添加载具集装箱角标

This commit is contained in:
17146 2025-06-03 21:07:36 +08:00 committed by Light_Quanta
parent 4732b61465
commit 68d7f43b72
No known key found for this signature in database
GPG key ID: 11A39A1B8C890959
16 changed files with 72 additions and 1 deletions

View file

@ -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;

View file

@ -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");
}
}

View file

@ -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");
}
}

View file

@ -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");
}
}

View file

@ -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");
}
}

View file

@ -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");
}
}

View file

@ -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");
}
}

View file

@ -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");
}
}

View file

@ -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");
}
}

View file

@ -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");
}
}

View file

@ -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");
}
}

View file

@ -567,4 +567,9 @@ public class SpeedboatEntity extends ContainerMobileVehicleEntity implements Geo
public Pair<Quaternionf, Quaternionf> 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");
}
}

View file

@ -360,4 +360,9 @@ public class Tom6Entity extends MobileVehicleEntity implements GeoEntity {
public Pair<Quaternionf, Quaternionf> 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");
}
}

View file

@ -312,4 +312,9 @@ public class WheelChairEntity extends MobileVehicleEntity implements GeoEntity {
public Pair<Quaternionf, Quaternionf> 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");
}
}

View file

@ -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");
}
}