添加A10空对地导弹

This commit is contained in:
Atsuishio 2025-05-09 19:26:32 +08:00 committed by Light_Quanta
parent cd71d815ec
commit 157c113e97
No known key found for this signature in database
GPG key ID: 11A39A1B8C890959
40 changed files with 5683 additions and 4775 deletions

View file

@ -1,5 +1,6 @@
// 1.21.1 2025-05-09T21:27:11.5373344 Item Models: superbwarfare // 1.21.1 2025-05-09T21:50:05.0172065 Item Models: superbwarfare
13ca8d5676888ff51f3308d88e4bf67691fa34f8 assets/superbwarfare/models/item/aa_12_blueprint.json 13ca8d5676888ff51f3308d88e4bf67691fa34f8 assets/superbwarfare/models/item/aa_12_blueprint.json
0a9bfb695c2b5668863a2de4770f5bfca663c1dc assets/superbwarfare/models/item/agm.json
13ca8d5676888ff51f3308d88e4bf67691fa34f8 assets/superbwarfare/models/item/ak_12_blueprint.json 13ca8d5676888ff51f3308d88e4bf67691fa34f8 assets/superbwarfare/models/item/ak_12_blueprint.json
13ca8d5676888ff51f3308d88e4bf67691fa34f8 assets/superbwarfare/models/item/ak_47_blueprint.json 13ca8d5676888ff51f3308d88e4bf67691fa34f8 assets/superbwarfare/models/item/ak_47_blueprint.json
c993bddc0db9453ffbefa59f9ac9a74dba909038 assets/superbwarfare/models/item/ancient_cpu.json c993bddc0db9453ffbefa59f9ac9a74dba909038 assets/superbwarfare/models/item/ancient_cpu.json

View file

@ -0,0 +1,6 @@
{
"parent": "minecraft:item/generated",
"textures": {
"layer0": "superbwarfare:item/agm"
}
}

View file

@ -0,0 +1,27 @@
package com.atsuishio.superbwarfare.client.layer.projectile;
import com.atsuishio.superbwarfare.Mod;
import com.atsuishio.superbwarfare.entity.projectile.Agm65Entity;
import com.mojang.blaze3d.vertex.PoseStack;
import com.mojang.blaze3d.vertex.VertexConsumer;
import net.minecraft.client.renderer.MultiBufferSource;
import net.minecraft.client.renderer.RenderType;
import net.minecraft.client.renderer.texture.OverlayTexture;
import net.minecraft.resources.ResourceLocation;
import software.bernie.geckolib.cache.object.BakedGeoModel;
import software.bernie.geckolib.renderer.GeoRenderer;
import software.bernie.geckolib.renderer.layer.GeoRenderLayer;
public class Agm65Layer extends GeoRenderLayer<Agm65Entity> {
private static final ResourceLocation LAYER = Mod.loc("textures/entity/rpg_rocket_e.png");
public Agm65Layer(GeoRenderer<Agm65Entity> entityRenderer) {
super(entityRenderer);
}
@Override
public void render(PoseStack poseStack, Agm65Entity animatable, BakedGeoModel bakedModel, RenderType renderType, MultiBufferSource bufferSource, VertexConsumer buffer, float partialTick, int packedLight, int packedOverlay) {
RenderType glowRenderType = RenderType.eyes(LAYER);
getRenderer().reRender(getDefaultBakedModel(animatable), poseStack, bufferSource, animatable, glowRenderType, bufferSource.getBuffer(glowRenderType), partialTick, packedLight, OverlayTexture.NO_OVERLAY, 0xFFFFFFFF);
}
}

View file

@ -0,0 +1,24 @@
package com.atsuishio.superbwarfare.client.model.entity;
import com.atsuishio.superbwarfare.Mod;
import com.atsuishio.superbwarfare.entity.projectile.Agm65Entity;
import net.minecraft.resources.ResourceLocation;
import software.bernie.geckolib.model.GeoModel;
public class Agm65Model extends GeoModel<Agm65Entity> {
@Override
public ResourceLocation getAnimationResource(Agm65Entity entity) {
return Mod.loc("animations/javelin_missile.animation.json");
}
@Override
public ResourceLocation getModelResource(Agm65Entity entity) {
return Mod.loc("geo/agm65.geo.json");
}
@Override
public ResourceLocation getTextureResource(Agm65Entity entity) {
return Mod.loc("textures/entity/agm65.png");
}
}

View file

@ -8,8 +8,10 @@ import com.atsuishio.superbwarfare.entity.vehicle.base.AircraftEntity;
import com.atsuishio.superbwarfare.entity.vehicle.base.MobileVehicleEntity; import com.atsuishio.superbwarfare.entity.vehicle.base.MobileVehicleEntity;
import com.atsuishio.superbwarfare.entity.vehicle.base.WeaponVehicleEntity; import com.atsuishio.superbwarfare.entity.vehicle.base.WeaponVehicleEntity;
import com.atsuishio.superbwarfare.event.ClientEventHandler; import com.atsuishio.superbwarfare.event.ClientEventHandler;
import com.atsuishio.superbwarfare.tools.EntityFindUtil;
import com.atsuishio.superbwarfare.tools.FormatTool; import com.atsuishio.superbwarfare.tools.FormatTool;
import com.atsuishio.superbwarfare.tools.InventoryTool; import com.atsuishio.superbwarfare.tools.InventoryTool;
import com.atsuishio.superbwarfare.tools.SeekTool;
import com.mojang.blaze3d.platform.GlStateManager; import com.mojang.blaze3d.platform.GlStateManager;
import com.mojang.blaze3d.systems.RenderSystem; import com.mojang.blaze3d.systems.RenderSystem;
import com.mojang.blaze3d.vertex.PoseStack; import com.mojang.blaze3d.vertex.PoseStack;
@ -24,6 +26,7 @@ import net.minecraft.client.renderer.GameRenderer;
import net.minecraft.network.chat.Component; import net.minecraft.network.chat.Component;
import net.minecraft.resources.ResourceLocation; import net.minecraft.resources.ResourceLocation;
import net.minecraft.util.Mth; import net.minecraft.util.Mth;
import net.minecraft.world.entity.Entity;
import net.minecraft.world.entity.player.Player; import net.minecraft.world.entity.player.Player;
import net.minecraft.world.phys.Vec3; import net.minecraft.world.phys.Vec3;
import net.neoforged.api.distmarker.Dist; import net.neoforged.api.distmarker.Dist;
@ -31,6 +34,8 @@ import net.neoforged.api.distmarker.OnlyIn;
import org.jetbrains.annotations.NotNull; import org.jetbrains.annotations.NotNull;
import org.joml.Math; import org.joml.Math;
import java.util.List;
import static com.atsuishio.superbwarfare.client.RenderHelper.preciseBlit; import static com.atsuishio.superbwarfare.client.RenderHelper.preciseBlit;
import static com.atsuishio.superbwarfare.entity.vehicle.base.VehicleEntity.HEAT; import static com.atsuishio.superbwarfare.entity.vehicle.base.VehicleEntity.HEAT;
@ -42,6 +47,10 @@ public class AircraftOverlay implements LayeredDraw.Layer {
private static float lerpVy = 1; private static float lerpVy = 1;
private static float lerpG = 1; private static float lerpG = 1;
private static final ResourceLocation FRAME = Mod.loc("textures/screens/frame/frame.png");
private static final ResourceLocation FRAME_TARGET = Mod.loc("textures/screens/frame/frame_target.png");
private static final ResourceLocation FRAME_LOCK = Mod.loc("textures/screens/frame/frame_lock.png");
@Override @Override
public void render(GuiGraphics guiGraphics, @NotNull DeltaTracker deltaTracker) { public void render(GuiGraphics guiGraphics, @NotNull DeltaTracker deltaTracker) {
Minecraft mc = Minecraft.getInstance(); Minecraft mc = Minecraft.getInstance();
@ -72,16 +81,18 @@ public class AircraftOverlay implements LayeredDraw.Layer {
float diffX = Mth.wrapDegrees(Mth.lerp(partialTick, player.xRotO, player.getXRot()) - Mth.lerp(partialTick, mobileVehicle.xRotO, mobileVehicle.getXRot())) * 0.5f; float diffX = Mth.wrapDegrees(Mth.lerp(partialTick, player.xRotO, player.getXRot()) - Mth.lerp(partialTick, mobileVehicle.xRotO, mobileVehicle.getXRot())) * 0.5f;
float fovAdjust2 = (float) (Minecraft.getInstance().options.fov().get() / 30) - 1; float fovAdjust2 = (float) (Minecraft.getInstance().options.fov().get() / 30) - 1;
double zoom = 0.96 * 3 + 0.06 * fovAdjust2; double zoom = 3 + 0.06 * fovAdjust2;
Vec3 pos = aircraftEntity.shootPos(partialTick).add(mobileVehicle.getViewVector(partialTick).scale(192)); Vec3 pos = aircraftEntity.shootPos(partialTick).add(mobileVehicle.getViewVector(partialTick).scale(192));
Vec3 posCross = aircraftEntity.shootPos(partialTick).add(aircraftEntity.shootVec(partialTick).scale(192)); Vec3 posCross = aircraftEntity.shootPos(partialTick).add(aircraftEntity.shootVec(partialTick).scale(192));
Vec3 lookAngle = player.getViewVector(partialTick).normalize().scale(pos.distanceTo(cameraPos) * (1 - 1.0 / zoom)); Vec3 lookAngle = player.getViewVector(partialTick).normalize().scale(pos.distanceTo(cameraPos) * (1 - 1.0 / zoom));
Vec3 lookAngle2 = player.getViewVector(partialTick).normalize().scale(posCross.distanceTo(cameraPos) * (1 - 1.0 / zoom));
var cPos = cameraPos.add(lookAngle); var cPos = cameraPos.add(lookAngle);
var cPos2 = cameraPos.add(lookAngle2);
Vec3 p = RenderHelper.worldToScreen(pos, ClientEventHandler.zoomVehicle ? cPos : cameraPos); Vec3 p = RenderHelper.worldToScreen(pos, ClientEventHandler.zoomVehicle ? cPos : cameraPos);
Vec3 pCross = RenderHelper.worldToScreen(posCross, ClientEventHandler.zoomVehicle ? cPos : cameraPos); Vec3 pCross = RenderHelper.worldToScreen(posCross, ClientEventHandler.zoomVehicle ? cPos2 : cameraPos);
if (p != null) { if (p != null) {
poseStack.pushPose(); poseStack.pushPose();
@ -156,6 +167,14 @@ public class AircraftOverlay implements LayeredDraw.Layer {
int width = Minecraft.getInstance().font.width(name); int width = Minecraft.getInstance().font.width(name);
guiGraphics.drawString(Minecraft.getInstance().font, Component.literal(name), (int) x - width / 2, (int) y + 67, 0x66FF00, false); guiGraphics.drawString(Minecraft.getInstance().font, Component.literal(name), (int) x - width / 2, (int) y + 67, 0x66FF00, false);
String count = String.valueOf(aircraftEntity.getAmmoCount(player));
int width2 = Minecraft.getInstance().font.width(count);
guiGraphics.drawString(Minecraft.getInstance().font, Component.literal(count), (int) x - width2 / 2, (int) y + 76, 0x66FF00, false);
} else if (weaponVehicle.getWeaponIndex(0) == 3) {
String name = "AGM-65";
int width = Minecraft.getInstance().font.width(name);
guiGraphics.drawString(Minecraft.getInstance().font, Component.literal(name), (int) x - width / 2, (int) y + 67, 0x66FF00, false);
String count = String.valueOf(aircraftEntity.getAmmoCount(player)); String count = String.valueOf(aircraftEntity.getAmmoCount(player));
int width2 = Minecraft.getInstance().font.width(count); int width2 = Minecraft.getInstance().font.width(count);
guiGraphics.drawString(Minecraft.getInstance().font, Component.literal(count), (int) x - width2 / 2, (int) y + 76, 0x66FF00, false); guiGraphics.drawString(Minecraft.getInstance().font, Component.literal(count), (int) x - width2 / 2, (int) y + 76, 0x66FF00, false);
@ -192,11 +211,12 @@ public class AircraftOverlay implements LayeredDraw.Layer {
// 准星 // 准星
if (pCross != null) { if (pCross != null) {
poseStack.pushPose(); poseStack.pushPose();
float x = (float) pCross.x; float x = (float) pCross.x;
float y = (float) pCross.y; float y = (float) pCross.y;
if (mc.options.getCameraType() == CameraType.FIRST_PERSON) { if (mc.options.getCameraType() == CameraType.FIRST_PERSON && !(mobileVehicle instanceof A10Entity a10Entity && a10Entity.getWeaponIndex(0) == 3)) {
RenderSystem.disableDepthTest(); RenderSystem.disableDepthTest();
RenderSystem.depthMask(false); RenderSystem.depthMask(false);
@ -229,6 +249,8 @@ public class AircraftOverlay implements LayeredDraw.Layer {
guiGraphics.drawString(Minecraft.getInstance().font, Component.literal("70MM ROCKET " + aircraftEntity.getAmmoCount(player)), 25, -9, -1, false); guiGraphics.drawString(Minecraft.getInstance().font, Component.literal("70MM ROCKET " + aircraftEntity.getAmmoCount(player)), 25, -9, -1, false);
} else if (weaponVehicle.getWeaponIndex(0) == 2) { } else if (weaponVehicle.getWeaponIndex(0) == 2) {
guiGraphics.drawString(Minecraft.getInstance().font, Component.literal("MK82 BOMB " + aircraftEntity.getAmmoCount(player)), 25, -9, -1, false); guiGraphics.drawString(Minecraft.getInstance().font, Component.literal("MK82 BOMB " + aircraftEntity.getAmmoCount(player)), 25, -9, -1, false);
} else if (weaponVehicle.getWeaponIndex(0) == 3) {
guiGraphics.drawString(Minecraft.getInstance().font, Component.literal("AGM-65 " + aircraftEntity.getAmmoCount(player)), 25, -9, -1, false);
} }
} }
@ -238,6 +260,33 @@ public class AircraftOverlay implements LayeredDraw.Layer {
} }
poseStack.popPose(); poseStack.popPose();
} }
//A-10的导弹锁定
if (mobileVehicle instanceof A10Entity a10Entity && a10Entity.getWeaponIndex(0) == 3) {
Entity targetEntity = EntityFindUtil.findEntity(player.level(), a10Entity.getTargetUuid());
List<Entity> entities = SeekTool.seekCustomSizeEntities(a10Entity, player.level(), 384, 20, 0.9);
for (var e : entities) {
Vec3 pos3 = new Vec3(Mth.lerp(partialTick, e.xo, e.getX()), Mth.lerp(partialTick, e.yo + e.getEyeHeight(), e.getEyeY()), Mth.lerp(partialTick, e.zo, e.getZ()));
Vec3 lookAngle3 = player.getViewVector(partialTick).normalize().scale(pos3.distanceTo(cameraPos) * (1 - 1.0 / zoom));
var cPos3 = cameraPos.add(lookAngle3);
Vec3 point = RenderHelper.worldToScreen(pos3, ClientEventHandler.zoomVehicle ? cPos3 : cameraPos);
if (point != null) {
boolean nearest = e == targetEntity;
boolean lockOn = a10Entity.locked && nearest;
poseStack.pushPose();
float x = (float) point.x;
float y = (float) point.y;
RenderHelper.preciseBlit(guiGraphics, lockOn ? FRAME_LOCK : nearest ? FRAME_TARGET : FRAME, x - 12, y - 12, 24, 24, 0, 0, 24, 24, 24, 24);
poseStack.popPose();
}
}
}
poseStack.popPose(); poseStack.popPose();
} }
} }

View file

@ -87,11 +87,11 @@ public class DroneHudOverlay implements LayeredDraw.Layer {
boolean lookAtEntity = false; boolean lookAtEntity = false;
double distance = player.distanceTo(entity); double distance = player.distanceTo(entity);
BlockHitResult result = entity.level().clip(new ClipContext(entity.getEyePosition(), entity.getEyePosition().add(player.getViewVector(1).scale(512)), BlockHitResult result = entity.level().clip(new ClipContext(cameraPos, cameraPos.add(player.getViewVector(1).scale(512)),
ClipContext.Block.OUTLINE, ClipContext.Fluid.NONE, entity)); ClipContext.Block.OUTLINE, ClipContext.Fluid.NONE, entity));
Vec3 hitPos = result.getLocation(); Vec3 hitPos = result.getLocation();
double blockRange = player.getEyePosition(1).distanceTo(hitPos); double blockRange = cameraPos.distanceTo(hitPos);
double entityRange = 0; double entityRange = 0;

View file

@ -11,11 +11,13 @@ import net.minecraft.client.renderer.entity.EntityRendererProvider;
import net.minecraft.resources.ResourceLocation; import net.minecraft.resources.ResourceLocation;
import net.minecraft.util.Mth; import net.minecraft.util.Mth;
import net.minecraft.world.phys.Vec3; import net.minecraft.world.phys.Vec3;
import org.jetbrains.annotations.NotNull;
import software.bernie.geckolib.cache.object.BakedGeoModel; import software.bernie.geckolib.cache.object.BakedGeoModel;
import software.bernie.geckolib.cache.object.GeoBone; import software.bernie.geckolib.cache.object.GeoBone;
import software.bernie.geckolib.renderer.GeoEntityRenderer; import software.bernie.geckolib.renderer.GeoEntityRenderer;
import static com.atsuishio.superbwarfare.entity.vehicle.A10Entity.LOADED_BOMB; import static com.atsuishio.superbwarfare.entity.vehicle.A10Entity.LOADED_BOMB;
import static com.atsuishio.superbwarfare.entity.vehicle.A10Entity.LOADED_MISSILE;
import static com.atsuishio.superbwarfare.entity.vehicle.base.MobileVehicleEntity.GEAR_ROT; import static com.atsuishio.superbwarfare.entity.vehicle.base.MobileVehicleEntity.GEAR_ROT;
public class A10Renderer extends GeoEntityRenderer<A10Entity> { public class A10Renderer extends GeoEntityRenderer<A10Entity> {
@ -39,7 +41,7 @@ public class A10Renderer extends GeoEntityRenderer<A10Entity> {
} }
@Override @Override
public void render(A10Entity entityIn, float entityYaw, float partialTicks, PoseStack poseStack, MultiBufferSource bufferIn, int packedLightIn) { public void render(A10Entity entityIn, float entityYaw, float partialTicks, PoseStack poseStack, @NotNull MultiBufferSource bufferIn, int packedLightIn) {
poseStack.pushPose(); poseStack.pushPose();
Vec3 root = new Vec3(0, 2.375, 0); Vec3 root = new Vec3(0, 2.375, 0);
poseStack.rotateAround(Axis.YP.rotationDegrees(-entityYaw), (float) root.x, (float) root.y, (float) root.z); poseStack.rotateAround(Axis.YP.rotationDegrees(-entityYaw), (float) root.x, (float) root.y, (float) root.z);
@ -82,6 +84,18 @@ public class A10Renderer extends GeoEntityRenderer<A10Entity> {
if (name.equals("bomb3")) { if (name.equals("bomb3")) {
bone.setHidden(animatable.getEntityData().get(LOADED_BOMB) < 1); bone.setHidden(animatable.getEntityData().get(LOADED_BOMB) < 1);
} }
if (name.equals("missile1")) {
bone.setHidden(animatable.getEntityData().get(LOADED_MISSILE) < 4);
}
if (name.equals("missile2")) {
bone.setHidden(animatable.getEntityData().get(LOADED_MISSILE) < 3);
}
if (name.equals("missile4")) {
bone.setHidden(animatable.getEntityData().get(LOADED_MISSILE) < 2);
}
if (name.equals("missile3")) {
bone.setHidden(animatable.getEntityData().get(LOADED_MISSILE) < 1);
}
super.renderRecursively(poseStack, animatable, bone, renderType, bufferSource, buffer, isReRender, partialTick, packedLight, packedOverlay, color); super.renderRecursively(poseStack, animatable, bone, renderType, bufferSource, buffer, isReRender, partialTick, packedLight, packedOverlay, color);
} }
} }

View file

@ -0,0 +1,45 @@
package com.atsuishio.superbwarfare.client.renderer.entity;
import com.atsuishio.superbwarfare.client.layer.projectile.Agm65Layer;
import com.atsuishio.superbwarfare.client.model.entity.Agm65Model;
import com.atsuishio.superbwarfare.entity.projectile.Agm65Entity;
import com.mojang.blaze3d.vertex.PoseStack;
import com.mojang.blaze3d.vertex.VertexConsumer;
import com.mojang.math.Axis;
import net.minecraft.client.renderer.MultiBufferSource;
import net.minecraft.client.renderer.RenderType;
import net.minecraft.client.renderer.entity.EntityRendererProvider;
import net.minecraft.resources.ResourceLocation;
import net.minecraft.util.Mth;
import org.jetbrains.annotations.NotNull;
import software.bernie.geckolib.cache.object.BakedGeoModel;
import software.bernie.geckolib.renderer.GeoEntityRenderer;
public class Agm65Renderer extends GeoEntityRenderer<Agm65Entity> {
public Agm65Renderer(EntityRendererProvider.Context renderManager) {
super(renderManager, new Agm65Model());
this.addRenderLayer(new Agm65Layer(this));
}
@Override
public RenderType getRenderType(Agm65Entity animatable, ResourceLocation texture, MultiBufferSource bufferSource, float partialTick) {
return RenderType.entityTranslucent(getTextureLocation(animatable));
}
@Override
public void preRender(PoseStack poseStack, Agm65Entity entity, BakedGeoModel model, MultiBufferSource bufferSource, VertexConsumer buffer, boolean isReRender, float partialTick, int packedLight, int packedOverlay, int color) {
float scale = 1f;
this.scaleHeight = scale;
this.scaleWidth = scale;
super.preRender(poseStack, entity, model, bufferSource, buffer, isReRender, partialTick, packedLight, packedOverlay, color);
}
@Override
public void render(Agm65Entity entityIn, float entityYaw, float partialTicks, PoseStack poseStack, @NotNull MultiBufferSource bufferIn, int packedLightIn) {
poseStack.pushPose();
poseStack.mulPose(Axis.YP.rotationDegrees(Mth.lerp(partialTicks, entityIn.yRotO, entityIn.getYRot()) - 90));
poseStack.mulPose(Axis.ZP.rotationDegrees(90 + Mth.lerp(partialTicks, entityIn.xRotO, entityIn.getXRot())));
super.render(entityIn, entityYaw, partialTicks, poseStack, bufferIn, packedLightIn);
poseStack.popPose();
}
}

View file

@ -80,6 +80,7 @@ public class ModItemModelProvider extends ItemModelProvider {
simpleItem(ModItems.HEAVY_AMMO); simpleItem(ModItems.HEAVY_AMMO);
simpleItem(ModItems.ROCKET_70); simpleItem(ModItems.ROCKET_70);
simpleItem(ModItems.WIRE_GUIDE_MISSILE); simpleItem(ModItems.WIRE_GUIDE_MISSILE);
simpleItem(ModItems.AGM);
simpleItem(ModItems.SMALL_SHELL); simpleItem(ModItems.SMALL_SHELL);
simpleItem(ModItems.SWARM_DRONE); simpleItem(ModItems.SWARM_DRONE);
simpleItem(ModItems.MEDIUM_AERIAL_BOMB); simpleItem(ModItems.MEDIUM_AERIAL_BOMB);

View file

@ -0,0 +1,306 @@
package com.atsuishio.superbwarfare.entity.projectile;
import com.atsuishio.superbwarfare.config.server.ExplosionConfig;
import com.atsuishio.superbwarfare.entity.LoudlyEntity;
import com.atsuishio.superbwarfare.entity.vehicle.base.VehicleEntity;
import com.atsuishio.superbwarfare.init.ModDamageTypes;
import com.atsuishio.superbwarfare.init.ModEntities;
import com.atsuishio.superbwarfare.init.ModItems;
import com.atsuishio.superbwarfare.init.ModSounds;
import com.atsuishio.superbwarfare.network.message.receive.ClientIndicatorMessage;
import com.atsuishio.superbwarfare.tools.*;
import net.minecraft.core.BlockPos;
import net.minecraft.core.particles.ParticleTypes;
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.server.level.ServerLevel;
import net.minecraft.server.level.ServerPlayer;
import net.minecraft.sounds.SoundEvent;
import net.minecraft.sounds.SoundEvents;
import net.minecraft.sounds.SoundSource;
import net.minecraft.world.damagesource.DamageSource;
import net.minecraft.world.damagesource.DamageTypes;
import net.minecraft.world.entity.AreaEffectCloud;
import net.minecraft.world.entity.Entity;
import net.minecraft.world.entity.EntityType;
import net.minecraft.world.entity.LivingEntity;
import net.minecraft.world.entity.animal.Pig;
import net.minecraft.world.entity.boss.enderdragon.EnderDragon;
import net.minecraft.world.entity.projectile.ThrownPotion;
import net.minecraft.world.item.Item;
import net.minecraft.world.level.Explosion;
import net.minecraft.world.level.Level;
import net.minecraft.world.level.block.BellBlock;
import net.minecraft.world.level.block.state.BlockState;
import net.minecraft.world.phys.BlockHitResult;
import net.minecraft.world.phys.EntityHitResult;
import net.minecraft.world.phys.HitResult;
import net.minecraft.world.phys.Vec3;
import net.neoforged.neoforge.event.EventHooks;
import net.neoforged.neoforge.network.PacketDistributor;
import org.jetbrains.annotations.NotNull;
import software.bernie.geckolib.animatable.GeoEntity;
import software.bernie.geckolib.animatable.instance.AnimatableInstanceCache;
import software.bernie.geckolib.animation.*;
import software.bernie.geckolib.util.GeckoLibUtil;
import java.util.List;
public class Agm65Entity extends FastThrowableProjectile implements GeoEntity, DestroyableProjectileEntity, LoudlyEntity {
public static final EntityDataAccessor<Float> HEALTH = SynchedEntityData.defineId(Agm65Entity.class, EntityDataSerializers.FLOAT);
public static final EntityDataAccessor<String> TARGET_UUID = SynchedEntityData.defineId(Agm65Entity.class, EntityDataSerializers.STRING);
private final AnimatableInstanceCache cache = GeckoLibUtil.createInstanceCache(this);
private float damage = 1000.0f;
private float explosion_damage = 150f;
private float explosion_radius = 11f;
private boolean distracted = false;
public Agm65Entity(EntityType<? extends Agm65Entity> type, Level world) {
super(type, world);
this.noCulling = true;
}
public Agm65Entity(LivingEntity entity, Level level, float damage, float explosion_damage, float explosion_radius) {
super(ModEntities.AGM_65.get(), entity, level);
this.damage = damage;
this.explosion_damage = explosion_damage;
this.explosion_radius = explosion_radius;
}
public void setTargetUuid(String uuid) {
this.entityData.set(TARGET_UUID, uuid);
}
@Override
protected @NotNull Item getDefaultItem() {
return ModItems.JAVELIN_MISSILE.get();
}
@Override
public boolean hurt(DamageSource source, float amount) {
if (source.getDirectEntity() instanceof ThrownPotion || source.getDirectEntity() instanceof AreaEffectCloud)
return false;
if (source.is(DamageTypes.FALL))
return false;
if (source.is(DamageTypes.CACTUS))
return false;
if (source.is(DamageTypes.DROWN))
return false;
if (source.is(DamageTypes.DRAGON_BREATH))
return false;
if (source.is(DamageTypes.WITHER))
return false;
if (source.is(DamageTypes.WITHER_SKULL))
return false;
this.entityData.set(HEALTH, this.entityData.get(HEALTH) - amount);
return super.hurt(source, amount);
}
@Override
protected void defineSynchedData(SynchedEntityData.@NotNull Builder builder) {
super.defineSynchedData(builder);
builder.define(HEALTH, 30f)
.define(TARGET_UUID, "none");
}
@Override
public boolean isPickable() {
return !this.isRemoved();
}
@Override
public void readAdditionalSaveData(@NotNull CompoundTag compound) {
super.readAdditionalSaveData(compound);
if (compound.contains("Health")) {
this.entityData.set(HEALTH, compound.getFloat("Health"));
}
}
@Override
public void addAdditionalSaveData(@NotNull CompoundTag compound) {
super.addAdditionalSaveData(compound);
compound.putFloat("Health", this.entityData.get(HEALTH));
}
@Override
public boolean shouldRenderAtSqrDistance(double pDistance) {
return true;
}
@Override
protected void onHitEntity(EntityHitResult result) {
Entity entity = result.getEntity();
if (this.level() instanceof ServerLevel && tickCount > 8) {
if (entity == this.getOwner() || (this.getOwner() != null && entity == this.getOwner().getVehicle()))
return;
if (this.getOwner() instanceof LivingEntity living) {
if (!living.level().isClientSide() && living instanceof ServerPlayer player) {
living.level().playSound(null, living.blockPosition(), ModSounds.INDICATION.get(), SoundSource.VOICE, 1, 1);
PacketDistributor.sendToPlayer(player, new ClientIndicatorMessage(0, 5));
}
}
entity.hurt(ModDamageTypes.causeCannonFireDamage(this.level().registryAccess(), this, this.getOwner()), this.damage);
if (entity instanceof LivingEntity) {
entity.invulnerableTime = 0;
}
causeExplode(result);
this.discard();
}
}
@Override
public boolean isNoGravity() {
return true;
}
@Override
public void onHitBlock(@NotNull BlockHitResult blockHitResult) {
super.onHitBlock(blockHitResult);
BlockPos resultPos = blockHitResult.getBlockPos();
BlockState state = this.level().getBlockState(resultPos);
if (state.getBlock() instanceof BellBlock bell) {
bell.attemptToRing(this.level(), resultPos, blockHitResult.getDirection());
}
if (this.tickCount > 8) {
if (this.level() instanceof ServerLevel) {
causeExplode(blockHitResult);
}
}
this.discard();
}
@Override
public void tick() {
super.tick();
Entity entity = EntityFindUtil.findEntity(this.level(), entityData.get(TARGET_UUID));
List<Entity> decoy = SeekTool.seekLivingEntities(this, this.level(), 32, 90);
for (var e : decoy) {
if (e instanceof DecoyEntity decoyEntity && !distracted) {
this.entityData.set(TARGET_UUID, decoyEntity.getDecoyUUID());
distracted = true;
}
}
if (!entityData.get(TARGET_UUID).equals("none")) {
if (entity != null) {
if (entity.level() instanceof ServerLevel) {
if ((!entity.getPassengers().isEmpty() || entity instanceof VehicleEntity) && entity.tickCount % ((int) Math.max(0.04 * this.distanceTo(entity), 2)) == 0) {
entity.level().playSound(null, entity.getOnPos(), entity instanceof Pig ? SoundEvents.PIG_HURT : ModSounds.MISSILE_WARNING.get(), SoundSource.PLAYERS, 2, 1f);
}
Vec3 targetPos = new Vec3(entity.getX(), entity.getEyeY() + (entity instanceof EnderDragon ? -3 : 0), entity.getZ()).add(entity.getDeltaMovement());
Vec3 toVec = getEyePosition().vectorTo(targetPos).normalize();
if (this.tickCount > 8) {
boolean lostTarget = (VectorTool.calculateAngle(getDeltaMovement(), toVec) > 80);
if (!lostTarget) {
setDeltaMovement(getDeltaMovement().add(toVec.scale(1)).scale(0.87));
}
}
}
}
}
if (this.tickCount == 8) {
this.level().playSound(null, BlockPos.containing(position()), ModSounds.MISSILE_START.get(), SoundSource.PLAYERS, 4, 1);
if (!this.level().isClientSide() && this.level() instanceof ServerLevel serverLevel) {
ParticleTool.sendParticle(serverLevel, ParticleTypes.CLOUD, this.xo, this.yo, this.zo, 15, 0.8, 0.8, 0.8, 0.01, true);
ParticleTool.sendParticle(serverLevel, ParticleTypes.CAMPFIRE_COSY_SMOKE, this.xo, this.yo, this.zo, 10, 0.8, 0.8, 0.8, 0.01, true);
}
}
if (this.tickCount > 8) {
if (!this.level().isClientSide() && this.level() instanceof ServerLevel serverLevel) {
ParticleTool.sendParticle(serverLevel, ParticleTypes.CAMPFIRE_COSY_SMOKE, this.xo, this.yo, this.zo, 1, 0, 0, 0, 0, true);
}
}
if (this.tickCount > 200 || this.isInWater() || this.entityData.get(HEALTH) <= 0) {
if (this.level() instanceof ServerLevel) {
ProjectileTool.causeCustomExplode(this,
ModDamageTypes.causeProjectileBoomDamage(this.level().registryAccess(), this, this.getOwner()),
this, this.explosion_damage, this.explosion_radius, 1);
}
this.discard();
}
// 控制速度
if (this.getDeltaMovement().length() < 6) {
this.setDeltaMovement(this.getDeltaMovement().multiply(1.06, 1.06, 1.06));
}
if (this.getDeltaMovement().length() > 7) {
this.setDeltaMovement(this.getDeltaMovement().multiply(0.95, 0.95, 0.95));
}
this.setDeltaMovement(this.getDeltaMovement().multiply(0.99, 0.99, 0.99));
}
private void causeExplode(HitResult result) {
CustomExplosion explosion = new CustomExplosion(this.level(), this,
ModDamageTypes.causeProjectileBoomDamage(this.level().registryAccess(),
this,
this.getOwner()),
explosion_damage,
this.getX(),
this.getEyeY(),
this.getZ(),
explosion_radius,
ExplosionConfig.EXPLOSION_DESTROY.get() ? Explosion.BlockInteraction.DESTROY : Explosion.BlockInteraction.KEEP, true).
setDamageMultiplier(1);
explosion.explode();
EventHooks.onExplosionStart(this.level(), explosion);
explosion.finalizeExplosion(false);
ParticleTool.spawnHugeExplosionParticles(this.level(), result.getLocation());
}
private PlayState movementPredicate(AnimationState<Agm65Entity> event) {
return event.setAndContinue(RawAnimation.begin().thenLoop("animation.jvm.idle"));
}
@Override
protected double getDefaultGravity() {
return 0.1;
}
@Override
public void registerControllers(AnimatableManager.ControllerRegistrar data) {
data.add(new AnimationController<>(this, "movement", 0, this::movementPredicate));
}
@Override
public AnimatableInstanceCache getAnimatableInstanceCache() {
return this.cache;
}
@Override
public boolean shouldSyncMotion() {
return true;
}
@Override
public @NotNull SoundEvent getCloseSound() {
return ModSounds.ROCKET_ENGINE.get();
}
@Override
public @NotNull SoundEvent getSound() {
return ModSounds.ROCKET_FLY.get();
}
@Override
public float getVolume() {
return 0.7f;
}
}

View file

@ -347,7 +347,7 @@ public class JavelinMissileEntity extends FastThrowableProjectile implements Geo
explosion.explode(); explosion.explode();
EventHooks.onExplosionStart(this.level(), explosion); EventHooks.onExplosionStart(this.level(), explosion);
explosion.finalizeExplosion(false); explosion.finalizeExplosion(false);
ParticleTool.spawnSmallExplosionParticles(this.level(), result.getLocation()); ParticleTool.spawnMediumExplosionParticles(this.level(), result.getLocation());
} }
private PlayState movementPredicate(AnimationState<JavelinMissileEntity> event) { private PlayState movementPredicate(AnimationState<JavelinMissileEntity> event) {
@ -375,12 +375,12 @@ public class JavelinMissileEntity extends FastThrowableProjectile implements Geo
} }
@Override @Override
public SoundEvent getCloseSound() { public @NotNull SoundEvent getCloseSound() {
return ModSounds.ROCKET_ENGINE.get(); return ModSounds.ROCKET_ENGINE.get();
} }
@Override @Override
public SoundEvent getSound() { public @NotNull SoundEvent getSound() {
return ModSounds.ROCKET_FLY.get(); return ModSounds.ROCKET_FLY.get();
} }

View file

@ -10,7 +10,6 @@ import net.minecraft.network.syncher.EntityDataAccessor;
import net.minecraft.network.syncher.EntityDataSerializers; import net.minecraft.network.syncher.EntityDataSerializers;
import net.minecraft.network.syncher.SynchedEntityData; import net.minecraft.network.syncher.SynchedEntityData;
import net.minecraft.sounds.SoundEvent; import net.minecraft.sounds.SoundEvent;
import net.minecraft.sounds.SoundEvents;
import net.minecraft.world.damagesource.DamageSource; import net.minecraft.world.damagesource.DamageSource;
import net.minecraft.world.damagesource.DamageTypes; import net.minecraft.world.damagesource.DamageTypes;
import net.minecraft.world.entity.AreaEffectCloud; import net.minecraft.world.entity.AreaEffectCloud;
@ -30,8 +29,8 @@ import software.bernie.geckolib.util.GeckoLibUtil;
public class Mk82Entity extends FastThrowableProjectile implements GeoEntity, DestroyableProjectileEntity, LoudlyEntity, AerialBombEntity { public class Mk82Entity extends FastThrowableProjectile implements GeoEntity, DestroyableProjectileEntity, LoudlyEntity, AerialBombEntity {
public static final EntityDataAccessor<Float> HEALTH = SynchedEntityData.defineId(Mk82Entity.class, EntityDataSerializers.FLOAT); public static final EntityDataAccessor<Float> HEALTH = SynchedEntityData.defineId(Mk82Entity.class, EntityDataSerializers.FLOAT);
private final AnimatableInstanceCache cache = GeckoLibUtil.createInstanceCache(this); private final AnimatableInstanceCache cache = GeckoLibUtil.createInstanceCache(this);
private float explosion_damage = 500f; private float explosion_damage = 520f;
private float explosion_radius = 12f; private float explosion_radius = 14f;
public Mk82Entity(EntityType<? extends Mk82Entity> type, Level world) { public Mk82Entity(EntityType<? extends Mk82Entity> type, Level world) {
super(type, world); super(type, world);
@ -89,7 +88,7 @@ public class Mk82Entity extends FastThrowableProjectile implements GeoEntity, De
} }
@Override @Override
public void readAdditionalSaveData(CompoundTag compound) { public void readAdditionalSaveData(@NotNull CompoundTag compound) {
super.readAdditionalSaveData(compound); super.readAdditionalSaveData(compound);
if (compound.contains("Health")) { if (compound.contains("Health")) {
this.entityData.set(HEALTH, compound.getFloat("Health")); this.entityData.set(HEALTH, compound.getFloat("Health"));
@ -97,7 +96,7 @@ public class Mk82Entity extends FastThrowableProjectile implements GeoEntity, De
} }
@Override @Override
public void addAdditionalSaveData(CompoundTag compound) { public void addAdditionalSaveData(@NotNull CompoundTag compound) {
super.addAdditionalSaveData(compound); super.addAdditionalSaveData(compound);
compound.putFloat("Health", this.entityData.get(HEALTH)); compound.putFloat("Health", this.entityData.get(HEALTH));
} }
@ -108,7 +107,7 @@ public class Mk82Entity extends FastThrowableProjectile implements GeoEntity, De
} }
@Override @Override
public void onHitBlock(BlockHitResult blockHitResult) { public void onHitBlock(@NotNull BlockHitResult blockHitResult) {
super.onHitBlock(blockHitResult); super.onHitBlock(blockHitResult);
ProjectileTool.causeCustomExplode(this, explosion_damage, explosion_radius, 1.2f); ProjectileTool.causeCustomExplode(this, explosion_damage, explosion_radius, 1.2f);
this.discard(); this.discard();
@ -149,7 +148,7 @@ public class Mk82Entity extends FastThrowableProjectile implements GeoEntity, De
@Override @Override
public @NotNull SoundEvent getCloseSound() { public @NotNull SoundEvent getCloseSound() {
return SoundEvents.EMPTY; return LoudlyEntity.super.getCloseSound();
} }
@Override @Override

View file

@ -3,29 +3,23 @@ package com.atsuishio.superbwarfare.entity.vehicle;
import com.atsuishio.superbwarfare.Mod; import com.atsuishio.superbwarfare.Mod;
import com.atsuishio.superbwarfare.config.server.ExplosionConfig; import com.atsuishio.superbwarfare.config.server.ExplosionConfig;
import com.atsuishio.superbwarfare.config.server.VehicleConfig; import com.atsuishio.superbwarfare.config.server.VehicleConfig;
import com.atsuishio.superbwarfare.entity.projectile.AerialBombEntity;
import com.atsuishio.superbwarfare.entity.projectile.GunGrenadeEntity; import com.atsuishio.superbwarfare.entity.projectile.GunGrenadeEntity;
import com.atsuishio.superbwarfare.entity.projectile.MortarShellEntity; import com.atsuishio.superbwarfare.entity.projectile.MortarShellEntity;
import com.atsuishio.superbwarfare.entity.vehicle.base.*; import com.atsuishio.superbwarfare.entity.vehicle.base.*;
import com.atsuishio.superbwarfare.entity.vehicle.damage.DamageModifier; import com.atsuishio.superbwarfare.entity.vehicle.damage.DamageModifier;
import com.atsuishio.superbwarfare.entity.vehicle.weapon.HeliRocketWeapon; import com.atsuishio.superbwarfare.entity.vehicle.weapon.*;
import com.atsuishio.superbwarfare.entity.vehicle.weapon.Mk82Weapon;
import com.atsuishio.superbwarfare.entity.vehicle.weapon.SmallCannonShellWeapon;
import com.atsuishio.superbwarfare.entity.vehicle.weapon.VehicleWeapon;
import com.atsuishio.superbwarfare.init.ModDamageTypes; import com.atsuishio.superbwarfare.init.ModDamageTypes;
import com.atsuishio.superbwarfare.init.ModItems; import com.atsuishio.superbwarfare.init.ModItems;
import com.atsuishio.superbwarfare.init.ModSounds; import com.atsuishio.superbwarfare.init.ModSounds;
import com.atsuishio.superbwarfare.init.ModTags; import com.atsuishio.superbwarfare.init.ModTags;
import com.atsuishio.superbwarfare.network.message.receive.ShakeClientMessage; import com.atsuishio.superbwarfare.network.message.receive.ShakeClientMessage;
import com.atsuishio.superbwarfare.tools.CustomExplosion; import com.atsuishio.superbwarfare.tools.*;
import com.atsuishio.superbwarfare.tools.EntityFindUtil;
import com.atsuishio.superbwarfare.tools.InventoryTool;
import com.atsuishio.superbwarfare.tools.ParticleTool;
import com.mojang.math.Axis; import com.mojang.math.Axis;
import net.minecraft.core.BlockPos; import net.minecraft.core.BlockPos;
import net.minecraft.core.Direction; import net.minecraft.core.Direction;
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.protocol.game.ClientboundStopSoundPacket;
import net.minecraft.network.syncher.EntityDataAccessor; import net.minecraft.network.syncher.EntityDataAccessor;
import net.minecraft.network.syncher.EntityDataSerializers; import net.minecraft.network.syncher.EntityDataSerializers;
import net.minecraft.network.syncher.SynchedEntityData; import net.minecraft.network.syncher.SynchedEntityData;
@ -63,13 +57,24 @@ import static com.atsuishio.superbwarfare.tools.ParticleTool.sendParticle;
public class A10Entity extends ContainerMobileVehicleEntity implements GeoEntity, WeaponVehicleEntity, AircraftEntity { public class A10Entity extends ContainerMobileVehicleEntity implements GeoEntity, WeaponVehicleEntity, AircraftEntity {
public static final EntityDataAccessor<Integer> LOADED_ROCKET = SynchedEntityData.defineId(A10Entity.class, EntityDataSerializers.INT); public static final EntityDataAccessor<Integer> LOADED_ROCKET = SynchedEntityData.defineId(A10Entity.class, EntityDataSerializers.INT);
public static final EntityDataAccessor<Integer> LOADED_BOMB = SynchedEntityData.defineId(A10Entity.class, EntityDataSerializers.INT); public static final EntityDataAccessor<Integer> LOADED_BOMB = SynchedEntityData.defineId(A10Entity.class, EntityDataSerializers.INT);
public static final EntityDataAccessor<Integer> LOADED_MISSILE = SynchedEntityData.defineId(A10Entity.class, EntityDataSerializers.INT);
public static final EntityDataAccessor<Integer> FIRE_TIME = SynchedEntityData.defineId(A10Entity.class, EntityDataSerializers.INT); public static final EntityDataAccessor<Integer> FIRE_TIME = SynchedEntityData.defineId(A10Entity.class, EntityDataSerializers.INT);
public static final EntityDataAccessor<String> TARGET_UUID = SynchedEntityData.defineId(A10Entity.class, EntityDataSerializers.STRING);
private final AnimatableInstanceCache cache = GeckoLibUtil.createInstanceCache(this); private final AnimatableInstanceCache cache = GeckoLibUtil.createInstanceCache(this);
private float yRotSync; private float yRotSync;
private boolean fly; private boolean fly;
private int flyTime; private int flyTime;
public int fireIndex; public int fireIndex;
public int reloadCoolDownBomb; public int reloadCoolDownBomb;
public int reloadCoolDownMissile;
public String lockingTargetO = "none";
public String lockingTarget = "none";
public String test;
public int lockTime;
public boolean locking;
public boolean locked;
public A10Entity(EntityType<A10Entity> type, Level world) { public A10Entity(EntityType<A10Entity> type, Level world) {
super(type, world); super(type, world);
@ -96,8 +101,13 @@ public class A10Entity extends ContainerMobileVehicleEntity implements GeoEntity
.explosionRadius(VehicleConfig.AH_6_ROCKET_EXPLOSION_RADIUS.get()) .explosionRadius(VehicleConfig.AH_6_ROCKET_EXPLOSION_RADIUS.get())
.sound(ModSounds.INTO_MISSILE.get()), .sound(ModSounds.INTO_MISSILE.get()),
new Mk82Weapon() new Mk82Weapon()
.explosionDamage(500) .explosionDamage(520)
.explosionRadius(12) .explosionRadius(14)
.sound(ModSounds.INTO_MISSILE.get()),
new Agm65Weapon()
.damage(1000)
.explosionDamage(150)
.explosionRadius(11)
.sound(ModSounds.INTO_MISSILE.get()), .sound(ModSounds.INTO_MISSILE.get()),
} }
}; };
@ -113,7 +123,9 @@ public class A10Entity extends ContainerMobileVehicleEntity implements GeoEntity
super.defineSynchedData(builder); super.defineSynchedData(builder);
builder.define(LOADED_ROCKET, 0) builder.define(LOADED_ROCKET, 0)
.define(LOADED_BOMB, 0) .define(LOADED_BOMB, 0)
.define(FIRE_TIME, 0); .define(LOADED_MISSILE, 0)
.define(FIRE_TIME, 0)
.define(TARGET_UUID, "none");
} }
@Override @Override
@ -121,6 +133,7 @@ public class A10Entity extends ContainerMobileVehicleEntity implements GeoEntity
super.addAdditionalSaveData(compound); super.addAdditionalSaveData(compound);
compound.putInt("LoadedRocket", this.entityData.get(LOADED_ROCKET)); compound.putInt("LoadedRocket", this.entityData.get(LOADED_ROCKET));
compound.putInt("LoadedBomb", this.entityData.get(LOADED_BOMB)); compound.putInt("LoadedBomb", this.entityData.get(LOADED_BOMB));
compound.putInt("LoadedMissile", this.entityData.get(LOADED_MISSILE));
} }
@Override @Override
@ -128,6 +141,7 @@ public class A10Entity extends ContainerMobileVehicleEntity implements GeoEntity
super.readAdditionalSaveData(compound); super.readAdditionalSaveData(compound);
this.entityData.set(LOADED_ROCKET, compound.getInt("LoadedRocket")); this.entityData.set(LOADED_ROCKET, compound.getInt("LoadedRocket"));
this.entityData.set(LOADED_BOMB, compound.getInt("LoadedBomb")); this.entityData.set(LOADED_BOMB, compound.getInt("LoadedBomb"));
this.entityData.set(LOADED_MISSILE, compound.getInt("LoadedMissile"));
} }
@Override @Override
@ -161,9 +175,6 @@ public class A10Entity extends ContainerMobileVehicleEntity implements GeoEntity
.multiply(15f, ModDamageTypes.VEHICLE_STRIKE) .multiply(15f, ModDamageTypes.VEHICLE_STRIKE)
.custom((source, damage) -> getSourceAngle(source, 0.25f) * damage) .custom((source, damage) -> getSourceAngle(source, 0.25f) * damage)
.custom((source, damage) -> { .custom((source, damage) -> {
if (source.getDirectEntity() instanceof AerialBombEntity) {
return 3f * damage;
}
if (source.getDirectEntity() instanceof MortarShellEntity) { if (source.getDirectEntity() instanceof MortarShellEntity) {
return 1.25f * damage; return 1.25f * damage;
} }
@ -177,6 +188,9 @@ public class A10Entity extends ContainerMobileVehicleEntity implements GeoEntity
@Override @Override
public void baseTick() { public void baseTick() {
lockingTargetO = getTargetUuid();
super.baseTick(); super.baseTick();
float f; float f;
@ -201,6 +215,9 @@ public class A10Entity extends ContainerMobileVehicleEntity implements GeoEntity
if (reloadCoolDownBomb > 0) { if (reloadCoolDownBomb > 0) {
reloadCoolDownBomb--; reloadCoolDownBomb--;
} }
if (reloadCoolDownMissile > 0) {
reloadCoolDownMissile--;
}
handleAmmo(); handleAmmo();
} }
@ -224,6 +241,12 @@ public class A10Entity extends ContainerMobileVehicleEntity implements GeoEntity
if (entityData.get(FIRE_TIME) > 0) { if (entityData.get(FIRE_TIME) > 0) {
entityData.set(FIRE_TIME, entityData.get(FIRE_TIME) - 1); entityData.set(FIRE_TIME, entityData.get(FIRE_TIME) - 1);
} }
if (this.getWeaponIndex(0) == 3) {
seekTarget();
}
releaseDecoy();
this.refreshDimensions(); this.refreshDimensions();
} }
@ -243,22 +266,86 @@ public class A10Entity extends ContainerMobileVehicleEntity implements GeoEntity
if ((hasItem(ModItems.MEDIUM_AERIAL_BOMB.get()) || hasCreativeAmmoBox) && reloadCoolDownBomb == 0 && this.getEntityData().get(LOADED_BOMB) < 3) { if ((hasItem(ModItems.MEDIUM_AERIAL_BOMB.get()) || hasCreativeAmmoBox) && reloadCoolDownBomb == 0 && this.getEntityData().get(LOADED_BOMB) < 3) {
this.entityData.set(LOADED_BOMB, this.getEntityData().get(LOADED_BOMB) + 1); this.entityData.set(LOADED_BOMB, this.getEntityData().get(LOADED_BOMB) + 1);
reloadCoolDownBomb = 200; reloadCoolDownBomb = 300;
if (!hasCreativeAmmoBox) { if (!hasCreativeAmmoBox) {
this.getItemStacks().stream().filter(stack -> stack.is(ModItems.MEDIUM_AERIAL_BOMB.get())).findFirst().ifPresent(stack -> stack.shrink(1)); this.getItemStacks().stream().filter(stack -> stack.is(ModItems.MEDIUM_AERIAL_BOMB.get())).findFirst().ifPresent(stack -> stack.shrink(1));
} }
this.level().playSound(null, this, ModSounds.BOMB_RELOAD.get(), this.getSoundSource(), 2, 1); this.level().playSound(null, this, ModSounds.BOMB_RELOAD.get(), this.getSoundSource(), 2, 1);
} }
if ((hasItem(ModItems.AGM.get()) || hasCreativeAmmoBox) && reloadCoolDownMissile == 0 && this.getEntityData().get(LOADED_MISSILE) < 4) {
this.entityData.set(LOADED_MISSILE, this.getEntityData().get(LOADED_MISSILE) + 1);
reloadCoolDownMissile = 400;
if (!hasCreativeAmmoBox) {
this.getItemStacks().stream().filter(stack -> stack.is(ModItems.AGM.get())).findFirst().ifPresent(stack -> stack.shrink(1));
}
this.level().playSound(null, this, ModSounds.BOMB_RELOAD.get(), this.getSoundSource(), 2, 1);
}
if (this.getWeaponIndex(0) == 0) { if (this.getWeaponIndex(0) == 0) {
this.entityData.set(AMMO, ammoCount); this.entityData.set(AMMO, ammoCount);
} else if (this.getWeaponIndex(0) == 1) { } else if (this.getWeaponIndex(0) == 1) {
this.entityData.set(AMMO, this.getEntityData().get(LOADED_ROCKET)); this.entityData.set(AMMO, this.getEntityData().get(LOADED_ROCKET));
} else { } else if (this.getWeaponIndex(0) == 2) {
this.entityData.set(AMMO, this.getEntityData().get(LOADED_BOMB)); this.entityData.set(AMMO, this.getEntityData().get(LOADED_BOMB));
} else if (this.getWeaponIndex(0) == 3) {
this.entityData.set(AMMO, this.getEntityData().get(LOADED_MISSILE));
} }
} }
public void seekTarget() {
if (!(this.getFirstPassenger() instanceof Player player)) return;
if (getTargetUuid().equals(lockingTargetO) && !getTargetUuid().equals("none")) {
lockTime++;
} else {
resetSeek(player);
}
Entity entity = SeekTool.seekCustomSizeEntitiy(this, this.level(), 384, 20, 0.9);
if (entity != null) {
if (lockTime == 0) {
setTargetUuid(String.valueOf(entity.getUUID()));
}
if (!String.valueOf(entity.getUUID()).equals(getTargetUuid())) {
resetSeek(player);
setTargetUuid(String.valueOf(entity.getUUID()));
}
} else {
setTargetUuid("none");
}
if (lockTime == 1) {
if (player instanceof ServerPlayer serverPlayer) {
SoundTool.playLocalSound(serverPlayer, ModSounds.JET_LOCK.get(), 2, 1);
}
}
if (lockTime > 20) {
if (player instanceof ServerPlayer serverPlayer) {
SoundTool.playLocalSound(serverPlayer, ModSounds.JET_LOCKON.get(), 2, 1);
}
locked = true;
}
}
public void resetSeek(Player player) {
lockTime = 0;
locked = false;
if (player instanceof ServerPlayer serverPlayer) {
var clientboundstopsoundpacket = new ClientboundStopSoundPacket(Mod.loc("jet_lock"), SoundSource.PLAYERS);
serverPlayer.connection.send(clientboundstopsoundpacket);
}
}
public void setTargetUuid(String uuid) {
this.lockingTarget = uuid;
}
public String getTargetUuid() {
return this.lockingTarget;
}
@Override @Override
public void travel() { public void travel() {
Entity passenger = this.getFirstPassenger(); Entity passenger = this.getFirstPassenger();
@ -284,7 +371,7 @@ public class A10Entity extends ContainerMobileVehicleEntity implements GeoEntity
} }
if (backInputDown) { if (backInputDown) {
this.entityData.set(POWER, Math.max(this.entityData.get(POWER) - 0.002f, onGround() ? -0.005f : 0.01f)); this.entityData.set(POWER, Math.max(this.entityData.get(POWER) - 0.002f, onGround() ? -0.04f : 0.05f));
} }
if (!onGround()) { if (!onGround()) {
@ -297,7 +384,7 @@ public class A10Entity extends ContainerMobileVehicleEntity implements GeoEntity
// 刹车 // 刹车
if (upInputDown) { if (upInputDown) {
this.entityData.set(POWER, this.entityData.get(POWER) * 0.8f); this.entityData.set(POWER, this.entityData.get(POWER) * 0.8f);
this.setDeltaMovement(this.getDeltaMovement().multiply(0.91, 1, 0.91)); this.setDeltaMovement(this.getDeltaMovement().multiply(0.98, 1, 0.98));
} }
} }
@ -481,16 +568,10 @@ public class A10Entity extends ContainerMobileVehicleEntity implements GeoEntity
@Override @Override
public Vec3 driverZoomPos(float ticks) { public Vec3 driverZoomPos(float ticks) {
if (getWeaponIndex(0) == 2) {
Matrix4f transform = getVehicleTransform(ticks);
Vector4f worldPosition = transformPosition(transform, 0, -0.75f, 7f);
return new Vec3(worldPosition.x, worldPosition.y, worldPosition.z);
} else {
Matrix4f transform = getVehicleTransform(ticks); Matrix4f transform = getVehicleTransform(ticks);
Vector4f worldPosition = transformPosition(transform, 0, 1.35f, 4.15f); Vector4f worldPosition = transformPosition(transform, 0, 1.35f, 4.15f);
return new Vec3(worldPosition.x, worldPosition.y, worldPosition.z); return new Vec3(worldPosition.x, worldPosition.y, worldPosition.z);
} }
}
public void copyEntityData(Entity entity) { public void copyEntityData(Entity entity) {
float i = getXRot() / 90; float i = getXRot() / 90;
@ -676,11 +757,11 @@ public class A10Entity extends ContainerMobileVehicleEntity implements GeoEntity
Vector4f worldPosition; Vector4f worldPosition;
if (this.getEntityData().get(LOADED_BOMB) == 3) { if (this.getEntityData().get(LOADED_BOMB) == 3) {
worldPosition = transformPosition(transform, -0.55625f, -1.203125f, 0.0625f); worldPosition = transformPosition(transform, 0.55625f, -1.203125f, 0.0625f);
} else if (this.getEntityData().get(LOADED_BOMB) == 2) { } else if (this.getEntityData().get(LOADED_BOMB) == 2) {
worldPosition = transformPosition(transform, 0f, -1.203125f, 0.0625f); worldPosition = transformPosition(transform, 0f, -1.203125f, 0.0625f);
} else { } else {
worldPosition = transformPosition(transform, 0.55625f, -1.203125f, 0.0625f); worldPosition = transformPosition(transform, -0.55625f, -1.203125f, 0.0625f);
} }
Mk82Entity.setPos(worldPosition.x, worldPosition.y, worldPosition.z); Mk82Entity.setPos(worldPosition.x, worldPosition.y, worldPosition.z);
@ -692,10 +773,41 @@ public class A10Entity extends ContainerMobileVehicleEntity implements GeoEntity
this.level().playSound(null, pos, ModSounds.BOMB_RELEASE.get(), SoundSource.PLAYERS, 3, 1); this.level().playSound(null, pos, ModSounds.BOMB_RELEASE.get(), SoundSource.PLAYERS, 3, 1);
if (this.getEntityData().get(LOADED_BOMB) == 3) { if (this.getEntityData().get(LOADED_BOMB) == 3) {
reloadCoolDownBomb = 200; reloadCoolDownBomb = 300;
}
this.entityData.set(LOADED_BOMB, this.getEntityData().get(LOADED_BOMB) - 1);
} else if (getWeaponIndex(0) == 3 && this.getEntityData().get(LOADED_MISSILE) > 0) {
var Agm65Entity = ((Agm65Weapon) getWeapon(0)).create(player);
Vector4f worldPosition;
if (this.getEntityData().get(LOADED_MISSILE) == 4) {
worldPosition = transformPosition(transform, 1.56875f, -0.943f, 0.1272f);
} else if (this.getEntityData().get(LOADED_MISSILE) == 3) {
worldPosition = transformPosition(transform, -1.56875f, -0.943f, 0.1272f);
} else if (this.getEntityData().get(LOADED_MISSILE) == 2) {
worldPosition = transformPosition(transform, 3.9321875f, -0.88680625f, 0.12965f);
} else {
worldPosition = transformPosition(transform, -3.9321875f, -0.88680625f, 0.12965f);
} }
this.entityData.set(LOADED_BOMB, this.getEntityData().get(LOADED_BOMB) - 1); if (locked) {
Agm65Entity.setTargetUuid(getTargetUuid());
}
Agm65Entity.setPos(worldPosition.x, worldPosition.y, worldPosition.z);
Agm65Entity.shoot(getDeltaMovement().x, getDeltaMovement().y, getDeltaMovement().z, (float) getDeltaMovement().length() * 0.8f, 1);
player.level().addFreshEntity(Agm65Entity);
BlockPos pos = BlockPos.containing(new Vec3(worldPosition.x, worldPosition.y, worldPosition.z));
this.level().playSound(null, pos, ModSounds.BOMB_RELEASE.get(), SoundSource.PLAYERS, 3, 1);
if (this.getEntityData().get(LOADED_MISSILE) == 3) {
reloadCoolDownMissile = 400;
}
this.entityData.set(LOADED_MISSILE, this.getEntityData().get(LOADED_MISSILE) - 1);
} }
} }
@ -712,12 +824,15 @@ public class A10Entity extends ContainerMobileVehicleEntity implements GeoEntity
if (getWeaponIndex(0) == 2) { if (getWeaponIndex(0) == 2) {
return 600; return 600;
} }
if (getWeaponIndex(0) == 3) {
return 120;
}
return 0; return 0;
} }
@Override @Override
public boolean canShoot(Player player) { public boolean canShoot(Player player) {
if (getWeaponIndex(0) == 2) { if (getWeaponIndex(0) == 2 || getWeaponIndex(0) == 3) {
return this.entityData.get(AMMO) > 0; return this.entityData.get(AMMO) > 0;
} }
return false; return false;

View file

@ -296,7 +296,7 @@ public abstract class MobileVehicleEntity extends EnergyVehicleEntity implements
flareDecoyEntity.decoyShoot(this, this.getViewVector(1).yRot((45 + 90 * i) * Mth.DEG_TO_RAD), 0.8f, 8); flareDecoyEntity.decoyShoot(this, this.getViewVector(1).yRot((45 + 90 * i) * Mth.DEG_TO_RAD), 0.8f, 8);
this.level().addFreshEntity(flareDecoyEntity); this.level().addFreshEntity(flareDecoyEntity);
} }
this.level().playSound(null, this, ModSounds.DECOY_FIRE.get(), this.getSoundSource(), 1, 1); this.level().playSound(null, this, ModSounds.DECOY_FIRE.get(), this.getSoundSource(), 2, 1);
if (this.getEntityData().get(DECOY_COUNT) == 4) { if (this.getEntityData().get(DECOY_COUNT) == 4) {
decoyReloadCoolDown = 300; decoyReloadCoolDown = 300;
} }

View file

@ -0,0 +1,32 @@
package com.atsuishio.superbwarfare.entity.vehicle.weapon;
import com.atsuishio.superbwarfare.Mod;
import com.atsuishio.superbwarfare.entity.projectile.Agm65Entity;
import net.minecraft.world.entity.LivingEntity;
public class Agm65Weapon extends VehicleWeapon {
public float damage = 1000, explosionDamage = 150, explosionRadius = 11;
public Agm65Weapon() {
this.icon = Mod.loc("textures/screens/vehicle_weapon/agm_65.png");
}
public Agm65Weapon damage(float damage) {
this.damage = damage;
return this;
}
public Agm65Weapon explosionDamage(float explosionDamage) {
this.explosionDamage = explosionDamage;
return this;
}
public Agm65Weapon explosionRadius(float explosionRadius) {
this.explosionRadius = explosionRadius;
return this;
}
public Agm65Entity create(LivingEntity entity) {
return new Agm65Entity(entity, entity.level(), damage, explosionDamage, explosionRadius);
}
}

View file

@ -6,7 +6,7 @@ import net.minecraft.world.entity.LivingEntity;
public class Mk82Weapon extends VehicleWeapon { public class Mk82Weapon extends VehicleWeapon {
public float explosionDamage = 500, explosionRadius = 12; public float explosionDamage = 520, explosionRadius = 14;
public Mk82Weapon() { public Mk82Weapon() {
this.icon = Mod.loc("textures/screens/vehicle_weapon/mk_82.png"); this.icon = Mod.loc("textures/screens/vehicle_weapon/mk_82.png");

View file

@ -20,6 +20,7 @@ public class ClientSoundHandler {
@SubscribeEvent @SubscribeEvent
public static void handleJoinLevelEvent(EntityJoinLevelEvent event) { public static void handleJoinLevelEvent(EntityJoinLevelEvent event) {
if (event.getLevel().isClientSide) { if (event.getLevel().isClientSide) {
com.atsuishio.superbwarfare.Mod.queueClientWork(60, () -> {
if (event.getEntity() instanceof MobileVehicleEntity mobileVehicle) { if (event.getEntity() instanceof MobileVehicleEntity mobileVehicle) {
Minecraft.getInstance().getSoundManager().play(new VehicleSoundInstance.EngineSound(mobileVehicle, mobileVehicle.getEngineSound())); Minecraft.getInstance().getSoundManager().play(new VehicleSoundInstance.EngineSound(mobileVehicle, mobileVehicle.getEngineSound()));
Minecraft.getInstance().getSoundManager().play(new VehicleSoundInstance.SwimSound(mobileVehicle)); Minecraft.getInstance().getSoundManager().play(new VehicleSoundInstance.SwimSound(mobileVehicle));
@ -37,6 +38,7 @@ public class ClientSoundHandler {
if (event.getEntity() instanceof MobileVehicleEntity mobileVehicle && mobileVehicle instanceof Hpj11Entity) { if (event.getEntity() instanceof MobileVehicleEntity mobileVehicle && mobileVehicle instanceof Hpj11Entity) {
Minecraft.getInstance().getSoundManager().play(new VehicleFireSoundInstance.HPJ11CloseFireSound(mobileVehicle)); Minecraft.getInstance().getSoundManager().play(new VehicleFireSoundInstance.HPJ11CloseFireSound(mobileVehicle));
} }
});
} }
} }
} }

View file

@ -35,7 +35,7 @@ public class ModEntities {
public static final DeferredHolder<EntityType<?>, EntityType<LaserEntity>> LASER = register("laser", public static final DeferredHolder<EntityType<?>, EntityType<LaserEntity>> LASER = register("laser",
EntityType.Builder.<LaserEntity>of(LaserEntity::new, MobCategory.MISC).sized(0.1f, 0.1f).fireImmune().setUpdateInterval(1)); EntityType.Builder.<LaserEntity>of(LaserEntity::new, MobCategory.MISC).sized(0.1f, 0.1f).fireImmune().setUpdateInterval(1));
public static final DeferredHolder<EntityType<?>, EntityType<FlareDecoyEntity>> FLARE_DECOY = register("flare_decoy", public static final DeferredHolder<EntityType<?>, EntityType<FlareDecoyEntity>> FLARE_DECOY = register("flare_decoy",
EntityType.Builder.<FlareDecoyEntity>of(FlareDecoyEntity::new, MobCategory.MISC).setTrackingRange(64).setUpdateInterval(1).sized(0.5f, 0.5f)); EntityType.Builder.<FlareDecoyEntity>of(FlareDecoyEntity::new, MobCategory.MISC).setTrackingRange(64).setUpdateInterval(1).noSave().sized(1, 1));
public static final DeferredHolder<EntityType<?>, EntityType<SmokeDecoyEntity>> SMOKE_DECOY = register("smoke_decoy", public static final DeferredHolder<EntityType<?>, EntityType<SmokeDecoyEntity>> SMOKE_DECOY = register("smoke_decoy",
EntityType.Builder.<SmokeDecoyEntity>of(SmokeDecoyEntity::new, MobCategory.MISC).setTrackingRange(64).setUpdateInterval(1).noSave().sized(3f, 3f)); EntityType.Builder.<SmokeDecoyEntity>of(SmokeDecoyEntity::new, MobCategory.MISC).setTrackingRange(64).setUpdateInterval(1).noSave().sized(3f, 3f));
public static final DeferredHolder<EntityType<?>, EntityType<ClaymoreEntity>> CLAYMORE = register("claymore", public static final DeferredHolder<EntityType<?>, EntityType<ClaymoreEntity>> CLAYMORE = register("claymore",
@ -72,6 +72,8 @@ public class ModEntities {
EntityType.Builder.<RgoGrenadeEntity>of(RgoGrenadeEntity::new, MobCategory.MISC).setShouldReceiveVelocityUpdates(false).noSave().setTrackingRange(64).setUpdateInterval(1).sized(0.3f, 0.3f)); EntityType.Builder.<RgoGrenadeEntity>of(RgoGrenadeEntity::new, MobCategory.MISC).setShouldReceiveVelocityUpdates(false).noSave().setTrackingRange(64).setUpdateInterval(1).sized(0.3f, 0.3f));
public static final DeferredHolder<EntityType<?>, EntityType<JavelinMissileEntity>> JAVELIN_MISSILE = register("javelin_missile", public static final DeferredHolder<EntityType<?>, EntityType<JavelinMissileEntity>> JAVELIN_MISSILE = register("javelin_missile",
EntityType.Builder.<JavelinMissileEntity>of(JavelinMissileEntity::new, MobCategory.MISC).setShouldReceiveVelocityUpdates(false).noSave().setTrackingRange(64).setUpdateInterval(1).sized(0.5f, 0.5f)); EntityType.Builder.<JavelinMissileEntity>of(JavelinMissileEntity::new, MobCategory.MISC).setShouldReceiveVelocityUpdates(false).noSave().setTrackingRange(64).setUpdateInterval(1).sized(0.5f, 0.5f));
public static final DeferredHolder<EntityType<?>, EntityType<Agm65Entity>> AGM_65 = register("agm_65",
EntityType.Builder.<Agm65Entity>of(Agm65Entity::new, MobCategory.MISC).setShouldReceiveVelocityUpdates(false).noSave().setTrackingRange(64).setUpdateInterval(1).sized(0.75f, 0.75f));
public static final DeferredHolder<EntityType<?>, EntityType<HeliRocketEntity>> HELI_ROCKET = register("heli_rocket", public static final DeferredHolder<EntityType<?>, EntityType<HeliRocketEntity>> HELI_ROCKET = register("heli_rocket",
EntityType.Builder.<HeliRocketEntity>of(HeliRocketEntity::new, MobCategory.MISC).setShouldReceiveVelocityUpdates(false).noSave().setTrackingRange(64).setUpdateInterval(1).sized(0.5f, 0.5f)); EntityType.Builder.<HeliRocketEntity>of(HeliRocketEntity::new, MobCategory.MISC).setShouldReceiveVelocityUpdates(false).noSave().setTrackingRange(64).setUpdateInterval(1).sized(0.5f, 0.5f));
public static final DeferredHolder<EntityType<?>, EntityType<WgMissileEntity>> WG_MISSILE = register("wg_missile", public static final DeferredHolder<EntityType<?>, EntityType<WgMissileEntity>> WG_MISSILE = register("wg_missile",
@ -79,7 +81,7 @@ public class ModEntities {
public static final DeferredHolder<EntityType<?>, EntityType<SwarmDroneEntity>> SWARM_DRONE = register("swarm_drone", public static final DeferredHolder<EntityType<?>, EntityType<SwarmDroneEntity>> SWARM_DRONE = register("swarm_drone",
EntityType.Builder.<SwarmDroneEntity>of(SwarmDroneEntity::new, MobCategory.MISC).setShouldReceiveVelocityUpdates(false).noSave().setTrackingRange(64).setUpdateInterval(1).fireImmune().sized(0.5f, 0.5f)); EntityType.Builder.<SwarmDroneEntity>of(SwarmDroneEntity::new, MobCategory.MISC).setShouldReceiveVelocityUpdates(false).noSave().setTrackingRange(64).setUpdateInterval(1).fireImmune().sized(0.5f, 0.5f));
public static final DeferredHolder<EntityType<?>, EntityType<Mk82Entity>> MK_82 = register("mk_82", public static final DeferredHolder<EntityType<?>, EntityType<Mk82Entity>> MK_82 = register("mk_82",
EntityType.Builder.<Mk82Entity>of(Mk82Entity::new, MobCategory.MISC).setShouldReceiveVelocityUpdates(false).noSave().setTrackingRange(64).setUpdateInterval(1).fireImmune().sized(0.5f, 0.5f)); EntityType.Builder.<Mk82Entity>of(Mk82Entity::new, MobCategory.MISC).setShouldReceiveVelocityUpdates(false).noSave().setTrackingRange(64).setUpdateInterval(1).fireImmune().sized(0.8f, 0.8f));
// Vehicles // Vehicles
public static final DeferredHolder<EntityType<?>, EntityType<Mk42Entity>> MK_42 = register("mk_42", public static final DeferredHolder<EntityType<?>, EntityType<Mk42Entity>> MK_42 = register("mk_42",

View file

@ -51,5 +51,6 @@ public class ModEntityRenderers {
event.registerEntityRenderer(ModEntities.HPJ_11.get(), Hpj11Renderer::new); event.registerEntityRenderer(ModEntities.HPJ_11.get(), Hpj11Renderer::new);
event.registerEntityRenderer(ModEntities.A_10A.get(), A10Renderer::new); event.registerEntityRenderer(ModEntities.A_10A.get(), A10Renderer::new);
event.registerEntityRenderer(ModEntities.MK_82.get(), Mk82Renderer::new); event.registerEntityRenderer(ModEntities.MK_82.get(), Mk82Renderer::new);
event.registerEntityRenderer(ModEntities.AGM_65.get(), Agm65Renderer::new);
} }
} }

View file

@ -117,7 +117,8 @@ public class ModItems {
public static final DeferredHolder<Item, C4Bomb> C4_BOMB = AMMO.register("c4_bomb", C4Bomb::new); public static final DeferredHolder<Item, C4Bomb> C4_BOMB = AMMO.register("c4_bomb", C4Bomb::new);
public static final DeferredHolder<Item, Item> SMALL_SHELL = AMMO.register("small_shell", SmallShellItem::new); public static final DeferredHolder<Item, Item> SMALL_SHELL = AMMO.register("small_shell", SmallShellItem::new);
public static final DeferredHolder<Item, Item> ROCKET_70 = AMMO.register("rocket_70", Rocket70::new); public static final DeferredHolder<Item, Item> ROCKET_70 = AMMO.register("rocket_70", Rocket70::new);
public static final DeferredHolder<Item, Item> WIRE_GUIDE_MISSILE = AMMO.register("wire_guide_missile", () -> new Item(new Item.Properties())); public static final DeferredHolder<Item, WireGuideMissile> WIRE_GUIDE_MISSILE = AMMO.register("wire_guide_missile", WireGuideMissile::new);
public static final DeferredHolder<Item, Agm> AGM = AMMO.register("agm", Agm::new);
public static final DeferredHolder<Item, Item> SWARM_DRONE = AMMO.register("swarm_drone", () -> new Item(new Item.Properties())); public static final DeferredHolder<Item, Item> SWARM_DRONE = AMMO.register("swarm_drone", () -> new Item(new Item.Properties()));
public static final DeferredHolder<Item, MediumAerialBomb> MEDIUM_AERIAL_BOMB = AMMO.register("medium_aerial_bomb", MediumAerialBomb::new); public static final DeferredHolder<Item, MediumAerialBomb> MEDIUM_AERIAL_BOMB = AMMO.register("medium_aerial_bomb", MediumAerialBomb::new);
public static final DeferredHolder<Item, BeamTest> BEAM_TEST = AMMO.register("beam_test", BeamTest::new); public static final DeferredHolder<Item, BeamTest> BEAM_TEST = AMMO.register("beam_test", BeamTest::new);

View file

@ -447,5 +447,8 @@ public class ModSounds {
public static final DeferredHolder<SoundEvent, SoundEvent> A_10_FIRE = REGISTRY.register("a10_fire", () -> SoundEvent.createVariableRangeEvent(Mod.loc("a10_fire"))); public static final DeferredHolder<SoundEvent, SoundEvent> A_10_FIRE = REGISTRY.register("a10_fire", () -> SoundEvent.createVariableRangeEvent(Mod.loc("a10_fire")));
public static final DeferredHolder<SoundEvent, SoundEvent> BOMB_RELEASE = REGISTRY.register("bomb_release", () -> SoundEvent.createVariableRangeEvent(Mod.loc("bomb_release"))); public static final DeferredHolder<SoundEvent, SoundEvent> BOMB_RELEASE = REGISTRY.register("bomb_release", () -> SoundEvent.createVariableRangeEvent(Mod.loc("bomb_release")));
public static final DeferredHolder<SoundEvent, SoundEvent> BOMB_RELOAD = REGISTRY.register("bomb_reload", () -> SoundEvent.createVariableRangeEvent(Mod.loc("bomb_reload"))); public static final DeferredHolder<SoundEvent, SoundEvent> BOMB_RELOAD = REGISTRY.register("bomb_reload", () -> SoundEvent.createVariableRangeEvent(Mod.loc("bomb_reload")));
public static final DeferredHolder<SoundEvent, SoundEvent> MISSILE_START = REGISTRY.register("missile_start", () -> SoundEvent.createVariableRangeEvent(Mod.loc("missile_start")));
public static final DeferredHolder<SoundEvent, SoundEvent> JET_LOCK = REGISTRY.register("jet_lock", () -> SoundEvent.createVariableRangeEvent(Mod.loc("jet_lock")));
public static final DeferredHolder<SoundEvent, SoundEvent> JET_LOCKON = REGISTRY.register("jet_lockon", () -> SoundEvent.createVariableRangeEvent(Mod.loc("jet_lockon")));
} }

View file

@ -0,0 +1,22 @@
package com.atsuishio.superbwarfare.item;
import net.minecraft.ChatFormatting;
import net.minecraft.network.chat.Component;
import net.minecraft.world.item.Item;
import net.minecraft.world.item.ItemStack;
import net.minecraft.world.item.TooltipFlag;
import javax.annotation.ParametersAreNonnullByDefault;
import java.util.List;
public class Agm extends Item {
public Agm() {
super(new Properties().stacksTo(2));
}
@Override
@ParametersAreNonnullByDefault
public void appendHoverText(ItemStack stack, TooltipContext context, List<Component> tooltipComponents, TooltipFlag tooltipFlag) {
tooltipComponents.add(Component.translatable("des.superbwarfare.agm").withStyle(ChatFormatting.GRAY));
}
}

View file

@ -0,0 +1,22 @@
package com.atsuishio.superbwarfare.item;
import net.minecraft.ChatFormatting;
import net.minecraft.network.chat.Component;
import net.minecraft.world.item.Item;
import net.minecraft.world.item.ItemStack;
import net.minecraft.world.item.TooltipFlag;
import javax.annotation.ParametersAreNonnullByDefault;
import java.util.List;
public class WireGuideMissile extends Item {
public WireGuideMissile() {
super(new Properties().stacksTo(4));
}
@Override
@ParametersAreNonnullByDefault
public void appendHoverText(ItemStack stack, TooltipContext context, List<Component> tooltipComponents, TooltipFlag tooltipFlag) {
tooltipComponents.add(Component.translatable("des.superbwarfare.wire_guide_missile").withStyle(ChatFormatting.GRAY));
}
}

View file

@ -62,6 +62,23 @@ public class SeekTool {
.orElse(null); .orElse(null);
} }
public static Entity seekCustomSizeEntitiy(Entity entity, Level level, double seekRange, double seekAngle, double size) {
return StreamSupport.stream(EntityFindUtil.getEntities(level).getAll().spliterator(), false)
.filter(e -> {
if (e.distanceTo(entity) <= seekRange && calculateAngle(e, entity) < seekAngle
&& e != entity
&& baseFilter(e)
&& e.getBoundingBox().getSize() >= size
&& smokeFilter(e)
&& e.getVehicle() == null
) {
return level.clip(new ClipContext(entity.getEyePosition(), e.getEyePosition(),
ClipContext.Block.COLLIDER, ClipContext.Fluid.NONE, entity)).getType() != HitResult.Type.BLOCK;
}
return false;
}).min(Comparator.comparingDouble(e -> calculateAngle(e, entity))).orElse(null);
}
public static Entity seekLivingEntity(Entity entity, Level level, double seekRange, double seekAngle) { public static Entity seekLivingEntity(Entity entity, Level level, double seekRange, double seekAngle) {
return StreamSupport.stream(EntityFindUtil.getEntities(level).getAll().spliterator(), false) return StreamSupport.stream(EntityFindUtil.getEntities(level).getAll().spliterator(), false)
.filter(e -> { .filter(e -> {
@ -104,6 +121,23 @@ public class SeekTool {
}).toList(); }).toList();
} }
public static List<Entity> seekCustomSizeEntities(Entity entity, Level level, double seekRange, double seekAngle, double size) {
return StreamSupport.stream(EntityFindUtil.getEntities(level).getAll().spliterator(), false)
.filter(e -> {
if (e.distanceTo(entity) <= seekRange && calculateAngle(e, entity) < seekAngle
&& e != entity
&& e.getBoundingBox().getSize() >= size
&& baseFilter(e)
&& smokeFilter(e)
&& e.getVehicle() == null
&& (!e.isAlliedTo(entity) || e.getTeam() == null || e.getTeam().getName().equals("TDM"))) {
return level.clip(new ClipContext(entity.getEyePosition(), e.getEyePosition(),
ClipContext.Block.COLLIDER, ClipContext.Fluid.NONE, entity)).getType() != HitResult.Type.BLOCK;
}
return false;
}).toList();
}
public static Entity vehicleSeekEntity(VehicleEntity vehicle, Level level, double seekRange, double seekAngle) { public static Entity vehicleSeekEntity(VehicleEntity vehicle, Level level, double seekRange, double seekAngle) {
return StreamSupport.stream(EntityFindUtil.getEntities(level).getAll().spliterator(), false) return StreamSupport.stream(EntityFindUtil.getEntities(level).getAll().spliterator(), false)
.filter(e -> { .filter(e -> {

File diff suppressed because it is too large Load diff

View file

@ -0,0 +1,337 @@
{
"format_version": "1.12.0",
"minecraft:geometry": [
{
"description": {
"identifier": "geometry.unknown",
"texture_width": 128,
"texture_height": 128,
"visible_bounds_width": 8,
"visible_bounds_height": 9,
"visible_bounds_offset": [0, 2.5, 0]
},
"bones": [
{
"name": "agm65",
"pivot": [0, 0, 0]
},
{
"name": "flare",
"parent": "agm65",
"pivot": [0, 27.33, 0],
"cubes": [
{
"origin": [-35.175, 27.39, -1.575],
"size": [33.6, 0, 3.15],
"uv": {
"up": {"uv": [18, 128], "uv_size": [-18, -2]},
"down": {"uv": [18, 128], "uv_size": [-18, -2]}
}
},
{
"origin": [-51.975, 27.39, -1.575],
"size": [50.4, 0, 3.15],
"pivot": [0, 28.335, 0],
"rotation": [0, 90, 0],
"uv": {
"up": {"uv": [18, 128], "uv_size": [-18, -2]},
"down": {"uv": [18, 128], "uv_size": [-18, -2]}
}
},
{
"origin": [-35.175, 27.39, -1.575],
"size": [33.6, 0, 3.15],
"pivot": [0, 28.335, 0],
"rotation": [0, 180, 0],
"uv": {
"up": {"uv": [18, 128], "uv_size": [-18, -2]},
"down": {"uv": [18, 128], "uv_size": [-18, -2]}
}
},
{
"origin": [-33.6, 58.785, -2.1],
"size": [67.2, 0, 4.2],
"pivot": [0, 58.785, 0],
"rotation": [135, 0, 90],
"uv": {
"up": {"uv": [18, 128], "uv_size": [-18, -2]},
"down": {"uv": [18, 128], "uv_size": [-18, -2]}
}
},
{
"origin": [-33.6, 58.785, -2.1],
"size": [67.2, 0, 4.2],
"pivot": [0, 58.785, 0],
"rotation": [-135, 0, 90],
"uv": {
"up": {"uv": [18, 128], "uv_size": [-18, -2]},
"down": {"uv": [18, 128], "uv_size": [-18, -2]}
}
},
{
"origin": [-51.975, 27.39, -1.575],
"size": [50.4, 0, 3.15],
"pivot": [0, 28.335, 0],
"rotation": [0, -90, 0],
"uv": {
"up": {"uv": [18, 128], "uv_size": [-18, -2]},
"down": {"uv": [18, 128], "uv_size": [-18, -2]}
}
},
{
"origin": [-5.775, 27.39, -5.775],
"size": [11.55, 0, 11.55],
"pivot": [0, 27.39, 0],
"rotation": [0, -45, 0],
"uv": {
"up": {"uv": [2, 128], "uv_size": [-2, -2]},
"down": {"uv": [2, 128], "uv_size": [-2, -2]}
}
},
{
"origin": [-5.25, 31.065, -5.25],
"size": [10.5, 0, 10.5],
"pivot": [0, 31.065, 0],
"rotation": [90, -45, 0],
"uv": {
"up": {"uv": [2, 128], "uv_size": [-2, -2]},
"down": {"uv": [2, 128], "uv_size": [-2, -2]}
}
},
{
"origin": [-5.25, 31.065, -5.25],
"size": [10.5, 0, 10.5],
"pivot": [0, 31.065, 0],
"rotation": [90, 45, 0],
"uv": {
"up": {"uv": [2, 128], "uv_size": [-2, -2]},
"down": {"uv": [2, 128], "uv_size": [-2, -2]}
}
}
]
},
{
"name": "bone",
"parent": "agm65",
"pivot": [0, 0, 0],
"rotation": [90, 0, 0]
},
{
"name": "bone1",
"parent": "bone",
"pivot": [0, 0, -2],
"cubes": [
{
"origin": [-26.28724, -3.04855, -2.26276],
"size": [53.57449, 6.09709, 2.52549],
"pivot": [0, 0, -1],
"rotation": [0, -90, 90],
"uv": {
"west": {"uv": [54, 0], "uv_size": [3, 6]},
"up": {"uv": [0, 0], "uv_size": [54, 3]},
"down": {"uv": [0, 6], "uv_size": [54, -3]}
}
},
{
"origin": [-26.28725, -3.04853, -2.26277],
"size": [53.57449, 6.09709, 2.52549],
"pivot": [0, 0, -1],
"rotation": [0, -90, 0],
"uv": {
"west": {"uv": [54, 36], "uv_size": [3, 6]},
"up": {"uv": [0, 18], "uv_size": [54, 3]},
"down": {"uv": [0, 24], "uv_size": [54, -3]}
}
},
{
"origin": [-26.28725, -3.04853, -2.26276],
"size": [53.57449, 6.09709, 2.52549],
"pivot": [0, 0, -1],
"rotation": [0, -90, 45],
"uv": {
"east": {"uv": [54, 18], "uv_size": [3, 6]},
"west": {"uv": [54, 30], "uv_size": [3, 6]},
"up": {"uv": [0, 12], "uv_size": [54, 3]},
"down": {"uv": [0, 18], "uv_size": [54, -3]}
}
},
{
"origin": [-26.28725, -3.04856, -2.26276],
"size": [53.57449, 6.09709, 2.52549],
"pivot": [0, 0, -1],
"rotation": [0, -90, 135],
"uv": {
"east": {"uv": [54, 6], "uv_size": [3, 6]},
"west": {"uv": [54, 12], "uv_size": [3, 6]},
"up": {"uv": [0, 6], "uv_size": [54, 3]},
"down": {"uv": [0, 12], "uv_size": [54, -3]}
}
}
]
},
{
"name": "bone2",
"parent": "bone",
"pivot": [0, 0, -48.5],
"cubes": [
{
"origin": [-2.12135, -0.35489, -30.05071],
"size": [4.67449, 2.59709, 2.52549],
"pivot": [0.00002, 0, -28.78797],
"rotation": [90, -67.5, -90],
"uv": {
"north": {"uv": [8, 56], "uv_size": [5, 3]},
"south": {"uv": [13, 56], "uv_size": [5, 3]},
"up": {"uv": [18, 56], "uv_size": [5, 3]}
}
},
{
"origin": [-0.18824, -0.12608, -31.57011],
"size": [2.5255, 0.34709, 2.52549],
"pivot": [0.00002, -1.07753, -30.30736],
"rotation": [90, 0, -90],
"uv": {
"up": {"uv": [57, 3], "uv_size": [3, 3]}
}
},
{
"origin": [-2.12135, -2.2422, -30.05071],
"size": [4.67449, 2.59709, 2.52549],
"pivot": [0.00002, 0, -28.78797],
"rotation": [-90, -67.5, 90],
"uv": {
"north": {"uv": [23, 56], "uv_size": [5, 3]},
"south": {"uv": [28, 56], "uv_size": [5, 3]},
"down": {"uv": [33, 59], "uv_size": [5, -3]}
}
},
{
"origin": [-2.12135, -2.2422, -30.05071],
"size": [4.67449, 2.59709, 2.52549],
"pivot": [0.00002, 0, -28.78797],
"rotation": [-90, -67.5, 0],
"uv": {
"north": {"uv": [56, 51], "uv_size": [5, 3]},
"south": {"uv": [56, 54], "uv_size": [5, 3]},
"down": {"uv": [57, 3], "uv_size": [5, -3]}
}
},
{
"origin": [-2.12135, -0.35489, -30.05071],
"size": [4.67449, 2.59709, 2.52549],
"pivot": [0.00002, 0, -28.78797],
"rotation": [90, -67.5, -180],
"uv": {
"north": {"uv": [56, 42], "uv_size": [5, 3]},
"south": {"uv": [56, 45], "uv_size": [5, 3]},
"up": {"uv": [56, 48], "uv_size": [5, 3]}
}
}
]
},
{
"name": "bone3",
"parent": "bone",
"pivot": [0, 0, 11.76367],
"rotation": [0, 0, -45],
"cubes": [
{
"origin": [-0.1525, -8.25, 18],
"size": [0.305, 16.5, 1],
"uv": {
"east": {"uv": [54, 42], "uv_size": [1, 17]},
"south": {"uv": [55, 42], "uv_size": [1, 17]},
"west": {"uv": [0, 56], "uv_size": [1, 17]},
"up": {"uv": [57, 22], "uv_size": [1, 1]},
"down": {"uv": [57, 24], "uv_size": [1, -1]}
}
},
{
"origin": [-0.15, -15.46446, -2.75558],
"size": [0.3, 31.95, 5.15],
"pivot": [0, 0, 2.71484],
"rotation": [-80, 0, 0],
"uv": {
"north": {"uv": [50, 30], "uv_size": [1, 32]},
"east": {"uv": [0, 24], "uv_size": [5, 32]},
"west": {"uv": [5, 24], "uv_size": [5, 32]}
}
},
{
"origin": [-0.15, -16.48554, -2.75558],
"size": [0.3, 31.95, 5.15],
"pivot": [0, 0, 2.71484],
"rotation": [80, 0, 0],
"uv": {
"north": {"uv": [51, 30], "uv_size": [1, 32]},
"east": {"uv": [10, 24], "uv_size": [5, 32]},
"west": {"uv": [15, 24], "uv_size": [5, 32]}
}
},
{
"origin": [-0.15, -16.48554, -2.75558],
"size": [0.3, 31.95, 5.15],
"pivot": [0, 0, 2.71484],
"rotation": [80, 0, 90],
"uv": {
"north": {"uv": [53, 30], "uv_size": [1, 32]},
"east": {"uv": [30, 24], "uv_size": [5, 32]},
"west": {"uv": [35, 24], "uv_size": [5, 32]}
}
},
{
"origin": [-0.15, -15.46446, -2.75558],
"size": [0.3, 31.95, 5.15],
"pivot": [0, 0, 2.71484],
"rotation": [-80, 0, 90],
"uv": {
"north": {"uv": [52, 30], "uv_size": [1, 32]},
"east": {"uv": [20, 24], "uv_size": [5, 32]},
"west": {"uv": [25, 24], "uv_size": [5, 32]}
}
},
{
"origin": [-0.15, -8.2525, 18],
"size": [0.305, 16.5, 1],
"pivot": [0, -0.0025, 10.56225],
"rotation": [0, 0, -90],
"uv": {
"east": {"uv": [1, 56], "uv_size": [1, 17]},
"south": {"uv": [2, 56], "uv_size": [1, 17]},
"west": {"uv": [3, 56], "uv_size": [1, 17]},
"up": {"uv": [57, 39], "uv_size": [1, 1]},
"down": {"uv": [57, 41], "uv_size": [1, -1]}
}
},
{
"origin": [-0.15, -8.25, 21.75],
"size": [0.3, 16.5, 2.75],
"uv": {
"north": {"uv": [6, 56], "uv_size": [1, 17]},
"east": {"uv": [44, 47], "uv_size": [3, 17]},
"south": {"uv": [7, 56], "uv_size": [1, 17]},
"west": {"uv": [47, 47], "uv_size": [3, 17]},
"up": {"uv": [57, 33], "uv_size": [1, 3]},
"down": {"uv": [57, 39], "uv_size": [1, -3]}
}
},
{
"origin": [-0.15, -8.5, 21.75],
"size": [0.3, 17, 2.75],
"pivot": [0, 0, 10.56225],
"rotation": [0, 0, -90],
"uv": {
"north": {"uv": [4, 56], "uv_size": [1, 17]},
"east": {"uv": [44, 30], "uv_size": [3, 17]},
"south": {"uv": [5, 56], "uv_size": [1, 17]},
"west": {"uv": [47, 30], "uv_size": [3, 17]},
"up": {"uv": [57, 19], "uv_size": [1, 3]},
"down": {"uv": [57, 33], "uv_size": [1, -3]}
}
}
]
}
]
}
]
}

File diff suppressed because it is too large Load diff

View file

@ -166,9 +166,12 @@
"item.superbwarfare.small_shell": "Small Caliber Shells", "item.superbwarfare.small_shell": "Small Caliber Shells",
"des.superbwarfare.small_shell": "Suitable for 20mm ~ 40mm caliber weapons", "des.superbwarfare.small_shell": "Suitable for 20mm ~ 40mm caliber weapons",
"item.superbwarfare.wire_guide_missile": "Wire Guide Missile", "item.superbwarfare.wire_guide_missile": "Wire Guide Missile",
"des.superbwarfare.wire_guide_missile": "Suitable for BMP-2",
"item.superbwarfare.swarm_drone": "Swarm Drone", "item.superbwarfare.swarm_drone": "Swarm Drone",
"item.superbwarfare.medium_aerial_bomb": "Medium Aerial Bomb", "item.superbwarfare.medium_aerial_bomb": "Medium Aerial Bomb",
"des.superbwarfare.medium_aerial_bomb": "Suitable for A-10 Thunderbolt II", "des.superbwarfare.medium_aerial_bomb": "Suitable for A-10 Thunderbolt II",
"item.superbwarfare.agm": "Air-to-ground Missile",
"des.superbwarfare.agm": "Suitable for A-10 Thunderbolt II",
"item.superbwarfare.firing_parameters": "Firing Parameters", "item.superbwarfare.firing_parameters": "Firing Parameters",
"item.superbwarfare.ancient_cpu": "Ancient CPU", "item.superbwarfare.ancient_cpu": "Ancient CPU",
@ -458,6 +461,7 @@
"entity.superbwarfare.hpj_11": "H/PJ-11 CIWS", "entity.superbwarfare.hpj_11": "H/PJ-11 CIWS",
"entity.superbwarfare.a_10a": "A-10 Thunderbolt II", "entity.superbwarfare.a_10a": "A-10 Thunderbolt II",
"entity.superbwarfare.mk_82": "MK-82 Aerial Bomb", "entity.superbwarfare.mk_82": "MK-82 Aerial Bomb",
"entity.superbwarfare.agm_65": "AGM-65 Maverick",
"key.categories.superbwarfare": "Superb Warfare", "key.categories.superbwarfare": "Superb Warfare",
"key.superbwarfare.hold_zoom": "Zoom (Hold)", "key.superbwarfare.hold_zoom": "Zoom (Hold)",

View file

@ -166,9 +166,12 @@
"item.superbwarfare.small_shell": "小口径炮弹", "item.superbwarfare.small_shell": "小口径炮弹",
"des.superbwarfare.small_shell": "适配20mm ~ 40mm口径武器", "des.superbwarfare.small_shell": "适配20mm ~ 40mm口径武器",
"item.superbwarfare.wire_guide_missile": "线控导弹", "item.superbwarfare.wire_guide_missile": "线控导弹",
"des.superbwarfare.wire_guide_missile": "适配BMP-2步兵战车",
"item.superbwarfare.swarm_drone": "蜂群无人机", "item.superbwarfare.swarm_drone": "蜂群无人机",
"item.superbwarfare.medium_aerial_bomb": "中型航空炸弹", "item.superbwarfare.medium_aerial_bomb": "中型航空炸弹",
"des.superbwarfare.medium_aerial_bomb": "适配A-10攻击机", "des.superbwarfare.medium_aerial_bomb": "适配A-10攻击机",
"item.superbwarfare.agm": "空对地导弹",
"des.superbwarfare.agm": "适配A-10攻击机",
"item.superbwarfare.firing_parameters": "射击诸元", "item.superbwarfare.firing_parameters": "射击诸元",
"item.superbwarfare.ancient_cpu": "古代处理器", "item.superbwarfare.ancient_cpu": "古代处理器",
@ -456,6 +459,7 @@
"entity.superbwarfare.hpj_11": "H/PJ-11近防炮", "entity.superbwarfare.hpj_11": "H/PJ-11近防炮",
"entity.superbwarfare.a_10a": "A-10 “雷电II” 攻击机", "entity.superbwarfare.a_10a": "A-10 “雷电II” 攻击机",
"entity.superbwarfare.mk_82": "MK-82 航空炸弹", "entity.superbwarfare.mk_82": "MK-82 航空炸弹",
"entity.superbwarfare.agm_65": "AGM-65 “小牛”空对地导弹",
"key.categories.superbwarfare": "卓越前线", "key.categories.superbwarfare": "卓越前线",
"key.superbwarfare.hold_zoom": "瞄准(按住)", "key.superbwarfare.hold_zoom": "瞄准(按住)",

View file

@ -3122,6 +3122,13 @@
} }
] ]
}, },
"missile_start": {
"sounds": [
{
"name": "superbwarfare:missile_start"
}
]
},
"bomb_reload": { "bomb_reload": {
"sounds": [ "sounds": [
{ {
@ -3130,5 +3137,21 @@
"name": "superbwarfare:bomb_reload" "name": "superbwarfare:bomb_reload"
} }
] ]
},
"jet_lock": {
"sounds": [
{
"name": "superbwarfare:a10/jet_lock",
"stream": false
}
]
},
"jet_lockon": {
"sounds": [
{
"name": "superbwarfare:a10/jet_lockon",
"stream": false
}
]
} }
} }

Binary file not shown.

Before

Width:  |  Height:  |  Size: 97 KiB

After

Width:  |  Height:  |  Size: 97 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 970 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.4 KiB

After

Width:  |  Height:  |  Size: 3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 210 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.6 KiB

View file

@ -0,0 +1,30 @@
{
"type": "minecraft:crafting_shaped",
"category": "misc",
"pattern": [
" b ",
"fdf",
"cec"
],
"key": {
"b": {
"item": "superbwarfare:seeker"
},
"c": {
"item": "superbwarfare:high_energy_explosives"
},
"d": {
"item":"minecraft:tnt"
},
"e": {
"item": "superbwarfare:missile_engine"
},
"f": {
"tag": "c:plates/copper"
}
},
"result": {
"id": "superbwarfare:agm",
"count": 1
}
}

View file

@ -0,0 +1,27 @@
{
"type": "minecraft:crafting_shaped",
"category": "misc",
"pattern": [
" c ",
"dad",
" b "
],
"key": {
"a": {
"item":"minecraft:tnt"
},
"b": {
"item": "minecraft:iron_ingot"
},
"c": {
"item": "superbwarfare:fusee"
},
"d": {
"item": "superbwarfare:high_energy_explosives"
}
},
"result": {
"id": "superbwarfare:medium_aerial_bomb",
"count": 1
}
}