规范命名ContainerMobileEntity
This commit is contained in:
parent
4fd964a1c1
commit
42954d80cb
6 changed files with 12 additions and 12 deletions
|
@ -60,7 +60,7 @@ import java.util.List;
|
|||
|
||||
import static com.atsuishio.superbwarfare.tools.ParticleTool.sendParticle;
|
||||
|
||||
public class Ah6Entity extends ContainerMobileEntity implements GeoEntity, IHelicopterEntity, MultiWeaponVehicleEntity {
|
||||
public class Ah6Entity extends ContainerMobileVehicleEntity implements GeoEntity, IHelicopterEntity, MultiWeaponVehicleEntity {
|
||||
|
||||
private final AnimatableInstanceCache cache = GeckoLibUtil.createInstanceCache(this);
|
||||
public static final float MAX_HEALTH = VehicleConfig.AH_6_HP.get();
|
||||
|
|
|
@ -63,7 +63,7 @@ import java.util.List;
|
|||
|
||||
import static com.atsuishio.superbwarfare.tools.ParticleTool.sendParticle;
|
||||
|
||||
public class Bmp2Entity extends ContainerMobileEntity implements GeoEntity, ILandArmorEntity, MultiWeaponVehicleEntity {
|
||||
public class Bmp2Entity extends ContainerMobileVehicleEntity implements GeoEntity, ILandArmorEntity, MultiWeaponVehicleEntity {
|
||||
|
||||
public static final EntityDataAccessor<Integer> FIRE_ANIM = SynchedEntityData.defineId(Bmp2Entity.class, EntityDataSerializers.INT);
|
||||
public static final EntityDataAccessor<Float> DELTA_ROT = SynchedEntityData.defineId(Bmp2Entity.class, EntityDataSerializers.FLOAT);
|
||||
|
|
|
@ -26,14 +26,14 @@ import net.minecraftforge.items.wrapper.InvWrapper;
|
|||
import org.jetbrains.annotations.Nullable;
|
||||
import org.joml.Math;
|
||||
|
||||
public class ContainerMobileEntity extends MobileVehicleEntity implements HasCustomInventoryScreen, ContainerEntity {
|
||||
public class ContainerMobileVehicleEntity extends MobileVehicleEntity implements HasCustomInventoryScreen, ContainerEntity {
|
||||
|
||||
public static final int CONTAINER_SIZE = 102;
|
||||
|
||||
private NonNullList<ItemStack> items = NonNullList.withSize(CONTAINER_SIZE, ItemStack.EMPTY);
|
||||
private LazyOptional<?> itemHandler = LazyOptional.of(() -> new InvWrapper(this));
|
||||
|
||||
public ContainerMobileEntity(EntityType<?> pEntityType, Level pLevel) {
|
||||
public ContainerMobileVehicleEntity(EntityType<?> pEntityType, Level pLevel) {
|
||||
super(pEntityType, pLevel);
|
||||
}
|
||||
|
|
@ -62,7 +62,7 @@ import java.util.List;
|
|||
|
||||
import static com.atsuishio.superbwarfare.tools.ParticleTool.sendParticle;
|
||||
|
||||
public class Lav150Entity extends ContainerMobileEntity implements GeoEntity, ILandArmorEntity, MultiWeaponVehicleEntity {
|
||||
public class Lav150Entity extends ContainerMobileVehicleEntity implements GeoEntity, ILandArmorEntity, MultiWeaponVehicleEntity {
|
||||
|
||||
public static final EntityDataAccessor<Integer> FIRE_ANIM = SynchedEntityData.defineId(Lav150Entity.class, EntityDataSerializers.INT);
|
||||
public static final EntityDataAccessor<Float> DELTA_ROT = SynchedEntityData.defineId(Lav150Entity.class, EntityDataSerializers.FLOAT);
|
||||
|
|
|
@ -52,7 +52,7 @@ import java.util.List;
|
|||
|
||||
import static com.atsuishio.superbwarfare.tools.ParticleTool.sendParticle;
|
||||
|
||||
public class SpeedboatEntity extends ContainerMobileEntity implements GeoEntity, IArmedVehicleEntity {
|
||||
public class SpeedboatEntity extends ContainerMobileVehicleEntity implements GeoEntity, IArmedVehicleEntity {
|
||||
|
||||
public static final EntityDataAccessor<Integer> FIRE_ANIM = SynchedEntityData.defineId(SpeedboatEntity.class, EntityDataSerializers.INT);
|
||||
public static final EntityDataAccessor<Float> DELTA_ROT = SynchedEntityData.defineId(SpeedboatEntity.class, EntityDataSerializers.FLOAT);
|
||||
|
|
|
@ -7,7 +7,7 @@ import com.atsuishio.superbwarfare.config.common.GameplayConfig;
|
|||
import com.atsuishio.superbwarfare.entity.ICustomKnockback;
|
||||
import com.atsuishio.superbwarfare.entity.TargetEntity;
|
||||
import com.atsuishio.superbwarfare.entity.projectile.ProjectileEntity;
|
||||
import com.atsuishio.superbwarfare.entity.vehicle.ContainerMobileEntity;
|
||||
import com.atsuishio.superbwarfare.entity.vehicle.ContainerMobileVehicleEntity;
|
||||
import com.atsuishio.superbwarfare.entity.vehicle.IArmedVehicleEntity;
|
||||
import com.atsuishio.superbwarfare.entity.vehicle.VehicleEntity;
|
||||
import com.atsuishio.superbwarfare.init.*;
|
||||
|
@ -736,10 +736,10 @@ public class LivingEventHandler {
|
|||
|
||||
@SubscribeEvent
|
||||
public static void onPickup(EntityItemPickupEvent event) {
|
||||
if (event.getEntity().getVehicle() instanceof ContainerMobileEntity containerMobileEntity) {
|
||||
if (event.getEntity().getVehicle() instanceof ContainerMobileVehicleEntity containerMobileVehicleEntity) {
|
||||
var pickUp = event.getItem();
|
||||
if (!containerMobileEntity.level().isClientSide) {
|
||||
HopperBlockEntity.addItem(containerMobileEntity, pickUp);
|
||||
if (!containerMobileVehicleEntity.level().isClientSide) {
|
||||
HopperBlockEntity.addItem(containerMobileVehicleEntity, pickUp);
|
||||
}
|
||||
event.setCanceled(true);
|
||||
}
|
||||
|
@ -753,11 +753,11 @@ public class LivingEventHandler {
|
|||
if (!(sourceEntity instanceof Player player)) return;
|
||||
ItemStack stack = player.getMainHandItem();
|
||||
|
||||
if (player.getVehicle() instanceof ContainerMobileEntity containerMobileEntity && source.is(ModDamageTypes.VEHICLE_STRIKE)) {
|
||||
if (player.getVehicle() instanceof ContainerMobileVehicleEntity containerMobileVehicleEntity && source.is(ModDamageTypes.VEHICLE_STRIKE)) {
|
||||
var drops = event.getDrops();
|
||||
drops.forEach(itemEntity -> {
|
||||
ItemStack item = itemEntity.getItem();
|
||||
if (!HopperBlockEntity.addItem(containerMobileEntity, itemEntity)) {
|
||||
if (!HopperBlockEntity.addItem(containerMobileVehicleEntity, itemEntity)) {
|
||||
player.drop(item, false);
|
||||
}
|
||||
});
|
||||
|
|
Loading…
Add table
Reference in a new issue