优化迫击炮角度调整

This commit is contained in:
Atsuihsio 2024-05-16 14:34:02 +08:00
parent b816adc06c
commit 4e01d34071
12 changed files with 104 additions and 122 deletions

View file

@ -3,7 +3,6 @@ package net.mcreator.target.entity;
import net.mcreator.target.TargetMod;
import net.mcreator.target.init.TargetModEntities;
import net.mcreator.target.init.TargetModItems;
import net.mcreator.target.procedures.MedexpProcedure;
import net.minecraft.commands.CommandSource;
import net.minecraft.commands.CommandSourceStack;
import net.minecraft.core.BlockPos;
@ -267,7 +266,10 @@ public class ClaymoreEntity extends TamableAnimal implements GeoEntity, Animated
if (!condition) continue;
if (!level.isClientSide()) {
MedexpProcedure.execute(this.level(), this.getX(), this.getY(), this.getZ());
if (!this.level().isClientSide() && this.getServer() != null) {
this.getServer().getCommands().performPrefixedCommand(new CommandSourceStack(CommandSource.NULL, this.position(), this.getRotationVector(), this.level() instanceof ServerLevel ? (ServerLevel) this.level() : null, 4,
this.getName().getString(), this.getDisplayName(), this.level().getServer(), this), "target:mediumexp");
}
this.discard();
}
target.getPersistentData().putDouble("claymore", 5);

View file

@ -4,7 +4,6 @@ import net.mcreator.target.headshot.BoundingBoxManager;
import net.mcreator.target.headshot.IHeadshotBox;
import net.mcreator.target.init.TargetModEntities;
import net.mcreator.target.network.TargetModVariables;
import net.mcreator.target.procedures.MedexpProcedure;
import net.minecraft.commands.CommandSource;
import net.minecraft.commands.CommandSourceStack;
import net.minecraft.network.protocol.Packet;
@ -89,9 +88,13 @@ public class GunGrenadeEntity extends AbstractArrow implements ItemSupplier {
}
if (this.getPersistentData().getDouble("baoxian") > 0) {
if (this.level() instanceof ServerLevel level) {
level.explode(this, (this.getX()), (this.getY()), (this.getZ()), 5.5f, Level.ExplosionInteraction.NONE);
MedexpProcedure.execute(this.level(), (this.getX()), (this.getY()), (this.getZ()));
if (!entity.level().isClientSide() && entity.getServer() != null) {
entity.getServer().getCommands().performPrefixedCommand(new CommandSourceStack(CommandSource.NULL, entity.position(), entity.getRotationVector(), entity.level() instanceof ServerLevel ? (ServerLevel) entity.level() : null, 4,
entity.getName().getString(), entity.getDisplayName(), entity.level().getServer(), entity), "target:mediumexp");
}
this.discard();
}
}
@ -146,8 +149,6 @@ public class GunGrenadeEntity extends AbstractArrow implements ItemSupplier {
if (this.getPersistentData().getDouble("baoxian") > 0) {
if (this.level() instanceof ServerLevel level) {
this.level().explode(this, this.getX(), this.getY(), this.getZ(), 5.5f, Level.ExplosionInteraction.NONE);
MedexpProcedure.execute(level, this.getX(), this.getY(), this.getZ());
this.discard();
}
}
}
@ -163,38 +164,15 @@ public class GunGrenadeEntity extends AbstractArrow implements ItemSupplier {
this.getServer().getCommands().performPrefixedCommand(new CommandSourceStack(CommandSource.NULL, this.position(), this.getRotationVector(), this.level() instanceof ServerLevel ? (ServerLevel) this.level() : null, 4,
this.getName().getString(), this.getDisplayName(), this.level().getServer(), this), "particle minecraft:campfire_cosy_smoke ~ ~ ~ 0 0 0 0 1 force");
}
if (this.inGround) {
if (!this.level().isClientSide() && this.getServer() != null) {
this.getServer().getCommands().performPrefixedCommand(new CommandSourceStack(CommandSource.NULL, this.position(), this.getRotationVector(), this.level() instanceof ServerLevel ? (ServerLevel) this.level() : null, 4,
this.getName().getString(), this.getDisplayName(), this.level().getServer(), this), "target:mediumexp");
}
this.discard();
}
if (this.tickCount > 200) {
this.discard();
}
}
public static GunGrenadeEntity shoot(Level world, LivingEntity entity, RandomSource source) {
return shoot(world, entity, source, 1f, 5, 5);
}
public static GunGrenadeEntity shoot(Level world, LivingEntity entity, RandomSource random, float power, double damage, int knockback) {
GunGrenadeEntity entityarrow = new GunGrenadeEntity(TargetModEntities.GUN_GRENADE.get(), entity, world);
entityarrow.shoot(entity.getViewVector(1).x, entity.getViewVector(1).y, entity.getViewVector(1).z, power * 2, 0);
entityarrow.setSilent(true);
entityarrow.setCritArrow(false);
entityarrow.setBaseDamage(damage);
entityarrow.setKnockback(knockback);
world.addFreshEntity(entityarrow);
return entityarrow;
}
public static GunGrenadeEntity shoot(LivingEntity entity, LivingEntity target) {
GunGrenadeEntity entityarrow = new GunGrenadeEntity(TargetModEntities.GUN_GRENADE.get(), entity, entity.level());
double dx = target.getX() - entity.getX();
double dy = target.getY() + target.getEyeHeight() - 1.1;
double dz = target.getZ() - entity.getZ();
entityarrow.shoot(dx, dy - entityarrow.getY() + Math.hypot(dx, dz) * 0.2F, dz, 1f * 2, 12.0F);
entityarrow.setSilent(true);
entityarrow.setBaseDamage(5);
entityarrow.setKnockback(5);
entityarrow.setCritArrow(false);
entity.level().addFreshEntity(entityarrow);
return entityarrow;
}
}

