mirror of
https://github.com/Xiao-MoMi/Custom-Crops.git
synced 2025-12-24 01:19:28 +00:00
Update AbstractRequirementManager.java
This commit is contained in:
@@ -1077,6 +1077,8 @@ public abstract class AbstractRequirementManager<T> implements RequirementManage
|
|||||||
if (state.isPresent() && state.get().type() instanceof PotBlock potBlock) {
|
if (state.isPresent() && state.get().type() instanceof PotBlock potBlock) {
|
||||||
int water = potBlock.water(state.get());
|
int water = potBlock.water(state.get());
|
||||||
if (water < value) return true;
|
if (water < value) return true;
|
||||||
|
} else {
|
||||||
|
return true;
|
||||||
}
|
}
|
||||||
if (advanced) ActionManager.trigger(context, actions);
|
if (advanced) ActionManager.trigger(context, actions);
|
||||||
return false;
|
return false;
|
||||||
@@ -1099,7 +1101,9 @@ public abstract class AbstractRequirementManager<T> implements RequirementManage
|
|||||||
Location location = requireNonNull(context.arg(ContextKeys.LOCATION)).clone().add(0, y, 0);
|
Location location = requireNonNull(context.arg(ContextKeys.LOCATION)).clone().add(0, y, 0);
|
||||||
Block block = location.getBlock();
|
Block block = location.getBlock();
|
||||||
if (block.getBlockData() instanceof Farmland farmland) {
|
if (block.getBlockData() instanceof Farmland farmland) {
|
||||||
return farmland.getMoisture() > value;
|
if (farmland.getMoisture() > value) {
|
||||||
|
return true;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
if (advanced) ActionManager.trigger(context, actions);
|
if (advanced) ActionManager.trigger(context, actions);
|
||||||
return false;
|
return false;
|
||||||
@@ -1122,7 +1126,11 @@ public abstract class AbstractRequirementManager<T> implements RequirementManage
|
|||||||
Location location = requireNonNull(context.arg(ContextKeys.LOCATION)).clone().add(0, y, 0);
|
Location location = requireNonNull(context.arg(ContextKeys.LOCATION)).clone().add(0, y, 0);
|
||||||
Block block = location.getBlock();
|
Block block = location.getBlock();
|
||||||
if (block.getBlockData() instanceof Farmland farmland) {
|
if (block.getBlockData() instanceof Farmland farmland) {
|
||||||
return farmland.getMoisture() < value;
|
if (farmland.getMoisture() < value) {
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
return true;
|
||||||
}
|
}
|
||||||
if (advanced) ActionManager.trigger(context, actions);
|
if (advanced) ActionManager.trigger(context, actions);
|
||||||
return false;
|
return false;
|
||||||
|
|||||||
Reference in New Issue
Block a user