diff --git a/CHANGELOG.md b/CHANGELOG.md index ce0d2d742..8c0b1a187 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,7 +2,8 @@ **Table of contents** -- [Release Candidate 14 (TBD)](#release-candidate-14-tbd) +- [Release Candidate 15 (TBD)](#release-candidate-15-tbd) +- [Release Candidate 14 (12 Jul 2020)](#release-candidate-14-12-jul-2020) - [Release Candidate 13 (16 Jun 2020)](#release-candidate-13-16-jun-2020) - [Release Candidate 12 (27 May 2020)](#release-candidate-12-27-may-2020) - [Release Candidate 11 (25 Apr 2020)](#release-candidate-11-25-apr-2020) @@ -19,9 +20,25 @@ -## Release Candidate 14 (TBD) +## Release Candidate 15 (TBD) #### Additions +* Added Reinforced Cloth +* Added Bee protection to Hazmat Suit +* Added Enchantment Rune +* Added Tape Measure + +#### Changes +* Changed recipe of Hazmat Suits +* Uranium can no longer be placed down + +#### Fixes +* Fixed Slimefun Armor sometimes not applying its effects + +## Release Candidate 14 (12 Jul 2020) + +#### Additions +* Added support for Minecraft 1.16 * Added a starting sound for the Ancient Altar * Added config option to disable backwards compatibility and improve performance * Added ReactorExplodeEvent to the API @@ -29,18 +46,42 @@ * Added Nether Quartz Ore Crusher Recipe * 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 +* 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 Gilded Blackstone 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 +* Added an AoE damage effect to the Explosive Bow +* Added runtime deprecation warnings for ItemHandlers and Attributes used by Addons +* Added a proper lag profiler +* Added per-plugin lag info to /sf timings +* Added Indonesian translations #### Changes * Coolant Cells now last twice as long * Ticking blocks will now catch more errors caused by addons -* Massive performance improvements to GPS/GEO machines, especially Oil Pump and GEO Miner * Changed the texture for the Nuclear Reactor * Changed the texture for the Nether Star Reactor -* Performance improvements to Rainbow Blocks * Crafting Tin cans now produces 8 items instead of 4 * Multi Tool lore now says "Crouch" instead of "Hold Shift" -* 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 +* Items which cannot be distributed by a Cargo Net will be dropped on the ground now instead of getting deleted +* Slimefun no longer supports CraftBukkit +* Item Energy is now also stored persistently via NBT +* Performance improvements to GPS/GEO machines, especially Oil Pump and GEO Miner +* Performance improvements for ticking blocks +* Performance improvements to the Cargo Net +* performance improvements to the Energy Net +* Performance improvements to Rainbow Blocks +* Performance improvements to Androids +* performance improvements to Generators and Electric Machines +* Cargo timings will now be attributed to the corresponding node and not the Cargo manager +* Thunderstorms now count as night time for Solar Generators +* Coolant Cells can no longer be placed on the ground +* Crafting Nether Ice Coolant Cells now results in 4 items +* Moved Soulbound Backpack to the "Magical Gadgets" Category #### Fixes * Fixed #2005 @@ -49,6 +90,28 @@ * Fixed Infused Magnet working even if you haven't researched it * Fixed Rainbow blocks duplication glitch when timing the block break right * Fixed #1855 +* 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 +* Fixed #2062 +* Fixed Grappling hooks disappearing when fired at Item frames or paintaings +* Fixed Grappling hooks not getting removed when the Player leaves +* Fixed Grappling hooks making Bat sounds +* Fixed #1959 +* Fixed Melon Juice requiring Melons instead of Melon Slices +* Fixed Cargo networks not showing up in /sf timings +* Fixed /sf timings reporting slightly inaccurate timings +* Fixed concurrency-related issues with the profiling +* Fixed #2066 +* Fixed Rainbow Glass Panes not properly connecting to blocks +* Fixed Androids turning in the wrong direction +* Fixed contributors losing their texture after restarts +* Fixed "korean" showing up as "null" +* Fixed an issue with moving androids getting stuck +* Fixed Cargo nodes sometimes preventing chunks from unloading +* Fixed #2081 +* Fixed a NullPointerException when Generators throw an Error Report ## Release Candidate 13 (16 Jun 2020) https://thebusybiscuit.github.io/builds/TheBusyBiscuit/Slimefun4/stable/#13 diff --git a/README.md b/README.md index ac6b86ae8..b7ffc8315 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. @@ -22,13 +22,15 @@ Check out our [Addons](https://github.com/TheBusyBiscuit/Slimefun4/wiki/Addons), ## Download Slimefun 4 (See also: [How to install Slimefun](https://github.com/TheBusyBiscuit/Slimefun4/wiki/Installing-Slimefun)) +**Due to [Spigot's abandonce of the Bukkit API](https://www.spigotmc.org/threads/spigot-bungeecord-1-16-1.447405/#post-3852349), Slimefun is no longer able to work on CraftBukkit, please switch over to Spigot or Paper if you haven't already.** + Slimefun 4 can be downloaded **for free** on our builds page.
We currently provide two distinct versions of Slimefun, development builds and "stable" builds.
Here is a full summary of the differences between the two different versions of Slimefun. | | development (latest) | "stable" | | ------------------ | -------- | -------- | -| **Minecraft version(s)** | :video_game: 1.13.X - 1.15.X | :video_game: 1.13.X - 1.15.X | +| **Minecraft version(s)** | :video_game: **1.13.\* - 1.16.\*** | :video_game: **1.13.\* - 1.16.\*** | | **automatic updates** | :heavy_check_mark: | :heavy_check_mark: | | **frequent updates** | :heavy_check_mark: | :x: | | **latest content** | :heavy_check_mark: | :x: | @@ -101,6 +103,19 @@ So not everything may be available for translation yet.
This is an open-source community project, so **your contributions keep this plugin alive!**
Pull Requests can be fixes, changes or even additions, but please keep in mind that if you add too much content to Slimefun 4, you should maybe consider making an Addon for it instead ([Developer Guide](https://github.com/TheBusyBiscuit/Slimefun4/wiki/Developer-Guide)). +#### Compiling +Slimefun is written in Java and uses [Maven](https://maven.apache.org/) for compilation.
+To compile Slimefun yourself, follow these steps: + +1. Clone the project via git
+`$ git clone https://github.com/TheBusyBiscuit/Slimefun4/` +2. Compile the project using Maven
+`$ mvn clean package` + +If you are already using an IDE, make sure to import the project via git and set it as a *Maven project*. Then you should be able build it via Maven using the goals `clean package`. + +If you have any further questions, then please join our [Discord Support Server](#discord) and ask your questions in the `#programming-help` channel. Note that we will not accept any bug reports from custom-compiled versions of Slimefun. + ### Code Quality Slimefun uses [Sonarcloud.io](https://sonarcloud.io/dashboard?id=TheBusyBiscuit_Slimefun4) to monitor Code Quality. diff --git a/pom.xml b/pom.xml index a825e329d..460e4bfc6 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.15.2 - https://hub.spigotmc.org/javadocs/bukkit/ + + 1.16.1 + https://hub.spigotmc.org/javadocs/spigot/ TheBusyBiscuit_Slimefun4 @@ -60,7 +60,7 @@ https://repo.destroystokyo.com/repository/maven-public/ - worldedit-worldguard-repo + worldedit-repo https://maven.sk89q.com/repo/ @@ -209,7 +209,7 @@ - ${bukkit.javadocs} + ${spigot.javadocs} @@ -270,15 +270,15 @@ - org.bukkit - bukkit - ${bukkit.version}-R0.1-SNAPSHOT + org.spigotmc + spigot-api + ${spigot.version}-R0.1-SNAPSHOT provided com.github.TheBusyBiscuit CS-CoreLib - 4a7fce5202 + 31390302cf provided @@ -298,15 +298,15 @@ org.mockito mockito-core - 3.3.3 + 3.4.0 test - com.github.thebusybiscuit + com.github.TheBusyBiscuit CS-CoreLib2 - 0.21 + 0.23.2 compile @@ -350,4 +350,4 @@ provided - \ No newline at end of file + 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 a04bf3739..2bdcc717b 100644 --- a/src/main/java/io/github/thebusybiscuit/slimefun4/api/ErrorReport.java +++ b/src/main/java/io/github/thebusybiscuit/slimefun4/api/ErrorReport.java @@ -1,7 +1,6 @@ package io.github.thebusybiscuit.slimefun4.api; import java.io.File; -import java.io.IOException; import java.io.PrintStream; import java.nio.charset.StandardCharsets; import java.time.LocalDateTime; @@ -18,7 +17,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; @@ -82,7 +81,7 @@ public class ErrorReport { throwable.printStackTrace(stream); addon.getLogger().log(Level.WARNING, ""); - addon.getLogger().log(Level.WARNING, "An Error occured! It has been saved as: "); + addon.getLogger().log(Level.WARNING, "An Error occurred! It has been saved as: "); addon.getLogger().log(Level.WARNING, "/plugins/Slimefun/error-reports/{0}", file.getName()); addon.getLogger().log(Level.WARNING, "Please put this file on https://pastebin.com and report this to the developer(s)."); @@ -92,8 +91,8 @@ public class ErrorReport { addon.getLogger().log(Level.WARNING, ""); } - catch (IOException x) { - addon.getLogger().log(Level.SEVERE, x, () -> "An Error occured while saving an Error-Report for Slimefun " + SlimefunPlugin.getVersion()); + catch (Exception x) { + addon.getLogger().log(Level.SEVERE, x, () -> "An Error occurred while saving an Error-Report for Slimefun " + SlimefunPlugin.getVersion()); } }); } @@ -109,9 +108,19 @@ public class ErrorReport { stream.println(" Block Data: " + l.getBlock().getBlockData().getClass().getName()); stream.println(" State: " + l.getBlock().getState().getClass().getName()); stream.println(); - stream.println("Ticker-Info:"); - stream.println(" Type: " + (item.getBlockTicker().isSynchronized() ? "Synchronized" : "Asynchronous")); - stream.println(); + + if (item.getBlockTicker() != null) { + stream.println("Ticker-Info:"); + stream.println(" Type: " + (item.getBlockTicker().isSynchronized() ? "Synchronized" : "Asynchronous")); + stream.println(); + } + + if (item.getEnergyTicker() != null) { + stream.println("Ticker-Info:"); + stream.println(" Type: Indirect (Energy Network)"); + stream.println(); + } + stream.println("Slimefun Data:"); stream.println(" ID: " + item.getID()); stream.println(" Inventory: " + BlockStorage.getStorage(l.getWorld()).hasInventory(l)); 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 9dbe51b8d..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. @@ -32,6 +32,12 @@ public enum MinecraftVersion { */ MINECRAFT_1_15("1.15.x"), + /** + * This constant represents Minecraft (Java Edition) Version 1.16 + * (The "Nether Update") + */ + MINECRAFT_1_16("1.16.x"), + /** * This constant represents an exceptional state in which we were unable * to identify the Minecraft Version we are using 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/exceptions/IncompatibleItemHandlerException.java b/src/main/java/io/github/thebusybiscuit/slimefun4/api/exceptions/IncompatibleItemHandlerException.java index 0a9de09a0..ff4ccd753 100644 --- a/src/main/java/io/github/thebusybiscuit/slimefun4/api/exceptions/IncompatibleItemHandlerException.java +++ b/src/main/java/io/github/thebusybiscuit/slimefun4/api/exceptions/IncompatibleItemHandlerException.java @@ -2,8 +2,8 @@ package io.github.thebusybiscuit.slimefun4.api.exceptions; import org.bukkit.plugin.Plugin; +import io.github.thebusybiscuit.slimefun4.core.handlers.BlockUseHandler; import me.mrCookieSlime.Slimefun.Objects.SlimefunItem.SlimefunItem; -import me.mrCookieSlime.Slimefun.Objects.handlers.BlockUseHandler; import me.mrCookieSlime.Slimefun.Objects.handlers.ItemHandler; /** diff --git a/src/main/java/io/github/thebusybiscuit/slimefun4/api/exceptions/WrongItemStackException.java b/src/main/java/io/github/thebusybiscuit/slimefun4/api/exceptions/WrongItemStackException.java new file mode 100644 index 000000000..9b8c647ec --- /dev/null +++ b/src/main/java/io/github/thebusybiscuit/slimefun4/api/exceptions/WrongItemStackException.java @@ -0,0 +1,36 @@ +package io.github.thebusybiscuit.slimefun4.api.exceptions; + +import org.bukkit.inventory.ItemStack; + +import io.github.thebusybiscuit.slimefun4.core.attributes.DamageableItem; +import me.mrCookieSlime.Slimefun.Objects.SlimefunItem.SlimefunItem; +import me.mrCookieSlime.Slimefun.api.SlimefunItemStack; + +/** + * A {@link WrongItemStackException} is thrown when someone tries to alter an {@link ItemStack} + * but actually wanted to alter a different one. + * + * If for example a {@link DamageableItem} accidentally damages the original {@link SlimefunItem} + * instead of the held {@link ItemStack}, this will be thrown. + * + * @author TheBusyBiscuit + * + * @see SlimefunItemStack + * @see SlimefunItem + * + */ +public class WrongItemStackException extends RuntimeException { + + private static final long serialVersionUID = 9144658137363309071L; + + /** + * This constructs a new {@link WrongItemStackException} with the given error context. + * + * @param message + * An error message to display + */ + public WrongItemStackException(String message) { + super("You probably wanted alter a different ItemStack: " + message); + } + +} 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 5d638162f..511c8e418 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; @@ -54,7 +54,7 @@ public class GPSNetwork { private final Map> transmitters = new HashMap<>(); private final TeleportationManager teleportation = new TeleportationManager(); - private final ResourceManager resourceManager = new ResourceManager(SlimefunPlugin.instance); + private final ResourceManager resourceManager = new ResourceManager(SlimefunPlugin.instance()); /** * This method updates the status of a {@link GPSTransmitter}. @@ -123,24 +123,24 @@ 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); })); 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"))); + 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; @@ -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++; @@ -196,23 +196,23 @@ 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; }); 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"))); + 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; @@ -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); @@ -249,14 +249,14 @@ 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)); + 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 357ab8a7c..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") + ": &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.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&r&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/HashedArmorpiece.java b/src/main/java/io/github/thebusybiscuit/slimefun4/api/items/HashedArmorpiece.java index afb0cd4be..a848cadca 100644 --- a/src/main/java/io/github/thebusybiscuit/slimefun4/api/items/HashedArmorpiece.java +++ b/src/main/java/io/github/thebusybiscuit/slimefun4/api/items/HashedArmorpiece.java @@ -78,7 +78,7 @@ public final class HashedArmorpiece { */ public boolean hasDiverged(ItemStack stack) { if (stack == null || stack.getType() == Material.AIR) { - return hash == 0; + return hash != 0; } else { ItemStack copy = stack.clone(); 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/network/Network.java b/src/main/java/io/github/thebusybiscuit/slimefun4/api/network/Network.java index c4c21e496..495211b1d 100644 --- a/src/main/java/io/github/thebusybiscuit/slimefun4/api/network/Network.java +++ b/src/main/java/io/github/thebusybiscuit/slimefun4/api/network/Network.java @@ -8,6 +8,7 @@ import java.util.Set; import org.apache.commons.lang.Validate; import org.bukkit.Color; import org.bukkit.Location; +import org.bukkit.Material; import org.bukkit.Particle; import org.bukkit.Particle.DustOptions; @@ -26,6 +27,34 @@ import me.mrCookieSlime.Slimefun.api.Slimefun; */ public abstract class Network { + private final NetworkManager manager; + protected Location regulator; + private Queue nodeQueue = new ArrayDeque<>(); + + protected final Set connectedLocations = new HashSet<>(); + protected final Set regulatorNodes = new HashSet<>(); + protected final Set connectorNodes = new HashSet<>(); + protected final Set terminusNodes = new HashSet<>(); + + /** + * This constructs a new {@link Network} at the given {@link Location}. + * + * @param manager + * The {@link NetworkManager} instance + * @param regulator + * The {@link Location} marking the regulator of this {@link Network}. + */ + protected Network(NetworkManager manager, Location regulator) { + Validate.notNull(manager, "A NetworkManager must be provided"); + Validate.notNull(regulator, "No regulator was specified"); + + this.manager = manager; + this.regulator = regulator; + + connectedLocations.add(regulator); + nodeQueue.add(regulator.clone()); + } + /** * This method returns the range of the {@link Network}. * The range determines how far the {@link Network} will search for @@ -60,34 +89,6 @@ public abstract class Network { */ public abstract void onClassificationChange(Location l, NetworkComponent from, NetworkComponent to); - protected Location regulator; - private Queue nodeQueue = new ArrayDeque<>(); - - private final NetworkManager manager; - protected final Set connectedLocations = new HashSet<>(); - protected final Set regulatorNodes = new HashSet<>(); - protected final Set connectorNodes = new HashSet<>(); - protected final Set terminusNodes = new HashSet<>(); - - /** - * This constructs a new {@link Network} at the given {@link Location}. - * - * @param manager - * The {@link NetworkManager} instance - * @param regulator - * The {@link Location} marking the regulator of this {@link Network}. - */ - protected Network(NetworkManager manager, Location regulator) { - Validate.notNull(manager, "A NetworkManager must be provided"); - Validate.notNull(regulator, "No regulator was specified"); - - this.manager = manager; - this.regulator = regulator; - - connectedLocations.add(regulator); - nodeQueue.add(regulator.clone()); - } - /** * This returns the size of this {@link Network}. It is equivalent to the amount * of {@link Location Locations} connected to this {@link Network}. @@ -208,18 +209,26 @@ public abstract class Network { /** * This method runs the network visualizer which displays a {@link Particle} on - * every {@link Location} that this {@link Network} can connect to. + * every {@link Location} that this {@link Network} is connected to. */ public void display() { Slimefun.runSync(() -> { - DustOptions options = new DustOptions(Color.BLUE, 2F); + DustOptions options = new DustOptions(Color.BLUE, 3F); for (Location l : connectedLocations) { - l.getWorld().spawnParticle(Particle.REDSTONE, l.getX() + 0.5, l.getY() + 0.5, l.getZ() + 0.5, 1, 0, 0, 0, 1, options); + Material type = l.getBlock().getType(); + + if (type == Material.PLAYER_HEAD || type == Material.PLAYER_WALL_HEAD) { + l.getWorld().spawnParticle(Particle.REDSTONE, l.getX() + 0.5, l.getY() + 0.5, l.getZ() + 0.5, 1, 0, 0, 0, 1, options); + } } }); } + public Location getRegulator() { + return regulator; + } + public void tick() { discoverStep(); } 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..896cf84ae 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 @@ -19,6 +19,7 @@ import org.apache.commons.lang.Validate; import org.bukkit.Bukkit; import org.bukkit.ChatColor; import org.bukkit.Location; +import org.bukkit.NamespacedKey; import org.bukkit.OfflinePlayer; import org.bukkit.command.CommandSender; import org.bukkit.entity.Player; @@ -31,11 +32,14 @@ import io.github.thebusybiscuit.cscorelib2.chat.ChatColors; import io.github.thebusybiscuit.cscorelib2.config.Config; import io.github.thebusybiscuit.slimefun4.api.gps.Waypoint; import io.github.thebusybiscuit.slimefun4.api.items.HashedArmorpiece; +import io.github.thebusybiscuit.slimefun4.core.attributes.ProtectiveArmor; +import io.github.thebusybiscuit.slimefun4.core.attributes.ProtectionType; 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.implementation.items.armor.SlimefunArmorPiece; 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; /** @@ -47,6 +51,7 @@ import me.mrCookieSlime.Slimefun.api.Slimefun; * @see Research * @see Waypoint * @see PlayerBackpack + * @see HashedArmorpiece * */ public final class PlayerProfile { @@ -367,7 +372,7 @@ public final class PlayerProfile { return true; } - Bukkit.getScheduler().runTaskAsynchronously(SlimefunPlugin.instance, () -> { + Bukkit.getScheduler().runTaskAsynchronously(SlimefunPlugin.instance(), () -> { PlayerProfile pp = new PlayerProfile(p); SlimefunPlugin.getRegistry().getPlayerProfiles().put(uuid, pp); callback.accept(pp); @@ -388,7 +393,7 @@ public final class PlayerProfile { public static boolean request(OfflinePlayer p) { if (!SlimefunPlugin.getRegistry().getPlayerProfiles().containsKey(p.getUniqueId())) { // Should probably prevent multiple requests for the same profile in the future - Bukkit.getScheduler().runTaskAsynchronously(SlimefunPlugin.instance, () -> { + Bukkit.getScheduler().runTaskAsynchronously(SlimefunPlugin.instance(), () -> { PlayerProfile pp = new PlayerProfile(p); SlimefunPlugin.getRegistry().getPlayerProfiles().put(p.getUniqueId(), pp); }); @@ -448,6 +453,41 @@ public final class PlayerProfile { } } + public boolean hasFullProtectionAgainst(ProtectionType type) { + int armorCount = 0; + + NamespacedKey setId = null; + for (HashedArmorpiece armorpiece : armor) { + Optional armorPiece = armorpiece.getItem(); + + if (!armorPiece.isPresent()) { + return false; + } + + if (armorPiece.get() instanceof ProtectiveArmor) { + ProtectiveArmor protectedArmor = (ProtectiveArmor) armorPiece.get(); + + if (setId == null && protectedArmor.isFullSetRequired()) { + setId = protectedArmor.getArmorSetId(); + } + + for (ProtectionType protectionType : protectedArmor.getProtectionTypes()) { + if (protectionType == type) { + if (setId == null) { + return true; + } + else if (setId.equals(protectedArmor.getArmorSetId())) { + armorCount++; + } + } + } + + } + } + + return armorCount == 4; + } + @Override public int hashCode() { return uuid.hashCode(); 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..3093112fb 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; @@ -19,6 +18,7 @@ import org.bukkit.inventory.ItemStack; import io.github.thebusybiscuit.cscorelib2.collections.KeyMap; import io.github.thebusybiscuit.cscorelib2.config.Config; +import io.github.thebusybiscuit.slimefun4.api.MinecraftVersion; import io.github.thebusybiscuit.slimefun4.api.geo.GEOResource; import io.github.thebusybiscuit.slimefun4.api.player.PlayerProfile; import io.github.thebusybiscuit.slimefun4.core.attributes.WitherProof; @@ -26,6 +26,7 @@ import io.github.thebusybiscuit.slimefun4.core.guide.SlimefunGuideImplementation import io.github.thebusybiscuit.slimefun4.core.guide.SlimefunGuideLayout; import io.github.thebusybiscuit.slimefun4.core.multiblocks.MultiBlock; 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.CheatSheetSlimefunGuide; import io.github.thebusybiscuit.slimefun4.implementation.guide.ChestSlimefunGuide; @@ -76,8 +77,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); @@ -100,7 +101,7 @@ public class SlimefunRegistry { researchRanks.addAll(cfg.getStringList("research-ranks")); - backwardsCompatibility = cfg.getBoolean("options.backwards-compatibility"); + backwardsCompatibility = cfg.getBoolean("options.backwards-compatibility") || SlimefunPlugin.getMinecraftVersion().isBefore(MinecraftVersion.MINECRAFT_1_14); freeCreativeResearches = cfg.getBoolean("researches.free-in-creative-mode"); researchFireworks = cfg.getBoolean("researches.enable-fireworks"); } @@ -234,7 +235,7 @@ public class SlimefunRegistry { return universalInventories; } - public ConcurrentMap getPlayerProfiles() { + public Map getPlayerProfiles() { return profiles; } 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/ProtectionType.java b/src/main/java/io/github/thebusybiscuit/slimefun4/core/attributes/ProtectionType.java new file mode 100644 index 000000000..df48ca2eb --- /dev/null +++ b/src/main/java/io/github/thebusybiscuit/slimefun4/core/attributes/ProtectionType.java @@ -0,0 +1,26 @@ +package io.github.thebusybiscuit.slimefun4.core.attributes; + +import org.bukkit.entity.Bee; + +/** + * Represents the {@link ProtectionType} that a {@link ProtectiveArmor} + * prevents the damage from. + * + * @author Linox + * + * @see ProtectiveArmor + * + */ +public enum ProtectionType { + + /** + * This damage type represents damage inflicted by {@link Radioactive} materials. + */ + RADIATION, + + /** + * This damage type represents damage caused by a {@link Bee} + */ + BEES; + +} diff --git a/src/main/java/io/github/thebusybiscuit/slimefun4/core/attributes/ProtectiveArmor.java b/src/main/java/io/github/thebusybiscuit/slimefun4/core/attributes/ProtectiveArmor.java new file mode 100644 index 000000000..8726ad7d0 --- /dev/null +++ b/src/main/java/io/github/thebusybiscuit/slimefun4/core/attributes/ProtectiveArmor.java @@ -0,0 +1,48 @@ +package io.github.thebusybiscuit.slimefun4.core.attributes; + +import org.bukkit.NamespacedKey; +import org.bukkit.entity.Player; + +import io.github.thebusybiscuit.slimefun4.implementation.items.armor.HazmatArmorPiece; +import io.github.thebusybiscuit.slimefun4.implementation.items.armor.SlimefunArmorPiece; + +/** + * Implement this interface to a {@link SlimefunArmorPiece} to protect + * the {@link Player} who wears that {@link SlimefunArmorPiece} from + * {@link ProtectionType} damage. + * + * Important: You need to specify which {@link ProtectionType} damages + * to protect the {@link Player} from. + * + * @author Linox + * + * @see SlimefunArmorPiece + * @see HazmatArmorPiece + * @see ItemAttribute + * + */ +public interface ProtectiveArmor extends ItemAttribute { + + /** + * This returns which {@link ProtectionType} damages this {@link ItemAttribute} + * will protect the {@link Player} from. + * + * @return The {@link ProtectionType}s. + */ + ProtectionType[] getProtectionTypes(); + + /** + * This returns whether the full set is required for {@link Player}'s protection on + * assigned {@link ProtectionType} damages. + * + * @return Whether or not he full set is required. + */ + boolean isFullSetRequired(); + + /** + * This returns the armor set {@link NamespacedKey} of this {@link SlimefunArmorPiece}. + * + * @return The set {@link NamespacedKey}, null if none is found. + */ + NamespacedKey getArmorSetId(); +} diff --git a/src/main/java/io/github/thebusybiscuit/slimefun4/core/attributes/RandomMobDrop.java b/src/main/java/io/github/thebusybiscuit/slimefun4/core/attributes/RandomMobDrop.java new file mode 100644 index 000000000..a873b8620 --- /dev/null +++ b/src/main/java/io/github/thebusybiscuit/slimefun4/core/attributes/RandomMobDrop.java @@ -0,0 +1,35 @@ +package io.github.thebusybiscuit.slimefun4.core.attributes; + +import org.bukkit.entity.EntityType; +import org.bukkit.entity.Player; +import org.bukkit.event.entity.EntityDeathEvent; + +import io.github.thebusybiscuit.slimefun4.implementation.items.misc.BasicCircuitBoard; +import io.github.thebusybiscuit.slimefun4.implementation.listeners.MobDropListener; +import me.mrCookieSlime.Slimefun.Lists.RecipeType; +import me.mrCookieSlime.Slimefun.Objects.SlimefunItem.SlimefunItem; + +/** + * This interface, when attached to a {@link SlimefunItem}, provides an easy method for adding + * a % chance to drop for an {@link SlimefunItem} on {@link EntityDeathEvent}, this chance is 0-100 + * and used in conjunction with the MOB_DROP {@link RecipeType}. + * + * @author dNiym + * + * @see BasicCircuitBoard + * @see MobDropListener + * + */ +@FunctionalInterface +public interface RandomMobDrop extends ItemAttribute { + + /** + * Implement this method to make the object have a variable chance of being + * added to the dropList when {@link EntityType} (specified in the recipe) + * is killed by the {@link Player} + * + * @return The integer chance (0-100%) {@link SlimefunItem} has to drop. + */ + int getMobDropChance(); + +} 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..39f53d797 --- /dev/null +++ b/src/main/java/io/github/thebusybiscuit/slimefun4/core/attributes/Rechargeable.java @@ -0,0 +1,150 @@ +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; + +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 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) { + throw new IllegalArgumentException("Cannot get Item charge for null or AIR"); + } + + 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) { + 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"); + } + + 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) { + 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"); + } + + 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..ec46fc522 --- /dev/null +++ b/src/main/java/io/github/thebusybiscuit/slimefun4/core/attributes/RechargeableHelper.java @@ -0,0 +1,82 @@ +package io.github.thebusybiscuit.slimefun4.core.attributes; + +import java.math.BigDecimal; +import java.math.RoundingMode; +import java.util.ArrayList; +import java.util.List; +import java.util.regex.Pattern; + +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.implementation.SlimefunPlugin; +import io.github.thebusybiscuit.slimefun4.utils.PatternUtils; +import net.md_5.bungee.api.ChatColor; + +/** + * 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("&8\u21E8 &e\u26A1 &7"); + private static final Pattern REGEX = Pattern.compile(ChatColors.color("(&c&o)?" + LORE_PREFIX) + "[0-9\\.]+ \\/ [0-9\\.]+ J"); + + 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.hasLore() ? meta.getLore() : new ArrayList<>(); + for (int i = 0; i < lore.size(); i++) { + String line = lore.get(i); + + if (REGEX.matcher(line).matches()) { + lore.set(i, LORE_PREFIX + value + " / " + capacity + " J"); + meta.setLore(lore); + return; + } + } + + lore.add(LORE_PREFIX + value + " / " + capacity + " J"); + meta.setLore(lore); + } + + static float getCharge(ItemMeta meta) { + if (SlimefunPlugin.getMinecraftVersion().isAtLeast(MinecraftVersion.MINECRAFT_1_14)) { + Float value = meta.getPersistentDataContainer().get(CHARGE_KEY, PersistentDataType.FLOAT); + + // 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 (REGEX.matcher(line).matches()) { + String data = ChatColor.stripColor(PatternUtils.SLASH_SEPARATOR.split(line)[0].replace(LORE_PREFIX, "")); + return Float.parseFloat(data); + } + } + } + + return 0; + } + +} 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..2b85e48aa 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,11 @@ 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); + sender.sendMessage("Please wait a second... The results are coming in!"); + SlimefunPlugin.getProfiler().requestSummary(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..3b89ff019 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; @@ -60,13 +60,19 @@ final class ContributorsMenu { menu.addItem(46, ChestMenuUtils.getPreviousButton(p, page + 1, pages)); menu.addMenuClickHandler(46, (pl, slot, item, action) -> { - if (page > 0) open(pl, page - 1); + if (page > 0) { + open(pl, page - 1); + } + return false; }); menu.addItem(52, ChestMenuUtils.getNextButton(p, page + 1, pages)); menu.addMenuClickHandler(52, (pl, slot, item, action) -> { - if (page + 1 < pages) open(pl, page + 1); + if (page + 1 < pages) { + open(pl, page + 1); + } + return false; }); @@ -87,15 +93,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 +111,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..9563e42f6 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,18 +10,18 @@ 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 { @Override public SlimefunAddon getAddon() { - return SlimefunPlugin.instance; + return SlimefunPlugin.instance(); } @Override public NamespacedKey getKey() { - return new NamespacedKey(SlimefunPlugin.instance, "research_fireworks"); + return new NamespacedKey(SlimefunPlugin.instance(), "research_fireworks"); } @Override 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..e6fe73e3a 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,20 +14,20 @@ 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 { @Override public SlimefunAddon getAddon() { - return SlimefunPlugin.instance; + return SlimefunPlugin.instance(); } @Override public NamespacedKey getKey() { - return new NamespacedKey(SlimefunPlugin.instance, "guide_layout"); + return new NamespacedKey(SlimefunPlugin.instance(), "guide_layout"); } @Override 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..6d55090a2 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,31 +13,31 @@ 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 { @Override public SlimefunAddon getAddon() { - return SlimefunPlugin.instance; + return SlimefunPlugin.instance(); } @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 92dcac117..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"), "", "&rMinecraft Version: &a" + Bukkit.getBukkitVersion(), "&rSlimefun Version: &a" + SlimefunPlugin.getVersion(), "&rCS-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/handlers/BlockBreakHandler.java b/src/main/java/io/github/thebusybiscuit/slimefun4/core/handlers/BlockBreakHandler.java new file mode 100644 index 000000000..d9a045fe3 --- /dev/null +++ b/src/main/java/io/github/thebusybiscuit/slimefun4/core/handlers/BlockBreakHandler.java @@ -0,0 +1,19 @@ +package io.github.thebusybiscuit.slimefun4.core.handlers; + +import java.util.List; + +import org.bukkit.event.block.BlockBreakEvent; +import org.bukkit.inventory.ItemStack; + +import me.mrCookieSlime.Slimefun.Objects.handlers.ItemHandler; + +@FunctionalInterface +public interface BlockBreakHandler extends ItemHandler { + + boolean onBlockBreak(BlockBreakEvent e, ItemStack item, int fortune, List drops); + + @Override + default Class getIdentifier() { + return BlockBreakHandler.class; + } +} diff --git a/src/main/java/me/mrCookieSlime/Slimefun/Objects/handlers/BlockDispenseHandler.java b/src/main/java/io/github/thebusybiscuit/slimefun4/core/handlers/BlockDispenseHandler.java similarity index 92% rename from src/main/java/me/mrCookieSlime/Slimefun/Objects/handlers/BlockDispenseHandler.java rename to src/main/java/io/github/thebusybiscuit/slimefun4/core/handlers/BlockDispenseHandler.java index 315435d90..437608096 100644 --- a/src/main/java/me/mrCookieSlime/Slimefun/Objects/handlers/BlockDispenseHandler.java +++ b/src/main/java/io/github/thebusybiscuit/slimefun4/core/handlers/BlockDispenseHandler.java @@ -1,4 +1,4 @@ -package me.mrCookieSlime.Slimefun.Objects.handlers; +package io.github.thebusybiscuit.slimefun4.core.handlers; import java.util.Optional; @@ -11,6 +11,7 @@ import io.github.thebusybiscuit.slimefun4.api.exceptions.IncompatibleItemHandler import io.github.thebusybiscuit.slimefun4.core.attributes.NotPlaceable; import io.github.thebusybiscuit.slimefun4.implementation.items.blocks.BlockPlacer; import me.mrCookieSlime.Slimefun.Objects.SlimefunItem.SlimefunItem; +import me.mrCookieSlime.Slimefun.Objects.handlers.ItemHandler; /** * This {@link ItemHandler} is triggered when the {@link SlimefunItem} it was assigned to diff --git a/src/main/java/me/mrCookieSlime/Slimefun/Objects/handlers/BlockPlaceHandler.java b/src/main/java/io/github/thebusybiscuit/slimefun4/core/handlers/BlockPlaceHandler.java similarity index 56% rename from src/main/java/me/mrCookieSlime/Slimefun/Objects/handlers/BlockPlaceHandler.java rename to src/main/java/io/github/thebusybiscuit/slimefun4/core/handlers/BlockPlaceHandler.java index 47310a0cb..cd4dccf81 100644 --- a/src/main/java/me/mrCookieSlime/Slimefun/Objects/handlers/BlockPlaceHandler.java +++ b/src/main/java/io/github/thebusybiscuit/slimefun4/core/handlers/BlockPlaceHandler.java @@ -1,12 +1,15 @@ -package me.mrCookieSlime.Slimefun.Objects.handlers; +package io.github.thebusybiscuit.slimefun4.core.handlers; +import org.bukkit.entity.Player; import org.bukkit.event.block.BlockPlaceEvent; import org.bukkit.inventory.ItemStack; +import me.mrCookieSlime.Slimefun.Objects.handlers.ItemHandler; + @FunctionalInterface public interface BlockPlaceHandler extends ItemHandler { - boolean onBlockPlace(BlockPlaceEvent e, ItemStack item); + boolean onBlockPlace(Player p, BlockPlaceEvent e, ItemStack item); @Override default Class getIdentifier() { diff --git a/src/main/java/me/mrCookieSlime/Slimefun/Objects/handlers/BlockUseHandler.java b/src/main/java/io/github/thebusybiscuit/slimefun4/core/handlers/BlockUseHandler.java similarity index 89% rename from src/main/java/me/mrCookieSlime/Slimefun/Objects/handlers/BlockUseHandler.java rename to src/main/java/io/github/thebusybiscuit/slimefun4/core/handlers/BlockUseHandler.java index b72320829..a88f963d0 100644 --- a/src/main/java/me/mrCookieSlime/Slimefun/Objects/handlers/BlockUseHandler.java +++ b/src/main/java/io/github/thebusybiscuit/slimefun4/core/handlers/BlockUseHandler.java @@ -1,4 +1,4 @@ -package me.mrCookieSlime.Slimefun.Objects.handlers; +package io.github.thebusybiscuit.slimefun4.core.handlers; import java.util.Optional; @@ -6,6 +6,7 @@ import io.github.thebusybiscuit.slimefun4.api.events.PlayerRightClickEvent; import io.github.thebusybiscuit.slimefun4.api.exceptions.IncompatibleItemHandlerException; import io.github.thebusybiscuit.slimefun4.core.attributes.NotPlaceable; import me.mrCookieSlime.Slimefun.Objects.SlimefunItem.SlimefunItem; +import me.mrCookieSlime.Slimefun.Objects.handlers.ItemHandler; @FunctionalInterface public interface BlockUseHandler extends ItemHandler { diff --git a/src/main/java/me/mrCookieSlime/Slimefun/Objects/handlers/BowShootHandler.java b/src/main/java/io/github/thebusybiscuit/slimefun4/core/handlers/BowShootHandler.java similarity index 91% rename from src/main/java/me/mrCookieSlime/Slimefun/Objects/handlers/BowShootHandler.java rename to src/main/java/io/github/thebusybiscuit/slimefun4/core/handlers/BowShootHandler.java index 8b990ee64..6cfa61768 100644 --- a/src/main/java/me/mrCookieSlime/Slimefun/Objects/handlers/BowShootHandler.java +++ b/src/main/java/io/github/thebusybiscuit/slimefun4/core/handlers/BowShootHandler.java @@ -1,4 +1,4 @@ -package me.mrCookieSlime.Slimefun.Objects.handlers; +package io.github.thebusybiscuit.slimefun4.core.handlers; import java.util.Optional; @@ -9,6 +9,7 @@ import org.bukkit.event.entity.EntityDamageByEntityEvent; import io.github.thebusybiscuit.slimefun4.api.exceptions.IncompatibleItemHandlerException; import io.github.thebusybiscuit.slimefun4.implementation.items.weapons.SlimefunBow; import me.mrCookieSlime.Slimefun.Objects.SlimefunItem.SlimefunItem; +import me.mrCookieSlime.Slimefun.Objects.handlers.ItemHandler; /** * This {@link ItemHandler} is triggered when the {@link SlimefunItem} it was assigned to diff --git a/src/main/java/me/mrCookieSlime/Slimefun/Objects/handlers/EntityInteractHandler.java b/src/main/java/io/github/thebusybiscuit/slimefun4/core/handlers/EntityInteractHandler.java similarity index 86% rename from src/main/java/me/mrCookieSlime/Slimefun/Objects/handlers/EntityInteractHandler.java rename to src/main/java/io/github/thebusybiscuit/slimefun4/core/handlers/EntityInteractHandler.java index c7fa151a9..919275888 100644 --- a/src/main/java/me/mrCookieSlime/Slimefun/Objects/handlers/EntityInteractHandler.java +++ b/src/main/java/io/github/thebusybiscuit/slimefun4/core/handlers/EntityInteractHandler.java @@ -1,4 +1,4 @@ -package me.mrCookieSlime.Slimefun.Objects.handlers; +package io.github.thebusybiscuit.slimefun4.core.handlers; import org.bukkit.entity.Entity; import org.bukkit.entity.Player; @@ -6,8 +6,9 @@ import org.bukkit.event.player.PlayerInteractAtEntityEvent; import org.bukkit.inventory.EquipmentSlot; import org.bukkit.inventory.ItemStack; -import me.mrCookieSlime.Slimefun.Objects.SlimefunItem.SimpleSlimefunItem; +import io.github.thebusybiscuit.slimefun4.implementation.items.SimpleSlimefunItem; import me.mrCookieSlime.Slimefun.Objects.SlimefunItem.SlimefunItem; +import me.mrCookieSlime.Slimefun.Objects.handlers.ItemHandler; /** * This is triggered when a {@link Player} interacts with an {@link Entity}. diff --git a/src/main/java/me/mrCookieSlime/Slimefun/Objects/handlers/EntityKillHandler.java b/src/main/java/io/github/thebusybiscuit/slimefun4/core/handlers/EntityKillHandler.java similarity index 80% rename from src/main/java/me/mrCookieSlime/Slimefun/Objects/handlers/EntityKillHandler.java rename to src/main/java/io/github/thebusybiscuit/slimefun4/core/handlers/EntityKillHandler.java index 99d2e1513..919da18a9 100644 --- a/src/main/java/me/mrCookieSlime/Slimefun/Objects/handlers/EntityKillHandler.java +++ b/src/main/java/io/github/thebusybiscuit/slimefun4/core/handlers/EntityKillHandler.java @@ -1,12 +1,13 @@ -package me.mrCookieSlime.Slimefun.Objects.handlers; +package io.github.thebusybiscuit.slimefun4.core.handlers; import org.bukkit.entity.Entity; import org.bukkit.entity.Player; import org.bukkit.event.entity.EntityDeathEvent; import org.bukkit.inventory.ItemStack; -import me.mrCookieSlime.Slimefun.Objects.SlimefunItem.SimpleSlimefunItem; +import io.github.thebusybiscuit.slimefun4.implementation.items.SimpleSlimefunItem; import me.mrCookieSlime.Slimefun.Objects.SlimefunItem.SlimefunItem; +import me.mrCookieSlime.Slimefun.Objects.handlers.ItemHandler; /** * If this {@link ItemHandler} is added to a {@link SlimefunItem} it will listen diff --git a/src/main/java/me/mrCookieSlime/Slimefun/Objects/handlers/ItemConsumptionHandler.java b/src/main/java/io/github/thebusybiscuit/slimefun4/core/handlers/ItemConsumptionHandler.java similarity index 87% rename from src/main/java/me/mrCookieSlime/Slimefun/Objects/handlers/ItemConsumptionHandler.java rename to src/main/java/io/github/thebusybiscuit/slimefun4/core/handlers/ItemConsumptionHandler.java index e9380f8e8..3e7756cf8 100644 --- a/src/main/java/me/mrCookieSlime/Slimefun/Objects/handlers/ItemConsumptionHandler.java +++ b/src/main/java/io/github/thebusybiscuit/slimefun4/core/handlers/ItemConsumptionHandler.java @@ -1,13 +1,14 @@ -package me.mrCookieSlime.Slimefun.Objects.handlers; +package io.github.thebusybiscuit.slimefun4.core.handlers; import org.bukkit.entity.Player; import org.bukkit.event.player.PlayerItemConsumeEvent; import org.bukkit.inventory.ItemStack; +import io.github.thebusybiscuit.slimefun4.implementation.items.SimpleSlimefunItem; import io.github.thebusybiscuit.slimefun4.implementation.items.food.DietCookie; import io.github.thebusybiscuit.slimefun4.implementation.items.food.FortuneCookie; -import me.mrCookieSlime.Slimefun.Objects.SlimefunItem.SimpleSlimefunItem; import me.mrCookieSlime.Slimefun.Objects.SlimefunItem.SlimefunItem; +import me.mrCookieSlime.Slimefun.Objects.handlers.ItemHandler; /** * This {@link ItemHandler} is triggered when the {@link SlimefunItem} it was assigned to diff --git a/src/main/java/me/mrCookieSlime/Slimefun/Objects/handlers/ItemDropHandler.java b/src/main/java/io/github/thebusybiscuit/slimefun4/core/handlers/ItemDropHandler.java similarity index 79% rename from src/main/java/me/mrCookieSlime/Slimefun/Objects/handlers/ItemDropHandler.java rename to src/main/java/io/github/thebusybiscuit/slimefun4/core/handlers/ItemDropHandler.java index e9a6435c4..c9e3f753b 100644 --- a/src/main/java/me/mrCookieSlime/Slimefun/Objects/handlers/ItemDropHandler.java +++ b/src/main/java/io/github/thebusybiscuit/slimefun4/core/handlers/ItemDropHandler.java @@ -1,9 +1,11 @@ -package me.mrCookieSlime.Slimefun.Objects.handlers; +package io.github.thebusybiscuit.slimefun4.core.handlers; import org.bukkit.entity.Item; import org.bukkit.entity.Player; import org.bukkit.event.player.PlayerDropItemEvent; +import me.mrCookieSlime.Slimefun.Objects.handlers.ItemHandler; + @FunctionalInterface public interface ItemDropHandler extends ItemHandler { diff --git a/src/main/java/io/github/thebusybiscuit/slimefun4/core/handlers/ItemUseHandler.java b/src/main/java/io/github/thebusybiscuit/slimefun4/core/handlers/ItemUseHandler.java new file mode 100644 index 000000000..cccbb295c --- /dev/null +++ b/src/main/java/io/github/thebusybiscuit/slimefun4/core/handlers/ItemUseHandler.java @@ -0,0 +1,37 @@ +package io.github.thebusybiscuit.slimefun4.core.handlers; + +import org.bukkit.entity.Player; + +import io.github.thebusybiscuit.slimefun4.api.events.PlayerRightClickEvent; +import io.github.thebusybiscuit.slimefun4.implementation.items.SimpleSlimefunItem; +import me.mrCookieSlime.Slimefun.Objects.SlimefunItem.SlimefunItem; +import me.mrCookieSlime.Slimefun.Objects.handlers.ItemHandler; + +/** + * This {@link ItemHandler} is triggered when the {@link SlimefunItem} it was assigned to + * is right-clicked. + * + * @author TheBusyBiscuit + * + * @see ItemHandler + * @see SimpleSlimefunItem + * + */ +@FunctionalInterface +public interface ItemUseHandler extends ItemHandler { + + /** + * This function is triggered when a {@link Player} right clicks with the assigned {@link SlimefunItem} + * in his hand. + * + * @param e + * The {@link PlayerRightClickEvent} that was triggered + */ + void onRightClick(PlayerRightClickEvent e); + + @Override + default Class getIdentifier() { + return ItemUseHandler.class; + } + +} diff --git a/src/main/java/io/github/thebusybiscuit/slimefun4/core/handlers/MultiBlockInteractionHandler.java b/src/main/java/io/github/thebusybiscuit/slimefun4/core/handlers/MultiBlockInteractionHandler.java new file mode 100644 index 000000000..36f2ce0ed --- /dev/null +++ b/src/main/java/io/github/thebusybiscuit/slimefun4/core/handlers/MultiBlockInteractionHandler.java @@ -0,0 +1,45 @@ +package io.github.thebusybiscuit.slimefun4.core.handlers; + +import java.util.Optional; + +import org.bukkit.block.Block; +import org.bukkit.entity.Player; + +import io.github.thebusybiscuit.slimefun4.api.exceptions.IncompatibleItemHandlerException; +import io.github.thebusybiscuit.slimefun4.core.multiblocks.MultiBlock; +import io.github.thebusybiscuit.slimefun4.core.multiblocks.MultiBlockMachine; +import me.mrCookieSlime.Slimefun.Objects.SlimefunItem.SlimefunItem; +import me.mrCookieSlime.Slimefun.Objects.handlers.ItemHandler; + +/** + * This {@link ItemHandler} is called whenever a {@link Player} interacts with + * this {@link MultiBlock}. + * Note that this {@link MultiBlockInteractionHandler} should be assigned to + * a class that inherits from {@link MultiBlockMachine}. + * + * @author TheBusyBiscuit + * + * @see ItemHandler + * @see MultiBlock + * @see MultiBlockMachine + * + */ +@FunctionalInterface +public interface MultiBlockInteractionHandler extends ItemHandler { + + boolean onInteract(Player p, MultiBlock mb, Block b); + + @Override + default Optional validate(SlimefunItem item) { + if (!(item instanceof MultiBlockMachine)) { + return Optional.of(new IncompatibleItemHandlerException("Only classes inheriting 'MultiBlockMachine' can have a MultiBlockInteractionHandler", item, this)); + } + + return Optional.empty(); + } + + @Override + default Class getIdentifier() { + return MultiBlockInteractionHandler.class; + } +} diff --git a/src/main/java/me/mrCookieSlime/Slimefun/Objects/handlers/RainbowTicker.java b/src/main/java/io/github/thebusybiscuit/slimefun4/core/handlers/RainbowTickHandler.java similarity index 60% rename from src/main/java/me/mrCookieSlime/Slimefun/Objects/handlers/RainbowTicker.java rename to src/main/java/io/github/thebusybiscuit/slimefun4/core/handlers/RainbowTickHandler.java index 6cf8766a3..70fa1ce35 100644 --- a/src/main/java/me/mrCookieSlime/Slimefun/Objects/handlers/RainbowTicker.java +++ b/src/main/java/io/github/thebusybiscuit/slimefun4/core/handlers/RainbowTickHandler.java @@ -1,19 +1,22 @@ -package me.mrCookieSlime.Slimefun.Objects.handlers; +package io.github.thebusybiscuit.slimefun4.core.handlers; import java.util.Arrays; +import org.apache.commons.lang.Validate; import org.bukkit.Material; import org.bukkit.block.Block; +import org.bukkit.block.BlockFace; import org.bukkit.block.data.BlockData; -import org.bukkit.block.data.Waterlogged; +import org.bukkit.block.data.type.GlassPane; 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; +import me.mrCookieSlime.Slimefun.Objects.handlers.BlockTicker; /** * This is a {@link BlockTicker} that is exclusively used for Rainbow blocks. @@ -25,34 +28,36 @@ import me.mrCookieSlime.Slimefun.Objects.SlimefunItem.SlimefunItem; * @see RainbowBlock * */ -public class RainbowTicker extends BlockTicker { +public class RainbowTickHandler extends BlockTicker { private final LoopIterator iterator; - private final boolean waterlogged; + private final boolean glassPanes; private Material material; - public RainbowTicker(Material... materials) { + public RainbowTickHandler(Material... materials) { + Validate.noNullElements(materials, "A RainbowTicker cannot have a Material that is null!"); + if (materials.length == 0) { throw new IllegalArgumentException("A RainbowTicker must have at least one Material associated with it!"); } - waterlogged = containsWaterlogged(materials); + glassPanes = containsGlassPanes(materials); iterator = new LoopIterator<>(Arrays.asList(materials)); material = iterator.next(); } /** * This method checks whether a given {@link Material} array contains any {@link Material} - * that would result in a {@link Waterlogged} {@link BlockData}. + * that would result in a {@link GlassPane} {@link BlockData}. * This is done to save performance, so we don't have to validate {@link BlockData} at * runtime. * * @param materials * The {@link Material} Array to check * - * @return Whether the array contained any {@link Waterlogged} materials + * @return Whether the array contained any {@link GlassPane} materials */ - private boolean containsWaterlogged(Material[] materials) { + private boolean containsGlassPanes(Material[] materials) { if (SlimefunPlugin.getMinecraftVersion() == MinecraftVersion.UNIT_TEST) { // BlockData is not available to us during Unit Tests :/ return false; @@ -61,8 +66,8 @@ public class RainbowTicker extends BlockTicker { for (Material type : materials) { // This BlockData is purely virtual and only created on startup, it should have // no impact on performance, in fact it should save performance as it preloads - // the data but also saves heavy calls for non-waterlogged Materials - if (type.createBlockData() instanceof Waterlogged) { + // the data but also saves heavy calls for other Materials + if (type.createBlockData() instanceof GlassPane) { return true; } } @@ -70,7 +75,7 @@ public class RainbowTicker extends BlockTicker { return false; } - public RainbowTicker(MaterialCollection collection) { + public RainbowTickHandler(MaterialCollection collection) { this(collection.getAsArray()); } @@ -82,20 +87,29 @@ public class RainbowTicker extends BlockTicker { return; } - if (waterlogged) { + if (glassPanes) { BlockData blockData = b.getBlockData(); - b.setType(material, true); + if (blockData instanceof GlassPane) { + BlockData block = material.createBlockData(bd -> { + if (bd instanceof GlassPane) { + GlassPane previousData = (GlassPane) blockData; + GlassPane nextData = (GlassPane) bd; + + nextData.setWaterlogged(previousData.isWaterlogged()); + + for (BlockFace face : previousData.getAllowedFaces()) { + nextData.setFace(face, previousData.hasFace(face)); + } + } + }); - if (blockData instanceof Waterlogged && ((Waterlogged) blockData).isWaterlogged()) { - Waterlogged block = (Waterlogged) b.getBlockData(); - block.setWaterlogged(true); b.setBlockData(block); + return; } } - else { - b.setType(material, false); - } + + b.setType(material, false); } @Override diff --git a/src/main/java/io/github/thebusybiscuit/slimefun4/core/handlers/package-info.java b/src/main/java/io/github/thebusybiscuit/slimefun4/core/handlers/package-info.java new file mode 100644 index 000000000..2dc20269a --- /dev/null +++ b/src/main/java/io/github/thebusybiscuit/slimefun4/core/handlers/package-info.java @@ -0,0 +1,5 @@ +/** + * This package contains all variations of {@link me.mrCookieSlime.Slimefun.Objects.handlers.ItemHandler} that + * can be assigned to a {@link me.mrCookieSlime.Slimefun.Objects.SlimefunItem.SlimefunItem} + */ +package io.github.thebusybiscuit.slimefun4.core.handlers; \ No newline at end of file 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..af5572702 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,9 +13,9 @@ 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.core.handlers.MultiBlockInteractionHandler; +import io.github.thebusybiscuit.slimefun4.implementation.SlimefunPlugin; import me.mrCookieSlime.Slimefun.Objects.SlimefunItem.SlimefunItem; -import me.mrCookieSlime.Slimefun.Objects.handlers.MultiBlockInteractionHandler; /** * A {@link MultiBlock} represents a structure build in a {@link World}. 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..a4fd5fb55 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,11 +20,11 @@ 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.core.handlers.MultiBlockInteractionHandler; +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; -import me.mrCookieSlime.Slimefun.Objects.handlers.MultiBlockInteractionHandler; import me.mrCookieSlime.Slimefun.api.BlockStorage; import me.mrCookieSlime.Slimefun.api.Slimefun; import me.mrCookieSlime.Slimefun.api.SlimefunItemStack; 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..f8df07d58 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 @@ -1,6 +1,5 @@ package io.github.thebusybiscuit.slimefun4.core.networks.cargo; -import java.util.Deque; import java.util.HashMap; import java.util.HashSet; import java.util.LinkedList; @@ -12,19 +11,14 @@ import java.util.logging.Level; import org.bukkit.Location; import org.bukkit.block.Block; -import org.bukkit.block.BlockState; -import org.bukkit.inventory.Inventory; -import org.bukkit.inventory.InventoryHolder; 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; /** * The {@link CargoNet} is a type of {@link Network} which deals with {@link ItemStack} transportation. @@ -49,7 +43,7 @@ public class CargoNet extends ChestTerminalNetwork { private final Set inputNodes = new HashSet<>(); private final Set outputNodes = new HashSet<>(); - private final Map roundRobin = new HashMap<>(); + protected final Map roundRobin = new HashMap<>(); private int tickDelayThreshold = 0; public static CargoNet getNetworkFromLocation(Location l) { @@ -111,6 +105,8 @@ public class CargoNet extends ChestTerminalNetwork { @Override public void onClassificationChange(Location l, NetworkComponent from, NetworkComponent to) { + connectorCache.remove(l); + if (from == NetworkComponent.TERMINUS) { inputNodes.remove(l); outputNodes.remove(l); @@ -120,7 +116,8 @@ public class CargoNet extends ChestTerminalNetwork { } if (to == NetworkComponent.TERMINUS) { - switch (BlockStorage.checkID(l)) { + String id = BlockStorage.checkID(l); + switch (id) { case "CARGO_NODE_INPUT": inputNodes.add(l); break; @@ -156,28 +153,65 @@ public class CargoNet extends ChestTerminalNetwork { } else { SimpleHologram.update(b, "&7Status: &a&lONLINE"); - Map> output = mapOutputNodes(); - // Chest Terminal Stuff - Set destinations = new HashSet<>(); - List output16 = output.get(16); - - if (output16 != null) { - destinations.addAll(output16); + // Skip ticking if the threshold is not reached. The delay is not same as minecraft tick, + // but it's based on 'custom-ticker-delay' config. + if (tickDelayThreshold < TICK_DELAY) { + tickDelayThreshold++; + return; } - Slimefun.runSync(() -> run(b, destinations, output)); + // Reset the internal threshold, so we can start skipping again + tickDelayThreshold = 0; + + // Chest Terminal Stuff + Set chestTerminalInputs = new HashSet<>(); + Set chestTerminalOutputs = new HashSet<>(); + + Map inputs = mapInputNodes(chestTerminalInputs); + Map> outputs = mapOutputNodes(chestTerminalOutputs); + + if (BlockStorage.getLocationInfo(b.getLocation(), "visualizer") == null) { + display(); + } + + SlimefunPlugin.getProfiler().scheduleEntries(1 + inputNodes.size()); + + CargoNetworkTask runnable = new CargoNetworkTask(this, inputs, outputs, chestTerminalInputs, chestTerminalOutputs); + Slimefun.runSync(runnable); } } - private Map> mapOutputNodes() { + private Map mapInputNodes(Set chestTerminalNodes) { + Map inputs = new HashMap<>(); + + for (Location node : inputNodes) { + int frequency = getFrequency(node); + + if (frequency == 16) { + chestTerminalNodes.add(node); + } + else if (frequency >= 0 && frequency < 16) { + inputs.put(node, frequency); + } + } + + return inputs; + } + + private Map> mapOutputNodes(Set chestTerminalOutputs) { Map> output = new HashMap<>(); List list = new LinkedList<>(); int lastFrequency = -1; - for (Location outputNode : outputNodes) { - int frequency = getFrequency(outputNode); + for (Location node : outputNodes) { + int frequency = getFrequency(node); + + if (frequency == 16) { + chestTerminalOutputs.add(node); + continue; + } if (frequency != lastFrequency && lastFrequency != -1) { output.merge(lastFrequency, list, (prev, next) -> { @@ -188,7 +222,7 @@ public class CargoNet extends ChestTerminalNetwork { list = new LinkedList<>(); } - list.add(outputNode); + list.add(node); lastFrequency = frequency; } @@ -202,153 +236,6 @@ public class CargoNet extends ChestTerminalNetwork { return output; } - private void run(Block b, Set destinations, Map> output) { - if (BlockStorage.getLocationInfo(b.getLocation(), "visualizer") == null) { - display(); - } - - // Skip ticking if the threshold is not reached. The delay is not same as minecraft tick, - // but it's based on 'custom-ticker-delay' config. - if (tickDelayThreshold < TICK_DELAY) { - tickDelayThreshold++; - return; - } - - // Reset the internal threshold, so we can start skipping again - tickDelayThreshold = 0; - - Map inputs = new HashMap<>(); - Set providers = new HashSet<>(); - - for (Location node : inputNodes) { - int frequency = getFrequency(node); - - if (frequency == 16) { - providers.add(node); - } - else if (frequency >= 0 && frequency < 16) { - inputs.put(node, frequency); - } - } - - // Chest Terminal Code - if (SlimefunPlugin.getThirdPartySupportService().isChestTerminalInstalled()) { - handleItemRequests(providers, destinations); - } - - // All operations happen here: Everything gets iterated from the Input Nodes. - // (Apart from ChestTerminal Buses) - for (Map.Entry entry : inputs.entrySet()) { - Location input = entry.getKey(); - Optional attachedBlock = getAttachedBlock(input.getBlock()); - - if (attachedBlock.isPresent()) { - routeItems(input, attachedBlock.get(), entry.getValue(), output); - } - } - - // Chest Terminal Code - if (SlimefunPlugin.getThirdPartySupportService().isChestTerminalInstalled()) { - updateTerminals(providers); - } - } - - private void routeItems(Location inputNode, Block inputTarget, int frequency, Map> outputNodes) { - ItemStackAndInteger slot = CargoUtils.withdraw(inputNode.getBlock(), inputTarget); - if (slot == null) { - return; - } - - ItemStack stack = slot.getItem(); - int previousSlot = slot.getInt(); - List outputs = outputNodes.get(frequency); - - if (outputs != null) { - stack = distributeItem(stack, inputNode, outputs); - } - - if (stack != null) { - DirtyChestMenu menu = CargoUtils.getChestMenu(inputTarget); - - if (menu != null) { - if (menu.getItemInSlot(previousSlot) == null) { - menu.replaceExistingItem(previousSlot, stack); - } - else { - inputTarget.getWorld().dropItem(inputTarget.getLocation().add(0, 1, 0), stack); - } - } - else if (CargoUtils.hasInventory(inputTarget)) { - BlockState state = inputTarget.getState(); - - if (state instanceof InventoryHolder) { - Inventory inv = ((InventoryHolder) state).getInventory(); - - if (inv.getItem(previousSlot) == null) { - inv.setItem(previousSlot, stack); - } - else { - inputTarget.getWorld().dropItem(inputTarget.getLocation().add(0, 1, 0), stack); - } - } - } - } - } - - private ItemStack distributeItem(ItemStack stack, Location inputNode, List outputNodes) { - ItemStack item = stack; - - Deque destinations = new LinkedList<>(outputNodes); - Config cfg = BlockStorage.getLocationInfo(inputNode); - boolean roundrobin = "true".equals(cfg.getString("round-robin")); - - if (roundrobin) { - roundRobinSort(inputNode, destinations); - } - - for (Location output : destinations) { - Optional target = getAttachedBlock(output.getBlock()); - - if (target.isPresent()) { - item = CargoUtils.insert(output.getBlock(), target.get(), item); - - if (item == null) { - break; - } - } - } - - return item; - } - - /** - * This method sorts a given {@link Deque} of output node locations using a semi-accurate - * round-robin method. - * - * @param inputNode - * The {@link Location} of the input node - * @param outputNodes - * A {@link Deque} of {@link Location Locations} of the output nodes - */ - private void roundRobinSort(Location inputNode, Deque outputNodes) { - int index = roundRobin.getOrDefault(inputNode, 0); - - if (index < outputNodes.size()) { - // Not ideal but actually not bad performance-wise over more elegant alternatives - for (int i = 0; i < index; i++) { - Location temp = outputNodes.removeFirst(); - outputNodes.add(temp); - } - - index++; - } - else { - index = 1; - } - - roundRobin.put(inputNode, index); - } - /** * This method returns the frequency a given node is set to. * Should there be an {@link Exception} to this method it will fall back to zero in diff --git a/src/main/java/io/github/thebusybiscuit/slimefun4/core/networks/cargo/CargoNetworkTask.java b/src/main/java/io/github/thebusybiscuit/slimefun4/core/networks/cargo/CargoNetworkTask.java new file mode 100644 index 000000000..d43d985b9 --- /dev/null +++ b/src/main/java/io/github/thebusybiscuit/slimefun4/core/networks/cargo/CargoNetworkTask.java @@ -0,0 +1,183 @@ +package io.github.thebusybiscuit.slimefun4.core.networks.cargo; + +import java.util.Deque; +import java.util.HashMap; +import java.util.LinkedList; +import java.util.List; +import java.util.Map; +import java.util.Optional; +import java.util.Set; + +import org.bukkit.Location; +import org.bukkit.block.Block; +import org.bukkit.inventory.Inventory; +import org.bukkit.inventory.ItemStack; + +import io.github.thebusybiscuit.slimefun4.implementation.SlimefunItems; +import io.github.thebusybiscuit.slimefun4.implementation.SlimefunPlugin; +import me.mrCookieSlime.CSCoreLibPlugin.Configuration.Config; +import me.mrCookieSlime.Slimefun.api.BlockStorage; +import me.mrCookieSlime.Slimefun.api.inventory.DirtyChestMenu; + +/** + * The {@link CargoNetworkTask} is the actual {@link Runnable} responsible for moving {@link ItemStack ItemStacks} + * around the {@link CargoNet}. + * + * Inbefore this was just a method in the {@link CargoNet} class. + * However for aesthetic reasons but mainly to prevent the Cargo Task from showing up as + * "lambda:xyz-123" in timing reports... this was moved. + * + * @see CargoNet + * @see CargoUtils + * @see ChestTerminalNetwork + * + */ +class CargoNetworkTask implements Runnable { + + private final CargoNet network; + private final Map inventories = new HashMap<>(); + + private final Map inputs; + private final Map> outputs; + + private final Set chestTerminalInputs; + private final Set chestTerminalOutputs; + + CargoNetworkTask(CargoNet network, Map inputs, Map> outputs, Set chestTerminalInputs, Set chestTerminalOutputs) { + this.network = network; + + this.inputs = inputs; + this.outputs = outputs; + this.chestTerminalInputs = chestTerminalInputs; + this.chestTerminalOutputs = chestTerminalOutputs; + } + + @Override + public void run() { + long timestamp = System.nanoTime(); + + // Chest Terminal Code + if (SlimefunPlugin.getThirdPartySupportService().isChestTerminalInstalled()) { + network.handleItemRequests(inventories, chestTerminalInputs, chestTerminalOutputs); + } + + // All operations happen here: Everything gets iterated from the Input Nodes. + // (Apart from ChestTerminal Buses) + for (Map.Entry entry : inputs.entrySet()) { + long nodeTimestamp = System.nanoTime(); + Location input = entry.getKey(); + Optional attachedBlock = network.getAttachedBlock(input); + + if (attachedBlock.isPresent()) { + routeItems(input, attachedBlock.get(), entry.getValue(), outputs); + } + + // This will prevent this timings from showing up for the Cargo Manager + timestamp += SlimefunPlugin.getProfiler().closeEntry(entry.getKey(), SlimefunItems.CARGO_INPUT_NODE.getItem(), nodeTimestamp); + } + + // Chest Terminal Code + if (SlimefunPlugin.getThirdPartySupportService().isChestTerminalInstalled()) { + network.updateTerminals(chestTerminalInputs); + } + + // Submit a timings report + SlimefunPlugin.getProfiler().closeEntry(network.getRegulator(), SlimefunItems.CARGO_MANAGER.getItem(), timestamp); + } + + private void routeItems(Location inputNode, Block inputTarget, int frequency, Map> outputNodes) { + ItemStackAndInteger slot = CargoUtils.withdraw(inventories, inputNode.getBlock(), inputTarget); + + if (slot == null) { + return; + } + + ItemStack stack = slot.getItem(); + int previousSlot = slot.getInt(); + List destinations = outputNodes.get(frequency); + + if (destinations != null) { + stack = distributeItem(stack, inputNode, destinations); + } + + if (stack != null) { + Inventory inv = inventories.get(inputTarget.getLocation()); + + if (inv != null) { + if (inv.getItem(previousSlot) == null) { + inv.setItem(previousSlot, stack); + } + else { + inputTarget.getWorld().dropItem(inputTarget.getLocation().add(0, 1, 0), stack); + } + } + else { + DirtyChestMenu menu = CargoUtils.getChestMenu(inputTarget); + + if (menu != null) { + if (menu.getItemInSlot(previousSlot) == null) { + menu.replaceExistingItem(previousSlot, stack); + } + else { + inputTarget.getWorld().dropItem(inputTarget.getLocation().add(0, 1, 0), stack); + } + } + } + } + } + + private ItemStack distributeItem(ItemStack stack, Location inputNode, List outputNodes) { + ItemStack item = stack; + + Deque destinations = new LinkedList<>(outputNodes); + Config cfg = BlockStorage.getLocationInfo(inputNode); + boolean roundrobin = "true".equals(cfg.getString("round-robin")); + + if (roundrobin) { + roundRobinSort(inputNode, destinations); + } + + for (Location output : destinations) { + Optional target = network.getAttachedBlock(output); + + if (target.isPresent()) { + item = CargoUtils.insert(inventories, output.getBlock(), target.get(), item); + + if (item == null) { + break; + } + } + } + + return item; + } + + /** + * This method sorts a given {@link Deque} of output node locations using a semi-accurate + * round-robin method. + * + * @param inputNode + * The {@link Location} of the input node + * @param outputNodes + * A {@link Deque} of {@link Location Locations} of the output nodes + */ + private void roundRobinSort(Location inputNode, Deque outputNodes) { + int index = network.roundRobin.getOrDefault(inputNode, 0); + + if (index < outputNodes.size()) { + // Not ideal but actually not bad performance-wise over more elegant alternatives + for (int i = 0; i < index; i++) { + Location temp = outputNodes.removeFirst(); + outputNodes.add(temp); + } + + index++; + } + else { + index = 1; + } + + network.roundRobin.put(inputNode, index); + } + +} 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 47bee5f73..ed6cf7105 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 @@ -1,9 +1,9 @@ package io.github.thebusybiscuit.slimefun4.core.networks.cargo; -import java.util.LinkedList; -import java.util.List; +import java.util.Map; import java.util.logging.Level; +import org.bukkit.Location; import org.bukkit.Material; import org.bukkit.Tag; import org.bukkit.block.Block; @@ -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; @@ -82,15 +82,23 @@ final class CargoUtils { return false; } - static ItemStack withdraw(Block node, Block target, ItemStack template) { + static ItemStack withdraw(Map inventories, Block node, Block target, ItemStack template) { DirtyChestMenu menu = getChestMenu(target); if (menu == null) { if (hasInventory(target)) { + Inventory inventory = inventories.get(target.getLocation()); + + if (inventory != null) { + return withdrawFromVanillaInventory(node, template, inventory); + } + BlockState state = target.getState(); if (state instanceof InventoryHolder) { - return withdrawFromVanillaInventory(node, template, ((InventoryHolder) state).getInventory()); + inventory = ((InventoryHolder) state).getInventory(); + inventories.put(target.getLocation(), inventory); + return withdrawFromVanillaInventory(node, template, inventory); } } @@ -134,10 +142,10 @@ final class CargoUtils { ItemStackWrapper wrapper = new ItemStackWrapper(template); for (int slot = minSlot; slot < maxSlot; slot++) { - // Changes to this ItemStack are synchronized with the Item in the Inventory + // Changes to these ItemStacks are synchronized with the Item in the Inventory ItemStack itemInSlot = contents[slot]; - if (SlimefunUtils.isItemSimilar(itemInSlot, wrapper, true) && matchesFilter(node, itemInSlot)) { + if (SlimefunUtils.isItemSimilar(itemInSlot, wrapper, true, false) && matchesFilter(node, itemInSlot)) { if (itemInSlot.getAmount() > template.getAmount()) { itemInSlot.setAmount(itemInSlot.getAmount() - template.getAmount()); return template; @@ -153,7 +161,7 @@ final class CargoUtils { return null; } - static ItemStackAndInteger withdraw(Block node, Block target) { + static ItemStackAndInteger withdraw(Map inventories, Block node, Block target) { DirtyChestMenu menu = getChestMenu(target); if (menu != null) { @@ -167,38 +175,50 @@ final class CargoUtils { } } else if (hasInventory(target)) { + Inventory inventory = inventories.get(target.getLocation()); + + if (inventory != null) { + return withdrawFromVanillaInventory(node, inventory); + } + BlockState state = target.getState(); if (state instanceof InventoryHolder) { - Inventory inv = ((InventoryHolder) state).getInventory(); - - ItemStack[] contents = inv.getContents(); - int minSlot = 0; - int maxSlot = contents.length; - - if (inv instanceof FurnaceInventory) { - minSlot = 2; - maxSlot = 3; - } - else if (inv instanceof BrewerInventory) { - maxSlot = 3; - } - - for (int slot = minSlot; slot < maxSlot; slot++) { - ItemStack is = contents[slot]; - - if (matchesFilter(node, is)) { - inv.setItem(slot, null); - return new ItemStackAndInteger(is, slot); - } - } + inventory = ((InventoryHolder) state).getInventory(); + inventories.put(target.getLocation(), inventory); + return withdrawFromVanillaInventory(node, inventory); } } return null; } - static ItemStack insert(Block node, Block target, ItemStack stack) { + private static ItemStackAndInteger withdrawFromVanillaInventory(Block node, Inventory inv) { + ItemStack[] contents = inv.getContents(); + int minSlot = 0; + int maxSlot = contents.length; + + if (inv instanceof FurnaceInventory) { + minSlot = 2; + maxSlot = 3; + } + else if (inv instanceof BrewerInventory) { + maxSlot = 3; + } + + for (int slot = minSlot; slot < maxSlot; slot++) { + ItemStack is = contents[slot]; + + if (matchesFilter(node, is)) { + inv.setItem(slot, null); + return new ItemStackAndInteger(is, slot); + } + } + + return null; + } + + static ItemStack insert(Map inventories, Block node, Block target, ItemStack stack) { if (!matchesFilter(node, stack)) { return stack; } @@ -207,10 +227,18 @@ final class CargoUtils { if (menu == null) { if (hasInventory(target)) { + Inventory inventory = inventories.get(target.getLocation()); + + if (inventory != null) { + return insertIntoVanillaInventory(stack, inventory); + } + BlockState state = target.getState(); if (state instanceof InventoryHolder) { - return insertIntoVanillaInventory(stack, ((InventoryHolder) state).getInventory()); + inventory = ((InventoryHolder) state).getInventory(); + inventories.put(target.getLocation(), inventory); + return insertIntoVanillaInventory(stack, inventory); } } @@ -248,7 +276,7 @@ final class CargoUtils { return stack; } - static ItemStack insertIntoVanillaInventory(ItemStack stack, Inventory inv) { + private static ItemStack insertIntoVanillaInventory(ItemStack stack, Inventory inv) { ItemStack[] contents = inv.getContents(); int minSlot = 0; int maxSlot = contents.length; @@ -338,7 +366,7 @@ final class CargoUtils { return stack != null && Tag.LOGS.isTagged(stack.getType()); } else { - return SlimefunPlugin.getMinecraftRecipes().isSmeltable(stack); + return SlimefunPlugin.getMinecraftRecipeService().isSmeltable(stack); } } @@ -356,63 +384,52 @@ final class CargoUtils { } // Store the returned Config instance to avoid heavy calls - Config blockInfo = BlockStorage.getLocationInfo(block.getLocation()); - String id = blockInfo.getString("id"); + Config blockData = BlockStorage.getLocationInfo(block.getLocation()); + String id = blockData.getString("id"); + // Cargo Output nodes have no filter actually if (id.equals("CARGO_NODE_OUTPUT")) { return true; } try { BlockMenu menu = BlockStorage.getInventory(block.getLocation()); + if (menu == null) { return false; } - boolean lore = "true".equals(blockInfo.getString("filter-lore")); - ItemStackWrapper wrapper = new ItemStackWrapper(item); - - if ("whitelist".equals(blockInfo.getString("filter-type"))) { - List templateItems = new LinkedList<>(); - - for (int slot : FILTER_SLOTS) { - ItemStack template = menu.getItemInSlot(slot); - - if (template != null) { - templateItems.add(template); - } - } - - if (templateItems.isEmpty()) { - return false; - } - - for (ItemStack stack : templateItems) { - if (SlimefunUtils.isItemSimilar(wrapper, stack, lore)) { - return true; - } - } - - return false; - } - else { - for (int slot : FILTER_SLOTS) { - ItemStack itemInSlot = menu.getItemInSlot(slot); - - if (itemInSlot != null && SlimefunUtils.isItemSimilar(wrapper, itemInSlot, lore, false)) { - return false; - } - } - - return true; - } + boolean lore = "true".equals(blockData.getString("filter-lore")); + boolean allowByDefault = !"whitelist".equals(blockData.getString("filter-type")); + return matchesFilterList(item, menu, lore, allowByDefault); } catch (Exception x) { - Slimefun.getLogger().log(Level.SEVERE, x, () -> "An Exception occured while trying to filter items for a Cargo Node (" + id + ") at " + new BlockPosition(block)); + Slimefun.getLogger().log(Level.SEVERE, x, () -> "An Exception occurred while trying to filter items for a Cargo Node (" + id + ") at " + new BlockPosition(block)); return false; } } + private static boolean matchesFilterList(ItemStack item, BlockMenu menu, boolean respectLore, boolean defaultValue) { + ItemStackWrapper wrapper = null; + + for (int slot : FILTER_SLOTS) { + ItemStack stack = menu.getItemInSlot(slot); + + if (stack != null) { + if (wrapper == null) { + // Only create this as needed to save performance + wrapper = new ItemStackWrapper(item); + } + + if (SlimefunUtils.isItemSimilar(stack, wrapper, respectLore, false)) { + return !defaultValue; + } + } + } + + return defaultValue; + } + /** * Get the whitelist/blacklist slots in a Cargo Input Node. If you wish to access the items * in the cargo (without hardcoding the slots in case of change) then you can use this method. 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..31c3e04de 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 @@ -3,10 +3,12 @@ package io.github.thebusybiscuit.slimefun4.core.networks.cargo; import java.util.ArrayList; import java.util.Collections; import java.util.Comparator; +import java.util.HashMap; import java.util.HashSet; import java.util.Iterator; import java.util.LinkedList; import java.util.List; +import java.util.Map; import java.util.Optional; import java.util.Queue; import java.util.Set; @@ -26,10 +28,11 @@ 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.Objects.SlimefunItem.SlimefunItem; import me.mrCookieSlime.Slimefun.api.BlockStorage; import me.mrCookieSlime.Slimefun.api.inventory.BlockMenu; import me.mrCookieSlime.Slimefun.api.inventory.DirtyChestMenu; @@ -57,22 +60,37 @@ abstract class ChestTerminalNetwork extends Network { // This represents a Queue of requests to handle private final Queue itemRequests = new LinkedList<>(); + // This is a cache for the BlockFace a node is facing, so we don't need to request the + // BlockData each time we visit a node + protected Map connectorCache = new HashMap<>(); + protected ChestTerminalNetwork(Location regulator) { super(SlimefunPlugin.getNetworkManager(), regulator); } - protected static Optional getAttachedBlock(Block block) { - if (block.getType() == Material.PLAYER_WALL_HEAD) { - BlockFace face = ((Directional) block.getBlockData()).getFacing().getOppositeFace(); - return Optional.of(block.getRelative(face)); + protected Optional getAttachedBlock(Location l) { + if (l.getWorld().isChunkLoaded(l.getBlockX() >> 4, l.getBlockZ() >> 4)) { + Block block = l.getBlock(); + + if (block.getType() == Material.PLAYER_WALL_HEAD) { + BlockFace cached = connectorCache.get(l); + + if (cached != null) { + return Optional.of(block.getRelative(cached)); + } + + BlockFace face = ((Directional) block.getBlockData()).getFacing().getOppositeFace(); + connectorCache.put(l, face); + return Optional.of(block.getRelative(face)); + } } return Optional.empty(); } - protected void handleItemRequests(Set providers, Set destinations) { - collectImportRequests(); - collectExportRequests(); + protected void handleItemRequests(Map inventories, Set providers, Set destinations) { + collectImportRequests(inventories); + collectExportRequests(inventories); collectTerminalRequests(); Iterator iterator = itemRequests.iterator(); @@ -84,10 +102,10 @@ abstract class ChestTerminalNetwork extends Network { switch (request.getDirection()) { case INSERT: - distributeInsertionRequest(request, menu, iterator, destinations); + distributeInsertionRequest(inventories, request, menu, iterator, destinations); break; case WITHDRAW: - collectExtractionRequest(request, menu, iterator, providers); + collectExtractionRequest(inventories, request, menu, iterator, providers); break; default: break; @@ -96,14 +114,14 @@ abstract class ChestTerminalNetwork extends Network { } } - private void distributeInsertionRequest(ItemRequest request, BlockMenu terminal, Iterator iterator, Set destinations) { + private void distributeInsertionRequest(Map inventories, ItemRequest request, BlockMenu terminal, Iterator iterator, Set destinations) { ItemStack item = request.getItem(); for (Location l : destinations) { - Optional target = getAttachedBlock(l.getBlock()); + Optional target = getAttachedBlock(l); if (target.isPresent()) { - item = CargoUtils.insert(l.getBlock(), target.get(), item); + item = CargoUtils.insert(inventories, l.getBlock(), target.get(), item); if (item == null) { terminal.replaceExistingItem(request.getSlot(), null); @@ -119,7 +137,7 @@ abstract class ChestTerminalNetwork extends Network { iterator.remove(); } - private void collectExtractionRequest(ItemRequest request, BlockMenu terminal, Iterator iterator, Set providers) { + private void collectExtractionRequest(Map inventories, ItemRequest request, BlockMenu terminal, Iterator iterator, Set providers) { int slot = request.getSlot(); ItemStack prevStack = terminal.getItemInSlot(slot); @@ -132,10 +150,10 @@ abstract class ChestTerminalNetwork extends Network { ItemStack item = request.getItem(); for (Location l : providers) { - Optional target = getAttachedBlock(l.getBlock()); + Optional target = getAttachedBlock(l); if (target.isPresent()) { - ItemStack is = CargoUtils.withdraw(l.getBlock(), target.get(), item); + ItemStack is = CargoUtils.withdraw(inventories, l.getBlock(), target.get(), item); if (is != null) { if (stack == null) { @@ -169,15 +187,18 @@ abstract class ChestTerminalNetwork extends Network { iterator.remove(); } - private void collectImportRequests() { + private void collectImportRequests(Map inventories) { + SlimefunItem item = SlimefunItem.getByID("CT_IMPORT_BUS"); + for (Location bus : imports) { + long timestamp = SlimefunPlugin.getProfiler().newEntry(); BlockMenu menu = BlockStorage.getInventory(bus); if (menu.getItemInSlot(17) == null) { - Optional target = getAttachedBlock(bus.getBlock()); + Optional target = getAttachedBlock(bus); if (target.isPresent()) { - ItemStackAndInteger stack = CargoUtils.withdraw(bus.getBlock(), target.get()); + ItemStackAndInteger stack = CargoUtils.withdraw(inventories, bus.getBlock(), target.get()); if (stack != null) { menu.replaceExistingItem(17, stack.getItem()); @@ -188,18 +209,23 @@ abstract class ChestTerminalNetwork extends Network { if (menu.getItemInSlot(17) != null) { itemRequests.add(new ItemRequest(bus, 17, menu.getItemInSlot(17), ItemTransportFlow.INSERT)); } + + SlimefunPlugin.getProfiler().closeEntry(bus, item, timestamp); } } - private void collectExportRequests() { + private void collectExportRequests(Map inventories) { + SlimefunItem item = SlimefunItem.getByID("CT_EXPORT_BUS"); + for (Location bus : exports) { + long timestamp = SlimefunPlugin.getProfiler().newEntry(); BlockMenu menu = BlockStorage.getInventory(bus); if (menu.getItemInSlot(17) != null) { - Optional target = getAttachedBlock(bus.getBlock()); + Optional target = getAttachedBlock(bus); if (target.isPresent()) { - menu.replaceExistingItem(17, CargoUtils.insert(bus.getBlock(), target.get(), menu.getItemInSlot(17))); + menu.replaceExistingItem(17, CargoUtils.insert(inventories, bus.getBlock(), target.get(), menu.getItemInSlot(17))); } } @@ -208,7 +234,10 @@ abstract class ChestTerminalNetwork extends Network { for (int slot : slots) { ItemStack template = menu.getItemInSlot(slot); - if (template != null) items.add(new CustomItem(template, 1)); + + if (template != null) { + items.add(new CustomItem(template, 1)); + } } if (!items.isEmpty()) { @@ -223,17 +252,24 @@ abstract class ChestTerminalNetwork extends Network { itemRequests.add(new ItemRequest(bus, 17, items.get(index), ItemTransportFlow.WITHDRAW)); } } + + SlimefunPlugin.getProfiler().closeEntry(bus, item, timestamp); } } private void collectTerminalRequests() { + SlimefunItem item = SlimefunItem.getByID("CHEST_TERMINAL"); + for (Location terminal : terminals) { + long timestamp = SlimefunPlugin.getProfiler().newEntry(); BlockMenu menu = BlockStorage.getInventory(terminal); ItemStack sendingItem = menu.getItemInSlot(TERMINAL_OUT_SLOT); if (sendingItem != null) { itemRequests.add(new ItemRequest(terminal, TERMINAL_OUT_SLOT, sendingItem, ItemTransportFlow.INSERT)); } + + SlimefunPlugin.getProfiler().closeEntry(terminal, item, timestamp); } } @@ -269,6 +305,7 @@ abstract class ChestTerminalNetwork extends Network { ItemStackAndInteger item = items.get(index); ItemStack stack = item.getItem().clone(); + stack.setAmount(1); ItemMeta im = stack.getItemMeta(); List lore = new ArrayList<>(); lore.add(""); @@ -308,7 +345,7 @@ abstract class ChestTerminalNetwork extends Network { List items = new LinkedList<>(); for (Location l : providers) { - Optional block = getAttachedBlock(l.getBlock()); + Optional block = getAttachedBlock(l); if (block.isPresent()) { Block target = block.get(); @@ -366,7 +403,7 @@ abstract class ChestTerminalNetwork extends Network { } if (add) { - items.add(new ItemStackAndInteger(new CustomItem(is, 1), is.getAmount() + stored)); + items.add(new ItemStackAndInteger(is, is.getAmount() + stored)); } } } @@ -378,19 +415,19 @@ abstract class ChestTerminalNetwork extends Network { } } - private void filter(ItemStack is, List items, Location l) { - if (is != null && CargoUtils.matchesFilter(l.getBlock(), is)) { + private void filter(ItemStack stack, List items, Location node) { + if (stack != null && CargoUtils.matchesFilter(node.getBlock(), stack)) { boolean add = true; for (ItemStackAndInteger item : items) { - if (SlimefunUtils.isItemSimilar(is, item.getItem(), true)) { + if (SlimefunUtils.isItemSimilar(stack, item.getItem(), true)) { add = false; - item.add(is.getAmount()); + item.add(stack.getAmount()); } } if (add) { - items.add(new ItemStackAndInteger(new CustomItem(is, 1), is.getAmount())); + items.add(new ItemStackAndInteger(stack, stack.getAmount())); } } } 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..b73fd8cf2 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 @@ -3,6 +3,8 @@ package io.github.thebusybiscuit.slimefun4.core.networks.energy; import java.util.HashSet; import java.util.Optional; import java.util.Set; +import java.util.concurrent.atomic.AtomicLong; +import java.util.function.LongConsumer; import org.bukkit.Location; import org.bukkit.Material; @@ -13,10 +15,11 @@ 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.SlimefunItems; +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; @@ -127,6 +130,8 @@ public class EnergyNet extends Network { } public void tick(Block b) { + AtomicLong timestamp = new AtomicLong(SlimefunPlugin.getProfiler().newEntry()); + if (!regulator.equals(b.getLocation())) { SimpleHologram.update(b, "&4Multiple Energy Regulators connected"); return; @@ -138,85 +143,90 @@ public class EnergyNet extends Network { SimpleHologram.update(b, "&4No Energy Network found"); } else { - double supply = DoubleHandler.fixDouble(tickAllGenerators() + tickAllCapacitors()); + double supply = DoubleHandler.fixDouble(tickAllGenerators(timestamp::getAndAdd) + tickAllCapacitors()); double demand = 0; - int available = (int) supply; + int availableEnergy = (int) supply; - for (Location destination : consumers) { - int capacity = ChargableBlock.getMaxCharge(destination); - int charge = ChargableBlock.getCharge(destination); + for (Location machine : consumers) { + int capacity = ChargableBlock.getMaxCharge(machine); + int charge = ChargableBlock.getCharge(machine); if (charge < capacity) { - int rest = capacity - charge; - demand += rest; + int availableSpace = capacity - charge; + demand += availableSpace; - if (available > 0) { - if (available > rest) { - ChargableBlock.setUnsafeCharge(destination, capacity, false); - available = available - rest; + if (availableEnergy > 0) { + if (availableEnergy > availableSpace) { + ChargableBlock.setUnsafeCharge(machine, capacity, false); + availableEnergy -= availableSpace; } else { - ChargableBlock.setUnsafeCharge(destination, charge + available, false); - available = 0; + ChargableBlock.setUnsafeCharge(machine, charge + availableEnergy, false); + availableEnergy = 0; } } } } - for (Location battery : storage) { - if (available > 0) { - int capacity = ChargableBlock.getMaxCharge(battery); + storeExcessEnergy(availableEnergy); + updateHologram(b, supply, demand); + } + // We have subtracted the timings from Generators, so they do not show up twice. + SlimefunPlugin.getProfiler().closeEntry(b.getLocation(), SlimefunItems.ENERGY_REGULATOR.getItem(), timestamp.get()); + } + + private void storeExcessEnergy(int available) { + for (Location capacitor : storage) { + if (available > 0) { + int capacity = ChargableBlock.getMaxCharge(capacitor); + + if (available > capacity) { + ChargableBlock.setUnsafeCharge(capacitor, capacity, true); + available -= capacity; + } + else { + ChargableBlock.setUnsafeCharge(capacitor, available, true); + available = 0; + } + } + else { + ChargableBlock.setUnsafeCharge(capacitor, 0, true); + } + } + + for (Location generator : generators) { + int capacity = ChargableBlock.getMaxCharge(generator); + + if (capacity > 0) { + if (available > 0) { if (available > capacity) { - ChargableBlock.setUnsafeCharge(battery, capacity, true); + ChargableBlock.setUnsafeCharge(generator, capacity, false); available = available - capacity; } else { - ChargableBlock.setUnsafeCharge(battery, available, true); + ChargableBlock.setUnsafeCharge(generator, available, false); available = 0; } } else { - ChargableBlock.setUnsafeCharge(battery, 0, true); + ChargableBlock.setUnsafeCharge(generator, 0, false); } } - - for (Location source : generators) { - if (ChargableBlock.isChargable(source)) { - if (available > 0) { - int capacity = ChargableBlock.getMaxCharge(source); - - if (available > capacity) { - ChargableBlock.setUnsafeCharge(source, capacity, false); - available = available - capacity; - } - else { - ChargableBlock.setUnsafeCharge(source, available, false); - available = 0; - } - } - else { - ChargableBlock.setUnsafeCharge(source, 0, false); - } - } - } - - updateHologram(b, supply, demand); } } - private double tickAllGenerators() { + private double tickAllGenerators(LongConsumer timeCallback) { double supply = 0; Set exploded = new HashSet<>(); for (Location source : generators) { - long timestamp = System.currentTimeMillis(); - SlimefunItem item = BlockStorage.check(source); + long timestamp = SlimefunPlugin.getProfiler().newEntry(); + Config config = BlockStorage.getLocationInfo(source); + SlimefunItem item = SlimefunItem.getByID(config.getString("id")); if (item != null) { - Config config = BlockStorage.getLocationInfo(source); - try { GeneratorTicker generator = item.getEnergyTicker(); @@ -247,7 +257,8 @@ public class EnergyNet extends Network { new ErrorReport(t, source, item); } - SlimefunPlugin.getTicker().addBlockTimings(source, System.currentTimeMillis() - timestamp); + long time = SlimefunPlugin.getProfiler().closeEntry(source, item, timestamp); + timeCallback.accept(time); } else { // This block seems to be gone now, better remove it to be extra safe @@ -263,8 +274,8 @@ public class EnergyNet extends Network { private double tickAllCapacitors() { double supply = 0; - for (Location battery : storage) { - supply += ChargableBlock.getCharge(battery); + for (Location capacitor : storage) { + supply += ChargableBlock.getCharge(capacitor); } return supply; 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 fab96c403..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; /** @@ -60,7 +60,7 @@ public class BackupService implements Runnable { } } catch (IOException x) { - Slimefun.getLogger().log(Level.SEVERE, x, () -> "An Error occured while creating a backup for Slimefun " + SlimefunPlugin.getVersion()); + Slimefun.getLogger().log(Level.SEVERE, x, () -> "An Error occurred while creating a backup for Slimefun " + SlimefunPlugin.getVersion()); } } } 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/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/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 bae567485..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; /** @@ -53,7 +53,7 @@ public class PerWorldSettingsService { migrate(); } catch (IOException e) { - plugin.getLogger().log(Level.WARNING, "An error occured while migrating old world settings", e); + plugin.getLogger().log(Level.WARNING, "An error occurred while migrating old world settings", e); } for (World world : worlds) { 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/Contributor.java b/src/main/java/io/github/thebusybiscuit/slimefun4/core/services/github/Contributor.java index 58251cb7c..9c1be58d5 100644 --- a/src/main/java/io/github/thebusybiscuit/slimefun4/core/services/github/Contributor.java +++ b/src/main/java/io/github/thebusybiscuit/slimefun4/core/services/github/Contributor.java @@ -13,6 +13,7 @@ import org.apache.commons.lang.Validate; import org.bukkit.ChatColor; import io.github.thebusybiscuit.cscorelib2.data.ComputedOptional; +import io.github.thebusybiscuit.slimefun4.implementation.SlimefunPlugin; import io.github.thebusybiscuit.slimefun4.utils.HeadTexture; /** @@ -132,7 +133,8 @@ public class Contributor { */ public String getTexture() { if (!headTexture.isComputed() || !headTexture.isPresent()) { - return HeadTexture.UNKNOWN.getTexture(); + String cached = SlimefunPlugin.getGitHubService().getCachedTexture(githubUsername); + return cached != null ? cached : HeadTexture.UNKNOWN.getTexture(); } else { return headTexture.get(); 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 73feca0b1..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 { @@ -98,7 +98,7 @@ abstract class GitHubConnector { onSuccess(element); } catch (IOException x) { - Slimefun.getLogger().log(Level.SEVERE, x, () -> "An Error occured while parsing GitHub-Data for Slimefun " + SlimefunPlugin.getVersion()); + Slimefun.getLogger().log(Level.SEVERE, x, () -> "An Error occurred while parsing GitHub-Data for Slimefun " + SlimefunPlugin.getVersion()); onFailure(); } } 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..1942eeb52 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,9 @@ 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.HeadTexture; import io.github.thebusybiscuit.slimefun4.utils.NumberUtils; -import me.mrCookieSlime.Slimefun.SlimefunPlugin; /** * This Service is responsible for grabbing every {@link Contributor} to this project @@ -30,7 +31,9 @@ public class GitHubService { private final String repository; private final Set connectors; private final ConcurrentMap contributors; + private final Config uuidCache = new Config("plugins/Slimefun/cache/github/uuids.yml"); + private final Config texturesCache = new Config("plugins/Slimefun/cache/github/skins.yml"); private boolean logging = false; @@ -73,10 +76,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; } @@ -194,18 +199,31 @@ public class GitHubService { } /** - * This will store the {@link UUID} of all {@link Contributor Contributors} in memory - * in a {@link File} to save requests the next time we iterate over them. + * This will store the {@link UUID} and texture of all {@link Contributor Contributors} + * in memory in a {@link File} to save requests the next time we iterate over them. */ - protected void saveUUIDCache() { + protected void saveCache() { for (Contributor contributor : contributors.values()) { Optional uuid = contributor.getUniqueId(); if (uuid.isPresent()) { uuidCache.setValue(contributor.getName(), uuid.get()); } + + if (contributor.hasTexture()) { + String texture = contributor.getTexture(); + + if (!texture.equals(HeadTexture.UNKNOWN.getTexture())) { + texturesCache.setValue(contributor.getName(), texture); + } + } } uuidCache.save(); + texturesCache.save(); + } + + protected String getCachedTexture(String name) { + return texturesCache.getString(name); } } 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..2f8ebe478 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; /** @@ -56,9 +56,9 @@ class GitHubTask implements Runnable { } } - if (requests >= MAX_REQUESTS_PER_MINUTE) { + if (requests >= MAX_REQUESTS_PER_MINUTE && SlimefunPlugin.instance() != null && SlimefunPlugin.instance().isEnabled()) { // Slow down API requests and wait a minute after more than x requests were made - Bukkit.getScheduler().runTaskLaterAsynchronously(SlimefunPlugin.instance, this::grabTextures, 2 * 60 * 20L); + Bukkit.getScheduler().runTaskLaterAsynchronously(SlimefunPlugin.instance(), this::grabTextures, 2 * 60 * 20L); } for (GitHubConnector connector : gitHubService.getConnectors()) { @@ -69,7 +69,7 @@ class GitHubTask implements Runnable { // We only wanna save this if all Connectors finished already // This will run multiple times but thats okay, this way we get as much data as possible stored - gitHubService.saveUUIDCache(); + gitHubService.saveCache(); } private int requestTexture(Contributor contributor, Map skins) { @@ -94,14 +94,14 @@ class GitHubTask implements Runnable { // Retry after 5 minutes if it was rate-limiting if (x.getMessage().contains("429")) { - Bukkit.getScheduler().runTaskLaterAsynchronously(SlimefunPlugin.instance, this::grabTextures, 5 * 60 * 20L); + Bukkit.getScheduler().runTaskLaterAsynchronously(SlimefunPlugin.instance(), this::grabTextures, 5 * 60 * 20L); } return -1; } catch (TooManyRequestsException x) { Slimefun.getLogger().log(Level.WARNING, "Received a rate-limit from mojang.com, retrying in 4 minutes"); - Bukkit.getScheduler().runTaskLaterAsynchronously(SlimefunPlugin.instance, this::grabTextures, 4 * 60 * 20L); + Bukkit.getScheduler().runTaskLaterAsynchronously(SlimefunPlugin.instance(), this::grabTextures, 4 * 60 * 20L); return -1; } 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/localization/SupportedLanguage.java b/src/main/java/io/github/thebusybiscuit/slimefun4/core/services/localization/SupportedLanguage.java index 63be7dcf6..b7231eaa1 100644 --- a/src/main/java/io/github/thebusybiscuit/slimefun4/core/services/localization/SupportedLanguage.java +++ b/src/main/java/io/github/thebusybiscuit/slimefun4/core/services/localization/SupportedLanguage.java @@ -39,11 +39,11 @@ enum SupportedLanguage { GREEK("el", false, "1514de6dd2b7682b1d3ebcd10291ae1f021e3012b5c8beffeb75b1819eb4259d"), SLOVAK("sk", true, "6c72a8c115a1fb669a25715c4d15f22136ac4c2452784e4894b3d56bc5b0b9"), VIETNAMESE("vi", true, "8a57b9d7dd04169478cfdb8d0b6fd0b8c82b6566bb28371ee9a7c7c1671ad0bb"), - INDONESIAN("id", false, "5db2678ccaba7934412cb97ee16d416463a392574c5906352f18dea42895ee"), + INDONESIAN("id", true, "5db2678ccaba7934412cb97ee16d416463a392574c5906352f18dea42895ee"), CHINESE_CHINA("zh-CN", true, "7f9bc035cdc80f1ab5e1198f29f3ad3fdd2b42d9a69aeb64de990681800b98dc"), CHINESE_TAIWAN("zh-TW", true, "702a4afb2e1e2e3a1894a8b74272f95cfa994ce53907f9ac140bd3c932f9f"), JAPANESE("ja", true, "d640ae466162a47d3ee33c4076df1cab96f11860f07edb1f0832c525a9e33323"), - KOREAN("kr", false, "fc1be5f12f45e413eda56f3de94e08d90ede8e339c7b1e8f32797390e9a5f"), + KOREAN("ko", false, "fc1be5f12f45e413eda56f3de94e08d90ede8e339c7b1e8f32797390e9a5f"), HEBREW("he", false, "1ba086a2cc7272cf5ba49c80248546c22e5ef1bab54120e8a8e5d9e75b6a"), ARABIC("ar", true, "a4be759a9cf7f0a19a7e8e62f23789ad1d21cebae38af9d9541676a3db001572"), TURKISH("tr", true, "9852b9aba3482348514c1034d0affe73545c9de679ae4647f99562b5e5f47d09"), diff --git a/src/main/java/io/github/thebusybiscuit/slimefun4/core/services/localization/Translators.java b/src/main/java/io/github/thebusybiscuit/slimefun4/core/services/localization/Translators.java index e9afa3edb..088856ec1 100644 --- a/src/main/java/io/github/thebusybiscuit/slimefun4/core/services/localization/Translators.java +++ b/src/main/java/io/github/thebusybiscuit/slimefun4/core/services/localization/Translators.java @@ -130,6 +130,10 @@ public class Translators { // Translators - Indonesian addTranslator("diradho", SupportedLanguage.INDONESIAN, false); + addTranslator("Frozenkamui", SupportedLanguage.INDONESIAN, false); + addTranslator("aril3721", SupportedLanguage.INDONESIAN, false); + addTranslator("JunederZ", SupportedLanguage.INDONESIAN, false); + addTranslator("EnderWingZ", SupportedLanguage.INDONESIAN, false); // Translators - Thai addTranslator("phoomin2012", SupportedLanguage.THAI, false); @@ -154,6 +158,8 @@ public class Translators { addTranslator("G4stavoM1ster", SupportedLanguage.PORTUGUESE_BRAZIL, true); addTranslator("yurinogueira", SupportedLanguage.PORTUGUESE_BRAZIL, true); addTranslator("Sakanas", SupportedLanguage.PORTUGUESE_BRAZIL, true); + addTranslator("krazybeat", SupportedLanguage.PORTUGUESE_BRAZIL, true); + addTranslator("FaolanMalcadh", SupportedLanguage.PORTUGUESE_BRAZIL, true); } private void addTranslator(String name, SupportedLanguage lang, boolean lock) { 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..457068e97 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,14 +9,14 @@ 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 { @Override public String getAuthor() { - return SlimefunPlugin.instance.getDescription().getAuthors().toString(); + return SlimefunPlugin.instance().getDescription().getAuthors().toString(); } @Override @@ -26,7 +26,7 @@ class PlaceholderAPIHook extends PlaceholderExpansion { @Override public String getVersion() { - return SlimefunPlugin.instance.getDescription().getVersion(); + return SlimefunPlugin.instance().getDescription().getVersion(); } @Override @@ -85,7 +85,7 @@ class PlaceholderAPIHook extends PlaceholderExpansion { } if (params.equals("timings_lag")) { - return SlimefunPlugin.getTicker().getTime() + "ms"; + return SlimefunPlugin.getProfiler().getTime(); } 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/core/services/profiler/PerformanceRating.java b/src/main/java/io/github/thebusybiscuit/slimefun4/core/services/profiler/PerformanceRating.java new file mode 100644 index 000000000..2e549ef20 --- /dev/null +++ b/src/main/java/io/github/thebusybiscuit/slimefun4/core/services/profiler/PerformanceRating.java @@ -0,0 +1,52 @@ +package io.github.thebusybiscuit.slimefun4.core.services.profiler; + +import java.util.function.Predicate; + +import org.bukkit.ChatColor; + +/** + * This enum is used to quantify Slimefun's performance impact. This way we can assign a + * "grade" to each timings report and also use this for metrics collection. + * + * @author TheBusyBiscuit + * + * @see SlimefunProfiler + * + */ +public enum PerformanceRating implements Predicate { + + // Thresholds might change in the future! + + UNKNOWN(ChatColor.WHITE, -1), + + GOOD(ChatColor.DARK_GREEN, 10), + FINE(ChatColor.DARK_GREEN, 20), + OKAY(ChatColor.GREEN, 30), + MODERATE(ChatColor.YELLOW, 55), + SEVERE(ChatColor.RED, 85), + HURTFUL(ChatColor.DARK_RED, 500), + BAD(ChatColor.DARK_RED, Float.MAX_VALUE); + + private final ChatColor color; + private final float threshold; + + PerformanceRating(ChatColor color, float threshold) { + this.color = color; + this.threshold = threshold; + } + + @Override + public boolean test(Float value) { + if (value == null) { + // null will only test true for UNKNOWN + return threshold < 0; + } + + return value <= threshold; + } + + public ChatColor getColor() { + return color; + } + +} diff --git a/src/main/java/io/github/thebusybiscuit/slimefun4/core/services/profiler/PerformanceSummary.java b/src/main/java/io/github/thebusybiscuit/slimefun4/core/services/profiler/PerformanceSummary.java new file mode 100644 index 000000000..f23ed6e54 --- /dev/null +++ b/src/main/java/io/github/thebusybiscuit/slimefun4/core/services/profiler/PerformanceSummary.java @@ -0,0 +1,195 @@ +package io.github.thebusybiscuit.slimefun4.core.services.profiler; + +import java.util.Comparator; +import java.util.List; +import java.util.Map; +import java.util.Map.Entry; +import java.util.function.Function; +import java.util.stream.Collectors; +import java.util.stream.Stream; + +import org.bukkit.command.CommandSender; +import org.bukkit.entity.Player; + +import io.github.thebusybiscuit.cscorelib2.chat.ChatColors; +import io.github.thebusybiscuit.slimefun4.utils.ChatUtils; +import io.github.thebusybiscuit.slimefun4.utils.NumberUtils; +import net.md_5.bungee.api.ChatColor; +import net.md_5.bungee.api.chat.HoverEvent; +import net.md_5.bungee.api.chat.TextComponent; + +class PerformanceSummary { + + // The threshold at which a Block or Chunk is significant enough to appear in /sf timings + private static final int VISIBILITY_THRESHOLD = 280_000; + private static final int MIN_ITEMS = 3; + private static final int MAX_ITEMS = 10; + + private final SlimefunProfiler profiler; + private final PerformanceRating rating; + private final long totalElapsedTime; + private final int totalTickedBlocks; + private final float percentage; + + private final Map chunks; + private final Map plugins; + private final Map items; + + PerformanceSummary(SlimefunProfiler profiler, long totalElapsedTime, int totalTickedBlocks) { + this.profiler = profiler; + this.rating = profiler.getPerformance(); + this.percentage = profiler.getPercentageOfTick(); + this.totalElapsedTime = totalElapsedTime; + this.totalTickedBlocks = totalTickedBlocks; + + chunks = profiler.getByChunk(); + plugins = profiler.getByPlugin(); + items = profiler.getByItem(); + } + + public void send(CommandSender sender) { + sender.sendMessage(""); + sender.sendMessage(ChatColor.GREEN + "===== Slimefun Lag Profiler ====="); + sender.sendMessage(ChatColor.GOLD + "Total: " + ChatColor.YELLOW + NumberUtils.getAsMillis(totalElapsedTime)); + sender.sendMessage(ChatColor.GOLD + "Performance: " + getPerformanceRating()); + sender.sendMessage(""); + + summarizeTimings(totalTickedBlocks, "block", sender, items, entry -> { + int count = profiler.getBlocksOfId(entry.getKey()); + String time = NumberUtils.getAsMillis(entry.getValue()); + + if (count > 1) { + String average = NumberUtils.getAsMillis(entry.getValue() / count); + + return entry.getKey() + " - " + count + "x (" + time + " | avg: " + average + ')'; + } + else { + return entry.getKey() + " - " + count + "x (" + time + ')'; + } + }); + + summarizeTimings(chunks.size(), "chunk", sender, chunks, entry -> { + int count = profiler.getBlocksInChunk(entry.getKey()); + String time = NumberUtils.getAsMillis(entry.getValue()); + + return entry.getKey() + " - " + count + " block" + (count != 1 ? 's' : "") + " (" + time + ")"; + }); + + summarizeTimings(plugins.size(), "plugin", sender, plugins, entry -> { + int count = profiler.getBlocksFromPlugin(entry.getKey()); + String time = NumberUtils.getAsMillis(entry.getValue()); + + return entry.getKey() + " - " + count + " block" + (count != 1 ? 's' : "") + " (" + time + ")"; + }); + } + + private void summarizeTimings(int count, String name, CommandSender sender, Map map, Function, String> formatter) { + Stream> stream = map.entrySet().stream(); + List> results = stream.sorted(Map.Entry.comparingByValue(Comparator.reverseOrder())).collect(Collectors.toList()); + String prefix = count + " " + name + (count != 1 ? 's' : ""); + + if (sender instanceof Player) { + TextComponent component = summarizeAsTextComponent(count, prefix, results, formatter); + sender.spigot().sendMessage(component); + } + else { + String text = summarizeAsString(count, prefix, results, formatter); + sender.sendMessage(text); + } + } + + private TextComponent summarizeAsTextComponent(int count, String prefix, List> results, Function, String> formatter) { + TextComponent component = new TextComponent(prefix); + component.setColor(ChatColor.YELLOW); + + if (count > 0) { + TextComponent hoverComponent = new TextComponent(" (Hover for details)"); + hoverComponent.setColor(ChatColor.GRAY); + StringBuilder builder = new StringBuilder(); + + int displayed = 0; + int hidden = 0; + + for (Map.Entry entry : results) { + if (displayed < MAX_ITEMS && (displayed < MIN_ITEMS || entry.getValue() > VISIBILITY_THRESHOLD)) { + builder.append("\n").append(ChatColor.YELLOW).append(formatter.apply(entry)); + displayed++; + } + else { + hidden++; + } + } + + if (hidden > 0) { + builder.append("\n\n&c+ &6").append(hidden).append(" more"); + } + + hoverComponent.setHoverEvent(new HoverEvent(HoverEvent.Action.SHOW_TEXT, TextComponent.fromLegacyText(ChatColors.color(builder.toString())))); + + component.addExtra(hoverComponent); + } + + return component; + } + + private String summarizeAsString(int count, String prefix, List> results, Function, String> formatter) { + int displayed = 0; + int hidden = 0; + + StringBuilder builder = new StringBuilder(); + builder.append(ChatColor.GOLD); + builder.append(prefix); + + if (count > 0) { + builder.append(ChatColor.YELLOW); + + for (Map.Entry entry : results) { + if (displayed < MAX_ITEMS && (displayed < MIN_ITEMS || entry.getValue() > VISIBILITY_THRESHOLD)) { + builder.append("\n "); + builder.append(ChatColor.stripColor(formatter.apply(entry))); + displayed++; + } + else { + hidden++; + } + } + + if (hidden > 0) { + builder.append("\n+ "); + builder.append(hidden); + builder.append(" more..."); + } + } + + return builder.toString(); + } + + private String getPerformanceRating() { + StringBuilder builder = new StringBuilder(); + builder.append(NumberUtils.getColorFromPercentage(100 - Math.min(percentage, 100))); + + int rest = 20; + for (int i = (int) Math.min(percentage, 100); i >= 5; i = i - 5) { + builder.append(':'); + rest--; + } + + builder.append(ChatColor.DARK_GRAY); + + for (int i = 0; i < rest; i++) { + builder.append(':'); + } + + builder.append(" - "); + + builder.append(rating.getColor() + ChatUtils.humanize(rating.name())); + + builder.append(ChatColor.GRAY); + builder.append(" ("); + builder.append(NumberUtils.roundDecimalNumber(percentage)); + builder.append("%)"); + + return builder.toString(); + } + +} diff --git a/src/main/java/io/github/thebusybiscuit/slimefun4/core/services/profiler/ProfiledBlock.java b/src/main/java/io/github/thebusybiscuit/slimefun4/core/services/profiler/ProfiledBlock.java new file mode 100644 index 000000000..70c5c2549 --- /dev/null +++ b/src/main/java/io/github/thebusybiscuit/slimefun4/core/services/profiler/ProfiledBlock.java @@ -0,0 +1,49 @@ +package io.github.thebusybiscuit.slimefun4.core.services.profiler; + +import org.bukkit.block.Block; + +import io.github.thebusybiscuit.cscorelib2.blocks.BlockPosition; +import io.github.thebusybiscuit.slimefun4.api.SlimefunAddon; +import me.mrCookieSlime.Slimefun.Objects.SlimefunItem.SlimefunItem; + +class ProfiledBlock { + + private final BlockPosition position; + private final SlimefunItem item; + + ProfiledBlock(BlockPosition position, SlimefunItem item) { + this.position = position; + this.item = item; + } + + ProfiledBlock(Block b) { + this(new BlockPosition(b), null); + } + + public BlockPosition getPosition() { + return position; + } + + public String getId() { + return item.getID(); + } + + public SlimefunAddon getAddon() { + return item.getAddon(); + } + + @Override + public boolean equals(Object obj) { + if (obj instanceof ProfiledBlock) { + return position.equals(((ProfiledBlock) obj).position); + } + + return false; + } + + @Override + public int hashCode() { + return position.hashCode(); + } + +} diff --git a/src/main/java/io/github/thebusybiscuit/slimefun4/core/services/profiler/SlimefunProfiler.java b/src/main/java/io/github/thebusybiscuit/slimefun4/core/services/profiler/SlimefunProfiler.java new file mode 100644 index 000000000..c5c567472 --- /dev/null +++ b/src/main/java/io/github/thebusybiscuit/slimefun4/core/services/profiler/SlimefunProfiler.java @@ -0,0 +1,314 @@ +package io.github.thebusybiscuit.slimefun4.core.services.profiler; + +import java.util.HashMap; +import java.util.Iterator; +import java.util.Map; +import java.util.Queue; +import java.util.concurrent.ConcurrentHashMap; +import java.util.concurrent.ConcurrentLinkedQueue; +import java.util.concurrent.ExecutorService; +import java.util.concurrent.Executors; +import java.util.concurrent.atomic.AtomicBoolean; +import java.util.concurrent.atomic.AtomicInteger; + +import org.apache.commons.lang.Validate; +import org.bukkit.Chunk; +import org.bukkit.Location; +import org.bukkit.Server; +import org.bukkit.block.Block; +import org.bukkit.command.CommandSender; + +import io.github.thebusybiscuit.cscorelib2.blocks.BlockPosition; +import io.github.thebusybiscuit.slimefun4.api.SlimefunAddon; +import io.github.thebusybiscuit.slimefun4.implementation.SlimefunPlugin; +import io.github.thebusybiscuit.slimefun4.implementation.tasks.TickerTask; +import io.github.thebusybiscuit.slimefun4.utils.NumberUtils; +import me.mrCookieSlime.Slimefun.Objects.SlimefunItem.SlimefunItem; + +/** + * The {@link SlimefunProfiler} works closely to the {@link TickerTask} and is + * responsible for monitoring that task. + * It collects timings data for any ticked {@link Block} and the corresponding {@link SlimefunItem}. + * This allows developers to identify laggy {@link SlimefunItem SlimefunItems} or {@link SlimefunAddon SlimefunAddons}. + * But it also enables Server Admins to locate lag-inducing areas on the {@link Server}. + * + * @author TheBusyBiscuit + * + * @see TickerTask + * + */ +public class SlimefunProfiler { + + // A minecraft server tick is 50ms and Slimefun ticks are stretched across + // two ticks (sync and async blocks), so we use 100ms as a reference here + private static final int MAX_TICK_DURATION = 100; + + private final ExecutorService executor = Executors.newFixedThreadPool(4); + private final AtomicBoolean running = new AtomicBoolean(false); + private final AtomicInteger queued = new AtomicInteger(0); + + private long totalElapsedTime; + + private final Map timings = new ConcurrentHashMap<>(); + private final Queue requests = new ConcurrentLinkedQueue<>(); + + /** + * This method starts the profiling, data from previous runs will be cleared. + */ + public void start() { + running.set(true); + queued.set(0); + timings.clear(); + } + + /** + * This method starts a new profiler entry. + * + * @return A timestamp, best fed back into {@link #closeEntry(Location, SlimefunItem, long)} + */ + public long newEntry() { + if (!running.get()) { + return 0; + } + + queued.incrementAndGet(); + return System.nanoTime(); + } + + /** + * This method schedules a given amount of entries for the future. + * Be careful to {@link #closeEntry(Location, SlimefunItem, long)} all of them again! + * No {@link PerformanceSummary} will be sent until all entires were closed. + * + * @param amount + * The amount of entries that should be scheduled. + */ + public void scheduleEntries(int amount) { + if (running.get()) { + queued.getAndAdd(amount); + } + } + + /** + * This method closes a previously started entry. + * Make sure to call {@link #newEntry()} to get the timestamp in advance. + * + * @param l + * The {@link Location} of our {@link Block} + * @param item + * The {@link SlimefunItem} at this {@link Location} + * @param timestamp + * The timestamp marking the start of this entry, you can retrieve it using {@link #newEntry()} + * + * @return The total timings of this entry + */ + public long closeEntry(Location l, SlimefunItem item, long timestamp) { + Validate.notNull(l, "Location must not be null!"); + Validate.notNull(item, "You need to specify a SlimefunItem!"); + + if (timestamp == 0) { + return 0; + } + + long elapsedTime = System.nanoTime() - timestamp; + + executor.execute(() -> { + ProfiledBlock block = new ProfiledBlock(new BlockPosition(l), item); + timings.put(block, elapsedTime); + queued.decrementAndGet(); + }); + + return elapsedTime; + } + + /** + * This stops the profiling. + */ + public void stop() { + running.set(false); + + if (SlimefunPlugin.instance() == null || !SlimefunPlugin.instance().isEnabled()) { + // Slimefun has been disabled + return; + } + + // Since we got more than one Thread in our pool, blocking this one is completely fine + executor.execute(() -> { + + // Wait for all timing results to come in + while (queued.get() > 0 && !running.get()) { + // Ideally we would wait some time here but the ticker task may be faster + // than 1ms, so it would halt this summary for up to 7 minutes + // Not perfect performance-wise but this is a seperate Thread anyway + } + + if (running.get()) { + // Looks like the next profiling has already started, abort! + return; + } + + totalElapsedTime = timings.values().stream().mapToLong(Long::longValue).sum(); + + if (!requests.isEmpty()) { + PerformanceSummary summary = new PerformanceSummary(this, totalElapsedTime, timings.size()); + Iterator iterator = requests.iterator(); + + while (iterator.hasNext()) { + summary.send(iterator.next()); + iterator.remove(); + } + } + }); + + } + + /** + * This method requests a summary for the given {@link CommandSender}. + * The summary will be sent upon the next available moment in time. + * + * @param sender + * The {@link CommandSender} who shall receive this summary. + */ + public void requestSummary(CommandSender sender) { + Validate.notNull(sender, "Cannot request a summary for null"); + + requests.add(sender); + } + + protected Map getByItem() { + Map map = new HashMap<>(); + + for (Map.Entry entry : timings.entrySet()) { + map.merge(entry.getKey().getId(), entry.getValue(), Long::sum); + } + + return map; + } + + protected Map getByPlugin() { + Map map = new HashMap<>(); + + for (Map.Entry entry : timings.entrySet()) { + map.merge(entry.getKey().getAddon().getName(), entry.getValue(), Long::sum); + } + + return map; + } + + protected Map getByChunk() { + Map map = new HashMap<>(); + + for (Map.Entry entry : timings.entrySet()) { + String world = entry.getKey().getPosition().getWorld().getName(); + int x = entry.getKey().getPosition().getChunkX(); + int z = entry.getKey().getPosition().getChunkZ(); + + map.merge(world + " (" + x + ',' + z + ')', entry.getValue(), Long::sum); + } + + return map; + } + + protected int getBlocksInChunk(String chunk) { + int blocks = 0; + + for (ProfiledBlock block : timings.keySet()) { + String world = block.getPosition().getWorld().getName(); + int x = block.getPosition().getChunkX(); + int z = block.getPosition().getChunkZ(); + + if (chunk.equals(world + " (" + x + ',' + z + ')')) { + blocks++; + } + } + + return blocks; + } + + protected int getBlocksOfId(String id) { + int blocks = 0; + + for (ProfiledBlock block : timings.keySet()) { + if (block.getId().equals(id)) { + blocks++; + } + } + + return blocks; + } + + protected int getBlocksFromPlugin(String id) { + int blocks = 0; + + for (ProfiledBlock block : timings.keySet()) { + if (block.getAddon().getName().equals(id)) { + blocks++; + } + } + + return blocks; + } + + protected float getPercentageOfTick() { + float millis = totalElapsedTime / 1000000.0F; + float fraction = (millis * 100.0F) / MAX_TICK_DURATION; + return Math.round((fraction * 100.0F) / 100.0F); + } + + /** + * This method returns the current {@link PerformanceRating}. + * + * @return The current performance grade + */ + public PerformanceRating getPerformance() { + float percentage = getPercentageOfTick(); + + for (PerformanceRating rating : PerformanceRating.values()) { + if (rating.test(percentage)) { + return rating; + } + } + + return PerformanceRating.UNKNOWN; + } + + public String getTime() { + return NumberUtils.getAsMillis(totalElapsedTime); + } + + /** + * This method checks whether the {@link SlimefunProfiler} has collected timings on + * the given {@link Block} + * + * @param b + * The {@link Block} + * + * @return Whether timings of this {@link Block} have been collected + */ + public boolean hasTimings(Block b) { + Validate.notNull("Cannot get timings for a null Block"); + return timings.containsKey(new ProfiledBlock(b)); + } + + public String getTime(Block b) { + Validate.notNull("Cannot get timings for a null Block"); + + long time = timings.getOrDefault(new ProfiledBlock(b), 0L); + return NumberUtils.getAsMillis(time); + } + + public String getTime(Chunk chunk) { + Validate.notNull("Cannot get timings for a null Chunk"); + + long time = getByChunk().getOrDefault(chunk.getWorld().getName() + " (" + chunk.getX() + ',' + chunk.getZ() + ')', 0L); + return NumberUtils.getAsMillis(time); + } + + public String getTime(SlimefunItem item) { + Validate.notNull("Cannot get timings for a null SlimefunItem"); + + long time = getByItem().getOrDefault(item.getID(), 0L); + return NumberUtils.getAsMillis(time); + } + +} diff --git a/src/main/java/io/github/thebusybiscuit/slimefun4/core/services/profiler/package-info.java b/src/main/java/io/github/thebusybiscuit/slimefun4/core/services/profiler/package-info.java new file mode 100644 index 000000000..62b32be85 --- /dev/null +++ b/src/main/java/io/github/thebusybiscuit/slimefun4/core/services/profiler/package-info.java @@ -0,0 +1,9 @@ +/** + * This package holds classes related to the + * {@link io.github.thebusybiscuit.slimefun4.core.services.profiler.SlimefunProfiler}. + * The {@link io.github.thebusybiscuit.slimefun4.core.services.profiler.SlimefunProfiler} is used to determine + * {@link org.bukkit.block.Block Blocks}, {@link org.bukkit.Chunk Chunks} or + * {@link me.mrCookieSlime.Slimefun.Objects.SlimefunItem.SlimefunItem SlimefunItems} that cause lag or performance + * drops. + */ +package io.github.thebusybiscuit.slimefun4.core.services.profiler; \ No newline at end of file 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 5ba9dde2a..589a50813 100644 --- a/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/SlimefunItems.java +++ b/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/SlimefunItems.java @@ -1,8 +1,11 @@ package io.github.thebusybiscuit.slimefun4.implementation; +import java.util.ArrayList; import java.util.HashMap; +import java.util.List; import java.util.Map; +import org.bukkit.ChatColor; import org.bukkit.Color; import org.bukkit.Material; import org.bukkit.enchantments.Enchantment; @@ -20,7 +23,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; /** @@ -36,31 +38,33 @@ public final class SlimefunItems { /* Items */ public static final SlimefunItemStack PORTABLE_CRAFTER = new SlimefunItemStack("PORTABLE_CRAFTER", HeadTexture.PORTABLE_CRAFTER, "&6Portable Crafter", "&a&oA portable Crafting Table", "", LoreBuilder.RIGHT_CLICK_TO_OPEN); - public static final SlimefunItemStack PORTABLE_DUSTBIN = new SlimefunItemStack("PORTABLE_DUSTBIN", HeadTexture.TRASH_CAN, "&6Portable Dustbin", "&rYour portable Item-Destroyer", "", LoreBuilder.RIGHT_CLICK_TO_OPEN); + public static final SlimefunItemStack PORTABLE_DUSTBIN = new SlimefunItemStack("PORTABLE_DUSTBIN", HeadTexture.TRASH_CAN, "&6Portable Dustbin", "&fYour portable Item-Destroyer", "", LoreBuilder.RIGHT_CLICK_TO_OPEN); public static final SlimefunItemStack ENDER_BACKPACK = new SlimefunItemStack("ENDER_BACKPACK", HeadTexture.ENDER_BACKPACK, "&6Ender Backpack", "&a&oA portable Ender Chest", "", LoreBuilder.RIGHT_CLICK_TO_OPEN); public static final SlimefunItemStack MAGIC_EYE_OF_ENDER = new SlimefunItemStack("MAGIC_EYE_OF_ENDER", Material.ENDER_EYE, "&6&lMagic Eye of Ender", "&4&lRequires full Ender Armor", "", "&7&eRight Click&7 to shoot an Ender Pearl"); public static final SlimefunItemStack BROKEN_SPAWNER = new SlimefunItemStack("BROKEN_SPAWNER", Material.SPAWNER, "&cBroken Spawner", "&7Type: &b", "", "&cFractured, must be repaired in an Ancient Altar"); public static final SlimefunItemStack REPAIRED_SPAWNER = new SlimefunItemStack("REINFORCED_SPAWNER", Material.SPAWNER, "&bReinforced Spawner", "&7Type: &b"); public static final SlimefunItemStack INFERNAL_BONEMEAL = new SlimefunItemStack("INFERNAL_BONEMEAL", Material.BONE_MEAL, "&4Infernal Bonemeal", "", "&cSpeeds up the Growth of", "&cNether Warts as well"); - + public static final SlimefunItemStack TAPE_MEASURE = new SlimefunItemStack("TAPE_MEASURE", "180d5c43a6cf5bb7769fd0c8240e1e70d2ae38ef9d78a1db401aca6a2cb36f65", "&6Tape Measure", "", "&eCrouch & Right Click &7to set an anchor", "&eRight Click &7to measure"); + /* Gadgets */ - public static final SlimefunItemStack GOLD_PAN = new SlimefunItemStack("GOLD_PAN", Material.BOWL, "&6Gold Pan", "&a&oCan get you all kinds of Goodies...", "", "&7&eRight Click&7 to pan various Stuff out of Gravel"); - public static final SlimefunItemStack NETHER_GOLD_PAN = new SlimefunItemStack("NETHER_GOLD_PAN", Material.BOWL, "&4Nether Gold Pan", "", "&7&eRight Click&7 to pan various stuff out of Soul Sand"); - public static final SlimefunItemStack PARACHUTE = new SlimefunItemStack("PARACHUTE", Material.LEATHER_CHESTPLATE, Color.WHITE, "&r&lParachute", "", LoreBuilder.CROUCH_TO_USE); + public static final SlimefunItemStack GOLD_PAN = new SlimefunItemStack("GOLD_PAN", Material.BOWL, "&6Gold Pan", "", "&eRight Click&7 to collect resources", "&7from Gravel"); + public static final SlimefunItemStack NETHER_GOLD_PAN = new SlimefunItemStack("NETHER_GOLD_PAN", Material.BOWL, "&4Nether Gold Pan", "", "&eRight Click&7 to collect resources", "&7from Soul Sand"); + public static final SlimefunItemStack PARACHUTE = new SlimefunItemStack("PARACHUTE", Material.LEATHER_CHESTPLATE, Color.WHITE, "&f&lParachute", "", LoreBuilder.CROUCH_TO_USE); public static final SlimefunItemStack GRAPPLING_HOOK = new SlimefunItemStack("GRAPPLING_HOOK", Material.LEAD, "&6Grappling Hook", "", LoreBuilder.RIGHT_CLICK_TO_USE); public static final SlimefunItemStack SOLAR_HELMET = new SlimefunItemStack("SOLAR_HELMET", Material.IRON_HELMET, "&bSolar Helmet", "", "&a&oCharges held Items and Armor"); public static final SlimefunItemStack CLOTH = new SlimefunItemStack("CLOTH", Material.PAPER, "&bCloth"); - public static final SlimefunItemStack TIN_CAN = new SlimefunItemStack("CAN", HeadTexture.TIN_CAN, "&rTin Can"); + public static final SlimefunItemStack REINFORCED_CLOTH = new SlimefunItemStack("REINFORCED_CLOTH", Material.PAPER, "&bReinforced Cloth", "", "&fThis cloth has been reinforced", "&fwith &bLead &fto protect against", "&fradioactive substances"); + public static final SlimefunItemStack TIN_CAN = new SlimefunItemStack("CAN", HeadTexture.TIN_CAN, "&fTin Can"); public static final SlimefunItemStack NIGHT_VISION_GOGGLES = new SlimefunItemStack("NIGHT_VISION_GOGGLES", Material.LEATHER_HELMET, Color.BLACK, "&aNight Vision Goggles", "", "&9+ Night Vision"); public static final SlimefunItemStack FARMER_SHOES = new SlimefunItemStack("FARMER_SHOES", Material.LEATHER_BOOTS, Color.YELLOW, "&eFarmer Shoes", "", "&6&oPrevents you from trampling your Crops"); - public static final SlimefunItemStack INFUSED_MAGNET = new SlimefunItemStack("INFUSED_MAGNET", HeadTexture.MAGNET, "&aInfused Magnet", "", "&rMagical infused Magnets", "&rattract nearby Items", "&ras long as it is somewhere in", "&ryour Inventory", "", "&7Hold &eShift&7 to pick up nearby Items"); - public static final SlimefunItemStack RAG = new SlimefunItemStack("RAG", Material.PAPER, "&cRag", "", "&aLevel I - Medical Supply", "", "&rRestores 2 Hearts", "&rExtinguishes Fire", "", LoreBuilder.RIGHT_CLICK_TO_USE); - public static final SlimefunItemStack BANDAGE = new SlimefunItemStack("BANDAGE", Material.PAPER, "&cBandage", "", "&aLevel II - Medical Supply", "", "&rRestores 4 Hearts", "&rExtinguishes Fire", "", LoreBuilder.RIGHT_CLICK_TO_USE); - public static final SlimefunItemStack SPLINT = new SlimefunItemStack("SPLINT", Material.STICK, "&cSplint", "", "&aLevel I - Medical Supply", "", "&rRestores 2 Hearts", "", LoreBuilder.RIGHT_CLICK_TO_USE); - public static final SlimefunItemStack VITAMINS = new SlimefunItemStack("VITAMINS", Material.NETHER_WART, "&cVitamins", "", "&aLevel III - Medical Supply", "", "&rRestores 4 Hearts", "&rExtinguishes Fire", "&rCures Poison/Wither/Radiation", "", LoreBuilder.RIGHT_CLICK_TO_USE); - public static final SlimefunItemStack MEDICINE = new SlimefunItemStack("MEDICINE", Material.POTION, Color.RED, "&cMedicine", "", "&aLevel III - Medical Supply", "", "&rRestores 4 Hearts", "&rExtinguishes Fire", "&rCures Poison/Wither/Radiation"); + public static final SlimefunItemStack INFUSED_MAGNET = new SlimefunItemStack("INFUSED_MAGNET", HeadTexture.MAGNET, "&aInfused Magnet", "", "&fMagical infused Magnets", "&fattract nearby Items", "&fas long as it is somewhere in", "&fyour Inventory", "", "&7Hold &eShift&7 to pick up nearby Items"); + public static final SlimefunItemStack RAG = new SlimefunItemStack("RAG", Material.PAPER, "&cRag", "", "&aLevel I - Medical Supply", "", "&fRestores 2 Hearts", "&fExtinguishes Fire", "", LoreBuilder.RIGHT_CLICK_TO_USE); + public static final SlimefunItemStack BANDAGE = new SlimefunItemStack("BANDAGE", Material.PAPER, "&cBandage", "", "&aLevel II - Medical Supply", "", "&fRestores 4 Hearts", "&fExtinguishes Fire", "", LoreBuilder.RIGHT_CLICK_TO_USE); + public static final SlimefunItemStack SPLINT = new SlimefunItemStack("SPLINT", Material.STICK, "&cSplint", "", "&aLevel I - Medical Supply", "", "&fRestores 2 Hearts", "", LoreBuilder.RIGHT_CLICK_TO_USE); + public static final SlimefunItemStack VITAMINS = new SlimefunItemStack("VITAMINS", Material.NETHER_WART, "&cVitamins", "", "&aLevel III - Medical Supply", "", "&fRestores 4 Hearts", "&fExtinguishes Fire", "&fCures Poison/Wither/Radiation", "", LoreBuilder.RIGHT_CLICK_TO_USE); + public static final SlimefunItemStack MEDICINE = new SlimefunItemStack("MEDICINE", Material.POTION, Color.RED, "&cMedicine", "", "&aLevel III - Medical Supply", "", "&fRestores 4 Hearts", "&fExtinguishes Fire", "&fCures Poison/Wither/Radiation"); - public static final SlimefunItemStack FLASK_OF_KNOWLEDGE = new SlimefunItemStack("FLASK_OF_KNOWLEDGE", Material.GLASS_BOTTLE, "&cFlask of Knowledge", "", "&rAllows you to store some of", "&ryour Experience in a Bottle", "&7Cost: &a1 Level"); + public static final SlimefunItemStack FLASK_OF_KNOWLEDGE = new SlimefunItemStack("FLASK_OF_KNOWLEDGE", Material.GLASS_BOTTLE, "&cFlask of Knowledge", "", "&fAllows you to store some of", "&fyour Experience in a Bottle", "&7Cost: &a1 Level"); public static final SlimefunItemStack FILLED_FLASK_OF_KNOWLEDGE = new SlimefunItemStack("FILLED_FLASK_OF_KNOWLEDGE", Material.EXPERIENCE_BOTTLE, "&aFlask of Knowledge"); /* Backpacks */ @@ -72,7 +76,7 @@ public final class SlimefunItems { public static final SlimefunItemStack GILDED_BACKPACK = new SlimefunItemStack("GILDED_BACKPACK", HeadTexture.BACKPACK, "&eGilded Backpack", "", "&7Size: &e45", BACKPACK_ID, "", LoreBuilder.RIGHT_CLICK_TO_OPEN); public static final SlimefunItemStack RADIANT_BACKPACK = new SlimefunItemStack("RADIANT_BACKPACK", HeadTexture.BACKPACK, "&eRadiant Backpack", "", "&7Size: &e54 (Double chest)", BACKPACK_ID, "", LoreBuilder.RIGHT_CLICK_TO_OPEN); public static final SlimefunItemStack BOUND_BACKPACK = new SlimefunItemStack("BOUND_BACKPACK", HeadTexture.ENDER_BACKPACK, "&cSoulbound Backpack", "", "&7Size: &e36", BACKPACK_ID, "", LoreBuilder.RIGHT_CLICK_TO_OPEN); - public static final SlimefunItemStack COOLER = new SlimefunItemStack("COOLER", HeadTexture.COOLER, "&bCooler", "&rAllows you to store Juices/Smoothies", "&rand automatically consumes them when you are hungry", "&rand you have this in your Inventory", "", "&7Size: &e27", BACKPACK_ID, "", LoreBuilder.RIGHT_CLICK_TO_OPEN); + public static final SlimefunItemStack COOLER = new SlimefunItemStack("COOLER", HeadTexture.COOLER, "&bCooler", "&fAllows you to store Juices/Smoothies", "&fand automatically consumes them when you are hungry", "&fand you have this in your Inventory", "", "&7Size: &e27", BACKPACK_ID, "", LoreBuilder.RIGHT_CLICK_TO_OPEN); public static final SlimefunItemStack RESTORED_BACKPACK = new SlimefunItemStack("RESTORED_BACKPACK", HeadTexture.RESTORED_BACKPACK, "&eRestored Backpack", "", "&7Retrieve your lost items", BACKPACK_ID, "", LoreBuilder.RIGHT_CLICK_TO_OPEN); /* Jetpacks */ @@ -137,7 +141,7 @@ public final class SlimefunItems { /* Food */ public static final SlimefunItemStack FORTUNE_COOKIE = new SlimefunItemStack("FORTUNE_COOKIE", Material.COOKIE, "&6Fortune Cookie", "", "&a&oTells you stuff about your Future :o"); - public static final SlimefunItemStack DIET_COOKIE = new SlimefunItemStack("DIET_COOKIE", Material.COOKIE, "&6Diet Cookie", "", "&aA very &olightweight &r&acookie."); + public static final SlimefunItemStack DIET_COOKIE = new SlimefunItemStack("DIET_COOKIE", Material.COOKIE, "&6Diet Cookie", "", "&aA very &olightweight &f&acookie."); public static final SlimefunItemStack MAGIC_SUGAR = new SlimefunItemStack("MAGIC_SUGAR", Material.SUGAR, "&6Magic Sugar", "", "&a&oFeel the Power of Hermes!"); public static final SlimefunItemStack MONSTER_JERKY = new SlimefunItemStack("MONSTER_JERKY", Material.ROTTEN_FLESH, "&6Monster Jerky", "", "&a&oNo longer hungry"); public static final SlimefunItemStack APPLE_JUICE = new SlimefunItemStack("APPLE_JUICE", Color.RED, new PotionEffect(PotionEffectType.SATURATION, 6, 0), "&cApple Juice", "", "&7&oRestores &b&o" + "3.0" + " &7&oHunger"); @@ -147,12 +151,12 @@ public final class SlimefunItems { public static final SlimefunItemStack SWEET_BERRY_JUICE = new SlimefunItemStack("SWEET_BERRY_JUICE", Color.RED, new PotionEffect(PotionEffectType.SATURATION, 6, 0), "&cSweet Berry Juice", "", "&7&oRestores &b&o" + "3.0" + " &7&oHunger"); public static final SlimefunItemStack GOLDEN_APPLE_JUICE = new SlimefunItemStack("GOLDEN_APPLE_JUICE", Color.YELLOW, new PotionEffect(PotionEffectType.ABSORPTION, 20 * 20, 0), "&bGolden Apple Juice"); - public static final SlimefunItemStack BEEF_JERKY = new SlimefunItemStack("BEEF_JERKY", Material.COOKED_BEEF, "&6Beef Jerky", "", "&rExtra saturating!"); - public static final SlimefunItemStack PORK_JERKY = new SlimefunItemStack("PORK_JERKY", Material.COOKED_PORKCHOP, "&6Pork Jerky", "", "&rExtra saturating!"); - public static final SlimefunItemStack CHICKEN_JERKY = new SlimefunItemStack("CHICKEN_JERKY", Material.COOKED_CHICKEN, "&6Chicken Jerky", "", "&rExtra saturating!"); - public static final SlimefunItemStack MUTTON_JERKY = new SlimefunItemStack("MUTTON_JERKY", Material.COOKED_MUTTON, "&6Mutton Jerky", "", "&rExtra saturating!"); - public static final SlimefunItemStack RABBIT_JERKY = new SlimefunItemStack("RABBIT_JERKY", Material.COOKED_RABBIT, "&6Rabbit Jerky", "", "&rExtra saturating!"); - public static final SlimefunItemStack FISH_JERKY = new SlimefunItemStack("FISH_JERKY", Material.COOKED_COD, "&6Fish Jerky", "", "&rExtra saturating!"); + public static final SlimefunItemStack BEEF_JERKY = new SlimefunItemStack("BEEF_JERKY", Material.COOKED_BEEF, "&6Beef Jerky", "", "&fExtra saturating!"); + public static final SlimefunItemStack PORK_JERKY = new SlimefunItemStack("PORK_JERKY", Material.COOKED_PORKCHOP, "&6Pork Jerky", "", "&fExtra saturating!"); + public static final SlimefunItemStack CHICKEN_JERKY = new SlimefunItemStack("CHICKEN_JERKY", Material.COOKED_CHICKEN, "&6Chicken Jerky", "", "&fExtra saturating!"); + public static final SlimefunItemStack MUTTON_JERKY = new SlimefunItemStack("MUTTON_JERKY", Material.COOKED_MUTTON, "&6Mutton Jerky", "", "&fExtra saturating!"); + public static final SlimefunItemStack RABBIT_JERKY = new SlimefunItemStack("RABBIT_JERKY", Material.COOKED_RABBIT, "&6Rabbit Jerky", "", "&fExtra saturating!"); + public static final SlimefunItemStack FISH_JERKY = new SlimefunItemStack("FISH_JERKY", Material.COOKED_COD, "&6Fish Jerky", "", "&fExtra saturating!"); public static final SlimefunItemStack KELP_COOKIE = new SlimefunItemStack("KELP_COOKIE", Material.COOKIE, "&2Kelp Cookie"); @@ -163,7 +167,7 @@ public final class SlimefunItems { public static final SlimefunItemStack CHRISTMAS_APPLE_CIDER = new SlimefunItemStack("CHRISTMAS_APPLE_CIDER", Color.RED, new PotionEffect(PotionEffectType.SATURATION, 14, 0), "&cApple Cider", "", "&7&oRestores &b&o" + "7.0" + " &7&oHunger"); public static final SlimefunItemStack CHRISTMAS_COOKIE = new SlimefunItemStack("CHRISTMAS_COOKIE", Material.COOKIE, ChatUtils.christmas("Christmas Cookie")); public static final SlimefunItemStack CHRISTMAS_FRUIT_CAKE = new SlimefunItemStack("CHRISTMAS_FRUIT_CAKE", Material.PUMPKIN_PIE, ChatUtils.christmas("Fruit Cake")); - public static final SlimefunItemStack CHRISTMAS_APPLE_PIE = new SlimefunItemStack("CHRISTMAS_APPLE_PIE", Material.PUMPKIN_PIE, "&rApple Pie"); + public static final SlimefunItemStack CHRISTMAS_APPLE_PIE = new SlimefunItemStack("CHRISTMAS_APPLE_PIE", Material.PUMPKIN_PIE, "&fApple Pie"); public static final SlimefunItemStack CHRISTMAS_HOT_CHOCOLATE = new SlimefunItemStack("CHRISTMAS_HOT_CHOCOLATE", Color.MAROON, new PotionEffect(PotionEffectType.SATURATION, 14, 0), "&6Hot Chocolate", "", "&7&oRestores &b&o" + "7.0" + " &7&oHunger"); public static final SlimefunItemStack CHRISTMAS_CAKE = new SlimefunItemStack("CHRISTMAS_CAKE", Material.PUMPKIN_PIE, ChatUtils.christmas("Christmas Cake")); public static final SlimefunItemStack CHRISTMAS_CARAMEL = new SlimefunItemStack("CHRISTMAS_CARAMEL", Material.BRICK, "&6Caramel"); @@ -172,15 +176,15 @@ public final class SlimefunItems { public static final SlimefunItemStack CHRISTMAS_PRESENT = new SlimefunItemStack("CHRISTMAS_PRESENT", HeadTexture.CHRISTMAS_PRESENT, ChatUtils.christmas("Christmas Present"), "&7From: &cTheBusyBiscuit", "&7To: &eYou", "", LoreBuilder.RIGHT_CLICK_TO_OPEN); /* Easter */ - public static final SlimefunItemStack EASTER_EGG = new SlimefunItemStack("EASTER_EGG", HeadTexture.EASTER_EGG, "&rEaster Egg", "&dHappy Easter! Have a surprise.", "", LoreBuilder.RIGHT_CLICK_TO_OPEN); + public static final SlimefunItemStack EASTER_EGG = new SlimefunItemStack("EASTER_EGG", HeadTexture.EASTER_EGG, "&fEaster Egg", "&dHappy Easter! Have a surprise.", "", LoreBuilder.RIGHT_CLICK_TO_OPEN); public static final SlimefunItemStack EASTER_CARROT_PIE = new SlimefunItemStack("CARROT_PIE", Material.PUMPKIN_PIE, "&6Carrot Pie"); - public static final SlimefunItemStack EASTER_APPLE_PIE = new SlimefunItemStack("EASTER_APPLE_PIE", Material.PUMPKIN_PIE, "&rApple Pie"); + public static final SlimefunItemStack EASTER_APPLE_PIE = new SlimefunItemStack("EASTER_APPLE_PIE", Material.PUMPKIN_PIE, "&fApple Pie"); /* Weapons */ public static final SlimefunItemStack GRANDMAS_WALKING_STICK = new SlimefunItemStack("GRANDMAS_WALKING_STICK", Material.STICK, "&7Grandmas Walking Stick"); public static final SlimefunItemStack GRANDPAS_WALKING_STICK = new SlimefunItemStack("GRANDPAS_WALKING_STICK", Material.STICK, "&7Grandpas Walking Stick"); - public static final SlimefunItemStack SWORD_OF_BEHEADING = new SlimefunItemStack("SWORD_OF_BEHEADING", Material.IRON_SWORD, "&6Sword of Beheading", "&7Beheading II", "", "&rHas a chance to behead Mobs", "&r(even a higher chance for Wither Skeletons)"); - public static final SlimefunItemStack BLADE_OF_VAMPIRES = new SlimefunItemStack("BLADE_OF_VAMPIRES", Material.GOLDEN_SWORD, "&cBlade of Vampires", "&7Life Steal I", "", "&rEverytime you attack something", "&ryou have a 45% chance to", "&rrecover 2 Hearts of your Health"); + public static final SlimefunItemStack SWORD_OF_BEHEADING = new SlimefunItemStack("SWORD_OF_BEHEADING", Material.IRON_SWORD, "&6Sword of Beheading", "&7Beheading II", "", "&fHas a chance to behead Mobs", "&f(even a higher chance for Wither Skeletons)"); + public static final SlimefunItemStack BLADE_OF_VAMPIRES = new SlimefunItemStack("BLADE_OF_VAMPIRES", Material.GOLDEN_SWORD, "&cBlade of Vampires", "&7Life Steal I", "", "&fEverytime you attack something", "&fyou have a 45% chance to", "&frecover 2 Hearts of your Health"); public static final SlimefunItemStack SEISMIC_AXE = new SlimefunItemStack("SEISMIC_AXE", Material.IRON_AXE, "&aSeismic Axe", "", "&7&oA portable Earthquake...", "", LoreBuilder.RIGHT_CLICK_TO_USE); static { @@ -193,19 +197,19 @@ public final class SlimefunItems { } /* Bows */ - public static final SlimefunItemStack EXPLOSIVE_BOW = new SlimefunItemStack("EXPLOSIVE_BOW", Material.BOW, "&cExplosive Bow", "&rAny Arrows fired using this Bow", "&rwill launch hit enemys into the air"); - public static final SlimefunItemStack ICY_BOW = new SlimefunItemStack("ICY_BOW", Material.BOW, "&bIcy Bow", "&rAny Arrows fired using this Bow", "&rwill prevent hit enemys from moving", "&rfor 2 seconds"); + public static final SlimefunItemStack EXPLOSIVE_BOW = new SlimefunItemStack("EXPLOSIVE_BOW", Material.BOW, "&cExplosive Bow", "&fAny Arrows fired using this Bow", "&fwill launch hit enemys into the air"); + public static final SlimefunItemStack ICY_BOW = new SlimefunItemStack("ICY_BOW", Material.BOW, "&bIcy Bow", "&fAny Arrows fired using this Bow", "&fwill prevent hit enemys from moving", "&ffor 2 seconds"); /* Tools */ public static final SlimefunItemStack SMELTERS_PICKAXE = new SlimefunItemStack("SMELTERS_PICKAXE", Material.DIAMOND_PICKAXE, "&6Smelter's Pickaxe", "&c&lAuto-Smelting", "", "&9Works with Fortune"); public static final SlimefunItemStack LUMBER_AXE = new SlimefunItemStack("LUMBER_AXE", Material.DIAMOND_AXE, "&6Lumber Axe", "&a&oCuts down the whole Tree..."); public static final SlimefunItemStack PICKAXE_OF_CONTAINMENT = new SlimefunItemStack("PICKAXE_OF_CONTAINMENT", Material.IRON_PICKAXE, "&cPickaxe of Containment", "", "&9Can pickup Spawners"); - public static final SlimefunItemStack HERCULES_PICKAXE = new SlimefunItemStack("HERCULES_PICKAXE", Material.IRON_PICKAXE, "&9Hercules' Pickaxe", "", "&rSo powerful that it", "&rcrushes all mined Ores", "&rinto Dust..."); - public static final SlimefunItemStack EXPLOSIVE_PICKAXE = new SlimefunItemStack("EXPLOSIVE_PICKAXE", Material.DIAMOND_PICKAXE, "&eExplosive Pickaxe", "", "&rAllows you to mine a good bit", "&rof Blocks at once...", "", "&9Works with Fortune"); - public static final SlimefunItemStack EXPLOSIVE_SHOVEL = new SlimefunItemStack("EXPLOSIVE_SHOVEL", Material.DIAMOND_SHOVEL, "&eExplosive Shovel", "", "&rAllows you to mine a good bit", "&rof diggable Blocks at once..."); - public static final SlimefunItemStack PICKAXE_OF_THE_SEEKER = new SlimefunItemStack("PICKAXE_OF_THE_SEEKER", Material.DIAMOND_PICKAXE, "&aPickaxe of the Seeker", "&rWill always point you to the nearest Ore", "&rbut might get damaged when doing it", "", "&7&eRight Click&7 to be pointed to the nearest Ore"); + public static final SlimefunItemStack HERCULES_PICKAXE = new SlimefunItemStack("HERCULES_PICKAXE", Material.IRON_PICKAXE, "&9Hercules' Pickaxe", "", "&fSo powerful that it", "&fcrushes all mined Ores", "&finto Dust..."); + public static final SlimefunItemStack EXPLOSIVE_PICKAXE = new SlimefunItemStack("EXPLOSIVE_PICKAXE", Material.DIAMOND_PICKAXE, "&eExplosive Pickaxe", "", "&fAllows you to mine a good bit", "&fof Blocks at once...", "", "&9Works with Fortune"); + public static final SlimefunItemStack EXPLOSIVE_SHOVEL = new SlimefunItemStack("EXPLOSIVE_SHOVEL", Material.DIAMOND_SHOVEL, "&eExplosive Shovel", "", "&fAllows you to mine a good bit", "&fof diggable Blocks at once..."); + public static final SlimefunItemStack PICKAXE_OF_THE_SEEKER = new SlimefunItemStack("PICKAXE_OF_THE_SEEKER", Material.DIAMOND_PICKAXE, "&aPickaxe of the Seeker", "&fWill always point you to the nearest Ore", "&fbut might get damaged when doing it", "", "&7&eRight Click&7 to be pointed to the nearest Ore"); public static final SlimefunItemStack COBALT_PICKAXE = new SlimefunItemStack("COBALT_PICKAXE", Material.IRON_PICKAXE, "&9Cobalt Pickaxe"); - public static final SlimefunItemStack PICKAXE_OF_VEIN_MINING = new SlimefunItemStack("PICKAXE_OF_VEIN_MINING", Material.DIAMOND_PICKAXE, "&ePickaxe of Vein Mining", "", "&rThis Pickaxe will dig out", "&rwhole Veins of Ores..."); + public static final SlimefunItemStack PICKAXE_OF_VEIN_MINING = new SlimefunItemStack("PICKAXE_OF_VEIN_MINING", Material.DIAMOND_PICKAXE, "&ePickaxe of Vein Mining", "", "&fThis Pickaxe will dig out", "&fwhole Veins of Ores..."); static { HERCULES_PICKAXE.addUnsafeEnchantment(Enchantment.DURABILITY, 5); @@ -246,10 +250,36 @@ public final class SlimefunItems { public static final SlimefunItemStack REINFORCED_ALLOY_LEGGINGS = new SlimefunItemStack("REINFORCED_ALLOY_LEGGINGS", Material.IRON_LEGGINGS, "&bReinforced Leggings"); public static final SlimefunItemStack REINFORCED_ALLOY_BOOTS = new SlimefunItemStack("REINFORCED_ALLOY_BOOTS", Material.IRON_BOOTS, "&bReinforced Boots"); - public static final SlimefunItemStack SCUBA_HELMET = new SlimefunItemStack("SCUBA_HELMET", Material.LEATHER_HELMET, Color.ORANGE, "&cScuba Helmet", "", "&bAllows you to breathe Underwater", "&4&oPart of Hazmat Suit"); - public static final SlimefunItemStack HAZMAT_CHESTPLATE = new SlimefunItemStack("HAZMAT_CHESTPLATE", Material.LEATHER_CHESTPLATE, Color.ORANGE, "&cHazmat Suit", "", "&bAllows you to walk through Fire", "&4&oPart of Hazmat Suit"); - public static final SlimefunItemStack HAZMAT_LEGGINGS = new SlimefunItemStack("HAZMAT_LEGGINGS", Material.LEATHER_LEGGINGS, Color.ORANGE, "&cHazmat Suit Leggings", "", "&4&oPart of Hazmat Suit"); - public static final SlimefunItemStack RUBBER_BOOTS = new SlimefunItemStack("RUBBER_BOOTS", Material.LEATHER_BOOTS, Color.BLACK, "&cRubber Boots", "", "&4&oPart of Hazmat Suit"); + private static final List hazmatLore = new ArrayList<>(); + + static { + hazmatLore.add(""); + hazmatLore.add(ChatColor.GOLD + "Full set effects:"); + hazmatLore.add(ChatColor.YELLOW + "- Radioation immunity"); + + if (SlimefunPlugin.getMinecraftVersion().isAtLeast(MinecraftVersion.MINECRAFT_1_15)) { + hazmatLore.add(ChatColor.YELLOW + "- Bee Sting protection"); + } + } + + public static final SlimefunItemStack SCUBA_HELMET = new SlimefunItemStack("SCUBA_HELMET", Material.LEATHER_HELMET, Color.ORANGE, "&cScuba Helmet", "", "&7Allows you to breathe underwater"); + public static final SlimefunItemStack HAZMAT_CHESTPLATE = new SlimefunItemStack("HAZMAT_CHESTPLATE", Material.LEATHER_CHESTPLATE, Color.ORANGE, "&cHazmat Suit", "", "&7Allows you to walk through fire and lava"); + public static final SlimefunItemStack HAZMAT_LEGGINGS = new SlimefunItemStack("HAZMAT_LEGGINGS", Material.LEATHER_LEGGINGS, Color.ORANGE, "&cHazmat Suit Leggings", hazmatLore.toArray(new String[0])); + public static final SlimefunItemStack HAZMAT_BOOTS = new SlimefunItemStack("RUBBER_BOOTS", Material.LEATHER_BOOTS, Color.BLACK, "&cHazmat Boots", hazmatLore.toArray(new String[0])); + + static { + ItemMeta helmetMeta = SCUBA_HELMET.getItemMeta(); + List helmetLore = helmetMeta.getLore(); + helmetLore.addAll(hazmatLore); + helmetMeta.setLore(helmetLore); + SCUBA_HELMET.setItemMeta(helmetMeta); + + ItemMeta chestplateMeta = HAZMAT_CHESTPLATE.getItemMeta(); + List chestplateLore = chestplateMeta.getLore(); + chestplateLore.addAll(hazmatLore); + chestplateMeta.setLore(chestplateLore); + HAZMAT_CHESTPLATE.setItemMeta(chestplateMeta); + } public static final SlimefunItemStack GILDED_IRON_HELMET = new SlimefunItemStack("GILDED_IRON_HELMET", Material.GOLDEN_HELMET, "&6Gilded Iron Helmet"); public static final SlimefunItemStack GILDED_IRON_CHESTPLATE = new SlimefunItemStack("GILDED_IRON_CHESTPLATE", Material.GOLDEN_CHESTPLATE, "&6Gilded Iron Chestplate"); @@ -329,9 +359,10 @@ public final class SlimefunItems { public static final SlimefunItemStack ENDER_LUMP_3 = new SlimefunItemStack("ENDER_LUMP_3", Material.GOLD_NUGGET, "&5Ender Lump &7- &eIII", "", "&c&oTier: III"); public static final SlimefunItemStack MAGICAL_BOOK_COVER = new SlimefunItemStack("MAGICAL_BOOK_COVER", Material.PAPER, "&6Magical Book Cover", "", "&a&oUsed for various Magic Books"); public static final SlimefunItemStack MAGICAL_ZOMBIE_PILLS = new SlimefunItemStack("MAGICAL_ZOMBIE_PILLS", Material.NETHER_WART, "&6Magical Zombie Pills", "", "&eRight Click &7a Zombified Villager to", "&7instantly cure it from its curse"); + public static final SlimefunItemStack MAGICAL_GLASS = new SlimefunItemStack("MAGICAL_GLASS", Material.GLASS_PANE, "&6Magical Glass", "", "&a&oUsed for various Magical Gadgets"); public static final SlimefunItemStack BASIC_CIRCUIT_BOARD = new SlimefunItemStack("BASIC_CIRCUIT_BOARD", Material.ACTIVATOR_RAIL, "&bBasic Circuit Board"); public static final SlimefunItemStack ADVANCED_CIRCUIT_BOARD = new SlimefunItemStack("ADVANCED_CIRCUIT_BOARD", Material.POWERED_RAIL, "&bAdvanced Circuit Board"); - public static final SlimefunItemStack WHEAT_FLOUR = new SlimefunItemStack("WHEAT_FLOUR", Material.SUGAR, "&rWheat Flour"); + public static final SlimefunItemStack WHEAT_FLOUR = new SlimefunItemStack("WHEAT_FLOUR", Material.SUGAR, "&fWheat Flour"); public static final SlimefunItemStack STEEL_PLATE = new SlimefunItemStack("STEEL_PLATE", Material.PAPER, "&7&lSteel Plate"); public static final SlimefunItemStack BATTERY = new SlimefunItemStack("BATTERY", HeadTexture.BATTERY, "&6Battery"); public static final SlimefunItemStack CARBON = new SlimefunItemStack("CARBON", HeadTexture.CARBON, "&eCarbon"); @@ -344,18 +375,18 @@ public final class SlimefunItems { public static final SlimefunItemStack SIFTED_ORE = new SlimefunItemStack("SIFTED_ORE", Material.GUNPOWDER, "&6Sifted Ore"); public static final SlimefunItemStack STONE_CHUNK = new SlimefunItemStack("STONE_CHUNK", HeadTexture.STONE_CHUNK, "&6Stone Chunk"); public static final SlimefunItemStack LAVA_CRYSTAL = new SlimefunItemStack("LAVA_CRYSTAL", HeadTexture.LAVA_CRYSTAL, "&4Lava Crystal"); - public static final SlimefunItemStack SALT = new SlimefunItemStack("SALT", Material.SUGAR, "&rSalt"); - public static final SlimefunItemStack CHEESE = new SlimefunItemStack("CHEESE", HeadTexture.CHEESE, "&rCheese"); - public static final SlimefunItemStack BUTTER = new SlimefunItemStack("BUTTER", HeadTexture.BUTTER, "&rButter"); - public static final SlimefunItemStack DUCT_TAPE = new SlimefunItemStack("DUCT_TAPE", HeadTexture.DUCT_TAPE, "&8Duct Tape", "", "&rYou can repair Items using this", "&rin an Auto-Anvil"); - public static final SlimefunItemStack HEAVY_CREAM = new SlimefunItemStack("HEAVY_CREAM", Material.SNOWBALL, "&rHeavy Cream"); + public static final SlimefunItemStack SALT = new SlimefunItemStack("SALT", Material.SUGAR, "&fSalt"); + public static final SlimefunItemStack CHEESE = new SlimefunItemStack("CHEESE", HeadTexture.CHEESE, "&fCheese"); + public static final SlimefunItemStack BUTTER = new SlimefunItemStack("BUTTER", HeadTexture.BUTTER, "&fButter"); + public static final SlimefunItemStack DUCT_TAPE = new SlimefunItemStack("DUCT_TAPE", HeadTexture.DUCT_TAPE, "&8Duct Tape", "", "&fYou can repair Items using this", "&fin an Auto-Anvil"); + public static final SlimefunItemStack HEAVY_CREAM = new SlimefunItemStack("HEAVY_CREAM", Material.SNOWBALL, "&fHeavy Cream"); public static final SlimefunItemStack CRUSHED_ORE = new SlimefunItemStack("CRUSHED_ORE", Material.GUNPOWDER, "&6Crushed Ore"); public static final SlimefunItemStack PULVERIZED_ORE = new SlimefunItemStack("PULVERIZED_ORE", Material.GUNPOWDER, "&6Pulverized Ore"); public static final SlimefunItemStack PURE_ORE_CLUSTER = new SlimefunItemStack("PURE_ORE_CLUSTER", Material.GUNPOWDER, "&6Pure Ore Cluster"); public static final SlimefunItemStack SMALL_URANIUM = new SlimefunItemStack("SMALL_URANIUM", HeadTexture.URANIUM, "&cSmall Chunk of Uranium", "", LoreBuilder.radioactive(Radioactivity.MODERATE), LoreBuilder.HAZMAT_SUIT_REQUIRED); public static final SlimefunItemStack TINY_URANIUM = new SlimefunItemStack("TINY_URANIUM", HeadTexture.URANIUM, "&cTiny Pile of Uranium", "", LoreBuilder.radioactive(Radioactivity.LOW)); public static final SlimefunItemStack SOLAR_PANEL = new SlimefunItemStack("SOLAR_PANEL", Material.DAYLIGHT_DETECTOR, "&bSolar Panel", "", "&a&oTransforms Sunlight to Energy"); - public static final SlimefunItemStack PLASTIC_SHEET = new SlimefunItemStack("PLASTIC_SHEET", Material.PAPER, "&rPlastic Sheet"); + public static final SlimefunItemStack PLASTIC_SHEET = new SlimefunItemStack("PLASTIC_SHEET", Material.PAPER, "&fPlastic Sheet"); public static final SlimefunItemStack MAGNET = new SlimefunItemStack("MAGNET", HeadTexture.MAGNET, "&cMagnet"); public static final SlimefunItemStack NECROTIC_SKULL = new SlimefunItemStack("NECROTIC_SKULL", Material.WITHER_SKELETON_SKULL, "&cNecrotic Skull"); @@ -365,11 +396,11 @@ public final class SlimefunItems { public static final SlimefunItemStack COOLING_UNIT = new SlimefunItemStack("COOLING_UNIT", HeadTexture.COOLING_UNIT, "&bCooling Unit"); public static final SlimefunItemStack ELECTRIC_MOTOR = new SlimefunItemStack("ELECTRIC_MOTOR", HeadTexture.MOTOR, "&cElectric Motor"); public static final SlimefunItemStack CARGO_MOTOR = new SlimefunItemStack("CARGO_MOTOR", HeadTexture.MOTOR, "&3Cargo Motor"); - public static final SlimefunItemStack SCROLL_OF_DIMENSIONAL_TELEPOSITION = new SlimefunItemStack("SCROLL_OF_DIMENSIONAL_TELEPOSITION", Material.PAPER, "&6Scroll of Dimensional Teleposition", "", "&cThis Scroll is capable of creating", "&ca temporary black Hole which pulls", "&cnearby Entities into itself and sends", "&cthem into another Dimension where", "&ceverything is turned around", "", "&rIn other words: Makes Entities turn by 180 Degrees"); + public static final SlimefunItemStack SCROLL_OF_DIMENSIONAL_TELEPOSITION = new SlimefunItemStack("SCROLL_OF_DIMENSIONAL_TELEPOSITION", Material.PAPER, "&6Scroll of Dimensional Teleposition", "", "&cThis Scroll is capable of creating", "&ca temporary black Hole which pulls", "&cnearby Entities into itself and sends", "&cthem into another Dimension where", "&ceverything is turned around", "", "&fIn other words: Makes Entities turn by 180 Degrees"); public static final SlimefunItemStack TOME_OF_KNOWLEDGE_SHARING = new SlimefunItemStack("TOME_OF_KNOWLEDGE_SHARING", Material.BOOK, "&6Tome of Knowledge Sharing", "&7Owner: &bNone", "", "&eRight Click&7 to bind this Tome to yourself", "", "", "&eRight Click&7 to obtain all Researches by", "&7the previously assigned Owner"); - public static final SlimefunItemStack HARDENED_GLASS = new SlimefunItemStack("HARDENED_GLASS", Material.LIGHT_GRAY_STAINED_GLASS, "&7Hardened Glass", "", "&rWithstands Explosions"); - public static final SlimefunItemStack WITHER_PROOF_OBSIDIAN = new SlimefunItemStack("WITHER_PROOF_OBSIDIAN", Material.OBSIDIAN, "&5Wither-Proof Obsidian", "", "&rWithstands Explosions", "&rWithstands Wither Bosses"); - public static final SlimefunItemStack WITHER_PROOF_GLASS = new SlimefunItemStack("WITHER_PROOF_GLASS", Material.PURPLE_STAINED_GLASS, "&5Wither-Proof Glass", "", "&rWithstands Explosions", "&rWithstands Wither Bosses"); + public static final SlimefunItemStack HARDENED_GLASS = new SlimefunItemStack("HARDENED_GLASS", Material.LIGHT_GRAY_STAINED_GLASS, "&7Hardened Glass", "", "&fWithstands Explosions"); + public static final SlimefunItemStack WITHER_PROOF_OBSIDIAN = new SlimefunItemStack("WITHER_PROOF_OBSIDIAN", Material.OBSIDIAN, "&5Wither-Proof Obsidian", "", "&fWithstands Explosions", "&fWithstands Wither Bosses"); + public static final SlimefunItemStack WITHER_PROOF_GLASS = new SlimefunItemStack("WITHER_PROOF_GLASS", Material.PURPLE_STAINED_GLASS, "&5Wither-Proof Glass", "", "&fWithstands Explosions", "&fWithstands Wither Bosses"); public static final SlimefunItemStack REINFORCED_PLATE = new SlimefunItemStack("REINFORCED_PLATE", Material.PAPER, "&7Reinforced Plate"); public static final SlimefunItemStack ANCIENT_PEDESTAL = new SlimefunItemStack("ANCIENT_PEDESTAL", Material.DISPENSER, "&dAncient Pedestal", "", "&5Part of the Ancient Altar"); public static final SlimefunItemStack ANCIENT_ALTAR = new SlimefunItemStack("ANCIENT_ALTAR", Material.ENCHANTING_TABLE, "&dAncient Altar", "", "&5Multi-Block Altar for", "&5magical Crafting Processes"); @@ -452,17 +483,17 @@ public final class SlimefunItems { public static final SlimefunItemStack COBALT_INGOT = new SlimefunItemStack("COBALT_INGOT", Material.IRON_INGOT, "&9Cobalt Ingot"); /* Gold */ - public static final SlimefunItemStack GOLD_4K = new SlimefunItemStack("GOLD_4K", Material.GOLD_INGOT, "&rGold Ingot &7(4-Carat)"); - public static final SlimefunItemStack GOLD_6K = new SlimefunItemStack("GOLD_6K", Material.GOLD_INGOT, "&rGold Ingot &7(6-Carat)"); - public static final SlimefunItemStack GOLD_8K = new SlimefunItemStack("GOLD_8K", Material.GOLD_INGOT, "&rGold Ingot &7(8-Carat)"); - public static final SlimefunItemStack GOLD_10K = new SlimefunItemStack("GOLD_10K", Material.GOLD_INGOT, "&rGold Ingot &7(10-Carat)"); - public static final SlimefunItemStack GOLD_12K = new SlimefunItemStack("GOLD_12K", Material.GOLD_INGOT, "&rGold Ingot &7(12-Carat)"); - public static final SlimefunItemStack GOLD_14K = new SlimefunItemStack("GOLD_14K", Material.GOLD_INGOT, "&rGold Ingot &7(14-Carat)"); - public static final SlimefunItemStack GOLD_16K = new SlimefunItemStack("GOLD_16K", Material.GOLD_INGOT, "&rGold Ingot &7(16-Carat)"); - public static final SlimefunItemStack GOLD_18K = new SlimefunItemStack("GOLD_18K", Material.GOLD_INGOT, "&rGold Ingot &7(18-Carat)"); - public static final SlimefunItemStack GOLD_20K = new SlimefunItemStack("GOLD_20K", Material.GOLD_INGOT, "&rGold Ingot &7(20-Carat)"); - public static final SlimefunItemStack GOLD_22K = new SlimefunItemStack("GOLD_22K", Material.GOLD_INGOT, "&rGold Ingot &7(22-Carat)"); - public static final SlimefunItemStack GOLD_24K = new SlimefunItemStack("GOLD_24K", Material.GOLD_INGOT, "&rGold Ingot &7(24-Carat)"); + public static final SlimefunItemStack GOLD_4K = new SlimefunItemStack("GOLD_4K", Material.GOLD_INGOT, "&fGold Ingot &7(4-Carat)"); + public static final SlimefunItemStack GOLD_6K = new SlimefunItemStack("GOLD_6K", Material.GOLD_INGOT, "&fGold Ingot &7(6-Carat)"); + public static final SlimefunItemStack GOLD_8K = new SlimefunItemStack("GOLD_8K", Material.GOLD_INGOT, "&fGold Ingot &7(8-Carat)"); + public static final SlimefunItemStack GOLD_10K = new SlimefunItemStack("GOLD_10K", Material.GOLD_INGOT, "&fGold Ingot &7(10-Carat)"); + public static final SlimefunItemStack GOLD_12K = new SlimefunItemStack("GOLD_12K", Material.GOLD_INGOT, "&fGold Ingot &7(12-Carat)"); + public static final SlimefunItemStack GOLD_14K = new SlimefunItemStack("GOLD_14K", Material.GOLD_INGOT, "&fGold Ingot &7(14-Carat)"); + public static final SlimefunItemStack GOLD_16K = new SlimefunItemStack("GOLD_16K", Material.GOLD_INGOT, "&fGold Ingot &7(16-Carat)"); + public static final SlimefunItemStack GOLD_18K = new SlimefunItemStack("GOLD_18K", Material.GOLD_INGOT, "&fGold Ingot &7(18-Carat)"); + public static final SlimefunItemStack GOLD_20K = new SlimefunItemStack("GOLD_20K", Material.GOLD_INGOT, "&fGold Ingot &7(20-Carat)"); + public static final SlimefunItemStack GOLD_22K = new SlimefunItemStack("GOLD_22K", Material.GOLD_INGOT, "&fGold Ingot &7(22-Carat)"); + public static final SlimefunItemStack GOLD_24K = new SlimefunItemStack("GOLD_24K", Material.GOLD_INGOT, "&fGold Ingot &7(24-Carat)"); /* Dusts */ public static final SlimefunItemStack IRON_DUST = new SlimefunItemStack("IRON_DUST", Material.GUNPOWDER, "&6Iron Dust"); @@ -477,12 +508,12 @@ public final class SlimefunItems { public static final SlimefunItemStack SULFATE = new SlimefunItemStack("SULFATE", Material.GLOWSTONE_DUST, "&6Sulfate"); public static final SlimefunItemStack SILICON = new SlimefunItemStack("SILICON", Material.FIREWORK_STAR, "&6Silicon"); - public static final SlimefunItemStack GOLD_24K_BLOCK = new SlimefunItemStack("GOLD_24K_BLOCK", Material.GOLD_BLOCK, "&rGold Block &7(24-Carat)"); + public static final SlimefunItemStack GOLD_24K_BLOCK = new SlimefunItemStack("GOLD_24K_BLOCK", Material.GOLD_BLOCK, "&fGold Block &7(24-Carat)"); /* Gems */ - public static final SlimefunItemStack SYNTHETIC_DIAMOND = new SlimefunItemStack("SYNTHETIC_DIAMOND", Material.DIAMOND, "&bSynthetic Diamond", "", "&rThis item can be used in a", "&rworkbench and acts like a normal Diamond"); - public static final SlimefunItemStack SYNTHETIC_EMERALD = new SlimefunItemStack("SYNTHETIC_EMERALD", Material.EMERALD, "&bSynthetic Emerald", "", "&rThis item can be used to", "&rtrade with Villagers"); - public static final SlimefunItemStack SYNTHETIC_SAPPHIRE = new SlimefunItemStack("SYNTHETIC_SAPPHIRE", HeadTexture.SAPPHIRE, "&bSynthetic Sapphire", "", "&rThis item can be used in a", "&rworkbench and acts like Lapis Lazuli"); + public static final SlimefunItemStack SYNTHETIC_DIAMOND = new SlimefunItemStack("SYNTHETIC_DIAMOND", Material.DIAMOND, "&bSynthetic Diamond", "", "&fThis item can be used in a", "&fworkbench and acts like a normal Diamond"); + public static final SlimefunItemStack SYNTHETIC_EMERALD = new SlimefunItemStack("SYNTHETIC_EMERALD", Material.EMERALD, "&bSynthetic Emerald", "", "&fThis item can be used to", "&ftrade with Villagers"); + public static final SlimefunItemStack SYNTHETIC_SAPPHIRE = new SlimefunItemStack("SYNTHETIC_SAPPHIRE", HeadTexture.SAPPHIRE, "&bSynthetic Sapphire", "", "&fThis item can be used in a", "&fworkbench and acts like Lapis Lazuli"); public static final SlimefunItemStack CARBONADO = new SlimefunItemStack("CARBONADO", HeadTexture.CARBONADO, "&b&lCarbonado", "", "&7&o\"Black Diamond\""); public static final SlimefunItemStack RAW_CARBONADO = new SlimefunItemStack("RAW_CARBONADO", HeadTexture.RAW_CARBONADO, "&bRaw Carbonado"); @@ -495,19 +526,19 @@ public final class SlimefunItems { public static final SlimefunItemStack COMMON_TALISMAN = new SlimefunItemStack("COMMON_TALISMAN", Material.EMERALD, "&6Common Talisman"); public static final SlimefunItemStack ENDER_TALISMAN = new SlimefunItemStack("ENDER_TALISMAN", Material.EMERALD, "&5Ender Talisman"); - public static final SlimefunItemStack TALISMAN_ANVIL = new SlimefunItemStack("ANVIL_TALISMAN", Material.EMERALD, "&aTalisman of the Anvil", "", "&rEach Talisman can prevent", "&r1 Tool from breaking, but will then", "&rbe consumed", "", "&4&lWARNING:", "&4This Talisman does not work on", "&4Tools which are too powerful", "&4due to their complexity"); - public static final SlimefunItemStack TALISMAN_MINER = new SlimefunItemStack("MINER_TALISMAN", Material.EMERALD, "&aTalisman of the Miner", "", "&rWhile you have this Talisman", "&rin your Inventory it has", "&ra 20% chance of doubling", "&rall Ores you mine"); - public static final SlimefunItemStack TALISMAN_HUNTER = new SlimefunItemStack("HUNTER_TALISMAN", Material.EMERALD, "&aTalisman of the Hunter", "", "&rWhile you have this Talisman", "&rin your Inventory it has", "&ra 20% chance of doubling", "&rall Drops from Mobs you kill"); - public static final SlimefunItemStack TALISMAN_LAVA = new SlimefunItemStack("LAVA_TALISMAN", Material.EMERALD, "&aTalisman of the Lava Walker", "", "&rWhile you have this Talisman", "&rin your Inventory it will", "&rgive you Fire Resistance", "&ras soon as you touch Lava", "&rbut will then be consumed"); - public static final SlimefunItemStack TALISMAN_WATER = new SlimefunItemStack("WATER_TALISMAN", Material.EMERALD, "&aTalisman of the Water Breather", "", "&rWhile you have this Talisman", "&rin your Inventory it will", "&rgive you the ability", "&rto breath underwater as", "&rsoon as you start drowning", "&rbut will then be consumed"); - public static final SlimefunItemStack TALISMAN_ANGEL = new SlimefunItemStack("ANGEL_TALISMAN", Material.EMERALD, "&aTalisman of the Angel", "", "&rWhile you have this Talisman", "&rin your Inventory it has a", "&r75% chance to prevent you", "&rfrom taking Fall Damage"); - public static final SlimefunItemStack TALISMAN_FIRE = new SlimefunItemStack("FIRE_TALISMAN", Material.EMERALD, "&aTalisman of the Firefighter", "", "&rWhile you have this Talisman", "&rin your Inventory it will", "&rgive you Fire Resistance", "&ras soon as you start burning", "&rbut will then be consumed"); - public static final SlimefunItemStack TALISMAN_MAGICIAN = new SlimefunItemStack("MAGICIAN_TALISMAN", Material.EMERALD, "&aTalisman of the Magician", "", "&rWhile you have this Talisman", "&rin your Inventory it gives", "&ryou a 80% Luck Bonus on Enchanting", "&rYou will sometimes get an Extra Enchantment"); - public static final SlimefunItemStack TALISMAN_TRAVELLER = new SlimefunItemStack("TRAVELLER_TALISMAN", Material.EMERALD, "&aTalisman of the Traveller", "", "&rWhile you have this Talisman", "&rin your Inventory it gives", "&ryou a 60% Chance for a decent", "&rSpeed Buff when you start sprinting"); - public static final SlimefunItemStack TALISMAN_WARRIOR = new SlimefunItemStack("WARRIOR_TALISMAN", Material.EMERALD, "&aTalisman of the Warrior", "", "&rWhile you have this Talisman", "&rin your Inventory it gives", "&ryou Strength III whenever you get hit", "&rbut will then be consumed"); - public static final SlimefunItemStack TALISMAN_KNIGHT = new SlimefunItemStack("KNIGHT_TALISMAN", Material.EMERALD, "&aTalisman of the Knight", "", "&rWhile you have this Talisman", "&rin your Inventory it gives", "&ryou a 30% Chance for 5 Seconds of Regeneration", "&rwhenever You get hit", "&rbut will then be consumed"); - public static final SlimefunItemStack TALISMAN_WHIRLWIND = new SlimefunItemStack("WHIRLWIND_TALISMAN", Material.EMERALD, "&aTalisman of the Whirlwind", "", "&rWhile you have this Talisman", "&rin your Inventory it will reflect", "&r60% of all Projectiles fired at you"); - public static final SlimefunItemStack TALISMAN_WIZARD = new SlimefunItemStack("WIZARD_TALISMAN", Material.EMERALD, "&aTalisman of the Wizard", "", "&rWhile you have this Talisman", "&rin your Inventory it allows you to", "&robtain Fortune Level 4/5 however", "&rit also has a chance to lower the", "&rLevel of some Enchantments on your Item"); + public static final SlimefunItemStack TALISMAN_ANVIL = new SlimefunItemStack("ANVIL_TALISMAN", Material.EMERALD, "&aTalisman of the Anvil", "", "&fEach Talisman can prevent", "&f1 Tool from breaking, but will then", "&fbe consumed", "", "&4&lWARNING:", "&4This Talisman does not work on", "&4Tools which are too powerful", "&4due to their complexity"); + public static final SlimefunItemStack TALISMAN_MINER = new SlimefunItemStack("MINER_TALISMAN", Material.EMERALD, "&aTalisman of the Miner", "", "&fWhile you have this Talisman", "&fin your Inventory it has", "&fa 20% chance of doubling", "&fall Ores you mine"); + public static final SlimefunItemStack TALISMAN_HUNTER = new SlimefunItemStack("HUNTER_TALISMAN", Material.EMERALD, "&aTalisman of the Hunter", "", "&fWhile you have this Talisman", "&fin your Inventory it has", "&fa 20% chance of doubling", "&fall Drops from Mobs you kill"); + public static final SlimefunItemStack TALISMAN_LAVA = new SlimefunItemStack("LAVA_TALISMAN", Material.EMERALD, "&aTalisman of the Lava Walker", "", "&fWhile you have this Talisman", "&fin your Inventory it will", "&fgive you Fire Resistance", "&fas soon as you touch Lava", "&fbut will then be consumed"); + public static final SlimefunItemStack TALISMAN_WATER = new SlimefunItemStack("WATER_TALISMAN", Material.EMERALD, "&aTalisman of the Water Breather", "", "&fWhile you have this Talisman", "&fin your Inventory it will", "&fgive you the ability", "&fto breath underwater as", "&fsoon as you start drowning", "&fbut will then be consumed"); + public static final SlimefunItemStack TALISMAN_ANGEL = new SlimefunItemStack("ANGEL_TALISMAN", Material.EMERALD, "&aTalisman of the Angel", "", "&fWhile you have this Talisman", "&fin your Inventory it has a", "&f75% chance to prevent you", "&ffrom taking Fall Damage"); + public static final SlimefunItemStack TALISMAN_FIRE = new SlimefunItemStack("FIRE_TALISMAN", Material.EMERALD, "&aTalisman of the Firefighter", "", "&fWhile you have this Talisman", "&fin your Inventory it will", "&fgive you Fire Resistance", "&fas soon as you start burning", "&fbut will then be consumed"); + public static final SlimefunItemStack TALISMAN_MAGICIAN = new SlimefunItemStack("MAGICIAN_TALISMAN", Material.EMERALD, "&aTalisman of the Magician", "", "&fWhile you have this Talisman", "&fin your Inventory it gives", "&fyou a 80% Luck Bonus on Enchanting", "&fYou will sometimes get an Extra Enchantment"); + public static final SlimefunItemStack TALISMAN_TRAVELLER = new SlimefunItemStack("TRAVELLER_TALISMAN", Material.EMERALD, "&aTalisman of the Traveller", "", "&fWhile you have this Talisman", "&fin your Inventory it gives", "&fyou a 60% Chance for a decent", "&fSpeed Buff when you start sprinting"); + public static final SlimefunItemStack TALISMAN_WARRIOR = new SlimefunItemStack("WARRIOR_TALISMAN", Material.EMERALD, "&aTalisman of the Warrior", "", "&fWhile you have this Talisman", "&fin your Inventory it gives", "&fyou Strength III whenever you get hit", "&fbut will then be consumed"); + public static final SlimefunItemStack TALISMAN_KNIGHT = new SlimefunItemStack("KNIGHT_TALISMAN", Material.EMERALD, "&aTalisman of the Knight", "", "&fWhile you have this Talisman", "&fin your Inventory it gives", "&fyou a 30% Chance for 5 Seconds of Regeneration", "&fwhenever You get hit", "&fbut will then be consumed"); + public static final SlimefunItemStack TALISMAN_WHIRLWIND = new SlimefunItemStack("WHIRLWIND_TALISMAN", Material.EMERALD, "&aTalisman of the Whirlwind", "", "&fWhile you have this Talisman", "&fin your Inventory it will reflect", "&f60% of all Projectiles fired at you"); + public static final SlimefunItemStack TALISMAN_WIZARD = new SlimefunItemStack("WIZARD_TALISMAN", Material.EMERALD, "&aTalisman of the Wizard", "", "&fWhile you have this Talisman", "&fin your Inventory it allows you to", "&fobtain Fortune Level 4/5 however", "&fit also has a chance to lower the", "&fLevel of some Enchantments on your Item"); /* Staves */ public static final SlimefunItemStack STAFF_ELEMENTAL = new SlimefunItemStack("STAFF_ELEMENTAL", Material.STICK, "&6Elemental Staff"); @@ -528,7 +559,7 @@ public final class SlimefunItems { public static final SlimefunItemStack GRIND_STONE = new SlimefunItemStack("GRIND_STONE", Material.DISPENSER, "&bGrind Stone", "", "&aGrinds items down into other items"); public static final SlimefunItemStack ARMOR_FORGE = new SlimefunItemStack("ARMOR_FORGE", Material.ANVIL, "&6Armor Forge", "", "&aGives you the ability to create powerful armor"); public static final SlimefunItemStack MAKESHIFT_SMELTERY; - public static final SlimefunItemStack SMELTERY = new SlimefunItemStack("SMELTERY", Material.FURNACE, "&6Smeltery", "", "&rA high-temperature furnace", "&rthat allows you to smelt dusts", "&rinto ingots and create alloys."); + public static final SlimefunItemStack SMELTERY = new SlimefunItemStack("SMELTERY", Material.FURNACE, "&6Smeltery", "", "&fA high-temperature furnace", "&fthat allows you to smelt dusts", "&finto ingots and create alloys."); public static final SlimefunItemStack ORE_CRUSHER = new SlimefunItemStack("ORE_CRUSHER", Material.DISPENSER, "&bOre Crusher", "", "&aCrushes ores to double them"); public static final SlimefunItemStack COMPRESSOR = new SlimefunItemStack("COMPRESSOR", Material.PISTON, "&bCompressor", "", "&aCompresses Items"); public static final SlimefunItemStack PRESSURE_CHAMBER = new SlimefunItemStack("PRESSURE_CHAMBER", Material.GLASS, "&bPressure Chamber", "", "&aCompresses Items even further"); @@ -536,10 +567,10 @@ public final class SlimefunItems { public static final SlimefunItemStack ORE_WASHER = new SlimefunItemStack("ORE_WASHER", Material.CAULDRON, "&6Ore Washer", "", "&aWashes Sifted Ore to filter Ores", "&aand gives you small Stone Chunks"); public static final SlimefunItemStack TABLE_SAW; public static final SlimefunItemStack JUICER = new SlimefunItemStack("JUICER", Material.GLASS_BOTTLE, "&aJuicer", "", "&aAllows you to create delicious Juice"); - public static final SlimefunItemStack AUTOMATED_PANNING_MACHINE = new SlimefunItemStack("AUTOMATED_PANNING_MACHINE", Material.BOWL, "&eAutomated Panning Machine", "", "&rA MultiBlock Version of the Gold Pan", "&rand Nether Gold Pan combined in one machine."); + public static final SlimefunItemStack AUTOMATED_PANNING_MACHINE = new SlimefunItemStack("AUTOMATED_PANNING_MACHINE", Material.BOWL, "&eAutomated Panning Machine", "", "&fA MultiBlock Version of the Gold Pan", "&fand Nether Gold Pan combined in one machine."); - public static final SlimefunItemStack INDUSTRIAL_MINER = new SlimefunItemStack("INDUSTRIAL_MINER", Material.GOLDEN_PICKAXE, "&bIndustrial Miner", "", "&rThis Multiblock will mine any Ores", "&rin a 7x7 area underneath it.", "&rPlace coal or similar in its chest", "&rto fuel this machine."); - public static final SlimefunItemStack ADVANCED_INDUSTRIAL_MINER = new SlimefunItemStack("ADVANCED_INDUSTRIAL_MINER", Material.DIAMOND_PICKAXE, "&cAdvanced Industrial Miner", "", "&rThis Multiblock will mine any Ores", "&rin a 11x11 area underneath it.", "&rPlace a bucket of fuel or lava in", "&rits chest to fuel this machine.", "", "&a+ Silk Touch"); + public static final SlimefunItemStack INDUSTRIAL_MINER = new SlimefunItemStack("INDUSTRIAL_MINER", Material.GOLDEN_PICKAXE, "&bIndustrial Miner", "", "&fThis Multiblock will mine any Ores", "&fin a 7x7 area underneath it.", "&fPlace coal or similar in its chest", "&fto fuel this machine."); + public static final SlimefunItemStack ADVANCED_INDUSTRIAL_MINER = new SlimefunItemStack("ADVANCED_INDUSTRIAL_MINER", Material.DIAMOND_PICKAXE, "&cAdvanced Industrial Miner", "", "&fThis Multiblock will mine any Ores", "&fin a 11x11 area underneath it.", "&fPlace a bucket of fuel or lava in", "&fits chest to fuel this machine.", "", "&a+ Silk Touch"); static { ItemMeta meta = INDUSTRIAL_MINER.getItemMeta(); @@ -555,9 +586,9 @@ public final class SlimefunItems { public static final SlimefunItemStack COMPOSTER = new SlimefunItemStack("COMPOSTER", Material.CAULDRON, "&aComposter", "", "&a&oCan convert various Materials over Time..."); public static final SlimefunItemStack CRUCIBLE = new SlimefunItemStack("CRUCIBLE", Material.CAULDRON, "&cCrucible", "", "&a&oUsed to smelt Items into Liquids"); public static final SlimefunItemStack OUTPUT_CHEST = new SlimefunItemStack("OUTPUT_CHEST", Material.CHEST, "&4Output Chest", "", "&c&oA basic machine will try to put", "&c&oitems in this chest if it's placed", "&c&oadjacent to the dispenser."); - public static final SlimefunItemStack IGNITION_CHAMBER = new SlimefunItemStack("IGNITION_CHAMBER", Material.DROPPER, "&4Automatic Ignition Chamber", "", "&rPrevents the Smeltery from using up fire.", "&rJust fill it up with \"Flint and Steel\"", "&rand place it adjacent to the Smeltery's dispenser"); - public static final SlimefunItemStack HOLOGRAM_PROJECTOR = new SlimefunItemStack("HOLOGRAM_PROJECTOR", Material.QUARTZ_SLAB, "&bHologram Projector", "", "&rProjects an Editable Hologram"); - public static final SlimefunItemStack BLOCK_PLACER = new SlimefunItemStack("BLOCK_PLACER", Material.DISPENSER, "&aBlock Placer", "", "&rAll Blocks in this Dispenser", "&rwill automatically get placed"); + public static final SlimefunItemStack IGNITION_CHAMBER = new SlimefunItemStack("IGNITION_CHAMBER", Material.DROPPER, "&4Automatic Ignition Chamber", "", "&fPrevents the Smeltery from using up fire.", "&fJust fill it up with \"Flint and Steel\"", "&fand place it adjacent to the Smeltery's dispenser"); + public static final SlimefunItemStack HOLOGRAM_PROJECTOR = new SlimefunItemStack("HOLOGRAM_PROJECTOR", Material.QUARTZ_SLAB, "&bHologram Projector", "", "&fProjects an Editable Hologram"); + public static final SlimefunItemStack BLOCK_PLACER = new SlimefunItemStack("BLOCK_PLACER", Material.DISPENSER, "&aBlock Placer", "", "&fAll Blocks in this Dispenser", "&fwill automatically get placed"); /* Enhanced Furnaces */ public static final SlimefunItemStack ENHANCED_FURNACE = new SlimefunItemStack("ENHANCED_FURNACE", Material.FURNACE, "&7Enhanced Furnace - &eI", "", "&7Processing Speed: &e1x", "&7Fuel Efficiency: &e1x", "&7Luck Multiplier: &e1x"); @@ -600,6 +631,7 @@ public final class SlimefunItems { public static final SlimefunItemStack RAINBOW_RUNE = new SlimefunItemStack("ANCIENT_RUNE_RAINBOW", new ColoredFireworkStar(Color.FUCHSIA, "&7Ancient Rune &8&l[&d&lRainbow&8&l]")); public static final SlimefunItemStack LIGHTNING_RUNE = new SlimefunItemStack("ANCIENT_RUNE_LIGHTNING", new ColoredFireworkStar(Color.fromRGB(255, 255, 95), "&7Ancient Rune &8&l[&e&lLightning&8&l]")); public static final SlimefunItemStack SOULBOUND_RUNE = new SlimefunItemStack("ANCIENT_RUNE_SOULBOUND", new ColoredFireworkStar(Color.fromRGB(47, 0, 117), "&7Ancient Rune &8&l[&5&lSoulbound&8&l]", "&eDrop this rune onto a dropped item to", "&5bind ðat item to your soul.", " ", "&eIt is advised that you only use this rune", "&eon &6important &eitems.", " ", "&eItems bound to your soul won't drop on death.")); + public static final SlimefunItemStack ENCHANTMENT_RUNE = new SlimefunItemStack("ANCIENT_RUNE_ENCHANTMENT", new ColoredFireworkStar(Color.fromRGB(255, 217, 25), "&7Ancient Rune &8&l[&6&lEnchantment&8&l]", "&eDrop this rune onto a dropped item to", "&6enchant ðat item with a random enchantment.")); /* Electricity */ public static final SlimefunItemStack SOLAR_GENERATOR = new SlimefunItemStack("SOLAR_GENERATOR", Material.DAYLIGHT_DETECTOR, "&bSolar Generator", "", LoreBuilder.machine(MachineTier.BASIC, MachineType.GENERATOR), LoreBuilder.powerBuffer(0), LoreBuilder.powerPerSecond(4)); @@ -617,9 +649,9 @@ public final class SlimefunItems { public static final SlimefunItemStack ELECTRIC_FURNACE_2 = new SlimefunItemStack("ELECTRIC_FURNACE_2", Material.FURNACE, "&cElectric Furnace &7- &eII", "", LoreBuilder.machine(MachineTier.MEDIUM, MachineType.MACHINE), LoreBuilder.speed(2), LoreBuilder.powerPerSecond(6)); public static final SlimefunItemStack ELECTRIC_FURNACE_3 = new SlimefunItemStack("ELECTRIC_FURNACE_3", Material.FURNACE, "&cElectric Furnace &7- &eIII", "", LoreBuilder.machine(MachineTier.MEDIUM, MachineType.MACHINE), LoreBuilder.speed(4), LoreBuilder.powerPerSecond(10)); - public static final SlimefunItemStack ELECTRIC_ORE_GRINDER = new SlimefunItemStack("ELECTRIC_ORE_GRINDER", Material.FURNACE, "&cElectric Ore Grinder", "", "&rWorks as an Ore Crusher and Grind Stone", "", LoreBuilder.machine(MachineTier.ADVANCED, MachineType.MACHINE), LoreBuilder.speed(1), LoreBuilder.powerPerSecond(12)); - public static final SlimefunItemStack ELECTRIC_ORE_GRINDER_2 = new SlimefunItemStack("ELECTRIC_ORE_GRINDER_2", Material.FURNACE, "&cElectric Ore Grinder &7(&eII&7)", "", "&rWorks as an Ore Crusher and Grind Stone", "", LoreBuilder.machine(MachineTier.END_GAME, MachineType.MACHINE), LoreBuilder.speed(4), LoreBuilder.powerPerSecond(30)); - public static final SlimefunItemStack ELECTRIC_INGOT_PULVERIZER = new SlimefunItemStack("ELECTRIC_INGOT_PULVERIZER", Material.FURNACE, "&cElectric Ingot Pulverizer", "", "&rPulverizes Ingots into Dust", "", LoreBuilder.machine(MachineTier.MEDIUM, MachineType.MACHINE), LoreBuilder.speed(1), LoreBuilder.powerPerSecond(14)); + public static final SlimefunItemStack ELECTRIC_ORE_GRINDER = new SlimefunItemStack("ELECTRIC_ORE_GRINDER", Material.FURNACE, "&cElectric Ore Grinder", "", "&fWorks as an Ore Crusher and Grind Stone", "", LoreBuilder.machine(MachineTier.ADVANCED, MachineType.MACHINE), LoreBuilder.speed(1), LoreBuilder.powerPerSecond(12)); + public static final SlimefunItemStack ELECTRIC_ORE_GRINDER_2 = new SlimefunItemStack("ELECTRIC_ORE_GRINDER_2", Material.FURNACE, "&cElectric Ore Grinder &7(&eII&7)", "", "&fWorks as an Ore Crusher and Grind Stone", "", LoreBuilder.machine(MachineTier.END_GAME, MachineType.MACHINE), LoreBuilder.speed(4), LoreBuilder.powerPerSecond(30)); + public static final SlimefunItemStack ELECTRIC_INGOT_PULVERIZER = new SlimefunItemStack("ELECTRIC_INGOT_PULVERIZER", Material.FURNACE, "&cElectric Ingot Pulverizer", "", "&fPulverizes Ingots into Dust", "", LoreBuilder.machine(MachineTier.MEDIUM, MachineType.MACHINE), LoreBuilder.speed(1), LoreBuilder.powerPerSecond(14)); public static final SlimefunItemStack AUTO_DRIER; public static final SlimefunItemStack AUTO_ENCHANTER = new SlimefunItemStack("AUTO_ENCHANTER", Material.ENCHANTING_TABLE, "&5Auto Enchanter", "", LoreBuilder.machine(MachineTier.MEDIUM, MachineType.MACHINE), LoreBuilder.speed(1), LoreBuilder.powerPerSecond(18)); public static final SlimefunItemStack AUTO_DISENCHANTER = new SlimefunItemStack("AUTO_DISENCHANTER", Material.ENCHANTING_TABLE, "&5Auto Disenchanter", "", LoreBuilder.machine(MachineTier.MEDIUM, MachineType.MACHINE), LoreBuilder.speed(1), LoreBuilder.powerPerSecond(18)); @@ -628,7 +660,7 @@ public final class SlimefunItems { public static final SlimefunItemStack AUTO_BREWER; public static final SlimefunItemStack BIO_REACTOR = new SlimefunItemStack("BIO_REACTOR", Material.LIME_TERRACOTTA, "&2Bio Reactor", "", LoreBuilder.machine(MachineTier.AVERAGE, MachineType.GENERATOR), LoreBuilder.powerBuffer(128), LoreBuilder.powerPerSecond(8)); - public static final SlimefunItemStack MULTIMETER = new SlimefunItemStack("MULTIMETER", Material.CLOCK, "&eMultimeter", "", "&rMeasures the Amount of stored", "&rEnergy in a Block"); + public static final SlimefunItemStack MULTIMETER = new SlimefunItemStack("MULTIMETER", Material.CLOCK, "&eMultimeter", "", "&fMeasures the Amount of stored", "&fEnergy in a Block"); public static final SlimefunItemStack SMALL_CAPACITOR = new SlimefunItemStack("SMALL_CAPACITOR", HeadTexture.CAPACITOR_25, "&aSmall Energy Capacitor", "", LoreBuilder.machine(MachineTier.BASIC, MachineType.CAPACITOR), "&8\u21E8 &e\u26A1 &7128 J Capacity"); public static final SlimefunItemStack MEDIUM_CAPACITOR = new SlimefunItemStack("MEDIUM_CAPACITOR", HeadTexture.CAPACITOR_25, "&aMedium Energy Capacitor", "", LoreBuilder.machine(MachineTier.AVERAGE, MachineType.CAPACITOR), "&8\u21E8 &e\u26A1 &7512 J Capacity"); @@ -659,31 +691,31 @@ public final class SlimefunItems { public static final SlimefunItemStack GPS_TRANSMITTER_3 = new SlimefunItemStack("GPS_TRANSMITTER_3", HeadTexture.GPS_TRANSMITTER, "&4Carbonado GPS Transmitter", "", LoreBuilder.powerBuffer(256), LoreBuilder.powerPerSecond(22)); public static final SlimefunItemStack GPS_TRANSMITTER_4 = new SlimefunItemStack("GPS_TRANSMITTER_4", HeadTexture.GPS_TRANSMITTER, "&eEnergized GPS Transmitter", "", LoreBuilder.powerBuffer(1024), LoreBuilder.powerPerSecond(92)); - public static final SlimefunItemStack GPS_MARKER_TOOL = new SlimefunItemStack("GPS_MARKER_TOOL", Material.REDSTONE_TORCH, "&bGPS Marker Tool", "", "&rAllows you to set a Waypoint at", "&rthe Location you place this"); - public static final SlimefunItemStack GPS_CONTROL_PANEL = new SlimefunItemStack("GPS_CONTROL_PANEL", HeadTexture.GPS_CONTROL_PANEL, "&bGPS Control Panel", "", "&rAllows you to track your Satellites", "&rand manage your Waypoints"); - public static final SlimefunItemStack GPS_EMERGENCY_TRANSMITTER = new SlimefunItemStack("GPS_EMERGENCY_TRANSMITTER", HeadTexture.GPS_TRANSMITTER, "&cGPS Emergency Transmitter", "", "&rCarrying this in your Inventory", "&rautomatically sets a Waypoint", "&rat your Location when you die."); + public static final SlimefunItemStack GPS_MARKER_TOOL = new SlimefunItemStack("GPS_MARKER_TOOL", Material.REDSTONE_TORCH, "&bGPS Marker Tool", "", "&fAllows you to set a Waypoint at", "&fthe Location you place this"); + public static final SlimefunItemStack GPS_CONTROL_PANEL = new SlimefunItemStack("GPS_CONTROL_PANEL", HeadTexture.GPS_CONTROL_PANEL, "&bGPS Control Panel", "", "&fAllows you to track your Satellites", "&fand manage your Waypoints"); + public static final SlimefunItemStack GPS_EMERGENCY_TRANSMITTER = new SlimefunItemStack("GPS_EMERGENCY_TRANSMITTER", HeadTexture.GPS_TRANSMITTER, "&cGPS Emergency Transmitter", "", "&fCarrying this in your Inventory", "&fautomatically sets a Waypoint", "&fat your Location when you die."); - public static final SlimefunItemStack ANDROID_INTERFACE_FUEL = new SlimefunItemStack("ANDROID_INTERFACE_FUEL", Material.DISPENSER, "&7Android Interface &c(Fuel)", "", "&rItems stored in this Interface", "&rwill be inserted into an Android's Fuel Slot", "&rwhen its Script tells them to do so"); - public static final SlimefunItemStack ANDROID_INTERFACE_ITEMS = new SlimefunItemStack("ANDROID_INTERFACE_ITEMS", Material.DISPENSER, "&7Android Interface &9(Items)", "", "&rItems stored in an Android's Inventory", "&rwill be inserted into this Interface", "&rwhen its Script tells them to do so"); + public static final SlimefunItemStack ANDROID_INTERFACE_FUEL = new SlimefunItemStack("ANDROID_INTERFACE_FUEL", Material.DISPENSER, "&7Android Interface &c(Fuel)", "", "&fItems stored in this Interface", "&fwill be inserted into an Android's Fuel Slot", "&fwhen its Script tells them to do so"); + public static final SlimefunItemStack ANDROID_INTERFACE_ITEMS = new SlimefunItemStack("ANDROID_INTERFACE_ITEMS", Material.DISPENSER, "&7Android Interface &9(Items)", "", "&fItems stored in an Android's Inventory", "&fwill be inserted into this Interface", "&fwhen its Script tells them to do so"); - public static final SlimefunItemStack GPS_GEO_SCANNER = new SlimefunItemStack("GPS_GEO_SCANNER", HeadTexture.GEO_SCANNER, "&bGPS Geo-Scanner", "", "&rScans a Chunk for natural Resources", "&rsuch as &8Oil"); - public static final SlimefunItemStack PORTABLE_GEO_SCANNER = new SlimefunItemStack("PORTABLE_GEO_SCANNER", Material.CLOCK, "&bPortable Geo-Scanner", "", "&rScans a Chunk for natural Resources", "", "&eRight Click&7 to scan"); + public static final SlimefunItemStack GPS_GEO_SCANNER = new SlimefunItemStack("GPS_GEO_SCANNER", HeadTexture.GEO_SCANNER, "&bGPS Geo-Scanner", "", "&fScans a Chunk for natural Resources", "&fsuch as &8Oil"); + public static final SlimefunItemStack PORTABLE_GEO_SCANNER = new SlimefunItemStack("PORTABLE_GEO_SCANNER", Material.CLOCK, "&bPortable Geo-Scanner", "", "&fScans a Chunk for natural Resources", "", "&eRight Click&7 to scan"); public static final SlimefunItemStack GEO_MINER = new SlimefunItemStack("GEO_MINER", HeadTexture.GEO_MINER, "&6GEO Miner", "", "&eMines up resources from the chunk", "&eThese Resources cannot be mined with a pickaxe", "", LoreBuilder.machine(MachineTier.ADVANCED, MachineType.MACHINE), LoreBuilder.speed(1), LoreBuilder.powerPerSecond(48), "", "&c&l! &cMake sure to Geo-Scan the Chunk first"); - public static final SlimefunItemStack OIL_PUMP = new SlimefunItemStack("OIL_PUMP", HeadTexture.OIL_PUMP, "&rOil Pump", "", "&7Pumps up Oil and fills it into Buckets", "", "&c&l! &cMake sure to Geo-Scan the Chunk first"); - public static final SlimefunItemStack OIL_BUCKET = new SlimefunItemStack("BUCKET_OF_OIL", HeadTexture.OIL_BUCKET, "&rBucket of Oil"); - public static final SlimefunItemStack FUEL_BUCKET = new SlimefunItemStack("BUCKET_OF_FUEL", HeadTexture.FUEL_BUCKET, "&rBucket of Fuel"); + public static final SlimefunItemStack OIL_PUMP = new SlimefunItemStack("OIL_PUMP", HeadTexture.OIL_PUMP, "&fOil Pump", "", "&7Pumps up Oil and fills it into Buckets", "", "&c&l! &cMake sure to Geo-Scan the Chunk first"); + public static final SlimefunItemStack OIL_BUCKET = new SlimefunItemStack("BUCKET_OF_OIL", HeadTexture.OIL_BUCKET, "&fBucket of Oil"); + public static final SlimefunItemStack FUEL_BUCKET = new SlimefunItemStack("BUCKET_OF_FUEL", HeadTexture.FUEL_BUCKET, "&fBucket of Fuel"); - public static final SlimefunItemStack REFINERY = new SlimefunItemStack("REFINERY", Material.PISTON, "&cRefinery", "", "&rRefines Oil to create Fuel"); + public static final SlimefunItemStack REFINERY = new SlimefunItemStack("REFINERY", Material.PISTON, "&cRefinery", "", "&fRefines Oil to create Fuel"); public static final SlimefunItemStack COMBUSTION_REACTOR = new SlimefunItemStack("COMBUSTION_REACTOR", HeadTexture.GENERATOR, "&cCombustion Reactor", "", LoreBuilder.machine(MachineTier.ADVANCED, MachineType.GENERATOR), LoreBuilder.powerBuffer(256), LoreBuilder.powerPerSecond(24)); public static final SlimefunItemStack ANDROID_MEMORY_CORE = new SlimefunItemStack("ANDROID_MEMORY_CORE", HeadTexture.ENERGY_REGULATOR, "&bAndroid Memory Core"); public static final SlimefunItemStack GPS_TELEPORTER_PYLON = new SlimefunItemStack("GPS_TELEPORTER_PYLON", Material.PURPLE_STAINED_GLASS, "&5GPS Teleporter Pylon", "", "&7Teleporter Component"); - public static final SlimefunItemStack GPS_TELEPORTATION_MATRIX = new SlimefunItemStack("GPS_TELEPORTATION_MATRIX", Material.IRON_BLOCK, "&bGPS Teleporter Matrix", "", "&rThis is your Teleporter's Main Component", "&rThis Matrix allows Players to choose from all", "&rWaypoints made by the Player who has placed", "&rthis Device."); - public static final SlimefunItemStack GPS_ACTIVATION_DEVICE_SHARED = new SlimefunItemStack("GPS_ACTIVATION_DEVICE_SHARED", Material.STONE_PRESSURE_PLATE, "&rGPS Activation Device &3(Shared)", "", "&rPlace this onto a Teleportation Matrix", "&rand step onto this Plate to activate", "&rthe Teleportation Process"); - public static final SlimefunItemStack GPS_ACTIVATION_DEVICE_PERSONAL = new SlimefunItemStack("GPS_ACTIVATION_DEVICE_PERSONAL", Material.STONE_PRESSURE_PLATE, "&rGPS Activation Device &a(Personal)", "", "&rPlace this onto a Teleportation Matrix", "&rand step onto this Plate to activate", "&rthe Teleportation Process", "", "&rThis Version only allows the Person who", "&rplaced this Device to use it"); + public static final SlimefunItemStack GPS_TELEPORTATION_MATRIX = new SlimefunItemStack("GPS_TELEPORTATION_MATRIX", Material.IRON_BLOCK, "&bGPS Teleporter Matrix", "", "&fThis is your Teleporter's Main Component", "&fThis Matrix allows Players to choose from all", "&fWaypoints made by the Player who has placed", "&fthis Device."); + public static final SlimefunItemStack GPS_ACTIVATION_DEVICE_SHARED = new SlimefunItemStack("GPS_ACTIVATION_DEVICE_SHARED", Material.STONE_PRESSURE_PLATE, "&fGPS Activation Device &3(Shared)", "", "&fPlace this onto a Teleportation Matrix", "&fand step onto this Plate to activate", "&fthe Teleportation Process"); + public static final SlimefunItemStack GPS_ACTIVATION_DEVICE_PERSONAL = new SlimefunItemStack("GPS_ACTIVATION_DEVICE_PERSONAL", Material.STONE_PRESSURE_PLATE, "&fGPS Activation Device &a(Personal)", "", "&fPlace this onto a Teleportation Matrix", "&fand step onto this Plate to activate", "&fthe Teleportation Process", "", "&fThis Version only allows the Person who", "&fplaced this Device to use it"); - public static final SlimefunItemStack ELEVATOR_PLATE = new SlimefunItemStack("ELEVATOR_PLATE", Material.STONE_PRESSURE_PLATE, "&bElevator Plate", "", "&rPlace an Elevator Plate on every floor", "&rand you will be able to teleport between them.", "", "&eRight Click this Block &7to name it"); - public static final SlimefunItemStack INFUSED_HOPPER = new SlimefunItemStack("INFUSED_HOPPER", Material.HOPPER, "&5Infused Hopper", "", "&rAutomatically picks up nearby Items in a 7x7x7", "&rRadius when placed."); + public static final SlimefunItemStack ELEVATOR_PLATE = new SlimefunItemStack("ELEVATOR_PLATE", Material.STONE_PRESSURE_PLATE, "&bElevator Plate", "", "&fPlace an Elevator Plate on every floor", "&fand you will be able to teleport between them.", "", "&eRight Click this Block &7to name it"); + public static final SlimefunItemStack INFUSED_HOPPER = new SlimefunItemStack("INFUSED_HOPPER", Material.HOPPER, "&5Infused Hopper", "", "&fAutomatically picks up nearby Items in a 7x7x7", "&fRadius when placed."); public static final SlimefunItemStack HEATED_PRESSURE_CHAMBER = new SlimefunItemStack("HEATED_PRESSURE_CHAMBER", Material.LIGHT_GRAY_STAINED_GLASS, "&cHeated Pressure Chamber", "", LoreBuilder.machine(MachineTier.END_GAME, MachineType.MACHINE), LoreBuilder.speed(1), LoreBuilder.powerPerSecond(10)); public static final SlimefunItemStack HEATED_PRESSURE_CHAMBER_2 = new SlimefunItemStack("HEATED_PRESSURE_CHAMBER_2", Material.LIGHT_GRAY_STAINED_GLASS, "&cHeated Pressure Chamber &7- &eII", "", LoreBuilder.machine(MachineTier.END_GAME, MachineType.MACHINE), LoreBuilder.speed(5), LoreBuilder.powerPerSecond(44)); @@ -706,21 +738,21 @@ public final class SlimefunItems { public static final SlimefunItemStack BLISTERING_INGOT_2 = new SlimefunItemStack("BLISTERING_INGOT_2", Material.GOLD_INGOT, "&6Blistering Ingot &7(66%)", "", LoreBuilder.radioactive(Radioactivity.VERY_HIGH), LoreBuilder.HAZMAT_SUIT_REQUIRED); public static final SlimefunItemStack BLISTERING_INGOT_3 = new SlimefunItemStack("BLISTERING_INGOT_3", Material.GOLD_INGOT, "&6Blistering Ingot", "", LoreBuilder.radioactive(Radioactivity.VERY_HIGH), LoreBuilder.HAZMAT_SUIT_REQUIRED); - public static final SlimefunItemStack ENERGY_REGULATOR = new SlimefunItemStack("ENERGY_REGULATOR", HeadTexture.ENERGY_REGULATOR, "&6Energy Regulator", "", "&rCore Component of an Energy Network"); - public static final SlimefunItemStack DEBUG_FISH = new SlimefunItemStack("DEBUG_FISH", Material.SALMON, "&3How much is the Fish?", "", "&eRight Click &rany Block to view it's BlockData", "&eLeft Click &rto break a Block", "&eShift + Left Click &rany Block to erase it's BlockData", "&eShift + Right Click &rto place a Placeholder Block"); + public static final SlimefunItemStack ENERGY_REGULATOR = new SlimefunItemStack("ENERGY_REGULATOR", HeadTexture.ENERGY_REGULATOR, "&6Energy Regulator", "", "&fCore Component of an Energy Network"); + public static final SlimefunItemStack DEBUG_FISH = new SlimefunItemStack("DEBUG_FISH", Material.SALMON, "&3How much is the Fish?", "", "&eRight Click &fany Block to view it's BlockData", "&eLeft Click &fto break a Block", "&eShift + Left Click &fany Block to erase it's BlockData", "&eShift + Right Click &fto place a Placeholder Block"); public static final SlimefunItemStack NETHER_ICE = new SlimefunItemStack("NETHER_ICE", HeadTexture.NETHER_ICE, "&eNether Ice", "", LoreBuilder.radioactive(Radioactivity.MODERATE), LoreBuilder.HAZMAT_SUIT_REQUIRED); public static final SlimefunItemStack ENRICHED_NETHER_ICE = new SlimefunItemStack("ENRICHED_NETHER_ICE", HeadTexture.ENRICHED_NETHER_ICE, "&eEnriched Nether Ice", "", LoreBuilder.radioactive(Radioactivity.VERY_HIGH), LoreBuilder.HAZMAT_SUIT_REQUIRED); public static final SlimefunItemStack NETHER_ICE_COOLANT_CELL = new SlimefunItemStack("NETHER_ICE_COOLANT_CELL", HeadTexture.NETHER_ICE_COOLANT_CELL, "&6Nether Ice Coolant Cell"); // Cargo - public static final SlimefunItemStack CARGO_MANAGER = new SlimefunItemStack("CARGO_MANAGER", HeadTexture.CARGO_MANAGER, "&6Cargo Manager", "", "&rCore Component of an Item Transport Network"); - public static final SlimefunItemStack CARGO_CONNECTOR_NODE = new SlimefunItemStack("CARGO_NODE", HeadTexture.CARGO_CONNECTOR_NODE, "&7Cargo Node &c(Connector)", "", "&rCargo Connector Pipe"); - public static final SlimefunItemStack CARGO_INPUT_NODE = new SlimefunItemStack("CARGO_NODE_INPUT", HeadTexture.CARGO_INPUT_NODE, "&7Cargo Node &c(Input)", "", "&rCargo Input Pipe"); - public static final SlimefunItemStack CARGO_OUTPUT_NODE = new SlimefunItemStack("CARGO_NODE_OUTPUT", HeadTexture.CARGO_OUTPUT_NODE, "&7Cargo Node &c(Output)", "", "&rCargo Output Pipe"); - public static final SlimefunItemStack CARGO_OUTPUT_NODE_2 = new SlimefunItemStack("CARGO_NODE_OUTPUT_ADVANCED", HeadTexture.CARGO_OUTPUT_NODE, "&6Advanced Cargo Node &c(Output)", "", "&rCargo Output Pipe"); + public static final SlimefunItemStack CARGO_MANAGER = new SlimefunItemStack("CARGO_MANAGER", HeadTexture.CARGO_MANAGER, "&6Cargo Manager", "", "&fCore Component of an Item Transport Network"); + public static final SlimefunItemStack CARGO_CONNECTOR_NODE = new SlimefunItemStack("CARGO_NODE", HeadTexture.CARGO_CONNECTOR_NODE, "&7Cargo Node &c(Connector)", "", "&fCargo Connector Pipe"); + public static final SlimefunItemStack CARGO_INPUT_NODE = new SlimefunItemStack("CARGO_NODE_INPUT", HeadTexture.CARGO_INPUT_NODE, "&7Cargo Node &c(Input)", "", "&fCargo Input Pipe"); + public static final SlimefunItemStack CARGO_OUTPUT_NODE = new SlimefunItemStack("CARGO_NODE_OUTPUT", HeadTexture.CARGO_OUTPUT_NODE, "&7Cargo Node &c(Output)", "", "&fCargo Output Pipe"); + public static final SlimefunItemStack CARGO_OUTPUT_NODE_2 = new SlimefunItemStack("CARGO_NODE_OUTPUT_ADVANCED", HeadTexture.CARGO_OUTPUT_NODE, "&6Advanced Cargo Node &c(Output)", "", "&fCargo Output Pipe"); - public static final SlimefunItemStack AUTO_BREEDER = new SlimefunItemStack("AUTO_BREEDER", Material.HAY_BLOCK, "&eAuto-Breeder", "", "&rRuns on &aOrganic Food", "", LoreBuilder.machine(MachineTier.END_GAME, MachineType.MACHINE), LoreBuilder.powerBuffer(1024), "&8\u21E8 &e\u26A1 &760 J/Animal"); + public static final SlimefunItemStack AUTO_BREEDER = new SlimefunItemStack("AUTO_BREEDER", Material.HAY_BLOCK, "&eAuto-Breeder", "", "&fRuns on &aOrganic Food", "", LoreBuilder.machine(MachineTier.END_GAME, MachineType.MACHINE), LoreBuilder.powerBuffer(1024), "&8\u21E8 &e\u26A1 &760 J/Animal"); public static final SlimefunItemStack ORGANIC_FOOD = new SlimefunItemStack("ORGANIC_FOOD", HeadTexture.FILLED_CAN, "&aOrganic Food", "&7Content: &9???"); public static final SlimefunItemStack WHEAT_ORGANIC_FOOD = new SlimefunItemStack("ORGANIC_FOOD_WHEAT", HeadTexture.FILLED_CAN, "&aOrganic Food", "&7Content: &9Wheat"); @@ -746,23 +778,23 @@ public final class SlimefunItems { public static final SlimefunItemStack KELP_FERTILIZER = new SlimefunItemStack("FERTILIZER_KELP", HeadTexture.FILLED_CAN, "&aOrganic Fertilizer", "&7Content: &9Dried Kelp"); public static final SlimefunItemStack COCOA_FERTILIZER = new SlimefunItemStack("FERTILIZER_COCOA", HeadTexture.FILLED_CAN, "&aOrganic Fertilizer", "&7Content: &9Cocoa beans"); - public static final SlimefunItemStack ANIMAL_GROWTH_ACCELERATOR = new SlimefunItemStack("ANIMAL_GROWTH_ACCELERATOR", Material.HAY_BLOCK, "&bAnimal Growth Accelerator", "", "&rRuns on &aOrganic Food", "", LoreBuilder.machine(MachineTier.END_GAME, MachineType.MACHINE), LoreBuilder.powerBuffer(1024), LoreBuilder.powerPerSecond(28)); - public static final SlimefunItemStack CROP_GROWTH_ACCELERATOR = new SlimefunItemStack("CROP_GROWTH_ACCELERATOR", Material.LIME_TERRACOTTA, "&aCrop Growth Accelerator", "", "&rRuns on &aOrganic Fertilizer", "", LoreBuilder.machine(MachineTier.END_GAME, MachineType.MACHINE), "&8\u21E8 &7Radius: 7x7", "&8\u21E8 &7Speed: &a3/time", LoreBuilder.powerBuffer(1024), LoreBuilder.powerPerSecond(50)); - public static final SlimefunItemStack CROP_GROWTH_ACCELERATOR_2 = new SlimefunItemStack("CROP_GROWTH_ACCELERATOR_2", Material.LIME_TERRACOTTA, "&aCrop Growth Accelerator &7(&eII&7)", "", "&rRuns on &aOrganic Fertilizer", "", LoreBuilder.machine(MachineTier.END_GAME, MachineType.MACHINE), "&8\u21E8 &7Radius: 9x9", "&8\u21E8 &7Speed: &a4/time", LoreBuilder.powerBuffer(1024), LoreBuilder.powerPerSecond(60)); - public static final SlimefunItemStack TREE_GROWTH_ACCELERATOR = new SlimefunItemStack("TREE_GROWTH_ACCELERATOR", Material.BROWN_TERRACOTTA, "&aTree Growth Accelerator", "", "&rRuns on &aOrganic Fertilizer", "", LoreBuilder.machine(MachineTier.END_GAME, MachineType.MACHINE), "&8\u21E8 &7Radius: 9x9", "&8\u21E8 &7Speed: &a4/time", LoreBuilder.powerBuffer(1024), LoreBuilder.powerPerSecond(48)); + public static final SlimefunItemStack ANIMAL_GROWTH_ACCELERATOR = new SlimefunItemStack("ANIMAL_GROWTH_ACCELERATOR", Material.HAY_BLOCK, "&bAnimal Growth Accelerator", "", "&fRuns on &aOrganic Food", "", LoreBuilder.machine(MachineTier.END_GAME, MachineType.MACHINE), LoreBuilder.powerBuffer(1024), LoreBuilder.powerPerSecond(28)); + public static final SlimefunItemStack CROP_GROWTH_ACCELERATOR = new SlimefunItemStack("CROP_GROWTH_ACCELERATOR", Material.LIME_TERRACOTTA, "&aCrop Growth Accelerator", "", "&fRuns on &aOrganic Fertilizer", "", LoreBuilder.machine(MachineTier.END_GAME, MachineType.MACHINE), "&8\u21E8 &7Radius: 7x7", "&8\u21E8 &7Speed: &a3/time", LoreBuilder.powerBuffer(1024), LoreBuilder.powerPerSecond(50)); + public static final SlimefunItemStack CROP_GROWTH_ACCELERATOR_2 = new SlimefunItemStack("CROP_GROWTH_ACCELERATOR_2", Material.LIME_TERRACOTTA, "&aCrop Growth Accelerator &7(&eII&7)", "", "&fRuns on &aOrganic Fertilizer", "", LoreBuilder.machine(MachineTier.END_GAME, MachineType.MACHINE), "&8\u21E8 &7Radius: 9x9", "&8\u21E8 &7Speed: &a4/time", LoreBuilder.powerBuffer(1024), LoreBuilder.powerPerSecond(60)); + public static final SlimefunItemStack TREE_GROWTH_ACCELERATOR = new SlimefunItemStack("TREE_GROWTH_ACCELERATOR", Material.BROWN_TERRACOTTA, "&aTree Growth Accelerator", "", "&fRuns on &aOrganic Fertilizer", "", LoreBuilder.machine(MachineTier.END_GAME, MachineType.MACHINE), "&8\u21E8 &7Radius: 9x9", "&8\u21E8 &7Speed: &a4/time", LoreBuilder.powerBuffer(1024), LoreBuilder.powerPerSecond(48)); - public static final SlimefunItemStack FOOD_FABRICATOR = new SlimefunItemStack("FOOD_FABRICATOR", Material.GREEN_STAINED_GLASS, "&cFood Fabricator", "", "&rProduces &aOrganic Food", "", LoreBuilder.machine(MachineTier.ADVANCED, MachineType.MACHINE), LoreBuilder.speed(1), LoreBuilder.powerBuffer(256), LoreBuilder.powerPerSecond(14)); - public static final SlimefunItemStack FOOD_FABRICATOR_2 = new SlimefunItemStack("FOOD_FABRICATOR_2", Material.GREEN_STAINED_GLASS, "&cFood Fabricator &7(&eII&7)", "", "&rProduces &aOrganic Food", "", LoreBuilder.machine(MachineTier.END_GAME, MachineType.MACHINE), LoreBuilder.speed(6), LoreBuilder.powerBuffer(512), LoreBuilder.powerPerSecond(48)); + public static final SlimefunItemStack FOOD_FABRICATOR = new SlimefunItemStack("FOOD_FABRICATOR", Material.GREEN_STAINED_GLASS, "&cFood Fabricator", "", "&fProduces &aOrganic Food", "", LoreBuilder.machine(MachineTier.ADVANCED, MachineType.MACHINE), LoreBuilder.speed(1), LoreBuilder.powerBuffer(256), LoreBuilder.powerPerSecond(14)); + public static final SlimefunItemStack FOOD_FABRICATOR_2 = new SlimefunItemStack("FOOD_FABRICATOR_2", Material.GREEN_STAINED_GLASS, "&cFood Fabricator &7(&eII&7)", "", "&fProduces &aOrganic Food", "", LoreBuilder.machine(MachineTier.END_GAME, MachineType.MACHINE), LoreBuilder.speed(6), LoreBuilder.powerBuffer(512), LoreBuilder.powerPerSecond(48)); - public static final SlimefunItemStack FOOD_COMPOSTER = new SlimefunItemStack("FOOD_COMPOSTER", Material.GREEN_TERRACOTTA, "&cFood Composter", "", "&rProduces &aOrganic Fertilizer", "", LoreBuilder.machine(MachineTier.ADVANCED, MachineType.MACHINE), LoreBuilder.speed(1), LoreBuilder.powerBuffer(256), LoreBuilder.powerPerSecond(16)); - public static final SlimefunItemStack FOOD_COMPOSTER_2 = new SlimefunItemStack("FOOD_COMPOSTER_2", Material.GREEN_TERRACOTTA, "&cFood Composter &7(&eII&7)", "", "&rProduces &aOrganic Fertilizer", "", LoreBuilder.machine(MachineTier.END_GAME, MachineType.MACHINE), LoreBuilder.speed(10), LoreBuilder.powerBuffer(512), LoreBuilder.powerPerSecond(52)); + public static final SlimefunItemStack FOOD_COMPOSTER = new SlimefunItemStack("FOOD_COMPOSTER", Material.GREEN_TERRACOTTA, "&cFood Composter", "", "&fProduces &aOrganic Fertilizer", "", LoreBuilder.machine(MachineTier.ADVANCED, MachineType.MACHINE), LoreBuilder.speed(1), LoreBuilder.powerBuffer(256), LoreBuilder.powerPerSecond(16)); + public static final SlimefunItemStack FOOD_COMPOSTER_2 = new SlimefunItemStack("FOOD_COMPOSTER_2", Material.GREEN_TERRACOTTA, "&cFood Composter &7(&eII&7)", "", "&fProduces &aOrganic Fertilizer", "", LoreBuilder.machine(MachineTier.END_GAME, MachineType.MACHINE), LoreBuilder.speed(10), LoreBuilder.powerBuffer(512), LoreBuilder.powerPerSecond(52)); - public static final SlimefunItemStack EXP_COLLECTOR = new SlimefunItemStack("XP_COLLECTOR", HeadTexture.EXP_COLLECTOR, "&aEXP Collector", "", "&rCollects nearby Exp and stores it", "", LoreBuilder.machine(MachineTier.END_GAME, MachineType.MACHINE), LoreBuilder.powerBuffer(1024), LoreBuilder.powerPerSecond(20)); + public static final SlimefunItemStack EXP_COLLECTOR = new SlimefunItemStack("XP_COLLECTOR", HeadTexture.EXP_COLLECTOR, "&aEXP Collector", "", "&fCollects nearby Exp and stores it", "", LoreBuilder.machine(MachineTier.END_GAME, MachineType.MACHINE), LoreBuilder.powerBuffer(1024), LoreBuilder.powerPerSecond(20)); public static final SlimefunItemStack REACTOR_COOLANT_CELL = new SlimefunItemStack("REACTOR_COLLANT_CELL", HeadTexture.COOLANT_CELL, "&bReactor Coolant Cell"); - public static final SlimefunItemStack NUCLEAR_REACTOR = new SlimefunItemStack("NUCLEAR_REACTOR", HeadTexture.NUCLEAR_REACTOR, "&2Nuclear Reactor", "", "&rRequires Cooling!", "&8\u21E8 &bMust be surrounded by Water", "&8\u21E8 &bMust be supplied with Reactor Coolant Cells", "", LoreBuilder.machine(MachineTier.END_GAME, MachineType.GENERATOR), LoreBuilder.powerBuffer(16384), LoreBuilder.powerPerSecond(500)); + public static final SlimefunItemStack NUCLEAR_REACTOR = new SlimefunItemStack("NUCLEAR_REACTOR", HeadTexture.NUCLEAR_REACTOR, "&2Nuclear Reactor", "", "&fRequires Cooling!", "&8\u21E8 &bMust be surrounded by Water", "&8\u21E8 &bMust be supplied with Reactor Coolant Cells", "", LoreBuilder.machine(MachineTier.END_GAME, MachineType.GENERATOR), LoreBuilder.powerBuffer(16384), LoreBuilder.powerPerSecond(500)); public static final SlimefunItemStack NETHER_STAR_REACTOR = new SlimefunItemStack("NETHERSTAR_REACTOR", HeadTexture.NETHER_STAR_REACTOR, "&fNether Star Reactor", "", "&fRuns on Nether Stars", "&8\u21E8 &bMust be surrounded by Water", "&8\u21E8 &bMust be supplied with Nether Ice Coolant Cells", "", LoreBuilder.machine(MachineTier.END_GAME, MachineType.GENERATOR), LoreBuilder.powerBuffer(32768), LoreBuilder.powerPerSecond(1024), "&8\u21E8 &4Causes nearby Entities to get Withered"); - public static final SlimefunItemStack REACTOR_ACCESS_PORT = new SlimefunItemStack("REACTOR_ACCESS_PORT", Material.CYAN_TERRACOTTA, "&2Reactor Access Port", "", "&rAllows you to interact with a Reactor", "&rvia Cargo Nodes, can also be used", "&ras a Buffer", "", "&8\u21E8 &eMust be placed &a3 Blocks &eabove the Reactor"); + public static final SlimefunItemStack REACTOR_ACCESS_PORT = new SlimefunItemStack("REACTOR_ACCESS_PORT", Material.CYAN_TERRACOTTA, "&2Reactor Access Port", "", "&fAllows you to interact with a Reactor", "&fvia Cargo Nodes, can also be used", "&fas a Buffer", "", "&8\u21E8 &eMust be placed &a3 Blocks &eabove the Reactor"); public static final SlimefunItemStack FREEZER = new SlimefunItemStack("FREEZER", Material.LIGHT_BLUE_STAINED_GLASS, "&bFreezer", "", LoreBuilder.machine(MachineTier.ADVANCED, MachineType.MACHINE), LoreBuilder.speed(1), LoreBuilder.powerBuffer(256), LoreBuilder.powerPerSecond(18)); public static final SlimefunItemStack FREEZER_2 = new SlimefunItemStack("FREEZER_2", Material.LIGHT_BLUE_STAINED_GLASS, "&bFreezer &7(&eII&7)", "", LoreBuilder.machine(MachineTier.END_GAME, MachineType.MACHINE), LoreBuilder.speed(2), LoreBuilder.powerBuffer(256), LoreBuilder.powerPerSecond(30)); @@ -781,11 +813,11 @@ public final class SlimefunItems { public static final SlimefunItemStack AUTOMATED_CRAFTING_CHAMBER = new SlimefunItemStack("AUTOMATED_CRAFTING_CHAMBER", Material.CRAFTING_TABLE, "&6Automated Crafting Chamber", "", LoreBuilder.machine(MachineTier.ADVANCED, MachineType.MACHINE), "&8\u21E8 &e\u26A1 &710 J/Item"); public static final SlimefunItemStack FLUID_PUMP = new SlimefunItemStack("FLUID_PUMP", Material.BLUE_TERRACOTTA, "&9Fluid Pump", "", LoreBuilder.machine(MachineTier.ADVANCED, MachineType.MACHINE), "&8\u21E8 &e\u26A1 &732 J/Block"); - public static final SlimefunItemStack CHARGING_BENCH = new SlimefunItemStack("CHARGING_BENCH", Material.CRAFTING_TABLE, "&6Charging Bench", "", "&rCharges Items such as Jetpacks", "", LoreBuilder.machine(MachineTier.BASIC, MachineType.MACHINE), LoreBuilder.powerBuffer(128), "&8\u21E8 &e\u26A1 &7Energy Loss: &c50%"); + public static final SlimefunItemStack CHARGING_BENCH = new SlimefunItemStack("CHARGING_BENCH", Material.CRAFTING_TABLE, "&6Charging Bench", "", "&fCharges Items such as Jetpacks", "", LoreBuilder.machine(MachineTier.BASIC, MachineType.MACHINE), LoreBuilder.powerBuffer(128), "&8\u21E8 &e\u26A1 &7Energy Loss: &c50%"); public static final SlimefunItemStack WITHER_ASSEMBLER = new SlimefunItemStack("WITHER_ASSEMBLER", Material.OBSIDIAN, "&5Wither Assembler", "", LoreBuilder.machine(MachineTier.END_GAME, MachineType.MACHINE), "&8\u21E8 &7Cooldown: &b30 Seconds", LoreBuilder.powerBuffer(4096), "&8\u21E8 &e\u26A1 &74096 J/Wither"); - public static final SlimefunItemStack TRASH_CAN = new SlimefunItemStack("TRASH_CAN_BLOCK", HeadTexture.TRASH_CAN, "&3Trash Can", "", "&rWill destroy all Items put into it"); + public static final SlimefunItemStack TRASH_CAN = new SlimefunItemStack("TRASH_CAN_BLOCK", HeadTexture.TRASH_CAN, "&3Trash Can", "", "&fWill destroy all Items put into it"); public static final SlimefunItemStack ELYTRA_SCALE = new SlimefunItemStack("ELYTRA_SCALE", Material.FEATHER, "&bElytra Scale"); public static final SlimefunItemStack INFUSED_ELYTRA = new SlimefunItemStack("INFUSED_ELYTRA", Material.ELYTRA, "&5Infused Elytra"); @@ -799,14 +831,14 @@ public final class SlimefunItems { if (SlimefunPlugin.getMinecraftVersion().isAtLeast(MinecraftVersion.MINECRAFT_1_14)) { TABLE_SAW = new SlimefunItemStack("TABLE_SAW", Material.STONECUTTER, "&6Table Saw", "", "&aAllows you to get 8 planks from 1 Log", "&a(Works with all log types)"); - MAKESHIFT_SMELTERY = new SlimefunItemStack("MAKESHIFT_SMELTERY", Material.BLAST_FURNACE, "&eMakeshift Smeltery", "", "&rImprovised version of the Smeltery", "&rthat only allows you to", "&rsmelt dusts into ingots"); + MAKESHIFT_SMELTERY = new SlimefunItemStack("MAKESHIFT_SMELTERY", Material.BLAST_FURNACE, "&eMakeshift Smeltery", "", "&fImprovised version of the Smeltery", "&fthat only allows you to", "&fsmelt dusts into ingots"); AUTO_DRIER = new SlimefunItemStack("AUTO_DRIER", Material.SMOKER, "&eAuto Drier", "", LoreBuilder.machine(MachineTier.MEDIUM, MachineType.MACHINE), LoreBuilder.speed(1), LoreBuilder.powerPerSecond(10)); AUTO_BREWER = new SlimefunItemStack("AUTO_BREWER", Material.SMOKER, "&eAuto Brewer", "", LoreBuilder.machine(MachineTier.MEDIUM, MachineType.MACHINE), LoreBuilder.speed(1), LoreBuilder.powerPerSecond(12)); } else { TABLE_SAW = null; - MAKESHIFT_SMELTERY = new SlimefunItemStack("MAKESHIFT_SMELTERY", Material.FURNACE, "&eMakeshift Smeltery", "", "&rImprovised version of the Smeltery", "&rthat only allows you to", "&rsmelt dusts into ingots"); - AUTO_DRIER = null; + MAKESHIFT_SMELTERY = new SlimefunItemStack("MAKESHIFT_SMELTERY", Material.FURNACE, "&eMakeshift Smeltery", "", "&fImprovised version of the Smeltery", "&fthat only allows you to", "&fsmelt dusts into ingots"); + AUTO_DRIER = new SlimefunItemStack("AUTO_DRIER", Material.FURNACE, "&eAuto Drier", "", LoreBuilder.machine(MachineTier.MEDIUM, MachineType.MACHINE), LoreBuilder.speed(1), LoreBuilder.powerPerSecond(10)); AUTO_BREWER = new SlimefunItemStack("AUTO_BREWER", Material.BREWING_STAND, "&eAuto Brewer", LoreBuilder.machine(MachineTier.MEDIUM, MachineType.MACHINE), LoreBuilder.speed(1), LoreBuilder.powerPerSecond(12)); } } 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..e0433c82d --- /dev/null +++ b/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/SlimefunPlugin.java @@ -0,0 +1,652 @@ +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.core.services.profiler.SlimefunProfiler; +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.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.BeeListener; +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 { + + private 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 final SlimefunProfiler profiler = new SlimefunProfiler(); + 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() { + instance = this; + + if (minecraftVersion == MinecraftVersion.UNIT_TEST) { + 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; + } + + // Creating all necessary Folders + getLogger().log(Level.INFO, "Creating directories..."); + createDirectories(); + registry.load(config); + + // Set up localization + getLogger().log(Level.INFO, "Loading language files..."); + 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(); + + getLogger().log(Level.INFO, "Registering listeners..."); + registerListeners(); + + // Initiating various Stuff and all items with a slight 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); + + // This try/catch should prevent buggy Spigot builds from blocking item loading + try { + recipeService.refresh(); + } + catch (Exception | LinkageError x) { + getLogger().log(Level.SEVERE, x, () -> "An Exception occured while iterating through the Recipe list on Minecraft Version " + minecraftVersion.getName() + " (Slimefun v" + getVersion() + ")"); + } + + }), 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 { + instance = null; + + 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", "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 registerListeners() { + 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); + + if (minecraftVersion.isAtLeast(MinecraftVersion.MINECRAFT_1_15)) { + new BeeListener(this); + } + + new MobDropListener(this); + + // 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); + } + + 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 SlimefunPlugin instance() { + return instance; + } + + 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; + } + + public static SlimefunProfiler getProfiler() { + return instance.profiler; + } + + /** + * 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..afaa464d4 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,16 +26,16 @@ 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; public class BookSlimefunGuide implements SlimefunGuideImplementation { - private final NamespacedKey guideSearch = new NamespacedKey(SlimefunPlugin.instance, "search"); + private final NamespacedKey guideSearch = new NamespacedKey(SlimefunPlugin.instance(), "search"); @Override public SlimefunGuideLayout getLayout() { @@ -53,17 +53,17 @@ 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")); + CustomBookInterface book = new CustomBookInterface(SlimefunPlugin.instance()); + 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"); - ChatInput.waitForPlayer(SlimefunPlugin.instance, player, msg -> SlimefunGuide.openSearch(profile, msg, true, true)); + SlimefunPlugin.getLocalization().sendMessage(player, "guide.search.message"); + ChatInput.waitForPlayer(SlimefunPlugin.instance(), player, msg -> SlimefunGuide.openSearch(profile, msg, true, true)); }, 1))); page.append(header); @@ -75,9 +75,9 @@ 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"))); - button.setClickEvent(new ClickEvent(new NamespacedKey(SlimefunPlugin.instance, "slimefun_guide"), pl -> openMainMenu(profile, 1))); + 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); } @@ -189,13 +189,13 @@ public class BookSlimefunGuide implements SlimefunGuideImplementation { } private void appendSlimefunItem(Category category, int page, Player p, PlayerProfile profile, SlimefunItem item, List items) { - NamespacedKey key = new NamespacedKey(SlimefunPlugin.instance, item.getID().toLowerCase(Locale.ROOT)); + NamespacedKey key = new NamespacedKey(SlimefunPlugin.instance(), item.getID().toLowerCase(Locale.ROOT)); if (!Slimefun.hasUnlocked(p, item, false) && item.getResearch() != null) { 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 88c956b7a..52b3670ed 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; @@ -55,13 +55,13 @@ public class ChestSlimefunGuide implements SlimefunGuideImplementation { private final boolean showVanillaRecipes; public ChestSlimefunGuide(boolean vanillaRecipes) { + showVanillaRecipes = vanillaRecipes; + if (SlimefunPlugin.getMinecraftVersion().isAtLeast(MinecraftVersion.MINECRAFT_1_14)) { sound = Sound.ITEM_BOOK_PAGE_TURN; - showVanillaRecipes = vanillaRecipes; } else { sound = Sound.ENTITY_BAT_TAKEOFF; - showVanillaRecipes = false; } } @@ -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,8 +161,8 @@ public class ChestSlimefunGuide implements SlimefunGuideImplementation { List lore = new ArrayList<>(); lore.add(""); - for (String line : SlimefunPlugin.getLocal().getMessages(p, "guide.locked-category")) { - lore.add(ChatColor.RESET + line); + for (String line : SlimefunPlugin.getLocalization().getMessages(p, "guide.locked-category")) { + lore.add(ChatColor.WHITE + line); } lore.add(""); @@ -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- &r" + 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, "&r" + 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.RESET, 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) { @@ -316,7 +329,7 @@ public class ChestSlimefunGuide implements SlimefunGuideImplementation { ItemStack categoryItem = category.getItem(p); if (categoryItem != null && categoryItem.hasItemMeta() && categoryItem.getItemMeta().hasDisplayName()) { - lore = Arrays.asList("", ChatColor.DARK_GRAY + "\u21E8 " + ChatColor.RESET + categoryItem.getItemMeta().getDisplayName()); + lore = Arrays.asList("", ChatColor.DARK_GRAY + "\u21E8 " + ChatColor.WHITE + categoryItem.getItemMeta().getDisplayName()); } } @@ -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)); @@ -455,13 +468,16 @@ public class ChestSlimefunGuide implements SlimefunGuideImplementation { @Override public void displayItem(PlayerProfile profile, SlimefunItem item, boolean addToHistory) { Player p = profile.getPlayer(); - if (p == null) return; + + if (p == null) { + return; + } ChestMenu menu = create(p); Optional wiki = item.getWikipage(); if (wiki.isPresent()) { - menu.addItem(8, new CustomItem(Material.KNOWLEDGE_BOOK, ChatColor.RESET + 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()); @@ -544,8 +560,8 @@ public class ChestSlimefunGuide implements SlimefunGuideImplementation { menu.addMenuClickHandler(7, (pl, slot, item, action) -> { pl.closeInventory(); - SlimefunPlugin.getLocal().sendMessage(pl, "guide.search.message"); - ChatInput.waitForPlayer(SlimefunPlugin.instance, pl, msg -> SlimefunGuide.openSearch(profile, msg, isSurvivalMode(), isSurvivalMode())); + SlimefunPlugin.getLocalization().sendMessage(pl, "guide.search.message"); + ChatInput.waitForPlayer(SlimefunPlugin.instance(), pl, msg -> SlimefunGuide.openSearch(profile, msg, isSurvivalMode(), isSurvivalMode())); return false; }); @@ -559,7 +575,7 @@ public class ChestSlimefunGuide implements SlimefunGuideImplementation { GuideHistory history = profile.getGuideHistory(); if (isSurvivalMode() && history.size() > 1) { - menu.addItem(slot, new CustomItem(ChestMenuUtils.getBackButton(p, "", "&rLeft Click: &7Go back to previous Page", "&rShift + left Click: &7Go back to Main Menu"))); + menu.addItem(slot, new CustomItem(ChestMenuUtils.getBackButton(p, "", "&fLeft Click: &7Go back to previous Page", "&fShift + left Click: &7Go back to Main Menu"))); menu.addMenuClickHandler(slot, (pl, s, is, action) -> { if (action.isShiftClicked()) { @@ -573,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; @@ -589,8 +605,8 @@ public class ChestSlimefunGuide implements SlimefunGuideImplementation { return item; } - String lore = Slimefun.hasPermission(p, slimefunItem, false) ? "&rNeeds to be unlocked elsewhere" : "&rNo Permission"; - return Slimefun.hasUnlocked(p, slimefunItem, false) ? item : new CustomItem(Material.BARRIER, ItemUtils.getItemName(item), "&4&l" + SlimefunPlugin.getLocal().getMessage(p, "guide.locked"), "", lore); + 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.getLocalization().getMessage(p, "guide.locked"), "", lore); } else { return item; @@ -678,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)); @@ -686,8 +702,8 @@ public class ChestSlimefunGuide implements SlimefunGuideImplementation { } private void printErrorMessage(Player p, Throwable x) { - p.sendMessage(ChatColor.DARK_RED + "An internal server error has occured. Please inform an admin, check the console for further info."); - Slimefun.getLogger().log(Level.SEVERE, "An error has occured while trying to open a SlimefunItem in the guide!", x); + p.sendMessage(ChatColor.DARK_RED + "An internal server error has occurred. Please inform an admin, check the console for further info."); + Slimefun.getLogger().log(Level.SEVERE, "An error has occurred while trying to open a SlimefunItem in the guide!", x); } } 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..642ff0b58 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 @@ -42,7 +42,7 @@ class RecipeChoiceTask implements Runnable { public void start(Inventory inv) { Validate.notNull(inv, "Inventory must not be null"); inventory = inv; - id = Bukkit.getScheduler().runTaskTimerAsynchronously(SlimefunPlugin.instance, this, 0, UPDATE_INTERVAL).getTaskId(); + id = Bukkit.getScheduler().runTaskTimerAsynchronously(SlimefunPlugin.instance(), this, 0, UPDATE_INTERVAL).getTaskId(); } public void add(int slot, MaterialChoice choice) { diff --git a/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/items/RadioactiveItem.java b/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/items/RadioactiveItem.java index c8e0052b5..3135ee83c 100644 --- a/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/items/RadioactiveItem.java +++ b/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/items/RadioactiveItem.java @@ -2,8 +2,11 @@ package io.github.thebusybiscuit.slimefun4.implementation.items; import org.bukkit.inventory.ItemStack; +import io.github.thebusybiscuit.slimefun4.api.events.PlayerRightClickEvent; +import io.github.thebusybiscuit.slimefun4.core.attributes.NotPlaceable; import io.github.thebusybiscuit.slimefun4.core.attributes.Radioactive; import io.github.thebusybiscuit.slimefun4.core.attributes.Radioactivity; +import io.github.thebusybiscuit.slimefun4.core.handlers.ItemUseHandler; import me.mrCookieSlime.Slimefun.Lists.RecipeType; import me.mrCookieSlime.Slimefun.Objects.Category; import me.mrCookieSlime.Slimefun.Objects.SlimefunItem.SlimefunItem; @@ -21,7 +24,7 @@ import me.mrCookieSlime.Slimefun.api.SlimefunItemStack; * @see Radioactivity * */ -public class RadioactiveItem extends SlimefunItem implements Radioactive { +public class RadioactiveItem extends SlimefunItem implements Radioactive, NotPlaceable { private final Radioactivity radioactivity; @@ -41,8 +44,14 @@ public class RadioactiveItem extends SlimefunItem implements Radioactive { */ public RadioactiveItem(Category category, Radioactivity radioactivity, SlimefunItemStack item, RecipeType recipeType, ItemStack[] recipe) { super(category, item, recipeType, recipe); - + this.radioactivity = radioactivity; + + addItemHandler(onRightClick()); + } + + private ItemUseHandler onRightClick() { + return PlayerRightClickEvent::cancel; } @Override diff --git a/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/items/SimpleSlimefunItem.java b/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/items/SimpleSlimefunItem.java new file mode 100644 index 000000000..f8ce58999 --- /dev/null +++ b/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/items/SimpleSlimefunItem.java @@ -0,0 +1,50 @@ +package io.github.thebusybiscuit.slimefun4.implementation.items; + +import org.bukkit.inventory.ItemStack; + +import io.github.thebusybiscuit.slimefun4.core.handlers.ItemUseHandler; +import me.mrCookieSlime.Slimefun.Lists.RecipeType; +import me.mrCookieSlime.Slimefun.Objects.Category; +import me.mrCookieSlime.Slimefun.Objects.SlimefunItem.SlimefunItem; +import me.mrCookieSlime.Slimefun.Objects.handlers.ItemHandler; +import me.mrCookieSlime.Slimefun.api.SlimefunItemStack; + +/** + * This is basically a quickstart class for your very first {@link SlimefunItem}. + * This class easily allows you to add one {@link ItemHandler} to your {@link SlimefunItem}. + * + * You could use an {@link ItemUseHandler} for example to give your {@link SlimefunItem} + * very basic right-click functionalities. + * + * @author TheBusyBiscuit + * + * @see ItemHandler + * @see ItemUseHandler + * @see SlimefunItem + * + * @param + * The Type of {@link ItemHandler} to add to this {@link SlimefunItem} + */ +public abstract class SimpleSlimefunItem extends SlimefunItem { + + public SimpleSlimefunItem(Category category, SlimefunItemStack item, RecipeType recipeType, ItemStack[] recipe) { + super(category, item, recipeType, recipe); + } + + public SimpleSlimefunItem(Category category, SlimefunItemStack item, RecipeType recipeType, ItemStack[] recipe, ItemStack recipeOutput) { + super(category, item, recipeType, recipe, recipeOutput); + } + + @Override + public void preRegister() { + addItemHandler(getItemHandler()); + } + + /** + * This returns the {@link ItemHandler} that will be added to this {@link SlimefunItem}. + * + * @return The {@link ItemHandler} that should be added to this {@link SlimefunItem} + */ + public abstract T getItemHandler(); + +} 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..a57fddafa 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; @@ -20,7 +20,7 @@ public class AncientPedestal extends SlimefunItem { Item stack = listener.findItem(b); if (stack != null) { - stack.removeMetadata("no_pickup", SlimefunPlugin.instance); + stack.removeMetadata("no_pickup", SlimefunPlugin.instance()); b.getWorld().dropItem(b.getLocation(), listener.fixItemStack(stack.getItemStack(), stack.getCustomName())); stack.remove(); } 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..716d21473 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; @@ -44,10 +44,7 @@ public abstract class AdvancedFarmerAndroid extends FarmerAndroid { if (result.isPresent()) { ItemStack drop = result.get(); menu.pushItem(drop, getOutputSlots()); - - if (menu.fits(drop, getOutputSlots())) { - block.getWorld().playEffect(block.getLocation(), Effect.STEP_SOUND, block.getType()); - } + block.getWorld().playEffect(block.getLocation(), Effect.STEP_SOUND, block.getType()); } } } 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..0c1e8ad0f 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,10 +11,9 @@ 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; import me.mrCookieSlime.Slimefun.api.SlimefunItemStack; public abstract class ButcherAndroid extends ProgrammableAndroid { @@ -31,14 +30,14 @@ public abstract class ButcherAndroid extends ProgrammableAndroid { } @Override - protected void attack(Block b, Predicate predicate) { + protected void attack(Block b, BlockFace face, Predicate predicate) { double damage = getTier() >= 3 ? 20D : 4D * getTier(); double radius = 4.0 + getTier(); for (Entity n : b.getWorld().getNearbyEntities(b.getLocation(), radius, radius, radius, n -> n instanceof LivingEntity && !(n instanceof ArmorStand) && !(n instanceof Player) && n.isValid() && predicate.test((LivingEntity) n))) { boolean attack = false; - switch (BlockFace.valueOf(BlockStorage.getLocationInfo(b.getLocation(), "rotation"))) { + switch (face) { case NORTH: attack = n.getLocation().getZ() < b.getZ(); break; @@ -57,10 +56,10 @@ public abstract class ButcherAndroid extends ProgrammableAndroid { if (attack) { if (n.hasMetadata(METADATA_KEY)) { - n.removeMetadata(METADATA_KEY, SlimefunPlugin.instance); + n.removeMetadata(METADATA_KEY, SlimefunPlugin.instance()); } - n.setMetadata(METADATA_KEY, new FixedMetadataValue(SlimefunPlugin.instance, new AndroidInstance(this, b))); + n.setMetadata(METADATA_KEY, new FixedMetadataValue(SlimefunPlugin.instance(), new AndroidInstance(this, b))); ((LivingEntity) n).damage(damage); break; 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..5bc7adf33 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; @@ -62,10 +62,7 @@ public abstract class FisherAndroid extends ProgrammableAndroid { if (ThreadLocalRandom.current().nextInt(100) < 10 * getTier()) { ItemStack drop = fishingLoot.getRandom(); - - if (menu.fits(drop, getOutputSlots())) { - menu.pushItem(drop, getOutputSlots()); - } + menu.pushItem(drop, getOutputSlots()); } } diff --git a/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/items/androids/Instruction.java b/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/items/androids/Instruction.java index 8cb11286c..02a24c1af 100644 --- a/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/items/androids/Instruction.java +++ b/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/items/androids/Instruction.java @@ -41,12 +41,12 @@ enum Instruction { // Directions TURN_LEFT(AndroidType.NONE, HeadTexture.SCRIPT_LEFT, (android, b, inv, face) -> { int mod = -1; - android.rotate(b, mod); + android.rotate(b, face, mod); }), TURN_RIGHT(AndroidType.NONE, HeadTexture.SCRIPT_RIGHT, (android, b, inv, face) -> { int mod = 1; - android.rotate(b, mod); + android.rotate(b, face, mod); }), // Action - Pickaxe @@ -83,22 +83,22 @@ enum Instruction { // Action - Sword ATTACK_MOBS_ANIMALS(AndroidType.FIGHTER, HeadTexture.SCRIPT_ATTACK, (android, b, inv, face) -> { Predicate predicate = e -> true; - android.attack(b, predicate); + android.attack(b, face, predicate); }), ATTACK_MOBS(AndroidType.FIGHTER, HeadTexture.SCRIPT_ATTACK, (android, b, inv, face) -> { Predicate predicate = e -> e instanceof Monster; - android.attack(b, predicate); + android.attack(b, face, predicate); }), ATTACK_ANIMALS(AndroidType.FIGHTER, HeadTexture.SCRIPT_ATTACK, (android, b, inv, face) -> { Predicate predicate = e -> e instanceof Animals; - android.attack(b, predicate); + android.attack(b, face, predicate); }), ATTACK_ANIMALS_ADULT(AndroidType.FIGHTER, HeadTexture.SCRIPT_ATTACK, (android, b, inv, face) -> { Predicate predicate = e -> e instanceof Animals && e instanceof Ageable && ((Ageable) e).isAdult(); - android.attack(b, predicate); + android.attack(b, face, predicate); }), // Action - Axe 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..52547aa0e 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 @@ -2,7 +2,6 @@ package io.github.thebusybiscuit.slimefun4.implementation.items.androids; import java.util.ArrayList; import java.util.Arrays; -import java.util.LinkedList; import java.util.List; import java.util.Optional; import java.util.function.Predicate; @@ -16,6 +15,7 @@ import org.bukkit.Tag; import org.bukkit.block.Block; import org.bukkit.block.BlockFace; import org.bukkit.block.Dispenser; +import org.bukkit.block.data.BlockData; import org.bukkit.block.data.Rotatable; import org.bukkit.entity.LivingEntity; import org.bukkit.entity.Player; @@ -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; @@ -49,6 +49,7 @@ import me.mrCookieSlime.Slimefun.Objects.SlimefunItem.abstractItems.MachineFuel; import me.mrCookieSlime.Slimefun.Objects.SlimefunItem.interfaces.InventoryBlock; import me.mrCookieSlime.Slimefun.Objects.handlers.BlockTicker; import me.mrCookieSlime.Slimefun.api.BlockStorage; +import me.mrCookieSlime.Slimefun.api.Slimefun; import me.mrCookieSlime.Slimefun.api.SlimefunItemStack; import me.mrCookieSlime.Slimefun.api.inventory.BlockMenu; import me.mrCookieSlime.Slimefun.api.inventory.BlockMenuPreset; @@ -82,7 +83,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 +93,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 +102,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; }); @@ -198,8 +199,8 @@ public abstract class ProgrammableAndroid extends SlimefunItem implements Invent @Override public void tick(Block b, SlimefunItem item, Config data) { - if (b != null) { - ProgrammableAndroid.this.tick(b); + if (b != null && data != null) { + ProgrammableAndroid.this.tick(b, data); } } @@ -211,9 +212,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 +237,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 +245,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) { @@ -387,33 +388,17 @@ public abstract class ProgrammableAndroid extends SlimefunItem implements Invent } else { Script script = scripts.get(target); - List lore = new LinkedList<>(); - lore.add("&7by &r" + script.getAuthor()); - lore.add(""); - lore.add("&7Downloads: &r" + script.getDownloads()); - lore.add("&7Rating: " + getScriptRatingPercentage(script)); - lore.add("&a" + script.getUpvotes() + " \u263A &7| &4\u2639 " + script.getDownvotes()); - lore.add(""); - lore.add("&eLeft Click &rto download this Script"); - lore.add("&4(This will override your current Script)"); - - if (script.canRate(p)) { - lore.add("&eShift + Left Click &rto leave a positive Rating"); - lore.add("&eShift + Right Click &rto leave a negative Rating"); - } - - ItemStack item = new CustomItem(getItem(), "&b" + script.getName(), lore.toArray(new String[0])); - menu.addItem(index, item, (player, slot, stack, action) -> { + menu.addItem(index, script.getAsItemStack(this, p), (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 +432,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 -> { + 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) -> { @@ -509,13 +494,8 @@ public abstract class ProgrammableAndroid extends SlimefunItem implements Invent return list; } - protected String getScriptRatingPercentage(Script script) { - float percentage = script.getRating(); - return NumberUtils.getColorFromPercentage(percentage) + String.valueOf(percentage) + ChatColor.RESET + "% "; - } - 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 +507,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); @@ -627,60 +607,69 @@ public abstract class ProgrammableAndroid extends SlimefunItem implements Invent public abstract int getTier(); - protected void tick(Block b) { + protected void tick(Block b, Config data) { if (b.getType() != Material.PLAYER_HEAD) { // The Android was destroyed or moved. return; } - if ("false".equals(BlockStorage.getLocationInfo(b.getLocation(), "paused"))) { + if ("false".equals(data.getString("paused"))) { BlockMenu menu = BlockStorage.getInventory(b); - float fuel = Float.parseFloat(BlockStorage.getLocationInfo(b.getLocation(), "fuel")); + String fuelData = data.getString("fuel"); + float fuel = fuelData == null ? 0 : Float.parseFloat(fuelData); if (fuel < 0.001) { consumeFuel(b, menu); } else { - String[] script = PatternUtils.DASH.split(BlockStorage.getLocationInfo(b.getLocation(), "script")); + String code = data.getString("script"); + String[] script = PatternUtils.DASH.split(code == null ? DEFAULT_SCRIPT : code); + + String indexData = data.getString("index"); + int index = (indexData == null ? 0 : Integer.parseInt(indexData)) + 1; - int index = Integer.parseInt(BlockStorage.getLocationInfo(b.getLocation(), "index")) + 1; if (index >= script.length) { index = 0; } - boolean refresh = true; BlockStorage.addBlockInfo(b, "fuel", String.valueOf(fuel - 1)); Instruction instruction = Instruction.valueOf(script[index]); - - if (getAndroidType().isType(instruction.getRequiredType())) { - BlockFace face = BlockFace.valueOf(BlockStorage.getLocationInfo(b.getLocation(), "rotation")); - - switch (instruction) { - case START: - case WAIT: - // Just "waiting" here which means we do nothing - break; - case REPEAT: - BlockStorage.addBlockInfo(b, "index", String.valueOf(0)); - break; - case CHOP_TREE: - refresh = chopTree(b, menu, face); - break; - default: - instruction.execute(this, b, menu, face); - break; - } - } - - if (refresh) { - BlockStorage.addBlockInfo(b, "index", String.valueOf(index)); - } + executeInstruction(instruction, b, menu, data, index); } } } - protected void rotate(Block b, int mod) { - BlockFace current = BlockFace.valueOf(BlockStorage.getLocationInfo(b.getLocation(), "rotation")); + private void executeInstruction(Instruction instruction, Block b, BlockMenu inv, Config data, int index) { + if (getAndroidType().isType(instruction.getRequiredType())) { + String rotationData = data.getString("rotation"); + BlockFace face = rotationData == null ? BlockFace.NORTH : BlockFace.valueOf(rotationData); + + switch (instruction) { + case START: + case WAIT: + // We are "waiting" here, so we only move a step forward + BlockStorage.addBlockInfo(b, "index", String.valueOf(index)); + break; + case REPEAT: + // "repeat" just means, we reset our index + BlockStorage.addBlockInfo(b, "index", String.valueOf(0)); + break; + case CHOP_TREE: + // We only move to the next step if we finished chopping wood + if (chopTree(b, inv, face)) { + BlockStorage.addBlockInfo(b, "index", String.valueOf(index)); + } + break; + default: + // We set the index here in advance to fix moving android issues + BlockStorage.addBlockInfo(b, "index", String.valueOf(index)); + instruction.execute(this, b, inv, face); + break; + } + } + } + + protected void rotate(Block b, BlockFace current, int mod) { int index = POSSIBLE_ROTATIONS.indexOf(current) + mod; if (index == POSSIBLE_ROTATIONS.size()) { @@ -693,7 +682,7 @@ public abstract class ProgrammableAndroid extends SlimefunItem implements Invent BlockFace rotation = POSSIBLE_ROTATIONS.get(index); Rotatable rotatatable = (Rotatable) b.getBlockData(); - rotatatable.setRotation(rotation); + rotatatable.setRotation(rotation.getOppositeFace()); b.setBlockData(rotatatable); BlockStorage.addBlockInfo(b, "rotation", rotation.name()); } @@ -739,7 +728,7 @@ public abstract class ProgrammableAndroid extends SlimefunItem implements Invent dispenser.setItem(slot, null); return true; } - else if (SlimefunUtils.isItemSimilar(newFuel, currentFuel, true)) { + else if (SlimefunUtils.isItemSimilar(newFuel, currentFuel, true, false)) { int rest = newFuel.getType().getMaxStackSize() - currentFuel.getAmount(); if (rest > 0) { @@ -766,7 +755,8 @@ public abstract class ProgrammableAndroid extends SlimefunItem implements Invent menu.pushItem(new ItemStack(Material.BUCKET), getOutputSlots()); } - BlockStorage.addBlockInfo(b, "fuel", String.valueOf((int) (fuel.getTicks() * this.getFuelEfficiency()))); + int fuelLevel = (int) (fuel.getTicks() * getFuelEfficiency()); + BlockStorage.addBlockInfo(b, "fuel", String.valueOf(fuelLevel)); break; } } @@ -809,19 +799,22 @@ public abstract class ProgrammableAndroid extends SlimefunItem implements Invent protected void move(Block b, BlockFace face, Block block) { if (block.getY() > 0 && block.getY() < block.getWorld().getMaxHeight() && (block.getType() == Material.AIR || block.getType() == Material.CAVE_AIR)) { - block.setType(Material.PLAYER_HEAD); - Rotatable blockData = (Rotatable) block.getBlockData(); - blockData.setRotation(face.getOppositeFace()); - block.setBlockData(blockData); + BlockData blockData = Material.PLAYER_HEAD.createBlockData(data -> { + if (data instanceof Rotatable) { + Rotatable rotatable = ((Rotatable) data); + rotatable.setRotation(face.getOppositeFace()); + } + }); - SkullBlock.setFromBase64(block, texture); + block.setBlockData(blockData); + Slimefun.runSync(() -> SkullBlock.setFromBase64(block, texture)); b.setType(Material.AIR); BlockStorage.moveBlockInfo(b.getLocation(), block.getLocation()); } } - protected void attack(Block b, Predicate predicate) { + protected void attack(Block b, BlockFace face, Predicate predicate) { throw new UnsupportedOperationException("Non-butcher Android tried to butcher!"); } diff --git a/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/items/androids/Script.java b/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/items/androids/Script.java index 9aac880dc..783cff824 100644 --- a/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/items/androids/Script.java +++ b/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/items/androids/Script.java @@ -11,11 +11,15 @@ import java.util.logging.Level; import org.apache.commons.lang.Validate; import org.bukkit.Bukkit; +import org.bukkit.ChatColor; import org.bukkit.OfflinePlayer; import org.bukkit.entity.Player; +import org.bukkit.inventory.ItemStack; import io.github.thebusybiscuit.cscorelib2.config.Config; +import io.github.thebusybiscuit.cscorelib2.item.CustomItem; import io.github.thebusybiscuit.slimefun4.utils.ChatUtils; +import io.github.thebusybiscuit.slimefun4.utils.NumberUtils; import me.mrCookieSlime.Slimefun.api.Slimefun; public final class Script { @@ -105,6 +109,30 @@ public final class Script { return !upvoters.contains(p.getUniqueId().toString()) && !downvoters.contains(p.getUniqueId().toString()); } + ItemStack getAsItemStack(ProgrammableAndroid android, Player p) { + List lore = new LinkedList<>(); + lore.add("&7by &r" + getAuthor()); + lore.add(""); + lore.add("&7Downloads: &r" + getDownloads()); + lore.add("&7Rating: " + getScriptRatingPercentage()); + lore.add("&a" + getUpvotes() + " \u263A &7| &4\u2639 " + getDownvotes()); + lore.add(""); + lore.add("&eLeft Click &rto download this Script"); + lore.add("&4(This will override your current Script)"); + + if (canRate(p)) { + lore.add("&eShift + Left Click &rto leave a positive Rating"); + lore.add("&eShift + Right Click &rto leave a negative Rating"); + } + + return new CustomItem(android.getItem(), "&b" + getName(), lore.toArray(new String[0])); + } + + private String getScriptRatingPercentage() { + float percentage = getRating(); + return NumberUtils.getColorFromPercentage(percentage) + String.valueOf(percentage) + ChatColor.RESET + "% "; + } + /** * This method returns the amount of upvotes this {@link Script} has received. * @@ -195,7 +223,7 @@ public final class Script { } } catch (Exception x) { - Slimefun.getLogger().log(Level.SEVERE, x, () -> "An Exception occured while trying to load Android Script '" + file.getName() + "'"); + Slimefun.getLogger().log(Level.SEVERE, x, () -> "An Exception occurred while trying to load Android Script '" + file.getName() + "'"); } } } 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..60c85e59e 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 @@ -7,15 +7,16 @@ import java.util.UUID; import org.bukkit.Bukkit; import org.bukkit.Effect; import org.bukkit.Material; +import org.bukkit.OfflinePlayer; +import org.bukkit.Tag; import org.bukkit.block.Block; import org.bukkit.block.BlockFace; import org.bukkit.inventory.ItemStack; 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; @@ -24,6 +25,8 @@ import me.mrCookieSlime.Slimefun.api.inventory.BlockMenu; public abstract class WoodcutterAndroid extends ProgrammableAndroid { + private static final int MAX_REACH = 160; + public WoodcutterAndroid(Category category, SlimefunItemStack item, RecipeType recipeType, ItemStack[] recipe) { super(category, item, recipeType, recipe); } @@ -35,14 +38,17 @@ public abstract class WoodcutterAndroid extends ProgrammableAndroid { @Override protected boolean chopTree(Block b, BlockMenu menu, BlockFace face) { - if (MaterialCollections.getAllLogs().contains(b.getRelative(face).getType())) { - List list = Vein.find(b.getRelative(face), 180, block -> MaterialCollections.getAllLogs().contains(block.getType())); + Block target = b.getRelative(face); + + if (Tag.LOGS.isTagged(target.getType())) { + List list = Vein.find(target, MAX_REACH, block -> Tag.LOGS.isTagged(block.getType())); if (!list.isEmpty()) { Block log = list.get(list.size() - 1); log.getWorld().playEffect(log.getLocation(), Effect.STEP_SOUND, log.getType()); - if (SlimefunPlugin.getProtectionManager().hasPermission(Bukkit.getOfflinePlayer(UUID.fromString(BlockStorage.getLocationInfo(b.getLocation(), "owner"))), log.getLocation(), ProtectableAction.BREAK_BLOCK)) { + OfflinePlayer owner = Bukkit.getOfflinePlayer(UUID.fromString(BlockStorage.getLocationInfo(b.getLocation(), "owner"))); + if (SlimefunPlugin.getProtectionManager().hasPermission(owner, log.getLocation(), ProtectableAction.BREAK_BLOCK)) { breakLog(log, b, menu, face); } diff --git a/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/items/armor/HazmatArmorPiece.java b/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/items/armor/HazmatArmorPiece.java new file mode 100644 index 000000000..f50860c3b --- /dev/null +++ b/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/items/armor/HazmatArmorPiece.java @@ -0,0 +1,50 @@ +package io.github.thebusybiscuit.slimefun4.implementation.items.armor; + +import org.bukkit.NamespacedKey; +import org.bukkit.inventory.ItemStack; +import org.bukkit.potion.PotionEffect; + +import io.github.thebusybiscuit.slimefun4.core.attributes.ProtectiveArmor; +import io.github.thebusybiscuit.slimefun4.core.attributes.ProtectionType; +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; + +/** + * Represents 1 {@link SlimefunArmorPiece} of the Hazmat armor set. + * One of the very few utilisations of {@link ProtectiveArmor}. + * + * @author Linox + * + * @see SlimefunArmorPiece + * @see ProtectiveArmor + * + */ +public class HazmatArmorPiece extends SlimefunArmorPiece implements ProtectiveArmor { + + private final NamespacedKey namespacedKey; + private final ProtectionType[] types; + + public HazmatArmorPiece(Category category, SlimefunItemStack item, RecipeType recipeType, ItemStack[] recipe, PotionEffect[] effects) { + super(category, item, recipeType, recipe, effects); + + types = new ProtectionType[] { ProtectionType.BEES, ProtectionType.RADIATION }; + namespacedKey = new NamespacedKey(SlimefunPlugin.instance(), "hazmat_suit"); + } + + @Override + public ProtectionType[] getProtectionTypes() { + return types; + } + + @Override + public boolean isFullSetRequired() { + return true; + } + + @Override + public NamespacedKey getArmorSetId() { + return namespacedKey; + } +} diff --git a/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/items/armor/SlimefunArmorPiece.java b/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/items/armor/SlimefunArmorPiece.java index 925934c64..47473bab7 100644 --- a/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/items/armor/SlimefunArmorPiece.java +++ b/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/items/armor/SlimefunArmorPiece.java @@ -28,5 +28,4 @@ public class SlimefunArmorPiece extends SlimefunItem { public PotionEffect[] getPotionEffects() { return effects; } - } diff --git a/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/items/backpacks/EnderBackpack.java b/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/items/backpacks/EnderBackpack.java index ec7454918..14f7b30fe 100644 --- a/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/items/backpacks/EnderBackpack.java +++ b/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/items/backpacks/EnderBackpack.java @@ -5,10 +5,10 @@ import org.bukkit.entity.Player; import org.bukkit.inventory.ItemStack; import io.github.thebusybiscuit.slimefun4.core.attributes.NotPlaceable; +import io.github.thebusybiscuit.slimefun4.core.handlers.ItemUseHandler; +import io.github.thebusybiscuit.slimefun4.implementation.items.SimpleSlimefunItem; import me.mrCookieSlime.Slimefun.Lists.RecipeType; import me.mrCookieSlime.Slimefun.Objects.Category; -import me.mrCookieSlime.Slimefun.Objects.SlimefunItem.SimpleSlimefunItem; -import me.mrCookieSlime.Slimefun.Objects.handlers.ItemUseHandler; import me.mrCookieSlime.Slimefun.api.SlimefunItemStack; public class EnderBackpack extends SimpleSlimefunItem implements NotPlaceable { 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..5d7af79f1 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,13 +5,13 @@ import org.bukkit.inventory.Inventory; import org.bukkit.inventory.ItemStack; import io.github.thebusybiscuit.slimefun4.api.player.PlayerBackpack; +import io.github.thebusybiscuit.slimefun4.core.handlers.ItemUseHandler; +import io.github.thebusybiscuit.slimefun4.implementation.SlimefunPlugin; +import io.github.thebusybiscuit.slimefun4.implementation.items.SimpleSlimefunItem; 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; import me.mrCookieSlime.Slimefun.Objects.SlimefunItem.SlimefunItem; -import me.mrCookieSlime.Slimefun.Objects.handlers.ItemUseHandler; import me.mrCookieSlime.Slimefun.api.SlimefunItemStack; /** 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..7a0c7ee02 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,12 +19,12 @@ 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.core.handlers.BlockDispenseHandler; +import io.github.thebusybiscuit.slimefun4.implementation.SlimefunPlugin; +import io.github.thebusybiscuit.slimefun4.implementation.items.SimpleSlimefunItem; 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.BlockDispenseHandler; import me.mrCookieSlime.Slimefun.api.BlockStorage; import me.mrCookieSlime.Slimefun.api.Slimefun; import me.mrCookieSlime.Slimefun.api.SlimefunItemStack; 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..11e1fd462 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,12 +20,12 @@ 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.core.handlers.BlockUseHandler; +import io.github.thebusybiscuit.slimefun4.implementation.SlimefunPlugin; +import io.github.thebusybiscuit.slimefun4.implementation.items.SimpleSlimefunItem; 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; -import me.mrCookieSlime.Slimefun.Objects.handlers.BlockUseHandler; import me.mrCookieSlime.Slimefun.api.BlockStorage; import me.mrCookieSlime.Slimefun.api.SlimefunItemStack; @@ -98,10 +98,10 @@ public class Composter extends SimpleSlimefunItem implements Re pushItem(b, output.clone()); }); - tasks.execute(SlimefunPlugin.instance); + 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..b87d1cfe6 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,12 +17,12 @@ 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.core.handlers.BlockUseHandler; +import io.github.thebusybiscuit.slimefun4.implementation.SlimefunPlugin; +import io.github.thebusybiscuit.slimefun4.implementation.items.SimpleSlimefunItem; 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; -import me.mrCookieSlime.Slimefun.Objects.handlers.BlockUseHandler; import me.mrCookieSlime.Slimefun.api.BlockStorage; import me.mrCookieSlime.Slimefun.api.Slimefun; import me.mrCookieSlime.Slimefun.api.SlimefunItemStack; @@ -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/EnhancedFurnace.java b/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/items/blocks/EnhancedFurnace.java index 3f7432f69..a57ea975c 100644 --- a/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/items/blocks/EnhancedFurnace.java +++ b/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/items/blocks/EnhancedFurnace.java @@ -7,10 +7,10 @@ import org.bukkit.block.Block; import org.bukkit.block.Furnace; import org.bukkit.inventory.ItemStack; +import io.github.thebusybiscuit.slimefun4.implementation.items.SimpleSlimefunItem; import me.mrCookieSlime.CSCoreLibPlugin.Configuration.Config; 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.BlockTicker; import me.mrCookieSlime.Slimefun.api.BlockStorage; @@ -30,14 +30,14 @@ public class EnhancedFurnace extends SimpleSlimefunItem { private final int speed; private final int efficiency; - private final int fortune; + private final int fortuneLevel; public EnhancedFurnace(Category category, int speed, int efficiency, int fortune, SlimefunItemStack item, ItemStack[] recipe) { super(category, item, RecipeType.ENHANCED_CRAFTING_TABLE, recipe); this.speed = speed - 1; this.efficiency = efficiency - 1; - this.fortune = fortune - 1; + this.fortuneLevel = fortune - 1; } public int getSpeed() { @@ -49,11 +49,8 @@ public class EnhancedFurnace extends SimpleSlimefunItem { } public int getOutput() { - int bonus = this.fortune; - bonus = ThreadLocalRandom.current().nextInt(bonus + 2) - 1; - if (bonus <= 0) bonus = 0; - bonus++; - return bonus; + int bonus = ThreadLocalRandom.current().nextInt(fortuneLevel + 2); + return 1 + bonus; } @Override 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..c030eee2d 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,17 +11,17 @@ 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.core.handlers.BlockUseHandler; +import io.github.thebusybiscuit.slimefun4.implementation.SlimefunPlugin; +import io.github.thebusybiscuit.slimefun4.implementation.items.SimpleSlimefunItem; 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; -import me.mrCookieSlime.Slimefun.Objects.SlimefunItem.SimpleSlimefunItem; import me.mrCookieSlime.Slimefun.Objects.SlimefunItem.SlimefunItem; import me.mrCookieSlime.Slimefun.Objects.SlimefunItem.UnregisterReason; -import me.mrCookieSlime.Slimefun.Objects.handlers.BlockUseHandler; import me.mrCookieSlime.Slimefun.api.BlockStorage; import me.mrCookieSlime.Slimefun.api.SlimefunItemStack; @@ -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/blocks/InfusedHopper.java b/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/items/blocks/InfusedHopper.java index 15ba809cd..8e98ce420 100644 --- a/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/items/blocks/InfusedHopper.java +++ b/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/items/blocks/InfusedHopper.java @@ -10,11 +10,11 @@ import org.bukkit.inventory.ItemStack; import org.bukkit.util.Vector; import io.github.thebusybiscuit.slimefun4.api.items.ItemSetting; +import io.github.thebusybiscuit.slimefun4.implementation.items.SimpleSlimefunItem; import io.github.thebusybiscuit.slimefun4.utils.SlimefunUtils; import me.mrCookieSlime.CSCoreLibPlugin.Configuration.Config; 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.BlockTicker; import me.mrCookieSlime.Slimefun.api.BlockStorage; diff --git a/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/items/blocks/RainbowBlock.java b/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/items/blocks/RainbowBlock.java index c4f87726d..6f9c13dfc 100644 --- a/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/items/blocks/RainbowBlock.java +++ b/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/items/blocks/RainbowBlock.java @@ -2,24 +2,24 @@ package io.github.thebusybiscuit.slimefun4.implementation.items.blocks; import org.bukkit.inventory.ItemStack; +import io.github.thebusybiscuit.slimefun4.core.handlers.RainbowTickHandler; +import io.github.thebusybiscuit.slimefun4.implementation.items.SimpleSlimefunItem; import me.mrCookieSlime.Slimefun.Lists.RecipeType; import me.mrCookieSlime.Slimefun.Objects.Category; -import me.mrCookieSlime.Slimefun.Objects.SlimefunItem.SimpleSlimefunItem; -import me.mrCookieSlime.Slimefun.Objects.handlers.RainbowTicker; import me.mrCookieSlime.Slimefun.api.SlimefunItemStack; -public class RainbowBlock extends SimpleSlimefunItem { +public class RainbowBlock extends SimpleSlimefunItem { - private final RainbowTicker ticker; + private final RainbowTickHandler ticker; - public RainbowBlock(Category category, SlimefunItemStack item, RecipeType recipeType, ItemStack[] recipe, ItemStack recipeOutput, RainbowTicker ticker) { + public RainbowBlock(Category category, SlimefunItemStack item, RecipeType recipeType, ItemStack[] recipe, ItemStack recipeOutput, RainbowTickHandler ticker) { super(category, item, recipeType, recipe, recipeOutput); this.ticker = ticker; } @Override - public RainbowTicker getItemHandler() { + public RainbowTickHandler getItemHandler() { return ticker; } diff --git a/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/items/blocks/RepairedSpawner.java b/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/items/blocks/RepairedSpawner.java index 3af6687a6..6155cbd97 100644 --- a/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/items/blocks/RepairedSpawner.java +++ b/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/items/blocks/RepairedSpawner.java @@ -8,12 +8,12 @@ import org.bukkit.block.CreatureSpawner; import org.bukkit.entity.EntityType; import org.bukkit.inventory.ItemStack; +import io.github.thebusybiscuit.slimefun4.core.handlers.BlockPlaceHandler; import io.github.thebusybiscuit.slimefun4.implementation.SlimefunItems; +import io.github.thebusybiscuit.slimefun4.implementation.items.SimpleSlimefunItem; import io.github.thebusybiscuit.slimefun4.utils.SlimefunUtils; import me.mrCookieSlime.Slimefun.Lists.RecipeType; import me.mrCookieSlime.Slimefun.Objects.Category; -import me.mrCookieSlime.Slimefun.Objects.SlimefunItem.SimpleSlimefunItem; -import me.mrCookieSlime.Slimefun.Objects.handlers.BlockPlaceHandler; import me.mrCookieSlime.Slimefun.api.SlimefunItemStack; public class RepairedSpawner extends SimpleSlimefunItem { @@ -24,7 +24,7 @@ public class RepairedSpawner extends SimpleSlimefunItem { @Override public BlockPlaceHandler getItemHandler() { - return (e, item) -> { + return (p, e, item) -> { // We need to explicitly ignore the lore here if (SlimefunUtils.isItemSimilar(item, SlimefunItems.REPAIRED_SPAWNER, false, false)) { Optional entity = getEntityType(item); diff --git a/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/items/blocks/UnplaceableBlock.java b/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/items/blocks/UnplaceableBlock.java index 1d1b02824..5697103a3 100644 --- a/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/items/blocks/UnplaceableBlock.java +++ b/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/items/blocks/UnplaceableBlock.java @@ -4,10 +4,10 @@ import org.bukkit.inventory.ItemStack; import io.github.thebusybiscuit.slimefun4.api.events.PlayerRightClickEvent; import io.github.thebusybiscuit.slimefun4.core.attributes.NotPlaceable; +import io.github.thebusybiscuit.slimefun4.core.handlers.ItemUseHandler; +import io.github.thebusybiscuit.slimefun4.implementation.items.SimpleSlimefunItem; import me.mrCookieSlime.Slimefun.Lists.RecipeType; import me.mrCookieSlime.Slimefun.Objects.Category; -import me.mrCookieSlime.Slimefun.Objects.SlimefunItem.SimpleSlimefunItem; -import me.mrCookieSlime.Slimefun.Objects.handlers.ItemUseHandler; import me.mrCookieSlime.Slimefun.api.SlimefunItemStack; public class UnplaceableBlock extends SimpleSlimefunItem implements NotPlaceable { @@ -16,6 +16,10 @@ public class UnplaceableBlock extends SimpleSlimefunItem impleme super(category, item, recipeType, recipe); } + public UnplaceableBlock(Category category, SlimefunItemStack item, RecipeType recipeType, ItemStack[] recipe, ItemStack recipeOutput) { + super(category, item, recipeType, recipe, recipeOutput); + } + @Override public ItemUseHandler getItemHandler() { return PlayerRightClickEvent::cancel; 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/CargoConnectorNode.java b/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/items/cargo/CargoConnectorNode.java index 42c8d347a..13f46f541 100644 --- a/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/items/cargo/CargoConnectorNode.java +++ b/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/items/cargo/CargoConnectorNode.java @@ -5,11 +5,11 @@ import org.bukkit.entity.Player; import org.bukkit.inventory.ItemStack; import io.github.thebusybiscuit.cscorelib2.chat.ChatColors; +import io.github.thebusybiscuit.slimefun4.core.handlers.BlockUseHandler; import io.github.thebusybiscuit.slimefun4.core.networks.cargo.CargoNet; +import io.github.thebusybiscuit.slimefun4.implementation.items.SimpleSlimefunItem; import me.mrCookieSlime.Slimefun.Lists.RecipeType; import me.mrCookieSlime.Slimefun.Objects.Category; -import me.mrCookieSlime.Slimefun.Objects.SlimefunItem.SimpleSlimefunItem; -import me.mrCookieSlime.Slimefun.Objects.handlers.BlockUseHandler; import me.mrCookieSlime.Slimefun.api.SlimefunItemStack; public class CargoConnectorNode extends SimpleSlimefunItem { 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/CargoManager.java b/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/items/cargo/CargoManager.java index 5a318b18b..29ff47e5b 100644 --- a/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/items/cargo/CargoManager.java +++ b/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/items/cargo/CargoManager.java @@ -8,6 +8,7 @@ import org.bukkit.entity.Player; import org.bukkit.inventory.ItemStack; import io.github.thebusybiscuit.slimefun4.api.events.PlayerRightClickEvent; +import io.github.thebusybiscuit.slimefun4.core.handlers.BlockUseHandler; import io.github.thebusybiscuit.slimefun4.core.networks.cargo.CargoNet; import io.github.thebusybiscuit.slimefun4.utils.holograms.SimpleHologram; import me.mrCookieSlime.CSCoreLibPlugin.Configuration.Config; @@ -15,7 +16,6 @@ import me.mrCookieSlime.Slimefun.Lists.RecipeType; import me.mrCookieSlime.Slimefun.Objects.Category; import me.mrCookieSlime.Slimefun.Objects.SlimefunItem.SlimefunItem; import me.mrCookieSlime.Slimefun.Objects.handlers.BlockTicker; -import me.mrCookieSlime.Slimefun.Objects.handlers.BlockUseHandler; import me.mrCookieSlime.Slimefun.api.BlockStorage; import me.mrCookieSlime.Slimefun.api.SlimefunItemStack; 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..899b8b937 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.implementation.items.misc.CoolantCell; 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; @@ -74,18 +74,27 @@ public class ReactorAccessPort extends SlimefunItem { @Override public int[] getSlotsAccessedByItemTransport(ItemTransportFlow flow) { - if (flow == ItemTransportFlow.INSERT) return getInputSlots(); - else return getOutputSlots(); + if (flow == ItemTransportFlow.INSERT) { + return getInputSlots(); + } + else { + return getOutputSlots(); + } } @Override public int[] getSlotsAccessedByItemTransport(DirtyChestMenu menu, ItemTransportFlow flow, ItemStack item) { if (flow == ItemTransportFlow.INSERT) { - if (SlimefunUtils.isItemSimilar(item, SlimefunItems.REACTOR_COOLANT_CELL, true)) return getCoolantSlots(); - else if (SlimefunUtils.isItemSimilar(item, SlimefunItems.NETHER_ICE_COOLANT_CELL, true)) return getCoolantSlots(); - else return getFuelSlots(); + if (SlimefunItem.getByItem(item) instanceof CoolantCell) { + return getCoolantSlots(); + } + else { + return getFuelSlots(); + } + } + else { + return getOutputSlots(); } - else return getOutputSlots(); } }; @@ -157,10 +166,12 @@ public class ReactorAccessPort extends SlimefunItem { } private BlockMenu getReactor(Location l) { - Location reactorL = new Location(l.getWorld(), l.getX(), l.getY() - 3, l.getZ()); + Location location = new Location(l.getWorld(), l.getX(), l.getY() - 3, l.getZ()); + SlimefunItem item = BlockStorage.check(location.getBlock()); - SlimefunItem item = BlockStorage.check(reactorL.getBlock()); - if (item instanceof Reactor) return BlockStorage.getInventory(reactorL); + if (item instanceof Reactor) { + return BlockStorage.getInventory(location); + } return null; } 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..4f73938a6 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 me.mrCookieSlime.Slimefun.SlimefunPlugin; +import io.github.thebusybiscuit.slimefun4.core.attributes.Rechargeable; +import io.github.thebusybiscuit.slimefun4.core.handlers.BlockBreakHandler; +import io.github.thebusybiscuit.slimefun4.core.handlers.ItemUseHandler; +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.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) { @@ -61,7 +64,7 @@ public class MultiTool extends ChargableItem { 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..8cbd760a1 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,11 +7,11 @@ 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.core.handlers.ItemUseHandler; +import io.github.thebusybiscuit.slimefun4.implementation.SlimefunPlugin; +import io.github.thebusybiscuit.slimefun4.implementation.items.SimpleSlimefunItem; import me.mrCookieSlime.Slimefun.Lists.RecipeType; import me.mrCookieSlime.Slimefun.Objects.Category; -import me.mrCookieSlime.Slimefun.Objects.SlimefunItem.SimpleSlimefunItem; -import me.mrCookieSlime.Slimefun.Objects.handlers.ItemUseHandler; import me.mrCookieSlime.Slimefun.api.SlimefunItemStack; import me.mrCookieSlime.Slimefun.api.energy.ChargableBlock; @@ -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/gadgets/SolarHelmet.java b/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/items/electric/gadgets/SolarHelmet.java index 953d9013c..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 @@ -1,25 +1,65 @@ 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; - public SolarHelmet(Category category, SlimefunItemStack item, RecipeType recipeType, ItemStack[] recipe) { - super(category, item, recipeType, recipe, null); + public SolarHelmet(Category category, SlimefunItemStack item, RecipeType recipeType, ItemStack[] recipe, double defaultChargingLevel) { + super(category, item, recipeType, recipe); - addItemSetting(chargeSetting); + if (defaultChargingLevel <= 0) { + throw new IllegalArgumentException("A Solar Helmet must have a positive charging level!"); + } + + charge = new ItemSetting<>("charge-amount", defaultChargingLevel); + addItemSetting(charge); } - public double getChargeAmount() { - return chargeSetting.getValue(); + /** + * 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()); + 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/generators/BioGenerator.java b/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/items/electric/generators/BioGenerator.java index 74760383d..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 @@ -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; @@ -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 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..512d6e2a3 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,17 +1,19 @@ 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; import io.github.thebusybiscuit.slimefun4.core.attributes.EnergyNetComponent; +import io.github.thebusybiscuit.slimefun4.core.handlers.BlockUseHandler; import io.github.thebusybiscuit.slimefun4.core.networks.energy.EnergyNetComponentType; +import io.github.thebusybiscuit.slimefun4.implementation.items.SimpleSlimefunItem; import me.mrCookieSlime.CSCoreLibPlugin.Configuration.Config; 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.BlockUseHandler; import me.mrCookieSlime.Slimefun.Objects.handlers.GeneratorTicker; import me.mrCookieSlime.Slimefun.api.SlimefunItemStack; @@ -60,11 +62,24 @@ 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) { + boolean isDaytime = isDaytime(world); + + // Performance optimization for daytime-only solar generators + if (!isDaytime && getNightEnergy() < 0.1) { + return 0; + } + + if (!world.isChunkLoaded(l.getBlockX() >> 4, l.getBlockZ() >> 4) || l.getBlock().getLightFromSky() != 15) { + return 0; + } + + if (isDaytime) { return getDayEnergy(); } @@ -78,6 +93,19 @@ public abstract class SolarGenerator extends SimpleSlimefunItem }; } + /** + * This method returns whether a given {@link World} has daytime. + * It will also return false if a thunderstorm is active in this world. + * + * @param world + * The {@link World} to check + * + * @return Whether the given {@link World} has daytime and no active thunderstorm + */ + private boolean isDaytime(World world) { + return !world.hasStorm() && !world.isThundering() && (world.getTime() < 12300 || world.getTime() > 23850); + } + @Override public void preRegister() { super.preRegister(); diff --git a/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/items/electric/machines/AutoAnvil.java b/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/items/electric/machines/AutoAnvil.java index 14e2a570e..831583010 100644 --- a/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/items/electric/machines/AutoAnvil.java +++ b/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/items/electric/machines/AutoAnvil.java @@ -57,12 +57,12 @@ public abstract class AutoAnvil extends AContainer { if (timeleft > 0) { ChestMenuUtils.updateProgressbar(menu, 22, timeleft, processing.get(b).getTicks(), getProgressBar()); - if (ChargableBlock.isChargable(b)) { - if (ChargableBlock.getCharge(b) < getEnergyConsumption()) return; - ChargableBlock.addCharge(b, -getEnergyConsumption()); - progress.put(b, timeleft - 1); + if (ChargableBlock.getCharge(b) < getEnergyConsumption()) { + return; } - else progress.put(b, timeleft - 1); + + ChargableBlock.addCharge(b, -getEnergyConsumption()); + progress.put(b, timeleft - 1); } else { menu.replaceExistingItem(22, new CustomItem(new ItemStack(Material.BLACK_STAINED_GLASS_PANE), " ")); 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..85cb3d60e 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); @@ -68,17 +68,12 @@ public class AutoBrewer extends AContainer { if (timeleft > 0) { ChestMenuUtils.updateProgressbar(menu, 22, timeleft, processing.get(b).getTicks(), getProgressBar()); - if (ChargableBlock.isChargable(b)) { - if (ChargableBlock.getCharge(b) < getEnergyConsumption()) { - return; - } + if (ChargableBlock.getCharge(b) < getEnergyConsumption()) { + return; + } - ChargableBlock.addCharge(b, -getEnergyConsumption()); - progress.put(b, timeleft - 1); - } - else { - progress.put(b, timeleft - 1); - } + ChargableBlock.addCharge(b, -getEnergyConsumption()); + progress.put(b, timeleft - 1); } else { menu.replaceExistingItem(22, new CustomItem(new ItemStack(Material.BLACK_STAINED_GLASS_PANE), " ")); @@ -119,18 +114,16 @@ public 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; - 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); + ItemStack potionItem = slot ? input1 : input2; + PotionMeta potion = (PotionMeta) potionItem.getItemMeta(); + ItemStack output = brew(ingredient.getType(), potionItem.getType(), potion); if (output == null) { return null; @@ -144,8 +137,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 +161,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 +208,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/AutoDisenchanter.java b/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/items/electric/machines/AutoDisenchanter.java index 782a8f760..ff9b03605 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; @@ -78,15 +78,12 @@ public class AutoDisenchanter extends AContainer { if (timeleft > 0) { ChestMenuUtils.updateProgressbar(menu, 22, timeleft, processing.get(b).getTicks(), getProgressBar()); - if (ChargableBlock.isChargable(b)) { - if (ChargableBlock.getCharge(b) < getEnergyConsumption()) { - return; - } - - ChargableBlock.addCharge(b, -getEnergyConsumption()); - progress.put(b, timeleft - 1); + if (ChargableBlock.getCharge(b) < getEnergyConsumption()) { + return; } - else progress.put(b, timeleft - 1); + + ChargableBlock.addCharge(b, -getEnergyConsumption()); + progress.put(b, timeleft - 1); } else { menu.replaceExistingItem(22, new CustomItem(Material.BLACK_STAINED_GLASS_PANE, " ")); diff --git a/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/items/electric/machines/AutoDrier.java b/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/items/electric/machines/AutoDrier.java index ffdcb4c6c..c25892873 100644 --- a/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/items/electric/machines/AutoDrier.java +++ b/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/items/electric/machines/AutoDrier.java @@ -104,12 +104,12 @@ public class AutoDrier extends AContainer implements RecipeDisplayItem { if (timeleft > 0) { ChestMenuUtils.updateProgressbar(menu, 22, timeleft, processing.get(b).getTicks(), getProgressBar()); - if (ChargableBlock.isChargable(b)) { - if (ChargableBlock.getCharge(b) < getEnergyConsumption()) return; - ChargableBlock.addCharge(b, -getEnergyConsumption()); - progress.put(b, timeleft - 1); + if (ChargableBlock.getCharge(b) < getEnergyConsumption()) { + return; } - else progress.put(b, timeleft - 1); + + ChargableBlock.addCharge(b, -getEnergyConsumption()); + progress.put(b, timeleft - 1); } else { menu.replaceExistingItem(22, new CustomItem(new ItemStack(Material.BLACK_STAINED_GLASS_PANE), " ")); 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..afcb3f41f 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; @@ -67,17 +67,12 @@ public class AutoEnchanter extends AContainer { if (timeleft > 0) { ChestMenuUtils.updateProgressbar(menu, 22, timeleft, processing.get(b).getTicks(), getProgressBar()); - if (ChargableBlock.isChargable(b)) { - if (ChargableBlock.getCharge(b) < getEnergyConsumption()) { - return; - } + if (ChargableBlock.getCharge(b) < getEnergyConsumption()) { + return; + } - ChargableBlock.addCharge(b, -getEnergyConsumption()); - progress.put(b, timeleft - 1); - } - else { - progress.put(b, timeleft - 1); - } + ChargableBlock.addCharge(b, -getEnergyConsumption()); + progress.put(b, timeleft - 1); } else { menu.replaceExistingItem(22, new CustomItem(new ItemStack(Material.BLACK_STAINED_GLASS_PANE), " ")); 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/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/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..4f037164e 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; @@ -59,18 +59,14 @@ public abstract class ElectricDustWasher extends AContainer { if (timeleft > 0 && getSpeed() < 10) { ChestMenuUtils.updateProgressbar(menu, 22, timeleft, processing.get(b).getTicks(), getProgressBar()); - if (ChargableBlock.isChargable(b)) { - if (ChargableBlock.getCharge(b) < getEnergyConsumption()) { - return; - } - ChargableBlock.addCharge(b, -getEnergyConsumption()); - progress.put(b, timeleft - 1); - } - else { - progress.put(b, timeleft - 1); + if (ChargableBlock.getCharge(b) < getEnergyConsumption()) { + return; } + + ChargableBlock.addCharge(b, -getEnergyConsumption()); + progress.put(b, timeleft - 1); } - else if (ChargableBlock.isChargable(b)) { + else { if (ChargableBlock.getCharge(b) < getEnergyConsumption()) { return; } 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/ElectricGoldPan.java b/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/items/electric/machines/ElectricGoldPan.java index 1564d400e..f8e75b2e4 100644 --- a/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/items/electric/machines/ElectricGoldPan.java +++ b/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/items/electric/machines/ElectricGoldPan.java @@ -63,19 +63,14 @@ public abstract class ElectricGoldPan extends AContainer implements RecipeDispla if (timeleft > 0 && getSpeed() < 10) { ChestMenuUtils.updateProgressbar(menu, 22, timeleft, processing.get(b).getTicks(), getProgressBar()); - if (ChargableBlock.isChargable(b)) { - if (ChargableBlock.getCharge(b) < getEnergyConsumption()) { - return; - } + if (ChargableBlock.getCharge(b) < getEnergyConsumption()) { + return; + } - ChargableBlock.addCharge(b, -getEnergyConsumption()); - progress.put(b, timeleft - 1); - } - else { - progress.put(b, timeleft - 1); - } + ChargableBlock.addCharge(b, -getEnergyConsumption()); + progress.put(b, timeleft - 1); } - else if (ChargableBlock.isChargable(b)) { + else { if (ChargableBlock.getCharge(b) < getEnergyConsumption()) { return; } diff --git a/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/items/electric/machines/ElectricIngotPulverizer.java b/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/items/electric/machines/ElectricIngotPulverizer.java index 14993cfac..3fb9aec88 100644 --- a/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/items/electric/machines/ElectricIngotPulverizer.java +++ b/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/items/electric/machines/ElectricIngotPulverizer.java @@ -53,10 +53,9 @@ public class ElectricIngotPulverizer extends AContainer implements RecipeDisplay @Override protected void registerDefaultRecipes() { - // this is an extra recipe on top of PostSetup.loadSmelteryRecipes() for converting Vanilla Gold Ingot to Slimefun gold dust - registerRecipe(3, - new ItemStack(Material.GOLD_INGOT), - SlimefunItems.GOLD_DUST); + // this is an extra recipe on top of PostSetup.loadSmelteryRecipes() for converting + // Vanilla Gold Ingot to Slimefun gold dust + registerRecipe(3, new ItemStack(Material.GOLD_INGOT), SlimefunItems.GOLD_DUST); } @Override 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); 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/FluidPump.java b/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/items/electric/machines/FluidPump.java index c405cb0f4..242e4fd75 100644 --- a/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/items/electric/machines/FluidPump.java +++ b/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/items/electric/machines/FluidPump.java @@ -14,6 +14,7 @@ import io.github.thebusybiscuit.cscorelib2.blocks.Vein; import io.github.thebusybiscuit.cscorelib2.item.CustomItem; import io.github.thebusybiscuit.slimefun4.core.attributes.EnergyNetComponent; import io.github.thebusybiscuit.slimefun4.core.networks.energy.EnergyNetComponentType; +import io.github.thebusybiscuit.slimefun4.implementation.items.SimpleSlimefunItem; import io.github.thebusybiscuit.slimefun4.utils.ChestMenuUtils; import io.github.thebusybiscuit.slimefun4.utils.SlimefunUtils; import me.mrCookieSlime.CSCoreLibPlugin.Configuration.Config; @@ -21,7 +22,6 @@ import me.mrCookieSlime.CSCoreLibPlugin.general.Inventory.ChestMenu.AdvancedMenu import me.mrCookieSlime.CSCoreLibPlugin.general.Inventory.ClickAction; 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.SlimefunItem.interfaces.InventoryBlock; import me.mrCookieSlime.Slimefun.Objects.handlers.BlockTicker; 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..e13a6b319 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; @@ -148,17 +148,12 @@ public abstract class HeatedPressureChamber extends AContainer { if (timeleft > 0) { ChestMenuUtils.updateProgressbar(menu, 22, timeleft, processing.get(b).getTicks(), getProgressBar()); - if (ChargableBlock.isChargable(b)) { - if (ChargableBlock.getCharge(b) < getEnergyConsumption()) { - return; - } + if (ChargableBlock.getCharge(b) < getEnergyConsumption()) { + return; + } - ChargableBlock.addCharge(b, -getEnergyConsumption()); - progress.put(b, timeleft - 1); - } - else { - progress.put(b, timeleft - 1); - } + ChargableBlock.addCharge(b, -getEnergyConsumption()); + progress.put(b, timeleft - 1); } else { menu.replaceExistingItem(22, new CustomItem(new ItemStack(Material.BLACK_STAINED_GLASS_PANE), " ")); 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..a4a1a86dd 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,14 +13,14 @@ 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.implementation.items.SimpleSlimefunItem; 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; -import me.mrCookieSlime.Slimefun.Objects.SlimefunItem.SimpleSlimefunItem; import me.mrCookieSlime.Slimefun.Objects.SlimefunItem.SlimefunItem; import me.mrCookieSlime.Slimefun.Objects.SlimefunItem.UnregisterReason; import me.mrCookieSlime.Slimefun.Objects.handlers.BlockTicker; @@ -63,7 +63,7 @@ public class WitherAssembler extends SimpleSlimefunItem implements @Override public void newInstance(BlockMenu menu, Block b) { if (!BlockStorage.hasBlockInfo(b) || BlockStorage.getLocationInfo(b.getLocation(), "enabled") == null || BlockStorage.getLocationInfo(b.getLocation(), "enabled").equals(String.valueOf(false))) { - menu.replaceExistingItem(22, new CustomItem(new ItemStack(Material.GUNPOWDER), "&7Enabled: &4\u2718", "", "&e> Click to enable this Machine")); + menu.replaceExistingItem(22, new CustomItem(Material.GUNPOWDER, "&7Enabled: &4\u2718", "", "&e> Click to enable this Machine")); menu.addMenuClickHandler(22, (p, slot, item, action) -> { BlockStorage.addBlockInfo(b, "enabled", String.valueOf(true)); newInstance(menu, b); @@ -71,7 +71,7 @@ public class WitherAssembler extends SimpleSlimefunItem implements }); } else { - menu.replaceExistingItem(22, new CustomItem(new ItemStack(Material.REDSTONE), "&7Enabled: &2\u2714", "", "&e> Click to disable this Machine")); + menu.replaceExistingItem(22, new CustomItem(Material.REDSTONE, "&7Enabled: &2\u2714", "", "&e> Click to disable this Machine")); menu.addMenuClickHandler(22, (p, slot, item, action) -> { BlockStorage.addBlockInfo(b, "enabled", String.valueOf(false)); newInstance(menu, b); @@ -81,7 +81,7 @@ public class WitherAssembler extends SimpleSlimefunItem implements double offset = (!BlockStorage.hasBlockInfo(b) || BlockStorage.getLocationInfo(b.getLocation(), "offset") == null) ? 3.0F : Double.valueOf(BlockStorage.getLocationInfo(b.getLocation(), "offset")); - menu.replaceExistingItem(31, new CustomItem(new ItemStack(Material.PISTON), "&7Offset: &3" + offset + " Block(s)", "", "&rLeft Click: &7+0.1", "&rRight Click: &7-0.1")); + menu.replaceExistingItem(31, new CustomItem(Material.PISTON, "&7Offset: &3" + offset + " Block(s)", "", "&rLeft Click: &7+0.1", "&rRight Click: &7-0.1")); menu.addMenuClickHandler(31, (p, slot, item, action) -> { double offsetv = DoubleHandler.fixDouble(Double.valueOf(BlockStorage.getLocationInfo(b.getLocation(), "offset")) + (action.isRightClicked() ? -0.1F : 0.1F)); BlockStorage.addBlockInfo(b, "offset", String.valueOf(offsetv)); @@ -97,17 +97,27 @@ public class WitherAssembler extends SimpleSlimefunItem implements @Override public int[] getSlotsAccessedByItemTransport(ItemTransportFlow flow) { - if (flow == ItemTransportFlow.INSERT) return getInputSlots(); - else return new int[0]; + if (flow == ItemTransportFlow.INSERT) { + return getInputSlots(); + } + else { + return new int[0]; + } } @Override public int[] getSlotsAccessedByItemTransport(DirtyChestMenu menu, ItemTransportFlow flow, ItemStack item) { - if (flow == ItemTransportFlow.INSERT) { - if (SlimefunUtils.isItemSimilar(item, new ItemStack(Material.SOUL_SAND), true)) return getSoulSandSlots(); - else return getWitherSkullSlots(); + if (flow == ItemTransportFlow.INSERT && item != null) { + if (item.getType() == Material.SOUL_SAND) { + return getSoulSandSlots(); + } + + if (item.getType() == Material.WITHER_SKELETON_SKULL) { + return getWitherSkullSlots(); + } } - else return new int[0]; + + return new int[0]; } }; @@ -121,7 +131,10 @@ public class WitherAssembler extends SimpleSlimefunItem implements @Override public boolean onBreak(Player p, Block b, SlimefunItem item, UnregisterReason reason) { - if (reason == UnregisterReason.EXPLODE) return false; + if (reason == UnregisterReason.EXPLODE) { + return false; + } + BlockMenu inv = BlockStorage.getInventory(b); if (inv != null) { @@ -139,6 +152,7 @@ public class WitherAssembler extends SimpleSlimefunItem implements } } } + return true; } }); @@ -227,7 +241,7 @@ public class WitherAssembler extends SimpleSlimefunItem implements int found = 0; for (int slot : slots) { - if (SlimefunUtils.isItemSimilar(menu.getItemInSlot(slot), new ItemStack(resource), true)) { + if (SlimefunUtils.isItemSimilar(menu.getItemInSlot(slot), new ItemStack(resource), true, false)) { found += menu.getItemInSlot(slot).getAmount(); if (found > required) { @@ -244,7 +258,7 @@ public class WitherAssembler extends SimpleSlimefunItem implements int skulls = 3; for (int slot : getSoulSandSlots()) { - if (SlimefunUtils.isItemSimilar(inv.getItemInSlot(slot), new ItemStack(Material.SOUL_SAND), true)) { + if (SlimefunUtils.isItemSimilar(inv.getItemInSlot(slot), new ItemStack(Material.SOUL_SAND), true, false)) { int amount = inv.getItemInSlot(slot).getAmount(); if (amount >= soulsand) { @@ -259,7 +273,7 @@ public class WitherAssembler extends SimpleSlimefunItem implements } for (int slot : getWitherSkullSlots()) { - if (SlimefunUtils.isItemSimilar(inv.getItemInSlot(slot), new ItemStack(Material.WITHER_SKELETON_SKULL), true)) { + if (SlimefunUtils.isItemSimilar(inv.getItemInSlot(slot), new ItemStack(Material.WITHER_SKELETON_SKULL), true, false)) { int amount = inv.getItemInSlot(slot).getAmount(); if (amount >= skulls) { 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..582fd78e5 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; @@ -278,7 +278,7 @@ public abstract class Reactor extends AbstractEnergyProvider { if (timeleft > 0) { int produced = getEnergyProduction(); - int space = ChargableBlock.getMaxCharge(l) - charge; + int space = getCapacity() - charge; if (space >= produced || !ReactorMode.GENERATOR.toString().equals(BlockStorage.getLocationInfo(l, MODE))) { progress.put(l, timeleft - 1); @@ -347,7 +347,7 @@ public abstract class Reactor extends AbstractEnergyProvider { } private void createByproduct(Location l, BlockMenu inv, BlockMenu accessPort) { - inv.replaceExistingItem(22, new CustomItem(new ItemStack(Material.BLACK_STAINED_GLASS_PANE), " ")); + inv.replaceExistingItem(22, new CustomItem(Material.BLACK_STAINED_GLASS_PANE, " ")); if (processing.get(l).getOutput() != null) { inv.pushItem(processing.get(l).getOutput(), getOutputSlots()); 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..634746bf9 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,11 +5,11 @@ 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.core.handlers.ItemConsumptionHandler; +import io.github.thebusybiscuit.slimefun4.implementation.SlimefunPlugin; +import io.github.thebusybiscuit.slimefun4.implementation.items.SimpleSlimefunItem; import me.mrCookieSlime.Slimefun.Lists.RecipeType; import me.mrCookieSlime.Slimefun.Objects.Category; -import me.mrCookieSlime.Slimefun.Objects.SlimefunItem.SimpleSlimefunItem; -import me.mrCookieSlime.Slimefun.Objects.handlers.ItemConsumptionHandler; import me.mrCookieSlime.Slimefun.api.SlimefunItemStack; /** @@ -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..cb8a13a23 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 @@ -7,13 +7,13 @@ import org.bukkit.entity.Player; import org.bukkit.inventory.ItemStack; import io.github.thebusybiscuit.cscorelib2.chat.ChatColors; +import io.github.thebusybiscuit.slimefun4.core.handlers.ItemConsumptionHandler; import io.github.thebusybiscuit.slimefun4.core.services.LocalizationService; -import me.mrCookieSlime.Slimefun.SlimefunPlugin; +import io.github.thebusybiscuit.slimefun4.implementation.SlimefunPlugin; +import io.github.thebusybiscuit.slimefun4.implementation.items.SimpleSlimefunItem; 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.ItemConsumptionHandler; import me.mrCookieSlime.Slimefun.api.SlimefunItemStack; /** @@ -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/food/MagicSugar.java b/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/items/food/MagicSugar.java index fb7af2b3e..a09eaf31e 100644 --- a/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/items/food/MagicSugar.java +++ b/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/items/food/MagicSugar.java @@ -9,10 +9,10 @@ import org.bukkit.potion.PotionEffect; import org.bukkit.potion.PotionEffectType; import io.github.thebusybiscuit.cscorelib2.inventory.ItemUtils; +import io.github.thebusybiscuit.slimefun4.core.handlers.ItemUseHandler; +import io.github.thebusybiscuit.slimefun4.implementation.items.SimpleSlimefunItem; import me.mrCookieSlime.Slimefun.Lists.RecipeType; import me.mrCookieSlime.Slimefun.Objects.Category; -import me.mrCookieSlime.Slimefun.Objects.SlimefunItem.SimpleSlimefunItem; -import me.mrCookieSlime.Slimefun.Objects.handlers.ItemUseHandler; import me.mrCookieSlime.Slimefun.api.SlimefunItemStack; public class MagicSugar extends SimpleSlimefunItem { diff --git a/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/items/food/MeatJerky.java b/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/items/food/MeatJerky.java index 7da8dad06..3ca675d84 100644 --- a/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/items/food/MeatJerky.java +++ b/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/items/food/MeatJerky.java @@ -3,10 +3,10 @@ package io.github.thebusybiscuit.slimefun4.implementation.items.food; import org.bukkit.inventory.ItemStack; import io.github.thebusybiscuit.slimefun4.api.items.ItemSetting; +import io.github.thebusybiscuit.slimefun4.core.handlers.ItemConsumptionHandler; +import io.github.thebusybiscuit.slimefun4.implementation.items.SimpleSlimefunItem; import me.mrCookieSlime.Slimefun.Lists.RecipeType; import me.mrCookieSlime.Slimefun.Objects.Category; -import me.mrCookieSlime.Slimefun.Objects.SlimefunItem.SimpleSlimefunItem; -import me.mrCookieSlime.Slimefun.Objects.handlers.ItemConsumptionHandler; import me.mrCookieSlime.Slimefun.api.SlimefunItemStack; /** diff --git a/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/items/food/MonsterJerky.java b/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/items/food/MonsterJerky.java index 4033da48e..1766b481f 100644 --- a/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/items/food/MonsterJerky.java +++ b/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/items/food/MonsterJerky.java @@ -4,10 +4,10 @@ import org.bukkit.inventory.ItemStack; import org.bukkit.potion.PotionEffect; import org.bukkit.potion.PotionEffectType; +import io.github.thebusybiscuit.slimefun4.core.handlers.ItemConsumptionHandler; +import io.github.thebusybiscuit.slimefun4.implementation.items.SimpleSlimefunItem; import me.mrCookieSlime.Slimefun.Lists.RecipeType; import me.mrCookieSlime.Slimefun.Objects.Category; -import me.mrCookieSlime.Slimefun.Objects.SlimefunItem.SimpleSlimefunItem; -import me.mrCookieSlime.Slimefun.Objects.handlers.ItemConsumptionHandler; import me.mrCookieSlime.Slimefun.api.Slimefun; import me.mrCookieSlime.Slimefun.api.SlimefunItemStack; 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..de00637ad 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,11 +3,11 @@ 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.core.handlers.BlockUseHandler; +import io.github.thebusybiscuit.slimefun4.implementation.SlimefunPlugin; +import io.github.thebusybiscuit.slimefun4.implementation.items.SimpleSlimefunItem; import me.mrCookieSlime.Slimefun.Lists.RecipeType; import me.mrCookieSlime.Slimefun.Objects.Category; -import me.mrCookieSlime.Slimefun.Objects.SlimefunItem.SimpleSlimefunItem; -import me.mrCookieSlime.Slimefun.Objects.handlers.BlockUseHandler; import me.mrCookieSlime.Slimefun.api.SlimefunItemStack; public class GEOScanner extends 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..721020aa2 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; @@ -36,7 +36,7 @@ public abstract class OilPump extends AContainer implements RecipeDisplayItem { public OilPump(Category category, SlimefunItemStack item, RecipeType recipeType, ItemStack[] recipe) { super(category, item, recipeType, recipe); - oil = SlimefunPlugin.getRegistry().getGEOResources().get(new NamespacedKey(SlimefunPlugin.instance, "oil")).orElse(null); + oil = SlimefunPlugin.getRegistry().getGEOResources().get(new NamespacedKey(SlimefunPlugin.instance(), "oil")).orElse(null); new BlockMenuPreset(getID(), getInventoryTitle()) { @@ -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..1c336c348 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,11 +5,11 @@ import java.util.Optional; import org.bukkit.block.Block; import org.bukkit.inventory.ItemStack; -import me.mrCookieSlime.Slimefun.SlimefunPlugin; +import io.github.thebusybiscuit.slimefun4.core.handlers.ItemUseHandler; +import io.github.thebusybiscuit.slimefun4.implementation.SlimefunPlugin; +import io.github.thebusybiscuit.slimefun4.implementation.items.SimpleSlimefunItem; import me.mrCookieSlime.Slimefun.Lists.RecipeType; import me.mrCookieSlime.Slimefun.Objects.Category; -import me.mrCookieSlime.Slimefun.Objects.SlimefunItem.SimpleSlimefunItem; -import me.mrCookieSlime.Slimefun.Objects.handlers.ItemUseHandler; import me.mrCookieSlime.Slimefun.api.SlimefunItemStack; public class PortableGEOScanner extends 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..86e7d4482 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,16 +20,16 @@ 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.core.handlers.BlockUseHandler; +import io.github.thebusybiscuit.slimefun4.implementation.SlimefunPlugin; +import io.github.thebusybiscuit.slimefun4.implementation.items.SimpleSlimefunItem; 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; -import me.mrCookieSlime.Slimefun.Objects.SlimefunItem.SimpleSlimefunItem; import me.mrCookieSlime.Slimefun.Objects.SlimefunItem.SlimefunItem; import me.mrCookieSlime.Slimefun.Objects.SlimefunItem.UnregisterReason; -import me.mrCookieSlime.Slimefun.Objects.handlers.BlockUseHandler; import me.mrCookieSlime.Slimefun.api.BlockStorage; import me.mrCookieSlime.Slimefun.api.Slimefun; import me.mrCookieSlime.Slimefun.api.SlimefunItemStack; @@ -96,13 +96,13 @@ public class ElevatorPlate extends SimpleSlimefunItem { return; } - CustomBookInterface book = new CustomBookInterface(SlimefunPlugin.instance); + CustomBookInterface book = new CustomBookInterface(SlimefunPlugin.instance()); ChatComponent page = null; 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,12 +120,12 @@ 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.setClickEvent(new ClickEvent(new NamespacedKey(SlimefunPlugin.instance, DATA_KEY + i), player -> Slimefun.runSync(() -> { + 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()); float yaw = player.getEyeLocation().getYaw() + 180; @@ -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..4d11de893 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,11 +2,11 @@ package io.github.thebusybiscuit.slimefun4.implementation.items.gps; import org.bukkit.inventory.ItemStack; -import me.mrCookieSlime.Slimefun.SlimefunPlugin; +import io.github.thebusybiscuit.slimefun4.core.handlers.BlockUseHandler; +import io.github.thebusybiscuit.slimefun4.implementation.SlimefunPlugin; +import io.github.thebusybiscuit.slimefun4.implementation.items.SimpleSlimefunItem; import me.mrCookieSlime.Slimefun.Lists.RecipeType; import me.mrCookieSlime.Slimefun.Objects.Category; -import me.mrCookieSlime.Slimefun.Objects.SlimefunItem.SimpleSlimefunItem; -import me.mrCookieSlime.Slimefun.Objects.handlers.BlockUseHandler; import me.mrCookieSlime.Slimefun.api.SlimefunItemStack; public class GPSControlPanel extends 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..b19fd4c0b 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,11 +4,11 @@ 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.core.handlers.ItemUseHandler; +import io.github.thebusybiscuit.slimefun4.implementation.SlimefunPlugin; +import io.github.thebusybiscuit.slimefun4.implementation.items.SimpleSlimefunItem; import me.mrCookieSlime.Slimefun.Lists.RecipeType; import me.mrCookieSlime.Slimefun.Objects.Category; -import me.mrCookieSlime.Slimefun.Objects.SlimefunItem.SimpleSlimefunItem; -import me.mrCookieSlime.Slimefun.Objects.handlers.ItemUseHandler; import me.mrCookieSlime.Slimefun.api.SlimefunItemStack; public class GPSMarkerTool extends SimpleSlimefunItem implements NotPlaceable { 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..ef66e79c0 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,12 +8,12 @@ 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 io.github.thebusybiscuit.slimefun4.implementation.items.SimpleSlimefunItem; 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; -import me.mrCookieSlime.Slimefun.Objects.SlimefunItem.SimpleSlimefunItem; import me.mrCookieSlime.Slimefun.Objects.SlimefunItem.SlimefunItem; import me.mrCookieSlime.Slimefun.Objects.SlimefunItem.UnregisterReason; import me.mrCookieSlime.Slimefun.Objects.handlers.BlockTicker; diff --git a/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/items/gps/TeleporterPylon.java b/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/items/gps/TeleporterPylon.java index 1d4bba69d..742428e51 100644 --- a/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/items/gps/TeleporterPylon.java +++ b/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/items/gps/TeleporterPylon.java @@ -3,10 +3,10 @@ package io.github.thebusybiscuit.slimefun4.implementation.items.gps; import org.bukkit.Material; import org.bukkit.inventory.ItemStack; +import io.github.thebusybiscuit.slimefun4.core.handlers.RainbowTickHandler; import io.github.thebusybiscuit.slimefun4.implementation.items.blocks.RainbowBlock; import me.mrCookieSlime.Slimefun.Lists.RecipeType; import me.mrCookieSlime.Slimefun.Objects.Category; -import me.mrCookieSlime.Slimefun.Objects.handlers.RainbowTicker; import me.mrCookieSlime.Slimefun.api.SlimefunItemStack; /** @@ -17,12 +17,12 @@ import me.mrCookieSlime.Slimefun.api.SlimefunItemStack; * * @see Teleporter * @see RainbowBlock - * @see RainbowTicker + * @see RainbowTickHandler */ public class TeleporterPylon extends RainbowBlock { public TeleporterPylon(Category category, SlimefunItemStack item, RecipeType recipeType, ItemStack[] recipe, ItemStack recipeOutput) { - super(category, item, recipeType, recipe, recipeOutput, new RainbowTicker(Material.CYAN_STAINED_GLASS, Material.PURPLE_STAINED_GLASS)); + super(category, item, recipeType, recipe, recipeOutput, new RainbowTickHandler(Material.CYAN_STAINED_GLASS, Material.PURPLE_STAINED_GLASS)); } } diff --git a/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/items/magical/EnchantmentRune.java b/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/items/magical/EnchantmentRune.java new file mode 100644 index 000000000..c57ffe8d1 --- /dev/null +++ b/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/items/magical/EnchantmentRune.java @@ -0,0 +1,168 @@ +package io.github.thebusybiscuit.slimefun4.implementation.items.magical; + +import java.util.ArrayList; +import java.util.Collection; +import java.util.EnumMap; +import java.util.List; +import java.util.Map; +import java.util.Optional; +import java.util.concurrent.ThreadLocalRandom; + +import org.bukkit.Location; +import org.bukkit.Material; +import org.bukkit.Particle; +import org.bukkit.Sound; +import org.bukkit.enchantments.Enchantment; +import org.bukkit.entity.Entity; +import org.bukkit.entity.Item; +import org.bukkit.entity.Player; +import org.bukkit.event.player.PlayerDropItemEvent; +import org.bukkit.inventory.ItemStack; + +import io.github.thebusybiscuit.slimefun4.core.handlers.ItemDropHandler; +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.api.Slimefun; +import me.mrCookieSlime.Slimefun.api.SlimefunItemStack; + +/** + * This {@link SlimefunItem} allows you to enchant any enchantable {@link ItemStack} with a random + * {@link Enchantment}. It is also one of the very few utilisations of {@link ItemDropHandler}. + * + * @author Linox + * + * @see ItemDropHandler + * @see Enchantment + * + */ +public class EnchantmentRune extends SimpleSlimefunItem { + + private static final double RANGE = 1.5; + private final Map> applicableEnchantments = new EnumMap<>(Material.class); + + public EnchantmentRune(Category category, SlimefunItemStack item, RecipeType recipeType, ItemStack[] recipe) { + super(category, item, recipeType, recipe); + + for (Material mat : Material.values()) { + List enchantments = new ArrayList<>(); + + for (Enchantment enchantment : Enchantment.values()) { + if (enchantment == Enchantment.BINDING_CURSE || enchantment == Enchantment.VANISHING_CURSE) { + continue; + } + + if (enchantment.canEnchantItem(new ItemStack(mat))) { + enchantments.add(enchantment); + } + } + + applicableEnchantments.put(mat, enchantments); + } + } + + @Override + public ItemDropHandler getItemHandler() { + return (e, p, item) -> { + if (isItem(item.getItemStack())) { + + if (!Slimefun.hasUnlocked(p, this, true)) { + return true; + } + + Slimefun.runSync(() -> addRandomEnchantment(p, e, item), 20L); + + return true; + } + + return false; + }; + } + + private void addRandomEnchantment(Player p, PlayerDropItemEvent e, Item item) { + // Being sure the entity is still valid and not picked up or whatsoever. + if (!item.isValid()) { + return; + } + + Location l = item.getLocation(); + Collection entites = l.getWorld().getNearbyEntities(l, RANGE, RANGE, RANGE, this::findCompatibleItem); + Optional optional = entites.stream().findFirst(); + + if (optional.isPresent()) { + Item entity = (Item) optional.get(); + ItemStack target = entity.getItemStack(); + + List applicableEnchantmentList = applicableEnchantments.get(target.getType()); + + if (applicableEnchantmentList == null) { + SlimefunPlugin.getLocalization().sendMessage(p, "messages.enchantment-rune.fail", true); + return; + } + else { + applicableEnchantmentList = new ArrayList<>(applicableEnchantmentList); + } + + // Removing the enchantments that the item already has from enchantmentSet + for (Enchantment enchantment : target.getEnchantments().keySet()) { + for (Enchantment possibleEnchantment : applicableEnchantmentList) { + if (possibleEnchantment == enchantment || possibleEnchantment.conflictsWith(enchantment)) { + applicableEnchantmentList.remove(possibleEnchantment); + } + } + } + + if (applicableEnchantmentList.isEmpty()) { + SlimefunPlugin.getLocalization().sendMessage(p, "messages.enchantment-rune.no-enchantment", true); + return; + } + + Enchantment enchantment = applicableEnchantmentList.get(ThreadLocalRandom.current().nextInt(applicableEnchantmentList.size())); + int level = 1; + + if (enchantment.getMaxLevel() != 1) { + level = ThreadLocalRandom.current().nextInt(enchantment.getMaxLevel()) + 1; + } + + target.addEnchantment(enchantment, level); + + if (target.getAmount() == 1) { + e.setCancelled(true); + + // This lightning is just an effect, it deals no damage. + l.getWorld().strikeLightningEffect(l); + + Slimefun.runSync(() -> { + // Being sure entities are still valid and not picked up or whatsoever. + if (item.isValid() && entity.isValid() && target.getAmount() == 1) { + + l.getWorld().spawnParticle(Particle.CRIT_MAGIC, l, 1); + l.getWorld().playSound(l, Sound.ENTITY_ZOMBIE_VILLAGER_CURE, 1F, 1F); + + entity.remove(); + item.remove(); + l.getWorld().dropItemNaturally(l, target); + + SlimefunPlugin.getLocalization().sendMessage(p, "messages.enchantment-rune.success", true); + } + }, 10L); + } + else { + SlimefunPlugin.getLocalization().sendMessage(p, "messages.enchantment-rune.fail", true); + } + } + } + + private boolean findCompatibleItem(Entity n) { + if (n instanceof Item) { + Item item = (Item) n; + + return !isItem(item.getItemStack()); + } + + return false; + } + +} diff --git a/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/items/magical/InfernalBonemeal.java b/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/items/magical/InfernalBonemeal.java index c2dd7eda7..f10c86655 100644 --- a/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/items/magical/InfernalBonemeal.java +++ b/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/items/magical/InfernalBonemeal.java @@ -11,10 +11,10 @@ import org.bukkit.event.Event.Result; import org.bukkit.inventory.ItemStack; import io.github.thebusybiscuit.cscorelib2.inventory.ItemUtils; +import io.github.thebusybiscuit.slimefun4.core.handlers.ItemUseHandler; +import io.github.thebusybiscuit.slimefun4.implementation.items.SimpleSlimefunItem; import me.mrCookieSlime.Slimefun.Lists.RecipeType; import me.mrCookieSlime.Slimefun.Objects.Category; -import me.mrCookieSlime.Slimefun.Objects.SlimefunItem.SimpleSlimefunItem; -import me.mrCookieSlime.Slimefun.Objects.handlers.ItemUseHandler; import me.mrCookieSlime.Slimefun.api.SlimefunItemStack; public class InfernalBonemeal extends SimpleSlimefunItem { diff --git a/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/items/magical/KnowledgeFlask.java b/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/items/magical/KnowledgeFlask.java index b0e45da66..99744102d 100644 --- a/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/items/magical/KnowledgeFlask.java +++ b/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/items/magical/KnowledgeFlask.java @@ -5,12 +5,12 @@ import org.bukkit.entity.Player; import org.bukkit.inventory.ItemStack; import io.github.thebusybiscuit.cscorelib2.inventory.ItemUtils; +import io.github.thebusybiscuit.slimefun4.core.handlers.ItemUseHandler; import io.github.thebusybiscuit.slimefun4.implementation.SlimefunItems; +import io.github.thebusybiscuit.slimefun4.implementation.items.SimpleSlimefunItem; 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.ItemUseHandler; import me.mrCookieSlime.Slimefun.api.SlimefunItemStack; /** 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..ed923bc6d 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 @@ -14,12 +14,12 @@ import org.bukkit.inventory.meta.ItemMeta; 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.handlers.ItemUseHandler; import io.github.thebusybiscuit.slimefun4.core.researching.Research; -import me.mrCookieSlime.Slimefun.SlimefunPlugin; +import io.github.thebusybiscuit.slimefun4.implementation.SlimefunPlugin; +import io.github.thebusybiscuit.slimefun4.implementation.items.SimpleSlimefunItem; import me.mrCookieSlime.Slimefun.Lists.RecipeType; import me.mrCookieSlime.Slimefun.Objects.Category; -import me.mrCookieSlime.Slimefun.Objects.SlimefunItem.SimpleSlimefunItem; -import me.mrCookieSlime.Slimefun.Objects.handlers.ItemUseHandler; import me.mrCookieSlime.Slimefun.api.SlimefunItemStack; public class KnowledgeTome extends 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/MagicEyeOfEnder.java b/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/items/magical/MagicEyeOfEnder.java index 762ca355f..b8163c176 100644 --- a/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/items/magical/MagicEyeOfEnder.java +++ b/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/items/magical/MagicEyeOfEnder.java @@ -6,12 +6,12 @@ import org.bukkit.entity.Player; import org.bukkit.inventory.ItemStack; import org.bukkit.inventory.PlayerInventory; +import io.github.thebusybiscuit.slimefun4.core.handlers.ItemUseHandler; import io.github.thebusybiscuit.slimefun4.implementation.SlimefunItems; +import io.github.thebusybiscuit.slimefun4.implementation.items.SimpleSlimefunItem; import io.github.thebusybiscuit.slimefun4.utils.SlimefunUtils; import me.mrCookieSlime.Slimefun.Lists.RecipeType; import me.mrCookieSlime.Slimefun.Objects.Category; -import me.mrCookieSlime.Slimefun.Objects.SlimefunItem.SimpleSlimefunItem; -import me.mrCookieSlime.Slimefun.Objects.handlers.ItemUseHandler; import me.mrCookieSlime.Slimefun.api.SlimefunItemStack; public class MagicEyeOfEnder extends SimpleSlimefunItem { 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..b14be25e1 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.core.handlers.EntityInteractHandler; +import io.github.thebusybiscuit.slimefun4.implementation.SlimefunPlugin; +import io.github.thebusybiscuit.slimefun4.implementation.items.SimpleSlimefunItem; 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..c9f33c4e5 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 @@ -12,14 +12,13 @@ import org.bukkit.event.player.PlayerDropItemEvent; 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.core.handlers.ItemDropHandler; +import io.github.thebusybiscuit.slimefun4.implementation.SlimefunPlugin; +import io.github.thebusybiscuit.slimefun4.implementation.items.SimpleSlimefunItem; 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; import me.mrCookieSlime.Slimefun.Objects.SlimefunItem.SlimefunItem; -import me.mrCookieSlime.Slimefun.Objects.handlers.ItemDropHandler; import me.mrCookieSlime.Slimefun.api.Slimefun; import me.mrCookieSlime.Slimefun.api.SlimefunItemStack; @@ -48,7 +47,7 @@ public class SoulboundRune extends SimpleSlimefunItem { return (e, p, item) -> { if (isItem(item.getItemStack())) { - if (!Slimefun.hasUnlocked(p, SlimefunItems.SOULBOUND_RUNE, true)) { + if (!Slimefun.hasUnlocked(p, this, true)) { return true; } @@ -93,12 +92,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..8e14f1ed1 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 @@ -17,13 +17,13 @@ import org.bukkit.persistence.PersistentDataType; import io.github.thebusybiscuit.cscorelib2.chat.ChatColors; import io.github.thebusybiscuit.cscorelib2.protection.ProtectableAction; +import io.github.thebusybiscuit.slimefun4.core.handlers.ItemUseHandler; import io.github.thebusybiscuit.slimefun4.implementation.SlimefunItems; -import me.mrCookieSlime.Slimefun.SlimefunPlugin; +import io.github.thebusybiscuit.slimefun4.implementation.SlimefunPlugin; +import io.github.thebusybiscuit.slimefun4.implementation.items.SimpleSlimefunItem; 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.ItemUseHandler; import me.mrCookieSlime.Slimefun.api.SlimefunItemStack; /** @@ -37,7 +37,7 @@ import me.mrCookieSlime.Slimefun.api.SlimefunItemStack; */ public class StormStaff extends SimpleSlimefunItem { - private static final NamespacedKey usageKey = new NamespacedKey(SlimefunPlugin.instance, "stormstaff_usage"); + private static final NamespacedKey usageKey = new NamespacedKey(SlimefunPlugin.instance(), "stormstaff_usage"); public static final int MAX_USES = 8; public StormStaff(Category category, SlimefunItemStack item, RecipeType recipeType, ItemStack[] recipe) { @@ -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/TelepositionScroll.java b/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/items/magical/TelepositionScroll.java index 122e88126..be4d3ed4f 100644 --- a/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/items/magical/TelepositionScroll.java +++ b/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/items/magical/TelepositionScroll.java @@ -7,11 +7,11 @@ import org.bukkit.entity.LivingEntity; import org.bukkit.inventory.ItemStack; import io.github.thebusybiscuit.slimefun4.api.items.ItemSetting; +import io.github.thebusybiscuit.slimefun4.core.handlers.ItemUseHandler; +import io.github.thebusybiscuit.slimefun4.implementation.items.SimpleSlimefunItem; 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.ItemUseHandler; import me.mrCookieSlime.Slimefun.api.SlimefunItemStack; /** 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..ca0f26c6d 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,12 +3,12 @@ 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.core.handlers.ItemUseHandler; +import io.github.thebusybiscuit.slimefun4.implementation.SlimefunPlugin; +import io.github.thebusybiscuit.slimefun4.implementation.items.SimpleSlimefunItem; 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.ItemUseHandler; import me.mrCookieSlime.Slimefun.api.SlimefunItemStack; /** @@ -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..6c07381ac 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,11 +9,11 @@ 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.core.handlers.ItemUseHandler; +import io.github.thebusybiscuit.slimefun4.implementation.SlimefunPlugin; +import io.github.thebusybiscuit.slimefun4.implementation.items.SimpleSlimefunItem; import me.mrCookieSlime.Slimefun.Lists.RecipeType; import me.mrCookieSlime.Slimefun.Objects.Category; -import me.mrCookieSlime.Slimefun.Objects.SlimefunItem.SimpleSlimefunItem; -import me.mrCookieSlime.Slimefun.Objects.handlers.ItemUseHandler; import me.mrCookieSlime.Slimefun.api.SlimefunItemStack; public class WindStaff extends 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..ee66d564f 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; /** @@ -19,7 +19,7 @@ import me.mrCookieSlime.Slimefun.api.SlimefunItemStack; */ class EnderTalisman extends Talisman { - private static final LockedCategory ENDER_TALISMANS_CATEGORY = new LockedCategory(new NamespacedKey(SlimefunPlugin.instance, "ender_talismans"), new CustomItem(SlimefunItems.ENDER_TALISMAN, "&7Talismans - &aTier II"), 3, Talisman.TALISMANS_CATEGORY.getKey()); + private static final LockedCategory ENDER_TALISMANS_CATEGORY = new LockedCategory(new NamespacedKey(SlimefunPlugin.instance(), "ender_talismans"), new CustomItem(SlimefunItems.ENDER_TALISMAN, "&7Talismans - &aTier II"), 3, Talisman.TALISMANS_CATEGORY.getKey()); public EnderTalisman(Talisman parent, SlimefunItemStack item) { super(ENDER_TALISMANS_CATEGORY, item, new ItemStack[] { SlimefunItems.ENDER_LUMP_3, null, SlimefunItems.ENDER_LUMP_3, null, parent.getItem(), null, SlimefunItems.ENDER_LUMP_3, null, SlimefunItems.ENDER_LUMP_3 }, parent.isConsumable(), parent.isEventCancelled(), parent.getMessageSuffix(), parent.getChance(), parent.getEffects()); diff --git a/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/items/magical/talismans/MagicianTalisman.java b/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/items/magical/talismans/MagicianTalisman.java index d91c8ead3..24bbd93e1 100644 --- a/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/items/magical/talismans/MagicianTalisman.java +++ b/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/items/magical/talismans/MagicianTalisman.java @@ -29,7 +29,7 @@ public class MagicianTalisman extends Talisman { } } catch (Exception x) { - Slimefun.getLogger().log(Level.SEVERE, x, () -> "The following Exception occured while trying to register the following Enchantment: " + enchantment); + Slimefun.getLogger().log(Level.SEVERE, x, () -> "The following Exception occurred while trying to register the following Enchantment: " + enchantment); } } 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..e0a58a0da 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; @@ -31,7 +31,7 @@ import me.mrCookieSlime.Slimefun.api.SlimefunItemStack; public class Talisman extends SlimefunItem { - protected static final Category TALISMANS_CATEGORY = new Category(new NamespacedKey(SlimefunPlugin.instance, "talismans"), new CustomItem(SlimefunItems.COMMON_TALISMAN, "&7Talismans - &aTier I"), 2); + protected static final Category TALISMANS_CATEGORY = new Category(new NamespacedKey(SlimefunPlugin.instance(), "talismans"), new CustomItem(SlimefunItems.COMMON_TALISMAN, "&7Talismans - &aTier I"), 2); private final SlimefunItemStack enderTalisman; @@ -117,7 +117,7 @@ public class Talisman extends SlimefunItem { protected void createEnderTalisman() { EnderTalisman talisman = (EnderTalisman) SlimefunItem.getByItem(getEnderVariant()); - Optional research = Research.getResearch(new NamespacedKey(SlimefunPlugin.instance, "ender_talismans")); + Optional research = Research.getResearch(new NamespacedKey(SlimefunPlugin.instance(), "ender_talismans")); if (talisman != null && research.isPresent()) { talisman.setResearch(research.get()); @@ -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/medical/Bandage.java b/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/items/medical/Bandage.java index 1113a6098..33235a6a3 100644 --- a/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/items/medical/Bandage.java +++ b/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/items/medical/Bandage.java @@ -10,10 +10,10 @@ import org.bukkit.potion.PotionEffect; import org.bukkit.potion.PotionEffectType; import io.github.thebusybiscuit.cscorelib2.inventory.ItemUtils; +import io.github.thebusybiscuit.slimefun4.core.handlers.ItemUseHandler; +import io.github.thebusybiscuit.slimefun4.implementation.items.SimpleSlimefunItem; import me.mrCookieSlime.Slimefun.Lists.RecipeType; import me.mrCookieSlime.Slimefun.Objects.Category; -import me.mrCookieSlime.Slimefun.Objects.SlimefunItem.SimpleSlimefunItem; -import me.mrCookieSlime.Slimefun.Objects.handlers.ItemUseHandler; import me.mrCookieSlime.Slimefun.api.SlimefunItemStack; public class Bandage extends SimpleSlimefunItem { diff --git a/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/items/medical/Medicine.java b/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/items/medical/Medicine.java index 25056dfa4..8d42e4b7e 100644 --- a/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/items/medical/Medicine.java +++ b/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/items/medical/Medicine.java @@ -3,10 +3,10 @@ package io.github.thebusybiscuit.slimefun4.implementation.items.medical; import org.bukkit.inventory.ItemStack; import org.bukkit.potion.PotionEffectType; +import io.github.thebusybiscuit.slimefun4.core.handlers.ItemConsumptionHandler; +import io.github.thebusybiscuit.slimefun4.implementation.items.SimpleSlimefunItem; import me.mrCookieSlime.Slimefun.Lists.RecipeType; import me.mrCookieSlime.Slimefun.Objects.Category; -import me.mrCookieSlime.Slimefun.Objects.SlimefunItem.SimpleSlimefunItem; -import me.mrCookieSlime.Slimefun.Objects.handlers.ItemConsumptionHandler; import me.mrCookieSlime.Slimefun.api.SlimefunItemStack; public class Medicine extends SimpleSlimefunItem { diff --git a/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/items/medical/Rag.java b/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/items/medical/Rag.java index 31ccd18b2..2d314ee86 100644 --- a/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/items/medical/Rag.java +++ b/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/items/medical/Rag.java @@ -10,10 +10,10 @@ import org.bukkit.potion.PotionEffect; import org.bukkit.potion.PotionEffectType; import io.github.thebusybiscuit.cscorelib2.inventory.ItemUtils; +import io.github.thebusybiscuit.slimefun4.core.handlers.ItemUseHandler; +import io.github.thebusybiscuit.slimefun4.implementation.items.SimpleSlimefunItem; import me.mrCookieSlime.Slimefun.Lists.RecipeType; import me.mrCookieSlime.Slimefun.Objects.Category; -import me.mrCookieSlime.Slimefun.Objects.SlimefunItem.SimpleSlimefunItem; -import me.mrCookieSlime.Slimefun.Objects.handlers.ItemUseHandler; import me.mrCookieSlime.Slimefun.api.SlimefunItemStack; public class Rag extends SimpleSlimefunItem { diff --git a/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/items/medical/Splint.java b/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/items/medical/Splint.java index 437248c3d..7518fd402 100644 --- a/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/items/medical/Splint.java +++ b/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/items/medical/Splint.java @@ -9,10 +9,10 @@ import org.bukkit.potion.PotionEffect; import org.bukkit.potion.PotionEffectType; import io.github.thebusybiscuit.cscorelib2.inventory.ItemUtils; +import io.github.thebusybiscuit.slimefun4.core.handlers.ItemUseHandler; +import io.github.thebusybiscuit.slimefun4.implementation.items.SimpleSlimefunItem; import me.mrCookieSlime.Slimefun.Lists.RecipeType; import me.mrCookieSlime.Slimefun.Objects.Category; -import me.mrCookieSlime.Slimefun.Objects.SlimefunItem.SimpleSlimefunItem; -import me.mrCookieSlime.Slimefun.Objects.handlers.ItemUseHandler; import me.mrCookieSlime.Slimefun.api.SlimefunItemStack; public class Splint extends SimpleSlimefunItem { diff --git a/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/items/medical/Vitamins.java b/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/items/medical/Vitamins.java index 85362792a..2b7240427 100644 --- a/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/items/medical/Vitamins.java +++ b/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/items/medical/Vitamins.java @@ -8,10 +8,10 @@ import org.bukkit.potion.PotionEffect; import org.bukkit.potion.PotionEffectType; import io.github.thebusybiscuit.cscorelib2.inventory.ItemUtils; +import io.github.thebusybiscuit.slimefun4.core.handlers.ItemUseHandler; +import io.github.thebusybiscuit.slimefun4.implementation.items.SimpleSlimefunItem; import me.mrCookieSlime.Slimefun.Lists.RecipeType; import me.mrCookieSlime.Slimefun.Objects.Category; -import me.mrCookieSlime.Slimefun.Objects.SlimefunItem.SimpleSlimefunItem; -import me.mrCookieSlime.Slimefun.Objects.handlers.ItemUseHandler; import me.mrCookieSlime.Slimefun.api.SlimefunItemStack; public class Vitamins extends SimpleSlimefunItem { diff --git a/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/items/electric/BasicCircuitBoard.java b/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/items/misc/BasicCircuitBoard.java similarity index 67% rename from src/main/java/io/github/thebusybiscuit/slimefun4/implementation/items/electric/BasicCircuitBoard.java rename to src/main/java/io/github/thebusybiscuit/slimefun4/implementation/items/misc/BasicCircuitBoard.java index 1934f01b5..ee6d4420a 100644 --- a/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/items/electric/BasicCircuitBoard.java +++ b/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/items/misc/BasicCircuitBoard.java @@ -1,24 +1,32 @@ -package io.github.thebusybiscuit.slimefun4.implementation.items.electric; +package io.github.thebusybiscuit.slimefun4.implementation.items.misc; import org.bukkit.inventory.ItemStack; import io.github.thebusybiscuit.slimefun4.api.events.PlayerRightClickEvent; import io.github.thebusybiscuit.slimefun4.api.items.ItemSetting; import io.github.thebusybiscuit.slimefun4.core.attributes.NotPlaceable; +import io.github.thebusybiscuit.slimefun4.core.attributes.RandomMobDrop; +import io.github.thebusybiscuit.slimefun4.core.handlers.ItemUseHandler; +import io.github.thebusybiscuit.slimefun4.implementation.items.SimpleSlimefunItem; import me.mrCookieSlime.Slimefun.Lists.RecipeType; import me.mrCookieSlime.Slimefun.Objects.Category; -import me.mrCookieSlime.Slimefun.Objects.SlimefunItem.SimpleSlimefunItem; -import me.mrCookieSlime.Slimefun.Objects.handlers.ItemUseHandler; import me.mrCookieSlime.Slimefun.api.SlimefunItemStack; -public class BasicCircuitBoard extends SimpleSlimefunItem implements NotPlaceable { +public class BasicCircuitBoard extends SimpleSlimefunItem implements NotPlaceable, RandomMobDrop { private final ItemSetting dropSetting = new ItemSetting<>("drop-from-golems", true); + private final ItemSetting chance = new ItemSetting<>("golem-drop-chance", 75); public BasicCircuitBoard(Category category, SlimefunItemStack item, RecipeType recipeType, ItemStack[] recipe) { super(category, item, recipeType, recipe); addItemSetting(dropSetting); + addItemSetting(chance); + } + + @Override + public int getMobDropChance() { + return chance.getValue(); } public boolean isDroppedFromGolems() { @@ -30,4 +38,4 @@ public class BasicCircuitBoard extends SimpleSlimefunItem implem return PlayerRightClickEvent::cancel; } -} +} \ No newline at end of file diff --git a/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/items/misc/CoolantCell.java b/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/items/misc/CoolantCell.java new file mode 100644 index 000000000..347a70d75 --- /dev/null +++ b/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/items/misc/CoolantCell.java @@ -0,0 +1,35 @@ +package io.github.thebusybiscuit.slimefun4.implementation.items.misc; + +import org.bukkit.inventory.ItemStack; + +import io.github.thebusybiscuit.slimefun4.implementation.items.blocks.UnplaceableBlock; +import io.github.thebusybiscuit.slimefun4.implementation.items.cargo.ReactorAccessPort; +import io.github.thebusybiscuit.slimefun4.implementation.items.electric.reactors.NetherStarReactor; +import io.github.thebusybiscuit.slimefun4.implementation.items.electric.reactors.NuclearReactor; +import io.github.thebusybiscuit.slimefun4.implementation.items.electric.reactors.Reactor; +import me.mrCookieSlime.Slimefun.Lists.RecipeType; +import me.mrCookieSlime.Slimefun.Objects.Category; +import me.mrCookieSlime.Slimefun.api.SlimefunItemStack; + +/** + * A {@link CoolantCell} is an {@link ItemStack} that is used to cool a {@link Reactor}. + * + * @author TheBusyBiscuit + * + * @see Reactor + * @see ReactorAccessPort + * @see NuclearReactor + * @see NetherStarReactor + * + */ +public class CoolantCell extends UnplaceableBlock { + + public CoolantCell(Category category, SlimefunItemStack item, RecipeType recipeType, ItemStack[] recipe) { + super(category, item, recipeType, recipe); + } + + public CoolantCell(Category category, SlimefunItemStack item, RecipeType recipeType, ItemStack[] recipe, ItemStack recipeOutput) { + super(category, item, recipeType, recipe, recipeOutput); + } + +} 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..d70141974 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; @@ -76,10 +76,10 @@ public class AutomatedPanningMachine extends MultiBlockMachine { } }); - queue.execute(SlimefunPlugin.instance); + 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..147205048 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,13 +75,13 @@ 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) { for (int j = 0; j < 4; j++) { int current = j; - Bukkit.getScheduler().runTaskLater(SlimefunPlugin.instance, () -> { + Bukkit.getScheduler().runTaskLater(SlimefunPlugin.instance(), () -> { p.getWorld().playEffect(b.getLocation(), Effect.MOBSPAWNER_FLAMES, 1); p.getWorld().playEffect(b.getLocation(), Effect.ENDER_SIGNAL, 1); 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 03b37556e..85337c638 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 @@ -14,11 +14,12 @@ import org.bukkit.inventory.Inventory; import org.bukkit.inventory.ItemStack; import io.github.thebusybiscuit.cscorelib2.item.CustomItem; +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; @@ -43,6 +44,14 @@ public class OreCrusher extends MultiBlockMachine { super.postRegister(); displayRecipes.addAll(Arrays.asList(new ItemStack(Material.COAL_ORE), doubleOres.getCoal(), new ItemStack(Material.LAPIS_ORE), doubleOres.getLapisLazuli(), new ItemStack(Material.REDSTONE_ORE), doubleOres.getRedstone(), new ItemStack(Material.DIAMOND_ORE), doubleOres.getDiamond(), new ItemStack(Material.EMERALD_ORE), doubleOres.getEmerald(), new ItemStack(Material.NETHER_QUARTZ_ORE), doubleOres.getNetherQuartz())); + + if (SlimefunPlugin.getMinecraftVersion().isAtLeast(MinecraftVersion.MINECRAFT_1_16)) { + displayRecipes.add(new ItemStack(Material.NETHER_GOLD_ORE)); + displayRecipes.add(doubleOres.getGoldNuggets()); + + displayRecipes.add(new ItemStack(Material.GILDED_BLACKSTONE)); + displayRecipes.add(doubleOres.getGoldNuggets()); + } } @Override @@ -68,14 +77,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 { @@ -86,6 +95,7 @@ public class OreCrusher extends MultiBlockMachine { private final ItemStack diamond = new ItemStack(Material.DIAMOND, 1); private final ItemStack emerald = new ItemStack(Material.EMERALD, 1); private final ItemStack quartz = new ItemStack(Material.QUARTZ, 1); + private final ItemStack goldNuggets = new ItemStack(Material.GOLD_NUGGET, 4); public DoubleOreSetting() { super("double-ores", true); @@ -98,6 +108,7 @@ public class OreCrusher extends MultiBlockMachine { diamond.setAmount(value ? 2 : 1); emerald.setAmount(value ? 2 : 1); quartz.setAmount(value ? 2 : 1); + goldNuggets.setAmount(value ? 8 : 4); SlimefunItem ironDust = SlimefunItem.getByID("IRON_DUST"); if (ironDust != null) { @@ -146,6 +157,10 @@ public class OreCrusher extends MultiBlockMachine { return quartz; } + public ItemStack getGoldNuggets() { + return goldNuggets; + } + } } 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..ad89e95b4 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,20 +57,20 @@ 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) { for (int i = 0; i < 4; i++) { int j = i; - Bukkit.getScheduler().runTaskLater(SlimefunPlugin.instance, () -> { + Bukkit.getScheduler().runTaskLater(SlimefunPlugin.instance(), () -> { p.getWorld().playSound(b.getLocation(), Sound.ENTITY_TNT_PRIMED, 1, 1); p.getWorld().playEffect(b.getRelative(BlockFace.UP).getLocation(), Effect.SMOKE, 4); p.getWorld().playEffect(b.getRelative(BlockFace.UP).getLocation(), Effect.SMOKE, 4); 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 2800d93b0..ecf09dabd 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(); @@ -149,7 +149,7 @@ class ActiveMiner implements Runnable { queue.thenRun(2, () -> setPistonState(pistons[1], false)); queue.thenRun(1, this); - queue.execute(SlimefunPlugin.instance); + queue.execute(SlimefunPlugin.instance()); } @Override @@ -197,12 +197,12 @@ class ActiveMiner implements Runnable { nextColumn(); } catch (Exception e) { - Slimefun.getLogger().log(Level.SEVERE, e, () -> "An Error occured while running an Industrial Miner at " + new BlockPosition(chest)); + Slimefun.getLogger().log(Level.SEVERE, e, () -> "An Error occurred while running an Industrial Miner at " + new BlockPosition(chest)); stop(); } }); - queue.execute(SlimefunPlugin.instance); + queue.execute(SlimefunPlugin.instance()); } /** @@ -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; @@ -343,7 +343,7 @@ class ActiveMiner implements Runnable { } } catch (Exception e) { - Slimefun.getLogger().log(Level.SEVERE, e, () -> "An Error occured while moving a Piston for an Industrial Miner at " + new BlockPosition(block)); + Slimefun.getLogger().log(Level.SEVERE, e, () -> "An Error occurred while moving a Piston for an Industrial Miner at " + new BlockPosition(block)); stop(); } } 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/seasonal/ChristmasPresent.java b/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/items/seasonal/ChristmasPresent.java index b60a2528f..bf0ffe8c7 100644 --- a/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/items/seasonal/ChristmasPresent.java +++ b/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/items/seasonal/ChristmasPresent.java @@ -7,11 +7,11 @@ import org.bukkit.inventory.ItemStack; import io.github.thebusybiscuit.cscorelib2.inventory.ItemUtils; import io.github.thebusybiscuit.slimefun4.core.attributes.NotPlaceable; +import io.github.thebusybiscuit.slimefun4.core.handlers.BlockPlaceHandler; +import io.github.thebusybiscuit.slimefun4.implementation.items.SimpleSlimefunItem; import io.github.thebusybiscuit.slimefun4.utils.FireworkUtils; import me.mrCookieSlime.Slimefun.Lists.RecipeType; import me.mrCookieSlime.Slimefun.Objects.Category; -import me.mrCookieSlime.Slimefun.Objects.SlimefunItem.SimpleSlimefunItem; -import me.mrCookieSlime.Slimefun.Objects.handlers.BlockPlaceHandler; import me.mrCookieSlime.Slimefun.api.SlimefunItemStack; public class ChristmasPresent extends SimpleSlimefunItem implements NotPlaceable { @@ -26,7 +26,7 @@ public class ChristmasPresent extends SimpleSlimefunItem impl @Override public BlockPlaceHandler getItemHandler() { - return (e, item) -> { + return (p, e, item) -> { if (isItem(item)) { e.setCancelled(true); @@ -34,7 +34,7 @@ public class ChristmasPresent extends SimpleSlimefunItem impl ItemUtils.consumeItem(item, false); } - FireworkUtils.launchRandom(e.getPlayer(), 3); + FireworkUtils.launchRandom(p, 3); ItemStack gift = gifts[ThreadLocalRandom.current().nextInt(gifts.length)].clone(); e.getBlockPlaced().getWorld().dropItemNaturally(e.getBlockPlaced().getLocation(), gift); diff --git a/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/items/seasonal/EasterEgg.java b/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/items/seasonal/EasterEgg.java index 7eb03c61b..14660476a 100644 --- a/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/items/seasonal/EasterEgg.java +++ b/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/items/seasonal/EasterEgg.java @@ -7,12 +7,12 @@ import org.bukkit.entity.Player; import org.bukkit.inventory.ItemStack; import io.github.thebusybiscuit.cscorelib2.inventory.ItemUtils; +import io.github.thebusybiscuit.slimefun4.core.handlers.ItemUseHandler; +import io.github.thebusybiscuit.slimefun4.implementation.items.SimpleSlimefunItem; import io.github.thebusybiscuit.slimefun4.utils.FireworkUtils; 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.ItemUseHandler; import me.mrCookieSlime.Slimefun.api.SlimefunItemStack; /** diff --git a/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/items/tools/ExplosivePickaxe.java b/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/items/tools/ExplosivePickaxe.java index 27a01f047..3ccd13f4a 100644 --- a/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/items/tools/ExplosivePickaxe.java +++ b/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/items/tools/ExplosivePickaxe.java @@ -13,6 +13,7 @@ import me.mrCookieSlime.Slimefun.api.SlimefunItemStack; * @author TheBusyBiscuit * * @see ExplosiveShovel + * @see ExplosiveTool * */ public class ExplosivePickaxe extends ExplosiveTool { 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..8b83819a5 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 @@ -3,14 +3,13 @@ package io.github.thebusybiscuit.slimefun4.implementation.items.tools; import java.util.List; import org.bukkit.Effect; -import org.bukkit.Material; import org.bukkit.block.Block; import org.bukkit.entity.Player; 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; @@ -22,6 +21,7 @@ import me.mrCookieSlime.Slimefun.api.SlimefunItemStack; * @author Linox * * @see ExplosivePickaxe + * @see ExplosiveTool * */ public class ExplosiveShovel extends ExplosiveTool { @@ -36,14 +36,8 @@ public class ExplosiveShovel extends ExplosiveTool { SlimefunPlugin.getProtectionManager().logAction(p, b, ProtectableAction.BREAK_BLOCK); b.getWorld().playEffect(b.getLocation(), Effect.STEP_SOUND, b.getType()); + b.breakNaturally(item); - for (ItemStack drop : b.getDrops(getItem())) { - if (drop != null) { - b.getWorld().dropItemNaturally(b.getLocation(), drop); - } - } - - b.setType(Material.AIR); damageItem(p, item); } } 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..2ad1cb1b2 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,14 +19,14 @@ 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.core.handlers.BlockBreakHandler; +import io.github.thebusybiscuit.slimefun4.implementation.SlimefunPlugin; +import io.github.thebusybiscuit.slimefun4.implementation.items.SimpleSlimefunItem; import me.mrCookieSlime.Slimefun.Lists.RecipeType; import me.mrCookieSlime.Slimefun.Objects.Category; import me.mrCookieSlime.Slimefun.Objects.SlimefunBlockHandler; -import me.mrCookieSlime.Slimefun.Objects.SlimefunItem.SimpleSlimefunItem; import me.mrCookieSlime.Slimefun.Objects.SlimefunItem.SlimefunItem; import me.mrCookieSlime.Slimefun.Objects.SlimefunItem.UnregisterReason; -import me.mrCookieSlime.Slimefun.Objects.handlers.BlockBreakHandler; import me.mrCookieSlime.Slimefun.api.BlockStorage; import me.mrCookieSlime.Slimefun.api.Slimefun; import me.mrCookieSlime.Slimefun.api.SlimefunItemStack; @@ -38,6 +38,7 @@ class ExplosiveTool extends SimpleSlimefunItem implements Not public ExplosiveTool(Category category, SlimefunItemStack item, RecipeType recipeType, ItemStack[] recipe) { super(category, item, recipeType, recipe); + addItemSetting(damageOnUse, callExplosionEvent); } @@ -53,25 +54,16 @@ class ExplosiveTool extends SimpleSlimefunItem implements Not @Override public boolean onBlockBreak(BlockBreakEvent e, ItemStack item, int fortune, List drops) { if (isItem(item)) { - if (Slimefun.hasUnlocked(e.getPlayer(), ExplosiveTool.this, true)) { - e.getBlock().getWorld().createExplosion(e.getBlock().getLocation(), 0.0F); - e.getBlock().getWorld().playSound(e.getBlock().getLocation(), Sound.ENTITY_GENERIC_EXPLODE, 0.2F, 1F); + Player p = e.getPlayer(); - List blocks = findBlocks(e.getBlock()); + if (Slimefun.hasUnlocked(p, ExplosiveTool.this, true)) { + Block b = e.getBlock(); - if (callExplosionEvent.getValue().booleanValue()) { - BlockExplodeEvent blockExplodeEvent = new BlockExplodeEvent(e.getBlock(), blocks, 0); - Bukkit.getServer().getPluginManager().callEvent(blockExplodeEvent); + b.getWorld().createExplosion(b.getLocation(), 0.0F); + b.getWorld().playSound(b.getLocation(), Sound.ENTITY_GENERIC_EXPLODE, 0.2F, 1F); - if (!blockExplodeEvent.isCancelled()) { - blockExplodeEvent.blockList().forEach(b -> breakBlock(e.getPlayer(), item, b, fortune, drops)); - } - } - else { - for (Block b : blocks) { - breakBlock(e.getPlayer(), item, b, fortune, drops); - } - } + List blocks = findBlocks(b); + breakBlocks(p, item, b, blocks, fortune, drops); } return true; @@ -83,6 +75,24 @@ class ExplosiveTool extends SimpleSlimefunItem implements Not }; } + private void breakBlocks(Player p, ItemStack item, Block b, List blocks, int fortune, List drops) { + if (callExplosionEvent.getValue().booleanValue()) { + BlockExplodeEvent blockExplodeEvent = new BlockExplodeEvent(b, blocks, 0); + Bukkit.getServer().getPluginManager().callEvent(blockExplodeEvent); + + if (!blockExplodeEvent.isCancelled()) { + for (Block block : blockExplodeEvent.blockList()) { + breakBlock(p, item, block, fortune, drops); + } + } + } + else { + for (Block block : blocks) { + breakBlock(p, item, block, fortune, drops); + } + } + } + private List findBlocks(Block b) { List blocks = new ArrayList<>(26); @@ -108,7 +118,7 @@ class ExplosiveTool extends SimpleSlimefunItem implements Not } protected void breakBlock(Player p, ItemStack item, Block b, int fortune, List drops) { - if (b.getType() != Material.AIR && !b.isLiquid() && !MaterialCollections.getAllUnbreakableBlocks().contains(b.getType()) && SlimefunPlugin.getProtectionManager().hasPermission(p, b.getLocation(), ProtectableAction.BREAK_BLOCK)) { + if (!b.isEmpty() && !b.isLiquid() && !MaterialCollections.getAllUnbreakableBlocks().contains(b.getType()) && SlimefunPlugin.getProtectionManager().hasPermission(p, b.getLocation(), ProtectableAction.BREAK_BLOCK)) { SlimefunPlugin.getProtectionManager().logAction(p, b, ProtectableAction.BREAK_BLOCK); b.getWorld().playEffect(b.getLocation(), Effect.STEP_SOUND, b.getType()); 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..2e7c09c60 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 @@ -15,15 +15,15 @@ import io.github.thebusybiscuit.cscorelib2.collections.RandomizedSet; 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.core.handlers.ItemUseHandler; import io.github.thebusybiscuit.slimefun4.implementation.SlimefunItems; +import io.github.thebusybiscuit.slimefun4.implementation.SlimefunPlugin; +import io.github.thebusybiscuit.slimefun4.implementation.items.SimpleSlimefunItem; 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; import me.mrCookieSlime.Slimefun.Objects.SlimefunItem.SlimefunItem; -import me.mrCookieSlime.Slimefun.Objects.handlers.ItemUseHandler; import me.mrCookieSlime.Slimefun.api.SlimefunItemStack; /** 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..8d0c68682 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,11 +13,11 @@ 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.core.handlers.ItemUseHandler; +import io.github.thebusybiscuit.slimefun4.implementation.SlimefunPlugin; +import io.github.thebusybiscuit.slimefun4.implementation.items.SimpleSlimefunItem; import me.mrCookieSlime.Slimefun.Lists.RecipeType; import me.mrCookieSlime.Slimefun.Objects.Category; -import me.mrCookieSlime.Slimefun.Objects.SlimefunItem.SimpleSlimefunItem; -import me.mrCookieSlime.Slimefun.Objects.handlers.ItemUseHandler; import me.mrCookieSlime.Slimefun.api.SlimefunItemStack; public class GrapplingHook extends SimpleSlimefunItem { @@ -55,14 +55,15 @@ public class GrapplingHook extends SimpleSlimefunItem { arrow.setShooter(p); arrow.setVelocity(direction); - Bat b = (Bat) p.getWorld().spawnEntity(p.getLocation(), EntityType.BAT); - b.setCanPickupItems(false); - b.setAI(false); - b.addPotionEffect(new PotionEffect(PotionEffectType.INVISIBILITY, 100000, 100000)); - b.setLeashHolder(arrow); + Bat bat = (Bat) p.getWorld().spawnEntity(p.getLocation(), EntityType.BAT); + bat.setCanPickupItems(false); + bat.setAI(false); + bat.setSilent(true); + bat.addPotionEffect(new PotionEffect(PotionEffectType.INVISIBILITY, 100000, 100000)); + bat.setLeashHolder(arrow); boolean state = item.getType() != Material.SHEARS; - SlimefunPlugin.getGrapplingHookListener().addGrapplingHook(uuid, arrow, b, state, despawnTicks.getValue() * 20L); + SlimefunPlugin.getGrapplingHookListener().addGrapplingHook(p, arrow, bat, state, despawnTicks.getValue()); } }; } diff --git a/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/items/tools/HerculesPickaxe.java b/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/items/tools/HerculesPickaxe.java index 82eeafce8..ddcee83ca 100644 --- a/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/items/tools/HerculesPickaxe.java +++ b/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/items/tools/HerculesPickaxe.java @@ -7,11 +7,11 @@ import org.bukkit.event.block.BlockBreakEvent; import org.bukkit.inventory.ItemStack; import io.github.thebusybiscuit.cscorelib2.item.CustomItem; +import io.github.thebusybiscuit.slimefun4.core.handlers.BlockBreakHandler; import io.github.thebusybiscuit.slimefun4.implementation.SlimefunItems; +import io.github.thebusybiscuit.slimefun4.implementation.items.SimpleSlimefunItem; import me.mrCookieSlime.Slimefun.Lists.RecipeType; import me.mrCookieSlime.Slimefun.Objects.Category; -import me.mrCookieSlime.Slimefun.Objects.SlimefunItem.SimpleSlimefunItem; -import me.mrCookieSlime.Slimefun.Objects.handlers.BlockBreakHandler; import me.mrCookieSlime.Slimefun.api.Slimefun; import me.mrCookieSlime.Slimefun.api.SlimefunItemStack; 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..77610b2a1 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,12 +16,12 @@ 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.core.handlers.BlockBreakHandler; +import io.github.thebusybiscuit.slimefun4.core.handlers.ItemUseHandler; +import io.github.thebusybiscuit.slimefun4.implementation.SlimefunPlugin; +import io.github.thebusybiscuit.slimefun4.implementation.items.SimpleSlimefunItem; import me.mrCookieSlime.Slimefun.Lists.RecipeType; import me.mrCookieSlime.Slimefun.Objects.Category; -import me.mrCookieSlime.Slimefun.Objects.SlimefunItem.SimpleSlimefunItem; -import me.mrCookieSlime.Slimefun.Objects.handlers.BlockBreakHandler; -import me.mrCookieSlime.Slimefun.Objects.handlers.ItemUseHandler; import me.mrCookieSlime.Slimefun.api.Slimefun; import me.mrCookieSlime.Slimefun.api.SlimefunItemStack; diff --git a/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/items/tools/PickaxeOfContainment.java b/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/items/tools/PickaxeOfContainment.java index 304a3577f..c43194abf 100644 --- a/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/items/tools/PickaxeOfContainment.java +++ b/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/items/tools/PickaxeOfContainment.java @@ -9,14 +9,14 @@ import org.bukkit.event.block.BlockBreakEvent; import org.bukkit.inventory.ItemStack; import org.bukkit.inventory.meta.ItemMeta; +import io.github.thebusybiscuit.slimefun4.core.handlers.BlockBreakHandler; import io.github.thebusybiscuit.slimefun4.implementation.SlimefunItems; +import io.github.thebusybiscuit.slimefun4.implementation.items.SimpleSlimefunItem; import io.github.thebusybiscuit.slimefun4.implementation.items.blocks.BrokenSpawner; import io.github.thebusybiscuit.slimefun4.implementation.items.blocks.RepairedSpawner; import io.github.thebusybiscuit.slimefun4.utils.ChatUtils; import me.mrCookieSlime.Slimefun.Lists.RecipeType; import me.mrCookieSlime.Slimefun.Objects.Category; -import me.mrCookieSlime.Slimefun.Objects.SlimefunItem.SimpleSlimefunItem; -import me.mrCookieSlime.Slimefun.Objects.handlers.BlockBreakHandler; import me.mrCookieSlime.Slimefun.api.BlockStorage; import me.mrCookieSlime.Slimefun.api.Slimefun; import me.mrCookieSlime.Slimefun.api.SlimefunItemStack; 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..82ae021d1 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,11 +8,11 @@ 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.core.handlers.ItemUseHandler; +import io.github.thebusybiscuit.slimefun4.implementation.SlimefunPlugin; +import io.github.thebusybiscuit.slimefun4.implementation.items.SimpleSlimefunItem; import me.mrCookieSlime.Slimefun.Lists.RecipeType; import me.mrCookieSlime.Slimefun.Objects.Category; -import me.mrCookieSlime.Slimefun.Objects.SlimefunItem.SimpleSlimefunItem; -import me.mrCookieSlime.Slimefun.Objects.handlers.ItemUseHandler; import me.mrCookieSlime.Slimefun.api.SlimefunItemStack; public class PickaxeOfTheSeeker extends SimpleSlimefunItem implements DamageableItem { @@ -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..e2ed14c78 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,11 +15,11 @@ 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.core.handlers.BlockBreakHandler; +import io.github.thebusybiscuit.slimefun4.implementation.SlimefunPlugin; +import io.github.thebusybiscuit.slimefun4.implementation.items.SimpleSlimefunItem; import me.mrCookieSlime.Slimefun.Lists.RecipeType; import me.mrCookieSlime.Slimefun.Objects.Category; -import me.mrCookieSlime.Slimefun.Objects.SlimefunItem.SimpleSlimefunItem; -import me.mrCookieSlime.Slimefun.Objects.handlers.BlockBreakHandler; import me.mrCookieSlime.Slimefun.api.Slimefun; import me.mrCookieSlime.Slimefun.api.SlimefunItemStack; diff --git a/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/items/tools/PortableCrafter.java b/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/items/tools/PortableCrafter.java index 47cab337c..4a9d02af4 100644 --- a/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/items/tools/PortableCrafter.java +++ b/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/items/tools/PortableCrafter.java @@ -5,10 +5,10 @@ import org.bukkit.entity.Player; import org.bukkit.inventory.ItemStack; import io.github.thebusybiscuit.slimefun4.core.attributes.NotPlaceable; +import io.github.thebusybiscuit.slimefun4.core.handlers.ItemUseHandler; +import io.github.thebusybiscuit.slimefun4.implementation.items.SimpleSlimefunItem; import me.mrCookieSlime.Slimefun.Lists.RecipeType; import me.mrCookieSlime.Slimefun.Objects.Category; -import me.mrCookieSlime.Slimefun.Objects.SlimefunItem.SimpleSlimefunItem; -import me.mrCookieSlime.Slimefun.Objects.handlers.ItemUseHandler; import me.mrCookieSlime.Slimefun.api.SlimefunItemStack; public class PortableCrafter extends SimpleSlimefunItem implements NotPlaceable { diff --git a/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/items/tools/PortableDustbin.java b/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/items/tools/PortableDustbin.java index 79c735443..9d785b3bf 100644 --- a/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/items/tools/PortableDustbin.java +++ b/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/items/tools/PortableDustbin.java @@ -7,10 +7,10 @@ import org.bukkit.entity.Player; import org.bukkit.inventory.ItemStack; import io.github.thebusybiscuit.slimefun4.core.attributes.NotPlaceable; +import io.github.thebusybiscuit.slimefun4.core.handlers.ItemUseHandler; +import io.github.thebusybiscuit.slimefun4.implementation.items.SimpleSlimefunItem; import me.mrCookieSlime.Slimefun.Lists.RecipeType; import me.mrCookieSlime.Slimefun.Objects.Category; -import me.mrCookieSlime.Slimefun.Objects.SlimefunItem.SimpleSlimefunItem; -import me.mrCookieSlime.Slimefun.Objects.handlers.ItemUseHandler; import me.mrCookieSlime.Slimefun.api.SlimefunItemStack; public class PortableDustbin extends SimpleSlimefunItem implements NotPlaceable { 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..bbd13af58 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,11 +12,11 @@ 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.core.handlers.BlockBreakHandler; +import io.github.thebusybiscuit.slimefun4.implementation.SlimefunPlugin; +import io.github.thebusybiscuit.slimefun4.implementation.items.SimpleSlimefunItem; import me.mrCookieSlime.Slimefun.Lists.RecipeType; import me.mrCookieSlime.Slimefun.Objects.Category; -import me.mrCookieSlime.Slimefun.Objects.SlimefunItem.SimpleSlimefunItem; -import me.mrCookieSlime.Slimefun.Objects.handlers.BlockBreakHandler; import me.mrCookieSlime.Slimefun.api.BlockStorage; import me.mrCookieSlime.Slimefun.api.Slimefun; import me.mrCookieSlime.Slimefun.api.SlimefunItemStack; @@ -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/tools/TapeMeasure.java b/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/items/tools/TapeMeasure.java new file mode 100644 index 000000000..919ddd8c1 --- /dev/null +++ b/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/items/tools/TapeMeasure.java @@ -0,0 +1,115 @@ +package io.github.thebusybiscuit.slimefun4.implementation.items.tools; + +import java.text.DecimalFormat; +import java.util.Optional; +import java.util.UUID; + +import org.bukkit.Location; +import org.bukkit.NamespacedKey; +import org.bukkit.block.Block; +import org.bukkit.entity.Player; +import org.bukkit.inventory.ItemStack; +import org.bukkit.inventory.meta.ItemMeta; +import org.bukkit.persistence.PersistentDataType; + +import com.google.gson.JsonObject; +import com.google.gson.JsonParser; + +import io.github.thebusybiscuit.slimefun4.core.attributes.NotPlaceable; +import io.github.thebusybiscuit.slimefun4.core.handlers.ItemUseHandler; +import io.github.thebusybiscuit.slimefun4.implementation.SlimefunPlugin; +import io.github.thebusybiscuit.slimefun4.implementation.items.SimpleSlimefunItem; +import me.mrCookieSlime.Slimefun.Lists.RecipeType; +import me.mrCookieSlime.Slimefun.Objects.Category; +import me.mrCookieSlime.Slimefun.api.SlimefunItemStack; + +/** + * The {@link TapeMeasure} is used to measure the distance between two {@link Block Blocks}. + * + * @author TheBusyBiscuit + * + */ +public class TapeMeasure extends SimpleSlimefunItem implements NotPlaceable { + + private final NamespacedKey key = new NamespacedKey(SlimefunPlugin.instance(), "anchor"); + private final DecimalFormat format = new DecimalFormat("##.###"); + + public TapeMeasure(Category category, SlimefunItemStack item, RecipeType recipeType, ItemStack[] recipe) { + super(category, item, recipeType, recipe); + } + + @Override + public ItemUseHandler getItemHandler() { + return e -> { + e.cancel(); + + if (e.getClickedBlock().isPresent()) { + Block block = e.getClickedBlock().get(); + + if (e.getPlayer().isSneaking()) { + setAnchor(e.getPlayer(), e.getItem(), block); + } + else { + measure(e.getPlayer(), e.getItem(), block); + } + } + }; + } + + private void setAnchor(Player p, ItemStack item, Block block) { + ItemMeta meta = item.getItemMeta(); + + JsonObject json = new JsonObject(); + json.addProperty("world", block.getWorld().getUID().toString()); + json.addProperty("x", block.getX()); + json.addProperty("y", block.getY()); + json.addProperty("z", block.getZ()); + + meta.getPersistentDataContainer().set(key, PersistentDataType.STRING, json.toString()); + + String anchor = block.getX() + " | " + block.getY() + " | " + block.getZ(); + SlimefunPlugin.getLocalization().sendMessage(p, "messages.tape-measure.anchor-set", msg -> msg.replace("%anchor%", anchor)); + + item.setItemMeta(meta); + + } + + private Optional getAnchor(Player p, ItemStack item) { + ItemMeta meta = item.getItemMeta(); + + String data = meta.getPersistentDataContainer().get(key, PersistentDataType.STRING); + + if (data != null) { + JsonObject json = new JsonParser().parse(data).getAsJsonObject(); + + UUID uuid = UUID.fromString(json.get("world").getAsString()); + + if (p.getWorld().getUID().equals(uuid)) { + int x = json.get("x").getAsInt(); + int y = json.get("y").getAsInt(); + int z = json.get("z").getAsInt(); + Location loc = new Location(p.getWorld(), x, y, z); + return Optional.of(loc); + } + else { + SlimefunPlugin.getLocalization().sendMessage(p, "messages.tape-measure.wrong-world"); + return Optional.empty(); + } + } + else { + SlimefunPlugin.getLocalization().sendMessage(p, "messages.tape-measure.no-anchor"); + return Optional.empty(); + } + } + + private void measure(Player p, ItemStack item, Block block) { + Optional anchor = getAnchor(p, item); + + if (anchor.isPresent()) { + Location loc = anchor.get(); + double distance = loc.distance(block.getLocation()); + SlimefunPlugin.getLocalization().sendMessage(p, "messages.tape-measure.distance", msg -> msg.replace("%distance%", format.format(distance))); + } + } + +} diff --git a/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/items/weapons/ExplosiveBow.java b/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/items/weapons/ExplosiveBow.java index 0f6499246..0a4e82b1c 100644 --- a/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/items/weapons/ExplosiveBow.java +++ b/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/items/weapons/ExplosiveBow.java @@ -1,28 +1,90 @@ package io.github.thebusybiscuit.slimefun4.implementation.items.weapons; +import org.bukkit.Bukkit; +import org.bukkit.Particle; import org.bukkit.Sound; +import org.bukkit.entity.Entity; +import org.bukkit.entity.LivingEntity; +import org.bukkit.event.entity.EntityDamageByEntityEvent; +import org.bukkit.event.entity.EntityDamageEvent; import org.bukkit.inventory.ItemStack; import org.bukkit.util.Vector; +import io.github.thebusybiscuit.slimefun4.api.items.ItemSetting; +import io.github.thebusybiscuit.slimefun4.core.handlers.BowShootHandler; import me.mrCookieSlime.Slimefun.Objects.Category; -import me.mrCookieSlime.Slimefun.Objects.handlers.BowShootHandler; import me.mrCookieSlime.Slimefun.api.SlimefunItemStack; +import java.util.Collection; + +/** + * The {@link ExplosiveBow} is a {@link SlimefunBow} which creates a fake explosion when it hits + * a {@link LivingEntity}. Any nearby {@link LivingEntity LivingEntities} get pushed away and + * take a little bit of damage, similar to an "Area of Effect" damage. + * + * @author TheBusyBiscuit + * @author Linox + * + * @see SlimefunBow + * + */ public class ExplosiveBow extends SlimefunBow { + private final ItemSetting range = new ItemSetting("explosion-range", 3) { + + @Override + public boolean validateInput(Integer input) { + return super.validateInput(input) && input > 0; + } + + }; + public ExplosiveBow(Category category, SlimefunItemStack item, ItemStack[] recipe) { super(category, item, recipe); + + addItemSetting(range); } @Override public BowShootHandler onShoot() { - return (e, n) -> { - Vector vector = n.getVelocity(); - vector.setY(0.6); - n.setVelocity(vector); - n.getWorld().createExplosion(n.getLocation(), 0F); - n.getWorld().playSound(n.getLocation(), Sound.ENTITY_GENERIC_EXPLODE, 1F, 1F); + return (e, target) -> { + target.getWorld().spawnParticle(Particle.EXPLOSION_LARGE, target.getLocation(), 1); + target.getWorld().playSound(target.getLocation(), Sound.ENTITY_GENERIC_EXPLODE, 1, 1); + + Collection entites = target.getWorld().getNearbyEntities(target.getLocation(), range.getValue(), range.getValue(), range.getValue(), entity -> entity instanceof LivingEntity && entity.isValid()); + for (Entity nearby : entites) { + LivingEntity entity = (LivingEntity) nearby; + + Vector distanceVector = entity.getLocation().toVector().subtract(target.getLocation().toVector()); + distanceVector.setY(distanceVector.getY() + 0.6); + + Vector velocity = entity.getVelocity(); + + double distanceSquared = distanceVector.lengthSquared(); + double damage = calculateDamage(distanceSquared, e.getDamage()); + + Vector knockback = velocity.add(distanceVector.normalize().multiply((int) (e.getDamage() / damage))); + entity.setVelocity(knockback); + + if (!entity.getUniqueId().equals(target.getUniqueId())) { + EntityDamageByEntityEvent event = new EntityDamageByEntityEvent(e.getDamager(), entity, EntityDamageEvent.DamageCause.ENTITY_EXPLOSION, damage); + Bukkit.getPluginManager().callEvent(event); + + if (!event.isCancelled()) { + entity.damage(event.getDamage()); + } + } + } }; } + private double calculateDamage(double distanceSquared, double originalDamage) { + if (distanceSquared <= 0.05) { + return originalDamage; + } + + double damage = originalDamage * (1 - (distanceSquared / (range.getValue() * range.getValue()))); + return Math.min(Math.max(1, damage), originalDamage); + } + } diff --git a/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/items/weapons/IcyBow.java b/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/items/weapons/IcyBow.java index 944903b18..f0bc3e8c6 100644 --- a/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/items/weapons/IcyBow.java +++ b/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/items/weapons/IcyBow.java @@ -6,8 +6,8 @@ import org.bukkit.inventory.ItemStack; import org.bukkit.potion.PotionEffect; import org.bukkit.potion.PotionEffectType; +import io.github.thebusybiscuit.slimefun4.core.handlers.BowShootHandler; import me.mrCookieSlime.Slimefun.Objects.Category; -import me.mrCookieSlime.Slimefun.Objects.handlers.BowShootHandler; import me.mrCookieSlime.Slimefun.api.SlimefunItemStack; public class IcyBow extends SlimefunBow { 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..3f8bd137a 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,11 +21,11 @@ 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.core.handlers.ItemUseHandler; +import io.github.thebusybiscuit.slimefun4.implementation.SlimefunPlugin; +import io.github.thebusybiscuit.slimefun4.implementation.items.SimpleSlimefunItem; import me.mrCookieSlime.Slimefun.Lists.RecipeType; import me.mrCookieSlime.Slimefun.Objects.Category; -import me.mrCookieSlime.Slimefun.Objects.SlimefunItem.SimpleSlimefunItem; -import me.mrCookieSlime.Slimefun.Objects.handlers.ItemUseHandler; import me.mrCookieSlime.Slimefun.api.SlimefunItemStack; /** @@ -63,7 +63,7 @@ public class SeismicAxe extends SimpleSlimefunItem implements No FallingBlock block = ground.getWorld().spawnFallingBlock(loc, ground.getBlockData()); block.setDropItem(false); block.setVelocity(new Vector(0, 0.4 + i * 0.01, 0)); - block.setMetadata("seismic_axe", new FixedMetadataValue(SlimefunPlugin.instance, "fake_block")); + block.setMetadata("seismic_axe", new FixedMetadataValue(SlimefunPlugin.instance(), "fake_block")); } for (Entity n : ground.getChunk().getEntities()) { diff --git a/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/items/weapons/SlimefunBow.java b/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/items/weapons/SlimefunBow.java index 376b8a343..00573ab8d 100644 --- a/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/items/weapons/SlimefunBow.java +++ b/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/items/weapons/SlimefunBow.java @@ -3,10 +3,10 @@ package io.github.thebusybiscuit.slimefun4.implementation.items.weapons; import org.bukkit.entity.Arrow; import org.bukkit.inventory.ItemStack; +import io.github.thebusybiscuit.slimefun4.core.handlers.BowShootHandler; import me.mrCookieSlime.Slimefun.Lists.RecipeType; import me.mrCookieSlime.Slimefun.Objects.Category; import me.mrCookieSlime.Slimefun.Objects.SlimefunItem.SlimefunItem; -import me.mrCookieSlime.Slimefun.Objects.handlers.BowShootHandler; import me.mrCookieSlime.Slimefun.api.SlimefunItemStack; /** diff --git a/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/items/weapons/SwordOfBeheading.java b/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/items/weapons/SwordOfBeheading.java index 51e018ae9..cd4affd3e 100644 --- a/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/items/weapons/SwordOfBeheading.java +++ b/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/items/weapons/SwordOfBeheading.java @@ -14,10 +14,10 @@ import org.bukkit.inventory.meta.ItemMeta; import org.bukkit.inventory.meta.SkullMeta; import io.github.thebusybiscuit.slimefun4.api.items.ItemSetting; +import io.github.thebusybiscuit.slimefun4.core.handlers.EntityKillHandler; +import io.github.thebusybiscuit.slimefun4.implementation.items.SimpleSlimefunItem; import me.mrCookieSlime.Slimefun.Lists.RecipeType; import me.mrCookieSlime.Slimefun.Objects.Category; -import me.mrCookieSlime.Slimefun.Objects.SlimefunItem.SimpleSlimefunItem; -import me.mrCookieSlime.Slimefun.Objects.handlers.EntityKillHandler; import me.mrCookieSlime.Slimefun.api.SlimefunItemStack; public class SwordOfBeheading extends 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/BeeListener.java b/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/listeners/BeeListener.java new file mode 100644 index 000000000..e45936f88 --- /dev/null +++ b/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/listeners/BeeListener.java @@ -0,0 +1,53 @@ +package io.github.thebusybiscuit.slimefun4.implementation.listeners; + +import java.util.Optional; + +import org.bukkit.entity.Bee; +import org.bukkit.entity.Player; +import org.bukkit.event.EventHandler; +import org.bukkit.event.Listener; +import org.bukkit.event.entity.EntityDamageByEntityEvent; +import org.bukkit.inventory.ItemStack; + +import io.github.thebusybiscuit.cscorelib2.inventory.ItemUtils; +import io.github.thebusybiscuit.slimefun4.api.player.PlayerProfile; +import io.github.thebusybiscuit.slimefun4.core.attributes.ProtectionType; +import io.github.thebusybiscuit.slimefun4.implementation.SlimefunPlugin; + +/** + * The {@link Listener} for Hazmat Suit's {@link Bee} sting protection. + * Only applied if the whole set is worn. + * + * @author Linox + * + */ +public class BeeListener implements Listener { + + public BeeListener(SlimefunPlugin plugin) { + plugin.getServer().getPluginManager().registerEvents(this, plugin); + } + + @EventHandler + public void onDamage(EntityDamageByEntityEvent e) { + if (e.getDamager() instanceof Bee && e.getEntity() instanceof Player) { + Player p = (Player) e.getEntity(); + Optional optional = PlayerProfile.find(p); + + if (!optional.isPresent()) { + PlayerProfile.request(p); + return; + } + + PlayerProfile profile = optional.get(); + + if (profile.hasFullProtectionAgainst(ProtectionType.BEES)) { + for (ItemStack armor : p.getInventory().getArmorContents()) { + ItemUtils.damageItem(armor, 1, false); + } + + e.setDamage(0D); + } + } + } + +} 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..d7d69e17b 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,12 +22,12 @@ 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.core.handlers.BlockBreakHandler; +import io.github.thebusybiscuit.slimefun4.core.handlers.BlockPlaceHandler; +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; -import me.mrCookieSlime.Slimefun.Objects.handlers.BlockBreakHandler; -import me.mrCookieSlime.Slimefun.Objects.handlers.BlockPlaceHandler; import me.mrCookieSlime.Slimefun.Objects.handlers.ItemHandler; import me.mrCookieSlime.Slimefun.api.BlockStorage; import me.mrCookieSlime.Slimefun.api.Slimefun; @@ -74,14 +74,7 @@ public class BlockListener implements Listener { blockHandler.onPlace(e.getPlayer(), e.getBlock(), sfItem); } else { - sfItem.callItemHandler(BlockPlaceHandler.class, handler -> handler.onBlockPlace(e, item)); - } - } - } - else { - for (ItemHandler handler : SlimefunItem.getPublicItemHandlers(BlockPlaceHandler.class)) { - if (((BlockPlaceHandler) handler).onBlockPlace(e, item)) { - break; + sfItem.callItemHandler(BlockPlaceHandler.class, handler -> handler.onBlockPlace(e.getPlayer(), e, item)); } } } 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..51a0018ec 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; /** @@ -89,6 +89,7 @@ public class BlockPhysicsListener implements Listener { public void onBucketUse(PlayerBucketEmptyEvent e) { // Fix for placing water on player heads Location l = e.getBlockClicked().getRelative(e.getBlockFace()).getLocation(); + if (BlockStorage.hasBlockInfo(l)) { e.setCancelled(true); } 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..78dda0ec3 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; /** @@ -61,7 +61,7 @@ public class ButcherAndroidListener implements Listener { }, 1L); // Removing metadata to prevent memory leaks - e.getEntity().removeMetadata(METADATA_KEY, SlimefunPlugin.instance); + e.getEntity().removeMetadata(METADATA_KEY, SlimefunPlugin.instance()); } } 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..ae00e218a 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,10 @@ 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; +import me.mrCookieSlime.Slimefun.Objects.SlimefunItem.SlimefunItem; /** * This {@link Listener} is solely responsible for preventing Cargo Nodes from being placed @@ -25,15 +26,29 @@ 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); + if (e.getBlock().getY() != e.getBlockAgainst().getY() && isCargoNode(e.getItemInHand())) { + SlimefunPlugin.getLocalization().sendMessage(e.getPlayer(), "machines.CARGO_NODES.must-be-placed", true); e.setCancelled(true); } } private boolean isCargoNode(ItemStack item) { - return SlimefunUtils.isItemSimilar(item, SlimefunItems.CARGO_INPUT_NODE, false) - || SlimefunUtils.isItemSimilar(item, SlimefunItems.CARGO_OUTPUT_NODE, false) - || SlimefunUtils.isItemSimilar(item, SlimefunItems.CARGO_OUTPUT_NODE_2, false); + if (SlimefunPlugin.getRegistry().isBackwardsCompatible()) { + ItemStackWrapper wrapper = new ItemStackWrapper(item); + + return SlimefunUtils.isItemSimilar(wrapper, SlimefunItems.CARGO_INPUT_NODE, false) + || SlimefunUtils.isItemSimilar(wrapper, SlimefunItems.CARGO_OUTPUT_NODE, false) + || SlimefunUtils.isItemSimilar(wrapper, SlimefunItems.CARGO_OUTPUT_NODE_2, false); + } + + SlimefunItem sfItem = SlimefunItem.getByItem(item); + + if (sfItem == null) { + return false; + } + + return sfItem.getID().equals(SlimefunItems.CARGO_INPUT_NODE.getItemId()) + || sfItem.getID().equals(SlimefunItems.CARGO_OUTPUT_NODE.getItemId()) + || sfItem.getID().equals(SlimefunItems.CARGO_OUTPUT_NODE_2.getItemId()); } } 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..1a3a886e9 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 @@ -1,6 +1,5 @@ package io.github.thebusybiscuit.slimefun4.implementation.listeners; -import org.bukkit.ChatColor; import org.bukkit.Material; import org.bukkit.block.Block; import org.bukkit.block.Skull; @@ -15,27 +14,26 @@ import org.bukkit.inventory.EquipmentSlot; import io.github.thebusybiscuit.cscorelib2.chat.ChatColors; import io.github.thebusybiscuit.cscorelib2.skull.SkullBlock; +import io.github.thebusybiscuit.slimefun4.core.attributes.EnergyNetComponent; import io.github.thebusybiscuit.slimefun4.core.networks.energy.EnergyNet; import io.github.thebusybiscuit.slimefun4.implementation.SlimefunItems; -import io.github.thebusybiscuit.slimefun4.implementation.tasks.TickerTask; +import io.github.thebusybiscuit.slimefun4.implementation.SlimefunPlugin; 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; public class DebugFishListener implements Listener { - private final String enabledTooltip; - private final String disabledTooltip; + private final String greenCheckmark; + private final String redCross; public DebugFishListener(SlimefunPlugin plugin) { plugin.getServer().getPluginManager().registerEvents(this, plugin); - enabledTooltip = "&2\u2714"; - disabledTooltip = "&4\u2718"; + greenCheckmark = "&2\u2714"; + redCross = "&4\u2718"; } @EventHandler @@ -81,7 +79,7 @@ public class DebugFishListener implements Listener { p.sendMessage(ChatColors.color("&dPlugin: " + "&e" + item.getAddon().getName())); if (b.getState() instanceof Skull) { - p.sendMessage(ChatColors.color("&dSkull: " + enabledTooltip)); + p.sendMessage(ChatColors.color("&dSkull: " + greenCheckmark)); // Check if the skull is a wall skull, and if so use Directional instead of Rotatable. if (b.getType() == Material.PLAYER_WALL_HEAD) { @@ -93,40 +91,40 @@ public class DebugFishListener implements Listener { } if (BlockStorage.getStorage(b.getWorld()).hasInventory(b.getLocation())) { - p.sendMessage(ChatColors.color("&dInventory: " + enabledTooltip)); + p.sendMessage(ChatColors.color("&dInventory: " + greenCheckmark)); } else { - p.sendMessage(ChatColors.color("&dInventory: " + disabledTooltip)); + p.sendMessage(ChatColors.color("&dInventory: " + redCross)); } - TickerTask ticker = SlimefunPlugin.getTicker(); - if (item.isTicking()) { - p.sendMessage(ChatColors.color("&dTicker: " + enabledTooltip)); - p.sendMessage(ChatColors.color(" &dAsync: &e" + (BlockStorage.check(b).getBlockTicker().isSynchronized() ? disabledTooltip : enabledTooltip))); - p.sendMessage(ChatColors.color(" &dTimings: &e" + NumberUtils.getAsMillis(ticker.getTimings(b)))); - p.sendMessage(ChatColors.color(" &dTotal Timings: &e" + NumberUtils.getAsMillis(ticker.getTimings(BlockStorage.checkID(b))))); - p.sendMessage(ChatColors.color(" &dChunk Timings: &e" + NumberUtils.getAsMillis(ticker.getTimings(b.getChunk())))); + p.sendMessage(ChatColors.color("&dTicking: " + greenCheckmark)); + p.sendMessage(ChatColors.color(" &dAsync: &e" + (item.getBlockTicker().isSynchronized() ? redCross : greenCheckmark))); } else if (item.getEnergyTicker() != null) { - p.sendMessage(ChatColors.color("&dTicking: " + "&3Indirect")); - p.sendMessage(ChatColors.color(" &dTimings: &e" + NumberUtils.getAsMillis(ticker.getTimings(b)))); - p.sendMessage(ChatColors.color(" &dChunk Timings: &e" + NumberUtils.getAsMillis(ticker.getTimings(b.getChunk())))); + p.sendMessage(ChatColors.color("&dTicking: &3Indirect")); } else { - p.sendMessage(ChatColors.color("&dTicker: " + disabledTooltip)); - p.sendMessage(ChatColor.translateAlternateColorCodes('&', "&dTicking: " + disabledTooltip)); + p.sendMessage(ChatColors.color("&dTicking: " + redCross)); + } + + if (SlimefunPlugin.getProfiler().hasTimings(b)) { + p.sendMessage(ChatColors.color(" &dTimings: &e" + SlimefunPlugin.getProfiler().getTime(b))); + p.sendMessage(ChatColors.color(" &dTotal Timings: &e" + SlimefunPlugin.getProfiler().getTime(item))); + p.sendMessage(ChatColors.color(" &dChunk Timings: &e" + SlimefunPlugin.getProfiler().getTime(b.getChunk()))); } if (ChargableBlock.isChargable(b)) { - p.sendMessage(ChatColors.color("&dChargeable: " + enabledTooltip)); + p.sendMessage(ChatColors.color("&dChargeable: " + greenCheckmark)); p.sendMessage(ChatColors.color(" &dEnergy: &e" + ChargableBlock.getCharge(b) + " / " + ChargableBlock.getMaxCharge(b))); } else { - p.sendMessage(ChatColors.color("&dChargeable: " + disabledTooltip)); + p.sendMessage(ChatColors.color("&dChargeable: " + redCross)); } - p.sendMessage(ChatColors.color(" &dEnergyNet Type: &e" + EnergyNet.getComponent(b.getLocation()))); + if (item instanceof EnergyNetComponent) { + p.sendMessage(ChatColors.color(" &dEnergyNet Type: &e" + EnergyNet.getComponent(b.getLocation()))); + } p.sendMessage(ChatColors.color("&6" + BlockStorage.getBlockInfoAsJson(b))); p.sendMessage(" "); 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..cdd6cbafb 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,9 +9,9 @@ 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.core.handlers.BlockDispenseHandler; +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 34fd363f2..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; @@ -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/listeners/GrapplingHookEntity.java b/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/listeners/GrapplingHookEntity.java new file mode 100644 index 000000000..86661d9ff --- /dev/null +++ b/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/listeners/GrapplingHookEntity.java @@ -0,0 +1,46 @@ +package io.github.thebusybiscuit.slimefun4.implementation.listeners; + +import org.bukkit.GameMode; +import org.bukkit.Location; +import org.bukkit.entity.Arrow; +import org.bukkit.entity.Entity; +import org.bukkit.entity.Item; +import org.bukkit.entity.Player; + +import io.github.thebusybiscuit.slimefun4.implementation.SlimefunItems; + +final class GrapplingHookEntity { + + private final boolean dropItem; + + private final Arrow arrow; + private final Entity leashTarget; + + GrapplingHookEntity(Player p, Arrow arrow, Entity leashTarget, boolean dropItem) { + this.arrow = arrow; + this.leashTarget = leashTarget; + this.dropItem = p.getGameMode() != GameMode.CREATIVE && dropItem; + } + + public Arrow getArrow() { + return arrow; + } + + public void drop(Location l) { + if (dropItem) { + Item item = l.getWorld().dropItem(l, SlimefunItems.GRAPPLING_HOOK.clone()); + item.setPickupDelay(16); + } + } + + public void remove() { + if (arrow.isValid()) { + arrow.remove(); + } + + if (leashTarget.isValid()) { + leashTarget.remove(); + } + } + +} \ No newline at end of file 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..f71d7bb7f 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 @@ -6,32 +6,42 @@ import java.util.Map; import java.util.Set; import java.util.UUID; -import org.bukkit.GameMode; import org.bukkit.Location; import org.bukkit.entity.Arrow; import org.bukkit.entity.Bat; -import org.bukkit.entity.Entity; import org.bukkit.entity.Player; import org.bukkit.event.EventHandler; import org.bukkit.event.Listener; import org.bukkit.event.entity.EntityDamageByEntityEvent; import org.bukkit.event.entity.EntityDamageEvent; import org.bukkit.event.entity.EntityDamageEvent.DamageCause; +import org.bukkit.event.entity.EntityPortalEnterEvent; import org.bukkit.event.entity.ProjectileHitEvent; +import org.bukkit.event.hanging.HangingBreakByEntityEvent; +import org.bukkit.event.player.PlayerKickEvent; +import org.bukkit.event.player.PlayerQuitEvent; 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; +/** + * This {@link Listener} is responsible for the mechanics behind the {@link GrapplingHook}. + * + * @author TheBusyBiscuit + * @author Linox + * @author BlackBeltPanda + * + * @see GrapplingHook + * + */ public class GrapplingHookListener implements Listener { private GrapplingHook grapplingHook; - private final Map grappleState = new HashMap<>(); - private final Set invulnerable = new HashSet<>(); - private final Map temporaryEntities = new HashMap<>(); + private final Map activeHooks = new HashMap<>(); + private final Set invulnerability = new HashSet<>(); public void register(SlimefunPlugin plugin, GrapplingHook grapplingHook) { plugin.getServer().getPluginManager().registerEvents(this, plugin); @@ -39,9 +49,13 @@ public class GrapplingHookListener implements Listener { this.grapplingHook = grapplingHook; } + private boolean isEnabled() { + return grapplingHook != null && !grapplingHook.isDisabled(); + } + @EventHandler public void onArrowHitEntity(EntityDamageByEntityEvent e) { - if (grapplingHook == null || grapplingHook.isDisabled()) { + if (!isEnabled()) { return; } @@ -51,102 +65,137 @@ public class GrapplingHookListener implements Listener { } @EventHandler - public void onArrowHit(ProjectileHitEvent e) { - if (grapplingHook == null || grapplingHook.isDisabled()) { + public void onArrowHitSurface(ProjectileHitEvent e) { + if (!isEnabled()) { return; } Slimefun.runSync(() -> { - if (e.getEntity().isValid() && e.getEntity() instanceof Arrow) { + if (e.getEntity() instanceof Arrow) { handleGrapplingHook((Arrow) e.getEntity()); } - }, 4L); + }, 2L); } @EventHandler - public void onArrowHit(EntityDamageEvent e) { - if (grapplingHook == null || grapplingHook.isDisabled()) { + public void onArrowHitHanging(HangingBreakByEntityEvent e) { + if (!isEnabled()) { return; } - if (e.getEntity() instanceof Player && e.getCause() == DamageCause.FALL && invulnerable.contains(e.getEntity().getUniqueId())) { + // This is called when the arrow shoots off a painting or an item frame + if (e.getRemover() instanceof Arrow) { + handleGrapplingHook((Arrow) e.getRemover()); + } + } + + @EventHandler + public void onLeave(PlayerQuitEvent e) { + if (!isEnabled()) { + return; + } + + UUID uuid = e.getPlayer().getUniqueId(); + activeHooks.remove(uuid); + invulnerability.remove(uuid); + } + + @EventHandler + public void onLeave(PlayerKickEvent e) { + if (!isEnabled()) { + return; + } + + UUID uuid = e.getPlayer().getUniqueId(); + activeHooks.remove(uuid); + invulnerability.remove(uuid); + } + + @EventHandler + public void onFallDamage(EntityDamageEvent e) { + if (!isEnabled()) { + return; + } + + if (e.getEntity() instanceof Player && e.getCause() == DamageCause.FALL && invulnerability.remove(e.getEntity().getUniqueId())) { e.setCancelled(true); - invulnerable.remove(e.getEntity().getUniqueId()); + } + } + + @EventHandler + public void onPortalEnter(EntityPortalEnterEvent e) { + if (!isEnabled()) { + return; + } + + if (e.getEntity() instanceof Arrow) { + handleGrapplingHook((Arrow) e.getEntity()); } } private void handleGrapplingHook(Arrow arrow) { - if (arrow != null && arrow.getShooter() instanceof Player && grappleState.containsKey(((Player) arrow.getShooter()).getUniqueId())) { + if (arrow != null && arrow.isValid() && arrow.getShooter() instanceof Player) { Player p = (Player) arrow.getShooter(); + GrapplingHookEntity hook = activeHooks.get(p.getUniqueId()); - if (p.getGameMode() != GameMode.CREATIVE && (boolean) grappleState.get(p.getUniqueId())) { - arrow.getWorld().dropItem(arrow.getLocation(), SlimefunItems.GRAPPLING_HOOK.clone()); - } + if (hook != null) { + Location target = arrow.getLocation(); + hook.drop(target); - Vector velocity = new Vector(0.0, 0.2, 0.0); + Vector velocity = new Vector(0.0, 0.2, 0.0); - if (p.getLocation().distance(arrow.getLocation()) < 3.0) { - if (arrow.getLocation().getY() <= p.getLocation().getY()) { - velocity = arrow.getLocation().toVector().subtract(p.getLocation().toVector()); + if (p.getLocation().distance(target) < 3.0) { + if (target.getY() <= p.getLocation().getY()) { + velocity = target.toVector().subtract(p.getLocation().toVector()); + } } - } - else { - Location l = p.getLocation(); - l.setY(l.getY() + 0.5); - p.teleport(l); + else { + Location l = p.getLocation(); + l.setY(l.getY() + 0.5); + p.teleport(l); - double g = -0.08; - double d = arrow.getLocation().distance(l); - double t = d; - double vX = (1.0 + 0.08 * t) * (arrow.getLocation().getX() - l.getX()) / t; - double vY = (1.0 + 0.04 * t) * (arrow.getLocation().getY() - l.getY()) / t - 0.5D * g * t; - double vZ = (1.0 + 0.08 * t) * (arrow.getLocation().getZ() - l.getZ()) / t; + double g = -0.08; + double d = target.distance(l); + double t = d; + double vX = (1.0 + 0.08 * t) * (target.getX() - l.getX()) / t; + double vY = (1.0 + 0.04 * t) * (target.getY() - l.getY()) / t - 0.5D * g * t; + double vZ = (1.0 + 0.08 * t) * (target.getZ() - l.getZ()) / t; - velocity = p.getVelocity(); - velocity.setX(vX); - velocity.setY(vY); - velocity.setZ(vZ); - } - - p.setVelocity(velocity); - - for (Entity n : temporaryEntities.get(p.getUniqueId())) { - if (n.isValid()) { - n.remove(); + velocity = p.getVelocity(); + velocity.setX(vX); + velocity.setY(vY); + velocity.setZ(vZ); } - } - Slimefun.runSync(() -> { - grappleState.remove(p.getUniqueId()); - temporaryEntities.remove(p.getUniqueId()); - }, 20L); + p.setVelocity(velocity); + + hook.remove(); + Slimefun.runSync(() -> activeHooks.remove(p.getUniqueId()), 20L); + } } } public boolean isGrappling(UUID uuid) { - return grappleState.containsKey(uuid); + return activeHooks.containsKey(uuid); } - public void addGrapplingHook(UUID uuid, Arrow arrow, Bat b, boolean state, long despawnTicks) { - grappleState.put(uuid, state); - invulnerable.add(uuid); - temporaryEntities.put(uuid, new Entity[] { b, arrow }); + public void addGrapplingHook(Player p, Arrow arrow, Bat bat, boolean dropItem, long despawnTicks) { + GrapplingHookEntity hook = new GrapplingHookEntity(p, arrow, bat, dropItem); + UUID uuid = p.getUniqueId(); + + activeHooks.put(uuid, hook); // To fix issue #253 Slimefun.runSync(() -> { - if (grappleState.containsKey(uuid)) { - SlimefunPlugin.getBowListener().getProjectileData().remove(uuid); + GrapplingHookEntity entity = activeHooks.get(uuid); - for (Entity n : temporaryEntities.get(uuid)) { - if (n.isValid()) { - n.remove(); - } - } + if (entity != null) { + SlimefunPlugin.getBowListener().getProjectileData().remove(uuid); + entity.remove(); Slimefun.runSync(() -> { - invulnerable.remove(uuid); - grappleState.remove(uuid); - temporaryEntities.remove(uuid); + activeHooks.remove(uuid); + invulnerability.remove(uuid); }, 20L); } }, despawnTicks); 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..204db964a 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 @@ -1,7 +1,7 @@ package io.github.thebusybiscuit.slimefun4.implementation.listeners; -import java.util.List; import java.util.Set; +import java.util.concurrent.ThreadLocalRandom; import org.bukkit.Material; import org.bukkit.entity.Player; @@ -10,20 +10,17 @@ import org.bukkit.event.Listener; import org.bukkit.event.entity.EntityDeathEvent; import org.bukkit.inventory.ItemStack; -import io.github.thebusybiscuit.slimefun4.implementation.items.electric.BasicCircuitBoard; -import me.mrCookieSlime.Slimefun.SlimefunPlugin; +import io.github.thebusybiscuit.slimefun4.core.attributes.RandomMobDrop; +import io.github.thebusybiscuit.slimefun4.core.handlers.EntityKillHandler; +import io.github.thebusybiscuit.slimefun4.implementation.SlimefunPlugin; +import io.github.thebusybiscuit.slimefun4.implementation.items.misc.BasicCircuitBoard; import me.mrCookieSlime.Slimefun.Objects.SlimefunItem.SlimefunItem; -import me.mrCookieSlime.Slimefun.Objects.handlers.EntityKillHandler; import me.mrCookieSlime.Slimefun.api.Slimefun; public class MobDropListener implements Listener { - private final BasicCircuitBoard circuitBoard; - - public MobDropListener(SlimefunPlugin plugin, BasicCircuitBoard circuitBoard) { + public MobDropListener(SlimefunPlugin plugin) { plugin.getServer().getPluginManager().registerEvents(this, plugin); - - this.circuitBoard = circuitBoard; } @EventHandler @@ -33,8 +30,13 @@ public class MobDropListener implements Listener { ItemStack item = p.getInventory().getItemInMainHand(); Set customDrops = SlimefunPlugin.getRegistry().getMobDrops(e.getEntityType()); + if (customDrops != null && !customDrops.isEmpty()) { - addDrops(p, customDrops, e.getDrops()); + for (ItemStack drop : customDrops) { + if (canDrop(p, drop)) { + e.getDrops().add(drop.clone()); + } + } } if (item.getType() != Material.AIR) { @@ -47,15 +49,30 @@ public class MobDropListener implements Listener { } } - private void addDrops(Player p, Set customDrops, List drops) { - for (ItemStack drop : customDrops) { - if (Slimefun.hasUnlocked(p, drop, true)) { - if (circuitBoard != null && circuitBoard.isItem(drop) && !circuitBoard.isDroppedFromGolems()) { - continue; - } + private boolean canDrop(Player p, ItemStack item) { + SlimefunItem sfi = SlimefunItem.getByItem(item); - drops.add(drop.clone()); + if (sfi == null) { + return true; + } + else if (Slimefun.hasUnlocked(p, sfi, true)) { + + if (sfi instanceof RandomMobDrop) { + int random = ThreadLocalRandom.current().nextInt(100); + + if (((RandomMobDrop) sfi).getMobDropChance() <= random) { + return false; + } } + + if (sfi instanceof BasicCircuitBoard) { + return ((BasicCircuitBoard) sfi).isDroppedFromGolems(); + } + + return true; + } + else { + return false; } } } 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..c97cac228 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 @@ -15,9 +15,9 @@ import org.bukkit.event.player.PlayerInteractEvent; import org.bukkit.inventory.EquipmentSlot; import io.github.thebusybiscuit.slimefun4.api.events.MultiBlockInteractEvent; +import io.github.thebusybiscuit.slimefun4.core.handlers.MultiBlockInteractionHandler; import io.github.thebusybiscuit.slimefun4.core.multiblocks.MultiBlock; -import me.mrCookieSlime.Slimefun.SlimefunPlugin; -import me.mrCookieSlime.Slimefun.Objects.handlers.MultiBlockInteractionHandler; +import io.github.thebusybiscuit.slimefun4.implementation.SlimefunPlugin; /** * This {@link Listener} is responsible for listening to a {@link PlayerInteractEvent} and 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..2bdc3baec 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.core.handlers.EntityInteractHandler; +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..50b3e6384 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 @@ -35,7 +35,7 @@ public class SeismicAxeListener implements Listener { if (e.getEntity().getType() == EntityType.FALLING_BLOCK && e.getEntity().hasMetadata("seismic_axe")) { e.setCancelled(true); - e.getEntity().removeMetadata("seismic_axe", SlimefunPlugin.instance); + e.getEntity().removeMetadata("seismic_axe", SlimefunPlugin.instance()); e.getEntity().remove(); } } 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..9a69a0038 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 @@ -10,13 +10,14 @@ import org.bukkit.entity.Player; import org.bukkit.event.EventHandler; import org.bukkit.event.Listener; import org.bukkit.event.entity.EntityDamageByEntityEvent; +import org.bukkit.event.entity.EntityDamageEvent; import org.bukkit.event.entity.EntityShootBowEvent; import org.bukkit.event.entity.ProjectileHitEvent; +import io.github.thebusybiscuit.slimefun4.core.handlers.BowShootHandler; +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; /** @@ -68,7 +69,7 @@ public class SlimefunBowListener implements Listener { @EventHandler public void onArrowSuccessfulHit(EntityDamageByEntityEvent e) { - if (e.getDamager() instanceof Arrow && e.getEntity() instanceof LivingEntity) { + if (e.getDamager() instanceof Arrow && e.getEntity() instanceof LivingEntity && e.getCause() != EntityDamageEvent.DamageCause.ENTITY_EXPLOSION) { SlimefunBow bow = projectiles.get(e.getDamager().getUniqueId()); if (bow != null) { 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..6fc3c8374 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,11 +10,11 @@ import org.bukkit.inventory.meta.PotionMeta; import org.bukkit.potion.PotionEffect; import org.bukkit.potion.PotionEffectType; +import io.github.thebusybiscuit.slimefun4.core.handlers.ItemConsumptionHandler; +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; public class SlimefunItemConsumeListener implements Listener { 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..523fa7939 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 @@ -14,14 +14,14 @@ import org.bukkit.event.player.PlayerInteractEvent; import org.bukkit.inventory.EquipmentSlot; import io.github.thebusybiscuit.slimefun4.api.events.PlayerRightClickEvent; +import io.github.thebusybiscuit.slimefun4.core.handlers.BlockUseHandler; +import io.github.thebusybiscuit.slimefun4.core.handlers.ItemDropHandler; +import io.github.thebusybiscuit.slimefun4.core.handlers.ItemUseHandler; 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; import me.mrCookieSlime.Slimefun.Objects.handlers.ItemHandler; -import me.mrCookieSlime.Slimefun.Objects.handlers.ItemUseHandler; import me.mrCookieSlime.Slimefun.api.BlockStorage; import me.mrCookieSlime.Slimefun.api.Slimefun; import me.mrCookieSlime.Slimefun.api.inventory.BlockMenu; @@ -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..994b20290 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,11 +7,11 @@ 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 { - private final NamespacedKey key = new NamespacedKey(SlimefunPlugin.instance, "nether_ice"); + private final NamespacedKey key = new NamespacedKey(SlimefunPlugin.instance(), "nether_ice"); @Override public int getDefaultSupply(Environment environment, Biome biome) { 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..f40777c83 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,11 +7,11 @@ 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 { - private final NamespacedKey key = new NamespacedKey(SlimefunPlugin.instance, "oil"); + private final NamespacedKey key = new NamespacedKey(SlimefunPlugin.instance(), "oil"); @Override public int getDefaultSupply(Environment environment, Biome biome) { 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..a93014bab 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,11 +7,11 @@ 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 { - private final NamespacedKey key = new NamespacedKey(SlimefunPlugin.instance, "salt"); + private final NamespacedKey key = new NamespacedKey(SlimefunPlugin.instance(), "salt"); @Override public int getDefaultSupply(Environment environment, Biome biome) { 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..b85528480 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,11 +7,11 @@ 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 { - private final NamespacedKey key = new NamespacedKey(SlimefunPlugin.instance, "uranium"); + private final NamespacedKey key = new NamespacedKey(SlimefunPlugin.instance(), "uranium"); @Override public int getDefaultSupply(Environment envionment, Biome biome) { 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..c90bc6e43 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; /** @@ -32,35 +32,35 @@ import me.mrCookieSlime.Slimefun.Objects.Category; class DefaultCategories { // Standard Categories - protected final Category weapons = new Category(new NamespacedKey(SlimefunPlugin.instance, "weapons"), new CustomItem(SlimefunItems.BLADE_OF_VAMPIRES, "&7Weapons"), 1); - protected final Category tools = new Category(new NamespacedKey(SlimefunPlugin.instance, "tools"), new CustomItem(SlimefunItems.SMELTERS_PICKAXE, "&7Tools"), 1); - protected final Category usefulItems = new Category(new NamespacedKey(SlimefunPlugin.instance, "items"), new CustomItem(SlimefunItems.BACKPACK_MEDIUM, "&7Useful Items"), 1); - protected final Category basicMachines = new Category(new NamespacedKey(SlimefunPlugin.instance, "basic_machines"), new CustomItem(Material.CRAFTING_TABLE, "&7Basic Machines"), 1); - protected final Category food = new Category(new NamespacedKey(SlimefunPlugin.instance, "food"), new CustomItem(SlimefunItems.FORTUNE_COOKIE, "&7Food"), 2); - protected final Category armor = new Category(new NamespacedKey(SlimefunPlugin.instance, "armor"), new CustomItem(SlimefunItems.DAMASCUS_STEEL_CHESTPLATE, "&7Armor"), 2); + protected final Category weapons = new Category(new NamespacedKey(SlimefunPlugin.instance(), "weapons"), new CustomItem(SlimefunItems.BLADE_OF_VAMPIRES, "&7Weapons"), 1); + protected final Category tools = new Category(new NamespacedKey(SlimefunPlugin.instance(), "tools"), new CustomItem(SlimefunItems.SMELTERS_PICKAXE, "&7Tools"), 1); + protected final Category usefulItems = new Category(new NamespacedKey(SlimefunPlugin.instance(), "items"), new CustomItem(SlimefunItems.BACKPACK_MEDIUM, "&7Useful Items"), 1); + protected final Category basicMachines = new Category(new NamespacedKey(SlimefunPlugin.instance(), "basic_machines"), new CustomItem(SlimefunItems.ENHANCED_CRAFTING_TABLE, "&7Basic Machines"), 1); + protected final Category food = new Category(new NamespacedKey(SlimefunPlugin.instance(), "food"), new CustomItem(SlimefunItems.FORTUNE_COOKIE, "&7Food"), 2); + protected final Category armor = new Category(new NamespacedKey(SlimefunPlugin.instance(), "armor"), new CustomItem(SlimefunItems.DAMASCUS_STEEL_CHESTPLATE, "&7Armor"), 2); // Magical - protected final Category magicalResources = new Category(new NamespacedKey(SlimefunPlugin.instance, "magical_items"), new CustomItem(SlimefunItems.ENDER_RUNE, "&7Magical Items"), 2); - protected final Category magicalGadgets = new Category(new NamespacedKey(SlimefunPlugin.instance, "magical_gadgets"), new CustomItem(SlimefunItems.INFUSED_ELYTRA, "&7Magical Gadgets"), 3); - protected final Category magicalArmor = new Category(new NamespacedKey(SlimefunPlugin.instance, "magical_armor"), new CustomItem(SlimefunItems.ENDER_HELMET, "&7Magical Armor"), 2); + protected final Category magicalResources = new Category(new NamespacedKey(SlimefunPlugin.instance(), "magical_items"), new CustomItem(SlimefunItems.ENDER_RUNE, "&7Magical Items"), 2); + protected final Category magicalGadgets = new Category(new NamespacedKey(SlimefunPlugin.instance(), "magical_gadgets"), new CustomItem(SlimefunItems.INFUSED_ELYTRA, "&7Magical Gadgets"), 3); + protected final Category magicalArmor = new Category(new NamespacedKey(SlimefunPlugin.instance(), "magical_armor"), new CustomItem(SlimefunItems.ENDER_HELMET, "&7Magical Armor"), 2); // Resources and tech stuff - protected final Category misc = new Category(new NamespacedKey(SlimefunPlugin.instance, "misc"), new CustomItem(SlimefunItems.TIN_CAN, "&7Miscellaneous"), 2); - protected final Category technicalComponents = new Category(new NamespacedKey(SlimefunPlugin.instance, "tech_misc"), new CustomItem(SlimefunItems.HEATING_COIL, "&7Technical Components"), 2); - protected final Category technicalGadgets = new Category(new NamespacedKey(SlimefunPlugin.instance, "technical_gadgets"), new CustomItem(SlimefunItems.STEEL_JETPACK, "&7Technical Gadgets"), 3); - protected final Category resources = new Category(new NamespacedKey(SlimefunPlugin.instance, "resources"), new CustomItem(SlimefunItems.SYNTHETIC_SAPPHIRE, "&7Resources"), 1); + protected final Category misc = new Category(new NamespacedKey(SlimefunPlugin.instance(), "misc"), new CustomItem(SlimefunItems.TIN_CAN, "&7Miscellaneous"), 2); + protected final Category technicalComponents = new Category(new NamespacedKey(SlimefunPlugin.instance(), "tech_misc"), new CustomItem(SlimefunItems.HEATING_COIL, "&7Technical Components"), 2); + protected final Category technicalGadgets = new Category(new NamespacedKey(SlimefunPlugin.instance(), "technical_gadgets"), new CustomItem(SlimefunItems.STEEL_JETPACK, "&7Technical Gadgets"), 3); + protected final Category resources = new Category(new NamespacedKey(SlimefunPlugin.instance(), "resources"), new CustomItem(SlimefunItems.SYNTHETIC_SAPPHIRE, "&7Resources"), 1); // Locked Categories - protected final LockedCategory electricity = new LockedCategory(new NamespacedKey(SlimefunPlugin.instance, "electricity"), new CustomItem(SlimefunItems.NUCLEAR_REACTOR, "&bEnergy and Electricity"), 4, basicMachines.getKey()); - protected final LockedCategory androids = new LockedCategory(new NamespacedKey(SlimefunPlugin.instance, "androids"), new CustomItem(SlimefunItems.PROGRAMMABLE_ANDROID, "&cProgrammable Androids"), 4, basicMachines.getKey()); - protected final Category cargo = new LockedCategory(new NamespacedKey(SlimefunPlugin.instance, "cargo"), new CustomItem(SlimefunItems.CARGO_MANAGER, "&cCargo Management"), 4, basicMachines.getKey()); - protected final LockedCategory gps = new LockedCategory(new NamespacedKey(SlimefunPlugin.instance, "gps"), new CustomItem(SlimefunItems.GPS_TRANSMITTER, "&bGPS-based Machines"), 4, basicMachines.getKey()); + protected final LockedCategory electricity = new LockedCategory(new NamespacedKey(SlimefunPlugin.instance(), "electricity"), new CustomItem(SlimefunItems.NUCLEAR_REACTOR, "&bEnergy and Electricity"), 4, basicMachines.getKey()); + protected final LockedCategory androids = new LockedCategory(new NamespacedKey(SlimefunPlugin.instance(), "androids"), new CustomItem(SlimefunItems.PROGRAMMABLE_ANDROID, "&cProgrammable Androids"), 4, basicMachines.getKey()); + protected final Category cargo = new LockedCategory(new NamespacedKey(SlimefunPlugin.instance(), "cargo"), new CustomItem(SlimefunItems.CARGO_MANAGER, "&cCargo Management"), 4, basicMachines.getKey()); + protected final LockedCategory gps = new LockedCategory(new NamespacedKey(SlimefunPlugin.instance(), "gps"), new CustomItem(SlimefunItems.GPS_TRANSMITTER, "&bGPS-based Machines"), 4, basicMachines.getKey()); // Seasonal Categories - protected final SeasonalCategory christmas = new SeasonalCategory(new NamespacedKey(SlimefunPlugin.instance, "christmas"), Month.DECEMBER, 1, new CustomItem(SlimefunUtils.getCustomHead("215ba31cde2671b8f176de6a9ffd008035f0590d63ee240be6e8921cd2037a45"), ChatUtils.christmas("Christmas") + " &7(December only)")); - protected final SeasonalCategory valentinesDay = new SeasonalCategory(new NamespacedKey(SlimefunPlugin.instance, "valentines_day"), Month.FEBRUARY, 2, new CustomItem(SlimefunUtils.getCustomHead("55d89431d14bfef2060461b4a3565614dc51115c001fae2508e8684bc0ae6a80"), "&dValentine's Day" + " &7(14th February)")); - protected final SeasonalCategory easter = new SeasonalCategory(new NamespacedKey(SlimefunPlugin.instance, "easter"), Month.APRIL, 2, new CustomItem(HeadTexture.EASTER_EGG.getAsItemStack(), "&6Easter" + " &7(April)")); - protected final SeasonalCategory birthday = new SeasonalCategory(new NamespacedKey(SlimefunPlugin.instance, "birthday"), Month.OCTOBER, 1, new CustomItem(Material.FIREWORK_ROCKET, "&a&lTheBusyBiscuit's Birthday &7(26th October)")); - protected final SeasonalCategory halloween = new SeasonalCategory(new NamespacedKey(SlimefunPlugin.instance, "halloween"), Month.OCTOBER, 1, new CustomItem(Material.JACK_O_LANTERN, "&6&lHalloween &7(31st October)")); + protected final SeasonalCategory christmas = new SeasonalCategory(new NamespacedKey(SlimefunPlugin.instance(), "christmas"), Month.DECEMBER, 1, new CustomItem(SlimefunUtils.getCustomHead("215ba31cde2671b8f176de6a9ffd008035f0590d63ee240be6e8921cd2037a45"), ChatUtils.christmas("Christmas") + " &7(December only)")); + protected final SeasonalCategory valentinesDay = new SeasonalCategory(new NamespacedKey(SlimefunPlugin.instance(), "valentines_day"), Month.FEBRUARY, 2, new CustomItem(SlimefunUtils.getCustomHead("55d89431d14bfef2060461b4a3565614dc51115c001fae2508e8684bc0ae6a80"), "&dValentine's Day" + " &7(14th February)")); + protected final SeasonalCategory easter = new SeasonalCategory(new NamespacedKey(SlimefunPlugin.instance(), "easter"), Month.APRIL, 2, new CustomItem(HeadTexture.EASTER_EGG.getAsItemStack(), "&6Easter" + " &7(April)")); + protected final SeasonalCategory birthday = new SeasonalCategory(new NamespacedKey(SlimefunPlugin.instance(), "birthday"), Month.OCTOBER, 1, new CustomItem(Material.FIREWORK_ROCKET, "&a&lTheBusyBiscuit's Birthday &7(26th October)")); + protected final SeasonalCategory halloween = new SeasonalCategory(new NamespacedKey(SlimefunPlugin.instance(), "halloween"), Month.OCTOBER, 1, new CustomItem(Material.JACK_O_LANTERN, "&6&lHalloween &7(31st October)")); } 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..e5cedb8c8 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; @@ -180,6 +180,7 @@ public final class PostSetup { if (input[0] != null && recipe[0] != null) { grinderRecipes.add(new ItemStack[] { input[0], recipe[0] }); } + input = null; } } @@ -216,9 +217,13 @@ public final class PostSetup { } for (SlimefunItem item : SlimefunPlugin.getRegistry().getEnabledSlimefunItems()) { - if (item instanceof AContainer && ((AContainer) item).getMachineIdentifier().equals("ELECTRIC_SMELTERY")) { - List recipes = ((AContainer) item).getMachineRecipes(); - Collections.sort(recipes, Comparator.comparingInt(recipe -> recipe == null ? 0 : -recipe.getInput().length)); + if (item instanceof AContainer) { + AContainer machine = (AContainer) item; + + if (machine.getMachineIdentifier().equals("ELECTRIC_SMELTERY")) { + List recipes = machine.getMachineRecipes(); + Collections.sort(recipes, Comparator.comparingInt(recipe -> recipe == null ? 0 : -recipe.getInput().length)); + } } } } @@ -253,8 +258,12 @@ public final class PostSetup { private static void registerMachineRecipe(String machine, int seconds, ItemStack[] input, ItemStack[] output) { for (SlimefunItem item : SlimefunPlugin.getRegistry().getEnabledSlimefunItems()) { - if (item instanceof AContainer && ((AContainer) item).getMachineIdentifier().equals(machine)) { - ((AContainer) item).registerRecipe(seconds, input, output); + if (item instanceof AContainer) { + AContainer container = (AContainer) item; + + if (container.getMachineIdentifier().equals(machine)) { + container.registerRecipe(seconds, input, output); + } } } } 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 49360af23..d84c85a1f 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; /** @@ -104,7 +104,7 @@ public final class ResearchSetup { register("whirlwind_talisman", 75, "Talisman of the Whirlwind", 19, SlimefunItems.TALISMAN_WHIRLWIND); register("wizard_talisman", 76, "Talisman of the Wizard", 22, SlimefunItems.TALISMAN_WIZARD); register("lumber_axe", 77, "Lumber Axe", 21, SlimefunItems.LUMBER_AXE); - register("hazmat_suit", 79, "Hazmat Suit", 21, SlimefunItems.SCUBA_HELMET, SlimefunItems.HAZMAT_CHESTPLATE, SlimefunItems.HAZMAT_LEGGINGS, SlimefunItems.RUBBER_BOOTS); + register("hazmat_suit", 79, "Hazmat Suit", 21, SlimefunItems.SCUBA_HELMET, SlimefunItems.HAZMAT_CHESTPLATE, SlimefunItems.HAZMAT_LEGGINGS, SlimefunItems.HAZMAT_BOOTS); register("uranium", 80, "Radioactive", 30, SlimefunItems.TINY_URANIUM, SlimefunItems.SMALL_URANIUM, SlimefunItems.URANIUM); register("crushed_ore", 81, "Ore Purification", 25, SlimefunItems.CRUSHED_ORE, SlimefunItems.PULVERIZED_ORE, SlimefunItems.PURE_ORE_CLUSTER); register("redstone_alloy", 84, "Redstone Alloy", 16, SlimefunItems.REDSTONE_ALLOY); @@ -267,11 +267,13 @@ public final class ResearchSetup { register("advanced_industrial_miner", 98, "Better Mining", 36, SlimefunItems.ADVANCED_INDUSTRIAL_MINER); register("magical_zombie_pills", 257, "De-Zombification", 22, SlimefunItems.MAGICAL_ZOMBIE_PILLS); register("auto_brewer", 258, "Industrial Brewery", 30, SlimefunItems.AUTO_BREWER); - register("shulker_shell", 259, "Synthetic Shulkers", 30, new ItemStack(Material.SHULKER_SHELL)); + register("enchantment_rune", 259, "Ancient Enchanting", 24, SlimefunItems.MAGICAL_GLASS, SlimefunItems.ENCHANTMENT_RUNE); + register("lead_clothing", 260, "Lead Clothing", 14, SlimefunItems.REINFORCED_CLOTH); + register("shulker_shell", 261, "Synthetic Shulkers", 30, new ItemStack(Material.SHULKER_SHELL)); } private static void register(String key, int id, String name, int defaultCost, ItemStack... items) { - Research research = new Research(new NamespacedKey(SlimefunPlugin.instance, key), id, name, defaultCost); + Research research = new Research(new NamespacedKey(SlimefunPlugin.instance(), key), id, name, defaultCost); for (ItemStack item : items) { SlimefunItem sfItem = SlimefunItem.getByItem(item); 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 5682fe828..40988f41f 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 @@ -16,7 +16,9 @@ import io.github.thebusybiscuit.cscorelib2.materials.MaterialCollections; 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.core.handlers.RainbowTickHandler; 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; @@ -29,6 +31,7 @@ import io.github.thebusybiscuit.slimefun4.implementation.items.androids.FisherAn import io.github.thebusybiscuit.slimefun4.implementation.items.androids.MinerAndroid; import io.github.thebusybiscuit.slimefun4.implementation.items.androids.ProgrammableAndroid; import io.github.thebusybiscuit.slimefun4.implementation.items.androids.WoodcutterAndroid; +import io.github.thebusybiscuit.slimefun4.implementation.items.armor.HazmatArmorPiece; import io.github.thebusybiscuit.slimefun4.implementation.items.armor.Parachute; import io.github.thebusybiscuit.slimefun4.implementation.items.armor.SlimefunArmorPiece; import io.github.thebusybiscuit.slimefun4.implementation.items.backpacks.Cooler; @@ -54,7 +57,6 @@ import io.github.thebusybiscuit.slimefun4.implementation.items.cargo.CargoManage import io.github.thebusybiscuit.slimefun4.implementation.items.cargo.CargoOutputNode; import io.github.thebusybiscuit.slimefun4.implementation.items.cargo.ReactorAccessPort; import io.github.thebusybiscuit.slimefun4.implementation.items.cargo.TrashCan; -import io.github.thebusybiscuit.slimefun4.implementation.items.electric.BasicCircuitBoard; import io.github.thebusybiscuit.slimefun4.implementation.items.electric.Capacitor; import io.github.thebusybiscuit.slimefun4.implementation.items.electric.EnergyRegulator; import io.github.thebusybiscuit.slimefun4.implementation.items.electric.gadgets.JetBoots; @@ -117,6 +119,7 @@ import io.github.thebusybiscuit.slimefun4.implementation.items.gps.GPSTransmitte import io.github.thebusybiscuit.slimefun4.implementation.items.gps.PersonalActivationPlate; import io.github.thebusybiscuit.slimefun4.implementation.items.gps.Teleporter; import io.github.thebusybiscuit.slimefun4.implementation.items.gps.TeleporterPylon; +import io.github.thebusybiscuit.slimefun4.implementation.items.magical.EnchantmentRune; import io.github.thebusybiscuit.slimefun4.implementation.items.magical.InfernalBonemeal; import io.github.thebusybiscuit.slimefun4.implementation.items.magical.InfusedMagnet; import io.github.thebusybiscuit.slimefun4.implementation.items.magical.KnowledgeFlask; @@ -136,6 +139,8 @@ import io.github.thebusybiscuit.slimefun4.implementation.items.medical.Medicine; import io.github.thebusybiscuit.slimefun4.implementation.items.medical.Rag; import io.github.thebusybiscuit.slimefun4.implementation.items.medical.Splint; import io.github.thebusybiscuit.slimefun4.implementation.items.medical.Vitamins; +import io.github.thebusybiscuit.slimefun4.implementation.items.misc.BasicCircuitBoard; +import io.github.thebusybiscuit.slimefun4.implementation.items.misc.CoolantCell; import io.github.thebusybiscuit.slimefun4.implementation.items.misc.OrganicFertilizer; import io.github.thebusybiscuit.slimefun4.implementation.items.misc.OrganicFood; import io.github.thebusybiscuit.slimefun4.implementation.items.multiblocks.ArmorForge; @@ -168,17 +173,16 @@ import io.github.thebusybiscuit.slimefun4.implementation.items.tools.PickaxeOfVe import io.github.thebusybiscuit.slimefun4.implementation.items.tools.PortableCrafter; import io.github.thebusybiscuit.slimefun4.implementation.items.tools.PortableDustbin; import io.github.thebusybiscuit.slimefun4.implementation.items.tools.SmeltersPickaxe; +import io.github.thebusybiscuit.slimefun4.implementation.items.tools.TapeMeasure; import io.github.thebusybiscuit.slimefun4.implementation.items.weapons.ExplosiveBow; import io.github.thebusybiscuit.slimefun4.implementation.items.weapons.IcyBow; import io.github.thebusybiscuit.slimefun4.implementation.items.weapons.SeismicAxe; 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; -import me.mrCookieSlime.Slimefun.Objects.handlers.RainbowTicker; import me.mrCookieSlime.Slimefun.api.SlimefunItemStack; import org.bukkit.potion.PotionType; @@ -352,12 +356,12 @@ public final class SlimefunItemSetup { new ItemStack[] {SlimefunItems.SALT, new ItemStack(Material.ROTTEN_FLESH), null, null, null, null, null, null, null}) .register(plugin); - new SlimefunItem(categories.magicalArmor, SlimefunItems.SLIME_HELMET, RecipeType.ARMOR_FORGE, - new ItemStack[] {new ItemStack(Material.SLIME_BALL), new ItemStack(Material.IRON_INGOT), new ItemStack(Material.SLIME_BALL), new ItemStack(Material.IRON_INGOT), null, new ItemStack(Material.IRON_INGOT), null, null, null}) + new SlimefunArmorPiece(categories.magicalArmor, SlimefunItems.SLIME_HELMET, RecipeType.ARMOR_FORGE, + new ItemStack[] {new ItemStack(Material.SLIME_BALL), new ItemStack(Material.IRON_INGOT), new ItemStack(Material.SLIME_BALL), new ItemStack(Material.IRON_INGOT), null, new ItemStack(Material.IRON_INGOT), null, null, null}, null) .register(plugin); - new SlimefunItem(categories.magicalArmor, SlimefunItems.SLIME_CHESTPLATE, RecipeType.ARMOR_FORGE, - new ItemStack[] {new ItemStack(Material.SLIME_BALL), null, new ItemStack(Material.SLIME_BALL), new ItemStack(Material.IRON_INGOT), new ItemStack(Material.SLIME_BALL), new ItemStack(Material.IRON_INGOT), new ItemStack(Material.IRON_INGOT), new ItemStack(Material.SLIME_BALL), new ItemStack(Material.IRON_INGOT)}) + new SlimefunArmorPiece(categories.magicalArmor, SlimefunItems.SLIME_CHESTPLATE, RecipeType.ARMOR_FORGE, + new ItemStack[] {new ItemStack(Material.SLIME_BALL), null, new ItemStack(Material.SLIME_BALL), new ItemStack(Material.IRON_INGOT), new ItemStack(Material.SLIME_BALL), new ItemStack(Material.IRON_INGOT), new ItemStack(Material.IRON_INGOT), new ItemStack(Material.SLIME_BALL), new ItemStack(Material.IRON_INGOT)}, null) .register(plugin); new SlimefunArmorPiece(categories.magicalArmor, SlimefunItems.SLIME_LEGGINGS, RecipeType.ARMOR_FORGE, @@ -378,6 +382,10 @@ public final class SlimefunItemSetup { new ItemStack[] {null, SlimefunItems.MAGIC_LUMP_2, null, SlimefunItems.MAGIC_LUMP_2, new ItemStack(Material.BOOK), SlimefunItems.MAGIC_LUMP_2, null, SlimefunItems.MAGIC_LUMP_2, null}) .register(plugin); + new SlimefunItem(categories.magicalResources, SlimefunItems.MAGICAL_GLASS, RecipeType.MAGIC_WORKBENCH, + new ItemStack[] {SlimefunItems.MAGIC_LUMP_2, SlimefunItems.GOLD_DUST, SlimefunItems.MAGIC_LUMP_2, SlimefunItems.FILLED_FLASK_OF_KNOWLEDGE, new ItemStack(Material.GLASS_PANE), SlimefunItems.FILLED_FLASK_OF_KNOWLEDGE, SlimefunItems.MAGIC_LUMP_2, SlimefunItems.FILLED_FLASK_OF_KNOWLEDGE, SlimefunItems.MAGIC_LUMP_2}) + .register(plugin); + new BasicCircuitBoard(categories.technicalComponents, SlimefunItems.BASIC_CIRCUIT_BOARD, RecipeType.MOB_DROP, new ItemStack[] {null, null, null, null, new CustomItem(SlimefunUtils.getCustomHead("89091d79ea0f59ef7ef94d7bba6e5f17f2f7d4572c44f90f76c4819a714"), "&aIron Golem"), null, null, null, null}) .register(plugin); @@ -603,37 +611,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, @@ -676,37 +684,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); @@ -769,7 +777,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, @@ -905,23 +914,27 @@ public final class SlimefunItemSetup { registerArmorSet(categories.armor, SlimefunItems.GILDED_IRON, new ItemStack[] { SlimefunItems.GILDED_IRON_HELMET, SlimefunItems.GILDED_IRON_CHESTPLATE, SlimefunItems.GILDED_IRON_LEGGINGS, SlimefunItems.GILDED_IRON_BOOTS }, "GILDED_IRON", false, plugin); + + new SlimefunItem(categories.technicalComponents, SlimefunItems.REINFORCED_CLOTH, RecipeType.ENHANCED_CRAFTING_TABLE, + new ItemStack[] {null, SlimefunItems.CLOTH, null, SlimefunItems.CLOTH, SlimefunItems.LEAD_INGOT, SlimefunItems.CLOTH, null, SlimefunItems.CLOTH, null}, new SlimefunItemStack(SlimefunItems.REINFORCED_CLOTH, 2)) + .register(plugin); - new SlimefunArmorPiece(categories.armor, SlimefunItems.SCUBA_HELMET, RecipeType.ARMOR_FORGE, - new ItemStack[] {new ItemStack(Material.ORANGE_WOOL), new ItemStack(Material.ORANGE_WOOL), new ItemStack(Material.ORANGE_WOOL), new ItemStack(Material.BLACK_WOOL), new ItemStack(Material.GLASS_PANE), new ItemStack(Material.BLACK_WOOL), null, null, null}, + new HazmatArmorPiece(categories.armor, SlimefunItems.SCUBA_HELMET, RecipeType.ARMOR_FORGE, + new ItemStack[] {new ItemStack(Material.ORANGE_WOOL), SlimefunItems.REINFORCED_CLOTH, new ItemStack(Material.ORANGE_WOOL), SlimefunItems.REINFORCED_CLOTH, new ItemStack(Material.GLASS_PANE), SlimefunItems.REINFORCED_CLOTH, null, null, null}, new PotionEffect[] {new PotionEffect(PotionEffectType.WATER_BREATHING, 300, 1)}) .register(plugin); - new SlimefunArmorPiece(categories.armor, SlimefunItems.HAZMAT_CHESTPLATE, RecipeType.ARMOR_FORGE, - new ItemStack[] {new ItemStack(Material.ORANGE_WOOL), null, new ItemStack(Material.ORANGE_WOOL), new ItemStack(Material.ORANGE_WOOL), new ItemStack(Material.ORANGE_WOOL), new ItemStack(Material.ORANGE_WOOL), new ItemStack(Material.BLACK_WOOL), new ItemStack(Material.BLACK_WOOL), new ItemStack(Material.BLACK_WOOL)}, + new HazmatArmorPiece(categories.armor, SlimefunItems.HAZMAT_CHESTPLATE, RecipeType.ARMOR_FORGE, + new ItemStack[] {new ItemStack(Material.ORANGE_WOOL), null, new ItemStack(Material.ORANGE_WOOL), SlimefunItems.REINFORCED_CLOTH, SlimefunItems.REINFORCED_CLOTH, SlimefunItems.REINFORCED_CLOTH, new ItemStack(Material.BLACK_WOOL), SlimefunItems.REINFORCED_CLOTH, new ItemStack(Material.BLACK_WOOL)}, new PotionEffect[] {new PotionEffect(PotionEffectType.FIRE_RESISTANCE, 300, 1)}) .register(plugin); - new SlimefunItem(categories.armor, SlimefunItems.HAZMAT_LEGGINGS, RecipeType.ARMOR_FORGE, - new ItemStack[] {new ItemStack(Material.BLACK_WOOL), new ItemStack(Material.BLACK_WOOL), new ItemStack(Material.BLACK_WOOL), new ItemStack(Material.ORANGE_WOOL), null, new ItemStack(Material.ORANGE_WOOL), new ItemStack(Material.ORANGE_WOOL), null, new ItemStack(Material.ORANGE_WOOL)}) + new HazmatArmorPiece(categories.armor, SlimefunItems.HAZMAT_LEGGINGS, RecipeType.ARMOR_FORGE, + new ItemStack[] {new ItemStack(Material.BLACK_WOOL), SlimefunItems.REINFORCED_CLOTH, new ItemStack(Material.BLACK_WOOL), SlimefunItems.REINFORCED_CLOTH, null, SlimefunItems.REINFORCED_CLOTH, SlimefunItems.REINFORCED_CLOTH, null, SlimefunItems.REINFORCED_CLOTH}, new PotionEffect[0]) .register(plugin); - new SlimefunItem(categories.armor, SlimefunItems.RUBBER_BOOTS, RecipeType.ARMOR_FORGE, - new ItemStack[] {null, null, null, new ItemStack(Material.BLACK_WOOL), null, new ItemStack(Material.BLACK_WOOL), new ItemStack(Material.BLACK_WOOL), null, new ItemStack(Material.BLACK_WOOL)}) + new HazmatArmorPiece(categories.armor, SlimefunItems.HAZMAT_BOOTS, RecipeType.ARMOR_FORGE, + new ItemStack[] {SlimefunItems.REINFORCED_CLOTH, null, SlimefunItems.REINFORCED_CLOTH, SlimefunItems.REINFORCED_CLOTH, null, SlimefunItems.REINFORCED_CLOTH, new ItemStack(Material.BLACK_WOOL), null, new ItemStack(Material.BLACK_WOOL)}, new PotionEffect[0]) .register(plugin); new SlimefunItem(categories.misc, SlimefunItems.CRUSHED_ORE, RecipeType.ORE_CRUSHER, @@ -1005,12 +1018,12 @@ public final class SlimefunItemSetup { new TableSaw(categories.basicMachines, SlimefunItems.TABLE_SAW).register(plugin); } - new SlimefunItem(categories.magicalArmor, SlimefunItems.SLIME_HELMET_STEEL, RecipeType.ARMOR_FORGE, - new ItemStack[] {new ItemStack(Material.SLIME_BALL), SlimefunItems.STEEL_PLATE, new ItemStack(Material.SLIME_BALL), new ItemStack(Material.SLIME_BALL), null, new ItemStack(Material.SLIME_BALL), null, null, null}) + new SlimefunArmorPiece(categories.magicalArmor, SlimefunItems.SLIME_HELMET_STEEL, RecipeType.ARMOR_FORGE, + new ItemStack[] {new ItemStack(Material.SLIME_BALL), SlimefunItems.STEEL_PLATE, new ItemStack(Material.SLIME_BALL), new ItemStack(Material.SLIME_BALL), null, new ItemStack(Material.SLIME_BALL), null, null, null}, null) .register(plugin); - new SlimefunItem(categories.magicalArmor, SlimefunItems.SLIME_CHESTPLATE_STEEL, RecipeType.ARMOR_FORGE, - new ItemStack[] {new ItemStack(Material.SLIME_BALL), null, new ItemStack(Material.SLIME_BALL), new ItemStack(Material.SLIME_BALL), SlimefunItems.STEEL_PLATE, new ItemStack(Material.SLIME_BALL), new ItemStack(Material.SLIME_BALL), new ItemStack(Material.SLIME_BALL), new ItemStack(Material.SLIME_BALL)}) + new SlimefunArmorPiece(categories.magicalArmor, SlimefunItems.SLIME_CHESTPLATE_STEEL, RecipeType.ARMOR_FORGE, + new ItemStack[] {new ItemStack(Material.SLIME_BALL), null, new ItemStack(Material.SLIME_BALL), new ItemStack(Material.SLIME_BALL), SlimefunItems.STEEL_PLATE, new ItemStack(Material.SLIME_BALL), new ItemStack(Material.SLIME_BALL), new ItemStack(Material.SLIME_BALL), new ItemStack(Material.SLIME_BALL)}, null) .register(plugin); new SlimefunArmorPiece(categories.magicalArmor, SlimefunItems.SLIME_LEGGINGS_STEEL, RecipeType.ARMOR_FORGE, @@ -1110,48 +1123,48 @@ public final class SlimefunItemSetup { new ItemStack[] {SlimefunItems.ENDER_LUMP_3, SlimefunItems.AIR_RUNE, SlimefunItems.ENDER_LUMP_3, SlimefunItems.EARTH_RUNE, SlimefunItems.NECROTIC_SKULL, SlimefunItems.FIRE_RUNE, SlimefunItems.ENDER_LUMP_3, SlimefunItems.WATER_RUNE, SlimefunItems.ENDER_LUMP_3}) .register(plugin); - new SoulboundBackpack(36, categories.usefulItems, SlimefunItems.BOUND_BACKPACK, RecipeType.MAGIC_WORKBENCH, + new SoulboundBackpack(36, categories.magicalGadgets, SlimefunItems.BOUND_BACKPACK, RecipeType.MAGIC_WORKBENCH, new ItemStack[] {SlimefunItems.ENDER_LUMP_2, null, SlimefunItems.ENDER_LUMP_2, SlimefunItems.ESSENCE_OF_AFTERLIFE, SlimefunItems.WOVEN_BACKPACK, SlimefunItems.ESSENCE_OF_AFTERLIFE, SlimefunItems.ENDER_LUMP_2, null, SlimefunItems.ENDER_LUMP_2}) .register(plugin); 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, @@ -1217,7 +1230,7 @@ public final class SlimefunItemSetup { .register(plugin); new Juice(categories.food, SlimefunItems.MELON_JUICE, RecipeType.JUICER, - new ItemStack[] {new ItemStack(Material.MELON), null, null, null, null, null, null, null, null}) + new ItemStack[] {new ItemStack(Material.MELON_SLICE), null, null, null, null, null, null, null, null}) .register(plugin); new Juice(categories.food, SlimefunItems.PUMPKIN_JUICE, RecipeType.JUICER, @@ -1976,14 +1989,25 @@ public final class SlimefunItemSetup { }.register(plugin); if (SlimefunPlugin.getMinecraftVersion().isAtLeast(MinecraftVersion.MINECRAFT_1_14)) { - 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); + 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 { + 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}) { @@ -2469,6 +2493,10 @@ public final class SlimefunItemSetup { new ItemStack[] {SlimefunItems.MAGIC_LUMP_3, SlimefunItems.ESSENCE_OF_AFTERLIFE, SlimefunItems.MAGIC_LUMP_3, SlimefunItems.ENDER_LUMP_3, SlimefunItems.ENDER_RUNE, SlimefunItems.ENDER_LUMP_3, SlimefunItems.MAGIC_LUMP_3, SlimefunItems.ESSENCE_OF_AFTERLIFE, SlimefunItems.MAGIC_LUMP_3}) .register(plugin); + new EnchantmentRune(categories.magicalResources, SlimefunItems.ENCHANTMENT_RUNE, RecipeType.ANCIENT_ALTAR, + new ItemStack[] {SlimefunItems.MAGIC_LUMP_3, SlimefunItems.MAGICAL_GLASS, SlimefunItems.MAGIC_LUMP_3, SlimefunItems.MAGICAL_GLASS, SlimefunItems.LIGHTNING_RUNE, SlimefunItems.MAGICAL_GLASS, SlimefunItems.MAGIC_LUMP_3, SlimefunItems.MAGICAL_GLASS, SlimefunItems.MAGIC_LUMP_3}) + .register(plugin); + new InfernalBonemeal(categories.magicalGadgets, SlimefunItems.INFERNAL_BONEMEAL, RecipeType.ANCIENT_ALTAR, new ItemStack[] {new ItemStack(Material.NETHER_WART), SlimefunItems.EARTH_RUNE, new ItemStack(Material.NETHER_WART), SlimefunItems.MAGIC_LUMP_2, new ItemStack(Material.BONE_MEAL), SlimefunItems.MAGIC_LUMP_2, new ItemStack(Material.NETHER_WART), new ItemStack(Material.BLAZE_POWDER), new ItemStack(Material.NETHER_WART)}, new CustomItem(SlimefunItems.INFERNAL_BONEMEAL, 8)) @@ -2496,128 +2524,128 @@ public final class SlimefunItemSetup { new RainbowBlock(categories.magicalGadgets, SlimefunItems.RAINBOW_WOOL, RecipeType.ANCIENT_ALTAR, new ItemStack[] {new ItemStack(Material.WHITE_WOOL), new ItemStack(Material.WHITE_WOOL), new ItemStack(Material.WHITE_WOOL), new ItemStack(Material.WHITE_WOOL), SlimefunItems.RAINBOW_RUNE, new ItemStack(Material.WHITE_WOOL), new ItemStack(Material.WHITE_WOOL), new ItemStack(Material.WHITE_WOOL), new ItemStack(Material.WHITE_WOOL)}, - new CustomItem(SlimefunItems.RAINBOW_WOOL, 8), new RainbowTicker(MaterialCollections.getAllWoolColors())) + new CustomItem(SlimefunItems.RAINBOW_WOOL, 8), new RainbowTickHandler(MaterialCollections.getAllWoolColors())) .register(plugin); new RainbowBlock(categories.magicalGadgets, SlimefunItems.RAINBOW_GLASS, RecipeType.ANCIENT_ALTAR, new ItemStack[] {new ItemStack(Material.WHITE_STAINED_GLASS), new ItemStack(Material.WHITE_STAINED_GLASS), new ItemStack(Material.WHITE_STAINED_GLASS), new ItemStack(Material.WHITE_STAINED_GLASS), SlimefunItems.RAINBOW_RUNE, new ItemStack(Material.WHITE_STAINED_GLASS), new ItemStack(Material.WHITE_STAINED_GLASS), new ItemStack(Material.WHITE_STAINED_GLASS), new ItemStack(Material.WHITE_STAINED_GLASS)}, - new CustomItem(SlimefunItems.RAINBOW_GLASS, 8), new RainbowTicker(MaterialCollections.getAllStainedGlassColors())) + new CustomItem(SlimefunItems.RAINBOW_GLASS, 8), new RainbowTickHandler(MaterialCollections.getAllStainedGlassColors())) .register(plugin); new RainbowBlock(categories.magicalGadgets, SlimefunItems.RAINBOW_GLASS_PANE, RecipeType.ANCIENT_ALTAR, new ItemStack[] {new ItemStack(Material.WHITE_STAINED_GLASS_PANE), new ItemStack(Material.WHITE_STAINED_GLASS_PANE), new ItemStack(Material.WHITE_STAINED_GLASS_PANE), new ItemStack(Material.WHITE_STAINED_GLASS_PANE), SlimefunItems.RAINBOW_RUNE, new ItemStack(Material.WHITE_STAINED_GLASS_PANE), new ItemStack(Material.WHITE_STAINED_GLASS_PANE), new ItemStack(Material.WHITE_STAINED_GLASS_PANE), new ItemStack(Material.WHITE_STAINED_GLASS_PANE)}, - new CustomItem(SlimefunItems.RAINBOW_GLASS_PANE, 8), new RainbowTicker(MaterialCollections.getAllStainedGlassPaneColors())) + new CustomItem(SlimefunItems.RAINBOW_GLASS_PANE, 8), new RainbowTickHandler(MaterialCollections.getAllStainedGlassPaneColors())) .register(plugin); new RainbowBlock(categories.magicalGadgets, SlimefunItems.RAINBOW_CLAY, RecipeType.ANCIENT_ALTAR, new ItemStack[] {new ItemStack(Material.WHITE_TERRACOTTA), new ItemStack(Material.WHITE_TERRACOTTA), new ItemStack(Material.WHITE_TERRACOTTA), new ItemStack(Material.WHITE_TERRACOTTA), SlimefunItems.RAINBOW_RUNE, new ItemStack(Material.WHITE_TERRACOTTA), new ItemStack(Material.WHITE_TERRACOTTA), new ItemStack(Material.WHITE_TERRACOTTA), new ItemStack(Material.WHITE_TERRACOTTA)}, - new CustomItem(SlimefunItems.RAINBOW_CLAY, 8), new RainbowTicker(MaterialCollections.getAllTerracottaColors())) + new CustomItem(SlimefunItems.RAINBOW_CLAY, 8), new RainbowTickHandler(MaterialCollections.getAllTerracottaColors())) .register(plugin); new RainbowBlock(categories.magicalGadgets, SlimefunItems.RAINBOW_CONCRETE, RecipeType.ANCIENT_ALTAR, new ItemStack[] {new ItemStack(Material.WHITE_CONCRETE), new ItemStack(Material.WHITE_CONCRETE), new ItemStack(Material.WHITE_CONCRETE), new ItemStack(Material.WHITE_CONCRETE), SlimefunItems.RAINBOW_RUNE, new ItemStack(Material.WHITE_CONCRETE), new ItemStack(Material.WHITE_CONCRETE), new ItemStack(Material.WHITE_CONCRETE), new ItemStack(Material.WHITE_CONCRETE)}, - new CustomItem(SlimefunItems.RAINBOW_CONCRETE, 8), new RainbowTicker(MaterialCollections.getAllConcreteColors())) + new CustomItem(SlimefunItems.RAINBOW_CONCRETE, 8), new RainbowTickHandler(MaterialCollections.getAllConcreteColors())) .register(plugin); new RainbowBlock(categories.magicalGadgets, SlimefunItems.RAINBOW_GLAZED_TERRACOTTA, RecipeType.ANCIENT_ALTAR, new ItemStack[] {new ItemStack(Material.WHITE_GLAZED_TERRACOTTA), new ItemStack(Material.WHITE_GLAZED_TERRACOTTA), new ItemStack(Material.WHITE_GLAZED_TERRACOTTA), new ItemStack(Material.WHITE_GLAZED_TERRACOTTA), SlimefunItems.RAINBOW_RUNE, new ItemStack(Material.WHITE_GLAZED_TERRACOTTA), new ItemStack(Material.WHITE_GLAZED_TERRACOTTA), new ItemStack(Material.WHITE_GLAZED_TERRACOTTA), new ItemStack(Material.WHITE_GLAZED_TERRACOTTA)}, - new CustomItem(SlimefunItems.RAINBOW_GLAZED_TERRACOTTA, 8), new RainbowTicker(MaterialCollections.getAllGlazedTerracottaColors())) + new CustomItem(SlimefunItems.RAINBOW_GLAZED_TERRACOTTA, 8), new RainbowTickHandler(MaterialCollections.getAllGlazedTerracottaColors())) .register(plugin); // Christmas new RainbowBlock(categories.christmas, SlimefunItems.RAINBOW_WOOL_XMAS, RecipeType.ANCIENT_ALTAR, new ItemStack[] {new ItemStack(RED_DYE), SlimefunItems.CHRISTMAS_COOKIE, new ItemStack(GREEN_DYE), new ItemStack(Material.WHITE_WOOL), SlimefunItems.RAINBOW_RUNE, new ItemStack(Material.WHITE_WOOL), new ItemStack(GREEN_DYE), SlimefunItems.CHRISTMAS_COOKIE, new ItemStack(RED_DYE)}, - new CustomItem(SlimefunItems.RAINBOW_WOOL_XMAS, 2), new RainbowTicker(Material.RED_WOOL, Material.GREEN_WOOL)) + new CustomItem(SlimefunItems.RAINBOW_WOOL_XMAS, 2), new RainbowTickHandler(Material.RED_WOOL, Material.GREEN_WOOL)) .register(plugin); new RainbowBlock(categories.christmas, SlimefunItems.RAINBOW_GLASS_XMAS, RecipeType.ANCIENT_ALTAR, new ItemStack[] {new ItemStack(RED_DYE), SlimefunItems.CHRISTMAS_COOKIE, new ItemStack(GREEN_DYE), new ItemStack(Material.WHITE_STAINED_GLASS), SlimefunItems.RAINBOW_RUNE, new ItemStack(Material.WHITE_STAINED_GLASS), new ItemStack(GREEN_DYE), SlimefunItems.CHRISTMAS_COOKIE, new ItemStack(RED_DYE)}, - new CustomItem(SlimefunItems.RAINBOW_GLASS_XMAS, 2), new RainbowTicker(Material.RED_STAINED_GLASS, Material.GREEN_STAINED_GLASS)) + new CustomItem(SlimefunItems.RAINBOW_GLASS_XMAS, 2), new RainbowTickHandler(Material.RED_STAINED_GLASS, Material.GREEN_STAINED_GLASS)) .register(plugin); new RainbowBlock(categories.christmas, SlimefunItems.RAINBOW_GLASS_PANE_XMAS, RecipeType.ANCIENT_ALTAR, new ItemStack[] {new ItemStack(RED_DYE), SlimefunItems.CHRISTMAS_COOKIE, new ItemStack(GREEN_DYE), new ItemStack(Material.WHITE_STAINED_GLASS_PANE), SlimefunItems.RAINBOW_RUNE, new ItemStack(Material.WHITE_STAINED_GLASS_PANE), new ItemStack(GREEN_DYE), SlimefunItems.CHRISTMAS_COOKIE, new ItemStack(RED_DYE)}, - new CustomItem(SlimefunItems.RAINBOW_GLASS_PANE_XMAS, 2), new RainbowTicker(Material.RED_STAINED_GLASS_PANE, Material.GREEN_STAINED_GLASS_PANE)) + new CustomItem(SlimefunItems.RAINBOW_GLASS_PANE_XMAS, 2), new RainbowTickHandler(Material.RED_STAINED_GLASS_PANE, Material.GREEN_STAINED_GLASS_PANE)) .register(plugin); new RainbowBlock(categories.christmas, SlimefunItems.RAINBOW_CLAY_XMAS, RecipeType.ANCIENT_ALTAR, new ItemStack[] {new ItemStack(RED_DYE), SlimefunItems.CHRISTMAS_COOKIE, new ItemStack(GREEN_DYE), new ItemStack(Material.WHITE_TERRACOTTA), SlimefunItems.RAINBOW_RUNE, new ItemStack(Material.WHITE_TERRACOTTA), new ItemStack(GREEN_DYE), SlimefunItems.CHRISTMAS_COOKIE, new ItemStack(RED_DYE)}, - new CustomItem(SlimefunItems.RAINBOW_CLAY_XMAS, 2), new RainbowTicker(Material.RED_TERRACOTTA, Material.GREEN_TERRACOTTA)) + new CustomItem(SlimefunItems.RAINBOW_CLAY_XMAS, 2), new RainbowTickHandler(Material.RED_TERRACOTTA, Material.GREEN_TERRACOTTA)) .register(plugin); new RainbowBlock(categories.christmas, SlimefunItems.RAINBOW_CONCRETE_XMAS, RecipeType.ANCIENT_ALTAR, new ItemStack[] {new ItemStack(RED_DYE), SlimefunItems.CHRISTMAS_COOKIE, new ItemStack(GREEN_DYE), new ItemStack(Material.WHITE_CONCRETE), SlimefunItems.RAINBOW_RUNE, new ItemStack(Material.WHITE_CONCRETE), new ItemStack(GREEN_DYE), SlimefunItems.CHRISTMAS_COOKIE, new ItemStack(RED_DYE)}, - new CustomItem(SlimefunItems.RAINBOW_CONCRETE_XMAS, 2), new RainbowTicker(Material.RED_CONCRETE, Material.GREEN_CONCRETE)) + new CustomItem(SlimefunItems.RAINBOW_CONCRETE_XMAS, 2), new RainbowTickHandler(Material.RED_CONCRETE, Material.GREEN_CONCRETE)) .register(plugin); new RainbowBlock(categories.christmas, SlimefunItems.RAINBOW_GLAZED_TERRACOTTA_XMAS, RecipeType.ANCIENT_ALTAR, new ItemStack[] {new ItemStack(RED_DYE), SlimefunItems.CHRISTMAS_COOKIE, new ItemStack(GREEN_DYE), new ItemStack(Material.WHITE_GLAZED_TERRACOTTA), SlimefunItems.RAINBOW_RUNE, new ItemStack(Material.WHITE_GLAZED_TERRACOTTA), new ItemStack(GREEN_DYE), SlimefunItems.CHRISTMAS_COOKIE, new ItemStack(RED_DYE)}, - new CustomItem(SlimefunItems.RAINBOW_GLAZED_TERRACOTTA_XMAS, 2), new RainbowTicker(Material.RED_GLAZED_TERRACOTTA, Material.GREEN_GLAZED_TERRACOTTA)) + new CustomItem(SlimefunItems.RAINBOW_GLAZED_TERRACOTTA_XMAS, 2), new RainbowTickHandler(Material.RED_GLAZED_TERRACOTTA, Material.GREEN_GLAZED_TERRACOTTA)) .register(plugin); // Valentines Day new RainbowBlock(categories.valentinesDay, SlimefunItems.RAINBOW_WOOL_VALENTINE, RecipeType.ANCIENT_ALTAR, new ItemStack[] {new ItemStack(RED_DYE), new ItemStack(Material.POPPY), new ItemStack(Material.PINK_DYE), new ItemStack(Material.WHITE_WOOL), SlimefunItems.RAINBOW_RUNE, new ItemStack(Material.WHITE_WOOL), new ItemStack(Material.PINK_DYE), new ItemStack(Material.POPPY), new ItemStack(RED_DYE)}, - new CustomItem(SlimefunItems.RAINBOW_WOOL_VALENTINE, 2), new RainbowTicker(Material.MAGENTA_WOOL, Material.PINK_WOOL)) + new CustomItem(SlimefunItems.RAINBOW_WOOL_VALENTINE, 2), new RainbowTickHandler(Material.MAGENTA_WOOL, Material.PINK_WOOL)) .register(plugin); new RainbowBlock(categories.valentinesDay, SlimefunItems.RAINBOW_GLASS_VALENTINE, RecipeType.ANCIENT_ALTAR, new ItemStack[] {new ItemStack(RED_DYE), new ItemStack(Material.POPPY), new ItemStack(Material.PINK_DYE), new ItemStack(Material.WHITE_STAINED_GLASS), SlimefunItems.RAINBOW_RUNE, new ItemStack(Material.WHITE_STAINED_GLASS), new ItemStack(Material.PINK_DYE), new ItemStack(Material.POPPY), new ItemStack(RED_DYE)}, - new CustomItem(SlimefunItems.RAINBOW_GLASS_VALENTINE, 2), new RainbowTicker(Material.MAGENTA_STAINED_GLASS, Material.PINK_STAINED_GLASS)) + new CustomItem(SlimefunItems.RAINBOW_GLASS_VALENTINE, 2), new RainbowTickHandler(Material.MAGENTA_STAINED_GLASS, Material.PINK_STAINED_GLASS)) .register(plugin); new RainbowBlock(categories.valentinesDay, SlimefunItems.RAINBOW_GLASS_PANE_VALENTINE, RecipeType.ANCIENT_ALTAR, new ItemStack[] {new ItemStack(RED_DYE), new ItemStack(Material.POPPY), new ItemStack(Material.PINK_DYE), new ItemStack(Material.WHITE_STAINED_GLASS_PANE), SlimefunItems.RAINBOW_RUNE, new ItemStack(Material.WHITE_STAINED_GLASS_PANE), new ItemStack(Material.PINK_DYE), new ItemStack(Material.POPPY), new ItemStack(RED_DYE)}, - new CustomItem(SlimefunItems.RAINBOW_GLASS_PANE_VALENTINE, 2), new RainbowTicker(Material.MAGENTA_STAINED_GLASS_PANE, Material.PINK_STAINED_GLASS_PANE)) + new CustomItem(SlimefunItems.RAINBOW_GLASS_PANE_VALENTINE, 2), new RainbowTickHandler(Material.MAGENTA_STAINED_GLASS_PANE, Material.PINK_STAINED_GLASS_PANE)) .register(plugin); new RainbowBlock(categories.valentinesDay, SlimefunItems.RAINBOW_CLAY_VALENTINE, RecipeType.ANCIENT_ALTAR, new ItemStack[] {new ItemStack(RED_DYE), new ItemStack(Material.POPPY), new ItemStack(Material.PINK_DYE), new ItemStack(Material.WHITE_TERRACOTTA), SlimefunItems.RAINBOW_RUNE, new ItemStack(Material.WHITE_TERRACOTTA), new ItemStack(Material.PINK_DYE), new ItemStack(Material.POPPY), new ItemStack(RED_DYE)}, - new CustomItem(SlimefunItems.RAINBOW_CLAY_VALENTINE, 2), new RainbowTicker(Material.MAGENTA_TERRACOTTA, Material.PINK_TERRACOTTA)) + new CustomItem(SlimefunItems.RAINBOW_CLAY_VALENTINE, 2), new RainbowTickHandler(Material.MAGENTA_TERRACOTTA, Material.PINK_TERRACOTTA)) .register(plugin); new RainbowBlock(categories.valentinesDay, SlimefunItems.RAINBOW_CONCRETE_VALENTINE, RecipeType.ANCIENT_ALTAR, new ItemStack[] {new ItemStack(RED_DYE), new ItemStack(Material.POPPY), new ItemStack(Material.PINK_DYE), new ItemStack(Material.WHITE_CONCRETE), SlimefunItems.RAINBOW_RUNE, new ItemStack(Material.WHITE_CONCRETE), new ItemStack(Material.PINK_DYE), new ItemStack(Material.POPPY), new ItemStack(RED_DYE)}, - new CustomItem(SlimefunItems.RAINBOW_CONCRETE_VALENTINE, 2), new RainbowTicker(Material.MAGENTA_CONCRETE, Material.PINK_CONCRETE)) + new CustomItem(SlimefunItems.RAINBOW_CONCRETE_VALENTINE, 2), new RainbowTickHandler(Material.MAGENTA_CONCRETE, Material.PINK_CONCRETE)) .register(plugin); new RainbowBlock(categories.valentinesDay, SlimefunItems.RAINBOW_GLAZED_TERRACOTTA_VALENTINE, RecipeType.ANCIENT_ALTAR, new ItemStack[] {new ItemStack(RED_DYE), new ItemStack(Material.POPPY), new ItemStack(Material.PINK_DYE), new ItemStack(Material.WHITE_GLAZED_TERRACOTTA), SlimefunItems.RAINBOW_RUNE, new ItemStack(Material.WHITE_GLAZED_TERRACOTTA), new ItemStack(Material.PINK_DYE), new ItemStack(Material.POPPY), new ItemStack(RED_DYE)}, - new CustomItem(SlimefunItems.RAINBOW_GLAZED_TERRACOTTA_VALENTINE, 2), new RainbowTicker(Material.MAGENTA_GLAZED_TERRACOTTA, Material.PINK_GLAZED_TERRACOTTA)) + new CustomItem(SlimefunItems.RAINBOW_GLAZED_TERRACOTTA_VALENTINE, 2), new RainbowTickHandler(Material.MAGENTA_GLAZED_TERRACOTTA, Material.PINK_GLAZED_TERRACOTTA)) .register(plugin); // Halloween new RainbowBlock(categories.halloween, SlimefunItems.RAINBOW_WOOL_HALLOWEEN, RecipeType.ANCIENT_ALTAR, new ItemStack[] {new ItemStack(Material.ORANGE_DYE), new ItemStack(Material.PUMPKIN), new ItemStack(BLACK_DYE), new ItemStack(Material.WHITE_WOOL), SlimefunItems.RAINBOW_RUNE, new ItemStack(Material.WHITE_WOOL), new ItemStack(BLACK_DYE), new ItemStack(Material.PUMPKIN), new ItemStack(Material.ORANGE_DYE)}, - new CustomItem(SlimefunItems.RAINBOW_WOOL_HALLOWEEN, 2), new RainbowTicker(Material.ORANGE_WOOL, Material.BLACK_WOOL)) + new CustomItem(SlimefunItems.RAINBOW_WOOL_HALLOWEEN, 2), new RainbowTickHandler(Material.ORANGE_WOOL, Material.BLACK_WOOL)) .register(plugin); new RainbowBlock(categories.halloween, SlimefunItems.RAINBOW_GLASS_HALLOWEEN, RecipeType.ANCIENT_ALTAR, new ItemStack[] {new ItemStack(Material.ORANGE_DYE), new ItemStack(Material.PUMPKIN), new ItemStack(BLACK_DYE), new ItemStack(Material.WHITE_STAINED_GLASS), SlimefunItems.RAINBOW_RUNE, new ItemStack(Material.WHITE_STAINED_GLASS), new ItemStack(BLACK_DYE), new ItemStack(Material.PUMPKIN), new ItemStack(Material.ORANGE_DYE)}, - new CustomItem(SlimefunItems.RAINBOW_GLASS_HALLOWEEN, 2), new RainbowTicker(Material.ORANGE_STAINED_GLASS, Material.BLACK_STAINED_GLASS)) + new CustomItem(SlimefunItems.RAINBOW_GLASS_HALLOWEEN, 2), new RainbowTickHandler(Material.ORANGE_STAINED_GLASS, Material.BLACK_STAINED_GLASS)) .register(plugin); new RainbowBlock(categories.halloween, SlimefunItems.RAINBOW_GLASS_PANE_HALLOWEEN, RecipeType.ANCIENT_ALTAR, new ItemStack[] {new ItemStack(Material.ORANGE_DYE), new ItemStack(Material.PUMPKIN), new ItemStack(BLACK_DYE), new ItemStack(Material.WHITE_STAINED_GLASS_PANE), SlimefunItems.RAINBOW_RUNE, new ItemStack(Material.WHITE_STAINED_GLASS_PANE), new ItemStack(BLACK_DYE), new ItemStack(Material.PUMPKIN), new ItemStack(Material.ORANGE_DYE)}, - new CustomItem(SlimefunItems.RAINBOW_GLASS_PANE_HALLOWEEN, 2), new RainbowTicker(Material.ORANGE_STAINED_GLASS_PANE, Material.BLACK_STAINED_GLASS_PANE)) + new CustomItem(SlimefunItems.RAINBOW_GLASS_PANE_HALLOWEEN, 2), new RainbowTickHandler(Material.ORANGE_STAINED_GLASS_PANE, Material.BLACK_STAINED_GLASS_PANE)) .register(plugin); new RainbowBlock(categories.halloween, SlimefunItems.RAINBOW_CLAY_HALLOWEEN, RecipeType.ANCIENT_ALTAR, new ItemStack[] {new ItemStack(Material.ORANGE_DYE), new ItemStack(Material.PUMPKIN), new ItemStack(BLACK_DYE), new ItemStack(Material.WHITE_TERRACOTTA), SlimefunItems.RAINBOW_RUNE, new ItemStack(Material.WHITE_TERRACOTTA), new ItemStack(BLACK_DYE), new ItemStack(Material.PUMPKIN), new ItemStack(Material.ORANGE_DYE)}, - new CustomItem(SlimefunItems.RAINBOW_CLAY_HALLOWEEN, 2), new RainbowTicker(Material.ORANGE_TERRACOTTA, Material.BLACK_TERRACOTTA)) + new CustomItem(SlimefunItems.RAINBOW_CLAY_HALLOWEEN, 2), new RainbowTickHandler(Material.ORANGE_TERRACOTTA, Material.BLACK_TERRACOTTA)) .register(plugin); new RainbowBlock(categories.halloween, SlimefunItems.RAINBOW_CONCRETE_HALLOWEEN, RecipeType.ANCIENT_ALTAR, new ItemStack[] {new ItemStack(Material.ORANGE_DYE), new ItemStack(Material.PUMPKIN), new ItemStack(BLACK_DYE), new ItemStack(Material.WHITE_CONCRETE), SlimefunItems.RAINBOW_RUNE, new ItemStack(Material.WHITE_CONCRETE), new ItemStack(BLACK_DYE), new ItemStack(Material.PUMPKIN), new ItemStack(Material.ORANGE_DYE)}, - new CustomItem(SlimefunItems.RAINBOW_CONCRETE_HALLOWEEN, 2), new RainbowTicker(Material.ORANGE_CONCRETE, Material.BLACK_CONCRETE)) + new CustomItem(SlimefunItems.RAINBOW_CONCRETE_HALLOWEEN, 2), new RainbowTickHandler(Material.ORANGE_CONCRETE, Material.BLACK_CONCRETE)) .register(plugin); new RainbowBlock(categories.halloween, SlimefunItems.RAINBOW_GLAZED_TERRACOTTA_HALLOWEEN, RecipeType.ANCIENT_ALTAR, new ItemStack[] {new ItemStack(Material.ORANGE_DYE), new ItemStack(Material.PUMPKIN), new ItemStack(BLACK_DYE), new ItemStack(Material.WHITE_GLAZED_TERRACOTTA), SlimefunItems.RAINBOW_RUNE, new ItemStack(Material.WHITE_GLAZED_TERRACOTTA), new ItemStack(BLACK_DYE), new ItemStack(Material.PUMPKIN), new ItemStack(Material.ORANGE_DYE)}, - new CustomItem(SlimefunItems.RAINBOW_GLAZED_TERRACOTTA_HALLOWEEN, 2), new RainbowTicker(Material.ORANGE_GLAZED_TERRACOTTA, Material.BLACK_GLAZED_TERRACOTTA)) + new CustomItem(SlimefunItems.RAINBOW_GLAZED_TERRACOTTA_HALLOWEEN, 2), new RainbowTickHandler(Material.ORANGE_GLAZED_TERRACOTTA, Material.BLACK_GLAZED_TERRACOTTA)) .register(plugin); new WitherProofBlock(categories.technicalComponents, SlimefunItems.WITHER_PROOF_GLASS, RecipeType.ENHANCED_CRAFTING_TABLE, @@ -3020,12 +3048,13 @@ public final class SlimefunItemSetup { }.register(plugin); - new SlimefunItem(categories.technicalComponents, SlimefunItems.REACTOR_COOLANT_CELL, RecipeType.FREEZER, + new CoolantCell(categories.technicalComponents, SlimefunItems.REACTOR_COOLANT_CELL, RecipeType.FREEZER, new ItemStack[] {new ItemStack(Material.BLUE_ICE), null, null, null, null, null, null, null, null}) .register(plugin); - new SlimefunItem(categories.technicalComponents, SlimefunItems.NETHER_ICE_COOLANT_CELL, RecipeType.HEATED_PRESSURE_CHAMBER, - new ItemStack[] {SlimefunItems.ENRICHED_NETHER_ICE, null, null, null, null, null, null, null, null}) + new CoolantCell(categories.technicalComponents, SlimefunItems.NETHER_ICE_COOLANT_CELL, RecipeType.HEATED_PRESSURE_CHAMBER, + new ItemStack[] {SlimefunItems.ENRICHED_NETHER_ICE, null, null, null, null, null, null, null, null}, + new SlimefunItemStack(SlimefunItems.NETHER_ICE_COOLANT_CELL, 4)) .register(plugin); new RadioactiveItem(categories.resources, Radioactivity.HIGH, SlimefunItems.NEPTUNIUM, RecipeType.NUCLEAR_REACTOR, @@ -3229,6 +3258,12 @@ public final class SlimefunItemSetup { new WitherAssembler(categories.electricity, SlimefunItems.WITHER_ASSEMBLER, RecipeType.ENHANCED_CRAFTING_TABLE, new ItemStack[] {SlimefunItems.BLISTERING_INGOT_3, new ItemStack(Material.NETHER_STAR), SlimefunItems.BLISTERING_INGOT_3, SlimefunItems.WITHER_PROOF_OBSIDIAN, SlimefunItems.ANDROID_MEMORY_CORE, SlimefunItems.WITHER_PROOF_OBSIDIAN, SlimefunItems.ELECTRIC_MOTOR, SlimefunItems.REINFORCED_ALLOY_INGOT, SlimefunItems.CARBONADO_EDGED_CAPACITOR}) .register(plugin); + + if (SlimefunPlugin.getMinecraftVersion().isAtLeast(MinecraftVersion.MINECRAFT_1_14)) { + new TapeMeasure(categories.usefulItems, SlimefunItems.TAPE_MEASURE, RecipeType.ENHANCED_CRAFTING_TABLE, + new ItemStack[] {SlimefunItems.SILICON, new ItemStack(Material.YELLOW_DYE), SlimefunItems.SILICON, new ItemStack(Material.YELLOW_DYE), new ItemStack(Material.STRING), new ItemStack(Material.YELLOW_DYE), SlimefunItems.GILDED_IRON, new ItemStack(Material.YELLOW_DYE), SlimefunItems.SILICON}) + .register(plugin); + } } private static void registerArmorSet(Category category, ItemStack baseComponent, ItemStack[] items, String idSyntax, boolean vanilla, SlimefunAddon addon) { 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..837a34a5f 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; /** @@ -129,7 +129,7 @@ public class AncientAltarTask implements Runnable { itemLock.remove(item); item.remove(); - item.removeMetadata("no_pickup", SlimefunPlugin.instance); + item.removeMetadata("no_pickup", SlimefunPlugin.instance()); } } 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..51175dbd8 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,8 @@ import java.util.HashSet; 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; @@ -12,15 +14,15 @@ import org.bukkit.potion.PotionEffectType; import io.github.thebusybiscuit.slimefun4.api.items.HashedArmorpiece; import io.github.thebusybiscuit.slimefun4.api.player.PlayerProfile; +import io.github.thebusybiscuit.slimefun4.core.attributes.ProtectionType; 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; -import me.mrCookieSlime.Slimefun.api.energy.ItemEnergy; /** * The {@link ArmorTask} is responsible for handling {@link PotionEffect PotionEffects} for @@ -57,8 +59,12 @@ public class ArmorTask implements Runnable { HashedArmorpiece[] cachedArmor = profile.getArmor(); handleSlimefunArmor(p, armor, cachedArmor); - checkForSolarHelmet(p); - checkForRadiation(p); + + if (hasSunlight(p)) { + checkForSolarHelmet(p); + } + + checkForRadiation(p, profile); }); } } @@ -70,6 +76,7 @@ public class ArmorTask implements Runnable { if (armorpiece.hasDiverged(item)) { SlimefunItem sfItem = SlimefunItem.getByItem(item); + if (!(sfItem instanceof SlimefunArmorPiece) || !Slimefun.hasUnlocked(p, sfItem, true)) { sfItem = null; } @@ -89,38 +96,46 @@ public class ArmorTask implements Runnable { } private void checkForSolarHelmet(Player p) { - // Temporary performance improvement - if (!SlimefunUtils.isItemSimilar(p.getInventory().getHelmet(), SlimefunItems.SOLAR_HELMET, true)) { + 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(p.getInventory().getHelmet()); + SlimefunItem item = SlimefunItem.getByItem(helmet); - 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).rechargeItems(p); } } private boolean hasSunlight(Player p) { - return (p.getWorld().getTime() < 12300 || p.getWorld().getTime() > 23850) && p.getEyeLocation().getBlock().getLightFromSky() == 15; + 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; } - 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)) { + private void checkForRadiation(Player p, PlayerProfile profile) { + if (!profile.hasFullProtectionAgainst(ProtectionType.RADIATION)) { for (ItemStack item : p.getInventory()) { - if (isRadioactive(p, item)) { + if (checkAndApplyRadiation(p, item)) { break; } } } } - private boolean isRadioactive(Player p, ItemStack item) { + private boolean checkAndApplyRadiation(Player p, ItemStack item) { 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); @@ -133,5 +148,4 @@ public class ArmorTask implements Runnable { return false; } - } 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/implementation/tasks/PlayerTask.java b/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/tasks/PlayerTask.java index d6ec1122a..7f9f49fcc 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; @@ -18,11 +19,11 @@ abstract class PlayerTask implements Runnable { } public void schedule(long delay) { - setID(Bukkit.getScheduler().scheduleSyncDelayedTask(SlimefunPlugin.instance, this, delay)); + setID(Bukkit.getScheduler().scheduleSyncDelayedTask(SlimefunPlugin.instance(), this, delay)); } public void scheduleRepeating(long delay, long interval) { - setID(Bukkit.getScheduler().scheduleSyncRepeatingTask(SlimefunPlugin.instance, this, delay, interval)); + setID(Bukkit.getScheduler().scheduleSyncRepeatingTask(SlimefunPlugin.instance(), this, delay, interval)); } @Override 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..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 @@ -1,15 +1,18 @@ package io.github.thebusybiscuit.slimefun4.implementation.tasks; +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; /** * 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/io/github/thebusybiscuit/slimefun4/implementation/tasks/TickerTask.java b/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/tasks/TickerTask.java index 8d6dad860..722dd77a6 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 @@ -1,38 +1,23 @@ package io.github.thebusybiscuit.slimefun4.implementation.tasks; -import java.util.AbstractMap; -import java.util.Comparator; -import java.util.HashMap; import java.util.HashSet; import java.util.Iterator; -import java.util.List; -import java.util.Locale; import java.util.Map; -import java.util.Map.Entry; import java.util.Set; import java.util.concurrent.ConcurrentHashMap; -import java.util.concurrent.ConcurrentMap; -import java.util.function.Function; import java.util.logging.Level; -import java.util.stream.Collectors; -import java.util.stream.Stream; import org.bukkit.Bukkit; -import org.bukkit.ChatColor; -import org.bukkit.Chunk; import org.bukkit.Location; import org.bukkit.Material; +import org.bukkit.World; import org.bukkit.block.Block; -import org.bukkit.command.CommandSender; -import org.bukkit.entity.Player; -import io.github.thebusybiscuit.cscorelib2.chat.ChatColors; -import io.github.thebusybiscuit.cscorelib2.chat.json.ChatComponent; -import io.github.thebusybiscuit.cscorelib2.chat.json.HoverEvent; +import io.github.thebusybiscuit.cscorelib2.blocks.BlockPosition; import io.github.thebusybiscuit.slimefun4.api.ErrorReport; -import io.github.thebusybiscuit.slimefun4.utils.NumberUtils; +import io.github.thebusybiscuit.slimefun4.implementation.SlimefunPlugin; import io.github.thebusybiscuit.slimefun4.utils.PatternUtils; -import me.mrCookieSlime.Slimefun.SlimefunPlugin; +import me.mrCookieSlime.CSCoreLibPlugin.Configuration.Config; import me.mrCookieSlime.Slimefun.Objects.SlimefunItem.SlimefunItem; import me.mrCookieSlime.Slimefun.Objects.handlers.BlockTicker; import me.mrCookieSlime.Slimefun.api.BlockStorage; @@ -40,31 +25,14 @@ import me.mrCookieSlime.Slimefun.api.Slimefun; public class TickerTask implements Runnable { - private static final int VISIBILITY_THRESHOLD = 200_000; - private final Set tickers = new HashSet<>(); // These are "Queues" of blocks that need to be removed or moved - private final ConcurrentMap movingQueue = new ConcurrentHashMap<>(); - private final ConcurrentMap deletionQueue = new ConcurrentHashMap<>(); - - private final ConcurrentMap buggedBlocks = new ConcurrentHashMap<>(); - - private final ConcurrentMap blockTimings = new ConcurrentHashMap<>(); - private final ConcurrentMap machineCount = new ConcurrentHashMap<>(); - private final ConcurrentMap machineTimings = new ConcurrentHashMap<>(); - - private final ConcurrentMap chunkTimings = new ConcurrentHashMap<>(); - private final ConcurrentMap chunkItemCount = new ConcurrentHashMap<>(); - private final Set skippedChunks = new HashSet<>(); + private final Map movingQueue = new ConcurrentHashMap<>(); + private final Map deletionQueue = new ConcurrentHashMap<>(); + private final Map bugs = new ConcurrentHashMap<>(); private boolean halted = false; - - private int skippedBlocks = 0; - private int chunks = 0; - private int blocks = 0; - private long time = 0; - private boolean running = false; public void abortTick() { @@ -78,235 +46,117 @@ public class TickerTask implements Runnable { } running = true; - long timestamp = System.nanoTime(); + SlimefunPlugin.getProfiler().start(); - skippedBlocks = 0; - chunks = 0; - blocks = 0; - chunkItemCount.clear(); - machineCount.clear(); - time = 0; - chunkTimings.clear(); - skippedChunks.clear(); - machineTimings.clear(); - blockTimings.clear(); - - Map bugs = new HashMap<>(buggedBlocks); - buggedBlocks.clear(); - - Map removals = new HashMap<>(deletionQueue); - - for (Map.Entry entry : removals.entrySet()) { + Iterator> removals = deletionQueue.entrySet().iterator(); + while (removals.hasNext()) { + Map.Entry entry = removals.next(); BlockStorage._integrated_removeBlockInfo(entry.getKey(), entry.getValue()); - deletionQueue.remove(entry.getKey()); + removals.remove(); } if (!halted) { for (String chunk : BlockStorage.getTickingChunks()) { - long chunkTimestamp = System.nanoTime(); - chunks++; + try { + Set locations = BlockStorage.getTickingLocations(chunk); + String[] components = PatternUtils.SEMICOLON.split(chunk); - for (Location l : BlockStorage.getTickingLocations(chunk)) { - if (l.getWorld().isChunkLoaded(l.getBlockX() >> 4, l.getBlockZ() >> 4)) { - tick(l, chunk, bugs); - } - else { - skippedBlocks += BlockStorage.getTickingLocations(chunk).size(); - skippedChunks.add(chunk); - chunks--; - break; + World world = Bukkit.getWorld(components[0]); + int x = Integer.parseInt(components[components.length - 2]); + int z = Integer.parseInt(components[components.length - 1]); + + if (world != null && world.isChunkLoaded(x, z)) { + for (Location l : locations) { + tick(l); + } } } - - chunkTimings.put(chunk, System.nanoTime() - chunkTimestamp); + catch (ArrayIndexOutOfBoundsException | NumberFormatException x) { + Slimefun.getLogger().log(Level.SEVERE, x, () -> "An Exception has occured while trying to parse Chunk: " + chunk); + } } } - for (Map.Entry entry : movingQueue.entrySet()) { + Iterator> moves = movingQueue.entrySet().iterator(); + while (moves.hasNext()) { + Map.Entry entry = moves.next(); BlockStorage._integrated_moveLocationInfo(entry.getKey(), entry.getValue()); + moves.remove(); } - movingQueue.clear(); - Iterator iterator = tickers.iterator(); while (iterator.hasNext()) { iterator.next().startNewTick(); iterator.remove(); } - time = System.nanoTime() - timestamp; running = false; + SlimefunPlugin.getProfiler().stop(); } - private void tick(Location l, String tickedChunk, Map bugs) { - Block b = l.getBlock(); - SlimefunItem item = BlockStorage.check(l); + private void tick(Location l) { + Config data = BlockStorage.getLocationInfo(l); + SlimefunItem item = SlimefunItem.getByID(data.getString("id")); if (item != null && item.getBlockTicker() != null) { - blocks++; - try { + long timestamp = SlimefunPlugin.getProfiler().newEntry(); + Block b = l.getBlock(); item.getBlockTicker().update(); if (item.getBlockTicker().isSynchronized()) { - Slimefun.runSync(() -> { - try { - long timestamp = System.nanoTime(); - item.getBlockTicker().tick(b, item, BlockStorage.getLocationInfo(l)); - - long machinetime = NumberUtils.getLong(machineTimings.get(item.getID()), 0); - int chunk = NumberUtils.getInt(chunkItemCount.get(tickedChunk), 0); - int machine = NumberUtils.getInt(machineCount.get(item.getID()), 0); - - machineTimings.put(item.getID(), machinetime + (System.nanoTime() - timestamp)); - chunkItemCount.put(tickedChunk, chunk + 1); - machineCount.put(item.getID(), machine + 1); - blockTimings.put(l, System.nanoTime() - timestamp); - } - catch (Exception | LinkageError x) { - int errors = bugs.getOrDefault(l, 0); - reportErrors(l, item, x, errors); - } - }); + // We are ignoring the timestamp from above because synchronized actions + // are always ran with a 50ms delay (1 game tick) + Slimefun.runSync(() -> tickBlock(l, b, item, data, System.nanoTime())); } else { - long timestamp = System.nanoTime(); - item.getBlockTicker().tick(b, item, BlockStorage.getLocationInfo(l)); - - machineTimings.merge(item.getID(), (System.nanoTime() - timestamp), Long::sum); - chunkItemCount.merge(tickedChunk, 1, Integer::sum); - machineCount.merge(item.getID(), 1, Integer::sum); - blockTimings.put(l, System.nanoTime() - timestamp); + tickBlock(l, b, item, data, timestamp); } tickers.add(item.getBlockTicker()); } catch (Exception x) { - int errors = bugs.getOrDefault(l, 0); - reportErrors(l, item, x, errors); + reportErrors(l, item, x); } } - else { - skippedBlocks++; - } } - private void reportErrors(Location l, SlimefunItem item, Throwable x, int errors) { - errors++; + private void tickBlock(Location l, Block b, SlimefunItem item, Config data, long timestamp) { + try { + item.getBlockTicker().tick(b, item, data); + } + catch (Exception | LinkageError x) { + reportErrors(l, item, x); + } + finally { + SlimefunPlugin.getProfiler().closeEntry(l, item, timestamp); + } + } + + private void reportErrors(Location l, SlimefunItem item, Throwable x) { + BlockPosition position = new BlockPosition(l); + int errors = bugs.getOrDefault(position, 0) + 1; if (errors == 1) { // Generate a new Error-Report new ErrorReport(x, l, item); - buggedBlocks.put(l, errors); + bugs.put(position, errors); } else if (errors == 4) { Slimefun.getLogger().log(Level.SEVERE, "X: {0} Y: {1} Z: {2} ({3})", new Object[] { l.getBlockX(), l.getBlockY(), l.getBlockZ(), item.getID() }); Slimefun.getLogger().log(Level.SEVERE, "has thrown 4 error messages in the last 4 Ticks, the Block has been terminated."); Slimefun.getLogger().log(Level.SEVERE, "Check your /plugins/Slimefun/error-reports/ folder for details."); Slimefun.getLogger().log(Level.SEVERE, " "); + bugs.remove(position); BlockStorage._integrated_removeBlockInfo(l, true); - Bukkit.getScheduler().scheduleSyncDelayedTask(SlimefunPlugin.instance, () -> l.getBlock().setType(Material.AIR)); + Bukkit.getScheduler().scheduleSyncDelayedTask(SlimefunPlugin.instance(), () -> l.getBlock().setType(Material.AIR)); } else { - buggedBlocks.put(l, errors); + bugs.put(position, errors); } } - public String getTime() { - return NumberUtils.getAsMillis(time); - } - - public void info(CommandSender sender) { - sender.sendMessage(ChatColors.color("&2== &aSlimefun Diagnostic Tool &2==")); - sender.sendMessage(ChatColors.color("&6Halted: &e&l" + String.valueOf(halted).toUpperCase(Locale.ROOT))); - sender.sendMessage(""); - sender.sendMessage(ChatColors.color("&6Impact: &e" + NumberUtils.getAsMillis(time))); - sender.sendMessage(ChatColors.color("&6Ticked Chunks: &e" + chunks)); - sender.sendMessage(ChatColors.color("&6Ticked Machines: &e" + blocks)); - sender.sendMessage(ChatColors.color("&6Skipped Machines: &e" + skippedBlocks)); - sender.sendMessage(""); - sender.sendMessage(ChatColors.color("&6Ticking Machines:")); - - summarizeTimings(sender, entry -> { - int count = machineCount.get(entry.getKey()); - String timings = NumberUtils.getAsMillis(entry.getValue()); - String average = NumberUtils.getAsMillis(entry.getValue() / count); - - return entry.getKey() + " - " + count + "x (" + timings + ", " + average + " avg/machine)"; - }, machineCount.keySet().stream().map(key -> new AbstractMap.SimpleEntry<>(key, machineTimings.getOrDefault(key, 0L)))); - - sender.sendMessage(""); - sender.sendMessage(ChatColors.color("&6Ticking Chunks:")); - - summarizeTimings(sender, entry -> { - int count = chunkItemCount.getOrDefault(entry.getKey(), 0); - String timings = NumberUtils.getAsMillis(entry.getValue()); - - return formatChunk(entry.getKey()) + " - " + count + "x (" + timings + ")"; - }, chunkTimings.entrySet().stream().filter(entry -> !skippedChunks.contains(entry.getKey()))); - } - - private void summarizeTimings(CommandSender sender, Function, String> formatter, Stream> stream) { - List> timings = stream.sorted(Map.Entry.comparingByValue(Comparator.reverseOrder())).collect(Collectors.toList()); - - if (sender instanceof Player) { - ChatComponent component = new ChatComponent(ChatColors.color(" &7&oHover for more Info")); - StringBuilder builder = new StringBuilder(); - int hidden = 0; - - for (Map.Entry entry : timings) { - if (entry.getValue() > VISIBILITY_THRESHOLD) { - builder.append("\n&c").append(formatter.apply(entry)); - } - else { - hidden++; - } - } - - builder.append("\n\n&c+ &4").append(hidden).append(" Hidden"); - component.setHoverEvent(new HoverEvent(ChatColors.color(builder.toString()))); - - component.sendMessage((Player) sender); - } - else { - int hidden = 0; - - for (Map.Entry entry : timings) { - if (entry.getValue() > VISIBILITY_THRESHOLD) { - sender.sendMessage(" " + ChatColor.stripColor(formatter.apply(entry))); - } - else { - hidden++; - } - } - - sender.sendMessage("+ " + hidden + " Hidden"); - } - } - - private String formatChunk(String chunk) { - String[] components = PatternUtils.SEMICOLON.split(chunk); - return components[0] + " [" + components[2] + ',' + components[3] + ']'; - } - - public long getTimings(Block b) { - return blockTimings.getOrDefault(b.getLocation(), 0L); - } - - public long getTimings(String item) { - return machineTimings.getOrDefault(item, 0L); - } - - public long getTimings(Chunk c) { - String id = c.getWorld().getName() + ';' + c.getX() + ';' + c.getZ(); - return chunkTimings.getOrDefault(id, 0L); - } - - public void addBlockTimings(Location l, long time) { - blockTimings.put(l, time); - } - public boolean isHalted() { return halted; } @@ -317,7 +167,7 @@ public class TickerTask implements Runnable { @Override public String toString() { - return "TickerTask {\n" + " HALTED = " + halted + "\n" + " tickers = " + tickers + "\n" + " move = " + movingQueue + "\n" + " delete = " + deletionQueue + "\n" + " chunks = " + chunkItemCount + "\n" + " machines = " + machineCount + "\n" + " machinetime = " + machineTimings + "\n" + " chunktime = " + chunkTimings + "\n" + " skipped = " + skippedChunks + "\n" + "}"; + return "TickerTask {\n" + " HALTED = " + halted + "\n" + " tickers = " + tickers + "\n" + " move = " + movingQueue + "\n" + " delete = " + deletionQueue + "}"; } public void queueMove(Location from, Location to) { 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..143b7b3f5 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(""); } @@ -48,7 +48,7 @@ public final class ChatUtils { } public static void awaitInput(Player p, Consumer callback) { - ChatInput.waitForPlayer(SlimefunPlugin.instance, p, callback); + ChatInput.waitForPlayer(SlimefunPlugin.instance(), p, callback); } /** @@ -66,7 +66,7 @@ public final class ChatUtils { */ public static String humanize(String string) { StringBuilder builder = new StringBuilder(); - String[] segments = string.toLowerCase(Locale.ROOT).split("_"); + String[] segments = PatternUtils.UNDERSCORE.split(string.toLowerCase(Locale.ROOT)); builder.append(Character.toUpperCase(segments[0].charAt(0))).append(segments[0].substring(1)); 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 785deb4b9..22fb6b61b 100644 --- a/src/main/java/io/github/thebusybiscuit/slimefun4/utils/ChestMenuUtils.java +++ b/src/main/java/io/github/thebusybiscuit/slimefun4/utils/ChestMenuUtils.java @@ -6,6 +6,7 @@ import java.util.List; import org.bukkit.ChatColor; import org.bukkit.Material; import org.bukkit.entity.Player; +import org.bukkit.inventory.Inventory; import org.bukkit.inventory.ItemFlag; import org.bukkit.inventory.ItemStack; import org.bukkit.inventory.meta.Damageable; @@ -13,9 +14,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 +45,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 +69,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.RESET + "\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 +83,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.RESET + 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 + ")")); }); } @@ -100,6 +101,13 @@ public final class ChestMenuUtils { } public static void updateProgressbar(ChestMenu menu, int slot, int timeLeft, int time, ItemStack indicator) { + Inventory inv = menu.toInventory(); + + // We don't need to update the progress bar if noone is watching :o + if (inv == null || inv.getViewers().isEmpty()) { + return; + } + ItemStack item = indicator.clone(); ItemMeta im = item.getItemMeta(); im.addItemFlags(ItemFlag.HIDE_ATTRIBUTES); @@ -116,30 +124,25 @@ public final class ChestMenuUtils { } public static String getProgressBar(int time, int total) { - StringBuilder progress = new StringBuilder(); + StringBuilder builder = new StringBuilder(); float percentage = Math.round(((((total - time) * 100.0F) / total) * 100.0F) / 100.0F); - if (percentage < 16.0F) progress.append("&4"); - else if (percentage < 32.0F) progress.append("&c"); - else if (percentage < 48.0F) progress.append("&6"); - else if (percentage < 64.0F) progress.append("&e"); - else if (percentage < 80.0F) progress.append("&2"); - else progress.append("&a"); + builder.append(NumberUtils.getColorFromPercentage(percentage)); int rest = 20; for (int i = (int) percentage; i >= 5; i = i - 5) { - progress.append(':'); + builder.append(':'); rest--; } - progress.append("&7"); + builder.append("&7"); for (int i = 0; i < rest; i++) { - progress.append(':'); + builder.append(':'); } - progress.append(" - ").append(percentage).append('%'); - return ChatColors.color(progress.toString()); + builder.append(" - ").append(percentage).append('%'); + return ChatColors.color(builder.toString()); } private static short getDurability(ItemStack item, int timeLeft, int max) { 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/LoreBuilder.java b/src/main/java/io/github/thebusybiscuit/slimefun4/utils/LoreBuilder.java index 4ef841c4c..49d3ff06d 100644 --- a/src/main/java/io/github/thebusybiscuit/slimefun4/utils/LoreBuilder.java +++ b/src/main/java/io/github/thebusybiscuit/slimefun4/utils/LoreBuilder.java @@ -39,7 +39,7 @@ public final class LoreBuilder { } public static String powerCharged(int charge, int capacity) { - return "&c&o&8\u21E8 &e\u26A1 &7" + charge + " / " + capacity + " J"; + return "&8\u21E8 &e\u26A1 &7" + charge + " / " + capacity + " J"; } public static String material(String material) { 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..dbf6a0c74 100644 --- a/src/main/java/io/github/thebusybiscuit/slimefun4/utils/NumberUtils.java +++ b/src/main/java/io/github/thebusybiscuit/slimefun4/utils/NumberUtils.java @@ -69,17 +69,25 @@ public final class NumberUtils { } public static String getAsMillis(long nanoseconds) { - String number = DECIMAL_FORMAT.format(nanoseconds / 1000000.0); + if (nanoseconds == 0) { + return "0ms"; + } + + String number = roundDecimalNumber(nanoseconds / 1000000.0); String[] parts = PatternUtils.NUMBER_SEPERATOR.split(number); if (parts.length == 1) { - return parts[0]; + return parts[0] + "ms"; } else { - return parts[0] + ',' + ChatColor.GRAY + parts[1] + "ms"; + return parts[0] + '.' + parts[1] + "ms"; } } + public static String roundDecimalNumber(double number) { + return DECIMAL_FORMAT.format(number); + } + public static long getLong(Long value, long defaultValue) { return value == null ? defaultValue : value; } @@ -87,4 +95,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/io/github/thebusybiscuit/slimefun4/utils/PatternUtils.java b/src/main/java/io/github/thebusybiscuit/slimefun4/utils/PatternUtils.java index c79bae32e..cf61255d9 100644 --- a/src/main/java/io/github/thebusybiscuit/slimefun4/utils/PatternUtils.java +++ b/src/main/java/io/github/thebusybiscuit/slimefun4/utils/PatternUtils.java @@ -21,6 +21,7 @@ public final class PatternUtils { public static final Pattern COMMA = Pattern.compile(","); public static final Pattern SLASH_SEPARATOR = Pattern.compile(" / "); public static final Pattern DASH = Pattern.compile("-"); + public static final Pattern UNDERSCORE = Pattern.compile("_"); public static final Pattern ASCII = Pattern.compile("[A-Za-z \"_]+"); public static final Pattern ALPHANUMERIC = Pattern.compile("[A-Fa-f0-9]+"); public static final Pattern NUMERIC = Pattern.compile("[0-9]+"); 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..e73acbb3c 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; @@ -45,7 +45,7 @@ public final class SlimefunUtils { private static final String EMERALDENCHANTS_LORE = ChatColor.YELLOW.toString() + ChatColor.YELLOW.toString() + ChatColor.GRAY.toString(); private static final String NO_PICKUP_METADATA = "no_pickup"; - private static final NamespacedKey SOULBOUND_KEY = new NamespacedKey(SlimefunPlugin.instance, "soulbound"); + private static final NamespacedKey SOULBOUND_KEY = new NamespacedKey(SlimefunPlugin.instance(), "soulbound"); private static final String SOULBOUND_LORE = ChatColor.GRAY + "Soulbound"; private SlimefunUtils() {} @@ -72,7 +72,7 @@ public final class SlimefunUtils { * The context in which this {@link Item} was flagged */ public static void markAsNoPickup(Item item, String context) { - item.setMetadata(NO_PICKUP_METADATA, new FixedMetadataValue(SlimefunPlugin.instance, context)); + item.setMetadata(NO_PICKUP_METADATA, new FixedMetadataValue(SlimefunPlugin.instance(), context)); } /** @@ -188,7 +188,7 @@ public final class SlimefunUtils { * @return An {@link ItemStack} with this Head texture */ public static ItemStack getCustomHead(String texture) { - if (SlimefunPlugin.instance == null) { + if (SlimefunPlugin.instance() == null) { throw new PrematureCodeException("You cannot instantiate a custom head before Slimefun was loaded."); } diff --git a/src/main/java/me/mrCookieSlime/Slimefun/Lists/RecipeType.java b/src/main/java/me/mrCookieSlime/Slimefun/Lists/RecipeType.java index 5dddac6e0..fab7fceed 100644 --- a/src/main/java/me/mrCookieSlime/Slimefun/Lists/RecipeType.java +++ b/src/main/java/me/mrCookieSlime/Slimefun/Lists/RecipeType.java @@ -21,41 +21,41 @@ 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; public class RecipeType implements Keyed { - public static final RecipeType MULTIBLOCK = new RecipeType(new NamespacedKey(SlimefunPlugin.instance, "multiblock"), new CustomItem(Material.BRICKS, "&bMultiBlock", "", "&a&oBuild it in the World")); - public static final RecipeType ARMOR_FORGE = new RecipeType(new NamespacedKey(SlimefunPlugin.instance, "armor_forge"), SlimefunItems.ARMOR_FORGE, "", "&a&oCraft it in an Armor Forge"); - public static final RecipeType GRIND_STONE = new RecipeType(new NamespacedKey(SlimefunPlugin.instance, "grind_stone"), SlimefunItems.GRIND_STONE, "", "&a&oGrind it using the Grind Stone"); - public static final RecipeType SMELTERY = new RecipeType(new NamespacedKey(SlimefunPlugin.instance, "smeltery"), SlimefunItems.SMELTERY, "", "&a&oSmelt it using a Smeltery"); - public static final RecipeType ORE_CRUSHER = new RecipeType(new NamespacedKey(SlimefunPlugin.instance, "ore_crusher"), SlimefunItems.ORE_CRUSHER, "", "&a&oCrush it using the Ore Crusher"); - public static final RecipeType GOLD_PAN = new RecipeType(new NamespacedKey(SlimefunPlugin.instance, "gold_pan"), SlimefunItems.GOLD_PAN, "", "&a&oUse a Gold Pan on Gravel to obtain this Item"); - public static final RecipeType COMPRESSOR = new RecipeType(new NamespacedKey(SlimefunPlugin.instance, "compressor"), SlimefunItems.COMPRESSOR, "", "&a&oCompress it using the Compressor"); - public static final RecipeType PRESSURE_CHAMBER = new RecipeType(new NamespacedKey(SlimefunPlugin.instance, "pressure_chamber"), SlimefunItems.PRESSURE_CHAMBER, "", "&a&oCompress it using the Pressure Chamber"); - public static final RecipeType MAGIC_WORKBENCH = new RecipeType(new NamespacedKey(SlimefunPlugin.instance, "magic_workbench"), SlimefunItems.MAGIC_WORKBENCH, "", "&a&oCraft it in a Magic Workbench"); - public static final RecipeType ORE_WASHER = new RecipeType(new NamespacedKey(SlimefunPlugin.instance, "ore_washer"), SlimefunItems.ORE_WASHER, "", "&a&oWash it in an Ore Washer"); - public static final RecipeType ENHANCED_CRAFTING_TABLE = new RecipeType(new NamespacedKey(SlimefunPlugin.instance, "enhanced_crafting_table"), SlimefunItems.ENHANCED_CRAFTING_TABLE, "", "&a&oA regular Crafting Table cannot", "&a&ohold this massive Amount of Power..."); - public static final RecipeType JUICER = new RecipeType(new NamespacedKey(SlimefunPlugin.instance, "juicer"), SlimefunItems.JUICER, "", "&a&oUsed for Juice Creation"); + public static final RecipeType MULTIBLOCK = new RecipeType(new NamespacedKey(SlimefunPlugin.instance(), "multiblock"), new CustomItem(Material.BRICKS, "&bMultiBlock", "", "&a&oBuild it in the World")); + public static final RecipeType ARMOR_FORGE = new RecipeType(new NamespacedKey(SlimefunPlugin.instance(), "armor_forge"), SlimefunItems.ARMOR_FORGE, "", "&a&oCraft it in an Armor Forge"); + public static final RecipeType GRIND_STONE = new RecipeType(new NamespacedKey(SlimefunPlugin.instance(), "grind_stone"), SlimefunItems.GRIND_STONE, "", "&a&oGrind it using the Grind Stone"); + public static final RecipeType SMELTERY = new RecipeType(new NamespacedKey(SlimefunPlugin.instance(), "smeltery"), SlimefunItems.SMELTERY, "", "&a&oSmelt it using a Smeltery"); + public static final RecipeType ORE_CRUSHER = new RecipeType(new NamespacedKey(SlimefunPlugin.instance(), "ore_crusher"), SlimefunItems.ORE_CRUSHER, "", "&a&oCrush it using the Ore Crusher"); + public static final RecipeType GOLD_PAN = new RecipeType(new NamespacedKey(SlimefunPlugin.instance(), "gold_pan"), SlimefunItems.GOLD_PAN, "", "&a&oUse a Gold Pan on Gravel to obtain this Item"); + public static final RecipeType COMPRESSOR = new RecipeType(new NamespacedKey(SlimefunPlugin.instance(), "compressor"), SlimefunItems.COMPRESSOR, "", "&a&oCompress it using the Compressor"); + public static final RecipeType PRESSURE_CHAMBER = new RecipeType(new NamespacedKey(SlimefunPlugin.instance(), "pressure_chamber"), SlimefunItems.PRESSURE_CHAMBER, "", "&a&oCompress it using the Pressure Chamber"); + public static final RecipeType MAGIC_WORKBENCH = new RecipeType(new NamespacedKey(SlimefunPlugin.instance(), "magic_workbench"), SlimefunItems.MAGIC_WORKBENCH, "", "&a&oCraft it in a Magic Workbench"); + public static final RecipeType ORE_WASHER = new RecipeType(new NamespacedKey(SlimefunPlugin.instance(), "ore_washer"), SlimefunItems.ORE_WASHER, "", "&a&oWash it in an Ore Washer"); + public static final RecipeType ENHANCED_CRAFTING_TABLE = new RecipeType(new NamespacedKey(SlimefunPlugin.instance(), "enhanced_crafting_table"), SlimefunItems.ENHANCED_CRAFTING_TABLE, "", "&a&oA regular Crafting Table cannot", "&a&ohold this massive Amount of Power..."); + public static final RecipeType JUICER = new RecipeType(new NamespacedKey(SlimefunPlugin.instance(), "juicer"), SlimefunItems.JUICER, "", "&a&oUsed for Juice Creation"); - public static final RecipeType ANCIENT_ALTAR = new RecipeType(new NamespacedKey(SlimefunPlugin.instance, "ancient_altar"), SlimefunItems.ANCIENT_ALTAR, (recipe, output) -> { + public static final RecipeType ANCIENT_ALTAR = new RecipeType(new NamespacedKey(SlimefunPlugin.instance(), "ancient_altar"), SlimefunItems.ANCIENT_ALTAR, (recipe, output) -> { AltarRecipe altarRecipe = new AltarRecipe(Arrays.asList(recipe), output); SlimefunPlugin.getAncientAltarListener().getRecipes().add(altarRecipe); }); - public static final RecipeType MOB_DROP = new RecipeType(new NamespacedKey(SlimefunPlugin.instance, "mob_drop"), new CustomItem(Material.IRON_SWORD, "&bMob Drop"), RecipeType::registerMobDrop, "", "&rKill the specified Mob to obtain this Item"); + public static final RecipeType MOB_DROP = new RecipeType(new NamespacedKey(SlimefunPlugin.instance(), "mob_drop"), new CustomItem(Material.IRON_SWORD, "&bMob Drop"), RecipeType::registerMobDrop, "", "&rKill the specified Mob to obtain this Item"); - public static final RecipeType HEATED_PRESSURE_CHAMBER = new RecipeType(new NamespacedKey(SlimefunPlugin.instance, "heated_pressure_chamber"), SlimefunItems.HEATED_PRESSURE_CHAMBER); - public static final RecipeType FOOD_FABRICATOR = new RecipeType(new NamespacedKey(SlimefunPlugin.instance, "food_fabricator"), SlimefunItems.FOOD_FABRICATOR); - public static final RecipeType FOOD_COMPOSTER = new RecipeType(new NamespacedKey(SlimefunPlugin.instance, "food_composter"), SlimefunItems.FOOD_COMPOSTER); - public static final RecipeType FREEZER = new RecipeType(new NamespacedKey(SlimefunPlugin.instance, "freezer"), SlimefunItems.FREEZER); - public static final RecipeType REFINERY = new RecipeType(new NamespacedKey(SlimefunPlugin.instance, "refinery"), SlimefunItems.REFINERY); + public static final RecipeType HEATED_PRESSURE_CHAMBER = new RecipeType(new NamespacedKey(SlimefunPlugin.instance(), "heated_pressure_chamber"), SlimefunItems.HEATED_PRESSURE_CHAMBER); + public static final RecipeType FOOD_FABRICATOR = new RecipeType(new NamespacedKey(SlimefunPlugin.instance(), "food_fabricator"), SlimefunItems.FOOD_FABRICATOR); + public static final RecipeType FOOD_COMPOSTER = new RecipeType(new NamespacedKey(SlimefunPlugin.instance(), "food_composter"), SlimefunItems.FOOD_COMPOSTER); + public static final RecipeType FREEZER = new RecipeType(new NamespacedKey(SlimefunPlugin.instance(), "freezer"), SlimefunItems.FREEZER); + public static final RecipeType REFINERY = new RecipeType(new NamespacedKey(SlimefunPlugin.instance(), "refinery"), SlimefunItems.REFINERY); - public static final RecipeType GEO_MINER = new RecipeType(new NamespacedKey(SlimefunPlugin.instance, "geo_miner"), SlimefunItems.GEO_MINER); - public static final RecipeType NUCLEAR_REACTOR = new RecipeType(new NamespacedKey(SlimefunPlugin.instance, "nuclear_reactor"), SlimefunItems.NUCLEAR_REACTOR); + public static final RecipeType GEO_MINER = new RecipeType(new NamespacedKey(SlimefunPlugin.instance(), "geo_miner"), SlimefunItems.GEO_MINER); + public static final RecipeType NUCLEAR_REACTOR = new RecipeType(new NamespacedKey(SlimefunPlugin.instance(), "nuclear_reactor"), SlimefunItems.NUCLEAR_REACTOR); public static final RecipeType NULL = new RecipeType(); @@ -67,7 +67,7 @@ public class RecipeType implements Keyed { private RecipeType() { this.item = null; this.machine = ""; - this.key = new NamespacedKey(SlimefunPlugin.instance, "null"); + this.key = new NamespacedKey(SlimefunPlugin.instance(), "null"); } public RecipeType(ItemStack item, String machine) { @@ -75,10 +75,10 @@ public class RecipeType implements Keyed { this.machine = machine; if (machine.length() > 0) { - this.key = new NamespacedKey(SlimefunPlugin.instance, machine.toLowerCase(Locale.ROOT)); + this.key = new NamespacedKey(SlimefunPlugin.instance(), machine.toLowerCase(Locale.ROOT)); } else { - this.key = new NamespacedKey(SlimefunPlugin.instance, "unknown"); + this.key = new NamespacedKey(SlimefunPlugin.instance(), "unknown"); } } @@ -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() { @@ -149,22 +149,27 @@ public class RecipeType implements Keyed { SlimefunPlugin.getRegistry().getMobDrops().put(entity, dropping); } - @Deprecated public static List getRecipeInputs(MultiBlockMachine machine) { - if (machine == null) return new ArrayList<>(); + if (machine == null) { + return new ArrayList<>(); + } + List recipes = machine.getRecipes(); List convertible = new ArrayList<>(); for (int i = 0; i < recipes.size(); i++) { - if (i % 2 == 0) convertible.add(recipes.get(i)[0]); + if (i % 2 == 0) { + convertible.add(recipes.get(i)[0]); + } } return convertible; } - @Deprecated public static List getRecipeInputList(MultiBlockMachine machine) { - if (machine == null) return new ArrayList<>(); + if (machine == null) { + return new ArrayList<>(); + } List recipes = machine.getRecipes(); List convertible = new ArrayList<>(); @@ -190,13 +195,11 @@ public class RecipeType implements Keyed { return convertible; } - @Deprecated public static ItemStack getRecipeOutput(MultiBlockMachine machine, ItemStack input) { List recipes = machine.getRecipes(); return recipes.get(((getRecipeInputs(machine).indexOf(input) * 2) + 1))[0].clone(); } - @Deprecated public static ItemStack getRecipeOutputList(MultiBlockMachine machine, ItemStack[] input) { List recipes = machine.getRecipes(); return recipes.get((recipes.indexOf(input) + 1))[0]; diff --git a/src/main/java/me/mrCookieSlime/Slimefun/Lists/SlimefunItems.java b/src/main/java/me/mrCookieSlime/Slimefun/Lists/SlimefunItems.java index 844b29f52..4b8d21ea3 100644 --- a/src/main/java/me/mrCookieSlime/Slimefun/Lists/SlimefunItems.java +++ b/src/main/java/me/mrCookieSlime/Slimefun/Lists/SlimefunItems.java @@ -150,7 +150,7 @@ public final class SlimefunItems { public static final SlimefunItemStack SCUBA_HELMET = io.github.thebusybiscuit.slimefun4.implementation.SlimefunItems.SCUBA_HELMET; public static final SlimefunItemStack HAZMATSUIT_CHESTPLATE = io.github.thebusybiscuit.slimefun4.implementation.SlimefunItems.HAZMAT_CHESTPLATE; public static final SlimefunItemStack HAZMATSUIT_LEGGINGS = io.github.thebusybiscuit.slimefun4.implementation.SlimefunItems.HAZMAT_LEGGINGS; - public static final SlimefunItemStack RUBBER_BOOTS = io.github.thebusybiscuit.slimefun4.implementation.SlimefunItems.RUBBER_BOOTS; + public static final SlimefunItemStack RUBBER_BOOTS = io.github.thebusybiscuit.slimefun4.implementation.SlimefunItems.HAZMAT_BOOTS; public static final SlimefunItemStack GILDED_IRON_HELMET = io.github.thebusybiscuit.slimefun4.implementation.SlimefunItems.GILDED_IRON_HELMET; public static final SlimefunItemStack GILDED_IRON_CHESTPLATE = io.github.thebusybiscuit.slimefun4.implementation.SlimefunItems.GILDED_IRON_CHESTPLATE; public static final SlimefunItemStack GILDED_IRON_LEGGINGS = io.github.thebusybiscuit.slimefun4.implementation.SlimefunItems.GILDED_IRON_LEGGINGS; 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/ChargableItem.java b/src/main/java/me/mrCookieSlime/Slimefun/Objects/SlimefunItem/ChargableItem.java deleted file mode 100644 index 8430fa40b..000000000 --- a/src/main/java/me/mrCookieSlime/Slimefun/Objects/SlimefunItem/ChargableItem.java +++ /dev/null @@ -1,19 +0,0 @@ -package me.mrCookieSlime.Slimefun.Objects.SlimefunItem; - -import org.bukkit.inventory.ItemStack; - -import me.mrCookieSlime.Slimefun.Lists.RecipeType; -import me.mrCookieSlime.Slimefun.Objects.Category; -import me.mrCookieSlime.Slimefun.api.SlimefunItemStack; - -// We need to refactor this class some day... -// Add some methods or whatever, make it useful -// (And also fix the typo in the name) -@Deprecated -public class ChargableItem extends SlimefunItem { - - public ChargableItem(Category category, SlimefunItemStack item, RecipeType recipeType, ItemStack[] recipe) { - super(category, item, recipeType, recipe); - } - -} diff --git a/src/main/java/me/mrCookieSlime/Slimefun/Objects/SlimefunItem/SimpleSlimefunItem.java b/src/main/java/me/mrCookieSlime/Slimefun/Objects/SlimefunItem/SimpleSlimefunItem.java index a16a3898f..f90416c80 100644 --- a/src/main/java/me/mrCookieSlime/Slimefun/Objects/SlimefunItem/SimpleSlimefunItem.java +++ b/src/main/java/me/mrCookieSlime/Slimefun/Objects/SlimefunItem/SimpleSlimefunItem.java @@ -5,26 +5,16 @@ import org.bukkit.inventory.ItemStack; import me.mrCookieSlime.Slimefun.Lists.RecipeType; import me.mrCookieSlime.Slimefun.Objects.Category; import me.mrCookieSlime.Slimefun.Objects.handlers.ItemHandler; -import me.mrCookieSlime.Slimefun.Objects.handlers.ItemUseHandler; import me.mrCookieSlime.Slimefun.api.SlimefunItemStack; /** - * This is basically a quickstart class for your very first {@link SlimefunItem}. - * This class easily allows you to add one {@link ItemHandler} to your {@link SlimefunItem}. - * - * You could use an {@link ItemUseHandler} for example to give your {@link SlimefunItem} - * very basic right-click functionalities. - * - * @author TheBusyBiscuit - * - * @see ItemHandler - * @see ItemUseHandler - * @see SlimefunItem + * @deprecated Moved to {@link io.github.thebusybiscuit.slimefun4.implementation.items.SimpleSlimefunItem} * * @param - * The Type of {@link ItemHandler} to add to this {@link SlimefunItem} + * deprecated. */ -public abstract class SimpleSlimefunItem extends SlimefunItem { +@Deprecated +public abstract class SimpleSlimefunItem extends io.github.thebusybiscuit.slimefun4.implementation.items.SimpleSlimefunItem { public SimpleSlimefunItem(Category category, SlimefunItemStack item, RecipeType recipeType, ItemStack[] recipe) { super(category, item, recipeType, recipe); @@ -34,16 +24,4 @@ public abstract class SimpleSlimefunItem extends Slimefun super(category, item, recipeType, recipe, recipeOutput); } - @Override - public void preRegister() { - addItemHandler(getItemHandler()); - } - - /** - * This returns the {@link ItemHandler} that will be added to this {@link SlimefunItem}. - * - * @return The {@link ItemHandler} that should be added to this {@link SlimefunItem} - */ - public abstract T getItemHandler(); - } 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..4877a3161 100644 --- a/src/main/java/me/mrCookieSlime/Slimefun/Objects/SlimefunItem/SlimefunItem.java +++ b/src/main/java/me/mrCookieSlime/Slimefun/Objects/SlimefunItem/SlimefunItem.java @@ -19,25 +19,28 @@ import io.github.thebusybiscuit.cscorelib2.collections.OptionalMap; import io.github.thebusybiscuit.cscorelib2.inventory.ItemUtils; import io.github.thebusybiscuit.slimefun4.api.MinecraftVersion; import io.github.thebusybiscuit.slimefun4.api.SlimefunAddon; +import io.github.thebusybiscuit.slimefun4.api.SlimefunBranch; import io.github.thebusybiscuit.slimefun4.api.exceptions.IdConflictException; import io.github.thebusybiscuit.slimefun4.api.exceptions.IncompatibleItemHandlerException; import io.github.thebusybiscuit.slimefun4.api.exceptions.MissingDependencyException; import io.github.thebusybiscuit.slimefun4.api.exceptions.UnregisteredItemException; +import io.github.thebusybiscuit.slimefun4.api.exceptions.WrongItemStackException; import io.github.thebusybiscuit.slimefun4.api.items.ItemSetting; 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; +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; @@ -390,6 +393,7 @@ public class SlimefunItem implements Placeable { } state = ItemState.ENABLED; + checkForDeprecations(getClass()); useableInWorkbench = SlimefunPlugin.getItemCfg().getBoolean(id + ".can-be-used-in-workbenches"); hidden = SlimefunPlugin.getItemCfg().getBoolean(id + ".hide-in-guide"); @@ -406,6 +410,10 @@ public class SlimefunItem implements Placeable { state = ItemState.DISABLED; } + if (item instanceof SlimefunItemStack && isItemStackImmutable()) { + ((SlimefunItemStack) item).lock(); + } + postRegister(); if (SlimefunPlugin.getRegistry().isAutoLoadingEnabled() && state == ItemState.ENABLED) { @@ -425,6 +433,12 @@ public class SlimefunItem implements Placeable { if (exception.isPresent()) { throw exception.get(); } + else { + // Make developers or at least Server admins aware that + // an Item is using a deprecated ItemHandler + checkForDeprecations(handler.getClass()); + // A bit too spammy atm, will enable it again later + } if (!handler.isPrivate()) { Set handlerset = getPublicItemHandlers(handler.getIdentifier()); @@ -433,6 +447,58 @@ public class SlimefunItem implements Placeable { } } + /** + * This method returns whether the original {@link SlimefunItemStack} of this + * {@link SlimefunItem} is immutable. + * + * If true is returned, then any changes to the original {@link SlimefunItemStack} + * will be rejected with a {@link WrongItemStackException}. + * This ensures integrity so developers don't accidentally damage the wrong {@link ItemStack}. + * + * @return Whether the original {@link SlimefunItemStack} is immutable. + */ + protected boolean isItemStackImmutable() { + return true; + } + + /** + * This method checks recursively for all {@link Class} parents to look for any {@link Deprecated} + * elements. + * + * If a {@link Deprecated} element was found, a warning message will be printed. + * + * @param c + * The {@link Class} from which to start this operation. + */ + private void checkForDeprecations(Class c) { + if (SlimefunPlugin.getUpdater().getBranch() == SlimefunBranch.DEVELOPMENT) { + // This method is currently way too spammy with all the restructuring going on... + // Since DEV builds are anyway under "development", things may be relocated. + // So we fire these only for stable versions, since devs should update then, so + // it's the perfect moment to tell them to act. + return; + } + + // We do not wanna throw an Exception here since this could also mean that + // we have reached the end of the Class hierarchy + if (c != null) { + // Check if this Class is deprecated + if (c.isAnnotationPresent(Deprecated.class)) { + warn("The inherited Class \"" + c.getName() + "\" has been deprecated. Check the documentation for more details!"); + } + + for (Class parent : c.getInterfaces()) { + // Check if this Interface is deprecated + if (parent.isAnnotationPresent(Deprecated.class)) { + warn("The implemented Interface \"" + parent.getName() + "\" has been deprecated. Check the documentation for more details!"); + } + } + + // Recursively lookup the super class + checkForDeprecations(c.getSuperclass()); + } + } + /** * This method will set the {@link Research} of this {@link SlimefunItem}. * You don't have to call this method if your {@link SlimefunItem} was linked to your {@link Research} @@ -462,12 +528,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); @@ -542,8 +608,8 @@ 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"); + if (SlimefunPlugin.getRegistry().isBackwardsCompatible()) { + boolean loreInsensitive = this instanceof Rechargeable || this instanceof SlimefunBackpack || id.equals("BROKEN_SPAWNER") || id.equals("REINFORCED_SPAWNER"); return SlimefunUtils.isItemSimilar(item, this.item, !loreInsensitive); } else { @@ -764,6 +830,11 @@ public class SlimefunItem implements Placeable { public void warn(String message) { String msg = toString() + ": " + message; addon.getLogger().log(Level.WARNING, msg); + + if (addon.getBugTrackerURL() != null) { + // We can prompt the server operator to report it to the addon's bug tracker + addon.getLogger().log(Level.WARNING, "You can report this warning here: {0}", addon.getBugTrackerURL()); + } } /** @@ -804,19 +875,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()) { + if (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()) { diff --git a/src/main/java/me/mrCookieSlime/Slimefun/Objects/SlimefunItem/abstractItems/AContainer.java b/src/main/java/me/mrCookieSlime/Slimefun/Objects/SlimefunItem/abstractItems/AContainer.java index 2ce4d01c8..3a0cd7fd5 100644 --- a/src/main/java/me/mrCookieSlime/Slimefun/Objects/SlimefunItem/abstractItems/AContainer.java +++ b/src/main/java/me/mrCookieSlime/Slimefun/Objects/SlimefunItem/abstractItems/AContainer.java @@ -244,8 +244,11 @@ public abstract class AContainer extends SlimefunItem implements InventoryBlock, if (timeleft > 0) { ChestMenuUtils.updateProgressbar(inv, 22, timeleft, processing.get(b).getTicks(), getProgressBar()); - if (ChargableBlock.isChargable(b)) { - if (ChargableBlock.getCharge(b) < getEnergyConsumption()) return; + if (getCapacity() > 0) { + if (ChargableBlock.getCharge(b) < getEnergyConsumption()) { + return; + } + ChargableBlock.addCharge(b, -getEnergyConsumption()); progress.put(b, timeleft - 1); } 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..e745b3ecb 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,14 @@ 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 io.github.thebusybiscuit.slimefun4.utils.itemstack.ItemStackWrapper; 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; @@ -115,7 +116,7 @@ public abstract class AGenerator extends AbstractEnergyProvider { }); } - preset.addItem(22, new CustomItem(new ItemStack(Material.BLACK_STAINED_GLASS_PANE), " "), ChestMenuUtils.getEmptyClickHandler()); + preset.addItem(22, new CustomItem(Material.BLACK_STAINED_GLASS_PANE, " "), ChestMenuUtils.getEmptyClickHandler()); } @Override @@ -143,7 +144,7 @@ public abstract class AGenerator extends AbstractEnergyProvider { @Override public double generateEnergy(Location l, SlimefunItem sf, Config data) { BlockMenu inv = BlockStorage.getInventory(l); - boolean chargeable = ChargableBlock.isChargable(l); + boolean chargeable = getCapacity() > 0; int charge = chargeable ? ChargableBlock.getCharge(l) : 0; if (isProcessing(l)) { @@ -153,7 +154,7 @@ public abstract class AGenerator extends AbstractEnergyProvider { ChestMenuUtils.updateProgressbar(inv, 22, timeleft, processing.get(l).getTicks(), getProgressBar()); if (chargeable) { - if (ChargableBlock.getMaxCharge(l) - charge >= getEnergyProduction()) { + if (getCapacity() - charge >= getEnergyProduction()) { ChargableBlock.addCharge(l, getEnergyProduction()); progress.put(l, timeleft - 1); return (double) (charge + getEnergyProduction()); @@ -169,11 +170,11 @@ public abstract class AGenerator extends AbstractEnergyProvider { else { ItemStack fuel = processing.get(l).getInput(); - if (SlimefunUtils.isItemSimilar(fuel, new ItemStack(Material.LAVA_BUCKET), true) || SlimefunUtils.isItemSimilar(fuel, SlimefunItems.FUEL_BUCKET, true) || SlimefunUtils.isItemSimilar(fuel, SlimefunItems.OIL_BUCKET, true)) { + if (isBucket(fuel)) { inv.pushItem(new ItemStack(Material.BUCKET), getOutputSlots()); } - inv.replaceExistingItem(22, new CustomItem(new ItemStack(Material.BLACK_STAINED_GLASS_PANE), " ")); + inv.replaceExistingItem(22, new CustomItem(Material.BLACK_STAINED_GLASS_PANE, " ")); progress.remove(l); processing.remove(l); @@ -204,6 +205,15 @@ public abstract class AGenerator extends AbstractEnergyProvider { }; } + private boolean isBucket(ItemStack item) { + if (item == null) { + return false; + } + + ItemStackWrapper wrapper = new ItemStackWrapper(item); + return SlimefunUtils.isItemSimilar(wrapper, new ItemStack(Material.LAVA_BUCKET), true) || SlimefunUtils.isItemSimilar(wrapper, SlimefunItems.FUEL_BUCKET, true) || SlimefunUtils.isItemSimilar(wrapper, SlimefunItems.OIL_BUCKET, true); + } + private MachineFuel findRecipe(BlockMenu menu, Map found) { for (MachineFuel fuel : fuelTypes) { for (int slot : getInputSlots()) { 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/BlockBreakHandler.java b/src/main/java/me/mrCookieSlime/Slimefun/Objects/handlers/BlockBreakHandler.java index 72b1d1b7d..2b43d181d 100644 --- a/src/main/java/me/mrCookieSlime/Slimefun/Objects/handlers/BlockBreakHandler.java +++ b/src/main/java/me/mrCookieSlime/Slimefun/Objects/handlers/BlockBreakHandler.java @@ -1,17 +1,9 @@ package me.mrCookieSlime.Slimefun.Objects.handlers; -import java.util.List; +/** + * @deprecated Moved to {@link io.github.thebusybiscuit.slimefun4.core.handlers.BlockBreakHandler} + */ +@Deprecated +public interface BlockBreakHandler extends io.github.thebusybiscuit.slimefun4.core.handlers.BlockBreakHandler { -import org.bukkit.event.block.BlockBreakEvent; -import org.bukkit.inventory.ItemStack; - -@FunctionalInterface -public interface BlockBreakHandler extends ItemHandler { - - boolean onBlockBreak(BlockBreakEvent e, ItemStack item, int fortune, List drops); - - @Override - default Class getIdentifier() { - return BlockBreakHandler.class; - } } diff --git a/src/main/java/me/mrCookieSlime/Slimefun/Objects/handlers/ItemHandler.java b/src/main/java/me/mrCookieSlime/Slimefun/Objects/handlers/ItemHandler.java index 3b685fe40..ca6417ae4 100644 --- a/src/main/java/me/mrCookieSlime/Slimefun/Objects/handlers/ItemHandler.java +++ b/src/main/java/me/mrCookieSlime/Slimefun/Objects/handlers/ItemHandler.java @@ -3,6 +3,12 @@ package me.mrCookieSlime.Slimefun.Objects.handlers; import java.util.Optional; import io.github.thebusybiscuit.slimefun4.api.exceptions.IncompatibleItemHandlerException; +import io.github.thebusybiscuit.slimefun4.core.handlers.BlockUseHandler; +import io.github.thebusybiscuit.slimefun4.core.handlers.BowShootHandler; +import io.github.thebusybiscuit.slimefun4.core.handlers.EntityInteractHandler; +import io.github.thebusybiscuit.slimefun4.core.handlers.EntityKillHandler; +import io.github.thebusybiscuit.slimefun4.core.handlers.ItemConsumptionHandler; +import io.github.thebusybiscuit.slimefun4.core.handlers.ItemUseHandler; import me.mrCookieSlime.Slimefun.Objects.SlimefunItem.SlimefunItem; /** @@ -16,6 +22,7 @@ import me.mrCookieSlime.Slimefun.Objects.SlimefunItem.SlimefunItem; * @see BlockUseHandler * @see EntityKillHandler * @see EntityInteractHandler + * @see BowShootHandler */ @FunctionalInterface public interface ItemHandler { diff --git a/src/main/java/me/mrCookieSlime/Slimefun/Objects/handlers/ItemUseHandler.java b/src/main/java/me/mrCookieSlime/Slimefun/Objects/handlers/ItemUseHandler.java index 22aaa40d1..13c5653b2 100644 --- a/src/main/java/me/mrCookieSlime/Slimefun/Objects/handlers/ItemUseHandler.java +++ b/src/main/java/me/mrCookieSlime/Slimefun/Objects/handlers/ItemUseHandler.java @@ -1,36 +1,9 @@ package me.mrCookieSlime.Slimefun.Objects.handlers; -import org.bukkit.entity.Player; - -import io.github.thebusybiscuit.slimefun4.api.events.PlayerRightClickEvent; -import me.mrCookieSlime.Slimefun.Objects.SlimefunItem.SimpleSlimefunItem; -import me.mrCookieSlime.Slimefun.Objects.SlimefunItem.SlimefunItem; - /** - * This {@link ItemHandler} is triggered when the {@link SlimefunItem} it was assigned to - * is right-clicked. - * - * @author TheBusyBiscuit - * - * @see ItemHandler - * @see SimpleSlimefunItem - * + * @deprecated Moved to {@link io.github.thebusybiscuit.slimefun4.core.handlers.ItemUseHandler} */ -@FunctionalInterface -public interface ItemUseHandler extends ItemHandler { - - /** - * This function is triggered when a {@link Player} right clicks with the assigned {@link SlimefunItem} - * in his hand. - * - * @param e - * The {@link PlayerRightClickEvent} that was triggered - */ - void onRightClick(PlayerRightClickEvent e); - - @Override - default Class getIdentifier() { - return ItemUseHandler.class; - } +@Deprecated +public interface ItemUseHandler extends io.github.thebusybiscuit.slimefun4.core.handlers.ItemUseHandler { } diff --git a/src/main/java/me/mrCookieSlime/Slimefun/Objects/handlers/MultiBlockInteractionHandler.java b/src/main/java/me/mrCookieSlime/Slimefun/Objects/handlers/MultiBlockInteractionHandler.java index 7f68b1fb6..226f52ea3 100644 --- a/src/main/java/me/mrCookieSlime/Slimefun/Objects/handlers/MultiBlockInteractionHandler.java +++ b/src/main/java/me/mrCookieSlime/Slimefun/Objects/handlers/MultiBlockInteractionHandler.java @@ -1,44 +1,9 @@ package me.mrCookieSlime.Slimefun.Objects.handlers; -import java.util.Optional; - -import org.bukkit.block.Block; -import org.bukkit.entity.Player; - -import io.github.thebusybiscuit.slimefun4.api.exceptions.IncompatibleItemHandlerException; -import io.github.thebusybiscuit.slimefun4.core.multiblocks.MultiBlock; -import io.github.thebusybiscuit.slimefun4.core.multiblocks.MultiBlockMachine; -import me.mrCookieSlime.Slimefun.Objects.SlimefunItem.SlimefunItem; - /** - * This {@link ItemHandler} is called whenever a {@link Player} interacts with - * this {@link MultiBlock}. - * Note that this {@link MultiBlockInteractionHandler} should be assigned to - * a class that inherits from {@link MultiBlockMachine}. - * - * @author TheBusyBiscuit - * - * @see ItemHandler - * @see MultiBlock - * @see MultiBlockMachine - * + * @deprecated Moved to {@link io.github.thebusybiscuit.slimefun4.core.handlers.MultiBlockInteractionHandler} */ -@FunctionalInterface -public interface MultiBlockInteractionHandler extends ItemHandler { +@Deprecated +public interface MultiBlockInteractionHandler extends io.github.thebusybiscuit.slimefun4.core.handlers.MultiBlockInteractionHandler { - boolean onInteract(Player p, MultiBlock mb, Block b); - - @Override - default Optional validate(SlimefunItem item) { - if (!(item instanceof MultiBlockMachine)) { - return Optional.of(new IncompatibleItemHandlerException("Only classes inheriting 'MultiBlockMachine' can have a MultiBlockInteractionHandler", item, this)); - } - - return Optional.empty(); - } - - @Override - default Class getIdentifier() { - return MultiBlockInteractionHandler.class; - } } diff --git a/src/main/java/me/mrCookieSlime/Slimefun/SlimefunPlugin.java b/src/main/java/me/mrCookieSlime/Slimefun/SlimefunPlugin.java index f91cf72d5..36e8dc9e1 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.Set; -import java.util.logging.Level; -import java.util.stream.Collectors; -import org.bukkit.Bukkit; -import org.bukkit.Server; -import org.bukkit.World; -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,16 +20,7 @@ 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; @@ -65,570 +35,127 @@ import io.github.thebusybiscuit.slimefun4.implementation.listeners.ExplosionsLis 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); - - if (ticker != null) { - // 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(); - } - }); - - for (World world : Bukkit.getWorlds()) { - try { - BlockStorage storage = BlockStorage.getStorage(world); - - if (storage != null) { - storage.save(true); - } - else { - getLogger().log(Level.SEVERE, "Could not save Slimefun Blocks for World \"{0}\"", world.getName()); - } - } - catch (Exception x) { - getLogger().log(Level.SEVERE, x, () -> "An Error occured while saving Slimefun-Blocks in World '" + world.getName() + "' 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 occured while initializing SlimefunItems for Slimefun " + getVersion()); - } - } - - private void loadResearches() { - try { - ResearchSetup.setupResearches(); - } - catch (Exception | LinkageError x) { - getLogger().log(Level.SEVERE, x, () -> "An Error occured while initializing Slimefun Researches for Slimefun " + getVersion()); - } - } +@Deprecated +public final class SlimefunPlugin { + + private 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 9797a9bc8..c8900f942 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; @@ -47,6 +47,8 @@ public class BlockStorage { private static final String PATH_CHUNKS = "data-storage/Slimefun/stored-chunks/"; private static final String PATH_INVENTORIES = "data-storage/Slimefun/stored-inventories/"; + private static final EmptyBlockData emptyBlockData = new EmptyBlockData(); + private final World world; private final Map storage = new ConcurrentHashMap<>(); private final Map inventories = new ConcurrentHashMap<>(); @@ -97,6 +99,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; @@ -232,7 +238,7 @@ public class BlockStorage { } } catch (Exception x) { - Slimefun.getLogger().log(Level.SEVERE, x, () -> "An Error occured while loading this Block Inventory: " + file.getName()); + Slimefun.getLogger().log(Level.SEVERE, x, () -> "An Error occurred while loading this Block Inventory: " + file.getName()); } } } @@ -248,7 +254,7 @@ public class BlockStorage { } } catch (Exception x) { - Slimefun.getLogger().log(Level.SEVERE, x, () -> "An Error occured while loading this universal Inventory: " + file.getName()); + Slimefun.getLogger().log(Level.SEVERE, x, () -> "An Error occurred while loading this universal Inventory: " + file.getName()); } } } @@ -313,7 +319,7 @@ public class BlockStorage { Files.move(tmpFile.toPath(), cfg.getFile().toPath(), StandardCopyOption.ATOMIC_MOVE); } catch (IOException x) { - Slimefun.getLogger().log(Level.SEVERE, x, () -> "An Error occured while copying a temporary File for Slimefun " + SlimefunPlugin.getVersion()); + Slimefun.getLogger().log(Level.SEVERE, x, () -> "An Error occurred while copying a temporary File for Slimefun " + SlimefunPlugin.getVersion()); } } } @@ -358,7 +364,10 @@ public class BlockStorage { public static void store(Block block, ItemStack item) { SlimefunItem sfitem = SlimefunItem.getByItem(item); - if (sfitem != null) addBlockInfo(block, "id", sfitem.getID(), true); + + if (sfitem != null) { + addBlockInfo(block, "id", sfitem.getID(), true); + } } public static void store(Block block, String item) { @@ -377,19 +386,31 @@ public class BlockStorage { * @since 4.0 */ public static ItemStack retrieve(Block block) { - if (!hasBlockInfo(block)) return null; + if (!hasBlockInfo(block)) { + return null; + } else { - final SlimefunItem item = SlimefunItem.getByID(getLocationInfo(block.getLocation(), "id")); + SlimefunItem item = SlimefunItem.getByID(getLocationInfo(block.getLocation(), "id")); clearBlockInfo(block); - if (item == null) return null; - else return item.getItem(); + + if (item == null) { + return null; + } + else { + return item.getItem(); + } } } public static Config getLocationInfo(Location l) { BlockStorage storage = getStorage(l.getWorld()); + + if (storage == null) { + return emptyBlockData; + } + Config cfg = storage.storage.get(l); - return cfg == null ? new BlockInfoConfig() : cfg; + return cfg == null ? emptyBlockData : cfg; } private static Map parseJSON(String json) { @@ -418,7 +439,7 @@ public class BlockStorage { logger.log(Level.WARNING, ""); logger.log(Level.WARNING, "IGNORE THIS ERROR UNLESS IT IS SPAMMING"); logger.log(Level.WARNING, ""); - logger.log(Level.SEVERE, x, () -> "An Error occured while parsing Block Info for Slimefun " + SlimefunPlugin.getVersion()); + logger.log(Level.SEVERE, x, () -> "An Error occurred while parsing Block Info for Slimefun " + SlimefunPlugin.getVersion()); return null; } } @@ -460,7 +481,12 @@ public class BlockStorage { } public static void addBlockInfo(Location l, String key, String value, boolean updateTicker) { - Config cfg = hasBlockInfo(l) ? getLocationInfo(l) : new BlockInfoConfig(); + Config cfg = getLocationInfo(l); + + if (cfg == emptyBlockData) { + cfg = new BlockInfoConfig(); + } + cfg.setValue(key, value); setBlockInfo(l, cfg, updateTicker); } @@ -471,7 +497,14 @@ public class BlockStorage { public static boolean hasBlockInfo(Location l) { BlockStorage storage = getStorage(l.getWorld()); - return storage != null && storage.storage.containsKey(l) && getLocationInfo(l, "id") != null; + + if (storage != null) { + Config cfg = storage.storage.get(l); + return cfg != null && cfg.getString("id") != null; + } + else { + return false; + } } public static void setBlockInfo(Block block, Config cfg, boolean updateTicker) { @@ -480,8 +513,13 @@ public class BlockStorage { public static void setBlockInfo(Location l, Config cfg, boolean updateTicker) { BlockStorage storage = getStorage(l.getWorld()); - storage.storage.put(l, cfg); + if (storage == null) { + Slimefun.getLogger().warning("Could not set Block info for non-registered World '" + l.getWorld().getName() + "'. Is some plugin trying to store data in a fake world?"); + return; + } + + storage.storage.put(l, cfg); String id = cfg.getString("id"); if (BlockMenuPreset.isInventory(id)) { @@ -492,8 +530,13 @@ public class BlockStorage { } else if (!storage.hasInventory(l)) { File file = new File(PATH_INVENTORIES + serializeLocation(l) + ".sfi"); - if (file.exists()) storage.inventories.put(l, new BlockMenu(BlockMenuPreset.getPreset(id), l, new io.github.thebusybiscuit.cscorelib2.config.Config(file))); - else storage.loadInventory(l, BlockMenuPreset.getPreset(id)); + + if (file.exists()) { + storage.inventories.put(l, new BlockMenu(BlockMenuPreset.getPreset(id), l, new io.github.thebusybiscuit.cscorelib2.config.Config(file))); + } + else { + storage.loadInventory(l, BlockMenuPreset.getPreset(id)); + } } } @@ -506,7 +549,11 @@ public class BlockStorage { public static void setBlockInfo(Location l, String json, boolean updateTicker) { Config blockInfo = json == null ? new BlockInfoConfig() : parseBlockInfo(l, json); - if (blockInfo == null) return; + + if (blockInfo == null) { + return; + } + setBlockInfo(l, blockInfo, updateTicker); } @@ -523,7 +570,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) { @@ -564,7 +611,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) { @@ -573,8 +620,8 @@ public class BlockStorage { } BlockStorage storage = getStorage(from.getWorld()); - - setBlockInfo(to, getLocationInfo(from), true); + Config previousData = getLocationInfo(from); + setBlockInfo(to, previousData, true); if (storage.inventories.containsKey(from)) { BlockMenu menu = storage.inventories.get(from); @@ -583,7 +630,7 @@ public class BlockStorage { menu.move(to); } - refreshCache(storage, from, getLocationInfo(from).getString("id"), null, true); + refreshCache(storage, from, previousData.getString("id"), null, true); storage.storage.remove(from); String chunkString = locationToChunkString(from); @@ -619,11 +666,9 @@ public class BlockStorage { String chunkString = locationToChunkString(l); if (value != null) { - Set locations = SlimefunPlugin.getRegistry().getActiveTickers().get(chunkString); - if (locations == null) locations = new HashSet<>(); - + Set locations = SlimefunPlugin.getRegistry().getActiveTickers().computeIfAbsent(chunkString, c -> new HashSet<>()); locations.add(l); - SlimefunPlugin.getRegistry().getActiveTickers().put(chunkString, locations); + SlimefunPlugin.getRegistry().getActiveChunks().add(chunkString); } } @@ -677,7 +722,7 @@ public class BlockStorage { return id != null && id.equalsIgnoreCase(slimefunItem); } catch (Exception x) { - Slimefun.getLogger().log(Level.SEVERE, x, () -> "An Exception occured while checking " + new BlockPosition(l) + " for: \"" + slimefunItem + "\""); + Slimefun.getLogger().log(Level.SEVERE, x, () -> "An Exception occurred while checking " + new BlockPosition(l) + " for: \"" + slimefunItem + "\""); return false; } } @@ -780,7 +825,10 @@ public class BlockStorage { public static BlockMenu getInventory(Location l) { BlockStorage storage = getStorage(l.getWorld()); - if (storage == null) return null; + + if (storage == null) { + return null; + } BlockMenu menu = storage.inventories.get(l); @@ -795,7 +843,7 @@ public class BlockStorage { public static Config getChunkInfo(World world, int x, int z) { try { if (!isWorldRegistered(world.getName())) { - return new BlockInfoConfig(); + return emptyBlockData; } String key = serializeChunk(world, x, z); @@ -810,7 +858,7 @@ public class BlockStorage { } catch (Exception e) { Slimefun.getLogger().log(Level.SEVERE, e, () -> "Failed to parse ChunkInfo for Slimefun " + SlimefunPlugin.getVersion()); - return new BlockInfoConfig(); + return emptyBlockData; } } diff --git a/src/main/java/me/mrCookieSlime/Slimefun/api/EmptyBlockData.java b/src/main/java/me/mrCookieSlime/Slimefun/api/EmptyBlockData.java new file mode 100644 index 000000000..c1cae795b --- /dev/null +++ b/src/main/java/me/mrCookieSlime/Slimefun/api/EmptyBlockData.java @@ -0,0 +1,29 @@ +package me.mrCookieSlime.Slimefun.api; + +/** + * This package-private class is supposed to be used as a singleton fallback in places where a + * {@link NullPointerException} should be avoided, like {@link BlockStorage#getLocationInfo(org.bukkit.Location)}. + * + * This object is a read-only variant of {@link BlockInfoConfig} and only serves the purpose of + * performance and memory optimization. + * + * @author TheBusyBiscuit + * + */ +class EmptyBlockData extends BlockInfoConfig { + + EmptyBlockData() { + super(null); + } + + @Override + protected void store(String path, Object value) { + throw new UnsupportedOperationException("Cannot store values (" + path + ':' + value + " on a read-only data object!"); + } + + @Override + public String getString(String path) { + return null; + } + +} diff --git a/src/main/java/me/mrCookieSlime/Slimefun/api/Slimefun.java b/src/main/java/me/mrCookieSlime/Slimefun/api/Slimefun.java index 3e5644f9a..0b88f19dc 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; @@ -29,7 +29,7 @@ public final class Slimefun { private Slimefun() {} public static Logger getLogger() { - return SlimefunPlugin.instance.getLogger(); + return SlimefunPlugin.instance().getLogger(); } /** @@ -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; @@ -231,7 +231,11 @@ public final class Slimefun { return null; } - return Bukkit.getScheduler().runTask(SlimefunPlugin.instance, r); + if (SlimefunPlugin.instance() == null || !SlimefunPlugin.instance().isEnabled()) { + return null; + } + + return Bukkit.getScheduler().runTask(SlimefunPlugin.instance(), r); } public static BukkitTask runSync(Runnable r, long delay) { @@ -240,6 +244,10 @@ public final class Slimefun { return null; } - return Bukkit.getScheduler().runTaskLater(SlimefunPlugin.instance, r, delay); + if (SlimefunPlugin.instance() == null || !SlimefunPlugin.instance().isEnabled()) { + return null; + } + + return Bukkit.getScheduler().runTaskLater(SlimefunPlugin.instance(), r, delay); } } \ No newline at end of file diff --git a/src/main/java/me/mrCookieSlime/Slimefun/api/SlimefunItemStack.java b/src/main/java/me/mrCookieSlime/Slimefun/api/SlimefunItemStack.java index 6d7ed0e50..22c1ebd9a 100644 --- a/src/main/java/me/mrCookieSlime/Slimefun/api/SlimefunItemStack.java +++ b/src/main/java/me/mrCookieSlime/Slimefun/api/SlimefunItemStack.java @@ -24,9 +24,10 @@ 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.api.exceptions.WrongItemStackException; +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 { @@ -34,6 +35,7 @@ public class SlimefunItemStack extends CustomItem { private String id; private ImmutableItemMeta immutableMeta; + private boolean locked = false; private String texture = null; public SlimefunItemStack(String id, Material type, String name, String... lore) { @@ -148,7 +150,7 @@ public class SlimefunItemStack extends CustomItem { Validate.notNull(id, "The Item id must never be null!"); Validate.isTrue(id.equals(id.toUpperCase(Locale.ROOT)), "Slimefun Item Ids must be uppercase! (e.g. 'MY_ITEM_ID')"); - if (SlimefunPlugin.instance == null) { + if (SlimefunPlugin.instance() == null) { throw new PrematureCodeException("A SlimefunItemStack must never be be created before your Plugin was enabled."); } @@ -206,11 +208,34 @@ public class SlimefunItemStack extends CustomItem { @Override public boolean setItemMeta(ItemMeta meta) { + validate(); immutableMeta = new ImmutableItemMeta(meta); return super.setItemMeta(meta); } + @Override + public void setType(Material type) { + validate(); + super.setType(type); + } + + @Override + public void setAmount(int amount) { + validate(); + super.setAmount(amount); + } + + private void validate() { + if (locked) { + throw new WrongItemStackException(id + " is not mutable."); + } + } + + public void lock() { + locked = true; + } + @Override public ItemStack clone() { return new SlimefunItemStack(id, this); @@ -244,5 +269,4 @@ public class SlimefunItemStack extends CustomItem { throw new IllegalArgumentException("The provided texture for Item \"" + id + "\" does not seem to be a valid texture String!"); } } - } 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..8558ca0c8 100644 --- a/src/main/java/me/mrCookieSlime/Slimefun/api/energy/ChargableBlock.java +++ b/src/main/java/me/mrCookieSlime/Slimefun/api/energy/ChargableBlock.java @@ -5,14 +5,15 @@ 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; public final class ChargableBlock { + private static final String KEY = "energy-charge"; + private ChargableBlock() {} public static boolean isChargable(Block b) { @@ -20,11 +21,13 @@ public final class ChargableBlock { } public static boolean isChargable(Location l) { - if (!BlockStorage.hasBlockInfo(l)) { + String id = BlockStorage.checkID(l); + + if (id == null) { return false; } - return SlimefunPlugin.getRegistry().getEnergyCapacities().containsKey(BlockStorage.checkID(l)); + return SlimefunPlugin.getRegistry().getEnergyCapacities().containsKey(id); } public static int getCharge(Block b) { @@ -32,41 +35,40 @@ public final class ChargableBlock { } public static int getCharge(Location l) { - String charge = BlockStorage.getLocationInfo(l, "energy-charge"); + String charge = BlockStorage.getLocationInfo(l, KEY); if (charge != null) { return Integer.parseInt(charge); } else { - BlockStorage.addBlockInfo(l, "energy-charge", "0", false); + BlockStorage.addBlockInfo(l, KEY, "0", false); return 0; } } - public static void setCharge(Block b, int charge) { - setCharge(b.getLocation(), charge); - } - public static void setCharge(Location l, int charge) { if (charge < 0) { charge = 0; } else { int capacity = getMaxCharge(l); - if (charge > capacity) charge = capacity; + + if (charge > capacity) { + charge = capacity; + } } if (charge != getCharge(l)) { - BlockStorage.addBlockInfo(l, "energy-charge", String.valueOf(charge), false); + BlockStorage.addBlockInfo(l, KEY, String.valueOf(charge), false); } } public static void setUnsafeCharge(Location l, int charge, boolean updateTexture) { if (charge != getCharge(l)) { - BlockStorage.addBlockInfo(l, "energy-charge", String.valueOf(charge), false); + BlockStorage.addBlockInfo(l, KEY, String.valueOf(charge), false); if (updateTexture) { - updateCapacitor(l); + updateCapacitor(l, charge, getMaxCharge(l)); } } } @@ -75,50 +77,60 @@ public final class ChargableBlock { return addCharge(b.getLocation(), charge); } - public static int addCharge(Location l, int charge) { - int energy = getCharge(l); - int space = getMaxCharge(l) - energy; - int rest = charge; + public static int addCharge(Location l, int addedCharge) { + String id = BlockStorage.checkID(l); - if (space > 0 && charge > 0) { - if (space > charge) { - setCharge(l, energy + charge); + if (id == null) { + BlockStorage.clearBlockInfo(l); + return 0; + } + + int capacity = SlimefunPlugin.getRegistry().getEnergyCapacities().getOrDefault(id, 0); + + int charge = getCharge(l); + int availableSpace = capacity - charge; + int rest = addedCharge; + + if (availableSpace > 0 && addedCharge > 0) { + if (availableSpace > addedCharge) { + charge += addedCharge; rest = 0; } else { - rest = charge - space; - setCharge(l, getMaxCharge(l)); + rest = addedCharge - availableSpace; + charge = capacity; } - if (SlimefunPlugin.getRegistry().getEnergyCapacitors().contains(BlockStorage.checkID(l))) { - updateCapacitor(l); + setCharge(l, charge); + + if (SlimefunPlugin.getRegistry().getEnergyCapacitors().contains(id)) { + updateCapacitor(l, charge, capacity); } } - else if (charge < 0 && energy >= -charge) { - setCharge(l, energy + charge); + else if (addedCharge < 0 && charge >= -addedCharge) { + charge += addedCharge; + setCharge(l, charge); - if (SlimefunPlugin.getRegistry().getEnergyCapacitors().contains(BlockStorage.checkID(l))) { - updateCapacitor(l); + if (SlimefunPlugin.getRegistry().getEnergyCapacitors().contains(id)) { + updateCapacitor(l, charge, capacity); } } return rest; } - private static void updateCapacitor(Location l) { + private static void updateCapacitor(Location l, int charge, int capacity) { Slimefun.runSync(() -> { Block b = l.getBlock(); - int charge = getCharge(b); - int capacity = getMaxCharge(b); if (b.getType() == Material.PLAYER_HEAD || b.getType() == Material.PLAYER_WALL_HEAD) { - if (charge < (int) (capacity * 0.25D)) { + if (charge < (int) (capacity * 0.25)) { SkullBlock.setFromHash(b, HeadTexture.CAPACITOR_25.getTexture()); } - else if (charge < (int) (capacity * 0.5D)) { + else if (charge < (int) (capacity * 0.5)) { SkullBlock.setFromHash(b, HeadTexture.CAPACITOR_50.getTexture()); } - else if (charge < (int) (capacity * 0.75D)) { + else if (charge < (int) (capacity * 0.75)) { SkullBlock.setFromHash(b, HeadTexture.CAPACITOR_75.getTexture()); } else { @@ -133,23 +145,14 @@ public final class ChargableBlock { } public static int getMaxCharge(Location l) { - Config cfg = BlockStorage.getLocationInfo(l); + String id = BlockStorage.checkID(l); - if (!cfg.contains("id")) { + if (id == null) { BlockStorage.clearBlockInfo(l); return 0; } - String str = cfg.getString("energy-capacity"); - - if (str != null) { - return Integer.parseInt(str); - } - else { - int capacity = SlimefunPlugin.getRegistry().getEnergyCapacities().get(cfg.getString("id")); - BlockStorage.addBlockInfo(l, "energy-capacity", String.valueOf(capacity), false); - return capacity; - } + return SlimefunPlugin.getRegistry().getEnergyCapacities().getOrDefault(id, 0); } } diff --git a/src/main/java/me/mrCookieSlime/Slimefun/api/energy/ItemEnergy.java b/src/main/java/me/mrCookieSlime/Slimefun/api/energy/ItemEnergy.java deleted file mode 100644 index 6ec6ce360..000000000 --- a/src/main/java/me/mrCookieSlime/Slimefun/api/energy/ItemEnergy.java +++ /dev/null @@ -1,109 +0,0 @@ -package me.mrCookieSlime.Slimefun.api.energy; - -import java.math.BigDecimal; -import java.math.RoundingMode; -import java.util.List; - -import org.bukkit.Material; -import org.bukkit.entity.Player; -import org.bukkit.inventory.ItemStack; -import org.bukkit.inventory.meta.ItemMeta; - -import io.github.thebusybiscuit.cscorelib2.chat.ChatColors; -import io.github.thebusybiscuit.slimefun4.utils.PatternUtils; - -public final class ItemEnergy { - - // We should find a replacement for this class - // Perhaps we could also use PersistentData here too? - private ItemEnergy() {} - - // "&c&o&8\u21E8 &e\u26A1 &70 / 50 J" - - public static float getStoredEnergy(ItemStack item) { - if (item == null || item.getType() == Material.AIR || item.getAmount() < 1) return 0F; - if (!item.hasItemMeta() || !item.getItemMeta().hasLore()) return 0F; - - for (String line : item.getItemMeta().getLore()) { - if (line.startsWith(ChatColors.color("&c&o&8\u21E8 &e\u26A1 &7")) && line.contains(" / ") && line.endsWith(" J")) { - return Float.parseFloat(PatternUtils.SLASH_SEPARATOR.split(line)[0].replace(ChatColors.color("&c&o&8\u21E8 &e\u26A1 &7"), "")); - } - } - - return 0F; - } - - public static float getMaxEnergy(ItemStack item) { - if (item == null || item.getType() == Material.AIR || item.getAmount() < 1) return 0F; - if (!item.hasItemMeta() || !item.getItemMeta().hasLore()) return 0F; - - for (String line : item.getItemMeta().getLore()) { - if (line.startsWith(ChatColors.color("&c&o&8\u21E8 &e\u26A1 &7")) && line.contains(" / ") && line.endsWith(" J")) { - return Float.parseFloat(PatternUtils.SLASH_SEPARATOR.split(line)[1].replace(" J", "")); - } - } - - return 0F; - } - - public static float addStoredEnergy(ItemStack item, float energy) { - if (item == null || item.getType() == Material.AIR || item.getAmount() < 1) return 0F; - if (!item.hasItemMeta() || !item.getItemMeta().hasLore()) return 0; - - float rest = 0F; - float capacity = getMaxEnergy(item); - - if ((int) capacity == 0) { - return rest; - } - - float stored = getStoredEnergy(item); - - if (stored + energy > capacity) { - rest = (stored + energy) - capacity; - stored = capacity; - } - else if (stored + energy < 0) { - stored = 0F; - } - else { - stored = stored + energy; - } - - List lore = item.getItemMeta().getLore(); - - int index = -1; - for (int i = 0; i < lore.size(); i++) { - String line = lore.get(i); - - if (line.startsWith(ChatColors.color("&c&o&8\u21E8 &e\u26A1 &7")) && line.contains(" / ") && line.endsWith(" J")) { - index = i; - break; - } - } - - BigDecimal decimal = BigDecimal.valueOf(stored).setScale(2, RoundingMode.HALF_UP); - - lore.set(index, ChatColors.color("&c&o&8\u21E8 &e\u26A1 &7") + decimal.floatValue() + " / " + capacity + " J"); - - ItemMeta im = item.getItemMeta(); - im.setLore(lore); - item.setItemMeta(im); - return rest; - } - - public static ItemStack chargeItem(ItemStack item, float energy) { - addStoredEnergy(item, energy); - return item; - } - - public static void chargeInventory(Player p, float energy) { - p.getInventory().setItemInMainHand(chargeItem(p.getInventory().getItemInMainHand(), energy)); - p.getInventory().setItemInOffHand(chargeItem(p.getInventory().getItemInOffHand(), energy)); - p.getInventory().setHelmet(chargeItem(p.getInventory().getHelmet(), energy)); - p.getInventory().setChestplate(chargeItem(p.getInventory().getChestplate(), energy)); - p.getInventory().setLeggings(chargeItem(p.getInventory().getLeggings(), energy)); - p.getInventory().setBoots(chargeItem(p.getInventory().getBoots(), energy)); - } - -} 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 48937ae2a..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; @@ -196,7 +196,7 @@ public abstract class BlockMenuPreset extends ChestMenu { newInstance(menu, l.getBlock()); } catch (Exception | LinkageError x) { - getSlimefunItem().error("An eror occured while trying to create a BlockMenu", x); + getSlimefunItem().error("An Error occurred while trying to create a BlockMenu", x); } }); } diff --git a/src/main/java/me/mrCookieSlime/Slimefun/api/inventory/DirtyChestMenu.java b/src/main/java/me/mrCookieSlime/Slimefun/api/inventory/DirtyChestMenu.java index 6703fa951..f89bef612 100644 --- a/src/main/java/me/mrCookieSlime/Slimefun/api/inventory/DirtyChestMenu.java +++ b/src/main/java/me/mrCookieSlime/Slimefun/api/inventory/DirtyChestMenu.java @@ -6,6 +6,7 @@ import org.bukkit.Material; import org.bukkit.block.Block; import org.bukkit.entity.HumanEntity; import org.bukkit.entity.Player; +import org.bukkit.inventory.Inventory; import org.bukkit.inventory.ItemStack; import io.github.thebusybiscuit.cscorelib2.inventory.InvUtils; @@ -26,6 +27,16 @@ public class DirtyChestMenu extends ChestMenu { this.preset = preset; } + /** + * This method checks whether this {@link DirtyChestMenu} is currently viewed by a {@link Player}. + * + * @return Whether anyone is currently viewing this {@link Inventory} + */ + public boolean hasViewer() { + Inventory inv = toInventory(); + return inv != null && !inv.getViewers().isEmpty(); + } + public void markDirty() { changes++; } diff --git a/src/main/resources/languages/categories_id.yml b/src/main/resources/languages/categories_id.yml index d6a335dc6..447af2e93 100644 --- a/src/main/resources/languages/categories_id.yml +++ b/src/main/resources/languages/categories_id.yml @@ -2,10 +2,10 @@ slimefun: weapons: Senjata tools: Peralatan - items: Alat Penting + items: Barang yang Berguna food: Makanan basic_machines: Mesin Dasar - electricity: Energi Dan Listrik + electricity: Energi dan Listrik gps: Mesin - Mesin GPS armor: Baju Zirah magical_items: Benda Sihir @@ -13,13 +13,14 @@ slimefun: misc: Lain - Lain technical_gadgets: Alat Teknis resources: Sumber Daya - cargo: Pengatur Muatan + cargo: Manajemen Kargo tech_misc: Komponen Teknis magical_armor: Pakaian Sihir talismans: Jimat (Tingkat I) ender_talismans: Jimat Ender (Tingkat II) christmas: Natal (Desember) valentines_day: Hari Valentine (14 Februari) - easter: Easter (April) + easter: Paskah (April) birthday: Ulang Tahun TheBusyBiscuit (26 Oktober) halloween: Halloween (31 Oktober) + androids: Mesin Berprogram diff --git a/src/main/resources/languages/categories_pl.yml b/src/main/resources/languages/categories_pl.yml index 503164073..47bda5b42 100644 --- a/src/main/resources/languages/categories_pl.yml +++ b/src/main/resources/languages/categories_pl.yml @@ -23,3 +23,4 @@ slimefun: easter: Wielkanoc (Kwiecień) birthday: Urodziny TheBusyBiscuit (26 Października) halloween: Halloween (31 Października) + androids: Programowalne Androidy diff --git a/src/main/resources/languages/categories_pt-BR.yml b/src/main/resources/languages/categories_pt-BR.yml index c974e0b87..c50ef575a 100644 --- a/src/main/resources/languages/categories_pt-BR.yml +++ b/src/main/resources/languages/categories_pt-BR.yml @@ -23,3 +23,4 @@ slimefun: easter: Páscoa (abril) birthday: Aniversário do TheBusyBiscuit (26 de outubro) halloween: Halloween (31 de outubro) + androids: Robôs e programação diff --git a/src/main/resources/languages/categories_tl.yml b/src/main/resources/languages/categories_tl.yml index 8503ddf9d..4b114b10e 100644 --- a/src/main/resources/languages/categories_tl.yml +++ b/src/main/resources/languages/categories_tl.yml @@ -23,4 +23,4 @@ slimefun: easter: Mahal na Araw (Abril) birthday: Ang Kaarawan ni TheBusyBiscuit (26th Oktubre) halloween: Undas (31st Oktubre) - androids: Mga Androids na Maipoprograma + androids: Mga Programmable Androids diff --git a/src/main/resources/languages/categories_tr.yml b/src/main/resources/languages/categories_tr.yml index 087c54c33..cd7389270 100644 --- a/src/main/resources/languages/categories_tr.yml +++ b/src/main/resources/languages/categories_tr.yml @@ -1,25 +1,26 @@ --- slimefun: weapons: Silahlar + tools: Aletler + items: Yararlı Eşyalar food: Yemek basic_machines: Temel Makineler electricity: Enerji ve Elektrik gps: GPS Tabanlı Makineler armor: Zırh magical_items: Büyülü Eşyalar + magical_gadgets: Büyülü Cihazlar misc: Çeşitli Eşyalar + technical_gadgets: Teknik Cihazlar resources: Kaynaklar cargo: Kargo Yönetimi + tech_misc: Teknik Bileşenler magical_armor: Büyülü Zırh talismans: Tılsımlar (Seviye I) ender_talismans: Ender Tılsımları (Seviye II) christmas: Noel (Aralık) valentines_day: Sevgililer Günü (14 Şubat) easter: Paskalya (Nisan) - halloween: Cadılar Bayramı (31 Ekim) - tools: Aletler - items: Yararlı Eşyalar - magical_gadgets: Büyülü Cihazlar - technical_gadgets: Teknik Cihazlar - tech_misc: Teknik Bileşenler birthday: TheBusyBiscuit'ün doğum günü (26 Ekim) + halloween: Cadılar Bayramı (31 Ekim) + androids: Programlanabilir Androidler 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: 可編輯的機器人 diff --git a/src/main/resources/languages/messages_en.yml b/src/main/resources/languages/messages_en.yml index e0a84ce44..b0f3a213b 100644 --- a/src/main/resources/languages/messages_en.yml +++ b/src/main/resources/languages/messages_en.yml @@ -129,10 +129,21 @@ messages: soulbound-rune: fail: '&cYou can only bind one item to your soul at a time.' success: '&aYou have successfully bound this item to your soul! You will keep it when you die.' + + enchantment-rune: + fail: '&cYou cannot enchant this item.' + no-enchantment: '&cCouldn''t find any applicable enchantment for this item.' + success: '&aYou have successfully applied a random applicable enchantment to this item.' research: start: '&7The Ancient Spirits whisper mysterious words into your ear!' progress: '&7You start to wonder about &b%research% &e(%progress%)' + + tape-measure: + no-anchor: '&cYou need to set an anchor before you can start to measure!' + wrong-world: '&cYour anchor seems to be in a different world!' + distance: '&7Measurement taken. &eDistance: %distance%' + anchor-set: '&aSuccessfully set the anchor:&e %anchor%' fire-extinguish: '&7You have extinguished yourself' cannot-place: '&cYou cannot place that block there!' diff --git a/src/main/resources/languages/messages_es.yml b/src/main/resources/languages/messages_es.yml index e78e376e5..d69e40244 100644 --- a/src/main/resources/languages/messages_es.yml +++ b/src/main/resources/languages/messages_es.yml @@ -1,248 +1,138 @@ --- -android: - scripts: - already-uploaded: "&4Este script ya ha sido subido." - editor: Editor de Guión - enter-name: - - - - "&ePor favor, escribe en el chat el nombre para tu script." - instructions: - ATTACK_ANIMALS: "&4Atacar &c(Animales)" - ATTACK_ANIMALS_ADULT: "&4Atacar &c(Animales &7[Adultos]&c)" - ATTACK_MOBS: "&4Atacar &c(Mobs Hostiles)" - ATTACK_MOBS_ANIMALS: "&4Atacar &c(Mobs Hostiles y Animales)" - CATCH_FISH: "&bPescar" - CHOP_TREE: "&cTalar y Replantar" - DIG_DOWN: "&bCavar abajo" - DIG_FORWARD: "&bCavar adelante" - DIG_UP: "&bCavar arriba" - FARM_DOWN: "&bCosechar y Replantar &7(En el bloque de abajo)" - FARM_EXOTIC_DOWN: "&bCosechar y Replantar Avanzado &7(En el bloque de abajo)" - FARM_EXOTIC_FORWARD: "&bCosechar y Replantar Avanzado" - FARM_FORWARD: "&bCosechar y Replantar" - GO_DOWN: "&7Mover hacia abajo" - GO_FORWARD: "&7Mover hacia adelante" - GO_UP: "&7Mover hacia arriba" - INTERFACE_FUEL: "&9Extraer el combustible de la interfaz que se mira." - INTERFACE_ITEMS: "&9Empujar el contenido del inventario a la interfaz que se - mira." - MOVE_AND_DIG_DOWN: "&bMover y Cavar abajo" - MOVE_AND_DIG_FORWARD: "&bMover y Cavar adelante" - MOVE_AND_DIG_UP: "&bMover y Cavar arriba" - REPEAT: "&9Repetir Script" - START: "&2Iniciar Script" - TURN_LEFT: "&7Girar a la izquierda" - TURN_RIGHT: "&7Girar a la derecha" - WAIT: "&eEsperar 0.5s" - rating: - already: "&4¡Ya has calificado este script!" - own: "&4¡No puedes calificar tu propio script!" - uploaded: - - "&bSubiendo..." - - "&a¡Script cargado correctamente!" - started: "&7Tu androide ha comenzado a correr el script." - stopped: "&7Tu androide ha pausado el script." -anvil: - not-working: "&4¡No puedes usar objetos de Slimefun en un yunque!" -backpack: - already-open: "&cPerdón, ¡Esta mochila esta abierta en otro lugar!" - no-stack: "&cNo puedes juntar mochilas." commands: + help: Muestra estos mensajes de ayuda. cheat: Te da objetos con trucos. give: Da a alguien algún objeto de Slimefun. guide: Obtén la guia de Slimefun. - help: Muestra estos mensajes de ayuda. + timings: Información del lag de tu servidor. + teleporter: Ve los Waypoints de otros jugadores. + versions: Lista los Addons instalados. + search: Busca en la guía el término dado. open_guide: Abre la guía de Slimefun sin usar el libro. + stats: Muestra algunos Stats de un Jugador. research: description: Desbloquea/Reinicia el conocimiento para un jugador. reset: "&cHas reiniciado el conocimiento de %player%." reset-target: "&cTu conocimiento fue reiniciado." - search: Busca en la guía el término dado. - stats: Muestra algunos Stats de un Jugador. - teleporter: Ve los Waypoints de otros jugadores. - timings: Información del lag de tu servidor. - versions: Lista los Addons instalados. backpack: description: Obtén una copia de una mochila existente invalid-id: "&4¡El ID ha de ser un número positivo!" player-never-joined: "&4¡Ningún jugador con ese nombre pudo ser encontrado!" backpack-does-not-exist: "&4¡La mochila especificada no existe!" restored-backpack-given: "&a¡Tu mochila ha sido restaurada y añadida a tu inventario!" -gps: - deathpoint: "&4Punto de Muerte &7%date%" - geo: - scan-required: "&4?GEO-Scan requerido! &c¡Escanea este chunk usando un GEO-Scanner - primero!" - insufficient-complexity: - - "&4Complejidad de red GPS insuficiente: &c%complexity%" - - "&4a) No tienes una red GPS armada aún." - - "&4b) Tu red GPS no es lo suficientemente compleja." - waypoint: - added: "&aNuevo waypoint agregado exitosamente." - max: "&4Has alcanzado el máximo número de waypoints permitidos." - new: "&ePor favor, escribe en el chat el nombre de tu nuevo waypoint. &7(¡Se permiten - códigos de color!)" guide: - back: - guide: Volver a la guía de Slimefun - settings: Volver al panel de configuración - title: Volver + search: + message: "&b¿Qué te gustaría buscar?" + name: "&7Busca..." + tooltip: "&bClick para buscar un item" + inventory: 'Buscando: %item%' + lore: + - "&b¿Qué te gustaría buscar?" + - "&7Escribe en el chat el término que quieres buscar." cheat: no-multiblocks: "&4¡No puedes obtener los Multiblocks, tienes que construirlos!" - credits: - commit: Contribución - commits: Contribuciones - profile-link: Clic para visitar su perfil en GitHub. - roles: - developer: "&6Desarrollador" - resourcepack: "&cArtista de Resourcepack" - translator: "&9Traductor" - wiki: "&3Editor de Wiki" languages: + updated: "&aTu lenguaje fue cambiado a: &b%lang%" + translations: + name: "&a¿Falta algo?" + lore: Clic para agregar tu propia traducción. select: Clic para seleccionar este idioma. select-default: Clic para seleccionar el idioma predeterminado. selected-language: 'Actualmente seleccionado:' - translations: - lore: Clic para agregar tu propia traducción. - name: "&a¿Falta algo?" - updated: "&aTu lenguaje fue cambiado a: &b%lang%" + title: + main: Guía de Slimefun. + settings: Configuración e Información. + languages: Selecciona tu idioma. + credits: Colaboradores de Slimefun4 + wiki: Wiki de Slimefun4 + addons: Complementos para Slimefun4 + bugs: Reportes de Bugs + source: Código base + credits: + commit: Contribución + commits: Contribuciones + roles: + developer: "&6Desarrollador" + wiki: "&3Editor de Wiki" + resourcepack: "&cArtista de Resourcepack" + translator: "&9Traductor" + profile-link: Clic para visitar su perfil en GitHub. + pages: + previous: Página anterior + next: Página siguiente + tooltips: + open-category: Clic para abrir + versions-notice: "¡Esto es muy importante cuando se reportan bugs!" + wiki: Ve este objeto en la wiki oficial de Slimefun + recipes: + machine: Recetas hechas en esta máquina + miner: Recursos que puedes obtener con el Miner + generator: Tipos de combustible disponibles + gold-pan: Recursos que puedes obtener + back: + title: Volver + guide: Volver a la guía de Slimefun + settings: Volver al panel de configuración locked: BLOQUEADO locked-category: - Para desbloquear esta categoría deberás - desbloquear todos los objetos de las - siguientes categorías - pages: - next: Página siguiente - previous: Página anterior - search: - inventory: 'Buscando: %item%' - lore: - - "&b¿Qué te gustaría buscar?" - - "&7Escribe en el chat el término que quieres buscar." - message: "&b¿Qué te gustaría buscar?" - name: "&7Busca..." - tooltip: "&bClick para buscar un item" - title: - addons: Complementos para Slimefun4 - bugs: Reportes de Bugs - credits: Colaboradores de Slimefun4 - languages: Selecciona tu idioma. - main: Guía de Slimefun. - settings: Configuración e Información. - source: Código base - wiki: Wiki de Slimefun4 - tooltips: - open-category: Clic para abrir - recipes: - generator: Tipos de combustible disponibles - gold-pan: Recursos que puedes obtener - machine: Recetas hechas en esta máquina - miner: Recursos que puedes obtener con el Miner - versions-notice: "¡Esto es muy importante cuando se reportan bugs!" - wiki: Ve este objeto en la wiki oficial de Slimefun -inventory: - no-access: "&4No tienes permitido el acceso a este bloque." -languages: - af: Africano - ar: Árabe - be: Bielorruso - bg: Búlgaro - cs: Checo - da: Danés - de: Alemán - default: Predeterminado - el: Griego - en: Inglés - es: Español - fa: Persa - fi: Finés - fr: Francés - he: Hebreo - hr: Croata - hu: Húngaro - id: Indonesio - it: Italiano - ja: Japonés - ko: Coreano - lv: Letón - mk: Macedónio - ms: Malayo - nl: Holandés - 'no': Noruego - pl: Polaco - pt: Portugués (Portugal) - pt-BR: Portugués (Brasil) - ro: Rumano - ru: Ruso - sk: Esloveno - sr: Serbio - sv: Sueco - th: Tailandés - tr: Turco - uk: Ucraniano - vi: Vietnamita - zh-CN: Chino (China) - zh-TW: Chino (Taiwan) -machines: - ANCIENT_ALTAR: - not-enough-pedestals: "&4El Altar no está rodeado por la cantidad correcta de - pedestales &c(%pedestals% / 8)" - unknown-catalyst: "&4¡Catalyst desconocido! &cUsa la receta correcta!" - unknown-recipe: "&4¡Receta desconocida! &c¡Usa la receta correcta!" - ANCIENT_PEDESTAL: - obstructed: "&4¡El Pedestal está obstruido! &c¡Quita lo que se encuentra encima!" - CARGO_NODES: - must-be-placed: "&4¡Tiene que ponerse sobre un cofre o máquina!" - ELEVATOR: - click-to-teleport: "&eClic &7para ir a este piso:" - current-floor: "&eTe encuentras en este piso:" - enter-name: "&7Por favor, escribe en el chat el nombre para el piso deseado. &r(¡Se - permiten códigos de color!)" - named: "&2Has dado nombre a este piso: &r%floor%" - no-destinations: "&4No se han encontrado destinos." - pick-a-floor: "&3- Selecciona un piso -" - full-inventory: "&e¡Perdón, mi inventario esta lleno!" - GPS_CONTROL_PANEL: - title: GPS - Panel de Control - transmitters: Visor General de Transmisores - waypoints: Visor de Waypoints - HOLOGRAM_PROJECTOR: - enter-text: "&7Por favor, escribe en el chat el texto deseado. &r(¡Se permiten - códigos de color!)" - inventory-title: Editor de Holograma - ignition-chamber-no-flint: "&cEl Ignition Chamber no tiene pedernal." - in-use: "&cEl inventario de este bloque esta siendo usado por otro jugador." - pattern-not-found: "&eLo siento, no puedo reconocer esta receta. Por favor coloca - el objeto en el patrón correcto dentro del dispensador." - TELEPORTER: - cancelled: "&4¡Teletransportación cancelada!" - gui: - time: Tiempo estimado - title: Tus waypoints - tooltip: Click para teletransportarte - invulnerability: "&b&l¡Tienes 30 segundos de invulnerabilidad!" - teleported: "&3¡Teletransportado!" - teleporting: "&3Teletransportando..." - unknown-material: "&eLo siento, no puedo reconocer el objeto en mi dispensador. - Por favor coloca algo que si conozca." - wrong-item: "&eLo siento, no puedo reconocer el objeto con el que me has hecho clic. - Revisa las recetas y mira que objetos puedes usar." - INDUSTRIAL_MINER: - no-fuel: "&c¡Tu Industrial Miner se ha quedado sin combustible! Pon combustible - en el cofre de encima." - piston-facing: "&c¡Tu Industrial Miner requiere pistones para mirar hacia arriba!" - piston-space: "&c¡Los dos pistones han de tener un bloque de aire encima de ellos!" - destroyed: "&cAl parecer tu Industrial Miner ha sido destruido..." - already-running: "&c¡Este Industrial Miner ya está en funcionamiento!" - full-chest: "&c¡El cofre de tu Industrial Miner está lleno!" - no-permission: "&4¡No tienes permisos para operar un Industrial Miner aquí!" - finished: "&e?¡Tu Industrial Miner ha acabado! ¡Obtuvo un total de %ores% mineral(es)!" messages: - cannot-place: "&c¡No puedes colocar ese bloque ahí!" - diet-cookie: "&eEmpiezas a sentirte muy ligero ..." + not-researched: "&4No tienes conocimiento suficiente para entender esto." + not-enough-xp: "&4No tienes suficiente XP para desbloquear esto." + unlocked: '&bHas desbloqueado &7"%research%"' + only-players: "&4Este comando es solo para jugadores." + unknown-player: "&4Jugador desconocido: &c%player%" + no-permission: "&4No tienes el permiso requerido para hacer esto." + usage: "&4Uso: &c%usage%" + not-online: "&c¡&4%player% &cno está conectado!" + not-valid-item: "&c¡&4%item% &cno es un objeto válido!" + not-valid-amount: "&c¡&4%amount% &cno es un valor válido: tiene que ser mayor a + 0!" + given-item: '&bTe han dado &a%amount% &7"%item%&7"' + give-item: '&bLe has dado a %player%, &a%amount% &7"%item%&7"' + not-valid-research: "&c¡&4%research% &cno es un conocimiento válido!" + give-research: '&bLe has dado a %player% la investigación &7"%research%&7"' + hungry: "&c¡Tienes demasiada hambre para hacer eso!" + mode-change: 'El modo de &b%device% ha cambiado a: &9%mode%' disabled-in-world: "&4&lEste item ha sido desactivado en el mundo." disabled-item: "&4&l¡Este item ha sido desactivado! ¿Cómo es que lo tienes?" + no-tome-yourself: "&cNo puedes usar el &4Tome of Knowledge &cen ti mismo..." + multimeter: "&bEnergía almacenada: &3%stored% &b/ &3%capacity%" + talisman: + anvil: "&a&oEl talismán salvó tu herramienta de ser destruida." + miner: "&a&oTu talismán ha duplicado los minerales." + hunter: "&a&oTu talismán ha duplicado el botín" + lava: "&a&oTu talismán ha evitado que te quemes en lava." + water: "&a&oTu talismán ha evitado que mueras ahogado." + angel: "&a&oTu talismán ha evitado que sufras daño por caída." + fire: "&a&oTu talismán ha evitado que te rostices hasta la muerte." + magician: "&a&oTu talismán te ha dado un encantamiento adicional." + traveller: "&a&oTu talismán te ha dado un impulso de velocidad." + warrior: "&a&oTu talismán te ha hecho más fuerte por un tiempo." + knight: "&a&oTu talismán te ha dado 5 segundos de regeneración." + whirlwind: "&a&oTu talismán ha reflejado un proyectil." + wizard: "&a&oTu talismán te ha dado un mayor nivel de fortuna, pero pudo disminuír + el nivel de otros encantamientos." + soulbound-rune: + fail: "&cSolo puedes ligar un objeto a tu alma." + success: "&a¡Has ligado este objeto a tu alma exitosamente! No lo perderás al + morir." + research: + start: "&7Los espíritus antiguos susurran palabras crípticas en tu oído..." + progress: "&7Empiezas a pensar sobre &b%research% &e(%progress%)" fire-extinguish: "&7Has dejado de quemarte." + cannot-place: "&c¡No puedes colocar ese bloque ahí!" + no-pvp: "&c¡No puedes pelear aquí!" + radiation: "&4¡Te has expuesto a radiación mortal! &c¡Desaste del objeto radiactivo + o equipate un traje HazMat!" + opening-guide: "&bAbriendo la guía, esto puede tomar unos segundos..." + opening-backpack: "&bAbriendo la mochila, esto podría tomar unos segundos..." + no-iron-golem-heal: "&cEso no es un lingote de hierro. ¡No puedes usar esto para + sanar a los Golems de Hierro!" + link-prompt: "&eHaga clic aquí:" + diet-cookie: "&eEmpiezas a sentirte muy ligero ..." fortune-cookie: - "&7¡Ayuda, estoy atrapado en una fábrica de galletas de la fortuna!" - "&7Morirás mañana... por un Creeper." @@ -256,56 +146,171 @@ messages: - "&742. La respuesta es 42." - "&7Un Walshy al día mantendrá alejados los problemas." - "&7¡Nunca caves hacia abajo!" - give-item: '&bLe has dado a %player%, &a%amount% &7"%item%&7"' - given-item: '&bTe han dado &a%amount% &7"%item%&7"' - give-research: '&bLe has dado a %player% la investigación &7"%research%&7"' - hungry: "&c¡Tienes demasiada hambre para hacer eso!" - link-prompt: "&eHaga clic aquí:" - mode-change: 'El modo de &b%device% ha cambiado a: &9%mode%' - multimeter: "&bEnergía almacenada: &3%stored% &b/ &3%capacity%" - no-iron-golem-heal: "&cEso no es un lingote de hierro. ¡No puedes usar esto para - sanar a los Golems de Hierro!" - no-permission: "&4No tienes el permiso requerido para hacer esto." - no-pvp: "&c¡No puedes pelear aquí!" - not-enough-xp: "&4No tienes suficiente XP para desbloquear esto." - no-tome-yourself: "&cNo puedes usar el &4Tome of Knowledge &cen ti mismo..." - not-online: "&c¡&4%player% &cno está conectado!" - not-researched: "&4No tienes conocimiento suficiente para entender esto." - not-valid-amount: "&c¡&4%amount% &cno es un valor válido: tiene que ser mayor a - 0!" - not-valid-item: "&c¡&4%item% &cno es un objeto válido!" - not-valid-research: "&c¡&4%research% &cno es un conocimiento válido!" - only-players: "&4Este comando es solo para jugadores." - opening-backpack: "&bAbriendo la mochila, esto podría tomar unos segundos..." - opening-guide: "&bAbriendo la guía, esto puede tomar unos segundos..." - radiation: "&4¡Te has expuesto a radiación mortal! &c¡Desaste del objeto radiactivo - o equipate un traje HazMat!" - research: - progress: "&7Empiezas a pensar sobre &b%research% &e(%progress%)" - start: "&7Los espíritus antiguos susurran palabras crípticas en tu oído..." - soulbound-rune: - fail: "&cSolo puedes ligar un objeto a tu alma." - success: "&a¡Has ligado este objeto a tu alma exitosamente! No lo perderás al - morir." - talisman: - angel: "&a&oTu talismán ha evitado que sufras daño por caída." - anvil: "&a&oEl talismán salvó tu herramienta de ser destruida." - fire: "&a&oTu talismán ha evitado que te rostices hasta la muerte." - hunter: "&a&oTu talismán ha duplicado el botín" - knight: "&a&oTu talismán te ha dado 5 segundos de regeneración." - lava: "&a&oTu talismán ha evitado que te quemes en lava." - magician: "&a&oTu talismán te ha dado un encantamiento adicional." - miner: "&a&oTu talismán ha duplicado los minerales." - traveller: "&a&oTu talismán te ha dado un impulso de velocidad." - warrior: "&a&oTu talismán te ha hecho más fuerte por un tiempo." - water: "&a&oTu talismán ha evitado que mueras ahogado." - whirlwind: "&a&oTu talismán ha reflejado un proyectil." - wizard: "&a&oTu talismán te ha dado un mayor nivel de fortuna, pero pudo disminuír - el nivel de otros encantamientos." - unknown-player: "&4Jugador desconocido: &c%player%" - unlocked: '&bHas desbloqueado &7"%research%"' - usage: "&4Uso: &c%usage%" -miner: - no-ores: "&ePerdón, ¡No encuentro ningún mineral cerca!" + - "&7¡Solo un raspón!" + - "&7¡Siempre mira el lado bueno de la vida!" + - "&7Esta era un bizcocho y no una galleta" + - "&7¡Los signos de neón son lo MEJOR!" +machines: + pattern-not-found: "&eLo siento, no puedo reconocer esta receta. Por favor coloca + el objeto en el patrón correcto dentro del dispensador." + unknown-material: "&eLo siento, no puedo reconocer el objeto en mi dispensador. + Por favor coloca algo que si conozca." + wrong-item: "&eLo siento, no puedo reconocer el objeto con el que me has hecho clic. + Revisa las recetas y mira que objetos puedes usar." + full-inventory: "&e¡Perdón, mi inventario esta lleno!" + in-use: "&cEl inventario de este bloque esta siendo usado por otro jugador." + ignition-chamber-no-flint: "&cEl Ignition Chamber no tiene pedernal." + ANCIENT_ALTAR: + not-enough-pedestals: "&4El Altar no está rodeado por la cantidad correcta de + pedestales &c(%pedestals% / 8)" + unknown-catalyst: "&4¡Catalyst desconocido! &cUsa la receta correcta!" + unknown-recipe: "&4¡Receta desconocida! &c¡Usa la receta correcta!" + ANCIENT_PEDESTAL: + obstructed: "&4¡El Pedestal está obstruido! &c¡Quita lo que se encuentra encima!" + HOLOGRAM_PROJECTOR: + enter-text: "&7Por favor, escribe en el chat el texto deseado. &r(¡Se permiten + códigos de color!)" + inventory-title: Editor de Holograma + ELEVATOR: + no-destinations: "&4No se han encontrado destinos." + pick-a-floor: "&3- Selecciona un piso -" + current-floor: "&eTe encuentras en este piso:" + click-to-teleport: "&eClic &7para ir a este piso:" + enter-name: "&7Por favor, escribe en el chat el nombre para el piso deseado. &r(¡Se + permiten códigos de color!)" + named: "&2Has dado nombre a este piso: &r%floor%" + TELEPORTER: + teleporting: "&3Teletransportando..." + teleported: "&3¡Teletransportado!" + cancelled: "&4¡Teletransportación cancelada!" + invulnerability: "&b&l¡Tienes 30 segundos de invulnerabilidad!" + gui: + title: Tus waypoints + tooltip: Click para teletransportarte + time: Tiempo estimado + CARGO_NODES: + must-be-placed: "&4¡Tiene que ponerse sobre un cofre o máquina!" + GPS_CONTROL_PANEL: + title: GPS - Panel de Control + transmitters: Visor General de Transmisores + waypoints: Visor de Waypoints + INDUSTRIAL_MINER: + no-fuel: "&c¡Tu Industrial Miner se ha quedado sin combustible! Pon combustible + en el cofre de encima." + piston-facing: "&c¡Tu Industrial Miner requiere pistones para mirar hacia arriba!" + piston-space: "&c¡Los dos pistones han de tener un bloque de aire encima de ellos!" + destroyed: "&cAl parecer tu Industrial Miner ha sido destruido..." + already-running: "&c¡Este Industrial Miner ya está en funcionamiento!" + full-chest: "&c¡El cofre de tu Industrial Miner está lleno!" + no-permission: "&4¡No tienes permisos para operar un Industrial Miner aquí!" + finished: "&e?¡Tu Industrial Miner ha acabado! ¡Obtuvo un total de %ores% mineral(es)!" +anvil: + not-working: "&4¡No puedes usar objetos de Slimefun en un yunque!" +backpack: + already-open: "&cPerdón, ¡Esta mochila esta abierta en otro lugar!" + no-stack: "&cNo puedes juntar mochilas." workbench: not-enhanced: "&4No puedes usar objetos de Slimefun en una mesa de crafteo normal." +gps: + deathpoint: "&4Punto de Muerte &7%date%" + waypoint: + new: "&ePor favor, escribe en el chat el nombre de tu nuevo waypoint. &7(¡Se permiten + códigos de color!)" + added: "&aNuevo waypoint agregado exitosamente." + max: "&4Has alcanzado el máximo número de waypoints permitidos." + insufficient-complexity: + - "&4Complejidad de red GPS insuficiente: &c%complexity%" + - "&4a) No tienes una red GPS armada aún." + - "&4b) Tu red GPS no es lo suficientemente compleja." + geo: + scan-required: "&4?GEO-Scan requerido! &c¡Escanea este chunk usando un GEO-Scanner + primero!" +inventory: + no-access: "&4No tienes permitido el acceso a este bloque." +android: + started: "&7Tu androide ha comenzado a correr el script." + stopped: "&7Tu androide ha pausado el script." + scripts: + already-uploaded: "&4Este script ya ha sido subido." + instructions: + START: "&2Iniciar Script" + REPEAT: "&9Repetir Script" + WAIT: "&eEsperar 0.5s" + GO_FORWARD: "&7Mover hacia adelante" + GO_UP: "&7Mover hacia arriba" + GO_DOWN: "&7Mover hacia abajo" + TURN_LEFT: "&7Girar a la izquierda" + TURN_RIGHT: "&7Girar a la derecha" + DIG_UP: "&bCavar arriba" + DIG_FORWARD: "&bCavar adelante" + DIG_DOWN: "&bCavar abajo" + MOVE_AND_DIG_UP: "&bMover y Cavar arriba" + MOVE_AND_DIG_FORWARD: "&bMover y Cavar adelante" + MOVE_AND_DIG_DOWN: "&bMover y Cavar abajo" + ATTACK_MOBS_ANIMALS: "&4Atacar &c(Mobs Hostiles y Animales)" + ATTACK_MOBS: "&4Atacar &c(Mobs Hostiles)" + ATTACK_ANIMALS: "&4Atacar &c(Animales)" + ATTACK_ANIMALS_ADULT: "&4Atacar &c(Animales &7[Adultos]&c)" + CHOP_TREE: "&cTalar y Replantar" + CATCH_FISH: "&bPescar" + FARM_FORWARD: "&bCosechar y Replantar" + FARM_DOWN: "&bCosechar y Replantar &7(En el bloque de abajo)" + FARM_EXOTIC_FORWARD: "&bCosechar y Replantar Avanzado" + FARM_EXOTIC_DOWN: "&bCosechar y Replantar Avanzado &7(En el bloque de abajo)" + INTERFACE_ITEMS: "&9Empujar el contenido del inventario a la interfaz que se + mira." + INTERFACE_FUEL: "&9Extraer el combustible de la interfaz que se mira." + enter-name: + - + - "&ePor favor, escribe en el chat el nombre para tu script." + uploaded: + - "&bSubiendo..." + - "&a¡Script cargado correctamente!" + rating: + own: "&4¡No puedes calificar tu propio script!" + already: "&4¡Ya has calificado este script!" + editor: Editor de Guión +languages: + default: Predeterminado + en: Inglés + de: Alemán + fr: Francés + it: Italiano + es: Español + pl: Polaco + sv: Sueco + nl: Holandés + cs: Checo + hu: Húngaro + lv: Letón + ru: Ruso + sk: Esloveno + zh-TW: Chino (Taiwan) + vi: Vietnamita + id: Indonesio + zh-CN: Chino (China) + el: Griego + he: Hebreo + pt: Portugués (Portugal) + pt-BR: Portugués (Brasil) + ar: Árabe + af: Africano + da: Danés + fi: Finés + uk: Ucraniano + ms: Malayo + 'no': Noruego + ja: Japonés + fa: Persa + th: Tailandés + ro: Rumano + bg: Búlgaro + ko: Coreano + tr: Turco + hr: Croata + mk: Macedónio + sr: Serbio + be: Bielorruso + tl: Tagalog +miner: + no-ores: "&ePerdón, ¡No encuentro ningún mineral cerca!" diff --git a/src/main/resources/languages/messages_id.yml b/src/main/resources/languages/messages_id.yml new file mode 100644 index 000000000..033a0c516 --- /dev/null +++ b/src/main/resources/languages/messages_id.yml @@ -0,0 +1,309 @@ +--- +commands: + help: Menampilkan layar bantuan ini + cheat: Mengijinkan kamu untuk mendapatkan item instan + give: Berikan seseorang Item Slimefun + guide: Berikan diri kamu Panduan Slimefun + timings: Informasi Lag tentang Servermu + teleporter: Lihat Waypoint Pemain lain + versions: Daftar Addons Yang Terpasang + search: Cari panduan anda untuk istilah yang diberikan + open_guide: Membuka Panduan Slimefun Tanpa Buku + stats: Lihat Statistik Seorang Pemain + research: + description: Membuka/Atur Ulang Penelitian Seorang Pemain + reset: "&cAnda Telah Mengatur Ulang Penelitian %player%" + reset-target: "&cPenelitian Anda Telah Di Atur Ulang" + backpack: + description: Ambil salinan tas yang ada + invalid-id: "&4 Id harus berupa angka nol hingga negatif!" + player-never-joined: "&4Tidak ada pemain dengan nama itu" + backpack-does-not-exist: "&4Ransel yang ditentukan tidak ada!" + restored-backpack-given: "&a Backpack Anda telah di tambahkan ke inventory Anda!" +guide: + search: + message: "&bApa Yang Anda Ingi Cari ?" + name: "&7Cari..." + tooltip: "&bKlik untuk mencari sebuah barang" + inventory: 'Hasil pencarian: %item%' + cheat: + no-multiblocks: "&4Anda Tidak Bisa Bermain Curang, Anda Harus Membuatnya!" + languages: + updated: "&aBahasa Anda Telah Berhasil Di Ubah Menjadi: &b%lang%" + translations: + name: "&aAda yang kurang?" + lore: Klik untuk menambahkan terjemahan anda + select: Klik untuk memilih bahasa ini + select-default: Klik untuk menggunakan bahasa standar server + selected-language: 'Yang sedang dipilih:' + title: + main: Panduan Slimefun + settings: Pengaturan & Informasi + languages: Pilih Bahasa Yang Anda Inginkan + credits: Para Kontributor Slimefun4 + wiki: Slimefun4 Wiki + addons: Addons untuk Slimefun4 + bugs: Laporkan masalah + source: Kode sumber + credits: + commit: Melakukan + roles: + developer: "&6Para Pengembang" + wiki: "&3Pengedit Wiki" + resourcepack: "&cArtis Resourcepack" + translator: "&9Penerjemah" + profile-link: Klik untuk mengunjungi profil mereka di GitHub + pages: + previous: Halaman sebelumnya + next: Halaman berikutnya + tooltips: + open-category: Klik untuk membuka + versions-notice: Melaporkan kesalahan program sangatlah penting! + wiki: Lihat benda ini di wiki resmi Slimefun + recipes: + machine: Resep yang di buat dalam mesin ini + miner: Sumber daya yang dapat diambil dengan penambang ini + generator: Bahan bakar yang dapat digunakan + gold-pan: Sumber daya yang dapat anda ambil + back: + title: Kembali + guide: Kembali ke panduan Slimefun + settings: Kemabali ke panel pengaturan + locked: TERKUNCI + locked-category: + - Untuk membuka kategori ini anda + - harus membuka semua barang dari + - kategori berikut +messages: + not-researched: "&4Anda Tidak Memiliki Cukup Pengehatuan Untuk Mengetahui Ini" + not-enough-xp: "&4Anda Tidak Memiliki Cukup XP untuk Membuka Ini" + unlocked: '&bAnda Telah Membuka &7"%research%"' + only-players: "&4Perintah Ini Hanya Untuk Para Pemain" + unknown-player: "&4Pemain Tidak Diketahui: &c%player%" + no-permission: "&4Anda Tidak Memiliki Izin Untuk Ini" + usage: "&4Penggunaan: &c%usage%" + not-online: "&4%player% &cTidak Sedang Bermain Disini!" + not-valid-item: "&4%item% &cBenda Ini Tidak sah" + not-valid-amount: "&4%amount% &cJumlah Ini Salah : Harus Lebih Tinggi Dari 0!" + given-item: '&bAnda Telah Diberikan &a%amount% &7"%item%&7"' + give-item: '&bAnda Telah Memberi %player% &a%amount% &7"%item%&7"' + not-valid-research: "&4%research% &cIni Bukan Penelitian Yang Benar!" + give-research: '&bAnda Telah Memberi %player% Penelitian &7"%research%&7"' + hungry: "&cAnda Terlalu Lapar Untuk Ini " + mode-change: "&b%device% Mode Telah Berubah Menjadi: &9%mode%" + disabled-in-world: "&4&lBarang Ini Telah Dilarang Di Dunia Ini" + disabled-item: "&4&lBenda Ini Telah Dinonakrifkan! Bagaimana Anda Mendapatkannya?" + no-tome-yourself: "&cKamu Tidak Bisa Menggunakan &4Tome Of Knowledge &cUntuk Diri + Anda Sendiri..." + multimeter: "&bEnergi Yang Telah Tersimpan: &3%stored% &b/ &3%capacity%" + talisman: + anvil: "&a&oJimat Anda Mencegah Barang Mu Agar Tidak Hancur" + miner: "&a&oJimat Anda Baru Saja Melipat Gandakan Penghasilan Mu" + hunter: "&a&oJimat Anda Baru Saja Melipat Gandakan Penghasilan Mu" + lava: "&a&oJimat Mu Menyelamatkan Kamu Dari kebakar Hingga Tewas" + water: "&a&oJimat Anda Menyelematkan Anda Dari Tenggelam" + angel: "&a&oJimat Anda Menyelematkan Anda Dari Jatuh Dari Ketinggian" + fire: "&a&oJimat Anda Menyelematkan Anda Dari Terbakar Hingga Mati" + magician: "&a&oJimat Anda Memberikan Pemikat Tambahan" + traveller: "&a&oJimat Anda Memberikan Kecepatan Tambahan" + warrior: "&a&oJimat Anda Memberikan Kekuatan Tambahan Untuk Sementara" + knight: "&a&oJimat Anda Memberikan Regenerasi Selama 5 Detik" + whirlwind: "&a&oJimat Anda Memantulkan Proyektil" + wizard: "&a&oJimat Anda Memberikan Keberuntungan Lebih Namun Mungkin Mengurangi + Pemikat Lain" + soulbound-rune: + fail: "&cAnda hanya dapat mengikat satu benda ke jiwa anda dalam waktu yang bersamaan." + success: "&aAnda Telah Berhasil Mengikat Benda Ini Ke Jiwa Anda! Benda Ini Akan + Tetap Bersama Anda Walaupun Setelah Kematian" + research: + start: "&7Roh Kuno Telah Membisikan Pesan Misterius Ke Telinga Anda!" + progress: "&7Anda Mulai Ingin Tahu Tentang &b%research% &e(%progress%)" + fire-extinguish: "&7Anda Telah Memadamkan Diri Anda Sendiri" + cannot-place: "&cAnda Tidak Bisa Menaruh Blok Disini!" + no-pvp: "&cAnda Tidak Bisa PvP Disini!" + radiation: "&4Anda Tidak Terlindungi Dari Benda Radioaktif! &cSegera Letakan Benda + Tersebut Atau Gunakan Pakaian Hazmat!" + opening-guide: "&bMembuka Panduan, Mungkin Membutuhkan Waktu Sebentar..." + opening-backpack: "&bMembuka tas, mungkin membutuhkan waktu sebentar..." + no-iron-golem-heal: "&cIni bukan sebuah Batang Besi. Anda tidak bisa munggunakan + ini untuk menyembuhkan Iron Golems!" + link-prompt: "&eKlik disini:" + diet-cookie: "&eAnda mulai merasa sangat ringan..." + fortune-cookie: + - "&7Tolong saya, Saya terjebak di pabrik kue keberuntungan!" + - "&7Anda akan mati besok... dibunuh oleh Creeper" + - "&7Suatu saat akan ada hal buruk dalam hidupmu!!!" + - "&7Minggu depan anda akan memperhatiakn ini bukan di dunia nyata, kamu dalam permainan + komputer" + - "&7Kue ini akan berubah menjadi enak dalam beberapa detik" + - '&7Kalimat terakhir yang akan anda dengar adalah "MEMUSNAHKAN!!!"' + - "&7Apapun yang anda lakukan, jangan memeluk Creeper... saya sudah mencobanya. + Terasa nyaman, tapi itu tidak setimpal." + - "&742. Jawabannya adalah 42" + - "&7AHari yang membosankan akan menjauhkan anda dari masalah" + - "&7Jangan pernah menggali lurus kebawah!" + - "&7Ini hanya luka Luar!" + - "& 7Selalu lihat sisi terang hidup!" + - "&7Yang ini sebenarnya biskuit dan bukan kue" + - "&7Neon signs are LIT!" +machines: + pattern-not-found: "&eMaaf, Saya tidak mengenali resep ini. Letakan benda pada dispenser + \ sesuai dengan pola." + unknown-material: "&eMaaf, Saya tidak mengenali benda yang ada di dalam dispenser. + Masukan benda yang saya ketahui." + wrong-item: "&eMaaf, Saya tidak mengenali barang yang anda klik terhadap saya. Cek + kembali resep dan lihat apa yang dapat anda gunakan." + full-inventory: "&eMaaf, Penyimpanan saya sudah penuh!" + in-use: "&cPenyimpanan blok ini sedang dibuka oleh pemain lain." + ignition-chamber-no-flint: '&cRuang perapian kehabisan "flint and steel"' + ANCIENT_ALTAR: + not-enough-pedestals: "&4Altar ini tidak dikelilingi dengan tumpuan yang cukup&c(%pedestals% + / 8)" + unknown-catalyst: "&4Katalisator tidak diketahui! &cGunakan resep yang benar!" + unknown-recipe: "&4Resep tidak diketahui! &cGunakan Pola yang benar!" + ANCIENT_PEDESTAL: + obstructed: "&4Tumpuan terhalangi! &Hancurkan semua yang berada di atas tumpuan!" + HOLOGRAM_PROJECTOR: + enter-text: "&7Masukan teks sesuai yang anda inginkan. &r(Mendukung warna teks!)" + inventory-title: Pengedit hologram + ELEVATOR: + no-destinations: "&4Tujuan tidak ditemukan" + pick-a-floor: "&3- Pilih Lantai -" + current-floor: "&eAnda sedang berada di lantai ini:" + click-to-teleport: "&eKlik &7untuk teleport ke lantai ini:" + enter-name: "&7Silakan masukan nama lantai pada kolom chat. &r(Mendukung warna + teks!)" + named: "&2Berhasil merubah nama lantai: &r%floor%" + TELEPORTER: + teleporting: "&3Melakukan teleportasi..." + teleported: "&3Teleportasi selesai!" + cancelled: "&4Teleportasi dibatalkan!" + invulnerability: "&b&lAnda kebal selama 30 detik!" + gui: + title: Titik jalan anda + tooltip: Klik untuk teleportasi + time: Perkiraan waktu + CARGO_NODES: + must-be-placed: "&4Harus diletakan di dalam peti atau mesin!" + GPS_CONTROL_PANEL: + title: Panel kendali GPS + transmitters: Gambaran pemancar + waypoints: Gambaran titik jalan + INDUSTRIAL_MINER: + no-fuel: "&c Penambang Industri Anda kehabisan bahan bakar! Masuklah bahan bakar + Anda ke peti di atas." + piston-facing: "& c Penambang Industri Anda membutuhkan piston untuk menghadap + ke atas!" + destroyed: "&c Penambang Industri Anda tampaknya telah hancurkan." + full-chest: "&c Penambang Industri Anda penuh!" + no-permission: "& 4Tampaknya Anda tidak memiliki izin untuk mengoperasikan Penambang + Industri Ini" + finished: "&e Penambang Industri Anda telah selesai! Itu memperoleh total% bijih% + bijih!" +anvil: + not-working: "&4Anda bisa menggunakan barang Slimefun di landasan!" +backpack: + already-open: "&cMaaf, tas ini dibuka di tempat lain!" + no-stack: "&cAnda tidak bisa menumpuk tas" +workbench: + not-enhanced: "&4Anda tidak dapat menggunakan barang Slimefun di meja kerajinan + biasa" +gps: + deathpoint: "&4Lokasi Kematian &7%date%" + waypoint: + new: "&eKetik nama baru untuk titik jalan di kolom pesan. &7(Mendukung warna teks!)" + added: "&aBerhasil menambahkan titik jalan baru" + max: "&4Anda telah mencapai jumlah maksimal penggunaan titik jalan" + insufficient-complexity: + - "&4Kompleksitas jaringan GPS tidak cukup: &c%complexity%" + - "&4a) Anda belum membuat sistem jaringan GPS" + - "&4b) Kompleksitas jaringan GPS anda belum cukup" + geo: + scan-required: "&4Dibutuhkan peninjauan GEO terlebih dahulu! &cGunakan Peninjau + GEO!" +inventory: + no-access: "&4Anda tidak di izinkan mengakses blok ini" +android: + started: "&7Android anda melanjutkan naskah nya" + stopped: "&7Android anda berhenti menjalankan naskah" + scripts: + already-uploaded: "&4Naskah yang sama sudah di unggah." + instructions: + START: "&2Mulai naskah" + REPEAT: "&9Ulangi naskah" + WAIT: "&eTunggu 0.5 detik" + GO_FORWARD: "&7Maju kedepan" + GO_UP: "&7Bergerak keatas" + GO_DOWN: "&7Bergerak kebawah" + TURN_LEFT: "&7Menghadap ke kiri" + TURN_RIGHT: "&7Menghadap ke kanan" + DIG_UP: "&bMenggali ke atas" + DIG_FORWARD: "&bMenggali ke depan" + DIG_DOWN: "&bMenggali ke bawah" + MOVE_AND_DIG_UP: "&bBergerak & Menggali ke atas" + MOVE_AND_DIG_FORWARD: "&bBergerak & Menggali ke depan" + MOVE_AND_DIG_DOWN: "&bBergerak & Menggali ke bawah" + ATTACK_MOBS_ANIMALS: "&4Serang &c(Musuh & Hewan)" + ATTACK_MOBS: "&4Serang &c(Musuh)" + ATTACK_ANIMALS: "&4Serang &c(Hewan)" + ATTACK_ANIMALS_ADULT: "&4Serang &c(Hewan &7[Dewasa]&c)" + CHOP_TREE: "&cTebang dan tanam kembali" + CATCH_FISH: "&bMenangkap ikan" + FARM_FORWARD: "&bPanen dan tanam kembali" + FARM_DOWN: "&bPanen dan tanam kembali &7(Blok yang dibawahnya)" + FARM_EXOTIC_FORWARD: "&bPanen dan tanam kembali tingkat lanjut" + FARM_EXOTIC_DOWN: "&bPanen dan tanam kembali tingkat lanjut &7(Blok yang dibawahnya)" + INTERFACE_ITEMS: "&9Masukan barang ke antarmuka penyimpanan" + INTERFACE_FUEL: "&cMengambil bahan bakar dari penyimpanan" + enter-name: + - + - "&eMasukan nama naskah anda" + uploaded: + - "&bMengunggah..." + - "&aBerhasil mengunggah naskah!" + rating: + own: "&4Anda tidak bisa menilai naskah anda sendiri!" + already: "&4Anda sudah memberikan nilai untuk naskah ini!" + editor: pengedit naskah +languages: + default: Server-Standar + en: Inggris + de: Jerman + fr: Perancis + it: Italia + es: Spanyol + pl: Polandia + sv: Swedia + nl: Belanda + cs: Ceko + hu: Hongaria + lv: Latvia + ru: Rusia + sk: Slovakia + zh-TW: Cina (Taiwan) + vi: Vietnam + id: Indonesia + zh-CN: Cina + el: Yunani + he: Ibrani + ar: Arab + af: Afrika + da: Denmark + fi: Finlandia + uk: Ukraina + ms: Malaysia + 'no': Norwegia + ja: Jepang + fa: Persia + th: Thailand + ro: Rumania + pt: Portugis + pt-BR: Portugis (Brazil) + bg: Bulgaria + ko: Korea + tr: Turki + hr: Croation + mk: Macedonian + sr: Serbian + be: Belarusian + tl: Tagalog diff --git a/src/main/resources/languages/messages_pl.yml b/src/main/resources/languages/messages_pl.yml index 23aa33300..1cff0f74c 100644 --- a/src/main/resources/languages/messages_pl.yml +++ b/src/main/resources/languages/messages_pl.yml @@ -1,184 +1,132 @@ --- -android: - scripts: - already-uploaded: "&4Ten skrypt został już przesłany." - enter-name: - - - - "&eProszę wpisać nazwę dla tego skryptu" - instructions: - ATTACK_ANIMALS: "&4Atakuj &c(Zwierzęta)" - ATTACK_ANIMALS_ADULT: "&4Atakuj &c(Zwierzęta &7[Dorosłe]&c)" - ATTACK_MOBS: "&4Atakuj &c(Wrogie Moby)" - ATTACK_MOBS_ANIMALS: "&4Atakuj &c(Wrogie Moby i Zwierzęta)" - CATCH_FISH: "&bŁów ryby" - CHOP_TREE: "&cTnij drzewo i posadź sadzonkę" - DIG_DOWN: "&bKop w dół" - DIG_FORWARD: "&bKop do przodu" - DIG_UP: "&bKop w górę" - FARM_DOWN: "&bZbieraj i posadź z powrotem &7(Blok pod spodem)" - FARM_EXOTIC_DOWN: "&bZaawansowanie zbieraj i posadź z powrotem &7(Blok pod spodem)" - FARM_EXOTIC_FORWARD: "&6Zaawansowanie zbieraj i posadź z powrotem" - FARM_FORWARD: "&bZbieraj i posadź z powrotem" - GO_DOWN: "&7Idź w dół" - GO_FORWARD: "&7Idź do przodu" - GO_UP: "&7Idź do góry" - INTERFACE_FUEL: "&cOtrzymaj paliwo z Interfejsu w obecnym kierunku" - INTERFACE_ITEMS: "&9Wyślij zawartość ekwipunku do Interfejsu w obecnym kierunku" - MOVE_AND_DIG_DOWN: "&bIdź i kop w dół" - MOVE_AND_DIG_FORWARD: "&bIdź i kop do przodu" - MOVE_AND_DIG_UP: "&bIdź i kop w górę" - REPEAT: "&9 Powtórz skrypt" - START: "&2Uruchom skrypt" - TURN_LEFT: "&7Skręć w lewo" - TURN_RIGHT: "&7Skręć w prawo" - WAIT: "&ePoczekaj 0.5s" - rating: - already: "&4Oceniłeś już ten skrypt!" - own: "&4Nie możesz ocenić własnego skryptu!" - uploaded: - - "&bPrzesyłanie..." - - "&aPomyślnie przesłano twój skrypt!" - started: "&7Twój Android wznowił swój skrypt" - stopped: "&7Twój Android wstrzymał swój skrypt" -anvil: - not-working: "&4Nie możesz używać przedmiotów Slimefun w kowadle!" -backpack: - already-open: "&cPrzepraszamy, ten plecak jest otwarty gdzie indziej!" - no-stack: "&cNie możesz stakować plecaków" commands: + help: Pokazuje ten ekran pomocy + cheat: Daje graczowi przedmioty Slimefun. give: Daj graczowi przedmioty Slimefun guide: Daje ci przewodnik Slimefun - help: Pokazuje ten ekran pomocy + timings: Informacje o opóźnieniu na twoim serwerze + teleporter: Zobacz punkty lokalizacji innych graczy + versions: Wyświetla listę wszystkich zainstalowanych dodatków + search: Przeszukuje twój przewodnik dla podanego terminu open_guide: Otwiera przewodnik Slimefun bez korzystania z książki + stats: Pokazuje niektóre statystyki dotyczące gracza research: description: Odblokuj/Zresetuj badania dla gracza reset: "&cZresetowano wiedzę gracza %player%" reset-target: "&c Twoja wiedza została zresetowana" - search: Przeszukuje twój przewodnik dla podanego terminu - stats: Pokazuje niektóre statystyki dotyczące gracza - teleporter: Zobacz punkty lokalizacji innych graczy - timings: Informacje o opóźnieniu na twoim serwerze - versions: Wyświetla listę wszystkich zainstalowanych dodatków - cheat: Daje graczowi przedmioty Slimefun. -gps: - deathpoint: "&4Punkt śmierci &7%date%" - geo: - scan-required: "&4Wymagany jest skan GEO-Skan! &cNajpierw zeskanuj ten fragment - za pomocą skanera GEO!" - insufficient-complexity: - - "&4Niewystarczająca złożoność sieci GPS: &c%complexity%" - - "&4a) Nie masz jeszcze skonfigurowanej sieci GPS" - - "&4b) Twoja sieć GPS nie jest wystarczająco złożona" - waypoint: - added: "&aPomyślnie dodano nowy punkt trasy" - max: "&4Osiągnięto maksymalną liczbę punktów trasy" - new: "&eProszę wpisać nazwę swojego nowego punktu trasy na czacie. &7(Kody kolorów - są obsługiwane!)" guide: - cheat: - no-multiblocks: "&4Nie możesz otrzymać Multibloków, musisz je zbudować!" - credits: - commit: Rejestracja zmian - commits: Rejestracje zmian - profile-link: Kliknij, aby odwiedzić ich profil na GitHub - roles: - developer: "&6Developer" - resourcepack: "&cArtysta paczki zasobów" - translator: "&9Tłumacz" - wiki: "&3Edytor Wiki" - languages: - select: Kliknij, aby wybrać ten język - select-default: Kliknij, aby wybrać domyślny język - selected-language: 'Aktualnie wybrane:' - translations: - lore: Kliknij, aby dodać własne tłumaczenie - name: "&aCzegoś brakuje?" - updated: "&aTwój język został pomyślnie ustawiony na: &b%lang%" - pages: - next: Kolejna strona - previous: Poprzednia strona search: + message: "&bCo chcesz wyszukać?" + name: "&7Szukaj..." + tooltip: "&bKliknij, aby wyszukać przedmiot" + inventory: 'Wyszukiwanie dla: % item%' lore: - "&bCo chcesz wyszukać?" - "&7Wpisz wyszukiwane hasło na czacie" - message: "&bCo chcesz wyszukać?" - name: "&7Szukaj..." + cheat: + no-multiblocks: "&4Nie możesz otrzymać Multibloków, musisz je zbudować!" + languages: + updated: "&aTwój język został pomyślnie ustawiony na: &b%lang%" + translations: + name: "&aCzegoś brakuje?" + lore: Kliknij, aby dodać własne tłumaczenie + select: Kliknij, aby wybrać ten język + select-default: Kliknij, aby wybrać domyślny język + selected-language: 'Aktualnie wybrane:' title: - addons: Dodatki dla Slimefun4 - bugs: Zgłaszanie błędów - credits: Autorzy Slimefun4 - languages: Wybierz preferowany język main: Przewodnik Slimefun settings: Ustawienia i informacje + languages: Wybierz preferowany język + credits: Autorzy Slimefun4 wiki: Wiki Slimefun4 + addons: Dodatki dla Slimefun4 + bugs: Zgłaszanie błędów + source: Kod Źródłowy + credits: + commit: Rejestracja zmian + commits: Rejestracje zmian + roles: + developer: "&6Developer" + wiki: "&3Edytor Wiki" + resourcepack: "&cArtysta paczki zasobów" + translator: "&9Tłumacz" + profile-link: Kliknij, aby odwiedzić ich profil na GitHub + pages: + previous: Poprzednia strona + next: Kolejna strona tooltips: open-category: Kliknij, aby otworzyć versions-notice: Jest to bardzo ważne przy zgłaszaniu błędów! -inventory: - no-access: "&4Nie masz dostępu do tego bloku" -languages: - cs: Czeski - de: Niemiecki - default: Domyślny serwera - el: Grecki - en: Język angielski - es: Hiszpański - fr: Francuski - he: Hebrajski - hu: Węgierski - id: Indonezyjski - it: Włoski - lv: Łotewski - nl: Holenderski - pl: Polski - pt: Portugalski (Portugalia) - pt-BR: Portugalski (Brazylia) - ru: Rosyjski - sk: Słowacki - sv: Szwedzki - vi: Wietnamski - zh-CN: Chiński (Chiny) - zh-TW: Chiński (Tajwan) -machines: - ANCIENT_ALTAR: - not-enough-pedestals: "&4Ołtarz nie jest otoczony potrzebną ilością cokołów &c(%pedestals% - / 8)" - unknown-catalyst: "&4Nieznany katalizator! &cZamiast tego użyj prawidłowego przepisu!" - unknown-recipe: "&4Nieznany przepis! &cZamiast tego użyj prawidłowego przepisu!" - ANCIENT_PEDESTAL: - obstructed: "&4Piedestał jest zablokowany! &cUsuń wszystko nad piedestałem!" - CARGO_NODES: - must-be-placed: "&4Musi być umieszczony na skrzyni lub maszynie!" - ELEVATOR: - click-to-teleport: "&eKliknij &7aby teleportować się na to piętro:" - current-floor: "&eTo jest piętro, na którym aktualnie jesteś:" - enter-name: "&7Wprowadź żądaną nazwę piętra na czacie. &r(Kody kolorów są obsługiwane!)" - named: "&2Pomyślnie nazwano podłogę: &r% floor%" - no-destinations: "&4Nie znaleziono miejsc docelowych" - pick-a-floor: "&3- Wybierz piętro-" - full-inventory: "&eEkwipunek jest pełny!" - HOLOGRAM_PROJECTOR: - enter-text: "&7Wprowadź żądany tekst hologramu na czacie. &r(Kody kolorów są obsługiwane!)" - ignition-chamber-no-flint: "&cDo Komory Zapłonowej brakuje Krzesiwa." - in-use: "&cEkwipunek tego bloku jest na razie otworzony przez innego gracza." - pattern-not-found: "&ePrzepraszamy, nie można rozpoznać tego przepisu. Umieść przedmioty - we właściwym wzorze w Dozowniku." - TELEPORTER: - cancelled: "&4Teleportacja anulowana!" - invulnerability: "&b&l Otrzymałeś(-aś) 30 sekund Niewrażliwości!" - teleported: "&3Przeteleportowano!" - teleporting: "&3Teleportuje..." - unknown-material: "&ePrzepraszamy, nie można rozpoznać przedmiotu w tym Dozowniku. - Proszę włożyć coś, co znam." - wrong-item: "&ePrzepraszamy, nie można rozpoznać przedmiotu, którym kliknąłeś(-aś) - mnie prawym przyciskiem myszy. Sprawdź przepisy i zobacz, jakich przedmiotów możesz - użyć." + wiki: Zobacz ten przedmiot na oficjalnej stronie Wiki Slimefun + recipes: + machine: Przepisy wykonane w tym urządzeniu + miner: Zasoby, które możesz uzyskać za pomocą tego Górnika + generator: Dostępne rodzaje paliwa + gold-pan: Zasoby, które możesz zdobyć + back: + title: Wstecz + guide: Wróć Do Przewodnika Slimefun + settings: Wróć Do Panelu Ustawień + locked: Zablokowany + locked-category: + - Aby odblokować tę kategorię, będziesz + - Musisz odblokować wszystkie przedmioty z + - Następujące kategorie messages: - cannot-place: "&cNie możesz umieścić tam tego bloku!" - diet-cookie: "&eZaczynasz czuć się bardzo lekko..." + not-researched: "&4Nie masz wystarczającej wiedzy, aby to zrozumieć" + not-enough-xp: "&4Nie masz wystarczająco doświadczenia, aby to odblokować" + unlocked: '&bOdblokowano &7"%research%"' + only-players: "&4To polecenie dotyczy tylko graczy" + unknown-player: "&4Nieznany gracz: &c%player%" + no-permission: "&4Brak uprawnień" + usage: "&4Użycie: &c%usage%" + not-online: "&4%player% &cnie jest online!" + not-valid-item: "&4%item% &cnie jest poprawnym przedmiotem!" + not-valid-amount: "&4%amount% &cnie jest prawidłową ilością: ilość musi być większa + od 0!" + given-item: '&bOtrzymano &a%amount% &7"%item%&7"' + give-item: '&bDodano przedmiot do plecaka gracza %player%: &a%amount% &7"%item%&7"' + not-valid-research: "&4%research% &cnie jest poprawnym Badaniem!" + give-research: '&bOdblokowano badanie &7"%research%&7" dla gracza %player%' + hungry: "&cJesteś zbyt głodny, żeby to zrobić!" + mode-change: "&bTryb urządzenia %device% został zmieniony na: &9%mode%" disabled-in-world: "&4&lTen przedmiot został wyłączony na tym świecie" disabled-item: "&4&l Ten przedmiot został wyłączony! Jak to w ogóle dostałeś(-aś)?" + no-tome-yourself: "&cNie możesz używać &4Księgi wiedzy &cna samym sobie..." + multimeter: "&bZmagazynowana energia: &3%stored% &b/ &3%capacity%" + talisman: + anvil: "&a&oTwój talizman uratował twoje narzędzie przed złamaniem" + miner: "&a&oTwój talizman podwoił twoje znaleziska" + hunter: "&a&oTwój talizman podwoił twoje znaleziska" + lava: "&a&oTwój talizman uratował cię przed spaleniem na śmierć" + water: "&a&oTwój talizman uratował cię przed utonięciem" + angel: "&a&oTwój talizman uratował cię przed odniesieniem obrażeń od upadku" + fire: "&a&oTwój talizman uratował cię przed spaleniem na śmierć" + magician: "&a&oTwój talizman dał ci dodatkowe zaklęcie" + traveller: "&a&oTwój talizman dał ci przyspieszenie prędkości" + warrior: "&a&oTwój talizman na pewien czas poprawił twoją siłę" + knight: "&a&oTwój talizman dał ci 5 sekund regeneracji" + whirlwind: "&a&oTwój talizman odbił pocisk" + wizard: "&a&oTwój talizman zapewnił ci lepszy poziom Szczęścia, ale może także + obniżył niektóre inne poziomy zaklinania" + soulbound-rune: + fail: "&cMożesz powiązać tylko jeden przedmiot ze swoją duszą na raz." + success: "&aPomyślnie powiązałeś(-aś) ten przedmiot ze swoją duszą! Zatrzymasz + go, gdy umrzesz." + research: + start: "&7Starożytne duchy szepczą ci do ucha tajemnicze słowa!" + progress: "&7 Zaczynasz się zastanawiać nad &b%research% &e(%progress%)" fire-extinguish: "&7Ty masz zgasły siebie." + cannot-place: "&cNie możesz umieścić tam tego bloku!" + no-pvp: "&c Nie możesz tutaj bić innych graczy!" + radiation: "&4Zostałeś(-aś) narażony na śmiertelne promieniowanie! &c Pozbądź się + radioaktywnego przedmiotu lub załóż kombinezon materiałów niebezpiecznych!" + opening-guide: "&bOtwieranie przewodnika, może to potrwać kilka sekund..." + opening-backpack: "&bOtwieranie plecaka, może to potrwać kilka sekund..." + no-iron-golem-heal: "&cTo nie jest sztabka żelaza. Nie możesz tego użyć do leczenia + Żelaznych Golemów!" + link-prompt: "&eKliknij tutaj:" + diet-cookie: "&eZaczynasz czuć się bardzo lekko..." fortune-cookie: - "&7Pomóż mi, jestem uwięziony w fabryce ciastek z wróżbami!" - "&7Jutro umrzesz... przez Creepera" @@ -192,56 +140,150 @@ messages: - "&742. Odpowiedź to 42." - "&7Walshy dziennie pomoże uniknąć kłopotów." - "&7Nigdy nie kop prosto w dół!" - give-item: '&bDodano przedmiot do plecaka gracza %player%: &a%amount% &7"%item%&7"' - given-item: '&bOtrzymano &a%amount% &7"%item%&7"' - hungry: "&cJesteś zbyt głodny, żeby to zrobić!" - link-prompt: "&eKliknij tutaj:" - mode-change: "&bTryb urządzenia %device% został zmieniony na: &9%mode%" - multimeter: "&bZmagazynowana energia: &3%stored% &b/ &3%capacity%" - no-iron-golem-heal: "&cTo nie jest sztabka żelaza. Nie możesz tego użyć do leczenia - Żelaznych Golemów!" - no-permission: "&4Brak uprawnień" - no-pvp: "&c Nie możesz tutaj bić innych graczy!" - not-enough-xp: "&4Nie masz wystarczająco doświadczenia, aby to odblokować" - no-tome-yourself: "&cNie możesz używać &4Księgi wiedzy &cna samym sobie..." - not-online: "&4%player% &cnie jest online!" - not-researched: "&4Nie masz wystarczającej wiedzy, aby to zrozumieć" - not-valid-amount: "&4%amount% &cnie jest prawidłową ilością: ilość musi być większa - od 0!" - not-valid-item: "&4%item% &cnie jest poprawnym przedmiotem!" - not-valid-research: "&4%research% &cnie jest poprawnym Badaniem!" - only-players: "&4To polecenie dotyczy tylko graczy" - opening-backpack: "&bOtwieranie plecaka, może to potrwać kilka sekund..." - opening-guide: "&bOtwieranie przewodnika, może to potrwać kilka sekund..." - radiation: "&4Zostałeś(-aś) narażony na śmiertelne promieniowanie! &c Pozbądź się - radioaktywnego przedmiotu lub załóż kombinezon materiałów niebezpiecznych!" - research: - progress: "&7 Zaczynasz się zastanawiać nad &b%research% &e(%progress%)" - start: "&7Starożytne duchy szepczą ci do ucha tajemnicze słowa!" - soulbound-rune: - fail: "&cMożesz powiązać tylko jeden przedmiot ze swoją duszą na raz." - success: "&aPomyślnie powiązałeś(-aś) ten przedmiot ze swoją duszą! Zatrzymasz - go, gdy umrzesz." - talisman: - angel: "&a&oTwój talizman uratował cię przed odniesieniem obrażeń od upadku" - anvil: "&a&oTwój talizman uratował twoje narzędzie przed złamaniem" - fire: "&a&oTwój talizman uratował cię przed spaleniem na śmierć" - hunter: "&a&oTwój talizman podwoił twoje znaleziska" - knight: "&a&oTwój talizman dał ci 5 sekund regeneracji" - lava: "&a&oTwój talizman uratował cię przed spaleniem na śmierć" - magician: "&a&oTwój talizman dał ci dodatkowe zaklęcie" - miner: "&a&oTwój talizman podwoił twoje znaleziska" - traveller: "&a&oTwój talizman dał ci przyspieszenie prędkości" - warrior: "&a&oTwój talizman na pewien czas poprawił twoją siłę" - water: "&a&oTwój talizman uratował cię przed utonięciem" - whirlwind: "&a&oTwój talizman odbił pocisk" - wizard: "&a&oTwój talizman zapewnił ci lepszy poziom Szczęścia, ale może także - obniżył niektóre inne poziomy zaklinania" - unknown-player: "&4Nieznany gracz: &c%player%" - unlocked: '&bOdblokowano &7"%research%"' - usage: "&4Użycie: &c%usage%" - give-research: '&bOdblokowano badanie &7"%research%&7" dla gracza %player%' -miner: - no-ores: "&eNie można znaleźć żadnych rud w pobliżu!" +machines: + pattern-not-found: "&ePrzepraszamy, nie można rozpoznać tego przepisu. Umieść przedmioty + we właściwym wzorze w Dozowniku." + unknown-material: "&ePrzepraszamy, nie można rozpoznać przedmiotu w tym Dozowniku. + Proszę włożyć coś, co znam." + wrong-item: "&ePrzepraszamy, nie można rozpoznać przedmiotu, którym kliknąłeś(-aś) + mnie prawym przyciskiem myszy. Sprawdź przepisy i zobacz, jakich przedmiotów możesz + użyć." + full-inventory: "&eEkwipunek jest pełny!" + in-use: "&cEkwipunek tego bloku jest na razie otworzony przez innego gracza." + ignition-chamber-no-flint: "&cDo Komory Zapłonowej brakuje Krzesiwa." + ANCIENT_ALTAR: + not-enough-pedestals: "&4Ołtarz nie jest otoczony potrzebną ilością cokołów &c(%pedestals% + / 8)" + unknown-catalyst: "&4Nieznany katalizator! &cZamiast tego użyj prawidłowego przepisu!" + unknown-recipe: "&4Nieznany przepis! &cZamiast tego użyj prawidłowego przepisu!" + ANCIENT_PEDESTAL: + obstructed: "&4Piedestał jest zablokowany! &cUsuń wszystko nad piedestałem!" + HOLOGRAM_PROJECTOR: + enter-text: "&7Wprowadź żądany tekst hologramu na czacie. &r(Kody kolorów są obsługiwane!)" + inventory-title: Edytor hologramów + ELEVATOR: + no-destinations: "&4Nie znaleziono miejsc docelowych" + pick-a-floor: "&3- Wybierz piętro-" + current-floor: "&eTo jest piętro, na którym aktualnie jesteś:" + click-to-teleport: "&eKliknij &7aby teleportować się na to piętro:" + enter-name: "&7Wprowadź żądaną nazwę piętra na czacie. &r(Kody kolorów są obsługiwane!)" + named: "&2Pomyślnie nazwano podłogę: &r% floor%" + TELEPORTER: + teleporting: "&3Teleportuje..." + teleported: "&3Przeteleportowano!" + cancelled: "&4Teleportacja anulowana!" + invulnerability: "&b&l Otrzymałeś(-aś) 30 sekund Niewrażliwości!" + gui: + title: Twoje punkty trasy + tooltip: Kliknij, aby się teleportować + time: Szacowany czas + CARGO_NODES: + must-be-placed: "&4Musi być umieszczony na skrzyni lub maszynie!" + GPS_CONTROL_PANEL: + title: GPS - Panel sterowania + transmitters: Transmiter Przegląd + waypoints: Waypoint Przegląd +anvil: + not-working: "&4Nie możesz używać przedmiotów Slimefun w kowadle!" +backpack: + already-open: "&cPrzepraszamy, ten plecak jest otwarty gdzie indziej!" + no-stack: "&cNie możesz stakować plecaków" workbench: not-enhanced: "&4Nie można używać przedmiotów Slimefun w zwykłym stole warsztatowym" +gps: + deathpoint: "&4Punkt śmierci &7%date%" + waypoint: + new: "&eProszę wpisać nazwę swojego nowego punktu trasy na czacie. &7(Kody kolorów + są obsługiwane!)" + added: "&aPomyślnie dodano nowy punkt trasy" + max: "&4Osiągnięto maksymalną liczbę punktów trasy" + insufficient-complexity: + - "&4Niewystarczająca złożoność sieci GPS: &c%complexity%" + - "&4a) Nie masz jeszcze skonfigurowanej sieci GPS" + - "&4b) Twoja sieć GPS nie jest wystarczająco złożona" + geo: + scan-required: "&4Wymagany jest skan GEO-Skan! &cNajpierw zeskanuj ten fragment + za pomocą skanera GEO!" +inventory: + no-access: "&4Nie masz dostępu do tego bloku" +android: + started: "&7Twój Android wznowił swój skrypt" + stopped: "&7Twój Android wstrzymał swój skrypt" + scripts: + already-uploaded: "&4Ten skrypt został już przesłany." + instructions: + START: "&2Uruchom skrypt" + REPEAT: "&9 Powtórz skrypt" + WAIT: "&ePoczekaj 0.5s" + GO_FORWARD: "&7Idź do przodu" + GO_UP: "&7Idź do góry" + GO_DOWN: "&7Idź w dół" + TURN_LEFT: "&7Skręć w lewo" + TURN_RIGHT: "&7Skręć w prawo" + DIG_UP: "&bKop w górę" + DIG_FORWARD: "&bKop do przodu" + DIG_DOWN: "&bKop w dół" + MOVE_AND_DIG_UP: "&bIdź i kop w górę" + MOVE_AND_DIG_FORWARD: "&bIdź i kop do przodu" + MOVE_AND_DIG_DOWN: "&bIdź i kop w dół" + ATTACK_MOBS_ANIMALS: "&4Atakuj &c(Wrogie Moby i Zwierzęta)" + ATTACK_MOBS: "&4Atakuj &c(Wrogie Moby)" + ATTACK_ANIMALS: "&4Atakuj &c(Zwierzęta)" + ATTACK_ANIMALS_ADULT: "&4Atakuj &c(Zwierzęta &7[Dorosłe]&c)" + CHOP_TREE: "&cTnij drzewo i posadź sadzonkę" + CATCH_FISH: "&bŁów ryby" + FARM_FORWARD: "&bZbieraj i posadź z powrotem" + FARM_DOWN: "&bZbieraj i posadź z powrotem &7(Blok pod spodem)" + FARM_EXOTIC_FORWARD: "&6Zaawansowanie zbieraj i posadź z powrotem" + FARM_EXOTIC_DOWN: "&bZaawansowanie zbieraj i posadź z powrotem &7(Blok pod spodem)" + INTERFACE_ITEMS: "&9Wyślij zawartość ekwipunku do Interfejsu w obecnym kierunku" + INTERFACE_FUEL: "&cOtrzymaj paliwo z Interfejsu w obecnym kierunku" + enter-name: + - + - "&eProszę wpisać nazwę dla tego skryptu" + uploaded: + - "&bPrzesyłanie..." + - "&aPomyślnie przesłano twój skrypt!" + rating: + own: "&4Nie możesz ocenić własnego skryptu!" + already: "&4Oceniłeś już ten skrypt!" + editor: Edytor skryptów +languages: + default: Domyślny serwera + en: Język angielski + de: Niemiecki + fr: Francuski + it: Włoski + es: Hiszpański + pl: Polski + sv: Szwedzki + nl: Holenderski + cs: Czeski + hu: Węgierski + lv: Łotewski + ru: Rosyjski + sk: Słowacki + zh-TW: Chiński (Tajwan) + vi: Wietnamski + id: Indonezyjski + zh-CN: Chiński (Chiny) + el: Grecki + he: Hebrajski + pt-BR: Portugalski (Brazylia) + ar: Arabski (Arabic) + af: Afrykański (Afrikaans) + da: Duński (Danish) + fi: Fiński (Finnish) + uk: Ukraiński (Ukrainian) + ms: Malajski (Malay) + 'no': Norweski + ja: Japonia + fa: Perski + th: Tajski + ro: Rumuński + pt: Portugalski (Portugalia) + bg: Bułgarski + ko: Koreański + tr: Turecki +miner: + no-ores: "&eNie można znaleźć żadnych rud w pobliżu!" diff --git a/src/main/resources/languages/messages_ru.yml b/src/main/resources/languages/messages_ru.yml index ac987a0e4..4b17e07f9 100644 --- a/src/main/resources/languages/messages_ru.yml +++ b/src/main/resources/languages/messages_ru.yml @@ -1,249 +1,139 @@ --- -android: - scripts: - already-uploaded: "&4Этот скрипт уже был загружен." - editor: Редактор скриптов - enter-name: - - - - "&eПожалуйста, введите название для Вашего скрипта" - instructions: - ATTACK_ANIMALS: "&4Атаковать &c(скот)" - ATTACK_ANIMALS_ADULT: "&4Атаковать &c(скот &7[взрослый]&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Собрать урожай и пересадить &7(блок снизу)" - FARM_EXOTIC_DOWN: "&bПродвинутая сборка урожая и пересадка &7(блок снизу)" - FARM_EXOTIC_FORWARD: "&bПродвинутая сборка урожая и пересадка" - FARM_FORWARD: "&bСобрать урожай и пересадить" - GO_DOWN: "&7Двинуться вниз" - GO_FORWARD: "&7Двинуться вперёд" - GO_UP: "&7Двинуться вверх" - INTERFACE_FUEL: "&cВосполнить топливо из хранилища спереди" - INTERFACE_ITEMS: "&9Сложить хранимые предметы в хранилище спереди" - 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Вы не можете использовать Slimefun предметы в наковальне!" -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: Вывести список установленных дополнений backpack: description: Заполучить копию существующего рюкзака invalid-id: "&4Идентификатор должен быть неотрицательным числом!" player-never-joined: "&4Игрок с таким ником не найден!" backpack-does-not-exist: "&4Указанный рюкзак не существует!" restored-backpack-given: "&aРюкзак был восстановлен и добавлен в Ваш инвентарь!" -gps: - deathpoint: "&4Точка смерти &7%date%" - geo: - scan-required: "&4Требуется геосканирование! &cПроанализируйте чанк при помощи - GPS-геосканера для начала!" - insufficient-complexity: - - "&4Недостаточная общая сила сигнала GPS сети: &c%complexity%" - - "&4а) Ваша GPS сеть пока что не подключена" - - "&4б) У Вашей GPS сети недостаточная сила сигнала" - waypoint: - added: "&aКонтрольная точка успешно добавлена" - max: "&4Вы достигли максимального количества контрольных точек" - new: "&eПожалуйста, введите название новой контрольной точки в чат. &7(можно использовать - цветовые коды!)" guide: - back: - guide: Вернуться к руководству Slimefun - settings: Вернуться к настройкам - title: Назад + search: + message: "&bЧто бы Вы хотели найти?" + name: "&7Поиск…" + tooltip: "&bНажмите для поиска предмета" + inventory: 'Поиск: %item%' + lore: + - "&bЧто бы Вы хотели найти?" + - "&7Введите поисковый запрос в чат" cheat: no-multiblocks: "&4Вы не можете выдать себе постройку, она должна быть построена в мире!" - credits: - commit: Коммит - commits: Коммитов - profile-link: Нажмите, чтобы посетить GitHub профиль - roles: - developer: "&6Разработчик" - resourcepack: "&cТекстурщик" - translator: "&9Локализатор" - wiki: "&3Редактор Вики" 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 Вики + addons: Дополнения к Slimefun4 + bugs: Отчёты об ошибках + source: Исходный код + credits: + commit: Коммит + commits: Коммитов + roles: + developer: "&6Разработчик" + wiki: "&3Редактор Вики" + resourcepack: "&cТекстурщик" + translator: "&9Локализатор" + profile-link: Нажмите, чтобы посетить GitHub профиль + pages: + previous: Предыдущая страница + next: Следующая страница + tooltips: + open-category: Нажмите, чтобы открыть + versions-notice: Это очень важно, когда Вы сообщаете об ошибках! + wiki: Просмотреть этот предмет на официальной Slimefun Вики + recipes: + machine: Рецепты, доступные в этой машине + miner: Ресурсы, добываемые этим шахтёром + generator: Доступные виды топлива + gold-pan: Ресурсы, которые Вы можете получить + back: + title: Назад + guide: Вернуться к руководству Slimefun + settings: Вернуться к настройкам locked: ЗАБЛОКИРОВАНО locked-category: - Для начала Вы должны - разблокировать все предметы - из следующих категорий - pages: - next: Следующая страница - previous: Предыдущая страница - search: - inventory: 'Поиск: %item%' - lore: - - "&bЧто бы Вы хотели найти?" - - "&7Введите поисковый запрос в чат" - message: "&bЧто бы Вы хотели найти?" - name: "&7Поиск…" - tooltip: "&bНажмите для поиска предмета" - title: - addons: Дополнения к Slimefun4 - bugs: Отчёты об ошибках - credits: Авторы Slimefun4 - languages: Выберите Ваш предпочитаемый язык - main: Руководство Slimefun - settings: Информация и настройки - source: Исходный код - wiki: Slimefun4 Вики - tooltips: - open-category: Нажмите, чтобы открыть - recipes: - generator: Доступные виды топлива - gold-pan: Ресурсы, которые Вы можете получить - machine: Рецепты, доступные в этой машине - miner: Ресурсы, добываемые этим шахтёром - versions-notice: Это очень важно, когда Вы сообщаете об ошибках! - wiki: Просмотреть этот предмет на официальной Slimefun Вики -inventory: - no-access: "&4У Вас нет доступа к этому блоку" -languages: - af: Бурский - ar: Арабский - be: Белорусский - bg: Болгарский - cs: Чешский - da: Датский - de: Немецкий - default: По умолчанию - el: Греческий - en: Английский - es: Испанский - fa: Персидский - fi: Финский - fr: Французский - he: Иврит - hr: Хорватский - hu: Венгерский - id: Индонезийский - it: Итальянский - ja: Японский - ko: Корейский - lv: Латышский - mk: Македонский - ms: Малайский - nl: Нидерландский - 'no': Норвержский - pl: Польский - pt: Португальский (Португалия) - pt-BR: Португальский (Бразилия) - ro: Румынский - ru: Русский - sk: Словацкий - sr: Сербский - 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К сожалению, не удалось распознать предмет, которым Вы кликнули. - Проверьте рецепты и посмотрите, какие предметы Вы можете использовать." - 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%!" 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не является допустимым числом: количество должно + быть больше нуля!" + 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Ваш талисман повысил Вашу скорость" + 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Вы не можете вступать в PvP здесь!" + radiation: "&4Вы подвергались смертельной радиации! &cИзбавьтесь от всех радиоактивных + предметов или наденьте костюм химзащиты!" + opening-guide: "&bОткрытие руководства, это может занять некоторое время…" + opening-backpack: "&bОткрытие рюкзака, это может занять некоторое время…" + no-iron-golem-heal: "&cЭтот предмет не является железным слитком. Его нельзя использовать + для починки железных големов!" + link-prompt: "&eНажмите сюда:" + diet-cookie: "&eВы ощущаете невероятное облегчение…" fortune-cookie: - "&7Помогите! Я в плену на фабрике печений с предсказаниями!" - "&7Уже завтра ты умрёшь… от любезного Крипера" @@ -257,56 +147,171 @@ messages: - "&742. Ответ – 42." - "&7Бед не ждите в этот день – Walshy гонит грусти тень." - "&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Вы не можете вступать в PvP здесь!" - not-enough-xp: "&4У Вас недостаточно опыта, чтобы исследовать это" - no-tome-yourself: "&cВы не можете использовать &4том обмена знаниями &cна себе…" - not-online: "&4%player% &cсейчас не в игре!" - not-researched: "&4Вам не хватает знаний, чтобы понять это" - not-valid-amount: "&4%amount% &cне является допустимым числом: количество должно - быть больше нуля!" - 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Ваш талисман повысил Вашу скорость" - 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Вы не можете использовать Slimefun предметы в наковальне!" +backpack: + already-open: "&cИзвините, этот рюкзак уже открыт в другом месте!" + no-stack: "&cВы не можете складывать рюкзаки вместе" workbench: not-enhanced: "&4Вы не можете использовать Slimefun предметы в обычном верстаке" +gps: + deathpoint: "&4Точка смерти &7%date%" + waypoint: + new: "&eПожалуйста, введите название новой контрольной точки в чат. &7(можно использовать + цветовые коды!)" + added: "&aКонтрольная точка успешно добавлена" + max: "&4Вы достигли максимального количества контрольных точек" + insufficient-complexity: + - "&4Недостаточная общая сила сигнала GPS сети: &c%complexity%" + - "&4а) Ваша GPS сеть пока что не подключена" + - "&4б) У Вашей GPS сети недостаточная сила сигнала" + geo: + scan-required: "&4Требуется геосканирование! &cПроанализируйте чанк при помощи + GPS-геосканера для начала!" +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(скот &7[взрослый]&c)" + CHOP_TREE: "&cСрубить и пересадить" + CATCH_FISH: "&bВыловить рыбу" + FARM_FORWARD: "&bСобрать урожай и пересадить" + FARM_DOWN: "&bСобрать урожай и пересадить &7(блок снизу)" + FARM_EXOTIC_FORWARD: "&bПродвинутая сборка урожая и пересадка" + FARM_EXOTIC_DOWN: "&bПродвинутая сборка урожая и пересадка &7(блок снизу)" + INTERFACE_ITEMS: "&9Сложить хранимые предметы в хранилище спереди" + 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К сожалению, не удалось найти какую-либо руду поблизости!" diff --git a/src/main/resources/languages/messages_tl.yml b/src/main/resources/languages/messages_tl.yml index 647d43970..644547da4 100644 --- a/src/main/resources/languages/messages_tl.yml +++ b/src/main/resources/languages/messages_tl.yml @@ -4,19 +4,19 @@ commands: cheat: Pinapayagan kang dayain ang mga Aytem sa Slimefun. give: Nagbibigay ito ng mga Aytem sa Slimefun. guide: Bibigyan ka nito ng Simefun Guide. - timings: Lag-Info patungkol sa iyong server. + timings: Lag-info patungkol sa iyong server. teleporter: Tingnan ang mga Waypoints ng mga Players. - versions: Ipapakita nito ang mga na-install na Addon sa Slimefun. + versions: Ipapakita nito ang mga na-install na mga Addon sa Slimefun. search: Hahanapin sa Guide ang binigyan na katawagan. - open_guide: Bubuksan nito ang Slimefun's Guide na wala ang libro. - stats: Ipapakita ang hindi karamihan na Estatistika ng Player. + open_guide: Bubuksan nito ang Slimefun's guide na wala ang libro. + stats: Ipapakita ang hindi karamihan na estatistika ng Player. research: description: Iaunlock/Irereset ang mga Researches para sa Player. reset: "&cNareset mo ang Knowledge para kay %player%." reset-target: "&cNareset ang iyong Knowledge." backpack: - description: Kunin ang isang kopya ng isang umiiral na backpack - invalid-id: "&4Ang id ay dapat na isang hindi negatibong numero!" + description: Kunin ang kopya ng isang umiiral na backpack. + invalid-id: "&4Ang ID ay dapat merong isang negatibong numero!" player-never-joined: "&4Walang nahanap na manlalaro na may pangalang iyon!" backpack-does-not-exist: "&4Ang tinukoy na backpack ay hindi umiiral!" restored-backpack-given: "&aAng iyong backpack ay naibalik at naidagdag sa iyong @@ -25,7 +25,7 @@ guide: search: message: "&bAno ang hinahanap mo?" name: "&7Hanap..." - tooltip: "&bI-click upang maghanap para sa isang item" + tooltip: "&bI-click ito upang maghanap para sa isang item." inventory: 'Naghahanap para sa: %item%' cheat: no-multiblocks: "&4Hindi ka puwedeng mag-daya sa Multiblocks, kailangan mo itong @@ -34,9 +34,9 @@ guide: updated: "&aNapalitan na ang iyong wika sa: &b%lang%" translations: name: "&aMay kulang ba?" - lore: I-click upang magdagdag ng iyong sariling pagsasalin - select: I-click upang piliin ang wikang ito - select-default: I-click upang piliin ang default na wika + lore: I-click ito upang magdagdag ng iyong sariling pagsasalin. + select: I-click ito upang piliin ang wikang ito. + select-default: I-click ito upang piliin ang default na wika. selected-language: 'Kasalukuyang pinili:' title: main: Slimefun Guide @@ -55,28 +55,28 @@ guide: wiki: "&3Wiki Editor" resourcepack: "&cResourcepack Artist" translator: "&9Translator" - profile-link: I-click upang bisitahin ang kanilang profile sa GitHub + profile-link: I-click ito upang bisitahin ang kanilang profile sa GitHub. pages: - previous: Nakaraang pahina - next: Susunod na pahina + previous: Nakaraang pahina. + next: Susunod na pahina. tooltips: - open-category: I-click upang buksan + open-category: I-click ito para buksan. versions-notice: Napakahalaga ng mga ito kapag nag-uulat ng mga bug! - wiki: Tingnan ang item na ito sa opisyal na Slimefun Wiki + wiki: Tingnan ang item na ito sa opisyal na Slimefun Wiki. recipes: - machine: Mga recipe na ginawa sa Makina na ito - miner: Mga mapagkukunan na maaari mong makuha sa Miner na ito - generator: Magagamit na mga uri ng gasolina - gold-pan: Mga mapagkukunan na maaari mong makuha + machine: Mga recipe na ginawa sa Makina na ito. + miner: Mga mapagkukunan na maaari mong makuha sa Miner na ito. + generator: Magagamit na mga uri ng gasolina. + gold-pan: Mga mapagkukunan na maaari mong makuha. back: title: Balik guide: Bumalik sa Slimefun Guide settings: Bumalik sa Settings Panel locked: NAKAKANDADO locked-category: - - Upang i-unlock ang kategoryang ito + - Upang i-unlock ang kategoryang ito, - kailangang i-unlock ang lahat ng mga item mula sa - - sumusunod na mga kategorya + - sumusunod na kategorya. messages: not-researched: "&4Kulang ang iyong Knowledge upang ito'y maintindihan." not-enough-xp: "&4Kulang ang iyong XP upang ito'y ma-unlock." @@ -148,6 +148,10 @@ messages: - "&742. Ang sagot ay 42." - "&7Ang isang Walshy sa isang araw ay maiiwasan ang problema." - "&7Huwag kang maghukay na diretso pababa!" + - "&7Ito ay ngunit isang sugat sa laman!" + - "&7Laging tumingin sa maliwanag na bahagi ng buhay!" + - "&7Biskwit pala ito at hindi ito siya Kukis." + - "&7Ang astig ng mga Neon Signs!" machines: pattern-not-found: "&ePasensiya na, hindi ko maintindihan ang Recipe na ito. Pakilagay ang mga Aytem sa tamang pattern sa loob ng Dispense." @@ -186,9 +190,9 @@ machines: cancelled: "&4Na-kansel ang teleportation!" invulnerability: "&b&lBinigyan ka ng 30 segundo ng Invulnerability!" gui: - title: Ang iyong mga waypoints - tooltip: I-click para mag-teleport - time: Tinatayang oras + title: Ang iyong mga waypoints. + tooltip: I-click ito para mag-teleport. + time: Tinatayang oras. CARGO_NODES: must-be-placed: "&4Kailangang mailagay ito sa isang chest o makina!" GPS_CONTROL_PANEL: @@ -203,8 +207,8 @@ machines: piston-space: "&cAng dalawang piston ay kailangang magkaroon ng isang walang laman na block sa itaas ng mga ito!" destroyed: "&cAng iyong Industrial Miner ay nawasak." - already-running: "&cAng Industrial Miner na ito ay tumatakbo na!" - full-chest: "&cAng chest ng iyong Industrial Miner ay puno!" + already-running: "&cAng Industrial Miner na ito ay gumagana na!" + full-chest: "&cAng chest ng iyong Industrial Miner ay puno na!" no-permission: "&4Mukhang wala kang pahintulot upang mapatakbo ang isang Industrial Miner dito!" finished: "&eTapos na ang iyong Industrial Miner! Nakuha nito ang isang kabuuang @@ -212,7 +216,7 @@ machines: anvil: not-working: "&4Hindi puwedeng gamitin ang mga Slimefun Aytem sa isang Anvil!" backpack: - already-open: "&cPasensiya na, ang backpack na ito ay nakabukas na sa ibang lugar!" + already-open: "&cSorry, ang backpack na ito ay nakabukas na sa ibang lugar!" no-stack: "&cHindi puwedeng i-stack ang mga Backpack." workbench: not-enhanced: "&4Hindi puwedeng gamitin ang mga Slimefun Aytem sa normal na workbench." @@ -221,7 +225,7 @@ gps: waypoint: new: "&eMangyaring mag-type ng isang pangalan para sa iyong bagong waypoint sa chat. &7(Supported ang Color Codes!)" - added: "&aTagumpay ang pag-add ng bagong waypoint" + added: "&aTagumpay ang pag-add ng bagong waypoint." max: "&4Naabot mo na ang maximum amount ng waypoints." insufficient-complexity: - "&4Kulang ang GPS Network Complexity: &c%complexity%" @@ -238,20 +242,20 @@ android: scripts: already-uploaded: "&4Na-upload na ang script na ito." instructions: - START: "&2Simulan ang Script" - REPEAT: "&9Ulitin ang Script" + START: "&2Simulan ang Script." + REPEAT: "&9Ulitin ang Script." WAIT: "&eHintay 0.5s" - GO_FORWARD: "&7Umabante" - GO_UP: "&7Pataas" - GO_DOWN: "&7Pababa" - TURN_LEFT: "&7Lumiko pakaliwa" - TURN_RIGHT: "&7Lumiko pakanan" - DIG_UP: "&bMaghukay pataas" - DIG_FORWARD: "&bMaghukay paabante" - DIG_DOWN: "&bMaghukay pababa" - MOVE_AND_DIG_UP: "&bGumalaw at Maghukay pataas" - MOVE_AND_DIG_FORWARD: "&bGumalaw at Maghukay paabante" - MOVE_AND_DIG_DOWN: "&bGumalaw at Maghukay pababa" + GO_FORWARD: "&7Umabante." + GO_UP: "&7Pataas." + GO_DOWN: "&7Pababa." + TURN_LEFT: "&7Lumiko pakaliwa." + TURN_RIGHT: "&7Lumiko pakanan." + DIG_UP: "&bMaghukay pataas." + DIG_FORWARD: "&bMaghukay paabante." + DIG_DOWN: "&bMaghukay pababa." + MOVE_AND_DIG_UP: "&bGumalaw at Maghukay pataas." + MOVE_AND_DIG_FORWARD: "&bGumalaw at Maghukay paabante." + MOVE_AND_DIG_DOWN: "&bGumalaw at Maghukay pababa." ATTACK_MOBS_ANIMALS: "&4Atake &c(Mga matatapang na mobs at mga hayop)" ATTACK_MOBS: "&4Atake &c(Mga matatapang na mobs)" ATTACK_ANIMALS: "&4Atake &c(Mga hayop)" @@ -271,8 +275,8 @@ android: - "&bUploading..." - "&aTagumpay ang pag-upload ng script!" rating: - own: "&4Hindi puwedeng i-rate ang sarili mong script!" - already: "&4Nakapag-iwan ka na ng Rating para sa script na ito!" + own: "&4Hindi puwedeng i-marka ang sarili mong script!" + already: "&4Nakapag-iwan ka na ng marka para sa script na ito!" editor: Script Editor languages: default: Server-Default @@ -315,3 +319,4 @@ languages: mk: Macedonian sr: Serbian be: Belarusian + tl: Tagalog/Filipino diff --git a/src/main/resources/languages/messages_tr.yml b/src/main/resources/languages/messages_tr.yml index 613d0dd7d..3dd4e8ea2 100644 --- a/src/main/resources/languages/messages_tr.yml +++ b/src/main/resources/languages/messages_tr.yml @@ -1,247 +1,138 @@ --- -android: - scripts: - already-uploaded: "&4Bu senaryo zaten yüklendi." - editor: Senaryo Editörü - enter-name: - - - - "&eLütfen senaryonuz için bir ad yazınız" - instructions: - ATTACK_ANIMALS: "&4Saldır &c(Hayvanlar)" - ATTACK_ANIMALS_ADULT: "&4Saldır &c(Hayvanlar &7[Yetişkin]&c)" - ATTACK_MOBS: "&4Saldır &c(Canavarlar)" - ATTACK_MOBS_ANIMALS: "&4Saldır &c(Canavarlar & Hayvanlar)" - CATCH_FISH: "&bBalık Tut" - CHOP_TREE: "&cKes ve Ek" - DIG_DOWN: "&bAltını Kaz" - DIG_FORWARD: "&bİleriyi Kaz" - DIG_UP: "&bYukarıyı Kaz" - FARM_DOWN: "&bToplama ve Ekim &7(Altındaki blok)" - FARM_EXOTIC_DOWN: "&bGelişmişce Topla ve Ek &7(Altındaki blok)" - FARM_EXOTIC_FORWARD: "&bGelişmişce Topla ve Ek" - FARM_FORWARD: "&bTopla ve Ek" - GO_DOWN: "&7Aşağıya İn" - GO_FORWARD: "&7İleri Git" - GO_UP: "&7Yukarı Çık" - INTERFACE_FUEL: "&cÖndeki Arayüzden Yakıt çek" - INTERFACE_ITEMS: "&9Envanter İçeriğini öndeki Arayüze aktar" - MOVE_AND_DIG_DOWN: "&bİlerle ve Altını Kaz" - MOVE_AND_DIG_FORWARD: "&bİlerle ve İleriyi Kaz" - MOVE_AND_DIG_UP: "&bİlerle ve Yukarıyı Kaz" - REPEAT: "&9Senaryoyu Tekrar Et" - START: "&2Senaryoyu başlat" - TURN_LEFT: "&7Sola Dön" - TURN_RIGHT: "&7Sağa Dön" - WAIT: "&e0.5s Bekle" - rating: - already: "&4Bu senaryo için zaten oy kullandın!" - own: "&4Kendi senaryonu oylayamazın!" - uploaded: - - "&bYükleniyor..." - - "&aSenaryon başarıyla yüklendi!" - started: "&7Androidiniz senaryoyu uygulamaya devam ediyor" - stopped: "&7Androidiniz senaryoyu duraklattı" -anvil: - not-working: "&4Slimefun eşyalarını örste kullanamazsın!" -backpack: - already-open: "&cÜzgünüm, bu Sırt Çantası başka bir yerde açık!" - no-stack: "&cSırt Çantalarını istifleyemezsiniz" commands: + help: Yardım ekranını görüntüler cheat: Hile Yapmanıza olanak sağlar give: Birisine Slimefun Eşyası verir guide: Kendinize bir Slimefun Rehberi verir - help: Yardım ekranını görüntüler + timings: |- + Sunucunuz Hakkında Gecikme Bilgisini + gösterir + teleporter: Diğer Bir Oyuncunun Yer Noktalarına Bakın + versions: Yüklü tüm Eklentileri listeler + search: Rehberinizde belirtilen eşyayı arar open_guide: Kitabı kullanmadan Slimefun Rehberini açar + stats: Oyuncu hakkında bazı İstatistikleri Gösterir research: description: Bir oyuncu için araştırmaların kilidini açma / sıfırlama reset: "&c %player%'ın Bilgisini sıfırladınız" reset-target: "&cBilginiz sıfırlandı" - search: Rehberinizde belirtilen eşyayı arar - stats: Oyuncu hakkında bazı İstatistikleri Gösterir - teleporter: Diğer Bir Oyuncunun Yer Noktalarına Bakın - timings: |- - Sunucunuz Hakkında Gecikme Bilgisini - gösterir - versions: Yüklü tüm Eklentileri listeler backpack: description: Varolan bir sırt çantasının kopyasını elde et invalid-id: "&4Id negatif olmayan bir numara olmalı!" player-never-joined: "&4Bu adda bir oyuncu bulunamadı!" backpack-does-not-exist: "&4Böyle bir sırt çantası yok." restored-backpack-given: "&aSırt çantanız bulundu ve envanterinize teslim edildi!" -gps: - deathpoint: "&4Ölüm Noktası &7%date%" - geo: - scan-required: "&4GEO-Taraması gerekli! &cİlk önce bir GEO-Tarayıcı kullanarak - bu bölgeyi tarayın!" - insufficient-complexity: - - "&4Yetersiz GPS Ağ Gücü: &c%complexity%" - - "&4a) Henüz bir GPS Ağı kurulumunuz yok" - - "&4b) GPS Ağınız yeterince güçlü değil" - waypoint: - added: "&aYeni bir yer noktası başarıyla eklendi" - max: "&4Maksimum yer noktası sayısına ulaştınız" - new: "&eLütfen sohbette yeni yer noktanız için bir ad yazın. &7(Renk Kodları destekleniyor!)" guide: - back: - guide: Slimefun Rehberine geri dön - settings: Ayarlar Paneline geri dön - title: Geri + search: + message: "&bNe aramak istersiniz?" + name: "&7Ara..." + tooltip: "&bBir eşyayı aramak için tıklayın" + inventory: 'Eşya aranıyor: %item%' + lore: + - "&bNe aramak istersiniz?" + - "&7Arama teriminizi sohbete yazınız." cheat: no-multiblocks: "&4Yapı Oluşturmada hile yapamazsınız, onları inşa etmelisiniz!" - credits: - commit: Geliştiirme - commits: Geliştirmeler - profile-link: GitHubdaki profillerini ziyaret etmek için tıklayın - roles: - developer: "&6Geliştirici" - resourcepack: "&cKaynak Paketi Tasarımcısı" - translator: "&9Çevirmen" - wiki: "&3Wiki Editörü" languages: + updated: "&aDiliniz başarıyla ayarlandı: &b%lang%" + translations: + name: "&aBir şeyler mi eksik?" + lore: Kendi çevirinizi eklemek için tıklayın select: Bu dili seçmek için tıklayın select-default: Varsayılan dili seçmek için tıklayın selected-language: 'Şuan seçili:' - translations: - lore: Kendi çevirinizi eklemek için tıklayın - name: "&aBir şeyler mi eksik?" - updated: "&aDiliniz başarıyla ayarlandı: &b%lang%" + title: + main: Slimefun Rehberi + settings: Ayarlar & Bilgi + languages: Tercih ettiğiniz dili seçin + credits: Slimefun4 Katkıda Bulunanlar + wiki: Slimefun4 Wiki + addons: Slimefun4 için Eklentiler + bugs: Hata Raporları + source: Kaynak Kodu + credits: + commit: Geliştiirme + commits: Geliştirmeler + roles: + developer: "&6Geliştirici" + wiki: "&3Wiki Editörü" + resourcepack: "&cKaynak Paketi Tasarımcısı" + translator: "&9Çevirmen" + profile-link: GitHubdaki profillerini ziyaret etmek için tıklayın + pages: + previous: Önceki sayfa + next: Sonraki sayfa + tooltips: + open-category: Açmak için tıklayın + versions-notice: Hata bildirirken bunlar çok önemlidir! + wiki: Bu eşyayı Slimefun Wikisinde görüntüle + recipes: + machine: Bu makinede üretilen tarifler + miner: Bu madenciyle elde edebileceğin kaynaklar + generator: Müsait yakıt türleri + gold-pan: Elde edebileceğin kaynaklar + back: + title: Geri + guide: Slimefun Rehberine geri dön + settings: Ayarlar Paneline geri dön locked: KİLİTLİ locked-category: - Bu kategoriyi açmak için - aşağıdaki kategorilerde bulunan - bütün eşyaları açın - pages: - next: Sonraki sayfa - previous: Önceki sayfa - search: - inventory: 'Eşya aranıyor: %item%' - lore: - - "&bNe aramak istersiniz?" - - "&7Arama teriminizi sohbete yazınız." - message: "&bNe aramak istersiniz?" - name: "&7Ara..." - tooltip: "&bBir eşyayı aramak için tıklayın" - title: - addons: Slimefun4 için Eklentiler - bugs: Hata Raporları - credits: Slimefun4 Katkıda Bulunanlar - languages: Tercih ettiğiniz dili seçin - main: Slimefun Rehberi - settings: Ayarlar & Bilgi - source: Kaynak Kodu - wiki: Slimefun4 Wiki - tooltips: - open-category: Açmak için tıklayın - recipes: - generator: Müsait yakıt türleri - gold-pan: Elde edebileceğin kaynaklar - machine: Bu makinede üretilen tarifler - miner: Bu madenciyle elde edebileceğin kaynaklar - versions-notice: Hata bildirirken bunlar çok önemlidir! - wiki: Bu eşyayı Slimefun Wikisinde görüntüle -inventory: - no-access: "&4Bu bloğa erişmenize izin verilmiyor" -languages: - af: Afrikanca - ar: Arapça - bg: Bulgarca - cs: Çekce - da: Danca - de: Almanca - default: Sunucu Varsayılanı - el: Yunanca - en: İngilizce - es: İspanyolca - fa: Persçe - fi: Fince - fr: Fransızca - he: İbranice - hu: Macarca - id: Endonezyaca - it: İtalyanca - ja: Japonca - ko: Korece - lv: Letonyaca - ms: Malayca - nl: Flemenkçe - 'no': Norveçce - pl: Lehçe - pt: Portekizce (Portekiz) - pt-BR: Portekizce (Brezilya) - ro: Romanca - ru: Rusça - sk: Slovakça - sv: İsveççe - th: Tayca - tr: Türkçe - uk: Ukraynaca - vi: Vietnamca - zh-CN: Çince (Çin) - zh-TW: Çince (Tayvan) - hr: Hırvatça - mk: Makedonca - sr: Sırpça - be: Belarusça -machines: - ANCIENT_ALTAR: - not-enough-pedestals: "&4Altar, gerekli Sütun miktarı ile çevrili değil &c(%pedestals% - / 8)" - unknown-catalyst: "&4Bilinmeyen Katalizör! &cDoğru Tarifi kullanın!" - unknown-recipe: "&4Bilinmeyen Tarif! &cDoğru Tarifi kullanın!" - ANCIENT_PEDESTAL: - obstructed: "&4Sütun tıkandı! &cSütunun üstündeki herhangi bir şeyi kaldırın!" - CARGO_NODES: - must-be-placed: "&4Mutlaka bir sandık veya makineye bağlanmalı!" - ELEVATOR: - click-to-teleport: "&7Bu yere ışınlanmak için &eTıkla:" - current-floor: "&eŞu anda bulunduğunuz kat:" - enter-name: "&7Lütfen sohbette yeni katınız için bir ad yazın. &r(Renk kodları - destekleniyor!)" - named: "&2Bu kat başarıyla isimlendirildi: &r%floor%" - no-destinations: "&4Varış noktası bulunamadı" - pick-a-floor: "&3- Bir kat seçin -" - full-inventory: "&eÜzgünüm, envanterim çok dolu!" - GPS_CONTROL_PANEL: - title: GPS - Kontrol Paneli - transmitters: Verici Genel Bakışı - waypoints: Yer Noktası Genel Bakışı - HOLOGRAM_PROJECTOR: - enter-text: "&7Lütfen Sohbette istediğiniz Hologram Metnini yazın. &r(Renk Kodları - destekleniyor!)" - inventory-title: Hologram Editörü - ignition-chamber-no-flint: "&cAteşleme Odasında Çakmak eksik." - in-use: "&cBu Bloğun envanteri şu anda farklı bir Oyuncu tarafından açıldı." - pattern-not-found: "&eÜzgünüm, bu tarifi tanıyamadım. Lütfen Eşyaları Dağıtıcıya - doğru şekilde yerleştirin." - TELEPORTER: - cancelled: "&4Işınlanma İptal Edildi!" - gui: - time: Tahmini süre - title: Yer noktaların - tooltip: Işınlanmak için tıklayın - invulnerability: "&b&l30 saniye boyunca dokunulmazsın!" - teleported: "&3Işınlanıldı!" - teleporting: "&3Işınlanılıyor..." - unknown-material: "&eÜzgünüm, fırlatıcıdaki Eşyayı tanıyamadım. Lütfen bildiğim - bir şey koy." - wrong-item: "&eÜzgünüm, bana sağ tıkladığınız Eşyayı tanıyamadım. Tarifleri kontrol - edin ve hangi Eşyaları kullanabileceğinizi görün." - INDUSTRIAL_MINER: - no-fuel: "&cIndustrial Miner'ınızın yakıtı bitti! Yukarıdaki sandığa yakıt koyun." - piston-facing: "&cIndustrial Miner'ınızın pistonu yukarıya bakmalı!" - piston-space: "&cHer iki pistonun da üstü boş olmalı!" - destroyed: "&cIndustrial Miner'ınız yok edilmiş." - already-running: "&cBu Industrial Miner zaten çalışıyor!" - full-chest: "&cIndustrial Miner'ınızın sandığı dolu!" - no-permission: "&4Bir Industrial Miner kullanmak için yetkili değilsin!" - finished: "&eIndustrial Miner'ınızın işi bitti! Toplamda %ores% kadar maden buldu!" messages: - cannot-place: "&cBu bloğu oraya yerleştiremezsiniz!" - diet-cookie: "&eKendinizi çok hafif hissetmeye başlıyorsunuz..." + not-researched: "&4Bunu anlayacak kadar bilgin yok" + not-enough-xp: "&4Bunun kilidini açmak için yeterli XP niz yok" + unlocked: '&bKilidini açtın &7"%research%"' + only-players: "&4Bu komut yalnızca oyuncular için" + unknown-player: "&4Bilinmeyen oyuncu: &c%player%" + no-permission: "&4Bunu yapmak için gerekli izniniz yok" + usage: "&4Kullanış: &c%usage%" + not-online: "&4%player% &coyunda değil!" + not-valid-item: "&4%item% &cgeçerli bir eşya değil!" + not-valid-amount: "&4%amount% &cgeçerli bir miktar değil : 0 dan büyük olmalı!" + given-item: '&a%amount% &badet &7"%item%&7" &bsana verildi.' + give-item: '&b%player% adlı oyuncuya &a%amount% &badet &7"%item%&7" &bverdin.' + not-valid-research: "&4%research% &cgeçerli bir araştırma değil!" + give-research: '&b%player% adlı oyuncu için bir araştırmayı açtın: &7"%research%&7"' + hungry: "&cBunu yapmak için çok açsın!" + mode-change: "&b%device% modu değişti: &9%mode%" disabled-in-world: "&4&lBu eşya bu dünyada devre dışı bırakıldı." disabled-item: "&4&lBu eşya devre dışı bırakıldı! Bunu nasıl aldın?" + no-tome-yourself: "&4Tome of Knowledge &cı kendin için kullanamazsın..." + multimeter: "&bDepolanmış Enerji: &3%stored% &b/ &3%capacity%" + talisman: + anvil: "&a&oTılsım aletinizi kırılmadan kurtardı" + miner: "&a&oTılsımın madenini ikiye katladı" + hunter: "&a&oTılsımın ganimetini ikiye katladı" + lava: "&a&oTılsımın seni yanarak ölmekten kurtardı" + water: "&a&oTılsımın seni boğulmaktan kurtardı" + angel: "&a&oTılsımın seni düşme hasarından kurtardı" + fire: "&a&oTılsımın seni yanarak ölmekten kurtardı" + magician: "&a&oTılsımın sana fazladan bir Büyü verdi" + traveller: "&a&oTılsımın sana bir Hız Artışı verdi" + warrior: "&a&oTılsımın bir süreliğine seni güçlendirdi" + knight: "&a&oTılsımın sana 5 Saniye Yenilenme verdi" + whirlwind: "&a&oTılsımın Mermiyi yansıttı" + wizard: "&a&oTılsımın sana daha yüksek seviye Servet verdi ama başka bir Büyünün + seviyesini düşürmüş olabilir." + soulbound-rune: + fail: "&cBir seferde sadece bir eşyayı ruhuna bağlayabilirsin." + success: "&aBu eşyayı ruhuna başarıyla bağladın! Öldüğünde saklayacaksın." + research: + start: "&7Kadim Ruhlar gizemli kelimeleri kulağına fısıldıyor!" + progress: "&b%research% &7hakkında bazı şeyler merak etmeye başlıyorsun &e(%progress%)" fire-extinguish: "&7Kendini söndürdün" + cannot-place: "&cBu bloğu oraya yerleştiremezsiniz!" + no-pvp: "&cBurada pvp yapamazsınız!" + radiation: "&4Ölümcül radyasyona maruz kaldınız! &cRadyoaktif maddeden kurtulun + veya koruyucu takımın tamamını giyinin!" + opening-guide: "&bRehber açılıyor, bu birkaç saniye sürebilir..." + opening-backpack: "&bSırt çantası açılıyor, bu birkaç saniye sürebilir..." + no-iron-golem-heal: "&cBu bir Demir Külçe değil. Demir Golemleri iyileştirmek için + bunu kullanamazsın!" + link-prompt: "&eBuraya tıklayın:" + diet-cookie: "&eKendinizi çok hafif hissetmeye başlıyorsunuz..." fortune-cookie: - "&7Bana yardım et, Şans Kurabiyesi Fabrikasında mahsur kaldım!" - "&7Yarın öleceksiniz ... bir Creeper tarafından" @@ -254,54 +145,168 @@ messages: - "&742. Cevap 42." - "&7Bir Walshy bir gün sıkıntıları uzak tutacaktır." - "&7Hiçbir zaman doğrudan aşağıyı kazmayın!" - give-item: '&b%player% adlı oyuncuya &a%amount% &badet &7"%item%&7" &bverdin.' - given-item: '&a%amount% &badet &7"%item%&7" &bsana verildi.' - give-research: '&b%player% adlı oyuncu için bir araştırmayı açtın: &7"%research%&7"' - hungry: "&cBunu yapmak için çok açsın!" - link-prompt: "&eBuraya tıklayın:" - mode-change: "&b%device% modu değişti: &9%mode%" - multimeter: "&bDepolanmış Enerji: &3%stored% &b/ &3%capacity%" - no-iron-golem-heal: "&cBu bir Demir Külçe değil. Demir Golemleri iyileştirmek için - bunu kullanamazsın!" - no-permission: "&4Bunu yapmak için gerekli izniniz yok" - no-pvp: "&cBurada pvp yapamazsınız!" - not-enough-xp: "&4Bunun kilidini açmak için yeterli XP niz yok" - no-tome-yourself: "&4Tome of Knowledge &cı kendin için kullanamazsın..." - not-online: "&4%player% &coyunda değil!" - not-researched: "&4Bunu anlayacak kadar bilgin yok" - not-valid-amount: "&4%amount% &cgeçerli bir miktar değil : 0 dan büyük olmalı!" - not-valid-item: "&4%item% &cgeçerli bir eşya değil!" - not-valid-research: "&4%research% &cgeçerli bir araştırma değil!" - only-players: "&4Bu komut yalnızca oyuncular için" - opening-backpack: "&bSırt çantası açılıyor, bu birkaç saniye sürebilir..." - opening-guide: "&bRehber açılıyor, bu birkaç saniye sürebilir..." - radiation: "&4Ölümcül radyasyona maruz kaldınız! &cRadyoaktif maddeden kurtulun - veya koruyucu takımın tamamını giyinin!" - research: - progress: "&b%research% &7hakkında bazı şeyler merak etmeye başlıyorsun &e(%progress%)" - start: "&7Kadim Ruhlar gizemli kelimeleri kulağına fısıldıyor!" - soulbound-rune: - fail: "&cBir seferde sadece bir eşyayı ruhuna bağlayabilirsin." - success: "&aBu eşyayı ruhuna başarıyla bağladın! Öldüğünde saklayacaksın." - talisman: - angel: "&a&oTılsımın seni düşme hasarından kurtardı" - anvil: "&a&oTılsım aletinizi kırılmadan kurtardı" - fire: "&a&oTılsımın seni yanarak ölmekten kurtardı" - hunter: "&a&oTılsımın ganimetini ikiye katladı" - knight: "&a&oTılsımın sana 5 Saniye Yenilenme verdi" - lava: "&a&oTılsımın seni yanarak ölmekten kurtardı" - magician: "&a&oTılsımın sana fazladan bir Büyü verdi" - miner: "&a&oTılsımın madenini ikiye katladı" - traveller: "&a&oTılsımın sana bir Hız Artışı verdi" - warrior: "&a&oTılsımın bir süreliğine seni güçlendirdi" - water: "&a&oTılsımın seni boğulmaktan kurtardı" - whirlwind: "&a&oTılsımın Mermiyi yansıttı" - wizard: "&a&oTılsımın sana daha yüksek seviye Servet verdi ama başka bir Büyünün - seviyesini düşürmüş olabilir." - unknown-player: "&4Bilinmeyen oyuncu: &c%player%" - unlocked: '&bKilidini açtın &7"%research%"' - usage: "&4Kullanış: &c%usage%" -miner: - no-ores: "&eÜzgünüm, yakınlarda herhangi bir cevher bulamadım!" + - "&7Bu ancak bir yara." + - "&7Daima hayatın parlak tarafından bak!" + - "&7Bu aslında bir Bisküvi idi, Kurabiye değil." + - "&7Neon levhalar ışık yayar!" +machines: + pattern-not-found: "&eÜzgünüm, bu tarifi tanıyamadım. Lütfen Eşyaları Dağıtıcıya + doğru şekilde yerleştirin." + unknown-material: "&eÜzgünüm, fırlatıcıdaki Eşyayı tanıyamadım. Lütfen bildiğim + bir şey koy." + wrong-item: "&eÜzgünüm, bana sağ tıkladığınız Eşyayı tanıyamadım. Tarifleri kontrol + edin ve hangi Eşyaları kullanabileceğinizi görün." + full-inventory: "&eÜzgünüm, envanterim çok dolu!" + in-use: "&cBu Bloğun envanteri şu anda farklı bir Oyuncu tarafından açıldı." + ignition-chamber-no-flint: "&cAteşleme Odasında Çakmak eksik." + ANCIENT_ALTAR: + not-enough-pedestals: "&4Altar, gerekli Sütun miktarı ile çevrili değil &c(%pedestals% + / 8)" + unknown-catalyst: "&4Bilinmeyen Katalizör! &cDoğru Tarifi kullanın!" + unknown-recipe: "&4Bilinmeyen Tarif! &cDoğru Tarifi kullanın!" + ANCIENT_PEDESTAL: + obstructed: "&4Sütun tıkandı! &cSütunun üstündeki herhangi bir şeyi kaldırın!" + HOLOGRAM_PROJECTOR: + enter-text: "&7Lütfen Sohbette istediğiniz Hologram Metnini yazın. &r(Renk Kodları + destekleniyor!)" + inventory-title: Hologram Editörü + ELEVATOR: + no-destinations: "&4Varış noktası bulunamadı" + pick-a-floor: "&3- Bir kat seçin -" + current-floor: "&eŞu anda bulunduğunuz kat:" + click-to-teleport: "&7Bu yere ışınlanmak için &eTıkla:" + enter-name: "&7Lütfen sohbette yeni katınız için bir ad yazın. &r(Renk kodları + destekleniyor!)" + named: "&2Bu kat başarıyla isimlendirildi: &r%floor%" + TELEPORTER: + teleporting: "&3Işınlanılıyor..." + teleported: "&3Işınlanıldı!" + cancelled: "&4Işınlanma İptal Edildi!" + invulnerability: "&b&l30 saniye boyunca dokunulmazsın!" + gui: + title: Yer noktaların + tooltip: Işınlanmak için tıklayın + time: Tahmini süre + CARGO_NODES: + must-be-placed: "&4Mutlaka bir sandık veya makineye bağlanmalı!" + GPS_CONTROL_PANEL: + title: GPS - Kontrol Paneli + transmitters: Verici Genel Bakışı + waypoints: Yer Noktası Genel Bakışı + INDUSTRIAL_MINER: + no-fuel: "&cIndustrial Miner'ınızın yakıtı bitti! Yukarıdaki sandığa yakıt koyun." + piston-facing: "&cIndustrial Miner'ınızın pistonu yukarıya bakmalı!" + piston-space: "&cHer iki pistonun da üstü boş olmalı!" + destroyed: "&cIndustrial Miner'ınız yok edilmiş." + already-running: "&cBu Industrial Miner zaten çalışıyor!" + full-chest: "&cIndustrial Miner'ınızın sandığı dolu!" + no-permission: "&4Bir Industrial Miner kullanmak için yetkili değilsin!" + finished: "&eIndustrial Miner'ınızın işi bitti! Toplamda %ores% kadar maden buldu!" +anvil: + not-working: "&4Slimefun eşyalarını örste kullanamazsın!" +backpack: + already-open: "&cÜzgünüm, bu Sırt Çantası başka bir yerde açık!" + no-stack: "&cSırt Çantalarını istifleyemezsiniz" workbench: not-enhanced: "&4Slimefun Eşyalarını normal bir üretim masasında kullanamazsınız" +gps: + deathpoint: "&4Ölüm Noktası &7%date%" + waypoint: + new: "&eLütfen sohbette yeni yer noktanız için bir ad yazın. &7(Renk Kodları destekleniyor!)" + added: "&aYeni bir yer noktası başarıyla eklendi" + max: "&4Maksimum yer noktası sayısına ulaştınız" + insufficient-complexity: + - "&4Yetersiz GPS Ağ Gücü: &c%complexity%" + - "&4a) Henüz bir GPS Ağı kurulumunuz yok" + - "&4b) GPS Ağınız yeterince güçlü değil" + geo: + scan-required: "&4GEO-Taraması gerekli! &cİlk önce bir GEO-Tarayıcı kullanarak + bu bölgeyi tarayın!" +inventory: + no-access: "&4Bu bloğa erişmenize izin verilmiyor" +android: + started: "&7Androidiniz senaryoyu uygulamaya devam ediyor" + stopped: "&7Androidiniz senaryoyu duraklattı" + scripts: + already-uploaded: "&4Bu senaryo zaten yüklendi." + instructions: + START: "&2Senaryoyu başlat" + REPEAT: "&9Senaryoyu Tekrar Et" + WAIT: "&e0.5s Bekle" + GO_FORWARD: "&7İleri Git" + GO_UP: "&7Yukarı Çık" + GO_DOWN: "&7Aşağıya İn" + TURN_LEFT: "&7Sola Dön" + TURN_RIGHT: "&7Sağa Dön" + DIG_UP: "&bYukarıyı Kaz" + DIG_FORWARD: "&bİleriyi Kaz" + DIG_DOWN: "&bAltını Kaz" + MOVE_AND_DIG_UP: "&bİlerle ve Yukarıyı Kaz" + MOVE_AND_DIG_FORWARD: "&bİlerle ve İleriyi Kaz" + MOVE_AND_DIG_DOWN: "&bİlerle ve Altını Kaz" + ATTACK_MOBS_ANIMALS: "&4Saldır &c(Canavarlar & Hayvanlar)" + ATTACK_MOBS: "&4Saldır &c(Canavarlar)" + ATTACK_ANIMALS: "&4Saldır &c(Hayvanlar)" + ATTACK_ANIMALS_ADULT: "&4Saldır &c(Hayvanlar &7[Yetişkin]&c)" + CHOP_TREE: "&cKes ve Ek" + CATCH_FISH: "&bBalık Tut" + FARM_FORWARD: "&bTopla ve Ek" + FARM_DOWN: "&bToplama ve Ekim &7(Altındaki blok)" + FARM_EXOTIC_FORWARD: "&bGelişmişce Topla ve Ek" + FARM_EXOTIC_DOWN: "&bGelişmişce Topla ve Ek &7(Altındaki blok)" + INTERFACE_ITEMS: "&9Envanter İçeriğini öndeki Arayüze aktar" + INTERFACE_FUEL: "&cÖndeki Arayüzden Yakıt çek" + enter-name: + - + - "&eLütfen senaryonuz için bir ad yazınız" + uploaded: + - "&bYükleniyor..." + - "&aSenaryon başarıyla yüklendi!" + rating: + own: "&4Kendi senaryonu oylayamazın!" + already: "&4Bu senaryo için zaten oy kullandın!" + editor: Senaryo Editörü +languages: + default: Sunucu Varsayılanı + en: İngilizce + de: Almanca + fr: Fransızca + it: İtalyanca + es: İspanyolca + pl: Lehçe + sv: İsveççe + nl: Flemenkçe + cs: Çekce + hu: Macarca + lv: Letonyaca + ru: Rusça + sk: Slovakça + zh-TW: Çince (Tayvan) + vi: Vietnamca + id: Endonezyaca + zh-CN: Çince (Çin) + el: Yunanca + he: İbranice + ar: Arapça + af: Afrikanca + da: Danca + fi: Fince + uk: Ukraynaca + ms: Malayca + 'no': Norveçce + ja: Japonca + fa: Persçe + th: Tayca + ro: Romanca + pt: Portekizce (Portekiz) + pt-BR: Portekizce (Brezilya) + bg: Bulgarca + ko: Korece + tr: Türkçe + hr: Hırvatça + mk: Makedonca + sr: Sırpça + be: Belarusça + tl: Tagalog +miner: + no-ores: "&eÜzgünüm, yakınlarda herhangi bir cevher bulamadım!" diff --git a/src/main/resources/languages/messages_uk.yml b/src/main/resources/languages/messages_uk.yml index f007bc9d4..46dda9c0a 100644 --- a/src/main/resources/languages/messages_uk.yml +++ b/src/main/resources/languages/messages_uk.yml @@ -1,244 +1,135 @@ --- -android: - scripts: - already-uploaded: "&4Цей скрипт вже було завантажено." - editor: Редактор скриптів - enter-name: - - - - "&eБудь ласка, введіть назву для Вашого скрипту" - instructions: - ATTACK_ANIMALS: "&4Атакувати &c(тварини)" - ATTACK_ANIMALS_ADULT: "&4Атакувати &c(тварини &7[дорослі]&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Зібрати врожай та пересадити &7(блок знизу)" - FARM_EXOTIC_DOWN: "&bПрогресивне збирання врожаю та пересадка &7(блок знизу)" - FARM_EXOTIC_FORWARD: "&bПрогресивне збирання врожаю та пересадка" - FARM_FORWARD: "&bЗібрати врожай та пересадити" - GO_DOWN: "&7Рушити вниз" - GO_FORWARD: "&7Рушити вперед" - GO_UP: "&7Рушити вгору" - INTERFACE_FUEL: "&cПоповнити запаси палива зі сховища спереду" - INTERFACE_ITEMS: "&9Скласти збережені предмети в сховище спереду" - 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Ви не можете використовувати Slimefun предмети в наковальні!" -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: Вивести список установлених доповнень backpack: description: Отримати копію існуючого рюкзака invalid-id: "&4Ідентифікатор повинен бути невід’ємним числом!" player-never-joined: "&4Гравця з таким ніком не знайдено!" backpack-does-not-exist: "&4Вказаний рюкзак не існує!" restored-backpack-given: "&aРюкзак відновлено та додано в Ваш інвентар!" -gps: - deathpoint: "&4Точка смерті &7%date%" - geo: - scan-required: "&4Необхідне геосканування! &cПроскануйте цей чанк геосканером - спочатку!" - insufficient-complexity: - - "&4Недостатня загальна сила GPS мережі: &c%complexity%" - - "&4а) Ваша GPS мережа ще не під’эднана" - - "&4б) У Вашої GPS мережі недостатня сила сигналу" - waypoint: - added: "&aКонтрольну точку успішно додано" - max: "&4Ви досягли максимальної кількості контрольних точок" - new: "&eБудь ласка, введіть назву для контрольної точки в чат. &7(кольори підтримуються!)" guide: - back: - guide: Повернутись до посібника Slimefun - settings: Повернутись до панелі налаштувань - title: Назад + search: + message: "&bЩо би Ви бажали знайти?" + name: "&7Пошук…" + tooltip: "&bНатисніть для пошуку предмету" + inventory: 'Пошук: %item%' cheat: no-multiblocks: "&4Ви не можете видати собі споруду, вона повинна бути побудована!" - credits: - commit: Коміт - commits: Комітів - profile-link: Натисніть, щоб відвідати GitHub профіль - roles: - developer: "&6Розробник" - resourcepack: "&cТекстурщик" - translator: "&9Локалізатор" - wiki: "&3Редактор Вікі" 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 Вікі + addons: Доповнення до Slimefun4 + bugs: Звіти про помилки + source: Вихідний код + credits: + commit: Коміт + commits: Комітів + roles: + developer: "&6Розробник" + wiki: "&3Редактор Вікі" + resourcepack: "&cТекстурщик" + translator: "&9Локалізатор" + profile-link: Натисніть, щоб відвідати GitHub профіль + pages: + previous: Попередня сторінка + next: Наступна сторінка + tooltips: + open-category: Натисніть, що відкрити + versions-notice: Це дуже важливо, коли Ви повідомляєте про помилки! + wiki: Переглянути цей предмет на офіційній Slimefun Вікі + recipes: + machine: Рецепти, доступні у цій машині + miner: Ресурси, що видобуваються цим шахтарем + generator: Доступні види палива + gold-pan: Ресурси, які Ви можете отримати + back: + title: Назад + guide: Повернутись до посібника Slimefun + settings: Повернутись до панелі налаштувань locked: ЗАКРИТО locked-category: - Для розблокування цієї категорії - спочатку відкрийте всі предмети - з категорій нижче - pages: - next: Наступна сторінка - previous: Попередня сторінка - search: - inventory: 'Пошук: %item%' - message: "&bЩо би Ви бажали знайти?" - name: "&7Пошук…" - tooltip: "&bНатисніть для пошуку предмету" - title: - addons: Доповнення до Slimefun4 - bugs: Звіти про помилки - credits: Автори Slimefun4 - languages: Виберіть бажану мову - main: Посібник Slimefun - settings: Налаштування та інформація - source: Вихідний код - wiki: Slimefun4 Вікі - tooltips: - open-category: Натисніть, що відкрити - recipes: - generator: Доступні види палива - gold-pan: Ресурси, які Ви можете отримати - machine: Рецепти, доступні у цій машині - miner: Ресурси, що видобуваються цим шахтарем - versions-notice: Це дуже важливо, коли Ви повідомляєте про помилки! - wiki: Переглянути цей предмет на офіційній Slimefun Вікі -inventory: - no-access: "&4У Вас немає доступу до цього блоку" -languages: - af: Бурська - ar: Арабська - be: Білоруська - bg: Болгарська - cs: Чеська - da: Датська - de: Німецька - default: За замовчуванням - el: Грецька - en: Англійська - es: Іспанська - fa: Перська - fi: Фінська - fr: Французька - he: Іврит - hr: Хорватська - hu: Угорська - id: Індонезійська - it: Італійська - ja: Японська - ko: Корейська - lv: Латвійська - mk: Македонська - ms: Малайська - nl: Голландська - 'no': Норвезька - pl: Польська - pt: Португальська (Португалія) - pt-BR: Португальська (Бразилія) - ro: Румунська - ru: Російська - sk: Словацька - sr: Сербська - 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На жаль, не вдалось розпізнати предмет, яким Ви нажали. Провірте - рецепти та гляньте, які предмети Ви можете використовувати." - 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%!" 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Ваш талісман надав Вам швидкості" + 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Ви не можете вступати в PvP тут!" + radiation: "&4Ви потрапили у дію небезпечної радіації! &cПозбавтесь радіоактивних + предметів або одягніть костюм хімзахисту!" + opening-guide: "&bВідкриваємо посібник, це може зайняти кілька секунд…" + opening-backpack: "&bВідкриваємо рюкзак, це може зайняти кілька секунд…" + no-iron-golem-heal: "&cЦей предмет не є залізним злитком. Його не можна використовувати + для лагодження залізних големів!" + link-prompt: "&eНатисніть сюди:" + diet-cookie: "&eВи відчуваєте неймовірне полегшення…" fortune-cookie: - "&7Допоможіть мені! Я у пастці на фабриці печива долі!" - "&7Завтра ти помреш… від люб’язного Кріпера" @@ -252,56 +143,170 @@ messages: - "&742. Відповідь – 42." - "&7Неприємності йдуть лісом – Walshy вже договорився з бісом." - "&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Ви не можете вступати в PvP тут!" - 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Ваш талісман надав Вам швидкості" - 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Ви не можете використовувати Slimefun предмети в наковальні!" +backpack: + already-open: "&cВибачте, цей рюкзак уже відкрито в іншому місці!" + no-stack: "&cВи не можете складати рюкзаки разом" workbench: not-enhanced: "&4Ви не можете використовувати Slimefun предмети в звичайному верстаку" +gps: + deathpoint: "&4Точка смерті &7%date%" + waypoint: + new: "&eБудь ласка, введіть назву для контрольної точки в чат. &7(кольори підтримуються!)" + added: "&aКонтрольну точку успішно додано" + max: "&4Ви досягли максимальної кількості контрольних точок" + insufficient-complexity: + - "&4Недостатня загальна сила GPS мережі: &c%complexity%" + - "&4а) Ваша GPS мережа ще не під’эднана" + - "&4б) У Вашої GPS мережі недостатня сила сигналу" + geo: + scan-required: "&4Необхідне геосканування! &cПроскануйте цей чанк геосканером + спочатку!" +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(тварини &7[дорослі]&c)" + CHOP_TREE: "&cЗрубати та пересадити" + CATCH_FISH: "&bВиловити рибу" + FARM_FORWARD: "&bЗібрати врожай та пересадити" + FARM_DOWN: "&bЗібрати врожай та пересадити &7(блок знизу)" + FARM_EXOTIC_FORWARD: "&bПрогресивне збирання врожаю та пересадка" + FARM_EXOTIC_DOWN: "&bПрогресивне збирання врожаю та пересадка &7(блок знизу)" + INTERFACE_ITEMS: "&9Скласти збережені предмети в сховище спереду" + 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: Іврит + pt: Португальська (Португалія) + pt-BR: Португальська (Бразилія) + ar: Арабська + af: Бурська + da: Датська + fi: Фінська + uk: Українська + ms: Малайська + 'no': Норвезька + ja: Японська + fa: Перська + th: Тайська + ro: Румунська + bg: Болгарська + ko: Корейська + tr: Турецька + hr: Хорватська + mk: Македонська + sr: Сербська + be: Білоруська + tl: Тагальська +miner: + no-ores: "&eНа жаль, не вдалось знайти руду поблизу!" diff --git a/src/main/resources/languages/messages_zh-CN.yml b/src/main/resources/languages/messages_zh-CN.yml index 88a35b3d3..080186a7d 100644 --- a/src/main/resources/languages/messages_zh-CN.yml +++ b/src/main/resources/languages/messages_zh-CN.yml @@ -1,238 +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自动采收并补种下面的作物 &7(支持异域花园植物)" - FARM_EXOTIC_FORWARD: "&b自动采收并补种作物 &7(支持异域花园植物)" - FARM_FORWARD: "&b自动采收并补种作物" - GO_DOWN: "&7向下走" - GO_FORWARD: "&7向前走" - GO_UP: "&7向上走" - INTERFACE_FUEL: "&c从面前的容器中拿出燃料" - INTERFACE_ITEMS: "&9将物品栏里的物品放入面前的容器" - 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.5s" - rating: - already: "&4你已经给这个脚本留下评价了!" - own: "&4你不能评价你自己的脚本!" - uploaded: - - "&b上传中..." - - "&a脚本上传成功!" - started: "&7你的机器人开始运行脚本" - stopped: "&7你的机器人暂停运行了脚本" -anvil: - not-working: "&4你不能在铁砧里使用 Slimefun 的物品" -backpack: - already-open: "&c抱歉, 这个背包已在别处打开了!" - no-stack: "&c你不能同时手持两个背包" commands: - backpack: - backpack-does-not-exist: "&4你指定的背包不存在!" - description: 获取你其中一个背包的拷贝 - invalid-id: "&4背包 ID 必须为非负数!" - player-never-joined: "&4找不到叫这个名字的玩家!" - restored-backpack-given: "&a你的背包已被恢复并且已经放入了你的物品栏!" + help: 展示此帮助页面 cheat: 使用作弊模式获取 Slimefun 的物品 give: 给某人 Slimefun 物品 guide: 给你自己一本 Slimefun 指南 - help: 展示此帮助页面 + timings: 查看关于 Slimefun 的耗能信息 + teleporter: 查看其他玩家的公开传送点 + versions: 列出已安装的扩展插件 + search: 搜索 Slimefun 物品 open_guide: 使用命令打开 Slimefun 指南 + stats: 查看玩家的统计数据 research: description: 解锁/重置玩家的研究 reset: "&c你已重置了 %player% 的所有研究" reset-target: "&c你的所有研究已被重置" - search: 搜索 Slimefun 物品 - stats: 查看玩家的统计数据 - teleporter: 查看其他玩家的公开传送点 - timings: 查看关于 Slimefun 的耗能信息 - versions: 列出已安装的扩展插件 -gps: - deathpoint: "&4死亡地点 &7%date%" - geo: - scan-required: "&4需要先进行 GEO 地形扫描! &c请先使用 GEO 地形扫描器!" - insufficient-complexity: - - "&4GPS网络复杂度不足: &c%complexity%" - - "&4a) 你还没有设置一个 GPS 网络" - - "&4b) 你的 GPS 网络复杂度不够, 多放置几个 GPS 信号发射机" - waypoint: - added: "&a成功添加了新的传送点" - max: "&4你已到达设置传送点个数的最大上限" - new: "&e给你的路径点起个名字吧 &7(支持彩色代码!)" + backpack: + description: 获取你其中一个背包的拷贝 + invalid-id: "&4背包 ID 必须为非负数!" + player-never-joined: "&4找不到叫这个名字的玩家!" + backpack-does-not-exist: "&4你指定的背包不存在!" + restored-backpack-given: "&a你的背包已被恢复并且已经放入了你的物品栏!" guide: - back: - guide: 返回 Slimefun 指南 - settings: 返回设置面板 - title: 返回 + search: + message: "&b你想要搜索什么?" + name: "&7搜索..." + tooltip: "&b单击搜索物品" + inventory: '正在搜索: %item%' + lore: + - "&b你想要搜索什么?" + - "&7将要搜索的物品的名字输入在聊天栏上" cheat: no-multiblocks: "&4你不能在作弊模式下直接获得多方块结构的机器, 你必须自己建造!" - credits: - commit: 提交 - commits: 提交次数 - profile-link: 单击访问TA们的 Github 个人主页 - roles: - developer: "&6开发者" - resourcepack: "&c材质制作者" - 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 维基 + addons: Slimefun4 扩展 + bugs: 问题反馈 + source: 源代码 + credits: + commit: 提交 + commits: 提交次数 + roles: + developer: "&6开发者" + wiki: "&3Wiki 编辑者" + resourcepack: "&c材质制作者" + translator: "&9翻译者" + profile-link: 单击访问TA们的 Github 个人主页 + pages: + previous: 上一页 + next: 下一页 + tooltips: + open-category: 单击打开 + versions-notice: 在反馈问题时这些很重要! + wiki: 在官方 Slimefun 维基上查看此物品 + recipes: + machine: 此机器可用的合成配方 + miner: 此采矿机可以获得的资源 + generator: 可用的燃料种类 + gold-pan: 你可以获得的资源 + back: + title: 返回 + guide: 返回 Slimefun 指南 + settings: 返回设置面板 locked: 已锁定 locked-category: - 为了解锁这一类别 - 你需要先解锁以下 - 类别里的所有物品 - pages: - next: 下一页 - previous: 上一页 - search: - inventory: '正在搜索: %item%' - lore: - - "&b你想要搜索什么?" - - "&7将要搜索的物品的名字输入在聊天栏上" - message: "&b你想要搜索什么?" - name: "&7搜索..." - tooltip: "&b单击搜索物品" - title: - addons: Slimefun4 扩展 - bugs: 问题反馈 - credits: Slimefun4 贡献者 - languages: 选择你想要的语言 - main: Slimefun 指南 - settings: 设置 & 关于 - source: 源代码 - wiki: Slimefun4 维基 - tooltips: - open-category: 单击打开 - recipes: - generator: 可用的燃料种类 - gold-pan: 你可以获得的资源 - machine: 此机器可用的合成配方 - miner: 此采矿机可以获得的资源 - versions-notice: 在反馈问题时这些很重要! - wiki: 在官方 Slimefun 维基上查看此物品 -inventory: - no-access: "&4你没有权限使用这个方块" -languages: - af: 南非语 - ar: 阿拉伯语 - be: 白俄罗斯语 - bg: 保加利亚语 - cs: 捷克语 - da: 丹麦语 - de: 德语 - default: 服务器默认语言 - el: 希腊语 - en: 英语 - es: 西班牙语 - fa: 波斯语 - fi: 芬兰语 - fr: 法语 - he: 希伯来语 - hr: 克罗地亚语 - hu: 匈牙利语 - id: 印尼语 - it: 意大利语 - ja: 日语 - ko: 韩语 - lv: 拉脱维亚语 - mk: 马其顿语 - ms: 马来西亚语 - nl: 荷兰语 - 'no': 挪威语 - pl: 波兰语 - pt: 葡萄牙语 (葡萄牙) - pt-BR: 葡萄牙语 (巴西) - ro: 罗马尼亚语 - ru: 俄语 - sk: 斯洛伐克文 - sr: 塞尔维亚语 - 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自动点火机缺少打火石." - INDUSTRIAL_MINER: - already-running: "&c这个工业矿机正在运行!" - destroyed: "&c你的工业矿机被拆除了." - finished: "&e你的工业矿机采矿已完成! 总共开采了 %ores% 个矿石!" - full-chest: "&c你的工业矿机的箱子已经满了!" - no-fuel: "&c你的工业矿机没有燃料了! 将燃料放入它上面的箱子里." - no-permission: "&4你没有权限在此操作此工业矿机!" - piston-facing: "&c你的工业矿机需要放置一个向上的活塞!" - piston-space: "&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% &ci不是一个有效的数字 : 它必须大于 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你的护身符让你跑起来更快了" + 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你不能在这里 PVP!" + radiation: "&4你已经暴露在致命的辐射之下! &c快把辐射物品丢掉或者穿上防化服!" + opening-guide: "&b正在打开指南书, 请稍等..." + opening-backpack: "&b正在打开背包, 请稍等...." + no-iron-golem-heal: "&c这不是铁锭. 你不能用这个治疗铁傀儡!" + link-prompt: "&e单击此处:" + diet-cookie: "&e你感觉变轻了..." fortune-cookie: - "&7救救我! 我被困在了幸运饼干工厂里!" - "&7你明天将会死在... 苦力怕的手下" @@ -244,51 +139,161 @@ messages: - "&742. 答案是 42." - "&7一天一 Walshy, 麻烦远离我." - "&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你不能在这里 PVP!" - not-enough-xp: "&4你没有足够的经验来解锁这个研究" - no-tome-yourself: "&c你不能对你自己使用 &4学识巨著 &c..." - not-online: "&4%player% &c不在线" - not-researched: "&4你没有足够的学识来理解它" - not-valid-amount: "&4%amount% &ci不是一个有效的数字 : 它必须大于 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你的护身符让你跑起来更快了" - 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你不能在铁砧里使用 Slimefun 的物品" +backpack: + already-open: "&c抱歉, 这个背包已在别处打开了!" + no-stack: "&c你不能同时手持两个背包" workbench: not-enhanced: "&4你不能在普通的工作台上使用 Slimefun 物品" +gps: + deathpoint: "&4死亡地点 &7%date%" + waypoint: + new: "&e给你的路径点起个名字吧 &7(支持彩色代码!)" + added: "&a成功添加了新的传送点" + max: "&4你已到达设置传送点个数的最大上限" + insufficient-complexity: + - "&4GPS网络复杂度不足: &c%complexity%" + - "&4a) 你还没有设置一个 GPS 网络" + - "&4b) 你的 GPS 网络复杂度不够, 多放置几个 GPS 信号发射机" + geo: + scan-required: "&4需要先进行 GEO 地形扫描! &c请先使用 GEO 地形扫描器!" +inventory: + no-access: "&4你没有权限使用这个方块" +android: + started: "&7你的机器人开始运行脚本" + stopped: "&7你的机器人暂停运行了脚本" + scripts: + already-uploaded: "&4这个脚本已经上传过了." + instructions: + START: "&2运行脚本" + REPEAT: "&9重复运行脚本" + WAIT: "&e等待 0.5s" + 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自动采收并补种作物 &7(支持异域花园植物)" + FARM_EXOTIC_DOWN: "&b自动采收并补种下面的作物 &7(支持异域花园植物)" + INTERFACE_ITEMS: "&9将物品栏里的物品放入面前的容器" + 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抱歉, 周围找不到矿石了!" 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附近沒礦了!" diff --git a/src/main/resources/languages/recipes_en.yml b/src/main/resources/languages/recipes_en.yml index 45a1680c6..9f82f5b76 100644 --- a/src/main/resources/languages/recipes_en.yml +++ b/src/main/resources/languages/recipes_en.yml @@ -186,3 +186,9 @@ minecraft: lore: - 'Craft this Item as shown' - 'using a Stonecutter' + + smithing: + name: 'Smithing Table Recipe' + lore: + - 'Craft this Item as shown' + - 'using a Smithing Table' 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 diff --git a/src/main/resources/languages/recipes_ja.yml b/src/main/resources/languages/recipes_ja.yml index c7ceb72c6..3a482d34f 100644 --- a/src/main/resources/languages/recipes_ja.yml +++ b/src/main/resources/languages/recipes_ja.yml @@ -1,158 +1,163 @@ --- -minecraft: - blasting: - lore: - - このアイテムの精錬に使用する - - '機械: 溶鉱炉' - name: 溶鉱炉での精錬 - campfire: - lore: - - このアイテムの精錬に使用する - - '機械: 焚き火' - name: 焚き火 - furnace: - lore: - - このアイテムの精錬に使用する - - '機械: かまど' - name: かまどでの精錬 - shaped: - lore: - - このアイテムの作成に使用する - - '機械: 作業台' - - 並べ方は固定 - name: 定形レシピ - shapeless: - lore: - - このアイテムの作成に使用する - - '機械: 作業台' - - 並べ方は自由 - name: 不定形レシピ - smoking: - lore: - - このアイテムの燻製に使用する - - '機械: 燻製器' - name: 燻製器 - stonecutting: - lore: - - このアイテムの作成に使用する - - '機械: 石切台' - name: 石切台 slimefun: - ancient_altar: + multiblock: + name: マルチブロック lore: - - このアイテムの作成に使用する - - '機械: Ancient Altar' - - 詳細はAncient Altarに記載 - name: Ancient Altar - armor_forge: - lore: - - このアイテムの作成に使用する - - '機械: Armor Forge' - name: Armor Forge - compressor: - lore: - - このアイテムの作成に使用する - - '機械: Compressor' - name: Compressor + - 図面通りに設置して建造する。 + - クラフトではありません! enhanced_crafting_table: + name: Enhanced Crafting Table lore: - このアイテムの作成に使用する - '機械: Enhanced Crafting Table' - 通常の作業台では不十分です! - name: Enhanced Crafting Table - food_composter: + armor_forge: + name: Armor Forge lore: - このアイテムの作成に使用する - - '機械: Food Composter' - name: Food Composter - food_fabricator: - lore: - - このアイテムの作成に使用する - - '機械: Food Fabricator' - name: Food Fabricator - freezer: - lore: - - このアイテムの作成に使用する - - '機械: Freezer' - name: Freezer - geo_miner: - lore: - - このアイテムの採掘に使用する - - '機械: GEO Miner' - name: GEO Miner - gold_pan: - lore: - - このアイテムの入手に使用する - - '機械: Gold Pan' - name: Gold Pan + - '機械: Armor Forge' grind_stone: + name: Grind Stone lore: - このアイテムの作成に使用する - '機械: Grind Stone' - name: Grind Stone - heated_pressure_chamber: + smeltery: + name: Smeltery lore: - このアイテムの作成に使用する - - '機械: Heated Pressure Chamber' - name: Heated Pressure Chamber - juicer: - lore: - - このジュースの作成に使用する - - '機械: Juicer' - name: Juicer - magic_workbench: - lore: - - このアイテムの作成に使用する - - '機械: Magic Workbench' - name: Magic Workbench - mob_drop: - lore: - - モブを倒して - - 入手するアイテム - name: モブドロップ - multiblock: - lore: - - 図面通りに設置して - - 建造する。クラフトではありません! - name: マルチブロック - nuclear_reactor: - lore: - - このアイテムを副産物として入手できる - - '機械: Nuclear Reactor' - name: Nuclear Reactor - oil_pump: - lore: - - このアイテムの収集に使用する - - '機械: Oil Pump' - name: Oil Pump + - '機械: Smeltery' ore_crusher: + name: Ore Crusher lore: - このアイテムの作成に使用する - '機械: Ore Crusher' - name: Ore Crusher + mob_drop: + name: モブドロップ + lore: + - モブを倒して + - 入手するアイテム + gold_pan: + name: Gold Pan + lore: + - このアイテムの入手に使用する + - '機械: Gold Pan' + compressor: + name: Compressor + lore: + - このアイテムの作成に使用する + - '機械: Compressor' + pressure_chamber: + name: Pressure Chamber + lore: + - このアイテムの作成に使用する + - '機械: Pressure Chamber' ore_washer: + name: Ore Washer lore: - このアイテムの作成に使用する - '機械: Ore Washer' - name: Ore Washer + juicer: + name: Juicer + lore: + - このジュースの作成に使用する + - '機械: Juicer' + magic_workbench: + name: Magic Workbench + lore: + - このアイテムの作成に使用する + - '機械: Magic Workbench' + ancient_altar: + name: Ancient Altar + lore: + - このアイテムの作成に使用する + - '機械: Ancient Altar' + - 詳細はAncient Altarに記載 + heated_pressure_chamber: + name: Heated Pressure Chamber + lore: + - このアイテムの作成に使用する + - '機械: Heated Pressure Chamber' + food_fabricator: + name: Food Fabricator + lore: + - このアイテムの作成に使用する + - '機械: Food Fabricator' + food_composter: + name: Food Composter + lore: + - このアイテムの作成に使用する + - '機械: Food Composter' + freezer: + name: Freezer + lore: + - このアイテムの作成に使用する + - '機械: Freezer' + geo_miner: + name: GEO Miner + lore: + - このアイテムの採掘に使用する + - '機械: GEO Miner' + nuclear_reactor: + name: Nuclear Reactor + lore: + - このアイテムを副産物として入手できる + - '機械: Nuclear Reactor' + oil_pump: + name: Oil Pump + lore: + - このアイテムの収集に使用する + - '機械: Oil Pump' pickaxe_of_containment: + name: Pickaxe of Containment lore: - このブロックを入手するには - Pickaxe of Containmentを - 使用してスポナーを採掘する - name: Pickaxe of Containment - pressure_chamber: - lore: - - このアイテムの作成に使用する - - '機械: Pressure Chamber' - name: Pressure Chamber refinery: + name: Refinery lore: - このアイテムの作成に使用する - '機械: Refinery' - name: Refinery - smeltery: +minecraft: + shaped: + name: 定形レシピ lore: - このアイテムの作成に使用する - - '機械: Smeltery' - name: Smeltery + - '機械: 作業台' + - 並べ方は固定 + shapeless: + name: 不定形レシピ + lore: + - このアイテムの作成に使用する + - '機械: 作業台' + - 並べ方は自由 + furnace: + name: かまどでの精錬 + lore: + - このアイテムの精錬に使用する + - '機械: かまど' + blasting: + name: 溶鉱炉での精錬 + lore: + - このアイテムの精錬に使用する + - '機械: 溶鉱炉' + smoking: + name: 燻製器 + lore: + - このアイテムの燻製に使用する + - '機械: 燻製器' + campfire: + name: 焚き火 + lore: + - このアイテムの精錬に使用する + - '機械: 焚き火' + stonecutting: + name: 石切台 + lore: + - このアイテムの作成に使用する + - '機械: 石切台' + smithing: + name: 鍛冶台 + lore: + - このアイテムの作成に使用する + - '機械: 鍛冶台' diff --git a/src/main/resources/languages/recipes_ru.yml b/src/main/resources/languages/recipes_ru.yml index 81807a2d2..a888b0340 100644 --- a/src/main/resources/languages/recipes_ru.yml +++ b/src/main/resources/languages/recipes_ru.yml @@ -156,3 +156,8 @@ minecraft: lore: - Создаётся так, как показано, - используя камнерез + smithing: + name: Создаётся на столе кузнеца + lore: + - Создаётся так, как показано, + - используя стол кузнеца diff --git a/src/main/resources/languages/recipes_tl.yml b/src/main/resources/languages/recipes_tl.yml index 77fc3aa2f..4ca058aef 100644 --- a/src/main/resources/languages/recipes_tl.yml +++ b/src/main/resources/languages/recipes_tl.yml @@ -156,3 +156,8 @@ minecraft: lore: - I-craft ang item na ito tulad ng ipinakita - gamit ang Stonecutter. + smithing: + name: Smithing Table Recipe + lore: + - I-craft ang item na ito tulad ng ipinakita + - gamit ang Smithing Table. diff --git a/src/main/resources/languages/recipes_tr.yml b/src/main/resources/languages/recipes_tr.yml index b705b3394..40161e2f5 100644 --- a/src/main/resources/languages/recipes_tr.yml +++ b/src/main/resources/languages/recipes_tr.yml @@ -1,158 +1,163 @@ --- -minecraft: - blasting: - lore: - - İstediğiniz eşyayı üretmek için - - bu eşyayı Maden Fırınında pişirin. - name: Maden Fırını Tarifi - campfire: - lore: - - İstediğiniz eşyayı hazırlamak için - - bu eşyayı Kamp Ateşinde pişirin. - name: Kamp Ateşi Tarifi - furnace: - lore: - - İstediğiniz eşyayı üretmek için - - bu eşyayı Fırında pişirin. - name: Fırın Tarifi - shaped: - lore: - - Bu eşyayı normal Üretim Masası kullanarak - - gösterildiği gibi üretin. - - Tarifin şekline dikkat edin. - name: Biçimli Üretim Tarifi - shapeless: - lore: - - Bu eşyayı normal Üretim Masası kullanarak - - gösterildiği gibi üretin. - - Tarifin şekli önemli değil. - name: Biçimsiz Üretim Tarifi - smoking: - lore: - - İstediğiniz eşyayı hazırlamak için - - bu eşyayı Duman Fırınında pişirin. - name: Duman Fırını Tarifi - stonecutting: - lore: - - İstediğiniz eşyayı üretmek için - - Taş Kesici kullanın. - name: Taş Kesici Tarifi slimefun: - ancient_altar: + multiblock: + name: Yapı İnşa Etme lore: - - Bu eşyayı Ancient Altar kullanarak - - gösterildiği gibi üretin. - - Daha fazla bilgi için Ancient Altar sayfasına bakın. - name: Ancient Altar - armor_forge: - lore: - - Bu eşyayı bir Armor Forge kullanarak - - gösterildiği gibi üretin. - name: Armor Forge - compressor: - lore: - - Bu eşyayı Compressor kullanarak - - gösterildiği gibi üretin. - name: Compressor + - Gösterilen yapıyı olduğu gibi inşa edin. + - Üretim masasında üretilmez. enhanced_crafting_table: + name: Enhanced Crafting Table lore: - Bu eşyayı Enhanced Crafting Tableda - gösterildiği gibi üretin. - Normal bir Üretim Masası yeterli olmaz! - name: Enhanced Crafting Table - food_composter: + armor_forge: + name: Armor Forge lore: - - Bu eşyayı Food Composter kullanarak + - Bu eşyayı bir Armor Forge kullanarak - gösterildiği gibi üretin. - name: Food Composter - food_fabricator: - lore: - - Bu eşyayı Food Fabricator kullanarak - - gösterildiği gibi üretin - name: Food Fabricator - freezer: - lore: - - Bu eşyayı Freezer kullanarak - - gösterildiği gibi üretin - name: Freezer - geo_miner: - lore: - - Bu eşyayı GEO Miner kullanarak - - elde edin - name: GEO Miner - gold_pan: - lore: - - Bu eşyayı almak için - - Gold Pan kullanın. - name: Gold Pan grind_stone: + name: Grind Stone lore: - Bu eşyayı Grind Stone kullanarak - gösterildiği gibi üretin. - name: Grind Stone - heated_pressure_chamber: + smeltery: + name: Smeltery lore: - - Bu eşyayı Heated Pressure Chamber kullanarak + - Bu eşyayı Smeltery kullanarak - gösterildiği gibi üretin. - name: Heated Pressure Chamber - juicer: - lore: - - Bu eşyayı Juicer kullanarak - - gösterildiği gibi üretin. - name: Juicer - magic_workbench: - lore: - - Bu eşyayı Magic Workbench kullanarak - - gösterildiği gibi üretin. - name: Magic Workbench - mob_drop: - lore: - - Bu eşyayı almak için - - yaratığı öldürün. - name: Yaratıktan Düşürme - multiblock: - lore: - - Gösterilen yapıyı olduğu gibi inşa edin. - - Üretim masasında üretilmez. - name: Yapı İnşa Etme - nuclear_reactor: - lore: - - Bu eşya Nuclear Reactor'ın - - bir yan ürünüdür - name: Nuclear Reactor - oil_pump: - lore: - - Bu eşyayı Oil Pump kullanarak - - elde edin - name: Oil Pump ore_crusher: + name: Ore Crusher lore: - Bu eşyayı Ore Crusher kullanarak - gösterildiği gibi üretin. - name: Ore Crusher + mob_drop: + name: Yaratıktan Düşürme + lore: + - Bu eşyayı almak için + - yaratığı öldürün. + gold_pan: + name: Gold Pan + lore: + - Bu eşyayı almak için + - Gold Pan kullanın. + compressor: + name: Compressor + lore: + - Bu eşyayı Compressor kullanarak + - gösterildiği gibi üretin. + pressure_chamber: + name: Pressure Chamber + lore: + - Bu eşyayı Pressure Chamber kullanarak + - gösterildiği gibi üretin. ore_washer: + name: Ore Washer lore: - Bu eşyayı Ore Washer kullanarak - gösterildiği gibi üretin. - name: Ore Washer + juicer: + name: Juicer + lore: + - Bu eşyayı Juicer kullanarak + - gösterildiği gibi üretin. + magic_workbench: + name: Magic Workbench + lore: + - Bu eşyayı Magic Workbench kullanarak + - gösterildiği gibi üretin. + ancient_altar: + name: Ancient Altar + lore: + - Bu eşyayı Ancient Altar kullanarak + - gösterildiği gibi üretin. + - Daha fazla bilgi için Ancient Altar sayfasına bakın. + heated_pressure_chamber: + name: Heated Pressure Chamber + lore: + - Bu eşyayı Heated Pressure Chamber kullanarak + - gösterildiği gibi üretin. + food_fabricator: + name: Food Fabricator + lore: + - Bu eşyayı Food Fabricator kullanarak + - gösterildiği gibi üretin + food_composter: + name: Food Composter + lore: + - Bu eşyayı Food Composter kullanarak + - gösterildiği gibi üretin. + freezer: + name: Freezer + lore: + - Bu eşyayı Freezer kullanarak + - gösterildiği gibi üretin + geo_miner: + name: GEO Miner + lore: + - Bu eşyayı GEO Miner kullanarak + - elde edin + nuclear_reactor: + name: Nuclear Reactor + lore: + - Bu eşya Nuclear Reactor'ın + - bir yan ürünüdür + oil_pump: + name: Oil Pump + lore: + - Bu eşyayı Oil Pump kullanarak + - elde edin pickaxe_of_containment: + name: Pickaxe of Containment lore: - Bu bloku Pickaxe of Containment kullanarak - ve bir Spawner kırarak - elde edin - name: Pickaxe of Containment - pressure_chamber: - lore: - - Bu eşyayı Pressure Chamber kullanarak - - gösterildiği gibi üretin. - name: Pressure Chamber refinery: + name: Refinery lore: - Bu eşyayı Refinery kullanarak - üretin - name: Refinery - smeltery: +minecraft: + shaped: + name: Biçimli Üretim Tarifi lore: - - Bu eşyayı Smeltery kullanarak + - Bu eşyayı normal Üretim Masası kullanarak - gösterildiği gibi üretin. - name: Smeltery + - Tarifin şekline dikkat edin. + shapeless: + name: Biçimsiz Üretim Tarifi + lore: + - Bu eşyayı normal Üretim Masası kullanarak + - gösterildiği gibi üretin. + - Tarifin şekli önemli değil. + furnace: + name: Fırın Tarifi + lore: + - İstediğiniz eşyayı üretmek için + - bu eşyayı Fırında pişirin. + blasting: + name: Maden Fırını Tarifi + lore: + - İstediğiniz eşyayı üretmek için + - bu eşyayı Maden Fırınında pişirin. + smoking: + name: Duman Fırını Tarifi + lore: + - İstediğiniz eşyayı hazırlamak için + - bu eşyayı Duman Fırınında pişirin. + campfire: + name: Kamp Ateşi Tarifi + lore: + - İstediğiniz eşyayı hazırlamak için + - bu eşyayı Kamp Ateşinde pişirin. + stonecutting: + name: Taş Kesici Tarifi + lore: + - İstediğiniz eşyayı üretmek için + - Taş Kesici kullanın. + smithing: + name: Demirci Masası Üretimi + lore: + - Bu eşyayı Demirci Masası kullanarak + - gösterildiği gibi üretin diff --git a/src/main/resources/languages/recipes_uk.yml b/src/main/resources/languages/recipes_uk.yml index 2e5821c9f..735980ba8 100644 --- a/src/main/resources/languages/recipes_uk.yml +++ b/src/main/resources/languages/recipes_uk.yml @@ -156,3 +156,8 @@ minecraft: lore: - Цей предмет створюється - у камнерізі + smithing: + name: Верстат коваля + lore: + - Цей предмет створюється + - на верстаті коваля diff --git a/src/main/resources/languages/recipes_zh-CN.yml b/src/main/resources/languages/recipes_zh-CN.yml index 10722e330..c996980ec 100644 --- a/src/main/resources/languages/recipes_zh-CN.yml +++ b/src/main/resources/languages/recipes_zh-CN.yml @@ -1,145 +1,107 @@ --- -minecraft: - blasting: - lore: - - 在高炉中燃烧 - - 以合成你想要的物品 - name: 高炉合成表 - campfire: - lore: - - 在营火上燃烧 - - 以合成你想要的物品 - name: 营火合成表 - furnace: - lore: - - 在熔炉中燃烧 - - 以合成你想要的物品 - name: 熔炉合成表 - shaped: - lore: - - 如合成表所示 - - 在普通的工作台中合成 - - 摆放顺序很重要. - name: 有序合成 - shapeless: - lore: - - 如合成表所示 - - 在普通的工作台中合成. - - 摆放顺序不重要. - name: 无序合成 - smoking: - lore: - - 在烟熏炉中燃烧 - - 以合成你想要的物品 - name: 烟熏炉合成表 - stonecutting: - lore: - - 如合成表所示 - - 使用切石机合成 - 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: - lore: - - 如合成表所示合成 - - 使用食品加工机 - name: 食品加工机 (Food Fabricator) - freezer: - lore: - - 如合成表所示 - - 在冰箱中合成 - name: 冰箱 (Freezer) - geo_miner: - lore: - - 这个物品可以用 - - GEO 矿机采集 - name: GEO 矿机 (GEO Miner) - gold_pan: - lore: - - 使用淘金盘 - - 获得此物品 - name: 淘金盘 (Gold Pan) + - 用盔甲锻造台合成 grind_stone: + name: 磨石 (Grind Stone) 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: 多方块结构 - nuclear_reactor: - lore: - - 这个物品是核反应堆 - - 运行时产生的副产物 - name: 核反应堆 (Nuclear Reactor) - ore_crusher: - lore: - - 如合成表所示 - - 在碎矿机中合成 - name: 矿石粉碎机 (Ore Crusher) - ore_washer: - lore: - - 如合成表所示 - - 在洗矿机中合成 - name: 洗矿机 (Ore Washer) - pressure_chamber: - lore: - - 如合成表所示 - - 在压力舱中合成 - name: 压力舱 (Pressure Chamber) smeltery: + name: 冶炼机 (Smeltery) lore: - 如合成表所示 - 用冶炼机合成 - name: 冶炼机 (Smeltery) + ore_crusher: + name: 矿石粉碎机 (Ore Crusher) + lore: + - 如合成表所示 + - 在碎矿机中合成 + mob_drop: + name: 击杀生物掉落 + lore: + - 击杀指定的生物 + - 以获得该物品 + gold_pan: + name: 淘金盘 (Gold Pan) + lore: + - 使用淘金盘 + - 获得此物品 + compressor: + name: 压缩机 (Compressor) + lore: + - 如合成表所示 + - 在压缩机中合成 + pressure_chamber: + name: 压力舱 (Pressure Chamber) + lore: + - 如合成表所示 + - 在压力舱中合成 + ore_washer: + name: 洗矿机 (Ore Washer) + lore: + - 如合成表所示 + - 在洗矿机中合成 + 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: + - 如合成表所示 + - 在冰箱中合成 + geo_miner: + name: GEO 矿机 (GEO Miner) + lore: + - 这个物品可以用 + - GEO 矿机采集 + nuclear_reactor: + name: 核反应堆 (Nuclear Reactor) + lore: + - 这个物品是核反应堆 + - 运行时产生的副产物 oil_pump: name: 油泵 (Oil Pump) lore: @@ -156,3 +118,46 @@ slimefun: lore: - 如合成表所示 - 用炼油机合成 +minecraft: + shaped: + name: 有序合成 + lore: + - 如合成表所示 + - 在普通的工作台中合成 + - 摆放顺序很重要. + shapeless: + name: 无序合成 + lore: + - 如合成表所示 + - 在普通的工作台中合成. + - 摆放顺序不重要. + furnace: + name: 熔炉合成表 + lore: + - 在熔炉中燃烧 + - 以合成你想要的物品 + blasting: + name: 高炉合成表 + lore: + - 在高炉中燃烧 + - 以合成你想要的物品 + smoking: + name: 烟熏炉合成表 + lore: + - 在烟熏炉中燃烧 + - 以合成你想要的物品 + campfire: + name: 营火合成表 + lore: + - 在营火上燃烧 + - 以合成你想要的物品 + stonecutting: + name: 切石机合成表 + lore: + - 如合成表所示 + - 使用切石机合成 + smithing: + name: 锻造台 + lore: + - 如所示配方 + - 在锻造台中合成 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: + - 鍛造一下下 + - 成品出來了 diff --git a/src/main/resources/languages/researches_en.yml b/src/main/resources/languages/researches_en.yml index a17fa35fb..cfef2c2ea 100644 --- a/src/main/resources/languages/researches_en.yml +++ b/src/main/resources/languages/researches_en.yml @@ -235,4 +235,6 @@ slimefun: advanced_industrial_miner: Better Mining magical_zombie_pills: De-Zombification auto_brewer: Industrial Brewery - shulker_shell: Synthetic Shulkers \ No newline at end of file + shulker_shell: Synthetic Shulkers + enchantment_rune: Ancient Enchanting + lead_clothing: Lead Clothing diff --git a/src/main/resources/languages/researches_es.yml b/src/main/resources/languages/researches_es.yml index d27fed9d9..92a533964 100644 --- a/src/main/resources/languages/researches_es.yml +++ b/src/main/resources/languages/researches_es.yml @@ -1,236 +1,238 @@ --- slimefun: - 24k_gold_block: El Dorado - advanced_android: Androides Avanzados - advanced_butcher_android: Androides Avanzados - Carnicero - advanced_circuit_board: Placa de Circuito Avanzada - advanced_electric_smeltery: Fundición Eléctrica Avanzada - advanced_farmer_android: Androides Avanzados - Granjero - advanced_fisherman_android: Androides Avanzados - Pescador - advanced_output_node: Nodo de Salida Avanzado - alloys: Aleaciones Avanzadas - ancient_altar: Altar Antiguo - ancient_runes: Runas Elementales - android_interfaces: Interfaz de Androide - android_memory_core: Núcleo de Memoria - angel_talisman: Talismán del Ángel - animal_growth_accelerator: Manipulación del Crecimiento Animal - anvil_talisman: Talismán del Herrero - armored_jetboots: Botas Jet Blindadas - armored_jetpack: Jetpack Blindado + walking_sticks: Bastones + portable_crafter: Mesa de Crafteo Portatil + fortune_cookie: Galleta de la Fortuna + portable_dustbin: Bote de Basura Portatil + meat_jerky: Carne Seca armor_forge: Forja de Armaduras - auto_anvil: Yunque Automático - auto_breeder: Auto-Alimentacion - auto_drier: Un día seco - auto_enchanting: Encantar y Desencantar Automático - automated_crafting_chamber: Crafteo Automatizado - automated_panning_machine: Gold Pan Automatizado - automatic_ignition_chamber: Cámara de Ignición Automática - backpacks: Mochilas + glowstone_armor: Armadura de Piedra Luminosa + lumps: Masas y Magia + ender_backpack: Mochila Ender + ender_armor: Armadura de Ender + magic_eye_of_ender: Ojo Mágico de Ender + magic_sugar: Azúcar Mágica + monster_jerky: Jamón de Monstruo + slime_armor: Armadura de Slime + sword_of_beheading: Espada Decapitadora basic_circuit_board: Placa de Circuito Básico + advanced_circuit_board: Placa de Circuito Avanzada + smeltery: Taller de Fundición + steel: Edad de Acero + misc_power_items: Objetos importantes relacionados con la energía battery: Tu primera Batería - better_carbon_press: Prensa de Carbón Mejorada - better_crop_growth_accelerator: Acelerador de Cultivos Mejorado - better_electric_crucibles: Crisoles Calientes - better_electric_furnace: Horno Eléctrico Mejorado - better_food_fabricator: Fabricación de Alimentos Mejorado - better_freezer: Congelador Mejorado - better_gps_transmitters: Transmisores Mejorados - better_heated_pressure_chamber: Maquina de Presión Caliente Mejorada - better_solar_generators: Paneles Solares Mejorados - bio_reactor: Reactor Biológico - blade_of_vampires: Espada Vampírica - blistering_ingots: Radiación Burbujeante - block_placer: Colocador de Bloques - boosted_uranium: Círculo Interminable - boots_of_the_stomper: Botas del Mamút - bound_armor: Armadura Ligada - bound_backpack: Almacenamiento Ligado - bound_tools: Herramientas Ligadas - bound_weapons: Armas Ligadas - bronze: Creación de Bronce - butcher_androids: Androides Carniceros + steel_plate: Placa de Acero + steel_thruster: Propulsor de Acero + parachute: Paracaídas + grappling_hook: Gancho + jetpacks: Jetpacks + multitools: Multi Herramientas + solar_panel_and_helmet: Energía solar + elemental_staff: Bastónes Elementales + grind_stone: Piedra de Moler cactus_armor: Armadura de Cactus - capacitors: Capacitador LVL I - carbonado: Diamantes Negros - carbonado_furnace: Horno de Carbonado - carbonado_tools: Máquinas de Punta - carbon_press: Prensa de Carbón - cargo_basics: Fundamentos de Cargas - cargo_nodes: Configuración de Carga - chainmail_armor: Armadura de Cota de Malla - charging_bench: Mesa de Carga - coal_generator: Generador de Carbón - cobalt_pickaxe: Pico Veloz - combustion_reactor: Reactor de Combustión - common_talisman: Talismán Común - composter: Compostando Tierra + gold_pan: Colador + magical_book_cover: Portada de Libro Mágico + slimefun_metals: Nuevos Metales + ore_crusher: Duplicador de Minerales + bronze: Creación de Bronce + alloys: Aleaciones Avanzadas compressor_and_carbon: Creaciones de Carbón - cooler: Bebidas Portables - copper_wire: Conductividad de Baja Potencia - crop_growth_accelerator: Acelerador de Cultivos - crucible: Crisol - crushed_ore: Purificación de Minerales + gilded_iron_armor: Armadura de Hierro Brillante + synthetic_diamond: Diamantes Sintéticos + pressure_chamber: Cámara de Presión + synthetic_sapphire: Zafiros Sintéticos damascus_steel: Acero de Damasco damascus_steel_armor: Armadura de Damasco - diet_cookie: Galleta Dietética - duct_tape: Cinta Adhesiva - electric_crucible: Crisól Electrificado - electric_furnaces: Horno Eléctrico - electric_ingot_machines: Fabricación Eléctrica de Lingotes + reinforced_alloy: Aleación Reforzada + carbonado: Diamantes Negros + magic_workbench: Mesa de Trabajo Mágica + wind_staff: Bastón de Aire + reinforced_armor: Armadura Reforzada + ore_washer: Tamizador + gold_carats: Oro Puro + silicon: Silicon Valley + fire_staff: Vara de Fuego + smelters_pickaxe: Pico Fundidor + common_talisman: Talismán Común + anvil_talisman: Talismán del Herrero + miner_talisman: Talismán del Minero + hunter_talisman: Talismán del Cazador + lava_talisman: Talismán del Caminante de Lava + water_talisman: Talismán del Pez + angel_talisman: Talismán del Ángel + fire_talisman: Talismán del Bombero + lava_crystal: Situación Ardiente + magician_talisman: Talismán del Mago + traveller_talisman: Talismán del Explorador + warrior_talisman: Talismán del Guerrero + knight_talisman: Talismán del Caballero + gilded_iron: Hierro Brillante + synthetic_emerald: Gema Falsa + chainmail_armor: Armadura de Cota de Malla + whirlwind_talisman: Talismán del Tornado + wizard_talisman: Talismán del Hechizero + lumber_axe: Hacha de Leñador + hazmat_suit: Traje Haz-Mat + uranium: Radioactivo + crushed_ore: Purificación de Minerales + redstone_alloy: Aleación de Redstone + carbonado_tools: Máquinas de Punta + first_aid: Primeros Auxilios + gold_armor: Armadura Resplandeciente + night_vision_googles: Lentes de Visión Nocturna + pickaxe_of_containment: Pico de Contención + hercules_pickaxe: Pico de Hércules + table_saw: Sierra + slime_steel_armor: Armadura de Acero Pegajoso + blade_of_vampires: Espada Vampírica + water_staff: Bastón de Agua + 24k_gold_block: El Dorado + composter: Compostando Tierra + farmer_shoes: Zapatos de Granjero + explosive_tools: Herramientas Explosivas + automated_panning_machine: Gold Pan Automatizado + boots_of_the_stomper: Botas del Mamút + pickaxe_of_the_seeker: Pico del Buscador + backpacks: Mochilas + woven_backpack: Mochila Tejida + crucible: Crisol + gilded_backpack: 'Mochila Reforzada ' + armored_jetpack: Jetpack Blindado + ender_talismans: Talismán de Ender + nickel_and_cobalt: Aún más Minerales + magnet: Metales Magnéticos + infused_magnet: Imánes Aleados + cobalt_pickaxe: Pico Veloz + essence_of_afterlife: Necromancia + bound_backpack: Almacenamiento Ligado + jetboots: Botas Jet + armored_jetboots: Botas Jet Blindadas + seismic_axe: Hacha Sísmica + pickaxe_of_vein_mining: Pico de Menas + bound_weapons: Armas Ligadas + bound_tools: Herramientas Ligadas + bound_armor: Armadura Ligada + juicer: Bebidas Deliciosas + repaired_spawner: Spawners Reparados + enhanced_furnace: Horno Mejorado + more_enhanced_furnaces: Mejores Hornos + high_tier_enhanced_furnaces: Horno de Alto Nivel + reinforced_furnace: Horno Reforzado + carbonado_furnace: Horno de Carbonado electric_motor: Calentando Motores + block_placer: Colocador de Bloques + scroll_of_dimensional_teleposition: Volteando cosas por aquí + special_bows: Robin Hood + tome_of_knowledge_sharing: Compartiendo con amigos + flask_of_knowledge: Almacenamiento de EXP + hardened_glass: Resistiendo Explosiones + golden_apple_juice: Poción Dorada + cooler: Bebidas Portables + ancient_altar: Altar Antiguo + wither_proof_obsidian: Obsidiana contra Withers + ancient_runes: Runas Elementales + special_runes: Runas Púrpuras + infernal_bonemeal: Polvo de Hueso Infernal + rainbow_blocks: Bloques Arcoíris + infused_hopper: Tolva Aleada + wither_proof_glass: Vidrio contra Withers + duct_tape: Cinta Adhesiva + plastic_sheet: Plástico + android_memory_core: Núcleo de Memoria + oil: Aceite + fuel: Combustible + hologram_projector: Hologramas + capacitors: Capacitador LVL I + high_tier_capacitors: Capacitador LVL II + solar_generators: Generador Solar + electric_furnaces: Horno Eléctrico electric_ore_grinding: Triturar y Moler - electric_press: Prensa Eléctrica - electric_smeltery: Fundición Eléctrica - elemental_staff: Bastónes Elementales + heated_pressure_chamber: Máquina de Presión Caliente + coal_generator: Generador de Carbón + bio_reactor: Reactor Biológico + auto_enchanting: Encantar y Desencantar Automático + auto_anvil: Yunque Automático + multimeter: Medidor de Potencia + gps_setup: Configuración GPS Básica + gps_emergency_transmitter: Waypoint GPS de Emergencia + programmable_androids: Androide Programable + android_interfaces: Interfaz de Androide + geo_scanner: GEO-Escaner + combustion_reactor: Reactor de Combustión + teleporter: Componentes Base de Teletransportador + teleporter_activation_plates: Activación de Teletransportador + better_solar_generators: Paneles Solares Mejorados + better_gps_transmitters: Transmisores Mejorados elevator: Elevadores - elytra: Elytras + energized_solar_generator: Energía Solar a Tiempo Completo + energized_gps_transmitter: Transmisor de Punta + energy_regulator: Redes Energéticas 101 + butcher_androids: Androides Carniceros + organic_food: Comida Organica + auto_breeder: Auto-Alimentacion + advanced_android: Androides Avanzados + advanced_butcher_android: Androides Avanzados - Carnicero + advanced_fisherman_android: Androides Avanzados - Pescador + animal_growth_accelerator: Manipulación del Crecimiento Animal + xp_collector: Recolector de EXP + organic_fertilizer: Fertilizante Orgánico + crop_growth_accelerator: Acelerador de Cultivos + better_crop_growth_accelerator: Acelerador de Cultivos Mejorado + reactor_essentials: Esenciales de Reactores + nuclear_reactor: Planta de Energía Nuclear + freezer: Congelador + cargo_basics: Fundamentos de Cargas + cargo_nodes: Configuración de Carga + electric_ingot_machines: Fabricación Eléctrica de Lingotes + high_tier_electric_ingot_machines: Lingotes Super Rápidos + automated_crafting_chamber: Crafteo Automatizado + better_food_fabricator: Fabricación de Alimentos Mejorado + reactor_access_port: Interactua con tú Reactor + fluid_pump: Bomba de Liquidos + better_freezer: Congelador Mejorado + boosted_uranium: Círculo Interminable + trash_can: Basurero + advanced_output_node: Nodo de Salida Avanzado + carbon_press: Prensa de Carbón + electric_smeltery: Fundición Eléctrica + better_electric_furnace: Horno Eléctrico Mejorado + better_carbon_press: Prensa de Carbón Mejorada empowered_android: Androides Potenciados empowered_butcher_android: Androides Potenciados - Carnicero empowered_fisherman_android: Androides Potenciados - Pescador - ender_armor: Armadura de Ender - ender_backpack: Mochila Ender - ender_talismans: Talismán de Ender - energized_gps_transmitter: Transmisor de Punta - energized_solar_generator: Energía Solar a Tiempo Completo - energy_regulator: Redes Energéticas 101 - enhanced_furnace: Horno Mejorado - essence_of_afterlife: Necromancia - explosive_tools: Herramientas Explosivas - farmer_shoes: Zapatos de Granjero - fire_staff: Vara de Fuego - fire_talisman: Talismán del Bombero - first_aid: Primeros Auxilios - flask_of_knowledge: Almacenamiento de EXP - fluid_pump: Bomba de Liquidos - fortune_cookie: Galleta de la Fortuna - freezer: Congelador - fuel: Combustible - geo_miner: GEO-Minador - geo_scanner: GEO-Escaner - gilded_backpack: 'Mochila Reforzada ' - gilded_iron: Hierro Brillante - gilded_iron_armor: Armadura de Hierro Brillante - glowstone_armor: Armadura de Piedra Luminosa - gold_armor: Armadura Resplandeciente - gold_carats: Oro Puro - golden_apple_juice: Poción Dorada - gold_pan: Colador - gps_emergency_transmitter: Waypoint GPS de Emergencia - gps_setup: Configuración GPS Básica - grappling_hook: Gancho - grind_stone: Piedra de Moler - hardened_glass: Resistiendo Explosiones - hazmat_suit: Traje Haz-Mat - heated_pressure_chamber: Máquina de Presión Caliente - hercules_pickaxe: Pico de Hércules - high_tier_capacitors: Capacitador LVL II high_tier_carbon_press: Carbón Prensado Definitivo - high_tier_electric_ingot_machines: Lingotes Super Rápidos - high_tier_enhanced_furnaces: Horno de Alto Nivel - hologram_projector: Hologramas - hunter_talisman: Talismán del Cazador - infernal_bonemeal: Polvo de Hueso Infernal - infused_hopper: Tolva Aleada - infused_magnet: Imánes Aleados - jetboots: Botas Jet - jetpacks: Jetpacks - juicer: Bebidas Deliciosas - kelp_cookie: Algas Sabrosas - knight_talisman: Talismán del Caballero - lava_crystal: Situación Ardiente + wither_assembler: Mata Withers Automatizado + better_heated_pressure_chamber: Maquina de Presión Caliente Mejorada + elytra: Elytras + special_elytras: Elytras Especiales + electric_crucible: Crisól Electrificado + better_electric_crucibles: Crisoles Calientes + advanced_electric_smeltery: Fundición Eléctrica Avanzada + advanced_farmer_android: Androides Avanzados - Granjero lava_generator: Generador de Lava - lava_talisman: Talismán del Caminante de Lava - lightning_rune: Runa de Rayos - lumber_axe: Hacha de Leñador - lumps: Masas y Magia - magical_book_cover: Portada de Libro Mágico - magic_eye_of_ender: Ojo Mágico de Ender - magician_talisman: Talismán del Mago - magic_sugar: Azúcar Mágica - magic_workbench: Mesa de Trabajo Mágica - magnesium_generator: Poder de Magnesio - magnet: Metales Magnéticos - makeshift_smeltery: Fundición Improvisada - meat_jerky: Carne Seca - miner_talisman: Talismán del Minero - misc_power_items: Objetos importantes relacionados con la energía - monster_jerky: Jamón de Monstruo - more_enhanced_furnaces: Mejores Hornos - multimeter: Medidor de Potencia - multitools: Multi Herramientas - nether_gold_pan: Colador del Nether nether_ice: Refrigerante de Hielo del Nether nether_star_reactor: Reactor de Estrella del Nether - nickel_and_cobalt: Aún más Minerales - night_vision_googles: Lentes de Visión Nocturna - nuclear_reactor: Planta de Energía Nuclear - oil: Aceite - ore_crusher: Duplicador de Minerales - ore_washer: Tamizador - organic_fertilizer: Fertilizante Orgánico - organic_food: Comida Organica + blistering_ingots: Radiación Burbujeante + automatic_ignition_chamber: Cámara de Ignición Automática output_chest: Cofre de Salida de Máquinas Básicas - parachute: Paracaídas - pickaxe_of_containment: Pico de Contención - pickaxe_of_the_seeker: Pico del Buscador - pickaxe_of_vein_mining: Pico de Menas - plastic_sheet: Plástico - portable_crafter: Mesa de Crafteo Portatil - portable_dustbin: Bote de Basura Portatil - pressure_chamber: Cámara de Presión - programmable_androids: Androide Programable + copper_wire: Conductividad de Baja Potencia radiant_backpack: Mochila Radiante - rainbow_blocks: Bloques Arcoíris - reactor_access_port: Interactua con tú Reactor - reactor_essentials: Esenciales de Reactores - redstone_alloy: Aleación de Redstone - reinforced_alloy: Aleación Reforzada - reinforced_armor: Armadura Reforzada - reinforced_furnace: Horno Reforzado - repaired_spawner: Spawners Reparados - scroll_of_dimensional_teleposition: Volteando cosas por aquí - seismic_axe: Hacha Sísmica - silicon: Silicon Valley - slime_armor: Armadura de Slime - slimefun_metals: Nuevos Metales - slime_steel_armor: Armadura de Acero Pegajoso - smelters_pickaxe: Pico Fundidor - smeltery: Taller de Fundición - solar_generators: Generador Solar - solar_panel_and_helmet: Energía solar - soulbound_rune: Runa de Alma - special_bows: Robin Hood - special_elytras: Elytras Especiales - special_runes: Runas Púrpuras - steel: Edad de Acero - steel_plate: Placa de Acero - steel_thruster: Propulsor de Acero + auto_drier: Un día seco + diet_cookie: Galleta Dietética storm_staff: Bastón de las Tormentas - sword_of_beheading: Espada Decapitadora - synthetic_diamond: Diamantes Sintéticos - synthetic_emerald: Gema Falsa - synthetic_sapphire: Zafiros Sintéticos - table_saw: Sierra - teleporter: Componentes Base de Teletransportador - teleporter_activation_plates: Activación de Teletransportador - tome_of_knowledge_sharing: Compartiendo con amigos + soulbound_rune: Runa de Alma + geo_miner: GEO-Minador + lightning_rune: Runa de Rayos totem_of_undying: Tótem de la Inmortalidad - trash_can: Basurero - traveller_talisman: Talismán del Explorador + charging_bench: Mesa de Carga + nether_gold_pan: Colador del Nether + electric_press: Prensa Eléctrica + magnesium_generator: Poder de Magnesio + kelp_cookie: Algas Sabrosas + makeshift_smeltery: Fundición Improvisada tree_growth_accelerator: Árboles Veloces - uranium: Radioactivo - walking_sticks: Bastones - warrior_talisman: Talismán del Guerrero - water_staff: Bastón de Agua - water_talisman: Talismán del Pez - whirlwind_talisman: Talismán del Tornado - wind_staff: Bastón de Aire - wither_assembler: Mata Withers Automatizado - wither_proof_glass: Vidrio contra Withers - wither_proof_obsidian: Obsidiana contra Withers - wizard_talisman: Talismán del Hechizero - woven_backpack: Mochila Tejida - xp_collector: Recolector de EXP industrial_miner: Minería Industrial advanced_industrial_miner: Minería Mejorada + magical_zombie_pills: De-Zombificación + auto_brewer: Alquimia Industrial diff --git a/src/main/resources/languages/researches_id.yml b/src/main/resources/languages/researches_id.yml new file mode 100644 index 000000000..0bf6617cc --- /dev/null +++ b/src/main/resources/languages/researches_id.yml @@ -0,0 +1,238 @@ +--- +slimefun: + walking_sticks: 'Tongkat ' + portable_crafter: Alat Crafting + fortune_cookie: Kue Keberuntungan + portable_dustbin: Tempat Sampah Portabel + meat_jerky: Dendeng Sapi + armor_forge: Meja Kerajinan Armor + glowstone_armor: Baju Zirah Glowstone + lumps: Gumpalan dan Sihir + ender_backpack: Tas Ender + ender_armor: Baju Zirah Ender + magic_eye_of_ender: Mata Sihir Ender + magic_sugar: Gula Sihir + monster_jerky: Dendeng Monster + slime_armor: Baju Zirah Lendir + sword_of_beheading: Pedang Pemenggal + basic_circuit_board: Papan Sirkuit Dasar + advanced_circuit_board: Papan Sirkuit Lanjutan + smeltery: Kompor Pelebur + steel: Baja + misc_power_items: Item terkait daya yang penting + battery: Baterai Pertamamu + steel_plate: Lembaran Baja + steel_thruster: Penekan Baja + parachute: Parasut + grappling_hook: Penggenggam Besi + jetpacks: Jetpacks + multitools: Alat Serbaguna + solar_panel_and_helmet: Tenaga Surya + elemental_staff: Tongkat Unsur + grind_stone: Penggiling Batu + cactus_armor: Pakaian Kaktus + gold_pan: Wajan Emas + magical_book_cover: Buku Pengikat Sihir + slimefun_metals: Logam Baru + ore_crusher: Bijih Dua Kali Lipat + bronze: Pembuatan Perunggu + alloys: Logam Campuran lanjutan + compressor_and_carbon: Pembuatan Karbon + gilded_iron_armor: Baju Zirah Besi Berlapis Emas + synthetic_diamond: Berlian Sintetis + pressure_chamber: Ruangan Bertekanan + synthetic_sapphire: Safir Sintetis + damascus_steel: Baja Damaskus + damascus_steel_armor: Baju Zirah Baja Damaskus + reinforced_alloy: Logam Campuran Yang Diperkuat + carbonado: Berlian Hitam + magic_workbench: Meja Kerajinan Sihir + wind_staff: Tongkat Sihir Udara + reinforced_armor: Baju Zirah Logam Campurang Yang Diperkuat + ore_washer: Mesin Pencuci Bijih + gold_carats: Emas Murni + silicon: Lembah Silikon + fire_staff: Tongkat Sihir Api + smelters_pickaxe: Beliung Pelebur + common_talisman: Jimat Biasa + anvil_talisman: Jimat Landasan + miner_talisman: Jimat Penambang + hunter_talisman: Jimat Pemburu + lava_talisman: Jimat Pejalan Lahar + water_talisman: Jimat Bernafas Dalam Air + angel_talisman: Jimat Malaikat + fire_talisman: Jimat Pemadam Kebakaran + lava_crystal: Kebakaran + magician_talisman: Jimat Pesulap + traveller_talisman: Jimat Petualang + warrior_talisman: Jimat Prajurit + knight_talisman: Jimat Ksatria + gilded_iron: Besi Bersinar + synthetic_emerald: Permata Palsu + chainmail_armor: Baju Zirah Rantai + whirlwind_talisman: Jimat Angin Puyuh + wizard_talisman: Jimat Penyihir + lumber_axe: Kapak Pemotong Kayu + hazmat_suit: Pakaian Pelindung Diri + uranium: Radio Aktif + crushed_ore: Pemurnian Bijih + redstone_alloy: Logam Campuran Redstone + carbonado_tools: Mesin Tingkat Atas + first_aid: Pertolongan Pertama + gold_armor: Baju Zirah Bersinar + night_vision_googles: Kacamata Penglihatan Malam + pickaxe_of_containment: Beliung Penahan + hercules_pickaxe: Beliung Hercules + table_saw: Meja Gergaji + slime_steel_armor: Pakaian Baja Berlendir + blade_of_vampires: Pedang Vampir + water_staff: Tongkat Sihir Air + 24k_gold_block: Kota Emas + composter: Tanah Kompos + farmer_shoes: Sepatu Petani + explosive_tools: Alat Peledak + automated_panning_machine: Wajan Emas Otomatis + boots_of_the_stomper: Sepatu Penginjak + pickaxe_of_the_seeker: Beliung Pencari + backpacks: Tas + woven_backpack: Tas Anyaman + crucible: Tempat Pencair Logam + gilded_backpack: Tas Berlapis Emas + armored_jetpack: Jetpack Berlapis Baja + ender_talismans: Jimat Ender + nickel_and_cobalt: Lebih Banyak Bijih + magnet: Besi Berani + infused_magnet: Besi Berani Tertanam + cobalt_pickaxe: Beliung Cepat + essence_of_afterlife: Penujuman + bound_backpack: Penyimpanan Terikat Jiwa + jetboots: Sepatu Jet + armored_jetboots: Sepatu Jet Berlapis Baja + seismic_axe: Kapak Seismik + pickaxe_of_vein_mining: Beliung Penambang Vena + bound_weapons: Senjata Terikat Jiwa + bound_tools: Peralatan Terikat Jiwa + bound_armor: Pakaian Terikat Jiwa + juicer: Minuman Segar + repaired_spawner: Memperbaiki Spawner + enhanced_furnace: Tungku Pembakaran Tingkatan + more_enhanced_furnaces: Tungku Pembakaran Yang Lebih Baik + high_tier_enhanced_furnaces: Tingkat Tinggi Tungku Pembakaran + reinforced_furnace: Tungku Pembakaran Yang Diperkuat + carbonado_furnace: 'Tungku Pembakaran Bersisi Carbonado ' + electric_motor: Memanaskan + block_placer: Peletak Blok + scroll_of_dimensional_teleposition: Memutar Sesuatu Disekeliling + special_bows: Robin Hood + tome_of_knowledge_sharing: Berbagi Dengan Teman + flask_of_knowledge: Penyimpan XP + hardened_glass: Tahan Terhadap Ledakan + golden_apple_juice: Ramuan Emas + cooler: Tempat Minuman Portabel + ancient_altar: Altar Kuno + wither_proof_obsidian: Obsidian Anti Wither + ancient_runes: Sajak Berelemen + special_runes: Sajak Ungu + infernal_bonemeal: Pupuk Neraka + rainbow_blocks: Blok Pelangi + infused_hopper: Hopper Infus + wither_proof_glass: Kaca Anti Wither + duct_tape: Lakban + plastic_sheet: Plastik + android_memory_core: Inti Memori + oil: Minyak + fuel: Bahan Bakar + hologram_projector: Hologram + capacitors: Kapasitor Tingkat 1 + high_tier_capacitors: Kapasitor Tingkat 2 + solar_generators: Pembangkit Listrik Tenaga Surya + electric_furnaces: Tungku Pembakaran Bertenaga + electric_ore_grinding: Penghancur Dan Penggiling + heated_pressure_chamber: Ruangan Bertekanan Panas + coal_generator: Batu Bara Generator + bio_reactor: Bio-Reaktor + auto_enchanting: Pemikat Otomatis Dan Pencabut Pemikat + auto_anvil: Landasan Otomatis + multimeter: Pengukur Daya + gps_setup: Susunan GPS Dasar + gps_emergency_transmitter: Titik Lokasi Darurat GPS + programmable_androids: Android + android_interfaces: Antarmuka Android + geo_scanner: Peninjau GEO + combustion_reactor: Reaktor Pembakaran + teleporter: Komponen Teleportasi + teleporter_activation_plates: Pengaktif Teleportasi + better_solar_generators: Pembangkit Listrik Bertenaga Surya Tingkat Lanjut + better_gps_transmitters: Pemancar Tingkat Lanjut + elevator: Tangga Berjalan + energized_solar_generator: Pembangkit Listrik Tenaga Surya Setiap Saat + energized_gps_transmitter: Pemancar Tingkat Tinggi + energy_regulator: Jaringan Energi 101 + butcher_androids: Android Tukang Daging + organic_food: Makanan Organik + auto_breeder: Pemberi Makan Otomatis + advanced_android: Android Lanjutan + advanced_butcher_android: Android Lanjutan - Tukang Daging + advanced_fisherman_android: Android Lanjutan - Pemancing + animal_growth_accelerator: Mesin Manipulasi Pertumbuhan Hewan + xp_collector: Pengumpul XP + organic_fertilizer: Pupuk Organik + crop_growth_accelerator: Mesin Akselerasi Pertumbuhan Tanaman + better_crop_growth_accelerator: Mesin Akselerasi Pertumbuhan Tanaman Tingka Lanjut + reactor_essentials: Barang Penting Reaktor + nuclear_reactor: Pembangkit Listrik Tenaga Nuklir + freezer: Pembeku + cargo_basics: Muatan Dasar + cargo_nodes: Susunan Muatan + electric_ingot_machines: Pembuat Batang Logam Elektrik + high_tier_electric_ingot_machines: Pembuat Batang Logam Sangat Cepat + automated_crafting_chamber: Pembuat Otomatis + better_food_fabricator: Mesin Pembuat Makanan Lanjutan + reactor_access_port: Interaksi Reaktor + fluid_pump: Pompa Cairan + better_freezer: Lemari Es Lanjutan + boosted_uranium: Perputaran Tiada Henti + trash_can: Sampah + advanced_output_node: Jalur Keluaran Lanjutan + carbon_press: Penekan Karbon + electric_smeltery: Kompor Pelebur Elektrik + better_electric_furnace: Kompor Pembakaran Elektrik Lanjutan + better_carbon_press: Penekan Karbon Lanjutan + empowered_android: Diberdayakan Android + empowered_butcher_android: Diberdayakan Android - Tukang Daging + empowered_fisherman_android: Diberdayakan Android - Pemancing + high_tier_carbon_press: Penekan Karbon Tingkat Akhir + wither_assembler: Pembunuh Wither Otomatis + better_heated_pressure_chamber: Ruang Bertenakan Tinggi Lanjutan + elytra: Elytra + special_elytras: Elytra Spesial + electric_crucible: Tempat Pencair Logam Elektrik + better_electric_crucibles: Tempat Pencain Logam Panas + advanced_electric_smeltery: Kompor Pelebur Elektrik Lanjutan + advanced_farmer_android: Android Lanjutan - Petani + lava_generator: Mesin Pembangkit Tenaga Lahar + nether_ice: 'Es Neraka Cairan Pendingin ' + nether_star_reactor: Reaktor Nether Star + blistering_ingots: Radioaktivitas Terik + automatic_ignition_chamber: Alat Perapian Otomatis + output_chest: 'Alat Penyimpanan Keluaran Dasar ' + copper_wire: Daya Konduksi Yang Menipis + radiant_backpack: Tas Berseri + auto_drier: Hari Yang Kering + diet_cookie: Kue Diet + storm_staff: Tongkat Sihir Petir + soulbound_rune: Sajak Terikat Jiwa + geo_miner: Penambang GEO + lightning_rune: Sajak Petir + totem_of_undying: Totem Keabadian + charging_bench: Meja Isi Daya + nether_gold_pan: Wajan Emas Neraka + electric_press: Mesin Tekan Elektrik + magnesium_generator: Tenaga Dari Magnesium + kelp_cookie: Rumput Laut Lezat + makeshift_smeltery: Pelebur Tingkat Lanjut + tree_growth_accelerator: Percepat Pohon + industrial_miner: Industrial tambang + advanced_industrial_miner: Menambang Yang Jauh Lebih Baik + magical_zombie_pills: De-Zombification + auto_brewer: Industri Bir diff --git a/src/main/resources/languages/researches_pl.yml b/src/main/resources/languages/researches_pl.yml new file mode 100644 index 000000000..e31a805d3 --- /dev/null +++ b/src/main/resources/languages/researches_pl.yml @@ -0,0 +1,234 @@ +--- +slimefun: + walking_sticks: Ruchomy Patyk + portable_crafter: Przenośny Stół Rzemieślniczy + fortune_cookie: Ciastko z wróżbą + portable_dustbin: Przenośny Kosz + meat_jerky: Suszone Mięso + armor_forge: Tworzenie Zbroji + glowstone_armor: Jasnopyłowa Zbroja + lumps: Grudki i Magia + ender_backpack: Plecak Endu + ender_armor: Zbroja Endu + magic_eye_of_ender: Magiczne Oko Endera + magic_sugar: Magiczny Cukier + monster_jerky: 'Potworne Mięso ' + slime_armor: Szlamowa Zbroja + sword_of_beheading: Miecz Odcinania Głów + basic_circuit_board: Podstawowa Płyta Drukowana + advanced_circuit_board: Zaawansowana Płyta Drukowana + smeltery: Wytapiacz + steel: Epoka Stali + misc_power_items: Ważne przedmioty związane z prądem + battery: Twoja pierwsza bateria + steel_plate: Stalowa Blacha + steel_thruster: Stalowy Ster Strumieniowy + parachute: Spadochron + grappling_hook: Hak do Chwytania + jetpacks: Plecaki Odrzutowe + multitools: Narzędzia Wielofunkcyjne + solar_panel_and_helmet: Energia Słoneczna + elemental_staff: Drążki Żywiołów + grind_stone: Kamień Szliferski + cactus_armor: Kaktusowy Garnitur + gold_pan: Złota Patelnia + magical_book_cover: Magiczna Oprawa do Książek + slimefun_metals: Nowe Metale + ore_crusher: Kruszarka Rud + bronze: Tworzenie Bronzu + alloys: Zaawansowane Stopy + compressor_and_carbon: Tworzenie Węgla + gilded_iron_armor: Pozłacana Żelazna Zbroja + synthetic_diamond: Diamenty Syntetyczne + pressure_chamber: Komora Ciśnieniowa + synthetic_sapphire: Szafiry Syntetyczne + damascus_steel: Stal Damasceńska + damascus_steel_armor: Zbroja ze Stali Damasceńskiej + reinforced_alloy: Wzmocniony Stop + carbonado: Czarne Diamenty + magic_workbench: Magiczny Stół Rzemieślniczy + wind_staff: Laska Wiatru + reinforced_armor: Wzmocniona Zbroja + ore_washer: Zmywacz Rud + gold_carats: Czyste Złoto + silicon: Dolina Krzemowa + fire_staff: Laska Ognia + smelters_pickaxe: Kilof Hutniczy + common_talisman: Pospolity Talizman + anvil_talisman: Talizman Kowadła + miner_talisman: Talizman Górnika + hunter_talisman: Talizman Łowcy + lava_talisman: Talizman Chodzącego po Lawie + water_talisman: Talizman Oddychacza pod Wodą + angel_talisman: Talizman Anioła + fire_talisman: Talizman Strażaka + lava_crystal: Ogniowa Sytuacja + magician_talisman: Talizman Maga + traveller_talisman: Talizman Podróżnika + warrior_talisman: Talizman Wojownika + knight_talisman: Talizman Rycerza + gilded_iron: Błyszczące Żelazo + synthetic_emerald: Fałszywy Klejnot + chainmail_armor: Kolczuga + whirlwind_talisman: Talizman Wiatru + wizard_talisman: Talizman Czarnoksiężnika + lumber_axe: Siekiera Drwala + hazmat_suit: Kombinezon Materiałów Niebezpiecznych + uranium: Radioaktywny + crushed_ore: Oczyszczanie Rud + redstone_alloy: Stop Czerwonego Proszku + carbonado_tools: Maszyny na Najwyższym Poziomie + first_aid: Pierwsza Pomoc + gold_armor: Błyszcząca Zbroja + night_vision_googles: Gogle Noktowizyjne + pickaxe_of_containment: Kilof Przechowywania + hercules_pickaxe: Kilof Herkulesa + table_saw: Piła Stołowa + slime_steel_armor: Szlamowy Pancerz Stalowy + blade_of_vampires: Ostrze Wampirów + water_staff: Laska Wody + 24k_gold_block: Miasto ze Złota + composter: Kompostowanie Ziemi + farmer_shoes: Buty Rolnika + explosive_tools: Narzędzia Wybuchowe + automated_panning_machine: Zautomatyzowana Złota Patelnia + boots_of_the_stomper: Buty Stompera + pickaxe_of_the_seeker: Kilof Poszukiwacza + backpacks: Plecaki + woven_backpack: Pleciony Plecak + crucible: Tygiel + gilded_backpack: Pozłacany Plecak + armored_jetpack: Opancerzony Plecak Odrzutowy + ender_talismans: Talizmany Endera + nickel_and_cobalt: Jeszcze więcej Rud + magnet: Metale Magnetyczne + infused_magnet: Natchnione Magnesy + cobalt_pickaxe: Kobaltowy Kilof + essence_of_afterlife: Nekromancja + bound_backpack: Plecak Soulbound + jetboots: Buty Odrzutowe + armored_jetboots: Opancerzone Buty Odrzutowe + seismic_axe: Sejsmiczny Topór + pickaxe_of_vein_mining: Kilof z Żyły Górnictwa + bound_weapons: Bronie Soulbound + bound_tools: Narzędzia Soulbound + bound_armor: Soulbound Zbroja + juicer: Pyszne Drinki + repaired_spawner: Naprawianie Spawnerów + enhanced_furnace: Ulepszony Piec + more_enhanced_furnaces: Lepsze Piece + high_tier_enhanced_furnaces: Piec Wysokopoziomowy + reinforced_furnace: Wzmocniony Piec + carbonado_furnace: Karbonado Ostry Piec + electric_motor: Podgrzewać + block_placer: Blok Kładący + scroll_of_dimensional_teleposition: Odwracając rzeczy dookoła + special_bows: Robin Hood + tome_of_knowledge_sharing: Podziel się z Znajomym + flask_of_knowledge: Przechowywacz Expa + hardened_glass: Wytrzymałość na Wybuchy + golden_apple_juice: Złota Mikstura + cooler: Przenośna Chłodnica + ancient_altar: Starożytny Ołtarz + wither_proof_obsidian: Wither-Ochronne Obsydian + ancient_runes: Runy Żywiołów + special_runes: Fioletowe Runy + infernal_bonemeal: Piekielna Mączka Kostna + rainbow_blocks: Tęczowy Blok + infused_hopper: Lej Infused + wither_proof_glass: Wither-Ochronne Szkło + duct_tape: Taśma Klejąca + plastic_sheet: Plastik + android_memory_core: Rdzeń Pamięci + oil: Olej + fuel: Paliwo + hologram_projector: Projektor Hologramów + capacitors: Poziom 1 Kondensator + high_tier_capacitors: Poziom 2 Kondensator + solar_generators: Generator Słoneczny + electric_furnaces: Elektryczny Piec + electric_ore_grinding: Elektryczna Szlifierka Rudy + heated_pressure_chamber: Ogrzewana Komora Ciśnieniowa + coal_generator: Generator Węgla + bio_reactor: Bio-Reaktor + auto_enchanting: Automatyczne zaczarowanie i odczarowywanie + auto_anvil: Automatyczne Kowadło + multimeter: Pomiar Mocy + gps_setup: Podstawowa Konfiguracja GPS + gps_emergency_transmitter: Awaryjny punkt GPS + programmable_androids: Programowalne Androidy + android_interfaces: Interfejsyjny Android + geo_scanner: GEO-Skaner + combustion_reactor: Reaktor Spalania + teleporter: Komponenty Podstawowe Teleportera + teleporter_activation_plates: Aktywacja Teleportera + better_solar_generators: Ulepszony Słoneczny Generator + better_gps_transmitters: Ulepszony Transmiter + elevator: Windy + energized_solar_generator: Pełny-Czas Energia Słoneczna + energized_gps_transmitter: Transmiter Najwyższego Poziomu + energy_regulator: Regulator Energii + butcher_androids: Rzeźnik Android + organic_food: Organiczne Jedzenie + auto_breeder: Zautomatyzowane Karmienie + advanced_android: Zaawansowane Androidy + advanced_butcher_android: Zaawansowany Android - Rzeźnik + advanced_fisherman_android: Zaawansowany Android - Rybak + animal_growth_accelerator: Manipulacja Wzrostem Zwierząt + xp_collector: Kolekcjoner Expa + organic_fertilizer: Organiczny Nawóz + crop_growth_accelerator: Przyspieszenie Wzrostu Upraw + better_crop_growth_accelerator: Upgraded Crop Growth Accelerator + reactor_essentials: Podstawowy Reaktor + nuclear_reactor: Elektrownia Atomowa + freezer: Zamrażarka + cargo_basics: Podstawy Ładunku + cargo_nodes: Konfiguracja Ładunku + electric_ingot_machines: Elektryczna Fabryka Sztabek + high_tier_electric_ingot_machines: Super Szybka Produkcja Sztabek + automated_crafting_chamber: Automatyczny Stół Rzemieślniczy + better_food_fabricator: Ulepszone Wytwarzanie Żywności + reactor_access_port: Interakcja Reaktora + fluid_pump: Pompa Płynu + better_freezer: Ulepszona Zamrażarka + boosted_uranium: Niekończący się krąg + trash_can: Kosz + advanced_output_node: Zaawansowany Węzeł Wyjściowy + carbon_press: Prasa do Karbonado + electric_smeltery: Elektryczny Wytapiacz + better_electric_furnace: Ulepszony Elektryczny Piec + better_carbon_press: Ulepszona Prasa do Karbonado + empowered_android: 'Wzmocniony Android ' + empowered_butcher_android: Wzmocniony Android - Rzeźnik + empowered_fisherman_android: Wzmocniony Android - Rybak + high_tier_carbon_press: Ostateczna Prasa Węglowa + wither_assembler: Automatyczny Zabijacz Withera + better_heated_pressure_chamber: Ulepszona Ogrzewana Komora Ciśnieniowa + elytra: Elytra + special_elytras: Specjalna Elytra + electric_crucible: Naelektryzowany Tygiel + better_electric_crucibles: Gorące Tygle + advanced_electric_smeltery: Zaawansowana Huta Elektryczna + advanced_farmer_android: Zaawansowany Android - Farmer + lava_generator: Generator Lawy + nether_ice: Piekielny Lód Chłodzący + nether_star_reactor: Piekielny Reaktor + blistering_ingots: Pękająca Promieniotwórczość + automatic_ignition_chamber: Automatyczna Komora Zapłonowa + output_chest: Podstawowa Skrzynia Wyjściowa Maszyn + copper_wire: Zmniejszona Przewodność + radiant_backpack: Radioaktywny Plecak + auto_drier: Suchy Dzień + diet_cookie: Dietetyczne Ciasteczko + storm_staff: Laska Burzowa + soulbound_rune: Soulbound Rune + geo_miner: GEO-Górnik + lightning_rune: Błyskawiczna Runa + totem_of_undying: Totem Nieśmiertelności + charging_bench: Stół do Ładowania + nether_gold_pan: Piekielna Złota Patelnia + electric_press: Prasa Elektryczna + magnesium_generator: Moc z Magnezu + kelp_cookie: Ciastko z Wodorostów + makeshift_smeltery: Improwizowana huta + tree_growth_accelerator: Szybsze drzewa diff --git a/src/main/resources/languages/researches_pt-BR.yml b/src/main/resources/languages/researches_pt-BR.yml index 3d9018b80..1333f704b 100644 --- a/src/main/resources/languages/researches_pt-BR.yml +++ b/src/main/resources/languages/researches_pt-BR.yml @@ -124,11 +124,14 @@ slimefun: block_placer: Colocador de Blocos scroll_of_dimensional_teleposition: Mudando as Coisas special_bows: Robin Hood + tome_of_knowledge_sharing: Compartilhando com amigos flask_of_knowledge: Armazenamento de XP hardened_glass: Suportar Explosões golden_apple_juice: Poção Dourada cooler: Bebidas Portáteis + ancient_altar: Altar Ancião wither_proof_obsidian: Obsidiana à Prova de Wither + ancient_runes: Runas Elementais special_runes: Runas Roxas infernal_bonemeal: Farinha de Osso Infernal rainbow_blocks: Blocos Coloridos @@ -166,12 +169,14 @@ slimefun: energized_gps_transmitter: Transmissor de Nível Superior energy_regulator: Redes de Energia 101 butcher_androids: Androids Açougueiro + organic_food: Comida Orgânica auto_breeder: Alimentação Automatizada advanced_android: Androids Avançados advanced_butcher_android: Androids Avançados - Açougueiro advanced_fisherman_android: Androids Avançados - Pescador animal_growth_accelerator: Manipulação do Crescimento Animal xp_collector: Coletor de XP + organic_fertilizer: Fertilizante Orgânico crop_growth_accelerator: Acelerador de Crescimento de Sementes better_crop_growth_accelerator: Acelerador de Crescimento de Sementes Atualizado reactor_essentials: Fundamentos do Reator @@ -181,6 +186,7 @@ slimefun: cargo_nodes: Configuração de Carga electric_ingot_machines: Fabricação de Barras Elétricas high_tier_electric_ingot_machines: Fabricação de Barras Super Rápida + automated_crafting_chamber: Criação Automatizada better_food_fabricator: Fabricação de Alimentos Atualizada reactor_access_port: Interação do Reator fluid_pump: Bomba de Fluido @@ -224,9 +230,9 @@ slimefun: electric_press: Prensa Elétrica magnesium_generator: Gerador de Magnésio kelp_cookie: Alga Marinha Saborosa - tome_of_knowledge_sharing: Compartilhando com amigos - ancient_altar: Altar Ancião - ancient_runes: Runas Elementais - organic_food: Comida Orgânica - organic_fertilizer: Fertilizante Orgânico - automated_crafting_chamber: Criação Automatizada + makeshift_smeltery: Fundição Improvisada + tree_growth_accelerator: Árvores mais rápidas + industrial_miner: Mineração Industrial + advanced_industrial_miner: Melhor mineração + magical_zombie_pills: Deszombificação + auto_brewer: Cervejaria Industrial diff --git a/src/main/resources/languages/researches_ru.yml b/src/main/resources/languages/researches_ru.yml index 83ccb2228..c73215fa2 100644 --- a/src/main/resources/languages/researches_ru.yml +++ b/src/main/resources/languages/researches_ru.yml @@ -1,236 +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: Модернизированный ускоритель роста растений - better_electric_crucibles: Горячие тигли - better_electric_furnace: Модернизированная электрическая печь - better_food_fabricator: Улучшенная пищевая фабрика - better_freezer: Улучшенная морозилка - better_gps_transmitters: Модернизированные передатчики - 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: Скотч - 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: Кирка искателя + 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: Скотч + 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: Модернизированные передатчики elevator: Лифтовая плита - elytra: Элитры + energized_solar_generator: Солнечная энергия круглые сутки! + energized_gps_transmitter: Высокоуровневый передатчик + 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: Модернизированный ускоритель роста растений + 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: Высокоуровневый передатчик - 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: Геокопатель - geo_scanner: Гоесканирование - 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: "«Огненная ситуация»" - 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: Магнитные металлы - makeshift_smeltery: Импровизированная плавильня - 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: Органическая пища - output_chest: Выходной сундук - parachute: Парашют - pickaxe_of_containment: Кирка сдерживания - pickaxe_of_the_seeker: Кирка искателя - pickaxe_of_vein_mining: Кирка жильного копания - plastic_sheet: Пластик - portable_crafter: Портативный крафтер - portable_dustbin: Портативный мусорный ящик - pressure_chamber: Барокамера - programmable_androids: Программируемые Андроиды - 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: Стальной ускоритель - storm_staff: Штормовой посох - sword_of_beheading: Меч обезглавливания - synthetic_diamond: Синтезированный алмаз - synthetic_emerald: Фальшивый изумруд - synthetic_sapphire: Синтетические сапфиры - table_saw: Лесопилка - teleporter: Базовые компоненты телепортера - teleporter_activation_plates: Активация телепортера - tome_of_knowledge_sharing: Поделиться с ближними - totem_of_undying: Тотем бессмертия - trash_can: Мусорка - traveller_talisman: Талисман путешественника - tree_growth_accelerator: Быстрорастущие деревья - 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: Собиратель опыта + better_heated_pressure_chamber: Модернизированная обогреваемая барокамера + elytra: Элитры + special_elytras: Особые элитры + electric_crucible: Электрический тигель + better_electric_crucibles: Горячие тигли + advanced_electric_smeltery: Модернизированная электрическая плавильня + advanced_farmer_android: Продвинутый Андроид-фермер + lava_generator: Лавовый генератор + nether_ice: Незерский хладагент + nether_star_reactor: Звёздный незерский реактор + blistering_ingots: Раскалённые слитки + automatic_ignition_chamber: Автоматизированная камера зажигания + output_chest: Выходной сундук + copper_wire: Медный провод + radiant_backpack: Рюкзак путешественника + auto_drier: "«День сушки»" + diet_cookie: Диетическое печенье + storm_staff: Штормовой посох + soulbound_rune: Персональная руна + geo_miner: Геокопатель + lightning_rune: Молниевая руна + totem_of_undying: Тотем бессмертия + 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: Промышленная пивоварня diff --git a/src/main/resources/languages/researches_tl.yml b/src/main/resources/languages/researches_tl.yml index b69dd74a9..b03a65186 100644 --- a/src/main/resources/languages/researches_tl.yml +++ b/src/main/resources/languages/researches_tl.yml @@ -14,16 +14,16 @@ slimefun: magic_sugar: Magic Sugar monster_jerky: Monster Jerky slime_armor: Slime Armor - sword_of_beheading: Sword of Beheading + sword_of_beheading: Espada sa Pagpugot ng Ulo basic_circuit_board: Basic Circuit Board advanced_circuit_board: Advanced Circuit Board smeltery: Smeltery steel: Steel Age - misc_power_items: Mahalagang Mga item na nauugnay sa kapangyarihan + misc_power_items: Mga mahahalagang item na nauugnay sa kapangyarihan battery: Ang iyong unang Baterya steel_plate: Steel Plating steel_thruster: Steel Thruster - parachute: Parachute + parachute: Parasyut grappling_hook: Grappling Hook jetpacks: Jetpacks multitools: Multi Tools @@ -31,11 +31,11 @@ slimefun: elemental_staff: Elemental Staves grind_stone: Grind Stone cactus_armor: Cactus Suit - gold_pan: Gold Pan + gold_pan: Gintong Kawali magical_book_cover: Magical Book Binding - slimefun_metals: New Metals - ore_crusher: Ore Doubling - bronze: Bronze Creation + slimefun_metals: Bagong Metal + ore_crusher: Pag-dodoble ng Ore + bronze: Paglikha ng Tanso alloys: Advanced Alloys compressor_and_carbon: Carbon Creation gilded_iron_armor: Gilded Iron Armor @@ -45,12 +45,12 @@ slimefun: damascus_steel: Damascus Steel damascus_steel_armor: Damascus Steel Armor reinforced_alloy: Reinforced Alloy - carbonado: Black Diamonds + carbonado: Maitim na Brilyante magic_workbench: Magic Workbench wind_staff: Wind Staff reinforced_armor: Reinforced Armor - ore_washer: Ore Washer - gold_carats: Pure Gold + ore_washer: Panghugas ng Ore + gold_carats: Tunay na Ginto silicon: Silicon Valley fire_staff: Fire Staff smelters_pickaxe: Smelters Pickaxe @@ -67,44 +67,44 @@ slimefun: traveller_talisman: Ang Anting-anting ng Manlalakbay warrior_talisman: Ang Anting-anting ng Mandirigma knight_talisman: Ang Anting-anting ng Knight - gilded_iron: Shiny Iron - synthetic_emerald: Fake Gem + gilded_iron: Makintab na Bakal + synthetic_emerald: Pekeng Hiyas chainmail_armor: Chainmail Armor whirlwind_talisman: Ang Anting-anting ng Whirlwind wizard_talisman: Ang Anting-anting ng Wizard lumber_axe: Lumber Axe hazmat_suit: Hazmat Suit - uranium: Radioactive + uranium: Radyaktibo crushed_ore: Ore Purification redstone_alloy: Redstone Alloy carbonado_tools: Top Tier Machines - first_aid: First Aid - gold_armor: Shiny Armor + first_aid: Pangunahing Lunas + gold_armor: Makintab na Armor night_vision_googles: Night Vision Goggles - pickaxe_of_containment: Pickaxe of Containment + pickaxe_of_containment: Piko ng Lalagyanan hercules_pickaxe: Hercules Pickaxe - table_saw: Table Saw + table_saw: Lagari slime_steel_armor: Slimy Steel Armor blade_of_vampires: Blade of Vampires water_staff: Water Staff - 24k_gold_block: Golden City - composter: Composting Dirt - farmer_shoes: Farmer Shoes - explosive_tools: Explosive Tools - automated_panning_machine: Automated Gold Pan - boots_of_the_stomper: Boots of the Stomper - pickaxe_of_the_seeker: Pickaxe of the Seeker + 24k_gold_block: Ginintuang Lungsod + composter: Pinagsama-samang Putik + farmer_shoes: Sapatos ng Magsasaka + explosive_tools: Mga Tool na Paputok + automated_panning_machine: Awtomatikong Gintong Kawali + boots_of_the_stomper: Mga Boots ng Stomper + pickaxe_of_the_seeker: Piko ng Naghahanap backpacks: Mga Backpacks - woven_backpack: Woven Backpack - crucible: Crucible - gilded_backpack: Gilded Backpack - armored_jetpack: Armored Jetpack + woven_backpack: Habi na Backpack + crucible: Marurok + gilded_backpack: Ginintuan na Backpack + armored_jetpack: Nakabaluting Jetpack ender_talismans: Ender Talismans - nickel_and_cobalt: Even more Ores + nickel_and_cobalt: Mas maraming Ores magnet: Magnetic Metals infused_magnet: Infused Magnets cobalt_pickaxe: Speedy Pickaxe - essence_of_afterlife: Necromancy + essence_of_afterlife: Nigromansiya bound_backpack: Soulbound Storage jetboots: Jet Boots armored_jetboots: Armoured Jet Boots @@ -113,18 +113,18 @@ slimefun: bound_weapons: Soulbound Weapons bound_tools: Soulbound Tools bound_armor: Soulbound Armor - juicer: Delicious Drinks + juicer: Masarap na Inumin repaired_spawner: Repairing Spawners enhanced_furnace: Enhanced Furnace more_enhanced_furnaces: Better Furnaces high_tier_enhanced_furnaces: High Tier Furnace reinforced_furnace: Reinforced Furnace - carbonado_furnace: Carbonado Edged furnace + carbonado_furnace: Carbonado Edged Furnace electric_motor: Heating up block_placer: Block Placer - scroll_of_dimensional_teleposition: Turning things around + scroll_of_dimensional_teleposition: Pagliko ng mga bagay special_bows: Robin Hood - tome_of_knowledge_sharing: Sharing with friends + tome_of_knowledge_sharing: Pagbabahagi sa mga kaibigan flask_of_knowledge: XP Storage hardened_glass: Withstanding Explosions golden_apple_juice: Golden Potion @@ -140,8 +140,8 @@ slimefun: duct_tape: Duct Tape plastic_sheet: Plastik android_memory_core: Memory Core - oil: Oil - fuel: Fuel + oil: Langis + fuel: Panggatong hologram_projector: Holograms capacitors: Tier 1 Capacitors high_tier_capacitors: Tier 2 Capacitors @@ -192,7 +192,7 @@ slimefun: fluid_pump: Fluid Pump better_freezer: Upgraded Freezer boosted_uranium: Never-Ending Circle - trash_can: Basura + trash_can: Basurahan advanced_output_node: Advanced Output Node carbon_press: Carbon Press electric_smeltery: Electric Smeltery @@ -205,7 +205,7 @@ slimefun: wither_assembler: Automated Wither Killer better_heated_pressure_chamber: Upgraded Heated Pressure Chamber elytra: Elytras - special_elytras: Espesyal na Elytras + special_elytras: Special Elytras electric_crucible: Electrified Crucible better_electric_crucibles: Hot Crucibles advanced_electric_smeltery: Advanced Electric Smeltery @@ -224,13 +224,15 @@ slimefun: soulbound_rune: Soulbound Rune geo_miner: GEO-Miner lightning_rune: Lightning Rune - totem_of_undying: Totem ng Undying + totem_of_undying: Totem ng Walang Kamatayan charging_bench: Charging Bench nether_gold_pan: Nether Gold Pan electric_press: Electric Press - magnesium_generator: Kapangyarihan mula sa Magnesium + magnesium_generator: Power of Magnesium kelp_cookie: Tasty Kelp makeshift_smeltery: Improvised Smeltery tree_growth_accelerator: Faster Trees industrial_miner: Industrial Mining advanced_industrial_miner: Better Mining + magical_zombie_pills: De-Zombification + auto_brewer: Industrial Brewery diff --git a/src/main/resources/languages/researches_tr.yml b/src/main/resources/languages/researches_tr.yml index 959c6075d..1c9a52170 100644 --- a/src/main/resources/languages/researches_tr.yml +++ b/src/main/resources/languages/researches_tr.yml @@ -1,236 +1,238 @@ --- slimefun: - 24k_gold_block: Altın Şehir - advanced_android: Gelişmiş Androidler - advanced_butcher_android: Gelişmiş Androidler - Kasap - advanced_circuit_board: Gelişmiş Devre Kartı - advanced_electric_smeltery: Gelişmiş Elektrikli Dökümhane - advanced_farmer_android: Gelişmiş Androidler - Çiftçi - advanced_fisherman_android: Gelişmiş Androidler - Balıkçı - advanced_output_node: Gelişmiş Çıkış Noktası - alloys: Gelişmiş Alaşımlar - ancient_altar: Antik Sunak - ancient_runes: Elementsel Rünler - android_interfaces: Android Arayüzleri - android_memory_core: Bellek Çekirdeği - angel_talisman: Melek Tılsımı - animal_growth_accelerator: Hayvan Büyüme Manipülasyonu - anvil_talisman: Örs Tılsımı - armored_jetboots: Zırhlı Jet Botlar - armored_jetpack: Zırhlı Jetpack + walking_sticks: Bastonlar + portable_crafter: Portatif Üretim Masası + fortune_cookie: Şans Kurabiyesi + portable_dustbin: Portatif Çöp Kovası + meat_jerky: Yağsız Et armor_forge: Zırh Üretimi - auto_anvil: Otomatik Örs - auto_breeder: Otomatik Besleme - auto_drier: Kuru Bir Gün - auto_enchanting: Otomatik Büyüleyici ve Büyü Sökücü - automated_crafting_chamber: Otomatik Üretim - automated_panning_machine: Otomatik Altın Tavası - automatic_ignition_chamber: Otomatik Ateşleme Odası - backpacks: Sırt Çantaları + glowstone_armor: Işık Taşı Zırhı + lumps: Yumrular ve Büyü + ender_backpack: Ender Sırt Çantası + ender_armor: Ender Zırhı + magic_eye_of_ender: Sihirli Ender Gözü + magic_sugar: Sihirli Şeker + monster_jerky: Yağsız Yaratık Eti + slime_armor: Balçık Zırhı + sword_of_beheading: Baş Kesme Kılıcı basic_circuit_board: Temel Devre Kartı + advanced_circuit_board: Gelişmiş Devre Kartı + smeltery: Dökümhane + steel: Çelik Çağı + misc_power_items: Güçle ilgili önemli eşyalar battery: İlk Piliniz - better_carbon_press: Gelişmiş Karbon Presi - better_crop_growth_accelerator: Gelişmiş Bitki Büyümesi Hızlandırıcı - better_electric_crucibles: Sıcak Potalar - better_electric_furnace: Gelişmiş Elektrikli Fırın - better_food_fabricator: Gelişmiş Yemek Üretimi - better_freezer: Gelişmiş Dondurucu - better_gps_transmitters: Gelişmiş Vericiler - better_heated_pressure_chamber: Gelişmiş Isıtmalı Basınç Odası - better_solar_generators: Gelişmiş Güneş Enerjisi Jeneratörleri - bio_reactor: Biyo-Reaktör - blade_of_vampires: Vampirlerin Bıçağı - blistering_ingots: Parlayan Radyoaktivite - block_placer: Blok Yerleştirici - boosted_uranium: Sonsuz Döngü - boots_of_the_stomper: Ağır Ayak Çizmeleri - bound_armor: Ruh Bağlı Zırhlar - bound_backpack: Ruh Bağlı Depolama - bound_tools: Ruh Bağlı Aletler - bound_weapons: Ruh Bağlı Silahlar - bronze: Bronz Üretimi - butcher_androids: Kasap Androidleri + steel_plate: Çelik Kaplama + steel_thruster: Çelik İtici + parachute: Paraşüt + grappling_hook: Kanca + jetpacks: Jetpackler + multitools: Çoklu Aletler + solar_panel_and_helmet: Güneş Enerjisi + elemental_staff: Elementsel Asalar + grind_stone: Taş Öğütücü cactus_armor: Kaktüs Takımı - capacitors: Seviye 1 Kapasitörler - carbonado: Siyah Elmaslar - carbonado_furnace: Kara Elmas Kaplamalı Fırın - carbonado_tools: Üst Seviye Makineler - carbon_press: Karbon Presi - cargo_basics: Kargo Temelleri - cargo_nodes: Kargo Kurulumu - chainmail_armor: Zincir Zırh - charging_bench: Şarj Tezgahı - coal_generator: Kömür Jeneratörü - cobalt_pickaxe: Hızlı Kazma - combustion_reactor: İçten Yanmalı Reaktör - common_talisman: Sıradan Tılsım - composter: Toprak Gübreleme + gold_pan: Altın Tavası + magical_book_cover: Sihirli Kitap Eşleme + slimefun_metals: Yeni Metaller + ore_crusher: Maden Katlama + bronze: Bronz Üretimi + alloys: Gelişmiş Alaşımlar compressor_and_carbon: Karbon Üretimi - cooler: Portatif İçecekler - copper_wire: İnceltilmiş İletkenlik - crop_growth_accelerator: Bitki Büyümesi Hızlandırması - crucible: Pota - crushed_ore: Maden Arıtma + gilded_iron_armor: Yaldızlı Demir Zırhı + synthetic_diamond: Sentetik Elmaslar + pressure_chamber: Basınç Odası + synthetic_sapphire: Sentetik Safirler damascus_steel: Şam Çeliği damascus_steel_armor: Şam Çeliği Zırhı - diet_cookie: Diyet Kurabiyesi - duct_tape: Koli Bandı - electric_crucible: Elektrikli Pota - electric_furnaces: Elektrikli Fırın - electric_ingot_machines: Elektrikli Külçe İmalatı + reinforced_alloy: Güçlendirilmiş Alaşım + carbonado: Siyah Elmaslar + magic_workbench: Sihirli Üretim Masası + wind_staff: Rüzgar Asası + reinforced_armor: Güçlendirilmiş Zırh + ore_washer: Maden Yıkayıcı + gold_carats: Saf Altın + silicon: Silikon Vadisi + fire_staff: Ateş Asası + smelters_pickaxe: Demircinin Kazması + common_talisman: Sıradan Tılsım + anvil_talisman: Örs Tılsımı + miner_talisman: Madenci Tılsımı + hunter_talisman: Avcı Tılsımı + lava_talisman: Lavda Yürüyen Tılsımı + water_talisman: Suda Nefes Alan Tılsımı + angel_talisman: Melek Tılsımı + fire_talisman: İtfaiyeci Tılsımı + lava_crystal: Ateşli Durum + magician_talisman: Sihirbaz Tılsımı + traveller_talisman: Gezgin Tılsımı + warrior_talisman: Savaşçı Tılsımı + knight_talisman: Şövalye Tılsımı + gilded_iron: Parlak Demir + synthetic_emerald: Sahte Mücevher + chainmail_armor: Zincir Zırh + whirlwind_talisman: Kasırga Tılsımı + wizard_talisman: Büyücü Tılsımı + lumber_axe: Kereste Baltası + hazmat_suit: Koruyucu Takım + uranium: Radyoaktif + crushed_ore: Maden Arıtma + redstone_alloy: Kızıltaş Alaşımı + carbonado_tools: Üst Seviye Makineler + first_aid: İlk yardım + gold_armor: Parlak Zırh + night_vision_googles: Gece Görüş Gözlüğü + pickaxe_of_containment: Kapsama Kazması + hercules_pickaxe: Herkülün Kazması + table_saw: Masa Testeresi + slime_steel_armor: Çelik Balçık Zırhı + blade_of_vampires: Vampirlerin Bıçağı + water_staff: Su Asası + 24k_gold_block: Altın Şehir + composter: Toprak Gübreleme + farmer_shoes: Çiftçi Ayakkabıları + explosive_tools: Patlayıcı Aletler + automated_panning_machine: Otomatik Altın Tavası + boots_of_the_stomper: Ağır Ayak Çizmeleri + pickaxe_of_the_seeker: Arayıcının Kazması + backpacks: Sırt Çantaları + woven_backpack: Dokuma Sırt Çantası + crucible: Pota + gilded_backpack: Yaldızlı Sırt Çantası + armored_jetpack: Zırhlı Jetpack + ender_talismans: Ender Tılsımları + nickel_and_cobalt: Daha fazla Maden + magnet: Manyetik Metaller + infused_magnet: Büyülü Mıknatıslar + cobalt_pickaxe: Hızlı Kazma + essence_of_afterlife: Nekromansi + bound_backpack: Ruh Bağlı Depolama + jetboots: Jet Botlar + armored_jetboots: Zırhlı Jet Botlar + seismic_axe: Sismik Balta + pickaxe_of_vein_mining: Damar Madenciliği Kazması + bound_weapons: Ruh Bağlı Silahlar + bound_tools: Ruh Bağlı Aletler + bound_armor: Ruh Bağlı Zırhlar + juicer: Lezzetli İçecekler + repaired_spawner: Çağırıcı Tamiratı + enhanced_furnace: Geliştirilmiş Fırın + more_enhanced_furnaces: Daha İyi Fırınlar + high_tier_enhanced_furnaces: Yüksek Seviye Fırın + reinforced_furnace: Güçlendirilmiş Fırın + carbonado_furnace: Kara Elmas Kaplamalı Fırın electric_motor: Kızışıyor + block_placer: Blok Yerleştirici + scroll_of_dimensional_teleposition: Bir şeyleri etrafında çevirmek + special_bows: Robin Hood + tome_of_knowledge_sharing: Arkadaşlarla paylaşma + flask_of_knowledge: XP Depolama + hardened_glass: Patlamalara Dayanıklı + golden_apple_juice: Altın iksir + cooler: Portatif İçecekler + ancient_altar: Antik Sunak + wither_proof_obsidian: Wither-Geçirmez Obsidyen + ancient_runes: Elementsel Rünler + special_runes: Mor Rünler + infernal_bonemeal: Şeytani Kemik Tozu + rainbow_blocks: Gökkuşağı Blokları + infused_hopper: Büyülü Huni + wither_proof_glass: Wither-Geçirmez Cam + duct_tape: Koli Bandı + plastic_sheet: Plastik + android_memory_core: Bellek Çekirdeği + oil: Petrol + fuel: Yakıt + hologram_projector: Hologramlar + capacitors: Seviye 1 Kapasitörler + high_tier_capacitors: Seviye 2 Kapasitörler + solar_generators: Güneş Enerjisi Elektrik Santrali + electric_furnaces: Elektrikli Fırın electric_ore_grinding: Kırma ve Öğütme - electric_press: Elektrikli Pres - electric_smeltery: Elektrikli Dökümhane - elemental_staff: Elementsel Asalar + heated_pressure_chamber: Isıtmalı Basınç Odası + coal_generator: Kömür Jeneratörü + bio_reactor: Biyo-Reaktör + auto_enchanting: Otomatik Büyüleyici ve Büyü Sökücü + auto_anvil: Otomatik Örs + multimeter: Elektrik Ölçümü + gps_setup: Temel GPS Kurulumu + gps_emergency_transmitter: GPS Acil Durum Noktası + programmable_androids: Programlanabilir Androidler + android_interfaces: Android Arayüzleri + geo_scanner: GEO-Taramalar + combustion_reactor: İçten Yanmalı Reaktör + teleporter: Işınlayıcı Temel Bileşenleri + teleporter_activation_plates: Işınlayıcı Etkinleştirmesi + better_solar_generators: Gelişmiş Güneş Enerjisi Jeneratörleri + better_gps_transmitters: Gelişmiş Vericiler elevator: Asansörler - elytra: Elytralar + energized_solar_generator: Tam Zamanlı Güneş Enerjisi + energized_gps_transmitter: Üst Seviye Verici + energy_regulator: Enerji Ağları 101 + butcher_androids: Kasap Androidleri + organic_food: Organik Yemek + auto_breeder: Otomatik Besleme + advanced_android: Gelişmiş Androidler + advanced_butcher_android: Gelişmiş Androidler - Kasap + advanced_fisherman_android: Gelişmiş Androidler - Balıkçı + animal_growth_accelerator: Hayvan Büyüme Manipülasyonu + xp_collector: XP Toplayıcı + organic_fertilizer: Organik Gübreleme + crop_growth_accelerator: Bitki Büyümesi Hızlandırması + better_crop_growth_accelerator: Gelişmiş Bitki Büyümesi Hızlandırıcı + reactor_essentials: Reaktör Temelleri + nuclear_reactor: Nükleer Enerji Santrali + freezer: Bay Donmuş + cargo_basics: Kargo Temelleri + cargo_nodes: Kargo Kurulumu + electric_ingot_machines: Elektrikli Külçe İmalatı + high_tier_electric_ingot_machines: Süper Hızlı Külçe İmalatı + automated_crafting_chamber: Otomatik Üretim + better_food_fabricator: Gelişmiş Yemek Üretimi + reactor_access_port: Reaktör Etkileşimi + fluid_pump: Sıvı Pompası + better_freezer: Gelişmiş Dondurucu + boosted_uranium: Sonsuz Döngü + trash_can: Çöp + advanced_output_node: Gelişmiş Çıkış Noktası + carbon_press: Karbon Presi + electric_smeltery: Elektrikli Dökümhane + better_electric_furnace: Gelişmiş Elektrikli Fırın + better_carbon_press: Gelişmiş Karbon Presi empowered_android: Güçlendirilmiş Androidler empowered_butcher_android: Güçlendirilmiş Androidler - Kasap empowered_fisherman_android: Güçlendirilmiş Androidler - Balıkçı - ender_armor: Ender Zırhı - ender_backpack: Ender Sırt Çantası - ender_talismans: Ender Tılsımları - energized_gps_transmitter: Üst Seviye Verici - energized_solar_generator: Tam Zamanlı Güneş Enerjisi - energy_regulator: Enerji Ağları 101 - enhanced_furnace: Geliştirilmiş Fırın - essence_of_afterlife: Nekromansi - explosive_tools: Patlayıcı Aletler - farmer_shoes: Çiftçi Ayakkabıları - fire_staff: Ateş Asası - fire_talisman: İtfaiyeci Tılsımı - first_aid: İlk yardım - flask_of_knowledge: XP Depolama - fluid_pump: Sıvı Pompası - fortune_cookie: Şans Kurabiyesi - freezer: Bay Donmuş - fuel: Yakıt - geo_miner: GEO-Madenci - geo_scanner: GEO-Taramalar - gilded_backpack: Yaldızlı Sırt Çantası - gilded_iron: Parlak Demir - gilded_iron_armor: Yaldızlı Demir Zırhı - glowstone_armor: Işık Taşı Zırhı - gold_armor: Parlak Zırh - gold_carats: Saf Altın - golden_apple_juice: Altın iksir - gold_pan: Altın Tavası - gps_emergency_transmitter: GPS Acil Durum Noktası - gps_setup: Temel GPS Kurulumu - grappling_hook: Kanca - grind_stone: Taş Öğütücü - hardened_glass: Patlamalara Dayanıklı - hazmat_suit: Koruyucu Takım - heated_pressure_chamber: Isıtmalı Basınç Odası - hercules_pickaxe: Herkülün Kazması - high_tier_capacitors: Seviye 2 Kapasitörler high_tier_carbon_press: Güçlü Karbon Presi - high_tier_electric_ingot_machines: Süper Hızlı Külçe İmalatı - high_tier_enhanced_furnaces: Yüksek Seviye Fırın - hologram_projector: Hologramlar - hunter_talisman: Avcı Tılsımı - infernal_bonemeal: Şeytani Kemik Tozu - infused_hopper: Büyülü Huni - infused_magnet: Büyülü Mıknatıslar - jetboots: Jet Botlar - jetpacks: Jetpackler - juicer: Lezzetli İçecekler - kelp_cookie: Lezzetli Yosun - knight_talisman: Şövalye Tılsımı - lava_crystal: Ateşli Durum + wither_assembler: Otomatik Wither Öldürücü + better_heated_pressure_chamber: Gelişmiş Isıtmalı Basınç Odası + elytra: Elytralar + special_elytras: Özel Elytralar + electric_crucible: Elektrikli Pota + better_electric_crucibles: Sıcak Potalar + advanced_electric_smeltery: Gelişmiş Elektrikli Dökümhane + advanced_farmer_android: Gelişmiş Androidler - Çiftçi lava_generator: Lav Jeneratörü - lava_talisman: Lavda Yürüyen Tılsımı - lightning_rune: Yıldırım Rünü - lumber_axe: Kereste Baltası - lumps: Yumrular ve Büyü - magical_book_cover: Sihirli Kitap Eşleme - magic_eye_of_ender: Sihirli Ender Gözü - magician_talisman: Sihirbaz Tılsımı - magic_sugar: Sihirli Şeker - magic_workbench: Sihirli Üretim Masası - magnesium_generator: Magnezyum Elektriği - magnet: Manyetik Metaller - makeshift_smeltery: Doğaçlama Dökümhane - meat_jerky: Yağsız Et - miner_talisman: Madenci Tılsımı - misc_power_items: Güçle ilgili önemli eşyalar - monster_jerky: Yağsız Yaratık Eti - more_enhanced_furnaces: Daha İyi Fırınlar - multimeter: Elektrik Ölçümü - multitools: Çoklu Aletler - nether_gold_pan: Nether Altın Tavası nether_ice: Nether Buzu Soğutucu nether_star_reactor: Nether Yıldız Reaktörü - nickel_and_cobalt: Daha fazla Maden - night_vision_googles: Gece Görüş Gözlüğü - nuclear_reactor: Nükleer Enerji Santrali - oil: Petrol - ore_crusher: Maden Katlama - ore_washer: Maden Yıkayıcı - organic_fertilizer: Organik Gübreleme - organic_food: Organik Yemek + blistering_ingots: Parlayan Radyoaktivite + automatic_ignition_chamber: Otomatik Ateşleme Odası output_chest: Temel Makine Çıkış Sandığı - parachute: Paraşüt - pickaxe_of_containment: Kapsama Kazması - pickaxe_of_the_seeker: Arayıcının Kazması - pickaxe_of_vein_mining: Damar Madenciliği Kazması - plastic_sheet: Plastik - portable_crafter: Portatif Üretim Masası - portable_dustbin: Portatif Çöp Kovası - pressure_chamber: Basınç Odası - programmable_androids: Programlanabilir Androidler + copper_wire: İnceltilmiş İletkenlik radiant_backpack: Göz Alıcı Sırt Çantası - rainbow_blocks: Gökkuşağı Blokları - reactor_access_port: Reaktör Etkileşimi - reactor_essentials: Reaktör Temelleri - redstone_alloy: Kızıltaş Alaşımı - reinforced_alloy: Güçlendirilmiş Alaşım - reinforced_armor: Güçlendirilmiş Zırh - reinforced_furnace: Güçlendirilmiş Fırın - repaired_spawner: Çağırıcı Tamiratı - scroll_of_dimensional_teleposition: Bir şeyleri etrafında çevirmek - seismic_axe: Sismik Balta - silicon: Silikon Vadisi - slime_armor: Balçık Zırhı - slimefun_metals: Yeni Metaller - slime_steel_armor: Çelik Balçık Zırhı - smelters_pickaxe: Demircinin Kazması - smeltery: Dökümhane - solar_generators: Güneş Enerjisi Elektrik Santrali - solar_panel_and_helmet: Güneş Enerjisi - soulbound_rune: Ruh Bağı Rünü - special_bows: Robin Hood - special_elytras: Özel Elytralar - special_runes: Mor Rünler - steel: Çelik Çağı - steel_plate: Çelik Kaplama - steel_thruster: Çelik İtici + auto_drier: Kuru Bir Gün + diet_cookie: Diyet Kurabiyesi storm_staff: Fırtına Asası - sword_of_beheading: Baş Kesme Kılıcı - synthetic_diamond: Sentetik Elmaslar - synthetic_emerald: Sahte Mücevher - synthetic_sapphire: Sentetik Safirler - table_saw: Masa Testeresi - teleporter: Işınlayıcı Temel Bileşenleri - teleporter_activation_plates: Işınlayıcı Etkinleştirmesi - tome_of_knowledge_sharing: Arkadaşlarla paylaşma + soulbound_rune: Ruh Bağı Rünü + geo_miner: GEO-Madenci + lightning_rune: Yıldırım Rünü totem_of_undying: Ölümsüzlük Totemi - trash_can: Çöp - traveller_talisman: Gezgin Tılsımı + charging_bench: Şarj Tezgahı + nether_gold_pan: Nether Altın Tavası + electric_press: Elektrikli Pres + magnesium_generator: Magnezyum Elektriği + kelp_cookie: Lezzetli Yosun + makeshift_smeltery: Doğaçlama Dökümhane tree_growth_accelerator: Daha Hızlı Ağaçlar - uranium: Radyoaktif - walking_sticks: Bastonlar - warrior_talisman: Savaşçı Tılsımı - water_staff: Su Asası - water_talisman: Suda Nefes Alan Tılsımı - whirlwind_talisman: Kasırga Tılsımı - wind_staff: Rüzgar Asası - wither_assembler: Otomatik Wither Öldürücü - wither_proof_glass: Wither-Geçirmez Cam - wither_proof_obsidian: Wither-Geçirmez Obsidyen - wizard_talisman: Büyücü Tılsımı - woven_backpack: Dokuma Sırt Çantası - xp_collector: XP Toplayıcı industrial_miner: Endüstriyel Madencilik advanced_industrial_miner: Gelişmiş Madencilik + magical_zombie_pills: A-Zombifikasyon + auto_brewer: Endüstriyel İksircilik diff --git a/src/main/resources/languages/researches_uk.yml b/src/main/resources/languages/researches_uk.yml index c74ca85b2..3335c3996 100644 --- a/src/main/resources/languages/researches_uk.yml +++ b/src/main/resources/languages/researches_uk.yml @@ -1,236 +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: Модернізований прискорювач росту рослин - better_electric_crucibles: Гарячі тиглі - better_electric_furnace: Модернізована електрична піч - better_food_fabricator: Покращена харчова фабрика - better_freezer: Покращена морозилка - better_gps_transmitters: Модернізовані передавачі - 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: Скотч - 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: Кайло шукача + 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: Скотч + 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: Модернізовані передавачі elevator: Ліфтові плити - elytra: Елітри + energized_solar_generator: Сонячна енергія цілодобово! + energized_gps_transmitter: Високорівневий передавач + 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: Модернізований прискорювач росту рослин + 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: Високорівневий передавач - 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: Геокопач - geo_scanner: Геосканування - 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: Магнітні метали - makeshift_smeltery: Імпровізована плавильня - 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: Кайло шукача - 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: Талісман мандрівника + charging_bench: Зарядний пристрій-верстак + nether_gold_pan: Пекельний рудопромивочний лоток + electric_press: Електричний прес + magnesium_generator: Магнієва підпитка + kelp_cookie: Смачна водорість + makeshift_smeltery: Імпровізована плавильня tree_growth_accelerator: Швидкорослі дерева - 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: Збирач досвіду industrial_miner: Промисловий видобуток advanced_industrial_miner: Покращений видобуток + magical_zombie_pills: Дезомбіфікація + auto_brewer: Промислова пивоварня diff --git a/src/main/resources/languages/researches_zh-CN.yml b/src/main/resources/languages/researches_zh-CN.yml index 0bfb3c1dc..51d5fa9b5 100644 --- a/src/main/resources/languages/researches_zh-CN.yml +++ b/src/main/resources/languages/researches_zh-CN.yml @@ -1,236 +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: 更好的作物生长加速器 - 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: 胶带 - 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: 寻矿稿 + 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: 胶带 + 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: GEO 地形扫描 + combustion_reactor: 燃烧反应机 + teleporter: 传送机基础组件 + teleporter_activation_plates: 传送激活装置 + better_solar_generators: 更好的太阳能发电机 + better_gps_transmitters: 更好的 GPS 信号发射机 elevator: 电梯 - elytra: 鞘翅 + energized_solar_generator: 全天候太阳能 + energized_gps_transmitter: 顶级 GPS 信号发射机 + energy_regulator: 能源网络 101 + 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: 更好的作物生长加速器 + 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: 能源网络 101 - 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: GEO 矿机 - geo_scanner: GEO 地形扫描 - 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: 磁性金属 - makeshift_smeltery: 临时冶炼炉 - 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: 寻矿稿 - 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: GEO 矿机 + lightning_rune: 雷电符文 totem_of_undying: 不死图腾 - trash_can: 垃圾桶 - traveller_talisman: 旅行者护身符 + charging_bench: 充电座 + nether_gold_pan: 下界淘金盘 + electric_press: 碳压机 + magnesium_generator: 来自镁的能量 + kelp_cookie: 美味的海藻 + makeshift_smeltery: 临时冶炼炉 tree_growth_accelerator: 树木生长加速器 - 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: 经验收集器 industrial_miner: 工业采矿 advanced_industrial_miner: 进阶采矿 + magical_zombie_pills: 去僵尸化 + auto_brewer: 自动化酿造 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: 工業化釀造 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..a89cc513e 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; @@ -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); } } 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..a17fb3756 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,10 +7,10 @@ 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.core.handlers.ItemConsumptionHandler; +import io.github.thebusybiscuit.slimefun4.core.handlers.ItemUseHandler; +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; @FunctionalInterface public interface SlimefunItemTest { 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 fdc5c0758..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 { @@ -40,13 +40,13 @@ public class TestResourceRegistration { @Test @Order(value = 1) public void testDefaultResources() { - Assertions.assertDoesNotThrow(() -> GEOResourcesSetup.setup()); + Assertions.assertDoesNotThrow(GEOResourcesSetup::setup); } @Test @Order(value = 2) public void testDoubleRegistration() { - Assertions.assertThrows(IllegalArgumentException.class, () -> GEOResourcesSetup.setup()); + Assertions.assertThrows(IllegalArgumentException.class, GEOResourcesSetup::setup); } private GEOResource testResource(NamespacedKey key, String name, ItemStack item, boolean miner, int deviation) { @@ -66,7 +66,7 @@ public class TestResourceRegistration { NamespacedKey key = new NamespacedKey(plugin, "oil"); GEOResource resource = testResource(key, "Oil", SlimefunItems.OIL_BUCKET, false, 8); - Assertions.assertEquals(0, resource.getDefaultSupply(Environment.NETHER, Biome.NETHER)); + Assertions.assertEquals(0, resource.getDefaultSupply(Environment.NETHER, Biome.NETHER_WASTES)); Assertions.assertNotEquals(0, resource.getDefaultSupply(Environment.NORMAL, Biome.BEACH)); Assertions.assertTrue(resource.getDefaultSupply(Environment.NORMAL, Biome.DESERT) > 10); @@ -83,7 +83,7 @@ public class TestResourceRegistration { NamespacedKey key = new NamespacedKey(plugin, "nether_ice"); GEOResource resource = testResource(key, "Nether Ice", SlimefunItems.NETHER_ICE, true, 6); - Assertions.assertNotEquals(0, resource.getDefaultSupply(Environment.NETHER, Biome.NETHER)); + Assertions.assertNotEquals(0, resource.getDefaultSupply(Environment.NETHER, Biome.NETHER_WASTES)); Assertions.assertEquals(0, resource.getDefaultSupply(Environment.NORMAL, Biome.DESERT)); } @@ -93,7 +93,7 @@ public class TestResourceRegistration { GEOResource resource = testResource(key, "Small Chunks of Uranium", SlimefunItems.SMALL_URANIUM, true, 2); Assertions.assertNotEquals(0, resource.getDefaultSupply(Environment.NORMAL, Biome.MOUNTAINS)); - Assertions.assertEquals(0, resource.getDefaultSupply(Environment.NETHER, Biome.NETHER)); + Assertions.assertEquals(0, resource.getDefaultSupply(Environment.NETHER, Biome.NETHER_WASTES)); Assertions.assertEquals(0, resource.getDefaultSupply(Environment.THE_END, Biome.THE_END)); } @@ -102,7 +102,7 @@ public class TestResourceRegistration { NamespacedKey key = new NamespacedKey(plugin, "salt"); GEOResource resource = testResource(key, "Salt", SlimefunItems.SALT, true, 18); - Assertions.assertEquals(0, resource.getDefaultSupply(Environment.NETHER, Biome.NETHER)); + Assertions.assertEquals(0, resource.getDefaultSupply(Environment.NETHER, Biome.NETHER_WASTES)); Assertions.assertEquals(0, resource.getDefaultSupply(Environment.THE_END, Biome.THE_END)); Assertions.assertNotEquals(0, resource.getDefaultSupply(Environment.NORMAL, Biome.MOUNTAINS)); 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 46e1e99ed..bd4bf5d7e 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.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; +import me.mrCookieSlime.Slimefun.api.SlimefunItemStack; public class TestCategories { @@ -46,7 +49,7 @@ public class TestCategories { Category category = new Category(new NamespacedKey(plugin, "getter_test"), new CustomItem(Material.DIAMOND_AXE, "&6Testing")); Assertions.assertEquals(3, category.getTier()); - Assertions.assertEquals(new NamespacedKey(SlimefunPlugin.instance, "getter_test"), category.getKey()); + Assertions.assertEquals(new NamespacedKey(SlimefunPlugin.instance(), "getter_test"), category.getKey()); Assertions.assertEquals("Testing", category.getUnlocalizedName()); Assertions.assertEquals(0, category.getItems().size()); } @@ -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 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..e28d9cb7b 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,13 +14,13 @@ 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.core.handlers.BowShootHandler; +import io.github.thebusybiscuit.slimefun4.core.handlers.ItemUseHandler; +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; -import me.mrCookieSlime.Slimefun.Objects.handlers.ItemUseHandler; public class TestItemHandlers { 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 new file mode 100644 index 000000000..f4fde025c --- /dev/null +++ b/src/test/java/io/github/thebusybiscuit/slimefun4/testing/tests/items/TestRechargeableItems.java @@ -0,0 +1,143 @@ +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.implementation.SlimefunPlugin; +import io.github.thebusybiscuit.slimefun4.testing.TestUtilities; +import io.github.thebusybiscuit.slimefun4.utils.LoreBuilder; +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("&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)); + + Assertions.assertThrows(IllegalArgumentException.class, () -> rechargeable.addItemCharge(item, -0.1F)); + Assertions.assertThrows(IllegalArgumentException.class, () -> rechargeable.removeItemCharge(item, -0.1F)); + } + + @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 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("&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); + 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; + } + + } + +} 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..bdf2e6d9b 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 { @@ -55,6 +55,7 @@ public class TestCargoNodeListener { @ParameterizedTest @SlimefunItemsSource(items = { "CARGO_INPUT_NODE", "CARGO_OUTPUT_NODE", "CARGO_OUTPUT_NODE_2" }) public void testInvalidPlacement(ItemStack item) { + SlimefunPlugin.getRegistry().setBackwardsCompatible(true); Player player = server.addPlayer(); Location l = new Location(player.getWorld(), 190, 50, 400); Block b = l.getBlock(); @@ -63,10 +64,12 @@ public class TestCargoNodeListener { BlockPlaceEvent event = new BlockPlaceEvent(b, new BlockStateMock(), against, item, player, true, EquipmentSlot.HAND); listener.onCargoNodePlace(event); Assertions.assertTrue(event.isCancelled()); + SlimefunPlugin.getRegistry().setBackwardsCompatible(false); } @Test public void testNonCargoNode() { + SlimefunPlugin.getRegistry().setBackwardsCompatible(true); Player player = server.addPlayer(); Location l = new Location(player.getWorld(), 190, 50, 400); Block b = l.getBlock(); @@ -77,6 +80,7 @@ public class TestCargoNodeListener { BlockPlaceEvent event = new BlockPlaceEvent(b, new BlockStateMock(), against, item, player, true, EquipmentSlot.HAND); listener.onCargoNodePlace(event); Assertions.assertFalse(event.isCancelled()); + SlimefunPlugin.getRegistry().setBackwardsCompatible(false); } } 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;