mirror of
https://github.com/Sollace/Unicopia.git
synced 2025-02-17 10:24:23 +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.objectweb.asm.Opcodes;
|
||||||
import org.spongepowered.asm.mixin.Mixin;
|
import org.spongepowered.asm.mixin.Mixin;
|
||||||
import org.spongepowered.asm.mixin.gen.Accessor;
|
|
||||||
import org.spongepowered.asm.mixin.injection.*;
|
import org.spongepowered.asm.mixin.injection.*;
|
||||||
import com.minelittlepony.unicopia.entity.player.Pony;
|
import com.minelittlepony.unicopia.entity.player.Pony;
|
||||||
|
|
||||||
|
@ -13,10 +12,6 @@ import net.minecraft.server.network.*;
|
||||||
ServerPlayNetworkHandler.class
|
ServerPlayNetworkHandler.class
|
||||||
})
|
})
|
||||||
abstract class MixinReachDistanceFix {
|
abstract class MixinReachDistanceFix {
|
||||||
|
|
||||||
@Accessor
|
|
||||||
public abstract ServerPlayerEntity getPlayer();
|
|
||||||
|
|
||||||
@Redirect(
|
@Redirect(
|
||||||
method = {
|
method = {
|
||||||
"processBlockBreakingAction",
|
"processBlockBreakingAction",
|
||||||
|
@ -30,20 +25,9 @@ abstract class MixinReachDistanceFix {
|
||||||
)
|
)
|
||||||
)
|
)
|
||||||
private double getMaxBreakSquaredDistance() {
|
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;
|
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",
|
"MixinProjectileEntity",
|
||||||
"MixinReachDistanceFix",
|
"MixinReachDistanceFix",
|
||||||
"MixinServerPlayerEntity",
|
"MixinServerPlayerEntity",
|
||||||
|
"MixinServerPlayerInteractionManager",
|
||||||
"MixinServerPlayNetworkHandler",
|
"MixinServerPlayNetworkHandler",
|
||||||
"MixinServerWorld",
|
"MixinServerWorld",
|
||||||
"MixinSheepEntity",
|
"MixinSheepEntity",
|
||||||
|
|
Loading…
Reference in a new issue