Skip to content

Commit 9e3405f

Browse files
committed
bug: Fixed hostile mob targeting when player rides manual autocannon
1 parent 29d0c29 commit 9e3405f

2 files changed

Lines changed: 11 additions & 0 deletions

File tree

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@ Fixed:
2222
- Fixed #create:safe_nbt exploits
2323
- Fixed casting mould drops and Schematicannon requirements
2424
- Fixed drop mortar plume positioning
25+
- Fixed hostile mob targeting when player rides manual autocannon
2526
- Fixed player rendering on manual autocannons, including invisibility on Sable sublevels
2627
- [1.21.1] Fixed cannon cast crashing game with NullPointerException when multiple pipes connected to top
2728
- [1.21.1] Fixed projectiles fired along the z+ axis being visually distorted; was not fixed in v5.10.1

src/main/java/rbasamoyai/createbigcannons/mixin/EntityMixin.java

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,16 @@ public abstract class EntityMixin {
3737
return this.onAutocannon() ? this.self.getBbWidth() * 0.425f : original.call();
3838
}
3939

40+
@WrapMethod(method = "getEyeY")
41+
private double createbigcannons$getEyeY(Operation<Double> original) {
42+
return this.onAutocannon() ? this.self.getY() + this.self.getBbWidth() * 0.425d : original.call();
43+
}
44+
45+
@WrapMethod(method = "getY(D)D")
46+
private double createbigcannons$getY(double scale, Operation<Double> original) {
47+
return this.onAutocannon() ? this.self.getY() + this.self.getBbWidth() * (scale - 1) : original.call(scale);
48+
}
49+
4050
@WrapMethod(method = "getEyePosition(F)Lnet/minecraft/world/phys/Vec3;")
4151
private Vec3 createbigcannons$getEyePosition(float partialTicks, Operation<Vec3> original) {
4252
Vec3 o = original.call(partialTicks);

0 commit comments

Comments
 (0)