mirror of
https://github.com/StarWishsama/Slimefun4.git
synced 2024-09-20 03:35:51 +00:00
Remove 1.14 & 1.15 from MinecraftVersion
This commit is contained in:
parent
5cd5f26c91
commit
dcc13a8f9a
@ -19,18 +19,6 @@ import io.papermc.lib.PaperLib;
|
||||
*/
|
||||
public enum MinecraftVersion {
|
||||
|
||||
/**
|
||||
* This constant represents Minecraft (Java Edition) Version 1.14
|
||||
* (The "Village & Pillage" Update)
|
||||
*/
|
||||
MINECRAFT_1_14(14, "1.14.x"),
|
||||
|
||||
/**
|
||||
* This constant represents Minecraft (Java Edition) Version 1.15
|
||||
* (The "Buzzy Bees" Update)
|
||||
*/
|
||||
MINECRAFT_1_15(15, "1.15.x"),
|
||||
|
||||
/**
|
||||
* This constant represents Minecraft (Java Edition) Version 1.16
|
||||
* (The "Nether Update")
|
||||
|
@ -630,18 +630,10 @@ public final class Slimefun extends JavaPlugin implements SlimefunAddon {
|
||||
new AutoCrafterListener(this);
|
||||
new SlimefunItemHitListener(this);
|
||||
new MiddleClickListener(this);
|
||||
|
||||
// Bees were added in 1.15
|
||||
if (minecraftVersion.isAtLeast(MinecraftVersion.MINECRAFT_1_15)) {
|
||||
new BeeListener(this);
|
||||
new BeeWingsListener(this, (BeeWings) SlimefunItems.BEE_WINGS.getItem());
|
||||
}
|
||||
|
||||
// Piglins were added in 1.16
|
||||
if (minecraftVersion.isAtLeast(MinecraftVersion.MINECRAFT_1_16)) {
|
||||
new PiglinListener(this);
|
||||
new SmithingTableListener(this);
|
||||
}
|
||||
new BeeListener(this);
|
||||
new BeeWingsListener(this, (BeeWings) SlimefunItems.BEE_WINGS.getItem());
|
||||
new PiglinListener(this);
|
||||
new SmithingTableListener(this);
|
||||
|
||||
// Item-specific Listeners
|
||||
new CoolerListener(this, (Cooler) SlimefunItems.COOLER.getItem());
|
||||
|
@ -257,10 +257,7 @@ public final class SlimefunItems {
|
||||
hazmatLore.add("");
|
||||
hazmatLore.add(ChatColor.GOLD + "Full set effects:");
|
||||
hazmatLore.add(ChatColor.YELLOW + "- Radiation immunity");
|
||||
|
||||
if (Slimefun.getMinecraftVersion().isAtLeast(MinecraftVersion.MINECRAFT_1_15)) {
|
||||
hazmatLore.add(ChatColor.YELLOW + "- Bee Sting protection");
|
||||
}
|
||||
hazmatLore.add(ChatColor.YELLOW + "- Bee Sting protection");
|
||||
}
|
||||
|
||||
public static final SlimefunItemStack SCUBA_HELMET = new SlimefunItemStack("SCUBA_HELMET", Material.LEATHER_HELMET, Color.ORANGE, "&cScuba Helmet", "", "&7Allows you to breathe underwater");
|
||||
|
@ -478,24 +478,15 @@ public abstract class AbstractAutoCrafter extends SlimefunItem implements Energy
|
||||
private ItemStack getLeftoverItem(@Nonnull ItemStack item) {
|
||||
Material type = item.getType();
|
||||
|
||||
switch (type) {
|
||||
case WATER_BUCKET:
|
||||
case LAVA_BUCKET:
|
||||
case MILK_BUCKET:
|
||||
return new ItemStack(Material.BUCKET);
|
||||
case DRAGON_BREATH:
|
||||
case POTION:
|
||||
return new ItemStack(Material.GLASS_BOTTLE);
|
||||
default:
|
||||
MinecraftVersion minecraftVersion = Slimefun.getMinecraftVersion();
|
||||
|
||||
// Honey does not exist in 1.14
|
||||
if (minecraftVersion.isAtLeast(MinecraftVersion.MINECRAFT_1_15) && type == Material.HONEY_BOTTLE) {
|
||||
return new ItemStack(Material.GLASS_BOTTLE);
|
||||
} else {
|
||||
return null;
|
||||
}
|
||||
}
|
||||
return switch (type) {
|
||||
case WATER_BUCKET,
|
||||
LAVA_BUCKET,
|
||||
MILK_BUCKET -> new ItemStack(Material.BUCKET);
|
||||
case DRAGON_BREATH,
|
||||
POTION,
|
||||
HONEY_BOTTLE -> new ItemStack(Material.GLASS_BOTTLE);
|
||||
default -> null;
|
||||
};
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -63,17 +63,13 @@ public class BioGenerator extends AGenerator {
|
||||
registerFuel(new MachineFuel(1, new ItemStack(m)));
|
||||
}
|
||||
|
||||
if (Slimefun.getMinecraftVersion().isAtLeast(MinecraftVersion.MINECRAFT_1_15)) {
|
||||
registerFuel(new MachineFuel(4, new ItemStack(Material.HONEYCOMB)));
|
||||
registerFuel(new MachineFuel(40, new ItemStack(Material.HONEYCOMB_BLOCK)));
|
||||
}
|
||||
registerFuel(new MachineFuel(4, new ItemStack(Material.HONEYCOMB)));
|
||||
registerFuel(new MachineFuel(40, new ItemStack(Material.HONEYCOMB_BLOCK)));
|
||||
|
||||
if (Slimefun.getMinecraftVersion().isAtLeast(MinecraftVersion.MINECRAFT_1_16)) {
|
||||
registerFuel(new MachineFuel(4, new ItemStack(Material.SHROOMLIGHT)));
|
||||
registerFuel(new MachineFuel(2, new ItemStack(Material.CRIMSON_FUNGUS)));
|
||||
registerFuel(new MachineFuel(2, new ItemStack(Material.WARPED_FUNGUS)));
|
||||
registerFuel(new MachineFuel(16, SlimefunItems.STRANGE_NETHER_GOO));
|
||||
}
|
||||
registerFuel(new MachineFuel(4, new ItemStack(Material.SHROOMLIGHT)));
|
||||
registerFuel(new MachineFuel(2, new ItemStack(Material.CRIMSON_FUNGUS)));
|
||||
registerFuel(new MachineFuel(2, new ItemStack(Material.WARPED_FUNGUS)));
|
||||
registerFuel(new MachineFuel(16, SlimefunItems.STRANGE_NETHER_GOO));
|
||||
|
||||
if (Slimefun.getMinecraftVersion().isAtLeast(MinecraftVersion.MINECRAFT_1_17)) {
|
||||
registerFuel(new MachineFuel(2, new ItemStack(Material.GLOW_BERRIES)));
|
||||
|
@ -73,11 +73,7 @@ public class IronGolemAssembler extends AbstractEntityAssembler<IronGolem> {
|
||||
|
||||
@Override
|
||||
public IronGolem spawnEntity(Location l) {
|
||||
if (Slimefun.getMinecraftVersion().isAtLeast(MinecraftVersion.MINECRAFT_1_15)) {
|
||||
// This sound doesn't exist in 1.14 and earlier :/
|
||||
l.getWorld().playSound(l, Sound.ENTITY_IRON_GOLEM_REPAIR, 0.5F, 1);
|
||||
}
|
||||
|
||||
l.getWorld().playSound(l, Sound.ENTITY_IRON_GOLEM_REPAIR, 0.5F, 1);
|
||||
return l.getWorld().spawn(l, IronGolem.class);
|
||||
}
|
||||
|
||||
|
@ -90,10 +90,7 @@ public class MagicalZombiePills extends SimpleSlimefunItem<EntityInteractHandler
|
||||
|
||||
private void healZombieVillager(@Nonnull ZombieVillager zombieVillager, @Nonnull Player p) {
|
||||
zombieVillager.setConversionTime(1);
|
||||
|
||||
if (Slimefun.getMinecraftVersion().isAtLeast(MinecraftVersion.MINECRAFT_1_15)) {
|
||||
zombieVillager.setConversionPlayer(p);
|
||||
}
|
||||
zombieVillager.setConversionPlayer(p);
|
||||
}
|
||||
|
||||
private void healZombifiedPiglin(@Nonnull PigZombie zombiePiglin) {
|
||||
|
@ -254,12 +254,10 @@ public class ClimbingPick extends SimpleSlimefunItem<ItemUseHandler> implements
|
||||
if (version != MinecraftVersion.UNIT_TEST) {
|
||||
p.getWorld().playEffect(b.getLocation(), Effect.STEP_SOUND, b.getType());
|
||||
|
||||
if (version.isAtLeast(MinecraftVersion.MINECRAFT_1_15)) {
|
||||
if (hand == EquipmentSlot.HAND) {
|
||||
p.swingMainHand();
|
||||
} else {
|
||||
p.swingOffHand();
|
||||
}
|
||||
if (hand == EquipmentSlot.HAND) {
|
||||
p.swingMainHand();
|
||||
} else {
|
||||
p.swingOffHand();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -2584,35 +2584,31 @@ public final class SlimefunItemSetup {
|
||||
|
||||
MinecraftVersion minecraftVersion = Slimefun.getMinecraftVersion();
|
||||
|
||||
if (minecraftVersion.isAtLeast(MinecraftVersion.MINECRAFT_1_15)) {
|
||||
new SlimefunItem(itemGroups.magicalArmor, SlimefunItems.BEE_HELMET, RecipeType.ARMOR_FORGE,
|
||||
new ItemStack[] {SlimefunItems.GOLD_8K, new ItemStack(Material.HONEY_BLOCK), SlimefunItems.GOLD_8K, new ItemStack(Material.HONEYCOMB_BLOCK), null, new ItemStack(Material.HONEYCOMB_BLOCK), null, null, null})
|
||||
.register(plugin);
|
||||
new SlimefunItem(itemGroups.magicalArmor, SlimefunItems.BEE_HELMET, RecipeType.ARMOR_FORGE,
|
||||
new ItemStack[] {SlimefunItems.GOLD_8K, new ItemStack(Material.HONEY_BLOCK), SlimefunItems.GOLD_8K, new ItemStack(Material.HONEYCOMB_BLOCK), null, new ItemStack(Material.HONEYCOMB_BLOCK), null, null, null})
|
||||
.register(plugin);
|
||||
|
||||
new BeeWings(itemGroups.magicalArmor, SlimefunItems.BEE_WINGS, RecipeType.ARMOR_FORGE,
|
||||
new ItemStack[] {SlimefunItems.GOLD_8K, null, SlimefunItems.GOLD_8K, new ItemStack(Material.HONEYCOMB_BLOCK), new ItemStack(Material.ELYTRA), new ItemStack(Material.HONEYCOMB_BLOCK), new ItemStack(Material.HONEY_BLOCK), SlimefunItems.GOLD_8K, new ItemStack(Material.HONEY_BLOCK)})
|
||||
.register(plugin);
|
||||
new BeeWings(itemGroups.magicalArmor, SlimefunItems.BEE_WINGS, RecipeType.ARMOR_FORGE,
|
||||
new ItemStack[] {SlimefunItems.GOLD_8K, null, SlimefunItems.GOLD_8K, new ItemStack(Material.HONEYCOMB_BLOCK), new ItemStack(Material.ELYTRA), new ItemStack(Material.HONEYCOMB_BLOCK), new ItemStack(Material.HONEY_BLOCK), SlimefunItems.GOLD_8K, new ItemStack(Material.HONEY_BLOCK)})
|
||||
.register(plugin);
|
||||
|
||||
new SlimefunItem(itemGroups.magicalArmor, SlimefunItems.BEE_LEGGINGS, RecipeType.ARMOR_FORGE,
|
||||
new ItemStack[] {SlimefunItems.GOLD_8K, new ItemStack(Material.HONEY_BLOCK), SlimefunItems.GOLD_8K, new ItemStack(Material.HONEYCOMB_BLOCK), null, new ItemStack(Material.HONEYCOMB_BLOCK), new ItemStack(Material.HONEYCOMB_BLOCK), null, new ItemStack(Material.HONEYCOMB_BLOCK)})
|
||||
.register(plugin);
|
||||
new SlimefunItem(itemGroups.magicalArmor, SlimefunItems.BEE_LEGGINGS, RecipeType.ARMOR_FORGE,
|
||||
new ItemStack[] {SlimefunItems.GOLD_8K, new ItemStack(Material.HONEY_BLOCK), SlimefunItems.GOLD_8K, new ItemStack(Material.HONEYCOMB_BLOCK), null, new ItemStack(Material.HONEYCOMB_BLOCK), new ItemStack(Material.HONEYCOMB_BLOCK), null, new ItemStack(Material.HONEYCOMB_BLOCK)})
|
||||
.register(plugin);
|
||||
|
||||
new LongFallBoots(itemGroups.magicalArmor, SlimefunItems.BEE_BOOTS, RecipeType.ARMOR_FORGE,
|
||||
new ItemStack[] {null, null, null, SlimefunItems.GOLD_8K, null, SlimefunItems.GOLD_8K, new ItemStack(Material.HONEY_BLOCK), null, new ItemStack(Material.HONEY_BLOCK)},
|
||||
new PotionEffect[] {new PotionEffect(PotionEffectType.JUMP, 300, 2)})
|
||||
.register(plugin);
|
||||
}
|
||||
new LongFallBoots(itemGroups.magicalArmor, SlimefunItems.BEE_BOOTS, RecipeType.ARMOR_FORGE,
|
||||
new ItemStack[] {null, null, null, SlimefunItems.GOLD_8K, null, SlimefunItems.GOLD_8K, new ItemStack(Material.HONEY_BLOCK), null, new ItemStack(Material.HONEY_BLOCK)},
|
||||
new PotionEffect[] {new PotionEffect(PotionEffectType.JUMP, 300, 2)})
|
||||
.register(plugin);
|
||||
|
||||
if (minecraftVersion.isAtLeast(MinecraftVersion.MINECRAFT_1_16)) {
|
||||
new VillagerRune(itemGroups.magicalResources, SlimefunItems.VILLAGER_RUNE, RecipeType.ANCIENT_ALTAR,
|
||||
new ItemStack[] {SlimefunItems.MAGIC_LUMP_3, SlimefunItems.MAGICAL_GLASS, new ItemStack(Material.CRYING_OBSIDIAN), SlimefunItems.STRANGE_NETHER_GOO, SlimefunItems.FIRE_RUNE, SlimefunItems.STRANGE_NETHER_GOO, new ItemStack(Material.CRYING_OBSIDIAN), SlimefunItems.MAGICAL_GLASS, SlimefunItems.MAGIC_LUMP_3},
|
||||
new SlimefunItemStack(SlimefunItems.VILLAGER_RUNE, 3))
|
||||
.register(plugin);
|
||||
new VillagerRune(itemGroups.magicalResources, SlimefunItems.VILLAGER_RUNE, RecipeType.ANCIENT_ALTAR,
|
||||
new ItemStack[] {SlimefunItems.MAGIC_LUMP_3, SlimefunItems.MAGICAL_GLASS, new ItemStack(Material.CRYING_OBSIDIAN), SlimefunItems.STRANGE_NETHER_GOO, SlimefunItems.FIRE_RUNE, SlimefunItems.STRANGE_NETHER_GOO, new ItemStack(Material.CRYING_OBSIDIAN), SlimefunItems.MAGICAL_GLASS, SlimefunItems.MAGIC_LUMP_3},
|
||||
new SlimefunItemStack(SlimefunItems.VILLAGER_RUNE, 3))
|
||||
.register(plugin);
|
||||
|
||||
new StrangeNetherGoo(itemGroups.magicalResources, SlimefunItems.STRANGE_NETHER_GOO, RecipeType.BARTER_DROP,
|
||||
new ItemStack[] {null, null, null, null, new CustomItemStack(HeadTexture.PIGLIN_HEAD.getAsItemStack(), "&fPiglin"), null, null, null, null})
|
||||
.register(plugin);
|
||||
}
|
||||
new StrangeNetherGoo(itemGroups.magicalResources, SlimefunItems.STRANGE_NETHER_GOO, RecipeType.BARTER_DROP,
|
||||
new ItemStack[] {null, null, null, null, new CustomItemStack(HeadTexture.PIGLIN_HEAD.getAsItemStack(), "&fPiglin"), null, null, null, null})
|
||||
.register(plugin);
|
||||
|
||||
new ElytraCap(itemGroups.magicalArmor, SlimefunItems.ELYTRA_CAP, RecipeType.ARMOR_FORGE,
|
||||
new ItemStack[] {new ItemStack(Material.SLIME_BALL), new ItemStack(Material.SLIME_BALL), new ItemStack(Material.SLIME_BALL), SlimefunItems.ELYTRA_SCALE, SlimefunItems.ELYTRA_SCALE, SlimefunItems.ELYTRA_SCALE, new ItemStack(Material.SLIME_BALL), new ItemStack(Material.LEATHER_HELMET), new ItemStack(Material.SLIME_BALL)})
|
||||
|
Loading…
Reference in New Issue
Block a user