Skip to content

Commit

Permalink
continue
Browse files Browse the repository at this point in the history
  • Loading branch information
xiewuzhiying committed Jul 28, 2024
1 parent 33e5ca9 commit a2daf4e
Showing 1 changed file with 40 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -25,9 +25,9 @@ public abstract class MixinWireNodeRenderer {
ordinal = 0
)
)
private void man(Args args, @Local(ordinal = 0) IWireNode te, @Local(ordinal = 0) BlockPos other, @Local(ordinal = 0) Vec3 d1, @Local(ordinal = 1) Vec3 d2, @Share("tePos") LocalRef<Vec3> tePos, @Share("otherPos") LocalRef<Vec3> otherPos) {
tePos.set(VSGameUtilsKt.toWorldCoordinates(Minecraft.getInstance().level, te.getPos().getCenter().add(d1)));
otherPos.set(VSGameUtilsKt.toWorldCoordinates(Minecraft.getInstance().level, other.getCenter().add(d2)));
private void toWorldCoordinates1(Args args, @Local(ordinal = 0) IWireNode te, @Local(ordinal = 0) BlockPos other, @Local(ordinal = 0) Vec3 d1, @Local(ordinal = 1) Vec3 d2, @Share("tePos") LocalRef<Vec3> tePos, @Share("otherPos") LocalRef<Vec3> otherPos) {
tePos.set(VSGameUtilsKt.toWorldCoordinates(Minecraft.getInstance().level, TransformUtils.getCenterOf(te.getPos()).add(d1)));
otherPos.set(VSGameUtilsKt.toWorldCoordinates(Minecraft.getInstance().level, TransformUtils.getCenterOf(other).add(d2)));

final Vec3 diff = otherPos.get().subtract(TransformUtils.toVec3(te.getPos()));
args.set(0, (float)diff.x);
Expand All @@ -44,10 +44,45 @@ private void man(Args args, @Local(ordinal = 0) IWireNode te, @Local(ordinal = 0
),
remap = false
)
private void man2(Args args, @Share("tePos") LocalRef<Vec3> tePos, @Share("otherPos") LocalRef<Vec3> otherPos) {
final Vec3 diff = otherPos.get().subtract(tePos.get());
private void toWorldCoordinates2(Args args, @Share("tePos") LocalRef<Vec3> tePos, @Share("otherPos") LocalRef<Vec3> otherPos) {
final Vec3 diff = tePos.get().subtract(otherPos.get());
args.set(4, (float)diff.x);
args.set(5, (float)diff.y);
args.set(6, (float)diff.z);
args.set(8, tePos.get().distanceTo(otherPos.get()));
}

@ModifyArgs(
method = "render",
at = @At(
value = "INVOKE",
target = "Lcom/mojang/blaze3d/vertex/PoseStack;translate(FFF)V",
ordinal = 1
)
)
private void toWorldCoordinates3(Args args, @Local(ordinal = 0) IWireNode te, @Local(ordinal = 2) Vec3 d1, @Local(ordinal = 3) Vec3 playerPos, @Share("tePos2") LocalRef<Vec3> tePos2) {
tePos2.set(VSGameUtilsKt.toWorldCoordinates(Minecraft.getInstance().level, TransformUtils.getCenterOf(te.getPos())).add(d1));

final Vec3 diff = playerPos.subtract(TransformUtils.toVec3(te.getPos()));
args.set(0, diff.x);
args.set(1, diff.y);
args.set(2, diff.z);
}

@ModifyArgs(
method = "render",
at = @At(
value = "INVOKE",
target = "Lcom/mrh0/createaddition/rendering/WireNodeRenderer;wireRender(Lnet/minecraft/world/level/block/entity/BlockEntity;Lnet/minecraft/core/BlockPos;Lcom/mojang/blaze3d/vertex/PoseStack;Lnet/minecraft/client/renderer/MultiBufferSource;FFFLcom/mrh0/createaddition/energy/WireType;F)V",
ordinal = 1
),
remap = false
)
private void toWorldCoordinates5(Args args, @Local(ordinal = 3) Vec3 playerPos, @Share("tePos2") LocalRef<Vec3> tePos2) {
final Vec3 diff = tePos2.get().subtract(playerPos);
args.set(4, (float)diff.x);
args.set(5, (float)diff.y);
args.set(6, (float)diff.z);
args.set(8, tePos2.get().distanceTo(playerPos));
}
}

0 comments on commit a2daf4e

Please sign in to comment.