Skip to content

Commit fafb00b

Browse files
committed
improvement: Improved casing ejection for up- and down-facing manual autocannon
1 parent d287eda commit fafb00b

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
@@ -267,7 +267,12 @@ public void fireShot(ServerLevel level, PitchOrientedContraptionEntity entity) {
267267
if (!(foundProjectile.getItem() instanceof AutocannonAmmoItem round)) return;
268268
ControlPitchContraption controller = entity.getController();
269269

270-
Vec3 ejectPos = entity.toGlobalVector(Vec3.atCenterOf(this.startPos.relative(this.isHandle ? Direction.DOWN : this.initialOrientation.getOpposite())), 0);
270+
Direction handleEjectDirection = switch (this.initialOrientation) {
271+
case DOWN -> Direction.SOUTH;
272+
case UP -> Direction.NORTH;
273+
default -> Direction.DOWN;
274+
};
275+
Vec3 ejectPos = entity.toGlobalVector(Vec3.atCenterOf(this.startPos.relative(this.isHandle ? handleEjectDirection : this.initialOrientation.getOpposite())), 0);
271276
Vec3 centerPos = entity.toGlobalVector(Vec3.atCenterOf(BlockPos.ZERO), 0);
272277
ItemStack ejectStack = round.getSpentItem(foundProjectile);
273278
if (!ejectStack.isEmpty()) {

0 commit comments

Comments
 (0)