diff --git a/CHANGELOG.md b/CHANGELOG.md index e99d20f7b..4284a3bbb 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -24,6 +24,7 @@ ## Release Candidate 21 (TBD) #### Additions +* Nether Wart Blocks can now be turned into Nether Warts using a Grind Stone #### Changes 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 74c51bbe4..c6a4c799e 100644 --- a/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/SlimefunPlugin.java +++ b/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/SlimefunPlugin.java @@ -137,8 +137,8 @@ public final class SlimefunPlugin extends JavaPlugin implements SlimefunAddon { private boolean isNewlyInstalled = false; private final SlimefunRegistry registry = new SlimefunRegistry(); - private final TickerTask ticker = new TickerTask(); private final SlimefunCommand command = new SlimefunCommand(this); + private final TickerTask ticker = new TickerTask(); // Services - Systems that fulfill certain tasks, treat them as a black box private final CustomItemDataService itemDataService = new CustomItemDataService(this, "slimefun_item"); @@ -362,8 +362,12 @@ public final class SlimefunPlugin extends JavaPlugin implements SlimefunAddon { Bukkit.getScheduler().cancelTasks(this); // Finishes all started movements/removals of block data - ticker.halt(); - ticker.run(); + try { + ticker.halt(); + ticker.run(); + } catch (Exception x) { + getLogger().log(Level.SEVERE, x, () -> "Something went wrong while disabling the ticker task for Slimefun v" + getDescription().getVersion()); + } // Kill our Profiler Threads profiler.kill(); diff --git a/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/items/multiblocks/GrindStone.java b/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/items/multiblocks/GrindStone.java index 3c1533a98..54d28c391 100644 --- a/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/items/multiblocks/GrindStone.java +++ b/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/items/multiblocks/GrindStone.java @@ -4,6 +4,7 @@ import java.util.List; import java.util.stream.Collectors; import javax.annotation.Nonnull; +import javax.annotation.ParametersAreNonnullByDefault; import org.bukkit.Material; import org.bukkit.Sound; @@ -27,6 +28,7 @@ import me.mrCookieSlime.Slimefun.api.SlimefunItemStack; public class GrindStone extends MultiBlockMachine { + @ParametersAreNonnullByDefault public GrindStone(Category category, SlimefunItemStack item) { super(category, item, new ItemStack[] { null, null, null, null, new ItemStack(Material.OAK_FENCE), null, null, new CustomItem(Material.DISPENSER, "Dispenser (Facing up)"), null }, BlockFace.SELF); } @@ -71,6 +73,9 @@ public class GrindStone extends MultiBlockMachine { recipes.add(new ItemStack(Material.PRISMARINE)); recipes.add(new ItemStack(Material.PRISMARINE_SHARD, 4)); + + recipes.add(new ItemStack(Material.NETHER_WART_BLOCK)); + recipes.add(new ItemStack(Material.NETHER_WART, 9)); } @Override diff --git a/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/listeners/TalismanListener.java b/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/listeners/TalismanListener.java index efab110ef..1a5ae752c 100644 --- a/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/listeners/TalismanListener.java +++ b/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/listeners/TalismanListener.java @@ -237,15 +237,15 @@ public class TalismanListener implements Listener { TalismanEnchantment enchantment = talisman.getRandomEnchantment(e.getItem(), enchantments.keySet()); if (enchantment != null && Talisman.checkFor(e, SlimefunItems.TALISMAN_MAGICIAN)) { - /* - * Fix #2679 - * By default, the Bukkit API doesn't allow us to give enchantment books extra enchantments. - */ - if (talisman.isEnchantmentBookAllowed() && e.getItem().getType() == Material.BOOK) { - e.getItem().addUnsafeEnchantment(enchantment.getEnchantment(), enchantment.getLevel()); - } else { - enchantments.put(enchantment.getEnchantment(), enchantment.getLevel()); - } + /* + * Fix #2679 + * By default, the Bukkit API doesn't allow us to give enchantment books extra enchantments. + */ + if (talisman.isEnchantmentBookAllowed() && e.getItem().getType() == Material.BOOK) { + e.getItem().addUnsafeEnchantment(enchantment.getEnchantment(), enchantment.getLevel()); + } else { + enchantments.put(enchantment.getEnchantment(), enchantment.getLevel()); + } } // Wizard Talisman diff --git a/src/main/java/io/github/thebusybiscuit/slimefun4/utils/ColoredMaterial.java b/src/main/java/io/github/thebusybiscuit/slimefun4/utils/ColoredMaterial.java index fb791fda3..4f6826508 100644 --- a/src/main/java/io/github/thebusybiscuit/slimefun4/utils/ColoredMaterial.java +++ b/src/main/java/io/github/thebusybiscuit/slimefun4/utils/ColoredMaterial.java @@ -47,6 +47,28 @@ public enum ColoredMaterial { Material.BLACK_WOOL }), + /** + * This {@link List} contains all carpet colors ordered by their appearance ingame. + */ + CARPET(new Material[] { + Material.WHITE_CARPET, + Material.ORANGE_CARPET, + Material.MAGENTA_CARPET, + Material.LIGHT_BLUE_CARPET, + Material.YELLOW_CARPET, + Material.LIME_CARPET, + Material.PINK_CARPET, + Material.GRAY_CARPET, + Material.LIGHT_GRAY_CARPET, + Material.CYAN_CARPET, + Material.PURPLE_CARPET, + Material.BLUE_CARPET, + Material.BROWN_CARPET, + Material.GREEN_CARPET, + Material.RED_CARPET, + Material.BLACK_CARPET + }), + /** * This {@link List} contains all stained glass colors ordered by their appearance ingame. */