Paper/Spigot-Server-Patches/0320-Add-sun-related-API.patch
Shane Freeder 7e8ae207bd
Updated Upstream (Bukkit/CraftBukkit/Spigot)
Upstream has released updates that appears to apply and compile correctly.
This update has not been tested by PaperMC and as with ANY update, please do your own testing

Bukkit Changes:
e99c9444 Add Plugin Chunk Ticket API
6a235f06 Fix incorrect nullability annotations for PlayerJoinEvent's join message

CraftBukkit Changes:
5f889388 Tweak build expiration to 7 days
572c02b0 MC-155077, SPIGOT-5113: EntityTracker desync
7ad3a1f4 SPIGOT-5146: BlockDataMeta does not work
60860983 SPIGOT-5155: Setting EntityExplodeEvent yield to 0 still causes blocks to drop
087a2cf4 Print number of force loaded chunks per plugin in crash reports
07b5b06d Add Plugin Chunk Ticket API
7ffb2a27 SPIGOT-5149: resetRecipes does nothing
a2275f19 SPIGOT-5141: World.generateTree() causes ClassCastException with huge mushrooms
31d4a777 SPIGOT-5142: Ignore invalid firework effects

Spigot Changes:
5e4e7f32 BUILDTOOLS-471: Rebuild patches
6e944739 SPIGOT-5159: Raider activation range overridden by Monster range
2019-07-11 17:59:21 +01:00

68 lines
2.5 KiB
Diff

From b4f22385c9fc8d2910d3edd9b448119953903eb9 Mon Sep 17 00:00:00 2001
From: BillyGalbreath <Blake.Galbreath@GMail.com>
Date: Sun, 7 Oct 2018 00:54:21 -0500
Subject: [PATCH] Add sun related API
diff --git a/src/main/java/net/minecraft/server/EntityInsentient.java b/src/main/java/net/minecraft/server/EntityInsentient.java
index c20374d77..5e88367d3 100644
--- a/src/main/java/net/minecraft/server/EntityInsentient.java
+++ b/src/main/java/net/minecraft/server/EntityInsentient.java
@@ -1327,6 +1327,7 @@ public abstract class EntityInsentient extends EntityLiving {
return flag;
}
+ public boolean isInDaylight() { return dT(); } // Paper - OBFHELPER
protected boolean dT() {
if (this.world.J() && !this.world.isClientSide) {
float f = this.aF();
diff --git a/src/main/java/net/minecraft/server/World.java b/src/main/java/net/minecraft/server/World.java
index f0332c893..1f28358f9 100644
--- a/src/main/java/net/minecraft/server/World.java
+++ b/src/main/java/net/minecraft/server/World.java
@@ -705,6 +705,7 @@ public abstract class World implements IIBlockAccess, GeneratorAccess, AutoClose
}
}
+ public boolean isDayTime() { return J(); } // Paper - OBFHELPER
public boolean J() {
return this.d < 4;
}
diff --git a/src/main/java/org/bukkit/craftbukkit/CraftWorld.java b/src/main/java/org/bukkit/craftbukkit/CraftWorld.java
index 2ef965a7d..79aac04ff 100644
--- a/src/main/java/org/bukkit/craftbukkit/CraftWorld.java
+++ b/src/main/java/org/bukkit/craftbukkit/CraftWorld.java
@@ -824,6 +824,13 @@ public class CraftWorld implements World {
}
}
+ // Paper start
+ @Override
+ public boolean isDayTime() {
+ return getHandle().isDayTime();
+ }
+ // Paper end
+
@Override
public boolean createExplosion(double x, double y, double z, float power) {
return createExplosion(x, y, z, power, false, true);
diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftMob.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftMob.java
index 53c2d154e..56c233872 100644
--- a/src/main/java/org/bukkit/craftbukkit/entity/CraftMob.java
+++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftMob.java
@@ -68,4 +68,11 @@ public abstract class CraftMob extends CraftLivingEntity implements Mob {
public long getSeed() {
return getHandle().lootTableSeed;
}
+
+ // Paper start
+ @Override
+ public boolean isInDaylight() {
+ return getHandle().isInDaylight();
+ }
+ // Paper end
}
--
2.22.0