Skip to content

Commit ef8669c

Browse files
committed
feat: always keep texture of colored fishing particles texture bright
fix: deployable rendering
1 parent 3503ffe commit ef8669c

File tree

5 files changed

+35
-6
lines changed

5 files changed

+35
-6
lines changed

src/main/java/com/fix3dll/skyblockaddons/listeners/RenderListener.java

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2446,7 +2446,7 @@ private void drawCompactDeployableStatus(GuiGraphics graphics, float scale, Butt
24462446
}
24472447

24482448
if (entity instanceof ArmorStand armorStand) {
2449-
drawDeployableArmorStand(graphics, armorStand, x, y, DEPLOYABLE_GUI_SIZE, DEPLOYABLE_GUI_SIZE, scale);
2449+
drawDeployableArmorStand(graphics, armorStand, x, y, scale);
24502450
} else {
24512451
graphics.blit(RenderPipelines.GUI_TEXTURED, deployable.getResourceLocation(), (int) x, (int) y, 0, 0, DEPLOYABLE_GUI_SIZE, DEPLOYABLE_GUI_SIZE, DEPLOYABLE_GUI_SIZE, DEPLOYABLE_GUI_SIZE);
24522452
}
@@ -2576,7 +2576,7 @@ private void drawDetailedDeployableStatus(GuiGraphics graphics, float scale, But
25762576
}
25772577

25782578
if (entity instanceof ArmorStand armorStand) {
2579-
drawDeployableArmorStand(graphics, armorStand, x, y, DEPLOYABLE_GUI_SIZE, height - DEPLOYABLE_GUI_SIZE, scale);
2579+
drawDeployableArmorStand(graphics, armorStand, x, y, scale);
25802580
} else {
25812581
graphics.blit(RenderPipelines.GUI_TEXTURED, deployable.getResourceLocation(), (int) x, (int) y, 0, 0, DEPLOYABLE_GUI_SIZE, DEPLOYABLE_GUI_SIZE, DEPLOYABLE_GUI_SIZE, DEPLOYABLE_GUI_SIZE);
25822582
}
@@ -2655,7 +2655,7 @@ public void onRenderWorld(MultiBufferSource.BufferSource source, PoseStack poseS
26552655
HealingCircleManager.renderHealingCircleOverlays(source, poseStack);
26562656
}
26572657

2658-
private void drawDeployableArmorStand(GuiGraphics graphics, ArmorStand deployableArmorStand, float x, float y, float width, float height, float scale) {
2658+
private void drawDeployableArmorStand(GuiGraphics graphics, ArmorStand deployableArmorStand, float x, float y, float scale) {
26592659
Vector3f translation = new Vector3f(0.0F, 1.5F + 0.0625F * deployableArmorStand.getScale(), 0.0F);
26602660
Quaternionf rotation = Axis.ZP.rotationDegrees(180.0F);
26612661
Quaternionf rotation4 = Axis.XP.rotationDegrees(-22.0F);
@@ -2672,9 +2672,8 @@ private void drawDeployableArmorStand(GuiGraphics graphics, ArmorStand deployabl
26722672

26732673
x *= scale;
26742674
y *= scale;
2675-
width *= scale;
2676-
height *= scale;
2677-
InventoryScreen.renderEntityInInventory(graphics, Math.round(x), Math.round(y), Math.round(x + width), Math.round(y + height), 25.0F / deployableArmorStand.getScale() * scale, translation, rotation, null, deployableArmorStand);
2675+
float scaledWH = DEPLOYABLE_GUI_SIZE * scale;
2676+
InventoryScreen.renderEntityInInventory(graphics, Math.round(x), Math.round(y), Math.round(x + scaledWH), Math.round(y + scaledWH), 25.0F / deployableArmorStand.getScale() * scale, translation, rotation, null, deployableArmorStand);
26782677

26792678
// rollback after rendering
26802679
deployableArmorStand.yBodyRot = prevRenderYawOffset;

src/main/java/com/fix3dll/skyblockaddons/mixin/extensions/WakeParticleExtension.java

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,4 +4,6 @@ public interface WakeParticleExtension {
44

55
void sba$setBlankSprite(boolean shouldBlank);
66

7+
boolean sba$isBlankSprite();
8+
79
}
Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
package com.fix3dll.skyblockaddons.mixin.transformers;
2+
3+
import com.fix3dll.skyblockaddons.mixin.extensions.WakeParticleExtension;
4+
import net.minecraft.client.particle.Particle;
5+
import net.minecraft.client.renderer.LightTexture;
6+
import org.spongepowered.asm.mixin.Mixin;
7+
import org.spongepowered.asm.mixin.injection.At;
8+
import org.spongepowered.asm.mixin.injection.Inject;
9+
import org.spongepowered.asm.mixin.injection.callback.CallbackInfoReturnable;
10+
11+
@Mixin(Particle.class)
12+
public class ParticleMixin {
13+
14+
@Inject(method = "getLightColor", at = @At("HEAD"), cancellable = true)
15+
public void sba$getLightColor(float partialTick, CallbackInfoReturnable<Integer> cir) {
16+
Particle particle = (Particle)(Object)this;
17+
if (particle instanceof WakeParticleExtension wpe && wpe.sba$isBlankSprite()) {
18+
cir.setReturnValue(LightTexture.FULL_BRIGHT);
19+
}
20+
}
21+
22+
}

src/main/java/com/fix3dll/skyblockaddons/mixin/transformers/WakeParticleMixin.java

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,11 @@ public class WakeParticleMixin implements WakeParticleExtension {
2020
this.sba$blankSprite = shouldBlank;
2121
}
2222

23+
@Override
24+
public boolean sba$isBlankSprite() {
25+
return this.sba$blankSprite;
26+
}
27+
2328
@ModifyArg(method = "tick", at = @At(value = "INVOKE", target = "Lnet/minecraft/client/particle/WakeParticle;setSprite(Lnet/minecraft/client/renderer/texture/TextureAtlasSprite;)V"))
2429
public TextureAtlasSprite sba$tick_setSprite(TextureAtlasSprite original, @Local int i) {
2530
if (!sba$blankSprite) return original;

src/main/resources/skyblockaddons.mixins.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,7 @@
3636
"MouseHandlerMixin",
3737
"MultiPlayerGameModeMixin",
3838
"ParticleEngineMixin",
39+
"ParticleMixin",
3940
"RecipeBookComponentMixin",
4041
"RenderSystemMixin",
4142
"ScreenMixin",

0 commit comments

Comments
 (0)