Skip to content
This repository has been archived by the owner on Jan 25, 2024. It is now read-only.

Commit

Permalink
cleanup param names in mixins 2
Browse files Browse the repository at this point in the history
  • Loading branch information
mist475 committed Nov 2, 2023
1 parent f36474f commit 7ed7695
Show file tree
Hide file tree
Showing 26 changed files with 113 additions and 116 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -89,9 +89,9 @@ private int modifyRenderWorld3(RenderGlobal instance, EntityLivingBase entityliv
@Inject(
method = "renderWorld(FJ)V",
at = @At(value = "INVOKE", target = "Lorg/lwjgl/opengl/GL11;glDepthMask(Z)V", ordinal = 3, remap = false))
private void modifyRenderWorld4(float p_78471_1_, long p_78471_2_, CallbackInfo ci) {
this.mc.renderGlobal.sortAndRender(this.mc.renderViewEntity, 5, p_78471_1_);
this.renderRainSnow(p_78471_1_);
private void modifyRenderWorld4(float partialTickTime, long p_78471_2_, CallbackInfo ci) {
this.mc.renderGlobal.sortAndRender(this.mc.renderViewEntity, 5, partialTickTime);
this.renderRainSnow(partialTickTime);
}

@Inject(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,9 +24,9 @@ public abstract class MixinItemRenderer {
at = @At(
value = "INVOKE",
target = "Lnet/minecraft/entity/EntityLivingBase;getItemIcon(Lnet/minecraft/item/ItemStack;I)Lnet/minecraft/util/IIcon;"))
private IIcon modifyRenderItem1(EntityLivingBase instance, ItemStack item, int p_70620_2_, EntityLivingBase entity,
ItemStack item2, int p_78443_3_) {
return CITUtils.getIcon(entity.getItemIcon(item2, p_78443_3_), item2, p_78443_3_);
private IIcon modifyRenderItem1(EntityLivingBase instance, ItemStack item, int renderPass, EntityLivingBase entity,
ItemStack item2, int renderPass1) {
return CITUtils.getIcon(entity.getItemIcon(item2, renderPass1), item2, renderPass1);
}

@Inject(
Expand All @@ -35,17 +35,17 @@ private IIcon modifyRenderItem1(EntityLivingBase instance, ItemStack item, int p
value = "INVOKE",
target = "Lnet/minecraft/client/renderer/ItemRenderer;renderItemIn2D(Lnet/minecraft/client/renderer/Tessellator;FFFFIIF)V",
ordinal = 0))
private void modifyRenderItem2(EntityLivingBase p_78443_1_, ItemStack p_78443_2_, int p_78443_3_,
private void modifyRenderItem2(EntityLivingBase entity, ItemStack itemStack, int renderPass,
IItemRenderer.ItemRenderType type, CallbackInfo ci) {
ColorizeBlock.colorizeWaterBlockGL(Block.getBlockFromItem(p_78443_2_.getItem()));
ColorizeBlock.colorizeWaterBlockGL(Block.getBlockFromItem(itemStack.getItem()));
}

@Redirect(
method = "renderItem(Lnet/minecraft/entity/EntityLivingBase;Lnet/minecraft/item/ItemStack;ILnet/minecraftforge/client/IItemRenderer$ItemRenderType;)V",
at = @At(value = "INVOKE", target = "Lnet/minecraft/item/ItemStack;hasEffect(I)Z"),
remap = false)
private boolean modifyRenderItem3(ItemStack item, int pass, EntityLivingBase p_78443_1_, ItemStack p_78443_2_,
int p_78443_3_) {
return !CITUtils.renderEnchantmentHeld(item, p_78443_3_) && item.hasEffect(pass);
private boolean modifyRenderItem3(ItemStack item, int pass, EntityLivingBase entity, ItemStack itemStack,
int renderPass) {
return !CITUtils.renderEnchantmentHeld(item, renderPass) && item.hasEffect(pass);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ private int modifyLoadRenderers(int input) {
method = "sortAndRender(Lnet/minecraft/entity/EntityLivingBase;ID)I",
at = @At(value = "HEAD"),
cancellable = true)
private void modifySortAndRender1(EntityLivingBase p_72719_1_, int map18To17, double p_72719_3_,
private void modifySortAndRender1(EntityLivingBase entity, int map18To17, double partialTickTime,
CallbackInfoReturnable<Integer> cir) {
if (!RenderPass.preRenderPass(RenderPassMap.map17To18(map18To17))) {
cir.setReturnValue(RenderPass.postRenderPass(0));
Expand All @@ -78,7 +78,7 @@ private int modifySortAndRender2(int map18To17) {
method = "sortAndRender(Lnet/minecraft/entity/EntityLivingBase;ID)I",
at = @At(value = "RETURN"),
cancellable = true)
private void modifySortAndRender3(EntityLivingBase p_72719_1_, int p_72719_2_, double p_72719_3_,
private void modifySortAndRender3(EntityLivingBase entity, int renderPass, double partialTickTime,
CallbackInfoReturnable<Integer> cir) {
cir.setReturnValue(RenderPass.postRenderPass(cir.getReturnValue()));
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ public abstract class MixinWorldRenderer {
private boolean isInitialized;

@Shadow
public abstract void setPosition(int p_78913_1_, int p_78913_2_, int p_78913_3_);
public abstract void setPosition(int x, int y, int z);

@Inject(method = "<init>(Lnet/minecraft/world/World;Ljava/util/List;IIII)V", at = @At("RETURN"))
private void modifyWorldRendererConstructor1(World world, List<TileEntity> tileEntities, int x, int y, int z,
Expand Down Expand Up @@ -85,8 +85,8 @@ private void finishRenderPassUpdateRenderer(EntityLivingBase entityLivingBase, C
method = "updateRenderer(Lnet/minecraft/entity/EntityLivingBase;)V",
at = @At(value = "JUMP", ordinal = 4, shift = At.Shift.AFTER),
locals = LocalCapture.CAPTURE_FAILHARD)
private void injectRenderPassStartUpdateRenderer(EntityLivingBase p_147892_1_, CallbackInfo ci, int i, int j, int k,
int l, int i1, int j1, HashSet hashset, Minecraft minecraft, EntityLivingBase entity, int l1, int i2, int j2,
private void injectRenderPassStartUpdateRenderer(EntityLivingBase entity, CallbackInfo ci, int i, int j, int k,
int l, int i1, int j1, HashSet hashset, Minecraft minecraft, EntityLivingBase entity1, int l1, int i2, int j2,
byte b0, ChunkCache chunkcache, RenderBlocks renderblocks, int k2) {
RenderPass.start(k2);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,8 @@
@Mixin(RenderBiped.class)
public abstract class MixinRenderBiped extends RenderLiving {

public MixinRenderBiped(ModelBase p_i1262_1_, float p_i1262_2_) {
super(p_i1262_1_, p_i1262_2_);
public MixinRenderBiped(ModelBase modelBase, float shadowSize) {
super(modelBase, shadowSize);
}

@Redirect(
Expand All @@ -25,9 +25,9 @@ public MixinRenderBiped(ModelBase p_i1262_1_, float p_i1262_2_) {
value = "INVOKE",
target = "Lnet/minecraft/client/renderer/entity/RenderBiped;bindTexture(Lnet/minecraft/util/ResourceLocation;)V"))
private void modifyShouldRenderPass(RenderBiped instance, ResourceLocation resourceLocation,
EntityLiving entityLiving, int p_77032_2_, float p_77032_3_) {
EntityLiving entityLiving, int slotId, float p_77032_3_) {
this.bindTexture(
CITUtils.getArmorTexture(resourceLocation, entityLiving, entityLiving.func_130225_q(3 - p_77032_2_)));
CITUtils.getArmorTexture(resourceLocation, entityLiving, entityLiving.func_130225_q(3 - slotId)));
}

@Redirect(
Expand All @@ -37,8 +37,8 @@ private void modifyShouldRenderPass(RenderBiped instance, ResourceLocation resou
target = "Lnet/minecraft/client/renderer/entity/RenderBiped;bindTexture(Lnet/minecraft/util/ResourceLocation;)V"))

private void modifyFunc_82408_c(RenderBiped instance, ResourceLocation resourceLocation, EntityLiving entityLiving,
int p_82408_2_, float p_82408_3_) {
int slotId, float p_82408_3_) {
this.bindTexture(
CITUtils.getArmorTexture(resourceLocation, entityLiving, entityLiving.func_130225_q(3 - p_82408_2_)));
CITUtils.getArmorTexture(resourceLocation, entityLiving, entityLiving.func_130225_q(3 - slotId)));
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -35,46 +35,46 @@ public abstract class MixinRenderEntityLiving extends Render {
protected ModelBase renderPassModel;

@Shadow
protected abstract float interpolateRotation(float p_77034_1_, float p_77034_2_, float p_77034_3_);
protected abstract float interpolateRotation(float angle1, float angle2, float p_77034_3_);

@Shadow
protected abstract void renderModel(EntityLivingBase p_77036_1_, float p_77036_2_, float p_77036_3_,
protected abstract void renderModel(EntityLivingBase entityLivingBase, float p_77036_2_, float p_77036_3_,
float p_77036_4_, float p_77036_5_, float p_77036_6_, float p_77036_7_);

@Shadow
protected abstract void renderLivingAt(EntityLivingBase p_77039_1_, double p_77039_2_, double p_77039_4_,
protected abstract void renderLivingAt(EntityLivingBase entityLivingBase, double p_77039_2_, double p_77039_4_,
double p_77039_6_);

@Shadow
protected abstract void rotateCorpse(EntityLivingBase p_77043_1_, float p_77043_2_, float p_77043_3_,
protected abstract void rotateCorpse(EntityLivingBase entityLivingBase, float p_77043_2_, float p_77043_3_,
float p_77043_4_);

@Shadow
protected abstract float renderSwingProgress(EntityLivingBase p_77040_1_, float p_77040_2_);
protected abstract float renderSwingProgress(EntityLivingBase entityLivingBase, float p_77040_2_);

@Shadow
protected abstract float handleRotationFloat(EntityLivingBase p_77044_1_, float p_77044_2_);
protected abstract float handleRotationFloat(EntityLivingBase entityLivingBase, float p_77044_2_);

@Shadow
protected abstract void renderEquippedItems(EntityLivingBase p_77029_1_, float p_77029_2_);
protected abstract void renderEquippedItems(EntityLivingBase entityLivingBase, float p_77029_2_);

@Shadow
protected abstract int inheritRenderPass(EntityLivingBase p_77035_1_, int p_77035_2_, float p_77035_3_);
protected abstract int inheritRenderPass(EntityLivingBase entityLivingBase, int p_77035_2_, float p_77035_3_);

@Shadow
protected abstract int shouldRenderPass(EntityLivingBase p_77032_1_, int p_77032_2_, float p_77032_3_);
protected abstract int shouldRenderPass(EntityLivingBase entityLivingBase, int p_77032_2_, float p_77032_3_);

@Shadow
protected abstract void func_82408_c(EntityLivingBase p_82408_1_, int p_82408_2_, float p_82408_3_);
protected abstract void func_82408_c(EntityLivingBase entityLivingBase, int p_82408_2_, float p_82408_3_);

@Shadow
protected abstract int getColorMultiplier(EntityLivingBase p_77030_1_, float p_77030_2_, float p_77030_3_);
protected abstract int getColorMultiplier(EntityLivingBase entityLivingBase, float p_77030_2_, float p_77030_3_);

@Shadow
protected abstract void preRenderCallback(EntityLivingBase p_77041_1_, float p_77041_2_);
protected abstract void preRenderCallback(EntityLivingBase entityLivingBase, float p_77041_2_);

@Shadow
protected abstract void passSpecialRender(EntityLivingBase p_77033_1_, double p_77033_2_, double p_77033_4_,
protected abstract void passSpecialRender(EntityLivingBase entityLivingBase, double p_77033_2_, double p_77033_4_,
double p_77033_6_);

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,13 +24,12 @@ public abstract class MixinRenderFish extends Render {
*/
@SuppressWarnings({ "DuplicatedCode", "ExtractMethodRecommender" })
@Overwrite
public void doRender(EntityFishHook p_76986_1_, double p_76986_2_, double p_76986_4_, double p_76986_6_,
float p_76986_8_, float p_76986_9_) {
public void doRender(EntityFishHook entity, double x, double y, double z, float p_76986_8_, float p_76986_9_) {
GL11.glPushMatrix();
GL11.glTranslatef((float) p_76986_2_, (float) p_76986_4_, (float) p_76986_6_);
GL11.glTranslatef((float) x, (float) y, (float) z);
GL11.glEnable(GL12.GL_RESCALE_NORMAL);
GL11.glScalef(0.5F, 0.5F, 0.5F);
this.bindEntityTexture(p_76986_1_);
this.bindEntityTexture(entity);
Tessellator tessellator = Tessellator.instance;
byte b0 = 1;
byte b1 = 2;
Expand All @@ -53,64 +52,62 @@ public void doRender(EntityFishHook p_76986_1_, double p_76986_2_, double p_7698
GL11.glDisable(GL12.GL_RESCALE_NORMAL);
GL11.glPopMatrix();

if (p_76986_1_.field_146042_b != null) {
float f9 = p_76986_1_.field_146042_b.getSwingProgress(p_76986_9_);
if (entity.field_146042_b != null) {
float f9 = entity.field_146042_b.getSwingProgress(p_76986_9_);
float f10 = MathHelper.sin(MathHelper.sqrt_float(f9) * (float) Math.PI);
Vec3 vec3 = Vec3.createVectorHelper(-0.5D, 0.03D, 0.8D);
vec3.rotateAroundX(
-(p_76986_1_.field_146042_b.prevRotationPitch
+ (p_76986_1_.field_146042_b.rotationPitch - p_76986_1_.field_146042_b.prevRotationPitch)
* p_76986_9_)
-(entity.field_146042_b.prevRotationPitch
+ (entity.field_146042_b.rotationPitch - entity.field_146042_b.prevRotationPitch) * p_76986_9_)
* (float) Math.PI
/ 180.0F);
vec3.rotateAroundY(
-(p_76986_1_.field_146042_b.prevRotationYaw
+ (p_76986_1_.field_146042_b.rotationYaw - p_76986_1_.field_146042_b.prevRotationYaw) * p_76986_9_)
-(entity.field_146042_b.prevRotationYaw
+ (entity.field_146042_b.rotationYaw - entity.field_146042_b.prevRotationYaw) * p_76986_9_)
* (float) Math.PI
/ 180.0F);
vec3.rotateAroundY(f10 * 0.5F);
vec3.rotateAroundX(-f10 * 0.7F);
double d3 = p_76986_1_.field_146042_b.prevPosX
+ (p_76986_1_.field_146042_b.posX - p_76986_1_.field_146042_b.prevPosX) * (double) p_76986_9_
double d3 = entity.field_146042_b.prevPosX
+ (entity.field_146042_b.posX - entity.field_146042_b.prevPosX) * (double) p_76986_9_
+ vec3.xCoord;
double d4 = p_76986_1_.field_146042_b.prevPosY
+ (p_76986_1_.field_146042_b.posY - p_76986_1_.field_146042_b.prevPosY) * (double) p_76986_9_
double d4 = entity.field_146042_b.prevPosY
+ (entity.field_146042_b.posY - entity.field_146042_b.prevPosY) * (double) p_76986_9_
+ vec3.yCoord;
double d5 = p_76986_1_.field_146042_b.prevPosZ
+ (p_76986_1_.field_146042_b.posZ - p_76986_1_.field_146042_b.prevPosZ) * (double) p_76986_9_
double d5 = entity.field_146042_b.prevPosZ
+ (entity.field_146042_b.posZ - entity.field_146042_b.prevPosZ) * (double) p_76986_9_
+ vec3.zCoord;
double d6 = p_76986_1_.field_146042_b == Minecraft.getMinecraft().thePlayer ? 0.0D
: (double) p_76986_1_.field_146042_b.getEyeHeight();
double d6 = entity.field_146042_b == Minecraft.getMinecraft().thePlayer ? 0.0D
: (double) entity.field_146042_b.getEyeHeight();

if (this.renderManager.options.thirdPersonView > 0
|| p_76986_1_.field_146042_b != Minecraft.getMinecraft().thePlayer) {
float f11 = (p_76986_1_.field_146042_b.prevRenderYawOffset
+ (p_76986_1_.field_146042_b.renderYawOffset - p_76986_1_.field_146042_b.prevRenderYawOffset)
* p_76986_9_)
|| entity.field_146042_b != Minecraft.getMinecraft().thePlayer) {
float f11 = (entity.field_146042_b.prevRenderYawOffset
+ (entity.field_146042_b.renderYawOffset - entity.field_146042_b.prevRenderYawOffset) * p_76986_9_)
* (float) Math.PI
/ 180.0F;
double d7 = MathHelper.sin(f11);
double d9 = MathHelper.cos(f11);
d3 = p_76986_1_.field_146042_b.prevPosX
+ (p_76986_1_.field_146042_b.posX - p_76986_1_.field_146042_b.prevPosX) * (double) p_76986_9_
d3 = entity.field_146042_b.prevPosX
+ (entity.field_146042_b.posX - entity.field_146042_b.prevPosX) * (double) p_76986_9_
- d9 * 0.35D
- d7 * 0.85D;
d4 = p_76986_1_.field_146042_b.prevPosY + d6
+ (p_76986_1_.field_146042_b.posY - p_76986_1_.field_146042_b.prevPosY) * (double) p_76986_9_
d4 = entity.field_146042_b.prevPosY + d6
+ (entity.field_146042_b.posY - entity.field_146042_b.prevPosY) * (double) p_76986_9_
- 0.45D;
d5 = p_76986_1_.field_146042_b.prevPosZ
+ (p_76986_1_.field_146042_b.posZ - p_76986_1_.field_146042_b.prevPosZ) * (double) p_76986_9_
d5 = entity.field_146042_b.prevPosZ
+ (entity.field_146042_b.posZ - entity.field_146042_b.prevPosZ) * (double) p_76986_9_
- d7 * 0.35D
+ d9 * 0.85D;
}

double d14 = p_76986_1_.prevPosX + (p_76986_1_.posX - p_76986_1_.prevPosX) * (double) p_76986_9_;
double d8 = p_76986_1_.prevPosY + (p_76986_1_.posY - p_76986_1_.prevPosY) * (double) p_76986_9_ + 0.25D;
double d10 = p_76986_1_.prevPosZ + (p_76986_1_.posZ - p_76986_1_.prevPosZ) * (double) p_76986_9_;
double d14 = entity.prevPosX + (entity.posX - entity.prevPosX) * (double) p_76986_9_;
double d8 = entity.prevPosY + (entity.posY - entity.prevPosY) * (double) p_76986_9_ + 0.25D;
double d10 = entity.prevPosZ + (entity.posZ - entity.prevPosZ) * (double) p_76986_9_;
double d11 = (float) (d3 - d14);
double d12 = (float) (d4 - d8);
double d13 = (float) (d5 - d10);
if (!LineRenderer.renderLine(0, p_76986_2_, p_76986_4_, p_76986_6_, d11, d12, d13)) {
if (!LineRenderer.renderLine(0, x, y, z, d11, d12, d13)) {
GL11.glDisable(GL11.GL_TEXTURE_2D);
GL11.glDisable(GL11.GL_LIGHTING);
tessellator.startDrawing(3);
Expand All @@ -120,9 +117,9 @@ public void doRender(EntityFishHook p_76986_1_, double p_76986_2_, double p_7698
for (int i = 0; i <= b2; ++i) {
float f12 = (float) i / (float) b2;
tessellator.addVertex(
p_76986_2_ + d11 * (double) f12,
p_76986_4_ + d12 * (double) (f12 * f12 + f12) * 0.5D + 0.25D,
p_76986_6_ + d13 * (double) f12);
x + d11 * (double) f12,
y + d12 * (double) (f12 * f12 + f12) * 0.5D + 0.25D,
z + d13 * (double) f12);
}

tessellator.draw();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,8 @@
@Mixin(RenderLiving.class)
public abstract class MixinRenderLiving extends RendererLivingEntity {

public MixinRenderLiving(ModelBase p_i1261_1_, float p_i1261_2_) {
super(p_i1261_1_, p_i1261_2_);
public MixinRenderLiving(ModelBase modelBase, float shadowSize) {
super(modelBase, shadowSize);
}

@Shadow
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,12 +20,12 @@
@Mixin(RenderMooshroom.class)
public abstract class MixinRenderMooshroom extends RenderLiving {

public MixinRenderMooshroom(ModelBase p_i1262_1_, float p_i1262_2_) {
super(p_i1262_1_, p_i1262_2_);
public MixinRenderMooshroom(ModelBase modelBase, float shadowSize) {
super(modelBase, shadowSize);
}

@Inject(method = "renderEquippedItems(Lnet/minecraft/entity/passive/EntityMooshroom;F)V", at = @At("RETURN"))
private void modifyRenderEquippedItems1(EntityMooshroom p_77029_1_, float p_77029_2_, CallbackInfo ci) {
private void modifyRenderEquippedItems1(EntityMooshroom entity, float p_77029_2_, CallbackInfo ci) {
MobOverlay.finishMooshroom();
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,8 @@
@Mixin(RenderPlayer.class)
public abstract class MixinRenderPlayer extends RendererLivingEntity {

public MixinRenderPlayer(ModelBase p_i1261_1_, float p_i1261_2_) {
super(p_i1261_1_, p_i1261_2_);
public MixinRenderPlayer(ModelBase modelBase, float shadowSize) {
super(modelBase, shadowSize);
}

@Redirect(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,8 @@
@Mixin(RenderSheep.class)
public abstract class MixinRenderSheep extends RenderLiving {

public MixinRenderSheep(ModelBase p_i1262_1_, float p_i1262_2_) {
super(p_i1262_1_, p_i1262_2_);
public MixinRenderSheep(ModelBase modelBase, float shadowSize) {
super(modelBase, shadowSize);
}

@Redirect(
Expand Down
Loading

0 comments on commit 7ed7695

Please sign in to comment.