1
mirror of https://github.com/StarWishsama/Slimefun4.git synced 2024-09-21 04:05:48 +00:00

Fixed some redundancies

This commit is contained in:
beSnow 2020-05-15 18:18:07 +02:00
parent ba886d275d
commit 6311f6ec2e
2 changed files with 18 additions and 29 deletions

View File

@ -266,35 +266,11 @@ public final class SlimefunItems {
public static final SlimefunItemStack BOOTS_OF_THE_STOMPER = new SlimefunItemStack("BOOTS_OF_THE_STOMPER", Material.LEATHER_BOOTS, Color.AQUA, "&bBoots of the Stomper", "", "&9All Fall Damage you receive", "&9will be applied to nearby Mobs/Players", "", "&9+ No Fall Damage");
public static final SlimefunItemStack BEE_HELMET;
public static final SlimefunItemStack BEE_WINGS;
public static final SlimefunItemStack BEE_LEGGINGS;
public static final SlimefunItemStack BEE_BOOTS;
public static final SlimefunItemStack BEE_HELMET = new SlimefunItemStack("BEE_HELMET", Material.GOLDEN_HELMET, "&e&lBee Helmet", " ", "&e&oNOT THE BEES");
public static final SlimefunItemStack BEE_WINGS = new SlimefunItemStack("BEE_WINGS", Material.ELYTRA, "&e&lBee Wings", " ", "&e&oFly Like a Bee", " ", "&9Activates Slow falling", "&9When approaching the ground", " ");
public static final SlimefunItemStack BEE_LEGGINGS = new SlimefunItemStack("BEE_LEGGINGS", Material.GOLDEN_LEGGINGS, "&e&lBee Leggings", " ", "&e&oBee like a Bee");
public static final SlimefunItemStack BEE_BOOTS = new SlimefunItemStack("BEE_BOOTS", Material.GOLDEN_BOOTS, "&e&lBee Boots", "", "&e&oNever have trouble taking off again", "", "&9+ Jump Boost", "&9+ No Fall Damage");
static {
if (SlimefunPlugin.getMinecraftVersion().isAtLeast(MinecraftVersion.MINECRAFT_1_15)) {
BEE_HELMET = new SlimefunItemStack("BEE_HELMET", Material.GOLDEN_HELMET, "&e&lBee Helmet", " ", "&e&oNOT THE BEES");
BEE_WINGS = new SlimefunItemStack("BEE_WINGS", Material.ELYTRA, "&e&lBee Wings", " ", "&e&oFly Like a Bee", " ", "&9Activates Slow falling", "&9When approaching the ground", " ");
BEE_LEGGINGS = new SlimefunItemStack("BEE_LEGGINGS", Material.GOLDEN_LEGGINGS, "&e&lBee Leggings", " ", "&e&oBee like a Bee");
BEE_BOOTS = new SlimefunItemStack("BEE_BOOTS", Material.GOLDEN_BOOTS, "&e&lBee Boots", "", "&e&oNever have trouble taking off again", "", "&9+ Jump Boost", "&9+ No Fall Damage");
Map<Enchantment, Integer> bee = new HashMap<>();
bee.put(Enchantment.DURABILITY, 4);
bee.put(Enchantment.PROTECTION_ENVIRONMENTAL, 2);
BEE_HELMET.addUnsafeEnchantments(bee);
BEE_WINGS.addUnsafeEnchantments(bee);
BEE_LEGGINGS.addUnsafeEnchantments(bee);
BEE_BOOTS.addUnsafeEnchantments(bee);
}
else {
BEE_HELMET = null;
BEE_WINGS = null;
BEE_LEGGINGS = null;
BEE_BOOTS = null;
}
}
static {
Map<Enchantment, Integer> cactus = new HashMap<>();
cactus.put(Enchantment.THORNS, 3);
@ -345,6 +321,15 @@ static {
SLIME_CHESTPLATE_STEEL.addUnsafeEnchantments(slime);
SLIME_LEGGINGS_STEEL.addUnsafeEnchantments(slime);
SLIME_BOOTS_STEEL.addUnsafeEnchantments(slime);
Map<Enchantment, Integer> bee = new HashMap<>();
bee.put(Enchantment.DURABILITY, 4);
bee.put(Enchantment.PROTECTION_ENVIRONMENTAL, 2);
BEE_HELMET.addUnsafeEnchantments(bee);
BEE_WINGS.addUnsafeEnchantments(bee);
BEE_LEGGINGS.addUnsafeEnchantments(bee);
BEE_BOOTS.addUnsafeEnchantments(bee);
}
/* Misc */

View File

@ -237,7 +237,6 @@ public final class SlimefunPlugin extends JavaPlugin implements SlimefunAddon {
new FireworksListener(this);
new WitherListener(this);
new IronGolemListener(this);
new BeeWingListener(this);
// Item-specific Listeners
new VampireBladeListener(this, (VampireBlade) SlimefunItems.BLADE_OF_VAMPIRES.getItem());
@ -270,6 +269,11 @@ public final class SlimefunPlugin extends JavaPlugin implements SlimefunAddon {
// Clear the Slimefun Guide History upon Player Leaving
new PlayerProfileListener(this);
// Listeners that only need to function in at least Minecraft version 1.15.X
if (SlimefunPlugin.getMinecraftVersion().isAtLeast(MinecraftVersion.MINECRAFT_1_15)) {
new BeeWingListener(this);
}
// Initiating various Stuff and all Items with a slightly delay (0ms after the Server finished loading)
Slimefun.runSync(new SlimefunStartupTask(this, () -> {
protections = new ProtectionManager(getServer());