diff --git a/src/main/java/com/atsuishio/superbwarfare/entity/vehicle/Bmp2Entity.java b/src/main/java/com/atsuishio/superbwarfare/entity/vehicle/Bmp2Entity.java index 37f9956a2..2a2e58193 100644 --- a/src/main/java/com/atsuishio/superbwarfare/entity/vehicle/Bmp2Entity.java +++ b/src/main/java/com/atsuishio/superbwarfare/entity/vehicle/Bmp2Entity.java @@ -27,7 +27,6 @@ import com.atsuishio.superbwarfare.tools.ParticleTool; import com.mojang.math.Axis; import net.minecraft.client.gui.Font; import net.minecraft.client.gui.GuiGraphics; -import net.minecraft.client.player.LocalPlayer; import net.minecraft.core.BlockPos; import net.minecraft.core.particles.ParticleTypes; import net.minecraft.nbt.CompoundTag; @@ -690,7 +689,7 @@ public class Bmp2Entity extends ContainerMobileVehicleEntity implements GeoEntit @OnlyIn(Dist.CLIENT) @Override - public void renderFirstPersonOverlay(GuiGraphics guiGraphics, Font font, LocalPlayer player, int screenWidth, int screenHeight, float scale) { + public void renderFirstPersonOverlay(GuiGraphics guiGraphics, Font font, Player player, int screenWidth, int screenHeight, float scale) { super.renderFirstPersonOverlay(guiGraphics, font, player, screenWidth, screenHeight, scale); if (this.getWeaponIndex(0) == 0) { @@ -706,7 +705,7 @@ public class Bmp2Entity extends ContainerMobileVehicleEntity implements GeoEntit @OnlyIn(Dist.CLIENT) @Override - public void renderThirdPersonOverlay(GuiGraphics guiGraphics, Font font, LocalPlayer player, int screenWidth, int screenHeight, float scale) { + public void renderThirdPersonOverlay(GuiGraphics guiGraphics, Font font, Player player, int screenWidth, int screenHeight, float scale) { if (this.getWeaponIndex(0) == 0) { double heat = this.getEntityData().get(HEAT) / 100.0F; guiGraphics.drawString(font, Component.literal("30MM 2A42 " + (InventoryTool.hasCreativeAmmoBox(player) ? "∞" : this.getAmmoCount(player))), 30, -9, Mth.hsvToRgb(0F, (float) heat, 1.0F), false); diff --git a/src/main/java/com/atsuishio/superbwarfare/entity/vehicle/Lav150Entity.java b/src/main/java/com/atsuishio/superbwarfare/entity/vehicle/Lav150Entity.java index 7ac3760e6..4e55ec610 100644 --- a/src/main/java/com/atsuishio/superbwarfare/entity/vehicle/Lav150Entity.java +++ b/src/main/java/com/atsuishio/superbwarfare/entity/vehicle/Lav150Entity.java @@ -26,7 +26,6 @@ import com.atsuishio.superbwarfare.tools.ParticleTool; import com.mojang.math.Axis; import net.minecraft.client.gui.Font; import net.minecraft.client.gui.GuiGraphics; -import net.minecraft.client.player.LocalPlayer; import net.minecraft.core.BlockPos; import net.minecraft.core.particles.ParticleTypes; import net.minecraft.nbt.CompoundTag; @@ -597,7 +596,7 @@ public class Lav150Entity extends ContainerMobileVehicleEntity implements GeoEnt @OnlyIn(Dist.CLIENT) @Override - public void renderFirstPersonOverlay(GuiGraphics guiGraphics, Font font, LocalPlayer player, int screenWidth, int screenHeight, float scale) { + public void renderFirstPersonOverlay(GuiGraphics guiGraphics, Font font, Player player, int screenWidth, int screenHeight, float scale) { super.renderFirstPersonOverlay(guiGraphics, font, player, screenWidth, screenHeight, scale); if (this.getWeaponIndex(0) == 0) { @@ -611,7 +610,7 @@ public class Lav150Entity extends ContainerMobileVehicleEntity implements GeoEnt @OnlyIn(Dist.CLIENT) @Override - public void renderThirdPersonOverlay(GuiGraphics guiGraphics, Font font, LocalPlayer player, int screenWidth, int screenHeight, float scale) { + public void renderThirdPersonOverlay(GuiGraphics guiGraphics, Font font, Player player, int screenWidth, int screenHeight, float scale) { super.renderThirdPersonOverlay(guiGraphics, font, player, screenWidth, screenHeight, scale); if (this.getWeaponIndex(0) == 0) { diff --git a/src/main/java/com/atsuishio/superbwarfare/entity/vehicle/PrismTankEntity.java b/src/main/java/com/atsuishio/superbwarfare/entity/vehicle/PrismTankEntity.java index 631226251..a5c1e6039 100644 --- a/src/main/java/com/atsuishio/superbwarfare/entity/vehicle/PrismTankEntity.java +++ b/src/main/java/com/atsuishio/superbwarfare/entity/vehicle/PrismTankEntity.java @@ -24,7 +24,6 @@ import com.mojang.math.Axis; import net.minecraft.ChatFormatting; import net.minecraft.client.gui.Font; import net.minecraft.client.gui.GuiGraphics; -import net.minecraft.client.player.LocalPlayer; import net.minecraft.core.BlockPos; import net.minecraft.core.Direction; import net.minecraft.core.Holder; @@ -740,7 +739,7 @@ public class PrismTankEntity extends ContainerMobileVehicleEntity implements Geo } @Override - public void renderFirstPersonOverlay(GuiGraphics guiGraphics, Font font, LocalPlayer player, int screenWidth, int screenHeight, float scale) { + public void renderFirstPersonOverlay(GuiGraphics guiGraphics, Font font, Player player, int screenWidth, int screenHeight, float scale) { float minWH = (float) Math.min(screenWidth, screenHeight); float scaledMinWH = Mth.floor(minWH * scale); float centerW = ((screenWidth - scaledMinWH) / 2); @@ -755,7 +754,7 @@ public class PrismTankEntity extends ContainerMobileVehicleEntity implements Geo } @Override - public void renderThirdPersonOverlay(GuiGraphics guiGraphics, Font font, LocalPlayer player, int screenWidth, int screenHeight, float scale) { + public void renderThirdPersonOverlay(GuiGraphics guiGraphics, Font font, Player player, int screenWidth, int screenHeight, float scale) { super.renderThirdPersonOverlay(guiGraphics, font, player, screenWidth, screenHeight, scale); double heat = this.getEntityData().get(HEAT) / 100.0F; diff --git a/src/main/java/com/atsuishio/superbwarfare/entity/vehicle/Yx100Entity.java b/src/main/java/com/atsuishio/superbwarfare/entity/vehicle/Yx100Entity.java index d660ca2f8..875cab936 100644 --- a/src/main/java/com/atsuishio/superbwarfare/entity/vehicle/Yx100Entity.java +++ b/src/main/java/com/atsuishio/superbwarfare/entity/vehicle/Yx100Entity.java @@ -27,7 +27,6 @@ import net.minecraft.client.CameraType; import net.minecraft.client.Minecraft; import net.minecraft.client.gui.Font; import net.minecraft.client.gui.GuiGraphics; -import net.minecraft.client.player.LocalPlayer; import net.minecraft.client.renderer.GameRenderer; import net.minecraft.core.BlockPos; import net.minecraft.core.particles.ParticleTypes; @@ -1174,7 +1173,7 @@ public class Yx100Entity extends ContainerMobileVehicleEntity implements GeoEnti } @Override - public void renderFirstPersonOverlay(GuiGraphics guiGraphics, Font font, LocalPlayer player, int screenWidth, int screenHeight, float scale) { + public void renderFirstPersonOverlay(GuiGraphics guiGraphics, Font font, Player player, int screenWidth, int screenHeight, float scale) { float minWH = (float) Math.min(screenWidth, screenHeight); float scaledMinWH = Mth.floor(minWH * scale); float centerW = ((screenWidth - scaledMinWH) / 2); @@ -1210,7 +1209,7 @@ public class Yx100Entity extends ContainerMobileVehicleEntity implements GeoEnti } @Override - public void renderThirdPersonOverlay(GuiGraphics guiGraphics, Font font, LocalPlayer player, int screenWidth, int screenHeight, float scale) { + public void renderThirdPersonOverlay(GuiGraphics guiGraphics, Font font, Player player, int screenWidth, int screenHeight, float scale) { if (this.getWeaponIndex(0) == 0) { guiGraphics.drawString(font, Component.literal("AP SHELL " + this.getAmmoCount(player) + " " + (InventoryTool.hasCreativeAmmoBox(player) ? "∞" : this.getEntityData().get(AMMO))), 30, -9, -1, false); } else if (this.getWeaponIndex(0) == 1) { diff --git a/src/main/java/com/atsuishio/superbwarfare/entity/vehicle/base/VehicleEntity.java b/src/main/java/com/atsuishio/superbwarfare/entity/vehicle/base/VehicleEntity.java index ce937a8b7..b5ba51f8d 100644 --- a/src/main/java/com/atsuishio/superbwarfare/entity/vehicle/base/VehicleEntity.java +++ b/src/main/java/com/atsuishio/superbwarfare/entity/vehicle/base/VehicleEntity.java @@ -954,8 +954,9 @@ public abstract class VehicleEntity extends Entity { } @OnlyIn(Dist.CLIENT) - public void renderFirstPersonOverlay(GuiGraphics guiGraphics, Font font, LocalPlayer player, int screenWidth, int screenHeight, float scale) { + public void renderFirstPersonOverlay(GuiGraphics guiGraphics, Font font, Player player, int screenWidth, int screenHeight, float scale) { if (!(this instanceof WeaponVehicleEntity weaponVehicle)) return; + if (!(player instanceof LocalPlayer)) return; float minWH = (float) Math.min(screenWidth, screenHeight); float scaledMinWH = Mth.floor(minWH * scale); @@ -982,6 +983,6 @@ public abstract class VehicleEntity extends Entity { } @OnlyIn(Dist.CLIENT) - public void renderThirdPersonOverlay(GuiGraphics guiGraphics, Font font, LocalPlayer player, int screenWidth, int screenHeight, float scale) { + public void renderThirdPersonOverlay(GuiGraphics guiGraphics, Font font, Player player, int screenWidth, int screenHeight, float scale) { } }