View file

@ -2,6 +2,7 @@ package net.mcreator.target.entity;
import io.netty.buffer.Unpooled;
import net.mcreator.target.TargetMod;
import net.mcreator.target.init.TargetModAttributes;
import net.mcreator.target.init.TargetModEntities;
import net.mcreator.target.init.TargetModItems;
import net.mcreator.target.init.TargetModSounds;
@ -52,6 +53,7 @@ import software.bernie.geckolib.core.object.PlayState;
import software.bernie.geckolib.util.GeckoLibUtil;
import javax.annotation.Nullable;
import java.text.DecimalFormat;
public class MortarEntity extends PathfinderMob implements GeoEntity, AnimatedEntity {
public static final EntityDataAccessor<Boolean> SHOOT = SynchedEntityData.defineId(MortarEntity.class, EntityDataSerializers.BOOLEAN);
@ -222,7 +224,7 @@ public class MortarEntity extends PathfinderMob implements GeoEntity, AnimatedEn
entityToSpawn.setBaseDamage(100);
entityToSpawn.setKnockback(0);
entityToSpawn.setSilent(true);
entityToSpawn.setPos(this.getX(), this.getEyeY() - 0.1, this.getZ());
entityToSpawn.setPos(this.getX(), this.getEyeY(), this.getZ());
entityToSpawn.shoot(this.getLookAngle().x, this.getLookAngle().y, this.getLookAngle().z, 8, (float) 0.5);
level.addFreshEntity(entityToSpawn);
@ -238,6 +240,26 @@ public class MortarEntity extends PathfinderMob implements GeoEntity, AnimatedEn
@Override
public void baseTick() {
super.baseTick();
double[] Timer = {0};
double totalTime = 4;
int sleepTime = 2;
double Duration = totalTime / sleepTime;
Runnable Runnable = () -> {
while (Timer[0] < Duration) {
this.setXRot((float) -this.getAttribute(TargetModAttributes.MORTAR_PITCH.get()).getBaseValue());
Timer[0]++;
try {
Thread.sleep(sleepTime);
} catch (InterruptedException e) {
e.printStackTrace();
}
}
};
Thread Thread = new Thread(Runnable);
Thread.start();
this.refreshDimensions();
}
@ -271,7 +293,7 @@ public class MortarEntity extends PathfinderMob implements GeoEntity, AnimatedEn
public static AttributeSupplier.Builder createAttributes() {
return Mob.createMobAttributes()
.add(Attributes.MOVEMENT_SPEED, 0)
.add(Attributes.MAX_HEALTH, 10)
.add(Attributes.MAX_HEALTH, 100)
.add(Attributes.ARMOR, 0)
.add(Attributes.ATTACK_DAMAGE, 0)
.add(Attributes.FOLLOW_RANGE, 16)

View file

@ -1,7 +1,6 @@
package net.mcreator.target.entity;
import net.mcreator.target.init.TargetModEntities;
import net.mcreator.target.procedures.MedexpProcedure;
import net.minecraft.commands.CommandSource;
import net.minecraft.commands.CommandSourceStack;
import net.minecraft.network.protocol.Packet;
@ -10,6 +9,7 @@ import net.minecraft.resources.ResourceLocation;
import net.minecraft.server.level.ServerLevel;
import net.minecraft.sounds.SoundSource;
import net.minecraft.util.RandomSource;
import net.minecraft.world.entity.Entity;
import net.minecraft.world.entity.EntityType;
import net.minecraft.world.entity.LivingEntity;
import net.minecraft.world.entity.projectile.AbstractArrow;
@ -70,20 +70,27 @@ public class MortarShellEntity extends AbstractArrow implements ItemSupplier {
@Override
public void onHitEntity(EntityHitResult entityHitResult) {
super.onHitEntity(entityHitResult);
onHit();
}
Entity entity = entityHitResult.getEntity();
private void onHit() {
if (this.level() instanceof ServerLevel server) {
MedexpProcedure.execute(this.level(), this.getX(), getY(), getZ());
server.explode(this, (this.getX()), (this.getY()), (this.getZ()), 7.5f, Level.ExplosionInteraction.NONE);
if (this.level() instanceof ServerLevel level) {
level.explode(this, (this.getX()), (this.getY()), (this.getZ()), 10, Level.ExplosionInteraction.NONE);
if (!entity.level().isClientSide() && entity.getServer() != null) {
entity.getServer().getCommands().performPrefixedCommand(new CommandSourceStack(CommandSource.NULL, entity.position(), entity.getRotationVector(), entity.level() instanceof ServerLevel ? (ServerLevel) entity.level() : null, 4,
entity.getName().getString(), entity.getDisplayName(), entity.level().getServer(), entity), "target:mediumexp");
}
}
this.discard();
}
@Override
public void onHitBlock(BlockHitResult blockHitResult) {
super.onHitBlock(blockHitResult);
onHit();
if (this.getPersistentData().getDouble("time") > 0) {
if (this.level() instanceof ServerLevel level) {
level.explode(this, this.getX(), this.getY(), this.getZ(), 10, Level.ExplosionInteraction.NONE);
}
}
}
@Override
@ -94,7 +101,13 @@ public class MortarShellEntity extends AbstractArrow implements ItemSupplier {
this.getServer().getCommands().performPrefixedCommand(new CommandSourceStack(CommandSource.NULL, this.position(), this.getRotationVector(), this.level() instanceof ServerLevel ? (ServerLevel) this.level() : null, 4,
this.getName().getString(), this.getDisplayName(), this.level().getServer(), this), "particle minecraft:campfire_cosy_smoke ~ ~ ~ 0 0 0 0 2 force");
}
if (this.inGround) this.discard();
if (this.inGround) {
if (!this.level().isClientSide() && this.getServer() != null) {
this.getServer().getCommands().performPrefixedCommand(new CommandSourceStack(CommandSource.NULL, this.position(), this.getRotationVector(), this.level() instanceof ServerLevel ? (ServerLevel) this.level() : null, 4,
this.getName().getString(), this.getDisplayName(), this.level().getServer(), this), "target:mediumexp");
}
this.discard();
}
}
public static MortarShellEntity shoot(Level world, LivingEntity entity, RandomSource source) {

View file

@ -4,7 +4,6 @@ import net.mcreator.target.headshot.BoundingBoxManager;
import net.mcreator.target.headshot.IHeadshotBox;
import net.mcreator.target.init.TargetModEntities;
import net.mcreator.target.network.TargetModVariables;
import net.mcreator.target.procedures.MedexpProcedure;
import net.minecraft.commands.CommandSource;
import net.minecraft.commands.CommandSourceStack;
import net.minecraft.network.protocol.Packet;
@ -100,7 +99,11 @@ public class RpgRocketEntity extends AbstractArrow implements ItemSupplier {
if (this.level() instanceof ServerLevel level) {
level.explode(this, this.getX(), this.getY(), this.getZ(), 4, Level.ExplosionInteraction.NONE);
MedexpProcedure.execute(level, this.getX(), this.getY(), this.getZ());
if (!entity.level().isClientSide() && entity.getServer() != null) {
entity.getServer().getCommands().performPrefixedCommand(new CommandSourceStack(CommandSource.NULL, entity.position(), entity.getRotationVector(), entity.level() instanceof ServerLevel ? (ServerLevel) entity.level() : null, 4,
entity.getName().getString(), entity.getDisplayName(), entity.level().getServer(), entity), "target:mediumexp");
}
this.discard();
}
}
@ -161,17 +164,9 @@ public class RpgRocketEntity extends AbstractArrow implements ItemSupplier {
if (this.getPersistentData().getDouble("time") > 0) {
if (this.level() instanceof ServerLevel level) {
level.explode(this, this.getX(), this.getY(), this.getZ(), 6, Level.ExplosionInteraction.NONE);
MedexpProcedure.execute(level, this.getX(), this.getY(), this.getZ());
}
if (!this.level().isClientSide())
this.discard();
}
}
public static RpgRocketEntity shoot(Level world, LivingEntity entity, RandomSource source) {
return shoot(world, entity, source, 1f, 5, 5);
}
@Override
public void tick() {
super.tick();
@ -196,28 +191,21 @@ public class RpgRocketEntity extends AbstractArrow implements ItemSupplier {
}
if (life >= 90) {
if (!this.level().isClientSide() && this.getServer() != null) {
MedexpProcedure.execute(this.level(), this.getX(), this.getY(), this.getZ());
this.getServer().getCommands().performPrefixedCommand(new CommandSourceStack(CommandSource.NULL, this.position(), this.getRotationVector(), this.level() instanceof ServerLevel ? (ServerLevel) this.level() : null, 4,
this.getName().getString(), this.getDisplayName(), this.level().getServer(), this), "target:mediumexp");
}
if (!this.level().isClientSide())
this.discard();
}
if (this.inGround) {
if (!this.level().isClientSide() && this.getServer() != null) {
this.getServer().getCommands().performPrefixedCommand(new CommandSourceStack(CommandSource.NULL, this.position(), this.getRotationVector(), this.level() instanceof ServerLevel ? (ServerLevel) this.level() : null, 4,
this.getName().getString(), this.getDisplayName(), this.level().getServer(), this), "target:mediumexp");
}
this.discard();
}
if (this.tickCount > 100) {
this.discard();
}
}
public static RpgRocketEntity shoot(LivingEntity entity, LivingEntity target) {
RpgRocketEntity entityarrow = new RpgRocketEntity(TargetModEntities.RPG_ROCKET.get(), entity, entity.level());
double dx = target.getX() - entity.getX();
double dy = target.getY() + target.getEyeHeight() - 1.1;
double dz = target.getZ() - entity.getZ();
entityarrow.shoot(dx, dy - entityarrow.getY() + Math.hypot(dx, dz) * 0.2F, dz, 1f * 2, 12.0F);
entityarrow.setSilent(true);
entityarrow.setBaseDamage(5);
entityarrow.setKnockback(5);
entityarrow.setCritArrow(false);
entity.level().addFreshEntity(entityarrow);
return entityarrow;
}
}

View file

@ -245,7 +245,7 @@ public class GunEventHandler {
projectile.beast();
}
projectile.setPos((player.getX() + (-0.5) * player.getLookAngle().x), (player.getEyeY() - 0.1 + (-0.5) * player.getLookAngle().y), (player.getZ() + (-0.5) * player.getLookAngle().z));
projectile.setPos(player.getX() - 0.1 * player.getLookAngle().x, player.getEyeY() - 0.1 - 0.1 * player.getLookAngle().y, player.getZ() + -0.1 * player.getLookAngle().z);
projectile.shoot(player.getLookAngle().x, player.getLookAngle().y, player.getLookAngle().z, 1 * (float) heldItem.getOrCreateTag().getDouble("velocity"),
(float) player.getAttributeBaseValue(TargetModAttributes.SPREAD.get()));
player.level().addFreshEntity(projectile);

View file

@ -1,6 +1,4 @@
/*
* MCreator note: This file will be REGENERATED on each build.
*/
package net.mcreator.target.init;
import net.mcreator.target.TargetMod;
@ -19,7 +17,7 @@ import net.minecraftforge.registries.RegistryObject;
@Mod.EventBusSubscriber(bus = Mod.EventBusSubscriber.Bus.MOD)
public class TargetModAttributes {
public static final DeferredRegister<Attribute> ATTRIBUTES = DeferredRegister.create(ForgeRegistries.ATTRIBUTES, TargetMod.MODID);
public static final RegistryObject<Attribute> MOTARPITCH = ATTRIBUTES.register("motar_pitch", () -> (new RangedAttribute("attribute." + TargetMod.MODID + ".motar_pitch", 70, 20, 90)).setSyncable(true));
public static final RegistryObject<Attribute> MORTAR_PITCH = ATTRIBUTES.register("mortar_pitch", () -> (new RangedAttribute("attribute." + TargetMod.MODID + ".mortar_pitch", 70, 20, 89)).setSyncable(true));
public static final RegistryObject<Attribute> SPREAD = ATTRIBUTES.register("spread", () -> (new RangedAttribute("attribute." + TargetMod.MODID + ".spread", 0, 0, 1024)).setSyncable(true));
@SubscribeEvent
@ -31,7 +29,7 @@ public class TargetModAttributes {
@SubscribeEvent
public static void addAttributes(EntityAttributeModificationEvent event) {
event.add(TargetModEntities.MORTAR.get(), MOTARPITCH.get());
event.add(TargetModEntities.MORTAR.get(), MORTAR_PITCH.get());
event.add(EntityType.PLAYER, SPREAD.get());
}
}

View file

@ -37,7 +37,6 @@ public class MortarDeployerItem extends Item {
entityToSpawn.setYRot(player.getYRot());
entityToSpawn.setYBodyRot(player.getYRot());
entityToSpawn.setYHeadRot(player.getYRot());
entityToSpawn.setXRot(-70);
entityToSpawn.setDeltaMovement(0, 0, 0);
}
}

View file

@ -5,8 +5,9 @@ import com.google.common.collect.Multimap;
import net.mcreator.target.client.renderer.item.RocketItemRenderer;
import net.mcreator.target.init.TargetModItems;
import net.mcreator.target.item.AnimatedItem;
import net.mcreator.target.procedures.MedexpProcedure;
import net.minecraft.client.renderer.BlockEntityWithoutLevelRenderer;
import net.minecraft.commands.CommandSource;
import net.minecraft.commands.CommandSourceStack;
import net.minecraft.network.chat.Component;
import net.minecraft.server.level.ServerLevel;
import net.minecraft.world.entity.EquipmentSlot;
@ -121,7 +122,10 @@ public class Rocket extends Item implements GeoItem, AnimatedItem {
level.explode(sourceentity, sourceentity.getX(), sourceentity.getY() + 1, sourceentity.getZ(), 6, Level.ExplosionInteraction.NONE);
level.explode(null, sourceentity.getX(), sourceentity.getY() + 1, sourceentity.getZ(), 6, Level.ExplosionInteraction.NONE);
MedexpProcedure.execute(level, sourceentity.getX(), sourceentity.getY(), sourceentity.getZ());
if (!sourceentity.level().isClientSide() && sourceentity.getServer() != null) {
sourceentity.getServer().getCommands().performPrefixedCommand(new CommandSourceStack(CommandSource.NULL, sourceentity.position(), sourceentity.getRotationVector(), sourceentity.level() instanceof ServerLevel ? (ServerLevel) sourceentity.level() : null, 4,
sourceentity.getName().getString(), sourceentity.getDisplayName(), sourceentity.level().getServer(), sourceentity), "playsound target:target:mediumexp");
}
}
if (sourceentity instanceof Player player) {
player.getInventory().clearOrCountMatchingItems(p -> TargetModItems.ROCKET.get() == p.getItem(), 1, player.inventoryMenu.getCraftSlots());

View file

@ -5,13 +5,16 @@ import net.mcreator.target.tools.TraceTool;
import net.minecraft.core.BlockPos;
import net.minecraft.network.FriendlyByteBuf;
import net.minecraft.world.entity.Entity;
import net.minecraft.world.entity.LivingEntity;
import net.minecraft.world.entity.player.Player;
import net.minecraft.world.level.Level;
import net.minecraftforge.eventbus.api.SubscribeEvent;
import net.minecraftforge.fml.common.Mod;
import net.minecraftforge.fml.event.lifecycle.FMLCommonSetupEvent;
import net.minecraftforge.network.NetworkEvent;
import net.minecraft.world.entity.LivingEntity;
import net.mcreator.target.init.TargetModAttributes;
import java.util.function.Supplier;
@ -66,63 +69,38 @@ public class MortarGUIButtonMessage {
Entity looking = TraceTool.findLookingEntity(player, 6);
if (looking == null) return;
boolean validXRot = true;
switch (buttonID) {
case 0 -> {
if (looking.getXRot() <= -88) {
validXRot = false;
} else {
looking.setXRot(looking.getXRot() - 1);
if (((LivingEntity) looking).getAttribute(TargetModAttributes.MORTAR_PITCH.get()).getBaseValue() < 89) {
((LivingEntity) looking).getAttribute(TargetModAttributes.MORTAR_PITCH.get()).setBaseValue((((LivingEntity) looking).getAttribute(TargetModAttributes.MORTAR_PITCH.get()).getBaseValue() + 1));
}
}
case 1 -> {
if (looking.getXRot() >= -20) {
validXRot = false;
} else {
looking.setXRot(looking.getXRot() + 1);
if (((LivingEntity) looking).getAttribute(TargetModAttributes.MORTAR_PITCH.get()).getBaseValue() > 21) {
((LivingEntity) looking).getAttribute(TargetModAttributes.MORTAR_PITCH.get()).setBaseValue((((LivingEntity) looking).getAttribute(TargetModAttributes.MORTAR_PITCH.get()).getBaseValue() - 1));
}
}
case 2 -> {
if (looking.getXRot() <= -78) {
validXRot = false;
} else {
looking.setXRot(looking.getXRot() - 10);
if (((LivingEntity) looking).getAttribute(TargetModAttributes.MORTAR_PITCH.get()).getBaseValue() < 78) {
((LivingEntity) looking).getAttribute(TargetModAttributes.MORTAR_PITCH.get()).setBaseValue((((LivingEntity) looking).getAttribute(TargetModAttributes.MORTAR_PITCH.get()).getBaseValue() + 10));
}
}
case 3 -> {
if (looking.getXRot() >= -30) {
validXRot = false;
} else {
looking.setXRot(looking.getXRot() + 10);
if (((LivingEntity) looking).getAttribute(TargetModAttributes.MORTAR_PITCH.get()).getBaseValue() > 31) {
((LivingEntity) looking).getAttribute(TargetModAttributes.MORTAR_PITCH.get()).setBaseValue((((LivingEntity) looking).getAttribute(TargetModAttributes.MORTAR_PITCH.get()).getBaseValue() - 10));
}
}
case 4 -> {
if (looking.getXRot() >= -20.5) {
validXRot = false;
} else {
looking.setXRot(looking.getXRot() + 0.5f);
if (((LivingEntity) looking).getAttribute(TargetModAttributes.MORTAR_PITCH.get()).getBaseValue() > 20.5) {
((LivingEntity) looking).getAttribute(TargetModAttributes.MORTAR_PITCH.get()).setBaseValue((((LivingEntity) looking).getAttribute(TargetModAttributes.MORTAR_PITCH.get()).getBaseValue() - 0.5));
}
}
case 5 -> {
if (looking.getXRot() <= -87.5) {
validXRot = false;
} else {
looking.setXRot(looking.getXRot() - 0.5f);
if (((LivingEntity) looking).getAttribute(TargetModAttributes.MORTAR_PITCH.get()).getBaseValue() < 88.5) {
((LivingEntity) looking).getAttribute(TargetModAttributes.MORTAR_PITCH.get()).setBaseValue((((LivingEntity) looking).getAttribute(TargetModAttributes.MORTAR_PITCH.get()).getBaseValue() + 0.5));
}
}
}
if (!validXRot) return;
looking.setYRot(looking.getYRot());
looking.setYBodyRot(looking.getYRot());
looking.setYHeadRot(looking.getYRot());
looking.yRotO = looking.getYRot();
looking.xRotO = looking.getXRot();
if (looking instanceof LivingEntity living) {
living.yBodyRotO = living.getYRot();
living.yHeadRotO = living.getYRot();
}
}
@SubscribeEvent

View file

@ -114,7 +114,7 @@ public class GunsTool {
if (tag.getBoolean("beast")) {
projectile.beast();
}
projectile.setPos(player.getX() + -0.5 * player.getLookAngle().x, player.getEyeY() - 0.1 + (-0.5) * player.getLookAngle().y, player.getZ() + (-0.5) * player.getLookAngle().z);
projectile.setPos(player.getX() - 0.1 * player.getLookAngle().x, player.getEyeY() - 0.1 - 0.1 * player.getLookAngle().y, player.getZ() + -0.1 * player.getLookAngle().z);
if (heldItem.getItem() == TargetModItems.BOCEK.get()) {
damage = 0.008333333 * tag.getDouble("damage") * tag.getDouble("speed") * tag.getDouble("damageadd");

View file

@ -88,7 +88,7 @@ public class MortarGUIMenu extends AbstractContainerMenu implements Supplier<Map
}
if (20 <= converted && converted <= 90) {
((LivingEntity) looking).getAttribute(TargetModAttributes.MOTARPITCH.get()).setBaseValue(converted);
((LivingEntity) looking).getAttribute(TargetModAttributes.MORTAR_PITCH.get()).setBaseValue(converted);
}
}
}