fix sentry disguise block not being placed
@@ -50,17 +50,17 @@ public class SentryItem extends Item {
return InteractionResult.FAIL;
}
+ if (replacesTargetedBlock)
+ level.removeBlock(pos, false);
+
Sentry entity = SCContent.SENTRY_ENTITY.get().create(level);
- entity.setupSentry(player);
entity.setPos(pos.getX() + 0.5F, pos.getY(), pos.getZ() + 0.5F);
+ entity.setupSentry(player);
if (stack.hasCustomHoverName())
entity.setCustomName(stack.getHoverName());
- if (replacesTargetedBlock)
- level.removeBlock(pos, false);
-
level.addFreshEntity(entity);
entity.gameEvent(GameEvent.ENTITY_PLACE, player);
player.displayClientMessage(Utils.localize(SentryMode.CAMOUFLAGE_HP.getModeKey()).append(Utils.localize(SentryMode.CAMOUFLAGE_HP.getDescriptionKey())), true);
