mirror of
https://github.com/Xiao-MoMi/Custom-Crops.git
synced 2025-12-19 15:09:25 +00:00
fix some bugs
This commit is contained in:
@@ -377,6 +377,7 @@ public class PotBlock extends AbstractCustomCropsBlock {
|
|||||||
waterChanged = true;
|
waterChanged = true;
|
||||||
}
|
}
|
||||||
hasNaturalWater = true;
|
hasNaturalWater = true;
|
||||||
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -33,6 +33,10 @@ import org.bukkit.Location;
|
|||||||
import org.bukkit.World;
|
import org.bukkit.World;
|
||||||
import org.bukkit.command.CommandSender;
|
import org.bukkit.command.CommandSender;
|
||||||
import org.bukkit.entity.Player;
|
import org.bukkit.entity.Player;
|
||||||
|
import org.bukkit.event.EventHandler;
|
||||||
|
import org.bukkit.event.HandlerList;
|
||||||
|
import org.bukkit.event.Listener;
|
||||||
|
import org.bukkit.event.player.PlayerQuitEvent;
|
||||||
import org.bukkit.metadata.FixedMetadataValue;
|
import org.bukkit.metadata.FixedMetadataValue;
|
||||||
import org.incendo.cloud.Command;
|
import org.incendo.cloud.Command;
|
||||||
import org.incendo.cloud.CommandManager;
|
import org.incendo.cloud.CommandManager;
|
||||||
@@ -40,7 +44,7 @@ import org.incendo.cloud.CommandManager;
|
|||||||
import java.util.*;
|
import java.util.*;
|
||||||
import java.util.concurrent.TimeUnit;
|
import java.util.concurrent.TimeUnit;
|
||||||
|
|
||||||
public class DebugInsightCommand extends BukkitCommandFeature<CommandSender> {
|
public class DebugInsightCommand extends BukkitCommandFeature<CommandSender> implements Listener {
|
||||||
|
|
||||||
public DebugInsightCommand(CustomCropsCommandManager<CommandSender> commandManager) {
|
public DebugInsightCommand(CustomCropsCommandManager<CommandSender> commandManager) {
|
||||||
super(commandManager);
|
super(commandManager);
|
||||||
@@ -71,6 +75,22 @@ public class DebugInsightCommand extends BukkitCommandFeature<CommandSender> {
|
|||||||
return "debug_insight";
|
return "debug_insight";
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void unregisterRelatedFunctions() {
|
||||||
|
HandlerList.unregisterAll(this);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void registerRelatedFunctions() {
|
||||||
|
Bukkit.getPluginManager().registerEvents(this, BukkitCustomCropsPlugin.getInstance().getBoostrap());
|
||||||
|
}
|
||||||
|
|
||||||
|
@EventHandler
|
||||||
|
public void onQuit(PlayerQuitEvent event) {
|
||||||
|
Player player = event.getPlayer();
|
||||||
|
player.removeMetadata("customcrops:insight", BukkitCustomCropsPlugin.getInstance().getBoostrap());
|
||||||
|
}
|
||||||
|
|
||||||
public static class InsightPlayer implements Runnable {
|
public static class InsightPlayer implements Runnable {
|
||||||
|
|
||||||
private final SchedulerTask task;
|
private final SchedulerTask task;
|
||||||
|
|||||||
@@ -41,7 +41,7 @@ worlds:
|
|||||||
# 300s means that a crop would be certainly ticked once in 300s
|
# 300s means that a crop would be certainly ticked once in 300s
|
||||||
# For crops, under the same conditions, the growth rate of crops is basically the same
|
# For crops, under the same conditions, the growth rate of crops is basically the same
|
||||||
# For sprinklers and pots, they would work periodically.
|
# For sprinklers and pots, they would work periodically.
|
||||||
min-tick-unit: 300
|
min-tick-unit: 180
|
||||||
# Offline tick settings
|
# Offline tick settings
|
||||||
# This option allows crops to grow even if the world is unloaded or the server is closed
|
# This option allows crops to grow even if the world is unloaded or the server is closed
|
||||||
# This may lead to some issues caused by timeliness conditions for instance seasons
|
# This may lead to some issues caused by timeliness conditions for instance seasons
|
||||||
|
|||||||
Reference in New Issue
Block a user