Skip to content

Commit

Permalink
refactor: remove 2 last local captures
Browse files Browse the repository at this point in the history
  • Loading branch information
IThundxr committed Sep 29, 2024
1 parent 42aaaa9 commit 33c5fd1
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -49,12 +49,10 @@ public abstract class MapRendererMapInstanceMixin {
target = "Ljava/util/Iterator;hasNext()Z",
shift = At.Shift.BY,
by = 3
),
locals = LocalCapture.CAPTURE_FAILHARD
)
)
private void port_Lib$getCurrentIndex(PoseStack poseStack, MultiBufferSource bufferSource, boolean active,
int packedLight, CallbackInfo ci, int i, int j, float f, Matrix4f matrix4f,
VertexConsumer vertexConsumer, int k, Iterator<?> var11) {
int packedLight, CallbackInfo ci, @Local(ordinal = 3) int k) {
this.port_Lib$cached_index.set(k);
}

Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
package io.github.fabricators_of_create.porting_lib.extensions.mixin.client;

import com.llamalad7.mixinextras.sugar.Local;

import net.minecraft.client.multiplayer.ClientLevel;
import net.minecraft.client.renderer.LightTexture;

Expand All @@ -9,12 +11,14 @@
import org.spongepowered.asm.mixin.injection.At;
import org.spongepowered.asm.mixin.injection.Inject;
import org.spongepowered.asm.mixin.injection.callback.CallbackInfo;
import org.spongepowered.asm.mixin.injection.callback.LocalCapture;

@Mixin(LightTexture.class)
public class LightTextureMixin {
@Inject(method = "updateLightTexture", at = @At(value = "JUMP", opcode = Opcodes.IFLE, ordinal = 3), locals = LocalCapture.CAPTURE_FAILHARD)
private void adjustLightmap(float partialTicks, CallbackInfo ci, ClientLevel clientlevel, float f, float h, float e, float a, float k, float m, float l, Vector3f vector3f, float f7, Vector3f vector3f1, int i, int j, float f8) {
clientlevel.effects().adjustLightmapColors(clientlevel, partialTicks, f, f7, f8, j, i, vector3f1);
@Inject(method = "updateLightTexture", at = @At(value = "JUMP", opcode = Opcodes.IFLE, ordinal = 3))
private void adjustLightmap(float partialTicks, CallbackInfo ci, @Local ClientLevel clientlevel,
@Local(ordinal = 1) float skyDarken, @Local(ordinal = 9) float skyLight,
@Local(ordinal = 10) float blockLight, @Local(ordinal = 0) int pixelX,
@Local(ordinal = 1) int pixelY, @Local(ordinal = 1) Vector3f colors) {
clientlevel.effects().adjustLightmapColors(clientlevel, partialTicks, skyDarken, skyLight, blockLight, pixelX, pixelY, colors);
}
}

0 comments on commit 33c5fd1

Please sign in to comment.