Archiviert
13
0

Updated Upstream (Bukkit/CraftBukkit/Spigot)

Developers!: You will need to clean up your work/Minecraft/1.13.2 folder for this

Upstream has released updates that appears to apply and compile correctly.
This update has not been tested by PaperMC and as with ANY update, please do your own testing

Bukkit Changes:
b850a822 SPIGOT-4526: Add conversion time API for Zombie & subclasses

CraftBukkit Changes:
38cf676e SPIGOT-4534: CreatureSpawnEvent not being called for CHUNK_GEN
b446cb5d SPIGOT-4527: Fix sponges with waterlogged blocks
6ec8ea5c SPIGOT-4526: Add conversion time API for Zombie & subclasses
c64fe508 Mappings Update
a3c2ec03 Fix missing ServerListPingEvent call for legacy pings

Spigot Changes:
1dc156ce Rebuild patches
140f654d Mappings Update
Dieser Commit ist enthalten in:
Shane Freeder 2018-12-17 05:18:06 +00:00
Ursprung 8ed2992da9
Commit 3496f2d7e4
Es konnte kein GPG-Schlüssel zu dieser Signatur gefunden werden
GPG-Schlüssel-ID: A3F61EA5A085289C
150 geänderte Dateien mit 1561 neuen und 1504 gelöschten Zeilen

Datei anzeigen

@ -1,18 +1,17 @@
From 46242a1697a2b7a91f5b564f7fd02ea8d1bbcc02 Mon Sep 17 00:00:00 2001
From 8fc89f6aa5cd95b3b784cefd12a6e7e4bd4db165 Mon Sep 17 00:00:00 2001
From: BillyGalbreath <Blake.Galbreath@GMail.com>
Date: Sun, 7 Oct 2018 04:29:51 -0500
Subject: [PATCH] Add more Zombie API
diff --git a/src/main/java/org/bukkit/entity/Zombie.java b/src/main/java/org/bukkit/entity/Zombie.java
index 62923379..a6894903 100644
index 48034198..615dd990 100644
--- a/src/main/java/org/bukkit/entity/Zombie.java
+++ b/src/main/java/org/bukkit/entity/Zombie.java
@@ -48,4 +48,53 @@ public interface Zombie extends Monster {
@@ -79,4 +79,55 @@ public interface Zombie extends Monster {
* @param time new conversion time
*/
@Deprecated
public Villager.Profession getVillagerProfession();
+
void setConversionTime(int time);
+ // Paper start
+ /**
+ * Check if zombie is drowning
@ -25,7 +24,10 @@ index 62923379..a6894903 100644
+ * Make zombie start drowning
+ *
+ * @param drownedConversionTime Amount of time until zombie converts from drowning
+ *
+ * @deprecated See {@link #setConversionTime(int)}
+ */
+ @Deprecated
+ void startDrowning(int drownedConversionTime);
+
+ /**
@ -63,5 +65,5 @@ index 62923379..a6894903 100644
+ // Paper end
}
--
2.19.1
2.20.0

Datei anzeigen

@ -1,4 +1,4 @@
From fdf3ad1b2a768fbbbcd50d038efff92f144c23b5 Mon Sep 17 00:00:00 2001
From 1b71f76b3adb5f3ea991080df8180a1473da4e12 Mon Sep 17 00:00:00 2001
From: Zach Brown <zach.brown@destroystokyo.com>
Date: Mon, 29 Feb 2016 21:02:09 -0600
Subject: [PATCH] Paper config files
@ -511,7 +511,7 @@ index 000000000..a73865739
+ }
+}
diff --git a/src/main/java/net/minecraft/server/DedicatedServer.java b/src/main/java/net/minecraft/server/DedicatedServer.java
index 1f44d8119..73a326684 100644
index cdfd9a8fb..b5e5c385d 100644
--- a/src/main/java/net/minecraft/server/DedicatedServer.java
+++ b/src/main/java/net/minecraft/server/DedicatedServer.java
@@ -192,6 +192,15 @@ public class DedicatedServer extends MinecraftServer implements IMinecraftServer
@ -531,19 +531,19 @@ index 1f44d8119..73a326684 100644
DedicatedServer.LOGGER.info("Generating keypair");
this.a(MinecraftEncryption.b());
diff --git a/src/main/java/net/minecraft/server/Entity.java b/src/main/java/net/minecraft/server/Entity.java
index 27a24b00b..08c17d134 100644
index f04e87c57..c93cab858 100644
--- a/src/main/java/net/minecraft/server/Entity.java
+++ b/src/main/java/net/minecraft/server/Entity.java
@@ -135,9 +135,9 @@ public abstract class Entity implements INamableTileEntity, ICommandListener {
private static final DataWatcherObject<Boolean> aG = DataWatcher.a(Entity.class, DataWatcherRegistry.i);
private static final DataWatcherObject<Boolean> aH = DataWatcher.a(Entity.class, DataWatcherRegistry.i);
public boolean inChunk;
- public int ae;
- public int af;
- public int ag;
+ public int ae; public int getChunkX() { return ae; } // Paper - OBFHELPER
+ public int af; public int getChunkY() { return af; } // Paper - OBFHELPER
+ public int ag; public int getChunkZ() { return ag; } // Paper - OBFHELPER
- public int chunkX;
- public int chunkY;
- public int chunkZ;
+ public int chunkX; public int getChunkX() { return chunkX; } // Paper - OBFHELPER
+ public int chunkY; public int getChunkY() { return chunkY; } // Paper - OBFHELPER
+ public int chunkZ; public int getChunkZ() { return chunkZ; } // Paper - OBFHELPER
public boolean ak;
public boolean impulse;
public int portalCooldown;
@ -572,7 +572,7 @@ index 207bad41e..bcdc790ba 100644
+ // Paper end
}
diff --git a/src/main/java/net/minecraft/server/World.java b/src/main/java/net/minecraft/server/World.java
index 2252fa991..44b381120 100644
index 673764369..0920ef2d1 100644
--- a/src/main/java/net/minecraft/server/World.java
+++ b/src/main/java/net/minecraft/server/World.java
@@ -134,6 +134,8 @@ public abstract class World implements IEntityAccess, GeneratorAccess, IIBlockAc
@ -593,7 +593,7 @@ index 2252fa991..44b381120 100644
this.world = new CraftWorld((WorldServer) this, gen, env);
this.ticksPerAnimalSpawns = this.getServer().getTicksPerAnimalSpawns(); // CraftBukkit
diff --git a/src/main/java/org/bukkit/craftbukkit/CraftServer.java b/src/main/java/org/bukkit/craftbukkit/CraftServer.java
index 8ade4244e..b524adc7d 100644
index aa0dfa4cc..a3c07fbac 100644
--- a/src/main/java/org/bukkit/craftbukkit/CraftServer.java
+++ b/src/main/java/org/bukkit/craftbukkit/CraftServer.java
@@ -753,6 +753,7 @@ public final class CraftServer implements Server {
@ -620,7 +620,7 @@ index 8ade4244e..b524adc7d 100644
overrideAllCommandBlockCommands = commandsConfiguration.getStringList("command-block-overrides").contains("*");
ignoreVanillaPermissions = commandsConfiguration.getBoolean("ignore-vanilla-permissions");
@@ -1973,4 +1976,26 @@ public final class CraftServer implements Server {
@@ -1972,4 +1975,26 @@ public final class CraftServer implements Server {
{
return spigot;
}

Datei anzeigen

@ -1,36 +1,38 @@
From 1ccbf8a244b37fa3cf0bd7e3843496891d891d3e Mon Sep 17 00:00:00 2001
From dadb0a624cab08627738eb8b0538dc25bf636f10 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
diff --git a/src/main/java/net/minecraft/server/BaseBlockPosition.java b/src/main/java/net/minecraft/server/BaseBlockPosition.java
index a553fb747..4048937c6 100644
index 25a1edc45..f1ad18511 100644
--- a/src/main/java/net/minecraft/server/BaseBlockPosition.java
+++ b/src/main/java/net/minecraft/server/BaseBlockPosition.java
@@ -99,7 +99,7 @@ public class BaseBlockPosition implements Comparable<BaseBlockPosition> {
@@ -98,8 +98,4 @@ public class BaseBlockPosition implements Comparable<BaseBlockPosition> {
return MoreObjects.toStringHelper(this).add("x", this.getX()).add("y", this.getY()).add("z", this.getZ()).toString();
}
// $FF: synthetic method
- // $FF: synthetic method
- public int compareTo(Object object) {
+ public int compareTo(BaseBlockPosition object) { // Paper - decompile fix
return this.l((BaseBlockPosition)object);
}
- return this.compareTo((BaseBlockPosition)object);
- }
}
diff --git a/src/main/java/net/minecraft/server/BlockPosition.java b/src/main/java/net/minecraft/server/BlockPosition.java
index 7f8802b2e..6ffc53514 100644
index 66c38df1f..50e29464b 100644
--- a/src/main/java/net/minecraft/server/BlockPosition.java
+++ b/src/main/java/net/minecraft/server/BlockPosition.java
@@ -179,7 +179,7 @@ public class BlockPosition extends BaseBlockPosition {
@@ -178,10 +178,6 @@ public class BlockPosition extends BaseBlockPosition {
}
}
// $FF: synthetic method
- // $FF: synthetic method
- protected Object computeNext() {
+ protected BlockPosition computeNext() { // Paper - decompile fix
return this.a();
}
- return this.computeNext();
- }
};
@@ -209,8 +209,11 @@ public class BlockPosition extends BaseBlockPosition {
};
}
@@ -209,8 +205,11 @@ public class BlockPosition extends BaseBlockPosition {
if (this.g.b < l) {
++this.g.b;
} else if (this.g.c < i1) {
@ -42,15 +44,71 @@ index 7f8802b2e..6ffc53514 100644
++this.g.d;
}
@@ -219,7 +222,7 @@ public class BlockPosition extends BaseBlockPosition {
@@ -218,18 +217,10 @@ public class BlockPosition extends BaseBlockPosition {
}
}
// $FF: synthetic method
- // $FF: synthetic method
- protected Object computeNext() {
+ protected BlockPosition.MutableBlockPosition computeNext() { // Paper - decompile fix
return this.a();
}
- return this.computeNext();
- }
};
};
}
- // $FF: synthetic method
- public BaseBlockPosition d(BaseBlockPosition baseblockposition) {
- return this.d(baseblockposition);
- }
public static class MutableBlockPosition extends BlockPosition {
protected int b;
@@ -314,10 +305,6 @@ public class BlockPosition extends BaseBlockPosition {
return new BlockPosition(this);
}
- // $FF: synthetic method
- public BaseBlockPosition d(BaseBlockPosition baseblockposition) {
- return super.d(baseblockposition);
- }
}
public static final class b extends BlockPosition.MutableBlockPosition implements AutoCloseable {
@@ -389,34 +376,5 @@ public class BlockPosition extends BaseBlockPosition {
}
}
- // $FF: synthetic method
- public BlockPosition.MutableBlockPosition d(int i, int j, int k) {
- return this.d(i, j, k);
- }
-
- // $FF: synthetic method
- public BlockPosition.MutableBlockPosition c(EnumDirection enumdirection, int i) {
- return this.c(enumdirection, i);
- }
-
- // $FF: synthetic method
- public BlockPosition.MutableBlockPosition c(EnumDirection enumdirection) {
- return this.c(enumdirection);
- }
-
- // $FF: synthetic method
- public BlockPosition.MutableBlockPosition g(BaseBlockPosition baseblockposition) {
- return this.g(baseblockposition);
- }
-
- // $FF: synthetic method
- public BlockPosition.MutableBlockPosition c(double d0, double d1, double d2) {
- return this.c(d0, d1, d2);
- }
-
- // $FF: synthetic method
- public BlockPosition.MutableBlockPosition c(int i, int j, int k) {
- return this.c(i, j, k);
- }
}
}
diff --git a/src/main/java/net/minecraft/server/DataPaletteBlock.java b/src/main/java/net/minecraft/server/DataPaletteBlock.java
index 3bd0c56d4..304e47bf2 100644
--- a/src/main/java/net/minecraft/server/DataPaletteBlock.java
@ -139,7 +197,7 @@ index 8bfa218a6..e2e60d3ed 100644
arraylist.add(definedstructure$a);
diff --git a/src/main/java/net/minecraft/server/EnchantmentManager.java b/src/main/java/net/minecraft/server/EnchantmentManager.java
index 5c2d50f97..fd6df39f1 100644
index 6695f8d77..e1ea8da88 100644
--- a/src/main/java/net/minecraft/server/EnchantmentManager.java
+++ b/src/main/java/net/minecraft/server/EnchantmentManager.java
@@ -51,7 +51,7 @@ public class EnchantmentManager {
@ -200,76 +258,101 @@ index 04cff50cb..e746a6a0d 100644
EntityAreaEffectCloud entityareaeffectcloud = new EntityAreaEffectCloud(this.world, this.locX, this.locY, this.locZ);
entityareaeffectcloud.setSource(this.shooter);
entityareaeffectcloud.setParticle(Particles.j);
diff --git a/src/main/java/net/minecraft/server/EntityLlama.java b/src/main/java/net/minecraft/server/EntityLlama.java
index 4dee04581..9c48bb3c9 100644
--- a/src/main/java/net/minecraft/server/EntityLlama.java
+++ b/src/main/java/net/minecraft/server/EntityLlama.java
@@ -371,11 +371,6 @@ public class EntityLlama extends EntityHorseChestedAbstract implements IRangedEn
public void s(boolean var1) {
}
- // $FF: synthetic method
- public EntityAgeable createChild(EntityAgeable entityageable) {
- return this.createChild(entityageable);
- }
-
static class a extends PathfinderGoalNearestAttackableTarget<EntityWolf> {
public a(EntityLlama entityllama) {
super(entityllama, EntityWolf.class, 16, false, true, (Predicate)null);
diff --git a/src/main/java/net/minecraft/server/EnumDirection.java b/src/main/java/net/minecraft/server/EnumDirection.java
index 38c85f4ab..c0853f0fc 100644
index 23ca6fc50..44c91ba26 100644
--- a/src/main/java/net/minecraft/server/EnumDirection.java
+++ b/src/main/java/net/minecraft/server/EnumDirection.java
@@ -233,7 +233,7 @@ public enum EnumDirection implements INamable {
@@ -232,10 +232,6 @@ public enum EnumDirection implements INamable {
return d0;
}
// $FF: synthetic method
- // $FF: synthetic method
- public boolean test(@Nullable Object object) {
+ public boolean test(@Nullable EnumDirection object) { // Paper - decompile fix
return super.a((EnumDirection)object);
}
- return super.test((EnumDirection)object);
- }
},
@@ -247,7 +247,7 @@ public enum EnumDirection implements INamable {
Y("y") {
public int a(int var1, int i, int var3) {
@@ -246,10 +242,6 @@ public enum EnumDirection implements INamable {
return d0;
}
// $FF: synthetic method
- // $FF: synthetic method
- public boolean test(@Nullable Object object) {
+ public boolean test(@Nullable EnumDirection object) { // Paper - decompile fix
return super.a((EnumDirection)object);
}
- return super.test((EnumDirection)object);
- }
},
@@ -261,7 +261,7 @@ public enum EnumDirection implements INamable {
Z("z") {
public int a(int var1, int var2, int i) {
@@ -260,10 +252,6 @@ public enum EnumDirection implements INamable {
return d0;
}
// $FF: synthetic method
- // $FF: synthetic method
- public boolean test(@Nullable Object object) {
+ public boolean test(@Nullable EnumDirection object) { // Paper - decompile fix
return super.a((EnumDirection)object);
}
- return super.test((EnumDirection)object);
- }
};
@@ -316,7 +316,7 @@ public enum EnumDirection implements INamable {
private static final Map<String, EnumDirection.EnumAxis> d = (Map)Arrays.stream(values()).collect(Collectors.toMap(EnumDirection.EnumAxis::a, (enumdirection$enumaxis) -> {
@@ -315,10 +303,6 @@ public enum EnumDirection implements INamable {
public abstract double a(double var1, double var3, double var5);
// $FF: synthetic method
- // $FF: synthetic method
- public boolean test(@Nullable Object object) {
+ public boolean test(@Nullable EnumDirection object) { // Paper - decompile fix
return this.a((EnumDirection)object);
}
- return this.test((EnumDirection)object);
- }
}
@@ -367,7 +367,7 @@ public enum EnumDirection implements INamable {
public static enum EnumAxisDirection {
@@ -366,9 +350,5 @@ public enum EnumDirection implements INamable {
return Iterators.forArray(this.c);
}
// $FF: synthetic method
- // $FF: synthetic method
- public boolean test(@Nullable Object object) {
+ public boolean test(@Nullable EnumDirection object) { // Paper - decompile fix
return this.a((EnumDirection)object);
}
- return this.test((EnumDirection)object);
- }
}
}
diff --git a/src/main/java/net/minecraft/server/IChatBaseComponent.java b/src/main/java/net/minecraft/server/IChatBaseComponent.java
index 3f5d6c323..286c1b14f 100644
index 0e0571a6c..8fc45c697 100644
--- a/src/main/java/net/minecraft/server/IChatBaseComponent.java
+++ b/src/main/java/net/minecraft/server/IChatBaseComponent.java
@@ -390,12 +390,12 @@ public interface IChatBaseComponent extends Message, Iterable<IChatBaseComponent
@@ -389,14 +389,5 @@ public interface IChatBaseComponent extends Message, Iterable<IChatBaseComponent
}
}
// $FF: synthetic method
- // $FF: synthetic method
- public JsonElement serialize(Object object, Type type, JsonSerializationContext jsonserializationcontext) {
+ public JsonElement serialize(IChatBaseComponent object, Type type, JsonSerializationContext jsonserializationcontext) { // Paper - decompile fix
return this.a((IChatBaseComponent)object, type, jsonserializationcontext);
}
// $FF: synthetic method
- return this.serialize((IChatBaseComponent)object, type, jsonserializationcontext);
- }
-
- // $FF: synthetic method
- public Object deserialize(JsonElement jsonelement, Type type, JsonDeserializationContext jsondeserializationcontext) throws JsonParseException {
+ public IChatBaseComponent deserialize(JsonElement jsonelement, Type type, JsonDeserializationContext jsondeserializationcontext) throws JsonParseException { // Paper - decompile fix
return this.a(jsonelement, type, jsondeserializationcontext);
}
- return this.deserialize(jsonelement, type, jsondeserializationcontext);
- }
}
}
diff --git a/src/main/java/net/minecraft/server/LocaleLanguage.java b/src/main/java/net/minecraft/server/LocaleLanguage.java
index 0c9249cd8..0648c76a0 100644
index 4157fcea3..ba03b9dcc 100644
--- a/src/main/java/net/minecraft/server/LocaleLanguage.java
+++ b/src/main/java/net/minecraft/server/LocaleLanguage.java
@@ -27,7 +27,7 @@ public class LocaleLanguage {
@ -282,24 +365,24 @@ index 0c9249cd8..0648c76a0 100644
this.d.put(entry.getKey(), s);
}
diff --git a/src/main/java/net/minecraft/server/LootSelectorEntry.java b/src/main/java/net/minecraft/server/LootSelectorEntry.java
index 9d01b70c7..8daccdd6e 100644
index 252b0f3ed..86df2b969 100644
--- a/src/main/java/net/minecraft/server/LootSelectorEntry.java
+++ b/src/main/java/net/minecraft/server/LootSelectorEntry.java
@@ -83,12 +83,12 @@ public abstract class LootSelectorEntry {
@@ -82,14 +82,5 @@ public abstract class LootSelectorEntry {
return jsonobject;
}
// $FF: synthetic method
- // $FF: synthetic method
- public JsonElement serialize(Object object, Type type, JsonSerializationContext jsonserializationcontext) {
+ public JsonElement serialize(LootSelectorEntry object, Type type, JsonSerializationContext jsonserializationcontext) {// Paper - Decompile fix
return this.a((LootSelectorEntry)object, type, jsonserializationcontext);
}
// $FF: synthetic method
- return this.serialize((LootSelectorEntry)object, type, jsonserializationcontext);
- }
-
- // $FF: synthetic method
- public Object deserialize(JsonElement jsonelement, Type type, JsonDeserializationContext jsondeserializationcontext) throws JsonParseException {
+ public LootSelectorEntry deserialize(JsonElement jsonelement, Type type, JsonDeserializationContext jsondeserializationcontext) throws JsonParseException {// Paper - Decompile fix
return this.a(jsonelement, type, jsondeserializationcontext);
}
- return this.deserialize(jsonelement, type, jsondeserializationcontext);
- }
}
}
diff --git a/src/main/java/net/minecraft/server/NBTBase.java b/src/main/java/net/minecraft/server/NBTBase.java
index 48d04b540..de9168a9c 100644
--- a/src/main/java/net/minecraft/server/NBTBase.java
@ -337,7 +420,7 @@ index 456b5f492..54f2935c0 100644
+ // Paper end- Decompile fix
}
diff --git a/src/main/java/net/minecraft/server/NBTTagByteArray.java b/src/main/java/net/minecraft/server/NBTTagByteArray.java
index 86881a22d..81ff1fd69 100644
index 973f28cc5..21a6f488a 100644
--- a/src/main/java/net/minecraft/server/NBTTagByteArray.java
+++ b/src/main/java/net/minecraft/server/NBTTagByteArray.java
@@ -66,7 +66,8 @@ public class NBTTagByteArray extends NBTList<NBTTagByte> {
@ -350,21 +433,8 @@ index 86881a22d..81ff1fd69 100644
byte[] abyte = new byte[this.data.length];
System.arraycopy(this.data, 0, abyte, 0, this.data.length);
diff --git a/src/main/java/net/minecraft/server/NBTTagIntArray.java b/src/main/java/net/minecraft/server/NBTTagIntArray.java
index 40f6179cd..ebc44ec9e 100644
--- a/src/main/java/net/minecraft/server/NBTTagIntArray.java
+++ b/src/main/java/net/minecraft/server/NBTTagIntArray.java
@@ -132,7 +132,7 @@ public class NBTTagIntArray extends NBTList<NBTTagInt> {
return this.a(i);
}
- public NBTBase clone() {
+ public NBTTagIntArray clone() { // Paper - decompile fix
return this.c();
}
}
diff --git a/src/main/java/net/minecraft/server/NBTTagList.java b/src/main/java/net/minecraft/server/NBTTagList.java
index 24a66f95a..2e7c96056 100644
index 8e6cce15f..1b72df8cd 100644
--- a/src/main/java/net/minecraft/server/NBTTagList.java
+++ b/src/main/java/net/minecraft/server/NBTTagList.java
@@ -12,7 +12,7 @@ import org.apache.logging.log4j.Logger;
@ -376,32 +446,56 @@ index 24a66f95a..2e7c96056 100644
private byte type = 0;
public NBTTagList() {
@@ -286,6 +286,7 @@ public class NBTTagList extends NBTList<NBTBase> {
return this.c();
@@ -281,11 +281,7 @@ public class NBTTagList extends NBTList<NBTBase> {
return this.type;
}
- // $FF: synthetic method
- public NBTBase clone() {
- return this.clone();
- }
-
+ /* // Paper start - Decompile fix
// $FF: synthetic method
public Object remove(int i) {
return this.remove(i);
@@ -305,4 +306,5 @@ public class NBTTagList extends NBTList<NBTBase> {
@@ -305,4 +301,5 @@ public class NBTTagList extends NBTList<NBTBase> {
public boolean add(Object object) {
return this.add((NBTBase)object);
}
+ */ // Paper end - Decompile fix
}
diff --git a/src/main/java/net/minecraft/server/PacketEncoder.java b/src/main/java/net/minecraft/server/PacketEncoder.java
index 113e8780a..8e312c761 100644
index a717ad95f..ff7e20dfc 100644
--- a/src/main/java/net/minecraft/server/PacketEncoder.java
+++ b/src/main/java/net/minecraft/server/PacketEncoder.java
@@ -49,7 +49,7 @@ public class PacketEncoder extends MessageToByteEncoder<Packet<?>> {
@@ -48,8 +48,4 @@ public class PacketEncoder extends MessageToByteEncoder<Packet<?>> {
}
}
// $FF: synthetic method
- // $FF: synthetic method
- protected void encode(ChannelHandlerContext channelhandlercontext, Object object, ByteBuf bytebuf) throws Exception {
+ protected void encode(ChannelHandlerContext channelhandlercontext, Packet<?> object, ByteBuf bytebuf) throws Exception { // Paper - decompiler fix
this.a(channelhandlercontext, (Packet)object, bytebuf);
- this.encode(channelhandlercontext, (Packet)object, bytebuf);
- }
}
diff --git a/src/main/java/net/minecraft/server/ProtoChunk.java b/src/main/java/net/minecraft/server/ProtoChunk.java
index 8bc7c0ccd..faaad0f41 100644
--- a/src/main/java/net/minecraft/server/ProtoChunk.java
+++ b/src/main/java/net/minecraft/server/ProtoChunk.java
@@ -483,14 +483,4 @@ public class ProtoChunk implements IChunkAccess {
public void b(boolean flag) {
this.u = flag;
}
-
- // $FF: synthetic method
- public TickList l() {
- return this.l();
- }
-
- // $FF: synthetic method
- public TickList k() {
- return this.k();
- }
}
diff --git a/src/main/java/net/minecraft/server/Registry.java b/src/main/java/net/minecraft/server/Registry.java
index 5be9f0ff2..9efec49d6 100644
@ -444,67 +538,93 @@ index 03c603362..d03ac0e70 100644
this.b = (K[])(new Object[i]);
this.c = new int[i];
diff --git a/src/main/java/net/minecraft/server/ServerPing.java b/src/main/java/net/minecraft/server/ServerPing.java
index 7b8a8064b..615aa2cd0 100644
index 364dadfbd..c338d09bf 100644
--- a/src/main/java/net/minecraft/server/ServerPing.java
+++ b/src/main/java/net/minecraft/server/ServerPing.java
@@ -101,12 +101,12 @@ public class ServerPing {
@@ -100,15 +100,6 @@ public class ServerPing {
return jsonobject;
}
// $FF: synthetic method
- // $FF: synthetic method
- public JsonElement serialize(Object object, Type type, JsonSerializationContext jsonserializationcontext) {
+ public JsonElement serialize(ServerPing object, Type type, JsonSerializationContext jsonserializationcontext) {// Paper - Decompile fix
return this.a((ServerPing)object, type, jsonserializationcontext);
}
// $FF: synthetic method
- return this.serialize((ServerPing)object, type, jsonserializationcontext);
- }
-
- // $FF: synthetic method
- public Object deserialize(JsonElement jsonelement, Type type, JsonDeserializationContext jsondeserializationcontext) throws JsonParseException {
+ public ServerPing deserialize(JsonElement jsonelement, Type type, JsonDeserializationContext jsondeserializationcontext) throws JsonParseException {// Paper - Decompile fix
return this.a(jsonelement, type, jsondeserializationcontext);
- return this.deserialize(jsonelement, type, jsondeserializationcontext);
- }
}
public static class ServerData {
@@ -144,15 +135,6 @@ public class ServerPing {
return jsonobject;
}
- // $FF: synthetic method
- public JsonElement serialize(Object object, Type type, JsonSerializationContext jsonserializationcontext) {
- return this.serialize((ServerPing.ServerData)object, type, jsonserializationcontext);
- }
-
- // $FF: synthetic method
- public Object deserialize(JsonElement jsonelement, Type type, JsonDeserializationContext jsondeserializationcontext) throws JsonParseException {
- return this.deserialize(jsonelement, type, jsondeserializationcontext);
- }
}
}
@@ -145,12 +145,12 @@ public class ServerPing {
@@ -228,15 +210,6 @@ public class ServerPing {
return jsonobject;
}
// $FF: synthetic method
- // $FF: synthetic method
- public JsonElement serialize(Object object, Type type, JsonSerializationContext jsonserializationcontext) {
+ public JsonElement serialize(ServerPing.ServerData object, Type type, JsonSerializationContext jsonserializationcontext) {// Paper - Decompile fix
return this.a((ServerPing.ServerData)object, type, jsonserializationcontext);
}
// $FF: synthetic method
- return this.serialize((ServerPing.ServerPingPlayerSample)object, type, jsonserializationcontext);
- }
-
- // $FF: synthetic method
- public Object deserialize(JsonElement jsonelement, Type type, JsonDeserializationContext jsondeserializationcontext) throws JsonParseException {
+ public ServerPing.ServerData deserialize(JsonElement jsonelement, Type type, JsonDeserializationContext jsondeserializationcontext) throws JsonParseException {// Paper - Decompile fix
return this.a(jsonelement, type, jsondeserializationcontext);
}
}
@@ -229,12 +229,12 @@ public class ServerPing {
}
// $FF: synthetic method
- public JsonElement serialize(Object object, Type type, JsonSerializationContext jsonserializationcontext) {
+ public JsonElement serialize(ServerPing.ServerPingPlayerSample object, Type type, JsonSerializationContext jsonserializationcontext) {// Paper - Decompile fix
return this.a((ServerPing.ServerPingPlayerSample)object, type, jsonserializationcontext);
}
// $FF: synthetic method
- public Object deserialize(JsonElement jsonelement, Type type, JsonDeserializationContext jsondeserializationcontext) throws JsonParseException {
+ public ServerPing.ServerPingPlayerSample deserialize(JsonElement jsonelement, Type type, JsonDeserializationContext jsondeserializationcontext) throws JsonParseException {// Paper - Decompile fix
return this.a(jsonelement, type, jsondeserializationcontext);
}
- return this.deserialize(jsonelement, type, jsondeserializationcontext);
- }
}
}
}
diff --git a/src/main/java/net/minecraft/server/ShapeDetector.java b/src/main/java/net/minecraft/server/ShapeDetector.java
index ef9d8e06f..0c9910d9a 100644
index 475bf35fa..78234cbdd 100644
--- a/src/main/java/net/minecraft/server/ShapeDetector.java
+++ b/src/main/java/net/minecraft/server/ShapeDetector.java
@@ -107,7 +107,7 @@ public class ShapeDetector {
@@ -106,10 +106,6 @@ public class ShapeDetector {
return new ShapeDetectorBlock(this.a, blockposition, this.b);
}
// $FF: synthetic method
- // $FF: synthetic method
- public Object load(Object object) throws Exception {
+ public ShapeDetectorBlock load(BlockPosition object) throws Exception {// Paper - Decompile fix
return this.a((BlockPosition)object);
}
- return this.load((BlockPosition)object);
- }
}
public static class ShapeDetectorCollection {
diff --git a/src/main/java/net/minecraft/server/WorldPersistentData.java b/src/main/java/net/minecraft/server/WorldPersistentData.java
index c1bbacfc1..f0a826cd1 100644
--- a/src/main/java/net/minecraft/server/WorldPersistentData.java
+++ b/src/main/java/net/minecraft/server/WorldPersistentData.java
@@ -7,6 +7,7 @@ import it.unimi.dsi.fastutil.objects.Object2IntOpenHashMap;
import it.unimi.dsi.fastutil.objects.ObjectIterator;
import it.unimi.dsi.fastutil.objects.Object2IntMap.Entry;
import java.io.DataInputStream;
+import java.io.DataOutput;
import java.io.DataOutputStream;
import java.io.File;
import java.io.FileInputStream;
@@ -98,7 +99,7 @@ public class WorldPersistentData {
}
DataOutputStream dataoutputstream = new DataOutputStream(new FileOutputStream(file1));
- NBTCompressedStreamTools.a(nbttagcompound, dataoutputstream);
+ NBTCompressedStreamTools.a(nbttagcompound, (DataOutput) dataoutputstream); // Paper - decompile fix
dataoutputstream.close();
}
} catch (Exception exception) {
--
2.19.2
2.20.0

Datei anzeigen

@ -1,11 +1,11 @@
From 7ac07ac07ac07ac07ac07ac07ac07ac07ac07ac0 Mon Sep 17 00:00:00 2001
From 6fa007b705e027301b61812c60b75dab498a177b Mon Sep 17 00:00:00 2001
From: Aikar <aikar@aikar.co>
Date: Mon, 28 Mar 2016 20:55:47 -0400
Subject: [PATCH] MC Utils
diff --git a/src/main/java/net/minecraft/server/AttributeInstance.java b/src/main/java/net/minecraft/server/AttributeInstance.java
index 7ac07ac07ac0..7ac07ac07ac0 100644
index 1c1a6a37a..0929e0189 100644
--- a/src/main/java/net/minecraft/server/AttributeInstance.java
+++ b/src/main/java/net/minecraft/server/AttributeInstance.java
@@ -20,8 +20,10 @@ public interface AttributeInstance {
@ -20,7 +20,7 @@ index 7ac07ac07ac0..7ac07ac07ac0 100644
void b(UUID var1);
diff --git a/src/main/java/net/minecraft/server/BlockPosition.java b/src/main/java/net/minecraft/server/BlockPosition.java
index 7ac07ac07ac0..7ac07ac07ac0 100644
index 50e29464b..880ce16b1 100644
--- a/src/main/java/net/minecraft/server/BlockPosition.java
+++ b/src/main/java/net/minecraft/server/BlockPosition.java
@@ -9,7 +9,7 @@ import org.apache.logging.log4j.Logger;
@ -40,7 +40,7 @@ index 7ac07ac07ac0..7ac07ac07ac0 100644
public BlockPosition a(int ix, int jx, int kx) {
return ix == 0 && jx == 0 && kx == 0 ? this : new BlockPosition(this.getX() + ix, this.getY() + jx, this.getZ() + kx);
}
@@ -186,6 +187,7 @@ public class BlockPosition extends BaseBlockPosition {
@@ -182,6 +183,7 @@ public class BlockPosition extends BaseBlockPosition {
};
}
@ -48,7 +48,7 @@ index 7ac07ac07ac0..7ac07ac07ac0 100644
public BlockPosition h() {
return this;
}
@@ -282,6 +284,7 @@ public class BlockPosition extends BaseBlockPosition {
@@ -270,6 +272,7 @@ public class BlockPosition extends BaseBlockPosition {
return this.d;
}
@ -56,7 +56,7 @@ index 7ac07ac07ac0..7ac07ac07ac0 100644
public BlockPosition.MutableBlockPosition c(int i, int j, int k) {
this.b = i;
this.c = j;
@@ -289,6 +292,7 @@ public class BlockPosition extends BaseBlockPosition {
@@ -277,6 +280,7 @@ public class BlockPosition extends BaseBlockPosition {
return this;
}
@ -65,10 +65,10 @@ index 7ac07ac07ac0..7ac07ac07ac0 100644
return this.c(MathHelper.floor(d0), MathHelper.floor(d1), MathHelper.floor(d2));
}
diff --git a/src/main/java/net/minecraft/server/Chunk.java b/src/main/java/net/minecraft/server/Chunk.java
index 7ac07ac07ac0..7ac07ac07ac0 100644
index 773a8c52d..5dd08018c 100644
--- a/src/main/java/net/minecraft/server/Chunk.java
+++ b/src/main/java/net/minecraft/server/Chunk.java
@@ -27,7 +27,7 @@ import com.google.common.collect.Lists; // CraftBukkit
@@ -32,7 +32,7 @@ import org.bukkit.event.entity.CreatureSpawnEvent;
public class Chunk implements IChunkAccess {
private static final Logger d = LogManager.getLogger();
@ -77,7 +77,7 @@ index 7ac07ac07ac0..7ac07ac07ac0 100644
private final ChunkSection[] sections;
private final BiomeBase[] f;
private final boolean[] g;
@@ -700,6 +700,7 @@ public class Chunk implements IChunkAccess {
@@ -705,6 +705,7 @@ public class Chunk implements IChunkAccess {
return this.a(blockposition, Chunk.EnumTileEntityState.CHECK);
}
@ -86,7 +86,7 @@ index 7ac07ac07ac0..7ac07ac07ac0 100644
public TileEntity a(BlockPosition blockposition, Chunk.EnumTileEntityState chunk_enumtileentitystate) {
// CraftBukkit start
diff --git a/src/main/java/net/minecraft/server/ChunkCoordIntPair.java b/src/main/java/net/minecraft/server/ChunkCoordIntPair.java
index 7ac07ac07ac0..7ac07ac07ac0 100644
index 744762b8b..d9608121b 100644
--- a/src/main/java/net/minecraft/server/ChunkCoordIntPair.java
+++ b/src/main/java/net/minecraft/server/ChunkCoordIntPair.java
@@ -23,6 +23,8 @@ public class ChunkCoordIntPair {
@ -99,7 +99,7 @@ index 7ac07ac07ac0..7ac07ac07ac0 100644
return (long)i & 4294967295L | ((long)j & 4294967295L) << 32;
}
diff --git a/src/main/java/net/minecraft/server/ChunkTaskScheduler.java b/src/main/java/net/minecraft/server/ChunkTaskScheduler.java
index 7ac07ac07ac0..7ac07ac07ac0 100644
index 3919c1fba..772382144 100644
--- a/src/main/java/net/minecraft/server/ChunkTaskScheduler.java
+++ b/src/main/java/net/minecraft/server/ChunkTaskScheduler.java
@@ -16,7 +16,7 @@ import org.apache.logging.log4j.Logger;
@ -112,7 +112,7 @@ index 7ac07ac07ac0..7ac07ac07ac0 100644
private final IChunkLoader e;
private final IAsyncTaskHandler f;
diff --git a/src/main/java/net/minecraft/server/DataBits.java b/src/main/java/net/minecraft/server/DataBits.java
index 7ac07ac07ac0..7ac07ac07ac0 100644
index 95ca5f6d8..0dc948a37 100644
--- a/src/main/java/net/minecraft/server/DataBits.java
+++ b/src/main/java/net/minecraft/server/DataBits.java
@@ -54,6 +54,7 @@ public class DataBits {
@ -124,7 +124,7 @@ index 7ac07ac07ac0..7ac07ac07ac0 100644
return this.a;
}
diff --git a/src/main/java/net/minecraft/server/DataPalette.java b/src/main/java/net/minecraft/server/DataPalette.java
index 7ac07ac07ac0..7ac07ac07ac0 100644
index 7f905b1e0..fa5b9262b 100644
--- a/src/main/java/net/minecraft/server/DataPalette.java
+++ b/src/main/java/net/minecraft/server/DataPalette.java
@@ -3,10 +3,11 @@ package net.minecraft.server;
@ -142,7 +142,7 @@ index 7ac07ac07ac0..7ac07ac07ac0 100644
void b(PacketDataSerializer var1);
diff --git a/src/main/java/net/minecraft/server/DataPaletteBlock.java b/src/main/java/net/minecraft/server/DataPaletteBlock.java
index 7ac07ac07ac0..7ac07ac07ac0 100644
index 304e47bf2..6e7454b13 100644
--- a/src/main/java/net/minecraft/server/DataPaletteBlock.java
+++ b/src/main/java/net/minecraft/server/DataPaletteBlock.java
@@ -7,7 +7,7 @@ import java.util.function.Function;
@ -184,7 +184,7 @@ index 7ac07ac07ac0..7ac07ac07ac0 100644
this.b();
packetdataserializer.writeByte(this.i);
diff --git a/src/main/java/net/minecraft/server/EntityCreature.java b/src/main/java/net/minecraft/server/EntityCreature.java
index 7ac07ac07ac0..7ac07ac07ac0 100644
index 372afbe94..20b7c2c6d 100644
--- a/src/main/java/net/minecraft/server/EntityCreature.java
+++ b/src/main/java/net/minecraft/server/EntityCreature.java
@@ -6,6 +6,7 @@ import org.bukkit.event.entity.EntityUnleashEvent;
@ -196,7 +196,7 @@ index 7ac07ac07ac0..7ac07ac07ac0 100644
private float b;
diff --git a/src/main/java/net/minecraft/server/EntityInsentient.java b/src/main/java/net/minecraft/server/EntityInsentient.java
index 7ac07ac07ac0..7ac07ac07ac0 100644
index 550c7a355..b039ff1b5 100644
--- a/src/main/java/net/minecraft/server/EntityInsentient.java
+++ b/src/main/java/net/minecraft/server/EntityInsentient.java
@@ -124,6 +124,7 @@ public abstract class EntityInsentient extends EntityLiving {
@ -208,7 +208,7 @@ index 7ac07ac07ac0..7ac07ac07ac0 100644
// CraftBukkit start - fire event
setGoalTarget(entityliving, EntityTargetEvent.TargetReason.UNKNOWN, true);
diff --git a/src/main/java/net/minecraft/server/EntityLiving.java b/src/main/java/net/minecraft/server/EntityLiving.java
index 7ac07ac07ac0..7ac07ac07ac0 100644
index 341af9c16..14c481220 100644
--- a/src/main/java/net/minecraft/server/EntityLiving.java
+++ b/src/main/java/net/minecraft/server/EntityLiving.java
@@ -122,6 +122,7 @@ public abstract class EntityLiving extends Entity {
@ -220,7 +220,7 @@ index 7ac07ac07ac0..7ac07ac07ac0 100644
@Override
public float getBukkitYaw() {
diff --git a/src/main/java/net/minecraft/server/EntityMonster.java b/src/main/java/net/minecraft/server/EntityMonster.java
index 7ac07ac07ac0..7ac07ac07ac0 100644
index c9e596367..70830bbf4 100644
--- a/src/main/java/net/minecraft/server/EntityMonster.java
+++ b/src/main/java/net/minecraft/server/EntityMonster.java
@@ -1,11 +1,14 @@
@ -239,7 +239,7 @@ index 7ac07ac07ac0..7ac07ac07ac0 100644
return SoundCategory.HOSTILE;
}
diff --git a/src/main/java/net/minecraft/server/EntityTypes.java b/src/main/java/net/minecraft/server/EntityTypes.java
index 7ac07ac07ac0..7ac07ac07ac0 100644
index bcdc790ba..339abdc01 100644
--- a/src/main/java/net/minecraft/server/EntityTypes.java
+++ b/src/main/java/net/minecraft/server/EntityTypes.java
@@ -3,6 +3,7 @@ package net.minecraft.server;
@ -290,7 +290,7 @@ index 7ac07ac07ac0..7ac07ac07ac0 100644
// Paper end
}
diff --git a/src/main/java/net/minecraft/server/ItemStack.java b/src/main/java/net/minecraft/server/ItemStack.java
index 7ac07ac07ac0..7ac07ac07ac0 100644
index ac081d230..faae6d09d 100644
--- a/src/main/java/net/minecraft/server/ItemStack.java
+++ b/src/main/java/net/minecraft/server/ItemStack.java
@@ -26,6 +26,7 @@ import org.bukkit.TreeType;
@ -321,7 +321,7 @@ index 7ac07ac07ac0..7ac07ac07ac0 100644
}
diff --git a/src/main/java/net/minecraft/server/MCUtil.java b/src/main/java/net/minecraft/server/MCUtil.java
new file mode 100644
index 7ac07ac07ac0..7ac07ac07ac0
index 000000000..c97e116aa
--- /dev/null
+++ b/src/main/java/net/minecraft/server/MCUtil.java
@@ -0,0 +1,316 @@
@ -642,7 +642,7 @@ index 7ac07ac07ac0..7ac07ac07ac0
+ }
+}
diff --git a/src/main/java/net/minecraft/server/NBTTagCompound.java b/src/main/java/net/minecraft/server/NBTTagCompound.java
index 7ac07ac07ac0..7ac07ac07ac0 100644
index 447b56323..db4e4b859 100644
--- a/src/main/java/net/minecraft/server/NBTTagCompound.java
+++ b/src/main/java/net/minecraft/server/NBTTagCompound.java
@@ -23,7 +23,7 @@ import org.apache.logging.log4j.Logger;
@ -687,18 +687,18 @@ index 7ac07ac07ac0..7ac07ac07ac0 100644
}
}
diff --git a/src/main/java/net/minecraft/server/NetworkManager.java b/src/main/java/net/minecraft/server/NetworkManager.java
index 7ac07ac07ac0..7ac07ac07ac0 100644
index db52ffad4..d5bbc5f8e 100644
--- a/src/main/java/net/minecraft/server/NetworkManager.java
+++ b/src/main/java/net/minecraft/server/NetworkManager.java
@@ -44,7 +44,7 @@ public class NetworkManager extends SimpleChannelInboundHandler<Packet<?>> {
return new DefaultEventLoopGroup(0, (new ThreadFactoryBuilder()).setNameFormat("Netty Local Client IO #%d").setDaemon(true).build());
});
private final EnumProtocolDirection h;
- private final Queue<NetworkManager.QueuedPacket> i = Queues.newConcurrentLinkedQueue();
+ private final Queue<NetworkManager.QueuedPacket> i = Queues.newConcurrentLinkedQueue(); private final Queue<NetworkManager.QueuedPacket> getPacketQueue() { return this.i; } // Paper - OBFHELPER
- private final Queue<NetworkManager.QueuedPacket> packetQueue = Queues.newConcurrentLinkedQueue();
+ private final Queue<NetworkManager.QueuedPacket> packetQueue = Queues.newConcurrentLinkedQueue(); private final Queue<NetworkManager.QueuedPacket> getPacketQueue() { return this.packetQueue; } // Paper - OBFHELPER
private final ReentrantReadWriteLock j = new ReentrantReadWriteLock();
public Channel channel;
// Spigot Start // PAIL
public SocketAddress socketAddress;
@@ -168,6 +168,7 @@ public class NetworkManager extends SimpleChannelInboundHandler<Packet<?>> {
}
@ -715,7 +715,7 @@ index 7ac07ac07ac0..7ac07ac07ac0 100644
private void o() {
if (this.channel != null && this.channel.isOpen()) {
this.j.readLock().lock();
@@ -338,9 +340,9 @@ public class NetworkManager extends SimpleChannelInboundHandler<Packet<?>> {
@@ -334,9 +336,9 @@ public class NetworkManager extends SimpleChannelInboundHandler<Packet<?>> {
static class QueuedPacket {
@ -728,7 +728,7 @@ index 7ac07ac07ac0..7ac07ac07ac0 100644
public QueuedPacket(Packet<?> packet, @Nullable GenericFutureListener<? extends Future<? super Void>> genericfuturelistener) {
this.a = packet;
diff --git a/src/main/java/net/minecraft/server/PacketDataSerializer.java b/src/main/java/net/minecraft/server/PacketDataSerializer.java
index 7ac07ac07ac0..7ac07ac07ac0 100644
index 7582151ae..d05f1e02c 100644
--- a/src/main/java/net/minecraft/server/PacketDataSerializer.java
+++ b/src/main/java/net/minecraft/server/PacketDataSerializer.java
@@ -33,6 +33,7 @@ public class PacketDataSerializer extends ByteBuf {
@ -740,7 +740,7 @@ index 7ac07ac07ac0..7ac07ac07ac0 100644
for (int j = 1; j < 5; ++j) {
if ((i & -1 << j * 7) == 0) {
diff --git a/src/main/java/net/minecraft/server/PacketEncoder.java b/src/main/java/net/minecraft/server/PacketEncoder.java
index 7ac07ac07ac0..7ac07ac07ac0 100644
index ff7e20dfc..3448f6c53 100644
--- a/src/main/java/net/minecraft/server/PacketEncoder.java
+++ b/src/main/java/net/minecraft/server/PacketEncoder.java
@@ -38,6 +38,7 @@ public class PacketEncoder extends MessageToByteEncoder<Packet<?>> {
@ -752,7 +752,7 @@ index 7ac07ac07ac0..7ac07ac07ac0 100644
throw new SkipEncodeException(throwable);
} else {
diff --git a/src/main/java/net/minecraft/server/PacketPlayOutMapChunk.java b/src/main/java/net/minecraft/server/PacketPlayOutMapChunk.java
index 7ac07ac07ac0..7ac07ac07ac0 100644
index 12d6c99cf..af382815f 100644
--- a/src/main/java/net/minecraft/server/PacketPlayOutMapChunk.java
+++ b/src/main/java/net/minecraft/server/PacketPlayOutMapChunk.java
@@ -11,7 +11,7 @@ public class PacketPlayOutMapChunk implements Packet<PacketListenerPlayOut> {
@ -773,24 +773,24 @@ index 7ac07ac07ac0..7ac07ac07ac0 100644
int j = 0;
ChunkSection[] achunksection = chunk.getSections();
diff --git a/src/main/java/net/minecraft/server/PlayerConnection.java b/src/main/java/net/minecraft/server/PlayerConnection.java
index 7ac07ac07ac0..7ac07ac07ac0 100644
index bbc8c0007..2b6c797ce 100644
--- a/src/main/java/net/minecraft/server/PlayerConnection.java
+++ b/src/main/java/net/minecraft/server/PlayerConnection.java
@@ -68,9 +68,9 @@ public class PlayerConnection implements PacketListenerPlayIn, ITickable {
private final MinecraftServer minecraftServer;
public EntityPlayer player;
private int e;
- private long f;
- private boolean g;
- private long lastKeepAlive;
- private boolean awaitingKeepAlive;
- private long h;
+ private long f; private void setLastPing(long lastPing) { this.f = lastPing;}; private long getLastPing() { return this.f;}; // Paper - OBFHELPER
+ private boolean g; private void setPendingPing(boolean isPending) { this.g = isPending;}; private boolean isPendingPing() { return this.g;}; // Paper - OBFHELPER
+ private long lastKeepAlive; private void setLastPing(long lastPing) { this.lastKeepAlive = lastPing;}; private long getLastPing() { return this.lastKeepAlive;}; // Paper - OBFHELPER
+ private boolean awaitingKeepAlive; private void setPendingPing(boolean isPending) { this.awaitingKeepAlive = isPending;}; private boolean isPendingPing() { return this.awaitingKeepAlive;}; // Paper - OBFHELPER
+ private long h; private void setKeepAliveID(long keepAliveID) { this.h = keepAliveID;}; private long getKeepAliveID() {return this.h; }; // Paper - OBFHELPER
// CraftBukkit start - multithreaded fields
private volatile int chatThrottle;
private static final AtomicIntegerFieldUpdater chatSpamField = AtomicIntegerFieldUpdater.newUpdater(PlayerConnection.class, "chatThrottle");
diff --git a/src/main/java/net/minecraft/server/PotionUtil.java b/src/main/java/net/minecraft/server/PotionUtil.java
index 7ac07ac07ac0..7ac07ac07ac0 100644
index 8fce3b022..58ac6eafc 100644
--- a/src/main/java/net/minecraft/server/PotionUtil.java
+++ b/src/main/java/net/minecraft/server/PotionUtil.java
@@ -103,6 +103,7 @@ public class PotionUtil {
@ -802,7 +802,7 @@ index 7ac07ac07ac0..7ac07ac07ac0 100644
MinecraftKey minecraftkey = IRegistry.POTION.getKey(potionregistry);
if (potionregistry == Potions.EMPTY) {
diff --git a/src/main/java/net/minecraft/server/RegistryBlockID.java b/src/main/java/net/minecraft/server/RegistryBlockID.java
index 7ac07ac07ac0..7ac07ac07ac0 100644
index a21006290..6c6f006f3 100644
--- a/src/main/java/net/minecraft/server/RegistryBlockID.java
+++ b/src/main/java/net/minecraft/server/RegistryBlockID.java
@@ -54,6 +54,7 @@ public class RegistryBlockID<T> implements Registry<T> {
@ -814,7 +814,7 @@ index 7ac07ac07ac0..7ac07ac07ac0 100644
return this.b.size();
}
diff --git a/src/main/java/net/minecraft/server/SystemUtils.java b/src/main/java/net/minecraft/server/SystemUtils.java
index 7ac07ac07ac0..7ac07ac07ac0 100644
index 25d4907b3..1f6de76a7 100644
--- a/src/main/java/net/minecraft/server/SystemUtils.java
+++ b/src/main/java/net/minecraft/server/SystemUtils.java
@@ -34,8 +34,8 @@ public class SystemUtils {
@ -828,20 +828,15 @@ index 7ac07ac07ac0..7ac07ac07ac0 100644
}
public static String a(String s, @Nullable MinecraftKey minecraftkey) {
@@ -43,11 +43,11 @@ public class SystemUtils {
@@ -47,7 +47,7 @@ public class SystemUtils {
}
public static long b() {
- return c() / 1000000L;
+ return System.nanoTime() / 1000000L; // Paper
}
public static long c() {
public static long getMonotonicNanos() {
- return a.getAsLong();
+ return System.nanoTime(); // Paper
}
public static long d() {
public static long getTimeMillis() {
@@ -109,7 +109,7 @@ public class SystemUtils {
futuretask.run();
return (V)futuretask.get();
@ -861,5 +856,5 @@ index 7ac07ac07ac0..7ac07ac07ac0 100644
static enum IdentityHashingStrategy implements Strategy<Object> {
--
2.19.1
2.20.0

Datei anzeigen

@ -1,4 +1,4 @@
From 02e9001365c48007078e30a3e7566cecc2a53414 Mon Sep 17 00:00:00 2001
From 89c7eb82c66a25dc178e94900fe26e498351762e Mon Sep 17 00:00:00 2001
From: Aikar <aikar@aikar.co>
Date: Wed, 4 Jul 2018 02:10:36 -0400
Subject: [PATCH] Store reference to current Chunk for Entity and Block
@ -8,10 +8,10 @@ This enables us a fast reference to the entities current chunk instead
of having to look it up by hashmap lookups.
diff --git a/src/main/java/net/minecraft/server/Chunk.java b/src/main/java/net/minecraft/server/Chunk.java
index 4870a4bb5..085d3d3e8 100644
index 5dd08018c..d1d8c3be6 100644
--- a/src/main/java/net/minecraft/server/Chunk.java
+++ b/src/main/java/net/minecraft/server/Chunk.java
@@ -32,7 +32,7 @@ public class Chunk implements IChunkAccess {
@@ -37,7 +37,7 @@ public class Chunk implements IChunkAccess {
private final BiomeBase[] f;
private final boolean[] g;
private final Map<BlockPosition, NBTTagCompound> h;
@ -20,7 +20,7 @@ index 4870a4bb5..085d3d3e8 100644
public final World world;
public final Map<HeightMap.Type, HeightMap> heightMap;
public final int locX;
@@ -62,7 +62,30 @@ public class Chunk implements IChunkAccess {
@@ -67,7 +67,30 @@ public class Chunk implements IChunkAccess {
// CraftBukkit start - Neighbor loaded cache for chunk lighting and entity ticking
private int neighbors = 0x1 << 12;
public long chunkKey;
@ -51,7 +51,7 @@ index 4870a4bb5..085d3d3e8 100644
public boolean areNeighborsLoaded(final int radius) {
switch (radius) {
case 2:
@@ -93,7 +116,7 @@ public class Chunk implements IChunkAccess {
@@ -98,7 +121,7 @@ public class Chunk implements IChunkAccess {
this.g = new boolean[256];
this.h = Maps.newHashMap();
this.heightMap = Maps.newEnumMap(HeightMap.Type.class);
@ -60,9 +60,9 @@ index 4870a4bb5..085d3d3e8 100644
this.p = Maps.newHashMap();
this.q = Maps.newHashMap();
this.r = new ShortList[16];
@@ -653,6 +676,9 @@ public class Chunk implements IChunkAccess {
entity.af = k;
entity.ag = this.locZ;
@@ -658,6 +681,9 @@ public class Chunk implements IChunkAccess {
entity.chunkY = k;
entity.chunkZ = this.locZ;
this.entitySlices[k].add(entity);
+ // Paper start
+ entity.setCurrentChunk(this);
@ -70,7 +70,7 @@ index 4870a4bb5..085d3d3e8 100644
}
public void a(HeightMap.Type heightmap_type, long[] along) {
@@ -671,8 +697,12 @@ public class Chunk implements IChunkAccess {
@@ -676,8 +702,12 @@ public class Chunk implements IChunkAccess {
if (i >= this.entitySlices.length) {
i = this.entitySlices.length - 1;
}
@ -85,7 +85,7 @@ index 4870a4bb5..085d3d3e8 100644
}
public boolean c(BlockPosition blockposition) {
@@ -873,6 +903,7 @@ public class Chunk implements IChunkAccess {
@@ -886,6 +916,7 @@ public class Chunk implements IChunkAccess {
}
}
// Spigot End
@ -94,7 +94,7 @@ index 4870a4bb5..085d3d3e8 100644
// Do not pass along players, as doing so can get them stuck outside of time.
// (which for example disables inventory icon updates and prevents block breaking)
diff --git a/src/main/java/net/minecraft/server/Entity.java b/src/main/java/net/minecraft/server/Entity.java
index 3e5c2d8e7..fde9d4d51 100644
index a6eb8ab6c..50176b97b 100644
--- a/src/main/java/net/minecraft/server/Entity.java
+++ b/src/main/java/net/minecraft/server/Entity.java
@@ -134,7 +134,7 @@ public abstract class Entity implements INamableTileEntity, ICommandListener, Ke
@ -103,9 +103,9 @@ index 3e5c2d8e7..fde9d4d51 100644
private static final DataWatcherObject<Boolean> aH = DataWatcher.a(Entity.class, DataWatcherRegistry.i);
- public boolean inChunk;
+ public boolean inChunk; public boolean isAddedToChunk() { return inChunk; } // Paper - OBFHELPER
public int ae; public int getChunkX() { return ae; } // Paper - OBFHELPER
public int af; public int getChunkY() { return af; } // Paper - OBFHELPER
public int ag; public int getChunkZ() { return ag; } // Paper - OBFHELPER
public int chunkX; public int getChunkX() { return chunkX; } // Paper - OBFHELPER
public int chunkY; public int getChunkY() { return chunkY; } // Paper - OBFHELPER
public int chunkZ; public int getChunkZ() { return chunkZ; } // Paper - OBFHELPER
@@ -1762,6 +1762,39 @@ public abstract class Entity implements INamableTileEntity, ICommandListener, Ke
}
@ -192,5 +192,5 @@ index 2c57a4f03..153efb9b9 100644
/**
* Order is *EXTREMELY* important -- keep it right! =D
--
2.19.1
2.20.0

Datei anzeigen

@ -1,4 +1,4 @@
From 7ac07ac07ac07ac07ac07ac07ac07ac07ac07ac0 Mon Sep 17 00:00:00 2001
From a00c2b358e7f0ce360d28c8e803026470f3ee940 Mon Sep 17 00:00:00 2001
From: Aikar <aikar@aikar.co>
Date: Wed, 4 Jul 2018 02:13:59 -0400
Subject: [PATCH] Store counts for each Entity/Block Entity Type
@ -6,10 +6,10 @@ Subject: [PATCH] Store counts for each Entity/Block Entity Type
Opens door for future patches to optimize performance
diff --git a/src/main/java/net/minecraft/server/Chunk.java b/src/main/java/net/minecraft/server/Chunk.java
index 7ac07ac07ac0..7ac07ac07ac0 100644
index d1d8c3be6..4d04fdda7 100644
--- a/src/main/java/net/minecraft/server/Chunk.java
+++ b/src/main/java/net/minecraft/server/Chunk.java
@@ -63,15 +63,19 @@ public class Chunk implements IChunkAccess {
@@ -68,15 +68,19 @@ public class Chunk implements IChunkAccess {
private int neighbors = 0x1 << 12;
public long chunkKey;
// Paper start
@ -29,7 +29,7 @@ index 7ac07ac07ac0..7ac07ac07ac0 100644
}
return replaced;
}
@@ -81,6 +85,7 @@ public class Chunk implements IChunkAccess {
@@ -86,6 +90,7 @@ public class Chunk implements IChunkAccess {
TileEntity removed = super.remove(key);
if (removed != null) {
removed.setCurrentChunk(null);
@ -37,7 +37,7 @@ index 7ac07ac07ac0..7ac07ac07ac0 100644
}
return removed;
}
@@ -678,6 +683,7 @@ public class Chunk implements IChunkAccess {
@@ -683,6 +688,7 @@ public class Chunk implements IChunkAccess {
this.entitySlices[k].add(entity);
// Paper start
entity.setCurrentChunk(this);
@ -45,7 +45,7 @@ index 7ac07ac07ac0..7ac07ac07ac0 100644
// Paper end
}
@@ -702,6 +708,7 @@ public class Chunk implements IChunkAccess {
@@ -707,6 +713,7 @@ public class Chunk implements IChunkAccess {
return;
}
entity.setCurrentChunk(null);
@ -54,5 +54,5 @@ index 7ac07ac07ac0..7ac07ac07ac0 100644
}
--
2.19.1
2.20.0

Datei anzeigen

@ -1,4 +1,4 @@
From 2589f04f992b46251d9c0317f588987a451be50a Mon Sep 17 00:00:00 2001
From 87fd657aa5de36c8b09b9d2463708b818665f008 Mon Sep 17 00:00:00 2001
From: Aikar <aikar@aikar.co>
Date: Thu, 3 Mar 2016 04:00:11 -0600
Subject: [PATCH] Timings v2
@ -253,7 +253,7 @@ index 000000000..145cb274b
+ }
+}
diff --git a/src/main/java/com/destroystokyo/paper/PaperConfig.java b/src/main/java/com/destroystokyo/paper/PaperConfig.java
index 87a7b6980..2f17e5219 100644
index 255b8bed0..fe148495b 100644
--- a/src/main/java/com/destroystokyo/paper/PaperConfig.java
+++ b/src/main/java/com/destroystokyo/paper/PaperConfig.java
@@ -14,11 +14,14 @@ import java.util.concurrent.TimeUnit;
@ -297,7 +297,7 @@ index 87a7b6980..2f17e5219 100644
+ }
}
diff --git a/src/main/java/net/minecraft/server/Block.java b/src/main/java/net/minecraft/server/Block.java
index b9645c669..fb7688e9e 100644
index a30b21ad2..83b1ef0fc 100644
--- a/src/main/java/net/minecraft/server/Block.java
+++ b/src/main/java/net/minecraft/server/Block.java
@@ -23,6 +23,15 @@ public class Block implements IMaterial {
@ -317,10 +317,10 @@ index b9645c669..fb7688e9e 100644
private final float frictionFactor;
protected final BlockStateList<Block, IBlockData> blockStateList;
diff --git a/src/main/java/net/minecraft/server/Chunk.java b/src/main/java/net/minecraft/server/Chunk.java
index 6675bc5cc..f929ce02e 100644
index 4d04fdda7..9970a58ed 100644
--- a/src/main/java/net/minecraft/server/Chunk.java
+++ b/src/main/java/net/minecraft/server/Chunk.java
@@ -842,6 +842,7 @@ public class Chunk implements IChunkAccess {
@@ -855,6 +855,7 @@ public class Chunk implements IChunkAccess {
server.getPluginManager().callEvent(new org.bukkit.event.world.ChunkLoadEvent(this.bukkitChunk, this.needsDecoration));
if (this.needsDecoration) {
@ -328,7 +328,7 @@ index 6675bc5cc..f929ce02e 100644
BlockSand.instaFall = true;
java.util.Random random = new java.util.Random();
random.setSeed(world.getSeed());
@@ -862,6 +863,7 @@ public class Chunk implements IChunkAccess {
@@ -875,6 +876,7 @@ public class Chunk implements IChunkAccess {
}
BlockSand.instaFall = false;
server.getPluginManager().callEvent(new org.bukkit.event.world.ChunkPopulateEvent(bukkitChunk));
@ -337,13 +337,13 @@ index 6675bc5cc..f929ce02e 100644
}
// CraftBukkit end
diff --git a/src/main/java/net/minecraft/server/ChunkMap.java b/src/main/java/net/minecraft/server/ChunkMap.java
index f0d926256..ca18901df 100644
index df2711a5f..732c8793e 100644
--- a/src/main/java/net/minecraft/server/ChunkMap.java
+++ b/src/main/java/net/minecraft/server/ChunkMap.java
@@ -14,6 +14,7 @@ public class ChunkMap extends Long2ObjectOpenHashMap<Chunk> {
}
public Chunk a(long i, Chunk chunk) {
public Chunk put(long i, Chunk chunk) {
+ chunk.world.timings.syncChunkLoadPostTimer.startTiming(); // Paper
Chunk chunk1 = (Chunk) super.put(i, chunk);
ChunkCoordIntPair chunkcoordintpair = new ChunkCoordIntPair(i);
@ -398,7 +398,7 @@ index b859a5b9e..60abc5f28 100644
this.chunkLoader.saveChunk(this.world, ichunkaccess, unloaded); // Spigot
} catch (IOException ioexception) {
diff --git a/src/main/java/net/minecraft/server/ChunkRegionLoader.java b/src/main/java/net/minecraft/server/ChunkRegionLoader.java
index 3bf55a054..179769323 100644
index 1b8c28096..62a63dfa8 100644
--- a/src/main/java/net/minecraft/server/ChunkRegionLoader.java
+++ b/src/main/java/net/minecraft/server/ChunkRegionLoader.java
@@ -1,5 +1,6 @@
@ -433,11 +433,11 @@ index 3bf55a054..179769323 100644
- world.timings.syncChunkLoadTileEntitiesTimer.stopTiming(); // Spigot
- world.timings.syncChunkLoadTileTicksTimer.startTiming(); // Spigot
if (nbttagcompound.hasKeyOfType("TileTicks", 9) && world.J() instanceof TickListServer) {
((TickListServer) world.J()).a(nbttagcompound.getList("TileTicks", 10));
if (nbttagcompound.hasKeyOfType("TileTicks", 9) && world.getBlockTickList() instanceof TickListServer) {
((TickListServer) world.getBlockTickList()).a(nbttagcompound.getList("TileTicks", 10));
@@ -719,7 +716,7 @@ public class ChunkRegionLoader implements IChunkLoader, IAsyncChunkSaver {
if (nbttagcompound.hasKeyOfType("LiquidTicks", 9) && world.I() instanceof TickListServer) {
((TickListServer) world.I()).a(nbttagcompound.getList("LiquidTicks", 10));
if (nbttagcompound.hasKeyOfType("LiquidTicks", 9) && world.getFluidTickList() instanceof TickListServer) {
((TickListServer) world.getFluidTickList()).a(nbttagcompound.getList("LiquidTicks", 10));
}
- world.timings.syncChunkLoadTileTicksTimer.stopTiming(); // Spigot
+ world.timings.chunkLoadLevelTimer.stopTiming(); // Spigot
@ -472,7 +472,7 @@ index cc9e8465c..1bd3a0f77 100644
return this.b;
}
diff --git a/src/main/java/net/minecraft/server/CustomFunctionData.java b/src/main/java/net/minecraft/server/CustomFunctionData.java
index 15ab4f0e4..1004e084c 100644
index b8a626dd4..323b2e6dc 100644
--- a/src/main/java/net/minecraft/server/CustomFunctionData.java
+++ b/src/main/java/net/minecraft/server/CustomFunctionData.java
@@ -109,7 +109,7 @@ public class CustomFunctionData implements ITickable, IResourcePackListener {
@ -485,7 +485,7 @@ index 15ab4f0e4..1004e084c 100644
int j = 0;
CustomFunction.c[] acustomfunction_c = customfunction.b();
diff --git a/src/main/java/net/minecraft/server/DedicatedServer.java b/src/main/java/net/minecraft/server/DedicatedServer.java
index 73a326684..a575ff529 100644
index b5e5c385d..7f4c76669 100644
--- a/src/main/java/net/minecraft/server/DedicatedServer.java
+++ b/src/main/java/net/minecraft/server/DedicatedServer.java
@@ -29,7 +29,7 @@ import org.apache.logging.log4j.Level;
@ -500,7 +500,7 @@ index 73a326684..a575ff529 100644
@@ -454,7 +454,7 @@ public class DedicatedServer extends MinecraftServer implements IMinecraftServer
}
public void aU() {
public void handleCommandQueue() {
- SpigotTimings.serverCommandTimer.startTiming(); // Spigot
+ MinecraftTimings.serverCommandTimer.startTiming(); // Spigot
while (!this.serverCommandQueue.isEmpty()) {
@ -538,7 +538,7 @@ index 73a326684..a575ff529 100644
return waitable.get();
} catch (java.util.concurrent.ExecutionException e) {
diff --git a/src/main/java/net/minecraft/server/Entity.java b/src/main/java/net/minecraft/server/Entity.java
index f05a9ebab..8b1e0448b 100644
index 50176b97b..f960db23d 100644
--- a/src/main/java/net/minecraft/server/Entity.java
+++ b/src/main/java/net/minecraft/server/Entity.java
@@ -29,7 +29,8 @@ import org.bukkit.command.CommandSender;
@ -570,14 +570,14 @@ index f05a9ebab..8b1e0448b 100644
this.recalcPosition();
@@ -887,7 +887,6 @@ public abstract class Entity implements INamableTileEntity, ICommandListener, Ke
this.world.methodProfiler.e();
this.world.methodProfiler.exit();
}
- org.bukkit.craftbukkit.SpigotTimings.entityMoveTimer.stopTiming(); // Spigot
}
protected float ab() {
diff --git a/src/main/java/net/minecraft/server/EntityLiving.java b/src/main/java/net/minecraft/server/EntityLiving.java
index 2a1e3c801..7f95652bd 100644
index 14c481220..92a55bdf6 100644
--- a/src/main/java/net/minecraft/server/EntityLiving.java
+++ b/src/main/java/net/minecraft/server/EntityLiving.java
@@ -32,7 +32,7 @@ import org.bukkit.event.entity.EntityTeleportEvent;
@ -602,7 +602,7 @@ index 2a1e3c801..7f95652bd 100644
}
- SpigotTimings.timerEntityBaseTick.stopTiming(); // Spigot
this.k();
this.movementTick();
- SpigotTimings.timerEntityTickRest.startTiming(); // Spigot
double d0 = this.locX - this.lastX;
double d1 = this.locZ - this.lastZ;
@ -619,19 +619,19 @@ index 2a1e3c801..7f95652bd 100644
@@ -2243,7 +2238,6 @@ public abstract class EntityLiving extends Entity {
}
this.world.methodProfiler.a("ai");
this.world.methodProfiler.enter("ai");
- SpigotTimings.timerEntityAI.startTiming(); // Spigot
if (this.isFrozen()) {
this.bg = false;
this.bh = 0.0F;
@@ -2254,7 +2248,6 @@ public abstract class EntityLiving extends Entity {
this.doTick();
this.world.methodProfiler.e();
this.world.methodProfiler.exit();
}
- SpigotTimings.timerEntityAI.stopTiming(); // Spigot
this.world.methodProfiler.e();
this.world.methodProfiler.a("jump");
this.world.methodProfiler.exit();
this.world.methodProfiler.enter("jump");
@@ -2279,9 +2272,7 @@ public abstract class EntityLiving extends Entity {
this.n();
AxisAlignedBB axisalignedbb = this.getBoundingBox();
@ -639,8 +639,8 @@ index 2a1e3c801..7f95652bd 100644
- SpigotTimings.timerEntityAIMove.startTiming(); // Spigot
this.a(this.bh, this.bi, this.bj);
- SpigotTimings.timerEntityAIMove.stopTiming(); // Spigot
this.world.methodProfiler.e();
this.world.methodProfiler.a("push");
this.world.methodProfiler.exit();
this.world.methodProfiler.enter("push");
if (this.bw > 0) {
@@ -2289,9 +2280,7 @@ public abstract class EntityLiving extends Entity {
this.a(axisalignedbb, this.getBoundingBox());
@ -649,11 +649,11 @@ index 2a1e3c801..7f95652bd 100644
- SpigotTimings.timerEntityAICollision.startTiming(); // Spigot
this.cN();
- SpigotTimings.timerEntityAICollision.stopTiming(); // Spigot
this.world.methodProfiler.e();
this.world.methodProfiler.exit();
}
diff --git a/src/main/java/net/minecraft/server/EntityTracker.java b/src/main/java/net/minecraft/server/EntityTracker.java
index ae31935c4..70c9b1f50 100644
index 22db1fad1..d7f33bd53 100644
--- a/src/main/java/net/minecraft/server/EntityTracker.java
+++ b/src/main/java/net/minecraft/server/EntityTracker.java
@@ -168,7 +168,7 @@ public class EntityTracker {
@ -684,7 +684,7 @@ index ae31935c4..70c9b1f50 100644
}
diff --git a/src/main/java/net/minecraft/server/MinecraftServer.java b/src/main/java/net/minecraft/server/MinecraftServer.java
index 04c5c1796..b99ed185f 100644
index 37211c33a..97690499f 100644
--- a/src/main/java/net/minecraft/server/MinecraftServer.java
+++ b/src/main/java/net/minecraft/server/MinecraftServer.java
@@ -1,5 +1,6 @@
@ -719,26 +719,26 @@ index 04c5c1796..b99ed185f 100644
- SpigotTimings.serverTickTimer.startTiming(); // Spigot
+ co.aikar.timings.TimingsManager.FULL_SERVER_TICK.startTiming(); // Paper
this.slackActivityAccountant.tickStarted(); // Spigot
long i = SystemUtils.c();
long i = SystemUtils.getMonotonicNanos();
@@ -848,7 +850,6 @@ public abstract class MinecraftServer implements IAsyncTaskHandler, IMojangStati
}
if (autosavePeriod > 0 && this.ticks % autosavePeriod == 0) { // CraftBukkit
- SpigotTimings.worldSaveTimer.startTiming(); // Spigot
this.methodProfiler.a("save");
this.s.savePlayers();
this.methodProfiler.enter("save");
this.playerList.savePlayers();
// Spigot Start
@@ -863,7 +864,6 @@ public abstract class MinecraftServer implements IAsyncTaskHandler, IMojangStati
// this.saveChunks(true);
// Spigot End
this.methodProfiler.e();
this.methodProfiler.exit();
- SpigotTimings.worldSaveTimer.stopTiming(); // Spigot
}
this.methodProfiler.a("snooper");
this.methodProfiler.enter("snooper");
@@ -884,14 +884,14 @@ public abstract class MinecraftServer implements IAsyncTaskHandler, IMojangStati
this.methodProfiler.e();
this.methodProfiler.exit();
org.spigotmc.WatchdogThread.tick(); // Spigot
this.slackActivityAccountant.tickEnded(l); // Spigot
- SpigotTimings.serverTickTimer.stopTiming(); // Spigot
@ -753,7 +753,7 @@ index 04c5c1796..b99ed185f 100644
- SpigotTimings.schedulerTimer.stopTiming(); // Spigot
+ MinecraftTimings.bukkitSchedulerTimer.stopTiming(); // Paper
+ MinecraftTimings.minecraftSchedulerTimer.startTiming(); // Paper
this.methodProfiler.a("jobs");
this.methodProfiler.enter("jobs");
FutureTask futuretask;
@@ -899,26 +899,27 @@ public abstract class MinecraftServer implements IAsyncTaskHandler, IMojangStati
@ -762,13 +762,13 @@ index 04c5c1796..b99ed185f 100644
}
+ MinecraftTimings.minecraftSchedulerTimer.stopTiming(); // Paper
this.methodProfiler.c("commandFunctions");
this.methodProfiler.exitEnter("commandFunctions");
- SpigotTimings.commandFunctionsTimer.startTiming(); // Spigot
+ MinecraftTimings.commandFunctionsTimer.startTiming(); // Spigot
this.getFunctionData().Y_();
this.getFunctionData().tick();
- SpigotTimings.commandFunctionsTimer.stopTiming(); // Spigot
+ MinecraftTimings.commandFunctionsTimer.stopTiming(); // Spigot
this.methodProfiler.c("levels");
this.methodProfiler.exitEnter("levels");
// CraftBukkit start
// Run tasks that are waiting on processing
@ -802,42 +802,42 @@ index 04c5c1796..b99ed185f 100644
long i;
@@ -985,29 +986,27 @@ public abstract class MinecraftServer implements IAsyncTaskHandler, IMojangStati
this.methodProfiler.e();
this.methodProfiler.a("tracker");
this.methodProfiler.exit();
this.methodProfiler.enter("tracker");
- worldserver.timings.tracker.startTiming(); // Spigot
worldserver.getTracker().updatePlayers();
- worldserver.timings.tracker.stopTiming(); // Spigot
this.methodProfiler.e();
this.methodProfiler.e();
this.methodProfiler.exit();
this.methodProfiler.exit();
}
}
this.methodProfiler.c("connection");
this.methodProfiler.exitEnter("connection");
- SpigotTimings.connectionTimer.startTiming(); // Spigot
+ MinecraftTimings.connectionTimer.startTiming(); // Spigot
this.getServerConnection().c();
- SpigotTimings.connectionTimer.stopTiming(); // Spigot
+ MinecraftTimings.connectionTimer.stopTiming(); // Spigot
this.methodProfiler.c("players");
this.methodProfiler.exitEnter("players");
- SpigotTimings.playerListTimer.startTiming(); // Spigot
+ MinecraftTimings.playerListTimer.startTiming(); // Spigot
this.s.tick();
this.playerList.tick();
- SpigotTimings.playerListTimer.stopTiming(); // Spigot
+ MinecraftTimings.playerListTimer.stopTiming(); // Spigot
this.methodProfiler.c("tickables");
this.methodProfiler.exitEnter("tickables");
- SpigotTimings.tickablesTimer.startTiming(); // Spigot
+ MinecraftTimings.tickablesTimer.startTiming(); // Spigot
for (int j = 0; j < this.k.size(); ++j) {
((ITickable) this.k.get(j)).Y_();
((ITickable) this.k.get(j)).tick();
}
- SpigotTimings.tickablesTimer.stopTiming(); // Spigot
+ MinecraftTimings.tickablesTimer.stopTiming(); // Spigot
this.methodProfiler.e();
this.methodProfiler.exit();
}
diff --git a/src/main/java/net/minecraft/server/PlayerChunkMap.java b/src/main/java/net/minecraft/server/PlayerChunkMap.java
index 384f4f45b..1dfdc5d70 100644
index ceac52fe5..29e24940f 100644
--- a/src/main/java/net/minecraft/server/PlayerChunkMap.java
+++ b/src/main/java/net/minecraft/server/PlayerChunkMap.java
@@ -1,5 +1,6 @@
@ -847,7 +847,7 @@ index 384f4f45b..1dfdc5d70 100644
import com.google.common.collect.AbstractIterator;
import com.google.common.collect.ComparisonChain;
import com.google.common.collect.Lists;
@@ -90,6 +91,7 @@ public class PlayerChunkMap {
@@ -86,6 +87,7 @@ public class PlayerChunkMap {
int j;
if (i - this.k > 8000L) {
@ -855,7 +855,7 @@ index 384f4f45b..1dfdc5d70 100644
this.k = i;
for (j = 0; j < this.i.size(); ++j) {
@@ -97,9 +99,11 @@ public class PlayerChunkMap {
@@ -93,9 +95,11 @@ public class PlayerChunkMap {
playerchunk.d();
playerchunk.c();
}
@ -867,7 +867,7 @@ index 384f4f45b..1dfdc5d70 100644
Iterator iterator = this.f.iterator();
while (iterator.hasNext()) {
@@ -108,25 +112,31 @@ public class PlayerChunkMap {
@@ -104,25 +108,31 @@ public class PlayerChunkMap {
}
this.f.clear();
@ -899,7 +899,7 @@ index 384f4f45b..1dfdc5d70 100644
// Spigot start
org.spigotmc.SlackActivityAccountant activityAccountant = this.world.getMinecraftServer().slackActivityAccountant;
activityAccountant.startActivity(0.5);
@@ -158,10 +168,12 @@ public class PlayerChunkMap {
@@ -154,10 +164,12 @@ public class PlayerChunkMap {
}
activityAccountant.endActivity(); // Spigot
@ -912,7 +912,7 @@ index 384f4f45b..1dfdc5d70 100644
Iterator iterator2 = this.g.iterator();
while (iterator2.hasNext()) {
@@ -175,14 +187,17 @@ public class PlayerChunkMap {
@@ -171,14 +183,17 @@ public class PlayerChunkMap {
}
}
}
@ -924,14 +924,14 @@ index 384f4f45b..1dfdc5d70 100644
WorldProvider worldprovider = this.world.worldProvider;
if (!worldprovider.canRespawn()) {
this.world.getChunkProviderServer().b();
this.world.getChunkProvider().b();
}
+ } // Paper timing
}
}
diff --git a/src/main/java/net/minecraft/server/PlayerConnection.java b/src/main/java/net/minecraft/server/PlayerConnection.java
index 539e6d3c9..67c993795 100644
index 2b6c797ce..0a887789a 100644
--- a/src/main/java/net/minecraft/server/PlayerConnection.java
+++ b/src/main/java/net/minecraft/server/PlayerConnection.java
@@ -59,6 +59,7 @@ import org.bukkit.inventory.CraftingInventory;
@ -945,7 +945,7 @@ index 539e6d3c9..67c993795 100644
@@ -136,7 +137,6 @@ public class PlayerConnection implements PacketListenerPlayIn, ITickable {
// CraftBukkit end
public void Y_() {
public void tick() {
- org.bukkit.craftbukkit.SpigotTimings.playerConnectionTimer.startTiming(); // Spigot
this.syncPosition();
this.player.playerTick();
@ -1007,7 +1007,7 @@ index 616797dc6..3a5daf670 100644
throw CancelledPacketHandleException.INSTANCE;
}
diff --git a/src/main/java/net/minecraft/server/PlayerList.java b/src/main/java/net/minecraft/server/PlayerList.java
index 39f149a81..597ad7d40 100644
index 9db7d7e30..aef650774 100644
--- a/src/main/java/net/minecraft/server/PlayerList.java
+++ b/src/main/java/net/minecraft/server/PlayerList.java
@@ -1,5 +1,6 @@
@ -1031,7 +1031,7 @@ index 39f149a81..597ad7d40 100644
public WhiteList getWhitelist() {
diff --git a/src/main/java/net/minecraft/server/TickListServer.java b/src/main/java/net/minecraft/server/TickListServer.java
index a07895935..ee5c2421b 100644
index 0d0b4d873..774134103 100644
--- a/src/main/java/net/minecraft/server/TickListServer.java
+++ b/src/main/java/net/minecraft/server/TickListServer.java
@@ -24,13 +24,19 @@ public class TickListServer<T> implements TickList<T> {
@ -1058,7 +1058,7 @@ index a07895935..ee5c2421b 100644
@@ -49,7 +55,7 @@ public class TickListServer<T> implements TickList<T> {
}
this.f.methodProfiler.a("cleaning");
this.f.methodProfiler.enter("cleaning");
-
+ timingCleanup.startTiming(); // Paper
NextTickListEntry<T> nextticklistentry; // CraftBukkit - decompile error
@ -1070,15 +1070,15 @@ index a07895935..ee5c2421b 100644
}
+ timingCleanup.stopTiming(); // Paper
this.f.methodProfiler.e();
this.f.methodProfiler.a("ticking");
this.f.methodProfiler.exit();
this.f.methodProfiler.enter("ticking");
+ timingTicking.startTiming(); // Paper
Iterator iterator = this.g.iterator();
while (iterator.hasNext()) {
@@ -89,6 +97,7 @@ public class TickListServer<T> implements TickList<T> {
this.f.methodProfiler.e();
this.f.methodProfiler.exit();
this.g.clear();
+ timingTicking.stopTiming(); // Paper
}
@ -1105,7 +1105,7 @@ index c69209497..68ac014aa 100644
private final TileEntityTypes<?> e; public TileEntityTypes getTileEntityType() { return e; } // Paper - OBFHELPER
protected World world;
diff --git a/src/main/java/net/minecraft/server/World.java b/src/main/java/net/minecraft/server/World.java
index 44b381120..119e1facc 100644
index 0920ef2d1..230517907 100644
--- a/src/main/java/net/minecraft/server/World.java
+++ b/src/main/java/net/minecraft/server/World.java
@@ -1,5 +1,6 @@
@ -1148,23 +1148,23 @@ index 44b381120..119e1facc 100644
this.entityLimiter = new org.spigotmc.TickLimiter(spigotConfig.entityMaxTickTime);
this.tileLimiter = new org.spigotmc.TickLimiter(spigotConfig.tileMaxTickTime);
}
@@ -1130,6 +1131,7 @@ public abstract class World implements IEntityAccess, GeneratorAccess, IIBlockAc
@@ -1080,6 +1081,7 @@ public abstract class World implements IEntityAccess, GeneratorAccess, IIBlockAc
}
this.methodProfiler.c("remove");
this.methodProfiler.exitEnter("remove");
+ timings.entityRemoval.startTiming(); // Paper
this.entityList.removeAll(this.g);
int j;
@@ -1150,6 +1152,7 @@ public abstract class World implements IEntityAccess, GeneratorAccess, IIBlockAc
@@ -1100,6 +1102,7 @@ public abstract class World implements IEntityAccess, GeneratorAccess, IIBlockAc
this.g.clear();
this.p_();
+ timings.entityRemoval.stopTiming(); // Paper
this.methodProfiler.c("regular");
this.methodProfiler.exitEnter("regular");
CrashReport crashreport1;
@@ -1159,6 +1162,7 @@ public abstract class World implements IEntityAccess, GeneratorAccess, IIBlockAc
@@ -1109,6 +1112,7 @@ public abstract class World implements IEntityAccess, GeneratorAccess, IIBlockAc
timings.entityTick.startTiming(); // Spigot
guardEntityList = true; // Spigot
// CraftBukkit start - Use field for loop variable
@ -1172,8 +1172,8 @@ index 44b381120..119e1facc 100644
int entitiesThisCycle = 0;
if (tickPosition < 0) tickPosition = 0;
for (entityLimiter.initTick();
@@ -1180,10 +1184,11 @@ public abstract class World implements IEntityAccess, GeneratorAccess, IIBlockAc
this.methodProfiler.a("tick");
@@ -1130,10 +1134,11 @@ public abstract class World implements IEntityAccess, GeneratorAccess, IIBlockAc
this.methodProfiler.enter("tick");
if (!entity.dead && !(entity instanceof EntityPlayer)) {
try {
- SpigotTimings.tickEntityTimer.startTiming(); // Spigot
@ -1186,15 +1186,15 @@ index 44b381120..119e1facc 100644
crashreport1 = CrashReport.a(throwable1, "Ticking entity");
crashreportsystemdetails1 = crashreport1.a("Entity being ticked");
entity.appendEntityCrashDetails(crashreportsystemdetails1);
@@ -1308,6 +1313,7 @@ public abstract class World implements IEntityAccess, GeneratorAccess, IIBlockAc
@@ -1258,6 +1263,7 @@ public abstract class World implements IEntityAccess, GeneratorAccess, IIBlockAc
}
timings.tileEntityPending.stopTiming(); // Spigot
+ co.aikar.timings.TimingHistory.tileEntityTicks += this.tileEntityListTick.size(); // Paper
this.methodProfiler.e();
this.methodProfiler.e();
this.methodProfiler.exit();
this.methodProfiler.exit();
}
@@ -1366,7 +1372,6 @@ public abstract class World implements IEntityAccess, GeneratorAccess, IIBlockAc
@@ -1316,7 +1322,6 @@ public abstract class World implements IEntityAccess, GeneratorAccess, IIBlockAc
}
// CraftBukkit end
@ -1202,7 +1202,7 @@ index 44b381120..119e1facc 100644
entity.N = entity.locX;
entity.O = entity.locY;
entity.P = entity.locZ;
@@ -1374,6 +1379,7 @@ public abstract class World implements IEntityAccess, GeneratorAccess, IIBlockAc
@@ -1324,6 +1329,7 @@ public abstract class World implements IEntityAccess, GeneratorAccess, IIBlockAc
entity.lastPitch = entity.pitch;
if (flag && entity.inChunk) {
++entity.ticksLived;
@ -1210,7 +1210,7 @@ index 44b381120..119e1facc 100644
if (entity.isPassenger()) {
entity.aH();
} else {
@@ -1437,8 +1443,6 @@ public abstract class World implements IEntityAccess, GeneratorAccess, IIBlockAc
@@ -1387,8 +1393,6 @@ public abstract class World implements IEntityAccess, GeneratorAccess, IIBlockAc
}
}
}
@ -1220,7 +1220,7 @@ index 44b381120..119e1facc 100644
public boolean a(@Nullable Entity entity, VoxelShape voxelshape) {
diff --git a/src/main/java/net/minecraft/server/WorldServer.java b/src/main/java/net/minecraft/server/WorldServer.java
index ee68983f6..435c54da1 100644
index 23c80f80a..2450421d4 100644
--- a/src/main/java/net/minecraft/server/WorldServer.java
+++ b/src/main/java/net/minecraft/server/WorldServer.java
@@ -1,5 +1,6 @@
@ -1251,39 +1251,38 @@ index ee68983f6..435c54da1 100644
@@ -297,13 +298,13 @@ public class WorldServer extends World implements IAsyncTaskHandler {
timings.doChunkUnload.stopTiming(); // Spigot
this.methodProfiler.c("tickPending");
this.methodProfiler.exitEnter("tickPending");
- timings.doTickPending.startTiming(); // Spigot
+ timings.scheduledBlocks.startTiming(); // Paper
this.q();
- timings.doTickPending.stopTiming(); // Spigot
+ timings.scheduledBlocks.stopTiming(); // Paper
this.methodProfiler.c("tickBlocks");
this.methodProfiler.exitEnter("tickBlocks");
- timings.doTickTiles.startTiming(); // Spigot
+ timings.chunkTicks.startTiming(); // Paper
this.n_();
- timings.doTickTiles.stopTiming(); // Spigot
+ timings.chunkTicks.stopTiming(); // Paper
this.methodProfiler.c("chunkMap");
this.methodProfiler.exitEnter("chunkMap");
timings.doChunkMap.startTiming(); // Spigot
this.manager.flush();
@@ -532,7 +533,7 @@ public class WorldServer extends World implements IAsyncTaskHandler {
}
@@ -533,6 +534,7 @@ public class WorldServer extends World implements IAsyncTaskHandler {
}
- this.methodProfiler.c("tickBlocks");
this.methodProfiler.exitEnter("tickBlocks");
+ timings.chunkTicksBlocks.startTiming(); // Paper
if (i > 0) {
ChunkSection[] achunksection = chunk.getSections();
int i1 = achunksection.length;
@@ -564,6 +565,7 @@ public class WorldServer extends World implements IAsyncTaskHandler {
@@ -564,6 +566,7 @@ public class WorldServer extends World implements IAsyncTaskHandler {
}
}
}
+ timings.chunkTicksBlocks.stopTiming(); // Paper
}
this.methodProfiler.e();
@@ -869,6 +871,7 @@ public class WorldServer extends World implements IAsyncTaskHandler {
this.methodProfiler.exit();
@@ -869,6 +872,7 @@ public class WorldServer extends World implements IAsyncTaskHandler {
if (chunkproviderserver.d()) {
org.bukkit.Bukkit.getPluginManager().callEvent(new org.bukkit.event.world.WorldSaveEvent(getWorld())); // CraftBukkit
@ -1291,7 +1290,7 @@ index ee68983f6..435c54da1 100644
if (iprogressupdate != null) {
iprogressupdate.a(new ChatMessage("menu.savingLevel", new Object[0]));
}
@@ -878,7 +881,9 @@ public class WorldServer extends World implements IAsyncTaskHandler {
@@ -878,7 +882,9 @@ public class WorldServer extends World implements IAsyncTaskHandler {
iprogressupdate.c(new ChatMessage("menu.savingChunks", new Object[0]));
}
@ -1301,7 +1300,7 @@ index ee68983f6..435c54da1 100644
// CraftBukkit - ArrayList -> Collection
java.util.Collection arraylist = chunkproviderserver.a();
Iterator iterator = arraylist.iterator();
@@ -890,7 +895,7 @@ public class WorldServer extends World implements IAsyncTaskHandler {
@@ -890,7 +896,7 @@ public class WorldServer extends World implements IAsyncTaskHandler {
chunkproviderserver.unload(chunk);
}
}
@ -1310,7 +1309,7 @@ index ee68983f6..435c54da1 100644
}
}
@@ -903,6 +908,7 @@ public class WorldServer extends World implements IAsyncTaskHandler {
@@ -903,6 +909,7 @@ public class WorldServer extends World implements IAsyncTaskHandler {
}
protected void a() throws ExceptionWorldConflict {
@ -1318,7 +1317,7 @@ index ee68983f6..435c54da1 100644
this.checkSession();
Iterator iterator = this.server.getWorlds().iterator();
@@ -932,6 +938,7 @@ public class WorldServer extends World implements IAsyncTaskHandler {
@@ -932,6 +939,7 @@ public class WorldServer extends World implements IAsyncTaskHandler {
this.worldData.c(this.server.getBossBattleCustomData().c());
this.dataManager.saveWorldData(this.worldData, this.server.getPlayerList().t());
this.h().a();
@ -1327,10 +1326,10 @@ index ee68983f6..435c54da1 100644
// CraftBukkit start
diff --git a/src/main/java/org/bukkit/craftbukkit/CraftServer.java b/src/main/java/org/bukkit/craftbukkit/CraftServer.java
index b524adc7d..9efd620f2 100644
index a3c07fbac..da57751f7 100644
--- a/src/main/java/org/bukkit/craftbukkit/CraftServer.java
+++ b/src/main/java/org/bukkit/craftbukkit/CraftServer.java
@@ -1946,12 +1946,31 @@ public final class CraftServer implements Server {
@@ -1945,12 +1945,31 @@ public final class CraftServer implements Server {
private final Spigot spigot = new Spigot()
{
@ -1819,5 +1818,5 @@ index c1071c92e..a99c0cea0 100644
}
}
--
2.19.2
2.20.0

Datei anzeigen

@ -1,11 +1,11 @@
From 7d4ea3d0550820a18c9c4795eca59b6ee33a8997 Mon Sep 17 00:00:00 2001
From bde91baa8fe7c3bd031f0cff6c602a672a50e71a Mon Sep 17 00:00:00 2001
From: Jedediah Smith <jedediah@silencegreys.com>
Date: Tue, 1 Mar 2016 14:47:52 -0600
Subject: [PATCH] Player affects spawning API
diff --git a/src/main/java/net/minecraft/server/EntityHuman.java b/src/main/java/net/minecraft/server/EntityHuman.java
index 7e151439c..0aae80a7f 100644
index 05360531c..1aec6d7c3 100644
--- a/src/main/java/net/minecraft/server/EntityHuman.java
+++ b/src/main/java/net/minecraft/server/EntityHuman.java
@@ -71,6 +71,9 @@ public abstract class EntityHuman extends EntityLiving {
@ -19,7 +19,7 @@ index 7e151439c..0aae80a7f 100644
// CraftBukkit start
public boolean fauxSleeping;
diff --git a/src/main/java/net/minecraft/server/EntityInsentient.java b/src/main/java/net/minecraft/server/EntityInsentient.java
index 8f4319c80..cf73a6d1f 100644
index ef3c94221..ac250182b 100644
--- a/src/main/java/net/minecraft/server/EntityInsentient.java
+++ b/src/main/java/net/minecraft/server/EntityInsentient.java
@@ -619,7 +619,7 @@ public abstract class EntityInsentient extends EntityLiving {
@ -58,7 +58,7 @@ index afe039905..ff564508f 100644
j = MathHelper.floor(entityhuman.locZ / 16.0D);
diff --git a/src/main/java/net/minecraft/server/World.java b/src/main/java/net/minecraft/server/World.java
index e1e931406..c378df796 100644
index b116239f2..73c47c517 100644
--- a/src/main/java/net/minecraft/server/World.java
+++ b/src/main/java/net/minecraft/server/World.java
@@ -34,6 +34,7 @@ import org.bukkit.craftbukkit.block.data.CraftBlockData;
@ -69,7 +69,7 @@ index e1e931406..c378df796 100644
import org.bukkit.event.block.BlockCanBuildEvent;
import org.bukkit.event.block.BlockPhysicsEvent;
import org.bukkit.event.entity.CreatureSpawnEvent.SpawnReason;
@@ -2439,7 +2440,7 @@ public abstract class World implements IEntityAccess, GeneratorAccess, IIBlockAc
@@ -2389,7 +2390,7 @@ public abstract class World implements IEntityAccess, GeneratorAccess, IIBlockAc
for (int i = 0; i < this.players.size(); ++i) {
EntityHuman entityhuman = (EntityHuman) this.players.get(i);
@ -103,5 +103,5 @@ index b5afd5d1c..47da00948 100644
@Override
public void updateCommands() {
--
2.19.2
2.20.0

Datei anzeigen

@ -1,14 +1,14 @@
From 7ac07ac07ac07ac07ac07ac07ac07ac07ac07ac0 Mon Sep 17 00:00:00 2001
From 729ed20118acbca8d55fbfb71d3d02ef0a27314b Mon Sep 17 00:00:00 2001
From: Byteflux <byte@byteflux.net>
Date: Tue, 1 Mar 2016 15:08:03 -0600
Subject: [PATCH] Remove invalid mob spawner tile entities
diff --git a/src/main/java/net/minecraft/server/Chunk.java b/src/main/java/net/minecraft/server/Chunk.java
index 7ac07ac07ac0..7ac07ac07ac0 100644
index 9970a58ed..da2548603 100644
--- a/src/main/java/net/minecraft/server/Chunk.java
+++ b/src/main/java/net/minecraft/server/Chunk.java
@@ -793,6 +793,10 @@ public class Chunk implements IChunkAccess {
@@ -798,6 +798,10 @@ public class Chunk implements IChunkAccess {
tileentity.z();
this.tileEntities.put(blockposition.h(), tileentity);
// CraftBukkit start
@ -20,5 +20,5 @@ index 7ac07ac07ac0..7ac07ac07ac0 100644
System.out.println("Attempted to place a tile entity (" + tileentity + ") at " + tileentity.position.getX() + "," + tileentity.position.getY() + "," + tileentity.position.getZ()
+ " (" + getType(blockposition) + ") where there was no entity tile!");
--
2.19.1
2.20.0

Datei anzeigen

@ -1,4 +1,4 @@
From 3721085914d0c1292ff6633d59f969ed1b4f2177 Mon Sep 17 00:00:00 2001
From fd0cba99aee112db7620e0860c08f2c65c982ee4 Mon Sep 17 00:00:00 2001
From: Aikar <aikar@aikar.co>
Date: Tue, 1 Mar 2016 23:09:29 -0600
Subject: [PATCH] Further improve server tick loop
@ -12,7 +12,7 @@ Previous implementation did not calculate TPS correctly.
Switch to a realistic rolling average and factor in std deviation as an extra reporting variable
diff --git a/src/main/java/net/minecraft/server/MinecraftServer.java b/src/main/java/net/minecraft/server/MinecraftServer.java
index 8a6589d95..9df2296dd 100644
index ffda9d793..4acb908ec 100644
--- a/src/main/java/net/minecraft/server/MinecraftServer.java
+++ b/src/main/java/net/minecraft/server/MinecraftServer.java
@@ -146,7 +146,7 @@ public abstract class MinecraftServer implements IAsyncTaskHandler, IMojangStati
@ -36,8 +36,8 @@ index 8a6589d95..9df2296dd 100644
@@ -689,7 +689,7 @@ public abstract class MinecraftServer implements IAsyncTaskHandler, IMojangStati
}
private boolean aT() {
- return SystemUtils.b() < this.aa;
private boolean canSleepForTick() {
- return SystemUtils.getMonotonicMillis() < this.nextTick;
+ return System.nanoTime() - lastTick + catchupTime < TICK_TIME; // Paper - improved "are we lagging" check to match our own
}
@ -157,14 +157,14 @@ index 8a6589d95..9df2296dd 100644
- MinecraftServer.currentTick = (int) (System.currentTimeMillis() / 50); // CraftBukkit
+ //MinecraftServer.currentTick = (int) (System.currentTimeMillis() / 50); // CraftBukkit // Paper - don't overwrite current tick time
this.a(this::aT);
this.aa += 50L;
this.a(this::canSleepForTick);
this.nextTick += 50L;
// Spigot end
diff --git a/src/main/java/org/bukkit/craftbukkit/CraftServer.java b/src/main/java/org/bukkit/craftbukkit/CraftServer.java
index 29b016e17..cf1db412e 100644
index ed0221f0d..212e3cd4a 100644
--- a/src/main/java/org/bukkit/craftbukkit/CraftServer.java
+++ b/src/main/java/org/bukkit/craftbukkit/CraftServer.java
@@ -1943,6 +1943,17 @@ public final class CraftServer implements Server {
@@ -1942,6 +1942,17 @@ public final class CraftServer implements Server {
return CraftMagicNumbers.INSTANCE;
}
@ -224,5 +224,5 @@ index be2e31dea..6d21c3269 100644
return ( ( tps > 18.0 ) ? ChatColor.GREEN : ( tps > 16.0 ) ? ChatColor.YELLOW : ChatColor.RED ).toString()
+ ( ( tps > 20.0 ) ? "*" : "" ) + Math.min( Math.round( tps * 100.0 ) / 100.0, 20.0 );
--
2.19.1
2.20.0

Datei anzeigen

@ -1,11 +1,11 @@
From 1deac4fb35880f7543e83f0bcf642d40608f9137 Mon Sep 17 00:00:00 2001
From f1f93c9e37b210e625b5881a7fe266309283a08b Mon Sep 17 00:00:00 2001
From: Byteflux <byte@byteflux.net>
Date: Tue, 1 Mar 2016 23:45:08 -0600
Subject: [PATCH] Entity Origin API
diff --git a/src/main/java/net/minecraft/server/Entity.java b/src/main/java/net/minecraft/server/Entity.java
index 792240f2e..65ba3fe66 100644
index 7c2a8c5c8..cc6ae6634 100644
--- a/src/main/java/net/minecraft/server/Entity.java
+++ b/src/main/java/net/minecraft/server/Entity.java
@@ -162,6 +162,7 @@ public abstract class Entity implements INamableTileEntity, ICommandListener, Ke
@ -51,7 +51,7 @@ index 792240f2e..65ba3fe66 100644
NBTTagList nbttaglist = new NBTTagList();
double[] adouble1 = adouble;
diff --git a/src/main/java/net/minecraft/server/EntityFallingBlock.java b/src/main/java/net/minecraft/server/EntityFallingBlock.java
index 25960cff2..1fb912eb0 100644
index dc173e14f..596ac18a7 100644
--- a/src/main/java/net/minecraft/server/EntityFallingBlock.java
+++ b/src/main/java/net/minecraft/server/EntityFallingBlock.java
@@ -249,6 +249,14 @@ public class EntityFallingBlock extends Entity {
@ -70,7 +70,7 @@ index 25960cff2..1fb912eb0 100644
public void a(boolean flag) {
diff --git a/src/main/java/net/minecraft/server/EntityTNTPrimed.java b/src/main/java/net/minecraft/server/EntityTNTPrimed.java
index 5ceb3f206..87f3205f8 100644
index 5dc52b6b8..2c28633c4 100644
--- a/src/main/java/net/minecraft/server/EntityTNTPrimed.java
+++ b/src/main/java/net/minecraft/server/EntityTNTPrimed.java
@@ -109,6 +109,14 @@ public class EntityTNTPrimed extends Entity {
@ -89,7 +89,7 @@ index 5ceb3f206..87f3205f8 100644
@Nullable
diff --git a/src/main/java/net/minecraft/server/NBTTagList.java b/src/main/java/net/minecraft/server/NBTTagList.java
index 769d599c5..e37da10e0 100644
index 1b72df8cd..ae8be435c 100644
--- a/src/main/java/net/minecraft/server/NBTTagList.java
+++ b/src/main/java/net/minecraft/server/NBTTagList.java
@@ -174,6 +174,7 @@ public class NBTTagList extends NBTList<NBTBase> {
@ -101,10 +101,10 @@ index 769d599c5..e37da10e0 100644
if (i >= 0 && i < this.list.size()) {
NBTBase nbtbase = (NBTBase)this.list.get(i);
diff --git a/src/main/java/net/minecraft/server/World.java b/src/main/java/net/minecraft/server/World.java
index 739e19bb1..21c9bb325 100644
index 73c47c517..ab74b1add 100644
--- a/src/main/java/net/minecraft/server/World.java
+++ b/src/main/java/net/minecraft/server/World.java
@@ -968,6 +968,12 @@ public abstract class World implements IEntityAccess, GeneratorAccess, IIBlockAc
@@ -918,6 +918,12 @@ public abstract class World implements IEntityAccess, GeneratorAccess, IIBlockAc
int j = MathHelper.floor(entity.locZ / 16.0D);
boolean flag = entity.attachedToPlayer;
@ -135,5 +135,5 @@ index 153efb9b9..df7c77e9a 100644
+ // Paper end
}
--
2.19.1
2.20.0

Datei anzeigen

@ -1,11 +1,11 @@
From 79a3b07620008e12ad07d2489dea841eb1314a44 Mon Sep 17 00:00:00 2001
From 207ee34b2e3af0d3f6ac16d639cccc9857bc16cf 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
diff --git a/src/main/java/net/minecraft/server/TileEntity.java b/src/main/java/net/minecraft/server/TileEntity.java
index 68ac014aab..c5212417c6 100644
index 68ac014aa..c5212417c 100644
--- a/src/main/java/net/minecraft/server/TileEntity.java
+++ b/src/main/java/net/minecraft/server/TileEntity.java
@@ -178,7 +178,12 @@ public abstract class TileEntity implements KeyedObject { // Paper
@ -23,10 +23,10 @@ index 68ac014aab..c5212417c6 100644
}
}
diff --git a/src/main/java/net/minecraft/server/World.java b/src/main/java/net/minecraft/server/World.java
index 8984949ff5..4afa16fb8a 100644
index ab74b1add..5d5a9f0bb 100644
--- a/src/main/java/net/minecraft/server/World.java
+++ b/src/main/java/net/minecraft/server/World.java
@@ -1197,10 +1197,12 @@ public abstract class World implements IEntityAccess, GeneratorAccess, IIBlockAc
@@ -1147,10 +1147,12 @@ public abstract class World implements IEntityAccess, GeneratorAccess, IIBlockAc
entity.tickTimer.stopTiming(); // Paper
} catch (Throwable throwable1) {
entity.tickTimer.stopTiming();
@ -43,9 +43,9 @@ index 8984949ff5..4afa16fb8a 100644
}
}
@@ -1263,10 +1265,13 @@ public abstract class World implements IEntityAccess, GeneratorAccess, IIBlockAc
((ITickable) tileentity).Y_();
this.methodProfiler.e();
@@ -1213,10 +1215,13 @@ public abstract class World implements IEntityAccess, GeneratorAccess, IIBlockAc
((ITickable) tileentity).tick();
this.methodProfiler.exit();
} catch (Throwable throwable2) {
- crashreport1 = CrashReport.a(throwable2, "Ticking block entity");
- crashreportsystemdetails1 = crashreport1.a("Block entity being ticked");
@ -62,5 +62,5 @@ index 8984949ff5..4afa16fb8a 100644
// Spigot start
finally {
--
2.19.0
2.20.0

Datei anzeigen

@ -1,4 +1,4 @@
From 1967a1ab38d312568ab657d7099d270cab87cb9f Mon Sep 17 00:00:00 2001
From 65611361ad1379efabc6de8576ae3282f808ff3b Mon Sep 17 00:00:00 2001
From: Zach Brown <zach.brown@destroystokyo.com>
Date: Tue, 1 Mar 2016 23:58:50 -0600
Subject: [PATCH] Configurable top of nether void damage
@ -20,7 +20,7 @@ index 1ed58f4bb..39d565db1 100644
+ }
}
diff --git a/src/main/java/net/minecraft/server/Entity.java b/src/main/java/net/minecraft/server/Entity.java
index c7db9db95..12fe12e04 100644
index cc6ae6634..99716419e 100644
--- a/src/main/java/net/minecraft/server/Entity.java
+++ b/src/main/java/net/minecraft/server/Entity.java
@@ -463,9 +463,15 @@ public abstract class Entity implements INamableTileEntity, ICommandListener, Ke
@ -40,7 +40,7 @@ index c7db9db95..12fe12e04 100644
if (!this.world.isClientSide) {
this.setFlag(0, this.fireTicks > 0);
@@ -475,6 +481,14 @@ public abstract class Entity implements INamableTileEntity, ICommandListener, Ke
this.world.methodProfiler.e();
this.world.methodProfiler.exit();
}
+ // Paper start
@ -63,7 +63,7 @@ index c7db9db95..12fe12e04 100644
this.die();
}
diff --git a/src/main/java/net/minecraft/server/EntityMinecartAbstract.java b/src/main/java/net/minecraft/server/EntityMinecartAbstract.java
index 5bee194fa..b52bc659e 100644
index a2f334968..e741c7f83 100644
--- a/src/main/java/net/minecraft/server/EntityMinecartAbstract.java
+++ b/src/main/java/net/minecraft/server/EntityMinecartAbstract.java
@@ -195,9 +195,15 @@ public abstract class EntityMinecartAbstract extends Entity implements INamableT
@ -83,5 +83,5 @@ index 5bee194fa..b52bc659e 100644
int i;
--
2.19.2
2.20.0

Datei anzeigen

@ -1,4 +1,4 @@
From 7ac07ac07ac07ac07ac07ac07ac07ac07ac07ac0 Mon Sep 17 00:00:00 2001
From 3e0df901f487044ce2782c682f66e627e9411eb3 Mon Sep 17 00:00:00 2001
From: Aikar <aikar@aikar.co>
Date: Wed, 2 Mar 2016 00:52:31 -0600
Subject: [PATCH] Lighting Queue
@ -6,7 +6,7 @@ Subject: [PATCH] Lighting Queue
This provides option to queue lighting updates to ensure they do not cause the server lag
diff --git a/src/main/java/co/aikar/timings/WorldTimingsHandler.java b/src/main/java/co/aikar/timings/WorldTimingsHandler.java
index 7ac07ac07ac0..7ac07ac07ac0 100644
index 145cb274b..eff9dcf54 100644
--- a/src/main/java/co/aikar/timings/WorldTimingsHandler.java
+++ b/src/main/java/co/aikar/timings/WorldTimingsHandler.java
@@ -50,6 +50,8 @@ public class WorldTimingsHandler {
@ -28,7 +28,7 @@ index 7ac07ac07ac0..7ac07ac07ac0 100644
public static Timing getTickList(WorldServer worldserver, String timingsType) {
diff --git a/src/main/java/com/destroystokyo/paper/PaperConfig.java b/src/main/java/com/destroystokyo/paper/PaperConfig.java
index 7ac07ac07ac0..7ac07ac07ac0 100644
index fe148495b..cc69ff3a4 100644
--- a/src/main/java/com/destroystokyo/paper/PaperConfig.java
+++ b/src/main/java/com/destroystokyo/paper/PaperConfig.java
@@ -191,6 +191,13 @@ public class PaperConfig {
@ -46,7 +46,7 @@ index 7ac07ac07ac0..7ac07ac07ac0 100644
boolean timings = getBoolean("timings.enabled", true);
boolean verboseTimings = getBoolean("timings.verbose", true);
diff --git a/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java b/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java
index 7ac07ac07ac0..7ac07ac07ac0 100644
index 39d565db1..8f6f0288b 100644
--- a/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java
+++ b/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java
@@ -130,4 +130,12 @@ public class PaperWorldConfig {
@ -63,10 +63,10 @@ index 7ac07ac07ac0..7ac07ac07ac0 100644
+ }
}
diff --git a/src/main/java/net/minecraft/server/Chunk.java b/src/main/java/net/minecraft/server/Chunk.java
index 7ac07ac07ac0..7ac07ac07ac0 100644
index da2548603..87ec4d1a2 100644
--- a/src/main/java/net/minecraft/server/Chunk.java
+++ b/src/main/java/net/minecraft/server/Chunk.java
@@ -90,6 +90,7 @@ public class Chunk implements IChunkAccess {
@@ -95,6 +95,7 @@ public class Chunk implements IChunkAccess {
return removed;
}
}
@ -74,16 +74,16 @@ index 7ac07ac07ac0..7ac07ac07ac0 100644
// Paper end
public boolean areNeighborsLoaded(final int radius) {
switch (radius) {
@@ -280,7 +281,7 @@ public class Chunk implements IChunkAccess {
@@ -285,7 +286,7 @@ public class Chunk implements IChunkAccess {
private void g(boolean flag) {
this.world.methodProfiler.a("recheckGaps");
this.world.methodProfiler.enter("recheckGaps");
- if (this.world.areChunksLoaded(new BlockPosition(this.locX * 16 + 8, 0, this.locZ * 16 + 8), 16)) {
+ if (this.areNeighborsLoaded(1)) { // Paper
for (int i = 0; i < 16; ++i) {
for (int j = 0; j < 16; ++j) {
if (this.g[i + j * 16]) {
@@ -331,7 +332,7 @@ public class Chunk implements IChunkAccess {
@@ -336,7 +337,7 @@ public class Chunk implements IChunkAccess {
}
private void a(int i, int j, int k, int l) {
@ -92,7 +92,7 @@ index 7ac07ac07ac0..7ac07ac07ac0 100644
for (int i1 = k; i1 < l; ++i1) {
this.world.c(EnumSkyBlock.SKY, new BlockPosition(i, i1, j));
}
@@ -531,6 +532,7 @@ public class Chunk implements IChunkAccess {
@@ -536,6 +537,7 @@ public class Chunk implements IChunkAccess {
if (flag1) {
this.initLighting();
} else {
@ -100,7 +100,7 @@ index 7ac07ac07ac0..7ac07ac07ac0 100644
int i1 = iblockdata.b(this.world, blockposition);
int j1 = iblockdata1.b(this.world, blockposition);
@@ -538,6 +540,7 @@ public class Chunk implements IChunkAccess {
@@ -543,6 +545,7 @@ public class Chunk implements IChunkAccess {
if (i1 != j1 && (i1 < j1 || this.getBrightness(EnumSkyBlock.SKY, blockposition) > 0 || this.getBrightness(EnumSkyBlock.BLOCK, blockposition) > 0)) {
this.c(i, k);
}
@ -108,7 +108,7 @@ index 7ac07ac07ac0..7ac07ac07ac0 100644
}
TileEntity tileentity;
@@ -1348,6 +1351,16 @@ public class Chunk implements IChunkAccess {
@@ -1361,6 +1364,16 @@ public class Chunk implements IChunkAccess {
return this.D == 8;
}
@ -126,7 +126,7 @@ index 7ac07ac07ac0..7ac07ac07ac0 100644
IMMEDIATE, QUEUED, CHECK;
diff --git a/src/main/java/net/minecraft/server/ChunkProviderServer.java b/src/main/java/net/minecraft/server/ChunkProviderServer.java
index 7ac07ac07ac0..7ac07ac07ac0 100644
index 60abc5f28..6a9b9fa2a 100644
--- a/src/main/java/net/minecraft/server/ChunkProviderServer.java
+++ b/src/main/java/net/minecraft/server/ChunkProviderServer.java
@@ -314,6 +314,7 @@ public class ChunkProviderServer implements IChunkProvider {
@ -138,21 +138,21 @@ index 7ac07ac07ac0..7ac07ac07ac0 100644
// Update neighbor counts
for (int x = -2; x < 3; x++) {
diff --git a/src/main/java/net/minecraft/server/MinecraftServer.java b/src/main/java/net/minecraft/server/MinecraftServer.java
index 7ac07ac07ac0..7ac07ac07ac0 100644
index 4acb908ec..194f8441e 100644
--- a/src/main/java/net/minecraft/server/MinecraftServer.java
+++ b/src/main/java/net/minecraft/server/MinecraftServer.java
@@ -894,7 +894,7 @@ public abstract class MinecraftServer implements IAsyncTaskHandler, IMojangStati
protected void a(BooleanSupplier booleansupplier) {
co.aikar.timings.TimingsManager.FULL_SERVER_TICK.startTiming(); // Paper
this.slackActivityAccountant.tickStarted(); // Spigot
- long i = SystemUtils.c();
+ long i = SystemUtils.c(); long startTime = i; // Paper
- long i = SystemUtils.getMonotonicNanos();
+ long i = SystemUtils.getMonotonicNanos(); long startTime = i; // Paper
++this.ticks;
if (this.S) {
@@ -952,6 +952,7 @@ public abstract class MinecraftServer implements IAsyncTaskHandler, IMojangStati
this.methodProfiler.e();
this.methodProfiler.e();
this.methodProfiler.exit();
this.methodProfiler.exit();
org.spigotmc.WatchdogThread.tick(); // Spigot
+ PaperLightingQueue.processQueue(startTime); // Paper
this.slackActivityAccountant.tickEnded(l); // Spigot
@ -160,7 +160,7 @@ index 7ac07ac07ac0..7ac07ac07ac0 100644
}
diff --git a/src/main/java/net/minecraft/server/PaperLightingQueue.java b/src/main/java/net/minecraft/server/PaperLightingQueue.java
new file mode 100644
index 7ac07ac07ac0..7ac07ac07ac0
index 000000000..9783f3a0d
--- /dev/null
+++ b/src/main/java/net/minecraft/server/PaperLightingQueue.java
@@ -0,0 +1,98 @@
@ -189,7 +189,7 @@ index 7ac07ac07ac0..7ac07ac07ac0
+ continue;
+ }
+
+ ObjectCollection<Chunk> loadedChunks = ((WorldServer) world).getChunkProviderServer().chunks.values();
+ ObjectCollection<Chunk> loadedChunks = ((WorldServer) world).getChunkProvider().chunks.values();
+ for (Chunk chunk : loadedChunks.toArray(new Chunk[0])) {
+ if (chunk.lightingQueue.processQueue(startTime, maxTickTime)) {
+ break START;
@ -263,18 +263,18 @@ index 7ac07ac07ac0..7ac07ac07ac0
+ }
+}
diff --git a/src/main/java/net/minecraft/server/World.java b/src/main/java/net/minecraft/server/World.java
index 7ac07ac07ac0..7ac07ac07ac0 100644
index 5d5a9f0bb..69f55d0dd 100644
--- a/src/main/java/net/minecraft/server/World.java
+++ b/src/main/java/net/minecraft/server/World.java
@@ -335,7 +335,7 @@ public abstract class World implements IEntityAccess, GeneratorAccess, IIBlockAc
if (iblockdata2.b(this, blockposition) != iblockdata1.b(this, blockposition) || iblockdata2.e() != iblockdata1.e()) {
this.methodProfiler.a("checkLight");
this.methodProfiler.enter("checkLight");
- this.r(blockposition);
+ chunk.runOrQueueLightUpdate(() -> this.r(blockposition)); // Paper - Queue light update
this.methodProfiler.e();
this.methodProfiler.exit();
}
--
2.19.1
2.20.0

Datei anzeigen

@ -1,11 +1,11 @@
From 41ab545f015675893214f7a9d3649abbc8b78963 Mon Sep 17 00:00:00 2001
From 218a1980882ca92ea3578f3ad4d3a34804dbda7e Mon Sep 17 00:00:00 2001
From: DoctorDark <doctordark11@gmail.com>
Date: Wed, 16 Mar 2016 02:21:39 -0500
Subject: [PATCH] Configurable end credits
diff --git a/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java b/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java
index 8f6f0288be..5aee23dceb 100644
index 8f6f0288b..5aee23dce 100644
--- a/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java
+++ b/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java
@@ -138,4 +138,10 @@ public class PaperWorldConfig {
@ -20,16 +20,16 @@ index 8f6f0288be..5aee23dceb 100644
+ }
}
diff --git a/src/main/java/net/minecraft/server/EntityPlayer.java b/src/main/java/net/minecraft/server/EntityPlayer.java
index e0215bcdb8..cdf89cfed3 100644
index d0d93b1eb..2804bfc0a 100644
--- a/src/main/java/net/minecraft/server/EntityPlayer.java
+++ b/src/main/java/net/minecraft/server/EntityPlayer.java
@@ -61,7 +61,7 @@ public class EntityPlayer extends EntityHuman implements ICrafting {
private long cu = SystemUtils.b();
private Entity cv;
private long cu = SystemUtils.getMonotonicMillis();
private Entity spectatedEntity;
public boolean worldChangeInvuln;
- private boolean cx;
+ private boolean cx; private void setHasSeenCredits(boolean has) { this.cx = has; } // Paper - OBFHELPER
private final RecipeBookServer cy;
private final RecipeBookServer recipeBook;
private Vec3D cz;
private int cA;
@@ -649,6 +649,7 @@ public class EntityPlayer extends EntityHuman implements ICrafting {
@ -41,5 +41,5 @@ index e0215bcdb8..cdf89cfed3 100644
this.cx = true;
}
--
2.19.1
2.20.0

Datei anzeigen

@ -1,11 +1,11 @@
From 7f8761e0c24cca4d01e02ea972fa5696fc3174a1 Mon Sep 17 00:00:00 2001
From b45b30d876512ac7815531b094830438c30de107 Mon Sep 17 00:00:00 2001
From: Iceee <andrew@opticgaming.tv>
Date: Wed, 2 Mar 2016 01:39:52 -0600
Subject: [PATCH] Fix lag from explosions processing dead entities
diff --git a/src/main/java/net/minecraft/server/Explosion.java b/src/main/java/net/minecraft/server/Explosion.java
index e5ba6eddd..c7d11cf62 100644
index d564aaf60..92e3a49e2 100644
--- a/src/main/java/net/minecraft/server/Explosion.java
+++ b/src/main/java/net/minecraft/server/Explosion.java
@@ -111,7 +111,14 @@ public class Explosion {
@ -25,7 +25,7 @@ index e5ba6eddd..c7d11cf62 100644
for (int l1 = 0; l1 < list.size(); ++l1) {
diff --git a/src/main/java/net/minecraft/server/IEntitySelector.java b/src/main/java/net/minecraft/server/IEntitySelector.java
index 30f8ec519..b1d05220b 100644
index 2e2fb85cf..7b7fd6b9b 100644
--- a/src/main/java/net/minecraft/server/IEntitySelector.java
+++ b/src/main/java/net/minecraft/server/IEntitySelector.java
@@ -13,6 +13,7 @@ public final class IEntitySelector {
@ -36,16 +36,16 @@ index 30f8ec519..b1d05220b 100644
public static final Predicate<Entity> e = (entity) -> {
return !(entity instanceof EntityHuman) || !((EntityHuman)entity).isSpectator() && !((EntityHuman)entity).u();
};
@@ -96,8 +97,7 @@ public final class IEntitySelector {
@@ -96,9 +97,5 @@ public final class IEntitySelector {
}
}
- // $FF: synthetic method
- public boolean test(@Nullable Object object) {
+ public boolean test(@Nullable Entity object) { // Paper - decompile error
return this.a((Entity)object);
}
- return this.test((Entity)object);
- }
}
}
--
2.18.0
2.20.0

Datei anzeigen

@ -1,4 +1,4 @@
From 7ac07ac07ac07ac07ac07ac07ac07ac07ac07ac0 Mon Sep 17 00:00:00 2001
From bbbcb6b95ae225470a3f41c3cd0e6fe294587320 Mon Sep 17 00:00:00 2001
From: Byteflux <byte@byteflux.net>
Date: Wed, 2 Mar 2016 11:59:48 -0600
Subject: [PATCH] Optimize explosions
@ -10,7 +10,7 @@ This patch adds a per-tick cache that is used for storing and retrieving
an entity's exposure during an explosion.
diff --git a/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java b/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java
index 7ac07ac07ac0..7ac07ac07ac0 100644
index 5aee23dce..2ec3d9355 100644
--- a/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java
+++ b/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java
@@ -144,4 +144,10 @@ public class PaperWorldConfig {
@ -25,7 +25,7 @@ index 7ac07ac07ac0..7ac07ac07ac0 100644
+ }
}
diff --git a/src/main/java/net/minecraft/server/Explosion.java b/src/main/java/net/minecraft/server/Explosion.java
index 7ac07ac07ac0..7ac07ac07ac0 100644
index 92e3a49e2..10c415b37 100644
--- a/src/main/java/net/minecraft/server/Explosion.java
+++ b/src/main/java/net/minecraft/server/Explosion.java
@@ -137,7 +137,7 @@ public class Explosion {
@ -124,19 +124,19 @@ index 7ac07ac07ac0..7ac07ac07ac0 100644
+ // Paper end
}
diff --git a/src/main/java/net/minecraft/server/MinecraftServer.java b/src/main/java/net/minecraft/server/MinecraftServer.java
index 7ac07ac07ac0..7ac07ac07ac0 100644
index 194f8441e..eef8d2b5a 100644
--- a/src/main/java/net/minecraft/server/MinecraftServer.java
+++ b/src/main/java/net/minecraft/server/MinecraftServer.java
@@ -1059,6 +1059,7 @@ public abstract class MinecraftServer implements IAsyncTaskHandler, IMojangStati
worldserver.getTracker().updatePlayers();
this.methodProfiler.e();
this.methodProfiler.e();
this.methodProfiler.exit();
this.methodProfiler.exit();
+ worldserver.explosionDensityCache.clear(); // Paper - Optimize explosions
}
}
diff --git a/src/main/java/net/minecraft/server/World.java b/src/main/java/net/minecraft/server/World.java
index 7ac07ac07ac0..7ac07ac07ac0 100644
index 69f55d0dd..00880d54f 100644
--- a/src/main/java/net/minecraft/server/World.java
+++ b/src/main/java/net/minecraft/server/World.java
@@ -24,6 +24,7 @@ import org.apache.logging.log4j.Logger;
@ -156,5 +156,5 @@ index 7ac07ac07ac0..7ac07ac07ac0 100644
public CraftWorld getWorld() {
return this.world;
--
2.19.1
2.20.0

Datei anzeigen

@ -1,11 +1,11 @@
From baf90d1a6d61697bf6b0d2ad89a714ef689d5ef1 Mon Sep 17 00:00:00 2001
From 0fc496b449eaf0a6b9cb98c8ab8d345e297a35a6 Mon Sep 17 00:00:00 2001
From: Byteflux <byte@byteflux.net>
Date: Wed, 2 Mar 2016 14:35:27 -0600
Subject: [PATCH] Add player view distance API
diff --git a/src/main/java/net/minecraft/server/EntityHuman.java b/src/main/java/net/minecraft/server/EntityHuman.java
index 6b58f632bd..d245502286 100644
index 1aec6d7c3..1185769ca 100644
--- a/src/main/java/net/minecraft/server/EntityHuman.java
+++ b/src/main/java/net/minecraft/server/EntityHuman.java
@@ -74,6 +74,15 @@ public abstract class EntityHuman extends EntityLiving {
@ -25,7 +25,7 @@ index 6b58f632bd..d245502286 100644
// CraftBukkit start
public boolean fauxSleeping;
diff --git a/src/main/java/net/minecraft/server/EntityTracker.java b/src/main/java/net/minecraft/server/EntityTracker.java
index 70c9b1f50c..0ea6392284 100644
index d7f33bd53..63e22bd9a 100644
--- a/src/main/java/net/minecraft/server/EntityTracker.java
+++ b/src/main/java/net/minecraft/server/EntityTracker.java
@@ -200,6 +200,7 @@ public class EntityTracker {
@ -37,7 +37,7 @@ index 70c9b1f50c..0ea6392284 100644
Iterator iterator = this.c.iterator();
diff --git a/src/main/java/net/minecraft/server/EntityTrackerEntry.java b/src/main/java/net/minecraft/server/EntityTrackerEntry.java
index 8478a81f5c..5dbd493f41 100644
index 6a622f72e..4272d2036 100644
--- a/src/main/java/net/minecraft/server/EntityTrackerEntry.java
+++ b/src/main/java/net/minecraft/server/EntityTrackerEntry.java
@@ -435,7 +435,7 @@ public class EntityTrackerEntry {
@ -50,7 +50,7 @@ index 8478a81f5c..5dbd493f41 100644
return d0 >= (double) (-i) && d0 <= (double) i && d1 >= (double) (-i) && d1 <= (double) i && this.tracker.a(entityplayer);
}
diff --git a/src/main/java/net/minecraft/server/PlayerChunkMap.java b/src/main/java/net/minecraft/server/PlayerChunkMap.java
index 12a8fec29a..7ca85a56ca 100644
index 29e24940f..653031af4 100644
--- a/src/main/java/net/minecraft/server/PlayerChunkMap.java
+++ b/src/main/java/net/minecraft/server/PlayerChunkMap.java
@@ -35,7 +35,7 @@ public class PlayerChunkMap {
@ -62,7 +62,7 @@ index 12a8fec29a..7ca85a56ca 100644
private long k;
private boolean l = true;
private boolean m = true;
@@ -265,8 +265,11 @@ public class PlayerChunkMap {
@@ -261,8 +261,11 @@ public class PlayerChunkMap {
// CraftBukkit start - Load nearby chunks first
List<ChunkCoordIntPair> chunkList = new LinkedList<ChunkCoordIntPair>();
@ -76,7 +76,7 @@ index 12a8fec29a..7ca85a56ca 100644
chunkList.add(new ChunkCoordIntPair(k, l));
}
}
@@ -285,8 +288,11 @@ public class PlayerChunkMap {
@@ -281,8 +284,11 @@ public class PlayerChunkMap {
int i = (int) entityplayer.d >> 4;
int j = (int) entityplayer.e >> 4;
@ -90,7 +90,7 @@ index 12a8fec29a..7ca85a56ca 100644
PlayerChunk playerchunk = this.getChunk(k, l);
if (playerchunk != null) {
@@ -316,7 +322,8 @@ public class PlayerChunkMap {
@@ -312,7 +318,8 @@ public class PlayerChunkMap {
if (d2 >= 64.0D) {
int k = (int) entityplayer.d >> 4;
int l = (int) entityplayer.e >> 4;
@ -100,7 +100,7 @@ index 12a8fec29a..7ca85a56ca 100644
int j1 = i - k;
int k1 = j - l;
@@ -360,6 +367,8 @@ public class PlayerChunkMap {
@@ -356,6 +363,8 @@ public class PlayerChunkMap {
return playerchunk != null && playerchunk.d(entityplayer) && playerchunk.e();
}
@ -109,7 +109,7 @@ index 12a8fec29a..7ca85a56ca 100644
public void a(int i) {
i = MathHelper.clamp(i, 3, 32);
if (i != this.j) {
@@ -369,36 +378,55 @@ public class PlayerChunkMap {
@@ -365,36 +374,55 @@ public class PlayerChunkMap {
while (iterator.hasNext()) {
EntityPlayer entityplayer = (EntityPlayer) iterator.next();
@ -187,7 +187,7 @@ index 12a8fec29a..7ca85a56ca 100644
private void e() {
this.l = true;
@@ -477,4 +505,32 @@ public class PlayerChunkMap {
@@ -473,4 +501,32 @@ public class PlayerChunkMap {
}
}
// CraftBukkit end
@ -221,7 +221,7 @@ index 12a8fec29a..7ca85a56ca 100644
+ // Paper end
}
diff --git a/src/main/java/net/minecraft/server/SpawnerCreature.java b/src/main/java/net/minecraft/server/SpawnerCreature.java
index 601d4c62d4..b919226bbf 100644
index ff564508f..4233b94a1 100644
--- a/src/main/java/net/minecraft/server/SpawnerCreature.java
+++ b/src/main/java/net/minecraft/server/SpawnerCreature.java
@@ -44,7 +44,7 @@ public final class SpawnerCreature {
@ -234,7 +234,7 @@ index 601d4c62d4..b919226bbf 100644
for (int i1 = -b0; i1 <= b0; ++i1) {
diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
index 6635f1a4a3..d2ff18cf77 100644
index 6635f1a4a..d2ff18cf7 100644
--- a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
+++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
@@ -1646,6 +1646,16 @@ public class CraftPlayer extends CraftHumanEntity implements Player {
@ -255,7 +255,7 @@ index 6635f1a4a3..d2ff18cf77 100644
@Override
diff --git a/src/main/java/org/spigotmc/ActivationRange.java b/src/main/java/org/spigotmc/ActivationRange.java
index a95f93eb76..09df00e94b 100644
index a95f93eb7..09df00e94 100644
--- a/src/main/java/org/spigotmc/ActivationRange.java
+++ b/src/main/java/org/spigotmc/ActivationRange.java
@@ -108,13 +108,13 @@ public class ActivationRange
@ -276,5 +276,5 @@ index a95f93eb76..09df00e94b 100644
animalBB = player.getBoundingBox().grow( animalActivationRange, 256, animalActivationRange );
monsterBB = player.getBoundingBox().grow( monsterActivationRange, 256, monsterActivationRange );
--
2.19.1
2.20.0

Datei anzeigen

@ -1,11 +1,11 @@
From 4da0d767e1e909a98ed9e0714241d187b9d0af61 Mon Sep 17 00:00:00 2001
From 728e0827b06ae5a4180b22c7e2163d580c1632a6 Mon Sep 17 00:00:00 2001
From: Sudzzy <originmc@outlook.com>
Date: Wed, 2 Mar 2016 14:57:24 -0600
Subject: [PATCH] Disable ice and snow
diff --git a/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java b/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java
index 13253f6e9c..cde9c11f4d 100644
index 13253f6e9..cde9c11f4 100644
--- a/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java
+++ b/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java
@@ -160,4 +160,9 @@ public class PaperWorldConfig {
@ -19,18 +19,18 @@ index 13253f6e9c..cde9c11f4d 100644
+ }
}
diff --git a/src/main/java/net/minecraft/server/WorldServer.java b/src/main/java/net/minecraft/server/WorldServer.java
index f39ce330f6..2341ce3f93 100644
index 73e9ff1b3..2558a20f6 100644
--- a/src/main/java/net/minecraft/server/WorldServer.java
+++ b/src/main/java/net/minecraft/server/WorldServer.java
@@ -513,7 +513,7 @@ public class WorldServer extends World implements IAsyncTaskHandler {
}
this.methodProfiler.c("iceandsnow");
this.methodProfiler.exitEnter("iceandsnow");
- if (this.random.nextInt(16) == 0) {
+ if (!this.paperConfig.disableIceAndSnow && this.random.nextInt(16) == 0) { // Paper - Disable ice and snow
this.m = this.m * 3 + 1013904223;
l = this.m >> 2;
blockposition = this.getHighestBlockYAt(HeightMap.Type.MOTION_BLOCKING, new BlockPosition(j + (l & 15), 0, k + (l >> 8 & 15)));
--
2.19.0
2.20.0

Datei anzeigen

@ -1,14 +1,14 @@
From 933080a0dc72a443ce3fac4cd03ae8a737e66e81 Mon Sep 17 00:00:00 2001
From 792f2e79ad0dd0e0c558ef3924a1dd34120a2901 Mon Sep 17 00:00:00 2001
From: Zach Brown <zach.brown@destroystokyo.com>
Date: Wed, 2 Mar 2016 23:45:17 -0600
Subject: [PATCH] Disable spigot tick limiters
diff --git a/src/main/java/net/minecraft/server/World.java b/src/main/java/net/minecraft/server/World.java
index 9a7da83b82..4a457e3302 100644
index 00880d54f..214adec9b 100644
--- a/src/main/java/net/minecraft/server/World.java
+++ b/src/main/java/net/minecraft/server/World.java
@@ -1174,10 +1174,10 @@ public abstract class World implements IEntityAccess, GeneratorAccess, IIBlockAc
@@ -1124,10 +1124,10 @@ public abstract class World implements IEntityAccess, GeneratorAccess, IIBlockAc
// CraftBukkit start - Use field for loop variable
co.aikar.timings.TimingHistory.entityTicks += this.entityList.size(); // Paper
int entitiesThisCycle = 0;
@ -23,7 +23,7 @@ index 9a7da83b82..4a457e3302 100644
tickPosition = (tickPosition < entityList.size()) ? tickPosition : 0;
entity = (Entity) this.entityList.get(this.tickPosition);
// CraftBukkit end
@@ -1241,9 +1241,7 @@ public abstract class World implements IEntityAccess, GeneratorAccess, IIBlockAc
@@ -1191,9 +1191,7 @@ public abstract class World implements IEntityAccess, GeneratorAccess, IIBlockAc
// Spigot start
// Iterator iterator = this.tileEntityListTick.iterator();
int tilesThisCycle = 0;
@ -35,5 +35,5 @@ index 9a7da83b82..4a457e3302 100644
TileEntity tileentity = (TileEntity) this.tileEntityListTick.get(tileTickPosition);
// Spigot start
--
2.19.0
2.20.0

Datei anzeigen

@ -1,4 +1,4 @@
From 7ac07ac07ac07ac07ac07ac07ac07ac07ac07ac0 Mon Sep 17 00:00:00 2001
From 5abf081ee514bf133173e6b77aede9134606ec6f Mon Sep 17 00:00:00 2001
From: CullanP <cullanpage@gmail.com>
Date: Thu, 3 Mar 2016 02:13:38 -0600
Subject: [PATCH] Avoid hopper searches if there are no items
@ -14,10 +14,10 @@ And since minecart hoppers are used _very_ rarely near we can avoid alot of sear
Combined, this adds up a lot.
diff --git a/src/main/java/net/minecraft/server/Chunk.java b/src/main/java/net/minecraft/server/Chunk.java
index 7ac07ac07ac0..7ac07ac07ac0 100644
index 87ec4d1a2..c5d562dca 100644
--- a/src/main/java/net/minecraft/server/Chunk.java
+++ b/src/main/java/net/minecraft/server/Chunk.java
@@ -91,6 +91,10 @@ public class Chunk implements IChunkAccess {
@@ -96,6 +96,10 @@ public class Chunk implements IChunkAccess {
}
}
final PaperLightingQueue.LightingQueue lightingQueue = new PaperLightingQueue.LightingQueue(this);
@ -28,8 +28,8 @@ index 7ac07ac07ac0..7ac07ac07ac0 100644
// Paper end
public boolean areNeighborsLoaded(final int radius) {
switch (radius) {
@@ -685,6 +689,11 @@ public class Chunk implements IChunkAccess {
entity.ag = this.locZ;
@@ -690,6 +694,11 @@ public class Chunk implements IChunkAccess {
entity.chunkZ = this.locZ;
this.entitySlices[k].add(entity);
// Paper start
+ if (entity instanceof EntityItem) {
@ -40,7 +40,7 @@ index 7ac07ac07ac0..7ac07ac07ac0 100644
entity.setCurrentChunk(this);
entityCounts.increment(entity.getMinecraftKeyString());
// Paper end
@@ -710,6 +719,11 @@ public class Chunk implements IChunkAccess {
@@ -715,6 +724,11 @@ public class Chunk implements IChunkAccess {
if (!this.entitySlices[i].remove(entity)) {
return;
}
@ -52,7 +52,7 @@ index 7ac07ac07ac0..7ac07ac07ac0 100644
entity.setCurrentChunk(null);
entityCounts.decrement(entity.getMinecraftKeyString());
// Paper end
@@ -949,6 +963,15 @@ public class Chunk implements IChunkAccess {
@@ -962,6 +976,15 @@ public class Chunk implements IChunkAccess {
if (!this.entitySlices[k].isEmpty()) {
Iterator iterator = this.entitySlices[k].iterator();
@ -68,7 +68,7 @@ index 7ac07ac07ac0..7ac07ac07ac0 100644
while (iterator.hasNext()) {
Entity entity1 = (Entity) iterator.next();
@@ -985,7 +1008,18 @@ public class Chunk implements IChunkAccess {
@@ -998,7 +1021,18 @@ public class Chunk implements IChunkAccess {
i = MathHelper.clamp(i, 0, this.entitySlices.length - 1);
j = MathHelper.clamp(j, 0, this.entitySlices.length - 1);
@ -88,7 +88,7 @@ index 7ac07ac07ac0..7ac07ac07ac0 100644
while (iterator.hasNext()) {
diff --git a/src/main/java/net/minecraft/server/IEntitySelector.java b/src/main/java/net/minecraft/server/IEntitySelector.java
index 7ac07ac07ac0..7ac07ac07ac0 100644
index 7b7fd6b9b..eb08a1caa 100644
--- a/src/main/java/net/minecraft/server/IEntitySelector.java
+++ b/src/main/java/net/minecraft/server/IEntitySelector.java
@@ -10,6 +10,7 @@ public final class IEntitySelector {
@ -100,5 +100,5 @@ index 7ac07ac07ac0..7ac07ac07ac0 100644
return entity instanceof IInventory && entity.isAlive();
};
--
2.19.1
2.20.0

Datei anzeigen

@ -1,14 +1,14 @@
From 95dbbc6f6a22b1e3d43ab82d83945f79b59dcf01 Mon Sep 17 00:00:00 2001
From 361868edfeb629c5a507c7d2db5ddcb2266f4774 Mon Sep 17 00:00:00 2001
From: kashike <kashike@vq.lc>
Date: Thu, 3 Mar 2016 02:15:57 -0600
Subject: [PATCH] Expose server CommandMap
diff --git a/src/main/java/org/bukkit/craftbukkit/CraftServer.java b/src/main/java/org/bukkit/craftbukkit/CraftServer.java
index 2bc16fb1a..cd17cdcf3 100644
index 6700ce84c..71bd5bc71 100644
--- a/src/main/java/org/bukkit/craftbukkit/CraftServer.java
+++ b/src/main/java/org/bukkit/craftbukkit/CraftServer.java
@@ -1641,6 +1641,7 @@ public final class CraftServer implements Server {
@@ -1640,6 +1640,7 @@ public final class CraftServer implements Server {
return helpMap;
}
@ -17,5 +17,5 @@ index 2bc16fb1a..cd17cdcf3 100644
return commandMap;
}
--
2.19.1
2.20.0

Datei anzeigen

@ -1,11 +1,11 @@
From 2eeade3b60ffa9d2da91ae718e6c0ec98986f926 Mon Sep 17 00:00:00 2001
From 1739a3d8040f80e9389d2113e3e83337d8e52e90 Mon Sep 17 00:00:00 2001
From: Joseph Hirschfeld <joe@ibj.io>
Date: Thu, 3 Mar 2016 02:39:54 -0600
Subject: [PATCH] Change implementation of (tile)entity removal list
diff --git a/src/main/java/net/minecraft/server/World.java b/src/main/java/net/minecraft/server/World.java
index 352a7f25a7..65e84b666f 100644
index 214adec9b..a9239ee7b 100644
--- a/src/main/java/net/minecraft/server/World.java
+++ b/src/main/java/net/minecraft/server/World.java
@@ -73,11 +73,11 @@ public abstract class World implements IEntityAccess, GeneratorAccess, IIBlockAc
@ -22,7 +22,7 @@ index 352a7f25a7..65e84b666f 100644
public final List<EntityHuman> players = Lists.newArrayList();
public final List<Entity> k = Lists.newArrayList();
protected final IntHashMap<Entity> entitiesById = new IntHashMap();
@@ -1145,20 +1145,20 @@ public abstract class World implements IEntityAccess, GeneratorAccess, IIBlockAc
@@ -1095,20 +1095,20 @@ public abstract class World implements IEntityAccess, GeneratorAccess, IIBlockAc
this.entityList.removeAll(this.g);
int j;
@ -33,9 +33,9 @@ index 352a7f25a7..65e84b666f 100644
- for (i = 0; i < this.g.size(); ++i) {
- entity = (Entity) this.g.get(i);
- int k = entity.ae;
- int k = entity.chunkX;
-
- j = entity.ag;
- j = entity.chunkZ;
- if (entity.inChunk && this.isChunkLoaded(k, j, true)) {
- this.getChunkAt(k, j).b(entity);
+ if (e.inChunk && this.isChunkLoaded(k, j, true)) {
@ -53,5 +53,5 @@ index 352a7f25a7..65e84b666f 100644
this.g.clear();
this.p_();
--
2.19.0
2.20.0

Datei anzeigen

@ -1,4 +1,4 @@
From 36694c1b91770ae842431bb2a55017f2e932a4b1 Mon Sep 17 00:00:00 2001
From d59504f70dfb71a27f3bee67630007337fc29f74 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 bc7ffbf8a..64342f54c 100644
index c5d562dca..37bea8dbe 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 bc7ffbf8a..64342f54c 100644
import com.google.common.collect.Maps;
import com.google.common.collect.Queues;
import com.google.common.collect.Sets;
@@ -420,6 +421,7 @@ public class Chunk implements IChunkAccess {
@@ -425,6 +426,7 @@ public class Chunk implements IChunkAccess {
return this.getBlockData(i, j, k).b(this.world, new BlockPosition(i, j, k));
}
@ -67,7 +67,7 @@ index bc7ffbf8a..64342f54c 100644
public IBlockData getType(BlockPosition blockposition) {
return this.getBlockData(blockposition.getX(), blockposition.getY(), blockposition.getZ());
}
@@ -815,10 +817,15 @@ public class Chunk implements IChunkAccess {
@@ -820,10 +822,15 @@ public class Chunk implements IChunkAccess {
this.tileEntities.remove(blockposition);
// Paper end
} else {
@ -119,7 +119,7 @@ index 6a9b9fa2a..557aa5180 100644
}
diff --git a/src/main/java/net/minecraft/server/NameReferencingFileConverter.java b/src/main/java/net/minecraft/server/NameReferencingFileConverter.java
index 399eb231d..6a59e798d 100644
index 95120be5d..5977d3b48 100644
--- a/src/main/java/net/minecraft/server/NameReferencingFileConverter.java
+++ b/src/main/java/net/minecraft/server/NameReferencingFileConverter.java
@@ -1,5 +1,6 @@
@ -146,7 +146,7 @@ index 399eb231d..6a59e798d 100644
}
// CraftBukkit end
diff --git a/src/main/java/net/minecraft/server/RegionFile.java b/src/main/java/net/minecraft/server/RegionFile.java
index f991fddf7..e888c9bdb 100644
index 66fe6ff86..06417b9ec 100644
--- a/src/main/java/net/minecraft/server/RegionFile.java
+++ b/src/main/java/net/minecraft/server/RegionFile.java
@@ -1,5 +1,6 @@
@ -165,7 +165,7 @@ index f991fddf7..e888c9bdb 100644
}
@@ -221,6 +223,7 @@ public class RegionFile {
this.b(i, j, (int)(SystemUtils.d() / 1000L));
this.b(i, j, (int)(SystemUtils.getTimeMillis() / 1000L));
} catch (IOException ioexception) {
ioexception.printStackTrace();
+ ServerInternalException.reportInternalException(ioexception); // Paper
@ -173,7 +173,7 @@ index f991fddf7..e888c9bdb 100644
}
diff --git a/src/main/java/net/minecraft/server/RegionFileCache.java b/src/main/java/net/minecraft/server/RegionFileCache.java
index d18921271..e5115863e 100644
index c5ca89691..e507a996f 100644
--- a/src/main/java/net/minecraft/server/RegionFileCache.java
+++ b/src/main/java/net/minecraft/server/RegionFileCache.java
@@ -1,5 +1,6 @@
@ -240,7 +240,7 @@ index e649d662a..560edb523 100644
}
diff --git a/src/main/java/net/minecraft/server/World.java b/src/main/java/net/minecraft/server/World.java
index 3ecddf0fd..20ab0d420 100644
index a9239ee7b..0e70a3d68 100644
--- a/src/main/java/net/minecraft/server/World.java
+++ b/src/main/java/net/minecraft/server/World.java
@@ -1,6 +1,8 @@
@ -252,7 +252,7 @@ index 3ecddf0fd..20ab0d420 100644
import com.google.common.base.MoreObjects;
import com.google.common.collect.Lists;
import it.unimi.dsi.fastutil.longs.LongSet;
@@ -1200,8 +1202,10 @@ public abstract class World implements IEntityAccess, GeneratorAccess, IIBlockAc
@@ -1150,8 +1152,10 @@ public abstract class World implements IEntityAccess, GeneratorAccess, IIBlockAc
} catch (Throwable throwable1) {
entity.tickTimer.stopTiming();
// Paper start - Prevent tile entity and entity crashes
@ -264,8 +264,8 @@ index 3ecddf0fd..20ab0d420 100644
entity.dead = true;
continue;
// Paper end
@@ -1266,8 +1270,10 @@ public abstract class World implements IEntityAccess, GeneratorAccess, IIBlockAc
this.methodProfiler.e();
@@ -1216,8 +1220,10 @@ public abstract class World implements IEntityAccess, GeneratorAccess, IIBlockAc
this.methodProfiler.exit();
} catch (Throwable throwable2) {
// Paper start - Prevent tile entity and entity crashes
- System.err.println("TileEntity threw exception at " + tileentity.world.getWorld().getName() + ":" + tileentity.position.getX() + "," + tileentity.position.getY() + "," + tileentity.position.getZ());
@ -277,16 +277,16 @@ index 3ecddf0fd..20ab0d420 100644
this.tileEntityListTick.remove(tileTickPosition--);
continue;
diff --git a/src/main/java/net/minecraft/server/WorldPersistentData.java b/src/main/java/net/minecraft/server/WorldPersistentData.java
index b21f7073f..882b8fe4f 100644
index f0a826cd1..2dee02669 100644
--- a/src/main/java/net/minecraft/server/WorldPersistentData.java
+++ b/src/main/java/net/minecraft/server/WorldPersistentData.java
@@ -138,6 +138,7 @@ public class WorldPersistentData {
nbttagcompound = GameProfileSerializer.a(idatamanager.i(), DataFixTypes.SAVED_DATA, nbttagcompound1, j, i);
} catch (Throwable throwable1) {
+ com.destroystokyo.paper.exception.ServerInternalException.reportInternalException(throwable1); // Paper
throwable = throwable1;
throw throwable1;
@@ -121,6 +121,7 @@ public class WorldPersistentData {
int j = nbttagcompound.hasKeyOfType("DataVersion", 99) ? nbttagcompound.getInt("DataVersion") : 1343;
nbttagcompound1 = GameProfileSerializer.a(idatamanager.i(), DataFixTypes.SAVED_DATA, nbttagcompound, j, i);
} catch (Throwable throwable2) {
+ com.destroystokyo.paper.exception.ServerInternalException.reportInternalException(throwable2); // Paper
throwable = throwable2;
throw throwable2;
} finally {
diff --git a/src/main/java/org/bukkit/craftbukkit/scheduler/CraftScheduler.java b/src/main/java/org/bukkit/craftbukkit/scheduler/CraftScheduler.java
index 311c4f5ca..e76882b8e 100644
@ -335,5 +335,5 @@ index 311c4f5ca..e76882b8e 100644
// (async tasks must live with race-conditions if they attempt to cancel between these few lines of code)
}
--
2.19.2
2.20.0

Datei anzeigen

@ -1,4 +1,4 @@
From 8db6f7dff5c3f970e46f8f6bb6005c7067e235e0 Mon Sep 17 00:00:00 2001
From f2a8776578335496dd9595b3d6a735ca6a52d675 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 50837d767f..898068a817 100644
index 50837d767..898068a81 100644
--- a/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java
+++ b/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java
@@ -195,4 +195,9 @@ public class PaperWorldConfig {
@ -25,19 +25,19 @@ index 50837d767f..898068a817 100644
+ }
}
diff --git a/src/main/java/net/minecraft/server/Entity.java b/src/main/java/net/minecraft/server/Entity.java
index 6b413833da..43ceb2fb18 100644
index 99716419e..caeb5eae0 100644
--- a/src/main/java/net/minecraft/server/Entity.java
+++ b/src/main/java/net/minecraft/server/Entity.java
@@ -2247,6 +2247,7 @@ public abstract class Entity implements INamableTileEntity, ICommandListener, Ke
@Nullable
public ScoreboardTeamBase be() {
public ScoreboardTeamBase getScoreboardTeam() {
+ if (!this.world.paperConfig.nonPlayerEntitiesOnScoreboards && !(this instanceof EntityHuman)) { return null; } // Paper
return this.world.getScoreboard().getPlayerTeam(this.getName());
}
diff --git a/src/main/java/net/minecraft/server/EntityLiving.java b/src/main/java/net/minecraft/server/EntityLiving.java
index 961da5bf97..91baaa5062 100644
index da105b41c..6f8ac61d8 100644
--- a/src/main/java/net/minecraft/server/EntityLiving.java
+++ b/src/main/java/net/minecraft/server/EntityLiving.java
@@ -538,6 +538,7 @@ public abstract class EntityLiving extends Entity {
@ -49,5 +49,5 @@ index 961da5bf97..91baaa5062 100644
if (!flag) {
--
2.19.0
2.20.0

Datei anzeigen

@ -1,4 +1,4 @@
From 8b104aaf5b009efc9c04ac1839443575da074737 Mon Sep 17 00:00:00 2001
From b8e76a39e5eaeb73e676e879ffd8650dc68ee57c 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,12 +6,12 @@ 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 e888c9bdba..f4405be395 100644
index 06417b9ec..e1c0921ea 100644
--- a/src/main/java/net/minecraft/server/RegionFile.java
+++ b/src/main/java/net/minecraft/server/RegionFile.java
@@ -222,8 +222,7 @@ public class RegionFile {
this.b(i, j, (int)(SystemUtils.d() / 1000L));
this.b(i, j, (int)(SystemUtils.getTimeMillis() / 1000L));
} catch (IOException ioexception) {
- ioexception.printStackTrace();
- ServerInternalException.reportInternalException(ioexception); // Paper
@ -20,7 +20,7 @@ index e888c9bdba..f4405be395 100644
}
diff --git a/src/main/java/net/minecraft/server/RegionFileCache.java b/src/main/java/net/minecraft/server/RegionFileCache.java
index e5115863ec..2217adf99c 100644
index e507a996f..5dbd1d517 100644
--- a/src/main/java/net/minecraft/server/RegionFileCache.java
+++ b/src/main/java/net/minecraft/server/RegionFileCache.java
@@ -95,11 +95,29 @@ public class RegionFileCache {
@ -54,5 +54,5 @@ index e5115863ec..2217adf99c 100644
public static synchronized boolean chunkExists(File file, int i, int j) {
--
2.19.0
2.20.0

Datei anzeigen

@ -1,4 +1,4 @@
From 65d546877bed1fdc70d0ffaaa8f616be16e01236 Mon Sep 17 00:00:00 2001
From f3c64acdb1626e3c83b9b962dd648cc43426b85a 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 bbd8969db..90177b72c 100644
index bcd8ba4ad..70c3cde24 100644
--- a/src/main/java/org/bukkit/craftbukkit/CraftServer.java
+++ b/src/main/java/org/bukkit/craftbukkit/CraftServer.java
@@ -2053,5 +2053,23 @@ public final class CraftServer implements Server {
@@ -2052,5 +2052,23 @@ public final class CraftServer implements Server {
return false;
}
}
@ -34,5 +34,5 @@ index bbd8969db..90177b72c 100644
// Paper end
}
--
2.19.1
2.20.0

Datei anzeigen

@ -1,4 +1,4 @@
From 7ac07ac07ac07ac07ac07ac07ac07ac07ac07ac0 Mon Sep 17 00:00:00 2001
From e69350a0263767ab2332db30c6fa93cddbf4237d 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
@ -6,10 +6,10 @@ 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 7ac07ac07ac0..7ac07ac07ac0 100644
index 37bea8dbe..eca041265 100644
--- a/src/main/java/net/minecraft/server/Chunk.java
+++ b/src/main/java/net/minecraft/server/Chunk.java
@@ -633,6 +633,7 @@ public class Chunk implements IChunkAccess {
@@ -638,6 +638,7 @@ public class Chunk implements IChunkAccess {
}
}
@ -18,7 +18,7 @@ index 7ac07ac07ac0..7ac07ac07ac0 100644
return this.a(blockposition, i, this.world.o().g());
}
diff --git a/src/main/java/net/minecraft/server/IWorldReader.java b/src/main/java/net/minecraft/server/IWorldReader.java
index 7ac07ac07ac0..7ac07ac07ac0 100644
index f5c56de0c..9b972e65d 100644
--- a/src/main/java/net/minecraft/server/IWorldReader.java
+++ b/src/main/java/net/minecraft/server/IWorldReader.java
@@ -35,6 +35,22 @@ public interface IWorldReader extends IBlockAccess {
@ -54,7 +54,7 @@ index 7ac07ac07ac0..7ac07ac07ac0 100644
};
Stream stream = StreamSupport.stream(BlockPosition.MutableBlockPosition.b(i, k, i1, j - 1, l - 1, j1 - 1).spliterator(), false).map((blockposition$mutableblockposition) -> {
diff --git a/src/main/java/net/minecraft/server/World.java b/src/main/java/net/minecraft/server/World.java
index 7ac07ac07ac0..7ac07ac07ac0 100644
index 0e70a3d68..4093d3486 100644
--- a/src/main/java/net/minecraft/server/World.java
+++ b/src/main/java/net/minecraft/server/World.java
@@ -84,7 +84,7 @@ public abstract class World implements IEntityAccess, GeneratorAccess, IIBlockAc
@ -151,5 +151,5 @@ index 7ac07ac07ac0..7ac07ac07ac0 100644
return this.getChunkAt(blockposition.getX() >> 4, blockposition.getZ() >> 4);
}
--
2.19.1
2.20.0

Datei anzeigen

@ -1,14 +1,14 @@
From 5f489d6f0d19763383fc223b8f8b1a0b3743ccf7 Mon Sep 17 00:00:00 2001
From a344b3a7f2aa1b2bc16b50743b31c011f4b3c996 Mon Sep 17 00:00:00 2001
From: Daniel Ennis <dennis@icontact.com>
Date: Sun, 20 Mar 2016 15:22:42 -0400
Subject: [PATCH] Catch Async PlayerChunkMap operations
diff --git a/src/main/java/net/minecraft/server/PlayerChunkMap.java b/src/main/java/net/minecraft/server/PlayerChunkMap.java
index fb593529e1..a69d510dd1 100644
index 653031af4..3d17ad646 100644
--- a/src/main/java/net/minecraft/server/PlayerChunkMap.java
+++ b/src/main/java/net/minecraft/server/PlayerChunkMap.java
@@ -442,10 +442,12 @@ public class PlayerChunkMap {
@@ -438,10 +438,12 @@ public class PlayerChunkMap {
}
public void a(PlayerChunk playerchunk) {
@ -22,5 +22,5 @@ index fb593529e1..a69d510dd1 100644
long i = d(chunkcoordintpair.x, chunkcoordintpair.z);
--
2.19.0
2.20.0

Datei anzeigen

@ -1,4 +1,4 @@
From 9d894a3b3e3aee3b5cdd072ead5de268498b1191 Mon Sep 17 00:00:00 2001
From f5810f944e68391b4e1b8c35968b89a54f6ee177 Mon Sep 17 00:00:00 2001
From: Aikar <aikar@aikar.co>
Date: Thu, 27 Aug 2015 01:15:02 -0400
Subject: [PATCH] Optimize Chunk Access
@ -9,12 +9,12 @@ getChunkAt is called for the same chunk multiple times in a row, often from getT
Optimize this look up by using a Last Access cache.
diff --git a/src/main/java/net/minecraft/server/ChunkMap.java b/src/main/java/net/minecraft/server/ChunkMap.java
index ca18901df..2ebb2d834 100644
index 732c8793e..8b3738c8f 100644
--- a/src/main/java/net/minecraft/server/ChunkMap.java
+++ b/src/main/java/net/minecraft/server/ChunkMap.java
@@ -15,6 +15,7 @@ public class ChunkMap extends Long2ObjectOpenHashMap<Chunk> {
public Chunk a(long i, Chunk chunk) {
public Chunk put(long i, Chunk chunk) {
chunk.world.timings.syncChunkLoadPostTimer.startTiming(); // Paper
+ lastChunkByPos = chunk; // Paper
Chunk chunk1 = (Chunk) super.put(i, chunk);
@ -68,8 +68,8 @@ index ca18901df..2ebb2d834 100644
+ }
+ // Paper end
public Chunk a(Object object) {
return this.a((Long) object);
public Chunk remove(Object object) {
return this.remove((Long) object);
diff --git a/src/main/java/net/minecraft/server/ChunkProviderServer.java b/src/main/java/net/minecraft/server/ChunkProviderServer.java
index 557aa5180..1d08ec37f 100644
--- a/src/main/java/net/minecraft/server/ChunkProviderServer.java
@ -121,5 +121,5 @@ index 557aa5180..1d08ec37f 100644
}
}
--
2.19.2
2.20.0

Datei anzeigen

@ -1,4 +1,4 @@
From 04b7649ebd2cec65cac90240083f2bd66eaba5ef Mon Sep 17 00:00:00 2001
From f8874981d7f1f44b2420f499c41ecadd99903172 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,7 +12,7 @@ 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 4048937c6..680764b34 100644
index f1ad18511..339e2da6b 100644
--- a/src/main/java/net/minecraft/server/BaseBlockPosition.java
+++ b/src/main/java/net/minecraft/server/BaseBlockPosition.java
@@ -9,6 +9,14 @@ public class BaseBlockPosition implements Comparable<BaseBlockPosition> {
@ -31,10 +31,10 @@ index 4048937c6..680764b34 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 5c5f19b4b..d81e2dc1c 100644
index 880ce16b1..c9019260b 100644
--- a/src/main/java/net/minecraft/server/BlockPosition.java
+++ b/src/main/java/net/minecraft/server/BlockPosition.java
@@ -240,6 +240,16 @@ public class BlockPosition extends BaseBlockPosition {
@@ -228,6 +228,16 @@ public class BlockPosition extends BaseBlockPosition {
protected int b;
protected int c;
protected int d;
@ -52,10 +52,10 @@ index 5c5f19b4b..d81e2dc1c 100644
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 101d5bb01..6a23b1ec2 100644
index eca041265..66520842d 100644
--- a/src/main/java/net/minecraft/server/Chunk.java
+++ b/src/main/java/net/minecraft/server/Chunk.java
@@ -421,12 +421,24 @@ public class Chunk implements IChunkAccess {
@@ -426,12 +426,24 @@ public class Chunk implements IChunkAccess {
return this.getBlockData(i, j, k).b(this.world, new BlockPosition(i, j, k));
}
@ -97,7 +97,7 @@ index 274c44948..7e4c79a1c 100644
private NibbleArray skyLight;
diff --git a/src/main/java/net/minecraft/server/World.java b/src/main/java/net/minecraft/server/World.java
index befb3e23f..3bfb9397d 100644
index 4093d3486..e109016b7 100644
--- a/src/main/java/net/minecraft/server/World.java
+++ b/src/main/java/net/minecraft/server/World.java
@@ -263,11 +263,11 @@ public abstract class World implements IEntityAccess, GeneratorAccess, IIBlockAc
@ -173,7 +173,7 @@ index befb3e23f..3bfb9397d 100644
return FluidTypes.a.i();
} else {
Chunk chunk = this.getChunkAtWorldCoords(blockposition);
@@ -1816,7 +1816,7 @@ public abstract class World implements IEntityAccess, GeneratorAccess, IIBlockAc
@@ -1766,7 +1766,7 @@ public abstract class World implements IEntityAccess, GeneratorAccess, IIBlockAc
public Map<BlockPosition, TileEntity> capturedTileEntities = Maps.newHashMap();
@Nullable
public TileEntity getTileEntity(BlockPosition blockposition) {
@ -182,7 +182,7 @@ index befb3e23f..3bfb9397d 100644
return null;
} else {
// CraftBukkit start
@@ -1857,7 +1857,7 @@ public abstract class World implements IEntityAccess, GeneratorAccess, IIBlockAc
@@ -1807,7 +1807,7 @@ public abstract class World implements IEntityAccess, GeneratorAccess, IIBlockAc
}
public void setTileEntity(BlockPosition blockposition, @Nullable TileEntity tileentity) {
@ -191,7 +191,7 @@ index befb3e23f..3bfb9397d 100644
if (tileentity != null && !tileentity.x()) {
// CraftBukkit start
if (captureBlockStates) {
@@ -1918,7 +1918,7 @@ public abstract class World implements IEntityAccess, GeneratorAccess, IIBlockAc
@@ -1868,7 +1868,7 @@ public abstract class World implements IEntityAccess, GeneratorAccess, IIBlockAc
}
public boolean p(BlockPosition blockposition) {
@ -201,5 +201,5 @@ index befb3e23f..3bfb9397d 100644
} else {
Chunk chunk = this.chunkProvider.getChunkAt(blockposition.getX() >> 4, blockposition.getZ() >> 4, false, false);
--
2.19.2
2.20.0

Datei anzeigen

@ -1,4 +1,4 @@
From a0af0ad881fb9d995344062b85a00144cef634db Mon Sep 17 00:00:00 2001
From 370c7181c7102186b298dd9d2427d8e7280bdd78 Mon Sep 17 00:00:00 2001
From: Aikar <aikar@aikar.co>
Date: Mon, 28 Mar 2016 19:55:45 -0400
Subject: [PATCH] Option to disable BlockPhysicsEvent for Redstone
@ -11,7 +11,7 @@ Defaulting this to false will provide substantial performance improvement
by saving millions of event calls on redstone heavy servers.
diff --git a/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java b/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java
index 0faef7cf28..deb4ec2543 100644
index 0faef7cf2..deb4ec254 100644
--- a/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java
+++ b/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java
@@ -228,4 +228,9 @@ public class PaperWorldConfig {
@ -25,7 +25,7 @@ index 0faef7cf28..deb4ec2543 100644
+ }
}
diff --git a/src/main/java/net/minecraft/server/World.java b/src/main/java/net/minecraft/server/World.java
index cad60e4f8b..22f0673743 100644
index e109016b7..e614ac33a 100644
--- a/src/main/java/net/minecraft/server/World.java
+++ b/src/main/java/net/minecraft/server/World.java
@@ -620,7 +620,7 @@ public abstract class World implements IEntityAccess, GeneratorAccess, IIBlockAc
@ -38,7 +38,7 @@ index cad60e4f8b..22f0673743 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 a7cc053dc8..c5201697d5 100644
index e98ba11dc..b5983957b 100644
--- a/src/main/java/net/minecraft/server/WorldServer.java
+++ b/src/main/java/net/minecraft/server/WorldServer.java
@@ -37,6 +37,7 @@ import org.bukkit.event.weather.LightningStrikeEvent;
@ -49,7 +49,7 @@ index a7cc053dc8..c5201697d5 100644
private final MinecraftServer server;
public EntityTracker tracker;
private final PlayerChunkMap manager;
@@ -676,6 +677,7 @@ public class WorldServer extends World implements IAsyncTaskHandler {
@@ -677,6 +678,7 @@ public class WorldServer extends World implements IAsyncTaskHandler {
IBlockData iblockdata = this.getType(nextticklistentry.a);
if (iblockdata.getBlock() == nextticklistentry.a()) {
@ -58,5 +58,5 @@ index a7cc053dc8..c5201697d5 100644
}
--
2.19.0
2.20.0

Datei anzeigen

@ -1,14 +1,14 @@
From d3b16edfb2a1998d0165e0c286da1ba9673eafe9 Mon Sep 17 00:00:00 2001
From 89e7bbd243d48746d5df915a32901d9b035976c1 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/World.java b/src/main/java/net/minecraft/server/World.java
index 22f0673743..207f53a9c3 100644
index e614ac33a..608f72f0f 100644
--- a/src/main/java/net/minecraft/server/World.java
+++ b/src/main/java/net/minecraft/server/World.java
@@ -1082,6 +1082,7 @@ public abstract class World implements IEntityAccess, GeneratorAccess, IIBlockAc
@@ -1032,6 +1032,7 @@ public abstract class World implements IEntityAccess, GeneratorAccess, IIBlockAc
}
entity.valid = true; // CraftBukkit
@ -16,7 +16,7 @@ index 22f0673743..207f53a9c3 100644
}
protected void c(Entity entity) {
@@ -1089,6 +1090,7 @@ public abstract class World implements IEntityAccess, GeneratorAccess, IIBlockAc
@@ -1039,6 +1040,7 @@ public abstract class World implements IEntityAccess, GeneratorAccess, IIBlockAc
((IWorldAccess) this.v.get(i)).b(entity);
}
@ -25,5 +25,5 @@ index 22f0673743..207f53a9c3 100644
}
--
2.19.0
2.20.0

Datei anzeigen

@ -1,4 +1,4 @@
From d558b28c05f4837bd5a31c256e92822f4e8959f4 Mon Sep 17 00:00:00 2001
From 298486afbcd90b8d75fff4514bc9c296c088508e 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
@ -30,10 +30,10 @@ index deb4ec254..d2559f7c4 100644
+ }
}
diff --git a/src/main/java/net/minecraft/server/Chunk.java b/src/main/java/net/minecraft/server/Chunk.java
index 6a23b1ec2..d065d88f7 100644
index 66520842d..f470eba29 100644
--- a/src/main/java/net/minecraft/server/Chunk.java
+++ b/src/main/java/net/minecraft/server/Chunk.java
@@ -1277,7 +1277,7 @@ public class Chunk implements IChunkAccess {
@@ -1290,7 +1290,7 @@ public class Chunk implements IChunkAccess {
}
public long m() {

Datei anzeigen

@ -1,4 +1,4 @@
From 662cf614a03e90feb9aaad1d22300aee82391b4c Mon Sep 17 00:00:00 2001
From 614a925bc91281a04de5af8f6da7fa8b725046eb 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/NavigationAbstract.java b/src/main/java/net/minecraft/server/NavigationAbstract.java
index 5d6f726d05..a8b070ed32 100644
index 0600fe23a..53f1c25d2 100644
--- a/src/main/java/net/minecraft/server/NavigationAbstract.java
+++ b/src/main/java/net/minecraft/server/NavigationAbstract.java
@@ -3,7 +3,7 @@ package net.minecraft.server;
@ -25,7 +25,7 @@ index 5d6f726d05..a8b070ed32 100644
+ if (!new com.destroystokyo.paper.event.entity.EntityPathfindEvent(getEntity().getBukkitEntity(), MCUtil.toLocation(getEntity().world, blockposition), null).callEvent()) { return null; } // Paper
this.q = blockposition;
float fx = this.j();
this.b.methodProfiler.a("pathfind");
this.b.methodProfiler.enter("pathfind");
@@ -95,6 +96,7 @@ public abstract class NavigationAbstract {
if (this.c != null && !this.c.b() && blockposition.equals(this.q)) {
return this.c;
@ -33,7 +33,7 @@ index 5d6f726d05..a8b070ed32 100644
+ if (!new com.destroystokyo.paper.event.entity.EntityPathfindEvent(getEntity().getBukkitEntity(), MCUtil.toLocation(entity.world, blockposition), entity.getBukkitEntity()).callEvent()) { return null; } // Paper
this.q = blockposition;
float fx = this.j();
this.b.methodProfiler.a("pathfind");
this.b.methodProfiler.enter("pathfind");
--
2.19.0
2.20.0

Datei anzeigen

@ -1,4 +1,4 @@
From a4d11307f56bfb8d5f7559315844f5cbc64b6ae4 Mon Sep 17 00:00:00 2001
From f66ef986b6349909793d94ae5f6087a3eb8302c0 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 dccd00127..b4dba7247 100644
index 492df2c8e..0778f53e2 100644
--- a/src/main/java/com/destroystokyo/paper/PaperConfig.java
+++ b/src/main/java/com/destroystokyo/paper/PaperConfig.java
@@ -228,4 +228,9 @@ public class PaperConfig {
@ -25,7 +25,7 @@ index dccd00127..b4dba7247 100644
+ }
}
diff --git a/src/main/java/net/minecraft/server/RegionFileCache.java b/src/main/java/net/minecraft/server/RegionFileCache.java
index 2217adf99..c0ab543b9 100644
index 5dbd1d517..964996976 100644
--- a/src/main/java/net/minecraft/server/RegionFileCache.java
+++ b/src/main/java/net/minecraft/server/RegionFileCache.java
@@ -9,10 +9,12 @@ import java.io.IOException;
@ -37,19 +37,17 @@ index 2217adf99..c0ab543b9 100644
public class RegionFileCache {
- public static final Map<File, RegionFile> a = Maps.newHashMap(); // Spigot - private -> public
+ public static final Map<File, RegionFile> a = new LinkedHashMap(PaperConfig.regionFileCacheSize, 0.75f, true); // Spigot - private -> public, Paper - HashMap -> LinkedHashMap
- public static final Map<File, RegionFile> cache = Maps.newHashMap();
+ public static final Map<File, RegionFile> cache = new LinkedHashMap(PaperConfig.regionFileCacheSize, 0.75f, true); // Paper - HashMap -> LinkedHashMap
public static synchronized RegionFile a(File file, int i, int j) {
File file1 = new File(file, "region");
@@ -26,8 +28,8 @@ public class RegionFileCache {
file1.mkdirs();
@@ -27,7 +29,7 @@ public class RegionFileCache {
}
- if (RegionFileCache.a.size() >= 256) {
if (RegionFileCache.cache.size() >= 256) {
- a();
+ if (RegionFileCache.a.size() >= PaperConfig.regionFileCacheSize) { // Paper
+ trimCache(); // Paper
+ trimCache();
}
RegionFile regionfile1 = new RegionFile(file2);
@ -59,11 +57,11 @@ index 2217adf99..c0ab543b9 100644
+ // Paper Start
+ private static synchronized void trimCache() {
+ Iterator<Map.Entry<File, RegionFile>> itr = RegionFileCache.a.entrySet().iterator();
+ int count = RegionFileCache.a.size() - PaperConfig.regionFileCacheSize;
+ Iterator<Map.Entry<File, RegionFile>> itr = RegionFileCache.cache.entrySet().iterator();
+ int count = RegionFileCache.cache.size() - PaperConfig.regionFileCacheSize;
+ while (count-- >= 0 && itr.hasNext()) {
+ try {
+ itr.next().getValue().c();
+ itr.next().getValue().close();
+ } catch (IOException ioexception) {
+ ioexception.printStackTrace();
+ ServerInternalException.reportInternalException(ioexception);
@ -74,8 +72,8 @@ index 2217adf99..c0ab543b9 100644
+ // Paper End
+
public static synchronized void a() {
Iterator iterator = RegionFileCache.a.values().iterator();
Iterator iterator = RegionFileCache.cache.values().iterator();
--
2.19.1
2.20.0

Datei anzeigen

@ -1,11 +1,11 @@
From 7ac07ac07ac07ac07ac07ac07ac07ac07ac07ac0 Mon Sep 17 00:00:00 2001
From 371d310b56332215506709abf6289ee0529dbb57 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 7ac07ac07ac0..7ac07ac07ac0 100644
index 546c79cd8..25caf7ef9 100644
--- a/src/main/java/net/minecraft/server/ChunkCache.java
+++ b/src/main/java/net/minecraft/server/ChunkCache.java
@@ -21,7 +21,7 @@ public class ChunkCache implements IIBlockAccess {
@ -18,7 +18,7 @@ index 7ac07ac07ac0..7ac07ac07ac0 100644
}
diff --git a/src/main/java/net/minecraft/server/NavigationAbstract.java b/src/main/java/net/minecraft/server/NavigationAbstract.java
index 7ac07ac07ac0..7ac07ac07ac0 100644
index 53f1c25d2..26156d6cf 100644
--- a/src/main/java/net/minecraft/server/NavigationAbstract.java
+++ b/src/main/java/net/minecraft/server/NavigationAbstract.java
@@ -21,13 +21,15 @@ public abstract class NavigationAbstract {
@ -47,7 +47,7 @@ index 7ac07ac07ac0..7ac07ac07ac0 100644
if (this.m) {
this.l();
diff --git a/src/main/java/net/minecraft/server/Pathfinder.java b/src/main/java/net/minecraft/server/Pathfinder.java
index 7ac07ac07ac0..7ac07ac07ac0 100644
index a12fdceac..1881dea66 100644
--- a/src/main/java/net/minecraft/server/Pathfinder.java
+++ b/src/main/java/net/minecraft/server/Pathfinder.java
@@ -8,7 +8,7 @@ public class Pathfinder {
@ -60,7 +60,7 @@ index 7ac07ac07ac0..7ac07ac07ac0 100644
public Pathfinder(PathfinderAbstract pathfinderabstract) {
this.d = pathfinderabstract;
diff --git a/src/main/java/net/minecraft/server/PathfinderAbstract.java b/src/main/java/net/minecraft/server/PathfinderAbstract.java
index 7ac07ac07ac0..7ac07ac07ac0 100644
index ba7fe359f..671628014 100644
--- a/src/main/java/net/minecraft/server/PathfinderAbstract.java
+++ b/src/main/java/net/minecraft/server/PathfinderAbstract.java
@@ -3,6 +3,7 @@ package net.minecraft.server;
@ -80,7 +80,7 @@ index 7ac07ac07ac0..7ac07ac07ac0 100644
this.c.c();
this.d = MathHelper.d(entityinsentient.width + 1.0F);
diff --git a/src/main/java/net/minecraft/server/PathfinderNormal.java b/src/main/java/net/minecraft/server/PathfinderNormal.java
index 7ac07ac07ac0..7ac07ac07ac0 100644
index 2e82c7c48..34b29652b 100644
--- a/src/main/java/net/minecraft/server/PathfinderNormal.java
+++ b/src/main/java/net/minecraft/server/PathfinderNormal.java
@@ -47,7 +47,7 @@ public class PathfinderNormal extends PathfinderAbstract {
@ -115,9 +115,9 @@ index 7ac07ac07ac0..7ac07ac07ac0 100644
for(int l = -1; l <= 1; ++l) {
for(int i1 = -1; i1 <= 1; ++i1) {
if (l != 0 || i1 != 0) {
- Block block = iblockaccess.getType(blockposition$b.f(l + i, jx, i1 + k)).getBlock();
- Block block = iblockaccess.getType(blockposition$b.c(l + i, jx, i1 + k)).getBlock();
- if (block == Blocks.CACTUS) {
+ Block block = world.getBlockIfLoaded(blockposition$b.f(l + i, jx, i1 + k)); // Paper
+ Block block = world.getBlockIfLoaded(blockposition$b.c(l + i, jx, i1 + k)); // Paper
+ if (block == null) pathtype = PathType.BLOCKED; // Paper
+ else if (block == Blocks.CACTUS) { // Paper
pathtype = PathType.DANGER_CACTUS;
@ -134,5 +134,5 @@ index 7ac07ac07ac0..7ac07ac07ac0 100644
Material material = iblockdata.getMaterial();
if (iblockdata.isAir()) {
--
2.19.1
2.20.0

Datei anzeigen

@ -1,4 +1,4 @@
From d6e138e030d90d72795ada5cf94cb506af0ef6ad Mon Sep 17 00:00:00 2001
From 7b96e2cf79f6c8f5fd688ae20700b1398670593b Mon Sep 17 00:00:00 2001
From: Aikar <aikar@aikar.co>
Date: Sat, 13 Sep 2014 23:14:43 -0400
Subject: [PATCH] Configurable Keep Spawn Loaded range per world
@ -21,7 +21,7 @@ index 058cd8cc8..276dd98fd 100644
+ }
}
diff --git a/src/main/java/net/minecraft/server/MinecraftServer.java b/src/main/java/net/minecraft/server/MinecraftServer.java
index 051608e38..7793626b5 100644
index eef8d2b5a..cc98b745b 100644
--- a/src/main/java/net/minecraft/server/MinecraftServer.java
+++ b/src/main/java/net/minecraft/server/MinecraftServer.java
@@ -490,13 +490,21 @@ public abstract class MinecraftServer implements IAsyncTaskHandler, IMojangStati
@ -42,7 +42,7 @@ index 051608e38..7793626b5 100644
+ int expected = arraylist.size(); // Paper
+
CompletableFuture completablefuture = worldserver.getChunkProviderServer().a((Iterable) arraylist, (chunk) -> {
CompletableFuture completablefuture = worldserver.getChunkProvider().a((Iterable) arraylist, (chunk) -> {
set.add(chunk.getPos());
+ if (set.size() < expected && set.size() % 25 == 0) this.a(new ChatMessage("menu.preparingSpawn", new Object[0]), set.size() * 100 / expected); // Paper
});
@ -63,10 +63,10 @@ index 051608e38..7793626b5 100644
}
diff --git a/src/main/java/net/minecraft/server/World.java b/src/main/java/net/minecraft/server/World.java
index 481a462f8..e64a95ece 100644
index ceb4102af..02a62d6d7 100644
--- a/src/main/java/net/minecraft/server/World.java
+++ b/src/main/java/net/minecraft/server/World.java
@@ -2902,8 +2902,9 @@ public abstract class World implements IEntityAccess, GeneratorAccess, IIBlockAc
@@ -2852,8 +2852,9 @@ public abstract class World implements IEntityAccess, GeneratorAccess, IIBlockAc
int k = i * 16 + 8 - blockposition.getX();
int l = j * 16 + 8 - blockposition.getZ();
boolean flag = true;
@ -78,7 +78,7 @@ index 481a462f8..e64a95ece 100644
public LongSet ag() {
diff --git a/src/main/java/org/bukkit/craftbukkit/CraftServer.java b/src/main/java/org/bukkit/craftbukkit/CraftServer.java
index 082e86963..b89c5f4ab 100644
index acd54067e..c655d51ac 100644
--- a/src/main/java/org/bukkit/craftbukkit/CraftServer.java
+++ b/src/main/java/org/bukkit/craftbukkit/CraftServer.java
@@ -1004,7 +1004,7 @@ public final class CraftServer implements Server {
@ -91,7 +91,7 @@ index 082e86963..b89c5f4ab 100644
for (int j = -short1; j <= short1; j += 16) {
for (int k = -short1; k <= short1; k += 16) {
diff --git a/src/main/java/org/bukkit/craftbukkit/CraftWorld.java b/src/main/java/org/bukkit/craftbukkit/CraftWorld.java
index a784bf6f6..24e504c27 100644
index 1676fcc85..b19eef1b1 100644
--- a/src/main/java/org/bukkit/craftbukkit/CraftWorld.java
+++ b/src/main/java/org/bukkit/craftbukkit/CraftWorld.java
@@ -1404,8 +1404,9 @@ public class CraftWorld implements World {

Datei anzeigen

@ -1,14 +1,14 @@
From 7ac07ac07ac07ac07ac07ac07ac07ac07ac07ac0 Mon Sep 17 00:00:00 2001
From c964f427b9758437f1cbbce042795818e8243b52 Mon Sep 17 00:00:00 2001
From: Aikar <aikar@aikar.co>
Date: Tue, 5 Apr 2016 19:42:22 -0400
Subject: [PATCH] Don't spam reload spawn chunks in nether/end
diff --git a/src/main/java/net/minecraft/server/World.java b/src/main/java/net/minecraft/server/World.java
index 7ac07ac07ac0..7ac07ac07ac0 100644
index 64482393d..1a1b40ac0 100644
--- a/src/main/java/net/minecraft/server/World.java
+++ b/src/main/java/net/minecraft/server/World.java
@@ -2898,6 +2898,7 @@ public abstract class World implements IEntityAccess, GeneratorAccess, IIBlockAc
@@ -2848,6 +2848,7 @@ public abstract class World implements IEntityAccess, GeneratorAccess, IIBlockAc
return this.K;
}
@ -17,7 +17,7 @@ index 7ac07ac07ac0..7ac07ac07ac0 100644
BlockPosition blockposition = this.getSpawn();
int k = i * 16 + 8 - blockposition.getX();
diff --git a/src/main/java/net/minecraft/server/WorldProvider.java b/src/main/java/net/minecraft/server/WorldProvider.java
index 7ac07ac07ac0..7ac07ac07ac0 100644
index bd9c76ee8..ef5c7b1f6 100644
--- a/src/main/java/net/minecraft/server/WorldProvider.java
+++ b/src/main/java/net/minecraft/server/WorldProvider.java
@@ -72,7 +72,7 @@ public abstract class WorldProvider {
@ -30,5 +30,5 @@ index 7ac07ac07ac0..7ac07ac07ac0 100644
protected abstract void m();
--
2.19.1
2.20.0

Datei anzeigen

@ -1,4 +1,4 @@
From 77c47f231d1a936f15d3dc8863d9e3362d0ca76d Mon Sep 17 00:00:00 2001
From 33a493b42f79a4adbdd4afe6806bdeea1e52322a 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
@ -25,20 +25,8 @@ index 276dd98fd..973ea8bca 100644
+ useVanillaScoreboardColoring = getBoolean("use-vanilla-world-scoreboard-name-coloring", false);
+ }
}
diff --git a/src/main/java/net/minecraft/server/Entity.java b/src/main/java/net/minecraft/server/Entity.java
index 734ee9d8e..e60e8e8fe 100644
--- a/src/main/java/net/minecraft/server/Entity.java
+++ b/src/main/java/net/minecraft/server/Entity.java
@@ -2259,6 +2259,7 @@ public abstract class Entity implements INamableTileEntity, ICommandListener, Ke
return this.getFlag(5);
}
+ @Nullable public ScoreboardTeamBase getTeam() { return this.be(); } // Paper - OBFHELPER
@Nullable
public ScoreboardTeamBase be() {
if (!this.world.paperConfig.nonPlayerEntitiesOnScoreboards && !(this instanceof EntityHuman)) { return null; } // Paper
diff --git a/src/main/java/net/minecraft/server/PlayerConnection.java b/src/main/java/net/minecraft/server/PlayerConnection.java
index dc2c143c8..5c7a88ec8 100644
index 8a65072fe..d162bd3d8 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, ITickable {
@ -49,7 +37,7 @@ index dc2c143c8..5c7a88ec8 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.getTeam(),((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;
+ }
@ -60,7 +48,7 @@ index dc2c143c8..5c7a88ec8 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 8c10a0da1..2cb5869ae 100644
index 80f595fea..7edca4284 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 {

Datei anzeigen

@ -1,4 +1,4 @@
From 84c22db34d740ea9f31baf1a34e55da2991b00dc Mon Sep 17 00:00:00 2001
From 7a77bcce394c3b98f9b3df7972bad53d5bbc3520 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,7 +6,7 @@ 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 796ce3103a..261ae87fb8 100644
index 1a1b40ac0..9c5f520f1 100644
--- a/src/main/java/net/minecraft/server/World.java
+++ b/src/main/java/net/minecraft/server/World.java
@@ -76,7 +76,7 @@ public abstract class World implements IEntityAccess, GeneratorAccess, IIBlockAc
@ -18,7 +18,7 @@ index 796ce3103a..261ae87fb8 100644
public final List<TileEntity> tileEntityListTick = Lists.newArrayList();
private final List<TileEntity> c = Lists.newArrayList();
private final Set<TileEntity> tileEntityListUnload = com.google.common.collect.Sets.newHashSet(); // Paper
@@ -1318,7 +1318,7 @@ public abstract class World implements IEntityAccess, GeneratorAccess, IIBlockAc
@@ -1268,7 +1268,7 @@ public abstract class World implements IEntityAccess, GeneratorAccess, IIBlockAc
timings.tileEntityTick.startTiming(); // Spigot
if (!this.tileEntityListUnload.isEmpty()) {
this.tileEntityListTick.removeAll(this.tileEntityListUnload);
@ -27,7 +27,7 @@ index 796ce3103a..261ae87fb8 100644
this.tileEntityListUnload.clear();
}
@@ -1371,7 +1371,7 @@ public abstract class World implements IEntityAccess, GeneratorAccess, IIBlockAc
@@ -1321,7 +1321,7 @@ public abstract class World implements IEntityAccess, GeneratorAccess, IIBlockAc
if (tileentity.x()) {
tilesThisCycle--;
this.tileEntityListTick.remove(tileTickPosition--);
@ -36,7 +36,7 @@ index 796ce3103a..261ae87fb8 100644
if (this.isLoaded(tileentity.getPosition())) {
this.getChunkAtWorldCoords(tileentity.getPosition()).d(tileentity.getPosition());
}
@@ -1401,7 +1401,7 @@ public abstract class World implements IEntityAccess, GeneratorAccess, IIBlockAc
@@ -1351,7 +1351,7 @@ public abstract class World implements IEntityAccess, GeneratorAccess, IIBlockAc
this.notify(tileentity1.getPosition(), iblockdata, iblockdata, 3);
// CraftBukkit start
// From above, don't screw this up - SPIGOT-1746
@ -45,7 +45,7 @@ index 796ce3103a..261ae87fb8 100644
this.a(tileentity1);
}
// CraftBukkit end
@@ -1421,9 +1421,9 @@ public abstract class World implements IEntityAccess, GeneratorAccess, IIBlockAc
@@ -1371,9 +1371,9 @@ public abstract class World implements IEntityAccess, GeneratorAccess, IIBlockAc
protected void p_() {}
public boolean a(TileEntity tileentity) {
@ -57,7 +57,7 @@ index 796ce3103a..261ae87fb8 100644
this.tileEntityListTick.add(tileentity);
}
@@ -1904,7 +1904,7 @@ public abstract class World implements IEntityAccess, GeneratorAccess, IIBlockAc
@@ -1854,7 +1854,7 @@ public abstract class World implements IEntityAccess, GeneratorAccess, IIBlockAc
} else {
if (tileentity != null) {
this.c.remove(tileentity);
@ -67,5 +67,5 @@ index 796ce3103a..261ae87fb8 100644
}
--
2.19.0
2.20.0

Datei anzeigen

@ -1,11 +1,11 @@
From deefbc94ab507f4a70b73a4006ece70e4e9c657f Mon Sep 17 00:00:00 2001
From 559f0719ff1b69a0decfbbc543cf13fcc2c79654 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 b4dba7247..1d32b93c8 100644
index 0778f53e2..30fcf4a72 100644
--- a/src/main/java/com/destroystokyo/paper/PaperConfig.java
+++ b/src/main/java/com/destroystokyo/paper/PaperConfig.java
@@ -233,4 +233,9 @@ public class PaperConfig {
@ -19,7 +19,7 @@ index b4dba7247..1d32b93c8 100644
+ }
}
diff --git a/src/main/java/net/minecraft/server/MinecraftServer.java b/src/main/java/net/minecraft/server/MinecraftServer.java
index 7793626b5..bdd2c4b85 100644
index cc98b745b..d146cc79c 100644
--- a/src/main/java/net/minecraft/server/MinecraftServer.java
+++ b/src/main/java/net/minecraft/server/MinecraftServer.java
@@ -425,6 +425,19 @@ public abstract class MinecraftServer implements IAsyncTaskHandler, IMojangStati
@ -56,7 +56,7 @@ index f7a9b9d88..7befd80cf 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 2cb5869ae..143c7c1be 100644
index 7edca4284..3e4ca288d 100644
--- a/src/main/java/net/minecraft/server/PlayerList.java
+++ b/src/main/java/net/minecraft/server/PlayerList.java
@@ -74,6 +74,7 @@ public abstract class PlayerList {
@ -74,7 +74,7 @@ index 2cb5869ae..143c7c1be 100644
+ // Paper start - Add to collideRule team if needed
+ final Scoreboard scoreboard = this.getServer().getWorldServer(DimensionManager.OVERWORLD).getScoreboard();
+ final ScoreboardTeam collideRuleTeam = scoreboard.getTeam(collideRuleTeamName);
+ if (this.collideRuleTeamName != null && collideRuleTeam != null && entityplayer.getTeam() == null) {
+ if (this.collideRuleTeamName != null && collideRuleTeam != null && entityplayer.getScoreboardTeam() == null) {
+ scoreboard.addPlayerToTeam(entityplayer.getName(), collideRuleTeam);
+ }
+ // Paper end
@ -89,7 +89,7 @@ index 2cb5869ae..143c7c1be 100644
+ if (this.collideRuleTeamName != null) {
+ final Scoreboard scoreBoard = this.server.getWorldServer(DimensionManager.OVERWORLD).getScoreboard();
+ final ScoreboardTeam team = scoreBoard.getTeam(this.collideRuleTeamName);
+ if (entityplayer.getTeam() == team && team != null) {
+ if (entityplayer.getScoreboardTeam() == team && team != null) {
+ scoreBoard.removePlayerFromTeam(entityplayer.getName(), team);
+ }
+ }
@ -114,5 +114,5 @@ index 2cb5869ae..143c7c1be 100644
// CraftBukkit start
--
2.19.2
2.20.0

Datei anzeigen

@ -1,4 +1,4 @@
From 619d038b64d2fe9203cb69d5b3229cd4f628c8ff Mon Sep 17 00:00:00 2001
From 59e670ac6abffe4d2f20f05ebd612da5f8b2a403 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 72d841af06..6aabdc2974 100644
index 8f2289f4e..93ca93b64 100644
--- a/src/main/java/net/minecraft/server/HandshakeListener.java
+++ b/src/main/java/net/minecraft/server/HandshakeListener.java
@@ -72,8 +72,33 @@ public class HandshakeListener implements PacketHandshakingInListener {
@ -29,7 +29,7 @@ index 72d841af06..6aabdc2974 100644
+ }
+
+ packethandshakinginsetprotocol.hostname = event.getServerHostname();
+ this.b.l = new java.net.InetSocketAddress(event.getSocketAddressHostname(), ((java.net.InetSocketAddress) this.b.getSocketAddress()).getPort());
+ this.b.socketAddress = new java.net.InetSocketAddress(event.getSocketAddressHostname(), ((java.net.InetSocketAddress) this.b.getSocketAddress()).getPort());
+ this.b.spoofedUUID = event.getUniqueId();
+ this.b.spoofedProfile = gson.fromJson(event.getPropertiesJson(), com.mojang.authlib.properties.Property[].class);
+ handledByEvent = true; // Hooray, we did it!
@ -45,5 +45,5 @@ index 72d841af06..6aabdc2974 100644
if ( split.length == 3 || split.length == 4 ) {
packethandshakinginsetprotocol.hostname = split[0];
--
2.19.0
2.20.0

Datei anzeigen

@ -1,4 +1,4 @@
From 7972a6a1c23e96a84c0e78c20c5fac7732a33d1f Mon Sep 17 00:00:00 2001
From 93c2696ec51341f0375fb4fda21b81e890bc49e4 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
@ -24,7 +24,7 @@ index 973ea8bca..7c7d5595a 100644
+ }
}
diff --git a/src/main/java/net/minecraft/server/BlockIceFrost.java b/src/main/java/net/minecraft/server/BlockIceFrost.java
index af6c744ad..7bea86f52 100644
index 1100073f3..598621fbb 100644
--- a/src/main/java/net/minecraft/server/BlockIceFrost.java
+++ b/src/main/java/net/minecraft/server/BlockIceFrost.java
@@ -11,19 +11,20 @@ public class BlockIceFrost extends BlockIce {
@ -35,18 +35,18 @@ index af6c744ad..7bea86f52 100644
if ((random.nextInt(3) == 0 || this.a(world, blockposition, 4)) && world.getLightLevel(blockposition) > 11 - iblockdata.get(a) - iblockdata.b(world, blockposition) && this.c(iblockdata, world, blockposition)) {
try (BlockPosition.b blockposition$b = BlockPosition.b.r()) {
for(EnumDirection enumdirection : EnumDirection.values()) {
blockposition$b.j(blockposition).d(enumdirection);
blockposition$b.g(blockposition).c(enumdirection);
IBlockData iblockdata1 = world.getType(blockposition$b);
if (iblockdata1.getBlock() == this && !this.c(iblockdata1, world, blockposition$b)) {
- world.J().a(blockposition$b, this, MathHelper.nextInt(random, 20, 40));
+ world.J().a(blockposition$b, this, MathHelper.nextInt(random, world.paperConfig.frostedIceDelayMin, world.paperConfig.frostedIceDelayMax)); // Paper - use configurable min/max delay
- world.getBlockTickList().a(blockposition$b, this, MathHelper.nextInt(random, 20, 40));
+ world.getBlockTickList().a(blockposition$b, this, MathHelper.nextInt(random, world.paperConfig.frostedIceDelayMin, world.paperConfig.frostedIceDelayMax)); // Paper - use configurable min/max delay
}
}
}
} else {
- world.J().a(blockposition, this, MathHelper.nextInt(random, 20, 40));
+ world.J().a(blockposition, this, MathHelper.nextInt(random, world.paperConfig.frostedIceDelayMin, world.paperConfig.frostedIceDelayMax)); // Paper - use configurable min/max delay
- 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
}
}

Datei anzeigen

@ -1,4 +1,4 @@
From d415127904d0188d028f30b361d7f5312c5532ca Mon Sep 17 00:00:00 2001
From 84144ea1b943d26fa00db7f33b51c5172d234a11 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,7 +13,7 @@ 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 d245502286..816854dc2f 100644
index 1185769ca..443a089d8 100644
--- a/src/main/java/net/minecraft/server/EntityHuman.java
+++ b/src/main/java/net/minecraft/server/EntityHuman.java
@@ -618,6 +618,12 @@ public abstract class EntityHuman extends EntityLiving {
@ -30,7 +30,7 @@ index d245502286..816854dc2f 100644
ItemStack itemstack1 = this.a(entityitem);
diff --git a/src/main/java/net/minecraft/server/EntityTrackerEntry.java b/src/main/java/net/minecraft/server/EntityTrackerEntry.java
index c5bfe6630d..4f2d7db378 100644
index 08d923563..6d9c80489 100644
--- a/src/main/java/net/minecraft/server/EntityTrackerEntry.java
+++ b/src/main/java/net/minecraft/server/EntityTrackerEntry.java
@@ -97,7 +97,7 @@ public class EntityTrackerEntry {
@ -43,10 +43,10 @@ index c5bfe6630d..4f2d7db378 100644
ItemStack itemstack = entityitemframe.getItem();
diff --git a/src/main/java/net/minecraft/server/World.java b/src/main/java/net/minecraft/server/World.java
index 264dc740cb..8aa4138a2e 100644
index 9c5f520f1..5d7370029 100644
--- a/src/main/java/net/minecraft/server/World.java
+++ b/src/main/java/net/minecraft/server/World.java
@@ -1122,6 +1122,7 @@ public abstract class World implements IEntityAccess, GeneratorAccess, IIBlockAc
@@ -1072,6 +1072,7 @@ public abstract class World implements IEntityAccess, GeneratorAccess, IIBlockAc
{
if ( iter.next().trackee == entity )
{
@ -55,7 +55,7 @@ index 264dc740cb..8aa4138a2e 100644
}
}
diff --git a/src/main/java/net/minecraft/server/WorldMap.java b/src/main/java/net/minecraft/server/WorldMap.java
index bf7963b421..338d753500 100644
index 5c09085a6..a819d6037 100644
--- a/src/main/java/net/minecraft/server/WorldMap.java
+++ b/src/main/java/net/minecraft/server/WorldMap.java
@@ -30,6 +30,7 @@ public class WorldMap extends PersistentBase {
@ -88,7 +88,7 @@ index bf7963b421..338d753500 100644
+ public void updateSeenPlayers(EntityHuman entityhuman, ItemStack itemstack) { a(entityhuman, itemstack); } // Paper - OBFHELPER
public void a(EntityHuman entityhuman, ItemStack itemstack) {
if (!this.j.containsKey(entityhuman)) {
if (!this.humans.containsKey(entityhuman)) {
WorldMap.WorldMapHumanTracker worldmap_worldmaphumantracker = new WorldMap.WorldMapHumanTracker(entityhuman);
@@ -404,6 +408,21 @@ public class WorldMap extends PersistentBase {
@ -127,7 +127,7 @@ index bf7963b421..338d753500 100644
for ( org.bukkit.map.MapCursor cursor : render.cursors) {
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;
@ -140,5 +140,5 @@ index 256a131781..5768cd512e 100644
public RenderData() {
--
2.19.1
2.20.0

Datei anzeigen

@ -1,4 +1,4 @@
From 138ea64830ff2fd0adfdd094500fea47c1e30852 Mon Sep 17 00:00:00 2001
From fdd7766d19df64b696d939e214b6a03c3e1757ab Mon Sep 17 00:00:00 2001
From: Aikar <aikar@aikar.co>
Date: Fri, 13 May 2016 01:38:06 -0400
Subject: [PATCH] Activation Range Improvements
@ -10,10 +10,10 @@ Fixes and adds new Immunities to improve gameplay behavior
Adds water Mobs to activation range config and nerfs fish
diff --git a/src/main/java/net/minecraft/server/BlockPosition.java b/src/main/java/net/minecraft/server/BlockPosition.java
index d81e2dc1c5..7bd51b3578 100644
index c9019260b..e980e31fc 100644
--- a/src/main/java/net/minecraft/server/BlockPosition.java
+++ b/src/main/java/net/minecraft/server/BlockPosition.java
@@ -327,6 +327,7 @@ public class BlockPosition extends BaseBlockPosition {
@@ -315,6 +315,7 @@ public class BlockPosition extends BaseBlockPosition {
this.c = i;
}
@ -22,7 +22,7 @@ index d81e2dc1c5..7bd51b3578 100644
return new BlockPosition(this);
}
diff --git a/src/main/java/net/minecraft/server/Entity.java b/src/main/java/net/minecraft/server/Entity.java
index e7f9e490bf..68ceee5f08 100644
index 69645d517..9682b0a01 100644
--- a/src/main/java/net/minecraft/server/Entity.java
+++ b/src/main/java/net/minecraft/server/Entity.java
@@ -575,6 +575,7 @@ public abstract class Entity implements INamableTileEntity, ICommandListener, Ke
@ -34,7 +34,7 @@ index e7f9e490bf..68ceee5f08 100644
if (i != this.aM) {
diff --git a/src/main/java/net/minecraft/server/EntityCreature.java b/src/main/java/net/minecraft/server/EntityCreature.java
index 20b7c2c6dc..d659c57dbe 100644
index 20b7c2c6d..d659c57db 100644
--- a/src/main/java/net/minecraft/server/EntityCreature.java
+++ b/src/main/java/net/minecraft/server/EntityCreature.java
@@ -7,6 +7,7 @@ import org.bukkit.event.entity.EntityUnleashEvent;
@ -46,7 +46,7 @@ index 20b7c2c6dc..d659c57dbe 100644
private float b;
diff --git a/src/main/java/net/minecraft/server/EntityInsentient.java b/src/main/java/net/minecraft/server/EntityInsentient.java
index c87304d477..41a4962e94 100644
index ac250182b..06bb8cf1f 100644
--- a/src/main/java/net/minecraft/server/EntityInsentient.java
+++ b/src/main/java/net/minecraft/server/EntityInsentient.java
@@ -104,6 +104,17 @@ public abstract class EntityInsentient extends EntityLiving {
@ -68,7 +68,7 @@ index c87304d477..41a4962e94 100644
return this.moveController;
}
diff --git a/src/main/java/net/minecraft/server/EntityLiving.java b/src/main/java/net/minecraft/server/EntityLiving.java
index 334580a8b7..b2b575d0e8 100644
index 95af2d529..162de836e 100644
--- a/src/main/java/net/minecraft/server/EntityLiving.java
+++ b/src/main/java/net/minecraft/server/EntityLiving.java
@@ -74,7 +74,7 @@ public abstract class EntityLiving extends Entity {
@ -77,11 +77,11 @@ index 334580a8b7..b2b575d0e8 100644
public EntityHuman killer;
- protected int lastDamageByPlayerTime;
+ public int lastDamageByPlayerTime; // Paper - public
protected boolean aX;
protected boolean killed;
protected int ticksFarFromPlayer;
protected float aZ;
diff --git a/src/main/java/net/minecraft/server/EntityLlama.java b/src/main/java/net/minecraft/server/EntityLlama.java
index c66d8b68f0..774e4d6414 100644
index 9c48bb3c9..22cea8552 100644
--- a/src/main/java/net/minecraft/server/EntityLlama.java
+++ b/src/main/java/net/minecraft/server/EntityLlama.java
@@ -340,6 +340,7 @@ public class EntityLlama extends EntityHorseChestedAbstract implements IRangedEn
@ -93,7 +93,7 @@ index c66d8b68f0..774e4d6414 100644
return this.bQ != null;
}
diff --git a/src/main/java/net/minecraft/server/PathfinderGoal.java b/src/main/java/net/minecraft/server/PathfinderGoal.java
index acc099e955..339c78eec9 100644
index acc099e95..339c78eec 100644
--- a/src/main/java/net/minecraft/server/PathfinderGoal.java
+++ b/src/main/java/net/minecraft/server/PathfinderGoal.java
@@ -20,7 +20,9 @@ public abstract class PathfinderGoal {
@ -107,7 +107,7 @@ index acc099e955..339c78eec9 100644
public void e() {
}
diff --git a/src/main/java/net/minecraft/server/PathfinderGoalGotoTarget.java b/src/main/java/net/minecraft/server/PathfinderGoalGotoTarget.java
index 9a75cb63ba..cf10605aaa 100644
index 9a75cb63b..cf10605aa 100644
--- a/src/main/java/net/minecraft/server/PathfinderGoalGotoTarget.java
+++ b/src/main/java/net/minecraft/server/PathfinderGoalGotoTarget.java
@@ -1,12 +1,12 @@
@ -148,7 +148,7 @@ index 9a75cb63ba..cf10605aaa 100644
}
}
diff --git a/src/main/java/net/minecraft/server/PathfinderGoalSelector.java b/src/main/java/net/minecraft/server/PathfinderGoalSelector.java
index be3a3c82ee..1404b629d5 100644
index ae21eb84d..8f35f71f8 100644
--- a/src/main/java/net/minecraft/server/PathfinderGoalSelector.java
+++ b/src/main/java/net/minecraft/server/PathfinderGoalSelector.java
@@ -10,10 +10,10 @@ import org.apache.logging.log4j.Logger;
@ -187,7 +187,7 @@ index be3a3c82ee..1404b629d5 100644
Iterator iterator = this.b.iterator();
diff --git a/src/main/java/org/spigotmc/ActivationRange.java b/src/main/java/org/spigotmc/ActivationRange.java
index 09df00e94b..d08ef3fe10 100644
index 09df00e94..d08ef3fe1 100644
--- a/src/main/java/org/spigotmc/ActivationRange.java
+++ b/src/main/java/org/spigotmc/ActivationRange.java
@@ -2,6 +2,8 @@ package org.spigotmc;
@ -385,7 +385,7 @@ index 09df00e94b..d08ef3fe10 100644
{
isActive = false;
diff --git a/src/main/java/org/spigotmc/SpigotWorldConfig.java b/src/main/java/org/spigotmc/SpigotWorldConfig.java
index 87bc8e2d9c..06d84a0b66 100644
index 87bc8e2d9..06d84a0b6 100644
--- a/src/main/java/org/spigotmc/SpigotWorldConfig.java
+++ b/src/main/java/org/spigotmc/SpigotWorldConfig.java
@@ -144,12 +144,14 @@ public class SpigotWorldConfig
@ -404,5 +404,5 @@ index 87bc8e2d9c..06d84a0b66 100644
log( "Entity Activation Range: An " + animalActivationRange + " / Mo " + monsterActivationRange + " / Mi " + miscActivationRange + " / Tiv " + tickInactiveVillagers );
}
--
2.19.1
2.20.0

Datei anzeigen

@ -1,4 +1,4 @@
From 69dc8f855cc02a3f1b8016a9accd29960e48b796 Mon Sep 17 00:00:00 2001
From d128b3896e20ff9f497284c2686617631ea0f874 Mon Sep 17 00:00:00 2001
From: Aikar <aikar@aikar.co>
Date: Mon, 16 May 2016 20:47:41 -0400
Subject: [PATCH] Optimize UserCache / Thread Safe
@ -10,7 +10,7 @@ Additionally, move Saving of the User cache to be done async, incase
the user never changed the default setting for Spigot's save on stop only.
diff --git a/src/main/java/net/minecraft/server/MinecraftServer.java b/src/main/java/net/minecraft/server/MinecraftServer.java
index eb6ada935f..04d8c108b4 100644
index 1c09dded9..edf72fbec 100644
--- a/src/main/java/net/minecraft/server/MinecraftServer.java
+++ b/src/main/java/net/minecraft/server/MinecraftServer.java
@@ -691,7 +691,7 @@ public abstract class MinecraftServer implements IAsyncTaskHandler, IMojangStati
@ -23,7 +23,7 @@ index eb6ada935f..04d8c108b4 100644
// Spigot end
}
diff --git a/src/main/java/net/minecraft/server/UserCache.java b/src/main/java/net/minecraft/server/UserCache.java
index 0e168ad349..f8b7d695c6 100644
index d1197b959..51c2c5dd7 100644
--- a/src/main/java/net/minecraft/server/UserCache.java
+++ b/src/main/java/net/minecraft/server/UserCache.java
@@ -109,7 +109,7 @@ public class UserCache {
@ -37,7 +37,7 @@ index 0e168ad349..f8b7d695c6 100644
if (date == null) {
@@ -122,8 +122,9 @@ public class UserCache {
UserCache.UserCacheEntry usercache_usercacheentry = new UserCache.UserCacheEntry(gameprofile, date, null);
UserCache.UserCacheEntry usercache_usercacheentry = new UserCache.UserCacheEntry(gameprofile, date); // CraftBukkit - decompile error
- if (this.e.containsKey(uuid)) {
+ //if (this.e.containsKey(uuid)) { // Paper
@ -98,5 +98,5 @@ index 0e168ad349..f8b7d695c6 100644
}
--
2.19.0
2.20.0

Datei anzeigen

@ -1,4 +1,4 @@
From 709e2779fa366bca564304e1fdd83b6940a387cf Mon Sep 17 00:00:00 2001
From b53f5958e3068cd2af5506553515162a3b4d96d9 Mon Sep 17 00:00:00 2001
From: Zach Brown <zach.brown@destroystokyo.com>
Date: Sun, 22 May 2016 20:20:55 -0500
Subject: [PATCH] Optional TNT doesn't move in water
@ -32,7 +32,7 @@ index 00f0451ef..42d951554 100644
+ }
}
diff --git a/src/main/java/net/minecraft/server/Entity.java b/src/main/java/net/minecraft/server/Entity.java
index be1c800c9..c065b2728 100644
index 9682b0a01..876ae1639 100644
--- a/src/main/java/net/minecraft/server/Entity.java
+++ b/src/main/java/net/minecraft/server/Entity.java
@@ -1173,6 +1173,12 @@ public abstract class Entity implements INamableTileEntity, ICommandListener, Ke
@ -48,7 +48,7 @@ index be1c800c9..c065b2728 100644
return this.isInWater() || this.q();
}
@@ -2725,6 +2731,11 @@ public abstract class Entity implements INamableTileEntity, ICommandListener, Ke
@@ -2724,6 +2730,11 @@ public abstract class Entity implements INamableTileEntity, ICommandListener, Ke
}
public boolean bw() {

Datei anzeigen

@ -1,4 +1,4 @@
From cf990aab8061ae3fb5211f0765056a0c0cb18e85 Mon Sep 17 00:00:00 2001
From 3e1acb4e8c061bfd5ad065665b8466a8d1cbdcd9 Mon Sep 17 00:00:00 2001
From: Aikar <aikar@aikar.co>
Date: Sat, 18 Jun 2016 23:22:12 -0400
Subject: [PATCH] Delay Chunk Unloads based on Player Movement
@ -43,10 +43,10 @@ index 42d951554..d8f258105 100644
+ }
}
diff --git a/src/main/java/net/minecraft/server/Chunk.java b/src/main/java/net/minecraft/server/Chunk.java
index d065d88f7..2a9bfd7af 100644
index f470eba29..86bdd6e7f 100644
--- a/src/main/java/net/minecraft/server/Chunk.java
+++ b/src/main/java/net/minecraft/server/Chunk.java
@@ -36,6 +36,7 @@ public class Chunk implements IChunkAccess {
@@ -41,6 +41,7 @@ public class Chunk implements IChunkAccess {
private boolean i;public boolean isLoaded() { return i; } // Paper - OBFHELPER
public final World world;
public final Map<HeightMap.Type, HeightMap> heightMap;
@ -55,7 +55,7 @@ index d065d88f7..2a9bfd7af 100644
public final int locZ;
private boolean l;
diff --git a/src/main/java/net/minecraft/server/ChunkMap.java b/src/main/java/net/minecraft/server/ChunkMap.java
index 2ebb2d834..e14ae2b42 100644
index 8b3738c8f..2021c0d02 100644
--- a/src/main/java/net/minecraft/server/ChunkMap.java
+++ b/src/main/java/net/minecraft/server/ChunkMap.java
@@ -48,6 +48,15 @@ public class ChunkMap extends Long2ObjectOpenHashMap<Chunk> {
@ -67,7 +67,7 @@ index 2ebb2d834..e14ae2b42 100644
+ if (chunk.world.paperConfig.delayChunkUnloadsBy > 0) {
+ chunk.scheduledForUnload = System.currentTimeMillis();
+ } else {
+ ((WorldServer) chunk.world).getChunkProviderServer().unload(chunk);
+ ((WorldServer) chunk.world).getChunkProvider().unload(chunk);
+ }
+ }
+ // Paper end
@ -99,17 +99,17 @@ index 1d08ec37f..516a583a8 100644
this.chunkScheduler.a(booleansupplier);
}
diff --git a/src/main/java/net/minecraft/server/PlayerChunk.java b/src/main/java/net/minecraft/server/PlayerChunk.java
index c7ea17e25..7cb1327a8 100644
index 1d672eaa1..5497a458d 100644
--- a/src/main/java/net/minecraft/server/PlayerChunk.java
+++ b/src/main/java/net/minecraft/server/PlayerChunk.java
@@ -33,8 +33,22 @@ public class PlayerChunk {
public void run() {
loadInProgress = false;
PlayerChunk.this.chunk = PlayerChunk.this.playerChunkMap.getWorld().getChunkProviderServer().getChunkAt(location.x, location.z, true, true);
+ markChunkUsed(); // Paper - delay chunk unloads
}
};
+ // Paper start - delay chunk unloads
@@ -26,8 +26,23 @@ public class PlayerChunk {
ChunkProviderServer chunkproviderserver = playerchunkmap.getWorld().getChunkProvider();
chunkproviderserver.a(ix, j);
this.chunk = chunkproviderserver.getChunkAt(ix, j, true, false);
+ markChunkUsed(); // Paper - delay chunk unloads
}
+ // Paper start
+ private void markChunkUsed() {
+ if (chunk == null) {
+ return;
@ -122,55 +122,48 @@ index c7ea17e25..7cb1327a8 100644
+ }
+ private boolean chunkHasPlayers = false;
+ // Paper end
// CraftBukkit end
public PlayerChunk(PlayerChunkMap playerchunkmap, int i, int j) {
@@ -44,6 +58,7 @@ public class PlayerChunk {
chunkproviderserver.a(i, j);
this.chunk = chunkproviderserver.getChunkAt(i, j, true, false);
+ markChunkUsed(); // Paper - delay chunk unloads
}
+
public ChunkCoordIntPair a() {
@@ -56,6 +71,8 @@ public class PlayerChunk {
return this.location;
}
@@ -38,6 +53,8 @@ public class PlayerChunk {
} else {
if (this.c.isEmpty()) {
if (this.players.isEmpty()) {
this.i = this.playerChunkMap.getWorld().getTime();
+ chunkHasPlayers = true; // Paper - delay chunk unloads
+ markChunkUsed(); // Paper - delay chunk unloads
}
this.c.add(entityplayer);
@@ -74,6 +91,8 @@ public class PlayerChunk {
this.players.add(entityplayer);
@@ -56,6 +73,8 @@ public class PlayerChunk {
this.c.remove(entityplayer);
if (this.c.isEmpty()) {
this.players.remove(entityplayer);
if (this.players.isEmpty()) {
+ chunkHasPlayers = false; // Paper - delay chunk unloads
+ markChunkUsed(); // Paper - delay chunk unloads
this.playerChunkMap.b(this);
}
@@ -85,6 +104,7 @@ public class PlayerChunk {
@@ -67,6 +86,7 @@ public class PlayerChunk {
return true;
} else {
this.chunk = this.playerChunkMap.getWorld().getChunkProviderServer().getChunkAt(this.location.x, this.location.z, true, flag);
this.chunk = this.playerChunkMap.getWorld().getChunkProvider().getChunkAt(this.location.x, this.location.z, true, flag);
+ markChunkUsed(); // Paper - delay chunk unloads
return this.chunk != null;
}
}
diff --git a/src/main/java/net/minecraft/server/PlayerChunkMap.java b/src/main/java/net/minecraft/server/PlayerChunkMap.java
index b8d8fc779..e5605c309 100644
index 3d17ad646..c3ac66d35 100644
--- a/src/main/java/net/minecraft/server/PlayerChunkMap.java
+++ b/src/main/java/net/minecraft/server/PlayerChunkMap.java
@@ -460,7 +460,13 @@ public class PlayerChunkMap {
@@ -456,7 +456,13 @@ public class PlayerChunkMap {
Chunk chunk = playerchunk.f();
if (chunk != null) {
- this.getWorld().getChunkProviderServer().unload(chunk);
- this.getWorld().getChunkProvider().unload(chunk);
+ // Paper start - delay chunk unloads
+ if (world.paperConfig.delayChunkUnloadsBy <= 0) {
+ this.getWorld().getChunkProviderServer().unload(chunk);
+ this.getWorld().getChunkProvider().unload(chunk);
+ } else {
+ chunk.scheduledForUnload = System.currentTimeMillis();
+ }
@ -179,10 +172,10 @@ index b8d8fc779..e5605c309 100644
}
diff --git a/src/main/java/net/minecraft/server/World.java b/src/main/java/net/minecraft/server/World.java
index 49432f2eb..288152775 100644
index 5d7370029..6f672aa22 100644
--- a/src/main/java/net/minecraft/server/World.java
+++ b/src/main/java/net/minecraft/server/World.java
@@ -1342,7 +1342,13 @@ public abstract class World implements IEntityAccess, GeneratorAccess, IIBlockAc
@@ -1292,7 +1292,13 @@ public abstract class World implements IEntityAccess, GeneratorAccess, IIBlockAc
if (!tileentity.x() && tileentity.hasWorld()) {
BlockPosition blockposition = tileentity.getPosition();
@ -198,11 +191,11 @@ index 49432f2eb..288152775 100644
this.methodProfiler.a(() -> {
return String.valueOf(TileEntityTypes.a(tileentity.C()));
diff --git a/src/main/java/org/bukkit/craftbukkit/CraftWorld.java b/src/main/java/org/bukkit/craftbukkit/CraftWorld.java
index 24e504c27..f0e974dff 100644
index b19eef1b1..f1320f5ac 100644
--- a/src/main/java/org/bukkit/craftbukkit/CraftWorld.java
+++ b/src/main/java/org/bukkit/craftbukkit/CraftWorld.java
@@ -1757,7 +1757,7 @@ public class CraftWorld implements World {
ChunkProviderServer cps = world.getChunkProviderServer();
ChunkProviderServer cps = world.getChunkProvider();
for (net.minecraft.server.Chunk chunk : cps.chunks.values()) {
// If in use, skip it
- if (isChunkInUse(chunk.locX, chunk.locZ)) {

Datei anzeigen

@ -1,4 +1,4 @@
From af3d6d625bbb57168b75bd1995f4135cf107c94e Mon Sep 17 00:00:00 2001
From af2828a58a4f89566cc230a26042e7811491def3 Mon Sep 17 00:00:00 2001
From: Aikar <aikar@aikar.co>
Date: Tue, 21 Jun 2016 22:54:34 -0400
Subject: [PATCH] Fix Double World Add issues
@ -8,7 +8,7 @@ Vanilla will double add Spider Jockeys to the world, so ignore already added.
Also add debug if something else tries to, and abort before world gets bad state
diff --git a/src/main/java/net/minecraft/server/ChunkRegionLoader.java b/src/main/java/net/minecraft/server/ChunkRegionLoader.java
index 4a0f3989e6..695044b1b1 100644
index 3b39b5472..6093ae408 100644
--- a/src/main/java/net/minecraft/server/ChunkRegionLoader.java
+++ b/src/main/java/net/minecraft/server/ChunkRegionLoader.java
@@ -1052,7 +1052,7 @@ public class ChunkRegionLoader implements IChunkLoader, IAsyncChunkSaver {
@ -21,17 +21,17 @@ index 4a0f3989e6..695044b1b1 100644
Iterator iterator = entity.bP().iterator();
diff --git a/src/main/java/net/minecraft/server/World.java b/src/main/java/net/minecraft/server/World.java
index d31101861c..a81c7dfa2e 100644
index 6f672aa22..0d04b14cf 100644
--- a/src/main/java/net/minecraft/server/World.java
+++ b/src/main/java/net/minecraft/server/World.java
@@ -993,6 +993,7 @@ public abstract class World implements IEntityAccess, GeneratorAccess, IIBlockAc
@@ -992,6 +992,7 @@ public abstract class World implements IEntityAccess, GeneratorAccess, IIBlockAc
public boolean addEntity(Entity entity, SpawnReason spawnReason) { // Changed signature, added SpawnReason
org.spigotmc.AsyncCatcher.catchOp( "entity add"); // Spigot
if (entity == null) return false;
+ if (entity.valid) { MinecraftServer.LOGGER.error("Attempted Double World add on " + entity, new Throwable()); return true; } // Paper
org.bukkit.event.Cancellable event = null;
if (entity instanceof EntityLiving && !(entity instanceof EntityPlayer)) {
if (!CraftEventFactory.doEntityAddEventCalling(this, entity, spawnReason)) {
return false;
}
--
2.19.0
2.20.0

Datei anzeigen

@ -1,11 +1,11 @@
From 07cc2951361cee1c499c68b7bbc79328f27da88d Mon Sep 17 00:00:00 2001
From d0b00a2f0cdb9e94da1f1942cf8b9a9b4ec403da Mon Sep 17 00:00:00 2001
From: Gabriele C <sgdc3.mail@gmail.com>
Date: Fri, 5 Aug 2016 01:03:08 +0200
Subject: [PATCH] Add setting for proxy online mode status
diff --git a/src/main/java/com/destroystokyo/paper/PaperConfig.java b/src/main/java/com/destroystokyo/paper/PaperConfig.java
index c4d12c315..1c1ef2dc2 100644
index e10055b7d..2ae623e7d 100644
--- a/src/main/java/com/destroystokyo/paper/PaperConfig.java
+++ b/src/main/java/com/destroystokyo/paper/PaperConfig.java
@@ -22,6 +22,7 @@ import org.bukkit.configuration.InvalidConfigurationException;
@ -31,7 +31,7 @@ index c4d12c315..1c1ef2dc2 100644
+ }
}
diff --git a/src/main/java/net/minecraft/server/NameReferencingFileConverter.java b/src/main/java/net/minecraft/server/NameReferencingFileConverter.java
index 58d971cf2..658f7be0d 100644
index 5977d3b48..c3f3ae03a 100644
--- a/src/main/java/net/minecraft/server/NameReferencingFileConverter.java
+++ b/src/main/java/net/minecraft/server/NameReferencingFileConverter.java
@@ -60,7 +60,8 @@ public class NameReferencingFileConverter {
@ -45,10 +45,10 @@ index 58d971cf2..658f7be0d 100644
} else {
String[] astring1 = astring;
diff --git a/src/main/java/org/bukkit/craftbukkit/CraftServer.java b/src/main/java/org/bukkit/craftbukkit/CraftServer.java
index b79f75bb0..b9eaaae29 100644
index c655d51ac..f90b708e4 100644
--- a/src/main/java/org/bukkit/craftbukkit/CraftServer.java
+++ b/src/main/java/org/bukkit/craftbukkit/CraftServer.java
@@ -1411,7 +1411,8 @@ public final class CraftServer implements Server {
@@ -1410,7 +1410,8 @@ public final class CraftServer implements Server {
// Spigot Start
GameProfile profile = null;
// Only fetch an online UUID in online mode
@ -59,5 +59,5 @@ index b79f75bb0..b9eaaae29 100644
profile = console.getUserCache().getProfile( name );
}
--
2.19.1
2.20.0

Datei anzeigen

@ -1,4 +1,4 @@
From cf6a10fd06d8de714535f84169f67871c80f0f6f Mon Sep 17 00:00:00 2001
From 64fefafc70b954dc364db2d05e3d7cf101ed823c Mon Sep 17 00:00:00 2001
From: Aikar <aikar@aikar.co>
Date: Mon, 19 Sep 2016 23:16:39 -0400
Subject: [PATCH] Auto Save Improvements
@ -64,10 +64,10 @@ index d8f258105..47bfb5b62 100644
+ }
}
diff --git a/src/main/java/net/minecraft/server/Chunk.java b/src/main/java/net/minecraft/server/Chunk.java
index 2a9bfd7af..2af8a582b 100644
index 86bdd6e7f..1a8317256 100644
--- a/src/main/java/net/minecraft/server/Chunk.java
+++ b/src/main/java/net/minecraft/server/Chunk.java
@@ -49,9 +49,9 @@ public class Chunk implements IChunkAccess {
@@ -54,9 +54,9 @@ public class Chunk implements IChunkAccess {
private final TickList<Block> s;
private final TickList<FluidType> t;
private boolean u;
@ -79,7 +79,7 @@ index 2a9bfd7af..2af8a582b 100644
private int y;
private long z;
private int A;
@@ -1059,11 +1059,11 @@ public class Chunk implements IChunkAccess {
@@ -1072,11 +1072,11 @@ public class Chunk implements IChunkAccess {
if (this.v && this.world.getTime() != this.lastSaved || this.x) {
return true;
}
@ -109,7 +109,7 @@ index 516a583a8..27bed54d2 100644
}
}
diff --git a/src/main/java/net/minecraft/server/EntityPlayer.java b/src/main/java/net/minecraft/server/EntityPlayer.java
index 3e4c80e0f..8506fad6f 100644
index 77c23884f..52dc6d83b 100644
--- a/src/main/java/net/minecraft/server/EntityPlayer.java
+++ b/src/main/java/net/minecraft/server/EntityPlayer.java
@@ -37,6 +37,7 @@ public class EntityPlayer extends EntityHuman implements ICrafting {
@ -121,7 +121,7 @@ index 3e4c80e0f..8506fad6f 100644
public final MinecraftServer server;
public final PlayerInteractManager playerInteractManager;
diff --git a/src/main/java/net/minecraft/server/MinecraftServer.java b/src/main/java/net/minecraft/server/MinecraftServer.java
index bdf4aed1a..acdfb0e1e 100644
index edf72fbec..dacb372a5 100644
--- a/src/main/java/net/minecraft/server/MinecraftServer.java
+++ b/src/main/java/net/minecraft/server/MinecraftServer.java
@@ -148,6 +148,7 @@ public abstract class MinecraftServer implements IAsyncTaskHandler, IMojangStati
@ -137,8 +137,8 @@ index bdf4aed1a..acdfb0e1e 100644
}
- if (autosavePeriod > 0 && this.ticks % autosavePeriod == 0) { // CraftBukkit
this.methodProfiler.a("save");
- this.s.savePlayers();
this.methodProfiler.enter("save");
- this.playerList.savePlayers();
+
+ serverAutoSave = (autosavePeriod > 0 && this.ticks % autosavePeriod == 0); // Paper
+ int playerSaveInterval = com.destroystokyo.paper.PaperConfig.playerAutoSaveRate;
@ -146,7 +146,7 @@ index bdf4aed1a..acdfb0e1e 100644
+ playerSaveInterval = autosavePeriod;
+ }
+ if (playerSaveInterval > 0) { // CraftBukkit // Paper
+ this.s.savePlayers(playerSaveInterval);
+ this.playerList.savePlayers(playerSaveInterval);
// Spigot Start
+ } // Paper - Incremental Auto Saving
+
@ -161,14 +161,14 @@ index bdf4aed1a..acdfb0e1e 100644
server.playerCommandState = false;
// this.saveChunks(true);
// Spigot End
this.methodProfiler.e();
this.methodProfiler.exit();
- }
+ //} // Paper - Incremental Auto Saving
this.methodProfiler.a("snooper");
if (getSnooperEnabled() && !this.i.d() && this.ticks > 100) { // Spigot
this.methodProfiler.enter("snooper");
if (getSnooperEnabled() && !this.snooper.d() && this.ticks > 100) { // Spigot
diff --git a/src/main/java/net/minecraft/server/PlayerList.java b/src/main/java/net/minecraft/server/PlayerList.java
index 143c7c1be..1259ec9d6 100644
index 3e4ca288d..e28485f18 100644
--- a/src/main/java/net/minecraft/server/PlayerList.java
+++ b/src/main/java/net/minecraft/server/PlayerList.java
@@ -342,6 +342,7 @@ public abstract class PlayerList {
@ -207,11 +207,11 @@ index 143c7c1be..1259ec9d6 100644
public WhiteList getWhitelist() {
return this.whitelist;
diff --git a/src/main/java/net/minecraft/server/WorldServer.java b/src/main/java/net/minecraft/server/WorldServer.java
index b37b284a5..6a5a7d1e0 100644
index b5983957b..7a765cb7b 100644
--- a/src/main/java/net/minecraft/server/WorldServer.java
+++ b/src/main/java/net/minecraft/server/WorldServer.java
@@ -872,8 +872,9 @@ public class WorldServer extends World implements IAsyncTaskHandler {
ChunkProviderServer chunkproviderserver = this.getChunkProviderServer();
@@ -873,8 +873,9 @@ public class WorldServer extends World implements IAsyncTaskHandler {
ChunkProviderServer chunkproviderserver = this.getChunkProvider();
if (chunkproviderserver.d()) {
- org.bukkit.Bukkit.getPluginManager().callEvent(new org.bukkit.event.world.WorldSaveEvent(getWorld())); // CraftBukkit
@ -221,7 +221,7 @@ index b37b284a5..6a5a7d1e0 100644
if (iprogressupdate != null) {
iprogressupdate.a(new ChatMessage("menu.savingLevel", new Object[0]));
}
@@ -882,6 +883,7 @@ public class WorldServer extends World implements IAsyncTaskHandler {
@@ -883,6 +884,7 @@ public class WorldServer extends World implements IAsyncTaskHandler {
if (iprogressupdate != null) {
iprogressupdate.c(new ChatMessage("menu.savingChunks", new Object[0]));
}

Datei anzeigen

@ -1,4 +1,4 @@
From afbbf90dcb52b0a550cbeec5b56d0c5a793e0b9f Mon Sep 17 00:00:00 2001
From 95cbe99b8731468c68949457a58ff6d966608555 Mon Sep 17 00:00:00 2001
From: Aikar <aikar@aikar.co>
Date: Wed, 21 Sep 2016 22:54:28 -0400
Subject: [PATCH] Chunk registration fixes
@ -8,10 +8,10 @@ World checks and the Chunk Add logic are inconsistent on how Y > 256, < 0, is tr
Keep them consistent
diff --git a/src/main/java/net/minecraft/server/World.java b/src/main/java/net/minecraft/server/World.java
index a81c7dfa2e..3740cdf95d 100644
index 0d04b14cf..b17a8d60c 100644
--- a/src/main/java/net/minecraft/server/World.java
+++ b/src/main/java/net/minecraft/server/World.java
@@ -1522,7 +1522,7 @@ public abstract class World implements IEntityAccess, GeneratorAccess, IIBlockAc
@@ -1472,7 +1472,7 @@ public abstract class World implements IEntityAccess, GeneratorAccess, IIBlockAc
}
i = MathHelper.floor(entity.locX / 16.0D);
@ -19,7 +19,7 @@ index a81c7dfa2e..3740cdf95d 100644
+ j = Math.min(15, Math.max(0, MathHelper.floor(entity.locY / 16.0D))); // Paper - stay consistent with chunk add/remove behavior
int k = MathHelper.floor(entity.locZ / 16.0D);
if (!entity.inChunk || entity.ae != i || entity.af != j || entity.ag != k) {
if (!entity.inChunk || entity.chunkX != i || entity.chunkY != j || entity.chunkZ != k) {
--
2.19.0
2.20.0

Datei anzeigen

@ -1,4 +1,4 @@
From b03a6b29d9398f78e843a25695269c8e774173e7 Mon Sep 17 00:00:00 2001
From bc73991ca431d8103066de1681288a381527e1f5 Mon Sep 17 00:00:00 2001
From: Aikar <aikar@aikar.co>
Date: Mon, 26 Sep 2016 01:51:30 -0400
Subject: [PATCH] Disable Vanilla Chunk GC
@ -6,10 +6,10 @@ Subject: [PATCH] Disable Vanilla Chunk GC
Bukkit has its own system for this.
diff --git a/src/main/java/net/minecraft/server/WorldServer.java b/src/main/java/net/minecraft/server/WorldServer.java
index ca2e027cda..f9b4f314ce 100644
index 7a765cb7b..a8675b8c6 100644
--- a/src/main/java/net/minecraft/server/WorldServer.java
+++ b/src/main/java/net/minecraft/server/WorldServer.java
@@ -889,6 +889,7 @@ public class WorldServer extends World implements IAsyncTaskHandler {
@@ -890,6 +890,7 @@ public class WorldServer extends World implements IAsyncTaskHandler {
chunkproviderserver.a(flag);
timings.worldSaveChunks.stopTiming(); // Paper
// CraftBukkit - ArrayList -> Collection
@ -17,7 +17,7 @@ index ca2e027cda..f9b4f314ce 100644
java.util.Collection arraylist = chunkproviderserver.a();
Iterator iterator = arraylist.iterator();
@@ -898,7 +899,8 @@ public class WorldServer extends World implements IAsyncTaskHandler {
@@ -899,7 +900,8 @@ public class WorldServer extends World implements IAsyncTaskHandler {
if (chunk != null && !this.manager.a(chunk.locX, chunk.locZ)) {
chunkproviderserver.unload(chunk);
}
@ -28,5 +28,5 @@ index ca2e027cda..f9b4f314ce 100644
}
}
--
2.19.0
2.20.0

Datei anzeigen

@ -1,4 +1,4 @@
From e3ae689d96b38bcb31c49ce06e4347fd2c9729f8 Mon Sep 17 00:00:00 2001
From 2c00cec203c7d519a368124a199e4f9719315956 Mon Sep 17 00:00:00 2001
From: Zach Brown <zach.brown@destroystokyo.com>
Date: Wed, 5 Oct 2016 16:27:36 -0500
Subject: [PATCH] Option to remove corrupt tile entities
@ -19,10 +19,10 @@ index 47bfb5b62..e8417cb2e 100644
+ }
}
diff --git a/src/main/java/net/minecraft/server/Chunk.java b/src/main/java/net/minecraft/server/Chunk.java
index 2af8a582b..9430bccf6 100644
index 1a8317256..9d3234c1c 100644
--- a/src/main/java/net/minecraft/server/Chunk.java
+++ b/src/main/java/net/minecraft/server/Chunk.java
@@ -839,6 +839,12 @@ public class Chunk implements IChunkAccess {
@@ -844,6 +844,12 @@ public class Chunk implements IChunkAccess {
"Chunk coordinates: " + (this.locX * 16) + "," + (this.locZ * 16));
e.printStackTrace();
ServerInternalException.reportInternalException(e);
@ -35,7 +35,7 @@ index 2af8a582b..9430bccf6 100644
// Paper end
// CraftBukkit end
}
@@ -848,6 +854,7 @@ public class Chunk implements IChunkAccess {
@@ -853,6 +859,7 @@ public class Chunk implements IChunkAccess {
this.h.put(new BlockPosition(nbttagcompound.getInt("x"), nbttagcompound.getInt("y"), nbttagcompound.getInt("z")), nbttagcompound);
}

Datei anzeigen

@ -1,11 +1,11 @@
From 14abdd7d5d7c4103a998ea90262f60619d9704b6 Mon Sep 17 00:00:00 2001
From 76212749b31aa78325f5a0500a66dc67830d247b Mon Sep 17 00:00:00 2001
From: AlphaBlend <whizkid3000@hotmail.com>
Date: Sun, 16 Oct 2016 23:19:30 -0700
Subject: [PATCH] Add EntityZapEvent
diff --git a/src/main/java/net/minecraft/server/EntityPig.java b/src/main/java/net/minecraft/server/EntityPig.java
index d299e1efb..30306256a 100644
index 7ef67350a..9dc2d8be2 100644
--- a/src/main/java/net/minecraft/server/EntityPig.java
+++ b/src/main/java/net/minecraft/server/EntityPig.java
@@ -163,6 +163,12 @@ public class EntityPig extends EntityAnimal {
@ -22,7 +22,7 @@ index d299e1efb..30306256a 100644
if (CraftEventFactory.callPigZapEvent(this, entitylightning, entitypigzombie).isCancelled()) {
return;
diff --git a/src/main/java/net/minecraft/server/EntityVillager.java b/src/main/java/net/minecraft/server/EntityVillager.java
index 36ca76bc8..928c5eb41 100644
index d2572b3e1..ddf170180 100644
--- a/src/main/java/net/minecraft/server/EntityVillager.java
+++ b/src/main/java/net/minecraft/server/EntityVillager.java
@@ -607,6 +607,12 @@ public class EntityVillager extends EntityAgeable implements NPC, IMerchant {
@ -39,10 +39,10 @@ index 36ca76bc8..928c5eb41 100644
entitywitch.prepare(this.world.getDamageScaler(new BlockPosition(entitywitch)), (GroupDataEntity) null, (NBTTagCompound) null);
entitywitch.setNoAI(this.isNoAI());
diff --git a/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java b/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java
index c2b24f99f..1b82f22f8 100644
index 35992c4ba..075e6f04e 100644
--- a/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java
+++ b/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java
@@ -793,6 +793,14 @@ public class CraftEventFactory {
@@ -851,6 +851,14 @@ public class CraftEventFactory {
return event;
}
@ -58,5 +58,5 @@ index c2b24f99f..1b82f22f8 100644
HorseJumpEvent event = new HorseJumpEvent((AbstractHorse) horse.getBukkitEntity(), power);
horse.getBukkitEntity().getServer().getPluginManager().callEvent(event);
--
2.19.2
2.20.0

Datei anzeigen

@ -1,4 +1,4 @@
From dccb48aa541237c662412c1137a14a650a5ad852 Mon Sep 17 00:00:00 2001
From 7849382101c9a10a3078ff6801ebf66b81d8bb1d Mon Sep 17 00:00:00 2001
From: Aikar <aikar@aikar.co>
Date: Thu, 3 Nov 2016 21:52:22 -0400
Subject: [PATCH] Prevent Auto Save if Save Queue is full
@ -23,7 +23,7 @@ index e8417cb2e..de59f4ce0 100644
private void removeCorruptTEs() {
removeCorruptTEs = getBoolean("remove-corrupt-tile-entities", false);
diff --git a/src/main/java/net/minecraft/server/ChunkProviderServer.java b/src/main/java/net/minecraft/server/ChunkProviderServer.java
index 27bed54d2..917f57ced 100644
index 27bed54d2..9990cdbcd 100644
--- a/src/main/java/net/minecraft/server/ChunkProviderServer.java
+++ b/src/main/java/net/minecraft/server/ChunkProviderServer.java
@@ -236,6 +236,13 @@ public class ChunkProviderServer implements IChunkProvider {
@ -31,7 +31,7 @@ index 27bed54d2..917f57ced 100644
ObjectIterator objectiterator = this.chunks.values().iterator();
+ // Paper start
+ final ChunkRegionLoader chunkLoader = (ChunkRegionLoader) world.getChunkProviderServer().chunkLoader;
+ final ChunkRegionLoader chunkLoader = (ChunkRegionLoader) world.getChunkProvider().chunkLoader;
+ final int queueSize = chunkLoader.getQueueSize();
+ if (!flag && queueSize > world.paperConfig.queueSizeAutoSaveThreshold){
+ return false;
@ -41,7 +41,7 @@ index 27bed54d2..917f57ced 100644
Chunk chunk = (Chunk) objectiterator.next();
diff --git a/src/main/java/net/minecraft/server/ChunkRegionLoader.java b/src/main/java/net/minecraft/server/ChunkRegionLoader.java
index 8fe4c6fec..a2c3c066b 100644
index 6093ae408..f17869d4d 100644
--- a/src/main/java/net/minecraft/server/ChunkRegionLoader.java
+++ b/src/main/java/net/minecraft/server/ChunkRegionLoader.java
@@ -152,6 +152,8 @@ public class ChunkRegionLoader implements IChunkLoader, IAsyncChunkSaver {

Datei anzeigen

@ -1,4 +1,4 @@
From bc5c56a6e6768f7b9d7f179a61db83e6d8fe92e9 Mon Sep 17 00:00:00 2001
From 4e6ed39f4a404bdd8ed37ebb72c38d80ce475e6b Mon Sep 17 00:00:00 2001
From: Aikar <aikar@aikar.co>
Date: Fri, 4 Nov 2016 02:12:10 -0400
Subject: [PATCH] Chunk Save Stats Debug Option
@ -8,7 +8,7 @@ Adds a command line flag to enable stats on how chunk saves are processing.
Stats on current queue, how many was processed and how many were queued.
diff --git a/src/main/java/net/minecraft/server/ChunkProviderServer.java b/src/main/java/net/minecraft/server/ChunkProviderServer.java
index 917f57ced..570ddc1a8 100644
index 9990cdbcd..b1c4eb4ae 100644
--- a/src/main/java/net/minecraft/server/ChunkProviderServer.java
+++ b/src/main/java/net/minecraft/server/ChunkProviderServer.java
@@ -30,6 +30,11 @@ public class ChunkProviderServer implements IChunkProvider {
@ -25,7 +25,7 @@ index 917f57ced..570ddc1a8 100644
private final ChunkTaskScheduler chunkScheduler;
@@ -239,6 +244,29 @@ public class ChunkProviderServer implements IChunkProvider {
// Paper start
final ChunkRegionLoader chunkLoader = (ChunkRegionLoader) world.getChunkProviderServer().chunkLoader;
final ChunkRegionLoader chunkLoader = (ChunkRegionLoader) world.getChunkProvider().chunkLoader;
final int queueSize = chunkLoader.getQueueSize();
+
+ final long now = System.currentTimeMillis();
@ -54,7 +54,7 @@ index 917f57ced..570ddc1a8 100644
return false;
}
diff --git a/src/main/java/net/minecraft/server/ChunkRegionLoader.java b/src/main/java/net/minecraft/server/ChunkRegionLoader.java
index a2c3c066b..34ddf655e 100644
index f17869d4d..8eecdbd33 100644
--- a/src/main/java/net/minecraft/server/ChunkRegionLoader.java
+++ b/src/main/java/net/minecraft/server/ChunkRegionLoader.java
@@ -152,7 +152,13 @@ public class ChunkRegionLoader implements IChunkLoader, IAsyncChunkSaver {
@ -89,5 +89,5 @@ index a2c3c066b..34ddf655e 100644
if (nbttagcompound == null) {
return true;
--
2.19.2
2.20.0

Datei anzeigen

@ -1,11 +1,11 @@
From 803f81d368bb8d45ff60a0aa77348076e2689c96 Mon Sep 17 00:00:00 2001
From 8dc52859943820f03a34c21f12b64d68fe78f325 Mon Sep 17 00:00:00 2001
From: Alfie Cleveland <alfeh@me.com>
Date: Fri, 25 Nov 2016 13:22:40 +0000
Subject: [PATCH] Optimise removeQueue
diff --git a/src/main/java/net/minecraft/server/EntityPlayer.java b/src/main/java/net/minecraft/server/EntityPlayer.java
index 9929e2a73..c2957ad2e 100644
index 13c538043..c07332e1b 100644
--- a/src/main/java/net/minecraft/server/EntityPlayer.java
+++ b/src/main/java/net/minecraft/server/EntityPlayer.java
@@ -5,8 +5,10 @@ import com.mojang.authlib.GameProfile;
@ -53,8 +53,8 @@ index 9929e2a73..c2957ad2e 100644
}
@@ -1138,7 +1147,14 @@ public class EntityPlayer extends EntityHuman implements ICrafting {
this.lastHealthSent = -1.0F;
this.co = -1;
// this.cy.a((RecipeBook) entityplayer.cy); // CraftBukkit
this.lastFoodSent = -1;
// this.recipeBook.a((RecipeBook) entityplayer.recipeBook); // CraftBukkit
- this.removeQueue.addAll(entityplayer.removeQueue);
+ // Paper start - Optimize remove queue - vanilla copies player objects, but CB doesn't. This method currently only
+ // Applies to the same player, so we need to not duplicate our removal queue. The rest of this method does "resetting"
@ -68,5 +68,5 @@ index 9929e2a73..c2957ad2e 100644
this.cC = entityplayer.cC;
this.setShoulderEntityLeft(entityplayer.getShoulderEntityLeft());
--
2.19.2
2.20.0

Datei anzeigen

@ -1,4 +1,4 @@
From b4bda32113b7f996ab8b0a5eb55e905e41a7255e Mon Sep 17 00:00:00 2001
From e786640212faf8e4bf9c96095614435bc3b948aa Mon Sep 17 00:00:00 2001
From: willies952002 <admin@domnian.com>
Date: Mon, 28 Nov 2016 10:21:52 -0500
Subject: [PATCH] Allow Reloading of Command Aliases
@ -6,10 +6,10 @@ Subject: [PATCH] Allow Reloading of Command Aliases
Reload the aliases stored in commands.yml
diff --git a/src/main/java/org/bukkit/craftbukkit/CraftServer.java b/src/main/java/org/bukkit/craftbukkit/CraftServer.java
index b9eaaae29..67dd3b908 100644
index f90b708e4..84c0a14ec 100644
--- a/src/main/java/org/bukkit/craftbukkit/CraftServer.java
+++ b/src/main/java/org/bukkit/craftbukkit/CraftServer.java
@@ -2082,5 +2082,24 @@ public final class CraftServer implements Server {
@@ -2081,5 +2081,24 @@ public final class CraftServer implements Server {
DefaultPermissions.registerCorePermissions();
CraftDefaultPermissions.registerCorePermissions();
}
@ -35,5 +35,5 @@ index b9eaaae29..67dd3b908 100644
// Paper end
}
--
2.19.1
2.20.0

Datei anzeigen

@ -1,11 +1,11 @@
From 5199cfb3cc6ae5904332802d378e78a5232d55bc Mon Sep 17 00:00:00 2001
From 143891fea19188753b3a7a416f54d988c8b97571 Mon Sep 17 00:00:00 2001
From: AlphaBlend <whizkid3000@hotmail.com>
Date: Thu, 8 Sep 2016 08:48:33 -0700
Subject: [PATCH] Add source to PlayerExpChangeEvent
diff --git a/src/main/java/net/minecraft/server/EntityExperienceOrb.java b/src/main/java/net/minecraft/server/EntityExperienceOrb.java
index e0a38b32a..2f6fd88ca 100644
index 808d1a120..3030dd9c3 100644
--- a/src/main/java/net/minecraft/server/EntityExperienceOrb.java
+++ b/src/main/java/net/minecraft/server/EntityExperienceOrb.java
@@ -185,7 +185,7 @@ public class EntityExperienceOrb extends Entity {
@ -18,7 +18,7 @@ index e0a38b32a..2f6fd88ca 100644
this.die();
diff --git a/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java b/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java
index 1b82f22f8..af61d99bc 100644
index 075e6f04e..2a06cbf85 100644
--- a/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java
+++ b/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java
@@ -51,6 +51,7 @@ import org.bukkit.entity.Player;
@ -29,7 +29,7 @@ index 1b82f22f8..af61d99bc 100644
import org.bukkit.event.Cancellable;
import org.bukkit.event.Event;
import org.bukkit.event.Event.Result;
@@ -762,6 +763,17 @@ public class CraftEventFactory {
@@ -820,6 +821,17 @@ public class CraftEventFactory {
return event;
}
@ -48,5 +48,5 @@ index 1b82f22f8..af61d99bc 100644
return handleBlockGrowEvent(world, pos, block, 3);
}
--
2.19.2
2.20.0

Datei anzeigen

@ -1,4 +1,4 @@
From 4118aa7da5c0587b51d452f6207adf199501380a Mon Sep 17 00:00:00 2001
From 12c01d5926cc5657e82bc0e57258c7536bbec558 Mon Sep 17 00:00:00 2001
From: Techcable <Techcable@outlook.com>
Date: Fri, 16 Dec 2016 21:25:39 -0600
Subject: [PATCH] Add ProjectileCollideEvent
@ -46,7 +46,7 @@ index 3e3619d79..58cc4824c 100644
this.a(movingobjectposition);
diff --git a/src/main/java/net/minecraft/server/EntityFishingHook.java b/src/main/java/net/minecraft/server/EntityFishingHook.java
index ddd77583c..84a9375db 100644
index cffb40efb..45a326779 100644
--- a/src/main/java/net/minecraft/server/EntityFishingHook.java
+++ b/src/main/java/net/minecraft/server/EntityFishingHook.java
@@ -245,6 +245,16 @@ public class EntityFishingHook extends Entity {
@ -87,10 +87,10 @@ index 11638221b..431afaf2f 100644
if (movingobjectposition.type == MovingObjectPosition.EnumMovingObjectType.BLOCK && this.world.getType(movingobjectposition.getBlockPosition()).getBlock() == Blocks.NETHER_PORTAL) {
this.e(movingobjectposition.getBlockPosition());
diff --git a/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java b/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java
index af61d99bc..8d12155c3 100644
index 2a06cbf85..464c5cfc9 100644
--- a/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java
+++ b/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java
@@ -897,6 +897,16 @@ public class CraftEventFactory {
@@ -955,6 +955,16 @@ public class CraftEventFactory {
return CraftItemStack.asNMSCopy(bitem);
}
@ -108,5 +108,5 @@ index af61d99bc..8d12155c3 100644
Projectile bukkitEntity = (Projectile) entity.getBukkitEntity();
ProjectileLaunchEvent event = new ProjectileLaunchEvent(bukkitEntity);
--
2.19.2
2.20.0

Datei anzeigen

@ -1,4 +1,4 @@
From 1665f677863e3e0b9ea1969ebeeba47a08f635bc Mon Sep 17 00:00:00 2001
From 6cb25c00886119aea4b3cdbf46592df12c48a429 Mon Sep 17 00:00:00 2001
From: Aikar <aikar@aikar.co>
Date: Tue, 20 Dec 2016 15:26:27 -0500
Subject: [PATCH] Configurable Cartographer Treasure Maps
@ -28,10 +28,10 @@ index 03b7410f5..5c50c62e5 100644
+ }
}
diff --git a/src/main/java/net/minecraft/server/EntityVillager.java b/src/main/java/net/minecraft/server/EntityVillager.java
index 928c5eb41..ac81a8d76 100644
index ddf170180..bd799d0c6 100644
--- a/src/main/java/net/minecraft/server/EntityVillager.java
+++ b/src/main/java/net/minecraft/server/EntityVillager.java
@@ -757,6 +757,7 @@ public class EntityVillager extends EntityAgeable implements NPC, IMerchant {
@@ -753,6 +753,7 @@ public class EntityVillager extends EntityAgeable implements NPC, IMerchant {
public void a(IMerchant imerchant, MerchantRecipeList merchantrecipelist, Random random) {
int i = this.a.a(random);
World world = imerchant.getWorld();

Datei anzeigen

@ -1,4 +1,4 @@
From 5a5b6bd59f789ea63dab28946a3bb4f88293a24f Mon Sep 17 00:00:00 2001
From a6c308143cb36a05f085bbd4391087888252dcc7 Mon Sep 17 00:00:00 2001
From: Aikar <aikar@aikar.co>
Date: Sat, 7 Jan 2017 15:24:46 -0500
Subject: [PATCH] Provide E/TE/Chunk count stat methods
@ -7,7 +7,7 @@ Provides counts without the ineffeciency of using .getEntities().size()
which creates copy of the collections.
diff --git a/src/main/java/org/bukkit/craftbukkit/CraftWorld.java b/src/main/java/org/bukkit/craftbukkit/CraftWorld.java
index f0e974dff..bcfe4c1da 100644
index f1320f5ac..f1a162420 100644
--- a/src/main/java/org/bukkit/craftbukkit/CraftWorld.java
+++ b/src/main/java/org/bukkit/craftbukkit/CraftWorld.java
@@ -87,6 +87,29 @@ public class CraftWorld implements World {
@ -30,7 +30,7 @@ index f0e974dff..bcfe4c1da 100644
+ return world.tileEntityListTick.size();
+ }
+ public int getChunkCount() {
+ return world.getChunkProviderServer().chunks.size();
+ return world.getChunkProvider().chunks.size();
+ }
+ public int getPlayerCount() {
+ return world.players.size();

Datei anzeigen

@ -1,4 +1,4 @@
From c199e596d1cda4b002a08669e4352b0ecba893eb Mon Sep 17 00:00:00 2001
From 80a09c12e7bb5c9b00b203446bb1a453a33271e1 Mon Sep 17 00:00:00 2001
From: Aikar <aikar@aikar.co>
Date: Sat, 7 Jan 2017 16:06:44 -0500
Subject: [PATCH] Enforce Sync Chunk Unloads
@ -7,7 +7,7 @@ Unloading Chunks async is extremely dangerous. This will force it to main
the same way we handle async chunk loads.
diff --git a/src/main/java/org/bukkit/craftbukkit/CraftWorld.java b/src/main/java/org/bukkit/craftbukkit/CraftWorld.java
index bcfe4c1da..3a30349f4 100644
index f1a162420..5d0e81731 100644
--- a/src/main/java/org/bukkit/craftbukkit/CraftWorld.java
+++ b/src/main/java/org/bukkit/craftbukkit/CraftWorld.java
@@ -235,6 +235,7 @@ public class CraftWorld implements World {
@ -15,13 +15,13 @@ index bcfe4c1da..3a30349f4 100644
private boolean unloadChunk0(int x, int z, boolean save) {
+ Boolean result = MCUtil.ensureMain("Unload Chunk", () -> { // Paper - Ensure never async
net.minecraft.server.Chunk chunk = world.getChunkProviderServer().getChunkAt(x, z, false, false);
net.minecraft.server.Chunk chunk = world.getChunkProvider().getChunkAt(x, z, false, false);
if (chunk == null) {
return true;
@@ -242,6 +243,7 @@ public class CraftWorld implements World {
// If chunk had previously been queued to save, must do save to avoid loss of that data
return world.getChunkProviderServer().unloadChunk(chunk, chunk.mustSave || save);
return world.getChunkProvider().unloadChunk(chunk, chunk.mustSave || save);
+ }); return result != null ? result : false; // Paper - Ensure never async
}

Datei anzeigen

@ -1,4 +1,4 @@
From 43480f765c8ce2abba530e068f7d17448fe4b92a Mon Sep 17 00:00:00 2001
From 8186e73d20a64b9dd3d508260bd6a88e60eea217 Mon Sep 17 00:00:00 2001
From: Zach Brown <zach.brown@destroystokyo.com>
Date: Fri, 12 May 2017 23:34:11 -0500
Subject: [PATCH] Properly handle async calls to restart the server
@ -30,23 +30,23 @@ will have plugins and worlds saving to the disk has a high potential to result
in corruption/dataloss.
diff --git a/src/main/java/net/minecraft/server/MinecraftServer.java b/src/main/java/net/minecraft/server/MinecraftServer.java
index acdfb0e1e..a1a574023 100644
index dacb372a5..fd405281b 100644
--- a/src/main/java/net/minecraft/server/MinecraftServer.java
+++ b/src/main/java/net/minecraft/server/MinecraftServer.java
@@ -90,6 +90,7 @@ public abstract class MinecraftServer implements IAsyncTaskHandler, IMojangStati
public final Map<DimensionManager, WorldServer> worldServer = Maps.newIdentityHashMap();
private PlayerList s;
private PlayerList playerList;
private boolean isRunning = true;
+ private boolean isRestarting = false; // Paper - flag to signify we're attempting to restart
private boolean isStopped;
private int ticks;
protected final Proxy c;
@@ -659,7 +660,7 @@ public abstract class MinecraftServer implements IAsyncTaskHandler, IMojangStati
if (this.s != null) {
if (this.playerList != null) {
MinecraftServer.LOGGER.info("Saving players");
this.s.savePlayers();
- this.s.u();
+ this.s.u(isRestarting); // Paper
this.playerList.savePlayers();
- this.playerList.u();
+ this.playerList.u(isRestarting); // Paper
try { Thread.sleep(100); } catch (InterruptedException ex) {} // CraftBukkit - SPIGOT-625 - give server at least a chance to send packets
}
@ -65,10 +65,10 @@ index acdfb0e1e..a1a574023 100644
}
+ // Paper end
private boolean aT() {
private boolean canSleepForTick() {
return System.nanoTime() - lastTick + catchupTime < TICK_TIME; // Paper - improved "are we lagging" check to match our own
diff --git a/src/main/java/net/minecraft/server/PlayerList.java b/src/main/java/net/minecraft/server/PlayerList.java
index b10ac733f..3f96443eb 100644
index 320c378e0..d8ed44fe2 100644
--- a/src/main/java/net/minecraft/server/PlayerList.java
+++ b/src/main/java/net/minecraft/server/PlayerList.java
@@ -1333,10 +1333,15 @@ public abstract class PlayerList {

Datei anzeigen

@ -1,4 +1,4 @@
From 1d4727137de48e632ae85472704bb0cf5b165115 Mon Sep 17 00:00:00 2001
From 765c04d1f89da22dc10a35695e836e105509f5a6 Mon Sep 17 00:00:00 2001
From: kashike <kashike@vq.lc>
Date: Fri, 9 Jun 2017 07:24:34 -0700
Subject: [PATCH] Add configuration option to prevent player names from being
@ -20,10 +20,10 @@ index 9f8b43d2a..3f59e060b 100644
+ }
}
diff --git a/src/main/java/org/bukkit/craftbukkit/CraftServer.java b/src/main/java/org/bukkit/craftbukkit/CraftServer.java
index 5ec283f5d..ba702591a 100644
index 84c0a14ec..457dec91a 100644
--- a/src/main/java/org/bukkit/craftbukkit/CraftServer.java
+++ b/src/main/java/org/bukkit/craftbukkit/CraftServer.java
@@ -2101,5 +2101,10 @@ public final class CraftServer implements Server {
@@ -2100,5 +2100,10 @@ public final class CraftServer implements Server {
commandMap.registerServerAliases();
return true;
}

Datei anzeigen

@ -1,4 +1,4 @@
From eeaa1bd05811d93b423295ef79a28377e7af0b8d Mon Sep 17 00:00:00 2001
From a84c70f87100764523afaf2f93bffcfdfdaad1f9 Mon Sep 17 00:00:00 2001
From: Minecrell <minecrell@minecrell.net>
Date: Fri, 9 Jun 2017 19:03:43 +0200
Subject: [PATCH] Use TerminalConsoleAppender for console improvements
@ -143,7 +143,7 @@ index 000000000..685deaa0e
+
+}
diff --git a/src/main/java/net/minecraft/server/DedicatedServer.java b/src/main/java/net/minecraft/server/DedicatedServer.java
index a575ff529..908127630 100644
index 7f4c76669..1007641d5 100644
--- a/src/main/java/net/minecraft/server/DedicatedServer.java
+++ b/src/main/java/net/minecraft/server/DedicatedServer.java
@@ -79,6 +79,9 @@ public class DedicatedServer extends MinecraftServer implements IMinecraftServer
@ -185,7 +185,7 @@ index a575ff529..908127630 100644
System.setOut(new PrintStream(new LoggerOutputStream(logger, Level.INFO), true));
System.setErr(new PrintStream(new LoggerOutputStream(logger, Level.WARN), true));
diff --git a/src/main/java/net/minecraft/server/MinecraftServer.java b/src/main/java/net/minecraft/server/MinecraftServer.java
index a1a574023..ce1805062 100644
index fd405281b..9c95661a7 100644
--- a/src/main/java/net/minecraft/server/MinecraftServer.java
+++ b/src/main/java/net/minecraft/server/MinecraftServer.java
@@ -61,7 +61,6 @@ import org.apache.commons.lang3.Validate;
@ -243,7 +243,7 @@ index a1a574023..ce1805062 100644
public KeyPair E() {
diff --git a/src/main/java/net/minecraft/server/PlayerList.java b/src/main/java/net/minecraft/server/PlayerList.java
index 3f96443eb..fb9b0835b 100644
index d8ed44fe2..e7bae58fa 100644
--- a/src/main/java/net/minecraft/server/PlayerList.java
+++ b/src/main/java/net/minecraft/server/PlayerList.java
@@ -78,8 +78,7 @@ public abstract class PlayerList {
@ -257,7 +257,7 @@ index 3f96443eb..fb9b0835b 100644
this.k = new GameProfileBanList(PlayerList.a);
diff --git a/src/main/java/org/bukkit/craftbukkit/CraftServer.java b/src/main/java/org/bukkit/craftbukkit/CraftServer.java
index ba702591a..97fa98d2c 100644
index 457dec91a..4a9af9ac1 100644
--- a/src/main/java/org/bukkit/craftbukkit/CraftServer.java
+++ b/src/main/java/org/bukkit/craftbukkit/CraftServer.java
@@ -144,8 +144,8 @@ import java.nio.ByteBuffer;
@ -270,7 +270,7 @@ index ba702591a..97fa98d2c 100644
import org.bukkit.NamespacedKey;
import org.bukkit.block.data.BlockData;
import org.bukkit.craftbukkit.block.data.CraftBlockData;
@@ -1153,9 +1153,13 @@ public final class CraftServer implements Server {
@@ -1152,9 +1152,13 @@ public final class CraftServer implements Server {
return logger;
}

Datei anzeigen

@ -1,4 +1,4 @@
From 71d83d49a94f00f87c916b14071cc7e2d0ed53c1 Mon Sep 17 00:00:00 2001
From 7748db61002280fe5cce27a6c3a1a26e0cb288f0 Mon Sep 17 00:00:00 2001
From: Shane Freeder <theboyetronic@gmail.com>
Date: Sun, 11 Jun 2017 21:01:18 +0100
Subject: [PATCH] provide a configurable option to disable creeper lingering
@ -21,11 +21,11 @@ index aefb0ce97..af31030dc 100644
+ }
}
diff --git a/src/main/java/net/minecraft/server/EntityCreeper.java b/src/main/java/net/minecraft/server/EntityCreeper.java
index d03c2f4ae..64a5fefad 100644
index b080fc792..fb76dc18b 100644
--- a/src/main/java/net/minecraft/server/EntityCreeper.java
+++ b/src/main/java/net/minecraft/server/EntityCreeper.java
@@ -214,7 +214,7 @@ public class EntityCreeper extends EntityMonster {
private void dF() {
private void createEffectCloud() {
Collection collection = this.getEffects();
- if (!collection.isEmpty()) {

Datei anzeigen

@ -1,4 +1,4 @@
From 3fdf826658a104dd664d8178cecd9f402e5cd17d Mon Sep 17 00:00:00 2001
From 220ba34511680c2cfa4eb0b7be73def8b83ef78a Mon Sep 17 00:00:00 2001
From: Aikar <aikar@aikar.co>
Date: Mon, 15 Jan 2018 22:11:48 -0500
Subject: [PATCH] Basic PlayerProfile API
@ -429,7 +429,7 @@ index e1af5c488..0ef5ad116 100644
* Calculates distance between 2 entities
* @param e1
diff --git a/src/main/java/net/minecraft/server/MinecraftServer.java b/src/main/java/net/minecraft/server/MinecraftServer.java
index ce1805062..34ba382a4 100644
index 9c95661a7..906bd973d 100644
--- a/src/main/java/net/minecraft/server/MinecraftServer.java
+++ b/src/main/java/net/minecraft/server/MinecraftServer.java
@@ -1189,7 +1189,7 @@ public abstract class MinecraftServer implements IAsyncTaskHandler, IMojangStati
@ -450,7 +450,7 @@ index ce1805062..34ba382a4 100644
return this.V;
}
diff --git a/src/main/java/net/minecraft/server/UserCache.java b/src/main/java/net/minecraft/server/UserCache.java
index a47a51a41..4c476f757 100644
index 7d9edb9a6..355875a98 100644
--- a/src/main/java/net/minecraft/server/UserCache.java
+++ b/src/main/java/net/minecraft/server/UserCache.java
@@ -44,7 +44,7 @@ public class UserCache {
@ -486,7 +486,7 @@ index a47a51a41..4c476f757 100644
private UserCacheEntry(GameProfile gameprofile, Date date) {
diff --git a/src/main/java/org/bukkit/craftbukkit/CraftServer.java b/src/main/java/org/bukkit/craftbukkit/CraftServer.java
index 873170864..72da1fe81 100644
index e08da05d4..b5d0886df 100644
--- a/src/main/java/org/bukkit/craftbukkit/CraftServer.java
+++ b/src/main/java/org/bukkit/craftbukkit/CraftServer.java
@@ -162,6 +162,10 @@ import org.bukkit.event.server.ServerLoadEvent;
@ -500,7 +500,7 @@ index 873170864..72da1fe81 100644
public final class CraftServer implements Server {
private final String serverName = "Paper"; // Paper
private final String serverVersion;
@@ -2117,5 +2121,21 @@ public final class CraftServer implements Server {
@@ -2116,5 +2120,21 @@ public final class CraftServer implements Server {
public boolean suggestPlayerNamesWhenNullTabCompletions() {
return com.destroystokyo.paper.PaperConfig.suggestPlayersWhenNullTabCompletions;
}

Datei anzeigen

@ -1,17 +1,17 @@
From 912a05f471cf950cf051635db0bc1a1dc4836711 Mon Sep 17 00:00:00 2001
From c69d35dbafb176fa11f092431c37e66d8824d2b1 Mon Sep 17 00:00:00 2001
From: Zach Brown <zach.brown@destroystokyo.com>
Date: Sun, 2 Jul 2017 21:35:56 -0500
Subject: [PATCH] Block player logins during server shutdown
diff --git a/src/main/java/net/minecraft/server/LoginListener.java b/src/main/java/net/minecraft/server/LoginListener.java
index bb08200e7..90d1096e5 100644
index 9f6b73d80..af5c699fe 100644
--- a/src/main/java/net/minecraft/server/LoginListener.java
+++ b/src/main/java/net/minecraft/server/LoginListener.java
@@ -50,6 +50,12 @@ public class LoginListener implements PacketLoginInListener, ITickable {
}
public void Y_() {
public void tick() {
+ // Paper start - Do not allow logins while the server is shutting down
+ if (!MinecraftServer.getServer().isRunning()) {
+ this.disconnect(new ChatMessage(org.spigotmc.SpigotConfig.restartMessage));

Datei anzeigen

@ -1,4 +1,4 @@
From 0cdc623700a1b50c3acea53bb5dafa30c1d4b9ae Mon Sep 17 00:00:00 2001
From 7e329c1d9bf4348638bc615cbfcc9a1bae32453a Mon Sep 17 00:00:00 2001
From: Aikar <aikar@aikar.co>
Date: Thu, 27 Jul 2017 00:06:43 -0400
Subject: [PATCH] GH-806: Respect saving disabled before unloading all chunks
@ -9,16 +9,16 @@ This behavior causes a save to occur even though saving was supposed to be turne
It's triggered when Hell/End worlds are empty of players.
diff --git a/src/main/java/net/minecraft/server/PlayerChunkMap.java b/src/main/java/net/minecraft/server/PlayerChunkMap.java
index e5605c309..9d971a9c5 100644
index c3ac66d35..5935bae58 100644
--- a/src/main/java/net/minecraft/server/PlayerChunkMap.java
+++ b/src/main/java/net/minecraft/server/PlayerChunkMap.java
@@ -194,7 +194,7 @@ public class PlayerChunkMap {
@@ -190,7 +190,7 @@ public class PlayerChunkMap {
try (Timing ignored = world.timings.doChunkMapUnloadChunks.startTiming()) { // Paper
WorldProvider worldprovider = this.world.worldProvider;
- if (!worldprovider.canRespawn()) {
+ if (!worldprovider.canRespawn() && !this.world.savingDisabled) { // Paper - respect saving disabled setting
this.world.getChunkProviderServer().b();
this.world.getChunkProvider().b();
}
} // Paper timing
--

Datei anzeigen

@ -1,15 +1,15 @@
From c5f69b14314ce7cd684e89b68e01fd1eb66e7de1 Mon Sep 17 00:00:00 2001
From 0297f85dc1ab08552c0c9e13f9e018b2a7810bc9 Mon Sep 17 00:00:00 2001
From: mezz <tehgeek@gmail.com>
Date: Wed, 9 Aug 2017 17:51:22 -0500
Subject: [PATCH] Fix MC-117075: TE Unload Lag Spike
diff --git a/src/main/java/net/minecraft/server/World.java b/src/main/java/net/minecraft/server/World.java
index c92df00e8..44ed34174 100644
index 65973edfc..cb62af425 100644
--- a/src/main/java/net/minecraft/server/World.java
+++ b/src/main/java/net/minecraft/server/World.java
@@ -1323,7 +1323,11 @@ public abstract class World implements IEntityAccess, GeneratorAccess, IIBlockAc
this.methodProfiler.c("blockEntities");
@@ -1273,7 +1273,11 @@ public abstract class World implements IEntityAccess, GeneratorAccess, IIBlockAc
this.methodProfiler.exitEnter("blockEntities");
timings.tileEntityTick.startTiming(); // Spigot
if (!this.tileEntityListUnload.isEmpty()) {
- this.tileEntityListTick.removeAll(this.tileEntityListUnload);

Datei anzeigen

@ -1,4 +1,4 @@
From 2b86a7eb79d741932c7ca5359af1ac0dd3cd00d9 Mon Sep 17 00:00:00 2001
From f71671bbb061fadb6bc835be690aec6bb587835b Mon Sep 17 00:00:00 2001
From: Shane Freeder <theboyetronic@gmail.com>
Date: Thu, 5 Oct 2017 01:54:07 +0100
Subject: [PATCH] handle PacketPlayInKeepAlive async
@ -15,7 +15,7 @@ also adding some additional logging in order to help work out what is causing
random disconnections for clients.
diff --git a/src/main/java/net/minecraft/server/PlayerConnection.java b/src/main/java/net/minecraft/server/PlayerConnection.java
index 00751a9d9..587f00286 100644
index 5076b9627..fb63496a0 100644
--- a/src/main/java/net/minecraft/server/PlayerConnection.java
+++ b/src/main/java/net/minecraft/server/PlayerConnection.java
@@ -2470,14 +2470,18 @@ public class PlayerConnection implements PacketListenerPlayIn, ITickable {
@ -24,11 +24,11 @@ index 00751a9d9..587f00286 100644
public void a(PacketPlayInKeepAlive packetplayinkeepalive) {
- PlayerConnectionUtils.ensureMainThread(packetplayinkeepalive, this, this.player.getWorldServer()); // CraftBukkit
+ //PlayerConnectionUtils.ensureMainThread(packetplayinkeepalive, this, this.player.getWorldServer()); // CraftBukkit // Paper - This shouldn't be on the main thread
if (this.g && packetplayinkeepalive.b() == this.h) {
int i = (int) (SystemUtils.b() - this.f);
if (this.awaitingKeepAlive && packetplayinkeepalive.b() == this.h) {
int i = (int) (SystemUtils.getMonotonicMillis() - this.lastKeepAlive);
this.player.ping = (this.player.ping * 3 + i) / 4;
this.g = false;
this.awaitingKeepAlive = false;
} else if (!this.player.getDisplayName().getString().equals(this.minecraftServer.G())) {
- this.disconnect(new ChatMessage("disconnect.timeout", new Object[0]));
+ // Paper start - This needs to be handled on the main thread for plugins

Datei anzeigen

@ -1,4 +1,4 @@
From 68c17de42dd9181bf40c9da2053c577a5896e86b Mon Sep 17 00:00:00 2001
From 4f61d9e0c6247790014a1d359cdf9c132a199dde Mon Sep 17 00:00:00 2001
From: Shane Freeder <theboyetronic@gmail.com>
Date: Sun, 15 Oct 2017 00:29:07 +0100
Subject: [PATCH] revert serverside behavior of keepalives
@ -17,16 +17,16 @@ from networking or during connections flood of chunk packets on slower clients,
at the cost of dead connections being kept open for longer.
diff --git a/src/main/java/net/minecraft/server/PlayerConnection.java b/src/main/java/net/minecraft/server/PlayerConnection.java
index 587f00286..870b59ce1 100644
index fb63496a0..921e1ec9e 100644
--- a/src/main/java/net/minecraft/server/PlayerConnection.java
+++ b/src/main/java/net/minecraft/server/PlayerConnection.java
@@ -71,7 +71,7 @@ public class PlayerConnection implements PacketListenerPlayIn, ITickable {
private final MinecraftServer minecraftServer;
public EntityPlayer player;
private int e;
- private long f; private void setLastPing(long lastPing) { this.f = lastPing;}; private long getLastPing() { return this.f;}; // Paper - OBFHELPER
+ private long f = SystemUtils.b(); private void setLastPing(long lastPing) { this.f = lastPing;}; private long getLastPing() { return this.f;}; // Paper - OBFHELPER - set ping to delay initial
private boolean g; private void setPendingPing(boolean isPending) { this.g = isPending;}; private boolean isPendingPing() { return this.g;}; // Paper - OBFHELPER
- private long lastKeepAlive; private void setLastPing(long lastPing) { this.lastKeepAlive = lastPing;}; private long getLastPing() { return this.lastKeepAlive;}; // Paper - OBFHELPER
+ private long lastKeepAlive = SystemUtils.getMonotonicMillis(); private void setLastPing(long lastPing) { this.lastKeepAlive = lastPing;}; private long getLastPing() { return this.lastKeepAlive;}; // Paper - OBFHELPER
private boolean awaitingKeepAlive; private void setPendingPing(boolean isPending) { this.awaitingKeepAlive = isPending;}; private boolean isPendingPing() { return this.awaitingKeepAlive;}; // Paper - OBFHELPER
private long h; private void setKeepAliveID(long keepAliveID) { this.h = keepAliveID;}; private long getKeepAliveID() {return this.h; }; // Paper - OBFHELPER
// CraftBukkit start - multithreaded fields
@@ -102,6 +102,7 @@ public class PlayerConnection implements PacketListenerPlayIn, ITickable {
@ -40,14 +40,14 @@ index 587f00286..870b59ce1 100644
@@ -180,18 +181,26 @@ public class PlayerConnection implements PacketListenerPlayIn, ITickable {
}
this.minecraftServer.methodProfiler.a("keepAlive");
- long i = SystemUtils.b();
this.minecraftServer.methodProfiler.enter("keepAlive");
- long i = SystemUtils.getMonotonicMillis();
-
- if (i - this.f >= 25000L) { // CraftBukkit
- if (this.g) {
- if (i - this.lastKeepAlive >= 25000L) { // CraftBukkit
- if (this.awaitingKeepAlive) {
+ // Paper Start - give clients a longer time to respond to pings as per pre 1.12.2 timings
+ // This should effectively place the keepalive handling back to "as it was" before 1.12.2
+ long currentTime = SystemUtils.b();
+ long currentTime = SystemUtils.getMonotonicMillis();
+ long elapsedTime = currentTime - this.getLastPing();
+
+ if (this.isPendingPing()) {
@ -55,8 +55,8 @@ index 587f00286..870b59ce1 100644
+ PlayerConnection.LOGGER.warn("{} was kicked due to keepalive timeout!", this.player.getName()); // more info
this.disconnect(new ChatMessage("disconnect.timeout", new Object[0]));
- } else {
- this.g = true;
- this.f = i;
- this.awaitingKeepAlive = true;
- this.lastKeepAlive = i;
- this.h = i;
- this.sendPacket(new PacketPlayOutKeepAlive(this.h));
+ }
@ -71,7 +71,7 @@ index 587f00286..870b59ce1 100644
}
+ // Paper end
this.minecraftServer.methodProfiler.e();
this.minecraftServer.methodProfiler.exit();
// CraftBukkit start
--
2.20.0

Datei anzeigen

@ -1,4 +1,4 @@
From db27a9af2843c90224bd268bdc1ace22fcca28e0 Mon Sep 17 00:00:00 2001
From 74eddc1deef9efd69230110de71d669ff4e975ce Mon Sep 17 00:00:00 2001
From: BillyGalbreath <Blake.Galbreath@GMail.com>
Date: Fri, 10 Nov 2017 23:03:12 -0500
Subject: [PATCH] Option for maximum exp value when merging orbs
@ -19,20 +19,20 @@ index af31030dc..b6764c7ec 100644
+ log("Experience Merge Max Value: " + expMergeMaxValue);
+ }
}
diff --git a/src/main/java/net/minecraft/server/World.java b/src/main/java/net/minecraft/server/World.java
index c1ede0651..15e07ce84 100644
--- a/src/main/java/net/minecraft/server/World.java
+++ b/src/main/java/net/minecraft/server/World.java
@@ -1032,16 +1032,32 @@ public abstract class World implements IEntityAccess, GeneratorAccess, IIBlockAc
diff --git a/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java b/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java
index 464c5cfc9..14df8e80b 100644
--- a/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java
+++ b/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java
@@ -390,16 +390,32 @@ public class CraftEventFactory {
EntityExperienceOrb xp = (EntityExperienceOrb) entity;
double radius = spigotConfig.expMerge;
double radius = world.spigotConfig.expMerge;
if (radius > 0) {
+ // Paper start - Maximum exp value when merging - Whole section has been tweaked, see comments for specifics
+ final int maxValue = paperConfig.expMergeMaxValue;
+ final boolean mergeUnconditionally = paperConfig.expMergeMaxValue <= 0;
+ final int maxValue = world.paperConfig.expMergeMaxValue;
+ final boolean mergeUnconditionally = world.paperConfig.expMergeMaxValue <= 0;
+ if (mergeUnconditionally || xp.value < maxValue) { // Paper - Skip iteration if unnecessary
+
List<Entity> entities = this.getEntities(entity, entity.getBoundingBox().grow(radius, radius, radius));
List<Entity> entities = world.getEntities(entity, entity.getBoundingBox().grow(radius, radius, radius));
for (Entity e : entities) {
if (e instanceof EntityExperienceOrb) {
EntityExperienceOrb loopItem = (EntityExperienceOrb) e;

Datei anzeigen

@ -1,4 +1,4 @@
From 5c19fb1b13f0e281aaf374a427335215bf77b770 Mon Sep 17 00:00:00 2001
From 329d98d1c8a9fa4db98a61786037815ef3d5cde5 Mon Sep 17 00:00:00 2001
From: Aikar <aikar@aikar.co>
Date: Sun, 26 Nov 2017 13:19:58 -0500
Subject: [PATCH] AsyncTabCompleteEvent
@ -14,7 +14,7 @@ completion, such as offline players.
Also adds isCommand and getLocation to the sync TabCompleteEvent
diff --git a/src/main/java/net/minecraft/server/PlayerConnection.java b/src/main/java/net/minecraft/server/PlayerConnection.java
index 870b59ce1..371513042 100644
index 921e1ec9e..f74e642b8 100644
--- a/src/main/java/net/minecraft/server/PlayerConnection.java
+++ b/src/main/java/net/minecraft/server/PlayerConnection.java
@@ -508,10 +508,10 @@ public class PlayerConnection implements PacketListenerPlayIn, ITickable {
@ -68,10 +68,10 @@ index 870b59ce1..371513042 100644
public void a(PacketPlayInSetCommandBlock packetplayinsetcommandblock) {
diff --git a/src/main/java/org/bukkit/craftbukkit/CraftServer.java b/src/main/java/org/bukkit/craftbukkit/CraftServer.java
index 72da1fe81..07364554a 100644
index b5d0886df..054d3f3dc 100644
--- a/src/main/java/org/bukkit/craftbukkit/CraftServer.java
+++ b/src/main/java/org/bukkit/craftbukkit/CraftServer.java
@@ -1722,7 +1722,7 @@ public final class CraftServer implements Server {
@@ -1721,7 +1721,7 @@ public final class CraftServer implements Server {
offers = tabCompleteChat(player, message);
}

Datei anzeigen

@ -1,4 +1,4 @@
From ebc7081b58b5d456f4bc6346d65e20b3319ac661 Mon Sep 17 00:00:00 2001
From 3f450566e42f24fc2cde31b2926431ec18137028 Mon Sep 17 00:00:00 2001
From: Aikar <aikar@aikar.co>
Date: Tue, 19 Dec 2017 22:02:53 -0500
Subject: [PATCH] PlayerPickupExperienceEvent
@ -6,7 +6,7 @@ Subject: [PATCH] PlayerPickupExperienceEvent
Allows plugins to cancel a player picking up an experience orb
diff --git a/src/main/java/net/minecraft/server/EntityExperienceOrb.java b/src/main/java/net/minecraft/server/EntityExperienceOrb.java
index dfd6230b2..73205b2f7 100644
index 404a222b4..4bcae2c21 100644
--- a/src/main/java/net/minecraft/server/EntityExperienceOrb.java
+++ b/src/main/java/net/minecraft/server/EntityExperienceOrb.java
@@ -218,7 +218,7 @@ public class EntityExperienceOrb extends Entity {
@ -17,7 +17,7 @@ index dfd6230b2..73205b2f7 100644
+ if (this.c == 0 && entityhuman.bJ == 0 && new com.destroystokyo.paper.event.player.PlayerPickupExperienceEvent(((EntityPlayer) entityhuman).getBukkitEntity(), (org.bukkit.entity.ExperienceOrb) this.getBukkitEntity()).callEvent()) { // Paper
entityhuman.bJ = 2;
entityhuman.receive(this, 1);
ItemStack itemstack = EnchantmentManager.b(Enchantments.G, (EntityLiving) entityhuman);
ItemStack itemstack = EnchantmentManager.b(Enchantments.MENDING, (EntityLiving) entityhuman);
--
2.20.0

Datei anzeigen

@ -1,4 +1,4 @@
From e7daf06af73e4ae7aec0982e034bd1ef4d35718f Mon Sep 17 00:00:00 2001
From 057183312e4a71d698e6238a1d15ed5674587de7 Mon Sep 17 00:00:00 2001
From: Aikar <aikar@aikar.co>
Date: Tue, 19 Dec 2017 22:57:26 -0500
Subject: [PATCH] ExperienceOrbMergeEvent
@ -7,16 +7,16 @@ Fired when the server is about to merge 2 experience orbs
Plugins can cancel this if they want to ensure experience orbs do not lose important
metadata such as spawn reason, or conditionally move data from source to target.
diff --git a/src/main/java/net/minecraft/server/World.java b/src/main/java/net/minecraft/server/World.java
index 2ddc3f050..a14518ba6 100644
--- a/src/main/java/net/minecraft/server/World.java
+++ b/src/main/java/net/minecraft/server/World.java
@@ -1042,7 +1042,7 @@ public abstract class World implements IEntityAccess, GeneratorAccess, IIBlockAc
diff --git a/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java b/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java
index 14df8e80b..9578e9d2e 100644
--- a/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java
+++ b/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java
@@ -400,7 +400,7 @@ public class CraftEventFactory {
if (e instanceof EntityExperienceOrb) {
EntityExperienceOrb loopItem = (EntityExperienceOrb) e;
// Paper start
- if (!loopItem.dead && !(maxValue > 0 && loopItem.value >= maxValue)) {
+ if (!loopItem.dead && !(maxValue > 0 && loopItem.value >= maxValue) && new com.destroystokyo.paper.event.entity.ExperienceOrbMergeEvent((org.bukkit.entity.ExperienceOrb) entity.getBukkitEntity(), (org.bukkit.entity.ExperienceOrb) loopItem.getBukkitEntity()).callEvent()) {
+ if (!loopItem.dead && !(maxValue > 0 && loopItem.value >= maxValue) && new com.destroystokyo.paper.event.entity.ExperienceOrbMergeEvent((org.bukkit.entity.ExperienceOrb) entity.getBukkitEntity(), (org.bukkit.entity.ExperienceOrb) loopItem.getBukkitEntity()).callEvent()) { // Paper
long newTotal = (long)xp.value + (long)loopItem.value;
if ((int) newTotal < 0) continue; // Overflow
if (maxValue > 0 && newTotal > (long)maxValue) {

Datei anzeigen

@ -1,4 +1,4 @@
From 362bcce7edac6cda9d4b8f998e760386a1a41ed6 Mon Sep 17 00:00:00 2001
From f4958d9d4612617fd65171cd018b29a9000af5fd Mon Sep 17 00:00:00 2001
From: Aikar <aikar@aikar.co>
Date: Wed, 20 Dec 2017 17:36:49 -0500
Subject: [PATCH] Ability to apply mending to XP API
@ -10,32 +10,19 @@ of giving the player experience points.
Both an API To standalone mend, and apply mending logic to .giveExp has been added.
diff --git a/src/main/java/net/minecraft/server/EnchantmentManager.java b/src/main/java/net/minecraft/server/EnchantmentManager.java
index fd6df39f1..f03aef2fe 100644
index e1ea8da88..f1921e151 100644
--- a/src/main/java/net/minecraft/server/EnchantmentManager.java
+++ b/src/main/java/net/minecraft/server/EnchantmentManager.java
@@ -223,6 +223,7 @@ public class EnchantmentManager {
return getEnchantmentLevel(Enchantments.F, itemstack) > 0;
return getEnchantmentLevel(Enchantments.CHANNELING, itemstack) > 0;
}
+ public static ItemStack getRandomEquippedItemWithEnchant(Enchantment enchantment, EntityLiving entityliving) { return b(enchantment, entityliving); } // Paper - OBFHELPER
public static ItemStack b(Enchantment enchantment, EntityLiving entityliving) {
List<ItemStack> list = enchantment.a(entityliving);// Paper - decompile fix
if (list.isEmpty()) {
diff --git a/src/main/java/net/minecraft/server/Enchantments.java b/src/main/java/net/minecraft/server/Enchantments.java
index 8cfb38b82..44b2d428b 100644
--- a/src/main/java/net/minecraft/server/Enchantments.java
+++ b/src/main/java/net/minecraft/server/Enchantments.java
@@ -35,7 +35,7 @@ public class Enchantments {
public static final Enchantment D = a("impaling");
public static final Enchantment E = a("riptide");
public static final Enchantment F = a("channeling");
- public static final Enchantment G = a("mending");
+ public static final Enchantment G = a("mending");public static final Enchantment MENDING = G; // Paper - OBFHELPER
public static final Enchantment H = a("vanishing_curse");
@Nullable
diff --git a/src/main/java/net/minecraft/server/EntityExperienceOrb.java b/src/main/java/net/minecraft/server/EntityExperienceOrb.java
index 73205b2f7..69d4dc9ab 100644
index 4bcae2c21..09d85764b 100644
--- a/src/main/java/net/minecraft/server/EntityExperienceOrb.java
+++ b/src/main/java/net/minecraft/server/EntityExperienceOrb.java
@@ -246,10 +246,12 @@ public class EntityExperienceOrb extends Entity {

Datei anzeigen

@ -1,4 +1,4 @@
From 7dfa55ecb28018b9084160369d510a4384ed4495 Mon Sep 17 00:00:00 2001
From 4cbdcadcd9ba0fee0c8d637e33a81ef921f4568c Mon Sep 17 00:00:00 2001
From: Aikar <aikar@aikar.co>
Date: Mon, 1 Jan 2018 15:41:59 -0500
Subject: [PATCH] Configurable Chunks Sends per Tick setting
@ -26,10 +26,10 @@ index b6764c7ec..29cb718fb 100644
+ }
}
diff --git a/src/main/java/net/minecraft/server/PlayerChunkMap.java b/src/main/java/net/minecraft/server/PlayerChunkMap.java
index 9d971a9c5..a696be750 100644
index 5935bae58..b1ece38b2 100644
--- a/src/main/java/net/minecraft/server/PlayerChunkMap.java
+++ b/src/main/java/net/minecraft/server/PlayerChunkMap.java
@@ -172,7 +172,7 @@ public class PlayerChunkMap {
@@ -168,7 +168,7 @@ public class PlayerChunkMap {
}
if (!this.g.isEmpty()) {

Datei anzeigen

@ -1,4 +1,4 @@
From f8f4c08e6822205bb69f8318ba136fab257a2f2d Mon Sep 17 00:00:00 2001
From 38f954aac3cbf55ef4c2ab8a91559775e2dcc5c0 Mon Sep 17 00:00:00 2001
From: Aikar <aikar@aikar.co>
Date: Mon, 1 Jan 2018 16:10:24 -0500
Subject: [PATCH] Configurable Max Chunk Gens per Tick
@ -33,30 +33,30 @@ index 29cb718fb..695bdf2e6 100644
+ }
}
diff --git a/src/main/java/net/minecraft/server/PlayerChunk.java b/src/main/java/net/minecraft/server/PlayerChunk.java
index 7cb1327a8..4383abccd 100644
index 5497a458d..db43a8a9a 100644
--- a/src/main/java/net/minecraft/server/PlayerChunk.java
+++ b/src/main/java/net/minecraft/server/PlayerChunk.java
@@ -28,6 +28,7 @@ public class PlayerChunk {
// CraftBukkit start - add fields
// You know the drill, https://hub.spigotmc.org/stash/projects/SPIGOT/repos/craftbukkit/browse
// All may seem good at first, but there's deeper issues if you play for a bit
@@ -19,6 +19,7 @@ public class PlayerChunk {
private int h;
private long i;
private boolean done;
+ boolean chunkExists; // Paper
private boolean loadInProgress = false;
private Runnable loadedRunnable = new Runnable() {
public void run() {
@@ -58,6 +59,7 @@ public class PlayerChunk {
chunkproviderserver.a(i, j);
this.chunk = chunkproviderserver.getChunkAt(i, j, true, false);
+ this.chunkExists = this.chunk != null || ChunkIOExecutor.hasQueuedChunkLoad(playerChunkMap.getWorld(), i, j); // Paper
public PlayerChunk(PlayerChunkMap playerchunkmap, int ix, int j) {
this.playerChunkMap = playerchunkmap;
@@ -26,6 +27,7 @@ public class PlayerChunk {
ChunkProviderServer chunkproviderserver = playerchunkmap.getWorld().getChunkProvider();
chunkproviderserver.a(ix, j);
this.chunk = chunkproviderserver.getChunkAt(ix, j, true, false);
+ this.chunkExists = this.chunk != null || org.bukkit.craftbukkit.chunkio.ChunkIOExecutor.hasQueuedChunkLoad(playerChunkMap.getWorld(), ix, j); // Paper
markChunkUsed(); // Paper - delay chunk unloads
}
diff --git a/src/main/java/net/minecraft/server/PlayerChunkMap.java b/src/main/java/net/minecraft/server/PlayerChunkMap.java
index a696be750..39e5b2484 100644
index b1ece38b2..27343174d 100644
--- a/src/main/java/net/minecraft/server/PlayerChunkMap.java
+++ b/src/main/java/net/minecraft/server/PlayerChunkMap.java
@@ -140,6 +140,7 @@ public class PlayerChunkMap {
@@ -136,6 +136,7 @@ public class PlayerChunkMap {
// Spigot start
org.spigotmc.SlackActivityAccountant activityAccountant = this.world.getMinecraftServer().slackActivityAccountant;
activityAccountant.startActivity(0.5);
@ -64,7 +64,7 @@ index a696be750..39e5b2484 100644
// Spigot end
Iterator iterator1 = this.h.iterator();
@@ -149,6 +150,11 @@ public class PlayerChunkMap {
@@ -145,6 +146,11 @@ public class PlayerChunkMap {
if (playerchunk1.f() == null) {
boolean flag = playerchunk1.a(PlayerChunkMap.b);

Datei anzeigen

@ -1,27 +1,27 @@
From 8e13d0697e68b74c47b0cfd20d0567fc8872a24b Mon Sep 17 00:00:00 2001
From f6be9923bfdf606012746f71fbb32ffb06ddc952 Mon Sep 17 00:00:00 2001
From: Aikar <aikar@aikar.co>
Date: Sat, 10 Mar 2018 16:33:15 -0500
Subject: [PATCH] Prevent Frosted Ice from loading/holding chunks
diff --git a/src/main/java/net/minecraft/server/BlockIceFrost.java b/src/main/java/net/minecraft/server/BlockIceFrost.java
index 7bea86f52..ea3a6f2fb 100644
index 598621fbb..5c5b3a531 100644
--- a/src/main/java/net/minecraft/server/BlockIceFrost.java
+++ b/src/main/java/net/minecraft/server/BlockIceFrost.java
@@ -16,7 +16,8 @@ public class BlockIceFrost extends BlockIce {
try (BlockPosition.b blockposition$b = BlockPosition.b.r()) {
for(EnumDirection enumdirection : EnumDirection.values()) {
blockposition$b.j(blockposition).d(enumdirection);
blockposition$b.g(blockposition).c(enumdirection);
- IBlockData iblockdata1 = world.getType(blockposition$b);
+ IBlockData iblockdata1 = world.getTypeIfLoaded(blockposition$b); // Paper - don't load chunks
+ if (iblockdata1 == null) continue; // Paper
if (iblockdata1.getBlock() == this && !this.c(iblockdata1, world, blockposition$b)) {
world.J().a(blockposition$b, this, MathHelper.nextInt(random, world.paperConfig.frostedIceDelayMin, world.paperConfig.frostedIceDelayMax)); // Paper - use configurable min/max delay
world.getBlockTickList().a(blockposition$b, this, MathHelper.nextInt(random, world.paperConfig.frostedIceDelayMin, world.paperConfig.frostedIceDelayMax)); // Paper - use configurable min/max delay
}
@@ -53,7 +54,7 @@ public class BlockIceFrost extends BlockIce {
try (BlockPosition.b blockposition$b = BlockPosition.b.r()) {
for(EnumDirection enumdirection : EnumDirection.values()) {
blockposition$b.j(blockposition).d(enumdirection);
blockposition$b.g(blockposition).c(enumdirection);
- if (iblockaccess.getType(blockposition$b).getBlock() == this) {
+ if (((World) iblockaccess).getBlockIfLoaded(blockposition$b) == this) { // Paper - don't load chunks
++j;

Datei anzeigen

@ -1,4 +1,4 @@
From b38db1bcd7c796e5a1a6737d4710400d52e0bad6 Mon Sep 17 00:00:00 2001
From 3e4d2f1027bb17badd21e471bbe0f2ad900a24bf Mon Sep 17 00:00:00 2001
From: Minecrell <minecrell@minecrell.net>
Date: Wed, 11 Oct 2017 15:56:26 +0200
Subject: [PATCH] Implement extended PaperServerListPingEvent
@ -177,7 +177,7 @@ index 000000000..26e3031d2
+
+}
diff --git a/src/main/java/net/minecraft/server/MinecraftServer.java b/src/main/java/net/minecraft/server/MinecraftServer.java
index 34ba382a4..c3efb5e1b 100644
index 906bd973d..9b823d4ca 100644
--- a/src/main/java/net/minecraft/server/MinecraftServer.java
+++ b/src/main/java/net/minecraft/server/MinecraftServer.java
@@ -1,6 +1,7 @@
@ -191,25 +191,12 @@ index 34ba382a4..c3efb5e1b 100644
@@ -943,7 +944,7 @@ public abstract class MinecraftServer implements IAsyncTaskHandler, IMojangStati
if (i - this.Y >= 5000000000L) {
this.Y = i;
this.m.setPlayerSample(new ServerPing.ServerPingPlayerSample(this.z(), this.y()));
- GameProfile[] agameprofile = new GameProfile[Math.min(this.y(), 12)];
+ GameProfile[] agameprofile = new GameProfile[Math.min(this.y(), org.spigotmc.SpigotConfig.playerSample)]; // Paper
int j = MathHelper.nextInt(this.n, 0, this.y() - agameprofile.length);
this.m.setPlayerSample(new ServerPing.ServerPingPlayerSample(this.getMaxPlayers(), this.getPlayerCount()));
- GameProfile[] agameprofile = new GameProfile[Math.min(this.getPlayerCount(), 12)];
+ GameProfile[] agameprofile = new GameProfile[Math.min(this.getPlayerCount(), org.spigotmc.SpigotConfig.playerSample)]; // Paper
int j = MathHelper.nextInt(this.n, 0, this.getPlayerCount() - agameprofile.length);
for (int k = 0; k < agameprofile.length; ++k) {
@@ -1300,10 +1301,12 @@ public abstract class MinecraftServer implements IAsyncTaskHandler, IMojangStati
return "1.13.2";
}
+ public int getPlayerCount() { return y(); } // Paper - OBFHELPER
public int y() {
return this.s.getPlayerCount();
}
+ public int getMaxPlayers() { return z(); } // Paper - OBFHELPER
public int z() {
return this.s.getMaxPlayers();
}
diff --git a/src/main/java/net/minecraft/server/PacketStatusListener.java b/src/main/java/net/minecraft/server/PacketStatusListener.java
index c9edd289a..8aa121e2f 100644
--- a/src/main/java/net/minecraft/server/PacketStatusListener.java
@ -234,7 +221,7 @@ index c9edd289a..8aa121e2f 100644
// CraftBukkit end
}
diff --git a/src/main/java/net/minecraft/server/ServerPing.java b/src/main/java/net/minecraft/server/ServerPing.java
index 615aa2cd0..408aad098 100644
index c338d09bf..087f5fe0d 100644
--- a/src/main/java/net/minecraft/server/ServerPing.java
+++ b/src/main/java/net/minecraft/server/ServerPing.java
@@ -29,6 +29,7 @@ public class ServerPing {
@ -245,7 +232,7 @@ index 615aa2cd0..408aad098 100644
public ServerPing.ServerPingPlayerSample b() {
return this.b;
}
@@ -174,10 +175,12 @@ public class ServerPing {
@@ -156,10 +157,12 @@ public class ServerPing {
return this.b;
}

Datei anzeigen

@ -1,4 +1,4 @@
From 46b48a06dd052ec7025966dfe111049bf74710d0 Mon Sep 17 00:00:00 2001
From a1af634f52b58bd1a460581e0281001fef1c06ab Mon Sep 17 00:00:00 2001
From: Aikar <aikar@aikar.co>
Date: Thu, 22 Mar 2018 01:40:24 -0400
Subject: [PATCH] getPlayerUniqueId API
@ -9,10 +9,10 @@ In Offline Mode, will return an Offline UUID
This is a more performant way to obtain a UUID for a name than loading an OfflinePlayer
diff --git a/src/main/java/org/bukkit/craftbukkit/CraftServer.java b/src/main/java/org/bukkit/craftbukkit/CraftServer.java
index 07364554a..71d1929c1 100644
index 054d3f3dc..ec197ef51 100644
--- a/src/main/java/org/bukkit/craftbukkit/CraftServer.java
+++ b/src/main/java/org/bukkit/craftbukkit/CraftServer.java
@@ -1415,6 +1415,26 @@ public final class CraftServer implements Server {
@@ -1414,6 +1414,26 @@ public final class CraftServer implements Server {
return recipients.size();
}

Datei anzeigen

@ -1,4 +1,4 @@
From 5adc07529bf386d144cafa53eb41c66b1c2cea8b Mon Sep 17 00:00:00 2001
From 70c73da3afa8adfbe7458fea7e5e4e41554f7d8c Mon Sep 17 00:00:00 2001
From: Minecrell <minecrell@minecrell.net>
Date: Wed, 11 Oct 2017 18:22:50 +0200
Subject: [PATCH] Make legacy ping handler more reliable
@ -28,21 +28,21 @@ respond to the request.
[2]: https://netty.io/wiki/user-guide-for-4.x.html#wiki-h4-13
diff --git a/src/main/java/net/minecraft/server/LegacyPingHandler.java b/src/main/java/net/minecraft/server/LegacyPingHandler.java
index 5691d0aea..aafca9c9c 100644
index cb2b9c368..976888b66 100644
--- a/src/main/java/net/minecraft/server/LegacyPingHandler.java
+++ b/src/main/java/net/minecraft/server/LegacyPingHandler.java
@@ -13,6 +13,7 @@ import org.apache.logging.log4j.Logger;
public class LegacyPingHandler extends ChannelInboundHandlerAdapter {
@@ -14,6 +14,7 @@ public class LegacyPingHandler extends ChannelInboundHandlerAdapter {
private static final Logger a = LogManager.getLogger();
private final ServerConnection b;
+ private ByteBuf buf; // Paper
public LegacyPingHandler(ServerConnection serverconnection) {
this.b = serverconnection;
@@ -20,6 +21,16 @@ public class LegacyPingHandler extends ChannelInboundHandlerAdapter {
@@ -22,6 +23,16 @@ public class LegacyPingHandler extends ChannelInboundHandlerAdapter {
public void channelRead(ChannelHandlerContext channelhandlercontext, Object object) throws Exception {
ByteBuf bytebuf = (ByteBuf)object;
ByteBuf bytebuf = (ByteBuf) object;
+ // Paper start - Make legacy ping handler more reliable
+ if (this.buf != null) {
+ try {
@ -56,26 +56,26 @@ index 5691d0aea..aafca9c9c 100644
bytebuf.markReaderIndex();
boolean flag = true;
@@ -44,6 +55,10 @@ public class LegacyPingHandler extends ChannelInboundHandlerAdapter {
this.a(channelhandlercontext, this.a(s));
break;
default:
+ // Paper start - Replace with improved version below
+ if (bytebuf.readUnsignedByte() != 0x01 || bytebuf.readUnsignedByte() != 0xFA) return;
+ readLegacy1_6(channelhandlercontext, bytebuf);
+ /*
boolean flag1 = bytebuf.readUnsignedByte() == 1;
flag1 = flag1 & bytebuf.readUnsignedByte() == 250;
flag1 = flag1 & "MC|PingHost".equals(new String(bytebuf.readBytes(bytebuf.readShort() * 2).array(), StandardCharsets.UTF_16BE));
@@ -65,6 +80,7 @@ public class LegacyPingHandler extends ChannelInboundHandlerAdapter {
} finally {
bytebuf1.release();
}
+ */ // Paper end- end commenting out
}
@@ -52,6 +63,10 @@ public class LegacyPingHandler extends ChannelInboundHandlerAdapter {
this.a(channelhandlercontext, this.a(s));
break;
default:
+ // Paper start - Replace with improved version below
+ if (bytebuf.readUnsignedByte() != 0x01 || bytebuf.readUnsignedByte() != 0xFA) return;
+ readLegacy1_6(channelhandlercontext, bytebuf);
+ /*
boolean flag1 = bytebuf.readUnsignedByte() == 1;
bytebuf.release();
@@ -84,6 +100,90 @@ public class LegacyPingHandler extends ChannelInboundHandlerAdapter {
flag1 &= bytebuf.readUnsignedByte() == 250;
@@ -75,6 +90,7 @@ public class LegacyPingHandler extends ChannelInboundHandlerAdapter {
} finally {
bytebuf1.release();
}
+ */ // Paper end - Replace with improved version below
}
bytebuf.release();
@@ -92,6 +108,90 @@ public class LegacyPingHandler extends ChannelInboundHandlerAdapter {
}

Datei anzeigen

@ -1,4 +1,4 @@
From 9a84ca1c9a75d3682f99f6f80938b597eb82b470 Mon Sep 17 00:00:00 2001
From 6dee247ee43798b736446d22975f00d91b2ab921 Mon Sep 17 00:00:00 2001
From: Minecrell <minecrell@minecrell.net>
Date: Wed, 11 Oct 2017 19:30:51 +0200
Subject: [PATCH] Call PaperServerListPingEvent for legacy pings
@ -84,54 +84,56 @@ index 000000000..74c012fd4
+
+}
diff --git a/src/main/java/net/minecraft/server/LegacyPingHandler.java b/src/main/java/net/minecraft/server/LegacyPingHandler.java
index aafca9c9c..860076fc2 100644
index 976888b66..48e7ae2d5 100644
--- a/src/main/java/net/minecraft/server/LegacyPingHandler.java
+++ b/src/main/java/net/minecraft/server/LegacyPingHandler.java
@@ -9,6 +9,7 @@ import java.net.InetSocketAddress;
import java.nio.charset.StandardCharsets;
import org.apache.logging.log4j.LogManager;
import org.apache.logging.log4j.Logger;
+import com.destroystokyo.paper.network.PaperLegacyStatusClient; // Paper
@@ -1,5 +1,7 @@
package net.minecraft.server;
public class LegacyPingHandler extends ChannelInboundHandlerAdapter {
private static final Logger a = LogManager.getLogger();
@@ -39,10 +40,18 @@ public class LegacyPingHandler extends ChannelInboundHandlerAdapter {
InetSocketAddress inetsocketaddress = (InetSocketAddress)channelhandlercontext.channel().remoteAddress();
MinecraftServer minecraftserver = this.b.d();
int i = bytebuf.readableBytes();
+ com.destroystokyo.paper.event.server.PaperServerListPingEvent event; // Paper
switch(i) {
case 0:
a.debug("Ping: (<1.3.x) from {}:{}", inetsocketaddress.getAddress(), inetsocketaddress.getPort());
- String s2 = String.format("%s\u00a7%d\u00a7%d", minecraftserver.getMotd(), minecraftserver.y(), minecraftserver.z());
+ // Paper start - Call PaperServerListPingEvent and use results
+ event = PaperLegacyStatusClient.processRequest(minecraftserver, inetsocketaddress, 39, null);
+ if (event == null) {
+ channelhandlercontext.close();
+ break;
+ }
+ String s2 = String.format("%s\u00a7%d\u00a7%d", PaperLegacyStatusClient.getUnformattedMotd(event), event.getNumPlayers(), event.getMaxPlayers());
+ // Paper end
this.a(channelhandlercontext, this.a(s2));
break;
case 1:
@@ -51,7 +60,14 @@ public class LegacyPingHandler extends ChannelInboundHandlerAdapter {
}
+import com.destroystokyo.paper.network.PaperLegacyStatusClient;
+
import io.netty.buffer.ByteBuf;
import io.netty.buffer.Unpooled;
import io.netty.channel.ChannelFutureListener;
@@ -45,12 +47,19 @@ public class LegacyPingHandler extends ChannelInboundHandlerAdapter {
MinecraftServer minecraftserver = this.b.d();
int i = bytebuf.readableBytes();
String s;
- org.bukkit.event.server.ServerListPingEvent event = org.bukkit.craftbukkit.event.CraftEventFactory.callServerListPingEvent(minecraftserver.server, inetsocketaddress.getAddress(), minecraftserver.getMotd(), minecraftserver.getPlayerCount(), minecraftserver.getMaxPlayers()); // CraftBukkit
+ //org.bukkit.event.server.ServerListPingEvent event = org.bukkit.craftbukkit.event.CraftEventFactory.callServerListPingEvent(minecraftserver.server, inetsocketaddress.getAddress(), minecraftserver.getMotd(), minecraftserver.getPlayerCount(), minecraftserver.getMaxPlayers()); // CraftBukkit // Paper
+ com.destroystokyo.paper.event.server.PaperServerListPingEvent event; // Paper
a.debug("Ping: (1.4-1.5.x) from {}:{}", inetsocketaddress.getAddress(), inetsocketaddress.getPort());
- String s = String.format("\u00a71\u0000%d\u0000%s\u0000%s\u0000%d\u0000%d", 127, minecraftserver.getVersion(), minecraftserver.getMotd(), minecraftserver.y(), minecraftserver.z());
+ // Paper start - Call PaperServerListPingEvent and use results
+ event = PaperLegacyStatusClient.processRequest(minecraftserver, inetsocketaddress, 61, null);
+ if (event == null) {
+ channelhandlercontext.close();
+ break;
+ }
+ String s = String.format("\u00a71\u0000%d\u0000%s\u0000%s\u0000%d\u0000%d", event.getProtocolVersion(), event.getVersion(), PaperLegacyStatusClient.getMotd(event), event.getNumPlayers(), event.getMaxPlayers());
+ // Paper end
this.a(channelhandlercontext, this.a(s));
break;
default:
@@ -161,8 +177,16 @@ public class LegacyPingHandler extends ChannelInboundHandlerAdapter {
switch (i) {
case 0:
LegacyPingHandler.a.debug("Ping: (<1.3.x) from {}:{}", inetsocketaddress.getAddress(), inetsocketaddress.getPort());
- s = String.format("%s\u00a7%d\u00a7%d", new Object[] { event.getMotd(), event.getNumPlayers(), event.getMaxPlayers()}); // CraftBukkit
+ // Paper start - Call PaperServerListPingEvent and use results
+ event = PaperLegacyStatusClient.processRequest(minecraftserver, inetsocketaddress, 39, null);
+ if (event == null) {
+ channelhandlercontext.close();
+ break;
+ }
+ s = String.format("%s\u00a7%d\u00a7%d", PaperLegacyStatusClient.getUnformattedMotd(event), event.getNumPlayers(), event.getMaxPlayers());
this.a(channelhandlercontext, this.a(s));
break;
case 1:
@@ -59,7 +68,14 @@ public class LegacyPingHandler extends ChannelInboundHandlerAdapter {
}
LegacyPingHandler.a.debug("Ping: (1.4-1.5.x) from {}:{}", inetsocketaddress.getAddress(), inetsocketaddress.getPort());
- s = String.format("\u00a71\u0000%d\u0000%s\u0000%s\u0000%d\u0000%d", new Object[] { 127, minecraftserver.getVersion(), event.getMotd(), event.getNumPlayers(), event.getMaxPlayers()}); // CraftBukkit
+ // Paper start - Call PaperServerListPingEvent and use results
+ event = PaperLegacyStatusClient.processRequest(minecraftserver, inetsocketaddress, 127, null); // Paper
+ if (event == null) {
+ channelhandlercontext.close();
+ break;
+ }
+ s = String.format("\u00a71\u0000%d\u0000%s\u0000%s\u0000%d\u0000%d", new Object[] { event.getProtocolVersion(), minecraftserver.getVersion(), event.getMotd(), event.getNumPlayers(), event.getMaxPlayers()}); // CraftBukkit
+ // Paper end
this.a(channelhandlercontext, this.a(s));
break;
default:
@@ -169,8 +185,16 @@ public class LegacyPingHandler extends ChannelInboundHandlerAdapter {
a.debug("Ping: (1.6) from {}", ctx.channel().remoteAddress());
@ -146,7 +148,7 @@ index aafca9c9c..860076fc2 100644
+ }
+
+ String response = String.format("\u00a71\u0000%d\u0000%s\u0000%s\u0000%d\u0000%d", event.getProtocolVersion(), event.getVersion(),
+ PaperLegacyStatusClient.getMotd(event), event.getNumPlayers(), event.getMaxPlayers());
+ PaperLegacyStatusClient.getMotd(event), event.getNumPlayers(), event.getMaxPlayers());
this.a(ctx, this.a(response));
}

Datei anzeigen

@ -1,4 +1,4 @@
From 76953fecb2b9aa243ac7b71bd8a42a804b28e07b Mon Sep 17 00:00:00 2001
From 76463a17eba739e541025e77eeabee94f11eff0a Mon Sep 17 00:00:00 2001
From: Aikar <aikar@aikar.co>
Date: Tue, 15 Aug 2017 22:29:12 -0400
Subject: [PATCH] Expand World.spawnParticle API and add Builder
@ -10,10 +10,10 @@ Adds an option to control the force mode of the particle.
This adds a new Builder API which is much friendlier to use.
diff --git a/src/main/java/net/minecraft/server/WorldServer.java b/src/main/java/net/minecraft/server/WorldServer.java
index b80315bc5..a30d92ce7 100644
index 5f386ff04..55e45dbb1 100644
--- a/src/main/java/net/minecraft/server/WorldServer.java
+++ b/src/main/java/net/minecraft/server/WorldServer.java
@@ -1206,12 +1206,17 @@ public class WorldServer extends World implements IAsyncTaskHandler {
@@ -1207,12 +1207,17 @@ public class WorldServer extends World implements IAsyncTaskHandler {
}
public <T extends ParticleParam> int sendParticles(EntityPlayer sender, T t0, double d0, double d1, double d2, int i, double d3, double d4, double d5, double d6, boolean force) {
@ -34,7 +34,7 @@ index b80315bc5..a30d92ce7 100644
if (this.a(entityplayer, force, d0, d1, d2, packetplayoutworldparticles)) { // CraftBukkit
diff --git a/src/main/java/org/bukkit/craftbukkit/CraftWorld.java b/src/main/java/org/bukkit/craftbukkit/CraftWorld.java
index e1c09452b..84bde3ef2 100644
index 8c4b7aee6..c844c4579 100644
--- a/src/main/java/org/bukkit/craftbukkit/CraftWorld.java
+++ b/src/main/java/org/bukkit/craftbukkit/CraftWorld.java
@@ -1746,11 +1746,17 @@ public class CraftWorld implements World {

Datei anzeigen

@ -1,4 +1,4 @@
From 660e2b2f1862b7cdbc2c98c8a012a979a93edf9f Mon Sep 17 00:00:00 2001
From 89460708a2e3800f898082e23a95f44de51a2995 Mon Sep 17 00:00:00 2001
From: Aikar <aikar@aikar.co>
Date: Sun, 10 Jun 2018 01:18:49 -0400
Subject: [PATCH] Unset Ignited flag on cancel of Explosion Event
@ -6,7 +6,7 @@ Subject: [PATCH] Unset Ignited flag on cancel of Explosion Event
Otherwise the creeper infinite explodes
diff --git a/src/main/java/net/minecraft/server/EntityCreeper.java b/src/main/java/net/minecraft/server/EntityCreeper.java
index 64a5fefad..569248abb 100644
index fb76dc18b..73d9d3b2c 100644
--- a/src/main/java/net/minecraft/server/EntityCreeper.java
+++ b/src/main/java/net/minecraft/server/EntityCreeper.java
@@ -12,7 +12,7 @@ public class EntityCreeper extends EntityMonster {
@ -19,7 +19,7 @@ index 64a5fefad..569248abb 100644
private int fuseTicks;
public int maxFuseTicks = 30;
@@ -205,6 +205,7 @@ public class EntityCreeper extends EntityMonster {
this.dF();
this.createEffectCloud();
} else {
fuseTicks = 0;
+ this.datawatcher.set(isIgnitedDW, Boolean.valueOf(false)); // Paper

Datei anzeigen

@ -1,4 +1,4 @@
From 7ffeeb46285513123a676adfd4f812b5c9282d16 Mon Sep 17 00:00:00 2001
From 50aa3a863c329e3f0fb655a6414d40eb6ed6845f Mon Sep 17 00:00:00 2001
From: Aikar <aikar@aikar.co>
Date: Sun, 10 Jun 2018 20:04:42 -0400
Subject: [PATCH] Properly remove entities on dimension teleport
@ -22,23 +22,23 @@ requirement, but plugins (such as my own) use this method to
trigger a "reload" of the entity on the client.
diff --git a/src/main/java/net/minecraft/server/Entity.java b/src/main/java/net/minecraft/server/Entity.java
index 07a64966e..5600223d9 100644
index 7c558c355..d033969cd 100644
--- a/src/main/java/net/minecraft/server/Entity.java
+++ b/src/main/java/net/minecraft/server/Entity.java
@@ -2595,7 +2595,7 @@ public abstract class Entity implements INamableTileEntity, ICommandListener, Ke
@@ -2594,7 +2594,7 @@ public abstract class Entity implements INamableTileEntity, ICommandListener, Ke
}
// CraftBukkit end */
- this.world.kill(this);
+ this.world.removeEntity(this); // Paper - Fully remove entity, can't have dupes in the UUID map
this.dead = false;
this.world.methodProfiler.a("reposition");
this.world.methodProfiler.enter("reposition");
/* CraftBukkit start - Handled in calculateTarget
diff --git a/src/main/java/net/minecraft/server/WorldServer.java b/src/main/java/net/minecraft/server/WorldServer.java
index a30d92ce7..83109177d 100644
index 55e45dbb1..91850fded 100644
--- a/src/main/java/net/minecraft/server/WorldServer.java
+++ b/src/main/java/net/minecraft/server/WorldServer.java
@@ -1020,6 +1020,7 @@ public class WorldServer extends World implements IAsyncTaskHandler {
@@ -1021,6 +1021,7 @@ public class WorldServer extends World implements IAsyncTaskHandler {
}
protected void c(Entity entity) {

Datei anzeigen

@ -1,4 +1,4 @@
From 405ca5db1a06b1eb62ef401c25629edcba54ac59 Mon Sep 17 00:00:00 2001
From cac46f6bb9e69438928374d87044a6fdf8c38f3d Mon Sep 17 00:00:00 2001
From: Brokkonaut <hannos17@gmx.de>
Date: Sat, 30 Jun 2018 05:45:39 +0200
Subject: [PATCH] Improve ProjectileHitEvent to include the BlockFace where the
@ -6,10 +6,10 @@ Subject: [PATCH] Improve ProjectileHitEvent to include the BlockFace where the
diff --git a/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java b/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java
index 3f17fbd37..dfedd4c30 100644
index 7061075b5..0dd52f859 100644
--- a/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java
+++ b/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java
@@ -921,7 +921,7 @@ public class CraftEventFactory {
@@ -995,7 +995,7 @@ public class CraftEventFactory {
hitBlock = entity.getBukkitEntity().getWorld().getBlockAt(blockposition.getX(), blockposition.getY(), blockposition.getZ());
}

Datei anzeigen

@ -1,4 +1,4 @@
From 1d69bda1bb0ad97f6b6883bf69578383d490c36a Mon Sep 17 00:00:00 2001
From 3ef70ba8a64895af46384d4159caccdf87796247 Mon Sep 17 00:00:00 2001
From: Aikar <aikar@aikar.co>
Date: Tue, 3 Jul 2018 21:56:23 -0400
Subject: [PATCH] InventoryCloseEvent Reason API
@ -7,10 +7,10 @@ Allows you to determine why an inventory was closed, enabling plugin developers
to "confirm" things based on if it was player triggered close or not.
diff --git a/src/main/java/net/minecraft/server/Chunk.java b/src/main/java/net/minecraft/server/Chunk.java
index 9430bccf6..aedf31a07 100644
index 9d3234c1c..9b88a4190 100644
--- a/src/main/java/net/minecraft/server/Chunk.java
+++ b/src/main/java/net/minecraft/server/Chunk.java
@@ -931,7 +931,7 @@ public class Chunk implements IChunkAccess {
@@ -944,7 +944,7 @@ public class Chunk implements IChunkAccess {
{
if ( h instanceof org.bukkit.craftbukkit.entity.CraftHumanEntity )
{
@ -19,7 +19,7 @@ index 9430bccf6..aedf31a07 100644
}
}
}
@@ -956,7 +956,7 @@ public class Chunk implements IChunkAccess {
@@ -969,7 +969,7 @@ public class Chunk implements IChunkAccess {
{
if ( h instanceof org.bukkit.craftbukkit.entity.CraftHumanEntity )
{
@ -29,7 +29,7 @@ index 9430bccf6..aedf31a07 100644
}
}
diff --git a/src/main/java/net/minecraft/server/EntityHuman.java b/src/main/java/net/minecraft/server/EntityHuman.java
index 2bab2ab92..20a46e2af 100644
index 82e85a035..752848323 100644
--- a/src/main/java/net/minecraft/server/EntityHuman.java
+++ b/src/main/java/net/minecraft/server/EntityHuman.java
@@ -161,7 +161,7 @@ public abstract class EntityHuman extends EntityLiving {
@ -56,7 +56,7 @@ index 2bab2ab92..20a46e2af 100644
this.activeContainer = this.defaultContainer;
}
diff --git a/src/main/java/net/minecraft/server/EntityPlayer.java b/src/main/java/net/minecraft/server/EntityPlayer.java
index a615d7867..6933d8876 100644
index 5bd65ddbb..bf842a0a9 100644
--- a/src/main/java/net/minecraft/server/EntityPlayer.java
+++ b/src/main/java/net/minecraft/server/EntityPlayer.java
@@ -347,7 +347,7 @@ public class EntityPlayer extends EntityHuman implements ICrafting {
@ -110,7 +110,7 @@ index a615d7867..6933d8876 100644
this.m();
}
diff --git a/src/main/java/net/minecraft/server/PlayerConnection.java b/src/main/java/net/minecraft/server/PlayerConnection.java
index 871dea68f..30d5c1734 100644
index 159a30e0e..a66f8ab2c 100644
--- a/src/main/java/net/minecraft/server/PlayerConnection.java
+++ b/src/main/java/net/minecraft/server/PlayerConnection.java
@@ -2019,7 +2019,7 @@ public class PlayerConnection implements PacketListenerPlayIn, ITickable {
@ -123,7 +123,7 @@ index 871dea68f..30d5c1734 100644
this.player.m();
}
diff --git a/src/main/java/net/minecraft/server/PlayerList.java b/src/main/java/net/minecraft/server/PlayerList.java
index 64a86b699..e6ee5042c 100644
index 08bbd86d1..6311c9f87 100644
--- a/src/main/java/net/minecraft/server/PlayerList.java
+++ b/src/main/java/net/minecraft/server/PlayerList.java
@@ -423,7 +423,7 @@ public abstract class PlayerList {
@ -168,10 +168,10 @@ index 8699cc72f..0f1d700c7 100644
// Check if the fromWorld and toWorld are the same.
diff --git a/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java b/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java
index dfedd4c30..b220895c2 100644
index 0dd52f859..dcd628104 100644
--- a/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java
+++ b/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java
@@ -1011,8 +1011,19 @@ public class CraftEventFactory {
@@ -1085,8 +1085,19 @@ public class CraftEventFactory {
return event;
}

Datei anzeigen

@ -1,4 +1,4 @@
From 5c0bebf72e955ea07f0ade815cdfbaf6e028e720 Mon Sep 17 00:00:00 2001
From 4e1aa38e484da825d02fb5435097c2516e3ea234 Mon Sep 17 00:00:00 2001
From: Aikar <aikar@aikar.co>
Date: Wed, 4 Jul 2018 03:39:51 -0400
Subject: [PATCH] Avoid Chunk Lookups for Entity/TileEntity Current Chunk
@ -10,22 +10,22 @@ to the object directly on the Entity/TileEntity object we can directly grab.
Use that local value instead to reduce lookups in many hot places.
diff --git a/src/main/java/net/minecraft/server/Chunk.java b/src/main/java/net/minecraft/server/Chunk.java
index aedf31a07..8ff542c88 100644
index 9b88a4190..6c9d7df20 100644
--- a/src/main/java/net/minecraft/server/Chunk.java
+++ b/src/main/java/net/minecraft/server/Chunk.java
@@ -719,6 +719,7 @@ public class Chunk implements IChunkAccess {
@@ -724,6 +724,7 @@ public class Chunk implements IChunkAccess {
((HeightMap) this.heightMap.get(heightmap_type)).a(along);
}
+ public void removeEntity(Entity entity) { b(entity); } // Paper - OBFHELPER
public void b(Entity entity) {
this.a(entity, entity.af);
this.a(entity, entity.chunkY);
}
diff --git a/src/main/java/net/minecraft/server/World.java b/src/main/java/net/minecraft/server/World.java
index a14518ba6..980f373b1 100644
index 0ca1816cb..7711b2eff 100644
--- a/src/main/java/net/minecraft/server/World.java
+++ b/src/main/java/net/minecraft/server/World.java
@@ -1258,12 +1258,15 @@ public abstract class World implements IEntityAccess, GeneratorAccess, IIBlockAc
@@ -1192,12 +1192,15 @@ public abstract class World implements IEntityAccess, GeneratorAccess, IIBlockAc
int j;
// Paper start - Set based removal lists
for (Entity e : this.g) {
@ -42,14 +42,14 @@ index a14518ba6..980f373b1 100644
}
for (Entity e : this.g) {
@@ -1324,12 +1327,17 @@ public abstract class World implements IEntityAccess, GeneratorAccess, IIBlockAc
this.methodProfiler.e();
this.methodProfiler.a("remove");
@@ -1258,12 +1261,17 @@ public abstract class World implements IEntityAccess, GeneratorAccess, IIBlockAc
this.methodProfiler.exit();
this.methodProfiler.enter("remove");
if (entity.dead) {
+ // Paper start
+ /*
j = entity.ae;
int l = entity.ag;
j = entity.chunkX;
int l = entity.chunkZ;
if (entity.inChunk && this.isChunkLoaded(j, l, true)) {
this.getChunkAt(j, l).b(entity);
@ -61,7 +61,7 @@ index a14518ba6..980f373b1 100644
guardEntityList = false; // Spigot
this.entityList.remove(this.tickPosition--); // CraftBukkit - Use field for loop variable
@@ -1374,7 +1382,7 @@ public abstract class World implements IEntityAccess, GeneratorAccess, IIBlockAc
@@ -1308,7 +1316,7 @@ public abstract class World implements IEntityAccess, GeneratorAccess, IIBlockAc
BlockPosition blockposition = tileentity.getPosition();
// Paper start - Skip ticking in chunks scheduled for unload
@ -70,7 +70,7 @@ index a14518ba6..980f373b1 100644
boolean shouldTick = chunk != null;
if(this.paperConfig.skipEntityTickingInChunksScheduledForUnload)
shouldTick = shouldTick && chunk.scheduledForUnload == null;
@@ -1410,8 +1418,11 @@ public abstract class World implements IEntityAccess, GeneratorAccess, IIBlockAc
@@ -1344,8 +1352,11 @@ public abstract class World implements IEntityAccess, GeneratorAccess, IIBlockAc
tilesThisCycle--;
this.tileEntityListTick.remove(tileTickPosition--);
//this.tileEntityList.remove(tileentity); // Paper - remove unused list

Datei anzeigen

@ -1,4 +1,4 @@
From 8c69389cc19ab38e56bd06e965cdd5e2d7a9937c Mon Sep 17 00:00:00 2001
From fe3396599073a4dd6b3f69921d54017523938b5c Mon Sep 17 00:00:00 2001
From: Aikar <aikar@aikar.co>
Date: Thu, 19 Jul 2018 01:08:05 -0400
Subject: [PATCH] Re-add vanilla entity warnings for duplicates
@ -8,10 +8,10 @@ These are a critical sign that somethin went wrong, and you've lost some data...
We should kind of know about these things you know.
diff --git a/src/main/java/net/minecraft/server/WorldServer.java b/src/main/java/net/minecraft/server/WorldServer.java
index 83109177d..a07077397 100644
index 91850fded..45851cd0c 100644
--- a/src/main/java/net/minecraft/server/WorldServer.java
+++ b/src/main/java/net/minecraft/server/WorldServer.java
@@ -986,7 +986,8 @@ public class WorldServer extends World implements IAsyncTaskHandler {
@@ -987,7 +987,8 @@ public class WorldServer extends World implements IAsyncTaskHandler {
this.g.remove(entity1);
} else {
if (!(entity instanceof EntityHuman)) {

Datei anzeigen

@ -1,4 +1,4 @@
From feb89c43a9cc4398764516124c5bb289e15bddb3 Mon Sep 17 00:00:00 2001
From c0d4e8c4a2cdc7120103013c003c1c0e9de279f1 Mon Sep 17 00:00:00 2001
From: Aikar <aikar@aikar.co>
Date: Thu, 19 Jul 2018 01:13:28 -0400
Subject: [PATCH] add more information to Entity.toString()
@ -6,10 +6,10 @@ Subject: [PATCH] add more information to Entity.toString()
UUID, ticks lived, valid, dead
diff --git a/src/main/java/net/minecraft/server/Entity.java b/src/main/java/net/minecraft/server/Entity.java
index 5600223d9..173712659 100644
index d033969cd..9f1610326 100644
--- a/src/main/java/net/minecraft/server/Entity.java
+++ b/src/main/java/net/minecraft/server/Entity.java
@@ -2498,7 +2498,7 @@ public abstract class Entity implements INamableTileEntity, ICommandListener, Ke
@@ -2497,7 +2497,7 @@ public abstract class Entity implements INamableTileEntity, ICommandListener, Ke
}
public String toString() {

Datei anzeigen

@ -1,4 +1,4 @@
From b0f35b7948542c90faf5e855470bc0ac36a49eca Mon Sep 17 00:00:00 2001
From f94015c93adb20a5fc3b30b9b1ca3dcf3064159f Mon Sep 17 00:00:00 2001
From: Aikar <aikar@aikar.co>
Date: Sat, 21 Jul 2018 08:25:40 -0400
Subject: [PATCH] Add Debug Entities option to debug dupe uuid issues
@ -6,7 +6,7 @@ Subject: [PATCH] Add Debug Entities option to debug dupe uuid issues
Add -Ddebug.entities=true to your JVM flags to gain more information
diff --git a/src/main/java/net/minecraft/server/Entity.java b/src/main/java/net/minecraft/server/Entity.java
index 173712659..a402f71a9 100644
index 9f1610326..1581edc4a 100644
--- a/src/main/java/net/minecraft/server/Entity.java
+++ b/src/main/java/net/minecraft/server/Entity.java
@@ -73,6 +73,7 @@ public abstract class Entity implements INamableTileEntity, ICommandListener, Ke
@ -18,7 +18,7 @@ index 173712659..a402f71a9 100644
if (bukkitEntity == null) {
bukkitEntity = CraftEntity.getEntity(world.getServer(), this);
diff --git a/src/main/java/net/minecraft/server/World.java b/src/main/java/net/minecraft/server/World.java
index 980f373b1..29c3a24f2 100644
index 7711b2eff..67ef109a5 100644
--- a/src/main/java/net/minecraft/server/World.java
+++ b/src/main/java/net/minecraft/server/World.java
@@ -115,6 +115,7 @@ public abstract class World implements IEntityAccess, GeneratorAccess, IIBlockAc
@ -30,7 +30,7 @@ index 980f373b1..29c3a24f2 100644
public boolean captureBlockStates = false;
public boolean captureTreeGeneration = false;
diff --git a/src/main/java/net/minecraft/server/WorldServer.java b/src/main/java/net/minecraft/server/WorldServer.java
index a07077397..0bb903aab 100644
index 45851cd0c..f37e85eb0 100644
--- a/src/main/java/net/minecraft/server/WorldServer.java
+++ b/src/main/java/net/minecraft/server/WorldServer.java
@@ -55,6 +55,9 @@ public class WorldServer extends World implements IAsyncTaskHandler {
@ -43,7 +43,7 @@ index a07077397..0bb903aab 100644
// Add env and gen to constructor
public WorldServer(MinecraftServer minecraftserver, IDataManager idatamanager, PersistentCollection persistentcollection, WorldData worlddata, DimensionManager dimensionmanager, MethodProfiler methodprofiler, org.bukkit.World.Environment env, org.bukkit.generator.ChunkGenerator gen) {
@@ -974,7 +977,12 @@ public class WorldServer extends World implements IAsyncTaskHandler {
@@ -975,7 +978,12 @@ public class WorldServer extends World implements IAsyncTaskHandler {
private boolean j(Entity entity) {
if (entity.dead) {
@ -57,7 +57,7 @@ index a07077397..0bb903aab 100644
return false;
} else {
UUID uuid = entity.getUniqueID();
@@ -986,8 +994,15 @@ public class WorldServer extends World implements IAsyncTaskHandler {
@@ -987,8 +995,15 @@ public class WorldServer extends World implements IAsyncTaskHandler {
this.g.remove(entity1);
} else {
if (!(entity instanceof EntityHuman)) {
@ -75,7 +75,7 @@ index a07077397..0bb903aab 100644
return false;
}
@@ -1004,7 +1019,25 @@ public class WorldServer extends World implements IAsyncTaskHandler {
@@ -1005,7 +1020,25 @@ public class WorldServer extends World implements IAsyncTaskHandler {
protected void b(Entity entity) {
super.b(entity);
this.entitiesById.a(entity.getId(), entity);

Datei anzeigen

@ -1,4 +1,4 @@
From 04c998bf22d871ead237bc6be5e12cd676965219 Mon Sep 17 00:00:00 2001
From 3d3653b83b8c5299747f3636891adf061080ac5e Mon Sep 17 00:00:00 2001
From: Aikar <aikar@aikar.co>
Date: Sat, 21 Jul 2018 14:27:34 -0400
Subject: [PATCH] Duplicate UUID Resolve Option
@ -81,7 +81,7 @@ index 92acfa6fb..05509e4fd 100644
+ }
}
diff --git a/src/main/java/net/minecraft/server/Chunk.java b/src/main/java/net/minecraft/server/Chunk.java
index 8ff542c88..bb76f56da 100644
index 6c9d7df20..55cb7b88e 100644
--- a/src/main/java/net/minecraft/server/Chunk.java
+++ b/src/main/java/net/minecraft/server/Chunk.java
@@ -1,5 +1,10 @@
@ -95,7 +95,7 @@ index 8ff542c88..bb76f56da 100644
import com.destroystokyo.paper.exception.ServerInternalException;
import com.google.common.collect.Maps;
import com.google.common.collect.Queues;
@@ -37,6 +42,7 @@ public class Chunk implements IChunkAccess {
@@ -42,6 +47,7 @@ public class Chunk implements IChunkAccess {
public final World world;
public final Map<HeightMap.Type, HeightMap> heightMap;
public Long scheduledForUnload; // Paper - delay chunk unloads
@ -103,7 +103,7 @@ index 8ff542c88..bb76f56da 100644
public final int locX;
public final int locZ;
private boolean l;
@@ -687,6 +693,7 @@ public class Chunk implements IChunkAccess {
@@ -692,6 +698,7 @@ public class Chunk implements IChunkAccess {
if (i != this.locX || j != this.locZ) {
Chunk.d.warn("Wrong location! ({}, {}) should be ({}, {}), {}", i, j, this.locX, this.locZ, entity);
entity.die();
@ -111,10 +111,10 @@ index 8ff542c88..bb76f56da 100644
}
int k = MathHelper.floor(entity.locY / 16.0D);
@@ -875,6 +882,50 @@ public class Chunk implements IChunkAccess {
@@ -881,6 +888,50 @@ public class Chunk implements IChunkAccess {
for (int j = 0; j < i; ++j) {
List entityslice = aentityslice[j]; // Spigot
// CraftBukkit start
List<Entity> entityslice = aentityslice[j]; // Spigot
+ // Paper start
+ DuplicateUUIDMode mode = world.paperConfig.duplicateUUIDMode;
+ if (mode == DuplicateUUIDMode.WARN || mode == DuplicateUUIDMode.DELETE || mode == DuplicateUUIDMode.SAFE_REGEN) {
@ -160,13 +160,13 @@ index 8ff542c88..bb76f56da 100644
+ }
+ // Paper end
List<Entity> toRemove = new LinkedList<>();
this.world.a(entityslice.stream().filter((entity) -> {
return !(entity instanceof EntityHuman);
diff --git a/src/main/java/net/minecraft/server/Entity.java b/src/main/java/net/minecraft/server/Entity.java
index a402f71a9..6c427e9aa 100644
index 1581edc4a..07cd5aa28 100644
--- a/src/main/java/net/minecraft/server/Entity.java
+++ b/src/main/java/net/minecraft/server/Entity.java
@@ -2723,6 +2723,7 @@ public abstract class Entity implements INamableTileEntity, ICommandListener, Ke
@@ -2722,6 +2722,7 @@ public abstract class Entity implements INamableTileEntity, ICommandListener, Ke
});
}
@ -175,7 +175,7 @@ index a402f71a9..6c427e9aa 100644
this.uniqueID = uuid;
this.au = this.uniqueID.toString();
diff --git a/src/main/java/net/minecraft/server/World.java b/src/main/java/net/minecraft/server/World.java
index 29c3a24f2..5557e9409 100644
index 67ef109a5..66d2026d0 100644
--- a/src/main/java/net/minecraft/server/World.java
+++ b/src/main/java/net/minecraft/server/World.java
@@ -75,7 +75,7 @@ public abstract class World implements IEntityAccess, GeneratorAccess, IIBlockAc
@ -188,7 +188,7 @@ index 29c3a24f2..5557e9409 100644
public final List<TileEntity> tileEntityListTick = Lists.newArrayList();
private final List<TileEntity> c = Lists.newArrayList();
diff --git a/src/main/java/net/minecraft/server/WorldServer.java b/src/main/java/net/minecraft/server/WorldServer.java
index 0bb903aab..572c54c9c 100644
index f37e85eb0..af9cdd9dc 100644
--- a/src/main/java/net/minecraft/server/WorldServer.java
+++ b/src/main/java/net/minecraft/server/WorldServer.java
@@ -41,7 +41,7 @@ public class WorldServer extends World implements IAsyncTaskHandler {
@ -200,7 +200,7 @@ index 0bb903aab..572c54c9c 100644
public boolean savingDisabled;
private boolean J;
private int emptyTime;
@@ -994,7 +994,7 @@ public class WorldServer extends World implements IAsyncTaskHandler {
@@ -995,7 +995,7 @@ public class WorldServer extends World implements IAsyncTaskHandler {
this.g.remove(entity1);
} else {
if (!(entity instanceof EntityHuman)) {
@ -209,7 +209,7 @@ index 0bb903aab..572c54c9c 100644
WorldServer.a.error("Keeping entity {} that already exists with UUID {}", entity1, uuid.toString()); // CraftBukkit // Paper
WorldServer.a.error("Deleting duplicate entity {}", entity); // Paper
@@ -1025,7 +1025,7 @@ public class WorldServer extends World implements IAsyncTaskHandler {
@@ -1026,7 +1026,7 @@ public class WorldServer extends World implements IAsyncTaskHandler {
}
Entity old = this.entitiesByUUID.put(entity.getUniqueID(), entity);

Datei anzeigen

@ -1,4 +1,4 @@
From 06bd33e6e6962babee025681cf18fbf3b17b52f0 Mon Sep 17 00:00:00 2001
From c7b1bc2d0b88a3154270b0502c355c2cf10a15a3 Mon Sep 17 00:00:00 2001
From: Techcable <Techcable@outlook.com>
Date: Wed, 30 Nov 2016 20:56:58 -0600
Subject: [PATCH] Speedup BlockPos by fixing inlining
@ -21,7 +21,7 @@ This is based upon conclusions drawn from inspecting the assenmbly generated byt
They had 'callq' (invoke) instead of 'mov' (get from memory) instructions.
diff --git a/src/main/java/net/minecraft/server/BaseBlockPosition.java b/src/main/java/net/minecraft/server/BaseBlockPosition.java
index 680764b34..25334377a 100644
index 339e2da6b..8dbb4864e 100644
--- a/src/main/java/net/minecraft/server/BaseBlockPosition.java
+++ b/src/main/java/net/minecraft/server/BaseBlockPosition.java
@@ -6,22 +6,22 @@ import javax.annotation.concurrent.Immutable;
@ -80,10 +80,10 @@ index 680764b34..25334377a 100644
public BaseBlockPosition d(BaseBlockPosition baseblockposition1) {
return new BaseBlockPosition(this.getY() * baseblockposition1.getZ() - this.getZ() * baseblockposition1.getY(), this.getZ() * baseblockposition1.getX() - this.getX() * baseblockposition1.getZ(), this.getX() * baseblockposition1.getY() - this.getY() * baseblockposition1.getX());
diff --git a/src/main/java/net/minecraft/server/BlockPosition.java b/src/main/java/net/minecraft/server/BlockPosition.java
index 7bd51b357..9ce3cd9c9 100644
index e980e31fc..ae162f615 100644
--- a/src/main/java/net/minecraft/server/BlockPosition.java
+++ b/src/main/java/net/minecraft/server/BlockPosition.java
@@ -205,18 +205,20 @@ public class BlockPosition extends BaseBlockPosition {
@@ -201,18 +201,20 @@ public class BlockPosition extends BaseBlockPosition {
if (this.g == null) {
this.g = new BlockPosition.MutableBlockPosition(ix, jx, kx);
return this.g;
@ -114,8 +114,8 @@ index 7bd51b357..9ce3cd9c9 100644
}
return this.g;
@@ -237,10 +239,12 @@ public class BlockPosition extends BaseBlockPosition {
}
@@ -225,10 +227,12 @@ public class BlockPosition extends BaseBlockPosition {
public static class MutableBlockPosition extends BlockPosition {
+ // Paper start - comment out
@ -128,7 +128,7 @@ index 7bd51b357..9ce3cd9c9 100644
@Override
public boolean isValidLocation() {
return b >= -30000000 && d >= -30000000 && b < 30000000 && d < 30000000 && c >= 0 && c < 256;
@@ -249,6 +253,7 @@ public class BlockPosition extends BaseBlockPosition {
@@ -237,6 +241,7 @@ public class BlockPosition extends BaseBlockPosition {
public boolean isInvalidYLocation() {
return c < 0 || c >= 256;
}
@ -136,7 +136,7 @@ index 7bd51b357..9ce3cd9c9 100644
// Paper end
public MutableBlockPosition() {
@@ -260,10 +265,13 @@ public class BlockPosition extends BaseBlockPosition {
@@ -248,10 +253,13 @@ public class BlockPosition extends BaseBlockPosition {
}
public MutableBlockPosition(int i, int j, int k) {
@ -152,7 +152,7 @@ index 7bd51b357..9ce3cd9c9 100644
}
public BlockPosition a(double d0, double d1, double d2) {
@@ -282,6 +290,8 @@ public class BlockPosition extends BaseBlockPosition {
@@ -270,6 +278,8 @@ public class BlockPosition extends BaseBlockPosition {
return super.a(enumblockrotation).h();
}
@ -161,7 +161,7 @@ index 7bd51b357..9ce3cd9c9 100644
public int getX() {
return this.b;
}
@@ -292,13 +302,16 @@ public class BlockPosition extends BaseBlockPosition {
@@ -280,13 +290,16 @@ public class BlockPosition extends BaseBlockPosition {
public int getZ() {
return this.d;
@ -182,7 +182,7 @@ index 7bd51b357..9ce3cd9c9 100644
return this;
}
@@ -316,15 +329,15 @@ public class BlockPosition extends BaseBlockPosition {
@@ -304,15 +317,15 @@ public class BlockPosition extends BaseBlockPosition {
}
public BlockPosition.MutableBlockPosition c(EnumDirection enumdirection, int i) {

Datei anzeigen

@ -1,4 +1,4 @@
From 741f77317ff07a0e73ecfc5474f9c4f75c0e3b59 Mon Sep 17 00:00:00 2001
From 0e020af7c41d390ecfeef912bca874a9384f938f Mon Sep 17 00:00:00 2001
From: Hugo Manrique <hugmanrique@gmail.com>
Date: Mon, 23 Jul 2018 12:57:39 +0200
Subject: [PATCH] Option to prevent armor stands from doing entity lookups
@ -21,10 +21,10 @@ index 05509e4fd..4059c7a72 100644
private void maxEntityCollision() {
maxCollisionsPerEntity = getInt( "max-entity-collisions", this.spigotConfig.getInt("max-entity-collisions", 8) );
diff --git a/src/main/java/net/minecraft/server/World.java b/src/main/java/net/minecraft/server/World.java
index 5557e9409..7f23a8e2e 100644
index 66d2026d0..858cc1b97 100644
--- a/src/main/java/net/minecraft/server/World.java
+++ b/src/main/java/net/minecraft/server/World.java
@@ -1613,6 +1613,14 @@ public abstract class World implements IEntityAccess, GeneratorAccess, IIBlockAc
@@ -1547,6 +1547,14 @@ public abstract class World implements IEntityAccess, GeneratorAccess, IIBlockAc
}
}

Datei anzeigen

@ -1,11 +1,11 @@
From be9b89578e5f5dac27f077804e41ee406100c1e4 Mon Sep 17 00:00:00 2001
From e5678439f8c0fd79df801804cf2caafe0bd58575 Mon Sep 17 00:00:00 2001
From: Hugo Manrique <hugmanrique@gmail.com>
Date: Mon, 23 Jul 2018 14:22:26 +0200
Subject: [PATCH] Vanished players don't have rights
diff --git a/src/main/java/net/minecraft/server/Entity.java b/src/main/java/net/minecraft/server/Entity.java
index 6c427e9aa..f13fa7fff 100644
index 07cd5aa28..fe0590dea 100644
--- a/src/main/java/net/minecraft/server/Entity.java
+++ b/src/main/java/net/minecraft/server/Entity.java
@@ -94,7 +94,7 @@ public abstract class Entity implements INamableTileEntity, ICommandListener, Ke
@ -44,10 +44,10 @@ index c6ec1a782..6c61718b2 100644
if (this.isEmpty()) {
throw new UnsupportedOperationException("No bounds for empty shape.");
diff --git a/src/main/java/net/minecraft/server/World.java b/src/main/java/net/minecraft/server/World.java
index 7f23a8e2e..811311e9e 100644
index 858cc1b97..78e85aacf 100644
--- a/src/main/java/net/minecraft/server/World.java
+++ b/src/main/java/net/minecraft/server/World.java
@@ -1595,6 +1595,37 @@ public abstract class World implements IEntityAccess, GeneratorAccess, IIBlockAc
@@ -1529,6 +1529,37 @@ public abstract class World implements IEntityAccess, GeneratorAccess, IIBlockAc
}
}
@ -86,10 +86,10 @@ index 7f23a8e2e..811311e9e 100644
if (voxelshape.isEmpty()) {
return true;
diff --git a/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java b/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java
index b220895c2..672c32858 100644
index dcd628104..41b05f231 100644
--- a/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java
+++ b/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java
@@ -902,6 +902,14 @@ public class CraftEventFactory {
@@ -976,6 +976,14 @@ public class CraftEventFactory {
Projectile projectile = (Projectile) entity.getBukkitEntity();
org.bukkit.entity.Entity collided = position.entity.getBukkitEntity();
com.destroystokyo.paper.event.entity.ProjectileCollideEvent event = new com.destroystokyo.paper.event.entity.ProjectileCollideEvent(projectile, collided);

Einige Dateien werden nicht angezeigt, da zu viele Dateien in diesem Diff geändert wurden Mehr anzeigen