修复无人机导致的加载和保存bug,与carry on冲突的问题

This commit is contained in:
17146 2025-03-16 01:37:25 +08:00
parent 3eab28a6b3
commit 7083ecd3e8

View file

@ -111,7 +111,6 @@ public class DroneEntity extends MobileVehicleEntity implements GeoEntity {
return Mth.lerp(0.6f * tickDelta, pitchO, getBodyPitch()); return Mth.lerp(0.6f * tickDelta, pitchO, getBodyPitch());
} }
@Override @Override
public boolean sendFireStarParticleOnHurt() { public boolean sendFireStarParticleOnHurt() {
return false; return false;
@ -157,7 +156,10 @@ public class DroneEntity extends MobileVehicleEntity implements GeoEntity {
compound.putString("Controller", this.entityData.get(CONTROLLER)); compound.putString("Controller", this.entityData.get(CONTROLLER));
compound.putInt("Ammo", this.entityData.get(AMMO)); compound.putInt("Ammo", this.entityData.get(AMMO));
compound.putInt("KamikazeMode", this.entityData.get(KAMIKAZE_MODE)); compound.putInt("KamikazeMode", this.entityData.get(KAMIKAZE_MODE));
compound.put("Item", this.currentItem.save(compound));
CompoundTag item = new CompoundTag();
this.currentItem.save(item);
compound.put("Item", item);
} }
@Override @Override
@ -308,7 +310,7 @@ public class DroneEntity extends MobileVehicleEntity implements GeoEntity {
} }
} }
} }
} else if (stack.isEmpty() && player.isCrouching()) { } else if (stack.is(ModItems.CROWBAR.get()) && player.isCrouching()) {
// 返还物品 // 返还物品
ItemHandlerHelper.giveItemToPlayer(player, new ItemStack(ModItems.DRONE.get())); ItemHandlerHelper.giveItemToPlayer(player, new ItemStack(ModItems.DRONE.get()));