@@ -42,7 +42,7 @@ public abstract class MoveItemsTaskMixin extends MultiTickTask<PathAwareEntity>
|
||||
@Inject(method = "findStorage", at = @At("HEAD"), cancellable = true)
|
||||
private void findStorage(ServerWorld world, PathAwareEntity entity,
|
||||
CallbackInfoReturnable<Optional<MoveItemsTask.Storage>> callbackInfo) {
|
||||
Copperfarmers.LOGGER.info("Wrapped findStorage called");
|
||||
Copperfarmers.LOGGER.debug("Wrapped findStorage called");
|
||||
|
||||
Box box = ((MoveItemsTaskAccessor) this).copperfarmers$getSearchBoundingBox(entity);
|
||||
if (!entity.getEquippedStack(EquipmentSlot.MAINHAND).isOf(Items.WHEAT_SEEDS)) {
|
||||
@@ -55,7 +55,7 @@ public abstract class MoveItemsTaskMixin extends MultiTickTask<PathAwareEntity>
|
||||
var blockState = world.getBlockState(pos);
|
||||
// if block is farmland
|
||||
if(blockState.isOf(Blocks.FARMLAND) && world.isAir(pos.up())) {
|
||||
Copperfarmers.LOGGER.info("Found farmland at " + pos);
|
||||
Copperfarmers.LOGGER.debug("Found farmland at " + pos);
|
||||
callbackInfo.setReturnValue(Optional.of(new MoveItemsTask.Storage(pos, null, null, blockState)));
|
||||
return;
|
||||
}
|
||||
@@ -66,7 +66,7 @@ public abstract class MoveItemsTaskMixin extends MultiTickTask<PathAwareEntity>
|
||||
|
||||
@Inject(method = "testContainer", at = @At("HEAD"), cancellable = true)
|
||||
private void testContainer(PathAwareEntity entity, BlockState state, CallbackInfoReturnable<Boolean> callbackInfo) {
|
||||
Copperfarmers.LOGGER.info("Wrapped testContainer called");
|
||||
Copperfarmers.LOGGER.debug("Wrapped testContainer called");
|
||||
if(state.isOf(Blocks.FARMLAND)) {
|
||||
callbackInfo.setReturnValue(true);
|
||||
}
|
||||
@@ -74,16 +74,16 @@ public abstract class MoveItemsTaskMixin extends MultiTickTask<PathAwareEntity>
|
||||
|
||||
@Inject(method = "tickInteracting", at = @At("HEAD"), cancellable = true)
|
||||
private void tickInteracting(MoveItemsTask.Storage storage, World world, PathAwareEntity entity, CallbackInfo callbackInfo) {
|
||||
Copperfarmers.LOGGER.info("Wrapped tickInteracting called");
|
||||
Copperfarmers.LOGGER.debug("Wrapped tickInteracting called");
|
||||
MoveItemsTaskAccessor thisAccessor = (MoveItemsTaskAccessor)this;
|
||||
if (!thisAccessor.copperfarmers$isWithinRange(2.0, storage, world, entity, thisAccessor.copperfarmers$atCenterY(entity))) {
|
||||
thisAccessor.copperfarmers$transitionToTravelling(entity);
|
||||
} else {
|
||||
thisAccessor.copperfarmers$setInteractionTicks(thisAccessor.copperfarmers$getInteractionTicks() + 1);
|
||||
thisAccessor.copperfarmers$setLookTarget(storage, entity);
|
||||
Copperfarmers.LOGGER.info("Interaction ticks: " + thisAccessor.copperfarmers$getInteractionTicks());
|
||||
Copperfarmers.LOGGER.debug("Interaction ticks: " + thisAccessor.copperfarmers$getInteractionTicks());
|
||||
if (thisAccessor.copperfarmers$getInteractionTicks() >= 60) {
|
||||
Copperfarmers.LOGGER.info("Interacting with storage at " + storage.pos());
|
||||
Copperfarmers.LOGGER.debug("Interacting with storage at " + storage.pos());
|
||||
this.selectInteractionState2(
|
||||
entity,
|
||||
storage,
|
||||
@@ -100,7 +100,7 @@ public abstract class MoveItemsTaskMixin extends MultiTickTask<PathAwareEntity>
|
||||
|
||||
@Inject(method = "transitionToInteracting", at = @At("HEAD"), cancellable = true)
|
||||
private void transitionToInteracting(MoveItemsTask.Storage storage, PathAwareEntity entity, CallbackInfo callbackInfo) {
|
||||
Copperfarmers.LOGGER.info("Wrapped transitionToInteracting called");
|
||||
Copperfarmers.LOGGER.debug("Wrapped transitionToInteracting called");
|
||||
this.selectInteractionState2(
|
||||
entity,
|
||||
storage,
|
||||
@@ -115,14 +115,14 @@ public abstract class MoveItemsTaskMixin extends MultiTickTask<PathAwareEntity>
|
||||
|
||||
@Inject(method = "isUnchanged", at = @At("HEAD"), cancellable = true)
|
||||
private void isUnchanged(World world, MoveItemsTask.Storage storage, CallbackInfoReturnable<Boolean> callbackInfo) {
|
||||
Copperfarmers.LOGGER.info("Wrapped isUnchanged called");
|
||||
Copperfarmers.LOGGER.debug("Wrapped isUnchanged called");
|
||||
if(storage.state().isOf(Blocks.FARMLAND)) {
|
||||
callbackInfo.setReturnValue(true);
|
||||
}
|
||||
}
|
||||
|
||||
private void placeStack2(PathAwareEntity entity, MoveItemsTask.Storage storage) {
|
||||
Copperfarmers.LOGGER.info("Wrapped placeStack called");
|
||||
Copperfarmers.LOGGER.debug("Wrapped placeStack called");
|
||||
MoveItemsTaskAccessor thisAccessor = (MoveItemsTaskAccessor)this;
|
||||
BlockPos pos = storage.pos();
|
||||
ServerWorld world = (ServerWorld) entity.getEntityWorld();
|
||||
@@ -135,7 +135,7 @@ public abstract class MoveItemsTaskMixin extends MultiTickTask<PathAwareEntity>
|
||||
} else {
|
||||
thisAccessor.copperfarmers$invalidateTargetStorage(entity);
|
||||
}
|
||||
Copperfarmers.LOGGER.info("Placed wheat seeds at " + pos.up());
|
||||
Copperfarmers.LOGGER.debug("Placed wheat seeds at " + pos.up());
|
||||
return;
|
||||
}
|
||||
ItemStack itemStack = MoveItemsTaskAccessor.copperfarmers$insertStack(entity, storage.inventory());
|
||||
@@ -164,7 +164,7 @@ public abstract class MoveItemsTaskMixin extends MultiTickTask<PathAwareEntity>
|
||||
BiConsumer<PathAwareEntity, MoveItemsTask.Storage> placeItemCallback,
|
||||
BiConsumer<PathAwareEntity, MoveItemsTask.Storage> placeNoItemCallback)
|
||||
{
|
||||
Copperfarmers.LOGGER.info("Wrapped selectInteractionState called");
|
||||
Copperfarmers.LOGGER.debug("Wrapped selectInteractionState called");
|
||||
if (storage == null && entity.getEquippedStack(EquipmentSlot.MAINHAND).isOf(Items.WHEAT_SEEDS)) {
|
||||
placeItemCallback.accept(entity, storage);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user