mirror of
https://github.com/StarWishsama/Slimefun4.git
synced 2024-09-20 11:45: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 {
|
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
|
* This constant represents Minecraft (Java Edition) Version 1.16
|
||||||
* (The "Nether Update")
|
* (The "Nether Update")
|
||||||
|
@ -630,18 +630,10 @@ public final class Slimefun extends JavaPlugin implements SlimefunAddon {
|
|||||||
new AutoCrafterListener(this);
|
new AutoCrafterListener(this);
|
||||||
new SlimefunItemHitListener(this);
|
new SlimefunItemHitListener(this);
|
||||||
new MiddleClickListener(this);
|
new MiddleClickListener(this);
|
||||||
|
|
||||||
// Bees were added in 1.15
|
|
||||||
if (minecraftVersion.isAtLeast(MinecraftVersion.MINECRAFT_1_15)) {
|
|
||||||
new BeeListener(this);
|
new BeeListener(this);
|
||||||
new BeeWingsListener(this, (BeeWings) SlimefunItems.BEE_WINGS.getItem());
|
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 PiglinListener(this);
|
||||||
new SmithingTableListener(this);
|
new SmithingTableListener(this);
|
||||||
}
|
|
||||||
|
|
||||||
// Item-specific Listeners
|
// Item-specific Listeners
|
||||||
new CoolerListener(this, (Cooler) SlimefunItems.COOLER.getItem());
|
new CoolerListener(this, (Cooler) SlimefunItems.COOLER.getItem());
|
||||||
|
@ -257,11 +257,8 @@ public final class SlimefunItems {
|
|||||||
hazmatLore.add("");
|
hazmatLore.add("");
|
||||||
hazmatLore.add(ChatColor.GOLD + "Full set effects:");
|
hazmatLore.add(ChatColor.GOLD + "Full set effects:");
|
||||||
hazmatLore.add(ChatColor.YELLOW + "- Radiation immunity");
|
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");
|
public static final SlimefunItemStack SCUBA_HELMET = new SlimefunItemStack("SCUBA_HELMET", Material.LEATHER_HELMET, Color.ORANGE, "&cScuba Helmet", "", "&7Allows you to breathe underwater");
|
||||||
public static final SlimefunItemStack HAZMAT_CHESTPLATE = new SlimefunItemStack("HAZMAT_CHESTPLATE", Material.LEATHER_CHESTPLATE, Color.ORANGE, "&cHazmat Suit", "", "&7Allows you to walk through fire and lava");
|
public static final SlimefunItemStack HAZMAT_CHESTPLATE = new SlimefunItemStack("HAZMAT_CHESTPLATE", Material.LEATHER_CHESTPLATE, Color.ORANGE, "&cHazmat Suit", "", "&7Allows you to walk through fire and lava");
|
||||||
|
@ -478,24 +478,15 @@ public abstract class AbstractAutoCrafter extends SlimefunItem implements Energy
|
|||||||
private ItemStack getLeftoverItem(@Nonnull ItemStack item) {
|
private ItemStack getLeftoverItem(@Nonnull ItemStack item) {
|
||||||
Material type = item.getType();
|
Material type = item.getType();
|
||||||
|
|
||||||
switch (type) {
|
return switch (type) {
|
||||||
case WATER_BUCKET:
|
case WATER_BUCKET,
|
||||||
case LAVA_BUCKET:
|
LAVA_BUCKET,
|
||||||
case MILK_BUCKET:
|
MILK_BUCKET -> new ItemStack(Material.BUCKET);
|
||||||
return new ItemStack(Material.BUCKET);
|
case DRAGON_BREATH,
|
||||||
case DRAGON_BREATH:
|
POTION,
|
||||||
case POTION:
|
HONEY_BOTTLE -> new ItemStack(Material.GLASS_BOTTLE);
|
||||||
return new ItemStack(Material.GLASS_BOTTLE);
|
default -> null;
|
||||||
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;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -63,17 +63,13 @@ public class BioGenerator extends AGenerator {
|
|||||||
registerFuel(new MachineFuel(1, new ItemStack(m)));
|
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(4, new ItemStack(Material.HONEYCOMB)));
|
||||||
registerFuel(new MachineFuel(40, new ItemStack(Material.HONEYCOMB_BLOCK)));
|
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(4, new ItemStack(Material.SHROOMLIGHT)));
|
||||||
registerFuel(new MachineFuel(2, new ItemStack(Material.CRIMSON_FUNGUS)));
|
registerFuel(new MachineFuel(2, new ItemStack(Material.CRIMSON_FUNGUS)));
|
||||||
registerFuel(new MachineFuel(2, new ItemStack(Material.WARPED_FUNGUS)));
|
registerFuel(new MachineFuel(2, new ItemStack(Material.WARPED_FUNGUS)));
|
||||||
registerFuel(new MachineFuel(16, SlimefunItems.STRANGE_NETHER_GOO));
|
registerFuel(new MachineFuel(16, SlimefunItems.STRANGE_NETHER_GOO));
|
||||||
}
|
|
||||||
|
|
||||||
if (Slimefun.getMinecraftVersion().isAtLeast(MinecraftVersion.MINECRAFT_1_17)) {
|
if (Slimefun.getMinecraftVersion().isAtLeast(MinecraftVersion.MINECRAFT_1_17)) {
|
||||||
registerFuel(new MachineFuel(2, new ItemStack(Material.GLOW_BERRIES)));
|
registerFuel(new MachineFuel(2, new ItemStack(Material.GLOW_BERRIES)));
|
||||||
|
@ -73,11 +73,7 @@ public class IronGolemAssembler extends AbstractEntityAssembler<IronGolem> {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public IronGolem spawnEntity(Location l) {
|
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);
|
return l.getWorld().spawn(l, IronGolem.class);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -90,11 +90,8 @@ public class MagicalZombiePills extends SimpleSlimefunItem<EntityInteractHandler
|
|||||||
|
|
||||||
private void healZombieVillager(@Nonnull ZombieVillager zombieVillager, @Nonnull Player p) {
|
private void healZombieVillager(@Nonnull ZombieVillager zombieVillager, @Nonnull Player p) {
|
||||||
zombieVillager.setConversionTime(1);
|
zombieVillager.setConversionTime(1);
|
||||||
|
|
||||||
if (Slimefun.getMinecraftVersion().isAtLeast(MinecraftVersion.MINECRAFT_1_15)) {
|
|
||||||
zombieVillager.setConversionPlayer(p);
|
zombieVillager.setConversionPlayer(p);
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
private void healZombifiedPiglin(@Nonnull PigZombie zombiePiglin) {
|
private void healZombifiedPiglin(@Nonnull PigZombie zombiePiglin) {
|
||||||
Location loc = zombiePiglin.getLocation();
|
Location loc = zombiePiglin.getLocation();
|
||||||
|
@ -254,7 +254,6 @@ public class ClimbingPick extends SimpleSlimefunItem<ItemUseHandler> implements
|
|||||||
if (version != MinecraftVersion.UNIT_TEST) {
|
if (version != MinecraftVersion.UNIT_TEST) {
|
||||||
p.getWorld().playEffect(b.getLocation(), Effect.STEP_SOUND, b.getType());
|
p.getWorld().playEffect(b.getLocation(), Effect.STEP_SOUND, b.getType());
|
||||||
|
|
||||||
if (version.isAtLeast(MinecraftVersion.MINECRAFT_1_15)) {
|
|
||||||
if (hand == EquipmentSlot.HAND) {
|
if (hand == EquipmentSlot.HAND) {
|
||||||
p.swingMainHand();
|
p.swingMainHand();
|
||||||
} else {
|
} else {
|
||||||
@ -262,7 +261,6 @@ public class ClimbingPick extends SimpleSlimefunItem<ItemUseHandler> implements
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public List<ItemStack> getDisplayRecipes() {
|
public List<ItemStack> getDisplayRecipes() {
|
||||||
|
@ -2584,7 +2584,6 @@ public final class SlimefunItemSetup {
|
|||||||
|
|
||||||
MinecraftVersion minecraftVersion = Slimefun.getMinecraftVersion();
|
MinecraftVersion minecraftVersion = Slimefun.getMinecraftVersion();
|
||||||
|
|
||||||
if (minecraftVersion.isAtLeast(MinecraftVersion.MINECRAFT_1_15)) {
|
|
||||||
new SlimefunItem(itemGroups.magicalArmor, SlimefunItems.BEE_HELMET, RecipeType.ARMOR_FORGE,
|
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})
|
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);
|
.register(plugin);
|
||||||
@ -2601,9 +2600,7 @@ public final class SlimefunItemSetup {
|
|||||||
new ItemStack[] {null, null, null, SlimefunItems.GOLD_8K, null, SlimefunItems.GOLD_8K, new ItemStack(Material.HONEY_BLOCK), null, new ItemStack(Material.HONEY_BLOCK)},
|
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)})
|
new PotionEffect[] {new PotionEffect(PotionEffectType.JUMP, 300, 2)})
|
||||||
.register(plugin);
|
.register(plugin);
|
||||||
}
|
|
||||||
|
|
||||||
if (minecraftVersion.isAtLeast(MinecraftVersion.MINECRAFT_1_16)) {
|
|
||||||
new VillagerRune(itemGroups.magicalResources, SlimefunItems.VILLAGER_RUNE, RecipeType.ANCIENT_ALTAR,
|
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 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))
|
new SlimefunItemStack(SlimefunItems.VILLAGER_RUNE, 3))
|
||||||
@ -2612,7 +2609,6 @@ public final class SlimefunItemSetup {
|
|||||||
new StrangeNetherGoo(itemGroups.magicalResources, SlimefunItems.STRANGE_NETHER_GOO, RecipeType.BARTER_DROP,
|
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})
|
new ItemStack[] {null, null, null, null, new CustomItemStack(HeadTexture.PIGLIN_HEAD.getAsItemStack(), "&fPiglin"), null, null, null, null})
|
||||||
.register(plugin);
|
.register(plugin);
|
||||||
}
|
|
||||||
|
|
||||||
new ElytraCap(itemGroups.magicalArmor, SlimefunItems.ELYTRA_CAP, RecipeType.ARMOR_FORGE,
|
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)})
|
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