回滚火炮指示器显示效果(恼

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

View file

@ -59,9 +59,9 @@ public class SpyglassRangeOverlay implements LayeredDraw.Layer {
var screenWidth = guiGraphics.guiWidth();
var screenHeight = guiGraphics.guiHeight();
if ((player.getMainHandItem().is(ModItems.ARTILLERY_INDICATOR.get()) || player.isScoping()) && Minecraft.getInstance().options.getCameraType() == CameraType.FIRST_PERSON) {
if (player.getMainHandItem().is(ModItems.ARTILLERY_INDICATOR.get())) {
ItemStack stack = player.getMainHandItem();
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();
poseStack.pushPose();
RenderSystem.disableDepthTest();
RenderSystem.depthMask(false);
@ -79,9 +79,7 @@ public class SpyglassRangeOverlay implements LayeredDraw.Layer {
float k = ((screenWidth - i) / 2);
float l = ((screenHeight - j) / 2);
float w = i * 21 / 9;
if (player.isUsingItem()) {
preciseBlit(guiGraphics, Mod.loc("textures/screens/spyglass.png"), k - (2 * w / 7), l, 0, 0.0F, w, j, w, j);
}
preciseBlit(guiGraphics, Mod.loc("textures/screens/spyglass.png"), k - (2 * w / 7), l, 0, 0.0F, w, j, w, j);
// 标记位置
Vec3 pos;
@ -117,16 +115,12 @@ public class SpyglassRangeOverlay implements LayeredDraw.Layer {
}
}
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);
}
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();
}
// vehicle info display
boolean lookAtEntity = false;
BlockHitResult result = player.level().clip(new ClipContext(player.getEyePosition(), player.getEyePosition().add(player.getViewVector(1).scale(512)),