mirror of
https://github.com/Sollace/Unicopia.git
synced 2024-11-23 21:38:00 +01:00
Fix mixins
This commit is contained in:
parent
1653ece6a5
commit
234e44cbaf
3 changed files with 17 additions and 19 deletions
|
@ -2,7 +2,6 @@ package com.minelittlepony.unicopia.mixin;
|
|||
|
||||
import org.objectweb.asm.Opcodes;
|
||||
import org.spongepowered.asm.mixin.Mixin;
|
||||
import org.spongepowered.asm.mixin.gen.Accessor;
|
||||
import org.spongepowered.asm.mixin.injection.*;
|
||||
import com.minelittlepony.unicopia.entity.player.Pony;
|
||||
|
||||
|
@ -13,10 +12,6 @@ import net.minecraft.server.network.*;
|
|||
ServerPlayNetworkHandler.class
|
||||
})
|
||||
abstract class MixinReachDistanceFix {
|
||||
|
||||
@Accessor
|
||||
public abstract ServerPlayerEntity getPlayer();
|
||||
|
||||
@Redirect(
|
||||
method = {
|
||||
"processBlockBreakingAction",
|
||||
|
@ -30,20 +25,9 @@ abstract class MixinReachDistanceFix {
|
|||
)
|
||||
)
|
||||
private double getMaxBreakSquaredDistance() {
|
||||
double reach = 6 + Pony.of(getPlayer()).getExtendedReach();
|
||||
Object o = this;
|
||||
ServerPlayerEntity player = o instanceof ServerPlayNetworkHandler s ? s.getPlayer() : ((MixinServerPlayerInteractionManager)o).getPlayer();
|
||||
double reach = 6 + Pony.of(player).getExtendedReach();
|
||||
return reach * reach;
|
||||
}
|
||||
/*
|
||||
@ModifyConstant(
|
||||
method = {
|
||||
"processBlockBreakingAction",
|
||||
"onPlayerInteractBlock",
|
||||
"onPlayerInteractEntity"
|
||||
},
|
||||
constant = @Constant(doubleValue = 36D)
|
||||
)
|
||||
private double modifyMaxBreakSquaredDistance(double initial) {
|
||||
double reach = 6 + Pony.of(getPlayer()).getExtendedReach();
|
||||
return reach * reach;
|
||||
}*/
|
||||
}
|
||||
|
|
|
@ -0,0 +1,13 @@
|
|||
package com.minelittlepony.unicopia.mixin;
|
||||
|
||||
import org.spongepowered.asm.mixin.Mixin;
|
||||
import org.spongepowered.asm.mixin.gen.Accessor;
|
||||
|
||||
import net.minecraft.server.network.ServerPlayerEntity;
|
||||
import net.minecraft.server.network.ServerPlayerInteractionManager;
|
||||
|
||||
@Mixin(ServerPlayerInteractionManager.class)
|
||||
public interface MixinServerPlayerInteractionManager {
|
||||
@Accessor
|
||||
ServerPlayerEntity getPlayer();
|
||||
}
|
|
@ -25,6 +25,7 @@
|
|||
"MixinProjectileEntity",
|
||||
"MixinReachDistanceFix",
|
||||
"MixinServerPlayerEntity",
|
||||
"MixinServerPlayerInteractionManager",
|
||||
"MixinServerPlayNetworkHandler",
|
||||
"MixinServerWorld",
|
||||
"MixinSheepEntity",
|
||||
|
|
Loading…
Reference in a new issue