1
mirror of https://github.com/StarWishsama/Slimefun4.git synced 2024-09-19 19:25:48 +00:00

Nether Wart Blocks can be turned into Nether Warts using a Grind Stone

This commit is contained in:
TheBusyBiscuit 2021-02-01 10:47:31 +01:00
parent ddfac01d35
commit fe42f6fa9f
5 changed files with 44 additions and 12 deletions

View File

@ -24,6 +24,7 @@
## Release Candidate 21 (TBD)
#### Additions
* Nether Wart Blocks can now be turned into Nether Warts using a Grind Stone
#### Changes

View File

@ -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();

View File

@ -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

View File

@ -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

View File

@ -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.
*/