-
Notifications
You must be signed in to change notification settings - Fork 62
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix wrong block placement distance check (#458)
- Loading branch information
1 parent
16ed4e0
commit 61a0245
Showing
3 changed files
with
33 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
23 changes: 23 additions & 0 deletions
23
...dgepodge/mixins/early/minecraft/MixinNetHandlePlayServer_FixWrongBlockPlacementCheck.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
package com.mitchej123.hodgepodge.mixins.early.minecraft; | ||
|
||
import net.minecraft.entity.player.EntityPlayerMP; | ||
import net.minecraft.network.NetHandlerPlayServer; | ||
|
||
import org.spongepowered.asm.mixin.Mixin; | ||
import org.spongepowered.asm.mixin.injection.At; | ||
|
||
import com.llamalad7.mixinextras.injector.wrapoperation.Operation; | ||
import com.llamalad7.mixinextras.injector.wrapoperation.WrapOperation; | ||
|
||
@Mixin(NetHandlerPlayServer.class) | ||
public class MixinNetHandlePlayServer_FixWrongBlockPlacementCheck { | ||
|
||
@WrapOperation( | ||
method = "processPlayerBlockPlacement", | ||
at = @At(value = "INVOKE", target = "Lnet/minecraft/entity/player/EntityPlayerMP;getDistanceSq(DDD)D")) | ||
private double hodgepodge$fixWrongBlockPlacementCheck(EntityPlayerMP entity, double x, double y, double z, | ||
Operation<Double> original) { | ||
y -= entity.getEyeHeight(); | ||
return original.call(entity, x, y, z); | ||
} | ||
} |