diff --git a/src/main/java/com/atsuishio/superbwarfare/client/ContainerItemDecorator.java b/src/main/java/com/atsuishio/superbwarfare/client/ContainerItemDecorator.java index 4e85b708c..67a43849d 100644 --- a/src/main/java/com/atsuishio/superbwarfare/client/ContainerItemDecorator.java +++ b/src/main/java/com/atsuishio/superbwarfare/client/ContainerItemDecorator.java @@ -38,7 +38,6 @@ public class ContainerItemDecorator implements IItemDecorator { var entity = entityType.create(level); if (!(entity instanceof VehicleEntity vehicle)) return false; - // TODO 给每一个载具加上item icon ResourceLocation icon = vehicle.getVehicleItemIcon(); if (icon == null) return false; diff --git a/src/main/java/com/atsuishio/superbwarfare/entity/vehicle/A10Entity.java b/src/main/java/com/atsuishio/superbwarfare/entity/vehicle/A10Entity.java index 8de6b511b..19dbea50a 100644 --- a/src/main/java/com/atsuishio/superbwarfare/entity/vehicle/A10Entity.java +++ b/src/main/java/com/atsuishio/superbwarfare/entity/vehicle/A10Entity.java @@ -1072,4 +1072,9 @@ public class A10Entity extends ContainerMobileVehicleEntity implements GeoEntity } return super.getCameraPosition(partialTicks, player, false, false); } + + @Override + public @Nullable ResourceLocation getVehicleItemIcon() { + return Mod.loc("textures/gui/vehicle/aircraft.png"); + } } diff --git a/src/main/java/com/atsuishio/superbwarfare/entity/vehicle/Ah6Entity.java b/src/main/java/com/atsuishio/superbwarfare/entity/vehicle/Ah6Entity.java index f925a8968..a4dd2f850 100644 --- a/src/main/java/com/atsuishio/superbwarfare/entity/vehicle/Ah6Entity.java +++ b/src/main/java/com/atsuishio/superbwarfare/entity/vehicle/Ah6Entity.java @@ -723,4 +723,9 @@ public class Ah6Entity extends ContainerMobileVehicleEntity implements GeoEntity } return super.getCameraPosition(partialTicks, player, false, false); } + + @Override + public @Nullable ResourceLocation getVehicleItemIcon() { + return Mod.loc("textures/gui/vehicle/aircraft.png"); + } } diff --git a/src/main/java/com/atsuishio/superbwarfare/entity/vehicle/AnnihilatorEntity.java b/src/main/java/com/atsuishio/superbwarfare/entity/vehicle/AnnihilatorEntity.java index 8ba7d5ecb..38325e6b5 100644 --- a/src/main/java/com/atsuishio/superbwarfare/entity/vehicle/AnnihilatorEntity.java +++ b/src/main/java/com/atsuishio/superbwarfare/entity/vehicle/AnnihilatorEntity.java @@ -595,4 +595,9 @@ public class AnnihilatorEntity extends EnergyVehicleEntity implements GeoEntity, public boolean useFixedCameraPos(Entity entity) { return true; } + + @Override + public @Nullable ResourceLocation getVehicleItemIcon() { + return Mod.loc("textures/gui/vehicle/defense.png"); + } } 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 ece50460c..2a2c0efd9 100644 --- a/src/main/java/com/atsuishio/superbwarfare/entity/vehicle/Bmp2Entity.java +++ b/src/main/java/com/atsuishio/superbwarfare/entity/vehicle/Bmp2Entity.java @@ -778,4 +778,9 @@ public class Bmp2Entity extends ContainerMobileVehicleEntity implements GeoEntit } return super.getCameraPosition(partialTicks, player, false, false); } + + @Override + public @Nullable ResourceLocation getVehicleItemIcon() { + return Mod.loc("textures/gui/vehicle/land.png"); + } } diff --git a/src/main/java/com/atsuishio/superbwarfare/entity/vehicle/Hpj11Entity.java b/src/main/java/com/atsuishio/superbwarfare/entity/vehicle/Hpj11Entity.java index 7d9ed4cc4..8b9a11521 100644 --- a/src/main/java/com/atsuishio/superbwarfare/entity/vehicle/Hpj11Entity.java +++ b/src/main/java/com/atsuishio/superbwarfare/entity/vehicle/Hpj11Entity.java @@ -607,4 +607,9 @@ public class Hpj11Entity extends ContainerMobileVehicleEntity implements GeoEnti } return super.getCameraPosition(partialTicks, player, false, false); } + + @Override + public @Nullable ResourceLocation getVehicleItemIcon() { + return Mod.loc("textures/gui/vehicle/defense.png"); + } } diff --git a/src/main/java/com/atsuishio/superbwarfare/entity/vehicle/LaserTowerEntity.java b/src/main/java/com/atsuishio/superbwarfare/entity/vehicle/LaserTowerEntity.java index 2acf8b3d1..0a7509b34 100644 --- a/src/main/java/com/atsuishio/superbwarfare/entity/vehicle/LaserTowerEntity.java +++ b/src/main/java/com/atsuishio/superbwarfare/entity/vehicle/LaserTowerEntity.java @@ -1,5 +1,6 @@ package com.atsuishio.superbwarfare.entity.vehicle; +import com.atsuishio.superbwarfare.Mod; import com.atsuishio.superbwarfare.config.server.VehicleConfig; import com.atsuishio.superbwarfare.entity.TargetEntity; import com.atsuishio.superbwarfare.entity.vehicle.base.AutoAimable; @@ -18,6 +19,7 @@ import net.minecraft.nbt.CompoundTag; import net.minecraft.network.syncher.EntityDataAccessor; import net.minecraft.network.syncher.EntityDataSerializers; import net.minecraft.network.syncher.SynchedEntityData; +import net.minecraft.resources.ResourceLocation; import net.minecraft.server.level.ServerLevel; import net.minecraft.server.level.ServerPlayer; import net.minecraft.server.players.OldUsersConverter; @@ -359,4 +361,9 @@ public class LaserTowerEntity extends EnergyVehicleEntity implements GeoEntity, public AnimatableInstanceCache getAnimatableInstanceCache() { return this.cache; } + + @Override + public @Nullable ResourceLocation getVehicleItemIcon() { + return Mod.loc("textures/gui/vehicle/defense.png"); + } } 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 8f296a48c..42a197a3f 100644 --- a/src/main/java/com/atsuishio/superbwarfare/entity/vehicle/Lav150Entity.java +++ b/src/main/java/com/atsuishio/superbwarfare/entity/vehicle/Lav150Entity.java @@ -641,4 +641,9 @@ public class Lav150Entity extends ContainerMobileVehicleEntity implements GeoEnt } return super.getCameraPosition(partialTicks, player, false, false); } + + @Override + public @Nullable ResourceLocation getVehicleItemIcon() { + return Mod.loc("textures/gui/vehicle/land.png"); + } } diff --git a/src/main/java/com/atsuishio/superbwarfare/entity/vehicle/Mk42Entity.java b/src/main/java/com/atsuishio/superbwarfare/entity/vehicle/Mk42Entity.java index 376d5447a..c2ccf6b52 100644 --- a/src/main/java/com/atsuishio/superbwarfare/entity/vehicle/Mk42Entity.java +++ b/src/main/java/com/atsuishio/superbwarfare/entity/vehicle/Mk42Entity.java @@ -457,4 +457,9 @@ public class Mk42Entity extends VehicleEntity implements GeoEntity, CannonEntity public boolean useFixedCameraPos(Entity entity) { return true; } + + @Override + public @Nullable ResourceLocation getVehicleItemIcon() { + return Mod.loc("textures/gui/vehicle/defense.png"); + } } diff --git a/src/main/java/com/atsuishio/superbwarfare/entity/vehicle/Mle1934Entity.java b/src/main/java/com/atsuishio/superbwarfare/entity/vehicle/Mle1934Entity.java index 18f7e64ac..f1b13ffdf 100644 --- a/src/main/java/com/atsuishio/superbwarfare/entity/vehicle/Mle1934Entity.java +++ b/src/main/java/com/atsuishio/superbwarfare/entity/vehicle/Mle1934Entity.java @@ -526,4 +526,9 @@ public class Mle1934Entity extends VehicleEntity implements GeoEntity, CannonEnt public boolean useFixedCameraPos(Entity entity) { return true; } + + @Override + public @Nullable ResourceLocation getVehicleItemIcon() { + return Mod.loc("textures/gui/vehicle/defense.png"); + } } 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 70b24276c..2ebc61c4f 100644 --- a/src/main/java/com/atsuishio/superbwarfare/entity/vehicle/PrismTankEntity.java +++ b/src/main/java/com/atsuishio/superbwarfare/entity/vehicle/PrismTankEntity.java @@ -821,4 +821,9 @@ public class PrismTankEntity extends ContainerMobileVehicleEntity implements Geo public boolean useFixedCameraPos(Entity entity) { return this.getSeatIndex(entity) == 0; } + + @Override + public @Nullable ResourceLocation getVehicleItemIcon() { + return Mod.loc("textures/gui/vehicle/land.png"); + } } diff --git a/src/main/java/com/atsuishio/superbwarfare/entity/vehicle/SpeedboatEntity.java b/src/main/java/com/atsuishio/superbwarfare/entity/vehicle/SpeedboatEntity.java index 7e2640c65..32cafec63 100644 --- a/src/main/java/com/atsuishio/superbwarfare/entity/vehicle/SpeedboatEntity.java +++ b/src/main/java/com/atsuishio/superbwarfare/entity/vehicle/SpeedboatEntity.java @@ -567,4 +567,9 @@ public class SpeedboatEntity extends ContainerMobileVehicleEntity implements Geo public Pair getPassengerRotation(Entity entity, float tickDelta) { return Pair.of(Axis.XP.rotationDegrees(-this.getViewXRot(tickDelta)), Axis.ZP.rotationDegrees(-this.getRoll(tickDelta))); } + + @Override + public @Nullable ResourceLocation getVehicleItemIcon() { + return Mod.loc("textures/gui/vehicle/water.png"); + } } diff --git a/src/main/java/com/atsuishio/superbwarfare/entity/vehicle/Tom6Entity.java b/src/main/java/com/atsuishio/superbwarfare/entity/vehicle/Tom6Entity.java index b2d4a8213..a6a8a27b5 100644 --- a/src/main/java/com/atsuishio/superbwarfare/entity/vehicle/Tom6Entity.java +++ b/src/main/java/com/atsuishio/superbwarfare/entity/vehicle/Tom6Entity.java @@ -360,4 +360,9 @@ public class Tom6Entity extends MobileVehicleEntity implements GeoEntity { public Pair getPassengerRotation(Entity entity, float tickDelta) { return Pair.of(Axis.XP.rotationDegrees(-this.getViewXRot(tickDelta)), Axis.ZP.rotationDegrees(-this.getRoll(tickDelta))); } + + @Override + public @Nullable ResourceLocation getVehicleItemIcon() { + return Mod.loc("textures/gui/vehicle/aircraft.png"); + } } diff --git a/src/main/java/com/atsuishio/superbwarfare/entity/vehicle/WheelChairEntity.java b/src/main/java/com/atsuishio/superbwarfare/entity/vehicle/WheelChairEntity.java index b1f5017e1..d44a6644d 100644 --- a/src/main/java/com/atsuishio/superbwarfare/entity/vehicle/WheelChairEntity.java +++ b/src/main/java/com/atsuishio/superbwarfare/entity/vehicle/WheelChairEntity.java @@ -312,4 +312,9 @@ public class WheelChairEntity extends MobileVehicleEntity implements GeoEntity { public Pair getPassengerRotation(Entity entity, float tickDelta) { return Pair.of(Axis.XP.rotationDegrees(-this.getViewXRot(tickDelta)), Axis.ZP.rotationDegrees(-this.getRoll(tickDelta))); } + + @Override + public @Nullable ResourceLocation getVehicleItemIcon() { + return Mod.loc("textures/gui/vehicle/otto.png"); + } } 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 c2dd2b947..607b34a42 100644 --- a/src/main/java/com/atsuishio/superbwarfare/entity/vehicle/Yx100Entity.java +++ b/src/main/java/com/atsuishio/superbwarfare/entity/vehicle/Yx100Entity.java @@ -1282,4 +1282,9 @@ public class Yx100Entity extends ContainerMobileVehicleEntity implements GeoEnti } return super.getCameraPosition(partialTicks, player, false, false); } + + @Override + public @Nullable ResourceLocation getVehicleItemIcon() { + return Mod.loc("textures/gui/vehicle/land.png"); + } } diff --git a/src/main/resources/assets/superbwarfare/textures/gui/vehicle/air.png b/src/main/resources/assets/superbwarfare/textures/gui/vehicle/aircraft.png similarity index 100% rename from src/main/resources/assets/superbwarfare/textures/gui/vehicle/air.png rename to src/main/resources/assets/superbwarfare/textures/gui/vehicle/aircraft.png