From 6ffa5ab9a7d42e1cb40b2d56720f41564198bc58 Mon Sep 17 00:00:00 2001 From: TheBusyBiscuit Date: Fri, 26 Jun 2020 15:32:57 +0200 Subject: [PATCH 01/24] Lots of refactoring and rewriting of Item Energy --- CHANGELOG.md | 1 + .../core/attributes/Rechargeable.java | 145 ++++++++++++++++++ .../core/attributes/RechargeableHelper.java | 73 +++++++++ .../items/electric/gadgets/JetBoots.java | 14 +- .../items/electric/gadgets/Jetpack.java | 14 +- .../items/electric/gadgets/MultiTool.java | 21 +-- .../items/electric/gadgets/SolarHelmet.java | 36 ++++- .../items/electric/machines/AutoBrewer.java | 28 ++-- .../electric/machines/ChargingBench.java | 39 +++-- .../listeners/GadgetsListener.java | 4 +- .../setup/SlimefunItemSetup.java | 57 ++++--- .../implementation/tasks/ArmorTask.java | 16 +- .../implementation/tasks/JetBootsTask.java | 27 ++-- .../implementation/tasks/JetpackTask.java | 22 +-- .../slimefun4/utils/NumberUtils.java | 4 + .../Objects/SlimefunItem/ChargableItem.java | 20 ++- .../Objects/SlimefunItem/SlimefunItem.java | 7 +- .../Slimefun/api/energy/ItemEnergy.java | 9 ++ 18 files changed, 417 insertions(+), 120 deletions(-) create mode 100644 src/main/java/io/github/thebusybiscuit/slimefun4/core/attributes/Rechargeable.java create mode 100644 src/main/java/io/github/thebusybiscuit/slimefun4/core/attributes/RechargeableHelper.java diff --git a/CHANGELOG.md b/CHANGELOG.md index 517599a59..595dcb80f 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -46,6 +46,7 @@ * items which cannot be distributed by a Cargo Net will be dropped on the ground now instead of getting deleted * Small performance improvements to the Cargo Net * Slimefun no longer supports CraftBukkit +* Item Energy is now also stored persistently via NBT #### Fixes * Fixed #2005 diff --git a/src/main/java/io/github/thebusybiscuit/slimefun4/core/attributes/Rechargeable.java b/src/main/java/io/github/thebusybiscuit/slimefun4/core/attributes/Rechargeable.java new file mode 100644 index 000000000..73205a28d --- /dev/null +++ b/src/main/java/io/github/thebusybiscuit/slimefun4/core/attributes/Rechargeable.java @@ -0,0 +1,145 @@ +package io.github.thebusybiscuit.slimefun4.core.attributes; + +import org.bukkit.Material; +import org.bukkit.inventory.ItemStack; +import org.bukkit.inventory.meta.ItemMeta; + +import io.github.thebusybiscuit.slimefun4.core.networks.energy.EnergyNet; +import io.github.thebusybiscuit.slimefun4.implementation.items.electric.gadgets.Jetpack; +import io.github.thebusybiscuit.slimefun4.implementation.items.electric.gadgets.MultiTool; +import io.github.thebusybiscuit.slimefun4.implementation.items.electric.machines.ChargingBench; +import me.mrCookieSlime.Slimefun.Objects.SlimefunItem.SlimefunItem; + +/** + * A {@link Rechargeable} {@link SlimefunItem} can hold energy and is able to + * be recharged using a {@link ChargingBench}. + * Any {@link SlimefunItem} which is supposed to be chargeable must implement this interface. + * + * @author TheBusyBiscuit + * + * @see ChargingBench + * @see EnergyNet + * @see Jetpack + * @see MultiTool + * + */ +@FunctionalInterface +public interface Rechargeable extends ItemAttribute { + + /** + * This method returns the maximum charge the given {@link ItemStack} is capable of holding. + * + * @param item + * The {@link ItemStack} for which to determine the maximum charge + * + * @return The maximum energy charge for this {@link ItemStack} + */ + float getMaxItemCharge(ItemStack item); + + /** + * This method sets the stored energy charge for a given {@link ItemStack}. + * The charge must be at least zero and at most {@link #getMaxItemCharge(ItemStack)}. + * + * @param item + * The {@link ItemStack} to charge + * @param charge + * The amount of charge to store + */ + default void setItemCharge(ItemStack item, float charge) { + if (item == null || item.getType() == Material.AIR) { + throw new IllegalArgumentException("Cannot set an Item charge for null or air"); + } + + float maximum = getMaxItemCharge(item); + + if (charge <= 0 || charge >= maximum) { + throw new IllegalArgumentException("Charge must be between zero and " + maximum + "."); + } + + ItemMeta meta = item.getItemMeta(); + RechargeableHelper.setCharge(meta, charge, maximum); + item.setItemMeta(meta); + } + + /** + * This method returns the currently stored energy charge on the provided {@link ItemStack}. + * + * @param item + * The {@link ItemStack} to get the charge from + * + * @return The charge stored on this {@link ItemStack} + */ + default float getItemCharge(ItemStack item) { + if (item == null || item.getType() == Material.AIR || !item.hasItemMeta()) { + throw new IllegalArgumentException("Cannot get the Item charge for invalid items (null, air or no ItemMeta)"); + } + + return RechargeableHelper.getCharge(item.getItemMeta()); + } + + /** + * This method adds the given charge to the provided {@link ItemStack}. + * The method will also return whether this operation was successful. + * If the {@link ItemStack} is already at maximum charge, the method will return false. + * + * @param item + * The {@link ItemStack} to charge + * @param charge + * The amount of charge to add + * + * @return Whether the given charge could be added successfully + */ + default boolean addItemCharge(ItemStack item, float charge) { + if (item == null || item.getType() == Material.AIR || !item.hasItemMeta()) { + throw new IllegalArgumentException("Cannot add Item charge for invalid items (null, air or no ItemMeta)"); + } + + ItemMeta meta = item.getItemMeta(); + float currentCharge = RechargeableHelper.getCharge(meta); + float maximum = getMaxItemCharge(item); + + // If the item is already fully charged, we abort. + if (currentCharge >= maximum) { + return false; + } + + float newCharge = Math.min(currentCharge + charge, maximum); + RechargeableHelper.setCharge(meta, newCharge, maximum); + + item.setItemMeta(meta); + return true; + } + + /** + * This method removes the given charge to the provided {@link ItemStack}. + * The method will also return whether this operation was successful. + * If the {@link ItemStack} does not have enough charge, the method will return false. + * + * @param item + * The {@link ItemStack} to remove the charge from + * @param charge + * The amount of charge to remove + * + * @return Whether the given charge could be removed successfully + */ + default boolean removeItemCharge(ItemStack item, float charge) { + if (item == null || item.getType() == Material.AIR || !item.hasItemMeta()) { + throw new IllegalArgumentException("Cannot remove Item charge for invalid items (null, air or no ItemMeta)"); + } + + ItemMeta meta = item.getItemMeta(); + float currentCharge = RechargeableHelper.getCharge(meta); + + // If the item does not have enough charge, we abort + if (currentCharge < charge) { + return false; + } + + float newCharge = Math.max(currentCharge - charge, 0); + RechargeableHelper.setCharge(meta, newCharge, getMaxItemCharge(item)); + + item.setItemMeta(meta); + return true; + } + +} diff --git a/src/main/java/io/github/thebusybiscuit/slimefun4/core/attributes/RechargeableHelper.java b/src/main/java/io/github/thebusybiscuit/slimefun4/core/attributes/RechargeableHelper.java new file mode 100644 index 000000000..e4bd282d1 --- /dev/null +++ b/src/main/java/io/github/thebusybiscuit/slimefun4/core/attributes/RechargeableHelper.java @@ -0,0 +1,73 @@ +package io.github.thebusybiscuit.slimefun4.core.attributes; + +import java.math.BigDecimal; +import java.math.RoundingMode; +import java.util.List; + +import org.bukkit.NamespacedKey; +import org.bukkit.inventory.meta.ItemMeta; +import org.bukkit.persistence.PersistentDataType; + +import io.github.thebusybiscuit.cscorelib2.chat.ChatColors; +import io.github.thebusybiscuit.slimefun4.api.MinecraftVersion; +import io.github.thebusybiscuit.slimefun4.utils.PatternUtils; +import me.mrCookieSlime.Slimefun.SlimefunPlugin; + +/** + * This is just a simple helper class to provide static methods to the {@link Rechargeable} + * interface. + * + * @author TheBusyBiscuit + * + * @see Rechargeable + * + */ +final class RechargeableHelper { + + private static final NamespacedKey CHARGE_KEY = new NamespacedKey(SlimefunPlugin.instance, "item_charge"); + private static final String LORE_PREFIX = ChatColors.color("&c&o&8\u21E8 &e\u26A1 &7"); + + private RechargeableHelper() {} + + static void setCharge(ItemMeta meta, float charge, float capacity) { + BigDecimal decimal = BigDecimal.valueOf(charge).setScale(2, RoundingMode.HALF_UP); + float value = decimal.floatValue(); + + if (SlimefunPlugin.getMinecraftVersion().isAtLeast(MinecraftVersion.MINECRAFT_1_14)) { + meta.getPersistentDataContainer().set(CHARGE_KEY, PersistentDataType.FLOAT, value); + } + + List lore = meta.getLore(); + for (int i = 0; i < lore.size(); i++) { + String line = lore.get(i); + + if (line.startsWith(LORE_PREFIX)) { + lore.set(i, LORE_PREFIX + value + " / " + capacity + " J"); + meta.setLore(lore); + return; + } + } + } + + static float getCharge(ItemMeta meta) { + if (SlimefunPlugin.getMinecraftVersion().isAtLeast(MinecraftVersion.MINECRAFT_1_14)) { + Float value = meta.getPersistentDataContainer().get(CHARGE_KEY, PersistentDataType.FLOAT); + + // If no persistent data exists, we will just fall back to the lore + if (value != null) { + return value; + } + } + + if (meta.hasLore()) { + for (String line : meta.getLore()) { + if (line.startsWith(LORE_PREFIX) && line.contains(" / ") && line.endsWith(" J")) { + return Float.parseFloat(PatternUtils.SLASH_SEPARATOR.split(line)[0].replace(LORE_PREFIX, "")); + } + } + } + + return 0; + } + +} diff --git a/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/items/electric/gadgets/JetBoots.java b/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/items/electric/gadgets/JetBoots.java index 8b1a62c48..a28dc115a 100644 --- a/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/items/electric/gadgets/JetBoots.java +++ b/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/items/electric/gadgets/JetBoots.java @@ -2,23 +2,31 @@ package io.github.thebusybiscuit.slimefun4.implementation.items.electric.gadgets import org.bukkit.inventory.ItemStack; +import io.github.thebusybiscuit.slimefun4.core.attributes.Rechargeable; import me.mrCookieSlime.Slimefun.Lists.RecipeType; import me.mrCookieSlime.Slimefun.Objects.Category; -import me.mrCookieSlime.Slimefun.Objects.SlimefunItem.ChargableItem; +import me.mrCookieSlime.Slimefun.Objects.SlimefunItem.SlimefunItem; import me.mrCookieSlime.Slimefun.api.SlimefunItemStack; -public class JetBoots extends ChargableItem { +public class JetBoots extends SlimefunItem implements Rechargeable { private final double speed; + private final float capacity; - public JetBoots(Category category, SlimefunItemStack item, ItemStack[] recipe, double speed) { + public JetBoots(Category category, SlimefunItemStack item, ItemStack[] recipe, double speed, float capacity) { super(category, item, RecipeType.ENHANCED_CRAFTING_TABLE, recipe); this.speed = speed; + this.capacity = capacity; } public double getSpeed() { return speed; } + @Override + public float getMaxItemCharge(ItemStack item) { + return capacity; + } + } diff --git a/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/items/electric/gadgets/Jetpack.java b/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/items/electric/gadgets/Jetpack.java index 0e59465bf..9131a16c5 100644 --- a/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/items/electric/gadgets/Jetpack.java +++ b/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/items/electric/gadgets/Jetpack.java @@ -2,23 +2,31 @@ package io.github.thebusybiscuit.slimefun4.implementation.items.electric.gadgets import org.bukkit.inventory.ItemStack; +import io.github.thebusybiscuit.slimefun4.core.attributes.Rechargeable; import me.mrCookieSlime.Slimefun.Lists.RecipeType; import me.mrCookieSlime.Slimefun.Objects.Category; -import me.mrCookieSlime.Slimefun.Objects.SlimefunItem.ChargableItem; +import me.mrCookieSlime.Slimefun.Objects.SlimefunItem.SlimefunItem; import me.mrCookieSlime.Slimefun.api.SlimefunItemStack; -public class Jetpack extends ChargableItem { +public class Jetpack extends SlimefunItem implements Rechargeable { private final double thrust; + private final float capacity; - public Jetpack(Category category, SlimefunItemStack item, ItemStack[] recipe, double thrust) { + public Jetpack(Category category, SlimefunItemStack item, ItemStack[] recipe, double thrust, float capacity) { super(category, item, RecipeType.ENHANCED_CRAFTING_TABLE, recipe); this.thrust = thrust; + this.capacity = capacity; } public double getThrust() { return thrust; } + @Override + public float getMaxItemCharge(ItemStack item) { + return capacity; + } + } diff --git a/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/items/electric/gadgets/MultiTool.java b/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/items/electric/gadgets/MultiTool.java index 33469534e..9fd98d226 100644 --- a/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/items/electric/gadgets/MultiTool.java +++ b/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/items/electric/gadgets/MultiTool.java @@ -10,29 +10,36 @@ import org.bukkit.ChatColor; import org.bukkit.entity.Player; import org.bukkit.inventory.ItemStack; +import io.github.thebusybiscuit.slimefun4.core.attributes.Rechargeable; import me.mrCookieSlime.Slimefun.SlimefunPlugin; import me.mrCookieSlime.Slimefun.Lists.RecipeType; import me.mrCookieSlime.Slimefun.Objects.Category; -import me.mrCookieSlime.Slimefun.Objects.SlimefunItem.ChargableItem; import me.mrCookieSlime.Slimefun.Objects.SlimefunItem.SlimefunItem; import me.mrCookieSlime.Slimefun.Objects.handlers.BlockBreakHandler; import me.mrCookieSlime.Slimefun.Objects.handlers.ItemUseHandler; import me.mrCookieSlime.Slimefun.api.SlimefunItemStack; -import me.mrCookieSlime.Slimefun.api.energy.ItemEnergy; -public class MultiTool extends ChargableItem { +public class MultiTool extends SlimefunItem implements Rechargeable { private static final float COST = 0.3F; private final Map selectedMode = new HashMap<>(); private final List modes = new ArrayList<>(); + private final float capacity; - public MultiTool(Category category, SlimefunItemStack item, RecipeType recipeType, ItemStack[] recipe, String... items) { + public MultiTool(Category category, SlimefunItemStack item, RecipeType recipeType, ItemStack[] recipe, float capacity, String... items) { super(category, item, recipeType, recipe); for (int i = 0; i < items.length; i++) { modes.add(new MultiToolMode(this, i, items[i])); } + + this.capacity = capacity; + } + + @Override + public float getMaxItemCharge(ItemStack item) { + return capacity; } protected ItemUseHandler getItemUseHandler() { @@ -44,11 +51,7 @@ public class MultiTool extends ChargableItem { int index = selectedMode.getOrDefault(p.getUniqueId(), 0); if (!p.isSneaking()) { - float charge = ItemEnergy.getStoredEnergy(item); - - if (charge >= COST) { - ItemEnergy.chargeItem(item, -COST); - + if (removeItemCharge(item, -COST)) { SlimefunItem sfItem = modes.get(index).getItem(); if (sfItem != null) { diff --git a/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/items/electric/gadgets/SolarHelmet.java b/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/items/electric/gadgets/SolarHelmet.java index 953d9013c..3c24a6cf5 100644 --- a/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/items/electric/gadgets/SolarHelmet.java +++ b/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/items/electric/gadgets/SolarHelmet.java @@ -1,25 +1,53 @@ package io.github.thebusybiscuit.slimefun4.implementation.items.electric.gadgets; +import org.bukkit.entity.Player; import org.bukkit.inventory.ItemStack; import io.github.thebusybiscuit.slimefun4.api.items.ItemSetting; +import io.github.thebusybiscuit.slimefun4.core.attributes.Rechargeable; +import io.github.thebusybiscuit.slimefun4.implementation.tasks.ArmorTask; import me.mrCookieSlime.Slimefun.Lists.RecipeType; import me.mrCookieSlime.Slimefun.Objects.Category; import me.mrCookieSlime.Slimefun.Objects.SlimefunItem.SlimefunItem; import me.mrCookieSlime.Slimefun.api.SlimefunItemStack; +/** + * The {@link SolarHelmet} can be worn by {@link Player}. + * As long as that {@link Player} has contact with sunlight, the helmet will charge any + * {@link Rechargeable} {@link SlimefunItem} that this {@link Player} is currently wearing + * or holding. + * + * @author TheBusyBiscuit + * + * @see ArmorTask + * @see Rechargeable + * + */ public class SolarHelmet extends SlimefunItem { - private final ItemSetting chargeSetting = new ItemSetting<>("charge-amount", 0.1); + private final ItemSetting charge = new ItemSetting<>("charge-amount", 0.1); public SolarHelmet(Category category, SlimefunItemStack item, RecipeType recipeType, ItemStack[] recipe) { super(category, item, recipeType, recipe, null); - addItemSetting(chargeSetting); + addItemSetting(charge); } - public double getChargeAmount() { - return chargeSetting.getValue(); + public void chargeItems(Player p) { + recharge(p.getInventory().getHelmet()); + recharge(p.getInventory().getChestplate()); + recharge(p.getInventory().getLeggings()); + recharge(p.getInventory().getBoots()); + recharge(p.getInventory().getItemInMainHand()); + recharge(p.getInventory().getItemInOffHand()); + } + + private void recharge(ItemStack item) { + SlimefunItem sfItem = SlimefunItem.getByItem(item); + + if (sfItem instanceof Rechargeable) { + ((Rechargeable) sfItem).addItemCharge(item, charge.getValue().floatValue()); + } } } diff --git a/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/items/electric/machines/AutoBrewer.java b/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/items/electric/machines/AutoBrewer.java index d7e43cce9..e6915a671 100644 --- a/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/items/electric/machines/AutoBrewer.java +++ b/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/items/electric/machines/AutoBrewer.java @@ -29,7 +29,7 @@ import me.mrCookieSlime.Slimefun.api.inventory.BlockMenu; * @author Linox * */ -public class AutoBrewer extends AContainer { +public abstract class AutoBrewer extends AContainer { private static final Map potionRecipes = new EnumMap<>(Material.class); private static final Map fermentations = new EnumMap<>(PotionType.class); @@ -122,15 +122,14 @@ public class AutoBrewer extends AContainer { ItemStack potionItem = slot ? input1 : input2; ItemStack ingredient = slot ? input2 : input1; - PotionMeta potion = (PotionMeta) potionItem.getItemMeta(); - // Reject any named items if (ingredient.hasItemMeta()) { return null; } - PotionData potionData = potion.getBasePotionData(); - ItemStack output = brew(ingredient.getType(), potionItem.getType(), potion, potionData); + PotionMeta potion = (PotionMeta) potionItem.getItemMeta(); + + ItemStack output = brew(ingredient.getType(), potionItem.getType(), potion); if (output == null) { return null; @@ -144,8 +143,10 @@ public class AutoBrewer extends AContainer { } } - private ItemStack brew(Material input, Material potionType, PotionMeta potion, PotionData potionData) { - if (potionData.getType() == PotionType.WATER) { + private ItemStack brew(Material input, Material potionType, PotionMeta potion) { + PotionData data = potion.getBasePotionData(); + + if (data.getType() == PotionType.WATER) { if (input == Material.FERMENTED_SPIDER_EYE) { potion.setBasePotionData(new PotionData(PotionType.WEAKNESS, false, false)); return new ItemStack(potionType); @@ -166,18 +167,18 @@ public class AutoBrewer extends AContainer { } else if (input == Material.FERMENTED_SPIDER_EYE) { - potion.setBasePotionData(new PotionData(fermentations.get(potionData.getType()), false, false)); + potion.setBasePotionData(new PotionData(fermentations.get(data.getType()), false, false)); return new ItemStack(potionType); } else if (input == Material.REDSTONE) { - potion.setBasePotionData(new PotionData(potionData.getType(), true, potionData.isUpgraded())); + potion.setBasePotionData(new PotionData(data.getType(), true, data.isUpgraded())); return new ItemStack(potionType); } else if (input == Material.GLOWSTONE_DUST) { - potion.setBasePotionData(new PotionData(potionData.getType(), potionData.isExtended(), true)); + potion.setBasePotionData(new PotionData(data.getType(), data.isExtended(), true)); return new ItemStack(potionType); } - else if (potionData.getType() == PotionType.AWKWARD && potionRecipes.containsKey(input)) { + else if (data.getType() == PotionType.AWKWARD && potionRecipes.containsKey(input)) { potion.setBasePotionData(new PotionData(potionRecipes.get(input), false, false)); return new ItemStack(potionType); } @@ -213,11 +214,6 @@ public class AutoBrewer extends AContainer { return 6; } - @Override - public int getSpeed() { - return 1; - } - @Override public String getMachineIdentifier() { return "AUTO_BREWER"; diff --git a/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/items/electric/machines/ChargingBench.java b/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/items/electric/machines/ChargingBench.java index f06c0f7e9..59ecfbc9b 100644 --- a/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/items/electric/machines/ChargingBench.java +++ b/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/items/electric/machines/ChargingBench.java @@ -4,13 +4,14 @@ import org.bukkit.Material; import org.bukkit.block.Block; import org.bukkit.inventory.ItemStack; +import io.github.thebusybiscuit.slimefun4.core.attributes.Rechargeable; import me.mrCookieSlime.Slimefun.Lists.RecipeType; import me.mrCookieSlime.Slimefun.Objects.Category; +import me.mrCookieSlime.Slimefun.Objects.SlimefunItem.SlimefunItem; import me.mrCookieSlime.Slimefun.Objects.SlimefunItem.abstractItems.AContainer; import me.mrCookieSlime.Slimefun.api.BlockStorage; import me.mrCookieSlime.Slimefun.api.SlimefunItemStack; import me.mrCookieSlime.Slimefun.api.energy.ChargableBlock; -import me.mrCookieSlime.Slimefun.api.energy.ItemEnergy; import me.mrCookieSlime.Slimefun.api.inventory.BlockMenu; public class ChargingBench extends AContainer { @@ -50,38 +51,34 @@ public class ChargingBench extends AContainer { for (int slot : getInputSlots()) { ItemStack item = inv.getItemInSlot(slot); - if (ItemEnergy.getMaxEnergy(item) > 0) { - charge(b, inv, slot, item); + if (charge(b, inv, slot, item)) { return; } } } - private void charge(Block b, BlockMenu inv, int slot, ItemStack item) { - if (ItemEnergy.getStoredEnergy(item) < ItemEnergy.getMaxEnergy(item)) { - ChargableBlock.addCharge(b, -getEnergyConsumption()); - float rest = ItemEnergy.addStoredEnergy(item, getEnergyConsumption() / 2F); + private boolean charge(Block b, BlockMenu inv, int slot, ItemStack item) { + SlimefunItem sfItem = SlimefunItem.getByItem(item); - if (rest > 0F) { - if (inv.fits(item, getOutputSlots())) { - inv.pushItem(item, getOutputSlots()); - inv.replaceExistingItem(slot, null); - } - else { - inv.replaceExistingItem(slot, item); - } + if (sfItem instanceof Rechargeable) { + float charge = getEnergyConsumption() / 2F; + + if (((Rechargeable) sfItem).addItemCharge(item, charge)) { + ChargableBlock.addCharge(b, -getEnergyConsumption()); } - else { - inv.replaceExistingItem(slot, item); + else if (inv.fits(item, getOutputSlots())) { + inv.pushItem(item, getOutputSlots()); + inv.replaceExistingItem(slot, null); } + + return true; } - else if (inv.fits(item, getOutputSlots())) { + else if (sfItem != null && inv.fits(item, getOutputSlots())) { inv.pushItem(item, getOutputSlots()); inv.replaceExistingItem(slot, null); } - else { - inv.replaceExistingItem(slot, item); - } + + return false; } @Override diff --git a/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/listeners/GadgetsListener.java b/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/listeners/GadgetsListener.java index 34fd363f2..c9a93fc53 100644 --- a/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/listeners/GadgetsListener.java +++ b/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/listeners/GadgetsListener.java @@ -72,7 +72,7 @@ public class GadgetsListener implements Listener { double thrust = ((Jetpack) chestplate).getThrust(); if (thrust > 0.2) { - new JetpackTask(p, thrust).scheduleRepeating(0, 3); + new JetpackTask(p, (Jetpack) chestplate).scheduleRepeating(0, 3); } } else if (chestplate instanceof Parachute) { @@ -85,7 +85,7 @@ public class GadgetsListener implements Listener { double speed = ((JetBoots) boots).getSpeed(); if (speed > 0.2) { - new JetBootsTask(p, speed).scheduleRepeating(0, 2); + new JetBootsTask(p, (JetBoots) boots).scheduleRepeating(0, 2); } } } diff --git a/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/setup/SlimefunItemSetup.java b/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/setup/SlimefunItemSetup.java index 416bb34f5..a7a2dbc63 100644 --- a/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/setup/SlimefunItemSetup.java +++ b/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/setup/SlimefunItemSetup.java @@ -599,37 +599,37 @@ public final class SlimefunItemSetup { new Jetpack(categories.technicalGadgets, SlimefunItems.DURALUMIN_JETPACK, new ItemStack[] {SlimefunItems.DURALUMIN_INGOT, null, SlimefunItems.DURALUMIN_INGOT, SlimefunItems.DURALUMIN_INGOT, SlimefunItems.POWER_CRYSTAL, SlimefunItems.DURALUMIN_INGOT, SlimefunItems.STEEL_THRUSTER, SlimefunItems.SMALL_CAPACITOR, SlimefunItems.STEEL_THRUSTER}, - 0.35) + 0.35, 20) .register(plugin); new Jetpack(categories.technicalGadgets, SlimefunItems.SOLDER_JETPACK, new ItemStack[] {SlimefunItems.SOLDER_INGOT, null, SlimefunItems.SOLDER_INGOT, SlimefunItems.SOLDER_INGOT, SlimefunItems.POWER_CRYSTAL, SlimefunItems.SOLDER_INGOT, SlimefunItems.STEEL_THRUSTER, SlimefunItems.SMALL_CAPACITOR, SlimefunItems.STEEL_THRUSTER}, - 0.4) + 0.4, 30) .register(plugin); new Jetpack(categories.technicalGadgets, SlimefunItems.BILLON_JETPACK, new ItemStack[] {SlimefunItems.BILLON_INGOT, null, SlimefunItems.BILLON_INGOT, SlimefunItems.BILLON_INGOT, SlimefunItems.POWER_CRYSTAL, SlimefunItems.BILLON_INGOT, SlimefunItems.STEEL_THRUSTER, SlimefunItems.SMALL_CAPACITOR, SlimefunItems.STEEL_THRUSTER}, - 0.45) + 0.45, 45) .register(plugin); new Jetpack(categories.technicalGadgets, SlimefunItems.STEEL_JETPACK, new ItemStack[] {SlimefunItems.STEEL_INGOT, null, SlimefunItems.STEEL_INGOT, SlimefunItems.STEEL_INGOT, SlimefunItems.POWER_CRYSTAL, SlimefunItems.STEEL_INGOT, SlimefunItems.STEEL_THRUSTER, SlimefunItems.SMALL_CAPACITOR, SlimefunItems.STEEL_THRUSTER}, - 0.5) + 0.5, 60) .register(plugin); new Jetpack(categories.technicalGadgets, SlimefunItems.DAMASCUS_STEEL_JETPACK, new ItemStack[] {SlimefunItems.DAMASCUS_STEEL_INGOT, null, SlimefunItems.DAMASCUS_STEEL_INGOT, SlimefunItems.DAMASCUS_STEEL_INGOT, SlimefunItems.POWER_CRYSTAL, SlimefunItems.DAMASCUS_STEEL_INGOT, SlimefunItems.STEEL_THRUSTER, SlimefunItems.SMALL_CAPACITOR, SlimefunItems.STEEL_THRUSTER}, - 0.55) + 0.55, 75) .register(plugin); new Jetpack(categories.technicalGadgets, SlimefunItems.REINFORCED_ALLOY_JETPACK, new ItemStack[] {SlimefunItems.REINFORCED_ALLOY_INGOT, null, SlimefunItems.REINFORCED_ALLOY_INGOT, SlimefunItems.REINFORCED_ALLOY_INGOT, SlimefunItems.POWER_CRYSTAL, SlimefunItems.REINFORCED_ALLOY_INGOT, SlimefunItems.STEEL_THRUSTER, SlimefunItems.MEDIUM_CAPACITOR, SlimefunItems.STEEL_THRUSTER}, - 0.6) + 0.6, 100) .register(plugin); new Jetpack(categories.technicalGadgets, SlimefunItems.CARBONADO_JETPACK, new ItemStack[] {SlimefunItems.CARBON_CHUNK, null, SlimefunItems.CARBON_CHUNK, SlimefunItems.CARBONADO, SlimefunItems.POWER_CRYSTAL, SlimefunItems.CARBONADO, SlimefunItems.STEEL_THRUSTER, SlimefunItems.LARGE_CAPACITOR, SlimefunItems.STEEL_THRUSTER}, - 0.7) + 0.7, 150) .register(plugin); new Parachute(categories.technicalGadgets, SlimefunItems.PARACHUTE, RecipeType.ENHANCED_CRAFTING_TABLE, @@ -672,37 +672,37 @@ public final class SlimefunItemSetup { new MultiTool(categories.technicalGadgets, SlimefunItems.DURALUMIN_MULTI_TOOL, RecipeType.ENHANCED_CRAFTING_TABLE, new ItemStack[] {SlimefunItems.DURALUMIN_INGOT, null, SlimefunItems.DURALUMIN_INGOT, SlimefunItems.DURALUMIN_INGOT, SlimefunItems.SMALL_CAPACITOR, SlimefunItems.DURALUMIN_INGOT, null, SlimefunItems.DURALUMIN_INGOT, null}, - multiToolItems) + 20, multiToolItems) .register(plugin); new MultiTool(categories.technicalGadgets, SlimefunItems.SOLDER_MULTI_TOOL, RecipeType.ENHANCED_CRAFTING_TABLE, new ItemStack[] {SlimefunItems.SOLDER_INGOT, null, SlimefunItems.SOLDER_INGOT, SlimefunItems.SOLDER_INGOT, SlimefunItems.SMALL_CAPACITOR, SlimefunItems.SOLDER_INGOT, null, SlimefunItems.SOLDER_INGOT, null}, - multiToolItems) + 30, multiToolItems) .register(plugin); new MultiTool(categories.technicalGadgets, SlimefunItems.BILLON_MULTI_TOOL, RecipeType.ENHANCED_CRAFTING_TABLE, new ItemStack[] {SlimefunItems.BILLON_INGOT, null, SlimefunItems.BILLON_INGOT, SlimefunItems.BILLON_INGOT, SlimefunItems.SMALL_CAPACITOR, SlimefunItems.BILLON_INGOT, null, SlimefunItems.BILLON_INGOT, null}, - multiToolItems) + 40, multiToolItems) .register(plugin); new MultiTool(categories.technicalGadgets, SlimefunItems.STEEL_MULTI_TOOL, RecipeType.ENHANCED_CRAFTING_TABLE, new ItemStack[] {SlimefunItems.STEEL_INGOT, null, SlimefunItems.STEEL_INGOT, SlimefunItems.STEEL_INGOT, SlimefunItems.SMALL_CAPACITOR, SlimefunItems.STEEL_INGOT, null, SlimefunItems.STEEL_INGOT, null}, - multiToolItems) + 50, multiToolItems) .register(plugin); new MultiTool(categories.technicalGadgets, SlimefunItems.DAMASCUS_STEEL_MULTI_TOOL, RecipeType.ENHANCED_CRAFTING_TABLE, new ItemStack[] {SlimefunItems.DAMASCUS_STEEL_INGOT, null, SlimefunItems.DAMASCUS_STEEL_INGOT, SlimefunItems.DAMASCUS_STEEL_INGOT, SlimefunItems.SMALL_CAPACITOR, SlimefunItems.DAMASCUS_STEEL_INGOT, null, SlimefunItems.DAMASCUS_STEEL_INGOT, null}, - multiToolItems) + 60, multiToolItems) .register(plugin); new MultiTool(categories.technicalGadgets, SlimefunItems.REINFORCED_ALLOY_MULTI_TOOL, RecipeType.ENHANCED_CRAFTING_TABLE, new ItemStack[] {SlimefunItems.REINFORCED_ALLOY_INGOT, null, SlimefunItems.REINFORCED_ALLOY_INGOT, SlimefunItems.REINFORCED_ALLOY_INGOT, SlimefunItems.MEDIUM_CAPACITOR, SlimefunItems.REINFORCED_ALLOY_INGOT, null, SlimefunItems.REINFORCED_ALLOY_INGOT, null}, - multiToolItems) + 75, multiToolItems) .register(plugin); new MultiTool(categories.technicalGadgets, SlimefunItems.CARBONADO_MULTI_TOOL, RecipeType.ENHANCED_CRAFTING_TABLE, new ItemStack[] {SlimefunItems.CARBONADO, null, SlimefunItems.CARBONADO, SlimefunItems.CARBONADO, SlimefunItems.LARGE_CAPACITOR, SlimefunItems.CARBONADO, null, SlimefunItems.CARBONADO, null}, - "PORTABLE_CRAFTER", "MAGIC_EYE_OF_ENDER", "STAFF_ELEMENTAL_WIND", "GRAPPLING_HOOK", "GOLD_PAN", "NETHER_GOLD_PAN") + 100, "PORTABLE_CRAFTER", "MAGIC_EYE_OF_ENDER", "STAFF_ELEMENTAL_WIND", "GRAPPLING_HOOK", "GOLD_PAN", "NETHER_GOLD_PAN") .register(plugin); new OreWasher(categories.basicMachines, SlimefunItems.ORE_WASHER).register(plugin); @@ -1112,42 +1112,42 @@ public final class SlimefunItemSetup { new JetBoots(categories.technicalGadgets, SlimefunItems.DURALUMIN_JETBOOTS, new ItemStack[] {null, null, null, SlimefunItems.DURALUMIN_INGOT, SlimefunItems.POWER_CRYSTAL, SlimefunItems.DURALUMIN_INGOT, SlimefunItems.STEEL_THRUSTER, SlimefunItems.SMALL_CAPACITOR, SlimefunItems.STEEL_THRUSTER}, - 0.35) + 0.35, 20) .register(plugin); new JetBoots(categories.technicalGadgets, SlimefunItems.SOLDER_JETBOOTS, new ItemStack[] {null, null, null, SlimefunItems.SOLDER_INGOT, SlimefunItems.POWER_CRYSTAL, SlimefunItems.SOLDER_INGOT, SlimefunItems.STEEL_THRUSTER, SlimefunItems.SMALL_CAPACITOR, SlimefunItems.STEEL_THRUSTER}, - 0.4) + 0.4, 30) .register(plugin); new JetBoots(categories.technicalGadgets, SlimefunItems.BILLON_JETBOOTS, new ItemStack[] {null, null, null, SlimefunItems.BILLON_INGOT, SlimefunItems.POWER_CRYSTAL, SlimefunItems.BILLON_INGOT, SlimefunItems.STEEL_THRUSTER, SlimefunItems.SMALL_CAPACITOR, SlimefunItems.STEEL_THRUSTER}, - 0.45) + 0.45, 40) .register(plugin); new JetBoots(categories.technicalGadgets, SlimefunItems.STEEL_JETBOOTS, new ItemStack[] {null, null, null, SlimefunItems.STEEL_INGOT, SlimefunItems.POWER_CRYSTAL, SlimefunItems.STEEL_INGOT, SlimefunItems.STEEL_THRUSTER, SlimefunItems.SMALL_CAPACITOR, SlimefunItems.STEEL_THRUSTER}, - 0.5) + 0.5, 50) .register(plugin); new JetBoots(categories.technicalGadgets, SlimefunItems.DAMASCUS_STEEL_JETBOOTS, new ItemStack[] {null, null, null, SlimefunItems.DAMASCUS_STEEL_INGOT, SlimefunItems.POWER_CRYSTAL, SlimefunItems.DAMASCUS_STEEL_INGOT, SlimefunItems.STEEL_THRUSTER, SlimefunItems.SMALL_CAPACITOR, SlimefunItems.STEEL_THRUSTER}, - 0.55) + 0.55, 75) .register(plugin); new JetBoots(categories.technicalGadgets, SlimefunItems.REINFORCED_ALLOY_JETBOOTS, new ItemStack[] {null, null, null, SlimefunItems.REINFORCED_ALLOY_INGOT, SlimefunItems.POWER_CRYSTAL, SlimefunItems.REINFORCED_ALLOY_INGOT, SlimefunItems.STEEL_THRUSTER, SlimefunItems.MEDIUM_CAPACITOR, SlimefunItems.STEEL_THRUSTER}, - 0.6) + 0.6, 100) .register(plugin); new JetBoots(categories.technicalGadgets, SlimefunItems.CARBONADO_JETBOOTS, new ItemStack[] {null, null, null, SlimefunItems.CARBONADO, SlimefunItems.POWER_CRYSTAL, SlimefunItems.CARBONADO, SlimefunItems.STEEL_THRUSTER, SlimefunItems.LARGE_CAPACITOR, SlimefunItems.STEEL_THRUSTER}, - 0.7) + 0.7, 125) .register(plugin); new JetBoots(categories.technicalGadgets, SlimefunItems.ARMORED_JETBOOTS, new ItemStack[] {null, null, null, SlimefunItems.STEEL_PLATE, SlimefunItems.POWER_CRYSTAL, SlimefunItems.STEEL_PLATE, SlimefunItems.STEEL_THRUSTER, SlimefunItems.MEDIUM_CAPACITOR, SlimefunItems.STEEL_THRUSTER}, - 0.45) + 0.45, 50) .register(plugin); new SeismicAxe(categories.weapons, SlimefunItems.SEISMIC_AXE, RecipeType.MAGIC_WORKBENCH, @@ -1975,15 +1975,22 @@ public final class SlimefunItemSetup { new AutoDrier(categories.electricity, SlimefunItems.AUTO_DRIER, RecipeType.ENHANCED_CRAFTING_TABLE, new ItemStack[]{null, null, null, SlimefunItems.HEATING_COIL, new ItemStack(Material.SMOKER), SlimefunItems.HEATING_COIL, null, new ItemStack(Material.CAMPFIRE), null}) .register(plugin); - } else { + } + else { new AutoDrier(categories.electricity, SlimefunItems.AUTO_DRIER, RecipeType.ENHANCED_CRAFTING_TABLE, new ItemStack[]{null, null, null, SlimefunItems.HEATING_COIL, new ItemStack(Material.FURNACE), SlimefunItems.HEATING_COIL, null, new ItemStack(Material.TORCH), null}) .register(plugin); } new AutoBrewer(categories.electricity, SlimefunItems.AUTO_BREWER, RecipeType.ENHANCED_CRAFTING_TABLE, - new ItemStack[] {null, SlimefunItems.HEATING_COIL, null, SlimefunItems.REINFORCED_PLATE, new ItemStack(Material.BREWING_STAND), SlimefunItems.REINFORCED_PLATE, null, SlimefunItems.ELECTRIC_MOTOR, null}) - .register(plugin); + new ItemStack[] {null, SlimefunItems.HEATING_COIL, null, SlimefunItems.REINFORCED_PLATE, new ItemStack(Material.BREWING_STAND), SlimefunItems.REINFORCED_PLATE, null, SlimefunItems.ELECTRIC_MOTOR, null}) { + + @Override + public int getSpeed() { + return 1; + } + + }.register(plugin); new ElectricPress(categories.electricity, SlimefunItems.ELECTRIC_PRESS, RecipeType.ENHANCED_CRAFTING_TABLE, new ItemStack[] {new ItemStack(Material.PISTON), SlimefunItems.ELECTRIC_MOTOR, new ItemStack(Material.PISTON), null, SlimefunItems.MEDIUM_CAPACITOR, null, SlimefunItems.DAMASCUS_STEEL_INGOT, SlimefunItems.DAMASCUS_STEEL_INGOT, SlimefunItems.DAMASCUS_STEEL_INGOT}) { diff --git a/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/tasks/ArmorTask.java b/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/tasks/ArmorTask.java index e3809b012..32313de41 100644 --- a/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/tasks/ArmorTask.java +++ b/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/tasks/ArmorTask.java @@ -20,7 +20,6 @@ import io.github.thebusybiscuit.slimefun4.utils.SlimefunUtils; import me.mrCookieSlime.Slimefun.SlimefunPlugin; import me.mrCookieSlime.Slimefun.Objects.SlimefunItem.SlimefunItem; import me.mrCookieSlime.Slimefun.api.Slimefun; -import me.mrCookieSlime.Slimefun.api.energy.ItemEnergy; /** * The {@link ArmorTask} is responsible for handling {@link PotionEffect PotionEffects} for @@ -57,7 +56,11 @@ public class ArmorTask implements Runnable { HashedArmorpiece[] cachedArmor = profile.getArmor(); handleSlimefunArmor(p, armor, cachedArmor); - checkForSolarHelmet(p); + + if (hasSunlight(p)) { + checkForSolarHelmet(p); + } + checkForRadiation(p); }); } @@ -89,15 +92,10 @@ public class ArmorTask implements Runnable { } private void checkForSolarHelmet(Player p) { - // Temporary performance improvement - if (!SlimefunUtils.isItemSimilar(p.getInventory().getHelmet(), SlimefunItems.SOLAR_HELMET, true)) { - return; - } - SlimefunItem item = SlimefunItem.getByItem(p.getInventory().getHelmet()); - if (item instanceof SolarHelmet && Slimefun.hasUnlocked(p, item, true) && hasSunlight(p)) { - ItemEnergy.chargeInventory(p, (float) ((SolarHelmet) item).getChargeAmount()); + if (item instanceof SolarHelmet && Slimefun.hasUnlocked(p, item, true)) { + ((SolarHelmet) item).chargeItems(p); } } diff --git a/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/tasks/JetBootsTask.java b/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/tasks/JetBootsTask.java index c5ea9fcc3..0c79d4c62 100644 --- a/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/tasks/JetBootsTask.java +++ b/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/tasks/JetBootsTask.java @@ -4,40 +4,45 @@ import java.util.concurrent.ThreadLocalRandom; import org.bukkit.Bukkit; import org.bukkit.Effect; +import org.bukkit.Material; import org.bukkit.Sound; import org.bukkit.entity.Player; import org.bukkit.util.Vector; import io.github.thebusybiscuit.cscorelib2.math.DoubleHandler; -import me.mrCookieSlime.Slimefun.api.energy.ItemEnergy; +import io.github.thebusybiscuit.slimefun4.implementation.items.electric.gadgets.JetBoots; public class JetBootsTask extends PlayerTask { - private final double speed; + private static final float COST = 0.075F; - public JetBootsTask(Player p, double speed) { + private final JetBoots boots; + + public JetBootsTask(Player p, JetBoots boots) { super(p); - this.speed = speed; + this.boots = boots; } @Override protected void executeTask() { - float cost = 0.075F; - float charge = ItemEnergy.getStoredEnergy(p.getInventory().getBoots()); - double accuracy = DoubleHandler.fixDouble(speed - 0.7); + if (p.getInventory().getBoots() == null || p.getInventory().getBoots().getType() == Material.AIR) { + return; + } - if (charge >= cost) { - p.getInventory().setBoots(ItemEnergy.chargeItem(p.getInventory().getBoots(), -cost)); + double accuracy = DoubleHandler.fixDouble(boots.getSpeed() - 0.7); + if (boots.removeItemCharge(p.getInventory().getBoots(), COST)) { p.getWorld().playSound(p.getLocation(), Sound.ENTITY_TNT_PRIMED, (float) 0.25, 1); p.getWorld().playEffect(p.getLocation(), Effect.SMOKE, 1, 1); p.setFallDistance(0F); double gravity = 0.04; double offset = ThreadLocalRandom.current().nextBoolean() ? accuracy : -accuracy; - Vector vector = new Vector(p.getEyeLocation().getDirection().getX() * speed + offset, gravity, p.getEyeLocation().getDirection().getZ() * speed - offset); + Vector vector = new Vector(p.getEyeLocation().getDirection().getX() * boots.getSpeed() + offset, gravity, p.getEyeLocation().getDirection().getZ() * boots.getSpeed() - offset); p.setVelocity(vector); } - else Bukkit.getScheduler().cancelTask(id); + else { + Bukkit.getScheduler().cancelTask(id); + } } } diff --git a/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/tasks/JetpackTask.java b/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/tasks/JetpackTask.java index 16ccbd6f0..ece737483 100644 --- a/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/tasks/JetpackTask.java +++ b/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/tasks/JetpackTask.java @@ -2,19 +2,22 @@ package io.github.thebusybiscuit.slimefun4.implementation.tasks; import org.bukkit.Bukkit; import org.bukkit.Effect; +import org.bukkit.Material; import org.bukkit.Sound; import org.bukkit.entity.Player; import org.bukkit.util.Vector; -import me.mrCookieSlime.Slimefun.api.energy.ItemEnergy; +import io.github.thebusybiscuit.slimefun4.implementation.items.electric.gadgets.Jetpack; public class JetpackTask extends PlayerTask { - private final double thrust; + private static final float COST = 0.08F; - public JetpackTask(Player p, double thrust) { + private final Jetpack jetpack; + + public JetpackTask(Player p, Jetpack jetpack) { super(p); - this.thrust = thrust; + this.jetpack = jetpack; } @Override @@ -24,17 +27,16 @@ public class JetpackTask extends PlayerTask { @Override protected void executeTask() { - float cost = 0.08F; - float charge = ItemEnergy.getStoredEnergy(p.getInventory().getChestplate()); - - if (charge >= cost) { - p.getInventory().setChestplate(ItemEnergy.chargeItem(p.getInventory().getChestplate(), -cost)); + if (p.getInventory().getChestplate() == null || p.getInventory().getChestplate().getType() == Material.AIR) { + return; + } + if (jetpack.removeItemCharge(p.getInventory().getChestplate(), COST)) { p.getWorld().playSound(p.getLocation(), Sound.ENTITY_GENERIC_EXPLODE, (float) 0.25, 1); p.getWorld().playEffect(p.getLocation(), Effect.SMOKE, 1, 1); p.setFallDistance(0F); Vector vector = new Vector(0, 1, 0); - vector.multiply(thrust); + vector.multiply(jetpack.getThrust()); vector.add(p.getEyeLocation().getDirection().multiply(0.2F)); p.setVelocity(vector); diff --git a/src/main/java/io/github/thebusybiscuit/slimefun4/utils/NumberUtils.java b/src/main/java/io/github/thebusybiscuit/slimefun4/utils/NumberUtils.java index cd9fa88ba..1c5a37cb3 100644 --- a/src/main/java/io/github/thebusybiscuit/slimefun4/utils/NumberUtils.java +++ b/src/main/java/io/github/thebusybiscuit/slimefun4/utils/NumberUtils.java @@ -87,4 +87,8 @@ public final class NumberUtils { public static int getInt(Integer value, int defaultValue) { return value == null ? defaultValue : value; } + + public static float getFloat(Float value, float defaultValue) { + return value == null ? defaultValue : value; + } } diff --git a/src/main/java/me/mrCookieSlime/Slimefun/Objects/SlimefunItem/ChargableItem.java b/src/main/java/me/mrCookieSlime/Slimefun/Objects/SlimefunItem/ChargableItem.java index 8430fa40b..2d1bddbbb 100644 --- a/src/main/java/me/mrCookieSlime/Slimefun/Objects/SlimefunItem/ChargableItem.java +++ b/src/main/java/me/mrCookieSlime/Slimefun/Objects/SlimefunItem/ChargableItem.java @@ -2,18 +2,30 @@ package me.mrCookieSlime.Slimefun.Objects.SlimefunItem; import org.bukkit.inventory.ItemStack; +import io.github.thebusybiscuit.slimefun4.core.attributes.Rechargeable; import me.mrCookieSlime.Slimefun.Lists.RecipeType; import me.mrCookieSlime.Slimefun.Objects.Category; import me.mrCookieSlime.Slimefun.api.SlimefunItemStack; +import me.mrCookieSlime.Slimefun.api.energy.ItemEnergy; -// We need to refactor this class some day... -// Add some methods or whatever, make it useful -// (And also fix the typo in the name) +/** + * This class is deprecated. + * + * @deprecated Please implement the {@link Rechargeable} interface from now on. + * + * @author TheBusyBiscuit + * + */ @Deprecated -public class ChargableItem extends SlimefunItem { +public class ChargableItem extends SlimefunItem implements Rechargeable { public ChargableItem(Category category, SlimefunItemStack item, RecipeType recipeType, ItemStack[] recipe) { super(category, item, recipeType, recipe); } + @Override + public float getMaxItemCharge(ItemStack item) { + return ItemEnergy.getMaxEnergy(item); + } + } diff --git a/src/main/java/me/mrCookieSlime/Slimefun/Objects/SlimefunItem/SlimefunItem.java b/src/main/java/me/mrCookieSlime/Slimefun/Objects/SlimefunItem/SlimefunItem.java index 28a952444..9f56f65e3 100644 --- a/src/main/java/me/mrCookieSlime/Slimefun/Objects/SlimefunItem/SlimefunItem.java +++ b/src/main/java/me/mrCookieSlime/Slimefun/Objects/SlimefunItem/SlimefunItem.java @@ -28,6 +28,7 @@ import io.github.thebusybiscuit.slimefun4.api.items.ItemState; import io.github.thebusybiscuit.slimefun4.core.attributes.EnergyNetComponent; import io.github.thebusybiscuit.slimefun4.core.attributes.Placeable; import io.github.thebusybiscuit.slimefun4.core.attributes.Radioactive; +import io.github.thebusybiscuit.slimefun4.core.attributes.Rechargeable; import io.github.thebusybiscuit.slimefun4.core.attributes.WitherProof; import io.github.thebusybiscuit.slimefun4.core.guide.SlimefunGuide; import io.github.thebusybiscuit.slimefun4.core.researching.Research; @@ -462,12 +463,12 @@ public class SlimefunItem implements Placeable { } public void setRecipeType(RecipeType type) { - Validate.notNull(type, "'recipeType' is not allowed to be null!"); + Validate.notNull(type, "The RecipeType is not allowed to be null!"); this.recipeType = type; } public void setCategory(Category category) { - Validate.notNull(category, "'category' is not allowed to be null!"); + Validate.notNull(category, "The Category is not allowed to be null!"); this.category.remove(this); category.add(this); @@ -543,7 +544,7 @@ public class SlimefunItem implements Placeable { // Backwards compatibility if (SlimefunPlugin.getMinecraftVersion().isBefore(MinecraftVersion.MINECRAFT_1_14) || SlimefunPlugin.getRegistry().isBackwardsCompatible()) { - boolean loreInsensitive = this instanceof ChargableItem || this instanceof SlimefunBackpack || id.equals("BROKEN_SPAWNER") || id.equals("REINFORCED_SPAWNER"); + boolean loreInsensitive = this instanceof Rechargeable || this instanceof SlimefunBackpack || id.equals("BROKEN_SPAWNER") || id.equals("REINFORCED_SPAWNER"); return SlimefunUtils.isItemSimilar(item, this.item, !loreInsensitive); } else { diff --git a/src/main/java/me/mrCookieSlime/Slimefun/api/energy/ItemEnergy.java b/src/main/java/me/mrCookieSlime/Slimefun/api/energy/ItemEnergy.java index 6ec6ce360..a668d0ad1 100644 --- a/src/main/java/me/mrCookieSlime/Slimefun/api/energy/ItemEnergy.java +++ b/src/main/java/me/mrCookieSlime/Slimefun/api/energy/ItemEnergy.java @@ -10,8 +10,17 @@ import org.bukkit.inventory.ItemStack; import org.bukkit.inventory.meta.ItemMeta; import io.github.thebusybiscuit.cscorelib2.chat.ChatColors; +import io.github.thebusybiscuit.slimefun4.core.attributes.Rechargeable; import io.github.thebusybiscuit.slimefun4.utils.PatternUtils; +import me.mrCookieSlime.Slimefun.Objects.SlimefunItem.SlimefunItem; +/** + * @deprecated Please implement {@link Rechargeable} on your {@link SlimefunItem} instead. + * + * @author TheBusyBiscuit + * + */ +@Deprecated public final class ItemEnergy { // We should find a replacement for this class From 8d0c816ed2fe1bc767dbd0c5779467ed450e68b9 Mon Sep 17 00:00:00 2001 From: TheBusyBiscuit Date: Fri, 26 Jun 2020 16:27:16 +0200 Subject: [PATCH 02/24] Some performance improvements --- .../core/services/CustomItemDataService.java | 3 ++- .../items/electric/gadgets/SolarHelmet.java | 9 ++++++++- .../slimefun4/implementation/tasks/ArmorTask.java | 11 +++++++++-- .../Objects/SlimefunItem/SlimefunItem.java | 14 ++++++-------- 4 files changed, 25 insertions(+), 12 deletions(-) diff --git a/src/main/java/io/github/thebusybiscuit/slimefun4/core/services/CustomItemDataService.java b/src/main/java/io/github/thebusybiscuit/slimefun4/core/services/CustomItemDataService.java index 2345b5b00..b2ca07a7c 100644 --- a/src/main/java/io/github/thebusybiscuit/slimefun4/core/services/CustomItemDataService.java +++ b/src/main/java/io/github/thebusybiscuit/slimefun4/core/services/CustomItemDataService.java @@ -3,6 +3,7 @@ package io.github.thebusybiscuit.slimefun4.core.services; import java.util.Optional; import org.bukkit.Keyed; +import org.bukkit.Material; import org.bukkit.NamespacedKey; import org.bukkit.inventory.ItemStack; import org.bukkit.inventory.meta.ItemMeta; @@ -65,7 +66,7 @@ public class CustomItemDataService implements PersistentDataService, Keyed { * @return An {@link Optional} describing the result */ public Optional getItemData(ItemStack item) { - if (item == null || !item.hasItemMeta()) { + if (item == null || item.getType() == Material.AIR || !item.hasItemMeta()) { return Optional.empty(); } diff --git a/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/items/electric/gadgets/SolarHelmet.java b/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/items/electric/gadgets/SolarHelmet.java index 3c24a6cf5..79263be8f 100644 --- a/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/items/electric/gadgets/SolarHelmet.java +++ b/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/items/electric/gadgets/SolarHelmet.java @@ -33,7 +33,14 @@ public class SolarHelmet extends SlimefunItem { addItemSetting(charge); } - public void chargeItems(Player p) { + /** + * This method recharges the equipment of the given {@link Player} by the configured + * factor of this {@link SolarHelmet}. + * + * @param p + * The {@link Player} wearing this {@link SolarHelmet} + */ + public void rechargeItems(Player p) { recharge(p.getInventory().getHelmet()); recharge(p.getInventory().getChestplate()); recharge(p.getInventory().getLeggings()); diff --git a/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/tasks/ArmorTask.java b/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/tasks/ArmorTask.java index 32313de41..ffbdd1381 100644 --- a/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/tasks/ArmorTask.java +++ b/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/tasks/ArmorTask.java @@ -92,10 +92,17 @@ public class ArmorTask implements Runnable { } private void checkForSolarHelmet(Player p) { - SlimefunItem item = SlimefunItem.getByItem(p.getInventory().getHelmet()); + ItemStack helmet = p.getInventory().getHelmet(); + + if (SlimefunPlugin.getRegistry().isBackwardsCompatible() && !SlimefunUtils.isItemSimilar(helmet, SlimefunItems.SOLAR_HELMET, true, false)) { + // Performance saver for slow backwards-compatible versions of Slimefun + return; + } + + SlimefunItem item = SlimefunItem.getByItem(helmet); if (item instanceof SolarHelmet && Slimefun.hasUnlocked(p, item, true)) { - ((SolarHelmet) item).chargeItems(p); + ((SolarHelmet) item).rechargeItems(p); } } diff --git a/src/main/java/me/mrCookieSlime/Slimefun/Objects/SlimefunItem/SlimefunItem.java b/src/main/java/me/mrCookieSlime/Slimefun/Objects/SlimefunItem/SlimefunItem.java index 9f56f65e3..58d084165 100644 --- a/src/main/java/me/mrCookieSlime/Slimefun/Objects/SlimefunItem/SlimefunItem.java +++ b/src/main/java/me/mrCookieSlime/Slimefun/Objects/SlimefunItem/SlimefunItem.java @@ -805,19 +805,17 @@ public class SlimefunItem implements Placeable { return getByID(((SlimefunItemStack) item).getItemId()); } - // This wrapper improves the heavy ItemStack#getItemMeta() call by caching it. - ItemStackWrapper wrapper = new ItemStackWrapper(item); + Optional itemID = SlimefunPlugin.getItemDataService().getItemData(item); - if (item.hasItemMeta()) { - Optional itemID = SlimefunPlugin.getItemDataService().getItemData(wrapper); - - if (itemID.isPresent()) { - return getByID(itemID.get()); - } + if (itemID.isPresent()) { + return getByID(itemID.get()); } // Backwards compatibility if (SlimefunPlugin.getMinecraftVersion().isBefore(MinecraftVersion.MINECRAFT_1_14) || SlimefunPlugin.getRegistry().isBackwardsCompatible()) { + // This wrapper improves the heavy ItemStack#getItemMeta() call by caching it. + ItemStackWrapper wrapper = new ItemStackWrapper(item); + // Quite expensive performance-wise // But necessary for supporting legacy items for (SlimefunItem sfi : SlimefunPlugin.getRegistry().getAllSlimefunItems()) { From 28e5b57c5d91fe62f79953ffe5186281cc77e0f6 Mon Sep 17 00:00:00 2001 From: TheBusyBiscuit Date: Fri, 26 Jun 2020 17:36:57 +0200 Subject: [PATCH 03/24] Some better exception handling --- .../implementation/tasks/SlimefunStartupTask.java | 10 +++++++++- .../me/mrCookieSlime/Slimefun/api/BlockStorage.java | 4 ++++ 2 files changed, 13 insertions(+), 1 deletion(-) diff --git a/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/tasks/SlimefunStartupTask.java b/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/tasks/SlimefunStartupTask.java index abfd58f4c..691b15913 100644 --- a/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/tasks/SlimefunStartupTask.java +++ b/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/tasks/SlimefunStartupTask.java @@ -1,5 +1,7 @@ package io.github.thebusybiscuit.slimefun4.implementation.tasks; +import java.util.logging.Level; + import org.bukkit.Bukkit; import org.bukkit.World; @@ -10,6 +12,7 @@ import io.github.thebusybiscuit.slimefun4.implementation.setup.PostSetup; import me.mrCookieSlime.Slimefun.SlimefunPlugin; import me.mrCookieSlime.Slimefun.Objects.SlimefunItem.SlimefunItem; import me.mrCookieSlime.Slimefun.api.BlockStorage; +import me.mrCookieSlime.Slimefun.api.Slimefun; /** * This Task initializes all items, some listeners and various other stuff. @@ -48,7 +51,12 @@ public class SlimefunStartupTask implements Runnable { SlimefunPlugin.getWorldSettingsService().load(Bukkit.getWorlds()); for (World world : Bukkit.getWorlds()) { - new BlockStorage(world); + try { + new BlockStorage(world); + } + catch (Exception x) { + Slimefun.getLogger().log(Level.SEVERE, x, () -> "An Error occured while trying to load World \"" + world.getName() + "\" for Slimefun v" + SlimefunPlugin.getVersion()); + } } // Load all listeners that depend on items to be enabled diff --git a/src/main/java/me/mrCookieSlime/Slimefun/api/BlockStorage.java b/src/main/java/me/mrCookieSlime/Slimefun/api/BlockStorage.java index 0c318134d..a48353540 100644 --- a/src/main/java/me/mrCookieSlime/Slimefun/api/BlockStorage.java +++ b/src/main/java/me/mrCookieSlime/Slimefun/api/BlockStorage.java @@ -97,6 +97,10 @@ public class BlockStorage { public BlockStorage(World w) { this.world = w; + if (world.getName().indexOf('.') != -1) { + throw new IllegalArgumentException("Slimefun cannot deal with World names that contain a dot: " + w.getName()); + } + if (SlimefunPlugin.getRegistry().getWorlds().containsKey(w.getName())) { // Cancel the loading process if the world was already loaded return; From ed85a9a051e3f63b9e3b903d194c5b815f01c538 Mon Sep 17 00:00:00 2001 From: TheBusyBiscuit Date: Fri, 26 Jun 2020 17:58:54 +0200 Subject: [PATCH 04/24] Added Unit tests for rechargeable items --- .../core/attributes/Rechargeable.java | 16 +-- .../tests/items/TestRechargeableItems.java | 126 ++++++++++++++++++ 2 files changed, 134 insertions(+), 8 deletions(-) create mode 100644 src/test/java/io/github/thebusybiscuit/slimefun4/testing/tests/items/TestRechargeableItems.java diff --git a/src/main/java/io/github/thebusybiscuit/slimefun4/core/attributes/Rechargeable.java b/src/main/java/io/github/thebusybiscuit/slimefun4/core/attributes/Rechargeable.java index 73205a28d..ef3ddea37 100644 --- a/src/main/java/io/github/thebusybiscuit/slimefun4/core/attributes/Rechargeable.java +++ b/src/main/java/io/github/thebusybiscuit/slimefun4/core/attributes/Rechargeable.java @@ -47,12 +47,12 @@ public interface Rechargeable extends ItemAttribute { */ default void setItemCharge(ItemStack item, float charge) { if (item == null || item.getType() == Material.AIR) { - throw new IllegalArgumentException("Cannot set an Item charge for null or air"); + throw new IllegalArgumentException("Cannot set Item charge for null or AIR"); } float maximum = getMaxItemCharge(item); - if (charge <= 0 || charge >= maximum) { + if (charge < 0 || charge > maximum) { throw new IllegalArgumentException("Charge must be between zero and " + maximum + "."); } @@ -70,8 +70,8 @@ public interface Rechargeable extends ItemAttribute { * @return The charge stored on this {@link ItemStack} */ default float getItemCharge(ItemStack item) { - if (item == null || item.getType() == Material.AIR || !item.hasItemMeta()) { - throw new IllegalArgumentException("Cannot get the Item charge for invalid items (null, air or no ItemMeta)"); + if (item == null || item.getType() == Material.AIR) { + throw new IllegalArgumentException("Cannot get Item charge for null or AIR"); } return RechargeableHelper.getCharge(item.getItemMeta()); @@ -90,8 +90,8 @@ public interface Rechargeable extends ItemAttribute { * @return Whether the given charge could be added successfully */ default boolean addItemCharge(ItemStack item, float charge) { - if (item == null || item.getType() == Material.AIR || !item.hasItemMeta()) { - throw new IllegalArgumentException("Cannot add Item charge for invalid items (null, air or no ItemMeta)"); + if (item == null || item.getType() == Material.AIR) { + throw new IllegalArgumentException("Cannot add Item charge for null or AIR"); } ItemMeta meta = item.getItemMeta(); @@ -123,8 +123,8 @@ public interface Rechargeable extends ItemAttribute { * @return Whether the given charge could be removed successfully */ default boolean removeItemCharge(ItemStack item, float charge) { - if (item == null || item.getType() == Material.AIR || !item.hasItemMeta()) { - throw new IllegalArgumentException("Cannot remove Item charge for invalid items (null, air or no ItemMeta)"); + if (item == null || item.getType() == Material.AIR) { + throw new IllegalArgumentException("Cannot remove Item charge for null or AIR"); } ItemMeta meta = item.getItemMeta(); diff --git a/src/test/java/io/github/thebusybiscuit/slimefun4/testing/tests/items/TestRechargeableItems.java b/src/test/java/io/github/thebusybiscuit/slimefun4/testing/tests/items/TestRechargeableItems.java new file mode 100644 index 000000000..13499c17d --- /dev/null +++ b/src/test/java/io/github/thebusybiscuit/slimefun4/testing/tests/items/TestRechargeableItems.java @@ -0,0 +1,126 @@ +package io.github.thebusybiscuit.slimefun4.testing.tests.items; + +import org.bukkit.Material; +import org.bukkit.inventory.ItemStack; +import org.junit.jupiter.api.AfterAll; +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.BeforeAll; +import org.junit.jupiter.api.Test; + +import be.seeseemelk.mockbukkit.MockBukkit; +import io.github.thebusybiscuit.cscorelib2.chat.ChatColors; +import io.github.thebusybiscuit.cscorelib2.item.CustomItem; +import io.github.thebusybiscuit.slimefun4.core.attributes.Rechargeable; +import io.github.thebusybiscuit.slimefun4.testing.TestUtilities; +import io.github.thebusybiscuit.slimefun4.utils.LoreBuilder; +import me.mrCookieSlime.Slimefun.SlimefunPlugin; +import me.mrCookieSlime.Slimefun.Lists.RecipeType; +import me.mrCookieSlime.Slimefun.Objects.Category; +import me.mrCookieSlime.Slimefun.Objects.SlimefunItem.SlimefunItem; +import me.mrCookieSlime.Slimefun.api.SlimefunItemStack; + +public class TestRechargeableItems { + + private static SlimefunPlugin plugin; + + @BeforeAll + public static void load() { + MockBukkit.mock(); + plugin = MockBukkit.load(SlimefunPlugin.class); + } + + @AfterAll + public static void unload() { + MockBukkit.unmock(); + } + + @Test + public void testInvalidItems() { + Rechargeable rechargeable = mock("INVALID_CHARGING_TEST", 1); + + Assertions.assertThrows(IllegalArgumentException.class, () -> rechargeable.getItemCharge(null)); + Assertions.assertThrows(IllegalArgumentException.class, () -> rechargeable.getItemCharge(new ItemStack(Material.AIR))); + + Assertions.assertThrows(IllegalArgumentException.class, () -> rechargeable.setItemCharge(null, 1)); + Assertions.assertThrows(IllegalArgumentException.class, () -> rechargeable.setItemCharge(new ItemStack(Material.AIR), 1)); + + Assertions.assertThrows(IllegalArgumentException.class, () -> rechargeable.addItemCharge(null, 1)); + Assertions.assertThrows(IllegalArgumentException.class, () -> rechargeable.addItemCharge(new ItemStack(Material.AIR), 1)); + + Assertions.assertThrows(IllegalArgumentException.class, () -> rechargeable.removeItemCharge(null, 1)); + Assertions.assertThrows(IllegalArgumentException.class, () -> rechargeable.removeItemCharge(new ItemStack(Material.AIR), 1)); + } + + @Test + public void testSetItemCharge() { + Rechargeable rechargeable = mock("CHARGING_TEST", 10); + ItemStack item = new CustomItem(Material.REDSTONE_ORE, "&4Chargeable Item", "", LoreBuilder.powerCharged(0, 10)); + + Assertions.assertEquals(0, rechargeable.getItemCharge(item)); + + rechargeable.setItemCharge(item, 10); + Assertions.assertEquals(10, rechargeable.getItemCharge(item)); + + String lore = ChatColors.color("&c&o&8\u21E8 &e\u26A1 &7") + "10.0 / 10.0 J"; + Assertions.assertEquals(lore, item.getItemMeta().getLore().get(1)); + } + + @Test + public void testItemChargeBounds() { + Rechargeable rechargeable = mock("CHARGING_BOUNDS_TEST", 10); + ItemStack item = new CustomItem(Material.REDSTONE_BLOCK, "&4Chargeable Item with bounds", "", LoreBuilder.powerCharged(0, 10)); + + Assertions.assertThrows(IllegalArgumentException.class, () -> rechargeable.setItemCharge(item, -1)); + Assertions.assertThrows(IllegalArgumentException.class, () -> rechargeable.setItemCharge(item, -0.01F)); + Assertions.assertThrows(IllegalArgumentException.class, () -> rechargeable.setItemCharge(item, 10.01F)); + Assertions.assertThrows(IllegalArgumentException.class, () -> rechargeable.setItemCharge(item, 11)); + } + + @Test + public void testAddItemCharge() { + Rechargeable rechargeable = mock("CHARGING_BOUNDS_TEST", 10); + ItemStack item = new CustomItem(Material.REDSTONE_BLOCK, "&4Chargeable Item with additions", "", LoreBuilder.powerCharged(0, 10)); + + Assertions.assertTrue(rechargeable.addItemCharge(item, 10)); + Assertions.assertEquals(10, rechargeable.getItemCharge(item)); + + Assertions.assertFalse(rechargeable.addItemCharge(item, 1)); + } + + @Test + public void testRemoveItemCharge() { + Rechargeable rechargeable = mock("CHARGING_BOUNDS_TEST", 10); + ItemStack item = new CustomItem(Material.REDSTONE_BLOCK, "&4Chargeable Item with removal", "", LoreBuilder.powerCharged(0, 10)); + + Assertions.assertFalse(rechargeable.removeItemCharge(item, 1)); + + rechargeable.setItemCharge(item, 10); + + Assertions.assertTrue(rechargeable.removeItemCharge(item, 10)); + Assertions.assertEquals(0, rechargeable.getItemCharge(item)); + + Assertions.assertFalse(rechargeable.removeItemCharge(item, 1)); + } + + private RechargeableMock mock(String id, float capacity) { + Category category = TestUtilities.getCategory(plugin, "rechargeable"); + return new RechargeableMock(category, new SlimefunItemStack(id, new CustomItem(Material.REDSTONE_LAMP, "&3" + id)), capacity); + } + + private class RechargeableMock extends SlimefunItem implements Rechargeable { + + private final float capacity; + + protected RechargeableMock(Category category, SlimefunItemStack item, float capacity) { + super(category, item, RecipeType.NULL, new ItemStack[9]); + this.capacity = capacity; + } + + @Override + public float getMaxItemCharge(ItemStack item) { + return capacity; + } + + } + +} From f99c7275831980f0564553278764f3dd2b644425 Mon Sep 17 00:00:00 2001 From: TheBusyBiscuit Date: Fri, 26 Jun 2020 20:37:53 +0200 Subject: [PATCH 05/24] Added another Unit Test --- .../testing/tests/items/TestCategories.java | 38 ++++++++++++++++++- 1 file changed, 37 insertions(+), 1 deletion(-) diff --git a/src/test/java/io/github/thebusybiscuit/slimefun4/testing/tests/items/TestCategories.java b/src/test/java/io/github/thebusybiscuit/slimefun4/testing/tests/items/TestCategories.java index 46e1e99ed..f38eaf17a 100644 --- a/src/test/java/io/github/thebusybiscuit/slimefun4/testing/tests/items/TestCategories.java +++ b/src/test/java/io/github/thebusybiscuit/slimefun4/testing/tests/items/TestCategories.java @@ -20,10 +20,13 @@ import io.github.thebusybiscuit.slimefun4.core.categories.FlexCategory; import io.github.thebusybiscuit.slimefun4.core.categories.LockedCategory; import io.github.thebusybiscuit.slimefun4.core.categories.SeasonalCategory; import io.github.thebusybiscuit.slimefun4.core.guide.SlimefunGuideLayout; +import io.github.thebusybiscuit.slimefun4.core.researching.Research; import io.github.thebusybiscuit.slimefun4.testing.TestUtilities; import me.mrCookieSlime.Slimefun.SlimefunPlugin; +import me.mrCookieSlime.Slimefun.Lists.RecipeType; import me.mrCookieSlime.Slimefun.Objects.Category; import me.mrCookieSlime.Slimefun.Objects.SlimefunItem.SlimefunItem; +import me.mrCookieSlime.Slimefun.api.SlimefunItemStack; public class TestCategories { @@ -115,7 +118,7 @@ public class TestCategories { } @Test - public void testLockedCategories() { + public void testLockedCategoriesParents() { Assertions.assertThrows(IllegalArgumentException.class, () -> new LockedCategory(new NamespacedKey(plugin, "locked"), new CustomItem(Material.GOLD_NUGGET, "&6Locked Test"), (NamespacedKey) null)); Category category = new Category(new NamespacedKey(plugin, "unlocked"), new CustomItem(Material.EMERALD, "&5I am SHERlocked")); @@ -139,6 +142,39 @@ public class TestCategories { Assertions.assertTrue(locked.getParents().contains(category)); } + @Test + public void testLockedCategoriesUnlocking() throws InterruptedException { + Player player = server.addPlayer(); + PlayerProfile profile = TestUtilities.awaitProfile(player); + + Assertions.assertThrows(IllegalArgumentException.class, () -> new LockedCategory(new NamespacedKey(plugin, "locked"), new CustomItem(Material.GOLD_NUGGET, "&6Locked Test"), (NamespacedKey) null)); + + Category category = new Category(new NamespacedKey(plugin, "parent"), new CustomItem(Material.EMERALD, "&5I am SHERlocked")); + category.register(); + + LockedCategory locked = new LockedCategory(new NamespacedKey(plugin, "locked"), new CustomItem(Material.GOLD_NUGGET, "&6Locked Test"), category.getKey()); + locked.register(); + + // No Items, so it should be unlocked + Assertions.assertTrue(locked.hasUnlocked(player, profile)); + + SlimefunItem item = new SlimefunItem(category, new SlimefunItemStack("LOCKED_CATEGORY_TEST", new CustomItem(Material.LANTERN, "&6Test Item for locked categories")), RecipeType.NULL, new ItemStack[9]); + item.register(plugin); + item.load(); + + SlimefunPlugin.getRegistry().setResearchingEnabled(true); + Research research = new Research(new NamespacedKey(plugin, "cant_touch_this"), 432432, "MC Hammer", 90); + research.addItems(item); + research.register(); + + Assertions.assertFalse(profile.hasUnlocked(research)); + Assertions.assertFalse(locked.hasUnlocked(player, profile)); + + profile.setResearched(research, true); + + Assertions.assertTrue(locked.hasUnlocked(player, profile)); + } + @Test public void testSeasonalCategories() { // Category with current Month From 80fc0a173e1d389873cdca0033539694e9e620d1 Mon Sep 17 00:00:00 2001 From: TheBusyBiscuit Date: Fri, 26 Jun 2020 20:58:23 +0200 Subject: [PATCH 06/24] Added lore addition --- .../slimefun4/core/attributes/RechargeableHelper.java | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/main/java/io/github/thebusybiscuit/slimefun4/core/attributes/RechargeableHelper.java b/src/main/java/io/github/thebusybiscuit/slimefun4/core/attributes/RechargeableHelper.java index e4bd282d1..43e0378ff 100644 --- a/src/main/java/io/github/thebusybiscuit/slimefun4/core/attributes/RechargeableHelper.java +++ b/src/main/java/io/github/thebusybiscuit/slimefun4/core/attributes/RechargeableHelper.java @@ -43,10 +43,12 @@ final class RechargeableHelper { if (line.startsWith(LORE_PREFIX)) { lore.set(i, LORE_PREFIX + value + " / " + capacity + " J"); - meta.setLore(lore); - return; + break; } } + + lore.add(LORE_PREFIX + value + " / " + capacity + " J"); + meta.setLore(lore); } static float getCharge(ItemMeta meta) { From dab48cbe13f3102494a99e981afd1f31e7e718a6 Mon Sep 17 00:00:00 2001 From: HeroBrineKing Date: Fri, 26 Jun 2020 21:51:16 +0000 Subject: [PATCH 07/24] Translate categories_zh-TW.yml via GitLocalize --- src/main/resources/languages/categories_zh-TW.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/src/main/resources/languages/categories_zh-TW.yml b/src/main/resources/languages/categories_zh-TW.yml index 544b513d4..0ccd29ed4 100644 --- a/src/main/resources/languages/categories_zh-TW.yml +++ b/src/main/resources/languages/categories_zh-TW.yml @@ -23,3 +23,4 @@ slimefun: easter: 復活節 birthday: TheBusyBiscuit的生日(10月26日) halloween: 萬聖節 + androids: 可編輯的機器人 From 6b89cd3fc2f7b2f57fb2a7625f8a4fc2f098a3de Mon Sep 17 00:00:00 2001 From: HeroBrineKing Date: Fri, 26 Jun 2020 21:51:17 +0000 Subject: [PATCH 08/24] Translate recipes_zh-TW.yml via GitLocalize --- .../resources/languages/recipes_zh-TW.yml | 221 +++++++++--------- 1 file changed, 113 insertions(+), 108 deletions(-) diff --git a/src/main/resources/languages/recipes_zh-TW.yml b/src/main/resources/languages/recipes_zh-TW.yml index 1aa858d18..52f547443 100644 --- a/src/main/resources/languages/recipes_zh-TW.yml +++ b/src/main/resources/languages/recipes_zh-TW.yml @@ -1,134 +1,96 @@ --- -minecraft: - blasting: - lore: - - 加熱燒一燒 - - 成品出來了! - name: 高爐合成表 - campfire: - lore: - - 加熱燒一燒 - - "\t\n成品出來了!" - name: 營火合成表 - furnace: - lore: - - 加熱燒一燒 - - 成品出來了! - name: 熔爐合成表 - shaped: - lore: - - 數量一樣 - - 位置一致 - - "(原版合成檯)" - name: 有序合成 - shapeless: - lore: - - 數量一樣 - - 位置不重要 - - "(原版合成檯)" - name: 無序合成 - smoking: - lore: - - 加熱燒一燒 - - 成品出來了! - name: 煙燻爐合成表 - stonecutting: - lore: - - 上去磨一磨 - - "\t\n成品出來了!" - name: 切石機合成表 slimefun: - ancient_altar: + multiblock: + name: 多重方塊 lore: - - 使用古代祭壇 - - 合成出該物品 - - 到古代祭壇頁面獲取更多資訊 - name: 古代祭壇(Ancient Altar) - armor_forge: - lore: - - 在盔甲鍛造檯中 - - 鍛造出該物品 - name: 盔甲鍛造檯(Armor Forge) - compressor: - lore: - - 使用壓縮機 - - 壓縮出該物品 - name: 壓縮機(Compressor) + - 在世界中蓋出該結構 + - 這不是一個可合成的物品 enhanced_crafting_table: + name: 進階合成檯(Enhanced Crafting Table) lore: - 在進階合成檯中 - 合成出該物品 - 原版工作檯沒用喔 - name: 進階合成檯(Enhanced Crafting Table) - food_composter: + armor_forge: + name: 盔甲鍛造檯(Armor Forge) lore: - - 使用堆肥機 - - 製造該物品 - name: 堆肥機(Food Composter) - food_fabricator: + - 在盔甲鍛造檯中 + - 鍛造出該物品 + grind_stone: + name: 研磨機(Grind Stone) lore: - - 使用食品加工場 - - 製造該物品 - name: 食品加工場(Food Fabricator) + - 在研磨機中 + - 研磨出該物品 + smeltery: + name: 冶(一ㄝˇ )煉爐(Smeltery) + lore: + - 在冶煉爐中 + - 冶煉出該物品 + ore_crusher: + name: 礦石粉碎機(Ore Crusher) + lore: + - 使用礦石粉碎機 + - 粉碎出該物品 + mob_drop: + name: 怪物掉落物 + lore: + - 擊殺該怪物 + - 以取得該物品 gold_pan: + name: 掏金盤(Gold Pan)[工具區] lore: - '使用掏金盤 ' - 篩出此物品 - name: 掏金盤(Gold Pan)[工具區] - grind_stone: + compressor: + name: 壓縮機(Compressor) lore: - - 在研磨機中 - - 研磨出該物品 - name: 研磨機(Grind Stone) - heated_pressure_chamber: - lore: - - 使用高溫加壓室 + - 使用壓縮機 - 壓縮出該物品 - name: |- - 高溫加壓室 - (Heated Pressure Chamber) - juicer: - lore: - - 使用果汁機 - - 榨出蓋物品 - name: 果汁機(Juicer) - magic_workbench: - lore: - - 使用魔法合成檯 - - 合成出該物品 - name: 魔法合成檯(Magic Workbench) - mob_drop: - lore: - - 擊殺該怪物 - - 以取得該物品 - name: 怪物掉落物 - multiblock: - lore: - - 在世界中蓋出該結構 - - 這不是一個可合成的物品 - name: 多重方塊 - ore_crusher: - lore: - - 使用礦石粉碎機 - - 粉碎出該物品 - name: 礦石粉碎機(Ore Crusher) - ore_washer: - lore: - - 使用礦物洗滌機 - - 篩出該物品 - name: 礦物洗滌機(Ore Washer) pressure_chamber: + name: 加壓室(Pressure Chamber) lore: - 使用加壓室 - 壓縮出該物品 - name: 加壓室(Pressure Chamber) - smeltery: + ore_washer: + name: 礦物洗滌機(Ore Washer) lore: - - 在冶煉爐中 - - 冶煉出該物品 - name: 冶(一ㄝˇ )煉爐(Smeltery) + - 使用礦物洗滌機 + - 篩出該物品 + juicer: + name: 果汁機(Juicer) + lore: + - 使用果汁機 + - 榨出蓋物品 + magic_workbench: + name: 魔法合成檯(Magic Workbench) + lore: + - 使用魔法合成檯 + - 合成出該物品 + ancient_altar: + name: 古代祭壇(Ancient Altar) + lore: + - 使用古代祭壇 + - 合成出該物品 + - 到古代祭壇頁面獲取更多資訊 + heated_pressure_chamber: + name: |- + 高溫加壓室 + (Heated Pressure Chamber) + lore: + - 使用高溫加壓室 + - 壓縮出該物品 + food_fabricator: + name: 食品加工場(Food Fabricator) + lore: + - 使用食品加工場 + - 製造該物品 + food_composter: + name: 堆肥機(Food Composter) + lore: + - 使用堆肥機 + - 製造該物品 freezer: name: 冷凍艙(Freezer) lore: @@ -160,3 +122,46 @@ slimefun: lore: - 使用煉油廠 - 提煉該物品 +minecraft: + shaped: + name: 有序合成 + lore: + - 數量一樣 + - 位置一致 + - "(原版合成檯)" + shapeless: + name: 無序合成 + lore: + - 數量一樣 + - 位置不重要 + - "(原版合成檯)" + furnace: + name: 熔爐合成表 + lore: + - 加熱燒一燒 + - 成品出來了! + blasting: + name: 高爐合成表 + lore: + - 加熱燒一燒 + - 成品出來了! + smoking: + name: 煙燻爐合成表 + lore: + - 加熱燒一燒 + - 成品出來了! + campfire: + name: 營火合成表 + lore: + - 加熱燒一燒 + - "\t\n成品出來了!" + stonecutting: + name: 切石機合成表 + lore: + - 上去磨一磨 + - "\t\n成品出來了!" + smithing: + name: 鍛造台合成表 + lore: + - 鍛造一下下 + - 成品出來了 From 3ba284746b5a34474715af8a7c867d28d9f082f1 Mon Sep 17 00:00:00 2001 From: HeroBrineKing Date: Fri, 26 Jun 2020 21:51:18 +0000 Subject: [PATCH 09/24] Translate researches_zh-TW.yml via GitLocalize --- .../resources/languages/researches_zh-TW.yml | 424 +++++++++--------- 1 file changed, 215 insertions(+), 209 deletions(-) diff --git a/src/main/resources/languages/researches_zh-TW.yml b/src/main/resources/languages/researches_zh-TW.yml index 39c4bcd5a..d4625c9d1 100644 --- a/src/main/resources/languages/researches_zh-TW.yml +++ b/src/main/resources/languages/researches_zh-TW.yml @@ -1,232 +1,238 @@ --- slimefun: - 24k_gold_block: 我就有錢 - advanced_android: 進階機器人 - advanced_butcher_android: 進階機器人–屠夫 - advanced_circuit_board: 進階電路板 - advanced_electric_smeltery: 進階電動冶煉爐 - advanced_farmer_android: 進階機器人—農夫 - advanced_fisherman_android: 進階機器人— 漁夫 - advanced_output_node: 進階輸出接口 - alloys: 進階合金 - ancient_altar: 古代祭壇 - ancient_runes: 元素符文 - android_interfaces: 機器人接口 - android_memory_core: 機器人記憶體 - angel_talisman: 天使護身符 - animal_growth_accelerator: 動物轉大人 - anvil_talisman: 鐵砧護身符 - armored_jetboots: 火箭鐵靴 - armored_jetpack: 噴射裝甲 + walking_sticks: 拐杖 + portable_crafter: 隨身合成檯 + fortune_cookie: 幸運餅乾 + portable_dustbin: 隨身垃圾桶 + meat_jerky: 肉乾 armor_forge: 盔甲合成檯 - auto_anvil: 電動鐵砧 - auto_breeder: 幫你餵動物 - auto_drier: 乾燥機 - auto_enchanting: 附魔&退魔檯 - automated_crafting_chamber: 自動合成檯 - automated_panning_machine: 懶人掏金盤 - automatic_ignition_chamber: 自動點火 - backpacks: 背包 + glowstone_armor: 螢光石套裝 + lumps: 魔法結晶 + ender_backpack: 終界背包 + ender_armor: 終界套裝 + magic_eye_of_ender: 終界法眼 + magic_sugar: 魔法糖 + monster_jerky: 腐肉乾 + slime_armor: 史萊姆套裝 + sword_of_beheading: 斬首劍 basic_circuit_board: 基礎電路板 + advanced_circuit_board: 進階電路板 + smeltery: 冶煉爐 + steel: 鋼鐵時代 + misc_power_items: 硫酸鹽和能量水晶 battery: 電池 - better_carbon_press: 升級版碳壓縮機 - better_crop_growth_accelerator: 金坷垃2.0 - better_electric_crucibles: 電熱坩堝—改 - better_electric_furnace: 升級版電磁爐 - better_food_fabricator: 進階食品加工場 - better_freezer: 比你的笑話還冷 - better_gps_transmitters: 高階GPS信號發送器 - better_heated_pressure_chamber: 進階高溫加壓室 - better_solar_generators: 高階太陽能發電機 - bio_reactor: 生化反應爐 - blade_of_vampires: 吸血之刃 - blistering_ingots: 發泡錠 - block_placer: 方塊放置器 - boosted_uranium: 高壓鈾 - boots_of_the_stomper: 踐踏之靴 - bound_armor: 魂綁套裝 - bound_backpack: 魂綁背包 - bound_tools: 魂綁工具 - bound_weapons: 魂綁武器 - bronze: 青銅時代 - butcher_androids: 屠夫機器人 + steel_plate: 鋼板 + steel_thruster: 鋼製推進器 + parachute: 降落傘 + grappling_hook: 鷹爪鉤 + jetpacks: 噴射背包 + multitools: 多功能工具 + solar_panel_and_helmet: 太陽能頭盔 + elemental_staff: 元素杖 + grind_stone: 研磨機 cactus_armor: 仙人掌套裝 - capacitors: 初階電容器 - carbonado: 黑鑽石 - carbonado_furnace: 碳纖維熔爐 - carbonado_tools: 頂級機器 - carbon_press: 碳壓縮機 - cargo_basics: 物流基礎 - cargo_nodes: 物流節點 - chainmail_armor: 鎖鍊套裝 - charging_bench: 充電台 - coal_generator: 乾淨的煤 - cobalt_pickaxe: 我是速度 - combustion_reactor: 火力反應爐 - common_talisman: 基礎護身符 - composter: 堆肥 + gold_pan: 掏金盤 + magical_book_cover: 魔法書封面 + slimefun_metals: 更多金屬 + ore_crusher: 雙倍礦物 + bronze: 青銅時代 + alloys: 進階合金 compressor_and_carbon: 壓縮碳 - cooler: 保溫器 - copper_wire: 良導體! - crop_growth_accelerator: 金坷垃 - crucible: 坩鍋 - crushed_ore: 礦石純化 + gilded_iron_armor: 鍍金鐵套裝 + synthetic_diamond: 合成鑽石 + pressure_chamber: 加壓室 + synthetic_sapphire: 合成藍寶石 damascus_steel: 大馬士革鋼 damascus_steel_armor: 大馬士革鋼套裝 - diet_cookie: 減肥餅 - duct_tape: FLEX TAPE - electric_crucible: 電動坩堝 - electric_furnaces: 電磁爐 - electric_ingot_machines: 電動煉錠產業鍊 + reinforced_alloy: 強化合金錠 + carbonado: 黑鑽石 + magic_workbench: 魔術合成檯 + wind_staff: 元素杖—風 + reinforced_armor: 強化合金錠套裝 + ore_washer: 礦物洗滌機 + gold_carats: 純金 + silicon: 麥塊矽谷 + fire_staff: 元素杖—火 + smelters_pickaxe: 冶煉鎬 + common_talisman: 基礎護身符 + anvil_talisman: 鐵砧護身符 + miner_talisman: 礦工護身符 + hunter_talisman: 獵人護身符 + lava_talisman: 熔岩護身符 + water_talisman: 水中呼吸護身符 + angel_talisman: 天使護身符 + fire_talisman: 火焰護身符 + lava_crystal: 燒喔~ + magician_talisman: 法師護身符 + traveller_talisman: 旅者護身符 + warrior_talisman: 戰士護身符 + knight_talisman: 騎士護身符 + gilded_iron: 鍍金鐵 + synthetic_emerald: 人造翡翠 + chainmail_armor: 鎖鍊套裝 + whirlwind_talisman: 旋風護身符 + wizard_talisman: 巫師護身符 + lumber_axe: 伐木斧 + hazmat_suit: 抗輻射套裝 + uranium: 輻射金屬 + crushed_ore: 礦石純化 + redstone_alloy: 紅石合金錠 + carbonado_tools: 頂級機器 + first_aid: 急救包 + gold_armor: 比較強的金裝 + night_vision_googles: 夜視鏡 + pickaxe_of_containment: 生怪磚鎬 + hercules_pickaxe: 粉碎鎬 + table_saw: 鋸木機 + slime_steel_armor: 鋼鐵史萊姆套裝 + blade_of_vampires: 吸血之刃 + water_staff: 元素杖—水 + 24k_gold_block: 我就有錢 + composter: 堆肥 + farmer_shoes: 農夫鞋 + explosive_tools: 爆炸性的突破 + automated_panning_machine: 懶人掏金盤 + boots_of_the_stomper: 踐踏之靴 + pickaxe_of_the_seeker: 合法X-ray + backpacks: 背包 + woven_backpack: 手織背包 + crucible: 坩鍋 + gilded_backpack: 鍍金背包 + armored_jetpack: 噴射裝甲 + ender_talismans: 放終界箱 + nickel_and_cobalt: 這是元素不是合金啊啊啊啊啊 + magnet: 磁鐵 + infused_magnet: 物品磁鐵 + cobalt_pickaxe: 我是速度 + essence_of_afterlife: 死靈法師?! + bound_backpack: 魂綁背包 + jetboots: 火箭靴 + armored_jetboots: 火箭鐵靴 + seismic_axe: 地震斧 + pickaxe_of_vein_mining: 連鎖鎬 + bound_weapons: 魂綁武器 + bound_tools: 魂綁工具 + bound_armor: 魂綁套裝 + juicer: 果汁! + repaired_spawner: 修理生怪磚 + enhanced_furnace: 進階熔爐 + more_enhanced_furnaces: 更好的進階熔爐 + high_tier_enhanced_furnaces: 更高階的熔爐 + reinforced_furnace: 強化熔爐 + carbonado_furnace: 碳纖維熔爐 electric_motor: 馬達 + block_placer: 方塊放置器 + scroll_of_dimensional_teleposition: 他很奇異~ + special_bows: 鷹眼 + tome_of_knowledge_sharing: 共產經驗 + flask_of_knowledge: 經驗值儲存器 + hardened_glass: 抗爆 + golden_apple_juice: 比較黃的果汁 + cooler: 保溫器 + ancient_altar: 古代祭壇 + wither_proof_obsidian: 抗凋黑曜石 + ancient_runes: 元素符文 + special_runes: 紫色符文 + infernal_bonemeal: 地獄骨粉 + rainbow_blocks: 彩虹方塊 + infused_hopper: 滴水不漏 + wither_proof_glass: 抗凋玻璃 + duct_tape: FLEX TAPE + plastic_sheet: 塑膠 + android_memory_core: 機器人記憶體 + oil: 美國的最愛 + fuel: 石油燃料 + hologram_projector: 投影文字 + capacitors: 初階電容器 + high_tier_capacitors: 高階電容器 + solar_generators: 太陽能發機 + electric_furnaces: 電磁爐 electric_ore_grinding: 電動研磨 - electric_press: 電動壓縮機 - electric_smeltery: 電動冶煉爐 - elemental_staff: 元素杖 + heated_pressure_chamber: 高溫加壓室 + coal_generator: 乾淨的煤 + bio_reactor: 生化反應爐 + auto_enchanting: 附魔&退魔檯 + auto_anvil: 電動鐵砧 + multimeter: 電力測量 + gps_setup: GPS基礎組件 + gps_emergency_transmitter: GPS求救信號 + programmable_androids: 機器人 + android_interfaces: 機器人接口 + geo_scanner: 地質掃描 + combustion_reactor: 火力反應爐 + teleporter: 傳送檯基座 + teleporter_activation_plates: 傳送裝置 + better_solar_generators: 高階太陽能發電機 + better_gps_transmitters: 高階GPS信號發送器 elevator: 電梯 - elytra: 鞘翅 + energized_solar_generator: 這...這不科學! + energized_gps_transmitter: 頂級GPS信號發送器 + energy_regulator: 電力核心 + butcher_androids: 屠夫機器人 + organic_food: 有機食品 + auto_breeder: 幫你餵動物 + advanced_android: 進階機器人 + advanced_butcher_android: 進階機器人–屠夫 + advanced_fisherman_android: 進階機器人— 漁夫 + animal_growth_accelerator: 動物轉大人 + xp_collector: 經驗收集器 + organic_fertilizer: 有機堆肥 + crop_growth_accelerator: 金坷垃 + better_crop_growth_accelerator: 金坷垃2.0 + reactor_essentials: 反應爐必需品 + nuclear_reactor: 核分裂反應爐 + freezer: 我的超人裝呢 + cargo_basics: 物流基礎 + cargo_nodes: 物流節點 + electric_ingot_machines: 電動煉錠產業鍊 + high_tier_electric_ingot_machines: 高速煉錠產業鍊 + automated_crafting_chamber: 自動合成檯 + better_food_fabricator: 進階食品加工場 + reactor_access_port: 反應爐接口 + fluid_pump: 幫浦 + better_freezer: 比你的笑話還冷 + boosted_uranium: 高壓鈾 + trash_can: 黑洞! + advanced_output_node: 進階輸出接口 + carbon_press: 碳壓縮機 + electric_smeltery: 電動冶煉爐 + better_electric_furnace: 升級版電磁爐 + better_carbon_press: 升級版碳壓縮機 empowered_android: 頂級機器人 empowered_butcher_android: 頂級機器人-屠夫 empowered_fisherman_android: 頂級機器人—漁夫 - ender_armor: 終界套裝 - ender_backpack: 終界背包 - ender_talismans: 放終界箱 - energized_gps_transmitter: 頂級GPS信號發送器 - energized_solar_generator: 這...這不科學! - energy_regulator: 電力核心 - enhanced_furnace: 進階熔爐 - essence_of_afterlife: 死靈法師?! - explosive_tools: 爆炸性的突破 - farmer_shoes: 農夫鞋 - fire_staff: 元素杖—火 - fire_talisman: 火焰護身符 - first_aid: 急救包 - flask_of_knowledge: 經驗值儲存器 - fluid_pump: 幫浦 - fortune_cookie: 幸運餅乾 - freezer: 我的超人裝呢 - fuel: 石油燃料 - geo_miner: 自然資源挖掘機 - gilded_backpack: 鍍金背包 - gilded_iron: 鍍金鐵 - gilded_iron_armor: 鍍金鐵套裝 - glowstone_armor: 螢光石套裝 - gold_armor: 比較強的金裝 - gold_carats: 純金 - golden_apple_juice: 比較黃的果汁 - gold_pan: 掏金盤 - gps_emergency_transmitter: GPS求救信號 - gps_setup: GPS基礎組件 - grappling_hook: 鷹爪鉤 - grind_stone: 研磨機 - hardened_glass: 抗爆 - hazmat_suit: 抗輻射套裝 - heated_pressure_chamber: 高溫加壓室 - hercules_pickaxe: 粉碎鎬 - high_tier_capacitors: 高階電容器 high_tier_carbon_press: 終極碳壓縮機 - high_tier_electric_ingot_machines: 高速煉錠產業鍊 - high_tier_enhanced_furnaces: 更高階的熔爐 - hologram_projector: 投影文字 - hunter_talisman: 獵人護身符 - infernal_bonemeal: 地獄骨粉 - infused_hopper: 滴水不漏 - infused_magnet: 物品磁鐵 - jetboots: 火箭靴 - jetpacks: 噴射背包 - juicer: 果汁! - kelp_cookie: 自然的顏 - knight_talisman: 騎士護身符 - lava_crystal: 燒喔~ + wither_assembler: 凋零農場 + better_heated_pressure_chamber: 進階高溫加壓室 + elytra: 鞘翅 + special_elytras: 特殊鞘翅 + electric_crucible: 電動坩堝 + better_electric_crucibles: 電熱坩堝—改 + advanced_electric_smeltery: 進階電動冶煉爐 + advanced_farmer_android: 進階機器人—農夫 lava_generator: 熔岩發電機 - lava_talisman: 熔岩護身符 - lightning_rune: 閃電符文 - lumber_axe: 伐木斧 - lumps: 魔法結晶 - magical_book_cover: 魔法書封面 - magic_eye_of_ender: 終界法眼 - magician_talisman: 法師護身符 - magic_sugar: 魔法糖 - magic_workbench: 魔術合成檯 - magnesium_generator: 鎂鹽發電 - magnet: 磁鐵 - meat_jerky: 肉乾 - miner_talisman: 礦工護身符 - misc_power_items: 硫酸鹽和能量水晶 - monster_jerky: 腐肉乾 - more_enhanced_furnaces: 更好的進階熔爐 - multimeter: 電力測量 - multitools: 多功能工具 - nether_gold_pan: 地域掏金盤 nether_ice: 地域冰 nether_star_reactor: 地域之星反應堆 - nickel_and_cobalt: 這是元素不是合金啊啊啊啊啊 - night_vision_googles: 夜視鏡 - nuclear_reactor: 核分裂反應爐 - oil: 美國的最愛 - ore_crusher: 雙倍礦物 - ore_washer: 礦物洗滌機 - organic_fertilizer: 有機堆肥 - organic_food: 有機食品 + blistering_ingots: 發泡錠 + automatic_ignition_chamber: 自動點火 output_chest: 基礎器械輸出箱 - parachute: 降落傘 - pickaxe_of_containment: 生怪磚鎬 - pickaxe_of_the_seeker: 合法X-ray - pickaxe_of_vein_mining: 連鎖鎬 - plastic_sheet: 塑膠 - portable_crafter: 隨身合成檯 - portable_dustbin: 隨身垃圾桶 - pressure_chamber: 加壓室 - programmable_androids: 機器人 + copper_wire: 良導體! radiant_backpack: 超級背包 - rainbow_blocks: 彩虹方塊 - reactor_access_port: 反應爐接口 - reactor_essentials: 反應爐必需品 - redstone_alloy: 紅石合金錠 - reinforced_alloy: 強化合金錠 - reinforced_armor: 強化合金錠套裝 - reinforced_furnace: 強化熔爐 - repaired_spawner: 修理生怪磚 - scroll_of_dimensional_teleposition: 他很奇異~ - seismic_axe: 地震斧 - silicon: 麥塊矽谷 - slime_armor: 史萊姆套裝 - slimefun_metals: 更多金屬 - slime_steel_armor: 鋼鐵史萊姆套裝 - smelters_pickaxe: 冶煉鎬 - smeltery: 冶煉爐 - solar_generators: 太陽能發機 - solar_panel_and_helmet: 太陽能頭盔 - soulbound_rune: 魂綁符文 - special_bows: 鷹眼 - special_elytras: 特殊鞘翅 - special_runes: 紫色符文 - steel: 鋼鐵時代 - steel_plate: 鋼板 - steel_thruster: 鋼製推進器 + auto_drier: 乾燥機 + diet_cookie: 減肥餅 storm_staff: 元素杖—風暴 - sword_of_beheading: 斬首劍 - synthetic_diamond: 合成鑽石 - synthetic_emerald: 人造翡翠 - synthetic_sapphire: 合成藍寶石 - table_saw: 鋸木機 - teleporter: 傳送檯基座 - teleporter_activation_plates: 傳送裝置 - tome_of_knowledge_sharing: 共產經驗 + soulbound_rune: 魂綁符文 + geo_miner: 自然資源挖掘機 + lightning_rune: 閃電符文 totem_of_undying: 逃避死亡 - trash_can: 黑洞! - traveller_talisman: 旅者護身符 - uranium: 輻射金屬 - walking_sticks: 拐杖 - warrior_talisman: 戰士護身符 - water_staff: 元素杖—水 - water_talisman: 水中呼吸護身符 - whirlwind_talisman: 旋風護身符 - wind_staff: 元素杖—風 - wither_assembler: 凋零農場 - wither_proof_glass: 抗凋玻璃 - wither_proof_obsidian: 抗凋黑曜石 - wizard_talisman: 巫師護身符 - woven_backpack: 手織背包 - xp_collector: 經驗收集器 - geo_scanner: 地質掃描 + charging_bench: 充電台 + nether_gold_pan: 地域掏金盤 + electric_press: 電動壓縮機 + magnesium_generator: 鎂鹽發電 + kelp_cookie: 自然的顏 + makeshift_smeltery: 自動冶煉 + tree_growth_accelerator: 自動金坷垃 + industrial_miner: 工業化採礦 + advanced_industrial_miner: 工業化採礦 - 改 + magical_zombie_pills: 救贖藥丸 + auto_brewer: 工業化釀造 From 758e687783ba6146306ef8233e772444a65bb429 Mon Sep 17 00:00:00 2001 From: HeroBrineKing Date: Fri, 26 Jun 2020 21:51:20 +0000 Subject: [PATCH 10/24] Translate messages_zh-TW.yml via GitLocalize --- .../resources/languages/messages_zh-TW.yml | 496 +++++++++--------- 1 file changed, 260 insertions(+), 236 deletions(-) diff --git a/src/main/resources/languages/messages_zh-TW.yml b/src/main/resources/languages/messages_zh-TW.yml index 572635929..26b65a0d6 100644 --- a/src/main/resources/languages/messages_zh-TW.yml +++ b/src/main/resources/languages/messages_zh-TW.yml @@ -1,219 +1,133 @@ --- -android: - scripts: - already-uploaded: "&4程式已上傳" - editor: 程式編輯器 - enter-name: - - - - "&e輸入程式名稱" - instructions: - ATTACK_ANIMALS: "&4攻擊&c動物" - ATTACK_ANIMALS_ADULT: "&4攻擊&c成年動物" - ATTACK_MOBS: "&4攻擊&c主動怪" - ATTACK_MOBS_ANIMALS: "&4攻擊&c主動怪和動物" - CATCH_FISH: "&b嘗試抓魚" - CHOP_TREE: "&c砍完整棵樹並重種" - DIG_DOWN: "&b挖下面" - DIG_FORWARD: "&b挖前面" - DIG_UP: "&b挖上面" - FARM_DOWN: "&b向下收割並重種" - FARM_EXOTIC_DOWN: "&b進階向下收割並重種" - FARM_EXOTIC_FORWARD: "&b進階向前收割並重種" - FARM_FORWARD: "&b向前收割並重種" - GO_DOWN: "&7向下移動" - GO_FORWARD: "&7向前移動" - GO_UP: "&7向上移動" - INTERFACE_FUEL: "&c從燃料節點取得燃料" - INTERFACE_ITEMS: "&c向物品節點輸入物品" - MOVE_AND_DIG_DOWN: "&b挖並向下移動" - MOVE_AND_DIG_FORWARD: "&b挖並向前移動" - MOVE_AND_DIG_UP: "&b挖並向上移動" - REPEAT: "&9重複程式" - START: "&2執行程式" - TURN_LEFT: "&7左轉" - TURN_RIGHT: "&7右轉" - WAIT: "&e等0.5秒" - rating: - already: "&4你已經評價過此程式!" - own: "&4你不能評價自己的程式!" - uploaded: - - "&b上傳中" - - "&a成功上傳程式!" - started: "&7機器人繼續運作" - stopped: "&7機器人暫停運作" -anvil: - not-working: "&4科技物品需要用自動鐵砧+修理膠帶!" -backpack: - already-open: "&c別人正在使用這個背包!" - no-stack: "&c背包不能疊!" commands: + help: 顯示此幫助畫面 cheat: 允許您以作弊取得物品 give: 給其他玩家Slimefun物品 guide: 給自己一個Slimefun指南 - help: 顯示此幫助畫面 + timings: 關於您的伺服器的卡頓信息 + teleporter: 查看其他玩家的位置標點 + versions: 列出所有已安裝的附屬插件 + search: 在指南中搜索輸入的字句 open_guide: 打開Slimefun指南(不使用書本) + stats: 顯示玩家的統計數據 research: description: 解鎖/重置玩家的研究項目 reset: "&c你已使%player%變回智障" reset-target: "&c你變回笨蛋了" - search: 在指南中搜索輸入的字句 - stats: 顯示玩家的統計數據 - teleporter: 查看其他玩家的位置標點 - timings: 關於您的伺服器的卡頓信息 - versions: 列出所有已安裝的附屬插件 -gps: - deathpoint: "&4死亡點&7%date%" - geo: - scan-required: "&4請先做地質掃描" - insufficient-complexity: - - "&4GPS信號不足 &c%complexity%" - - "&4a) GPS基礎設施未放置" - - "&4b)GPS信號不足" - waypoint: - added: "&a成功新增傳送點" - max: "&4傳送點已達上限" - new: "&e輸入傳送點名稱 &7(Color Codes supported!)" + backpack: + description: 檢索已存在背包的副本 + invalid-id: "&4ID不能是負數!" + player-never-joined: "&4找不到該ID的玩家" + backpack-does-not-exist: "&4該背包不存在!" + restored-backpack-given: "&a你的背包已被修復並放到你的物品欄中!" guide: - back: - guide: 回到Slimefun指南 - settings: 回到設定介面 - title: 上一頁 + search: + message: "&c你要搜尋什麼?" + name: "&7搜尋..." + tooltip: "&b點擊以尋找物品" + inventory: '尋找: %item%' + lore: + - "&b您要搜尋什麼?" + - "&7請輸入搜尋字句到聊天" cheat: no-multiblocks: "&4您不能靠作弊取得多方塊結構機械,你必須用蓋的!" - credits: - commit: 成員 - commits: 成員 - profile-link: 點擊觀看他們在GitHub上的個人資料 - roles: - developer: "&6開發人員" - resourcepack: "&7資源包製作人員" - translator: "&9翻譯人員" - wiki: "&3Wiki編輯人員" languages: + updated: "&a你的語言已改成: &b%lang%" + translations: + name: "&a缺少什麼嗎?" + lore: 點擊增加您自己的翻譯 select: 點擊選擇此語言 select-default: 點擊選擇默認語言 selected-language: 當前選擇: - translations: - lore: 點擊增加您自己的翻譯 - name: "&a缺少什麼嗎?" - updated: "&a你的語言已改成: &b%lang%" + title: + main: Slimefun指南 + settings: 設置及資訊 + languages: 請選擇您偏好的語言 + credits: Slimefun4貢獻者 + wiki: Slimefun4 Wiki + addons: Slimefun4的附加插件 + bugs: 錯誤報告 + source: 來源代碼 + credits: + commit: 成員 + commits: 成員 + roles: + developer: "&6開發人員" + wiki: "&3Wiki編輯人員" + resourcepack: "&7資源包製作人員" + translator: "&9翻譯人員" + profile-link: 點擊觀看他們在GitHub上的個人資料 + pages: + previous: 上一頁 + next: 下一頁 + tooltips: + open-category: 點擊開啟 + versions-notice: 這些在報告錯誤時非常重要! + wiki: 在Slimefun官方Wiki上查看此物品 + recipes: + machine: 使用本機械的合成表 + miner: 此挖礦機可獲取的資源 + generator: 可以使用的燃料 + gold-pan: 可以獲取的資源 + back: + title: 上一頁 + guide: 回到Slimefun指南 + settings: 回到設定介面 locked: 已鎖定 locked-category: - 要解鎖此分類 - 必須先解鎖下列分類 - 的所有物品 - pages: - next: 下一頁 - previous: 上一頁 - search: - inventory: '尋找: %item%' - lore: - - "&b您要搜尋什麼?" - - "&7請輸入搜尋字句到聊天" - message: "&c你要搜尋什麼?" - name: "&7搜尋..." - tooltip: "&b點擊以尋找物品" - title: - addons: Slimefun4的附加插件 - bugs: 錯誤報告 - credits: Slimefun4貢獻者 - languages: 請選擇您偏好的語言 - main: Slimefun指南 - settings: 設置及資訊 - source: 來源代碼 - wiki: Slimefun4 Wiki - tooltips: - open-category: 點擊開啟 - recipes: - generator: 可以使用的燃料 - gold-pan: 可以獲取的資源 - machine: 使用本機械的合成表 - miner: 此挖礦機可獲取的資源 - versions-notice: 這些在報告錯誤時非常重要! - wiki: 在Slimefun官方Wiki上查看此物品 -inventory: - no-access: "&4沒有權限使用該物品" -languages: - af: 南非語 - ar: 阿拉伯文 - bg: 保加利亞語 - cs: 捷克文 - da: 丹麥文 - de: 德語 - default: 默認 - el: 希臘語 - en: 英語 - es: 西班牙文 - fa: 波斯語 - fi: 芬蘭文 - fr: 法文 - he: 希伯來語 - hu: 匈牙利文 - id: 印尼語 - it: 義大利文 - ja: 日語 - ko: 韓語 - lv: 拉脫維亞語 - ms: 馬來語 - nl: 荷蘭語 - 'no': 挪威 - pl: 波蘭語 - pt: 葡萄牙文(葡萄牙) - pt-BR: 葡萄牙文(巴西) - ro: 羅馬尼亞語 - ru: 俄語 - sk: 斯洛伐克文 - sv: 瑞典語 - th: 泰語 - tr: 土耳其 - uk: 烏克蘭文 - vi: 越南文 - zh-CN: 中文(簡體) - zh-TW: 中文(繁體) -machines: - ANCIENT_ALTAR: - not-enough-pedestals: "&4此祭壇需要更多基座&c(%pedestals% / 8)" - unknown-catalyst: "&4未知中心物品! &c請檢察合成表!" - unknown-recipe: "&4未知合成表! &c請檢察合成表!" - ANCIENT_PEDESTAL: - obstructed: "&4基座被擋住了! &c移除上方的方塊!" - CARGO_NODES: - must-be-placed: "&4必須連接在箱子或機器旁!" - ELEVATOR: - click-to-teleport: "&e按這 &7來傳送到該樓:" - current-floor: "&e這是你現在的樓層:" - enter-name: "&7輸入你的樓層名稱&r(可以輸入顏色代碼!)" - named: "&2成功命名為 &r%floor%" - no-destinations: "&4沒有目的地" - pick-a-floor: "&3選擇樓層" - full-inventory: "&e發射器滿了!(請考慮使用基礎機械輸出箱)" - GPS_CONTROL_PANEL: - title: GPS控制面板 - transmitters: 訊號發射器總覽 - waypoints: 傳送點總覽 - HOLOGRAM_PROJECTOR: - enter-text: "&7輸入你想要的文字 &r(可以輸入顏色代碼!)" - inventory-title: 全息投影編輯器 - ignition-chamber-no-flint: "&c點火系統沒有打火石" - in-use: "&c別人正在使用這台機器" - pattern-not-found: "&e查無此合成表 請確認使用的機器或合成表的材料" - TELEPORTER: - cancelled: "&4傳送中止!" - gui: - time: 估計時間 - title: 你的標記點 - tooltip: 點擊以傳送 - invulnerability: "&b&l你得到了30秒的無敵!" - teleported: "&3傳送成功!" - teleporting: "&3傳送中..." - unknown-material: "&e這個機器不能處理這個物品 請確認使用的機器或合成表的材料" - wrong-item: "&e你手持的物品和機器並不相容 請確認使用的機器或合成表的材料" messages: - cannot-place: "&c那裡不能放方塊!" - diet-cookie: "&e你開始覺得很輕..." + not-researched: "&4你太笨了" + not-enough-xp: "&4你沒有足夠的經驗值用以解鎖這個" + unlocked: "&b你已解鎖&7“%research%”" + only-players: "&4此命令只可由玩家發送" + unknown-player: "&4未知玩家:&c%player%" + no-permission: "&4您沒有執行此動作所需的權限" + usage: "&4用法: &c%usage%" + not-online: "&4%player% &c還未上線!" + not-valid-item: "&4%item% &c不存在!" + not-valid-amount: "&4%amount% &c不是有效數量:數值必須大於0!" + given-item: '&b你已獲得 &a%amount% &7"%item%&7"' + give-item: '&b你已給予%player% &a%amount% &7"%item%&7"' + not-valid-research: "&4%research% &c不存在!" + give-research: '&b你已給予%player% 研究項目&7"%research%&7"' + hungry: "&c你太餓了,做不了這個!" + mode-change: "&b%device% 模式切換至: &9%mode%" disabled-in-world: "&4&l此物品在此世界中已被禁用" disabled-item: "&4&l此物品已被禁用!你到底是怎樣得到的?" + no-tome-yourself: "&c你不能在自己身上使用 &4知識之書&c..." + multimeter: "&b已儲存的能量:&3%stored% &b最大容量:&3%capacity%" + talisman: + anvil: "&a&o你的護符免了您的工具於斷裂" + miner: "&a&o你的護符剛雙倍了你的掉落" + hunter: "&a&o你的護符剛雙倍了你的掉落" + lava: "&a&o你的護符把你從被燒死的命運中救出" + water: "&a&o你的護身符給了你空氣" + angel: "&a&o你的護身符使你免疫摔落傷害" + fire: "&a&o你的護身符使你沒有燒死" + magician: "&a&o你的護身符給了你額外的附魔" + traveller: "&a&o你的護身符給了你速度3" + warrior: "&a&o你的護身符暫時提高了你的力量" + knight: "&a&o你的護身符給了你5秒的回復時間" + whirlwind: "&a&o你的護身符反射了投射物" + wizard: "&a&o你的護身符為你升高了幸運等級,但也降低了其他附魔等級" + soulbound-rune: + fail: "&c你一次只能魂綁一個物品。" + success: "&a您已成功將此物品綁定魂綁!死後不會噴掉。" + research: + start: "&7遠古之靈在你耳邊低語!" + progress: "&7你開始研究&b%research% &e(%progress%)" fire-extinguish: "&7你熄滅身上的火" + cannot-place: "&c那裡不能放方塊!" + no-pvp: "&c這裡不准打架!" + radiation: "&4你正暴露在致命的輻射之下!&c立即丟棄放射性物品或裝備完整的防護服!" + opening-guide: "&b正在打開指南,這可能需要幾秒鐘的時間..." + opening-backpack: "&b正在打開背包,這可能需要幾秒鐘的時間..." + no-iron-golem-heal: "&c這不是鐵錠。你不能用它來治癒鐵巨人!" + link-prompt: "&e點擊此處:" + diet-cookie: "&e你開始覺得很輕..." fortune-cookie: - "&7快來幫幫我!我在幸運餅乾工廠裡出不了來!" - "&7明天會有苦力怕歡樂送" @@ -225,51 +139,161 @@ messages: - "&742, 萬物的答案" - "&7Walshy會使你每天開開心心\n" - "&7不要垂直往下挖!" - give-item: '&b你已給予%player% &a%amount% &7"%item%&7"' - given-item: '&b你已獲得 &a%amount% &7"%item%&7"' - give-research: '&b你已給予%player% 研究項目&7"%research%&7"' - hungry: "&c你太餓了,做不了這個!" - link-prompt: "&e點擊此處:" - mode-change: "&b%device% 模式切換至: &9%mode%" - multimeter: "&b已儲存的能量:&3%stored% &b最大容量:&3%capacity%" - no-iron-golem-heal: "&c這不是鐵錠。你不能用它來治癒鐵巨人!" - no-permission: "&4您沒有執行此動作所需的權限" - no-pvp: "&c這裡不准打架!" - not-enough-xp: "&4你沒有足夠的經驗值用以解鎖這個" - no-tome-yourself: "&c你不能在自己身上使用 &4知識之書&c..." - not-online: "&4%player% &c還未上線!" - not-researched: "&4你太笨了" - not-valid-amount: "&4%amount% &c不是有效數量:數值必須大於0!" - not-valid-item: "&4%item% &c不存在!" - not-valid-research: "&4%research% &c不存在!" - only-players: "&4此命令只可由玩家發送" - opening-backpack: "&b正在打開背包,這可能需要幾秒鐘的時間..." - opening-guide: "&b正在打開指南,這可能需要幾秒鐘的時間..." - radiation: "&4你正暴露在致命的輻射之下!&c立即丟棄放射性物品或裝備完整的防護服!" - research: - progress: "&7你開始研究&b%research% &e(%progress%)" - start: "&7遠古之靈在你耳邊低語!" - soulbound-rune: - fail: "&c你一次只能魂綁一個物品。" - success: "&a您已成功將此物品綁定魂綁!死後不會噴掉。" - talisman: - angel: "&a&o你的護身符使你免疫摔落傷害" - anvil: "&a&o你的護符免了您的工具於斷裂" - fire: "&a&o你的護身符使你沒有燒死" - hunter: "&a&o你的護符剛雙倍了你的掉落" - knight: "&a&o你的護身符給了你5秒的回復時間" - lava: "&a&o你的護符把你從被燒死的命運中救出" - magician: "&a&o你的護身符給了你額外的附魔" - miner: "&a&o你的護符剛雙倍了你的掉落" - traveller: "&a&o你的護身符給了你速度3" - warrior: "&a&o你的護身符暫時提高了你的力量" - water: "&a&o你的護身符給了你空氣" - whirlwind: "&a&o你的護身符反射了投射物" - wizard: "&a&o你的護身符為你升高了幸運等級,但也降低了其他附魔等級" - unknown-player: "&4未知玩家:&c%player%" - unlocked: "&b你已解鎖&7“%research%”" - usage: "&4用法: &c%usage%" -miner: - no-ores: "&e附近沒礦了!" + - "&7這只是一個小傷!" + - "&7永遠保持樂觀積極!" + - "&7這不是普通的餅乾" + - "&7霓虹燈好帥!" +machines: + pattern-not-found: "&e查無此合成表 請確認使用的機器或合成表的材料" + unknown-material: "&e這個機器不能處理這個物品 請確認使用的機器或合成表的材料" + wrong-item: "&e你手持的物品和機器並不相容 請確認使用的機器或合成表的材料" + full-inventory: "&e發射器滿了!(請考慮使用基礎機械輸出箱)" + in-use: "&c別人正在使用這台機器" + ignition-chamber-no-flint: "&c點火系統沒有打火石" + ANCIENT_ALTAR: + not-enough-pedestals: "&4此祭壇需要更多基座&c(%pedestals% / 8)" + unknown-catalyst: "&4未知中心物品! &c請檢察合成表!" + unknown-recipe: "&4未知合成表! &c請檢察合成表!" + ANCIENT_PEDESTAL: + obstructed: "&4基座被擋住了! &c移除上方的方塊!" + HOLOGRAM_PROJECTOR: + enter-text: "&7輸入你想要的文字 &r(可以輸入顏色代碼!)" + inventory-title: 全息投影編輯器 + ELEVATOR: + no-destinations: "&4沒有目的地" + pick-a-floor: "&3選擇樓層" + current-floor: "&e這是你現在的樓層:" + click-to-teleport: "&e按這 &7來傳送到該樓:" + enter-name: "&7輸入你的樓層名稱&r(可以輸入顏色代碼!)" + named: "&2成功命名為 &r%floor%" + TELEPORTER: + teleporting: "&3傳送中..." + teleported: "&3傳送成功!" + cancelled: "&4傳送中止!" + invulnerability: "&b&l你得到了30秒的無敵!" + gui: + title: 你的標記點 + tooltip: 點擊以傳送 + time: 估計時間 + CARGO_NODES: + must-be-placed: "&4必須連接在箱子或機器旁!" + GPS_CONTROL_PANEL: + title: GPS控制面板 + transmitters: 訊號發射器總覽 + waypoints: 傳送點總覽 + INDUSTRIAL_MINER: + no-fuel: "&c你的工業挖礦機沒燃料了! 將燃料放置到上方的箱子" + piston-facing: "&c工業挖礦機的活塞需要朝上!" + piston-space: "&c兩活塞的上面需要為空氣!" + destroyed: "&c你的工業挖礦機被摧毀了" + already-running: "&c此工業挖礦機已經在運作中了!" + full-chest: "&c此工業挖礦機的箱子已滿!" + no-permission: "&4你沒有權限在此使用工業挖礦機!" + finished: "&e你的工業挖礦機已挖掘完畢 共挖到 %ores% 個!" +anvil: + not-working: "&4科技物品需要用自動鐵砧+修理膠帶!" +backpack: + already-open: "&c別人正在使用這個背包!" + no-stack: "&c背包不能疊!" workbench: not-enhanced: "&4科技物品不可在普通合成檯使用" +gps: + deathpoint: "&4死亡點&7%date%" + waypoint: + new: "&e輸入傳送點名稱 &7(Color Codes supported!)" + added: "&a成功新增傳送點" + max: "&4傳送點已達上限" + insufficient-complexity: + - "&4GPS信號不足 &c%complexity%" + - "&4a) GPS基礎設施未放置" + - "&4b)GPS信號不足" + geo: + scan-required: "&4請先做地質掃描" +inventory: + no-access: "&4沒有權限使用該物品" +android: + started: "&7機器人繼續運作" + stopped: "&7機器人暫停運作" + scripts: + already-uploaded: "&4程式已上傳" + instructions: + START: "&2執行程式" + REPEAT: "&9重複程式" + WAIT: "&e等0.5秒" + GO_FORWARD: "&7向前移動" + GO_UP: "&7向上移動" + GO_DOWN: "&7向下移動" + TURN_LEFT: "&7左轉" + TURN_RIGHT: "&7右轉" + DIG_UP: "&b挖上面" + DIG_FORWARD: "&b挖前面" + DIG_DOWN: "&b挖下面" + MOVE_AND_DIG_UP: "&b挖並向上移動" + MOVE_AND_DIG_FORWARD: "&b挖並向前移動" + MOVE_AND_DIG_DOWN: "&b挖並向下移動" + ATTACK_MOBS_ANIMALS: "&4攻擊&c主動怪和動物" + ATTACK_MOBS: "&4攻擊&c主動怪" + ATTACK_ANIMALS: "&4攻擊&c動物" + ATTACK_ANIMALS_ADULT: "&4攻擊&c成年動物" + CHOP_TREE: "&c砍完整棵樹並重種" + CATCH_FISH: "&b嘗試抓魚" + FARM_FORWARD: "&b向前收割並重種" + FARM_DOWN: "&b向下收割並重種" + FARM_EXOTIC_FORWARD: "&b進階向前收割並重種" + FARM_EXOTIC_DOWN: "&b進階向下收割並重種" + INTERFACE_ITEMS: "&c向物品節點輸入物品" + INTERFACE_FUEL: "&c從燃料節點取得燃料" + enter-name: + - + - "&e輸入程式名稱" + uploaded: + - "&b上傳中" + - "&a成功上傳程式!" + rating: + own: "&4你不能評價自己的程式!" + already: "&4你已經評價過此程式!" + editor: 程式編輯器 +languages: + default: 默認 + en: 英語 + de: 德語 + fr: 法文 + it: 義大利文 + es: 西班牙文 + pl: 波蘭語 + sv: 瑞典語 + nl: 荷蘭語 + cs: 捷克文 + hu: 匈牙利文 + lv: 拉脫維亞語 + ru: 俄語 + sk: 斯洛伐克文 + zh-TW: 中文(繁體) + vi: 越南文 + id: 印尼語 + zh-CN: 中文(簡體) + el: 希臘語 + he: 希伯來語 + ar: 阿拉伯文 + af: 南非語 + da: 丹麥文 + fi: 芬蘭文 + uk: 烏克蘭文 + ms: 馬來語 + 'no': 挪威 + ja: 日語 + fa: 波斯語 + th: 泰語 + ro: 羅馬尼亞語 + pt: 葡萄牙文(葡萄牙) + pt-BR: 葡萄牙文(巴西) + bg: 保加利亞語 + ko: 韓語 + tr: 土耳其 + hr: 克羅地亞語 + mk: 馬其頓語 + sr: 塞爾維亞語 + be: 白俄羅斯語 + tl: 他加祿語 +miner: + no-ores: "&e附近沒礦了!" From c941b9080ff88fa07339a5b2fc8877968292ef44 Mon Sep 17 00:00:00 2001 From: Vravinite Date: Fri, 26 Jun 2020 21:53:21 +0000 Subject: [PATCH 11/24] Translate recipes_es.yml via GitLocalize --- src/main/resources/languages/recipes_es.yml | 253 ++++++++++---------- 1 file changed, 129 insertions(+), 124 deletions(-) diff --git a/src/main/resources/languages/recipes_es.yml b/src/main/resources/languages/recipes_es.yml index af652ac8c..8dcb8c432 100644 --- a/src/main/resources/languages/recipes_es.yml +++ b/src/main/resources/languages/recipes_es.yml @@ -1,145 +1,107 @@ --- -minecraft: - blasting: - lore: - - Funde este objeto en un Alto Horno - - para obtener el objeto que buscas. - name: Receta de Alto Horno - campfire: - lore: - - Funde este objeto sobre una Hoguera - - para obtener el objeto que buscas. - name: Receta de Hoguera - furnace: - lore: - - Funde este objeto en un Horno - - para obtener el objeto que buscas. - name: Receta de Horno - shaped: - lore: - - Haz este objeto tal como se muestra - - en una Tabla de Crafteo normal, - - la forma es importante. - name: Receta de Crafteo con forma - shapeless: - lore: - - Haz este objeto tal como se muestra - - en una Tabla de Crafteo normal - - Esta receta no tiene forma. - name: Receta de Crafteo sin forma - smoking: - lore: - - Funde este objeto en un Ahumador - - para obtener el objeto que buscas. - name: Receta de Ahumador - stonecutting: - lore: - - Haz este objeto tal como se muestra - - usando un Cortapiedras - name: Receta de Cortapiedras slimefun: - ancient_altar: + multiblock: + name: Multiblock lore: - - Haz este objeto tal como se muestra - - usando un Ancient Altar. - - Busca Ancient Altar para mas info. - name: Ancient Altar - armor_forge: - lore: - - Haz este objeto tal como se muestra - - usando una Armor Forge - name: Armor Forge - compressor: - lore: - - Haz este objeto tal como se muestra - - usando un Compressor - name: Compressor + - Construye la estructura presentada + - tal cual. No es una receta. enhanced_crafting_table: + name: Enhanced Crafting Table lore: - Haz este objeto tal como se muestra - en una Enhanced Crafting Table. - "¡Una Tabla de Crafteo normal no servirá!" - name: Enhanced Crafting Table - food_composter: + armor_forge: + name: Armor Forge lore: - Haz este objeto tal como se muestra - - usando un Food Composter - name: Food Composter - food_fabricator: - lore: - - Haz este objeto tal como se muestra - - usando un Food Fabricator - name: Food Fabricator - freezer: - lore: - - Congela este objeto tal como se muestra - - usando un Freezer - name: Freezer - geo_miner: - lore: - - Este objeto se puede obtener - - usando un GEO Miner - name: GEO Miner - gold_pan: - lore: - - Usa un Gold Pan para - - obtener este objeto. - name: Gold Pan + - usando una Armor Forge grind_stone: + name: Grind Stone lore: - Haz este objeto tal como se muestra - usando una Grind Stone - name: Grind Stone - heated_pressure_chamber: - lore: - - Haz este objeto tal como se muestra - - usando una Heated Pressure Chamber - name: Heated Pressure Chamber - juicer: - lore: - - Haz este jugo tal como se muestra - - usando un Juicer - name: Juicer - magic_workbench: - lore: - - Haz este objeto tal como se muestra - - Usando una Magic Workbench - name: Magic Workbench - mob_drop: - lore: - - Mata ese Mob para - - obtener este objeto. - name: Botín de Mob - multiblock: - lore: - - Construye la estructura presentada - - tal cual. No es una receta. - name: Multiblock - nuclear_reactor: - lore: - - Este objeto es un suproducto generado - - al correr un Nuclear Reactor - name: Nuclear Reactor - ore_crusher: - lore: - - Haz este objeto tal como se muestra - - usando un Ore Crusher - name: Ore Crusher - ore_washer: - lore: - - Haz este objeto tal como se muestra - - usando un Ore Washer - name: Ore Washer - pressure_chamber: - lore: - - Haz este objeto tal como se muestra - - usando un Pressure Chamber - name: Pressure Chamber smeltery: + name: Smeltery lore: - Haz este objeto tal como se muestra - usando un Smeltery - name: Smeltery + ore_crusher: + name: Ore Crusher + lore: + - Haz este objeto tal como se muestra + - usando un Ore Crusher + mob_drop: + name: Botín de Mob + lore: + - Mata ese Mob para + - obtener este objeto. + gold_pan: + name: Gold Pan + lore: + - Usa un Gold Pan para + - obtener este objeto. + compressor: + name: Compressor + lore: + - Haz este objeto tal como se muestra + - usando un Compressor + pressure_chamber: + name: Pressure Chamber + lore: + - Haz este objeto tal como se muestra + - usando un Pressure Chamber + ore_washer: + name: Ore Washer + lore: + - Haz este objeto tal como se muestra + - usando un Ore Washer + juicer: + name: Juicer + lore: + - Haz este jugo tal como se muestra + - usando un Juicer + magic_workbench: + name: Magic Workbench + lore: + - Haz este objeto tal como se muestra + - Usando una Magic Workbench + ancient_altar: + name: Ancient Altar + lore: + - Haz este objeto tal como se muestra + - usando un Ancient Altar. + - Busca Ancient Altar para mas info. + heated_pressure_chamber: + name: Heated Pressure Chamber + lore: + - Haz este objeto tal como se muestra + - usando una Heated Pressure Chamber + food_fabricator: + name: Food Fabricator + lore: + - Haz este objeto tal como se muestra + - usando un Food Fabricator + food_composter: + name: Food Composter + lore: + - Haz este objeto tal como se muestra + - usando un Food Composter + freezer: + name: Freezer + lore: + - Congela este objeto tal como se muestra + - usando un Freezer + geo_miner: + name: GEO Miner + lore: + - Este objeto se puede obtener + - usando un GEO Miner + nuclear_reactor: + name: Nuclear Reactor + lore: + - Este objeto es un suproducto generado + - al correr un Nuclear Reactor oil_pump: name: Oil Pump lore: @@ -156,3 +118,46 @@ slimefun: lore: - Haz este objeto tal como se muestra - usando una Refinery +minecraft: + shaped: + name: Receta de Crafteo con forma + lore: + - Haz este objeto tal como se muestra + - en una Tabla de Crafteo normal, + - la forma es importante. + shapeless: + name: Receta de Crafteo sin forma + lore: + - Haz este objeto tal como se muestra + - en una Tabla de Crafteo normal + - Esta receta no tiene forma. + furnace: + name: Receta de Horno + lore: + - Funde este objeto en un Horno + - para obtener el objeto que buscas. + blasting: + name: Receta de Alto Horno + lore: + - Funde este objeto en un Alto Horno + - para obtener el objeto que buscas. + smoking: + name: Receta de Ahumador + lore: + - Funde este objeto en un Ahumador + - para obtener el objeto que buscas. + campfire: + name: Receta de Hoguera + lore: + - Funde este objeto sobre una Hoguera + - para obtener el objeto que buscas. + stonecutting: + name: Receta de Cortapiedras + lore: + - Haz este objeto tal como se muestra + - usando un Cortapiedras + smithing: + name: Smithing Table Recipe + lore: + - Haz este objeto como se muestra + - usando una Smithing Table From e081d15c6d6643d40d46c1adb4275df80ac69d9c Mon Sep 17 00:00:00 2001 From: TheBusyBiscuit Date: Sat, 27 Jun 2020 01:46:20 +0200 Subject: [PATCH 12/24] Fixed a slight mistake with the lore --- .../core/attributes/RechargeableHelper.java | 6 ++++-- .../testing/tests/items/TestRechargeableItems.java | 14 ++++++++++++++ 2 files changed, 18 insertions(+), 2 deletions(-) diff --git a/src/main/java/io/github/thebusybiscuit/slimefun4/core/attributes/RechargeableHelper.java b/src/main/java/io/github/thebusybiscuit/slimefun4/core/attributes/RechargeableHelper.java index 43e0378ff..546ffe0e9 100644 --- a/src/main/java/io/github/thebusybiscuit/slimefun4/core/attributes/RechargeableHelper.java +++ b/src/main/java/io/github/thebusybiscuit/slimefun4/core/attributes/RechargeableHelper.java @@ -2,6 +2,7 @@ package io.github.thebusybiscuit.slimefun4.core.attributes; import java.math.BigDecimal; import java.math.RoundingMode; +import java.util.ArrayList; import java.util.List; import org.bukkit.NamespacedKey; @@ -37,13 +38,14 @@ final class RechargeableHelper { meta.getPersistentDataContainer().set(CHARGE_KEY, PersistentDataType.FLOAT, value); } - List lore = meta.getLore(); + List lore = meta.hasLore() ? meta.getLore() : new ArrayList<>(); for (int i = 0; i < lore.size(); i++) { String line = lore.get(i); if (line.startsWith(LORE_PREFIX)) { lore.set(i, LORE_PREFIX + value + " / " + capacity + " J"); - break; + meta.setLore(lore); + return; } } diff --git a/src/test/java/io/github/thebusybiscuit/slimefun4/testing/tests/items/TestRechargeableItems.java b/src/test/java/io/github/thebusybiscuit/slimefun4/testing/tests/items/TestRechargeableItems.java index 13499c17d..3e11539ef 100644 --- a/src/test/java/io/github/thebusybiscuit/slimefun4/testing/tests/items/TestRechargeableItems.java +++ b/src/test/java/io/github/thebusybiscuit/slimefun4/testing/tests/items/TestRechargeableItems.java @@ -87,6 +87,20 @@ public class TestRechargeableItems { Assertions.assertFalse(rechargeable.addItemCharge(item, 1)); } + @Test + public void testAddItemChargeWithoutLore() { + Rechargeable rechargeable = mock("CHARGING_NO_LORE_TEST", 10); + ItemStack item = new CustomItem(Material.REDSTONE_BLOCK, "&4Chargeable Item with no lore"); + + Assertions.assertEquals(0, rechargeable.getItemCharge(item)); + + Assertions.assertTrue(rechargeable.addItemCharge(item, 10)); + Assertions.assertEquals(10, rechargeable.getItemCharge(item)); + + String lore = ChatColors.color("&c&o&8\u21E8 &e\u26A1 &7") + "10.0 / 10.0 J"; + Assertions.assertEquals(lore, item.getItemMeta().getLore().get(0)); + } + @Test public void testRemoveItemCharge() { Rechargeable rechargeable = mock("CHARGING_BOUNDS_TEST", 10); From b2833b3ce85782ea07f2513cbc44904026f43f89 Mon Sep 17 00:00:00 2001 From: TheBusyBiscuit Date: Sat, 27 Jun 2020 02:18:49 +0200 Subject: [PATCH 13/24] Removed unused parameter --- .../implementation/items/electric/gadgets/SolarHelmet.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/items/electric/gadgets/SolarHelmet.java b/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/items/electric/gadgets/SolarHelmet.java index 79263be8f..c9d4f1812 100644 --- a/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/items/electric/gadgets/SolarHelmet.java +++ b/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/items/electric/gadgets/SolarHelmet.java @@ -28,7 +28,7 @@ public class SolarHelmet extends SlimefunItem { private final ItemSetting charge = new ItemSetting<>("charge-amount", 0.1); public SolarHelmet(Category category, SlimefunItemStack item, RecipeType recipeType, ItemStack[] recipe) { - super(category, item, recipeType, recipe, null); + super(category, item, recipeType, recipe); addItemSetting(charge); } From f6f09d2e2eef4d34c2cff586e6b477899301a1dd Mon Sep 17 00:00:00 2001 From: TheBusyBiscuit Date: Sat, 27 Jun 2020 02:28:01 +0200 Subject: [PATCH 14/24] Some more refactoring --- .../items/electric/gadgets/SolarHelmet.java | 9 +++++++-- .../implementation/setup/SlimefunItemSetup.java | 3 ++- .../slimefun4/implementation/tasks/ArmorTask.java | 6 ++++-- 3 files changed, 13 insertions(+), 5 deletions(-) diff --git a/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/items/electric/gadgets/SolarHelmet.java b/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/items/electric/gadgets/SolarHelmet.java index c9d4f1812..fb19075ca 100644 --- a/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/items/electric/gadgets/SolarHelmet.java +++ b/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/items/electric/gadgets/SolarHelmet.java @@ -25,11 +25,16 @@ import me.mrCookieSlime.Slimefun.api.SlimefunItemStack; */ public class SolarHelmet extends SlimefunItem { - private final ItemSetting charge = new ItemSetting<>("charge-amount", 0.1); + private final ItemSetting charge; - public SolarHelmet(Category category, SlimefunItemStack item, RecipeType recipeType, ItemStack[] recipe) { + public SolarHelmet(Category category, SlimefunItemStack item, RecipeType recipeType, ItemStack[] recipe, double defaultChargingLevel) { super(category, item, recipeType, recipe); + if (defaultChargingLevel <= 0) { + throw new IllegalArgumentException("A Solar Helmet must have a positive charging level!"); + } + + charge = new ItemSetting<>("charge-amount", defaultChargingLevel); addItemSetting(charge); } diff --git a/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/setup/SlimefunItemSetup.java b/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/setup/SlimefunItemSetup.java index a7a2dbc63..33335b37d 100644 --- a/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/setup/SlimefunItemSetup.java +++ b/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/setup/SlimefunItemSetup.java @@ -765,7 +765,8 @@ public final class SlimefunItemSetup { .register(plugin); new SolarHelmet(categories.technicalGadgets, SlimefunItems.SOLAR_HELMET, RecipeType.ENHANCED_CRAFTING_TABLE, - new ItemStack[] {SlimefunItems.REINFORCED_ALLOY_INGOT, SlimefunItems.SOLAR_PANEL, SlimefunItems.REINFORCED_ALLOY_INGOT, SlimefunItems.REINFORCED_ALLOY_INGOT, null, SlimefunItems.REINFORCED_ALLOY_INGOT, SlimefunItems.MEDIUM_CAPACITOR, null, SlimefunItems.MEDIUM_CAPACITOR}) + new ItemStack[] {SlimefunItems.REINFORCED_ALLOY_INGOT, SlimefunItems.SOLAR_PANEL, SlimefunItems.REINFORCED_ALLOY_INGOT, SlimefunItems.REINFORCED_ALLOY_INGOT, null, SlimefunItems.REINFORCED_ALLOY_INGOT, SlimefunItems.MEDIUM_CAPACITOR, null, SlimefunItems.MEDIUM_CAPACITOR}, + 0.1) .register(plugin); new UnplaceableBlock(categories.magicalResources, SlimefunItems.LAVA_CRYSTAL, RecipeType.ENHANCED_CRAFTING_TABLE, diff --git a/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/tasks/ArmorTask.java b/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/tasks/ArmorTask.java index ffbdd1381..a23d3fe33 100644 --- a/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/tasks/ArmorTask.java +++ b/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/tasks/ArmorTask.java @@ -5,6 +5,7 @@ import java.util.HashSet; import java.util.Set; import org.bukkit.Bukkit; +import org.bukkit.World; import org.bukkit.entity.Player; import org.bukkit.inventory.ItemStack; import org.bukkit.potion.PotionEffect; @@ -107,12 +108,13 @@ public class ArmorTask implements Runnable { } private boolean hasSunlight(Player p) { - return (p.getWorld().getTime() < 12300 || p.getWorld().getTime() > 23850) && p.getEyeLocation().getBlock().getLightFromSky() == 15; + World world = p.getWorld(); + return (world.getTime() < 12300 || world.getTime() > 23850) && p.getEyeLocation().getBlock().getLightFromSky() == 15; } private void checkForRadiation(Player p) { // Check for a Hazmat Suit - if (!SlimefunUtils.isItemSimilar(SlimefunItems.SCUBA_HELMET, p.getInventory().getHelmet(), true) || !SlimefunUtils.isItemSimilar(SlimefunItems.HAZMAT_CHESTPLATE, p.getInventory().getChestplate(), true) || !SlimefunUtils.isItemSimilar(SlimefunItems.HAZMAT_LEGGINGS, p.getInventory().getLeggings(), true) || !SlimefunUtils.isItemSimilar(SlimefunItems.RUBBER_BOOTS, p.getInventory().getBoots(), true)) { + if (!SlimefunUtils.isItemSimilar(p.getInventory().getHelmet(), SlimefunItems.SCUBA_HELMET, true) || !SlimefunUtils.isItemSimilar(p.getInventory().getChestplate(), SlimefunItems.HAZMAT_CHESTPLATE, true) || !SlimefunUtils.isItemSimilar(p.getInventory().getLeggings(), SlimefunItems.HAZMAT_LEGGINGS, true) || !SlimefunUtils.isItemSimilar(p.getInventory().getBoots(), SlimefunItems.RUBBER_BOOTS, true)) { for (ItemStack item : p.getInventory()) { if (isRadioactive(p, item)) { break; From 0dfd40e4079448db5e6d48910566084f3b7cfe14 Mon Sep 17 00:00:00 2001 From: TheBusyBiscuit Date: Sat, 27 Jun 2020 02:35:29 +0200 Subject: [PATCH 15/24] Fixed a few more color codes for 1.16 (Sorry Walshy :P ) --- .../thebusybiscuit/slimefun4/api/gps/GPSNetwork.java | 8 ++++---- .../slimefun4/api/gps/TeleportationManager.java | 4 ++-- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/src/main/java/io/github/thebusybiscuit/slimefun4/api/gps/GPSNetwork.java b/src/main/java/io/github/thebusybiscuit/slimefun4/api/gps/GPSNetwork.java index 5d638162f..27415de8c 100644 --- a/src/main/java/io/github/thebusybiscuit/slimefun4/api/gps/GPSNetwork.java +++ b/src/main/java/io/github/thebusybiscuit/slimefun4/api/gps/GPSNetwork.java @@ -137,7 +137,7 @@ public class GPSNetwork { menu.addMenuClickHandler(2, ChestMenuUtils.getEmptyClickHandler()); int complexity = getNetworkComplexity(p.getUniqueId()); - menu.addItem(4, new CustomItem(SlimefunItems.GPS_CONTROL_PANEL, "&7Network Info", "", "&8\u21E8 &7Status: " + (complexity > 0 ? "&2&lONLINE" : "&4&lOFFLINE"), "&8\u21E8 &7Complexity: &r" + complexity)); + menu.addItem(4, new CustomItem(SlimefunItems.GPS_CONTROL_PANEL, "&7Network Info", "", "&8\u21E8 &7Status: " + (complexity > 0 ? "&2&lONLINE" : "&4&lOFFLINE"), "&8\u21E8 &7Complexity: &f" + complexity)); menu.addMenuClickHandler(4, ChestMenuUtils.getEmptyClickHandler()); menu.addItem(6, new CustomItem(HeadTexture.GLOBE_OVERWORLD.getAsItemStack(), "&7" + SlimefunPlugin.getLocal().getMessage(p, "machines.GPS_CONTROL_PANEL.waypoints"), "", ChatColor.GRAY + "\u21E8 " + SlimefunPlugin.getLocal().getMessage(p, "guide.tooltips.open-category"))); @@ -154,7 +154,7 @@ public class GPSNetwork { if (sfi instanceof GPSTransmitter) { int slot = inventory[index]; - menu.addItem(slot, new CustomItem(SlimefunItems.GPS_TRANSMITTER, "&bGPS Transmitter", "&8\u21E8 &7World: &r" + l.getWorld().getName(), "&8\u21E8 &7X: &r" + l.getX(), "&8\u21E8 &7Y: &r" + l.getY(), "&8\u21E8 &7Z: &r" + l.getZ(), "", "&8\u21E8 &7Signal Strength: &r" + ((GPSTransmitter) sfi).getMultiplier(l.getBlockY()), "&8\u21E8 &7Ping: &r" + DoubleHandler.fixDouble(1000D / l.getY()) + "ms")); + menu.addItem(slot, new CustomItem(SlimefunItems.GPS_TRANSMITTER, "&bGPS Transmitter", "&8\u21E8 &7World: &f" + l.getWorld().getName(), "&8\u21E8 &7X: &f" + l.getX(), "&8\u21E8 &7Y: &f" + l.getY(), "&8\u21E8 &7Z: &f" + l.getZ(), "", "&8\u21E8 &7Signal Strength: &f" + ((GPSTransmitter) sfi).getMultiplier(l.getBlockY()), "&8\u21E8 &7Ping: &f" + DoubleHandler.fixDouble(1000D / l.getY()) + "ms")); menu.addMenuClickHandler(slot, ChestMenuUtils.getEmptyClickHandler()); index++; @@ -209,7 +209,7 @@ public class GPSNetwork { }); int complexity = getNetworkComplexity(p.getUniqueId()); - menu.addItem(4, new CustomItem(SlimefunItems.GPS_CONTROL_PANEL, "&7Network Info", "", "&8\u21E8 &7Status: " + (complexity > 0 ? "&2&lONLINE" : "&4&lOFFLINE"), "&8\u21E8 &7Complexity: &r" + complexity)); + menu.addItem(4, new CustomItem(SlimefunItems.GPS_CONTROL_PANEL, "&7Network Info", "", "&8\u21E8 &7Status: " + (complexity > 0 ? "&2&lONLINE" : "&4&lOFFLINE"), "&8\u21E8 &7Complexity: &f" + complexity)); menu.addMenuClickHandler(4, ChestMenuUtils.getEmptyClickHandler()); menu.addItem(6, new CustomItem(HeadTexture.GLOBE_OVERWORLD.getAsItemStack(), "&7" + SlimefunPlugin.getLocal().getMessage(p, "machines.GPS_CONTROL_PANEL.waypoints"))); @@ -221,7 +221,7 @@ public class GPSNetwork { int slot = inventory[index]; Location l = waypoint.getLocation(); - menu.addItem(slot, new CustomItem(waypoint.getIcon(), waypoint.getName().replace("player:death ", ""), "&8\u21E8 &7World: &r" + l.getWorld().getName(), "&8\u21E8 &7X: &r" + l.getX(), "&8\u21E8 &7Y: &r" + l.getY(), "&8\u21E8 &7Z: &r" + l.getZ(), "", "&8\u21E8 &cClick to delete")); + menu.addItem(slot, new CustomItem(waypoint.getIcon(), waypoint.getName().replace("player:death ", ""), "&8\u21E8 &7World: &f" + l.getWorld().getName(), "&8\u21E8 &7X: &f" + l.getX(), "&8\u21E8 &7Y: &f" + l.getY(), "&8\u21E8 &7Z: &f" + l.getZ(), "", "&8\u21E8 &cClick to delete")); menu.addMenuClickHandler(slot, (pl, s, item, action) -> { profile.removeWaypoint(waypoint); pl.playSound(pl.getLocation(), Sound.UI_BUTTON_CLICK, 1F, 1F); diff --git a/src/main/java/io/github/thebusybiscuit/slimefun4/api/gps/TeleportationManager.java b/src/main/java/io/github/thebusybiscuit/slimefun4/api/gps/TeleportationManager.java index 357ab8a7c..7535551a0 100644 --- a/src/main/java/io/github/thebusybiscuit/slimefun4/api/gps/TeleportationManager.java +++ b/src/main/java/io/github/thebusybiscuit/slimefun4/api/gps/TeleportationManager.java @@ -61,7 +61,7 @@ public final class TeleportationManager { Location l = waypoint.getLocation(); menu.addItem(slot, - new CustomItem(waypoint.getIcon(), waypoint.getName().replace("player:death ", ""), "", "&8\u21E8 &7" + SlimefunPlugin.getLocal().getResourceString(p, "tooltips.world") + ": &r" + l.getWorld().getName(), "&8\u21E8 &7X: &r" + l.getX(), "&8\u21E8 &7Y: &r" + l.getY(), "&8\u21E8 &7Z: &r" + l.getZ(), "&8\u21E8 &7" + SlimefunPlugin.getLocal().getMessage(p, "machines.TELEPORTER.gui.time") + ": &r" + DoubleHandler.fixDouble(0.5 * getTeleportationTime(complexity, source, l)) + "s", "", "&8\u21E8 &c" + SlimefunPlugin.getLocal().getMessage(p, "machines.TELEPORTER.gui.tooltip"))); + new CustomItem(waypoint.getIcon(), waypoint.getName().replace("player:death ", ""), "", "&8\u21E8 &7" + SlimefunPlugin.getLocal().getResourceString(p, "tooltips.world") + ": &f" + l.getWorld().getName(), "&8\u21E8 &7X: &f" + l.getX(), "&8\u21E8 &7Y: &f" + l.getY(), "&8\u21E8 &7Z: &f" + l.getZ(), "&8\u21E8 &7" + SlimefunPlugin.getLocal().getMessage(p, "machines.TELEPORTER.gui.time") + ": &f" + DoubleHandler.fixDouble(0.5 * getTeleportationTime(complexity, source, l)) + "s", "", "&8\u21E8 &c" + SlimefunPlugin.getLocal().getMessage(p, "machines.TELEPORTER.gui.tooltip"))); menu.addMenuClickHandler(slot, (pl, s, item, action) -> { pl.closeInventory(); teleport(pl.getUniqueId(), complexity, source, l, false); @@ -107,7 +107,7 @@ public final class TeleportationManager { teleporterUsers.remove(uuid); if (p != null) { - p.sendTitle(ChatColors.color(SlimefunPlugin.getLocal().getMessage(p, "machines.TELEPORTER.cancelled")), ChatColors.color("&c&k40&r&c%"), 20, 60, 20); + p.sendTitle(ChatColors.color(SlimefunPlugin.getLocal().getMessage(p, "machines.TELEPORTER.cancelled")), ChatColors.color("&c&k40&f&c%"), 20, 60, 20); } } From 44c0029587805a0721655ce52149c5af0bfa5993 Mon Sep 17 00:00:00 2001 From: TheBusyBiscuit Date: Sat, 27 Jun 2020 02:47:53 +0200 Subject: [PATCH 16/24] Fixed a rare concurrency issue with world saving --- CHANGELOG.md | 1 + .../thebusybiscuit/slimefun4/core/SlimefunRegistry.java | 7 +++---- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 595dcb80f..93026a309 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -57,6 +57,7 @@ * Fixed #1855 * Fixed some issues with AsyncWorldEdit * Fixed some problems with unregistered or fake worlds +* Fixed a rare concurrency issue with world saving ## Release Candidate 13 (16 Jun 2020) https://thebusybiscuit.github.io/builds/TheBusyBiscuit/Slimefun4/stable/#13 diff --git a/src/main/java/io/github/thebusybiscuit/slimefun4/core/SlimefunRegistry.java b/src/main/java/io/github/thebusybiscuit/slimefun4/core/SlimefunRegistry.java index bfcdbb596..62aebdfae 100644 --- a/src/main/java/io/github/thebusybiscuit/slimefun4/core/SlimefunRegistry.java +++ b/src/main/java/io/github/thebusybiscuit/slimefun4/core/SlimefunRegistry.java @@ -10,7 +10,6 @@ import java.util.Map; import java.util.Set; import java.util.UUID; import java.util.concurrent.ConcurrentHashMap; -import java.util.concurrent.ConcurrentMap; import org.bukkit.Location; import org.bukkit.Server; @@ -76,8 +75,8 @@ public class SlimefunRegistry { private final Set chargeableBlocks = new HashSet<>(); private final Map witherProofBlocks = new HashMap<>(); - private final ConcurrentMap profiles = new ConcurrentHashMap<>(); - private final Map worlds = new HashMap<>(); + private final Map profiles = new ConcurrentHashMap<>(); + private final Map worlds = new ConcurrentHashMap<>(); private final Map chunks = new HashMap<>(); private final Map layouts = new EnumMap<>(SlimefunGuideLayout.class); private final Map> drops = new EnumMap<>(EntityType.class); @@ -234,7 +233,7 @@ public class SlimefunRegistry { return universalInventories; } - public ConcurrentMap getPlayerProfiles() { + public Map getPlayerProfiles() { return profiles; } From 468617d9a2a81221488050c32b4986d5854269a7 Mon Sep 17 00:00:00 2001 From: TheBusyBiscuit Date: Sat, 27 Jun 2020 03:13:43 +0200 Subject: [PATCH 17/24] Changed a comment. --- .../slimefun4/core/attributes/RechargeableHelper.java | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/main/java/io/github/thebusybiscuit/slimefun4/core/attributes/RechargeableHelper.java b/src/main/java/io/github/thebusybiscuit/slimefun4/core/attributes/RechargeableHelper.java index 546ffe0e9..47fe3b4a8 100644 --- a/src/main/java/io/github/thebusybiscuit/slimefun4/core/attributes/RechargeableHelper.java +++ b/src/main/java/io/github/thebusybiscuit/slimefun4/core/attributes/RechargeableHelper.java @@ -57,12 +57,13 @@ final class RechargeableHelper { if (SlimefunPlugin.getMinecraftVersion().isAtLeast(MinecraftVersion.MINECRAFT_1_14)) { Float value = meta.getPersistentDataContainer().get(CHARGE_KEY, PersistentDataType.FLOAT); - // If no persistent data exists, we will just fall back to the lore + // If persistent data is available, we just return this value if (value != null) { return value; } } + // If no persistent data exists, we will just fall back to the lore if (meta.hasLore()) { for (String line : meta.getLore()) { if (line.startsWith(LORE_PREFIX) && line.contains(" / ") && line.endsWith(" J")) { From bd2f4b196d6a3c265ea8945bcbd4d1ac853b4afc Mon Sep 17 00:00:00 2001 From: TheBusyBiscuit Date: Sat, 27 Jun 2020 03:29:10 +0200 Subject: [PATCH 18/24] Minor optimization for Solar Helmet checks --- .../slimefun4/implementation/tasks/ArmorTask.java | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/tasks/ArmorTask.java b/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/tasks/ArmorTask.java index a23d3fe33..dbcde28bf 100644 --- a/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/tasks/ArmorTask.java +++ b/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/tasks/ArmorTask.java @@ -6,6 +6,7 @@ import java.util.Set; import org.bukkit.Bukkit; import org.bukkit.World; +import org.bukkit.World.Environment; import org.bukkit.entity.Player; import org.bukkit.inventory.ItemStack; import org.bukkit.potion.PotionEffect; @@ -109,6 +110,12 @@ public class ArmorTask implements Runnable { private boolean hasSunlight(Player p) { World world = p.getWorld(); + + if (world.getEnvironment() != Environment.NORMAL) { + // The End and Nether have no sunlight + return false; + } + return (world.getTime() < 12300 || world.getTime() > 23850) && p.getEyeLocation().getBlock().getLightFromSky() == 15; } From 6d3665508175600f592be2b68de06ea3215e7fa0 Mon Sep 17 00:00:00 2001 From: TheBusyBiscuit Date: Sat, 27 Jun 2020 03:40:27 +0200 Subject: [PATCH 19/24] Another optimization for Solar Generators --- .../items/electric/generators/SolarGenerator.java | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/items/electric/generators/SolarGenerator.java b/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/items/electric/generators/SolarGenerator.java index 3ebef8a14..84b0fa7d0 100644 --- a/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/items/electric/generators/SolarGenerator.java +++ b/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/items/electric/generators/SolarGenerator.java @@ -1,6 +1,8 @@ package io.github.thebusybiscuit.slimefun4.implementation.items.electric.generators; import org.bukkit.Location; +import org.bukkit.World; +import org.bukkit.World.Environment; import org.bukkit.inventory.ItemStack; import io.github.thebusybiscuit.slimefun4.api.events.PlayerRightClickEvent; @@ -60,11 +62,17 @@ public abstract class SolarGenerator extends SimpleSlimefunItem @Override public double generateEnergy(Location l, SlimefunItem item, Config data) { - if (!l.getWorld().isChunkLoaded(l.getBlockX() >> 4, l.getBlockZ() >> 4) || l.getBlock().getLightFromSky() != 15) { - return 0D; + World world = l.getWorld(); + + if (world.getEnvironment() != Environment.NORMAL) { + return 0; } - if (l.getWorld().getTime() < 12300 || l.getWorld().getTime() > 23850) { + if (!world.isChunkLoaded(l.getBlockX() >> 4, l.getBlockZ() >> 4) || l.getBlock().getLightFromSky() != 15) { + return 0; + } + + if (world.getTime() < 12300 || world.getTime() > 23850) { return getDayEnergy(); } From 3dc043c857da79e6763ef6e67e05f39f94b73978 Mon Sep 17 00:00:00 2001 From: TheBusyBiscuit Date: Sat, 27 Jun 2020 13:10:47 +0200 Subject: [PATCH 20/24] Refactoring: Relocated Plugin class --- .../slimefun4/api/ErrorReport.java | 2 +- .../slimefun4/api/MinecraftVersion.java | 2 +- .../slimefun4/api/SlimefunAddon.java | 2 +- .../slimefun4/api/geo/GEOResource.java | 4 +- .../slimefun4/api/geo/ResourceManager.java | 40 +- .../slimefun4/api/gps/GPSNetwork.java | 22 +- .../api/gps/TeleportationManager.java | 14 +- .../slimefun4/api/gps/Waypoint.java | 2 +- .../slimefun4/api/items/ItemSetting.java | 2 +- .../slimefun4/api/player/PlayerProfile.java | 2 +- .../core/attributes/EnergyNetComponent.java | 2 +- .../core/attributes/RechargeableHelper.java | 2 +- .../core/attributes/RecipeDisplayItem.java | 4 +- .../core/categories/LockedCategory.java | 2 +- .../core/commands/SlimefunCommand.java | 2 +- .../core/commands/SlimefunTabCompleter.java | 2 +- .../slimefun4/core/commands/SubCommand.java | 6 +- .../commands/subcommands/BackpackCommand.java | 14 +- .../commands/subcommands/CheatCommand.java | 6 +- .../core/commands/subcommands/Commands.java | 2 +- .../subcommands/DebugFishCommand.java | 4 +- .../commands/subcommands/GiveCommand.java | 18 +- .../commands/subcommands/GuideCommand.java | 6 +- .../commands/subcommands/HelpCommand.java | 2 +- .../subcommands/OpenGuideCommand.java | 6 +- .../commands/subcommands/ResearchCommand.java | 16 +- .../commands/subcommands/SearchCommand.java | 8 +- .../commands/subcommands/StatsCommand.java | 8 +- .../subcommands/TeleporterCommand.java | 10 +- .../commands/subcommands/TimingsCommand.java | 6 +- .../commands/subcommands/VersionsCommand.java | 4 +- .../slimefun4/core/guide/SlimefunGuide.java | 4 +- .../guide/SlimefunGuideImplementation.java | 2 +- .../core/guide/options/ContributorsMenu.java | 14 +- .../core/guide/options/FireworksOption.java | 2 +- .../core/guide/options/GuideLayoutOption.java | 2 +- .../guide/options/PlayerLanguageOption.java | 38 +- .../guide/options/SlimefunGuideSettings.java | 18 +- .../core/multiblocks/MultiBlock.java | 2 +- .../core/multiblocks/MultiBlockMachine.java | 2 +- .../core/networks/cargo/CargoNet.java | 2 +- .../core/networks/cargo/CargoUtils.java | 4 +- .../networks/cargo/ChestTerminalNetwork.java | 2 +- .../core/networks/energy/EnergyNet.java | 4 +- .../slimefun4/core/researching/Research.java | 12 +- .../core/services/AutoSavingService.java | 2 +- .../core/services/BackupService.java | 2 +- .../core/services/BlockDataService.java | 2 +- .../core/services/CustomTextureService.java | 2 +- .../core/services/LocalizationService.java | 2 +- .../services/PerWorldSettingsService.java | 2 +- .../core/services/PermissionsService.java | 2 +- .../core/services/PersistentDataService.java | 2 +- .../core/services/UpdaterService.java | 2 +- .../core/services/github/GitHubConnector.java | 2 +- .../core/services/github/GitHubService.java | 2 +- .../core/services/github/GitHubTask.java | 2 +- .../core/services/localization/Language.java | 6 +- .../localization/SlimefunLocalization.java | 2 +- .../core/services/metrics/AddonsChart.java | 2 +- .../services/metrics/AutoUpdaterChart.java | 2 +- .../core/services/metrics/CommandChart.java | 2 +- .../metrics/CompatibilityModeChart.java | 2 +- .../services/metrics/GuideLayoutChart.java | 2 +- .../core/services/metrics/MetricsService.java | 2 +- .../services/metrics/PlayerLanguageChart.java | 6 +- .../metrics/ResearchesEnabledChart.java | 2 +- .../services/metrics/ResourcePackChart.java | 2 +- .../services/metrics/ServerLanguageChart.java | 6 +- .../metrics/SlimefunVersionChart.java | 2 +- .../core/services/plugins/ClearLagHook.java | 2 +- .../services/plugins/PlaceholderAPIHook.java | 6 +- .../plugins/ThirdPartyPluginService.java | 2 +- .../implementation/SlimefunItems.java | 1 - .../implementation/SlimefunPlugin.java | 624 ++++++++++++++++++ .../guide/BookSlimefunGuide.java | 22 +- .../guide/ChestSlimefunGuide.java | 153 +++-- .../guide/RecipeChoiceTask.java | 2 +- .../items/altar/AncientPedestal.java | 2 +- .../items/androids/AdvancedFarmerAndroid.java | 2 +- .../items/androids/ButcherAndroid.java | 2 +- .../items/androids/FarmerAndroid.java | 2 +- .../items/androids/FisherAndroid.java | 2 +- .../items/androids/MinerAndroid.java | 2 +- .../items/androids/ProgrammableAndroid.java | 34 +- .../items/androids/WoodcutterAndroid.java | 2 +- .../items/backpacks/SlimefunBackpack.java | 2 +- .../items/blocks/BlockPlacer.java | 2 +- .../items/blocks/Composter.java | 4 +- .../implementation/items/blocks/Crucible.java | 4 +- .../items/blocks/HologramProjector.java | 6 +- .../items/cargo/AbstractCargoNode.java | 2 +- .../items/cargo/AdvancedCargoOutputNode.java | 2 +- .../items/cargo/CargoInputNode.java | 2 +- .../items/cargo/CargoOutputNode.java | 2 +- .../items/cargo/ReactorAccessPort.java | 2 +- .../items/electric/gadgets/MultiTool.java | 4 +- .../items/electric/gadgets/Multimeter.java | 4 +- .../electric/generators/BioGenerator.java | 2 +- .../items/electric/machines/AutoBrewer.java | 5 +- .../electric/machines/AutoDisenchanter.java | 2 +- .../electric/machines/AutoEnchanter.java | 2 +- .../machines/AutomatedCraftingChamber.java | 2 +- .../machines/CropGrowthAccelerator.java | 2 +- .../electric/machines/ElectricDustWasher.java | 2 +- .../electric/machines/ElectricFurnace.java | 4 +- .../electric/machines/ElectricSmeltery.java | 2 +- .../electric/machines/FoodComposter.java | 2 +- .../electric/machines/FoodFabricator.java | 2 +- .../machines/HeatedPressureChamber.java | 2 +- .../electric/machines/WitherAssembler.java | 2 +- .../items/electric/reactors/Reactor.java | 2 +- .../implementation/items/food/DietCookie.java | 4 +- .../items/food/FortuneCookie.java | 4 +- .../implementation/items/geo/GEOMiner.java | 2 +- .../implementation/items/geo/GEOScanner.java | 2 +- .../implementation/items/geo/OilPump.java | 4 +- .../items/geo/PortableGEOScanner.java | 2 +- .../items/gps/ElevatorPlate.java | 14 +- .../items/gps/GPSControlPanel.java | 2 +- .../items/gps/GPSMarkerTool.java | 2 +- .../items/gps/GPSTransmitter.java | 2 +- .../items/magical/KnowledgeTome.java | 4 +- .../items/magical/MagicalZombiePills.java | 2 +- .../items/magical/SoulboundRune.java | 6 +- .../items/magical/StormStaff.java | 6 +- .../items/magical/WaterStaff.java | 4 +- .../items/magical/WindStaff.java | 4 +- .../magical/talismans/EnderTalisman.java | 2 +- .../items/magical/talismans/Talisman.java | 4 +- .../items/multiblocks/AbstractSmeltery.java | 6 +- .../items/multiblocks/ArmorForge.java | 6 +- .../multiblocks/AutomatedPanningMachine.java | 4 +- .../items/multiblocks/BackpackCrafter.java | 2 +- .../items/multiblocks/Compressor.java | 6 +- .../multiblocks/EnhancedCraftingTable.java | 6 +- .../items/multiblocks/GrindStone.java | 6 +- .../items/multiblocks/Juicer.java | 6 +- .../items/multiblocks/MagicWorkbench.java | 6 +- .../items/multiblocks/OreCrusher.java | 6 +- .../items/multiblocks/OreWasher.java | 6 +- .../items/multiblocks/PressureChamber.java | 6 +- .../items/multiblocks/Smeltery.java | 4 +- .../items/multiblocks/miner/ActiveMiner.java | 6 +- .../multiblocks/miner/IndustrialMiner.java | 4 +- .../items/tools/ExplosiveShovel.java | 2 +- .../items/tools/ExplosiveTool.java | 2 +- .../implementation/items/tools/GoldPan.java | 2 +- .../items/tools/GrapplingHook.java | 2 +- .../implementation/items/tools/LumberAxe.java | 2 +- .../items/tools/PickaxeOfTheSeeker.java | 4 +- .../items/tools/PickaxeOfVeinMining.java | 2 +- .../items/tools/SmeltersPickaxe.java | 4 +- .../items/weapons/SeismicAxe.java | 2 +- .../listeners/AncientAltarListener.java | 12 +- .../listeners/BackpackListener.java | 8 +- .../listeners/BlockListener.java | 2 +- .../listeners/BlockPhysicsListener.java | 2 +- .../listeners/ButcherAndroidListener.java | 2 +- .../listeners/CargoNodeListener.java | 4 +- .../listeners/CoolerListener.java | 2 +- .../listeners/DeathpointListener.java | 4 +- .../listeners/DebugFishListener.java | 4 +- .../listeners/DispenserListener.java | 2 +- .../listeners/EnhancedFurnaceListener.java | 4 +- .../listeners/ExplosionsListener.java | 2 +- .../listeners/FireworksListener.java | 2 +- .../listeners/GadgetsListener.java | 2 +- .../listeners/GrapplingHookListener.java | 2 +- .../listeners/IronGolemListener.java | 4 +- .../listeners/ItemPickupListener.java | 2 +- .../listeners/MobDropListener.java | 2 +- .../listeners/MultiBlockListener.java | 2 +- .../listeners/NetworkListener.java | 2 +- .../PlayerInteractEntityListener.java | 2 +- .../listeners/PlayerProfileListener.java | 2 +- .../listeners/SeismicAxeListener.java | 2 +- .../listeners/SlimefunBootsListener.java | 2 +- .../listeners/SlimefunBowListener.java | 2 +- .../listeners/SlimefunGuideListener.java | 4 +- .../SlimefunItemConsumeListener.java | 2 +- .../listeners/SlimefunItemListener.java | 6 +- .../listeners/SoulboundListener.java | 2 +- .../listeners/TalismanListener.java | 2 +- .../listeners/TeleporterListener.java | 2 +- .../listeners/VampireBladeListener.java | 2 +- .../listeners/VanillaMachinesListener.java | 6 +- .../listeners/WitherListener.java | 2 +- .../listeners/WorldListener.java | 2 +- .../resources/NetherIceResource.java | 2 +- .../implementation/resources/OilResource.java | 2 +- .../resources/SaltResource.java | 2 +- .../resources/UraniumResource.java | 2 +- .../setup/DefaultCategories.java | 2 +- .../implementation/setup/PostSetup.java | 2 +- .../implementation/setup/ResearchSetup.java | 2 +- .../setup/SlimefunItemSetup.java | 2 +- .../tasks/AncientAltarTask.java | 2 +- .../implementation/tasks/ArmorTask.java | 4 +- .../implementation/tasks/PlayerTask.java | 3 +- .../tasks/SlimefunStartupTask.java | 2 +- .../implementation/tasks/TickerTask.java | 2 +- .../slimefun4/utils/ChatUtils.java | 4 +- .../slimefun4/utils/ChestMenuUtils.java | 18 +- .../slimefun4/utils/HeadTexture.java | 3 +- .../slimefun4/utils/SlimefunUtils.java | 2 +- .../Slimefun/Lists/RecipeType.java | 4 +- .../Slimefun/Objects/Category.java | 6 +- .../Objects/SlimefunItem/SlimefunItem.java | 2 +- .../abstractItems/AGenerator.java | 2 +- .../interfaces/InventoryBlock.java | 2 +- .../Objects/handlers/RainbowTicker.java | 2 +- .../Slimefun/SlimefunPlugin.java | 539 +-------------- .../Slimefun/api/BlockStorage.java | 6 +- .../mrCookieSlime/Slimefun/api/Slimefun.java | 10 +- .../Slimefun/api/SlimefunItemStack.java | 2 +- .../Slimefun/api/energy/ChargableBlock.java | 2 +- .../api/inventory/BlockMenuPreset.java | 2 +- src/main/resources/plugin.yml | 2 +- .../slimefun4/testing/TestUtilities.java | 2 +- .../testing/interfaces/SlimefunItemTest.java | 2 +- .../testing/tests/TestPluginClass.java | 8 +- .../tests/commands/TestBackpackCommand.java | 2 +- .../tests/commands/TestDebugFishCommand.java | 2 +- .../tests/commands/TestGuideCommand.java | 2 +- .../tests/commands/TestResearchCommand.java | 2 +- .../tests/geo/TestResourceRegistration.java | 2 +- .../testing/tests/gps/TestWaypoints.java | 2 +- .../tests/guide/TestBookSlimefunGuide.java | 2 +- .../tests/guide/TestChestSlimefunGuide.java | 2 +- .../testing/tests/guide/TestGuideOpening.java | 2 +- .../testing/tests/items/TestCategories.java | 2 +- .../testing/tests/items/TestItemHandlers.java | 2 +- .../testing/tests/items/TestItemSettings.java | 2 +- .../testing/tests/items/TestItemSetup.java | 2 +- .../tests/items/TestRechargeableItems.java | 2 +- .../items/TestSlimefunItemRegistration.java | 2 +- .../backpacks/TestEnderBackpack.java | 2 +- .../implementations/food/TestDietCookie.java | 2 +- .../implementations/food/TestMeatJerky.java | 2 +- .../food/TestMonsterJerky.java | 2 +- .../tests/listeners/TestBackpackListener.java | 2 +- .../listeners/TestCargoNodeListener.java | 2 +- .../tests/listeners/TestCoolerListener.java | 2 +- .../listeners/TestDeathpointListener.java | 2 +- .../listeners/TestFireworksListener.java | 2 +- .../listeners/TestIronGolemListener.java | 2 +- .../listeners/TestMultiblockListener.java | 2 +- .../tests/listeners/TestNetworkListener.java | 2 +- .../listeners/TestPlayerProfileListener.java | 2 +- .../listeners/TestSoulboundListener.java | 2 +- .../TestVanillaMachinesListener.java | 2 +- .../tests/multiblocks/TestMultiBlocks.java | 2 +- .../tests/profiles/TestGuideHistory.java | 2 +- .../tests/profiles/TestPlayerBackpacks.java | 2 +- .../tests/profiles/TestPlayerProfile.java | 2 +- .../researches/TestProfileResearches.java | 2 +- .../tests/researches/TestResearchSetup.java | 2 +- .../researches/TestResearchUnlocking.java | 2 +- .../tests/researches/TestResearches.java | 2 +- .../tests/services/TestBlockDataService.java | 2 +- .../tests/services/TestItemDataService.java | 2 +- .../services/TestPermissionsService.java | 2 +- .../tests/services/TestRecipeService.java | 2 +- .../tests/services/TestUpdaterService.java | 2 +- .../services/TextCustomTextureService.java | 2 +- .../tests/utils/TestItemStackWrapper.java | 2 +- .../tests/utils/TestSoulboundItem.java | 2 +- 268 files changed, 1263 insertions(+), 1077 deletions(-) create mode 100644 src/main/java/io/github/thebusybiscuit/slimefun4/implementation/SlimefunPlugin.java diff --git a/src/main/java/io/github/thebusybiscuit/slimefun4/api/ErrorReport.java b/src/main/java/io/github/thebusybiscuit/slimefun4/api/ErrorReport.java index 95ec565a9..70a5467c9 100644 --- a/src/main/java/io/github/thebusybiscuit/slimefun4/api/ErrorReport.java +++ b/src/main/java/io/github/thebusybiscuit/slimefun4/api/ErrorReport.java @@ -18,7 +18,7 @@ import org.bukkit.Bukkit; import org.bukkit.Location; import org.bukkit.plugin.Plugin; -import me.mrCookieSlime.Slimefun.SlimefunPlugin; +import io.github.thebusybiscuit.slimefun4.implementation.SlimefunPlugin; import me.mrCookieSlime.Slimefun.Objects.SlimefunItem.SlimefunItem; import me.mrCookieSlime.Slimefun.Objects.handlers.BlockTicker; import me.mrCookieSlime.Slimefun.api.BlockStorage; diff --git a/src/main/java/io/github/thebusybiscuit/slimefun4/api/MinecraftVersion.java b/src/main/java/io/github/thebusybiscuit/slimefun4/api/MinecraftVersion.java index 821b07001..43ad2d8b3 100644 --- a/src/main/java/io/github/thebusybiscuit/slimefun4/api/MinecraftVersion.java +++ b/src/main/java/io/github/thebusybiscuit/slimefun4/api/MinecraftVersion.java @@ -2,7 +2,7 @@ package io.github.thebusybiscuit.slimefun4.api; import org.apache.commons.lang.Validate; -import me.mrCookieSlime.Slimefun.SlimefunPlugin; +import io.github.thebusybiscuit.slimefun4.implementation.SlimefunPlugin; /** * This enum holds all versions of Minecraft that we currently support. diff --git a/src/main/java/io/github/thebusybiscuit/slimefun4/api/SlimefunAddon.java b/src/main/java/io/github/thebusybiscuit/slimefun4/api/SlimefunAddon.java index 8a3d69488..a8bb04e3e 100644 --- a/src/main/java/io/github/thebusybiscuit/slimefun4/api/SlimefunAddon.java +++ b/src/main/java/io/github/thebusybiscuit/slimefun4/api/SlimefunAddon.java @@ -10,7 +10,7 @@ import org.bukkit.plugin.Plugin; import org.bukkit.plugin.PluginDescriptionFile; import org.bukkit.plugin.java.JavaPlugin; -import me.mrCookieSlime.Slimefun.SlimefunPlugin; +import io.github.thebusybiscuit.slimefun4.implementation.SlimefunPlugin; import me.mrCookieSlime.Slimefun.Objects.Category; import me.mrCookieSlime.Slimefun.Objects.SlimefunItem.SlimefunItem; diff --git a/src/main/java/io/github/thebusybiscuit/slimefun4/api/geo/GEOResource.java b/src/main/java/io/github/thebusybiscuit/slimefun4/api/geo/GEOResource.java index b9828dc02..cfa3cbfa5 100644 --- a/src/main/java/io/github/thebusybiscuit/slimefun4/api/geo/GEOResource.java +++ b/src/main/java/io/github/thebusybiscuit/slimefun4/api/geo/GEOResource.java @@ -10,9 +10,9 @@ import org.bukkit.inventory.ItemStack; import io.github.thebusybiscuit.slimefun4.api.events.GEOResourceGenerationEvent; import io.github.thebusybiscuit.slimefun4.core.services.localization.Language; +import io.github.thebusybiscuit.slimefun4.implementation.SlimefunPlugin; import io.github.thebusybiscuit.slimefun4.implementation.items.geo.GEOMiner; import io.github.thebusybiscuit.slimefun4.implementation.items.geo.GEOScanner; -import me.mrCookieSlime.Slimefun.SlimefunPlugin; /** * A {@link GEOResource} is a virtual resource that can be thought of as world-gen. @@ -91,7 +91,7 @@ public interface GEOResource extends Keyed { * @return The localized name for this {@link GEOResource} */ default String getName(Player p) { - String name = SlimefunPlugin.getLocal().getResourceString(p, "resources." + getKey().getNamespace() + "." + getKey().getKey()); + String name = SlimefunPlugin.getLocalization().getResourceString(p, "resources." + getKey().getNamespace() + "." + getKey().getKey()); return name == null ? getName() : name; } diff --git a/src/main/java/io/github/thebusybiscuit/slimefun4/api/geo/ResourceManager.java b/src/main/java/io/github/thebusybiscuit/slimefun4/api/geo/ResourceManager.java index f68f2e4df..896f133ab 100644 --- a/src/main/java/io/github/thebusybiscuit/slimefun4/api/geo/ResourceManager.java +++ b/src/main/java/io/github/thebusybiscuit/slimefun4/api/geo/ResourceManager.java @@ -9,6 +9,7 @@ import java.util.concurrent.ThreadLocalRandom; import org.apache.commons.lang.Validate; import org.bukkit.Bukkit; +import org.bukkit.ChatColor; import org.bukkit.Chunk; import org.bukkit.Location; import org.bukkit.World; @@ -20,12 +21,13 @@ import io.github.thebusybiscuit.cscorelib2.config.Config; import io.github.thebusybiscuit.cscorelib2.item.CustomItem; import io.github.thebusybiscuit.slimefun4.api.MinecraftVersion; import io.github.thebusybiscuit.slimefun4.api.events.GEOResourceGenerationEvent; +import io.github.thebusybiscuit.slimefun4.implementation.SlimefunPlugin; import io.github.thebusybiscuit.slimefun4.implementation.items.geo.GEOMiner; import io.github.thebusybiscuit.slimefun4.implementation.items.geo.GEOScanner; import io.github.thebusybiscuit.slimefun4.utils.ChestMenuUtils; +import io.github.thebusybiscuit.slimefun4.utils.HeadTexture; import io.github.thebusybiscuit.slimefun4.utils.SlimefunUtils; import me.mrCookieSlime.CSCoreLibPlugin.general.Inventory.ChestMenu; -import me.mrCookieSlime.Slimefun.SlimefunPlugin; import me.mrCookieSlime.Slimefun.api.BlockStorage; /** @@ -42,7 +44,6 @@ import me.mrCookieSlime.Slimefun.api.BlockStorage; public class ResourceManager { private final int[] backgroundSlots = { 0, 1, 2, 3, 5, 6, 7, 8, 9, 17, 18, 26, 27, 35, 36, 44, 45, 46, 48, 49, 50, 52, 53 }; - private final ItemStack chunkTexture = SlimefunUtils.getCustomHead("8449b9318e33158e64a46ab0de121c3d40000e3332c1574932b3c849d8fa0dc2"); private final Config config; public ResourceManager(SlimefunPlugin plugin) { @@ -77,7 +78,26 @@ public class ResourceManager { } } + /** + * This method returns the amount of a certain {@link GEOResource} found in a given {@link Chunk}. + * The result is an {@link OptionalInt} which will be empty if this {@link GEOResource} + * has not been generated at that {@link Location} yet. + * + * @param resource + * The {@link GEOResource} to query + * @param world + * The {@link World} of this {@link Location} + * @param x + * The {@link Chunk} x cordinate + * @param z + * The {@link Chunk} z cordinate + * + * @return An {@link OptionalInt}, either empty or containing the amount of the given {@link GEOResource} + */ public OptionalInt getSupplies(GEOResource resource, World world, int x, int z) { + Validate.notNull(resource, "Cannot get supplies for null"); + Validate.notNull(world, "World must not be null"); + String key = resource.getKey().toString().replace(':', '-'); String value = BlockStorage.getChunkInfo(world, x, z, key); @@ -90,11 +110,17 @@ public class ResourceManager { } public void setSupplies(GEOResource resource, World world, int x, int z, int value) { + Validate.notNull(resource, "Cannot set supplies for null"); + Validate.notNull(world, "World cannot be null"); + String key = resource.getKey().toString().replace(':', '-'); BlockStorage.setChunkInfo(world, x, z, key, String.valueOf(value)); } private int generate(GEOResource resource, World world, int x, int z) { + Validate.notNull(resource, "Cannot generate resources for null"); + Validate.notNull(world, "World cannot be null"); + Block block = world.getBlockAt(x << 4, 72, z << 4); int value = resource.getDefaultSupply(world.getEnvironment(), block.getBiome()); @@ -133,20 +159,20 @@ public class ResourceManager { */ public void scan(Player p, Block block, int page) { if (SlimefunPlugin.getGPSNetwork().getNetworkComplexity(p.getUniqueId()) < 600) { - SlimefunPlugin.getLocal().sendMessages(p, "gps.insufficient-complexity", true, msg -> msg.replace("%complexity%", "600")); + SlimefunPlugin.getLocalization().sendMessages(p, "gps.insufficient-complexity", true, msg -> msg.replace("%complexity%", "600")); return; } int x = block.getX() >> 4; int z = block.getZ() >> 4; - ChestMenu menu = new ChestMenu("&4" + SlimefunPlugin.getLocal().getResourceString(p, "tooltips.results")); + ChestMenu menu = new ChestMenu("&4" + SlimefunPlugin.getLocalization().getResourceString(p, "tooltips.results")); for (int slot : backgroundSlots) { menu.addItem(slot, ChestMenuUtils.getBackground(), ChestMenuUtils.getEmptyClickHandler()); } - menu.addItem(4, new CustomItem(chunkTexture, "&e" + SlimefunPlugin.getLocal().getResourceString(p, "tooltips.chunk"), "", "&8\u21E8 &7" + SlimefunPlugin.getLocal().getResourceString(p, "tooltips.world") + ": " + block.getWorld().getName(), "&8\u21E8 &7X: " + x + " Z: " + z), ChestMenuUtils.getEmptyClickHandler()); + menu.addItem(4, new CustomItem(SlimefunUtils.getCustomHead(HeadTexture.MINECRAFT_CHUNK.getTexture()), ChatColor.YELLOW + SlimefunPlugin.getLocalization().getResourceString(p, "tooltips.chunk"), "", "&8\u21E8 &7" + SlimefunPlugin.getLocalization().getResourceString(p, "tooltips.world") + ": " + block.getWorld().getName(), "&8\u21E8 &7X: " + x + " Z: " + z), ChestMenuUtils.getEmptyClickHandler()); List resources = new ArrayList<>(SlimefunPlugin.getRegistry().getGEOResources().values()); Collections.sort(resources, (a, b) -> a.getName(p).toLowerCase(Locale.ROOT).compareTo(b.getName(p).toLowerCase(Locale.ROOT))); @@ -157,9 +183,9 @@ public class ResourceManager { GEOResource resource = resources.get(i); OptionalInt optional = getSupplies(resource, block.getWorld(), x, z); int supplies = optional.isPresent() ? optional.getAsInt() : generate(resource, block.getWorld(), x, z); - String suffix = SlimefunPlugin.getLocal().getResourceString(p, supplies == 1 ? "tooltips.unit" : "tooltips.units"); + String suffix = SlimefunPlugin.getLocalization().getResourceString(p, supplies == 1 ? "tooltips.unit" : "tooltips.units"); - ItemStack item = new CustomItem(resource.getItem(), "&r" + resource.getName(p), "&8\u21E8 &e" + supplies + ' ' + suffix); + ItemStack item = new CustomItem(resource.getItem(), "&f" + resource.getName(p), "&8\u21E8 &e" + supplies + ' ' + suffix); if (supplies > 1) { item.setAmount(supplies > item.getMaxStackSize() ? item.getMaxStackSize() : supplies); diff --git a/src/main/java/io/github/thebusybiscuit/slimefun4/api/gps/GPSNetwork.java b/src/main/java/io/github/thebusybiscuit/slimefun4/api/gps/GPSNetwork.java index 27415de8c..8694c661b 100644 --- a/src/main/java/io/github/thebusybiscuit/slimefun4/api/gps/GPSNetwork.java +++ b/src/main/java/io/github/thebusybiscuit/slimefun4/api/gps/GPSNetwork.java @@ -26,12 +26,12 @@ import io.github.thebusybiscuit.slimefun4.api.geo.GEOResource; import io.github.thebusybiscuit.slimefun4.api.geo.ResourceManager; import io.github.thebusybiscuit.slimefun4.api.player.PlayerProfile; import io.github.thebusybiscuit.slimefun4.implementation.SlimefunItems; +import io.github.thebusybiscuit.slimefun4.implementation.SlimefunPlugin; import io.github.thebusybiscuit.slimefun4.implementation.items.gps.GPSTransmitter; import io.github.thebusybiscuit.slimefun4.implementation.items.gps.Teleporter; import io.github.thebusybiscuit.slimefun4.utils.ChestMenuUtils; import io.github.thebusybiscuit.slimefun4.utils.HeadTexture; import me.mrCookieSlime.CSCoreLibPlugin.general.Inventory.ChestMenu; -import me.mrCookieSlime.Slimefun.SlimefunPlugin; import me.mrCookieSlime.Slimefun.Objects.SlimefunItem.SlimefunItem; import me.mrCookieSlime.Slimefun.api.BlockStorage; import me.mrCookieSlime.Slimefun.api.Slimefun; @@ -123,14 +123,14 @@ public class GPSNetwork { } public void openTransmitterControlPanel(Player p) { - ChestMenu menu = new ChestMenu(ChatColor.BLUE + SlimefunPlugin.getLocal().getMessage(p, "machines.GPS_CONTROL_PANEL.title")); + ChestMenu menu = new ChestMenu(ChatColor.BLUE + SlimefunPlugin.getLocalization().getMessage(p, "machines.GPS_CONTROL_PANEL.title")); for (int slot : border) { menu.addItem(slot, ChestMenuUtils.getBackground(), ChestMenuUtils.getEmptyClickHandler()); } menu.addItem(2, new CustomItem(SlimefunItems.GPS_TRANSMITTER, im -> { - im.setDisplayName(ChatColor.GRAY + SlimefunPlugin.getLocal().getMessage(p, "machines.GPS_CONTROL_PANEL.transmitters")); + im.setDisplayName(ChatColor.GRAY + SlimefunPlugin.getLocalization().getMessage(p, "machines.GPS_CONTROL_PANEL.transmitters")); im.setLore(null); })); @@ -140,7 +140,7 @@ public class GPSNetwork { menu.addItem(4, new CustomItem(SlimefunItems.GPS_CONTROL_PANEL, "&7Network Info", "", "&8\u21E8 &7Status: " + (complexity > 0 ? "&2&lONLINE" : "&4&lOFFLINE"), "&8\u21E8 &7Complexity: &f" + complexity)); menu.addMenuClickHandler(4, ChestMenuUtils.getEmptyClickHandler()); - menu.addItem(6, new CustomItem(HeadTexture.GLOBE_OVERWORLD.getAsItemStack(), "&7" + SlimefunPlugin.getLocal().getMessage(p, "machines.GPS_CONTROL_PANEL.waypoints"), "", ChatColor.GRAY + "\u21E8 " + SlimefunPlugin.getLocal().getMessage(p, "guide.tooltips.open-category"))); + menu.addItem(6, new CustomItem(HeadTexture.GLOBE_OVERWORLD.getAsItemStack(), "&7" + SlimefunPlugin.getLocalization().getMessage(p, "machines.GPS_CONTROL_PANEL.waypoints"), "", ChatColor.GRAY + "\u21E8 " + SlimefunPlugin.getLocalization().getMessage(p, "guide.tooltips.open-category"))); menu.addMenuClickHandler(6, (pl, slot, item, action) -> { openWaypointControlPanel(pl); return false; @@ -196,13 +196,13 @@ public class GPSNetwork { public void openWaypointControlPanel(Player p) { PlayerProfile.get(p, profile -> { - ChestMenu menu = new ChestMenu(ChatColor.BLUE + SlimefunPlugin.getLocal().getMessage(p, "machines.GPS_CONTROL_PANEL.title")); + ChestMenu menu = new ChestMenu(ChatColor.BLUE + SlimefunPlugin.getLocalization().getMessage(p, "machines.GPS_CONTROL_PANEL.title")); for (int slot : border) { menu.addItem(slot, ChestMenuUtils.getBackground(), ChestMenuUtils.getEmptyClickHandler()); } - menu.addItem(2, new CustomItem(SlimefunItems.GPS_TRANSMITTER, "&7" + SlimefunPlugin.getLocal().getMessage(p, "machines.GPS_CONTROL_PANEL.transmitters"), "", ChatColor.GRAY + "\u21E8 " + SlimefunPlugin.getLocal().getMessage(p, "guide.tooltips.open-category"))); + menu.addItem(2, new CustomItem(SlimefunItems.GPS_TRANSMITTER, "&7" + SlimefunPlugin.getLocalization().getMessage(p, "machines.GPS_CONTROL_PANEL.transmitters"), "", ChatColor.GRAY + "\u21E8 " + SlimefunPlugin.getLocalization().getMessage(p, "guide.tooltips.open-category"))); menu.addMenuClickHandler(2, (pl, slot, item, action) -> { openTransmitterControlPanel(pl); return false; @@ -212,7 +212,7 @@ public class GPSNetwork { menu.addItem(4, new CustomItem(SlimefunItems.GPS_CONTROL_PANEL, "&7Network Info", "", "&8\u21E8 &7Status: " + (complexity > 0 ? "&2&lONLINE" : "&4&lOFFLINE"), "&8\u21E8 &7Complexity: &f" + complexity)); menu.addMenuClickHandler(4, ChestMenuUtils.getEmptyClickHandler()); - menu.addItem(6, new CustomItem(HeadTexture.GLOBE_OVERWORLD.getAsItemStack(), "&7" + SlimefunPlugin.getLocal().getMessage(p, "machines.GPS_CONTROL_PANEL.waypoints"))); + menu.addItem(6, new CustomItem(HeadTexture.GLOBE_OVERWORLD.getAsItemStack(), "&7" + SlimefunPlugin.getLocalization().getMessage(p, "machines.GPS_CONTROL_PANEL.waypoints"))); menu.addMenuClickHandler(6, ChestMenuUtils.getEmptyClickHandler()); int index = 0; @@ -249,11 +249,11 @@ public class GPSNetwork { public void createWaypoint(Player p, Location l) { PlayerProfile.get(p, profile -> { if ((profile.getWaypoints().size() + 2) > inventory.length) { - SlimefunPlugin.getLocal().sendMessage(p, "gps.waypoint.max", true); + SlimefunPlugin.getLocalization().sendMessage(p, "gps.waypoint.max", true); return; } - SlimefunPlugin.getLocal().sendMessage(p, "gps.waypoint.new", true); + SlimefunPlugin.getLocalization().sendMessage(p, "gps.waypoint.new", true); p.playSound(p.getLocation(), Sound.BLOCK_NOTE_BLOCK_PLING, 0.5F, 1F); ChatInput.waitForPlayer(SlimefunPlugin.instance, p, message -> addWaypoint(p, message, l)); @@ -273,7 +273,7 @@ public class GPSNetwork { public void addWaypoint(Player p, String name, Location l) { PlayerProfile.get(p, profile -> { if ((profile.getWaypoints().size() + 2) > inventory.length) { - SlimefunPlugin.getLocal().sendMessage(p, "gps.waypoint.max", true); + SlimefunPlugin.getLocalization().sendMessage(p, "gps.waypoint.max", true); return; } @@ -286,7 +286,7 @@ public class GPSNetwork { profile.addWaypoint(new Waypoint(profile, id, event.getLocation(), event.getName())); p.playSound(p.getLocation(), Sound.BLOCK_NOTE_BLOCK_PLING, 1F, 1F); - SlimefunPlugin.getLocal().sendMessage(p, "gps.waypoint.added", true); + SlimefunPlugin.getLocalization().sendMessage(p, "gps.waypoint.added", true); } }); }); diff --git a/src/main/java/io/github/thebusybiscuit/slimefun4/api/gps/TeleportationManager.java b/src/main/java/io/github/thebusybiscuit/slimefun4/api/gps/TeleportationManager.java index 7535551a0..0b99e4370 100644 --- a/src/main/java/io/github/thebusybiscuit/slimefun4/api/gps/TeleportationManager.java +++ b/src/main/java/io/github/thebusybiscuit/slimefun4/api/gps/TeleportationManager.java @@ -18,10 +18,10 @@ import io.github.thebusybiscuit.cscorelib2.chat.ChatColors; import io.github.thebusybiscuit.cscorelib2.item.CustomItem; import io.github.thebusybiscuit.cscorelib2.math.DoubleHandler; import io.github.thebusybiscuit.slimefun4.api.player.PlayerProfile; +import io.github.thebusybiscuit.slimefun4.implementation.SlimefunPlugin; import io.github.thebusybiscuit.slimefun4.utils.ChestMenuUtils; import io.github.thebusybiscuit.slimefun4.utils.HeadTexture; import me.mrCookieSlime.CSCoreLibPlugin.general.Inventory.ChestMenu; -import me.mrCookieSlime.Slimefun.SlimefunPlugin; import me.mrCookieSlime.Slimefun.api.Slimefun; public final class TeleportationManager { @@ -46,7 +46,7 @@ public final class TeleportationManager { menu.addItem(slot, ChestMenuUtils.getBackground(), ChestMenuUtils.getEmptyClickHandler()); } - menu.addItem(4, new CustomItem(HeadTexture.GLOBE_OVERWORLD.getAsItemStack(), ChatColor.YELLOW + SlimefunPlugin.getLocal().getMessage(p, "machines.TELEPORTER.gui.title"))); + menu.addItem(4, new CustomItem(HeadTexture.GLOBE_OVERWORLD.getAsItemStack(), ChatColor.YELLOW + SlimefunPlugin.getLocalization().getMessage(p, "machines.TELEPORTER.gui.title"))); menu.addMenuClickHandler(4, ChestMenuUtils.getEmptyClickHandler()); Location source = new Location(b.getWorld(), b.getX() + 0.5D, b.getY() + 2D, b.getZ() + 0.5D); @@ -61,7 +61,7 @@ public final class TeleportationManager { Location l = waypoint.getLocation(); menu.addItem(slot, - new CustomItem(waypoint.getIcon(), waypoint.getName().replace("player:death ", ""), "", "&8\u21E8 &7" + SlimefunPlugin.getLocal().getResourceString(p, "tooltips.world") + ": &f" + l.getWorld().getName(), "&8\u21E8 &7X: &f" + l.getX(), "&8\u21E8 &7Y: &f" + l.getY(), "&8\u21E8 &7Z: &f" + l.getZ(), "&8\u21E8 &7" + SlimefunPlugin.getLocal().getMessage(p, "machines.TELEPORTER.gui.time") + ": &f" + DoubleHandler.fixDouble(0.5 * getTeleportationTime(complexity, source, l)) + "s", "", "&8\u21E8 &c" + SlimefunPlugin.getLocal().getMessage(p, "machines.TELEPORTER.gui.tooltip"))); + new CustomItem(waypoint.getIcon(), waypoint.getName().replace("player:death ", ""), "", "&8\u21E8 &7" + SlimefunPlugin.getLocalization().getResourceString(p, "tooltips.world") + ": &f" + l.getWorld().getName(), "&8\u21E8 &7X: &f" + l.getX(), "&8\u21E8 &7Y: &f" + l.getY(), "&8\u21E8 &7Z: &f" + l.getZ(), "&8\u21E8 &7" + SlimefunPlugin.getLocalization().getMessage(p, "machines.TELEPORTER.gui.time") + ": &f" + DoubleHandler.fixDouble(0.5 * getTeleportationTime(complexity, source, l)) + "s", "", "&8\u21E8 &c" + SlimefunPlugin.getLocalization().getMessage(p, "machines.TELEPORTER.gui.tooltip"))); menu.addMenuClickHandler(slot, (pl, s, item, action) -> { pl.closeInventory(); teleport(pl.getUniqueId(), complexity, source, l, false); @@ -107,7 +107,7 @@ public final class TeleportationManager { teleporterUsers.remove(uuid); if (p != null) { - p.sendTitle(ChatColors.color(SlimefunPlugin.getLocal().getMessage(p, "machines.TELEPORTER.cancelled")), ChatColors.color("&c&k40&f&c%"), 20, 60, 20); + p.sendTitle(ChatColors.color(SlimefunPlugin.getLocalization().getMessage(p, "machines.TELEPORTER.cancelled")), ChatColors.color("&c&k40&f&c%"), 20, 60, 20); } } @@ -116,12 +116,12 @@ public final class TeleportationManager { if (isValid(p, source)) { if (progress > 99) { - p.sendTitle(ChatColors.color(SlimefunPlugin.getLocal().getMessage(p, "machines.TELEPORTER.teleported")), ChatColors.color("&b100%"), 20, 60, 20); + p.sendTitle(ChatColors.color(SlimefunPlugin.getLocalization().getMessage(p, "machines.TELEPORTER.teleported")), ChatColors.color("&b100%"), 20, 60, 20); p.teleport(destination); if (resistance) { p.addPotionEffect(new PotionEffect(PotionEffectType.DAMAGE_RESISTANCE, 600, 20)); - SlimefunPlugin.getLocal().sendMessage(p, "machines.TELEPORTER.invulnerability"); + SlimefunPlugin.getLocalization().sendMessage(p, "machines.TELEPORTER.invulnerability"); } destination.getWorld().spawnParticle(Particle.PORTAL, new Location(destination.getWorld(), destination.getX(), destination.getY() + 1, destination.getZ()), progress * 2, 0.2F, 0.8F, 0.2F); @@ -129,7 +129,7 @@ public final class TeleportationManager { teleporterUsers.remove(uuid); } else { - p.sendTitle(ChatColors.color(SlimefunPlugin.getLocal().getMessage(p, "machines.TELEPORTER.teleporting")), ChatColors.color("&b" + progress + "%"), 0, 60, 0); + p.sendTitle(ChatColors.color(SlimefunPlugin.getLocalization().getMessage(p, "machines.TELEPORTER.teleporting")), ChatColors.color("&b" + progress + "%"), 0, 60, 0); source.getWorld().spawnParticle(Particle.PORTAL, source, progress * 2, 0.2F, 0.8F, 0.2F); source.getWorld().playSound(source, Sound.BLOCK_BEACON_AMBIENT, 1F, 0.6F); diff --git a/src/main/java/io/github/thebusybiscuit/slimefun4/api/gps/Waypoint.java b/src/main/java/io/github/thebusybiscuit/slimefun4/api/gps/Waypoint.java index bf599e731..d27a53d18 100644 --- a/src/main/java/io/github/thebusybiscuit/slimefun4/api/gps/Waypoint.java +++ b/src/main/java/io/github/thebusybiscuit/slimefun4/api/gps/Waypoint.java @@ -9,8 +9,8 @@ import org.bukkit.inventory.ItemStack; import io.github.thebusybiscuit.slimefun4.api.events.WaypointCreateEvent; import io.github.thebusybiscuit.slimefun4.api.player.PlayerProfile; +import io.github.thebusybiscuit.slimefun4.implementation.SlimefunPlugin; import io.github.thebusybiscuit.slimefun4.implementation.items.gps.Teleporter; -import me.mrCookieSlime.Slimefun.SlimefunPlugin; /** * A {@link Waypoint} represents a named {@link Location} that was created by a {@link Player}. diff --git a/src/main/java/io/github/thebusybiscuit/slimefun4/api/items/ItemSetting.java b/src/main/java/io/github/thebusybiscuit/slimefun4/api/items/ItemSetting.java index 26873fd74..a406199c6 100644 --- a/src/main/java/io/github/thebusybiscuit/slimefun4/api/items/ItemSetting.java +++ b/src/main/java/io/github/thebusybiscuit/slimefun4/api/items/ItemSetting.java @@ -5,7 +5,7 @@ import java.util.logging.Level; import org.apache.commons.lang.Validate; import io.github.thebusybiscuit.cscorelib2.config.Config; -import me.mrCookieSlime.Slimefun.SlimefunPlugin; +import io.github.thebusybiscuit.slimefun4.implementation.SlimefunPlugin; import me.mrCookieSlime.Slimefun.Objects.SlimefunItem.SlimefunItem; import me.mrCookieSlime.Slimefun.api.Slimefun; diff --git a/src/main/java/io/github/thebusybiscuit/slimefun4/api/player/PlayerProfile.java b/src/main/java/io/github/thebusybiscuit/slimefun4/api/player/PlayerProfile.java index 30e85d15e..2e98e117a 100644 --- a/src/main/java/io/github/thebusybiscuit/slimefun4/api/player/PlayerProfile.java +++ b/src/main/java/io/github/thebusybiscuit/slimefun4/api/player/PlayerProfile.java @@ -33,9 +33,9 @@ import io.github.thebusybiscuit.slimefun4.api.gps.Waypoint; import io.github.thebusybiscuit.slimefun4.api.items.HashedArmorpiece; import io.github.thebusybiscuit.slimefun4.core.guide.GuideHistory; import io.github.thebusybiscuit.slimefun4.core.researching.Research; +import io.github.thebusybiscuit.slimefun4.implementation.SlimefunPlugin; import io.github.thebusybiscuit.slimefun4.utils.NumberUtils; import io.github.thebusybiscuit.slimefun4.utils.PatternUtils; -import me.mrCookieSlime.Slimefun.SlimefunPlugin; import me.mrCookieSlime.Slimefun.api.Slimefun; /** diff --git a/src/main/java/io/github/thebusybiscuit/slimefun4/core/attributes/EnergyNetComponent.java b/src/main/java/io/github/thebusybiscuit/slimefun4/core/attributes/EnergyNetComponent.java index 8623fe6a4..954b9d32a 100644 --- a/src/main/java/io/github/thebusybiscuit/slimefun4/core/attributes/EnergyNetComponent.java +++ b/src/main/java/io/github/thebusybiscuit/slimefun4/core/attributes/EnergyNetComponent.java @@ -2,7 +2,7 @@ package io.github.thebusybiscuit.slimefun4.core.attributes; import io.github.thebusybiscuit.slimefun4.core.networks.energy.EnergyNet; import io.github.thebusybiscuit.slimefun4.core.networks.energy.EnergyNetComponentType; -import me.mrCookieSlime.Slimefun.SlimefunPlugin; +import io.github.thebusybiscuit.slimefun4.implementation.SlimefunPlugin; import me.mrCookieSlime.Slimefun.Objects.SlimefunItem.SlimefunItem; /** diff --git a/src/main/java/io/github/thebusybiscuit/slimefun4/core/attributes/RechargeableHelper.java b/src/main/java/io/github/thebusybiscuit/slimefun4/core/attributes/RechargeableHelper.java index 47fe3b4a8..26c1c370e 100644 --- a/src/main/java/io/github/thebusybiscuit/slimefun4/core/attributes/RechargeableHelper.java +++ b/src/main/java/io/github/thebusybiscuit/slimefun4/core/attributes/RechargeableHelper.java @@ -11,8 +11,8 @@ import org.bukkit.persistence.PersistentDataType; import io.github.thebusybiscuit.cscorelib2.chat.ChatColors; import io.github.thebusybiscuit.slimefun4.api.MinecraftVersion; +import io.github.thebusybiscuit.slimefun4.implementation.SlimefunPlugin; import io.github.thebusybiscuit.slimefun4.utils.PatternUtils; -import me.mrCookieSlime.Slimefun.SlimefunPlugin; /** * This is just a simple helper class to provide static methods to the {@link Rechargeable} diff --git a/src/main/java/io/github/thebusybiscuit/slimefun4/core/attributes/RecipeDisplayItem.java b/src/main/java/io/github/thebusybiscuit/slimefun4/core/attributes/RecipeDisplayItem.java index be80cff99..09bb199d6 100644 --- a/src/main/java/io/github/thebusybiscuit/slimefun4/core/attributes/RecipeDisplayItem.java +++ b/src/main/java/io/github/thebusybiscuit/slimefun4/core/attributes/RecipeDisplayItem.java @@ -6,9 +6,9 @@ import org.bukkit.entity.Player; import org.bukkit.inventory.ItemStack; import io.github.thebusybiscuit.slimefun4.core.guide.SlimefunGuide; +import io.github.thebusybiscuit.slimefun4.implementation.SlimefunPlugin; import io.github.thebusybiscuit.slimefun4.implementation.items.geo.GEOMiner; import io.github.thebusybiscuit.slimefun4.implementation.items.tools.GoldPan; -import me.mrCookieSlime.Slimefun.SlimefunPlugin; import me.mrCookieSlime.Slimefun.Objects.SlimefunItem.SlimefunItem; import me.mrCookieSlime.Slimefun.Objects.SlimefunItem.abstractItems.AGenerator; @@ -45,6 +45,6 @@ public interface RecipeDisplayItem extends ItemAttribute { } default String getRecipeSectionLabel(Player p) { - return "&7\u21E9 " + SlimefunPlugin.getLocal().getMessage(p, getLabelLocalPath()) + " \u21E9"; + return "&7\u21E9 " + SlimefunPlugin.getLocalization().getMessage(p, getLabelLocalPath()) + " \u21E9"; } } diff --git a/src/main/java/io/github/thebusybiscuit/slimefun4/core/categories/LockedCategory.java b/src/main/java/io/github/thebusybiscuit/slimefun4/core/categories/LockedCategory.java index 581cae502..61f86fc15 100644 --- a/src/main/java/io/github/thebusybiscuit/slimefun4/core/categories/LockedCategory.java +++ b/src/main/java/io/github/thebusybiscuit/slimefun4/core/categories/LockedCategory.java @@ -12,7 +12,7 @@ import org.bukkit.entity.Player; import org.bukkit.inventory.ItemStack; import io.github.thebusybiscuit.slimefun4.api.player.PlayerProfile; -import me.mrCookieSlime.Slimefun.SlimefunPlugin; +import io.github.thebusybiscuit.slimefun4.implementation.SlimefunPlugin; import me.mrCookieSlime.Slimefun.Objects.Category; import me.mrCookieSlime.Slimefun.Objects.SlimefunItem.SlimefunItem; import me.mrCookieSlime.Slimefun.api.Slimefun; diff --git a/src/main/java/io/github/thebusybiscuit/slimefun4/core/commands/SlimefunCommand.java b/src/main/java/io/github/thebusybiscuit/slimefun4/core/commands/SlimefunCommand.java index cd2a4fa01..e13771812 100644 --- a/src/main/java/io/github/thebusybiscuit/slimefun4/core/commands/SlimefunCommand.java +++ b/src/main/java/io/github/thebusybiscuit/slimefun4/core/commands/SlimefunCommand.java @@ -15,7 +15,7 @@ import org.bukkit.event.player.PlayerCommandPreprocessEvent; import io.github.thebusybiscuit.cscorelib2.chat.ChatColors; import io.github.thebusybiscuit.slimefun4.core.commands.subcommands.Commands; -import me.mrCookieSlime.Slimefun.SlimefunPlugin; +import io.github.thebusybiscuit.slimefun4.implementation.SlimefunPlugin; /** * This {@link CommandExecutor} holds the functionality of our {@code /slimefun} command. diff --git a/src/main/java/io/github/thebusybiscuit/slimefun4/core/commands/SlimefunTabCompleter.java b/src/main/java/io/github/thebusybiscuit/slimefun4/core/commands/SlimefunTabCompleter.java index 3d7271f7a..1a4adad1b 100644 --- a/src/main/java/io/github/thebusybiscuit/slimefun4/core/commands/SlimefunTabCompleter.java +++ b/src/main/java/io/github/thebusybiscuit/slimefun4/core/commands/SlimefunTabCompleter.java @@ -12,7 +12,7 @@ import org.bukkit.command.CommandSender; import org.bukkit.command.TabCompleter; import io.github.thebusybiscuit.slimefun4.core.researching.Research; -import me.mrCookieSlime.Slimefun.SlimefunPlugin; +import io.github.thebusybiscuit.slimefun4.implementation.SlimefunPlugin; import me.mrCookieSlime.Slimefun.Objects.SlimefunItem.SlimefunItem; class SlimefunTabCompleter implements TabCompleter { diff --git a/src/main/java/io/github/thebusybiscuit/slimefun4/core/commands/SubCommand.java b/src/main/java/io/github/thebusybiscuit/slimefun4/core/commands/SubCommand.java index 5d188d617..ede461878 100644 --- a/src/main/java/io/github/thebusybiscuit/slimefun4/core/commands/SubCommand.java +++ b/src/main/java/io/github/thebusybiscuit/slimefun4/core/commands/SubCommand.java @@ -7,7 +7,7 @@ import org.bukkit.command.CommandSender; import org.bukkit.entity.Player; import io.github.thebusybiscuit.slimefun4.core.services.localization.Language; -import me.mrCookieSlime.Slimefun.SlimefunPlugin; +import io.github.thebusybiscuit.slimefun4.implementation.SlimefunPlugin; /** * This class represents a {@link SubCommand}, it is a {@link Command} that starts with @@ -53,10 +53,10 @@ public abstract class SubCommand { */ public String getDescription(CommandSender sender) { if (sender instanceof Player) { - return SlimefunPlugin.getLocal().getMessage((Player) sender, getDescription()); + return SlimefunPlugin.getLocalization().getMessage((Player) sender, getDescription()); } else { - return SlimefunPlugin.getLocal().getMessage(getDescription()); + return SlimefunPlugin.getLocalization().getMessage(getDescription()); } } diff --git a/src/main/java/io/github/thebusybiscuit/slimefun4/core/commands/subcommands/BackpackCommand.java b/src/main/java/io/github/thebusybiscuit/slimefun4/core/commands/subcommands/BackpackCommand.java index 91cedbe33..f607010c3 100644 --- a/src/main/java/io/github/thebusybiscuit/slimefun4/core/commands/subcommands/BackpackCommand.java +++ b/src/main/java/io/github/thebusybiscuit/slimefun4/core/commands/subcommands/BackpackCommand.java @@ -10,8 +10,8 @@ import io.github.thebusybiscuit.slimefun4.api.player.PlayerProfile; import io.github.thebusybiscuit.slimefun4.core.commands.SlimefunCommand; import io.github.thebusybiscuit.slimefun4.core.commands.SubCommand; import io.github.thebusybiscuit.slimefun4.implementation.SlimefunItems; +import io.github.thebusybiscuit.slimefun4.implementation.SlimefunPlugin; import io.github.thebusybiscuit.slimefun4.utils.PatternUtils; -import me.mrCookieSlime.Slimefun.SlimefunPlugin; import me.mrCookieSlime.Slimefun.api.Slimefun; class BackpackCommand extends SubCommand { @@ -38,17 +38,17 @@ class BackpackCommand extends SubCommand { @Override public void onExecute(CommandSender sender, String[] args) { if (!(sender instanceof Player) || !sender.hasPermission("slimefun.command.backpack")) { - SlimefunPlugin.getLocal().sendMessage(sender, "messages.no-permission", true); + SlimefunPlugin.getLocalization().sendMessage(sender, "messages.no-permission", true); return; } if (args.length != 3) { - SlimefunPlugin.getLocal().sendMessage(sender, "messages.usage", true, msg -> msg.replace("%usage%", "/sf backpack ")); + SlimefunPlugin.getLocalization().sendMessage(sender, "messages.usage", true, msg -> msg.replace("%usage%", "/sf backpack ")); return; } if (!PatternUtils.NUMERIC.matcher(args[2]).matches()) { - SlimefunPlugin.getLocal().sendMessage(sender, "commands.backpack.invalid-id"); + SlimefunPlugin.getLocalization().sendMessage(sender, "commands.backpack.invalid-id"); return; } @@ -56,7 +56,7 @@ class BackpackCommand extends SubCommand { OfflinePlayer backpackOwner = Bukkit.getOfflinePlayer(args[1]); if (!(backpackOwner instanceof Player) && !backpackOwner.hasPlayedBefore()) { - SlimefunPlugin.getLocal().sendMessage(sender, "commands.backpack.player-never-joined"); + SlimefunPlugin.getLocalization().sendMessage(sender, "commands.backpack.player-never-joined"); return; } @@ -64,7 +64,7 @@ class BackpackCommand extends SubCommand { PlayerProfile.get(backpackOwner, profile -> { if (!profile.getBackpack(id).isPresent()) { - SlimefunPlugin.getLocal().sendMessage(sender, "commands.backpack.backpack-does-not-exist"); + SlimefunPlugin.getLocalization().sendMessage(sender, "commands.backpack.backpack-does-not-exist"); return; } @@ -72,7 +72,7 @@ class BackpackCommand extends SubCommand { ItemStack item = SlimefunItems.RESTORED_BACKPACK.clone(); SlimefunPlugin.getBackpackListener().setBackpackId(backpackOwner, item, 2, id); ((Player) sender).getInventory().addItem(item); - SlimefunPlugin.getLocal().sendMessage(sender, "commands.backpack.restored-backpack-given"); + SlimefunPlugin.getLocalization().sendMessage(sender, "commands.backpack.restored-backpack-given"); }); }); } diff --git a/src/main/java/io/github/thebusybiscuit/slimefun4/core/commands/subcommands/CheatCommand.java b/src/main/java/io/github/thebusybiscuit/slimefun4/core/commands/subcommands/CheatCommand.java index 9111aa6df..faa553341 100644 --- a/src/main/java/io/github/thebusybiscuit/slimefun4/core/commands/subcommands/CheatCommand.java +++ b/src/main/java/io/github/thebusybiscuit/slimefun4/core/commands/subcommands/CheatCommand.java @@ -6,7 +6,7 @@ import org.bukkit.entity.Player; import io.github.thebusybiscuit.slimefun4.core.commands.SlimefunCommand; import io.github.thebusybiscuit.slimefun4.core.commands.SubCommand; import io.github.thebusybiscuit.slimefun4.core.guide.SlimefunGuide; -import me.mrCookieSlime.Slimefun.SlimefunPlugin; +import io.github.thebusybiscuit.slimefun4.implementation.SlimefunPlugin; class CheatCommand extends SubCommand { @@ -31,11 +31,11 @@ class CheatCommand extends SubCommand { SlimefunGuide.openCheatMenu((Player) sender); } else { - SlimefunPlugin.getLocal().sendMessage(sender, "messages.no-permission", true); + SlimefunPlugin.getLocalization().sendMessage(sender, "messages.no-permission", true); } } else { - SlimefunPlugin.getLocal().sendMessage(sender, "messages.only-players", true); + SlimefunPlugin.getLocalization().sendMessage(sender, "messages.only-players", true); } } diff --git a/src/main/java/io/github/thebusybiscuit/slimefun4/core/commands/subcommands/Commands.java b/src/main/java/io/github/thebusybiscuit/slimefun4/core/commands/subcommands/Commands.java index e11282560..192ef7026 100644 --- a/src/main/java/io/github/thebusybiscuit/slimefun4/core/commands/subcommands/Commands.java +++ b/src/main/java/io/github/thebusybiscuit/slimefun4/core/commands/subcommands/Commands.java @@ -4,7 +4,7 @@ import java.util.Collection; import io.github.thebusybiscuit.slimefun4.core.commands.SlimefunCommand; import io.github.thebusybiscuit.slimefun4.core.commands.SubCommand; -import me.mrCookieSlime.Slimefun.SlimefunPlugin; +import io.github.thebusybiscuit.slimefun4.implementation.SlimefunPlugin; public final class Commands { diff --git a/src/main/java/io/github/thebusybiscuit/slimefun4/core/commands/subcommands/DebugFishCommand.java b/src/main/java/io/github/thebusybiscuit/slimefun4/core/commands/subcommands/DebugFishCommand.java index f37e6373e..dcc63f273 100644 --- a/src/main/java/io/github/thebusybiscuit/slimefun4/core/commands/subcommands/DebugFishCommand.java +++ b/src/main/java/io/github/thebusybiscuit/slimefun4/core/commands/subcommands/DebugFishCommand.java @@ -6,7 +6,7 @@ import org.bukkit.entity.Player; import io.github.thebusybiscuit.slimefun4.core.commands.SlimefunCommand; import io.github.thebusybiscuit.slimefun4.core.commands.SubCommand; import io.github.thebusybiscuit.slimefun4.implementation.SlimefunItems; -import me.mrCookieSlime.Slimefun.SlimefunPlugin; +import io.github.thebusybiscuit.slimefun4.implementation.SlimefunPlugin; class DebugFishCommand extends SubCommand { @@ -30,7 +30,7 @@ class DebugFishCommand extends SubCommand { ((Player) sender).getInventory().addItem(SlimefunItems.DEBUG_FISH); } else { - SlimefunPlugin.getLocal().sendMessage(sender, "messages.no-permission", true); + SlimefunPlugin.getLocalization().sendMessage(sender, "messages.no-permission", true); } } diff --git a/src/main/java/io/github/thebusybiscuit/slimefun4/core/commands/subcommands/GiveCommand.java b/src/main/java/io/github/thebusybiscuit/slimefun4/core/commands/subcommands/GiveCommand.java index 42fdcdea4..8c9457845 100644 --- a/src/main/java/io/github/thebusybiscuit/slimefun4/core/commands/subcommands/GiveCommand.java +++ b/src/main/java/io/github/thebusybiscuit/slimefun4/core/commands/subcommands/GiveCommand.java @@ -11,8 +11,8 @@ import io.github.thebusybiscuit.cscorelib2.players.PlayerList; import io.github.thebusybiscuit.slimefun4.core.commands.SlimefunCommand; import io.github.thebusybiscuit.slimefun4.core.commands.SubCommand; import io.github.thebusybiscuit.slimefun4.core.multiblocks.MultiBlockMachine; +import io.github.thebusybiscuit.slimefun4.implementation.SlimefunPlugin; import io.github.thebusybiscuit.slimefun4.utils.PatternUtils; -import me.mrCookieSlime.Slimefun.SlimefunPlugin; import me.mrCookieSlime.Slimefun.Objects.SlimefunItem.SlimefunItem; class GiveCommand extends SubCommand { @@ -50,36 +50,36 @@ class GiveCommand extends SubCommand { giveItem(sender, p, sfItem, args); } else { - SlimefunPlugin.getLocal().sendMessage(sender, "messages.not-valid-item", true, msg -> msg.replace(PLACEHOLDER_ITEM, args[2])); + SlimefunPlugin.getLocalization().sendMessage(sender, "messages.not-valid-item", true, msg -> msg.replace(PLACEHOLDER_ITEM, args[2])); } } else { - SlimefunPlugin.getLocal().sendMessage(sender, "messages.not-online", true, msg -> msg.replace(PLACEHOLDER_PLAYER, args[1])); + SlimefunPlugin.getLocalization().sendMessage(sender, "messages.not-online", true, msg -> msg.replace(PLACEHOLDER_PLAYER, args[1])); } } else { - SlimefunPlugin.getLocal().sendMessage(sender, "messages.usage", true, msg -> msg.replace("%usage%", "/sf give [Amount]")); + SlimefunPlugin.getLocalization().sendMessage(sender, "messages.usage", true, msg -> msg.replace("%usage%", "/sf give [Amount]")); } } else { - SlimefunPlugin.getLocal().sendMessage(sender, "messages.no-permission", true); + SlimefunPlugin.getLocalization().sendMessage(sender, "messages.no-permission", true); } } private void giveItem(CommandSender sender, Player p, SlimefunItem sfItem, String[] args) { if (sfItem instanceof MultiBlockMachine) { - SlimefunPlugin.getLocal().sendMessage(sender, "guide.cheat.no-multiblocks"); + SlimefunPlugin.getLocalization().sendMessage(sender, "guide.cheat.no-multiblocks"); } else { int amount = parseAmount(args); if (amount > 0) { - SlimefunPlugin.getLocal().sendMessage(p, "messages.given-item", true, msg -> msg.replace(PLACEHOLDER_ITEM, sfItem.getItemName()).replace(PLACEHOLDER_AMOUNT, String.valueOf(amount))); + SlimefunPlugin.getLocalization().sendMessage(p, "messages.given-item", true, msg -> msg.replace(PLACEHOLDER_ITEM, sfItem.getItemName()).replace(PLACEHOLDER_AMOUNT, String.valueOf(amount))); p.getInventory().addItem(new CustomItem(sfItem.getItem(), amount)); - SlimefunPlugin.getLocal().sendMessage(sender, "messages.give-item", true, msg -> msg.replace(PLACEHOLDER_PLAYER, args[1]).replace(PLACEHOLDER_ITEM, sfItem.getItemName()).replace(PLACEHOLDER_AMOUNT, String.valueOf(amount))); + SlimefunPlugin.getLocalization().sendMessage(sender, "messages.give-item", true, msg -> msg.replace(PLACEHOLDER_PLAYER, args[1]).replace(PLACEHOLDER_ITEM, sfItem.getItemName()).replace(PLACEHOLDER_AMOUNT, String.valueOf(amount))); } else { - SlimefunPlugin.getLocal().sendMessage(sender, "messages.not-valid-amount", true, msg -> msg.replace(PLACEHOLDER_AMOUNT, args[3])); + SlimefunPlugin.getLocalization().sendMessage(sender, "messages.not-valid-amount", true, msg -> msg.replace(PLACEHOLDER_AMOUNT, args[3])); } } } diff --git a/src/main/java/io/github/thebusybiscuit/slimefun4/core/commands/subcommands/GuideCommand.java b/src/main/java/io/github/thebusybiscuit/slimefun4/core/commands/subcommands/GuideCommand.java index e6971e736..a233cc3f5 100644 --- a/src/main/java/io/github/thebusybiscuit/slimefun4/core/commands/subcommands/GuideCommand.java +++ b/src/main/java/io/github/thebusybiscuit/slimefun4/core/commands/subcommands/GuideCommand.java @@ -7,7 +7,7 @@ import io.github.thebusybiscuit.slimefun4.core.commands.SlimefunCommand; import io.github.thebusybiscuit.slimefun4.core.commands.SubCommand; import io.github.thebusybiscuit.slimefun4.core.guide.SlimefunGuide; import io.github.thebusybiscuit.slimefun4.core.guide.SlimefunGuideLayout; -import me.mrCookieSlime.Slimefun.SlimefunPlugin; +import io.github.thebusybiscuit.slimefun4.implementation.SlimefunPlugin; class GuideCommand extends SubCommand { @@ -32,11 +32,11 @@ class GuideCommand extends SubCommand { ((Player) sender).getInventory().addItem(SlimefunGuide.getItem(SlimefunPlugin.getCfg().getBoolean("guide.default-view-book") ? SlimefunGuideLayout.BOOK : SlimefunGuideLayout.CHEST)); } else { - SlimefunPlugin.getLocal().sendMessage(sender, "messages.no-permission", true); + SlimefunPlugin.getLocalization().sendMessage(sender, "messages.no-permission", true); } } else { - SlimefunPlugin.getLocal().sendMessage(sender, "messages.only-players", true); + SlimefunPlugin.getLocalization().sendMessage(sender, "messages.only-players", true); } } diff --git a/src/main/java/io/github/thebusybiscuit/slimefun4/core/commands/subcommands/HelpCommand.java b/src/main/java/io/github/thebusybiscuit/slimefun4/core/commands/subcommands/HelpCommand.java index 511f73dd5..1c241462d 100644 --- a/src/main/java/io/github/thebusybiscuit/slimefun4/core/commands/subcommands/HelpCommand.java +++ b/src/main/java/io/github/thebusybiscuit/slimefun4/core/commands/subcommands/HelpCommand.java @@ -4,7 +4,7 @@ import org.bukkit.command.CommandSender; import io.github.thebusybiscuit.slimefun4.core.commands.SlimefunCommand; import io.github.thebusybiscuit.slimefun4.core.commands.SubCommand; -import me.mrCookieSlime.Slimefun.SlimefunPlugin; +import io.github.thebusybiscuit.slimefun4.implementation.SlimefunPlugin; class HelpCommand extends SubCommand { diff --git a/src/main/java/io/github/thebusybiscuit/slimefun4/core/commands/subcommands/OpenGuideCommand.java b/src/main/java/io/github/thebusybiscuit/slimefun4/core/commands/subcommands/OpenGuideCommand.java index 84bcb297c..a286db515 100644 --- a/src/main/java/io/github/thebusybiscuit/slimefun4/core/commands/subcommands/OpenGuideCommand.java +++ b/src/main/java/io/github/thebusybiscuit/slimefun4/core/commands/subcommands/OpenGuideCommand.java @@ -7,7 +7,7 @@ import io.github.thebusybiscuit.slimefun4.core.commands.SlimefunCommand; import io.github.thebusybiscuit.slimefun4.core.commands.SubCommand; import io.github.thebusybiscuit.slimefun4.core.guide.SlimefunGuide; import io.github.thebusybiscuit.slimefun4.core.guide.SlimefunGuideLayout; -import me.mrCookieSlime.Slimefun.SlimefunPlugin; +import io.github.thebusybiscuit.slimefun4.implementation.SlimefunPlugin; class OpenGuideCommand extends SubCommand { @@ -33,11 +33,11 @@ class OpenGuideCommand extends SubCommand { SlimefunGuide.openGuide((Player) sender, book ? SlimefunGuideLayout.BOOK : SlimefunGuideLayout.CHEST); } else { - SlimefunPlugin.getLocal().sendMessage(sender, "messages.no-permission", true); + SlimefunPlugin.getLocalization().sendMessage(sender, "messages.no-permission", true); } } else { - SlimefunPlugin.getLocal().sendMessage(sender, "messages.only-players", true); + SlimefunPlugin.getLocalization().sendMessage(sender, "messages.only-players", true); } } diff --git a/src/main/java/io/github/thebusybiscuit/slimefun4/core/commands/subcommands/ResearchCommand.java b/src/main/java/io/github/thebusybiscuit/slimefun4/core/commands/subcommands/ResearchCommand.java index 75997151f..1ea35f95b 100644 --- a/src/main/java/io/github/thebusybiscuit/slimefun4/core/commands/subcommands/ResearchCommand.java +++ b/src/main/java/io/github/thebusybiscuit/slimefun4/core/commands/subcommands/ResearchCommand.java @@ -11,7 +11,7 @@ import io.github.thebusybiscuit.slimefun4.api.player.PlayerProfile; import io.github.thebusybiscuit.slimefun4.core.commands.SlimefunCommand; import io.github.thebusybiscuit.slimefun4.core.commands.SubCommand; import io.github.thebusybiscuit.slimefun4.core.researching.Research; -import me.mrCookieSlime.Slimefun.SlimefunPlugin; +import io.github.thebusybiscuit.slimefun4.implementation.SlimefunPlugin; class ResearchCommand extends SubCommand { @@ -60,13 +60,13 @@ class ResearchCommand extends SubCommand { }); } else { - SlimefunPlugin.getLocal().sendMessage(sender, "messages.not-online", true, msg -> msg.replace(PLACEHOLDER_PLAYER, args[1])); + SlimefunPlugin.getLocalization().sendMessage(sender, "messages.not-online", true, msg -> msg.replace(PLACEHOLDER_PLAYER, args[1])); } } - else SlimefunPlugin.getLocal().sendMessage(sender, "messages.no-permission", true); + else SlimefunPlugin.getLocalization().sendMessage(sender, "messages.no-permission", true); } else { - SlimefunPlugin.getLocal().sendMessage(sender, "messages.usage", true, msg -> msg.replace("%usage%", "/sf research ")); + SlimefunPlugin.getLocalization().sendMessage(sender, "messages.usage", true, msg -> msg.replace("%usage%", "/sf research ")); } } @@ -76,18 +76,18 @@ class ResearchCommand extends SubCommand { if (research.isPresent()) { research.get().unlock(p, true, player -> { UnaryOperator variables = msg -> msg.replace(PLACEHOLDER_PLAYER, player.getName()).replace(PLACEHOLDER_RESEARCH, research.get().getName(player)); - SlimefunPlugin.getLocal().sendMessage(player, "messages.give-research", true, variables); + SlimefunPlugin.getLocalization().sendMessage(player, "messages.give-research", true, variables); }); } else { - SlimefunPlugin.getLocal().sendMessage(sender, "messages.not-valid-research", true, msg -> msg.replace(PLACEHOLDER_RESEARCH, input)); + SlimefunPlugin.getLocalization().sendMessage(sender, "messages.not-valid-research", true, msg -> msg.replace(PLACEHOLDER_RESEARCH, input)); } } private void researchAll(CommandSender sender, PlayerProfile profile, Player p) { for (Research res : SlimefunPlugin.getRegistry().getResearches()) { if (!profile.hasUnlocked(res)) { - SlimefunPlugin.getLocal().sendMessage(sender, "messages.give-research", true, msg -> msg.replace(PLACEHOLDER_PLAYER, p.getName()).replace(PLACEHOLDER_RESEARCH, res.getName(p))); + SlimefunPlugin.getLocalization().sendMessage(sender, "messages.give-research", true, msg -> msg.replace(PLACEHOLDER_PLAYER, p.getName()).replace(PLACEHOLDER_RESEARCH, res.getName(p))); } res.unlock(p, true); @@ -99,7 +99,7 @@ class ResearchCommand extends SubCommand { profile.setResearched(research, false); } - SlimefunPlugin.getLocal().sendMessage(p, "commands.research.reset", true, msg -> msg.replace(PLACEHOLDER_PLAYER, p.getName())); + SlimefunPlugin.getLocalization().sendMessage(p, "commands.research.reset", true, msg -> msg.replace(PLACEHOLDER_PLAYER, p.getName())); } private Optional getResearchFromString(String input) { diff --git a/src/main/java/io/github/thebusybiscuit/slimefun4/core/commands/subcommands/SearchCommand.java b/src/main/java/io/github/thebusybiscuit/slimefun4/core/commands/subcommands/SearchCommand.java index 33b3f82a0..60186e0c4 100644 --- a/src/main/java/io/github/thebusybiscuit/slimefun4/core/commands/subcommands/SearchCommand.java +++ b/src/main/java/io/github/thebusybiscuit/slimefun4/core/commands/subcommands/SearchCommand.java @@ -9,7 +9,7 @@ import io.github.thebusybiscuit.slimefun4.api.player.PlayerProfile; import io.github.thebusybiscuit.slimefun4.core.commands.SlimefunCommand; import io.github.thebusybiscuit.slimefun4.core.commands.SubCommand; import io.github.thebusybiscuit.slimefun4.core.guide.SlimefunGuide; -import me.mrCookieSlime.Slimefun.SlimefunPlugin; +import io.github.thebusybiscuit.slimefun4.implementation.SlimefunPlugin; class SearchCommand extends SubCommand { @@ -36,15 +36,15 @@ class SearchCommand extends SubCommand { PlayerProfile.get((Player) sender, profile -> SlimefunGuide.openSearch(profile, query, true, true)); } else { - SlimefunPlugin.getLocal().sendMessage(sender, "messages.usage", true, msg -> msg.replace("%usage%", "/sf search ")); + SlimefunPlugin.getLocalization().sendMessage(sender, "messages.usage", true, msg -> msg.replace("%usage%", "/sf search ")); } } else { - SlimefunPlugin.getLocal().sendMessage(sender, "messages.no-permission", true); + SlimefunPlugin.getLocalization().sendMessage(sender, "messages.no-permission", true); } } else { - SlimefunPlugin.getLocal().sendMessage(sender, "messages.only-players", true); + SlimefunPlugin.getLocalization().sendMessage(sender, "messages.only-players", true); } } diff --git a/src/main/java/io/github/thebusybiscuit/slimefun4/core/commands/subcommands/StatsCommand.java b/src/main/java/io/github/thebusybiscuit/slimefun4/core/commands/subcommands/StatsCommand.java index 8e4a99396..29e3b861a 100644 --- a/src/main/java/io/github/thebusybiscuit/slimefun4/core/commands/subcommands/StatsCommand.java +++ b/src/main/java/io/github/thebusybiscuit/slimefun4/core/commands/subcommands/StatsCommand.java @@ -10,7 +10,7 @@ import io.github.thebusybiscuit.cscorelib2.players.PlayerList; import io.github.thebusybiscuit.slimefun4.api.player.PlayerProfile; import io.github.thebusybiscuit.slimefun4.core.commands.SlimefunCommand; import io.github.thebusybiscuit.slimefun4.core.commands.SubCommand; -import me.mrCookieSlime.Slimefun.SlimefunPlugin; +import io.github.thebusybiscuit.slimefun4.implementation.SlimefunPlugin; class StatsCommand extends SubCommand { @@ -38,16 +38,16 @@ class StatsCommand extends SubCommand { PlayerProfile.get(player.get(), profile -> profile.sendStats(sender)); } else { - SlimefunPlugin.getLocal().sendMessage(sender, "messages.not-online", true, msg -> msg.replace("%player%", args[1])); + SlimefunPlugin.getLocalization().sendMessage(sender, "messages.not-online", true, msg -> msg.replace("%player%", args[1])); } } - else SlimefunPlugin.getLocal().sendMessage(sender, "messages.no-permission", true); + else SlimefunPlugin.getLocalization().sendMessage(sender, "messages.no-permission", true); } else if (sender instanceof Player) { PlayerProfile.get((Player) sender, profile -> profile.sendStats(sender)); } else { - SlimefunPlugin.getLocal().sendMessage(sender, "messages.only-players", true); + SlimefunPlugin.getLocalization().sendMessage(sender, "messages.only-players", true); } } diff --git a/src/main/java/io/github/thebusybiscuit/slimefun4/core/commands/subcommands/TeleporterCommand.java b/src/main/java/io/github/thebusybiscuit/slimefun4/core/commands/subcommands/TeleporterCommand.java index 732709ede..75437e35e 100644 --- a/src/main/java/io/github/thebusybiscuit/slimefun4/core/commands/subcommands/TeleporterCommand.java +++ b/src/main/java/io/github/thebusybiscuit/slimefun4/core/commands/subcommands/TeleporterCommand.java @@ -8,7 +8,7 @@ import org.bukkit.entity.Player; import io.github.thebusybiscuit.slimefun4.core.commands.SlimefunCommand; import io.github.thebusybiscuit.slimefun4.core.commands.SubCommand; -import me.mrCookieSlime.Slimefun.SlimefunPlugin; +import io.github.thebusybiscuit.slimefun4.implementation.SlimefunPlugin; class TeleporterCommand extends SubCommand { @@ -43,19 +43,19 @@ class TeleporterCommand extends SubCommand { SlimefunPlugin.getGPSNetwork().getTeleportationManager().openTeleporterGUI((Player) sender, player.getUniqueId(), ((Player) sender).getLocation().getBlock().getRelative(BlockFace.DOWN), 999999999); } else { - SlimefunPlugin.getLocal().sendMessage(sender, "messages.unknown-player", msg -> msg.replace("%player%", args[1])); + SlimefunPlugin.getLocalization().sendMessage(sender, "messages.unknown-player", msg -> msg.replace("%player%", args[1])); } } else { - SlimefunPlugin.getLocal().sendMessage(sender, "messages.usage", msg -> msg.replace("%usage%", "/sf teleporter [Player]")); + SlimefunPlugin.getLocalization().sendMessage(sender, "messages.usage", msg -> msg.replace("%usage%", "/sf teleporter [Player]")); } } else { - SlimefunPlugin.getLocal().sendMessage(sender, "messages.no-permission"); + SlimefunPlugin.getLocalization().sendMessage(sender, "messages.no-permission"); } } else { - SlimefunPlugin.getLocal().sendMessage(sender, "messages.only-players"); + SlimefunPlugin.getLocalization().sendMessage(sender, "messages.only-players"); } } diff --git a/src/main/java/io/github/thebusybiscuit/slimefun4/core/commands/subcommands/TimingsCommand.java b/src/main/java/io/github/thebusybiscuit/slimefun4/core/commands/subcommands/TimingsCommand.java index ecde73b5c..33528c197 100644 --- a/src/main/java/io/github/thebusybiscuit/slimefun4/core/commands/subcommands/TimingsCommand.java +++ b/src/main/java/io/github/thebusybiscuit/slimefun4/core/commands/subcommands/TimingsCommand.java @@ -5,7 +5,7 @@ import org.bukkit.command.ConsoleCommandSender; import io.github.thebusybiscuit.slimefun4.core.commands.SlimefunCommand; import io.github.thebusybiscuit.slimefun4.core.commands.SubCommand; -import me.mrCookieSlime.Slimefun.SlimefunPlugin; +import io.github.thebusybiscuit.slimefun4.implementation.SlimefunPlugin; class TimingsCommand extends SubCommand { @@ -26,10 +26,10 @@ class TimingsCommand extends SubCommand { @Override public void onExecute(CommandSender sender, String[] args) { if (sender.hasPermission("slimefun.command.timings") || sender instanceof ConsoleCommandSender) { - SlimefunPlugin.getTicker().info(sender); + SlimefunPlugin.getTickerTask().info(sender); } else { - SlimefunPlugin.getLocal().sendMessage(sender, "messages.no-permission", true); + SlimefunPlugin.getLocalization().sendMessage(sender, "messages.no-permission", true); } } diff --git a/src/main/java/io/github/thebusybiscuit/slimefun4/core/commands/subcommands/VersionsCommand.java b/src/main/java/io/github/thebusybiscuit/slimefun4/core/commands/subcommands/VersionsCommand.java index 7807fea70..386d7ccbc 100644 --- a/src/main/java/io/github/thebusybiscuit/slimefun4/core/commands/subcommands/VersionsCommand.java +++ b/src/main/java/io/github/thebusybiscuit/slimefun4/core/commands/subcommands/VersionsCommand.java @@ -12,7 +12,7 @@ import io.github.thebusybiscuit.cscorelib2.chat.ChatColors; import io.github.thebusybiscuit.cscorelib2.reflection.ReflectionUtils; import io.github.thebusybiscuit.slimefun4.core.commands.SlimefunCommand; import io.github.thebusybiscuit.slimefun4.core.commands.SubCommand; -import me.mrCookieSlime.Slimefun.SlimefunPlugin; +import io.github.thebusybiscuit.slimefun4.implementation.SlimefunPlugin; class VersionsCommand extends SubCommand { @@ -57,7 +57,7 @@ class VersionsCommand extends SubCommand { } } else { - SlimefunPlugin.getLocal().sendMessage(sender, "messages.no-permission", true); + SlimefunPlugin.getLocalization().sendMessage(sender, "messages.no-permission", true); } } diff --git a/src/main/java/io/github/thebusybiscuit/slimefun4/core/guide/SlimefunGuide.java b/src/main/java/io/github/thebusybiscuit/slimefun4/core/guide/SlimefunGuide.java index 36e6bd4f4..14ff02237 100644 --- a/src/main/java/io/github/thebusybiscuit/slimefun4/core/guide/SlimefunGuide.java +++ b/src/main/java/io/github/thebusybiscuit/slimefun4/core/guide/SlimefunGuide.java @@ -12,10 +12,10 @@ import org.bukkit.inventory.meta.ItemMeta; import io.github.thebusybiscuit.cscorelib2.chat.ChatColors; import io.github.thebusybiscuit.slimefun4.api.player.PlayerProfile; +import io.github.thebusybiscuit.slimefun4.implementation.SlimefunPlugin; import io.github.thebusybiscuit.slimefun4.implementation.guide.BookSlimefunGuide; import io.github.thebusybiscuit.slimefun4.implementation.guide.ChestSlimefunGuide; import io.github.thebusybiscuit.slimefun4.utils.SlimefunUtils; -import me.mrCookieSlime.Slimefun.SlimefunPlugin; import me.mrCookieSlime.Slimefun.Objects.Category; import me.mrCookieSlime.Slimefun.Objects.SlimefunItem.SlimefunItem; import me.mrCookieSlime.Slimefun.api.Slimefun; @@ -102,7 +102,7 @@ public final class SlimefunGuide { private static void openMainMenuAsync(Player player, SlimefunGuideLayout layout, int selectedPage) { if (!PlayerProfile.get(player, profile -> Slimefun.runSync(() -> openMainMenu(profile, layout, selectedPage)))) { - SlimefunPlugin.getLocal().sendMessage(player, "messages.opening-guide"); + SlimefunPlugin.getLocalization().sendMessage(player, "messages.opening-guide"); } } diff --git a/src/main/java/io/github/thebusybiscuit/slimefun4/core/guide/SlimefunGuideImplementation.java b/src/main/java/io/github/thebusybiscuit/slimefun4/core/guide/SlimefunGuideImplementation.java index d60f660b7..7ef81acfc 100644 --- a/src/main/java/io/github/thebusybiscuit/slimefun4/core/guide/SlimefunGuideImplementation.java +++ b/src/main/java/io/github/thebusybiscuit/slimefun4/core/guide/SlimefunGuideImplementation.java @@ -8,9 +8,9 @@ import org.bukkit.inventory.ItemStack; import io.github.thebusybiscuit.slimefun4.api.player.PlayerProfile; import io.github.thebusybiscuit.slimefun4.core.researching.Research; +import io.github.thebusybiscuit.slimefun4.implementation.SlimefunPlugin; import io.github.thebusybiscuit.slimefun4.implementation.guide.BookSlimefunGuide; import io.github.thebusybiscuit.slimefun4.implementation.guide.ChestSlimefunGuide; -import me.mrCookieSlime.Slimefun.SlimefunPlugin; import me.mrCookieSlime.Slimefun.Objects.Category; import me.mrCookieSlime.Slimefun.Objects.SlimefunItem.SlimefunItem; diff --git a/src/main/java/io/github/thebusybiscuit/slimefun4/core/guide/options/ContributorsMenu.java b/src/main/java/io/github/thebusybiscuit/slimefun4/core/guide/options/ContributorsMenu.java index 734ddcfd6..2dd9ce001 100644 --- a/src/main/java/io/github/thebusybiscuit/slimefun4/core/guide/options/ContributorsMenu.java +++ b/src/main/java/io/github/thebusybiscuit/slimefun4/core/guide/options/ContributorsMenu.java @@ -14,26 +14,26 @@ import org.bukkit.inventory.meta.SkullMeta; import io.github.thebusybiscuit.cscorelib2.chat.ChatColors; import io.github.thebusybiscuit.cscorelib2.item.CustomItem; import io.github.thebusybiscuit.slimefun4.core.services.github.Contributor; +import io.github.thebusybiscuit.slimefun4.implementation.SlimefunPlugin; import io.github.thebusybiscuit.slimefun4.utils.ChatUtils; import io.github.thebusybiscuit.slimefun4.utils.ChestMenuUtils; import io.github.thebusybiscuit.slimefun4.utils.PatternUtils; import io.github.thebusybiscuit.slimefun4.utils.SlimefunUtils; import me.mrCookieSlime.CSCoreLibPlugin.general.Inventory.ChestMenu; -import me.mrCookieSlime.Slimefun.SlimefunPlugin; final class ContributorsMenu { private ContributorsMenu() {} public static void open(Player p, int page) { - ChestMenu menu = new ChestMenu(SlimefunPlugin.getLocal().getMessage(p, "guide.title.credits")); + ChestMenu menu = new ChestMenu(SlimefunPlugin.getLocalization().getMessage(p, "guide.title.credits")); menu.setEmptySlotsClickable(false); menu.addMenuOpeningHandler(pl -> pl.playSound(pl.getLocation(), Sound.BLOCK_NOTE_BLOCK_HARP, 0.7F, 0.7F)); ChestMenuUtils.drawBackground(menu, 0, 2, 3, 4, 5, 6, 7, 8, 45, 47, 48, 49, 50, 51, 52); - menu.addItem(1, new CustomItem(ChestMenuUtils.getBackButton(p, "", "&7" + SlimefunPlugin.getLocal().getMessage(p, "guide.back.settings")))); + menu.addItem(1, new CustomItem(ChestMenuUtils.getBackButton(p, "", "&7" + SlimefunPlugin.getLocalization().getMessage(p, "guide.back.settings")))); menu.addMenuClickHandler(1, (pl, slot, item, action) -> { SlimefunGuideSettings.openSettings(pl, p.getInventory().getItemInMainHand()); return false; @@ -87,15 +87,15 @@ final class ContributorsMenu { if (!info.startsWith("&")) { String[] segments = PatternUtils.COMMA.split(info); - info = SlimefunPlugin.getLocal().getMessage(p, "guide.credits.roles." + segments[0]); + info = SlimefunPlugin.getLocalization().getMessage(p, "guide.credits.roles." + segments[0]); if (segments.length == 2) { - info += " &7(" + SlimefunPlugin.getLocal().getMessage(p, "languages." + segments[1]) + ')'; + info += " &7(" + SlimefunPlugin.getLocalization().getMessage(p, "languages." + segments[1]) + ')'; } } if (entry.getValue() > 0) { - String commits = SlimefunPlugin.getLocal().getMessage(p, "guide.credits." + (entry.getValue() > 1 ? "commits" : "commit")); + String commits = SlimefunPlugin.getLocalization().getMessage(p, "guide.credits." + (entry.getValue() > 1 ? "commits" : "commit")); info += " &7(" + entry.getValue() + ' ' + commits + ')'; } @@ -105,7 +105,7 @@ final class ContributorsMenu { if (contributor.getProfile() != null) { lore.add(""); - lore.add(ChatColors.color("&7\u21E8 &e") + SlimefunPlugin.getLocal().getMessage(p, "guide.credits.profile-link")); + lore.add(ChatColors.color("&7\u21E8 &e") + SlimefunPlugin.getLocalization().getMessage(p, "guide.credits.profile-link")); } meta.setLore(lore); diff --git a/src/main/java/io/github/thebusybiscuit/slimefun4/core/guide/options/FireworksOption.java b/src/main/java/io/github/thebusybiscuit/slimefun4/core/guide/options/FireworksOption.java index 4a27f5ea6..e6ac96373 100644 --- a/src/main/java/io/github/thebusybiscuit/slimefun4/core/guide/options/FireworksOption.java +++ b/src/main/java/io/github/thebusybiscuit/slimefun4/core/guide/options/FireworksOption.java @@ -10,7 +10,7 @@ import org.bukkit.inventory.ItemStack; import io.github.thebusybiscuit.cscorelib2.data.PersistentDataAPI; import io.github.thebusybiscuit.cscorelib2.item.CustomItem; import io.github.thebusybiscuit.slimefun4.api.SlimefunAddon; -import me.mrCookieSlime.Slimefun.SlimefunPlugin; +import io.github.thebusybiscuit.slimefun4.implementation.SlimefunPlugin; class FireworksOption implements SlimefunGuideOption { diff --git a/src/main/java/io/github/thebusybiscuit/slimefun4/core/guide/options/GuideLayoutOption.java b/src/main/java/io/github/thebusybiscuit/slimefun4/core/guide/options/GuideLayoutOption.java index 61b0c9a22..16173c9ba 100644 --- a/src/main/java/io/github/thebusybiscuit/slimefun4/core/guide/options/GuideLayoutOption.java +++ b/src/main/java/io/github/thebusybiscuit/slimefun4/core/guide/options/GuideLayoutOption.java @@ -14,9 +14,9 @@ import org.bukkit.inventory.meta.ItemMeta; import io.github.thebusybiscuit.slimefun4.api.SlimefunAddon; import io.github.thebusybiscuit.slimefun4.core.guide.SlimefunGuide; import io.github.thebusybiscuit.slimefun4.core.guide.SlimefunGuideLayout; +import io.github.thebusybiscuit.slimefun4.implementation.SlimefunPlugin; import io.github.thebusybiscuit.slimefun4.utils.ChatUtils; import io.github.thebusybiscuit.slimefun4.utils.SlimefunUtils; -import me.mrCookieSlime.Slimefun.SlimefunPlugin; class GuideLayoutOption implements SlimefunGuideOption { diff --git a/src/main/java/io/github/thebusybiscuit/slimefun4/core/guide/options/PlayerLanguageOption.java b/src/main/java/io/github/thebusybiscuit/slimefun4/core/guide/options/PlayerLanguageOption.java index 015040c0f..ffd660b1a 100644 --- a/src/main/java/io/github/thebusybiscuit/slimefun4/core/guide/options/PlayerLanguageOption.java +++ b/src/main/java/io/github/thebusybiscuit/slimefun4/core/guide/options/PlayerLanguageOption.java @@ -13,11 +13,11 @@ import io.github.thebusybiscuit.cscorelib2.item.CustomItem; import io.github.thebusybiscuit.slimefun4.api.SlimefunAddon; import io.github.thebusybiscuit.slimefun4.api.events.PlayerLanguageChangeEvent; import io.github.thebusybiscuit.slimefun4.core.services.localization.Language; +import io.github.thebusybiscuit.slimefun4.implementation.SlimefunPlugin; import io.github.thebusybiscuit.slimefun4.utils.ChatUtils; import io.github.thebusybiscuit.slimefun4.utils.ChestMenuUtils; import io.github.thebusybiscuit.slimefun4.utils.SlimefunUtils; import me.mrCookieSlime.CSCoreLibPlugin.general.Inventory.ChestMenu; -import me.mrCookieSlime.Slimefun.SlimefunPlugin; class PlayerLanguageOption implements SlimefunGuideOption { @@ -28,16 +28,16 @@ class PlayerLanguageOption implements SlimefunGuideOption { @Override public NamespacedKey getKey() { - return SlimefunPlugin.getLocal().getKey(); + return SlimefunPlugin.getLocalization().getKey(); } @Override public Optional getDisplayItem(Player p, ItemStack guide) { - if (SlimefunPlugin.getLocal().isEnabled()) { - Language language = SlimefunPlugin.getLocal().getLanguage(p); - String languageName = language.isDefault() ? (SlimefunPlugin.getLocal().getMessage(p, "languages.default") + ChatColor.DARK_GRAY + " (" + language.getName(p) + ")") : SlimefunPlugin.getLocal().getMessage(p, "languages." + language.getId()); + if (SlimefunPlugin.getLocalization().isEnabled()) { + Language language = SlimefunPlugin.getLocalization().getLanguage(p); + String languageName = language.isDefault() ? (SlimefunPlugin.getLocalization().getMessage(p, "languages.default") + ChatColor.DARK_GRAY + " (" + language.getName(p) + ")") : SlimefunPlugin.getLocalization().getMessage(p, "languages." + language.getId()); - return Optional.of(new CustomItem(language.getItem(), "&7" + SlimefunPlugin.getLocal().getMessage(p, "guide.languages.selected-language") + " &a" + languageName, "", "&7You now have the option to change", "&7the language in which Slimefun", "&7will send you messages.", "&7Note that this only translates", "&7some messages, not items.", "&7&oThis feature is still being worked on", "", "&7\u21E8 &eClick to change your language")); + return Optional.of(new CustomItem(language.getItem(), "&7" + SlimefunPlugin.getLocalization().getMessage(p, "guide.languages.selected-language") + " &a" + languageName, "", "&7You now have the option to change", "&7the language in which Slimefun", "&7will send you messages.", "&7Note that this only translates", "&7some messages, not items.", "&7&oThis feature is still being worked on", "", "&7\u21E8 &eClick to change your language")); } else { return Optional.empty(); @@ -51,7 +51,7 @@ class PlayerLanguageOption implements SlimefunGuideOption { @Override public Optional getSelectedOption(Player p, ItemStack guide) { - return Optional.of(SlimefunPlugin.getLocal().getLanguage(p).getId()); + return Optional.of(SlimefunPlugin.getLocalization().getLanguage(p).getId()); } @Override @@ -65,20 +65,20 @@ class PlayerLanguageOption implements SlimefunGuideOption { } private void openLanguageSelection(Player p, ItemStack guide) { - ChestMenu menu = new ChestMenu(SlimefunPlugin.getLocal().getMessage(p, "guide.title.languages")); + ChestMenu menu = new ChestMenu(SlimefunPlugin.getLocalization().getMessage(p, "guide.title.languages")); menu.setEmptySlotsClickable(false); menu.addMenuOpeningHandler(pl -> pl.playSound(pl.getLocation(), Sound.BLOCK_NOTE_BLOCK_HARP, 0.7F, 0.7F)); for (int i = 0; i < 9; i++) { if (i == 1) { - menu.addItem(1, ChestMenuUtils.getBackButton(p, "", "&7" + SlimefunPlugin.getLocal().getMessage(p, "guide.back.settings")), (pl, slot, item, action) -> { + menu.addItem(1, ChestMenuUtils.getBackButton(p, "", "&7" + SlimefunPlugin.getLocalization().getMessage(p, "guide.back.settings")), (pl, slot, item, action) -> { SlimefunGuideSettings.openSettings(pl, guide); return false; }); } else if (i == 7) { - menu.addItem(7, new CustomItem(SlimefunUtils.getCustomHead("3edd20be93520949e6ce789dc4f43efaeb28c717ee6bfcbbe02780142f716"), SlimefunPlugin.getLocal().getMessage(p, "guide.languages.translations.name"), "", "&7\u21E8 &e" + SlimefunPlugin.getLocal().getMessage(p, "guide.languages.translations.lore")), (pl, slot, item, action) -> { + menu.addItem(7, new CustomItem(SlimefunUtils.getCustomHead("3edd20be93520949e6ce789dc4f43efaeb28c717ee6bfcbbe02780142f716"), SlimefunPlugin.getLocalization().getMessage(p, "guide.languages.translations.name"), "", "&7\u21E8 &e" + SlimefunPlugin.getLocalization().getMessage(p, "guide.languages.translations.lore")), (pl, slot, item, action) -> { ChatUtils.sendURL(pl, "https://github.com/TheBusyBiscuit/Slimefun4/wiki/Translating-Slimefun"); pl.closeInventory(); return false; @@ -89,14 +89,14 @@ class PlayerLanguageOption implements SlimefunGuideOption { } } - Language defaultLanguage = SlimefunPlugin.getLocal().getDefaultLanguage(); - String defaultLanguageString = SlimefunPlugin.getLocal().getMessage(p, "languages.default"); + Language defaultLanguage = SlimefunPlugin.getLocalization().getDefaultLanguage(); + String defaultLanguageString = SlimefunPlugin.getLocalization().getMessage(p, "languages.default"); - menu.addItem(9, new CustomItem(defaultLanguage.getItem(), ChatColor.GRAY + defaultLanguageString + ChatColor.DARK_GRAY + " (" + defaultLanguage.getName(p) + ")", "", "&7\u21E8 &e" + SlimefunPlugin.getLocal().getMessage(p, "guide.languages.select-default")), (pl, i, item, action) -> { - SlimefunPlugin.instance.getServer().getPluginManager().callEvent(new PlayerLanguageChangeEvent(pl, SlimefunPlugin.getLocal().getLanguage(pl), defaultLanguage)); + menu.addItem(9, new CustomItem(defaultLanguage.getItem(), ChatColor.GRAY + defaultLanguageString + ChatColor.DARK_GRAY + " (" + defaultLanguage.getName(p) + ")", "", "&7\u21E8 &e" + SlimefunPlugin.getLocalization().getMessage(p, "guide.languages.select-default")), (pl, i, item, action) -> { + SlimefunPlugin.instance.getServer().getPluginManager().callEvent(new PlayerLanguageChangeEvent(pl, SlimefunPlugin.getLocalization().getLanguage(pl), defaultLanguage)); setSelectedOption(pl, guide, null); - SlimefunPlugin.getLocal().sendMessage(pl, "guide.languages.updated", msg -> msg.replace("%lang%", defaultLanguageString)); + SlimefunPlugin.getLocalization().sendMessage(pl, "guide.languages.updated", msg -> msg.replace("%lang%", defaultLanguageString)); SlimefunGuideSettings.openSettings(pl, guide); return false; @@ -104,13 +104,13 @@ class PlayerLanguageOption implements SlimefunGuideOption { int slot = 10; - for (Language language : SlimefunPlugin.getLocal().getLanguages()) { - menu.addItem(slot, new CustomItem(language.getItem(), ChatColor.GREEN + language.getName(p), "&b" + SlimefunPlugin.getLocal().getProgress(language) + '%', "", "&7\u21E8 &e" + SlimefunPlugin.getLocal().getMessage(p, "guide.languages.select")), (pl, i, item, action) -> { - SlimefunPlugin.instance.getServer().getPluginManager().callEvent(new PlayerLanguageChangeEvent(pl, SlimefunPlugin.getLocal().getLanguage(pl), language)); + for (Language language : SlimefunPlugin.getLocalization().getLanguages()) { + menu.addItem(slot, new CustomItem(language.getItem(), ChatColor.GREEN + language.getName(p), "&b" + SlimefunPlugin.getLocalization().getProgress(language) + '%', "", "&7\u21E8 &e" + SlimefunPlugin.getLocalization().getMessage(p, "guide.languages.select")), (pl, i, item, action) -> { + SlimefunPlugin.instance.getServer().getPluginManager().callEvent(new PlayerLanguageChangeEvent(pl, SlimefunPlugin.getLocalization().getLanguage(pl), language)); setSelectedOption(pl, guide, language.getId()); String name = language.getName(pl); - SlimefunPlugin.getLocal().sendMessage(pl, "guide.languages.updated", msg -> msg.replace("%lang%", name)); + SlimefunPlugin.getLocalization().sendMessage(pl, "guide.languages.updated", msg -> msg.replace("%lang%", name)); SlimefunGuideSettings.openSettings(pl, guide); return false; diff --git a/src/main/java/io/github/thebusybiscuit/slimefun4/core/guide/options/SlimefunGuideSettings.java b/src/main/java/io/github/thebusybiscuit/slimefun4/core/guide/options/SlimefunGuideSettings.java index c19c0a7a5..b65c52b8d 100644 --- a/src/main/java/io/github/thebusybiscuit/slimefun4/core/guide/options/SlimefunGuideSettings.java +++ b/src/main/java/io/github/thebusybiscuit/slimefun4/core/guide/options/SlimefunGuideSettings.java @@ -15,12 +15,12 @@ import io.github.thebusybiscuit.slimefun4.api.MinecraftVersion; import io.github.thebusybiscuit.slimefun4.core.guide.SlimefunGuide; import io.github.thebusybiscuit.slimefun4.core.guide.SlimefunGuideLayout; import io.github.thebusybiscuit.slimefun4.core.services.localization.Language; +import io.github.thebusybiscuit.slimefun4.implementation.SlimefunPlugin; import io.github.thebusybiscuit.slimefun4.utils.ChatUtils; import io.github.thebusybiscuit.slimefun4.utils.ChestMenuUtils; import io.github.thebusybiscuit.slimefun4.utils.NumberUtils; import io.github.thebusybiscuit.slimefun4.utils.SlimefunUtils; import me.mrCookieSlime.CSCoreLibPlugin.general.Inventory.ChestMenu; -import me.mrCookieSlime.Slimefun.SlimefunPlugin; /** * This static utility class offers various methods that provide access to the @@ -54,7 +54,7 @@ public final class SlimefunGuideSettings { } public static void openSettings(Player p, ItemStack guide) { - ChestMenu menu = new ChestMenu(SlimefunPlugin.getLocal().getMessage(p, "guide.title.settings")); + ChestMenu menu = new ChestMenu(SlimefunPlugin.getLocalization().getMessage(p, "guide.title.settings")); menu.setEmptySlotsClickable(false); menu.addMenuOpeningHandler(pl -> pl.playSound(pl.getLocation(), Sound.BLOCK_NOTE_BLOCK_HARP, 0.7F, 0.7F)); @@ -68,39 +68,39 @@ public final class SlimefunGuideSettings { } private static void addHeader(Player p, ChestMenu menu, ItemStack guide) { - menu.addItem(0, new CustomItem(SlimefunGuide.getItem(SlimefunGuideLayout.CHEST), "&e\u21E6 " + SlimefunPlugin.getLocal().getMessage(p, "guide.back.title"), "", "&7" + SlimefunPlugin.getLocal().getMessage(p, "guide.back.guide")), (pl, slot, item, action) -> { + menu.addItem(0, new CustomItem(SlimefunGuide.getItem(SlimefunGuideLayout.CHEST), "&e\u21E6 " + SlimefunPlugin.getLocalization().getMessage(p, "guide.back.title"), "", "&7" + SlimefunPlugin.getLocalization().getMessage(p, "guide.back.guide")), (pl, slot, item, action) -> { SlimefunGuide.openGuide(pl, guide); return false; }); - menu.addItem(2, new CustomItem(SlimefunUtils.getCustomHead("e952d2b3f351a6b0487cc59db31bf5f2641133e5ba0006b18576e996a0293e52"), "&c" + SlimefunPlugin.getLocal().getMessage(p, "guide.title.credits"), "", "&7Contributors: &e" + SlimefunPlugin.getGitHubService().getContributors().size(), "", "&7Slimefun is an open-source project", "&7and maintained by a large community of people.", "&7Here you can see who helped shape the project.", "", "&7\u21E8 &eClick to see our contributors"), (pl, slot, action, item) -> { + menu.addItem(2, new CustomItem(SlimefunUtils.getCustomHead("e952d2b3f351a6b0487cc59db31bf5f2641133e5ba0006b18576e996a0293e52"), "&c" + SlimefunPlugin.getLocalization().getMessage(p, "guide.title.credits"), "", "&7Contributors: &e" + SlimefunPlugin.getGitHubService().getContributors().size(), "", "&7Slimefun is an open-source project", "&7and maintained by a large community of people.", "&7Here you can see who helped shape the project.", "", "&7\u21E8 &eClick to see our contributors"), (pl, slot, action, item) -> { ContributorsMenu.open(pl, 0); return false; }); - menu.addItem(4, new CustomItem(Material.WRITABLE_BOOK, "&aSlimefun Version", "&7&o" + SlimefunPlugin.getLocal().getMessage(p, "guide.tooltips.versions-notice"), "", "&fMinecraft Version: &a" + Bukkit.getBukkitVersion(), "&fSlimefun Version: &a" + SlimefunPlugin.getVersion(), "&fCS-CoreLib Version: &a" + SlimefunPlugin.getCSCoreLibVersion()), ChestMenuUtils.getEmptyClickHandler()); + menu.addItem(4, new CustomItem(Material.WRITABLE_BOOK, "&aSlimefun Version", "&7&o" + SlimefunPlugin.getLocalization().getMessage(p, "guide.tooltips.versions-notice"), "", "&fMinecraft Version: &a" + Bukkit.getBukkitVersion(), "&fSlimefun Version: &a" + SlimefunPlugin.getVersion(), "&fCS-CoreLib Version: &a" + SlimefunPlugin.getCSCoreLibVersion()), ChestMenuUtils.getEmptyClickHandler()); - menu.addItem(6, new CustomItem(Material.COMPARATOR, "&e" + SlimefunPlugin.getLocal().getMessage(p, "guide.title.source"), "", "&7Last Activity: &a" + NumberUtils.getElapsedTime(SlimefunPlugin.getGitHubService().getLastUpdate()) + " ago", "&7Forks: &e" + SlimefunPlugin.getGitHubService().getForks(), "&7Stars: &e" + SlimefunPlugin.getGitHubService().getStars(), "", "&7&oSlimefun 4 is a community project,", "&7&othe source code is available on GitHub", "&7&oand if you want to keep this Plugin alive,", "&7&othen please consider contributing to it", "", "&7\u21E8 &eClick to go to GitHub")); + menu.addItem(6, new CustomItem(Material.COMPARATOR, "&e" + SlimefunPlugin.getLocalization().getMessage(p, "guide.title.source"), "", "&7Last Activity: &a" + NumberUtils.getElapsedTime(SlimefunPlugin.getGitHubService().getLastUpdate()) + " ago", "&7Forks: &e" + SlimefunPlugin.getGitHubService().getForks(), "&7Stars: &e" + SlimefunPlugin.getGitHubService().getStars(), "", "&7&oSlimefun 4 is a community project,", "&7&othe source code is available on GitHub", "&7&oand if you want to keep this Plugin alive,", "&7&othen please consider contributing to it", "", "&7\u21E8 &eClick to go to GitHub")); menu.addMenuClickHandler(6, (pl, slot, item, action) -> { pl.closeInventory(); ChatUtils.sendURL(pl, "https://github.com/TheBusyBiscuit/Slimefun4"); return false; }); - menu.addItem(8, new CustomItem(Material.KNOWLEDGE_BOOK, "&3" + SlimefunPlugin.getLocal().getMessage(p, "guide.title.wiki"), "", "&7Do you need help with an Item or machine?", "&7You cannot figure out what to do?", "&7Check out our community-maintained Wiki", "&7and become one of our Editors!", "", "&7\u21E8 &eClick to go to the official Slimefun Wiki"), (pl, slot, item, action) -> { + menu.addItem(8, new CustomItem(Material.KNOWLEDGE_BOOK, "&3" + SlimefunPlugin.getLocalization().getMessage(p, "guide.title.wiki"), "", "&7Do you need help with an Item or machine?", "&7You cannot figure out what to do?", "&7Check out our community-maintained Wiki", "&7and become one of our Editors!", "", "&7\u21E8 &eClick to go to the official Slimefun Wiki"), (pl, slot, item, action) -> { pl.closeInventory(); ChatUtils.sendURL(pl, "https://github.com/TheBusyBiscuit/Slimefun4/wiki"); return false; }); - menu.addItem(47, new CustomItem(Material.BOOKSHELF, "&3" + SlimefunPlugin.getLocal().getMessage(p, "guide.title.addons"), "", "&7Slimefun is huge. But its addons are what makes", "&7this plugin truly shine. Go check them out, some", "&7of them may be exactly what you were missing out on!", "", "&7Installed on this Server: &b" + SlimefunPlugin.getInstalledAddons().size(), "", "&7\u21E8 &eClick to see all available Addons for Slimefun4"), (pl, slot, item, action) -> { + menu.addItem(47, new CustomItem(Material.BOOKSHELF, "&3" + SlimefunPlugin.getLocalization().getMessage(p, "guide.title.addons"), "", "&7Slimefun is huge. But its addons are what makes", "&7this plugin truly shine. Go check them out, some", "&7of them may be exactly what you were missing out on!", "", "&7Installed on this Server: &b" + SlimefunPlugin.getInstalledAddons().size(), "", "&7\u21E8 &eClick to see all available Addons for Slimefun4"), (pl, slot, item, action) -> { pl.closeInventory(); ChatUtils.sendURL(pl, "https://github.com/TheBusyBiscuit/Slimefun4/wiki/Addons"); return false; }); if (SlimefunPlugin.getUpdater().getBranch().isOfficial()) { - menu.addItem(49, new CustomItem(Material.REDSTONE_TORCH, "&4" + SlimefunPlugin.getLocal().getMessage(p, "guide.title.bugs"), "", "&7&oBug reports have to be made in English!", "", "&7Open Issues: &a" + SlimefunPlugin.getGitHubService().getOpenissues(), "&7Pending Pull Requests: &a" + SlimefunPlugin.getGitHubService().getPendingPullRequests(), "", "&7\u21E8 &eClick to go to the Slimefun4 Bug Tracker"), (pl, slot, item, action) -> { + menu.addItem(49, new CustomItem(Material.REDSTONE_TORCH, "&4" + SlimefunPlugin.getLocalization().getMessage(p, "guide.title.bugs"), "", "&7&oBug reports have to be made in English!", "", "&7Open Issues: &a" + SlimefunPlugin.getGitHubService().getOpenissues(), "&7Pending Pull Requests: &a" + SlimefunPlugin.getGitHubService().getPendingPullRequests(), "", "&7\u21E8 &eClick to go to the Slimefun4 Bug Tracker"), (pl, slot, item, action) -> { pl.closeInventory(); ChatUtils.sendURL(pl, "https://github.com/TheBusyBiscuit/Slimefun4/issues"); return false; diff --git a/src/main/java/io/github/thebusybiscuit/slimefun4/core/multiblocks/MultiBlock.java b/src/main/java/io/github/thebusybiscuit/slimefun4/core/multiblocks/MultiBlock.java index c8c8a5589..62083c2e8 100644 --- a/src/main/java/io/github/thebusybiscuit/slimefun4/core/multiblocks/MultiBlock.java +++ b/src/main/java/io/github/thebusybiscuit/slimefun4/core/multiblocks/MultiBlock.java @@ -13,7 +13,7 @@ import org.bukkit.block.BlockFace; import io.github.thebusybiscuit.slimefun4.api.MinecraftVersion; import io.github.thebusybiscuit.slimefun4.api.events.MultiBlockInteractEvent; -import me.mrCookieSlime.Slimefun.SlimefunPlugin; +import io.github.thebusybiscuit.slimefun4.implementation.SlimefunPlugin; import me.mrCookieSlime.Slimefun.Objects.SlimefunItem.SlimefunItem; import me.mrCookieSlime.Slimefun.Objects.handlers.MultiBlockInteractionHandler; diff --git a/src/main/java/io/github/thebusybiscuit/slimefun4/core/multiblocks/MultiBlockMachine.java b/src/main/java/io/github/thebusybiscuit/slimefun4/core/multiblocks/MultiBlockMachine.java index 4282f4405..1b7af5b77 100644 --- a/src/main/java/io/github/thebusybiscuit/slimefun4/core/multiblocks/MultiBlockMachine.java +++ b/src/main/java/io/github/thebusybiscuit/slimefun4/core/multiblocks/MultiBlockMachine.java @@ -20,7 +20,7 @@ import io.github.thebusybiscuit.cscorelib2.protection.ProtectableAction; import io.github.thebusybiscuit.slimefun4.api.SlimefunAddon; import io.github.thebusybiscuit.slimefun4.core.attributes.NotPlaceable; import io.github.thebusybiscuit.slimefun4.core.attributes.RecipeDisplayItem; -import me.mrCookieSlime.Slimefun.SlimefunPlugin; +import io.github.thebusybiscuit.slimefun4.implementation.SlimefunPlugin; import me.mrCookieSlime.Slimefun.Lists.RecipeType; import me.mrCookieSlime.Slimefun.Objects.Category; import me.mrCookieSlime.Slimefun.Objects.SlimefunItem.SlimefunItem; diff --git a/src/main/java/io/github/thebusybiscuit/slimefun4/core/networks/cargo/CargoNet.java b/src/main/java/io/github/thebusybiscuit/slimefun4/core/networks/cargo/CargoNet.java index ee42a1f93..883635780 100644 --- a/src/main/java/io/github/thebusybiscuit/slimefun4/core/networks/cargo/CargoNet.java +++ b/src/main/java/io/github/thebusybiscuit/slimefun4/core/networks/cargo/CargoNet.java @@ -19,9 +19,9 @@ import org.bukkit.inventory.ItemStack; import io.github.thebusybiscuit.slimefun4.api.network.Network; import io.github.thebusybiscuit.slimefun4.api.network.NetworkComponent; +import io.github.thebusybiscuit.slimefun4.implementation.SlimefunPlugin; import io.github.thebusybiscuit.slimefun4.utils.holograms.SimpleHologram; import me.mrCookieSlime.CSCoreLibPlugin.Configuration.Config; -import me.mrCookieSlime.Slimefun.SlimefunPlugin; import me.mrCookieSlime.Slimefun.api.BlockStorage; import me.mrCookieSlime.Slimefun.api.Slimefun; import me.mrCookieSlime.Slimefun.api.inventory.DirtyChestMenu; diff --git a/src/main/java/io/github/thebusybiscuit/slimefun4/core/networks/cargo/CargoUtils.java b/src/main/java/io/github/thebusybiscuit/slimefun4/core/networks/cargo/CargoUtils.java index 3d2c79dd1..d45567123 100644 --- a/src/main/java/io/github/thebusybiscuit/slimefun4/core/networks/cargo/CargoUtils.java +++ b/src/main/java/io/github/thebusybiscuit/slimefun4/core/networks/cargo/CargoUtils.java @@ -16,10 +16,10 @@ import org.bukkit.inventory.ItemStack; import io.github.thebusybiscuit.cscorelib2.blocks.BlockPosition; import io.github.thebusybiscuit.slimefun4.api.MinecraftVersion; +import io.github.thebusybiscuit.slimefun4.implementation.SlimefunPlugin; import io.github.thebusybiscuit.slimefun4.utils.SlimefunUtils; import io.github.thebusybiscuit.slimefun4.utils.itemstack.ItemStackWrapper; import me.mrCookieSlime.CSCoreLibPlugin.Configuration.Config; -import me.mrCookieSlime.Slimefun.SlimefunPlugin; import me.mrCookieSlime.Slimefun.api.BlockStorage; import me.mrCookieSlime.Slimefun.api.Slimefun; import me.mrCookieSlime.Slimefun.api.inventory.BlockMenu; @@ -338,7 +338,7 @@ final class CargoUtils { return stack != null && Tag.LOGS.isTagged(stack.getType()); } else { - return SlimefunPlugin.getMinecraftRecipes().isSmeltable(stack); + return SlimefunPlugin.getMinecraftRecipeService().isSmeltable(stack); } } diff --git a/src/main/java/io/github/thebusybiscuit/slimefun4/core/networks/cargo/ChestTerminalNetwork.java b/src/main/java/io/github/thebusybiscuit/slimefun4/core/networks/cargo/ChestTerminalNetwork.java index f0abb52a5..3722ada69 100644 --- a/src/main/java/io/github/thebusybiscuit/slimefun4/core/networks/cargo/ChestTerminalNetwork.java +++ b/src/main/java/io/github/thebusybiscuit/slimefun4/core/networks/cargo/ChestTerminalNetwork.java @@ -26,10 +26,10 @@ import io.github.thebusybiscuit.cscorelib2.chat.ChatColors; import io.github.thebusybiscuit.cscorelib2.item.CustomItem; import io.github.thebusybiscuit.cscorelib2.math.DoubleHandler; import io.github.thebusybiscuit.slimefun4.api.network.Network; +import io.github.thebusybiscuit.slimefun4.implementation.SlimefunPlugin; import io.github.thebusybiscuit.slimefun4.utils.ChestMenuUtils; import io.github.thebusybiscuit.slimefun4.utils.SlimefunUtils; import me.mrCookieSlime.CSCoreLibPlugin.Configuration.Config; -import me.mrCookieSlime.Slimefun.SlimefunPlugin; import me.mrCookieSlime.Slimefun.api.BlockStorage; import me.mrCookieSlime.Slimefun.api.inventory.BlockMenu; import me.mrCookieSlime.Slimefun.api.inventory.DirtyChestMenu; diff --git a/src/main/java/io/github/thebusybiscuit/slimefun4/core/networks/energy/EnergyNet.java b/src/main/java/io/github/thebusybiscuit/slimefun4/core/networks/energy/EnergyNet.java index 7f0d4b8aa..9dc4f273f 100644 --- a/src/main/java/io/github/thebusybiscuit/slimefun4/core/networks/energy/EnergyNet.java +++ b/src/main/java/io/github/thebusybiscuit/slimefun4/core/networks/energy/EnergyNet.java @@ -13,10 +13,10 @@ import io.github.thebusybiscuit.slimefun4.api.ErrorReport; import io.github.thebusybiscuit.slimefun4.api.network.Network; import io.github.thebusybiscuit.slimefun4.api.network.NetworkComponent; import io.github.thebusybiscuit.slimefun4.core.attributes.EnergyNetComponent; +import io.github.thebusybiscuit.slimefun4.implementation.SlimefunPlugin; import io.github.thebusybiscuit.slimefun4.implementation.items.electric.reactors.Reactor; import io.github.thebusybiscuit.slimefun4.utils.holograms.SimpleHologram; import me.mrCookieSlime.CSCoreLibPlugin.Configuration.Config; -import me.mrCookieSlime.Slimefun.SlimefunPlugin; import me.mrCookieSlime.Slimefun.Objects.SlimefunItem.SlimefunItem; import me.mrCookieSlime.Slimefun.Objects.handlers.GeneratorTicker; import me.mrCookieSlime.Slimefun.api.BlockStorage; @@ -247,7 +247,7 @@ public class EnergyNet extends Network { new ErrorReport(t, source, item); } - SlimefunPlugin.getTicker().addBlockTimings(source, System.currentTimeMillis() - timestamp); + SlimefunPlugin.getTickerTask().addBlockTimings(source, System.currentTimeMillis() - timestamp); } else { // This block seems to be gone now, better remove it to be extra safe diff --git a/src/main/java/io/github/thebusybiscuit/slimefun4/core/researching/Research.java b/src/main/java/io/github/thebusybiscuit/slimefun4/core/researching/Research.java index 6b451f90e..c3ce60dfc 100644 --- a/src/main/java/io/github/thebusybiscuit/slimefun4/core/researching/Research.java +++ b/src/main/java/io/github/thebusybiscuit/slimefun4/core/researching/Research.java @@ -18,9 +18,9 @@ import io.github.thebusybiscuit.slimefun4.api.events.ResearchUnlockEvent; import io.github.thebusybiscuit.slimefun4.api.player.PlayerProfile; import io.github.thebusybiscuit.slimefun4.core.guide.options.SlimefunGuideSettings; import io.github.thebusybiscuit.slimefun4.core.services.localization.Language; +import io.github.thebusybiscuit.slimefun4.implementation.SlimefunPlugin; import io.github.thebusybiscuit.slimefun4.implementation.setup.ResearchSetup; import io.github.thebusybiscuit.slimefun4.utils.FireworkUtils; -import me.mrCookieSlime.Slimefun.SlimefunPlugin; import me.mrCookieSlime.Slimefun.Objects.SlimefunItem.SlimefunItem; import me.mrCookieSlime.Slimefun.api.Slimefun; @@ -110,7 +110,7 @@ public class Research implements Keyed { * @return The localized Name of this {@link Research}. */ public String getName(Player p) { - String localized = SlimefunPlugin.getLocal().getResearchName(p, key); + String localized = SlimefunPlugin.getLocalization().getResearchName(p, key); return localized != null ? localized : name; } @@ -222,7 +222,7 @@ public class Research implements Keyed { if (!instant) { Slimefun.runSync(() -> { p.playSound(p.getLocation(), Sound.ENTITY_BAT_TAKEOFF, 0.7F, 1F); - SlimefunPlugin.getLocal().sendMessage(p, "messages.research.progress", true, msg -> msg.replace(PLACEHOLDER_RESEARCH, getName(p)).replace("%progress%", "0%")); + SlimefunPlugin.getLocalization().sendMessage(p, "messages.research.progress", true, msg -> msg.replace(PLACEHOLDER_RESEARCH, getName(p)).replace("%progress%", "0%")); }, 10L); } PlayerProfile.get(p, profile -> { @@ -235,7 +235,7 @@ public class Research implements Keyed { finishResearch(p, profile, callback); } else if (SlimefunPlugin.getRegistry().getCurrentlyResearchingPlayers().add(p.getUniqueId())) { - SlimefunPlugin.getLocal().sendMessage(p, "messages.research.start", true, msg -> msg.replace(PLACEHOLDER_RESEARCH, getName(p))); + SlimefunPlugin.getLocalization().sendMessage(p, "messages.research.start", true, msg -> msg.replace(PLACEHOLDER_RESEARCH, getName(p))); playResearchAnimation(p); Slimefun.runSync(() -> { @@ -251,7 +251,7 @@ public class Research implements Keyed { private void finishResearch(Player p, PlayerProfile profile, Consumer callback) { profile.setResearched(this, true); - SlimefunPlugin.getLocal().sendMessage(p, "messages.unlocked", true, msg -> msg.replace(PLACEHOLDER_RESEARCH, getName(p))); + SlimefunPlugin.getLocalization().sendMessage(p, "messages.unlocked", true, msg -> msg.replace(PLACEHOLDER_RESEARCH, getName(p))); callback.accept(p); if (SlimefunPlugin.getRegistry().isResearchFireworkEnabled() && SlimefunGuideSettings.hasFireworksEnabled(p)) { @@ -265,7 +265,7 @@ public class Research implements Keyed { Slimefun.runSync(() -> { p.playSound(p.getLocation(), Sound.ENTITY_BAT_TAKEOFF, 0.7F, 1F); - SlimefunPlugin.getLocal().sendMessage(p, "messages.research.progress", true, msg -> msg.replace(PLACEHOLDER_RESEARCH, getName(p)).replace("%progress%", RESEARCH_PROGRESS[j - 1] + "%")); + SlimefunPlugin.getLocalization().sendMessage(p, "messages.research.progress", true, msg -> msg.replace(PLACEHOLDER_RESEARCH, getName(p)).replace("%progress%", RESEARCH_PROGRESS[j - 1] + "%")); }, i * 20L); } } diff --git a/src/main/java/io/github/thebusybiscuit/slimefun4/core/services/AutoSavingService.java b/src/main/java/io/github/thebusybiscuit/slimefun4/core/services/AutoSavingService.java index bca4fbe3e..adc353194 100644 --- a/src/main/java/io/github/thebusybiscuit/slimefun4/core/services/AutoSavingService.java +++ b/src/main/java/io/github/thebusybiscuit/slimefun4/core/services/AutoSavingService.java @@ -11,7 +11,7 @@ import org.bukkit.block.Block; import org.bukkit.entity.Player; import io.github.thebusybiscuit.slimefun4.api.player.PlayerProfile; -import me.mrCookieSlime.Slimefun.SlimefunPlugin; +import io.github.thebusybiscuit.slimefun4.implementation.SlimefunPlugin; import me.mrCookieSlime.Slimefun.api.BlockStorage; import me.mrCookieSlime.Slimefun.api.Slimefun; diff --git a/src/main/java/io/github/thebusybiscuit/slimefun4/core/services/BackupService.java b/src/main/java/io/github/thebusybiscuit/slimefun4/core/services/BackupService.java index 04200e50d..63630a648 100644 --- a/src/main/java/io/github/thebusybiscuit/slimefun4/core/services/BackupService.java +++ b/src/main/java/io/github/thebusybiscuit/slimefun4/core/services/BackupService.java @@ -15,7 +15,7 @@ import java.util.logging.Level; import java.util.zip.ZipEntry; import java.util.zip.ZipOutputStream; -import me.mrCookieSlime.Slimefun.SlimefunPlugin; +import io.github.thebusybiscuit.slimefun4.implementation.SlimefunPlugin; import me.mrCookieSlime.Slimefun.api.Slimefun; /** diff --git a/src/main/java/io/github/thebusybiscuit/slimefun4/core/services/BlockDataService.java b/src/main/java/io/github/thebusybiscuit/slimefun4/core/services/BlockDataService.java index 94dc9f244..5fcb9face 100644 --- a/src/main/java/io/github/thebusybiscuit/slimefun4/core/services/BlockDataService.java +++ b/src/main/java/io/github/thebusybiscuit/slimefun4/core/services/BlockDataService.java @@ -12,7 +12,7 @@ import org.bukkit.persistence.PersistentDataHolder; import org.bukkit.plugin.Plugin; import io.github.thebusybiscuit.slimefun4.api.MinecraftVersion; -import me.mrCookieSlime.Slimefun.SlimefunPlugin; +import io.github.thebusybiscuit.slimefun4.implementation.SlimefunPlugin; /** * The {@link BlockDataService} is similar to the {@link CustomItemDataService}, diff --git a/src/main/java/io/github/thebusybiscuit/slimefun4/core/services/CustomTextureService.java b/src/main/java/io/github/thebusybiscuit/slimefun4/core/services/CustomTextureService.java index 12338756a..9edd55169 100644 --- a/src/main/java/io/github/thebusybiscuit/slimefun4/core/services/CustomTextureService.java +++ b/src/main/java/io/github/thebusybiscuit/slimefun4/core/services/CustomTextureService.java @@ -8,7 +8,7 @@ import org.bukkit.inventory.meta.ItemMeta; import io.github.thebusybiscuit.cscorelib2.config.Config; import io.github.thebusybiscuit.slimefun4.api.MinecraftVersion; -import me.mrCookieSlime.Slimefun.SlimefunPlugin; +import io.github.thebusybiscuit.slimefun4.implementation.SlimefunPlugin; import me.mrCookieSlime.Slimefun.Objects.SlimefunItem.SlimefunItem; import me.mrCookieSlime.Slimefun.api.SlimefunItemStack; diff --git a/src/main/java/io/github/thebusybiscuit/slimefun4/core/services/LocalizationService.java b/src/main/java/io/github/thebusybiscuit/slimefun4/core/services/LocalizationService.java index 38ed49a49..42dfbbd6c 100644 --- a/src/main/java/io/github/thebusybiscuit/slimefun4/core/services/LocalizationService.java +++ b/src/main/java/io/github/thebusybiscuit/slimefun4/core/services/LocalizationService.java @@ -19,7 +19,7 @@ import org.bukkit.entity.Player; import io.github.thebusybiscuit.cscorelib2.math.DoubleHandler; import io.github.thebusybiscuit.slimefun4.core.services.localization.Language; import io.github.thebusybiscuit.slimefun4.core.services.localization.SlimefunLocalization; -import me.mrCookieSlime.Slimefun.SlimefunPlugin; +import io.github.thebusybiscuit.slimefun4.implementation.SlimefunPlugin; import me.mrCookieSlime.Slimefun.api.Slimefun; /** diff --git a/src/main/java/io/github/thebusybiscuit/slimefun4/core/services/PerWorldSettingsService.java b/src/main/java/io/github/thebusybiscuit/slimefun4/core/services/PerWorldSettingsService.java index dec933960..03a308515 100644 --- a/src/main/java/io/github/thebusybiscuit/slimefun4/core/services/PerWorldSettingsService.java +++ b/src/main/java/io/github/thebusybiscuit/slimefun4/core/services/PerWorldSettingsService.java @@ -21,7 +21,7 @@ import io.github.thebusybiscuit.cscorelib2.collections.OptionalMap; import io.github.thebusybiscuit.cscorelib2.config.Config; import io.github.thebusybiscuit.slimefun4.api.MinecraftVersion; import io.github.thebusybiscuit.slimefun4.api.SlimefunAddon; -import me.mrCookieSlime.Slimefun.SlimefunPlugin; +import io.github.thebusybiscuit.slimefun4.implementation.SlimefunPlugin; import me.mrCookieSlime.Slimefun.Objects.SlimefunItem.SlimefunItem; /** diff --git a/src/main/java/io/github/thebusybiscuit/slimefun4/core/services/PermissionsService.java b/src/main/java/io/github/thebusybiscuit/slimefun4/core/services/PermissionsService.java index 1684b0a12..7b6e81d1b 100644 --- a/src/main/java/io/github/thebusybiscuit/slimefun4/core/services/PermissionsService.java +++ b/src/main/java/io/github/thebusybiscuit/slimefun4/core/services/PermissionsService.java @@ -12,7 +12,7 @@ import org.bukkit.permissions.Permissible; import org.bukkit.permissions.Permission; import io.github.thebusybiscuit.cscorelib2.config.Config; -import me.mrCookieSlime.Slimefun.SlimefunPlugin; +import io.github.thebusybiscuit.slimefun4.implementation.SlimefunPlugin; import me.mrCookieSlime.Slimefun.Objects.SlimefunItem.SlimefunItem; /** diff --git a/src/main/java/io/github/thebusybiscuit/slimefun4/core/services/PersistentDataService.java b/src/main/java/io/github/thebusybiscuit/slimefun4/core/services/PersistentDataService.java index 67a1c7c8d..8a1035d74 100644 --- a/src/main/java/io/github/thebusybiscuit/slimefun4/core/services/PersistentDataService.java +++ b/src/main/java/io/github/thebusybiscuit/slimefun4/core/services/PersistentDataService.java @@ -8,7 +8,7 @@ import org.bukkit.persistence.PersistentDataHolder; import org.bukkit.persistence.PersistentDataType; import io.github.thebusybiscuit.slimefun4.api.MinecraftVersion; -import me.mrCookieSlime.Slimefun.SlimefunPlugin; +import io.github.thebusybiscuit.slimefun4.implementation.SlimefunPlugin; /** * This interface is used to defer calls to Persistent Data and make sure they are only called diff --git a/src/main/java/io/github/thebusybiscuit/slimefun4/core/services/UpdaterService.java b/src/main/java/io/github/thebusybiscuit/slimefun4/core/services/UpdaterService.java index 32313750d..b4b47634c 100644 --- a/src/main/java/io/github/thebusybiscuit/slimefun4/core/services/UpdaterService.java +++ b/src/main/java/io/github/thebusybiscuit/slimefun4/core/services/UpdaterService.java @@ -9,8 +9,8 @@ import io.github.thebusybiscuit.cscorelib2.config.Config; import io.github.thebusybiscuit.cscorelib2.updater.GitHubBuildsUpdater; import io.github.thebusybiscuit.cscorelib2.updater.Updater; import io.github.thebusybiscuit.slimefun4.api.SlimefunBranch; +import io.github.thebusybiscuit.slimefun4.implementation.SlimefunPlugin; import io.github.thebusybiscuit.slimefun4.utils.PatternUtils; -import me.mrCookieSlime.Slimefun.SlimefunPlugin; /** * This Class represents our {@link Updater} Service. diff --git a/src/main/java/io/github/thebusybiscuit/slimefun4/core/services/github/GitHubConnector.java b/src/main/java/io/github/thebusybiscuit/slimefun4/core/services/github/GitHubConnector.java index cb30fa294..68e76ec42 100644 --- a/src/main/java/io/github/thebusybiscuit/slimefun4/core/services/github/GitHubConnector.java +++ b/src/main/java/io/github/thebusybiscuit/slimefun4/core/services/github/GitHubConnector.java @@ -16,7 +16,7 @@ import java.util.logging.Level; import com.google.gson.JsonElement; import com.google.gson.JsonParser; -import me.mrCookieSlime.Slimefun.SlimefunPlugin; +import io.github.thebusybiscuit.slimefun4.implementation.SlimefunPlugin; import me.mrCookieSlime.Slimefun.api.Slimefun; abstract class GitHubConnector { diff --git a/src/main/java/io/github/thebusybiscuit/slimefun4/core/services/github/GitHubService.java b/src/main/java/io/github/thebusybiscuit/slimefun4/core/services/github/GitHubService.java index cccf312c1..f4ab531dd 100644 --- a/src/main/java/io/github/thebusybiscuit/slimefun4/core/services/github/GitHubService.java +++ b/src/main/java/io/github/thebusybiscuit/slimefun4/core/services/github/GitHubService.java @@ -14,8 +14,8 @@ import com.google.gson.JsonObject; import io.github.thebusybiscuit.cscorelib2.config.Config; import io.github.thebusybiscuit.slimefun4.core.services.localization.Translators; +import io.github.thebusybiscuit.slimefun4.implementation.SlimefunPlugin; import io.github.thebusybiscuit.slimefun4.utils.NumberUtils; -import me.mrCookieSlime.Slimefun.SlimefunPlugin; /** * This Service is responsible for grabbing every {@link Contributor} to this project diff --git a/src/main/java/io/github/thebusybiscuit/slimefun4/core/services/github/GitHubTask.java b/src/main/java/io/github/thebusybiscuit/slimefun4/core/services/github/GitHubTask.java index 338360409..e666f9fae 100644 --- a/src/main/java/io/github/thebusybiscuit/slimefun4/core/services/github/GitHubTask.java +++ b/src/main/java/io/github/thebusybiscuit/slimefun4/core/services/github/GitHubTask.java @@ -11,7 +11,7 @@ import org.bukkit.Bukkit; import io.github.thebusybiscuit.cscorelib2.players.MinecraftAccount; import io.github.thebusybiscuit.cscorelib2.players.MinecraftAccount.TooManyRequestsException; -import me.mrCookieSlime.Slimefun.SlimefunPlugin; +import io.github.thebusybiscuit.slimefun4.implementation.SlimefunPlugin; import me.mrCookieSlime.Slimefun.api.Slimefun; /** diff --git a/src/main/java/io/github/thebusybiscuit/slimefun4/core/services/localization/Language.java b/src/main/java/io/github/thebusybiscuit/slimefun4/core/services/localization/Language.java index 097937170..0a7ecaa8b 100644 --- a/src/main/java/io/github/thebusybiscuit/slimefun4/core/services/localization/Language.java +++ b/src/main/java/io/github/thebusybiscuit/slimefun4/core/services/localization/Language.java @@ -10,8 +10,8 @@ import org.bukkit.inventory.ItemStack; import io.github.thebusybiscuit.slimefun4.core.guide.SlimefunGuide; import io.github.thebusybiscuit.slimefun4.core.services.LocalizationService; +import io.github.thebusybiscuit.slimefun4.implementation.SlimefunPlugin; import io.github.thebusybiscuit.slimefun4.utils.SlimefunUtils; -import me.mrCookieSlime.Slimefun.SlimefunPlugin; /** * This Class represents a {@link Language} that Slimefun can recognize and use. @@ -129,7 +129,7 @@ public final class Language { * @return The localized name of this {@link Language} */ public String getName(Player p) { - String name = SlimefunPlugin.getLocal().getMessage(p, "languages." + id); + String name = SlimefunPlugin.getLocalization().getMessage(p, "languages." + id); return name != null ? name : toString(); } @@ -140,7 +140,7 @@ public final class Language { * @return Whether this is the default {@link Language} of this {@link Server} */ public boolean isDefault() { - return this == SlimefunPlugin.getLocal().getDefaultLanguage(); + return this == SlimefunPlugin.getLocalization().getDefaultLanguage(); } @Override diff --git a/src/main/java/io/github/thebusybiscuit/slimefun4/core/services/localization/SlimefunLocalization.java b/src/main/java/io/github/thebusybiscuit/slimefun4/core/services/localization/SlimefunLocalization.java index c7c9012cd..e287a2de0 100644 --- a/src/main/java/io/github/thebusybiscuit/slimefun4/core/services/localization/SlimefunLocalization.java +++ b/src/main/java/io/github/thebusybiscuit/slimefun4/core/services/localization/SlimefunLocalization.java @@ -21,7 +21,7 @@ import io.github.thebusybiscuit.cscorelib2.item.CustomItem; import io.github.thebusybiscuit.slimefun4.api.MinecraftVersion; import io.github.thebusybiscuit.slimefun4.api.SlimefunBranch; import io.github.thebusybiscuit.slimefun4.core.services.LocalizationService; -import me.mrCookieSlime.Slimefun.SlimefunPlugin; +import io.github.thebusybiscuit.slimefun4.implementation.SlimefunPlugin; import me.mrCookieSlime.Slimefun.Lists.RecipeType; /** diff --git a/src/main/java/io/github/thebusybiscuit/slimefun4/core/services/metrics/AddonsChart.java b/src/main/java/io/github/thebusybiscuit/slimefun4/core/services/metrics/AddonsChart.java index a1eecc6ed..2ed2a7d59 100644 --- a/src/main/java/io/github/thebusybiscuit/slimefun4/core/services/metrics/AddonsChart.java +++ b/src/main/java/io/github/thebusybiscuit/slimefun4/core/services/metrics/AddonsChart.java @@ -6,7 +6,7 @@ import java.util.Map; import org.bstats.bukkit.Metrics.AdvancedPie; import org.bukkit.plugin.Plugin; -import me.mrCookieSlime.Slimefun.SlimefunPlugin; +import io.github.thebusybiscuit.slimefun4.implementation.SlimefunPlugin; class AddonsChart extends AdvancedPie { diff --git a/src/main/java/io/github/thebusybiscuit/slimefun4/core/services/metrics/AutoUpdaterChart.java b/src/main/java/io/github/thebusybiscuit/slimefun4/core/services/metrics/AutoUpdaterChart.java index c05eb9781..eba426338 100644 --- a/src/main/java/io/github/thebusybiscuit/slimefun4/core/services/metrics/AutoUpdaterChart.java +++ b/src/main/java/io/github/thebusybiscuit/slimefun4/core/services/metrics/AutoUpdaterChart.java @@ -2,7 +2,7 @@ package io.github.thebusybiscuit.slimefun4.core.services.metrics; import org.bstats.bukkit.Metrics.SimplePie; -import me.mrCookieSlime.Slimefun.SlimefunPlugin; +import io.github.thebusybiscuit.slimefun4.implementation.SlimefunPlugin; class AutoUpdaterChart extends SimplePie { diff --git a/src/main/java/io/github/thebusybiscuit/slimefun4/core/services/metrics/CommandChart.java b/src/main/java/io/github/thebusybiscuit/slimefun4/core/services/metrics/CommandChart.java index 7b1e07d2e..d9fc909c1 100644 --- a/src/main/java/io/github/thebusybiscuit/slimefun4/core/services/metrics/CommandChart.java +++ b/src/main/java/io/github/thebusybiscuit/slimefun4/core/services/metrics/CommandChart.java @@ -6,7 +6,7 @@ import java.util.Map; import org.bstats.bukkit.Metrics.AdvancedPie; import io.github.thebusybiscuit.slimefun4.core.commands.SubCommand; -import me.mrCookieSlime.Slimefun.SlimefunPlugin; +import io.github.thebusybiscuit.slimefun4.implementation.SlimefunPlugin; class CommandChart extends AdvancedPie { diff --git a/src/main/java/io/github/thebusybiscuit/slimefun4/core/services/metrics/CompatibilityModeChart.java b/src/main/java/io/github/thebusybiscuit/slimefun4/core/services/metrics/CompatibilityModeChart.java index 9d45c6e9b..045c2657e 100644 --- a/src/main/java/io/github/thebusybiscuit/slimefun4/core/services/metrics/CompatibilityModeChart.java +++ b/src/main/java/io/github/thebusybiscuit/slimefun4/core/services/metrics/CompatibilityModeChart.java @@ -2,7 +2,7 @@ package io.github.thebusybiscuit.slimefun4.core.services.metrics; import org.bstats.bukkit.Metrics.SimplePie; -import me.mrCookieSlime.Slimefun.SlimefunPlugin; +import io.github.thebusybiscuit.slimefun4.implementation.SlimefunPlugin; class CompatibilityModeChart extends SimplePie { diff --git a/src/main/java/io/github/thebusybiscuit/slimefun4/core/services/metrics/GuideLayoutChart.java b/src/main/java/io/github/thebusybiscuit/slimefun4/core/services/metrics/GuideLayoutChart.java index 68f7a9487..75fc72b42 100644 --- a/src/main/java/io/github/thebusybiscuit/slimefun4/core/services/metrics/GuideLayoutChart.java +++ b/src/main/java/io/github/thebusybiscuit/slimefun4/core/services/metrics/GuideLayoutChart.java @@ -2,7 +2,7 @@ package io.github.thebusybiscuit.slimefun4.core.services.metrics; import org.bstats.bukkit.Metrics.SimplePie; -import me.mrCookieSlime.Slimefun.SlimefunPlugin; +import io.github.thebusybiscuit.slimefun4.implementation.SlimefunPlugin; class GuideLayoutChart extends SimplePie { diff --git a/src/main/java/io/github/thebusybiscuit/slimefun4/core/services/metrics/MetricsService.java b/src/main/java/io/github/thebusybiscuit/slimefun4/core/services/metrics/MetricsService.java index c338a6735..d6654f6a2 100644 --- a/src/main/java/io/github/thebusybiscuit/slimefun4/core/services/metrics/MetricsService.java +++ b/src/main/java/io/github/thebusybiscuit/slimefun4/core/services/metrics/MetricsService.java @@ -3,7 +3,7 @@ package io.github.thebusybiscuit.slimefun4.core.services.metrics; import org.bstats.bukkit.Metrics; import org.bukkit.plugin.Plugin; -import me.mrCookieSlime.Slimefun.SlimefunPlugin; +import io.github.thebusybiscuit.slimefun4.implementation.SlimefunPlugin; /** * This Class represents a Metrics Service that sends data to https://bstats.org/ diff --git a/src/main/java/io/github/thebusybiscuit/slimefun4/core/services/metrics/PlayerLanguageChart.java b/src/main/java/io/github/thebusybiscuit/slimefun4/core/services/metrics/PlayerLanguageChart.java index c0d77b3e5..347bf0640 100644 --- a/src/main/java/io/github/thebusybiscuit/slimefun4/core/services/metrics/PlayerLanguageChart.java +++ b/src/main/java/io/github/thebusybiscuit/slimefun4/core/services/metrics/PlayerLanguageChart.java @@ -8,7 +8,7 @@ import org.bukkit.Bukkit; import org.bukkit.entity.Player; import io.github.thebusybiscuit.slimefun4.core.services.localization.Language; -import me.mrCookieSlime.Slimefun.SlimefunPlugin; +import io.github.thebusybiscuit.slimefun4.implementation.SlimefunPlugin; class PlayerLanguageChart extends AdvancedPie { @@ -17,8 +17,8 @@ class PlayerLanguageChart extends AdvancedPie { Map languages = new HashMap<>(); for (Player p : Bukkit.getOnlinePlayers()) { - Language language = SlimefunPlugin.getLocal().getLanguage(p); - boolean supported = SlimefunPlugin.getLocal().isLanguageLoaded(language.getId()); + Language language = SlimefunPlugin.getLocalization().getLanguage(p); + boolean supported = SlimefunPlugin.getLocalization().isLanguageLoaded(language.getId()); String lang = supported ? language.getId() : "Unsupported Language"; languages.merge(lang, 1, Integer::sum); diff --git a/src/main/java/io/github/thebusybiscuit/slimefun4/core/services/metrics/ResearchesEnabledChart.java b/src/main/java/io/github/thebusybiscuit/slimefun4/core/services/metrics/ResearchesEnabledChart.java index 2ba0d9813..87a66bf2f 100644 --- a/src/main/java/io/github/thebusybiscuit/slimefun4/core/services/metrics/ResearchesEnabledChart.java +++ b/src/main/java/io/github/thebusybiscuit/slimefun4/core/services/metrics/ResearchesEnabledChart.java @@ -2,7 +2,7 @@ package io.github.thebusybiscuit.slimefun4.core.services.metrics; import org.bstats.bukkit.Metrics.SimplePie; -import me.mrCookieSlime.Slimefun.SlimefunPlugin; +import io.github.thebusybiscuit.slimefun4.implementation.SlimefunPlugin; class ResearchesEnabledChart extends SimplePie { diff --git a/src/main/java/io/github/thebusybiscuit/slimefun4/core/services/metrics/ResourcePackChart.java b/src/main/java/io/github/thebusybiscuit/slimefun4/core/services/metrics/ResourcePackChart.java index 586d30aa1..0622c6e03 100644 --- a/src/main/java/io/github/thebusybiscuit/slimefun4/core/services/metrics/ResourcePackChart.java +++ b/src/main/java/io/github/thebusybiscuit/slimefun4/core/services/metrics/ResourcePackChart.java @@ -2,7 +2,7 @@ package io.github.thebusybiscuit.slimefun4.core.services.metrics; import org.bstats.bukkit.Metrics.SimplePie; -import me.mrCookieSlime.Slimefun.SlimefunPlugin; +import io.github.thebusybiscuit.slimefun4.implementation.SlimefunPlugin; class ResourcePackChart extends SimplePie { diff --git a/src/main/java/io/github/thebusybiscuit/slimefun4/core/services/metrics/ServerLanguageChart.java b/src/main/java/io/github/thebusybiscuit/slimefun4/core/services/metrics/ServerLanguageChart.java index 85d5584e4..e006eaf6d 100644 --- a/src/main/java/io/github/thebusybiscuit/slimefun4/core/services/metrics/ServerLanguageChart.java +++ b/src/main/java/io/github/thebusybiscuit/slimefun4/core/services/metrics/ServerLanguageChart.java @@ -3,14 +3,14 @@ package io.github.thebusybiscuit.slimefun4.core.services.metrics; import org.bstats.bukkit.Metrics.SimplePie; import io.github.thebusybiscuit.slimefun4.core.services.localization.Language; -import me.mrCookieSlime.Slimefun.SlimefunPlugin; +import io.github.thebusybiscuit.slimefun4.implementation.SlimefunPlugin; class ServerLanguageChart extends SimplePie { ServerLanguageChart() { super("language", () -> { - Language language = SlimefunPlugin.getLocal().getDefaultLanguage(); - boolean supported = SlimefunPlugin.getLocal().isLanguageLoaded(language.getId()); + Language language = SlimefunPlugin.getLocalization().getDefaultLanguage(); + boolean supported = SlimefunPlugin.getLocalization().isLanguageLoaded(language.getId()); return supported ? language.getId() : "Unsupported Language"; }); } diff --git a/src/main/java/io/github/thebusybiscuit/slimefun4/core/services/metrics/SlimefunVersionChart.java b/src/main/java/io/github/thebusybiscuit/slimefun4/core/services/metrics/SlimefunVersionChart.java index b8302af77..6140b60b0 100644 --- a/src/main/java/io/github/thebusybiscuit/slimefun4/core/services/metrics/SlimefunVersionChart.java +++ b/src/main/java/io/github/thebusybiscuit/slimefun4/core/services/metrics/SlimefunVersionChart.java @@ -5,7 +5,7 @@ import java.util.Map; import org.bstats.bukkit.Metrics.DrilldownPie; -import me.mrCookieSlime.Slimefun.SlimefunPlugin; +import io.github.thebusybiscuit.slimefun4.implementation.SlimefunPlugin; class SlimefunVersionChart extends DrilldownPie { diff --git a/src/main/java/io/github/thebusybiscuit/slimefun4/core/services/plugins/ClearLagHook.java b/src/main/java/io/github/thebusybiscuit/slimefun4/core/services/plugins/ClearLagHook.java index 74a5c4128..49b008dbc 100644 --- a/src/main/java/io/github/thebusybiscuit/slimefun4/core/services/plugins/ClearLagHook.java +++ b/src/main/java/io/github/thebusybiscuit/slimefun4/core/services/plugins/ClearLagHook.java @@ -7,9 +7,9 @@ import org.bukkit.entity.Item; import org.bukkit.event.EventHandler; import org.bukkit.event.Listener; +import io.github.thebusybiscuit.slimefun4.implementation.SlimefunPlugin; import io.github.thebusybiscuit.slimefun4.utils.SlimefunUtils; import me.minebuilders.clearlag.events.EntityRemoveEvent; -import me.mrCookieSlime.Slimefun.SlimefunPlugin; class ClearLagHook implements Listener { diff --git a/src/main/java/io/github/thebusybiscuit/slimefun4/core/services/plugins/PlaceholderAPIHook.java b/src/main/java/io/github/thebusybiscuit/slimefun4/core/services/plugins/PlaceholderAPIHook.java index 28e56331e..e9dec1405 100644 --- a/src/main/java/io/github/thebusybiscuit/slimefun4/core/services/plugins/PlaceholderAPIHook.java +++ b/src/main/java/io/github/thebusybiscuit/slimefun4/core/services/plugins/PlaceholderAPIHook.java @@ -9,8 +9,8 @@ import org.bukkit.entity.Player; import io.github.thebusybiscuit.slimefun4.api.player.PlayerProfile; import io.github.thebusybiscuit.slimefun4.core.researching.Research; +import io.github.thebusybiscuit.slimefun4.implementation.SlimefunPlugin; import me.clip.placeholderapi.expansion.PlaceholderExpansion; -import me.mrCookieSlime.Slimefun.SlimefunPlugin; class PlaceholderAPIHook extends PlaceholderExpansion { @@ -85,7 +85,7 @@ class PlaceholderAPIHook extends PlaceholderExpansion { } if (params.equals("timings_lag")) { - return SlimefunPlugin.getTicker().getTime() + "ms"; + return SlimefunPlugin.getTickerTask().getTime() + "ms"; } if (params.equals("language")) { @@ -93,7 +93,7 @@ class PlaceholderAPIHook extends PlaceholderExpansion { return "Unknown"; } - return SlimefunPlugin.getLocal().getLanguage((Player) p).getName((Player) p); + return SlimefunPlugin.getLocalization().getLanguage((Player) p).getName((Player) p); } return null; diff --git a/src/main/java/io/github/thebusybiscuit/slimefun4/core/services/plugins/ThirdPartyPluginService.java b/src/main/java/io/github/thebusybiscuit/slimefun4/core/services/plugins/ThirdPartyPluginService.java index 1bf6b157b..47d881cef 100644 --- a/src/main/java/io/github/thebusybiscuit/slimefun4/core/services/plugins/ThirdPartyPluginService.java +++ b/src/main/java/io/github/thebusybiscuit/slimefun4/core/services/plugins/ThirdPartyPluginService.java @@ -11,7 +11,7 @@ import org.bukkit.plugin.Plugin; import io.github.thebusybiscuit.slimefun4.api.SlimefunAddon; import io.github.thebusybiscuit.slimefun4.core.categories.FlexCategory; -import me.mrCookieSlime.Slimefun.SlimefunPlugin; +import io.github.thebusybiscuit.slimefun4.implementation.SlimefunPlugin; import me.mrCookieSlime.Slimefun.api.Slimefun; /** diff --git a/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/SlimefunItems.java b/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/SlimefunItems.java index 6d9cf0fb1..365687e04 100644 --- a/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/SlimefunItems.java +++ b/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/SlimefunItems.java @@ -20,7 +20,6 @@ import io.github.thebusybiscuit.slimefun4.utils.ChatUtils; import io.github.thebusybiscuit.slimefun4.utils.HeadTexture; import io.github.thebusybiscuit.slimefun4.utils.LoreBuilder; import io.github.thebusybiscuit.slimefun4.utils.itemstack.ColoredFireworkStar; -import me.mrCookieSlime.Slimefun.SlimefunPlugin; import me.mrCookieSlime.Slimefun.api.SlimefunItemStack; /** diff --git a/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/SlimefunPlugin.java b/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/SlimefunPlugin.java new file mode 100644 index 000000000..3da4f58f4 --- /dev/null +++ b/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/SlimefunPlugin.java @@ -0,0 +1,624 @@ +package io.github.thebusybiscuit.slimefun4.implementation; + +import java.io.File; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.Collection; +import java.util.List; +import java.util.Map; +import java.util.Set; +import java.util.logging.Level; +import java.util.stream.Collectors; + +import org.bukkit.Bukkit; +import org.bukkit.Server; +import org.bukkit.command.Command; +import org.bukkit.entity.Player; +import org.bukkit.plugin.Plugin; +import org.bukkit.plugin.PluginDescriptionFile; +import org.bukkit.plugin.java.JavaPlugin; +import org.bukkit.plugin.java.JavaPluginLoader; + +import io.github.thebusybiscuit.cscorelib2.config.Config; +import io.github.thebusybiscuit.cscorelib2.math.DoubleHandler; +import io.github.thebusybiscuit.cscorelib2.protection.ProtectionManager; +import io.github.thebusybiscuit.cscorelib2.reflection.ReflectionUtils; +import io.github.thebusybiscuit.slimefun4.api.MinecraftVersion; +import io.github.thebusybiscuit.slimefun4.api.SlimefunAddon; +import io.github.thebusybiscuit.slimefun4.api.gps.GPSNetwork; +import io.github.thebusybiscuit.slimefun4.api.player.PlayerProfile; +import io.github.thebusybiscuit.slimefun4.core.SlimefunRegistry; +import io.github.thebusybiscuit.slimefun4.core.commands.SlimefunCommand; +import io.github.thebusybiscuit.slimefun4.core.networks.NetworkManager; +import io.github.thebusybiscuit.slimefun4.core.services.AutoSavingService; +import io.github.thebusybiscuit.slimefun4.core.services.BackupService; +import io.github.thebusybiscuit.slimefun4.core.services.BlockDataService; +import io.github.thebusybiscuit.slimefun4.core.services.CustomItemDataService; +import io.github.thebusybiscuit.slimefun4.core.services.CustomTextureService; +import io.github.thebusybiscuit.slimefun4.core.services.LocalizationService; +import io.github.thebusybiscuit.slimefun4.core.services.MinecraftRecipeService; +import io.github.thebusybiscuit.slimefun4.core.services.PerWorldSettingsService; +import io.github.thebusybiscuit.slimefun4.core.services.PermissionsService; +import io.github.thebusybiscuit.slimefun4.core.services.UpdaterService; +import io.github.thebusybiscuit.slimefun4.core.services.github.GitHubService; +import io.github.thebusybiscuit.slimefun4.core.services.metrics.MetricsService; +import io.github.thebusybiscuit.slimefun4.core.services.plugins.ThirdPartyPluginService; +import io.github.thebusybiscuit.slimefun4.implementation.items.altar.AncientAltar; +import io.github.thebusybiscuit.slimefun4.implementation.items.backpacks.Cooler; +import io.github.thebusybiscuit.slimefun4.implementation.items.electric.BasicCircuitBoard; +import io.github.thebusybiscuit.slimefun4.implementation.items.electric.reactors.Reactor; +import io.github.thebusybiscuit.slimefun4.implementation.items.tools.GrapplingHook; +import io.github.thebusybiscuit.slimefun4.implementation.items.weapons.SeismicAxe; +import io.github.thebusybiscuit.slimefun4.implementation.items.weapons.VampireBlade; +import io.github.thebusybiscuit.slimefun4.implementation.listeners.AncientAltarListener; +import io.github.thebusybiscuit.slimefun4.implementation.listeners.BackpackListener; +import io.github.thebusybiscuit.slimefun4.implementation.listeners.BlockListener; +import io.github.thebusybiscuit.slimefun4.implementation.listeners.BlockPhysicsListener; +import io.github.thebusybiscuit.slimefun4.implementation.listeners.CargoNodeListener; +import io.github.thebusybiscuit.slimefun4.implementation.listeners.CoolerListener; +import io.github.thebusybiscuit.slimefun4.implementation.listeners.DeathpointListener; +import io.github.thebusybiscuit.slimefun4.implementation.listeners.DebugFishListener; +import io.github.thebusybiscuit.slimefun4.implementation.listeners.DispenserListener; +import io.github.thebusybiscuit.slimefun4.implementation.listeners.EnhancedFurnaceListener; +import io.github.thebusybiscuit.slimefun4.implementation.listeners.ExplosionsListener; +import io.github.thebusybiscuit.slimefun4.implementation.listeners.FireworksListener; +import io.github.thebusybiscuit.slimefun4.implementation.listeners.GadgetsListener; +import io.github.thebusybiscuit.slimefun4.implementation.listeners.GrapplingHookListener; +import io.github.thebusybiscuit.slimefun4.implementation.listeners.IronGolemListener; +import io.github.thebusybiscuit.slimefun4.implementation.listeners.ItemPickupListener; +import io.github.thebusybiscuit.slimefun4.implementation.listeners.MobDropListener; +import io.github.thebusybiscuit.slimefun4.implementation.listeners.MultiBlockListener; +import io.github.thebusybiscuit.slimefun4.implementation.listeners.PlayerInteractEntityListener; +import io.github.thebusybiscuit.slimefun4.implementation.listeners.PlayerProfileListener; +import io.github.thebusybiscuit.slimefun4.implementation.listeners.SeismicAxeListener; +import io.github.thebusybiscuit.slimefun4.implementation.listeners.SlimefunBootsListener; +import io.github.thebusybiscuit.slimefun4.implementation.listeners.SlimefunBowListener; +import io.github.thebusybiscuit.slimefun4.implementation.listeners.SlimefunGuideListener; +import io.github.thebusybiscuit.slimefun4.implementation.listeners.SlimefunItemConsumeListener; +import io.github.thebusybiscuit.slimefun4.implementation.listeners.SlimefunItemListener; +import io.github.thebusybiscuit.slimefun4.implementation.listeners.SoulboundListener; +import io.github.thebusybiscuit.slimefun4.implementation.listeners.TalismanListener; +import io.github.thebusybiscuit.slimefun4.implementation.listeners.VampireBladeListener; +import io.github.thebusybiscuit.slimefun4.implementation.listeners.VanillaMachinesListener; +import io.github.thebusybiscuit.slimefun4.implementation.listeners.WitherListener; +import io.github.thebusybiscuit.slimefun4.implementation.listeners.WorldListener; +import io.github.thebusybiscuit.slimefun4.implementation.resources.GEOResourcesSetup; +import io.github.thebusybiscuit.slimefun4.implementation.setup.PostSetup; +import io.github.thebusybiscuit.slimefun4.implementation.setup.ResearchSetup; +import io.github.thebusybiscuit.slimefun4.implementation.setup.SlimefunItemSetup; +import io.github.thebusybiscuit.slimefun4.implementation.tasks.ArmorTask; +import io.github.thebusybiscuit.slimefun4.implementation.tasks.SlimefunStartupTask; +import io.github.thebusybiscuit.slimefun4.implementation.tasks.TickerTask; +import me.mrCookieSlime.CSCoreLibPlugin.CSCoreLib; +import me.mrCookieSlime.Slimefun.Objects.SlimefunItem.abstractItems.AContainer; +import me.mrCookieSlime.Slimefun.Objects.SlimefunItem.abstractItems.AGenerator; +import me.mrCookieSlime.Slimefun.api.BlockStorage; +import me.mrCookieSlime.Slimefun.api.Slimefun; +import me.mrCookieSlime.Slimefun.api.inventory.UniversalBlockMenu; + +/** + * This is the main class of Slimefun. + * This is where all the magic starts, take a look around. + * Feel like home. + * + * @author TheBusyBiscuit + */ +public final class SlimefunPlugin extends JavaPlugin implements SlimefunAddon { + + public static SlimefunPlugin instance; + + private MinecraftVersion minecraftVersion = MinecraftVersion.UNKNOWN; + + private final SlimefunRegistry registry = new SlimefunRegistry(); + private final TickerTask ticker = new TickerTask(); + private final SlimefunCommand command = new SlimefunCommand(this); + + // Services - Systems that fulfill certain tasks, treat them as a black box + private final CustomItemDataService itemDataService = new CustomItemDataService(this, "slimefun_item"); + private final BlockDataService blockDataService = new BlockDataService(this, "slimefun_block"); + private final CustomTextureService textureService = new CustomTextureService(new Config(this, "item-models.yml")); + private final GitHubService gitHubService = new GitHubService("TheBusyBiscuit/Slimefun4"); + private final UpdaterService updaterService = new UpdaterService(this, getDescription().getVersion(), getFile()); + private final MetricsService metricsService = new MetricsService(this); + private final AutoSavingService autoSavingService = new AutoSavingService(); + private final BackupService backupService = new BackupService(); + private final PermissionsService permissionsService = new PermissionsService(this); + private final PerWorldSettingsService worldSettingsService = new PerWorldSettingsService(this); + private final ThirdPartyPluginService thirdPartySupportService = new ThirdPartyPluginService(this); + private final MinecraftRecipeService recipeService = new MinecraftRecipeService(this); + private LocalizationService local; + + private GPSNetwork gpsNetwork; + private NetworkManager networkManager; + private ProtectionManager protections; + + // Important config files for Slimefun + private final Config config = new Config(this); + private final Config items = new Config(this, "Items.yml"); + private final Config researches = new Config(this, "Researches.yml"); + + // Listeners that need to be accessed elsewhere + private final AncientAltarListener ancientAltarListener = new AncientAltarListener(); + private final GrapplingHookListener grapplingHookListener = new GrapplingHookListener(); + private final BackpackListener backpackListener = new BackpackListener(); + private final SlimefunBowListener bowListener = new SlimefunBowListener(); + + public SlimefunPlugin() { + super(); + } + + public SlimefunPlugin(JavaPluginLoader loader, PluginDescriptionFile description, File dataFolder, File file) { + super(loader, description, dataFolder, file); + minecraftVersion = MinecraftVersion.UNIT_TEST; + } + + @Override + public void onEnable() { + if (minecraftVersion == MinecraftVersion.UNIT_TEST) { + instance = this; + local = new LocalizationService(this, "", null); + gpsNetwork = new GPSNetwork(); + command.register(); + } + else if (getServer().getPluginManager().isPluginEnabled("CS-CoreLib")) { + long timestamp = System.nanoTime(); + + // We wanna ensure that the Server uses a compatible version of Minecraft + if (isVersionUnsupported()) { + getServer().getPluginManager().disablePlugin(this); + return; + } + + instance = this; + + // Creating all necessary Folders + getLogger().log(Level.INFO, "Loading various systems..."); + createDirectories(); + registry.load(config); + + // Set up localization + local = new LocalizationService(this, config.getString("options.chat-prefix"), config.getString("options.language")); + + // Setting up Networks + gpsNetwork = new GPSNetwork(); + + int networkSize = config.getInt("networks.max-size"); + + if (networkSize < 1) { + getLogger().log(Level.WARNING, "Your 'networks.max-size' setting is misconfigured! It must be at least 1, it was set to: {0}", networkSize); + networkSize = 1; + } + + networkManager = new NetworkManager(networkSize); + + // Setting up bStats + metricsService.start(); + + // Starting the Auto-Updater + if (config.getBoolean("options.auto-update")) { + getLogger().log(Level.INFO, "Starting Auto-Updater..."); + updaterService.start(); + } + else { + updaterService.disable(); + } + + // Registering all GEO Resources + getLogger().log(Level.INFO, "Loading GEO-Resources..."); + GEOResourcesSetup.setup(); + + getLogger().log(Level.INFO, "Loading items..."); + loadItems(); + + getLogger().log(Level.INFO, "Loading researches..."); + loadResearches(); + + registry.setResearchingEnabled(getResearchCfg().getBoolean("enable-researching")); + PostSetup.setupWiki(); + + // All Slimefun Listeners + new SlimefunBootsListener(this); + new SlimefunItemListener(this); + new SlimefunItemConsumeListener(this); + new BlockPhysicsListener(this); + new CargoNodeListener(this); + new MultiBlockListener(this); + new GadgetsListener(this); + new DispenserListener(this); + new BlockListener(this); + new EnhancedFurnaceListener(this); + new ItemPickupListener(this); + new DeathpointListener(this); + new ExplosionsListener(this); + new DebugFishListener(this); + new VanillaMachinesListener(this); + new FireworksListener(this); + new WitherListener(this); + new IronGolemListener(this); + new PlayerInteractEntityListener(this); + + new MobDropListener(this, (BasicCircuitBoard) SlimefunItems.BASIC_CIRCUIT_BOARD.getItem()); + + // Item-specific Listeners + new VampireBladeListener(this, (VampireBlade) SlimefunItems.BLADE_OF_VAMPIRES.getItem()); + new CoolerListener(this, (Cooler) SlimefunItems.COOLER.getItem()); + new SeismicAxeListener(this, (SeismicAxe) SlimefunItems.SEISMIC_AXE.getItem()); + grapplingHookListener.register(this, (GrapplingHook) SlimefunItems.GRAPPLING_HOOK.getItem()); + ancientAltarListener.register(this, (AncientAltar) SlimefunItems.ANCIENT_ALTAR.getItem()); + + bowListener.register(this); + + // Toggleable Listeners for performance reasons + if (config.getBoolean("items.talismans")) { + new TalismanListener(this); + } + + if (config.getBoolean("items.soulbound")) { + new SoulboundListener(this); + } + + if (config.getBoolean("items.backpacks")) { + backpackListener.register(this); + } + + // Handle Slimefun Guide being given on Join + new SlimefunGuideListener(this, config.getBoolean("guide.receive-on-first-join")); + + // Load/Unload Worlds in Slimefun + new WorldListener(this); + + // Clear the Slimefun Guide History upon Player Leaving + new PlayerProfileListener(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()); + textureService.register(registry.getAllSlimefunItems(), true); + permissionsService.register(registry.getAllSlimefunItems(), true); + recipeService.refresh(); + }), 0); + + // Setting up the command /sf and all subcommands + command.register(); + + // Armor Update Task + if (config.getBoolean("options.enable-armor-effects")) { + getServer().getScheduler().runTaskTimerAsynchronously(this, new ArmorTask(), 0L, config.getInt("options.armor-update-interval") * 20L); + } + + autoSavingService.start(this, config.getInt("options.auto-save-delay-in-minutes")); + ticker.start(this); + thirdPartySupportService.start(); + gitHubService.start(this); + + // Hooray! + getLogger().log(Level.INFO, "Slimefun has finished loading in {0}", getStartupTime(timestamp)); + } + else { + getLogger().log(Level.INFO, "#################### - INFO - ####################"); + getLogger().log(Level.INFO, " "); + getLogger().log(Level.INFO, "Slimefun could not be loaded (yet)."); + getLogger().log(Level.INFO, "It appears that you have not installed CS-CoreLib."); + getLogger().log(Level.INFO, "Please download and install CS-CoreLib manually:"); + getLogger().log(Level.INFO, "https://thebusybiscuit.github.io/builds/TheBusyBiscuit/CS-CoreLib/master/"); + + getCommand("slimefun").setExecutor((sender, cmd, label, args) -> { + sender.sendMessage("You have forgotten to install CS-CoreLib! Slimefun is disabled."); + sender.sendMessage("https://thebusybiscuit.github.io/builds/TheBusyBiscuit/CS-CoreLib/master/"); + return true; + }); + } + } + + private String getStartupTime(long timestamp) { + long ms = (System.nanoTime() - timestamp) / 1000000; + + if (ms > 1000) { + return DoubleHandler.fixDouble(ms / 1000.0) + "s"; + } + else { + return DoubleHandler.fixDouble(ms) + "ms"; + } + } + + /** + * This method checks for the {@link MinecraftVersion} of the {@link Server}. + * If the version is unsupported, a warning will be printed to the console. + * + * @return Whether the {@link MinecraftVersion} is unsupported + */ + private boolean isVersionUnsupported() { + String currentVersion = ReflectionUtils.getVersion(); + + if (currentVersion.startsWith("v")) { + for (MinecraftVersion version : MinecraftVersion.values()) { + if (version.matches(currentVersion)) { + minecraftVersion = version; + return false; + } + } + + // Looks like you are using an unsupported Minecraft Version + getLogger().log(Level.SEVERE, "#############################################"); + getLogger().log(Level.SEVERE, "### Slimefun was not installed correctly!"); + getLogger().log(Level.SEVERE, "### You are using the wrong version of Minecraft!"); + getLogger().log(Level.SEVERE, "###"); + getLogger().log(Level.SEVERE, "### You are using Minecraft {0}", ReflectionUtils.getVersion()); + getLogger().log(Level.SEVERE, "### but Slimefun v{0} requires you to be using", getDescription().getVersion()); + getLogger().log(Level.SEVERE, "### Minecraft {0}", String.join(" / ", getSupportedVersions())); + getLogger().log(Level.SEVERE, "#############################################"); + return true; + } + + getLogger().log(Level.WARNING, "We could not determine the version of Minecraft you were using ({0})", currentVersion); + return false; + } + + private Collection getSupportedVersions() { + List list = new ArrayList<>(); + + for (MinecraftVersion version : MinecraftVersion.values()) { + if (version != MinecraftVersion.UNKNOWN) { + list.add(version.getName()); + } + } + + return list; + } + + @Override + public void onDisable() { + // Slimefun never loaded successfully, so we don't even bother doing stuff here + if (instance == null || minecraftVersion == MinecraftVersion.UNIT_TEST) { + return; + } + + // Cancel all tasks from this plugin immediately + Bukkit.getScheduler().cancelTasks(this); + + // Finishes all started movements/removals of block data + ticker.halt(); + ticker.run(); + + // Save all Player Profiles that are still in memory + PlayerProfile.iterator().forEachRemaining(profile -> { + if (profile.isDirty()) { + profile.save(); + } + }); + + // Save all registered Worlds + for (Map.Entry entry : getRegistry().getWorlds().entrySet()) { + try { + entry.getValue().save(true); + } + catch (Exception x) { + getLogger().log(Level.SEVERE, x, () -> "An Error occurred while saving Slimefun-Blocks in World '" + entry.getKey() + "' for Slimefun " + getVersion()); + } + } + + for (UniversalBlockMenu menu : registry.getUniversalInventories().values()) { + menu.save(); + } + + // Create a new backup zip + backupService.run(); + + // Prevent Memory Leaks + // These static Maps should be removed at some point... + AContainer.processing = null; + AContainer.progress = null; + + AGenerator.processing = null; + AGenerator.progress = null; + + Reactor.processing = null; + Reactor.progress = null; + + instance = null; + + // Close all inventories on the server to prevent item dupes + // (Incase some idiot uses /reload) + for (Player p : Bukkit.getOnlinePlayers()) { + p.closeInventory(); + } + } + + private void createDirectories() { + String[] storageFolders = { "Players", "blocks", "stored-blocks", "stored-inventories", "stored-chunks", "universal-inventories", "waypoints", "block-backups" }; + String[] pluginFolders = { "scripts", "generators", "error-reports", "cache/github", "world-settings" }; + + for (String folder : storageFolders) { + File file = new File("data-storage/Slimefun", folder); + + if (!file.exists()) { + file.mkdirs(); + } + } + + for (String folder : pluginFolders) { + File file = new File("plugins/Slimefun", folder); + + if (!file.exists()) { + file.mkdirs(); + } + } + } + + private void loadItems() { + try { + SlimefunItemSetup.setup(this); + } + catch (Exception | LinkageError x) { + getLogger().log(Level.SEVERE, x, () -> "An Error occurred while initializing SlimefunItems for Slimefun " + getVersion()); + } + } + + private void loadResearches() { + try { + ResearchSetup.setupResearches(); + } + catch (Exception | LinkageError x) { + getLogger().log(Level.SEVERE, x, () -> "An Error occurred while initializing Slimefun Researches for Slimefun " + getVersion()); + } + } + + public static Config getCfg() { + return instance.config; + } + + public static Config getResearchCfg() { + return instance.researches; + } + + public static Config getItemCfg() { + return instance.items; + } + + public static GPSNetwork getGPSNetwork() { + return instance.gpsNetwork; + } + + public static TickerTask getTickerTask() { + return instance.ticker; + } + + /** + * This returns the version of Slimefun that is currently installed. + * + * @return The currently installed version of Slimefun + */ + public static String getVersion() { + return instance.getDescription().getVersion(); + } + + /** + * This returns the {@link LocalizationService} of Slimefun. + * + * @return The {@link LocalizationService} of Slimefun + */ + public static LocalizationService getLocalization() { + return instance.local; + } + + public static ProtectionManager getProtectionManager() { + return instance.protections; + } + + public static MinecraftRecipeService getMinecraftRecipeService() { + return instance.recipeService; + } + + public static CustomItemDataService getItemDataService() { + return instance.itemDataService; + } + + public static CustomTextureService getItemTextureService() { + return instance.textureService; + } + + public static PermissionsService getPermissionsService() { + return instance.permissionsService; + } + + public static BlockDataService getBlockDataService() { + return instance.blockDataService; + } + + public static ThirdPartyPluginService getThirdPartySupportService() { + return instance.thirdPartySupportService; + } + + public static PerWorldSettingsService getWorldSettingsService() { + return instance.worldSettingsService; + } + + /** + * This method returns the {@link UpdaterService} of Slimefun. + * It is used to handle automatic updates. + * + * @return The {@link UpdaterService} for Slimefun + */ + public static UpdaterService getUpdater() { + return instance.updaterService; + } + + /** + * This method returns the {@link GitHubService} of Slimefun. + * It is used to retrieve data from GitHub repositories. + * + * @return The {@link GitHubService} for Slimefun + */ + public static GitHubService getGitHubService() { + return instance.gitHubService; + } + + public static SlimefunRegistry getRegistry() { + return instance.registry; + } + + public static NetworkManager getNetworkManager() { + return instance.networkManager; + } + + public static AncientAltarListener getAncientAltarListener() { + return instance.ancientAltarListener; + } + + public static GrapplingHookListener getGrapplingHookListener() { + return instance.grapplingHookListener; + } + + public static BackpackListener getBackpackListener() { + return instance.backpackListener; + } + + public static SlimefunBowListener getBowListener() { + return instance.bowListener; + } + + /** + * This method returns a {@link Set} of every {@link Plugin} that lists Slimefun + * as a required or optional dependency. + *

+ * We will just assume this to be a list of our addons. + * + * @return A {@link Set} of every {@link Plugin} that is dependent on Slimefun + */ + public static Set getInstalledAddons() { + return Arrays.stream(instance.getServer().getPluginManager().getPlugins()).filter(plugin -> plugin.getDescription().getDepend().contains(instance.getName()) || plugin.getDescription().getSoftDepend().contains(instance.getName())).collect(Collectors.toSet()); + } + + /** + * The {@link Command} that was added by Slimefun. + * + * @return Slimefun's command + */ + public static SlimefunCommand getCommand() { + return instance.command; + } + + /** + * This returns the currently installed version of Minecraft. + * + * @return The current version of Minecraft + */ + public static MinecraftVersion getMinecraftVersion() { + return instance.minecraftVersion; + } + + public static String getCSCoreLibVersion() { + return CSCoreLib.getLib().getDescription().getVersion(); + } + + @Override + public JavaPlugin getJavaPlugin() { + return this; + } + + @Override + public String getBugTrackerURL() { + return "https://github.com/TheBusyBiscuit/Slimefun4/issues"; + } + +} diff --git a/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/guide/BookSlimefunGuide.java b/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/guide/BookSlimefunGuide.java index 4872834d4..cac68da1f 100644 --- a/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/guide/BookSlimefunGuide.java +++ b/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/guide/BookSlimefunGuide.java @@ -26,9 +26,9 @@ import io.github.thebusybiscuit.slimefun4.core.guide.SlimefunGuide; import io.github.thebusybiscuit.slimefun4.core.guide.SlimefunGuideImplementation; import io.github.thebusybiscuit.slimefun4.core.guide.SlimefunGuideLayout; import io.github.thebusybiscuit.slimefun4.core.researching.Research; +import io.github.thebusybiscuit.slimefun4.implementation.SlimefunPlugin; import io.github.thebusybiscuit.slimefun4.utils.ChatUtils; import io.github.thebusybiscuit.slimefun4.utils.ChestMenuUtils; -import me.mrCookieSlime.Slimefun.SlimefunPlugin; import me.mrCookieSlime.Slimefun.Objects.Category; import me.mrCookieSlime.Slimefun.Objects.SlimefunItem.SlimefunItem; import me.mrCookieSlime.Slimefun.api.Slimefun; @@ -54,15 +54,15 @@ public class BookSlimefunGuide implements SlimefunGuideImplementation { private void openBook(Player p, PlayerProfile profile, List lines, boolean backButton) { CustomBookInterface book = new CustomBookInterface(SlimefunPlugin.instance); - book.setTitle(SlimefunPlugin.getLocal().getMessage(p, "guide.title.main")); + book.setTitle(SlimefunPlugin.getLocalization().getMessage(p, "guide.title.main")); for (int i = 0; i < lines.size(); i = i + 10) { ChatComponent page = new ChatComponent(""); - ChatComponent header = new ChatComponent(ChatColors.color("&b&l- " + SlimefunPlugin.getLocal().getMessage(p, "guide.title.main") + " -\n\n")); + ChatComponent header = new ChatComponent(ChatColors.color("&b&l- " + SlimefunPlugin.getLocalization().getMessage(p, "guide.title.main") + " -\n\n")); header.setHoverEvent(new HoverEvent(ChestMenuUtils.getSearchButton(p))); header.setClickEvent(new ClickEvent(guideSearch, player -> Slimefun.runSync(() -> { - SlimefunPlugin.getLocal().sendMessage(player, "guide.search.message"); + SlimefunPlugin.getLocalization().sendMessage(player, "guide.search.message"); ChatInput.waitForPlayer(SlimefunPlugin.instance, player, msg -> SlimefunGuide.openSearch(profile, msg, true, true)); }, 1))); @@ -75,8 +75,8 @@ public class BookSlimefunGuide implements SlimefunGuideImplementation { page.append(new ChatComponent("\n")); if (backButton) { - ChatComponent button = new ChatComponent(ChatColor.DARK_BLUE + "\u21E6 " + SlimefunPlugin.getLocal().getMessage(p, "guide.back.title")); - button.setHoverEvent(new HoverEvent(ChatColor.DARK_BLUE + "\u21E6 " + SlimefunPlugin.getLocal().getMessage(p, "guide.back.title"), "", ChatColor.GRAY + SlimefunPlugin.getLocal().getMessage(p, "guide.back.guide"))); + ChatComponent button = new ChatComponent(ChatColor.DARK_BLUE + "\u21E6 " + SlimefunPlugin.getLocalization().getMessage(p, "guide.back.title")); + button.setHoverEvent(new HoverEvent(ChatColor.DARK_BLUE + "\u21E6 " + SlimefunPlugin.getLocalization().getMessage(p, "guide.back.title"), "", ChatColor.GRAY + SlimefunPlugin.getLocalization().getMessage(p, "guide.back.guide"))); button.setClickEvent(new ClickEvent(new NamespacedKey(SlimefunPlugin.instance, "slimefun_guide"), pl -> openMainMenu(profile, 1))); page.append(button); } @@ -114,10 +114,10 @@ public class BookSlimefunGuide implements SlimefunGuideImplementation { if (category instanceof LockedCategory && !((LockedCategory) category).hasUnlocked(p, profile)) { List lore = new LinkedList<>(); - lore.add(ChatColor.DARK_RED + SlimefunPlugin.getLocal().getMessage(p, "guide.locked") + " " + ChatColor.GRAY + "- " + ChatColor.RESET + category.getItem(p).getItemMeta().getDisplayName()); + lore.add(ChatColor.DARK_RED + SlimefunPlugin.getLocalization().getMessage(p, "guide.locked") + " " + ChatColor.GRAY + "- " + ChatColor.RESET + category.getItem(p).getItemMeta().getDisplayName()); lore.add(""); - for (String line : SlimefunPlugin.getLocal().getMessages(p, "guide.locked-category")) { + for (String line : SlimefunPlugin.getLocalization().getMessages(p, "guide.locked-category")) { lore.add(ChatColor.RESET + line); } @@ -133,7 +133,7 @@ public class BookSlimefunGuide implements SlimefunGuideImplementation { } else { ChatComponent chatComponent = new ChatComponent(ChatUtils.crop(ChatColor.DARK_GREEN, ItemUtils.getItemName(category.getItem(p))) + "\n"); - chatComponent.setHoverEvent(new HoverEvent(ItemUtils.getItemName(category.getItem(p)), "", ChatColor.GRAY + "\u21E8 " + ChatColor.GREEN + SlimefunPlugin.getLocal().getMessage(p, "guide.tooltips.open-category"))); + chatComponent.setHoverEvent(new HoverEvent(ItemUtils.getItemName(category.getItem(p)), "", ChatColor.GRAY + "\u21E8 " + ChatColor.GREEN + SlimefunPlugin.getLocalization().getMessage(p, "guide.tooltips.open-category"))); chatComponent.setClickEvent(new ClickEvent(category.getKey(), pl -> openCategory(profile, category, 1))); lines.add(chatComponent); } @@ -195,7 +195,7 @@ public class BookSlimefunGuide implements SlimefunGuideImplementation { Research research = item.getResearch(); ChatComponent component = new ChatComponent(ChatUtils.crop(ChatColor.RED, item.getItemName()) + "\n"); - component.setHoverEvent(new HoverEvent(ChatColor.RESET + item.getItemName(), ChatColor.DARK_RED.toString() + ChatColor.BOLD + SlimefunPlugin.getLocal().getMessage(p, "guide.locked"), "", ChatColor.GREEN + "> Click to unlock", "", ChatColor.GRAY + "Cost: " + ChatColor.AQUA.toString() + research.getCost() + " Level(s)")); + component.setHoverEvent(new HoverEvent(ChatColor.RESET + item.getItemName(), ChatColor.DARK_RED.toString() + ChatColor.BOLD + SlimefunPlugin.getLocalization().getMessage(p, "guide.locked"), "", ChatColor.GREEN + "> Click to unlock", "", ChatColor.GRAY + "Cost: " + ChatColor.AQUA.toString() + research.getCost() + " Level(s)")); component.setClickEvent(new ClickEvent(key, player -> Slimefun.runSync(() -> { if (!SlimefunPlugin.getRegistry().getCurrentlyResearchingPlayers().contains(p.getUniqueId())) { if (research.canUnlock(p)) { @@ -207,7 +207,7 @@ public class BookSlimefunGuide implements SlimefunGuideImplementation { } } else { - SlimefunPlugin.getLocal().sendMessage(p, "messages.not-enough-xp", true); + SlimefunPlugin.getLocalization().sendMessage(p, "messages.not-enough-xp", true); } } }))); diff --git a/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/guide/ChestSlimefunGuide.java b/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/guide/ChestSlimefunGuide.java index 0b7974360..6d8ead8b1 100644 --- a/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/guide/ChestSlimefunGuide.java +++ b/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/guide/ChestSlimefunGuide.java @@ -36,11 +36,11 @@ import io.github.thebusybiscuit.slimefun4.core.guide.options.SlimefunGuideSettin import io.github.thebusybiscuit.slimefun4.core.multiblocks.MultiBlock; import io.github.thebusybiscuit.slimefun4.core.multiblocks.MultiBlockMachine; import io.github.thebusybiscuit.slimefun4.core.researching.Research; +import io.github.thebusybiscuit.slimefun4.implementation.SlimefunPlugin; import io.github.thebusybiscuit.slimefun4.utils.ChatUtils; import io.github.thebusybiscuit.slimefun4.utils.ChestMenuUtils; import me.mrCookieSlime.CSCoreLibPlugin.general.Inventory.ChestMenu; import me.mrCookieSlime.CSCoreLibPlugin.general.Inventory.ChestMenu.MenuClickHandler; -import me.mrCookieSlime.Slimefun.SlimefunPlugin; import me.mrCookieSlime.Slimefun.Lists.RecipeType; import me.mrCookieSlime.Slimefun.Objects.Category; import me.mrCookieSlime.Slimefun.Objects.SlimefunItem.SlimefunItem; @@ -115,9 +115,10 @@ public class ChestSlimefunGuide implements SlimefunGuideImplementation { while (target < (categories.size() - 1) && index < CATEGORY_SIZE + 9) { target++; - Category category = categories.get(target); + Category category = categories.get(target); displayCategory(menu, p, profile, category, index); + index++; } @@ -126,14 +127,22 @@ public class ChestSlimefunGuide implements SlimefunGuideImplementation { menu.addItem(46, ChestMenuUtils.getPreviousButton(p, page, pages)); menu.addMenuClickHandler(46, (pl, slot, item, action) -> { int next = page - 1; - if (next != page && next > 0) openMainMenu(profile, next); + + if (next != page && next > 0) { + openMainMenu(profile, next); + } + return false; }); menu.addItem(52, ChestMenuUtils.getNextButton(p, page, pages)); menu.addMenuClickHandler(52, (pl, slot, item, action) -> { int next = page + 1; - if (next != page && next <= pages) openMainMenu(profile, next); + + if (next != page && next <= pages) { + openMainMenu(profile, next); + } + return false; }); @@ -152,7 +161,7 @@ public class ChestSlimefunGuide implements SlimefunGuideImplementation { List lore = new ArrayList<>(); lore.add(""); - for (String line : SlimefunPlugin.getLocal().getMessages(p, "guide.locked-category")) { + for (String line : SlimefunPlugin.getLocalization().getMessages(p, "guide.locked-category")) { lore.add(ChatColor.WHITE + line); } @@ -162,7 +171,7 @@ public class ChestSlimefunGuide implements SlimefunGuideImplementation { lore.add(parent.getItem(p).getItemMeta().getDisplayName()); } - menu.addItem(index, new CustomItem(Material.BARRIER, "&4" + SlimefunPlugin.getLocal().getMessage(p, "guide.locked") + " &7- &f" + category.getItem(p).getItemMeta().getDisplayName(), lore.toArray(new String[0]))); + menu.addItem(index, new CustomItem(Material.BARRIER, "&4" + SlimefunPlugin.getLocalization().getMessage(p, "guide.locked") + " &7- &f" + category.getItem(p).getItemMeta().getDisplayName(), lore.toArray(new String[0]))); menu.addMenuClickHandler(index, ChestMenuUtils.getEmptyClickHandler()); } } @@ -187,7 +196,7 @@ public class ChestSlimefunGuide implements SlimefunGuideImplementation { ChestMenu menu = create(p); createHeader(p, profile, menu); - menu.addItem(1, new CustomItem(ChestMenuUtils.getBackButton(p, "", ChatColor.GRAY + SlimefunPlugin.getLocal().getMessage(p, "guide.back.guide")))); + menu.addItem(1, new CustomItem(ChestMenuUtils.getBackButton(p, "", ChatColor.GRAY + SlimefunPlugin.getLocalization().getMessage(p, "guide.back.guide")))); menu.addMenuClickHandler(1, (pl, s, is, action) -> { openMainMenu(profile, 1); return false; @@ -214,71 +223,75 @@ public class ChestSlimefunGuide implements SlimefunGuideImplementation { for (int i = 0; i < CATEGORY_SIZE; i++) { int target = categoryIndex + i; - if (target >= category.getItems().size()) break; + + if (target >= category.getItems().size()) { + break; + } SlimefunItem sfitem = category.getItems().get(target); if (Slimefun.isEnabled(p, sfitem, false)) { - Research research = sfitem.getResearch(); - - if (isSurvivalMode() && !Slimefun.hasPermission(p, sfitem, false)) { - List message = SlimefunPlugin.getPermissionsService().getLore(sfitem); - menu.addItem(index, new CustomItem(Material.BARRIER, sfitem.getItemName(), message.toArray(new String[0]))); - menu.addMenuClickHandler(index, ChestMenuUtils.getEmptyClickHandler()); - index++; - } - else if (isSurvivalMode() && research != null && !profile.hasUnlocked(research)) { - menu.addItem(index, new CustomItem(Material.BARRIER, ChatColor.WHITE + ItemUtils.getItemName(sfitem.getItem()), "&4&l" + SlimefunPlugin.getLocal().getMessage(p, "guide.locked"), "", "&a> Click to unlock", "", "&7Cost: &b" + research.getCost() + " Level(s)")); - menu.addMenuClickHandler(index, (pl, slot, item, action) -> { - if (!SlimefunPlugin.getRegistry().getCurrentlyResearchingPlayers().contains(pl.getUniqueId())) { - if (research.canUnlock(pl)) { - if (profile.hasUnlocked(research)) { - openCategory(profile, category, page); - } - else { - unlockItem(pl, sfitem, player -> openCategory(profile, category, page)); - } - } - else { - SlimefunPlugin.getLocal().sendMessage(pl, "messages.not-enough-xp", true); - } - } - return false; - }); - - index++; - } - else { - menu.addItem(index, sfitem.getItem()); - menu.addMenuClickHandler(index, (pl, slot, item, action) -> { - try { - if (isSurvivalMode()) { - displayItem(profile, sfitem, true); - } - else { - if (sfitem instanceof MultiBlockMachine) { - SlimefunPlugin.getLocal().sendMessage(pl, "guide.cheat.no-multiblocks"); - } - else { - pl.getInventory().addItem(sfitem.getItem().clone()); - } - } - } - catch (Exception | LinkageError x) { - printErrorMessage(pl, x); - } - - return false; - }); - - index++; - } + displaySlimefunItem(menu, category, p, profile, sfitem, page, index); + index++; } } menu.open(p); } + private void displaySlimefunItem(ChestMenu menu, Category category, Player p, PlayerProfile profile, SlimefunItem sfitem, int page, int index) { + Research research = sfitem.getResearch(); + + if (isSurvivalMode() && !Slimefun.hasPermission(p, sfitem, false)) { + List message = SlimefunPlugin.getPermissionsService().getLore(sfitem); + menu.addItem(index, new CustomItem(Material.BARRIER, sfitem.getItemName(), message.toArray(new String[0]))); + menu.addMenuClickHandler(index, ChestMenuUtils.getEmptyClickHandler()); + } + else if (isSurvivalMode() && research != null && !profile.hasUnlocked(research)) { + menu.addItem(index, new CustomItem(Material.BARRIER, ChatColor.WHITE + ItemUtils.getItemName(sfitem.getItem()), "&4&l" + SlimefunPlugin.getLocalization().getMessage(p, "guide.locked"), "", "&a> Click to unlock", "", "&7Cost: &b" + research.getCost() + " Level(s)")); + menu.addMenuClickHandler(index, (pl, slot, item, action) -> { + if (!SlimefunPlugin.getRegistry().getCurrentlyResearchingPlayers().contains(pl.getUniqueId())) { + if (research.canUnlock(pl)) { + if (profile.hasUnlocked(research)) { + openCategory(profile, category, page); + } + else { + unlockItem(pl, sfitem, player -> openCategory(profile, category, page)); + } + } + else { + SlimefunPlugin.getLocalization().sendMessage(pl, "messages.not-enough-xp", true); + } + } + + return false; + }); + } + else { + menu.addItem(index, sfitem.getItem()); + menu.addMenuClickHandler(index, (pl, slot, item, action) -> { + try { + if (isSurvivalMode()) { + displayItem(profile, sfitem, true); + } + else { + if (sfitem instanceof MultiBlockMachine) { + SlimefunPlugin.getLocalization().sendMessage(pl, "guide.cheat.no-multiblocks"); + } + else { + pl.getInventory().addItem(sfitem.getItem().clone()); + } + } + } + catch (Exception | LinkageError x) { + printErrorMessage(pl, x); + } + + return false; + }); + } + } + @Override public void openSearch(PlayerProfile profile, String input, boolean addToHistory) { Player p = profile.getPlayer(); @@ -287,7 +300,7 @@ public class ChestSlimefunGuide implements SlimefunGuideImplementation { return; } - ChestMenu menu = new ChestMenu(SlimefunPlugin.getLocal().getMessage(p, "guide.search.inventory").replace("%item%", ChatUtils.crop(ChatColor.WHITE, input))); + ChestMenu menu = new ChestMenu(SlimefunPlugin.getLocalization().getMessage(p, "guide.search.inventory").replace("%item%", ChatUtils.crop(ChatColor.WHITE, input))); String searchTerm = input.toLowerCase(Locale.ROOT); if (addToHistory) { @@ -367,7 +380,7 @@ public class ChestSlimefunGuide implements SlimefunGuideImplementation { return; } - Recipe[] recipes = SlimefunPlugin.getMinecraftRecipes().getRecipesFor(item); + Recipe[] recipes = SlimefunPlugin.getMinecraftRecipeService().getRecipesFor(item); if (recipes.length == 0) { return; @@ -389,7 +402,7 @@ public class ChestSlimefunGuide implements SlimefunGuideImplementation { if (optional.isPresent()) { MinecraftRecipe mcRecipe = optional.get(); - RecipeChoice[] choices = SlimefunPlugin.getMinecraftRecipes().getRecipeShape(recipe); + RecipeChoice[] choices = SlimefunPlugin.getMinecraftRecipeService().getRecipeShape(recipe); if (choices.length == 1 && choices[0] instanceof MaterialChoice) { recipeItems[4] = new ItemStack(((MaterialChoice) choices[0]).getChoices().get(0)); @@ -464,7 +477,7 @@ public class ChestSlimefunGuide implements SlimefunGuideImplementation { Optional wiki = item.getWikipage(); if (wiki.isPresent()) { - menu.addItem(8, new CustomItem(Material.KNOWLEDGE_BOOK, ChatColor.WHITE + SlimefunPlugin.getLocal().getMessage(p, "guide.tooltips.wiki"), "", ChatColor.GRAY + "\u21E8 " + ChatColor.GREEN + SlimefunPlugin.getLocal().getMessage(p, "guide.tooltips.open-category"))); + menu.addItem(8, new CustomItem(Material.KNOWLEDGE_BOOK, ChatColor.WHITE + SlimefunPlugin.getLocalization().getMessage(p, "guide.tooltips.wiki"), "", ChatColor.GRAY + "\u21E8 " + ChatColor.GREEN + SlimefunPlugin.getLocalization().getMessage(p, "guide.tooltips.open-category"))); menu.addMenuClickHandler(8, (pl, slot, itemstack, action) -> { pl.closeInventory(); ChatUtils.sendURL(pl, wiki.get()); @@ -547,7 +560,7 @@ public class ChestSlimefunGuide implements SlimefunGuideImplementation { menu.addMenuClickHandler(7, (pl, slot, item, action) -> { pl.closeInventory(); - SlimefunPlugin.getLocal().sendMessage(pl, "guide.search.message"); + SlimefunPlugin.getLocalization().sendMessage(pl, "guide.search.message"); ChatInput.waitForPlayer(SlimefunPlugin.instance, pl, msg -> SlimefunGuide.openSearch(profile, msg, isSurvivalMode(), isSurvivalMode())); return false; @@ -576,7 +589,7 @@ public class ChestSlimefunGuide implements SlimefunGuideImplementation { } else { - menu.addItem(slot, new CustomItem(ChestMenuUtils.getBackButton(p, "", ChatColor.GRAY + SlimefunPlugin.getLocal().getMessage(p, "guide.back.guide")))); + menu.addItem(slot, new CustomItem(ChestMenuUtils.getBackButton(p, "", ChatColor.GRAY + SlimefunPlugin.getLocalization().getMessage(p, "guide.back.guide")))); menu.addMenuClickHandler(slot, (pl, s, is, action) -> { openMainMenu(profile, 1); return false; @@ -593,7 +606,7 @@ public class ChestSlimefunGuide implements SlimefunGuideImplementation { } String lore = Slimefun.hasPermission(p, slimefunItem, false) ? "&fNeeds to be unlocked elsewhere" : "&fNo Permission"; - return Slimefun.hasUnlocked(p, slimefunItem, false) ? item : new CustomItem(Material.BARRIER, ItemUtils.getItemName(item), "&4&l" + SlimefunPlugin.getLocal().getMessage(p, "guide.locked"), "", lore); + return Slimefun.hasUnlocked(p, slimefunItem, false) ? item : new CustomItem(Material.BARRIER, ItemUtils.getItemName(item), "&4&l" + SlimefunPlugin.getLocalization().getMessage(p, "guide.locked"), "", lore); } else { return item; @@ -681,7 +694,7 @@ public class ChestSlimefunGuide implements SlimefunGuideImplementation { } private ChestMenu create(Player p) { - ChestMenu menu = new ChestMenu(SlimefunPlugin.getLocal().getMessage(p, "guide.title.main")); + ChestMenu menu = new ChestMenu(SlimefunPlugin.getLocalization().getMessage(p, "guide.title.main")); menu.setEmptySlotsClickable(false); menu.addMenuOpeningHandler(pl -> pl.playSound(pl.getLocation(), sound, 1, 1)); diff --git a/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/guide/RecipeChoiceTask.java b/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/guide/RecipeChoiceTask.java index 96e27ffbf..f48420ec3 100644 --- a/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/guide/RecipeChoiceTask.java +++ b/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/guide/RecipeChoiceTask.java @@ -13,7 +13,7 @@ import org.bukkit.inventory.Recipe; import org.bukkit.inventory.RecipeChoice.MaterialChoice; import io.github.thebusybiscuit.cscorelib2.collections.LoopIterator; -import me.mrCookieSlime.Slimefun.SlimefunPlugin; +import io.github.thebusybiscuit.slimefun4.implementation.SlimefunPlugin; /** * A {@link RecipeChoiceTask} is an asynchronously repeating task that cycles diff --git a/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/items/altar/AncientPedestal.java b/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/items/altar/AncientPedestal.java index e9893ea18..8c2242596 100644 --- a/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/items/altar/AncientPedestal.java +++ b/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/items/altar/AncientPedestal.java @@ -3,8 +3,8 @@ package io.github.thebusybiscuit.slimefun4.implementation.items.altar; import org.bukkit.entity.Item; import org.bukkit.inventory.ItemStack; +import io.github.thebusybiscuit.slimefun4.implementation.SlimefunPlugin; import io.github.thebusybiscuit.slimefun4.implementation.listeners.AncientAltarListener; -import me.mrCookieSlime.Slimefun.SlimefunPlugin; import me.mrCookieSlime.Slimefun.Lists.RecipeType; import me.mrCookieSlime.Slimefun.Objects.Category; import me.mrCookieSlime.Slimefun.Objects.SlimefunItem.SlimefunItem; diff --git a/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/items/androids/AdvancedFarmerAndroid.java b/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/items/androids/AdvancedFarmerAndroid.java index 1c94c55e2..d3cf5d9ce 100644 --- a/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/items/androids/AdvancedFarmerAndroid.java +++ b/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/items/androids/AdvancedFarmerAndroid.java @@ -7,7 +7,7 @@ import org.bukkit.block.Block; import org.bukkit.entity.Player; import org.bukkit.inventory.ItemStack; -import me.mrCookieSlime.Slimefun.SlimefunPlugin; +import io.github.thebusybiscuit.slimefun4.implementation.SlimefunPlugin; import me.mrCookieSlime.Slimefun.Lists.RecipeType; import me.mrCookieSlime.Slimefun.Objects.Category; import me.mrCookieSlime.Slimefun.api.SlimefunItemStack; diff --git a/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/items/androids/ButcherAndroid.java b/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/items/androids/ButcherAndroid.java index f85145f3b..f0580738c 100644 --- a/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/items/androids/ButcherAndroid.java +++ b/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/items/androids/ButcherAndroid.java @@ -11,7 +11,7 @@ import org.bukkit.entity.Player; import org.bukkit.inventory.ItemStack; import org.bukkit.metadata.FixedMetadataValue; -import me.mrCookieSlime.Slimefun.SlimefunPlugin; +import io.github.thebusybiscuit.slimefun4.implementation.SlimefunPlugin; import me.mrCookieSlime.Slimefun.Lists.RecipeType; import me.mrCookieSlime.Slimefun.Objects.Category; import me.mrCookieSlime.Slimefun.api.BlockStorage; diff --git a/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/items/androids/FarmerAndroid.java b/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/items/androids/FarmerAndroid.java index 4b32d5239..2edd555eb 100644 --- a/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/items/androids/FarmerAndroid.java +++ b/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/items/androids/FarmerAndroid.java @@ -11,7 +11,7 @@ import org.bukkit.block.data.BlockData; import org.bukkit.inventory.ItemStack; import io.github.thebusybiscuit.slimefun4.api.MinecraftVersion; -import me.mrCookieSlime.Slimefun.SlimefunPlugin; +import io.github.thebusybiscuit.slimefun4.implementation.SlimefunPlugin; import me.mrCookieSlime.Slimefun.Lists.RecipeType; import me.mrCookieSlime.Slimefun.Objects.Category; import me.mrCookieSlime.Slimefun.api.SlimefunItemStack; diff --git a/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/items/androids/FisherAndroid.java b/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/items/androids/FisherAndroid.java index e9de8d50d..e5e98b92c 100644 --- a/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/items/androids/FisherAndroid.java +++ b/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/items/androids/FisherAndroid.java @@ -11,7 +11,7 @@ import org.bukkit.inventory.ItemStack; import io.github.thebusybiscuit.cscorelib2.collections.RandomizedSet; import io.github.thebusybiscuit.cscorelib2.materials.MaterialCollections; import io.github.thebusybiscuit.slimefun4.api.MinecraftVersion; -import me.mrCookieSlime.Slimefun.SlimefunPlugin; +import io.github.thebusybiscuit.slimefun4.implementation.SlimefunPlugin; import me.mrCookieSlime.Slimefun.Lists.RecipeType; import me.mrCookieSlime.Slimefun.Objects.Category; import me.mrCookieSlime.Slimefun.api.SlimefunItemStack; diff --git a/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/items/androids/MinerAndroid.java b/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/items/androids/MinerAndroid.java index 228b4678e..2553ba4d8 100644 --- a/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/items/androids/MinerAndroid.java +++ b/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/items/androids/MinerAndroid.java @@ -13,7 +13,7 @@ import org.bukkit.inventory.ItemStack; import io.github.thebusybiscuit.cscorelib2.materials.MaterialCollections; import io.github.thebusybiscuit.cscorelib2.protection.ProtectableAction; import io.github.thebusybiscuit.slimefun4.api.events.AndroidMineEvent; -import me.mrCookieSlime.Slimefun.SlimefunPlugin; +import io.github.thebusybiscuit.slimefun4.implementation.SlimefunPlugin; import me.mrCookieSlime.Slimefun.Lists.RecipeType; import me.mrCookieSlime.Slimefun.Objects.Category; import me.mrCookieSlime.Slimefun.Objects.SlimefunItem.SlimefunItem; diff --git a/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/items/androids/ProgrammableAndroid.java b/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/items/androids/ProgrammableAndroid.java index e3a87fd1d..d963bf588 100644 --- a/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/items/androids/ProgrammableAndroid.java +++ b/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/items/androids/ProgrammableAndroid.java @@ -31,6 +31,7 @@ import io.github.thebusybiscuit.cscorelib2.item.CustomItem; import io.github.thebusybiscuit.cscorelib2.skull.SkullBlock; import io.github.thebusybiscuit.slimefun4.core.attributes.RecipeDisplayItem; import io.github.thebusybiscuit.slimefun4.implementation.SlimefunItems; +import io.github.thebusybiscuit.slimefun4.implementation.SlimefunPlugin; import io.github.thebusybiscuit.slimefun4.utils.ChestMenuUtils; import io.github.thebusybiscuit.slimefun4.utils.NumberUtils; import io.github.thebusybiscuit.slimefun4.utils.PatternUtils; @@ -39,7 +40,6 @@ import me.mrCookieSlime.CSCoreLibPlugin.Configuration.Config; import me.mrCookieSlime.CSCoreLibPlugin.general.Inventory.ChestMenu; import me.mrCookieSlime.CSCoreLibPlugin.general.Inventory.ChestMenu.AdvancedMenuClickHandler; import me.mrCookieSlime.CSCoreLibPlugin.general.Inventory.ClickAction; -import me.mrCookieSlime.Slimefun.SlimefunPlugin; import me.mrCookieSlime.Slimefun.Lists.RecipeType; import me.mrCookieSlime.Slimefun.Objects.Category; import me.mrCookieSlime.Slimefun.Objects.SlimefunBlockHandler; @@ -82,7 +82,7 @@ public abstract class ProgrammableAndroid extends SlimefunItem implements Invent boolean open = BlockStorage.getLocationInfo(b.getLocation(), "owner").equals(p.getUniqueId().toString()) || p.hasPermission("slimefun.android.bypass"); if (!open) { - SlimefunPlugin.getLocal().sendMessage(p, "inventory.no-access", true); + SlimefunPlugin.getLocalization().sendMessage(p, "inventory.no-access", true); } return open; @@ -92,7 +92,7 @@ public abstract class ProgrammableAndroid extends SlimefunItem implements Invent public void newInstance(BlockMenu menu, Block b) { menu.replaceExistingItem(15, new CustomItem(SlimefunUtils.getCustomHead("e01c7b5726178974b3b3a01b42a590e54366026fd43808f2a787648843a7f5a"), "&aStart/Continue")); menu.addMenuClickHandler(15, (p, slot, item, action) -> { - SlimefunPlugin.getLocal().sendMessage(p, "android.started", true); + SlimefunPlugin.getLocalization().sendMessage(p, "android.started", true); BlockStorage.addBlockInfo(b, "paused", "false"); p.closeInventory(); return false; @@ -101,14 +101,14 @@ public abstract class ProgrammableAndroid extends SlimefunItem implements Invent menu.replaceExistingItem(17, new CustomItem(SlimefunUtils.getCustomHead("16139fd1c5654e56e9e4e2c8be7eb2bd5b499d633616663feee99b74352ad64"), "&4Pause")); menu.addMenuClickHandler(17, (p, slot, item, action) -> { BlockStorage.addBlockInfo(b, "paused", "true"); - SlimefunPlugin.getLocal().sendMessage(p, "android.stopped", true); + SlimefunPlugin.getLocalization().sendMessage(p, "android.stopped", true); return false; }); menu.replaceExistingItem(16, new CustomItem(SlimefunUtils.getCustomHead("d78f2b7e5e75639ea7fb796c35d364c4df28b4243e66b76277aadcd6261337"), "&bMemory Core", "", "&8\u21E8 &7Click to open the Script Editor")); menu.addMenuClickHandler(16, (p, slot, item, action) -> { BlockStorage.addBlockInfo(b, "paused", "true"); - SlimefunPlugin.getLocal().sendMessage(p, "android.stopped", true); + SlimefunPlugin.getLocalization().sendMessage(p, "android.stopped", true); openScriptEditor(p, b); return false; }); @@ -211,9 +211,9 @@ public abstract class ProgrammableAndroid extends SlimefunItem implements Invent } public void openScript(Player p, Block b, String sourceCode) { - ChestMenu menu = new ChestMenu(ChatColor.DARK_AQUA + SlimefunPlugin.getLocal().getMessage(p, "android.scripts.editor")); + ChestMenu menu = new ChestMenu(ChatColor.DARK_AQUA + SlimefunPlugin.getLocalization().getMessage(p, "android.scripts.editor")); - menu.addItem(0, new CustomItem(Instruction.START.getItem(), SlimefunPlugin.getLocal().getMessage(p, "android.scripts.instructions.START"), "", "&7\u21E8 &eLeft Click &7to return to the Android's interface")); + menu.addItem(0, new CustomItem(Instruction.START.getItem(), SlimefunPlugin.getLocalization().getMessage(p, "android.scripts.instructions.START"), "", "&7\u21E8 &eLeft Click &7to return to the Android's interface")); menu.addMenuClickHandler(0, (pl, slot, item, action) -> { BlockStorage.getInventory(b).open(pl); return false; @@ -236,7 +236,7 @@ public abstract class ProgrammableAndroid extends SlimefunItem implements Invent } int slot = i + (hasFreeSlot ? 1 : 0); - menu.addItem(slot, new CustomItem(Instruction.REPEAT.getItem(), SlimefunPlugin.getLocal().getMessage(p, "android.scripts.instructions.REPEAT"), "", "&7\u21E8 &eLeft Click &7to return to the Android's interface")); + menu.addItem(slot, new CustomItem(Instruction.REPEAT.getItem(), SlimefunPlugin.getLocalization().getMessage(p, "android.scripts.instructions.REPEAT"), "", "&7\u21E8 &eLeft Click &7to return to the Android's interface")); menu.addMenuClickHandler(slot, (pl, s, item, action) -> { BlockStorage.getInventory(b).open(pl); return false; @@ -244,7 +244,7 @@ public abstract class ProgrammableAndroid extends SlimefunItem implements Invent } else { ItemStack stack = Instruction.valueOf(script[i]).getItem(); - menu.addItem(i, new CustomItem(stack, SlimefunPlugin.getLocal().getMessage(p, "android.scripts.instructions." + Instruction.valueOf(script[i]).name()), "", "&7\u21E8 &eLeft Click &7to edit", "&7\u21E8 &eRight Click &7to delete", "&7\u21E8 &eShift + Right Click &7to duplicate")); + menu.addItem(i, new CustomItem(stack, SlimefunPlugin.getLocalization().getMessage(p, "android.scripts.instructions." + Instruction.valueOf(script[i]).name()), "", "&7\u21E8 &eLeft Click &7to edit", "&7\u21E8 &eRight Click &7to delete", "&7\u21E8 &eShift + Right Click &7to duplicate")); menu.addMenuClickHandler(i, (pl, slot, item, action) -> { if (action.isRightClicked() && action.isShiftClicked()) { if (script.length == 54) { @@ -406,14 +406,14 @@ public abstract class ProgrammableAndroid extends SlimefunItem implements Invent menu.addItem(index, item, (player, slot, stack, action) -> { if (action.isShiftClicked()) { if (script.isAuthor(player)) { - SlimefunPlugin.getLocal().sendMessage(player, "android.scripts.rating.own", true); + SlimefunPlugin.getLocalization().sendMessage(player, "android.scripts.rating.own", true); } else if (script.canRate(player)) { script.rate(player, !action.isRightClicked()); openScriptDownloader(player, b, page); } else { - SlimefunPlugin.getLocal().sendMessage(player, "android.scripts.rating.already", true); + SlimefunPlugin.getLocalization().sendMessage(player, "android.scripts.rating.already", true); } } else if (!action.isRightClicked()) { @@ -447,24 +447,24 @@ public abstract class ProgrammableAndroid extends SlimefunItem implements Invent } if (script.getSourceCode().equals(code)) { - SlimefunPlugin.getLocal().sendMessage(p, "android.scripts.already-uploaded", true); + SlimefunPlugin.getLocalization().sendMessage(p, "android.scripts.already-uploaded", true); return; } } p.closeInventory(); - SlimefunPlugin.getLocal().sendMessages(p, "android.scripts.enter-name"); + SlimefunPlugin.getLocalization().sendMessages(p, "android.scripts.enter-name"); int id = nextId; ChatInput.waitForPlayer(SlimefunPlugin.instance, p, msg -> { Script.upload(p, getAndroidType(), id, msg, code); - SlimefunPlugin.getLocal().sendMessages(p, "android.scripts.uploaded"); + SlimefunPlugin.getLocalization().sendMessages(p, "android.scripts.uploaded"); openScriptDownloader(p, b, page); }); } public void openScriptEditor(Player p, Block b) { - ChestMenu menu = new ChestMenu(ChatColor.DARK_AQUA + SlimefunPlugin.getLocal().getMessage(p, "android.scripts.editor")); + ChestMenu menu = new ChestMenu(ChatColor.DARK_AQUA + SlimefunPlugin.getLocalization().getMessage(p, "android.scripts.editor")); menu.addItem(1, new CustomItem(SlimefunUtils.getCustomHead("d9bf6db4aeda9d8822b9f736538e8c18b9a4844f84eb45504adfbfee87eb"), "&2> Edit Script", "", "&aEdits your current Script")); menu.addMenuClickHandler(1, (pl, slot, item, action) -> { @@ -515,7 +515,7 @@ public abstract class ProgrammableAndroid extends SlimefunItem implements Invent } protected void editInstruction(Player p, Block b, String[] script, int index) { - ChestMenu menu = new ChestMenu(ChatColor.DARK_AQUA + SlimefunPlugin.getLocal().getMessage(p, "android.scripts.editor")); + ChestMenu menu = new ChestMenu(ChatColor.DARK_AQUA + SlimefunPlugin.getLocalization().getMessage(p, "android.scripts.editor")); ChestMenuUtils.drawBackground(menu, 0, 1, 2, 3, 4, 5, 6, 7, 8); menu.addItem(9, new CustomItem(SlimefunUtils.getCustomHead("16139fd1c5654e56e9e4e2c8be7eb2bd5b499d633616663feee99b74352ad64"), "&rDo nothing"), (pl, slot, item, action) -> { @@ -527,7 +527,7 @@ public abstract class ProgrammableAndroid extends SlimefunItem implements Invent int i = 10; for (Instruction instruction : getValidScriptInstructions()) { - menu.addItem(i, new CustomItem(instruction.getItem(), SlimefunPlugin.getLocal().getMessage(p, "android.scripts.instructions." + instruction.name())), (pl, slot, item, action) -> { + menu.addItem(i, new CustomItem(instruction.getItem(), SlimefunPlugin.getLocalization().getMessage(p, "android.scripts.instructions." + instruction.name())), (pl, slot, item, action) -> { String code = addInstruction(script, index, instruction); setScript(b.getLocation(), code); openScript(p, b, code); diff --git a/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/items/androids/WoodcutterAndroid.java b/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/items/androids/WoodcutterAndroid.java index 780c9ae02..735e8bade 100644 --- a/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/items/androids/WoodcutterAndroid.java +++ b/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/items/androids/WoodcutterAndroid.java @@ -15,7 +15,7 @@ import io.github.thebusybiscuit.cscorelib2.blocks.Vein; import io.github.thebusybiscuit.cscorelib2.materials.MaterialCollections; import io.github.thebusybiscuit.cscorelib2.materials.MaterialConverter; import io.github.thebusybiscuit.cscorelib2.protection.ProtectableAction; -import me.mrCookieSlime.Slimefun.SlimefunPlugin; +import io.github.thebusybiscuit.slimefun4.implementation.SlimefunPlugin; import me.mrCookieSlime.Slimefun.Lists.RecipeType; import me.mrCookieSlime.Slimefun.Objects.Category; import me.mrCookieSlime.Slimefun.api.BlockStorage; diff --git a/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/items/backpacks/SlimefunBackpack.java b/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/items/backpacks/SlimefunBackpack.java index 84989af45..aee23c7f0 100644 --- a/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/items/backpacks/SlimefunBackpack.java +++ b/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/items/backpacks/SlimefunBackpack.java @@ -5,8 +5,8 @@ import org.bukkit.inventory.Inventory; import org.bukkit.inventory.ItemStack; import io.github.thebusybiscuit.slimefun4.api.player.PlayerBackpack; +import io.github.thebusybiscuit.slimefun4.implementation.SlimefunPlugin; import io.github.thebusybiscuit.slimefun4.implementation.listeners.BackpackListener; -import me.mrCookieSlime.Slimefun.SlimefunPlugin; import me.mrCookieSlime.Slimefun.Lists.RecipeType; import me.mrCookieSlime.Slimefun.Objects.Category; import me.mrCookieSlime.Slimefun.Objects.SlimefunItem.SimpleSlimefunItem; diff --git a/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/items/blocks/BlockPlacer.java b/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/items/blocks/BlockPlacer.java index 2b8c95a48..874a31794 100644 --- a/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/items/blocks/BlockPlacer.java +++ b/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/items/blocks/BlockPlacer.java @@ -19,7 +19,7 @@ import io.github.thebusybiscuit.cscorelib2.item.CustomItem; import io.github.thebusybiscuit.cscorelib2.materials.MaterialCollections; import io.github.thebusybiscuit.slimefun4.api.items.ItemSetting; import io.github.thebusybiscuit.slimefun4.core.attributes.NotPlaceable; -import me.mrCookieSlime.Slimefun.SlimefunPlugin; +import io.github.thebusybiscuit.slimefun4.implementation.SlimefunPlugin; import me.mrCookieSlime.Slimefun.Lists.RecipeType; import me.mrCookieSlime.Slimefun.Objects.Category; import me.mrCookieSlime.Slimefun.Objects.SlimefunItem.SimpleSlimefunItem; diff --git a/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/items/blocks/Composter.java b/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/items/blocks/Composter.java index 096d69b52..6c09d146d 100644 --- a/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/items/blocks/Composter.java +++ b/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/items/blocks/Composter.java @@ -20,8 +20,8 @@ import io.github.thebusybiscuit.cscorelib2.materials.MaterialCollections; import io.github.thebusybiscuit.cscorelib2.protection.ProtectableAction; import io.github.thebusybiscuit.cscorelib2.scheduling.TaskQueue; import io.github.thebusybiscuit.slimefun4.core.attributes.RecipeDisplayItem; +import io.github.thebusybiscuit.slimefun4.implementation.SlimefunPlugin; import io.github.thebusybiscuit.slimefun4.utils.SlimefunUtils; -import me.mrCookieSlime.Slimefun.SlimefunPlugin; import me.mrCookieSlime.Slimefun.Lists.RecipeType; import me.mrCookieSlime.Slimefun.Objects.Category; import me.mrCookieSlime.Slimefun.Objects.SlimefunItem.SimpleSlimefunItem; @@ -101,7 +101,7 @@ public class Composter extends SimpleSlimefunItem implements Re tasks.execute(SlimefunPlugin.instance); } else { - SlimefunPlugin.getLocal().sendMessage(p, "machines.wrong-item", true); + SlimefunPlugin.getLocalization().sendMessage(p, "machines.wrong-item", true); } } } diff --git a/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/items/blocks/Crucible.java b/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/items/blocks/Crucible.java index 2e6de5d10..48dfec049 100644 --- a/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/items/blocks/Crucible.java +++ b/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/items/blocks/Crucible.java @@ -17,8 +17,8 @@ import org.bukkit.inventory.ItemStack; import io.github.thebusybiscuit.cscorelib2.materials.MaterialCollections; import io.github.thebusybiscuit.cscorelib2.protection.ProtectableAction; import io.github.thebusybiscuit.slimefun4.core.attributes.RecipeDisplayItem; +import io.github.thebusybiscuit.slimefun4.implementation.SlimefunPlugin; import io.github.thebusybiscuit.slimefun4.utils.SlimefunUtils; -import me.mrCookieSlime.Slimefun.SlimefunPlugin; import me.mrCookieSlime.Slimefun.Lists.RecipeType; import me.mrCookieSlime.Slimefun.Objects.Category; import me.mrCookieSlime.Slimefun.Objects.SlimefunItem.SimpleSlimefunItem; @@ -93,7 +93,7 @@ public class Crucible extends SimpleSlimefunItem implements Rec generateLiquid(block, water); } else { - SlimefunPlugin.getLocal().sendMessage(p, "machines.wrong-item", true); + SlimefunPlugin.getLocalization().sendMessage(p, "machines.wrong-item", true); } } } diff --git a/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/items/blocks/HologramProjector.java b/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/items/blocks/HologramProjector.java index 08dadfda9..24a68ac93 100644 --- a/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/items/blocks/HologramProjector.java +++ b/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/items/blocks/HologramProjector.java @@ -11,10 +11,10 @@ import org.bukkit.inventory.ItemStack; import io.github.thebusybiscuit.cscorelib2.chat.ChatColors; import io.github.thebusybiscuit.cscorelib2.item.CustomItem; import io.github.thebusybiscuit.cscorelib2.math.DoubleHandler; +import io.github.thebusybiscuit.slimefun4.implementation.SlimefunPlugin; import io.github.thebusybiscuit.slimefun4.utils.ChatUtils; import io.github.thebusybiscuit.slimefun4.utils.holograms.SimpleHologram; import me.mrCookieSlime.CSCoreLibPlugin.general.Inventory.ChestMenu; -import me.mrCookieSlime.Slimefun.SlimefunPlugin; import me.mrCookieSlime.Slimefun.Lists.RecipeType; import me.mrCookieSlime.Slimefun.Objects.Category; import me.mrCookieSlime.Slimefun.Objects.SlimefunBlockHandler; @@ -64,12 +64,12 @@ public class HologramProjector extends SimpleSlimefunItem { } private static void openEditor(Player p, Block projector) { - ChestMenu menu = new ChestMenu(SlimefunPlugin.getLocal().getMessage(p, "machines.HOLOGRAM_PROJECTOR.inventory-title")); + ChestMenu menu = new ChestMenu(SlimefunPlugin.getLocalization().getMessage(p, "machines.HOLOGRAM_PROJECTOR.inventory-title")); menu.addItem(0, new CustomItem(Material.NAME_TAG, "&7Text &e(Click to edit)", "", "&r" + ChatColors.color(BlockStorage.getLocationInfo(projector.getLocation(), "text")))); menu.addMenuClickHandler(0, (pl, slot, item, action) -> { pl.closeInventory(); - SlimefunPlugin.getLocal().sendMessage(pl, "machines.HOLOGRAM_PROJECTOR.enter-text", true); + SlimefunPlugin.getLocalization().sendMessage(pl, "machines.HOLOGRAM_PROJECTOR.enter-text", true); ChatUtils.awaitInput(pl, message -> { ArmorStand hologram = getArmorStand(projector, true); diff --git a/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/items/cargo/AbstractCargoNode.java b/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/items/cargo/AbstractCargoNode.java index c1f66c733..79f38daa7 100644 --- a/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/items/cargo/AbstractCargoNode.java +++ b/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/items/cargo/AbstractCargoNode.java @@ -5,8 +5,8 @@ import org.bukkit.entity.Player; import org.bukkit.inventory.ItemStack; import io.github.thebusybiscuit.cscorelib2.protection.ProtectableAction; +import io.github.thebusybiscuit.slimefun4.implementation.SlimefunPlugin; import io.github.thebusybiscuit.slimefun4.utils.ChatUtils; -import me.mrCookieSlime.Slimefun.SlimefunPlugin; import me.mrCookieSlime.Slimefun.Lists.RecipeType; import me.mrCookieSlime.Slimefun.Objects.Category; import me.mrCookieSlime.Slimefun.Objects.SlimefunItem.SlimefunItem; diff --git a/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/items/cargo/AdvancedCargoOutputNode.java b/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/items/cargo/AdvancedCargoOutputNode.java index fce306a53..49694f7fe 100644 --- a/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/items/cargo/AdvancedCargoOutputNode.java +++ b/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/items/cargo/AdvancedCargoOutputNode.java @@ -9,9 +9,9 @@ import org.bukkit.inventory.meta.ItemMeta; import io.github.thebusybiscuit.cscorelib2.item.CustomItem; import io.github.thebusybiscuit.cscorelib2.materials.MaterialCollections; +import io.github.thebusybiscuit.slimefun4.implementation.SlimefunPlugin; import io.github.thebusybiscuit.slimefun4.utils.ChestMenuUtils; import io.github.thebusybiscuit.slimefun4.utils.SlimefunUtils; -import me.mrCookieSlime.Slimefun.SlimefunPlugin; import me.mrCookieSlime.Slimefun.Lists.RecipeType; import me.mrCookieSlime.Slimefun.Objects.Category; import me.mrCookieSlime.Slimefun.Objects.SlimefunBlockHandler; diff --git a/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/items/cargo/CargoInputNode.java b/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/items/cargo/CargoInputNode.java index ae2d310d0..3d576c435 100644 --- a/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/items/cargo/CargoInputNode.java +++ b/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/items/cargo/CargoInputNode.java @@ -9,9 +9,9 @@ import org.bukkit.inventory.meta.ItemMeta; import io.github.thebusybiscuit.cscorelib2.item.CustomItem; import io.github.thebusybiscuit.cscorelib2.materials.MaterialCollections; +import io.github.thebusybiscuit.slimefun4.implementation.SlimefunPlugin; import io.github.thebusybiscuit.slimefun4.utils.ChestMenuUtils; import io.github.thebusybiscuit.slimefun4.utils.SlimefunUtils; -import me.mrCookieSlime.Slimefun.SlimefunPlugin; import me.mrCookieSlime.Slimefun.Lists.RecipeType; import me.mrCookieSlime.Slimefun.Objects.Category; import me.mrCookieSlime.Slimefun.Objects.SlimefunBlockHandler; diff --git a/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/items/cargo/CargoOutputNode.java b/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/items/cargo/CargoOutputNode.java index b3fe76d0f..668d55141 100644 --- a/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/items/cargo/CargoOutputNode.java +++ b/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/items/cargo/CargoOutputNode.java @@ -7,9 +7,9 @@ import org.bukkit.inventory.ItemStack; import io.github.thebusybiscuit.cscorelib2.item.CustomItem; import io.github.thebusybiscuit.cscorelib2.materials.MaterialCollections; +import io.github.thebusybiscuit.slimefun4.implementation.SlimefunPlugin; import io.github.thebusybiscuit.slimefun4.utils.ChestMenuUtils; import io.github.thebusybiscuit.slimefun4.utils.SlimefunUtils; -import me.mrCookieSlime.Slimefun.SlimefunPlugin; import me.mrCookieSlime.Slimefun.Lists.RecipeType; import me.mrCookieSlime.Slimefun.Objects.Category; import me.mrCookieSlime.Slimefun.Objects.SlimefunBlockHandler; diff --git a/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/items/cargo/ReactorAccessPort.java b/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/items/cargo/ReactorAccessPort.java index 123b93e74..3546efb22 100644 --- a/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/items/cargo/ReactorAccessPort.java +++ b/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/items/cargo/ReactorAccessPort.java @@ -9,10 +9,10 @@ import org.bukkit.inventory.ItemStack; import io.github.thebusybiscuit.cscorelib2.item.CustomItem; import io.github.thebusybiscuit.cscorelib2.protection.ProtectableAction; import io.github.thebusybiscuit.slimefun4.implementation.SlimefunItems; +import io.github.thebusybiscuit.slimefun4.implementation.SlimefunPlugin; import io.github.thebusybiscuit.slimefun4.implementation.items.electric.reactors.Reactor; import io.github.thebusybiscuit.slimefun4.utils.ChestMenuUtils; import io.github.thebusybiscuit.slimefun4.utils.SlimefunUtils; -import me.mrCookieSlime.Slimefun.SlimefunPlugin; import me.mrCookieSlime.Slimefun.Lists.RecipeType; import me.mrCookieSlime.Slimefun.Objects.Category; import me.mrCookieSlime.Slimefun.Objects.SlimefunItem.SlimefunItem; diff --git a/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/items/electric/gadgets/MultiTool.java b/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/items/electric/gadgets/MultiTool.java index 9fd98d226..0171cdc7e 100644 --- a/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/items/electric/gadgets/MultiTool.java +++ b/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/items/electric/gadgets/MultiTool.java @@ -11,7 +11,7 @@ import org.bukkit.entity.Player; import org.bukkit.inventory.ItemStack; import io.github.thebusybiscuit.slimefun4.core.attributes.Rechargeable; -import me.mrCookieSlime.Slimefun.SlimefunPlugin; +import io.github.thebusybiscuit.slimefun4.implementation.SlimefunPlugin; import me.mrCookieSlime.Slimefun.Lists.RecipeType; import me.mrCookieSlime.Slimefun.Objects.Category; import me.mrCookieSlime.Slimefun.Objects.SlimefunItem.SlimefunItem; @@ -64,7 +64,7 @@ public class MultiTool extends SlimefunItem implements Rechargeable { SlimefunItem selectedItem = modes.get(index).getItem(); String itemName = selectedItem != null ? selectedItem.getItemName() : "Unknown"; - SlimefunPlugin.getLocal().sendMessage(p, "messages.mode-change", true, msg -> msg.replace("%device%", "Multi Tool").replace("%mode%", ChatColor.stripColor(itemName))); + SlimefunPlugin.getLocalization().sendMessage(p, "messages.mode-change", true, msg -> msg.replace("%device%", "Multi Tool").replace("%mode%", ChatColor.stripColor(itemName))); selectedMode.put(p.getUniqueId(), index); } }; diff --git a/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/items/electric/gadgets/Multimeter.java b/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/items/electric/gadgets/Multimeter.java index 0c1df7c5f..6955c9105 100644 --- a/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/items/electric/gadgets/Multimeter.java +++ b/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/items/electric/gadgets/Multimeter.java @@ -7,7 +7,7 @@ import org.bukkit.entity.Player; import org.bukkit.inventory.ItemStack; import io.github.thebusybiscuit.cscorelib2.math.DoubleHandler; -import me.mrCookieSlime.Slimefun.SlimefunPlugin; +import io.github.thebusybiscuit.slimefun4.implementation.SlimefunPlugin; import me.mrCookieSlime.Slimefun.Lists.RecipeType; import me.mrCookieSlime.Slimefun.Objects.Category; import me.mrCookieSlime.Slimefun.Objects.SlimefunItem.SimpleSlimefunItem; @@ -37,7 +37,7 @@ public class Multimeter extends SimpleSlimefunItem { Player p = e.getPlayer(); p.sendMessage(""); - SlimefunPlugin.getLocal().sendMessage(p, "messages.multimeter", false, str -> str.replace("%stored%", stored).replace("%capacity%", capacity)); + SlimefunPlugin.getLocalization().sendMessage(p, "messages.multimeter", false, str -> str.replace("%stored%", stored).replace("%capacity%", capacity)); p.sendMessage(""); } } diff --git a/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/items/electric/generators/BioGenerator.java b/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/items/electric/generators/BioGenerator.java index 74760383d..9582f390f 100644 --- a/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/items/electric/generators/BioGenerator.java +++ b/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/items/electric/generators/BioGenerator.java @@ -5,7 +5,7 @@ import org.bukkit.Tag; import org.bukkit.inventory.ItemStack; import io.github.thebusybiscuit.slimefun4.api.MinecraftVersion; -import me.mrCookieSlime.Slimefun.SlimefunPlugin; +import io.github.thebusybiscuit.slimefun4.implementation.SlimefunPlugin; import me.mrCookieSlime.Slimefun.Lists.RecipeType; import me.mrCookieSlime.Slimefun.Objects.Category; import me.mrCookieSlime.Slimefun.Objects.SlimefunItem.abstractItems.AGenerator; diff --git a/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/items/electric/machines/AutoBrewer.java b/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/items/electric/machines/AutoBrewer.java index e6915a671..c25218602 100644 --- a/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/items/electric/machines/AutoBrewer.java +++ b/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/items/electric/machines/AutoBrewer.java @@ -119,7 +119,6 @@ public abstract class AutoBrewer extends AContainer { if (isPotion(input1.getType()) || isPotion(input2.getType())) { boolean slot = isPotion(input1.getType()); - ItemStack potionItem = slot ? input1 : input2; ItemStack ingredient = slot ? input2 : input1; // Reject any named items @@ -127,8 +126,8 @@ public abstract class AutoBrewer extends AContainer { return null; } + ItemStack potionItem = slot ? input1 : input2; PotionMeta potion = (PotionMeta) potionItem.getItemMeta(); - ItemStack output = brew(ingredient.getType(), potionItem.getType(), potion); if (output == null) { @@ -145,7 +144,7 @@ public abstract class AutoBrewer extends AContainer { private ItemStack brew(Material input, Material potionType, PotionMeta potion) { PotionData data = potion.getBasePotionData(); - + if (data.getType() == PotionType.WATER) { if (input == Material.FERMENTED_SPIDER_EYE) { potion.setBasePotionData(new PotionData(PotionType.WEAKNESS, false, false)); diff --git a/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/items/electric/machines/AutoDisenchanter.java b/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/items/electric/machines/AutoDisenchanter.java index 782a8f760..92621dafb 100644 --- a/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/items/electric/machines/AutoDisenchanter.java +++ b/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/items/electric/machines/AutoDisenchanter.java @@ -17,10 +17,10 @@ import org.bukkit.inventory.meta.Repairable; import io.github.thebusybiscuit.cscorelib2.inventory.InvUtils; import io.github.thebusybiscuit.cscorelib2.item.CustomItem; import io.github.thebusybiscuit.slimefun4.api.events.AutoDisenchantEvent; +import io.github.thebusybiscuit.slimefun4.implementation.SlimefunPlugin; import io.github.thebusybiscuit.slimefun4.utils.ChestMenuUtils; import me.mrCookieSlime.EmeraldEnchants.EmeraldEnchants; import me.mrCookieSlime.EmeraldEnchants.ItemEnchantment; -import me.mrCookieSlime.Slimefun.SlimefunPlugin; import me.mrCookieSlime.Slimefun.Lists.RecipeType; import me.mrCookieSlime.Slimefun.Objects.Category; import me.mrCookieSlime.Slimefun.Objects.SlimefunItem.SlimefunItem; diff --git a/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/items/electric/machines/AutoEnchanter.java b/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/items/electric/machines/AutoEnchanter.java index 9a0164f90..c0db898c7 100644 --- a/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/items/electric/machines/AutoEnchanter.java +++ b/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/items/electric/machines/AutoEnchanter.java @@ -13,10 +13,10 @@ import org.bukkit.inventory.meta.EnchantmentStorageMeta; import io.github.thebusybiscuit.cscorelib2.inventory.InvUtils; import io.github.thebusybiscuit.cscorelib2.item.CustomItem; +import io.github.thebusybiscuit.slimefun4.implementation.SlimefunPlugin; import io.github.thebusybiscuit.slimefun4.utils.ChestMenuUtils; import me.mrCookieSlime.EmeraldEnchants.EmeraldEnchants; import me.mrCookieSlime.EmeraldEnchants.ItemEnchantment; -import me.mrCookieSlime.Slimefun.SlimefunPlugin; import me.mrCookieSlime.Slimefun.Lists.RecipeType; import me.mrCookieSlime.Slimefun.Objects.Category; import me.mrCookieSlime.Slimefun.Objects.SlimefunItem.SlimefunItem; diff --git a/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/items/electric/machines/AutomatedCraftingChamber.java b/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/items/electric/machines/AutomatedCraftingChamber.java index 08cfcc148..43348e0aa 100644 --- a/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/items/electric/machines/AutomatedCraftingChamber.java +++ b/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/items/electric/machines/AutomatedCraftingChamber.java @@ -15,12 +15,12 @@ import io.github.thebusybiscuit.cscorelib2.item.CustomItem; import io.github.thebusybiscuit.cscorelib2.protection.ProtectableAction; import io.github.thebusybiscuit.slimefun4.core.attributes.EnergyNetComponent; import io.github.thebusybiscuit.slimefun4.core.networks.energy.EnergyNetComponentType; +import io.github.thebusybiscuit.slimefun4.implementation.SlimefunPlugin; import me.mrCookieSlime.CSCoreLibPlugin.Configuration.Config; import me.mrCookieSlime.CSCoreLibPlugin.general.Inventory.ChestMenu.AdvancedMenuClickHandler; import me.mrCookieSlime.CSCoreLibPlugin.general.Inventory.ClickAction; import me.mrCookieSlime.CSCoreLibPlugin.general.Inventory.Item.CustomItemSerializer; import me.mrCookieSlime.CSCoreLibPlugin.general.Inventory.Item.CustomItemSerializer.ItemFlag; -import me.mrCookieSlime.Slimefun.SlimefunPlugin; import me.mrCookieSlime.Slimefun.Lists.RecipeType; import me.mrCookieSlime.Slimefun.Objects.Category; import me.mrCookieSlime.Slimefun.Objects.SlimefunBlockHandler; diff --git a/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/items/electric/machines/CropGrowthAccelerator.java b/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/items/electric/machines/CropGrowthAccelerator.java index d61483054..dc5bab316 100644 --- a/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/items/electric/machines/CropGrowthAccelerator.java +++ b/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/items/electric/machines/CropGrowthAccelerator.java @@ -14,11 +14,11 @@ import io.github.thebusybiscuit.slimefun4.api.MinecraftVersion; import io.github.thebusybiscuit.slimefun4.core.attributes.EnergyNetComponent; import io.github.thebusybiscuit.slimefun4.core.networks.energy.EnergyNetComponentType; import io.github.thebusybiscuit.slimefun4.implementation.SlimefunItems; +import io.github.thebusybiscuit.slimefun4.implementation.SlimefunPlugin; import io.github.thebusybiscuit.slimefun4.utils.ChestMenuUtils; import io.github.thebusybiscuit.slimefun4.utils.SlimefunUtils; import io.github.thebusybiscuit.slimefun4.utils.itemstack.ItemStackWrapper; import me.mrCookieSlime.CSCoreLibPlugin.Configuration.Config; -import me.mrCookieSlime.Slimefun.SlimefunPlugin; import me.mrCookieSlime.Slimefun.Lists.RecipeType; import me.mrCookieSlime.Slimefun.Objects.Category; import me.mrCookieSlime.Slimefun.Objects.SlimefunItem.SlimefunItem; diff --git a/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/items/electric/machines/ElectricDustWasher.java b/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/items/electric/machines/ElectricDustWasher.java index 94bf70331..011d8fef8 100644 --- a/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/items/electric/machines/ElectricDustWasher.java +++ b/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/items/electric/machines/ElectricDustWasher.java @@ -6,10 +6,10 @@ import org.bukkit.inventory.ItemStack; import io.github.thebusybiscuit.cscorelib2.item.CustomItem; import io.github.thebusybiscuit.slimefun4.implementation.SlimefunItems; +import io.github.thebusybiscuit.slimefun4.implementation.SlimefunPlugin; import io.github.thebusybiscuit.slimefun4.implementation.items.multiblocks.OreWasher; import io.github.thebusybiscuit.slimefun4.utils.ChestMenuUtils; import io.github.thebusybiscuit.slimefun4.utils.SlimefunUtils; -import me.mrCookieSlime.Slimefun.SlimefunPlugin; import me.mrCookieSlime.Slimefun.Lists.RecipeType; import me.mrCookieSlime.Slimefun.Objects.Category; import me.mrCookieSlime.Slimefun.Objects.SlimefunItem.abstractItems.AContainer; diff --git a/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/items/electric/machines/ElectricFurnace.java b/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/items/electric/machines/ElectricFurnace.java index b8b46b999..c631c5ad4 100644 --- a/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/items/electric/machines/ElectricFurnace.java +++ b/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/items/electric/machines/ElectricFurnace.java @@ -6,7 +6,7 @@ import org.bukkit.inventory.ItemStack; import org.bukkit.inventory.RecipeChoice; import org.bukkit.inventory.RecipeChoice.MaterialChoice; -import me.mrCookieSlime.Slimefun.SlimefunPlugin; +import io.github.thebusybiscuit.slimefun4.implementation.SlimefunPlugin; import me.mrCookieSlime.Slimefun.Lists.RecipeType; import me.mrCookieSlime.Slimefun.Objects.Category; import me.mrCookieSlime.Slimefun.Objects.SlimefunItem.abstractItems.AContainer; @@ -20,7 +20,7 @@ public abstract class ElectricFurnace extends AContainer { @Override public void registerDefaultRecipes() { - SlimefunPlugin.getMinecraftRecipes().subscribe(snapshot -> { + SlimefunPlugin.getMinecraftRecipeService().subscribe(snapshot -> { for (FurnaceRecipe recipe : snapshot.getRecipes(FurnaceRecipe.class)) { RecipeChoice choice = recipe.getInputChoice(); diff --git a/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/items/electric/machines/ElectricSmeltery.java b/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/items/electric/machines/ElectricSmeltery.java index 0d24f71e6..ee61a684a 100644 --- a/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/items/electric/machines/ElectricSmeltery.java +++ b/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/items/electric/machines/ElectricSmeltery.java @@ -13,11 +13,11 @@ import org.bukkit.inventory.ItemStack; import io.github.thebusybiscuit.cscorelib2.item.CustomItem; import io.github.thebusybiscuit.cscorelib2.protection.ProtectableAction; +import io.github.thebusybiscuit.slimefun4.implementation.SlimefunPlugin; import io.github.thebusybiscuit.slimefun4.utils.ChestMenuUtils; import io.github.thebusybiscuit.slimefun4.utils.SlimefunUtils; import me.mrCookieSlime.CSCoreLibPlugin.general.Inventory.ChestMenu.AdvancedMenuClickHandler; import me.mrCookieSlime.CSCoreLibPlugin.general.Inventory.ClickAction; -import me.mrCookieSlime.Slimefun.SlimefunPlugin; import me.mrCookieSlime.Slimefun.Lists.RecipeType; import me.mrCookieSlime.Slimefun.Objects.Category; import me.mrCookieSlime.Slimefun.Objects.SlimefunItem.abstractItems.AContainer; diff --git a/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/items/electric/machines/FoodComposter.java b/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/items/electric/machines/FoodComposter.java index 37d817556..ea89ba234 100644 --- a/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/items/electric/machines/FoodComposter.java +++ b/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/items/electric/machines/FoodComposter.java @@ -6,8 +6,8 @@ import org.bukkit.inventory.ItemStack; import io.github.thebusybiscuit.slimefun4.api.MinecraftVersion; import io.github.thebusybiscuit.slimefun4.core.attributes.RecipeDisplayItem; import io.github.thebusybiscuit.slimefun4.implementation.SlimefunItems; +import io.github.thebusybiscuit.slimefun4.implementation.SlimefunPlugin; import io.github.thebusybiscuit.slimefun4.implementation.items.misc.OrganicFertilizer; -import me.mrCookieSlime.Slimefun.SlimefunPlugin; import me.mrCookieSlime.Slimefun.Lists.RecipeType; import me.mrCookieSlime.Slimefun.Objects.Category; import me.mrCookieSlime.Slimefun.Objects.SlimefunItem.abstractItems.AContainer; diff --git a/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/items/electric/machines/FoodFabricator.java b/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/items/electric/machines/FoodFabricator.java index e86ccc5ed..2a52499e5 100644 --- a/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/items/electric/machines/FoodFabricator.java +++ b/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/items/electric/machines/FoodFabricator.java @@ -5,8 +5,8 @@ import org.bukkit.inventory.ItemStack; import io.github.thebusybiscuit.slimefun4.api.MinecraftVersion; import io.github.thebusybiscuit.slimefun4.implementation.SlimefunItems; +import io.github.thebusybiscuit.slimefun4.implementation.SlimefunPlugin; import io.github.thebusybiscuit.slimefun4.implementation.items.misc.OrganicFood; -import me.mrCookieSlime.Slimefun.SlimefunPlugin; import me.mrCookieSlime.Slimefun.Lists.RecipeType; import me.mrCookieSlime.Slimefun.Objects.Category; import me.mrCookieSlime.Slimefun.Objects.SlimefunItem.abstractItems.AContainer; diff --git a/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/items/electric/machines/HeatedPressureChamber.java b/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/items/electric/machines/HeatedPressureChamber.java index 9b1456608..2fbea6f3b 100644 --- a/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/items/electric/machines/HeatedPressureChamber.java +++ b/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/items/electric/machines/HeatedPressureChamber.java @@ -15,10 +15,10 @@ import org.bukkit.inventory.ItemStack; import io.github.thebusybiscuit.cscorelib2.item.CustomItem; import io.github.thebusybiscuit.cscorelib2.protection.ProtectableAction; import io.github.thebusybiscuit.slimefun4.implementation.SlimefunItems; +import io.github.thebusybiscuit.slimefun4.implementation.SlimefunPlugin; import io.github.thebusybiscuit.slimefun4.utils.ChestMenuUtils; import io.github.thebusybiscuit.slimefun4.utils.SlimefunUtils; import me.mrCookieSlime.CSCoreLibPlugin.Configuration.Config; -import me.mrCookieSlime.Slimefun.SlimefunPlugin; import me.mrCookieSlime.Slimefun.Lists.RecipeType; import me.mrCookieSlime.Slimefun.Objects.Category; import me.mrCookieSlime.Slimefun.Objects.SlimefunItem.SlimefunItem; diff --git a/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/items/electric/machines/WitherAssembler.java b/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/items/electric/machines/WitherAssembler.java index d71314f27..549d1f938 100644 --- a/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/items/electric/machines/WitherAssembler.java +++ b/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/items/electric/machines/WitherAssembler.java @@ -13,10 +13,10 @@ import io.github.thebusybiscuit.cscorelib2.math.DoubleHandler; import io.github.thebusybiscuit.cscorelib2.protection.ProtectableAction; import io.github.thebusybiscuit.slimefun4.core.attributes.EnergyNetComponent; import io.github.thebusybiscuit.slimefun4.core.networks.energy.EnergyNetComponentType; +import io.github.thebusybiscuit.slimefun4.implementation.SlimefunPlugin; import io.github.thebusybiscuit.slimefun4.utils.ChestMenuUtils; import io.github.thebusybiscuit.slimefun4.utils.SlimefunUtils; import me.mrCookieSlime.CSCoreLibPlugin.Configuration.Config; -import me.mrCookieSlime.Slimefun.SlimefunPlugin; import me.mrCookieSlime.Slimefun.Lists.RecipeType; import me.mrCookieSlime.Slimefun.Objects.Category; import me.mrCookieSlime.Slimefun.Objects.SlimefunBlockHandler; diff --git a/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/items/electric/reactors/Reactor.java b/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/items/electric/reactors/Reactor.java index c6a1e11f4..ec0760c28 100644 --- a/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/items/electric/reactors/Reactor.java +++ b/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/items/electric/reactors/Reactor.java @@ -19,6 +19,7 @@ import io.github.thebusybiscuit.cscorelib2.item.CustomItem; import io.github.thebusybiscuit.cscorelib2.protection.ProtectableAction; import io.github.thebusybiscuit.slimefun4.api.events.ReactorExplodeEvent; import io.github.thebusybiscuit.slimefun4.implementation.SlimefunItems; +import io.github.thebusybiscuit.slimefun4.implementation.SlimefunPlugin; import io.github.thebusybiscuit.slimefun4.implementation.items.cargo.ReactorAccessPort; import io.github.thebusybiscuit.slimefun4.implementation.items.electric.AbstractEnergyProvider; import io.github.thebusybiscuit.slimefun4.utils.ChestMenuUtils; @@ -26,7 +27,6 @@ import io.github.thebusybiscuit.slimefun4.utils.SlimefunUtils; import io.github.thebusybiscuit.slimefun4.utils.holograms.ReactorHologram; import io.github.thebusybiscuit.slimefun4.utils.holograms.SimpleHologram; import me.mrCookieSlime.CSCoreLibPlugin.Configuration.Config; -import me.mrCookieSlime.Slimefun.SlimefunPlugin; import me.mrCookieSlime.Slimefun.Lists.RecipeType; import me.mrCookieSlime.Slimefun.Objects.Category; import me.mrCookieSlime.Slimefun.Objects.SlimefunItem.SlimefunItem; diff --git a/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/items/food/DietCookie.java b/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/items/food/DietCookie.java index 9419ab0b1..683908ccb 100644 --- a/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/items/food/DietCookie.java +++ b/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/items/food/DietCookie.java @@ -5,7 +5,7 @@ import org.bukkit.inventory.ItemStack; import org.bukkit.potion.PotionEffect; import org.bukkit.potion.PotionEffectType; -import me.mrCookieSlime.Slimefun.SlimefunPlugin; +import io.github.thebusybiscuit.slimefun4.implementation.SlimefunPlugin; import me.mrCookieSlime.Slimefun.Lists.RecipeType; import me.mrCookieSlime.Slimefun.Objects.Category; import me.mrCookieSlime.Slimefun.Objects.SlimefunItem.SimpleSlimefunItem; @@ -31,7 +31,7 @@ public class DietCookie extends SimpleSlimefunItem { @Override public ItemConsumptionHandler getItemHandler() { return (e, p, item) -> { - SlimefunPlugin.getLocal().sendMessage(p, "messages.diet-cookie"); + SlimefunPlugin.getLocalization().sendMessage(p, "messages.diet-cookie"); p.playSound(p.getLocation(), Sound.ENTITY_GENERIC_EAT, 1, 1); if (p.hasPotionEffect(PotionEffectType.LEVITATION)) { diff --git a/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/items/food/FortuneCookie.java b/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/items/food/FortuneCookie.java index fd2eb27d9..5797fc6e1 100644 --- a/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/items/food/FortuneCookie.java +++ b/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/items/food/FortuneCookie.java @@ -8,7 +8,7 @@ import org.bukkit.inventory.ItemStack; import io.github.thebusybiscuit.cscorelib2.chat.ChatColors; import io.github.thebusybiscuit.slimefun4.core.services.LocalizationService; -import me.mrCookieSlime.Slimefun.SlimefunPlugin; +import io.github.thebusybiscuit.slimefun4.implementation.SlimefunPlugin; import me.mrCookieSlime.Slimefun.Lists.RecipeType; import me.mrCookieSlime.Slimefun.Objects.Category; import me.mrCookieSlime.Slimefun.Objects.SlimefunItem.SimpleSlimefunItem; @@ -33,7 +33,7 @@ public class FortuneCookie extends SimpleSlimefunItem { @Override public ItemConsumptionHandler getItemHandler() { return (e, p, item) -> { - List messages = SlimefunPlugin.getLocal().getMessages(p, "messages.fortune-cookie"); + List messages = SlimefunPlugin.getLocalization().getMessages(p, "messages.fortune-cookie"); String message = messages.get(ThreadLocalRandom.current().nextInt(messages.size())); p.sendMessage(ChatColors.color(message)); diff --git a/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/items/geo/GEOMiner.java b/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/items/geo/GEOMiner.java index 7856b2ee0..ea157dcf0 100644 --- a/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/items/geo/GEOMiner.java +++ b/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/items/geo/GEOMiner.java @@ -14,11 +14,11 @@ import org.bukkit.inventory.ItemStack; import io.github.thebusybiscuit.cscorelib2.item.CustomItem; import io.github.thebusybiscuit.slimefun4.api.geo.GEOResource; import io.github.thebusybiscuit.slimefun4.core.attributes.RecipeDisplayItem; +import io.github.thebusybiscuit.slimefun4.implementation.SlimefunPlugin; import io.github.thebusybiscuit.slimefun4.utils.ChestMenuUtils; import io.github.thebusybiscuit.slimefun4.utils.holograms.SimpleHologram; import me.mrCookieSlime.CSCoreLibPlugin.general.Inventory.ChestMenu.AdvancedMenuClickHandler; import me.mrCookieSlime.CSCoreLibPlugin.general.Inventory.ClickAction; -import me.mrCookieSlime.Slimefun.SlimefunPlugin; import me.mrCookieSlime.Slimefun.Lists.RecipeType; import me.mrCookieSlime.Slimefun.Objects.Category; import me.mrCookieSlime.Slimefun.Objects.SlimefunBlockHandler; diff --git a/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/items/geo/GEOScanner.java b/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/items/geo/GEOScanner.java index 08c7f8b4e..0ab93122f 100644 --- a/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/items/geo/GEOScanner.java +++ b/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/items/geo/GEOScanner.java @@ -3,7 +3,7 @@ package io.github.thebusybiscuit.slimefun4.implementation.items.geo; import org.bukkit.block.Block; import org.bukkit.inventory.ItemStack; -import me.mrCookieSlime.Slimefun.SlimefunPlugin; +import io.github.thebusybiscuit.slimefun4.implementation.SlimefunPlugin; import me.mrCookieSlime.Slimefun.Lists.RecipeType; import me.mrCookieSlime.Slimefun.Objects.Category; import me.mrCookieSlime.Slimefun.Objects.SlimefunItem.SimpleSlimefunItem; diff --git a/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/items/geo/OilPump.java b/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/items/geo/OilPump.java index afda67198..6996a3d87 100644 --- a/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/items/geo/OilPump.java +++ b/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/items/geo/OilPump.java @@ -15,9 +15,9 @@ import io.github.thebusybiscuit.cscorelib2.protection.ProtectableAction; import io.github.thebusybiscuit.slimefun4.api.geo.GEOResource; import io.github.thebusybiscuit.slimefun4.core.attributes.RecipeDisplayItem; import io.github.thebusybiscuit.slimefun4.implementation.SlimefunItems; +import io.github.thebusybiscuit.slimefun4.implementation.SlimefunPlugin; import io.github.thebusybiscuit.slimefun4.utils.ChestMenuUtils; import io.github.thebusybiscuit.slimefun4.utils.SlimefunUtils; -import me.mrCookieSlime.Slimefun.SlimefunPlugin; import me.mrCookieSlime.Slimefun.Lists.RecipeType; import me.mrCookieSlime.Slimefun.Objects.Category; import me.mrCookieSlime.Slimefun.Objects.SlimefunItem.abstractItems.AContainer; @@ -52,7 +52,7 @@ public abstract class OilPump extends AContainer implements RecipeDisplayItem { } if (!SlimefunPlugin.getGPSNetwork().getResourceManager().getSupplies(oil, b.getWorld(), b.getX() >> 4, b.getZ() >> 4).isPresent()) { - SlimefunPlugin.getLocal().sendMessage(p, "gps.geo.scan-required", true); + SlimefunPlugin.getLocalization().sendMessage(p, "gps.geo.scan-required", true); return false; } diff --git a/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/items/geo/PortableGEOScanner.java b/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/items/geo/PortableGEOScanner.java index 5c80ebbe9..960114fce 100644 --- a/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/items/geo/PortableGEOScanner.java +++ b/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/items/geo/PortableGEOScanner.java @@ -5,7 +5,7 @@ import java.util.Optional; import org.bukkit.block.Block; import org.bukkit.inventory.ItemStack; -import me.mrCookieSlime.Slimefun.SlimefunPlugin; +import io.github.thebusybiscuit.slimefun4.implementation.SlimefunPlugin; import me.mrCookieSlime.Slimefun.Lists.RecipeType; import me.mrCookieSlime.Slimefun.Objects.Category; import me.mrCookieSlime.Slimefun.Objects.SlimefunItem.SimpleSlimefunItem; diff --git a/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/items/gps/ElevatorPlate.java b/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/items/gps/ElevatorPlate.java index c618a1d88..7505563e8 100644 --- a/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/items/gps/ElevatorPlate.java +++ b/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/items/gps/ElevatorPlate.java @@ -20,9 +20,9 @@ import io.github.thebusybiscuit.cscorelib2.chat.json.ClickEvent; import io.github.thebusybiscuit.cscorelib2.chat.json.CustomBookInterface; import io.github.thebusybiscuit.cscorelib2.chat.json.HoverEvent; import io.github.thebusybiscuit.cscorelib2.item.CustomItem; +import io.github.thebusybiscuit.slimefun4.implementation.SlimefunPlugin; import io.github.thebusybiscuit.slimefun4.utils.ChatUtils; import me.mrCookieSlime.CSCoreLibPlugin.general.Inventory.ChestMenu; -import me.mrCookieSlime.Slimefun.SlimefunPlugin; import me.mrCookieSlime.Slimefun.Lists.RecipeType; import me.mrCookieSlime.Slimefun.Objects.Category; import me.mrCookieSlime.Slimefun.Objects.SlimefunBlockHandler; @@ -102,7 +102,7 @@ public class ElevatorPlate extends SimpleSlimefunItem { List floors = getFloors(b); if (floors.size() < 2) { - SlimefunPlugin.getLocal().sendMessage(p, "machines.ELEVATOR.no-destinations", true); + SlimefunPlugin.getLocalization().sendMessage(p, "machines.ELEVATOR.no-destinations", true); } for (int i = 0; i < floors.size(); i++) { @@ -111,7 +111,7 @@ public class ElevatorPlate extends SimpleSlimefunItem { book.addPage(page); } - page = new ChatComponent(ChatColors.color(SlimefunPlugin.getLocal().getMessage(p, "machines.ELEVATOR.pick-a-floor")) + "\n"); + page = new ChatComponent(ChatColors.color(SlimefunPlugin.getLocalization().getMessage(p, "machines.ELEVATOR.pick-a-floor")) + "\n"); } Block block = floors.get(i); @@ -120,11 +120,11 @@ public class ElevatorPlate extends SimpleSlimefunItem { if (block.getY() == b.getY()) { line = new ChatComponent("\n" + ChatColor.GRAY + "> " + (floors.size() - i) + ". " + ChatColor.RESET + floor); - line.setHoverEvent(new HoverEvent(ChatColors.color(SlimefunPlugin.getLocal().getMessage(p, "machines.ELEVATOR.current-floor")), "", ChatColor.RESET + floor, "")); + line.setHoverEvent(new HoverEvent(ChatColors.color(SlimefunPlugin.getLocalization().getMessage(p, "machines.ELEVATOR.current-floor")), "", ChatColor.RESET + floor, "")); } else { line = new ChatComponent("\n" + ChatColor.GRAY.toString() + (floors.size() - i) + ". " + ChatColor.RESET + floor); - line.setHoverEvent(new HoverEvent(ChatColors.color(SlimefunPlugin.getLocal().getMessage(p, "machines.ELEVATOR.click-to-teleport")), "", ChatColor.RESET + floor, "")); + line.setHoverEvent(new HoverEvent(ChatColors.color(SlimefunPlugin.getLocalization().getMessage(p, "machines.ELEVATOR.click-to-teleport")), "", ChatColor.RESET + floor, "")); line.setClickEvent(new ClickEvent(new NamespacedKey(SlimefunPlugin.instance, DATA_KEY + i), player -> Slimefun.runSync(() -> { users.add(player.getUniqueId()); @@ -156,14 +156,14 @@ public class ElevatorPlate extends SimpleSlimefunItem { menu.addMenuClickHandler(4, (pl, slot, item, action) -> { pl.closeInventory(); pl.sendMessage(""); - SlimefunPlugin.getLocal().sendMessage(p, "machines.ELEVATOR.enter-name"); + SlimefunPlugin.getLocalization().sendMessage(p, "machines.ELEVATOR.enter-name"); pl.sendMessage(""); ChatUtils.awaitInput(pl, message -> { BlockStorage.addBlockInfo(b, DATA_KEY, message.replace(ChatColor.COLOR_CHAR, '&')); pl.sendMessage(""); - SlimefunPlugin.getLocal().sendMessage(p, "machines.ELEVATOR.named", msg -> msg.replace("%floor%", message)); + SlimefunPlugin.getLocalization().sendMessage(p, "machines.ELEVATOR.named", msg -> msg.replace("%floor%", message)); pl.sendMessage(""); openEditor(pl, b); diff --git a/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/items/gps/GPSControlPanel.java b/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/items/gps/GPSControlPanel.java index 88f0d31b0..94fc3fb67 100644 --- a/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/items/gps/GPSControlPanel.java +++ b/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/items/gps/GPSControlPanel.java @@ -2,7 +2,7 @@ package io.github.thebusybiscuit.slimefun4.implementation.items.gps; import org.bukkit.inventory.ItemStack; -import me.mrCookieSlime.Slimefun.SlimefunPlugin; +import io.github.thebusybiscuit.slimefun4.implementation.SlimefunPlugin; import me.mrCookieSlime.Slimefun.Lists.RecipeType; import me.mrCookieSlime.Slimefun.Objects.Category; import me.mrCookieSlime.Slimefun.Objects.SlimefunItem.SimpleSlimefunItem; diff --git a/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/items/gps/GPSMarkerTool.java b/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/items/gps/GPSMarkerTool.java index 8ccef0015..b03c96e5f 100644 --- a/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/items/gps/GPSMarkerTool.java +++ b/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/items/gps/GPSMarkerTool.java @@ -4,7 +4,7 @@ import org.bukkit.block.Block; import org.bukkit.inventory.ItemStack; import io.github.thebusybiscuit.slimefun4.core.attributes.NotPlaceable; -import me.mrCookieSlime.Slimefun.SlimefunPlugin; +import io.github.thebusybiscuit.slimefun4.implementation.SlimefunPlugin; import me.mrCookieSlime.Slimefun.Lists.RecipeType; import me.mrCookieSlime.Slimefun.Objects.Category; import me.mrCookieSlime.Slimefun.Objects.SlimefunItem.SimpleSlimefunItem; diff --git a/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/items/gps/GPSTransmitter.java b/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/items/gps/GPSTransmitter.java index 9523f936d..d96be8f1f 100644 --- a/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/items/gps/GPSTransmitter.java +++ b/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/items/gps/GPSTransmitter.java @@ -8,8 +8,8 @@ import org.bukkit.inventory.ItemStack; import io.github.thebusybiscuit.slimefun4.core.attributes.EnergyNetComponent; import io.github.thebusybiscuit.slimefun4.core.networks.energy.EnergyNetComponentType; +import io.github.thebusybiscuit.slimefun4.implementation.SlimefunPlugin; import me.mrCookieSlime.CSCoreLibPlugin.Configuration.Config; -import me.mrCookieSlime.Slimefun.SlimefunPlugin; import me.mrCookieSlime.Slimefun.Lists.RecipeType; import me.mrCookieSlime.Slimefun.Objects.Category; import me.mrCookieSlime.Slimefun.Objects.SlimefunBlockHandler; diff --git a/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/items/magical/KnowledgeTome.java b/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/items/magical/KnowledgeTome.java index d4980cb6a..33d05d2db 100644 --- a/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/items/magical/KnowledgeTome.java +++ b/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/items/magical/KnowledgeTome.java @@ -15,7 +15,7 @@ import io.github.thebusybiscuit.cscorelib2.chat.ChatColors; import io.github.thebusybiscuit.cscorelib2.inventory.ItemUtils; import io.github.thebusybiscuit.slimefun4.api.player.PlayerProfile; import io.github.thebusybiscuit.slimefun4.core.researching.Research; -import me.mrCookieSlime.Slimefun.SlimefunPlugin; +import io.github.thebusybiscuit.slimefun4.implementation.SlimefunPlugin; import me.mrCookieSlime.Slimefun.Lists.RecipeType; import me.mrCookieSlime.Slimefun.Objects.Category; import me.mrCookieSlime.Slimefun.Objects.SlimefunItem.SimpleSlimefunItem; @@ -50,7 +50,7 @@ public class KnowledgeTome extends SimpleSlimefunItem { UUID uuid = UUID.fromString(ChatColor.stripColor(item.getItemMeta().getLore().get(1))); if (p.getUniqueId().equals(uuid)) { - SlimefunPlugin.getLocal().sendMessage(p, "messages.no-tome-yourself"); + SlimefunPlugin.getLocalization().sendMessage(p, "messages.no-tome-yourself"); return; } diff --git a/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/items/magical/MagicalZombiePills.java b/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/items/magical/MagicalZombiePills.java index 34f89f505..a04470728 100644 --- a/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/items/magical/MagicalZombiePills.java +++ b/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/items/magical/MagicalZombiePills.java @@ -8,12 +8,12 @@ import org.bukkit.entity.ZombieVillager; import org.bukkit.inventory.ItemStack; import io.github.thebusybiscuit.slimefun4.api.MinecraftVersion; +import io.github.thebusybiscuit.slimefun4.implementation.SlimefunPlugin; import me.mrCookieSlime.Slimefun.Lists.RecipeType; import me.mrCookieSlime.Slimefun.Objects.Category; import me.mrCookieSlime.Slimefun.Objects.SlimefunItem.SimpleSlimefunItem; import me.mrCookieSlime.Slimefun.Objects.SlimefunItem.SlimefunItem; import me.mrCookieSlime.Slimefun.Objects.handlers.EntityInteractHandler; -import me.mrCookieSlime.Slimefun.SlimefunPlugin; import me.mrCookieSlime.Slimefun.api.SlimefunItemStack; /** diff --git a/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/items/magical/SoulboundRune.java b/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/items/magical/SoulboundRune.java index d84a7b6f7..a9eedcd16 100644 --- a/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/items/magical/SoulboundRune.java +++ b/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/items/magical/SoulboundRune.java @@ -13,8 +13,8 @@ import org.bukkit.inventory.ItemStack; import io.github.thebusybiscuit.slimefun4.core.attributes.Soulbound; import io.github.thebusybiscuit.slimefun4.implementation.SlimefunItems; +import io.github.thebusybiscuit.slimefun4.implementation.SlimefunPlugin; import io.github.thebusybiscuit.slimefun4.utils.SlimefunUtils; -import me.mrCookieSlime.Slimefun.SlimefunPlugin; import me.mrCookieSlime.Slimefun.Lists.RecipeType; import me.mrCookieSlime.Slimefun.Objects.Category; import me.mrCookieSlime.Slimefun.Objects.SlimefunItem.SimpleSlimefunItem; @@ -93,12 +93,12 @@ public class SoulboundRune extends SimpleSlimefunItem { item.remove(); l.getWorld().dropItemNaturally(l, target); - SlimefunPlugin.getLocal().sendMessage(p, "messages.soulbound-rune.success", true); + SlimefunPlugin.getLocalization().sendMessage(p, "messages.soulbound-rune.success", true); } }, 10L); } else { - SlimefunPlugin.getLocal().sendMessage(p, "messages.soulbound-rune.fail", true); + SlimefunPlugin.getLocalization().sendMessage(p, "messages.soulbound-rune.fail", true); } } } diff --git a/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/items/magical/StormStaff.java b/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/items/magical/StormStaff.java index 7c1849776..b6fb77951 100644 --- a/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/items/magical/StormStaff.java +++ b/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/items/magical/StormStaff.java @@ -18,7 +18,7 @@ import org.bukkit.persistence.PersistentDataType; import io.github.thebusybiscuit.cscorelib2.chat.ChatColors; import io.github.thebusybiscuit.cscorelib2.protection.ProtectableAction; import io.github.thebusybiscuit.slimefun4.implementation.SlimefunItems; -import me.mrCookieSlime.Slimefun.SlimefunPlugin; +import io.github.thebusybiscuit.slimefun4.implementation.SlimefunPlugin; import me.mrCookieSlime.Slimefun.Lists.RecipeType; import me.mrCookieSlime.Slimefun.Objects.Category; import me.mrCookieSlime.Slimefun.Objects.SlimefunItem.SimpleSlimefunItem; @@ -72,12 +72,12 @@ public class StormStaff extends SimpleSlimefunItem { useItem(p, item, loc); } else { - SlimefunPlugin.getLocal().sendMessage(p, "messages.no-pvp", true); + SlimefunPlugin.getLocalization().sendMessage(p, "messages.no-pvp", true); } } } else { - SlimefunPlugin.getLocal().sendMessage(p, "messages.hungry", true); + SlimefunPlugin.getLocalization().sendMessage(p, "messages.hungry", true); } }; } diff --git a/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/items/magical/WaterStaff.java b/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/items/magical/WaterStaff.java index ed4becf25..c460cc3a1 100644 --- a/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/items/magical/WaterStaff.java +++ b/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/items/magical/WaterStaff.java @@ -3,7 +3,7 @@ package io.github.thebusybiscuit.slimefun4.implementation.items.magical; import org.bukkit.entity.Player; import org.bukkit.inventory.ItemStack; -import me.mrCookieSlime.Slimefun.SlimefunPlugin; +import io.github.thebusybiscuit.slimefun4.implementation.SlimefunPlugin; import me.mrCookieSlime.Slimefun.Lists.RecipeType; import me.mrCookieSlime.Slimefun.Objects.Category; import me.mrCookieSlime.Slimefun.Objects.SlimefunItem.SimpleSlimefunItem; @@ -30,7 +30,7 @@ public class WaterStaff extends SimpleSlimefunItem { Player p = e.getPlayer(); p.setFireTicks(0); - SlimefunPlugin.getLocal().sendMessage(p, "messages.fire-extinguish", true); + SlimefunPlugin.getLocalization().sendMessage(p, "messages.fire-extinguish", true); }; } diff --git a/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/items/magical/WindStaff.java b/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/items/magical/WindStaff.java index 4503a5d58..b28125bed 100644 --- a/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/items/magical/WindStaff.java +++ b/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/items/magical/WindStaff.java @@ -9,7 +9,7 @@ import org.bukkit.entity.Player; import org.bukkit.event.entity.FoodLevelChangeEvent; import org.bukkit.inventory.ItemStack; -import me.mrCookieSlime.Slimefun.SlimefunPlugin; +import io.github.thebusybiscuit.slimefun4.implementation.SlimefunPlugin; import me.mrCookieSlime.Slimefun.Lists.RecipeType; import me.mrCookieSlime.Slimefun.Objects.Category; import me.mrCookieSlime.Slimefun.Objects.SlimefunItem.SimpleSlimefunItem; @@ -40,7 +40,7 @@ public class WindStaff extends SimpleSlimefunItem { p.setFallDistance(0F); } else { - SlimefunPlugin.getLocal().sendMessage(p, "messages.hungry", true); + SlimefunPlugin.getLocalization().sendMessage(p, "messages.hungry", true); } }; } diff --git a/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/items/magical/talismans/EnderTalisman.java b/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/items/magical/talismans/EnderTalisman.java index 587caf423..4790a6a1d 100644 --- a/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/items/magical/talismans/EnderTalisman.java +++ b/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/items/magical/talismans/EnderTalisman.java @@ -7,7 +7,7 @@ import org.bukkit.inventory.ItemStack; import io.github.thebusybiscuit.cscorelib2.item.CustomItem; import io.github.thebusybiscuit.slimefun4.core.categories.LockedCategory; import io.github.thebusybiscuit.slimefun4.implementation.SlimefunItems; -import me.mrCookieSlime.Slimefun.SlimefunPlugin; +import io.github.thebusybiscuit.slimefun4.implementation.SlimefunPlugin; import me.mrCookieSlime.Slimefun.api.SlimefunItemStack; /** diff --git a/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/items/magical/talismans/Talisman.java b/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/items/magical/talismans/Talisman.java index 5594a9504..e5a945025 100644 --- a/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/items/magical/talismans/Talisman.java +++ b/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/items/magical/talismans/Talisman.java @@ -22,7 +22,7 @@ import org.bukkit.potion.PotionEffect; import io.github.thebusybiscuit.cscorelib2.item.CustomItem; import io.github.thebusybiscuit.slimefun4.core.researching.Research; import io.github.thebusybiscuit.slimefun4.implementation.SlimefunItems; -import me.mrCookieSlime.Slimefun.SlimefunPlugin; +import io.github.thebusybiscuit.slimefun4.implementation.SlimefunPlugin; import me.mrCookieSlime.Slimefun.Lists.RecipeType; import me.mrCookieSlime.Slimefun.Objects.Category; import me.mrCookieSlime.Slimefun.Objects.SlimefunItem.SlimefunItem; @@ -199,7 +199,7 @@ public class Talisman extends SlimefunItem { private static void sendMessage(Player p, Talisman talisman) { if (hasMessage(talisman)) { - SlimefunPlugin.getLocal().sendMessage(p, "messages.talisman." + talisman.getMessageSuffix(), true); + SlimefunPlugin.getLocalization().sendMessage(p, "messages.talisman." + talisman.getMessageSuffix(), true); } } diff --git a/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/items/multiblocks/AbstractSmeltery.java b/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/items/multiblocks/AbstractSmeltery.java index 9c44c4e76..032d3424e 100644 --- a/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/items/multiblocks/AbstractSmeltery.java +++ b/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/items/multiblocks/AbstractSmeltery.java @@ -13,8 +13,8 @@ import org.bukkit.inventory.ItemStack; import io.github.thebusybiscuit.cscorelib2.inventory.InvUtils; import io.github.thebusybiscuit.slimefun4.core.multiblocks.MultiBlockMachine; +import io.github.thebusybiscuit.slimefun4.implementation.SlimefunPlugin; import io.github.thebusybiscuit.slimefun4.utils.SlimefunUtils; -import me.mrCookieSlime.Slimefun.SlimefunPlugin; import me.mrCookieSlime.Slimefun.Lists.RecipeType; import me.mrCookieSlime.Slimefun.Objects.Category; import me.mrCookieSlime.Slimefun.api.Slimefun; @@ -50,7 +50,7 @@ abstract class AbstractSmeltery extends MultiBlockMachine { craft(p, b, inv, inputs.get(i), output, outputInv); } else { - SlimefunPlugin.getLocal().sendMessage(p, "machines.full-inventory", true); + SlimefunPlugin.getLocalization().sendMessage(p, "machines.full-inventory", true); } } @@ -58,7 +58,7 @@ abstract class AbstractSmeltery extends MultiBlockMachine { } } - SlimefunPlugin.getLocal().sendMessage(p, "machines.unknown-material", true); + SlimefunPlugin.getLocalization().sendMessage(p, "machines.unknown-material", true); } private boolean canCraft(Inventory inv, List inputs, int i) { diff --git a/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/items/multiblocks/ArmorForge.java b/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/items/multiblocks/ArmorForge.java index 6b353d28d..f01a0149e 100644 --- a/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/items/multiblocks/ArmorForge.java +++ b/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/items/multiblocks/ArmorForge.java @@ -14,8 +14,8 @@ import org.bukkit.inventory.ItemStack; import io.github.thebusybiscuit.cscorelib2.inventory.ItemUtils; import io.github.thebusybiscuit.cscorelib2.item.CustomItem; import io.github.thebusybiscuit.slimefun4.core.multiblocks.MultiBlockMachine; +import io.github.thebusybiscuit.slimefun4.implementation.SlimefunPlugin; import io.github.thebusybiscuit.slimefun4.utils.SlimefunUtils; -import me.mrCookieSlime.Slimefun.SlimefunPlugin; import me.mrCookieSlime.Slimefun.Lists.RecipeType; import me.mrCookieSlime.Slimefun.Objects.Category; import me.mrCookieSlime.Slimefun.api.Slimefun; @@ -49,7 +49,7 @@ public class ArmorForge extends MultiBlockMachine { craft(p, output, inv, outputInv); } else { - SlimefunPlugin.getLocal().sendMessage(p, "machines.full-inventory", true); + SlimefunPlugin.getLocalization().sendMessage(p, "machines.full-inventory", true); } } @@ -57,7 +57,7 @@ public class ArmorForge extends MultiBlockMachine { } } - SlimefunPlugin.getLocal().sendMessage(p, "machines.pattern-not-found", true); + SlimefunPlugin.getLocalization().sendMessage(p, "machines.pattern-not-found", true); } private boolean isCraftable(Inventory inv, ItemStack[] recipe) { diff --git a/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/items/multiblocks/AutomatedPanningMachine.java b/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/items/multiblocks/AutomatedPanningMachine.java index 28daa92d9..aa33cc629 100644 --- a/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/items/multiblocks/AutomatedPanningMachine.java +++ b/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/items/multiblocks/AutomatedPanningMachine.java @@ -17,9 +17,9 @@ import io.github.thebusybiscuit.cscorelib2.inventory.ItemUtils; import io.github.thebusybiscuit.cscorelib2.scheduling.TaskQueue; import io.github.thebusybiscuit.slimefun4.core.multiblocks.MultiBlockMachine; import io.github.thebusybiscuit.slimefun4.implementation.SlimefunItems; +import io.github.thebusybiscuit.slimefun4.implementation.SlimefunPlugin; import io.github.thebusybiscuit.slimefun4.implementation.items.tools.GoldPan; import io.github.thebusybiscuit.slimefun4.utils.SlimefunUtils; -import me.mrCookieSlime.Slimefun.SlimefunPlugin; import me.mrCookieSlime.Slimefun.Objects.Category; import me.mrCookieSlime.Slimefun.api.SlimefunItemStack; @@ -79,7 +79,7 @@ public class AutomatedPanningMachine extends MultiBlockMachine { queue.execute(SlimefunPlugin.instance); } else { - SlimefunPlugin.getLocal().sendMessage(p, "machines.wrong-item", true); + SlimefunPlugin.getLocalization().sendMessage(p, "machines.wrong-item", true); } } diff --git a/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/items/multiblocks/BackpackCrafter.java b/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/items/multiblocks/BackpackCrafter.java index 84e3986d8..51375c919 100644 --- a/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/items/multiblocks/BackpackCrafter.java +++ b/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/items/multiblocks/BackpackCrafter.java @@ -17,9 +17,9 @@ import io.github.thebusybiscuit.cscorelib2.item.CustomItem; import io.github.thebusybiscuit.slimefun4.api.player.PlayerBackpack; import io.github.thebusybiscuit.slimefun4.api.player.PlayerProfile; import io.github.thebusybiscuit.slimefun4.core.multiblocks.MultiBlockMachine; +import io.github.thebusybiscuit.slimefun4.implementation.SlimefunPlugin; import io.github.thebusybiscuit.slimefun4.implementation.items.backpacks.SlimefunBackpack; import io.github.thebusybiscuit.slimefun4.utils.PatternUtils; -import me.mrCookieSlime.Slimefun.SlimefunPlugin; import me.mrCookieSlime.Slimefun.Objects.Category; import me.mrCookieSlime.Slimefun.Objects.SlimefunItem.SlimefunItem; import me.mrCookieSlime.Slimefun.api.SlimefunItemStack; diff --git a/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/items/multiblocks/Compressor.java b/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/items/multiblocks/Compressor.java index 9f47f6437..90e9b9af0 100644 --- a/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/items/multiblocks/Compressor.java +++ b/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/items/multiblocks/Compressor.java @@ -15,8 +15,8 @@ import org.bukkit.inventory.ItemStack; import io.github.thebusybiscuit.cscorelib2.item.CustomItem; import io.github.thebusybiscuit.slimefun4.core.multiblocks.MultiBlockMachine; import io.github.thebusybiscuit.slimefun4.implementation.SlimefunItems; +import io.github.thebusybiscuit.slimefun4.implementation.SlimefunPlugin; import io.github.thebusybiscuit.slimefun4.utils.SlimefunUtils; -import me.mrCookieSlime.Slimefun.SlimefunPlugin; import me.mrCookieSlime.Slimefun.Lists.RecipeType; import me.mrCookieSlime.Slimefun.Objects.Category; import me.mrCookieSlime.Slimefun.api.Slimefun; @@ -60,7 +60,7 @@ public class Compressor extends MultiBlockMachine { craft(p, output, outputInv); } else { - SlimefunPlugin.getLocal().sendMessage(p, "machines.full-inventory", true); + SlimefunPlugin.getLocalization().sendMessage(p, "machines.full-inventory", true); } return; @@ -68,7 +68,7 @@ public class Compressor extends MultiBlockMachine { } } - SlimefunPlugin.getLocal().sendMessage(p, "machines.unknown-material", true); + SlimefunPlugin.getLocalization().sendMessage(p, "machines.unknown-material", true); } private void craft(Player p, ItemStack output, Inventory outputInv) { diff --git a/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/items/multiblocks/EnhancedCraftingTable.java b/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/items/multiblocks/EnhancedCraftingTable.java index 256fc6bc8..de69888a3 100644 --- a/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/items/multiblocks/EnhancedCraftingTable.java +++ b/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/items/multiblocks/EnhancedCraftingTable.java @@ -12,9 +12,9 @@ import org.bukkit.inventory.Inventory; import org.bukkit.inventory.ItemStack; import io.github.thebusybiscuit.cscorelib2.inventory.ItemUtils; +import io.github.thebusybiscuit.slimefun4.implementation.SlimefunPlugin; import io.github.thebusybiscuit.slimefun4.implementation.items.backpacks.SlimefunBackpack; import io.github.thebusybiscuit.slimefun4.utils.SlimefunUtils; -import me.mrCookieSlime.Slimefun.SlimefunPlugin; import me.mrCookieSlime.Slimefun.Lists.RecipeType; import me.mrCookieSlime.Slimefun.Objects.Category; import me.mrCookieSlime.Slimefun.Objects.SlimefunItem.SlimefunItem; @@ -45,7 +45,7 @@ public class EnhancedCraftingTable extends BackpackCrafter { return; } } - SlimefunPlugin.getLocal().sendMessage(p, "machines.pattern-not-found", true); + SlimefunPlugin.getLocalization().sendMessage(p, "machines.pattern-not-found", true); } private void craft(Inventory inv, Block dispenser, Player p, Block b, ItemStack output) { @@ -71,7 +71,7 @@ public class EnhancedCraftingTable extends BackpackCrafter { outputInv.addItem(output); } - else SlimefunPlugin.getLocal().sendMessage(p, "machines.full-inventory", true); + else SlimefunPlugin.getLocalization().sendMessage(p, "machines.full-inventory", true); } private boolean isCraftable(Inventory inv, ItemStack[] recipe) { diff --git a/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/items/multiblocks/GrindStone.java b/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/items/multiblocks/GrindStone.java index 33f9abdc1..cff7af535 100644 --- a/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/items/multiblocks/GrindStone.java +++ b/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/items/multiblocks/GrindStone.java @@ -15,8 +15,8 @@ import org.bukkit.inventory.ItemStack; import io.github.thebusybiscuit.cscorelib2.item.CustomItem; import io.github.thebusybiscuit.slimefun4.core.multiblocks.MultiBlockMachine; import io.github.thebusybiscuit.slimefun4.implementation.SlimefunItems; +import io.github.thebusybiscuit.slimefun4.implementation.SlimefunPlugin; import io.github.thebusybiscuit.slimefun4.utils.SlimefunUtils; -import me.mrCookieSlime.Slimefun.SlimefunPlugin; import me.mrCookieSlime.Slimefun.Lists.RecipeType; import me.mrCookieSlime.Slimefun.Objects.Category; import me.mrCookieSlime.Slimefun.api.SlimefunItemStack; @@ -70,14 +70,14 @@ public class GrindStone extends MultiBlockMachine { p.getWorld().playSound(p.getLocation(), Sound.BLOCK_WOODEN_BUTTON_CLICK_ON, 1, 1); } else { - SlimefunPlugin.getLocal().sendMessage(p, "machines.full-inventory", true); + SlimefunPlugin.getLocalization().sendMessage(p, "machines.full-inventory", true); } return; } } } - SlimefunPlugin.getLocal().sendMessage(p, "machines.unknown-material", true); + SlimefunPlugin.getLocalization().sendMessage(p, "machines.unknown-material", true); } } diff --git a/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/items/multiblocks/Juicer.java b/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/items/multiblocks/Juicer.java index 8a0784678..3d5ae8cba 100644 --- a/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/items/multiblocks/Juicer.java +++ b/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/items/multiblocks/Juicer.java @@ -15,8 +15,8 @@ import org.bukkit.inventory.ItemStack; import io.github.thebusybiscuit.cscorelib2.item.CustomItem; import io.github.thebusybiscuit.slimefun4.core.multiblocks.MultiBlockMachine; +import io.github.thebusybiscuit.slimefun4.implementation.SlimefunPlugin; import io.github.thebusybiscuit.slimefun4.utils.SlimefunUtils; -import me.mrCookieSlime.Slimefun.SlimefunPlugin; import me.mrCookieSlime.Slimefun.Lists.RecipeType; import me.mrCookieSlime.Slimefun.Objects.Category; import me.mrCookieSlime.Slimefun.api.SlimefunItemStack; @@ -56,14 +56,14 @@ public class Juicer extends MultiBlockMachine { p.getWorld().playSound(b.getLocation(), Sound.ENTITY_PLAYER_SPLASH, 1F, 1F); p.getWorld().playEffect(b.getLocation(), Effect.STEP_SOUND, Material.HAY_BLOCK); } - else SlimefunPlugin.getLocal().sendMessage(p, "machines.full-inventory", true); + else SlimefunPlugin.getLocalization().sendMessage(p, "machines.full-inventory", true); return; } } } - SlimefunPlugin.getLocal().sendMessage(p, "machines.unknown-material", true); + SlimefunPlugin.getLocalization().sendMessage(p, "machines.unknown-material", true); } } diff --git a/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/items/multiblocks/MagicWorkbench.java b/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/items/multiblocks/MagicWorkbench.java index 3e23a090b..bc853dbdd 100644 --- a/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/items/multiblocks/MagicWorkbench.java +++ b/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/items/multiblocks/MagicWorkbench.java @@ -14,9 +14,9 @@ import org.bukkit.inventory.Inventory; import org.bukkit.inventory.ItemStack; import io.github.thebusybiscuit.cscorelib2.item.CustomItem; +import io.github.thebusybiscuit.slimefun4.implementation.SlimefunPlugin; import io.github.thebusybiscuit.slimefun4.implementation.items.backpacks.SlimefunBackpack; import io.github.thebusybiscuit.slimefun4.utils.SlimefunUtils; -import me.mrCookieSlime.Slimefun.SlimefunPlugin; import me.mrCookieSlime.Slimefun.Lists.RecipeType; import me.mrCookieSlime.Slimefun.Objects.Category; import me.mrCookieSlime.Slimefun.Objects.SlimefunItem.SlimefunItem; @@ -52,7 +52,7 @@ public class MagicWorkbench extends BackpackCrafter { return; } } - SlimefunPlugin.getLocal().sendMessage(p, "machines.pattern-not-found", true); + SlimefunPlugin.getLocalization().sendMessage(p, "machines.pattern-not-found", true); } private void craft(Inventory inv, Block dispenser, Player p, Block b, ItemStack output) { @@ -75,7 +75,7 @@ public class MagicWorkbench extends BackpackCrafter { startAnimation(p, b, outputInv, output); } - else SlimefunPlugin.getLocal().sendMessage(p, "machines.full-inventory", true); + else SlimefunPlugin.getLocalization().sendMessage(p, "machines.full-inventory", true); } private void startAnimation(Player p, Block b, Inventory inv, ItemStack output) { diff --git a/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/items/multiblocks/OreCrusher.java b/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/items/multiblocks/OreCrusher.java index 95f0f1c3a..dc528767e 100644 --- a/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/items/multiblocks/OreCrusher.java +++ b/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/items/multiblocks/OreCrusher.java @@ -18,8 +18,8 @@ import io.github.thebusybiscuit.slimefun4.api.MinecraftVersion; import io.github.thebusybiscuit.slimefun4.api.items.ItemSetting; import io.github.thebusybiscuit.slimefun4.core.multiblocks.MultiBlockMachine; import io.github.thebusybiscuit.slimefun4.implementation.SlimefunItems; +import io.github.thebusybiscuit.slimefun4.implementation.SlimefunPlugin; import io.github.thebusybiscuit.slimefun4.utils.SlimefunUtils; -import me.mrCookieSlime.Slimefun.SlimefunPlugin; import me.mrCookieSlime.Slimefun.Lists.RecipeType; import me.mrCookieSlime.Slimefun.Objects.Category; import me.mrCookieSlime.Slimefun.Objects.SlimefunItem.SlimefunItem; @@ -74,14 +74,14 @@ public class OreCrusher extends MultiBlockMachine { outputInv.addItem(adding); p.getWorld().playEffect(b.getLocation(), Effect.STEP_SOUND, 1); } - else SlimefunPlugin.getLocal().sendMessage(p, "machines.full-inventory", true); + else SlimefunPlugin.getLocalization().sendMessage(p, "machines.full-inventory", true); return; } } } - SlimefunPlugin.getLocal().sendMessage(p, "machines.unknown-material", true); + SlimefunPlugin.getLocalization().sendMessage(p, "machines.unknown-material", true); } private class DoubleOreSetting extends ItemSetting { diff --git a/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/items/multiblocks/OreWasher.java b/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/items/multiblocks/OreWasher.java index 31fae5823..719646aad 100644 --- a/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/items/multiblocks/OreWasher.java +++ b/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/items/multiblocks/OreWasher.java @@ -16,8 +16,8 @@ import org.bukkit.inventory.ItemStack; import io.github.thebusybiscuit.slimefun4.core.multiblocks.MultiBlockMachine; import io.github.thebusybiscuit.slimefun4.implementation.SlimefunItems; +import io.github.thebusybiscuit.slimefun4.implementation.SlimefunPlugin; import io.github.thebusybiscuit.slimefun4.utils.SlimefunUtils; -import me.mrCookieSlime.Slimefun.SlimefunPlugin; import me.mrCookieSlime.Slimefun.Objects.Category; import me.mrCookieSlime.Slimefun.api.SlimefunItemStack; @@ -91,7 +91,7 @@ public class OreWasher extends MultiBlockMachine { } } } - SlimefunPlugin.getLocal().sendMessage(p, "machines.unknown-material", true); + SlimefunPlugin.getLocalization().sendMessage(p, "machines.unknown-material", true); } private void removeItem(Player p, Block b, Inventory inputInv, Inventory outputInv, ItemStack input, ItemStack output, int amount) { @@ -105,7 +105,7 @@ public class OreWasher extends MultiBlockMachine { b.getWorld().playSound(b.getLocation(), Sound.ENTITY_PLAYER_SPLASH, 1, 1); } else { - SlimefunPlugin.getLocal().sendMessage(p, "machines.full-inventory", true); + SlimefunPlugin.getLocalization().sendMessage(p, "machines.full-inventory", true); } } diff --git a/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/items/multiblocks/PressureChamber.java b/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/items/multiblocks/PressureChamber.java index 310a6890c..50f919e5d 100644 --- a/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/items/multiblocks/PressureChamber.java +++ b/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/items/multiblocks/PressureChamber.java @@ -17,8 +17,8 @@ import org.bukkit.inventory.ItemStack; import io.github.thebusybiscuit.cscorelib2.item.CustomItem; import io.github.thebusybiscuit.slimefun4.api.MinecraftVersion; import io.github.thebusybiscuit.slimefun4.core.multiblocks.MultiBlockMachine; +import io.github.thebusybiscuit.slimefun4.implementation.SlimefunPlugin; import io.github.thebusybiscuit.slimefun4.utils.SlimefunUtils; -import me.mrCookieSlime.Slimefun.SlimefunPlugin; import me.mrCookieSlime.Slimefun.Lists.RecipeType; import me.mrCookieSlime.Slimefun.Objects.Category; import me.mrCookieSlime.Slimefun.api.SlimefunItemStack; @@ -57,13 +57,13 @@ public class PressureChamber extends MultiBlockMachine { craft(p, b, output, outputInv); } - else SlimefunPlugin.getLocal().sendMessage(p, "machines.full-inventory", true); + else SlimefunPlugin.getLocalization().sendMessage(p, "machines.full-inventory", true); return; } } } - SlimefunPlugin.getLocal().sendMessage(p, "machines.unknown-material", true); + SlimefunPlugin.getLocalization().sendMessage(p, "machines.unknown-material", true); } private void craft(Player p, Block b, ItemStack output, Inventory outputInv) { diff --git a/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/items/multiblocks/Smeltery.java b/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/items/multiblocks/Smeltery.java index e4c4a3c94..0fd03ccd1 100644 --- a/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/items/multiblocks/Smeltery.java +++ b/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/items/multiblocks/Smeltery.java @@ -21,7 +21,7 @@ import org.bukkit.inventory.meta.ItemMeta; import io.github.thebusybiscuit.cscorelib2.item.CustomItem; import io.github.thebusybiscuit.slimefun4.api.items.ItemSetting; import io.github.thebusybiscuit.slimefun4.implementation.SlimefunItems; -import me.mrCookieSlime.Slimefun.SlimefunPlugin; +import io.github.thebusybiscuit.slimefun4.implementation.SlimefunPlugin; import me.mrCookieSlime.Slimefun.Objects.Category; import me.mrCookieSlime.Slimefun.api.BlockStorage; import me.mrCookieSlime.Slimefun.api.SlimefunItemStack; @@ -80,7 +80,7 @@ public class Smeltery extends AbstractSmeltery { p.getWorld().playSound(p.getLocation(), Sound.ITEM_FLINTANDSTEEL_USE, 1, 1); } else { - SlimefunPlugin.getLocal().sendMessage(p, "machines.ignition-chamber-no-flint", true); + SlimefunPlugin.getLocalization().sendMessage(p, "machines.ignition-chamber-no-flint", true); Block fire = b.getRelative(BlockFace.DOWN).getRelative(BlockFace.DOWN); fire.getWorld().playEffect(fire.getLocation(), Effect.STEP_SOUND, fire.getType()); diff --git a/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/items/multiblocks/miner/ActiveMiner.java b/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/items/multiblocks/miner/ActiveMiner.java index 8a5e3c2f1..557953ef6 100644 --- a/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/items/multiblocks/miner/ActiveMiner.java +++ b/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/items/multiblocks/miner/ActiveMiner.java @@ -23,7 +23,7 @@ import io.github.thebusybiscuit.cscorelib2.inventory.InvUtils; import io.github.thebusybiscuit.cscorelib2.inventory.ItemUtils; import io.github.thebusybiscuit.cscorelib2.protection.ProtectableAction; import io.github.thebusybiscuit.cscorelib2.scheduling.TaskQueue; -import me.mrCookieSlime.Slimefun.SlimefunPlugin; +import io.github.thebusybiscuit.slimefun4.implementation.SlimefunPlugin; import me.mrCookieSlime.Slimefun.Objects.SlimefunItem.abstractItems.MachineFuel; import me.mrCookieSlime.Slimefun.api.Slimefun; @@ -102,7 +102,7 @@ class ActiveMiner implements Runnable { Player p = Bukkit.getPlayer(owner); if (p != null) { - SlimefunPlugin.getLocal().sendMessage(p, error); + SlimefunPlugin.getLocalization().sendMessage(p, error); } stop(); @@ -224,7 +224,7 @@ class ActiveMiner implements Runnable { if (p != null) { p.playSound(p.getLocation(), Sound.ENTITY_ARROW_HIT_PLAYER, 0.4F, 1F); - SlimefunPlugin.getLocal().sendMessage(p, "machines.INDUSTRIAL_MINER.finished", msg -> msg.replace("%ores%", String.valueOf(ores))); + SlimefunPlugin.getLocalization().sendMessage(p, "machines.INDUSTRIAL_MINER.finished", msg -> msg.replace("%ores%", String.valueOf(ores))); } return; diff --git a/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/items/multiblocks/miner/IndustrialMiner.java b/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/items/multiblocks/miner/IndustrialMiner.java index 11fa017d6..7caf4b073 100644 --- a/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/items/multiblocks/miner/IndustrialMiner.java +++ b/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/items/multiblocks/miner/IndustrialMiner.java @@ -22,7 +22,7 @@ import io.github.thebusybiscuit.cscorelib2.chat.ChatColors; import io.github.thebusybiscuit.cscorelib2.item.CustomItem; import io.github.thebusybiscuit.slimefun4.api.MinecraftVersion; import io.github.thebusybiscuit.slimefun4.core.multiblocks.MultiBlockMachine; -import me.mrCookieSlime.Slimefun.SlimefunPlugin; +import io.github.thebusybiscuit.slimefun4.implementation.SlimefunPlugin; import me.mrCookieSlime.Slimefun.Objects.Category; import me.mrCookieSlime.Slimefun.Objects.SlimefunItem.abstractItems.MachineFuel; import me.mrCookieSlime.Slimefun.api.SlimefunItemStack; @@ -172,7 +172,7 @@ public class IndustrialMiner extends MultiBlockMachine { @Override public void onInteract(Player p, Block b) { if (activeMiners.containsKey(b.getLocation())) { - SlimefunPlugin.getLocal().sendMessage(p, "machines.INDUSTRIAL_MINER.already-running"); + SlimefunPlugin.getLocalization().sendMessage(p, "machines.INDUSTRIAL_MINER.already-running"); return; } diff --git a/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/items/tools/ExplosiveShovel.java b/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/items/tools/ExplosiveShovel.java index ec2204cb7..a0ca6b56e 100644 --- a/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/items/tools/ExplosiveShovel.java +++ b/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/items/tools/ExplosiveShovel.java @@ -10,7 +10,7 @@ import org.bukkit.inventory.ItemStack; import io.github.thebusybiscuit.cscorelib2.materials.MaterialTools; import io.github.thebusybiscuit.cscorelib2.protection.ProtectableAction; -import me.mrCookieSlime.Slimefun.SlimefunPlugin; +import io.github.thebusybiscuit.slimefun4.implementation.SlimefunPlugin; import me.mrCookieSlime.Slimefun.Lists.RecipeType; import me.mrCookieSlime.Slimefun.Objects.Category; import me.mrCookieSlime.Slimefun.api.SlimefunItemStack; diff --git a/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/items/tools/ExplosiveTool.java b/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/items/tools/ExplosiveTool.java index 549445851..664e79b46 100644 --- a/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/items/tools/ExplosiveTool.java +++ b/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/items/tools/ExplosiveTool.java @@ -19,7 +19,7 @@ import io.github.thebusybiscuit.cscorelib2.protection.ProtectableAction; import io.github.thebusybiscuit.slimefun4.api.items.ItemSetting; import io.github.thebusybiscuit.slimefun4.core.attributes.DamageableItem; import io.github.thebusybiscuit.slimefun4.core.attributes.NotPlaceable; -import me.mrCookieSlime.Slimefun.SlimefunPlugin; +import io.github.thebusybiscuit.slimefun4.implementation.SlimefunPlugin; import me.mrCookieSlime.Slimefun.Lists.RecipeType; import me.mrCookieSlime.Slimefun.Objects.Category; import me.mrCookieSlime.Slimefun.Objects.SlimefunBlockHandler; diff --git a/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/items/tools/GoldPan.java b/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/items/tools/GoldPan.java index 23aa033ca..db79ec099 100644 --- a/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/items/tools/GoldPan.java +++ b/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/items/tools/GoldPan.java @@ -16,9 +16,9 @@ import io.github.thebusybiscuit.cscorelib2.protection.ProtectableAction; import io.github.thebusybiscuit.slimefun4.api.items.ItemSetting; import io.github.thebusybiscuit.slimefun4.core.attributes.RecipeDisplayItem; import io.github.thebusybiscuit.slimefun4.implementation.SlimefunItems; +import io.github.thebusybiscuit.slimefun4.implementation.SlimefunPlugin; import io.github.thebusybiscuit.slimefun4.implementation.items.electric.machines.ElectricGoldPan; import io.github.thebusybiscuit.slimefun4.implementation.items.multiblocks.AutomatedPanningMachine; -import me.mrCookieSlime.Slimefun.SlimefunPlugin; import me.mrCookieSlime.Slimefun.Lists.RecipeType; import me.mrCookieSlime.Slimefun.Objects.Category; import me.mrCookieSlime.Slimefun.Objects.SlimefunItem.SimpleSlimefunItem; diff --git a/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/items/tools/GrapplingHook.java b/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/items/tools/GrapplingHook.java index 08b9f3656..e4d27a4ab 100644 --- a/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/items/tools/GrapplingHook.java +++ b/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/items/tools/GrapplingHook.java @@ -13,7 +13,7 @@ import org.bukkit.potion.PotionEffectType; import org.bukkit.util.Vector; import io.github.thebusybiscuit.slimefun4.api.items.ItemSetting; -import me.mrCookieSlime.Slimefun.SlimefunPlugin; +import io.github.thebusybiscuit.slimefun4.implementation.SlimefunPlugin; import me.mrCookieSlime.Slimefun.Lists.RecipeType; import me.mrCookieSlime.Slimefun.Objects.Category; import me.mrCookieSlime.Slimefun.Objects.SlimefunItem.SimpleSlimefunItem; diff --git a/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/items/tools/LumberAxe.java b/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/items/tools/LumberAxe.java index be15f1332..98b41e326 100644 --- a/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/items/tools/LumberAxe.java +++ b/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/items/tools/LumberAxe.java @@ -16,7 +16,7 @@ import io.github.thebusybiscuit.cscorelib2.blocks.Vein; import io.github.thebusybiscuit.cscorelib2.materials.MaterialCollections; import io.github.thebusybiscuit.cscorelib2.protection.ProtectableAction; import io.github.thebusybiscuit.slimefun4.core.attributes.NotPlaceable; -import me.mrCookieSlime.Slimefun.SlimefunPlugin; +import io.github.thebusybiscuit.slimefun4.implementation.SlimefunPlugin; import me.mrCookieSlime.Slimefun.Lists.RecipeType; import me.mrCookieSlime.Slimefun.Objects.Category; import me.mrCookieSlime.Slimefun.Objects.SlimefunItem.SimpleSlimefunItem; diff --git a/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/items/tools/PickaxeOfTheSeeker.java b/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/items/tools/PickaxeOfTheSeeker.java index cb8997277..2d7df1f4c 100644 --- a/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/items/tools/PickaxeOfTheSeeker.java +++ b/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/items/tools/PickaxeOfTheSeeker.java @@ -8,7 +8,7 @@ import org.bukkit.inventory.ItemStack; import io.github.thebusybiscuit.cscorelib2.materials.MaterialCollections; import io.github.thebusybiscuit.slimefun4.core.attributes.DamageableItem; -import me.mrCookieSlime.Slimefun.SlimefunPlugin; +import io.github.thebusybiscuit.slimefun4.implementation.SlimefunPlugin; import me.mrCookieSlime.Slimefun.Lists.RecipeType; import me.mrCookieSlime.Slimefun.Objects.Category; import me.mrCookieSlime.Slimefun.Objects.SlimefunItem.SimpleSlimefunItem; @@ -30,7 +30,7 @@ public class PickaxeOfTheSeeker extends SimpleSlimefunItem imple e.setUseBlock(Result.DENY); if (closest == null) { - SlimefunPlugin.getLocal().sendMessage(p, "miner.no-ores"); + SlimefunPlugin.getLocalization().sendMessage(p, "miner.no-ores"); } else { double l = closest.getX() + 0.5 - p.getLocation().getX(); diff --git a/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/items/tools/PickaxeOfVeinMining.java b/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/items/tools/PickaxeOfVeinMining.java index 759bcf076..b4c6f0816 100644 --- a/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/items/tools/PickaxeOfVeinMining.java +++ b/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/items/tools/PickaxeOfVeinMining.java @@ -15,7 +15,7 @@ import io.github.thebusybiscuit.cscorelib2.item.CustomItem; import io.github.thebusybiscuit.cscorelib2.materials.MaterialCollections; import io.github.thebusybiscuit.cscorelib2.protection.ProtectableAction; import io.github.thebusybiscuit.slimefun4.api.items.ItemSetting; -import me.mrCookieSlime.Slimefun.SlimefunPlugin; +import io.github.thebusybiscuit.slimefun4.implementation.SlimefunPlugin; import me.mrCookieSlime.Slimefun.Lists.RecipeType; import me.mrCookieSlime.Slimefun.Objects.Category; import me.mrCookieSlime.Slimefun.Objects.SlimefunItem.SimpleSlimefunItem; diff --git a/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/items/tools/SmeltersPickaxe.java b/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/items/tools/SmeltersPickaxe.java index 45234a7db..e46c05080 100644 --- a/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/items/tools/SmeltersPickaxe.java +++ b/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/items/tools/SmeltersPickaxe.java @@ -12,7 +12,7 @@ import org.bukkit.inventory.ItemStack; import io.github.thebusybiscuit.cscorelib2.materials.MaterialCollections; import io.github.thebusybiscuit.slimefun4.core.attributes.DamageableItem; -import me.mrCookieSlime.Slimefun.SlimefunPlugin; +import io.github.thebusybiscuit.slimefun4.implementation.SlimefunPlugin; import me.mrCookieSlime.Slimefun.Lists.RecipeType; import me.mrCookieSlime.Slimefun.Objects.Category; import me.mrCookieSlime.Slimefun.Objects.SlimefunItem.SimpleSlimefunItem; @@ -66,7 +66,7 @@ public class SmeltersPickaxe extends SimpleSlimefunItem imple } private void smelt(Block b, ItemStack drop, int fortune) { - Optional furnaceOutput = SlimefunPlugin.getMinecraftRecipes().getFurnaceOutput(drop); + Optional furnaceOutput = SlimefunPlugin.getMinecraftRecipeService().getFurnaceOutput(drop); if (furnaceOutput.isPresent()) { b.getWorld().playEffect(b.getLocation(), Effect.MOBSPAWNER_FLAMES, 1); diff --git a/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/items/weapons/SeismicAxe.java b/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/items/weapons/SeismicAxe.java index cc8437b01..0fecccf40 100644 --- a/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/items/weapons/SeismicAxe.java +++ b/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/items/weapons/SeismicAxe.java @@ -21,7 +21,7 @@ import org.bukkit.util.Vector; import io.github.thebusybiscuit.slimefun4.core.attributes.DamageableItem; import io.github.thebusybiscuit.slimefun4.core.attributes.NotPlaceable; -import me.mrCookieSlime.Slimefun.SlimefunPlugin; +import io.github.thebusybiscuit.slimefun4.implementation.SlimefunPlugin; import me.mrCookieSlime.Slimefun.Lists.RecipeType; import me.mrCookieSlime.Slimefun.Objects.Category; import me.mrCookieSlime.Slimefun.Objects.SlimefunItem.SimpleSlimefunItem; diff --git a/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/listeners/AncientAltarListener.java b/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/listeners/AncientAltarListener.java index 8feb73a5a..825859459 100644 --- a/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/listeners/AncientAltarListener.java +++ b/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/listeners/AncientAltarListener.java @@ -31,13 +31,13 @@ import io.github.thebusybiscuit.cscorelib2.inventory.ItemUtils; import io.github.thebusybiscuit.cscorelib2.item.CustomItem; import io.github.thebusybiscuit.slimefun4.api.events.PlayerRightClickEvent; import io.github.thebusybiscuit.slimefun4.implementation.SlimefunItems; +import io.github.thebusybiscuit.slimefun4.implementation.SlimefunPlugin; import io.github.thebusybiscuit.slimefun4.implementation.items.altar.AltarRecipe; import io.github.thebusybiscuit.slimefun4.implementation.items.altar.AncientAltar; import io.github.thebusybiscuit.slimefun4.implementation.items.altar.AncientPedestal; import io.github.thebusybiscuit.slimefun4.implementation.tasks.AncientAltarTask; import io.github.thebusybiscuit.slimefun4.utils.SlimefunUtils; import io.github.thebusybiscuit.slimefun4.utils.itemstack.ItemStackWrapper; -import me.mrCookieSlime.Slimefun.SlimefunPlugin; import me.mrCookieSlime.Slimefun.Objects.SlimefunItem.SlimefunItem; import me.mrCookieSlime.Slimefun.api.BlockStorage; import me.mrCookieSlime.Slimefun.api.Slimefun; @@ -136,7 +136,7 @@ public class AncientAltarListener implements Listener { if (p.getInventory().getItemInMainHand().getType() != Material.AIR) { // Check for pedestal obstructions if (pedestal.getRelative(0, 1, 0).getType() != Material.AIR) { - SlimefunPlugin.getLocal().sendMessage(p, "machines.ANCIENT_PEDESTAL.obstructed", true); + SlimefunPlugin.getLocalization().sendMessage(p, "machines.ANCIENT_PEDESTAL.obstructed", true); return; } @@ -171,7 +171,7 @@ public class AncientAltarListener implements Listener { } else { altars.remove(altar); - SlimefunPlugin.getLocal().sendMessage(p, "machines.ANCIENT_ALTAR.unknown-catalyst", true); + SlimefunPlugin.getLocalization().sendMessage(p, "machines.ANCIENT_ALTAR.unknown-catalyst", true); for (Block block : pedestals) { altarsInUse.remove(block.getLocation()); @@ -183,7 +183,7 @@ public class AncientAltarListener implements Listener { } else { altars.remove(altar); - SlimefunPlugin.getLocal().sendMessage(p, "machines.ANCIENT_ALTAR.not-enough-pedestals", true, msg -> msg.replace("%pedestals%", String.valueOf(pedestals.size()))); + SlimefunPlugin.getLocalization().sendMessage(p, "machines.ANCIENT_ALTAR.not-enough-pedestals", true, msg -> msg.replace("%pedestals%", String.valueOf(pedestals.size()))); // Not a valid altar so remove from inuse altarsInUse.remove(altar.getLocation()); @@ -228,7 +228,7 @@ public class AncientAltarListener implements Listener { } else { altars.remove(b); - SlimefunPlugin.getLocal().sendMessage(p, "machines.ANCIENT_ALTAR.unknown-recipe", true); + SlimefunPlugin.getLocalization().sendMessage(p, "machines.ANCIENT_ALTAR.unknown-recipe", true); for (Block block : pedestals) { altarsInUse.remove(block.getLocation()); @@ -251,7 +251,7 @@ public class AncientAltarListener implements Listener { String id = BlockStorage.checkID(pedestal); if (id != null && id.equals(SlimefunItems.ANCIENT_PEDESTAL.getItemId())) { - SlimefunPlugin.getLocal().sendMessage(e.getPlayer(), "messages.cannot-place", true); + SlimefunPlugin.getLocalization().sendMessage(e.getPlayer(), "messages.cannot-place", true); e.setCancelled(true); } } diff --git a/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/listeners/BackpackListener.java b/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/listeners/BackpackListener.java index 0a1080315..a9139f9fe 100644 --- a/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/listeners/BackpackListener.java +++ b/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/listeners/BackpackListener.java @@ -23,9 +23,9 @@ import org.bukkit.inventory.meta.ItemMeta; import io.github.thebusybiscuit.slimefun4.api.player.PlayerBackpack; import io.github.thebusybiscuit.slimefun4.api.player.PlayerProfile; +import io.github.thebusybiscuit.slimefun4.implementation.SlimefunPlugin; import io.github.thebusybiscuit.slimefun4.implementation.items.backpacks.Cooler; import io.github.thebusybiscuit.slimefun4.implementation.items.backpacks.SlimefunBackpack; -import me.mrCookieSlime.Slimefun.SlimefunPlugin; import me.mrCookieSlime.Slimefun.Objects.SlimefunItem.SlimefunItem; import me.mrCookieSlime.Slimefun.api.Slimefun; @@ -110,11 +110,11 @@ public class BackpackListener implements Listener { public void openBackpack(Player p, ItemStack item, SlimefunBackpack backpack) { if (item.getAmount() == 1) { if (Slimefun.hasUnlocked(p, backpack, true) && !PlayerProfile.get(p, profile -> openBackpack(p, item, profile, backpack.getSize()))) { - SlimefunPlugin.getLocal().sendMessage(p, "messages.opening-backpack"); + SlimefunPlugin.getLocalization().sendMessage(p, "messages.opening-backpack"); } } else { - SlimefunPlugin.getLocal().sendMessage(p, "backpack.no-stack", true); + SlimefunPlugin.getLocalization().sendMessage(p, "backpack.no-stack", true); } } @@ -138,7 +138,7 @@ public class BackpackListener implements Listener { }); } else { - SlimefunPlugin.getLocal().sendMessage(p, "backpack.already-open", true); + SlimefunPlugin.getLocalization().sendMessage(p, "backpack.already-open", true); } } diff --git a/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/listeners/BlockListener.java b/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/listeners/BlockListener.java index 1ef53575a..db3e4cb6a 100644 --- a/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/listeners/BlockListener.java +++ b/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/listeners/BlockListener.java @@ -22,7 +22,7 @@ import org.bukkit.event.block.BlockPlaceEvent; import org.bukkit.inventory.ItemStack; import io.github.thebusybiscuit.slimefun4.core.attributes.NotPlaceable; -import me.mrCookieSlime.Slimefun.SlimefunPlugin; +import io.github.thebusybiscuit.slimefun4.implementation.SlimefunPlugin; import me.mrCookieSlime.Slimefun.Objects.SlimefunBlockHandler; import me.mrCookieSlime.Slimefun.Objects.SlimefunItem.SlimefunItem; import me.mrCookieSlime.Slimefun.Objects.SlimefunItem.UnregisterReason; diff --git a/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/listeners/BlockPhysicsListener.java b/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/listeners/BlockPhysicsListener.java index a7d182672..0b69c00a6 100644 --- a/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/listeners/BlockPhysicsListener.java +++ b/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/listeners/BlockPhysicsListener.java @@ -18,7 +18,7 @@ import org.bukkit.event.entity.EntityChangeBlockEvent; import org.bukkit.event.player.PlayerBucketEmptyEvent; import org.bukkit.inventory.ItemStack; -import me.mrCookieSlime.Slimefun.SlimefunPlugin; +import io.github.thebusybiscuit.slimefun4.implementation.SlimefunPlugin; import me.mrCookieSlime.Slimefun.api.BlockStorage; /** diff --git a/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/listeners/ButcherAndroidListener.java b/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/listeners/ButcherAndroidListener.java index 9608087a7..f90df4ddf 100644 --- a/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/listeners/ButcherAndroidListener.java +++ b/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/listeners/ButcherAndroidListener.java @@ -16,10 +16,10 @@ import org.bukkit.event.Listener; import org.bukkit.event.entity.EntityDeathEvent; import org.bukkit.inventory.ItemStack; +import io.github.thebusybiscuit.slimefun4.implementation.SlimefunPlugin; import io.github.thebusybiscuit.slimefun4.implementation.items.androids.AndroidInstance; import io.github.thebusybiscuit.slimefun4.implementation.items.androids.ButcherAndroid; import io.github.thebusybiscuit.slimefun4.utils.SlimefunUtils; -import me.mrCookieSlime.Slimefun.SlimefunPlugin; import me.mrCookieSlime.Slimefun.api.Slimefun; /** diff --git a/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/listeners/CargoNodeListener.java b/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/listeners/CargoNodeListener.java index 3fd305413..57e19ff1c 100644 --- a/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/listeners/CargoNodeListener.java +++ b/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/listeners/CargoNodeListener.java @@ -6,9 +6,9 @@ import org.bukkit.event.block.BlockPlaceEvent; import org.bukkit.inventory.ItemStack; import io.github.thebusybiscuit.slimefun4.implementation.SlimefunItems; +import io.github.thebusybiscuit.slimefun4.implementation.SlimefunPlugin; import io.github.thebusybiscuit.slimefun4.utils.SlimefunUtils; import io.github.thebusybiscuit.slimefun4.utils.itemstack.ItemStackWrapper; -import me.mrCookieSlime.Slimefun.SlimefunPlugin; /** * This {@link Listener} is solely responsible for preventing Cargo Nodes from being placed @@ -26,7 +26,7 @@ public class CargoNodeListener implements Listener { @EventHandler(ignoreCancelled = true) public void onCargoNodePlace(BlockPlaceEvent e) { if (e.getBlock().getY() != e.getBlockAgainst().getY() && isCargoNode(new ItemStackWrapper(e.getItemInHand()))) { - SlimefunPlugin.getLocal().sendMessage(e.getPlayer(), "machines.CARGO_NODES.must-be-placed", true); + SlimefunPlugin.getLocalization().sendMessage(e.getPlayer(), "machines.CARGO_NODES.must-be-placed", true); e.setCancelled(true); } } diff --git a/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/listeners/CoolerListener.java b/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/listeners/CoolerListener.java index 72254ed90..3be8cf9b3 100644 --- a/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/listeners/CoolerListener.java +++ b/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/listeners/CoolerListener.java @@ -13,9 +13,9 @@ import org.bukkit.potion.PotionEffect; import io.github.thebusybiscuit.slimefun4.api.player.PlayerBackpack; import io.github.thebusybiscuit.slimefun4.api.player.PlayerProfile; +import io.github.thebusybiscuit.slimefun4.implementation.SlimefunPlugin; import io.github.thebusybiscuit.slimefun4.implementation.items.backpacks.Cooler; import io.github.thebusybiscuit.slimefun4.implementation.items.food.Juice; -import me.mrCookieSlime.Slimefun.SlimefunPlugin; import me.mrCookieSlime.Slimefun.api.Slimefun; /** diff --git a/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/listeners/DeathpointListener.java b/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/listeners/DeathpointListener.java index 49c646880..d1f7cc8cb 100644 --- a/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/listeners/DeathpointListener.java +++ b/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/listeners/DeathpointListener.java @@ -11,8 +11,8 @@ import org.bukkit.event.entity.EntityDeathEvent; import org.bukkit.event.entity.PlayerDeathEvent; import io.github.thebusybiscuit.slimefun4.implementation.SlimefunItems; +import io.github.thebusybiscuit.slimefun4.implementation.SlimefunPlugin; import io.github.thebusybiscuit.slimefun4.utils.SlimefunUtils; -import me.mrCookieSlime.Slimefun.SlimefunPlugin; /** * This {@link Listener} listens to the {@link EntityDeathEvent} to automatically @@ -34,7 +34,7 @@ public class DeathpointListener implements Listener { Player p = e.getEntity(); if (SlimefunUtils.containsSimilarItem(p.getInventory(), SlimefunItems.GPS_EMERGENCY_TRANSMITTER, true)) { - SlimefunPlugin.getGPSNetwork().addWaypoint(p, "player:death " + SlimefunPlugin.getLocal().getMessage(p, "gps.deathpoint").replace("%date%", format.format(LocalDateTime.now())), p.getLocation().getBlock().getLocation()); + SlimefunPlugin.getGPSNetwork().addWaypoint(p, "player:death " + SlimefunPlugin.getLocalization().getMessage(p, "gps.deathpoint").replace("%date%", format.format(LocalDateTime.now())), p.getLocation().getBlock().getLocation()); } } } diff --git a/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/listeners/DebugFishListener.java b/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/listeners/DebugFishListener.java index 0036ddf53..2345d307e 100644 --- a/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/listeners/DebugFishListener.java +++ b/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/listeners/DebugFishListener.java @@ -17,11 +17,11 @@ import io.github.thebusybiscuit.cscorelib2.chat.ChatColors; import io.github.thebusybiscuit.cscorelib2.skull.SkullBlock; import io.github.thebusybiscuit.slimefun4.core.networks.energy.EnergyNet; import io.github.thebusybiscuit.slimefun4.implementation.SlimefunItems; +import io.github.thebusybiscuit.slimefun4.implementation.SlimefunPlugin; import io.github.thebusybiscuit.slimefun4.implementation.tasks.TickerTask; import io.github.thebusybiscuit.slimefun4.utils.HeadTexture; import io.github.thebusybiscuit.slimefun4.utils.NumberUtils; import io.github.thebusybiscuit.slimefun4.utils.SlimefunUtils; -import me.mrCookieSlime.Slimefun.SlimefunPlugin; import me.mrCookieSlime.Slimefun.Objects.SlimefunItem.SlimefunItem; import me.mrCookieSlime.Slimefun.api.BlockStorage; import me.mrCookieSlime.Slimefun.api.energy.ChargableBlock; @@ -99,7 +99,7 @@ public class DebugFishListener implements Listener { p.sendMessage(ChatColors.color("&dInventory: " + disabledTooltip)); } - TickerTask ticker = SlimefunPlugin.getTicker(); + TickerTask ticker = SlimefunPlugin.getTickerTask(); if (item.isTicking()) { p.sendMessage(ChatColors.color("&dTicker: " + enabledTooltip)); diff --git a/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/listeners/DispenserListener.java b/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/listeners/DispenserListener.java index 8c6a18166..8cde6ccdb 100644 --- a/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/listeners/DispenserListener.java +++ b/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/listeners/DispenserListener.java @@ -9,7 +9,7 @@ import org.bukkit.event.EventHandler; import org.bukkit.event.Listener; import org.bukkit.event.block.BlockDispenseEvent; -import me.mrCookieSlime.Slimefun.SlimefunPlugin; +import io.github.thebusybiscuit.slimefun4.implementation.SlimefunPlugin; import me.mrCookieSlime.Slimefun.Objects.SlimefunItem.SlimefunItem; import me.mrCookieSlime.Slimefun.Objects.handlers.BlockDispenseHandler; import me.mrCookieSlime.Slimefun.api.BlockStorage; diff --git a/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/listeners/EnhancedFurnaceListener.java b/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/listeners/EnhancedFurnaceListener.java index 77873fbb2..8cc56d8eb 100644 --- a/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/listeners/EnhancedFurnaceListener.java +++ b/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/listeners/EnhancedFurnaceListener.java @@ -11,8 +11,8 @@ import org.bukkit.event.inventory.FurnaceSmeltEvent; import org.bukkit.inventory.ItemStack; import io.github.thebusybiscuit.cscorelib2.item.CustomItem; +import io.github.thebusybiscuit.slimefun4.implementation.SlimefunPlugin; import io.github.thebusybiscuit.slimefun4.implementation.items.blocks.EnhancedFurnace; -import me.mrCookieSlime.Slimefun.SlimefunPlugin; import me.mrCookieSlime.Slimefun.Objects.SlimefunItem.SlimefunItem; import me.mrCookieSlime.Slimefun.api.BlockStorage; @@ -52,7 +52,7 @@ public class EnhancedFurnaceListener implements Listener { Optional result = Optional.ofNullable(furnace.getInventory().getResult()); if (!result.isPresent()) { - result = SlimefunPlugin.getMinecraftRecipes().getFurnaceOutput(furnace.getInventory().getSmelting()); + result = SlimefunPlugin.getMinecraftRecipeService().getFurnaceOutput(furnace.getInventory().getSmelting()); } if (result.isPresent()) { diff --git a/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/listeners/ExplosionsListener.java b/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/listeners/ExplosionsListener.java index d2f27e255..80e3dc330 100644 --- a/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/listeners/ExplosionsListener.java +++ b/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/listeners/ExplosionsListener.java @@ -10,7 +10,7 @@ import org.bukkit.event.Listener; import org.bukkit.event.entity.EntityExplodeEvent; import io.github.thebusybiscuit.slimefun4.implementation.SlimefunItems; -import me.mrCookieSlime.Slimefun.SlimefunPlugin; +import io.github.thebusybiscuit.slimefun4.implementation.SlimefunPlugin; import me.mrCookieSlime.Slimefun.Objects.SlimefunBlockHandler; import me.mrCookieSlime.Slimefun.Objects.SlimefunItem.SlimefunItem; import me.mrCookieSlime.Slimefun.Objects.SlimefunItem.UnregisterReason; diff --git a/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/listeners/FireworksListener.java b/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/listeners/FireworksListener.java index 7136a8956..e4134035f 100644 --- a/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/listeners/FireworksListener.java +++ b/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/listeners/FireworksListener.java @@ -8,7 +8,7 @@ import org.bukkit.event.Listener; import org.bukkit.event.entity.EntityDamageByEntityEvent; import org.bukkit.inventory.meta.FireworkMeta; -import me.mrCookieSlime.Slimefun.SlimefunPlugin; +import io.github.thebusybiscuit.slimefun4.implementation.SlimefunPlugin; public class FireworksListener implements Listener { diff --git a/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/listeners/GadgetsListener.java b/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/listeners/GadgetsListener.java index c9a93fc53..9ba07c781 100644 --- a/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/listeners/GadgetsListener.java +++ b/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/listeners/GadgetsListener.java @@ -6,6 +6,7 @@ import org.bukkit.event.Listener; import org.bukkit.event.player.PlayerToggleSneakEvent; import io.github.thebusybiscuit.slimefun4.implementation.SlimefunItems; +import io.github.thebusybiscuit.slimefun4.implementation.SlimefunPlugin; import io.github.thebusybiscuit.slimefun4.implementation.items.armor.Parachute; import io.github.thebusybiscuit.slimefun4.implementation.items.electric.gadgets.JetBoots; import io.github.thebusybiscuit.slimefun4.implementation.items.electric.gadgets.Jetpack; @@ -15,7 +16,6 @@ import io.github.thebusybiscuit.slimefun4.implementation.tasks.JetpackTask; import io.github.thebusybiscuit.slimefun4.implementation.tasks.MagnetTask; import io.github.thebusybiscuit.slimefun4.implementation.tasks.ParachuteTask; import io.github.thebusybiscuit.slimefun4.utils.SlimefunUtils; -import me.mrCookieSlime.Slimefun.SlimefunPlugin; import me.mrCookieSlime.Slimefun.Objects.SlimefunItem.SlimefunItem; import me.mrCookieSlime.Slimefun.api.Slimefun; diff --git a/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/listeners/GrapplingHookListener.java b/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/listeners/GrapplingHookListener.java index 5bbdc21c5..bf84dce05 100644 --- a/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/listeners/GrapplingHookListener.java +++ b/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/listeners/GrapplingHookListener.java @@ -21,8 +21,8 @@ import org.bukkit.event.entity.ProjectileHitEvent; import org.bukkit.util.Vector; import io.github.thebusybiscuit.slimefun4.implementation.SlimefunItems; +import io.github.thebusybiscuit.slimefun4.implementation.SlimefunPlugin; import io.github.thebusybiscuit.slimefun4.implementation.items.tools.GrapplingHook; -import me.mrCookieSlime.Slimefun.SlimefunPlugin; import me.mrCookieSlime.Slimefun.api.Slimefun; public class GrapplingHookListener implements Listener { diff --git a/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/listeners/IronGolemListener.java b/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/listeners/IronGolemListener.java index f8b58c187..cfdcd315e 100644 --- a/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/listeners/IronGolemListener.java +++ b/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/listeners/IronGolemListener.java @@ -10,8 +10,8 @@ import org.bukkit.inventory.EquipmentSlot; import org.bukkit.inventory.ItemStack; import org.bukkit.inventory.PlayerInventory; +import io.github.thebusybiscuit.slimefun4.implementation.SlimefunPlugin; import io.github.thebusybiscuit.slimefun4.implementation.items.VanillaItem; -import me.mrCookieSlime.Slimefun.SlimefunPlugin; import me.mrCookieSlime.Slimefun.Objects.SlimefunItem.SlimefunItem; /** @@ -46,7 +46,7 @@ public class IronGolemListener implements Listener { if (sfItem != null && !(sfItem instanceof VanillaItem)) { e.setCancelled(true); - SlimefunPlugin.getLocal().sendMessage(e.getPlayer(), "messages.no-iron-golem-heal"); + SlimefunPlugin.getLocalization().sendMessage(e.getPlayer(), "messages.no-iron-golem-heal"); // This is just there to update the Inventory... // Somehow cancelling it isn't enough. diff --git a/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/listeners/ItemPickupListener.java b/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/listeners/ItemPickupListener.java index 1a3abb542..d009d5007 100644 --- a/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/listeners/ItemPickupListener.java +++ b/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/listeners/ItemPickupListener.java @@ -6,8 +6,8 @@ import org.bukkit.event.entity.EntityPickupItemEvent; import org.bukkit.event.inventory.InventoryPickupItemEvent; import io.github.thebusybiscuit.cscorelib2.chat.ChatColors; +import io.github.thebusybiscuit.slimefun4.implementation.SlimefunPlugin; import io.github.thebusybiscuit.slimefun4.utils.SlimefunUtils; -import me.mrCookieSlime.Slimefun.SlimefunPlugin; /** * Listens to the ItemPickup events to prevent it if the item has the "no_pickup" metadata or is an ALTAR_PROBE. diff --git a/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/listeners/MobDropListener.java b/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/listeners/MobDropListener.java index 248713276..346975b50 100644 --- a/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/listeners/MobDropListener.java +++ b/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/listeners/MobDropListener.java @@ -10,8 +10,8 @@ import org.bukkit.event.Listener; import org.bukkit.event.entity.EntityDeathEvent; import org.bukkit.inventory.ItemStack; +import io.github.thebusybiscuit.slimefun4.implementation.SlimefunPlugin; import io.github.thebusybiscuit.slimefun4.implementation.items.electric.BasicCircuitBoard; -import me.mrCookieSlime.Slimefun.SlimefunPlugin; import me.mrCookieSlime.Slimefun.Objects.SlimefunItem.SlimefunItem; import me.mrCookieSlime.Slimefun.Objects.handlers.EntityKillHandler; import me.mrCookieSlime.Slimefun.api.Slimefun; diff --git a/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/listeners/MultiBlockListener.java b/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/listeners/MultiBlockListener.java index 094e97855..f271295ea 100644 --- a/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/listeners/MultiBlockListener.java +++ b/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/listeners/MultiBlockListener.java @@ -16,7 +16,7 @@ import org.bukkit.inventory.EquipmentSlot; import io.github.thebusybiscuit.slimefun4.api.events.MultiBlockInteractEvent; import io.github.thebusybiscuit.slimefun4.core.multiblocks.MultiBlock; -import me.mrCookieSlime.Slimefun.SlimefunPlugin; +import io.github.thebusybiscuit.slimefun4.implementation.SlimefunPlugin; import me.mrCookieSlime.Slimefun.Objects.handlers.MultiBlockInteractionHandler; /** diff --git a/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/listeners/NetworkListener.java b/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/listeners/NetworkListener.java index 082958bd9..a8c531e2e 100644 --- a/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/listeners/NetworkListener.java +++ b/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/listeners/NetworkListener.java @@ -8,7 +8,7 @@ import org.bukkit.event.block.BlockPlaceEvent; import io.github.thebusybiscuit.slimefun4.api.network.Network; import io.github.thebusybiscuit.slimefun4.core.networks.NetworkManager; -import me.mrCookieSlime.Slimefun.SlimefunPlugin; +import io.github.thebusybiscuit.slimefun4.implementation.SlimefunPlugin; /** * This {@link Listener} is responsible for all updates to a {@link Network}. diff --git a/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/listeners/PlayerInteractEntityListener.java b/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/listeners/PlayerInteractEntityListener.java index 64e4a6d4e..c66177b10 100644 --- a/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/listeners/PlayerInteractEntityListener.java +++ b/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/listeners/PlayerInteractEntityListener.java @@ -8,9 +8,9 @@ import org.bukkit.event.player.PlayerInteractAtEntityEvent; import org.bukkit.inventory.EquipmentSlot; import org.bukkit.inventory.ItemStack; +import io.github.thebusybiscuit.slimefun4.implementation.SlimefunPlugin; import me.mrCookieSlime.Slimefun.Objects.SlimefunItem.SlimefunItem; import me.mrCookieSlime.Slimefun.Objects.handlers.EntityInteractHandler; -import me.mrCookieSlime.Slimefun.SlimefunPlugin; import me.mrCookieSlime.Slimefun.api.Slimefun; /** diff --git a/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/listeners/PlayerProfileListener.java b/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/listeners/PlayerProfileListener.java index c7aa87e36..f88b582c0 100644 --- a/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/listeners/PlayerProfileListener.java +++ b/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/listeners/PlayerProfileListener.java @@ -10,7 +10,7 @@ import org.bukkit.event.player.PlayerKickEvent; import org.bukkit.event.player.PlayerQuitEvent; import io.github.thebusybiscuit.slimefun4.api.player.PlayerProfile; -import me.mrCookieSlime.Slimefun.SlimefunPlugin; +import io.github.thebusybiscuit.slimefun4.implementation.SlimefunPlugin; /** * This {@link Listener} removes a {@link PlayerProfile} from memory if the corresponding {@link Player} diff --git a/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/listeners/SeismicAxeListener.java b/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/listeners/SeismicAxeListener.java index aae928ebf..4b5aae5fd 100644 --- a/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/listeners/SeismicAxeListener.java +++ b/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/listeners/SeismicAxeListener.java @@ -6,8 +6,8 @@ import org.bukkit.event.EventHandler; import org.bukkit.event.Listener; import org.bukkit.event.entity.EntityChangeBlockEvent; +import io.github.thebusybiscuit.slimefun4.implementation.SlimefunPlugin; import io.github.thebusybiscuit.slimefun4.implementation.items.weapons.SeismicAxe; -import me.mrCookieSlime.Slimefun.SlimefunPlugin; /** * This {@link Listener} is responsible for removing every {@link FallingBlock} that was diff --git a/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/listeners/SlimefunBootsListener.java b/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/listeners/SlimefunBootsListener.java index cd94b83fa..cc786d63e 100644 --- a/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/listeners/SlimefunBootsListener.java +++ b/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/listeners/SlimefunBootsListener.java @@ -28,9 +28,9 @@ import org.bukkit.util.Vector; import io.github.thebusybiscuit.cscorelib2.protection.ProtectableAction; import io.github.thebusybiscuit.slimefun4.implementation.SlimefunItems; +import io.github.thebusybiscuit.slimefun4.implementation.SlimefunPlugin; import io.github.thebusybiscuit.slimefun4.implementation.items.armor.SlimefunArmorPiece; import io.github.thebusybiscuit.slimefun4.utils.SlimefunUtils; -import me.mrCookieSlime.Slimefun.SlimefunPlugin; import me.mrCookieSlime.Slimefun.Objects.SlimefunItem.SlimefunItem; import me.mrCookieSlime.Slimefun.api.Slimefun; diff --git a/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/listeners/SlimefunBowListener.java b/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/listeners/SlimefunBowListener.java index b20e8c54f..e5d458dfe 100644 --- a/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/listeners/SlimefunBowListener.java +++ b/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/listeners/SlimefunBowListener.java @@ -13,8 +13,8 @@ import org.bukkit.event.entity.EntityDamageByEntityEvent; import org.bukkit.event.entity.EntityShootBowEvent; import org.bukkit.event.entity.ProjectileHitEvent; +import io.github.thebusybiscuit.slimefun4.implementation.SlimefunPlugin; import io.github.thebusybiscuit.slimefun4.implementation.items.weapons.SlimefunBow; -import me.mrCookieSlime.Slimefun.SlimefunPlugin; import me.mrCookieSlime.Slimefun.Objects.SlimefunItem.SlimefunItem; import me.mrCookieSlime.Slimefun.Objects.handlers.BowShootHandler; import me.mrCookieSlime.Slimefun.api.Slimefun; diff --git a/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/listeners/SlimefunGuideListener.java b/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/listeners/SlimefunGuideListener.java index 186365caa..760ef9faf 100644 --- a/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/listeners/SlimefunGuideListener.java +++ b/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/listeners/SlimefunGuideListener.java @@ -12,8 +12,8 @@ import io.github.thebusybiscuit.slimefun4.api.events.PlayerRightClickEvent; import io.github.thebusybiscuit.slimefun4.core.guide.SlimefunGuide; import io.github.thebusybiscuit.slimefun4.core.guide.SlimefunGuideLayout; import io.github.thebusybiscuit.slimefun4.core.guide.options.SlimefunGuideSettings; +import io.github.thebusybiscuit.slimefun4.implementation.SlimefunPlugin; import io.github.thebusybiscuit.slimefun4.utils.SlimefunUtils; -import me.mrCookieSlime.Slimefun.SlimefunPlugin; public class SlimefunGuideListener implements Listener { @@ -73,7 +73,7 @@ public class SlimefunGuideListener implements Listener { e.cancel(); if (!SlimefunPlugin.getWorldSettingsService().isWorldEnabled(p.getWorld())) { - SlimefunPlugin.getLocal().sendMessage(p, "messages.disabled-item", true); + SlimefunPlugin.getLocalization().sendMessage(p, "messages.disabled-item", true); return Result.DENY; } diff --git a/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/listeners/SlimefunItemConsumeListener.java b/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/listeners/SlimefunItemConsumeListener.java index 02af36eaa..937db4a8b 100644 --- a/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/listeners/SlimefunItemConsumeListener.java +++ b/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/listeners/SlimefunItemConsumeListener.java @@ -10,9 +10,9 @@ import org.bukkit.inventory.meta.PotionMeta; import org.bukkit.potion.PotionEffect; import org.bukkit.potion.PotionEffectType; +import io.github.thebusybiscuit.slimefun4.implementation.SlimefunPlugin; import io.github.thebusybiscuit.slimefun4.implementation.items.food.Juice; import io.github.thebusybiscuit.slimefun4.utils.SlimefunUtils; -import me.mrCookieSlime.Slimefun.SlimefunPlugin; import me.mrCookieSlime.Slimefun.Objects.SlimefunItem.SlimefunItem; import me.mrCookieSlime.Slimefun.Objects.handlers.ItemConsumptionHandler; import me.mrCookieSlime.Slimefun.api.Slimefun; diff --git a/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/listeners/SlimefunItemListener.java b/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/listeners/SlimefunItemListener.java index 17553bb07..f440c2a98 100644 --- a/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/listeners/SlimefunItemListener.java +++ b/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/listeners/SlimefunItemListener.java @@ -15,8 +15,8 @@ import org.bukkit.inventory.EquipmentSlot; import io.github.thebusybiscuit.slimefun4.api.events.PlayerRightClickEvent; import io.github.thebusybiscuit.slimefun4.implementation.SlimefunItems; +import io.github.thebusybiscuit.slimefun4.implementation.SlimefunPlugin; import io.github.thebusybiscuit.slimefun4.utils.SlimefunUtils; -import me.mrCookieSlime.Slimefun.SlimefunPlugin; import me.mrCookieSlime.Slimefun.Objects.SlimefunItem.SlimefunItem; import me.mrCookieSlime.Slimefun.Objects.handlers.BlockUseHandler; import me.mrCookieSlime.Slimefun.Objects.handlers.ItemDropHandler; @@ -115,7 +115,7 @@ public class SlimefunItemListener implements Listener { menu.open(p); } else { - SlimefunPlugin.getLocal().sendMessage(p, "inventory.no-access", true); + SlimefunPlugin.getLocalization().sendMessage(p, "inventory.no-access", true); } } else if (BlockStorage.getStorage(e.getClickedBlock().getWorld()).hasInventory(e.getClickedBlock().getLocation())) { @@ -125,7 +125,7 @@ public class SlimefunItemListener implements Listener { menu.open(p); } else { - SlimefunPlugin.getLocal().sendMessage(p, "inventory.no-access", true); + SlimefunPlugin.getLocalization().sendMessage(p, "inventory.no-access", true); } } } diff --git a/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/listeners/SoulboundListener.java b/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/listeners/SoulboundListener.java index 03d3aacb9..af78211b5 100644 --- a/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/listeners/SoulboundListener.java +++ b/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/listeners/SoulboundListener.java @@ -12,8 +12,8 @@ import org.bukkit.event.entity.PlayerDeathEvent; import org.bukkit.event.player.PlayerRespawnEvent; import org.bukkit.inventory.ItemStack; +import io.github.thebusybiscuit.slimefun4.implementation.SlimefunPlugin; import io.github.thebusybiscuit.slimefun4.utils.SlimefunUtils; -import me.mrCookieSlime.Slimefun.SlimefunPlugin; public class SoulboundListener implements Listener { diff --git a/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/listeners/TalismanListener.java b/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/listeners/TalismanListener.java index a238d7dd8..1c1c2c114 100644 --- a/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/listeners/TalismanListener.java +++ b/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/listeners/TalismanListener.java @@ -37,10 +37,10 @@ import org.bukkit.util.Vector; import io.github.thebusybiscuit.cscorelib2.item.CustomItem; import io.github.thebusybiscuit.cscorelib2.materials.MaterialCollections; import io.github.thebusybiscuit.slimefun4.implementation.SlimefunItems; +import io.github.thebusybiscuit.slimefun4.implementation.SlimefunPlugin; import io.github.thebusybiscuit.slimefun4.implementation.items.magical.talismans.MagicianTalisman; import io.github.thebusybiscuit.slimefun4.implementation.items.magical.talismans.Talisman; import io.github.thebusybiscuit.slimefun4.implementation.items.magical.talismans.TalismanEnchantment; -import me.mrCookieSlime.Slimefun.SlimefunPlugin; import me.mrCookieSlime.Slimefun.api.Slimefun; public class TalismanListener implements Listener { diff --git a/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/listeners/TeleporterListener.java b/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/listeners/TeleporterListener.java index 243b77ab7..cc2bd0e98 100644 --- a/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/listeners/TeleporterListener.java +++ b/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/listeners/TeleporterListener.java @@ -11,9 +11,9 @@ import org.bukkit.event.block.Action; import org.bukkit.event.player.PlayerInteractEvent; import io.github.thebusybiscuit.slimefun4.implementation.SlimefunItems; +import io.github.thebusybiscuit.slimefun4.implementation.SlimefunPlugin; import io.github.thebusybiscuit.slimefun4.implementation.items.gps.ElevatorPlate; import io.github.thebusybiscuit.slimefun4.implementation.items.gps.Teleporter; -import me.mrCookieSlime.Slimefun.SlimefunPlugin; import me.mrCookieSlime.Slimefun.Objects.SlimefunItem.SlimefunItem; import me.mrCookieSlime.Slimefun.api.BlockStorage; diff --git a/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/listeners/VampireBladeListener.java b/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/listeners/VampireBladeListener.java index 4377b2a23..1fdfe5d89 100644 --- a/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/listeners/VampireBladeListener.java +++ b/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/listeners/VampireBladeListener.java @@ -9,8 +9,8 @@ import org.bukkit.event.Listener; import org.bukkit.event.entity.EntityDamageByEntityEvent; import org.bukkit.potion.PotionEffect; +import io.github.thebusybiscuit.slimefun4.implementation.SlimefunPlugin; import io.github.thebusybiscuit.slimefun4.implementation.items.weapons.VampireBlade; -import me.mrCookieSlime.Slimefun.SlimefunPlugin; import me.mrCookieSlime.Slimefun.api.Slimefun; /** diff --git a/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/listeners/VanillaMachinesListener.java b/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/listeners/VanillaMachinesListener.java index 17fe7ee4d..ed660f5cc 100644 --- a/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/listeners/VanillaMachinesListener.java +++ b/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/listeners/VanillaMachinesListener.java @@ -14,8 +14,8 @@ import org.bukkit.inventory.ItemStack; import io.github.thebusybiscuit.slimefun4.api.MinecraftVersion; import io.github.thebusybiscuit.slimefun4.core.guide.SlimefunGuide; +import io.github.thebusybiscuit.slimefun4.implementation.SlimefunPlugin; import io.github.thebusybiscuit.slimefun4.implementation.items.VanillaItem; -import me.mrCookieSlime.Slimefun.SlimefunPlugin; import me.mrCookieSlime.Slimefun.Objects.SlimefunItem.SlimefunItem; /** @@ -60,7 +60,7 @@ public class VanillaMachinesListener implements Listener { if (sfItem != null && !sfItem.isUseableInWorkbench()) { e.setResult(Result.DENY); - SlimefunPlugin.getLocal().sendMessage((Player) e.getWhoClicked(), "workbench.not-enhanced", true); + SlimefunPlugin.getLocalization().sendMessage((Player) e.getWhoClicked(), "workbench.not-enhanced", true); break; } } @@ -88,7 +88,7 @@ public class VanillaMachinesListener implements Listener { if (checkForUnallowedItems(item1, item2)) { e.setResult(Result.DENY); - SlimefunPlugin.getLocal().sendMessage((Player) e.getWhoClicked(), "anvil.not-working", true); + SlimefunPlugin.getLocalization().sendMessage((Player) e.getWhoClicked(), "anvil.not-working", true); } } } diff --git a/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/listeners/WitherListener.java b/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/listeners/WitherListener.java index 5957d5b4d..f60400221 100644 --- a/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/listeners/WitherListener.java +++ b/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/listeners/WitherListener.java @@ -7,7 +7,7 @@ import org.bukkit.event.Listener; import org.bukkit.event.entity.EntityChangeBlockEvent; import io.github.thebusybiscuit.slimefun4.core.attributes.WitherProof; -import me.mrCookieSlime.Slimefun.SlimefunPlugin; +import io.github.thebusybiscuit.slimefun4.implementation.SlimefunPlugin; import me.mrCookieSlime.Slimefun.api.BlockStorage; /** diff --git a/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/listeners/WorldListener.java b/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/listeners/WorldListener.java index 2ebb33834..31b64d0c2 100644 --- a/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/listeners/WorldListener.java +++ b/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/listeners/WorldListener.java @@ -7,7 +7,7 @@ import org.bukkit.event.Listener; import org.bukkit.event.world.WorldLoadEvent; import org.bukkit.event.world.WorldUnloadEvent; -import me.mrCookieSlime.Slimefun.SlimefunPlugin; +import io.github.thebusybiscuit.slimefun4.implementation.SlimefunPlugin; import me.mrCookieSlime.Slimefun.api.BlockStorage; import me.mrCookieSlime.Slimefun.api.Slimefun; diff --git a/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/resources/NetherIceResource.java b/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/resources/NetherIceResource.java index 3a1ab409f..5a1e0f7c8 100644 --- a/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/resources/NetherIceResource.java +++ b/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/resources/NetherIceResource.java @@ -7,7 +7,7 @@ import org.bukkit.inventory.ItemStack; import io.github.thebusybiscuit.slimefun4.api.geo.GEOResource; import io.github.thebusybiscuit.slimefun4.implementation.SlimefunItems; -import me.mrCookieSlime.Slimefun.SlimefunPlugin; +import io.github.thebusybiscuit.slimefun4.implementation.SlimefunPlugin; class NetherIceResource implements GEOResource { diff --git a/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/resources/OilResource.java b/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/resources/OilResource.java index ec1d441cc..44ff1a090 100644 --- a/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/resources/OilResource.java +++ b/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/resources/OilResource.java @@ -7,7 +7,7 @@ import org.bukkit.inventory.ItemStack; import io.github.thebusybiscuit.slimefun4.api.geo.GEOResource; import io.github.thebusybiscuit.slimefun4.implementation.SlimefunItems; -import me.mrCookieSlime.Slimefun.SlimefunPlugin; +import io.github.thebusybiscuit.slimefun4.implementation.SlimefunPlugin; class OilResource implements GEOResource { diff --git a/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/resources/SaltResource.java b/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/resources/SaltResource.java index cee51728a..5a4cabb61 100644 --- a/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/resources/SaltResource.java +++ b/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/resources/SaltResource.java @@ -7,7 +7,7 @@ import org.bukkit.inventory.ItemStack; import io.github.thebusybiscuit.slimefun4.api.geo.GEOResource; import io.github.thebusybiscuit.slimefun4.implementation.SlimefunItems; -import me.mrCookieSlime.Slimefun.SlimefunPlugin; +import io.github.thebusybiscuit.slimefun4.implementation.SlimefunPlugin; class SaltResource implements GEOResource { diff --git a/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/resources/UraniumResource.java b/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/resources/UraniumResource.java index 06cb38a5f..a98010ac1 100644 --- a/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/resources/UraniumResource.java +++ b/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/resources/UraniumResource.java @@ -7,7 +7,7 @@ import org.bukkit.inventory.ItemStack; import io.github.thebusybiscuit.slimefun4.api.geo.GEOResource; import io.github.thebusybiscuit.slimefun4.implementation.SlimefunItems; -import me.mrCookieSlime.Slimefun.SlimefunPlugin; +import io.github.thebusybiscuit.slimefun4.implementation.SlimefunPlugin; class UraniumResource implements GEOResource { diff --git a/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/setup/DefaultCategories.java b/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/setup/DefaultCategories.java index bfedcc391..c18221bc3 100644 --- a/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/setup/DefaultCategories.java +++ b/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/setup/DefaultCategories.java @@ -9,10 +9,10 @@ import io.github.thebusybiscuit.cscorelib2.item.CustomItem; import io.github.thebusybiscuit.slimefun4.core.categories.LockedCategory; import io.github.thebusybiscuit.slimefun4.core.categories.SeasonalCategory; import io.github.thebusybiscuit.slimefun4.implementation.SlimefunItems; +import io.github.thebusybiscuit.slimefun4.implementation.SlimefunPlugin; import io.github.thebusybiscuit.slimefun4.utils.ChatUtils; import io.github.thebusybiscuit.slimefun4.utils.HeadTexture; import io.github.thebusybiscuit.slimefun4.utils.SlimefunUtils; -import me.mrCookieSlime.Slimefun.SlimefunPlugin; import me.mrCookieSlime.Slimefun.Objects.Category; /** diff --git a/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/setup/PostSetup.java b/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/setup/PostSetup.java index 4f41c20ed..b4fffe314 100644 --- a/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/setup/PostSetup.java +++ b/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/setup/PostSetup.java @@ -24,6 +24,7 @@ import com.google.gson.JsonObject; import com.google.gson.JsonParser; import io.github.thebusybiscuit.slimefun4.implementation.SlimefunItems; +import io.github.thebusybiscuit.slimefun4.implementation.SlimefunPlugin; import io.github.thebusybiscuit.slimefun4.implementation.items.electric.machines.AutomatedCraftingChamber; import io.github.thebusybiscuit.slimefun4.implementation.items.multiblocks.EnhancedCraftingTable; import io.github.thebusybiscuit.slimefun4.implementation.items.multiblocks.GrindStone; @@ -32,7 +33,6 @@ import io.github.thebusybiscuit.slimefun4.implementation.items.multiblocks.OreCr import io.github.thebusybiscuit.slimefun4.implementation.items.multiblocks.Smeltery; import me.mrCookieSlime.CSCoreLibPlugin.general.Inventory.Item.CustomItemSerializer; import me.mrCookieSlime.CSCoreLibPlugin.general.Inventory.Item.CustomItemSerializer.ItemFlag; -import me.mrCookieSlime.Slimefun.SlimefunPlugin; import me.mrCookieSlime.Slimefun.Lists.RecipeType; import me.mrCookieSlime.Slimefun.Objects.SlimefunItem.SlimefunItem; import me.mrCookieSlime.Slimefun.Objects.SlimefunItem.abstractItems.AContainer; diff --git a/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/setup/ResearchSetup.java b/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/setup/ResearchSetup.java index 93e44701d..60fc71b48 100644 --- a/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/setup/ResearchSetup.java +++ b/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/setup/ResearchSetup.java @@ -6,7 +6,7 @@ import org.bukkit.inventory.ItemStack; import io.github.thebusybiscuit.slimefun4.core.researching.Research; import io.github.thebusybiscuit.slimefun4.implementation.SlimefunItems; -import me.mrCookieSlime.Slimefun.SlimefunPlugin; +import io.github.thebusybiscuit.slimefun4.implementation.SlimefunPlugin; import me.mrCookieSlime.Slimefun.Objects.SlimefunItem.SlimefunItem; /** diff --git a/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/setup/SlimefunItemSetup.java b/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/setup/SlimefunItemSetup.java index 33335b37d..49504bda3 100644 --- a/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/setup/SlimefunItemSetup.java +++ b/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/setup/SlimefunItemSetup.java @@ -17,6 +17,7 @@ import io.github.thebusybiscuit.slimefun4.api.MinecraftVersion; import io.github.thebusybiscuit.slimefun4.api.SlimefunAddon; import io.github.thebusybiscuit.slimefun4.core.attributes.Radioactivity; import io.github.thebusybiscuit.slimefun4.implementation.SlimefunItems; +import io.github.thebusybiscuit.slimefun4.implementation.SlimefunPlugin; import io.github.thebusybiscuit.slimefun4.implementation.items.RadioactiveItem; import io.github.thebusybiscuit.slimefun4.implementation.items.VanillaItem; import io.github.thebusybiscuit.slimefun4.implementation.items.altar.AncientAltar; @@ -174,7 +175,6 @@ import io.github.thebusybiscuit.slimefun4.implementation.items.weapons.SeismicAx import io.github.thebusybiscuit.slimefun4.implementation.items.weapons.SwordOfBeheading; import io.github.thebusybiscuit.slimefun4.implementation.items.weapons.VampireBlade; import io.github.thebusybiscuit.slimefun4.utils.SlimefunUtils; -import me.mrCookieSlime.Slimefun.SlimefunPlugin; import me.mrCookieSlime.Slimefun.Lists.RecipeType; import me.mrCookieSlime.Slimefun.Objects.Category; import me.mrCookieSlime.Slimefun.Objects.SlimefunItem.SlimefunItem; diff --git a/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/tasks/AncientAltarTask.java b/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/tasks/AncientAltarTask.java index 9a15242f7..29cc8a153 100644 --- a/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/tasks/AncientAltarTask.java +++ b/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/tasks/AncientAltarTask.java @@ -18,9 +18,9 @@ import org.bukkit.entity.Item; import org.bukkit.entity.Player; import org.bukkit.inventory.ItemStack; +import io.github.thebusybiscuit.slimefun4.implementation.SlimefunPlugin; import io.github.thebusybiscuit.slimefun4.implementation.items.altar.AncientAltar; import io.github.thebusybiscuit.slimefun4.implementation.listeners.AncientAltarListener; -import me.mrCookieSlime.Slimefun.SlimefunPlugin; import me.mrCookieSlime.Slimefun.api.Slimefun; /** diff --git a/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/tasks/ArmorTask.java b/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/tasks/ArmorTask.java index dbcde28bf..a64607702 100644 --- a/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/tasks/ArmorTask.java +++ b/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/tasks/ArmorTask.java @@ -16,10 +16,10 @@ import io.github.thebusybiscuit.slimefun4.api.items.HashedArmorpiece; import io.github.thebusybiscuit.slimefun4.api.player.PlayerProfile; import io.github.thebusybiscuit.slimefun4.core.attributes.Radioactive; import io.github.thebusybiscuit.slimefun4.implementation.SlimefunItems; +import io.github.thebusybiscuit.slimefun4.implementation.SlimefunPlugin; import io.github.thebusybiscuit.slimefun4.implementation.items.armor.SlimefunArmorPiece; import io.github.thebusybiscuit.slimefun4.implementation.items.electric.gadgets.SolarHelmet; import io.github.thebusybiscuit.slimefun4.utils.SlimefunUtils; -import me.mrCookieSlime.Slimefun.SlimefunPlugin; import me.mrCookieSlime.Slimefun.Objects.SlimefunItem.SlimefunItem; import me.mrCookieSlime.Slimefun.api.Slimefun; @@ -134,7 +134,7 @@ public class ArmorTask implements Runnable { for (SlimefunItem radioactiveItem : SlimefunPlugin.getRegistry().getRadioactiveItems()) { if (radioactiveItem.isItem(item) && Slimefun.isEnabled(p, radioactiveItem, true)) { // If the item is enabled in the world, then make radioactivity do its job - SlimefunPlugin.getLocal().sendMessage(p, "messages.radiation"); + SlimefunPlugin.getLocalization().sendMessage(p, "messages.radiation"); Slimefun.runSync(() -> { p.addPotionEffects(radiationEffects); diff --git a/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/tasks/PlayerTask.java b/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/tasks/PlayerTask.java index d6ec1122a..0a77c0f14 100644 --- a/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/tasks/PlayerTask.java +++ b/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/tasks/PlayerTask.java @@ -1,9 +1,10 @@ package io.github.thebusybiscuit.slimefun4.implementation.tasks; -import me.mrCookieSlime.Slimefun.SlimefunPlugin; import org.bukkit.Bukkit; import org.bukkit.entity.Player; +import io.github.thebusybiscuit.slimefun4.implementation.SlimefunPlugin; + abstract class PlayerTask implements Runnable { protected int id; diff --git a/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/tasks/SlimefunStartupTask.java b/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/tasks/SlimefunStartupTask.java index 691b15913..d3d5ee38e 100644 --- a/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/tasks/SlimefunStartupTask.java +++ b/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/tasks/SlimefunStartupTask.java @@ -5,11 +5,11 @@ import java.util.logging.Level; import org.bukkit.Bukkit; import org.bukkit.World; +import io.github.thebusybiscuit.slimefun4.implementation.SlimefunPlugin; import io.github.thebusybiscuit.slimefun4.implementation.listeners.ButcherAndroidListener; import io.github.thebusybiscuit.slimefun4.implementation.listeners.NetworkListener; import io.github.thebusybiscuit.slimefun4.implementation.listeners.TeleporterListener; import io.github.thebusybiscuit.slimefun4.implementation.setup.PostSetup; -import me.mrCookieSlime.Slimefun.SlimefunPlugin; import me.mrCookieSlime.Slimefun.Objects.SlimefunItem.SlimefunItem; import me.mrCookieSlime.Slimefun.api.BlockStorage; import me.mrCookieSlime.Slimefun.api.Slimefun; diff --git a/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/tasks/TickerTask.java b/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/tasks/TickerTask.java index 6d8980c40..bebfe79d0 100644 --- a/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/tasks/TickerTask.java +++ b/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/tasks/TickerTask.java @@ -28,9 +28,9 @@ import org.bukkit.entity.Player; import io.github.thebusybiscuit.cscorelib2.chat.ChatColors; import io.github.thebusybiscuit.slimefun4.api.ErrorReport; +import io.github.thebusybiscuit.slimefun4.implementation.SlimefunPlugin; import io.github.thebusybiscuit.slimefun4.utils.NumberUtils; import io.github.thebusybiscuit.slimefun4.utils.PatternUtils; -import me.mrCookieSlime.Slimefun.SlimefunPlugin; import me.mrCookieSlime.Slimefun.Objects.SlimefunItem.SlimefunItem; import me.mrCookieSlime.Slimefun.Objects.handlers.BlockTicker; import me.mrCookieSlime.Slimefun.api.BlockStorage; diff --git a/src/main/java/io/github/thebusybiscuit/slimefun4/utils/ChatUtils.java b/src/main/java/io/github/thebusybiscuit/slimefun4/utils/ChatUtils.java index cec83946f..d6bac1e3c 100644 --- a/src/main/java/io/github/thebusybiscuit/slimefun4/utils/ChatUtils.java +++ b/src/main/java/io/github/thebusybiscuit/slimefun4/utils/ChatUtils.java @@ -9,7 +9,7 @@ import org.bukkit.entity.Player; import io.github.thebusybiscuit.cscorelib2.chat.ChatColors; import io.github.thebusybiscuit.cscorelib2.chat.ChatInput; -import me.mrCookieSlime.Slimefun.SlimefunPlugin; +import io.github.thebusybiscuit.slimefun4.implementation.SlimefunPlugin; /** * This utility class contains a few static methods that are all about {@link String} manipulation @@ -25,7 +25,7 @@ public final class ChatUtils { public static void sendURL(CommandSender sender, String url) { // If we get access to the URL prompt one day, we can just prompt the link to the Player that way. sender.sendMessage(""); - SlimefunPlugin.getLocal().sendMessage(sender, "messages.link-prompt", false); + SlimefunPlugin.getLocalization().sendMessage(sender, "messages.link-prompt", false); sender.sendMessage(ChatColors.color("&7&o" + url)); sender.sendMessage(""); } diff --git a/src/main/java/io/github/thebusybiscuit/slimefun4/utils/ChestMenuUtils.java b/src/main/java/io/github/thebusybiscuit/slimefun4/utils/ChestMenuUtils.java index a2ae247f3..0c861495f 100644 --- a/src/main/java/io/github/thebusybiscuit/slimefun4/utils/ChestMenuUtils.java +++ b/src/main/java/io/github/thebusybiscuit/slimefun4/utils/ChestMenuUtils.java @@ -13,9 +13,9 @@ import org.bukkit.inventory.meta.ItemMeta; import io.github.thebusybiscuit.cscorelib2.chat.ChatColors; import io.github.thebusybiscuit.cscorelib2.item.CustomItem; +import io.github.thebusybiscuit.slimefun4.implementation.SlimefunPlugin; import me.mrCookieSlime.CSCoreLibPlugin.general.Inventory.ChestMenu; import me.mrCookieSlime.CSCoreLibPlugin.general.Inventory.ChestMenu.MenuClickHandler; -import me.mrCookieSlime.Slimefun.SlimefunPlugin; import me.mrCookieSlime.Slimefun.api.SlimefunItemStack; public final class ChestMenuUtils { @@ -44,18 +44,18 @@ public final class ChestMenuUtils { } public static ItemStack getBackButton(Player p, String... lore) { - return new CustomItem(BACK_BUTTON, "&7\u21E6 " + SlimefunPlugin.getLocal().getMessage(p, "guide.back.title"), lore); + return new CustomItem(BACK_BUTTON, "&7\u21E6 " + SlimefunPlugin.getLocalization().getMessage(p, "guide.back.title"), lore); } public static ItemStack getMenuButton(Player p) { - return new CustomItem(MENU_BUTTON, ChatColor.YELLOW + SlimefunPlugin.getLocal().getMessage(p, "guide.title.settings"), "", "&7\u21E8 " + SlimefunPlugin.getLocal().getMessage(p, "guide.tooltips.open-category")); + return new CustomItem(MENU_BUTTON, ChatColor.YELLOW + SlimefunPlugin.getLocalization().getMessage(p, "guide.title.settings"), "", "&7\u21E8 " + SlimefunPlugin.getLocalization().getMessage(p, "guide.tooltips.open-category")); } public static ItemStack getSearchButton(Player p) { return new CustomItem(SEARCH_BUTTON, meta -> { - meta.setDisplayName(ChatColors.color(SlimefunPlugin.getLocal().getMessage(p, "guide.search.name"))); + meta.setDisplayName(ChatColors.color(SlimefunPlugin.getLocalization().getMessage(p, "guide.search.name"))); - List lore = Arrays.asList("", ChatColor.GRAY + "\u21E8 " + SlimefunPlugin.getLocal().getMessage(p, "guide.search.tooltip")); + List lore = Arrays.asList("", ChatColor.GRAY + "\u21E8 " + SlimefunPlugin.getLocalization().getMessage(p, "guide.search.tooltip")); lore.replaceAll(ChatColors::color); meta.setLore(lore); }); @@ -68,13 +68,13 @@ public final class ChestMenuUtils { public static ItemStack getPreviousButton(Player p, int page, int pages) { if (pages == 1 || page == 1) { return new CustomItem(PREV_BUTTON_INACTIVE, meta -> { - meta.setDisplayName(ChatColor.DARK_GRAY + "\u21E6 " + SlimefunPlugin.getLocal().getMessage(p, "guide.pages.previous")); + meta.setDisplayName(ChatColor.DARK_GRAY + "\u21E6 " + SlimefunPlugin.getLocalization().getMessage(p, "guide.pages.previous")); meta.setLore(Arrays.asList("", ChatColor.GRAY + "(" + page + " / " + pages + ")")); }); } return new CustomItem(PREV_BUTTON_ACTIVE, meta -> { - meta.setDisplayName(ChatColor.WHITE + "\u21E6 " + SlimefunPlugin.getLocal().getMessage(p, "guide.pages.previous")); + meta.setDisplayName(ChatColor.WHITE + "\u21E6 " + SlimefunPlugin.getLocalization().getMessage(p, "guide.pages.previous")); meta.setLore(Arrays.asList("", ChatColor.GRAY + "(" + page + " / " + pages + ")")); }); } @@ -82,13 +82,13 @@ public final class ChestMenuUtils { public static ItemStack getNextButton(Player p, int page, int pages) { if (pages == 1 || page == pages) { return new CustomItem(NEXT_BUTTON_INACTIVE, meta -> { - meta.setDisplayName(ChatColor.DARK_GRAY + SlimefunPlugin.getLocal().getMessage(p, "guide.pages.next") + " \u21E8"); + meta.setDisplayName(ChatColor.DARK_GRAY + SlimefunPlugin.getLocalization().getMessage(p, "guide.pages.next") + " \u21E8"); meta.setLore(Arrays.asList("", ChatColor.GRAY + "(" + page + " / " + pages + ")")); }); } return new CustomItem(NEXT_BUTTON_ACTIVE, meta -> { - meta.setDisplayName(ChatColor.WHITE + SlimefunPlugin.getLocal().getMessage(p, "guide.pages.next") + " \u21E8"); + meta.setDisplayName(ChatColor.WHITE + SlimefunPlugin.getLocalization().getMessage(p, "guide.pages.next") + " \u21E8"); meta.setLore(Arrays.asList("", ChatColor.GRAY + "(" + page + " / " + pages + ")")); }); } diff --git a/src/main/java/io/github/thebusybiscuit/slimefun4/utils/HeadTexture.java b/src/main/java/io/github/thebusybiscuit/slimefun4/utils/HeadTexture.java index 43abab960..d8aecf27e 100644 --- a/src/main/java/io/github/thebusybiscuit/slimefun4/utils/HeadTexture.java +++ b/src/main/java/io/github/thebusybiscuit/slimefun4/utils/HeadTexture.java @@ -95,7 +95,8 @@ public enum HeadTexture { NUCLEAR_REACTOR("fa5de0bc2bfb5cc2d23eb72f96402ada479524dd0de404bc23b6dacee3ffd080"), NETHER_STAR_REACTOR("a11ed1d1b25b624665ecdddc3d3a5dff0b9f35e3de77a12f516e60fe8501cc8d"), UNKNOWN("46ba63344f49dd1c4f5488e926bf3d9e2b29916a6c50d610bb40a5273dc8c82"), - MISSING_TEXTURE("e9eb9da26cf2d3341397a7f4913ba3d37d1ad10eae30ab25fa39ceb84bc"); + MISSING_TEXTURE("e9eb9da26cf2d3341397a7f4913ba3d37d1ad10eae30ab25fa39ceb84bc"), + MINECRAFT_CHUNK("8449b9318e33158e64a46ab0de121c3d40000e3332c1574932b3c849d8fa0dc2"); private final String texture; diff --git a/src/main/java/io/github/thebusybiscuit/slimefun4/utils/SlimefunUtils.java b/src/main/java/io/github/thebusybiscuit/slimefun4/utils/SlimefunUtils.java index 2e93ca6aa..99e233fab 100644 --- a/src/main/java/io/github/thebusybiscuit/slimefun4/utils/SlimefunUtils.java +++ b/src/main/java/io/github/thebusybiscuit/slimefun4/utils/SlimefunUtils.java @@ -23,11 +23,11 @@ import io.github.thebusybiscuit.slimefun4.api.MinecraftVersion; import io.github.thebusybiscuit.slimefun4.api.exceptions.PrematureCodeException; import io.github.thebusybiscuit.slimefun4.core.attributes.Radioactive; import io.github.thebusybiscuit.slimefun4.core.attributes.Soulbound; +import io.github.thebusybiscuit.slimefun4.implementation.SlimefunPlugin; import io.github.thebusybiscuit.slimefun4.implementation.items.altar.AncientPedestal; import io.github.thebusybiscuit.slimefun4.utils.itemstack.ItemStackWrapper; import me.mrCookieSlime.EmeraldEnchants.EmeraldEnchants; import me.mrCookieSlime.EmeraldEnchants.ItemEnchantment; -import me.mrCookieSlime.Slimefun.SlimefunPlugin; import me.mrCookieSlime.Slimefun.Objects.SlimefunItem.SlimefunItem; import me.mrCookieSlime.Slimefun.api.SlimefunItemStack; diff --git a/src/main/java/me/mrCookieSlime/Slimefun/Lists/RecipeType.java b/src/main/java/me/mrCookieSlime/Slimefun/Lists/RecipeType.java index 5dddac6e0..646bb5c01 100644 --- a/src/main/java/me/mrCookieSlime/Slimefun/Lists/RecipeType.java +++ b/src/main/java/me/mrCookieSlime/Slimefun/Lists/RecipeType.java @@ -21,8 +21,8 @@ import io.github.thebusybiscuit.cscorelib2.item.CustomItem; import io.github.thebusybiscuit.cscorelib2.recipes.MinecraftRecipe; import io.github.thebusybiscuit.slimefun4.core.multiblocks.MultiBlockMachine; import io.github.thebusybiscuit.slimefun4.implementation.SlimefunItems; +import io.github.thebusybiscuit.slimefun4.implementation.SlimefunPlugin; import io.github.thebusybiscuit.slimefun4.implementation.items.altar.AltarRecipe; -import me.mrCookieSlime.Slimefun.SlimefunPlugin; import me.mrCookieSlime.Slimefun.Objects.SlimefunItem.SlimefunItem; import me.mrCookieSlime.Slimefun.api.SlimefunItemStack; @@ -129,7 +129,7 @@ public class RecipeType implements Keyed { } public ItemStack getItem(Player p) { - return SlimefunPlugin.getLocal().getRecipeTypeItem(p, this); + return SlimefunPlugin.getLocalization().getRecipeTypeItem(p, this); } public SlimefunItem getMachine() { diff --git a/src/main/java/me/mrCookieSlime/Slimefun/Objects/Category.java b/src/main/java/me/mrCookieSlime/Slimefun/Objects/Category.java index 7a45f8535..2d10efc09 100644 --- a/src/main/java/me/mrCookieSlime/Slimefun/Objects/Category.java +++ b/src/main/java/me/mrCookieSlime/Slimefun/Objects/Category.java @@ -19,7 +19,7 @@ import io.github.thebusybiscuit.cscorelib2.item.CustomItem; import io.github.thebusybiscuit.slimefun4.core.categories.LockedCategory; import io.github.thebusybiscuit.slimefun4.core.categories.SeasonalCategory; import io.github.thebusybiscuit.slimefun4.core.guide.SlimefunGuide; -import me.mrCookieSlime.Slimefun.SlimefunPlugin; +import io.github.thebusybiscuit.slimefun4.implementation.SlimefunPlugin; import me.mrCookieSlime.Slimefun.Objects.SlimefunItem.SlimefunItem; import me.mrCookieSlime.Slimefun.api.Slimefun; @@ -131,7 +131,7 @@ public class Category implements Keyed { */ public ItemStack getItem(Player p) { return new CustomItem(item, meta -> { - String name = SlimefunPlugin.getLocal().getCategoryName(p, getKey()); + String name = SlimefunPlugin.getLocalization().getCategoryName(p, getKey()); if (name == null) name = item.getItemMeta().getDisplayName(); if (this instanceof SeasonalCategory) { @@ -141,7 +141,7 @@ public class Category implements Keyed { meta.setDisplayName(ChatColor.YELLOW + name); } - meta.setLore(Arrays.asList("", ChatColor.GRAY + "\u21E8 " + ChatColor.GREEN + SlimefunPlugin.getLocal().getMessage(p, "guide.tooltips.open-category"))); + meta.setLore(Arrays.asList("", ChatColor.GRAY + "\u21E8 " + ChatColor.GREEN + SlimefunPlugin.getLocalization().getMessage(p, "guide.tooltips.open-category"))); }); } diff --git a/src/main/java/me/mrCookieSlime/Slimefun/Objects/SlimefunItem/SlimefunItem.java b/src/main/java/me/mrCookieSlime/Slimefun/Objects/SlimefunItem/SlimefunItem.java index 58d084165..755b679de 100644 --- a/src/main/java/me/mrCookieSlime/Slimefun/Objects/SlimefunItem/SlimefunItem.java +++ b/src/main/java/me/mrCookieSlime/Slimefun/Objects/SlimefunItem/SlimefunItem.java @@ -32,13 +32,13 @@ import io.github.thebusybiscuit.slimefun4.core.attributes.Rechargeable; import io.github.thebusybiscuit.slimefun4.core.attributes.WitherProof; import io.github.thebusybiscuit.slimefun4.core.guide.SlimefunGuide; import io.github.thebusybiscuit.slimefun4.core.researching.Research; +import io.github.thebusybiscuit.slimefun4.implementation.SlimefunPlugin; import io.github.thebusybiscuit.slimefun4.implementation.items.VanillaItem; import io.github.thebusybiscuit.slimefun4.implementation.items.backpacks.SlimefunBackpack; import io.github.thebusybiscuit.slimefun4.implementation.items.electric.machines.AutoDisenchanter; import io.github.thebusybiscuit.slimefun4.implementation.items.electric.machines.AutoEnchanter; import io.github.thebusybiscuit.slimefun4.utils.SlimefunUtils; import io.github.thebusybiscuit.slimefun4.utils.itemstack.ItemStackWrapper; -import me.mrCookieSlime.Slimefun.SlimefunPlugin; import me.mrCookieSlime.Slimefun.Lists.RecipeType; import me.mrCookieSlime.Slimefun.Objects.Category; import me.mrCookieSlime.Slimefun.Objects.SlimefunBlockHandler; diff --git a/src/main/java/me/mrCookieSlime/Slimefun/Objects/SlimefunItem/abstractItems/AGenerator.java b/src/main/java/me/mrCookieSlime/Slimefun/Objects/SlimefunItem/abstractItems/AGenerator.java index dd4dbfddf..7add05178 100644 --- a/src/main/java/me/mrCookieSlime/Slimefun/Objects/SlimefunItem/abstractItems/AGenerator.java +++ b/src/main/java/me/mrCookieSlime/Slimefun/Objects/SlimefunItem/abstractItems/AGenerator.java @@ -13,13 +13,13 @@ import org.bukkit.inventory.ItemStack; import io.github.thebusybiscuit.cscorelib2.item.CustomItem; import io.github.thebusybiscuit.cscorelib2.protection.ProtectableAction; import io.github.thebusybiscuit.slimefun4.implementation.SlimefunItems; +import io.github.thebusybiscuit.slimefun4.implementation.SlimefunPlugin; import io.github.thebusybiscuit.slimefun4.implementation.items.electric.AbstractEnergyProvider; import io.github.thebusybiscuit.slimefun4.utils.ChestMenuUtils; import io.github.thebusybiscuit.slimefun4.utils.SlimefunUtils; import me.mrCookieSlime.CSCoreLibPlugin.Configuration.Config; import me.mrCookieSlime.CSCoreLibPlugin.general.Inventory.ChestMenu.AdvancedMenuClickHandler; import me.mrCookieSlime.CSCoreLibPlugin.general.Inventory.ClickAction; -import me.mrCookieSlime.Slimefun.SlimefunPlugin; import me.mrCookieSlime.Slimefun.Lists.RecipeType; import me.mrCookieSlime.Slimefun.Objects.Category; import me.mrCookieSlime.Slimefun.Objects.SlimefunItem.SlimefunItem; diff --git a/src/main/java/me/mrCookieSlime/Slimefun/Objects/SlimefunItem/interfaces/InventoryBlock.java b/src/main/java/me/mrCookieSlime/Slimefun/Objects/SlimefunItem/interfaces/InventoryBlock.java index 1fbb079ca..9ba0a3df4 100644 --- a/src/main/java/me/mrCookieSlime/Slimefun/Objects/SlimefunItem/interfaces/InventoryBlock.java +++ b/src/main/java/me/mrCookieSlime/Slimefun/Objects/SlimefunItem/interfaces/InventoryBlock.java @@ -8,7 +8,7 @@ import org.bukkit.entity.Player; import org.bukkit.inventory.Inventory; import io.github.thebusybiscuit.cscorelib2.protection.ProtectableAction; -import me.mrCookieSlime.Slimefun.SlimefunPlugin; +import io.github.thebusybiscuit.slimefun4.implementation.SlimefunPlugin; import me.mrCookieSlime.Slimefun.Objects.SlimefunItem.SlimefunItem; import me.mrCookieSlime.Slimefun.api.Slimefun; import me.mrCookieSlime.Slimefun.api.inventory.BlockMenuPreset; diff --git a/src/main/java/me/mrCookieSlime/Slimefun/Objects/handlers/RainbowTicker.java b/src/main/java/me/mrCookieSlime/Slimefun/Objects/handlers/RainbowTicker.java index 6cf8766a3..61171ee1b 100644 --- a/src/main/java/me/mrCookieSlime/Slimefun/Objects/handlers/RainbowTicker.java +++ b/src/main/java/me/mrCookieSlime/Slimefun/Objects/handlers/RainbowTicker.java @@ -10,9 +10,9 @@ import org.bukkit.block.data.Waterlogged; import io.github.thebusybiscuit.cscorelib2.collections.LoopIterator; import io.github.thebusybiscuit.cscorelib2.materials.MaterialCollection; import io.github.thebusybiscuit.slimefun4.api.MinecraftVersion; +import io.github.thebusybiscuit.slimefun4.implementation.SlimefunPlugin; import io.github.thebusybiscuit.slimefun4.implementation.items.blocks.RainbowBlock; import me.mrCookieSlime.CSCoreLibPlugin.Configuration.Config; -import me.mrCookieSlime.Slimefun.SlimefunPlugin; import me.mrCookieSlime.Slimefun.Objects.SlimefunItem.SlimefunItem; /** diff --git a/src/main/java/me/mrCookieSlime/Slimefun/SlimefunPlugin.java b/src/main/java/me/mrCookieSlime/Slimefun/SlimefunPlugin.java index 635821e44..df0719e51 100644 --- a/src/main/java/me/mrCookieSlime/Slimefun/SlimefunPlugin.java +++ b/src/main/java/me/mrCookieSlime/Slimefun/SlimefunPlugin.java @@ -1,37 +1,16 @@ package me.mrCookieSlime.Slimefun; -import java.io.File; -import java.util.ArrayList; -import java.util.Arrays; -import java.util.Collection; -import java.util.List; -import java.util.Map; import java.util.Set; -import java.util.logging.Level; -import java.util.stream.Collectors; -import org.bukkit.Bukkit; -import org.bukkit.Server; -import org.bukkit.command.Command; -import org.bukkit.entity.Player; import org.bukkit.plugin.Plugin; -import org.bukkit.plugin.PluginDescriptionFile; -import org.bukkit.plugin.java.JavaPlugin; -import org.bukkit.plugin.java.JavaPluginLoader; import io.github.thebusybiscuit.cscorelib2.config.Config; -import io.github.thebusybiscuit.cscorelib2.math.DoubleHandler; import io.github.thebusybiscuit.cscorelib2.protection.ProtectionManager; -import io.github.thebusybiscuit.cscorelib2.reflection.ReflectionUtils; import io.github.thebusybiscuit.slimefun4.api.MinecraftVersion; -import io.github.thebusybiscuit.slimefun4.api.SlimefunAddon; import io.github.thebusybiscuit.slimefun4.api.gps.GPSNetwork; -import io.github.thebusybiscuit.slimefun4.api.player.PlayerProfile; import io.github.thebusybiscuit.slimefun4.core.SlimefunRegistry; import io.github.thebusybiscuit.slimefun4.core.commands.SlimefunCommand; import io.github.thebusybiscuit.slimefun4.core.networks.NetworkManager; -import io.github.thebusybiscuit.slimefun4.core.services.AutoSavingService; -import io.github.thebusybiscuit.slimefun4.core.services.BackupService; import io.github.thebusybiscuit.slimefun4.core.services.BlockDataService; import io.github.thebusybiscuit.slimefun4.core.services.CustomItemDataService; import io.github.thebusybiscuit.slimefun4.core.services.CustomTextureService; @@ -41,585 +20,129 @@ import io.github.thebusybiscuit.slimefun4.core.services.PerWorldSettingsService; import io.github.thebusybiscuit.slimefun4.core.services.PermissionsService; import io.github.thebusybiscuit.slimefun4.core.services.UpdaterService; import io.github.thebusybiscuit.slimefun4.core.services.github.GitHubService; -import io.github.thebusybiscuit.slimefun4.core.services.metrics.MetricsService; import io.github.thebusybiscuit.slimefun4.core.services.plugins.ThirdPartyPluginService; -import io.github.thebusybiscuit.slimefun4.implementation.SlimefunItems; -import io.github.thebusybiscuit.slimefun4.implementation.items.altar.AncientAltar; -import io.github.thebusybiscuit.slimefun4.implementation.items.backpacks.Cooler; -import io.github.thebusybiscuit.slimefun4.implementation.items.electric.BasicCircuitBoard; -import io.github.thebusybiscuit.slimefun4.implementation.items.electric.reactors.Reactor; -import io.github.thebusybiscuit.slimefun4.implementation.items.tools.GrapplingHook; -import io.github.thebusybiscuit.slimefun4.implementation.items.weapons.SeismicAxe; -import io.github.thebusybiscuit.slimefun4.implementation.items.weapons.VampireBlade; import io.github.thebusybiscuit.slimefun4.implementation.listeners.AncientAltarListener; import io.github.thebusybiscuit.slimefun4.implementation.listeners.BackpackListener; -import io.github.thebusybiscuit.slimefun4.implementation.listeners.BlockListener; -import io.github.thebusybiscuit.slimefun4.implementation.listeners.BlockPhysicsListener; -import io.github.thebusybiscuit.slimefun4.implementation.listeners.CargoNodeListener; -import io.github.thebusybiscuit.slimefun4.implementation.listeners.CoolerListener; -import io.github.thebusybiscuit.slimefun4.implementation.listeners.DeathpointListener; -import io.github.thebusybiscuit.slimefun4.implementation.listeners.DebugFishListener; -import io.github.thebusybiscuit.slimefun4.implementation.listeners.DispenserListener; -import io.github.thebusybiscuit.slimefun4.implementation.listeners.EnhancedFurnaceListener; -import io.github.thebusybiscuit.slimefun4.implementation.listeners.ExplosionsListener; -import io.github.thebusybiscuit.slimefun4.implementation.listeners.FireworksListener; -import io.github.thebusybiscuit.slimefun4.implementation.listeners.GadgetsListener; import io.github.thebusybiscuit.slimefun4.implementation.listeners.GrapplingHookListener; -import io.github.thebusybiscuit.slimefun4.implementation.listeners.IronGolemListener; -import io.github.thebusybiscuit.slimefun4.implementation.listeners.ItemPickupListener; -import io.github.thebusybiscuit.slimefun4.implementation.listeners.MobDropListener; -import io.github.thebusybiscuit.slimefun4.implementation.listeners.MultiBlockListener; -import io.github.thebusybiscuit.slimefun4.implementation.listeners.PlayerInteractEntityListener; -import io.github.thebusybiscuit.slimefun4.implementation.listeners.PlayerProfileListener; -import io.github.thebusybiscuit.slimefun4.implementation.listeners.SeismicAxeListener; -import io.github.thebusybiscuit.slimefun4.implementation.listeners.SlimefunBootsListener; import io.github.thebusybiscuit.slimefun4.implementation.listeners.SlimefunBowListener; -import io.github.thebusybiscuit.slimefun4.implementation.listeners.SlimefunGuideListener; -import io.github.thebusybiscuit.slimefun4.implementation.listeners.SlimefunItemConsumeListener; -import io.github.thebusybiscuit.slimefun4.implementation.listeners.SlimefunItemListener; -import io.github.thebusybiscuit.slimefun4.implementation.listeners.SoulboundListener; -import io.github.thebusybiscuit.slimefun4.implementation.listeners.TalismanListener; -import io.github.thebusybiscuit.slimefun4.implementation.listeners.VampireBladeListener; -import io.github.thebusybiscuit.slimefun4.implementation.listeners.VanillaMachinesListener; -import io.github.thebusybiscuit.slimefun4.implementation.listeners.WitherListener; -import io.github.thebusybiscuit.slimefun4.implementation.listeners.WorldListener; -import io.github.thebusybiscuit.slimefun4.implementation.resources.GEOResourcesSetup; -import io.github.thebusybiscuit.slimefun4.implementation.setup.PostSetup; -import io.github.thebusybiscuit.slimefun4.implementation.setup.ResearchSetup; -import io.github.thebusybiscuit.slimefun4.implementation.setup.SlimefunItemSetup; -import io.github.thebusybiscuit.slimefun4.implementation.tasks.ArmorTask; -import io.github.thebusybiscuit.slimefun4.implementation.tasks.SlimefunStartupTask; import io.github.thebusybiscuit.slimefun4.implementation.tasks.TickerTask; import me.mrCookieSlime.CSCoreLibPlugin.CSCoreLib; -import me.mrCookieSlime.Slimefun.Objects.SlimefunItem.abstractItems.AContainer; -import me.mrCookieSlime.Slimefun.Objects.SlimefunItem.abstractItems.AGenerator; -import me.mrCookieSlime.Slimefun.api.BlockStorage; -import me.mrCookieSlime.Slimefun.api.Slimefun; -import me.mrCookieSlime.Slimefun.api.inventory.UniversalBlockMenu; /** - * This is the main class of Slimefun. - * This is where all the magic starts, take a look around. - * Feel like home. - * + * @deprecated This class has been moved to {@link io.github.thebusybiscuit.slimefun4.implementation.SlimefunPlugin} + * * @author TheBusyBiscuit + * */ -public final class SlimefunPlugin extends JavaPlugin implements SlimefunAddon { - - public static SlimefunPlugin instance; - - private MinecraftVersion minecraftVersion = MinecraftVersion.UNKNOWN; - - private final SlimefunRegistry registry = new SlimefunRegistry(); - private final TickerTask ticker = new TickerTask(); - private final SlimefunCommand command = new SlimefunCommand(this); - - // Services - Systems that fulfill certain tasks, treat them as a black box - private final CustomItemDataService itemDataService = new CustomItemDataService(this, "slimefun_item"); - private final BlockDataService blockDataService = new BlockDataService(this, "slimefun_block"); - private final CustomTextureService textureService = new CustomTextureService(new Config(this, "item-models.yml")); - private final GitHubService gitHubService = new GitHubService("TheBusyBiscuit/Slimefun4"); - private final UpdaterService updaterService = new UpdaterService(this, getDescription().getVersion(), getFile()); - private final MetricsService metricsService = new MetricsService(this); - private final AutoSavingService autoSavingService = new AutoSavingService(); - private final BackupService backupService = new BackupService(); - private final PermissionsService permissionsService = new PermissionsService(this); - private final PerWorldSettingsService worldSettingsService = new PerWorldSettingsService(this); - private final ThirdPartyPluginService thirdPartySupportService = new ThirdPartyPluginService(this); - private final MinecraftRecipeService recipeService = new MinecraftRecipeService(this); - private LocalizationService local; - - private GPSNetwork gpsNetwork; - private NetworkManager networkManager; - private ProtectionManager protections; - - // Important config files for Slimefun - private final Config config = new Config(this); - private final Config items = new Config(this, "Items.yml"); - private final Config researches = new Config(this, "Researches.yml"); - - // Listeners that need to be accessed elsewhere - private final AncientAltarListener ancientAltarListener = new AncientAltarListener(); - private final GrapplingHookListener grapplingHookListener = new GrapplingHookListener(); - private final BackpackListener backpackListener = new BackpackListener(); - private final SlimefunBowListener bowListener = new SlimefunBowListener(); - - public SlimefunPlugin() { - super(); - } - - public SlimefunPlugin(JavaPluginLoader loader, PluginDescriptionFile description, File dataFolder, File file) { - super(loader, description, dataFolder, file); - minecraftVersion = MinecraftVersion.UNIT_TEST; - } - - @Override - public void onEnable() { - if (minecraftVersion == MinecraftVersion.UNIT_TEST) { - instance = this; - local = new LocalizationService(this, "", null); - gpsNetwork = new GPSNetwork(); - command.register(); - } - else if (getServer().getPluginManager().isPluginEnabled("CS-CoreLib")) { - long timestamp = System.nanoTime(); - - // We wanna ensure that the Server uses a compatible version of Minecraft - if (isVersionUnsupported()) { - getServer().getPluginManager().disablePlugin(this); - return; - } - - instance = this; - - // Creating all necessary Folders - getLogger().log(Level.INFO, "Loading various systems..."); - createDirectories(); - registry.load(config); - - // Set up localization - local = new LocalizationService(this, config.getString("options.chat-prefix"), config.getString("options.language")); - - // Setting up Networks - gpsNetwork = new GPSNetwork(); - - int networkSize = config.getInt("networks.max-size"); - - if (networkSize < 1) { - getLogger().log(Level.WARNING, "Your 'networks.max-size' setting is misconfigured! It must be at least 1, it was set to: {0}", networkSize); - networkSize = 1; - } - - networkManager = new NetworkManager(networkSize); - - // Setting up bStats - metricsService.start(); - - // Starting the Auto-Updater - if (config.getBoolean("options.auto-update")) { - getLogger().log(Level.INFO, "Starting Auto-Updater..."); - updaterService.start(); - } - else { - updaterService.disable(); - } - - // Registering all GEO Resources - getLogger().log(Level.INFO, "Loading GEO-Resources..."); - GEOResourcesSetup.setup(); - - getLogger().log(Level.INFO, "Loading items..."); - loadItems(); - - getLogger().log(Level.INFO, "Loading researches..."); - loadResearches(); - - registry.setResearchingEnabled(getResearchCfg().getBoolean("enable-researching")); - PostSetup.setupWiki(); - - // All Slimefun Listeners - new SlimefunBootsListener(this); - new SlimefunItemListener(this); - new SlimefunItemConsumeListener(this); - new BlockPhysicsListener(this); - new CargoNodeListener(this); - new MultiBlockListener(this); - new GadgetsListener(this); - new DispenserListener(this); - new BlockListener(this); - new EnhancedFurnaceListener(this); - new ItemPickupListener(this); - new DeathpointListener(this); - new ExplosionsListener(this); - new DebugFishListener(this); - new VanillaMachinesListener(this); - new FireworksListener(this); - new WitherListener(this); - new IronGolemListener(this); - new PlayerInteractEntityListener(this); - - new MobDropListener(this, (BasicCircuitBoard) SlimefunItems.BASIC_CIRCUIT_BOARD.getItem()); - - // Item-specific Listeners - new VampireBladeListener(this, (VampireBlade) SlimefunItems.BLADE_OF_VAMPIRES.getItem()); - new CoolerListener(this, (Cooler) SlimefunItems.COOLER.getItem()); - new SeismicAxeListener(this, (SeismicAxe) SlimefunItems.SEISMIC_AXE.getItem()); - grapplingHookListener.register(this, (GrapplingHook) SlimefunItems.GRAPPLING_HOOK.getItem()); - ancientAltarListener.register(this, (AncientAltar) SlimefunItems.ANCIENT_ALTAR.getItem()); - - bowListener.register(this); - - // Toggleable Listeners for performance reasons - if (config.getBoolean("items.talismans")) { - new TalismanListener(this); - } - - if (config.getBoolean("items.soulbound")) { - new SoulboundListener(this); - } - - if (config.getBoolean("items.backpacks")) { - backpackListener.register(this); - } - - // Handle Slimefun Guide being given on Join - new SlimefunGuideListener(this, config.getBoolean("guide.receive-on-first-join")); - - // Load/Unload Worlds in Slimefun - new WorldListener(this); - - // Clear the Slimefun Guide History upon Player Leaving - new PlayerProfileListener(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()); - textureService.register(registry.getAllSlimefunItems(), true); - permissionsService.register(registry.getAllSlimefunItems(), true); - recipeService.refresh(); - }), 0); - - // Setting up the command /sf and all subcommands - command.register(); - - // Armor Update Task - if (config.getBoolean("options.enable-armor-effects")) { - getServer().getScheduler().runTaskTimerAsynchronously(this, new ArmorTask(), 0L, config.getInt("options.armor-update-interval") * 20L); - } - - autoSavingService.start(this, config.getInt("options.auto-save-delay-in-minutes")); - ticker.start(this); - thirdPartySupportService.start(); - gitHubService.start(this); - - // Hooray! - getLogger().log(Level.INFO, "Slimefun has finished loading in {0}", getStartupTime(timestamp)); - } - else { - getLogger().log(Level.INFO, "#################### - INFO - ####################"); - getLogger().log(Level.INFO, " "); - getLogger().log(Level.INFO, "Slimefun could not be loaded (yet)."); - getLogger().log(Level.INFO, "It appears that you have not installed CS-CoreLib."); - getLogger().log(Level.INFO, "Please download and install CS-CoreLib manually:"); - getLogger().log(Level.INFO, "https://thebusybiscuit.github.io/builds/TheBusyBiscuit/CS-CoreLib/master/"); - - getCommand("slimefun").setExecutor((sender, cmd, label, args) -> { - sender.sendMessage("You have forgotten to install CS-CoreLib! Slimefun is disabled."); - sender.sendMessage("https://thebusybiscuit.github.io/builds/TheBusyBiscuit/CS-CoreLib/master/"); - return true; - }); - } - } - - private String getStartupTime(long timestamp) { - long ms = (System.nanoTime() - timestamp) / 1000000; - - if (ms > 1000) { - return DoubleHandler.fixDouble(ms / 1000.0) + "s"; - } - else { - return DoubleHandler.fixDouble(ms) + "ms"; - } - } - - /** - * This method checks for the {@link MinecraftVersion} of the {@link Server}. - * If the version is unsupported, a warning will be printed to the console. - * - * @return Whether the {@link MinecraftVersion} is unsupported - */ - private boolean isVersionUnsupported() { - String currentVersion = ReflectionUtils.getVersion(); - - if (currentVersion.startsWith("v")) { - for (MinecraftVersion version : MinecraftVersion.values()) { - if (version.matches(currentVersion)) { - minecraftVersion = version; - return false; - } - } - - // Looks like you are using an unsupported Minecraft Version - getLogger().log(Level.SEVERE, "#############################################"); - getLogger().log(Level.SEVERE, "### Slimefun was not installed correctly!"); - getLogger().log(Level.SEVERE, "### You are using the wrong version of Minecraft!"); - getLogger().log(Level.SEVERE, "###"); - getLogger().log(Level.SEVERE, "### You are using Minecraft {0}", ReflectionUtils.getVersion()); - getLogger().log(Level.SEVERE, "### but Slimefun v{0} requires you to be using", getDescription().getVersion()); - getLogger().log(Level.SEVERE, "### Minecraft {0}", String.join(" / ", getSupportedVersions())); - getLogger().log(Level.SEVERE, "#############################################"); - return true; - } - - getLogger().log(Level.WARNING, "We could not determine the version of Minecraft you were using ({0})", currentVersion); - return false; - } - - private Collection getSupportedVersions() { - List list = new ArrayList<>(); - - for (MinecraftVersion version : MinecraftVersion.values()) { - if (version != MinecraftVersion.UNKNOWN) { - list.add(version.getName()); - } - } - - return list; - } - - @Override - public void onDisable() { - // Slimefun never loaded successfully, so we don't even bother doing stuff here - if (instance == null || minecraftVersion == MinecraftVersion.UNIT_TEST) { - return; - } - - // Cancel all tasks from this plugin immediately - Bukkit.getScheduler().cancelTasks(this); - - // Finishes all started movements/removals of block data - ticker.halt(); - ticker.run(); - - // Save all Player Profiles that are still in memory - PlayerProfile.iterator().forEachRemaining(profile -> { - if (profile.isDirty()) { - profile.save(); - } - }); - - // Save all registered Worlds - for (Map.Entry entry : getRegistry().getWorlds().entrySet()) { - try { - entry.getValue().save(true); - } - catch (Exception x) { - getLogger().log(Level.SEVERE, x, () -> "An Error occurred while saving Slimefun-Blocks in World '" + entry.getKey() + "' for Slimefun " + getVersion()); - } - } - - for (UniversalBlockMenu menu : registry.getUniversalInventories().values()) { - menu.save(); - } - - // Create a new backup zip - backupService.run(); - - // Prevent Memory Leaks - // These static Maps should be removed at some point... - AContainer.processing = null; - AContainer.progress = null; - - AGenerator.processing = null; - AGenerator.progress = null; - - Reactor.processing = null; - Reactor.progress = null; - - instance = null; - - // Close all inventories on the server to prevent item dupes - // (Incase some idiot uses /reload) - for (Player p : Bukkit.getOnlinePlayers()) { - p.closeInventory(); - } - } - - private void createDirectories() { - String[] storageFolders = { "Players", "blocks", "stored-blocks", "stored-inventories", "stored-chunks", "universal-inventories", "waypoints", "block-backups" }; - String[] pluginFolders = { "scripts", "generators", "error-reports", "cache/github", "world-settings" }; - - for (String folder : storageFolders) { - File file = new File("data-storage/Slimefun", folder); - - if (!file.exists()) { - file.mkdirs(); - } - } - - for (String folder : pluginFolders) { - File file = new File("plugins/Slimefun", folder); - - if (!file.exists()) { - file.mkdirs(); - } - } - } - - private void loadItems() { - try { - SlimefunItemSetup.setup(this); - } - catch (Exception | LinkageError x) { - getLogger().log(Level.SEVERE, x, () -> "An Error occurred while initializing SlimefunItems for Slimefun " + getVersion()); - } - } - - private void loadResearches() { - try { - ResearchSetup.setupResearches(); - } - catch (Exception | LinkageError x) { - getLogger().log(Level.SEVERE, x, () -> "An Error occurred while initializing Slimefun Researches for Slimefun " + getVersion()); - } - } +@Deprecated +public class SlimefunPlugin { public static Config getCfg() { - return instance.config; + return io.github.thebusybiscuit.slimefun4.implementation.SlimefunPlugin.getCfg(); } public static Config getResearchCfg() { - return instance.researches; + return io.github.thebusybiscuit.slimefun4.implementation.SlimefunPlugin.getResearchCfg(); } public static Config getItemCfg() { - return instance.items; + return io.github.thebusybiscuit.slimefun4.implementation.SlimefunPlugin.getItemCfg(); } public static GPSNetwork getGPSNetwork() { - return instance.gpsNetwork; + return io.github.thebusybiscuit.slimefun4.implementation.SlimefunPlugin.getGPSNetwork(); } public static TickerTask getTicker() { - return instance.ticker; + return io.github.thebusybiscuit.slimefun4.implementation.SlimefunPlugin.getTickerTask(); } - /** - * This returns the version of Slimefun that is currently installed. - * - * @return The currently installed version of Slimefun - */ public static String getVersion() { - return instance.getDescription().getVersion(); + return io.github.thebusybiscuit.slimefun4.implementation.SlimefunPlugin.getVersion(); } public static ProtectionManager getProtectionManager() { - return instance.protections; + return io.github.thebusybiscuit.slimefun4.implementation.SlimefunPlugin.getProtectionManager(); } - /** - * This returns the {@link LocalizationService} of Slimefun. - * - * @return The {@link LocalizationService} of Slimefun - */ public static LocalizationService getLocal() { - return instance.local; + return io.github.thebusybiscuit.slimefun4.implementation.SlimefunPlugin.getLocalization(); } public static MinecraftRecipeService getMinecraftRecipes() { - return instance.recipeService; + return io.github.thebusybiscuit.slimefun4.implementation.SlimefunPlugin.getMinecraftRecipeService(); } public static CustomItemDataService getItemDataService() { - return instance.itemDataService; + return io.github.thebusybiscuit.slimefun4.implementation.SlimefunPlugin.getItemDataService(); } public static CustomTextureService getItemTextureService() { - return instance.textureService; + return io.github.thebusybiscuit.slimefun4.implementation.SlimefunPlugin.getItemTextureService(); } public static PermissionsService getPermissionsService() { - return instance.permissionsService; + return io.github.thebusybiscuit.slimefun4.implementation.SlimefunPlugin.getPermissionsService(); } public static BlockDataService getBlockDataService() { - return instance.blockDataService; + return io.github.thebusybiscuit.slimefun4.implementation.SlimefunPlugin.getBlockDataService(); } public static ThirdPartyPluginService getThirdPartySupportService() { - return instance.thirdPartySupportService; + return io.github.thebusybiscuit.slimefun4.implementation.SlimefunPlugin.getThirdPartySupportService(); } public static PerWorldSettingsService getWorldSettingsService() { - return instance.worldSettingsService; + return io.github.thebusybiscuit.slimefun4.implementation.SlimefunPlugin.getWorldSettingsService(); } - /** - * This method returns the {@link UpdaterService} of Slimefun. - * It is used to handle automatic updates. - * - * @return The {@link UpdaterService} for Slimefun - */ public static UpdaterService getUpdater() { - return instance.updaterService; + return io.github.thebusybiscuit.slimefun4.implementation.SlimefunPlugin.getUpdater(); } - /** - * This method returns the {@link GitHubService} of Slimefun. - * It is used to retrieve data from GitHub repositories. - * - * @return The {@link GitHubService} for Slimefun - */ public static GitHubService getGitHubService() { - return instance.gitHubService; + return io.github.thebusybiscuit.slimefun4.implementation.SlimefunPlugin.getGitHubService(); } public static SlimefunRegistry getRegistry() { - return instance.registry; + return io.github.thebusybiscuit.slimefun4.implementation.SlimefunPlugin.getRegistry(); } public static NetworkManager getNetworkManager() { - return instance.networkManager; + return io.github.thebusybiscuit.slimefun4.implementation.SlimefunPlugin.getNetworkManager(); } public static AncientAltarListener getAncientAltarListener() { - return instance.ancientAltarListener; + return io.github.thebusybiscuit.slimefun4.implementation.SlimefunPlugin.getAncientAltarListener(); } public static GrapplingHookListener getGrapplingHookListener() { - return instance.grapplingHookListener; + return io.github.thebusybiscuit.slimefun4.implementation.SlimefunPlugin.getGrapplingHookListener(); } public static BackpackListener getBackpackListener() { - return instance.backpackListener; + return io.github.thebusybiscuit.slimefun4.implementation.SlimefunPlugin.getBackpackListener(); } public static SlimefunBowListener getBowListener() { - return instance.bowListener; + return io.github.thebusybiscuit.slimefun4.implementation.SlimefunPlugin.getBowListener(); } - /** - * This method returns a {@link Set} of every {@link Plugin} that lists Slimefun - * as a required or optional dependency. - *

- * We will just assume this to be a list of our addons. - * - * @return A {@link Set} of every {@link Plugin} that is dependent on Slimefun - */ public static Set getInstalledAddons() { - return Arrays.stream(instance.getServer().getPluginManager().getPlugins()).filter(plugin -> plugin.getDescription().getDepend().contains(instance.getName()) || plugin.getDescription().getSoftDepend().contains(instance.getName())).collect(Collectors.toSet()); + return io.github.thebusybiscuit.slimefun4.implementation.SlimefunPlugin.getInstalledAddons(); } - /** - * The {@link Command} that was added by Slimefun. - * - * @return Slimefun's command - */ public static SlimefunCommand getCommand() { - return instance.command; + return io.github.thebusybiscuit.slimefun4.implementation.SlimefunPlugin.getCommand(); } - /** - * This returns the currently installed version of Minecraft. - * - * @return The current version of Minecraft - */ public static MinecraftVersion getMinecraftVersion() { - return instance.minecraftVersion; + return io.github.thebusybiscuit.slimefun4.implementation.SlimefunPlugin.getMinecraftVersion(); } public static String getCSCoreLibVersion() { return CSCoreLib.getLib().getDescription().getVersion(); } - @Override - public JavaPlugin getJavaPlugin() { - return this; - } - - @Override - public String getBugTrackerURL() { - return "https://github.com/TheBusyBiscuit/Slimefun4/issues"; - } - } diff --git a/src/main/java/me/mrCookieSlime/Slimefun/api/BlockStorage.java b/src/main/java/me/mrCookieSlime/Slimefun/api/BlockStorage.java index a48353540..c5413bdbc 100644 --- a/src/main/java/me/mrCookieSlime/Slimefun/api/BlockStorage.java +++ b/src/main/java/me/mrCookieSlime/Slimefun/api/BlockStorage.java @@ -32,9 +32,9 @@ import com.google.gson.stream.JsonWriter; import io.github.thebusybiscuit.cscorelib2.blocks.BlockPosition; import io.github.thebusybiscuit.cscorelib2.math.DoubleHandler; +import io.github.thebusybiscuit.slimefun4.implementation.SlimefunPlugin; import io.github.thebusybiscuit.slimefun4.utils.PatternUtils; import me.mrCookieSlime.CSCoreLibPlugin.Configuration.Config; -import me.mrCookieSlime.Slimefun.SlimefunPlugin; import me.mrCookieSlime.Slimefun.Objects.SlimefunItem.SlimefunItem; import me.mrCookieSlime.Slimefun.api.inventory.BlockMenu; import me.mrCookieSlime.Slimefun.api.inventory.BlockMenuPreset; @@ -531,7 +531,7 @@ public class BlockStorage { } public static void clearBlockInfo(Location l, boolean destroy) { - SlimefunPlugin.getTicker().queueDelete(l, destroy); + SlimefunPlugin.getTickerTask().queueDelete(l, destroy); } public static void _integrated_removeBlockInfo(Location l, boolean destroy) { @@ -572,7 +572,7 @@ public class BlockStorage { } public static void moveBlockInfo(Location from, Location to) { - SlimefunPlugin.getTicker().queueMove(from, to); + SlimefunPlugin.getTickerTask().queueMove(from, to); } public static void _integrated_moveLocationInfo(Location from, Location to) { diff --git a/src/main/java/me/mrCookieSlime/Slimefun/api/Slimefun.java b/src/main/java/me/mrCookieSlime/Slimefun/api/Slimefun.java index 3e5644f9a..9a8f979a6 100644 --- a/src/main/java/me/mrCookieSlime/Slimefun/api/Slimefun.java +++ b/src/main/java/me/mrCookieSlime/Slimefun/api/Slimefun.java @@ -12,8 +12,8 @@ import org.bukkit.scheduler.BukkitTask; import io.github.thebusybiscuit.slimefun4.api.MinecraftVersion; import io.github.thebusybiscuit.slimefun4.api.items.ItemState; import io.github.thebusybiscuit.slimefun4.api.player.PlayerProfile; +import io.github.thebusybiscuit.slimefun4.implementation.SlimefunPlugin; import io.github.thebusybiscuit.slimefun4.implementation.items.VanillaItem; -import me.mrCookieSlime.Slimefun.SlimefunPlugin; import me.mrCookieSlime.Slimefun.Objects.Research; import me.mrCookieSlime.Slimefun.Objects.SlimefunItem.SlimefunItem; @@ -135,7 +135,7 @@ public final class Slimefun { } else { if (message && !(sfItem instanceof VanillaItem)) { - SlimefunPlugin.getLocal().sendMessage(p, "messages.not-researched", true); + SlimefunPlugin.getLocalization().sendMessage(p, "messages.not-researched", true); } return false; @@ -168,7 +168,7 @@ public final class Slimefun { } else { if (message) { - SlimefunPlugin.getLocal().sendMessage(p, "messages.no-permission", true); + SlimefunPlugin.getLocalization().sendMessage(p, "messages.no-permission", true); } return false; @@ -210,14 +210,14 @@ public final class Slimefun { public static boolean isEnabled(Player p, SlimefunItem sfItem, boolean message) { if (sfItem.isDisabled()) { if (message) { - SlimefunPlugin.getLocal().sendMessage(p, "messages.disabled-item", true); + SlimefunPlugin.getLocalization().sendMessage(p, "messages.disabled-item", true); } return false; } else if (!SlimefunPlugin.getWorldSettingsService().isEnabled(p.getWorld(), sfItem)) { if (message) { - SlimefunPlugin.getLocal().sendMessage(p, "messages.disabled-in-world", true); + SlimefunPlugin.getLocalization().sendMessage(p, "messages.disabled-in-world", true); } return false; diff --git a/src/main/java/me/mrCookieSlime/Slimefun/api/SlimefunItemStack.java b/src/main/java/me/mrCookieSlime/Slimefun/api/SlimefunItemStack.java index 6d7ed0e50..b0bf9854c 100644 --- a/src/main/java/me/mrCookieSlime/Slimefun/api/SlimefunItemStack.java +++ b/src/main/java/me/mrCookieSlime/Slimefun/api/SlimefunItemStack.java @@ -24,9 +24,9 @@ import io.github.thebusybiscuit.cscorelib2.item.ImmutableItemMeta; import io.github.thebusybiscuit.cscorelib2.skull.SkullItem; import io.github.thebusybiscuit.slimefun4.api.MinecraftVersion; import io.github.thebusybiscuit.slimefun4.api.exceptions.PrematureCodeException; +import io.github.thebusybiscuit.slimefun4.implementation.SlimefunPlugin; import io.github.thebusybiscuit.slimefun4.utils.HeadTexture; import io.github.thebusybiscuit.slimefun4.utils.PatternUtils; -import me.mrCookieSlime.Slimefun.SlimefunPlugin; import me.mrCookieSlime.Slimefun.Objects.SlimefunItem.SlimefunItem; public class SlimefunItemStack extends CustomItem { diff --git a/src/main/java/me/mrCookieSlime/Slimefun/api/energy/ChargableBlock.java b/src/main/java/me/mrCookieSlime/Slimefun/api/energy/ChargableBlock.java index 3ea009e5f..f3022cedc 100644 --- a/src/main/java/me/mrCookieSlime/Slimefun/api/energy/ChargableBlock.java +++ b/src/main/java/me/mrCookieSlime/Slimefun/api/energy/ChargableBlock.java @@ -5,9 +5,9 @@ import org.bukkit.Material; import org.bukkit.block.Block; import io.github.thebusybiscuit.cscorelib2.skull.SkullBlock; +import io.github.thebusybiscuit.slimefun4.implementation.SlimefunPlugin; import io.github.thebusybiscuit.slimefun4.utils.HeadTexture; import me.mrCookieSlime.CSCoreLibPlugin.Configuration.Config; -import me.mrCookieSlime.Slimefun.SlimefunPlugin; import me.mrCookieSlime.Slimefun.api.BlockStorage; import me.mrCookieSlime.Slimefun.api.Slimefun; diff --git a/src/main/java/me/mrCookieSlime/Slimefun/api/inventory/BlockMenuPreset.java b/src/main/java/me/mrCookieSlime/Slimefun/api/inventory/BlockMenuPreset.java index 0a160f544..ce50bdb17 100644 --- a/src/main/java/me/mrCookieSlime/Slimefun/api/inventory/BlockMenuPreset.java +++ b/src/main/java/me/mrCookieSlime/Slimefun/api/inventory/BlockMenuPreset.java @@ -10,8 +10,8 @@ import org.bukkit.entity.Player; import org.bukkit.inventory.InventoryView; import org.bukkit.inventory.ItemStack; +import io.github.thebusybiscuit.slimefun4.implementation.SlimefunPlugin; import me.mrCookieSlime.CSCoreLibPlugin.general.Inventory.ChestMenu; -import me.mrCookieSlime.Slimefun.SlimefunPlugin; import me.mrCookieSlime.Slimefun.Objects.SlimefunItem.SlimefunItem; import me.mrCookieSlime.Slimefun.api.Slimefun; import me.mrCookieSlime.Slimefun.api.item_transport.ItemTransportFlow; diff --git a/src/main/resources/plugin.yml b/src/main/resources/plugin.yml index 69327096a..b991fb322 100644 --- a/src/main/resources/plugin.yml +++ b/src/main/resources/plugin.yml @@ -4,7 +4,7 @@ author: The Slimefun 4 Community description: Slimefun basically turns your entire Server into a FTB modpack without installing a single mod website: https://github.com/TheBusyBiscuit/Slimefun4 -main: me.mrCookieSlime.Slimefun.SlimefunPlugin +main: io.github.thebusybiscuit.slimefun4.implementation.SlimefunPlugin softdepend: [CS-CoreLib, PlaceholderAPI, WorldEdit, EmeraldEnchants] api-version: '1.13' diff --git a/src/test/java/io/github/thebusybiscuit/slimefun4/testing/TestUtilities.java b/src/test/java/io/github/thebusybiscuit/slimefun4/testing/TestUtilities.java index f56e74077..d103bb174 100644 --- a/src/test/java/io/github/thebusybiscuit/slimefun4/testing/TestUtilities.java +++ b/src/test/java/io/github/thebusybiscuit/slimefun4/testing/TestUtilities.java @@ -19,9 +19,9 @@ import org.mockito.Mockito; import be.seeseemelk.mockbukkit.ServerMock; import io.github.thebusybiscuit.cscorelib2.item.CustomItem; import io.github.thebusybiscuit.slimefun4.api.player.PlayerProfile; +import io.github.thebusybiscuit.slimefun4.implementation.SlimefunPlugin; import io.github.thebusybiscuit.slimefun4.implementation.items.VanillaItem; import io.github.thebusybiscuit.slimefun4.testing.mocks.MockSlimefunItem; -import me.mrCookieSlime.Slimefun.SlimefunPlugin; import me.mrCookieSlime.Slimefun.Lists.RecipeType; import me.mrCookieSlime.Slimefun.Objects.Category; import me.mrCookieSlime.Slimefun.Objects.SlimefunItem.SlimefunItem; diff --git a/src/test/java/io/github/thebusybiscuit/slimefun4/testing/interfaces/SlimefunItemTest.java b/src/test/java/io/github/thebusybiscuit/slimefun4/testing/interfaces/SlimefunItemTest.java index 00a102426..32c7b4162 100644 --- a/src/test/java/io/github/thebusybiscuit/slimefun4/testing/interfaces/SlimefunItemTest.java +++ b/src/test/java/io/github/thebusybiscuit/slimefun4/testing/interfaces/SlimefunItemTest.java @@ -7,7 +7,7 @@ import org.bukkit.event.player.PlayerItemConsumeEvent; import org.bukkit.inventory.EquipmentSlot; import io.github.thebusybiscuit.slimefun4.api.events.PlayerRightClickEvent; -import me.mrCookieSlime.Slimefun.SlimefunPlugin; +import io.github.thebusybiscuit.slimefun4.implementation.SlimefunPlugin; import me.mrCookieSlime.Slimefun.Objects.SlimefunItem.SlimefunItem; import me.mrCookieSlime.Slimefun.Objects.handlers.ItemConsumptionHandler; import me.mrCookieSlime.Slimefun.Objects.handlers.ItemUseHandler; diff --git a/src/test/java/io/github/thebusybiscuit/slimefun4/testing/tests/TestPluginClass.java b/src/test/java/io/github/thebusybiscuit/slimefun4/testing/tests/TestPluginClass.java index dc2f1d799..b40004742 100644 --- a/src/test/java/io/github/thebusybiscuit/slimefun4/testing/tests/TestPluginClass.java +++ b/src/test/java/io/github/thebusybiscuit/slimefun4/testing/tests/TestPluginClass.java @@ -7,7 +7,7 @@ import org.junit.jupiter.api.Test; import be.seeseemelk.mockbukkit.MockBukkit; import io.github.thebusybiscuit.slimefun4.api.MinecraftVersion; -import me.mrCookieSlime.Slimefun.SlimefunPlugin; +import io.github.thebusybiscuit.slimefun4.implementation.SlimefunPlugin; public class TestPluginClass { @@ -39,7 +39,7 @@ public class TestPluginClass { @Test public void testGetters() { - Assertions.assertNotNull(SlimefunPlugin.getTicker()); + Assertions.assertNotNull(SlimefunPlugin.getTickerTask()); Assertions.assertNotNull(SlimefunPlugin.getVersion()); Assertions.assertNotNull(SlimefunPlugin.getRegistry()); Assertions.assertNotNull(SlimefunPlugin.getCommand()); @@ -47,8 +47,8 @@ public class TestPluginClass { @Test public void testServicesNotNull() { - Assertions.assertNotNull(SlimefunPlugin.getLocal()); - Assertions.assertNotNull(SlimefunPlugin.getMinecraftRecipes()); + Assertions.assertNotNull(SlimefunPlugin.getLocalization()); + Assertions.assertNotNull(SlimefunPlugin.getMinecraftRecipeService()); Assertions.assertNotNull(SlimefunPlugin.getItemDataService()); Assertions.assertNotNull(SlimefunPlugin.getItemTextureService()); Assertions.assertNotNull(SlimefunPlugin.getPermissionsService()); diff --git a/src/test/java/io/github/thebusybiscuit/slimefun4/testing/tests/commands/TestBackpackCommand.java b/src/test/java/io/github/thebusybiscuit/slimefun4/testing/tests/commands/TestBackpackCommand.java index fbca86a2d..de4559d66 100644 --- a/src/test/java/io/github/thebusybiscuit/slimefun4/testing/tests/commands/TestBackpackCommand.java +++ b/src/test/java/io/github/thebusybiscuit/slimefun4/testing/tests/commands/TestBackpackCommand.java @@ -17,10 +17,10 @@ import be.seeseemelk.mockbukkit.ServerMock; import io.github.thebusybiscuit.slimefun4.api.player.PlayerBackpack; import io.github.thebusybiscuit.slimefun4.api.player.PlayerProfile; import io.github.thebusybiscuit.slimefun4.implementation.SlimefunItems; +import io.github.thebusybiscuit.slimefun4.implementation.SlimefunPlugin; import io.github.thebusybiscuit.slimefun4.testing.TestUtilities; import io.github.thebusybiscuit.slimefun4.utils.PatternUtils; import io.github.thebusybiscuit.slimefun4.utils.SlimefunUtils; -import me.mrCookieSlime.Slimefun.SlimefunPlugin; public class TestBackpackCommand { diff --git a/src/test/java/io/github/thebusybiscuit/slimefun4/testing/tests/commands/TestDebugFishCommand.java b/src/test/java/io/github/thebusybiscuit/slimefun4/testing/tests/commands/TestDebugFishCommand.java index c0ef530b7..81360c0d2 100644 --- a/src/test/java/io/github/thebusybiscuit/slimefun4/testing/tests/commands/TestDebugFishCommand.java +++ b/src/test/java/io/github/thebusybiscuit/slimefun4/testing/tests/commands/TestDebugFishCommand.java @@ -10,8 +10,8 @@ import org.junit.jupiter.params.provider.ValueSource; import be.seeseemelk.mockbukkit.MockBukkit; import be.seeseemelk.mockbukkit.ServerMock; import io.github.thebusybiscuit.slimefun4.implementation.SlimefunItems; +import io.github.thebusybiscuit.slimefun4.implementation.SlimefunPlugin; import io.github.thebusybiscuit.slimefun4.utils.SlimefunUtils; -import me.mrCookieSlime.Slimefun.SlimefunPlugin; public class TestDebugFishCommand { diff --git a/src/test/java/io/github/thebusybiscuit/slimefun4/testing/tests/commands/TestGuideCommand.java b/src/test/java/io/github/thebusybiscuit/slimefun4/testing/tests/commands/TestGuideCommand.java index c07149679..1976f6f2a 100644 --- a/src/test/java/io/github/thebusybiscuit/slimefun4/testing/tests/commands/TestGuideCommand.java +++ b/src/test/java/io/github/thebusybiscuit/slimefun4/testing/tests/commands/TestGuideCommand.java @@ -12,8 +12,8 @@ import be.seeseemelk.mockbukkit.MockBukkit; import be.seeseemelk.mockbukkit.ServerMock; import io.github.thebusybiscuit.slimefun4.core.guide.SlimefunGuide; import io.github.thebusybiscuit.slimefun4.core.guide.SlimefunGuideLayout; +import io.github.thebusybiscuit.slimefun4.implementation.SlimefunPlugin; import io.github.thebusybiscuit.slimefun4.utils.SlimefunUtils; -import me.mrCookieSlime.Slimefun.SlimefunPlugin; public class TestGuideCommand { diff --git a/src/test/java/io/github/thebusybiscuit/slimefun4/testing/tests/commands/TestResearchCommand.java b/src/test/java/io/github/thebusybiscuit/slimefun4/testing/tests/commands/TestResearchCommand.java index 994a77b2b..db30d05b6 100644 --- a/src/test/java/io/github/thebusybiscuit/slimefun4/testing/tests/commands/TestResearchCommand.java +++ b/src/test/java/io/github/thebusybiscuit/slimefun4/testing/tests/commands/TestResearchCommand.java @@ -11,8 +11,8 @@ import be.seeseemelk.mockbukkit.MockBukkit; import be.seeseemelk.mockbukkit.ServerMock; import io.github.thebusybiscuit.slimefun4.api.player.PlayerProfile; import io.github.thebusybiscuit.slimefun4.core.researching.Research; +import io.github.thebusybiscuit.slimefun4.implementation.SlimefunPlugin; import io.github.thebusybiscuit.slimefun4.testing.TestUtilities; -import me.mrCookieSlime.Slimefun.SlimefunPlugin; public class TestResearchCommand { diff --git a/src/test/java/io/github/thebusybiscuit/slimefun4/testing/tests/geo/TestResourceRegistration.java b/src/test/java/io/github/thebusybiscuit/slimefun4/testing/tests/geo/TestResourceRegistration.java index 86c872432..29d30549e 100644 --- a/src/test/java/io/github/thebusybiscuit/slimefun4/testing/tests/geo/TestResourceRegistration.java +++ b/src/test/java/io/github/thebusybiscuit/slimefun4/testing/tests/geo/TestResourceRegistration.java @@ -17,9 +17,9 @@ import org.junit.jupiter.api.TestMethodOrder; import be.seeseemelk.mockbukkit.MockBukkit; import io.github.thebusybiscuit.slimefun4.api.geo.GEOResource; import io.github.thebusybiscuit.slimefun4.implementation.SlimefunItems; +import io.github.thebusybiscuit.slimefun4.implementation.SlimefunPlugin; import io.github.thebusybiscuit.slimefun4.implementation.resources.GEOResourcesSetup; import io.github.thebusybiscuit.slimefun4.utils.SlimefunUtils; -import me.mrCookieSlime.Slimefun.SlimefunPlugin; @TestMethodOrder(value = OrderAnnotation.class) public class TestResourceRegistration { diff --git a/src/test/java/io/github/thebusybiscuit/slimefun4/testing/tests/gps/TestWaypoints.java b/src/test/java/io/github/thebusybiscuit/slimefun4/testing/tests/gps/TestWaypoints.java index fe9cf4b42..6ae75c56c 100644 --- a/src/test/java/io/github/thebusybiscuit/slimefun4/testing/tests/gps/TestWaypoints.java +++ b/src/test/java/io/github/thebusybiscuit/slimefun4/testing/tests/gps/TestWaypoints.java @@ -12,8 +12,8 @@ import io.github.thebusybiscuit.slimefun4.api.events.WaypointCreateEvent; import io.github.thebusybiscuit.slimefun4.api.gps.GPSNetwork; import io.github.thebusybiscuit.slimefun4.api.gps.Waypoint; import io.github.thebusybiscuit.slimefun4.api.player.PlayerProfile; +import io.github.thebusybiscuit.slimefun4.implementation.SlimefunPlugin; import io.github.thebusybiscuit.slimefun4.testing.TestUtilities; -import me.mrCookieSlime.Slimefun.SlimefunPlugin; public class TestWaypoints { diff --git a/src/test/java/io/github/thebusybiscuit/slimefun4/testing/tests/guide/TestBookSlimefunGuide.java b/src/test/java/io/github/thebusybiscuit/slimefun4/testing/tests/guide/TestBookSlimefunGuide.java index c28760e26..6ae0170ac 100644 --- a/src/test/java/io/github/thebusybiscuit/slimefun4/testing/tests/guide/TestBookSlimefunGuide.java +++ b/src/test/java/io/github/thebusybiscuit/slimefun4/testing/tests/guide/TestBookSlimefunGuide.java @@ -7,8 +7,8 @@ import org.junit.jupiter.api.Test; import be.seeseemelk.mockbukkit.MockBukkit; import io.github.thebusybiscuit.slimefun4.core.guide.SlimefunGuideLayout; +import io.github.thebusybiscuit.slimefun4.implementation.SlimefunPlugin; import io.github.thebusybiscuit.slimefun4.implementation.guide.BookSlimefunGuide; -import me.mrCookieSlime.Slimefun.SlimefunPlugin; public class TestBookSlimefunGuide { diff --git a/src/test/java/io/github/thebusybiscuit/slimefun4/testing/tests/guide/TestChestSlimefunGuide.java b/src/test/java/io/github/thebusybiscuit/slimefun4/testing/tests/guide/TestChestSlimefunGuide.java index f609ef618..260ed9bc1 100644 --- a/src/test/java/io/github/thebusybiscuit/slimefun4/testing/tests/guide/TestChestSlimefunGuide.java +++ b/src/test/java/io/github/thebusybiscuit/slimefun4/testing/tests/guide/TestChestSlimefunGuide.java @@ -7,8 +7,8 @@ import org.junit.jupiter.api.Test; import be.seeseemelk.mockbukkit.MockBukkit; import io.github.thebusybiscuit.slimefun4.core.guide.SlimefunGuideLayout; +import io.github.thebusybiscuit.slimefun4.implementation.SlimefunPlugin; import io.github.thebusybiscuit.slimefun4.implementation.guide.ChestSlimefunGuide; -import me.mrCookieSlime.Slimefun.SlimefunPlugin; public class TestChestSlimefunGuide { diff --git a/src/test/java/io/github/thebusybiscuit/slimefun4/testing/tests/guide/TestGuideOpening.java b/src/test/java/io/github/thebusybiscuit/slimefun4/testing/tests/guide/TestGuideOpening.java index c76b6794b..e23c39d06 100644 --- a/src/test/java/io/github/thebusybiscuit/slimefun4/testing/tests/guide/TestGuideOpening.java +++ b/src/test/java/io/github/thebusybiscuit/slimefun4/testing/tests/guide/TestGuideOpening.java @@ -17,8 +17,8 @@ import io.github.thebusybiscuit.cscorelib2.item.CustomItem; import io.github.thebusybiscuit.slimefun4.api.player.PlayerProfile; import io.github.thebusybiscuit.slimefun4.core.guide.GuideHistory; import io.github.thebusybiscuit.slimefun4.core.guide.SlimefunGuideImplementation; +import io.github.thebusybiscuit.slimefun4.implementation.SlimefunPlugin; import io.github.thebusybiscuit.slimefun4.testing.TestUtilities; -import me.mrCookieSlime.Slimefun.SlimefunPlugin; import me.mrCookieSlime.Slimefun.Objects.Category; import me.mrCookieSlime.Slimefun.Objects.SlimefunItem.SlimefunItem; diff --git a/src/test/java/io/github/thebusybiscuit/slimefun4/testing/tests/items/TestCategories.java b/src/test/java/io/github/thebusybiscuit/slimefun4/testing/tests/items/TestCategories.java index f38eaf17a..01fdc202b 100644 --- a/src/test/java/io/github/thebusybiscuit/slimefun4/testing/tests/items/TestCategories.java +++ b/src/test/java/io/github/thebusybiscuit/slimefun4/testing/tests/items/TestCategories.java @@ -21,8 +21,8 @@ import io.github.thebusybiscuit.slimefun4.core.categories.LockedCategory; import io.github.thebusybiscuit.slimefun4.core.categories.SeasonalCategory; import io.github.thebusybiscuit.slimefun4.core.guide.SlimefunGuideLayout; import io.github.thebusybiscuit.slimefun4.core.researching.Research; +import io.github.thebusybiscuit.slimefun4.implementation.SlimefunPlugin; import io.github.thebusybiscuit.slimefun4.testing.TestUtilities; -import me.mrCookieSlime.Slimefun.SlimefunPlugin; import me.mrCookieSlime.Slimefun.Lists.RecipeType; import me.mrCookieSlime.Slimefun.Objects.Category; import me.mrCookieSlime.Slimefun.Objects.SlimefunItem.SlimefunItem; diff --git a/src/test/java/io/github/thebusybiscuit/slimefun4/testing/tests/items/TestItemHandlers.java b/src/test/java/io/github/thebusybiscuit/slimefun4/testing/tests/items/TestItemHandlers.java index 373cdeaf2..06df60470 100644 --- a/src/test/java/io/github/thebusybiscuit/slimefun4/testing/tests/items/TestItemHandlers.java +++ b/src/test/java/io/github/thebusybiscuit/slimefun4/testing/tests/items/TestItemHandlers.java @@ -14,9 +14,9 @@ import org.junit.jupiter.api.Test; import be.seeseemelk.mockbukkit.MockBukkit; import io.github.thebusybiscuit.cscorelib2.item.CustomItem; import io.github.thebusybiscuit.slimefun4.api.exceptions.IncompatibleItemHandlerException; +import io.github.thebusybiscuit.slimefun4.implementation.SlimefunPlugin; import io.github.thebusybiscuit.slimefun4.testing.TestUtilities; import io.github.thebusybiscuit.slimefun4.testing.mocks.MockItemHandler; -import me.mrCookieSlime.Slimefun.SlimefunPlugin; import me.mrCookieSlime.Slimefun.Objects.SlimefunItem.SlimefunItem; import me.mrCookieSlime.Slimefun.Objects.handlers.BowShootHandler; import me.mrCookieSlime.Slimefun.Objects.handlers.ItemHandler; diff --git a/src/test/java/io/github/thebusybiscuit/slimefun4/testing/tests/items/TestItemSettings.java b/src/test/java/io/github/thebusybiscuit/slimefun4/testing/tests/items/TestItemSettings.java index 9b83bd152..394d21648 100644 --- a/src/test/java/io/github/thebusybiscuit/slimefun4/testing/tests/items/TestItemSettings.java +++ b/src/test/java/io/github/thebusybiscuit/slimefun4/testing/tests/items/TestItemSettings.java @@ -11,8 +11,8 @@ import org.junit.jupiter.api.Test; import be.seeseemelk.mockbukkit.MockBukkit; import io.github.thebusybiscuit.cscorelib2.item.CustomItem; import io.github.thebusybiscuit.slimefun4.api.items.ItemSetting; +import io.github.thebusybiscuit.slimefun4.implementation.SlimefunPlugin; import io.github.thebusybiscuit.slimefun4.testing.TestUtilities; -import me.mrCookieSlime.Slimefun.SlimefunPlugin; import me.mrCookieSlime.Slimefun.Objects.SlimefunItem.SlimefunItem; public class TestItemSettings { diff --git a/src/test/java/io/github/thebusybiscuit/slimefun4/testing/tests/items/TestItemSetup.java b/src/test/java/io/github/thebusybiscuit/slimefun4/testing/tests/items/TestItemSetup.java index 18578cc0c..bd4a15362 100644 --- a/src/test/java/io/github/thebusybiscuit/slimefun4/testing/tests/items/TestItemSetup.java +++ b/src/test/java/io/github/thebusybiscuit/slimefun4/testing/tests/items/TestItemSetup.java @@ -17,10 +17,10 @@ import org.junit.jupiter.api.TestMethodOrder; import be.seeseemelk.mockbukkit.MockBukkit; import be.seeseemelk.mockbukkit.ServerMock; +import io.github.thebusybiscuit.slimefun4.implementation.SlimefunPlugin; import io.github.thebusybiscuit.slimefun4.implementation.setup.PostSetup; import io.github.thebusybiscuit.slimefun4.implementation.setup.SlimefunItemSetup; import io.github.thebusybiscuit.slimefun4.testing.TestUtilities; -import me.mrCookieSlime.Slimefun.SlimefunPlugin; import me.mrCookieSlime.Slimefun.Objects.Category; @TestMethodOrder(value = OrderAnnotation.class) diff --git a/src/test/java/io/github/thebusybiscuit/slimefun4/testing/tests/items/TestRechargeableItems.java b/src/test/java/io/github/thebusybiscuit/slimefun4/testing/tests/items/TestRechargeableItems.java index 3e11539ef..337cda7cd 100644 --- a/src/test/java/io/github/thebusybiscuit/slimefun4/testing/tests/items/TestRechargeableItems.java +++ b/src/test/java/io/github/thebusybiscuit/slimefun4/testing/tests/items/TestRechargeableItems.java @@ -11,9 +11,9 @@ import be.seeseemelk.mockbukkit.MockBukkit; import io.github.thebusybiscuit.cscorelib2.chat.ChatColors; import io.github.thebusybiscuit.cscorelib2.item.CustomItem; import io.github.thebusybiscuit.slimefun4.core.attributes.Rechargeable; +import io.github.thebusybiscuit.slimefun4.implementation.SlimefunPlugin; import io.github.thebusybiscuit.slimefun4.testing.TestUtilities; import io.github.thebusybiscuit.slimefun4.utils.LoreBuilder; -import me.mrCookieSlime.Slimefun.SlimefunPlugin; import me.mrCookieSlime.Slimefun.Lists.RecipeType; import me.mrCookieSlime.Slimefun.Objects.Category; import me.mrCookieSlime.Slimefun.Objects.SlimefunItem.SlimefunItem; diff --git a/src/test/java/io/github/thebusybiscuit/slimefun4/testing/tests/items/TestSlimefunItemRegistration.java b/src/test/java/io/github/thebusybiscuit/slimefun4/testing/tests/items/TestSlimefunItemRegistration.java index 28a1fdf21..7c37b4dd1 100644 --- a/src/test/java/io/github/thebusybiscuit/slimefun4/testing/tests/items/TestSlimefunItemRegistration.java +++ b/src/test/java/io/github/thebusybiscuit/slimefun4/testing/tests/items/TestSlimefunItemRegistration.java @@ -16,9 +16,9 @@ import be.seeseemelk.mockbukkit.MockBukkit; import io.github.thebusybiscuit.cscorelib2.item.CustomItem; import io.github.thebusybiscuit.slimefun4.api.exceptions.IdConflictException; import io.github.thebusybiscuit.slimefun4.api.items.ItemState; +import io.github.thebusybiscuit.slimefun4.implementation.SlimefunPlugin; import io.github.thebusybiscuit.slimefun4.implementation.items.VanillaItem; import io.github.thebusybiscuit.slimefun4.testing.TestUtilities; -import me.mrCookieSlime.Slimefun.SlimefunPlugin; import me.mrCookieSlime.Slimefun.Lists.RecipeType; import me.mrCookieSlime.Slimefun.Objects.Category; import me.mrCookieSlime.Slimefun.Objects.SlimefunItem.SlimefunItem; diff --git a/src/test/java/io/github/thebusybiscuit/slimefun4/testing/tests/items/implementations/backpacks/TestEnderBackpack.java b/src/test/java/io/github/thebusybiscuit/slimefun4/testing/tests/items/implementations/backpacks/TestEnderBackpack.java index d85469718..5684b59b9 100644 --- a/src/test/java/io/github/thebusybiscuit/slimefun4/testing/tests/items/implementations/backpacks/TestEnderBackpack.java +++ b/src/test/java/io/github/thebusybiscuit/slimefun4/testing/tests/items/implementations/backpacks/TestEnderBackpack.java @@ -10,10 +10,10 @@ import org.junit.jupiter.api.Test; import be.seeseemelk.mockbukkit.MockBukkit; import be.seeseemelk.mockbukkit.ServerMock; +import io.github.thebusybiscuit.slimefun4.implementation.SlimefunPlugin; import io.github.thebusybiscuit.slimefun4.implementation.items.backpacks.EnderBackpack; import io.github.thebusybiscuit.slimefun4.testing.TestUtilities; import io.github.thebusybiscuit.slimefun4.testing.interfaces.SlimefunItemTest; -import me.mrCookieSlime.Slimefun.SlimefunPlugin; import me.mrCookieSlime.Slimefun.Lists.RecipeType; import me.mrCookieSlime.Slimefun.api.SlimefunItemStack; diff --git a/src/test/java/io/github/thebusybiscuit/slimefun4/testing/tests/items/implementations/food/TestDietCookie.java b/src/test/java/io/github/thebusybiscuit/slimefun4/testing/tests/items/implementations/food/TestDietCookie.java index b5573d028..4bcdb086a 100644 --- a/src/test/java/io/github/thebusybiscuit/slimefun4/testing/tests/items/implementations/food/TestDietCookie.java +++ b/src/test/java/io/github/thebusybiscuit/slimefun4/testing/tests/items/implementations/food/TestDietCookie.java @@ -13,10 +13,10 @@ import org.junit.jupiter.api.Test; import be.seeseemelk.mockbukkit.MockBukkit; import be.seeseemelk.mockbukkit.ServerMock; import be.seeseemelk.mockbukkit.entity.PlayerMock; +import io.github.thebusybiscuit.slimefun4.implementation.SlimefunPlugin; import io.github.thebusybiscuit.slimefun4.implementation.items.food.DietCookie; import io.github.thebusybiscuit.slimefun4.testing.TestUtilities; import io.github.thebusybiscuit.slimefun4.testing.interfaces.SlimefunItemTest; -import me.mrCookieSlime.Slimefun.SlimefunPlugin; import me.mrCookieSlime.Slimefun.Lists.RecipeType; import me.mrCookieSlime.Slimefun.api.SlimefunItemStack; diff --git a/src/test/java/io/github/thebusybiscuit/slimefun4/testing/tests/items/implementations/food/TestMeatJerky.java b/src/test/java/io/github/thebusybiscuit/slimefun4/testing/tests/items/implementations/food/TestMeatJerky.java index 129da4cfe..9a84f1c2e 100644 --- a/src/test/java/io/github/thebusybiscuit/slimefun4/testing/tests/items/implementations/food/TestMeatJerky.java +++ b/src/test/java/io/github/thebusybiscuit/slimefun4/testing/tests/items/implementations/food/TestMeatJerky.java @@ -10,10 +10,10 @@ import org.junit.jupiter.api.Test; import be.seeseemelk.mockbukkit.MockBukkit; import be.seeseemelk.mockbukkit.ServerMock; import be.seeseemelk.mockbukkit.entity.PlayerMock; +import io.github.thebusybiscuit.slimefun4.implementation.SlimefunPlugin; import io.github.thebusybiscuit.slimefun4.implementation.items.food.MeatJerky; import io.github.thebusybiscuit.slimefun4.testing.TestUtilities; import io.github.thebusybiscuit.slimefun4.testing.interfaces.SlimefunItemTest; -import me.mrCookieSlime.Slimefun.SlimefunPlugin; import me.mrCookieSlime.Slimefun.Lists.RecipeType; import me.mrCookieSlime.Slimefun.api.SlimefunItemStack; diff --git a/src/test/java/io/github/thebusybiscuit/slimefun4/testing/tests/items/implementations/food/TestMonsterJerky.java b/src/test/java/io/github/thebusybiscuit/slimefun4/testing/tests/items/implementations/food/TestMonsterJerky.java index c1a809a6b..c8752a782 100644 --- a/src/test/java/io/github/thebusybiscuit/slimefun4/testing/tests/items/implementations/food/TestMonsterJerky.java +++ b/src/test/java/io/github/thebusybiscuit/slimefun4/testing/tests/items/implementations/food/TestMonsterJerky.java @@ -12,10 +12,10 @@ import org.junit.jupiter.api.Test; import be.seeseemelk.mockbukkit.MockBukkit; import be.seeseemelk.mockbukkit.ServerMock; import be.seeseemelk.mockbukkit.entity.PlayerMock; +import io.github.thebusybiscuit.slimefun4.implementation.SlimefunPlugin; import io.github.thebusybiscuit.slimefun4.implementation.items.food.MonsterJerky; import io.github.thebusybiscuit.slimefun4.testing.TestUtilities; import io.github.thebusybiscuit.slimefun4.testing.interfaces.SlimefunItemTest; -import me.mrCookieSlime.Slimefun.SlimefunPlugin; import me.mrCookieSlime.Slimefun.Lists.RecipeType; import me.mrCookieSlime.Slimefun.api.SlimefunItemStack; diff --git a/src/test/java/io/github/thebusybiscuit/slimefun4/testing/tests/listeners/TestBackpackListener.java b/src/test/java/io/github/thebusybiscuit/slimefun4/testing/tests/listeners/TestBackpackListener.java index 8b7bcdcd1..47f7d276a 100644 --- a/src/test/java/io/github/thebusybiscuit/slimefun4/testing/tests/listeners/TestBackpackListener.java +++ b/src/test/java/io/github/thebusybiscuit/slimefun4/testing/tests/listeners/TestBackpackListener.java @@ -31,10 +31,10 @@ import be.seeseemelk.mockbukkit.ServerMock; import io.github.thebusybiscuit.cscorelib2.item.CustomItem; import io.github.thebusybiscuit.slimefun4.api.player.PlayerBackpack; import io.github.thebusybiscuit.slimefun4.api.player.PlayerProfile; +import io.github.thebusybiscuit.slimefun4.implementation.SlimefunPlugin; import io.github.thebusybiscuit.slimefun4.implementation.items.backpacks.SlimefunBackpack; import io.github.thebusybiscuit.slimefun4.implementation.listeners.BackpackListener; import io.github.thebusybiscuit.slimefun4.testing.TestUtilities; -import me.mrCookieSlime.Slimefun.SlimefunPlugin; import me.mrCookieSlime.Slimefun.Lists.RecipeType; import me.mrCookieSlime.Slimefun.Objects.Category; import me.mrCookieSlime.Slimefun.api.SlimefunItemStack; diff --git a/src/test/java/io/github/thebusybiscuit/slimefun4/testing/tests/listeners/TestCargoNodeListener.java b/src/test/java/io/github/thebusybiscuit/slimefun4/testing/tests/listeners/TestCargoNodeListener.java index 6b50ec90e..f878de7aa 100644 --- a/src/test/java/io/github/thebusybiscuit/slimefun4/testing/tests/listeners/TestCargoNodeListener.java +++ b/src/test/java/io/github/thebusybiscuit/slimefun4/testing/tests/listeners/TestCargoNodeListener.java @@ -17,9 +17,9 @@ import org.junit.jupiter.params.ParameterizedTest; import be.seeseemelk.mockbukkit.MockBukkit; import be.seeseemelk.mockbukkit.ServerMock; import be.seeseemelk.mockbukkit.block.BlockStateMock; +import io.github.thebusybiscuit.slimefun4.implementation.SlimefunPlugin; import io.github.thebusybiscuit.slimefun4.implementation.listeners.CargoNodeListener; import io.github.thebusybiscuit.slimefun4.testing.annotations.SlimefunItemsSource; -import me.mrCookieSlime.Slimefun.SlimefunPlugin; public class TestCargoNodeListener { diff --git a/src/test/java/io/github/thebusybiscuit/slimefun4/testing/tests/listeners/TestCoolerListener.java b/src/test/java/io/github/thebusybiscuit/slimefun4/testing/tests/listeners/TestCoolerListener.java index 3c608704b..c594dfb3c 100644 --- a/src/test/java/io/github/thebusybiscuit/slimefun4/testing/tests/listeners/TestCoolerListener.java +++ b/src/test/java/io/github/thebusybiscuit/slimefun4/testing/tests/listeners/TestCoolerListener.java @@ -18,12 +18,12 @@ import be.seeseemelk.mockbukkit.ServerMock; import io.github.thebusybiscuit.cscorelib2.item.CustomItem; import io.github.thebusybiscuit.slimefun4.api.player.PlayerBackpack; import io.github.thebusybiscuit.slimefun4.api.player.PlayerProfile; +import io.github.thebusybiscuit.slimefun4.implementation.SlimefunPlugin; import io.github.thebusybiscuit.slimefun4.implementation.items.backpacks.Cooler; import io.github.thebusybiscuit.slimefun4.implementation.items.food.Juice; import io.github.thebusybiscuit.slimefun4.implementation.listeners.BackpackListener; import io.github.thebusybiscuit.slimefun4.implementation.listeners.CoolerListener; import io.github.thebusybiscuit.slimefun4.testing.TestUtilities; -import me.mrCookieSlime.Slimefun.SlimefunPlugin; import me.mrCookieSlime.Slimefun.Lists.RecipeType; import me.mrCookieSlime.Slimefun.Objects.Category; import me.mrCookieSlime.Slimefun.api.SlimefunItemStack; diff --git a/src/test/java/io/github/thebusybiscuit/slimefun4/testing/tests/listeners/TestDeathpointListener.java b/src/test/java/io/github/thebusybiscuit/slimefun4/testing/tests/listeners/TestDeathpointListener.java index 7375a5fbe..625d9b0b6 100644 --- a/src/test/java/io/github/thebusybiscuit/slimefun4/testing/tests/listeners/TestDeathpointListener.java +++ b/src/test/java/io/github/thebusybiscuit/slimefun4/testing/tests/listeners/TestDeathpointListener.java @@ -10,9 +10,9 @@ import be.seeseemelk.mockbukkit.MockBukkit; import be.seeseemelk.mockbukkit.ServerMock; import io.github.thebusybiscuit.slimefun4.api.events.WaypointCreateEvent; import io.github.thebusybiscuit.slimefun4.implementation.SlimefunItems; +import io.github.thebusybiscuit.slimefun4.implementation.SlimefunPlugin; import io.github.thebusybiscuit.slimefun4.implementation.listeners.DeathpointListener; import io.github.thebusybiscuit.slimefun4.testing.TestUtilities; -import me.mrCookieSlime.Slimefun.SlimefunPlugin; public class TestDeathpointListener { diff --git a/src/test/java/io/github/thebusybiscuit/slimefun4/testing/tests/listeners/TestFireworksListener.java b/src/test/java/io/github/thebusybiscuit/slimefun4/testing/tests/listeners/TestFireworksListener.java index 25a7b07a1..849416af7 100644 --- a/src/test/java/io/github/thebusybiscuit/slimefun4/testing/tests/listeners/TestFireworksListener.java +++ b/src/test/java/io/github/thebusybiscuit/slimefun4/testing/tests/listeners/TestFireworksListener.java @@ -16,8 +16,8 @@ import org.mockito.Mockito; import be.seeseemelk.mockbukkit.MockBukkit; import be.seeseemelk.mockbukkit.ServerMock; import be.seeseemelk.mockbukkit.inventory.meta.FireworkMetaMock; +import io.github.thebusybiscuit.slimefun4.implementation.SlimefunPlugin; import io.github.thebusybiscuit.slimefun4.implementation.listeners.FireworksListener; -import me.mrCookieSlime.Slimefun.SlimefunPlugin; public class TestFireworksListener { diff --git a/src/test/java/io/github/thebusybiscuit/slimefun4/testing/tests/listeners/TestIronGolemListener.java b/src/test/java/io/github/thebusybiscuit/slimefun4/testing/tests/listeners/TestIronGolemListener.java index 52926382c..2f6be5615 100644 --- a/src/test/java/io/github/thebusybiscuit/slimefun4/testing/tests/listeners/TestIronGolemListener.java +++ b/src/test/java/io/github/thebusybiscuit/slimefun4/testing/tests/listeners/TestIronGolemListener.java @@ -16,10 +16,10 @@ import org.mockito.Mockito; import be.seeseemelk.mockbukkit.MockBukkit; import be.seeseemelk.mockbukkit.ServerMock; import io.github.thebusybiscuit.cscorelib2.item.CustomItem; +import io.github.thebusybiscuit.slimefun4.implementation.SlimefunPlugin; import io.github.thebusybiscuit.slimefun4.implementation.items.VanillaItem; import io.github.thebusybiscuit.slimefun4.implementation.listeners.IronGolemListener; import io.github.thebusybiscuit.slimefun4.testing.TestUtilities; -import me.mrCookieSlime.Slimefun.SlimefunPlugin; import me.mrCookieSlime.Slimefun.Objects.SlimefunItem.SlimefunItem; public class TestIronGolemListener { diff --git a/src/test/java/io/github/thebusybiscuit/slimefun4/testing/tests/listeners/TestMultiblockListener.java b/src/test/java/io/github/thebusybiscuit/slimefun4/testing/tests/listeners/TestMultiblockListener.java index 88af97e2b..4d7d96ef4 100644 --- a/src/test/java/io/github/thebusybiscuit/slimefun4/testing/tests/listeners/TestMultiblockListener.java +++ b/src/test/java/io/github/thebusybiscuit/slimefun4/testing/tests/listeners/TestMultiblockListener.java @@ -19,9 +19,9 @@ import be.seeseemelk.mockbukkit.ServerMock; import io.github.thebusybiscuit.cscorelib2.item.CustomItem; import io.github.thebusybiscuit.slimefun4.api.events.MultiBlockInteractEvent; import io.github.thebusybiscuit.slimefun4.core.multiblocks.MultiBlock; +import io.github.thebusybiscuit.slimefun4.implementation.SlimefunPlugin; import io.github.thebusybiscuit.slimefun4.implementation.listeners.MultiBlockListener; import io.github.thebusybiscuit.slimefun4.testing.TestUtilities; -import me.mrCookieSlime.Slimefun.SlimefunPlugin; import me.mrCookieSlime.Slimefun.Objects.SlimefunItem.SlimefunItem; public class TestMultiblockListener { diff --git a/src/test/java/io/github/thebusybiscuit/slimefun4/testing/tests/listeners/TestNetworkListener.java b/src/test/java/io/github/thebusybiscuit/slimefun4/testing/tests/listeners/TestNetworkListener.java index c48dde944..0fbb6a86e 100644 --- a/src/test/java/io/github/thebusybiscuit/slimefun4/testing/tests/listeners/TestNetworkListener.java +++ b/src/test/java/io/github/thebusybiscuit/slimefun4/testing/tests/listeners/TestNetworkListener.java @@ -17,8 +17,8 @@ import be.seeseemelk.mockbukkit.MockBukkit; import be.seeseemelk.mockbukkit.ServerMock; import io.github.thebusybiscuit.slimefun4.api.network.Network; import io.github.thebusybiscuit.slimefun4.core.networks.NetworkManager; +import io.github.thebusybiscuit.slimefun4.implementation.SlimefunPlugin; import io.github.thebusybiscuit.slimefun4.implementation.listeners.NetworkListener; -import me.mrCookieSlime.Slimefun.SlimefunPlugin; public class TestNetworkListener { diff --git a/src/test/java/io/github/thebusybiscuit/slimefun4/testing/tests/listeners/TestPlayerProfileListener.java b/src/test/java/io/github/thebusybiscuit/slimefun4/testing/tests/listeners/TestPlayerProfileListener.java index a1c9c6e47..1a9221f03 100644 --- a/src/test/java/io/github/thebusybiscuit/slimefun4/testing/tests/listeners/TestPlayerProfileListener.java +++ b/src/test/java/io/github/thebusybiscuit/slimefun4/testing/tests/listeners/TestPlayerProfileListener.java @@ -11,9 +11,9 @@ import org.junit.jupiter.api.Test; import be.seeseemelk.mockbukkit.MockBukkit; import be.seeseemelk.mockbukkit.ServerMock; import io.github.thebusybiscuit.slimefun4.api.player.PlayerProfile; +import io.github.thebusybiscuit.slimefun4.implementation.SlimefunPlugin; import io.github.thebusybiscuit.slimefun4.implementation.listeners.PlayerProfileListener; import io.github.thebusybiscuit.slimefun4.testing.TestUtilities; -import me.mrCookieSlime.Slimefun.SlimefunPlugin; public class TestPlayerProfileListener { diff --git a/src/test/java/io/github/thebusybiscuit/slimefun4/testing/tests/listeners/TestSoulboundListener.java b/src/test/java/io/github/thebusybiscuit/slimefun4/testing/tests/listeners/TestSoulboundListener.java index 33f634884..9e97bc095 100644 --- a/src/test/java/io/github/thebusybiscuit/slimefun4/testing/tests/listeners/TestSoulboundListener.java +++ b/src/test/java/io/github/thebusybiscuit/slimefun4/testing/tests/listeners/TestSoulboundListener.java @@ -13,9 +13,9 @@ import be.seeseemelk.mockbukkit.MockBukkit; import be.seeseemelk.mockbukkit.ServerMock; import be.seeseemelk.mockbukkit.entity.PlayerMock; import io.github.thebusybiscuit.cscorelib2.item.CustomItem; +import io.github.thebusybiscuit.slimefun4.implementation.SlimefunPlugin; import io.github.thebusybiscuit.slimefun4.implementation.listeners.SoulboundListener; import io.github.thebusybiscuit.slimefun4.utils.SlimefunUtils; -import me.mrCookieSlime.Slimefun.SlimefunPlugin; public class TestSoulboundListener { diff --git a/src/test/java/io/github/thebusybiscuit/slimefun4/testing/tests/listeners/TestVanillaMachinesListener.java b/src/test/java/io/github/thebusybiscuit/slimefun4/testing/tests/listeners/TestVanillaMachinesListener.java index c6a35dc38..71ca41ca3 100644 --- a/src/test/java/io/github/thebusybiscuit/slimefun4/testing/tests/listeners/TestVanillaMachinesListener.java +++ b/src/test/java/io/github/thebusybiscuit/slimefun4/testing/tests/listeners/TestVanillaMachinesListener.java @@ -32,10 +32,10 @@ import be.seeseemelk.mockbukkit.ServerMock; import io.github.thebusybiscuit.cscorelib2.item.CustomItem; import io.github.thebusybiscuit.slimefun4.core.guide.SlimefunGuide; import io.github.thebusybiscuit.slimefun4.core.guide.SlimefunGuideLayout; +import io.github.thebusybiscuit.slimefun4.implementation.SlimefunPlugin; import io.github.thebusybiscuit.slimefun4.implementation.items.VanillaItem; import io.github.thebusybiscuit.slimefun4.implementation.listeners.VanillaMachinesListener; import io.github.thebusybiscuit.slimefun4.testing.TestUtilities; -import me.mrCookieSlime.Slimefun.SlimefunPlugin; import me.mrCookieSlime.Slimefun.Objects.SlimefunItem.SlimefunItem; public class TestVanillaMachinesListener { diff --git a/src/test/java/io/github/thebusybiscuit/slimefun4/testing/tests/multiblocks/TestMultiBlocks.java b/src/test/java/io/github/thebusybiscuit/slimefun4/testing/tests/multiblocks/TestMultiBlocks.java index 25f3587b7..2579c9261 100644 --- a/src/test/java/io/github/thebusybiscuit/slimefun4/testing/tests/multiblocks/TestMultiBlocks.java +++ b/src/test/java/io/github/thebusybiscuit/slimefun4/testing/tests/multiblocks/TestMultiBlocks.java @@ -11,8 +11,8 @@ import be.seeseemelk.mockbukkit.MockBukkit; import be.seeseemelk.mockbukkit.ServerMock; import io.github.thebusybiscuit.cscorelib2.item.CustomItem; import io.github.thebusybiscuit.slimefun4.core.multiblocks.MultiBlock; +import io.github.thebusybiscuit.slimefun4.implementation.SlimefunPlugin; import io.github.thebusybiscuit.slimefun4.testing.TestUtilities; -import me.mrCookieSlime.Slimefun.SlimefunPlugin; import me.mrCookieSlime.Slimefun.Objects.SlimefunItem.SlimefunItem; public class TestMultiBlocks { diff --git a/src/test/java/io/github/thebusybiscuit/slimefun4/testing/tests/profiles/TestGuideHistory.java b/src/test/java/io/github/thebusybiscuit/slimefun4/testing/tests/profiles/TestGuideHistory.java index a86851b0b..e26a9d275 100644 --- a/src/test/java/io/github/thebusybiscuit/slimefun4/testing/tests/profiles/TestGuideHistory.java +++ b/src/test/java/io/github/thebusybiscuit/slimefun4/testing/tests/profiles/TestGuideHistory.java @@ -14,8 +14,8 @@ import be.seeseemelk.mockbukkit.ServerMock; import io.github.thebusybiscuit.cscorelib2.item.CustomItem; import io.github.thebusybiscuit.slimefun4.api.player.PlayerProfile; import io.github.thebusybiscuit.slimefun4.core.guide.GuideHistory; +import io.github.thebusybiscuit.slimefun4.implementation.SlimefunPlugin; import io.github.thebusybiscuit.slimefun4.testing.TestUtilities; -import me.mrCookieSlime.Slimefun.SlimefunPlugin; import me.mrCookieSlime.Slimefun.Objects.Category; import me.mrCookieSlime.Slimefun.Objects.SlimefunItem.SlimefunItem; diff --git a/src/test/java/io/github/thebusybiscuit/slimefun4/testing/tests/profiles/TestPlayerBackpacks.java b/src/test/java/io/github/thebusybiscuit/slimefun4/testing/tests/profiles/TestPlayerBackpacks.java index 2851a07ed..1cbeef5da 100644 --- a/src/test/java/io/github/thebusybiscuit/slimefun4/testing/tests/profiles/TestPlayerBackpacks.java +++ b/src/test/java/io/github/thebusybiscuit/slimefun4/testing/tests/profiles/TestPlayerBackpacks.java @@ -14,8 +14,8 @@ import be.seeseemelk.mockbukkit.MockBukkit; import be.seeseemelk.mockbukkit.ServerMock; import io.github.thebusybiscuit.slimefun4.api.player.PlayerBackpack; import io.github.thebusybiscuit.slimefun4.api.player.PlayerProfile; +import io.github.thebusybiscuit.slimefun4.implementation.SlimefunPlugin; import io.github.thebusybiscuit.slimefun4.testing.TestUtilities; -import me.mrCookieSlime.Slimefun.SlimefunPlugin; public class TestPlayerBackpacks { diff --git a/src/test/java/io/github/thebusybiscuit/slimefun4/testing/tests/profiles/TestPlayerProfile.java b/src/test/java/io/github/thebusybiscuit/slimefun4/testing/tests/profiles/TestPlayerProfile.java index 9d4eb2afe..138e532e2 100644 --- a/src/test/java/io/github/thebusybiscuit/slimefun4/testing/tests/profiles/TestPlayerProfile.java +++ b/src/test/java/io/github/thebusybiscuit/slimefun4/testing/tests/profiles/TestPlayerProfile.java @@ -15,8 +15,8 @@ import be.seeseemelk.mockbukkit.ServerMock; import be.seeseemelk.mockbukkit.entity.OfflinePlayerMock; import io.github.thebusybiscuit.slimefun4.api.items.HashedArmorpiece; import io.github.thebusybiscuit.slimefun4.api.player.PlayerProfile; +import io.github.thebusybiscuit.slimefun4.implementation.SlimefunPlugin; import io.github.thebusybiscuit.slimefun4.testing.TestUtilities; -import me.mrCookieSlime.Slimefun.SlimefunPlugin; public class TestPlayerProfile { diff --git a/src/test/java/io/github/thebusybiscuit/slimefun4/testing/tests/researches/TestProfileResearches.java b/src/test/java/io/github/thebusybiscuit/slimefun4/testing/tests/researches/TestProfileResearches.java index b616b90f3..adee1b32a 100644 --- a/src/test/java/io/github/thebusybiscuit/slimefun4/testing/tests/researches/TestProfileResearches.java +++ b/src/test/java/io/github/thebusybiscuit/slimefun4/testing/tests/researches/TestProfileResearches.java @@ -13,8 +13,8 @@ import be.seeseemelk.mockbukkit.MockBukkit; import be.seeseemelk.mockbukkit.ServerMock; import io.github.thebusybiscuit.slimefun4.api.player.PlayerProfile; import io.github.thebusybiscuit.slimefun4.core.researching.Research; +import io.github.thebusybiscuit.slimefun4.implementation.SlimefunPlugin; import io.github.thebusybiscuit.slimefun4.testing.TestUtilities; -import me.mrCookieSlime.Slimefun.SlimefunPlugin; public class TestProfileResearches { diff --git a/src/test/java/io/github/thebusybiscuit/slimefun4/testing/tests/researches/TestResearchSetup.java b/src/test/java/io/github/thebusybiscuit/slimefun4/testing/tests/researches/TestResearchSetup.java index 1b7d67d7d..a9c92d8ab 100644 --- a/src/test/java/io/github/thebusybiscuit/slimefun4/testing/tests/researches/TestResearchSetup.java +++ b/src/test/java/io/github/thebusybiscuit/slimefun4/testing/tests/researches/TestResearchSetup.java @@ -17,8 +17,8 @@ import org.junit.jupiter.api.MethodOrderer.OrderAnnotation; import be.seeseemelk.mockbukkit.MockBukkit; import io.github.thebusybiscuit.slimefun4.core.researching.Research; +import io.github.thebusybiscuit.slimefun4.implementation.SlimefunPlugin; import io.github.thebusybiscuit.slimefun4.implementation.setup.ResearchSetup; -import me.mrCookieSlime.Slimefun.SlimefunPlugin; @TestMethodOrder(value = OrderAnnotation.class) public class TestResearchSetup { diff --git a/src/test/java/io/github/thebusybiscuit/slimefun4/testing/tests/researches/TestResearchUnlocking.java b/src/test/java/io/github/thebusybiscuit/slimefun4/testing/tests/researches/TestResearchUnlocking.java index 5ee3caa6d..221bac9f8 100644 --- a/src/test/java/io/github/thebusybiscuit/slimefun4/testing/tests/researches/TestResearchUnlocking.java +++ b/src/test/java/io/github/thebusybiscuit/slimefun4/testing/tests/researches/TestResearchUnlocking.java @@ -18,7 +18,7 @@ import be.seeseemelk.mockbukkit.ServerMock; import io.github.thebusybiscuit.slimefun4.api.events.ResearchUnlockEvent; import io.github.thebusybiscuit.slimefun4.api.player.PlayerProfile; import io.github.thebusybiscuit.slimefun4.core.researching.Research; -import me.mrCookieSlime.Slimefun.SlimefunPlugin; +import io.github.thebusybiscuit.slimefun4.implementation.SlimefunPlugin; public class TestResearchUnlocking { diff --git a/src/test/java/io/github/thebusybiscuit/slimefun4/testing/tests/researches/TestResearches.java b/src/test/java/io/github/thebusybiscuit/slimefun4/testing/tests/researches/TestResearches.java index 1d687022b..6079d67a5 100644 --- a/src/test/java/io/github/thebusybiscuit/slimefun4/testing/tests/researches/TestResearches.java +++ b/src/test/java/io/github/thebusybiscuit/slimefun4/testing/tests/researches/TestResearches.java @@ -15,8 +15,8 @@ import be.seeseemelk.mockbukkit.MockBukkit; import be.seeseemelk.mockbukkit.ServerMock; import io.github.thebusybiscuit.cscorelib2.item.CustomItem; import io.github.thebusybiscuit.slimefun4.core.researching.Research; +import io.github.thebusybiscuit.slimefun4.implementation.SlimefunPlugin; import io.github.thebusybiscuit.slimefun4.testing.TestUtilities; -import me.mrCookieSlime.Slimefun.SlimefunPlugin; import me.mrCookieSlime.Slimefun.Objects.SlimefunItem.SlimefunItem; public class TestResearches { diff --git a/src/test/java/io/github/thebusybiscuit/slimefun4/testing/tests/services/TestBlockDataService.java b/src/test/java/io/github/thebusybiscuit/slimefun4/testing/tests/services/TestBlockDataService.java index c098c402f..cad9afeff 100644 --- a/src/test/java/io/github/thebusybiscuit/slimefun4/testing/tests/services/TestBlockDataService.java +++ b/src/test/java/io/github/thebusybiscuit/slimefun4/testing/tests/services/TestBlockDataService.java @@ -9,7 +9,7 @@ import org.junit.jupiter.api.Test; import be.seeseemelk.mockbukkit.MockBukkit; import io.github.thebusybiscuit.slimefun4.core.services.BlockDataService; -import me.mrCookieSlime.Slimefun.SlimefunPlugin; +import io.github.thebusybiscuit.slimefun4.implementation.SlimefunPlugin; public class TestBlockDataService { diff --git a/src/test/java/io/github/thebusybiscuit/slimefun4/testing/tests/services/TestItemDataService.java b/src/test/java/io/github/thebusybiscuit/slimefun4/testing/tests/services/TestItemDataService.java index 2ecaa68b4..544deba6f 100644 --- a/src/test/java/io/github/thebusybiscuit/slimefun4/testing/tests/services/TestItemDataService.java +++ b/src/test/java/io/github/thebusybiscuit/slimefun4/testing/tests/services/TestItemDataService.java @@ -13,7 +13,7 @@ import org.junit.jupiter.api.Test; import be.seeseemelk.mockbukkit.MockBukkit; import io.github.thebusybiscuit.slimefun4.core.services.CustomItemDataService; -import me.mrCookieSlime.Slimefun.SlimefunPlugin; +import io.github.thebusybiscuit.slimefun4.implementation.SlimefunPlugin; public class TestItemDataService { diff --git a/src/test/java/io/github/thebusybiscuit/slimefun4/testing/tests/services/TestPermissionsService.java b/src/test/java/io/github/thebusybiscuit/slimefun4/testing/tests/services/TestPermissionsService.java index ea6760d71..4bb0c3a64 100644 --- a/src/test/java/io/github/thebusybiscuit/slimefun4/testing/tests/services/TestPermissionsService.java +++ b/src/test/java/io/github/thebusybiscuit/slimefun4/testing/tests/services/TestPermissionsService.java @@ -14,8 +14,8 @@ import be.seeseemelk.mockbukkit.MockBukkit; import be.seeseemelk.mockbukkit.ServerMock; import io.github.thebusybiscuit.cscorelib2.item.CustomItem; import io.github.thebusybiscuit.slimefun4.core.services.PermissionsService; +import io.github.thebusybiscuit.slimefun4.implementation.SlimefunPlugin; import io.github.thebusybiscuit.slimefun4.testing.TestUtilities; -import me.mrCookieSlime.Slimefun.SlimefunPlugin; import me.mrCookieSlime.Slimefun.Objects.SlimefunItem.SlimefunItem; public class TestPermissionsService { diff --git a/src/test/java/io/github/thebusybiscuit/slimefun4/testing/tests/services/TestRecipeService.java b/src/test/java/io/github/thebusybiscuit/slimefun4/testing/tests/services/TestRecipeService.java index 666cbbbe1..1ec2cc558 100644 --- a/src/test/java/io/github/thebusybiscuit/slimefun4/testing/tests/services/TestRecipeService.java +++ b/src/test/java/io/github/thebusybiscuit/slimefun4/testing/tests/services/TestRecipeService.java @@ -21,7 +21,7 @@ import be.seeseemelk.mockbukkit.MockBukkit; import be.seeseemelk.mockbukkit.ServerMock; import io.github.thebusybiscuit.cscorelib2.recipes.RecipeSnapshot; import io.github.thebusybiscuit.slimefun4.core.services.MinecraftRecipeService; -import me.mrCookieSlime.Slimefun.SlimefunPlugin; +import io.github.thebusybiscuit.slimefun4.implementation.SlimefunPlugin; public class TestRecipeService { diff --git a/src/test/java/io/github/thebusybiscuit/slimefun4/testing/tests/services/TestUpdaterService.java b/src/test/java/io/github/thebusybiscuit/slimefun4/testing/tests/services/TestUpdaterService.java index 9144aae83..19f0eedb6 100644 --- a/src/test/java/io/github/thebusybiscuit/slimefun4/testing/tests/services/TestUpdaterService.java +++ b/src/test/java/io/github/thebusybiscuit/slimefun4/testing/tests/services/TestUpdaterService.java @@ -10,7 +10,7 @@ import org.junit.jupiter.api.Test; import be.seeseemelk.mockbukkit.MockBukkit; import io.github.thebusybiscuit.slimefun4.api.SlimefunBranch; import io.github.thebusybiscuit.slimefun4.core.services.UpdaterService; -import me.mrCookieSlime.Slimefun.SlimefunPlugin; +import io.github.thebusybiscuit.slimefun4.implementation.SlimefunPlugin; public class TestUpdaterService { diff --git a/src/test/java/io/github/thebusybiscuit/slimefun4/testing/tests/services/TextCustomTextureService.java b/src/test/java/io/github/thebusybiscuit/slimefun4/testing/tests/services/TextCustomTextureService.java index efc54f60c..16daca7d5 100644 --- a/src/test/java/io/github/thebusybiscuit/slimefun4/testing/tests/services/TextCustomTextureService.java +++ b/src/test/java/io/github/thebusybiscuit/slimefun4/testing/tests/services/TextCustomTextureService.java @@ -12,8 +12,8 @@ import org.junit.jupiter.api.Test; import be.seeseemelk.mockbukkit.MockBukkit; import io.github.thebusybiscuit.cscorelib2.config.Config; import io.github.thebusybiscuit.slimefun4.core.services.CustomTextureService; +import io.github.thebusybiscuit.slimefun4.implementation.SlimefunPlugin; import io.github.thebusybiscuit.slimefun4.testing.TestUtilities; -import me.mrCookieSlime.Slimefun.SlimefunPlugin; import me.mrCookieSlime.Slimefun.Objects.SlimefunItem.SlimefunItem; public class TextCustomTextureService { diff --git a/src/test/java/io/github/thebusybiscuit/slimefun4/testing/tests/utils/TestItemStackWrapper.java b/src/test/java/io/github/thebusybiscuit/slimefun4/testing/tests/utils/TestItemStackWrapper.java index 0960a952f..0e85707a8 100644 --- a/src/test/java/io/github/thebusybiscuit/slimefun4/testing/tests/utils/TestItemStackWrapper.java +++ b/src/test/java/io/github/thebusybiscuit/slimefun4/testing/tests/utils/TestItemStackWrapper.java @@ -9,9 +9,9 @@ import org.junit.jupiter.api.Test; import be.seeseemelk.mockbukkit.MockBukkit; import io.github.thebusybiscuit.cscorelib2.item.CustomItem; +import io.github.thebusybiscuit.slimefun4.implementation.SlimefunPlugin; import io.github.thebusybiscuit.slimefun4.utils.SlimefunUtils; import io.github.thebusybiscuit.slimefun4.utils.itemstack.ItemStackWrapper; -import me.mrCookieSlime.Slimefun.SlimefunPlugin; public class TestItemStackWrapper { diff --git a/src/test/java/io/github/thebusybiscuit/slimefun4/testing/tests/utils/TestSoulboundItem.java b/src/test/java/io/github/thebusybiscuit/slimefun4/testing/tests/utils/TestSoulboundItem.java index 09683c4db..55316f6c4 100644 --- a/src/test/java/io/github/thebusybiscuit/slimefun4/testing/tests/utils/TestSoulboundItem.java +++ b/src/test/java/io/github/thebusybiscuit/slimefun4/testing/tests/utils/TestSoulboundItem.java @@ -11,8 +11,8 @@ import org.junit.jupiter.api.Test; import be.seeseemelk.mockbukkit.MockBukkit; import io.github.thebusybiscuit.cscorelib2.item.CustomItem; import io.github.thebusybiscuit.slimefun4.core.attributes.Soulbound; +import io.github.thebusybiscuit.slimefun4.implementation.SlimefunPlugin; import io.github.thebusybiscuit.slimefun4.utils.SlimefunUtils; -import me.mrCookieSlime.Slimefun.SlimefunPlugin; import me.mrCookieSlime.Slimefun.Lists.RecipeType; import me.mrCookieSlime.Slimefun.Objects.Category; import me.mrCookieSlime.Slimefun.Objects.SlimefunItem.SlimefunItem; From 50aaa4b965ff93b0958cdaade218660186dde796 Mon Sep 17 00:00:00 2001 From: TheBusyBiscuit Date: Sat, 27 Jun 2020 14:04:31 +0200 Subject: [PATCH 21/24] Added a few more items to the Bio Generator --- CHANGELOG.md | 3 +++ README.md | 2 +- pom.xml | 12 +++++------ .../electric/generators/BioGenerator.java | 20 +++++++++++++++++++ 4 files changed, 30 insertions(+), 7 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 93026a309..c370baea7 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -31,8 +31,11 @@ * Added a new language: Tagalog * Added Magical Zombie Pills * Added 1.13 compatibility to the Auto Drier +* Added Corals to the fuel list for the Bio Generator * (1.16+) Slimefun guide can now show Smithing Table recipes * (1.16+) Added Nether Gold Ore recipe to the Ore Crusher +* (1.16+) Added Shroomlights to the fuel list for the Bio Generator +* (1.16+) Added Warped and Crimson Fungus to the fuel list for the Bio Generator #### Changes * Coolant Cells now last twice as long diff --git a/README.md b/README.md index 4cace9dcc..32fc24d49 100644 --- a/README.md +++ b/README.md @@ -1,7 +1,7 @@ # Slimefun 4 Looking for the download link? [**Click here**](https://github.com/TheBusyBiscuit/Slimefun4/blob/master/README.md#download-slimefun-4) -Slimefun is a plugin which aims to turn your Bukkit/Spigot Server into a modpack without ever installing a single mod. It offers everything you could possibly imagine. From Backpacks to Jetpacks! Slimefun lets every player decide on their own how much they want to dive into Magic or Tech.
+Slimefun is a plugin which aims to turn your Spigot Server into a modpack without ever installing a single mod. It offers everything you could possibly imagine. From Backpacks to Jetpacks! Slimefun lets every player decide on their own how much they want to dive into Magic or Tech.
We got everything from magical wands to nuclear reactors.
We feature a magical altar, an electric power grid and even item transport systems. diff --git a/pom.xml b/pom.xml index ecdc0c245..128eb224b 100644 --- a/pom.xml +++ b/pom.xml @@ -13,7 +13,7 @@ 2013 jar - Slimefun is a Bukkit / Spigot plugin that simulates a modpack-like atmosphere by adding over 500 new items and recipes to your Minecraft Server. + Slimefun is a Spigot plugin that simulates a modpack-like atmosphere by adding over 500 new items and recipes to your Minecraft Server. https://github.com/TheBusyBiscuit/Slimefun4 @@ -21,9 +21,9 @@ 1.8 1.8 - - 1.16.1 - https://hub.spigotmc.org/javadocs/bukkit/ + + 1.16.1 + https://hub.spigotmc.org/javadocs/spigot/ TheBusyBiscuit_Slimefun4 @@ -209,7 +209,7 @@ - ${bukkit.javadocs} + ${spigot.javadocs} @@ -272,7 +272,7 @@ org.spigotmc spigot-api - ${bukkit.version}-R0.1-SNAPSHOT + ${spigot.version}-R0.1-SNAPSHOT provided diff --git a/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/items/electric/generators/BioGenerator.java b/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/items/electric/generators/BioGenerator.java index 9582f390f..563a3fd71 100644 --- a/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/items/electric/generators/BioGenerator.java +++ b/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/items/electric/generators/BioGenerator.java @@ -58,6 +58,17 @@ public abstract class BioGenerator extends AGenerator { } } + if (SlimefunPlugin.getMinecraftVersion().isAtLeast(MinecraftVersion.MINECRAFT_1_15)) { + registerFuel(new MachineFuel(4, new ItemStack(Material.HONEYCOMB))); + registerFuel(new MachineFuel(40, new ItemStack(Material.HONEYCOMB_BLOCK))); + } + + if (SlimefunPlugin.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))); + } + // Leaves for (Material m : Tag.LEAVES.getValues()) { registerFuel(new MachineFuel(1, new ItemStack(m))); @@ -67,6 +78,15 @@ public abstract class BioGenerator extends AGenerator { for (Material m : Tag.SAPLINGS.getValues()) { registerFuel(new MachineFuel(1, new ItemStack(m))); } + + // Corals + for (Material m : Tag.CORALS.getValues()) { + registerFuel(new MachineFuel(2, new ItemStack(m))); + } + + for (Material m : Tag.CORAL_BLOCKS.getValues()) { + registerFuel(new MachineFuel(2, new ItemStack(m))); + } } @Override From 4314581a61e73d036d441b21fbda8c880d0ea816 Mon Sep 17 00:00:00 2001 From: TheBusyBiscuit Date: Sat, 27 Jun 2020 14:22:45 +0200 Subject: [PATCH 22/24] Another fix and an addition --- CHANGELOG.md | 2 ++ .../slimefun4/core/services/github/GitHubService.java | 8 +++++--- .../items/electric/machines/ElectricPress.java | 1 + 3 files changed, 8 insertions(+), 3 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index c370baea7..e826c9b1a 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -32,6 +32,7 @@ * Added Magical Zombie Pills * Added 1.13 compatibility to the Auto Drier * Added Corals to the fuel list for the Bio Generator +* Added Clay -> Clay blocks recipe to the Electric Press * (1.16+) Slimefun guide can now show Smithing Table recipes * (1.16+) Added Nether Gold Ore recipe to the Ore Crusher * (1.16+) Added Shroomlights to the fuel list for the Bio Generator @@ -61,6 +62,7 @@ * Fixed some issues with AsyncWorldEdit * Fixed some problems with unregistered or fake worlds * Fixed a rare concurrency issue with world saving +* Fixed some contributors showing up twice ## Release Candidate 13 (16 Jun 2020) https://thebusybiscuit.github.io/builds/TheBusyBiscuit/Slimefun4/stable/#13 diff --git a/src/main/java/io/github/thebusybiscuit/slimefun4/core/services/github/GitHubService.java b/src/main/java/io/github/thebusybiscuit/slimefun4/core/services/github/GitHubService.java index f4ab531dd..72a48028e 100644 --- a/src/main/java/io/github/thebusybiscuit/slimefun4/core/services/github/GitHubService.java +++ b/src/main/java/io/github/thebusybiscuit/slimefun4/core/services/github/GitHubService.java @@ -73,10 +73,12 @@ public class GitHubService { contributors.put(name, contributor); } - public Contributor addContributor(String name, String profile, String role, int commits) { - Contributor contributor = contributors.computeIfAbsent(name, key -> new Contributor(name, profile)); + public Contributor addContributor(String minecraftName, String profile, String role, int commits) { + String username = profile.substring(profile.lastIndexOf('/') + 1); + + Contributor contributor = contributors.computeIfAbsent(username, key -> new Contributor(minecraftName, profile)); contributor.setContribution(role, commits); - contributor.setUniqueId(uuidCache.getUUID(name)); + contributor.setUniqueId(uuidCache.getUUID(minecraftName)); return contributor; } diff --git a/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/items/electric/machines/ElectricPress.java b/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/items/electric/machines/ElectricPress.java index 09e81095d..94a1c3858 100644 --- a/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/items/electric/machines/ElectricPress.java +++ b/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/items/electric/machines/ElectricPress.java @@ -27,6 +27,7 @@ public abstract class ElectricPress extends AContainer implements RecipeDisplayI addRecipe(3, new ItemStack(Material.DRIED_KELP, 9), new ItemStack(Material.DRIED_KELP_BLOCK)); addRecipe(3, new ItemStack(Material.BONE_MEAL, 9), new ItemStack(Material.BONE_BLOCK)); + addRecipe(3, new ItemStack(Material.CLAY_BALL, 4), new ItemStack(Material.CLAY)); addRecipe(6, SlimefunItems.COPPER_INGOT, new CustomItem(SlimefunItems.COPPER_WIRE, 3)); addRecipe(16, new CustomItem(SlimefunItems.STEEL_INGOT, 8), SlimefunItems.STEEL_PLATE); From 492010a8d4e8ed21ad24ff09f27ff60d127632a8 Mon Sep 17 00:00:00 2001 From: TheBusyBiscuit Date: Sat, 27 Jun 2020 14:32:13 +0200 Subject: [PATCH 23/24] Adjusted Unit Test to include new item tags --- .../github/thebusybiscuit/slimefun4/testing/TestUtilities.java | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/test/java/io/github/thebusybiscuit/slimefun4/testing/TestUtilities.java b/src/test/java/io/github/thebusybiscuit/slimefun4/testing/TestUtilities.java index d103bb174..a89cc513e 100644 --- a/src/test/java/io/github/thebusybiscuit/slimefun4/testing/TestUtilities.java +++ b/src/test/java/io/github/thebusybiscuit/slimefun4/testing/TestUtilities.java @@ -81,6 +81,8 @@ public final class TestUtilities { server.createMaterialTag(NamespacedKey.minecraft("small_flowers"), Material.POPPY, Material.DANDELION, Material.AZURE_BLUET, Material.LILY_OF_THE_VALLEY); server.createMaterialTag(NamespacedKey.minecraft("leaves"), Material.OAK_LEAVES, Material.BIRCH_LEAVES, Material.SPRUCE_LEAVES, Material.JUNGLE_LEAVES, Material.ACACIA_LEAVES, Material.DARK_OAK_LEAVES); server.createMaterialTag(NamespacedKey.minecraft("saplings"), Material.OAK_SAPLING, Material.BIRCH_SAPLING, Material.SPRUCE_SAPLING, Material.JUNGLE_SAPLING, Material.ACACIA_SAPLING, Material.DARK_OAK_SAPLING); + server.createMaterialTag(NamespacedKey.minecraft("coral_blocks"), Material.BRAIN_CORAL_BLOCK, Material.BUBBLE_CORAL_BLOCK, Material.FIRE_CORAL_BLOCK, Material.HORN_CORAL_BLOCK, Material.TUBE_CORAL_BLOCK); + server.createMaterialTag(NamespacedKey.minecraft("corals"), Material.BRAIN_CORAL, Material.BUBBLE_CORAL, Material.FIRE_CORAL, Material.HORN_CORAL, Material.TUBE_CORAL); } } From 03c08ed6f17cc9260067205c172e1184d98162ae Mon Sep 17 00:00:00 2001 From: TheBusyBiscuit Date: Sun, 28 Jun 2020 11:20:56 +0200 Subject: [PATCH 24/24] Fixes #2062 --- CHANGELOG.md | 1 + .../slimefun4/core/attributes/Rechargeable.java | 5 +++++ .../implementation/items/electric/gadgets/MultiTool.java | 2 +- .../slimefun4/testing/tests/items/TestRechargeableItems.java | 3 +++ 4 files changed, 10 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index e826c9b1a..6ce3e5f7c 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -63,6 +63,7 @@ * Fixed some problems with unregistered or fake worlds * Fixed a rare concurrency issue with world saving * Fixed some contributors showing up twice +* Fixed #2062 ## Release Candidate 13 (16 Jun 2020) https://thebusybiscuit.github.io/builds/TheBusyBiscuit/Slimefun4/stable/#13 diff --git a/src/main/java/io/github/thebusybiscuit/slimefun4/core/attributes/Rechargeable.java b/src/main/java/io/github/thebusybiscuit/slimefun4/core/attributes/Rechargeable.java index ef3ddea37..39f53d797 100644 --- a/src/main/java/io/github/thebusybiscuit/slimefun4/core/attributes/Rechargeable.java +++ b/src/main/java/io/github/thebusybiscuit/slimefun4/core/attributes/Rechargeable.java @@ -1,5 +1,6 @@ package io.github.thebusybiscuit.slimefun4.core.attributes; +import org.apache.commons.lang.Validate; import org.bukkit.Material; import org.bukkit.inventory.ItemStack; import org.bukkit.inventory.meta.ItemMeta; @@ -90,6 +91,8 @@ public interface Rechargeable extends ItemAttribute { * @return Whether the given charge could be added successfully */ default boolean addItemCharge(ItemStack item, float charge) { + Validate.isTrue(charge > 0, "Charge must be above zero!"); + if (item == null || item.getType() == Material.AIR) { throw new IllegalArgumentException("Cannot add Item charge for null or AIR"); } @@ -123,6 +126,8 @@ public interface Rechargeable extends ItemAttribute { * @return Whether the given charge could be removed successfully */ default boolean removeItemCharge(ItemStack item, float charge) { + Validate.isTrue(charge > 0, "Charge must be above zero!"); + if (item == null || item.getType() == Material.AIR) { throw new IllegalArgumentException("Cannot remove Item charge for null or AIR"); } diff --git a/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/items/electric/gadgets/MultiTool.java b/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/items/electric/gadgets/MultiTool.java index 0171cdc7e..bc151084c 100644 --- a/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/items/electric/gadgets/MultiTool.java +++ b/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/items/electric/gadgets/MultiTool.java @@ -51,7 +51,7 @@ public class MultiTool extends SlimefunItem implements Rechargeable { int index = selectedMode.getOrDefault(p.getUniqueId(), 0); if (!p.isSneaking()) { - if (removeItemCharge(item, -COST)) { + if (removeItemCharge(item, COST)) { SlimefunItem sfItem = modes.get(index).getItem(); if (sfItem != null) { diff --git a/src/test/java/io/github/thebusybiscuit/slimefun4/testing/tests/items/TestRechargeableItems.java b/src/test/java/io/github/thebusybiscuit/slimefun4/testing/tests/items/TestRechargeableItems.java index 337cda7cd..cc417f06d 100644 --- a/src/test/java/io/github/thebusybiscuit/slimefun4/testing/tests/items/TestRechargeableItems.java +++ b/src/test/java/io/github/thebusybiscuit/slimefun4/testing/tests/items/TestRechargeableItems.java @@ -74,6 +74,9 @@ public class TestRechargeableItems { Assertions.assertThrows(IllegalArgumentException.class, () -> rechargeable.setItemCharge(item, -0.01F)); Assertions.assertThrows(IllegalArgumentException.class, () -> rechargeable.setItemCharge(item, 10.01F)); Assertions.assertThrows(IllegalArgumentException.class, () -> rechargeable.setItemCharge(item, 11)); + + Assertions.assertThrows(IllegalArgumentException.class, () -> rechargeable.addItemCharge(item, -0.1F)); + Assertions.assertThrows(IllegalArgumentException.class, () -> rechargeable.removeItemCharge(item, -0.1F)); } @Test