优化火炮指示器进度条

This commit is contained in:
Atsuishio 2025-07-09 21:23:07 +08:00 committed by Light_Quanta
parent b936f29e97
commit da9d55a249
No known key found for this signature in database
GPG key ID: 11A39A1B8C890959

View file

@ -59,6 +59,11 @@ public class SpyglassRangeOverlay implements LayeredDraw.Layer {
var screenWidth = guiGraphics.guiWidth();
var screenHeight = guiGraphics.guiHeight();
if (ClientEventHandler.holdArtilleryIndicator > 0) {
RenderHelper.fill(guiGraphics, RenderType.guiOverlay(), (float) screenWidth / 2 - 20, (float) (screenHeight / 2 + 44), (float) screenWidth / 2 + 20, (float) screenHeight / 2 + 48, -90, -16777216);
RenderHelper.fill(guiGraphics, RenderType.guiOverlay(), (float) screenWidth / 2 - 20, (float) (screenHeight / 2 + 44), (float) (screenWidth / 2 - 20 + 4 * ClientEventHandler.holdArtilleryIndicator), (float) screenHeight / 2 + 48, -90, -1);
}
if (((player.isUsingItem() && player.getUseItem().is(ModItems.ARTILLERY_INDICATOR.get())) || player.isScoping()) && mc.options.getCameraType() == CameraType.FIRST_PERSON) {
if (player.getUseItem().is(ModItems.ARTILLERY_INDICATOR.get())) {
ItemStack stack = player.getUseItem();
@ -115,9 +120,6 @@ public class SpyglassRangeOverlay implements LayeredDraw.Layer {
}
}
RenderHelper.fill(guiGraphics, RenderType.guiOverlay(), (float) screenWidth / 2 - 20, (float) (screenHeight / 2 + 44), (float) screenWidth / 2 + 20, (float) screenHeight / 2 + 48, -90, -16777216);
RenderHelper.fill(guiGraphics, RenderType.guiOverlay(), (float) screenWidth / 2 - 20, (float) (screenHeight / 2 + 44), (float) (screenWidth / 2 - 20 + 4 * ClientEventHandler.holdArtilleryIndicator), (float) screenHeight / 2 + 48, -90, -1);
poseStack.popPose();
}