8
8
9
9
import org .apache .commons .lang3 .mutable .MutableBoolean ;
10
10
import org .apache .logging .log4j .util .TriConsumer ;
11
- import org .objectweb .asm .Opcodes ;
12
11
import org .spongepowered .asm .mixin .Final ;
13
12
import org .spongepowered .asm .mixin .Mixin ;
14
13
import org .spongepowered .asm .mixin .Shadow ;
@@ -82,7 +81,7 @@ private EntityContraptionInteractionMixin(Class<Entity> baseClass) {
82
81
}
83
82
84
83
@ Unique
85
- private void forCollision (Vec3 worldPos , TriConsumer <Contraption , BlockState , BlockPos > action ) {
84
+ private void create$ forCollision (Vec3 worldPos , TriConsumer <Contraption , BlockState , BlockPos > action ) {
86
85
create$getIntersectingContraptions ().forEach (cEntity -> {
87
86
Vec3 localPos = ContraptionCollider .worldToLocalPos (worldPos , cEntity );
88
87
@@ -100,12 +99,12 @@ private void forCollision(Vec3 worldPos, TriConsumer<Contraption, BlockState, Bl
100
99
101
100
// involves block step sounds on contraptions
102
101
// IFNE line 661 injecting before `!blockstate.isAir(this.world, blockpos)`
103
- @ Inject (method = "move" , at = @ At (value = "JUMP " , opcode = Opcodes . IFNE , ordinal = 7 ))
102
+ @ Inject (method = "move" , at = @ At (value = "INVOKE " , target = "Lnet/minecraft/world/level/block/state/BlockState;isAir()Z" , ordinal = 0 ))
104
103
private void create$contraptionStepSounds (MoverType mover , Vec3 movement , CallbackInfo ci ) {
105
104
Vec3 worldPos = position .add (0 , -0.2 , 0 );
106
105
MutableBoolean stepped = new MutableBoolean (false );
107
106
108
- forCollision (worldPos , (contraption , state , pos ) -> {
107
+ create$ forCollision (worldPos , (contraption , state , pos ) -> {
109
108
playStepSound (pos , state );
110
109
stepped .setTrue ();
111
110
});
@@ -136,7 +135,7 @@ private void forCollision(Vec3 worldPos, TriConsumer<Contraption, BlockState, Bl
136
135
137
136
if (info == null )
138
137
return false ;
139
-
138
+
140
139
cEntity .registerColliding (self );
141
140
return true ;
142
141
});
@@ -155,7 +154,7 @@ private void forCollision(Vec3 worldPos, TriConsumer<Contraption, BlockState, Bl
155
154
Vec3 worldPos = position .add (0 , -0.2 , 0 );
156
155
BlockPos particlePos = new BlockPos (worldPos ); // pos where particles are spawned
157
156
158
- forCollision (worldPos , (contraption , state , pos ) -> {
157
+ create$ forCollision (worldPos , (contraption , state , pos ) -> {
159
158
if (!state .addRunningEffects (level , pos , self )
160
159
&& state .getRenderShape () != RenderShape .INVISIBLE ) {
161
160
Vec3 speed = self .getDeltaMovement ();
0 commit comments