From 78dcaa432873d59232381481364831a2e77c43bc Mon Sep 17 00:00:00 2001 From: "Panda.com" Date: Thu, 15 Oct 2020 14:42:44 +0200 Subject: [PATCH 01/34] fixes #2470 --- .../tags/block_placer_ignored_materials.json | 95 ++++++++++++++++++- 1 file changed, 90 insertions(+), 5 deletions(-) diff --git a/src/main/resources/tags/block_placer_ignored_materials.json b/src/main/resources/tags/block_placer_ignored_materials.json index a41e8050e..19e797783 100644 --- a/src/main/resources/tags/block_placer_ignored_materials.json +++ b/src/main/resources/tags/block_placer_ignored_materials.json @@ -14,12 +14,97 @@ "id" : "#minecraft:doors", "required" : false }, - "minecraft:sugar_cane", - "minecraft:lily_pad", - "minecraft:dead_bush", { "id" : "minecraft:bamboo", "required" : false - } - ] + }, + { + "id" : "minecraft:rails", + "required" : false + }, + { + "id" : "minecraft:small_flowers", + "required" : false + }, + { + "id" : "minecraft:coral_blocks", + "required" : false + }, + { + "id" : "minecraft:coral_plants", + "required" : false + }, + { + "id" : "minecraft:small_flowers", + "required" : false + }, + { + "id" : "minecraft:buttons", + "required" : false + }, + { + "id" : "minecraft:banners", + "required" : false + }, + { + "id" : "minecraft:signs", + "required" : false + }, + { + "id" : "minecraft:standing_signs", + "required" : false + }, + { + "id" : "minecraft:wall_signs", + "required" : false + }, + { + "id" : "minecraft:wooden_pressure_plates", + "required" : false + }, + { + "id" : "minecraft:nether_sprouts", + "required" : false + }, + { + "id" : "minecraft:crimson_roots", + "required" : false + }, + { + "id" : "minecraft:twisting_vines", + "required" : false + }, + { + "id" : "warped_roots", + "required" : false + }, + { + "id" : "weeping_vines", + "required" : false + }, + { + "id" : "polished_blackstone_pressure_plate", + "required" : false + }, + { + "id" : "warped_roots", + "required" : false + }, + "minecraft:sugar_cane", + "minecraft:lily_pad", + "minecraft:dead_bush", + "minecraft:fern", + "minecraft:grass", + "minecraft:seagrass", + "minecraft:tall_seagrass", + "minecraft:cactus", + "minecraft:kelp", + "minecraft:ladder", + "minecraft:snow", + "minecraft:lever", + "minecraft:repeater", + "minecraft:tripwire_hook", + "minecraft:tall_grass", + "minecraft:large_fern" + ] } From b70949a3861b12dd196494578e426480e8980a0f Mon Sep 17 00:00:00 2001 From: "Panda.com" Date: Thu, 15 Oct 2020 14:59:44 +0200 Subject: [PATCH 02/34] fixed fingerscrossed --- .../tags/block_placer_ignored_materials.json | 171 +++++++----------- 1 file changed, 63 insertions(+), 108 deletions(-) diff --git a/src/main/resources/tags/block_placer_ignored_materials.json b/src/main/resources/tags/block_placer_ignored_materials.json index 19e797783..053691770 100644 --- a/src/main/resources/tags/block_placer_ignored_materials.json +++ b/src/main/resources/tags/block_placer_ignored_materials.json @@ -1,110 +1,65 @@ { - "values" : [ - "#slimefun:sensitive_materials", - "#slimefun:mushrooms", - { - "id" : "#minecraft:tall_flowers", - "required" : false - }, - { - "id" : "#minecraft:beds", - "required" : false - }, - { - "id" : "#minecraft:doors", - "required" : false - }, - { - "id" : "minecraft:bamboo", - "required" : false - }, - { - "id" : "minecraft:rails", - "required" : false - }, - { - "id" : "minecraft:small_flowers", - "required" : false - }, - { - "id" : "minecraft:coral_blocks", - "required" : false - }, - { - "id" : "minecraft:coral_plants", - "required" : false - }, - { - "id" : "minecraft:small_flowers", - "required" : false - }, - { - "id" : "minecraft:buttons", - "required" : false - }, - { - "id" : "minecraft:banners", - "required" : false - }, - { - "id" : "minecraft:signs", - "required" : false - }, - { - "id" : "minecraft:standing_signs", - "required" : false - }, - { - "id" : "minecraft:wall_signs", - "required" : false - }, - { - "id" : "minecraft:wooden_pressure_plates", - "required" : false - }, - { - "id" : "minecraft:nether_sprouts", - "required" : false - }, - { - "id" : "minecraft:crimson_roots", - "required" : false - }, - { - "id" : "minecraft:twisting_vines", - "required" : false - }, - { - "id" : "warped_roots", - "required" : false - }, - { - "id" : "weeping_vines", - "required" : false - }, - { - "id" : "polished_blackstone_pressure_plate", - "required" : false - }, - { - "id" : "warped_roots", - "required" : false - }, - "minecraft:sugar_cane", - "minecraft:lily_pad", - "minecraft:dead_bush", - "minecraft:fern", - "minecraft:grass", - "minecraft:seagrass", - "minecraft:tall_seagrass", - "minecraft:cactus", - "minecraft:kelp", - "minecraft:ladder", - "minecraft:snow", - "minecraft:lever", - "minecraft:repeater", - "minecraft:tripwire_hook", - "minecraft:tall_grass", - "minecraft:large_fern" - ] + "values": [ + "#slimefun:sensitive_materials", + "#slimefun:mushrooms", + "#minecraft:tall_flowers", + "#minecraft:beds", + "#minecraft:doors", + "minecraft:bamboo", + "#minecraft:rails", + "#minecraft:small_flowers", + "#minecraft:coral_blocks", + "#minecraft:coral_plants", + "#minecraft:small_flowers", + "#minecraft:buttons", + "#minecraft:banners", + "#minecraft:signs", + "#minecraft:standing_signs", + "#minecraft:wall_signs", + "#minecraft:wooden_pressure_plates", + { + "id": "#minecraft:nether_sprouts", + "required": false + }, + { + "id": "#minecraft:crimson_roots", + "required": false + }, + { + "id": "#minecraft:twisting_vines", + "required": false + }, + { + "id": "#warped_roots", + "required": false + }, + { + "id": "#weeping_vines", + "required": false + }, + { + "id": "#polished_blackstone_pressure_plate", + "required": false + }, + { + "id": "#warped_roots", + "required": false + }, + "minecraft:sugar_cane", + "minecraft:lily_pad", + "minecraft:dead_bush", + "minecraft:fern", + "minecraft:grass", + "minecraft:seagrass", + "minecraft:tall_seagrass", + "minecraft:cactus", + "minecraft:kelp", + "minecraft:ladder", + "minecraft:snow", + "minecraft:lever", + "minecraft:repeater", + "minecraft:tripwire_hook", + "minecraft:tall_grass", + "minecraft:large_fern" + ] } From 0b27ea6ed5d9396762e6803ff13ccb3db107a72a Mon Sep 17 00:00:00 2001 From: "Panda.com" Date: Thu, 15 Oct 2020 15:03:02 +0200 Subject: [PATCH 03/34] ? --- .../tags/block_placer_ignored_materials.json | 123 +++++++++--------- 1 file changed, 61 insertions(+), 62 deletions(-) diff --git a/src/main/resources/tags/block_placer_ignored_materials.json b/src/main/resources/tags/block_placer_ignored_materials.json index 053691770..1aa98ff10 100644 --- a/src/main/resources/tags/block_placer_ignored_materials.json +++ b/src/main/resources/tags/block_placer_ignored_materials.json @@ -1,65 +1,64 @@ { "values": [ - "#slimefun:sensitive_materials", - "#slimefun:mushrooms", - "#minecraft:tall_flowers", - "#minecraft:beds", - "#minecraft:doors", - "minecraft:bamboo", - "#minecraft:rails", - "#minecraft:small_flowers", - "#minecraft:coral_blocks", - "#minecraft:coral_plants", - "#minecraft:small_flowers", - "#minecraft:buttons", - "#minecraft:banners", - "#minecraft:signs", - "#minecraft:standing_signs", - "#minecraft:wall_signs", - "#minecraft:wooden_pressure_plates", - { - "id": "#minecraft:nether_sprouts", - "required": false - }, - { - "id": "#minecraft:crimson_roots", - "required": false - }, - { - "id": "#minecraft:twisting_vines", - "required": false - }, - { - "id": "#warped_roots", - "required": false - }, - { - "id": "#weeping_vines", - "required": false - }, - { - "id": "#polished_blackstone_pressure_plate", - "required": false - }, - { - "id": "#warped_roots", - "required": false - }, - "minecraft:sugar_cane", - "minecraft:lily_pad", - "minecraft:dead_bush", - "minecraft:fern", - "minecraft:grass", - "minecraft:seagrass", - "minecraft:tall_seagrass", - "minecraft:cactus", - "minecraft:kelp", - "minecraft:ladder", - "minecraft:snow", - "minecraft:lever", - "minecraft:repeater", - "minecraft:tripwire_hook", - "minecraft:tall_grass", - "minecraft:large_fern" - ] + "#slimefun:mushrooms", + "#minecraft:tall_flowers", + "#minecraft:beds", + "#minecraft:doors", + "minecraft:bamboo", + "#minecraft:rails", + "#minecraft:small_flowers", + "#minecraft:coral_blocks", + "#minecraft:coral_plants", + "#minecraft:small_flowers", + "#minecraft:buttons", + "#minecraft:banners", + "#minecraft:signs", + "#minecraft:standing_signs", + "#minecraft:wall_signs", + "#minecraft:wooden_pressure_plates", + { + "id": "#minecraft:nether_sprouts", + "required": false + }, + { + "id": "#minecraft:crimson_roots", + "required": false + }, + { + "id": "#minecraft:twisting_vines", + "required": false + }, + { + "id": "#warped_roots", + "required": false + }, + { + "id": "#weeping_vines", + "required": false + }, + { + "id": "#polished_blackstone_pressure_plate", + "required": false + }, + { + "id": "#warped_roots", + "required": false + }, + "minecraft:sugar_cane", + "minecraft:lily_pad", + "minecraft:dead_bush", + "minecraft:fern", + "minecraft:grass", + "minecraft:seagrass", + "minecraft:tall_seagrass", + "minecraft:cactus", + "minecraft:kelp", + "minecraft:ladder", + "minecraft:snow", + "minecraft:lever", + "minecraft:repeater", + "minecraft:tripwire_hook", + "minecraft:tall_grass", + "minecraft:large_fern" + ] } From 27583fc3f0fab081bd78a4ebe4fc4092f9b25a19 Mon Sep 17 00:00:00 2001 From: "Panda.com" Date: Thu, 15 Oct 2020 15:05:06 +0200 Subject: [PATCH 04/34] 1 eternity later --- .../tags/block_placer_ignored_materials.json | 122 +++++++++--------- 1 file changed, 61 insertions(+), 61 deletions(-) diff --git a/src/main/resources/tags/block_placer_ignored_materials.json b/src/main/resources/tags/block_placer_ignored_materials.json index 1aa98ff10..69ea2f946 100644 --- a/src/main/resources/tags/block_placer_ignored_materials.json +++ b/src/main/resources/tags/block_placer_ignored_materials.json @@ -1,64 +1,64 @@ { "values": [ - "#slimefun:mushrooms", - "#minecraft:tall_flowers", - "#minecraft:beds", - "#minecraft:doors", - "minecraft:bamboo", - "#minecraft:rails", - "#minecraft:small_flowers", - "#minecraft:coral_blocks", - "#minecraft:coral_plants", - "#minecraft:small_flowers", - "#minecraft:buttons", - "#minecraft:banners", - "#minecraft:signs", - "#minecraft:standing_signs", - "#minecraft:wall_signs", - "#minecraft:wooden_pressure_plates", - { - "id": "#minecraft:nether_sprouts", - "required": false - }, - { - "id": "#minecraft:crimson_roots", - "required": false - }, - { - "id": "#minecraft:twisting_vines", - "required": false - }, - { - "id": "#warped_roots", - "required": false - }, - { - "id": "#weeping_vines", - "required": false - }, - { - "id": "#polished_blackstone_pressure_plate", - "required": false - }, - { - "id": "#warped_roots", - "required": false - }, - "minecraft:sugar_cane", - "minecraft:lily_pad", - "minecraft:dead_bush", - "minecraft:fern", - "minecraft:grass", - "minecraft:seagrass", - "minecraft:tall_seagrass", - "minecraft:cactus", - "minecraft:kelp", - "minecraft:ladder", - "minecraft:snow", - "minecraft:lever", - "minecraft:repeater", - "minecraft:tripwire_hook", - "minecraft:tall_grass", - "minecraft:large_fern" - ] + "#slimefun:mushrooms", + "#minecraft:tall_flowers", + "#minecraft:beds", + "#minecraft:doors", + "minecraft:bamboo", + "#minecraft:rails", + "#minecraft:small_flowers", + "#minecraft:coral_blocks", + "#minecraft:coral_plants", + "#minecraft:small_flowers", + "#minecraft:buttons", + "#minecraft:banners", + "#minecraft:signs", + "#minecraft:standing_signs", + "#minecraft:wall_signs", + "#minecraft:wooden_pressure_plates", + { + "id": "#minecraft:nether_sprouts", + "required": false + }, + { + "id": "#minecraft:crimson_roots", + "required": false + }, + { + "id": "#minecraft:twisting_vines", + "required": false + }, + { + "id": "#warped_roots", + "required": false + }, + { + "id": "#weeping_vines", + "required": false + }, + { + "id": "#polished_blackstone_pressure_plate", + "required": false + }, + { + "id": "#warped_roots", + "required": false + }, + "minecraft:sugar_cane", + "minecraft:lily_pad", + "minecraft:dead_bush", + "minecraft:fern", + "minecraft:grass", + "minecraft:seagrass", + "minecraft:tall_seagrass", + "minecraft:cactus", + "minecraft:kelp", + "minecraft:ladder", + "minecraft:snow", + "minecraft:lever", + "minecraft:repeater", + "minecraft:tripwire_hook", + "minecraft:tall_grass", + "minecraft:large_fern" + ] } From ee3e358f314a2bd8f498bf623ab894fb57182d23 Mon Sep 17 00:00:00 2001 From: "Panda.com" Date: Thu, 15 Oct 2020 15:07:50 +0200 Subject: [PATCH 05/34] :pansad: --- .../tags/block_placer_ignored_materials.json | 124 +++++++++--------- 1 file changed, 62 insertions(+), 62 deletions(-) diff --git a/src/main/resources/tags/block_placer_ignored_materials.json b/src/main/resources/tags/block_placer_ignored_materials.json index 69ea2f946..e0fd24cc9 100644 --- a/src/main/resources/tags/block_placer_ignored_materials.json +++ b/src/main/resources/tags/block_placer_ignored_materials.json @@ -1,64 +1,64 @@ { - "values": [ - "#slimefun:mushrooms", - "#minecraft:tall_flowers", - "#minecraft:beds", - "#minecraft:doors", - "minecraft:bamboo", - "#minecraft:rails", - "#minecraft:small_flowers", - "#minecraft:coral_blocks", - "#minecraft:coral_plants", - "#minecraft:small_flowers", - "#minecraft:buttons", - "#minecraft:banners", - "#minecraft:signs", - "#minecraft:standing_signs", - "#minecraft:wall_signs", - "#minecraft:wooden_pressure_plates", - { - "id": "#minecraft:nether_sprouts", - "required": false - }, - { - "id": "#minecraft:crimson_roots", - "required": false - }, - { - "id": "#minecraft:twisting_vines", - "required": false - }, - { - "id": "#warped_roots", - "required": false - }, - { - "id": "#weeping_vines", - "required": false - }, - { - "id": "#polished_blackstone_pressure_plate", - "required": false - }, - { - "id": "#warped_roots", - "required": false - }, - "minecraft:sugar_cane", - "minecraft:lily_pad", - "minecraft:dead_bush", - "minecraft:fern", - "minecraft:grass", - "minecraft:seagrass", - "minecraft:tall_seagrass", - "minecraft:cactus", - "minecraft:kelp", - "minecraft:ladder", - "minecraft:snow", - "minecraft:lever", - "minecraft:repeater", - "minecraft:tripwire_hook", - "minecraft:tall_grass", - "minecraft:large_fern" - ] + "values": [ + "#slimefun:mushrooms", + "#minecraft:tall_flowers", + "#minecraft:beds", + "#minecraft:doors", + "minecraft:bamboo", + "#minecraft:rails", + "#minecraft:small_flowers", + "#minecraft:coral_blocks", + "#minecraft:coral_plants", + "#minecraft:small_flowers", + "#minecraft:buttons", + "#minecraft:banners", + "#minecraft:signs", + "#minecraft:standing_signs", + "#minecraft:wall_signs", + "#minecraft:wooden_pressure_plates", + { + "id": "#minecraft:nether_sprouts", + "required": false + }, + { + "id": "#minecraft:crimson_roots", + "required": false + }, + { + "id": "#minecraft:twisting_vines", + "required": false + }, + { + "id": "#warped_roots", + "required": false + }, + { + "id": "#weeping_vines", + "required": false + }, + { + "id": "#polished_blackstone_pressure_plate", + "required": false + }, + { + "id": "#warped_roots", + "required": false + }, + "minecraft:sugar_cane", + "minecraft:lily_pad", + "minecraft:dead_bush", + "minecraft:fern", + "minecraft:grass", + "minecraft:seagrass", + "minecraft:tall_seagrass", + "minecraft:cactus", + "minecraft:kelp", + "minecraft:ladder", + "minecraft:snow", + "minecraft:lever", + "minecraft:repeater", + "minecraft:tripwire_hook", + "minecraft:tall_grass", + "minecraft:large_fern" + ] } From 3b43dd7ebc44ef8f04e15f3c7dc306fef3356094 Mon Sep 17 00:00:00 2001 From: "Panda.com" Date: Thu, 15 Oct 2020 15:08:42 +0200 Subject: [PATCH 06/34] good now? --- .../tags/block_placer_ignored_materials.json | 124 +++++++++--------- 1 file changed, 62 insertions(+), 62 deletions(-) diff --git a/src/main/resources/tags/block_placer_ignored_materials.json b/src/main/resources/tags/block_placer_ignored_materials.json index e0fd24cc9..1c580f53b 100644 --- a/src/main/resources/tags/block_placer_ignored_materials.json +++ b/src/main/resources/tags/block_placer_ignored_materials.json @@ -1,64 +1,64 @@ { - "values": [ - "#slimefun:mushrooms", - "#minecraft:tall_flowers", - "#minecraft:beds", - "#minecraft:doors", - "minecraft:bamboo", - "#minecraft:rails", - "#minecraft:small_flowers", - "#minecraft:coral_blocks", - "#minecraft:coral_plants", - "#minecraft:small_flowers", - "#minecraft:buttons", - "#minecraft:banners", - "#minecraft:signs", - "#minecraft:standing_signs", - "#minecraft:wall_signs", - "#minecraft:wooden_pressure_plates", - { - "id": "#minecraft:nether_sprouts", - "required": false - }, - { - "id": "#minecraft:crimson_roots", - "required": false - }, - { - "id": "#minecraft:twisting_vines", - "required": false - }, - { - "id": "#warped_roots", - "required": false - }, - { - "id": "#weeping_vines", - "required": false - }, - { - "id": "#polished_blackstone_pressure_plate", - "required": false - }, - { - "id": "#warped_roots", - "required": false - }, - "minecraft:sugar_cane", - "minecraft:lily_pad", - "minecraft:dead_bush", - "minecraft:fern", - "minecraft:grass", - "minecraft:seagrass", - "minecraft:tall_seagrass", - "minecraft:cactus", - "minecraft:kelp", - "minecraft:ladder", - "minecraft:snow", - "minecraft:lever", - "minecraft:repeater", - "minecraft:tripwire_hook", - "minecraft:tall_grass", - "minecraft:large_fern" - ] + "values": [ + "#slimefun:mushrooms", + "#minecraft:tall_flowers", + "#minecraft:beds", + "#minecraft:doors", + "minecraft:bamboo", + "#minecraft:rails", + "#minecraft:small_flowers", + "#minecraft:coral_blocks", + "#minecraft:coral_plants", + "#minecraft:small_flowers", + "#minecraft:buttons", + "#minecraft:banners", + "#minecraft:signs", + "#minecraft:standing_signs", + "#minecraft:wall_signs", + "#minecraft:wooden_pressure_plates", + { + "id": "#minecraft:nether_sprouts", + "required": false + }, + { + "id": "#minecraft:crimson_roots", + "required": false + }, + { + "id": "#minecraft:twisting_vines", + "required": false + }, + { + "id": "#warped_roots", + "required": false + }, + { + "id": "#weeping_vines", + "required": false + }, + { + "id": "#polished_blackstone_pressure_plate", + "required": false + }, + { + "id": "#warped_roots", + "required": false + }, + "minecraft:sugar_cane", + "minecraft:lily_pad", + "minecraft:dead_bush", + "minecraft:fern", + "minecraft:grass", + "minecraft:seagrass", + "minecraft:tall_seagrass", + "minecraft:cactus", + "minecraft:kelp", + "minecraft:ladder", + "minecraft:snow", + "minecraft:lever", + "minecraft:repeater", + "minecraft:tripwire_hook", + "minecraft:tall_grass", + "minecraft:large_fern" + ] } From 16bf13b2afb0d5034db0447d87e3b6d725d69226 Mon Sep 17 00:00:00 2001 From: "Panda.com" Date: Thu, 15 Oct 2020 15:12:03 +0200 Subject: [PATCH 07/34] stop bullying --- .../tags/block_placer_ignored_materials.json | 16 ++++++---------- 1 file changed, 6 insertions(+), 10 deletions(-) diff --git a/src/main/resources/tags/block_placer_ignored_materials.json b/src/main/resources/tags/block_placer_ignored_materials.json index 1c580f53b..7c3098fb3 100644 --- a/src/main/resources/tags/block_placer_ignored_materials.json +++ b/src/main/resources/tags/block_placer_ignored_materials.json @@ -17,31 +17,27 @@ "#minecraft:wall_signs", "#minecraft:wooden_pressure_plates", { - "id": "#minecraft:nether_sprouts", + "id": "minecraft:nether_sprouts", "required": false }, { - "id": "#minecraft:crimson_roots", + "id": "minecraft:crimson_roots", "required": false }, { - "id": "#minecraft:twisting_vines", + "id": "minecraft:twisting_vines", "required": false }, { - "id": "#warped_roots", + "id": "minecraft:warped_roots", "required": false }, { - "id": "#weeping_vines", + "id": "minecraft:weeping_vines", "required": false }, { - "id": "#polished_blackstone_pressure_plate", - "required": false - }, - { - "id": "#warped_roots", + "id": "minecraft:polished_blackstone_pressure_plate", "required": false }, "minecraft:sugar_cane", From 29541cdfe2d068992a55054ce32c21c09f9dd4b1 Mon Sep 17 00:00:00 2001 From: "Panda.com" Date: Thu, 15 Oct 2020 15:41:21 +0200 Subject: [PATCH 08/34] Someone else can go format this if its not good --- .../tags/block_placer_ignored_materials.json | 116 +++++++++--------- 1 file changed, 58 insertions(+), 58 deletions(-) diff --git a/src/main/resources/tags/block_placer_ignored_materials.json b/src/main/resources/tags/block_placer_ignored_materials.json index 7c3098fb3..722dad247 100644 --- a/src/main/resources/tags/block_placer_ignored_materials.json +++ b/src/main/resources/tags/block_placer_ignored_materials.json @@ -1,60 +1,60 @@ { - "values": [ - "#slimefun:mushrooms", - "#minecraft:tall_flowers", - "#minecraft:beds", - "#minecraft:doors", - "minecraft:bamboo", - "#minecraft:rails", - "#minecraft:small_flowers", - "#minecraft:coral_blocks", - "#minecraft:coral_plants", - "#minecraft:small_flowers", - "#minecraft:buttons", - "#minecraft:banners", - "#minecraft:signs", - "#minecraft:standing_signs", - "#minecraft:wall_signs", - "#minecraft:wooden_pressure_plates", - { - "id": "minecraft:nether_sprouts", - "required": false - }, - { - "id": "minecraft:crimson_roots", - "required": false - }, - { - "id": "minecraft:twisting_vines", - "required": false - }, - { - "id": "minecraft:warped_roots", - "required": false - }, - { - "id": "minecraft:weeping_vines", - "required": false - }, - { - "id": "minecraft:polished_blackstone_pressure_plate", - "required": false - }, - "minecraft:sugar_cane", - "minecraft:lily_pad", - "minecraft:dead_bush", - "minecraft:fern", - "minecraft:grass", - "minecraft:seagrass", - "minecraft:tall_seagrass", - "minecraft:cactus", - "minecraft:kelp", - "minecraft:ladder", - "minecraft:snow", - "minecraft:lever", - "minecraft:repeater", - "minecraft:tripwire_hook", - "minecraft:tall_grass", - "minecraft:large_fern" - ] + "values": [ + "#slimefun:mushrooms", + "#minecraft:tall_flowers", + "#minecraft:beds", + "#minecraft:doors", + "minecraft:bamboo", + "#minecraft:rails", + "#minecraft:small_flowers", + "#minecraft:coral_blocks", + "#minecraft:coral_plants", + "#minecraft:small_flowers", + "#minecraft:buttons", + "#minecraft:banners", + "#minecraft:signs", + "#minecraft:standing_signs", + "#minecraft:wall_signs", + "#minecraft:wooden_pressure_plates", + { + "id": "minecraft:nether_sprouts", + "required": false + }, + { + "id": "minecraft:crimson_roots", + "required": false + }, + { + "id": "minecraft:twisting_vines", + "required": false + }, + { + "id": "minecraft:warped_roots", + "required": false + }, + { + "id": "minecraft:weeping_vines", + "required": false + }, + { + "id": "minecraft:polished_blackstone_pressure_plate", + "required": false + }, + "minecraft:sugar_cane", + "minecraft:lily_pad", + "minecraft:dead_bush", + "minecraft:fern", + "minecraft:grass", + "minecraft:seagrass", + "minecraft:tall_seagrass", + "minecraft:cactus", + "minecraft:kelp", + "minecraft:ladder", + "minecraft:snow", + "minecraft:lever", + "minecraft:repeater", + "minecraft:tripwire_hook", + "minecraft:tall_grass", + "minecraft:large_fern" + ] } From 6611eaf444a464f84fc9b356e62dd31d11526c54 Mon Sep 17 00:00:00 2001 From: "Panda.com" Date: Thu, 15 Oct 2020 15:43:06 +0200 Subject: [PATCH 09/34] idk whats wrong with "values" --- src/main/resources/tags/block_placer_ignored_materials.json | 1 + 1 file changed, 1 insertion(+) diff --git a/src/main/resources/tags/block_placer_ignored_materials.json b/src/main/resources/tags/block_placer_ignored_materials.json index 722dad247..e9d5b18ca 100644 --- a/src/main/resources/tags/block_placer_ignored_materials.json +++ b/src/main/resources/tags/block_placer_ignored_materials.json @@ -1,5 +1,6 @@ { "values": [ + "#slimefun:sensitive_materials", "#slimefun:mushrooms", "#minecraft:tall_flowers", "#minecraft:beds", From 7dbbb87af58adc30375a3eb2061a77b7b0135031 Mon Sep 17 00:00:00 2001 From: "Panda.com" Date: Thu, 15 Oct 2020 15:43:28 +0200 Subject: [PATCH 10/34] ? --- src/main/resources/tags/block_placer_ignored_materials.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/main/resources/tags/block_placer_ignored_materials.json b/src/main/resources/tags/block_placer_ignored_materials.json index e9d5b18ca..dae04518c 100644 --- a/src/main/resources/tags/block_placer_ignored_materials.json +++ b/src/main/resources/tags/block_placer_ignored_materials.json @@ -1,5 +1,5 @@ { - "values": [ + "values": [ "#slimefun:sensitive_materials", "#slimefun:mushrooms", "#minecraft:tall_flowers", From 349c57aef430f55ca158ae0141f316d2e6d71fdb Mon Sep 17 00:00:00 2001 From: "Panda.com" Date: Thu, 15 Oct 2020 15:44:32 +0200 Subject: [PATCH 11/34] a --- src/main/resources/tags/block_placer_ignored_materials.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/main/resources/tags/block_placer_ignored_materials.json b/src/main/resources/tags/block_placer_ignored_materials.json index dae04518c..90d6b66ab 100644 --- a/src/main/resources/tags/block_placer_ignored_materials.json +++ b/src/main/resources/tags/block_placer_ignored_materials.json @@ -1,5 +1,5 @@ { - "values": [ + "values" : [ "#slimefun:sensitive_materials", "#slimefun:mushrooms", "#minecraft:tall_flowers", From 372c6b41b1a22916f127f0c5256e397601dcf085 Mon Sep 17 00:00:00 2001 From: "Panda.com" Date: Thu, 15 Oct 2020 15:45:23 +0200 Subject: [PATCH 12/34] a --- src/main/resources/tags/block_placer_ignored_materials.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/main/resources/tags/block_placer_ignored_materials.json b/src/main/resources/tags/block_placer_ignored_materials.json index 90d6b66ab..b90b81517 100644 --- a/src/main/resources/tags/block_placer_ignored_materials.json +++ b/src/main/resources/tags/block_placer_ignored_materials.json @@ -1,5 +1,5 @@ { - "values" : [ + "values" : [ "#slimefun:sensitive_materials", "#slimefun:mushrooms", "#minecraft:tall_flowers", From c00ded786a4dc6493f47b7b7411ebcadff8c43d1 Mon Sep 17 00:00:00 2001 From: "Panda.com" Date: Thu, 15 Oct 2020 15:46:01 +0200 Subject: [PATCH 13/34] fix? --- src/main/resources/tags/block_placer_ignored_materials.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/main/resources/tags/block_placer_ignored_materials.json b/src/main/resources/tags/block_placer_ignored_materials.json index b90b81517..a3f5bb9ea 100644 --- a/src/main/resources/tags/block_placer_ignored_materials.json +++ b/src/main/resources/tags/block_placer_ignored_materials.json @@ -1,5 +1,5 @@ { - "values" : [ + "values" : [ "#slimefun:sensitive_materials", "#slimefun:mushrooms", "#minecraft:tall_flowers", From 49c7d3ad239eda7dcc1d270a646a31b769127a5a Mon Sep 17 00:00:00 2001 From: "Panda.com" Date: Thu, 15 Oct 2020 15:49:00 +0200 Subject: [PATCH 14/34] 14* prs --- .../tags/block_placer_ignored_materials.json | 26 +++++++++---------- 1 file changed, 13 insertions(+), 13 deletions(-) diff --git a/src/main/resources/tags/block_placer_ignored_materials.json b/src/main/resources/tags/block_placer_ignored_materials.json index a3f5bb9ea..ef5b31ac2 100644 --- a/src/main/resources/tags/block_placer_ignored_materials.json +++ b/src/main/resources/tags/block_placer_ignored_materials.json @@ -18,28 +18,28 @@ "#minecraft:wall_signs", "#minecraft:wooden_pressure_plates", { - "id": "minecraft:nether_sprouts", + "id" : "minecraft:nether_sprouts", + "required" : false + }, + { + "id" : "minecraft:crimson_roots", "required": false }, { - "id": "minecraft:crimson_roots", - "required": false + "id" : "minecraft:twisting_vines", + "required" : false }, { - "id": "minecraft:twisting_vines", - "required": false + "id" : "minecraft:warped_roots", + "required" : false }, { - "id": "minecraft:warped_roots", - "required": false + "id" : "minecraft:weeping_vines", + "required" : false }, { - "id": "minecraft:weeping_vines", - "required": false - }, - { - "id": "minecraft:polished_blackstone_pressure_plate", - "required": false + "id" : "minecraft:polished_blackstone_pressure_plate", + "required" : false }, "minecraft:sugar_cane", "minecraft:lily_pad", From ca6962811fc746d669a2b4294e21206708ebf905 Mon Sep 17 00:00:00 2001 From: Timotiyadeyhakesem Date: Fri, 16 Oct 2020 21:57:07 +0000 Subject: [PATCH 15/34] Translate categories_he.yml via GitLocalize --- src/main/resources/languages/categories_he.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/src/main/resources/languages/categories_he.yml b/src/main/resources/languages/categories_he.yml index 70c1547a9..492b733a6 100644 --- a/src/main/resources/languages/categories_he.yml +++ b/src/main/resources/languages/categories_he.yml @@ -23,3 +23,4 @@ slimefun: easter: חג הפסחא (אפריל) birthday: יום הולדתו של TheBusyBiscuit (26 באוקטובר) halloween: ליל כל הקדושים (31 באוקטובר) + androids: רובוטים ניתנים לתכנות From b976370d97894275c795a01f3b19f083be350241 Mon Sep 17 00:00:00 2001 From: TheBusyBiscuit Date: Sat, 17 Oct 2020 12:07:21 +0200 Subject: [PATCH 16/34] Reverted deprecation warning --- README.md | 2 +- .../Objects/SlimefunItem/interfaces/InventoryBlock.java | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 80f30248b..f531b510d 100644 --- a/README.md +++ b/README.md @@ -32,7 +32,7 @@ Here is a full summary of the differences between the two different versions of | | development (latest) | "stable" | | ------------------ | -------- | -------- | -| **Minecraft version(s)** | :video_game: **1.13.\* - 1.16.\*** | :video_game: **1.13.\* - 1.16.\*** | +| **Minecraft version(s)** | :video_game: **1.14.\* - 1.16.\*** | :video_game: **1.13.\* - 1.16.\*** | | **automatic updates** | :heavy_check_mark: | :heavy_check_mark: | | **frequent updates** | :heavy_check_mark: | :x: | | **latest content** | :heavy_check_mark: | :x: | diff --git a/src/main/java/me/mrCookieSlime/Slimefun/Objects/SlimefunItem/interfaces/InventoryBlock.java b/src/main/java/me/mrCookieSlime/Slimefun/Objects/SlimefunItem/interfaces/InventoryBlock.java index 8de896dc1..de0c283a3 100644 --- a/src/main/java/me/mrCookieSlime/Slimefun/Objects/SlimefunItem/interfaces/InventoryBlock.java +++ b/src/main/java/me/mrCookieSlime/Slimefun/Objects/SlimefunItem/interfaces/InventoryBlock.java @@ -19,7 +19,7 @@ import me.mrCookieSlime.Slimefun.api.item_transport.ItemTransportFlow; * @deprecated This interface is not designed to be used by addons. * */ -@Deprecated +// @Deprecated - commented out because we are not ready to send out warnings yet public interface InventoryBlock { /** From 4aff61f3b13871c4263a5d44b80d68c4a7a978a5 Mon Sep 17 00:00:00 2001 From: TheBusyBiscuit Date: Sat, 17 Oct 2020 12:54:36 +0200 Subject: [PATCH 17/34] Removed 1.13 support --- CHANGELOG.md | 10 ++ .../slimefun4/api/MinecraftVersion.java | 6 - .../slimefun4/core/SlimefunRegistry.java | 4 +- .../core/attributes/RechargeableHelper.java | 15 +-- .../guide/options/SlimefunGuideSettings.java | 8 +- .../core/multiblocks/MultiBlock.java | 4 +- .../core/networks/cargo/CargoUtils.java | 29 ++--- .../core/services/BlockDataService.java | 8 +- .../core/services/CustomTextureService.java | 7 +- .../core/services/PersistentDataService.java | 19 ++- .../implementation/SlimefunItems.java | 20 +-- .../implementation/SlimefunPlugin.java | 7 +- .../guide/ChestSlimefunGuide.java | 13 +- .../items/androids/FarmerAndroid.java | 8 +- .../items/androids/FisherAndroid.java | 7 +- .../electric/generators/BioGenerator.java | 13 +- .../electric/machines/FoodComposter.java | 7 +- .../electric/machines/FoodFabricator.java | 7 +- .../items/multiblocks/PressureChamber.java | 4 +- .../multiblocks/miner/IndustrialMiner.java | 2 +- .../items/tools/ExplosiveTool.java | 9 +- .../setup/SlimefunItemSetup.java | 119 +++++++----------- .../slimefun4/utils/SlimefunUtils.java | 16 ++- .../slimefun4/utils/tags/SlimefunTag.java | 11 ++ src/main/resources/plugin.yml | 2 +- .../tags/block_placer_ignored_materials.json | 18 +-- .../tags/crop_growth_accelerator_blocks.json | 5 +- src/main/resources/tags/dirt_variants.json | 11 ++ .../tags/explosive_shovel_blocks.json | 8 +- .../tags/fortune_compatible_ores.json | 10 ++ src/main/resources/tags/ores.json | 7 +- .../tests/utils/TestMinecraftVersion.java | 17 ++- 32 files changed, 165 insertions(+), 266 deletions(-) create mode 100644 src/main/resources/tags/dirt_variants.json create mode 100644 src/main/resources/tags/fortune_compatible_ores.json diff --git a/CHANGELOG.md b/CHANGELOG.md index 7c3ecac3a..e3f22799e 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,6 +2,7 @@ **Table of contents** +- [Release Candidate 18 (TBD)](#release-candidate-18-tbd) - [Release Candidate 17 (17 Oct 2020)](#release-candidate-17-17-oct-2020) - [Release Candidate 16 (07 Sep 2020)](#release-candidate-16-07-sep-2020) - [Release Candidate 15 (01 Aug 2020)](#release-candidate-15-01-aug-2020) @@ -22,6 +23,15 @@ +## Release Candidate 18 (TBD) + +#### Additions + +#### Changes +* Removed 1.13 support + +#### Fixes + ## Release Candidate 17 (17 Oct 2020) #### Additions diff --git a/src/main/java/io/github/thebusybiscuit/slimefun4/api/MinecraftVersion.java b/src/main/java/io/github/thebusybiscuit/slimefun4/api/MinecraftVersion.java index 9cb5793b9..3f49247a9 100644 --- a/src/main/java/io/github/thebusybiscuit/slimefun4/api/MinecraftVersion.java +++ b/src/main/java/io/github/thebusybiscuit/slimefun4/api/MinecraftVersion.java @@ -14,12 +14,6 @@ import io.github.thebusybiscuit.slimefun4.implementation.SlimefunPlugin; */ public enum MinecraftVersion { - /** - * This constant represents Minecraft (Java Edition) Version 1.14 - * (The Update Aquatic) - */ - MINECRAFT_1_13("1.13.x"), - /** * This constant represents Minecraft (Java Edition) Version 1.14 * (The "Village & Pillage" Update) diff --git a/src/main/java/io/github/thebusybiscuit/slimefun4/core/SlimefunRegistry.java b/src/main/java/io/github/thebusybiscuit/slimefun4/core/SlimefunRegistry.java index ae85b19ab..538a1dc49 100644 --- a/src/main/java/io/github/thebusybiscuit/slimefun4/core/SlimefunRegistry.java +++ b/src/main/java/io/github/thebusybiscuit/slimefun4/core/SlimefunRegistry.java @@ -22,14 +22,12 @@ import org.bukkit.inventory.ItemStack; import io.github.thebusybiscuit.cscorelib2.collections.KeyMap; import io.github.thebusybiscuit.cscorelib2.config.Config; -import io.github.thebusybiscuit.slimefun4.api.MinecraftVersion; import io.github.thebusybiscuit.slimefun4.api.geo.GEOResource; import io.github.thebusybiscuit.slimefun4.api.player.PlayerProfile; import io.github.thebusybiscuit.slimefun4.core.guide.SlimefunGuideImplementation; import io.github.thebusybiscuit.slimefun4.core.guide.SlimefunGuideLayout; import io.github.thebusybiscuit.slimefun4.core.multiblocks.MultiBlock; import io.github.thebusybiscuit.slimefun4.core.researching.Research; -import io.github.thebusybiscuit.slimefun4.implementation.SlimefunPlugin; import io.github.thebusybiscuit.slimefun4.implementation.guide.BookSlimefunGuide; import io.github.thebusybiscuit.slimefun4.implementation.guide.CheatSheetSlimefunGuide; import io.github.thebusybiscuit.slimefun4.implementation.guide.ChestSlimefunGuide; @@ -100,7 +98,7 @@ public final class SlimefunRegistry { researchRanks.addAll(cfg.getStringList("research-ranks")); - backwardsCompatibility = cfg.getBoolean("options.backwards-compatibility") || SlimefunPlugin.getMinecraftVersion().isBefore(MinecraftVersion.MINECRAFT_1_14); + backwardsCompatibility = cfg.getBoolean("options.backwards-compatibility"); freeCreativeResearches = cfg.getBoolean("researches.free-in-creative-mode"); researchFireworks = cfg.getBoolean("researches.enable-fireworks"); logDuplicateBlockEntries = cfg.getBoolean("options.log-duplicate-block-entries"); diff --git a/src/main/java/io/github/thebusybiscuit/slimefun4/core/attributes/RechargeableHelper.java b/src/main/java/io/github/thebusybiscuit/slimefun4/core/attributes/RechargeableHelper.java index f19af55a5..b0e47b1a5 100644 --- a/src/main/java/io/github/thebusybiscuit/slimefun4/core/attributes/RechargeableHelper.java +++ b/src/main/java/io/github/thebusybiscuit/slimefun4/core/attributes/RechargeableHelper.java @@ -13,7 +13,6 @@ import org.bukkit.inventory.meta.ItemMeta; import org.bukkit.persistence.PersistentDataType; import io.github.thebusybiscuit.cscorelib2.chat.ChatColors; -import io.github.thebusybiscuit.slimefun4.api.MinecraftVersion; import io.github.thebusybiscuit.slimefun4.implementation.SlimefunPlugin; import io.github.thebusybiscuit.slimefun4.utils.PatternUtils; import net.md_5.bungee.api.ChatColor; @@ -39,9 +38,7 @@ final class RechargeableHelper { BigDecimal decimal = BigDecimal.valueOf(charge).setScale(2, RoundingMode.HALF_UP); float value = decimal.floatValue(); - if (SlimefunPlugin.getMinecraftVersion().isAtLeast(MinecraftVersion.MINECRAFT_1_14)) { - meta.getPersistentDataContainer().set(CHARGE_KEY, PersistentDataType.FLOAT, value); - } + meta.getPersistentDataContainer().set(CHARGE_KEY, PersistentDataType.FLOAT, value); List lore = meta.hasLore() ? meta.getLore() : new ArrayList<>(); for (int i = 0; i < lore.size(); i++) { @@ -59,13 +56,11 @@ final class RechargeableHelper { } static float getCharge(@Nonnull ItemMeta meta) { - if (SlimefunPlugin.getMinecraftVersion().isAtLeast(MinecraftVersion.MINECRAFT_1_14)) { - Float value = meta.getPersistentDataContainer().get(CHARGE_KEY, PersistentDataType.FLOAT); + Float value = meta.getPersistentDataContainer().get(CHARGE_KEY, PersistentDataType.FLOAT); - // If persistent data is available, we just return this value - if (value != null) { - return value; - } + // If persistent data is available, we just return this value + if (value != null) { + return value; } // If no persistent data exists, we will just fall back to the lore 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 7c132d44f..1ed862a13 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 @@ -12,7 +12,6 @@ import org.bukkit.entity.Player; import org.bukkit.inventory.ItemStack; import io.github.thebusybiscuit.cscorelib2.item.CustomItem; -import io.github.thebusybiscuit.slimefun4.api.MinecraftVersion; import io.github.thebusybiscuit.slimefun4.core.guide.SlimefunGuide; import io.github.thebusybiscuit.slimefun4.core.guide.SlimefunGuideLayout; import io.github.thebusybiscuit.slimefun4.core.services.localization.Language; @@ -41,11 +40,8 @@ public final class SlimefunGuideSettings { static { options.add(new GuideLayoutOption()); - - if (SlimefunPlugin.getMinecraftVersion().isAtLeast(MinecraftVersion.MINECRAFT_1_14)) { - options.add(new FireworksOption()); - options.add(new PlayerLanguageOption()); - } + options.add(new FireworksOption()); + options.add(new PlayerLanguageOption()); } private SlimefunGuideSettings() {} diff --git a/src/main/java/io/github/thebusybiscuit/slimefun4/core/multiblocks/MultiBlock.java b/src/main/java/io/github/thebusybiscuit/slimefun4/core/multiblocks/MultiBlock.java index 61d96ebf9..49b80dd9a 100644 --- a/src/main/java/io/github/thebusybiscuit/slimefun4/core/multiblocks/MultiBlock.java +++ b/src/main/java/io/github/thebusybiscuit/slimefun4/core/multiblocks/MultiBlock.java @@ -41,10 +41,8 @@ public class MultiBlock { SUPPORTED_TAGS.add(Tag.LOGS); SUPPORTED_TAGS.add(Tag.WOODEN_TRAPDOORS); SUPPORTED_TAGS.add(Tag.WOODEN_SLABS); + SUPPORTED_TAGS.add(Tag.WOODEN_FENCES); - if (SlimefunPlugin.getMinecraftVersion().isAtLeast(MinecraftVersion.MINECRAFT_1_14)) { - SUPPORTED_TAGS.add(Tag.WOODEN_FENCES); - } if (SlimefunPlugin.getMinecraftVersion().isAtLeast(MinecraftVersion.MINECRAFT_1_16)) { SUPPORTED_TAGS.add(Tag.FIRE); } 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 81c8051c2..b7e5fabab 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 @@ -18,10 +18,10 @@ import org.bukkit.inventory.InventoryHolder; import org.bukkit.inventory.ItemStack; import io.github.thebusybiscuit.cscorelib2.blocks.BlockPosition; -import io.github.thebusybiscuit.slimefun4.api.MinecraftVersion; import io.github.thebusybiscuit.slimefun4.implementation.SlimefunPlugin; import io.github.thebusybiscuit.slimefun4.utils.SlimefunUtils; import io.github.thebusybiscuit.slimefun4.utils.itemstack.ItemStackWrapper; +import io.github.thebusybiscuit.slimefun4.utils.tags.SlimefunTag; import io.papermc.lib.PaperLib; import me.mrCookieSlime.CSCoreLibPlugin.Configuration.Config; import me.mrCookieSlime.Slimefun.api.BlockStorage; @@ -54,6 +54,10 @@ final class CargoUtils { Material type = block.getType(); + if (SlimefunTag.SHULKER_BOXES.isTagged(type)) { + return true; + } + switch (type) { case CHEST: case TRAPPED_CHEST: @@ -62,28 +66,13 @@ final class CargoUtils { case DROPPER: case HOPPER: case BREWING_STAND: - case SHULKER_BOX: + case BARREL: + case BLAST_FURNACE: + case SMOKER: return true; default: - break; + return false; } - - if (type.name().endsWith("_SHULKER_BOX")) { - return true; - } - - if (SlimefunPlugin.getMinecraftVersion().isAtLeast(MinecraftVersion.MINECRAFT_1_14)) { - switch (type) { - case BARREL: - case BLAST_FURNACE: - case SMOKER: - return true; - default: - break; - } - } - - return false; } static int[] getInputSlotRange(@Nonnull Inventory inv, @Nullable ItemStack item) { diff --git a/src/main/java/io/github/thebusybiscuit/slimefun4/core/services/BlockDataService.java b/src/main/java/io/github/thebusybiscuit/slimefun4/core/services/BlockDataService.java index 9dd1449f8..c9c577681 100644 --- a/src/main/java/io/github/thebusybiscuit/slimefun4/core/services/BlockDataService.java +++ b/src/main/java/io/github/thebusybiscuit/slimefun4/core/services/BlockDataService.java @@ -11,9 +11,6 @@ import org.bukkit.block.TileState; import org.bukkit.persistence.PersistentDataHolder; import org.bukkit.plugin.Plugin; -import io.github.thebusybiscuit.slimefun4.api.MinecraftVersion; -import io.github.thebusybiscuit.slimefun4.implementation.SlimefunPlugin; - /** * The {@link BlockDataService} is similar to the {@link CustomItemDataService}, * it is responsible for storing NBT data inside a {@link TileState}. @@ -83,9 +80,8 @@ public class BlockDataService implements PersistentDataService, Keyed { * @return Whether the given {@link Material} is considered a Tile Entity */ public boolean isTileEntity(Material type) { - if (type == null || !SlimefunPlugin.getMinecraftVersion().isAtLeast(MinecraftVersion.MINECRAFT_1_14)) { - // We can only store data on Tile Entities in 1.14+ - // So we will just return false here in that case. + if (type == null || type.isAir()) { + // Cannot store data on air return false; } diff --git a/src/main/java/io/github/thebusybiscuit/slimefun4/core/services/CustomTextureService.java b/src/main/java/io/github/thebusybiscuit/slimefun4/core/services/CustomTextureService.java index b94cecf1d..5587ad8b2 100644 --- a/src/main/java/io/github/thebusybiscuit/slimefun4/core/services/CustomTextureService.java +++ b/src/main/java/io/github/thebusybiscuit/slimefun4/core/services/CustomTextureService.java @@ -10,8 +10,6 @@ import org.bukkit.inventory.ItemStack; import org.bukkit.inventory.meta.ItemMeta; import io.github.thebusybiscuit.cscorelib2.config.Config; -import io.github.thebusybiscuit.slimefun4.api.MinecraftVersion; -import io.github.thebusybiscuit.slimefun4.implementation.SlimefunPlugin; import me.mrCookieSlime.Slimefun.Objects.SlimefunItem.SlimefunItem; import me.mrCookieSlime.Slimefun.api.SlimefunItemStack; @@ -101,10 +99,7 @@ public class CustomTextureService { public void setTexture(@Nonnull ItemMeta im, @Nonnull String id) { int data = getModelData(id); - - if (SlimefunPlugin.getMinecraftVersion().isAtLeast(MinecraftVersion.MINECRAFT_1_14)) { - im.setCustomModelData(data == 0 ? null : data); - } + im.setCustomModelData(data == 0 ? null : data); } } diff --git a/src/main/java/io/github/thebusybiscuit/slimefun4/core/services/PersistentDataService.java b/src/main/java/io/github/thebusybiscuit/slimefun4/core/services/PersistentDataService.java index 8a1035d74..b1792f546 100644 --- a/src/main/java/io/github/thebusybiscuit/slimefun4/core/services/PersistentDataService.java +++ b/src/main/java/io/github/thebusybiscuit/slimefun4/core/services/PersistentDataService.java @@ -7,32 +7,29 @@ import org.bukkit.persistence.PersistentDataContainer; import org.bukkit.persistence.PersistentDataHolder; import org.bukkit.persistence.PersistentDataType; +import io.github.thebusybiscuit.cscorelib2.data.PersistentDataAPI; import io.github.thebusybiscuit.slimefun4.api.MinecraftVersion; -import io.github.thebusybiscuit.slimefun4.implementation.SlimefunPlugin; /** * This interface is used to defer calls to Persistent Data and make sure they are only called * if the {@link MinecraftVersion} supports it. * * @author TheBusyBiscuit + * + * @deprecated This is redundant, we can use {@link PersistentDataAPI} instead. * */ +@Deprecated interface PersistentDataService { default void setString(Object obj, NamespacedKey key, String value) { - if (SlimefunPlugin.getMinecraftVersion().isAtLeast(MinecraftVersion.MINECRAFT_1_14) && obj instanceof PersistentDataHolder) { - PersistentDataContainer container = ((PersistentDataHolder) obj).getPersistentDataContainer(); - container.set(key, PersistentDataType.STRING, value); - } + PersistentDataContainer container = ((PersistentDataHolder) obj).getPersistentDataContainer(); + container.set(key, PersistentDataType.STRING, value); } default Optional getString(Object obj, NamespacedKey key) { - if (SlimefunPlugin.getMinecraftVersion().isAtLeast(MinecraftVersion.MINECRAFT_1_14) && obj instanceof PersistentDataHolder) { - PersistentDataContainer container = ((PersistentDataHolder) obj).getPersistentDataContainer(); - return Optional.ofNullable(container.get(key, PersistentDataType.STRING)); - } - - return Optional.empty(); + PersistentDataContainer container = ((PersistentDataHolder) obj).getPersistentDataContainer(); + return Optional.ofNullable(container.get(key, PersistentDataType.STRING)); } } 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 92a58d15f..0f995f7a3 100644 --- a/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/SlimefunItems.java +++ b/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/SlimefunItems.java @@ -567,14 +567,14 @@ public final class SlimefunItems { public static final SlimefunItemStack ENHANCED_CRAFTING_TABLE = new SlimefunItemStack("ENHANCED_CRAFTING_TABLE", Material.CRAFTING_TABLE, "&eEnhanced Crafting Table", "", "&aA regular Crafting Table cannot", "&ahold this massive Amount of Power..."); public static final SlimefunItemStack GRIND_STONE = new SlimefunItemStack("GRIND_STONE", Material.DISPENSER, "&bGrind Stone", "", "&aGrinds items down into other items"); public static final SlimefunItemStack ARMOR_FORGE = new SlimefunItemStack("ARMOR_FORGE", Material.ANVIL, "&6Armor Forge", "", "&aGives you the ability to create powerful armor"); - public static final SlimefunItemStack MAKESHIFT_SMELTERY; + public static final SlimefunItemStack MAKESHIFT_SMELTERY = new SlimefunItemStack("MAKESHIFT_SMELTERY", Material.BLAST_FURNACE, "&eMakeshift Smeltery", "", "&fImprovised version of the Smeltery", "&fthat only allows you to", "&fsmelt dusts into ingots"); public static final SlimefunItemStack SMELTERY = new SlimefunItemStack("SMELTERY", Material.FURNACE, "&6Smeltery", "", "&fA high-temperature furnace", "&fthat allows you to smelt dusts", "&finto ingots and create alloys."); public static final SlimefunItemStack ORE_CRUSHER = new SlimefunItemStack("ORE_CRUSHER", Material.DISPENSER, "&bOre Crusher", "", "&aCrushes ores to double them"); public static final SlimefunItemStack COMPRESSOR = new SlimefunItemStack("COMPRESSOR", Material.PISTON, "&bCompressor", "", "&aCompresses Items"); public static final SlimefunItemStack PRESSURE_CHAMBER = new SlimefunItemStack("PRESSURE_CHAMBER", Material.GLASS, "&bPressure Chamber", "", "&aCompresses Items even further"); public static final SlimefunItemStack MAGIC_WORKBENCH = new SlimefunItemStack("MAGIC_WORKBENCH", Material.CRAFTING_TABLE, "&6Magic Workbench", "", "&dInfuses Items with magical Energy"); public static final SlimefunItemStack ORE_WASHER = new SlimefunItemStack("ORE_WASHER", Material.CAULDRON, "&6Ore Washer", "", "&aWashes Sifted Ore to filter Ores", "&aand gives you small Stone Chunks"); - public static final SlimefunItemStack TABLE_SAW; + public static final SlimefunItemStack TABLE_SAW = new SlimefunItemStack("TABLE_SAW", Material.STONECUTTER, "&6Table Saw", "", "&aAllows you to get 8 planks from 1 Log", "&a(Works with all log types)"); public static final SlimefunItemStack JUICER = new SlimefunItemStack("JUICER", Material.GLASS_BOTTLE, "&aJuicer", "", "&aAllows you to create delicious Juice"); public static final SlimefunItemStack AUTOMATED_PANNING_MACHINE = new SlimefunItemStack("AUTOMATED_PANNING_MACHINE", Material.BOWL, "&eAutomated Panning Machine", "", "&fA MultiBlock Version of the Gold Pan", "&fand Nether Gold Pan combined in one machine."); @@ -662,12 +662,12 @@ public final class SlimefunItems { public static final SlimefunItemStack ELECTRIC_ORE_GRINDER = new SlimefunItemStack("ELECTRIC_ORE_GRINDER", Material.FURNACE, "&cElectric Ore Grinder", "", "&fWorks as an Ore Crusher and Grind Stone", "", LoreBuilder.machine(MachineTier.ADVANCED, MachineType.MACHINE), LoreBuilder.speed(1), LoreBuilder.powerPerSecond(12)); public static final SlimefunItemStack ELECTRIC_ORE_GRINDER_2 = new SlimefunItemStack("ELECTRIC_ORE_GRINDER_2", Material.FURNACE, "&cElectric Ore Grinder &7(&eII&7)", "", "&fWorks as an Ore Crusher and Grind Stone", "", LoreBuilder.machine(MachineTier.END_GAME, MachineType.MACHINE), LoreBuilder.speed(4), LoreBuilder.powerPerSecond(30)); public static final SlimefunItemStack ELECTRIC_INGOT_PULVERIZER = new SlimefunItemStack("ELECTRIC_INGOT_PULVERIZER", Material.FURNACE, "&cElectric Ingot Pulverizer", "", "&fPulverizes Ingots into Dust", "", LoreBuilder.machine(MachineTier.MEDIUM, MachineType.MACHINE), LoreBuilder.speed(1), LoreBuilder.powerPerSecond(14)); - public static final SlimefunItemStack AUTO_DRIER; + public static final SlimefunItemStack AUTO_DRIER = new SlimefunItemStack("AUTO_DRIER", Material.SMOKER, "&6Auto Drier", "", LoreBuilder.machine(MachineTier.MEDIUM, MachineType.MACHINE), LoreBuilder.speed(1), LoreBuilder.powerPerSecond(10)); public static final SlimefunItemStack AUTO_ENCHANTER = new SlimefunItemStack("AUTO_ENCHANTER", Material.ENCHANTING_TABLE, "&5Auto Enchanter", "", LoreBuilder.machine(MachineTier.MEDIUM, MachineType.MACHINE), LoreBuilder.speed(1), LoreBuilder.powerPerSecond(18)); public static final SlimefunItemStack AUTO_DISENCHANTER = new SlimefunItemStack("AUTO_DISENCHANTER", Material.ENCHANTING_TABLE, "&5Auto Disenchanter", "", LoreBuilder.machine(MachineTier.MEDIUM, MachineType.MACHINE), LoreBuilder.speed(1), LoreBuilder.powerPerSecond(18)); public static final SlimefunItemStack AUTO_ANVIL = new SlimefunItemStack("AUTO_ANVIL", Material.IRON_BLOCK, "&7Auto Anvil", "", LoreBuilder.machine(MachineTier.ADVANCED, MachineType.MACHINE), "&8\u21E8 &7Repair Factor: 10%", LoreBuilder.powerPerSecond(24)); public static final SlimefunItemStack AUTO_ANVIL_2 = new SlimefunItemStack("AUTO_ANVIL_2", Material.IRON_BLOCK, "&7Auto Anvil Mk.II", "", LoreBuilder.machine(MachineTier.END_GAME, MachineType.MACHINE), "&8\u21E8 &7Repair Factor: 25%", LoreBuilder.powerPerSecond(32)); - public static final SlimefunItemStack AUTO_BREWER; + public static final SlimefunItemStack AUTO_BREWER = new SlimefunItemStack("AUTO_BREWER", Material.SMOKER, "&6Auto Brewer", "", LoreBuilder.machine(MachineTier.MEDIUM, MachineType.MACHINE), LoreBuilder.speed(1), LoreBuilder.powerPerSecond(12)); public static final SlimefunItemStack BIO_REACTOR = new SlimefunItemStack("BIO_REACTOR", Material.LIME_TERRACOTTA, "&2Bio Reactor", "", LoreBuilder.machine(MachineTier.AVERAGE, MachineType.GENERATOR), LoreBuilder.powerBuffer(128), LoreBuilder.powerPerSecond(8)); public static final SlimefunItemStack MULTIMETER = new SlimefunItemStack("MULTIMETER", Material.CLOCK, "&eMultimeter", "", "&fMeasures the Amount of stored", "&fEnergy in a Block"); @@ -841,17 +841,5 @@ public final class SlimefunItems { static { INFUSED_ELYTRA.addUnsafeEnchantment(Enchantment.MENDING, 1); - - if (SlimefunPlugin.getMinecraftVersion().isAtLeast(MinecraftVersion.MINECRAFT_1_14)) { - TABLE_SAW = new SlimefunItemStack("TABLE_SAW", Material.STONECUTTER, "&6Table Saw", "", "&aAllows you to get 8 planks from 1 Log", "&a(Works with all log types)"); - MAKESHIFT_SMELTERY = new SlimefunItemStack("MAKESHIFT_SMELTERY", Material.BLAST_FURNACE, "&eMakeshift Smeltery", "", "&fImprovised version of the Smeltery", "&fthat only allows you to", "&fsmelt dusts into ingots"); - AUTO_DRIER = new SlimefunItemStack("AUTO_DRIER", Material.SMOKER, "&6Auto Drier", "", LoreBuilder.machine(MachineTier.MEDIUM, MachineType.MACHINE), LoreBuilder.speed(1), LoreBuilder.powerPerSecond(10)); - AUTO_BREWER = new SlimefunItemStack("AUTO_BREWER", Material.SMOKER, "&6Auto Brewer", "", LoreBuilder.machine(MachineTier.MEDIUM, MachineType.MACHINE), LoreBuilder.speed(1), LoreBuilder.powerPerSecond(12)); - } else { - TABLE_SAW = null; - MAKESHIFT_SMELTERY = new SlimefunItemStack("MAKESHIFT_SMELTERY", Material.FURNACE, "&eMakeshift Smeltery", "", "&fImprovised version of the Smeltery", "&fthat only allows you to", "&fsmelt dusts into ingots"); - AUTO_DRIER = new SlimefunItemStack("AUTO_DRIER", Material.FURNACE, "&6Auto Drier", "", LoreBuilder.machine(MachineTier.MEDIUM, MachineType.MACHINE), LoreBuilder.speed(1), LoreBuilder.powerPerSecond(10)); - AUTO_BREWER = new SlimefunItemStack("AUTO_BREWER", Material.BREWING_STAND, "&6Auto Brewer", LoreBuilder.machine(MachineTier.MEDIUM, MachineType.MACHINE), LoreBuilder.speed(1), LoreBuilder.powerPerSecond(12)); - } } } diff --git a/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/SlimefunPlugin.java b/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/SlimefunPlugin.java index 781d46bb0..25308eac1 100644 --- a/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/SlimefunPlugin.java +++ b/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/SlimefunPlugin.java @@ -469,11 +469,8 @@ public final class SlimefunPlugin extends JavaPlugin implements SlimefunAddon { new AnvilListener(this); new BrewingStandListener(this); new CauldronListener(this); - - if (minecraftVersion.isAtLeast(MinecraftVersion.MINECRAFT_1_14)) { - new GrindstoneListener(this); - new CartographyTableListener(this); - } + new GrindstoneListener(this); + new CartographyTableListener(this); if (minecraftVersion.isAtLeast(MinecraftVersion.MINECRAFT_1_15)) { new BeeListener(this); 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 4f346f291..cbab11d87 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 @@ -1,7 +1,5 @@ package io.github.thebusybiscuit.slimefun4.implementation.guide; -import javax.annotation.Nonnull; - import java.util.ArrayList; import java.util.Arrays; import java.util.LinkedList; @@ -10,6 +8,8 @@ import java.util.Locale; import java.util.Optional; import java.util.logging.Level; +import javax.annotation.Nonnull; + import org.bukkit.ChatColor; import org.bukkit.Material; import org.bukkit.Sound; @@ -26,7 +26,6 @@ import io.github.thebusybiscuit.cscorelib2.chat.ChatInput; import io.github.thebusybiscuit.cscorelib2.inventory.ItemUtils; import io.github.thebusybiscuit.cscorelib2.item.CustomItem; import io.github.thebusybiscuit.cscorelib2.recipes.MinecraftRecipe; -import io.github.thebusybiscuit.slimefun4.api.MinecraftVersion; import io.github.thebusybiscuit.slimefun4.api.player.PlayerProfile; import io.github.thebusybiscuit.slimefun4.core.attributes.RecipeDisplayItem; import io.github.thebusybiscuit.slimefun4.core.categories.FlexCategory; @@ -68,18 +67,12 @@ public class ChestSlimefunGuide implements SlimefunGuideImplementation { private final ItemStack item; private final int[] recipeSlots = { 3, 4, 5, 12, 13, 14, 21, 22, 23 }; - private final Sound sound; + private final Sound sound = Sound.ITEM_BOOK_PAGE_TURN; private final boolean showVanillaRecipes; public ChestSlimefunGuide(boolean vanillaRecipes) { showVanillaRecipes = vanillaRecipes; item = new SlimefunGuideItem(this, "&aSlimefun Guide &7(Chest GUI)"); - - if (SlimefunPlugin.getMinecraftVersion().isAtLeast(MinecraftVersion.MINECRAFT_1_14)) { - sound = Sound.ITEM_BOOK_PAGE_TURN; - } else { - sound = Sound.ENTITY_BAT_TAKEOFF; - } } @Override diff --git a/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/items/androids/FarmerAndroid.java b/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/items/androids/FarmerAndroid.java index 060bb6b81..e46721c84 100644 --- a/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/items/androids/FarmerAndroid.java +++ b/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/items/androids/FarmerAndroid.java @@ -10,8 +10,6 @@ import org.bukkit.block.data.Ageable; import org.bukkit.block.data.BlockData; import org.bukkit.inventory.ItemStack; -import io.github.thebusybiscuit.slimefun4.api.MinecraftVersion; -import io.github.thebusybiscuit.slimefun4.implementation.SlimefunPlugin; import me.mrCookieSlime.Slimefun.Lists.RecipeType; import me.mrCookieSlime.Slimefun.Objects.Category; import me.mrCookieSlime.Slimefun.api.SlimefunItemStack; @@ -57,10 +55,6 @@ public class FarmerAndroid extends ProgrammableAndroid { private ItemStack getDropFromCrop(Material crop) { Random random = ThreadLocalRandom.current(); - if (SlimefunPlugin.getMinecraftVersion().isAtLeast(MinecraftVersion.MINECRAFT_1_14) && crop == Material.SWEET_BERRY_BUSH) { - return new ItemStack(Material.SWEET_BERRIES, random.nextInt(3) + 1); - } - switch (crop) { case WHEAT: return new ItemStack(Material.WHEAT, random.nextInt(2) + 1); @@ -74,6 +68,8 @@ public class FarmerAndroid extends ProgrammableAndroid { return new ItemStack(Material.COCOA_BEANS, random.nextInt(3) + 1); case NETHER_WART: return new ItemStack(Material.NETHER_WART, random.nextInt(3) + 1); + case SWEET_BERRY_BUSH: + return new ItemStack(Material.SWEET_BERRIES, random.nextInt(3) + 1); default: return null; } diff --git a/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/items/androids/FisherAndroid.java b/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/items/androids/FisherAndroid.java index d2e9ce0c3..de83525a7 100644 --- a/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/items/androids/FisherAndroid.java +++ b/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/items/androids/FisherAndroid.java @@ -10,8 +10,6 @@ import org.bukkit.block.BlockFace; import org.bukkit.inventory.ItemStack; import io.github.thebusybiscuit.cscorelib2.collections.RandomizedSet; -import io.github.thebusybiscuit.slimefun4.api.MinecraftVersion; -import io.github.thebusybiscuit.slimefun4.implementation.SlimefunPlugin; import me.mrCookieSlime.Slimefun.Lists.RecipeType; import me.mrCookieSlime.Slimefun.Objects.Category; import me.mrCookieSlime.Slimefun.api.SlimefunItemStack; @@ -37,10 +35,7 @@ public class FisherAndroid extends ProgrammableAndroid { fishingLoot.add(new ItemStack(Material.STICK), 5); fishingLoot.add(new ItemStack(Material.ROTTEN_FLESH), 3); fishingLoot.add(new ItemStack(Material.LEATHER), 2); - - if (SlimefunPlugin.getMinecraftVersion().isAtLeast(MinecraftVersion.MINECRAFT_1_14)) { - fishingLoot.add(new ItemStack(Material.BAMBOO), 3); - } + fishingLoot.add(new ItemStack(Material.BAMBOO), 3); // "loot" fishingLoot.add(new ItemStack(Material.SADDLE), 1); diff --git a/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/items/electric/generators/BioGenerator.java b/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/items/electric/generators/BioGenerator.java index 18a864221..e1c624ede 100644 --- a/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/items/electric/generators/BioGenerator.java +++ b/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/items/electric/generators/BioGenerator.java @@ -48,15 +48,12 @@ public abstract class BioGenerator extends AGenerator { registerFuel(new MachineFuel(20, new ItemStack(Material.DRIED_KELP_BLOCK))); registerFuel(new MachineFuel(1, new ItemStack(Material.SEAGRASS))); registerFuel(new MachineFuel(2, new ItemStack(Material.SEA_PICKLE))); + registerFuel(new MachineFuel(1, new ItemStack(Material.BAMBOO))); + registerFuel(new MachineFuel(2, new ItemStack(Material.SWEET_BERRIES))); - if (SlimefunPlugin.getMinecraftVersion().isAtLeast(MinecraftVersion.MINECRAFT_1_14)) { - registerFuel(new MachineFuel(1, new ItemStack(Material.BAMBOO))); - registerFuel(new MachineFuel(2, new ItemStack(Material.SWEET_BERRIES))); - - // Small Flowers (formally just dandelions and poppies). - for (Material m : Tag.SMALL_FLOWERS.getValues()) { - registerFuel(new MachineFuel(1, new ItemStack(m))); - } + // Small Flowers (formally just dandelions and poppies). + for (Material m : Tag.SMALL_FLOWERS.getValues()) { + registerFuel(new MachineFuel(1, new ItemStack(m))); } if (SlimefunPlugin.getMinecraftVersion().isAtLeast(MinecraftVersion.MINECRAFT_1_15)) { diff --git a/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/items/electric/machines/FoodComposter.java b/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/items/electric/machines/FoodComposter.java index 8f7988af3..a7ef3c4b8 100644 --- a/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/items/electric/machines/FoodComposter.java +++ b/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/items/electric/machines/FoodComposter.java @@ -3,10 +3,8 @@ package io.github.thebusybiscuit.slimefun4.implementation.items.electric.machine import org.bukkit.Material; import org.bukkit.inventory.ItemStack; -import io.github.thebusybiscuit.slimefun4.api.MinecraftVersion; import io.github.thebusybiscuit.slimefun4.core.attributes.RecipeDisplayItem; import io.github.thebusybiscuit.slimefun4.implementation.SlimefunItems; -import io.github.thebusybiscuit.slimefun4.implementation.SlimefunPlugin; import io.github.thebusybiscuit.slimefun4.implementation.items.misc.OrganicFertilizer; import me.mrCookieSlime.Slimefun.Lists.RecipeType; import me.mrCookieSlime.Slimefun.Objects.Category; @@ -30,10 +28,7 @@ public abstract class FoodComposter extends AContainer implements RecipeDisplayI registerRecipe(30, new ItemStack[] { SlimefunItems.APPLE_ORGANIC_FOOD }, new ItemStack[] { new SlimefunItemStack(SlimefunItems.APPLE_FERTILIZER, OrganicFertilizer.OUTPUT) }); registerRecipe(30, new ItemStack[] { SlimefunItems.KELP_ORGANIC_FOOD }, new ItemStack[] { new SlimefunItemStack(SlimefunItems.KELP_FERTILIZER, OrganicFertilizer.OUTPUT) }); registerRecipe(30, new ItemStack[] { SlimefunItems.COCOA_ORGANIC_FOOD }, new ItemStack[] { new SlimefunItemStack(SlimefunItems.COCOA_FERTILIZER, OrganicFertilizer.OUTPUT) }); - - if (SlimefunPlugin.getMinecraftVersion().isAtLeast(MinecraftVersion.MINECRAFT_1_14)) { - registerRecipe(30, new ItemStack[] { SlimefunItems.SWEET_BERRIES_ORGANIC_FOOD }, new ItemStack[] { new SlimefunItemStack(SlimefunItems.SWEET_BERRIES_FERTILIZER, OrganicFertilizer.OUTPUT) }); - } + registerRecipe(30, new ItemStack[] { SlimefunItems.SWEET_BERRIES_ORGANIC_FOOD }, new ItemStack[] { new SlimefunItemStack(SlimefunItems.SWEET_BERRIES_FERTILIZER, OrganicFertilizer.OUTPUT) }); } @Override diff --git a/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/items/electric/machines/FoodFabricator.java b/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/items/electric/machines/FoodFabricator.java index 03fec44c6..ecc8a3e2a 100644 --- a/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/items/electric/machines/FoodFabricator.java +++ b/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/items/electric/machines/FoodFabricator.java @@ -3,9 +3,7 @@ package io.github.thebusybiscuit.slimefun4.implementation.items.electric.machine import org.bukkit.Material; import org.bukkit.inventory.ItemStack; -import io.github.thebusybiscuit.slimefun4.api.MinecraftVersion; import io.github.thebusybiscuit.slimefun4.implementation.SlimefunItems; -import io.github.thebusybiscuit.slimefun4.implementation.SlimefunPlugin; import io.github.thebusybiscuit.slimefun4.implementation.items.misc.OrganicFood; import me.mrCookieSlime.Slimefun.Lists.RecipeType; import me.mrCookieSlime.Slimefun.Objects.Category; @@ -29,10 +27,7 @@ public abstract class FoodFabricator extends AContainer { registerRecipe(12, new ItemStack[] { SlimefunItems.TIN_CAN, new ItemStack(Material.APPLE) }, new ItemStack[] { new SlimefunItemStack(SlimefunItems.APPLE_ORGANIC_FOOD, OrganicFood.OUTPUT) }); registerRecipe(12, new ItemStack[] { SlimefunItems.TIN_CAN, new ItemStack(Material.DRIED_KELP) }, new ItemStack[] { new SlimefunItemStack(SlimefunItems.KELP_ORGANIC_FOOD, OrganicFood.OUTPUT) }); registerRecipe(12, new ItemStack[] { SlimefunItems.TIN_CAN, new ItemStack(Material.COCOA_BEANS) }, new ItemStack[] { new SlimefunItemStack(SlimefunItems.COCOA_ORGANIC_FOOD, OrganicFood.OUTPUT) }); - - if (SlimefunPlugin.getMinecraftVersion().isAtLeast(MinecraftVersion.MINECRAFT_1_14)) { - registerRecipe(12, new ItemStack[] { SlimefunItems.TIN_CAN, new ItemStack(Material.SWEET_BERRIES) }, new ItemStack[] { new SlimefunItemStack(SlimefunItems.SWEET_BERRIES_ORGANIC_FOOD, OrganicFood.OUTPUT) }); - } + registerRecipe(12, new ItemStack[] { SlimefunItems.TIN_CAN, new ItemStack(Material.SWEET_BERRIES) }, new ItemStack[] { new SlimefunItemStack(SlimefunItems.SWEET_BERRIES_ORGANIC_FOOD, OrganicFood.OUTPUT) }); } @Override diff --git a/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/items/multiblocks/PressureChamber.java b/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/items/multiblocks/PressureChamber.java index 4395387c8..e3173af17 100644 --- a/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/items/multiblocks/PressureChamber.java +++ b/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/items/multiblocks/PressureChamber.java @@ -15,7 +15,6 @@ import org.bukkit.inventory.Inventory; import org.bukkit.inventory.ItemStack; import io.github.thebusybiscuit.cscorelib2.item.CustomItem; -import io.github.thebusybiscuit.slimefun4.api.MinecraftVersion; import io.github.thebusybiscuit.slimefun4.core.multiblocks.MultiBlockMachine; import io.github.thebusybiscuit.slimefun4.implementation.SlimefunPlugin; import io.github.thebusybiscuit.slimefun4.utils.SlimefunUtils; @@ -27,8 +26,7 @@ import me.mrCookieSlime.Slimefun.api.SlimefunItemStack; public class PressureChamber extends MultiBlockMachine { public PressureChamber(Category category, SlimefunItemStack item) { - super(category, item, new ItemStack[] { SlimefunPlugin.getMinecraftVersion().isAtLeast(MinecraftVersion.MINECRAFT_1_14) ? new ItemStack(Material.SMOOTH_STONE_SLAB) : new ItemStack(Material.STONE_SLAB), new CustomItem(Material.DISPENSER, "Dispenser (Facing down)"), SlimefunPlugin.getMinecraftVersion() - .isAtLeast(MinecraftVersion.MINECRAFT_1_14) ? new ItemStack(Material.SMOOTH_STONE_SLAB) : new ItemStack(Material.STONE_SLAB), new ItemStack(Material.PISTON), new ItemStack(Material.GLASS), new ItemStack(Material.PISTON), new ItemStack(Material.PISTON), new ItemStack(Material.CAULDRON), new ItemStack(Material.PISTON) }, BlockFace.UP); + super(category, item, new ItemStack[] { new ItemStack(Material.SMOOTH_STONE_SLAB), new CustomItem(Material.DISPENSER, "Dispenser (Facing down)"), new ItemStack(Material.SMOOTH_STONE_SLAB), new ItemStack(Material.PISTON), new ItemStack(Material.GLASS), new ItemStack(Material.PISTON), new ItemStack(Material.PISTON), new ItemStack(Material.CAULDRON), new ItemStack(Material.PISTON) }, BlockFace.UP); } @Override 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 c0dc2775d..157b26954 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 @@ -52,7 +52,7 @@ public class IndustrialMiner extends MultiBlockMachine { private final ItemSetting canMineAncientDebris = new ItemSetting<>("can-mine-ancient-debris", false); public IndustrialMiner(Category category, SlimefunItemStack item, Material baseMaterial, boolean silkTouch, int range) { - super(category, item, new ItemStack[] { null, null, null, new CustomItem(Material.PISTON, "Piston (facing up)"), new ItemStack(Material.CHEST), new CustomItem(Material.PISTON, "Piston (facing up)"), new ItemStack(baseMaterial), new ItemStack(SlimefunPlugin.getMinecraftVersion().isAtLeast(MinecraftVersion.MINECRAFT_1_14) ? Material.BLAST_FURNACE : Material.FURNACE), new ItemStack(baseMaterial) }, BlockFace.UP); + super(category, item, new ItemStack[] { null, null, null, new CustomItem(Material.PISTON, "Piston (facing up)"), new ItemStack(Material.CHEST), new CustomItem(Material.PISTON, "Piston (facing up)"), new ItemStack(baseMaterial), new ItemStack(Material.BLAST_FURNACE), new ItemStack(baseMaterial) }, BlockFace.UP); this.range = range; this.silkTouch = silkTouch; diff --git a/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/items/tools/ExplosiveTool.java b/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/items/tools/ExplosiveTool.java index d452896f3..33d3f9cc5 100644 --- a/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/items/tools/ExplosiveTool.java +++ b/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/items/tools/ExplosiveTool.java @@ -55,7 +55,7 @@ class ExplosiveTool extends SimpleSlimefunItem implements NotPla Player p = e.getPlayer(); Block b = e.getBlock(); - b.getWorld().createExplosion(b.getLocation(), 0.0F); + b.getWorld().createExplosion(b.getLocation(), 0); b.getWorld().playSound(b.getLocation(), Sound.ENTITY_GENERIC_EXPLODE, 0.2F, 1F); List blocks = findBlocks(b); @@ -122,8 +122,9 @@ class ExplosiveTool extends SimpleSlimefunItem implements NotPla private void breakBlock(Player p, ItemStack item, Block b, int fortune, List drops) { SlimefunPlugin.getProtectionManager().logAction(p, b, ProtectableAction.BREAK_BLOCK); + Material material = b.getType(); - b.getWorld().playEffect(b.getLocation(), Effect.STEP_SOUND, b.getType()); + b.getWorld().playEffect(b.getLocation(), Effect.STEP_SOUND, material); SlimefunItem sfItem = BlockStorage.check(b); if (sfItem != null && !sfItem.useVanillaBlockBreaking()) { @@ -132,10 +133,10 @@ class ExplosiveTool extends SimpleSlimefunItem implements NotPla if (handler != null && !handler.onBreak(p, b, sfItem, UnregisterReason.PLAYER_BREAK)) { drops.add(BlockStorage.retrieve(b)); } - } else if (b.getType() == Material.PLAYER_HEAD || b.getType() == Material.SHULKER_BOX || b.getType().name().endsWith("_SHULKER_BOX")) { + } else if (material == Material.PLAYER_HEAD || SlimefunTag.SHULKER_BOXES.isTagged(material)) { b.breakNaturally(item); } else { - boolean applyFortune = b.getType().name().endsWith("_ORE") && b.getType() != Material.IRON_ORE && b.getType() != Material.GOLD_ORE; + boolean applyFortune = SlimefunTag.FORTUNE_COMPATIBLE_ORES.isTagged(material); for (ItemStack drop : b.getDrops(getItem())) { // For some reason this check is necessary with Paper 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 4a401e158..85092ae9a 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 @@ -207,26 +207,7 @@ import me.mrCookieSlime.Slimefun.api.SlimefunItemStack; */ public final class SlimefunItemSetup { - private static final Material RED_DYE; - private static final Material YELLOW_DYE; - private static final Material BLACK_DYE; - private static final Material GREEN_DYE; - private static boolean registeredItems = false; - - static { - if (SlimefunPlugin.getMinecraftVersion().isAtLeast(MinecraftVersion.MINECRAFT_1_14)) { - RED_DYE = Material.RED_DYE; - YELLOW_DYE = Material.YELLOW_DYE; - BLACK_DYE = Material.BLACK_DYE; - GREEN_DYE = Material.GREEN_DYE; - } else { - RED_DYE = Material.valueOf("ROSE_RED"); - YELLOW_DYE = Material.valueOf("DANDELION_YELLOW"); - BLACK_DYE = Material.valueOf("INK_SAC"); - GREEN_DYE = Material.valueOf("CACTUS_GREEN"); - } - } private SlimefunItemSetup() {} @@ -796,21 +777,19 @@ public final class SlimefunItemSetup { 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 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}) @@ -1026,9 +1005,7 @@ public final class SlimefunItemSetup { 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 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) @@ -1258,11 +1235,9 @@ public final class SlimefunItemSetup { 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.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}) @@ -1989,11 +1964,9 @@ public final class SlimefunItemSetup { }.register(plugin); - if (SlimefunPlugin.getMinecraftVersion().isAtLeast(MinecraftVersion.MINECRAFT_1_14)) { - new AutoDrier(categories.electricity, SlimefunItems.AUTO_DRIER, RecipeType.ENHANCED_CRAFTING_TABLE, - new ItemStack[]{null, null, null, SlimefunItems.HEATING_COIL, new ItemStack(Material.SMOKER), SlimefunItems.HEATING_COIL, null, new ItemStack(Material.CAMPFIRE), null}) - .register(plugin); - } + new AutoDrier(categories.electricity, SlimefunItems.AUTO_DRIER, RecipeType.ENHANCED_CRAFTING_TABLE, + new ItemStack[]{null, null, null, SlimefunItems.HEATING_COIL, new ItemStack(Material.SMOKER), SlimefunItems.HEATING_COIL, null, new ItemStack(Material.CAMPFIRE), null}) + .register(plugin); 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}) { @@ -2282,7 +2255,7 @@ public final class SlimefunItemSetup { .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)}) + new ItemStack[] {new ItemStack(Material.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(Material.YELLOW_DYE), SlimefunItems.ENDER_LUMP_3, new ItemStack(Material.MAGENTA_DYE)}) .register(plugin); new SoulboundRune(categories.magicalResources, SlimefunItems.SOULBOUND_RUNE, RecipeType.ANCIENT_ALTAR, @@ -2351,96 +2324,96 @@ public final class SlimefunItemSetup { // 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 ItemStack[] {new ItemStack(Material.RED_DYE), SlimefunItems.CHRISTMAS_COOKIE, new ItemStack(Material.GREEN_DYE), new ItemStack(Material.WHITE_WOOL), SlimefunItems.RAINBOW_RUNE, new ItemStack(Material.WHITE_WOOL), new ItemStack(Material.GREEN_DYE), SlimefunItems.CHRISTMAS_COOKIE, new ItemStack(Material.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 ItemStack[] {new ItemStack(Material.RED_DYE), SlimefunItems.CHRISTMAS_COOKIE, new ItemStack(Material.GREEN_DYE), new ItemStack(Material.WHITE_STAINED_GLASS), SlimefunItems.RAINBOW_RUNE, new ItemStack(Material.WHITE_STAINED_GLASS), new ItemStack(Material.GREEN_DYE), SlimefunItems.CHRISTMAS_COOKIE, new ItemStack(Material.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 ItemStack[] {new ItemStack(Material.RED_DYE), SlimefunItems.CHRISTMAS_COOKIE, new ItemStack(Material.GREEN_DYE), new ItemStack(Material.WHITE_STAINED_GLASS_PANE), SlimefunItems.RAINBOW_RUNE, new ItemStack(Material.WHITE_STAINED_GLASS_PANE), new ItemStack(Material.GREEN_DYE), SlimefunItems.CHRISTMAS_COOKIE, new ItemStack(Material.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 ItemStack[] {new ItemStack(Material.RED_DYE), SlimefunItems.CHRISTMAS_COOKIE, new ItemStack(Material.GREEN_DYE), new ItemStack(Material.WHITE_TERRACOTTA), SlimefunItems.RAINBOW_RUNE, new ItemStack(Material.WHITE_TERRACOTTA), new ItemStack(Material.GREEN_DYE), SlimefunItems.CHRISTMAS_COOKIE, new ItemStack(Material.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 ItemStack[] {new ItemStack(Material.RED_DYE), SlimefunItems.CHRISTMAS_COOKIE, new ItemStack(Material.GREEN_DYE), new ItemStack(Material.WHITE_CONCRETE), SlimefunItems.RAINBOW_RUNE, new ItemStack(Material.WHITE_CONCRETE), new ItemStack(Material.GREEN_DYE), SlimefunItems.CHRISTMAS_COOKIE, new ItemStack(Material.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 ItemStack[] {new ItemStack(Material.RED_DYE), SlimefunItems.CHRISTMAS_COOKIE, new ItemStack(Material.GREEN_DYE), new ItemStack(Material.WHITE_GLAZED_TERRACOTTA), SlimefunItems.RAINBOW_RUNE, new ItemStack(Material.WHITE_GLAZED_TERRACOTTA), new ItemStack(Material.GREEN_DYE), SlimefunItems.CHRISTMAS_COOKIE, new ItemStack(Material.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 ItemStack[] {new ItemStack(Material.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(Material.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 ItemStack[] {new ItemStack(Material.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(Material.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 ItemStack[] {new ItemStack(Material.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(Material.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 ItemStack[] {new ItemStack(Material.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(Material.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 ItemStack[] {new ItemStack(Material.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(Material.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 ItemStack[] {new ItemStack(Material.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(Material.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 ItemStack[] {new ItemStack(Material.ORANGE_DYE), new ItemStack(Material.PUMPKIN), new ItemStack(Material.BLACK_DYE), new ItemStack(Material.WHITE_WOOL), SlimefunItems.RAINBOW_RUNE, new ItemStack(Material.WHITE_WOOL), new ItemStack(Material.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 ItemStack[] {new ItemStack(Material.ORANGE_DYE), new ItemStack(Material.PUMPKIN), new ItemStack(Material.BLACK_DYE), new ItemStack(Material.WHITE_STAINED_GLASS), SlimefunItems.RAINBOW_RUNE, new ItemStack(Material.WHITE_STAINED_GLASS), new ItemStack(Material.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 ItemStack[] {new ItemStack(Material.ORANGE_DYE), new ItemStack(Material.PUMPKIN), new ItemStack(Material.BLACK_DYE), new ItemStack(Material.WHITE_STAINED_GLASS_PANE), SlimefunItems.RAINBOW_RUNE, new ItemStack(Material.WHITE_STAINED_GLASS_PANE), new ItemStack(Material.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 ItemStack[] {new ItemStack(Material.ORANGE_DYE), new ItemStack(Material.PUMPKIN), new ItemStack(Material.BLACK_DYE), new ItemStack(Material.WHITE_TERRACOTTA), SlimefunItems.RAINBOW_RUNE, new ItemStack(Material.WHITE_TERRACOTTA), new ItemStack(Material.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 ItemStack[] {new ItemStack(Material.ORANGE_DYE), new ItemStack(Material.PUMPKIN), new ItemStack(Material.BLACK_DYE), new ItemStack(Material.WHITE_CONCRETE), SlimefunItems.RAINBOW_RUNE, new ItemStack(Material.WHITE_CONCRETE), new ItemStack(Material.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 ItemStack[] {new ItemStack(Material.ORANGE_DYE), new ItemStack(Material.PUMPKIN), new ItemStack(Material.BLACK_DYE), new ItemStack(Material.WHITE_GLAZED_TERRACOTTA), SlimefunItems.RAINBOW_RUNE, new ItemStack(Material.WHITE_GLAZED_TERRACOTTA), new ItemStack(Material.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); @@ -2678,10 +2651,8 @@ public final class SlimefunItemSetup { 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); - } + 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); @@ -3059,11 +3030,9 @@ public final class SlimefunItemSetup { 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 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); if (SlimefunPlugin.getMinecraftVersion().isAtLeast(MinecraftVersion.MINECRAFT_1_16)) { new StrangeNetherGoo(categories.magicalResources, SlimefunItems.STRANGE_NETHER_GOO, RecipeType.BARTER_DROP, 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 8c90ef203..05046d5d8 100644 --- a/src/main/java/io/github/thebusybiscuit/slimefun4/utils/SlimefunUtils.java +++ b/src/main/java/io/github/thebusybiscuit/slimefun4/utils/SlimefunUtils.java @@ -121,7 +121,7 @@ public final class SlimefunUtils { } private static boolean hasSoulboundFlag(@Nullable ItemMeta meta) { - if (meta != null && SlimefunPlugin.getMinecraftVersion().isAtLeast(MinecraftVersion.MINECRAFT_1_14)) { + if (meta != null) { PersistentDataContainer container = meta.getPersistentDataContainer(); if (container.has(SOULBOUND_KEY, PersistentDataType.BYTE)) { @@ -154,16 +154,14 @@ public final class SlimefunUtils { boolean isSoulbound = isSoulbound(item); ItemMeta meta = item.getItemMeta(); - if (SlimefunPlugin.getMinecraftVersion().isAtLeast(MinecraftVersion.MINECRAFT_1_14)) { - PersistentDataContainer container = meta.getPersistentDataContainer(); + PersistentDataContainer container = meta.getPersistentDataContainer(); - if (makeSoulbound && !isSoulbound) { - container.set(SOULBOUND_KEY, PersistentDataType.BYTE, (byte) 1); - } + if (makeSoulbound && !isSoulbound) { + container.set(SOULBOUND_KEY, PersistentDataType.BYTE, (byte) 1); + } - if (!makeSoulbound && isSoulbound) { - container.remove(SOULBOUND_KEY); - } + if (!makeSoulbound && isSoulbound) { + container.remove(SOULBOUND_KEY); } List lore = meta.hasLore() ? meta.getLore() : new ArrayList<>(); diff --git a/src/main/java/io/github/thebusybiscuit/slimefun4/utils/tags/SlimefunTag.java b/src/main/java/io/github/thebusybiscuit/slimefun4/utils/tags/SlimefunTag.java index 844baf8ec..74dc60adf 100644 --- a/src/main/java/io/github/thebusybiscuit/slimefun4/utils/tags/SlimefunTag.java +++ b/src/main/java/io/github/thebusybiscuit/slimefun4/utils/tags/SlimefunTag.java @@ -48,6 +48,11 @@ public enum SlimefunTag implements Tag { */ ORES, + /** + * All minecraft ores that can be affected by fortune. + */ + FORTUNE_COMPATIBLE_ORES, + /** * All Shulker boxes, normal and colored. */ @@ -104,6 +109,12 @@ public enum SlimefunTag implements Tag { */ STONE_VARIANTS, + /** + * All dirt variants. Dirt, coarse dirt, grass, mycelium. + * This also includes farmland and grass paths. + */ + DIRT_VARIANTS, + /** * All variants of concrete powder. * Can you believe there is no tag for this already? diff --git a/src/main/resources/plugin.yml b/src/main/resources/plugin.yml index ab969be2b..04a127c8a 100644 --- a/src/main/resources/plugin.yml +++ b/src/main/resources/plugin.yml @@ -7,7 +7,7 @@ website: https://github.com/Slimefun main: io.github.thebusybiscuit.slimefun4.implementation.SlimefunPlugin softdepend: [CS-CoreLib, PlaceholderAPI, WorldEdit, EmeraldEnchants, mcMMO] -api-version: '1.13' +api-version: '1.14' commands: slimefun: diff --git a/src/main/resources/tags/block_placer_ignored_materials.json b/src/main/resources/tags/block_placer_ignored_materials.json index a41e8050e..84091d9f9 100644 --- a/src/main/resources/tags/block_placer_ignored_materials.json +++ b/src/main/resources/tags/block_placer_ignored_materials.json @@ -2,23 +2,15 @@ "values" : [ "#slimefun:sensitive_materials", "#slimefun:mushrooms", - { - "id" : "#minecraft:tall_flowers", - "required" : false - }, - { - "id" : "#minecraft:beds", - "required" : false - }, - { - "id" : "#minecraft:doors", - "required" : false - }, + "#minecraft:beds", + "#minecraft:doors", "minecraft:sugar_cane", + "minecraft:bamboo", + "minecraft:cactus", "minecraft:lily_pad", "minecraft:dead_bush", { - "id" : "minecraft:bamboo", + "id" : "#minecraft:tall_flowers", "required" : false } ] diff --git a/src/main/resources/tags/crop_growth_accelerator_blocks.json b/src/main/resources/tags/crop_growth_accelerator_blocks.json index 97af19e67..e0be360b6 100644 --- a/src/main/resources/tags/crop_growth_accelerator_blocks.json +++ b/src/main/resources/tags/crop_growth_accelerator_blocks.json @@ -12,9 +12,6 @@ "minecraft:pumpkin_stem", "minecraft:nether_wart", "minecraft:cocoa", - { - "id" : "minecraft:sweet_berry_bush", - "required" : false - } + "minecraft:sweet_berry_bush" ] } diff --git a/src/main/resources/tags/dirt_variants.json b/src/main/resources/tags/dirt_variants.json new file mode 100644 index 000000000..d551913f7 --- /dev/null +++ b/src/main/resources/tags/dirt_variants.json @@ -0,0 +1,11 @@ +{ + "values" : [ + "minecraft:dirt", + "minecraft:coarse_dirt", + "minecraft:grass_block", + "minecraft:grass_path", + "minecraft:farmland", + "minecraft:podzol", + "minecraft:mycelium" + ] +} diff --git a/src/main/resources/tags/explosive_shovel_blocks.json b/src/main/resources/tags/explosive_shovel_blocks.json index 41b4d4d29..17ceed4e0 100644 --- a/src/main/resources/tags/explosive_shovel_blocks.json +++ b/src/main/resources/tags/explosive_shovel_blocks.json @@ -2,13 +2,7 @@ "values" : [ "#minecraft:sand", "#slimefun:concrete_powders", - "minecraft:dirt", - "minecraft:coarse_dirt", - "minecraft:grass_block", - "minecraft:grass_path", - "minecraft:farmland", - "minecraft:podzol", - "minecraft:mycelium", + "#slimefun:dirt_variants", "minecraft:snow", "minecraft:snow_block", "minecraft:gravel", diff --git a/src/main/resources/tags/fortune_compatible_ores.json b/src/main/resources/tags/fortune_compatible_ores.json new file mode 100644 index 000000000..bdf61d641 --- /dev/null +++ b/src/main/resources/tags/fortune_compatible_ores.json @@ -0,0 +1,10 @@ +{ + "values" : [ + "minecraft:coal_ore", + "minecraft:lapis_ore", + "minecraft:diamond_ore", + "minecraft:redstone_ore", + "minecraft:emerald_ore", + "minecraft:nether_quartz_ore" + ] +} diff --git a/src/main/resources/tags/ores.json b/src/main/resources/tags/ores.json index b4c76a1a4..fd4c45729 100644 --- a/src/main/resources/tags/ores.json +++ b/src/main/resources/tags/ores.json @@ -6,11 +6,6 @@ }, "minecraft:gold_ore", "minecraft:iron_ore", - "minecraft:coal_ore", - "minecraft:lapis_ore", - "minecraft:diamond_ore", - "minecraft:redstone_ore", - "minecraft:emerald_ore", - "minecraft:nether_quartz_ore" + "#slimefun:fortune_compatible_ores" ] } diff --git a/src/test/java/io/github/thebusybiscuit/slimefun4/testing/tests/utils/TestMinecraftVersion.java b/src/test/java/io/github/thebusybiscuit/slimefun4/testing/tests/utils/TestMinecraftVersion.java index 35664ada5..1bdb43a44 100644 --- a/src/test/java/io/github/thebusybiscuit/slimefun4/testing/tests/utils/TestMinecraftVersion.java +++ b/src/test/java/io/github/thebusybiscuit/slimefun4/testing/tests/utils/TestMinecraftVersion.java @@ -11,10 +11,10 @@ class TestMinecraftVersion { @Test @DisplayName("Test if Minecraft versions match themselves") void testMatches() { - Assertions.assertTrue(MinecraftVersion.MINECRAFT_1_13.matches("v1_13_R1")); Assertions.assertTrue(MinecraftVersion.MINECRAFT_1_14.matches("v1_14_R2")); + Assertions.assertTrue(MinecraftVersion.MINECRAFT_1_15.matches("v1_15_R1")); - Assertions.assertFalse(MinecraftVersion.MINECRAFT_1_13.matches("v1_14_R2")); + Assertions.assertFalse(MinecraftVersion.MINECRAFT_1_15.matches("v1_14_R2")); Assertions.assertFalse(MinecraftVersion.MINECRAFT_1_14.matches("1.14.x")); Assertions.assertThrows(IllegalArgumentException.class, () -> MinecraftVersion.MINECRAFT_1_14.matches(null)); } @@ -22,18 +22,18 @@ class TestMinecraftVersion { @Test @DisplayName("Test if Minecraft versions are ordered correctly (#atLeast)") void testAtLeast() { - Assertions.assertTrue(MinecraftVersion.MINECRAFT_1_15.isAtLeast(MinecraftVersion.MINECRAFT_1_13)); + Assertions.assertTrue(MinecraftVersion.MINECRAFT_1_16.isAtLeast(MinecraftVersion.MINECRAFT_1_14)); Assertions.assertTrue(MinecraftVersion.MINECRAFT_1_15.isAtLeast(MinecraftVersion.MINECRAFT_1_14)); Assertions.assertTrue(MinecraftVersion.MINECRAFT_1_15.isAtLeast(MinecraftVersion.MINECRAFT_1_15)); - Assertions.assertFalse(MinecraftVersion.MINECRAFT_1_13.isAtLeast(MinecraftVersion.MINECRAFT_1_14)); + Assertions.assertFalse(MinecraftVersion.MINECRAFT_1_15.isAtLeast(MinecraftVersion.MINECRAFT_1_16)); } @Test @DisplayName("Test correct behaviour for MinecraftVersion.UNKNOWN.isAtleast(...)") void testAtLeastUnknown() { // Unknown should always fall back to false - Assertions.assertFalse(MinecraftVersion.UNKNOWN.isAtLeast(MinecraftVersion.MINECRAFT_1_13)); + Assertions.assertFalse(MinecraftVersion.UNKNOWN.isAtLeast(MinecraftVersion.MINECRAFT_1_14)); Assertions.assertFalse(MinecraftVersion.UNKNOWN.isAtLeast(MinecraftVersion.MINECRAFT_1_15)); Assertions.assertThrows(IllegalArgumentException.class, () -> MinecraftVersion.MINECRAFT_1_14.isAtLeast(null)); @@ -42,19 +42,18 @@ class TestMinecraftVersion { @Test @DisplayName("Test if Minecraft versions are ordered correctly (#isBefore)") void testIsBefore() { - Assertions.assertTrue(MinecraftVersion.MINECRAFT_1_13.isBefore(MinecraftVersion.MINECRAFT_1_14)); - Assertions.assertTrue(MinecraftVersion.MINECRAFT_1_13.isBefore(MinecraftVersion.MINECRAFT_1_15)); Assertions.assertTrue(MinecraftVersion.MINECRAFT_1_14.isBefore(MinecraftVersion.MINECRAFT_1_15)); + Assertions.assertTrue(MinecraftVersion.MINECRAFT_1_14.isBefore(MinecraftVersion.MINECRAFT_1_16)); Assertions.assertFalse(MinecraftVersion.MINECRAFT_1_15.isBefore(MinecraftVersion.MINECRAFT_1_15)); - Assertions.assertFalse(MinecraftVersion.MINECRAFT_1_15.isBefore(MinecraftVersion.MINECRAFT_1_13)); + Assertions.assertFalse(MinecraftVersion.MINECRAFT_1_15.isBefore(MinecraftVersion.MINECRAFT_1_14)); } @Test @DisplayName("Test correct behaviour for MinecraftVersion.UNKNOWN.isBefore(...)") void testIsBeforeUnknown() { // Unknown should always fall back to true - Assertions.assertTrue(MinecraftVersion.UNKNOWN.isBefore(MinecraftVersion.MINECRAFT_1_13)); + Assertions.assertTrue(MinecraftVersion.UNKNOWN.isBefore(MinecraftVersion.MINECRAFT_1_14)); Assertions.assertTrue(MinecraftVersion.UNKNOWN.isBefore(MinecraftVersion.MINECRAFT_1_15)); Assertions.assertThrows(IllegalArgumentException.class, () -> MinecraftVersion.MINECRAFT_1_14.isBefore(null)); From 9f3e2bba7cce6d428b96a064541479bbae1454c0 Mon Sep 17 00:00:00 2001 From: TheBusyBiscuit Date: Sat, 17 Oct 2020 13:22:22 +0200 Subject: [PATCH 18/34] [CI skip] Removed a troublesome config setting --- .../slimefun4/implementation/SlimefunPlugin.java | 5 +---- src/main/resources/config.yml | 1 - 2 files changed, 1 insertion(+), 5 deletions(-) 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 25308eac1..2d14d4f21 100644 --- a/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/SlimefunPlugin.java +++ b/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/SlimefunPlugin.java @@ -487,6 +487,7 @@ public final class SlimefunPlugin extends JavaPlugin implements SlimefunAddon { new AncientAltarListener(this, (AncientAltar) SlimefunItems.ANCIENT_ALTAR.getItem(), (AncientPedestal) SlimefunItems.ANCIENT_PEDESTAL.getItem()); grapplingHookListener.register(this, (GrapplingHook) SlimefunItems.GRAPPLING_HOOK.getItem()); bowListener.register(this); + backpackListener.register(this); // Toggleable Listeners for performance reasons if (config.getBoolean("items.talismans")) { @@ -497,10 +498,6 @@ public final class SlimefunPlugin extends JavaPlugin implements SlimefunAddon { new SoulboundListener(this); } - if (config.getBoolean("items.backpacks")) { - backpackListener.register(this); - } - // Handle Slimefun Guide being given on Join new SlimefunGuideListener(this, config.getBoolean("guide.receive-on-first-join")); diff --git a/src/main/resources/config.yml b/src/main/resources/config.yml index bad81f55d..c9090a91c 100644 --- a/src/main/resources/config.yml +++ b/src/main/resources/config.yml @@ -40,7 +40,6 @@ networks: items: talismans: true - backpacks: true soulbound: true metrics: From 087af60ab871f61685df73a26deb9fc7213b9cee Mon Sep 17 00:00:00 2001 From: Renovate Bot Date: Sat, 17 Oct 2020 13:17:35 +0000 Subject: [PATCH 19/34] Update dependency com.konghq:unirest-java to v3.11.02 --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index 06d6812a0..ac20b52c4 100644 --- a/pom.xml +++ b/pom.xml @@ -349,7 +349,7 @@ com.konghq unirest-java - 3.11.01 + 3.11.02 compile From f9d4be9cbbbcce6efe423ede7815b9238239bc96 Mon Sep 17 00:00:00 2001 From: Nameless Date: Sun, 18 Oct 2020 02:44:33 +0000 Subject: [PATCH 20/34] Translate messages_zh-CN.yml via GitLocalize --- src/main/resources/languages/messages_zh-CN.yml | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/src/main/resources/languages/messages_zh-CN.yml b/src/main/resources/languages/messages_zh-CN.yml index b0b631128..34134c21d 100644 --- a/src/main/resources/languages/messages_zh-CN.yml +++ b/src/main/resources/languages/messages_zh-CN.yml @@ -20,6 +20,10 @@ commands: player-never-joined: "&4找不到叫这个名字的玩家!" backpack-does-not-exist: "&4你指定的背包不存在!" restored-backpack-given: "&a你的背包已被恢复并且已经放入了你的物品栏!" + charge: + description: 为你手持的物品充电 + charge-success: 充电完成! + not-rechargeable: 这个物品不能充电! guide: search: message: "&b你想要搜索什么?" @@ -127,6 +131,7 @@ messages: knight: "&a&o你的护身符给予了你 5 秒的生命恢复" whirlwind: "&a&o你的护身符反弹了所有的弹射物" wizard: "&a&o你的护身符使一个附魔的等级提高了, 同时其他附魔等级将会下降" + caveman: "&a&o你的护身符给予了你急迫效果" soulbound-rune: fail: "&c一次只能灵魂绑定一个物品." success: "&a物品绑定成功! 在你死亡后此物品将不会掉落." @@ -223,6 +228,7 @@ machines: finished: "&e你的工业矿机采矿已完成! 总共开采了 %ores% 个矿石!" anvil: not-working: "&4你不能在铁砧里使用 Slimefun 的物品" + mcmmo-salvaging: "&4你不能分解 Slimefun 物品!" backpack: already-open: "&c抱歉, 这个背包已在别处打开了!" no-stack: "&c你不能同时手持两个背包" @@ -331,5 +337,9 @@ brewing_stand: not-working: "&4你不能在酿造台中使用 Slimefun 物品!" villagers: no-trading: "&4你不能用 Slimefun 的物品和村民交易!" +cartography_table: + not-working: "&4你不能在制图台中使用 Slimefun 物品!" +cauldron: + no-discoloring: "&4你不能用炼药锅清洗 Slimefun 物品上的颜色" miner: no-ores: "&e抱歉, 周围找不到矿石了!" From 1257ca5ebba85f4a7bf98e0c7273fcd3c5cdcf35 Mon Sep 17 00:00:00 2001 From: TheBusyBiscuit Date: Sun, 18 Oct 2020 02:44:34 +0000 Subject: [PATCH 21/34] Translate messages_zh-CN.yml via GitLocalize From de1e846382f06428d0db811c3e6df26155a71110 Mon Sep 17 00:00:00 2001 From: Nameless Date: Sun, 18 Oct 2020 02:44:36 +0000 Subject: [PATCH 22/34] Translate researches_zh-CN.yml via GitLocalize --- src/main/resources/languages/researches_zh-CN.yml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/main/resources/languages/researches_zh-CN.yml b/src/main/resources/languages/researches_zh-CN.yml index b0db0509e..3b2187c3a 100644 --- a/src/main/resources/languages/researches_zh-CN.yml +++ b/src/main/resources/languages/researches_zh-CN.yml @@ -243,3 +243,6 @@ slimefun: climbing_pick: 古块丽影 shulker_shell: 人造潜影贝 villager_rune: 防奸商神器 + caveman_talisman: 穴居人护身符 + even_higher_tier_capacitors: 三级电容器 + energy_connectors: 有线连接 From e054fe66828b72a2d363255332ed1a3e254d0cca Mon Sep 17 00:00:00 2001 From: TheBusyBiscuit Date: Sun, 18 Oct 2020 13:17:18 +0200 Subject: [PATCH 23/34] Fixes #2448 --- CHANGELOG.md | 1 + .../thebusybiscuit/slimefun4/implementation/SlimefunItems.java | 2 +- .../io/github/thebusybiscuit/slimefun4/utils/HeadTexture.java | 3 ++- 3 files changed, 4 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index e3f22799e..2e90d9fc9 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -31,6 +31,7 @@ * Removed 1.13 support #### Fixes +* Fixed #2448 ## Release Candidate 17 (17 Oct 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 0f995f7a3..5f68e896d 100644 --- a/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/SlimefunItems.java +++ b/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/SlimefunItems.java @@ -394,7 +394,7 @@ public final class SlimefunItems { public static final SlimefunItemStack PLASTIC_SHEET = new SlimefunItemStack("PLASTIC_SHEET", Material.PAPER, "&fPlastic Sheet"); public static final SlimefunItemStack MAGNET = new SlimefunItemStack("MAGNET", HeadTexture.MAGNET, "&cMagnet"); - public static final SlimefunItemStack NECROTIC_SKULL = new SlimefunItemStack("NECROTIC_SKULL", Material.WITHER_SKELETON_SKULL, "&cNecrotic Skull"); + public static final SlimefunItemStack NECROTIC_SKULL = new SlimefunItemStack("NECROTIC_SKULL", HeadTexture.NECROTIC_SKULL, "&cNecrotic Skull"); public static final SlimefunItemStack ESSENCE_OF_AFTERLIFE = new SlimefunItemStack("ESSENCE_OF_AFTERLIFE", Material.GUNPOWDER, "&4Essence of Afterlife"); public static final SlimefunItemStack STRANGE_NETHER_GOO = new SlimefunItemStack("STRANGE_NETHER_GOO", Material.PURPLE_DYE, "&5Strange Nether Goo", "", "&fA strange bio matter that", "&fcan be acquired from", "&fbartering with Piglins"); public static final SlimefunItemStack ELECTRO_MAGNET = new SlimefunItemStack("ELECTRO_MAGNET", HeadTexture.MAGNET, "&cElectromagnet"); 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 ea095a5d7..ee8a849d0 100644 --- a/src/main/java/io/github/thebusybiscuit/slimefun4/utils/HeadTexture.java +++ b/src/main/java/io/github/thebusybiscuit/slimefun4/utils/HeadTexture.java @@ -108,7 +108,8 @@ public enum HeadTexture { CARGO_ARROW_RIGHT("c2f910c47da042e4aa28af6cc81cf48ac6caf37dab35f88db993accb9dfe516"), ADD_NEW_LANGUAGE("3edd20be93520949e6ce789dc4f43efaeb28c717ee6bfcbbe02780142f716"), IRON_GOLEM("89091d79ea0f59ef7ef94d7bba6e5f17f2f7d4572c44f90f76c4819a714"), - PIGLIN_HEAD("2882af1294a74023e6919a31d1a027310f2e142afb4667d230d155e7f21dbb41"); + PIGLIN_HEAD("2882af1294a74023e6919a31d1a027310f2e142afb4667d230d155e7f21dbb41"), + NECROTIC_SKULL("7953b6c68448e7e6b6bf8fb273d7203acd8e1be19e81481ead51f45de59a8"); public static final HeadTexture[] valuesCache = values(); From 3d364ee331de23cffacbb88177e0b6ffb0289d09 Mon Sep 17 00:00:00 2001 From: "Panda.com" Date: Sun, 18 Oct 2020 13:48:38 +0200 Subject: [PATCH 24/34] did requested changes --- .../slimefun4/utils/tags/SlimefunTag.java | 27 +++++++----- .../tags/block_placer_ignored_materials.json | 41 +++---------------- src/main/resources/tags/pressure_plates.json | 12 ++++++ .../resources/tags/sensitive_materials.json | 32 ++++++++++++--- 4 files changed, 60 insertions(+), 52 deletions(-) create mode 100644 src/main/resources/tags/pressure_plates.json diff --git a/src/main/java/io/github/thebusybiscuit/slimefun4/utils/tags/SlimefunTag.java b/src/main/java/io/github/thebusybiscuit/slimefun4/utils/tags/SlimefunTag.java index 74dc60adf..558f78e9c 100644 --- a/src/main/java/io/github/thebusybiscuit/slimefun4/utils/tags/SlimefunTag.java +++ b/src/main/java/io/github/thebusybiscuit/slimefun4/utils/tags/SlimefunTag.java @@ -35,9 +35,9 @@ import io.github.thebusybiscuit.slimefun4.implementation.items.tools.SmeltersPic * extensions of the default Minecraft tags. * The actual tag files are located in the {@literal /src/main/resources/tags} directory * and follow Minecraft's tags.json format. - * + * * @author TheBusyBiscuit - * + * * @see TagParser * */ @@ -193,7 +193,12 @@ public enum SlimefunTag implements Tag { /** * All materials (ores) which trigger the Talisman of the Caveman. */ - CAVEMAN_TALISMAN_TRIGGERS; + CAVEMAN_TALISMAN_TRIGGERS, + + /** + * All the types of pressure plates. + */ + PRESSURE_PLATES; private static final Map nameLookup = new HashMap<>(); public static final SlimefunTag[] valuesCache = values(); @@ -219,7 +224,7 @@ public enum SlimefunTag implements Tag { /** * This method reloads this {@link SlimefunTag} from our resources directory. - * + * * @throws TagMisconfigurationException * This is thrown whenever a {@link SlimefunTag} could not be parsed properly */ @@ -236,11 +241,11 @@ public enum SlimefunTag implements Tag { /** * This method reloads every single {@link SlimefunTag} from the resources directory. * It is equivalent to running {@link #reload()} on every single {@link SlimefunTag} manually. - * + * * Do keep in mind though that any misconfigured {@link SlimefunTag} will abort the entire * method and throw a {@link TagMisconfigurationException}. So one faulty {@link SlimefunTag} * will stop the reloading process. - * + * * @throws TagMisconfigurationException * This is thrown if one of the {@link SlimefunTag SlimefunTags} could not be parsed correctly */ @@ -293,9 +298,9 @@ public enum SlimefunTag implements Tag { /** * This returns a {@link Set} of {@link Tag Tags} which are children of this {@link SlimefunTag}, * these can be other {@link SlimefunTag SlimefunTags} or regular {@link Tag Tags}. - * + * * The returned {@link Set} is immutable - * + * * @return An immutable {@link Set} of all sub tags. */ @Nonnull @@ -305,7 +310,7 @@ public enum SlimefunTag implements Tag { /** * This method returns an Array representation for this {@link SlimefunTag}. - * + * * @return A {@link Material} array for this {@link Tag} */ @Nonnull @@ -315,7 +320,7 @@ public enum SlimefunTag implements Tag { /** * This returns a {@link Stream} of {@link Material Materials} for this {@link SlimefunTag}. - * + * * @return A {@link Stream} of {@link Material Materials} */ @Nonnull @@ -331,7 +336,7 @@ public enum SlimefunTag implements Tag { * * @param value * The value which you would like to look up. - * + * * @return The {@link SlimefunTag} or null if it does not exist. */ @Nullable diff --git a/src/main/resources/tags/block_placer_ignored_materials.json b/src/main/resources/tags/block_placer_ignored_materials.json index ef5b31ac2..9bd0c14da 100644 --- a/src/main/resources/tags/block_placer_ignored_materials.json +++ b/src/main/resources/tags/block_placer_ignored_materials.json @@ -1,22 +1,10 @@ { "values" : [ "#slimefun:sensitive_materials", - "#slimefun:mushrooms", - "#minecraft:tall_flowers", + "#slimefun:pressure_plates", "#minecraft:beds", - "#minecraft:doors", - "minecraft:bamboo", - "#minecraft:rails", - "#minecraft:small_flowers", - "#minecraft:coral_blocks", - "#minecraft:coral_plants", - "#minecraft:small_flowers", - "#minecraft:buttons", - "#minecraft:banners", - "#minecraft:signs", - "#minecraft:standing_signs", - "#minecraft:wall_signs", - "#minecraft:wooden_pressure_plates", + "minecraft:cake", + { "id" : "minecraft:nether_sprouts", "required" : false @@ -36,26 +24,7 @@ { "id" : "minecraft:weeping_vines", "required" : false - }, - { - "id" : "minecraft:polished_blackstone_pressure_plate", - "required" : false - }, - "minecraft:sugar_cane", - "minecraft:lily_pad", - "minecraft:dead_bush", - "minecraft:fern", - "minecraft:grass", - "minecraft:seagrass", - "minecraft:tall_seagrass", - "minecraft:cactus", - "minecraft:kelp", - "minecraft:ladder", - "minecraft:snow", - "minecraft:lever", - "minecraft:repeater", - "minecraft:tripwire_hook", - "minecraft:tall_grass", - "minecraft:large_fern" + } + ] } diff --git a/src/main/resources/tags/pressure_plates.json b/src/main/resources/tags/pressure_plates.json new file mode 100644 index 000000000..b8bdb7667 --- /dev/null +++ b/src/main/resources/tags/pressure_plates.json @@ -0,0 +1,12 @@ +{ + "values" : [ + "#minecraft:wooden_pressure_plates", + "minecraft:stone_pressure_plate", + "minecraft:light_weighted_pressure_plate", + "minecraft:heavy_weighted_pressure_plate", + { + "id" : "minecraft:polished_blackstone_pressure_plate", + "required" : false + } + ] +} diff --git a/src/main/resources/tags/sensitive_materials.json b/src/main/resources/tags/sensitive_materials.json index bd782e1e6..019721a14 100644 --- a/src/main/resources/tags/sensitive_materials.json +++ b/src/main/resources/tags/sensitive_materials.json @@ -1,11 +1,33 @@ { "values" : [ "#minecraft:saplings", - "#minecraft:wooden_pressure_plates", "#slimefun:torches", - "minecraft:stone_pressure_plate", - "minecraft:light_weighted_pressure_plate", - "minecraft:heavy_weighted_pressure_plate", - "minecraft:cake" + "#minecraft:buttons", + "#minecraft:signs", + "#slimefun:mushrooms", + "#minecraft:doors", + "minecraft:bamboo", + "#minecraft:rails", + "#minecraft:small_flowers", + "#minecraft:coral_blocks", + "#minecraft:coral_plants", + "#minecraft:small_flowers", + "#minecraft:banners", + "minecraft:sugar_cane", + "minecraft:ladder", + "minecraft:snow", + "minecraft:lever", + "minecraft:repeater", + "minecraft:tripwire_hook", + "minecraft:tall_grass", + "minecraft:large_fern", + "minecraft:lily_pad", + "minecraft:dead_bush", + "minecraft:fern", + "minecraft:grass", + "minecraft:seagrass", + "minecraft:tall_seagrass", + "minecraft:cactus", + "minecraft:kelp" ] } From 734b853eb7e2995e0a02f50a5280591e85a65e44 Mon Sep 17 00:00:00 2001 From: TheBusyBiscuit Date: Sun, 18 Oct 2020 13:53:15 +0200 Subject: [PATCH 25/34] [CI skip] Reduced technical debt --- .../guide/ChestSlimefunGuide.java | 32 ++++------ .../slimefun4/utils/NumberUtils.java | 62 +++++++++++++++++-- .../Slimefun/Objects/Category.java | 21 +++++++ 3 files changed, 92 insertions(+), 23 deletions(-) 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 cbab11d87..e024b4c38 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 @@ -9,6 +9,7 @@ import java.util.Optional; import java.util.logging.Level; import javax.annotation.Nonnull; +import javax.annotation.ParametersAreNonnullByDefault; import org.bukkit.ChatColor; import org.bukkit.Material; @@ -64,14 +65,14 @@ import me.mrCookieSlime.Slimefun.api.Slimefun; public class ChestSlimefunGuide implements SlimefunGuideImplementation { private static final int CATEGORY_SIZE = 36; + private static final Sound sound = Sound.ITEM_BOOK_PAGE_TURN; - private final ItemStack item; private final int[] recipeSlots = { 3, 4, 5, 12, 13, 14, 21, 22, 23 }; - private final Sound sound = Sound.ITEM_BOOK_PAGE_TURN; + private final ItemStack item; private final boolean showVanillaRecipes; - public ChestSlimefunGuide(boolean vanillaRecipes) { - showVanillaRecipes = vanillaRecipes; + public ChestSlimefunGuide(boolean showVanillaRecipes) { + this.showVanillaRecipes = showVanillaRecipes; item = new SlimefunGuideItem(this, "&aSlimefun Guide &7(Chest GUI)"); } @@ -125,7 +126,6 @@ public class ChestSlimefunGuide implements SlimefunGuideImplementation { } ChestMenu menu = create(p); - List categories = getVisibleCategories(p, profile); int index = 9; @@ -334,26 +334,14 @@ public class ChestSlimefunGuide implements SlimefunGuideImplementation { int index = 9; // Find items and add them 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))) { + if (isSearchFilterApplicable(slimefunItem, searchTerm)) { ItemStack itemstack = new CustomItem(slimefunItem.getItem(), meta -> { - List lore = null; Category category = slimefunItem.getCategory(); - - if (category != null) { - ItemStack categoryItem = category.getItem(p); - - if (categoryItem != null && categoryItem.hasItemMeta() && categoryItem.getItemMeta().hasDisplayName()) { - lore = Arrays.asList("", ChatColor.DARK_GRAY + "\u21E8 " + ChatColor.WHITE + categoryItem.getItemMeta().getDisplayName()); - } - } - - meta.setLore(lore); + meta.setLore(Arrays.asList("", ChatColor.DARK_GRAY + "\u21E8 " + ChatColor.WHITE + category.getDisplayName(p))); meta.addItemFlags(ItemFlag.HIDE_ATTRIBUTES, ItemFlag.HIDE_ENCHANTS, ItemFlag.HIDE_POTION_EFFECTS); }); @@ -379,6 +367,12 @@ public class ChestSlimefunGuide implements SlimefunGuideImplementation { menu.open(p); } + @ParametersAreNonnullByDefault + private boolean isSearchFilterApplicable(SlimefunItem slimefunItem, String searchTerm) { + String itemName = ChatColor.stripColor(slimefunItem.getItemName()).toLowerCase(Locale.ROOT); + return !itemName.isEmpty() && (itemName.equals(searchTerm) || itemName.contains(searchTerm)); + } + @Override public void displayItem(PlayerProfile profile, ItemStack item, int index, boolean addToHistory) { Player p = profile.getPlayer(); diff --git a/src/main/java/io/github/thebusybiscuit/slimefun4/utils/NumberUtils.java b/src/main/java/io/github/thebusybiscuit/slimefun4/utils/NumberUtils.java index a84293946..8dd69f881 100644 --- a/src/main/java/io/github/thebusybiscuit/slimefun4/utils/NumberUtils.java +++ b/src/main/java/io/github/thebusybiscuit/slimefun4/utils/NumberUtils.java @@ -12,16 +12,51 @@ import javax.annotation.Nullable; import org.apache.commons.lang.Validate; import org.bukkit.ChatColor; +/** + * This class contains various utilities related to numbers and number formatting. + * + * @author TheBusyBiscuit + * @author Walshy + * + */ public final class NumberUtils { + /** + * This is our {@link DecimalFormat} for decimal values. + */ private static final DecimalFormat DECIMAL_FORMAT = new DecimalFormat("#.##"); + /** + * We do not want any instance of this to be created. + */ private NumberUtils() {} - public static String formatBigNumber(int i) { - return NumberFormat.getNumberInstance(Locale.US).format(i); + /** + * This method formats a given {@link Integer} to be displayed nicely with + * decimal digit grouping. + * {@code 1000000} for example will return {@code "1,000,000"} as a {@link String}. + * It uses the american (US) {@link Locale} for this transformation. + * + * @param number + * Your {@link Integer} + * + * @return The formatted String + */ + @Nonnull + public static String formatBigNumber(int number) { + return NumberFormat.getNumberInstance(Locale.US).format(number); } + /** + * This method transforms a String representation of a {@link LocalDateTime} + * from GitHub's API back into a {@link LocalDateTime} object + * + * @param date + * The formatted String version of a date from GitHub + * + * @return The {@link LocalDateTime} for the given input + */ + @Nonnull public static LocalDateTime parseGitHubDate(@Nonnull String date) { Validate.notNull(date, "Provided date was null"); return LocalDateTime.parse(date.substring(0, date.length() - 1)); @@ -37,6 +72,7 @@ public final class NumberUtils { * * @return A representative {@link ChatColor} */ + @Nonnull public static ChatColor getColorFromPercentage(float percentage) { if (percentage < 16.0F) { return ChatColor.DARK_RED; @@ -53,13 +89,28 @@ public final class NumberUtils { } } + /** + * This returns the elapsed time since the given {@link LocalDateTime}. + * The output will be nicely formatted based on the elapsed hours or days since the + * given {@link LocalDateTime}. + * + * If a {@link LocalDateTime} from yesterday was passed it will return {@code "1d"}. + * One hour later it will read {@code "1d 1h"}. For values smaller than an hour {@code "< 1h"} + * will be returned instead. + * + * @param date + * The {@link LocalDateTime}. + * + * @return The elapsed time as a {@link String} + */ + @Nonnull public static String getElapsedTime(@Nonnull LocalDateTime date) { Validate.notNull(date, "Provided date was null"); long hours = Duration.between(date, LocalDateTime.now()).toHours(); if (hours == 0) { return "< 1h"; - } else if ((hours / 24) == 0) { + } else if (hours / 24 == 0) { return (hours % 24) + "h"; } else if (hours % 24 == 0) { return (hours / 24) + "d"; @@ -68,10 +119,12 @@ public final class NumberUtils { } } + @Nonnull public static String getTimeLeft(int seconds) { String timeleft = ""; int minutes = (int) (seconds / 60L); + if (minutes > 0) { timeleft += minutes + "m "; } @@ -80,7 +133,7 @@ public final class NumberUtils { return timeleft + seconds + "s"; } - public static int getInt(String str, int defaultValue) { + public static int getInt(@Nonnull String str, int defaultValue) { if (PatternUtils.NUMERIC.matcher(str).matches()) { return Integer.parseInt(str); } @@ -88,6 +141,7 @@ public final class NumberUtils { return defaultValue; } + @Nonnull public static String getAsMillis(long nanoseconds) { if (nanoseconds == 0) { return "0ms"; diff --git a/src/main/java/me/mrCookieSlime/Slimefun/Objects/Category.java b/src/main/java/me/mrCookieSlime/Slimefun/Objects/Category.java index c69a682ec..8c788e94f 100644 --- a/src/main/java/me/mrCookieSlime/Slimefun/Objects/Category.java +++ b/src/main/java/me/mrCookieSlime/Slimefun/Objects/Category.java @@ -134,6 +134,7 @@ public class Category implements Keyed { * * @param p * The Player to create this {@link ItemStack} for + * * @return A localized display item for this {@link Category} */ @Nonnull @@ -166,6 +167,26 @@ public class Category implements Keyed { return ChatColor.stripColor(item.getItemMeta().getDisplayName()); } + /** + * This returns the localized display name of this {@link Category} for the given {@link Player}. + * The method will fall back to {@link #getUnlocalizedName()} if no translation was found. + * + * @param p + * The {@link Player} who to translate the name for + * + * @return The localized name of this {@link Category} + */ + @Nonnull + public String getDisplayName(@Nonnull Player p) { + String localized = SlimefunPlugin.getLocalization().getCategoryName(p, getKey()); + + if (localized != null) { + return localized; + } else { + return getUnlocalizedName(); + } + } + /** * Returns all instances of {@link SlimefunItem} bound to this {@link Category}. * From dc025c7b28a213a0b7f7f50b94fe1cfde5587731 Mon Sep 17 00:00:00 2001 From: "Panda.com" Date: Sun, 18 Oct 2020 14:31:54 +0200 Subject: [PATCH 26/34] fix --- .../slimefun4/utils/tags/SlimefunTag.java | 12 +++---- .../tags/block_placer_ignored_materials.json | 31 ++++++++++++++++--- .../resources/tags/sensitive_materials.json | 29 ++--------------- 3 files changed, 35 insertions(+), 37 deletions(-) diff --git a/src/main/java/io/github/thebusybiscuit/slimefun4/utils/tags/SlimefunTag.java b/src/main/java/io/github/thebusybiscuit/slimefun4/utils/tags/SlimefunTag.java index 558f78e9c..aba7a1189 100644 --- a/src/main/java/io/github/thebusybiscuit/slimefun4/utils/tags/SlimefunTag.java +++ b/src/main/java/io/github/thebusybiscuit/slimefun4/utils/tags/SlimefunTag.java @@ -121,6 +121,11 @@ public enum SlimefunTag implements Tag { */ CONCRETE_POWDERS, + /** + * All the types of pressure plates. + */ + PRESSURE_PLATES, + /** * Materials which are sensitive to break. * Things like Saplings or Pressure plates which break as well when you break @@ -193,12 +198,7 @@ public enum SlimefunTag implements Tag { /** * All materials (ores) which trigger the Talisman of the Caveman. */ - CAVEMAN_TALISMAN_TRIGGERS, - - /** - * All the types of pressure plates. - */ - PRESSURE_PLATES; + CAVEMAN_TALISMAN_TRIGGERS; private static final Map nameLookup = new HashMap<>(); public static final SlimefunTag[] valuesCache = values(); diff --git a/src/main/resources/tags/block_placer_ignored_materials.json b/src/main/resources/tags/block_placer_ignored_materials.json index 9bd0c14da..8601e2471 100644 --- a/src/main/resources/tags/block_placer_ignored_materials.json +++ b/src/main/resources/tags/block_placer_ignored_materials.json @@ -1,10 +1,34 @@ { "values" : [ "#slimefun:sensitive_materials", - "#slimefun:pressure_plates", "#minecraft:beds", - "minecraft:cake", - + "#minecraft:buttons", + "#minecraft:signs", + "#slimefun:mushrooms", + "#minecraft:doors", + "minecraft:bamboo", + "#minecraft:rails", + "#minecraft:small_flowers", + "#minecraft:coral_blocks", + "#minecraft:coral_plants", + "#minecraft:small_flowers", + "#minecraft:banners", + "minecraft:sugar_cane", + "minecraft:ladder", + "minecraft:snow", + "minecraft:lever", + "minecraft:repeater", + "minecraft:tripwire_hook", + "minecraft:tall_grass", + "minecraft:large_fern", + "minecraft:lily_pad", + "minecraft:dead_bush", + "minecraft:fern", + "minecraft:grass", + "minecraft:seagrass", + "minecraft:tall_seagrass", + "minecraft:cactus", + "minecraft:kelp", { "id" : "minecraft:nether_sprouts", "required" : false @@ -25,6 +49,5 @@ "id" : "minecraft:weeping_vines", "required" : false } - ] } diff --git a/src/main/resources/tags/sensitive_materials.json b/src/main/resources/tags/sensitive_materials.json index 019721a14..455173a3b 100644 --- a/src/main/resources/tags/sensitive_materials.json +++ b/src/main/resources/tags/sensitive_materials.json @@ -2,32 +2,7 @@ "values" : [ "#minecraft:saplings", "#slimefun:torches", - "#minecraft:buttons", - "#minecraft:signs", - "#slimefun:mushrooms", - "#minecraft:doors", - "minecraft:bamboo", - "#minecraft:rails", - "#minecraft:small_flowers", - "#minecraft:coral_blocks", - "#minecraft:coral_plants", - "#minecraft:small_flowers", - "#minecraft:banners", - "minecraft:sugar_cane", - "minecraft:ladder", - "minecraft:snow", - "minecraft:lever", - "minecraft:repeater", - "minecraft:tripwire_hook", - "minecraft:tall_grass", - "minecraft:large_fern", - "minecraft:lily_pad", - "minecraft:dead_bush", - "minecraft:fern", - "minecraft:grass", - "minecraft:seagrass", - "minecraft:tall_seagrass", - "minecraft:cactus", - "minecraft:kelp" + "minecraft:cake", + "#slimefun:pressure_plates" ] } From e3df3ab012a353c21a996e5d40e4f6c3c7af8a2d Mon Sep 17 00:00:00 2001 From: "Panda.com" Date: Sun, 18 Oct 2020 15:47:47 +0200 Subject: [PATCH 27/34] added tall_flowers.json and requested changes --- .../slimefun4/utils/tags/SlimefunTag.java | 5 +++++ .../resources/tags/block_placer_ignored_materials.json | 6 ++---- src/main/resources/tags/sensitive_materials.json | 4 ++-- src/main/resources/tags/tall_flowers.json | 10 ++++++++++ 4 files changed, 19 insertions(+), 6 deletions(-) create mode 100644 src/main/resources/tags/tall_flowers.json diff --git a/src/main/java/io/github/thebusybiscuit/slimefun4/utils/tags/SlimefunTag.java b/src/main/java/io/github/thebusybiscuit/slimefun4/utils/tags/SlimefunTag.java index aba7a1189..289314298 100644 --- a/src/main/java/io/github/thebusybiscuit/slimefun4/utils/tags/SlimefunTag.java +++ b/src/main/java/io/github/thebusybiscuit/slimefun4/utils/tags/SlimefunTag.java @@ -126,6 +126,11 @@ public enum SlimefunTag implements Tag { */ PRESSURE_PLATES, + /** + * All tall flowers because minecraft doesn't have a tag for this + */ + TALL_FLOWERS, + /** * Materials which are sensitive to break. * Things like Saplings or Pressure plates which break as well when you break diff --git a/src/main/resources/tags/block_placer_ignored_materials.json b/src/main/resources/tags/block_placer_ignored_materials.json index 8601e2471..dba4fd923 100644 --- a/src/main/resources/tags/block_placer_ignored_materials.json +++ b/src/main/resources/tags/block_placer_ignored_materials.json @@ -1,17 +1,17 @@ { "values" : [ "#slimefun:sensitive_materials", + "#slimefun:tall_flowers", + "#slimefun:mushrooms", "#minecraft:beds", "#minecraft:buttons", "#minecraft:signs", - "#slimefun:mushrooms", "#minecraft:doors", "minecraft:bamboo", "#minecraft:rails", "#minecraft:small_flowers", "#minecraft:coral_blocks", "#minecraft:coral_plants", - "#minecraft:small_flowers", "#minecraft:banners", "minecraft:sugar_cane", "minecraft:ladder", @@ -19,8 +19,6 @@ "minecraft:lever", "minecraft:repeater", "minecraft:tripwire_hook", - "minecraft:tall_grass", - "minecraft:large_fern", "minecraft:lily_pad", "minecraft:dead_bush", "minecraft:fern", diff --git a/src/main/resources/tags/sensitive_materials.json b/src/main/resources/tags/sensitive_materials.json index 455173a3b..daae5c94f 100644 --- a/src/main/resources/tags/sensitive_materials.json +++ b/src/main/resources/tags/sensitive_materials.json @@ -2,7 +2,7 @@ "values" : [ "#minecraft:saplings", "#slimefun:torches", - "minecraft:cake", - "#slimefun:pressure_plates" + "#slimefun:pressure_plates", + "minecraft:cake" ] } diff --git a/src/main/resources/tags/tall_flowers.json b/src/main/resources/tags/tall_flowers.json new file mode 100644 index 000000000..c725cbaac --- /dev/null +++ b/src/main/resources/tags/tall_flowers.json @@ -0,0 +1,10 @@ +{ + "values" : [ + "#minecraft:lilac", + "#minecraft:rose_bush", + "#minecraft:peony", + "minecraft:tall_grass", + "minecraft:large_fern", + "sunflower" + ] +} From b4cd8e0d0cc5299972157cfbe5bb8757f0a613ff Mon Sep 17 00:00:00 2001 From: "Panda.com" Date: Sun, 18 Oct 2020 16:01:32 +0200 Subject: [PATCH 28/34] added Unit Test --- src/main/resources/tags/tall_flowers.json | 2 +- .../slimefun4/testing/tests/tags/TestSlimefunTags.java | 2 ++ 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/src/main/resources/tags/tall_flowers.json b/src/main/resources/tags/tall_flowers.json index c725cbaac..85552928a 100644 --- a/src/main/resources/tags/tall_flowers.json +++ b/src/main/resources/tags/tall_flowers.json @@ -5,6 +5,6 @@ "#minecraft:peony", "minecraft:tall_grass", "minecraft:large_fern", - "sunflower" + "minecraft:sunflower" ] } diff --git a/src/test/java/io/github/thebusybiscuit/slimefun4/testing/tests/tags/TestSlimefunTags.java b/src/test/java/io/github/thebusybiscuit/slimefun4/testing/tests/tags/TestSlimefunTags.java index 7c2a6f51f..65a850c1c 100644 --- a/src/test/java/io/github/thebusybiscuit/slimefun4/testing/tests/tags/TestSlimefunTags.java +++ b/src/test/java/io/github/thebusybiscuit/slimefun4/testing/tests/tags/TestSlimefunTags.java @@ -8,6 +8,7 @@ import javax.annotation.ParametersAreNonnullByDefault; import org.bukkit.Material; import org.bukkit.Tag; +import org.bukkit.entity.Slime; import org.junit.jupiter.api.AfterAll; import org.junit.jupiter.api.Assertions; import org.junit.jupiter.api.BeforeAll; @@ -63,6 +64,7 @@ class TestSlimefunTags { // Inclusion through a Slimefun Tag Assertions.assertTrue(SlimefunTag.SENSITIVE_MATERIALS.isTagged(Material.TORCH)); + Assertions.assertTrue(SlimefunTag.SENSITIVE_MATERIALS.isTagged(Material.OAK_PRESSURE_PLATE)); } @Test From 0a4f666094f8c1811a086f9c6fe28ab4eeade41d Mon Sep 17 00:00:00 2001 From: "Panda.com" Date: Sun, 18 Oct 2020 16:06:19 +0200 Subject: [PATCH 29/34] me dumb --- src/main/resources/tags/tall_flowers.json | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/main/resources/tags/tall_flowers.json b/src/main/resources/tags/tall_flowers.json index 85552928a..61958b5de 100644 --- a/src/main/resources/tags/tall_flowers.json +++ b/src/main/resources/tags/tall_flowers.json @@ -1,8 +1,8 @@ { "values" : [ - "#minecraft:lilac", - "#minecraft:rose_bush", - "#minecraft:peony", + "minecraft:lilac", + "minecraft:rose_bush", + "minecraft:peony", "minecraft:tall_grass", "minecraft:large_fern", "minecraft:sunflower" From 48f45bef02f8453a2483fe8af636bea673e11416 Mon Sep 17 00:00:00 2001 From: "Panda.com" Date: Sun, 18 Oct 2020 17:39:54 +0200 Subject: [PATCH 30/34] Whoops --- .../slimefun4/testing/tests/tags/TestSlimefunTags.java | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/test/java/io/github/thebusybiscuit/slimefun4/testing/tests/tags/TestSlimefunTags.java b/src/test/java/io/github/thebusybiscuit/slimefun4/testing/tests/tags/TestSlimefunTags.java index 65a850c1c..e6a16d73c 100644 --- a/src/test/java/io/github/thebusybiscuit/slimefun4/testing/tests/tags/TestSlimefunTags.java +++ b/src/test/java/io/github/thebusybiscuit/slimefun4/testing/tests/tags/TestSlimefunTags.java @@ -8,7 +8,6 @@ import javax.annotation.ParametersAreNonnullByDefault; import org.bukkit.Material; import org.bukkit.Tag; -import org.bukkit.entity.Slime; import org.junit.jupiter.api.AfterAll; import org.junit.jupiter.api.Assertions; import org.junit.jupiter.api.BeforeAll; @@ -62,7 +61,7 @@ class TestSlimefunTags { // Inclusion through a Minecraft Tag Assertions.assertTrue(SlimefunTag.SENSITIVE_MATERIALS.isTagged(Material.OAK_SAPLING)); - // Inclusion through a Slimefun Tag + // Inclusion through a Slimefun Tags Assertions.assertTrue(SlimefunTag.SENSITIVE_MATERIALS.isTagged(Material.TORCH)); Assertions.assertTrue(SlimefunTag.SENSITIVE_MATERIALS.isTagged(Material.OAK_PRESSURE_PLATE)); } From 766a245a162673a356dcebc406391ea2cb5c61d7 Mon Sep 17 00:00:00 2001 From: "Panda.com" Date: Sun, 18 Oct 2020 18:42:12 +0200 Subject: [PATCH 31/34] whoops --- .../slimefun4/testing/tests/tags/TestSlimefunTags.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/test/java/io/github/thebusybiscuit/slimefun4/testing/tests/tags/TestSlimefunTags.java b/src/test/java/io/github/thebusybiscuit/slimefun4/testing/tests/tags/TestSlimefunTags.java index e6a16d73c..139c5c998 100644 --- a/src/test/java/io/github/thebusybiscuit/slimefun4/testing/tests/tags/TestSlimefunTags.java +++ b/src/test/java/io/github/thebusybiscuit/slimefun4/testing/tests/tags/TestSlimefunTags.java @@ -61,7 +61,7 @@ class TestSlimefunTags { // Inclusion through a Minecraft Tag Assertions.assertTrue(SlimefunTag.SENSITIVE_MATERIALS.isTagged(Material.OAK_SAPLING)); - // Inclusion through a Slimefun Tags + // Inclusion through a Slimefun Tag Assertions.assertTrue(SlimefunTag.SENSITIVE_MATERIALS.isTagged(Material.TORCH)); Assertions.assertTrue(SlimefunTag.SENSITIVE_MATERIALS.isTagged(Material.OAK_PRESSURE_PLATE)); } From c98292b08cf2f3bc8a5c96429380e9a4c5231a55 Mon Sep 17 00:00:00 2001 From: CURVX Date: Sun, 18 Oct 2020 22:32:36 +0530 Subject: [PATCH 32/34] Added changes req. by TTB --- .../listeners/SlimefunBootsListener.java | 27 ++++++++----------- 1 file changed, 11 insertions(+), 16 deletions(-) diff --git a/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/listeners/SlimefunBootsListener.java b/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/listeners/SlimefunBootsListener.java index 777b7c141..8120b61c8 100644 --- a/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/listeners/SlimefunBootsListener.java +++ b/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/listeners/SlimefunBootsListener.java @@ -39,15 +39,19 @@ public class SlimefunBootsListener implements Listener { @EventHandler(priority = EventPriority.HIGH, ignoreCancelled = true) public void onDamage(EntityDamageEvent e) { - if (e.getEntity() instanceof Player) { - if (e.getCause() == DamageCause.FALL) { + if (e.getEntity() instanceof Player && e.getCause() == DamageCause.FALL) { onFallDamage(e); - } else if (e instanceof EntityDamageByEntityEvent) { - EntityDamageByEntityEvent event = (EntityDamageByEntityEvent) e; + } + } - if (event.getDamager() instanceof EnderPearl) { - onEnderPearlDamage(e); - } + @EventHandler + public void onEnderPearlDamage(EntityDamageByEntityEvent e) { + if (e.getDamager() instanceof EnderPearl && e.getEntity() instanceof Player) { + Player p = (Player) e.getEntity(); + SlimefunItem boots = SlimefunItem.getByItem(p.getInventory().getBoots()); + + if (boots != null && boots.getId().equals("ENDER_BOOTS") && Slimefun.hasUnlocked(p, boots, true)) { + e.setCancelled(true); } } } @@ -71,15 +75,6 @@ public class SlimefunBootsListener implements Listener { } } - private void onEnderPearlDamage(@Nonnull EntityDamageEvent e) { - Player p = (Player) e.getEntity(); - SlimefunItem boots = SlimefunItem.getByItem(p.getInventory().getBoots()); - - if (boots != null && boots.getId().equals("ENDER_BOOTS") && Slimefun.hasUnlocked(p, boots, true)) { - e.setCancelled(true); - } - } - @EventHandler public void onTrample(PlayerInteractEvent e) { if (e.getAction() == Action.PHYSICAL) { From 95636818f5e9eb2d5f18950206f1fba710c78acb Mon Sep 17 00:00:00 2001 From: TheBusyBiscuit Date: Sun, 18 Oct 2020 19:21:46 +0200 Subject: [PATCH 33/34] [CI skip] Updated changelog --- CHANGELOG.md | 1 + 1 file changed, 1 insertion(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 2e90d9fc9..79e744e69 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -32,6 +32,7 @@ #### Fixes * Fixed #2448 +* Fixed #2470 ## Release Candidate 17 (17 Oct 2020) From df03c4bd8d1d9a2ad17562ac70611c01e3bab208 Mon Sep 17 00:00:00 2001 From: TheBusyBiscuit Date: Mon, 19 Oct 2020 12:49:43 +0200 Subject: [PATCH 34/34] [CI skip] Updated changelog --- CHANGELOG.md | 1 + 1 file changed, 1 insertion(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 79e744e69..d13310464 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -33,6 +33,7 @@ #### Fixes * Fixed #2448 * Fixed #2470 +* Fixed #2478 ## Release Candidate 17 (17 Oct 2020)