From 0333ee50eb4d152d93ceb6ea3223a9fc4cd2e1db Mon Sep 17 00:00:00 2001 From: 17146 <1714673995@qq.com> Date: Tue, 3 Jun 2025 16:27:37 +0800 Subject: [PATCH] =?UTF-8?q?=E6=B7=BB=E5=8A=A0=E9=80=9A=E7=94=A8=E6=96=B9?= =?UTF-8?q?=E6=B3=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../superbwarfare/client/ContainerItemDecorator.java | 9 +-------- .../superbwarfare/entity/vehicle/base/VehicleEntity.java | 8 ++++++++ 2 files changed, 9 insertions(+), 8 deletions(-) diff --git a/src/main/java/com/atsuishio/superbwarfare/client/ContainerItemDecorator.java b/src/main/java/com/atsuishio/superbwarfare/client/ContainerItemDecorator.java index 235e4a2e8..4e85b708c 100644 --- a/src/main/java/com/atsuishio/superbwarfare/client/ContainerItemDecorator.java +++ b/src/main/java/com/atsuishio/superbwarfare/client/ContainerItemDecorator.java @@ -1,7 +1,5 @@ package com.atsuishio.superbwarfare.client; -import com.atsuishio.superbwarfare.Mod; -import com.atsuishio.superbwarfare.entity.vehicle.WheelChairEntity; import com.atsuishio.superbwarfare.entity.vehicle.base.VehicleEntity; import com.atsuishio.superbwarfare.item.ContainerBlockItem; import net.minecraft.client.Minecraft; @@ -40,13 +38,8 @@ public class ContainerItemDecorator implements IItemDecorator { var entity = entityType.create(level); if (!(entity instanceof VehicleEntity vehicle)) return false; - ResourceLocation icon = null; - // TODO 给每一个载具加上item icon - if (vehicle instanceof WheelChairEntity) { - icon = Mod.loc("textures/item/perk/beast_bullet.png"); - } - + ResourceLocation icon = vehicle.getVehicleItemIcon(); if (icon == null) return false; var pose = guiGraphics.pose(); 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 d79d0a044..e72e538e3 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 @@ -1030,6 +1030,14 @@ public abstract class VehicleEntity extends Entity { return original; } + /** + * 载具在集装箱物品上显示的贴图 + */ + @Nullable + public ResourceLocation getVehicleItemIcon() { + return null; + } + /** * 渲染载具的第一人称UI * 务必标记 @OnlyIn(Dist.CLIENT) !