修复了无法选择的问题
This commit is contained in:
parent
c7a1218562
commit
1e7ff74eb6
1 changed files with 6 additions and 19 deletions
|
@ -5,7 +5,6 @@ import net.mcreator.superbwarfare.entity.projectile.MortarShellEntity;
|
||||||
import net.mcreator.superbwarfare.init.ModEntities;
|
import net.mcreator.superbwarfare.init.ModEntities;
|
||||||
import net.mcreator.superbwarfare.init.ModItems;
|
import net.mcreator.superbwarfare.init.ModItems;
|
||||||
import net.mcreator.superbwarfare.init.ModSounds;
|
import net.mcreator.superbwarfare.init.ModSounds;
|
||||||
import net.minecraft.core.NonNullList;
|
|
||||||
import net.minecraft.core.particles.ParticleTypes;
|
import net.minecraft.core.particles.ParticleTypes;
|
||||||
import net.minecraft.nbt.CompoundTag;
|
import net.minecraft.nbt.CompoundTag;
|
||||||
import net.minecraft.network.chat.Component;
|
import net.minecraft.network.chat.Component;
|
||||||
|
@ -63,6 +62,10 @@ public class MortarEntity extends Entity implements GeoEntity, AnimatedEntity {
|
||||||
this.entityData.define(PITCH, 70f);
|
this.entityData.define(PITCH, 70f);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public boolean isPickable() {
|
||||||
|
return !this.isRemoved();
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected float getEyeHeight(Pose pPose, EntityDimensions pSize) {
|
protected float getEyeHeight(Pose pPose, EntityDimensions pSize) {
|
||||||
|
@ -74,16 +77,6 @@ public class MortarEntity extends Entity implements GeoEntity, AnimatedEntity {
|
||||||
return NetworkHooks.getEntitySpawningPacket(this);
|
return NetworkHooks.getEntitySpawningPacket(this);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
|
||||||
public Iterable<ItemStack> getArmorSlots() {
|
|
||||||
return NonNullList.withSize(1, ItemStack.EMPTY);
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void setItemSlot(EquipmentSlot pSlot, ItemStack pStack) {
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean hurt(DamageSource source, float amount) {
|
public boolean hurt(DamageSource source, float amount) {
|
||||||
if (source.is(DamageTypes.IN_FIRE))
|
if (source.is(DamageTypes.IN_FIRE))
|
||||||
|
@ -127,7 +120,6 @@ public class MortarEntity extends Entity implements GeoEntity, AnimatedEntity {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public InteractionResult interactAt(Player player, Vec3 pVec, InteractionHand pHand) {
|
public InteractionResult interactAt(Player player, Vec3 pVec, InteractionHand pHand) {
|
||||||
|
|
||||||
player.displayClientMessage(Component.literal("114"), true);
|
player.displayClientMessage(Component.literal("114"), true);
|
||||||
if (!this.level().isClientSide) {
|
if (!this.level().isClientSide) {
|
||||||
ItemStack mainHandItem = player.getMainHandItem();
|
ItemStack mainHandItem = player.getMainHandItem();
|
||||||
|
@ -239,16 +231,11 @@ public class MortarEntity extends Entity implements GeoEntity, AnimatedEntity {
|
||||||
if (this.entityData.get(FIRE_TIME) > 0) {
|
if (this.entityData.get(FIRE_TIME) > 0) {
|
||||||
this.entityData.set(FIRE_TIME, this.entityData.get(FIRE_TIME) - 1);
|
this.entityData.set(FIRE_TIME, this.entityData.get(FIRE_TIME) - 1);
|
||||||
}
|
}
|
||||||
this.setXRot(-Mth.clamp(entityData.get(PITCH), 20, 89));
|
this.setXRot(-Mth.clamp(entityData.get(PITCH), 20, 89));
|
||||||
this.xRotO = this.getXRot();
|
this.xRotO = this.getXRot();
|
||||||
this.refreshDimensions();
|
this.refreshDimensions();
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
|
||||||
public boolean isPushable() {
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
// @Override
|
// @Override
|
||||||
// public HumanoidArm getMainArm() {
|
// public HumanoidArm getMainArm() {
|
||||||
// return HumanoidArm.RIGHT;
|
// return HumanoidArm.RIGHT;
|
||||||
|
|
Loading…
Add table
Reference in a new issue