添加通用方法
This commit is contained in:
parent
ba553a76d0
commit
0333ee50eb
2 changed files with 9 additions and 8 deletions
|
@ -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();
|
||||
|
|
|
@ -1030,6 +1030,14 @@ public abstract class VehicleEntity extends Entity {
|
|||
return original;
|
||||
}
|
||||
|
||||
/**
|
||||
* 载具在集装箱物品上显示的贴图
|
||||
*/
|
||||
@Nullable
|
||||
public ResourceLocation getVehicleItemIcon() {
|
||||
return null;
|
||||
}
|
||||
|
||||
/**
|
||||
* 渲染载具的第一人称UI
|
||||
* 务必标记 @OnlyIn(Dist.CLIENT) !
|
||||
|
|
Loading…
Add table
Reference in a new issue