mirror of
https://github.com/Xiao-MoMi/Custom-Crops.git
synced 2025-12-25 18:09:28 +00:00
3.6.14
This commit is contained in:
@@ -223,6 +223,7 @@ public class BukkitCustomCropsPluginImpl extends BukkitCustomCropsPlugin {
|
||||
this.coolDownManager.reload();
|
||||
this.translationManager.reload();
|
||||
this.hologramManager.reload();
|
||||
this.itemManager.reload();
|
||||
|
||||
this.actionManagers.values().forEach(Reloadable::reload);
|
||||
this.requirementManagers.values().forEach(Reloadable::reload);
|
||||
|
||||
@@ -196,7 +196,7 @@ public class BukkitWorldAdaptor extends AbstractWorldAdaptor<World> {
|
||||
if (parentDir != null && !parentDir.exists()) {
|
||||
parentDir.mkdirs();
|
||||
}
|
||||
try (BufferedOutputStream bos = new BufferedOutputStream(new FileOutputStream(file))) {
|
||||
try (FileOutputStream fos = new FileOutputStream(file); BufferedOutputStream bos = new BufferedOutputStream(fos)) {
|
||||
bos.write(serializeRegion(region));
|
||||
long time2 = System.currentTimeMillis();
|
||||
BukkitCustomCropsPlugin.getInstance().debug(() -> "[" + world.worldName() + "] Took " + (time2-time1) + "ms to save region " + region.regionPos());
|
||||
|
||||
@@ -328,7 +328,9 @@ public class BukkitItemManager extends AbstractItemManager {
|
||||
if (itemStack == null || itemStack.getType() == Material.AIR) return "AIR";
|
||||
String id = provider.itemID(itemStack);
|
||||
if (id != null) return id;
|
||||
plugin.debug(() -> "Start checking ID from external plugins");
|
||||
for (ItemProvider p : itemDetectArray) {
|
||||
plugin.debug(p::identifier);
|
||||
id = p.itemID(itemStack);
|
||||
if (id != null) return p.identifier() + ":" + id;
|
||||
}
|
||||
@@ -458,6 +460,8 @@ public class BukkitItemManager extends AbstractItemManager {
|
||||
}
|
||||
|
||||
private void handleInteractEvent(String blockID, WrappedInteractEvent wrapped) {
|
||||
plugin.debug(() -> "Player [" + wrapped.player().getName() + "] interacted [" + blockID + "] with [" + wrapped.itemID() + "] at " + wrapped.location());
|
||||
|
||||
CustomCropsItem customCropsItem = Registries.ITEMS.get(wrapped.itemID());
|
||||
if (customCropsItem != null) {
|
||||
InteractionResult result = customCropsItem.interactAt(wrapped);
|
||||
|
||||
@@ -134,6 +134,12 @@ public class BukkitWorldManager implements WorldManager, Listener {
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void unload() {
|
||||
HandlerList.unregisterAll(this);
|
||||
this.worldSettings.clear();
|
||||
}
|
||||
|
||||
private void loadConfig() {
|
||||
YamlDocument config = BukkitConfigManager.getMainConfig();
|
||||
|
||||
@@ -170,12 +176,6 @@ public class BukkitWorldManager implements WorldManager, Listener {
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void unload() {
|
||||
HandlerList.unregisterAll(this);
|
||||
this.worldSettings.clear();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void disable() {
|
||||
this.unload();
|
||||
|
||||
Reference in New Issue
Block a user