diff --git a/paper-server/nms-patches/net/minecraft/world/entity/EntityLightning.patch b/paper-server/nms-patches/net/minecraft/world/entity/EntityLightning.patch index a6705430a4..50459640fb 100644 --- a/paper-server/nms-patches/net/minecraft/world/entity/EntityLightning.patch +++ b/paper-server/nms-patches/net/minecraft/world/entity/EntityLightning.patch @@ -1,6 +1,6 @@ --- a/net/minecraft/world/entity/EntityLightning.java +++ b/net/minecraft/world/entity/EntityLightning.java -@@ -29,6 +29,10 @@ +@@ -29,14 +29,18 @@ import net.minecraft.world.phys.AxisAlignedBB; import net.minecraft.world.phys.Vec3D; @@ -11,6 +11,16 @@ public class EntityLightning extends Entity { private static final int START_LIFE = 2; + private static final double DAMAGE_RADIUS = 3.0D; + private static final double DETECTION_RADIUS = 15.0D; +- private int life; ++ public int life; // PAIL private -> public + public long seed; +- private int flashes; ++ public int flashes; // PAIL private -> public + public boolean visualOnly; + @Nullable + private EntityPlayer cause; @@ -129,7 +133,7 @@ } } diff --git a/paper-server/src/main/java/org/bukkit/craftbukkit/entity/CraftLightningStrike.java b/paper-server/src/main/java/org/bukkit/craftbukkit/entity/CraftLightningStrike.java index 381f448b01..3a4fb14bff 100644 --- a/paper-server/src/main/java/org/bukkit/craftbukkit/entity/CraftLightningStrike.java +++ b/paper-server/src/main/java/org/bukkit/craftbukkit/entity/CraftLightningStrike.java @@ -1,8 +1,10 @@ package org.bukkit.craftbukkit.entity; +import net.minecraft.server.level.EntityPlayer; import net.minecraft.world.entity.EntityLightning; import org.bukkit.craftbukkit.CraftServer; import org.bukkit.entity.LightningStrike; +import org.bukkit.entity.Player; public class CraftLightningStrike extends CraftEntity implements LightningStrike { public CraftLightningStrike(final CraftServer server, final EntityLightning entity) { @@ -14,6 +16,31 @@ public class CraftLightningStrike extends CraftEntity implements LightningStrike return getHandle().visualOnly; } + public int getFlashes() { + return getHandle().flashes; + } + + public void setFlashes(int flashes) { + getHandle().flashes = flashes; + } + + public int getLifeTicks() { + return getHandle().life; + } + + public void setLifeTicks(int ticks) { + getHandle().life = ticks; + } + + public Player getCausingPlayer() { + EntityPlayer player = getHandle().getCause(); + return (player != null) ? player.getBukkitEntity() : null; + } + + public void setCausingPlayer(Player player) { + getHandle().setCause((player != null) ? ((CraftPlayer) player).getHandle() : null); + } + @Override public EntityLightning getHandle() { return (EntityLightning) entity;