PaperMC/Spigot-Server-Patches/More-lightning-API.patch
Jason Penilla 062733b903 Updated Upstream (CraftBukkit/Spigot)
Doesn't compile yet.

CraftBukkit Changes:
90d6905b Repackage NMS
69cf961d Repackage patches

Spigot Changes:
79d53c28 Repackage NMS
2021-03-16 00:19:45 -07:00

68 lines
2.4 KiB
Diff

From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: Nassim Jahnke <nassim@njahnke.dev>
Date: Sun, 26 Jul 2020 14:44:09 +0200
Subject: [PATCH] More lightning API
diff --git a/src/main/java/net/minecraft/world/entity/EntityLightning.java b/src/main/java/net/minecraft/world/entity/EntityLightning.java
index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644
--- a/src/main/java/net/minecraft/world/entity/EntityLightning.java
+++ b/src/main/java/net/minecraft/world/entity/EntityLightning.java
@@ -0,0 +0,0 @@ public class EntityLightning extends Entity {
private int lifeTicks;
public long b;
- private int d;
+ private int d; public int getFlashCount() { return d; } public void setFlashCount(int flashes) { this.d = flashes; } // Paper - OBFHELPER
public boolean isEffect;
@Nullable
private EntityPlayer f;
@@ -0,0 +0,0 @@ public class EntityLightning extends Entity {
this.isEffect = flag;
}
+ // Paper start
+ public int getLifeTicks() {
+ return lifeTicks;
+ }
+
+ public void setLifeTicks(int lifeTicks) {
+ this.lifeTicks = lifeTicks;
+ }
+ // Paper end
+
@Override
public SoundCategory getSoundCategory() {
return SoundCategory.WEATHER;
diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftLightningStrike.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftLightningStrike.java
index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644
--- a/src/main/java/org/bukkit/craftbukkit/entity/CraftLightningStrike.java
+++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftLightningStrike.java
@@ -0,0 +0,0 @@ public class CraftLightningStrike extends CraftEntity implements LightningStrike
return spigot;
}
// Spigot end
+
+ // Paper start
+ @Override
+ public int getFlashCount() {
+ return getHandle().getFlashCount();
+ }
+
+ @Override
+ public void setFlashCount(int flashes) {
+ com.google.common.base.Preconditions.checkArgument(flashes >= 0, "Flashes has to be a positive number!");
+ getHandle().setFlashCount(flashes);
+ }
+
+ @Override
+ public int getLifeTicks() {
+ return getHandle().getLifeTicks();
+ }
+
+ @Override
+ public void setLifeTicks(int lifeTicks) {
+ getHandle().setLifeTicks(lifeTicks);
+ }
+ // Paper end
}