From afca03de0bf32d537b114a473362fe2970524ea6 Mon Sep 17 00:00:00 2001 From: Talrey Date: Thu, 19 Aug 2021 21:13:07 -0700 Subject: [PATCH] deployers work on the move now --- .../deployer/DeployerMovingInteraction.java | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/src/main/java/com/simibubi/create/content/contraptions/components/deployer/DeployerMovingInteraction.java b/src/main/java/com/simibubi/create/content/contraptions/components/deployer/DeployerMovingInteraction.java index 41e97c6db..1fceefddb 100644 --- a/src/main/java/com/simibubi/create/content/contraptions/components/deployer/DeployerMovingInteraction.java +++ b/src/main/java/com/simibubi/create/content/contraptions/components/deployer/DeployerMovingInteraction.java @@ -1,6 +1,7 @@ package com.simibubi.create.content.contraptions.components.deployer; import com.simibubi.create.AllItems; +import com.simibubi.create.Create; import com.simibubi.create.content.contraptions.components.structureMovement.AbstractContraptionEntity; import com.simibubi.create.content.contraptions.components.structureMovement.MovementContext; import com.simibubi.create.content.contraptions.components.structureMovement.MovingInteractionBehaviour; @@ -9,6 +10,7 @@ import com.simibubi.create.foundation.utility.NBTHelper; import net.minecraft.entity.player.PlayerEntity; import net.minecraft.item.ItemStack; +import net.minecraft.nbt.CompoundNBT; import net.minecraft.util.Hand; import net.minecraft.util.math.BlockPos; import net.minecraft.world.gen.feature.template.Template.BlockInfo; @@ -43,13 +45,10 @@ public class DeployerMovingInteraction extends MovingInteractionBehaviour { ); // Create.LOGGER.info("Changed mode"); } else { - // this part isn't quite working yet due to being unable to get the fake player from ctx.temporaryData + if (ctx.world.isClientSide) return true; // we'll try again on the server side DeployerFakePlayer fake = null; - if ( !(ctx.temporaryData instanceof DeployerFakePlayer)) { - if (ctx.world instanceof ServerWorld) { - ctx.temporaryData = new DeployerFakePlayer((ServerWorld) ctx.world); - } - else return false; + if ( !(ctx.temporaryData instanceof DeployerFakePlayer) && ctx.world instanceof ServerWorld) { + ctx.temporaryData = new DeployerFakePlayer((ServerWorld) ctx.world); } else { fake = (DeployerFakePlayer)ctx.temporaryData; }