Skip to content

Commit 15f836b

Browse files
committed
improvement: Improved casing ejection for up- and down-facing manual autocannon
1 parent 2e3cf5d commit 15f836b

2 files changed

Lines changed: 7 additions & 1 deletion

File tree

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66

77
Changed:
88
- Improved Cannon Mount syncing
9+
- Improved casing ejection for up- and down-facing manual autocannon
910
- [1.20.1] Create Big Cannons will not load with the latest release of CBC: Advanced Technologies until an issue on their end is fixed.
1011
- CBC: Advanced Technologies breaks Big Cartridges and prevents them from firing. Other issues may also be present.
1112
- [1.21.1] Updated Chinese (Simplified) (zh_cn.json) localization courtesy of pingguomc

src/main/java/rbasamoyai/createbigcannons/cannon_control/contraption/MountedAutocannonContraption.java

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -260,7 +260,12 @@ public void fireShot(ServerLevel level, PitchOrientedContraptionEntity entity) {
260260
if (!(foundProjectile.getItem() instanceof AutocannonAmmoItem round)) return;
261261
ControlPitchContraption controller = entity.getController();
262262

263-
Vec3 ejectPos = entity.toGlobalVector(Vec3.atCenterOf(this.startPos.relative(this.isHandle ? Direction.DOWN : this.initialOrientation.getOpposite())), 0);
263+
Direction handleEjectDirection = switch (this.initialOrientation) {
264+
case DOWN -> Direction.SOUTH;
265+
case UP -> Direction.NORTH;
266+
default -> Direction.DOWN;
267+
};
268+
Vec3 ejectPos = entity.toGlobalVector(Vec3.atCenterOf(this.startPos.relative(this.isHandle ? handleEjectDirection : this.initialOrientation.getOpposite())), 0);
264269
Vec3 centerPos = entity.toGlobalVector(Vec3.atCenterOf(BlockPos.ZERO), 0);
265270
ItemStack ejectStack = round.getSpentItem(foundProjectile);
266271
if (!ejectStack.isEmpty()) {

0 commit comments

Comments
 (0)