From 5e555a518c93e2fc278b608512c60baaea51c7ac Mon Sep 17 00:00:00 2001 From: screret <68943070+screret@users.noreply.github.com> Date: Sat, 28 Sep 2024 14:36:07 +0300 Subject: [PATCH 1/2] fix rocket synchronization --- CHANGELOG.md | 1 + .../gcyr/common/data/GCYREntityDataSerializers.java | 3 +++ 2 files changed, 4 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 80b1be41..464ce0b9 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,6 +1,7 @@ ### ADDITIONS: ### FIXES: +- Fixed rocket synchronization ### CHANGES: - updated to GT 1.4.4 diff --git a/src/main/java/argent_matter/gcyr/common/data/GCYREntityDataSerializers.java b/src/main/java/argent_matter/gcyr/common/data/GCYREntityDataSerializers.java index e7d69a9b..3e119e8f 100644 --- a/src/main/java/argent_matter/gcyr/common/data/GCYREntityDataSerializers.java +++ b/src/main/java/argent_matter/gcyr/common/data/GCYREntityDataSerializers.java @@ -44,7 +44,10 @@ public void write(FriendlyByteBuf friendlyByteBuf, PosWithState posState) { EntityDataSerializers.BLOCK_POS.write(friendlyByteBuf, posState.pos()); EntityDataSerializers.BLOCK_STATE.write(friendlyByteBuf, posState.state()); if (posState.entityTag() != null) { + friendlyByteBuf.writeBoolean(true); EntityDataSerializers.COMPOUND_TAG.write(friendlyByteBuf, posState.entityTag()); + } else { + friendlyByteBuf.writeBoolean(false); } } From 5045b8fb97d336aaba27a6b5b159ec7bca294dbe Mon Sep 17 00:00:00 2001 From: screret <68943070+screret@users.noreply.github.com> Date: Sat, 28 Sep 2024 14:36:36 +0300 Subject: [PATCH 2/2] fix rocket building (again) --- CHANGELOG.md | 1 + gradle.properties | 2 +- .../machine/multiblock/RocketScannerMachine.java | 12 ++++++------ .../multiblock/SpaceStationPackagerMachine.java | 12 ++++++------ 4 files changed, 14 insertions(+), 13 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 464ce0b9..0290d91d 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,6 +2,7 @@ ### FIXES: - Fixed rocket synchronization +- Fixed rockets forming incorrectly again ### CHANGES: - updated to GT 1.4.4 diff --git a/gradle.properties b/gradle.properties index a10bda1d..0148a7e2 100644 --- a/gradle.properties +++ b/gradle.properties @@ -2,7 +2,7 @@ org.gradle.jvmargs=-Xmx4G -Xss4M mod_id=gcyr mod_name=Gregicality Rocketry -mod_version=0.2.3 +mod_version=0.2.4 maven_group=argent_matter loom.platform=forge diff --git a/src/main/java/argent_matter/gcyr/common/machine/multiblock/RocketScannerMachine.java b/src/main/java/argent_matter/gcyr/common/machine/multiblock/RocketScannerMachine.java index c248588a..216cdb83 100644 --- a/src/main/java/argent_matter/gcyr/common/machine/multiblock/RocketScannerMachine.java +++ b/src/main/java/argent_matter/gcyr/common/machine/multiblock/RocketScannerMachine.java @@ -115,15 +115,15 @@ public void setRocketBuilt(boolean rocketBuilt) { this.rocketBuilt = rocketBuilt && isFormed; if (getLevel().isClientSide || !this.isFormed) return; + boolean isNegative = this.getFrontFacing().getAxisDirection() == Direction.AxisDirection.NEGATIVE; Direction back = this.getFrontFacing().getOpposite(); - Direction left = this.getFrontFacing().getCounterClockWise(); BlockPos current = getPos().relative(back, 1); - int startX = current.getX(); - int endX = current.relative(back, bDist - 1).getX(); - int startZ = current.relative(left, lDist).getZ(); - int endZ = current.relative(left.getOpposite(), rDist).getZ(); + int startX = current.getX() + (isNegative ? -1 : 1); + int endX = current.getX() - (isNegative ? -(bDist - 1) : (bDist - 1)); + int startZ = current.getZ() - (isNegative ? -(lDist + 1) : (lDist + 1)); + int endZ = current.getZ() - (isNegative ? (rDist - 1) : -(rDist - 1)); int startY = current.getY(); - int endY = current.offset(0, hDist, 0).getY(); + int endY = current.getY() + hDist; AABB bounds = new AABB(startX, startY, startZ, endX, endY, endZ); startX = (int) bounds.minX; diff --git a/src/main/java/argent_matter/gcyr/common/machine/multiblock/SpaceStationPackagerMachine.java b/src/main/java/argent_matter/gcyr/common/machine/multiblock/SpaceStationPackagerMachine.java index 9bd1bafe..9375e828 100644 --- a/src/main/java/argent_matter/gcyr/common/machine/multiblock/SpaceStationPackagerMachine.java +++ b/src/main/java/argent_matter/gcyr/common/machine/multiblock/SpaceStationPackagerMachine.java @@ -93,15 +93,15 @@ private void onBuildButtonClick(ClickData data) { Planet targetPlanet = PlanetIdChipBehaviour.getPlanetFromStack(idChip); if (targetPlanet == null) return; + boolean isNegative = this.getFrontFacing().getAxisDirection() == Direction.AxisDirection.NEGATIVE; Direction back = this.getFrontFacing().getOpposite(); - Direction left = this.getFrontFacing().getCounterClockWise(); BlockPos current = getPos().relative(back, 1); - int startX = current.getX(); - int endX = current.relative(back, bDist - 1).getX(); - int startZ = current.relative(left, lDist).getZ(); - int endZ = current.relative(left.getOpposite(), rDist).getZ(); + int startX = current.getX() + (isNegative ? -1 : 1); + int endX = current.getX() + (isNegative ? (bDist - 1) : -(bDist - 1)); + int startZ = current.getZ() + (isNegative ? (lDist + 1) : -(lDist + 1)); + int endZ = current.getZ() - (isNegative ? (rDist - 1) : -(rDist - 1)); int startY = current.getY(); - int endY = current.offset(0, hDist, 0).getY(); + int endY = current.getY() + hDist; AABB bounds = new AABB(startX, startY, startZ, endX, endY, endZ); startX = (int) bounds.minX;