From 6de4130d05b06942140ea6fbd7be9ff7072523ab Mon Sep 17 00:00:00 2001 From: poma123 Date: Wed, 5 Aug 2020 12:41:48 +0200 Subject: [PATCH 01/81] Fixed prevention when brewing with slimefun items --- .../listeners/VanillaMachinesListener.java | 21 ++++++++++++++++--- src/main/resources/languages/messages_en.yml | 3 +++ 2 files changed, 21 insertions(+), 3 deletions(-) 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 ed660f5cc..dcc2c8969 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 @@ -6,6 +6,7 @@ import org.bukkit.event.Event.Result; import org.bukkit.event.EventHandler; import org.bukkit.event.Listener; import org.bukkit.event.inventory.CraftItemEvent; +import org.bukkit.event.inventory.InventoryAction; import org.bukkit.event.inventory.InventoryClickEvent; import org.bukkit.event.inventory.InventoryType; import org.bukkit.event.inventory.PrepareItemCraftEvent; @@ -95,10 +96,24 @@ public class VanillaMachinesListener implements Listener { @EventHandler(ignoreCancelled = true) public void onPreBrew(InventoryClickEvent e) { - Inventory inventory = e.getInventory(); + Inventory inventory = e.getClickedInventory(); + Inventory topInventory = e.getView().getTopInventory(); - if (inventory.getType() == InventoryType.BREWING && e.getRawSlot() < inventory.getSize() && inventory.getHolder() instanceof BrewingStand) { - e.setCancelled(isUnallowed(SlimefunItem.getByItem(e.getCursor()))); + if (inventory != null && topInventory.getType() == InventoryType.BREWING && topInventory.getHolder() instanceof BrewingStand) { + if (e.getAction() == InventoryAction.HOTBAR_SWAP) { + e.setCancelled(true); + return; + } + + if (inventory.getType() == InventoryType.BREWING) { + e.setCancelled(isUnallowed(SlimefunItem.getByItem(e.getCursor()))); + } else { + e.setCancelled(isUnallowed(SlimefunItem.getByItem(e.getCurrentItem()))); + } + + if (e.getResult() == Result.DENY) { + SlimefunPlugin.getLocalization().sendMessage((Player) e.getWhoClicked(), "brewing_stand.not-working", true); + } } } diff --git a/src/main/resources/languages/messages_en.yml b/src/main/resources/languages/messages_en.yml index 099dd5281..1298dcb36 100644 --- a/src/main/resources/languages/messages_en.yml +++ b/src/main/resources/languages/messages_en.yml @@ -232,6 +232,9 @@ machines: anvil: not-working: '&4You cannot use Slimefun Items in an anvil!' +brewing_stand: + not-working: '&4You cannot use Slimefun Items in a brewing stand!' + backpack: already-open: '&cSorry, this Backpack is open somewhere else!' no-stack: '&cYou cannot stack Backpacks' From 9454c890ea71d970a9e545c35e2cfdf7cb2a5639 Mon Sep 17 00:00:00 2001 From: poma123 Date: Wed, 5 Aug 2020 13:02:35 +0200 Subject: [PATCH 02/81] Refactoring --- .../implementation/listeners/VanillaMachinesListener.java | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) 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 dcc2c8969..bdb8d367f 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 @@ -96,16 +96,16 @@ public class VanillaMachinesListener implements Listener { @EventHandler(ignoreCancelled = true) public void onPreBrew(InventoryClickEvent e) { - Inventory inventory = e.getClickedInventory(); + Inventory clickedInventory = e.getClickedInventory(); Inventory topInventory = e.getView().getTopInventory(); - if (inventory != null && topInventory.getType() == InventoryType.BREWING && topInventory.getHolder() instanceof BrewingStand) { + if (clickedInventory != null && topInventory.getType() == InventoryType.BREWING && topInventory.getHolder() instanceof BrewingStand) { if (e.getAction() == InventoryAction.HOTBAR_SWAP) { e.setCancelled(true); return; } - if (inventory.getType() == InventoryType.BREWING) { + if (clickedInventory.getType() == InventoryType.BREWING) { e.setCancelled(isUnallowed(SlimefunItem.getByItem(e.getCursor()))); } else { e.setCancelled(isUnallowed(SlimefunItem.getByItem(e.getCurrentItem()))); From 3d8e01e6f2cdb00610c5046d4fa1aa80b1e9e90b Mon Sep 17 00:00:00 2001 From: TheBusyBiscuit Date: Wed, 5 Aug 2020 14:52:33 +0000 Subject: [PATCH 03/81] Translate messages_de.yml via GitLocalize --- src/main/resources/languages/messages_de.yml | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/main/resources/languages/messages_de.yml b/src/main/resources/languages/messages_de.yml index a95ab895d..2b9f41e0f 100644 --- a/src/main/resources/languages/messages_de.yml +++ b/src/main/resources/languages/messages_de.yml @@ -306,6 +306,7 @@ languages: zh-CN: Chinesisch (China) el: Griechisch he: Hebräisch + pt: Portugiesisch (Portugal) ar: Arabisch af: Afrikaans da: Dänisch @@ -317,7 +318,6 @@ languages: fa: Persisch th: Thailändisch ro: Rumänisch - pt: Portugiesisch (Portugal) pt-BR: Portugiesisch (Brasilien) bg: Bulgarisch ko: Koreanisch @@ -327,5 +327,7 @@ languages: sr: Serbisch be: Belarusisch tl: Tagalog +brewing_stand: + not-working: "&4Items von Slimefun können nicht zum Brauen verwendet werden!" miner: no-ores: "&eIch konnte leider keine Erze in der Nähe finden!" From a0fe200948985f2f13743021fc71e2d53d069fea Mon Sep 17 00:00:00 2001 From: Scott Gomez Andoy Date: Wed, 5 Aug 2020 14:54:16 +0000 Subject: [PATCH 04/81] Translate messages_tl.yml via GitLocalize --- src/main/resources/languages/messages_tl.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/main/resources/languages/messages_tl.yml b/src/main/resources/languages/messages_tl.yml index bafeb2697..de0485288 100644 --- a/src/main/resources/languages/messages_tl.yml +++ b/src/main/resources/languages/messages_tl.yml @@ -334,3 +334,5 @@ languages: sr: Serbian be: Belarusian tl: Tagalog/Filipino +brewing_stand: + not-working: "&4Hindi ka maaaring gumamit ng mga Item ng Slimefun sa Brewing Stand!" From cd7a94516a350979c9b930b8a3fd8fc0ae1a1825 Mon Sep 17 00:00:00 2001 From: LinoxGH Date: Wed, 5 Aug 2020 15:06:58 +0000 Subject: [PATCH 05/81] Translate messages_tr.yml via GitLocalize --- src/main/resources/languages/messages_tr.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/main/resources/languages/messages_tr.yml b/src/main/resources/languages/messages_tr.yml index a729d4f4a..0608f4bb9 100644 --- a/src/main/resources/languages/messages_tr.yml +++ b/src/main/resources/languages/messages_tr.yml @@ -318,5 +318,7 @@ languages: sr: Sırpça be: Belarusça tl: Tagalog +brewing_stand: + not-working: "&4Slimefun eşyalarını simya standında kullanamazsın!" miner: no-ores: "&eÜzgünüm, yakınlarda herhangi bir cevher bulamadım!" From c2cc7ab96c706c51ba7697e1cf26ef0f76853ae1 Mon Sep 17 00:00:00 2001 From: TheBusyBiscuit Date: Wed, 5 Aug 2020 15:38:07 +0000 Subject: [PATCH 06/81] Translate messages_ja.yml via GitLocalize --- src/main/resources/languages/messages_ja.yml | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/main/resources/languages/messages_ja.yml b/src/main/resources/languages/messages_ja.yml index 62077b9a0..24877bc5d 100644 --- a/src/main/resources/languages/messages_ja.yml +++ b/src/main/resources/languages/messages_ja.yml @@ -284,6 +284,8 @@ languages: zh-CN: 中国語(中国) el: ギリシャ語 he: ヘブライ語 + pt: ポルトガル語(ポルトガル) + pt-BR: ポルトガル語(ブラジル) ar: アラビア語 af: アフリカーンス語 da: デンマーク語 @@ -295,8 +297,6 @@ languages: fa: ペルシア語 th: タイ語 ro: ルーマニア語 - pt: ポルトガル語(ポルトガル) - pt-BR: ポルトガル語(ブラジル) bg: ブルガリア語 ko: 韓国語 tr: トルコ語 @@ -305,5 +305,7 @@ languages: sr: セルビア語 be: ベラルーシ語 tl: タガログ語 +brewing_stand: + not-working: "&4Slimefunのアイテムは醸造台で使えません!" miner: no-ores: "&e周辺には鉱石が見つかりませんでした!" From bb67155add857c45b0a8cb7ae7a64352936757b7 Mon Sep 17 00:00:00 2001 From: bito-blosh Date: Wed, 5 Aug 2020 15:38:08 +0000 Subject: [PATCH 07/81] Translate messages_ja.yml via GitLocalize From 9594046bd5a0e7644e303acd781cff7a1da70308 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andr=C3=A1s=20Marczink=C3=B3?= Date: Wed, 5 Aug 2020 21:36:35 +0000 Subject: [PATCH 08/81] Translate recipes_hu.yml via GitLocalize --- src/main/resources/languages/recipes_hu.yml | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/main/resources/languages/recipes_hu.yml b/src/main/resources/languages/recipes_hu.yml index 1992ade71..899b0e21f 100644 --- a/src/main/resources/languages/recipes_hu.yml +++ b/src/main/resources/languages/recipes_hu.yml @@ -32,7 +32,7 @@ slimefun: - Készítsd el ezt a Tárgyat az ábra alapján - egy Ore Crusher segítségével mob_drop: - name: Mob Drop + name: Élőlény Dobja lore: - Öld meg ezt az Élőlényt, - hogy megszerezd ezt a tárgyat @@ -118,6 +118,11 @@ slimefun: lore: - Készítsd el ezt a Tárgyat az ábra alapján - egy Refinery segítségével + barter_drop: + name: Piglinek Dobják Cserélésnél + lore: + - Cseréld el a Piglenekkel Aranyrudakat, + - hogy megszerezd ezt a tárgyat minecraft: shaped: name: Barkácsrecept Forma From f89f3a35bb5d5664e6f0d005af78b07f9bf6f9c3 Mon Sep 17 00:00:00 2001 From: poma123 Date: Wed, 5 Aug 2020 21:36:36 +0000 Subject: [PATCH 09/81] Translate messages_hu.yml via GitLocalize --- src/main/resources/languages/messages_hu.yml | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/src/main/resources/languages/messages_hu.yml b/src/main/resources/languages/messages_hu.yml index 6a932fd5c..17adc36d7 100644 --- a/src/main/resources/languages/messages_hu.yml +++ b/src/main/resources/languages/messages_hu.yml @@ -121,7 +121,7 @@ messages: meghalsz." research: start: "&7Az Ősi Lelkek titokzatos szavakat súgnak a füledbe!" - progress: "&7Elkezdel kíváncsiskodni a kutatásról, neve: &b%research% &e(%progress%)" + progress: "&7Elkezdtél kíváncsiskodni a következő kutatásról: &b%research% &e(%progress%)" fire-extinguish: "&7Eloltottad magad!" cannot-place: "&cNem teheted ezt a blokkot oda!" no-pvp: "&cA pvp itt nem engedélyezett!" @@ -300,8 +300,6 @@ languages: zh-CN: Kínai (Kína) el: Görög he: Héber - pt: Portugál (Portugália) - pt-BR: Portugál (Brazília) ar: Arab af: Afrikánsz da: Dán @@ -313,6 +311,8 @@ languages: fa: Perzsa th: Thai ro: Román + pt: Portugál (Portugália) + pt-BR: Portugál (Brazília) bg: Bolgár ko: Koreai tr: Török @@ -321,5 +321,7 @@ languages: sr: Szerb be: Belorusz tl: Tagalog +brewing_stand: + not-working: "&4Nem használhatsz Slimefun tárgyakat a Főzőállványban!" miner: no-ores: "&eSajnálom, nem találtam semmilyen Ércet a közelben!" From 7f1a300f380771792fa32a875fd691ee844e5355 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andr=C3=A1s=20Marczink=C3=B3?= Date: Wed, 5 Aug 2020 21:36:37 +0000 Subject: [PATCH 10/81] Translate messages_hu.yml via GitLocalize From 33d802b9408376acd8eba88ed97f349106b18961 Mon Sep 17 00:00:00 2001 From: Luu7 Date: Thu, 6 Aug 2020 07:47:02 +0000 Subject: [PATCH 11/81] Translate researches_es.yml via GitLocalize --- src/main/resources/languages/researches_es.yml | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/main/resources/languages/researches_es.yml b/src/main/resources/languages/researches_es.yml index 92a533964..9e3aec5cc 100644 --- a/src/main/resources/languages/researches_es.yml +++ b/src/main/resources/languages/researches_es.yml @@ -236,3 +236,7 @@ slimefun: advanced_industrial_miner: Minería Mejorada magical_zombie_pills: De-Zombificación auto_brewer: Alquimia Industrial + enchantment_rune: Encantamiento Antiguo + lead_clothing: Ropa de Plomo + tape_measure: Cinta Métrica + iron_golem_assembler: Iron Golems Automáticos From 4a45757a53fc3a0ceb76e9f4dab411fedea062db Mon Sep 17 00:00:00 2001 From: Luu7 Date: Thu, 6 Aug 2020 07:47:03 +0000 Subject: [PATCH 12/81] Translate messages_es.yml via GitLocalize --- src/main/resources/languages/messages_es.yml | 16 ++++++++++++++-- 1 file changed, 14 insertions(+), 2 deletions(-) diff --git a/src/main/resources/languages/messages_es.yml b/src/main/resources/languages/messages_es.yml index d69e40244..497df743d 100644 --- a/src/main/resources/languages/messages_es.yml +++ b/src/main/resources/languages/messages_es.yml @@ -150,6 +150,16 @@ messages: - "&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!" + piglin-barter: "&4No puedes tradear con piglins usando items de Slimefun" + enchantment-rune: + fail: "&cNo puedes encantar este item." + no-enchantment: "&cNo se pudo encontrar un encantamiento aplicable a este item." + success: "&aHas aplicado con éxito un encantamiento aleatorio a este item." + tape-measure: + no-anchor: "&cNecesitas establecer un ancla antes de comenzar a medir!" + wrong-world: "&cParece ser que tu ancla se encuentra en un mundo diferente!" + distance: "&7Medida tomada. &eDistancia: %distance%" + anchor-set: "&aAncla establecida con éxito:&e %anchor%" machines: pattern-not-found: "&eLo siento, no puedo reconocer esta receta. Por favor coloca el objeto en el patrón correcto dentro del dispensador." @@ -291,8 +301,6 @@ languages: zh-CN: Chino (China) el: Griego he: Hebreo - pt: Portugués (Portugal) - pt-BR: Portugués (Brasil) ar: Árabe af: Africano da: Danés @@ -304,6 +312,8 @@ languages: fa: Persa th: Tailandés ro: Rumano + pt: Portugués (Portugal) + pt-BR: Portugués (Brasil) bg: Búlgaro ko: Coreano tr: Turco @@ -312,5 +322,7 @@ languages: sr: Serbio be: Bielorruso tl: Tagalog +brewing_stand: + not-working: "&4¡No puedes usar objetos de Slimefun en un soporte para pociones!" miner: no-ores: "&ePerdón, ¡No encuentro ningún mineral cerca!" From 5585e502301488db051181e458e555e3f28347b2 Mon Sep 17 00:00:00 2001 From: TheBusyBiscuit Date: Thu, 6 Aug 2020 07:47:05 +0000 Subject: [PATCH 13/81] Translate messages_es.yml via GitLocalize From b0c040ea7acef667f0fc9fd0f9b568892cd270e0 Mon Sep 17 00:00:00 2001 From: Vravinite Date: Thu, 6 Aug 2020 07:47:06 +0000 Subject: [PATCH 14/81] Translate recipes_es.yml via GitLocalize --- src/main/resources/languages/recipes_es.yml | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/main/resources/languages/recipes_es.yml b/src/main/resources/languages/recipes_es.yml index 8dcb8c432..0bd28656d 100644 --- a/src/main/resources/languages/recipes_es.yml +++ b/src/main/resources/languages/recipes_es.yml @@ -118,6 +118,11 @@ slimefun: lore: - Haz este objeto tal como se muestra - usando una Refinery + barter_drop: + name: Piglin Bartering Drop + lore: + - Troca con Piglins usando + - Lingotes de Oro para obtener este objeto minecraft: shaped: name: Receta de Crafteo con forma From 353aef44a2c69d878b1e2b7730224e7265b1b131 Mon Sep 17 00:00:00 2001 From: TheBusyBiscuit Date: Thu, 6 Aug 2020 09:50:37 +0200 Subject: [PATCH 15/81] [CI skip] Updated workflow file --- .github/workflows/yaml-linter.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.github/workflows/yaml-linter.yml b/.github/workflows/yaml-linter.yml index ca7054f6a..445e5afe2 100644 --- a/.github/workflows/yaml-linter.yml +++ b/.github/workflows/yaml-linter.yml @@ -11,8 +11,9 @@ on: - '**.yml' jobs: - build: + linter: + name: YAML Linter runs-on: ubuntu-latest steps: From 344596b10fa78b02d5203aa1a95fe8829bd68817 Mon Sep 17 00:00:00 2001 From: TheBusyBiscuit Date: Thu, 6 Aug 2020 09:51:15 +0200 Subject: [PATCH 16/81] [CI skip] Updated workflow file --- .github/workflows/close-invalid-issues.yml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/.github/workflows/close-invalid-issues.yml b/.github/workflows/close-invalid-issues.yml index 54b3bb834..bcfa7120d 100644 --- a/.github/workflows/close-invalid-issues.yml +++ b/.github/workflows/close-invalid-issues.yml @@ -6,7 +6,10 @@ on: jobs: comment: + + name: Invalid Issues runs-on: ubuntu-latest + if: contains(github.event.issue.labels.*.name, 'Bug Report') == false steps: - name: Close Issue From 5093cac924fbbab2687c29cedb66f75d945ad432 Mon Sep 17 00:00:00 2001 From: TheBusyBiscuit Date: Thu, 6 Aug 2020 09:51:46 +0200 Subject: [PATCH 17/81] [CI skip] Updated workflow file --- .github/workflows/maven-compiler.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/maven-compiler.yml b/.github/workflows/maven-compiler.yml index 0aa9a2e80..1e041876b 100644 --- a/.github/workflows/maven-compiler.yml +++ b/.github/workflows/maven-compiler.yml @@ -17,6 +17,7 @@ on: jobs: build: + name: Maven build runs-on: ubuntu-latest steps: From faad86b750445a74b96b2bac5095acea89d1ebab Mon Sep 17 00:00:00 2001 From: TheBusyBiscuit Date: Thu, 6 Aug 2020 09:52:31 +0200 Subject: [PATCH 18/81] [CI skip] Updated workflow file --- .github/workflows/duplicates.yml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/.github/workflows/duplicates.yml b/.github/workflows/duplicates.yml index 3cdafa89a..c1b481ced 100644 --- a/.github/workflows/duplicates.yml +++ b/.github/workflows/duplicates.yml @@ -6,7 +6,10 @@ on: jobs: comment: + + name: Mark Issue as duplicate runs-on: ubuntu-latest + if: contains(github.event.comment.body, 'Duplicate of ') steps: - name: Add label to the Issue From 3fb6b57c3c122b894cfadaeab3c4e55bf044c869 Mon Sep 17 00:00:00 2001 From: TheBusyBiscuit Date: Thu, 6 Aug 2020 09:52:59 +0200 Subject: [PATCH 19/81] [CI skip] Updated workflow file --- .github/workflows/discord-webhook.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/discord-webhook.yml b/.github/workflows/discord-webhook.yml index b3e0783c8..c11ccaf3d 100644 --- a/.github/workflows/discord-webhook.yml +++ b/.github/workflows/discord-webhook.yml @@ -9,6 +9,7 @@ on: jobs: report: + name: Discord Webhook runs-on: ubuntu-latest if: github.repository == 'TheBusyBiscuit/Slimefun4' From d55a546c4260743f590aacc8c01e3a57f3b6fdae Mon Sep 17 00:00:00 2001 From: TheBusyBiscuit Date: Thu, 6 Aug 2020 16:24:41 +0200 Subject: [PATCH 20/81] Fixes #2168 --- CHANGELOG.md | 1 + .../implementation/SlimefunItems.java | 20 +-- .../items/cargo/AdvancedCargoOutputNode.java | 4 +- .../implementation/items/food/Juice.java | 78 +++++++++- .../SlimefunItemConsumeListener.java | 57 ++------ .../setup/SlimefunItemSetup.java | 133 +++++++++--------- 6 files changed, 162 insertions(+), 131 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index df82aa2e4..be7801f58 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -52,6 +52,7 @@ * Fixed #2181 * Fixed #2180 * Fixed #2122 +* Fixed #2168 ## Release Candidate 15 (01 Aug 2020) 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 fcf7b7034..4953a736f 100644 --- a/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/SlimefunItems.java +++ b/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/SlimefunItems.java @@ -144,11 +144,11 @@ public final class SlimefunItems { 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", "", LoreBuilder.hunger(3)); - public static final SlimefunItemStack MELON_JUICE = new SlimefunItemStack("MELON_JUICE", Color.RED, new PotionEffect(PotionEffectType.SATURATION, 6, 0), "&cMelon Juice", "", LoreBuilder.hunger(3)); - public static final SlimefunItemStack CARROT_JUICE = new SlimefunItemStack("CARROT_JUICE", Color.ORANGE, new PotionEffect(PotionEffectType.SATURATION, 6, 0), "&6Carrot Juice", "", LoreBuilder.hunger(3)); - public static final SlimefunItemStack PUMPKIN_JUICE = new SlimefunItemStack("PUMPKIN_JUICE", Color.ORANGE, new PotionEffect(PotionEffectType.SATURATION, 6, 0), "&6Pumpkin Juice", "", LoreBuilder.hunger(3)); - public static final SlimefunItemStack SWEET_BERRY_JUICE = new SlimefunItemStack("SWEET_BERRY_JUICE", Color.RED, new PotionEffect(PotionEffectType.SATURATION, 6, 0), "&cSweet Berry Juice", "", LoreBuilder.hunger(3)); + public static final SlimefunItemStack APPLE_JUICE = new SlimefunItemStack("APPLE_JUICE", Color.RED, new PotionEffect(PotionEffectType.SATURATION, 5, 0), "&cApple Juice", "", LoreBuilder.hunger(3)); + public static final SlimefunItemStack MELON_JUICE = new SlimefunItemStack("MELON_JUICE", Color.RED, new PotionEffect(PotionEffectType.SATURATION, 5, 0), "&cMelon Juice", "", LoreBuilder.hunger(3)); + public static final SlimefunItemStack CARROT_JUICE = new SlimefunItemStack("CARROT_JUICE", Color.ORANGE, new PotionEffect(PotionEffectType.SATURATION, 5, 0), "&6Carrot Juice", "", LoreBuilder.hunger(3)); + public static final SlimefunItemStack PUMPKIN_JUICE = new SlimefunItemStack("PUMPKIN_JUICE", Color.ORANGE, new PotionEffect(PotionEffectType.SATURATION, 5, 0), "&6Pumpkin Juice", "", LoreBuilder.hunger(3)); + public static final SlimefunItemStack SWEET_BERRY_JUICE = new SlimefunItemStack("SWEET_BERRY_JUICE", Color.RED, new PotionEffect(PotionEffectType.SATURATION, 5, 0), "&cSweet Berry Juice", "", LoreBuilder.hunger(3)); 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", "", "&fExtra saturating!"); @@ -161,14 +161,14 @@ public final class SlimefunItems { public static final SlimefunItemStack KELP_COOKIE = new SlimefunItemStack("KELP_COOKIE", Material.COOKIE, "&2Kelp Cookie"); /* Christmas */ - public static final SlimefunItemStack CHRISTMAS_MILK = new SlimefunItemStack("CHRISTMAS_MILK", Color.WHITE, new PotionEffect(PotionEffectType.SATURATION, 5, 0), "&6Glass of Milk", "", LoreBuilder.hunger(2.5)); - public static final SlimefunItemStack CHRISTMAS_CHOCOLATE_MILK = new SlimefunItemStack("CHRISTMAS_CHOCOLATE_MILK", Color.MAROON, new PotionEffect(PotionEffectType.SATURATION, 12, 0), "&6Chocolate Milk", "", LoreBuilder.hunger(6)); - public static final SlimefunItemStack CHRISTMAS_EGG_NOG = new SlimefunItemStack("CHRISTMAS_EGG_NOG", Color.GRAY, new PotionEffect(PotionEffectType.SATURATION, 7, 0), "&aEgg Nog", "", LoreBuilder.hunger(3.5)); - public static final SlimefunItemStack CHRISTMAS_APPLE_CIDER = new SlimefunItemStack("CHRISTMAS_APPLE_CIDER", Color.RED, new PotionEffect(PotionEffectType.SATURATION, 14, 0), "&cApple Cider", "", LoreBuilder.hunger(7)); + public static final SlimefunItemStack CHRISTMAS_MILK = new SlimefunItemStack("CHRISTMAS_MILK", Color.WHITE, new PotionEffect(PotionEffectType.SATURATION, 4, 0), "&6Glass of Milk", "", LoreBuilder.hunger(2.5)); + public static final SlimefunItemStack CHRISTMAS_CHOCOLATE_MILK = new SlimefunItemStack("CHRISTMAS_CHOCOLATE_MILK", Color.MAROON, new PotionEffect(PotionEffectType.SATURATION, 11, 0), "&6Chocolate Milk", "", LoreBuilder.hunger(6)); + public static final SlimefunItemStack CHRISTMAS_EGG_NOG = new SlimefunItemStack("CHRISTMAS_EGG_NOG", Color.GRAY, new PotionEffect(PotionEffectType.SATURATION, 6, 0), "&aEgg Nog", "", LoreBuilder.hunger(3.5)); + public static final SlimefunItemStack CHRISTMAS_APPLE_CIDER = new SlimefunItemStack("CHRISTMAS_APPLE_CIDER", Color.RED, new PotionEffect(PotionEffectType.SATURATION, 13, 0), "&cApple Cider", "", LoreBuilder.hunger(7)); 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, "&fApple Pie"); - public static final SlimefunItemStack CHRISTMAS_HOT_CHOCOLATE = new SlimefunItemStack("CHRISTMAS_HOT_CHOCOLATE", Color.MAROON, new PotionEffect(PotionEffectType.SATURATION, 14, 0), "&6Hot Chocolate", "", LoreBuilder.hunger(7)); + public static final SlimefunItemStack CHRISTMAS_HOT_CHOCOLATE = new SlimefunItemStack("CHRISTMAS_HOT_CHOCOLATE", Color.MAROON, new PotionEffect(PotionEffectType.SATURATION, 13, 0), "&6Hot Chocolate", "", LoreBuilder.hunger(7)); 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"); public static final SlimefunItemStack CHRISTMAS_CARAMEL_APPLE = new SlimefunItemStack("CHRISTMAS_CARAMEL_APPLE", Material.APPLE, "&6Caramel Apple"); 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 a8f42c3bf..667ee068d 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 @@ -10,8 +10,8 @@ public class AdvancedCargoOutputNode extends AbstractFilterNode { private static final int[] BORDER = { 0, 1, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 17, 18, 22, 23, 24, 26, 27, 31, 32, 33, 34, 35, 36, 40, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53 }; - public AdvancedCargoOutputNode(Category category, SlimefunItemStack item, RecipeType recipeType, ItemStack[] recipe, ItemStack recipeOutput) { - super(category, item, recipeType, recipe, recipeOutput); + public AdvancedCargoOutputNode(Category category, SlimefunItemStack item, RecipeType recipeType, ItemStack[] recipe) { + super(category, item, recipeType, recipe, null); } @Override diff --git a/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/items/food/Juice.java b/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/items/food/Juice.java index f4076401b..15d2d1c78 100644 --- a/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/items/food/Juice.java +++ b/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/items/food/Juice.java @@ -1,12 +1,25 @@ package io.github.thebusybiscuit.slimefun4.implementation.items.food; -import org.bukkit.inventory.ItemStack; +import java.util.ArrayList; +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 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.items.SimpleSlimefunItem; import io.github.thebusybiscuit.slimefun4.implementation.items.backpacks.Cooler; import io.github.thebusybiscuit.slimefun4.implementation.listeners.CoolerListener; +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.SlimefunItem; +import me.mrCookieSlime.Slimefun.api.Slimefun; import me.mrCookieSlime.Slimefun.api.SlimefunItemStack; /** @@ -19,10 +32,69 @@ import me.mrCookieSlime.Slimefun.api.SlimefunItemStack; * @see CoolerListener * */ -public class Juice extends SlimefunItem { +public class Juice extends SimpleSlimefunItem { + + private final List effects; public Juice(Category category, SlimefunItemStack item, RecipeType recipeType, ItemStack[] recipe) { - super(category, item, recipeType, recipe); + this(category, item, recipeType, recipe, null); + } + + public Juice(Category category, SlimefunItemStack item, RecipeType recipeType, ItemStack[] recipe, ItemStack recipeOutput) { + super(category, item, recipeType, recipe, recipeOutput); + + ItemMeta meta = item.getItemMeta(); + + if (meta instanceof PotionMeta) { + effects = ((PotionMeta) meta).getCustomEffects(); + } + else { + effects = new ArrayList<>(); + } + } + + @Override + public ItemConsumptionHandler getItemHandler() { + return (e, p, item) -> { + // Fix for Saturation on potions is no longer working, + // Minecraft has been broken when it comes to Saturation potions for a long time + + for (PotionEffect effect : effects) { + if (effect.getType().equals(PotionEffectType.SATURATION)) { + p.addPotionEffect(effect); + break; + } + } + + removeGlassBottle(p, item); + }; + } + + /** + * Determines from which hand the juice is being drunk, and its amount + * + * @param p + * The {@link Player} that triggered this + * @param item + * The {@link ItemStack} in question + */ + private void removeGlassBottle(Player p, ItemStack item) { + if (SlimefunUtils.isItemSimilar(item, p.getInventory().getItemInMainHand(), true)) { + if (p.getInventory().getItemInMainHand().getAmount() == 1) { + Slimefun.runSync(() -> p.getEquipment().getItemInMainHand().setAmount(0)); + } + else { + Slimefun.runSync(() -> p.getInventory().removeItem(new ItemStack(Material.GLASS_BOTTLE, 1))); + } + } + else if (SlimefunUtils.isItemSimilar(item, p.getInventory().getItemInOffHand(), true)) { + if (p.getInventory().getItemInOffHand().getAmount() == 1) { + Slimefun.runSync(() -> p.getEquipment().getItemInOffHand().setAmount(0)); + } + else { + Slimefun.runSync(() -> p.getInventory().removeItem(new ItemStack(Material.GLASS_BOTTLE, 1))); + } + } } } 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 6fc3c8374..e56acdcfb 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 @@ -1,22 +1,23 @@ package io.github.thebusybiscuit.slimefun4.implementation.listeners; -import org.bukkit.Material; import org.bukkit.entity.Player; import org.bukkit.event.EventHandler; import org.bukkit.event.Listener; import org.bukkit.event.player.PlayerItemConsumeEvent; import org.bukkit.inventory.ItemStack; -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.Objects.SlimefunItem.SlimefunItem; import me.mrCookieSlime.Slimefun.api.Slimefun; +/** + * This {@link Listener} is responsible for handling the {@link ItemConsumptionHandler} + * for any {@link SlimefunItem}. + * + * @author TheBusyBiscuit + * + */ public class SlimefunItemConsumeListener implements Listener { public SlimefunItemConsumeListener(SlimefunPlugin plugin) { @@ -31,53 +32,11 @@ public class SlimefunItemConsumeListener implements Listener { if (sfItem != null) { if (Slimefun.hasUnlocked(p, sfItem, true)) { - if (sfItem instanceof Juice) { - // Fix for Saturation on potions is no longer working - - for (PotionEffect effect : ((PotionMeta) item.getItemMeta()).getCustomEffects()) { - if (effect.getType().equals(PotionEffectType.SATURATION)) { - p.addPotionEffect(new PotionEffect(PotionEffectType.SATURATION, effect.getDuration(), effect.getAmplifier())); - break; - } - } - - removeGlassBottle(p, item); - } - else { - sfItem.callItemHandler(ItemConsumptionHandler.class, handler -> handler.onConsume(e, p, item)); - } + sfItem.callItemHandler(ItemConsumptionHandler.class, handler -> handler.onConsume(e, p, item)); } else { e.setCancelled(true); } } } - - /** - * Determines from which hand the juice is being drunk, and its amount - * - * @param p - * The {@link Player} that triggered this - * @param item - * The {@link ItemStack} in question - */ - private void removeGlassBottle(Player p, ItemStack item) { - if (SlimefunUtils.isItemSimilar(item, p.getInventory().getItemInMainHand(), true)) { - if (p.getInventory().getItemInMainHand().getAmount() == 1) { - Slimefun.runSync(() -> p.getEquipment().getItemInMainHand().setAmount(0)); - } - else { - Slimefun.runSync(() -> p.getInventory().removeItem(new ItemStack(Material.GLASS_BOTTLE, 1))); - } - } - else if (SlimefunUtils.isItemSimilar(item, p.getInventory().getItemInOffHand(), true)) { - if (p.getInventory().getItemInOffHand().getAmount() == 1) { - Slimefun.runSync(() -> p.getEquipment().getItemInOffHand().setAmount(0)); - } - else { - Slimefun.runSync(() -> p.getInventory().removeItem(new ItemStack(Material.GLASS_BOTTLE, 1))); - } - } - } - } 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 89fb366f7..a2c10280b 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 @@ -283,7 +283,7 @@ public final class SlimefunItemSetup { new SlimefunItem(categories.food, SlimefunItems.KELP_COOKIE, RecipeType.ENHANCED_CRAFTING_TABLE, new ItemStack[] {null, new ItemStack(Material.DRIED_KELP), null, new ItemStack(Material.DRIED_KELP), new ItemStack(Material.SUGAR), new ItemStack(Material.DRIED_KELP), null, new ItemStack(Material.DRIED_KELP), null}, - new CustomItem(SlimefunItems.KELP_COOKIE, 2)) + new SlimefunItemStack(SlimefunItems.KELP_COOKIE, 2)) .register(plugin); new GrindStone(categories.basicMachines, SlimefunItems.GRIND_STONE).register(plugin); @@ -296,7 +296,7 @@ public final class SlimefunItemSetup { new SlimefunItem(categories.magicalResources, SlimefunItems.MAGIC_LUMP_1, RecipeType.GRIND_STONE, new ItemStack[] {new ItemStack(Material.NETHER_WART), null, null, null, null, null, null, null, null}, - new CustomItem(SlimefunItems.MAGIC_LUMP_1, 2)) + new SlimefunItemStack(SlimefunItems.MAGIC_LUMP_1, 2)) .register(plugin); new SlimefunItem(categories.magicalResources, SlimefunItems.MAGIC_LUMP_2, RecipeType.ENHANCED_CRAFTING_TABLE, @@ -309,7 +309,7 @@ public final class SlimefunItemSetup { new SlimefunItem(categories.magicalResources, SlimefunItems.ENDER_LUMP_1, RecipeType.ENHANCED_CRAFTING_TABLE, new ItemStack[] {null, null, null, null, new ItemStack(Material.ENDER_EYE), null, null, null, null}, - new CustomItem(SlimefunItems.ENDER_LUMP_1, 2)) + new SlimefunItemStack(SlimefunItems.ENDER_LUMP_1, 2)) .register(plugin); new SlimefunItem(categories.magicalResources, SlimefunItems.ENDER_LUMP_2, RecipeType.ENHANCED_CRAFTING_TABLE, @@ -509,12 +509,12 @@ public final class SlimefunItemSetup { new SlimefunItem(categories.resources, SlimefunItems.IRON_DUST, RecipeType.ORE_CRUSHER, new ItemStack[] {new ItemStack(Material.IRON_ORE), null, null, null, null, null, null, null, null}, - new CustomItem(SlimefunItems.IRON_DUST, oreCrusher.isOreDoublingEnabled() ? 2 : 1)) + new SlimefunItemStack(SlimefunItems.IRON_DUST, oreCrusher.isOreDoublingEnabled() ? 2 : 1)) .register(plugin); new SlimefunItem(categories.resources, SlimefunItems.GOLD_DUST, RecipeType.ORE_CRUSHER, new ItemStack[] {new ItemStack(Material.GOLD_ORE), null, null, null, null, null, null, null, null}, - new CustomItem(SlimefunItems.GOLD_DUST, oreCrusher.isOreDoublingEnabled() ? 2 : 1)) + new SlimefunItemStack(SlimefunItems.GOLD_DUST, oreCrusher.isOreDoublingEnabled() ? 2 : 1)) .register(plugin); new SlimefunItem(categories.resources, SlimefunItems.COPPER_DUST, RecipeType.ORE_WASHER, @@ -586,11 +586,11 @@ public final class SlimefunItemSetup { .register(plugin); new SlimefunItem(categories.misc, SlimefunItems.STEEL_PLATE, RecipeType.COMPRESSOR, - new ItemStack[] {new CustomItem(SlimefunItems.STEEL_INGOT, 8), null, null, null, null, null, null, null, null}) + new ItemStack[] {new SlimefunItemStack(SlimefunItems.STEEL_INGOT, 8), null, null, null, null, null, null, null, null}) .register(plugin); new UnplaceableBlock(categories.resources, SlimefunItems.COMPRESSED_CARBON, RecipeType.COMPRESSOR, - new ItemStack[] {new CustomItem(SlimefunItems.CARBON, 4), null, null, null, null, null, null, null, null}) + new ItemStack[] {new SlimefunItemStack(SlimefunItems.CARBON, 4), null, null, null, null, null, null, null, null}) .register(plugin); new UnplaceableBlock(categories.resources, SlimefunItems.CARBON_CHUNK, RecipeType.ENHANCED_CRAFTING_TABLE, @@ -646,12 +646,12 @@ public final class SlimefunItemSetup { new HologramProjector(categories.technicalGadgets, SlimefunItems.HOLOGRAM_PROJECTOR, RecipeType.ENHANCED_CRAFTING_TABLE, new ItemStack[] {null, SlimefunItems.POWER_CRYSTAL, null, SlimefunItems.ALUMINUM_BRASS_INGOT, SlimefunItems.ELECTRIC_MOTOR, SlimefunItems.ALUMINUM_BRASS_INGOT, null, SlimefunItems.ALUMINUM_BRASS_INGOT, null}, - new CustomItem(SlimefunItems.HOLOGRAM_PROJECTOR, 3)) + new SlimefunItemStack(SlimefunItems.HOLOGRAM_PROJECTOR, 3)) .register(plugin); new SlimefunItem(categories.misc, SlimefunItems.CHAIN, RecipeType.ENHANCED_CRAFTING_TABLE, new ItemStack[] {null, null, SlimefunItems.STEEL_INGOT, null, SlimefunItems.STEEL_INGOT, null, SlimefunItems.STEEL_INGOT, null, null}, - new CustomItem(SlimefunItems.CHAIN, 8)) + new SlimefunItemStack(SlimefunItems.CHAIN, 8)) .register(plugin); new SlimefunItem(categories.misc, SlimefunItems.HOOK, RecipeType.ENHANCED_CRAFTING_TABLE, @@ -797,7 +797,7 @@ public final class SlimefunItemSetup { new MagicalZombiePills(categories.magicalGadgets, SlimefunItems.MAGICAL_ZOMBIE_PILLS, RecipeType.MAGIC_WORKBENCH, new ItemStack[] {new ItemStack(Material.GOLD_INGOT), SlimefunItems.MAGIC_LUMP_2, new ItemStack(Material.GOLD_INGOT), new ItemStack(Material.APPLE), weaknessPotion, new ItemStack(Material.APPLE), new ItemStack(Material.GOLD_INGOT), SlimefunItems.MAGIC_LUMP_2, new ItemStack(Material.GOLD_INGOT)}, - new CustomItem(SlimefunItems.MAGICAL_ZOMBIE_PILLS, 2)) + new SlimefunItemStack(SlimefunItems.MAGICAL_ZOMBIE_PILLS, 2)) .register(plugin); } @@ -896,7 +896,7 @@ public final class SlimefunItemSetup { new SlimefunItem(categories.misc, SlimefunItems.HEAVY_CREAM, RecipeType.ENHANCED_CRAFTING_TABLE, new ItemStack[] {new ItemStack(Material.MILK_BUCKET), null, null, null, null, null, null, null, null}, - new CustomItem(SlimefunItems.HEAVY_CREAM, 2)) + new SlimefunItemStack(SlimefunItems.HEAVY_CREAM, 2)) .register(plugin); new SlimefunItem(categories.misc, SlimefunItems.CHEESE, RecipeType.ENHANCED_CRAFTING_TABLE, @@ -967,7 +967,7 @@ public final class SlimefunItemSetup { new SlimefunItem(categories.misc, SlimefunItems.CLOTH, RecipeType.ENHANCED_CRAFTING_TABLE, new ItemStack[] {new ItemStack(Material.WHITE_WOOL), null, null, null, null, null, null, null, null}, - new CustomItem(SlimefunItems.CLOTH, 8)) + new SlimefunItemStack(SlimefunItems.CLOTH, 8)) .register(plugin); new Bandage(categories.usefulItems, SlimefunItems.RAG, RecipeType.ENHANCED_CRAFTING_TABLE, @@ -982,12 +982,12 @@ public final class SlimefunItemSetup { new Splint(categories.usefulItems, SlimefunItems.SPLINT, RecipeType.ENHANCED_CRAFTING_TABLE, new ItemStack[] {null, new ItemStack(Material.IRON_INGOT), null, new ItemStack(Material.STICK), new ItemStack(Material.STICK), new ItemStack(Material.STICK), null, new ItemStack(Material.IRON_INGOT), null}, - new CustomItem(SlimefunItems.SPLINT, 4)) + new SlimefunItemStack(SlimefunItems.SPLINT, 4)) .register(plugin); new SlimefunItem(categories.misc, SlimefunItems.TIN_CAN, RecipeType.ENHANCED_CRAFTING_TABLE, new ItemStack[] {SlimefunItems.TIN_INGOT, SlimefunItems.TIN_INGOT, SlimefunItems.TIN_INGOT, SlimefunItems.TIN_INGOT, null, SlimefunItems.TIN_INGOT, SlimefunItems.TIN_INGOT, SlimefunItems.TIN_INGOT, SlimefunItems.TIN_INGOT}, - new CustomItem(SlimefunItems.TIN_CAN, 8)) + new SlimefunItemStack(SlimefunItems.TIN_CAN, 8)) .register(plugin); new Vitamins(categories.usefulItems, SlimefunItems.VITAMINS, RecipeType.ENHANCED_CRAFTING_TABLE, @@ -1318,7 +1318,7 @@ public final class SlimefunItemSetup { new SlimefunItem(categories.technicalComponents, SlimefunItems.COPPER_WIRE, RecipeType.ENHANCED_CRAFTING_TABLE, new ItemStack[] {null, null, null, SlimefunItems.COPPER_INGOT, SlimefunItems.COPPER_INGOT, SlimefunItems.COPPER_INGOT, null, null, null}, - new CustomItem(SlimefunItems.COPPER_WIRE, 8)) + new SlimefunItemStack(SlimefunItems.COPPER_WIRE, 8)) .register(plugin); new BlockPlacer(categories.basicMachines, SlimefunItems.BLOCK_PLACER, RecipeType.ENHANCED_CRAFTING_TABLE, @@ -1343,104 +1343,104 @@ public final class SlimefunItemSetup { new KnowledgeFlask(categories.magicalGadgets, SlimefunItems.FLASK_OF_KNOWLEDGE, RecipeType.MAGIC_WORKBENCH, new ItemStack[] {null, null, null, SlimefunItems.MAGIC_LUMP_2, new ItemStack(Material.GLASS_PANE), SlimefunItems.MAGIC_LUMP_2, null, SlimefunItems.MAGIC_LUMP_2, null}, - new CustomItem(SlimefunItems.FLASK_OF_KNOWLEDGE, 8)) + new SlimefunItemStack(SlimefunItems.FLASK_OF_KNOWLEDGE, 8)) .register(plugin); new BirthdayCake(categories.birthday, new SlimefunItemStack("BIRTHDAY_CAKE", Material.CAKE, "&bBirthday Cake"), RecipeType.ENHANCED_CRAFTING_TABLE, new ItemStack[] {null, new ItemStack(Material.TORCH), null, new ItemStack(Material.SUGAR), new ItemStack(Material.CAKE), new ItemStack(Material.SUGAR), null, null, null}) .register(plugin); - new SlimefunItem(categories.christmas, SlimefunItems.CHRISTMAS_MILK, RecipeType.ENHANCED_CRAFTING_TABLE, + new Juice(categories.christmas, SlimefunItems.CHRISTMAS_MILK, RecipeType.ENHANCED_CRAFTING_TABLE, new ItemStack[] {new ItemStack(Material.MILK_BUCKET), new ItemStack(Material.GLASS_BOTTLE), null, null, null, null, null, null, null}, - new CustomItem(SlimefunItems.CHRISTMAS_MILK, 4)) + new SlimefunItemStack(SlimefunItems.CHRISTMAS_MILK, 4)) .register(plugin); - new SlimefunItem(categories.christmas, SlimefunItems.CHRISTMAS_CHOCOLATE_MILK, RecipeType.ENHANCED_CRAFTING_TABLE, + new Juice(categories.christmas, SlimefunItems.CHRISTMAS_CHOCOLATE_MILK, RecipeType.ENHANCED_CRAFTING_TABLE, new ItemStack[] {SlimefunItems.CHRISTMAS_MILK, new ItemStack(Material.COCOA_BEANS), null, null, null, null, null, null, null}, - new CustomItem(SlimefunItems.CHRISTMAS_CHOCOLATE_MILK, 2)) + new SlimefunItemStack(SlimefunItems.CHRISTMAS_CHOCOLATE_MILK, 2)) .register(plugin); - new SlimefunItem(categories.christmas, SlimefunItems.CHRISTMAS_EGG_NOG, RecipeType.ENHANCED_CRAFTING_TABLE, + new Juice(categories.christmas, SlimefunItems.CHRISTMAS_EGG_NOG, RecipeType.ENHANCED_CRAFTING_TABLE, new ItemStack[] {SlimefunItems.CHRISTMAS_MILK, new ItemStack(Material.EGG), null, null, null, null, null, null, null}, - new CustomItem(SlimefunItems.CHRISTMAS_EGG_NOG, 2)) + new SlimefunItemStack(SlimefunItems.CHRISTMAS_EGG_NOG, 2)) .register(plugin); - new SlimefunItem(categories.christmas, SlimefunItems.CHRISTMAS_APPLE_CIDER, RecipeType.ENHANCED_CRAFTING_TABLE, + new Juice(categories.christmas, SlimefunItems.CHRISTMAS_APPLE_CIDER, RecipeType.ENHANCED_CRAFTING_TABLE, new ItemStack[] {SlimefunItems.APPLE_JUICE, new ItemStack(Material.SUGAR), null, null, null, null, null, null, null}, - new CustomItem(SlimefunItems.CHRISTMAS_APPLE_CIDER, 2)) + new SlimefunItemStack(SlimefunItems.CHRISTMAS_APPLE_CIDER, 2)) .register(plugin); new SlimefunItem(categories.christmas, SlimefunItems.CHRISTMAS_COOKIE, RecipeType.ENHANCED_CRAFTING_TABLE, new ItemStack[] {new ItemStack(Material.COOKIE), new ItemStack(Material.SUGAR), new ItemStack(Material.LIME_DYE), null, null, null, null, null, null}, - new CustomItem(SlimefunItems.CHRISTMAS_COOKIE, 16)) + new SlimefunItemStack(SlimefunItems.CHRISTMAS_COOKIE, 16)) .register(plugin); new SlimefunItem(categories.christmas, SlimefunItems.CHRISTMAS_FRUIT_CAKE, RecipeType.ENHANCED_CRAFTING_TABLE, new ItemStack[] {new ItemStack(Material.EGG), new ItemStack(Material.APPLE), new ItemStack(Material.MELON), new ItemStack(Material.SUGAR), null, null, null, null, null}, - new CustomItem(SlimefunItems.CHRISTMAS_FRUIT_CAKE, 4)) + new SlimefunItemStack(SlimefunItems.CHRISTMAS_FRUIT_CAKE, 4)) .register(plugin); new SlimefunItem(categories.christmas, SlimefunItems.CHRISTMAS_APPLE_PIE, RecipeType.ENHANCED_CRAFTING_TABLE, new ItemStack[] {new ItemStack(Material.SUGAR), new ItemStack(Material.APPLE), new ItemStack(Material.EGG), null, null, null, null, null, null}, - new CustomItem(SlimefunItems.CHRISTMAS_APPLE_PIE, 2)) + new SlimefunItemStack(SlimefunItems.CHRISTMAS_APPLE_PIE, 2)) .register(plugin); - new SlimefunItem(categories.christmas, SlimefunItems.CHRISTMAS_HOT_CHOCOLATE, RecipeType.SMELTERY, + new Juice(categories.christmas, SlimefunItems.CHRISTMAS_HOT_CHOCOLATE, RecipeType.SMELTERY, new ItemStack[] {SlimefunItems.CHRISTMAS_CHOCOLATE_MILK, null, null, null, null, null, null, null, null}, SlimefunItems.CHRISTMAS_HOT_CHOCOLATE) .register(plugin); new SlimefunItem(categories.christmas, SlimefunItems.CHRISTMAS_CAKE, RecipeType.ENHANCED_CRAFTING_TABLE, new ItemStack[] {new ItemStack(Material.EGG), new ItemStack(Material.SUGAR), SlimefunItems.WHEAT_FLOUR, new ItemStack(Material.MILK_BUCKET), null, null, null, null, null}, - new CustomItem(SlimefunItems.CHRISTMAS_CAKE, 4)) + new SlimefunItemStack(SlimefunItems.CHRISTMAS_CAKE, 4)) .register(plugin); new SlimefunItem(categories.christmas, SlimefunItems.CHRISTMAS_CARAMEL, RecipeType.SMELTERY, new ItemStack[] {new ItemStack(Material.SUGAR), new ItemStack(Material.SUGAR), null, null, null, null, null, null, null}, - new CustomItem(SlimefunItems.CHRISTMAS_CARAMEL, 4)) + new SlimefunItemStack(SlimefunItems.CHRISTMAS_CARAMEL, 4)) .register(plugin); new SlimefunItem(categories.christmas, SlimefunItems.CHRISTMAS_CARAMEL_APPLE, RecipeType.ENHANCED_CRAFTING_TABLE, new ItemStack[] {null, SlimefunItems.CHRISTMAS_CARAMEL, null, null, new ItemStack(Material.APPLE), null, null, new ItemStack(Material.STICK), null}, - new CustomItem(SlimefunItems.CHRISTMAS_CARAMEL_APPLE, 2)) + new SlimefunItemStack(SlimefunItems.CHRISTMAS_CARAMEL_APPLE, 2)) .register(plugin); new SlimefunItem(categories.christmas, SlimefunItems.CHRISTMAS_CHOCOLATE_APPLE, RecipeType.ENHANCED_CRAFTING_TABLE, new ItemStack[] {null, new ItemStack(Material.COCOA_BEANS), null, null, new ItemStack(Material.APPLE), null, null, new ItemStack(Material.STICK), null}, - new CustomItem(SlimefunItems.CHRISTMAS_CHOCOLATE_APPLE, 2)) + new SlimefunItemStack(SlimefunItems.CHRISTMAS_CHOCOLATE_APPLE, 2)) .register(plugin); new ChristmasPresent(categories.christmas, SlimefunItems.CHRISTMAS_PRESENT, RecipeType.MAGIC_WORKBENCH, new ItemStack[] {null, new ItemStack(Material.NAME_TAG), null, new ItemStack(Material.RED_WOOL), new ItemStack(Material.GREEN_WOOL), new ItemStack(Material.RED_WOOL), new ItemStack(Material.RED_WOOL), new ItemStack(Material.GREEN_WOOL), new ItemStack(Material.RED_WOOL)}, - new CustomItem(SlimefunItems.CHRISTMAS_HOT_CHOCOLATE, 1), - new CustomItem(SlimefunItems.CHRISTMAS_CHOCOLATE_APPLE, 4), - new CustomItem(SlimefunItems.CHRISTMAS_CARAMEL_APPLE, 4), - new CustomItem(SlimefunItems.CHRISTMAS_CAKE, 4), - new CustomItem(SlimefunItems.CHRISTMAS_COOKIE, 8), - new CustomItem(SlimefunItems.CHRISTMAS_PRESENT, 1), - new CustomItem(SlimefunItems.CHRISTMAS_EGG_NOG, 1), - new CustomItem(SlimefunItems.CHRISTMAS_MILK, 1), - new CustomItem(SlimefunItems.CHRISTMAS_APPLE_CIDER, 1), - new CustomItem(SlimefunItems.CHRISTMAS_FRUIT_CAKE, 4), - new CustomItem(SlimefunItems.CHRISTMAS_APPLE_PIE, 4), + new SlimefunItemStack(SlimefunItems.CHRISTMAS_HOT_CHOCOLATE, 1), + new SlimefunItemStack(SlimefunItems.CHRISTMAS_CHOCOLATE_APPLE, 4), + new SlimefunItemStack(SlimefunItems.CHRISTMAS_CARAMEL_APPLE, 4), + new SlimefunItemStack(SlimefunItems.CHRISTMAS_CAKE, 4), + new SlimefunItemStack(SlimefunItems.CHRISTMAS_COOKIE, 8), + new SlimefunItemStack(SlimefunItems.CHRISTMAS_PRESENT, 1), + new SlimefunItemStack(SlimefunItems.CHRISTMAS_EGG_NOG, 1), + new SlimefunItemStack(SlimefunItems.CHRISTMAS_MILK, 1), + new SlimefunItemStack(SlimefunItems.CHRISTMAS_APPLE_CIDER, 1), + new SlimefunItemStack(SlimefunItems.CHRISTMAS_FRUIT_CAKE, 4), + new SlimefunItemStack(SlimefunItems.CHRISTMAS_APPLE_PIE, 4), new ItemStack(Material.EMERALD) ).register(plugin); new SlimefunItem(categories.easter, SlimefunItems.EASTER_CARROT_PIE, RecipeType.ENHANCED_CRAFTING_TABLE, new ItemStack[] {new ItemStack(Material.SUGAR), new ItemStack(Material.CARROT), new ItemStack(Material.EGG), null, null, null, null, null, null}, - new CustomItem(SlimefunItems.EASTER_CARROT_PIE, 2)) + new SlimefunItemStack(SlimefunItems.EASTER_CARROT_PIE, 2)) .register(plugin); new SlimefunItem(categories.easter, SlimefunItems.EASTER_APPLE_PIE, RecipeType.ENHANCED_CRAFTING_TABLE, new ItemStack[] {new ItemStack(Material.SUGAR), new ItemStack(Material.APPLE), new ItemStack(Material.EGG), null, null, null, null, null, null}, - new CustomItem(SlimefunItems.CHRISTMAS_APPLE_PIE, 2)) + new SlimefunItemStack(SlimefunItems.CHRISTMAS_APPLE_PIE, 2)) .register(plugin); new EasterEgg(categories.easter, SlimefunItems.EASTER_EGG, RecipeType.ENHANCED_CRAFTING_TABLE, new ItemStack[] {null, null, null, new ItemStack(Material.LIME_DYE), new ItemStack(Material.EGG), new ItemStack(Material.PURPLE_DYE), null, null, null}, - new CustomItem(SlimefunItems.EASTER_EGG, 2), + new SlimefunItemStack(SlimefunItems.EASTER_EGG, 2), // Gifts: - new CustomItem(SlimefunItems.EASTER_CARROT_PIE, 4), - new CustomItem(SlimefunItems.CARROT_JUICE, 1), + new SlimefunItemStack(SlimefunItems.EASTER_CARROT_PIE, 4), + new SlimefunItemStack(SlimefunItems.CARROT_JUICE, 1), new ItemStack(Material.EMERALD), new ItemStack(Material.CAKE), new ItemStack(Material.RABBIT_FOOT), @@ -1448,12 +1448,12 @@ public final class SlimefunItemSetup { ).register(plugin); new SlimefunItem(categories.misc, SlimefunItems.REINFORCED_PLATE, RecipeType.COMPRESSOR, - new ItemStack[] {new CustomItem(SlimefunItems.REINFORCED_ALLOY_INGOT, 8), null, null, null, null, null, null, null, null}) + new ItemStack[] {new SlimefunItemStack(SlimefunItems.REINFORCED_ALLOY_INGOT, 8), null, null, null, null, null, null, null, null}) .register(plugin); new HardenedGlass(categories.technicalComponents, SlimefunItems.HARDENED_GLASS, RecipeType.ENHANCED_CRAFTING_TABLE, new ItemStack[] {new ItemStack(Material.GLASS), new ItemStack(Material.GLASS), new ItemStack(Material.GLASS), new ItemStack(Material.GLASS), SlimefunItems.REINFORCED_PLATE, new ItemStack(Material.GLASS), new ItemStack(Material.GLASS), new ItemStack(Material.GLASS), new ItemStack(Material.GLASS)}, - new CustomItem(SlimefunItems.HARDENED_GLASS, 16)) + new SlimefunItemStack(SlimefunItems.HARDENED_GLASS, 16)) .register(plugin); new SlimefunItem(categories.technicalComponents, SlimefunItems.COOLING_UNIT, RecipeType.ENHANCED_CRAFTING_TABLE, @@ -1466,12 +1466,12 @@ public final class SlimefunItemSetup { new WitherProofBlock(categories.technicalComponents, SlimefunItems.WITHER_PROOF_OBSIDIAN, RecipeType.ENHANCED_CRAFTING_TABLE, new ItemStack[] {SlimefunItems.LEAD_INGOT, new ItemStack(Material.OBSIDIAN), SlimefunItems.LEAD_INGOT, new ItemStack(Material.OBSIDIAN), SlimefunItems.HARDENED_GLASS, new ItemStack(Material.OBSIDIAN), SlimefunItems.LEAD_INGOT, new ItemStack(Material.OBSIDIAN), SlimefunItems.LEAD_INGOT}, - new CustomItem(SlimefunItems.WITHER_PROOF_OBSIDIAN, 4)) + new SlimefunItemStack(SlimefunItems.WITHER_PROOF_OBSIDIAN, 4)) .register(plugin); new AncientPedestal(categories.magicalResources, SlimefunItems.ANCIENT_PEDESTAL, RecipeType.MAGIC_WORKBENCH, new ItemStack[] {new ItemStack(Material.OBSIDIAN), SlimefunItems.GOLD_8K, new ItemStack(Material.OBSIDIAN), null, new ItemStack(Material.STONE), null, new ItemStack(Material.OBSIDIAN), SlimefunItems.GOLD_8K, new ItemStack(Material.OBSIDIAN)}, - new CustomItem(SlimefunItems.ANCIENT_PEDESTAL, 4)) + new SlimefunItemStack(SlimefunItems.ANCIENT_PEDESTAL, 4)) .register(plugin); new AncientAltar(categories.magicalGadgets, 8, SlimefunItems.ANCIENT_ALTAR, RecipeType.MAGIC_WORKBENCH, @@ -1484,7 +1484,7 @@ public final class SlimefunItemSetup { new SlimefunItem(categories.misc, SlimefunItems.DUCT_TAPE, RecipeType.ENHANCED_CRAFTING_TABLE, new ItemStack[] {SlimefunItems.ALUMINUM_DUST, SlimefunItems.ALUMINUM_DUST, SlimefunItems.ALUMINUM_DUST, new ItemStack(Material.SLIME_BALL), new ItemStack(Material.WHITE_WOOL), new ItemStack(Material.SLIME_BALL), new ItemStack(Material.PAPER), new ItemStack(Material.PAPER), new ItemStack(Material.PAPER)}, - new CustomItem(SlimefunItems.DUCT_TAPE, 2)) + new SlimefunItemStack(SlimefunItems.DUCT_TAPE, 2)) .register(plugin); new Capacitor(categories.electricity, 128, SlimefunItems.SMALL_CAPACITOR, RecipeType.ENHANCED_CRAFTING_TABLE, @@ -2411,32 +2411,32 @@ public final class SlimefunItemSetup { new SlimefunItem(categories.magicalResources, SlimefunItems.AIR_RUNE, RecipeType.ANCIENT_ALTAR, new ItemStack[] {new ItemStack(Material.FEATHER), SlimefunItems.MAGIC_LUMP_1, new ItemStack(Material.FEATHER), new ItemStack(Material.GHAST_TEAR), SlimefunItems.BLANK_RUNE, new ItemStack(Material.GHAST_TEAR), new ItemStack(Material.FEATHER), SlimefunItems.MAGIC_LUMP_1, new ItemStack(Material.FEATHER)}, - new CustomItem(SlimefunItems.AIR_RUNE, 4)) + new SlimefunItemStack(SlimefunItems.AIR_RUNE, 4)) .register(plugin); new SlimefunItem(categories.magicalResources, SlimefunItems.EARTH_RUNE, RecipeType.ANCIENT_ALTAR, new ItemStack[] {new ItemStack(Material.DIRT), SlimefunItems.MAGIC_LUMP_1, new ItemStack(Material.STONE), new ItemStack(Material.OBSIDIAN), SlimefunItems.BLANK_RUNE, new ItemStack(Material.OBSIDIAN), new ItemStack(Material.STONE), SlimefunItems.MAGIC_LUMP_1, new ItemStack(Material.DIRT)}, - new CustomItem(SlimefunItems.EARTH_RUNE, 4)) + new SlimefunItemStack(SlimefunItems.EARTH_RUNE, 4)) .register(plugin); new SlimefunItem(categories.magicalResources, SlimefunItems.FIRE_RUNE, RecipeType.ANCIENT_ALTAR, new ItemStack[] {new ItemStack(Material.FIRE_CHARGE), SlimefunItems.MAGIC_LUMP_2, new ItemStack(Material.FIRE_CHARGE), new ItemStack(Material.BLAZE_POWDER), SlimefunItems.EARTH_RUNE, new ItemStack(Material.FLINT_AND_STEEL), new ItemStack(Material.FIRE_CHARGE), SlimefunItems.MAGIC_LUMP_2, new ItemStack(Material.FIRE_CHARGE)}, - new CustomItem(SlimefunItems.FIRE_RUNE, 4)) + new SlimefunItemStack(SlimefunItems.FIRE_RUNE, 4)) .register(plugin); new SlimefunItem(categories.magicalResources, SlimefunItems.WATER_RUNE, RecipeType.ANCIENT_ALTAR, new ItemStack[] {new ItemStack(Material.SALMON), SlimefunItems.MAGIC_LUMP_2, new ItemStack(Material.WATER_BUCKET), new ItemStack(Material.SAND), SlimefunItems.BLANK_RUNE, new ItemStack(Material.SAND), new ItemStack(Material.WATER_BUCKET), SlimefunItems.MAGIC_LUMP_2, new ItemStack(Material.COD)}, - new CustomItem(SlimefunItems.WATER_RUNE, 4)) + new SlimefunItemStack(SlimefunItems.WATER_RUNE, 4)) .register(plugin); new SlimefunItem(categories.magicalResources, SlimefunItems.ENDER_RUNE, RecipeType.ANCIENT_ALTAR, new ItemStack[] {new ItemStack(Material.ENDER_PEARL), SlimefunItems.ENDER_LUMP_3, new ItemStack(Material.ENDER_PEARL), new ItemStack(Material.ENDER_EYE), SlimefunItems.BLANK_RUNE, new ItemStack(Material.ENDER_EYE), new ItemStack(Material.ENDER_PEARL), SlimefunItems.ENDER_LUMP_3, new ItemStack(Material.ENDER_PEARL)}, - new CustomItem(SlimefunItems.ENDER_RUNE, 6)) + new SlimefunItemStack(SlimefunItems.ENDER_RUNE, 6)) .register(plugin); new SlimefunItem(categories.magicalResources, SlimefunItems.LIGHTNING_RUNE, RecipeType.ANCIENT_ALTAR, new ItemStack[] {new ItemStack(Material.IRON_INGOT), SlimefunItems.MAGIC_LUMP_3, new ItemStack(Material.IRON_INGOT), SlimefunItems.AIR_RUNE, new ItemStack(Material.PHANTOM_MEMBRANE), SlimefunItems.WATER_RUNE, new ItemStack(Material.IRON_INGOT), SlimefunItems.MAGIC_LUMP_3, new ItemStack(Material.IRON_INGOT)}, - new CustomItem(SlimefunItems.LIGHTNING_RUNE, 4)) + new SlimefunItemStack(SlimefunItems.LIGHTNING_RUNE, 4)) .register(plugin); new SlimefunItem(categories.magicalResources, SlimefunItems.RAINBOW_RUNE, RecipeType.ANCIENT_ALTAR, @@ -2530,7 +2530,7 @@ public final class SlimefunItemSetup { 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 RainbowTickHandler(Material.RED_CONCRETE, Material.GREEN_CONCRETE)) + new SlimefunItemStack(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, @@ -2734,7 +2734,7 @@ public final class SlimefunItemSetup { new TeleporterPylon(categories.gps, SlimefunItems.GPS_TELEPORTER_PYLON, RecipeType.ENHANCED_CRAFTING_TABLE, new ItemStack[] {SlimefunItems.ZINC_INGOT, new ItemStack(Material.GLASS), SlimefunItems.ZINC_INGOT, new ItemStack(Material.GLASS), SlimefunItems.HEATING_COIL, new ItemStack(Material.GLASS), SlimefunItems.ZINC_INGOT, new ItemStack(Material.GLASS), SlimefunItems.ZINC_INGOT}, - new CustomItem(SlimefunItems.GPS_TELEPORTER_PYLON, 8)) + new SlimefunItemStack(SlimefunItems.GPS_TELEPORTER_PYLON, 8)) .register(plugin); new Teleporter(categories.gps, SlimefunItems.GPS_TELEPORTATION_MATRIX, RecipeType.ENHANCED_CRAFTING_TABLE, @@ -3056,7 +3056,7 @@ public final class SlimefunItemSetup { new SlimefunItem(categories.cargo, SlimefunItems.CARGO_MOTOR, RecipeType.ENHANCED_CRAFTING_TABLE, new ItemStack[] {SlimefunItems.HARDENED_GLASS, SlimefunItems.ELECTRO_MAGNET, SlimefunItems.HARDENED_GLASS, SlimefunItems.SILVER_INGOT, SlimefunItems.ELECTRIC_MOTOR, SlimefunItems.SILVER_INGOT, SlimefunItems.HARDENED_GLASS, SlimefunItems.ELECTRO_MAGNET, SlimefunItems.HARDENED_GLASS}, - new CustomItem(SlimefunItems.CARGO_MOTOR, 4)) + new SlimefunItemStack(SlimefunItems.CARGO_MOTOR, 4)) .register(plugin); new CargoManager(categories.cargo, SlimefunItems.CARGO_MANAGER, RecipeType.ENHANCED_CRAFTING_TABLE, @@ -3065,22 +3065,21 @@ public final class SlimefunItemSetup { new CargoConnectorNode(categories.cargo, SlimefunItems.CARGO_CONNECTOR_NODE, RecipeType.ENHANCED_CRAFTING_TABLE, new ItemStack[] {SlimefunItems.BRONZE_INGOT, SlimefunItems.SILVER_INGOT, SlimefunItems.BRONZE_INGOT, SlimefunItems.SILVER_INGOT, SlimefunItems.CARGO_MOTOR, SlimefunItems.SILVER_INGOT, SlimefunItems.BRONZE_INGOT, SlimefunItems.SILVER_INGOT, SlimefunItems.BRONZE_INGOT}, - new CustomItem(SlimefunItems.CARGO_CONNECTOR_NODE, 4)) + new SlimefunItemStack(SlimefunItems.CARGO_CONNECTOR_NODE, 4)) .register(plugin); new CargoInputNode(categories.cargo, SlimefunItems.CARGO_INPUT_NODE, RecipeType.ENHANCED_CRAFTING_TABLE, new ItemStack[] {null, new ItemStack(Material.HOPPER), null, SlimefunItems.BILLON_INGOT, SlimefunItems.CARGO_CONNECTOR_NODE, SlimefunItems.BILLON_INGOT, null, new ItemStack(Material.HOPPER), null}, - new CustomItem(SlimefunItems.CARGO_INPUT_NODE, 2)) + new SlimefunItemStack(SlimefunItems.CARGO_INPUT_NODE, 2)) .register(plugin); new CargoOutputNode(categories.cargo, SlimefunItems.CARGO_OUTPUT_NODE, RecipeType.ENHANCED_CRAFTING_TABLE, new ItemStack[] {null, new ItemStack(Material.HOPPER), null, SlimefunItems.BRASS_INGOT, SlimefunItems.CARGO_CONNECTOR_NODE, SlimefunItems.BRASS_INGOT, null, new ItemStack(Material.HOPPER), null}, - new CustomItem(SlimefunItems.CARGO_OUTPUT_NODE, 2)) + new SlimefunItemStack(SlimefunItems.CARGO_OUTPUT_NODE, 2)) .register(plugin); new AdvancedCargoOutputNode(categories.cargo, SlimefunItems.CARGO_OUTPUT_NODE_2, RecipeType.ENHANCED_CRAFTING_TABLE, - new ItemStack[] {null, SlimefunItems.CARGO_MOTOR, null, SlimefunItems.COBALT_INGOT, SlimefunItems.CARGO_OUTPUT_NODE, SlimefunItems.COBALT_INGOT, null, SlimefunItems.CARGO_MOTOR, null}, - new CustomItem(SlimefunItems.CARGO_OUTPUT_NODE_2)) + new ItemStack[] {null, SlimefunItems.CARGO_MOTOR, null, SlimefunItems.COBALT_INGOT, SlimefunItems.CARGO_OUTPUT_NODE, SlimefunItems.COBALT_INGOT, null, SlimefunItems.CARGO_MOTOR, null}) .register(plugin); new AutomatedCraftingChamber(categories.electricity, SlimefunItems.AUTOMATED_CRAFTING_CHAMBER, RecipeType.ENHANCED_CRAFTING_TABLE, From 090e58aff7464c36dd12623a48b81706d9d0c3fe Mon Sep 17 00:00:00 2001 From: TheBusyBiscuit Date: Thu, 6 Aug 2020 23:06:07 +0200 Subject: [PATCH 21/81] [CI skip] Added URL checker --- .github/workflows/url-checker.yml | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) create mode 100644 .github/workflows/url-checker.yml diff --git a/.github/workflows/url-checker.yml b/.github/workflows/url-checker.yml new file mode 100644 index 000000000..42d412aaa --- /dev/null +++ b/.github/workflows/url-checker.yml @@ -0,0 +1,23 @@ +name: URL Validator + +on: + push: + branches: + - master + pull_request: + branches: + - master + +jobs: + build: + + name: URL Checker + runs-on: ubuntu-latest + + steps: + - name: URLs-checker + uses: SuperKogito/URLs-checker@0.2.1 + with: + git_path: https://github.com/TheBusyBiscuit/Slimefun4 + file_types: .md,.java,.yml + print_all: False From c350d5694fbe53a03e74debe8536b240f7f0d097 Mon Sep 17 00:00:00 2001 From: TheBusyBiscuit Date: Thu, 6 Aug 2020 23:14:29 +0200 Subject: [PATCH 22/81] [CI skip] Updated CONTRIBUTING.md --- .github/CONTRIBUTING.md | 31 ++++--------------------------- 1 file changed, 4 insertions(+), 27 deletions(-) diff --git a/.github/CONTRIBUTING.md b/.github/CONTRIBUTING.md index 0a39c543a..75f383ea7 100644 --- a/.github/CONTRIBUTING.md +++ b/.github/CONTRIBUTING.md @@ -17,13 +17,13 @@ Rules for all types of posts: Rules for posting an Issue on GitHub: 1. This Issue Section is ONLY for Slimefun-related Issues, Issues about other Plugins or Slimefun Addons should not be posted here. -2. Please consult our [Troubleshooting Guide](#troubleshooting-guide) before posting. +2. Please consult our [Troubleshooting Guide](https://github.com/TheBusyBiscuit/Slimefun4/wiki/How-to-report-bugs) before posting. 3. Check other Issues before posting to make sure you are not posting a duplicate. -4. Do not put any Tags inside your title like [IMPORTANT], [URGENT] or [SUGGESTION]. Try to be professional by making your title as short as possible, we will assign it the required labels if necessary. -5. Do not post your Issue more than once, this is considered spam and does not benefit our community in any way. Do not repost your Issue if it was closed either. +4. Please do not put any Tags inside your title like [IMPORTANT], [URGENT] or [SUGGESTION]. Try to be professional by making your title as short as possible, we will assign it the required labels if necessary. +5. Do not post your Issue more than once, this is considered spam and does not benefit our community in any way. Do not repost your Issue if it was closed either, just leave a comment stating that the issue has still persisted and give more context on it. 6. Give us all available information right away, it may be a bit of time-wasting for us to keep asking for more Info. And this includes any Information to reproduce your Issue step-by-step. 7. Check whether there are newer versions available than the ones you are using, it might be that your Issue has been fixed already. -8. All text logs must be posted via a link to http://pastebin.com or similiar websites. +8. All text logs must be posted via a link to https://pastebin.com or similiar websites, long logs are very hard to read and get weirdly formatted when you post them on here. Using a proper pasting site allows us to keep things clean and easy to read. Your Issue will be CLOSED WITHOUT WARNING if we think you violated these Rules. @@ -35,26 +35,3 @@ Guidelines for making a Pull Request on GitHub: 2. Try to make your values configurable in the config.yml / Items.yml or any additional file. This may not be necessary at every instance but it does give the end-users a way to customize their experience. 3. If your Pull Request is made in response to an Issue opened on GitHub, comment on that Issue and reference your Pull Request to show that you are proposing a fix for it. 4. Name your commits appropriately. Standards like "Add files via upload" or "Update Readme.md" are lame. Make sure that the commit message stands for it's changes. (e.g. "Fixed Furnaces duplicating Items") - -## Troubleshooting Guide - -### Step 1: Check whether you have installed Slimefun correctly -Slimefun requires [CS-CoreLib](http://dev.bukkit.org/bukkit-plugins/cs-corelib) to run. -If it has not been installed automatically for you, then please download & install it manually. - -### Step 2: Check whether you are running on the latest Versions -Both, [Slimefun](http://dev.bukkit.org/bukkit-plugins/slimefun/files) and [CS-CoreLib](http://dev.bukkit.org/bukkit-plugins/cs-corelib/files) are updated from time to time. -You should be sure that you run the latest Versions (at the time you post your Issue) of both Plugins. - -### Step 3: Does it have to do with Items called 'CS-CoreLib's Head'? -Well in that case, you have been the victim of corruption, unless you have an Error/Crash Report that we can work with, there is literally nothing we can do about it. -Corrupting Files/Data can happen from time to time and getting completely rid of it would require a ton of work and even then it is still not completely impossible to occur. - -### Step 4: Do you get an Error, do you have an Error Report? -Check your /plugins/Slimefun/error-reports/ directory and if it contains any Files, then please upload those to http://pastebin.com -and provide us with a link. - -When providing us Errors from your Server Log MAKE SURE THEY ARE ERRORS. -It has happened more often than you may think that people send us messages. -Try to read the suspected 'Error' before uploading it to http://pastebin.com -If it says "Please install CS-CoreLib", then you may want to rethink whether you want to ask us what it means... From a2c84941a595f8e1c5d2641bbe85d948ec4f875f Mon Sep 17 00:00:00 2001 From: TheBusyBiscuit Date: Thu, 6 Aug 2020 23:15:40 +0200 Subject: [PATCH 23/81] [CI skip] Fixed link in README --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index e37c9a7be..32995cc88 100644 --- a/README.md +++ b/README.md @@ -192,5 +192,5 @@ This information includes (but is not limited to) * date of the last commit to this repository -Additionally the plugin connects to https://mojang.com/ to retrieve the Minecraft skins of our contributors (if possible).
+Additionally the plugin connects to https://www.minecraft.net/ to retrieve the Minecraft skins of our contributors (if possible).
Note that Slimefun is not associated with `Mojang Studios` or Minecraft. From 48bfc3710b957428d13638787fc6f1b269068c9d Mon Sep 17 00:00:00 2001 From: TheBusyBiscuit Date: Thu, 6 Aug 2020 23:19:15 +0200 Subject: [PATCH 24/81] [CI skip] Updated link in README again --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 32995cc88..94aabee21 100644 --- a/README.md +++ b/README.md @@ -192,5 +192,5 @@ This information includes (but is not limited to) * date of the last commit to this repository -Additionally the plugin connects to https://www.minecraft.net/ to retrieve the Minecraft skins of our contributors (if possible).
+Additionally the plugin connects to [textures.minecraft.net](https://www.minecraft.net/en-us) to retrieve the Minecraft skins of our contributors (if possible).
Note that Slimefun is not associated with `Mojang Studios` or Minecraft. From 9de72881ab8f91c3089764966c205003288afb6d Mon Sep 17 00:00:00 2001 From: TheBusyBiscuit Date: Fri, 7 Aug 2020 00:31:09 +0200 Subject: [PATCH 25/81] [CI skip] Fixed some URLs --- .github/workflows/url-checker.yml | 3 ++- .../slimefun4/core/services/MetricsService.java | 10 ++++++---- .../core/services/github/GitHubConnector.java | 4 +++- 3 files changed, 11 insertions(+), 6 deletions(-) diff --git a/.github/workflows/url-checker.yml b/.github/workflows/url-checker.yml index 42d412aaa..31ce5c910 100644 --- a/.github/workflows/url-checker.yml +++ b/.github/workflows/url-checker.yml @@ -15,9 +15,10 @@ jobs: runs-on: ubuntu-latest steps: - - name: URLs-checker + - name: URL-checker uses: SuperKogito/URLs-checker@0.2.1 with: git_path: https://github.com/TheBusyBiscuit/Slimefun4 file_types: .md,.java,.yml print_all: False + white_listed_patterns: http://textures.minecraft.net/texture/ diff --git a/src/main/java/io/github/thebusybiscuit/slimefun4/core/services/MetricsService.java b/src/main/java/io/github/thebusybiscuit/slimefun4/core/services/MetricsService.java index 9b00e302c..930cede84 100644 --- a/src/main/java/io/github/thebusybiscuit/slimefun4/core/services/MetricsService.java +++ b/src/main/java/io/github/thebusybiscuit/slimefun4/core/services/MetricsService.java @@ -32,9 +32,11 @@ import org.bukkit.plugin.Plugin; */ public class MetricsService { + + private static final String API_URL = "https://api.github.com/"; private static final String REPO_NAME = "MetricsModule"; - private static final String GH_API = "https://api.github.com/repos/Slimefun/" + REPO_NAME; - private static final String GH_RELEASES = "https://github.com/Slimefun/" + REPO_NAME + "/releases/download"; + private static final String RELEASES_URL = API_URL + "repos/Slimefun/" + REPO_NAME + "/releases/latest"; + private static final String DOWNLOAD_URL = "https://github.com/Slimefun/" + REPO_NAME + "/releases/download"; private final SlimefunPlugin plugin; private final File parentFolder; @@ -160,7 +162,7 @@ public class MetricsService { */ private int getLatestVersion() { try { - HttpResponse response = Unirest.get(GH_API + "/releases/latest").asJson(); + HttpResponse response = Unirest.get(RELEASES_URL).asJson(); if (!response.isSuccess()) { return -1; @@ -198,7 +200,7 @@ public class MetricsService { } AtomicInteger lastPercentPosted = new AtomicInteger(); - GetRequest request = Unirest.get(GH_RELEASES + "/" + version + "/" + REPO_NAME + ".jar"); + GetRequest request = Unirest.get(DOWNLOAD_URL + "/" + version + "/" + REPO_NAME + ".jar"); HttpResponse response = request.downloadMonitor((b, fileName, bytesWritten, totalBytes) -> { int percent = (int) (20 * (Math.round((((double) bytesWritten / totalBytes) * 100) / 20))); 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 cdf77ef0c..922355172 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 @@ -17,6 +17,8 @@ import kong.unirest.json.JSONException; import me.mrCookieSlime.Slimefun.api.Slimefun; abstract class GitHubConnector { + + private static final String API_URL = "https://api.github.com/"; protected File file; protected String repository; @@ -45,7 +47,7 @@ abstract class GitHubConnector { } try { - HttpResponse resp = Unirest.get("https://api.github.com/repos/" + repository + getURLSuffix()) + HttpResponse resp = Unirest.get(API_URL + "repos/" + repository + getURLSuffix()) .header("User-Agent", "Slimefun4 (https://github.com/Slimefun)") .asJson(); From 1fde84a4c7c0d2c0872dce867349e57ec38a5ee3 Mon Sep 17 00:00:00 2001 From: dniym Date: Thu, 6 Aug 2020 21:08:59 -0400 Subject: [PATCH 26/81] Approved Suggestion #272 - AutoBio#8746 --- .../implementation/items/electric/machines/ElectricPress.java | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) 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 94a1c3858..a945983cc 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 @@ -48,7 +48,9 @@ public abstract class ElectricPress extends AContainer implements RecipeDisplayI addRecipe(4, new ItemStack(Material.IRON_NUGGET, 9), new ItemStack(Material.IRON_INGOT)); addRecipe(4, new ItemStack(Material.GOLD_NUGGET, 9), new ItemStack(Material.GOLD_INGOT)); addRecipe(4, new ItemStack(Material.COAL, 9), new ItemStack(Material.COAL_BLOCK)); - + addRecipe(4, new ItemStack(Material.SAND, 4), new ItemStack(Material.SANDSTONE)); + addRecipe(4, new ItemStack(Material.RED_SAND, 4), new ItemStack(Material.RED_SANDSTONE)); + addRecipe(5, new ItemStack(Material.IRON_INGOT, 9), new ItemStack(Material.IRON_BLOCK)); addRecipe(5, new ItemStack(Material.GOLD_INGOT, 9), new ItemStack(Material.GOLD_BLOCK)); From 99d07c42e52c623e3470d12fa8019ec276f91024 Mon Sep 17 00:00:00 2001 From: TheBusyBiscuit Date: Fri, 7 Aug 2020 19:05:51 +0200 Subject: [PATCH 27/81] [CI skip] Update MockBukkit --- pom.xml | 14 ++++++++++++-- .../items/implementations/food/TestDietCookie.java | 2 -- .../implementations/food/TestMonsterJerky.java | 2 -- .../tests/listeners/TestSoulboundListener.java | 3 ++- 4 files changed, 14 insertions(+), 7 deletions(-) diff --git a/pom.xml b/pom.xml index b59367211..11892434e 100644 --- a/pom.xml +++ b/pom.xml @@ -47,6 +47,16 @@ + + sonatype-snapshots + http://oss.sonatype.org/content/repositories/snapshots + + false + + + true + + jitpack.io https://jitpack.io @@ -303,8 +313,8 @@ com.github.seeseemelk - MockBukkit - v1.15-d952559324-1 + MockBukkit-v1.15 + 0.3.1-SNAPSHOT test 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 4bcdb086a..f7e9336e3 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 @@ -7,7 +7,6 @@ import org.bukkit.potion.PotionEffectType; import org.junit.jupiter.api.AfterAll; import org.junit.jupiter.api.Assertions; import org.junit.jupiter.api.BeforeAll; -import org.junit.jupiter.api.Disabled; import org.junit.jupiter.api.Test; import be.seeseemelk.mockbukkit.MockBukkit; @@ -45,7 +44,6 @@ public class TestDietCookie implements SlimefunItemTest { } @Test - @Disabled("Potion Effects are currently not fully implemented in MockBukkit") public void testConsumptionBehaviour() { PlayerMock player = server.addPlayer(); DietCookie cookie = registerSlimefunItem(plugin, "TEST_DIET_COOKIE"); 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 c8752a782..0002be40d 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 @@ -6,7 +6,6 @@ import org.bukkit.potion.PotionEffectType; import org.junit.jupiter.api.AfterAll; import org.junit.jupiter.api.Assertions; import org.junit.jupiter.api.BeforeAll; -import org.junit.jupiter.api.Disabled; import org.junit.jupiter.api.Test; import be.seeseemelk.mockbukkit.MockBukkit; @@ -44,7 +43,6 @@ public class TestMonsterJerky implements SlimefunItemTest { } @Test - @Disabled("Potion Effects are currently not fully implemented in MockBukkit") public void testConsumptionBehaviour() { PlayerMock player = server.addPlayer(); player.addPotionEffect(PotionEffectType.HUNGER.createEffect(20, 2)); 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 9e97bc095..4d2aec92c 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 @@ -59,7 +59,8 @@ public class TestSoulboundListener { player.respawn(); server.getPluginManager().assertEventFired(PlayerRespawnEvent.class, event -> { - return player.getInventory().getItem(6).isSimilar(item) == soulbound; + ItemStack stack = player.getInventory().getItem(6); + return SlimefunUtils.isItemSimilar(stack, item, true) == soulbound; }); } From 5002533a6547f3dc73e64c90e58e5c4d088e5287 Mon Sep 17 00:00:00 2001 From: TheBusyBiscuit Date: Fri, 7 Aug 2020 19:21:12 +0200 Subject: [PATCH 28/81] [CI skip] Updated change log --- CHANGELOG.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index be7801f58..d7b4c1c87 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -29,6 +29,8 @@ * (API) Added support for adding custom Piglin Barter drops * (API) Added BlockPlacerPlaceEvent * (API) Added ToolUseHandler +* Added "Sand -> Sandstone" recipe to the Electric Press +* Added "Red Sand -> Red Sandstone" recipe to the Electric Press #### Changes * Performance improvement for Programmable Android rotations From 87f8e7ae8c9b185ab7b904d44b4e43c6f0cc8f31 Mon Sep 17 00:00:00 2001 From: poma123 <25465545+poma123@users.noreply.github.com> Date: Fri, 7 Aug 2020 21:46:59 +0200 Subject: [PATCH 29/81] Fixed Industrial Miner debris issue --- .../implementation/items/multiblocks/miner/IndustrialMiner.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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 8dba2f29e..d89e761eb 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 @@ -212,7 +212,7 @@ public class IndustrialMiner extends MultiBlockMachine { * @return Whether this {@link IndustrialMiner} is capable of mining this {@link Material} */ public boolean canMine(Material type) { - return type.name().endsWith("_ORE") || (type == Material.ANCIENT_DEBRIS && canMineAncientDebris.getValue()); + return type.name().endsWith("_ORE") || (type.name().equals("ANCIENT_DEBRIS") && canMineAncientDebris.getValue()); } } From 6ab196a03dc161e8b22bba1052ca25a7161f552d Mon Sep 17 00:00:00 2001 From: poma123 <25465545+poma123@users.noreply.github.com> Date: Fri, 7 Aug 2020 22:04:15 +0200 Subject: [PATCH 30/81] Requested changes --- .../implementation/items/multiblocks/miner/IndustrialMiner.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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 d89e761eb..689009e4d 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 @@ -212,7 +212,7 @@ public class IndustrialMiner extends MultiBlockMachine { * @return Whether this {@link IndustrialMiner} is capable of mining this {@link Material} */ public boolean canMine(Material type) { - return type.name().endsWith("_ORE") || (type.name().equals("ANCIENT_DEBRIS") && canMineAncientDebris.getValue()); + return type.name().endsWith("_ORE") || (SlimefunPlugin.getMinecraftVersion().isAtLeast(MinecraftVersion.MINECRAFT_1_16) && type == Material.ANCIENT_DEBRIS && canMineAncientDebris.getValue()); } } From c2fa590aa15d60d5196bce49169dfcf17f7e5091 Mon Sep 17 00:00:00 2001 From: poma123 <25465545+poma123@users.noreply.github.com> Date: Fri, 7 Aug 2020 22:43:58 +0200 Subject: [PATCH 31/81] Requested changes --- .../items/multiblocks/miner/IndustrialMiner.java | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) 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 689009e4d..321d18502 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 @@ -212,7 +212,15 @@ public class IndustrialMiner extends MultiBlockMachine { * @return Whether this {@link IndustrialMiner} is capable of mining this {@link Material} */ public boolean canMine(Material type) { - return type.name().endsWith("_ORE") || (SlimefunPlugin.getMinecraftVersion().isAtLeast(MinecraftVersion.MINECRAFT_1_16) && type == Material.ANCIENT_DEBRIS && canMineAncientDebris.getValue()); + if (type.name().endsWith("_ORE")) { + return true; + } + else if (SlimefunPlugin.getMinecraftVersion().isAtLeast(MinecraftVersion.MINECRAFT_1_16)) { + return type == Material.ANCIENT_DEBRIS && canMineAncientDebris.getValue(); + } + else { + return false; + } } } From 3e6a9594b5a35c324e8507c4d985e1a947f9a5f5 Mon Sep 17 00:00:00 2001 From: TheBusyBiscuit Date: Sat, 8 Aug 2020 00:09:28 +0200 Subject: [PATCH 32/81] [CI skip] Updated changelog --- CHANGELOG.md | 1 + 1 file changed, 1 insertion(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index d7b4c1c87..d1f288f74 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -55,6 +55,7 @@ * Fixed #2180 * Fixed #2122 * Fixed #2168 +* Fixed #2203 ## Release Candidate 15 (01 Aug 2020) From aab0b5a45c71c5b21d7d346b5d962c84e74f68a0 Mon Sep 17 00:00:00 2001 From: TheBusyBiscuit Date: Sat, 8 Aug 2020 00:12:23 +0200 Subject: [PATCH 33/81] [CI skip] Unified a link --- .github/CONTRIBUTING.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/CONTRIBUTING.md b/.github/CONTRIBUTING.md index 75f383ea7..92af0675b 100644 --- a/.github/CONTRIBUTING.md +++ b/.github/CONTRIBUTING.md @@ -23,7 +23,7 @@ Rules for posting an Issue on GitHub: 5. Do not post your Issue more than once, this is considered spam and does not benefit our community in any way. Do not repost your Issue if it was closed either, just leave a comment stating that the issue has still persisted and give more context on it. 6. Give us all available information right away, it may be a bit of time-wasting for us to keep asking for more Info. And this includes any Information to reproduce your Issue step-by-step. 7. Check whether there are newer versions available than the ones you are using, it might be that your Issue has been fixed already. -8. All text logs must be posted via a link to https://pastebin.com or similiar websites, long logs are very hard to read and get weirdly formatted when you post them on here. Using a proper pasting site allows us to keep things clean and easy to read. +8. All text logs must be posted via a link to https://pastebin.com/ or similiar websites, long logs are very hard to read and get weirdly formatted when you post them on here. Using a proper pasting site allows us to keep things clean and easy to read. Your Issue will be CLOSED WITHOUT WARNING if we think you violated these Rules. From b0497bbee6441b759e23bf07ac5d2001447d8982 Mon Sep 17 00:00:00 2001 From: TheBusyBiscuit Date: Sat, 8 Aug 2020 00:12:39 +0200 Subject: [PATCH 34/81] [CI skip] Updated a workflow --- .github/workflows/url-checker.yml | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/.github/workflows/url-checker.yml b/.github/workflows/url-checker.yml index 31ce5c910..0b82a5aa5 100644 --- a/.github/workflows/url-checker.yml +++ b/.github/workflows/url-checker.yml @@ -21,4 +21,6 @@ jobs: git_path: https://github.com/TheBusyBiscuit/Slimefun4 file_types: .md,.java,.yml print_all: False - white_listed_patterns: http://textures.minecraft.net/texture/ + retry_count: 2 + ## These URLs will always be correct, even if their services may be offline right now + white_listed_patterns: http://textures.minecraft.net/texture/,https://pastebin.com/ From bffbb488bad5fed8c096c1a84a7e4c4096f2d589 Mon Sep 17 00:00:00 2001 From: TheBusyBiscuit Date: Sat, 8 Aug 2020 00:45:01 +0200 Subject: [PATCH 35/81] [CI skip] Added Unit Tests for Piglins --- .../slimefun4/api/ErrorReport.java | 2 +- .../listeners/PiglinListener.java | 56 ++++----- .../tests/listeners/TestPiglinListener.java | 109 ++++++++++++++++++ 3 files changed, 138 insertions(+), 29 deletions(-) create mode 100644 src/test/java/io/github/thebusybiscuit/slimefun4/testing/tests/listeners/TestPiglinListener.java diff --git a/src/main/java/io/github/thebusybiscuit/slimefun4/api/ErrorReport.java b/src/main/java/io/github/thebusybiscuit/slimefun4/api/ErrorReport.java index 4297e2223..462c77064 100644 --- a/src/main/java/io/github/thebusybiscuit/slimefun4/api/ErrorReport.java +++ b/src/main/java/io/github/thebusybiscuit/slimefun4/api/ErrorReport.java @@ -84,7 +84,7 @@ public class ErrorReport { addon.getLogger().log(Level.WARNING, ""); 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)."); + addon.getLogger().log(Level.WARNING, "Please put this file on https://pastebin.com/ and report this to the developer(s)."); if (addon.getBugTrackerURL() != null) { addon.getLogger().log(Level.WARNING, "Bug Tracker: {0}", addon.getBugTrackerURL()); diff --git a/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/listeners/PiglinListener.java b/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/listeners/PiglinListener.java index 1e5e34f91..c5f68cfd7 100644 --- a/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/listeners/PiglinListener.java +++ b/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/listeners/PiglinListener.java @@ -36,7 +36,7 @@ public class PiglinListener implements Listener { } @EventHandler - public void onEntityPickup(EntityPickupItemEvent e) { + public void onPickup(EntityPickupItemEvent e) { if (e.getEntityType() == EntityType.PIGLIN) { ItemStack item = e.getItem().getItemStack(); @@ -47,6 +47,33 @@ public class PiglinListener implements Listener { } } + @EventHandler + public void onInteract(PlayerInteractEntityEvent e) { + if (!e.getRightClicked().isValid() || e.getRightClicked().getType() != EntityType.PIGLIN) { + return; + } + + Player p = e.getPlayer(); + ItemStack item; + + if (e.getHand() == EquipmentSlot.OFF_HAND) { + item = p.getInventory().getItemInOffHand(); + } + else { + item = p.getInventory().getItemInMainHand(); + } + + // We only care about Gold since it's the actual "Bartering" we wanna prevent + if (item.getType() == Material.GOLD_INGOT) { + SlimefunItem sfItem = SlimefunItem.getByItem(item); + + if (sfItem != null) { + SlimefunPlugin.getLocalization().sendMessage(p, "messages.piglin-barter", true); + e.setCancelled(true); + } + } + } + @EventHandler public void onPiglinDropItem(EntityDropItemEvent e) { if (e.getEntity() instanceof Piglin) { @@ -76,31 +103,4 @@ public class PiglinListener implements Listener { } } } - - @EventHandler - public void onInteractEntity(PlayerInteractEntityEvent e) { - if (!e.getRightClicked().isValid() || e.getRightClicked().getType() != EntityType.PIGLIN) { - return; - } - - Player p = e.getPlayer(); - ItemStack item; - - if (e.getHand() == EquipmentSlot.OFF_HAND) { - item = p.getInventory().getItemInOffHand(); - } - else { - item = p.getInventory().getItemInMainHand(); - } - - // We only care about Gold since it's the actual "Bartering" we wanna prevent - if (item.getType() == Material.GOLD_INGOT) { - SlimefunItem sfItem = SlimefunItem.getByItem(item); - - if (sfItem != null) { - SlimefunPlugin.getLocalization().sendMessage(p, "messages.piglin-barter", true); - e.setCancelled(true); - } - } - } } diff --git a/src/test/java/io/github/thebusybiscuit/slimefun4/testing/tests/listeners/TestPiglinListener.java b/src/test/java/io/github/thebusybiscuit/slimefun4/testing/tests/listeners/TestPiglinListener.java new file mode 100644 index 000000000..161d2d1cc --- /dev/null +++ b/src/test/java/io/github/thebusybiscuit/slimefun4/testing/tests/listeners/TestPiglinListener.java @@ -0,0 +1,109 @@ +package io.github.thebusybiscuit.slimefun4.testing.tests.listeners; + +import org.bukkit.Material; +import org.bukkit.entity.EntityType; +import org.bukkit.entity.Item; +import org.bukkit.entity.Piglin; +import org.bukkit.entity.Player; +import org.bukkit.event.entity.EntityPickupItemEvent; +import org.bukkit.event.player.PlayerInteractEntityEvent; +import org.bukkit.inventory.EquipmentSlot; +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 org.junit.jupiter.params.ParameterizedTest; +import org.junit.jupiter.params.provider.EnumSource; +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.listeners.PiglinListener; +import io.github.thebusybiscuit.slimefun4.testing.TestUtilities; +import me.mrCookieSlime.Slimefun.Objects.SlimefunItem.SlimefunItem; + +class TestPiglinListener { + + private static SlimefunPlugin plugin; + private static PiglinListener listener; + private static ServerMock server; + + @BeforeAll + public static void load() { + server = MockBukkit.mock(); + plugin = MockBukkit.load(SlimefunPlugin.class); + listener = new PiglinListener(plugin); + } + + @AfterAll + public static void unload() { + MockBukkit.unmock(); + } + + private EntityPickupItemEvent createPickupEvent(ItemStack item) { + Piglin piglin = Mockito.mock(Piglin.class); + Mockito.when(piglin.getType()).thenReturn(EntityType.PIGLIN); + + Item itemEntity = Mockito.mock(Item.class); + Mockito.when(itemEntity.getItemStack()).thenReturn(item); + + return new EntityPickupItemEvent(piglin, itemEntity, 1); + } + + private PlayerInteractEntityEvent createInteractEvent(EquipmentSlot hand, ItemStack item) { + Player player = server.addPlayer(); + + Piglin piglin = Mockito.mock(Piglin.class); + Mockito.when(piglin.getType()).thenReturn(EntityType.PIGLIN); + Mockito.when(piglin.isValid()).thenReturn(true); + + if (hand == EquipmentSlot.OFF_HAND) { + player.getInventory().setItemInOffHand(item); + } + else { + player.getInventory().setItemInMainHand(item); + } + + return new PlayerInteractEntityEvent(player, piglin, hand); + } + + @Test + void testPiglinPickup() { + EntityPickupItemEvent event = createPickupEvent(new ItemStack(Material.GOLD_INGOT)); + listener.onPickup(event); + Assertions.assertFalse(event.isCancelled()); + } + + @Test + void testPiglinPickupWithSlimefunItem() { + SlimefunItem item = TestUtilities.mockSlimefunItem(plugin, "PIGLIN_PICKUP_MOCK", new CustomItem(Material.GOLD_INGOT, "&6Piglin Bait")); + item.register(plugin); + + EntityPickupItemEvent event = createPickupEvent(item.getItem()); + listener.onPickup(event); + Assertions.assertTrue(event.isCancelled()); + } + + @ParameterizedTest + @EnumSource(value = EquipmentSlot.class, names = { "HAND", "OFF_HAND" }) + void testPiglinInteract(EquipmentSlot hand) { + PlayerInteractEntityEvent event = createInteractEvent(hand, new ItemStack(Material.GOLD_INGOT)); + listener.onInteract(event); + Assertions.assertFalse(event.isCancelled()); + } + + @ParameterizedTest + @EnumSource(value = EquipmentSlot.class, names = { "HAND", "OFF_HAND" }) + void testPiglinInteractWithSlimefunItem(EquipmentSlot hand) { + SlimefunItem item = TestUtilities.mockSlimefunItem(plugin, "PIGLIN_GIVE_" + hand.name(), new CustomItem(Material.GOLD_INGOT, "&6Piglin Bait")); + item.register(plugin); + + PlayerInteractEntityEvent event = createInteractEvent(hand, item.getItem()); + listener.onInteract(event); + Assertions.assertTrue(event.isCancelled()); + } + +} From c08eadcaae1f2bc02ea6a844aabc864d8d3953fd Mon Sep 17 00:00:00 2001 From: TheBusyBiscuit Date: Sat, 8 Aug 2020 00:48:09 +0200 Subject: [PATCH 36/81] Small performance improvement --- .../listeners/AncientAltarListener.java | 5 +++- .../listeners/ItemPickupListener.java | 24 ++++++++++++------- 2 files changed, 19 insertions(+), 10 deletions(-) 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 518ae597d..e314b9c82 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 @@ -27,6 +27,7 @@ import org.bukkit.inventory.ItemStack; import org.bukkit.inventory.meta.ItemMeta; import org.bukkit.util.Vector; +import io.github.thebusybiscuit.cscorelib2.chat.ChatColors; import io.github.thebusybiscuit.cscorelib2.inventory.ItemUtils; import io.github.thebusybiscuit.cscorelib2.item.CustomItem; import io.github.thebusybiscuit.cscorelib2.protection.ProtectableAction; @@ -53,6 +54,8 @@ import me.mrCookieSlime.Slimefun.api.Slimefun; */ public class AncientAltarListener implements Listener { + static final String ITEM_PREFIX = ChatColors.color("&dALTAR &3Probe - &e"); + private AncientAltar altar; private final Set altarRecipes = new HashSet<>(); @@ -303,7 +306,7 @@ public class AncientAltarListener implements Listener { } String nametag = ItemUtils.getItemName(stack); - Item entity = b.getWorld().dropItem(b.getLocation().add(0.5, 1.2, 0.5), new CustomItem(stack, "&5&dALTAR &3Probe - &e" + System.nanoTime())); + Item entity = b.getWorld().dropItem(b.getLocation().add(0.5, 1.2, 0.5), new CustomItem(stack, ITEM_PREFIX + System.nanoTime())); entity.setVelocity(new Vector(0, 0.1, 0)); SlimefunUtils.markAsNoPickup(entity, "altar_item"); entity.setCustomNameVisible(true); 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 8b7216751..ce734ed8d 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 @@ -4,8 +4,8 @@ import org.bukkit.event.EventHandler; import org.bukkit.event.Listener; import org.bukkit.event.entity.EntityPickupItemEvent; import org.bukkit.event.inventory.InventoryPickupItemEvent; +import org.bukkit.inventory.meta.ItemMeta; -import io.github.thebusybiscuit.cscorelib2.chat.ChatColors; import io.github.thebusybiscuit.slimefun4.implementation.SlimefunPlugin; import io.github.thebusybiscuit.slimefun4.utils.SlimefunUtils; @@ -16,8 +16,6 @@ import io.github.thebusybiscuit.slimefun4.utils.SlimefunUtils; */ public class ItemPickupListener implements Listener { - private static final String ITEM_PREFIX = ChatColors.color("&5&dALTAR &3Probe - &e"); - public ItemPickupListener(SlimefunPlugin plugin) { plugin.getServer().getPluginManager().registerEvents(this, plugin); } @@ -27,9 +25,13 @@ public class ItemPickupListener implements Listener { if (SlimefunUtils.hasNoPickupFlag(e.getItem())) { e.setCancelled(true); } - else if (e.getItem().getItemStack().hasItemMeta() && e.getItem().getItemStack().getItemMeta().hasDisplayName() && e.getItem().getItemStack().getItemMeta().getDisplayName().startsWith(ITEM_PREFIX)) { - e.setCancelled(true); - e.getItem().remove(); + else if (e.getItem().getItemStack().hasItemMeta()) { + ItemMeta meta = e.getItem().getItemStack().getItemMeta(); + + if (meta.hasDisplayName() && meta.getDisplayName().startsWith(AncientAltarListener.ITEM_PREFIX)) { + e.setCancelled(true); + e.getItem().remove(); + } } } @@ -38,9 +40,13 @@ public class ItemPickupListener implements Listener { if (SlimefunUtils.hasNoPickupFlag(e.getItem())) { e.setCancelled(true); } - else if (e.getItem().getItemStack().hasItemMeta() && e.getItem().getItemStack().getItemMeta().hasDisplayName() && e.getItem().getItemStack().getItemMeta().getDisplayName().startsWith(ITEM_PREFIX)) { - e.setCancelled(true); - e.getItem().remove(); + else if (e.getItem().getItemStack().hasItemMeta()) { + ItemMeta meta = e.getItem().getItemStack().getItemMeta(); + + if (meta.hasDisplayName() && meta.getDisplayName().startsWith(AncientAltarListener.ITEM_PREFIX)) { + e.setCancelled(true); + e.getItem().remove(); + } } } } From d26ba90b5bb5141757a023043781422f9c4e6509 Mon Sep 17 00:00:00 2001 From: TheBusyBiscuit Date: Sat, 8 Aug 2020 11:50:56 +0200 Subject: [PATCH 37/81] [CI skip] Updated paper repository url --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index 11892434e..db59c3f5c 100644 --- a/pom.xml +++ b/pom.xml @@ -67,7 +67,7 @@ paper-repo - https://repo.destroystokyo.com/repository/maven-public/ + https://papermc.io/repo/repository/maven-public/ worldedit-repo From 9f49dd39815a7e060e427279c35024baa2f60637 Mon Sep 17 00:00:00 2001 From: TheBusyBiscuit Date: Sat, 8 Aug 2020 12:47:39 +0200 Subject: [PATCH 38/81] Reduced technical debt --- .../listeners/AncientAltarListener.java | 2 +- .../listeners/BlockListener.java | 95 +++++++++++-------- .../listeners/DebugFishListener.java | 51 ++++++---- .../listeners/TalismanListener.java | 8 +- .../slimefun4/utils/SlimefunUtils.java | 82 +++++----------- 5 files changed, 115 insertions(+), 123 deletions(-) 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 e314b9c82..960ca8587 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 @@ -54,7 +54,7 @@ import me.mrCookieSlime.Slimefun.api.Slimefun; */ public class AncientAltarListener implements Listener { - static final String ITEM_PREFIX = ChatColors.color("&dALTAR &3Probe - &e"); + public static final String ITEM_PREFIX = ChatColors.color("&dALTAR &3Probe - &e"); private AncientAltar altar; 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 74ee24f35..81a9f876e 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 @@ -32,6 +32,17 @@ import me.mrCookieSlime.Slimefun.Objects.SlimefunItem.UnregisterReason; import me.mrCookieSlime.Slimefun.api.BlockStorage; import me.mrCookieSlime.Slimefun.api.Slimefun; +/** + * The {@link BlockListener} is responsible for listening to the {@link BlockPlaceEvent} + * and {@link BlockBreakEvent}. + * + * @author TheBusyBiscuit + * + * @see BlockPlaceHandler + * @see BlockBreakHandler + * @see ToolUseHandler + * + */ public class BlockListener implements Listener { // Materials that require a Block under it, e.g. Pressure Plates @@ -49,7 +60,7 @@ public class BlockListener implements Listener { } @EventHandler(priority = EventPriority.MONITOR, ignoreCancelled = true) - public void onBlockRegister(BlockPlaceEvent e) { + public void onBlockPlace(BlockPlaceEvent e) { if (BlockStorage.hasBlockInfo(e.getBlock())) { e.setCancelled(true); return; @@ -81,7 +92,7 @@ public class BlockListener implements Listener { } @EventHandler(priority = EventPriority.MONITOR, ignoreCancelled = true) - public void onBlockUnregister(BlockBreakEvent e) { + public void onBlockBreak(BlockBreakEvent e) { checkForSensitiveBlockAbove(e.getPlayer(), e.getBlock()); ItemStack item = e.getPlayer().getInventory().getItemInMainHand(); @@ -89,50 +100,58 @@ public class BlockListener implements Listener { List drops = new ArrayList<>(); if (item.getType() != Material.AIR) { - SlimefunItem tool = SlimefunItem.getByItem(item); - - if (tool != null) { - if (Slimefun.hasUnlocked(e.getPlayer(), tool, true)) { - tool.callItemHandler(ToolUseHandler.class, handler -> handler.onToolUse(e, item, fortune, drops)); - } - else { - e.setCancelled(true); - } - } + callToolHandler(e, item, fortune, drops); } if (!e.isCancelled()) { - SlimefunItem sfItem = BlockStorage.check(e.getBlock()); - - if (sfItem == null && SlimefunPlugin.getBlockDataService().isTileEntity(e.getBlock().getType())) { - Optional blockData = SlimefunPlugin.getBlockDataService().getBlockData(e.getBlock()); - - if (blockData.isPresent()) { - sfItem = SlimefunItem.getByID(blockData.get()); - } - } - - if (sfItem != null && !sfItem.useVanillaBlockBreaking()) { - SlimefunBlockHandler blockHandler = SlimefunPlugin.getRegistry().getBlockHandlers().get(sfItem.getID()); - - if (blockHandler != null) { - if (!blockHandler.onBreak(e.getPlayer(), e.getBlock(), sfItem, UnregisterReason.PLAYER_BREAK)) { - e.setCancelled(true); - return; - } - } - else { - sfItem.callItemHandler(BlockBreakHandler.class, handler -> handler.onBlockBreak(e, item, fortune, drops)); - } - - drops.addAll(sfItem.getDrops()); - BlockStorage.clearBlockInfo(e.getBlock()); - } + callBlockHandler(e, item, fortune, drops); } dropItems(e, drops); } + private void callToolHandler(BlockBreakEvent e, ItemStack item, int fortune, List drops) { + SlimefunItem tool = SlimefunItem.getByItem(item); + + if (tool != null) { + if (Slimefun.hasUnlocked(e.getPlayer(), tool, true)) { + tool.callItemHandler(ToolUseHandler.class, handler -> handler.onToolUse(e, item, fortune, drops)); + } + else { + e.setCancelled(true); + } + } + } + + private void callBlockHandler(BlockBreakEvent e, ItemStack item, int fortune, List drops) { + SlimefunItem sfItem = BlockStorage.check(e.getBlock()); + + if (sfItem == null && SlimefunPlugin.getBlockDataService().isTileEntity(e.getBlock().getType())) { + Optional blockData = SlimefunPlugin.getBlockDataService().getBlockData(e.getBlock()); + + if (blockData.isPresent()) { + sfItem = SlimefunItem.getByID(blockData.get()); + } + } + + if (sfItem != null && !sfItem.useVanillaBlockBreaking()) { + SlimefunBlockHandler blockHandler = SlimefunPlugin.getRegistry().getBlockHandlers().get(sfItem.getID()); + + if (blockHandler != null) { + if (!blockHandler.onBreak(e.getPlayer(), e.getBlock(), sfItem, UnregisterReason.PLAYER_BREAK)) { + e.setCancelled(true); + return; + } + } + else { + sfItem.callItemHandler(BlockBreakHandler.class, handler -> handler.onBlockBreak(e, item, fortune, drops)); + } + + drops.addAll(sfItem.getDrops()); + BlockStorage.clearBlockInfo(e.getBlock()); + } + } + private void dropItems(BlockBreakEvent e, List drops) { if (!drops.isEmpty()) { e.getBlock().setType(Material.AIR); 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 ad9edce67..30a969e25 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 @@ -4,6 +4,7 @@ import java.util.logging.Level; import org.bukkit.Material; import org.bukkit.block.Block; +import org.bukkit.block.BlockFace; import org.bukkit.block.Skull; import org.bukkit.block.data.Directional; import org.bukkit.block.data.Rotatable; @@ -60,29 +61,10 @@ public class DebugFishListener implements Listener { if (p.hasPermission("slimefun.debugging")) { if (e.getAction() == Action.LEFT_CLICK_BLOCK) { - if (p.isSneaking()) { - if (BlockStorage.hasBlockInfo(e.getClickedBlock())) { - BlockStorage.clearBlockInfo(e.getClickedBlock()); - } - } - else { - e.setCancelled(false); - } + onLeftClick(p, e.getClickedBlock(), e); } else if (e.getAction() == Action.RIGHT_CLICK_BLOCK) { - if (p.isSneaking()) { - Block b = e.getClickedBlock().getRelative(e.getBlockFace()); - b.setType(Material.PLAYER_HEAD); - SkullBlock.setFromHash(b, HeadTexture.MISSING_TEXTURE.getTexture()); - } - else if (BlockStorage.hasBlockInfo(e.getClickedBlock())) { - try { - sendInfo(p, e.getClickedBlock()); - } - catch (Exception x) { - Slimefun.getLogger().log(Level.SEVERE, "An Exception occured while using a Debug-Fish", x); - } - } + onRightClick(p, e.getClickedBlock(), e.getBlockFace()); } } else { @@ -91,6 +73,33 @@ public class DebugFishListener implements Listener { } } + private void onLeftClick(Player p, Block b, PlayerInteractEvent e) { + if (p.isSneaking()) { + if (BlockStorage.hasBlockInfo(b)) { + BlockStorage.clearBlockInfo(b); + } + } + else { + e.setCancelled(false); + } + } + + private void onRightClick(Player p, Block b, BlockFace face) { + if (p.isSneaking()) { + Block block = b.getRelative(face); + block.setType(Material.PLAYER_HEAD); + SkullBlock.setFromHash(block, HeadTexture.MISSING_TEXTURE.getTexture()); + } + else if (BlockStorage.hasBlockInfo(b)) { + try { + sendInfo(p, b); + } + catch (Exception x) { + Slimefun.getLogger().log(Level.SEVERE, "An Exception occured while using a Debug-Fish", x); + } + } + } + private void sendInfo(Player p, Block b) { SlimefunItem item = BlockStorage.check(b); 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 d68d47a63..df00ffc64 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 @@ -235,20 +235,20 @@ public class TalismanListener implements Listener { if (MaterialCollections.getAllOres().contains(e.getBlock().getType())) { ItemStack item = e.getPlayer().getInventory().getItemInMainHand(); - if (item.getType() != Material.AIR && item.getAmount() > 0) { + if (item.getType() != Material.AIR && item.getAmount() > 0 && !item.containsEnchantment(Enchantment.SILK_TOUCH)) { Collection drops = e.getBlock().getDrops(item); int dropAmount = 1; - if (item.getEnchantments().containsKey(Enchantment.LOOT_BONUS_BLOCKS) && !item.getEnchantments().containsKey(Enchantment.SILK_TOUCH)) { + if (item.containsEnchantment(Enchantment.LOOT_BONUS_BLOCKS)) { Random random = ThreadLocalRandom.current(); dropAmount = random.nextInt(item.getEnchantmentLevel(Enchantment.LOOT_BONUS_BLOCKS) + 2) - 1; dropAmount = Math.max(dropAmount, 1); dropAmount = (e.getBlock().getType() == Material.LAPIS_ORE ? 4 + random.nextInt(5) : 1) * (dropAmount + 1); } - if (!item.getEnchantments().containsKey(Enchantment.SILK_TOUCH) && Talisman.checkFor(e, SlimefunItems.TALISMAN_MINER)) { + if (Talisman.checkFor(e, SlimefunItems.TALISMAN_MINER)) { for (ItemStack drop : drops) { - if (!drop.getType().isBlock()) { + if (drop != null && !drop.getType().isBlock()) { int amount = Math.max(1, (dropAmount * 2) - drop.getAmount()); e.getBlock().getWorld().dropItemNaturally(e.getBlock().getLocation(), new CustomItem(drop, amount)); } 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 260c6b971..b1250a9c8 100644 --- a/src/main/java/io/github/thebusybiscuit/slimefun4/utils/SlimefunUtils.java +++ b/src/main/java/io/github/thebusybiscuit/slimefun4/utils/SlimefunUtils.java @@ -270,78 +270,42 @@ public final class SlimefunUtils { private static boolean equalsItemMeta(ItemMeta itemMeta, ImmutableItemMeta meta, boolean checkLore) { Optional displayName = meta.getDisplayName(); - if (itemMeta.hasDisplayName() && displayName.isPresent()) { - if (itemMeta.getDisplayName().equals(displayName.get())) { - Optional> itemLore = meta.getLore(); - - if (checkLore) { - if (itemMeta.hasLore() && itemLore.isPresent()) { - return equalsLore(itemMeta.getLore(), itemLore.get()); - } - else { - return !itemMeta.hasLore() && !itemLore.isPresent(); - } - } - else { - return true; - } - } - else { - return false; - } + if (itemMeta.hasDisplayName() != displayName.isPresent()) { + return false; } - else if (!itemMeta.hasDisplayName() && !displayName.isPresent()) { + else if (itemMeta.hasDisplayName() && displayName.isPresent() && !itemMeta.getDisplayName().equals(displayName.get())) { + return false; + } + else if (!checkLore) { + return true; + } + else { Optional> itemLore = meta.getLore(); - if (checkLore) { - if (itemMeta.hasLore() && itemLore.isPresent()) { - return equalsLore(itemMeta.getLore(), itemLore.get()); - } - else { - return !itemMeta.hasLore() && !itemLore.isPresent(); - } + if (itemMeta.hasLore() && itemLore.isPresent()) { + return equalsLore(itemMeta.getLore(), itemLore.get()); } else { - return true; + return !itemMeta.hasLore() && !itemLore.isPresent(); } } - else return false; } private static boolean equalsItemMeta(ItemMeta itemMeta, ItemMeta sfitemMeta, boolean checkLore) { - if (itemMeta.hasDisplayName() && sfitemMeta.hasDisplayName()) { - if (itemMeta.getDisplayName().equals(sfitemMeta.getDisplayName())) { - if (checkLore) { - if (itemMeta.hasLore() && sfitemMeta.hasLore()) { - return equalsLore(itemMeta.getLore(), sfitemMeta.getLore()); - } - else { - return !itemMeta.hasLore() && !sfitemMeta.hasLore(); - } - } - else { - return true; - } - } - else { - return false; - } + if (itemMeta.hasDisplayName() != sfitemMeta.hasDisplayName()) { + return false; } - else if (!itemMeta.hasDisplayName() && !sfitemMeta.hasDisplayName()) { - if (checkLore) { - if (itemMeta.hasLore() && sfitemMeta.hasLore()) { - return equalsLore(itemMeta.getLore(), sfitemMeta.getLore()); - } - else { - return !itemMeta.hasLore() && !sfitemMeta.hasLore(); - } - } - else { - return true; - } + else if (itemMeta.hasDisplayName() && sfitemMeta.hasDisplayName() && !itemMeta.getDisplayName().equals(sfitemMeta.getDisplayName())) { + return false; + } + else if (!checkLore) { + return true; + } + else if (itemMeta.hasLore() && sfitemMeta.hasLore()) { + return equalsLore(itemMeta.getLore(), sfitemMeta.getLore()); } else { - return false; + return !itemMeta.hasLore() && !sfitemMeta.hasLore(); } } From 7de9dd6683c1e42f4f39dfa68f23250344b505ac Mon Sep 17 00:00:00 2001 From: TheBusyBiscuit Date: Sat, 8 Aug 2020 12:51:26 +0200 Subject: [PATCH 39/81] Industrial Miners can now also mine Gilded Blackstone --- CHANGELOG.md | 1 + .../items/multiblocks/miner/IndustrialMiner.java | 16 +++++++++------- 2 files changed, 10 insertions(+), 7 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index d1f288f74..073582c9f 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -31,6 +31,7 @@ * (API) Added ToolUseHandler * Added "Sand -> Sandstone" recipe to the Electric Press * Added "Red Sand -> Red Sandstone" recipe to the Electric Press +* Industrial Miners can now also mine Gilded Blackstone #### Changes * Performance improvement for Programmable Android rotations 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 321d18502..4e4a54301 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 @@ -131,10 +131,8 @@ public class IndustrialMiner extends MultiBlockMachine { return new ItemStack(Material.REDSTONE, 4 + random.nextInt(2)); case LAPIS_ORE: return new ItemStack(Material.LAPIS_LAZULI, 4 + random.nextInt(4)); - case ANCIENT_DEBRIS: - return new ItemStack(Material.ANCIENT_DEBRIS); default: - // This includes Iron and Gold ore + // This includes Iron and Gold ore (and Ancient Debris) return new ItemStack(ore); } } @@ -216,11 +214,15 @@ public class IndustrialMiner extends MultiBlockMachine { return true; } else if (SlimefunPlugin.getMinecraftVersion().isAtLeast(MinecraftVersion.MINECRAFT_1_16)) { - return type == Material.ANCIENT_DEBRIS && canMineAncientDebris.getValue(); - } - else { - return false; + if (type == Material.GILDED_BLACKSTONE) { + return true; + } + else if (type == Material.ANCIENT_DEBRIS) { + return canMineAncientDebris.getValue(); + } } + + return false; } } From a3f58150ee99b225194a7e3546fe108c7d963c93 Mon Sep 17 00:00:00 2001 From: Nameless Date: Sun, 9 Aug 2020 08:17:17 +0000 Subject: [PATCH 40/81] Translate messages_zh-CN.yml via GitLocalize --- src/main/resources/languages/messages_zh-CN.yml | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/main/resources/languages/messages_zh-CN.yml b/src/main/resources/languages/messages_zh-CN.yml index 907b6275c..1a60ee479 100644 --- a/src/main/resources/languages/messages_zh-CN.yml +++ b/src/main/resources/languages/messages_zh-CN.yml @@ -284,6 +284,7 @@ languages: zh-CN: 简体中文 (中国) el: 希腊语 he: 希伯来语 + pt-BR: 葡萄牙语 (巴西) ar: 阿拉伯语 af: 南非语 da: 丹麦语 @@ -296,7 +297,6 @@ languages: th: 泰语 ro: 罗马尼亚语 pt: 葡萄牙语 (葡萄牙) - pt-BR: 葡萄牙语 (巴西) bg: 保加利亚语 ko: 韩语 tr: 土耳其语 @@ -305,5 +305,7 @@ languages: sr: 塞尔维亚语 be: 白俄罗斯语 tl: 他加禄语 +brewing_stand: + not-working: "&4你不能在酿造台中使用 Slimefun 物品!" miner: no-ores: "&e抱歉, 周围找不到矿石了!" From 03d7516605dbcff521470bf58a5c4cca1522eb5d Mon Sep 17 00:00:00 2001 From: TheBusyBiscuit Date: Sun, 9 Aug 2020 08:17:18 +0000 Subject: [PATCH 41/81] Translate messages_zh-CN.yml via GitLocalize From af32c0ed4a790bf08ce761881758ba278848e7ce Mon Sep 17 00:00:00 2001 From: Nameless Date: Sun, 9 Aug 2020 08:20:48 +0000 Subject: [PATCH 42/81] Translate recipes_zh-CN.yml via GitLocalize --- src/main/resources/languages/recipes_zh-CN.yml | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/main/resources/languages/recipes_zh-CN.yml b/src/main/resources/languages/recipes_zh-CN.yml index c996980ec..14f407f6f 100644 --- a/src/main/resources/languages/recipes_zh-CN.yml +++ b/src/main/resources/languages/recipes_zh-CN.yml @@ -118,6 +118,11 @@ slimefun: lore: - 如合成表所示 - 用炼油机合成 + barter_drop: + name: 猪灵交易掉落 + lore: + - 使用金锭与猪灵交易 + - 可以获得此物品 minecraft: shaped: name: 有序合成 From 66f4c48b4b6ddad045134ed5525d9065b7559719 Mon Sep 17 00:00:00 2001 From: TheBusyBiscuit Date: Sun, 9 Aug 2020 11:33:48 +0200 Subject: [PATCH 43/81] Fixes #2205 --- CHANGELOG.md | 1 + pom.xml | 2 +- .../implementation/SlimefunPlugin.java | 2 + .../items/misc/SyntheticEmerald.java | 29 ++++++ .../listeners/VillagerTradingListener.java | 57 +++++++++++ .../setup/SlimefunItemSetup.java | 4 +- src/main/resources/languages/messages_en.yml | 4 + .../TestVillagerTradingListener.java | 97 +++++++++++++++++++ 8 files changed, 193 insertions(+), 3 deletions(-) create mode 100644 src/main/java/io/github/thebusybiscuit/slimefun4/implementation/items/misc/SyntheticEmerald.java create mode 100644 src/main/java/io/github/thebusybiscuit/slimefun4/implementation/listeners/VillagerTradingListener.java create mode 100644 src/test/java/io/github/thebusybiscuit/slimefun4/testing/tests/listeners/TestVillagerTradingListener.java diff --git a/CHANGELOG.md b/CHANGELOG.md index 073582c9f..d7953b951 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -57,6 +57,7 @@ * Fixed #2122 * Fixed #2168 * Fixed #2203 +* Fixed #2205 ## Release Candidate 15 (01 Aug 2020) diff --git a/pom.xml b/pom.xml index db59c3f5c..19d1b0273 100644 --- a/pom.xml +++ b/pom.xml @@ -4,7 +4,7 @@ xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> 4.0.0 - io.github.thebusybiscuit + com.github.thebusybiscuit Slimefun diff --git a/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/SlimefunPlugin.java b/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/SlimefunPlugin.java index 745671d55..75561d0a3 100644 --- a/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/SlimefunPlugin.java +++ b/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/SlimefunPlugin.java @@ -82,6 +82,7 @@ import io.github.thebusybiscuit.slimefun4.implementation.listeners.SoulboundList 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.VillagerTradingListener; import io.github.thebusybiscuit.slimefun4.implementation.listeners.WitherListener; import io.github.thebusybiscuit.slimefun4.implementation.listeners.WorldListener; import io.github.thebusybiscuit.slimefun4.implementation.resources.GEOResourcesSetup; @@ -442,6 +443,7 @@ public final class SlimefunPlugin extends JavaPlugin implements SlimefunAddon { new IronGolemListener(this); new PlayerInteractEntityListener(this); new MobDropListener(this); + new VillagerTradingListener(this); if (minecraftVersion.isAtLeast(MinecraftVersion.MINECRAFT_1_15)) { new BeeListener(this); diff --git a/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/items/misc/SyntheticEmerald.java b/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/items/misc/SyntheticEmerald.java new file mode 100644 index 000000000..a8fa1fb2b --- /dev/null +++ b/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/items/misc/SyntheticEmerald.java @@ -0,0 +1,29 @@ +package io.github.thebusybiscuit.slimefun4.implementation.items.misc; + +import org.bukkit.entity.Villager; +import org.bukkit.inventory.ItemStack; + +import io.github.thebusybiscuit.slimefun4.implementation.listeners.VillagerTradingListener; +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 SyntheticEmerald} is an almost normal emerald. + * It can even be used to trade with {@link Villager Villagers}. + * + * @author TheBusyBiscuit + * + * @see VillagerTradingListener + * + */ +public class SyntheticEmerald extends SlimefunItem { + + public SyntheticEmerald(Category category, SlimefunItemStack item, RecipeType recipeType, ItemStack[] recipe) { + super(category, item, recipeType, recipe); + + setUseableInWorkbench(true); + } + +} diff --git a/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/listeners/VillagerTradingListener.java b/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/listeners/VillagerTradingListener.java new file mode 100644 index 000000000..2f199a217 --- /dev/null +++ b/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/listeners/VillagerTradingListener.java @@ -0,0 +1,57 @@ +package io.github.thebusybiscuit.slimefun4.implementation.listeners; + +import org.bukkit.entity.Player; +import org.bukkit.event.Event.Result; +import org.bukkit.event.EventHandler; +import org.bukkit.event.Listener; +import org.bukkit.event.inventory.InventoryAction; +import org.bukkit.event.inventory.InventoryClickEvent; +import org.bukkit.event.inventory.InventoryType; +import org.bukkit.inventory.Inventory; + +import io.github.thebusybiscuit.slimefun4.implementation.SlimefunPlugin; +import io.github.thebusybiscuit.slimefun4.implementation.items.VanillaItem; +import io.github.thebusybiscuit.slimefun4.implementation.items.misc.SyntheticEmerald; +import me.mrCookieSlime.Slimefun.Objects.SlimefunItem.SlimefunItem; + +/** + * This {@link Listener} prevents any {@link SlimefunItem} from being used to trade with + * Villagers, with one exception being {@link SyntheticEmerald}. + * + * @author TheBusyBiscuit + * + */ +public class VillagerTradingListener implements Listener { + + public VillagerTradingListener(SlimefunPlugin plugin) { + plugin.getServer().getPluginManager().registerEvents(this, plugin); + } + + @EventHandler(ignoreCancelled = true) + public void onPreBrew(InventoryClickEvent e) { + Inventory clickedInventory = e.getClickedInventory(); + Inventory topInventory = e.getView().getTopInventory(); + + if (clickedInventory != null && topInventory.getType() == InventoryType.MERCHANT) { + if (e.getAction() == InventoryAction.HOTBAR_SWAP) { + e.setCancelled(true); + return; + } + + if (clickedInventory.getType() == InventoryType.MERCHANT) { + e.setCancelled(isUnallowed(SlimefunItem.getByItem(e.getCursor()))); + } + else { + e.setCancelled(isUnallowed(SlimefunItem.getByItem(e.getCurrentItem()))); + } + + if (e.getResult() == Result.DENY) { + SlimefunPlugin.getLocalization().sendMessage((Player) e.getWhoClicked(), "villagers.no-trading", true); + } + } + } + + private boolean isUnallowed(SlimefunItem item) { + return item != null && !(item instanceof VanillaItem) && !(item instanceof SyntheticEmerald) && !item.isDisabled(); + } +} 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 a2c10280b..c07619d3f 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 @@ -144,6 +144,7 @@ import io.github.thebusybiscuit.slimefun4.implementation.items.misc.BasicCircuit 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.misc.SyntheticEmerald; import io.github.thebusybiscuit.slimefun4.implementation.items.multiblocks.ArmorForge; import io.github.thebusybiscuit.slimefun4.implementation.items.multiblocks.AutomatedPanningMachine; import io.github.thebusybiscuit.slimefun4.implementation.items.multiblocks.Compressor; @@ -867,9 +868,8 @@ public final class SlimefunItemSetup { new ItemStack[] {SlimefunItems.GOLD_24K, SlimefunItems.IRON_DUST, null, null, null, null, null, null, null}) .register(plugin); - new SlimefunItem(categories.resources, SlimefunItems.SYNTHETIC_EMERALD, RecipeType.SMELTERY, + new SyntheticEmerald(categories.resources, SlimefunItems.SYNTHETIC_EMERALD, RecipeType.SMELTERY, new ItemStack[] {SlimefunItems.SYNTHETIC_SAPPHIRE, SlimefunItems.ALUMINUM_DUST, SlimefunItems.ALUMINUM_INGOT, new ItemStack(Material.GLASS_PANE), null, null, null, null, null}) - .setUseableInWorkbench(true) .register(plugin); registerArmorSet(categories.armor, SlimefunItems.CHAIN, new ItemStack[] { diff --git a/src/main/resources/languages/messages_en.yml b/src/main/resources/languages/messages_en.yml index 1298dcb36..c50aedf71 100644 --- a/src/main/resources/languages/messages_en.yml +++ b/src/main/resources/languages/messages_en.yml @@ -235,6 +235,9 @@ anvil: brewing_stand: not-working: '&4You cannot use Slimefun Items in a brewing stand!' +villagers: + no-trading: '&4You cannot trade Slimefun Items with Villagers!' + backpack: already-open: '&cSorry, this Backpack is open somewhere else!' no-stack: '&cYou cannot stack Backpacks' @@ -248,6 +251,7 @@ gps: new: '&ePlease type in a name for your new waypoint in the chat. &7(Color Codes supported!)' added: '&aSuccessfully added a new waypoint' max: '&4You have reached the maximum amount of waypoints' + duplicate: '&4You have already created a waypoint named: &f%waypoint%' insufficient-complexity: - '&4Insufficient GPS Network Complexity: &c%complexity%' diff --git a/src/test/java/io/github/thebusybiscuit/slimefun4/testing/tests/listeners/TestVillagerTradingListener.java b/src/test/java/io/github/thebusybiscuit/slimefun4/testing/tests/listeners/TestVillagerTradingListener.java new file mode 100644 index 000000000..ebcc2c629 --- /dev/null +++ b/src/test/java/io/github/thebusybiscuit/slimefun4/testing/tests/listeners/TestVillagerTradingListener.java @@ -0,0 +1,97 @@ +package io.github.thebusybiscuit.slimefun4.testing.tests.listeners; + +import org.bukkit.Material; +import org.bukkit.entity.Player; +import org.bukkit.event.Event.Result; +import org.bukkit.event.inventory.ClickType; +import org.bukkit.event.inventory.InventoryAction; +import org.bukkit.event.inventory.InventoryClickEvent; +import org.bukkit.event.inventory.InventoryType; +import org.bukkit.event.inventory.InventoryType.SlotType; +import org.bukkit.inventory.Inventory; +import org.bukkit.inventory.InventoryView; +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 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.items.misc.SyntheticEmerald; +import io.github.thebusybiscuit.slimefun4.implementation.listeners.VillagerTradingListener; +import io.github.thebusybiscuit.slimefun4.testing.TestUtilities; +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; + +class TestVillagerTradingListener { + + private static SlimefunPlugin plugin; + private static VillagerTradingListener listener; + private static ServerMock server; + + @BeforeAll + public static void load() { + server = MockBukkit.mock(); + plugin = MockBukkit.load(SlimefunPlugin.class); + listener = new VillagerTradingListener(plugin); + } + + @AfterAll + public static void unload() { + MockBukkit.unmock(); + } + + private InventoryClickEvent mockClickEvent(ItemStack item) { + Player player = server.addPlayer(); + Inventory inv = TestUtilities.mockInventory(InventoryType.MERCHANT); + Mockito.when(inv.getSize()).thenReturn(8); + + InventoryView view = player.openInventory(inv); + view.setCursor(item); + InventoryClickEvent event = new InventoryClickEvent(view, SlotType.CONTAINER, 1, ClickType.LEFT, InventoryAction.PICKUP_ONE); + listener.onPreBrew(event); + return event; + } + + @Test + void testTradingWithoutSlimefunItems() { + InventoryClickEvent event = mockClickEvent(new ItemStack(Material.EMERALD)); + Assertions.assertEquals(Result.ALLOW, event.getResult()); + } + + @Test + void testTradingWithSlimefunItem() { + SlimefunItem item = TestUtilities.mockSlimefunItem(plugin, "MOCKED_FAKE_EMERALD", new CustomItem(Material.EMERALD, "&aFake Emerald")); + item.register(plugin); + + InventoryClickEvent event = mockClickEvent(item.getItem()); + Assertions.assertEquals(Result.DENY, event.getResult()); + } + + @Test + void testTradingWithVanillaItem() { + VanillaItem item = TestUtilities.mockVanillaItem(plugin, Material.EMERALD, true); + item.register(plugin); + + InventoryClickEvent event = mockClickEvent(item.getItem()); + Assertions.assertEquals(Result.ALLOW, event.getResult()); + } + + @Test + void testTradingWithSyntheticEmerald() { + Category category = TestUtilities.getCategory(plugin, "shiny_emeralds"); + SlimefunItemStack stack = new SlimefunItemStack("FAKE_EMERALD", Material.EMERALD, "&aTrade me"); + SyntheticEmerald item = new SyntheticEmerald(category, stack, RecipeType.ENHANCED_CRAFTING_TABLE, new ItemStack[9]); + item.register(plugin); + + InventoryClickEvent event = mockClickEvent(item.getItem()); + Assertions.assertEquals(Result.ALLOW, event.getResult()); + } +} From 485a80f6ef2a94e4467b1a87a4a21c4b7de7ee89 Mon Sep 17 00:00:00 2001 From: TheBusyBiscuit Date: Sun, 9 Aug 2020 11:41:15 +0200 Subject: [PATCH 44/81] Fixes #2209 --- CHANGELOG.md | 1 + .../thebusybiscuit/slimefun4/api/gps/GPSNetwork.java | 8 ++++++++ 2 files changed, 9 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index d7953b951..870503d15 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -58,6 +58,7 @@ * Fixed #2168 * Fixed #2203 * Fixed #2205 +* Fixed #2209 ## Release Candidate 15 (01 Aug 2020) 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 511c8e418..9fd78d6b1 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 @@ -283,6 +283,14 @@ public class GPSNetwork { if (!event.isCancelled()) { String id = ChatColor.stripColor(ChatColors.color(event.getName())).toUpperCase(Locale.ROOT).replace(' ', '_'); + + for (Waypoint wp : profile.getWaypoints()) { + if (wp.getId().equals(id)) { + SlimefunPlugin.getLocalization().sendMessage(p, "gps.waypoint.duplicate", true, msg -> msg.replace("%waypoint%", event.getName())); + return; + } + } + profile.addWaypoint(new Waypoint(profile, id, event.getLocation(), event.getName())); p.playSound(p.getLocation(), Sound.BLOCK_NOTE_BLOCK_PLING, 1F, 1F); From bb40017985c5a8d22ba510fab5ac749f5cae608d Mon Sep 17 00:00:00 2001 From: TheBusyBiscuit Date: Sun, 9 Aug 2020 09:48:03 +0000 Subject: [PATCH 45/81] Translate messages_de.yml via GitLocalize --- src/main/resources/languages/messages_de.yml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/main/resources/languages/messages_de.yml b/src/main/resources/languages/messages_de.yml index 2b9f41e0f..1f737aeeb 100644 --- a/src/main/resources/languages/messages_de.yml +++ b/src/main/resources/languages/messages_de.yml @@ -234,6 +234,7 @@ gps: werden unterstützt!)" added: "&aEin neuer Wegpunkt wurde hinzugefügt" max: "&4Du hast die maximale Anzahl an Wegpunkten erreicht" + duplicate: "&4Es existiert bereits ein Wegpunkt mit folgendem Namen: &f%waypoint%" insufficient-complexity: - "&4Unzureichende Komplexität deines GPS-Netzwerkes! Folgende Komplexität wird benötigt: &c%complexity%" @@ -329,5 +330,7 @@ languages: tl: Tagalog brewing_stand: not-working: "&4Items von Slimefun können nicht zum Brauen verwendet werden!" +villagers: + no-trading: "&4Items von Slimefun können nicht zum Handeln verwendet werden!" miner: no-ores: "&eIch konnte leider keine Erze in der Nähe finden!" From adddf4811dcecff36d6290aeb190d68bc05910e7 Mon Sep 17 00:00:00 2001 From: Luu7 Date: Sun, 9 Aug 2020 13:07:04 +0000 Subject: [PATCH 46/81] Translate messages_es.yml via GitLocalize --- src/main/resources/languages/messages_es.yml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/main/resources/languages/messages_es.yml b/src/main/resources/languages/messages_es.yml index 497df743d..c8fe3f45c 100644 --- a/src/main/resources/languages/messages_es.yml +++ b/src/main/resources/languages/messages_es.yml @@ -228,6 +228,7 @@ gps: códigos de color!)" added: "&aNuevo waypoint agregado exitosamente." max: "&4Has alcanzado el máximo número de waypoints permitidos." + duplicate: "&4Ya has creado un waypoint llamado: &f%waypoint%" insufficient-complexity: - "&4Complejidad de red GPS insuficiente: &c%complexity%" - "&4a) No tienes una red GPS armada aún." @@ -324,5 +325,7 @@ languages: tl: Tagalog brewing_stand: not-working: "&4¡No puedes usar objetos de Slimefun en un soporte para pociones!" +villagers: + no-trading: "&4No puedes tradear Slimefun items con los aldeanos!" miner: no-ores: "&ePerdón, ¡No encuentro ningún mineral cerca!" From 9175f27fdda7baa639eb1a92de5c7815a2f27c6a Mon Sep 17 00:00:00 2001 From: LinoxGH Date: Sun, 9 Aug 2020 14:59:09 +0000 Subject: [PATCH 47/81] Translate messages_tr.yml via GitLocalize --- src/main/resources/languages/messages_tr.yml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/main/resources/languages/messages_tr.yml b/src/main/resources/languages/messages_tr.yml index 0608f4bb9..a600ff98b 100644 --- a/src/main/resources/languages/messages_tr.yml +++ b/src/main/resources/languages/messages_tr.yml @@ -225,6 +225,7 @@ gps: 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" + duplicate: "&4Bu adla zaten bir yer noktası yarattınız: &f%waypoint%" insufficient-complexity: - "&4Yetersiz GPS Ağ Gücü: &c%complexity%" - "&4a) Henüz bir GPS Ağı kurulumunuz yok" @@ -320,5 +321,7 @@ languages: tl: Tagalog brewing_stand: not-working: "&4Slimefun eşyalarını simya standında kullanamazsın!" +villagers: + no-trading: "&4Köylülerle Slimefun eşyalarını kullanarak ticaret yapamazsın!" miner: no-ores: "&eÜzgünüm, yakınlarda herhangi bir cevher bulamadım!" From aafa1e7d0c2fc58e43e267e982d646ad9f015f29 Mon Sep 17 00:00:00 2001 From: LinoxGH Date: Sun, 9 Aug 2020 14:59:10 +0000 Subject: [PATCH 48/81] Translate recipes_tr.yml via GitLocalize From 517bd6139e16a7370373128d1065b0cdbaa6dd9a Mon Sep 17 00:00:00 2001 From: Nameless Date: Mon, 10 Aug 2020 06:47:24 +0000 Subject: [PATCH 49/81] Translate messages_zh-CN.yml via GitLocalize --- src/main/resources/languages/messages_zh-CN.yml | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/main/resources/languages/messages_zh-CN.yml b/src/main/resources/languages/messages_zh-CN.yml index 1a60ee479..458152fee 100644 --- a/src/main/resources/languages/messages_zh-CN.yml +++ b/src/main/resources/languages/messages_zh-CN.yml @@ -213,6 +213,7 @@ gps: new: "&e给你的路径点起个名字吧 &7(支持彩色代码!)" added: "&a成功添加了新的传送点" max: "&4你已到达设置传送点个数的最大上限" + duplicate: "&4你已经创建了一个相同名字的传送点了: &f%waypoint%" insufficient-complexity: - "&4GPS网络复杂度不足: &c%complexity%" - "&4a) 你还没有设置一个 GPS 网络" @@ -284,7 +285,7 @@ languages: zh-CN: 简体中文 (中国) el: 希腊语 he: 希伯来语 - pt-BR: 葡萄牙语 (巴西) + pt: 葡萄牙语 (葡萄牙) ar: 阿拉伯语 af: 南非语 da: 丹麦语 @@ -296,7 +297,7 @@ languages: fa: 波斯语 th: 泰语 ro: 罗马尼亚语 - pt: 葡萄牙语 (葡萄牙) + pt-BR: 葡萄牙语 (巴西) bg: 保加利亚语 ko: 韩语 tr: 土耳其语 @@ -307,5 +308,7 @@ languages: tl: 他加禄语 brewing_stand: not-working: "&4你不能在酿造台中使用 Slimefun 物品!" +villagers: + no-trading: "&4你不能用 Slimefun 的物品和村民交易!" miner: no-ores: "&e抱歉, 周围找不到矿石了!" From d4f04311f956f037f72022e6574296f01db9c792 Mon Sep 17 00:00:00 2001 From: TheBusyBiscuit Date: Mon, 10 Aug 2020 06:47:25 +0000 Subject: [PATCH 50/81] Translate messages_zh-CN.yml via GitLocalize From 1aaedf0825cbdeeec3d8715407f186f8ba01ba42 Mon Sep 17 00:00:00 2001 From: TheBusyBiscuit Date: Tue, 11 Aug 2020 11:17:08 +0200 Subject: [PATCH 51/81] [CI skip] Added more Unit Tests --- .../slimefun4/core/guide/SlimefunGuide.java | 9 ++ .../listeners/SlimefunGuideListener.java | 4 +- .../listeners/TestItemPickupListener.java | 137 ++++++++++++++++++ .../tests/listeners/TestPiglinListener.java | 6 +- .../listeners/TestSlimefunGuideListener.java | 71 +++++++++ 5 files changed, 223 insertions(+), 4 deletions(-) create mode 100644 src/test/java/io/github/thebusybiscuit/slimefun4/testing/tests/listeners/TestItemPickupListener.java create mode 100644 src/test/java/io/github/thebusybiscuit/slimefun4/testing/tests/listeners/TestSlimefunGuideListener.java 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 14ff02237..979b9df45 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 @@ -132,4 +132,13 @@ public final class SlimefunGuide { public static boolean isGuideItem(ItemStack item) { return SlimefunUtils.isItemSimilar(item, getItem(SlimefunGuideLayout.CHEST), true) || SlimefunUtils.isItemSimilar(item, getItem(SlimefunGuideLayout.BOOK), true) || SlimefunUtils.isItemSimilar(item, getItem(SlimefunGuideLayout.CHEAT_SHEET), true); } + + public static SlimefunGuideLayout getDefaultLayout() { + if (SlimefunPlugin.getCfg().getBoolean("guide.default-view-book")) { + return SlimefunGuideLayout.BOOK; + } + else { + return SlimefunGuideLayout.CHEST; + } + } } 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 760ef9faf..78cf71659 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 @@ -33,7 +33,7 @@ public class SlimefunGuideListener implements Listener { return; } - SlimefunGuideLayout type = SlimefunPlugin.getCfg().getBoolean("guide.default-view-book") ? SlimefunGuideLayout.BOOK : SlimefunGuideLayout.CHEST; + SlimefunGuideLayout type = SlimefunGuide.getDefaultLayout(); p.getInventory().addItem(SlimefunGuide.getItem(type)); } } @@ -69,7 +69,7 @@ public class SlimefunGuideListener implements Listener { Player p = e.getPlayer(); ItemStack item = e.getItem(); - if (SlimefunUtils.isItemSimilar(item, SlimefunGuide.getItem(layout), true)) { + if (SlimefunUtils.isItemSimilar(item, SlimefunGuide.getItem(layout), true, false)) { e.cancel(); if (!SlimefunPlugin.getWorldSettingsService().isWorldEnabled(p.getWorld())) { diff --git a/src/test/java/io/github/thebusybiscuit/slimefun4/testing/tests/listeners/TestItemPickupListener.java b/src/test/java/io/github/thebusybiscuit/slimefun4/testing/tests/listeners/TestItemPickupListener.java new file mode 100644 index 000000000..081f76a84 --- /dev/null +++ b/src/test/java/io/github/thebusybiscuit/slimefun4/testing/tests/listeners/TestItemPickupListener.java @@ -0,0 +1,137 @@ +package io.github.thebusybiscuit.slimefun4.testing.tests.listeners; + +import java.util.UUID; +import java.util.concurrent.atomic.AtomicBoolean; + +import org.bukkit.Material; +import org.bukkit.entity.Item; +import org.bukkit.entity.Player; +import org.bukkit.event.entity.EntityPickupItemEvent; +import org.bukkit.event.inventory.InventoryPickupItemEvent; +import org.bukkit.inventory.Inventory; +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.params.ParameterizedTest; +import org.junit.jupiter.params.provider.ValueSource; + +import be.seeseemelk.mockbukkit.MockBukkit; +import be.seeseemelk.mockbukkit.ServerMock; +import be.seeseemelk.mockbukkit.entity.ItemEntityMock; +import be.seeseemelk.mockbukkit.inventory.ChestInventoryMock; +import io.github.thebusybiscuit.slimefun4.implementation.SlimefunPlugin; +import io.github.thebusybiscuit.slimefun4.implementation.listeners.AncientAltarListener; +import io.github.thebusybiscuit.slimefun4.implementation.listeners.ItemPickupListener; +import io.github.thebusybiscuit.slimefun4.utils.SlimefunUtils; +import me.mrCookieSlime.CSCoreLibPlugin.cscorelib2.item.CustomItem; + +class TestItemPickupListener { + + private static SlimefunPlugin plugin; + private static ItemPickupListener listener; + private static ServerMock server; + + @BeforeAll + public static void load() { + server = MockBukkit.mock(); + plugin = MockBukkit.load(SlimefunPlugin.class); + listener = new ItemPickupListener(plugin); + } + + @AfterAll + public static void unload() { + MockBukkit.unmock(); + } + + @ParameterizedTest + @ValueSource(booleans = { true, false }) + void testNoPickupFlagForEntities(boolean flag) { + Player player = server.addPlayer(); + Item item = new ItemEntityMock(server, UUID.randomUUID(), new ItemStack(Material.COMPASS)); + + if (flag) { + SlimefunUtils.markAsNoPickup(item, "Unit Test"); + } + + EntityPickupItemEvent event = new EntityPickupItemEvent(player, item, 1); + listener.onEntityPickup(event); + + Assertions.assertEquals(flag, event.isCancelled()); + } + + @ParameterizedTest + @ValueSource(booleans = { true, false }) + void testNoPickupFlagForInventories(boolean flag) { + Inventory inventory = new ChestInventoryMock(null, 5); + Item item = new ItemEntityMock(server, UUID.randomUUID(), new ItemStack(Material.COMPASS)); + + if (flag) { + SlimefunUtils.markAsNoPickup(item, "Unit Test"); + } + + InventoryPickupItemEvent event = new InventoryPickupItemEvent(inventory, item); + listener.onHopperPickup(event); + + Assertions.assertEquals(flag, event.isCancelled()); + } + + @ParameterizedTest + @ValueSource(booleans = { true, false }) + void testAltarProbeForEntities(boolean flag) { + Player player = server.addPlayer(); + ItemStack stack; + + if (flag) { + stack = new CustomItem(Material.DIAMOND, AncientAltarListener.ITEM_PREFIX + System.nanoTime()); + } + else { + stack = new CustomItem(Material.DIAMOND, "&5Just a normal named diamond"); + } + + AtomicBoolean removed = new AtomicBoolean(false); + Item item = new ItemEntityMock(server, UUID.randomUUID(), stack) { + + @Override + public void remove() { + removed.set(true); + } + }; + + EntityPickupItemEvent event = new EntityPickupItemEvent(player, item, 1); + listener.onEntityPickup(event); + + Assertions.assertEquals(flag, event.isCancelled()); + Assertions.assertEquals(flag, removed.get()); + } + + @ParameterizedTest + @ValueSource(booleans = { true, false }) + void testAltarProbeForInventories(boolean flag) { + Inventory inventory = new ChestInventoryMock(null, 5); + ItemStack stack; + + if (flag) { + stack = new CustomItem(Material.DIAMOND, AncientAltarListener.ITEM_PREFIX + System.nanoTime()); + } + else { + stack = new CustomItem(Material.DIAMOND, "&5Just a normal named diamond"); + } + + AtomicBoolean removed = new AtomicBoolean(false); + Item item = new ItemEntityMock(server, UUID.randomUUID(), stack) { + + @Override + public void remove() { + removed.set(true); + } + }; + + InventoryPickupItemEvent event = new InventoryPickupItemEvent(inventory, item); + listener.onHopperPickup(event); + + Assertions.assertEquals(flag, event.isCancelled()); + Assertions.assertEquals(flag, removed.get()); + } + +} diff --git a/src/test/java/io/github/thebusybiscuit/slimefun4/testing/tests/listeners/TestPiglinListener.java b/src/test/java/io/github/thebusybiscuit/slimefun4/testing/tests/listeners/TestPiglinListener.java index 161d2d1cc..8feb37334 100644 --- a/src/test/java/io/github/thebusybiscuit/slimefun4/testing/tests/listeners/TestPiglinListener.java +++ b/src/test/java/io/github/thebusybiscuit/slimefun4/testing/tests/listeners/TestPiglinListener.java @@ -1,5 +1,7 @@ package io.github.thebusybiscuit.slimefun4.testing.tests.listeners; +import java.util.UUID; + import org.bukkit.Material; import org.bukkit.entity.EntityType; import org.bukkit.entity.Item; @@ -19,6 +21,7 @@ import org.mockito.Mockito; import be.seeseemelk.mockbukkit.MockBukkit; import be.seeseemelk.mockbukkit.ServerMock; +import be.seeseemelk.mockbukkit.entity.ItemEntityMock; import io.github.thebusybiscuit.cscorelib2.item.CustomItem; import io.github.thebusybiscuit.slimefun4.implementation.SlimefunPlugin; import io.github.thebusybiscuit.slimefun4.implementation.listeners.PiglinListener; @@ -47,8 +50,7 @@ class TestPiglinListener { Piglin piglin = Mockito.mock(Piglin.class); Mockito.when(piglin.getType()).thenReturn(EntityType.PIGLIN); - Item itemEntity = Mockito.mock(Item.class); - Mockito.when(itemEntity.getItemStack()).thenReturn(item); + Item itemEntity = new ItemEntityMock(server, UUID.randomUUID(), item); return new EntityPickupItemEvent(piglin, itemEntity, 1); } diff --git a/src/test/java/io/github/thebusybiscuit/slimefun4/testing/tests/listeners/TestSlimefunGuideListener.java b/src/test/java/io/github/thebusybiscuit/slimefun4/testing/tests/listeners/TestSlimefunGuideListener.java new file mode 100644 index 000000000..aadef5254 --- /dev/null +++ b/src/test/java/io/github/thebusybiscuit/slimefun4/testing/tests/listeners/TestSlimefunGuideListener.java @@ -0,0 +1,71 @@ +package io.github.thebusybiscuit.slimefun4.testing.tests.listeners; + +import java.util.stream.Stream; + +import org.bukkit.entity.Player; +import org.bukkit.event.player.PlayerJoinEvent; +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.params.ParameterizedTest; +import org.junit.jupiter.params.provider.Arguments; +import org.junit.jupiter.params.provider.MethodSource; + +import be.seeseemelk.mockbukkit.MockBukkit; +import be.seeseemelk.mockbukkit.ServerMock; +import be.seeseemelk.mockbukkit.entity.PlayerMock; +import io.github.thebusybiscuit.slimefun4.core.guide.SlimefunGuide; +import io.github.thebusybiscuit.slimefun4.implementation.SlimefunPlugin; +import io.github.thebusybiscuit.slimefun4.implementation.listeners.SlimefunGuideListener; +import io.github.thebusybiscuit.slimefun4.utils.SlimefunUtils; + +class TestSlimefunGuideListener { + + private static SlimefunPlugin plugin; + private static ServerMock server; + + @BeforeAll + public static void load() { + server = MockBukkit.mock(); + plugin = MockBukkit.load(SlimefunPlugin.class); + } + + @AfterAll + public static void unload() { + MockBukkit.unmock(); + } + + @ParameterizedTest + @MethodSource("cartesianBooleans") + void testFirstJoin(boolean hasPlayedBefore, boolean giveSlimefunGuide) { + SlimefunGuideListener listener = new SlimefunGuideListener(plugin, giveSlimefunGuide); + PlayerMock player = new PlayerMock(server, "CanIHazGuide"); + + if (hasPlayedBefore) { + player.setLastPlayed(System.currentTimeMillis()); + } + + PlayerJoinEvent event = new PlayerJoinEvent(player, "CanIHazGuide has joined and wants sum guide"); + listener.onJoin(event); + + ItemStack guide = SlimefunGuide.getItem(SlimefunGuide.getDefaultLayout()); + Assertions.assertEquals(!hasPlayedBefore && giveSlimefunGuide, hasSlimefunGuide(player, guide)); + } + + private boolean hasSlimefunGuide(Player player, ItemStack guide) { + return SlimefunUtils.isItemSimilar(player.getInventory().getItem(0), guide, true); + } + + /** + * This returns an {@link Arguments} {@link Stream} of boolean combinations. + * It performs a certesian product on two boolean sets. + * + * @return a {@link Stream} of {@link Arguments} + */ + private static Stream cartesianBooleans() { + Stream stream = Stream.of(true, false); + return stream.flatMap(a -> Stream.of(true, false).map(b -> Arguments.of(a, b))); + } + +} From e406481b985c3ffc3ad5f5e5c52669cc3c6570c8 Mon Sep 17 00:00:00 2001 From: TheBusyBiscuit Date: Tue, 11 Aug 2020 16:23:31 +0200 Subject: [PATCH 52/81] [CI skip] Replaced the last tabs with spaces --- .../electric/generators/LavaGenerator.java | 28 +- .../setup/SlimefunItemSetup.java | 5616 ++++++++--------- 2 files changed, 2822 insertions(+), 2822 deletions(-) diff --git a/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/items/electric/generators/LavaGenerator.java b/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/items/electric/generators/LavaGenerator.java index 8d7f5df9e..89470aa34 100644 --- a/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/items/electric/generators/LavaGenerator.java +++ b/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/items/electric/generators/LavaGenerator.java @@ -11,23 +11,23 @@ import me.mrCookieSlime.Slimefun.api.SlimefunItemStack; public abstract class LavaGenerator extends AGenerator { - public LavaGenerator(Category category, SlimefunItemStack item, RecipeType recipeType, ItemStack[] recipe) { - super(category, item, recipeType, recipe); - } - + public LavaGenerator(Category category, SlimefunItemStack item, RecipeType recipeType, ItemStack[] recipe) { + super(category, item, recipeType, recipe); + } + @Override protected void registerDefaultFuelTypes() { - registerFuel(new MachineFuel(40, new ItemStack(Material.LAVA_BUCKET))); - } + registerFuel(new MachineFuel(40, new ItemStack(Material.LAVA_BUCKET))); + } - @Override - public ItemStack getProgressBar() { - return new ItemStack(Material.FLINT_AND_STEEL); - } + @Override + public ItemStack getProgressBar() { + return new ItemStack(Material.FLINT_AND_STEEL); + } - @Override - public String getInventoryTitle() { - return "&4Lava Generator"; - } + @Override + public String getInventoryTitle() { + return "&4Lava Generator"; + } } 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 c07619d3f..cab9e1e9a 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 @@ -218,1976 +218,1976 @@ public final class SlimefunItemSetup { } } - private SlimefunItemSetup() {} + private SlimefunItemSetup() {} - public static void setup(SlimefunPlugin plugin) { - if (registeredItems) { - throw new UnsupportedOperationException("Slimefun Items can only be registered once!"); - } + public static void setup(SlimefunPlugin plugin) { + if (registeredItems) { + throw new UnsupportedOperationException("Slimefun Items can only be registered once!"); + } - registeredItems = true; - DefaultCategories categories = new DefaultCategories(); - - new SlimefunItem(categories.weapons, SlimefunItems.GRANDMAS_WALKING_STICK, RecipeType.ENHANCED_CRAFTING_TABLE, - new ItemStack[] {null, new ItemStack(Material.OAK_LOG), null, null, new ItemStack(Material.OAK_LOG), null, null, new ItemStack(Material.OAK_LOG), null}) - .register(plugin); - - new SlimefunItem(categories.weapons, SlimefunItems.GRANDPAS_WALKING_STICK, RecipeType.ENHANCED_CRAFTING_TABLE, - new ItemStack[] {new ItemStack(Material.LEATHER), new ItemStack(Material.OAK_LOG), new ItemStack(Material.LEATHER), null, new ItemStack(Material.OAK_LOG), null, null, new ItemStack(Material.OAK_LOG), null}) - .register(plugin); - - new PortableCrafter(categories.usefulItems, SlimefunItems.PORTABLE_CRAFTER, RecipeType.ENHANCED_CRAFTING_TABLE, - new ItemStack[] {new ItemStack(Material.BOOK), new ItemStack(Material.CRAFTING_TABLE), null, null, null, null, null, null, null}) - .register(plugin); - - new FortuneCookie(categories.food, SlimefunItems.FORTUNE_COOKIE, RecipeType.ENHANCED_CRAFTING_TABLE, - new ItemStack[] {new ItemStack(Material.COOKIE), new ItemStack(Material.PAPER), null, null, null, null, null, null, null}) - .register(plugin); - - new DietCookie(categories.food, SlimefunItems.DIET_COOKIE, RecipeType.MAGIC_WORKBENCH, - new ItemStack[] {new ItemStack(Material.COOKIE), SlimefunItems.ELYTRA_SCALE, null, null, null, null, null, null, null}) - .register(plugin); - - new SlimefunItem(categories.basicMachines, SlimefunItems.OUTPUT_CHEST, RecipeType.ENHANCED_CRAFTING_TABLE, - new ItemStack[] {SlimefunItems.LEAD_INGOT, new ItemStack(Material.HOPPER), SlimefunItems.LEAD_INGOT, SlimefunItems.LEAD_INGOT, new ItemStack(Material.CHEST), SlimefunItems.LEAD_INGOT, null, SlimefunItems.LEAD_INGOT, null}) - .register(plugin); - - new EnhancedCraftingTable(categories.basicMachines, SlimefunItems.ENHANCED_CRAFTING_TABLE).register(plugin); - - new PortableDustbin(categories.usefulItems, SlimefunItems.PORTABLE_DUSTBIN, RecipeType.ENHANCED_CRAFTING_TABLE, - new ItemStack[] {new ItemStack(Material.IRON_INGOT), new ItemStack(Material.IRON_INGOT), new ItemStack(Material.IRON_INGOT), new ItemStack(Material.IRON_INGOT), null, new ItemStack(Material.IRON_INGOT), new ItemStack(Material.IRON_INGOT), new ItemStack(Material.IRON_INGOT), new ItemStack(Material.IRON_INGOT)}) - .register(plugin); - - new MeatJerky(categories.food, SlimefunItems.BEEF_JERKY, RecipeType.ENHANCED_CRAFTING_TABLE, - new ItemStack[] {SlimefunItems.SALT, new ItemStack(Material.COOKED_BEEF), null, null, null, null, null, null, null}) - .register(plugin); - - new MeatJerky(categories.food, SlimefunItems.PORK_JERKY, RecipeType.ENHANCED_CRAFTING_TABLE, - new ItemStack[] {SlimefunItems.SALT, new ItemStack(Material.COOKED_PORKCHOP), null, null, null, null, null, null, null}) - .register(plugin); - - new MeatJerky(categories.food, SlimefunItems.CHICKEN_JERKY, RecipeType.ENHANCED_CRAFTING_TABLE, - new ItemStack[] {SlimefunItems.SALT, new ItemStack(Material.COOKED_CHICKEN), null, null, null, null, null, null, null}) - .register(plugin); - - new MeatJerky(categories.food, SlimefunItems.MUTTON_JERKY, RecipeType.ENHANCED_CRAFTING_TABLE, - new ItemStack[] {SlimefunItems.SALT, new ItemStack(Material.COOKED_MUTTON), null, null, null, null, null, null, null}) - .register(plugin); - - new MeatJerky(categories.food, SlimefunItems.RABBIT_JERKY, RecipeType.ENHANCED_CRAFTING_TABLE, - new ItemStack[] {SlimefunItems.SALT, new ItemStack(Material.COOKED_RABBIT), null, null, null, null, null, null, null}) - .register(plugin); - - new MeatJerky(categories.food, SlimefunItems.FISH_JERKY, RecipeType.ENHANCED_CRAFTING_TABLE, - new ItemStack[] {SlimefunItems.SALT, new ItemStack(Material.COOKED_COD), null, null, null, null, null, null, null}) - .register(plugin); - - new SlimefunItem(categories.food, SlimefunItems.KELP_COOKIE, RecipeType.ENHANCED_CRAFTING_TABLE, - new ItemStack[] {null, new ItemStack(Material.DRIED_KELP), null, new ItemStack(Material.DRIED_KELP), new ItemStack(Material.SUGAR), new ItemStack(Material.DRIED_KELP), null, new ItemStack(Material.DRIED_KELP), null}, - new SlimefunItemStack(SlimefunItems.KELP_COOKIE, 2)) - .register(plugin); - - new GrindStone(categories.basicMachines, SlimefunItems.GRIND_STONE).register(plugin); - new ArmorForge(categories.basicMachines, SlimefunItems.ARMOR_FORGE).register(plugin); - - OreCrusher oreCrusher = new OreCrusher(categories.basicMachines, SlimefunItems.ORE_CRUSHER); - oreCrusher.register(plugin); - - new Compressor(categories.basicMachines, SlimefunItems.COMPRESSOR).register(plugin); - - new SlimefunItem(categories.magicalResources, SlimefunItems.MAGIC_LUMP_1, RecipeType.GRIND_STONE, - new ItemStack[] {new ItemStack(Material.NETHER_WART), null, null, null, null, null, null, null, null}, - new SlimefunItemStack(SlimefunItems.MAGIC_LUMP_1, 2)) - .register(plugin); - - new SlimefunItem(categories.magicalResources, SlimefunItems.MAGIC_LUMP_2, RecipeType.ENHANCED_CRAFTING_TABLE, - new ItemStack[] {SlimefunItems.MAGIC_LUMP_1, SlimefunItems.MAGIC_LUMP_1, null, SlimefunItems.MAGIC_LUMP_1, SlimefunItems.MAGIC_LUMP_1, null, null, null, null}) - .register(plugin); - - new SlimefunItem(categories.magicalResources, SlimefunItems.MAGIC_LUMP_3, RecipeType.ENHANCED_CRAFTING_TABLE, - new ItemStack[] {SlimefunItems.MAGIC_LUMP_2, SlimefunItems.MAGIC_LUMP_2, null, SlimefunItems.MAGIC_LUMP_2, SlimefunItems.MAGIC_LUMP_2, null, null, null, null}) - .register(plugin); - - new SlimefunItem(categories.magicalResources, SlimefunItems.ENDER_LUMP_1, RecipeType.ENHANCED_CRAFTING_TABLE, - new ItemStack[] {null, null, null, null, new ItemStack(Material.ENDER_EYE), null, null, null, null}, - new SlimefunItemStack(SlimefunItems.ENDER_LUMP_1, 2)) - .register(plugin); - - new SlimefunItem(categories.magicalResources, SlimefunItems.ENDER_LUMP_2, RecipeType.ENHANCED_CRAFTING_TABLE, - new ItemStack[] {SlimefunItems.ENDER_LUMP_1, SlimefunItems.ENDER_LUMP_1, null, SlimefunItems.ENDER_LUMP_1, SlimefunItems.ENDER_LUMP_1, null, null, null, null}) - .register(plugin); - - new SlimefunItem(categories.magicalResources, SlimefunItems.ENDER_LUMP_3, RecipeType.ENHANCED_CRAFTING_TABLE, - new ItemStack[] {SlimefunItems.ENDER_LUMP_2, SlimefunItems.ENDER_LUMP_2, null, SlimefunItems.ENDER_LUMP_2, SlimefunItems.ENDER_LUMP_2, null, null, null, null}) - .register(plugin); - - new EnderBackpack(categories.magicalGadgets, SlimefunItems.ENDER_BACKPACK, RecipeType.MAGIC_WORKBENCH, - new ItemStack[] {SlimefunItems.ENDER_LUMP_2, new ItemStack(Material.LEATHER), SlimefunItems.ENDER_LUMP_2, new ItemStack(Material.LEATHER), new ItemStack(Material.CHEST), new ItemStack(Material.LEATHER), SlimefunItems.ENDER_LUMP_2, new ItemStack(Material.LEATHER), SlimefunItems.ENDER_LUMP_2}) - .register(plugin); - - new SlimefunItem(categories.magicalArmor, SlimefunItems.ENDER_HELMET, RecipeType.ARMOR_FORGE, - new ItemStack[] {SlimefunItems.ENDER_LUMP_1, new ItemStack(Material.ENDER_EYE), SlimefunItems.ENDER_LUMP_1, new ItemStack(Material.OBSIDIAN), null, new ItemStack(Material.OBSIDIAN), null, null, null}) - .register(plugin); - - new SlimefunItem(categories.magicalArmor, SlimefunItems.ENDER_CHESTPLATE, RecipeType.ARMOR_FORGE, - new ItemStack[] {SlimefunItems.ENDER_LUMP_1, null, SlimefunItems.ENDER_LUMP_1, new ItemStack(Material.OBSIDIAN), new ItemStack(Material.ENDER_EYE), new ItemStack(Material.OBSIDIAN), new ItemStack(Material.OBSIDIAN), new ItemStack(Material.OBSIDIAN), new ItemStack(Material.OBSIDIAN)}) - .register(plugin); - - new SlimefunItem(categories.magicalArmor, SlimefunItems.ENDER_LEGGINGS, RecipeType.ARMOR_FORGE, - new ItemStack[] {SlimefunItems.ENDER_LUMP_1, new ItemStack(Material.ENDER_EYE), SlimefunItems.ENDER_LUMP_1, new ItemStack(Material.OBSIDIAN), null, new ItemStack(Material.OBSIDIAN), new ItemStack(Material.OBSIDIAN), null, new ItemStack(Material.OBSIDIAN)}) - .register(plugin); - - new SlimefunItem(categories.magicalArmor, SlimefunItems.ENDER_BOOTS, RecipeType.ARMOR_FORGE, - new ItemStack[] {null, null, null, SlimefunItems.ENDER_LUMP_1, null, SlimefunItems.ENDER_LUMP_1, new ItemStack(Material.OBSIDIAN), null, new ItemStack(Material.OBSIDIAN)}) - .register(plugin); - - new MagicEyeOfEnder(categories.magicalGadgets, SlimefunItems.MAGIC_EYE_OF_ENDER, RecipeType.MAGIC_WORKBENCH, - new ItemStack[] {SlimefunItems.ENDER_LUMP_2, new ItemStack(Material.ENDER_PEARL), SlimefunItems.ENDER_LUMP_2, new ItemStack(Material.ENDER_PEARL), new ItemStack(Material.ENDER_EYE), new ItemStack(Material.ENDER_PEARL), SlimefunItems.ENDER_LUMP_2, new ItemStack(Material.ENDER_PEARL), SlimefunItems.ENDER_LUMP_2}) - .register(plugin); - - new MagicSugar(categories.food, SlimefunItems.MAGIC_SUGAR, RecipeType.ENHANCED_CRAFTING_TABLE, - new ItemStack[] {new ItemStack(Material.SUGAR), new ItemStack(Material.REDSTONE), new ItemStack(Material.GLOWSTONE_DUST), null, null, null, null, null, null}) - .register(plugin); - - new MonsterJerky(categories.food, SlimefunItems.MONSTER_JERKY, RecipeType.ENHANCED_CRAFTING_TABLE, - new ItemStack[] {SlimefunItems.SALT, new ItemStack(Material.ROTTEN_FLESH), null, null, null, null, null, null, null}) - .register(plugin); - - 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 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, - 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), new ItemStack(Material.IRON_INGOT), null, new ItemStack(Material.IRON_INGOT)}, - new PotionEffect[] {new PotionEffect(PotionEffectType.SPEED, 300, 2)}) - .register(plugin); - - new SlimefunArmorPiece(categories.magicalArmor, SlimefunItems.SLIME_BOOTS, RecipeType.ARMOR_FORGE, - new ItemStack[] {null, null, null, new ItemStack(Material.SLIME_BALL), null, new ItemStack(Material.SLIME_BALL), new ItemStack(Material.IRON_INGOT), null, new ItemStack(Material.IRON_INGOT)}, - new PotionEffect[] {new PotionEffect(PotionEffectType.JUMP, 300, 5)}) - .register(plugin); - - new SwordOfBeheading(categories.weapons, SlimefunItems.SWORD_OF_BEHEADING, RecipeType.ENHANCED_CRAFTING_TABLE, - new ItemStack[] {null, new ItemStack(Material.EMERALD), null, SlimefunItems.MAGIC_LUMP_2, new ItemStack(Material.EMERALD), SlimefunItems.MAGIC_LUMP_2, null, new ItemStack(Material.BLAZE_ROD), null}) - .register(plugin); - - new SlimefunItem(categories.magicalResources, SlimefunItems.MAGICAL_BOOK_COVER, RecipeType.ENHANCED_CRAFTING_TABLE, - 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); - - new UnplaceableBlock(categories.technicalComponents, SlimefunItems.ADVANCED_CIRCUIT_BOARD, RecipeType.ENHANCED_CRAFTING_TABLE, - new ItemStack[] {new ItemStack(Material.LAPIS_BLOCK), new ItemStack(Material.LAPIS_BLOCK), new ItemStack(Material.LAPIS_BLOCK), new ItemStack(Material.REDSTONE_BLOCK), SlimefunItems.BASIC_CIRCUIT_BOARD, new ItemStack(Material.REDSTONE_BLOCK), new ItemStack(Material.LAPIS_BLOCK), new ItemStack(Material.LAPIS_BLOCK), new ItemStack(Material.LAPIS_BLOCK)}) - .register(plugin); - - new GoldPan(categories.tools, SlimefunItems.GOLD_PAN, RecipeType.ENHANCED_CRAFTING_TABLE, - new ItemStack[] {null, null, null, new ItemStack(Material.STONE), new ItemStack(Material.BOWL), new ItemStack(Material.STONE), new ItemStack(Material.STONE), new ItemStack(Material.STONE), new ItemStack(Material.STONE)}) - .register(plugin); - - new NetherGoldPan(categories.tools, SlimefunItems.NETHER_GOLD_PAN, RecipeType.ENHANCED_CRAFTING_TABLE, - new ItemStack[] {null, null, null, new ItemStack(Material.NETHER_BRICK), SlimefunItems.GOLD_PAN, new ItemStack(Material.NETHER_BRICK), new ItemStack(Material.NETHER_BRICK), new ItemStack(Material.NETHER_BRICK), new ItemStack(Material.NETHER_BRICK)}) - .register(plugin); - - new SlimefunItem(categories.misc, SlimefunItems.SIFTED_ORE, RecipeType.GOLD_PAN, - new ItemStack[] {new ItemStack(Material.GRAVEL), null, null, null, null, null, null, null, null}) - .register(plugin); - - new MakeshiftSmeltery(categories.basicMachines, SlimefunItems.MAKESHIFT_SMELTERY).register(plugin); - new Smeltery(categories.basicMachines, SlimefunItems.SMELTERY).register(plugin); - - new SlimefunItem(categories.basicMachines, SlimefunItems.IGNITION_CHAMBER, RecipeType.ENHANCED_CRAFTING_TABLE, - new ItemStack[] {new ItemStack(Material.IRON_INGOT), new ItemStack(Material.FLINT_AND_STEEL), new ItemStack(Material.IRON_INGOT), new ItemStack(Material.IRON_INGOT), SlimefunItems.BASIC_CIRCUIT_BOARD, new ItemStack(Material.IRON_INGOT), null, new ItemStack(Material.OBSERVER), null}) - .register(plugin); - - new PressureChamber(categories.basicMachines, SlimefunItems.PRESSURE_CHAMBER).register(plugin); - - new SlimefunItem(categories.technicalComponents, SlimefunItems.BATTERY, RecipeType.ENHANCED_CRAFTING_TABLE, - new ItemStack[] {null, new ItemStack(Material.REDSTONE), null, SlimefunItems.ZINC_INGOT, SlimefunItems.SULFATE, SlimefunItems.COPPER_INGOT, SlimefunItems.ZINC_INGOT, SlimefunItems.SULFATE, SlimefunItems.COPPER_INGOT}) - .register(plugin); - - registerArmorSet(categories.magicalArmor, new ItemStack(Material.GLOWSTONE), new ItemStack[] {SlimefunItems.GLOWSTONE_HELMET, SlimefunItems.GLOWSTONE_CHESTPLATE, SlimefunItems.GLOWSTONE_LEGGINGS, SlimefunItems.GLOWSTONE_BOOTS}, "GLOWSTONE", false, - new PotionEffect[][] { - new PotionEffect[] {new PotionEffect(PotionEffectType.NIGHT_VISION, 600, 0)}, - new PotionEffect[] {new PotionEffect(PotionEffectType.NIGHT_VISION, 600, 0)}, - new PotionEffect[] {new PotionEffect(PotionEffectType.NIGHT_VISION, 600, 0)}, - new PotionEffect[] {new PotionEffect(PotionEffectType.NIGHT_VISION, 600, 0)} - }, plugin); - - registerArmorSet(categories.armor, SlimefunItems.DAMASCUS_STEEL_INGOT, new ItemStack[] {SlimefunItems.DAMASCUS_STEEL_HELMET, SlimefunItems.DAMASCUS_STEEL_CHESTPLATE, SlimefunItems.DAMASCUS_STEEL_LEGGINGS, SlimefunItems.DAMASCUS_STEEL_BOOTS}, "DAMASCUS_STEEL", false, new PotionEffect[0][0], plugin); - - registerArmorSet(categories.armor, SlimefunItems.REINFORCED_ALLOY_INGOT, new ItemStack[] {SlimefunItems.REINFORCED_ALLOY_HELMET, SlimefunItems.REINFORCED_ALLOY_CHESTPLATE, SlimefunItems.REINFORCED_ALLOY_LEGGINGS, SlimefunItems.REINFORCED_ALLOY_BOOTS}, "REINFORCED_ALLOY", false, new PotionEffect[0][0], plugin); - - registerArmorSet(categories.armor, new ItemStack(Material.CACTUS), new ItemStack[] {SlimefunItems.CACTUS_HELMET, SlimefunItems.CACTUS_CHESTPLATE, SlimefunItems.CACTUS_LEGGINGS, SlimefunItems.CACTUS_BOOTS}, "CACTUS", false, new PotionEffect[0][0], plugin); - - new SlimefunItem(categories.resources, SlimefunItems.REINFORCED_ALLOY_INGOT, RecipeType.SMELTERY, - new ItemStack[] {SlimefunItems.DAMASCUS_STEEL_INGOT, SlimefunItems.HARDENED_METAL_INGOT, SlimefunItems.CORINTHIAN_BRONZE_INGOT, SlimefunItems.SOLDER_INGOT, SlimefunItems.BILLON_INGOT, SlimefunItems.GOLD_24K, null, null, null}) - .register(plugin); - - new SlimefunItem(categories.resources, SlimefunItems.HARDENED_METAL_INGOT, RecipeType.SMELTERY, - new ItemStack[] {SlimefunItems.DAMASCUS_STEEL_INGOT, SlimefunItems.DURALUMIN_INGOT, SlimefunItems.COMPRESSED_CARBON, SlimefunItems.ALUMINUM_BRONZE_INGOT, null, null, null, null, null}) - .register(plugin); - - new SlimefunItem(categories.resources, SlimefunItems.DAMASCUS_STEEL_INGOT, RecipeType.SMELTERY, - new ItemStack[] {SlimefunItems.STEEL_INGOT, SlimefunItems.IRON_DUST, SlimefunItems.CARBON, new ItemStack(Material.IRON_INGOT), null, null, null, null, null}) - .register(plugin); - - new SlimefunItem(categories.resources, SlimefunItems.STEEL_INGOT, RecipeType.SMELTERY, - new ItemStack[] {SlimefunItems.IRON_DUST, SlimefunItems.CARBON, new ItemStack(Material.IRON_INGOT), null, null, null, null, null, null}) - .register(plugin); - - new SlimefunItem(categories.resources, SlimefunItems.BRONZE_INGOT, RecipeType.SMELTERY, - new ItemStack[] {SlimefunItems.COPPER_DUST, SlimefunItems.TIN_DUST, SlimefunItems.COPPER_INGOT, null, null, null, null, null, null}) - .register(plugin); - - new SlimefunItem(categories.resources, SlimefunItems.DURALUMIN_INGOT, RecipeType.SMELTERY, - new ItemStack[] {SlimefunItems.ALUMINUM_DUST, SlimefunItems.COPPER_DUST, SlimefunItems.ALUMINUM_INGOT, null, null, null, null, null, null}) - .register(plugin); - - new SlimefunItem(categories.resources, SlimefunItems.BILLON_INGOT, RecipeType.SMELTERY, - new ItemStack[] {SlimefunItems.SILVER_DUST, SlimefunItems.COPPER_DUST, SlimefunItems.SILVER_INGOT, null, null, null, null, null, null}) - .register(plugin); - - new SlimefunItem(categories.resources, SlimefunItems.BRASS_INGOT, RecipeType.SMELTERY, - new ItemStack[] {SlimefunItems.COPPER_DUST, SlimefunItems.ZINC_DUST, SlimefunItems.COPPER_INGOT, null, null, null, null, null, null}) - .register(plugin); - - new SlimefunItem(categories.resources, SlimefunItems.ALUMINUM_BRASS_INGOT, RecipeType.SMELTERY, - new ItemStack[] {SlimefunItems.ALUMINUM_DUST, SlimefunItems.BRASS_INGOT, SlimefunItems.ALUMINUM_INGOT, null, null, null, null, null, null}) - .register(plugin); - - new SlimefunItem(categories.resources, SlimefunItems.ALUMINUM_BRONZE_INGOT, RecipeType.SMELTERY, - new ItemStack[] {SlimefunItems.ALUMINUM_DUST, SlimefunItems.BRONZE_INGOT, SlimefunItems.ALUMINUM_INGOT, null, null, null, null, null, null}) - .register(plugin); - - new SlimefunItem(categories.resources, SlimefunItems.CORINTHIAN_BRONZE_INGOT, RecipeType.SMELTERY, - new ItemStack[] {SlimefunItems.SILVER_DUST, SlimefunItems.GOLD_DUST, SlimefunItems.COPPER_DUST, SlimefunItems.BRONZE_INGOT, null, null, null, null, null}) - .register(plugin); - - new SlimefunItem(categories.resources, SlimefunItems.SOLDER_INGOT, RecipeType.SMELTERY, - new ItemStack[] {SlimefunItems.LEAD_DUST, SlimefunItems.TIN_DUST, SlimefunItems.LEAD_INGOT, null, null, null, null, null, null}) - .register(plugin); - - new SlimefunItem(categories.resources, SlimefunItems.SYNTHETIC_SAPPHIRE, RecipeType.SMELTERY, - new ItemStack[] {SlimefunItems.ALUMINUM_DUST, new ItemStack(Material.GLASS), new ItemStack(Material.GLASS_PANE), SlimefunItems.ALUMINUM_INGOT, new ItemStack(Material.LAPIS_LAZULI), null, null, null, null}) - .setUseableInWorkbench(true) - .register(plugin); - - new SlimefunItem(categories.resources, SlimefunItems.SYNTHETIC_DIAMOND, RecipeType.PRESSURE_CHAMBER, - new ItemStack[] {SlimefunItems.CARBON_CHUNK, null, null, null, null, null, null, null, null}) - .setUseableInWorkbench(true) - .register(plugin); - - new SlimefunItem(categories.resources, SlimefunItems.RAW_CARBONADO, RecipeType.SMELTERY, - new ItemStack[] {SlimefunItems.SYNTHETIC_DIAMOND, SlimefunItems.CARBON_CHUNK, new ItemStack(Material.GLASS_PANE), null, null, null, null, null, null}) - .register(plugin); - - new SlimefunItem(categories.resources, SlimefunItems.NICKEL_INGOT, RecipeType.SMELTERY, - new ItemStack[] {SlimefunItems.IRON_DUST, new ItemStack(Material.IRON_INGOT), SlimefunItems.COPPER_DUST, null, null, null, null, null, null}) - .register(plugin); - - new SlimefunItem(categories.resources, SlimefunItems.COBALT_INGOT, RecipeType.SMELTERY, - new ItemStack[] {SlimefunItems.IRON_DUST, SlimefunItems.COPPER_DUST, SlimefunItems.NICKEL_INGOT, null, null, null, null, null, null}) - .register(plugin); - - new SlimefunItem(categories.resources, SlimefunItems.CARBONADO, RecipeType.PRESSURE_CHAMBER, - new ItemStack[] {SlimefunItems.RAW_CARBONADO, null, null, null, null, null, null, null, null}) - .register(plugin); - - new SlimefunItem(categories.resources, SlimefunItems.FERROSILICON, RecipeType.SMELTERY, - new ItemStack[] {new ItemStack(Material.IRON_INGOT), SlimefunItems.IRON_DUST, SlimefunItems.SILICON, null, null, null, null, null, null}) - .register(plugin); - - new SlimefunItem(categories.resources, SlimefunItems.IRON_DUST, RecipeType.ORE_CRUSHER, - new ItemStack[] {new ItemStack(Material.IRON_ORE), null, null, null, null, null, null, null, null}, - new SlimefunItemStack(SlimefunItems.IRON_DUST, oreCrusher.isOreDoublingEnabled() ? 2 : 1)) - .register(plugin); - - new SlimefunItem(categories.resources, SlimefunItems.GOLD_DUST, RecipeType.ORE_CRUSHER, - new ItemStack[] {new ItemStack(Material.GOLD_ORE), null, null, null, null, null, null, null, null}, - new SlimefunItemStack(SlimefunItems.GOLD_DUST, oreCrusher.isOreDoublingEnabled() ? 2 : 1)) - .register(plugin); - - new SlimefunItem(categories.resources, SlimefunItems.COPPER_DUST, RecipeType.ORE_WASHER, - new ItemStack[] {SlimefunItems.SIFTED_ORE, null, null, null, null, null, null, null, null}) - .register(plugin); - - new SlimefunItem(categories.resources, SlimefunItems.TIN_DUST, RecipeType.ORE_WASHER, - new ItemStack[] {SlimefunItems.SIFTED_ORE, null, null, null, null, null, null, null, null}) - .register(plugin); - - new SlimefunItem(categories.resources, SlimefunItems.LEAD_DUST, RecipeType.ORE_WASHER, - new ItemStack[] {SlimefunItems.SIFTED_ORE, null, null, null, null, null, null, null, null}) - .register(plugin); - - new SlimefunItem(categories.resources, SlimefunItems.SILVER_DUST, RecipeType.ORE_WASHER, - new ItemStack[] {SlimefunItems.SIFTED_ORE, null, null, null, null, null, null, null, null}) - .register(plugin); - - new SlimefunItem(categories.resources, SlimefunItems.ALUMINUM_DUST, RecipeType.ORE_WASHER, - new ItemStack[] {SlimefunItems.SIFTED_ORE, null, null, null, null, null, null, null, null}) - .register(plugin); - - new SlimefunItem(categories.resources, SlimefunItems.ZINC_DUST, RecipeType.ORE_WASHER, - new ItemStack[] {SlimefunItems.SIFTED_ORE, null, null, null, null, null, null, null, null}) - .register(plugin); - - new SlimefunItem(categories.resources, SlimefunItems.MAGNESIUM_DUST, RecipeType.ORE_WASHER, - new ItemStack[] {SlimefunItems.SIFTED_ORE, null, null, null, null, null, null, null, null}) - .register(plugin); - - new SlimefunItem(categories.resources, SlimefunItems.COPPER_INGOT, RecipeType.SMELTERY, - new ItemStack[] {SlimefunItems.COPPER_DUST, null, null, null, null, null, null, null, null}) - .register(plugin); - - new SlimefunItem(categories.resources, SlimefunItems.TIN_INGOT, RecipeType.SMELTERY, - new ItemStack[] {SlimefunItems.TIN_DUST, null, null, null, null, null, null, null, null}) - .register(plugin); - - new SlimefunItem(categories.resources, SlimefunItems.SILVER_INGOT, RecipeType.SMELTERY, - new ItemStack[] {SlimefunItems.SILVER_DUST, null, null, null, null, null, null, null, null}) - .register(plugin); - - new SlimefunItem(categories.resources, SlimefunItems.LEAD_INGOT, RecipeType.SMELTERY, - new ItemStack[] {SlimefunItems.LEAD_DUST, null, null, null, null, null, null, null, null}) - .register(plugin); - - new SlimefunItem(categories.resources, SlimefunItems.ALUMINUM_INGOT, RecipeType.SMELTERY, - new ItemStack[] {SlimefunItems.ALUMINUM_DUST, null, null, null, null, null, null, null, null}) - .register(plugin); - - new SlimefunItem(categories.resources, SlimefunItems.ZINC_INGOT, RecipeType.SMELTERY, - new ItemStack[] {SlimefunItems.ZINC_DUST, null, null, null, null, null, null, null, null}) - .register(plugin); - - new SlimefunItem(categories.resources, SlimefunItems.MAGNESIUM_INGOT, RecipeType.SMELTERY, - new ItemStack[] {SlimefunItems.MAGNESIUM_DUST, null, null, null, null, null, null, null, null}) - .register(plugin); - - new SlimefunItem(categories.resources, SlimefunItems.SULFATE, RecipeType.ORE_CRUSHER, - new ItemStack[] {new ItemStack(Material.NETHERRACK, 16), null, null, null, null, null, null, null, null}) - .register(plugin); - - new UnplaceableBlock(categories.resources, SlimefunItems.CARBON, RecipeType.COMPRESSOR, - new ItemStack[] {new ItemStack(Material.COAL, 8), null, null, null, null, null, null, null, null}) - .register(plugin); - - new SlimefunItem(categories.misc, SlimefunItems.WHEAT_FLOUR, RecipeType.GRIND_STONE, - new ItemStack[] {new ItemStack(Material.WHEAT), null, null, null, null, null, null, null, null}) - .register(plugin); - - new SlimefunItem(categories.misc, SlimefunItems.STEEL_PLATE, RecipeType.COMPRESSOR, - new ItemStack[] {new SlimefunItemStack(SlimefunItems.STEEL_INGOT, 8), null, null, null, null, null, null, null, null}) - .register(plugin); - - new UnplaceableBlock(categories.resources, SlimefunItems.COMPRESSED_CARBON, RecipeType.COMPRESSOR, - new ItemStack[] {new SlimefunItemStack(SlimefunItems.CARBON, 4), null, null, null, null, null, null, null, null}) - .register(plugin); - - new UnplaceableBlock(categories.resources, SlimefunItems.CARBON_CHUNK, RecipeType.ENHANCED_CRAFTING_TABLE, - new ItemStack[] {SlimefunItems.COMPRESSED_CARBON, SlimefunItems.COMPRESSED_CARBON, SlimefunItems.COMPRESSED_CARBON, SlimefunItems.COMPRESSED_CARBON, new ItemStack(Material.FLINT), SlimefunItems.COMPRESSED_CARBON, SlimefunItems.COMPRESSED_CARBON, SlimefunItems.COMPRESSED_CARBON, SlimefunItems.COMPRESSED_CARBON}) - .register(plugin); - - new SlimefunItem(categories.technicalComponents, SlimefunItems.STEEL_THRUSTER, RecipeType.ENHANCED_CRAFTING_TABLE, - new ItemStack[] {null, new ItemStack(Material.REDSTONE), null, SlimefunItems.ALUMINUM_BRONZE_INGOT, SlimefunItems.ALUMINUM_BRONZE_INGOT, SlimefunItems.ALUMINUM_BRONZE_INGOT, SlimefunItems.STEEL_PLATE, new ItemStack(Material.FIRE_CHARGE), SlimefunItems.STEEL_PLATE}) - .register(plugin); - - new SlimefunItem(categories.technicalComponents, SlimefunItems.POWER_CRYSTAL, RecipeType.ENHANCED_CRAFTING_TABLE, - new ItemStack[] {new ItemStack(Material.REDSTONE), SlimefunItems.SYNTHETIC_SAPPHIRE, new ItemStack(Material.REDSTONE), SlimefunItems.SYNTHETIC_SAPPHIRE, SlimefunItems.SYNTHETIC_DIAMOND, SlimefunItems.SYNTHETIC_SAPPHIRE, new ItemStack(Material.REDSTONE), SlimefunItems.SYNTHETIC_SAPPHIRE, new ItemStack(Material.REDSTONE)}) - .register(plugin); - - 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, 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, 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, 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, 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, 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, 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, 150) - .register(plugin); - - new Parachute(categories.technicalGadgets, SlimefunItems.PARACHUTE, RecipeType.ENHANCED_CRAFTING_TABLE, - new ItemStack[] {SlimefunItems.CLOTH, SlimefunItems.CLOTH, SlimefunItems.CLOTH, SlimefunItems.CHAIN, null, SlimefunItems.CHAIN, null, null, null}) - .register(plugin); - - new HologramProjector(categories.technicalGadgets, SlimefunItems.HOLOGRAM_PROJECTOR, RecipeType.ENHANCED_CRAFTING_TABLE, - new ItemStack[] {null, SlimefunItems.POWER_CRYSTAL, null, SlimefunItems.ALUMINUM_BRASS_INGOT, SlimefunItems.ELECTRIC_MOTOR, SlimefunItems.ALUMINUM_BRASS_INGOT, null, SlimefunItems.ALUMINUM_BRASS_INGOT, null}, - new SlimefunItemStack(SlimefunItems.HOLOGRAM_PROJECTOR, 3)) - .register(plugin); - - new SlimefunItem(categories.misc, SlimefunItems.CHAIN, RecipeType.ENHANCED_CRAFTING_TABLE, - new ItemStack[] {null, null, SlimefunItems.STEEL_INGOT, null, SlimefunItems.STEEL_INGOT, null, SlimefunItems.STEEL_INGOT, null, null}, - new SlimefunItemStack(SlimefunItems.CHAIN, 8)) - .register(plugin); - - new SlimefunItem(categories.misc, SlimefunItems.HOOK, RecipeType.ENHANCED_CRAFTING_TABLE, - new ItemStack[] {null, SlimefunItems.STEEL_INGOT, null, SlimefunItems.STEEL_INGOT, null, SlimefunItems.STEEL_INGOT, null, null, null}) - .register(plugin); - - new GrapplingHook(categories.tools, SlimefunItems.GRAPPLING_HOOK, RecipeType.ENHANCED_CRAFTING_TABLE, - new ItemStack[] {null, null, SlimefunItems.HOOK, null, SlimefunItems.CHAIN, null, SlimefunItems.CHAIN, null, null}) - .register(plugin); - - new MagicWorkbench(categories.basicMachines, SlimefunItems.MAGIC_WORKBENCH).register(plugin); - - new SlimefunItem(categories.magicalGadgets, SlimefunItems.STAFF_ELEMENTAL, RecipeType.MAGIC_WORKBENCH, - new ItemStack[] {null, SlimefunItems.MAGICAL_BOOK_COVER, SlimefunItems.MAGIC_LUMP_3, null, new ItemStack(Material.STICK), SlimefunItems.MAGICAL_BOOK_COVER, SlimefunItems.MAGIC_LUMP_3, null, null}) - .register(plugin); - - new WindStaff(categories.magicalGadgets, SlimefunItems.STAFF_WIND, RecipeType.MAGIC_WORKBENCH, - new ItemStack[] {null, new ItemStack(Material.FEATHER), SlimefunItems.ENDER_LUMP_3, null, SlimefunItems.STAFF_ELEMENTAL, new ItemStack(Material.FEATHER), SlimefunItems.STAFF_ELEMENTAL, null, null}) - .register(plugin); - - new WaterStaff(categories.magicalGadgets, SlimefunItems.STAFF_WATER, RecipeType.MAGIC_WORKBENCH, - new ItemStack[] {null, new ItemStack(Material.LILY_PAD), SlimefunItems.MAGIC_LUMP_2, null, SlimefunItems.STAFF_ELEMENTAL, new ItemStack(Material.LILY_PAD), SlimefunItems.STAFF_ELEMENTAL, null, null}) - .register(plugin); - - String[] multiToolItems = new String[] {"PORTABLE_CRAFTER", "MAGIC_EYE_OF_ENDER", "STAFF_ELEMENTAL_WIND", "GRAPPLING_HOOK"}; - - 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}, - 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}, - 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}, - 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}, - 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}, - 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}, - 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}, - 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); - - new SlimefunItem(categories.resources, SlimefunItems.GOLD_24K, RecipeType.SMELTERY, - new ItemStack[] {SlimefunItems.GOLD_DUST, SlimefunItems.GOLD_22K, null, null, null, null, null, null, null}) - .register(plugin); - - new SlimefunItem(categories.resources, SlimefunItems.GOLD_22K, RecipeType.SMELTERY, - new ItemStack[] {SlimefunItems.GOLD_DUST, SlimefunItems.GOLD_20K, null, null, null, null, null, null, null}) - .register(plugin); - - new SlimefunItem(categories.resources, SlimefunItems.GOLD_20K, RecipeType.SMELTERY, - new ItemStack[] {SlimefunItems.GOLD_DUST, SlimefunItems.GOLD_18K, null, null, null, null, null, null, null}) - .register(plugin); - - new SlimefunItem(categories.resources, SlimefunItems.GOLD_18K, RecipeType.SMELTERY, - new ItemStack[] {SlimefunItems.GOLD_DUST, SlimefunItems.GOLD_16K, null, null, null, null, null, null, null}) - .register(plugin); - - new SlimefunItem(categories.resources, SlimefunItems.GOLD_16K, RecipeType.SMELTERY, - new ItemStack[] {SlimefunItems.GOLD_DUST, SlimefunItems.GOLD_14K, null, null, null, null, null, null, null}) - .register(plugin); - - new SlimefunItem(categories.resources, SlimefunItems.GOLD_14K, RecipeType.SMELTERY, - new ItemStack[] {SlimefunItems.GOLD_DUST, SlimefunItems.GOLD_12K, null, null, null, null, null, null, null}) - .register(plugin); - - new SlimefunItem(categories.resources, SlimefunItems.GOLD_12K, RecipeType.SMELTERY, - new ItemStack[] {SlimefunItems.GOLD_DUST, SlimefunItems.GOLD_10K, null, null, null, null, null, null, null}) - .register(plugin); - - new SlimefunItem(categories.resources, SlimefunItems.GOLD_10K, RecipeType.SMELTERY, - new ItemStack[] {SlimefunItems.GOLD_DUST, SlimefunItems.GOLD_8K, null, null, null, null, null, null, null}) - .register(plugin); - - new SlimefunItem(categories.resources, SlimefunItems.GOLD_8K, RecipeType.SMELTERY, - new ItemStack[] {SlimefunItems.GOLD_DUST, SlimefunItems.GOLD_6K, null, null, null, null, null, null, null}) - .register(plugin); - - new SlimefunItem(categories.resources, SlimefunItems.GOLD_6K, RecipeType.SMELTERY, - new ItemStack[] {SlimefunItems.GOLD_DUST, SlimefunItems.GOLD_4K, null, null, null, null, null, null, null}) - .register(plugin); - - new SlimefunItem(categories.resources, SlimefunItems.GOLD_4K, RecipeType.SMELTERY, - new ItemStack[] {SlimefunItems.GOLD_DUST, null, null, null, null, null, null, null, null}) - .setUseableInWorkbench(true) - .register(plugin); - - new SlimefunItem(categories.misc, SlimefunItems.STONE_CHUNK, RecipeType.ORE_WASHER, - new ItemStack[] {SlimefunItems.SIFTED_ORE, null, null, null, null, null, null, null, null}) - .register(plugin); - - new SlimefunItem(categories.resources, SlimefunItems.SILICON, RecipeType.SMELTERY, - new ItemStack[] {new ItemStack(Material.QUARTZ_BLOCK), null, null, null, null, null, null, null, null}) - .register(plugin); - - new SlimefunItem(categories.technicalComponents, SlimefunItems.SOLAR_PANEL, RecipeType.ENHANCED_CRAFTING_TABLE, - new ItemStack[] {new ItemStack(Material.GLASS), new ItemStack(Material.GLASS), new ItemStack(Material.GLASS), SlimefunItems.SILICON, SlimefunItems.SILICON, SlimefunItems.SILICON, SlimefunItems.FERROSILICON, SlimefunItems.FERROSILICON, SlimefunItems.FERROSILICON}) - .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}, - 0.1) - .register(plugin); - - new UnplaceableBlock(categories.magicalResources, SlimefunItems.LAVA_CRYSTAL, RecipeType.ENHANCED_CRAFTING_TABLE, - new ItemStack[] {SlimefunItems.MAGIC_LUMP_1, new ItemStack(Material.BLAZE_POWDER), SlimefunItems.MAGIC_LUMP_1, new ItemStack(Material.BLAZE_POWDER), SlimefunItems.FIRE_RUNE, new ItemStack(Material.BLAZE_POWDER), SlimefunItems.MAGIC_LUMP_1, new ItemStack(Material.BLAZE_POWDER), SlimefunItems.MAGIC_LUMP_1}) - .register(plugin); - - new SlimefunItem(categories.magicalGadgets, SlimefunItems.STAFF_FIRE, RecipeType.MAGIC_WORKBENCH, - new ItemStack[] {null, null, SlimefunItems.LAVA_CRYSTAL, null, SlimefunItems.STAFF_ELEMENTAL, null, SlimefunItems.STAFF_ELEMENTAL, null, null}) - .register(plugin); - - if (SlimefunPlugin.getMinecraftVersion().isAtLeast(MinecraftVersion.MINECRAFT_1_14)) { - new StormStaff(categories.magicalGadgets, SlimefunItems.STAFF_STORM, RecipeType.ANCIENT_ALTAR, - new ItemStack[] {SlimefunItems.LIGHTNING_RUNE, SlimefunItems.ENDER_LUMP_3, SlimefunItems.LIGHTNING_RUNE, SlimefunItems.STAFF_WATER, SlimefunItems.MAGIC_SUGAR, SlimefunItems.STAFF_WIND, SlimefunItems.LIGHTNING_RUNE, SlimefunItems.ENDER_LUMP_3, SlimefunItems.LIGHTNING_RUNE}) - .register(plugin); - - ItemStack weaknessPotion = new ItemStack(Material.POTION); - PotionMeta meta = (PotionMeta) weaknessPotion.getItemMeta(); - meta.setBasePotionData(new PotionData(PotionType.WEAKNESS, false, false)); - weaknessPotion.setItemMeta(meta); - - new MagicalZombiePills(categories.magicalGadgets, SlimefunItems.MAGICAL_ZOMBIE_PILLS, RecipeType.MAGIC_WORKBENCH, - new ItemStack[] {new ItemStack(Material.GOLD_INGOT), SlimefunItems.MAGIC_LUMP_2, new ItemStack(Material.GOLD_INGOT), new ItemStack(Material.APPLE), weaknessPotion, new ItemStack(Material.APPLE), new ItemStack(Material.GOLD_INGOT), SlimefunItems.MAGIC_LUMP_2, new ItemStack(Material.GOLD_INGOT)}, - new SlimefunItemStack(SlimefunItems.MAGICAL_ZOMBIE_PILLS, 2)) - .register(plugin); - } - - new SmeltersPickaxe(categories.tools, SlimefunItems.SMELTERS_PICKAXE, RecipeType.ENHANCED_CRAFTING_TABLE, - new ItemStack[] {SlimefunItems.LAVA_CRYSTAL, SlimefunItems.LAVA_CRYSTAL, SlimefunItems.LAVA_CRYSTAL, null, SlimefunItems.FERROSILICON, null, null, SlimefunItems.FERROSILICON, null}) - .register(plugin); - - new SlimefunItem(categories.magicalResources, SlimefunItems.COMMON_TALISMAN, RecipeType.MAGIC_WORKBENCH, - new ItemStack[] {SlimefunItems.MAGIC_LUMP_2, SlimefunItems.GOLD_8K, SlimefunItems.MAGIC_LUMP_2, null, new ItemStack(Material.EMERALD), null, SlimefunItems.MAGIC_LUMP_2, SlimefunItems.GOLD_8K, SlimefunItems.MAGIC_LUMP_2}) - .register(plugin); - - new Talisman(SlimefunItems.TALISMAN_ANVIL, - new ItemStack[] {SlimefunItems.MAGIC_LUMP_3, null, SlimefunItems.MAGIC_LUMP_3, new ItemStack(Material.ANVIL), SlimefunItems.COMMON_TALISMAN, new ItemStack(Material.ANVIL), SlimefunItems.MAGIC_LUMP_3, null, SlimefunItems.MAGIC_LUMP_3}, - true, false, "anvil") - .register(plugin); - - new Talisman(SlimefunItems.TALISMAN_MINER, - new ItemStack[] {SlimefunItems.MAGIC_LUMP_3, null, SlimefunItems.MAGIC_LUMP_3, SlimefunItems.SYNTHETIC_SAPPHIRE, SlimefunItems.COMMON_TALISMAN, SlimefunItems.SIFTED_ORE, SlimefunItems.MAGIC_LUMP_3, null, SlimefunItems.MAGIC_LUMP_3}, - false, false, "miner", 20) - .register(plugin); - - new Talisman(SlimefunItems.TALISMAN_HUNTER, - new ItemStack[] {SlimefunItems.MAGIC_LUMP_3, null, SlimefunItems.MAGIC_LUMP_3, SlimefunItems.SYNTHETIC_SAPPHIRE, SlimefunItems.COMMON_TALISMAN, SlimefunItems.MONSTER_JERKY, SlimefunItems.MAGIC_LUMP_3, null, SlimefunItems.MAGIC_LUMP_3}, - false, false, "hunter", 20) - .register(plugin); - - new Talisman(SlimefunItems.TALISMAN_LAVA, - new ItemStack[] {SlimefunItems.MAGIC_LUMP_3, null, SlimefunItems.MAGIC_LUMP_3, SlimefunItems.LAVA_CRYSTAL, SlimefunItems.COMMON_TALISMAN, new ItemStack(Material.LAVA_BUCKET), SlimefunItems.MAGIC_LUMP_3, null, SlimefunItems.MAGIC_LUMP_3}, - true, true, "lava", new PotionEffect(PotionEffectType.FIRE_RESISTANCE, 3600, 4)) - .register(plugin); - - new Talisman(SlimefunItems.TALISMAN_WATER, - new ItemStack[] {SlimefunItems.MAGIC_LUMP_3, null, SlimefunItems.MAGIC_LUMP_3, new ItemStack(Material.WATER_BUCKET), SlimefunItems.COMMON_TALISMAN, new ItemStack(Material.FISHING_ROD), SlimefunItems.MAGIC_LUMP_3, null, SlimefunItems.MAGIC_LUMP_3}, - true, true, "water", new PotionEffect(PotionEffectType.WATER_BREATHING, 3600, 4)) - .register(plugin); - - new Talisman(SlimefunItems.TALISMAN_ANGEL, - new ItemStack[] {SlimefunItems.MAGIC_LUMP_3, null, SlimefunItems.MAGIC_LUMP_3, new ItemStack(Material.FEATHER), SlimefunItems.COMMON_TALISMAN, new ItemStack(Material.FEATHER), SlimefunItems.MAGIC_LUMP_3, null, SlimefunItems.MAGIC_LUMP_3}, - false, true, "angel", 75) - .register(plugin); - - new Talisman(SlimefunItems.TALISMAN_FIRE, - new ItemStack[] {SlimefunItems.MAGIC_LUMP_3, null, SlimefunItems.MAGIC_LUMP_3, SlimefunItems.LAVA_CRYSTAL, SlimefunItems.COMMON_TALISMAN, SlimefunItems.LAVA_CRYSTAL, SlimefunItems.MAGIC_LUMP_3, null, SlimefunItems.MAGIC_LUMP_3}, - true, true, "fire", new PotionEffect(PotionEffectType.FIRE_RESISTANCE, 3600, 4)) - .register(plugin); - - new MagicianTalisman(SlimefunItems.TALISMAN_MAGICIAN, - new ItemStack[] {SlimefunItems.ENDER_LUMP_3, null, SlimefunItems.ENDER_LUMP_3, new ItemStack(Material.ENCHANTING_TABLE), SlimefunItems.COMMON_TALISMAN, new ItemStack(Material.ENCHANTING_TABLE), SlimefunItems.ENDER_LUMP_3, null, SlimefunItems.ENDER_LUMP_3}) - .register(plugin); - - new Talisman(SlimefunItems.TALISMAN_TRAVELLER, - new ItemStack[] {SlimefunItems.MAGIC_LUMP_3, null, SlimefunItems.MAGIC_LUMP_3, SlimefunItems.STAFF_WIND, SlimefunItems.TALISMAN_ANGEL, SlimefunItems.STAFF_WIND, SlimefunItems.MAGIC_LUMP_3, null, SlimefunItems.MAGIC_LUMP_3}, - false, false, "traveller", 60, new PotionEffect(PotionEffectType.SPEED, 3600, 2)) - .register(plugin); - - new Talisman(SlimefunItems.TALISMAN_WARRIOR, - new ItemStack[] {SlimefunItems.MAGIC_LUMP_3, null, SlimefunItems.MAGIC_LUMP_3, SlimefunItems.REINFORCED_ALLOY_INGOT, SlimefunItems.COMMON_TALISMAN, SlimefunItems.REINFORCED_ALLOY_INGOT, SlimefunItems.MAGIC_LUMP_3, null, SlimefunItems.MAGIC_LUMP_3}, - true, true, "warrior", new PotionEffect(PotionEffectType.INCREASE_DAMAGE, 3600, 2)) - .register(plugin); - - new Talisman(SlimefunItems.TALISMAN_KNIGHT, - new ItemStack[] {SlimefunItems.MAGIC_LUMP_3, null, SlimefunItems.MAGIC_LUMP_3, SlimefunItems.GILDED_IRON, SlimefunItems.TALISMAN_WARRIOR, SlimefunItems.GILDED_IRON, SlimefunItems.MAGIC_LUMP_3, null, SlimefunItems.MAGIC_LUMP_3}, - "knight", 30, new PotionEffect(PotionEffectType.REGENERATION, 100, 3)) - .register(plugin); - - new SlimefunItem(categories.resources, SlimefunItems.GILDED_IRON, RecipeType.SMELTERY, - new ItemStack[] {SlimefunItems.GOLD_24K, SlimefunItems.IRON_DUST, null, null, null, null, null, null, null}) - .register(plugin); - - new SyntheticEmerald(categories.resources, SlimefunItems.SYNTHETIC_EMERALD, RecipeType.SMELTERY, - new ItemStack[] {SlimefunItems.SYNTHETIC_SAPPHIRE, SlimefunItems.ALUMINUM_DUST, SlimefunItems.ALUMINUM_INGOT, new ItemStack(Material.GLASS_PANE), null, null, null, null, null}) - .register(plugin); - - registerArmorSet(categories.armor, SlimefunItems.CHAIN, new ItemStack[] { - new ItemStack(Material.CHAINMAIL_HELMET), new ItemStack(Material.CHAINMAIL_CHESTPLATE), new ItemStack(Material.CHAINMAIL_LEGGINGS), new ItemStack(Material.CHAINMAIL_BOOTS) - }, "CHAIN", true, new PotionEffect[0][0], plugin); - - new Talisman(SlimefunItems.TALISMAN_WHIRLWIND, - new ItemStack[] {SlimefunItems.MAGIC_LUMP_3, null, SlimefunItems.MAGIC_LUMP_3, SlimefunItems.STAFF_WIND, SlimefunItems.TALISMAN_TRAVELLER, SlimefunItems.STAFF_WIND, SlimefunItems.MAGIC_LUMP_3, null, SlimefunItems.MAGIC_LUMP_3} - , false, true, "whirlwind", 60) - .register(plugin); - - new Talisman(SlimefunItems.TALISMAN_WIZARD, - new ItemStack[] {SlimefunItems.ENDER_LUMP_3, null, SlimefunItems.ENDER_LUMP_3, SlimefunItems.MAGIC_EYE_OF_ENDER, SlimefunItems.TALISMAN_MAGICIAN, SlimefunItems.MAGIC_EYE_OF_ENDER, SlimefunItems.ENDER_LUMP_3, null, SlimefunItems.ENDER_LUMP_3}, - false, false, "wizard", 60) - .register(plugin); - - new LumberAxe(categories.tools, SlimefunItems.LUMBER_AXE, RecipeType.MAGIC_WORKBENCH, - new ItemStack[] {SlimefunItems.SYNTHETIC_DIAMOND, SlimefunItems.SYNTHETIC_DIAMOND, null, SlimefunItems.SYNTHETIC_EMERALD, SlimefunItems.GILDED_IRON, null, null, SlimefunItems.GILDED_IRON, null}) - .register(plugin); - - new SlimefunItem(categories.misc, SlimefunItems.SALT, RecipeType.ORE_WASHER, - new ItemStack[] {new ItemStack(Material.SAND, 2), null, null, null, null, null, null, null, null}) - .register(plugin); - - new SlimefunItem(categories.misc, SlimefunItems.HEAVY_CREAM, RecipeType.ENHANCED_CRAFTING_TABLE, - new ItemStack[] {new ItemStack(Material.MILK_BUCKET), null, null, null, null, null, null, null, null}, - new SlimefunItemStack(SlimefunItems.HEAVY_CREAM, 2)) - .register(plugin); - - new SlimefunItem(categories.misc, SlimefunItems.CHEESE, RecipeType.ENHANCED_CRAFTING_TABLE, - new ItemStack[] {new ItemStack(Material.MILK_BUCKET), SlimefunItems.SALT, null, null, null, null, null, null, null}) - .register(plugin); - - new SlimefunItem(categories.misc, SlimefunItems.BUTTER, RecipeType.ENHANCED_CRAFTING_TABLE, - new ItemStack[] {SlimefunItems.HEAVY_CREAM, SlimefunItems.SALT, null, null, null, null, null, null, null}) - .register(plugin); - - 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, new PotionEffect[0][0], 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 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 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 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 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, - new ItemStack[] {SlimefunItems.SIFTED_ORE, null, null, null, null, null, null, null, null}) - .register(plugin); - - new SlimefunItem(categories.misc, SlimefunItems.PULVERIZED_ORE, RecipeType.ORE_CRUSHER, - new ItemStack[] {SlimefunItems.CRUSHED_ORE, null, null, null, null, null, null, null, null}) - .register(plugin); - - new SlimefunItem(categories.misc, SlimefunItems.PURE_ORE_CLUSTER, RecipeType.ORE_WASHER, - new ItemStack[] {SlimefunItems.PULVERIZED_ORE, null, null, null, null, null, null, null, null}) - .register(plugin); - - new UnplaceableBlock(categories.misc, SlimefunItems.TINY_URANIUM, RecipeType.ORE_CRUSHER, - new ItemStack[] {SlimefunItems.PURE_ORE_CLUSTER, null, null, null, null, null, null, null, null}) - .register(plugin); - - new RadioactiveItem(categories.misc, Radioactivity.MODERATE, SlimefunItems.SMALL_URANIUM, RecipeType.ENHANCED_CRAFTING_TABLE, - new ItemStack[] {SlimefunItems.TINY_URANIUM, SlimefunItems.TINY_URANIUM, SlimefunItems.TINY_URANIUM, SlimefunItems.TINY_URANIUM, SlimefunItems.TINY_URANIUM, SlimefunItems.TINY_URANIUM, SlimefunItems.TINY_URANIUM, SlimefunItems.TINY_URANIUM, SlimefunItems.TINY_URANIUM}) - .register(plugin); - - new RadioactiveItem(categories.resources, Radioactivity.HIGH, SlimefunItems.URANIUM, RecipeType.ENHANCED_CRAFTING_TABLE, - new ItemStack[] {SlimefunItems.SMALL_URANIUM, SlimefunItems.SMALL_URANIUM, null, SlimefunItems.SMALL_URANIUM, SlimefunItems.SMALL_URANIUM, null, null, null, null}) - .register(plugin); - - new SlimefunItem(categories.resources, SlimefunItems.REDSTONE_ALLOY, RecipeType.SMELTERY, - new ItemStack[] {new ItemStack(Material.REDSTONE), new ItemStack(Material.REDSTONE_BLOCK), SlimefunItems.FERROSILICON, SlimefunItems.HARDENED_METAL_INGOT, null, null, null, null, null}) - .register(plugin); - - registerArmorSet(categories.armor, SlimefunItems.GOLD_12K, new ItemStack[] { - SlimefunItems.GOLD_HELMET, SlimefunItems.GOLD_CHESTPLATE, SlimefunItems.GOLD_LEGGINGS, SlimefunItems.GOLD_BOOTS - }, "GOLD_12K", false, new PotionEffect[0][0], plugin); - - new SlimefunItem(categories.misc, SlimefunItems.CLOTH, RecipeType.ENHANCED_CRAFTING_TABLE, - new ItemStack[] {new ItemStack(Material.WHITE_WOOL), null, null, null, null, null, null, null, null}, - new SlimefunItemStack(SlimefunItems.CLOTH, 8)) - .register(plugin); - - new Bandage(categories.usefulItems, SlimefunItems.RAG, RecipeType.ENHANCED_CRAFTING_TABLE, - new ItemStack[] {SlimefunItems.CLOTH, SlimefunItems.CLOTH, SlimefunItems.CLOTH, new ItemStack(Material.STRING), null, new ItemStack(Material.STRING), SlimefunItems.CLOTH, SlimefunItems.CLOTH, SlimefunItems.CLOTH}, - new SlimefunItemStack(SlimefunItems.RAG, 2), 0) - .register(plugin); - - new Bandage(categories.usefulItems, SlimefunItems.BANDAGE, RecipeType.ENHANCED_CRAFTING_TABLE, - new ItemStack[] {SlimefunItems.RAG, new ItemStack(Material.STRING), SlimefunItems.RAG, null, null, null, null, null, null}, - new SlimefunItemStack(SlimefunItems.BANDAGE, 4), 1) - .register(plugin); - - new Splint(categories.usefulItems, SlimefunItems.SPLINT, RecipeType.ENHANCED_CRAFTING_TABLE, - new ItemStack[] {null, new ItemStack(Material.IRON_INGOT), null, new ItemStack(Material.STICK), new ItemStack(Material.STICK), new ItemStack(Material.STICK), null, new ItemStack(Material.IRON_INGOT), null}, - new SlimefunItemStack(SlimefunItems.SPLINT, 4)) - .register(plugin); - - new SlimefunItem(categories.misc, SlimefunItems.TIN_CAN, RecipeType.ENHANCED_CRAFTING_TABLE, - new ItemStack[] {SlimefunItems.TIN_INGOT, SlimefunItems.TIN_INGOT, SlimefunItems.TIN_INGOT, SlimefunItems.TIN_INGOT, null, SlimefunItems.TIN_INGOT, SlimefunItems.TIN_INGOT, SlimefunItems.TIN_INGOT, SlimefunItems.TIN_INGOT}, - new SlimefunItemStack(SlimefunItems.TIN_CAN, 8)) - .register(plugin); - - new Vitamins(categories.usefulItems, SlimefunItems.VITAMINS, RecipeType.ENHANCED_CRAFTING_TABLE, - new ItemStack[] {SlimefunItems.TIN_CAN, new ItemStack(Material.APPLE), new ItemStack(Material.RED_MUSHROOM), new ItemStack(Material.SUGAR), null, null, null, null, null}) - .register(plugin); - - new Medicine(categories.usefulItems, SlimefunItems.MEDICINE, RecipeType.ENHANCED_CRAFTING_TABLE, - new ItemStack[] {SlimefunItems.VITAMINS, new ItemStack(Material.GLASS_BOTTLE), SlimefunItems.HEAVY_CREAM, null, null, null, null, null, null}) - .register(plugin); - - new SlimefunArmorPiece(categories.technicalGadgets, SlimefunItems.NIGHT_VISION_GOGGLES, RecipeType.ARMOR_FORGE, - new ItemStack[] {new ItemStack(Material.COAL_BLOCK), new ItemStack(Material.COAL_BLOCK), new ItemStack(Material.COAL_BLOCK), new ItemStack(Material.LIME_STAINED_GLASS_PANE), new ItemStack(Material.COAL_BLOCK), new ItemStack(Material.LIME_STAINED_GLASS_PANE), new ItemStack(Material.COAL_BLOCK), null, new ItemStack(Material.COAL_BLOCK)}, - new PotionEffect[] {new PotionEffect(PotionEffectType.NIGHT_VISION, 600, 20)}) - .register(plugin); - - new PickaxeOfContainment(categories.tools, SlimefunItems.PICKAXE_OF_CONTAINMENT, RecipeType.MAGIC_WORKBENCH, - new ItemStack[] {SlimefunItems.FERROSILICON, SlimefunItems.FERROSILICON, SlimefunItems.FERROSILICON, null, SlimefunItems.GILDED_IRON, null, null, SlimefunItems.GILDED_IRON, null}) - .register(plugin); - - new HerculesPickaxe(categories.tools, SlimefunItems.HERCULES_PICKAXE, RecipeType.MAGIC_WORKBENCH, - new ItemStack[] {SlimefunItems.HARDENED_METAL_INGOT, SlimefunItems.HARDENED_METAL_INGOT, SlimefunItems.HARDENED_METAL_INGOT, null, SlimefunItems.FERROSILICON, null, null, SlimefunItems.FERROSILICON, null}) - .register(plugin); + registeredItems = true; + DefaultCategories categories = new DefaultCategories(); - if (SlimefunPlugin.getMinecraftVersion().isAtLeast(MinecraftVersion.MINECRAFT_1_14)) { - new TableSaw(categories.basicMachines, SlimefunItems.TABLE_SAW).register(plugin); - } - - 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 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, - 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), new ItemStack(Material.SLIME_BALL), null, new ItemStack(Material.SLIME_BALL)}, - new PotionEffect[] {new PotionEffect(PotionEffectType.SPEED, 300, 2)}) - .register(plugin); - - new SlimefunArmorPiece(categories.magicalArmor, SlimefunItems.SLIME_BOOTS_STEEL, RecipeType.ARMOR_FORGE, - new ItemStack[] {null, null, null, 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 PotionEffect[] {new PotionEffect(PotionEffectType.JUMP, 300, 5)}) - .register(plugin); - - new VampireBlade(categories.weapons, SlimefunItems.BLADE_OF_VAMPIRES, RecipeType.MAGIC_WORKBENCH, - new ItemStack[] {null, new ItemStack(Material.WITHER_SKELETON_SKULL), null, null, new ItemStack(Material.WITHER_SKELETON_SKULL), null, null, new ItemStack(Material.BLAZE_ROD), null}) - .register(plugin); - - new SlimefunItem(categories.misc, SlimefunItems.GOLD_24K_BLOCK, RecipeType.ENHANCED_CRAFTING_TABLE, - new ItemStack[] {SlimefunItems.GOLD_24K, SlimefunItems.GOLD_24K, SlimefunItems.GOLD_24K, SlimefunItems.GOLD_24K, SlimefunItems.GOLD_24K, SlimefunItems.GOLD_24K, SlimefunItems.GOLD_24K, SlimefunItems.GOLD_24K, SlimefunItems.GOLD_24K}) - .register(plugin); - - new Composter(categories.basicMachines, SlimefunItems.COMPOSTER, RecipeType.ENHANCED_CRAFTING_TABLE, - new ItemStack[] {new ItemStack(Material.OAK_SLAB), null, new ItemStack(Material.OAK_SLAB), new ItemStack(Material.OAK_SLAB), null, new ItemStack(Material.OAK_SLAB), new ItemStack(Material.OAK_SLAB), new ItemStack(Material.CAULDRON), new ItemStack(Material.OAK_SLAB)}) - .register(plugin); - - new SlimefunItem(categories.magicalArmor, SlimefunItems.FARMER_SHOES, RecipeType.ARMOR_FORGE, - new ItemStack[] {null, null, null, new ItemStack(Material.HAY_BLOCK), null, new ItemStack(Material.HAY_BLOCK), new ItemStack(Material.HAY_BLOCK), null, new ItemStack(Material.HAY_BLOCK)}) - .register(plugin); - - new ExplosivePickaxe(categories.tools, SlimefunItems.EXPLOSIVE_PICKAXE, RecipeType.MAGIC_WORKBENCH, - new ItemStack[] {new ItemStack(Material.TNT), SlimefunItems.SYNTHETIC_DIAMOND, new ItemStack(Material.TNT), null, SlimefunItems.FERROSILICON, null, null, SlimefunItems.FERROSILICON, null}) - .register(plugin); - - new ExplosiveShovel(categories.tools, SlimefunItems.EXPLOSIVE_SHOVEL, RecipeType.MAGIC_WORKBENCH, - new ItemStack[] {null, SlimefunItems.SYNTHETIC_DIAMOND, null, null, new ItemStack(Material.TNT), null, null, SlimefunItems.FERROSILICON, null}) - .register(plugin); - - new AutomatedPanningMachine(categories.basicMachines, SlimefunItems.AUTOMATED_PANNING_MACHINE).register(plugin); - - new IndustrialMiner(categories.basicMachines, SlimefunItems.INDUSTRIAL_MINER, Material.IRON_BLOCK, false, 3).register(plugin); - new AdvancedIndustrialMiner(categories.basicMachines, SlimefunItems.ADVANCED_INDUSTRIAL_MINER).register(plugin); - - new SlimefunItem(categories.magicalArmor, SlimefunItems.BOOTS_OF_THE_STOMPER, RecipeType.ARMOR_FORGE, - new ItemStack[] {null, null, null, new ItemStack(Material.YELLOW_WOOL), null, new ItemStack(Material.YELLOW_WOOL), new ItemStack(Material.PISTON), null, new ItemStack(Material.PISTON)}) - .register(plugin); - - new PickaxeOfTheSeeker(categories.tools, SlimefunItems.PICKAXE_OF_THE_SEEKER, RecipeType.MAGIC_WORKBENCH, - new ItemStack[] {new ItemStack(Material.COMPASS), SlimefunItems.SYNTHETIC_DIAMOND, new ItemStack(Material.COMPASS), null, SlimefunItems.FERROSILICON, null, null, SlimefunItems.FERROSILICON, null}) - .register(plugin); - - new SlimefunBackpack(9, categories.usefulItems, SlimefunItems.BACKPACK_SMALL, RecipeType.ENHANCED_CRAFTING_TABLE, - new ItemStack[] {new ItemStack(Material.LEATHER), null, new ItemStack(Material.LEATHER), SlimefunItems.GOLD_6K, new ItemStack(Material.CHEST), SlimefunItems.GOLD_6K, new ItemStack(Material.LEATHER), new ItemStack(Material.LEATHER), new ItemStack(Material.LEATHER)}) - .register(plugin); - - new SlimefunBackpack(18, categories.usefulItems, SlimefunItems.BACKPACK_MEDIUM, RecipeType.ENHANCED_CRAFTING_TABLE, - new ItemStack[] {new ItemStack(Material.LEATHER), null, new ItemStack(Material.LEATHER), SlimefunItems.GOLD_10K, SlimefunItems.BACKPACK_SMALL, SlimefunItems.GOLD_10K, new ItemStack(Material.LEATHER), new ItemStack(Material.LEATHER), new ItemStack(Material.LEATHER)}) - .register(plugin); - - new SlimefunBackpack(27, categories.usefulItems, SlimefunItems.BACKPACK_LARGE, RecipeType.ENHANCED_CRAFTING_TABLE, - new ItemStack[] {new ItemStack(Material.LEATHER), null, new ItemStack(Material.LEATHER), SlimefunItems.GOLD_14K, SlimefunItems.BACKPACK_MEDIUM, SlimefunItems.GOLD_14K, new ItemStack(Material.LEATHER), new ItemStack(Material.LEATHER), new ItemStack(Material.LEATHER)}) - .register(plugin); - - new SlimefunBackpack(36, categories.usefulItems, SlimefunItems.WOVEN_BACKPACK, RecipeType.ENHANCED_CRAFTING_TABLE, - new ItemStack[] {SlimefunItems.CLOTH, null, SlimefunItems.CLOTH, SlimefunItems.GOLD_16K, SlimefunItems.BACKPACK_LARGE, SlimefunItems.GOLD_16K, SlimefunItems.CLOTH, SlimefunItems.CLOTH, SlimefunItems.CLOTH}) - .register(plugin); - - new Crucible(categories.basicMachines, SlimefunItems.CRUCIBLE, RecipeType.ENHANCED_CRAFTING_TABLE, - new ItemStack[] {new ItemStack(Material.TERRACOTTA), null, new ItemStack(Material.TERRACOTTA), new ItemStack(Material.TERRACOTTA), null, new ItemStack(Material.TERRACOTTA), new ItemStack(Material.TERRACOTTA), new ItemStack(Material.FLINT_AND_STEEL), new ItemStack(Material.TERRACOTTA)}) - .register(plugin); - - new SlimefunBackpack(45, categories.usefulItems, SlimefunItems.GILDED_BACKPACK, RecipeType.ENHANCED_CRAFTING_TABLE, - new ItemStack[] {SlimefunItems.GOLD_22K, null, SlimefunItems.GOLD_22K, new ItemStack(Material.LEATHER), SlimefunItems.WOVEN_BACKPACK, new ItemStack(Material.LEATHER), SlimefunItems.GOLD_22K, null, SlimefunItems.GOLD_22K}) - .register(plugin); - - new SlimefunBackpack(54, categories.usefulItems, SlimefunItems.RADIANT_BACKPACK, RecipeType.ENHANCED_CRAFTING_TABLE, - new ItemStack[] {SlimefunItems.GOLD_24K, null, SlimefunItems.GOLD_24K, new ItemStack(Material.LEATHER), SlimefunItems.GILDED_BACKPACK, new ItemStack(Material.LEATHER), SlimefunItems.GOLD_24K, null, SlimefunItems.GOLD_24K}) - .register(plugin); - - new RestoredBackpack(categories.usefulItems).register(plugin); - - new SlimefunItem(categories.technicalComponents, SlimefunItems.MAGNET, RecipeType.SMELTERY, - new ItemStack[] {SlimefunItems.NICKEL_INGOT, SlimefunItems.ALUMINUM_DUST, SlimefunItems.IRON_DUST, SlimefunItems.COBALT_INGOT, null, null, null, null, null}) - .register(plugin); - - new InfusedMagnet(categories.magicalGadgets, SlimefunItems.INFUSED_MAGNET, RecipeType.MAGIC_WORKBENCH, - new ItemStack[] {SlimefunItems.MAGIC_LUMP_3, null, SlimefunItems.MAGIC_LUMP_3, SlimefunItems.ENDER_LUMP_2, SlimefunItems.MAGNET, SlimefunItems.ENDER_LUMP_2, SlimefunItems.MAGIC_LUMP_3, null, SlimefunItems.MAGIC_LUMP_3}) - .register(plugin); - - new SlimefunItem(categories.tools, SlimefunItems.COBALT_PICKAXE, RecipeType.ENHANCED_CRAFTING_TABLE, - new ItemStack[] {SlimefunItems.COBALT_INGOT, SlimefunItems.COBALT_INGOT, SlimefunItems.COBALT_INGOT, null, SlimefunItems.NICKEL_INGOT, null, null, SlimefunItems.NICKEL_INGOT, null}) - .register(plugin); - - new SlimefunItem(categories.magicalResources, SlimefunItems.NECROTIC_SKULL, RecipeType.MAGIC_WORKBENCH, - new ItemStack[] {SlimefunItems.MAGIC_LUMP_3, null, SlimefunItems.MAGIC_LUMP_3, null, new ItemStack(Material.WITHER_SKELETON_SKULL), null, SlimefunItems.MAGIC_LUMP_3, null, SlimefunItems.MAGIC_LUMP_3}) - .register(plugin); - - new SlimefunItem(categories.magicalResources, SlimefunItems.ESSENCE_OF_AFTERLIFE, RecipeType.ANCIENT_ALTAR, - 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.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, 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, 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, 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, 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, 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, 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, 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, 50) - .register(plugin); - - new SeismicAxe(categories.weapons, SlimefunItems.SEISMIC_AXE, RecipeType.MAGIC_WORKBENCH, - new ItemStack[] {SlimefunItems.HARDENED_METAL_INGOT, SlimefunItems.HARDENED_METAL_INGOT, null, SlimefunItems.HARDENED_METAL_INGOT, SlimefunItems.STAFF_ELEMENTAL, null, null, SlimefunItems.STAFF_ELEMENTAL, null}) - .register(plugin); - - new PickaxeOfVeinMining(categories.tools, SlimefunItems.PICKAXE_OF_VEIN_MINING, RecipeType.MAGIC_WORKBENCH, - new ItemStack[] {new ItemStack(Material.EMERALD_ORE), SlimefunItems.SYNTHETIC_DIAMOND, new ItemStack(Material.EMERALD_ORE), null, SlimefunItems.GILDED_IRON, null, null, SlimefunItems.GILDED_IRON, null}) - .register(plugin); - - new SoulboundItem(categories.weapons, SlimefunItems.SOULBOUND_SWORD, RecipeType.MAGIC_WORKBENCH, - new ItemStack[] {null, SlimefunItems.ESSENCE_OF_AFTERLIFE, null, null, new ItemStack(Material.DIAMOND_SWORD), null, null, SlimefunItems.ESSENCE_OF_AFTERLIFE, null}) - .register(plugin); - - new SoulboundItem(categories.weapons, SlimefunItems.SOULBOUND_TRIDENT, RecipeType.MAGIC_WORKBENCH, - new ItemStack[] {null, SlimefunItems.ESSENCE_OF_AFTERLIFE, null, null, new ItemStack(Material.TRIDENT), null, null, SlimefunItems.ESSENCE_OF_AFTERLIFE, null}) - .register(plugin); - - new SoulboundItem(categories.weapons, SlimefunItems.SOULBOUND_BOW, RecipeType.MAGIC_WORKBENCH, - new ItemStack[] {null, SlimefunItems.ESSENCE_OF_AFTERLIFE, null, null, new ItemStack(Material.BOW), null, null, SlimefunItems.ESSENCE_OF_AFTERLIFE, null}) - .register(plugin); - - new SoulboundItem(categories.tools, SlimefunItems.SOULBOUND_PICKAXE, RecipeType.MAGIC_WORKBENCH, - new ItemStack[] {null, SlimefunItems.ESSENCE_OF_AFTERLIFE, null, null, new ItemStack(Material.DIAMOND_PICKAXE), null, null, SlimefunItems.ESSENCE_OF_AFTERLIFE, null}) - .register(plugin); - - new SoulboundItem(categories.tools, SlimefunItems.SOULBOUND_AXE, RecipeType.MAGIC_WORKBENCH, - new ItemStack[] {null, SlimefunItems.ESSENCE_OF_AFTERLIFE, null, null, new ItemStack(Material.DIAMOND_AXE), null, null, SlimefunItems.ESSENCE_OF_AFTERLIFE, null}) - .register(plugin); - - new SoulboundItem(categories.tools, SlimefunItems.SOULBOUND_SHOVEL, RecipeType.MAGIC_WORKBENCH, - new ItemStack[] {null, SlimefunItems.ESSENCE_OF_AFTERLIFE, null, null, new ItemStack(Material.DIAMOND_SHOVEL), null, null, SlimefunItems.ESSENCE_OF_AFTERLIFE, null}) - .register(plugin); - - new SoulboundItem(categories.tools, SlimefunItems.SOULBOUND_HOE, RecipeType.MAGIC_WORKBENCH, - new ItemStack[] {null, SlimefunItems.ESSENCE_OF_AFTERLIFE, null, null, new ItemStack(Material.DIAMOND_HOE), null, null, SlimefunItems.ESSENCE_OF_AFTERLIFE, null}) - .register(plugin); - - new SoulboundItem(categories.magicalArmor, SlimefunItems.SOULBOUND_HELMET, RecipeType.MAGIC_WORKBENCH, - new ItemStack[] {null, SlimefunItems.ESSENCE_OF_AFTERLIFE, null, null, new ItemStack(Material.DIAMOND_HELMET), null, null, SlimefunItems.ESSENCE_OF_AFTERLIFE, null}) - .register(plugin); - - new SoulboundItem(categories.magicalArmor, SlimefunItems.SOULBOUND_CHESTPLATE, RecipeType.MAGIC_WORKBENCH, - new ItemStack[] {null, SlimefunItems.ESSENCE_OF_AFTERLIFE, null, null, new ItemStack(Material.DIAMOND_CHESTPLATE), null, null, SlimefunItems.ESSENCE_OF_AFTERLIFE, null}) - .register(plugin); - - new SoulboundItem(categories.magicalArmor, SlimefunItems.SOULBOUND_LEGGINGS, RecipeType.MAGIC_WORKBENCH, - new ItemStack[] {null, SlimefunItems.ESSENCE_OF_AFTERLIFE, null, null, new ItemStack(Material.DIAMOND_LEGGINGS), null, null, SlimefunItems.ESSENCE_OF_AFTERLIFE, null}) - .register(plugin); - - new SoulboundItem(categories.magicalArmor, SlimefunItems.SOULBOUND_BOOTS, RecipeType.MAGIC_WORKBENCH, - new ItemStack[] {null, SlimefunItems.ESSENCE_OF_AFTERLIFE, null, null, new ItemStack(Material.DIAMOND_BOOTS), null, null, SlimefunItems.ESSENCE_OF_AFTERLIFE, null}) - .register(plugin); - - new Juicer(categories.basicMachines, SlimefunItems.JUICER).register(plugin); - - new Juice(categories.food, SlimefunItems.APPLE_JUICE, RecipeType.JUICER, - new ItemStack[] {new ItemStack(Material.APPLE), null, null, null, null, null, null, null, null}) - .register(plugin); - - new Juice(categories.food, SlimefunItems.CARROT_JUICE, RecipeType.JUICER, - new ItemStack[] {new ItemStack(Material.CARROT), null, null, null, null, null, null, null, null}) - .register(plugin); - - new Juice(categories.food, SlimefunItems.MELON_JUICE, RecipeType.JUICER, - 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, - new ItemStack[] {new ItemStack(Material.PUMPKIN), null, null, null, null, null, null, null, null}) - .register(plugin); - - if (SlimefunPlugin.getMinecraftVersion().isAtLeast(MinecraftVersion.MINECRAFT_1_14)) { - new Juice(categories.food, SlimefunItems.SWEET_BERRY_JUICE, RecipeType.JUICER, - new ItemStack[] {new ItemStack(Material.SWEET_BERRIES), null, null, null, null, null, null, null, null}) - .register(plugin); - } - - new Juice(categories.food, SlimefunItems.GOLDEN_APPLE_JUICE, RecipeType.JUICER, - new ItemStack[] {new ItemStack(Material.GOLDEN_APPLE), null, null, null, null, null, null, null, null}) - .register(plugin); - - new BrokenSpawner(categories.magicalResources, SlimefunItems.BROKEN_SPAWNER, new RecipeType(new NamespacedKey(plugin, "pickaxe_of_containment"), SlimefunItems.PICKAXE_OF_CONTAINMENT), - new ItemStack[] {null, null, null, null, new ItemStack(Material.SPAWNER), null, null, null, null}) - .register(plugin); - - new RepairedSpawner(categories.magicalGadgets, SlimefunItems.REPAIRED_SPAWNER, RecipeType.ANCIENT_ALTAR, - new ItemStack[] {SlimefunItems.ENDER_RUNE, SlimefunItems.FILLED_FLASK_OF_KNOWLEDGE, SlimefunItems.ESSENCE_OF_AFTERLIFE, SlimefunItems.FILLED_FLASK_OF_KNOWLEDGE, SlimefunItems.BROKEN_SPAWNER, SlimefunItems.FILLED_FLASK_OF_KNOWLEDGE, SlimefunItems.ESSENCE_OF_AFTERLIFE, SlimefunItems.FILLED_FLASK_OF_KNOWLEDGE, SlimefunItems.ENDER_RUNE}) - .register(plugin); - - new EnhancedFurnace(categories.basicMachines, 1, 1, 1, SlimefunItems.ENHANCED_FURNACE, - new ItemStack[] {null, SlimefunItems.STEEL_INGOT, null, SlimefunItems.BASIC_CIRCUIT_BOARD, new ItemStack(Material.FURNACE), SlimefunItems.HEATING_COIL, null, SlimefunItems.ELECTRIC_MOTOR, null}) - .register(plugin); - - new EnhancedFurnace(categories.basicMachines, 2, 1, 1, SlimefunItems.ENHANCED_FURNACE_2, - new ItemStack[] {null, SlimefunItems.STEEL_INGOT, null, SlimefunItems.BASIC_CIRCUIT_BOARD, SlimefunItems.ENHANCED_FURNACE, SlimefunItems.HEATING_COIL, null, SlimefunItems.ELECTRIC_MOTOR, null}) - .register(plugin); - - new EnhancedFurnace(categories.basicMachines, 2, 2, 1, SlimefunItems.ENHANCED_FURNACE_3, - new ItemStack[] {null, SlimefunItems.STEEL_INGOT, null, SlimefunItems.BASIC_CIRCUIT_BOARD, SlimefunItems.ENHANCED_FURNACE_2, SlimefunItems.HEATING_COIL, null, SlimefunItems.ELECTRIC_MOTOR, null}) - .register(plugin); - - new EnhancedFurnace(categories.basicMachines, 3, 2, 1, SlimefunItems.ENHANCED_FURNACE_4, - new ItemStack[] {null, SlimefunItems.STEEL_INGOT, null, SlimefunItems.BASIC_CIRCUIT_BOARD, SlimefunItems.ENHANCED_FURNACE_3, SlimefunItems.HEATING_COIL, null, SlimefunItems.ELECTRIC_MOTOR, null}) - .register(plugin); - - new EnhancedFurnace(categories.basicMachines, 3, 2, 2, SlimefunItems.ENHANCED_FURNACE_5, - new ItemStack[] {null, SlimefunItems.STEEL_INGOT, null, SlimefunItems.BASIC_CIRCUIT_BOARD, SlimefunItems.ENHANCED_FURNACE_4, SlimefunItems.HEATING_COIL, null, SlimefunItems.ELECTRIC_MOTOR, null}) - .register(plugin); - - new EnhancedFurnace(categories.basicMachines, 3, 3, 2, SlimefunItems.ENHANCED_FURNACE_6, - new ItemStack[] {null, SlimefunItems.STEEL_INGOT, null, SlimefunItems.BASIC_CIRCUIT_BOARD, SlimefunItems.ENHANCED_FURNACE_5, SlimefunItems.HEATING_COIL, null, SlimefunItems.ELECTRIC_MOTOR, null}) - .register(plugin); - - new EnhancedFurnace(categories.basicMachines, 4, 3, 2, SlimefunItems.ENHANCED_FURNACE_7, - new ItemStack[] {null, SlimefunItems.STEEL_INGOT, null, SlimefunItems.BASIC_CIRCUIT_BOARD, SlimefunItems.ENHANCED_FURNACE_6, SlimefunItems.HEATING_COIL, null, SlimefunItems.ELECTRIC_MOTOR, null}) - .register(plugin); - - new EnhancedFurnace(categories.basicMachines, 4, 4, 2, SlimefunItems.ENHANCED_FURNACE_8, - new ItemStack[] {null, SlimefunItems.STEEL_INGOT, null, SlimefunItems.BASIC_CIRCUIT_BOARD, SlimefunItems.ENHANCED_FURNACE_7, SlimefunItems.HEATING_COIL, null, SlimefunItems.ELECTRIC_MOTOR, null}) - .register(plugin); - - new EnhancedFurnace(categories.basicMachines, 5, 4, 2, SlimefunItems.ENHANCED_FURNACE_9, - new ItemStack[] {null, SlimefunItems.STEEL_INGOT, null, SlimefunItems.BASIC_CIRCUIT_BOARD, SlimefunItems.ENHANCED_FURNACE_8, SlimefunItems.HEATING_COIL, null, SlimefunItems.ELECTRIC_MOTOR, null}) - .register(plugin); - - new EnhancedFurnace(categories.basicMachines, 5, 5, 2, SlimefunItems.ENHANCED_FURNACE_10, - new ItemStack[] {null, SlimefunItems.STEEL_INGOT, null, SlimefunItems.BASIC_CIRCUIT_BOARD, SlimefunItems.ENHANCED_FURNACE_9, SlimefunItems.HEATING_COIL, null, SlimefunItems.ELECTRIC_MOTOR, null}) - .register(plugin); - - new EnhancedFurnace(categories.basicMachines, 5, 5, 3, SlimefunItems.ENHANCED_FURNACE_11, - new ItemStack[] {null, SlimefunItems.STEEL_INGOT, null, SlimefunItems.BASIC_CIRCUIT_BOARD, SlimefunItems.ENHANCED_FURNACE_10, SlimefunItems.HEATING_COIL, null, SlimefunItems.ELECTRIC_MOTOR, null}) - .register(plugin); - - new EnhancedFurnace(categories.basicMachines, 10, 10, 3, SlimefunItems.REINFORCED_FURNACE, - new ItemStack[] {SlimefunItems.REINFORCED_ALLOY_INGOT, SlimefunItems.BASIC_CIRCUIT_BOARD, SlimefunItems.REINFORCED_ALLOY_INGOT, SlimefunItems.HEATING_COIL, SlimefunItems.ENHANCED_FURNACE_11, SlimefunItems.HEATING_COIL, SlimefunItems.REINFORCED_ALLOY_INGOT, SlimefunItems.ELECTRIC_MOTOR, SlimefunItems.REINFORCED_ALLOY_INGOT}) - .register(plugin); - - new EnhancedFurnace(categories.basicMachines, 20, 10, 3, SlimefunItems.CARBONADO_EDGED_FURNACE, - new ItemStack[] {SlimefunItems.CARBONADO, SlimefunItems.BASIC_CIRCUIT_BOARD, SlimefunItems.CARBONADO, SlimefunItems.HEATING_COIL, SlimefunItems.REINFORCED_FURNACE, SlimefunItems.HEATING_COIL, SlimefunItems.CARBONADO, SlimefunItems.ELECTRIC_MOTOR, SlimefunItems.CARBONADO}) - .register(plugin); - - new SlimefunItem(categories.technicalComponents, SlimefunItems.ELECTRO_MAGNET, RecipeType.ENHANCED_CRAFTING_TABLE, - new ItemStack[] {SlimefunItems.NICKEL_INGOT, SlimefunItems.MAGNET, SlimefunItems.COBALT_INGOT, null, SlimefunItems.BATTERY, null, null, null, null}) - .register(plugin); - - new SlimefunItem(categories.technicalComponents, SlimefunItems.ELECTRIC_MOTOR, RecipeType.ENHANCED_CRAFTING_TABLE, - new ItemStack[] {SlimefunItems.COPPER_WIRE, SlimefunItems.COPPER_WIRE, SlimefunItems.COPPER_WIRE, null, SlimefunItems.ELECTRO_MAGNET, null, SlimefunItems.COPPER_WIRE, SlimefunItems.COPPER_WIRE, SlimefunItems.COPPER_WIRE}) - .register(plugin); - - new SlimefunItem(categories.technicalComponents, SlimefunItems.HEATING_COIL, RecipeType.ENHANCED_CRAFTING_TABLE, - new ItemStack[] {SlimefunItems.COPPER_WIRE, SlimefunItems.COPPER_WIRE, SlimefunItems.COPPER_WIRE, SlimefunItems.COPPER_WIRE, SlimefunItems.ELECTRIC_MOTOR, SlimefunItems.COPPER_WIRE, SlimefunItems.COPPER_WIRE, SlimefunItems.COPPER_WIRE, SlimefunItems.COPPER_WIRE}) - .register(plugin); - - new SlimefunItem(categories.technicalComponents, SlimefunItems.COPPER_WIRE, RecipeType.ENHANCED_CRAFTING_TABLE, - new ItemStack[] {null, null, null, SlimefunItems.COPPER_INGOT, SlimefunItems.COPPER_INGOT, SlimefunItems.COPPER_INGOT, null, null, null}, - new SlimefunItemStack(SlimefunItems.COPPER_WIRE, 8)) - .register(plugin); - - new BlockPlacer(categories.basicMachines, SlimefunItems.BLOCK_PLACER, RecipeType.ENHANCED_CRAFTING_TABLE, - new ItemStack[] {SlimefunItems.GOLD_4K, new ItemStack(Material.PISTON), SlimefunItems.GOLD_4K, new ItemStack(Material.IRON_INGOT), SlimefunItems.ELECTRIC_MOTOR, new ItemStack(Material.IRON_INGOT), SlimefunItems.GOLD_4K, new ItemStack(Material.PISTON), SlimefunItems.GOLD_4K}) - .register(plugin); - - new TelepositionScroll(categories.magicalGadgets, SlimefunItems.SCROLL_OF_DIMENSIONAL_TELEPOSITION, RecipeType.MAGIC_WORKBENCH, - new ItemStack[] {null, SlimefunItems.ENDER_LUMP_3, SlimefunItems.MAGIC_EYE_OF_ENDER, SlimefunItems.ENDER_LUMP_3, SlimefunItems.MAGICAL_BOOK_COVER, SlimefunItems.ENDER_LUMP_3, SlimefunItems.MAGIC_EYE_OF_ENDER, SlimefunItems.ENDER_LUMP_3, null}) - .register(plugin); - - new ExplosiveBow(categories.weapons, SlimefunItems.EXPLOSIVE_BOW, - new ItemStack[] {null, new ItemStack(Material.STICK), new ItemStack(Material.GUNPOWDER), SlimefunItems.STAFF_FIRE, null, SlimefunItems.SULFATE, null, new ItemStack(Material.STICK), new ItemStack(Material.GUNPOWDER)}) - .register(plugin); - - new IcyBow(categories.weapons, SlimefunItems.ICY_BOW, - new ItemStack[] {null, new ItemStack(Material.STICK), new ItemStack(Material.ICE), SlimefunItems.STAFF_WATER, null, new ItemStack(Material.PACKED_ICE), null, new ItemStack(Material.STICK), new ItemStack(Material.ICE)}) - .register(plugin); - - new KnowledgeTome(categories.magicalGadgets, SlimefunItems.TOME_OF_KNOWLEDGE_SHARING, RecipeType.MAGIC_WORKBENCH, - new ItemStack[] {null, new ItemStack(Material.FEATHER), null, new ItemStack(Material.INK_SAC), SlimefunItems.MAGICAL_BOOK_COVER, new ItemStack(Material.GLASS_BOTTLE), null, new ItemStack(Material.WRITABLE_BOOK), null}) - .register(plugin); - - new KnowledgeFlask(categories.magicalGadgets, SlimefunItems.FLASK_OF_KNOWLEDGE, RecipeType.MAGIC_WORKBENCH, - new ItemStack[] {null, null, null, SlimefunItems.MAGIC_LUMP_2, new ItemStack(Material.GLASS_PANE), SlimefunItems.MAGIC_LUMP_2, null, SlimefunItems.MAGIC_LUMP_2, null}, - new SlimefunItemStack(SlimefunItems.FLASK_OF_KNOWLEDGE, 8)) - .register(plugin); - - new BirthdayCake(categories.birthday, new SlimefunItemStack("BIRTHDAY_CAKE", Material.CAKE, "&bBirthday Cake"), RecipeType.ENHANCED_CRAFTING_TABLE, - new ItemStack[] {null, new ItemStack(Material.TORCH), null, new ItemStack(Material.SUGAR), new ItemStack(Material.CAKE), new ItemStack(Material.SUGAR), null, null, null}) - .register(plugin); - - new Juice(categories.christmas, SlimefunItems.CHRISTMAS_MILK, RecipeType.ENHANCED_CRAFTING_TABLE, - new ItemStack[] {new ItemStack(Material.MILK_BUCKET), new ItemStack(Material.GLASS_BOTTLE), null, null, null, null, null, null, null}, - new SlimefunItemStack(SlimefunItems.CHRISTMAS_MILK, 4)) - .register(plugin); - - new Juice(categories.christmas, SlimefunItems.CHRISTMAS_CHOCOLATE_MILK, RecipeType.ENHANCED_CRAFTING_TABLE, - new ItemStack[] {SlimefunItems.CHRISTMAS_MILK, new ItemStack(Material.COCOA_BEANS), null, null, null, null, null, null, null}, - new SlimefunItemStack(SlimefunItems.CHRISTMAS_CHOCOLATE_MILK, 2)) - .register(plugin); - - new Juice(categories.christmas, SlimefunItems.CHRISTMAS_EGG_NOG, RecipeType.ENHANCED_CRAFTING_TABLE, - new ItemStack[] {SlimefunItems.CHRISTMAS_MILK, new ItemStack(Material.EGG), null, null, null, null, null, null, null}, - new SlimefunItemStack(SlimefunItems.CHRISTMAS_EGG_NOG, 2)) - .register(plugin); - - new Juice(categories.christmas, SlimefunItems.CHRISTMAS_APPLE_CIDER, RecipeType.ENHANCED_CRAFTING_TABLE, - new ItemStack[] {SlimefunItems.APPLE_JUICE, new ItemStack(Material.SUGAR), null, null, null, null, null, null, null}, - new SlimefunItemStack(SlimefunItems.CHRISTMAS_APPLE_CIDER, 2)) - .register(plugin); - - new SlimefunItem(categories.christmas, SlimefunItems.CHRISTMAS_COOKIE, RecipeType.ENHANCED_CRAFTING_TABLE, - new ItemStack[] {new ItemStack(Material.COOKIE), new ItemStack(Material.SUGAR), new ItemStack(Material.LIME_DYE), null, null, null, null, null, null}, - new SlimefunItemStack(SlimefunItems.CHRISTMAS_COOKIE, 16)) - .register(plugin); - - new SlimefunItem(categories.christmas, SlimefunItems.CHRISTMAS_FRUIT_CAKE, RecipeType.ENHANCED_CRAFTING_TABLE, - new ItemStack[] {new ItemStack(Material.EGG), new ItemStack(Material.APPLE), new ItemStack(Material.MELON), new ItemStack(Material.SUGAR), null, null, null, null, null}, - new SlimefunItemStack(SlimefunItems.CHRISTMAS_FRUIT_CAKE, 4)) - .register(plugin); - - new SlimefunItem(categories.christmas, SlimefunItems.CHRISTMAS_APPLE_PIE, RecipeType.ENHANCED_CRAFTING_TABLE, - new ItemStack[] {new ItemStack(Material.SUGAR), new ItemStack(Material.APPLE), new ItemStack(Material.EGG), null, null, null, null, null, null}, - new SlimefunItemStack(SlimefunItems.CHRISTMAS_APPLE_PIE, 2)) - .register(plugin); - - new Juice(categories.christmas, SlimefunItems.CHRISTMAS_HOT_CHOCOLATE, RecipeType.SMELTERY, - new ItemStack[] {SlimefunItems.CHRISTMAS_CHOCOLATE_MILK, null, null, null, null, null, null, null, null}, SlimefunItems.CHRISTMAS_HOT_CHOCOLATE) - .register(plugin); - - new SlimefunItem(categories.christmas, SlimefunItems.CHRISTMAS_CAKE, RecipeType.ENHANCED_CRAFTING_TABLE, - new ItemStack[] {new ItemStack(Material.EGG), new ItemStack(Material.SUGAR), SlimefunItems.WHEAT_FLOUR, new ItemStack(Material.MILK_BUCKET), null, null, null, null, null}, - new SlimefunItemStack(SlimefunItems.CHRISTMAS_CAKE, 4)) - .register(plugin); - - new SlimefunItem(categories.christmas, SlimefunItems.CHRISTMAS_CARAMEL, RecipeType.SMELTERY, - new ItemStack[] {new ItemStack(Material.SUGAR), new ItemStack(Material.SUGAR), null, null, null, null, null, null, null}, - new SlimefunItemStack(SlimefunItems.CHRISTMAS_CARAMEL, 4)) - .register(plugin); - - new SlimefunItem(categories.christmas, SlimefunItems.CHRISTMAS_CARAMEL_APPLE, RecipeType.ENHANCED_CRAFTING_TABLE, - new ItemStack[] {null, SlimefunItems.CHRISTMAS_CARAMEL, null, null, new ItemStack(Material.APPLE), null, null, new ItemStack(Material.STICK), null}, - new SlimefunItemStack(SlimefunItems.CHRISTMAS_CARAMEL_APPLE, 2)) - .register(plugin); - - new SlimefunItem(categories.christmas, SlimefunItems.CHRISTMAS_CHOCOLATE_APPLE, RecipeType.ENHANCED_CRAFTING_TABLE, - new ItemStack[] {null, new ItemStack(Material.COCOA_BEANS), null, null, new ItemStack(Material.APPLE), null, null, new ItemStack(Material.STICK), null}, - new SlimefunItemStack(SlimefunItems.CHRISTMAS_CHOCOLATE_APPLE, 2)) - .register(plugin); - - new ChristmasPresent(categories.christmas, SlimefunItems.CHRISTMAS_PRESENT, RecipeType.MAGIC_WORKBENCH, - new ItemStack[] {null, new ItemStack(Material.NAME_TAG), null, new ItemStack(Material.RED_WOOL), new ItemStack(Material.GREEN_WOOL), new ItemStack(Material.RED_WOOL), new ItemStack(Material.RED_WOOL), new ItemStack(Material.GREEN_WOOL), new ItemStack(Material.RED_WOOL)}, - new SlimefunItemStack(SlimefunItems.CHRISTMAS_HOT_CHOCOLATE, 1), - new SlimefunItemStack(SlimefunItems.CHRISTMAS_CHOCOLATE_APPLE, 4), - new SlimefunItemStack(SlimefunItems.CHRISTMAS_CARAMEL_APPLE, 4), - new SlimefunItemStack(SlimefunItems.CHRISTMAS_CAKE, 4), - new SlimefunItemStack(SlimefunItems.CHRISTMAS_COOKIE, 8), - new SlimefunItemStack(SlimefunItems.CHRISTMAS_PRESENT, 1), - new SlimefunItemStack(SlimefunItems.CHRISTMAS_EGG_NOG, 1), - new SlimefunItemStack(SlimefunItems.CHRISTMAS_MILK, 1), - new SlimefunItemStack(SlimefunItems.CHRISTMAS_APPLE_CIDER, 1), - new SlimefunItemStack(SlimefunItems.CHRISTMAS_FRUIT_CAKE, 4), + new SlimefunItem(categories.weapons, SlimefunItems.GRANDMAS_WALKING_STICK, RecipeType.ENHANCED_CRAFTING_TABLE, + new ItemStack[] {null, new ItemStack(Material.OAK_LOG), null, null, new ItemStack(Material.OAK_LOG), null, null, new ItemStack(Material.OAK_LOG), null}) + .register(plugin); + + new SlimefunItem(categories.weapons, SlimefunItems.GRANDPAS_WALKING_STICK, RecipeType.ENHANCED_CRAFTING_TABLE, + new ItemStack[] {new ItemStack(Material.LEATHER), new ItemStack(Material.OAK_LOG), new ItemStack(Material.LEATHER), null, new ItemStack(Material.OAK_LOG), null, null, new ItemStack(Material.OAK_LOG), null}) + .register(plugin); + + new PortableCrafter(categories.usefulItems, SlimefunItems.PORTABLE_CRAFTER, RecipeType.ENHANCED_CRAFTING_TABLE, + new ItemStack[] {new ItemStack(Material.BOOK), new ItemStack(Material.CRAFTING_TABLE), null, null, null, null, null, null, null}) + .register(plugin); + + new FortuneCookie(categories.food, SlimefunItems.FORTUNE_COOKIE, RecipeType.ENHANCED_CRAFTING_TABLE, + new ItemStack[] {new ItemStack(Material.COOKIE), new ItemStack(Material.PAPER), null, null, null, null, null, null, null}) + .register(plugin); + + new DietCookie(categories.food, SlimefunItems.DIET_COOKIE, RecipeType.MAGIC_WORKBENCH, + new ItemStack[] {new ItemStack(Material.COOKIE), SlimefunItems.ELYTRA_SCALE, null, null, null, null, null, null, null}) + .register(plugin); + + new SlimefunItem(categories.basicMachines, SlimefunItems.OUTPUT_CHEST, RecipeType.ENHANCED_CRAFTING_TABLE, + new ItemStack[] {SlimefunItems.LEAD_INGOT, new ItemStack(Material.HOPPER), SlimefunItems.LEAD_INGOT, SlimefunItems.LEAD_INGOT, new ItemStack(Material.CHEST), SlimefunItems.LEAD_INGOT, null, SlimefunItems.LEAD_INGOT, null}) + .register(plugin); + + new EnhancedCraftingTable(categories.basicMachines, SlimefunItems.ENHANCED_CRAFTING_TABLE).register(plugin); + + new PortableDustbin(categories.usefulItems, SlimefunItems.PORTABLE_DUSTBIN, RecipeType.ENHANCED_CRAFTING_TABLE, + new ItemStack[] {new ItemStack(Material.IRON_INGOT), new ItemStack(Material.IRON_INGOT), new ItemStack(Material.IRON_INGOT), new ItemStack(Material.IRON_INGOT), null, new ItemStack(Material.IRON_INGOT), new ItemStack(Material.IRON_INGOT), new ItemStack(Material.IRON_INGOT), new ItemStack(Material.IRON_INGOT)}) + .register(plugin); + + new MeatJerky(categories.food, SlimefunItems.BEEF_JERKY, RecipeType.ENHANCED_CRAFTING_TABLE, + new ItemStack[] {SlimefunItems.SALT, new ItemStack(Material.COOKED_BEEF), null, null, null, null, null, null, null}) + .register(plugin); + + new MeatJerky(categories.food, SlimefunItems.PORK_JERKY, RecipeType.ENHANCED_CRAFTING_TABLE, + new ItemStack[] {SlimefunItems.SALT, new ItemStack(Material.COOKED_PORKCHOP), null, null, null, null, null, null, null}) + .register(plugin); + + new MeatJerky(categories.food, SlimefunItems.CHICKEN_JERKY, RecipeType.ENHANCED_CRAFTING_TABLE, + new ItemStack[] {SlimefunItems.SALT, new ItemStack(Material.COOKED_CHICKEN), null, null, null, null, null, null, null}) + .register(plugin); + + new MeatJerky(categories.food, SlimefunItems.MUTTON_JERKY, RecipeType.ENHANCED_CRAFTING_TABLE, + new ItemStack[] {SlimefunItems.SALT, new ItemStack(Material.COOKED_MUTTON), null, null, null, null, null, null, null}) + .register(plugin); + + new MeatJerky(categories.food, SlimefunItems.RABBIT_JERKY, RecipeType.ENHANCED_CRAFTING_TABLE, + new ItemStack[] {SlimefunItems.SALT, new ItemStack(Material.COOKED_RABBIT), null, null, null, null, null, null, null}) + .register(plugin); + + new MeatJerky(categories.food, SlimefunItems.FISH_JERKY, RecipeType.ENHANCED_CRAFTING_TABLE, + new ItemStack[] {SlimefunItems.SALT, new ItemStack(Material.COOKED_COD), null, null, null, null, null, null, null}) + .register(plugin); + + new SlimefunItem(categories.food, SlimefunItems.KELP_COOKIE, RecipeType.ENHANCED_CRAFTING_TABLE, + new ItemStack[] {null, new ItemStack(Material.DRIED_KELP), null, new ItemStack(Material.DRIED_KELP), new ItemStack(Material.SUGAR), new ItemStack(Material.DRIED_KELP), null, new ItemStack(Material.DRIED_KELP), null}, + new SlimefunItemStack(SlimefunItems.KELP_COOKIE, 2)) + .register(plugin); + + new GrindStone(categories.basicMachines, SlimefunItems.GRIND_STONE).register(plugin); + new ArmorForge(categories.basicMachines, SlimefunItems.ARMOR_FORGE).register(plugin); + + OreCrusher oreCrusher = new OreCrusher(categories.basicMachines, SlimefunItems.ORE_CRUSHER); + oreCrusher.register(plugin); + + new Compressor(categories.basicMachines, SlimefunItems.COMPRESSOR).register(plugin); + + new SlimefunItem(categories.magicalResources, SlimefunItems.MAGIC_LUMP_1, RecipeType.GRIND_STONE, + new ItemStack[] {new ItemStack(Material.NETHER_WART), null, null, null, null, null, null, null, null}, + new SlimefunItemStack(SlimefunItems.MAGIC_LUMP_1, 2)) + .register(plugin); + + new SlimefunItem(categories.magicalResources, SlimefunItems.MAGIC_LUMP_2, RecipeType.ENHANCED_CRAFTING_TABLE, + new ItemStack[] {SlimefunItems.MAGIC_LUMP_1, SlimefunItems.MAGIC_LUMP_1, null, SlimefunItems.MAGIC_LUMP_1, SlimefunItems.MAGIC_LUMP_1, null, null, null, null}) + .register(plugin); + + new SlimefunItem(categories.magicalResources, SlimefunItems.MAGIC_LUMP_3, RecipeType.ENHANCED_CRAFTING_TABLE, + new ItemStack[] {SlimefunItems.MAGIC_LUMP_2, SlimefunItems.MAGIC_LUMP_2, null, SlimefunItems.MAGIC_LUMP_2, SlimefunItems.MAGIC_LUMP_2, null, null, null, null}) + .register(plugin); + + new SlimefunItem(categories.magicalResources, SlimefunItems.ENDER_LUMP_1, RecipeType.ENHANCED_CRAFTING_TABLE, + new ItemStack[] {null, null, null, null, new ItemStack(Material.ENDER_EYE), null, null, null, null}, + new SlimefunItemStack(SlimefunItems.ENDER_LUMP_1, 2)) + .register(plugin); + + new SlimefunItem(categories.magicalResources, SlimefunItems.ENDER_LUMP_2, RecipeType.ENHANCED_CRAFTING_TABLE, + new ItemStack[] {SlimefunItems.ENDER_LUMP_1, SlimefunItems.ENDER_LUMP_1, null, SlimefunItems.ENDER_LUMP_1, SlimefunItems.ENDER_LUMP_1, null, null, null, null}) + .register(plugin); + + new SlimefunItem(categories.magicalResources, SlimefunItems.ENDER_LUMP_3, RecipeType.ENHANCED_CRAFTING_TABLE, + new ItemStack[] {SlimefunItems.ENDER_LUMP_2, SlimefunItems.ENDER_LUMP_2, null, SlimefunItems.ENDER_LUMP_2, SlimefunItems.ENDER_LUMP_2, null, null, null, null}) + .register(plugin); + + new EnderBackpack(categories.magicalGadgets, SlimefunItems.ENDER_BACKPACK, RecipeType.MAGIC_WORKBENCH, + new ItemStack[] {SlimefunItems.ENDER_LUMP_2, new ItemStack(Material.LEATHER), SlimefunItems.ENDER_LUMP_2, new ItemStack(Material.LEATHER), new ItemStack(Material.CHEST), new ItemStack(Material.LEATHER), SlimefunItems.ENDER_LUMP_2, new ItemStack(Material.LEATHER), SlimefunItems.ENDER_LUMP_2}) + .register(plugin); + + new SlimefunItem(categories.magicalArmor, SlimefunItems.ENDER_HELMET, RecipeType.ARMOR_FORGE, + new ItemStack[] {SlimefunItems.ENDER_LUMP_1, new ItemStack(Material.ENDER_EYE), SlimefunItems.ENDER_LUMP_1, new ItemStack(Material.OBSIDIAN), null, new ItemStack(Material.OBSIDIAN), null, null, null}) + .register(plugin); + + new SlimefunItem(categories.magicalArmor, SlimefunItems.ENDER_CHESTPLATE, RecipeType.ARMOR_FORGE, + new ItemStack[] {SlimefunItems.ENDER_LUMP_1, null, SlimefunItems.ENDER_LUMP_1, new ItemStack(Material.OBSIDIAN), new ItemStack(Material.ENDER_EYE), new ItemStack(Material.OBSIDIAN), new ItemStack(Material.OBSIDIAN), new ItemStack(Material.OBSIDIAN), new ItemStack(Material.OBSIDIAN)}) + .register(plugin); + + new SlimefunItem(categories.magicalArmor, SlimefunItems.ENDER_LEGGINGS, RecipeType.ARMOR_FORGE, + new ItemStack[] {SlimefunItems.ENDER_LUMP_1, new ItemStack(Material.ENDER_EYE), SlimefunItems.ENDER_LUMP_1, new ItemStack(Material.OBSIDIAN), null, new ItemStack(Material.OBSIDIAN), new ItemStack(Material.OBSIDIAN), null, new ItemStack(Material.OBSIDIAN)}) + .register(plugin); + + new SlimefunItem(categories.magicalArmor, SlimefunItems.ENDER_BOOTS, RecipeType.ARMOR_FORGE, + new ItemStack[] {null, null, null, SlimefunItems.ENDER_LUMP_1, null, SlimefunItems.ENDER_LUMP_1, new ItemStack(Material.OBSIDIAN), null, new ItemStack(Material.OBSIDIAN)}) + .register(plugin); + + new MagicEyeOfEnder(categories.magicalGadgets, SlimefunItems.MAGIC_EYE_OF_ENDER, RecipeType.MAGIC_WORKBENCH, + new ItemStack[] {SlimefunItems.ENDER_LUMP_2, new ItemStack(Material.ENDER_PEARL), SlimefunItems.ENDER_LUMP_2, new ItemStack(Material.ENDER_PEARL), new ItemStack(Material.ENDER_EYE), new ItemStack(Material.ENDER_PEARL), SlimefunItems.ENDER_LUMP_2, new ItemStack(Material.ENDER_PEARL), SlimefunItems.ENDER_LUMP_2}) + .register(plugin); + + new MagicSugar(categories.food, SlimefunItems.MAGIC_SUGAR, RecipeType.ENHANCED_CRAFTING_TABLE, + new ItemStack[] {new ItemStack(Material.SUGAR), new ItemStack(Material.REDSTONE), new ItemStack(Material.GLOWSTONE_DUST), null, null, null, null, null, null}) + .register(plugin); + + new MonsterJerky(categories.food, SlimefunItems.MONSTER_JERKY, RecipeType.ENHANCED_CRAFTING_TABLE, + new ItemStack[] {SlimefunItems.SALT, new ItemStack(Material.ROTTEN_FLESH), null, null, null, null, null, null, null}) + .register(plugin); + + 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 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, + 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), new ItemStack(Material.IRON_INGOT), null, new ItemStack(Material.IRON_INGOT)}, + new PotionEffect[] {new PotionEffect(PotionEffectType.SPEED, 300, 2)}) + .register(plugin); + + new SlimefunArmorPiece(categories.magicalArmor, SlimefunItems.SLIME_BOOTS, RecipeType.ARMOR_FORGE, + new ItemStack[] {null, null, null, new ItemStack(Material.SLIME_BALL), null, new ItemStack(Material.SLIME_BALL), new ItemStack(Material.IRON_INGOT), null, new ItemStack(Material.IRON_INGOT)}, + new PotionEffect[] {new PotionEffect(PotionEffectType.JUMP, 300, 5)}) + .register(plugin); + + new SwordOfBeheading(categories.weapons, SlimefunItems.SWORD_OF_BEHEADING, RecipeType.ENHANCED_CRAFTING_TABLE, + new ItemStack[] {null, new ItemStack(Material.EMERALD), null, SlimefunItems.MAGIC_LUMP_2, new ItemStack(Material.EMERALD), SlimefunItems.MAGIC_LUMP_2, null, new ItemStack(Material.BLAZE_ROD), null}) + .register(plugin); + + new SlimefunItem(categories.magicalResources, SlimefunItems.MAGICAL_BOOK_COVER, RecipeType.ENHANCED_CRAFTING_TABLE, + 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); + + new UnplaceableBlock(categories.technicalComponents, SlimefunItems.ADVANCED_CIRCUIT_BOARD, RecipeType.ENHANCED_CRAFTING_TABLE, + new ItemStack[] {new ItemStack(Material.LAPIS_BLOCK), new ItemStack(Material.LAPIS_BLOCK), new ItemStack(Material.LAPIS_BLOCK), new ItemStack(Material.REDSTONE_BLOCK), SlimefunItems.BASIC_CIRCUIT_BOARD, new ItemStack(Material.REDSTONE_BLOCK), new ItemStack(Material.LAPIS_BLOCK), new ItemStack(Material.LAPIS_BLOCK), new ItemStack(Material.LAPIS_BLOCK)}) + .register(plugin); + + new GoldPan(categories.tools, SlimefunItems.GOLD_PAN, RecipeType.ENHANCED_CRAFTING_TABLE, + new ItemStack[] {null, null, null, new ItemStack(Material.STONE), new ItemStack(Material.BOWL), new ItemStack(Material.STONE), new ItemStack(Material.STONE), new ItemStack(Material.STONE), new ItemStack(Material.STONE)}) + .register(plugin); + + new NetherGoldPan(categories.tools, SlimefunItems.NETHER_GOLD_PAN, RecipeType.ENHANCED_CRAFTING_TABLE, + new ItemStack[] {null, null, null, new ItemStack(Material.NETHER_BRICK), SlimefunItems.GOLD_PAN, new ItemStack(Material.NETHER_BRICK), new ItemStack(Material.NETHER_BRICK), new ItemStack(Material.NETHER_BRICK), new ItemStack(Material.NETHER_BRICK)}) + .register(plugin); + + new SlimefunItem(categories.misc, SlimefunItems.SIFTED_ORE, RecipeType.GOLD_PAN, + new ItemStack[] {new ItemStack(Material.GRAVEL), null, null, null, null, null, null, null, null}) + .register(plugin); + + new MakeshiftSmeltery(categories.basicMachines, SlimefunItems.MAKESHIFT_SMELTERY).register(plugin); + new Smeltery(categories.basicMachines, SlimefunItems.SMELTERY).register(plugin); + + new SlimefunItem(categories.basicMachines, SlimefunItems.IGNITION_CHAMBER, RecipeType.ENHANCED_CRAFTING_TABLE, + new ItemStack[] {new ItemStack(Material.IRON_INGOT), new ItemStack(Material.FLINT_AND_STEEL), new ItemStack(Material.IRON_INGOT), new ItemStack(Material.IRON_INGOT), SlimefunItems.BASIC_CIRCUIT_BOARD, new ItemStack(Material.IRON_INGOT), null, new ItemStack(Material.OBSERVER), null}) + .register(plugin); + + new PressureChamber(categories.basicMachines, SlimefunItems.PRESSURE_CHAMBER).register(plugin); + + new SlimefunItem(categories.technicalComponents, SlimefunItems.BATTERY, RecipeType.ENHANCED_CRAFTING_TABLE, + new ItemStack[] {null, new ItemStack(Material.REDSTONE), null, SlimefunItems.ZINC_INGOT, SlimefunItems.SULFATE, SlimefunItems.COPPER_INGOT, SlimefunItems.ZINC_INGOT, SlimefunItems.SULFATE, SlimefunItems.COPPER_INGOT}) + .register(plugin); + + registerArmorSet(categories.magicalArmor, new ItemStack(Material.GLOWSTONE), new ItemStack[] {SlimefunItems.GLOWSTONE_HELMET, SlimefunItems.GLOWSTONE_CHESTPLATE, SlimefunItems.GLOWSTONE_LEGGINGS, SlimefunItems.GLOWSTONE_BOOTS}, "GLOWSTONE", false, + new PotionEffect[][] { + new PotionEffect[] {new PotionEffect(PotionEffectType.NIGHT_VISION, 600, 0)}, + new PotionEffect[] {new PotionEffect(PotionEffectType.NIGHT_VISION, 600, 0)}, + new PotionEffect[] {new PotionEffect(PotionEffectType.NIGHT_VISION, 600, 0)}, + new PotionEffect[] {new PotionEffect(PotionEffectType.NIGHT_VISION, 600, 0)} + }, plugin); + + registerArmorSet(categories.armor, SlimefunItems.DAMASCUS_STEEL_INGOT, new ItemStack[] {SlimefunItems.DAMASCUS_STEEL_HELMET, SlimefunItems.DAMASCUS_STEEL_CHESTPLATE, SlimefunItems.DAMASCUS_STEEL_LEGGINGS, SlimefunItems.DAMASCUS_STEEL_BOOTS}, "DAMASCUS_STEEL", false, new PotionEffect[0][0], plugin); + + registerArmorSet(categories.armor, SlimefunItems.REINFORCED_ALLOY_INGOT, new ItemStack[] {SlimefunItems.REINFORCED_ALLOY_HELMET, SlimefunItems.REINFORCED_ALLOY_CHESTPLATE, SlimefunItems.REINFORCED_ALLOY_LEGGINGS, SlimefunItems.REINFORCED_ALLOY_BOOTS}, "REINFORCED_ALLOY", false, new PotionEffect[0][0], plugin); + + registerArmorSet(categories.armor, new ItemStack(Material.CACTUS), new ItemStack[] {SlimefunItems.CACTUS_HELMET, SlimefunItems.CACTUS_CHESTPLATE, SlimefunItems.CACTUS_LEGGINGS, SlimefunItems.CACTUS_BOOTS}, "CACTUS", false, new PotionEffect[0][0], plugin); + + new SlimefunItem(categories.resources, SlimefunItems.REINFORCED_ALLOY_INGOT, RecipeType.SMELTERY, + new ItemStack[] {SlimefunItems.DAMASCUS_STEEL_INGOT, SlimefunItems.HARDENED_METAL_INGOT, SlimefunItems.CORINTHIAN_BRONZE_INGOT, SlimefunItems.SOLDER_INGOT, SlimefunItems.BILLON_INGOT, SlimefunItems.GOLD_24K, null, null, null}) + .register(plugin); + + new SlimefunItem(categories.resources, SlimefunItems.HARDENED_METAL_INGOT, RecipeType.SMELTERY, + new ItemStack[] {SlimefunItems.DAMASCUS_STEEL_INGOT, SlimefunItems.DURALUMIN_INGOT, SlimefunItems.COMPRESSED_CARBON, SlimefunItems.ALUMINUM_BRONZE_INGOT, null, null, null, null, null}) + .register(plugin); + + new SlimefunItem(categories.resources, SlimefunItems.DAMASCUS_STEEL_INGOT, RecipeType.SMELTERY, + new ItemStack[] {SlimefunItems.STEEL_INGOT, SlimefunItems.IRON_DUST, SlimefunItems.CARBON, new ItemStack(Material.IRON_INGOT), null, null, null, null, null}) + .register(plugin); + + new SlimefunItem(categories.resources, SlimefunItems.STEEL_INGOT, RecipeType.SMELTERY, + new ItemStack[] {SlimefunItems.IRON_DUST, SlimefunItems.CARBON, new ItemStack(Material.IRON_INGOT), null, null, null, null, null, null}) + .register(plugin); + + new SlimefunItem(categories.resources, SlimefunItems.BRONZE_INGOT, RecipeType.SMELTERY, + new ItemStack[] {SlimefunItems.COPPER_DUST, SlimefunItems.TIN_DUST, SlimefunItems.COPPER_INGOT, null, null, null, null, null, null}) + .register(plugin); + + new SlimefunItem(categories.resources, SlimefunItems.DURALUMIN_INGOT, RecipeType.SMELTERY, + new ItemStack[] {SlimefunItems.ALUMINUM_DUST, SlimefunItems.COPPER_DUST, SlimefunItems.ALUMINUM_INGOT, null, null, null, null, null, null}) + .register(plugin); + + new SlimefunItem(categories.resources, SlimefunItems.BILLON_INGOT, RecipeType.SMELTERY, + new ItemStack[] {SlimefunItems.SILVER_DUST, SlimefunItems.COPPER_DUST, SlimefunItems.SILVER_INGOT, null, null, null, null, null, null}) + .register(plugin); + + new SlimefunItem(categories.resources, SlimefunItems.BRASS_INGOT, RecipeType.SMELTERY, + new ItemStack[] {SlimefunItems.COPPER_DUST, SlimefunItems.ZINC_DUST, SlimefunItems.COPPER_INGOT, null, null, null, null, null, null}) + .register(plugin); + + new SlimefunItem(categories.resources, SlimefunItems.ALUMINUM_BRASS_INGOT, RecipeType.SMELTERY, + new ItemStack[] {SlimefunItems.ALUMINUM_DUST, SlimefunItems.BRASS_INGOT, SlimefunItems.ALUMINUM_INGOT, null, null, null, null, null, null}) + .register(plugin); + + new SlimefunItem(categories.resources, SlimefunItems.ALUMINUM_BRONZE_INGOT, RecipeType.SMELTERY, + new ItemStack[] {SlimefunItems.ALUMINUM_DUST, SlimefunItems.BRONZE_INGOT, SlimefunItems.ALUMINUM_INGOT, null, null, null, null, null, null}) + .register(plugin); + + new SlimefunItem(categories.resources, SlimefunItems.CORINTHIAN_BRONZE_INGOT, RecipeType.SMELTERY, + new ItemStack[] {SlimefunItems.SILVER_DUST, SlimefunItems.GOLD_DUST, SlimefunItems.COPPER_DUST, SlimefunItems.BRONZE_INGOT, null, null, null, null, null}) + .register(plugin); + + new SlimefunItem(categories.resources, SlimefunItems.SOLDER_INGOT, RecipeType.SMELTERY, + new ItemStack[] {SlimefunItems.LEAD_DUST, SlimefunItems.TIN_DUST, SlimefunItems.LEAD_INGOT, null, null, null, null, null, null}) + .register(plugin); + + new SlimefunItem(categories.resources, SlimefunItems.SYNTHETIC_SAPPHIRE, RecipeType.SMELTERY, + new ItemStack[] {SlimefunItems.ALUMINUM_DUST, new ItemStack(Material.GLASS), new ItemStack(Material.GLASS_PANE), SlimefunItems.ALUMINUM_INGOT, new ItemStack(Material.LAPIS_LAZULI), null, null, null, null}) + .setUseableInWorkbench(true) + .register(plugin); + + new SlimefunItem(categories.resources, SlimefunItems.SYNTHETIC_DIAMOND, RecipeType.PRESSURE_CHAMBER, + new ItemStack[] {SlimefunItems.CARBON_CHUNK, null, null, null, null, null, null, null, null}) + .setUseableInWorkbench(true) + .register(plugin); + + new SlimefunItem(categories.resources, SlimefunItems.RAW_CARBONADO, RecipeType.SMELTERY, + new ItemStack[] {SlimefunItems.SYNTHETIC_DIAMOND, SlimefunItems.CARBON_CHUNK, new ItemStack(Material.GLASS_PANE), null, null, null, null, null, null}) + .register(plugin); + + new SlimefunItem(categories.resources, SlimefunItems.NICKEL_INGOT, RecipeType.SMELTERY, + new ItemStack[] {SlimefunItems.IRON_DUST, new ItemStack(Material.IRON_INGOT), SlimefunItems.COPPER_DUST, null, null, null, null, null, null}) + .register(plugin); + + new SlimefunItem(categories.resources, SlimefunItems.COBALT_INGOT, RecipeType.SMELTERY, + new ItemStack[] {SlimefunItems.IRON_DUST, SlimefunItems.COPPER_DUST, SlimefunItems.NICKEL_INGOT, null, null, null, null, null, null}) + .register(plugin); + + new SlimefunItem(categories.resources, SlimefunItems.CARBONADO, RecipeType.PRESSURE_CHAMBER, + new ItemStack[] {SlimefunItems.RAW_CARBONADO, null, null, null, null, null, null, null, null}) + .register(plugin); + + new SlimefunItem(categories.resources, SlimefunItems.FERROSILICON, RecipeType.SMELTERY, + new ItemStack[] {new ItemStack(Material.IRON_INGOT), SlimefunItems.IRON_DUST, SlimefunItems.SILICON, null, null, null, null, null, null}) + .register(plugin); + + new SlimefunItem(categories.resources, SlimefunItems.IRON_DUST, RecipeType.ORE_CRUSHER, + new ItemStack[] {new ItemStack(Material.IRON_ORE), null, null, null, null, null, null, null, null}, + new SlimefunItemStack(SlimefunItems.IRON_DUST, oreCrusher.isOreDoublingEnabled() ? 2 : 1)) + .register(plugin); + + new SlimefunItem(categories.resources, SlimefunItems.GOLD_DUST, RecipeType.ORE_CRUSHER, + new ItemStack[] {new ItemStack(Material.GOLD_ORE), null, null, null, null, null, null, null, null}, + new SlimefunItemStack(SlimefunItems.GOLD_DUST, oreCrusher.isOreDoublingEnabled() ? 2 : 1)) + .register(plugin); + + new SlimefunItem(categories.resources, SlimefunItems.COPPER_DUST, RecipeType.ORE_WASHER, + new ItemStack[] {SlimefunItems.SIFTED_ORE, null, null, null, null, null, null, null, null}) + .register(plugin); + + new SlimefunItem(categories.resources, SlimefunItems.TIN_DUST, RecipeType.ORE_WASHER, + new ItemStack[] {SlimefunItems.SIFTED_ORE, null, null, null, null, null, null, null, null}) + .register(plugin); + + new SlimefunItem(categories.resources, SlimefunItems.LEAD_DUST, RecipeType.ORE_WASHER, + new ItemStack[] {SlimefunItems.SIFTED_ORE, null, null, null, null, null, null, null, null}) + .register(plugin); + + new SlimefunItem(categories.resources, SlimefunItems.SILVER_DUST, RecipeType.ORE_WASHER, + new ItemStack[] {SlimefunItems.SIFTED_ORE, null, null, null, null, null, null, null, null}) + .register(plugin); + + new SlimefunItem(categories.resources, SlimefunItems.ALUMINUM_DUST, RecipeType.ORE_WASHER, + new ItemStack[] {SlimefunItems.SIFTED_ORE, null, null, null, null, null, null, null, null}) + .register(plugin); + + new SlimefunItem(categories.resources, SlimefunItems.ZINC_DUST, RecipeType.ORE_WASHER, + new ItemStack[] {SlimefunItems.SIFTED_ORE, null, null, null, null, null, null, null, null}) + .register(plugin); + + new SlimefunItem(categories.resources, SlimefunItems.MAGNESIUM_DUST, RecipeType.ORE_WASHER, + new ItemStack[] {SlimefunItems.SIFTED_ORE, null, null, null, null, null, null, null, null}) + .register(plugin); + + new SlimefunItem(categories.resources, SlimefunItems.COPPER_INGOT, RecipeType.SMELTERY, + new ItemStack[] {SlimefunItems.COPPER_DUST, null, null, null, null, null, null, null, null}) + .register(plugin); + + new SlimefunItem(categories.resources, SlimefunItems.TIN_INGOT, RecipeType.SMELTERY, + new ItemStack[] {SlimefunItems.TIN_DUST, null, null, null, null, null, null, null, null}) + .register(plugin); + + new SlimefunItem(categories.resources, SlimefunItems.SILVER_INGOT, RecipeType.SMELTERY, + new ItemStack[] {SlimefunItems.SILVER_DUST, null, null, null, null, null, null, null, null}) + .register(plugin); + + new SlimefunItem(categories.resources, SlimefunItems.LEAD_INGOT, RecipeType.SMELTERY, + new ItemStack[] {SlimefunItems.LEAD_DUST, null, null, null, null, null, null, null, null}) + .register(plugin); + + new SlimefunItem(categories.resources, SlimefunItems.ALUMINUM_INGOT, RecipeType.SMELTERY, + new ItemStack[] {SlimefunItems.ALUMINUM_DUST, null, null, null, null, null, null, null, null}) + .register(plugin); + + new SlimefunItem(categories.resources, SlimefunItems.ZINC_INGOT, RecipeType.SMELTERY, + new ItemStack[] {SlimefunItems.ZINC_DUST, null, null, null, null, null, null, null, null}) + .register(plugin); + + new SlimefunItem(categories.resources, SlimefunItems.MAGNESIUM_INGOT, RecipeType.SMELTERY, + new ItemStack[] {SlimefunItems.MAGNESIUM_DUST, null, null, null, null, null, null, null, null}) + .register(plugin); + + new SlimefunItem(categories.resources, SlimefunItems.SULFATE, RecipeType.ORE_CRUSHER, + new ItemStack[] {new ItemStack(Material.NETHERRACK, 16), null, null, null, null, null, null, null, null}) + .register(plugin); + + new UnplaceableBlock(categories.resources, SlimefunItems.CARBON, RecipeType.COMPRESSOR, + new ItemStack[] {new ItemStack(Material.COAL, 8), null, null, null, null, null, null, null, null}) + .register(plugin); + + new SlimefunItem(categories.misc, SlimefunItems.WHEAT_FLOUR, RecipeType.GRIND_STONE, + new ItemStack[] {new ItemStack(Material.WHEAT), null, null, null, null, null, null, null, null}) + .register(plugin); + + new SlimefunItem(categories.misc, SlimefunItems.STEEL_PLATE, RecipeType.COMPRESSOR, + new ItemStack[] {new SlimefunItemStack(SlimefunItems.STEEL_INGOT, 8), null, null, null, null, null, null, null, null}) + .register(plugin); + + new UnplaceableBlock(categories.resources, SlimefunItems.COMPRESSED_CARBON, RecipeType.COMPRESSOR, + new ItemStack[] {new SlimefunItemStack(SlimefunItems.CARBON, 4), null, null, null, null, null, null, null, null}) + .register(plugin); + + new UnplaceableBlock(categories.resources, SlimefunItems.CARBON_CHUNK, RecipeType.ENHANCED_CRAFTING_TABLE, + new ItemStack[] {SlimefunItems.COMPRESSED_CARBON, SlimefunItems.COMPRESSED_CARBON, SlimefunItems.COMPRESSED_CARBON, SlimefunItems.COMPRESSED_CARBON, new ItemStack(Material.FLINT), SlimefunItems.COMPRESSED_CARBON, SlimefunItems.COMPRESSED_CARBON, SlimefunItems.COMPRESSED_CARBON, SlimefunItems.COMPRESSED_CARBON}) + .register(plugin); + + new SlimefunItem(categories.technicalComponents, SlimefunItems.STEEL_THRUSTER, RecipeType.ENHANCED_CRAFTING_TABLE, + new ItemStack[] {null, new ItemStack(Material.REDSTONE), null, SlimefunItems.ALUMINUM_BRONZE_INGOT, SlimefunItems.ALUMINUM_BRONZE_INGOT, SlimefunItems.ALUMINUM_BRONZE_INGOT, SlimefunItems.STEEL_PLATE, new ItemStack(Material.FIRE_CHARGE), SlimefunItems.STEEL_PLATE}) + .register(plugin); + + new SlimefunItem(categories.technicalComponents, SlimefunItems.POWER_CRYSTAL, RecipeType.ENHANCED_CRAFTING_TABLE, + new ItemStack[] {new ItemStack(Material.REDSTONE), SlimefunItems.SYNTHETIC_SAPPHIRE, new ItemStack(Material.REDSTONE), SlimefunItems.SYNTHETIC_SAPPHIRE, SlimefunItems.SYNTHETIC_DIAMOND, SlimefunItems.SYNTHETIC_SAPPHIRE, new ItemStack(Material.REDSTONE), SlimefunItems.SYNTHETIC_SAPPHIRE, new ItemStack(Material.REDSTONE)}) + .register(plugin); + + 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, 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, 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, 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, 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, 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, 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, 150) + .register(plugin); + + new Parachute(categories.technicalGadgets, SlimefunItems.PARACHUTE, RecipeType.ENHANCED_CRAFTING_TABLE, + new ItemStack[] {SlimefunItems.CLOTH, SlimefunItems.CLOTH, SlimefunItems.CLOTH, SlimefunItems.CHAIN, null, SlimefunItems.CHAIN, null, null, null}) + .register(plugin); + + new HologramProjector(categories.technicalGadgets, SlimefunItems.HOLOGRAM_PROJECTOR, RecipeType.ENHANCED_CRAFTING_TABLE, + new ItemStack[] {null, SlimefunItems.POWER_CRYSTAL, null, SlimefunItems.ALUMINUM_BRASS_INGOT, SlimefunItems.ELECTRIC_MOTOR, SlimefunItems.ALUMINUM_BRASS_INGOT, null, SlimefunItems.ALUMINUM_BRASS_INGOT, null}, + new SlimefunItemStack(SlimefunItems.HOLOGRAM_PROJECTOR, 3)) + .register(plugin); + + new SlimefunItem(categories.misc, SlimefunItems.CHAIN, RecipeType.ENHANCED_CRAFTING_TABLE, + new ItemStack[] {null, null, SlimefunItems.STEEL_INGOT, null, SlimefunItems.STEEL_INGOT, null, SlimefunItems.STEEL_INGOT, null, null}, + new SlimefunItemStack(SlimefunItems.CHAIN, 8)) + .register(plugin); + + new SlimefunItem(categories.misc, SlimefunItems.HOOK, RecipeType.ENHANCED_CRAFTING_TABLE, + new ItemStack[] {null, SlimefunItems.STEEL_INGOT, null, SlimefunItems.STEEL_INGOT, null, SlimefunItems.STEEL_INGOT, null, null, null}) + .register(plugin); + + new GrapplingHook(categories.tools, SlimefunItems.GRAPPLING_HOOK, RecipeType.ENHANCED_CRAFTING_TABLE, + new ItemStack[] {null, null, SlimefunItems.HOOK, null, SlimefunItems.CHAIN, null, SlimefunItems.CHAIN, null, null}) + .register(plugin); + + new MagicWorkbench(categories.basicMachines, SlimefunItems.MAGIC_WORKBENCH).register(plugin); + + new SlimefunItem(categories.magicalGadgets, SlimefunItems.STAFF_ELEMENTAL, RecipeType.MAGIC_WORKBENCH, + new ItemStack[] {null, SlimefunItems.MAGICAL_BOOK_COVER, SlimefunItems.MAGIC_LUMP_3, null, new ItemStack(Material.STICK), SlimefunItems.MAGICAL_BOOK_COVER, SlimefunItems.MAGIC_LUMP_3, null, null}) + .register(plugin); + + new WindStaff(categories.magicalGadgets, SlimefunItems.STAFF_WIND, RecipeType.MAGIC_WORKBENCH, + new ItemStack[] {null, new ItemStack(Material.FEATHER), SlimefunItems.ENDER_LUMP_3, null, SlimefunItems.STAFF_ELEMENTAL, new ItemStack(Material.FEATHER), SlimefunItems.STAFF_ELEMENTAL, null, null}) + .register(plugin); + + new WaterStaff(categories.magicalGadgets, SlimefunItems.STAFF_WATER, RecipeType.MAGIC_WORKBENCH, + new ItemStack[] {null, new ItemStack(Material.LILY_PAD), SlimefunItems.MAGIC_LUMP_2, null, SlimefunItems.STAFF_ELEMENTAL, new ItemStack(Material.LILY_PAD), SlimefunItems.STAFF_ELEMENTAL, null, null}) + .register(plugin); + + String[] multiToolItems = new String[] {"PORTABLE_CRAFTER", "MAGIC_EYE_OF_ENDER", "STAFF_ELEMENTAL_WIND", "GRAPPLING_HOOK"}; + + 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}, + 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}, + 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}, + 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}, + 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}, + 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}, + 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}, + 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); + + new SlimefunItem(categories.resources, SlimefunItems.GOLD_24K, RecipeType.SMELTERY, + new ItemStack[] {SlimefunItems.GOLD_DUST, SlimefunItems.GOLD_22K, null, null, null, null, null, null, null}) + .register(plugin); + + new SlimefunItem(categories.resources, SlimefunItems.GOLD_22K, RecipeType.SMELTERY, + new ItemStack[] {SlimefunItems.GOLD_DUST, SlimefunItems.GOLD_20K, null, null, null, null, null, null, null}) + .register(plugin); + + new SlimefunItem(categories.resources, SlimefunItems.GOLD_20K, RecipeType.SMELTERY, + new ItemStack[] {SlimefunItems.GOLD_DUST, SlimefunItems.GOLD_18K, null, null, null, null, null, null, null}) + .register(plugin); + + new SlimefunItem(categories.resources, SlimefunItems.GOLD_18K, RecipeType.SMELTERY, + new ItemStack[] {SlimefunItems.GOLD_DUST, SlimefunItems.GOLD_16K, null, null, null, null, null, null, null}) + .register(plugin); + + new SlimefunItem(categories.resources, SlimefunItems.GOLD_16K, RecipeType.SMELTERY, + new ItemStack[] {SlimefunItems.GOLD_DUST, SlimefunItems.GOLD_14K, null, null, null, null, null, null, null}) + .register(plugin); + + new SlimefunItem(categories.resources, SlimefunItems.GOLD_14K, RecipeType.SMELTERY, + new ItemStack[] {SlimefunItems.GOLD_DUST, SlimefunItems.GOLD_12K, null, null, null, null, null, null, null}) + .register(plugin); + + new SlimefunItem(categories.resources, SlimefunItems.GOLD_12K, RecipeType.SMELTERY, + new ItemStack[] {SlimefunItems.GOLD_DUST, SlimefunItems.GOLD_10K, null, null, null, null, null, null, null}) + .register(plugin); + + new SlimefunItem(categories.resources, SlimefunItems.GOLD_10K, RecipeType.SMELTERY, + new ItemStack[] {SlimefunItems.GOLD_DUST, SlimefunItems.GOLD_8K, null, null, null, null, null, null, null}) + .register(plugin); + + new SlimefunItem(categories.resources, SlimefunItems.GOLD_8K, RecipeType.SMELTERY, + new ItemStack[] {SlimefunItems.GOLD_DUST, SlimefunItems.GOLD_6K, null, null, null, null, null, null, null}) + .register(plugin); + + new SlimefunItem(categories.resources, SlimefunItems.GOLD_6K, RecipeType.SMELTERY, + new ItemStack[] {SlimefunItems.GOLD_DUST, SlimefunItems.GOLD_4K, null, null, null, null, null, null, null}) + .register(plugin); + + new SlimefunItem(categories.resources, SlimefunItems.GOLD_4K, RecipeType.SMELTERY, + new ItemStack[] {SlimefunItems.GOLD_DUST, null, null, null, null, null, null, null, null}) + .setUseableInWorkbench(true) + .register(plugin); + + new SlimefunItem(categories.misc, SlimefunItems.STONE_CHUNK, RecipeType.ORE_WASHER, + new ItemStack[] {SlimefunItems.SIFTED_ORE, null, null, null, null, null, null, null, null}) + .register(plugin); + + new SlimefunItem(categories.resources, SlimefunItems.SILICON, RecipeType.SMELTERY, + new ItemStack[] {new ItemStack(Material.QUARTZ_BLOCK), null, null, null, null, null, null, null, null}) + .register(plugin); + + new SlimefunItem(categories.technicalComponents, SlimefunItems.SOLAR_PANEL, RecipeType.ENHANCED_CRAFTING_TABLE, + new ItemStack[] {new ItemStack(Material.GLASS), new ItemStack(Material.GLASS), new ItemStack(Material.GLASS), SlimefunItems.SILICON, SlimefunItems.SILICON, SlimefunItems.SILICON, SlimefunItems.FERROSILICON, SlimefunItems.FERROSILICON, SlimefunItems.FERROSILICON}) + .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}, + 0.1) + .register(plugin); + + new UnplaceableBlock(categories.magicalResources, SlimefunItems.LAVA_CRYSTAL, RecipeType.ENHANCED_CRAFTING_TABLE, + new ItemStack[] {SlimefunItems.MAGIC_LUMP_1, new ItemStack(Material.BLAZE_POWDER), SlimefunItems.MAGIC_LUMP_1, new ItemStack(Material.BLAZE_POWDER), SlimefunItems.FIRE_RUNE, new ItemStack(Material.BLAZE_POWDER), SlimefunItems.MAGIC_LUMP_1, new ItemStack(Material.BLAZE_POWDER), SlimefunItems.MAGIC_LUMP_1}) + .register(plugin); + + new SlimefunItem(categories.magicalGadgets, SlimefunItems.STAFF_FIRE, RecipeType.MAGIC_WORKBENCH, + new ItemStack[] {null, null, SlimefunItems.LAVA_CRYSTAL, null, SlimefunItems.STAFF_ELEMENTAL, null, SlimefunItems.STAFF_ELEMENTAL, null, null}) + .register(plugin); + + if (SlimefunPlugin.getMinecraftVersion().isAtLeast(MinecraftVersion.MINECRAFT_1_14)) { + new StormStaff(categories.magicalGadgets, SlimefunItems.STAFF_STORM, RecipeType.ANCIENT_ALTAR, + new ItemStack[] {SlimefunItems.LIGHTNING_RUNE, SlimefunItems.ENDER_LUMP_3, SlimefunItems.LIGHTNING_RUNE, SlimefunItems.STAFF_WATER, SlimefunItems.MAGIC_SUGAR, SlimefunItems.STAFF_WIND, SlimefunItems.LIGHTNING_RUNE, SlimefunItems.ENDER_LUMP_3, SlimefunItems.LIGHTNING_RUNE}) + .register(plugin); + + ItemStack weaknessPotion = new ItemStack(Material.POTION); + PotionMeta meta = (PotionMeta) weaknessPotion.getItemMeta(); + meta.setBasePotionData(new PotionData(PotionType.WEAKNESS, false, false)); + weaknessPotion.setItemMeta(meta); + + new MagicalZombiePills(categories.magicalGadgets, SlimefunItems.MAGICAL_ZOMBIE_PILLS, RecipeType.MAGIC_WORKBENCH, + new ItemStack[] {new ItemStack(Material.GOLD_INGOT), SlimefunItems.MAGIC_LUMP_2, new ItemStack(Material.GOLD_INGOT), new ItemStack(Material.APPLE), weaknessPotion, new ItemStack(Material.APPLE), new ItemStack(Material.GOLD_INGOT), SlimefunItems.MAGIC_LUMP_2, new ItemStack(Material.GOLD_INGOT)}, + new SlimefunItemStack(SlimefunItems.MAGICAL_ZOMBIE_PILLS, 2)) + .register(plugin); + } + + new SmeltersPickaxe(categories.tools, SlimefunItems.SMELTERS_PICKAXE, RecipeType.ENHANCED_CRAFTING_TABLE, + new ItemStack[] {SlimefunItems.LAVA_CRYSTAL, SlimefunItems.LAVA_CRYSTAL, SlimefunItems.LAVA_CRYSTAL, null, SlimefunItems.FERROSILICON, null, null, SlimefunItems.FERROSILICON, null}) + .register(plugin); + + new SlimefunItem(categories.magicalResources, SlimefunItems.COMMON_TALISMAN, RecipeType.MAGIC_WORKBENCH, + new ItemStack[] {SlimefunItems.MAGIC_LUMP_2, SlimefunItems.GOLD_8K, SlimefunItems.MAGIC_LUMP_2, null, new ItemStack(Material.EMERALD), null, SlimefunItems.MAGIC_LUMP_2, SlimefunItems.GOLD_8K, SlimefunItems.MAGIC_LUMP_2}) + .register(plugin); + + new Talisman(SlimefunItems.TALISMAN_ANVIL, + new ItemStack[] {SlimefunItems.MAGIC_LUMP_3, null, SlimefunItems.MAGIC_LUMP_3, new ItemStack(Material.ANVIL), SlimefunItems.COMMON_TALISMAN, new ItemStack(Material.ANVIL), SlimefunItems.MAGIC_LUMP_3, null, SlimefunItems.MAGIC_LUMP_3}, + true, false, "anvil") + .register(plugin); + + new Talisman(SlimefunItems.TALISMAN_MINER, + new ItemStack[] {SlimefunItems.MAGIC_LUMP_3, null, SlimefunItems.MAGIC_LUMP_3, SlimefunItems.SYNTHETIC_SAPPHIRE, SlimefunItems.COMMON_TALISMAN, SlimefunItems.SIFTED_ORE, SlimefunItems.MAGIC_LUMP_3, null, SlimefunItems.MAGIC_LUMP_3}, + false, false, "miner", 20) + .register(plugin); + + new Talisman(SlimefunItems.TALISMAN_HUNTER, + new ItemStack[] {SlimefunItems.MAGIC_LUMP_3, null, SlimefunItems.MAGIC_LUMP_3, SlimefunItems.SYNTHETIC_SAPPHIRE, SlimefunItems.COMMON_TALISMAN, SlimefunItems.MONSTER_JERKY, SlimefunItems.MAGIC_LUMP_3, null, SlimefunItems.MAGIC_LUMP_3}, + false, false, "hunter", 20) + .register(plugin); + + new Talisman(SlimefunItems.TALISMAN_LAVA, + new ItemStack[] {SlimefunItems.MAGIC_LUMP_3, null, SlimefunItems.MAGIC_LUMP_3, SlimefunItems.LAVA_CRYSTAL, SlimefunItems.COMMON_TALISMAN, new ItemStack(Material.LAVA_BUCKET), SlimefunItems.MAGIC_LUMP_3, null, SlimefunItems.MAGIC_LUMP_3}, + true, true, "lava", new PotionEffect(PotionEffectType.FIRE_RESISTANCE, 3600, 4)) + .register(plugin); + + new Talisman(SlimefunItems.TALISMAN_WATER, + new ItemStack[] {SlimefunItems.MAGIC_LUMP_3, null, SlimefunItems.MAGIC_LUMP_3, new ItemStack(Material.WATER_BUCKET), SlimefunItems.COMMON_TALISMAN, new ItemStack(Material.FISHING_ROD), SlimefunItems.MAGIC_LUMP_3, null, SlimefunItems.MAGIC_LUMP_3}, + true, true, "water", new PotionEffect(PotionEffectType.WATER_BREATHING, 3600, 4)) + .register(plugin); + + new Talisman(SlimefunItems.TALISMAN_ANGEL, + new ItemStack[] {SlimefunItems.MAGIC_LUMP_3, null, SlimefunItems.MAGIC_LUMP_3, new ItemStack(Material.FEATHER), SlimefunItems.COMMON_TALISMAN, new ItemStack(Material.FEATHER), SlimefunItems.MAGIC_LUMP_3, null, SlimefunItems.MAGIC_LUMP_3}, + false, true, "angel", 75) + .register(plugin); + + new Talisman(SlimefunItems.TALISMAN_FIRE, + new ItemStack[] {SlimefunItems.MAGIC_LUMP_3, null, SlimefunItems.MAGIC_LUMP_3, SlimefunItems.LAVA_CRYSTAL, SlimefunItems.COMMON_TALISMAN, SlimefunItems.LAVA_CRYSTAL, SlimefunItems.MAGIC_LUMP_3, null, SlimefunItems.MAGIC_LUMP_3}, + true, true, "fire", new PotionEffect(PotionEffectType.FIRE_RESISTANCE, 3600, 4)) + .register(plugin); + + new MagicianTalisman(SlimefunItems.TALISMAN_MAGICIAN, + new ItemStack[] {SlimefunItems.ENDER_LUMP_3, null, SlimefunItems.ENDER_LUMP_3, new ItemStack(Material.ENCHANTING_TABLE), SlimefunItems.COMMON_TALISMAN, new ItemStack(Material.ENCHANTING_TABLE), SlimefunItems.ENDER_LUMP_3, null, SlimefunItems.ENDER_LUMP_3}) + .register(plugin); + + new Talisman(SlimefunItems.TALISMAN_TRAVELLER, + new ItemStack[] {SlimefunItems.MAGIC_LUMP_3, null, SlimefunItems.MAGIC_LUMP_3, SlimefunItems.STAFF_WIND, SlimefunItems.TALISMAN_ANGEL, SlimefunItems.STAFF_WIND, SlimefunItems.MAGIC_LUMP_3, null, SlimefunItems.MAGIC_LUMP_3}, + false, false, "traveller", 60, new PotionEffect(PotionEffectType.SPEED, 3600, 2)) + .register(plugin); + + new Talisman(SlimefunItems.TALISMAN_WARRIOR, + new ItemStack[] {SlimefunItems.MAGIC_LUMP_3, null, SlimefunItems.MAGIC_LUMP_3, SlimefunItems.REINFORCED_ALLOY_INGOT, SlimefunItems.COMMON_TALISMAN, SlimefunItems.REINFORCED_ALLOY_INGOT, SlimefunItems.MAGIC_LUMP_3, null, SlimefunItems.MAGIC_LUMP_3}, + true, true, "warrior", new PotionEffect(PotionEffectType.INCREASE_DAMAGE, 3600, 2)) + .register(plugin); + + new Talisman(SlimefunItems.TALISMAN_KNIGHT, + new ItemStack[] {SlimefunItems.MAGIC_LUMP_3, null, SlimefunItems.MAGIC_LUMP_3, SlimefunItems.GILDED_IRON, SlimefunItems.TALISMAN_WARRIOR, SlimefunItems.GILDED_IRON, SlimefunItems.MAGIC_LUMP_3, null, SlimefunItems.MAGIC_LUMP_3}, + "knight", 30, new PotionEffect(PotionEffectType.REGENERATION, 100, 3)) + .register(plugin); + + new SlimefunItem(categories.resources, SlimefunItems.GILDED_IRON, RecipeType.SMELTERY, + new ItemStack[] {SlimefunItems.GOLD_24K, SlimefunItems.IRON_DUST, null, null, null, null, null, null, null}) + .register(plugin); + + new SyntheticEmerald(categories.resources, SlimefunItems.SYNTHETIC_EMERALD, RecipeType.SMELTERY, + new ItemStack[] {SlimefunItems.SYNTHETIC_SAPPHIRE, SlimefunItems.ALUMINUM_DUST, SlimefunItems.ALUMINUM_INGOT, new ItemStack(Material.GLASS_PANE), null, null, null, null, null}) + .register(plugin); + + registerArmorSet(categories.armor, SlimefunItems.CHAIN, new ItemStack[] { + new ItemStack(Material.CHAINMAIL_HELMET), new ItemStack(Material.CHAINMAIL_CHESTPLATE), new ItemStack(Material.CHAINMAIL_LEGGINGS), new ItemStack(Material.CHAINMAIL_BOOTS) + }, "CHAIN", true, new PotionEffect[0][0], plugin); + + new Talisman(SlimefunItems.TALISMAN_WHIRLWIND, + new ItemStack[] {SlimefunItems.MAGIC_LUMP_3, null, SlimefunItems.MAGIC_LUMP_3, SlimefunItems.STAFF_WIND, SlimefunItems.TALISMAN_TRAVELLER, SlimefunItems.STAFF_WIND, SlimefunItems.MAGIC_LUMP_3, null, SlimefunItems.MAGIC_LUMP_3} + , false, true, "whirlwind", 60) + .register(plugin); + + new Talisman(SlimefunItems.TALISMAN_WIZARD, + new ItemStack[] {SlimefunItems.ENDER_LUMP_3, null, SlimefunItems.ENDER_LUMP_3, SlimefunItems.MAGIC_EYE_OF_ENDER, SlimefunItems.TALISMAN_MAGICIAN, SlimefunItems.MAGIC_EYE_OF_ENDER, SlimefunItems.ENDER_LUMP_3, null, SlimefunItems.ENDER_LUMP_3}, + false, false, "wizard", 60) + .register(plugin); + + new LumberAxe(categories.tools, SlimefunItems.LUMBER_AXE, RecipeType.MAGIC_WORKBENCH, + new ItemStack[] {SlimefunItems.SYNTHETIC_DIAMOND, SlimefunItems.SYNTHETIC_DIAMOND, null, SlimefunItems.SYNTHETIC_EMERALD, SlimefunItems.GILDED_IRON, null, null, SlimefunItems.GILDED_IRON, null}) + .register(plugin); + + new SlimefunItem(categories.misc, SlimefunItems.SALT, RecipeType.ORE_WASHER, + new ItemStack[] {new ItemStack(Material.SAND, 2), null, null, null, null, null, null, null, null}) + .register(plugin); + + new SlimefunItem(categories.misc, SlimefunItems.HEAVY_CREAM, RecipeType.ENHANCED_CRAFTING_TABLE, + new ItemStack[] {new ItemStack(Material.MILK_BUCKET), null, null, null, null, null, null, null, null}, + new SlimefunItemStack(SlimefunItems.HEAVY_CREAM, 2)) + .register(plugin); + + new SlimefunItem(categories.misc, SlimefunItems.CHEESE, RecipeType.ENHANCED_CRAFTING_TABLE, + new ItemStack[] {new ItemStack(Material.MILK_BUCKET), SlimefunItems.SALT, null, null, null, null, null, null, null}) + .register(plugin); + + new SlimefunItem(categories.misc, SlimefunItems.BUTTER, RecipeType.ENHANCED_CRAFTING_TABLE, + new ItemStack[] {SlimefunItems.HEAVY_CREAM, SlimefunItems.SALT, null, null, null, null, null, null, null}) + .register(plugin); + + 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, new PotionEffect[0][0], 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 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 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 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 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, + new ItemStack[] {SlimefunItems.SIFTED_ORE, null, null, null, null, null, null, null, null}) + .register(plugin); + + new SlimefunItem(categories.misc, SlimefunItems.PULVERIZED_ORE, RecipeType.ORE_CRUSHER, + new ItemStack[] {SlimefunItems.CRUSHED_ORE, null, null, null, null, null, null, null, null}) + .register(plugin); + + new SlimefunItem(categories.misc, SlimefunItems.PURE_ORE_CLUSTER, RecipeType.ORE_WASHER, + new ItemStack[] {SlimefunItems.PULVERIZED_ORE, null, null, null, null, null, null, null, null}) + .register(plugin); + + new UnplaceableBlock(categories.misc, SlimefunItems.TINY_URANIUM, RecipeType.ORE_CRUSHER, + new ItemStack[] {SlimefunItems.PURE_ORE_CLUSTER, null, null, null, null, null, null, null, null}) + .register(plugin); + + new RadioactiveItem(categories.misc, Radioactivity.MODERATE, SlimefunItems.SMALL_URANIUM, RecipeType.ENHANCED_CRAFTING_TABLE, + new ItemStack[] {SlimefunItems.TINY_URANIUM, SlimefunItems.TINY_URANIUM, SlimefunItems.TINY_URANIUM, SlimefunItems.TINY_URANIUM, SlimefunItems.TINY_URANIUM, SlimefunItems.TINY_URANIUM, SlimefunItems.TINY_URANIUM, SlimefunItems.TINY_URANIUM, SlimefunItems.TINY_URANIUM}) + .register(plugin); + + new RadioactiveItem(categories.resources, Radioactivity.HIGH, SlimefunItems.URANIUM, RecipeType.ENHANCED_CRAFTING_TABLE, + new ItemStack[] {SlimefunItems.SMALL_URANIUM, SlimefunItems.SMALL_URANIUM, null, SlimefunItems.SMALL_URANIUM, SlimefunItems.SMALL_URANIUM, null, null, null, null}) + .register(plugin); + + new SlimefunItem(categories.resources, SlimefunItems.REDSTONE_ALLOY, RecipeType.SMELTERY, + new ItemStack[] {new ItemStack(Material.REDSTONE), new ItemStack(Material.REDSTONE_BLOCK), SlimefunItems.FERROSILICON, SlimefunItems.HARDENED_METAL_INGOT, null, null, null, null, null}) + .register(plugin); + + registerArmorSet(categories.armor, SlimefunItems.GOLD_12K, new ItemStack[] { + SlimefunItems.GOLD_HELMET, SlimefunItems.GOLD_CHESTPLATE, SlimefunItems.GOLD_LEGGINGS, SlimefunItems.GOLD_BOOTS + }, "GOLD_12K", false, new PotionEffect[0][0], plugin); + + new SlimefunItem(categories.misc, SlimefunItems.CLOTH, RecipeType.ENHANCED_CRAFTING_TABLE, + new ItemStack[] {new ItemStack(Material.WHITE_WOOL), null, null, null, null, null, null, null, null}, + new SlimefunItemStack(SlimefunItems.CLOTH, 8)) + .register(plugin); + + new Bandage(categories.usefulItems, SlimefunItems.RAG, RecipeType.ENHANCED_CRAFTING_TABLE, + new ItemStack[] {SlimefunItems.CLOTH, SlimefunItems.CLOTH, SlimefunItems.CLOTH, new ItemStack(Material.STRING), null, new ItemStack(Material.STRING), SlimefunItems.CLOTH, SlimefunItems.CLOTH, SlimefunItems.CLOTH}, + new SlimefunItemStack(SlimefunItems.RAG, 2), 0) + .register(plugin); + + new Bandage(categories.usefulItems, SlimefunItems.BANDAGE, RecipeType.ENHANCED_CRAFTING_TABLE, + new ItemStack[] {SlimefunItems.RAG, new ItemStack(Material.STRING), SlimefunItems.RAG, null, null, null, null, null, null}, + new SlimefunItemStack(SlimefunItems.BANDAGE, 4), 1) + .register(plugin); + + new Splint(categories.usefulItems, SlimefunItems.SPLINT, RecipeType.ENHANCED_CRAFTING_TABLE, + new ItemStack[] {null, new ItemStack(Material.IRON_INGOT), null, new ItemStack(Material.STICK), new ItemStack(Material.STICK), new ItemStack(Material.STICK), null, new ItemStack(Material.IRON_INGOT), null}, + new SlimefunItemStack(SlimefunItems.SPLINT, 4)) + .register(plugin); + + new SlimefunItem(categories.misc, SlimefunItems.TIN_CAN, RecipeType.ENHANCED_CRAFTING_TABLE, + new ItemStack[] {SlimefunItems.TIN_INGOT, SlimefunItems.TIN_INGOT, SlimefunItems.TIN_INGOT, SlimefunItems.TIN_INGOT, null, SlimefunItems.TIN_INGOT, SlimefunItems.TIN_INGOT, SlimefunItems.TIN_INGOT, SlimefunItems.TIN_INGOT}, + new SlimefunItemStack(SlimefunItems.TIN_CAN, 8)) + .register(plugin); + + new Vitamins(categories.usefulItems, SlimefunItems.VITAMINS, RecipeType.ENHANCED_CRAFTING_TABLE, + new ItemStack[] {SlimefunItems.TIN_CAN, new ItemStack(Material.APPLE), new ItemStack(Material.RED_MUSHROOM), new ItemStack(Material.SUGAR), null, null, null, null, null}) + .register(plugin); + + new Medicine(categories.usefulItems, SlimefunItems.MEDICINE, RecipeType.ENHANCED_CRAFTING_TABLE, + new ItemStack[] {SlimefunItems.VITAMINS, new ItemStack(Material.GLASS_BOTTLE), SlimefunItems.HEAVY_CREAM, null, null, null, null, null, null}) + .register(plugin); + + new SlimefunArmorPiece(categories.technicalGadgets, SlimefunItems.NIGHT_VISION_GOGGLES, RecipeType.ARMOR_FORGE, + new ItemStack[] {new ItemStack(Material.COAL_BLOCK), new ItemStack(Material.COAL_BLOCK), new ItemStack(Material.COAL_BLOCK), new ItemStack(Material.LIME_STAINED_GLASS_PANE), new ItemStack(Material.COAL_BLOCK), new ItemStack(Material.LIME_STAINED_GLASS_PANE), new ItemStack(Material.COAL_BLOCK), null, new ItemStack(Material.COAL_BLOCK)}, + new PotionEffect[] {new PotionEffect(PotionEffectType.NIGHT_VISION, 600, 20)}) + .register(plugin); + + new PickaxeOfContainment(categories.tools, SlimefunItems.PICKAXE_OF_CONTAINMENT, RecipeType.MAGIC_WORKBENCH, + new ItemStack[] {SlimefunItems.FERROSILICON, SlimefunItems.FERROSILICON, SlimefunItems.FERROSILICON, null, SlimefunItems.GILDED_IRON, null, null, SlimefunItems.GILDED_IRON, null}) + .register(plugin); + + new HerculesPickaxe(categories.tools, SlimefunItems.HERCULES_PICKAXE, RecipeType.MAGIC_WORKBENCH, + new ItemStack[] {SlimefunItems.HARDENED_METAL_INGOT, SlimefunItems.HARDENED_METAL_INGOT, SlimefunItems.HARDENED_METAL_INGOT, null, SlimefunItems.FERROSILICON, null, null, SlimefunItems.FERROSILICON, null}) + .register(plugin); + + if (SlimefunPlugin.getMinecraftVersion().isAtLeast(MinecraftVersion.MINECRAFT_1_14)) { + new TableSaw(categories.basicMachines, SlimefunItems.TABLE_SAW).register(plugin); + } + + 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 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, + 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), new ItemStack(Material.SLIME_BALL), null, new ItemStack(Material.SLIME_BALL)}, + new PotionEffect[] {new PotionEffect(PotionEffectType.SPEED, 300, 2)}) + .register(plugin); + + new SlimefunArmorPiece(categories.magicalArmor, SlimefunItems.SLIME_BOOTS_STEEL, RecipeType.ARMOR_FORGE, + new ItemStack[] {null, null, null, 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 PotionEffect[] {new PotionEffect(PotionEffectType.JUMP, 300, 5)}) + .register(plugin); + + new VampireBlade(categories.weapons, SlimefunItems.BLADE_OF_VAMPIRES, RecipeType.MAGIC_WORKBENCH, + new ItemStack[] {null, new ItemStack(Material.WITHER_SKELETON_SKULL), null, null, new ItemStack(Material.WITHER_SKELETON_SKULL), null, null, new ItemStack(Material.BLAZE_ROD), null}) + .register(plugin); + + new SlimefunItem(categories.misc, SlimefunItems.GOLD_24K_BLOCK, RecipeType.ENHANCED_CRAFTING_TABLE, + new ItemStack[] {SlimefunItems.GOLD_24K, SlimefunItems.GOLD_24K, SlimefunItems.GOLD_24K, SlimefunItems.GOLD_24K, SlimefunItems.GOLD_24K, SlimefunItems.GOLD_24K, SlimefunItems.GOLD_24K, SlimefunItems.GOLD_24K, SlimefunItems.GOLD_24K}) + .register(plugin); + + new Composter(categories.basicMachines, SlimefunItems.COMPOSTER, RecipeType.ENHANCED_CRAFTING_TABLE, + new ItemStack[] {new ItemStack(Material.OAK_SLAB), null, new ItemStack(Material.OAK_SLAB), new ItemStack(Material.OAK_SLAB), null, new ItemStack(Material.OAK_SLAB), new ItemStack(Material.OAK_SLAB), new ItemStack(Material.CAULDRON), new ItemStack(Material.OAK_SLAB)}) + .register(plugin); + + new SlimefunItem(categories.magicalArmor, SlimefunItems.FARMER_SHOES, RecipeType.ARMOR_FORGE, + new ItemStack[] {null, null, null, new ItemStack(Material.HAY_BLOCK), null, new ItemStack(Material.HAY_BLOCK), new ItemStack(Material.HAY_BLOCK), null, new ItemStack(Material.HAY_BLOCK)}) + .register(plugin); + + new ExplosivePickaxe(categories.tools, SlimefunItems.EXPLOSIVE_PICKAXE, RecipeType.MAGIC_WORKBENCH, + new ItemStack[] {new ItemStack(Material.TNT), SlimefunItems.SYNTHETIC_DIAMOND, new ItemStack(Material.TNT), null, SlimefunItems.FERROSILICON, null, null, SlimefunItems.FERROSILICON, null}) + .register(plugin); + + new ExplosiveShovel(categories.tools, SlimefunItems.EXPLOSIVE_SHOVEL, RecipeType.MAGIC_WORKBENCH, + new ItemStack[] {null, SlimefunItems.SYNTHETIC_DIAMOND, null, null, new ItemStack(Material.TNT), null, null, SlimefunItems.FERROSILICON, null}) + .register(plugin); + + new AutomatedPanningMachine(categories.basicMachines, SlimefunItems.AUTOMATED_PANNING_MACHINE).register(plugin); + + new IndustrialMiner(categories.basicMachines, SlimefunItems.INDUSTRIAL_MINER, Material.IRON_BLOCK, false, 3).register(plugin); + new AdvancedIndustrialMiner(categories.basicMachines, SlimefunItems.ADVANCED_INDUSTRIAL_MINER).register(plugin); + + new SlimefunItem(categories.magicalArmor, SlimefunItems.BOOTS_OF_THE_STOMPER, RecipeType.ARMOR_FORGE, + new ItemStack[] {null, null, null, new ItemStack(Material.YELLOW_WOOL), null, new ItemStack(Material.YELLOW_WOOL), new ItemStack(Material.PISTON), null, new ItemStack(Material.PISTON)}) + .register(plugin); + + new PickaxeOfTheSeeker(categories.tools, SlimefunItems.PICKAXE_OF_THE_SEEKER, RecipeType.MAGIC_WORKBENCH, + new ItemStack[] {new ItemStack(Material.COMPASS), SlimefunItems.SYNTHETIC_DIAMOND, new ItemStack(Material.COMPASS), null, SlimefunItems.FERROSILICON, null, null, SlimefunItems.FERROSILICON, null}) + .register(plugin); + + new SlimefunBackpack(9, categories.usefulItems, SlimefunItems.BACKPACK_SMALL, RecipeType.ENHANCED_CRAFTING_TABLE, + new ItemStack[] {new ItemStack(Material.LEATHER), null, new ItemStack(Material.LEATHER), SlimefunItems.GOLD_6K, new ItemStack(Material.CHEST), SlimefunItems.GOLD_6K, new ItemStack(Material.LEATHER), new ItemStack(Material.LEATHER), new ItemStack(Material.LEATHER)}) + .register(plugin); + + new SlimefunBackpack(18, categories.usefulItems, SlimefunItems.BACKPACK_MEDIUM, RecipeType.ENHANCED_CRAFTING_TABLE, + new ItemStack[] {new ItemStack(Material.LEATHER), null, new ItemStack(Material.LEATHER), SlimefunItems.GOLD_10K, SlimefunItems.BACKPACK_SMALL, SlimefunItems.GOLD_10K, new ItemStack(Material.LEATHER), new ItemStack(Material.LEATHER), new ItemStack(Material.LEATHER)}) + .register(plugin); + + new SlimefunBackpack(27, categories.usefulItems, SlimefunItems.BACKPACK_LARGE, RecipeType.ENHANCED_CRAFTING_TABLE, + new ItemStack[] {new ItemStack(Material.LEATHER), null, new ItemStack(Material.LEATHER), SlimefunItems.GOLD_14K, SlimefunItems.BACKPACK_MEDIUM, SlimefunItems.GOLD_14K, new ItemStack(Material.LEATHER), new ItemStack(Material.LEATHER), new ItemStack(Material.LEATHER)}) + .register(plugin); + + new SlimefunBackpack(36, categories.usefulItems, SlimefunItems.WOVEN_BACKPACK, RecipeType.ENHANCED_CRAFTING_TABLE, + new ItemStack[] {SlimefunItems.CLOTH, null, SlimefunItems.CLOTH, SlimefunItems.GOLD_16K, SlimefunItems.BACKPACK_LARGE, SlimefunItems.GOLD_16K, SlimefunItems.CLOTH, SlimefunItems.CLOTH, SlimefunItems.CLOTH}) + .register(plugin); + + new Crucible(categories.basicMachines, SlimefunItems.CRUCIBLE, RecipeType.ENHANCED_CRAFTING_TABLE, + new ItemStack[] {new ItemStack(Material.TERRACOTTA), null, new ItemStack(Material.TERRACOTTA), new ItemStack(Material.TERRACOTTA), null, new ItemStack(Material.TERRACOTTA), new ItemStack(Material.TERRACOTTA), new ItemStack(Material.FLINT_AND_STEEL), new ItemStack(Material.TERRACOTTA)}) + .register(plugin); + + new SlimefunBackpack(45, categories.usefulItems, SlimefunItems.GILDED_BACKPACK, RecipeType.ENHANCED_CRAFTING_TABLE, + new ItemStack[] {SlimefunItems.GOLD_22K, null, SlimefunItems.GOLD_22K, new ItemStack(Material.LEATHER), SlimefunItems.WOVEN_BACKPACK, new ItemStack(Material.LEATHER), SlimefunItems.GOLD_22K, null, SlimefunItems.GOLD_22K}) + .register(plugin); + + new SlimefunBackpack(54, categories.usefulItems, SlimefunItems.RADIANT_BACKPACK, RecipeType.ENHANCED_CRAFTING_TABLE, + new ItemStack[] {SlimefunItems.GOLD_24K, null, SlimefunItems.GOLD_24K, new ItemStack(Material.LEATHER), SlimefunItems.GILDED_BACKPACK, new ItemStack(Material.LEATHER), SlimefunItems.GOLD_24K, null, SlimefunItems.GOLD_24K}) + .register(plugin); + + new RestoredBackpack(categories.usefulItems).register(plugin); + + new SlimefunItem(categories.technicalComponents, SlimefunItems.MAGNET, RecipeType.SMELTERY, + new ItemStack[] {SlimefunItems.NICKEL_INGOT, SlimefunItems.ALUMINUM_DUST, SlimefunItems.IRON_DUST, SlimefunItems.COBALT_INGOT, null, null, null, null, null}) + .register(plugin); + + new InfusedMagnet(categories.magicalGadgets, SlimefunItems.INFUSED_MAGNET, RecipeType.MAGIC_WORKBENCH, + new ItemStack[] {SlimefunItems.MAGIC_LUMP_3, null, SlimefunItems.MAGIC_LUMP_3, SlimefunItems.ENDER_LUMP_2, SlimefunItems.MAGNET, SlimefunItems.ENDER_LUMP_2, SlimefunItems.MAGIC_LUMP_3, null, SlimefunItems.MAGIC_LUMP_3}) + .register(plugin); + + new SlimefunItem(categories.tools, SlimefunItems.COBALT_PICKAXE, RecipeType.ENHANCED_CRAFTING_TABLE, + new ItemStack[] {SlimefunItems.COBALT_INGOT, SlimefunItems.COBALT_INGOT, SlimefunItems.COBALT_INGOT, null, SlimefunItems.NICKEL_INGOT, null, null, SlimefunItems.NICKEL_INGOT, null}) + .register(plugin); + + new SlimefunItem(categories.magicalResources, SlimefunItems.NECROTIC_SKULL, RecipeType.MAGIC_WORKBENCH, + new ItemStack[] {SlimefunItems.MAGIC_LUMP_3, null, SlimefunItems.MAGIC_LUMP_3, null, new ItemStack(Material.WITHER_SKELETON_SKULL), null, SlimefunItems.MAGIC_LUMP_3, null, SlimefunItems.MAGIC_LUMP_3}) + .register(plugin); + + new SlimefunItem(categories.magicalResources, SlimefunItems.ESSENCE_OF_AFTERLIFE, RecipeType.ANCIENT_ALTAR, + 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.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, 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, 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, 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, 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, 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, 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, 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, 50) + .register(plugin); + + new SeismicAxe(categories.weapons, SlimefunItems.SEISMIC_AXE, RecipeType.MAGIC_WORKBENCH, + new ItemStack[] {SlimefunItems.HARDENED_METAL_INGOT, SlimefunItems.HARDENED_METAL_INGOT, null, SlimefunItems.HARDENED_METAL_INGOT, SlimefunItems.STAFF_ELEMENTAL, null, null, SlimefunItems.STAFF_ELEMENTAL, null}) + .register(plugin); + + new PickaxeOfVeinMining(categories.tools, SlimefunItems.PICKAXE_OF_VEIN_MINING, RecipeType.MAGIC_WORKBENCH, + new ItemStack[] {new ItemStack(Material.EMERALD_ORE), SlimefunItems.SYNTHETIC_DIAMOND, new ItemStack(Material.EMERALD_ORE), null, SlimefunItems.GILDED_IRON, null, null, SlimefunItems.GILDED_IRON, null}) + .register(plugin); + + new SoulboundItem(categories.weapons, SlimefunItems.SOULBOUND_SWORD, RecipeType.MAGIC_WORKBENCH, + new ItemStack[] {null, SlimefunItems.ESSENCE_OF_AFTERLIFE, null, null, new ItemStack(Material.DIAMOND_SWORD), null, null, SlimefunItems.ESSENCE_OF_AFTERLIFE, null}) + .register(plugin); + + new SoulboundItem(categories.weapons, SlimefunItems.SOULBOUND_TRIDENT, RecipeType.MAGIC_WORKBENCH, + new ItemStack[] {null, SlimefunItems.ESSENCE_OF_AFTERLIFE, null, null, new ItemStack(Material.TRIDENT), null, null, SlimefunItems.ESSENCE_OF_AFTERLIFE, null}) + .register(plugin); + + new SoulboundItem(categories.weapons, SlimefunItems.SOULBOUND_BOW, RecipeType.MAGIC_WORKBENCH, + new ItemStack[] {null, SlimefunItems.ESSENCE_OF_AFTERLIFE, null, null, new ItemStack(Material.BOW), null, null, SlimefunItems.ESSENCE_OF_AFTERLIFE, null}) + .register(plugin); + + new SoulboundItem(categories.tools, SlimefunItems.SOULBOUND_PICKAXE, RecipeType.MAGIC_WORKBENCH, + new ItemStack[] {null, SlimefunItems.ESSENCE_OF_AFTERLIFE, null, null, new ItemStack(Material.DIAMOND_PICKAXE), null, null, SlimefunItems.ESSENCE_OF_AFTERLIFE, null}) + .register(plugin); + + new SoulboundItem(categories.tools, SlimefunItems.SOULBOUND_AXE, RecipeType.MAGIC_WORKBENCH, + new ItemStack[] {null, SlimefunItems.ESSENCE_OF_AFTERLIFE, null, null, new ItemStack(Material.DIAMOND_AXE), null, null, SlimefunItems.ESSENCE_OF_AFTERLIFE, null}) + .register(plugin); + + new SoulboundItem(categories.tools, SlimefunItems.SOULBOUND_SHOVEL, RecipeType.MAGIC_WORKBENCH, + new ItemStack[] {null, SlimefunItems.ESSENCE_OF_AFTERLIFE, null, null, new ItemStack(Material.DIAMOND_SHOVEL), null, null, SlimefunItems.ESSENCE_OF_AFTERLIFE, null}) + .register(plugin); + + new SoulboundItem(categories.tools, SlimefunItems.SOULBOUND_HOE, RecipeType.MAGIC_WORKBENCH, + new ItemStack[] {null, SlimefunItems.ESSENCE_OF_AFTERLIFE, null, null, new ItemStack(Material.DIAMOND_HOE), null, null, SlimefunItems.ESSENCE_OF_AFTERLIFE, null}) + .register(plugin); + + new SoulboundItem(categories.magicalArmor, SlimefunItems.SOULBOUND_HELMET, RecipeType.MAGIC_WORKBENCH, + new ItemStack[] {null, SlimefunItems.ESSENCE_OF_AFTERLIFE, null, null, new ItemStack(Material.DIAMOND_HELMET), null, null, SlimefunItems.ESSENCE_OF_AFTERLIFE, null}) + .register(plugin); + + new SoulboundItem(categories.magicalArmor, SlimefunItems.SOULBOUND_CHESTPLATE, RecipeType.MAGIC_WORKBENCH, + new ItemStack[] {null, SlimefunItems.ESSENCE_OF_AFTERLIFE, null, null, new ItemStack(Material.DIAMOND_CHESTPLATE), null, null, SlimefunItems.ESSENCE_OF_AFTERLIFE, null}) + .register(plugin); + + new SoulboundItem(categories.magicalArmor, SlimefunItems.SOULBOUND_LEGGINGS, RecipeType.MAGIC_WORKBENCH, + new ItemStack[] {null, SlimefunItems.ESSENCE_OF_AFTERLIFE, null, null, new ItemStack(Material.DIAMOND_LEGGINGS), null, null, SlimefunItems.ESSENCE_OF_AFTERLIFE, null}) + .register(plugin); + + new SoulboundItem(categories.magicalArmor, SlimefunItems.SOULBOUND_BOOTS, RecipeType.MAGIC_WORKBENCH, + new ItemStack[] {null, SlimefunItems.ESSENCE_OF_AFTERLIFE, null, null, new ItemStack(Material.DIAMOND_BOOTS), null, null, SlimefunItems.ESSENCE_OF_AFTERLIFE, null}) + .register(plugin); + + new Juicer(categories.basicMachines, SlimefunItems.JUICER).register(plugin); + + new Juice(categories.food, SlimefunItems.APPLE_JUICE, RecipeType.JUICER, + new ItemStack[] {new ItemStack(Material.APPLE), null, null, null, null, null, null, null, null}) + .register(plugin); + + new Juice(categories.food, SlimefunItems.CARROT_JUICE, RecipeType.JUICER, + new ItemStack[] {new ItemStack(Material.CARROT), null, null, null, null, null, null, null, null}) + .register(plugin); + + new Juice(categories.food, SlimefunItems.MELON_JUICE, RecipeType.JUICER, + 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, + new ItemStack[] {new ItemStack(Material.PUMPKIN), null, null, null, null, null, null, null, null}) + .register(plugin); + + if (SlimefunPlugin.getMinecraftVersion().isAtLeast(MinecraftVersion.MINECRAFT_1_14)) { + new Juice(categories.food, SlimefunItems.SWEET_BERRY_JUICE, RecipeType.JUICER, + new ItemStack[] {new ItemStack(Material.SWEET_BERRIES), null, null, null, null, null, null, null, null}) + .register(plugin); + } + + new Juice(categories.food, SlimefunItems.GOLDEN_APPLE_JUICE, RecipeType.JUICER, + new ItemStack[] {new ItemStack(Material.GOLDEN_APPLE), null, null, null, null, null, null, null, null}) + .register(plugin); + + new BrokenSpawner(categories.magicalResources, SlimefunItems.BROKEN_SPAWNER, new RecipeType(new NamespacedKey(plugin, "pickaxe_of_containment"), SlimefunItems.PICKAXE_OF_CONTAINMENT), + new ItemStack[] {null, null, null, null, new ItemStack(Material.SPAWNER), null, null, null, null}) + .register(plugin); + + new RepairedSpawner(categories.magicalGadgets, SlimefunItems.REPAIRED_SPAWNER, RecipeType.ANCIENT_ALTAR, + new ItemStack[] {SlimefunItems.ENDER_RUNE, SlimefunItems.FILLED_FLASK_OF_KNOWLEDGE, SlimefunItems.ESSENCE_OF_AFTERLIFE, SlimefunItems.FILLED_FLASK_OF_KNOWLEDGE, SlimefunItems.BROKEN_SPAWNER, SlimefunItems.FILLED_FLASK_OF_KNOWLEDGE, SlimefunItems.ESSENCE_OF_AFTERLIFE, SlimefunItems.FILLED_FLASK_OF_KNOWLEDGE, SlimefunItems.ENDER_RUNE}) + .register(plugin); + + new EnhancedFurnace(categories.basicMachines, 1, 1, 1, SlimefunItems.ENHANCED_FURNACE, + new ItemStack[] {null, SlimefunItems.STEEL_INGOT, null, SlimefunItems.BASIC_CIRCUIT_BOARD, new ItemStack(Material.FURNACE), SlimefunItems.HEATING_COIL, null, SlimefunItems.ELECTRIC_MOTOR, null}) + .register(plugin); + + new EnhancedFurnace(categories.basicMachines, 2, 1, 1, SlimefunItems.ENHANCED_FURNACE_2, + new ItemStack[] {null, SlimefunItems.STEEL_INGOT, null, SlimefunItems.BASIC_CIRCUIT_BOARD, SlimefunItems.ENHANCED_FURNACE, SlimefunItems.HEATING_COIL, null, SlimefunItems.ELECTRIC_MOTOR, null}) + .register(plugin); + + new EnhancedFurnace(categories.basicMachines, 2, 2, 1, SlimefunItems.ENHANCED_FURNACE_3, + new ItemStack[] {null, SlimefunItems.STEEL_INGOT, null, SlimefunItems.BASIC_CIRCUIT_BOARD, SlimefunItems.ENHANCED_FURNACE_2, SlimefunItems.HEATING_COIL, null, SlimefunItems.ELECTRIC_MOTOR, null}) + .register(plugin); + + new EnhancedFurnace(categories.basicMachines, 3, 2, 1, SlimefunItems.ENHANCED_FURNACE_4, + new ItemStack[] {null, SlimefunItems.STEEL_INGOT, null, SlimefunItems.BASIC_CIRCUIT_BOARD, SlimefunItems.ENHANCED_FURNACE_3, SlimefunItems.HEATING_COIL, null, SlimefunItems.ELECTRIC_MOTOR, null}) + .register(plugin); + + new EnhancedFurnace(categories.basicMachines, 3, 2, 2, SlimefunItems.ENHANCED_FURNACE_5, + new ItemStack[] {null, SlimefunItems.STEEL_INGOT, null, SlimefunItems.BASIC_CIRCUIT_BOARD, SlimefunItems.ENHANCED_FURNACE_4, SlimefunItems.HEATING_COIL, null, SlimefunItems.ELECTRIC_MOTOR, null}) + .register(plugin); + + new EnhancedFurnace(categories.basicMachines, 3, 3, 2, SlimefunItems.ENHANCED_FURNACE_6, + new ItemStack[] {null, SlimefunItems.STEEL_INGOT, null, SlimefunItems.BASIC_CIRCUIT_BOARD, SlimefunItems.ENHANCED_FURNACE_5, SlimefunItems.HEATING_COIL, null, SlimefunItems.ELECTRIC_MOTOR, null}) + .register(plugin); + + new EnhancedFurnace(categories.basicMachines, 4, 3, 2, SlimefunItems.ENHANCED_FURNACE_7, + new ItemStack[] {null, SlimefunItems.STEEL_INGOT, null, SlimefunItems.BASIC_CIRCUIT_BOARD, SlimefunItems.ENHANCED_FURNACE_6, SlimefunItems.HEATING_COIL, null, SlimefunItems.ELECTRIC_MOTOR, null}) + .register(plugin); + + new EnhancedFurnace(categories.basicMachines, 4, 4, 2, SlimefunItems.ENHANCED_FURNACE_8, + new ItemStack[] {null, SlimefunItems.STEEL_INGOT, null, SlimefunItems.BASIC_CIRCUIT_BOARD, SlimefunItems.ENHANCED_FURNACE_7, SlimefunItems.HEATING_COIL, null, SlimefunItems.ELECTRIC_MOTOR, null}) + .register(plugin); + + new EnhancedFurnace(categories.basicMachines, 5, 4, 2, SlimefunItems.ENHANCED_FURNACE_9, + new ItemStack[] {null, SlimefunItems.STEEL_INGOT, null, SlimefunItems.BASIC_CIRCUIT_BOARD, SlimefunItems.ENHANCED_FURNACE_8, SlimefunItems.HEATING_COIL, null, SlimefunItems.ELECTRIC_MOTOR, null}) + .register(plugin); + + new EnhancedFurnace(categories.basicMachines, 5, 5, 2, SlimefunItems.ENHANCED_FURNACE_10, + new ItemStack[] {null, SlimefunItems.STEEL_INGOT, null, SlimefunItems.BASIC_CIRCUIT_BOARD, SlimefunItems.ENHANCED_FURNACE_9, SlimefunItems.HEATING_COIL, null, SlimefunItems.ELECTRIC_MOTOR, null}) + .register(plugin); + + new EnhancedFurnace(categories.basicMachines, 5, 5, 3, SlimefunItems.ENHANCED_FURNACE_11, + new ItemStack[] {null, SlimefunItems.STEEL_INGOT, null, SlimefunItems.BASIC_CIRCUIT_BOARD, SlimefunItems.ENHANCED_FURNACE_10, SlimefunItems.HEATING_COIL, null, SlimefunItems.ELECTRIC_MOTOR, null}) + .register(plugin); + + new EnhancedFurnace(categories.basicMachines, 10, 10, 3, SlimefunItems.REINFORCED_FURNACE, + new ItemStack[] {SlimefunItems.REINFORCED_ALLOY_INGOT, SlimefunItems.BASIC_CIRCUIT_BOARD, SlimefunItems.REINFORCED_ALLOY_INGOT, SlimefunItems.HEATING_COIL, SlimefunItems.ENHANCED_FURNACE_11, SlimefunItems.HEATING_COIL, SlimefunItems.REINFORCED_ALLOY_INGOT, SlimefunItems.ELECTRIC_MOTOR, SlimefunItems.REINFORCED_ALLOY_INGOT}) + .register(plugin); + + new EnhancedFurnace(categories.basicMachines, 20, 10, 3, SlimefunItems.CARBONADO_EDGED_FURNACE, + new ItemStack[] {SlimefunItems.CARBONADO, SlimefunItems.BASIC_CIRCUIT_BOARD, SlimefunItems.CARBONADO, SlimefunItems.HEATING_COIL, SlimefunItems.REINFORCED_FURNACE, SlimefunItems.HEATING_COIL, SlimefunItems.CARBONADO, SlimefunItems.ELECTRIC_MOTOR, SlimefunItems.CARBONADO}) + .register(plugin); + + new SlimefunItem(categories.technicalComponents, SlimefunItems.ELECTRO_MAGNET, RecipeType.ENHANCED_CRAFTING_TABLE, + new ItemStack[] {SlimefunItems.NICKEL_INGOT, SlimefunItems.MAGNET, SlimefunItems.COBALT_INGOT, null, SlimefunItems.BATTERY, null, null, null, null}) + .register(plugin); + + new SlimefunItem(categories.technicalComponents, SlimefunItems.ELECTRIC_MOTOR, RecipeType.ENHANCED_CRAFTING_TABLE, + new ItemStack[] {SlimefunItems.COPPER_WIRE, SlimefunItems.COPPER_WIRE, SlimefunItems.COPPER_WIRE, null, SlimefunItems.ELECTRO_MAGNET, null, SlimefunItems.COPPER_WIRE, SlimefunItems.COPPER_WIRE, SlimefunItems.COPPER_WIRE}) + .register(plugin); + + new SlimefunItem(categories.technicalComponents, SlimefunItems.HEATING_COIL, RecipeType.ENHANCED_CRAFTING_TABLE, + new ItemStack[] {SlimefunItems.COPPER_WIRE, SlimefunItems.COPPER_WIRE, SlimefunItems.COPPER_WIRE, SlimefunItems.COPPER_WIRE, SlimefunItems.ELECTRIC_MOTOR, SlimefunItems.COPPER_WIRE, SlimefunItems.COPPER_WIRE, SlimefunItems.COPPER_WIRE, SlimefunItems.COPPER_WIRE}) + .register(plugin); + + new SlimefunItem(categories.technicalComponents, SlimefunItems.COPPER_WIRE, RecipeType.ENHANCED_CRAFTING_TABLE, + new ItemStack[] {null, null, null, SlimefunItems.COPPER_INGOT, SlimefunItems.COPPER_INGOT, SlimefunItems.COPPER_INGOT, null, null, null}, + new SlimefunItemStack(SlimefunItems.COPPER_WIRE, 8)) + .register(plugin); + + new BlockPlacer(categories.basicMachines, SlimefunItems.BLOCK_PLACER, RecipeType.ENHANCED_CRAFTING_TABLE, + new ItemStack[] {SlimefunItems.GOLD_4K, new ItemStack(Material.PISTON), SlimefunItems.GOLD_4K, new ItemStack(Material.IRON_INGOT), SlimefunItems.ELECTRIC_MOTOR, new ItemStack(Material.IRON_INGOT), SlimefunItems.GOLD_4K, new ItemStack(Material.PISTON), SlimefunItems.GOLD_4K}) + .register(plugin); + + new TelepositionScroll(categories.magicalGadgets, SlimefunItems.SCROLL_OF_DIMENSIONAL_TELEPOSITION, RecipeType.MAGIC_WORKBENCH, + new ItemStack[] {null, SlimefunItems.ENDER_LUMP_3, SlimefunItems.MAGIC_EYE_OF_ENDER, SlimefunItems.ENDER_LUMP_3, SlimefunItems.MAGICAL_BOOK_COVER, SlimefunItems.ENDER_LUMP_3, SlimefunItems.MAGIC_EYE_OF_ENDER, SlimefunItems.ENDER_LUMP_3, null}) + .register(plugin); + + new ExplosiveBow(categories.weapons, SlimefunItems.EXPLOSIVE_BOW, + new ItemStack[] {null, new ItemStack(Material.STICK), new ItemStack(Material.GUNPOWDER), SlimefunItems.STAFF_FIRE, null, SlimefunItems.SULFATE, null, new ItemStack(Material.STICK), new ItemStack(Material.GUNPOWDER)}) + .register(plugin); + + new IcyBow(categories.weapons, SlimefunItems.ICY_BOW, + new ItemStack[] {null, new ItemStack(Material.STICK), new ItemStack(Material.ICE), SlimefunItems.STAFF_WATER, null, new ItemStack(Material.PACKED_ICE), null, new ItemStack(Material.STICK), new ItemStack(Material.ICE)}) + .register(plugin); + + new KnowledgeTome(categories.magicalGadgets, SlimefunItems.TOME_OF_KNOWLEDGE_SHARING, RecipeType.MAGIC_WORKBENCH, + new ItemStack[] {null, new ItemStack(Material.FEATHER), null, new ItemStack(Material.INK_SAC), SlimefunItems.MAGICAL_BOOK_COVER, new ItemStack(Material.GLASS_BOTTLE), null, new ItemStack(Material.WRITABLE_BOOK), null}) + .register(plugin); + + new KnowledgeFlask(categories.magicalGadgets, SlimefunItems.FLASK_OF_KNOWLEDGE, RecipeType.MAGIC_WORKBENCH, + new ItemStack[] {null, null, null, SlimefunItems.MAGIC_LUMP_2, new ItemStack(Material.GLASS_PANE), SlimefunItems.MAGIC_LUMP_2, null, SlimefunItems.MAGIC_LUMP_2, null}, + new SlimefunItemStack(SlimefunItems.FLASK_OF_KNOWLEDGE, 8)) + .register(plugin); + + new BirthdayCake(categories.birthday, new SlimefunItemStack("BIRTHDAY_CAKE", Material.CAKE, "&bBirthday Cake"), RecipeType.ENHANCED_CRAFTING_TABLE, + new ItemStack[] {null, new ItemStack(Material.TORCH), null, new ItemStack(Material.SUGAR), new ItemStack(Material.CAKE), new ItemStack(Material.SUGAR), null, null, null}) + .register(plugin); + + new Juice(categories.christmas, SlimefunItems.CHRISTMAS_MILK, RecipeType.ENHANCED_CRAFTING_TABLE, + new ItemStack[] {new ItemStack(Material.MILK_BUCKET), new ItemStack(Material.GLASS_BOTTLE), null, null, null, null, null, null, null}, + new SlimefunItemStack(SlimefunItems.CHRISTMAS_MILK, 4)) + .register(plugin); + + new Juice(categories.christmas, SlimefunItems.CHRISTMAS_CHOCOLATE_MILK, RecipeType.ENHANCED_CRAFTING_TABLE, + new ItemStack[] {SlimefunItems.CHRISTMAS_MILK, new ItemStack(Material.COCOA_BEANS), null, null, null, null, null, null, null}, + new SlimefunItemStack(SlimefunItems.CHRISTMAS_CHOCOLATE_MILK, 2)) + .register(plugin); + + new Juice(categories.christmas, SlimefunItems.CHRISTMAS_EGG_NOG, RecipeType.ENHANCED_CRAFTING_TABLE, + new ItemStack[] {SlimefunItems.CHRISTMAS_MILK, new ItemStack(Material.EGG), null, null, null, null, null, null, null}, + new SlimefunItemStack(SlimefunItems.CHRISTMAS_EGG_NOG, 2)) + .register(plugin); + + new Juice(categories.christmas, SlimefunItems.CHRISTMAS_APPLE_CIDER, RecipeType.ENHANCED_CRAFTING_TABLE, + new ItemStack[] {SlimefunItems.APPLE_JUICE, new ItemStack(Material.SUGAR), null, null, null, null, null, null, null}, + new SlimefunItemStack(SlimefunItems.CHRISTMAS_APPLE_CIDER, 2)) + .register(plugin); + + new SlimefunItem(categories.christmas, SlimefunItems.CHRISTMAS_COOKIE, RecipeType.ENHANCED_CRAFTING_TABLE, + new ItemStack[] {new ItemStack(Material.COOKIE), new ItemStack(Material.SUGAR), new ItemStack(Material.LIME_DYE), null, null, null, null, null, null}, + new SlimefunItemStack(SlimefunItems.CHRISTMAS_COOKIE, 16)) + .register(plugin); + + new SlimefunItem(categories.christmas, SlimefunItems.CHRISTMAS_FRUIT_CAKE, RecipeType.ENHANCED_CRAFTING_TABLE, + new ItemStack[] {new ItemStack(Material.EGG), new ItemStack(Material.APPLE), new ItemStack(Material.MELON), new ItemStack(Material.SUGAR), null, null, null, null, null}, + new SlimefunItemStack(SlimefunItems.CHRISTMAS_FRUIT_CAKE, 4)) + .register(plugin); + + new SlimefunItem(categories.christmas, SlimefunItems.CHRISTMAS_APPLE_PIE, RecipeType.ENHANCED_CRAFTING_TABLE, + new ItemStack[] {new ItemStack(Material.SUGAR), new ItemStack(Material.APPLE), new ItemStack(Material.EGG), null, null, null, null, null, null}, + new SlimefunItemStack(SlimefunItems.CHRISTMAS_APPLE_PIE, 2)) + .register(plugin); + + new Juice(categories.christmas, SlimefunItems.CHRISTMAS_HOT_CHOCOLATE, RecipeType.SMELTERY, + new ItemStack[] {SlimefunItems.CHRISTMAS_CHOCOLATE_MILK, null, null, null, null, null, null, null, null}, SlimefunItems.CHRISTMAS_HOT_CHOCOLATE) + .register(plugin); + + new SlimefunItem(categories.christmas, SlimefunItems.CHRISTMAS_CAKE, RecipeType.ENHANCED_CRAFTING_TABLE, + new ItemStack[] {new ItemStack(Material.EGG), new ItemStack(Material.SUGAR), SlimefunItems.WHEAT_FLOUR, new ItemStack(Material.MILK_BUCKET), null, null, null, null, null}, + new SlimefunItemStack(SlimefunItems.CHRISTMAS_CAKE, 4)) + .register(plugin); + + new SlimefunItem(categories.christmas, SlimefunItems.CHRISTMAS_CARAMEL, RecipeType.SMELTERY, + new ItemStack[] {new ItemStack(Material.SUGAR), new ItemStack(Material.SUGAR), null, null, null, null, null, null, null}, + new SlimefunItemStack(SlimefunItems.CHRISTMAS_CARAMEL, 4)) + .register(plugin); + + new SlimefunItem(categories.christmas, SlimefunItems.CHRISTMAS_CARAMEL_APPLE, RecipeType.ENHANCED_CRAFTING_TABLE, + new ItemStack[] {null, SlimefunItems.CHRISTMAS_CARAMEL, null, null, new ItemStack(Material.APPLE), null, null, new ItemStack(Material.STICK), null}, + new SlimefunItemStack(SlimefunItems.CHRISTMAS_CARAMEL_APPLE, 2)) + .register(plugin); + + new SlimefunItem(categories.christmas, SlimefunItems.CHRISTMAS_CHOCOLATE_APPLE, RecipeType.ENHANCED_CRAFTING_TABLE, + new ItemStack[] {null, new ItemStack(Material.COCOA_BEANS), null, null, new ItemStack(Material.APPLE), null, null, new ItemStack(Material.STICK), null}, + new SlimefunItemStack(SlimefunItems.CHRISTMAS_CHOCOLATE_APPLE, 2)) + .register(plugin); + + new ChristmasPresent(categories.christmas, SlimefunItems.CHRISTMAS_PRESENT, RecipeType.MAGIC_WORKBENCH, + new ItemStack[] {null, new ItemStack(Material.NAME_TAG), null, new ItemStack(Material.RED_WOOL), new ItemStack(Material.GREEN_WOOL), new ItemStack(Material.RED_WOOL), new ItemStack(Material.RED_WOOL), new ItemStack(Material.GREEN_WOOL), new ItemStack(Material.RED_WOOL)}, + new SlimefunItemStack(SlimefunItems.CHRISTMAS_HOT_CHOCOLATE, 1), + new SlimefunItemStack(SlimefunItems.CHRISTMAS_CHOCOLATE_APPLE, 4), + new SlimefunItemStack(SlimefunItems.CHRISTMAS_CARAMEL_APPLE, 4), + new SlimefunItemStack(SlimefunItems.CHRISTMAS_CAKE, 4), + new SlimefunItemStack(SlimefunItems.CHRISTMAS_COOKIE, 8), + new SlimefunItemStack(SlimefunItems.CHRISTMAS_PRESENT, 1), + new SlimefunItemStack(SlimefunItems.CHRISTMAS_EGG_NOG, 1), + new SlimefunItemStack(SlimefunItems.CHRISTMAS_MILK, 1), + new SlimefunItemStack(SlimefunItems.CHRISTMAS_APPLE_CIDER, 1), + new SlimefunItemStack(SlimefunItems.CHRISTMAS_FRUIT_CAKE, 4), new SlimefunItemStack(SlimefunItems.CHRISTMAS_APPLE_PIE, 4), new ItemStack(Material.EMERALD) - ).register(plugin); - - new SlimefunItem(categories.easter, SlimefunItems.EASTER_CARROT_PIE, RecipeType.ENHANCED_CRAFTING_TABLE, - new ItemStack[] {new ItemStack(Material.SUGAR), new ItemStack(Material.CARROT), new ItemStack(Material.EGG), null, null, null, null, null, null}, - new SlimefunItemStack(SlimefunItems.EASTER_CARROT_PIE, 2)) - .register(plugin); - - new SlimefunItem(categories.easter, SlimefunItems.EASTER_APPLE_PIE, RecipeType.ENHANCED_CRAFTING_TABLE, - new ItemStack[] {new ItemStack(Material.SUGAR), new ItemStack(Material.APPLE), new ItemStack(Material.EGG), null, null, null, null, null, null}, - new SlimefunItemStack(SlimefunItems.CHRISTMAS_APPLE_PIE, 2)) - .register(plugin); - - new EasterEgg(categories.easter, SlimefunItems.EASTER_EGG, RecipeType.ENHANCED_CRAFTING_TABLE, - new ItemStack[] {null, null, null, new ItemStack(Material.LIME_DYE), new ItemStack(Material.EGG), new ItemStack(Material.PURPLE_DYE), null, null, null}, - new SlimefunItemStack(SlimefunItems.EASTER_EGG, 2), - // Gifts: - new SlimefunItemStack(SlimefunItems.EASTER_CARROT_PIE, 4), - new SlimefunItemStack(SlimefunItems.CARROT_JUICE, 1), - new ItemStack(Material.EMERALD), - new ItemStack(Material.CAKE), - new ItemStack(Material.RABBIT_FOOT), - new ItemStack(Material.GOLDEN_CARROT, 4) - ).register(plugin); - - new SlimefunItem(categories.misc, SlimefunItems.REINFORCED_PLATE, RecipeType.COMPRESSOR, - new ItemStack[] {new SlimefunItemStack(SlimefunItems.REINFORCED_ALLOY_INGOT, 8), null, null, null, null, null, null, null, null}) - .register(plugin); - - new HardenedGlass(categories.technicalComponents, SlimefunItems.HARDENED_GLASS, RecipeType.ENHANCED_CRAFTING_TABLE, - new ItemStack[] {new ItemStack(Material.GLASS), new ItemStack(Material.GLASS), new ItemStack(Material.GLASS), new ItemStack(Material.GLASS), SlimefunItems.REINFORCED_PLATE, new ItemStack(Material.GLASS), new ItemStack(Material.GLASS), new ItemStack(Material.GLASS), new ItemStack(Material.GLASS)}, - new SlimefunItemStack(SlimefunItems.HARDENED_GLASS, 16)) - .register(plugin); - - new SlimefunItem(categories.technicalComponents, SlimefunItems.COOLING_UNIT, RecipeType.ENHANCED_CRAFTING_TABLE, - new ItemStack[] {new ItemStack(Material.ICE), new ItemStack(Material.ICE), new ItemStack(Material.ICE), SlimefunItems.ALUMINUM_INGOT, SlimefunItems.ELECTRIC_MOTOR, SlimefunItems.ALUMINUM_INGOT, new ItemStack(Material.ICE), new ItemStack(Material.ICE), new ItemStack(Material.ICE)}) - .register(plugin); - - new Cooler(27, categories.usefulItems, SlimefunItems.COOLER, RecipeType.ENHANCED_CRAFTING_TABLE, - new ItemStack[] {SlimefunItems.CLOTH, SlimefunItems.CLOTH, SlimefunItems.CLOTH, SlimefunItems.ALUMINUM_INGOT, SlimefunItems.COOLING_UNIT, SlimefunItems.ALUMINUM_INGOT, SlimefunItems.ALUMINUM_INGOT, SlimefunItems.ALUMINUM_INGOT, SlimefunItems.ALUMINUM_INGOT}) - .register(plugin); - - new WitherProofBlock(categories.technicalComponents, SlimefunItems.WITHER_PROOF_OBSIDIAN, RecipeType.ENHANCED_CRAFTING_TABLE, - new ItemStack[] {SlimefunItems.LEAD_INGOT, new ItemStack(Material.OBSIDIAN), SlimefunItems.LEAD_INGOT, new ItemStack(Material.OBSIDIAN), SlimefunItems.HARDENED_GLASS, new ItemStack(Material.OBSIDIAN), SlimefunItems.LEAD_INGOT, new ItemStack(Material.OBSIDIAN), SlimefunItems.LEAD_INGOT}, - new SlimefunItemStack(SlimefunItems.WITHER_PROOF_OBSIDIAN, 4)) - .register(plugin); - - new AncientPedestal(categories.magicalResources, SlimefunItems.ANCIENT_PEDESTAL, RecipeType.MAGIC_WORKBENCH, - new ItemStack[] {new ItemStack(Material.OBSIDIAN), SlimefunItems.GOLD_8K, new ItemStack(Material.OBSIDIAN), null, new ItemStack(Material.STONE), null, new ItemStack(Material.OBSIDIAN), SlimefunItems.GOLD_8K, new ItemStack(Material.OBSIDIAN)}, - new SlimefunItemStack(SlimefunItems.ANCIENT_PEDESTAL, 4)) - .register(plugin); - - new AncientAltar(categories.magicalGadgets, 8, SlimefunItems.ANCIENT_ALTAR, RecipeType.MAGIC_WORKBENCH, - new ItemStack[] {null, new ItemStack(Material.ENCHANTING_TABLE), null, SlimefunItems.MAGIC_LUMP_3, SlimefunItems.GOLD_8K, SlimefunItems.MAGIC_LUMP_3, new ItemStack(Material.OBSIDIAN), SlimefunItems.GOLD_8K, new ItemStack(Material.OBSIDIAN)}) - .register(plugin); - - new EnergyRegulator(categories.electricity, SlimefunItems.ENERGY_REGULATOR, RecipeType.ENHANCED_CRAFTING_TABLE, - new ItemStack[] {SlimefunItems.SILVER_INGOT, SlimefunItems.DAMASCUS_STEEL_INGOT, SlimefunItems.SILVER_INGOT, SlimefunItems.DAMASCUS_STEEL_INGOT, SlimefunItems.ELECTRIC_MOTOR, SlimefunItems.DAMASCUS_STEEL_INGOT, SlimefunItems.SILVER_INGOT, SlimefunItems.DAMASCUS_STEEL_INGOT, SlimefunItems.SILVER_INGOT}) - .register(plugin); - - new SlimefunItem(categories.misc, SlimefunItems.DUCT_TAPE, RecipeType.ENHANCED_CRAFTING_TABLE, - new ItemStack[] {SlimefunItems.ALUMINUM_DUST, SlimefunItems.ALUMINUM_DUST, SlimefunItems.ALUMINUM_DUST, new ItemStack(Material.SLIME_BALL), new ItemStack(Material.WHITE_WOOL), new ItemStack(Material.SLIME_BALL), new ItemStack(Material.PAPER), new ItemStack(Material.PAPER), new ItemStack(Material.PAPER)}, - new SlimefunItemStack(SlimefunItems.DUCT_TAPE, 2)) - .register(plugin); - - new Capacitor(categories.electricity, 128, SlimefunItems.SMALL_CAPACITOR, RecipeType.ENHANCED_CRAFTING_TABLE, - new ItemStack[] {SlimefunItems.DURALUMIN_INGOT, SlimefunItems.REDSTONE_ALLOY, SlimefunItems.DURALUMIN_INGOT, new ItemStack(Material.REDSTONE), SlimefunItems.SULFATE, new ItemStack(Material.REDSTONE), SlimefunItems.DURALUMIN_INGOT, SlimefunItems.REDSTONE_ALLOY, SlimefunItems.DURALUMIN_INGOT}) - .register(plugin); - - new Capacitor(categories.electricity, 512, SlimefunItems.MEDIUM_CAPACITOR, RecipeType.ENHANCED_CRAFTING_TABLE, - new ItemStack[] {SlimefunItems.BILLON_INGOT, SlimefunItems.REDSTONE_ALLOY, SlimefunItems.BILLON_INGOT, new ItemStack(Material.REDSTONE), SlimefunItems.SMALL_CAPACITOR, new ItemStack(Material.REDSTONE), SlimefunItems.BILLON_INGOT, SlimefunItems.REDSTONE_ALLOY, SlimefunItems.BILLON_INGOT}) - .register(plugin); - - new Capacitor(categories.electricity, 1024, SlimefunItems.BIG_CAPACITOR, RecipeType.ENHANCED_CRAFTING_TABLE, - new ItemStack[] {SlimefunItems.STEEL_INGOT, SlimefunItems.REDSTONE_ALLOY, SlimefunItems.STEEL_INGOT, new ItemStack(Material.REDSTONE), SlimefunItems.MEDIUM_CAPACITOR, new ItemStack(Material.REDSTONE), SlimefunItems.STEEL_INGOT, SlimefunItems.REDSTONE_ALLOY, SlimefunItems.STEEL_INGOT}) - .register(plugin); - - new Capacitor(categories.electricity, 8192, SlimefunItems.LARGE_CAPACITOR, RecipeType.ENHANCED_CRAFTING_TABLE, - new ItemStack[] {SlimefunItems.REINFORCED_ALLOY_INGOT, SlimefunItems.REDSTONE_ALLOY, SlimefunItems.REINFORCED_ALLOY_INGOT, new ItemStack(Material.REDSTONE), SlimefunItems.BIG_CAPACITOR, new ItemStack(Material.REDSTONE), SlimefunItems.REINFORCED_ALLOY_INGOT, SlimefunItems.REDSTONE_ALLOY, SlimefunItems.REINFORCED_ALLOY_INGOT}) - .register(plugin); - - new Capacitor(categories.electricity, 65536, SlimefunItems.CARBONADO_EDGED_CAPACITOR, RecipeType.ENHANCED_CRAFTING_TABLE, - new ItemStack[] {SlimefunItems.CARBONADO, SlimefunItems.REDSTONE_ALLOY, SlimefunItems.CARBONADO, new ItemStack(Material.REDSTONE), SlimefunItems.LARGE_CAPACITOR, new ItemStack(Material.REDSTONE), SlimefunItems.CARBONADO, SlimefunItems.REDSTONE_ALLOY, SlimefunItems.CARBONADO}) - .register(plugin); - - new SolarGenerator(categories.electricity, 2, 0, SlimefunItems.SOLAR_GENERATOR, RecipeType.ENHANCED_CRAFTING_TABLE, - new ItemStack[] {SlimefunItems.SOLAR_PANEL, SlimefunItems.SOLAR_PANEL, SlimefunItems.SOLAR_PANEL, SlimefunItems.ALUMINUM_INGOT, SlimefunItems.ELECTRIC_MOTOR, SlimefunItems.ALUMINUM_INGOT, null, SlimefunItems.ALUMINUM_INGOT, null}) - .register(plugin); - - new SolarGenerator(categories.electricity, 8, 0, SlimefunItems.SOLAR_GENERATOR_2, RecipeType.ENHANCED_CRAFTING_TABLE, - new ItemStack[] {SlimefunItems.SOLAR_GENERATOR, SlimefunItems.ALUMINUM_INGOT, SlimefunItems.SOLAR_GENERATOR, SlimefunItems.ALUMINUM_INGOT, new ItemStack(Material.REDSTONE), SlimefunItems.ALUMINUM_INGOT, SlimefunItems.SOLAR_GENERATOR, SlimefunItems.ALUMINUM_INGOT, SlimefunItems.SOLAR_GENERATOR}) - .register(plugin); - - new SolarGenerator(categories.electricity, 32, 0, SlimefunItems.SOLAR_GENERATOR_3, RecipeType.ENHANCED_CRAFTING_TABLE, - new ItemStack[] {SlimefunItems.SOLAR_GENERATOR_2, SlimefunItems.ALUMINUM_INGOT, SlimefunItems.SOLAR_GENERATOR_2, SlimefunItems.ALUMINUM_INGOT, SlimefunItems.CARBONADO, SlimefunItems.ALUMINUM_INGOT, SlimefunItems.SOLAR_GENERATOR_2, SlimefunItems.ALUMINUM_INGOT, SlimefunItems.SOLAR_GENERATOR_2}) - .register(plugin); - - new SolarGenerator(categories.electricity, 128, 64, SlimefunItems.SOLAR_GENERATOR_4, RecipeType.ENHANCED_CRAFTING_TABLE, - new ItemStack[] {SlimefunItems.SOLAR_GENERATOR_3, SlimefunItems.BLISTERING_INGOT_3, SlimefunItems.SOLAR_GENERATOR_3, SlimefunItems.BLISTERING_INGOT_3, SlimefunItems.ELECTRO_MAGNET, SlimefunItems.BLISTERING_INGOT_3, SlimefunItems.SOLAR_GENERATOR_3, SlimefunItems.BLISTERING_INGOT_3, SlimefunItems.SOLAR_GENERATOR_3}) - .register(plugin); - - new ChargingBench(categories.electricity, SlimefunItems.CHARGING_BENCH, RecipeType.ENHANCED_CRAFTING_TABLE, - new ItemStack[] {null, SlimefunItems.ELECTRO_MAGNET, null, SlimefunItems.BATTERY, new ItemStack(Material.CRAFTING_TABLE), SlimefunItems.BATTERY, null, SlimefunItems.SMALL_CAPACITOR, null}) - .register(plugin); - - new ElectricFurnace(categories.electricity, SlimefunItems.ELECTRIC_FURNACE, RecipeType.ENHANCED_CRAFTING_TABLE, - new ItemStack[] {null, new ItemStack(Material.FURNACE), null, SlimefunItems.GILDED_IRON, SlimefunItems.HEATING_COIL, SlimefunItems.GILDED_IRON, SlimefunItems.GILDED_IRON, SlimefunItems.ELECTRIC_MOTOR, SlimefunItems.GILDED_IRON}) { - - @Override - public int getEnergyConsumption() { - return 2; - } - - @Override - public int getCapacity() { - return 64; - } - - @Override - public int getSpeed() { - return 1; - } - - }.register(plugin); - - new ElectricFurnace(categories.electricity, SlimefunItems.ELECTRIC_FURNACE_2, RecipeType.ENHANCED_CRAFTING_TABLE, - new ItemStack[] {null, SlimefunItems.ELECTRIC_MOTOR, null, SlimefunItems.GILDED_IRON, SlimefunItems.ELECTRIC_FURNACE, SlimefunItems.GILDED_IRON, SlimefunItems.GILDED_IRON, SlimefunItems.HEATING_COIL, SlimefunItems.GILDED_IRON}) { - - @Override - public int getEnergyConsumption() { - return 3; - } - - @Override - public int getCapacity() { - return 128; - } - - @Override - public int getSpeed() { - return 2; - } - - }.register(plugin); - - new ElectricFurnace(categories.electricity, SlimefunItems.ELECTRIC_FURNACE_3, RecipeType.ENHANCED_CRAFTING_TABLE, - new ItemStack[] {null, SlimefunItems.ELECTRIC_MOTOR, null, SlimefunItems.STEEL_INGOT, SlimefunItems.ELECTRIC_FURNACE_2, SlimefunItems.STEEL_INGOT, SlimefunItems.GILDED_IRON, SlimefunItems.HEATING_COIL, SlimefunItems.GILDED_IRON}) { - - @Override - public int getEnergyConsumption() { - return 5; - } - - @Override - public int getCapacity() { - return 128; - } - - @Override - public int getSpeed() { - return 4; - } - - }.register(plugin); - - new ElectricGoldPan(categories.electricity, SlimefunItems.ELECTRIC_GOLD_PAN, RecipeType.ENHANCED_CRAFTING_TABLE, - new ItemStack[] {null, SlimefunItems.GOLD_PAN, null, new ItemStack(Material.FLINT), SlimefunItems.ELECTRIC_MOTOR, new ItemStack(Material.FLINT), SlimefunItems.ALUMINUM_INGOT, SlimefunItems.ALUMINUM_INGOT, SlimefunItems.ALUMINUM_INGOT}) { - - @Override - public int getEnergyConsumption() { - return 1; - } - - @Override - public int getCapacity() { - return 128; - } - - @Override - public int getSpeed() { - return 1; - } - - }.register(plugin); - - new ElectricGoldPan(categories.electricity, SlimefunItems.ELECTRIC_GOLD_PAN_2, RecipeType.ENHANCED_CRAFTING_TABLE, - new ItemStack[] {null, SlimefunItems.GOLD_PAN, null, new ItemStack(Material.IRON_INGOT), SlimefunItems.ELECTRIC_GOLD_PAN, new ItemStack(Material.IRON_INGOT), SlimefunItems.DURALUMIN_INGOT, SlimefunItems.DURALUMIN_INGOT, SlimefunItems.DURALUMIN_INGOT}) { - - @Override - public int getEnergyConsumption() { - return 2; - } - - @Override - public int getCapacity() { - return 128; - } - - @Override - public int getSpeed() { - return 3; - } - - }.register(plugin); - - new ElectricGoldPan(categories.electricity, SlimefunItems.ELECTRIC_GOLD_PAN_3, RecipeType.ENHANCED_CRAFTING_TABLE, - new ItemStack[] {null, SlimefunItems.GOLD_PAN, null, SlimefunItems.ELECTRIC_MOTOR, SlimefunItems.ELECTRIC_GOLD_PAN_2, SlimefunItems.ELECTRIC_MOTOR, SlimefunItems.COBALT_INGOT, SlimefunItems.BLISTERING_INGOT_3, SlimefunItems.COBALT_INGOT}) { - - @Override - public int getEnergyConsumption() { - return 7; - } - - @Override - public int getCapacity() { - return 512; - } - - @Override - public int getSpeed() { - return 10; - } - - }.register(plugin); - - new ElectricDustWasher(categories.electricity, SlimefunItems.ELECTRIC_DUST_WASHER, RecipeType.ENHANCED_CRAFTING_TABLE, - new ItemStack[] {null, new ItemStack(Material.WATER_BUCKET), null, SlimefunItems.ELECTRO_MAGNET, SlimefunItems.ELECTRIC_GOLD_PAN, SlimefunItems.ELECTRO_MAGNET, SlimefunItems.COPPER_INGOT, SlimefunItems.COPPER_INGOT, SlimefunItems.COPPER_INGOT}) { - - @Override - public int getEnergyConsumption() { - return 3; - } - - @Override - public int getCapacity() { - return 128; - } - - @Override - public int getSpeed() { - return 1; - } - - }.register(plugin); - - new ElectricDustWasher(categories.electricity, SlimefunItems.ELECTRIC_DUST_WASHER_2, RecipeType.ENHANCED_CRAFTING_TABLE, - new ItemStack[] {null, new ItemStack(Material.WATER_BUCKET), null, SlimefunItems.ELECTRO_MAGNET, SlimefunItems.ELECTRIC_DUST_WASHER, SlimefunItems.ELECTRO_MAGNET, SlimefunItems.DAMASCUS_STEEL_INGOT, SlimefunItems.DAMASCUS_STEEL_INGOT, SlimefunItems.DAMASCUS_STEEL_INGOT}) { - - @Override - public int getEnergyConsumption() { - return 5; - } - - @Override - public int getCapacity() { - return 128; - } - - @Override - public int getSpeed() { - return 2; - } - - }.register(plugin); - - new ElectricDustWasher(categories.electricity, SlimefunItems.ELECTRIC_DUST_WASHER_3, RecipeType.ENHANCED_CRAFTING_TABLE, - new ItemStack[] {null, new ItemStack(Material.WATER_BUCKET), null, SlimefunItems.ELECTRO_MAGNET, SlimefunItems.ELECTRIC_DUST_WASHER_2, SlimefunItems.ELECTRO_MAGNET, SlimefunItems.CORINTHIAN_BRONZE_INGOT, SlimefunItems.BLISTERING_INGOT_3, SlimefunItems.CORINTHIAN_BRONZE_INGOT}) { - - @Override - public int getEnergyConsumption() { - return 15; - } - - @Override - public int getCapacity() { - return 512; - } - - @Override - public int getSpeed() { - return 10; - } - - }.register(plugin); - - new ElectricIngotFactory(categories.electricity, SlimefunItems.ELECTRIC_INGOT_FACTORY, RecipeType.ENHANCED_CRAFTING_TABLE, - new ItemStack[] {null, new ItemStack(Material.FLINT_AND_STEEL), null, SlimefunItems.HEATING_COIL, SlimefunItems.ELECTRIC_DUST_WASHER, SlimefunItems.HEATING_COIL, SlimefunItems.DAMASCUS_STEEL_INGOT, SlimefunItems.ELECTRIC_MOTOR, SlimefunItems.DAMASCUS_STEEL_INGOT}) { - - @Override - public int getEnergyConsumption() { - return 4; - } - - @Override - public int getCapacity() { - return 256; - } - - @Override - public int getSpeed() { - return 1; - } - - }.register(plugin); - - new ElectricIngotFactory(categories.electricity, SlimefunItems.ELECTRIC_INGOT_FACTORY_2, RecipeType.ENHANCED_CRAFTING_TABLE, - new ItemStack[] {SlimefunItems.GILDED_IRON, new ItemStack(Material.FLINT_AND_STEEL), SlimefunItems.GILDED_IRON, SlimefunItems.HEATING_COIL, SlimefunItems.ELECTRIC_INGOT_FACTORY, SlimefunItems.HEATING_COIL, SlimefunItems.BRASS_INGOT, SlimefunItems.ELECTRIC_MOTOR, SlimefunItems.BRASS_INGOT}) { - - @Override - public int getEnergyConsumption() { - return 7; - } - - @Override - public int getCapacity() { - return 256; - } - - @Override - public int getSpeed() { - return 2; - } - - }.register(plugin); - - new ElectricIngotFactory(categories.electricity, SlimefunItems.ELECTRIC_INGOT_FACTORY_3, RecipeType.ENHANCED_CRAFTING_TABLE, - new ItemStack[] {SlimefunItems.GILDED_IRON, new ItemStack(Material.FLINT_AND_STEEL), SlimefunItems.GILDED_IRON, SlimefunItems.HEATING_COIL, SlimefunItems.ELECTRIC_INGOT_FACTORY_2, SlimefunItems.HEATING_COIL, SlimefunItems.BRASS_INGOT, SlimefunItems.BLISTERING_INGOT_3, SlimefunItems.BRASS_INGOT}) { - - @Override - public int getEnergyConsumption() { - return 20; - } - - @Override - public int getCapacity() { - return 512; - } - - @Override - public int getSpeed() { - return 8; - } - - }.register(plugin); - - new ElectrifiedCrucible(categories.electricity, SlimefunItems.ELECTRIFIED_CRUCIBLE, RecipeType.ENHANCED_CRAFTING_TABLE, - new ItemStack[] {SlimefunItems.LEAD_INGOT, SlimefunItems.CRUCIBLE, SlimefunItems.LEAD_INGOT, SlimefunItems.DAMASCUS_STEEL_INGOT, SlimefunItems.HEATING_COIL, SlimefunItems.DAMASCUS_STEEL_INGOT, SlimefunItems.LEAD_INGOT, SlimefunItems.LARGE_CAPACITOR, SlimefunItems.LEAD_INGOT}) { - - @Override - public int getEnergyConsumption() { - return 24; - } - - @Override - public int getCapacity() { - return 1024; - } - - @Override - public int getSpeed() { - return 1; - } - - }.register(plugin); - - new ElectrifiedCrucible(categories.electricity, SlimefunItems.ELECTRIFIED_CRUCIBLE_2, RecipeType.ENHANCED_CRAFTING_TABLE, - new ItemStack[] {SlimefunItems.CORINTHIAN_BRONZE_INGOT, SlimefunItems.ELECTRIFIED_CRUCIBLE, SlimefunItems.CORINTHIAN_BRONZE_INGOT, SlimefunItems.DAMASCUS_STEEL_INGOT, SlimefunItems.ELECTRIC_MOTOR, SlimefunItems.DAMASCUS_STEEL_INGOT, SlimefunItems.LEAD_INGOT, SlimefunItems.HEATING_COIL, SlimefunItems.LEAD_INGOT}) { - - @Override - public int getEnergyConsumption() { - return 40; - } - - @Override - public int getCapacity() { - return 1024; - } - - @Override - public int getSpeed() { - return 2; - } - - }.register(plugin); - - new ElectrifiedCrucible(categories.electricity, SlimefunItems.ELECTRIFIED_CRUCIBLE_3, RecipeType.ENHANCED_CRAFTING_TABLE, - new ItemStack[] {SlimefunItems.CORINTHIAN_BRONZE_INGOT, SlimefunItems.ELECTRIFIED_CRUCIBLE_2, SlimefunItems.CORINTHIAN_BRONZE_INGOT, SlimefunItems.STEEL_PLATE, SlimefunItems.POWER_CRYSTAL, SlimefunItems.STEEL_PLATE, SlimefunItems.LEAD_INGOT, SlimefunItems.LEAD_INGOT, SlimefunItems.LEAD_INGOT}) { - - @Override - public int getEnergyConsumption() { - return 60; - } - - @Override - public int getCapacity() { - return 1024; - } - - @Override - public int getSpeed() { - return 4; - } - - }.register(plugin); - - new ElectricOreGrinder(categories.electricity, SlimefunItems.ELECTRIC_ORE_GRINDER, RecipeType.ENHANCED_CRAFTING_TABLE, - new ItemStack[] {null, new ItemStack(Material.DIAMOND_PICKAXE), null, SlimefunItems.GILDED_IRON, SlimefunItems.HEATING_COIL, SlimefunItems.GILDED_IRON, SlimefunItems.GILDED_IRON, SlimefunItems.ELECTRIC_MOTOR, SlimefunItems.GILDED_IRON}) { - - @Override - public int getEnergyConsumption() { - return 6; - } - - @Override - public int getCapacity() { - return 128; - } - - @Override - public int getSpeed() { - return 1; - } - - }.register(plugin); - - new ElectricOreGrinder(categories.electricity, SlimefunItems.ELECTRIC_ORE_GRINDER_2, RecipeType.ENHANCED_CRAFTING_TABLE, - new ItemStack[] {null, new ItemStack(Material.DIAMOND_PICKAXE), null, SlimefunItems.HEATING_COIL, SlimefunItems.ELECTRIC_ORE_GRINDER, SlimefunItems.HEATING_COIL, SlimefunItems.GILDED_IRON, SlimefunItems.BLISTERING_INGOT_3, SlimefunItems.GILDED_IRON}) { - - @Override - public int getEnergyConsumption() { - return 15; - } - - @Override - public int getCapacity() { - return 512; - } - - @Override - public int getSpeed() { - return 4; - } - - }.register(plugin); - - new HeatedPressureChamber(categories.electricity, SlimefunItems.HEATED_PRESSURE_CHAMBER, RecipeType.ENHANCED_CRAFTING_TABLE, - new ItemStack[] {SlimefunItems.LEAD_INGOT, SlimefunItems.ELECTRIC_MOTOR, SlimefunItems.LEAD_INGOT, SlimefunItems.LEAD_INGOT, new ItemStack(Material.GLASS), SlimefunItems.LEAD_INGOT, SlimefunItems.LEAD_INGOT, SlimefunItems.HEATING_COIL, SlimefunItems.LEAD_INGOT}) { - - @Override - public int getEnergyConsumption() { - return 5; - } - - @Override - public int getCapacity() { - return 128; - } - - @Override - public int getSpeed() { - return 1; - } - - }.register(plugin); - - new HeatedPressureChamber(categories.electricity, SlimefunItems.HEATED_PRESSURE_CHAMBER_2, RecipeType.ENHANCED_CRAFTING_TABLE, - new ItemStack[] {SlimefunItems.LEAD_INGOT, SlimefunItems.ELECTRIC_MOTOR, SlimefunItems.LEAD_INGOT, SlimefunItems.LEAD_INGOT, SlimefunItems.HEATED_PRESSURE_CHAMBER, SlimefunItems.LEAD_INGOT, SlimefunItems.REINFORCED_ALLOY_INGOT, SlimefunItems.HEATING_COIL, SlimefunItems.REINFORCED_ALLOY_INGOT}) { - - @Override - public int getEnergyConsumption() { - return 22; - } - - @Override - public int getCapacity() { - return 256; - } - - @Override - public int getSpeed() { - return 5; - } - - }.register(plugin); - - new ElectricIngotPulverizer(categories.electricity, SlimefunItems.ELECTRIC_INGOT_PULVERIZER, RecipeType.ENHANCED_CRAFTING_TABLE, - new ItemStack[] {null, SlimefunItems.ELECTRIC_ORE_GRINDER, null, SlimefunItems.LEAD_INGOT, SlimefunItems.MEDIUM_CAPACITOR, SlimefunItems.LEAD_INGOT, SlimefunItems.LEAD_INGOT, SlimefunItems.HEATING_COIL, SlimefunItems.LEAD_INGOT}) - .register(plugin); - - new CoalGenerator(categories.electricity, SlimefunItems.COAL_GENERATOR, RecipeType.ENHANCED_CRAFTING_TABLE, - new ItemStack[] {SlimefunItems.HEATING_COIL, new ItemStack(Material.FURNACE), SlimefunItems.HEATING_COIL, SlimefunItems.NICKEL_INGOT, SlimefunItems.ELECTRIC_MOTOR, SlimefunItems.NICKEL_INGOT, null, SlimefunItems.NICKEL_INGOT, null}) { - - @Override - public int getEnergyProduction() { - return 8; - } - - @Override - public int getCapacity() { - return 64; - } - - }.register(plugin); - - new CoalGenerator(categories.electricity, SlimefunItems.COAL_GENERATOR_2, RecipeType.ENHANCED_CRAFTING_TABLE, - new ItemStack[] {new ItemStack(Material.MAGMA_BLOCK), SlimefunItems.HEATING_COIL, new ItemStack(Material.MAGMA_BLOCK), SlimefunItems.HARDENED_METAL_INGOT, SlimefunItems.COAL_GENERATOR, SlimefunItems.HARDENED_METAL_INGOT, null, SlimefunItems.ELECTRIC_MOTOR, null}) { - - @Override - public int getEnergyProduction() { - return 15; - } - - @Override - public int getCapacity() { - return 256; - } - - }.register(plugin); - - new BioGenerator(categories.electricity, SlimefunItems.BIO_REACTOR, RecipeType.ENHANCED_CRAFTING_TABLE, - new ItemStack[] {SlimefunItems.HEATING_COIL, SlimefunItems.COMPOSTER, SlimefunItems.HEATING_COIL, SlimefunItems.ALUMINUM_BRASS_INGOT, SlimefunItems.ELECTRIC_MOTOR, SlimefunItems.ALUMINUM_BRASS_INGOT, null, SlimefunItems.ALUMINUM_BRASS_INGOT, null}) { - - @Override - public int getEnergyProduction() { - return 4; - } - - @Override - public int getCapacity() { - return 128; - } - - }.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); - } - 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 SlimefunItem(categories.easter, SlimefunItems.EASTER_CARROT_PIE, RecipeType.ENHANCED_CRAFTING_TABLE, + new ItemStack[] {new ItemStack(Material.SUGAR), new ItemStack(Material.CARROT), new ItemStack(Material.EGG), null, null, null, null, null, null}, + new SlimefunItemStack(SlimefunItems.EASTER_CARROT_PIE, 2)) + .register(plugin); + + new SlimefunItem(categories.easter, SlimefunItems.EASTER_APPLE_PIE, RecipeType.ENHANCED_CRAFTING_TABLE, + new ItemStack[] {new ItemStack(Material.SUGAR), new ItemStack(Material.APPLE), new ItemStack(Material.EGG), null, null, null, null, null, null}, + new SlimefunItemStack(SlimefunItems.CHRISTMAS_APPLE_PIE, 2)) + .register(plugin); + + new EasterEgg(categories.easter, SlimefunItems.EASTER_EGG, RecipeType.ENHANCED_CRAFTING_TABLE, + new ItemStack[] {null, null, null, new ItemStack(Material.LIME_DYE), new ItemStack(Material.EGG), new ItemStack(Material.PURPLE_DYE), null, null, null}, + new SlimefunItemStack(SlimefunItems.EASTER_EGG, 2), + // Gifts: + new SlimefunItemStack(SlimefunItems.EASTER_CARROT_PIE, 4), + new SlimefunItemStack(SlimefunItems.CARROT_JUICE, 1), + new ItemStack(Material.EMERALD), + new ItemStack(Material.CAKE), + new ItemStack(Material.RABBIT_FOOT), + new ItemStack(Material.GOLDEN_CARROT, 4) + ).register(plugin); + + new SlimefunItem(categories.misc, SlimefunItems.REINFORCED_PLATE, RecipeType.COMPRESSOR, + new ItemStack[] {new SlimefunItemStack(SlimefunItems.REINFORCED_ALLOY_INGOT, 8), null, null, null, null, null, null, null, null}) + .register(plugin); + + new HardenedGlass(categories.technicalComponents, SlimefunItems.HARDENED_GLASS, RecipeType.ENHANCED_CRAFTING_TABLE, + new ItemStack[] {new ItemStack(Material.GLASS), new ItemStack(Material.GLASS), new ItemStack(Material.GLASS), new ItemStack(Material.GLASS), SlimefunItems.REINFORCED_PLATE, new ItemStack(Material.GLASS), new ItemStack(Material.GLASS), new ItemStack(Material.GLASS), new ItemStack(Material.GLASS)}, + new SlimefunItemStack(SlimefunItems.HARDENED_GLASS, 16)) + .register(plugin); + + new SlimefunItem(categories.technicalComponents, SlimefunItems.COOLING_UNIT, RecipeType.ENHANCED_CRAFTING_TABLE, + new ItemStack[] {new ItemStack(Material.ICE), new ItemStack(Material.ICE), new ItemStack(Material.ICE), SlimefunItems.ALUMINUM_INGOT, SlimefunItems.ELECTRIC_MOTOR, SlimefunItems.ALUMINUM_INGOT, new ItemStack(Material.ICE), new ItemStack(Material.ICE), new ItemStack(Material.ICE)}) + .register(plugin); + + new Cooler(27, categories.usefulItems, SlimefunItems.COOLER, RecipeType.ENHANCED_CRAFTING_TABLE, + new ItemStack[] {SlimefunItems.CLOTH, SlimefunItems.CLOTH, SlimefunItems.CLOTH, SlimefunItems.ALUMINUM_INGOT, SlimefunItems.COOLING_UNIT, SlimefunItems.ALUMINUM_INGOT, SlimefunItems.ALUMINUM_INGOT, SlimefunItems.ALUMINUM_INGOT, SlimefunItems.ALUMINUM_INGOT}) + .register(plugin); + + new WitherProofBlock(categories.technicalComponents, SlimefunItems.WITHER_PROOF_OBSIDIAN, RecipeType.ENHANCED_CRAFTING_TABLE, + new ItemStack[] {SlimefunItems.LEAD_INGOT, new ItemStack(Material.OBSIDIAN), SlimefunItems.LEAD_INGOT, new ItemStack(Material.OBSIDIAN), SlimefunItems.HARDENED_GLASS, new ItemStack(Material.OBSIDIAN), SlimefunItems.LEAD_INGOT, new ItemStack(Material.OBSIDIAN), SlimefunItems.LEAD_INGOT}, + new SlimefunItemStack(SlimefunItems.WITHER_PROOF_OBSIDIAN, 4)) + .register(plugin); + + new AncientPedestal(categories.magicalResources, SlimefunItems.ANCIENT_PEDESTAL, RecipeType.MAGIC_WORKBENCH, + new ItemStack[] {new ItemStack(Material.OBSIDIAN), SlimefunItems.GOLD_8K, new ItemStack(Material.OBSIDIAN), null, new ItemStack(Material.STONE), null, new ItemStack(Material.OBSIDIAN), SlimefunItems.GOLD_8K, new ItemStack(Material.OBSIDIAN)}, + new SlimefunItemStack(SlimefunItems.ANCIENT_PEDESTAL, 4)) + .register(plugin); + + new AncientAltar(categories.magicalGadgets, 8, SlimefunItems.ANCIENT_ALTAR, RecipeType.MAGIC_WORKBENCH, + new ItemStack[] {null, new ItemStack(Material.ENCHANTING_TABLE), null, SlimefunItems.MAGIC_LUMP_3, SlimefunItems.GOLD_8K, SlimefunItems.MAGIC_LUMP_3, new ItemStack(Material.OBSIDIAN), SlimefunItems.GOLD_8K, new ItemStack(Material.OBSIDIAN)}) + .register(plugin); + + new EnergyRegulator(categories.electricity, SlimefunItems.ENERGY_REGULATOR, RecipeType.ENHANCED_CRAFTING_TABLE, + new ItemStack[] {SlimefunItems.SILVER_INGOT, SlimefunItems.DAMASCUS_STEEL_INGOT, SlimefunItems.SILVER_INGOT, SlimefunItems.DAMASCUS_STEEL_INGOT, SlimefunItems.ELECTRIC_MOTOR, SlimefunItems.DAMASCUS_STEEL_INGOT, SlimefunItems.SILVER_INGOT, SlimefunItems.DAMASCUS_STEEL_INGOT, SlimefunItems.SILVER_INGOT}) + .register(plugin); + + new SlimefunItem(categories.misc, SlimefunItems.DUCT_TAPE, RecipeType.ENHANCED_CRAFTING_TABLE, + new ItemStack[] {SlimefunItems.ALUMINUM_DUST, SlimefunItems.ALUMINUM_DUST, SlimefunItems.ALUMINUM_DUST, new ItemStack(Material.SLIME_BALL), new ItemStack(Material.WHITE_WOOL), new ItemStack(Material.SLIME_BALL), new ItemStack(Material.PAPER), new ItemStack(Material.PAPER), new ItemStack(Material.PAPER)}, + new SlimefunItemStack(SlimefunItems.DUCT_TAPE, 2)) + .register(plugin); + + new Capacitor(categories.electricity, 128, SlimefunItems.SMALL_CAPACITOR, RecipeType.ENHANCED_CRAFTING_TABLE, + new ItemStack[] {SlimefunItems.DURALUMIN_INGOT, SlimefunItems.REDSTONE_ALLOY, SlimefunItems.DURALUMIN_INGOT, new ItemStack(Material.REDSTONE), SlimefunItems.SULFATE, new ItemStack(Material.REDSTONE), SlimefunItems.DURALUMIN_INGOT, SlimefunItems.REDSTONE_ALLOY, SlimefunItems.DURALUMIN_INGOT}) + .register(plugin); + + new Capacitor(categories.electricity, 512, SlimefunItems.MEDIUM_CAPACITOR, RecipeType.ENHANCED_CRAFTING_TABLE, + new ItemStack[] {SlimefunItems.BILLON_INGOT, SlimefunItems.REDSTONE_ALLOY, SlimefunItems.BILLON_INGOT, new ItemStack(Material.REDSTONE), SlimefunItems.SMALL_CAPACITOR, new ItemStack(Material.REDSTONE), SlimefunItems.BILLON_INGOT, SlimefunItems.REDSTONE_ALLOY, SlimefunItems.BILLON_INGOT}) + .register(plugin); + + new Capacitor(categories.electricity, 1024, SlimefunItems.BIG_CAPACITOR, RecipeType.ENHANCED_CRAFTING_TABLE, + new ItemStack[] {SlimefunItems.STEEL_INGOT, SlimefunItems.REDSTONE_ALLOY, SlimefunItems.STEEL_INGOT, new ItemStack(Material.REDSTONE), SlimefunItems.MEDIUM_CAPACITOR, new ItemStack(Material.REDSTONE), SlimefunItems.STEEL_INGOT, SlimefunItems.REDSTONE_ALLOY, SlimefunItems.STEEL_INGOT}) + .register(plugin); + + new Capacitor(categories.electricity, 8192, SlimefunItems.LARGE_CAPACITOR, RecipeType.ENHANCED_CRAFTING_TABLE, + new ItemStack[] {SlimefunItems.REINFORCED_ALLOY_INGOT, SlimefunItems.REDSTONE_ALLOY, SlimefunItems.REINFORCED_ALLOY_INGOT, new ItemStack(Material.REDSTONE), SlimefunItems.BIG_CAPACITOR, new ItemStack(Material.REDSTONE), SlimefunItems.REINFORCED_ALLOY_INGOT, SlimefunItems.REDSTONE_ALLOY, SlimefunItems.REINFORCED_ALLOY_INGOT}) + .register(plugin); + + new Capacitor(categories.electricity, 65536, SlimefunItems.CARBONADO_EDGED_CAPACITOR, RecipeType.ENHANCED_CRAFTING_TABLE, + new ItemStack[] {SlimefunItems.CARBONADO, SlimefunItems.REDSTONE_ALLOY, SlimefunItems.CARBONADO, new ItemStack(Material.REDSTONE), SlimefunItems.LARGE_CAPACITOR, new ItemStack(Material.REDSTONE), SlimefunItems.CARBONADO, SlimefunItems.REDSTONE_ALLOY, SlimefunItems.CARBONADO}) + .register(plugin); + + new SolarGenerator(categories.electricity, 2, 0, SlimefunItems.SOLAR_GENERATOR, RecipeType.ENHANCED_CRAFTING_TABLE, + new ItemStack[] {SlimefunItems.SOLAR_PANEL, SlimefunItems.SOLAR_PANEL, SlimefunItems.SOLAR_PANEL, SlimefunItems.ALUMINUM_INGOT, SlimefunItems.ELECTRIC_MOTOR, SlimefunItems.ALUMINUM_INGOT, null, SlimefunItems.ALUMINUM_INGOT, null}) + .register(plugin); + + new SolarGenerator(categories.electricity, 8, 0, SlimefunItems.SOLAR_GENERATOR_2, RecipeType.ENHANCED_CRAFTING_TABLE, + new ItemStack[] {SlimefunItems.SOLAR_GENERATOR, SlimefunItems.ALUMINUM_INGOT, SlimefunItems.SOLAR_GENERATOR, SlimefunItems.ALUMINUM_INGOT, new ItemStack(Material.REDSTONE), SlimefunItems.ALUMINUM_INGOT, SlimefunItems.SOLAR_GENERATOR, SlimefunItems.ALUMINUM_INGOT, SlimefunItems.SOLAR_GENERATOR}) + .register(plugin); + + new SolarGenerator(categories.electricity, 32, 0, SlimefunItems.SOLAR_GENERATOR_3, RecipeType.ENHANCED_CRAFTING_TABLE, + new ItemStack[] {SlimefunItems.SOLAR_GENERATOR_2, SlimefunItems.ALUMINUM_INGOT, SlimefunItems.SOLAR_GENERATOR_2, SlimefunItems.ALUMINUM_INGOT, SlimefunItems.CARBONADO, SlimefunItems.ALUMINUM_INGOT, SlimefunItems.SOLAR_GENERATOR_2, SlimefunItems.ALUMINUM_INGOT, SlimefunItems.SOLAR_GENERATOR_2}) + .register(plugin); + + new SolarGenerator(categories.electricity, 128, 64, SlimefunItems.SOLAR_GENERATOR_4, RecipeType.ENHANCED_CRAFTING_TABLE, + new ItemStack[] {SlimefunItems.SOLAR_GENERATOR_3, SlimefunItems.BLISTERING_INGOT_3, SlimefunItems.SOLAR_GENERATOR_3, SlimefunItems.BLISTERING_INGOT_3, SlimefunItems.ELECTRO_MAGNET, SlimefunItems.BLISTERING_INGOT_3, SlimefunItems.SOLAR_GENERATOR_3, SlimefunItems.BLISTERING_INGOT_3, SlimefunItems.SOLAR_GENERATOR_3}) + .register(plugin); + + new ChargingBench(categories.electricity, SlimefunItems.CHARGING_BENCH, RecipeType.ENHANCED_CRAFTING_TABLE, + new ItemStack[] {null, SlimefunItems.ELECTRO_MAGNET, null, SlimefunItems.BATTERY, new ItemStack(Material.CRAFTING_TABLE), SlimefunItems.BATTERY, null, SlimefunItems.SMALL_CAPACITOR, null}) + .register(plugin); + + new ElectricFurnace(categories.electricity, SlimefunItems.ELECTRIC_FURNACE, RecipeType.ENHANCED_CRAFTING_TABLE, + new ItemStack[] {null, new ItemStack(Material.FURNACE), null, SlimefunItems.GILDED_IRON, SlimefunItems.HEATING_COIL, SlimefunItems.GILDED_IRON, SlimefunItems.GILDED_IRON, SlimefunItems.ELECTRIC_MOTOR, SlimefunItems.GILDED_IRON}) { + + @Override + public int getEnergyConsumption() { + return 2; + } + + @Override + public int getCapacity() { + return 64; + } + + @Override + public int getSpeed() { + return 1; + } + + }.register(plugin); + + new ElectricFurnace(categories.electricity, SlimefunItems.ELECTRIC_FURNACE_2, RecipeType.ENHANCED_CRAFTING_TABLE, + new ItemStack[] {null, SlimefunItems.ELECTRIC_MOTOR, null, SlimefunItems.GILDED_IRON, SlimefunItems.ELECTRIC_FURNACE, SlimefunItems.GILDED_IRON, SlimefunItems.GILDED_IRON, SlimefunItems.HEATING_COIL, SlimefunItems.GILDED_IRON}) { + + @Override + public int getEnergyConsumption() { + return 3; + } + + @Override + public int getCapacity() { + return 128; + } + + @Override + public int getSpeed() { + return 2; + } + + }.register(plugin); + + new ElectricFurnace(categories.electricity, SlimefunItems.ELECTRIC_FURNACE_3, RecipeType.ENHANCED_CRAFTING_TABLE, + new ItemStack[] {null, SlimefunItems.ELECTRIC_MOTOR, null, SlimefunItems.STEEL_INGOT, SlimefunItems.ELECTRIC_FURNACE_2, SlimefunItems.STEEL_INGOT, SlimefunItems.GILDED_IRON, SlimefunItems.HEATING_COIL, SlimefunItems.GILDED_IRON}) { + + @Override + public int getEnergyConsumption() { + return 5; + } + + @Override + public int getCapacity() { + return 128; + } + + @Override + public int getSpeed() { + return 4; + } + + }.register(plugin); + + new ElectricGoldPan(categories.electricity, SlimefunItems.ELECTRIC_GOLD_PAN, RecipeType.ENHANCED_CRAFTING_TABLE, + new ItemStack[] {null, SlimefunItems.GOLD_PAN, null, new ItemStack(Material.FLINT), SlimefunItems.ELECTRIC_MOTOR, new ItemStack(Material.FLINT), SlimefunItems.ALUMINUM_INGOT, SlimefunItems.ALUMINUM_INGOT, SlimefunItems.ALUMINUM_INGOT}) { + + @Override + public int getEnergyConsumption() { + return 1; + } + + @Override + public int getCapacity() { + return 128; + } @Override public int getSpeed() { return 1; } - }.register(plugin); + }.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}) { + new ElectricGoldPan(categories.electricity, SlimefunItems.ELECTRIC_GOLD_PAN_2, RecipeType.ENHANCED_CRAFTING_TABLE, + new ItemStack[] {null, SlimefunItems.GOLD_PAN, null, new ItemStack(Material.IRON_INGOT), SlimefunItems.ELECTRIC_GOLD_PAN, new ItemStack(Material.IRON_INGOT), SlimefunItems.DURALUMIN_INGOT, SlimefunItems.DURALUMIN_INGOT, SlimefunItems.DURALUMIN_INGOT}) { - @Override - public int getEnergyConsumption() { - return 8; - } + @Override + public int getEnergyConsumption() { + return 2; + } - @Override - public int getCapacity() { - return 256; - } + @Override + public int getCapacity() { + return 128; + } - @Override - public int getSpeed() { - return 1; - } + @Override + public int getSpeed() { + return 3; + } + + }.register(plugin); - }.register(plugin); + new ElectricGoldPan(categories.electricity, SlimefunItems.ELECTRIC_GOLD_PAN_3, RecipeType.ENHANCED_CRAFTING_TABLE, + new ItemStack[] {null, SlimefunItems.GOLD_PAN, null, SlimefunItems.ELECTRIC_MOTOR, SlimefunItems.ELECTRIC_GOLD_PAN_2, SlimefunItems.ELECTRIC_MOTOR, SlimefunItems.COBALT_INGOT, SlimefunItems.BLISTERING_INGOT_3, SlimefunItems.COBALT_INGOT}) { - new ElectricPress(categories.electricity, SlimefunItems.ELECTRIC_PRESS_2, RecipeType.ENHANCED_CRAFTING_TABLE, - new ItemStack[] {new ItemStack(Material.STICKY_PISTON), SlimefunItems.ELECTRIC_PRESS, new ItemStack(Material.STICKY_PISTON), SlimefunItems.DAMASCUS_STEEL_INGOT, SlimefunItems.BIG_CAPACITOR, SlimefunItems.DAMASCUS_STEEL_INGOT, SlimefunItems.DAMASCUS_STEEL_INGOT, SlimefunItems.DAMASCUS_STEEL_INGOT, SlimefunItems.DAMASCUS_STEEL_INGOT}) { + @Override + public int getEnergyConsumption() { + return 7; + } - @Override - public int getEnergyConsumption() { - return 20; - } + @Override + public int getCapacity() { + return 512; + } - @Override - public int getCapacity() { - return 1024; - } + @Override + public int getSpeed() { + return 10; + } + + }.register(plugin); - @Override - public int getSpeed() { - return 3; - } + new ElectricDustWasher(categories.electricity, SlimefunItems.ELECTRIC_DUST_WASHER, RecipeType.ENHANCED_CRAFTING_TABLE, + new ItemStack[] {null, new ItemStack(Material.WATER_BUCKET), null, SlimefunItems.ELECTRO_MAGNET, SlimefunItems.ELECTRIC_GOLD_PAN, SlimefunItems.ELECTRO_MAGNET, SlimefunItems.COPPER_INGOT, SlimefunItems.COPPER_INGOT, SlimefunItems.COPPER_INGOT}) { - }.register(plugin); - - new SlimefunItem(categories.resources, SlimefunItems.MAGNESIUM_SALT, RecipeType.HEATED_PRESSURE_CHAMBER, - new ItemStack[] {SlimefunItems.MAGNESIUM_DUST, SlimefunItems.SALT, null, null, null, null, null, null, null}) - .register(plugin); - - new MagnesiumGenerator(categories.electricity, SlimefunItems.MAGNESIUM_GENERATOR, RecipeType.ENHANCED_CRAFTING_TABLE, - new ItemStack[] {null, SlimefunItems.ELECTRIC_MOTOR, null, SlimefunItems.COMPRESSED_CARBON, new ItemStack(Material.WATER_BUCKET), SlimefunItems.COMPRESSED_CARBON, SlimefunItems.DURALUMIN_INGOT, SlimefunItems.DURALUMIN_INGOT, SlimefunItems.DURALUMIN_INGOT}) { - - @Override - public int getEnergyProduction() { - return 18; - } + @Override + public int getEnergyConsumption() { + return 3; + } - @Override - public int getCapacity() { - return 128; - } + @Override + public int getCapacity() { + return 128; + } - }.register(plugin); + @Override + public int getSpeed() { + return 1; + } + + }.register(plugin); - new AutoEnchanter(categories.electricity, SlimefunItems.AUTO_ENCHANTER, RecipeType.ENHANCED_CRAFTING_TABLE, - new ItemStack[] {null, new ItemStack(Material.ENCHANTING_TABLE), null, SlimefunItems.CARBONADO, SlimefunItems.ELECTRIC_MOTOR, SlimefunItems.CARBONADO, SlimefunItems.WITHER_PROOF_OBSIDIAN, SlimefunItems.WITHER_PROOF_OBSIDIAN, SlimefunItems.WITHER_PROOF_OBSIDIAN}) - .register(plugin); + new ElectricDustWasher(categories.electricity, SlimefunItems.ELECTRIC_DUST_WASHER_2, RecipeType.ENHANCED_CRAFTING_TABLE, + new ItemStack[] {null, new ItemStack(Material.WATER_BUCKET), null, SlimefunItems.ELECTRO_MAGNET, SlimefunItems.ELECTRIC_DUST_WASHER, SlimefunItems.ELECTRO_MAGNET, SlimefunItems.DAMASCUS_STEEL_INGOT, SlimefunItems.DAMASCUS_STEEL_INGOT, SlimefunItems.DAMASCUS_STEEL_INGOT}) { - new AutoDisenchanter(categories.electricity, SlimefunItems.AUTO_DISENCHANTER, RecipeType.ENHANCED_CRAFTING_TABLE, - new ItemStack[] {new ItemStack(Material.REDSTONE), new ItemStack(Material.ANVIL), new ItemStack(Material.REDSTONE), SlimefunItems.CARBONADO, SlimefunItems.AUTO_ENCHANTER, SlimefunItems.CARBONADO, SlimefunItems.WITHER_PROOF_OBSIDIAN, SlimefunItems.WITHER_PROOF_OBSIDIAN, SlimefunItems.WITHER_PROOF_OBSIDIAN}) - .register(plugin); + @Override + public int getEnergyConsumption() { + return 5; + } - new AutoAnvil(categories.electricity, SlimefunItems.AUTO_ANVIL, RecipeType.ENHANCED_CRAFTING_TABLE, - new ItemStack[] {null, new ItemStack(Material.ANVIL), null, SlimefunItems.REINFORCED_ALLOY_INGOT, SlimefunItems.ELECTRIC_MOTOR, SlimefunItems.REINFORCED_ALLOY_INGOT, new ItemStack(Material.IRON_BLOCK), new ItemStack(Material.IRON_BLOCK), new ItemStack(Material.IRON_BLOCK)}) { + @Override + public int getCapacity() { + return 128; + } - @Override - public int getRepairFactor() { - return 10; - } + @Override + public int getSpeed() { + return 2; + } + + }.register(plugin); - @Override - public int getCapacity() { - return 128; - } + new ElectricDustWasher(categories.electricity, SlimefunItems.ELECTRIC_DUST_WASHER_3, RecipeType.ENHANCED_CRAFTING_TABLE, + new ItemStack[] {null, new ItemStack(Material.WATER_BUCKET), null, SlimefunItems.ELECTRO_MAGNET, SlimefunItems.ELECTRIC_DUST_WASHER_2, SlimefunItems.ELECTRO_MAGNET, SlimefunItems.CORINTHIAN_BRONZE_INGOT, SlimefunItems.BLISTERING_INGOT_3, SlimefunItems.CORINTHIAN_BRONZE_INGOT}) { - @Override - public int getEnergyConsumption() { - return 12; - } + @Override + public int getEnergyConsumption() { + return 15; + } - }.register(plugin); + @Override + public int getCapacity() { + return 512; + } - new AutoAnvil(categories.electricity, SlimefunItems.AUTO_ANVIL_2, RecipeType.ENHANCED_CRAFTING_TABLE, - new ItemStack[] {null, SlimefunItems.AUTO_ANVIL, null, SlimefunItems.STEEL_PLATE, SlimefunItems.HEATING_COIL, SlimefunItems.STEEL_PLATE, new ItemStack(Material.IRON_BLOCK), new ItemStack(Material.IRON_BLOCK), new ItemStack(Material.IRON_BLOCK)}) { + @Override + public int getSpeed() { + return 10; + } + + }.register(plugin); - @Override - public int getRepairFactor() { - return 4; - } + new ElectricIngotFactory(categories.electricity, SlimefunItems.ELECTRIC_INGOT_FACTORY, RecipeType.ENHANCED_CRAFTING_TABLE, + new ItemStack[] {null, new ItemStack(Material.FLINT_AND_STEEL), null, SlimefunItems.HEATING_COIL, SlimefunItems.ELECTRIC_DUST_WASHER, SlimefunItems.HEATING_COIL, SlimefunItems.DAMASCUS_STEEL_INGOT, SlimefunItems.ELECTRIC_MOTOR, SlimefunItems.DAMASCUS_STEEL_INGOT}) { + + @Override + public int getEnergyConsumption() { + return 4; + } - @Override - public int getCapacity() { - return 256; - } + @Override + public int getCapacity() { + return 256; + } - @Override - public int getEnergyConsumption() { - return 16; - } + @Override + public int getSpeed() { + return 1; + } - }.register(plugin); + }.register(plugin); - new Multimeter(categories.technicalGadgets, SlimefunItems.MULTIMETER, RecipeType.ENHANCED_CRAFTING_TABLE, - new ItemStack[] {SlimefunItems.COPPER_INGOT, null, SlimefunItems.COPPER_INGOT, null, SlimefunItems.REDSTONE_ALLOY, null, null, SlimefunItems.GOLD_6K, null}) - .register(plugin); + new ElectricIngotFactory(categories.electricity, SlimefunItems.ELECTRIC_INGOT_FACTORY_2, RecipeType.ENHANCED_CRAFTING_TABLE, + new ItemStack[] {SlimefunItems.GILDED_IRON, new ItemStack(Material.FLINT_AND_STEEL), SlimefunItems.GILDED_IRON, SlimefunItems.HEATING_COIL, SlimefunItems.ELECTRIC_INGOT_FACTORY, SlimefunItems.HEATING_COIL, SlimefunItems.BRASS_INGOT, SlimefunItems.ELECTRIC_MOTOR, SlimefunItems.BRASS_INGOT}) { - new SlimefunItem(categories.technicalComponents, SlimefunItems.PLASTIC_SHEET, RecipeType.HEATED_PRESSURE_CHAMBER, - new ItemStack[] {null, null, null, null, SlimefunItems.OIL_BUCKET, null, null, null, null}, - new SlimefunItemStack(SlimefunItems.PLASTIC_SHEET, 8)) - .register(plugin); + @Override + public int getEnergyConsumption() { + return 7; + } - new UnplaceableBlock(categories.technicalComponents, SlimefunItems.ANDROID_MEMORY_CORE, RecipeType.ENHANCED_CRAFTING_TABLE, - new ItemStack[] {SlimefunItems.BRASS_INGOT, new ItemStack(Material.ORANGE_STAINED_GLASS), SlimefunItems.BRASS_INGOT, SlimefunItems.POWER_CRYSTAL, SlimefunItems.TIN_DUST, SlimefunItems.POWER_CRYSTAL, SlimefunItems.BRASS_INGOT, new ItemStack(Material.ORANGE_STAINED_GLASS), SlimefunItems.BRASS_INGOT}) - .register(plugin); + @Override + public int getCapacity() { + return 256; + } - new GPSTransmitter(categories.gps, SlimefunItems.GPS_TRANSMITTER, RecipeType.ENHANCED_CRAFTING_TABLE, - new ItemStack[] {null, null, SlimefunItems.ELECTRO_MAGNET, SlimefunItems.STEEL_INGOT, SlimefunItems.ADVANCED_CIRCUIT_BOARD, SlimefunItems.STEEL_INGOT, SlimefunItems.STEEL_INGOT, SlimefunItems.ELECTRIC_MOTOR, SlimefunItems.STEEL_INGOT}) { - - @Override - public int getMultiplier(int y) { - return y; - } + @Override + public int getSpeed() { + return 2; + } - @Override - public int getCapacity() { - return 16; - } + }.register(plugin); - @Override - public int getEnergyConsumption() { - return 1; - } + new ElectricIngotFactory(categories.electricity, SlimefunItems.ELECTRIC_INGOT_FACTORY_3, RecipeType.ENHANCED_CRAFTING_TABLE, + new ItemStack[] {SlimefunItems.GILDED_IRON, new ItemStack(Material.FLINT_AND_STEEL), SlimefunItems.GILDED_IRON, SlimefunItems.HEATING_COIL, SlimefunItems.ELECTRIC_INGOT_FACTORY_2, SlimefunItems.HEATING_COIL, SlimefunItems.BRASS_INGOT, SlimefunItems.BLISTERING_INGOT_3, SlimefunItems.BRASS_INGOT}) { - }.register(plugin); + @Override + public int getEnergyConsumption() { + return 20; + } - new GPSTransmitter(categories.gps, SlimefunItems.GPS_TRANSMITTER_2, RecipeType.ENHANCED_CRAFTING_TABLE, - new ItemStack[] {SlimefunItems.GPS_TRANSMITTER, SlimefunItems.BRONZE_INGOT, SlimefunItems.GPS_TRANSMITTER, SlimefunItems.BRONZE_INGOT, SlimefunItems.CARBON, SlimefunItems.BRONZE_INGOT, SlimefunItems.GPS_TRANSMITTER, SlimefunItems.BRONZE_INGOT, SlimefunItems.GPS_TRANSMITTER}) { - - @Override - public int getMultiplier(int y) { - return y * 4 + 100; - } + @Override + public int getCapacity() { + return 512; + } - @Override - public int getCapacity() { - return 64; - } + @Override + public int getSpeed() { + return 8; + } - @Override - public int getEnergyConsumption() { - return 3; - } + }.register(plugin); - }.register(plugin); + new ElectrifiedCrucible(categories.electricity, SlimefunItems.ELECTRIFIED_CRUCIBLE, RecipeType.ENHANCED_CRAFTING_TABLE, + new ItemStack[] {SlimefunItems.LEAD_INGOT, SlimefunItems.CRUCIBLE, SlimefunItems.LEAD_INGOT, SlimefunItems.DAMASCUS_STEEL_INGOT, SlimefunItems.HEATING_COIL, SlimefunItems.DAMASCUS_STEEL_INGOT, SlimefunItems.LEAD_INGOT, SlimefunItems.LARGE_CAPACITOR, SlimefunItems.LEAD_INGOT}) { - new GPSTransmitter(categories.gps, SlimefunItems.GPS_TRANSMITTER_3, RecipeType.ENHANCED_CRAFTING_TABLE, - new ItemStack[] {SlimefunItems.GPS_TRANSMITTER_2, SlimefunItems.CORINTHIAN_BRONZE_INGOT, SlimefunItems.GPS_TRANSMITTER_2, SlimefunItems.CORINTHIAN_BRONZE_INGOT, SlimefunItems.CARBONADO, SlimefunItems.CORINTHIAN_BRONZE_INGOT, SlimefunItems.GPS_TRANSMITTER_2, SlimefunItems.CORINTHIAN_BRONZE_INGOT, SlimefunItems.GPS_TRANSMITTER_2}) { - - @Override - public int getMultiplier(int y) { - return y * 16 + 500; - } + @Override + public int getEnergyConsumption() { + return 24; + } - @Override - public int getCapacity() { - return 256; - } + @Override + public int getCapacity() { + return 1024; + } - @Override - public int getEnergyConsumption() { - return 11; - } + @Override + public int getSpeed() { + return 1; + } - }.register(plugin); + }.register(plugin); - new GPSTransmitter(categories.gps, SlimefunItems.GPS_TRANSMITTER_4, RecipeType.ENHANCED_CRAFTING_TABLE, - new ItemStack[] {SlimefunItems.GPS_TRANSMITTER_3, SlimefunItems.BLISTERING_INGOT_3, SlimefunItems.GPS_TRANSMITTER_3, SlimefunItems.NICKEL_INGOT, SlimefunItems.CARBONADO, SlimefunItems.NICKEL_INGOT, SlimefunItems.GPS_TRANSMITTER_3, SlimefunItems.BLISTERING_INGOT_3, SlimefunItems.GPS_TRANSMITTER_3}) { - - @Override - public int getMultiplier(int y) { - return y * 64 + 600; - } + new ElectrifiedCrucible(categories.electricity, SlimefunItems.ELECTRIFIED_CRUCIBLE_2, RecipeType.ENHANCED_CRAFTING_TABLE, + new ItemStack[] {SlimefunItems.CORINTHIAN_BRONZE_INGOT, SlimefunItems.ELECTRIFIED_CRUCIBLE, SlimefunItems.CORINTHIAN_BRONZE_INGOT, SlimefunItems.DAMASCUS_STEEL_INGOT, SlimefunItems.ELECTRIC_MOTOR, SlimefunItems.DAMASCUS_STEEL_INGOT, SlimefunItems.LEAD_INGOT, SlimefunItems.HEATING_COIL, SlimefunItems.LEAD_INGOT}) { - @Override - public int getCapacity() { - return 1024; - } + @Override + public int getEnergyConsumption() { + return 40; + } - @Override - public int getEnergyConsumption() { - return 46; - } - - }.register(plugin); + @Override + public int getCapacity() { + return 1024; + } - new GPSControlPanel(categories.gps, SlimefunItems.GPS_CONTROL_PANEL, RecipeType.ENHANCED_CRAFTING_TABLE, - new ItemStack[] {null, null, SlimefunItems.ELECTRO_MAGNET, SlimefunItems.COBALT_INGOT, SlimefunItems.ADVANCED_CIRCUIT_BOARD, SlimefunItems.COBALT_INGOT, SlimefunItems.ALUMINUM_BRASS_INGOT, SlimefunItems.ALUMINUM_BRASS_INGOT, SlimefunItems.ALUMINUM_BRASS_INGOT}) - .register(plugin); + @Override + public int getSpeed() { + return 2; + } - new GPSMarkerTool(categories.gps, SlimefunItems.GPS_MARKER_TOOL, RecipeType.ENHANCED_CRAFTING_TABLE, - new ItemStack[] {null, SlimefunItems.ELECTRO_MAGNET, null, new ItemStack(Material.LAPIS_LAZULI), SlimefunItems.BASIC_CIRCUIT_BOARD, new ItemStack(Material.LAPIS_LAZULI), new ItemStack(Material.REDSTONE), SlimefunItems.REDSTONE_ALLOY, new ItemStack(Material.REDSTONE)}) - .register(plugin); + }.register(plugin); - new SlimefunItem(categories.gps, SlimefunItems.GPS_EMERGENCY_TRANSMITTER, RecipeType.ENHANCED_CRAFTING_TABLE, - new ItemStack[] {null, SlimefunItems.ELECTRO_MAGNET, null, null, SlimefunItems.GPS_TRANSMITTER, null, null, SlimefunItems.ESSENCE_OF_AFTERLIFE, null}) - .register(plugin); + new ElectrifiedCrucible(categories.electricity, SlimefunItems.ELECTRIFIED_CRUCIBLE_3, RecipeType.ENHANCED_CRAFTING_TABLE, + new ItemStack[] {SlimefunItems.CORINTHIAN_BRONZE_INGOT, SlimefunItems.ELECTRIFIED_CRUCIBLE_2, SlimefunItems.CORINTHIAN_BRONZE_INGOT, SlimefunItems.STEEL_PLATE, SlimefunItems.POWER_CRYSTAL, SlimefunItems.STEEL_PLATE, SlimefunItems.LEAD_INGOT, SlimefunItems.LEAD_INGOT, SlimefunItems.LEAD_INGOT}) { + + @Override + public int getEnergyConsumption() { + return 60; + } + + @Override + public int getCapacity() { + return 1024; + } + + @Override + public int getSpeed() { + return 4; + } + + }.register(plugin); + + new ElectricOreGrinder(categories.electricity, SlimefunItems.ELECTRIC_ORE_GRINDER, RecipeType.ENHANCED_CRAFTING_TABLE, + new ItemStack[] {null, new ItemStack(Material.DIAMOND_PICKAXE), null, SlimefunItems.GILDED_IRON, SlimefunItems.HEATING_COIL, SlimefunItems.GILDED_IRON, SlimefunItems.GILDED_IRON, SlimefunItems.ELECTRIC_MOTOR, SlimefunItems.GILDED_IRON}) { + + @Override + public int getEnergyConsumption() { + return 6; + } + + @Override + public int getCapacity() { + return 128; + } + + @Override + public int getSpeed() { + return 1; + } + + }.register(plugin); + + new ElectricOreGrinder(categories.electricity, SlimefunItems.ELECTRIC_ORE_GRINDER_2, RecipeType.ENHANCED_CRAFTING_TABLE, + new ItemStack[] {null, new ItemStack(Material.DIAMOND_PICKAXE), null, SlimefunItems.HEATING_COIL, SlimefunItems.ELECTRIC_ORE_GRINDER, SlimefunItems.HEATING_COIL, SlimefunItems.GILDED_IRON, SlimefunItems.BLISTERING_INGOT_3, SlimefunItems.GILDED_IRON}) { + + @Override + public int getEnergyConsumption() { + return 15; + } + + @Override + public int getCapacity() { + return 512; + } + + @Override + public int getSpeed() { + return 4; + } + + }.register(plugin); + + new HeatedPressureChamber(categories.electricity, SlimefunItems.HEATED_PRESSURE_CHAMBER, RecipeType.ENHANCED_CRAFTING_TABLE, + new ItemStack[] {SlimefunItems.LEAD_INGOT, SlimefunItems.ELECTRIC_MOTOR, SlimefunItems.LEAD_INGOT, SlimefunItems.LEAD_INGOT, new ItemStack(Material.GLASS), SlimefunItems.LEAD_INGOT, SlimefunItems.LEAD_INGOT, SlimefunItems.HEATING_COIL, SlimefunItems.LEAD_INGOT}) { + + @Override + public int getEnergyConsumption() { + return 5; + } + + @Override + public int getCapacity() { + return 128; + } + + @Override + public int getSpeed() { + return 1; + } + + }.register(plugin); + + new HeatedPressureChamber(categories.electricity, SlimefunItems.HEATED_PRESSURE_CHAMBER_2, RecipeType.ENHANCED_CRAFTING_TABLE, + new ItemStack[] {SlimefunItems.LEAD_INGOT, SlimefunItems.ELECTRIC_MOTOR, SlimefunItems.LEAD_INGOT, SlimefunItems.LEAD_INGOT, SlimefunItems.HEATED_PRESSURE_CHAMBER, SlimefunItems.LEAD_INGOT, SlimefunItems.REINFORCED_ALLOY_INGOT, SlimefunItems.HEATING_COIL, SlimefunItems.REINFORCED_ALLOY_INGOT}) { + + @Override + public int getEnergyConsumption() { + return 22; + } + + @Override + public int getCapacity() { + return 256; + } + + @Override + public int getSpeed() { + return 5; + } + + }.register(plugin); + + new ElectricIngotPulverizer(categories.electricity, SlimefunItems.ELECTRIC_INGOT_PULVERIZER, RecipeType.ENHANCED_CRAFTING_TABLE, + new ItemStack[] {null, SlimefunItems.ELECTRIC_ORE_GRINDER, null, SlimefunItems.LEAD_INGOT, SlimefunItems.MEDIUM_CAPACITOR, SlimefunItems.LEAD_INGOT, SlimefunItems.LEAD_INGOT, SlimefunItems.HEATING_COIL, SlimefunItems.LEAD_INGOT}) + .register(plugin); + + new CoalGenerator(categories.electricity, SlimefunItems.COAL_GENERATOR, RecipeType.ENHANCED_CRAFTING_TABLE, + new ItemStack[] {SlimefunItems.HEATING_COIL, new ItemStack(Material.FURNACE), SlimefunItems.HEATING_COIL, SlimefunItems.NICKEL_INGOT, SlimefunItems.ELECTRIC_MOTOR, SlimefunItems.NICKEL_INGOT, null, SlimefunItems.NICKEL_INGOT, null}) { + + @Override + public int getEnergyProduction() { + return 8; + } + + @Override + public int getCapacity() { + return 64; + } + + }.register(plugin); + + new CoalGenerator(categories.electricity, SlimefunItems.COAL_GENERATOR_2, RecipeType.ENHANCED_CRAFTING_TABLE, + new ItemStack[] {new ItemStack(Material.MAGMA_BLOCK), SlimefunItems.HEATING_COIL, new ItemStack(Material.MAGMA_BLOCK), SlimefunItems.HARDENED_METAL_INGOT, SlimefunItems.COAL_GENERATOR, SlimefunItems.HARDENED_METAL_INGOT, null, SlimefunItems.ELECTRIC_MOTOR, null}) { + + @Override + public int getEnergyProduction() { + return 15; + } + + @Override + public int getCapacity() { + return 256; + } + + }.register(plugin); + + new BioGenerator(categories.electricity, SlimefunItems.BIO_REACTOR, RecipeType.ENHANCED_CRAFTING_TABLE, + new ItemStack[] {SlimefunItems.HEATING_COIL, SlimefunItems.COMPOSTER, SlimefunItems.HEATING_COIL, SlimefunItems.ALUMINUM_BRASS_INGOT, SlimefunItems.ELECTRIC_MOTOR, SlimefunItems.ALUMINUM_BRASS_INGOT, null, SlimefunItems.ALUMINUM_BRASS_INGOT, null}) { + + @Override + public int getEnergyProduction() { + return 4; + } + + @Override + public int getCapacity() { + return 128; + } + + }.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); + } + 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}) { + + @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}) { + + @Override + public int getEnergyConsumption() { + return 8; + } + + @Override + public int getCapacity() { + return 256; + } + + @Override + public int getSpeed() { + return 1; + } + + }.register(plugin); + + new ElectricPress(categories.electricity, SlimefunItems.ELECTRIC_PRESS_2, RecipeType.ENHANCED_CRAFTING_TABLE, + new ItemStack[] {new ItemStack(Material.STICKY_PISTON), SlimefunItems.ELECTRIC_PRESS, new ItemStack(Material.STICKY_PISTON), SlimefunItems.DAMASCUS_STEEL_INGOT, SlimefunItems.BIG_CAPACITOR, SlimefunItems.DAMASCUS_STEEL_INGOT, SlimefunItems.DAMASCUS_STEEL_INGOT, SlimefunItems.DAMASCUS_STEEL_INGOT, SlimefunItems.DAMASCUS_STEEL_INGOT}) { + + @Override + public int getEnergyConsumption() { + return 20; + } + + @Override + public int getCapacity() { + return 1024; + } + + @Override + public int getSpeed() { + return 3; + } + + }.register(plugin); + + new SlimefunItem(categories.resources, SlimefunItems.MAGNESIUM_SALT, RecipeType.HEATED_PRESSURE_CHAMBER, + new ItemStack[] {SlimefunItems.MAGNESIUM_DUST, SlimefunItems.SALT, null, null, null, null, null, null, null}) + .register(plugin); + + new MagnesiumGenerator(categories.electricity, SlimefunItems.MAGNESIUM_GENERATOR, RecipeType.ENHANCED_CRAFTING_TABLE, + new ItemStack[] {null, SlimefunItems.ELECTRIC_MOTOR, null, SlimefunItems.COMPRESSED_CARBON, new ItemStack(Material.WATER_BUCKET), SlimefunItems.COMPRESSED_CARBON, SlimefunItems.DURALUMIN_INGOT, SlimefunItems.DURALUMIN_INGOT, SlimefunItems.DURALUMIN_INGOT}) { + + @Override + public int getEnergyProduction() { + return 18; + } + + @Override + public int getCapacity() { + return 128; + } + + }.register(plugin); + + new AutoEnchanter(categories.electricity, SlimefunItems.AUTO_ENCHANTER, RecipeType.ENHANCED_CRAFTING_TABLE, + new ItemStack[] {null, new ItemStack(Material.ENCHANTING_TABLE), null, SlimefunItems.CARBONADO, SlimefunItems.ELECTRIC_MOTOR, SlimefunItems.CARBONADO, SlimefunItems.WITHER_PROOF_OBSIDIAN, SlimefunItems.WITHER_PROOF_OBSIDIAN, SlimefunItems.WITHER_PROOF_OBSIDIAN}) + .register(plugin); + + new AutoDisenchanter(categories.electricity, SlimefunItems.AUTO_DISENCHANTER, RecipeType.ENHANCED_CRAFTING_TABLE, + new ItemStack[] {new ItemStack(Material.REDSTONE), new ItemStack(Material.ANVIL), new ItemStack(Material.REDSTONE), SlimefunItems.CARBONADO, SlimefunItems.AUTO_ENCHANTER, SlimefunItems.CARBONADO, SlimefunItems.WITHER_PROOF_OBSIDIAN, SlimefunItems.WITHER_PROOF_OBSIDIAN, SlimefunItems.WITHER_PROOF_OBSIDIAN}) + .register(plugin); + + new AutoAnvil(categories.electricity, SlimefunItems.AUTO_ANVIL, RecipeType.ENHANCED_CRAFTING_TABLE, + new ItemStack[] {null, new ItemStack(Material.ANVIL), null, SlimefunItems.REINFORCED_ALLOY_INGOT, SlimefunItems.ELECTRIC_MOTOR, SlimefunItems.REINFORCED_ALLOY_INGOT, new ItemStack(Material.IRON_BLOCK), new ItemStack(Material.IRON_BLOCK), new ItemStack(Material.IRON_BLOCK)}) { + + @Override + public int getRepairFactor() { + return 10; + } + + @Override + public int getCapacity() { + return 128; + } + + @Override + public int getEnergyConsumption() { + return 12; + } + + }.register(plugin); + + new AutoAnvil(categories.electricity, SlimefunItems.AUTO_ANVIL_2, RecipeType.ENHANCED_CRAFTING_TABLE, + new ItemStack[] {null, SlimefunItems.AUTO_ANVIL, null, SlimefunItems.STEEL_PLATE, SlimefunItems.HEATING_COIL, SlimefunItems.STEEL_PLATE, new ItemStack(Material.IRON_BLOCK), new ItemStack(Material.IRON_BLOCK), new ItemStack(Material.IRON_BLOCK)}) { + + @Override + public int getRepairFactor() { + return 4; + } + + @Override + public int getCapacity() { + return 256; + } + + @Override + public int getEnergyConsumption() { + return 16; + } + + }.register(plugin); + + new Multimeter(categories.technicalGadgets, SlimefunItems.MULTIMETER, RecipeType.ENHANCED_CRAFTING_TABLE, + new ItemStack[] {SlimefunItems.COPPER_INGOT, null, SlimefunItems.COPPER_INGOT, null, SlimefunItems.REDSTONE_ALLOY, null, null, SlimefunItems.GOLD_6K, null}) + .register(plugin); + + new SlimefunItem(categories.technicalComponents, SlimefunItems.PLASTIC_SHEET, RecipeType.HEATED_PRESSURE_CHAMBER, + new ItemStack[] {null, null, null, null, SlimefunItems.OIL_BUCKET, null, null, null, null}, + new SlimefunItemStack(SlimefunItems.PLASTIC_SHEET, 8)) + .register(plugin); + + new UnplaceableBlock(categories.technicalComponents, SlimefunItems.ANDROID_MEMORY_CORE, RecipeType.ENHANCED_CRAFTING_TABLE, + new ItemStack[] {SlimefunItems.BRASS_INGOT, new ItemStack(Material.ORANGE_STAINED_GLASS), SlimefunItems.BRASS_INGOT, SlimefunItems.POWER_CRYSTAL, SlimefunItems.TIN_DUST, SlimefunItems.POWER_CRYSTAL, SlimefunItems.BRASS_INGOT, new ItemStack(Material.ORANGE_STAINED_GLASS), SlimefunItems.BRASS_INGOT}) + .register(plugin); + + new GPSTransmitter(categories.gps, SlimefunItems.GPS_TRANSMITTER, RecipeType.ENHANCED_CRAFTING_TABLE, + new ItemStack[] {null, null, SlimefunItems.ELECTRO_MAGNET, SlimefunItems.STEEL_INGOT, SlimefunItems.ADVANCED_CIRCUIT_BOARD, SlimefunItems.STEEL_INGOT, SlimefunItems.STEEL_INGOT, SlimefunItems.ELECTRIC_MOTOR, SlimefunItems.STEEL_INGOT}) { + + @Override + public int getMultiplier(int y) { + return y; + } + + @Override + public int getCapacity() { + return 16; + } + + @Override + public int getEnergyConsumption() { + return 1; + } + + }.register(plugin); + + new GPSTransmitter(categories.gps, SlimefunItems.GPS_TRANSMITTER_2, RecipeType.ENHANCED_CRAFTING_TABLE, + new ItemStack[] {SlimefunItems.GPS_TRANSMITTER, SlimefunItems.BRONZE_INGOT, SlimefunItems.GPS_TRANSMITTER, SlimefunItems.BRONZE_INGOT, SlimefunItems.CARBON, SlimefunItems.BRONZE_INGOT, SlimefunItems.GPS_TRANSMITTER, SlimefunItems.BRONZE_INGOT, SlimefunItems.GPS_TRANSMITTER}) { + + @Override + public int getMultiplier(int y) { + return y * 4 + 100; + } + + @Override + public int getCapacity() { + return 64; + } + + @Override + public int getEnergyConsumption() { + return 3; + } + + }.register(plugin); + + new GPSTransmitter(categories.gps, SlimefunItems.GPS_TRANSMITTER_3, RecipeType.ENHANCED_CRAFTING_TABLE, + new ItemStack[] {SlimefunItems.GPS_TRANSMITTER_2, SlimefunItems.CORINTHIAN_BRONZE_INGOT, SlimefunItems.GPS_TRANSMITTER_2, SlimefunItems.CORINTHIAN_BRONZE_INGOT, SlimefunItems.CARBONADO, SlimefunItems.CORINTHIAN_BRONZE_INGOT, SlimefunItems.GPS_TRANSMITTER_2, SlimefunItems.CORINTHIAN_BRONZE_INGOT, SlimefunItems.GPS_TRANSMITTER_2}) { + + @Override + public int getMultiplier(int y) { + return y * 16 + 500; + } + + @Override + public int getCapacity() { + return 256; + } + + @Override + public int getEnergyConsumption() { + return 11; + } + + }.register(plugin); + + new GPSTransmitter(categories.gps, SlimefunItems.GPS_TRANSMITTER_4, RecipeType.ENHANCED_CRAFTING_TABLE, + new ItemStack[] {SlimefunItems.GPS_TRANSMITTER_3, SlimefunItems.BLISTERING_INGOT_3, SlimefunItems.GPS_TRANSMITTER_3, SlimefunItems.NICKEL_INGOT, SlimefunItems.CARBONADO, SlimefunItems.NICKEL_INGOT, SlimefunItems.GPS_TRANSMITTER_3, SlimefunItems.BLISTERING_INGOT_3, SlimefunItems.GPS_TRANSMITTER_3}) { + + @Override + public int getMultiplier(int y) { + return y * 64 + 600; + } + + @Override + public int getCapacity() { + return 1024; + } + + @Override + public int getEnergyConsumption() { + return 46; + } + + }.register(plugin); + + new GPSControlPanel(categories.gps, SlimefunItems.GPS_CONTROL_PANEL, RecipeType.ENHANCED_CRAFTING_TABLE, + new ItemStack[] {null, null, SlimefunItems.ELECTRO_MAGNET, SlimefunItems.COBALT_INGOT, SlimefunItems.ADVANCED_CIRCUIT_BOARD, SlimefunItems.COBALT_INGOT, SlimefunItems.ALUMINUM_BRASS_INGOT, SlimefunItems.ALUMINUM_BRASS_INGOT, SlimefunItems.ALUMINUM_BRASS_INGOT}) + .register(plugin); + + new GPSMarkerTool(categories.gps, SlimefunItems.GPS_MARKER_TOOL, RecipeType.ENHANCED_CRAFTING_TABLE, + new ItemStack[] {null, SlimefunItems.ELECTRO_MAGNET, null, new ItemStack(Material.LAPIS_LAZULI), SlimefunItems.BASIC_CIRCUIT_BOARD, new ItemStack(Material.LAPIS_LAZULI), new ItemStack(Material.REDSTONE), SlimefunItems.REDSTONE_ALLOY, new ItemStack(Material.REDSTONE)}) + .register(plugin); + + new SlimefunItem(categories.gps, SlimefunItems.GPS_EMERGENCY_TRANSMITTER, RecipeType.ENHANCED_CRAFTING_TABLE, + new ItemStack[] {null, SlimefunItems.ELECTRO_MAGNET, null, null, SlimefunItems.GPS_TRANSMITTER, null, null, SlimefunItems.ESSENCE_OF_AFTERLIFE, null}) + .register(plugin); new SlimefunItem(categories.androids, SlimefunItems.ANDROID_INTERFACE_ITEMS, RecipeType.ENHANCED_CRAFTING_TABLE, new ItemStack[] {SlimefunItems.PLASTIC_SHEET, SlimefunItems.STEEL_INGOT, SlimefunItems.PLASTIC_SHEET, SlimefunItems.STEEL_INGOT, SlimefunItems.BASIC_CIRCUIT_BOARD, new ItemStack(Material.BLUE_STAINED_GLASS), SlimefunItems.PLASTIC_SHEET, SlimefunItems.STEEL_INGOT, SlimefunItems.PLASTIC_SHEET}) @@ -2197,1034 +2197,1034 @@ public final class SlimefunItemSetup { new ItemStack[] {SlimefunItems.PLASTIC_SHEET, SlimefunItems.STEEL_INGOT, SlimefunItems.PLASTIC_SHEET, new ItemStack(Material.RED_STAINED_GLASS), SlimefunItems.BASIC_CIRCUIT_BOARD, SlimefunItems.STEEL_INGOT, SlimefunItems.PLASTIC_SHEET, SlimefunItems.STEEL_INGOT, SlimefunItems.PLASTIC_SHEET}) .register(plugin); - new ProgrammableAndroid(categories.androids, SlimefunItems.PROGRAMMABLE_ANDROID, RecipeType.ENHANCED_CRAFTING_TABLE, - new ItemStack[] {SlimefunItems.PLASTIC_SHEET, SlimefunItems.ANDROID_MEMORY_CORE, SlimefunItems.PLASTIC_SHEET, SlimefunItems.COAL_GENERATOR, SlimefunItems.ELECTRIC_MOTOR, new ItemStack(Material.CHEST), SlimefunItems.PLASTIC_SHEET, SlimefunItems.PLASTIC_SHEET, SlimefunItems.PLASTIC_SHEET}) { + new ProgrammableAndroid(categories.androids, SlimefunItems.PROGRAMMABLE_ANDROID, RecipeType.ENHANCED_CRAFTING_TABLE, + new ItemStack[] {SlimefunItems.PLASTIC_SHEET, SlimefunItems.ANDROID_MEMORY_CORE, SlimefunItems.PLASTIC_SHEET, SlimefunItems.COAL_GENERATOR, SlimefunItems.ELECTRIC_MOTOR, new ItemStack(Material.CHEST), SlimefunItems.PLASTIC_SHEET, SlimefunItems.PLASTIC_SHEET, SlimefunItems.PLASTIC_SHEET}) { - @Override - public float getFuelEfficiency() { - return 1; - } - - @Override - public int getTier() { - return 1; - } + @Override + public float getFuelEfficiency() { + return 1; + } + + @Override + public int getTier() { + return 1; + } - } - .register(plugin); + } + .register(plugin); - new MinerAndroid(categories.androids, SlimefunItems.PROGRAMMABLE_ANDROID_MINER, RecipeType.ENHANCED_CRAFTING_TABLE, - new ItemStack[] {null, null, null, new ItemStack(Material.DIAMOND_PICKAXE), SlimefunItems.PROGRAMMABLE_ANDROID, new ItemStack(Material.DIAMOND_PICKAXE), null, SlimefunItems.ELECTRIC_MOTOR, null}) { + new MinerAndroid(categories.androids, SlimefunItems.PROGRAMMABLE_ANDROID_MINER, RecipeType.ENHANCED_CRAFTING_TABLE, + new ItemStack[] {null, null, null, new ItemStack(Material.DIAMOND_PICKAXE), SlimefunItems.PROGRAMMABLE_ANDROID, new ItemStack(Material.DIAMOND_PICKAXE), null, SlimefunItems.ELECTRIC_MOTOR, null}) { - @Override - public float getFuelEfficiency() { - return 1; - } - - @Override - public int getTier() { - return 1; - } + @Override + public float getFuelEfficiency() { + return 1; + } + + @Override + public int getTier() { + return 1; + } - } - .register(plugin); + } + .register(plugin); - new FarmerAndroid(categories.androids, SlimefunItems.PROGRAMMABLE_ANDROID_FARMER, RecipeType.ENHANCED_CRAFTING_TABLE, - new ItemStack[] {null, null, null, new ItemStack(Material.DIAMOND_HOE), SlimefunItems.PROGRAMMABLE_ANDROID, new ItemStack(Material.DIAMOND_HOE), null, SlimefunItems.ELECTRIC_MOTOR, null}) { + new FarmerAndroid(categories.androids, SlimefunItems.PROGRAMMABLE_ANDROID_FARMER, RecipeType.ENHANCED_CRAFTING_TABLE, + new ItemStack[] {null, null, null, new ItemStack(Material.DIAMOND_HOE), SlimefunItems.PROGRAMMABLE_ANDROID, new ItemStack(Material.DIAMOND_HOE), null, SlimefunItems.ELECTRIC_MOTOR, null}) { - @Override - public float getFuelEfficiency() { - return 1; - } - - @Override - public int getTier() { - return 1; - } + @Override + public float getFuelEfficiency() { + return 1; + } + + @Override + public int getTier() { + return 1; + } - } - .register(plugin); + } + .register(plugin); - new WoodcutterAndroid(categories.androids, SlimefunItems.PROGRAMMABLE_ANDROID_WOODCUTTER, RecipeType.ENHANCED_CRAFTING_TABLE, - new ItemStack[] {null, null, null, new ItemStack(Material.DIAMOND_AXE), SlimefunItems.PROGRAMMABLE_ANDROID, new ItemStack(Material.DIAMOND_AXE), null, SlimefunItems.ELECTRIC_MOTOR, null}) { + new WoodcutterAndroid(categories.androids, SlimefunItems.PROGRAMMABLE_ANDROID_WOODCUTTER, RecipeType.ENHANCED_CRAFTING_TABLE, + new ItemStack[] {null, null, null, new ItemStack(Material.DIAMOND_AXE), SlimefunItems.PROGRAMMABLE_ANDROID, new ItemStack(Material.DIAMOND_AXE), null, SlimefunItems.ELECTRIC_MOTOR, null}) { - @Override - public float getFuelEfficiency() { - return 1; - } - - @Override - public int getTier() { - return 1; - } + @Override + public float getFuelEfficiency() { + return 1; + } + + @Override + public int getTier() { + return 1; + } - } - .register(plugin); + } + .register(plugin); - new FisherAndroid(categories.androids, SlimefunItems.PROGRAMMABLE_ANDROID_FISHERMAN, RecipeType.ENHANCED_CRAFTING_TABLE, - new ItemStack[] {null, null, null, new ItemStack(Material.FISHING_ROD), SlimefunItems.PROGRAMMABLE_ANDROID, new ItemStack(Material.FISHING_ROD), null, SlimefunItems.ELECTRIC_MOTOR, null}) { + new FisherAndroid(categories.androids, SlimefunItems.PROGRAMMABLE_ANDROID_FISHERMAN, RecipeType.ENHANCED_CRAFTING_TABLE, + new ItemStack[] {null, null, null, new ItemStack(Material.FISHING_ROD), SlimefunItems.PROGRAMMABLE_ANDROID, new ItemStack(Material.FISHING_ROD), null, SlimefunItems.ELECTRIC_MOTOR, null}) { - @Override - public float getFuelEfficiency() { - return 1; - } - - @Override - public int getTier() { - return 1; - } + @Override + public float getFuelEfficiency() { + return 1; + } + + @Override + public int getTier() { + return 1; + } - } - .register(plugin); + } + .register(plugin); - new ButcherAndroid(categories.androids, SlimefunItems.PROGRAMMABLE_ANDROID_BUTCHER, RecipeType.ENHANCED_CRAFTING_TABLE, - new ItemStack[] {null, SlimefunItems.GPS_TRANSMITTER, null, new ItemStack(Material.DIAMOND_SWORD), SlimefunItems.PROGRAMMABLE_ANDROID, new ItemStack(Material.DIAMOND_SWORD), null, SlimefunItems.ELECTRIC_MOTOR, null}) { + new ButcherAndroid(categories.androids, SlimefunItems.PROGRAMMABLE_ANDROID_BUTCHER, RecipeType.ENHANCED_CRAFTING_TABLE, + new ItemStack[] {null, SlimefunItems.GPS_TRANSMITTER, null, new ItemStack(Material.DIAMOND_SWORD), SlimefunItems.PROGRAMMABLE_ANDROID, new ItemStack(Material.DIAMOND_SWORD), null, SlimefunItems.ELECTRIC_MOTOR, null}) { - @Override - public float getFuelEfficiency() { - return 1; - } - - @Override - public int getTier() { - return 1; - } + @Override + public float getFuelEfficiency() { + return 1; + } + + @Override + public int getTier() { + return 1; + } - } - .register(plugin); + } + .register(plugin); - new ProgrammableAndroid(categories.androids, SlimefunItems.PROGRAMMABLE_ANDROID_2, RecipeType.ENHANCED_CRAFTING_TABLE, - new ItemStack[] {SlimefunItems.PLASTIC_SHEET, SlimefunItems.ANDROID_MEMORY_CORE, SlimefunItems.PLASTIC_SHEET, SlimefunItems.COMBUSTION_REACTOR, SlimefunItems.PROGRAMMABLE_ANDROID, new ItemStack(Material.CHEST), SlimefunItems.PLASTIC_SHEET, SlimefunItems.POWER_CRYSTAL, SlimefunItems.PLASTIC_SHEET}) { + new ProgrammableAndroid(categories.androids, SlimefunItems.PROGRAMMABLE_ANDROID_2, RecipeType.ENHANCED_CRAFTING_TABLE, + new ItemStack[] {SlimefunItems.PLASTIC_SHEET, SlimefunItems.ANDROID_MEMORY_CORE, SlimefunItems.PLASTIC_SHEET, SlimefunItems.COMBUSTION_REACTOR, SlimefunItems.PROGRAMMABLE_ANDROID, new ItemStack(Material.CHEST), SlimefunItems.PLASTIC_SHEET, SlimefunItems.POWER_CRYSTAL, SlimefunItems.PLASTIC_SHEET}) { - @Override - public float getFuelEfficiency() { - return 1.5F; - } - - @Override - public int getTier() { - return 2; - } + @Override + public float getFuelEfficiency() { + return 1.5F; + } + + @Override + public int getTier() { + return 2; + } - } - .register(plugin); + } + .register(plugin); - new FisherAndroid(categories.androids, SlimefunItems.PROGRAMMABLE_ANDROID_2_FISHERMAN, RecipeType.ENHANCED_CRAFTING_TABLE, - new ItemStack[] {null, null, null, new ItemStack(Material.FISHING_ROD), SlimefunItems.PROGRAMMABLE_ANDROID_2, new ItemStack(Material.FISHING_ROD), null, SlimefunItems.ELECTRIC_MOTOR, null}) { + new FisherAndroid(categories.androids, SlimefunItems.PROGRAMMABLE_ANDROID_2_FISHERMAN, RecipeType.ENHANCED_CRAFTING_TABLE, + new ItemStack[] {null, null, null, new ItemStack(Material.FISHING_ROD), SlimefunItems.PROGRAMMABLE_ANDROID_2, new ItemStack(Material.FISHING_ROD), null, SlimefunItems.ELECTRIC_MOTOR, null}) { - @Override - public float getFuelEfficiency() { - return 1.5F; - } - - @Override - public int getTier() { - return 2; - } - - } - .register(plugin); + @Override + public float getFuelEfficiency() { + return 1.5F; + } + + @Override + public int getTier() { + return 2; + } + + } + .register(plugin); - new ButcherAndroid(categories.androids, SlimefunItems.PROGRAMMABLE_ANDROID_2_BUTCHER, RecipeType.ENHANCED_CRAFTING_TABLE, - new ItemStack[] {null, SlimefunItems.GPS_TRANSMITTER, null, new ItemStack(Material.DIAMOND_SWORD), SlimefunItems.PROGRAMMABLE_ANDROID_2, new ItemStack(Material.DIAMOND_SWORD), null, SlimefunItems.ELECTRIC_MOTOR, null}) { - - @Override - public float getFuelEfficiency() { - return 1.5F; - } - - @Override - public int getTier() { - return 2; - } - - } - .register(plugin); - - new AdvancedFarmerAndroid(categories.androids, SlimefunItems.PROGRAMMABLE_ANDROID_2_FARMER, RecipeType.ENHANCED_CRAFTING_TABLE, - new ItemStack[] {null, SlimefunItems.GPS_TRANSMITTER, null, new ItemStack(Material.DIAMOND_HOE), SlimefunItems.PROGRAMMABLE_ANDROID_2, new ItemStack(Material.DIAMOND_HOE), null, SlimefunItems.ELECTRIC_MOTOR, null}) { - - @Override - public float getFuelEfficiency() { - return 1.5F; - } - - @Override - public int getTier() { - return 2; - } - - } - .register(plugin); - - new ProgrammableAndroid(categories.androids, SlimefunItems.PROGRAMMABLE_ANDROID_3, RecipeType.ENHANCED_CRAFTING_TABLE, - new ItemStack[] {SlimefunItems.PLASTIC_SHEET, SlimefunItems.ANDROID_MEMORY_CORE, SlimefunItems.PLASTIC_SHEET, SlimefunItems.NUCLEAR_REACTOR, SlimefunItems.PROGRAMMABLE_ANDROID_2, new ItemStack(Material.CHEST), SlimefunItems.BLISTERING_INGOT_3, SlimefunItems.POWER_CRYSTAL, SlimefunItems.BLISTERING_INGOT_3}) { - - @Override - public float getFuelEfficiency() { - return 1F; - } - - @Override - public int getTier() { - return 3; - } - - } - .register(plugin); - - new FisherAndroid(categories.androids, SlimefunItems.PROGRAMMABLE_ANDROID_3_FISHERMAN, RecipeType.ENHANCED_CRAFTING_TABLE, - new ItemStack[] {null, null, null, new ItemStack(Material.FISHING_ROD), SlimefunItems.PROGRAMMABLE_ANDROID_3, new ItemStack(Material.FISHING_ROD), null, SlimefunItems.ELECTRIC_MOTOR, null}) { - - @Override - public float getFuelEfficiency() { - return 1F; - } - - @Override - public int getTier() { - return 3; - } - - } - .register(plugin); - - new ButcherAndroid(categories.androids, SlimefunItems.PROGRAMMABLE_ANDROID_3_BUTCHER, RecipeType.ENHANCED_CRAFTING_TABLE, - new ItemStack[] {null, SlimefunItems.GPS_TRANSMITTER_3, null, new ItemStack(Material.DIAMOND_SWORD), SlimefunItems.PROGRAMMABLE_ANDROID_3, new ItemStack(Material.DIAMOND_SWORD), null, SlimefunItems.ELECTRIC_MOTOR, null}) { - - @Override - public float getFuelEfficiency() { - return 1F; - } - - @Override - public int getTier() { - return 3; - } - - } - .register(plugin); - - new SlimefunItem(categories.magicalResources, SlimefunItems.BLANK_RUNE, RecipeType.ANCIENT_ALTAR, - new ItemStack[] {new ItemStack(Material.STONE), SlimefunItems.MAGIC_LUMP_1, new ItemStack(Material.STONE), SlimefunItems.MAGIC_LUMP_1, new ItemStack(Material.OBSIDIAN), SlimefunItems.MAGIC_LUMP_1, new ItemStack(Material.STONE), SlimefunItems.MAGIC_LUMP_1, new ItemStack(Material.STONE)}) - .register(plugin); - - new SlimefunItem(categories.magicalResources, SlimefunItems.AIR_RUNE, RecipeType.ANCIENT_ALTAR, - new ItemStack[] {new ItemStack(Material.FEATHER), SlimefunItems.MAGIC_LUMP_1, new ItemStack(Material.FEATHER), new ItemStack(Material.GHAST_TEAR), SlimefunItems.BLANK_RUNE, new ItemStack(Material.GHAST_TEAR), new ItemStack(Material.FEATHER), SlimefunItems.MAGIC_LUMP_1, new ItemStack(Material.FEATHER)}, - new SlimefunItemStack(SlimefunItems.AIR_RUNE, 4)) - .register(plugin); - - new SlimefunItem(categories.magicalResources, SlimefunItems.EARTH_RUNE, RecipeType.ANCIENT_ALTAR, - new ItemStack[] {new ItemStack(Material.DIRT), SlimefunItems.MAGIC_LUMP_1, new ItemStack(Material.STONE), new ItemStack(Material.OBSIDIAN), SlimefunItems.BLANK_RUNE, new ItemStack(Material.OBSIDIAN), new ItemStack(Material.STONE), SlimefunItems.MAGIC_LUMP_1, new ItemStack(Material.DIRT)}, - new SlimefunItemStack(SlimefunItems.EARTH_RUNE, 4)) - .register(plugin); - - new SlimefunItem(categories.magicalResources, SlimefunItems.FIRE_RUNE, RecipeType.ANCIENT_ALTAR, - new ItemStack[] {new ItemStack(Material.FIRE_CHARGE), SlimefunItems.MAGIC_LUMP_2, new ItemStack(Material.FIRE_CHARGE), new ItemStack(Material.BLAZE_POWDER), SlimefunItems.EARTH_RUNE, new ItemStack(Material.FLINT_AND_STEEL), new ItemStack(Material.FIRE_CHARGE), SlimefunItems.MAGIC_LUMP_2, new ItemStack(Material.FIRE_CHARGE)}, - new SlimefunItemStack(SlimefunItems.FIRE_RUNE, 4)) - .register(plugin); - - new SlimefunItem(categories.magicalResources, SlimefunItems.WATER_RUNE, RecipeType.ANCIENT_ALTAR, - new ItemStack[] {new ItemStack(Material.SALMON), SlimefunItems.MAGIC_LUMP_2, new ItemStack(Material.WATER_BUCKET), new ItemStack(Material.SAND), SlimefunItems.BLANK_RUNE, new ItemStack(Material.SAND), new ItemStack(Material.WATER_BUCKET), SlimefunItems.MAGIC_LUMP_2, new ItemStack(Material.COD)}, - new SlimefunItemStack(SlimefunItems.WATER_RUNE, 4)) - .register(plugin); - - new SlimefunItem(categories.magicalResources, SlimefunItems.ENDER_RUNE, RecipeType.ANCIENT_ALTAR, - new ItemStack[] {new ItemStack(Material.ENDER_PEARL), SlimefunItems.ENDER_LUMP_3, new ItemStack(Material.ENDER_PEARL), new ItemStack(Material.ENDER_EYE), SlimefunItems.BLANK_RUNE, new ItemStack(Material.ENDER_EYE), new ItemStack(Material.ENDER_PEARL), SlimefunItems.ENDER_LUMP_3, new ItemStack(Material.ENDER_PEARL)}, - new SlimefunItemStack(SlimefunItems.ENDER_RUNE, 6)) - .register(plugin); - - new SlimefunItem(categories.magicalResources, SlimefunItems.LIGHTNING_RUNE, RecipeType.ANCIENT_ALTAR, - new ItemStack[] {new ItemStack(Material.IRON_INGOT), SlimefunItems.MAGIC_LUMP_3, new ItemStack(Material.IRON_INGOT), SlimefunItems.AIR_RUNE, new ItemStack(Material.PHANTOM_MEMBRANE), SlimefunItems.WATER_RUNE, new ItemStack(Material.IRON_INGOT), SlimefunItems.MAGIC_LUMP_3, new ItemStack(Material.IRON_INGOT)}, - new SlimefunItemStack(SlimefunItems.LIGHTNING_RUNE, 4)) - .register(plugin); - - new SlimefunItem(categories.magicalResources, SlimefunItems.RAINBOW_RUNE, RecipeType.ANCIENT_ALTAR, - new ItemStack[] {new ItemStack(RED_DYE), SlimefunItems.MAGIC_LUMP_3, new ItemStack(Material.CYAN_DYE), new ItemStack(Material.WHITE_WOOL), SlimefunItems.ENDER_RUNE, new ItemStack(Material.WHITE_WOOL), new ItemStack(YELLOW_DYE), SlimefunItems.ENDER_LUMP_3, new ItemStack(Material.MAGENTA_DYE)}) - .register(plugin); - - new SoulboundRune(categories.magicalResources, SlimefunItems.SOULBOUND_RUNE, RecipeType.ANCIENT_ALTAR, - 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 SlimefunItemStack(SlimefunItems.INFERNAL_BONEMEAL, 8)) - .register(plugin); - - new SlimefunItem(categories.magicalGadgets, SlimefunItems.ELYTRA_SCALE, RecipeType.ANCIENT_ALTAR, - new ItemStack[] {SlimefunItems.ENDER_LUMP_3, SlimefunItems.AIR_RUNE, SlimefunItems.ENDER_LUMP_3, new ItemStack(Material.PHANTOM_MEMBRANE), new ItemStack(Material.FEATHER), new ItemStack(Material.PHANTOM_MEMBRANE), SlimefunItems.ENDER_LUMP_3, SlimefunItems.AIR_RUNE, SlimefunItems.ENDER_LUMP_3}) - .register(plugin); - - new VanillaItem(categories.magicalGadgets, new ItemStack(Material.ELYTRA), "ELYTRA", RecipeType.ANCIENT_ALTAR, - new ItemStack[] {SlimefunItems.ELYTRA_SCALE, SlimefunItems.AIR_RUNE, SlimefunItems.ELYTRA_SCALE, SlimefunItems.AIR_RUNE, new ItemStack(Material.LEATHER_CHESTPLATE), SlimefunItems.AIR_RUNE, SlimefunItems.ELYTRA_SCALE, SlimefunItems.AIR_RUNE, SlimefunItems.ELYTRA_SCALE}) - .register(plugin); - - new SlimefunItem(categories.magicalGadgets, SlimefunItems.INFUSED_ELYTRA, RecipeType.ANCIENT_ALTAR, - new ItemStack[] {SlimefunItems.FLASK_OF_KNOWLEDGE, SlimefunItems.ELYTRA_SCALE, SlimefunItems.FLASK_OF_KNOWLEDGE, SlimefunItems.FLASK_OF_KNOWLEDGE, new ItemStack(Material.ELYTRA), SlimefunItems.FLASK_OF_KNOWLEDGE, SlimefunItems.FLASK_OF_KNOWLEDGE, SlimefunItems.ELYTRA_SCALE, SlimefunItems.FLASK_OF_KNOWLEDGE}) - .register(plugin); - - new SoulboundItem(categories.magicalGadgets, SlimefunItems.SOULBOUND_ELYTRA, RecipeType.ANCIENT_ALTAR, - new ItemStack[] {SlimefunItems.FLASK_OF_KNOWLEDGE, SlimefunItems.ESSENCE_OF_AFTERLIFE, SlimefunItems.FLASK_OF_KNOWLEDGE, SlimefunItems.ELYTRA_SCALE, new ItemStack(Material.ELYTRA), SlimefunItems.ELYTRA_SCALE, SlimefunItems.FLASK_OF_KNOWLEDGE, SlimefunItems.ESSENCE_OF_AFTERLIFE, SlimefunItems.FLASK_OF_KNOWLEDGE}) - .register(plugin); - - new VanillaItem(categories.magicalGadgets, new ItemStack(Material.TOTEM_OF_UNDYING), "TOTEM_OF_UNDYING", RecipeType.ANCIENT_ALTAR, - new ItemStack[] {SlimefunItems.ESSENCE_OF_AFTERLIFE, new ItemStack(Material.EMERALD_BLOCK), SlimefunItems.ESSENCE_OF_AFTERLIFE, SlimefunItems.MAGIC_LUMP_3, SlimefunItems.COMMON_TALISMAN, SlimefunItems.MAGIC_LUMP_3, SlimefunItems.ESSENCE_OF_AFTERLIFE, new ItemStack(Material.EMERALD_BLOCK), SlimefunItems.ESSENCE_OF_AFTERLIFE}) - .register(plugin); - - 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 SlimefunItemStack(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 SlimefunItemStack(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 SlimefunItemStack(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 SlimefunItemStack(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 SlimefunItemStack(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 SlimefunItemStack(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 SlimefunItemStack(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 SlimefunItemStack(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 SlimefunItemStack(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 SlimefunItemStack(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 SlimefunItemStack(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 SlimefunItemStack(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 SlimefunItemStack(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 SlimefunItemStack(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 SlimefunItemStack(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 SlimefunItemStack(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 SlimefunItemStack(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 SlimefunItemStack(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 SlimefunItemStack(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 SlimefunItemStack(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 SlimefunItemStack(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 SlimefunItemStack(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 SlimefunItemStack(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 SlimefunItemStack(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, - new ItemStack[] {SlimefunItems.LEAD_INGOT, SlimefunItems.WITHER_PROOF_OBSIDIAN, SlimefunItems.LEAD_INGOT, SlimefunItems.WITHER_PROOF_OBSIDIAN, SlimefunItems.HARDENED_GLASS, SlimefunItems.WITHER_PROOF_OBSIDIAN, SlimefunItems.LEAD_INGOT, SlimefunItems.WITHER_PROOF_OBSIDIAN, SlimefunItems.LEAD_INGOT}, - new SlimefunItemStack(SlimefunItems.WITHER_PROOF_GLASS, 4)) - .register(plugin); - - new GEOScanner(categories.gps, SlimefunItems.GPS_GEO_SCANNER, RecipeType.ENHANCED_CRAFTING_TABLE, - new ItemStack[] {null, null, SlimefunItems.ELECTRO_MAGNET, null, SlimefunItems.STEEL_INGOT, SlimefunItems.STEEL_INGOT, SlimefunItems.ELECTRO_MAGNET, SlimefunItems.ELECTRIC_MOTOR, SlimefunItems.ELECTRO_MAGNET}) - .register(plugin); - - new PortableGEOScanner(categories.gps, SlimefunItems.PORTABLE_GEO_SCANNER, RecipeType.ENHANCED_CRAFTING_TABLE, - new ItemStack[] {SlimefunItems.ELECTRO_MAGNET, new ItemStack(Material.COMPASS), SlimefunItems.ELECTRO_MAGNET, SlimefunItems.STEEL_INGOT, SlimefunItems.GPS_MARKER_TOOL, SlimefunItems.STEEL_INGOT, SlimefunItems.SOLDER_INGOT, SlimefunItems.ELECTRIC_MOTOR, SlimefunItems.SOLDER_INGOT}) - .register(plugin); - - new OilPump(categories.gps, SlimefunItems.OIL_PUMP, RecipeType.ENHANCED_CRAFTING_TABLE, - new ItemStack[] {SlimefunItems.STEEL_INGOT, SlimefunItems.MEDIUM_CAPACITOR, SlimefunItems.STEEL_INGOT, SlimefunItems.STEEL_INGOT, SlimefunItems.ELECTRIC_MOTOR, SlimefunItems.STEEL_INGOT, null, new ItemStack(Material.BUCKET), null}) { - - @Override - public int getEnergyConsumption() { - return 14; - } - - @Override - public int getCapacity() { - return 256; - } - - @Override - public int getSpeed() { - return 1; - } - - }.register(plugin); - - new GEOMiner(categories.gps, SlimefunItems.GEO_MINER, RecipeType.ENHANCED_CRAFTING_TABLE, - new ItemStack[] {new ItemStack(Material.DIAMOND_PICKAXE), SlimefunItems.MEDIUM_CAPACITOR, new ItemStack(Material.DIAMOND_PICKAXE), SlimefunItems.REINFORCED_ALLOY_INGOT, SlimefunItems.OIL_PUMP, SlimefunItems.REINFORCED_ALLOY_INGOT, null, SlimefunItems.ELECTRIC_MOTOR, null}) { - - @Override - public int getSpeed() { - return 1; - } - - @Override - public int getCapacity() { - return 512; - } - - @Override - public int getEnergyConsumption() { - return 24; - } - - }.register(plugin); - - new SlimefunItem(categories.resources, SlimefunItems.OIL_BUCKET, new RecipeType(new NamespacedKey(plugin, "oil_pump"), SlimefunItems.OIL_PUMP), - new ItemStack[] {null, null, null, null, new ItemStack(Material.BUCKET), null, null, null, null}) - .register(plugin); - - new SlimefunItem(categories.resources, SlimefunItems.FUEL_BUCKET, RecipeType.REFINERY, - new ItemStack[] {null, null, null, null, SlimefunItems.OIL_BUCKET, null, null, null, null}) - .register(plugin); - - new RadioactiveItem(categories.resources, Radioactivity.MODERATE, SlimefunItems.NETHER_ICE, RecipeType.GEO_MINER, - new ItemStack[] {null, null, null, null, null, null, null, null, null}) - .register(plugin); - - new Refinery(categories.electricity, SlimefunItems.REFINERY, RecipeType.ENHANCED_CRAFTING_TABLE, - new ItemStack[] {SlimefunItems.HARDENED_GLASS, SlimefunItems.REDSTONE_ALLOY, SlimefunItems.HARDENED_GLASS, SlimefunItems.HARDENED_GLASS, SlimefunItems.REDSTONE_ALLOY, SlimefunItems.HARDENED_GLASS, new ItemStack(Material.PISTON), SlimefunItems.ELECTRIC_MOTOR, new ItemStack(Material.PISTON)}) { - - @Override - public int getEnergyConsumption() { - return 16; - } - - @Override - public int getCapacity() { - return 256; - } - - @Override - public int getSpeed() { - return 1; - } - - }.register(plugin); - - new LavaGenerator(categories.electricity, SlimefunItems.LAVA_GENERATOR, RecipeType.ENHANCED_CRAFTING_TABLE, - new ItemStack[] {null, SlimefunItems.GOLD_16K, null, SlimefunItems.DAMASCUS_STEEL_INGOT, SlimefunItems.ELECTRIC_MOTOR, SlimefunItems.DAMASCUS_STEEL_INGOT, SlimefunItems.HEATING_COIL, SlimefunItems.DAMASCUS_STEEL_INGOT, SlimefunItems.HEATING_COIL}) { - - @Override - public int getEnergyProduction() { - return 10; - } - - @Override - public int getCapacity() { - return 512; - } - - }.register(plugin); - - new LavaGenerator(categories.electricity, SlimefunItems.LAVA_GENERATOR_2, RecipeType.ENHANCED_CRAFTING_TABLE, - new ItemStack[] {SlimefunItems.CORINTHIAN_BRONZE_INGOT, SlimefunItems.CORINTHIAN_BRONZE_INGOT, SlimefunItems.CORINTHIAN_BRONZE_INGOT, SlimefunItems.COMPRESSED_CARBON, SlimefunItems.LAVA_GENERATOR, SlimefunItems.COMPRESSED_CARBON, SlimefunItems.HEATING_COIL, SlimefunItems.COMPRESSED_CARBON, SlimefunItems.HEATING_COIL}) { - - @Override - public int getEnergyProduction() { - return 20; - } - - @Override - public int getCapacity() { - return 1024; - } - - }.register(plugin); - - new CombustionGenerator(categories.electricity, SlimefunItems.COMBUSTION_REACTOR, RecipeType.ENHANCED_CRAFTING_TABLE, - new ItemStack[] {null, SlimefunItems.STEEL_INGOT, null, SlimefunItems.STEEL_INGOT, SlimefunItems.ELECTRIC_MOTOR, SlimefunItems.STEEL_INGOT, SlimefunItems.HEATING_COIL, SlimefunItems.STEEL_INGOT, SlimefunItems.HEATING_COIL}) { - - @Override - public int getEnergyProduction() { - return 12; - } - - @Override - public int getCapacity() { - return 256; - } - - }.register(plugin); - - new TeleporterPylon(categories.gps, SlimefunItems.GPS_TELEPORTER_PYLON, RecipeType.ENHANCED_CRAFTING_TABLE, - new ItemStack[] {SlimefunItems.ZINC_INGOT, new ItemStack(Material.GLASS), SlimefunItems.ZINC_INGOT, new ItemStack(Material.GLASS), SlimefunItems.HEATING_COIL, new ItemStack(Material.GLASS), SlimefunItems.ZINC_INGOT, new ItemStack(Material.GLASS), SlimefunItems.ZINC_INGOT}, - new SlimefunItemStack(SlimefunItems.GPS_TELEPORTER_PYLON, 8)) - .register(plugin); - - new Teleporter(categories.gps, SlimefunItems.GPS_TELEPORTATION_MATRIX, RecipeType.ENHANCED_CRAFTING_TABLE, - new ItemStack[] {SlimefunItems.GPS_TELEPORTER_PYLON, SlimefunItems.REINFORCED_ALLOY_INGOT, SlimefunItems.GPS_TELEPORTER_PYLON, SlimefunItems.ELECTRO_MAGNET, SlimefunItems.GPS_CONTROL_PANEL, SlimefunItems.ELECTRO_MAGNET, SlimefunItems.GPS_TELEPORTER_PYLON, SlimefunItems.REINFORCED_ALLOY_INGOT, SlimefunItems.GPS_TELEPORTER_PYLON}) - .register(plugin); - - new SlimefunItem(categories.gps, SlimefunItems.GPS_ACTIVATION_DEVICE_SHARED, RecipeType.ENHANCED_CRAFTING_TABLE, - new ItemStack[] {null, new ItemStack(Material.STONE_PRESSURE_PLATE), null, new ItemStack(Material.REDSTONE), SlimefunItems.GPS_TRANSMITTER, new ItemStack(Material.REDSTONE), SlimefunItems.BILLON_INGOT, SlimefunItems.BILLON_INGOT, SlimefunItems.BILLON_INGOT}) - .register(plugin); - - new PersonalActivationPlate(categories.gps, SlimefunItems.GPS_ACTIVATION_DEVICE_PERSONAL, RecipeType.ENHANCED_CRAFTING_TABLE, - new ItemStack[] {null, SlimefunItems.LEAD_INGOT, null, SlimefunItems.COBALT_INGOT, SlimefunItems.GPS_ACTIVATION_DEVICE_SHARED, SlimefunItems.COBALT_INGOT, null, SlimefunItems.LEAD_INGOT, null}) - .register(plugin); - - new InfusedHopper(categories.magicalGadgets, SlimefunItems.INFUSED_HOPPER, RecipeType.ANCIENT_ALTAR, - new ItemStack[] {new ItemStack(Material.OBSIDIAN), SlimefunItems.EARTH_RUNE, new ItemStack(Material.HOPPER), SlimefunItems.ENDER_RUNE, SlimefunItems.INFUSED_MAGNET, SlimefunItems.ENDER_RUNE, new ItemStack(Material.HOPPER), SlimefunItems.EARTH_RUNE, new ItemStack(Material.OBSIDIAN)}) - .register(plugin); - - new RadioactiveItem(categories.resources, Radioactivity.HIGH, SlimefunItems.BLISTERING_INGOT, RecipeType.HEATED_PRESSURE_CHAMBER, - new ItemStack[] {SlimefunItems.GOLD_24K, SlimefunItems.URANIUM, null, null, null, null, null, null, null}) - .register(plugin); - - new RadioactiveItem(categories.resources, Radioactivity.VERY_HIGH, SlimefunItems.BLISTERING_INGOT_2, RecipeType.HEATED_PRESSURE_CHAMBER, - new ItemStack[] {SlimefunItems.BLISTERING_INGOT, SlimefunItems.CARBONADO, null, null, null, null, null, null, null}) - .register(plugin); - - new RadioactiveItem(categories.resources, Radioactivity.VERY_HIGH, SlimefunItems.BLISTERING_INGOT_3, RecipeType.HEATED_PRESSURE_CHAMBER, - new ItemStack[] {SlimefunItems.BLISTERING_INGOT_2, new ItemStack(Material.NETHER_STAR), null, null, null, null, null, null, null}) - .register(plugin); - - new RadioactiveItem(categories.resources, Radioactivity.VERY_HIGH, SlimefunItems.ENRICHED_NETHER_ICE, RecipeType.HEATED_PRESSURE_CHAMBER, - new ItemStack[] {SlimefunItems.NETHER_ICE, SlimefunItems.PLUTONIUM, null, null, null, null, null, null, null}, - new SlimefunItemStack(SlimefunItems.ENRICHED_NETHER_ICE, 4)) - .register(plugin); - - new ElevatorPlate(categories.gps, SlimefunItems.ELEVATOR_PLATE, RecipeType.ENHANCED_CRAFTING_TABLE, - new ItemStack[] {null, new ItemStack(Material.STONE_PRESSURE_PLATE), null, new ItemStack(Material.PISTON), SlimefunItems.ELECTRIC_MOTOR, new ItemStack(Material.PISTON), SlimefunItems.ALUMINUM_BRONZE_INGOT, SlimefunItems.ALUMINUM_BRONZE_INGOT, SlimefunItems.ALUMINUM_BRONZE_INGOT}, - new SlimefunItemStack(SlimefunItems.ELEVATOR_PLATE, 2)) - .register(plugin); - - new FoodFabricator(categories.electricity, SlimefunItems.FOOD_FABRICATOR, RecipeType.ENHANCED_CRAFTING_TABLE, - new ItemStack[] {SlimefunItems.BILLON_INGOT, SlimefunItems.SILVER_INGOT, SlimefunItems.BILLON_INGOT, SlimefunItems.TIN_CAN, SlimefunItems.SMALL_CAPACITOR, SlimefunItems.TIN_CAN, null, SlimefunItems.ELECTRIC_MOTOR, null}) { - - @Override - public int getEnergyConsumption() { - return 7; - } - - @Override - public int getCapacity() { - return 256; - } - - @Override - public int getSpeed() { - return 1; - } - - }.register(plugin); - - new FoodFabricator(categories.electricity, SlimefunItems.FOOD_FABRICATOR_2, RecipeType.ENHANCED_CRAFTING_TABLE, - new ItemStack[] {SlimefunItems.HARDENED_METAL_INGOT, SlimefunItems.REINFORCED_ALLOY_INGOT, SlimefunItems.HARDENED_METAL_INGOT, SlimefunItems.ELECTRIC_MOTOR, SlimefunItems.FOOD_FABRICATOR, SlimefunItems.ELECTRIC_MOTOR, null, SlimefunItems.ELECTRO_MAGNET, null}) { - - @Override - public int getEnergyConsumption() { - return 24; - } - - @Override - public int getCapacity() { - return 512; - } - - @Override - public int getSpeed() { - return 6; - } + new ButcherAndroid(categories.androids, SlimefunItems.PROGRAMMABLE_ANDROID_2_BUTCHER, RecipeType.ENHANCED_CRAFTING_TABLE, + new ItemStack[] {null, SlimefunItems.GPS_TRANSMITTER, null, new ItemStack(Material.DIAMOND_SWORD), SlimefunItems.PROGRAMMABLE_ANDROID_2, new ItemStack(Material.DIAMOND_SWORD), null, SlimefunItems.ELECTRIC_MOTOR, null}) { + + @Override + public float getFuelEfficiency() { + return 1.5F; + } + + @Override + public int getTier() { + return 2; + } + + } + .register(plugin); + + new AdvancedFarmerAndroid(categories.androids, SlimefunItems.PROGRAMMABLE_ANDROID_2_FARMER, RecipeType.ENHANCED_CRAFTING_TABLE, + new ItemStack[] {null, SlimefunItems.GPS_TRANSMITTER, null, new ItemStack(Material.DIAMOND_HOE), SlimefunItems.PROGRAMMABLE_ANDROID_2, new ItemStack(Material.DIAMOND_HOE), null, SlimefunItems.ELECTRIC_MOTOR, null}) { + + @Override + public float getFuelEfficiency() { + return 1.5F; + } + + @Override + public int getTier() { + return 2; + } + + } + .register(plugin); + + new ProgrammableAndroid(categories.androids, SlimefunItems.PROGRAMMABLE_ANDROID_3, RecipeType.ENHANCED_CRAFTING_TABLE, + new ItemStack[] {SlimefunItems.PLASTIC_SHEET, SlimefunItems.ANDROID_MEMORY_CORE, SlimefunItems.PLASTIC_SHEET, SlimefunItems.NUCLEAR_REACTOR, SlimefunItems.PROGRAMMABLE_ANDROID_2, new ItemStack(Material.CHEST), SlimefunItems.BLISTERING_INGOT_3, SlimefunItems.POWER_CRYSTAL, SlimefunItems.BLISTERING_INGOT_3}) { + + @Override + public float getFuelEfficiency() { + return 1F; + } + + @Override + public int getTier() { + return 3; + } + + } + .register(plugin); + + new FisherAndroid(categories.androids, SlimefunItems.PROGRAMMABLE_ANDROID_3_FISHERMAN, RecipeType.ENHANCED_CRAFTING_TABLE, + new ItemStack[] {null, null, null, new ItemStack(Material.FISHING_ROD), SlimefunItems.PROGRAMMABLE_ANDROID_3, new ItemStack(Material.FISHING_ROD), null, SlimefunItems.ELECTRIC_MOTOR, null}) { + + @Override + public float getFuelEfficiency() { + return 1F; + } + + @Override + public int getTier() { + return 3; + } + + } + .register(plugin); + + new ButcherAndroid(categories.androids, SlimefunItems.PROGRAMMABLE_ANDROID_3_BUTCHER, RecipeType.ENHANCED_CRAFTING_TABLE, + new ItemStack[] {null, SlimefunItems.GPS_TRANSMITTER_3, null, new ItemStack(Material.DIAMOND_SWORD), SlimefunItems.PROGRAMMABLE_ANDROID_3, new ItemStack(Material.DIAMOND_SWORD), null, SlimefunItems.ELECTRIC_MOTOR, null}) { + + @Override + public float getFuelEfficiency() { + return 1F; + } + + @Override + public int getTier() { + return 3; + } + + } + .register(plugin); + + new SlimefunItem(categories.magicalResources, SlimefunItems.BLANK_RUNE, RecipeType.ANCIENT_ALTAR, + new ItemStack[] {new ItemStack(Material.STONE), SlimefunItems.MAGIC_LUMP_1, new ItemStack(Material.STONE), SlimefunItems.MAGIC_LUMP_1, new ItemStack(Material.OBSIDIAN), SlimefunItems.MAGIC_LUMP_1, new ItemStack(Material.STONE), SlimefunItems.MAGIC_LUMP_1, new ItemStack(Material.STONE)}) + .register(plugin); + + new SlimefunItem(categories.magicalResources, SlimefunItems.AIR_RUNE, RecipeType.ANCIENT_ALTAR, + new ItemStack[] {new ItemStack(Material.FEATHER), SlimefunItems.MAGIC_LUMP_1, new ItemStack(Material.FEATHER), new ItemStack(Material.GHAST_TEAR), SlimefunItems.BLANK_RUNE, new ItemStack(Material.GHAST_TEAR), new ItemStack(Material.FEATHER), SlimefunItems.MAGIC_LUMP_1, new ItemStack(Material.FEATHER)}, + new SlimefunItemStack(SlimefunItems.AIR_RUNE, 4)) + .register(plugin); + + new SlimefunItem(categories.magicalResources, SlimefunItems.EARTH_RUNE, RecipeType.ANCIENT_ALTAR, + new ItemStack[] {new ItemStack(Material.DIRT), SlimefunItems.MAGIC_LUMP_1, new ItemStack(Material.STONE), new ItemStack(Material.OBSIDIAN), SlimefunItems.BLANK_RUNE, new ItemStack(Material.OBSIDIAN), new ItemStack(Material.STONE), SlimefunItems.MAGIC_LUMP_1, new ItemStack(Material.DIRT)}, + new SlimefunItemStack(SlimefunItems.EARTH_RUNE, 4)) + .register(plugin); + + new SlimefunItem(categories.magicalResources, SlimefunItems.FIRE_RUNE, RecipeType.ANCIENT_ALTAR, + new ItemStack[] {new ItemStack(Material.FIRE_CHARGE), SlimefunItems.MAGIC_LUMP_2, new ItemStack(Material.FIRE_CHARGE), new ItemStack(Material.BLAZE_POWDER), SlimefunItems.EARTH_RUNE, new ItemStack(Material.FLINT_AND_STEEL), new ItemStack(Material.FIRE_CHARGE), SlimefunItems.MAGIC_LUMP_2, new ItemStack(Material.FIRE_CHARGE)}, + new SlimefunItemStack(SlimefunItems.FIRE_RUNE, 4)) + .register(plugin); + + new SlimefunItem(categories.magicalResources, SlimefunItems.WATER_RUNE, RecipeType.ANCIENT_ALTAR, + new ItemStack[] {new ItemStack(Material.SALMON), SlimefunItems.MAGIC_LUMP_2, new ItemStack(Material.WATER_BUCKET), new ItemStack(Material.SAND), SlimefunItems.BLANK_RUNE, new ItemStack(Material.SAND), new ItemStack(Material.WATER_BUCKET), SlimefunItems.MAGIC_LUMP_2, new ItemStack(Material.COD)}, + new SlimefunItemStack(SlimefunItems.WATER_RUNE, 4)) + .register(plugin); + + new SlimefunItem(categories.magicalResources, SlimefunItems.ENDER_RUNE, RecipeType.ANCIENT_ALTAR, + new ItemStack[] {new ItemStack(Material.ENDER_PEARL), SlimefunItems.ENDER_LUMP_3, new ItemStack(Material.ENDER_PEARL), new ItemStack(Material.ENDER_EYE), SlimefunItems.BLANK_RUNE, new ItemStack(Material.ENDER_EYE), new ItemStack(Material.ENDER_PEARL), SlimefunItems.ENDER_LUMP_3, new ItemStack(Material.ENDER_PEARL)}, + new SlimefunItemStack(SlimefunItems.ENDER_RUNE, 6)) + .register(plugin); + + new SlimefunItem(categories.magicalResources, SlimefunItems.LIGHTNING_RUNE, RecipeType.ANCIENT_ALTAR, + new ItemStack[] {new ItemStack(Material.IRON_INGOT), SlimefunItems.MAGIC_LUMP_3, new ItemStack(Material.IRON_INGOT), SlimefunItems.AIR_RUNE, new ItemStack(Material.PHANTOM_MEMBRANE), SlimefunItems.WATER_RUNE, new ItemStack(Material.IRON_INGOT), SlimefunItems.MAGIC_LUMP_3, new ItemStack(Material.IRON_INGOT)}, + new SlimefunItemStack(SlimefunItems.LIGHTNING_RUNE, 4)) + .register(plugin); + + new SlimefunItem(categories.magicalResources, SlimefunItems.RAINBOW_RUNE, RecipeType.ANCIENT_ALTAR, + new ItemStack[] {new ItemStack(RED_DYE), SlimefunItems.MAGIC_LUMP_3, new ItemStack(Material.CYAN_DYE), new ItemStack(Material.WHITE_WOOL), SlimefunItems.ENDER_RUNE, new ItemStack(Material.WHITE_WOOL), new ItemStack(YELLOW_DYE), SlimefunItems.ENDER_LUMP_3, new ItemStack(Material.MAGENTA_DYE)}) + .register(plugin); + + new SoulboundRune(categories.magicalResources, SlimefunItems.SOULBOUND_RUNE, RecipeType.ANCIENT_ALTAR, + 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 SlimefunItemStack(SlimefunItems.INFERNAL_BONEMEAL, 8)) + .register(plugin); + + new SlimefunItem(categories.magicalGadgets, SlimefunItems.ELYTRA_SCALE, RecipeType.ANCIENT_ALTAR, + new ItemStack[] {SlimefunItems.ENDER_LUMP_3, SlimefunItems.AIR_RUNE, SlimefunItems.ENDER_LUMP_3, new ItemStack(Material.PHANTOM_MEMBRANE), new ItemStack(Material.FEATHER), new ItemStack(Material.PHANTOM_MEMBRANE), SlimefunItems.ENDER_LUMP_3, SlimefunItems.AIR_RUNE, SlimefunItems.ENDER_LUMP_3}) + .register(plugin); + + new VanillaItem(categories.magicalGadgets, new ItemStack(Material.ELYTRA), "ELYTRA", RecipeType.ANCIENT_ALTAR, + new ItemStack[] {SlimefunItems.ELYTRA_SCALE, SlimefunItems.AIR_RUNE, SlimefunItems.ELYTRA_SCALE, SlimefunItems.AIR_RUNE, new ItemStack(Material.LEATHER_CHESTPLATE), SlimefunItems.AIR_RUNE, SlimefunItems.ELYTRA_SCALE, SlimefunItems.AIR_RUNE, SlimefunItems.ELYTRA_SCALE}) + .register(plugin); + + new SlimefunItem(categories.magicalGadgets, SlimefunItems.INFUSED_ELYTRA, RecipeType.ANCIENT_ALTAR, + new ItemStack[] {SlimefunItems.FLASK_OF_KNOWLEDGE, SlimefunItems.ELYTRA_SCALE, SlimefunItems.FLASK_OF_KNOWLEDGE, SlimefunItems.FLASK_OF_KNOWLEDGE, new ItemStack(Material.ELYTRA), SlimefunItems.FLASK_OF_KNOWLEDGE, SlimefunItems.FLASK_OF_KNOWLEDGE, SlimefunItems.ELYTRA_SCALE, SlimefunItems.FLASK_OF_KNOWLEDGE}) + .register(plugin); + + new SoulboundItem(categories.magicalGadgets, SlimefunItems.SOULBOUND_ELYTRA, RecipeType.ANCIENT_ALTAR, + new ItemStack[] {SlimefunItems.FLASK_OF_KNOWLEDGE, SlimefunItems.ESSENCE_OF_AFTERLIFE, SlimefunItems.FLASK_OF_KNOWLEDGE, SlimefunItems.ELYTRA_SCALE, new ItemStack(Material.ELYTRA), SlimefunItems.ELYTRA_SCALE, SlimefunItems.FLASK_OF_KNOWLEDGE, SlimefunItems.ESSENCE_OF_AFTERLIFE, SlimefunItems.FLASK_OF_KNOWLEDGE}) + .register(plugin); + + new VanillaItem(categories.magicalGadgets, new ItemStack(Material.TOTEM_OF_UNDYING), "TOTEM_OF_UNDYING", RecipeType.ANCIENT_ALTAR, + new ItemStack[] {SlimefunItems.ESSENCE_OF_AFTERLIFE, new ItemStack(Material.EMERALD_BLOCK), SlimefunItems.ESSENCE_OF_AFTERLIFE, SlimefunItems.MAGIC_LUMP_3, SlimefunItems.COMMON_TALISMAN, SlimefunItems.MAGIC_LUMP_3, SlimefunItems.ESSENCE_OF_AFTERLIFE, new ItemStack(Material.EMERALD_BLOCK), SlimefunItems.ESSENCE_OF_AFTERLIFE}) + .register(plugin); + + 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 SlimefunItemStack(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 SlimefunItemStack(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 SlimefunItemStack(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 SlimefunItemStack(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 SlimefunItemStack(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 SlimefunItemStack(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 SlimefunItemStack(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 SlimefunItemStack(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 SlimefunItemStack(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 SlimefunItemStack(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 SlimefunItemStack(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 SlimefunItemStack(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 SlimefunItemStack(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 SlimefunItemStack(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 SlimefunItemStack(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 SlimefunItemStack(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 SlimefunItemStack(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 SlimefunItemStack(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 SlimefunItemStack(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 SlimefunItemStack(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 SlimefunItemStack(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 SlimefunItemStack(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 SlimefunItemStack(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 SlimefunItemStack(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, + new ItemStack[] {SlimefunItems.LEAD_INGOT, SlimefunItems.WITHER_PROOF_OBSIDIAN, SlimefunItems.LEAD_INGOT, SlimefunItems.WITHER_PROOF_OBSIDIAN, SlimefunItems.HARDENED_GLASS, SlimefunItems.WITHER_PROOF_OBSIDIAN, SlimefunItems.LEAD_INGOT, SlimefunItems.WITHER_PROOF_OBSIDIAN, SlimefunItems.LEAD_INGOT}, + new SlimefunItemStack(SlimefunItems.WITHER_PROOF_GLASS, 4)) + .register(plugin); + + new GEOScanner(categories.gps, SlimefunItems.GPS_GEO_SCANNER, RecipeType.ENHANCED_CRAFTING_TABLE, + new ItemStack[] {null, null, SlimefunItems.ELECTRO_MAGNET, null, SlimefunItems.STEEL_INGOT, SlimefunItems.STEEL_INGOT, SlimefunItems.ELECTRO_MAGNET, SlimefunItems.ELECTRIC_MOTOR, SlimefunItems.ELECTRO_MAGNET}) + .register(plugin); + + new PortableGEOScanner(categories.gps, SlimefunItems.PORTABLE_GEO_SCANNER, RecipeType.ENHANCED_CRAFTING_TABLE, + new ItemStack[] {SlimefunItems.ELECTRO_MAGNET, new ItemStack(Material.COMPASS), SlimefunItems.ELECTRO_MAGNET, SlimefunItems.STEEL_INGOT, SlimefunItems.GPS_MARKER_TOOL, SlimefunItems.STEEL_INGOT, SlimefunItems.SOLDER_INGOT, SlimefunItems.ELECTRIC_MOTOR, SlimefunItems.SOLDER_INGOT}) + .register(plugin); + + new OilPump(categories.gps, SlimefunItems.OIL_PUMP, RecipeType.ENHANCED_CRAFTING_TABLE, + new ItemStack[] {SlimefunItems.STEEL_INGOT, SlimefunItems.MEDIUM_CAPACITOR, SlimefunItems.STEEL_INGOT, SlimefunItems.STEEL_INGOT, SlimefunItems.ELECTRIC_MOTOR, SlimefunItems.STEEL_INGOT, null, new ItemStack(Material.BUCKET), null}) { + + @Override + public int getEnergyConsumption() { + return 14; + } + + @Override + public int getCapacity() { + return 256; + } + + @Override + public int getSpeed() { + return 1; + } + + }.register(plugin); + + new GEOMiner(categories.gps, SlimefunItems.GEO_MINER, RecipeType.ENHANCED_CRAFTING_TABLE, + new ItemStack[] {new ItemStack(Material.DIAMOND_PICKAXE), SlimefunItems.MEDIUM_CAPACITOR, new ItemStack(Material.DIAMOND_PICKAXE), SlimefunItems.REINFORCED_ALLOY_INGOT, SlimefunItems.OIL_PUMP, SlimefunItems.REINFORCED_ALLOY_INGOT, null, SlimefunItems.ELECTRIC_MOTOR, null}) { + + @Override + public int getSpeed() { + return 1; + } + + @Override + public int getCapacity() { + return 512; + } + + @Override + public int getEnergyConsumption() { + return 24; + } + + }.register(plugin); + + new SlimefunItem(categories.resources, SlimefunItems.OIL_BUCKET, new RecipeType(new NamespacedKey(plugin, "oil_pump"), SlimefunItems.OIL_PUMP), + new ItemStack[] {null, null, null, null, new ItemStack(Material.BUCKET), null, null, null, null}) + .register(plugin); + + new SlimefunItem(categories.resources, SlimefunItems.FUEL_BUCKET, RecipeType.REFINERY, + new ItemStack[] {null, null, null, null, SlimefunItems.OIL_BUCKET, null, null, null, null}) + .register(plugin); + + new RadioactiveItem(categories.resources, Radioactivity.MODERATE, SlimefunItems.NETHER_ICE, RecipeType.GEO_MINER, + new ItemStack[] {null, null, null, null, null, null, null, null, null}) + .register(plugin); + + new Refinery(categories.electricity, SlimefunItems.REFINERY, RecipeType.ENHANCED_CRAFTING_TABLE, + new ItemStack[] {SlimefunItems.HARDENED_GLASS, SlimefunItems.REDSTONE_ALLOY, SlimefunItems.HARDENED_GLASS, SlimefunItems.HARDENED_GLASS, SlimefunItems.REDSTONE_ALLOY, SlimefunItems.HARDENED_GLASS, new ItemStack(Material.PISTON), SlimefunItems.ELECTRIC_MOTOR, new ItemStack(Material.PISTON)}) { + + @Override + public int getEnergyConsumption() { + return 16; + } + + @Override + public int getCapacity() { + return 256; + } + + @Override + public int getSpeed() { + return 1; + } + + }.register(plugin); + + new LavaGenerator(categories.electricity, SlimefunItems.LAVA_GENERATOR, RecipeType.ENHANCED_CRAFTING_TABLE, + new ItemStack[] {null, SlimefunItems.GOLD_16K, null, SlimefunItems.DAMASCUS_STEEL_INGOT, SlimefunItems.ELECTRIC_MOTOR, SlimefunItems.DAMASCUS_STEEL_INGOT, SlimefunItems.HEATING_COIL, SlimefunItems.DAMASCUS_STEEL_INGOT, SlimefunItems.HEATING_COIL}) { + + @Override + public int getEnergyProduction() { + return 10; + } + + @Override + public int getCapacity() { + return 512; + } + + }.register(plugin); + + new LavaGenerator(categories.electricity, SlimefunItems.LAVA_GENERATOR_2, RecipeType.ENHANCED_CRAFTING_TABLE, + new ItemStack[] {SlimefunItems.CORINTHIAN_BRONZE_INGOT, SlimefunItems.CORINTHIAN_BRONZE_INGOT, SlimefunItems.CORINTHIAN_BRONZE_INGOT, SlimefunItems.COMPRESSED_CARBON, SlimefunItems.LAVA_GENERATOR, SlimefunItems.COMPRESSED_CARBON, SlimefunItems.HEATING_COIL, SlimefunItems.COMPRESSED_CARBON, SlimefunItems.HEATING_COIL}) { + + @Override + public int getEnergyProduction() { + return 20; + } + + @Override + public int getCapacity() { + return 1024; + } + + }.register(plugin); + + new CombustionGenerator(categories.electricity, SlimefunItems.COMBUSTION_REACTOR, RecipeType.ENHANCED_CRAFTING_TABLE, + new ItemStack[] {null, SlimefunItems.STEEL_INGOT, null, SlimefunItems.STEEL_INGOT, SlimefunItems.ELECTRIC_MOTOR, SlimefunItems.STEEL_INGOT, SlimefunItems.HEATING_COIL, SlimefunItems.STEEL_INGOT, SlimefunItems.HEATING_COIL}) { + + @Override + public int getEnergyProduction() { + return 12; + } + + @Override + public int getCapacity() { + return 256; + } + + }.register(plugin); + + new TeleporterPylon(categories.gps, SlimefunItems.GPS_TELEPORTER_PYLON, RecipeType.ENHANCED_CRAFTING_TABLE, + new ItemStack[] {SlimefunItems.ZINC_INGOT, new ItemStack(Material.GLASS), SlimefunItems.ZINC_INGOT, new ItemStack(Material.GLASS), SlimefunItems.HEATING_COIL, new ItemStack(Material.GLASS), SlimefunItems.ZINC_INGOT, new ItemStack(Material.GLASS), SlimefunItems.ZINC_INGOT}, + new SlimefunItemStack(SlimefunItems.GPS_TELEPORTER_PYLON, 8)) + .register(plugin); + + new Teleporter(categories.gps, SlimefunItems.GPS_TELEPORTATION_MATRIX, RecipeType.ENHANCED_CRAFTING_TABLE, + new ItemStack[] {SlimefunItems.GPS_TELEPORTER_PYLON, SlimefunItems.REINFORCED_ALLOY_INGOT, SlimefunItems.GPS_TELEPORTER_PYLON, SlimefunItems.ELECTRO_MAGNET, SlimefunItems.GPS_CONTROL_PANEL, SlimefunItems.ELECTRO_MAGNET, SlimefunItems.GPS_TELEPORTER_PYLON, SlimefunItems.REINFORCED_ALLOY_INGOT, SlimefunItems.GPS_TELEPORTER_PYLON}) + .register(plugin); + + new SlimefunItem(categories.gps, SlimefunItems.GPS_ACTIVATION_DEVICE_SHARED, RecipeType.ENHANCED_CRAFTING_TABLE, + new ItemStack[] {null, new ItemStack(Material.STONE_PRESSURE_PLATE), null, new ItemStack(Material.REDSTONE), SlimefunItems.GPS_TRANSMITTER, new ItemStack(Material.REDSTONE), SlimefunItems.BILLON_INGOT, SlimefunItems.BILLON_INGOT, SlimefunItems.BILLON_INGOT}) + .register(plugin); + + new PersonalActivationPlate(categories.gps, SlimefunItems.GPS_ACTIVATION_DEVICE_PERSONAL, RecipeType.ENHANCED_CRAFTING_TABLE, + new ItemStack[] {null, SlimefunItems.LEAD_INGOT, null, SlimefunItems.COBALT_INGOT, SlimefunItems.GPS_ACTIVATION_DEVICE_SHARED, SlimefunItems.COBALT_INGOT, null, SlimefunItems.LEAD_INGOT, null}) + .register(plugin); + + new InfusedHopper(categories.magicalGadgets, SlimefunItems.INFUSED_HOPPER, RecipeType.ANCIENT_ALTAR, + new ItemStack[] {new ItemStack(Material.OBSIDIAN), SlimefunItems.EARTH_RUNE, new ItemStack(Material.HOPPER), SlimefunItems.ENDER_RUNE, SlimefunItems.INFUSED_MAGNET, SlimefunItems.ENDER_RUNE, new ItemStack(Material.HOPPER), SlimefunItems.EARTH_RUNE, new ItemStack(Material.OBSIDIAN)}) + .register(plugin); + + new RadioactiveItem(categories.resources, Radioactivity.HIGH, SlimefunItems.BLISTERING_INGOT, RecipeType.HEATED_PRESSURE_CHAMBER, + new ItemStack[] {SlimefunItems.GOLD_24K, SlimefunItems.URANIUM, null, null, null, null, null, null, null}) + .register(plugin); + + new RadioactiveItem(categories.resources, Radioactivity.VERY_HIGH, SlimefunItems.BLISTERING_INGOT_2, RecipeType.HEATED_PRESSURE_CHAMBER, + new ItemStack[] {SlimefunItems.BLISTERING_INGOT, SlimefunItems.CARBONADO, null, null, null, null, null, null, null}) + .register(plugin); + + new RadioactiveItem(categories.resources, Radioactivity.VERY_HIGH, SlimefunItems.BLISTERING_INGOT_3, RecipeType.HEATED_PRESSURE_CHAMBER, + new ItemStack[] {SlimefunItems.BLISTERING_INGOT_2, new ItemStack(Material.NETHER_STAR), null, null, null, null, null, null, null}) + .register(plugin); + + new RadioactiveItem(categories.resources, Radioactivity.VERY_HIGH, SlimefunItems.ENRICHED_NETHER_ICE, RecipeType.HEATED_PRESSURE_CHAMBER, + new ItemStack[] {SlimefunItems.NETHER_ICE, SlimefunItems.PLUTONIUM, null, null, null, null, null, null, null}, + new SlimefunItemStack(SlimefunItems.ENRICHED_NETHER_ICE, 4)) + .register(plugin); + + new ElevatorPlate(categories.gps, SlimefunItems.ELEVATOR_PLATE, RecipeType.ENHANCED_CRAFTING_TABLE, + new ItemStack[] {null, new ItemStack(Material.STONE_PRESSURE_PLATE), null, new ItemStack(Material.PISTON), SlimefunItems.ELECTRIC_MOTOR, new ItemStack(Material.PISTON), SlimefunItems.ALUMINUM_BRONZE_INGOT, SlimefunItems.ALUMINUM_BRONZE_INGOT, SlimefunItems.ALUMINUM_BRONZE_INGOT}, + new SlimefunItemStack(SlimefunItems.ELEVATOR_PLATE, 2)) + .register(plugin); + + new FoodFabricator(categories.electricity, SlimefunItems.FOOD_FABRICATOR, RecipeType.ENHANCED_CRAFTING_TABLE, + new ItemStack[] {SlimefunItems.BILLON_INGOT, SlimefunItems.SILVER_INGOT, SlimefunItems.BILLON_INGOT, SlimefunItems.TIN_CAN, SlimefunItems.SMALL_CAPACITOR, SlimefunItems.TIN_CAN, null, SlimefunItems.ELECTRIC_MOTOR, null}) { + + @Override + public int getEnergyConsumption() { + return 7; + } + + @Override + public int getCapacity() { + return 256; + } + + @Override + public int getSpeed() { + return 1; + } + + }.register(plugin); + + new FoodFabricator(categories.electricity, SlimefunItems.FOOD_FABRICATOR_2, RecipeType.ENHANCED_CRAFTING_TABLE, + new ItemStack[] {SlimefunItems.HARDENED_METAL_INGOT, SlimefunItems.REINFORCED_ALLOY_INGOT, SlimefunItems.HARDENED_METAL_INGOT, SlimefunItems.ELECTRIC_MOTOR, SlimefunItems.FOOD_FABRICATOR, SlimefunItems.ELECTRIC_MOTOR, null, SlimefunItems.ELECTRO_MAGNET, null}) { + + @Override + public int getEnergyConsumption() { + return 24; + } + + @Override + public int getCapacity() { + return 512; + } + + @Override + public int getSpeed() { + return 6; + } - }.register(plugin); + }.register(plugin); - new OrganicFood(categories.misc, SlimefunItems.WHEAT_ORGANIC_FOOD, Material.WHEAT) - .register(plugin); - - new OrganicFood(categories.misc, SlimefunItems.CARROT_ORGANIC_FOOD, Material.CARROT) - .register(plugin); + new OrganicFood(categories.misc, SlimefunItems.WHEAT_ORGANIC_FOOD, Material.WHEAT) + .register(plugin); + + new OrganicFood(categories.misc, SlimefunItems.CARROT_ORGANIC_FOOD, Material.CARROT) + .register(plugin); - new OrganicFood(categories.misc, SlimefunItems.POTATO_ORGANIC_FOOD, Material.POTATO) - .register(plugin); + new OrganicFood(categories.misc, SlimefunItems.POTATO_ORGANIC_FOOD, Material.POTATO) + .register(plugin); - new OrganicFood(categories.misc, SlimefunItems.SEEDS_ORGANIC_FOOD, Material.WHEAT_SEEDS) - .register(plugin); + new OrganicFood(categories.misc, SlimefunItems.SEEDS_ORGANIC_FOOD, Material.WHEAT_SEEDS) + .register(plugin); - new OrganicFood(categories.misc, SlimefunItems.BEETROOT_ORGANIC_FOOD, Material.BEETROOT) - .register(plugin); + new OrganicFood(categories.misc, SlimefunItems.BEETROOT_ORGANIC_FOOD, Material.BEETROOT) + .register(plugin); - new OrganicFood(categories.misc, SlimefunItems.MELON_ORGANIC_FOOD, Material.MELON_SLICE) - .register(plugin); + new OrganicFood(categories.misc, SlimefunItems.MELON_ORGANIC_FOOD, Material.MELON_SLICE) + .register(plugin); - new OrganicFood(categories.misc, SlimefunItems.APPLE_ORGANIC_FOOD, Material.APPLE) - .register(plugin); + new OrganicFood(categories.misc, SlimefunItems.APPLE_ORGANIC_FOOD, Material.APPLE) + .register(plugin); - if (SlimefunPlugin.getMinecraftVersion().isAtLeast(MinecraftVersion.MINECRAFT_1_14)) { - new OrganicFood(categories.misc, SlimefunItems.SWEET_BERRIES_ORGANIC_FOOD, Material.SWEET_BERRIES) - .register(plugin); - } + if (SlimefunPlugin.getMinecraftVersion().isAtLeast(MinecraftVersion.MINECRAFT_1_14)) { + new OrganicFood(categories.misc, SlimefunItems.SWEET_BERRIES_ORGANIC_FOOD, Material.SWEET_BERRIES) + .register(plugin); + } - new OrganicFood(categories.misc, SlimefunItems.KELP_ORGANIC_FOOD, Material.DRIED_KELP) - .register(plugin); + new OrganicFood(categories.misc, SlimefunItems.KELP_ORGANIC_FOOD, Material.DRIED_KELP) + .register(plugin); new OrganicFood(categories.misc, SlimefunItems.COCOA_ORGANIC_FOOD, Material.COCOA_BEANS) .register(plugin); - new AutoBreeder(categories.electricity, SlimefunItems.AUTO_BREEDER, RecipeType.ENHANCED_CRAFTING_TABLE, - new ItemStack[] {SlimefunItems.GOLD_18K, SlimefunItems.TIN_CAN, SlimefunItems.GOLD_18K, SlimefunItems.ELECTRIC_MOTOR, new ItemStack(Material.HAY_BLOCK), SlimefunItems.ELECTRIC_MOTOR, SlimefunItems.LEAD_INGOT, SlimefunItems.FOOD_FABRICATOR, SlimefunItems.LEAD_INGOT}) - .register(plugin); + new AutoBreeder(categories.electricity, SlimefunItems.AUTO_BREEDER, RecipeType.ENHANCED_CRAFTING_TABLE, + new ItemStack[] {SlimefunItems.GOLD_18K, SlimefunItems.TIN_CAN, SlimefunItems.GOLD_18K, SlimefunItems.ELECTRIC_MOTOR, new ItemStack(Material.HAY_BLOCK), SlimefunItems.ELECTRIC_MOTOR, SlimefunItems.LEAD_INGOT, SlimefunItems.FOOD_FABRICATOR, SlimefunItems.LEAD_INGOT}) + .register(plugin); - new AnimalGrowthAccelerator(categories.electricity, SlimefunItems.ANIMAL_GROWTH_ACCELERATOR, RecipeType.ENHANCED_CRAFTING_TABLE, - new ItemStack[] {null, SlimefunItems.BLISTERING_INGOT_3, null, SlimefunItems.ELECTRIC_MOTOR, SlimefunItems.WHEAT_ORGANIC_FOOD, SlimefunItems.ELECTRIC_MOTOR, SlimefunItems.REINFORCED_ALLOY_INGOT, SlimefunItems.AUTO_BREEDER, SlimefunItems.REINFORCED_ALLOY_INGOT}) - .register(plugin); + new AnimalGrowthAccelerator(categories.electricity, SlimefunItems.ANIMAL_GROWTH_ACCELERATOR, RecipeType.ENHANCED_CRAFTING_TABLE, + new ItemStack[] {null, SlimefunItems.BLISTERING_INGOT_3, null, SlimefunItems.ELECTRIC_MOTOR, SlimefunItems.WHEAT_ORGANIC_FOOD, SlimefunItems.ELECTRIC_MOTOR, SlimefunItems.REINFORCED_ALLOY_INGOT, SlimefunItems.AUTO_BREEDER, SlimefunItems.REINFORCED_ALLOY_INGOT}) + .register(plugin); new TreeGrowthAccelerator(categories.electricity, SlimefunItems.TREE_GROWTH_ACCELERATOR, RecipeType.ENHANCED_CRAFTING_TABLE, new ItemStack[] {null, SlimefunItems.CARBONADO, null, SlimefunItems.ELECTRIC_MOTOR, new ItemStack(Material.DIAMOND_AXE), SlimefunItems.ELECTRIC_MOTOR, SlimefunItems.MAGNESIUM_SALT, SlimefunItems.BIG_CAPACITOR, SlimefunItems.MAGNESIUM_SALT}) .register(plugin); - + new XPCollector(categories.electricity, SlimefunItems.EXP_COLLECTOR, RecipeType.ENHANCED_CRAFTING_TABLE, - new ItemStack[] {null, SlimefunItems.BLISTERING_INGOT_3, null, SlimefunItems.WITHER_PROOF_OBSIDIAN, SlimefunItems.AUTO_ENCHANTER, SlimefunItems.WITHER_PROOF_OBSIDIAN, SlimefunItems.ALUMINUM_BRONZE_INGOT, SlimefunItems.ELECTRIC_MOTOR, SlimefunItems.ALUMINUM_BRONZE_INGOT}) - .register(plugin); + new ItemStack[] {null, SlimefunItems.BLISTERING_INGOT_3, null, SlimefunItems.WITHER_PROOF_OBSIDIAN, SlimefunItems.AUTO_ENCHANTER, SlimefunItems.WITHER_PROOF_OBSIDIAN, SlimefunItems.ALUMINUM_BRONZE_INGOT, SlimefunItems.ELECTRIC_MOTOR, SlimefunItems.ALUMINUM_BRONZE_INGOT}) + .register(plugin); - new FoodComposter(categories.electricity, SlimefunItems.FOOD_COMPOSTER, RecipeType.ENHANCED_CRAFTING_TABLE, - new ItemStack[] {SlimefunItems.DAMASCUS_STEEL_INGOT, SlimefunItems.FOOD_FABRICATOR, SlimefunItems.DAMASCUS_STEEL_INGOT, SlimefunItems.TIN_CAN, SlimefunItems.MEDIUM_CAPACITOR, SlimefunItems.TIN_CAN, null, SlimefunItems.ELECTRIC_MOTOR, null}) { - - @Override - public int getEnergyConsumption() { - return 8; - } + new FoodComposter(categories.electricity, SlimefunItems.FOOD_COMPOSTER, RecipeType.ENHANCED_CRAFTING_TABLE, + new ItemStack[] {SlimefunItems.DAMASCUS_STEEL_INGOT, SlimefunItems.FOOD_FABRICATOR, SlimefunItems.DAMASCUS_STEEL_INGOT, SlimefunItems.TIN_CAN, SlimefunItems.MEDIUM_CAPACITOR, SlimefunItems.TIN_CAN, null, SlimefunItems.ELECTRIC_MOTOR, null}) { + + @Override + public int getEnergyConsumption() { + return 8; + } - @Override - public int getCapacity() { - return 256; - } + @Override + public int getCapacity() { + return 256; + } - @Override - public int getSpeed() { - return 1; - } + @Override + public int getSpeed() { + return 1; + } - }.register(plugin); + }.register(plugin); - new FoodComposter(categories.electricity, SlimefunItems.FOOD_COMPOSTER_2, RecipeType.ENHANCED_CRAFTING_TABLE, - new ItemStack[] {SlimefunItems.HARDENED_METAL_INGOT, SlimefunItems.REINFORCED_ALLOY_INGOT, SlimefunItems.HARDENED_METAL_INGOT, SlimefunItems.ELECTRIC_MOTOR, SlimefunItems.FOOD_COMPOSTER, SlimefunItems.ELECTRIC_MOTOR, null, SlimefunItems.ELECTRO_MAGNET, null}) { + new FoodComposter(categories.electricity, SlimefunItems.FOOD_COMPOSTER_2, RecipeType.ENHANCED_CRAFTING_TABLE, + new ItemStack[] {SlimefunItems.HARDENED_METAL_INGOT, SlimefunItems.REINFORCED_ALLOY_INGOT, SlimefunItems.HARDENED_METAL_INGOT, SlimefunItems.ELECTRIC_MOTOR, SlimefunItems.FOOD_COMPOSTER, SlimefunItems.ELECTRIC_MOTOR, null, SlimefunItems.ELECTRO_MAGNET, null}) { - @Override - public int getEnergyConsumption() { - return 26; - } + @Override + public int getEnergyConsumption() { + return 26; + } - @Override - public int getCapacity() { - return 512; - } + @Override + public int getCapacity() { + return 512; + } - @Override - public int getSpeed() { - return 10; - } + @Override + public int getSpeed() { + return 10; + } - }.register(plugin); + }.register(plugin); - new OrganicFertilizer(categories.misc, SlimefunItems.WHEAT_FERTILIZER, SlimefunItems.WHEAT_ORGANIC_FOOD) - .register(plugin); + new OrganicFertilizer(categories.misc, SlimefunItems.WHEAT_FERTILIZER, SlimefunItems.WHEAT_ORGANIC_FOOD) + .register(plugin); - new OrganicFertilizer(categories.misc, SlimefunItems.CARROT_FERTILIZER, SlimefunItems.CARROT_ORGANIC_FOOD) - .register(plugin); + new OrganicFertilizer(categories.misc, SlimefunItems.CARROT_FERTILIZER, SlimefunItems.CARROT_ORGANIC_FOOD) + .register(plugin); - new OrganicFertilizer(categories.misc, SlimefunItems.POTATO_FERTILIZER, SlimefunItems.POTATO_ORGANIC_FOOD) - .register(plugin); + new OrganicFertilizer(categories.misc, SlimefunItems.POTATO_FERTILIZER, SlimefunItems.POTATO_ORGANIC_FOOD) + .register(plugin); - new OrganicFertilizer(categories.misc, SlimefunItems.SEEDS_FERTILIZER, SlimefunItems.SEEDS_ORGANIC_FOOD) - .register(plugin); + new OrganicFertilizer(categories.misc, SlimefunItems.SEEDS_FERTILIZER, SlimefunItems.SEEDS_ORGANIC_FOOD) + .register(plugin); - new OrganicFertilizer(categories.misc, SlimefunItems.BEETROOT_FERTILIZER, SlimefunItems.BEETROOT_ORGANIC_FOOD) - .register(plugin); + new OrganicFertilizer(categories.misc, SlimefunItems.BEETROOT_FERTILIZER, SlimefunItems.BEETROOT_ORGANIC_FOOD) + .register(plugin); - new OrganicFertilizer(categories.misc, SlimefunItems.MELON_FERTILIZER, SlimefunItems.MELON_ORGANIC_FOOD) - .register(plugin); + new OrganicFertilizer(categories.misc, SlimefunItems.MELON_FERTILIZER, SlimefunItems.MELON_ORGANIC_FOOD) + .register(plugin); - new OrganicFertilizer(categories.misc, SlimefunItems.APPLE_FERTILIZER, SlimefunItems.APPLE_ORGANIC_FOOD) - .register(plugin); + new OrganicFertilizer(categories.misc, SlimefunItems.APPLE_FERTILIZER, SlimefunItems.APPLE_ORGANIC_FOOD) + .register(plugin); - new OrganicFertilizer(categories.misc, SlimefunItems.SWEET_BERRIES_FERTILIZER, SlimefunItems.SWEET_BERRIES_ORGANIC_FOOD) - .register(plugin); + new OrganicFertilizer(categories.misc, SlimefunItems.SWEET_BERRIES_FERTILIZER, SlimefunItems.SWEET_BERRIES_ORGANIC_FOOD) + .register(plugin); - new OrganicFertilizer(categories.misc, SlimefunItems.KELP_FERTILIZER, SlimefunItems.KELP_ORGANIC_FOOD) - .register(plugin); + new OrganicFertilizer(categories.misc, SlimefunItems.KELP_FERTILIZER, SlimefunItems.KELP_ORGANIC_FOOD) + .register(plugin); new OrganicFertilizer(categories.misc, SlimefunItems.COCOA_FERTILIZER, SlimefunItems.COCOA_ORGANIC_FOOD) .register(plugin); - new CropGrowthAccelerator(categories.electricity, SlimefunItems.CROP_GROWTH_ACCELERATOR, RecipeType.ENHANCED_CRAFTING_TABLE, - new ItemStack[] {null, SlimefunItems.BLISTERING_INGOT_3, null, SlimefunItems.ELECTRIC_MOTOR, SlimefunItems.PROGRAMMABLE_ANDROID_FARMER, SlimefunItems.ELECTRIC_MOTOR, SlimefunItems.ELECTRO_MAGNET, SlimefunItems.ANIMAL_GROWTH_ACCELERATOR, SlimefunItems.ELECTRO_MAGNET}) { + new CropGrowthAccelerator(categories.electricity, SlimefunItems.CROP_GROWTH_ACCELERATOR, RecipeType.ENHANCED_CRAFTING_TABLE, + new ItemStack[] {null, SlimefunItems.BLISTERING_INGOT_3, null, SlimefunItems.ELECTRIC_MOTOR, SlimefunItems.PROGRAMMABLE_ANDROID_FARMER, SlimefunItems.ELECTRIC_MOTOR, SlimefunItems.ELECTRO_MAGNET, SlimefunItems.ANIMAL_GROWTH_ACCELERATOR, SlimefunItems.ELECTRO_MAGNET}) { - @Override - public int getEnergyConsumption() { - return 25; - } + @Override + public int getEnergyConsumption() { + return 25; + } - @Override - public int getRadius() { - return 3; - } + @Override + public int getRadius() { + return 3; + } - @Override - public int getSpeed() { - return 3; - } + @Override + public int getSpeed() { + return 3; + } - }.register(plugin); + }.register(plugin); - new CropGrowthAccelerator(categories.electricity, SlimefunItems.CROP_GROWTH_ACCELERATOR_2, RecipeType.ENHANCED_CRAFTING_TABLE, - new ItemStack[] {null, SlimefunItems.BLISTERING_INGOT_3, null, SlimefunItems.ELECTRIC_MOTOR, SlimefunItems.CROP_GROWTH_ACCELERATOR, SlimefunItems.ELECTRIC_MOTOR, SlimefunItems.ELECTRO_MAGNET, SlimefunItems.ADVANCED_CIRCUIT_BOARD, SlimefunItems.ELECTRO_MAGNET}) { + new CropGrowthAccelerator(categories.electricity, SlimefunItems.CROP_GROWTH_ACCELERATOR_2, RecipeType.ENHANCED_CRAFTING_TABLE, + new ItemStack[] {null, SlimefunItems.BLISTERING_INGOT_3, null, SlimefunItems.ELECTRIC_MOTOR, SlimefunItems.CROP_GROWTH_ACCELERATOR, SlimefunItems.ELECTRIC_MOTOR, SlimefunItems.ELECTRO_MAGNET, SlimefunItems.ADVANCED_CIRCUIT_BOARD, SlimefunItems.ELECTRO_MAGNET}) { - @Override - public int getEnergyConsumption() { - return 30; - } + @Override + public int getEnergyConsumption() { + return 30; + } - @Override - public int getRadius() { - return 4; - } + @Override + public int getRadius() { + return 4; + } - @Override - public int getSpeed() { - return 4; - } + @Override + public int getSpeed() { + return 4; + } - }.register(plugin); + }.register(plugin); - new Freezer(categories.electricity, SlimefunItems.FREEZER, RecipeType.ENHANCED_CRAFTING_TABLE, - new ItemStack[] {null, SlimefunItems.SILVER_INGOT, null, SlimefunItems.ELECTRIC_MOTOR, new ItemStack(Material.PACKED_ICE), SlimefunItems.ELECTRIC_MOTOR, SlimefunItems.COOLING_UNIT, SlimefunItems.MEDIUM_CAPACITOR, SlimefunItems.COOLING_UNIT}) { - - @Override - public int getEnergyConsumption() { - return 9; - } + new Freezer(categories.electricity, SlimefunItems.FREEZER, RecipeType.ENHANCED_CRAFTING_TABLE, + new ItemStack[] {null, SlimefunItems.SILVER_INGOT, null, SlimefunItems.ELECTRIC_MOTOR, new ItemStack(Material.PACKED_ICE), SlimefunItems.ELECTRIC_MOTOR, SlimefunItems.COOLING_UNIT, SlimefunItems.MEDIUM_CAPACITOR, SlimefunItems.COOLING_UNIT}) { + + @Override + public int getEnergyConsumption() { + return 9; + } - @Override - public int getSpeed() { - return 1; - } + @Override + public int getSpeed() { + return 1; + } - }.register(plugin); + }.register(plugin); - new Freezer(categories.electricity, SlimefunItems.FREEZER_2, RecipeType.ENHANCED_CRAFTING_TABLE, - new ItemStack[] {null, SlimefunItems.SILVER_INGOT, null, SlimefunItems.ELECTRO_MAGNET, SlimefunItems.FREEZER, SlimefunItems.ELECTRO_MAGNET, SlimefunItems.COOLING_UNIT, SlimefunItems.ALUMINUM_BRASS_INGOT, SlimefunItems.COOLING_UNIT}) { + new Freezer(categories.electricity, SlimefunItems.FREEZER_2, RecipeType.ENHANCED_CRAFTING_TABLE, + new ItemStack[] {null, SlimefunItems.SILVER_INGOT, null, SlimefunItems.ELECTRO_MAGNET, SlimefunItems.FREEZER, SlimefunItems.ELECTRO_MAGNET, SlimefunItems.COOLING_UNIT, SlimefunItems.ALUMINUM_BRASS_INGOT, SlimefunItems.COOLING_UNIT}) { - @Override - public int getEnergyConsumption() { - return 15; - } + @Override + public int getEnergyConsumption() { + return 15; + } - @Override - public int getSpeed() { - return 2; - } + @Override + public int getSpeed() { + return 2; + } - }.register(plugin); + }.register(plugin); - 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 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 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, 8)) - .register(plugin); + 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, 8)) + .register(plugin); - new RadioactiveItem(categories.resources, Radioactivity.HIGH, SlimefunItems.NEPTUNIUM, RecipeType.NUCLEAR_REACTOR, - new ItemStack[] {SlimefunItems.URANIUM, null, null, null, null, null, null, null, null}) - .register(plugin); + new RadioactiveItem(categories.resources, Radioactivity.HIGH, SlimefunItems.NEPTUNIUM, RecipeType.NUCLEAR_REACTOR, + new ItemStack[] {SlimefunItems.URANIUM, null, null, null, null, null, null, null, null}) + .register(plugin); - new RadioactiveItem(categories.resources, Radioactivity.VERY_HIGH, SlimefunItems.PLUTONIUM, RecipeType.NUCLEAR_REACTOR, - new ItemStack[] {SlimefunItems.NEPTUNIUM, null, null, null, null, null, null, null, null}) - .register(plugin); + new RadioactiveItem(categories.resources, Radioactivity.VERY_HIGH, SlimefunItems.PLUTONIUM, RecipeType.NUCLEAR_REACTOR, + new ItemStack[] {SlimefunItems.NEPTUNIUM, null, null, null, null, null, null, null, null}) + .register(plugin); - new RadioactiveItem(categories.resources, Radioactivity.VERY_HIGH, SlimefunItems.BOOSTED_URANIUM, RecipeType.HEATED_PRESSURE_CHAMBER, - new ItemStack[] {SlimefunItems.PLUTONIUM, SlimefunItems.URANIUM, null, null, null, null, null, null, null}) - .register(plugin); + new RadioactiveItem(categories.resources, Radioactivity.VERY_HIGH, SlimefunItems.BOOSTED_URANIUM, RecipeType.HEATED_PRESSURE_CHAMBER, + new ItemStack[] {SlimefunItems.PLUTONIUM, SlimefunItems.URANIUM, null, null, null, null, null, null, null}) + .register(plugin); - new NuclearReactor(categories.electricity, SlimefunItems.NUCLEAR_REACTOR, RecipeType.ENHANCED_CRAFTING_TABLE, - new ItemStack[] {SlimefunItems.BLISTERING_INGOT_3, SlimefunItems.CARBONADO_EDGED_CAPACITOR, SlimefunItems.BLISTERING_INGOT_3, SlimefunItems.REINFORCED_PLATE, SlimefunItems.COOLING_UNIT, SlimefunItems.REINFORCED_PLATE, SlimefunItems.LEAD_INGOT, SlimefunItems.REINFORCED_PLATE, SlimefunItems.LEAD_INGOT}){ - - @Override - public int getEnergyProduction() { - return 250; - } + new NuclearReactor(categories.electricity, SlimefunItems.NUCLEAR_REACTOR, RecipeType.ENHANCED_CRAFTING_TABLE, + new ItemStack[] {SlimefunItems.BLISTERING_INGOT_3, SlimefunItems.CARBONADO_EDGED_CAPACITOR, SlimefunItems.BLISTERING_INGOT_3, SlimefunItems.REINFORCED_PLATE, SlimefunItems.COOLING_UNIT, SlimefunItems.REINFORCED_PLATE, SlimefunItems.LEAD_INGOT, SlimefunItems.REINFORCED_PLATE, SlimefunItems.LEAD_INGOT}){ + + @Override + public int getEnergyProduction() { + return 250; + } - @Override - public int getCapacity() { - return 16384; - } - - }.register(plugin); + @Override + public int getCapacity() { + return 16384; + } + + }.register(plugin); - new NetherStarReactor(categories.electricity, SlimefunItems.NETHER_STAR_REACTOR, RecipeType.ENHANCED_CRAFTING_TABLE, - new ItemStack[] {SlimefunItems.BOOSTED_URANIUM, SlimefunItems.CARBONADO_EDGED_CAPACITOR, SlimefunItems.BOOSTED_URANIUM, SlimefunItems.REINFORCED_PLATE, new ItemStack(Material.NETHER_STAR), SlimefunItems.REINFORCED_PLATE, SlimefunItems.CORINTHIAN_BRONZE_INGOT, SlimefunItems.REINFORCED_PLATE, SlimefunItems.CORINTHIAN_BRONZE_INGOT}){ + new NetherStarReactor(categories.electricity, SlimefunItems.NETHER_STAR_REACTOR, RecipeType.ENHANCED_CRAFTING_TABLE, + new ItemStack[] {SlimefunItems.BOOSTED_URANIUM, SlimefunItems.CARBONADO_EDGED_CAPACITOR, SlimefunItems.BOOSTED_URANIUM, SlimefunItems.REINFORCED_PLATE, new ItemStack(Material.NETHER_STAR), SlimefunItems.REINFORCED_PLATE, SlimefunItems.CORINTHIAN_BRONZE_INGOT, SlimefunItems.REINFORCED_PLATE, SlimefunItems.CORINTHIAN_BRONZE_INGOT}){ - @Override - public int getEnergyProduction() { - return 512; - } + @Override + public int getEnergyProduction() { + return 512; + } - @Override - public int getCapacity() { - return 32768; - } + @Override + public int getCapacity() { + return 32768; + } - }.register(plugin); + }.register(plugin); - new SlimefunItem(categories.cargo, SlimefunItems.CARGO_MOTOR, RecipeType.ENHANCED_CRAFTING_TABLE, - new ItemStack[] {SlimefunItems.HARDENED_GLASS, SlimefunItems.ELECTRO_MAGNET, SlimefunItems.HARDENED_GLASS, SlimefunItems.SILVER_INGOT, SlimefunItems.ELECTRIC_MOTOR, SlimefunItems.SILVER_INGOT, SlimefunItems.HARDENED_GLASS, SlimefunItems.ELECTRO_MAGNET, SlimefunItems.HARDENED_GLASS}, - new SlimefunItemStack(SlimefunItems.CARGO_MOTOR, 4)) - .register(plugin); + new SlimefunItem(categories.cargo, SlimefunItems.CARGO_MOTOR, RecipeType.ENHANCED_CRAFTING_TABLE, + new ItemStack[] {SlimefunItems.HARDENED_GLASS, SlimefunItems.ELECTRO_MAGNET, SlimefunItems.HARDENED_GLASS, SlimefunItems.SILVER_INGOT, SlimefunItems.ELECTRIC_MOTOR, SlimefunItems.SILVER_INGOT, SlimefunItems.HARDENED_GLASS, SlimefunItems.ELECTRO_MAGNET, SlimefunItems.HARDENED_GLASS}, + new SlimefunItemStack(SlimefunItems.CARGO_MOTOR, 4)) + .register(plugin); - new CargoManager(categories.cargo, SlimefunItems.CARGO_MANAGER, RecipeType.ENHANCED_CRAFTING_TABLE, - new ItemStack[] {null, SlimefunItems.HOLOGRAM_PROJECTOR, null, SlimefunItems.REINFORCED_PLATE, SlimefunItems.CARGO_MOTOR, SlimefunItems.REINFORCED_PLATE, SlimefunItems.ALUMINUM_BRONZE_INGOT, SlimefunItems.ANDROID_MEMORY_CORE, SlimefunItems.ALUMINUM_BRONZE_INGOT}) - .register(plugin); + new CargoManager(categories.cargo, SlimefunItems.CARGO_MANAGER, RecipeType.ENHANCED_CRAFTING_TABLE, + new ItemStack[] {null, SlimefunItems.HOLOGRAM_PROJECTOR, null, SlimefunItems.REINFORCED_PLATE, SlimefunItems.CARGO_MOTOR, SlimefunItems.REINFORCED_PLATE, SlimefunItems.ALUMINUM_BRONZE_INGOT, SlimefunItems.ANDROID_MEMORY_CORE, SlimefunItems.ALUMINUM_BRONZE_INGOT}) + .register(plugin); - new CargoConnectorNode(categories.cargo, SlimefunItems.CARGO_CONNECTOR_NODE, RecipeType.ENHANCED_CRAFTING_TABLE, - new ItemStack[] {SlimefunItems.BRONZE_INGOT, SlimefunItems.SILVER_INGOT, SlimefunItems.BRONZE_INGOT, SlimefunItems.SILVER_INGOT, SlimefunItems.CARGO_MOTOR, SlimefunItems.SILVER_INGOT, SlimefunItems.BRONZE_INGOT, SlimefunItems.SILVER_INGOT, SlimefunItems.BRONZE_INGOT}, - new SlimefunItemStack(SlimefunItems.CARGO_CONNECTOR_NODE, 4)) - .register(plugin); + new CargoConnectorNode(categories.cargo, SlimefunItems.CARGO_CONNECTOR_NODE, RecipeType.ENHANCED_CRAFTING_TABLE, + new ItemStack[] {SlimefunItems.BRONZE_INGOT, SlimefunItems.SILVER_INGOT, SlimefunItems.BRONZE_INGOT, SlimefunItems.SILVER_INGOT, SlimefunItems.CARGO_MOTOR, SlimefunItems.SILVER_INGOT, SlimefunItems.BRONZE_INGOT, SlimefunItems.SILVER_INGOT, SlimefunItems.BRONZE_INGOT}, + new SlimefunItemStack(SlimefunItems.CARGO_CONNECTOR_NODE, 4)) + .register(plugin); - new CargoInputNode(categories.cargo, SlimefunItems.CARGO_INPUT_NODE, RecipeType.ENHANCED_CRAFTING_TABLE, - new ItemStack[] {null, new ItemStack(Material.HOPPER), null, SlimefunItems.BILLON_INGOT, SlimefunItems.CARGO_CONNECTOR_NODE, SlimefunItems.BILLON_INGOT, null, new ItemStack(Material.HOPPER), null}, - new SlimefunItemStack(SlimefunItems.CARGO_INPUT_NODE, 2)) - .register(plugin); + new CargoInputNode(categories.cargo, SlimefunItems.CARGO_INPUT_NODE, RecipeType.ENHANCED_CRAFTING_TABLE, + new ItemStack[] {null, new ItemStack(Material.HOPPER), null, SlimefunItems.BILLON_INGOT, SlimefunItems.CARGO_CONNECTOR_NODE, SlimefunItems.BILLON_INGOT, null, new ItemStack(Material.HOPPER), null}, + new SlimefunItemStack(SlimefunItems.CARGO_INPUT_NODE, 2)) + .register(plugin); - new CargoOutputNode(categories.cargo, SlimefunItems.CARGO_OUTPUT_NODE, RecipeType.ENHANCED_CRAFTING_TABLE, - new ItemStack[] {null, new ItemStack(Material.HOPPER), null, SlimefunItems.BRASS_INGOT, SlimefunItems.CARGO_CONNECTOR_NODE, SlimefunItems.BRASS_INGOT, null, new ItemStack(Material.HOPPER), null}, - new SlimefunItemStack(SlimefunItems.CARGO_OUTPUT_NODE, 2)) - .register(plugin); + new CargoOutputNode(categories.cargo, SlimefunItems.CARGO_OUTPUT_NODE, RecipeType.ENHANCED_CRAFTING_TABLE, + new ItemStack[] {null, new ItemStack(Material.HOPPER), null, SlimefunItems.BRASS_INGOT, SlimefunItems.CARGO_CONNECTOR_NODE, SlimefunItems.BRASS_INGOT, null, new ItemStack(Material.HOPPER), null}, + new SlimefunItemStack(SlimefunItems.CARGO_OUTPUT_NODE, 2)) + .register(plugin); - new AdvancedCargoOutputNode(categories.cargo, SlimefunItems.CARGO_OUTPUT_NODE_2, RecipeType.ENHANCED_CRAFTING_TABLE, - new ItemStack[] {null, SlimefunItems.CARGO_MOTOR, null, SlimefunItems.COBALT_INGOT, SlimefunItems.CARGO_OUTPUT_NODE, SlimefunItems.COBALT_INGOT, null, SlimefunItems.CARGO_MOTOR, null}) - .register(plugin); + new AdvancedCargoOutputNode(categories.cargo, SlimefunItems.CARGO_OUTPUT_NODE_2, RecipeType.ENHANCED_CRAFTING_TABLE, + new ItemStack[] {null, SlimefunItems.CARGO_MOTOR, null, SlimefunItems.COBALT_INGOT, SlimefunItems.CARGO_OUTPUT_NODE, SlimefunItems.COBALT_INGOT, null, SlimefunItems.CARGO_MOTOR, null}) + .register(plugin); - new AutomatedCraftingChamber(categories.electricity, SlimefunItems.AUTOMATED_CRAFTING_CHAMBER, RecipeType.ENHANCED_CRAFTING_TABLE, - new ItemStack[] {null, new ItemStack(Material.CRAFTING_TABLE), null, SlimefunItems.CARGO_MOTOR, SlimefunItems.BLISTERING_INGOT_3, SlimefunItems.CARGO_MOTOR, null, SlimefunItems.ELECTRIC_MOTOR, null}) { + new AutomatedCraftingChamber(categories.electricity, SlimefunItems.AUTOMATED_CRAFTING_CHAMBER, RecipeType.ENHANCED_CRAFTING_TABLE, + new ItemStack[] {null, new ItemStack(Material.CRAFTING_TABLE), null, SlimefunItems.CARGO_MOTOR, SlimefunItems.BLISTERING_INGOT_3, SlimefunItems.CARGO_MOTOR, null, SlimefunItems.ELECTRIC_MOTOR, null}) { - @Override - public int getEnergyConsumption() { - return 10; - } + @Override + public int getEnergyConsumption() { + return 10; + } - @Override - public int getCapacity() { - return 256; - } + @Override + public int getCapacity() { + return 256; + } - }.register(plugin); + }.register(plugin); - new ReactorAccessPort(categories.cargo, SlimefunItems.REACTOR_ACCESS_PORT, RecipeType.ENHANCED_CRAFTING_TABLE, - new ItemStack[] {null, SlimefunItems.BLISTERING_INGOT_3, null, SlimefunItems.LEAD_INGOT, SlimefunItems.CARGO_MOTOR, SlimefunItems.LEAD_INGOT, null, SlimefunItems.ELECTRIC_MOTOR, null}) - .register(plugin); + new ReactorAccessPort(categories.cargo, SlimefunItems.REACTOR_ACCESS_PORT, RecipeType.ENHANCED_CRAFTING_TABLE, + new ItemStack[] {null, SlimefunItems.BLISTERING_INGOT_3, null, SlimefunItems.LEAD_INGOT, SlimefunItems.CARGO_MOTOR, SlimefunItems.LEAD_INGOT, null, SlimefunItems.ELECTRIC_MOTOR, null}) + .register(plugin); - new FluidPump(categories.electricity, SlimefunItems.FLUID_PUMP, RecipeType.ENHANCED_CRAFTING_TABLE, - new ItemStack[] {null, SlimefunItems.MEDIUM_CAPACITOR, null, new ItemStack(Material.BUCKET), SlimefunItems.CARGO_MOTOR, new ItemStack(Material.BUCKET), null, SlimefunItems.OIL_PUMP, null}) - .register(plugin); + new FluidPump(categories.electricity, SlimefunItems.FLUID_PUMP, RecipeType.ENHANCED_CRAFTING_TABLE, + new ItemStack[] {null, SlimefunItems.MEDIUM_CAPACITOR, null, new ItemStack(Material.BUCKET), SlimefunItems.CARGO_MOTOR, new ItemStack(Material.BUCKET), null, SlimefunItems.OIL_PUMP, null}) + .register(plugin); - new TrashCan(categories.cargo, SlimefunItems.TRASH_CAN, RecipeType.ENHANCED_CRAFTING_TABLE, - new ItemStack[] {null, SlimefunItems.PORTABLE_DUSTBIN, null, SlimefunItems.LEAD_INGOT, SlimefunItems.CARGO_MOTOR, SlimefunItems.LEAD_INGOT, SlimefunItems.ALUMINUM_INGOT, SlimefunItems.LEAD_INGOT, SlimefunItems.ALUMINUM_INGOT}) - .register(plugin); + new TrashCan(categories.cargo, SlimefunItems.TRASH_CAN, RecipeType.ENHANCED_CRAFTING_TABLE, + new ItemStack[] {null, SlimefunItems.PORTABLE_DUSTBIN, null, SlimefunItems.LEAD_INGOT, SlimefunItems.CARGO_MOTOR, SlimefunItems.LEAD_INGOT, SlimefunItems.ALUMINUM_INGOT, SlimefunItems.LEAD_INGOT, SlimefunItems.ALUMINUM_INGOT}) + .register(plugin); - new CarbonPress(categories.electricity, SlimefunItems.CARBON_PRESS, RecipeType.ENHANCED_CRAFTING_TABLE, - new ItemStack[] {SlimefunItems.CARBON, SlimefunItems.ELECTRIC_MOTOR, SlimefunItems.CARBON, SlimefunItems.CARBON, SlimefunItems.HEATED_PRESSURE_CHAMBER, SlimefunItems.CARBON, SlimefunItems.HEATING_COIL, SlimefunItems.CARBONADO, SlimefunItems.HEATING_COIL}) { + new CarbonPress(categories.electricity, SlimefunItems.CARBON_PRESS, RecipeType.ENHANCED_CRAFTING_TABLE, + new ItemStack[] {SlimefunItems.CARBON, SlimefunItems.ELECTRIC_MOTOR, SlimefunItems.CARBON, SlimefunItems.CARBON, SlimefunItems.HEATED_PRESSURE_CHAMBER, SlimefunItems.CARBON, SlimefunItems.HEATING_COIL, SlimefunItems.CARBONADO, SlimefunItems.HEATING_COIL}) { - @Override - public int getEnergyConsumption() { - return 10; - } + @Override + public int getEnergyConsumption() { + return 10; + } - @Override - public int getCapacity() { - return 256; - } + @Override + public int getCapacity() { + return 256; + } - @Override - public int getSpeed() { - return 1; - } + @Override + public int getSpeed() { + return 1; + } - }.register(plugin); + }.register(plugin); - new CarbonPress(categories.electricity, SlimefunItems.CARBON_PRESS_2, RecipeType.ENHANCED_CRAFTING_TABLE, - new ItemStack[] {SlimefunItems.CARBONADO, SlimefunItems.ELECTRIC_MOTOR, SlimefunItems.CARBONADO, SlimefunItems.CARBON, SlimefunItems.CARBON_PRESS, SlimefunItems.CARBON, SlimefunItems.HEATING_COIL, SlimefunItems.ELECTRO_MAGNET, SlimefunItems.HEATING_COIL}) { + new CarbonPress(categories.electricity, SlimefunItems.CARBON_PRESS_2, RecipeType.ENHANCED_CRAFTING_TABLE, + new ItemStack[] {SlimefunItems.CARBONADO, SlimefunItems.ELECTRIC_MOTOR, SlimefunItems.CARBONADO, SlimefunItems.CARBON, SlimefunItems.CARBON_PRESS, SlimefunItems.CARBON, SlimefunItems.HEATING_COIL, SlimefunItems.ELECTRO_MAGNET, SlimefunItems.HEATING_COIL}) { - @Override - public int getEnergyConsumption() { - return 25; - } + @Override + public int getEnergyConsumption() { + return 25; + } - @Override - public int getCapacity() { - return 512; - } + @Override + public int getCapacity() { + return 512; + } - @Override - public int getSpeed() { - return 3; - } + @Override + public int getSpeed() { + return 3; + } - }.register(plugin); + }.register(plugin); - new CarbonPress(categories.electricity, SlimefunItems.CARBON_PRESS_3, RecipeType.ENHANCED_CRAFTING_TABLE, - new ItemStack[] {SlimefunItems.CARBONADO, SlimefunItems.ELECTRIC_MOTOR, SlimefunItems.CARBONADO, SlimefunItems.REINFORCED_ALLOY_INGOT, SlimefunItems.CARBON_PRESS_2, SlimefunItems.REINFORCED_ALLOY_INGOT, SlimefunItems.HEATING_COIL, SlimefunItems.ELECTRO_MAGNET, SlimefunItems.HEATING_COIL}) { + new CarbonPress(categories.electricity, SlimefunItems.CARBON_PRESS_3, RecipeType.ENHANCED_CRAFTING_TABLE, + new ItemStack[] {SlimefunItems.CARBONADO, SlimefunItems.ELECTRIC_MOTOR, SlimefunItems.CARBONADO, SlimefunItems.REINFORCED_ALLOY_INGOT, SlimefunItems.CARBON_PRESS_2, SlimefunItems.REINFORCED_ALLOY_INGOT, SlimefunItems.HEATING_COIL, SlimefunItems.ELECTRO_MAGNET, SlimefunItems.HEATING_COIL}) { - @Override - public int getEnergyConsumption() { - return 90; - } + @Override + public int getEnergyConsumption() { + return 90; + } - @Override - public int getCapacity() { - return 512; - } + @Override + public int getCapacity() { + return 512; + } - @Override - public int getSpeed() { - return 15; - } + @Override + public int getSpeed() { + return 15; + } - }.register(plugin); + }.register(plugin); - new ElectricSmeltery(categories.electricity, SlimefunItems.ELECTRIC_SMELTERY, RecipeType.ENHANCED_CRAFTING_TABLE, - new ItemStack[] {new ItemStack(Material.NETHER_BRICKS), SlimefunItems.ELECTRIC_MOTOR, new ItemStack(Material.NETHER_BRICKS), SlimefunItems.HEATING_COIL, SlimefunItems.ELECTRIC_INGOT_FACTORY, SlimefunItems.HEATING_COIL, SlimefunItems.GILDED_IRON, SlimefunItems.ELECTRIC_MOTOR, SlimefunItems.GILDED_IRON}) { + new ElectricSmeltery(categories.electricity, SlimefunItems.ELECTRIC_SMELTERY, RecipeType.ENHANCED_CRAFTING_TABLE, + new ItemStack[] {new ItemStack(Material.NETHER_BRICKS), SlimefunItems.ELECTRIC_MOTOR, new ItemStack(Material.NETHER_BRICKS), SlimefunItems.HEATING_COIL, SlimefunItems.ELECTRIC_INGOT_FACTORY, SlimefunItems.HEATING_COIL, SlimefunItems.GILDED_IRON, SlimefunItems.ELECTRIC_MOTOR, SlimefunItems.GILDED_IRON}) { - @Override - public int getEnergyConsumption() { - return 10; - } + @Override + public int getEnergyConsumption() { + return 10; + } - @Override - public int getCapacity() { - return 512; - } + @Override + public int getCapacity() { + return 512; + } - @Override - public int getSpeed() { - return 1; - } + @Override + public int getSpeed() { + return 1; + } - }.register(plugin); + }.register(plugin); - new ElectricSmeltery(categories.electricity, SlimefunItems.ELECTRIC_SMELTERY_2, RecipeType.ENHANCED_CRAFTING_TABLE, - new ItemStack[] {SlimefunItems.DAMASCUS_STEEL_INGOT, SlimefunItems.POWER_CRYSTAL, SlimefunItems.DAMASCUS_STEEL_INGOT, SlimefunItems.HEATING_COIL, SlimefunItems.ELECTRIC_SMELTERY, SlimefunItems.HEATING_COIL, SlimefunItems.GILDED_IRON, SlimefunItems.ELECTRIC_MOTOR, SlimefunItems.GILDED_IRON}) { - - @Override - public int getEnergyConsumption() { - return 20; - } + new ElectricSmeltery(categories.electricity, SlimefunItems.ELECTRIC_SMELTERY_2, RecipeType.ENHANCED_CRAFTING_TABLE, + new ItemStack[] {SlimefunItems.DAMASCUS_STEEL_INGOT, SlimefunItems.POWER_CRYSTAL, SlimefunItems.DAMASCUS_STEEL_INGOT, SlimefunItems.HEATING_COIL, SlimefunItems.ELECTRIC_SMELTERY, SlimefunItems.HEATING_COIL, SlimefunItems.GILDED_IRON, SlimefunItems.ELECTRIC_MOTOR, SlimefunItems.GILDED_IRON}) { + + @Override + public int getEnergyConsumption() { + return 20; + } - @Override - public int getCapacity() { - return 1024; - } + @Override + public int getCapacity() { + return 1024; + } - @Override - public int getSpeed() { - return 3; - } + @Override + public int getSpeed() { + return 3; + } - }.register(plugin); + }.register(plugin); new IronGolemAssembler(categories.electricity, SlimefunItems.IRON_GOLEM_ASSEMBLER, RecipeType.ENHANCED_CRAFTING_TABLE, new ItemStack[] {SlimefunItems.BLISTERING_INGOT_3, SlimefunItems.ADVANCED_CIRCUIT_BOARD, SlimefunItems.BLISTERING_INGOT_3, new ItemStack(Material.IRON_BLOCK), SlimefunItems.ANDROID_MEMORY_CORE, new ItemStack(Material.IRON_BLOCK), SlimefunItems.ELECTRIC_MOTOR, SlimefunItems.REINFORCED_ALLOY_INGOT, SlimefunItems.CARBONADO_EDGED_CAPACITOR}) .register(plugin); - 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); - } - } + 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, PotionEffect[][] effects, SlimefunAddon addon) { + private static void registerArmorSet(Category category, ItemStack baseComponent, ItemStack[] items, String idSyntax, boolean vanilla, PotionEffect[][] effects, SlimefunAddon addon) { String[] components = new String[] { "_HELMET", "_CHESTPLATE", "_LEGGINGS", "_BOOTS" }; List recipes = new ArrayList<>(); From 923b59c6e7042ab333be0e32e9e9835e61a3e33c Mon Sep 17 00:00:00 2001 From: TheBusyBiscuit Date: Tue, 11 Aug 2020 16:28:52 +0200 Subject: [PATCH 53/81] [CI skip] Reduced technical debt --- .../implementation/SlimefunItems.java | 29 ++++++++++--------- .../implementation/items/geo/GEOMiner.java | 3 +- .../implementation/setup/ResearchSetup.java | 2 +- .../setup/SlimefunItemSetup.java | 2 +- .../Slimefun/Lists/SlimefunItems.java | 8 ++--- 5 files changed, 22 insertions(+), 22 deletions(-) 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 4953a736f..b347a66d5 100644 --- a/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/SlimefunItems.java +++ b/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/SlimefunItems.java @@ -286,10 +286,10 @@ public final class SlimefunItems { public static final SlimefunItemStack GILDED_IRON_LEGGINGS = new SlimefunItemStack("GILDED_IRON_LEGGINGS", Material.GOLDEN_LEGGINGS, "&6Gilded Iron Leggings"); public static final SlimefunItemStack GILDED_IRON_BOOTS = new SlimefunItemStack("GILDED_IRON_BOOTS", Material.GOLDEN_BOOTS, "&6Gilded Iron Boots"); - public static final SlimefunItemStack GOLD_HELMET = new SlimefunItemStack("GOLD_12K_HELMET", Material.GOLDEN_HELMET, "&6Gold Helmet", "&912-Carat"); - public static final SlimefunItemStack GOLD_CHESTPLATE = new SlimefunItemStack("GOLD_12K_CHESTPLATE", Material.GOLDEN_CHESTPLATE, "&6Gold Chestplate", "&912-Carat"); - public static final SlimefunItemStack GOLD_LEGGINGS = new SlimefunItemStack("GOLD_12K_LEGGINGS", Material.GOLDEN_LEGGINGS, "&6Gold Leggings", "&912-Carat"); - public static final SlimefunItemStack GOLD_BOOTS = new SlimefunItemStack("GOLD_12K_BOOTS", Material.GOLDEN_BOOTS, "&6Gold Boots", "&912-Carat"); + public static final SlimefunItemStack GOLDEN_HELMET_12K = new SlimefunItemStack("GOLD_12K_HELMET", Material.GOLDEN_HELMET, "&6Golden Helmet &7(12-Carat)"); + public static final SlimefunItemStack GOLDEN_CHESTPLATE_12K = new SlimefunItemStack("GOLD_12K_CHESTPLATE", Material.GOLDEN_CHESTPLATE, "&6Golden Chestplate &7(12-Carat)"); + public static final SlimefunItemStack GOLDEN_LEGGINGS_12K = new SlimefunItemStack("GOLD_12K_LEGGINGS", Material.GOLDEN_LEGGINGS, "&6Golden Leggings &7(12-Carat)"); + public static final SlimefunItemStack GOLDEN_BOOTS_12K = new SlimefunItemStack("GOLD_12K_BOOTS", Material.GOLDEN_BOOTS, "&6Golden Boots &7(12-Carat)"); public static final SlimefunItemStack SLIME_HELMET_STEEL = new SlimefunItemStack("SLIME_STEEL_HELMET", Material.IRON_HELMET, "&a&lSlime Helmet", "&7&oReinforced", "", "&a&oBouncy Feeling"); public static final SlimefunItemStack SLIME_CHESTPLATE_STEEL = new SlimefunItemStack("SLIME_STEEL_CHESTPLATE", Material.IRON_CHESTPLATE, "&a&lSlime Chestplate", "&7&oReinforced", "", "&a&oBouncy Feeling"); @@ -335,10 +335,10 @@ public final class SlimefunItems { GILDED_IRON_LEGGINGS.addUnsafeEnchantments(gilded); GILDED_IRON_BOOTS.addUnsafeEnchantments(gilded); - GOLD_HELMET.addUnsafeEnchantment(Enchantment.DURABILITY, 10); - GOLD_CHESTPLATE.addUnsafeEnchantment(Enchantment.DURABILITY, 10); - GOLD_LEGGINGS.addUnsafeEnchantment(Enchantment.DURABILITY, 10); - GOLD_BOOTS.addUnsafeEnchantment(Enchantment.DURABILITY, 10); + GOLDEN_HELMET_12K.addUnsafeEnchantment(Enchantment.DURABILITY, 10); + GOLDEN_CHESTPLATE_12K.addUnsafeEnchantment(Enchantment.DURABILITY, 10); + GOLDEN_LEGGINGS_12K.addUnsafeEnchantment(Enchantment.DURABILITY, 10); + GOLDEN_BOOTS_12K.addUnsafeEnchantment(Enchantment.DURABILITY, 10); Map slime = new HashMap<>(); slime.put(Enchantment.DURABILITY, 4); @@ -406,12 +406,13 @@ public final class SlimefunItems { public static final SlimefunItemStack ANCIENT_ALTAR = new SlimefunItemStack("ANCIENT_ALTAR", Material.ENCHANTING_TABLE, "&dAncient Altar", "", "&5Multi-Block Altar for", "&5magical Crafting Processes"); public static final SlimefunItemStack COPPER_WIRE = new SlimefunItemStack("COPPER_WIRE", Material.STRING, "&6Copper Wire", "", "&6Crucial component in electric modules"); - public static final SlimefunItemStack RAINBOW_WOOL = new SlimefunItemStack("RAINBOW_WOOL", Material.WHITE_WOOL, "&5Rainbow Wool", "", "&dCycles through all Colors of the Rainbow!"); - public static final SlimefunItemStack RAINBOW_GLASS = new SlimefunItemStack("RAINBOW_GLASS", Material.WHITE_STAINED_GLASS, "&5Rainbow Glass", "", "&dCycles through all Colors of the Rainbow!"); - public static final SlimefunItemStack RAINBOW_CLAY = new SlimefunItemStack("RAINBOW_CLAY", Material.WHITE_TERRACOTTA, "&5Rainbow Clay", "", "&dCycles through all Colors of the Rainbow!"); - public static final SlimefunItemStack RAINBOW_GLASS_PANE = new SlimefunItemStack("RAINBOW_GLASS_PANE", Material.WHITE_STAINED_GLASS_PANE, "&5Rainbow Glass Pane", "", "&dCycles through all Colors of the Rainbow!"); - public static final SlimefunItemStack RAINBOW_CONCRETE = new SlimefunItemStack("RAINBOW_CONCRETE", Material.WHITE_CONCRETE, "&5Rainbow Concrete", "", "&dCycles through all Colors of the Rainbow!"); - public static final SlimefunItemStack RAINBOW_GLAZED_TERRACOTTA = new SlimefunItemStack("RAINBOW_GLAZED_TERRACOTTA", Material.WHITE_GLAZED_TERRACOTTA, "&5Rainbow Glazed Terracotta", "", "&dCycles through all Colors of the Rainbow!"); + private static final String RAINBOW = "&dCycles through all Colors of the Rainbow!"; + public static final SlimefunItemStack RAINBOW_WOOL = new SlimefunItemStack("RAINBOW_WOOL", Material.WHITE_WOOL, "&5Rainbow Wool", "", RAINBOW); + public static final SlimefunItemStack RAINBOW_GLASS = new SlimefunItemStack("RAINBOW_GLASS", Material.WHITE_STAINED_GLASS, "&5Rainbow Glass", "", RAINBOW); + public static final SlimefunItemStack RAINBOW_CLAY = new SlimefunItemStack("RAINBOW_CLAY", Material.WHITE_TERRACOTTA, "&5Rainbow Clay", "", RAINBOW); + public static final SlimefunItemStack RAINBOW_GLASS_PANE = new SlimefunItemStack("RAINBOW_GLASS_PANE", Material.WHITE_STAINED_GLASS_PANE, "&5Rainbow Glass Pane", "", RAINBOW); + public static final SlimefunItemStack RAINBOW_CONCRETE = new SlimefunItemStack("RAINBOW_CONCRETE", Material.WHITE_CONCRETE, "&5Rainbow Concrete", "", RAINBOW); + public static final SlimefunItemStack RAINBOW_GLAZED_TERRACOTTA = new SlimefunItemStack("RAINBOW_GLAZED_TERRACOTTA", Material.WHITE_GLAZED_TERRACOTTA, "&5Rainbow Glazed Terracotta", "", RAINBOW); /* Seasonal */ private static final String CHRISTMAS = ChatUtils.christmas("[Christmas Edition]"); 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 160d170a4..da8d3c4bf 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 @@ -25,14 +25,13 @@ import me.mrCookieSlime.Slimefun.Lists.RecipeType; import me.mrCookieSlime.Slimefun.Objects.Category; import me.mrCookieSlime.Slimefun.Objects.SlimefunItem.abstractItems.AContainer; import me.mrCookieSlime.Slimefun.Objects.SlimefunItem.abstractItems.MachineRecipe; -import me.mrCookieSlime.Slimefun.Objects.SlimefunItem.interfaces.InventoryBlock; import me.mrCookieSlime.Slimefun.api.BlockStorage; import me.mrCookieSlime.Slimefun.api.SlimefunItemStack; import me.mrCookieSlime.Slimefun.api.energy.ChargableBlock; import me.mrCookieSlime.Slimefun.api.inventory.BlockMenu; import me.mrCookieSlime.Slimefun.api.inventory.BlockMenuPreset; -public abstract class GEOMiner extends AContainer implements InventoryBlock, RecipeDisplayItem { +public abstract class GEOMiner extends AContainer implements RecipeDisplayItem { private static final int[] BORDER = { 0, 1, 2, 3, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 26, 27, 35, 36, 44, 45, 53 }; private static final int[] OUTPUT_BORDER = { 19, 20, 21, 22, 23, 24, 25, 28, 34, 37, 43, 46, 47, 48, 49, 50, 51, 52 }; 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 fa61210c5..f98ec86f9 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 @@ -110,7 +110,7 @@ public final class ResearchSetup { register("redstone_alloy", 84, "Redstone Alloy", 16, SlimefunItems.REDSTONE_ALLOY); register("carbonado_tools", 85, "Top Tier Machines", 24, SlimefunItems.CARBONADO_MULTI_TOOL, SlimefunItems.CARBONADO_JETPACK, SlimefunItems.CARBONADO_JETBOOTS); register("first_aid", 86, "First Aid", 2, SlimefunItems.CLOTH, SlimefunItems.RAG, SlimefunItems.BANDAGE, SlimefunItems.SPLINT, SlimefunItems.TIN_CAN, SlimefunItems.VITAMINS, SlimefunItems.MEDICINE); - register("gold_armor", 87, "Shiny Armor", 13, SlimefunItems.GOLD_HELMET, SlimefunItems.GOLD_CHESTPLATE, SlimefunItems.GOLD_LEGGINGS, SlimefunItems.GOLD_BOOTS); + register("gold_armor", 87, "Shiny Armor", 13, SlimefunItems.GOLDEN_HELMET_12K, SlimefunItems.GOLDEN_CHESTPLATE_12K, SlimefunItems.GOLDEN_LEGGINGS_12K, SlimefunItems.GOLDEN_BOOTS_12K); register("night_vision_googles", 89, "Night Vision Goggles", 10, SlimefunItems.NIGHT_VISION_GOGGLES); register("pickaxe_of_containment", 90, "Pickaxe of Containment", 14, SlimefunItems.PICKAXE_OF_CONTAINMENT, SlimefunItems.BROKEN_SPAWNER); register("hercules_pickaxe", 91, "Hercules Pickaxe", 28, SlimefunItems.HERCULES_PICKAXE); 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 cab9e1e9a..0e5414101 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 @@ -962,7 +962,7 @@ public final class SlimefunItemSetup { .register(plugin); registerArmorSet(categories.armor, SlimefunItems.GOLD_12K, new ItemStack[] { - SlimefunItems.GOLD_HELMET, SlimefunItems.GOLD_CHESTPLATE, SlimefunItems.GOLD_LEGGINGS, SlimefunItems.GOLD_BOOTS + SlimefunItems.GOLDEN_HELMET_12K, SlimefunItems.GOLDEN_CHESTPLATE_12K, SlimefunItems.GOLDEN_LEGGINGS_12K, SlimefunItems.GOLDEN_BOOTS_12K }, "GOLD_12K", false, new PotionEffect[0][0], plugin); new SlimefunItem(categories.misc, SlimefunItems.CLOTH, RecipeType.ENHANCED_CRAFTING_TABLE, diff --git a/src/main/java/me/mrCookieSlime/Slimefun/Lists/SlimefunItems.java b/src/main/java/me/mrCookieSlime/Slimefun/Lists/SlimefunItems.java index 4b8d21ea3..826452ce1 100644 --- a/src/main/java/me/mrCookieSlime/Slimefun/Lists/SlimefunItems.java +++ b/src/main/java/me/mrCookieSlime/Slimefun/Lists/SlimefunItems.java @@ -155,10 +155,10 @@ public final class SlimefunItems { 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; public static final SlimefunItemStack GILDED_IRON_BOOTS = io.github.thebusybiscuit.slimefun4.implementation.SlimefunItems.GILDED_IRON_BOOTS; - public static final SlimefunItemStack GOLD_HELMET = io.github.thebusybiscuit.slimefun4.implementation.SlimefunItems.GOLD_HELMET; - public static final SlimefunItemStack GOLD_CHESTPLATE = io.github.thebusybiscuit.slimefun4.implementation.SlimefunItems.GOLD_CHESTPLATE; - public static final SlimefunItemStack GOLD_LEGGINGS = io.github.thebusybiscuit.slimefun4.implementation.SlimefunItems.GOLD_LEGGINGS; - public static final SlimefunItemStack GOLD_BOOTS = io.github.thebusybiscuit.slimefun4.implementation.SlimefunItems.GOLD_BOOTS; + public static final SlimefunItemStack GOLD_HELMET = io.github.thebusybiscuit.slimefun4.implementation.SlimefunItems.GOLDEN_HELMET_12K; + public static final SlimefunItemStack GOLD_CHESTPLATE = io.github.thebusybiscuit.slimefun4.implementation.SlimefunItems.GOLDEN_CHESTPLATE_12K; + public static final SlimefunItemStack GOLD_LEGGINGS = io.github.thebusybiscuit.slimefun4.implementation.SlimefunItems.GOLDEN_LEGGINGS_12K; + public static final SlimefunItemStack GOLD_BOOTS = io.github.thebusybiscuit.slimefun4.implementation.SlimefunItems.GOLDEN_BOOTS_12K; public static final SlimefunItemStack SLIME_HELMET_STEEL = io.github.thebusybiscuit.slimefun4.implementation.SlimefunItems.SLIME_HELMET_STEEL; public static final SlimefunItemStack SLIME_CHESTPLATE_STEEL = io.github.thebusybiscuit.slimefun4.implementation.SlimefunItems.SLIME_CHESTPLATE_STEEL; public static final SlimefunItemStack SLIME_LEGGINGS_STEEL = io.github.thebusybiscuit.slimefun4.implementation.SlimefunItems.SLIME_LEGGINGS_STEEL; From c0d18c5c89f501da17babc1ff088f83cc5902799 Mon Sep 17 00:00:00 2001 From: TheBusyBiscuit Date: Thu, 13 Aug 2020 21:13:19 +0200 Subject: [PATCH 54/81] Fixes #2217 --- CHANGELOG.md | 1 + .../core/guide/options/ContributorsMenu.java | 6 +++ .../guide/options/PlayerLanguageOption.java | 17 +++++- .../guide/options/SlimefunGuideSettings.java | 5 +- .../core/handlers/EntityInteractHandler.java | 12 ++--- .../implementation/SlimefunPlugin.java | 4 +- .../items/electric/gadgets/MultiTool.java | 53 +++++++++++++------ .../items/magical/MagicalZombiePills.java | 10 ++-- ...er.java => EntityInteractionListener.java} | 10 ++-- .../setup/SlimefunItemSetup.java | 3 +- .../slimefun4/utils/HeadTexture.java | 4 +- src/main/resources/languages/messages_en.yml | 14 ++++- 12 files changed, 100 insertions(+), 39 deletions(-) rename src/main/java/io/github/thebusybiscuit/slimefun4/implementation/listeners/{PlayerInteractEntityListener.java => EntityInteractionListener.java} (78%) diff --git a/CHANGELOG.md b/CHANGELOG.md index 870503d15..ec080f206 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -59,6 +59,7 @@ * Fixed #2203 * Fixed #2205 * Fixed #2209 +* Fixed #2217 ## Release Candidate 15 (01 Aug 2020) 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 3b89ff019..df5d74cf0 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 @@ -21,6 +21,12 @@ import io.github.thebusybiscuit.slimefun4.utils.PatternUtils; import io.github.thebusybiscuit.slimefun4.utils.SlimefunUtils; import me.mrCookieSlime.CSCoreLibPlugin.general.Inventory.ChestMenu; +/** + * This menu shows a list of every {@link Contributor} to this project. + * + * @author TheBusyBiscuit + * + */ final class ContributorsMenu { private ContributorsMenu() {} 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 6d55090a2..25bb7ce80 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 @@ -1,5 +1,7 @@ package io.github.thebusybiscuit.slimefun4.core.guide.options; +import java.util.ArrayList; +import java.util.List; import java.util.Optional; import org.bukkit.ChatColor; @@ -8,6 +10,7 @@ import org.bukkit.Sound; import org.bukkit.entity.Player; import org.bukkit.inventory.ItemStack; +import io.github.thebusybiscuit.cscorelib2.chat.ChatColors; import io.github.thebusybiscuit.cscorelib2.data.PersistentDataAPI; import io.github.thebusybiscuit.cscorelib2.item.CustomItem; import io.github.thebusybiscuit.slimefun4.api.SlimefunAddon; @@ -16,6 +19,7 @@ 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.HeadTexture; import io.github.thebusybiscuit.slimefun4.utils.SlimefunUtils; import me.mrCookieSlime.CSCoreLibPlugin.general.Inventory.ChestMenu; @@ -37,7 +41,16 @@ class PlayerLanguageOption implements SlimefunGuideOption { 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.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")); + List lore = new ArrayList<>(); + lore.add(""); + lore.add(ChatColors.color("&e&o") + SlimefunPlugin.getLocalization().getMessage(p, "guide.work-in-progress")); + lore.add(""); + lore.addAll(SlimefunPlugin.getLocalization().getMessages(p, "guide.languages.description")); + lore.add(""); + lore.add("&7\u21E8 &e" + SlimefunPlugin.getLocalization().getMessage(p, "guide.languages.change")); + + ItemStack item = new CustomItem(language.getItem(), "&7" + SlimefunPlugin.getLocalization().getMessage(p, "guide.languages.selected-language") + " &a" + languageName, lore.toArray(new String[0])); + return Optional.of(item); } else { return Optional.empty(); @@ -78,7 +91,7 @@ class PlayerLanguageOption implements SlimefunGuideOption { }); } else if (i == 7) { - 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) -> { + menu.addItem(7, new CustomItem(SlimefunUtils.getCustomHead(HeadTexture.ADD_NEW_LANGUAGE.getTexture()), 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; 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 b65c52b8d..07c3b6153 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 @@ -21,6 +21,7 @@ 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 net.md_5.bungee.api.ChatColor; /** * This static utility class offers various methods that provide access to the @@ -78,7 +79,7 @@ public final class SlimefunGuideSettings { return false; }); - 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(4, new CustomItem(Material.WRITABLE_BOOK, "&aSlimefun Version", "&7&o" + SlimefunPlugin.getLocalization().getMessage(p, "guide.tooltips.versions-notice"), "", "&fMinecraft: &a" + Bukkit.getBukkitVersion(), "&fSlimefun: &a" + SlimefunPlugin.getVersion(), "&fCS-CoreLib: &a" + SlimefunPlugin.getCSCoreLibVersion()), ChestMenuUtils.getEmptyClickHandler()); 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) -> { @@ -110,7 +111,7 @@ public final class SlimefunGuideSettings { menu.addItem(49, ChestMenuUtils.getBackground(), ChestMenuUtils.getEmptyClickHandler()); } - menu.addItem(51, new CustomItem(Material.TOTEM_OF_UNDYING, "&cSoon", "", "&7Something will be added here later..."), (pl, slot, item, action) -> { + menu.addItem(51, new CustomItem(Material.TOTEM_OF_UNDYING, ChatColor.RED + SlimefunPlugin.getLocalization().getMessage(p, "guide.work-in-progress")), (pl, slot, item, action) -> { // Add something here return false; }); diff --git a/src/main/java/io/github/thebusybiscuit/slimefun4/core/handlers/EntityInteractHandler.java b/src/main/java/io/github/thebusybiscuit/slimefun4/core/handlers/EntityInteractHandler.java index 919275888..1d6507902 100644 --- a/src/main/java/io/github/thebusybiscuit/slimefun4/core/handlers/EntityInteractHandler.java +++ b/src/main/java/io/github/thebusybiscuit/slimefun4/core/handlers/EntityInteractHandler.java @@ -3,10 +3,12 @@ package io.github.thebusybiscuit.slimefun4.core.handlers; import org.bukkit.entity.Entity; import org.bukkit.entity.Player; import org.bukkit.event.player.PlayerInteractAtEntityEvent; +import org.bukkit.event.player.PlayerInteractEntityEvent; import org.bukkit.inventory.EquipmentSlot; import org.bukkit.inventory.ItemStack; import io.github.thebusybiscuit.slimefun4.implementation.items.SimpleSlimefunItem; +import io.github.thebusybiscuit.slimefun4.implementation.listeners.EntityInteractionListener; import me.mrCookieSlime.Slimefun.Objects.SlimefunItem.SlimefunItem; import me.mrCookieSlime.Slimefun.Objects.handlers.ItemHandler; @@ -15,9 +17,9 @@ import me.mrCookieSlime.Slimefun.Objects.handlers.ItemHandler; * * @author Linox * + * @see EntityInteractionListener * @see ItemHandler * @see SimpleSlimefunItem - * @see PlayerInteractAtEntityEvent * */ @FunctionalInterface @@ -27,16 +29,14 @@ public interface EntityInteractHandler extends ItemHandler { * This function is triggered when a {@link Player} right clicks with the assigned {@link SlimefunItem} * in his hand. * - * @param p - * The {@link Player} that right clicked - * @param entity - * The {@link Entity} that was right clicked on + * @param e + * The {@link PlayerInteractAtEntityEvent} which was called * @param item * The {@link ItemStack} that was held and used while triggering * @param offHand * true if the {@link EquipmentSlot} is off hand */ - void onInteract(Player p, Entity entity, ItemStack item, boolean offHand); + void onInteract(PlayerInteractEntityEvent e, ItemStack item, boolean offHand); @Override default Class getIdentifier() { diff --git a/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/SlimefunPlugin.java b/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/SlimefunPlugin.java index 75561d0a3..3787d40b9 100644 --- a/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/SlimefunPlugin.java +++ b/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/SlimefunPlugin.java @@ -70,7 +70,7 @@ import io.github.thebusybiscuit.slimefun4.implementation.listeners.ItemPickupLis import io.github.thebusybiscuit.slimefun4.implementation.listeners.MobDropListener; import io.github.thebusybiscuit.slimefun4.implementation.listeners.MultiBlockListener; import io.github.thebusybiscuit.slimefun4.implementation.listeners.PiglinListener; -import io.github.thebusybiscuit.slimefun4.implementation.listeners.PlayerInteractEntityListener; +import io.github.thebusybiscuit.slimefun4.implementation.listeners.EntityInteractionListener; import io.github.thebusybiscuit.slimefun4.implementation.listeners.PlayerProfileListener; import io.github.thebusybiscuit.slimefun4.implementation.listeners.SeismicAxeListener; import io.github.thebusybiscuit.slimefun4.implementation.listeners.SlimefunBootsListener; @@ -441,7 +441,7 @@ public final class SlimefunPlugin extends JavaPlugin implements SlimefunAddon { new FireworksListener(this); new WitherListener(this); new IronGolemListener(this); - new PlayerInteractEntityListener(this); + new EntityInteractionListener(this); new MobDropListener(this); new VillagerTradingListener(this); 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 1f950ff6d..b9cd1696b 100644 --- a/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/items/electric/gadgets/MultiTool.java +++ b/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/items/electric/gadgets/MultiTool.java @@ -11,6 +11,7 @@ import org.bukkit.entity.Player; import org.bukkit.inventory.ItemStack; import io.github.thebusybiscuit.slimefun4.core.attributes.Rechargeable; +import io.github.thebusybiscuit.slimefun4.core.handlers.EntityInteractHandler; import io.github.thebusybiscuit.slimefun4.core.handlers.ItemUseHandler; import io.github.thebusybiscuit.slimefun4.core.handlers.ToolUseHandler; import io.github.thebusybiscuit.slimefun4.implementation.SlimefunPlugin; @@ -42,6 +43,21 @@ public class MultiTool extends SlimefunItem implements Rechargeable { return capacity; } + private int nextIndex(int i) { + int index = i; + + do { + index++; + + if (index >= modes.size()) { + index = 0; + } + } + while (index != i && !modes.get(index).isEnabled()); + + return index; + } + protected ItemUseHandler getItemUseHandler() { return e -> { Player p = e.getPlayer(); @@ -64,29 +80,33 @@ public class MultiTool extends SlimefunItem implements Rechargeable { SlimefunItem selectedItem = modes.get(index).getItem(); String itemName = selectedItem != null ? selectedItem.getItemName() : "Unknown"; - SlimefunPlugin.getLocalization().sendMessage(p, "messages.mode-change", true, msg -> msg.replace("%device%", "Multi Tool").replace("%mode%", ChatColor.stripColor(itemName))); + SlimefunPlugin.getLocalization().sendMessage(p, "messages.multi-tool.mode-change", true, msg -> msg.replace("%device%", "Multi Tool").replace("%mode%", ChatColor.stripColor(itemName))); selectedMode.put(p.getUniqueId(), index); } }; } - private int nextIndex(int i) { - int index = i; - - do { - index++; - - if (index >= modes.size()) { - index = 0; - } - } - while (index != i && !modes.get(index).isEnabled()); - - return index; + private ToolUseHandler getToolUseHandler() { + return (e, tool, fortune, drops) -> { + SlimefunPlugin.getLocalization().sendMessage(e.getPlayer(), "messages.multi-tool.not-shears"); + e.setCancelled(true); + }; } - private ToolUseHandler getToolUseHandler() { - return (e, tool, fortune, drops) -> e.setCancelled(true); + private EntityInteractHandler getEntityInteractionHandler() { + return (e, item, offhand) -> { + // Fixes #2217 - Prevent them from being used to shear entities + switch (e.getRightClicked().getType()) { + case MUSHROOM_COW: + case SHEEP: + case SNOWMAN: + SlimefunPlugin.getLocalization().sendMessage(e.getPlayer(), "messages.multi-tool.not-shears"); + e.setCancelled(true); + break; + default: + break; + } + }; } @Override @@ -95,6 +115,7 @@ public class MultiTool extends SlimefunItem implements Rechargeable { addItemHandler(getItemUseHandler()); addItemHandler(getToolUseHandler()); + addItemHandler(getEntityInteractionHandler()); } } 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 cef452f2f..33f193ef0 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 @@ -1,14 +1,15 @@ package io.github.thebusybiscuit.slimefun4.implementation.items.magical; -import io.github.thebusybiscuit.cscorelib2.inventory.ItemUtils; - import org.bukkit.GameMode; import org.bukkit.Sound; +import org.bukkit.entity.Entity; import org.bukkit.entity.EntityType; +import org.bukkit.entity.Player; import org.bukkit.entity.Villager; import org.bukkit.entity.ZombieVillager; import org.bukkit.inventory.ItemStack; +import io.github.thebusybiscuit.cscorelib2.inventory.ItemUtils; import io.github.thebusybiscuit.slimefun4.api.MinecraftVersion; import io.github.thebusybiscuit.slimefun4.core.handlers.EntityInteractHandler; import io.github.thebusybiscuit.slimefun4.implementation.SlimefunPlugin; @@ -38,8 +39,11 @@ public class MagicalZombiePills extends SimpleSlimefunItem { + return (e, item, offhand) -> { + Entity entity = e.getRightClicked(); + if (entity.getType() == EntityType.ZOMBIE_VILLAGER) { + Player p = e.getPlayer(); if (p.getGameMode() != GameMode.CREATIVE) { ItemUtils.consumeItem(item, false); diff --git a/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/listeners/PlayerInteractEntityListener.java b/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/listeners/EntityInteractionListener.java similarity index 78% rename from src/main/java/io/github/thebusybiscuit/slimefun4/implementation/listeners/PlayerInteractEntityListener.java rename to src/main/java/io/github/thebusybiscuit/slimefun4/implementation/listeners/EntityInteractionListener.java index 2bdc3baec..0372b850d 100644 --- a/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/listeners/PlayerInteractEntityListener.java +++ b/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/listeners/EntityInteractionListener.java @@ -4,7 +4,7 @@ import org.bukkit.entity.Entity; import org.bukkit.entity.Player; import org.bukkit.event.EventHandler; import org.bukkit.event.Listener; -import org.bukkit.event.player.PlayerInteractAtEntityEvent; +import org.bukkit.event.player.PlayerInteractEntityEvent; import org.bukkit.inventory.EquipmentSlot; import org.bukkit.inventory.ItemStack; @@ -21,14 +21,14 @@ import me.mrCookieSlime.Slimefun.api.Slimefun; * @see EntityInteractHandler * */ -public class PlayerInteractEntityListener implements Listener { +public class EntityInteractionListener implements Listener { - public PlayerInteractEntityListener(SlimefunPlugin plugin) { + public EntityInteractionListener(SlimefunPlugin plugin) { plugin.getServer().getPluginManager().registerEvents(this, plugin); } @EventHandler - public void onInteractEntity(PlayerInteractAtEntityEvent e) { + public void onInteractEntity(PlayerInteractEntityEvent e) { if (!e.getRightClicked().isValid()) { return; } @@ -45,7 +45,7 @@ public class PlayerInteractEntityListener implements Listener { SlimefunItem sfItem = SlimefunItem.getByItem(itemStack); if (sfItem != null && Slimefun.hasUnlocked(e.getPlayer(), sfItem, true)) { - sfItem.callItemHandler(EntityInteractHandler.class, handler -> handler.onInteract(e.getPlayer(), e.getRightClicked(), itemStack, e.getHand() == EquipmentSlot.OFF_HAND)); + sfItem.callItemHandler(EntityInteractHandler.class, handler -> handler.onInteract(e, itemStack, e.getHand() == EquipmentSlot.OFF_HAND)); } } } \ No newline at end of file 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 0e5414101..60781232d 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 @@ -181,6 +181,7 @@ 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.HeadTexture; import io.github.thebusybiscuit.slimefun4.utils.SlimefunUtils; import me.mrCookieSlime.Slimefun.Lists.RecipeType; import me.mrCookieSlime.Slimefun.Objects.Category; @@ -384,7 +385,7 @@ public final class SlimefunItemSetup { .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}) + new ItemStack[] {null, null, null, null, new CustomItem(SlimefunUtils.getCustomHead(HeadTexture.IRON_GOLEM.getTexture()), "&aIron Golem"), null, null, null, null}) .register(plugin); new UnplaceableBlock(categories.technicalComponents, SlimefunItems.ADVANCED_CIRCUIT_BOARD, RecipeType.ENHANCED_CRAFTING_TABLE, 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 87e9f49e1..028d7e092 100644 --- a/src/main/java/io/github/thebusybiscuit/slimefun4/utils/HeadTexture.java +++ b/src/main/java/io/github/thebusybiscuit/slimefun4/utils/HeadTexture.java @@ -99,7 +99,9 @@ public enum HeadTexture { MINECRAFT_CHUNK("8449b9318e33158e64a46ab0de121c3d40000e3332c1574932b3c849d8fa0dc2"), CHEST_TERMINAL("7a44ff3a5f49c69cab676bad8d98a063fa78cfa61916fdef3e267557fec18283"), CARGO_ARROW_LEFT("f2599bd986659b8ce2c4988525c94e19ddd39fad08a38284a197f1b70675acc"), - CARGO_ARROW_RIGHT("c2f910c47da042e4aa28af6cc81cf48ac6caf37dab35f88db993accb9dfe516"); + CARGO_ARROW_RIGHT("c2f910c47da042e4aa28af6cc81cf48ac6caf37dab35f88db993accb9dfe516"), + ADD_NEW_LANGUAGE("3edd20be93520949e6ce789dc4f43efaeb28c717ee6bfcbbe02780142f716"), + IRON_GOLEM("89091d79ea0f59ef7ef94d7bba6e5f17f2f7d4572c44f90f76c4819a714"); private final String texture; diff --git a/src/main/resources/languages/messages_en.yml b/src/main/resources/languages/messages_en.yml index c50aedf71..e1555655c 100644 --- a/src/main/resources/languages/messages_en.yml +++ b/src/main/resources/languages/messages_en.yml @@ -24,6 +24,7 @@ commands: guide: locked: 'LOCKED' + work-in-progress: 'This feature is not fully finished yet!' locked-category: - 'To unlock this category you will' @@ -64,6 +65,13 @@ guide: selected-language: 'Currently selected:' select: 'Click to select this language' select-default: 'Click to select the default language' + change: 'Click to select a new language' + + description: + - '&7You now have the option to change' + - '&7the language in which Slimefun' + - '&7will be presented to you. Items' + - '&7cannot be translated for now.' translations: name: '&aIs something missing?' @@ -83,6 +91,7 @@ guide: commit: 'Commit' commits: 'Commits' profile-link: 'Click to visit their profile on GitHub' + roles: developer: '&6Developer' wiki: '&3Wiki Editor' @@ -105,13 +114,16 @@ messages: not-valid-research: '&4%research% &cis not a valid Research!' give-research: '&bYou have given %player% the Research &7"%research%&7"' hungry: '&cYou are too hungry to do that!' - mode-change: '&b%device% mode changed to: &9%mode%' disabled-in-world: '&4&lThis Item has been disabled in this world' disabled-item: '&4&lThis Item has been disabled! How did you even get that?' no-tome-yourself: '&cYou cannot use the &4Tome of Knowledge &con yourself...' multimeter: '&bStored Energy: &3%stored% &b/ &3%capacity%' piglin-barter: '&4You cannot barter with piglins using Slimefun items' + multi-tool: + mode-change: '&b%device% mode changed to: &9%mode%' + not-shears: '&cA Multi Tool cannot be used as shears!' + talisman: anvil: '&a&oYour Talisman saved your tool from breaking' miner: '&a&oYour Talisman just doubled your drops' From acfc3c6880bf2d5e48283040cd84f2b325729f6a Mon Sep 17 00:00:00 2001 From: LinoxGH Date: Thu, 13 Aug 2020 19:53:13 +0000 Subject: [PATCH 55/81] Translate messages_tr.yml via GitLocalize --- src/main/resources/languages/messages_tr.yml | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/src/main/resources/languages/messages_tr.yml b/src/main/resources/languages/messages_tr.yml index a600ff98b..954d94865 100644 --- a/src/main/resources/languages/messages_tr.yml +++ b/src/main/resources/languages/messages_tr.yml @@ -41,6 +41,12 @@ guide: 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:' + change: Yeni bir dil seçmek için tıklayın + description: + - "&7Artık Slimefun içerisinde size" + - "&7sunulacak olan dilinizi" + - "&7değiştirebilirsiniz. Henüz eşyalar" + - "&7çevrilememektedir." title: main: Slimefun Rehberi settings: Ayarlar & Bilgi @@ -80,6 +86,7 @@ guide: - Bu kategoriyi açmak için - aşağıdaki kategorilerde bulunan - bütün eşyaları açın + work-in-progress: Bu özellik henüz tamamlanmadı! messages: not-researched: "&4Bunu anlayacak kadar bilgin yok" not-enough-xp: "&4Bunun kilidini açmak için yeterli XP niz yok" @@ -96,7 +103,6 @@ messages: 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..." @@ -159,6 +165,10 @@ messages: wrong-world: "&cSeçtiğiniz nokta başka bir dünyada gözüküyor!" distance: "&7Ölçüm yapıldı. &eUzaklık: %distance%" anchor-set: "&aBaşarılı bir şekilde bir nokta seçildi:&e %anchor%" + multi-tool: + mode-change: "&b%device% modül değiştirildi: &9%mode%" + not-shears: "&cBir Multi Tool makas olarak kullanılamaz!" + mode-change: "&b%device% modu değişti: &9%mode%" 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." From 18bbef426b011f9f1d2a09b354d2bc3fb91ff0ee Mon Sep 17 00:00:00 2001 From: LinoxGH Date: Thu, 13 Aug 2020 19:53:14 +0000 Subject: [PATCH 56/81] Translate recipes_tr.yml via GitLocalize From eb5b2678e082825cb5314882b6f0465644144307 Mon Sep 17 00:00:00 2001 From: TheBusyBiscuit Date: Fri, 14 Aug 2020 01:46:05 +0200 Subject: [PATCH 57/81] Fixes #2077 --- CHANGELOG.md | 2 + .../guide/options/SlimefunGuideSettings.java | 2 +- .../items/magical/talismans/Talisman.java | 6 ++- .../listeners/TalismanListener.java | 52 ++++++++++++------- .../setup/SlimefunItemSetup.java | 2 +- 5 files changed, 43 insertions(+), 21 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index ec080f206..5bf2b5b5b 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -60,6 +60,8 @@ * Fixed #2205 * Fixed #2209 * Fixed #2217 +* Fixed Miner Talisman sending messages when drops were not even doubled +* Fixed #2077 ## Release Candidate 15 (01 Aug 2020) 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 07c3b6153..6f7840e5b 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 @@ -5,6 +5,7 @@ import java.util.List; import java.util.Optional; import org.bukkit.Bukkit; +import org.bukkit.ChatColor; import org.bukkit.Material; import org.bukkit.Sound; import org.bukkit.entity.Player; @@ -21,7 +22,6 @@ 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 net.md_5.bungee.api.ChatColor; /** * This static utility class offers various methods that provide access to the 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 378efa246..8ec502809 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 @@ -11,6 +11,7 @@ import org.bukkit.entity.Player; import org.bukkit.event.Cancellable; import org.bukkit.event.Event; import org.bukkit.event.block.BlockBreakEvent; +import org.bukkit.event.block.BlockDropItemEvent; import org.bukkit.event.enchantment.EnchantItemEvent; import org.bukkit.event.entity.EntityDeathEvent; import org.bukkit.event.entity.EntityEvent; @@ -127,7 +128,7 @@ public class Talisman extends SlimefunItem { } private static boolean hasMessage(Talisman talisman) { - return !("").equalsIgnoreCase(talisman.getMessageSuffix()); + return talisman.getMessageSuffix() != null; } public static boolean checkFor(Event e, SlimefunItemStack stack) { @@ -224,6 +225,9 @@ public class Talisman extends SlimefunItem { else if (e instanceof BlockBreakEvent) { return ((BlockBreakEvent) e).getPlayer(); } + else if (e instanceof BlockDropItemEvent) { + return ((BlockDropItemEvent) e).getPlayer(); + } else if (e instanceof PlayerEvent) { return ((PlayerEvent) e).getPlayer(); } 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 df00ffc64..8a41ff747 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 @@ -13,13 +13,14 @@ import org.bukkit.enchantments.Enchantment; import org.bukkit.entity.AbstractArrow; import org.bukkit.entity.ArmorStand; import org.bukkit.entity.ChestedHorse; +import org.bukkit.entity.Item; import org.bukkit.entity.LivingEntity; import org.bukkit.entity.Player; import org.bukkit.entity.Projectile; import org.bukkit.event.EventHandler; import org.bukkit.event.EventPriority; import org.bukkit.event.Listener; -import org.bukkit.event.block.BlockBreakEvent; +import org.bukkit.event.block.BlockDropItemEvent; import org.bukkit.event.enchantment.EnchantItemEvent; import org.bukkit.event.entity.EntityDamageByEntityEvent; import org.bukkit.event.entity.EntityDamageEvent; @@ -35,7 +36,6 @@ import org.bukkit.inventory.meta.ItemMeta; 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; @@ -229,32 +229,48 @@ public class TalismanListener implements Listener { } } - @EventHandler(priority = EventPriority.HIGHEST, ignoreCancelled = true) - public void onBlockBreak(BlockBreakEvent e) { + @EventHandler(ignoreCancelled = true) + public void onBlockDropItems(BlockDropItemEvent e) { // We only want to double ores - if (MaterialCollections.getAllOres().contains(e.getBlock().getType())) { + Material type = e.getBlockState().getType(); + if (type.name().endsWith("_ORE")) { ItemStack item = e.getPlayer().getInventory().getItemInMainHand(); if (item.getType() != Material.AIR && item.getAmount() > 0 && !item.containsEnchantment(Enchantment.SILK_TOUCH)) { - Collection drops = e.getBlock().getDrops(item); - int dropAmount = 1; - - if (item.containsEnchantment(Enchantment.LOOT_BONUS_BLOCKS)) { - Random random = ThreadLocalRandom.current(); - dropAmount = random.nextInt(item.getEnchantmentLevel(Enchantment.LOOT_BONUS_BLOCKS) + 2) - 1; - dropAmount = Math.max(dropAmount, 1); - dropAmount = (e.getBlock().getType() == Material.LAPIS_ORE ? 4 + random.nextInt(5) : 1) * (dropAmount + 1); - } + Collection drops = e.getItems(); if (Talisman.checkFor(e, SlimefunItems.TALISMAN_MINER)) { - for (ItemStack drop : drops) { - if (drop != null && !drop.getType().isBlock()) { - int amount = Math.max(1, (dropAmount * 2) - drop.getAmount()); - e.getBlock().getWorld().dropItemNaturally(e.getBlock().getLocation(), new CustomItem(drop, amount)); + int dropAmount = getAmountWithFortune(type, item.getEnchantmentLevel(Enchantment.LOOT_BONUS_BLOCKS)); + boolean doubledDrops = false; + + for (Item drop : drops) { + ItemStack droppedItem = drop.getItemStack(); + + if (!droppedItem.getType().isBlock()) { + int amount = Math.max(1, (dropAmount * 2) - droppedItem.getAmount()); + e.getBlock().getWorld().dropItemNaturally(e.getBlock().getLocation(), new CustomItem(droppedItem, amount)); + doubledDrops = true; } } + + if (doubledDrops) { + SlimefunPlugin.getLocalization().sendMessage(e.getPlayer(), "messages.talisman.miner", true); + } } } } } + + private int getAmountWithFortune(Material type, int fortuneLevel) { + if (fortuneLevel > 0) { + Random random = ThreadLocalRandom.current(); + int amount = random.nextInt(fortuneLevel + 2) - 1; + amount = Math.max(amount, 1); + amount = (type == Material.LAPIS_ORE ? 4 + random.nextInt(5) : 1) * (amount + 1); + return amount; + } + else { + return 1; + } + } } 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 60781232d..ccbaf67d6 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 @@ -818,7 +818,7 @@ public final class SlimefunItemSetup { new Talisman(SlimefunItems.TALISMAN_MINER, new ItemStack[] {SlimefunItems.MAGIC_LUMP_3, null, SlimefunItems.MAGIC_LUMP_3, SlimefunItems.SYNTHETIC_SAPPHIRE, SlimefunItems.COMMON_TALISMAN, SlimefunItems.SIFTED_ORE, SlimefunItems.MAGIC_LUMP_3, null, SlimefunItems.MAGIC_LUMP_3}, - false, false, "miner", 20) + false, false, null, 20) .register(plugin); new Talisman(SlimefunItems.TALISMAN_HUNTER, From bae84215117dac7dd6cb56704db037507f292192 Mon Sep 17 00:00:00 2001 From: TheBusyBiscuit Date: Thu, 13 Aug 2020 23:51:00 +0000 Subject: [PATCH 58/81] Translate messages_de.yml via GitLocalize --- src/main/resources/languages/messages_de.yml | 16 +++++++++++++--- 1 file changed, 13 insertions(+), 3 deletions(-) diff --git a/src/main/resources/languages/messages_de.yml b/src/main/resources/languages/messages_de.yml index 1f737aeeb..8dbec9751 100644 --- a/src/main/resources/languages/messages_de.yml +++ b/src/main/resources/languages/messages_de.yml @@ -41,6 +41,12 @@ guide: select: Klicke hier um diese Sprache auszuwählen select-default: Klicke hier um die Standardsprache auszuwählen selected-language: 'Aktuell ausgewählt:' + change: Klicke um die Sprache zu ändern + description: + - "&7Hier kannst du deine Spracheinstellungen" + - "&7verwalten. Derzeit umfasst dies" + - "&7jedoch nur bestimmte Nachrichten," + - "&7Items können noch nicht übersetzt werden." title: main: Slimefun-Handbuch settings: Einstellungen & Infos @@ -80,6 +86,7 @@ guide: - Um diese Kategorie freizuschalten, - müssen zuerst sämtliche Items der - folgenden Kategorien freigeschaltet werden + work-in-progress: Dieses Feature befindet sich noch in der Testphase! messages: not-researched: "&4Du hast diesen Gegenstand noch nicht freigeschaltet!" not-enough-xp: "&4Du hast nicht genügend Erfahrungspunkte, um dies freizuschalten" @@ -96,7 +103,6 @@ messages: not-valid-research: "&4%research% &cist kein gültiger Erfahrungsgrad!" give-research: '&bDu hast %player% den Erfahrungsgrad &7"%research%&7" vergeben' hungry: "&cDu bist zu hungrig, um dies zu tun!" - mode-change: "&bDer Modus von deinem %device% wurde geändert zu: &9%mode%" disabled-in-world: "&4&lDieses Item wurde in dieser Welt deaktiviert!" disabled-item: "&4&lDieses Item wurde von einem Server-Administrator deaktiviert!" no-tome-yourself: "&cDu kannst dieses Item nicht an dir selbst anwenden..." @@ -164,6 +170,10 @@ messages: wrong-world: "&cDein Ankerpunkt scheint sich in einer anderen Dimension zu befinden!" distance: "&7Messung erfolgreich. &eDistanz: %distance%" anchor-set: "&aErfolgreich den Ankerpunkt gesetzt:&e %anchor%" + multi-tool: + mode-change: "&bDer Modus von deinem Multi-Tool wurde geändert zu: &9%mode%" + not-shears: "&cEinMulti Tool kann nicht als Schere verwendet werden!" + mode-change: "&bDer Modus von deinem %device% wurde geändert zu: &9%mode%" machines: pattern-not-found: "&eEs tut mir leid, aber ich konnte kein passendes Rezept finden." unknown-material: "&eEs tut mir leid, aber ich erkenne das Item in meinem Werfer @@ -307,7 +317,7 @@ languages: zh-CN: Chinesisch (China) el: Griechisch he: Hebräisch - pt: Portugiesisch (Portugal) + pt-BR: Portugiesisch (Brasilien) ar: Arabisch af: Afrikaans da: Dänisch @@ -319,7 +329,7 @@ languages: fa: Persisch th: Thailändisch ro: Rumänisch - pt-BR: Portugiesisch (Brasilien) + pt: Portugiesisch (Portugal) bg: Bulgarisch ko: Koreanisch tr: Türkisch From 9a6b8d697db9ee7cbdc14a68ce3c8c13e2d96b60 Mon Sep 17 00:00:00 2001 From: Luu7 Date: Fri, 14 Aug 2020 21:53:14 +0000 Subject: [PATCH 59/81] Translate messages_es.yml via GitLocalize --- src/main/resources/languages/messages_es.yml | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/src/main/resources/languages/messages_es.yml b/src/main/resources/languages/messages_es.yml index c8fe3f45c..c9ea285d7 100644 --- a/src/main/resources/languages/messages_es.yml +++ b/src/main/resources/languages/messages_es.yml @@ -39,6 +39,12 @@ guide: select: Clic para seleccionar este idioma. select-default: Clic para seleccionar el idioma predeterminado. selected-language: 'Actualmente seleccionado:' + change: Click para seleccionar un nuevo lenguaje + description: + - "&7Ahora tienes la opción de cambiar" + - "&7el idioma en el que Slimefun" + - "&7se le presentará. Items" + - "&7no puede ser traducido por ahora." title: main: Guía de Slimefun. settings: Configuración e Información. @@ -78,6 +84,7 @@ guide: - Para desbloquear esta categoría deberás - desbloquear todos los objetos de las - siguientes categorías + work-in-progress: Esta característica no esta completamente terminada todavia!! messages: not-researched: "&4No tienes conocimiento suficiente para entender esto." not-enough-xp: "&4No tienes suficiente XP para desbloquear esto." @@ -95,7 +102,6 @@ messages: 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..." @@ -160,6 +166,10 @@ messages: wrong-world: "&cParece ser que tu ancla se encuentra en un mundo diferente!" distance: "&7Medida tomada. &eDistancia: %distance%" anchor-set: "&aAncla establecida con éxito:&e %anchor%" + multi-tool: + mode-change: "&b%device% modo cambiado a: &9%mode%" + not-shears: "&cUna Multi Tool no puede ser usada como tijeras!" + mode-change: 'El modo de &b%device% ha cambiado a: &9%mode%' machines: pattern-not-found: "&eLo siento, no puedo reconocer esta receta. Por favor coloca el objeto en el patrón correcto dentro del dispensador." From d9d1d0961f4569614b62035325cb168ac4468d2b Mon Sep 17 00:00:00 2001 From: Renovate Bot Date: Sun, 16 Aug 2020 00:58:12 +0000 Subject: [PATCH 60/81] Update dependency org.mockito:mockito-core to v3.5.0 --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index 19d1b0273..e69829ba3 100644 --- a/pom.xml +++ b/pom.xml @@ -320,7 +320,7 @@ org.mockito mockito-core - 3.4.6 + 3.5.0 test From 037e8d83df39bbda504400875697fce094f4bcbc Mon Sep 17 00:00:00 2001 From: TheBusyBiscuit Date: Sun, 16 Aug 2020 15:49:47 +0200 Subject: [PATCH 61/81] Small performance improvement, also reduced technical debt a bit --- .../commands/subcommands/GuideCommand.java | 3 +- .../slimefun4/core/guide/SlimefunGuide.java | 32 +---- .../core/guide/options/GuideLayoutOption.java | 2 +- .../guide/BookSlimefunGuide.java | 126 +++++++++++------- .../guide/CheatSheetSlimefunGuide.java | 32 ++++- .../guide/ChestSlimefunGuide.java | 88 +++++++----- .../listeners/SlimefunGuideListener.java | 2 +- 7 files changed, 166 insertions(+), 119 deletions(-) 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 457151115..19b6b40a2 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 @@ -19,7 +19,8 @@ class GuideCommand extends SubCommand { public void onExecute(CommandSender sender, String[] args) { if (sender instanceof Player) { if (sender.hasPermission("slimefun.command.guide")) { - ((Player) sender).getInventory().addItem(SlimefunGuide.getItem(SlimefunPlugin.getCfg().getBoolean("guide.default-view-book") ? SlimefunGuideLayout.BOOK : SlimefunGuideLayout.CHEST)); + SlimefunGuideLayout design = SlimefunGuide.getDefaultLayout(); + ((Player) sender).getInventory().addItem(SlimefunGuide.getItem(design).clone()); } else { 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 979b9df45..6760baae1 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 @@ -1,16 +1,10 @@ package io.github.thebusybiscuit.slimefun4.core.guide; -import java.util.Arrays; -import java.util.LinkedList; -import java.util.List; import java.util.Optional; -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.api.player.PlayerProfile; import io.github.thebusybiscuit.slimefun4.implementation.SlimefunPlugin; import io.github.thebusybiscuit.slimefun4.implementation.guide.BookSlimefunGuide; @@ -36,31 +30,7 @@ public final class SlimefunGuide { private SlimefunGuide() {} public static ItemStack getItem(SlimefunGuideLayout design) { - ItemStack item = new ItemStack(Material.ENCHANTED_BOOK); - ItemMeta meta = item.getItemMeta(); - List lore = new LinkedList<>(); - lore.addAll(Arrays.asList("", ChatColors.color("&eRight Click &8\u21E8 &7Browse Items"), ChatColors.color("&eShift + Right Click &8\u21E8 &7Open Settings / Credits"))); - - switch (design) { - case BOOK: - meta.setDisplayName(ChatColors.color("&aSlimefun Guide &7(Book GUI)")); - break; - case CHEAT_SHEET: - meta.setDisplayName(ChatColors.color("&cSlimefun Guide &4(Cheat Sheet)")); - lore.add(0, ChatColors.color("&4&lOnly openable by Admins")); - lore.add(0, ""); - break; - case CHEST: - meta.setDisplayName(ChatColors.color("&aSlimefun Guide &7(Chest GUI)")); - break; - default: - return null; - } - - meta.setLore(lore); - SlimefunPlugin.getItemTextureService().setTexture(meta, "SLIMEFUN_GUIDE"); - item.setItemMeta(meta); - return item; + return SlimefunPlugin.getRegistry().getGuideLayout(design).getItem(); } public static void openCheatMenu(Player p) { 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 e6fe73e3a..92379ac9b 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 @@ -102,7 +102,7 @@ class GuideLayoutOption implements SlimefunGuideOption { @Override public Optional getSelectedOption(Player p, ItemStack guide) { for (SlimefunGuideLayout layout : SlimefunGuideLayout.values()) { - if (SlimefunUtils.isItemSimilar(guide, SlimefunGuide.getItem(layout), true)) { + if (SlimefunUtils.isItemSimilar(guide, SlimefunGuide.getItem(layout), true, false)) { return Optional.of(layout); } } 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 afaa464d4..90cfc8234 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 @@ -10,6 +10,7 @@ import org.bukkit.Material; import org.bukkit.NamespacedKey; 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.cscorelib2.chat.ChatInput; @@ -18,7 +19,6 @@ 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.inventory.ItemUtils; -import io.github.thebusybiscuit.cscorelib2.item.CustomItem; import io.github.thebusybiscuit.slimefun4.api.player.PlayerProfile; import io.github.thebusybiscuit.slimefun4.core.categories.FlexCategory; import io.github.thebusybiscuit.slimefun4.core.categories.LockedCategory; @@ -36,6 +36,24 @@ import me.mrCookieSlime.Slimefun.api.Slimefun; public class BookSlimefunGuide implements SlimefunGuideImplementation { private final NamespacedKey guideSearch = new NamespacedKey(SlimefunPlugin.instance(), "search"); + private final ItemStack item; + + public BookSlimefunGuide() { + item = new ItemStack(Material.ENCHANTED_BOOK); + ItemMeta meta = item.getItemMeta(); + + meta.setDisplayName(ChatColors.color("&aSlimefun Guide &7(Book GUI)")); + + List lore = new LinkedList<>(); + + lore.add(""); + lore.add(ChatColors.color("&eRight Click &8\u21E8 &7Browse Items")); + lore.add(ChatColors.color("&eShift + Right Click &8\u21E8 &7Open Settings / Credits")); + + meta.setLore(lore); + SlimefunPlugin.getItemTextureService().setTexture(meta, "SLIMEFUN_GUIDE"); + item.setItemMeta(meta); + } @Override public SlimefunGuideLayout getLayout() { @@ -49,7 +67,7 @@ public class BookSlimefunGuide implements SlimefunGuideImplementation { @Override public ItemStack getItem() { - return new CustomItem(new ItemStack(Material.ENCHANTED_BOOK), "&aSlimefun Guide &7(Book GUI)", "", "&eRight Click &8\u21E8 &7Browse Items", "&eShift + Right Click &8\u21E8 &7Open Settings / Credits"); + return item; } private void openBook(Player p, PlayerProfile profile, List lines, boolean backButton) { @@ -112,37 +130,41 @@ public class BookSlimefunGuide implements SlimefunGuideImplementation { lines.add(new ChatComponent(ChatColor.DARK_GRAY + "\u21E8" + ChatColor.DARK_BLUE + " Tier " + tier + "\n")); } - if (category instanceof LockedCategory && !((LockedCategory) category).hasUnlocked(p, profile)) { - List lore = new LinkedList<>(); - 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.getLocalization().getMessages(p, "guide.locked-category")) { - lore.add(ChatColor.RESET + line); - } - - lore.add(""); - - for (Category parent : ((LockedCategory) category).getParents()) { - lore.add(parent.getItem(p).getItemMeta().getDisplayName()); - } - - ChatComponent chatComponent = new ChatComponent(ChatUtils.crop(ChatColor.RED, ItemUtils.getItemName(category.getItem(p))) + "\n"); - chatComponent.setHoverEvent(new HoverEvent(lore)); - lines.add(chatComponent); - } - 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.getLocalization().getMessage(p, "guide.tooltips.open-category"))); - chatComponent.setClickEvent(new ClickEvent(category.getKey(), pl -> openCategory(profile, category, 1))); - lines.add(chatComponent); - } + addCategory(p, profile, category, lines); } } openBook(p, profile, lines, false); } + private void addCategory(Player p, PlayerProfile profile, Category category, List lines) { + if (category instanceof LockedCategory && !((LockedCategory) category).hasUnlocked(p, profile)) { + List lore = new LinkedList<>(); + 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.getLocalization().getMessages(p, "guide.locked-category")) { + lore.add(ChatColor.RESET + line); + } + + lore.add(""); + + for (Category parent : ((LockedCategory) category).getParents()) { + lore.add(parent.getItem(p).getItemMeta().getDisplayName()); + } + + ChatComponent chatComponent = new ChatComponent(ChatUtils.crop(ChatColor.RED, ItemUtils.getItemName(category.getItem(p))) + "\n"); + chatComponent.setHoverEvent(new HoverEvent(lore)); + lines.add(chatComponent); + } + 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.getLocalization().getMessage(p, "guide.tooltips.open-category"))); + chatComponent.setClickEvent(new ClickEvent(category.getKey(), pl -> openCategory(profile, category, 1))); + lines.add(chatComponent); + } + } + @Override public void openCategory(PlayerProfile profile, Category category, int page) { Player p = profile.getPlayer(); @@ -159,20 +181,20 @@ public class BookSlimefunGuide implements SlimefunGuideImplementation { List items = new LinkedList<>(); - for (SlimefunItem item : category.getItems()) { - if (Slimefun.hasPermission(p, item, false)) { - if (Slimefun.isEnabled(p, item, false)) { - appendSlimefunItem(category, page, p, profile, item, items); + for (SlimefunItem slimefunItem : category.getItems()) { + if (Slimefun.hasPermission(p, slimefunItem, false)) { + if (Slimefun.isEnabled(p, slimefunItem, false)) { + addSlimefunItem(category, page, p, profile, slimefunItem, items); } } else { - ChatComponent component = new ChatComponent(ChatUtils.crop(ChatColor.DARK_RED, ItemUtils.getItemName(item.getItem())) + "\n"); + ChatComponent component = new ChatComponent(ChatUtils.crop(ChatColor.DARK_RED, ItemUtils.getItemName(slimefunItem.getItem())) + "\n"); List lore = new ArrayList<>(); - lore.add(ChatColor.DARK_RED + ChatColor.stripColor(ItemUtils.getItemName(item.getItem()))); + lore.add(ChatColor.DARK_RED + ChatColor.stripColor(ItemUtils.getItemName(slimefunItem.getItem()))); lore.add(""); - for (String line : SlimefunPlugin.getPermissionsService().getLore(item)) { + for (String line : SlimefunPlugin.getPermissionsService().getLore(slimefunItem)) { lore.add(ChatColors.color(line)); } @@ -188,7 +210,7 @@ public class BookSlimefunGuide implements SlimefunGuideImplementation { } } - private void appendSlimefunItem(Category category, int page, Player p, PlayerProfile profile, SlimefunItem item, List items) { + private void addSlimefunItem(Category category, int page, Player p, PlayerProfile profile, SlimefunItem item, List items) { NamespacedKey key = new NamespacedKey(SlimefunPlugin.instance(), item.getID().toLowerCase(Locale.ROOT)); if (!Slimefun.hasUnlocked(p, item, false) && item.getResearch() != null) { @@ -196,21 +218,7 @@ public class BookSlimefunGuide implements SlimefunGuideImplementation { 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.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)) { - if (profile.hasUnlocked(research)) { - openCategory(profile, category, page); - } - else { - unlockItem(p, item, pl -> openCategory(profile, category, page)); - } - } - else { - SlimefunPlugin.getLocalization().sendMessage(p, "messages.not-enough-xp", true); - } - } - }))); + component.setClickEvent(new ClickEvent(key, player -> research(player, profile, item, research, category, page))); items.add(component); } @@ -230,6 +238,24 @@ public class BookSlimefunGuide implements SlimefunGuideImplementation { } } + private void research(Player p, PlayerProfile profile, SlimefunItem item, Research research, Category category, int page) { + Slimefun.runSync(() -> { + if (!SlimefunPlugin.getRegistry().getCurrentlyResearchingPlayers().contains(p.getUniqueId())) { + if (research.canUnlock(p)) { + if (profile.hasUnlocked(research)) { + openCategory(profile, category, page); + } + else { + unlockItem(p, item, pl -> openCategory(profile, category, page)); + } + } + else { + SlimefunPlugin.getLocalization().sendMessage(p, "messages.not-enough-xp", true); + } + } + }); + } + @Override public void openSearch(PlayerProfile profile, String input, boolean addToHistory) { // We need to write a book implementation for this at some point diff --git a/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/guide/CheatSheetSlimefunGuide.java b/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/guide/CheatSheetSlimefunGuide.java index d8d17c262..b115cc54b 100644 --- a/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/guide/CheatSheetSlimefunGuide.java +++ b/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/guide/CheatSheetSlimefunGuide.java @@ -1,16 +1,41 @@ package io.github.thebusybiscuit.slimefun4.implementation.guide; -import org.bukkit.entity.Player; +import java.util.LinkedList; +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.api.player.PlayerProfile; import io.github.thebusybiscuit.slimefun4.core.guide.SlimefunGuideLayout; +import io.github.thebusybiscuit.slimefun4.implementation.SlimefunPlugin; import io.github.thebusybiscuit.slimefun4.utils.ChestMenuUtils; import me.mrCookieSlime.CSCoreLibPlugin.general.Inventory.ChestMenu; public class CheatSheetSlimefunGuide extends ChestSlimefunGuide { + private final ItemStack item; + public CheatSheetSlimefunGuide() { super(false); + + item = new ItemStack(Material.ENCHANTED_BOOK); + ItemMeta meta = item.getItemMeta(); + + meta.setDisplayName(ChatColors.color("&cSlimefun Guide &4(Cheat Sheet)")); + + List lore = new LinkedList<>(); + + lore.add(ChatColors.color("&4&lOnly openable by Admins")); + lore.add(ChatColors.color("&eRight Click &8\u21E8 &7Browse Items")); + lore.add(ChatColors.color("&eShift + Right Click &8\u21E8 &7Open Settings / Credits")); + + meta.setLore(lore); + SlimefunPlugin.getItemTextureService().setTexture(meta, "SLIMEFUN_GUIDE"); + item.setItemMeta(meta); } @Override @@ -23,6 +48,11 @@ public class CheatSheetSlimefunGuide extends ChestSlimefunGuide { return SlimefunGuideLayout.CHEAT_SHEET; } + @Override + public ItemStack getItem() { + return item; + } + @Override protected void createHeader(Player p, PlayerProfile profile, ChestMenu menu) { super.createHeader(p, profile, menu); 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 52b3670ed..48f97598d 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 @@ -18,7 +18,9 @@ import org.bukkit.inventory.ItemStack; import org.bukkit.inventory.Recipe; import org.bukkit.inventory.RecipeChoice; import org.bukkit.inventory.RecipeChoice.MaterialChoice; +import org.bukkit.inventory.meta.ItemMeta; +import io.github.thebusybiscuit.cscorelib2.chat.ChatColors; import io.github.thebusybiscuit.cscorelib2.chat.ChatInput; import io.github.thebusybiscuit.cscorelib2.inventory.ItemUtils; import io.github.thebusybiscuit.cscorelib2.item.CustomItem; @@ -50,6 +52,7 @@ public class ChestSlimefunGuide implements SlimefunGuideImplementation { private static final int CATEGORY_SIZE = 36; + private final ItemStack item; private final int[] recipeSlots = { 3, 4, 5, 12, 13, 14, 21, 22, 23 }; private final Sound sound; private final boolean showVanillaRecipes; @@ -63,6 +66,21 @@ public class ChestSlimefunGuide implements SlimefunGuideImplementation { else { sound = Sound.ENTITY_BAT_TAKEOFF; } + + item = new ItemStack(Material.ENCHANTED_BOOK); + ItemMeta meta = item.getItemMeta(); + + meta.setDisplayName(ChatColors.color("&aSlimefun Guide &7(Chest GUI)")); + + List lore = new LinkedList<>(); + + lore.add(""); + lore.add(ChatColors.color("&eRight Click &8\u21E8 &7Browse Items")); + lore.add(ChatColors.color("&eShift + Right Click &8\u21E8 &7Open Settings / Credits")); + + meta.setLore(lore); + SlimefunPlugin.getItemTextureService().setTexture(meta, "SLIMEFUN_GUIDE"); + item.setItemMeta(meta); } @Override @@ -72,7 +90,7 @@ public class ChestSlimefunGuide implements SlimefunGuideImplementation { @Override public ItemStack getItem() { - return new CustomItem(new ItemStack(Material.ENCHANTED_BOOK), "&aSlimefun Guide &7(Chest GUI)", "", "&eRight Click &8\u21E8 &7Browse Items", "&eShift + Right Click &8\u21E8 &7Open Settings / Credits"); + return item; } @Override @@ -313,17 +331,17 @@ public class ChestSlimefunGuide implements SlimefunGuideImplementation { int index = 9; // Find items and add them - for (SlimefunItem item : SlimefunPlugin.getRegistry().getEnabledSlimefunItems()) { - String itemName = ChatColor.stripColor(item.getItemName()).toLowerCase(Locale.ROOT); + for (SlimefunItem slimefunItem : SlimefunPlugin.getRegistry().getEnabledSlimefunItems()) { + String itemName = ChatColor.stripColor(slimefunItem.getItemName()).toLowerCase(Locale.ROOT); if (index == 44) { break; } if (!itemName.isEmpty() && (itemName.equals(searchTerm) || itemName.contains(searchTerm))) { - ItemStack itemstack = new CustomItem(item.getItem(), meta -> { + ItemStack itemstack = new CustomItem(slimefunItem.getItem(), meta -> { List lore = null; - Category category = item.getCategory(); + Category category = slimefunItem.getCategory(); if (category != null) { ItemStack categoryItem = category.getItem(p); @@ -341,10 +359,10 @@ public class ChestSlimefunGuide implements SlimefunGuideImplementation { menu.addMenuClickHandler(index, (pl, slot, itm, action) -> { try { if (!isSurvivalMode()) { - pl.getInventory().addItem(item.getItem().clone()); + pl.getInventory().addItem(slimefunItem.getItem().clone()); } else { - displayItem(profile, item, true); + displayItem(profile, slimefunItem, true); } } catch (Exception | LinkageError x) { @@ -400,30 +418,9 @@ public class ChestSlimefunGuide implements SlimefunGuideImplementation { RecipeChoiceTask task = new RecipeChoiceTask(); if (optional.isPresent()) { - MinecraftRecipe mcRecipe = optional.get(); + showRecipeChoices(recipe, recipeItems, task); - RecipeChoice[] choices = SlimefunPlugin.getMinecraftRecipeService().getRecipeShape(recipe); - - if (choices.length == 1 && choices[0] instanceof MaterialChoice) { - recipeItems[4] = new ItemStack(((MaterialChoice) choices[0]).getChoices().get(0)); - - if (((MaterialChoice) choices[0]).getChoices().size() > 1) { - task.add(recipeSlots[4], (MaterialChoice) choices[0]); - } - } - else { - for (int i = 0; i < choices.length; i++) { - if (choices[i] instanceof MaterialChoice) { - recipeItems[i] = new ItemStack(((MaterialChoice) choices[i]).getChoices().get(0)); - - if (((MaterialChoice) choices[i]).getChoices().size() > 1) { - task.add(recipeSlots[i], (MaterialChoice) choices[i]); - } - } - } - } - - recipeType = new RecipeType(mcRecipe); + recipeType = new RecipeType(optional.get()); result = recipe.getResult(); } else { @@ -465,6 +462,29 @@ public class ChestSlimefunGuide implements SlimefunGuideImplementation { } } + private void showRecipeChoices(T recipe, ItemStack[] recipeItems, RecipeChoiceTask task) { + RecipeChoice[] choices = SlimefunPlugin.getMinecraftRecipeService().getRecipeShape(recipe); + + if (choices.length == 1 && choices[0] instanceof MaterialChoice) { + recipeItems[4] = new ItemStack(((MaterialChoice) choices[0]).getChoices().get(0)); + + if (((MaterialChoice) choices[0]).getChoices().size() > 1) { + task.add(recipeSlots[4], (MaterialChoice) choices[0]); + } + } + else { + for (int i = 0; i < choices.length; i++) { + if (choices[i] instanceof MaterialChoice) { + recipeItems[i] = new ItemStack(((MaterialChoice) choices[i]).getChoices().get(0)); + + if (((MaterialChoice) choices[i]).getChoices().size() > 1) { + task.add(recipeSlots[i], (MaterialChoice) choices[i]); + } + } + } + } + } + @Override public void displayItem(PlayerProfile profile, SlimefunItem item, boolean addToHistory) { Player p = profile.getPlayer(); @@ -670,15 +690,15 @@ public class ChestSlimefunGuide implements SlimefunGuideImplementation { private void addDisplayRecipe(ChestMenu menu, PlayerProfile profile, List recipes, int slot, int i, int page) { if ((i + (page * 18)) < recipes.size()) { - ItemStack item = recipes.get(i + (page * 18)); + ItemStack displayItem = recipes.get(i + (page * 18)); // We want to clone this item to avoid corrupting the original // but we wanna make sure no stupid addon creator sneaked some nulls in here - if (item != null) { - item = item.clone(); + if (displayItem != null) { + displayItem = displayItem.clone(); } - menu.replaceExistingItem(slot, item); + menu.replaceExistingItem(slot, displayItem); if (page == 0) { menu.addMenuClickHandler(slot, (pl, s, itemstack, action) -> { 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 78cf71659..490fc44a9 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 @@ -34,7 +34,7 @@ public class SlimefunGuideListener implements Listener { } SlimefunGuideLayout type = SlimefunGuide.getDefaultLayout(); - p.getInventory().addItem(SlimefunGuide.getItem(type)); + p.getInventory().addItem(SlimefunGuide.getItem(type).clone()); } } From 4911b8a5b6bf7154c3b3c7f60333d8759d419bb6 Mon Sep 17 00:00:00 2001 From: TheBusyBiscuit Date: Sun, 16 Aug 2020 15:53:40 +0200 Subject: [PATCH 62/81] [CI skip] Added another url to be excluded --- .github/workflows/url-checker.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/url-checker.yml b/.github/workflows/url-checker.yml index 0b82a5aa5..db92ab64e 100644 --- a/.github/workflows/url-checker.yml +++ b/.github/workflows/url-checker.yml @@ -23,4 +23,4 @@ jobs: print_all: False retry_count: 2 ## These URLs will always be correct, even if their services may be offline right now - white_listed_patterns: http://textures.minecraft.net/texture/,https://pastebin.com/ + white_listed_patterns: http://textures.minecraft.net/texture/,https://pastebin.com/,https://www.spigotmc.org/threads/spigot-bungeecord-1-16-1.447405/#post-3852349 From 2a8abcbdbfbe262341caae94c7e6880ab94ad45b Mon Sep 17 00:00:00 2001 From: TheBusyBiscuit Date: Sun, 16 Aug 2020 15:57:09 +0200 Subject: [PATCH 63/81] Fixed unit tests, also improved test coverage --- .../thebusybiscuit/slimefun4/implementation/SlimefunPlugin.java | 1 + 1 file changed, 1 insertion(+) diff --git a/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/SlimefunPlugin.java b/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/SlimefunPlugin.java index 3787d40b9..a49eaeef2 100644 --- a/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/SlimefunPlugin.java +++ b/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/SlimefunPlugin.java @@ -166,6 +166,7 @@ public final class SlimefunPlugin extends JavaPlugin implements SlimefunAddon { local = new LocalizationService(this, "", null); gpsNetwork = new GPSNetwork(); command.register(); + registry.load(config); } else if (getServer().getPluginManager().isPluginEnabled("CS-CoreLib")) { long timestamp = System.nanoTime(); From 7a31c88ce974b58ed2bcc5300cbed72d15db2fbc Mon Sep 17 00:00:00 2001 From: TheBusyBiscuit Date: Mon, 17 Aug 2020 00:32:18 +0200 Subject: [PATCH 64/81] Fixes #2207 --- CHANGELOG.md | 1 + pom.xml | 2 +- .../implementation/items/weapons/SeismicAxe.java | 15 ++++++++------- 3 files changed, 10 insertions(+), 8 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 5bf2b5b5b..b25b039da 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -62,6 +62,7 @@ * Fixed #2217 * Fixed Miner Talisman sending messages when drops were not even doubled * Fixed #2077 +* Fixed #2207 ## Release Candidate 15 (01 Aug 2020) diff --git a/pom.xml b/pom.xml index e69829ba3..7b3e9f11b 100644 --- a/pom.xml +++ b/pom.xml @@ -22,7 +22,7 @@ 1.8 - 1.16.1 + 1.16.2 https://hub.spigotmc.org/javadocs/spigot/ 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 3f8bd137a..53d43e5c8 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 @@ -80,17 +80,18 @@ public class SeismicAxe extends SimpleSlimefunItem implements No } private void pushEntity(Player p, Entity entity) { - Vector vector = entity.getLocation().toVector().subtract(p.getLocation().toVector()).normalize(); - vector.multiply(STRENGTH); - vector.setY(0.9); - entity.setVelocity(vector); - if (entity.getType() != EntityType.PLAYER || p.getWorld().getPVP()) { - EntityDamageByEntityEvent event = new EntityDamageByEntityEvent(p, entity, DamageCause.ENTITY_ATTACK, 6D); + EntityDamageByEntityEvent event = new EntityDamageByEntityEvent(p, entity, DamageCause.ENTITY_ATTACK, DAMAGE); Bukkit.getPluginManager().callEvent(event); + // Fixes #2207 - Only apply Vector if the Player is able to damage the entity if (!event.isCancelled()) { - ((LivingEntity) entity).damage(DAMAGE); + Vector vector = entity.getLocation().toVector().subtract(p.getLocation().toVector()).normalize(); + vector.multiply(STRENGTH); + vector.setY(0.9); + entity.setVelocity(vector); + + ((LivingEntity) entity).damage(event.getDamage()); } } } From 1bba2efa3e71629f0dfa919deb98dbec34c2635c Mon Sep 17 00:00:00 2001 From: TheBusyBiscuit Date: Mon, 17 Aug 2020 02:23:28 +0200 Subject: [PATCH 65/81] [CI skip] Added more unit tests --- .../slimefun4/api/items/HashedArmorpiece.java | 5 + .../slimefun4/api/player/PlayerProfile.java | 6 +- .../implementation/SlimefunPlugin.java | 5 +- .../implementation/tasks/ArmorTask.java | 27 ++++- .../testing/tests/networks/MockNetwork.java | 42 +++++++ .../tests/networks/TestNetworkManager.java | 78 +++++-------- .../tests/profiles/TestGuideHistory.java | 21 ++-- .../tests/profiles/TestPlayerBackpacks.java | 15 ++- .../tests/profiles/TestPlayerProfile.java | 24 ++-- .../researches/TestProfileResearches.java | 12 +- .../tests/researches/TestResearchSetup.java | 9 +- .../researches/TestResearchUnlocking.java | 6 +- .../tests/researches/TestResearches.java | 43 +++++--- .../tests/services/TestBlockDataService.java | 9 +- .../testing/tests/tasks/MockHazmatSuit.java | 35 ++++++ .../testing/tests/tasks/TestArmorTask.java | 104 ++++++++++++++++++ .../testing/tests/utils/TestChatUtils.java | 8 +- 17 files changed, 341 insertions(+), 108 deletions(-) create mode 100644 src/test/java/io/github/thebusybiscuit/slimefun4/testing/tests/networks/MockNetwork.java create mode 100644 src/test/java/io/github/thebusybiscuit/slimefun4/testing/tests/tasks/MockHazmatSuit.java create mode 100644 src/test/java/io/github/thebusybiscuit/slimefun4/testing/tests/tasks/TestArmorTask.java 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 a848cadca..a3bbe0185 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 @@ -99,4 +99,9 @@ public final class HashedArmorpiece { return item; } + @Override + public String toString() { + return "HashedArmorpiece {hash=" + hash + ",item=" + item.map(SlimefunItem::getID).orElse(null) + '}'; + } + } 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 a030a751e..0184fb95c 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 @@ -32,8 +32,8 @@ 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.attributes.ProtectiveArmor; import io.github.thebusybiscuit.slimefun4.core.guide.GuideHistory; import io.github.thebusybiscuit.slimefun4.core.researching.Research; import io.github.thebusybiscuit.slimefun4.implementation.SlimefunPlugin; @@ -455,11 +455,13 @@ public final class PlayerProfile { int armorCount = 0; NamespacedKey setId = null; + for (HashedArmorpiece armorpiece : armor) { Optional armorPiece = armorpiece.getItem(); if (!armorPiece.isPresent()) { - return false; + setId = null; + continue; } if (armorPiece.get() instanceof ProtectiveArmor) { diff --git a/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/SlimefunPlugin.java b/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/SlimefunPlugin.java index a49eaeef2..b802f54e7 100644 --- a/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/SlimefunPlugin.java +++ b/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/SlimefunPlugin.java @@ -61,6 +61,7 @@ import io.github.thebusybiscuit.slimefun4.implementation.listeners.DeathpointLis 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.EntityInteractionListener; import io.github.thebusybiscuit.slimefun4.implementation.listeners.ExplosionsListener; import io.github.thebusybiscuit.slimefun4.implementation.listeners.FireworksListener; import io.github.thebusybiscuit.slimefun4.implementation.listeners.GadgetsListener; @@ -70,7 +71,6 @@ import io.github.thebusybiscuit.slimefun4.implementation.listeners.ItemPickupLis import io.github.thebusybiscuit.slimefun4.implementation.listeners.MobDropListener; import io.github.thebusybiscuit.slimefun4.implementation.listeners.MultiBlockListener; import io.github.thebusybiscuit.slimefun4.implementation.listeners.PiglinListener; -import io.github.thebusybiscuit.slimefun4.implementation.listeners.EntityInteractionListener; import io.github.thebusybiscuit.slimefun4.implementation.listeners.PlayerProfileListener; import io.github.thebusybiscuit.slimefun4.implementation.listeners.SeismicAxeListener; import io.github.thebusybiscuit.slimefun4.implementation.listeners.SlimefunBootsListener; @@ -257,7 +257,8 @@ public final class SlimefunPlugin extends JavaPlugin implements SlimefunAddon { // Armor Update Task if (config.getBoolean("options.enable-armor-effects")) { - getServer().getScheduler().runTaskTimerAsynchronously(this, new ArmorTask(), 0L, config.getInt("options.armor-update-interval") * 20L); + boolean radioactiveFire = config.getBoolean("options.burn-players-when-radioactive"); + getServer().getScheduler().runTaskTimerAsynchronously(this, new ArmorTask(radioactiveFire), 0L, config.getInt("options.armor-update-interval") * 20L); } autoSavingService.start(this, config.getInt("options.auto-save-delay-in-minutes")); 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 e0412b9c2..7d982ba07 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 @@ -35,8 +35,17 @@ import me.mrCookieSlime.Slimefun.api.Slimefun; public class ArmorTask implements Runnable { private final Set radiationEffects; + private final boolean radioactiveFire; + + /** + * This creates a new {@link ArmorTask}. + * + * @param radioactiveFire + * Whether radiation also causes a {@link Player} to burn + */ + public ArmorTask(boolean radioactiveFire) { + this.radioactiveFire = radioactiveFire; - public ArmorTask() { Set effects = new HashSet<>(); effects.add(new PotionEffect(PotionEffectType.WITHER, 400, 2)); effects.add(new PotionEffect(PotionEffectType.BLINDNESS, 400, 3)); @@ -47,6 +56,16 @@ public class ArmorTask implements Runnable { radiationEffects = Collections.unmodifiableSet(effects); } + /** + * This returns a {@link Set} of {@link PotionEffect PotionEffects} which get applied to + * a {@link Player} when they are exposed to deadly radiation. + * + * @return The {@link Set} of {@link PotionEffect PotionEffects} applied upon radioactive contact + */ + public Set getRadiationEffects() { + return radiationEffects; + } + @Override public void run() { for (Player p : Bukkit.getOnlinePlayers()) { @@ -144,7 +163,11 @@ public class ArmorTask implements Runnable { Slimefun.runSync(() -> { p.addPotionEffects(radiationEffects); - p.setFireTicks(400); + + // if radiative fire is enabled + if (radioactiveFire) { + p.setFireTicks(400); + } }); return true; diff --git a/src/test/java/io/github/thebusybiscuit/slimefun4/testing/tests/networks/MockNetwork.java b/src/test/java/io/github/thebusybiscuit/slimefun4/testing/tests/networks/MockNetwork.java new file mode 100644 index 000000000..7fa9e0b61 --- /dev/null +++ b/src/test/java/io/github/thebusybiscuit/slimefun4/testing/tests/networks/MockNetwork.java @@ -0,0 +1,42 @@ +package io.github.thebusybiscuit.slimefun4.testing.tests.networks; + +import java.util.Map; + +import org.bukkit.Location; + +import io.github.thebusybiscuit.slimefun4.api.network.Network; +import io.github.thebusybiscuit.slimefun4.api.network.NetworkComponent; +import io.github.thebusybiscuit.slimefun4.core.networks.NetworkManager; + +class MockNetwork extends Network { + + private final int range; + private final Map locations; + + protected MockNetwork(NetworkManager manager, Location regulator, int range, Map locations) { + super(manager, regulator); + this.range = range; + this.locations = locations; + } + + @Override + public int getRange() { + return range; + } + + @Override + public NetworkComponent classifyLocation(Location l) { + if (l.equals(regulator)) { + return NetworkComponent.REGULATOR; + } + else { + return locations.get(l); + } + } + + @Override + public void onClassificationChange(Location l, NetworkComponent from, NetworkComponent to) { + // Do nothing + } + +} \ No newline at end of file diff --git a/src/test/java/io/github/thebusybiscuit/slimefun4/testing/tests/networks/TestNetworkManager.java b/src/test/java/io/github/thebusybiscuit/slimefun4/testing/tests/networks/TestNetworkManager.java index 62ede051a..f0d043d46 100644 --- a/src/test/java/io/github/thebusybiscuit/slimefun4/testing/tests/networks/TestNetworkManager.java +++ b/src/test/java/io/github/thebusybiscuit/slimefun4/testing/tests/networks/TestNetworkManager.java @@ -9,6 +9,7 @@ import org.bukkit.World; import org.junit.jupiter.api.AfterAll; import org.junit.jupiter.api.Assertions; import org.junit.jupiter.api.BeforeAll; +import org.junit.jupiter.api.DisplayName; import org.junit.jupiter.api.Test; import org.mockito.Mockito; @@ -19,7 +20,7 @@ import io.github.thebusybiscuit.slimefun4.api.network.NetworkComponent; import io.github.thebusybiscuit.slimefun4.core.networks.NetworkManager; import io.github.thebusybiscuit.slimefun4.core.networks.cargo.CargoNet; -public class TestNetworkManager { +class TestNetworkManager { private static ServerMock server; @@ -34,13 +35,15 @@ public class TestNetworkManager { } @Test - public void testIllegalNetworkSize() { + @DisplayName("Test illegal network size arguments") + void testIllegalNetworkSize() { Assertions.assertThrows(IllegalArgumentException.class, () -> new NetworkManager(-100)); Assertions.assertThrows(IllegalArgumentException.class, () -> new NetworkManager(0)); } @Test - public void testGetMaxNetworkSize() { + @DisplayName("Test maximum network size") + void testGetMaxNetworkSize() { int size = 50; NetworkManager manager = new NetworkManager(size); @@ -48,12 +51,13 @@ public class TestNetworkManager { } @Test - public void testGetNetworkList() { + @DisplayName("Test network list") + void testGetNetworkList() { NetworkManager manager = new NetworkManager(10); World world = server.addSimpleWorld("Simple Network World"); Location loc = new Location(world, 0, 100, 0); - Network network = new DummyNetwork(manager, loc, 10, new HashMap<>()); + Network network = new MockNetwork(manager, loc, 10, new HashMap<>()); Assertions.assertFalse(manager.getNetworkList().contains(network)); manager.registerNetwork(network); @@ -63,60 +67,64 @@ public class TestNetworkManager { } @Test - public void testDirtyRegulatorUnregistersNetwork() { + @DisplayName("Test network re-registration for dirty regulators") + void testDirtyRegulatorUnregistersNetwork() { World world = server.addSimpleWorld("Simple Network World"); Location loc = new Location(world, 0, 100, 0); NetworkManager manager = Mockito.mock(NetworkManager.class); - Network network = new DummyNetwork(manager, loc, 10, new HashMap<>()); + Network network = new MockNetwork(manager, loc, 10, new HashMap<>()); network.markDirty(loc); Mockito.verify(manager).unregisterNetwork(network); } @Test - public void testGetNetworkAtLocation() { + @DisplayName("Test getting a network at a location") + void testGetNetworkAtLocation() { NetworkManager manager = new NetworkManager(10); World world = server.addSimpleWorld("Simple Network World"); Location loc = new Location(world, 0, 100, 0); Location loc2 = new Location(world, 0, 200, 0); - Network network = new DummyNetwork(manager, loc, 10, new HashMap<>()); + Network network = new MockNetwork(manager, loc, 10, new HashMap<>()); - Assertions.assertFalse(manager.getNetworkFromLocation(loc, DummyNetwork.class).isPresent()); + Assertions.assertFalse(manager.getNetworkFromLocation(loc, MockNetwork.class).isPresent()); manager.registerNetwork(network); - Optional optional = manager.getNetworkFromLocation(loc, DummyNetwork.class); + Optional optional = manager.getNetworkFromLocation(loc, MockNetwork.class); Assertions.assertTrue(optional.isPresent()); Assertions.assertEquals(network, optional.get()); - Assertions.assertFalse(manager.getNetworkFromLocation(loc2, DummyNetwork.class).isPresent()); + Assertions.assertFalse(manager.getNetworkFromLocation(loc2, MockNetwork.class).isPresent()); Assertions.assertFalse(manager.getNetworkFromLocation(loc, CargoNet.class).isPresent()); } @Test - public void testGetNetworksAtLocation() { + @DisplayName("Test getting all networks at a location") + void testGetNetworksAtLocation() { NetworkManager manager = new NetworkManager(10); World world = server.addSimpleWorld("Simple Network World"); Location loc = new Location(world, 0, 100, 0); Location loc2 = new Location(world, 0, 200, 0); - Network network = new DummyNetwork(manager, loc, 10, new HashMap<>()); + Network network = new MockNetwork(manager, loc, 10, new HashMap<>()); manager.registerNetwork(network); - Assertions.assertFalse(manager.getNetworksFromLocation(loc2, DummyNetwork.class).contains(network)); + Assertions.assertFalse(manager.getNetworksFromLocation(loc2, MockNetwork.class).contains(network)); Assertions.assertFalse(manager.getNetworksFromLocation(loc, CargoNet.class).contains(network)); - Assertions.assertTrue(manager.getNetworksFromLocation(loc, DummyNetwork.class).contains(network)); + Assertions.assertTrue(manager.getNetworksFromLocation(loc, MockNetwork.class).contains(network)); } @Test - public void testSingleNodeNetwork() { + @DisplayName("Test a single node network") + void testSingleNodeNetwork() { NetworkManager manager = new NetworkManager(1); World world = server.addSimpleWorld("Simple Network World"); Location loc = new Location(world, 0, 100, 0); - Network network = new DummyNetwork(manager, loc, 1, new HashMap<>()); + Network network = new MockNetwork(manager, loc, 1, new HashMap<>()); network.tick(); Assertions.assertEquals(1, network.getSize()); @@ -124,7 +132,8 @@ public class TestNetworkManager { } @Test - public void testCornerConnection() { + @DisplayName("Test networks connecting via corners") + void testCornerConnection() { NetworkManager manager = new NetworkManager(100); World world = server.addSimpleWorld("Simple Network World"); Map map = new HashMap<>(); @@ -137,39 +146,10 @@ public class TestNetworkManager { Location loc3 = new Location(world, 2, 100, 2); map.put(loc3, NetworkComponent.CONNECTOR); - Network network = new DummyNetwork(manager, loc, 3, map); + Network network = new MockNetwork(manager, loc, 3, map); network.tick(); Assertions.assertEquals(3, network.getSize()); } - private class DummyNetwork extends Network { - - private final int range; - private final Map locations; - - protected DummyNetwork(NetworkManager manager, Location regulator, int range, Map locations) { - super(manager, regulator); - this.range = range; - this.locations = locations; - } - - @Override - public int getRange() { - return range; - } - - @Override - public NetworkComponent classifyLocation(Location l) { - if (l.equals(regulator)) return NetworkComponent.REGULATOR; - return locations.get(l); - } - - @Override - public void onClassificationChange(Location l, NetworkComponent from, NetworkComponent to) { - // Do nothing - } - - } - } 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 e26a9d275..3ad8087de 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 @@ -7,6 +7,7 @@ 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.DisplayName; import org.junit.jupiter.api.Test; import be.seeseemelk.mockbukkit.MockBukkit; @@ -19,7 +20,7 @@ import io.github.thebusybiscuit.slimefun4.testing.TestUtilities; import me.mrCookieSlime.Slimefun.Objects.Category; import me.mrCookieSlime.Slimefun.Objects.SlimefunItem.SlimefunItem; -public class TestGuideHistory { +class TestGuideHistory { private static ServerMock server; private static SlimefunPlugin plugin; @@ -36,7 +37,8 @@ public class TestGuideHistory { } @Test - public void testDefaults() throws InterruptedException { + @DisplayName("Test Guide History being empty by default") + void testDefaults() throws InterruptedException { Player player = server.addPlayer(); PlayerProfile profile = TestUtilities.awaitProfile(player); @@ -47,7 +49,8 @@ public class TestGuideHistory { } @Test - public void testSearchTerm() throws InterruptedException { + @DisplayName("Test adding a search term to the history") + void testSearchTerm() throws InterruptedException { Player player = server.addPlayer(); PlayerProfile profile = TestUtilities.awaitProfile(player); GuideHistory history = profile.getGuideHistory(); @@ -60,7 +63,8 @@ public class TestGuideHistory { } @Test - public void testClear() throws InterruptedException { + @DisplayName("Test clearing the Guide History") + void testClear() throws InterruptedException { Player player = server.addPlayer(); PlayerProfile profile = TestUtilities.awaitProfile(player); GuideHistory history = profile.getGuideHistory(); @@ -73,7 +77,8 @@ public class TestGuideHistory { } @Test - public void testSlimefunItem() throws InterruptedException { + @DisplayName("Test adding a SlimefunItem to Guide History") + void testSlimefunItem() throws InterruptedException { Player player = server.addPlayer(); PlayerProfile profile = TestUtilities.awaitProfile(player); GuideHistory history = profile.getGuideHistory(); @@ -89,7 +94,8 @@ public class TestGuideHistory { } @Test - public void testItem() throws InterruptedException { + @DisplayName("Test adding an ItemStack to Guide History") + void testItem() throws InterruptedException { Player player = server.addPlayer(); PlayerProfile profile = TestUtilities.awaitProfile(player); GuideHistory history = profile.getGuideHistory(); @@ -107,7 +113,8 @@ public class TestGuideHistory { } @Test - public void testCategory() throws InterruptedException { + @DisplayName("Test adding a Category to Guide History") + void testCategory() throws InterruptedException { Player player = server.addPlayer(); PlayerProfile profile = TestUtilities.awaitProfile(player); GuideHistory history = profile.getGuideHistory(); 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 1cbeef5da..309755a7b 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 @@ -8,6 +8,7 @@ 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.DisplayName; import org.junit.jupiter.api.Test; import be.seeseemelk.mockbukkit.MockBukkit; @@ -17,7 +18,7 @@ import io.github.thebusybiscuit.slimefun4.api.player.PlayerProfile; import io.github.thebusybiscuit.slimefun4.implementation.SlimefunPlugin; import io.github.thebusybiscuit.slimefun4.testing.TestUtilities; -public class TestPlayerBackpacks { +class TestPlayerBackpacks { private static ServerMock server; @@ -33,7 +34,8 @@ public class TestPlayerBackpacks { } @Test - public void testCreateBackpack() throws InterruptedException { + @DisplayName("Test creating a new Player Backpack") + void testCreateBackpack() throws InterruptedException { Player player = server.addPlayer(); PlayerProfile profile = TestUtilities.awaitProfile(player); Assertions.assertFalse(profile.isDirty()); @@ -51,7 +53,8 @@ public class TestPlayerBackpacks { } @Test - public void testChangeSize() throws InterruptedException { + @DisplayName("Test upgrading the backpack size") + void testChangeSize() throws InterruptedException { Player player = server.addPlayer(); PlayerProfile profile = TestUtilities.awaitProfile(player); PlayerBackpack backpack = profile.createBackpack(9); @@ -71,7 +74,8 @@ public class TestPlayerBackpacks { } @Test - public void testGetBackpackById() throws InterruptedException { + @DisplayName("Test getting a backpack by its id") + void testGetBackpackById() throws InterruptedException { Player player = server.addPlayer(); PlayerProfile profile = TestUtilities.awaitProfile(player); PlayerBackpack backpack = profile.createBackpack(9); @@ -87,7 +91,8 @@ public class TestPlayerBackpacks { } @Test - public void testLoadBackpackFromFile() throws InterruptedException { + @DisplayName("Test loading a backpack from file") + void testLoadBackpackFromFile() throws InterruptedException { Player player = server.addPlayer(); PlayerProfile profile = TestUtilities.awaitProfile(player); 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 138e532e2..b600c4eef 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 @@ -8,6 +8,7 @@ import org.bukkit.entity.Player; import org.junit.jupiter.api.AfterAll; import org.junit.jupiter.api.Assertions; import org.junit.jupiter.api.BeforeAll; +import org.junit.jupiter.api.DisplayName; import org.junit.jupiter.api.Test; import be.seeseemelk.mockbukkit.MockBukkit; @@ -18,7 +19,7 @@ import io.github.thebusybiscuit.slimefun4.api.player.PlayerProfile; import io.github.thebusybiscuit.slimefun4.implementation.SlimefunPlugin; import io.github.thebusybiscuit.slimefun4.testing.TestUtilities; -public class TestPlayerProfile { +class TestPlayerProfile { private static ServerMock server; @@ -34,7 +35,8 @@ public class TestPlayerProfile { } @Test - public void testOfflinePlayer() throws InterruptedException { + @DisplayName("Test Player Profiles for offline Players") + void testOfflinePlayer() throws InterruptedException { OfflinePlayer player = new OfflinePlayerMock("Offline Test Player"); PlayerProfile profile = TestUtilities.awaitProfile(player); @@ -54,7 +56,8 @@ public class TestPlayerProfile { } @Test - public void testOnlinePlayer() throws InterruptedException { + @DisplayName("Test Player Profiles for online Players") + void testOnlinePlayer() throws InterruptedException { Player player = server.addPlayer(); PlayerProfile profile = TestUtilities.awaitProfile(player); @@ -63,7 +66,8 @@ public class TestPlayerProfile { } @Test - public void testIterator() throws InterruptedException { + @DisplayName("Test PlayerProfile iterators") + void testIterator() throws InterruptedException { // Clear out any previous profiles Iterator clear = PlayerProfile.iterator(); while (clear.hasNext()) { @@ -83,7 +87,8 @@ public class TestPlayerProfile { } @Test - public void testAttributes() throws InterruptedException { + @DisplayName("Test PlayerProfile methods") + void testAttributes() throws InterruptedException { Player player = server.addPlayer(); PlayerProfile profile = TestUtilities.awaitProfile(player); @@ -107,7 +112,8 @@ public class TestPlayerProfile { } @Test - public void testNotExistentProfile() throws InterruptedException { + @DisplayName("Test a non-existent Player Profile") + void testNotExistentProfile() throws InterruptedException { OfflinePlayer player = new OfflinePlayerMock("Offline Test Player 2"); Assertions.assertFalse(PlayerProfile.find(player).isPresent()); @@ -117,12 +123,14 @@ public class TestPlayerProfile { } @Test - public void testNullPlayerGetProfile() { + @DisplayName("Test nullability for Player profiles") + void testNullPlayerGetProfile() { Assertions.assertThrows(IllegalArgumentException.class, () -> PlayerProfile.get(null, p -> {})); } @Test - public void testHashCode() throws InterruptedException { + @DisplayName("Test PlayerProfile#hashCode()") + void testHashCode() throws InterruptedException { Player player = server.addPlayer(); PlayerProfile profile = TestUtilities.awaitProfile(player); 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 adee1b32a..e85340602 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 @@ -7,6 +7,7 @@ import org.bukkit.entity.Player; import org.junit.jupiter.api.AfterAll; import org.junit.jupiter.api.Assertions; import org.junit.jupiter.api.BeforeAll; +import org.junit.jupiter.api.DisplayName; import org.junit.jupiter.api.Test; import be.seeseemelk.mockbukkit.MockBukkit; @@ -16,7 +17,7 @@ import io.github.thebusybiscuit.slimefun4.core.researching.Research; import io.github.thebusybiscuit.slimefun4.implementation.SlimefunPlugin; import io.github.thebusybiscuit.slimefun4.testing.TestUtilities; -public class TestProfileResearches { +class TestProfileResearches { private static ServerMock server; private static SlimefunPlugin plugin; @@ -33,7 +34,8 @@ public class TestProfileResearches { } @Test - public void testSetResearched() throws InterruptedException { + @DisplayName("Test setting a Research as unlocked") + void testSetResearched() throws InterruptedException { SlimefunPlugin.getRegistry().setResearchingEnabled(true); Player player = server.addPlayer(); @@ -53,7 +55,8 @@ public class TestProfileResearches { } @Test - public void testHasUnlocked() throws InterruptedException { + @DisplayName("Test checking if Research is unlocked") + void testHasUnlocked() throws InterruptedException { SlimefunPlugin.getRegistry().setResearchingEnabled(true); Player player = server.addPlayer(); @@ -78,7 +81,8 @@ public class TestProfileResearches { } @Test - public void testGetResearches() throws InterruptedException { + @DisplayName("Test getting all unlocked Researches") + void testGetResearches() throws InterruptedException { SlimefunPlugin.getRegistry().setResearchingEnabled(true); Player player = server.addPlayer(); 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 a9c92d8ab..1af5501a1 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 @@ -10,6 +10,7 @@ import org.bukkit.configuration.file.YamlConfiguration; import org.junit.jupiter.api.AfterAll; import org.junit.jupiter.api.Assertions; import org.junit.jupiter.api.BeforeAll; +import org.junit.jupiter.api.DisplayName; import org.junit.jupiter.api.Order; import org.junit.jupiter.api.Test; import org.junit.jupiter.api.TestMethodOrder; @@ -21,7 +22,7 @@ import io.github.thebusybiscuit.slimefun4.implementation.SlimefunPlugin; import io.github.thebusybiscuit.slimefun4.implementation.setup.ResearchSetup; @TestMethodOrder(value = OrderAnnotation.class) -public class TestResearchSetup { +class TestResearchSetup { @BeforeAll public static void load() { @@ -35,8 +36,9 @@ public class TestResearchSetup { } @Test + @DisplayName("Test if ResearchSetup throws an Exception") @Order(value = 1) - public void testForExceptions() { + void testForExceptions() { // Not really ideal but still important to test. // Research amount is variable, so we can't test for that. // We are really only concerned about any runtime exceptions here. @@ -49,7 +51,8 @@ public class TestResearchSetup { @Test @Order(value = 2) - public void testResearchTranslations() throws IOException { + @DisplayName("Test if Researches have a translation") + void testResearchTranslations() throws IOException { try (BufferedReader reader = new BufferedReader(new InputStreamReader(getClass().getResourceAsStream("/languages/researches_en.yml"), StandardCharsets.UTF_8))) { FileConfiguration config = YamlConfiguration.loadConfiguration(reader); 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 221bac9f8..9f4f88bac 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 @@ -10,6 +10,7 @@ import org.bukkit.entity.Player; import org.junit.jupiter.api.AfterEach; import org.junit.jupiter.api.Assertions; import org.junit.jupiter.api.BeforeEach; +import org.junit.jupiter.api.DisplayName; import org.junit.jupiter.params.ParameterizedTest; import org.junit.jupiter.params.provider.ValueSource; @@ -20,7 +21,7 @@ import io.github.thebusybiscuit.slimefun4.api.player.PlayerProfile; import io.github.thebusybiscuit.slimefun4.core.researching.Research; import io.github.thebusybiscuit.slimefun4.implementation.SlimefunPlugin; -public class TestResearchUnlocking { +class TestResearchUnlocking { private ServerMock server; private SlimefunPlugin plugin; @@ -51,8 +52,9 @@ public class TestResearchUnlocking { } @ParameterizedTest + @DisplayName("Test Unlocking Researches") @ValueSource(booleans = { true, false }) - public void testUnlock(boolean instant) throws InterruptedException { + void testUnlock(boolean instant) throws InterruptedException { SlimefunPlugin.getRegistry().setResearchingEnabled(true); Player player = server.addPlayer(); Research research = new Research(new NamespacedKey(plugin, "unlock_me"), 1842, "Unlock me", 500); 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 6079d67a5..ce3ff70ef 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 @@ -9,6 +9,7 @@ import org.bukkit.entity.Player; import org.junit.jupiter.api.AfterAll; import org.junit.jupiter.api.Assertions; import org.junit.jupiter.api.BeforeAll; +import org.junit.jupiter.api.DisplayName; import org.junit.jupiter.api.Test; import be.seeseemelk.mockbukkit.MockBukkit; @@ -19,7 +20,7 @@ import io.github.thebusybiscuit.slimefun4.implementation.SlimefunPlugin; import io.github.thebusybiscuit.slimefun4.testing.TestUtilities; import me.mrCookieSlime.Slimefun.Objects.SlimefunItem.SlimefunItem; -public class TestResearches { +class TestResearches { private static ServerMock server; private static SlimefunPlugin plugin; @@ -36,7 +37,8 @@ public class TestResearches { } @Test - public void testResearchGetters() { + @DisplayName("Test Getter methods for Research class") + void testResearchGetters() { NamespacedKey key = new NamespacedKey(plugin, "getter_test"); Research research = new Research(key, 0, "Test", 100); research.register(); @@ -52,7 +54,8 @@ public class TestResearches { } @Test - public void testResearchCost() { + @DisplayName("Test cost of Researches") + void testResearchCost() { NamespacedKey key = new NamespacedKey(plugin, "cost_test"); Research research = new Research(key, 5, "Cost Test", 100); @@ -66,8 +69,9 @@ public class TestResearches { } @Test - public void testResearchRegistration() { - NamespacedKey key = new NamespacedKey(plugin, "testResearch"); + @DisplayName("Test registering a Research") + void testResearchRegistration() { + NamespacedKey key = new NamespacedKey(plugin, "test_research"); Research research = new Research(key, 1, "Test", 100); SlimefunItem item = TestUtilities.mockSlimefunItem(plugin, "RESEARCH_TEST", new CustomItem(Material.TORCH, "&bResearch Test")); research.addItems(item, null); @@ -85,8 +89,9 @@ public class TestResearches { } @Test - public void testDisabledResearch() { - NamespacedKey key = new NamespacedKey(plugin, "disabledResearch"); + @DisplayName("Test disabling a Research") + void testDisabledResearch() { + NamespacedKey key = new NamespacedKey(plugin, "disabled_research"); Research research = new Research(key, 2, "Test", 100); SlimefunItem item = TestUtilities.mockSlimefunItem(plugin, "RESEARCH_TEST", new CustomItem(Material.TORCH, "&bResearch Test")); research.addItems(item); @@ -100,8 +105,9 @@ public class TestResearches { } @Test - public void testResearchGloballyDisabled() { - NamespacedKey key = new NamespacedKey(plugin, "globallyDisabledResearch"); + @DisplayName("Test disabling Researches server-wide") + void testResearchGloballyDisabled() { + NamespacedKey key = new NamespacedKey(plugin, "globally_disabled_research"); Research research = new Research(key, 3, "Test", 100); SlimefunPlugin.getRegistry().setResearchingEnabled(true); @@ -112,8 +118,9 @@ public class TestResearches { } @Test - public void testAddItems() { - NamespacedKey key = new NamespacedKey(plugin, "addItemsResearch"); + @DisplayName("Test adding items to a Research") + void testAddItems() { + NamespacedKey key = new NamespacedKey(plugin, "add_items_to_research"); Research research = new Research(key, 17, "Test", 100); SlimefunItem item = TestUtilities.mockSlimefunItem(plugin, "RESEARCH_ITEMS_TEST", new CustomItem(Material.LAPIS_LAZULI, "&9Adding items is fun")); item.register(plugin); @@ -125,11 +132,11 @@ public class TestResearches { } @Test - public void testPlayerCanUnlockDisabledResearch() { + void testPlayerCanUnlockDisabledResearch() { SlimefunPlugin.getRegistry().setResearchingEnabled(false); Player player = server.addPlayer(); - NamespacedKey key = new NamespacedKey(plugin, "disabledUnlockableResearch"); + NamespacedKey key = new NamespacedKey(plugin, "disabled_unlockable_research"); Research research = new Research(key, 567, "Test", 100); Assertions.assertTrue(research.canUnlock(player)); @@ -138,11 +145,12 @@ public class TestResearches { } @Test - public void testFreeCreativeResearch() { + @DisplayName("Test 'free creative researching' option") + void testFreeCreativeResearch() { SlimefunPlugin.getRegistry().setResearchingEnabled(true); Player player = server.addPlayer(); - NamespacedKey key = new NamespacedKey(plugin, "freeCreativeResearch"); + NamespacedKey key = new NamespacedKey(plugin, "free_creative_research"); Research research = new Research(key, 153, "Test", 100); SlimefunPlugin.getRegistry().setFreeCreativeResearchingEnabled(false); @@ -163,9 +171,10 @@ public class TestResearches { } @Test - public void testUnlockableResearch() { + @DisplayName("Test levels requirement") + void testUnlockableResearch() { Player player = server.addPlayer(); - NamespacedKey key = new NamespacedKey(plugin, "freeCreativeResearch"); + NamespacedKey key = new NamespacedKey(plugin, "unlocking_research"); Research research = new Research(key, 235, "Test", 4); Assertions.assertFalse(research.canUnlock(player)); 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 cad9afeff..80e24545c 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 @@ -5,13 +5,14 @@ import org.bukkit.NamespacedKey; import org.junit.jupiter.api.AfterAll; import org.junit.jupiter.api.Assertions; import org.junit.jupiter.api.BeforeAll; +import org.junit.jupiter.api.DisplayName; import org.junit.jupiter.api.Test; import be.seeseemelk.mockbukkit.MockBukkit; import io.github.thebusybiscuit.slimefun4.core.services.BlockDataService; import io.github.thebusybiscuit.slimefun4.implementation.SlimefunPlugin; -public class TestBlockDataService { +class TestBlockDataService { private static SlimefunPlugin plugin; @@ -27,13 +28,15 @@ public class TestBlockDataService { } @Test - public void testInitialization() { + @DisplayName("Test creating a BlockDataService") + void testInitialization() { BlockDataService service = new BlockDataService(plugin, "test"); Assertions.assertEquals(new NamespacedKey(plugin, "test"), service.getKey()); } @Test - public void testTileEntities() { + @DisplayName("Test Tile Entity check") + void testTileEntities() { BlockDataService service = new BlockDataService(plugin, "test"); Assertions.assertFalse(service.isTileEntity(null)); diff --git a/src/test/java/io/github/thebusybiscuit/slimefun4/testing/tests/tasks/MockHazmatSuit.java b/src/test/java/io/github/thebusybiscuit/slimefun4/testing/tests/tasks/MockHazmatSuit.java new file mode 100644 index 000000000..72efc00b3 --- /dev/null +++ b/src/test/java/io/github/thebusybiscuit/slimefun4/testing/tests/tasks/MockHazmatSuit.java @@ -0,0 +1,35 @@ +package io.github.thebusybiscuit.slimefun4.testing.tests.tasks; + +import org.bukkit.NamespacedKey; +import org.bukkit.inventory.ItemStack; +import org.bukkit.potion.PotionEffect; + +import io.github.thebusybiscuit.slimefun4.core.attributes.ProtectionType; +import io.github.thebusybiscuit.slimefun4.core.attributes.ProtectiveArmor; +import io.github.thebusybiscuit.slimefun4.implementation.items.armor.SlimefunArmorPiece; +import me.mrCookieSlime.Slimefun.Lists.RecipeType; +import me.mrCookieSlime.Slimefun.Objects.Category; +import me.mrCookieSlime.Slimefun.api.SlimefunItemStack; + +class MockHazmatSuit extends SlimefunArmorPiece implements ProtectiveArmor { + + public MockHazmatSuit(Category category, SlimefunItemStack item) { + super(category, item, RecipeType.NULL, new ItemStack[9], new PotionEffect[0]); + } + + @Override + public ProtectionType[] getProtectionTypes() { + return new ProtectionType[] { ProtectionType.RADIATION }; + } + + @Override + public boolean isFullSetRequired() { + return false; + } + + @Override + public NamespacedKey getArmorSetId() { + return new NamespacedKey(getAddon().getJavaPlugin(), "mock_hazmat"); + } + +} diff --git a/src/test/java/io/github/thebusybiscuit/slimefun4/testing/tests/tasks/TestArmorTask.java b/src/test/java/io/github/thebusybiscuit/slimefun4/testing/tests/tasks/TestArmorTask.java new file mode 100644 index 000000000..6985c90c5 --- /dev/null +++ b/src/test/java/io/github/thebusybiscuit/slimefun4/testing/tests/tasks/TestArmorTask.java @@ -0,0 +1,104 @@ +package io.github.thebusybiscuit.slimefun4.testing.tests.tasks; + +import java.util.Arrays; +import java.util.Locale; + +import org.bukkit.Material; +import org.bukkit.entity.Player; +import org.bukkit.inventory.ItemStack; +import org.bukkit.potion.PotionEffect; +import org.bukkit.potion.PotionEffectType; +import org.junit.jupiter.api.AfterAll; +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.BeforeAll; +import org.junit.jupiter.api.DisplayName; +import org.junit.jupiter.api.Test; +import org.junit.jupiter.params.ParameterizedTest; +import org.junit.jupiter.params.provider.ValueSource; + +import be.seeseemelk.mockbukkit.MockBukkit; +import be.seeseemelk.mockbukkit.ServerMock; +import io.github.thebusybiscuit.slimefun4.core.attributes.Radioactivity; +import io.github.thebusybiscuit.slimefun4.implementation.SlimefunPlugin; +import io.github.thebusybiscuit.slimefun4.implementation.items.RadioactiveItem; +import io.github.thebusybiscuit.slimefun4.implementation.items.armor.SlimefunArmorPiece; +import io.github.thebusybiscuit.slimefun4.implementation.tasks.ArmorTask; +import io.github.thebusybiscuit.slimefun4.testing.TestUtilities; +import me.mrCookieSlime.Slimefun.Lists.RecipeType; +import me.mrCookieSlime.Slimefun.Objects.Category; +import me.mrCookieSlime.Slimefun.api.SlimefunItemStack; + +class TestArmorTask { + + private static ServerMock server; + private static SlimefunPlugin plugin; + private static ArmorTask task; + + @BeforeAll + public static void load() { + server = MockBukkit.mock(); + plugin = MockBukkit.load(SlimefunPlugin.class); + task = new ArmorTask(false); + } + + @AfterAll + public static void unload() { + MockBukkit.unmock(); + } + + @Test + @DisplayName("Test Slimefun Armor Effects") + void testSlimefunArmor() throws InterruptedException { + Player player = server.addPlayer(); + TestUtilities.awaitProfile(player); + + // Setting the time to noon, to exclude the Solar Helmet check + player.getWorld().setTime(16000); + + PotionEffect[] effects = { new PotionEffect(PotionEffectType.SPEED, 50, 3), new PotionEffect(PotionEffectType.SATURATION, 128, 12) }; + + SlimefunItemStack helmet = new SlimefunItemStack("HELMET_FLEX", Material.IRON_HELMET, "&bSuper cool Helmet"); + SlimefunArmorPiece armor = new SlimefunArmorPiece(TestUtilities.getCategory(plugin, "armor_test"), helmet, RecipeType.NULL, new ItemStack[9], effects); + armor.register(plugin); + + player.getInventory().setHelmet(helmet.clone()); + player.getInventory().setChestplate(new ItemStack(Material.DIAMOND_CHESTPLATE)); + task.run(); + + // Check if all Potion Effects were applied + Assertions.assertTrue(player.getActivePotionEffects().containsAll(Arrays.asList(effects))); + } + + @ParameterizedTest + @DisplayName("Test Radiation and Hazmat Suits") + @ValueSource(booleans = { true, false }) + void testRadiactivity(boolean hazmat) throws InterruptedException { + Player player = server.addPlayer(); + TestUtilities.awaitProfile(player); + + // Setting the time to noon, to exclude the Solar Helmet check + player.getWorld().setTime(16000); + + Category category = TestUtilities.getCategory(plugin, "hazmat_suit_test"); + SlimefunItemStack item = new SlimefunItemStack("MOCK_URANIUM_" + String.valueOf(hazmat).toUpperCase(Locale.ROOT), Material.EMERALD, "&aHi, I am deadly"); + new RadioactiveItem(category, Radioactivity.VERY_DEADLY, item, RecipeType.NULL, new ItemStack[9]).register(plugin); + + player.getInventory().setItemInMainHand(item.clone()); + player.getInventory().setItemInOffHand(new ItemStack(Material.EMERALD_ORE)); + + if (hazmat) { + SlimefunItemStack chestplate = new SlimefunItemStack("MOCK_HAZMAT_SUIT", Material.LEATHER_CHESTPLATE, "&4Hazmat Prototype"); + MockHazmatSuit armor = new MockHazmatSuit(category, chestplate); + armor.register(plugin); + + player.getInventory().setChestplate(chestplate.clone()); + } + + task.run(); + + // Check if the Player is suffering from radiation + boolean radiation = player.getActivePotionEffects().containsAll(task.getRadiationEffects()); + Assertions.assertEquals(!hazmat, radiation); + } + +} diff --git a/src/test/java/io/github/thebusybiscuit/slimefun4/testing/tests/utils/TestChatUtils.java b/src/test/java/io/github/thebusybiscuit/slimefun4/testing/tests/utils/TestChatUtils.java index 0ff674bea..d99036f0c 100644 --- a/src/test/java/io/github/thebusybiscuit/slimefun4/testing/tests/utils/TestChatUtils.java +++ b/src/test/java/io/github/thebusybiscuit/slimefun4/testing/tests/utils/TestChatUtils.java @@ -7,24 +7,24 @@ import org.junit.jupiter.api.Test; import io.github.thebusybiscuit.cscorelib2.chat.ChatColors; import io.github.thebusybiscuit.slimefun4.utils.ChatUtils; -public class TestChatUtils { +class TestChatUtils { @Test - public void testHumanize() { + void testHumanize() { String input = "TEST_STRING_COOL"; String expected = "Test String Cool"; Assertions.assertEquals(expected, ChatUtils.humanize(input)); } @Test - public void testChristmas() { + void testChristmas() { String input = "Tis the season"; String expected = ChatColors.color("&aT&ci&as&c &at&ch&ae&c &as&ce&aa&cs&ao&cn"); Assertions.assertEquals(expected, ChatUtils.christmas(input)); } @Test - public void testColorCodeRemoval() { + void testColorCodeRemoval() { String expected = "Hello world"; Assertions.assertEquals(expected, ChatUtils.removeColorCodes("&4&lHello &6world")); Assertions.assertEquals(expected, ChatUtils.removeColorCodes(ChatColor.GREEN + "Hello " + ChatColor.RED + "world")); From 0d27a787abd06d101b543ec6a61dc40b4c9c6f7f Mon Sep 17 00:00:00 2001 From: TheBusyBiscuit Date: Mon, 17 Aug 2020 02:23:59 +0200 Subject: [PATCH 66/81] Added a new config option for setting Players on fire when radioactive --- CHANGELOG.md | 1 + src/main/resources/config.yml | 1 + 2 files changed, 2 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index b25b039da..187e0a41c 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -32,6 +32,7 @@ * Added "Sand -> Sandstone" recipe to the Electric Press * Added "Red Sand -> Red Sandstone" recipe to the Electric Press * Industrial Miners can now also mine Gilded Blackstone +* Added a config option to disable Players from burning when exposed to radiation #### Changes * Performance improvement for Programmable Android rotations diff --git a/src/main/resources/config.yml b/src/main/resources/config.yml index 7c21f2dd8..35b9a48da 100644 --- a/src/main/resources/config.yml +++ b/src/main/resources/config.yml @@ -17,6 +17,7 @@ options: language: en enable-translations: true log-duplicate-block-entries: true + burn-players-when-radioactive: true guide: default-view-book: false From d4953dd029e31ab718d2a10daf59d6fa94158d28 Mon Sep 17 00:00:00 2001 From: TheBusyBiscuit Date: Mon, 17 Aug 2020 13:00:22 +0200 Subject: [PATCH 67/81] [CI skip] Added more Unit Tests --- .../implementation/listeners/BeeListener.java | 4 +- .../tests/commands/TestBackpackCommand.java | 11 ++- .../tests/commands/TestDebugFishCommand.java | 6 +- .../tests/commands/TestGuideCommand.java | 6 +- .../tests/guide/TestBookSlimefunGuide.java | 6 +- .../tests/guide/TestChestSlimefunGuide.java | 6 +- .../backpacks/TestEnderBackpack.java | 6 +- .../listeners/MockBeeProtectionSuit.java | 35 +++++++++ .../tests/listeners/TestBeeListener.java | 75 +++++++++++++++++++ .../tests/listeners/TestCoolerListener.java | 9 ++- .../listeners/TestFireworksListener.java | 6 +- .../services/TextCustomTextureService.java | 9 ++- .../testing/tests/utils/TestHeadTextures.java | 6 +- .../tests/utils/TestItemStackWrapper.java | 59 ++++++++++++++- .../testing/tests/utils/TestWikiResource.java | 6 +- 15 files changed, 220 insertions(+), 30 deletions(-) create mode 100644 src/test/java/io/github/thebusybiscuit/slimefun4/testing/tests/listeners/MockBeeProtectionSuit.java create mode 100644 src/test/java/io/github/thebusybiscuit/slimefun4/testing/tests/listeners/TestBeeListener.java 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 index e45936f88..92577900d 100644 --- a/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/listeners/BeeListener.java +++ b/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/listeners/BeeListener.java @@ -42,7 +42,9 @@ public class BeeListener implements Listener { if (profile.hasFullProtectionAgainst(ProtectionType.BEES)) { for (ItemStack armor : p.getInventory().getArmorContents()) { - ItemUtils.damageItem(armor, 1, false); + if (armor != null) { + ItemUtils.damageItem(armor, 1, false); + } } e.setDamage(0D); 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 de4559d66..67eb67e5a 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 @@ -8,6 +8,7 @@ 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.DisplayName; import org.junit.jupiter.api.Test; import org.junit.jupiter.params.ParameterizedTest; import org.junit.jupiter.params.provider.ValueSource; @@ -22,7 +23,7 @@ import io.github.thebusybiscuit.slimefun4.testing.TestUtilities; import io.github.thebusybiscuit.slimefun4.utils.PatternUtils; import io.github.thebusybiscuit.slimefun4.utils.SlimefunUtils; -public class TestBackpackCommand { +class TestBackpackCommand { private static ServerMock server; @@ -52,7 +53,8 @@ public class TestBackpackCommand { } @Test - public void testValidBackpack() throws InterruptedException { + @DisplayName("Test /sf backpack giving a restored backpack") + void testValidBackpack() throws InterruptedException { Player player = server.addPlayer(); player.setOp(true); PlayerProfile profile = TestUtilities.awaitProfile(player); @@ -64,8 +66,9 @@ public class TestBackpackCommand { } @ParameterizedTest - @ValueSource(strings = { "ABC", "-100", "123456789" }) - public void testNonExistantBackpacks(String id) throws InterruptedException { + @DisplayName("Test /sf backpack with invalid id parameters") + @ValueSource(strings = { "", " ", "ABC", "-100", "123456789" }) + void testNonExistentBackpacks(String id) throws InterruptedException { Player player = server.addPlayer(); player.setOp(true); TestUtilities.awaitProfile(player); 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 81360c0d2..a7497a3e7 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 @@ -4,6 +4,7 @@ import org.bukkit.entity.Player; import org.junit.jupiter.api.AfterAll; import org.junit.jupiter.api.Assertions; import org.junit.jupiter.api.BeforeAll; +import org.junit.jupiter.api.DisplayName; import org.junit.jupiter.params.ParameterizedTest; import org.junit.jupiter.params.provider.ValueSource; @@ -13,7 +14,7 @@ import io.github.thebusybiscuit.slimefun4.implementation.SlimefunItems; import io.github.thebusybiscuit.slimefun4.implementation.SlimefunPlugin; import io.github.thebusybiscuit.slimefun4.utils.SlimefunUtils; -public class TestDebugFishCommand { +class TestDebugFishCommand { private static ServerMock server; @@ -30,7 +31,8 @@ public class TestDebugFishCommand { @ParameterizedTest @ValueSource(booleans = { true, false }) - public void testCommand(boolean op) { + @DisplayName("Test if Debug Fish is given on /sf debug_fish") + void testCommand(boolean op) { Player player = server.addPlayer(); player.setOp(op); server.execute("slimefun", player, "debug_fish").assertSucceeded(); 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 1976f6f2a..663d1e1bc 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 @@ -5,6 +5,7 @@ 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.DisplayName; import org.junit.jupiter.params.ParameterizedTest; import org.junit.jupiter.params.provider.ValueSource; @@ -15,7 +16,7 @@ import io.github.thebusybiscuit.slimefun4.core.guide.SlimefunGuideLayout; import io.github.thebusybiscuit.slimefun4.implementation.SlimefunPlugin; import io.github.thebusybiscuit.slimefun4.utils.SlimefunUtils; -public class TestGuideCommand { +class TestGuideCommand { private static ServerMock server; @@ -31,8 +32,9 @@ public class TestGuideCommand { } @ParameterizedTest + @DisplayName("Test if Slimefun Guide is given on /sf guide") @ValueSource(booleans = { true, false }) - public void testCommand(boolean op) { + void testCommand(boolean op) { Player player = server.addPlayer(); player.setOp(op); server.execute("slimefun", player, "guide").assertSucceeded(); 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 6ae0170ac..6d56a54e6 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 @@ -3,6 +3,7 @@ package io.github.thebusybiscuit.slimefun4.testing.tests.guide; import org.junit.jupiter.api.AfterAll; import org.junit.jupiter.api.Assertions; import org.junit.jupiter.api.BeforeAll; +import org.junit.jupiter.api.DisplayName; import org.junit.jupiter.api.Test; import be.seeseemelk.mockbukkit.MockBukkit; @@ -10,7 +11,7 @@ import io.github.thebusybiscuit.slimefun4.core.guide.SlimefunGuideLayout; import io.github.thebusybiscuit.slimefun4.implementation.SlimefunPlugin; import io.github.thebusybiscuit.slimefun4.implementation.guide.BookSlimefunGuide; -public class TestBookSlimefunGuide { +class TestBookSlimefunGuide { @BeforeAll public static void load() { @@ -24,7 +25,8 @@ public class TestBookSlimefunGuide { } @Test - public void testBasicGetters() { + @DisplayName("Test Getters for Chest Slimefun Guide") + void testBasicGetters() { BookSlimefunGuide guide = new BookSlimefunGuide(); Assertions.assertEquals(SlimefunGuideLayout.BOOK, guide.getLayout()); 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 260ed9bc1..5880e650f 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 @@ -3,6 +3,7 @@ package io.github.thebusybiscuit.slimefun4.testing.tests.guide; import org.junit.jupiter.api.AfterAll; import org.junit.jupiter.api.Assertions; import org.junit.jupiter.api.BeforeAll; +import org.junit.jupiter.api.DisplayName; import org.junit.jupiter.api.Test; import be.seeseemelk.mockbukkit.MockBukkit; @@ -10,7 +11,7 @@ import io.github.thebusybiscuit.slimefun4.core.guide.SlimefunGuideLayout; import io.github.thebusybiscuit.slimefun4.implementation.SlimefunPlugin; import io.github.thebusybiscuit.slimefun4.implementation.guide.ChestSlimefunGuide; -public class TestChestSlimefunGuide { +class TestChestSlimefunGuide { @BeforeAll public static void load() { @@ -24,7 +25,8 @@ public class TestChestSlimefunGuide { } @Test - public void testBasicGetters() { + @DisplayName("Test Getters for Chest Slimefun Guide") + void testBasicGetters() { ChestSlimefunGuide guide = new ChestSlimefunGuide(false); Assertions.assertEquals(SlimefunGuideLayout.CHEST, guide.getLayout()); 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 5684b59b9..12fab7fa3 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 @@ -6,6 +6,7 @@ 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.DisplayName; import org.junit.jupiter.api.Test; import be.seeseemelk.mockbukkit.MockBukkit; @@ -17,7 +18,7 @@ import io.github.thebusybiscuit.slimefun4.testing.interfaces.SlimefunItemTest; import me.mrCookieSlime.Slimefun.Lists.RecipeType; import me.mrCookieSlime.Slimefun.api.SlimefunItemStack; -public class TestEnderBackpack implements SlimefunItemTest { +class TestEnderBackpack implements SlimefunItemTest { private static ServerMock server; private static SlimefunPlugin plugin; @@ -42,7 +43,8 @@ public class TestEnderBackpack implements SlimefunItemTest { } @Test - public void testRightClickBehaviour() { + @DisplayName("Test Ender Backpack opening Enderchest") + void testRightClickBehaviour() { Player player = server.addPlayer(); EnderBackpack backpack = registerSlimefunItem(plugin, "TEST_ENDER_BACKPACK"); diff --git a/src/test/java/io/github/thebusybiscuit/slimefun4/testing/tests/listeners/MockBeeProtectionSuit.java b/src/test/java/io/github/thebusybiscuit/slimefun4/testing/tests/listeners/MockBeeProtectionSuit.java new file mode 100644 index 000000000..43fdc850a --- /dev/null +++ b/src/test/java/io/github/thebusybiscuit/slimefun4/testing/tests/listeners/MockBeeProtectionSuit.java @@ -0,0 +1,35 @@ +package io.github.thebusybiscuit.slimefun4.testing.tests.listeners; + +import org.bukkit.NamespacedKey; +import org.bukkit.inventory.ItemStack; +import org.bukkit.potion.PotionEffect; + +import io.github.thebusybiscuit.slimefun4.core.attributes.ProtectionType; +import io.github.thebusybiscuit.slimefun4.core.attributes.ProtectiveArmor; +import io.github.thebusybiscuit.slimefun4.implementation.items.armor.SlimefunArmorPiece; +import me.mrCookieSlime.Slimefun.Lists.RecipeType; +import me.mrCookieSlime.Slimefun.Objects.Category; +import me.mrCookieSlime.Slimefun.api.SlimefunItemStack; + +class MockBeeProtectionSuit extends SlimefunArmorPiece implements ProtectiveArmor { + + public MockBeeProtectionSuit(Category category, SlimefunItemStack item) { + super(category, item, RecipeType.NULL, new ItemStack[9], new PotionEffect[0]); + } + + @Override + public ProtectionType[] getProtectionTypes() { + return new ProtectionType[] { ProtectionType.BEES }; + } + + @Override + public boolean isFullSetRequired() { + return false; + } + + @Override + public NamespacedKey getArmorSetId() { + return new NamespacedKey(getAddon().getJavaPlugin(), "mock_bees"); + } + +} diff --git a/src/test/java/io/github/thebusybiscuit/slimefun4/testing/tests/listeners/TestBeeListener.java b/src/test/java/io/github/thebusybiscuit/slimefun4/testing/tests/listeners/TestBeeListener.java new file mode 100644 index 000000000..c154d93a8 --- /dev/null +++ b/src/test/java/io/github/thebusybiscuit/slimefun4/testing/tests/listeners/TestBeeListener.java @@ -0,0 +1,75 @@ +package io.github.thebusybiscuit.slimefun4.testing.tests.listeners; + +import org.bukkit.Material; +import org.bukkit.entity.Bee; +import org.bukkit.entity.Player; +import org.bukkit.event.entity.EntityDamageByEntityEvent; +import org.bukkit.event.entity.EntityDamageEvent.DamageCause; +import org.junit.jupiter.api.AfterAll; +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.BeforeAll; +import org.junit.jupiter.api.DisplayName; +import org.junit.jupiter.params.ParameterizedTest; +import org.junit.jupiter.params.provider.ValueSource; +import org.mockito.Mockito; + +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.BeeListener; +import io.github.thebusybiscuit.slimefun4.testing.TestUtilities; +import me.mrCookieSlime.Slimefun.Objects.Category; +import me.mrCookieSlime.Slimefun.api.SlimefunItemStack; + +class TestBeeListener { + + private static ServerMock server; + private static SlimefunPlugin plugin; + private static BeeListener listener; + + @BeforeAll + public static void load() { + server = MockBukkit.mock(); + plugin = MockBukkit.load(SlimefunPlugin.class); + listener = new BeeListener(plugin); + } + + @AfterAll + public static void unload() { + MockBukkit.unmock(); + } + + @ParameterizedTest + @DisplayName("Test Bee damage protection") + @ValueSource(booleans = { true, false }) + void testBeeDamage(boolean hasArmor) throws InterruptedException { + Player player = server.addPlayer(); + PlayerProfile profile = TestUtilities.awaitProfile(player); + + if (hasArmor) { + Category category = TestUtilities.getCategory(plugin, "bee_suit_test"); + SlimefunItemStack chestplate = new SlimefunItemStack("MOCK_BEE_SUIT", Material.LEATHER_CHESTPLATE, "&cBee Suit Prototype"); + MockBeeProtectionSuit armor = new MockBeeProtectionSuit(category, chestplate); + armor.register(plugin); + + player.getInventory().setChestplate(chestplate.clone()); + // Force update the cached armor + profile.getArmor()[1].update(chestplate, armor); + } + + double damage = 7.5; + + Bee bee = Mockito.mock(Bee.class); + EntityDamageByEntityEvent event = new EntityDamageByEntityEvent(bee, player, DamageCause.ENTITY_ATTACK, damage); + listener.onDamage(event); + + if (hasArmor) { + Assertions.assertEquals(0, event.getDamage()); + } + else { + Assertions.assertEquals(damage, event.getDamage()); + } + } + +} 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 c594dfb3c..e3dd6b8e7 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 @@ -11,6 +11,7 @@ import org.bukkit.potion.PotionEffectType; import org.junit.jupiter.api.AfterAll; import org.junit.jupiter.api.Assertions; import org.junit.jupiter.api.BeforeAll; +import org.junit.jupiter.api.DisplayName; import org.junit.jupiter.api.Test; import be.seeseemelk.mockbukkit.MockBukkit; @@ -28,7 +29,7 @@ import me.mrCookieSlime.Slimefun.Lists.RecipeType; import me.mrCookieSlime.Slimefun.Objects.Category; import me.mrCookieSlime.Slimefun.api.SlimefunItemStack; -public class TestCoolerListener { +class TestCoolerListener { private static ServerMock server; private static CoolerListener listener; @@ -59,14 +60,16 @@ public class TestCoolerListener { } @Test - public void testOnlyJuiceAllowance() { + @DisplayName("Test if Coolers only allow juices") + void testOnlyJuiceAllowance() { Assertions.assertFalse(cooler.isItemAllowed(new ItemStack(Material.DIAMOND), null)); Assertions.assertFalse(cooler.isItemAllowed(cooler.getItem(), cooler)); Assertions.assertTrue(cooler.isItemAllowed(juice.getItem(), juice)); } @Test - public void testCoolerUsage() throws InterruptedException { + @DisplayName("Test if Coolers consume Juices when hunger gets low") + void testCoolerUsage() throws InterruptedException { Player player = server.addPlayer(); PlayerProfile profile = TestUtilities.awaitProfile(player); PlayerBackpack backpack = profile.createBackpack(cooler.getSize()); 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 849416af7..bc5f4709d 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 @@ -10,6 +10,7 @@ import org.bukkit.inventory.meta.FireworkMeta; import org.junit.jupiter.api.AfterAll; import org.junit.jupiter.api.Assertions; import org.junit.jupiter.api.BeforeAll; +import org.junit.jupiter.api.DisplayName; import org.junit.jupiter.api.Test; import org.mockito.Mockito; @@ -19,7 +20,7 @@ import be.seeseemelk.mockbukkit.inventory.meta.FireworkMetaMock; import io.github.thebusybiscuit.slimefun4.implementation.SlimefunPlugin; import io.github.thebusybiscuit.slimefun4.implementation.listeners.FireworksListener; -public class TestFireworksListener { +class TestFireworksListener { private static ServerMock server; @@ -36,7 +37,8 @@ public class TestFireworksListener { } @Test - public void testFireworkDamage() { + @DisplayName("Test if Fireworks from Research cause no damage") + void testFireworkDamage() { Player player = server.addPlayer(); Firework firework = Mockito.mock(Firework.class); FireworkMeta meta = new FireworkMetaMock(); 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 16daca7d5..44801d46f 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 @@ -7,6 +7,7 @@ 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.DisplayName; import org.junit.jupiter.api.Test; import be.seeseemelk.mockbukkit.MockBukkit; @@ -16,7 +17,7 @@ import io.github.thebusybiscuit.slimefun4.implementation.SlimefunPlugin; import io.github.thebusybiscuit.slimefun4.testing.TestUtilities; import me.mrCookieSlime.Slimefun.Objects.SlimefunItem.SlimefunItem; -public class TextCustomTextureService { +class TextCustomTextureService { private static SlimefunPlugin plugin; @@ -32,7 +33,8 @@ public class TextCustomTextureService { } @Test - public void testInitialization() { + @DisplayName("Test creating a new Custom Texture Service") + void testInitialization() { Config config = new Config("plugins/temporary"); CustomTextureService service = new CustomTextureService(config); Assertions.assertFalse(service.isActive()); @@ -51,7 +53,8 @@ public class TextCustomTextureService { } @Test - public void testSetTexture() { + @DisplayName("Test applying a custom item model") + void testSetTexture() { Config config = new Config("plugins/temporary"); CustomTextureService service = new CustomTextureService(config); SlimefunItem item = TestUtilities.mockSlimefunItem(plugin, "TEXTURE_TEST", new ItemStack(Material.LANTERN)); diff --git a/src/test/java/io/github/thebusybiscuit/slimefun4/testing/tests/utils/TestHeadTextures.java b/src/test/java/io/github/thebusybiscuit/slimefun4/testing/tests/utils/TestHeadTextures.java index 7952d410f..c320da673 100644 --- a/src/test/java/io/github/thebusybiscuit/slimefun4/testing/tests/utils/TestHeadTextures.java +++ b/src/test/java/io/github/thebusybiscuit/slimefun4/testing/tests/utils/TestHeadTextures.java @@ -4,14 +4,16 @@ import java.util.HashSet; import java.util.Set; import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.DisplayName; import org.junit.jupiter.api.Test; import io.github.thebusybiscuit.slimefun4.utils.HeadTexture; -public class TestHeadTextures { +class TestHeadTextures { @Test - public void testForDuplicates() { + @DisplayName("Test if the HeadTexture enum contains any duplicates") + void testForDuplicates() { Set textures = new HashSet<>(); for (HeadTexture head : HeadTexture.values()) { 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 0e85707a8..e58748a39 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 @@ -1,10 +1,14 @@ package io.github.thebusybiscuit.slimefun4.testing.tests.utils; +import java.util.Arrays; +import java.util.List; + 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.DisplayName; import org.junit.jupiter.api.Test; import be.seeseemelk.mockbukkit.MockBukkit; @@ -13,7 +17,7 @@ import io.github.thebusybiscuit.slimefun4.implementation.SlimefunPlugin; import io.github.thebusybiscuit.slimefun4.utils.SlimefunUtils; import io.github.thebusybiscuit.slimefun4.utils.itemstack.ItemStackWrapper; -public class TestItemStackWrapper { +class TestItemStackWrapper { @BeforeAll public static void load() { @@ -27,7 +31,8 @@ public class TestItemStackWrapper { } @Test - public void testEquality() { + @DisplayName("Test if an ItemStackWrappers can be compared properly (With ItemMeta)") + void testEqualityWithItemMeta() { ItemStack item = new CustomItem(Material.LAVA_BUCKET, "&4SuperHot.exe", "", "&6Hello"); ItemStackWrapper wrapper = new ItemStackWrapper(item); @@ -38,7 +43,20 @@ public class TestItemStackWrapper { } @Test - public void testImmutability() { + @DisplayName("Test if an ItemStackWrappers can be compared properly (No ItemMeta)") + void testEqualityWithoutItemMeta() { + ItemStack item = new ItemStack(Material.DIAMOND_AXE); + ItemStackWrapper wrapper = new ItemStackWrapper(item); + + Assertions.assertEquals(item.getType(), wrapper.getType()); + Assertions.assertEquals(item.hasItemMeta(), wrapper.hasItemMeta()); + Assertions.assertEquals(item.getItemMeta(), wrapper.getItemMeta()); + Assertions.assertTrue(SlimefunUtils.isItemSimilar(wrapper, item, true)); + } + + @Test + @DisplayName("Test if an ItemStackWrapper is immutable") + void testImmutability() { ItemStack item = new CustomItem(Material.LAVA_BUCKET, "&4SuperHot.exe", "", "&6Hello"); ItemStackWrapper wrapper = new ItemStackWrapper(item); @@ -51,4 +69,39 @@ public class TestItemStackWrapper { Assertions.assertThrows(UnsupportedOperationException.class, () -> wrapper.equals(wrapper)); } + @Test + @DisplayName("Test wrapping an ItemStack Array") + void testWrapArray() { + ItemStack[] items = { new ItemStack(Material.DIAMOND), null, new ItemStack(Material.EMERALD), new CustomItem(Material.REDSTONE, "&4Firey thing", "with lore :o") }; + ItemStackWrapper[] wrappers = ItemStackWrapper.wrapArray(items); + + Assertions.assertEquals(items.length, wrappers.length); + + for (int i = 0; i < items.length; i++) { + assertWrapped(items[i], wrappers[i]); + } + } + + @Test + @DisplayName("Test wrapping an ItemStack List") + void testWrapList() { + List items = Arrays.asList(new ItemStack(Material.DIAMOND), null, new ItemStack(Material.EMERALD), new CustomItem(Material.REDSTONE, "&4Firey thing", "with lore :o")); + List wrappers = ItemStackWrapper.wrapList(items); + + Assertions.assertEquals(items.size(), wrappers.size()); + + for (int i = 0; i < items.size(); i++) { + assertWrapped(items.get(i), wrappers.get(i)); + } + } + + private void assertWrapped(ItemStack expected, ItemStack actual) { + if (expected == null) { + Assertions.assertNull(actual); + } + else { + Assertions.assertTrue(actual instanceof ItemStackWrapper); + Assertions.assertTrue(SlimefunUtils.isItemSimilar(actual, expected, true)); + } + } } diff --git a/src/test/java/io/github/thebusybiscuit/slimefun4/testing/tests/utils/TestWikiResource.java b/src/test/java/io/github/thebusybiscuit/slimefun4/testing/tests/utils/TestWikiResource.java index 2b4202be2..2ad9293ce 100644 --- a/src/test/java/io/github/thebusybiscuit/slimefun4/testing/tests/utils/TestWikiResource.java +++ b/src/test/java/io/github/thebusybiscuit/slimefun4/testing/tests/utils/TestWikiResource.java @@ -8,15 +8,17 @@ import java.util.Map; import java.util.regex.Pattern; import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.DisplayName; import org.junit.jupiter.api.Test; import com.google.gson.JsonElement; import com.google.gson.JsonParser; -public class TestWikiResource { +class TestWikiResource { @Test - public void testWikiJson() throws IOException { + @DisplayName("Test wiki.json file format") + void testWikiJson() throws IOException { JsonParser parser = new JsonParser(); Pattern pattern = Pattern.compile("[A-Z_0-9]+"); From 646fb6d523b07893010c0b77c37880e787c83a14 Mon Sep 17 00:00:00 2001 From: Scott Gomez Andoy Date: Mon, 17 Aug 2020 11:26:10 +0000 Subject: [PATCH 68/81] Translate messages_tl.yml via GitLocalize --- src/main/resources/languages/messages_tl.yml | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/src/main/resources/languages/messages_tl.yml b/src/main/resources/languages/messages_tl.yml index de0485288..fa284c8f7 100644 --- a/src/main/resources/languages/messages_tl.yml +++ b/src/main/resources/languages/messages_tl.yml @@ -38,6 +38,12 @@ guide: select: I-click ito upang piliin ang wikang ito. select-default: I-click ito upang piliin ang default na wika. selected-language: 'Kasalukuyang pinili:' + change: Mag-click upang pumili ng bagong wika. + description: + - "&7Meron ka nang pagpipilian upang pumili" + - "&7ng wika kung saan ang Slimefun" + - "&7ay may ipapakita sa iyo. Ang mga" + - "&7items ay bawal pa i-translate sa ngayon." title: main: Slimefun Guide settings: Mga Settings & Impormasyon @@ -77,6 +83,7 @@ guide: - Upang i-unlock ang kategoryang ito, - kailangang i-unlock ang lahat ng mga item mula sa - sumusunod na kategorya. + work-in-progress: Ang feature na ito ay hindi pa tapos! messages: not-researched: "&4Kulang ang iyong Knowledge upang ito'y maintindihan." not-enough-xp: "&4Kulang ang iyong XP upang ito'y ma-unlock." @@ -94,7 +101,6 @@ messages: not-valid-research: "&4%research% &cay hindi valid na Research!" give-research: '&bBinigyan mo si %player% ng Research &7"%research%&7"' hungry: "&cIkaw ay sobrang gutom para gawin ito!" - mode-change: "&b%device% mode ay pinalitan ng: &9%mode%" disabled-in-world: "&4&lDinisable ang Aytem sa world na ito." disabled-item: "&4&lDinisable ang Aytem na ito! Paano mo ito nakuha?" no-tome-yourself: "&cHindi mo magagamit ang &4Tome of Knowledge &cpara sa'yo..." @@ -166,6 +172,10 @@ messages: wrong-world: "&cAng iyong angkla ay tila nasa ibang mundo!" distance: "&7Measurement taken. &eDistansiya: %distance%" anchor-set: "&aMatagumpay na na-set ang angla:&e %anchor%" + multi-tool: + mode-change: "&b%device% napalitan ang mode sa: &9%mode%" + not-shears: "&cBawal gamitin ang Multi-Tool bilang shears!" + mode-change: "&b%device% mode ay pinalitan ng: &9%mode%" machines: pattern-not-found: "&ePasensiya na, hindi ko maintindihan ang Recipe na ito. Pakilagay ang mga Aytem sa tamang pattern sa loob ng Dispense." @@ -241,6 +251,7 @@ gps: chat. &7(Supported ang Color Codes!)" added: "&aTagumpay ang pag-add ng bagong waypoint." max: "&4Naabot mo na ang maximum amount ng waypoints." + duplicate: "&4Nakagawa ka na ng isang waypoint na pinangalanan: & f%waypoint%" insufficient-complexity: - "&4Kulang ang GPS Network Complexity: &c%complexity%" - "&4a) Wala ka pang GPS Network setup." @@ -336,3 +347,5 @@ languages: tl: Tagalog/Filipino brewing_stand: not-working: "&4Hindi ka maaaring gumamit ng mga Item ng Slimefun sa Brewing Stand!" +villagers: + no-trading: "&4Hindi ka maaaring mag-trade ng mga Slimefun Items sa mga villagers!" From 8e8a87fce666b19b33981479e67b47121992b5ea Mon Sep 17 00:00:00 2001 From: TheBusyBiscuit Date: Mon, 17 Aug 2020 17:31:15 +0200 Subject: [PATCH 69/81] Fixed ChestTerminal timings showing up as cargo nodes --- CHANGELOG.md | 4 ++ .../core/networks/cargo/CargoNet.java | 2 +- .../core/networks/cargo/CargoNetworkTask.java | 7 ++- .../core/networks/cargo/CargoUtils.java | 32 ++++++++--- .../networks/cargo/ChestTerminalNetwork.java | 54 +++++++++++-------- .../services/profiler/SlimefunProfiler.java | 13 +++-- 6 files changed, 78 insertions(+), 34 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 187e0a41c..b5821b674 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -41,6 +41,8 @@ * Performance improvements for idling Enhanced Furnaces when using Paper * Performance improvements for Rainbow Blocks * Crafting a Rag now yields two items +* Small performance improvements for Slimefun guides +* Small performance improvements for Cargo networks #### Fixes * Fixed Programmable Androids rotating in the wrong direction @@ -64,6 +66,8 @@ * Fixed Miner Talisman sending messages when drops were not even doubled * Fixed #2077 * Fixed #2207 +* Fixed ChestTerminal timings showing up as cargo nodes +* Fixed timings reports never arriving sometimes ## Release Candidate 15 (01 Aug 2020) 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 f8df07d58..681fffaaa 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 @@ -175,7 +175,7 @@ public class CargoNet extends ChestTerminalNetwork { display(); } - SlimefunPlugin.getProfiler().scheduleEntries(1 + inputNodes.size()); + SlimefunPlugin.getProfiler().scheduleEntries((terminals.isEmpty() ? 1 : 2) + inputs.size()); CargoNetworkTask runnable = new CargoNetworkTask(this, inputs, outputs, chestTerminalInputs, chestTerminalOutputs); Slimefun.runSync(runnable); 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 index eec1652df..11b87f47e 100644 --- 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 @@ -16,6 +16,7 @@ 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.Objects.SlimefunItem.SlimefunItem; import me.mrCookieSlime.Slimefun.api.BlockStorage; import me.mrCookieSlime.Slimefun.api.inventory.DirtyChestMenu; @@ -63,6 +64,7 @@ class CargoNetworkTask implements Runnable { // All operations happen here: Everything gets iterated from the Input Nodes. // (Apart from ChestTerminal Buses) + SlimefunItem inputNode = SlimefunItems.CARGO_INPUT_NODE.getItem(); for (Map.Entry entry : inputs.entrySet()) { long nodeTimestamp = System.nanoTime(); Location input = entry.getKey(); @@ -71,12 +73,13 @@ class CargoNetworkTask implements Runnable { attachedBlock.ifPresent(block -> routeItems(input, block, 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); + timestamp += SlimefunPlugin.getProfiler().closeEntry(entry.getKey(), inputNode, nodeTimestamp); } // Chest Terminal Code if (SlimefunPlugin.getThirdPartySupportService().isChestTerminalInstalled()) { - network.updateTerminals(chestTerminalInputs); + // This will deduct any CT timings and attribute them towards the actual terminal + timestamp += network.updateTerminals(chestTerminalInputs); } // Submit a timings report 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 b13b43d67..561cb30bc 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 @@ -409,18 +409,36 @@ final class CargoUtils { } private static boolean matchesFilterList(ItemStack item, BlockMenu menu, boolean respectLore, boolean defaultValue) { - ItemStackWrapper wrapper = null; + // Little performance optimization: + // First check if there is more than one item to compare, if so + // then we know we should create an ItemStackWrapper, otherwise it would + // be of no benefit to us and just be redundant + int itemsToCompare = 0; 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 (stack != null && stack.getType() != Material.AIR) { + itemsToCompare++; - if (SlimefunUtils.isItemSimilar(stack, wrapper, respectLore, false)) { + if (itemsToCompare > 1) { + break; + } + } + } + + // Check if there are event non-air items + if (itemsToCompare > 0) { + // Only create the Wrapper if its worth it + if (itemsToCompare > 1) { + // Create an itemStackWrapper to save performance + item = new ItemStackWrapper(item); + } + + for (int slot : FILTER_SLOTS) { + ItemStack stack = menu.getItemInSlot(slot); + + if (SlimefunUtils.isItemSimilar(stack, item, respectLore, false)) { return !defaultValue; } } 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 d7d1a0cfe..1a9fe1077 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 @@ -274,37 +274,49 @@ abstract class ChestTerminalNetwork extends Network { * * @param providers * A {@link Set} of providers to this {@link ChestTerminalNetwork} + * + * @return The time it took to compute this operation */ - protected void updateTerminals(Set providers) { + protected long updateTerminals(Set providers) { if (terminals.isEmpty()) { // Performance improvement - We don't need to compute items for // Cargo networks without any Chest Terminals - return; + return 0; } - // Timings will be slightly inaccurate here but most often people are gonna - // use no more than one terminal anyway, so this might be fine - long timestamp = SlimefunPlugin.getProfiler().newEntry(); + // Timings will be slightly inaccurate here but most often people are not + // gonna use no more than one terminal anyway, so this might be fine + long timestamp = System.nanoTime(); + Location firstTerminal = null; SlimefunItem item = SlimefunItem.getByID("CHEST_TERMINAL"); List items = findAvailableItems(providers); - for (Location l : terminals) { - BlockMenu terminal = BlockStorage.getInventory(l); - int page = Integer.parseInt(BlockStorage.getLocationInfo(l, "page")); + try { + for (Location l : terminals) { + BlockMenu terminal = BlockStorage.getInventory(l); + int page = Integer.parseInt(BlockStorage.getLocationInfo(l, "page")); - if (!items.isEmpty() && items.size() < (page - 1) * TERMINAL_SLOTS.length + 1) { - page = 1; - BlockStorage.addBlockInfo(l, "page", String.valueOf(1)); + if (!items.isEmpty() && items.size() < (page - 1) * TERMINAL_SLOTS.length + 1) { + page = 1; + BlockStorage.addBlockInfo(l, "page", String.valueOf(1)); + } + + for (int i = 0; i < TERMINAL_SLOTS.length; i++) { + int slot = TERMINAL_SLOTS[i]; + int index = i + (TERMINAL_SLOTS.length * (page - 1)); + updateTerminal(l, terminal, slot, index, items); + } + + if (firstTerminal == null) { + firstTerminal = l; + } } - - for (int i = 0; i < TERMINAL_SLOTS.length; i++) { - int slot = TERMINAL_SLOTS[i]; - int index = i + (TERMINAL_SLOTS.length * (page - 1)); - updateTerminal(l, terminal, slot, index, items); - } - - SlimefunPlugin.getProfiler().closeEntry(l, item, timestamp); } + catch (Exception | LinkageError x) { + item.error("An Exception was caused while trying to tick Chest terminals", x); + } + + return SlimefunPlugin.getProfiler().closeEntry(firstTerminal, item, timestamp); } private void updateTerminal(Location l, BlockMenu terminal, int slot, int index, List items) { @@ -316,7 +328,7 @@ abstract class ChestTerminalNetwork extends Network { ItemMeta im = stack.getItemMeta(); List lore = new ArrayList<>(); lore.add(""); - lore.add(ChatColors.color("&7Stored Items: &r" + DoubleHandler.getFancyDouble(item.getInt()))); + lore.add(ChatColors.color("&7Stored Items: &f" + DoubleHandler.getFancyDouble(item.getInt()))); if (stack.getMaxStackSize() > 1) { int amount = item.getInt() > stack.getMaxStackSize() ? stack.getMaxStackSize() : item.getInt(); @@ -437,7 +449,7 @@ abstract class ChestTerminalNetwork extends Network { boolean add = true; for (ItemStackAndInteger item : items) { - if (SlimefunUtils.isItemSimilar(stack, item.getItemStackWrapper(), true)) { + if (SlimefunUtils.isItemSimilar(stack, item.getItemStackWrapper(), true, false)) { add = false; item.add(stack.getAmount()); } 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 index fad49ad33..98b012e59 100644 --- 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 @@ -44,7 +44,7 @@ public class SlimefunProfiler { // 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 ExecutorService executor = Executors.newFixedThreadPool(5); private final AtomicBoolean running = new AtomicBoolean(false); private final AtomicInteger queued = new AtomicInteger(0); @@ -118,7 +118,8 @@ public class SlimefunProfiler { executor.execute(() -> { ProfiledBlock block = new ProfiledBlock(l, item); - timings.putIfAbsent(block, elapsedTime); + // Merge (if we have multiple samples for whatever reason) + timings.merge(block, elapsedTime, Long::sum); queued.decrementAndGet(); }); @@ -143,7 +144,7 @@ public class SlimefunProfiler { private void finishReport() { // We will only wait for a maximum of this many 1ms sleeps - int iterations = 1000; + int iterations = 4000; // Wait for all timing results to come in while (!running.get() && queued.get() > 0) { @@ -153,6 +154,12 @@ public class SlimefunProfiler { // If we waited for too long, then we should just abort if (iterations <= 0) { + Iterator iterator = requests.iterator(); + + while (iterator.hasNext()) { + iterator.next().sendMessage("Your timings report has timed out, we were still waiting for " + queued.get() + " samples to be collected :/"); + iterator.remove(); + } return; } } From 6be0709aea218eeda8766e5b81a549920b54fdc3 Mon Sep 17 00:00:00 2001 From: TheBusyBiscuit Date: Tue, 18 Aug 2020 14:18:44 +0200 Subject: [PATCH 70/81] Fixes #2138 --- CHANGELOG.md | 2 + .../items/androids/MinerAndroid.java | 79 +++++++++++-------- .../items/blocks/BlockPlacer.java | 74 ++++++++++++++--- 3 files changed, 109 insertions(+), 46 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index b5821b674..ad9af9284 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -43,6 +43,7 @@ * Crafting a Rag now yields two items * Small performance improvements for Slimefun guides * Small performance improvements for Cargo networks +* Small performance improvements for Miner Androids #### Fixes * Fixed Programmable Androids rotating in the wrong direction @@ -68,6 +69,7 @@ * Fixed #2207 * Fixed ChestTerminal timings showing up as cargo nodes * Fixed timings reports never arriving sometimes +* Fixed #2138 ## Release Candidate 15 (01 Aug 2020) 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 2553ba4d8..f475995fe 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 @@ -6,6 +6,7 @@ import java.util.UUID; import org.bukkit.Bukkit; import org.bukkit.Effect; import org.bukkit.Material; +import org.bukkit.OfflinePlayer; import org.bukkit.block.Block; import org.bukkit.block.BlockFace; import org.bukkit.inventory.ItemStack; @@ -39,24 +40,28 @@ public abstract class MinerAndroid extends ProgrammableAndroid { protected void dig(Block b, BlockMenu menu, Block block) { Collection drops = block.getDrops(effectivePickaxe); - if (!MaterialCollections.getAllUnbreakableBlocks().contains(block.getType()) && !drops.isEmpty() && SlimefunPlugin.getProtectionManager().hasPermission(Bukkit.getOfflinePlayer(UUID.fromString(BlockStorage.getLocationInfo(b.getLocation(), "owner"))), block.getLocation(), ProtectableAction.BREAK_BLOCK)) { + if (!MaterialCollections.getAllUnbreakableBlocks().contains(block.getType()) && !drops.isEmpty()) { + OfflinePlayer owner = Bukkit.getOfflinePlayer(UUID.fromString(BlockStorage.getLocationInfo(b.getLocation(), "owner"))); - AndroidMineEvent event = new AndroidMineEvent(block, new AndroidInstance(this, b)); - Bukkit.getPluginManager().callEvent(event); + if (SlimefunPlugin.getProtectionManager().hasPermission(owner, block.getLocation(), ProtectableAction.BREAK_BLOCK)) { + AndroidMineEvent event = new AndroidMineEvent(block, new AndroidInstance(this, b)); + Bukkit.getPluginManager().callEvent(event); - if (event.isCancelled()) { - return; - } + if (event.isCancelled()) { + return; + } - // We only want to break non-Slimefun blocks - String blockId = BlockStorage.checkID(block); - if (blockId == null) { - for (ItemStack drop : drops) { - if (menu.fits(drop, getOutputSlots())) { - menu.pushItem(drop, getOutputSlots()); - block.getWorld().playEffect(block.getLocation(), Effect.STEP_SOUND, block.getType()); - block.setType(Material.AIR); + // We only want to break non-Slimefun blocks + String blockId = BlockStorage.checkID(block); + if (blockId == null) { + for (ItemStack drop : drops) { + if (menu.fits(drop, getOutputSlots())) { + menu.pushItem(drop, getOutputSlots()); + } } + + block.getWorld().playEffect(block.getLocation(), Effect.STEP_SOUND, block.getType()); + block.setType(Material.AIR); } } } @@ -66,30 +71,34 @@ public abstract class MinerAndroid extends ProgrammableAndroid { protected void moveAndDig(Block b, BlockMenu menu, BlockFace face, Block block) { Collection drops = block.getDrops(effectivePickaxe); - if (!MaterialCollections.getAllUnbreakableBlocks().contains(block.getType()) && !drops.isEmpty() && SlimefunPlugin.getProtectionManager().hasPermission(Bukkit.getOfflinePlayer(UUID.fromString(BlockStorage.getLocationInfo(b.getLocation(), "owner"))), block.getLocation(), ProtectableAction.BREAK_BLOCK)) { + if (!MaterialCollections.getAllUnbreakableBlocks().contains(block.getType()) && !drops.isEmpty()) { + OfflinePlayer owner = Bukkit.getOfflinePlayer(UUID.fromString(BlockStorage.getLocationInfo(b.getLocation(), "owner"))); - AndroidMineEvent event = new AndroidMineEvent(block, new AndroidInstance(this, b)); - Bukkit.getPluginManager().callEvent(event); + if (SlimefunPlugin.getProtectionManager().hasPermission(owner, block.getLocation(), ProtectableAction.BREAK_BLOCK)) { + AndroidMineEvent event = new AndroidMineEvent(block, new AndroidInstance(this, b)); + Bukkit.getPluginManager().callEvent(event); - if (event.isCancelled()) { - return; - } - - // We only want to break non-Slimefun blocks - SlimefunItem blockId = BlockStorage.check(block); - if (blockId == null) { - for (ItemStack drop : drops) { - if (menu.fits(drop, getOutputSlots())) { - menu.pushItem(drop, getOutputSlots()); - block.getWorld().playEffect(block.getLocation(), Effect.STEP_SOUND, block.getType()); - - block.setType(Material.AIR); - move(b, face, block); - - b.setType(Material.AIR); - BlockStorage.moveBlockInfo(b.getLocation(), block.getLocation()); - } + if (event.isCancelled()) { + return; } + + // We only want to break non-Slimefun blocks + SlimefunItem blockId = BlockStorage.check(block); + if (blockId == null) { + for (ItemStack drop : drops) { + if (menu.fits(drop, getOutputSlots())) { + menu.pushItem(drop, getOutputSlots()); + } + } + + block.getWorld().playEffect(block.getLocation(), Effect.STEP_SOUND, block.getType()); + + block.setType(Material.AIR); + move(b, face, block); + } + } + else { + move(b, face, block); } } else { 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 d478f9b59..225af96dd 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 @@ -1,26 +1,33 @@ package io.github.thebusybiscuit.slimefun4.implementation.items.blocks; import java.util.List; +import java.util.UUID; import java.util.stream.Collectors; import org.bukkit.Bukkit; import org.bukkit.Effect; +import org.bukkit.Location; import org.bukkit.Material; import org.bukkit.Nameable; +import org.bukkit.OfflinePlayer; import org.bukkit.block.Block; -import org.bukkit.block.BlockState; import org.bukkit.block.Dispenser; +import org.bukkit.entity.Player; +import org.bukkit.event.block.BlockPlaceEvent; import org.bukkit.inventory.ItemStack; import org.bukkit.inventory.meta.ItemMeta; 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.events.BlockPlacerPlaceEvent; import io.github.thebusybiscuit.slimefun4.api.items.ItemSetting; import io.github.thebusybiscuit.slimefun4.core.attributes.NotPlaceable; import io.github.thebusybiscuit.slimefun4.core.handlers.BlockDispenseHandler; import io.github.thebusybiscuit.slimefun4.core.handlers.BlockPlaceHandler; -import io.github.thebusybiscuit.slimefun4.implementation.items.SimpleSlimefunItem; +import io.github.thebusybiscuit.slimefun4.implementation.SlimefunPlugin; +import io.papermc.lib.PaperLib; +import io.papermc.lib.features.blockstatesnapshot.BlockStateSnapshotResult; import me.mrCookieSlime.Slimefun.Lists.RecipeType; import me.mrCookieSlime.Slimefun.Objects.Category; import me.mrCookieSlime.Slimefun.Objects.SlimefunItem.SlimefunItem; @@ -39,7 +46,7 @@ import me.mrCookieSlime.Slimefun.api.SlimefunItemStack; * @see BlockPlacerPlaceEvent * */ -public class BlockPlacer extends SimpleSlimefunItem { +public class BlockPlacer extends SlimefunItem { private final ItemSetting> blacklist = new ItemSetting<>("unplaceable-blocks", MaterialCollections.getAllUnbreakableBlocks().stream().map(Material::name).collect(Collectors.toList())); @@ -47,11 +54,28 @@ public class BlockPlacer extends SimpleSlimefunItem { super(category, item, recipeType, recipe); addItemSetting(blacklist); + addItemHandler(onPlace(), onBlockDispense()); } - @Override - public BlockDispenseHandler getItemHandler() { + private BlockPlaceHandler onPlace() { + return new BlockPlaceHandler(false) { + + @Override + public void onPlayerPlace(BlockPlaceEvent e) { + Player p = e.getPlayer(); + Block b = e.getBlock(); + + BlockStorage.addBlockInfo(b, "owner", p.getUniqueId().toString()); + } + }; + } + + private BlockDispenseHandler onBlockDispense() { return (e, dispenser, facedBlock, machine) -> { + if (!hasPermission(dispenser, facedBlock)) { + return; + } + if (isShulkerBox(e.getItem().getType())) { // Since vanilla Dispensers can already place Shulker boxes, we // simply fallback to the vanilla behaviour. @@ -76,6 +100,31 @@ public class BlockPlacer extends SimpleSlimefunItem { }; } + /** + * This checks whether the {@link Player} who placed down this {@link BlockPlacer} has + * building permissions at that {@link Location}. + * + * @param dispenser + * The {@link Dispenser} who represents our {@link BlockPlacer} + * @param target + * The {@link Block} where it should be placed + * + * @return Whether this action is permitted or not + */ + private boolean hasPermission(Dispenser dispenser, Block target) { + String owner = BlockStorage.getLocationInfo(dispenser.getLocation(), "owner"); + + if (owner == null) { + // If no owner was set, then we will fallback to the previous behaviour: + // Allowing block placers to bypass protection, newly placed Block placers + // will respect protection plugins. + return true; + } + + OfflinePlayer player = Bukkit.getOfflinePlayer(UUID.fromString(owner)); + return SlimefunPlugin.getProtectionManager().hasPermission(player, target, ProtectableAction.PLACE_BLOCK); + } + private boolean isShulkerBox(Material type) { return type == Material.SHULKER_BOX || type.name().endsWith("_SHULKER_BOX"); } @@ -139,14 +188,17 @@ public class BlockPlacer extends SimpleSlimefunItem { ItemMeta meta = item.getItemMeta(); if (meta.hasDisplayName()) { - BlockState blockState = facedBlock.getState(); + BlockStateSnapshotResult blockState = PaperLib.getBlockState(facedBlock, false); - if ((blockState instanceof Nameable)) { - ((Nameable) blockState).setCustomName(meta.getDisplayName()); + if ((blockState.getState() instanceof Nameable)) { + Nameable nameable = ((Nameable) blockState.getState()); + nameable.setCustomName(meta.getDisplayName()); + + if (blockState.isSnapshot()) { + // Update block state after changing name + blockState.getState().update(true, false); + } } - - // Update block state after changing name - blockState.update(); } } From 9d4d2060baec6e5a044b28d7fed5968046f04971 Mon Sep 17 00:00:00 2001 From: TheBusyBiscuit Date: Tue, 18 Aug 2020 14:45:51 +0200 Subject: [PATCH 71/81] [CI skip] Added a few more strings to translation files --- .../core/guide/options/PlayerLanguageOption.java | 5 ++--- .../core/guide/options/SlimefunGuideOption.java | 5 +++++ .../core/guide/options/SlimefunGuideSettings.java | 13 ++++++++++--- .../services/localization/SlimefunLocalization.java | 7 +++++++ src/main/resources/languages/messages_en.yml | 7 +++++++ 5 files changed, 31 insertions(+), 6 deletions(-) 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 25bb7ce80..38acd8e7c 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 @@ -10,7 +10,6 @@ import org.bukkit.Sound; import org.bukkit.entity.Player; import org.bukkit.inventory.ItemStack; -import io.github.thebusybiscuit.cscorelib2.chat.ChatColors; import io.github.thebusybiscuit.cscorelib2.data.PersistentDataAPI; import io.github.thebusybiscuit.cscorelib2.item.CustomItem; import io.github.thebusybiscuit.slimefun4.api.SlimefunAddon; @@ -43,9 +42,9 @@ class PlayerLanguageOption implements SlimefunGuideOption { List lore = new ArrayList<>(); lore.add(""); - lore.add(ChatColors.color("&e&o") + SlimefunPlugin.getLocalization().getMessage(p, "guide.work-in-progress")); + lore.add("&e&o" + SlimefunPlugin.getLocalization().getMessage(p, "guide.work-in-progress")); lore.add(""); - lore.addAll(SlimefunPlugin.getLocalization().getMessages(p, "guide.languages.description")); + lore.addAll(SlimefunPlugin.getLocalization().getMessages(p, "guide.languages.description", msg -> msg.replace("%contributors%", String.valueOf(SlimefunPlugin.getGitHubService().getContributors().size())))); lore.add(""); lore.add("&7\u21E8 &e" + SlimefunPlugin.getLocalization().getMessage(p, "guide.languages.change")); diff --git a/src/main/java/io/github/thebusybiscuit/slimefun4/core/guide/options/SlimefunGuideOption.java b/src/main/java/io/github/thebusybiscuit/slimefun4/core/guide/options/SlimefunGuideOption.java index a61f0d76a..a1318fedf 100644 --- a/src/main/java/io/github/thebusybiscuit/slimefun4/core/guide/options/SlimefunGuideOption.java +++ b/src/main/java/io/github/thebusybiscuit/slimefun4/core/guide/options/SlimefunGuideOption.java @@ -19,6 +19,11 @@ import io.github.thebusybiscuit.slimefun4.core.guide.SlimefunGuide; */ public interface SlimefunGuideOption extends Keyed { + /** + * This returns the {@link SlimefunAddon} which added this {@link SlimefunGuideOption}. + * + * @return The registering {@link SlimefunAddon} + */ SlimefunAddon getAddon(); Optional getDisplayItem(Player p, ItemStack guide); 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 6f7840e5b..09c20cd1a 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 @@ -74,14 +74,21 @@ public final class SlimefunGuideSettings { return false; }); - 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) -> { + List contributorsLore = new ArrayList<>(); + contributorsLore.add(""); + contributorsLore.addAll(SlimefunPlugin.getLocalization().getMessages(p, "guide.credits.description", msg -> msg.replace("%contributors%", String.valueOf(SlimefunPlugin.getGitHubService().getContributors().size())))); + contributorsLore.add(""); + contributorsLore.add("&7\u21E8 &e" + SlimefunPlugin.getLocalization().getMessage(p, "guide.credits.open")); + + menu.addItem(2, new CustomItem(SlimefunUtils.getCustomHead("e952d2b3f351a6b0487cc59db31bf5f2641133e5ba0006b18576e996a0293e52"), "&c" + SlimefunPlugin.getLocalization().getMessage(p, "guide.title.credits"), contributorsLore.toArray(new String[0])), (pl, slot, action, item) -> { ContributorsMenu.open(pl, 0); return false; }); - menu.addItem(4, new CustomItem(Material.WRITABLE_BOOK, "&aSlimefun Version", "&7&o" + SlimefunPlugin.getLocalization().getMessage(p, "guide.tooltips.versions-notice"), "", "&fMinecraft: &a" + Bukkit.getBukkitVersion(), "&fSlimefun: &a" + SlimefunPlugin.getVersion(), "&fCS-CoreLib: &a" + SlimefunPlugin.getCSCoreLibVersion()), ChestMenuUtils.getEmptyClickHandler()); + menu.addItem(4, new CustomItem(Material.WRITABLE_BOOK, ChatColor.GREEN + SlimefunPlugin.getLocalization().getMessage(p, "guide.title.versions"), "&7&o" + SlimefunPlugin.getLocalization().getMessage(p, "guide.tooltips.versions-notice"), "", "&fMinecraft: &a" + Bukkit.getBukkitVersion(), "&fSlimefun: &a" + SlimefunPlugin.getVersion(), "&fCS-CoreLib: &a" + SlimefunPlugin.getCSCoreLibVersion()), ChestMenuUtils.getEmptyClickHandler()); - 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.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"); 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 85e9a202e..4a09fc340 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 @@ -119,6 +119,13 @@ public abstract class SlimefunLocalization extends Localization implements Keyed return messages; } + public List getMessages(Player p, String key, UnaryOperator function) { + List messages = getMessages(p, key); + messages.replaceAll(function); + + return messages; + } + public String getResearchName(Player p, NamespacedKey key) { Language language = getLanguage(p); diff --git a/src/main/resources/languages/messages_en.yml b/src/main/resources/languages/messages_en.yml index e1555655c..f4fac7169 100644 --- a/src/main/resources/languages/messages_en.yml +++ b/src/main/resources/languages/messages_en.yml @@ -86,11 +86,18 @@ guide: addons: 'Addons for Slimefun4' bugs: 'Bug Reports' source: 'Source Code' + versions: 'Installed versions' credits: commit: 'Commit' commits: 'Commits' profile-link: 'Click to visit their profile on GitHub' + open: 'Click to see our contributors' + description: + - '&7Slimefun is an open-source project' + - '&7and maintained by a large community of people.' + - '&7Over &e%contributors% &7people have worked on' + - '&7Slimefun throughout all these years.' roles: developer: '&6Developer' From 9f4c34e826b2c996845bb33e16fc1d9c1b21986f Mon Sep 17 00:00:00 2001 From: Renovate Bot Date: Tue, 18 Aug 2020 21:24:32 +0000 Subject: [PATCH 72/81] Update dependency org.mockito:mockito-core to v3.5.2 --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index 7b3e9f11b..9cd7e2639 100644 --- a/pom.xml +++ b/pom.xml @@ -320,7 +320,7 @@ org.mockito mockito-core - 3.5.0 + 3.5.2 test From aa22e7c9b2f40f795cff97116d712e8d99e4c452 Mon Sep 17 00:00:00 2001 From: TheBusyBiscuit Date: Wed, 19 Aug 2020 13:54:46 +0200 Subject: [PATCH 73/81] [CI skip] A bit of refactoring and documentation --- .../slimefun4/api/network/Network.java | 5 ++ .../guide/options/PlayerLanguageOption.java | 2 +- .../core/services/AutoSavingService.java | 2 +- .../core/services/BackupService.java | 13 +++++- .../core/services/LocalizationService.java | 46 +++++++++++++++---- .../core/services/localization/Language.java | 23 +++++++++- .../implementation/SlimefunPlugin.java | 2 +- .../items/electric/EnergyRegulator.java | 6 ++- .../listeners/WorldListener.java | 2 +- .../Slimefun/api/BlockInfoConfig.java | 8 ++-- .../Slimefun/api/BlockStorage.java | 17 +++---- 11 files changed, 93 insertions(+), 33 deletions(-) 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 0158dbbd4..9cc30d2d0 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 @@ -225,6 +225,11 @@ public abstract class Network { }); } + /** + * This returns the {@link Location} of the regulator block for this {@link Network} + * + * @return The {@link Location} of our regulator + */ public Location getRegulator() { return regulator; } 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 38acd8e7c..961ec32c9 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 @@ -117,7 +117,7 @@ class PlayerLanguageOption implements SlimefunGuideOption { int slot = 10; 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) -> { + menu.addItem(slot, new CustomItem(language.getItem(), ChatColor.GREEN + language.getName(p), "&b" + language.getTranslationProgress() + '%', "", "&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()); 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 f148ec9f6..52d108b52 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 @@ -89,7 +89,7 @@ public class AutoSavingService { Slimefun.getLogger().log(Level.INFO, "Auto-saving block data... (Next auto-save: {0}m)", interval); for (BlockStorage storage : worlds) { - storage.save(false); + storage.save(); } } 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 63630a648..dbe3487ee 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 @@ -37,7 +37,7 @@ public class BackupService implements Runnable { if (backups.size() > MAX_BACKUPS) { try { - deleteOldBackups(backups); + purgeBackups(backups); } catch (IOException e) { Slimefun.getLogger().log(Level.WARNING, "Could not delete an old backup", e); @@ -112,7 +112,16 @@ public class BackupService implements Runnable { } } - private void deleteOldBackups(List backups) throws IOException { + /** + * This method will delete old backups. + * + * @param backups + * The {@link List} of all backups + * + * @throws IOException + * An {@link IOException} is thrown if a {@link File} could not be deleted + */ + private void purgeBackups(List backups) throws IOException { Collections.sort(backups, (a, b) -> { LocalDateTime time1 = LocalDateTime.parse(a.getName().substring(0, a.getName().length() - 4), format); LocalDateTime time2 = LocalDateTime.parse(b.getName().substring(0, b.getName().length() - 4), format); 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 9c0a7683a..da0bf7809 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 @@ -5,11 +5,14 @@ import java.io.IOException; import java.io.InputStreamReader; import java.nio.charset.StandardCharsets; import java.util.Collection; +import java.util.HashSet; import java.util.LinkedHashMap; import java.util.Map; import java.util.Optional; +import java.util.Set; import java.util.logging.Level; +import org.apache.commons.lang.Validate; import org.bukkit.NamespacedKey; import org.bukkit.Server; import org.bukkit.configuration.file.FileConfiguration; @@ -116,7 +119,16 @@ public class LocalizationService extends SlimefunLocalization implements Persist return containsResource("messages_" + language); } + /** + * This returns whether the given {@link Language} is loaded or not. + * + * @param id + * The id of that {@link Language} + * + * @return Whether or not this {@link Language} is loaded + */ public boolean isLanguageLoaded(String id) { + Validate.notNull(id, "The language id cannot be null!"); return languages.containsKey(id); } @@ -173,7 +185,10 @@ public class LocalizationService extends SlimefunLocalization implements Persist } @Override - protected void addLanguage(String id, String hash) { + protected void addLanguage(String id, String texture) { + Validate.notNull(id, "The language id cannot be null!"); + Validate.notNull(texture, "The language texture cannot be null"); + if (hasLanguage(id)) { FileConfiguration messages = streamConfigFile("messages_" + id + ".yml", getConfig().getConfiguration()); FileConfiguration researches = streamConfigFile("researches_" + id + ".yml", null); @@ -181,7 +196,7 @@ public class LocalizationService extends SlimefunLocalization implements Persist FileConfiguration categories = streamConfigFile("categories_" + id + ".yml", null); FileConfiguration recipes = streamConfigFile("recipes_" + id + ".yml", null); - Language language = new Language(id, hash); + Language language = new Language(id, texture); language.setMessagesFile(messages); language.setResearchesFile(researches); language.setResourcesFile(resources); @@ -202,25 +217,36 @@ public class LocalizationService extends SlimefunLocalization implements Persist * * @return A percentage {@code (0.0 - 100.0)} for the progress of translation of that {@link Language} */ - public double getProgress(Language lang) { - int defaultKeys = getTotalKeys(languages.get("en")); + public double calculateProgress(Language lang) { + Validate.notNull(lang, "Cannot get the language progress of null"); - if (defaultKeys == 0) { + Set defaultKeys = getTotalKeys(languages.get("en")); + + if (defaultKeys.isEmpty()) { return 0; } - return Math.min(DoubleHandler.fixDouble(100.0 * (getTotalKeys(lang) / (double) defaultKeys)), 100.0); + Set keys = getTotalKeys(lang); + int matches = 0; + + for (String key : defaultKeys) { + if (keys.contains(key)) { + matches++; + } + } + + return Math.min(DoubleHandler.fixDouble(100.0 * (matches / (double) defaultKeys.size())), 100.0); } - private int getTotalKeys(Language lang) { + private Set getTotalKeys(Language lang) { return getKeys(lang.getFiles()); } - private int getKeys(FileConfiguration... files) { - int keys = 0; + private Set getKeys(FileConfiguration... files) { + Set keys = new HashSet<>(); for (FileConfiguration cfg : files) { - keys += cfg != null ? cfg.getKeys(true).size() : 0; + keys.addAll(cfg.getKeys(true)); } return keys; 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 0a7ecaa8b..a37bb397b 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 @@ -25,6 +25,7 @@ public final class Language { private final String id; private final ItemStack item; + private double progress = -1; private FileConfiguration messages; private FileConfiguration researches; @@ -60,6 +61,26 @@ public final class Language { return id; } + /** + * This method returns the progress of translation for this {@link Language}. + * The progress is determined by the amount of translated strings divided by the amount + * of strings in the english {@link Language} file and multiplied by 100.0 + * + * @return A percentage {@code (0.0 - 100.0)} for the progress of translation of this {@link Language} + */ + public double getTranslationProgress() { + if (id.equals("en")) { + return 100.0; + } + else { + if (progress < 0) { + progress = SlimefunPlugin.getLocalization().calculateProgress(this); + } + + return progress; + } + } + FileConfiguration getMessagesFile() { return messages; } @@ -145,7 +166,7 @@ public final class Language { @Override public String toString() { - return "Language [ id= " + id + " | default=" + isDefault() + " ]"; + return "Language {id= " + id + ", default=" + isDefault() + " }"; } public FileConfiguration[] getFiles() { diff --git a/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/SlimefunPlugin.java b/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/SlimefunPlugin.java index b802f54e7..cab5348c2 100644 --- a/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/SlimefunPlugin.java +++ b/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/SlimefunPlugin.java @@ -367,7 +367,7 @@ public final class SlimefunPlugin extends JavaPlugin implements SlimefunAddon { // Save all registered Worlds for (Map.Entry entry : getRegistry().getWorlds().entrySet()) { try { - entry.getValue().save(true); + entry.getValue().saveAndRemove(); } catch (Exception x) { getLogger().log(Level.SEVERE, x, () -> "An Error occurred while saving Slimefun-Blocks in World '" + entry.getKey() + "' for Slimefun " + getVersion()); diff --git a/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/items/electric/EnergyRegulator.java b/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/items/electric/EnergyRegulator.java index c26043fde..f11334f97 100644 --- a/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/items/electric/EnergyRegulator.java +++ b/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/items/electric/EnergyRegulator.java @@ -59,9 +59,13 @@ public class EnergyRegulator extends SlimefunItem { @Override public void tick(Block b, SlimefunItem item, Config data) { - EnergyNet.getNetworkFromLocationOrCreate(b.getLocation()).tick(b); + EnergyRegulator.this.tick(b); } }); } + private void tick(Block b) { + EnergyNet.getNetworkFromLocationOrCreate(b.getLocation()).tick(b); + } + } 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 31b64d0c2..1e4617fae 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 @@ -28,7 +28,7 @@ public class WorldListener implements Listener { BlockStorage storage = BlockStorage.getStorage(e.getWorld()); if (storage != null) { - storage.save(true); + storage.saveAndRemove(); } else { Slimefun.getLogger().log(Level.SEVERE, "Could not save Slimefun Blocks for World \"{0}\"", e.getWorld().getName()); diff --git a/src/main/java/me/mrCookieSlime/Slimefun/api/BlockInfoConfig.java b/src/main/java/me/mrCookieSlime/Slimefun/api/BlockInfoConfig.java index d3e4f14f3..5b525a1f2 100644 --- a/src/main/java/me/mrCookieSlime/Slimefun/api/BlockInfoConfig.java +++ b/src/main/java/me/mrCookieSlime/Slimefun/api/BlockInfoConfig.java @@ -87,10 +87,6 @@ public class BlockInfoConfig extends Config { return data.keySet(); } - private UnsupportedOperationException invalidType(String path) { - return new UnsupportedOperationException("Can't get \"" + path + "\" because BlockInfoConfig only supports String values"); - } - @Override public int getInt(String path) { throw invalidType(path); @@ -121,6 +117,10 @@ public class BlockInfoConfig extends Config { throw invalidType(path); } + private UnsupportedOperationException invalidType(String path) { + return new UnsupportedOperationException("Can't get \"" + path + "\" because BlockInfoConfig only supports String values"); + } + @Override public File getFile() { throw new UnsupportedOperationException(); diff --git a/src/main/java/me/mrCookieSlime/Slimefun/api/BlockStorage.java b/src/main/java/me/mrCookieSlime/Slimefun/api/BlockStorage.java index 92824b214..b261a0b37 100644 --- a/src/main/java/me/mrCookieSlime/Slimefun/api/BlockStorage.java +++ b/src/main/java/me/mrCookieSlime/Slimefun/api/BlockStorage.java @@ -288,14 +288,8 @@ public class BlockStorage { return changes; } - public void save(boolean remove) { - save(true, remove); - } - - public void save(boolean computeChanges, boolean remove) { - if (computeChanges) { - computeChanges(); - } + public void save() { + computeChanges(); if (changes == 0) { return; @@ -344,10 +338,11 @@ public class BlockStorage { } changes = 0; + } - if (remove) { - SlimefunPlugin.getRegistry().getWorlds().remove(world.getName()); - } + public void saveAndRemove() { + save(); + SlimefunPlugin.getRegistry().getWorlds().remove(world.getName()); } public static void saveChunks() { From dbd5cc16411bae1554ea73e7d161eabe52df0e8a Mon Sep 17 00:00:00 2001 From: SoSeDiK Date: Wed, 19 Aug 2020 12:20:08 +0000 Subject: [PATCH 74/81] Translate messages_ru.yml via GitLocalize --- src/main/resources/languages/messages_ru.yml | 28 +++++++++++++++++--- 1 file changed, 25 insertions(+), 3 deletions(-) diff --git a/src/main/resources/languages/messages_ru.yml b/src/main/resources/languages/messages_ru.yml index 5b163e04a..f1989d92a 100644 --- a/src/main/resources/languages/messages_ru.yml +++ b/src/main/resources/languages/messages_ru.yml @@ -40,6 +40,12 @@ guide: select: Нажмите для выбора этого языка select-default: Нажмите для выбора языка по умолчанию selected-language: 'Сейчас выбрано:' + change: Нажмите для выбора нового языка + description: + - "&7У Вас теперь есть возможность" + - "&7выбрать язык, на котором Slimefun" + - "&7будет отправлять сообщения." + - "&7Предметы пока не могут быть переведены." title: main: Руководство Slimefun settings: Информация и настройки @@ -49,6 +55,7 @@ guide: addons: Дополнения к Slimefun4 bugs: Отчёты об ошибках source: Исходный код + versions: Установленные версии credits: commit: Коммит commits: Коммитов @@ -58,6 +65,12 @@ guide: resourcepack: "&cТекстурщик" translator: "&9Локализатор" profile-link: Нажмите, чтобы посетить GitHub профиль + open: Нажмите для просмотра списка авторов + description: + - "&7Slimefun — проект с открытым исходным кодом," + - "&7и поддерживается большим сообществом хороших людей." + - "&7Свыше &e%contributors% &7людей работали над" + - "&7Slimefun за все эти долгие годы." pages: previous: Предыдущая страница next: Следующая страница @@ -79,6 +92,7 @@ guide: - Для начала Вы должны - разблокировать все предметы - из следующих категорий + work-in-progress: Эта функция ещё не полностью завершена! messages: not-researched: "&4Вам не хватает знаний, чтобы понять это" not-enough-xp: "&4У Вас недостаточно опыта, чтобы исследовать это" @@ -96,7 +110,6 @@ messages: 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на себе…" @@ -161,6 +174,10 @@ messages: wrong-world: "&cВаш якорь находится в другом мире!" distance: "&7Измерение завершено. &eРасстояние: %distance%" anchor-set: "&aЯкорь успешно установлен:&e %anchor%" + multi-tool: + mode-change: "&bРежим «%device%» изменён на: &9%mode%" + not-shears: "&cМультиинструмент не может быть использован в качестве ножниц!" + mode-change: "&b%device% | Режим изменён на: &9%mode%" machines: pattern-not-found: "&eК сожалению, не удалось распознать этот рецепт. Пожалуйста, разложите предметы в верной последовательности в раздатчик." @@ -230,6 +247,7 @@ gps: цветовые коды!)" added: "&aКонтрольная точка успешно добавлена" max: "&4Вы достигли максимального количества контрольных точек" + duplicate: "&4Вы уже создали контрольную точку с таким названием: &f%waypoint%" insufficient-complexity: - "&4Недостаточная общая сила сигнала GPS сети: &c%complexity%" - "&4а) Ваша GPS сеть пока что не подключена" @@ -302,7 +320,7 @@ languages: zh-CN: Китайский (Китай) el: Греческий he: Иврит - pt: Португальский (Португалия) + pt-BR: Португальский (Бразилия) ar: Арабский af: Бурский da: Датский @@ -314,7 +332,7 @@ languages: fa: Персидский th: Тайский ro: Румынский - pt-BR: Португальский (Бразилия) + pt: Португальский (Португалия) bg: Болгарский ko: Корейский tr: Турецкий @@ -323,5 +341,9 @@ languages: sr: Сербский be: Белорусский tl: Тагальский +brewing_stand: + not-working: "&4Вы не можете использовать Slimefun предметы в варочной стойке!" +villagers: + no-trading: "&4Вы не можете торговаться с крестьянами Slimefun предметами!" miner: no-ores: "&eК сожалению, не удалось найти какую-либо руду поблизости!" From 4429bd3c705f77a6eac21508d65cec051d7cb8b5 Mon Sep 17 00:00:00 2001 From: TheBusyBiscuit Date: Wed, 19 Aug 2020 12:20:09 +0000 Subject: [PATCH 75/81] Translate messages_ru.yml via GitLocalize From 273e459e263b5a59d70345bac9e5aec3a93ff89b Mon Sep 17 00:00:00 2001 From: SoSeDiK Date: Wed, 19 Aug 2020 12:20:10 +0000 Subject: [PATCH 76/81] Translate recipes_ru.yml via GitLocalize --- src/main/resources/languages/recipes_ru.yml | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/main/resources/languages/recipes_ru.yml b/src/main/resources/languages/recipes_ru.yml index a888b0340..99781cb13 100644 --- a/src/main/resources/languages/recipes_ru.yml +++ b/src/main/resources/languages/recipes_ru.yml @@ -118,6 +118,11 @@ slimefun: lore: - Создаётся так, как показано, - используя Refinery + barter_drop: + name: Предмет товарообмена с пиглином + lore: + - 'Обменяйтесь с пиглином, используя золотые ' + - слитки, чтобы заполучить этот предмет minecraft: shaped: name: Обычный рецепт From 15487fb33341cb77db75cefe877a66facdf19a2c Mon Sep 17 00:00:00 2001 From: TheBusyBiscuit Date: Wed, 19 Aug 2020 12:33:36 +0000 Subject: [PATCH 77/81] Translate messages_de.yml via GitLocalize --- src/main/resources/languages/messages_de.yml | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/src/main/resources/languages/messages_de.yml b/src/main/resources/languages/messages_de.yml index 8dbec9751..7027ecd20 100644 --- a/src/main/resources/languages/messages_de.yml +++ b/src/main/resources/languages/messages_de.yml @@ -56,6 +56,7 @@ guide: addons: Addons für Slimefun4 bugs: Fehlermeldungen source: Quellcode + versions: Installierte Versionen credits: commit: Beitrag commits: Beiträge @@ -65,6 +66,12 @@ guide: resourcepack: "&cRessourcenpaket-Designer" translator: "&9Übersetzer" profile-link: Klick um mich auf GitHub zu sehen + open: Klicke um Mitwirkende zu sehen + description: + - "&7Slimefun ist ein Open-Source Projekt" + - "&7und wird von einer riesigen Community entwickelt." + - "&7Über &e%contributors% &7Personen haben bereits" + - "&7an Slimefun mitgewirkt." pages: previous: Vorherige Seite next: Nächste Seite @@ -317,6 +324,7 @@ languages: zh-CN: Chinesisch (China) el: Griechisch he: Hebräisch + pt: Portugiesisch (Portugal) pt-BR: Portugiesisch (Brasilien) ar: Arabisch af: Afrikaans @@ -329,7 +337,6 @@ languages: fa: Persisch th: Thailändisch ro: Rumänisch - pt: Portugiesisch (Portugal) bg: Bulgarisch ko: Koreanisch tr: Türkisch From 04214ed11396d3c395aa9e12afd6957f5c93753e Mon Sep 17 00:00:00 2001 From: LinoxGH Date: Wed, 19 Aug 2020 12:42:32 +0000 Subject: [PATCH 78/81] Translate recipes_tr.yml via GitLocalize From 5f0df75b81cd00fe30bb1da9a18775ad5348b9a8 Mon Sep 17 00:00:00 2001 From: LinoxGH Date: Wed, 19 Aug 2020 12:42:33 +0000 Subject: [PATCH 79/81] Translate messages_tr.yml via GitLocalize --- src/main/resources/languages/messages_tr.yml | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/main/resources/languages/messages_tr.yml b/src/main/resources/languages/messages_tr.yml index 954d94865..56cf6ba96 100644 --- a/src/main/resources/languages/messages_tr.yml +++ b/src/main/resources/languages/messages_tr.yml @@ -56,6 +56,7 @@ guide: addons: Slimefun4 için Eklentiler bugs: Hata Raporları source: Kaynak Kodu + versions: Yüklü sürümler credits: commit: Geliştiirme commits: Geliştirmeler @@ -65,6 +66,12 @@ guide: resourcepack: "&cKaynak Paketi Tasarımcısı" translator: "&9Çevirmen" profile-link: GitHubdaki profillerini ziyaret etmek için tıklayın + open: Bize katkıda bulunanları görmek için tıklayın + description: + - "&7Slimefun açık kaynak kodlu bir projedir" + - "&7ve büyük bir topluluk tarafından geliştirilir." + - "&e%contributors%&7den(dan) fazla kişi yıllar" + - "&7boyunca Slimefun'a katkıda bulundu." pages: previous: Önceki sayfa next: Sonraki sayfa From 310622c3ac188a0a005f10fcc7e5f609b9e17982 Mon Sep 17 00:00:00 2001 From: Vravinite Date: Wed, 19 Aug 2020 23:50:04 +0000 Subject: [PATCH 80/81] Translate messages_es.yml via GitLocalize --- src/main/resources/languages/messages_es.yml | 45 +++++++++++--------- 1 file changed, 26 insertions(+), 19 deletions(-) diff --git a/src/main/resources/languages/messages_es.yml b/src/main/resources/languages/messages_es.yml index c9ea285d7..eaa8ef06c 100644 --- a/src/main/resources/languages/messages_es.yml +++ b/src/main/resources/languages/messages_es.yml @@ -24,27 +24,27 @@ guide: search: message: "&b¿Qué te gustaría buscar?" name: "&7Busca..." - tooltip: "&bClick para buscar un item" + tooltip: "&bCliquea para buscar un objeto" 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!" + no-multiblocks: "&4¡No puedes regalarte los Multiblocks, tienes que construirlos!" 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. + lore: Cliquea para agregar tu propia traducción. + select: Cliquea para seleccionar este idioma. + select-default: Cliquea para seleccionar el idioma predeterminado. selected-language: 'Actualmente seleccionado:' change: Click para seleccionar un nuevo lenguaje description: - "&7Ahora tienes la opción de cambiar" - "&7el idioma en el que Slimefun" - - "&7se le presentará. Items" - - "&7no puede ser traducido por ahora." + - "&7se le presentará. Los objetos" + - "&7no pueden ser traducidos por ahora." title: main: Guía de Slimefun. settings: Configuración e Información. @@ -54,6 +54,7 @@ guide: addons: Complementos para Slimefun4 bugs: Reportes de Bugs source: Código base + versions: Versiones instaladas credits: commit: Contribución commits: Contribuciones @@ -62,12 +63,18 @@ guide: wiki: "&3Editor de Wiki" resourcepack: "&cArtista de Resourcepack" translator: "&9Traductor" - profile-link: Clic para visitar su perfil en GitHub. + profile-link: Cliquea para visitar su perfil en GitHub. + open: Cliquea para ver nuestros contribuyentes + description: + - "&7Slimefun es un proyecto open-source" + - "&7mantenido por una gran comunidad." + - "&7Mas de &e%contributors% &7personas han trabajado en" + - "&7Slimefun en todos estos años." pages: previous: Página anterior next: Página siguiente tooltips: - open-category: Clic para abrir + open-category: Cliquea para abrir versions-notice: "¡Esto es muy importante cuando se reportan bugs!" wiki: Ve este objeto en la wiki oficial de Slimefun recipes: @@ -84,7 +91,7 @@ guide: - Para desbloquear esta categoría deberás - desbloquear todos los objetos de las - siguientes categorías - work-in-progress: Esta característica no esta completamente terminada todavia!! + work-in-progress: "¡¡¡Esta característica no está completamente terminada todavía!!" messages: not-researched: "&4No tienes conocimiento suficiente para entender esto." not-enough-xp: "&4No tienes suficiente XP para desbloquear esto." @@ -156,19 +163,19 @@ messages: - "&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!" - piglin-barter: "&4No puedes tradear con piglins usando items de Slimefun" + piglin-barter: "&4No puedes trocar con piglins usando objetos de Slimefun" enchantment-rune: - fail: "&cNo puedes encantar este item." - no-enchantment: "&cNo se pudo encontrar un encantamiento aplicable a este item." - success: "&aHas aplicado con éxito un encantamiento aleatorio a este item." + fail: "&cNo puedes encantar este objeto." + no-enchantment: "&cNo se pudo encontrar un encantamiento aplicable a este objeto." + success: "&aHas aplicado con éxito un encantamiento aleatorio a este objeto." tape-measure: - no-anchor: "&cNecesitas establecer un ancla antes de comenzar a medir!" - wrong-world: "&cParece ser que tu ancla se encuentra en un mundo diferente!" + no-anchor: "&c¡Necesitas establecer un ancla antes de comenzar a medir!" + wrong-world: "&c¡Parece ser que tu ancla se encuentra en un mundo diferente!" distance: "&7Medida tomada. &eDistancia: %distance%" anchor-set: "&aAncla establecida con éxito:&e %anchor%" multi-tool: mode-change: "&b%device% modo cambiado a: &9%mode%" - not-shears: "&cUna Multi Tool no puede ser usada como tijeras!" + not-shears: "&c¡Una Multi Tool no puede ser usada como tijeras!" mode-change: 'El modo de &b%device% ha cambiado a: &9%mode%' machines: pattern-not-found: "&eLo siento, no puedo reconocer esta receta. Por favor coloca @@ -206,7 +213,7 @@ machines: invulnerability: "&b&l¡Tienes 30 segundos de invulnerabilidad!" gui: title: Tus waypoints - tooltip: Click para teletransportarte + tooltip: Cliquea para teletransportarte time: Tiempo estimado CARGO_NODES: must-be-placed: "&4¡Tiene que ponerse sobre un cofre o máquina!" @@ -336,6 +343,6 @@ languages: brewing_stand: not-working: "&4¡No puedes usar objetos de Slimefun en un soporte para pociones!" villagers: - no-trading: "&4No puedes tradear Slimefun items con los aldeanos!" + no-trading: "&4¡No puedes comerciar objetos de Slimefun con los aldeanos!" miner: no-ores: "&ePerdón, ¡No encuentro ningún mineral cerca!" From fc7587b51712a434edf74074bc408be90c60b133 Mon Sep 17 00:00:00 2001 From: Luu7 Date: Wed, 19 Aug 2020 23:50:05 +0000 Subject: [PATCH 81/81] Translate messages_es.yml via GitLocalize