Skip to content

Commit

Permalink
fix: array gates not auto-rotating on cross-placement
Browse files Browse the repository at this point in the history
  • Loading branch information
MrTJP committed Apr 8, 2024
1 parent a3abc56 commit 76b6353
Showing 1 changed file with 1 addition and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -258,9 +258,8 @@ public boolean preparePlacement(MultipartPlaceContext context) {
if (!super.preparePlacement(context)) return false;

if (canCross() && context.getPlayer() != null) {
BlockPos onPos = context.getClickedPos().relative(context.getClickedFace().getOpposite());
// Note: tile() is not available yet, must access from player.level
MultiPart tpart = BlockMultipart.getPart(context.getPlayer().getLevel(), onPos, getSide()^1);
MultiPart tpart = BlockMultipart.getPart(context.getPlayer().getLevel(), context.getClickedPos(), getSide()^1);
if (tpart instanceof ArrayGatePart part) {
if (part.getGateType() == getGateType() && (part.getRotation() & 1) == (getRotation() & 1)) {
setRotation((getRotation() + 1) % 4);
Expand Down

0 comments on commit 76b6353

Please sign in to comment.