mirror of
https://github.com/PaperMC/Paper.git
synced 2024-12-01 04:31:58 +01:00
060bc7bbee
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: 4543fb40 SPIGOT-4943: Zombie villager conversion player API. CraftBukkit Changes:585b2ebd
Tweak thresholds for can't keep up message91ada5c2
SPIGOT-4956: EntityTameEvent not triggered when taming a Cat9bda4134
SPIGOT-4943: Zombie villager conversion player API.5a027071
SPIGOT-4947: Allow setting the content on a lectern09d00e9f
SPIGOT-4938: Call EntityPickupItemEvent for dolphinsa278e445
SPIGOT-4948: Lectern.getInventory should return a LecternInventory Spigot Changes: 4f661b22 Rebuild patches
67 lines
2.5 KiB
Diff
67 lines
2.5 KiB
Diff
From 0a7c840cccbb6c84d43432205ed423fb5791ac99 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 11652628b..90923c753 100644
|
|
--- a/src/main/java/net/minecraft/server/EntityInsentient.java
|
|
+++ b/src/main/java/net/minecraft/server/EntityInsentient.java
|
|
@@ -1326,6 +1326,7 @@ public abstract class EntityInsentient extends EntityLiving {
|
|
return flag;
|
|
}
|
|
|
|
+ public boolean isInDaylight() { return dS(); } // Paper - OBFHELPER
|
|
protected boolean dS() {
|
|
if (this.world.J() && !this.world.isClientSide) {
|
|
float f = this.aE();
|
|
diff --git a/src/main/java/net/minecraft/server/World.java b/src/main/java/net/minecraft/server/World.java
|
|
index 5220ea099..70e5552cd 100644
|
|
--- a/src/main/java/net/minecraft/server/World.java
|
|
+++ b/src/main/java/net/minecraft/server/World.java
|
|
@@ -669,6 +669,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 ca41b6d6b..073400f23 100644
|
|
--- a/src/main/java/org/bukkit/craftbukkit/CraftWorld.java
|
|
+++ b/src/main/java/org/bukkit/craftbukkit/CraftWorld.java
|
|
@@ -740,6 +740,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.21.0
|
|
|