9
0
mirror of https://github.com/Xiao-MoMi/Custom-Crops.git synced 2025-12-25 09:59:20 +00:00

add comments

This commit is contained in:
XiaoMoMi
2024-09-04 01:42:37 +08:00
parent 31976acc2a
commit 32f01f1aec
55 changed files with 3048 additions and 310 deletions

View File

@@ -61,6 +61,7 @@ import java.io.InputStream;
import java.nio.file.Path;
import java.util.List;
import java.util.function.Consumer;
import java.util.function.Supplier;
public class BukkitCustomCropsPluginImpl extends BukkitCustomCropsPlugin {
@@ -91,6 +92,12 @@ public class BukkitCustomCropsPluginImpl extends BukkitCustomCropsPlugin {
this.debugger.accept(message);
}
@Override
public void debug(Supplier<Object> message) {
if (this.debugger != null)
this.debugger.accept(message.get());
}
@Override
public InputStream getResourceStream(String filePath) {
return getBoostrap().getResource(filePath);

View File

@@ -266,7 +266,8 @@ public class ConfigType {
.storage(section.getInt("storage", 4))
.infinite(section.getBoolean("infinite", false))
.twoDItem(section.getString("2D-item"))
.sprinklingAmount(section.getInt("water", 1))
.wateringAmount(section.getInt("water", 1))
.sprinklingAmount(section.getInt("sprinkling", 1))
.threeDItem(section.getString("3D-item"))
.threeDItemWithWater(section.getString("3D-item-with-water"))
.wateringMethods(manager.getWateringMethods(section.getSection("fill-method")))

View File

@@ -212,11 +212,6 @@ public class BukkitWorldAdaptor extends AbstractWorldAdaptor<World> {
return world.getName();
}
@Override
public long getWorldFullTime(World world) {
return world.getFullTime();
}
@Override
public int priority() {
return BUKKIT_WORLD_PRIORITY;

View File

@@ -169,6 +169,7 @@ public class BukkitItemManager extends AbstractItemManager {
}
}
@NotNull
@Override
public FurnitureRotation remove(@NotNull Location location, @NotNull ExistenceForm form) {
switch (form) {
@@ -216,6 +217,7 @@ public class BukkitItemManager extends AbstractItemManager {
}
}
@NotNull
@Override
public FurnitureRotation removeFurniture(@NotNull Location location) {
Collection<Entity> entities = location.getWorld().getNearbyEntities(LocationUtils.toSurfaceCenterLocation(location), 0.5,0.25,0.5);
@@ -229,7 +231,7 @@ public class BukkitItemManager extends AbstractItemManager {
}
}
}
return rotation;
return rotation == null ? FurnitureRotation.NONE : rotation;
}
@NotNull
@@ -329,7 +331,7 @@ public class BukkitItemManager extends AbstractItemManager {
}
@Override
public Item<ItemStack> wrap(ItemStack itemStack) {
public Item<ItemStack> wrap(@NotNull ItemStack itemStack) {
return factory.wrap(itemStack);
}

View File

@@ -43,7 +43,7 @@ import java.util.concurrent.ConcurrentHashMap;
public class BukkitWorldManager implements WorldManager, Listener {
private final BukkitCustomCropsPlugin plugin;
private final Set<WorldAdaptor<?>> adaptors = new TreeSet<>();
private final TreeSet<WorldAdaptor<?>> adaptors = new TreeSet<>();
private final ConcurrentHashMap<String, CustomCropsWorld<?>> worlds = new ConcurrentHashMap<>();
private final HashMap<String, WorldSetting> worldSettings = new HashMap<>();
private WorldSetting defaultWorldSetting;
@@ -290,7 +290,7 @@ public class BukkitWorldManager implements WorldManager, Listener {
}
@Override
public Set<WorldAdaptor<?>> adaptors() {
public TreeSet<WorldAdaptor<?>> adaptors() {
return adaptors;
}