A less atrocious approach to fixing 95
This commit is contained in:
parent
7d863ebfed
commit
1801551d3b
@ -21,29 +21,23 @@ import com.google.common.base.MoreObjects;
|
|||||||
import net.minecraft.util.math.BlockPos;
|
import net.minecraft.util.math.BlockPos;
|
||||||
import net.minecraft.util.math.Vec3i;
|
import net.minecraft.util.math.Vec3i;
|
||||||
import org.spongepowered.asm.mixin.Mixin;
|
import org.spongepowered.asm.mixin.Mixin;
|
||||||
import org.spongepowered.asm.mixin.injection.At;
|
|
||||||
import org.spongepowered.asm.mixin.injection.Redirect;
|
import javax.annotation.Nonnull;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @author Brady
|
* @author Brady
|
||||||
* @since 8/25/2018
|
* @since 8/25/2018
|
||||||
*/
|
*/
|
||||||
@Mixin(Vec3i.class)
|
@Mixin(BlockPos.class)
|
||||||
public class MixinVec3i {
|
public abstract class MixinBlockPos extends Vec3i {
|
||||||
|
|
||||||
@Redirect(
|
public MixinBlockPos(int xIn, int yIn, int zIn) {
|
||||||
method = "toString",
|
super(xIn, yIn, zIn);
|
||||||
at = @At(
|
|
||||||
value = "INVOKE",
|
|
||||||
target = "com/google/common/base/MoreObjects.toStringHelper(Ljava/lang/Object;)Lcom/google/common/base/MoreObjects$ToStringHelper;"
|
|
||||||
)
|
|
||||||
)
|
|
||||||
private MoreObjects.ToStringHelper toStringHelper(Object object) {
|
|
||||||
|
|
||||||
if (object.getClass().equals(BlockPos.class)) {
|
|
||||||
return MoreObjects.toStringHelper("BlockPos");
|
|
||||||
}
|
}
|
||||||
|
|
||||||
return MoreObjects.toStringHelper(object);
|
@Override
|
||||||
|
@Nonnull
|
||||||
|
public String toString() {
|
||||||
|
return MoreObjects.toStringHelper("BlockPos").add("x", this.getX()).add("y", this.getY()).add("z", this.getZ()).toString();
|
||||||
}
|
}
|
||||||
}
|
}
|
@ -8,6 +8,7 @@
|
|||||||
"maxShiftBy": 2
|
"maxShiftBy": 2
|
||||||
},
|
},
|
||||||
"client": [
|
"client": [
|
||||||
|
"MixinBlockPos",
|
||||||
"MixinEntity",
|
"MixinEntity",
|
||||||
"MixinEntityPlayerSP",
|
"MixinEntityPlayerSP",
|
||||||
"MixinEntityRenderer",
|
"MixinEntityRenderer",
|
||||||
@ -19,7 +20,6 @@
|
|||||||
"MixinMinecraft",
|
"MixinMinecraft",
|
||||||
"MixinNetHandlerPlayClient",
|
"MixinNetHandlerPlayClient",
|
||||||
"MixinNetworkManager",
|
"MixinNetworkManager",
|
||||||
"MixinVec3i",
|
|
||||||
"MixinWorldClient",
|
"MixinWorldClient",
|
||||||
|
|
||||||
"accessor.IAnvilChunkLoader",
|
"accessor.IAnvilChunkLoader",
|
||||||
|
Loading…
Reference in New Issue
Block a user