I'm searching a way to literally shorten my code. For the moment my code is this;
if(getDashConfig().getBoolean("enchantments.multifirearrow.enabled")){
MultiFireArrow fire = new MultiFireArrow();
DashEnchant.getEnchants().put(1, fire);
DashEnchant.getStringEnchants().put("multifirearrow", fire);
if(debug()){
getLogger().info("MultiFireArrow enchant registred");
}
if(getDashConfig().getBoolean("enchantments.bolt.enabled")){
Bolt bolt = new Bolt();
DashEnchant.getEnchants().put(2, bolt);
DashEnchant.getStringEnchants().put("bolt", bolt);
if(debug()){ getLogger().info("Bolt enchant registred"); }
}
if(getDashConfig().getBoolean("enchantments.randomspeed.enabled")){
SpeedRandom speed = new SpeedRandom();
DashEnchant.getEnchants().put(3, speed);
DashEnchant.getStringEnchants().put("randomspeed", speed);
if(debug()){ getLogger().info("RandomSpeed enchant registred"); }
Not that presentable.. uh? How i would literally shorten it? I don't want 350 lines like that.
1
,2
, and3
come from, and what do they mean? So that we met advise you properly, please provide more context for this code. We can't necessarily improve it in isolation. See How to Ask. \$\endgroup\$