mirror of
https://github.com/Xiao-MoMi/Custom-Crops.git
synced 2025-12-25 09:59:20 +00:00
3.0.6-hotfix2
This commit is contained in:
@@ -37,7 +37,7 @@ public class SprinklerConfig {
|
||||
private final WaterAmountHologram waterAmountHologram;
|
||||
private final SprinklerAnimation sprinklerAnimation;
|
||||
|
||||
public SprinklerConfig(String key, int storage, int range, @Nullable Sound sound, @NotNull ItemMode itemMode, @NotNull String threeD, @NotNull String twoD,
|
||||
public SprinklerConfig(String key, int storage, int range, @Nullable Sound sound, @NotNull ItemMode itemMode, @NotNull String threeD, @Nullable String twoD,
|
||||
@NotNull PassiveFillMethod[] passiveFillMethods, @Nullable WaterAmountHologram waterAmountHologram, SprinklerAnimation sprinklerAnimation) {
|
||||
this.key = key;
|
||||
this.storage = storage;
|
||||
@@ -78,7 +78,7 @@ public class SprinklerConfig {
|
||||
return threeD;
|
||||
}
|
||||
|
||||
@NotNull
|
||||
@Nullable
|
||||
public String getTwoD() {
|
||||
return twoD;
|
||||
}
|
||||
|
||||
@@ -83,8 +83,8 @@ public class SprinklerManager extends Function implements Listener {
|
||||
if (sprinklerSec == null) continue;
|
||||
String twoD = sprinklerSec.getString("2D-item");
|
||||
String threeD = sprinklerSec.getString("3D-item");
|
||||
if (twoD == null || threeD == null) {
|
||||
AdventureUtils.consoleMessage("<red>[CustomCrops] 2/3D-item is not set for sprinkler: " + key);
|
||||
if (threeD == null) {
|
||||
AdventureUtils.consoleMessage("<red>[CustomCrops] 3D-item is not set for sprinkler: " + key);
|
||||
continue;
|
||||
}
|
||||
PassiveFillMethod[] methods = ConfigUtils.getPassiveFillMethods(sprinklerSec.getConfigurationSection("fill-method"));
|
||||
@@ -129,7 +129,7 @@ public class SprinklerManager extends Function implements Listener {
|
||||
) : null
|
||||
);
|
||||
this.itemToKey.put(threeD, key);
|
||||
this.itemToKey.put(twoD, key);
|
||||
if (twoD != null) this.itemToKey.put(twoD, key);
|
||||
this.sprinklerConfigMap.put(key, sprinklerConfig);
|
||||
}
|
||||
}
|
||||
@@ -161,6 +161,7 @@ public class SprinklerManager extends Function implements Listener {
|
||||
String key = itemToKey.get(id);
|
||||
if (key == null) return;
|
||||
String twoD = sprinklerConfigMap.get(key).getTwoD();
|
||||
if (twoD == null) return;
|
||||
ItemStack itemStack = plugin.getPlatformInterface().getItemStack(twoD);
|
||||
if (itemStack == null) {
|
||||
AdventureUtils.consoleMessage("<red>[CustomCrops] 2D sprinkler " + twoD + " doesn't exist");
|
||||
|
||||
@@ -9,6 +9,7 @@ sprinkler_1:
|
||||
storage: 4
|
||||
# 2/3D物品
|
||||
3D-item: customcrops:sprinkler_1
|
||||
# Optional, remove this section if you don't need 2d items
|
||||
2D-item: customcrops:sprinkler_1_item
|
||||
# ITEM_FRAME / TRIPWIRE / ITEM_DISPLAY (1.19.4+)
|
||||
# Sprinkler item type
|
||||
|
||||
Reference in New Issue
Block a user