9
0
mirror of https://github.com/Xiao-MoMi/Custom-Crops.git synced 2025-12-25 01:49:18 +00:00
This commit is contained in:
Xiao-MoMi
2022-10-10 21:29:24 +08:00
parent 3d481aadc9
commit 41810c090e
2 changed files with 7 additions and 4 deletions

View File

@@ -105,7 +105,12 @@ public class MainConfig {
worlds[i] = Bukkit.getWorld(worldsName.get(i));
}
}
worldList = List.of(worlds);
if (worlds != null) {
worldList = List.of(worlds);
}
else {
worldList = new ArrayList<>();
}
cropMode = config.getString("mechanics.crops-mode", "tripwire").equals("tripwire");
limitation = config.getBoolean("optimization.limitation.enable", true);
wireAmount = config.getInt("optimization.limitation.tripwire-amount", 64);

View File

@@ -100,9 +100,6 @@ public class ItemsAdderWireHandler extends ItemsAdderHandler {
public void onPlayerInteract(PlayerInteractEvent event) {
final Player player = event.getPlayer();
long time = System.currentTimeMillis();
if (time - (coolDown.getOrDefault(player, time - 50)) < 50) return;
coolDown.put(player, time);
super.onPlayerInteract(event);
@@ -154,6 +151,7 @@ public class ItemsAdderWireHandler extends ItemsAdderHandler {
//interact pot (must have an item)
else if (blockID.equals(BasicItemConfig.wetPot) || blockID.equals(BasicItemConfig.dryPot)) {
if (!AntiGrief.testPlace(player, location)) return;
ItemStack itemInHand = event.getItem();