Fixing golems trying to plant on already planted farmland
build / build (push) Successful in 4m57s

This commit is contained in:
Dynamitos
2025-10-26 10:34:26 +01:00
parent d574cf8d38
commit ba6bd0be35
@@ -116,9 +116,13 @@ public abstract class MoveItemsTaskMixin extends MultiTickTask<PathAwareEntity>
@Inject(method = "isUnchanged", at = @At("HEAD"), cancellable = true) @Inject(method = "isUnchanged", at = @At("HEAD"), cancellable = true)
private void isUnchanged(World world, MoveItemsTask.Storage storage, CallbackInfoReturnable<Boolean> callbackInfo) { private void isUnchanged(World world, MoveItemsTask.Storage storage, CallbackInfoReturnable<Boolean> callbackInfo) {
Copperfarmers.LOGGER.debug("Wrapped isUnchanged called"); Copperfarmers.LOGGER.debug("Wrapped isUnchanged called");
if(storage.state().isOf(Blocks.FARMLAND)) { if(storage.state().isOf(Blocks.FARMLAND) && world.isAir(storage.pos().up())) {
callbackInfo.setReturnValue(true); callbackInfo.setReturnValue(true);
} }
if(storage.inventory() == null) {
Copperfarmers.LOGGER.debug("No inventory at " + storage.pos());
callbackInfo.setReturnValue(false);
}
} }
private void placeStack2(PathAwareEntity entity, MoveItemsTask.Storage storage) { private void placeStack2(PathAwareEntity entity, MoveItemsTask.Storage storage) {