修改音效文件命名
This commit is contained in:
parent
2c4bcef205
commit
b706383ac1
18 changed files with 63 additions and 92 deletions
|
@ -1,56 +1,51 @@
|
|||
|
||||
package net.mcreator.target.entity;
|
||||
|
||||
import net.mcreator.target.init.*;
|
||||
import net.mcreator.target.init.TargetModDamageTypes;
|
||||
import net.mcreator.target.init.TargetModEntities;
|
||||
import net.mcreator.target.init.TargetModItems;
|
||||
import net.mcreator.target.init.TargetModSounds;
|
||||
import net.mcreator.target.item.common.ammo.CannonShellItem;
|
||||
import net.mcreator.target.item.common.ammo.He5Inches;
|
||||
import net.mcreator.target.network.TargetModVariables;
|
||||
import net.mcreator.target.tools.CustomExplosion;
|
||||
import net.mcreator.target.tools.ParticleTool;
|
||||
import net.mcreator.target.tools.SoundTool;
|
||||
import net.minecraft.client.Minecraft;
|
||||
import net.minecraft.core.particles.ParticleTypes;
|
||||
import net.minecraft.nbt.CompoundTag;
|
||||
import net.minecraft.network.protocol.Packet;
|
||||
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.InteractionHand;
|
||||
import net.minecraft.world.InteractionResult;
|
||||
import net.minecraft.world.entity.*;
|
||||
import net.minecraft.world.entity.player.Player;
|
||||
import net.minecraft.world.item.ItemStack;
|
||||
import net.minecraft.world.item.enchantment.EnchantmentHelper;
|
||||
import net.minecraft.world.level.Explosion;
|
||||
import net.minecraft.world.phys.Vec3;
|
||||
import net.minecraftforge.event.entity.player.PlayerInteractEvent;
|
||||
import net.minecraftforge.eventbus.api.SubscribeEvent;
|
||||
import software.bernie.geckolib.util.GeckoLibUtil;
|
||||
import software.bernie.geckolib.core.object.PlayState;
|
||||
import software.bernie.geckolib.core.animation.RawAnimation;
|
||||
import software.bernie.geckolib.core.animation.AnimationState;
|
||||
import software.bernie.geckolib.core.animation.AnimationController;
|
||||
import software.bernie.geckolib.core.animation.AnimatableManager;
|
||||
import software.bernie.geckolib.core.animatable.instance.AnimatableInstanceCache;
|
||||
import software.bernie.geckolib.animatable.GeoEntity;
|
||||
|
||||
import net.minecraftforge.registries.ForgeRegistries;
|
||||
import net.minecraftforge.network.PlayMessages;
|
||||
import net.minecraftforge.network.NetworkHooks;
|
||||
|
||||
import net.minecraft.world.level.Level;
|
||||
import net.minecraft.world.entity.projectile.ThrownPotion;
|
||||
import net.minecraft.world.entity.ai.attributes.Attributes;
|
||||
import net.minecraft.world.entity.ai.attributes.AttributeSupplier;
|
||||
import net.minecraft.world.damagesource.DamageTypes;
|
||||
import net.minecraft.world.damagesource.DamageSource;
|
||||
import net.minecraft.sounds.SoundEvent;
|
||||
import net.minecraft.resources.ResourceLocation;
|
||||
import net.minecraft.network.syncher.SynchedEntityData;
|
||||
import net.minecraft.network.syncher.EntityDataSerializers;
|
||||
import net.minecraft.network.syncher.EntityDataAccessor;
|
||||
import net.minecraft.network.protocol.game.ClientGamePacketListener;
|
||||
import net.minecraft.network.protocol.Packet;
|
||||
import net.minecraft.nbt.CompoundTag;
|
||||
import net.minecraft.world.damagesource.DamageTypes;
|
||||
import net.minecraft.world.entity.*;
|
||||
import net.minecraft.world.entity.ai.attributes.AttributeSupplier;
|
||||
import net.minecraft.world.entity.ai.attributes.Attributes;
|
||||
import net.minecraft.world.entity.player.Player;
|
||||
import net.minecraft.world.entity.projectile.ThrownPotion;
|
||||
import net.minecraft.world.item.ItemStack;
|
||||
import net.minecraft.world.level.Explosion;
|
||||
import net.minecraft.world.level.Level;
|
||||
import net.minecraft.world.phys.Vec3;
|
||||
import net.minecraftforge.network.NetworkHooks;
|
||||
import net.minecraftforge.network.PlayMessages;
|
||||
import net.minecraftforge.registries.ForgeRegistries;
|
||||
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;
|
||||
|
||||
public class Mk42Entity extends PathfinderMob implements GeoEntity {
|
||||
public static final EntityDataAccessor<Boolean> SHOOT = SynchedEntityData.defineId(Mk42Entity.class, EntityDataSerializers.BOOLEAN);
|
||||
|
@ -80,6 +75,7 @@ public class Mk42Entity extends PathfinderMob implements GeoEntity {
|
|||
this.entityData.define(ANIMATION, "undefined");
|
||||
this.entityData.define(TEXTURE, "sherman");
|
||||
}
|
||||
|
||||
@Override
|
||||
protected float getStandingEyeHeight(Pose poseIn, EntityDimensions sizeIn) {
|
||||
return 2.16F;
|
||||
|
@ -110,7 +106,7 @@ public class Mk42Entity extends PathfinderMob implements GeoEntity {
|
|||
|
||||
@Override
|
||||
public MobType getMobType() {
|
||||
return MobType.UNDEFINED;
|
||||
return super.getMobType();
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -165,7 +161,6 @@ public class Mk42Entity extends PathfinderMob implements GeoEntity {
|
|||
}
|
||||
|
||||
|
||||
|
||||
@Override
|
||||
public InteractionResult mobInteract(Player sourceentity, InteractionHand hand) {
|
||||
InteractionResult retval = InteractionResult.sidedSuccess(this.level().isClientSide());
|
||||
|
@ -182,12 +177,12 @@ public class Mk42Entity extends PathfinderMob implements GeoEntity {
|
|||
super.die(source);
|
||||
|
||||
if (level() instanceof ServerLevel) {
|
||||
destoryExplode();
|
||||
destroyExplode();
|
||||
this.discard();
|
||||
}
|
||||
}
|
||||
|
||||
private void destoryExplode() {
|
||||
private void destroyExplode() {
|
||||
CustomExplosion explosion = new CustomExplosion(this.level(), this,
|
||||
TargetModDamageTypes.causeProjectileBoomDamage(this.level().registryAccess(), this, this), 30f,
|
||||
this.getX(), this.getY(), this.getZ(), 7.5f, Explosion.BlockInteraction.KEEP).setDamageMultiplier(1);
|
||||
|
@ -255,12 +250,13 @@ public class Mk42Entity extends PathfinderMob implements GeoEntity {
|
|||
}
|
||||
|
||||
public void cannonShoot(Player player) {
|
||||
|
||||
Level level = player.level();
|
||||
if (level instanceof ServerLevel server) {
|
||||
ItemStack stack = player.getMainHandItem();
|
||||
|
||||
if (!(player.getMainHandItem().getItem() instanceof CannonShellItem))
|
||||
if (!(stack.getItem() instanceof CannonShellItem)) {
|
||||
return;
|
||||
}
|
||||
|
||||
float hitDamage = 0;
|
||||
float explosionRadius = 0;
|
||||
|
@ -269,16 +265,15 @@ public class Mk42Entity extends PathfinderMob implements GeoEntity {
|
|||
int fireTime = 0;
|
||||
int durability = 0;
|
||||
|
||||
if (player.getMainHandItem().is(TargetModItems.HE_5_INCHES.get())) {
|
||||
if (stack.is(TargetModItems.HE_5_INCHES.get())) {
|
||||
hitDamage = 100;
|
||||
explosionRadius = 10;
|
||||
explosionDamage = 200;
|
||||
fireProbability = 0.18F;
|
||||
fireTime = 100;
|
||||
durability = 0;
|
||||
}
|
||||
|
||||
if (player.getMainHandItem().is(TargetModItems.AP_5_INCHES.get())) {
|
||||
if (stack.is(TargetModItems.AP_5_INCHES.get())) {
|
||||
hitDamage = 150;
|
||||
explosionRadius = 3;
|
||||
explosionDamage = 250;
|
||||
|
@ -288,10 +283,11 @@ public class Mk42Entity extends PathfinderMob implements GeoEntity {
|
|||
}
|
||||
|
||||
if (!player.isCreative()) {
|
||||
player.getMainHandItem().shrink(1);
|
||||
stack.shrink(1);
|
||||
}
|
||||
|
||||
CannonShellEntity entityToSpawn = new CannonShellEntity(TargetModEntities.CANNON_SHELL.get(), player, level, hitDamage, explosionRadius, explosionDamage, fireProbability, fireTime).durability(durability);
|
||||
CannonShellEntity entityToSpawn = new CannonShellEntity(TargetModEntities.CANNON_SHELL.get(),
|
||||
player, level, hitDamage, explosionRadius, explosionDamage, fireProbability, fireTime).durability(durability);
|
||||
|
||||
entityToSpawn.setPos(this.getX(), this.getEyeY(), this.getZ());
|
||||
entityToSpawn.shoot(this.getLookAngle().x, this.getLookAngle().y, this.getLookAngle().z, 15, 0.1f);
|
||||
|
|
|
@ -23,7 +23,6 @@
|
|||
}
|
||||
]
|
||||
},
|
||||
|
||||
"trachelium_fire_1p": {
|
||||
"sounds": [
|
||||
{
|
||||
|
@ -64,7 +63,6 @@
|
|||
}
|
||||
]
|
||||
},
|
||||
|
||||
"hunting_rifle_fire_1p": {
|
||||
"sounds": [
|
||||
{
|
||||
|
@ -105,7 +103,6 @@
|
|||
}
|
||||
]
|
||||
},
|
||||
|
||||
"m_79_fire_1p": {
|
||||
"sounds": [
|
||||
{
|
||||
|
@ -146,7 +143,6 @@
|
|||
}
|
||||
]
|
||||
},
|
||||
|
||||
"sks_fire_1p": {
|
||||
"sounds": [
|
||||
{
|
||||
|
@ -195,7 +191,6 @@
|
|||
}
|
||||
]
|
||||
},
|
||||
|
||||
"abekiri_fire_1p": {
|
||||
"sounds": [
|
||||
{
|
||||
|
@ -244,7 +239,6 @@
|
|||
}
|
||||
]
|
||||
},
|
||||
|
||||
"ak_47_fire_1p": {
|
||||
"sounds": [
|
||||
{
|
||||
|
@ -293,7 +287,6 @@
|
|||
}
|
||||
]
|
||||
},
|
||||
|
||||
"devotion_fire_1p": {
|
||||
"sounds": [
|
||||
{
|
||||
|
@ -342,7 +335,6 @@
|
|||
}
|
||||
]
|
||||
},
|
||||
|
||||
"rpg_fire_1p": {
|
||||
"sounds": [
|
||||
{
|
||||
|
@ -383,7 +375,6 @@
|
|||
}
|
||||
]
|
||||
},
|
||||
|
||||
"m_4_fire_1p": {
|
||||
"sounds": [
|
||||
{
|
||||
|
@ -432,7 +423,6 @@
|
|||
}
|
||||
]
|
||||
},
|
||||
|
||||
"aa_12_fire_1p": {
|
||||
"sounds": [
|
||||
{
|
||||
|
@ -481,7 +471,6 @@
|
|||
}
|
||||
]
|
||||
},
|
||||
|
||||
"bocek_zoom_fire_1p": {
|
||||
"sounds": [
|
||||
{
|
||||
|
@ -530,7 +519,6 @@
|
|||
}
|
||||
]
|
||||
},
|
||||
|
||||
"hk_416_fire_1p": {
|
||||
"sounds": [
|
||||
{
|
||||
|
@ -579,7 +567,6 @@
|
|||
}
|
||||
]
|
||||
},
|
||||
|
||||
"rpk_fire_1p": {
|
||||
"sounds": [
|
||||
{
|
||||
|
@ -628,7 +615,6 @@
|
|||
}
|
||||
]
|
||||
},
|
||||
|
||||
"ntw_20_fire_1p": {
|
||||
"sounds": [
|
||||
{
|
||||
|
@ -685,7 +671,6 @@
|
|||
}
|
||||
]
|
||||
},
|
||||
|
||||
"vector_fire_1p": {
|
||||
"sounds": [
|
||||
{
|
||||
|
@ -734,7 +719,6 @@
|
|||
}
|
||||
]
|
||||
},
|
||||
|
||||
"minigun_fire_1p": {
|
||||
"sounds": [
|
||||
{
|
||||
|
@ -783,7 +767,6 @@
|
|||
}
|
||||
]
|
||||
},
|
||||
|
||||
"mk_14_fire_1p": {
|
||||
"sounds": [
|
||||
{
|
||||
|
@ -832,7 +815,6 @@
|
|||
}
|
||||
]
|
||||
},
|
||||
|
||||
"sentinel_fire_1p": {
|
||||
"sounds": [
|
||||
{
|
||||
|
@ -929,7 +911,6 @@
|
|||
}
|
||||
]
|
||||
},
|
||||
|
||||
"m_60_fire_1p": {
|
||||
"sounds": [
|
||||
{
|
||||
|
@ -978,7 +959,6 @@
|
|||
}
|
||||
]
|
||||
},
|
||||
|
||||
"svd_fire_1p": {
|
||||
"sounds": [
|
||||
{
|
||||
|
@ -1027,7 +1007,6 @@
|
|||
}
|
||||
]
|
||||
},
|
||||
|
||||
"m_98b_fire_1p": {
|
||||
"sounds": [
|
||||
{
|
||||
|
@ -1084,7 +1063,6 @@
|
|||
}
|
||||
]
|
||||
},
|
||||
|
||||
"marlin_fire_1p": {
|
||||
"sounds": [
|
||||
{
|
||||
|
@ -1141,7 +1119,6 @@
|
|||
}
|
||||
]
|
||||
},
|
||||
|
||||
"m_870_fire_1p": {
|
||||
"sounds": [
|
||||
{
|
||||
|
@ -1190,7 +1167,6 @@
|
|||
}
|
||||
]
|
||||
},
|
||||
|
||||
"mk_42_fire_1p": {
|
||||
"sounds": [
|
||||
{
|
||||
|
@ -1235,7 +1211,6 @@
|
|||
}
|
||||
]
|
||||
},
|
||||
|
||||
"lightsaber": {
|
||||
"sounds": [
|
||||
{
|
||||
|
@ -1455,67 +1430,67 @@
|
|||
"land": {
|
||||
"sounds": [
|
||||
{
|
||||
"name": "target:bullet/1",
|
||||
"name": "target:bullet/bullet1",
|
||||
"stream": false
|
||||
},
|
||||
{
|
||||
"name": "target:bullet/2",
|
||||
"name": "target:bullet/bullet2",
|
||||
"stream": false
|
||||
},
|
||||
{
|
||||
"name": "target:bullet/3",
|
||||
"name": "target:bullet/bullet3",
|
||||
"stream": false
|
||||
},
|
||||
{
|
||||
"name": "target:bullet/4",
|
||||
"name": "target:bullet/bullet4",
|
||||
"stream": false
|
||||
},
|
||||
{
|
||||
"name": "target:bullet/5",
|
||||
"name": "target:bullet/bullet5",
|
||||
"stream": false
|
||||
},
|
||||
{
|
||||
"name": "target:bullet/6",
|
||||
"name": "target:bullet/bullet6",
|
||||
"stream": false
|
||||
},
|
||||
{
|
||||
"name": "target:bullet/7",
|
||||
"name": "target:bullet/bullet7",
|
||||
"stream": false
|
||||
},
|
||||
{
|
||||
"name": "target:bullet/8",
|
||||
"name": "target:bullet/bullet8",
|
||||
"stream": false
|
||||
},
|
||||
{
|
||||
"name": "target:bullet/9",
|
||||
"name": "target:bullet/bullet9",
|
||||
"stream": false
|
||||
},
|
||||
{
|
||||
"name": "target:bullet/10",
|
||||
"name": "target:bullet/bullet10",
|
||||
"stream": false
|
||||
},
|
||||
{
|
||||
"name": "target:bullet/11",
|
||||
"name": "target:bullet/bullet11",
|
||||
"stream": false
|
||||
},
|
||||
{
|
||||
"name": "target:bullet/12",
|
||||
"name": "target:bullet/bullet12",
|
||||
"stream": false
|
||||
},
|
||||
{
|
||||
"name": "target:bullet/13",
|
||||
"name": "target:bullet/bullet13",
|
||||
"stream": false
|
||||
},
|
||||
{
|
||||
"name": "target:bullet/14",
|
||||
"name": "target:bullet/bullet14",
|
||||
"stream": false
|
||||
},
|
||||
{
|
||||
"name": "target:bullet/15",
|
||||
"name": "target:bullet/bullet15",
|
||||
"stream": false
|
||||
},
|
||||
{
|
||||
"name": "target:bullet/16",
|
||||
"name": "target:bullet/bullet16",
|
||||
"stream": false
|
||||
}
|
||||
]
|
||||
|
|
Loading…
Add table
Reference in a new issue