From d0c4dcee56062f2ce880543584972281c94dcc3a Mon Sep 17 00:00:00 2001 From: Atsuihsio <842960157@qq.com> Date: Sun, 9 Mar 2025 02:05:23 +0800 Subject: [PATCH] =?UTF-8?q?=E6=B7=BB=E5=8A=A0=EF=BC=8C=E8=B0=83=E6=95=B4?= =?UTF-8?q?=E9=83=A8=E5=88=86=E9=85=8D=E6=96=B9=EF=BC=8C=E7=A7=BB=E9=99=A4?= =?UTF-8?q?=E6=97=A0=E4=BA=BA=E6=9C=BA=E5=8A=A0=E8=BD=BD=E5=8C=BA=E5=9D=97?= =?UTF-8?q?=E8=83=BD=E5=8A=9B=EF=BC=8C=E8=B0=83=E6=95=B4=E9=A3=9E=E8=A1=8C?= =?UTF-8?q?=E8=BD=BD=E5=85=B7=E5=9D=A0=E6=9C=BA=E4=BC=A4=E5=AE=B3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../entity/vehicle/Ah6Entity.java | 12 +++---- .../entity/vehicle/DroneEntity.java | 34 ------------------- .../entity/vehicle/Tom6Entity.java | 12 ++++--- .../create/recipes/crushing/iron_powder.json | 15 ++++++++ .../recipes/crushing/tungsten_powder.json | 15 ++++++++ .../mixing/high_energy_explosives.json | 23 +++++++++++++ .../recipes/armor_plate_crafting.json | 2 +- .../recipes/missile_engine_crafting.json | 7 ++-- 8 files changed, 69 insertions(+), 51 deletions(-) create mode 100644 src/main/resources/data/create/recipes/crushing/iron_powder.json create mode 100644 src/main/resources/data/create/recipes/crushing/tungsten_powder.json create mode 100644 src/main/resources/data/create/recipes/mixing/high_energy_explosives.json diff --git a/src/main/java/com/atsuishio/superbwarfare/entity/vehicle/Ah6Entity.java b/src/main/java/com/atsuishio/superbwarfare/entity/vehicle/Ah6Entity.java index 4c4aa9e07..774a52db5 100644 --- a/src/main/java/com/atsuishio/superbwarfare/entity/vehicle/Ah6Entity.java +++ b/src/main/java/com/atsuishio/superbwarfare/entity/vehicle/Ah6Entity.java @@ -459,6 +459,12 @@ public class Ah6Entity extends ContainerMobileVehicleEntity implements GeoEntity @Override public void destroy() { + if (this.crash) { + crashPassengers(); + } else { + explodePassengers(); + } + if (level() instanceof ServerLevel) { CustomExplosion explosion = new CustomExplosion(this.level(), this, ModDamageTypes.causeCustomExplosionDamage(this.level().registryAccess(), this, getAttacker()), 300.0f, @@ -468,12 +474,6 @@ public class Ah6Entity extends ContainerMobileVehicleEntity implements GeoEntity explosion.finalizeExplosion(false); ParticleTool.spawnHugeExplosionParticles(this.level(), this.position()); } - - if (this.crash) { - crashPassengers(); - } else { - explodePassengers(); - } this.discard(); } diff --git a/src/main/java/com/atsuishio/superbwarfare/entity/vehicle/DroneEntity.java b/src/main/java/com/atsuishio/superbwarfare/entity/vehicle/DroneEntity.java index 8d4f8f53a..56f91787b 100644 --- a/src/main/java/com/atsuishio/superbwarfare/entity/vehicle/DroneEntity.java +++ b/src/main/java/com/atsuishio/superbwarfare/entity/vehicle/DroneEntity.java @@ -13,7 +13,6 @@ import com.atsuishio.superbwarfare.init.ModItems; import com.atsuishio.superbwarfare.init.ModSounds; import com.atsuishio.superbwarfare.item.Monitor; import com.atsuishio.superbwarfare.item.common.ammo.MortarShell; -import com.atsuishio.superbwarfare.tools.ChunkLoadTool; import com.atsuishio.superbwarfare.tools.CustomExplosion; import com.atsuishio.superbwarfare.tools.EntityFindUtil; import com.atsuishio.superbwarfare.tools.ParticleTool; @@ -198,11 +197,6 @@ public class DroneEntity extends MobileVehicleEntity implements GeoEntity { setZRot(getRoll() * 0.9f); - if (this.level() instanceof ServerLevel serverLevel) { - // 更新需要加载的区块 - ChunkLoadTool.updateLoadedChunks(serverLevel, this, this.loadedChunks); - } - lastTickSpeed = this.getDeltaMovement().length(); lastTickVerticalSpeed = this.getDeltaMovement().y; @@ -214,7 +208,6 @@ public class DroneEntity extends MobileVehicleEntity implements GeoEntity { if (!this.onGround()) { if (controller != null) { - handleSimulationDistance(controller); ItemStack stack = controller.getMainHandItem(); if (stack.is(ModItems.MONITOR.get()) && stack.getOrCreateTag().getBoolean("Using")) { if (controller.level().isClientSide) { @@ -266,25 +259,6 @@ public class DroneEntity extends MobileVehicleEntity implements GeoEntity { this.refreshDimensions(); } - public void handleSimulationDistance(Player player) { - if (player.level() instanceof ServerLevel serverLevel && player instanceof ServerPlayer) { - var distanceManager = serverLevel.getChunkSource().chunkMap.getDistanceManager(); - var playerTicketManager = distanceManager.playerTicketManager; - int maxDistance = playerTicketManager.viewDistance; - - if (this.position().vectorTo(player.position()).horizontalDistance() > maxDistance * 16) { - this.upInputDown = false; - this.downInputDown = false; - this.forwardInputDown = false; - this.backInputDown = false; - this.leftInputDown = false; - this.rightInputDown = false; - - Vec3 toVec = position().vectorTo(player.position()).normalize(); - setDeltaMovement(getDeltaMovement().add(new Vec3(toVec.x, 0, toVec.z).scale(0.2))); - } - } - } private void droneDrop(Player player) { Level level = player.level(); @@ -647,14 +621,6 @@ public class DroneEntity extends MobileVehicleEntity implements GeoEntity { return this.cache; } - @Override - public void onRemovedFromWorld() { - if (this.level() instanceof ServerLevel serverLevel) { - ChunkLoadTool.unloadAllChunks(serverLevel, this, this.loadedChunks); - } - super.onRemovedFromWorld(); - } - @Override public boolean canCrushEntities() { return false; diff --git a/src/main/java/com/atsuishio/superbwarfare/entity/vehicle/Tom6Entity.java b/src/main/java/com/atsuishio/superbwarfare/entity/vehicle/Tom6Entity.java index ca359ac9d..5f3f9be96 100644 --- a/src/main/java/com/atsuishio/superbwarfare/entity/vehicle/Tom6Entity.java +++ b/src/main/java/com/atsuishio/superbwarfare/entity/vehicle/Tom6Entity.java @@ -298,6 +298,13 @@ public class Tom6Entity extends MobileVehicleEntity implements GeoEntity { @Override public void destroy() { + + if (this.crash) { + crashPassengers(); + } else { + explodePassengers(); + } + if (level() instanceof ServerLevel) { if (entityData.get(MELON)) { CustomExplosion explosion = new CustomExplosion(this.level(), this, @@ -318,11 +325,6 @@ public class Tom6Entity extends MobileVehicleEntity implements GeoEntity { } } - if (this.crash) { - crashPassengers(); - } else { - explodePassengers(); - } this.discard(); } diff --git a/src/main/resources/data/create/recipes/crushing/iron_powder.json b/src/main/resources/data/create/recipes/crushing/iron_powder.json new file mode 100644 index 000000000..2fb814543 --- /dev/null +++ b/src/main/resources/data/create/recipes/crushing/iron_powder.json @@ -0,0 +1,15 @@ +{ + "type": "create:crushing", + "ingredients": [ + { + "item": "minecraft:iron_ingot" + } + ], + "processingTime": 150, + "results": [ + { + "count": 1, + "item": "superbwarfare:iron_powder" + } + ] +} \ No newline at end of file diff --git a/src/main/resources/data/create/recipes/crushing/tungsten_powder.json b/src/main/resources/data/create/recipes/crushing/tungsten_powder.json new file mode 100644 index 000000000..0500e81e3 --- /dev/null +++ b/src/main/resources/data/create/recipes/crushing/tungsten_powder.json @@ -0,0 +1,15 @@ +{ + "type": "create:crushing", + "ingredients": [ + { + "tag": "forge:ingots/tungsten" + } + ], + "processingTime": 150, + "results": [ + { + "count": 1, + "item": "superbwarfare:tungsten_powder" + } + ] +} \ No newline at end of file diff --git a/src/main/resources/data/create/recipes/mixing/high_energy_explosives.json b/src/main/resources/data/create/recipes/mixing/high_energy_explosives.json new file mode 100644 index 000000000..2cc3ff223 --- /dev/null +++ b/src/main/resources/data/create/recipes/mixing/high_energy_explosives.json @@ -0,0 +1,23 @@ +{ + "type": "create:mixing", + "ingredients": [ + { + "item": "minecraft:gunpowder" + }, + { + "item": "minecraft:gunpowder" + }, + { + "tag": "forge:sand" + }, + { + "item": "minecraft:sugar" + } + ], + "results": [ + { + "item": "superbwarfare:high_energy_explosives", + "count": 3 + } + ] +} \ No newline at end of file diff --git a/src/main/resources/data/superbwarfare/recipes/armor_plate_crafting.json b/src/main/resources/data/superbwarfare/recipes/armor_plate_crafting.json index 3cc57b3f8..633110de3 100644 --- a/src/main/resources/data/superbwarfare/recipes/armor_plate_crafting.json +++ b/src/main/resources/data/superbwarfare/recipes/armor_plate_crafting.json @@ -22,6 +22,6 @@ }, "result": { "item": "superbwarfare:armor_plate", - "count": 2 + "count": 4 } } \ No newline at end of file diff --git a/src/main/resources/data/superbwarfare/recipes/missile_engine_crafting.json b/src/main/resources/data/superbwarfare/recipes/missile_engine_crafting.json index 5828a8e22..d7eea19c9 100644 --- a/src/main/resources/data/superbwarfare/recipes/missile_engine_crafting.json +++ b/src/main/resources/data/superbwarfare/recipes/missile_engine_crafting.json @@ -3,7 +3,7 @@ "category": "misc", "pattern": [ "aba", - "cdc", + "cbc", " e " ], "key": { @@ -11,14 +11,11 @@ "item": "minecraft:copper_ingot" }, "b": { - "item": "minecraft:hopper" + "item": "superbwarfare:grain" }, "c": { "item": "minecraft:iron_ingot" }, - "d": { - "item": "superbwarfare:grain" - }, "e": { "item": "minecraft:firework_rocket" }