添加缺失的@OnlyIn(Dist.CLIENT)注解
This commit is contained in:
parent
d6f4ff1507
commit
3a5ec09058
3 changed files with 16 additions and 0 deletions
|
@ -49,6 +49,8 @@ import net.minecraft.world.level.Explosion;
|
|||
import net.minecraft.world.level.Level;
|
||||
import net.minecraft.world.level.block.state.BlockState;
|
||||
import net.minecraft.world.phys.*;
|
||||
import net.neoforged.api.distmarker.Dist;
|
||||
import net.neoforged.api.distmarker.OnlyIn;
|
||||
import net.neoforged.neoforge.capabilities.Capabilities;
|
||||
import net.neoforged.neoforge.event.EventHooks;
|
||||
import net.neoforged.neoforge.network.PacketDistributor;
|
||||
|
@ -779,6 +781,7 @@ public class PrismTankEntity extends ContainerMobileVehicleEntity implements Geo
|
|||
return Mod.loc("textures/vehicle_icon/prism_tank_icon.png");
|
||||
}
|
||||
|
||||
@OnlyIn(Dist.CLIENT)
|
||||
@Override
|
||||
public void renderFirstPersonOverlay(GuiGraphics guiGraphics, Font font, Player player, int screenWidth, int screenHeight, float scale) {
|
||||
float minWH = (float) Math.min(screenWidth, screenHeight);
|
||||
|
@ -794,6 +797,7 @@ public class PrismTankEntity extends ContainerMobileVehicleEntity implements Geo
|
|||
guiGraphics.drawString(font, Component.literal("LASER " + (this.getEntityData().get(HEAT) + 25) + " ℃"), screenWidth / 2 - 33, screenHeight - 65, Mth.hsvToRgb((float) heat / 3.745318352059925F, 1.0F, 1.0F), false);
|
||||
}
|
||||
|
||||
@OnlyIn(Dist.CLIENT)
|
||||
@Override
|
||||
public void renderThirdPersonOverlay(GuiGraphics guiGraphics, Font font, Player player, int screenWidth, int screenHeight, float scale) {
|
||||
super.renderThirdPersonOverlay(guiGraphics, font, player, screenWidth, screenHeight, scale);
|
||||
|
|
|
@ -55,6 +55,8 @@ import net.minecraft.world.level.block.state.BlockState;
|
|||
import net.minecraft.world.phys.AABB;
|
||||
import net.minecraft.world.phys.BlockHitResult;
|
||||
import net.minecraft.world.phys.Vec3;
|
||||
import net.neoforged.api.distmarker.Dist;
|
||||
import net.neoforged.api.distmarker.OnlyIn;
|
||||
import net.neoforged.neoforge.event.EventHooks;
|
||||
import net.neoforged.neoforge.network.PacketDistributor;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
|
@ -1223,6 +1225,7 @@ public class Yx100Entity extends ContainerMobileVehicleEntity implements GeoEnti
|
|||
return Mod.loc("textures/vehicle_icon/yx_100_icon.png");
|
||||
}
|
||||
|
||||
@OnlyIn(Dist.CLIENT)
|
||||
@Override
|
||||
public void renderFirstPersonOverlay(GuiGraphics guiGraphics, Font font, Player player, int screenWidth, int screenHeight, float scale) {
|
||||
float minWH = (float) Math.min(screenWidth, screenHeight);
|
||||
|
@ -1259,6 +1262,7 @@ public class Yx100Entity extends ContainerMobileVehicleEntity implements GeoEnti
|
|||
}
|
||||
}
|
||||
|
||||
@OnlyIn(Dist.CLIENT)
|
||||
@Override
|
||||
public void renderThirdPersonOverlay(GuiGraphics guiGraphics, Font font, Player player, int screenWidth, int screenHeight, float scale) {
|
||||
if (this.getWeaponIndex(0) == 0) {
|
||||
|
|
|
@ -970,6 +970,10 @@ public abstract class VehicleEntity extends Entity {
|
|||
return getEyePosition();
|
||||
}
|
||||
|
||||
/**
|
||||
* 渲染载具的第一人称UI
|
||||
* 务必标记 @OnlyIn(Dist.CLIENT) !
|
||||
*/
|
||||
@OnlyIn(Dist.CLIENT)
|
||||
public void renderFirstPersonOverlay(GuiGraphics guiGraphics, Font font, Player player, int screenWidth, int screenHeight, float scale) {
|
||||
if (!(this instanceof WeaponVehicleEntity weaponVehicle)) return;
|
||||
|
@ -999,6 +1003,10 @@ public abstract class VehicleEntity extends Entity {
|
|||
preciseBlit(guiGraphics, texture, centerW, centerH, 0, 0, scaledMinWH, scaledMinWH, scaledMinWH, scaledMinWH);
|
||||
}
|
||||
|
||||
/**
|
||||
* 渲染载具的第三人称UI
|
||||
* 务必标记 @OnlyIn(Dist.CLIENT) !
|
||||
*/
|
||||
@OnlyIn(Dist.CLIENT)
|
||||
public void renderThirdPersonOverlay(GuiGraphics guiGraphics, Font font, Player player, int screenWidth, int screenHeight, float scale) {
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue