移除载具perk,新建带存储的载具类,添加直升机的弹药机制

This commit is contained in:
Atsuihsio 2025-01-05 23:45:38 +08:00
parent 06a1f0b827
commit c5652234e5
33 changed files with 1980 additions and 380 deletions

View file

@ -1,4 +1,4 @@
// 1.20.1 2024-12-29T21:51:17.35717 Item Models: superbwarfare
// 1.20.1 2025-01-05T22:08:45.9480261 Item Models: superbwarfare
13ca8d5676888ff51f3308d88e4bf67691fa34f8 assets/superbwarfare/models/item/aa_12_blueprint.json
13ca8d5676888ff51f3308d88e4bf67691fa34f8 assets/superbwarfare/models/item/ak_12_blueprint.json
13ca8d5676888ff51f3308d88e4bf67691fa34f8 assets/superbwarfare/models/item/ak_47_blueprint.json
@ -80,6 +80,7 @@ e821640d80c55763e7e7b62f7b80c60ff56dcc4f assets/superbwarfare/models/item/rare_m
ce0f0949b0545d8ef08aeaa52dd423dbe592f704 assets/superbwarfare/models/item/raw_cemented_carbide_powder.json
59cbca463403cfc50d964229268638c55dd915fb assets/superbwarfare/models/item/raw_silver.json
5b8f7d5922e49e06bcd4d4d2a2a3dc934548570b assets/superbwarfare/models/item/reforging_table.json
2ffa0e320740cfae96341842450e95c916971fb1 assets/superbwarfare/models/item/rocket_70.json
13ca8d5676888ff51f3308d88e4bf67691fa34f8 assets/superbwarfare/models/item/rpg_blueprint.json
13ca8d5676888ff51f3308d88e4bf67691fa34f8 assets/superbwarfare/models/item/rpk_blueprint.json
34aecddee2e3b903c075b1625e1b23c57ea23fd1 assets/superbwarfare/models/item/ru_chest_6b43.json

View file

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

View file

@ -0,0 +1,27 @@
package com.atsuishio.superbwarfare.client.layer;
import com.atsuishio.superbwarfare.ModUtils;
import com.atsuishio.superbwarfare.entity.projectile.HeliRocketEntity;
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 HeliRocketLayer extends GeoRenderLayer<HeliRocketEntity> {
private static final ResourceLocation LAYER = new ResourceLocation(ModUtils.MODID, "textures/entity/rpg_rocket_e.png");
public HeliRocketLayer(GeoRenderer<HeliRocketEntity> entityRenderer) {
super(entityRenderer);
}
@Override
public void render(PoseStack poseStack, HeliRocketEntity 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, 1, 1, 1, 1);
}
}

View file

@ -0,0 +1,24 @@
package com.atsuishio.superbwarfare.client.model.entity;
import com.atsuishio.superbwarfare.ModUtils;
import com.atsuishio.superbwarfare.entity.projectile.HeliRocketEntity;
import net.minecraft.resources.ResourceLocation;
import software.bernie.geckolib.model.GeoModel;
public class HeliRocketModel extends GeoModel<HeliRocketEntity> {
@Override
public ResourceLocation getAnimationResource(HeliRocketEntity entity) {
return new ResourceLocation(ModUtils.MODID, "animations/rpg_rocket.animation.json");
}
@Override
public ResourceLocation getModelResource(HeliRocketEntity entity) {
return new ResourceLocation(ModUtils.MODID, "geo/heli_rocket.geo.json");
}
@Override
public ResourceLocation getTextureResource(HeliRocketEntity entity) {
return new ResourceLocation(ModUtils.MODID, "textures/entity/heli_rocket.png");
}
}

View file

