|
| 1 | +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 |
| 2 | +From: notstevy <notstevy@ultrabuildmc.de> |
| 3 | +Date: Thu, 2 Oct 2025 21:37:23 +0200 |
| 4 | +Subject: [PATCH] Predictable Projectiles |
| 5 | + |
| 6 | +Signed-off-by: notstevy <notstevy@ultrabuildmc.de> |
| 7 | + |
| 8 | +diff --git a/net/minecraft/world/entity/projectile/Projectile.java b/net/minecraft/world/entity/projectile/Projectile.java |
| 9 | +index dae6619f4670c6f68dae7e4b10b0b6a8bbe6dc2e..a85f9745e61a5b05752beceacca34bc9cbbc0b04 100644 |
| 10 | +--- a/net/minecraft/world/entity/projectile/Projectile.java |
| 11 | ++++ b/net/minecraft/world/entity/projectile/Projectile.java |
| 12 | +@@ -139,6 +139,12 @@ public abstract class Projectile extends Entity implements TraceableEntity { |
| 13 | + } |
| 14 | + |
| 15 | + public Vec3 getMovementToShoot(double x, double y, double z, float velocity, float inaccuracy) { |
| 16 | ++ // kitpvp start - Predictable Projectiles |
| 17 | ++ if(((ServerLevel) this.level()).getGameRules().getBoolean(GameRules.RULE_PREDICATBLE_PROJECTILES)) { |
| 18 | ++ inaccuracy = 0; |
| 19 | ++ } |
| 20 | ++ // kitpvp end - Predictable Projectiles |
| 21 | ++ |
| 22 | + return new Vec3(x, y, z) |
| 23 | + .normalize() |
| 24 | + .add( |
| 25 | +diff --git a/net/minecraft/world/level/GameRules.java b/net/minecraft/world/level/GameRules.java |
| 26 | +index ff5ac5d7aa0346c6598ed097cfb10b0e2991642e..4420ce80c8dff106c1f497c63161649eb8c37c06 100644 |
| 27 | +--- a/net/minecraft/world/level/GameRules.java |
| 28 | ++++ b/net/minecraft/world/level/GameRules.java |
| 29 | +@@ -245,6 +245,11 @@ public class GameRules { |
| 30 | + "predictableEnchantments", GameRules.Category.MISC, GameRules.BooleanValue.create(false) |
| 31 | + ); |
| 32 | + // kitpvp end - Predicatable Enchantments |
| 33 | ++ // kitpvp start - Predicatable Projectiles |
| 34 | ++ public static final GameRules.Key<GameRules.BooleanValue> RULE_PREDICATBLE_PROJECTILES = register( |
| 35 | ++ "predictableProjectiles", GameRules.Category.MISC, GameRules.BooleanValue.create(false) |
| 36 | ++ ); |
| 37 | ++ // kitpvp end - Predicatable Projectiles |
| 38 | + private final Map<GameRules.Key<?>, GameRules.Value<?>> rules; |
| 39 | + private final FeatureFlagSet enabledFeatures; |
| 40 | + private final GameRules.Value<?>[] gameruleArray; // Paper - Perf: Use array for gamerule storage |
0 commit comments