Skip to content

Commit f53f65d

Browse files
committed
Update create compat patch. Closes #337
1 parent 9a257d6 commit f53f65d

File tree

1 file changed

+12
-10
lines changed
  • src/main/java/eu/ha3/presencefootsteps/mixins/compat/create

1 file changed

+12
-10
lines changed

src/main/java/eu/ha3/presencefootsteps/mixins/compat/create/MEntity.java

+12-10
Original file line numberDiff line numberDiff line change
@@ -14,25 +14,27 @@
1414
@Mixin(value = Entity.class, priority = 9999 /* Run us last */)
1515
abstract class MEntity implements ContraptionCollidable {
1616

17-
private int lastCollidedContraptionStateTick = -1;
18-
private BlockState lastCollidedContraptionState = Blocks.AIR.getDefaultState();
17+
private int presenceFootsteps$lastCollidedContraptionStateTick = -1;
18+
private BlockState presenceFootsteps$lastCollidedContraptionState = Blocks.AIR.getDefaultState();
1919

2020
@Dynamic(
21-
value = "forCollission(center, consumer) - Private member injected by Create. See: https://github.com/Fabricators-of-Create/Create/blob/49cc17e3de33c965b1c409130abe436821f7410c/src/main/java/com/simibubi/create/foundation/mixin/client/EntityContraptionInteractionMixin.java#L81C21-L81C21"
21+
value = "create$forCollision(center, consumer) - Private member injected by Create. See: https://github.com/Fabricators-of-Create/Create/blob/49cc17e3de33c965b1c409130abe436821f7410c/src/main/java/com/simibubi/create/foundation/mixin/client/EntityContraptionInteractionMixin.java#L81C21-L81C21"
2222
)
23-
@Shadow
24-
private void forCollision(Vec3d anchorPos, TriConsumer<Object, BlockState, BlockPos> action) {}
23+
@Shadow(aliases = {
24+
"forCollision", "create$forCollision"
25+
})
26+
private void create$forCollision(Vec3d anchorPos, TriConsumer<Object, BlockState, BlockPos> action) {}
2527

2628
@Override
2729
public BlockState getCollidedStateAt(BlockPos pos) {
28-
if (lastCollidedContraptionStateTick != ((Entity)(Object)this).age) {
29-
lastCollidedContraptionStateTick = ((Entity)(Object)this).age;
30-
forCollision(((Entity)(Object)this).getPos().add(0, -0.2, 0), (unused, state, p) -> {
30+
if (presenceFootsteps$lastCollidedContraptionStateTick != ((Entity)(Object)this).age) {
31+
presenceFootsteps$lastCollidedContraptionStateTick = ((Entity)(Object)this).age;
32+
create$forCollision(((Entity)(Object)this).getPos().add(0, -0.2, 0), (unused, state, p) -> {
3133
if (pos.equals(p)) {
32-
lastCollidedContraptionState = state;
34+
presenceFootsteps$lastCollidedContraptionState = state;
3335
}
3436
});
3537
}
36-
return lastCollidedContraptionState;
38+
return presenceFootsteps$lastCollidedContraptionState;
3739
}
3840
}

0 commit comments

Comments
 (0)