diff --git a/LICENSE.md b/LICENSE.md index f499fec45c..45bb214c6f 100644 --- a/LICENSE.md +++ b/LICENSE.md @@ -46,4 +46,5 @@ Machine_Maker Ivan Pekov Camotoy <20743703+Camotoy@users.noreply.github.com> Bjarne Koll +MeFisto94 ``` diff --git a/Spigot-API-Patches/Add-a-should-burn-in-sunlight-API-for-Phantoms-and-S.patch b/Spigot-API-Patches/Add-a-should-burn-in-sunlight-API-for-Phantoms-and-S.patch new file mode 100644 index 0000000000..8d495850c0 --- /dev/null +++ b/Spigot-API-Patches/Add-a-should-burn-in-sunlight-API-for-Phantoms-and-S.patch @@ -0,0 +1,55 @@ +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 +From: MeFisto94 +Date: Tue, 11 May 2021 00:48:51 +0200 +Subject: [PATCH] Add a "should burn in sunlight" API for Phantoms and + Skeletons + + +diff --git a/src/main/java/org/bukkit/entity/Phantom.java b/src/main/java/org/bukkit/entity/Phantom.java +index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644 +--- a/src/main/java/org/bukkit/entity/Phantom.java ++++ b/src/main/java/org/bukkit/entity/Phantom.java +@@ -0,0 +0,0 @@ public interface Phantom extends Flying { + */ + @Nullable + public java.util.UUID getSpawningEntity(); ++ ++ /** ++ * Check if this phantom will burn in the sunlight ++ * ++ * @return True if phantom will burn in sunlight ++ */ ++ public boolean shouldBurnInDay(); ++ ++ /** ++ * Set if this phantom should burn in the sunlight ++ * ++ * @param shouldBurnInDay True to burn in sunlight ++ */ ++ public void setShouldBurnInDay(boolean shouldBurnInDay); + // Paper end + } +diff --git a/src/main/java/org/bukkit/entity/Skeleton.java b/src/main/java/org/bukkit/entity/Skeleton.java +index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644 +--- a/src/main/java/org/bukkit/entity/Skeleton.java ++++ b/src/main/java/org/bukkit/entity/Skeleton.java +@@ -0,0 +0,0 @@ public interface Skeleton extends Monster, RangedEntity { // Paper + */ + STRAY; + } ++ // Paper start ++ /** ++ * Check if this skeleton will burn in the sunlight ++ * ++ * @return True if skeleton will burn in sunlight ++ */ ++ boolean shouldBurnInDay(); ++ ++ /** ++ * Set if this skeleton should burn in the sunlight ++ * ++ * @param shouldBurnInDay True to burn in sunlight ++ */ ++ void setShouldBurnInDay(boolean shouldBurnInDay); ++ // Paper end + } diff --git a/Spigot-Server-Patches/Add-a-should-burn-in-sunlight-API-for-Phantoms-and-S.patch b/Spigot-Server-Patches/Add-a-should-burn-in-sunlight-API-for-Phantoms-and-S.patch new file mode 100644 index 0000000000..56e162de3b --- /dev/null +++ b/Spigot-Server-Patches/Add-a-should-burn-in-sunlight-API-for-Phantoms-and-S.patch @@ -0,0 +1,126 @@ +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 +From: MeFisto94 +Date: Tue, 11 May 2021 00:48:33 +0200 +Subject: [PATCH] Add a "should burn in sunlight" API for Phantoms and + Skeletons + + +diff --git a/src/main/java/net/minecraft/world/entity/monster/EntityPhantom.java b/src/main/java/net/minecraft/world/entity/monster/EntityPhantom.java +index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644 +--- a/src/main/java/net/minecraft/world/entity/monster/EntityPhantom.java ++++ b/src/main/java/net/minecraft/world/entity/monster/EntityPhantom.java +@@ -0,0 +0,0 @@ public class EntityPhantom extends EntityFlying implements IMonster { + + @Override + public void movementTick() { +- if (this.isAlive() && this.eG()) { ++ if (this.isAlive() && shouldBurnInDay && this.eG()) { // Paper - Configurable Burning + this.setOnFire(8); + } + +@@ -0,0 +0,0 @@ public class EntityPhantom extends EntityFlying implements IMonster { + if (nbttagcompound.hasUUID("Paper.SpawningEntity")) { + this.spawningEntity = nbttagcompound.getUUID("Paper.SpawningEntity"); + } ++ this.shouldBurnInDay = nbttagcompound.getBoolean("Paper.ShouldBurnInDay"); + // Paper end + } + +@@ -0,0 +0,0 @@ public class EntityPhantom extends EntityFlying implements IMonster { + if (this.spawningEntity != null) { + nbttagcompound.setUUID("Paper.SpawningEntity", this.spawningEntity); + } ++ nbttagcompound.setBoolean("Paper.ShouldBurnInDay", shouldBurnInDay); + // Paper end + } + +@@ -0,0 +0,0 @@ public class EntityPhantom extends EntityFlying implements IMonster { + return spawningEntity; + } + public void setSpawningEntity(java.util.UUID entity) { this.spawningEntity = entity; } ++ ++ private boolean shouldBurnInDay = true; ++ public boolean shouldBurnInDay() { return shouldBurnInDay; } ++ public void setShouldBurnInDay(boolean shouldBurnInDay) { this.shouldBurnInDay = shouldBurnInDay; } + // Paper end + + class b extends PathfinderGoal { +diff --git a/src/main/java/net/minecraft/world/entity/monster/EntitySkeletonAbstract.java b/src/main/java/net/minecraft/world/entity/monster/EntitySkeletonAbstract.java +index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644 +--- a/src/main/java/net/minecraft/world/entity/monster/EntitySkeletonAbstract.java ++++ b/src/main/java/net/minecraft/world/entity/monster/EntitySkeletonAbstract.java +@@ -0,0 +0,0 @@ public abstract class EntitySkeletonAbstract extends EntityMonster implements IR + return EnumMonsterType.UNDEAD; + } + ++ // Paper start ++ private boolean shouldBurnInDay = true; ++ public boolean shouldBurnInDay() { return shouldBurnInDay; } ++ public void setShouldBurnInDay(boolean shouldBurnInDay) { this.shouldBurnInDay = shouldBurnInDay; } ++ // Paper end ++ + @Override + public void movementTick() { +- boolean flag = this.eG(); ++ boolean flag = shouldBurnInDay && this.eG(); // Paper - Configurable Burning + + if (flag) { + ItemStack itemstack = this.getEquipment(EnumItemSlot.HEAD); +@@ -0,0 +0,0 @@ public abstract class EntitySkeletonAbstract extends EntityMonster implements IR + public void loadData(NBTTagCompound nbttagcompound) { + super.loadData(nbttagcompound); + this.eL(); ++ this.shouldBurnInDay = nbttagcompound.getBoolean("Paper.ShouldBurnInDay"); // Paper ++ } ++ ++ // Paper start ++ @Override ++ public void saveData(NBTTagCompound nbttagcompound) { ++ super.saveData(nbttagcompound); ++ nbttagcompound.setBoolean("Paper.ShouldBurnInDay", shouldBurnInDay); + } ++ // Paper end + + @Override + public void setSlot(EnumItemSlot enumitemslot, ItemStack itemstack) { +diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftPhantom.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftPhantom.java +index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644 +--- a/src/main/java/org/bukkit/craftbukkit/entity/CraftPhantom.java ++++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftPhantom.java +@@ -0,0 +0,0 @@ public class CraftPhantom extends CraftFlying implements Phantom { + public java.util.UUID getSpawningEntity() { + return getHandle().getSpawningEntity(); + } ++ ++ @Override ++ public boolean shouldBurnInDay() { ++ return getHandle().shouldBurnInDay(); ++ } ++ ++ @Override ++ public void setShouldBurnInDay(boolean shouldBurnInDay) { ++ getHandle().setShouldBurnInDay(shouldBurnInDay); ++ } + // Paper end + } +diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftSkeleton.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftSkeleton.java +index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644 +--- a/src/main/java/org/bukkit/craftbukkit/entity/CraftSkeleton.java ++++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftSkeleton.java +@@ -0,0 +0,0 @@ public class CraftSkeleton extends CraftMonster implements Skeleton, com.destroy + public void setSkeletonType(SkeletonType type) { + throw new UnsupportedOperationException("Not supported."); + } ++ ++ // Paper start ++ @Override ++ public boolean shouldBurnInDay() { ++ return getHandle().shouldBurnInDay(); ++ } ++ ++ @Override ++ public void setShouldBurnInDay(boolean shouldBurnInDay) { ++ getHandle().setShouldBurnInDay(shouldBurnInDay); ++ } ++ // Paper end + }