mirror of
https://github.com/PurpurMC/Purpur.git
synced 2026-02-17 16:37:43 +01:00
Fix broken /time command
This commit is contained in:
@@ -18,7 +18,7 @@ index 15af5927f3..c9c2e9774a 100644
|
||||
public PacketPlayOutUpdateTime() {}
|
||||
|
||||
diff --git a/src/main/java/net/minecraft/server/WorldServer.java b/src/main/java/net/minecraft/server/WorldServer.java
|
||||
index 0fb41962c8..62b1f09f82 100644
|
||||
index 0fb41962c8..86b6442292 100644
|
||||
--- a/src/main/java/net/minecraft/server/WorldServer.java
|
||||
+++ b/src/main/java/net/minecraft/server/WorldServer.java
|
||||
@@ -90,6 +90,7 @@ public class WorldServer extends World implements GeneratorAccessSeed {
|
||||
@@ -48,7 +48,7 @@ index 0fb41962c8..62b1f09f82 100644
|
||||
+ double incrementTimeBy = 12000.0D / (double) (world.isDay() ? world.purpurConfig.daytimeTicks : world.purpurConfig.nighttimeTicks);
|
||||
+ if (incrementTimeBy != 1.0D) {
|
||||
+ this.fakeTime += incrementTimeBy;
|
||||
+ this.setDayTime((long) this.fakeTime);
|
||||
+ this.setDayTime(this.fakeTime);
|
||||
+ PacketPlayOutUpdateTime packet = new PacketPlayOutUpdateTime(world.getTime(), world.getDayTime(), true);
|
||||
+ for (EntityHuman entityhuman : world.players) {
|
||||
+ EntityPlayer player = (EntityPlayer) entityhuman;
|
||||
@@ -60,6 +60,19 @@ index 0fb41962c8..62b1f09f82 100644
|
||||
this.setDayTime(this.worldData.getDayTime() + 1L);
|
||||
}
|
||||
|
||||
@@ -1017,6 +1033,12 @@ public class WorldServer extends World implements GeneratorAccessSeed {
|
||||
|
||||
public void setDayTime(long i) {
|
||||
this.worldDataServer.setDayTime(i);
|
||||
+ // Purpur start
|
||||
+ this.fakeTime = i;
|
||||
+ }
|
||||
+ public void setDayTime(double i) {
|
||||
+ this.worldDataServer.setDayTime((long) i);
|
||||
+ // Purpur end
|
||||
}
|
||||
|
||||
public void doMobSpawning(boolean flag, boolean flag1) {
|
||||
diff --git a/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java b/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java
|
||||
index 595a64aee5..b7de516378 100644
|
||||
--- a/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java
|
||||
|
||||
Reference in New Issue
Block a user