@ -118,7 +118,7 @@ public class CrossHairOverlay {
}
// 在开启伤害指示器时才进行渲染
if (DisplayConfig.KILL_INDICATION.get()) {
if (DisplayConfig.KILL_INDICATION.get() && stack.is(ModTags.Items.GUN)) {
renderKillIndicator(guiGraphics, w, h, moveX, moveY);
}

View file

@ -32,6 +32,7 @@ import org.joml.Vector4f;
import java.text.DecimalFormat;
import static com.atsuishio.superbwarfare.client.RenderHelper.preciseBlit;
import static com.atsuishio.superbwarfare.client.overlay.CrossHairOverlay.*;
@Mod.EventBusSubscriber(value = Dist.CLIENT)
public class HelicopterHudOverlay {
@ -146,8 +147,10 @@ public class HelicopterHudOverlay {
float y3 = (float) p3.y;
if (Minecraft.getInstance().options.getCameraType() == CameraType.FIRST_PERSON) {
preciseBlit(guiGraphics, ModUtils.loc("textures/screens/helicopter/crosshair_ind.png"), x - 8, y - 8, 0, 0, 16, 16, 16, 16);
renderKillIndicator(guiGraphics, x - 7.5f + (float) (2 * (Math.random() - 0.5f)), y - 7.5f + (float) (2 * (Math.random() - 0.5f)));
} else if (Minecraft.getInstance().options.getCameraType() == CameraType.THIRD_PERSON_BACK) {
preciseBlit(guiGraphics, ModUtils.loc("textures/screens/drone.png"), x3 - 8, y3 - 8, 0, 0, 16, 16, 16, 16);
renderKillIndicator(guiGraphics, x3 - 7.5f + (float) (2 * (Math.random() - 0.5f)), y3 - 7.5f + (float) (2 * (Math.random() - 0.5f)));
}
poseStack.popPose();
@ -159,6 +162,30 @@ public class HelicopterHudOverlay {
}
}
private static void renderKillIndicator(GuiGraphics guiGraphics, float posX, float posY) {
float rate = (40 - KILL_INDICATOR * 5) / 5.5f;
if (HIT_INDICATOR > 0) {
preciseBlit(guiGraphics, ModUtils.loc("textures/screens/hit_marker.png"), posX, posY, 0, 0, 16, 16, 16, 16);
}
if (HEAD_INDICATOR > 0) {
preciseBlit(guiGraphics, ModUtils.loc("textures/screens/headshot_mark.png"), posX, posY, 0, 0, 16, 16, 16, 16);
}
if (KILL_INDICATOR > 0) {
float posX1 = posX - 2 + rate;
float posY1 = posY - 2 + rate;
float posX2 = posX + 2 - rate;
float posY2 = posY + 2 - rate;
preciseBlit(guiGraphics, ModUtils.loc("textures/screens/kill_mark1.png"), posX1, posY1, 0, 0, 16, 16, 16, 16);
preciseBlit(guiGraphics, ModUtils.loc("textures/screens/kill_mark2.png"), posX2, posY1, 0, 0, 16, 16, 16, 16);
preciseBlit(guiGraphics, ModUtils.loc("textures/screens/kill_mark3.png"), posX1, posY2, 0, 0, 16, 16, 16, 16);
preciseBlit(guiGraphics, ModUtils.loc("textures/screens/kill_mark4.png"), posX2, posY2, 0, 0, 16, 16, 16, 16);
}
}
public static Matrix4f getVehicleTransform(VehicleEntity vehicle) {
Matrix4f transform = new Matrix4f();
transform.translate((float) vehicle.getX(), (float) vehicle.getY(), (float) vehicle.getZ());

View file

@ -22,6 +22,8 @@ import net.minecraftforge.eventbus.api.EventPriority;
import net.minecraftforge.eventbus.api.SubscribeEvent;
import net.minecraftforge.fml.common.Mod;
import static com.atsuishio.superbwarfare.entity.vehicle.Ah6Entity.WEAPON_TYPE;
@Mod.EventBusSubscriber(value = Dist.CLIENT)
public class VehicleHudOverlay {
@ -80,7 +82,10 @@ public class VehicleHudOverlay {
poseStack.scale(1.5f, 1.5f, 1f);
float v = h / 1.5f - (iCharge ? 42 : 29) / 1.5f;
if (player.getInventory().hasAnyMatching(s -> s.is(ModItems.CREATIVE_AMMO_BOX.get())) && !(iVehicle instanceof ICannonEntity)) {
if (player.getInventory().hasAnyMatching(s -> s.is(ModItems.CREATIVE_AMMO_BOX.get()))
&& !(iVehicle instanceof ICannonEntity
|| (iVehicle instanceof Ah6Entity ah6Entity && ah6Entity.getEntityData().get(WEAPON_TYPE) == 1))
) {
event.getGuiGraphics().drawString(
Minecraft.getInstance().font,
"",
@ -130,6 +135,14 @@ public class VehicleHudOverlay {
if (iVehicle instanceof SpeedboatEntity) {
return Component.translatable("des.superbwarfare.tips.ammo_type.cal50").getString();
}
if (iVehicle instanceof Ah6Entity ah6Entity) {
if (ah6Entity.getEntityData().get(WEAPON_TYPE) == 0) {
return Component.translatable("des.superbwarfare.tips.ammo_type.20mm_cannon").getString();
} else {
return Component.translatable("des.superbwarfare.tips.ammo_type.rocket").getString();
}
}
return "";
}

View file

@ -0,0 +1,50 @@
package com.atsuishio.superbwarfare.client.renderer.entity;
import com.atsuishio.superbwarfare.client.layer.HeliRocketLayer;
import com.atsuishio.superbwarfare.client.model.entity.HeliRocketModel;
import com.atsuishio.superbwarfare.entity.projectile.HeliRocketEntity;
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 software.bernie.geckolib.cache.object.BakedGeoModel;
import software.bernie.geckolib.renderer.GeoEntityRenderer;
public class HeliRocketRenderer extends GeoEntityRenderer<HeliRocketEntity> {
public HeliRocketRenderer(EntityRendererProvider.Context renderManager) {
super(renderManager, new HeliRocketModel());
this.addRenderLayer(new HeliRocketLayer(this));
}
@Override
public RenderType getRenderType(HeliRocketEntity animatable, ResourceLocation texture, MultiBufferSource bufferSource, float partialTick) {
return RenderType.entityTranslucent(getTextureLocation(animatable));
}
@Override
public void preRender(PoseStack poseStack, HeliRocketEntity entity, BakedGeoModel model, MultiBufferSource bufferSource, VertexConsumer buffer, boolean isReRender, float partialTick, int packedLight, int packedOverlay, float red, float green,
float blue, float alpha) {
float scale = 1f;
this.scaleHeight = scale;
this.scaleWidth = scale;
super.preRender(poseStack, entity, model, bufferSource, buffer, isReRender, partialTick, packedLight, packedOverlay, red, green, blue, alpha);
}
@Override
public void render(HeliRocketEntity entityIn, float entityYaw, float partialTicks, PoseStack poseStack, 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();
}
@Override
protected float getDeathMaxRotation(HeliRocketEntity entityLivingBaseIn) {
return 0.0F;
}
}

View file

@ -65,6 +65,7 @@ public class ModItemModelProvider extends ItemModelProvider {
simpleItem(ModItems.FIRING_PARAMETERS);
simpleItem(ModItems.BEAM_TEST);
simpleItem(ModItems.HEAVY_AMMO);
simpleItem(ModItems.ROCKET_70);
simpleItem(ModItems.TUNGSTEN_ROD);
simpleItem(ModItems.IRON_BARREL);

View file

@ -0,0 +1,190 @@
package com.atsuishio.superbwarfare.entity.projectile;
import com.atsuishio.superbwarfare.ModUtils;
import com.atsuishio.superbwarfare.config.server.ExplosionDestroyConfig;
import com.atsuishio.superbwarfare.entity.AnimatedEntity;
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.ClientIndicatorMessage;
import com.atsuishio.superbwarfare.tools.CustomExplosion;
import com.atsuishio.superbwarfare.tools.ParticleTool;
import net.minecraft.core.particles.ParticleTypes;
import net.minecraft.network.protocol.Packet;
import net.minecraft.network.protocol.game.ClientGamePacketListener;
import net.minecraft.server.level.ServerLevel;
import net.minecraft.server.level.ServerPlayer;
import net.minecraft.sounds.SoundSource;
import net.minecraft.world.damagesource.DamageSource;
import net.minecraft.world.entity.Entity;
import net.minecraft.world.entity.EntityType;
import net.minecraft.world.entity.LivingEntity;
import net.minecraft.world.entity.projectile.ThrowableItemProjectile;
import net.minecraft.world.item.Item;
import net.minecraft.world.level.Explosion;
import net.minecraft.world.level.Level;
import net.minecraft.world.phys.BlockHitResult;
import net.minecraft.world.phys.EntityHitResult;
import net.minecraftforge.network.NetworkHooks;
import net.minecraftforge.network.PacketDistributor;
import net.minecraftforge.network.PlayMessages;
import software.bernie.geckolib.animatable.GeoEntity;
import software.bernie.geckolib.core.animatable.instance.AnimatableInstanceCache;
import software.bernie.geckolib.core.animation.AnimatableManager;
import software.bernie.geckolib.core.animation.AnimationController;
import software.bernie.geckolib.core.animation.AnimationState;
import software.bernie.geckolib.core.animation.RawAnimation;
import software.bernie.geckolib.core.object.PlayState;
import software.bernie.geckolib.util.GeckoLibUtil;
import javax.annotation.Nullable;
public class HeliRocketEntity extends ThrowableItemProjectile implements GeoEntity, AnimatedEntity {
private final AnimatableInstanceCache cache = GeckoLibUtil.createInstanceCache(this);
private float damage = 140f;
private float explosion_damage = 60f;
private float explosion_radius = 5f;
public HeliRocketEntity(EntityType<? extends HeliRocketEntity> type, Level world) {
super(type, world);
this.noCulling = true;
}
public HeliRocketEntity(LivingEntity entity, Level level, float damage, float explosion_damage, float explosion_radius) {
super(ModEntities.HELI_ROCKET.get(), entity, level);
this.damage = damage;
this.explosion_damage = explosion_damage;
this.explosion_radius = explosion_radius;
}
public HeliRocketEntity(PlayMessages.SpawnEntity spawnEntity, Level level) {
this(ModEntities.HELI_ROCKET.get(), level);
}
@Override
public Packet<ClientGamePacketListener> getAddEntityPacket() {
return NetworkHooks.getEntitySpawningPacket(this);
}
@Override
protected Item getDefaultItem() {
return ModItems.ROCKET.get();
}
@Override
public boolean shouldRenderAtSqrDistance(double pDistance) {
return true;
}
@Override
protected void onHitEntity(EntityHitResult result) {
Entity entity = result.getEntity();
if (entity == this.getOwner() || entity == this.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);
ModUtils.PACKET_HANDLER.send(PacketDistributor.PLAYER.with(() -> player), new ClientIndicatorMessage(0, 5));
}
}
entity.hurt(ModDamageTypes.causeCannonFireDamage(this.level().registryAccess(), this, this.getOwner()), this.damage);
if (entity instanceof LivingEntity) {
entity.invulnerableTime = 0;
}
if (this.tickCount > 1) {
if (this.level() instanceof ServerLevel) {
causeRocketExplode(this,
ModDamageTypes.causeProjectileBoomDamage(this.level().registryAccess(), this, this.getOwner()),
entity, this.explosion_damage, this.explosion_radius, 1);
}
}
this.discard();
}
@Override
public void onHitBlock(BlockHitResult blockHitResult) {
super.onHitBlock(blockHitResult);
if (this.tickCount > 1) {
if (this.level() instanceof ServerLevel) {
causeRocketExplode(this,
ModDamageTypes.causeProjectileBoomDamage(this.level().registryAccess(), this, this.getOwner()),
this, this.explosion_damage, this.explosion_radius, 1);
}
}
this.discard();
}
@Override
public void tick() {
super.tick();
if (this.tickCount == 3) {
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 > 2) {
this.setDeltaMovement(this.getDeltaMovement().multiply(1.025, 1.025, 1.025));
if (!this.level().isClientSide() && this.level() instanceof ServerLevel serverLevel) {
ParticleTool.sendParticle(serverLevel, ParticleTypes.SMOKE, this.xo, this.yo, this.zo, 1, 0, 0, 0, 0, true);
}
}
if (this.tickCount > 100 || this.isInWater()) {
if (this.level() instanceof ServerLevel) {
causeRocketExplode(this,
ModDamageTypes.causeProjectileBoomDamage(this.level().registryAccess(), this, this.getOwner()),
this, this.explosion_damage, this.explosion_radius, 1);
}
this.discard();
}
}
public static void causeRocketExplode(ThrowableItemProjectile projectile, @Nullable DamageSource source, Entity target, float damage, float radius, float damageMultiplier) {
CustomExplosion explosion = new CustomExplosion(projectile.level(), projectile, source, damage,
target.getX(), target.getY(), target.getZ(), radius, ExplosionDestroyConfig.EXPLOSION_DESTROY.get() ? Explosion.BlockInteraction.DESTROY : Explosion.BlockInteraction.KEEP).setDamageMultiplier(damageMultiplier);
explosion.explode();
net.minecraftforge.event.ForgeEventFactory.onExplosionStart(projectile.level(), explosion);
explosion.finalizeExplosion(false);
ParticleTool.spawnMediumExplosionParticles(projectile.level(), projectile.position());
projectile.discard();
}
private PlayState movementPredicate(AnimationState<HeliRocketEntity> event) {
return event.setAndContinue(RawAnimation.begin().thenLoop("animation.rpg.idle"));
}
@Override
protected float getGravity() {
return 0.002f;
}
public String getSyncedAnimation() {
return null;
}
public void setAnimation(String animation) {
}
@Override
public void setAnimationProcedure(String procedure) {
}
@Override
public void registerControllers(AnimatableManager.ControllerRegistrar data) {
data.add(new AnimationController<>(this, "movement", 0, this::movementPredicate));
}
@Override
public AnimatableInstanceCache getAnimatableInstanceCache() {
return this.cache;
}
}

View file

@ -2,12 +2,9 @@ package com.atsuishio.superbwarfare.entity.vehicle;
import com.atsuishio.superbwarfare.ModUtils;
import com.atsuishio.superbwarfare.config.server.ExplosionDestroyConfig;
import com.atsuishio.superbwarfare.entity.projectile.GunGrenadeEntity;
import com.atsuishio.superbwarfare.entity.projectile.HeliRocketEntity;
import com.atsuishio.superbwarfare.entity.projectile.ProjectileEntity;
import com.atsuishio.superbwarfare.init.ModDamageTypes;
import com.atsuishio.superbwarfare.init.ModEntities;
import com.atsuishio.superbwarfare.init.ModParticleTypes;
import com.atsuishio.superbwarfare.init.ModSounds;
import com.atsuishio.superbwarfare.init.*;
import com.atsuishio.superbwarfare.network.message.ShakeClientMessage;
import com.atsuishio.superbwarfare.tools.CustomExplosion;
import com.atsuishio.superbwarfare.tools.EntityFindUtil;
@ -34,6 +31,7 @@ import net.minecraft.world.entity.LivingEntity;
import net.minecraft.world.entity.Pose;
import net.minecraft.world.entity.player.Player;
import net.minecraft.world.entity.vehicle.DismountHelper;
import net.minecraft.world.item.ItemStack;
import net.minecraft.world.level.Explosion;
import net.minecraft.world.level.Level;
import net.minecraft.world.level.gameevent.GameEvent;
@ -59,21 +57,24 @@ import java.util.List;
import static com.atsuishio.superbwarfare.tools.ParticleTool.sendParticle;
public class Ah6Entity extends MobileVehicleEntity implements GeoEntity, IHelicopterEntity, MultiWeaponVehicleEntity {
public class Ah6Entity extends ContainerMobileEntity implements GeoEntity, IHelicopterEntity, MultiWeaponVehicleEntity {
private final AnimatableInstanceCache cache = GeckoLibUtil.createInstanceCache(this);
public static final float MAX_HEALTH = 300;
public static final float MAX_HEALTH = 400;
public static final int MAX_ENERGY = 4000000;
public static final EntityDataAccessor<Float> DELTA_ROT = SynchedEntityData.defineId(Ah6Entity.class, EntityDataSerializers.FLOAT);
public static final EntityDataAccessor<Float> PROPELLER_ROT = SynchedEntityData.defineId(Ah6Entity.class, EntityDataSerializers.FLOAT);
public static final EntityDataAccessor<Integer> WEAPON_TYPE = SynchedEntityData.defineId(Ah6Entity.class, EntityDataSerializers.INT);
public static final EntityDataAccessor<Integer> AMMO = SynchedEntityData.defineId(Ah6Entity.class, EntityDataSerializers.INT);
public static final EntityDataAccessor<Integer> LOADED_ROCKET = SynchedEntityData.defineId(Ah6Entity.class, EntityDataSerializers.INT);
public boolean engineStart;
public boolean engineStartOver;
public float propellerRot;
public float propellerRotO;
public double velocity;
public int reloadCoolDown;
public int fireIndex;
public Ah6Entity(PlayMessages.SpawnEntity packet, Level world) {
@ -88,6 +89,8 @@ public class Ah6Entity extends MobileVehicleEntity implements GeoEntity, IHelico
@Override
protected void defineSynchedData() {
super.defineSynchedData();
this.entityData.define(AMMO, 0);
this.entityData.define(LOADED_ROCKET, 0);
this.entityData.define(DELTA_ROT, 0f);
this.entityData.define(WEAPON_TYPE, 0);
this.entityData.define(PROPELLER_ROT, 0f);
@ -96,11 +99,13 @@ public class Ah6Entity extends MobileVehicleEntity implements GeoEntity, IHelico
@Override
public void addAdditionalSaveData(CompoundTag compound) {
super.addAdditionalSaveData(compound);
compound.putInt("LoadedRocket", this.entityData.get(LOADED_ROCKET));
}
@Override
public void readAdditionalSaveData(CompoundTag compound) {
super.readAdditionalSaveData(compound);
this.entityData.set(LOADED_ROCKET, compound.getInt("LoadedRocket"));
}
@Override
@ -135,6 +140,27 @@ public class Ah6Entity extends MobileVehicleEntity implements GeoEntity, IHelico
propellerRotO = this.getPropellerRot();
super.baseTick();
if (this.level() instanceof ServerLevel) {
if (reloadCoolDown > 0){
reloadCoolDown--;
}
Player player = (Player) this.getFirstPassenger();
if (player != null) {
if ((this.getItemStacks().stream().filter(stack -> stack.is(ModItems.ROCKET_70.get())).mapToInt(ItemStack::getCount).sum() > 0 || player.getInventory().hasAnyMatching(s -> s.is(ModItems.CREATIVE_AMMO_BOX.get()))) && reloadCoolDown == 0 && this.getEntityData().get(LOADED_ROCKET) < 14) {
this.entityData.set(LOADED_ROCKET,this.getEntityData().get(LOADED_ROCKET) + 1);
reloadCoolDown = 30;
this.getItemStacks().stream().filter(stack -> stack.is(ModItems.ROCKET_70.get())).findFirst().ifPresent(stack -> stack.shrink(1));
this.level().playSound(null, this, ModSounds.MISSILE_RELOAD.get(), this.getSoundSource(), 1, 1);
}
}
if (this.getEntityData().get(WEAPON_TYPE) == 0) {
this.entityData.set(AMMO, this.getItemStacks().stream().filter(stack -> stack.is(ModItems.HEAVY_AMMO.get())).mapToInt(ItemStack::getCount).sum());
} else {
this.entityData.set(AMMO, this.getEntityData().get(LOADED_ROCKET));
}
}
if (this.onGround()) {
this.setDeltaMovement(this.getDeltaMovement().multiply(0.8, 0.95, 0.8));
this.setZRot(this.roll * 0.9f);
@ -333,7 +359,7 @@ public class Ah6Entity extends MobileVehicleEntity implements GeoEntity, IHelico
List<Entity> passenger = this.getPassengers();
for (var e : passenger) {
if (e instanceof LivingEntity living) {
if (e instanceof ServerPlayer victim) {
if (e instanceof ServerPlayer victim && !(victim.isCreative() || victim.isSpectator())) {
living.setHealth(0);
if (attacker == null || attacker == victim) {
living.level().players().forEach(
@ -404,7 +430,7 @@ public class Ah6Entity extends MobileVehicleEntity implements GeoEntity, IHelico
Vector4f worldPositionLeft;
if (entityData.get(WEAPON_TYPE) == 0) {
x = 1f;
x = 1.1f;
y = 0.62f;
z = 0.8f;
@ -417,10 +443,10 @@ public class Ah6Entity extends MobileVehicleEntity implements GeoEntity, IHelico
.headShot(2f)
.zoom(false);
projectileRight.heBullet(true, 5);
projectileRight.bypassArmorRate(1);
projectileRight.heBullet(true, 3);
projectileRight.bypassArmorRate(0.5f);
projectileRight.setPos(worldPositionRight.x, worldPositionRight.y, worldPositionRight.z);
projectileRight.shoot(player, this.getLookAngle().x, this.getLookAngle().y+ 0.03, this.getLookAngle().z, 20,
projectileRight.shoot(player, this.getLookAngle().x, this.getLookAngle().y + 0.025, this.getLookAngle().z, 20,
(float) 0.2);
this.level().addFreshEntity(projectileRight);
sendParticle((ServerLevel) this.level(), ParticleTypes.LARGE_SMOKE, worldPositionRight.x, worldPositionRight.y, worldPositionRight.z, 1, 0, 0, 0, 0, false);
@ -431,10 +457,10 @@ public class Ah6Entity extends MobileVehicleEntity implements GeoEntity, IHelico
.headShot(2f)
.zoom(false);
projectileLeft.heBullet(true, 5);
projectileLeft.bypassArmorRate(1);
projectileLeft.heBullet(true, 3);
projectileLeft.bypassArmorRate(0.5f);
projectileLeft.setPos(worldPositionLeft.x, worldPositionLeft.y, worldPositionLeft.z);
projectileLeft.shoot(player, this.getLookAngle().x, this.getLookAngle().y + 0.03, this.getLookAngle().z, 20,
projectileLeft.shoot(player, this.getLookAngle().x, this.getLookAngle().y + 0.025, this.getLookAngle().z, 20,
(float) 0.2);
this.level().addFreshEntity(projectileLeft);
sendParticle((ServerLevel) this.level(), ParticleTypes.LARGE_SMOKE, worldPositionLeft.x, worldPositionLeft.y, worldPositionLeft.z, 1, 0, 0, 0, 0, false);
@ -446,8 +472,20 @@ public class Ah6Entity extends MobileVehicleEntity implements GeoEntity, IHelico
serverPlayer.playSound(ModSounds.HELICOPTER_CANNON_VERYFAR.get(), 24, 1);
}
}
} else if (entityData.get(WEAPON_TYPE) == 1) {
x = 1.15f;
this.getItemStacks().stream().filter(stack -> stack.is(ModItems.HEAVY_AMMO.get())).findFirst().ifPresent(stack -> stack.shrink(1));
Level level = player.level();
final Vec3 center = new Vec3(this.getX(), this.getEyeY(), this.getZ());
for (Entity target : level.getEntitiesOfClass(Entity.class, new AABB(center, center).inflate(6), e -> true).stream().sorted(Comparator.comparingDouble(e -> e.distanceToSqr(center))).toList()) {
if (target instanceof ServerPlayer serverPlayer) {
ModUtils.PACKET_HANDLER.send(PacketDistributor.PLAYER.with(() -> serverPlayer), new ShakeClientMessage(6, 5, 7, this.getX(), this.getEyeY(), this.getZ()));
}
}
} else if (entityData.get(WEAPON_TYPE) == 1 && this.getEntityData().get(LOADED_ROCKET) > 0) {
x = 1.7f;
y = 0.62f;
z = 0.8f;
@ -455,24 +493,24 @@ public class Ah6Entity extends MobileVehicleEntity implements GeoEntity, IHelico
worldPositionLeft = transformPosition(transform, x, y, z);
if (fireIndex == 0) {
GunGrenadeEntity gunGrenadeEntity = new GunGrenadeEntity(player, player.level(),
110,
40,
6);
gunGrenadeEntity.setPos(worldPositionRight.x, worldPositionRight.y, worldPositionRight.z);
gunGrenadeEntity.shoot(this.getLookAngle().x, this.getLookAngle().y+ 0.03, this.getLookAngle().z, 8, 0.25f);
player.level().addFreshEntity(gunGrenadeEntity);
fireIndex = 1;
} else if (fireIndex == 1){
GunGrenadeEntity gunGrenadeEntityLeft = new GunGrenadeEntity(player, player.level(),
110,
HeliRocketEntity heliRocketEntityRight = new HeliRocketEntity(player, player.level(),
140,
40,
5);
gunGrenadeEntityLeft.setPos(worldPositionLeft.x, worldPositionLeft.y, worldPositionLeft.z);
gunGrenadeEntityLeft.shoot(this.getLookAngle().x, this.getLookAngle().y+ 0.03, this.getLookAngle().z, 8, 0.25f);
player.level().addFreshEntity(gunGrenadeEntityLeft);
heliRocketEntityRight.setPos(worldPositionRight.x, worldPositionRight.y, worldPositionRight.z);
heliRocketEntityRight.shoot(this.getLookAngle().x, this.getLookAngle().y + 0.0125, this.getLookAngle().z, 5, 0.25f);
player.level().addFreshEntity(heliRocketEntityRight);
fireIndex = 1;
} else if (fireIndex == 1){
HeliRocketEntity heliRocketEntityLeft = new HeliRocketEntity(player, player.level(),
140,
40,
5);
heliRocketEntityLeft.setPos(worldPositionLeft.x, worldPositionLeft.y, worldPositionLeft.z);
heliRocketEntityLeft.shoot(this.getLookAngle().x, this.getLookAngle().y + 0.0125, this.getLookAngle().z, 5, 0.25f);
player.level().addFreshEntity(heliRocketEntityLeft);
fireIndex = 0;
}
@ -481,14 +519,17 @@ public class Ah6Entity extends MobileVehicleEntity implements GeoEntity, IHelico
serverPlayer.playSound(ModSounds.HELICOPTER_ROCKET_FIRE_3P.get(), 6, 1);
}
}
}
Level level = player.level();
final Vec3 center = new Vec3(this.getX(), this.getEyeY(), this.getZ());
this.entityData.set(LOADED_ROCKET, this.getEntityData().get(LOADED_ROCKET) - 1);
reloadCoolDown = 30;
for (Entity target : level.getEntitiesOfClass(Entity.class, new AABB(center, center).inflate(6), e -> true).stream().sorted(Comparator.comparingDouble(e -> e.distanceToSqr(center))).toList()) {
if (target instanceof ServerPlayer serverPlayer) {
ModUtils.PACKET_HANDLER.send(PacketDistributor.PLAYER.with(() -> serverPlayer), new ShakeClientMessage(6, 5, 7, this.getX(), this.getEyeY(), this.getZ()));
Level level = player.level();
final Vec3 center = new Vec3(this.getX(), this.getEyeY(), this.getZ());
for (Entity target : level.getEntitiesOfClass(Entity.class, new AABB(center, center).inflate(6), e -> true).stream().sorted(Comparator.comparingDouble(e -> e.distanceToSqr(center))).toList()) {
if (target instanceof ServerPlayer serverPlayer) {
ModUtils.PACKET_HANDLER.send(PacketDistributor.PLAYER.with(() -> serverPlayer), new ShakeClientMessage(6, 5, 7, this.getX(), this.getEyeY(), this.getZ()));
}
}
}
}
@ -534,17 +575,22 @@ public class Ah6Entity extends MobileVehicleEntity implements GeoEntity, IHelico
@Override
public int mainGunRpm() {
return 300;
return 480;
}
@Override
public boolean canShoot(Player player) {
return true;
if (entityData.get(WEAPON_TYPE) == 0) {
return this.entityData.get(AMMO) > 0 || player.getInventory().hasAnyMatching(s -> s.is(ModItems.CREATIVE_AMMO_BOX.get()));
} else if (entityData.get(WEAPON_TYPE) == 1) {
return this.entityData.get(AMMO) > 0;
}
return false;
}
@Override
public int getAmmoCount(Player player) {
return -1;
return this.entityData.get(AMMO);
}
@ -570,9 +616,13 @@ public class Ah6Entity extends MobileVehicleEntity implements GeoEntity, IHelico
@Override
public void changeWeapon() {
entityData.set(WEAPON_TYPE, entityData.get(WEAPON_TYPE) + 1);
if (entityData.get(WEAPON_TYPE) == 2) {
// entityData.set(WEAPON_TYPE, entityData.get(WEAPON_TYPE) + 1);
if (entityData.get(WEAPON_TYPE) == 0) {
this.level().playSound(null, this, ModSounds.INTO_MISSILE.get(), this.getSoundSource(), 1, 1);
entityData.set(WEAPON_TYPE, 1);
} else if (entityData.get(WEAPON_TYPE) == 1) {
entityData.set(WEAPON_TYPE, 0);
this.level().playSound(null, this, ModSounds.INTO_CANNON.get(), this.getSoundSource(), 1, 1);
}
}

View file

@ -0,0 +1,203 @@
package com.atsuishio.superbwarfare.entity.vehicle;
import com.atsuishio.superbwarfare.menu.VehicleMenu;
import net.minecraft.core.Direction;
import net.minecraft.core.NonNullList;
import net.minecraft.nbt.CompoundTag;
import net.minecraft.resources.ResourceLocation;
import net.minecraft.world.ContainerHelper;
import net.minecraft.world.Containers;
import net.minecraft.world.entity.EntityType;
import net.minecraft.world.entity.HasCustomInventoryScreen;
import net.minecraft.world.entity.item.ItemEntity;
import net.minecraft.world.entity.player.Inventory;
import net.minecraft.world.entity.player.Player;
import net.minecraft.world.entity.vehicle.ContainerEntity;
import net.minecraft.world.inventory.AbstractContainerMenu;
import net.minecraft.world.item.ItemStack;
import net.minecraft.world.level.Level;
import net.minecraft.world.level.block.entity.HopperBlockEntity;
import net.minecraft.world.level.gameevent.GameEvent;
import net.minecraftforge.common.capabilities.Capability;
import net.minecraftforge.common.capabilities.ForgeCapabilities;
import net.minecraftforge.common.util.LazyOptional;
import net.minecraftforge.items.wrapper.InvWrapper;
import org.jetbrains.annotations.Nullable;
import java.util.List;
public class ContainerMobileEntity extends MobileVehicleEntity implements HasCustomInventoryScreen, ContainerEntity {
public static final int CONTAINER_SIZE = 102;
private NonNullList<ItemStack> items = NonNullList.withSize(CONTAINER_SIZE, ItemStack.EMPTY);
private LazyOptional<?> itemHandler = LazyOptional.of(() -> new InvWrapper(this));
public ContainerMobileEntity(EntityType<?> pEntityType, Level pLevel) {
super(pEntityType, pLevel);
}
@Override
protected void defineSynchedData() {
super.defineSynchedData();
}
@Override
public void addAdditionalSaveData(CompoundTag compound) {
super.addAdditionalSaveData(compound);
ContainerHelper.saveAllItems(compound, this.getItemStacks());
}
@Override
public void readAdditionalSaveData(CompoundTag compound) {
super.readAdditionalSaveData(compound);
ContainerHelper.loadAllItems(compound, this.getItemStacks());
}
@Override
public void remove(RemovalReason pReason) {
if (!this.level().isClientSide && pReason != RemovalReason.DISCARDED) {
Containers.dropContents(this.level(), this, this);
}
super.remove(pReason);
}
@Override
public void baseTick() {
super.baseTick();
pickUpItem();
this.refreshDimensions();
}
public void pickUpItem() {
List<ItemEntity> list = this.level().getEntitiesOfClass(ItemEntity.class, this.getBoundingBox().inflate(0.2F, 0.1, 0.2F));
if (!list.isEmpty()) {
for (ItemEntity entity : list) {
if (!this.level().isClientSide) {
HopperBlockEntity.addItem(this, entity);
}
}
}
}
@Override
public void openCustomInventoryScreen(Player pPlayer) {
pPlayer.openMenu(this);
if (!pPlayer.level().isClientSide) {
this.gameEvent(GameEvent.CONTAINER_OPEN, pPlayer);
}
}
@Nullable
@Override
public ResourceLocation getLootTable() {
return null;
}
@Override
public void setLootTable(@Nullable ResourceLocation pLootTable) {
}
@Override
public long getLootTableSeed() {
return 0;
}
@Override
public void setLootTableSeed(long pLootTableSeed) {
}
@Override
public NonNullList<ItemStack> getItemStacks() {
return this.items;
}
@Override
public void clearItemStacks() {
this.items.clear();
}
@Override
public int getContainerSize() {
return CONTAINER_SIZE;
}
@Override
public ItemStack getItem(int pSlot) {
return this.items.get(pSlot);
}
@Override
public ItemStack removeItem(int pSlot, int pAmount) {
return ContainerHelper.removeItem(this.items, pSlot, pAmount);
}
@Override
public ItemStack removeItemNoUpdate(int pSlot) {
ItemStack itemstack = this.getItemStacks().get(pSlot);
if (itemstack.isEmpty()) {
return ItemStack.EMPTY;
} else {
this.getItemStacks().set(pSlot, ItemStack.EMPTY);
return itemstack;
}
}
@Override
public void setItem(int pSlot, ItemStack pStack) {
this.getItemStacks().set(pSlot, pStack);
if (!pStack.isEmpty() && pStack.getCount() > this.getMaxStackSize()) {
pStack.setCount(this.getMaxStackSize());
}
}
@Override
public void setChanged() {
}
@Override
public boolean stillValid(Player pPlayer) {
return !this.isRemoved() && this.position().closerThan(pPlayer.position(), 8.0D);
}
@Override
public void clearContent() {
this.getItemStacks().clear();
}
@Nullable
@Override
public AbstractContainerMenu createMenu(int pContainerId, Inventory pPlayerInventory, Player pPlayer) {
if (pPlayer.isSpectator()) {
return null;
} else {
return new VehicleMenu(pContainerId, pPlayerInventory, this);
}
}
@Override
public <T> LazyOptional<T> getCapability(Capability<T> capability, @Nullable Direction facing) {
if (this.isAlive() && capability == ForgeCapabilities.ITEM_HANDLER) {
return itemHandler.cast();
}
return super.getCapability(capability, facing);
}
@Override
public void invalidateCaps() {
super.invalidateCaps();
itemHandler.invalidate();
}
@Override
public void reviveCaps() {
super.reviveCaps();
itemHandler = LazyOptional.of(() -> new InvWrapper(this));
}
@Override
public void stopOpen(Player pPlayer) {
this.level().gameEvent(GameEvent.CONTAINER_CLOSE, this.position(), GameEvent.Context.of(pPlayer));
}
}

View file

@ -5,19 +5,13 @@ import com.atsuishio.superbwarfare.config.server.CannonConfig;
import com.atsuishio.superbwarfare.config.server.ExplosionDestroyConfig;
import com.atsuishio.superbwarfare.entity.projectile.ProjectileEntity;
import com.atsuishio.superbwarfare.init.*;
import com.atsuishio.superbwarfare.item.PerkItem;
import com.atsuishio.superbwarfare.menu.VehicleMenu;
import com.atsuishio.superbwarfare.network.ModVariables;
import com.atsuishio.superbwarfare.network.message.ShakeClientMessage;
import com.atsuishio.superbwarfare.perk.AmmoPerk;
import com.atsuishio.superbwarfare.perk.Perk;
import com.atsuishio.superbwarfare.tools.CustomExplosion;
import com.atsuishio.superbwarfare.tools.EntityFindUtil;
import com.atsuishio.superbwarfare.tools.ParticleTool;
import com.atsuishio.superbwarfare.tools.SoundTool;
import net.minecraft.core.BlockPos;
import net.minecraft.core.Direction;
import net.minecraft.core.NonNullList;
import net.minecraft.core.particles.ParticleTypes;
import net.minecraft.nbt.CompoundTag;
import net.minecraft.network.protocol.Packet;
@ -25,44 +19,27 @@ import net.minecraft.network.protocol.game.ClientGamePacketListener;
import net.minecraft.network.syncher.EntityDataAccessor;
import net.minecraft.network.syncher.EntityDataSerializers;
import net.minecraft.network.syncher.SynchedEntityData;
import net.minecraft.resources.ResourceLocation;
import net.minecraft.server.level.ServerLevel;
import net.minecraft.server.level.ServerPlayer;
import net.minecraft.sounds.SoundEvent;
import net.minecraft.sounds.SoundSource;
import net.minecraft.util.Mth;
import net.minecraft.world.ContainerHelper;
import net.minecraft.world.Containers;
import net.minecraft.world.damagesource.DamageSource;
import net.minecraft.world.effect.MobEffect;
import net.minecraft.world.effect.MobEffectInstance;
import net.minecraft.world.entity.Entity;
import net.minecraft.world.entity.EntityType;
import net.minecraft.world.entity.HasCustomInventoryScreen;
import net.minecraft.world.entity.item.ItemEntity;
import net.minecraft.world.entity.player.Inventory;
import net.minecraft.world.entity.player.Player;
import net.minecraft.world.entity.vehicle.ContainerEntity;
import net.minecraft.world.inventory.AbstractContainerMenu;
import net.minecraft.world.item.ItemStack;
import net.minecraft.world.level.Explosion;
import net.minecraft.world.level.Level;
import net.minecraft.world.level.block.Blocks;
import net.minecraft.world.level.block.entity.HopperBlockEntity;
import net.minecraft.world.level.block.state.BlockState;
import net.minecraft.world.level.gameevent.GameEvent;
import net.minecraft.world.phys.AABB;
import net.minecraft.world.phys.Vec3;
import net.minecraftforge.common.capabilities.Capability;
import net.minecraftforge.common.capabilities.ForgeCapabilities;
import net.minecraftforge.common.util.LazyOptional;
import net.minecraftforge.fluids.FluidType;
import net.minecraftforge.items.wrapper.InvWrapper;
import net.minecraftforge.network.NetworkHooks;
import net.minecraftforge.network.PacketDistributor;
import net.minecraftforge.network.PlayMessages;
import net.minecraftforge.registries.ForgeRegistries;
import org.jetbrains.annotations.Nullable;
import org.joml.Math;
import software.bernie.geckolib.animatable.GeoEntity;
import software.bernie.geckolib.core.animatable.instance.AnimatableInstanceCache;
@ -73,13 +50,11 @@ import software.bernie.geckolib.core.animation.RawAnimation;
import software.bernie.geckolib.core.object.PlayState;
import software.bernie.geckolib.util.GeckoLibUtil;
import java.util.ArrayList;
import java.util.Comparator;
import java.util.List;
import static com.atsuishio.superbwarfare.tools.ParticleTool.sendParticle;
public class SpeedboatEntity extends MobileVehicleEntity implements GeoEntity, IChargeEntity, IArmedVehicleEntity, HasCustomInventoryScreen, ContainerEntity {
public class SpeedboatEntity extends ContainerMobileEntity implements GeoEntity, IChargeEntity, IArmedVehicleEntity {
public static final EntityDataAccessor<Integer> FIRE_ANIM = SynchedEntityData.defineId(SpeedboatEntity.class, EntityDataSerializers.INT);
public static final EntityDataAccessor<Float> DELTA_ROT = SynchedEntityData.defineId(SpeedboatEntity.class, EntityDataSerializers.FLOAT);
@ -88,10 +63,6 @@ public class SpeedboatEntity extends MobileVehicleEntity implements GeoEntity, I
public static final float MAX_HEALTH = CannonConfig.SPEEDBOAT_HP.get();
public static final int MAX_ENERGY = CannonConfig.SPEEDBOAT_MAX_ENERGY.get();
public static final int CONTAINER_SIZE = 105;
private NonNullList<ItemStack> items = NonNullList.withSize(CONTAINER_SIZE, ItemStack.EMPTY);
private LazyOptional<?> itemHandler = LazyOptional.of(() -> new InvWrapper(this));
private final AnimatableInstanceCache cache = GeckoLibUtil.createInstanceCache(this);
public float turretYRot;
@ -125,14 +96,11 @@ public class SpeedboatEntity extends MobileVehicleEntity implements GeoEntity, I
@Override
public void addAdditionalSaveData(CompoundTag compound) {
super.addAdditionalSaveData(compound);
compound.putFloat("Energy", this.entityData.get(ENERGY));
ContainerHelper.saveAllItems(compound, this.getItemStacks());
}
@Override
public void readAdditionalSaveData(CompoundTag compound) {
super.readAdditionalSaveData(compound);
ContainerHelper.loadAllItems(compound, this.getItemStacks());
}
@Override
@ -145,14 +113,6 @@ public class SpeedboatEntity extends MobileVehicleEntity implements GeoEntity, I
return super.getPassengersRidingOffset() - 0.8;
}
@Override
public void remove(Entity.RemovalReason pReason) {
if (!this.level().isClientSide && pReason != RemovalReason.DISCARDED) {
Containers.dropContents(this.level(), this, this);
}
super.remove(pReason);
}
@Override
public boolean hurt(DamageSource source, float amount) {
super.hurt(source, amount);
@ -241,7 +201,6 @@ public class SpeedboatEntity extends MobileVehicleEntity implements GeoEntity, I
collideBlock();
gunnerAngle();
pickUpItem();
this.refreshDimensions();
}
@ -268,43 +227,6 @@ public class SpeedboatEntity extends MobileVehicleEntity implements GeoEntity, I
.headShot(2f)
.zoom(false);
if (this.getItemStacks().size() > 102) {
ItemStack perkItem = this.getItemStacks().get(102);
if (perkItem.getItem() instanceof PerkItem perk) {
if (perk.getPerk() == ModPerks.SILVER_BULLET.get()) {
projectile.undeadMultiple(2.5f);
} else if (perk.getPerk() == ModPerks.BEAST_BULLET.get()) {
projectile.beast();
} else if (perk.getPerk() == ModPerks.JHP_BULLET.get()) {
projectile.jhpBullet(true, 3);
} else if (perk.getPerk() == ModPerks.HE_BULLET.get()) {
projectile.heBullet(true, 3);
} else if (perk.getPerk() == ModPerks.INCENDIARY_BULLET.get()) {
projectile.fireBullet(true, 3, false);
}
if (perk.getPerk() instanceof AmmoPerk ammoPerk) {
projectile.setRGB(ammoPerk.rgb);
if (!ammoPerk.mobEffects.get().isEmpty()) {
ArrayList<MobEffectInstance> mobEffectInstances = new ArrayList<>();
for (MobEffect effect : ammoPerk.mobEffects.get()) {
mobEffectInstances.add(new MobEffectInstance(effect, 160, 2));
}
projectile.effect(mobEffectInstances);
}
}
}
}
if (this.getItemStacks().size() > 104) {
ItemStack perkItem = this.getItemStacks().get(104);
if (perkItem.getItem() instanceof PerkItem perk) {
if (perk.getPerk() == ModPerks.MONSTER_HUNTER.get()) {
projectile.monsterMultiple(0.5f);
}
}
}
projectile.bypassArmorRate(0.9f);
projectile.setPos(this.xo - this.getViewVector(1).scale(0.54).x - this.getDeltaMovement().x, this.yo + 3.0, this.zo - this.getViewVector(1).scale(0.54).z - this.getDeltaMovement().z);
projectile.shoot(player, player.getLookAngle().x, player.getLookAngle().y + (zooming() ? 0.002f : -0.009f), player.getLookAngle().z, 20,
@ -479,17 +401,6 @@ public class SpeedboatEntity extends MobileVehicleEntity implements GeoEntity, I
}
}
public void pickUpItem() {
List<ItemEntity> list = this.level().getEntitiesOfClass(ItemEntity.class, this.getBoundingBox().inflate(0.2F, 0.1, 0.2F));
if (!list.isEmpty()) {
for (ItemEntity entity : list) {
if (!this.level().isClientSide) {
HopperBlockEntity.addItem(this, entity);
}
}
}
}
@Override
public void destroy() {
Entity attacker = EntityFindUtil.findEntity(this.level(), this.entityData.get(LAST_ATTACKER_UUID));
@ -545,139 +456,6 @@ public class SpeedboatEntity extends MobileVehicleEntity implements GeoEntity, I
return 5;
}
@Override
public void openCustomInventoryScreen(Player pPlayer) {
pPlayer.openMenu(this);
if (!pPlayer.level().isClientSide) {
this.gameEvent(GameEvent.CONTAINER_OPEN, pPlayer);
}
}
@Nullable
@Override
public ResourceLocation getLootTable() {
return null;
}
@Override
public void setLootTable(@Nullable ResourceLocation pLootTable) {
}
@Override
public long getLootTableSeed() {
return 0;
}
@Override
public void setLootTableSeed(long pLootTableSeed) {
}
@Override
public NonNullList<ItemStack> getItemStacks() {
return this.items;
}
@Override
public void clearItemStacks() {
this.items.clear();
}
@Override
public int getContainerSize() {
return CONTAINER_SIZE;
}
@Override
public ItemStack getItem(int pSlot) {
return this.items.get(pSlot);
}
@Override
public ItemStack removeItem(int pSlot, int pAmount) {
return ContainerHelper.removeItem(this.items, pSlot, pAmount);
}
@Override
public boolean canPlaceItem(int pIndex, ItemStack pStack) {
return switch (pIndex) {
case VehicleMenu.DEFAULT_AMMO_PERK_SLOT ->
pStack.getItem() instanceof PerkItem perkItem && perkItem.getPerk().type == Perk.Type.AMMO;
case VehicleMenu.DEFAULT_FUNC_PERK_SLOT ->
pStack.getItem() instanceof PerkItem perkItem && perkItem.getPerk().type == Perk.Type.FUNCTIONAL && perkItem.getPerk() == ModPerks.POWERFUL_ATTRACTION.get();
case VehicleMenu.DEFAULT_DAMAGE_PERK_SLOT ->
pStack.getItem() instanceof PerkItem perkItem && perkItem.getPerk().type == Perk.Type.DAMAGE && perkItem.getPerk() == ModPerks.MONSTER_HUNTER.get();
default -> true;
};
}
@Override
public ItemStack removeItemNoUpdate(int pSlot) {
ItemStack itemstack = this.getItemStacks().get(pSlot);
if (itemstack.isEmpty()) {
return ItemStack.EMPTY;
} else {
this.getItemStacks().set(pSlot, ItemStack.EMPTY);
return itemstack;
}
}
@Override
public void setItem(int pSlot, ItemStack pStack) {
this.getItemStacks().set(pSlot, pStack);
if (!pStack.isEmpty() && pStack.getCount() > this.getMaxStackSize()) {
pStack.setCount(this.getMaxStackSize());
}
}
@Override
public void setChanged() {
}
@Override
public boolean stillValid(Player pPlayer) {
return !this.isRemoved() && this.position().closerThan(pPlayer.position(), 8.0D);
}
@Override
public void clearContent() {
this.getItemStacks().clear();
}
@Nullable
@Override
public AbstractContainerMenu createMenu(int pContainerId, Inventory pPlayerInventory, Player pPlayer) {
if (pPlayer.isSpectator()) {
return null;
} else {
return new VehicleMenu(pContainerId, pPlayerInventory, this);
}
}
@Override
public <T> LazyOptional<T> getCapability(Capability<T> capability, @Nullable Direction facing) {
if (this.isAlive() && capability == ForgeCapabilities.ITEM_HANDLER) {
return itemHandler.cast();
}
return super.getCapability(capability, facing);
}
@Override
public void invalidateCaps() {
super.invalidateCaps();
itemHandler.invalidate();
}
@Override
public void reviveCaps() {
super.reviveCaps();
itemHandler = LazyOptional.of(() -> new InvWrapper(this));
}
@Override
public void stopOpen(Player pPlayer) {
this.level().gameEvent(GameEvent.CONTAINER_CLOSE, this.position(), GameEvent.Context.of(pPlayer));
}
@Override
public int getMaxEnergy() {
return MAX_ENERGY;

View file

@ -720,20 +720,6 @@ public class LivingEventHandler {
if (!(sourceEntity instanceof Player player)) return;
ItemStack stack = player.getMainHandItem();
if (sourceEntity.getVehicle() instanceof IArmedVehicleEntity vehicle && DamageTypeTool.isGunDamage(source) && !stack.is(ModTags.Items.GUN)) {
var drops = event.getDrops();
if (vehicle instanceof ContainerEntity containerEntity) {
drops.forEach(itemEntity -> {
ItemStack item = itemEntity.getItem();
if (!HopperBlockEntity.addItem(containerEntity, itemEntity)) {
player.drop(item, false);
}
});
event.setCanceled(true);
return;
}
}
if (sourceEntity.getVehicle() instanceof IArmedVehicleEntity vehicle && source.is(ModDamageTypes.VEHICLE_STRIKE)) {
var drops = event.getDrops();
if (vehicle instanceof ContainerEntity containerEntity) {

View file

@ -68,6 +68,8 @@ public class ModEntities {
EntityType.Builder.<WheelChairEntity>of(WheelChairEntity::new, MobCategory.MISC).setShouldReceiveVelocityUpdates(true).setTrackingRange(512).setUpdateInterval(3).setCustomClientFactory(WheelChairEntity::new).fireImmune().sized(1.0f, 1.0f));
public static final RegistryObject<EntityType<Ah6Entity>> AH_6 = register("ah_6",
EntityType.Builder.<Ah6Entity>of(Ah6Entity::new, MobCategory.MISC).setShouldReceiveVelocityUpdates(true).setTrackingRange(512).setUpdateInterval(3).setCustomClientFactory(Ah6Entity::new).fireImmune().sized(2.8f, 2.9f));
public static final RegistryObject<EntityType<HeliRocketEntity>> HELI_ROCKET = register("projectile_heli_rocket",
EntityType.Builder.<HeliRocketEntity>of(HeliRocketEntity::new, MobCategory.MISC).setShouldReceiveVelocityUpdates(true).setTrackingRange(512).setUpdateInterval(1).setCustomClientFactory(HeliRocketEntity::new).sized(0.5f, 0.5f));
private static <T extends Entity> RegistryObject<EntityType<T>> register(String name, EntityType.Builder<T> entityTypeBuilder) {
return REGISTRY.register(name, () -> entityTypeBuilder.build(name));

View file

@ -18,6 +18,7 @@ public class ModEntityRenderers {
event.registerEntityRenderer(ModEntities.GUN_GRENADE.get(), GunGrenadeRenderer::new);
event.registerEntityRenderer(ModEntities.TARGET.get(), TargetRenderer::new);
event.registerEntityRenderer(ModEntities.RPG_ROCKET.get(), RpgRocketRenderer::new);
event.registerEntityRenderer(ModEntities.HELI_ROCKET.get(), HeliRocketRenderer::new);
event.registerEntityRenderer(ModEntities.MORTAR_SHELL.get(), MortarShellRenderer::new);
event.registerEntityRenderer(ModEntities.CANNON_SHELL.get(), CannonShellRenderer::new);
event.registerEntityRenderer(ModEntities.PROJECTILE.get(), ProjectileEntityRenderer::new);

View file

@ -106,6 +106,7 @@ public class ModItems {
public static final RegistryObject<Item> RGO_GRENADE = AMMO.register("rgo_grenade", RgoGrenade::new);
public static final RegistryObject<Item> CLAYMORE_MINE = AMMO.register("claymore_mine", ClaymoreMine::new);
public static final RegistryObject<Item> HEAVY_AMMO = AMMO.register("heavy_ammo", () -> new Item(new Item.Properties()));
public static final RegistryObject<Item> ROCKET_70 = AMMO.register("rocket_70", () -> new Item(new Item.Properties()));
public static final RegistryObject<Item> BEAM_TEST = AMMO.register("beam_test", BeamTest::new);
/**

View file

@ -365,5 +365,8 @@ public class ModSounds {
public static final RegistryObject<SoundEvent> HELICOPTER_CANNON_VERYFAR = REGISTRY.register("heli_cannon_veryfar", () -> SoundEvent.createVariableRangeEvent(ModUtils.loc("heli_cannon_veryfar")));
public static final RegistryObject<SoundEvent> HELICOPTER_ROCKET_FIRE_1P = REGISTRY.register("heli_rocket_fire_1p", () -> SoundEvent.createVariableRangeEvent(ModUtils.loc("heli_rocket_fire_1p")));
public static final RegistryObject<SoundEvent> HELICOPTER_ROCKET_FIRE_3P = REGISTRY.register("heli_rocket_fire_3p", () -> SoundEvent.createVariableRangeEvent(ModUtils.loc("heli_rocket_fire_3p")));
public static final RegistryObject<SoundEvent> INTO_CANNON = REGISTRY.register("into_cannon", () -> SoundEvent.createVariableRangeEvent(ModUtils.loc("into_cannon")));
public static final RegistryObject<SoundEvent> INTO_MISSILE = REGISTRY.register("into_missile", () -> SoundEvent.createVariableRangeEvent(ModUtils.loc("into_missile")));
public static final RegistryObject<SoundEvent> MISSILE_RELOAD = REGISTRY.register("missile_reload", () -> SoundEvent.createVariableRangeEvent(ModUtils.loc("missile_reload")));
}

View file

@ -1,9 +1,6 @@
package com.atsuishio.superbwarfare.menu;
import com.atsuishio.superbwarfare.init.ModMenuTypes;
import com.atsuishio.superbwarfare.init.ModPerks;
import com.atsuishio.superbwarfare.item.PerkItem;
import com.atsuishio.superbwarfare.perk.Perk;
import net.minecraft.world.Container;
import net.minecraft.world.SimpleContainer;
import net.minecraft.world.entity.player.Inventory;
@ -13,14 +10,10 @@ import net.minecraft.world.inventory.Slot;
import net.minecraft.world.item.ItemStack;
public class VehicleMenu extends AbstractContainerMenu {
private final Container container;
private final int containerRows;
public static final int DEFAULT_SIZE = 105;
public static final int DEFAULT_AMMO_PERK_SLOT = 102;
public static final int DEFAULT_FUNC_PERK_SLOT = 103;
public static final int DEFAULT_DAMAGE_PERK_SLOT = 104;
public static final int DEFAULT_SIZE = 102;
public static final int X_OFFSET = 97;
public static final int Y_OFFSET = 20;
@ -44,10 +37,6 @@ public class VehicleMenu extends AbstractContainerMenu {
}
}
this.addSlot(new PerkSlot(pContainer, this.containerRows * 17, Perk.Type.AMMO, 8, 36));
this.addSlot(new PerkSlot(pContainer, this.containerRows * 17 + 1, Perk.Type.FUNCTIONAL, 8, 54));
this.addSlot(new PerkSlot(pContainer, this.containerRows * 17 + 2, Perk.Type.DAMAGE, 8, 72));
for (int l = 0; l < 3; ++l) {
for (int j = 0; j < 9; ++j) {
this.addSlot(new Slot(pPlayerInventory, j + l * 9 + 9, 8 + j * 18 + X_OFFSET, 84 + l * 18 + Y_OFFSET + i));
@ -70,13 +59,6 @@ public class VehicleMenu extends AbstractContainerMenu {
if (!this.moveItemStackTo(itemstack1, this.containerRows * 17 + 3, this.slots.size(), true)) {
return ItemStack.EMPTY;
}
} else if (itemstack1.getItem() instanceof PerkItem) {
if (!this.moveItemStackTo(itemstack1, this.containerRows * 17, this.containerRows * 17 + 3, false)) {
if (!this.moveItemStackTo(itemstack1, 0, this.containerRows * 17, false)) {
return ItemStack.EMPTY;
}
return ItemStack.EMPTY;
}
} else if (!this.moveItemStackTo(itemstack1, 0, this.containerRows * 17, false)) {
return ItemStack.EMPTY;
}
@ -96,30 +78,5 @@ public class VehicleMenu extends AbstractContainerMenu {
return this.container.stillValid(pPlayer);
}
static class PerkSlot extends Slot {
public Perk.Type type;
public PerkSlot(Container pContainer, int pSlot, Perk.Type type, int pX, int pY) {
super(pContainer, pSlot, pX, pY);
this.type = type;
}
@Override
public boolean mayPlace(ItemStack pStack) {
return pStack.getItem() instanceof PerkItem perkItem && perkItem.getPerk().type == this.type && switch (this.type) {
case AMMO:
yield true;
case FUNCTIONAL:
yield perkItem.getPerk() == ModPerks.POWERFUL_ATTRACTION.get();
case DAMAGE:
yield perkItem.getPerk() == ModPerks.MONSTER_HUNTER.get();
};
}
@Override
public int getMaxStackSize() {
return 1;
}
}
}

View file

@ -98,7 +98,7 @@ public abstract class CameraMixin {
return;
}
if (thirdPerson && entity.getVehicle() instanceof Ah6Entity) {
move(-getMaxZoom(6), 1, -2.0);
move(-getMaxZoom(7), 1, -2.7);
return;
}
if (Minecraft.getInstance().options.getCameraType() == CameraType.THIRD_PERSON_BACK && entity instanceof Player player && player.getMainHandItem().is(ModTags.Items.GUN)) {

View file

@ -64,61 +64,62 @@
"0.0": [0, 0, 0],
"0.5": [0, 0, 0],
"0.5417": [1.5, 1.5, 1.5],
"0.5667": [1, 1, 1],
"0.675": [1.05, 1.05, 1.05],
"0.5667": [0.6, 0.6, 0.6],
"0.675": [0.75, 0.75, 0.75],
"0.7833": [1.1, 1.1, 1.1],
"0.8917": [1.05121, 1.05121, 1.05121],
"1.0": [0.97056, 0.97056, 0.97056],
"1.0583": [0.955, 0.955, 0.955],
"1.0": [0.86056, 0.86056, 0.86056],
"1.0583": [0.775, 0.775, 0.775],
"1.1667": [0.97562, 0.97562, 0.97562],
"1.275": [1.01085, 1.01085, 1.01085],
"1.275": [0.90085, 0.90085, 0.90085],
"1.3833": [1.04249, 1.04249, 1.04249],
"1.4417": [1.05, 1.05, 1.05],
"1.4417": [1.22, 1.22, 1.22],
"1.55": [1.03425, 1.03425, 1.03425],
"1.6583": [1.0079, 1.0079, 1.0079],
"1.6583": [0.8379, 0.8379, 0.8379],
"1.7667": [0.98218, 0.98218, 0.98218],
"1.8583": [0.97, 0.97, 0.97],
"1.9667": [0.98318, 0.98318, 0.98318],
"2.075": [1.005, 1.005, 1.005],
"2.1833": [1.02682, 1.02682, 1.02682],
"2.2917": [1.04, 1.04, 1.04],
"2.4": [1.00495, 1.00495, 1.00495],
"2.5083": [0.95684, 0.95684, 0.95684],
"2.5333": [0.955, 0.955, 0.955],
"2.6417": [0.97562, 0.97562, 0.97562],
"2.75": [1.01085, 1.01085, 1.01085],
"2.8583": [1.04249, 1.04249, 1.04249],
"2.9167": [1.05, 1.05, 1.05],
"3.025": [1.03425, 1.03425, 1.03425],
"3.1333": [1.0079, 1.0079, 1.0079],
"3.2417": [0.98218, 0.98218, 0.98218],
"3.3333": [0.97, 0.97, 0.97],
"3.4417": [0.98318, 0.98318, 0.98318],
"3.55": [1.005, 1.005, 1.005],
"3.6583": [1.02682, 1.02682, 1.02682],
"3.7667": [1.04, 1.04, 1.04],
"3.875": [0.97636, 0.97636, 0.97636],
"3.9167": [0.94107, 0.94107, 0.94107],
"3.95": [0.955, 0.955, 0.955],
"4.0583": [0.99318, 0.99318, 0.99318],
"4.1667": [1.00498, 1.00498, 1.00498],
"4.275": [1.02112, 1.02112, 1.02112],
"4.325": [1.04197, 1.04197, 1.04197],
"4.3333": [1.05, 1.05, 1.05],
"4.4417": [1.04664, 1.04664, 1.04664],
"4.55": [1.00677, 1.00677, 1.00677],
"4.6583": [0.96833, 0.96833, 0.96833],
"4.7333": [0.95994, 0.95994, 0.95994],
"4.75": [0.97, 0.97, 0.97],
"4.8583": [1.00099, 1.00099, 1.00099],
"4.9667": [1.005, 1.005, 1.005],
"5.075": [1.00901, 1.00901, 1.00901],
"5.1667": [1.02741, 1.02741, 1.02741],
"5.1833": [1.04, 1.04, 1.04]
"1.8583": [0.68, 0.68, 0.68],
"1.9583": [0.75, 0.75, 0.75],
"2.0667": [1.1, 1.1, 1.1],
"2.175": [1.05121, 1.05121, 1.05121],
"2.2833": [0.86056, 0.86056, 0.86056],
"2.3417": [0.775, 0.775, 0.775],
"2.45": [0.97562, 0.97562, 0.97562],
"2.5583": [0.90085, 0.90085, 0.90085],
"2.6667": [1.04249, 1.04249, 1.04249],
"2.725": [1.22, 1.22, 1.22],
"2.8333": [1.03425, 1.03425, 1.03425],
"2.9417": [0.8379, 0.8379, 0.8379],
"3.05": [0.98218, 0.98218, 0.98218],
"3.1417": [0.68, 0.68, 0.68],
"3.2417": [0.75, 0.75, 0.75],
"3.35": [1.1, 1.1, 1.1],
"3.4583": [1.05121, 1.05121, 1.05121],
"3.5667": [0.86056, 0.86056, 0.86056],
"3.625": [0.775, 0.775, 0.775],
"3.7333": [0.97562, 0.97562, 0.97562],
"3.8417": [0.90085, 0.90085, 0.90085],
"3.95": [1.04249, 1.04249, 1.04249],
"4.0083": [1.22, 1.22, 1.22],
"4.1167": [1.03425, 1.03425, 1.03425],
"4.225": [0.8379, 0.8379, 0.8379],
"4.3333": [0.98218, 0.98218, 0.98218],
"4.425": [0.68, 0.68, 0.68],
"4.5333": [0.75, 0.75, 0.75],
"4.6417": [1.1, 1.1, 1.1],
"4.75": [1.05121, 1.05121, 1.05121],
"4.8583": [0.86056, 0.86056, 0.86056],
"4.9167": [0.775, 0.775, 0.775],
"5.025": [0.97562, 0.97562, 0.97562],
"5.1333": [0.90085, 0.90085, 0.90085],
"5.2417": [1.04249, 1.04249, 1.04249],
"5.3": [1.22, 1.22, 1.22],
"5.4083": [1.03425, 1.03425, 1.03425],
"5.5167": [0.8379, 0.8379, 0.8379],
"5.625": [0.98218, 0.98218, 0.98218],
"5.7167": [0.68, 0.68, 0.68]
}
}
}
}
},
"geckolib_format_version": 2
}
}

File diff suppressed because it is too large Load diff

View file

@ -0,0 +1,230 @@
{
"format_version": "1.12.0",
"minecraft:geometry": [
{
"description": {
"identifier": "geometry.rpg",
"texture_width": 64,
"texture_height": 64,
"visible_bounds_width": 91,
"visible_bounds_height": 8,
"visible_bounds_offset": [0, 2, 0]
},
"bones": [
{
"name": "bone",
"pivot": [0, 19.5, 0]
},
{
"name": "body",
"parent": "bone",
"pivot": [0, -18.5, 0],
"rotation": [90, 0, 0]
},
{
"name": "bone5",
"parent": "body",
"pivot": [-0.00215, -18.54737, 10.23332],
"cubes": [
{
"origin": [-0.23997, -19.18522, -16.12402],
"size": [0.53362, 1.28869, 34.12752],
"pivot": [0.02684, -18.54066, 3.13474],
"rotation": [0, 0, 90],
"uv": {
"north": {"uv": [9, 12], "uv_size": [1, 1]},
"south": {"uv": [12, 10], "uv_size": [1, 1]},
"up": {"uv": [0, 0], "uv_size": [1, 34]},
"down": {"uv": [1, 34], "uv_size": [1, -34]}
}
},
{
"origin": [-0.24018, -19.185, -16.12402],
"size": [0.53362, 1.28869, 34.12752],
"pivot": [0.02663, -18.54066, 9.18974],
"rotation": [0, 0, 45],
"uv": {
"north": {"uv": [12, 11], "uv_size": [1, 1]},
"south": {"uv": [12, 12], "uv_size": [1, 1]},
"up": {"uv": [2, 0], "uv_size": [1, 34]},
"down": {"uv": [3, 34], "uv_size": [1, -34]}
}
},
{
"origin": [-0.24018, -19.185, -16.12402],
"size": [0.53362, 1.28869, 34.12752],
"uv": {
"north": {"uv": [13, 0], "uv_size": [1, 1]},
"south": {"uv": [13, 1], "uv_size": [1, 1]},
"up": {"uv": [4, 0], "uv_size": [1, 34]},
"down": {"uv": [5, 34], "uv_size": [1, -34]}
}
},
{
"origin": [-0.24018, -19.185, -16.12402],
"size": [0.53362, 1.28869, 34.12752],
"pivot": [0.02663, -18.54066, 9.18974],
"rotation": [0, 0, -45],
"uv": {
"north": {"uv": [13, 2], "uv_size": [1, 1]},
"south": {"uv": [13, 3], "uv_size": [1, 1]},
"up": {"uv": [6, 0], "uv_size": [1, 34]},
"down": {"uv": [7, 34], "uv_size": [1, -34]}
}
}
]
},
{
"name": "bone6",
"parent": "body",
"pivot": [0.02663, -18.54066, 2.15849],
"cubes": [
{
"origin": [-0.14088, -19.80743, 16.19012],
"size": [0.33501, 2.53354, 1.73175],
"uv": {
"east": {"uv": [8, 0], "uv_size": [2, 3]},
"south": {"uv": [10, 8], "uv_size": [1, 3]},
"west": {"uv": [8, 3], "uv_size": [2, 3]},
"up": {"uv": [10, 11], "uv_size": [1, 2]},
"down": {"uv": [11, 13], "uv_size": [1, -2]}
}
},
{
"origin": [-0.14088, -19.12759, 15.42042],
"size": [0.33501, 1.78854, 1.79175],
"pivot": [0.02662, -18.54019, 16.62249],
"rotation": [45, 0, 0],
"uv": {
"north": {"uv": [12, 0], "uv_size": [1, 2]},
"east": {"uv": [10, 0], "uv_size": [2, 2]},
"west": {"uv": [10, 2], "uv_size": [2, 2]},
"up": {"uv": [12, 2], "uv_size": [1, 2]}
}
},
{
"origin": [-0.14088, -19.80743, 16.19012],
"size": [0.33501, 2.53354, 1.73175],
"pivot": [0.02662, -18.54019, 16.62249],
"rotation": [0, 0, 90],
"uv": {
"east": {"uv": [8, 6], "uv_size": [2, 3]},
"south": {"uv": [11, 8], "uv_size": [1, 3]},
"west": {"uv": [8, 9], "uv_size": [2, 3]},
"up": {"uv": [8, 12], "uv_size": [1, 2]},
"down": {"uv": [12, 10], "uv_size": [1, -2]}
}
},
{
"origin": [-0.14088, -19.12759, 15.42042],
"size": [0.33501, 1.78854, 1.79175],
"pivot": [0.02662, -18.54019, 16.62249],
"rotation": [45, 0, 90],
"uv": {
"north": {"uv": [12, 4], "uv_size": [1, 2]},
"east": {"uv": [10, 4], "uv_size": [2, 2]},
"west": {"uv": [10, 6], "uv_size": [2, 2]},
"up": {"uv": [12, 6], "uv_size": [1, 2]}
}
}
]
},
{
"name": "flare",
"parent": "bone",
"pivot": [0, -0.47857, 0],
"cubes": [
{
"origin": [-16.75, -0.45, -0.75],
"size": [16, 0, 1.5],
"uv": {
"up": {"uv": [40, 64], "uv_size": [-34, -4]},
"down": {"uv": [40, 64], "uv_size": [-34, -4]}
}
},
{
"origin": [-24.75, -0.45, -0.75],
"size": [24, 0, 1.5],
"pivot": [0, 0, 0],
"rotation": [0, 90, 0],
"uv": {
"up": {"uv": [40, 64], "uv_size": [-34, -4]},
"down": {"uv": [40, 64], "uv_size": [-34, -4]}
}
},
{
"origin": [-16.75, -0.45, -0.75],
"size": [16, 0, 1.5],
"pivot": [0, 0, 0],
"rotation": [0, 180, 0],
"uv": {
"up": {"uv": [40, 64], "uv_size": [-34, -4]},
"down": {"uv": [40, 64], "uv_size": [-34, -4]}
}
},
{
"origin": [-16, 14.5, -1],
"size": [32, 0, 2],
"pivot": [0, 14.5, 0],
"rotation": [135, 0, 90],
"uv": {
"up": {"uv": [40, 64], "uv_size": [-34, -4]},
"down": {"uv": [40, 64], "uv_size": [-34, -4]}
}
},
{
"origin": [-16, 14.5, -1],
"size": [32, 0, 2],
"pivot": [0, 14.5, 0],
"rotation": [-135, 0, 90],
"uv": {
"up": {"uv": [40, 64], "uv_size": [-34, -4]},
"down": {"uv": [40, 64], "uv_size": [-34, -4]}
}
},
{
"origin": [-24.75, -0.45, -0.75],
"size": [24, 0, 1.5],
"pivot": [0, 0, 0],
"rotation": [0, -90, 0],
"uv": {
"up": {"uv": [40, 64], "uv_size": [-34, -4]},
"down": {"uv": [40, 64], "uv_size": [-34, -4]}
}
},
{
"origin": [-2.75, -0.45, -2.75],
"size": [5.5, 0, 5.5],
"pivot": [0, -0.45, 0],
"rotation": [0, -45, 0],
"uv": {
"up": {"uv": [8, 64], "uv_size": [-4, -4]},
"down": {"uv": [8, 64], "uv_size": [-4, -4]}
}
},
{
"origin": [-2.5, 1.3, -2.5],
"size": [5, 0, 5],
"pivot": [0, 1.3, 0],
"rotation": [90, -45, 0],
"uv": {
"up": {"uv": [8, 64], "uv_size": [-4, -4]},
"down": {"uv": [8, 64], "uv_size": [-4, -4]}
}
},
{
"origin": [-2.5, 1.3, -2.5],
"size": [5, 0, 5],
"pivot": [0, 1.3, 0],
"rotation": [90, 45, 0],
"uv": {
"up": {"uv": [8, 64], "uv_size": [-4, -4]},
"down": {"uv": [8, 64], "uv_size": [-4, -4]}
}
}
]
}
]
}
]
}

View file

@ -154,6 +154,7 @@
"item.superbwarfare.javelin_missile": "Javelin Missile",
"item.superbwarfare.heavy_ammo": "Heavy Ammo",
"item.superbwarfare.lunge_mine": "Lunge Mine",
"item.superbwarfare.rocket_70": "70mm Rocket",
"block.superbwarfare.container": "Container",
"des.superbwarfare.container.empty": "空的",
@ -473,5 +474,7 @@
"des.superbwarfare.revolver.sa": "SA",
"des.superbwarfare.tips.ammo_type.ap": "AP SHELL",
"des.superbwarfare.tips.ammo_type.he": "HE SHELL",
"des.superbwarfare.tips.ammo_type.cal50": ".50 BMG"
"des.superbwarfare.tips.ammo_type.cal50": ".50 BMG",
"des.superbwarfare.tips.ammo_type.20mm_cannon": "20MM HE",
"des.superbwarfare.tips.ammo_type.rocket": "ROCKET"
}

View file

@ -154,6 +154,7 @@
"item.superbwarfare.javelin_missile": "标枪导弹",
"item.superbwarfare.heavy_ammo": "重型弹药",
"item.superbwarfare.lunge_mine": "突刺爆雷",
"item.superbwarfare.rocket_70": "70mm火箭弹",
"block.superbwarfare.container": "集装箱",
"des.superbwarfare.container.empty": "空的",
@ -473,5 +474,7 @@
"des.superbwarfare.revolver.sa": "单动",
"des.superbwarfare.tips.ammo_type.ap": "AP SHELL",
"des.superbwarfare.tips.ammo_type.he": "HE SHELL",
"des.superbwarfare.tips.ammo_type.cal50": ".50 BMG"
"des.superbwarfare.tips.ammo_type.cal50": ".50 BMG",
"des.superbwarfare.tips.ammo_type.20mm_cannon": "20MM HE",
"des.superbwarfare.tips.ammo_type.rocket": "ROCKET"
}

View file

@ -2569,5 +2569,29 @@
"stream": false
}
]
},
"into_cannon": {
"sounds": [
{
"name": "superbwarfare:into_cannon",
"stream": false
}
]
},
"into_missile": {
"sounds": [
{
"name": "superbwarfare:into_missile",
"stream": false
}
]
},
"missile_reload": {
"sounds": [
{
"name": "superbwarfare:missile_reload",
"stream": false
}
]
}
}

Binary file not shown.

Before

Width:  |  Height:  |  Size: 16 KiB

After

Width:  |  Height:  |  Size: 16 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 324 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.8 KiB

After

Width:  |  Height:  |  Size: 1.6 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 346 B