回滚火炮指示器显示效果(恼
This commit is contained in:
parent
44bb4340ba
commit
b936f29e97
1 changed files with 6 additions and 12 deletions
|
@ -59,9 +59,9 @@ public class SpyglassRangeOverlay implements LayeredDraw.Layer {
|
||||||
var screenWidth = guiGraphics.guiWidth();
|
var screenWidth = guiGraphics.guiWidth();
|
||||||
var screenHeight = guiGraphics.guiHeight();
|
var screenHeight = guiGraphics.guiHeight();
|
||||||
|
|
||||||
if ((player.getMainHandItem().is(ModItems.ARTILLERY_INDICATOR.get()) || player.isScoping()) && Minecraft.getInstance().options.getCameraType() == CameraType.FIRST_PERSON) {
|
if (((player.isUsingItem() && player.getUseItem().is(ModItems.ARTILLERY_INDICATOR.get())) || player.isScoping()) && mc.options.getCameraType() == CameraType.FIRST_PERSON) {
|
||||||
if (player.getMainHandItem().is(ModItems.ARTILLERY_INDICATOR.get())) {
|
if (player.getUseItem().is(ModItems.ARTILLERY_INDICATOR.get())) {
|
||||||
ItemStack stack = player.getMainHandItem();
|
ItemStack stack = player.getUseItem();
|
||||||
poseStack.pushPose();
|
poseStack.pushPose();
|
||||||
RenderSystem.disableDepthTest();
|
RenderSystem.disableDepthTest();
|
||||||
RenderSystem.depthMask(false);
|
RenderSystem.depthMask(false);
|
||||||
|
@ -79,9 +79,7 @@ public class SpyglassRangeOverlay implements LayeredDraw.Layer {
|
||||||
float k = ((screenWidth - i) / 2);
|
float k = ((screenWidth - i) / 2);
|
||||||
float l = ((screenHeight - j) / 2);
|
float l = ((screenHeight - j) / 2);
|
||||||
float w = i * 21 / 9;
|
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;
|
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, (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 + 4 * ClientEventHandler.holdArtilleryIndicator), (float) screenHeight / 2 + 48, -90, -1);
|
||||||
}
|
|
||||||
|
|
||||||
poseStack.popPose();
|
poseStack.popPose();
|
||||||
}
|
}
|
||||||
|
|
||||||
// vehicle info display
|
|
||||||
|
|
||||||
boolean lookAtEntity = false;
|
boolean lookAtEntity = false;
|
||||||
|
|
||||||
BlockHitResult result = player.level().clip(new ClipContext(player.getEyePosition(), player.getEyePosition().add(player.getViewVector(1).scale(512)),
|
BlockHitResult result = player.level().clip(new ClipContext(player.getEyePosition(), player.getEyePosition().add(player.getViewVector(1).scale(512)),
|
||||||
|
|
Loading…
Add table
Reference in a new issue