Skip to content

Commit

Permalink
Fix MixinServerPlayNetworkHandler not applying when the synthetic fie…
Browse files Browse the repository at this point in the history
…lds have been renamed.

This happens when using mojmap in dev.
  • Loading branch information
modmuss50 committed Feb 28, 2021
1 parent 7268309 commit 0d6fdde
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 9 deletions.
2 changes: 1 addition & 1 deletion build.gradle
Expand Up @@ -19,7 +19,7 @@ plugins {
def ENV = System.getenv()

class Globals {
static def baseVersion = "0.31.1"
static def baseVersion = "0.31.2"
static def mcVersion = "21w08a"
static def yarnVersion = "+build.1"
static def loaderVersion = "0.10.5+build.213"
Expand Down
2 changes: 1 addition & 1 deletion fabric-events-interaction-v0/build.gradle
@@ -1,5 +1,5 @@
archivesBaseName = "fabric-events-interaction-v0"
version = getSubprojectVersion(project, "0.4.5")
version = getSubprojectVersion(project, "0.4.6")

moduleDependencies(project, [
'fabric-api-base'
Expand Down
Expand Up @@ -36,19 +36,19 @@

@Mixin(targets = "net/minecraft/server/network/ServerPlayNetworkHandler$1")
public abstract class MixinServerPlayNetworkHandler implements PlayerInteractEntityC2SPacket.class_5908 {
@Shadow(aliases = {"field_28963"})
public ServerPlayNetworkHandler serverPlayNetworkHandler;
@Shadow
public ServerPlayNetworkHandler field_28963;

@Shadow(aliases = {"field_28962"})
public Entity entity;
@Shadow
public Entity field_28962;

@Inject(method = "method_34220", at = @At(value = "HEAD"), cancellable = true)
public void onPlayerInteractEntity(Hand hand, Vec3d hitPosition, CallbackInfo info) {
PlayerEntity player = serverPlayNetworkHandler.player;
PlayerEntity player = field_28963.player;
World world = player.getEntityWorld();

EntityHitResult hitResult = new EntityHitResult(entity, hitPosition.add(entity.getX(), entity.getY(), entity.getZ()));
ActionResult result = UseEntityCallback.EVENT.invoker().interact(player, world, hand, entity, hitResult);
EntityHitResult hitResult = new EntityHitResult(field_28962, hitPosition.add(field_28962.getX(), field_28962.getY(), field_28962.getZ()));
ActionResult result = UseEntityCallback.EVENT.invoker().interact(player, world, hand, field_28962, hitResult);

if (result != ActionResult.PASS) {
info.cancel();
Expand Down

0 comments on commit 0d6fdde

Please sign in to comment.