diff --git a/src/main/java/com/atsuishio/superbwarfare/entity/Blu43Entity.java b/src/main/java/com/atsuishio/superbwarfare/entity/Blu43Entity.java index 66140734e..749ed9bd3 100644 --- a/src/main/java/com/atsuishio/superbwarfare/entity/Blu43Entity.java +++ b/src/main/java/com/atsuishio/superbwarfare/entity/Blu43Entity.java @@ -26,6 +26,7 @@ import net.minecraft.world.item.ItemStack; import net.minecraft.world.level.Explosion; import net.minecraft.world.level.Level; import net.minecraft.world.level.entity.EntityTypeTest; +import net.minecraft.world.phys.Vec3; import net.neoforged.neoforge.event.EventHooks; import net.neoforged.neoforge.items.ItemHandlerHelper; import org.jetbrains.annotations.NotNull; @@ -220,7 +221,7 @@ public class Blu43Entity extends Entity implements GeoEntity, OwnableEntity { private void triggerExplode() { CustomExplosion explosion = new CustomExplosion(this.level(), this, - ModDamageTypes.causeCustomExplosionDamage(this.level().registryAccess(), this, this.getOwner()), 15f, + ModDamageTypes.causeCustomExplosionDamage(this.level().registryAccess(), this, this.getOwner()), 10f, this.getX(), this.getEyeY(), this.getZ(), 2f, Explosion.BlockInteraction.KEEP, true); explosion.explode(); EventHooks.onExplosionStart(this.level(), explosion); @@ -242,4 +243,9 @@ public class Blu43Entity extends Entity implements GeoEntity, OwnableEntity { public AnimatableInstanceCache getAnimatableInstanceCache() { return this.cache; } + + public void shoot(double pX, double pY, double pZ, float pVelocity, float pInaccuracy) { + Vec3 vec3 = (new Vec3(pX, pY, pZ)).normalize().add(this.random.triangle(0.0, 0.0172275 * (double) pInaccuracy), this.random.triangle(0.0, 0.0172275 * (double) pInaccuracy), this.random.triangle(0.0, 0.0172275 * (double) pInaccuracy)).scale((double) pVelocity); + this.setDeltaMovement(vec3); + } } \ No newline at end of file diff --git a/src/main/java/com/atsuishio/superbwarfare/item/Blu43Mine.java b/src/main/java/com/atsuishio/superbwarfare/item/Blu43Mine.java index 891c7c890..1e72c3a9c 100644 --- a/src/main/java/com/atsuishio/superbwarfare/item/Blu43Mine.java +++ b/src/main/java/com/atsuishio/superbwarfare/item/Blu43Mine.java @@ -14,7 +14,6 @@ import net.minecraft.world.item.Item; import net.minecraft.world.item.ItemStack; import net.minecraft.world.level.Level; import net.minecraft.world.level.block.DispenserBlock; -import net.minecraft.world.phys.Vec3; import org.jetbrains.annotations.NotNull; import org.joml.Math; @@ -62,15 +61,11 @@ public class Blu43Mine extends Item { float randomRot = (float) Mth.clamp((2 * Math.random() - 1) * 180, -180, 180); var pX = direction.getStepX(); - var pY = direction.getStepY() + 0.1F; + var pY = direction.getStepY(); var pZ = direction.getStepZ(); - Vec3 vec3 = (new Vec3(pX, pY, pZ)).normalize().scale(0.05); - blu43.setDeltaMovement(vec3); - double d0 = vec3.horizontalDistance(); + blu43.shoot(pX, pY, pZ, 0.4f, 10); blu43.setYRot(randomRot); - blu43.setXRot((float) (Mth.atan2(vec3.y, d0) * (double) (180F / (float) Math.PI))); blu43.yRotO = blu43.getYRot(); - blu43.xRotO = blu43.getXRot(); level.addFreshEntity(blu43); stack.shrink(1); diff --git a/src/main/resources/data/superbwarfare/recipe/blu_43_crafting.json b/src/main/resources/data/superbwarfare/recipe/blu_43_crafting.json new file mode 100644 index 000000000..bf0852a82 --- /dev/null +++ b/src/main/resources/data/superbwarfare/recipe/blu_43_crafting.json @@ -0,0 +1,24 @@ +{ + "type": "minecraft:crafting_shaped", + "category": "misc", + "pattern": [ + "a", + "b", + "c" + ], + "key": { + "a": { + "item": "minecraft:stone_pressure_plate" + }, + "b": { + "item": "superbwarfare:high_energy_explosives" + }, + "c": { + "item": "minecraft:green_concrete" + } + }, + "result": { + "id": "superbwarfare:blu_43_mine", + "count": 8 + } +} \ No newline at end of file