3
0
Mirror von https://github.com/PaperMC/Paper.git synchronisiert 2024-12-15 02:50:09 +01:00
Dieser Commit ist enthalten in:
Zach Brown 2019-12-10 20:43:21 -06:00
Ursprung a308619d28
Commit f2ed239ead
Es konnte kein GPG-Schlüssel zu dieser Signatur gefunden werden
GPG-Schlüssel-ID: CC9DA35FC5450B76
44 geänderte Dateien mit 403 neuen und 524 gelöschten Zeilen

Datei anzeigen

@ -1,4 +1,4 @@
From 34ff43f4623f7d96bedfae635ad4d12a2d6dee76 Mon Sep 17 00:00:00 2001
From 35a49b435ebe8feda6702c2a358e9b26c2da3c61 Mon Sep 17 00:00:00 2001
From: Aikar <aikar@aikar.co>
Date: Wed, 30 Mar 2016 19:36:20 -0400
Subject: [PATCH] MC Dev fixes
@ -443,7 +443,7 @@ index ee2059cf8..77bb6b092 100644
}
diff --git a/src/main/java/net/minecraft/server/VillagePlace.java b/src/main/java/net/minecraft/server/VillagePlace.java
index c137484f6..5f03eb40b 100644
index c137484f6..c999f8c9b 100644
--- a/src/main/java/net/minecraft/server/VillagePlace.java
+++ b/src/main/java/net/minecraft/server/VillagePlace.java
@@ -165,7 +165,7 @@ public class VillagePlace extends RegionFileSection<VillagePlaceSection> {
@ -455,6 +455,15 @@ index c137484f6..5f03eb40b 100644
chunksection.getClass();
return stream.anyMatch(chunksection::a);
@@ -185,7 +185,7 @@ public class VillagePlace extends RegionFileSection<VillagePlaceSection> {
SectionPosition.b(new ChunkCoordIntPair(blockposition), Math.floorDiv(i, 16)).map((sectionposition) -> {
return Pair.of(sectionposition, this.d(sectionposition.v()));
}).filter((pair) -> {
- return !(Boolean) ((Optional) pair.getSecond()).map(VillagePlaceSection::a).orElse(false);
+ return !(Boolean) (pair.getSecond()).map(VillagePlaceSection::a).orElse(false); // Paper - decompile fix
}).map((pair) -> {
return ((SectionPosition) pair.getFirst()).u();
}).filter((chunkcoordintpair) -> {
@@ -237,7 +237,7 @@ public class VillagePlace extends RegionFileSection<VillagePlaceSection> {
private final Predicate<? super VillagePlaceRecord> d;

Datei anzeigen

@ -1,4 +1,4 @@
From b37f294b95b584c122e443d1fb1b91946e0a796a Mon Sep 17 00:00:00 2001
From 8fb5fc5d8d43a02dbfa67bae041deff8c09989c2 Mon Sep 17 00:00:00 2001
From: Aikar <aikar@aikar.co>
Date: Tue, 1 Mar 2016 23:52:34 -0600
Subject: [PATCH] Prevent tile entity and entity crashes
@ -23,7 +23,7 @@ index fa6400dcc..e2f3cec74 100644
}
}
diff --git a/src/main/java/net/minecraft/server/World.java b/src/main/java/net/minecraft/server/World.java
index 53757ee20..970ead244 100644
index 53757ee20..5793ebd00 100644
--- a/src/main/java/net/minecraft/server/World.java
+++ b/src/main/java/net/minecraft/server/World.java
@@ -687,11 +687,13 @@ public abstract class World implements GeneratorAccess, AutoCloseable {
@ -55,7 +55,7 @@ index 53757ee20..970ead244 100644
- entity.appendEntityCrashDetails(crashreportsystemdetails);
- throw new ReportedException(crashreport);
+ // Paper start - Prevent tile entity and entity crashes
+ System.err.println("Entity threw exception at " + entity.world.getWorld().getName() + ":" + entity.locX + "," + entity.locY + "," + entity.locZ);
+ System.err.println("Entity threw exception at " + entity.world.getWorld().getName() + ":" + entity.locX() + "," + entity.locY() + "," + entity.locZ());
+ throwable.printStackTrace();
+ entity.dead = true;
+ return;

Datei anzeigen

@ -1,4 +1,4 @@
From 00076452a7fc4bedb2f956fdbde185911cb712e6 Mon Sep 17 00:00:00 2001
From dab65a988fe0797faad9731359cfd9b36751931b Mon Sep 17 00:00:00 2001
From: Steve Anton <anxuiz.nx@gmail.com>
Date: Thu, 3 Mar 2016 00:09:38 -0600
Subject: [PATCH] Add PlayerInitialSpawnEvent
@ -6,24 +6,22 @@ Subject: [PATCH] Add PlayerInitialSpawnEvent
For modifying a player's initial spawn location as they join the server
diff --git a/src/main/java/net/minecraft/server/PlayerList.java b/src/main/java/net/minecraft/server/PlayerList.java
index fc3422cca3..00bab3f758 100644
index 1652a57e2..948a6e3b7 100644
--- a/src/main/java/net/minecraft/server/PlayerList.java
+++ b/src/main/java/net/minecraft/server/PlayerList.java
@@ -109,7 +109,22 @@ public abstract class PlayerList {
@@ -109,7 +109,20 @@ public abstract class PlayerList {
}
// CraftBukkit end
- entityplayer.spawnIn(worldserver);
+ // Paper start - support PlayerInitialSpawnEvent
+ Location originalLoc = new Location(entityplayer.world.getWorld(), entityplayer.locX, entityplayer.locY, entityplayer.locZ, entityplayer.yaw, entityplayer.pitch);
+ Location originalLoc = new Location(entityplayer.world.getWorld(), entityplayer.locX(), entityplayer.locY(), entityplayer.locZ(), entityplayer.yaw, entityplayer.pitch);
+ com.destroystokyo.paper.event.player.PlayerInitialSpawnEvent event = new com.destroystokyo.paper.event.player.PlayerInitialSpawnEvent(entityplayer.getBukkitEntity(), originalLoc);
+ this.server.server.getPluginManager().callEvent(event);
+
+ Location newLoc = event.getSpawnLocation();
+ entityplayer.world = ((CraftWorld) newLoc.getWorld()).getHandle();
+ entityplayer.locX = newLoc.getX();
+ entityplayer.locY = newLoc.getY();
+ entityplayer.locZ = newLoc.getZ();
+ entityplayer.setPositionRaw(newLoc.getX(), newLoc.getY(), newLoc.getZ());
+ entityplayer.yaw = newLoc.getYaw();
+ entityplayer.pitch = newLoc.getPitch();
+ entityplayer.dimension = ((CraftWorld) newLoc.getWorld()).getHandle().worldProvider.getDimensionManager();
@ -34,5 +32,5 @@ index fc3422cca3..00bab3f758 100644
String s1 = "local";
--
2.21.0
2.24.0

Datei anzeigen

@ -1,4 +1,4 @@
From a7a3c92a8a4cc9c19e672c543cc83faad68ef8ba Mon Sep 17 00:00:00 2001
From 2b1430ab1613161342f8b5cc8ea1e19ee5f90d0a Mon Sep 17 00:00:00 2001
From: Joseph Hirschfeld <joe@ibj.io>
Date: Thu, 3 Mar 2016 03:15:41 -0600
Subject: [PATCH] Add exception reporting event
@ -49,7 +49,7 @@ index 000000000..f699ce18c
+ }
+}
diff --git a/src/main/java/net/minecraft/server/Chunk.java b/src/main/java/net/minecraft/server/Chunk.java
index 46635a530..6c13ae3ba 100644
index f62429277..be32b31e7 100644
--- a/src/main/java/net/minecraft/server/Chunk.java
+++ b/src/main/java/net/minecraft/server/Chunk.java
@@ -1,5 +1,6 @@
@ -59,7 +59,7 @@ index 46635a530..6c13ae3ba 100644
import com.google.common.collect.Maps;
import com.google.common.collect.Sets;
import it.unimi.dsi.fastutil.longs.LongOpenHashSet;
@@ -511,10 +512,15 @@ public class Chunk implements IChunkAccess {
@@ -505,10 +506,15 @@ public class Chunk implements IChunkAccess {
this.tileEntities.remove(blockposition);
// Paper end
} else {
@ -80,7 +80,7 @@ index 46635a530..6c13ae3ba 100644
}
}
diff --git a/src/main/java/net/minecraft/server/ChunkProviderServer.java b/src/main/java/net/minecraft/server/ChunkProviderServer.java
index 15480a8df..0e8f08569 100644
index 459baf26d..038b7b68d 100644
--- a/src/main/java/net/minecraft/server/ChunkProviderServer.java
+++ b/src/main/java/net/minecraft/server/ChunkProviderServer.java
@@ -15,6 +15,9 @@ import java.util.function.BooleanSupplier;
@ -94,7 +94,7 @@ index 15480a8df..0e8f08569 100644
public class ChunkProviderServer extends IChunkProvider {
diff --git a/src/main/java/net/minecraft/server/NameReferencingFileConverter.java b/src/main/java/net/minecraft/server/NameReferencingFileConverter.java
index 2cb0962ff..21a8ed323 100644
index c9c2b0025..1422503e1 100644
--- a/src/main/java/net/minecraft/server/NameReferencingFileConverter.java
+++ b/src/main/java/net/minecraft/server/NameReferencingFileConverter.java
@@ -1,5 +1,6 @@
@ -121,10 +121,10 @@ index 2cb0962ff..21a8ed323 100644
}
// CraftBukkit end
diff --git a/src/main/java/net/minecraft/server/PlayerChunkMap.java b/src/main/java/net/minecraft/server/PlayerChunkMap.java
index 04a65b487..b65f4226b 100644
index 25eb8f648..1d4eddd93 100644
--- a/src/main/java/net/minecraft/server/PlayerChunkMap.java
+++ b/src/main/java/net/minecraft/server/PlayerChunkMap.java
@@ -688,6 +688,7 @@ public class PlayerChunkMap extends IChunkLoader implements PlayerChunk.d {
@@ -690,6 +690,7 @@ public class PlayerChunkMap extends IChunkLoader implements PlayerChunk.d {
this.world.checkSession();
} catch (ExceptionWorldConflict exceptionworldconflict) {
PlayerChunkMap.LOGGER.error("Couldn't save chunk; already in use by another instance of Minecraft?", exceptionworldconflict);
@ -132,7 +132,7 @@ index 04a65b487..b65f4226b 100644
return false;
}
@@ -715,6 +716,7 @@ public class PlayerChunkMap extends IChunkLoader implements PlayerChunk.d {
@@ -717,6 +718,7 @@ public class PlayerChunkMap extends IChunkLoader implements PlayerChunk.d {
return true;
} catch (Exception exception) {
PlayerChunkMap.LOGGER.error("Failed to save chunk {},{}", chunkcoordintpair.x, chunkcoordintpair.z, exception);
@ -141,34 +141,27 @@ index 04a65b487..b65f4226b 100644
}
}
diff --git a/src/main/java/net/minecraft/server/RegionFile.java b/src/main/java/net/minecraft/server/RegionFile.java
index 8b17dde50..d6cecfc09 100644
index 64be7cb97..515cc034e 100644
--- a/src/main/java/net/minecraft/server/RegionFile.java
+++ b/src/main/java/net/minecraft/server/RegionFile.java
@@ -1,5 +1,6 @@
package net.minecraft.server;
+import com.destroystokyo.paper.exception.ServerInternalException;
import com.google.common.collect.Lists;
import java.io.BufferedInputStream;
import java.io.BufferedOutputStream;
@@ -142,6 +143,7 @@ public class RegionFile implements AutoCloseable {
@@ -240,6 +240,7 @@ public class RegionFile implements AutoCloseable {
return true;
}
} catch (IOException ioexception) {
+ com.destroystokyo.paper.exception.ServerInternalException.reportInternalException(ioexception); // Paper
return false;
}
} catch (IOException ioexception) {
+ ServerInternalException.reportInternalException(ioexception); // Paper
return null;
}
}
@@ -262,6 +264,7 @@ public class RegionFile implements AutoCloseable {
// this.b(chunkcoordintpair, (int) (SystemUtils.getTimeMillis() / 1000L)); // Spigot - move this into writeChunk
} catch (IOException ioexception) {
ioexception.printStackTrace();
+ ServerInternalException.reportInternalException(ioexception); // Paper
}
}
@@ -308,6 +309,7 @@ public class RegionFile implements AutoCloseable {
filechannel.write(bytebuffer);
} catch (Throwable throwable1) {
throwable = throwable1;
+ com.destroystokyo.paper.exception.ServerInternalException.reportInternalException(throwable); // Paper
throw throwable1;
} finally {
if (filechannel != null) {
diff --git a/src/main/java/net/minecraft/server/SpawnerCreature.java b/src/main/java/net/minecraft/server/SpawnerCreature.java
index fc2bb1d69..9c065c999 100644
index 8ba344df6..02157d051 100644
--- a/src/main/java/net/minecraft/server/SpawnerCreature.java
+++ b/src/main/java/net/minecraft/server/SpawnerCreature.java
@@ -8,6 +8,7 @@ import org.apache.logging.log4j.LogManager;
@ -196,7 +189,7 @@ index fc2bb1d69..9c065c999 100644
}
diff --git a/src/main/java/net/minecraft/server/VillageSiege.java b/src/main/java/net/minecraft/server/VillageSiege.java
index a58d3ba4c..6e4c5d4d8 100644
index a8d1a0727..90e863280 100644
--- a/src/main/java/net/minecraft/server/VillageSiege.java
+++ b/src/main/java/net/minecraft/server/VillageSiege.java
@@ -1,5 +1,7 @@
@ -216,7 +209,7 @@ index a58d3ba4c..6e4c5d4d8 100644
}
diff --git a/src/main/java/net/minecraft/server/World.java b/src/main/java/net/minecraft/server/World.java
index 76704abda..ce723c62e 100644
index 464a8da31..5d8404f8a 100644
--- a/src/main/java/net/minecraft/server/World.java
+++ b/src/main/java/net/minecraft/server/World.java
@@ -2,6 +2,9 @@ package net.minecraft.server;
@ -229,7 +222,7 @@ index 76704abda..ce723c62e 100644
import com.google.common.collect.Lists;
import java.io.IOException;
import java.util.Collection;
@@ -715,8 +718,11 @@ public abstract class World implements IIBlockAccess, GeneratorAccess, AutoClose
@@ -688,8 +691,11 @@ public abstract class World implements GeneratorAccess, AutoCloseable {
gameprofilerfiller.exit();
} catch (Throwable throwable) {
// Paper start - Prevent tile entity and entity crashes
@ -242,12 +235,12 @@ index 76704abda..ce723c62e 100644
tilesThisCycle--;
this.tileEntityListTick.remove(tileTickPosition--);
continue;
@@ -787,8 +793,10 @@ public abstract class World implements IIBlockAccess, GeneratorAccess, AutoClose
@@ -760,8 +766,10 @@ public abstract class World implements GeneratorAccess, AutoCloseable {
consumer.accept(entity);
} catch (Throwable throwable) {
// Paper start - Prevent tile entity and entity crashes
- System.err.println("Entity threw exception at " + entity.world.getWorld().getName() + ":" + entity.locX + "," + entity.locY + "," + entity.locZ);
+ String msg = "Entity threw exception at " + entity.world.getWorld().getName() + ":" + entity.locX + "," + entity.locY + "," + entity.locZ;
- System.err.println("Entity threw exception at " + entity.world.getWorld().getName() + ":" + entity.locX() + "," + entity.locY() + "," + entity.locZ());
+ String msg = "Entity threw exception at " + entity.world.getWorld().getName() + ":" + entity.locX() + "," + entity.locY() + "," + entity.locZ();
+ System.err.println(msg);
throwable.printStackTrace();
+ getServer().getPluginManager().callEvent(new ServerExceptionEvent(new ServerInternalException(msg, throwable)));
@ -255,7 +248,7 @@ index 76704abda..ce723c62e 100644
return;
// Paper end
diff --git a/src/main/java/net/minecraft/server/WorldPersistentData.java b/src/main/java/net/minecraft/server/WorldPersistentData.java
index f5f540032..00e9a1735 100644
index 19e68a783..a2a25cf6a 100644
--- a/src/main/java/net/minecraft/server/WorldPersistentData.java
+++ b/src/main/java/net/minecraft/server/WorldPersistentData.java
@@ -121,6 +121,7 @@ public class WorldPersistentData {

Datei anzeigen

@ -1,4 +1,4 @@
From f6a52c30101f704f878fd5c02dd3fc79ab00b389 Mon Sep 17 00:00:00 2001
From a751c9333b1469eb35ce42ef889079b8a6b1287e Mon Sep 17 00:00:00 2001
From: Aikar <aikar@aikar.co>
Date: Tue, 8 Mar 2016 23:25:45 -0500
Subject: [PATCH] Disable Scoreboards for non players by default
@ -11,7 +11,7 @@ So avoid looking up scoreboards and short circuit to the "not on a team"
logic which is most likely to be true.
diff --git a/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java b/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java
index 773fa8c32..970de3fe8 100644
index ba16bcc31..f5e7f24c5 100644
--- a/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java
+++ b/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java
@@ -201,4 +201,9 @@ public class PaperWorldConfig {
@ -25,10 +25,10 @@ index 773fa8c32..970de3fe8 100644
+ }
}
diff --git a/src/main/java/net/minecraft/server/Entity.java b/src/main/java/net/minecraft/server/Entity.java
index 9629489fa..a9271479b 100644
index 2aea9ba50..2e5426432 100644
--- a/src/main/java/net/minecraft/server/Entity.java
+++ b/src/main/java/net/minecraft/server/Entity.java
@@ -2263,6 +2263,7 @@ public abstract class Entity implements INamableTileEntity, ICommandListener, Ke
@@ -2265,6 +2265,7 @@ public abstract class Entity implements INamableTileEntity, ICommandListener, Ke
@Nullable
public ScoreboardTeamBase getScoreboardTeam() {
@ -37,10 +37,10 @@ index 9629489fa..a9271479b 100644
}
diff --git a/src/main/java/net/minecraft/server/EntityLiving.java b/src/main/java/net/minecraft/server/EntityLiving.java
index fd5d1e1c8..c335a20fa 100644
index e38be6eba..6e8adb65c 100644
--- a/src/main/java/net/minecraft/server/EntityLiving.java
+++ b/src/main/java/net/minecraft/server/EntityLiving.java
@@ -582,6 +582,7 @@ public abstract class EntityLiving extends Entity {
@@ -535,6 +535,7 @@ public abstract class EntityLiving extends Entity {
if (nbttagcompound.hasKeyOfType("Team", 8)) {
String s = nbttagcompound.getString("Team");
ScoreboardTeam scoreboardteam = this.world.getScoreboard().getTeam(s);
@ -49,5 +49,5 @@ index fd5d1e1c8..c335a20fa 100644
if (!flag) {
--
2.23.0
2.24.0

Datei anzeigen

@ -1,14 +1,14 @@
From 66cd8b650ee784167dc1ccb379ca3ac3072e4ca2 Mon Sep 17 00:00:00 2001
From eff01493b52c93fb5b5d8faaf198442038f71bbd Mon Sep 17 00:00:00 2001
From: Jedediah Smith <jedediah@silencegreys.com>
Date: Sat, 4 Apr 2015 23:17:52 -0400
Subject: [PATCH] Complete resource pack API
diff --git a/src/main/java/net/minecraft/server/PlayerConnection.java b/src/main/java/net/minecraft/server/PlayerConnection.java
index 962362889a..7906b67570 100644
index fae57fc2c..d90c6a732 100644
--- a/src/main/java/net/minecraft/server/PlayerConnection.java
+++ b/src/main/java/net/minecraft/server/PlayerConnection.java
@@ -1318,7 +1318,11 @@ public class PlayerConnection implements PacketListenerPlayIn {
@@ -1334,7 +1334,11 @@ public class PlayerConnection implements PacketListenerPlayIn {
// CraftBukkit start
public void a(PacketPlayInResourcePackStatus packetplayinresourcepackstatus) {
PlayerConnectionUtils.ensureMainThread(packetplayinresourcepackstatus, this, this.player.getWorldServer());
@ -22,10 +22,10 @@ index 962362889a..7906b67570 100644
// CraftBukkit end
diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
index 3be0c60b5c..dbd34b1432 100644
index b0a459d3f..d6452504b 100644
--- a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
+++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
@@ -134,6 +134,10 @@ public class CraftPlayer extends CraftHumanEntity implements Player {
@@ -133,6 +133,10 @@ public class CraftPlayer extends CraftHumanEntity implements Player {
private double health = 20;
private boolean scaledHealth = false;
private double healthScale = 20;
@ -36,7 +36,7 @@ index 3be0c60b5c..dbd34b1432 100644
public CraftPlayer(CraftServer server, EntityPlayer entity) {
super(server, entity);
@@ -1755,6 +1759,32 @@ public class CraftPlayer extends CraftHumanEntity implements Player {
@@ -1739,6 +1743,32 @@ public class CraftPlayer extends CraftHumanEntity implements Player {
public boolean getAffectsSpawning() {
return this.getHandle().affectsSpawning;
}
@ -70,5 +70,5 @@ index 3be0c60b5c..dbd34b1432 100644
@Override
--
2.22.0
2.24.0

Datei anzeigen

@ -1,4 +1,4 @@
From 6951163f41c48961ff495eadbc07949a8ae88979 Mon Sep 17 00:00:00 2001
From 994f6f6f791b76504dc1feeb6051a421a1606aea Mon Sep 17 00:00:00 2001
From: Aikar <aikar@aikar.co>
Date: Mon, 4 Mar 2013 23:46:10 -0500
Subject: [PATCH] Chunk Save Reattempt
@ -6,32 +6,31 @@ Subject: [PATCH] Chunk Save Reattempt
We commonly have "Stream Closed" errors on chunk saving, so this code should re-try to save the chunk in the event of failure and hopefully prevent rollbacks.
diff --git a/src/main/java/net/minecraft/server/RegionFile.java b/src/main/java/net/minecraft/server/RegionFile.java
index d6cecfc09b..fb529eac91 100644
index 515cc034e..5d2cbbad2 100644
--- a/src/main/java/net/minecraft/server/RegionFile.java
+++ b/src/main/java/net/minecraft/server/RegionFile.java
@@ -263,8 +263,7 @@ public class RegionFile implements AutoCloseable {
// this.b(chunkcoordintpair, (int) (SystemUtils.getTimeMillis() / 1000L)); // Spigot - move this into writeChunk
} catch (IOException ioexception) {
- ioexception.printStackTrace();
- ServerInternalException.reportInternalException(ioexception); // Paper
+ com.destroystokyo.paper.util.SneakyThrow.sneaky(ioexception); // Paper - we want the upper try/catch to retry this
@@ -240,7 +240,7 @@ public class RegionFile implements AutoCloseable {
return true;
}
} catch (IOException ioexception) {
- com.destroystokyo.paper.exception.ServerInternalException.reportInternalException(ioexception); // Paper
+ com.destroystokyo.paper.util.SneakyThrow.sneaky(ioexception); // Paper - we want the upper try/catch to retry this
return false;
}
}
}
diff --git a/src/main/java/net/minecraft/server/RegionFileCache.java b/src/main/java/net/minecraft/server/RegionFileCache.java
index 84fe9ee3bf..1ea9e5bb43 100644
index a7f19c849..2fe27b460 100644
--- a/src/main/java/net/minecraft/server/RegionFileCache.java
+++ b/src/main/java/net/minecraft/server/RegionFileCache.java
@@ -79,6 +79,7 @@ public abstract class RegionFileCache implements AutoCloseable {
}
@@ -80,6 +80,7 @@ public final class RegionFileCache implements AutoCloseable {
protected void write(ChunkCoordIntPair chunkcoordintpair, NBTTagCompound nbttagcompound) throws IOException {
RegionFile regionfile = this.getFile(chunkcoordintpair, false); // CraftBukkit
+ int attempts = 0; Exception laste = null; while (attempts++ < 5) { try { // Paper
RegionFile regionfile = this.a(chunkcoordintpair, false); // CraftBukkit
DataOutputStream dataoutputstream = regionfile.c(chunkcoordintpair);
Throwable throwable = null;
@@ -103,6 +104,18 @@ public abstract class RegionFileCache implements AutoCloseable {
@@ -103,6 +104,18 @@ public final class RegionFileCache implements AutoCloseable {
}
@ -51,5 +50,5 @@ index 84fe9ee3bf..1ea9e5bb43 100644
public void close() throws IOException {
--
2.22.0
2.24.0

Datei anzeigen

@ -1,4 +1,4 @@
From f84198d655f9bc92955c539d6674292aa7f346b8 Mon Sep 17 00:00:00 2001
From ec2f6dd722010823cf75fb05071ee397441b9871 Mon Sep 17 00:00:00 2001
From: Aikar <aikar@aikar.co>
Date: Fri, 18 Mar 2016 13:17:38 -0400
Subject: [PATCH] Default loading permissions.yml before plugins
@ -16,7 +16,7 @@ modify that. Under the previous logic, plugins were unable (cleanly) override pe
A config option has been added for those who depend on the previous behavior, but I don't expect that.
diff --git a/src/main/java/com/destroystokyo/paper/PaperConfig.java b/src/main/java/com/destroystokyo/paper/PaperConfig.java
index 0c65afccfd..6cc99ffe43 100644
index f402a29b0..6ef5bb9f3 100644
--- a/src/main/java/com/destroystokyo/paper/PaperConfig.java
+++ b/src/main/java/com/destroystokyo/paper/PaperConfig.java
@@ -213,4 +213,9 @@ public class PaperConfig {
@ -30,10 +30,10 @@ index 0c65afccfd..6cc99ffe43 100644
+ }
}
diff --git a/src/main/java/org/bukkit/craftbukkit/CraftServer.java b/src/main/java/org/bukkit/craftbukkit/CraftServer.java
index ca4d68c181..adcb6fd1f3 100644
index 733abbbd9..cf12da15c 100644
--- a/src/main/java/org/bukkit/craftbukkit/CraftServer.java
+++ b/src/main/java/org/bukkit/craftbukkit/CraftServer.java
@@ -367,6 +367,7 @@ public final class CraftServer implements Server {
@@ -368,6 +368,7 @@ public final class CraftServer implements Server {
if (type == PluginLoadOrder.STARTUP) {
helpMap.clear();
helpMap.initializeGeneralTopics();
@ -41,7 +41,7 @@ index ca4d68c181..adcb6fd1f3 100644
}
Plugin[] plugins = pluginManager.getPlugins();
@@ -386,7 +387,7 @@ public final class CraftServer implements Server {
@@ -387,7 +388,7 @@ public final class CraftServer implements Server {
commandMap.registerServerAliases();
DefaultPermissions.registerCorePermissions();
CraftDefaultPermissions.registerCorePermissions();
@ -51,5 +51,5 @@ index ca4d68c181..adcb6fd1f3 100644
syncCommands();
}
--
2.22.0
2.24.0

Datei anzeigen

@ -1,4 +1,4 @@
From e4a631c318c73bc88e050bf30fb9175776e1d5c0 Mon Sep 17 00:00:00 2001
From 7f46adeb924e999511d8a4a236380f3228374ce1 Mon Sep 17 00:00:00 2001
From: William <admin@domnian.com>
Date: Fri, 18 Mar 2016 03:30:17 -0400
Subject: [PATCH] Allow Reloading of Custom Permissions
@ -6,10 +6,10 @@ Subject: [PATCH] Allow Reloading of Custom Permissions
https://github.com/PaperMC/Paper/issues/49
diff --git a/src/main/java/org/bukkit/craftbukkit/CraftServer.java b/src/main/java/org/bukkit/craftbukkit/CraftServer.java
index 4a43da08a5..8b8e85b711 100644
index cf12da15c..110fee6b6 100644
--- a/src/main/java/org/bukkit/craftbukkit/CraftServer.java
+++ b/src/main/java/org/bukkit/craftbukkit/CraftServer.java
@@ -2048,5 +2048,23 @@ public final class CraftServer implements Server {
@@ -2051,5 +2051,23 @@ public final class CraftServer implements Server {
return null;
}
}
@ -34,5 +34,5 @@ index 4a43da08a5..8b8e85b711 100644
// Paper end
}
--
2.22.0
2.24.0

Datei anzeigen

@ -1,4 +1,4 @@
From 502480c4124674193286dbae28552fca7c481b12 Mon Sep 17 00:00:00 2001
From 7a404dfb43ecfdf375aaa758a34374d93a643f9f Mon Sep 17 00:00:00 2001
From: Aikar <aikar@aikar.co>
Date: Fri, 18 Mar 2016 13:50:14 -0400
Subject: [PATCH] Remove Metadata on reload
@ -7,10 +7,10 @@ Metadata is not meant to persist reload as things break badly with non primitive
This will remove metadata on reload so it does not crash everything if a plugin uses it.
diff --git a/src/main/java/org/bukkit/craftbukkit/CraftServer.java b/src/main/java/org/bukkit/craftbukkit/CraftServer.java
index 20bd804bce..5d50baa038 100644
index 110fee6b6..09c62261a 100644
--- a/src/main/java/org/bukkit/craftbukkit/CraftServer.java
+++ b/src/main/java/org/bukkit/craftbukkit/CraftServer.java
@@ -800,8 +800,18 @@ public final class CraftServer implements Server {
@@ -801,8 +801,18 @@ public final class CraftServer implements Server {
world.paperConfig.init(); // Paper
}
@ -30,5 +30,5 @@ index 20bd804bce..5d50baa038 100644
reloadData();
org.spigotmc.SpigotConfig.registerCommands(); // Spigot
--
2.22.0
2.24.0

Datei anzeigen

@ -1,4 +1,4 @@
From 9c94c4d666dd012a9143703a7e8c4f5f727fc684 Mon Sep 17 00:00:00 2001
From 733d2f61b89c8b2061a6352570870c6444b609d8 Mon Sep 17 00:00:00 2001
From: Aikar <aikar@aikar.co>
Date: Thu, 28 May 2015 23:00:19 -0400
Subject: [PATCH] Handle Item Meta Inconsistencies
@ -18,7 +18,7 @@ For consistency, the old API methods now forward to use the
ItemMeta API equivalents, and should deprecate the old API's.
diff --git a/src/main/java/net/minecraft/server/ItemStack.java b/src/main/java/net/minecraft/server/ItemStack.java
index 9ebfbff46b..b1dfd64d15 100644
index 8e8fab497..0a1596ff0 100644
--- a/src/main/java/net/minecraft/server/ItemStack.java
+++ b/src/main/java/net/minecraft/server/ItemStack.java
@@ -7,6 +7,8 @@ import com.mojang.brigadier.StringReader;
@ -30,10 +30,10 @@ index 9ebfbff46b..b1dfd64d15 100644
import java.util.Locale;
import java.util.Objects;
import java.util.Random;
@@ -66,6 +68,22 @@ public final class ItemStack {
decimalformat.setDecimalFormatSymbols(DecimalFormatSymbols.getInstance(Locale.ROOT));
@@ -67,6 +69,23 @@ public final class ItemStack {
return decimalformat;
}
+ // Paper start
+ private static final java.util.Comparator<? super NBTTagCompound> enchantSorter = java.util.Comparator.comparing(o -> o.getString("id"));
+ private void processEnchantOrder(NBTTagCompound tag) {
@ -50,10 +50,11 @@ index 9ebfbff46b..b1dfd64d15 100644
+ } catch (Exception ignored) {}
+ }
+ // Paper end
+
public ItemStack(IMaterial imaterial) {
this(imaterial, 1);
@@ -100,6 +118,7 @@ public final class ItemStack {
}
@@ -104,6 +123,7 @@ public final class ItemStack {
if (nbttagcompound.hasKeyOfType("tag", 10)) {
// CraftBukkit start - make defensive copy as this data may be coming from the save thread
this.tag = (NBTTagCompound) nbttagcompound.getCompound("tag").clone();
@ -61,15 +62,15 @@ index 9ebfbff46b..b1dfd64d15 100644
this.getItem().a(this.tag);
// CraftBukkit end
}
@@ -613,6 +632,7 @@ public final class ItemStack {
@@ -615,6 +635,7 @@ public final class ItemStack {
// Paper end
public void setTag(@Nullable NBTTagCompound nbttagcompound) {
this.tag = nbttagcompound;
+ processEnchantOrder(this.tag); // Paper
}
public IChatBaseComponent getName() {
@@ -689,6 +709,7 @@ public final class ItemStack {
// CraftBukkit start - ensure null tags do not get inappropriately used (SpigotCraft#463)
if (this.tag == null && this.item != null && this.item.usesDurability()) {
this.setDamage(this.getDamage());
@@ -700,6 +721,7 @@ public final class ItemStack {
nbttagcompound.setString("id", String.valueOf(IRegistry.ENCHANTMENT.getKey(enchantment)));
nbttagcompound.setShort("lvl", (short) ((byte) i));
nbttaglist.add(nbttagcompound);
@ -78,7 +79,7 @@ index 9ebfbff46b..b1dfd64d15 100644
public boolean hasEnchantments() {
diff --git a/src/main/java/org/bukkit/craftbukkit/inventory/CraftItemStack.java b/src/main/java/org/bukkit/craftbukkit/inventory/CraftItemStack.java
index b0f9fa0ecd..9c9852f7a2 100644
index 15e3edee2..410444747 100644
--- a/src/main/java/org/bukkit/craftbukkit/inventory/CraftItemStack.java
+++ b/src/main/java/org/bukkit/craftbukkit/inventory/CraftItemStack.java
@@ -178,28 +178,11 @@ public final class CraftItemStack extends ItemStack {
@ -115,7 +116,7 @@ index b0f9fa0ecd..9c9852f7a2 100644
}
static boolean makeTag(net.minecraft.server.ItemStack item) {
@@ -216,66 +199,32 @@ public final class CraftItemStack extends ItemStack {
@@ -216,66 +199,33 @@ public final class CraftItemStack extends ItemStack {
@Override
public boolean containsEnchantment(Enchantment ench) {
@ -140,13 +141,7 @@ index b0f9fa0ecd..9c9852f7a2 100644
- NBTTagList list = getEnchantmentList(handle), listCopy;
- if (list == null) {
- return 0;
+ // Paper start - replace entire method
+ final ItemMeta itemMeta = getItemMeta();
+ int level = itemMeta.getEnchantLevel(ench);
+ if (level > 0) {
+ itemMeta.removeEnchant(ench);
+ setItemMeta(itemMeta);
}
- }
- int index = Integer.MIN_VALUE;
- int level = Integer.MIN_VALUE;
- int size = list.size();
@ -178,11 +173,17 @@ index b0f9fa0ecd..9c9852f7a2 100644
- if (i != index) {
- listCopy.add(list.get(i));
- }
- }
+ // Paper start - replace entire method
+ final ItemMeta itemMeta = getItemMeta();
+ int level = itemMeta.getEnchantLevel(ench);
+ if (level > 0) {
+ itemMeta.removeEnchant(ench);
+ setItemMeta(itemMeta);
}
- handle.getTag().set(ENCHANTMENTS.NBT, listCopy);
-
return level;
+ // Paper end
return level;
}
@Override
@ -193,7 +194,7 @@ index b0f9fa0ecd..9c9852f7a2 100644
static Map<Enchantment, Integer> getEnchantments(net.minecraft.server.ItemStack item) {
diff --git a/src/main/java/org/bukkit/craftbukkit/inventory/CraftMetaItem.java b/src/main/java/org/bukkit/craftbukkit/inventory/CraftMetaItem.java
index 33c988ead3..479a5686aa 100644
index 0f901453d..5ee968f2e 100644
--- a/src/main/java/org/bukkit/craftbukkit/inventory/CraftMetaItem.java
+++ b/src/main/java/org/bukkit/craftbukkit/inventory/CraftMetaItem.java
@@ -6,6 +6,7 @@ import com.google.common.collect.ImmutableList;
@ -204,14 +205,14 @@ index 33c988ead3..479a5686aa 100644
import com.google.common.collect.Lists;
import com.google.common.collect.Multimap;
import com.google.common.collect.SetMultimap;
@@ -24,6 +25,7 @@ import java.util.ArrayList;
@@ -23,6 +24,7 @@ import java.lang.reflect.InvocationTargetException;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Collection;
import java.util.EnumSet;
+import java.util.Comparator; // Paper
import java.util.EnumSet;
import java.util.HashMap;
import java.util.Iterator;
import java.util.LinkedHashMap;
@@ -32,6 +34,7 @@ import java.util.Locale;
import java.util.Map;
import java.util.NoSuchElementException;
@ -305,10 +306,11 @@ index 33c988ead3..479a5686aa 100644
}
if (this.hasAttributeModifiers()) {
clone.attributeModifiers = LinkedHashMultimap.create(this.attributeModifiers);
@@ -1432,6 +1435,23 @@ class CraftMetaItem implements ItemMeta, Damageable, Repairable, BlockDataMeta {
@@ -1431,4 +1434,22 @@ class CraftMetaItem implements ItemMeta, Damageable, Repairable, BlockDataMeta {
return HANDLED_TAGS;
}
}
+
+ // Paper start
+ private static class EnchantmentMap extends TreeMap<Enchantment, Integer> {
+ private EnchantmentMap(Map<Enchantment, Integer> enchantments) {
@ -326,9 +328,7 @@ index 33c988ead3..479a5686aa 100644
+ }
+ // Paper end
+
// Spigot start
private final Spigot spigot = new Spigot()
{
}
--
2.23.0
2.24.0

Datei anzeigen

@ -1,4 +1,4 @@
From bcd2fc4d37a9f78c89eeaaa4b79f6418579f4061 Mon Sep 17 00:00:00 2001
From e42bb2076e988a7257305c424389e160ab1997d9 Mon Sep 17 00:00:00 2001
From: Aikar <aikar@aikar.co>
Date: Fri, 18 Mar 2016 15:12:22 -0400
Subject: [PATCH] Configurable Non Player Arrow Despawn Rate
@ -6,7 +6,7 @@ Subject: [PATCH] Configurable Non Player Arrow Despawn Rate
Can set a much shorter despawn rate for arrows that players can not pick up.
diff --git a/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java b/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java
index aaa1b60f9..b72da38a7 100644
index 2c20de281..64146effd 100644
--- a/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java
+++ b/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java
@@ -211,4 +211,19 @@ public class PaperWorldConfig {
@ -30,10 +30,10 @@ index aaa1b60f9..b72da38a7 100644
+ }
}
diff --git a/src/main/java/net/minecraft/server/EntityArrow.java b/src/main/java/net/minecraft/server/EntityArrow.java
index e83b50ed4..2b829abac 100644
index 6723ffcca..fc70d50ac 100644
--- a/src/main/java/net/minecraft/server/EntityArrow.java
+++ b/src/main/java/net/minecraft/server/EntityArrow.java
@@ -263,7 +263,7 @@ public abstract class EntityArrow extends Entity implements IProjectile {
@@ -266,7 +266,7 @@ public abstract class EntityArrow extends Entity implements IProjectile {
protected void i() {
++this.despawnCounter;
@ -43,5 +43,5 @@ index e83b50ed4..2b829abac 100644
}
--
2.23.0
2.24.0

Datei anzeigen

@ -1,92 +1,12 @@
From 85561da6e86d037f623b9cf78ca338fe3ba56913 Mon Sep 17 00:00:00 2001
From c9cf346e450300465e7d6491d96007120a892e30 Mon Sep 17 00:00:00 2001
From: Aikar <aikar@aikar.co>
Date: Fri, 18 Mar 2016 20:16:03 -0400
Subject: [PATCH] Add World Util Methods
Methods that can be used for other patches to help improve logic.
diff --git a/src/main/java/net/minecraft/server/Chunk.java b/src/main/java/net/minecraft/server/Chunk.java
index 6c13ae3bae..77d6d5e6eb 100644
--- a/src/main/java/net/minecraft/server/Chunk.java
+++ b/src/main/java/net/minecraft/server/Chunk.java
@@ -371,6 +371,7 @@ public class Chunk implements IChunkAccess {
return this.world.getChunkProvider().getLightEngine();
}
+ public final int getLightSubtracted(BlockPosition blockposition, int i) { return this.a(blockposition, i); } // Paper - OBFHELPER
public int a(BlockPosition blockposition, int i) {
return this.a(blockposition, i, this.world.getWorldProvider().g());
}
diff --git a/src/main/java/net/minecraft/server/World.java b/src/main/java/net/minecraft/server/World.java
index ce723c62e1..ea5905817a 100644
--- a/src/main/java/net/minecraft/server/World.java
+++ b/src/main/java/net/minecraft/server/World.java
@@ -46,7 +46,7 @@ public abstract class World implements IIBlockAccess, GeneratorAccess, AutoClose
protected final java.util.Set<TileEntity> tileEntityListUnload = com.google.common.collect.Sets.newHashSet(); // Paper
private final long b = 16777215L;
final Thread serverThread; // CraftBukkit - package private
- private int u;
+ private int u; public int getSkylightSubtracted() { return this.u; } public void setSkylightSubtracted(int value) { this.u = value;} // Paper - OBFHELPER
protected int i = (new Random()).nextInt();
protected final int j = 1013904223;
protected float lastRainLevel;
@@ -208,6 +208,54 @@ public abstract class World implements IIBlockAccess, GeneratorAccess, AutoClose
return i < 0 || i >= 256;
}
+ // Paper start
+ public boolean isLoadedAndInBounds(BlockPosition blockposition) {
+ return getWorldBorder().isInBounds(blockposition) && getChunkIfLoaded(blockposition.getX() >> 4, blockposition.getZ() >> 4) != null;
+ }
+ public Chunk getChunkIfLoaded(BlockPosition blockposition) {
+ return getChunkIfLoaded(blockposition.getX() >> 4, blockposition.getZ() >> 4);
+ }
+ // test if meets light level, return faster
+ // logic copied from below
+ public boolean isLightLevel(BlockPosition blockposition, int level) {
+ return this.getLightLevel(blockposition) >= level; // TODO
+// if (isValidLocation(blockposition)) {
+// if (this.getType(blockposition).c(this, blockposition)) { // use neighbour brightness (where did this go)
+// int sky = getSkylightSubtracted();
+// if (this.getLightLevel(blockposition.up(), sky) >= level) {
+// return true;
+// }
+// if (this.getLightLevel(blockposition.east(), sky) >= level) {
+// return true;
+// }
+// if (this.getLightLevel(blockposition.west(), sky) >= level) {
+// return true;
+// }
+// if (this.getLightLevel(blockposition.south(), sky) >= level) {
+// return true;
+// }
+// if (this.getLightLevel(blockposition.north(), sky) >= level) {
+// return true;
+// }
+// return false;
+// } else {
+// if (blockposition.getY() >= 256) {
+// blockposition = new BlockPosition(blockposition.getX(), 255, blockposition.getZ());
+// }
+//
+// Chunk chunk = this.getChunkAtWorldCoords(blockposition);
+// return chunk.getLightSubtracted(blockposition, this.getSkylightSubtracted()) >= level;
+// }
+// } else {
+// return true;
+// }
+ }
+ // reduces need to do isLoaded before getType
+ public IBlockData getTypeIfLoadedAndInBounds(BlockPosition blockposition) {
+ return getWorldBorder().isInBounds(blockposition) ? getTypeIfLoaded(blockposition) : null;
+ }
+ // Paper end
+
public Chunk getChunkAtWorldCoords(BlockPosition blockposition) {
return this.getChunkAt(blockposition.getX() >> 4, blockposition.getZ() >> 4);
}
diff --git a/src/main/java/net/minecraft/server/WorldBorder.java b/src/main/java/net/minecraft/server/WorldBorder.java
index 4cf31207e0..1388610a7b 100644
index 020e5c171..4ee13ac45 100644
--- a/src/main/java/net/minecraft/server/WorldBorder.java
+++ b/src/main/java/net/minecraft/server/WorldBorder.java
@@ -19,6 +19,7 @@ public class WorldBorder {
@ -98,5 +18,5 @@ index 4cf31207e0..1388610a7b 100644
return (double) (blockposition.getX() + 1) > this.c() && (double) blockposition.getX() < this.e() && (double) (blockposition.getZ() + 1) > this.d() && (double) blockposition.getZ() < this.f();
}
--
2.22.1
2.24.0

Datei anzeigen

@ -1,49 +1,46 @@
From 86eb3bc68d65c0bb4cd7005648825ece1e7239a8 Mon Sep 17 00:00:00 2001
From b6694f092eb5700091be881e5bf8b231aaf1d2ef Mon Sep 17 00:00:00 2001
From: Jedediah Smith <jedediah@silencegreys.com>
Date: Sun, 21 Jun 2015 15:07:20 -0400
Subject: [PATCH] Custom replacement for eaten items
diff --git a/src/main/java/net/minecraft/server/EntityLiving.java b/src/main/java/net/minecraft/server/EntityLiving.java
index c335a20fa9..adacb1847c 100644
index 6e8adb65c..14097275c 100644
--- a/src/main/java/net/minecraft/server/EntityLiving.java
+++ b/src/main/java/net/minecraft/server/EntityLiving.java
@@ -2818,12 +2818,13 @@ public abstract class EntityLiving extends Entity {
@@ -2894,9 +2894,10 @@ public abstract class EntityLiving extends Entity {
this.b(this.activeItem, 16);
// CraftBukkit start - fire PlayerItemConsumeEvent
ItemStack itemstack;
+ PlayerItemConsumeEvent event = null; // Paper
if (this instanceof EntityPlayer) {
org.bukkit.inventory.ItemStack craftItem = CraftItemStack.asBukkitCopy(this.activeItem);
- PlayerItemConsumeEvent event = new PlayerItemConsumeEvent((Player) this.getBukkitEntity(), craftItem);
+ event = new PlayerItemConsumeEvent((Player) this.getBukkitEntity(), craftItem); // Paper
world.getServer().getPluginManager().callEvent(event);
protected void q() {
if (!this.activeItem.isEmpty() && this.isHandRaised()) {
+ PlayerItemConsumeEvent event = null; // Paper
this.b(this.activeItem, 16);
// CraftBukkit start - fire PlayerItemConsumeEvent
ItemStack itemstack;
if (this instanceof EntityPlayer) {
org.bukkit.inventory.ItemStack craftItem = CraftItemStack.asBukkitCopy(this.activeItem);
- PlayerItemConsumeEvent event = new PlayerItemConsumeEvent((Player) this.getBukkitEntity(), craftItem);
+ event = new PlayerItemConsumeEvent((Player) this.getBukkitEntity(), craftItem); // Paper
world.getServer().getPluginManager().callEvent(event);
if (event.isCancelled()) {
@@ -2911,9 +2912,20 @@ public abstract class EntityLiving extends Entity {
itemstack = this.activeItem.a(this.world, this);
}
if (event.isCancelled()) {
@@ -2838,9 +2839,20 @@ public abstract class EntityLiving extends Entity {
itemstack = this.activeItem.a(this.world, this);
+ // Paper start - save the default replacement item and change it if necessary
+ final ItemStack defaultReplacement = itemstack;
+ if (event != null && event.getReplacement() != null) {
+ itemstack = CraftItemStack.asNMSCopy(event.getReplacement());
+ }
+ // Paper end
this.a(this.getRaisedHand(), itemstack);
// CraftBukkit end
this.dH();
+ // Paper start - if the replacement is anything but the default, update the client inventory
+ if (this instanceof EntityPlayer && !com.google.common.base.Objects.equal(defaultReplacement, itemstack)) {
+ ((EntityPlayer) this).getBukkitEntity().updateInventory();
+ }
+ // Paper end
}
+ // Paper start - save the default replacement item and change it if necessary
+ final ItemStack defaultReplacement = itemstack;
+ if (event != null && event.getReplacement() != null) {
+ itemstack = CraftItemStack.asNMSCopy(event.getReplacement());
+ }
+ // Paper end
this.a(this.getRaisedHand(), itemstack);
// CraftBukkit end
this.dp();
+ // Paper start - if the replacement is anything but the default, update the client inventory
+ if (this instanceof EntityPlayer && !com.google.common.base.Objects.equal(defaultReplacement, itemstack)) {
+ ((EntityPlayer) this).getBukkitEntity().updateInventory();
+ }
+ // Paper end
}
}
--
2.22.0
2.24.0

Datei anzeigen

@ -1,14 +1,14 @@
From a4600ef6c1900a74208033a6768d2f829096b2b8 Mon Sep 17 00:00:00 2001
From c7b19568d688823cc7963f0a73864959f323fe37 Mon Sep 17 00:00:00 2001
From: Aikar <aikar@aikar.co>
Date: Sun, 27 Sep 2015 01:18:02 -0400
Subject: [PATCH] handle NaN health/absorb values and repair bad data
diff --git a/src/main/java/net/minecraft/server/EntityLiving.java b/src/main/java/net/minecraft/server/EntityLiving.java
index adacb1847c..217fd0c2dd 100644
index 14097275c..bdbd89996 100644
--- a/src/main/java/net/minecraft/server/EntityLiving.java
+++ b/src/main/java/net/minecraft/server/EntityLiving.java
@@ -543,7 +543,13 @@ public abstract class EntityLiving extends Entity {
@@ -496,7 +496,13 @@ public abstract class EntityLiving extends Entity {
@Override
public void a(NBTTagCompound nbttagcompound) {
@ -23,7 +23,7 @@ index adacb1847c..217fd0c2dd 100644
if (nbttagcompound.hasKeyOfType("Attributes", 9) && this.world != null && !this.world.isClientSide) {
GenericAttributes.a(this.getAttributeMap(), nbttagcompound.getList("Attributes", 10));
}
@@ -990,6 +996,10 @@ public abstract class EntityLiving extends Entity {
@@ -943,6 +949,10 @@ public abstract class EntityLiving extends Entity {
}
public void setHealth(float f) {
@ -34,7 +34,7 @@ index adacb1847c..217fd0c2dd 100644
// CraftBukkit start - Handle scaled health
if (this instanceof EntityPlayer) {
org.bukkit.craftbukkit.entity.CraftPlayer player = ((EntityPlayer) this).getBukkitEntity();
@@ -2676,7 +2686,7 @@ public abstract class EntityLiving extends Entity {
@@ -2737,7 +2747,7 @@ public abstract class EntityLiving extends Entity {
}
public void setAbsorptionHearts(float f) {
@ -44,10 +44,10 @@ index adacb1847c..217fd0c2dd 100644
}
diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
index b6a93c4f4c..427f392f9a 100644
index d6452504b..493edc743 100644
--- a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
+++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
@@ -1574,6 +1574,7 @@ public class CraftPlayer extends CraftHumanEntity implements Player {
@@ -1558,6 +1558,7 @@ public class CraftPlayer extends CraftHumanEntity implements Player {
}
public void setRealHealth(double health) {
@ -56,5 +56,5 @@ index b6a93c4f4c..427f392f9a 100644
}
--
2.22.0
2.24.0

Datei anzeigen

@ -1,4 +1,4 @@
From 5bb81d3a9a3dcc78fc00d4c1b487d6b827df3578 Mon Sep 17 00:00:00 2001
From be7be89645b52c2a417433dc774971a12b5110c4 Mon Sep 17 00:00:00 2001
From: Aikar <aikar@aikar.co>
Date: Tue, 22 Mar 2016 00:33:47 -0400
Subject: [PATCH] Use a Shared Random for Entities
@ -6,13 +6,13 @@ Subject: [PATCH] Use a Shared Random for Entities
Reduces memory usage and provides ensures more randomness, Especially since a lot of garbage entity objects get created.
diff --git a/src/main/java/net/minecraft/server/Entity.java b/src/main/java/net/minecraft/server/Entity.java
index 39ca7d5870..865dfa2b05 100644
index 2e5426432..167d22574 100644
--- a/src/main/java/net/minecraft/server/Entity.java
+++ b/src/main/java/net/minecraft/server/Entity.java
@@ -54,6 +54,20 @@ public abstract class Entity implements INamableTileEntity, ICommandListener, Ke
@@ -58,6 +58,21 @@ public abstract class Entity implements INamableTileEntity, ICommandListener, Ke
return tag.hasKey("Bukkit.updateLevel") && tag.getInt("Bukkit.updateLevel") >= level;
}
// CraftBukkit start
private static final int CURRENT_LEVEL = 2;
+ // Paper start
+ public static Random SHARED_RANDOM = new Random() {
+ private boolean locked = false;
@ -27,11 +27,12 @@ index 39ca7d5870..865dfa2b05 100644
+ }
+ };
+ // Paper end
static boolean isLevelAtLeast(NBTTagCompound tag, int level) {
return tag.hasKey("Bukkit.updateLevel") && tag.getInt("Bukkit.updateLevel") >= level;
}
@@ -189,7 +203,7 @@ public abstract class Entity implements INamableTileEntity, ICommandListener, Ke
this.B = Vec3D.a;
+
private CraftEntity bukkitEntity;
public CraftEntity getBukkitEntity() {
@@ -193,7 +208,7 @@ public abstract class Entity implements INamableTileEntity, ICommandListener, Ke
this.y = Vec3D.a;
this.av = 1.0F;
this.aw = 1.0F;
- this.random = new Random();
@ -40,5 +41,5 @@ index 39ca7d5870..865dfa2b05 100644
this.justCreated = true;
this.uniqueID = MathHelper.a(this.random);
--
2.22.0
2.24.0

Datei anzeigen

@ -1,11 +1,11 @@
From 74e0b9f473ac53d056cf7bfd6dd00bf3533d3149 Mon Sep 17 00:00:00 2001
From 05b087370709a25f1f66b99d9d10904d5d813b7c Mon Sep 17 00:00:00 2001
From: Zach Brown <zach.brown@destroystokyo.com>
Date: Tue, 22 Mar 2016 12:04:28 -0500
Subject: [PATCH] Configurable spawn chances for skeleton horses
diff --git a/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java b/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java
index b72da38a7..b910b648f 100644
index 64146effd..cc81e1cae 100644
--- a/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java
+++ b/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java
@@ -226,4 +226,12 @@ public class PaperWorldConfig {
@ -22,10 +22,10 @@ index b72da38a7..b910b648f 100644
+ }
}
diff --git a/src/main/java/net/minecraft/server/WorldServer.java b/src/main/java/net/minecraft/server/WorldServer.java
index 9928e5aab..d3039c2fd 100644
index fe20687b2..8307379e9 100644
--- a/src/main/java/net/minecraft/server/WorldServer.java
+++ b/src/main/java/net/minecraft/server/WorldServer.java
@@ -428,7 +428,7 @@ public class WorldServer extends World {
@@ -450,7 +450,7 @@ public class WorldServer extends World {
blockposition = this.a(this.a(j, 0, k, 15));
if (this.isRainingAt(blockposition)) {
DifficultyDamageScaler difficultydamagescaler = this.getDamageScaler(blockposition);
@ -35,5 +35,5 @@ index 9928e5aab..d3039c2fd 100644
if (flag1) {
EntityHorseSkeleton entityhorseskeleton = (EntityHorseSkeleton) EntityTypes.SKELETON_HORSE.a((World) this);
--
2.23.0
2.24.0

Datei anzeigen

@ -1,4 +1,4 @@
From de45b3395d8c937c9c5a38717db7edda3f800c6a Mon Sep 17 00:00:00 2001
From 568ef66bc6542fa409549a32853318be49f874da Mon Sep 17 00:00:00 2001
From: Aikar <aikar@aikar.co>
Date: Thu, 3 Mar 2016 02:07:55 -0600
Subject: [PATCH] Optimize isValidLocation, getType and getBlockData for inling
@ -12,12 +12,12 @@ Replace all calls to the new place to the unnecessary forward.
Optimize getType and getBlockData to manually inline and optimize the calls
diff --git a/src/main/java/net/minecraft/server/BaseBlockPosition.java b/src/main/java/net/minecraft/server/BaseBlockPosition.java
index 2852a17f23..7cb46d7a9c 100644
index a3b5793e4..71089442c 100644
--- a/src/main/java/net/minecraft/server/BaseBlockPosition.java
+++ b/src/main/java/net/minecraft/server/BaseBlockPosition.java
@@ -10,6 +10,14 @@ public class BaseBlockPosition implements Comparable<BaseBlockPosition> {
private final int a;
@@ -13,6 +13,14 @@ public class BaseBlockPosition implements Comparable<BaseBlockPosition> {
private final int b;
@Deprecated
private final int c;
+ // Paper start
+ public boolean isValidLocation() {
@ -30,29 +30,8 @@ index 2852a17f23..7cb46d7a9c 100644
public BaseBlockPosition(int i, int j, int k) {
this.a = i;
diff --git a/src/main/java/net/minecraft/server/BlockPosition.java b/src/main/java/net/minecraft/server/BlockPosition.java
index 2613de6624..2eabaaeba2 100644
--- a/src/main/java/net/minecraft/server/BlockPosition.java
+++ b/src/main/java/net/minecraft/server/BlockPosition.java
@@ -339,6 +339,16 @@ public class BlockPosition extends BaseBlockPosition implements MinecraftSeriali
protected int b;
protected int c;
protected int d;
+ // Paper start
+ @Override
+ public boolean isValidLocation() {
+ return b >= -30000000 && d >= -30000000 && b < 30000000 && d < 30000000 && c >= 0 && c < 256;
+ }
+ @Override
+ public boolean isInvalidYLocation() {
+ return c < 0 || c >= 256;
+ }
+ // Paper end
public MutableBlockPosition() {
this(0, 0, 0);
diff --git a/src/main/java/net/minecraft/server/Chunk.java b/src/main/java/net/minecraft/server/Chunk.java
index 4aaf20dfcb..591c823b39 100644
index be32b31e7..fd9ba8232 100644
--- a/src/main/java/net/minecraft/server/Chunk.java
+++ b/src/main/java/net/minecraft/server/Chunk.java
@@ -203,12 +203,24 @@ public class Chunk implements IChunkAccess {
@ -85,7 +64,7 @@ index 4aaf20dfcb..591c823b39 100644
IBlockData iblockdata = null;
diff --git a/src/main/java/net/minecraft/server/ChunkSection.java b/src/main/java/net/minecraft/server/ChunkSection.java
index f4605e3937..c4c181c1d5 100644
index 652067757..0d5deee36 100644
--- a/src/main/java/net/minecraft/server/ChunkSection.java
+++ b/src/main/java/net/minecraft/server/ChunkSection.java
@@ -9,7 +9,7 @@ public class ChunkSection {
@ -93,28 +72,28 @@ index f4605e3937..c4c181c1d5 100644
private short tickingBlockCount;
private short e;
- private final DataPaletteBlock<IBlockData> blockIds;
+ final DataPaletteBlock<IBlockData> blockIds; // Paper - package
+ final DataPaletteBlock<IBlockData> blockIds;
public ChunkSection(int i) {
this(i, (short) 0, (short) 0, (short) 0);
diff --git a/src/main/java/net/minecraft/server/World.java b/src/main/java/net/minecraft/server/World.java
index 769d59271a..822db5d4c0 100644
index 4feb3e9d8..182376a0a 100644
--- a/src/main/java/net/minecraft/server/World.java
+++ b/src/main/java/net/minecraft/server/World.java
@@ -197,11 +197,11 @@ public abstract class World implements IIBlockAccess, GeneratorAccess, AutoClose
@@ -183,11 +183,11 @@ public abstract class World implements GeneratorAccess, AutoCloseable {
}
public static boolean isValidLocation(BlockPosition blockposition) {
- return !isOutsideWorld(blockposition) && blockposition.getX() >= -30000000 && blockposition.getZ() >= -30000000 && blockposition.getX() < 30000000 && blockposition.getZ() < 30000000;
+ return blockposition.isValidLocation(); // Paper
+ return blockposition.isValidLocation();
}
public static boolean isOutsideWorld(BlockPosition blockposition) {
- return b(blockposition.getY());
+ return blockposition.isInvalidYLocation(); // Paper
+ return blockposition.isInvalidYLocation();
}
public static boolean b(int i) {
--
2.22.0
2.24.0

Datei anzeigen

@ -1,4 +1,4 @@
From 289faea6ee2eb1b54b4a74ce988dec9321ac9111 Mon Sep 17 00:00:00 2001
From fa37dd8d51f347ec51960d3f30ec4dedea351dcf Mon Sep 17 00:00:00 2001
From: Aikar <aikar@aikar.co>
Date: Mon, 28 Mar 2016 19:55:45 -0400
Subject: [PATCH] Only process BlockPhysicsEvent if a plugin has a listener
@ -6,7 +6,7 @@ Subject: [PATCH] Only process BlockPhysicsEvent if a plugin has a listener
Saves on some object allocation and processing when no plugin listens to this
diff --git a/src/main/java/net/minecraft/server/BlockPlant.java b/src/main/java/net/minecraft/server/BlockPlant.java
index 9bf42bb5e..0526af776 100644
index ed1da4f4b..a6891b9fa 100644
--- a/src/main/java/net/minecraft/server/BlockPlant.java
+++ b/src/main/java/net/minecraft/server/BlockPlant.java
@@ -16,7 +16,7 @@ public class BlockPlant extends Block {
@ -19,7 +19,7 @@ index 9bf42bb5e..0526af776 100644
}
}
diff --git a/src/main/java/net/minecraft/server/BlockTallPlant.java b/src/main/java/net/minecraft/server/BlockTallPlant.java
index ef392f5fe..227fe073f 100644
index 42e86881b..6cdce1158 100644
--- a/src/main/java/net/minecraft/server/BlockTallPlant.java
+++ b/src/main/java/net/minecraft/server/BlockTallPlant.java
@@ -55,7 +55,7 @@ public class BlockTallPlant extends BlockPlant {
@ -32,10 +32,10 @@ index ef392f5fe..227fe073f 100644
}
// CraftBukkit end
diff --git a/src/main/java/net/minecraft/server/MinecraftServer.java b/src/main/java/net/minecraft/server/MinecraftServer.java
index f56edde78..34be67417 100644
index 81d3a5262..25774fb73 100644
--- a/src/main/java/net/minecraft/server/MinecraftServer.java
+++ b/src/main/java/net/minecraft/server/MinecraftServer.java
@@ -1128,6 +1128,7 @@ public abstract class MinecraftServer extends IAsyncTaskHandlerReentrant<TickTas
@@ -1136,6 +1136,7 @@ public abstract class MinecraftServer extends IAsyncTaskHandlerReentrant<TickTas
while (iterator.hasNext()) {
WorldServer worldserver = (WorldServer) iterator.next();
@ -44,10 +44,10 @@ index f56edde78..34be67417 100644
this.methodProfiler.a(() -> {
return worldserver.getWorldData().getName() + " " + IRegistry.DIMENSION_TYPE.getKey(worldserver.worldProvider.getDimensionManager());
diff --git a/src/main/java/net/minecraft/server/World.java b/src/main/java/net/minecraft/server/World.java
index c40777ecb..cb5515dc3 100644
index 182376a0a..ead8d84be 100644
--- a/src/main/java/net/minecraft/server/World.java
+++ b/src/main/java/net/minecraft/server/World.java
@@ -440,7 +440,7 @@ public abstract class World implements IIBlockAccess, GeneratorAccess, AutoClose
@@ -378,7 +378,7 @@ public abstract class World implements GeneratorAccess, AutoCloseable {
// CraftBukkit start
iblockdata1.b(this, blockposition, j); // Don't call an event for the old block to limit event spam
CraftWorld world = ((WorldServer) this).getWorld();
@ -56,7 +56,7 @@ index c40777ecb..cb5515dc3 100644
BlockPhysicsEvent event = new BlockPhysicsEvent(world.getBlockAt(blockposition.getX(), blockposition.getY(), blockposition.getZ()), CraftBlockData.fromData(iblockdata));
this.getServer().getPluginManager().callEvent(event);
@@ -552,7 +552,7 @@ public abstract class World implements IIBlockAccess, GeneratorAccess, AutoClose
@@ -490,7 +490,7 @@ public abstract class World implements GeneratorAccess, AutoCloseable {
try {
// CraftBukkit start
CraftWorld world = ((WorldServer) this).getWorld();
@ -66,10 +66,10 @@ index c40777ecb..cb5515dc3 100644
this.getServer().getPluginManager().callEvent(event);
diff --git a/src/main/java/net/minecraft/server/WorldServer.java b/src/main/java/net/minecraft/server/WorldServer.java
index df3a9340a..559dee777 100644
index 8307379e9..30c9cfa12 100644
--- a/src/main/java/net/minecraft/server/WorldServer.java
+++ b/src/main/java/net/minecraft/server/WorldServer.java
@@ -72,6 +72,7 @@ public class WorldServer extends World {
@@ -74,6 +74,7 @@ public class WorldServer extends World {
// CraftBukkit start
private int tickPosition;
@ -78,5 +78,5 @@ index df3a9340a..559dee777 100644
// Add env and gen to constructor
public WorldServer(MinecraftServer minecraftserver, Executor executor, WorldNBTStorage worldnbtstorage, WorldData worlddata, DimensionManager dimensionmanager, GameProfilerFiller gameprofilerfiller, WorldLoadListener worldloadlistener, org.bukkit.World.Environment env, org.bukkit.generator.ChunkGenerator gen) {
--
2.23.0
2.24.0

Datei anzeigen

@ -1,23 +1,23 @@
From 2db5f37a634e2d54cf102d794fa1628bcf79f4a3 Mon Sep 17 00:00:00 2001
From 0fa1b2946203fcb041f0a3bbd4f2483519b5b962 Mon Sep 17 00:00:00 2001
From: Aikar <aikar@aikar.co>
Date: Mon, 28 Mar 2016 20:32:58 -0400
Subject: [PATCH] Entity AddTo/RemoveFrom World Events
diff --git a/src/main/java/net/minecraft/server/WorldServer.java b/src/main/java/net/minecraft/server/WorldServer.java
index dfb8a70a2c..835428e839 100644
index 30c9cfa12..64b80441f 100644
--- a/src/main/java/net/minecraft/server/WorldServer.java
+++ b/src/main/java/net/minecraft/server/WorldServer.java
@@ -1124,7 +1124,7 @@ public class WorldServer extends World {
@@ -1132,7 +1132,7 @@ public class WorldServer extends World {
if (entity instanceof EntityInsentient) {
this.H.remove(((EntityInsentient) entity).getNavigation());
this.navigators.remove(((EntityInsentient) entity).getNavigation());
}
-
+ new com.destroystokyo.paper.event.entity.EntityRemoveFromWorldEvent(entity.getBukkitEntity()).callEvent(); // Paper - fire while valid
entity.valid = false; // CraftBukkit
}
@@ -1162,6 +1162,7 @@ public class WorldServer extends World {
@@ -1170,6 +1170,7 @@ public class WorldServer extends World {
entity.origin = entity.getBukkitEntity().getLocation();
}
// Paper end
@ -26,5 +26,5 @@ index dfb8a70a2c..835428e839 100644
}
--
2.22.1
2.24.0

Datei anzeigen

@ -1,4 +1,4 @@
From 1717a3b6afb19fd2580234c2c1d5f0645740e96b Mon Sep 17 00:00:00 2001
From f5af27d1bef6ea5746e3b9da9c7f0a45272311ce Mon Sep 17 00:00:00 2001
From: Aikar <aikar@aikar.co>
Date: Mon, 28 Mar 2016 20:46:14 -0400
Subject: [PATCH] Configurable Chunk Inhabited Time
@ -11,7 +11,7 @@ For people who want all chunks to be treated equally, you can chose a fixed valu
This allows to fine-tune vanilla gameplay.
diff --git a/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java b/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java
index b910b648f..4afd7553d 100644
index cc81e1cae..edb5248f3 100644
--- a/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java
+++ b/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java
@@ -234,4 +234,14 @@ public class PaperWorldConfig {
@ -30,18 +30,18 @@ index b910b648f..4afd7553d 100644
+ }
}
diff --git a/src/main/java/net/minecraft/server/Chunk.java b/src/main/java/net/minecraft/server/Chunk.java
index 2dbfca3f0..85e17253d 100644
index fd9ba8232..034e8684d 100644
--- a/src/main/java/net/minecraft/server/Chunk.java
+++ b/src/main/java/net/minecraft/server/Chunk.java
@@ -839,7 +839,7 @@ public class Chunk implements IChunkAccess {
@@ -832,7 +832,7 @@ public class Chunk implements IChunkAccess {
@Override
public long q() {
- return this.t;
+ return world.paperConfig.fixedInhabitedTime < 0 ? this.t : world.paperConfig.fixedInhabitedTime; // Paper
public long getInhabitedTime() {
- return this.inhabitedTime;
+ return world.paperConfig.fixedInhabitedTime < 0 ? this.inhabitedTime : world.paperConfig.fixedInhabitedTime; // Paper
}
@Override
--
2.23.0
2.24.0

Datei anzeigen

@ -1,4 +1,4 @@
From 774c6237e4c391735a13a083af901713e91a82ea Mon Sep 17 00:00:00 2001
From 7c9c24d434a54e51e94f3c7160268291af77f2bf Mon Sep 17 00:00:00 2001
From: Aikar <aikar@aikar.co>
Date: Mon, 28 Mar 2016 21:22:26 -0400
Subject: [PATCH] EntityPathfindEvent
@ -6,7 +6,7 @@ Subject: [PATCH] EntityPathfindEvent
Fires when an Entity decides to start moving to a location.
diff --git a/src/main/java/net/minecraft/server/Navigation.java b/src/main/java/net/minecraft/server/Navigation.java
index 9ca0e2c9d0..fd1dbb1085 100644
index 3fdeda0ce..abf450917 100644
--- a/src/main/java/net/minecraft/server/Navigation.java
+++ b/src/main/java/net/minecraft/server/Navigation.java
@@ -60,7 +60,7 @@ public class Navigation extends NavigationAbstract {
@ -19,7 +19,7 @@ index 9ca0e2c9d0..fd1dbb1085 100644
private int t() {
diff --git a/src/main/java/net/minecraft/server/NavigationAbstract.java b/src/main/java/net/minecraft/server/NavigationAbstract.java
index 4e49133b03..4d04ba8fc6 100644
index a600ee765..5e7158ba1 100644
--- a/src/main/java/net/minecraft/server/NavigationAbstract.java
+++ b/src/main/java/net/minecraft/server/NavigationAbstract.java
@@ -8,7 +8,7 @@ import javax.annotation.Nullable;
@ -31,7 +31,7 @@ index 4e49133b03..4d04ba8fc6 100644
protected final World b;
@Nullable
protected PathEntity c;
@@ -83,16 +83,26 @@ public abstract class NavigationAbstract {
@@ -91,16 +91,26 @@ public abstract class NavigationAbstract {
@Nullable
public PathEntity a(BlockPosition blockposition, int i) {
@ -59,8 +59,8 @@ index 4e49133b03..4d04ba8fc6 100644
+ // Paper end
if (set.isEmpty()) {
return null;
} else if (this.a.locY < 0.0D) {
@@ -102,6 +112,23 @@ public abstract class NavigationAbstract {
} else if (this.a.locY() < 0.0D) {
@@ -110,6 +120,23 @@ public abstract class NavigationAbstract {
} else if (this.c != null && !this.c.b() && set.contains(this.q)) {
return this.c;
} else {
@ -82,10 +82,10 @@ index 4e49133b03..4d04ba8fc6 100644
+ }
+ // Paper end
this.b.getMethodProfiler().enter("pathfind");
float f = this.i();
float f = (float) this.p.getValue();
BlockPosition blockposition = flag ? (new BlockPosition(this.a)).up() : new BlockPosition(this.a);
diff --git a/src/main/java/net/minecraft/server/NavigationFlying.java b/src/main/java/net/minecraft/server/NavigationFlying.java
index f5844a7260..fbf5752aa5 100644
index 5b057e96d..f16c6d1fa 100644
--- a/src/main/java/net/minecraft/server/NavigationFlying.java
+++ b/src/main/java/net/minecraft/server/NavigationFlying.java
@@ -25,7 +25,7 @@ public class NavigationFlying extends NavigationAbstract {
@ -98,5 +98,5 @@ index f5844a7260..fbf5752aa5 100644
@Override
--
2.22.0
2.24.0

Datei anzeigen

@ -1,4 +1,4 @@
From 2b336ee13e884d9e79c97336dc94df744ba71abe Mon Sep 17 00:00:00 2001
From 2c63f48776cf7970637588a35f6f5cb92accab89 Mon Sep 17 00:00:00 2001
From: Antony Riley <antony@cyberiantiger.org>
Date: Tue, 29 Mar 2016 08:22:55 +0300
Subject: [PATCH] Sanitise RegionFileCache and make configurable.
@ -11,7 +11,7 @@ The implementation uses a LinkedHashMap as an LRU cache (modified from HashMap).
The maximum size of the RegionFileCache is also made configurable.
diff --git a/src/main/java/com/destroystokyo/paper/PaperConfig.java b/src/main/java/com/destroystokyo/paper/PaperConfig.java
index 6cc99ffe43..0cef1853f5 100644
index 6ef5bb9f3..d500cd75a 100644
--- a/src/main/java/com/destroystokyo/paper/PaperConfig.java
+++ b/src/main/java/com/destroystokyo/paper/PaperConfig.java
@@ -218,4 +218,9 @@ public class PaperConfig {
@ -25,26 +25,18 @@ index 6cc99ffe43..0cef1853f5 100644
+ }
}
diff --git a/src/main/java/net/minecraft/server/RegionFileCache.java b/src/main/java/net/minecraft/server/RegionFileCache.java
index 1ea9e5bb43..21b3b06f53 100644
index 2fe27b460..57ce53cfd 100644
--- a/src/main/java/net/minecraft/server/RegionFileCache.java
+++ b/src/main/java/net/minecraft/server/RegionFileCache.java
@@ -8,6 +8,7 @@ import java.io.DataOutputStream;
import java.io.File;
import java.io.IOException;
import javax.annotation.Nullable;
+import com.destroystokyo.paper.PaperConfig; // Paper
public abstract class RegionFileCache implements AutoCloseable {
@@ -25,7 +26,7 @@ public abstract class RegionFileCache implements AutoCloseable {
@@ -25,7 +25,7 @@ public final class RegionFileCache implements AutoCloseable {
if (regionfile != null) {
return regionfile;
} else {
- if (this.cache.size() >= 256) {
+ if (this.cache.size() >= PaperConfig.regionFileCacheSize) { // Paper - configurable
+ if (this.cache.size() >= com.destroystokyo.paper.PaperConfig.regionFileCacheSize) { // Paper - configurable
((RegionFile) this.cache.removeLast()).close();
}
--
2.22.0
2.24.0

Datei anzeigen

@ -1,87 +1,80 @@
From 5ff0a28a206a6167b2cc2ed85be0bdbc41633c19 Mon Sep 17 00:00:00 2001
From 82722e2f0678bfcb418043e9d8d3465aaa9697c2 Mon Sep 17 00:00:00 2001
From: Aikar <aikar@aikar.co>
Date: Thu, 31 Mar 2016 19:17:58 -0400
Subject: [PATCH] Do not load chunks for Pathfinding
diff --git a/src/main/java/net/minecraft/server/ChunkCache.java b/src/main/java/net/minecraft/server/ChunkCache.java
index 869e8548c6..beb50d2068 100644
index 818872944..1065c0dec 100644
--- a/src/main/java/net/minecraft/server/ChunkCache.java
+++ b/src/main/java/net/minecraft/server/ChunkCache.java
@@ -25,7 +25,7 @@ public class ChunkCache implements IWorldReader {
@@ -27,7 +27,7 @@ public class ChunkCache implements IBlockAccess, ICollisionAccess {
for (k = this.a; k <= i; ++k) {
for (l = this.b; l <= j; ++l) {
- this.c[k - this.a][l - this.b] = world.getChunkAt(k, l, ChunkStatus.FULL, false);
- this.c[k - this.a][l - this.b] = ichunkprovider.a(k, l);
+ this.c[k - this.a][l - this.b] = world.getChunkIfLoadedImmediately(k, l); // Paper
}
}
@@ -91,7 +91,7 @@ public class ChunkCache implements IWorldReader {
int k = i - this.a;
int l = j - this.b;
- return k >= 0 && k < this.c.length && l >= 0 && l < this.c[k].length;
+ return k >= 0 && k < this.c.length && l >= 0 && l < this.c[k].length && this.c[k][l] != null; // Paper - We don't always load chunks
}
@Override
diff --git a/src/main/java/net/minecraft/server/NavigationAbstract.java b/src/main/java/net/minecraft/server/NavigationAbstract.java
index 4d04ba8fc6..126c05adc7 100644
index 5e7158ba1..39a0c45bb 100644
--- a/src/main/java/net/minecraft/server/NavigationAbstract.java
+++ b/src/main/java/net/minecraft/server/NavigationAbstract.java
@@ -27,7 +27,7 @@ public abstract class NavigationAbstract {
protected PathfinderAbstract o;
@@ -28,7 +28,7 @@ public abstract class NavigationAbstract {
private BlockPosition q;
private int r;
- private Pathfinder s;
+ private Pathfinder s; public Pathfinder getPathfinder() { return this.s; } // Paper - OBFHELPER
private float s;
- private final Pathfinder t;
+ private final Pathfinder t; public Pathfinder getPathfinder() { return this.t; } // Paper - OBFHELPER
public NavigationAbstract(EntityInsentient entityinsentient, World world) {
this.g = Vec3D.a;
diff --git a/src/main/java/net/minecraft/server/Pathfinder.java b/src/main/java/net/minecraft/server/Pathfinder.java
index 30b4569a39..0cec80ec7d 100644
index 619957061..67c63cfe3 100644
--- a/src/main/java/net/minecraft/server/Pathfinder.java
+++ b/src/main/java/net/minecraft/server/Pathfinder.java
@@ -19,7 +19,7 @@ public class Pathfinder {
private final Set<PathPoint> b = Sets.newHashSet();
private final PathPoint[] c = new PathPoint[32];
private final int d;
- private PathfinderAbstract e;
+ private PathfinderAbstract e; public PathfinderAbstract getPathfinder() { return this.e; } // Paper - OBFHELPER
- private final PathfinderAbstract e;
+ private final PathfinderAbstract e; public PathfinderAbstract getPathfinder() { return this.e; } // Paper - OBFHELPER
public Pathfinder(PathfinderAbstract pathfinderabstract, int i) {
this.e = pathfinderabstract;
diff --git a/src/main/java/net/minecraft/server/PathfinderNormal.java b/src/main/java/net/minecraft/server/PathfinderNormal.java
index 617c29a58a..45fd135034 100644
index ef248ebcc..4240ca81c 100644
--- a/src/main/java/net/minecraft/server/PathfinderNormal.java
+++ b/src/main/java/net/minecraft/server/PathfinderNormal.java
@@ -355,7 +355,8 @@ public class PathfinderNormal extends PathfinderAbstract {
PathType pathtype = this.b(iblockaccess, i, j, k);
@@ -365,7 +365,8 @@ public class PathfinderNormal extends PathfinderAbstract {
PathType pathtype = c(iblockaccess, i, j, k);
if (pathtype == PathType.OPEN && j >= 1) {
- Block block = iblockaccess.getType(new BlockPosition(i, j - 1, k)).getBlock();
+ Block block = iblockaccess.getBlockIfLoaded(new BlockPosition(i, j - 1, k)); // Paper
+ if (block == null) return PathType.BLOCKED; // Paper
PathType pathtype1 = this.b(iblockaccess, i, j - 1, k);
PathType pathtype1 = c(iblockaccess, i, j - 1, k);
pathtype = pathtype1 != PathType.WALKABLE && pathtype1 != PathType.OPEN && pathtype1 != PathType.WATER && pathtype1 != PathType.LAVA ? PathType.WALKABLE : PathType.OPEN;
@@ -385,9 +386,10 @@ public class PathfinderNormal extends PathfinderAbstract {
for (int l = -1; l <= 1; ++l) {
for (int i1 = -1; i1 <= 1; ++i1) {
if (l != 0 || i1 != 0) {
- Block block = iblockaccess.getType(blockposition_pooledblockposition.d(l + i, j, i1 + k)).getBlock();
+ Block block = iblockaccess.getBlockIfLoaded(blockposition_pooledblockposition.d(l + i, j, i1 + k)); // Paper
- if (block == Blocks.CACTUS) {
+ if (block == null) pathtype = PathType.BLOCKED; // Paper
+ else if (block == Blocks.CACTUS) { // Paper
@@ -402,8 +403,12 @@ public class PathfinderNormal extends PathfinderAbstract {
for (int i1 = -1; i1 <= 1; ++i1) {
for (int j1 = -1; j1 <= 1; ++j1) {
if (l != 0 || j1 != 0) {
- Block block = iblockaccess.getType(blockposition_pooledblockposition.d(l + i, i1 + j, j1 + k)).getBlock();
-
+ // Paper start
+ Block block = iblockaccess.getBlockIfLoaded(blockposition_pooledblockposition.d(l + i, i1 + j, j1 + k));
+ if (block == null) {
+ pathtype = PathType.BLOCKED;
+ } else
+ // Paper end
if (block == Blocks.CACTUS) {
pathtype = PathType.DANGER_CACTUS;
} else if (block == Blocks.FIRE) {
pathtype = PathType.DANGER_FIRE;
@@ -421,7 +423,8 @@ public class PathfinderNormal extends PathfinderAbstract {
} else if (block != Blocks.FIRE && block != Blocks.LAVA) {
@@ -440,7 +445,8 @@ public class PathfinderNormal extends PathfinderAbstract {
protected PathType b(IBlockAccess iblockaccess, int i, int j, int k) {
protected static PathType c(IBlockAccess iblockaccess, int i, int j, int k) {
BlockPosition blockposition = new BlockPosition(i, j, k);
- IBlockData iblockdata = iblockaccess.getType(blockposition);
+ IBlockData iblockdata = iblockaccess.getTypeIfLoaded(blockposition); // Paper
@ -90,5 +83,5 @@ index 617c29a58a..45fd135034 100644
Material material = iblockdata.getMaterial();
--
2.22.0
2.24.0

Datei anzeigen

@ -1,11 +1,11 @@
From 3a52ecf1b027228b2c9325519362f95f31c7ed8a Mon Sep 17 00:00:00 2001
From 542cb79f92d27d6c006cca7f6b2c7a5c9fec0bee Mon Sep 17 00:00:00 2001
From: Jedediah Smith <jedediah@silencegreys.com>
Date: Sat, 2 Apr 2016 05:09:16 -0400
Subject: [PATCH] Add PlayerUseUnknownEntityEvent
diff --git a/src/main/java/net/minecraft/server/PacketPlayInUseEntity.java b/src/main/java/net/minecraft/server/PacketPlayInUseEntity.java
index 680adbdeb0..3f7697b39c 100644
index 680adbdeb..3f7697b39 100644
--- a/src/main/java/net/minecraft/server/PacketPlayInUseEntity.java
+++ b/src/main/java/net/minecraft/server/PacketPlayInUseEntity.java
@@ -5,7 +5,7 @@ import javax.annotation.Nullable;
@ -18,10 +18,10 @@ index 680adbdeb0..3f7697b39c 100644
private Vec3D c;
private EnumHand d;
diff --git a/src/main/java/net/minecraft/server/PlayerConnection.java b/src/main/java/net/minecraft/server/PlayerConnection.java
index 7906b67570..32c6e2eca4 100644
index d90c6a732..f91144693 100644
--- a/src/main/java/net/minecraft/server/PlayerConnection.java
+++ b/src/main/java/net/minecraft/server/PlayerConnection.java
@@ -1897,6 +1897,16 @@ public class PlayerConnection implements PacketListenerPlayIn {
@@ -1911,6 +1911,16 @@ public class PlayerConnection implements PacketListenerPlayIn {
}
}
}
@ -39,5 +39,5 @@ index 7906b67570..32c6e2eca4 100644
}
--
2.22.0
2.24.0

Datei anzeigen

@ -1,14 +1,14 @@
From e15d195695a11539d6e7f28301510015c02cb00c Mon Sep 17 00:00:00 2001
From 76c0ebf307133b782fff3fdf6be3b80a39b257af Mon Sep 17 00:00:00 2001
From: Jedediah Smith <jedediah@silencegreys.com>
Date: Sat, 2 Apr 2016 20:37:03 -0400
Subject: [PATCH] Fix reducedDebugInfo not initialized on client
diff --git a/src/main/java/net/minecraft/server/PlayerList.java b/src/main/java/net/minecraft/server/PlayerList.java
index 35bda2e1d..cce5305fb 100644
index 948a6e3b7..05ea0ace5 100644
--- a/src/main/java/net/minecraft/server/PlayerList.java
+++ b/src/main/java/net/minecraft/server/PlayerList.java
@@ -162,6 +162,7 @@ public abstract class PlayerList {
@@ -163,6 +163,7 @@ public abstract class PlayerList {
playerconnection.sendPacket(new PacketPlayOutHeldItemSlot(entityplayer.inventory.itemInHandIndex));
playerconnection.sendPacket(new PacketPlayOutRecipeUpdate(this.server.getCraftingManager().b()));
playerconnection.sendPacket(new PacketPlayOutTags(this.server.getTagRegistry()));
@ -17,5 +17,5 @@ index 35bda2e1d..cce5305fb 100644
entityplayer.getStatisticManager().c();
entityplayer.B().a(entityplayer);
--
2.22.0
2.24.0

Datei anzeigen

@ -1,11 +1,11 @@
From b9d7b4651e3d7de16245a87466372c48aad93637 Mon Sep 17 00:00:00 2001
From 073c5e88483ced82b8c5e8960e9bd9ce7b8be9a2 Mon Sep 17 00:00:00 2001
From: Aikar <aikar@aikar.co>
Date: Sun, 3 Apr 2016 16:28:17 -0400
Subject: [PATCH] Configurable Grass Spread Tick Rate
diff --git a/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java b/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java
index 4afd7553d..88a4f8882 100644
index edb5248f3..862cbfbd5 100644
--- a/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java
+++ b/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java
@@ -244,4 +244,10 @@ public class PaperWorldConfig {
@ -20,17 +20,17 @@ index 4afd7553d..88a4f8882 100644
+ }
}
diff --git a/src/main/java/net/minecraft/server/BlockDirtSnowSpreadable.java b/src/main/java/net/minecraft/server/BlockDirtSnowSpreadable.java
index c4c9a353a..cb90b74ca 100644
index 9b25fc2f9..2b19b6754 100644
--- a/src/main/java/net/minecraft/server/BlockDirtSnowSpreadable.java
+++ b/src/main/java/net/minecraft/server/BlockDirtSnowSpreadable.java
@@ -29,6 +29,7 @@ public abstract class BlockDirtSnowSpreadable extends BlockDirtSnow {
@Override
public void tick(IBlockData iblockdata, World world, BlockPosition blockposition, Random random) {
+ if (this instanceof BlockGrass && world.paperConfig.grassUpdateRate != 1 && (world.paperConfig.grassUpdateRate < 1 || (MinecraftServer.currentTick + blockposition.hashCode()) % world.paperConfig.grassUpdateRate != 0)) { return; } // Paper
if (!world.isClientSide) {
if (!b(iblockdata, (IWorldReader) world, blockposition)) {
// CraftBukkit start
public void tick(IBlockData iblockdata, WorldServer worldserver, BlockPosition blockposition, Random random) {
+ if (this instanceof BlockGrass && worldserver.paperConfig.grassUpdateRate != 1 && (worldserver.paperConfig.grassUpdateRate < 1 || (MinecraftServer.currentTick + blockposition.hashCode()) % worldserver.paperConfig.grassUpdateRate != 0)) { return; } // Paper
if (!b(iblockdata, (IWorldReader) worldserver, blockposition)) {
// CraftBukkit start
if (org.bukkit.craftbukkit.event.CraftEventFactory.callBlockFadeEvent(worldserver, blockposition, Blocks.DIRT.getBlockData()).isCancelled()) {
--
2.23.0
2.24.0

Datei anzeigen

@ -1,14 +1,14 @@
From 5bd701a50d3bfb1c5e3ee0d9e4943cf228713b68 Mon Sep 17 00:00:00 2001
From ec2f595808f9c9cbe442786652708d5b305f757f Mon Sep 17 00:00:00 2001
From: Aikar <aikar@aikar.co>
Date: Sun, 3 Apr 2016 17:48:50 -0400
Subject: [PATCH] Fix Cancelling BlockPlaceEvent triggering physics
diff --git a/src/main/java/net/minecraft/server/World.java b/src/main/java/net/minecraft/server/World.java
index a0e3974a54..07d1505867 100644
index c4d5907b5..57633955c 100644
--- a/src/main/java/net/minecraft/server/World.java
+++ b/src/main/java/net/minecraft/server/World.java
@@ -510,6 +510,7 @@ public abstract class World implements IIBlockAccess, GeneratorAccess, AutoClose
@@ -448,6 +448,7 @@ public abstract class World implements GeneratorAccess, AutoCloseable {
public void b(BlockPosition blockposition, IBlockData iblockdata, IBlockData iblockdata1) {}
public void applyPhysics(BlockPosition blockposition, Block block) {
@ -17,5 +17,5 @@ index a0e3974a54..07d1505867 100644
this.a(blockposition.east(), block, blockposition);
this.a(blockposition.down(), block, blockposition);
--
2.22.0
2.24.0

Datei anzeigen

@ -1,4 +1,4 @@
From 0bb92ac5ff3a6a438066972a9983b450375cbe92 Mon Sep 17 00:00:00 2001
From ab6f206ddbb3e74fb23a95cedb6c0acdc74f5d54 Mon Sep 17 00:00:00 2001
From: Aikar <aikar@aikar.co>
Date: Tue, 5 Apr 2016 21:38:58 -0400
Subject: [PATCH] Remove Debug checks from DataBits
@ -9,7 +9,7 @@ Before: http://i.imgur.com/nQsMzAE.png
After: http://i.imgur.com/nJ46crB.png
diff --git a/src/main/java/net/minecraft/server/DataBits.java b/src/main/java/net/minecraft/server/DataBits.java
index 08d1be3117..a75b08ee33 100644
index 2edd9b871..f9680b683 100644
--- a/src/main/java/net/minecraft/server/DataBits.java
+++ b/src/main/java/net/minecraft/server/DataBits.java
@@ -15,7 +15,7 @@ public class DataBits {
@ -53,5 +53,5 @@ index 08d1be3117..a75b08ee33 100644
int k = j >> 6;
int l = (i + 1) * this.b - 1 >> 6;
--
2.22.0
2.24.0

Datei anzeigen

@ -1,4 +1,4 @@
From 55a08558c4e2718bbf77f9ac687d962296d2dabc Mon Sep 17 00:00:00 2001
From 8fb2556bfd8e89f9438e8996f8136cd139670788 Mon Sep 17 00:00:00 2001
From: Zach Brown <zach.brown@destroystokyo.com>
Date: Wed, 6 Apr 2016 01:04:23 -0500
Subject: [PATCH] Option to use vanilla per-world scoreboard coloring on names
@ -12,7 +12,7 @@ for this on CB at one point but I can't find it. We may need to do this
ourselves at some point in the future.
diff --git a/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java b/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java
index 88a4f8882..da2746754 100644
index 862cbfbd5..b1682894f 100644
--- a/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java
+++ b/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java
@@ -250,4 +250,9 @@ public class PaperWorldConfig {
@ -26,10 +26,10 @@ index 88a4f8882..da2746754 100644
+ }
}
diff --git a/src/main/java/net/minecraft/server/PlayerConnection.java b/src/main/java/net/minecraft/server/PlayerConnection.java
index 32c6e2eca..046bcb27e 100644
index f91144693..8f182fcc8 100644
--- a/src/main/java/net/minecraft/server/PlayerConnection.java
+++ b/src/main/java/net/minecraft/server/PlayerConnection.java
@@ -1631,7 +1631,16 @@ public class PlayerConnection implements PacketListenerPlayIn {
@@ -1647,7 +1647,16 @@ public class PlayerConnection implements PacketListenerPlayIn {
return;
}
@ -37,7 +37,7 @@ index 32c6e2eca..046bcb27e 100644
+ // Paper Start - (Meh) Support for vanilla world scoreboard name coloring
+ String displayName = event.getPlayer().getDisplayName();
+ if (this.player.getWorld().paperConfig.useVanillaScoreboardColoring) {
+ IChatBaseComponent nameFromTeam = ScoreboardTeam.a(this.player.getScoreboardTeam(),((CraftPlayer) player).getHandle().getDisplayName());
+ IChatBaseComponent nameFromTeam = ScoreboardTeam.a(this.player.getScoreboardTeam(), ((CraftPlayer) player).getHandle().getDisplayName());
+ // Explicitly add a RESET here, vanilla uses components for this now...
+ displayName = CraftChatMessage.fromComponent(nameFromTeam, EnumChatFormat.WHITE) + org.bukkit.ChatColor.RESET;
+ }
@ -48,18 +48,18 @@ index 32c6e2eca..046bcb27e 100644
if (((LazyPlayerSet) event.getRecipients()).isLazy()) {
for (Object recipient : minecraftServer.getPlayerList().players) {
diff --git a/src/main/java/net/minecraft/server/PlayerList.java b/src/main/java/net/minecraft/server/PlayerList.java
index cce5305fb..d368b3975 100644
index 05ea0ace5..94a24a49c 100644
--- a/src/main/java/net/minecraft/server/PlayerList.java
+++ b/src/main/java/net/minecraft/server/PlayerList.java
@@ -177,7 +177,7 @@ public abstract class PlayerList {
@@ -178,7 +178,7 @@ public abstract class PlayerList {
}
// CraftBukkit start
chatmessage.a(EnumChatFormat.YELLOW);
- String joinMessage = CraftChatMessage.fromComponent(chatmessage);
+ String joinMessage = CraftChatMessage.fromComponent(chatmessage, EnumChatFormat.WHITE);
playerconnection.a(entityplayer.locX, entityplayer.locY, entityplayer.locZ, entityplayer.yaw, entityplayer.pitch);
playerconnection.a(entityplayer.locX(), entityplayer.locY(), entityplayer.locZ(), entityplayer.yaw, entityplayer.pitch);
this.players.add(entityplayer);
--
2.23.0
2.24.0

Datei anzeigen

@ -1,4 +1,4 @@
From c2cf15f3bb28ed63f7ba3e882b98cccd64630e95 Mon Sep 17 00:00:00 2001
From cea469d071f85fdb862004c5782b4b2d3a70df66 Mon Sep 17 00:00:00 2001
From: Zach Brown <zach.brown@destroystokyo.com>
Date: Sun, 10 Apr 2016 03:23:32 -0500
Subject: [PATCH] Workaround for setting passengers on players
@ -6,10 +6,10 @@ Subject: [PATCH] Workaround for setting passengers on players
SPIGOT-1915 & GH-114
diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
index d0d61fd29..57f2499ca 100644
index 493edc743..f48a77f21 100644
--- a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
+++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
@@ -764,6 +764,17 @@ public class CraftPlayer extends CraftHumanEntity implements Player {
@@ -763,6 +763,17 @@ public class CraftPlayer extends CraftHumanEntity implements Player {
return true;
}
@ -28,5 +28,5 @@ index d0d61fd29..57f2499ca 100644
public void setSneaking(boolean sneak) {
getHandle().setSneaking(sneak);
--
2.22.0
2.24.0

Datei anzeigen

@ -1,4 +1,4 @@
From 0ee56a69b369639630bf92c98b166b3171579e94 Mon Sep 17 00:00:00 2001
From b34235812fc440fa306910d1562c5fb0f93ae857 Mon Sep 17 00:00:00 2001
From: Aikar <aikar@aikar.co>
Date: Wed, 13 Apr 2016 00:25:28 -0400
Subject: [PATCH] Remove unused World Tile Entity List
@ -6,10 +6,10 @@ Subject: [PATCH] Remove unused World Tile Entity List
Massive hit to performance and it is completely unnecessary.
diff --git a/src/main/java/net/minecraft/server/World.java b/src/main/java/net/minecraft/server/World.java
index 38abe7cf34..fccc85ff82 100644
index 57633955c..7d5f6e220 100644
--- a/src/main/java/net/minecraft/server/World.java
+++ b/src/main/java/net/minecraft/server/World.java
@@ -40,7 +40,7 @@ public abstract class World implements IIBlockAccess, GeneratorAccess, AutoClose
@@ -40,7 +40,7 @@ public abstract class World implements GeneratorAccess, AutoCloseable {
protected static final Logger LOGGER = LogManager.getLogger();
private static final EnumDirection[] a = EnumDirection.values();
@ -17,8 +17,8 @@ index 38abe7cf34..fccc85ff82 100644
+ //public final List<TileEntity> tileEntityList = Lists.newArrayList(); // Paper - remove unused list
public final List<TileEntity> tileEntityListTick = Lists.newArrayList();
protected final List<TileEntity> tileEntityListPending = Lists.newArrayList();
protected final java.util.Set<TileEntity> tileEntityListUnload = com.google.common.collect.Sets.newHashSet(); // Paper
@@ -692,9 +692,9 @@ public abstract class World implements IIBlockAccess, GeneratorAccess, AutoClose
protected final java.util.Set<TileEntity> tileEntityListUnload = com.google.common.collect.Sets.newHashSet();
@@ -616,9 +616,9 @@ public abstract class World implements GeneratorAccess, AutoCloseable {
}, tileentity::getPosition});
}
@ -30,7 +30,7 @@ index 38abe7cf34..fccc85ff82 100644
this.tileEntityListTick.add(tileentity);
}
@@ -730,7 +730,7 @@ public abstract class World implements IIBlockAccess, GeneratorAccess, AutoClose
@@ -654,7 +654,7 @@ public abstract class World implements GeneratorAccess, AutoCloseable {
timings.tileEntityTick.startTiming(); // Spigot
if (!this.tileEntityListUnload.isEmpty()) {
this.tileEntityListTick.removeAll(this.tileEntityListUnload);
@ -39,7 +39,7 @@ index 38abe7cf34..fccc85ff82 100644
this.tileEntityListUnload.clear();
}
@@ -791,7 +791,7 @@ public abstract class World implements IIBlockAccess, GeneratorAccess, AutoClose
@@ -715,7 +715,7 @@ public abstract class World implements GeneratorAccess, AutoCloseable {
tilesThisCycle--;
this.tileEntityListTick.remove(tileTickPosition--);
// Spigot end
@ -48,7 +48,7 @@ index 38abe7cf34..fccc85ff82 100644
if (this.isLoaded(tileentity.getPosition())) {
this.getChunkAtWorldCoords(tileentity.getPosition()).removeTileEntity(tileentity.getPosition());
}
@@ -821,7 +821,7 @@ public abstract class World implements IIBlockAccess, GeneratorAccess, AutoClose
@@ -745,7 +745,7 @@ public abstract class World implements GeneratorAccess, AutoCloseable {
this.notify(tileentity1.getPosition(), iblockdata, iblockdata, 3);
// CraftBukkit start
// From above, don't screw this up - SPIGOT-1746
@ -57,7 +57,7 @@ index 38abe7cf34..fccc85ff82 100644
this.a(tileentity1);
}
// CraftBukkit end
@@ -1083,7 +1083,7 @@ public abstract class World implements IIBlockAccess, GeneratorAccess, AutoClose
@@ -1005,7 +1005,7 @@ public abstract class World implements GeneratorAccess, AutoCloseable {
} else {
if (tileentity != null) {
this.tileEntityListPending.remove(tileentity);
@ -67,10 +67,10 @@ index 38abe7cf34..fccc85ff82 100644
}
diff --git a/src/main/java/net/minecraft/server/WorldServer.java b/src/main/java/net/minecraft/server/WorldServer.java
index 835428e839..5a6b82dbc3 100644
index 64b80441f..f03e562c3 100644
--- a/src/main/java/net/minecraft/server/WorldServer.java
+++ b/src/main/java/net/minecraft/server/WorldServer.java
@@ -1610,7 +1610,7 @@ public class WorldServer extends World {
@@ -1617,7 +1617,7 @@ public class WorldServer extends World {
}
bufferedwriter.write(String.format("entities: %d\n", this.entitiesById.size()));
@ -79,7 +79,7 @@ index 835428e839..5a6b82dbc3 100644
bufferedwriter.write(String.format("block_ticks: %d\n", this.getBlockTickList().a()));
bufferedwriter.write(String.format("fluid_ticks: %d\n", this.getFluidTickList().a()));
bufferedwriter.write("distance_manager: " + playerchunkmap.e().c() + "\n");
@@ -1773,7 +1773,7 @@ public class WorldServer extends World {
@@ -1780,7 +1780,7 @@ public class WorldServer extends World {
private void a(Writer writer) throws IOException {
CSVWriter csvwriter = CSVWriter.a().a("x").a("y").a("z").a("type").a(writer);
@ -89,5 +89,5 @@ index 835428e839..5a6b82dbc3 100644
while (iterator.hasNext()) {
TileEntity tileentity = (TileEntity) iterator.next();
--
2.22.1
2.24.0

Datei anzeigen

@ -1,4 +1,4 @@
From a8a2a5f526e820f15592fbe10e45217f427d428a Mon Sep 17 00:00:00 2001
From 3319f42462f09528ba6daa8d7803c92ca0f53cad Mon Sep 17 00:00:00 2001
From: Aikar <aikar@aikar.co>
Date: Wed, 13 Apr 2016 00:30:10 -0400
Subject: [PATCH] Don't tick Skulls - unused code
@ -27,5 +27,5 @@ index 99442bb13..177cceb77 100644
Block block = this.getBlock().getBlock();
--
2.22.0
2.24.0

Datei anzeigen

@ -1,11 +1,11 @@
From ad70f23c1ea684f7771bb2b748da2103093c3711 Mon Sep 17 00:00:00 2001
From 91d001f58b8055d79681b68865013416ce4b818e Mon Sep 17 00:00:00 2001
From: Aikar <aikar@aikar.co>
Date: Wed, 13 Apr 2016 02:10:49 -0400
Subject: [PATCH] Configurable Player Collision
diff --git a/src/main/java/com/destroystokyo/paper/PaperConfig.java b/src/main/java/com/destroystokyo/paper/PaperConfig.java
index 0cef1853f5..dc3438890b 100644
index d500cd75a..e4f0db64c 100644
--- a/src/main/java/com/destroystokyo/paper/PaperConfig.java
+++ b/src/main/java/com/destroystokyo/paper/PaperConfig.java
@@ -223,4 +223,9 @@ public class PaperConfig {
@ -19,10 +19,10 @@ index 0cef1853f5..dc3438890b 100644
+ }
}
diff --git a/src/main/java/net/minecraft/server/MinecraftServer.java b/src/main/java/net/minecraft/server/MinecraftServer.java
index fe50d4ff71..e3bd80c934 100644
index 25774fb73..696cab131 100644
--- a/src/main/java/net/minecraft/server/MinecraftServer.java
+++ b/src/main/java/net/minecraft/server/MinecraftServer.java
@@ -446,6 +446,20 @@ public abstract class MinecraftServer extends IAsyncTaskHandlerReentrant<TickTas
@@ -453,6 +453,20 @@ public abstract class MinecraftServer extends IAsyncTaskHandlerReentrant<TickTas
this.server.getPluginManager().callEvent(new org.bukkit.event.world.WorldLoadEvent(worldserver.getWorld()));
}
@ -44,7 +44,7 @@ index fe50d4ff71..e3bd80c934 100644
this.server.getPluginManager().callEvent(new ServerLoadEvent(ServerLoadEvent.LoadType.STARTUP));
this.serverConnection.acceptConnections();
diff --git a/src/main/java/net/minecraft/server/PacketPlayOutScoreboardTeam.java b/src/main/java/net/minecraft/server/PacketPlayOutScoreboardTeam.java
index b0740965a4..6b1a914d2f 100644
index b0740965a..6b1a914d2 100644
--- a/src/main/java/net/minecraft/server/PacketPlayOutScoreboardTeam.java
+++ b/src/main/java/net/minecraft/server/PacketPlayOutScoreboardTeam.java
@@ -96,7 +96,7 @@ public class PacketPlayOutScoreboardTeam implements Packet<PacketListenerPlayOut
@ -57,7 +57,7 @@ index b0740965a4..6b1a914d2f 100644
packetdataserializer.a(this.c);
packetdataserializer.a(this.d);
diff --git a/src/main/java/net/minecraft/server/PlayerList.java b/src/main/java/net/minecraft/server/PlayerList.java
index d368b39751..ee5297dc38 100644
index 94a24a49c..b7012b5b6 100644
--- a/src/main/java/net/minecraft/server/PlayerList.java
+++ b/src/main/java/net/minecraft/server/PlayerList.java
@@ -72,6 +72,7 @@ public abstract class PlayerList {
@ -68,7 +68,7 @@ index d368b39751..ee5297dc38 100644
public PlayerList(MinecraftServer minecraftserver, int i) {
this.cserver = minecraftserver.server = new CraftServer((DedicatedServer) minecraftserver, this);
@@ -286,6 +287,13 @@ public abstract class PlayerList {
@@ -287,6 +288,13 @@ public abstract class PlayerList {
}
entityplayer.syncInventory();
@ -80,9 +80,9 @@ index d368b39751..ee5297dc38 100644
+ }
+ // Paper end
// CraftBukkit - Moved from above, added world
PlayerList.LOGGER.info("{}[{}] logged in with entity id {} at ([{}]{}, {}, {})", entityplayer.getDisplayName().getString(), s1, entityplayer.getId(), entityplayer.world.worldData.getName(), entityplayer.locX, entityplayer.locY, entityplayer.locZ);
PlayerList.LOGGER.info("{}[{}] logged in with entity id {} at ([{}]{}, {}, {})", entityplayer.getDisplayName().getString(), s1, entityplayer.getId(), entityplayer.world.worldData.getName(), entityplayer.locX(), entityplayer.locY(), entityplayer.locZ());
}
@@ -404,6 +412,16 @@ public abstract class PlayerList {
@@ -405,6 +413,16 @@ public abstract class PlayerList {
entityplayer.playerTick();// SPIGOT-924
// CraftBukkit end
@ -99,11 +99,10 @@ index d368b39751..ee5297dc38 100644
this.savePlayerFile(entityplayer);
if (entityplayer.isPassenger()) {
Entity entity = entityplayer.getRootVehicle();
@@ -1027,7 +1045,13 @@ public abstract class PlayerList {
player.playerConnection.disconnect(this.server.server.getShutdownMessage()); // CraftBukkit - add custom shutdown message
@@ -1029,6 +1047,13 @@ public abstract class PlayerList {
}
// CraftBukkit end
-
+ // Paper start - Remove collideRule team if it exists
+ if (this.collideRuleTeamName != null) {
+ final Scoreboard scoreboard = this.getServer().getWorldServer(DimensionManager.OVERWORLD).getScoreboard();
@ -115,5 +114,5 @@ index d368b39751..ee5297dc38 100644
// CraftBukkit start
--
2.22.0
2.24.0

Datei anzeigen

@ -1,4 +1,4 @@
From bc570b6f9591c86611478036b2c3afb749b3cc34 Mon Sep 17 00:00:00 2001
From c53ff4ca1da2dbd6ec00ea821a986238f7390c92 Mon Sep 17 00:00:00 2001
From: kashike <kashike@vq.lc>
Date: Wed, 13 Apr 2016 20:21:38 -0700
Subject: [PATCH] Add handshake event to allow plugins to handle client
@ -6,7 +6,7 @@ Subject: [PATCH] Add handshake event to allow plugins to handle client
diff --git a/src/main/java/net/minecraft/server/HandshakeListener.java b/src/main/java/net/minecraft/server/HandshakeListener.java
index 756330a6c..66dda900b 100644
index 963dbd064..d0b9c6e3d 100644
--- a/src/main/java/net/minecraft/server/HandshakeListener.java
+++ b/src/main/java/net/minecraft/server/HandshakeListener.java
@@ -73,8 +73,33 @@ public class HandshakeListener implements PacketHandshakingInListener {
@ -45,5 +45,5 @@ index 756330a6c..66dda900b 100644
if ( split.length == 3 || split.length == 4 ) {
packethandshakinginsetprotocol.hostname = split[0];
--
2.22.0
2.24.0

Datei anzeigen

@ -1,4 +1,4 @@
From d9a3536a7a23b482b3808a0c323d69b5517e6dde Mon Sep 17 00:00:00 2001
From ee7d5d106982a5476dcd5f899b0ae62dd576b057 Mon Sep 17 00:00:00 2001
From: Aikar <aikar@aikar.co>
Date: Sat, 16 Apr 2016 00:39:33 -0400
Subject: [PATCH] Configurable RCON IP address
@ -6,7 +6,7 @@ Subject: [PATCH] Configurable RCON IP address
For servers with multiple IP's, ability to bind to a specific interface.
diff --git a/src/main/java/net/minecraft/server/DedicatedServerProperties.java b/src/main/java/net/minecraft/server/DedicatedServerProperties.java
index ad1e3508a7..0c3ec83570 100644
index ad1e3508a..0c3ec8357 100644
--- a/src/main/java/net/minecraft/server/DedicatedServerProperties.java
+++ b/src/main/java/net/minecraft/server/DedicatedServerProperties.java
@@ -54,6 +54,8 @@ public class DedicatedServerProperties extends PropertyManager<DedicatedServerPr
@ -30,7 +30,7 @@ index ad1e3508a7..0c3ec83570 100644
// CraftBukkit start
diff --git a/src/main/java/net/minecraft/server/PropertyManager.java b/src/main/java/net/minecraft/server/PropertyManager.java
index d7e81a6d99..729455ce53 100644
index d7e81a6d9..729455ce5 100644
--- a/src/main/java/net/minecraft/server/PropertyManager.java
+++ b/src/main/java/net/minecraft/server/PropertyManager.java
@@ -127,8 +127,8 @@ public abstract class PropertyManager<T extends PropertyManager<T>> {
@ -45,7 +45,7 @@ index d7e81a6d99..729455ce53 100644
}
diff --git a/src/main/java/net/minecraft/server/RemoteControlListener.java b/src/main/java/net/minecraft/server/RemoteControlListener.java
index e48d6dcd74..2ce490be00 100644
index e48d6dcd7..2ce490be0 100644
--- a/src/main/java/net/minecraft/server/RemoteControlListener.java
+++ b/src/main/java/net/minecraft/server/RemoteControlListener.java
@@ -25,7 +25,7 @@ public class RemoteControlListener extends RemoteConnectionThread {
@ -58,5 +58,5 @@ index e48d6dcd74..2ce490be00 100644
this.i = "0.0.0.0";
}
--
2.22.0
2.24.0

Datei anzeigen

@ -1,4 +1,4 @@
From 067640ae81f0a55d2a5deb5a9703b7c7a39629ff Mon Sep 17 00:00:00 2001
From 54b3a7993832da083470c8918749a25d2ce762fb Mon Sep 17 00:00:00 2001
From: Aikar <aikar@aikar.co>
Date: Sun, 17 Apr 2016 17:27:09 -0400
Subject: [PATCH] Prevent Fire from loading chunks
@ -7,7 +7,7 @@ This causes the nether to spam unload/reload chunks, plus overall
bad behavior.
diff --git a/src/main/java/net/minecraft/server/BlockFire.java b/src/main/java/net/minecraft/server/BlockFire.java
index 81e9717ae..49e3d7284 100644
index 2909f78f8..9cf7d0b9e 100644
--- a/src/main/java/net/minecraft/server/BlockFire.java
+++ b/src/main/java/net/minecraft/server/BlockFire.java
@@ -163,6 +163,7 @@ public class BlockFire extends Block {
@ -15,20 +15,20 @@ index 81e9717ae..49e3d7284 100644
blockposition_mutableblockposition.g(blockposition).e(l, j1, i1);
+ if (!world.isLoaded(blockposition_mutableblockposition)) continue; // Paper
int l1 = this.a((IWorldReader) world, (BlockPosition) blockposition_mutableblockposition);
int l1 = this.a((IWorldReader) worldserver, (BlockPosition) blockposition_mutableblockposition);
if (l1 > 0) {
@@ -208,10 +209,16 @@ public class BlockFire extends Block {
}
private void a(World world, BlockPosition blockposition, int i, Random random, int j, BlockPosition sourceposition) { // CraftBukkit add sourceposition
- int k = this.q(world.getType(blockposition));
- int k = this.i(world.getType(blockposition));
+ // Paper start
+ final IBlockData iblockdata = world.getTypeIfLoaded(blockposition);
+ if (iblockdata == null) {
+ return;
+ }
+ int k = this.q(iblockdata);
+ int k = this.i(iblockdata);
+ // Paper end
if (random.nextInt(i) < k) {
@ -53,5 +53,5 @@ index 81e9717ae..49e3d7284 100644
}
--
2.22.0
2.24.0

Datei anzeigen

@ -1,11 +1,11 @@
From e5747591e90b08f7f608da800748d4c476b883c8 Mon Sep 17 00:00:00 2001
From 8205197440b1d36daa929092848db35dd5295c71 Mon Sep 17 00:00:00 2001
From: Isaac Moore <rmsy@me.com>
Date: Tue, 19 Apr 2016 14:09:31 -0500
Subject: [PATCH] Implement PlayerLocaleChangeEvent
diff --git a/src/main/java/net/minecraft/server/EntityPlayer.java b/src/main/java/net/minecraft/server/EntityPlayer.java
index 55e8174bf..3b80e7bfb 100644
index 6354f25b2..6595dca86 100644
--- a/src/main/java/net/minecraft/server/EntityPlayer.java
+++ b/src/main/java/net/minecraft/server/EntityPlayer.java
@@ -37,7 +37,7 @@ import org.bukkit.inventory.MainHand;
@ -17,7 +17,7 @@ index 55e8174bf..3b80e7bfb 100644
public PlayerConnection playerConnection;
public final MinecraftServer server;
public final PlayerInteractManager playerInteractManager;
@@ -1456,13 +1456,20 @@ public class EntityPlayer extends EntityHuman implements ICrafting {
@@ -1431,13 +1431,20 @@ public class EntityPlayer extends EntityHuman implements ICrafting {
PlayerChangedMainHandEvent event = new PlayerChangedMainHandEvent(getBukkitEntity(), getMainHand() == EnumMainHand.LEFT ? MainHand.LEFT : MainHand.RIGHT);
this.server.server.getPluginManager().callEvent(event);
}
@ -36,14 +36,14 @@ index 55e8174bf..3b80e7bfb 100644
+ new com.destroystokyo.paper.event.player.PlayerLocaleChangeEvent(this.getBukkitEntity(), oldLocale, this.locale).callEvent();
+ }
+ // Paper end
this.ck = packetplayinsettings.d();
this.cl = packetplayinsettings.e();
this.getDataWatcher().set(EntityPlayer.bt, (byte) packetplayinsettings.f());
this.ch = packetplayinsettings.d();
this.ci = packetplayinsettings.e();
this.getDataWatcher().set(EntityPlayer.bq, (byte) packetplayinsettings.f());
diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
index 881fa70b2..151dcf243 100644
index f48a77f21..534e2756d 100644
--- a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
+++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
@@ -1758,8 +1758,10 @@ public class CraftPlayer extends CraftHumanEntity implements Player {
@@ -1742,8 +1742,10 @@ public class CraftPlayer extends CraftHumanEntity implements Player {
@Override
public String getLocale() {
@ -56,15 +56,14 @@ index 881fa70b2..151dcf243 100644
}
// Paper start
@@ -1849,7 +1851,7 @@ public class CraftPlayer extends CraftHumanEntity implements Player {
@Override
public String getLocale()
{
- return getHandle().locale;
+ return CraftPlayer.this.getLocale(); // Paper
@@ -1830,7 +1832,6 @@ public class CraftPlayer extends CraftHumanEntity implements Player {
}
}
@Override
- @Override
public Set<Player> getHiddenPlayers()
{
Set<Player> ret = new HashSet<Player>();
--
2.23.0
2.24.0

Datei anzeigen

@ -1,4 +1,4 @@
From b93ae0b6d950cf48acc1044579ab0284fb734df6 Mon Sep 17 00:00:00 2001
From e432e5cddfd6f7a262bc077627e112ed651cbaa7 Mon Sep 17 00:00:00 2001
From: Zach Brown <zach.brown@destroystokyo.com>
Date: Fri, 22 Apr 2016 01:43:11 -0500
Subject: [PATCH] EntityRegainHealthEvent isFastRegen API
@ -6,10 +6,10 @@ Subject: [PATCH] EntityRegainHealthEvent isFastRegen API
Don't even get me started
diff --git a/src/main/java/net/minecraft/server/EntityLiving.java b/src/main/java/net/minecraft/server/EntityLiving.java
index 18e152b8f..45c024ca2 100644
index bdbd89996..191e7dfaf 100644
--- a/src/main/java/net/minecraft/server/EntityLiving.java
+++ b/src/main/java/net/minecraft/server/EntityLiving.java
@@ -969,10 +969,16 @@ public abstract class EntityLiving extends Entity {
@@ -922,10 +922,16 @@ public abstract class EntityLiving extends Entity {
}
public void heal(float f, EntityRegainHealthEvent.RegainReason regainReason) {
@ -28,7 +28,7 @@ index 18e152b8f..45c024ca2 100644
if (this.valid) {
this.world.getServer().getPluginManager().callEvent(event);
diff --git a/src/main/java/net/minecraft/server/FoodMetaData.java b/src/main/java/net/minecraft/server/FoodMetaData.java
index 739b8fd18..28b04f35e 100644
index 01d702d5c..c3a9a9bd4 100644
--- a/src/main/java/net/minecraft/server/FoodMetaData.java
+++ b/src/main/java/net/minecraft/server/FoodMetaData.java
@@ -69,7 +69,7 @@ public class FoodMetaData {
@ -41,5 +41,5 @@ index 739b8fd18..28b04f35e 100644
this.foodTickTimer = 0;
}
--
2.22.0
2.24.0

Datei anzeigen

@ -1,11 +1,11 @@
From f3379f11685779d6c619774596eeb258aea321fb Mon Sep 17 00:00:00 2001
From 6c3518bcb40157228f7e11e6f75615fe6e77a1c0 Mon Sep 17 00:00:00 2001
From: kashike <kashike@vq.lc>
Date: Thu, 21 Apr 2016 23:51:55 -0700
Subject: [PATCH] Add ability to configure frosted_ice properties
diff --git a/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java b/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java
index da2746754..bea878970 100644
index b1682894f..d00e8155d 100644
--- a/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java
+++ b/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java
@@ -255,4 +255,14 @@ public class PaperWorldConfig {
@ -24,23 +24,23 @@ index da2746754..bea878970 100644
+ }
}
diff --git a/src/main/java/net/minecraft/server/BlockIceFrost.java b/src/main/java/net/minecraft/server/BlockIceFrost.java
index 1a0c2eeaa..39c3bbc9c 100644
index af17aba8b..5e414138e 100644
--- a/src/main/java/net/minecraft/server/BlockIceFrost.java
+++ b/src/main/java/net/minecraft/server/BlockIceFrost.java
@@ -13,6 +13,7 @@ public class BlockIceFrost extends BlockIce {
@Override
public void tick(IBlockData iblockdata, World world, BlockPosition blockposition, Random random) {
+ if (!world.paperConfig.frostedIceEnabled) return; // Paper - add ability to disable frosted ice
if ((random.nextInt(3) == 0 || this.a(world, blockposition, 4)) && world.getLightLevel(blockposition) > 11 - (Integer) iblockdata.get(BlockIceFrost.a) - iblockdata.b((IBlockAccess) world, blockposition) && this.e(iblockdata, world, blockposition)) {
public void tick(IBlockData iblockdata, WorldServer worldserver, BlockPosition blockposition, Random random) {
+ if (!worldserver.paperConfig.frostedIceEnabled) return; // Paper - add ability to disable frosted ice
if ((random.nextInt(3) == 0 || this.a(worldserver, blockposition, 4)) && worldserver.getLightLevel(blockposition) > 11 - (Integer) iblockdata.get(BlockIceFrost.a) - iblockdata.b((IBlockAccess) worldserver, blockposition) && this.e(iblockdata, (World) worldserver, blockposition)) {
BlockPosition.PooledBlockPosition blockposition_pooledblockposition = BlockPosition.PooledBlockPosition.r();
Throwable throwable = null;
@@ -28,7 +29,7 @@ public class BlockIceFrost extends BlockIce {
IBlockData iblockdata1 = world.getType(blockposition_pooledblockposition);
IBlockData iblockdata1 = worldserver.getType(blockposition_pooledblockposition);
if (iblockdata1.getBlock() == this && !this.e(iblockdata1, world, blockposition_pooledblockposition)) {
- world.getBlockTickList().a(blockposition_pooledblockposition, this, MathHelper.nextInt(random, 20, 40));
+ world.getBlockTickList().a(blockposition_pooledblockposition, this, MathHelper.nextInt(random, world.paperConfig.frostedIceDelayMin, world.paperConfig.frostedIceDelayMax)); // Paper - use configurable min/max delay
if (iblockdata1.getBlock() == this && !this.e(iblockdata1, (World) worldserver, blockposition_pooledblockposition)) {
- worldserver.getBlockTickList().a(blockposition_pooledblockposition, this, MathHelper.nextInt(random, 20, 40));
+ worldserver.getBlockTickList().a(blockposition_pooledblockposition, this, MathHelper.nextInt(random, worldserver.paperConfig.frostedIceDelayMin, worldserver.paperConfig.frostedIceDelayMax)); // Paper - use configurable min/max delay
}
}
} catch (Throwable throwable1) {
@ -48,11 +48,11 @@ index 1a0c2eeaa..39c3bbc9c 100644
}
} else {
- world.getBlockTickList().a(blockposition, this, MathHelper.nextInt(random, 20, 40));
+ world.getBlockTickList().a(blockposition, this, MathHelper.nextInt(random, world.paperConfig.frostedIceDelayMin, world.paperConfig.frostedIceDelayMax)); // Paper - use configurable min/max delay
- worldserver.getBlockTickList().a(blockposition, this, MathHelper.nextInt(random, 20, 40));
+ worldserver.getBlockTickList().a(blockposition, this, MathHelper.nextInt(random, worldserver.paperConfig.frostedIceDelayMin, worldserver.paperConfig.frostedIceDelayMax)); // Paper - use configurable min/max delay
}
}
--
2.23.0
2.24.0

Datei anzeigen

@ -1,4 +1,4 @@
From 2a5c0c28e79e357361e9179b4291881df81cc6c6 Mon Sep 17 00:00:00 2001
From 3479646f77022bda2f0127cf2d914addab3ad3e1 Mon Sep 17 00:00:00 2001
From: Aikar <aikar@aikar.co>
Date: Thu, 28 Apr 2016 00:57:27 -0400
Subject: [PATCH] remove null possibility for getServer singleton
@ -6,7 +6,7 @@ Subject: [PATCH] remove null possibility for getServer singleton
to stop IDE complaining about potential NPE
diff --git a/src/main/java/net/minecraft/server/MinecraftServer.java b/src/main/java/net/minecraft/server/MinecraftServer.java
index b4eb53f28a..fbad6a31c1 100644
index 696cab131..2a40bb0b8 100644
--- a/src/main/java/net/minecraft/server/MinecraftServer.java
+++ b/src/main/java/net/minecraft/server/MinecraftServer.java
@@ -68,6 +68,7 @@ import org.spigotmc.SlackActivityAccountant; // Spigot
@ -17,15 +17,15 @@ index b4eb53f28a..fbad6a31c1 100644
public static final Logger LOGGER = LogManager.getLogger();
public static final File b = new File("usercache.json");
private static final CompletableFuture<Unit> i = CompletableFuture.completedFuture(Unit.INSTANCE);
@@ -175,6 +176,7 @@ public abstract class MinecraftServer extends IAsyncTaskHandlerReentrant<TickTas
@@ -178,6 +179,7 @@ public abstract class MinecraftServer extends IAsyncTaskHandlerReentrant<TickTas
public MinecraftServer(OptionSet options, Proxy proxy, DataFixer datafixer, CommandDispatcher commanddispatcher, YggdrasilAuthenticationService yggdrasilauthenticationservice, MinecraftSessionService minecraftsessionservice, GameProfileRepository gameprofilerepository, UserCache usercache, WorldLoadListenerFactory worldloadlistenerfactory, String s) {
super("Server");
this.ae = new ResourceManager(EnumResourcePackType.SERVER_DATA, this.serverThread);
+ SERVER = this; // Paper - better singleton
this.resourcePackRepository = new ResourcePackRepository<>(ResourcePackLoader::new);
this.ai = new CraftingManager();
this.aj = new TagRegistry();
@@ -2140,7 +2142,7 @@ public abstract class MinecraftServer extends IAsyncTaskHandlerReentrant<TickTas
this.craftingManager = new CraftingManager();
this.tagRegistry = new TagRegistry();
@@ -2169,7 +2171,7 @@ public abstract class MinecraftServer extends IAsyncTaskHandlerReentrant<TickTas
@Deprecated
public static MinecraftServer getServer() {
@ -35,5 +35,5 @@ index b4eb53f28a..fbad6a31c1 100644
// CraftBukkit end
}
--
2.22.1
2.24.0

Datei anzeigen

@ -1,4 +1,4 @@
From 4a24d933c3d86830cce8e1c055cf62512d538e5d Mon Sep 17 00:00:00 2001
From d0c50d51c53fc8166be18788e32fd3d238871671 Mon Sep 17 00:00:00 2001
From: Aikar <aikar@aikar.co>
Date: Fri, 29 Apr 2016 20:02:00 -0400
Subject: [PATCH] Improve Maps (in item frames) performance and bug fixes
@ -13,10 +13,10 @@ custom renderers are in use, defaulting to the much simpler Vanilla system.
Additionally, numerous issues to player position tracking on maps has been fixed.
diff --git a/src/main/java/net/minecraft/server/EntityHuman.java b/src/main/java/net/minecraft/server/EntityHuman.java
index 9bddbd8a88..4ceac0a2ff 100644
index 761fe32ba..242d0df1c 100644
--- a/src/main/java/net/minecraft/server/EntityHuman.java
+++ b/src/main/java/net/minecraft/server/EntityHuman.java
@@ -605,6 +605,12 @@ public abstract class EntityHuman extends EntityLiving {
@@ -615,6 +615,12 @@ public abstract class EntityHuman extends EntityLiving {
return null;
}
// CraftBukkit end
@ -30,7 +30,7 @@ index 9bddbd8a88..4ceac0a2ff 100644
return entityitem;
}
diff --git a/src/main/java/net/minecraft/server/WorldMap.java b/src/main/java/net/minecraft/server/WorldMap.java
index fc08158937..090d3dbd31 100644
index a56ac3da8..2f1be1995 100644
--- a/src/main/java/net/minecraft/server/WorldMap.java
+++ b/src/main/java/net/minecraft/server/WorldMap.java
@@ -31,6 +31,7 @@ public class WorldMap extends PersistentBase {
@ -102,10 +102,10 @@ index fc08158937..090d3dbd31 100644
for ( org.bukkit.map.MapCursor cursor : render.cursors) {
diff --git a/src/main/java/net/minecraft/server/WorldServer.java b/src/main/java/net/minecraft/server/WorldServer.java
index 5a6b82dbc3..d50e804102 100644
index f03e562c3..ea9899889 100644
--- a/src/main/java/net/minecraft/server/WorldServer.java
+++ b/src/main/java/net/minecraft/server/WorldServer.java
@@ -1086,6 +1086,7 @@ public class WorldServer extends World {
@@ -1094,6 +1094,7 @@ public class WorldServer extends World {
{
if ( iter.next().trackee == entity )
{
@ -114,7 +114,7 @@ index 5a6b82dbc3..d50e804102 100644
}
}
diff --git a/src/main/java/org/bukkit/craftbukkit/map/RenderData.java b/src/main/java/org/bukkit/craftbukkit/map/RenderData.java
index 256a131781..5768cd512e 100644
index 256a13178..5768cd512 100644
--- a/src/main/java/org/bukkit/craftbukkit/map/RenderData.java
+++ b/src/main/java/org/bukkit/craftbukkit/map/RenderData.java
@@ -5,7 +5,7 @@ import org.bukkit.map.MapCursor;
@ -127,5 +127,5 @@ index 256a131781..5768cd512e 100644
public RenderData() {
--
2.22.1
2.24.0