9
0
mirror of https://github.com/Samsuik/Sakura.git synced 2026-01-04 15:31:43 +00:00

Configure enderpearl randomness

This commit is contained in:
Samsuik
2025-09-28 14:04:06 +01:00
parent 590ddfe056
commit 969ce59fb7
2 changed files with 12 additions and 1 deletions

View File

@@ -1,6 +1,6 @@
--- a/net/minecraft/world/entity/projectile/ThrownEnderpearl.java
+++ b/net/minecraft/world/entity/projectile/ThrownEnderpearl.java
@@ -39,6 +_,21 @@
@@ -39,6 +_,31 @@
super(EntityType.ENDER_PEARL, owner, level, item);
}
@@ -18,6 +18,16 @@
+ return super.isInWater() && this.level().sakuraConfig().entity.enderPearl.slowedDownByWater;
+ }
+ // Sakura end - configure enderpearls being slowed down by water
+ // Sakura start - configure enderpearls random spread
+ @Override
+ public final Vec3 getMovementToShoot(final double x, final double y, final double z, final float velocity, final float inaccuracy) {
+ final float randomness = this.level().sakuraConfig().entity.enderPearl.randomSpreadWhenThrown
+ ? inaccuracy
+ : 0.0f;
+ return super.getMovementToShoot(x, y, z, velocity, randomness);
+ }
+ // Sakura end - configure enderpearls random spread
+
+
@Override
public Item getDefaultItem() {

View File

@@ -230,6 +230,7 @@ public final class WorldConfiguration extends ConfigurationPart {
public boolean useOutlineForCollision = false;
public boolean preventTeleportingInsideBlocks = false;
public boolean slowedDownByWater = true;
public boolean randomSpreadWhenThrown = true;
}
}