mirror of
https://github.com/Creators-of-Create/Create.git
synced 2024-11-13 05:54:17 +01:00
Added return after schematic activation to prevent double interaction
This commit is contained in:
parent
a92c08b1e1
commit
1d2da07756
@ -73,6 +73,7 @@ public class DeployerMovementBehaviour implements MovementBehaviour {
|
|||||||
return;
|
return;
|
||||||
|
|
||||||
activate(context, pos, player, mode);
|
activate(context, pos, player, mode);
|
||||||
|
checkForPlacementAdvancement();
|
||||||
tryDisposeOfExcess(context);
|
tryDisposeOfExcess(context);
|
||||||
context.stall = player.blockBreakingProgress != null;
|
context.stall = player.blockBreakingProgress != null;
|
||||||
}
|
}
|
||||||
@ -81,8 +82,10 @@ public class DeployerMovementBehaviour implements MovementBehaviour {
|
|||||||
Level world = context.world;
|
Level world = context.world;
|
||||||
|
|
||||||
FilterItemStack filter = context.getFilterFromBE();
|
FilterItemStack filter = context.getFilterFromBE();
|
||||||
if (AllItems.SCHEMATIC.isIn(filter.item()))
|
if (AllItems.SCHEMATIC.isIn(filter.item())) {
|
||||||
activateAsSchematicPrinter(context, pos, player, world, filter.item());
|
activateAsSchematicPrinter(context, pos, player, world, filter.item());
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
Vec3 facingVec = Vec3.atLowerCornerOf(context.state.getValue(DeployerBlock.FACING)
|
Vec3 facingVec = Vec3.atLowerCornerOf(context.state.getValue(DeployerBlock.FACING)
|
||||||
.getNormal());
|
.getNormal());
|
||||||
@ -104,7 +107,9 @@ public class DeployerMovementBehaviour implements MovementBehaviour {
|
|||||||
player.placedTracks = false;
|
player.placedTracks = false;
|
||||||
|
|
||||||
DeployerHandler.activate(player, vec, pos, facingVec, mode);
|
DeployerHandler.activate(player, vec, pos, facingVec, mode);
|
||||||
|
}
|
||||||
|
|
||||||
|
protected void checkForPlacementAdvancement() {
|
||||||
if ((context.contraption instanceof MountedContraption || context.contraption instanceof CarriageContraption)
|
if ((context.contraption instanceof MountedContraption || context.contraption instanceof CarriageContraption)
|
||||||
&& player.placedTracks && context.blockEntityData != null && context.blockEntityData.contains("Owner"))
|
&& player.placedTracks && context.blockEntityData != null && context.blockEntityData.contains("Owner"))
|
||||||
AllAdvancements.SELF_DEPLOYING.awardTo(world.getPlayerByUUID(context.blockEntityData.getUUID("Owner")));
|
AllAdvancements.SELF_DEPLOYING.awardTo(world.getPlayerByUUID(context.blockEntityData.getUUID("Owner")));
|
||||||
|
Loading…
Reference in New Issue
Block a user