PaperMC/Spigot-Server-Patches/0318-Add-sun-related-API.patch
Shane Freeder c9fd745840
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:
ff0672ca SPIGOT-5211: Add Raid API

CraftBukkit Changes:
96bc85f0 SPIGOT-5298: Remove unexplained 0.1 drop chance offset
6ed8a189 SPIGOT-5290: Invulnerable and/or Marker armor stand triggers EntityDamageEvent
631eaeb0 SPIGOT-5297: PlayerBedLeaveEvent.getBed() returns player location
8d4bc541 SPIGOT-5293: Sponge behaviour differs from Vanilla
e91fd75e SPIGOT-5291: Missing event for ravagers trampling crops
cbdd7139 SPIGOT-5211: Add Raid API
edd8fdfb SPIGOT-5287: Fix rare CME generating new chunks
3fc97f08 SPIGOT-5265: FireworkExplodeEvent only fired when rockets explode in air

Spigot Changes:
065a3734 Rebuild patches
a5961826 SPIGOT-5286: tick-inactive-villagers invokes the AI for NoAI villagers
2019-08-31 20:30:44 +01:00

67 lines
2.5 KiB
Diff

From 72e4d2214ccb12a300545872fbeef8dfb54e54b8 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 a14d490ad..09112a8b0 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 this.dS(); } // Paper - OBFHELPER
protected boolean dS() {
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 c60279da8..1c3285f5c 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.u < 4;
}
diff --git a/src/main/java/org/bukkit/craftbukkit/CraftWorld.java b/src/main/java/org/bukkit/craftbukkit/CraftWorld.java
index c0dca07b6..0b891cd0f 100644
--- a/src/main/java/org/bukkit/craftbukkit/CraftWorld.java
+++ b/src/main/java/org/bukkit/craftbukkit/CraftWorld.java
@@ -839,6 +839,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.23.0