mirror of
https://github.com/PaperMC/Paper.git
synced 2024-11-09 04:09:54 +01:00
88ab784da0
Upstream has released updates that appear to apply and compile correctly. This update has not been tested by PaperMC and as with ANY update, please do your own testing CraftBukkit Changes: 28d72c4bd SPIGOT-6428: World.generateTree does not generate bee nests
53 lines
2.1 KiB
Diff
53 lines
2.1 KiB
Diff
From 0000000000000000000000000000000000000000 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/world/entity/EntityInsentient.java b/src/main/java/net/minecraft/world/entity/EntityInsentient.java
|
|
index 41566398f5eee6cf93376f2e2200728bb6d2181c..db72b685f4a4b95f345f1d34f9eeb83b8731120a 100644
|
|
--- a/src/main/java/net/minecraft/world/entity/EntityInsentient.java
|
|
+++ b/src/main/java/net/minecraft/world/entity/EntityInsentient.java
|
|
@@ -1597,6 +1597,7 @@ public abstract class EntityInsentient extends EntityLiving {
|
|
|
|
}
|
|
|
|
+ public boolean isInDaylight() { return this.eG(); } // Paper - OBFHELPER
|
|
protected boolean eG() {
|
|
if (this.world.isDay() && !this.world.isClientSide) {
|
|
float f = this.aR();
|
|
diff --git a/src/main/java/org/bukkit/craftbukkit/CraftWorld.java b/src/main/java/org/bukkit/craftbukkit/CraftWorld.java
|
|
index 796fd718f3fe57618aedc9f5a41aac64422e3e34..2197dad881bf5e9d90902c4526db18e19a087230 100644
|
|
--- a/src/main/java/org/bukkit/craftbukkit/CraftWorld.java
|
|
+++ b/src/main/java/org/bukkit/craftbukkit/CraftWorld.java
|
|
@@ -865,6 +865,13 @@ public class CraftWorld implements World {
|
|
}
|
|
}
|
|
|
|
+ // Paper start
|
|
+ @Override
|
|
+ public boolean isDayTime() {
|
|
+ return getHandle().isDay();
|
|
+ }
|
|
+ // Paper end
|
|
+
|
|
@Override
|
|
public long getGameTime() {
|
|
return world.worldData.getTime();
|
|
diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftMob.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftMob.java
|
|
index 28a4e90130f51fd2fda7003fde5b4d0a410e1aef..06cbe63ef04e0de824ac0b9d545b6da1f53701b3 100644
|
|
--- a/src/main/java/org/bukkit/craftbukkit/entity/CraftMob.java
|
|
+++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftMob.java
|
|
@@ -78,4 +78,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
|
|
}
|