mirror of
https://github.com/PaperMC/Paper.git
synced 2024-12-12 09:51:12 +01:00
aaefc4fbbe
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 Spigot Changes: 2474d93d SPIGOT-4462: Catch async chunk regenerate
65 lines
2.5 KiB
Diff
65 lines
2.5 KiB
Diff
From 4c9116f3e592f2ce2708d593e0379be42d0a43fc 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 5aea6629f2..fd4a77c1a9 100644
|
|
--- a/src/main/java/net/minecraft/server/EntityInsentient.java
|
|
+++ b/src/main/java/net/minecraft/server/EntityInsentient.java
|
|
@@ -1286,6 +1286,7 @@ public abstract class EntityInsentient extends EntityLiving {
|
|
return flag;
|
|
}
|
|
|
|
+ public boolean isInDaylight() { return dq(); } // Paper - OBFHELPER
|
|
protected boolean dq() {
|
|
if (this.world.L() && !this.world.isClientSide) {
|
|
float f = this.az();
|
|
diff --git a/src/main/java/net/minecraft/server/World.java b/src/main/java/net/minecraft/server/World.java
|
|
index 23529954b4..7914f9b606 100644
|
|
--- a/src/main/java/net/minecraft/server/World.java
|
|
+++ b/src/main/java/net/minecraft/server/World.java
|
|
@@ -829,6 +829,7 @@ public abstract class World implements IEntityAccess, GeneratorAccess, IIBlockAc
|
|
}
|
|
}
|
|
|
|
+ public boolean isDayTime() { return L(); } // Paper - OBFHELPER
|
|
public boolean L() {
|
|
return this.G < 4;
|
|
}
|
|
diff --git a/src/main/java/org/bukkit/craftbukkit/CraftWorld.java b/src/main/java/org/bukkit/craftbukkit/CraftWorld.java
|
|
index ef5a7bc38a..10fa122536 100644
|
|
--- a/src/main/java/org/bukkit/craftbukkit/CraftWorld.java
|
|
+++ b/src/main/java/org/bukkit/craftbukkit/CraftWorld.java
|
|
@@ -523,6 +523,12 @@ public class CraftWorld implements World {
|
|
}
|
|
}
|
|
|
|
+ // Paper start
|
|
+ public boolean isDayTime() {
|
|
+ return getHandle().isDayTime();
|
|
+ }
|
|
+ // Paper end
|
|
+
|
|
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 53c2d154ed..40a429942e 100644
|
|
--- a/src/main/java/org/bukkit/craftbukkit/entity/CraftMob.java
|
|
+++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftMob.java
|
|
@@ -68,4 +68,10 @@ public abstract class CraftMob extends CraftLivingEntity implements Mob {
|
|
public long getSeed() {
|
|
return getHandle().lootTableSeed;
|
|
}
|
|
+
|
|
+ // Paper start
|
|
+ public boolean isInDaylight() {
|
|
+ return getHandle().isInDaylight();
|
|
+ }
|
|
+ // Paper end
|
|
}
|
|
--
|
|
2.19.1
|
|
|