Skip to content

Commit

Permalink
[StAPI] Fix Vanilla Items in Buildcraft pipes but break ML items as r…
Browse files Browse the repository at this point in the history
…evenge
  • Loading branch information
thecatcore committed Nov 3, 2023
1 parent 1a007d7 commit 3b8de9e
Showing 1 changed file with 6 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
import org.spongepowered.asm.mixin.injection.At;
import org.spongepowered.asm.mixin.injection.Redirect;

@Mixin(RenderPipe.class)
@Mixin(value = RenderPipe.class, remap = false)
public class RenderPipeMixin {
@Redirect(method = "doRenderItem", remap = false,
at = @At(value = "INVOKE", remap = false,
Expand Down Expand Up @@ -72,11 +72,11 @@ private void fixBindItemTexture2(String s, @Local(ordinal = 0)ItemStack stack, @

@WrapOperation(method = "doRenderItem", remap = false,
at = @At(value = "INVOKE", target = "Lnet/minecraft/client/render/Tessellator;vertex(DDDDD)V",
ordinal = 0))
ordinal = 0, remap = true))
private void fixItemTexture0(Tessellator instance, double x, double y, double z, double u, double v,
Operation<Void> operation, @Share("sprite") LocalRef<Sprite> ref) {
Sprite sprite = ref.get();
operation.call(instance, x, y, z, sprite.getMinU(), sprite.getMaxV());
operation.call(instance, x, y, z, (double)sprite.getMinU(), (double)sprite.getMaxV());
}

@WrapOperation(method = "doRenderItem", remap = false,
Expand All @@ -85,7 +85,7 @@ private void fixItemTexture0(Tessellator instance, double x, double y, double z,
private void fixItemTexture1(Tessellator instance, double x, double y, double z, double u, double v,
Operation<Void> operation, @Share("sprite")LocalRef<Sprite> ref) {
Sprite sprite = ref.get();
operation.call(instance, x, y, z, sprite.getMaxU(), sprite.getMaxV());
operation.call(instance, x, y, z, (double)sprite.getMaxU(), (double)sprite.getMaxV());
}

@WrapOperation(method = "doRenderItem", remap = false,
Expand All @@ -94,7 +94,7 @@ private void fixItemTexture1(Tessellator instance, double x, double y, double z,
private void fixItemTexture2(Tessellator instance, double x, double y, double z, double u, double v,
Operation<Void> operation, @Share("sprite")LocalRef<Sprite> ref) {
Sprite sprite = ref.get();
operation.call(instance, x, y, z, sprite.getMaxU(), sprite.getMinV());
operation.call(instance, x, y, z, (double)sprite.getMaxU(), (double)sprite.getMinV());
}

@WrapOperation(method = "doRenderItem", remap = false,
Expand All @@ -103,6 +103,6 @@ private void fixItemTexture2(Tessellator instance, double x, double y, double z,
private void fixItemTexture3(Tessellator instance, double x, double y, double z, double u, double v,
Operation<Void> operation, @Share("sprite")LocalRef<Sprite> ref) {
Sprite sprite = ref.get();
operation.call(instance, x, y, z, sprite.getMinU(), sprite.getMinV());
operation.call(instance, x, y, z, (double)sprite.getMinU(), (double)sprite.getMinV());
}
}

0 comments on commit 3b8de9e

Please sign in to comment.