diff --git a/Spigot-Server-Patches/0218-Option-for-maximum-exp-value-when-merging-orbs.patch b/Spigot-Server-Patches/0218-Option-for-maximum-exp-value-when-merging-orbs.patch index 80c97883c..1d1cb2816 100644 --- a/Spigot-Server-Patches/0218-Option-for-maximum-exp-value-when-merging-orbs.patch +++ b/Spigot-Server-Patches/0218-Option-for-maximum-exp-value-when-merging-orbs.patch @@ -1,4 +1,4 @@ -From 74c77acc857f97071521e3aa54a850b09074e6a0 Mon Sep 17 00:00:00 2001 +From 519a8bbe176159ac61beec2e7c5e11073bd42186 Mon Sep 17 00:00:00 2001 From: BillyGalbreath Date: Fri, 10 Nov 2017 23:03:12 -0500 Subject: [PATCH] Option for maximum exp value when merging orbs @@ -20,10 +20,10 @@ index 23cb3feef0..1c642e6364 100644 + } } diff --git a/src/main/java/net/minecraft/server/World.java b/src/main/java/net/minecraft/server/World.java -index ed21614e0b..0e7fa6a0f2 100644 +index ed21614e0b..5a7a2443c4 100644 --- a/src/main/java/net/minecraft/server/World.java +++ b/src/main/java/net/minecraft/server/World.java -@@ -1005,16 +1005,31 @@ public abstract class World implements GeneratorAccess, IIBlockAccess, AutoClose +@@ -1005,16 +1005,32 @@ public abstract class World implements GeneratorAccess, IIBlockAccess, AutoClose EntityExperienceOrb xp = (EntityExperienceOrb) entity; double radius = spigotConfig.expMerge; if (radius > 0) { @@ -42,8 +42,9 @@ index ed21614e0b..0e7fa6a0f2 100644 + // Paper start + if (!loopItem.dead && !(maxValue > 0 && loopItem.value >= maxValue)) { + long newTotal = (long)xp.value + (long)loopItem.value; -+ if (newTotal > (long)maxValue) { -+ loopItem.value = xp.value - maxValue; ++ if ((int) newTotal < 0) continue; // Overflow ++ if (maxValue > 0 && newTotal > (long)maxValue) { ++ loopItem.value = (int) (newTotal - maxValue); + xp.value = maxValue; + } else { + xp.value += loopItem.value; diff --git a/Spigot-Server-Patches/0226-ExperienceOrbMergeEvent.patch b/Spigot-Server-Patches/0226-ExperienceOrbMergeEvent.patch index 18640092c..c2ac48451 100644 --- a/Spigot-Server-Patches/0226-ExperienceOrbMergeEvent.patch +++ b/Spigot-Server-Patches/0226-ExperienceOrbMergeEvent.patch @@ -1,4 +1,4 @@ -From a52f0dc0ac68a35e4ba71589eeab5fe3e1e06e84 Mon Sep 17 00:00:00 2001 +From 6a546a82b514bd47a5c58f2f211ff2730217d0c1 Mon Sep 17 00:00:00 2001 From: Aikar Date: Tue, 19 Dec 2017 22:57:26 -0500 Subject: [PATCH] ExperienceOrbMergeEvent @@ -8,7 +8,7 @@ Plugins can cancel this if they want to ensure experience orbs do not lose impor 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 d40725b17a..0f56969270 100644 +index 4c42dad5f6..3569e209c2 100644 --- a/src/main/java/net/minecraft/server/World.java +++ b/src/main/java/net/minecraft/server/World.java @@ -1015,7 +1015,7 @@ public abstract class World implements GeneratorAccess, IIBlockAccess, AutoClose @@ -18,8 +18,8 @@ index d40725b17a..0f56969270 100644 - 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()) { long newTotal = (long)xp.value + (long)loopItem.value; - if (newTotal > (long)maxValue) { - loopItem.value = xp.value - maxValue; + if ((int) newTotal < 0) continue; // Overflow + if (maxValue > 0 && newTotal > (long)maxValue) { -- 2.18.0 diff --git a/Spigot-Server-Patches/0289-Avoid-Chunk-Lookups-for-Entity-TileEntity-Current-Ch.patch b/Spigot-Server-Patches/0289-Avoid-Chunk-Lookups-for-Entity-TileEntity-Current-Ch.patch index 70f778c53..f7e47530e 100644 --- a/Spigot-Server-Patches/0289-Avoid-Chunk-Lookups-for-Entity-TileEntity-Current-Ch.patch +++ b/Spigot-Server-Patches/0289-Avoid-Chunk-Lookups-for-Entity-TileEntity-Current-Ch.patch @@ -1,4 +1,4 @@ -From 5141b8c2ab3839058f95e6bbc02d06eb04d48a54 Mon Sep 17 00:00:00 2001 +From f6f856f0baa6e8abef1664fc3b32767c01ba8b08 Mon Sep 17 00:00:00 2001 From: Aikar Date: Wed, 4 Jul 2018 03:39:51 -0400 Subject: [PATCH] Avoid Chunk Lookups for Entity/TileEntity Current Chunk @@ -22,10 +22,10 @@ index d2e87693fa..1997cbdc65 100644 this.a(entity, entity.af); } diff --git a/src/main/java/net/minecraft/server/World.java b/src/main/java/net/minecraft/server/World.java -index 0f56969270..29678af2de 100644 +index 3569e209c2..a8b317cee3 100644 --- a/src/main/java/net/minecraft/server/World.java +++ b/src/main/java/net/minecraft/server/World.java -@@ -1220,12 +1220,15 @@ public abstract class World implements GeneratorAccess, IIBlockAccess, AutoClose +@@ -1221,12 +1221,15 @@ public abstract class World implements GeneratorAccess, IIBlockAccess, AutoClose int j; // Paper start - Set based removal lists for (Entity e : this.g) { @@ -42,7 +42,7 @@ index 0f56969270..29678af2de 100644 } for (Entity e : this.g) { -@@ -1286,12 +1289,17 @@ public abstract class World implements GeneratorAccess, IIBlockAccess, AutoClose +@@ -1287,12 +1290,17 @@ public abstract class World implements GeneratorAccess, IIBlockAccess, AutoClose this.methodProfiler.e(); this.methodProfiler.a("remove"); if (entity.dead) { @@ -61,7 +61,7 @@ index 0f56969270..29678af2de 100644 guardEntityList = false; // Spigot this.entityList.remove(this.tickPosition--); // CraftBukkit - Use field for loop variable -@@ -1336,7 +1344,7 @@ public abstract class World implements GeneratorAccess, IIBlockAccess, AutoClose +@@ -1337,7 +1345,7 @@ public abstract class World implements GeneratorAccess, IIBlockAccess, AutoClose BlockPosition blockposition = tileentity.getPosition(); // Paper start - Skip ticking in chunks scheduled for unload @@ -70,7 +70,7 @@ index 0f56969270..29678af2de 100644 boolean shouldTick = chunk != null; if(this.paperConfig.skipEntityTickingInChunksScheduledForUnload) shouldTick = shouldTick && !chunk.isUnloading() && chunk.scheduledForUnload == null; -@@ -1372,8 +1380,11 @@ public abstract class World implements GeneratorAccess, IIBlockAccess, AutoClose +@@ -1373,8 +1381,11 @@ public abstract class World implements GeneratorAccess, IIBlockAccess, AutoClose tilesThisCycle--; this.tileEntityListTick.remove(tileTickPosition--); //this.tileEntityList.remove(tileentity); // Paper - remove unused list diff --git a/Spigot-Server-Patches/0308-Option-to-prevent-armor-stands-from-doing-entity-loo.patch b/Spigot-Server-Patches/0308-Option-to-prevent-armor-stands-from-doing-entity-loo.patch index 87683d957..f1e95633e 100644 --- a/Spigot-Server-Patches/0308-Option-to-prevent-armor-stands-from-doing-entity-loo.patch +++ b/Spigot-Server-Patches/0308-Option-to-prevent-armor-stands-from-doing-entity-loo.patch @@ -1,11 +1,11 @@ -From 25962f106f179d9d346451ce9c64d7279a590e06 Mon Sep 17 00:00:00 2001 +From bbffbcb0c9638847a91349590dcd2abcc2e2ed02 Mon Sep 17 00:00:00 2001 From: Hugo Manrique Date: Mon, 23 Jul 2018 12:57:39 +0200 Subject: [PATCH] Option to prevent armor stands from doing entity lookups diff --git a/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java b/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java -index 5b14973810..77fda4051e 100644 +index 4a135d84db..e9b024ad65 100644 --- a/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java +++ b/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java @@ -350,6 +350,11 @@ public class PaperWorldConfig { @@ -21,7 +21,7 @@ index 5b14973810..77fda4051e 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 0de1847639..6f063dc935 100644 +index d5ec209feb..6ed5cbb096 100644 --- a/src/main/java/net/minecraft/server/World.java +++ b/src/main/java/net/minecraft/server/World.java @@ -11,6 +11,7 @@ import java.util.Iterator; @@ -32,7 +32,7 @@ index 0de1847639..6f063dc935 100644 import java.util.function.Function; import java.util.function.Predicate; import java.util.function.Supplier; -@@ -1574,6 +1575,14 @@ public abstract class World implements GeneratorAccess, IIBlockAccess, AutoClose +@@ -1575,6 +1576,14 @@ public abstract class World implements GeneratorAccess, IIBlockAccess, AutoClose } } diff --git a/Spigot-Server-Patches/0309-Vanished-players-don-t-have-rights.patch b/Spigot-Server-Patches/0309-Vanished-players-don-t-have-rights.patch index 67615bd01..9a10c49c0 100644 --- a/Spigot-Server-Patches/0309-Vanished-players-don-t-have-rights.patch +++ b/Spigot-Server-Patches/0309-Vanished-players-don-t-have-rights.patch @@ -1,4 +1,4 @@ -From aebc84bf99be4cd7ae93c2943ddd77d4766a6c7f Mon Sep 17 00:00:00 2001 +From 4a4c12137482311b3bef9e78fa3a43a3a5f4c74d Mon Sep 17 00:00:00 2001 From: Hugo Manrique Date: Mon, 23 Jul 2018 14:22:26 +0200 Subject: [PATCH] Vanished players don't have rights @@ -64,10 +64,10 @@ index 53c9f21887..71e4084320 100644 return this.a.a(); } diff --git a/src/main/java/net/minecraft/server/World.java b/src/main/java/net/minecraft/server/World.java -index 6f063dc935..94a4bf3c7a 100644 +index 6ed5cbb096..3c9d9f1ab0 100644 --- a/src/main/java/net/minecraft/server/World.java +++ b/src/main/java/net/minecraft/server/World.java -@@ -1557,6 +1557,37 @@ public abstract class World implements GeneratorAccess, IIBlockAccess, AutoClose +@@ -1558,6 +1558,37 @@ public abstract class World implements GeneratorAccess, IIBlockAccess, AutoClose } } diff --git a/Spigot-Server-Patches/0316-Prevent-Saving-Bad-entities-to-chunks.patch b/Spigot-Server-Patches/0316-Prevent-Saving-Bad-entities-to-chunks.patch index cbb9d5886..b4172f9e0 100644 --- a/Spigot-Server-Patches/0316-Prevent-Saving-Bad-entities-to-chunks.patch +++ b/Spigot-Server-Patches/0316-Prevent-Saving-Bad-entities-to-chunks.patch @@ -1,4 +1,4 @@ -From b8d0747c9e80896a7ecfe94b4cb3d1601229e5f0 Mon Sep 17 00:00:00 2001 +From 1c7a3f36379778527ce9725cbeb9f5cab5e1475f Mon Sep 17 00:00:00 2001 From: Aikar Date: Thu, 26 Jul 2018 00:11:12 -0400 Subject: [PATCH] Prevent Saving Bad entities to chunks @@ -57,10 +57,10 @@ index a97e024ec4..bd52bf6561 100644 nbttagcompound.set("Entities", nbttaglist1); NBTTagList nbttaglist2 = new NBTTagList(); diff --git a/src/main/java/net/minecraft/server/World.java b/src/main/java/net/minecraft/server/World.java -index 94a4bf3c7a..eb56940a18 100644 +index 3c9d9f1ab0..0f2dadfa39 100644 --- a/src/main/java/net/minecraft/server/World.java +++ b/src/main/java/net/minecraft/server/World.java -@@ -1065,7 +1065,7 @@ public abstract class World implements GeneratorAccess, IIBlockAccess, AutoClose +@@ -1066,7 +1066,7 @@ public abstract class World implements GeneratorAccess, IIBlockAccess, AutoClose } this.getChunkAt(i, j).a(entity); diff --git a/Spigot-Server-Patches/0318-Always-process-chunk-removal-in-removeEntity.patch b/Spigot-Server-Patches/0318-Always-process-chunk-removal-in-removeEntity.patch index 5dba559c6..91c868508 100644 --- a/Spigot-Server-Patches/0318-Always-process-chunk-removal-in-removeEntity.patch +++ b/Spigot-Server-Patches/0318-Always-process-chunk-removal-in-removeEntity.patch @@ -1,4 +1,4 @@ -From 41011bfa8744eec1ba2c81054d8e20cb2cf73e82 Mon Sep 17 00:00:00 2001 +From 9cdc39234556fddc6c3fcb347f2ffd44ee7719b5 Mon Sep 17 00:00:00 2001 From: Aikar Date: Sat, 28 Jul 2018 12:09:20 -0400 Subject: [PATCH] Always process chunk removal in removeEntity @@ -8,10 +8,10 @@ which can keep them in the chunk when they shouldnt be if done during entity ticking. diff --git a/src/main/java/net/minecraft/server/World.java b/src/main/java/net/minecraft/server/World.java -index eb56940a18..7f999cbd5b 100644 +index 0f2dadfa39..f6531d4fea 100644 --- a/src/main/java/net/minecraft/server/World.java +++ b/src/main/java/net/minecraft/server/World.java -@@ -1135,7 +1135,7 @@ public abstract class World implements GeneratorAccess, IIBlockAccess, AutoClose +@@ -1136,7 +1136,7 @@ public abstract class World implements GeneratorAccess, IIBlockAccess, AutoClose this.everyoneSleeping(); } @@ -20,7 +20,7 @@ index eb56940a18..7f999cbd5b 100644 int i = entity.ae; int j = entity.ag; -@@ -1143,6 +1143,7 @@ public abstract class World implements GeneratorAccess, IIBlockAccess, AutoClose +@@ -1144,6 +1144,7 @@ public abstract class World implements GeneratorAccess, IIBlockAccess, AutoClose this.getChunkAt(i, j).b(entity); } diff --git a/Spigot-Server-Patches/0319-Ignore-Dead-Entities-in-entityList-iteration.patch b/Spigot-Server-Patches/0319-Ignore-Dead-Entities-in-entityList-iteration.patch index 027b81658..9986944d2 100644 --- a/Spigot-Server-Patches/0319-Ignore-Dead-Entities-in-entityList-iteration.patch +++ b/Spigot-Server-Patches/0319-Ignore-Dead-Entities-in-entityList-iteration.patch @@ -1,4 +1,4 @@ -From e22b56e894628cbeb7e529a3f81e4e56c45329ab Mon Sep 17 00:00:00 2001 +From 6a6de194fc8ecd5e1b3a764440d9394100ae96dd Mon Sep 17 00:00:00 2001 From: Aikar Date: Sat, 28 Jul 2018 12:18:27 -0400 Subject: [PATCH] Ignore Dead Entities in entityList iteration @@ -35,10 +35,10 @@ index 785c31089e..6b0ca4eb98 100644 public float length; public float J; diff --git a/src/main/java/net/minecraft/server/World.java b/src/main/java/net/minecraft/server/World.java -index 7f999cbd5b..397915a553 100644 +index f6531d4fea..e9da359e93 100644 --- a/src/main/java/net/minecraft/server/World.java +++ b/src/main/java/net/minecraft/server/World.java -@@ -1077,6 +1077,7 @@ public abstract class World implements GeneratorAccess, IIBlockAccess, AutoClose +@@ -1078,6 +1078,7 @@ public abstract class World implements GeneratorAccess, IIBlockAccess, AutoClose } entity.valid = true; // CraftBukkit @@ -46,7 +46,7 @@ index 7f999cbd5b..397915a553 100644 new com.destroystokyo.paper.event.entity.EntityAddToWorldEvent(entity.getBukkitEntity()).callEvent(); // Paper - fire while valid } -@@ -1142,6 +1143,7 @@ public abstract class World implements GeneratorAccess, IIBlockAccess, AutoClose +@@ -1143,6 +1144,7 @@ public abstract class World implements GeneratorAccess, IIBlockAccess, AutoClose if (entity.inChunk && this.isChunkLoaded(i, j, true)) { this.getChunkAt(i, j).b(entity); } @@ -54,7 +54,7 @@ index 7f999cbd5b..397915a553 100644 if (!guardEntityList) { // Spigot - It will get removed after the tick if we are ticking // Paper - always remove from current chunk above // CraftBukkit start - Decrement loop variable field if we've already ticked this entity -@@ -2349,6 +2351,7 @@ public abstract class World implements GeneratorAccess, IIBlockAccess, AutoClose +@@ -2350,6 +2352,7 @@ public abstract class World implements GeneratorAccess, IIBlockAccess, AutoClose while (iterator.hasNext()) { Entity entity = (Entity) iterator.next(); @@ -62,7 +62,7 @@ index 7f999cbd5b..397915a553 100644 if (oclass.isAssignableFrom(entity.getClass()) && predicate.test((T) entity)) { arraylist.add(entity); -@@ -2435,6 +2438,7 @@ public abstract class World implements GeneratorAccess, IIBlockAccess, AutoClose +@@ -2436,6 +2439,7 @@ public abstract class World implements GeneratorAccess, IIBlockAccess, AutoClose while (iterator.hasNext()) { Entity entity = (Entity) iterator.next(); diff --git a/Spigot-Server-Patches/0325-World-EntityHuman-Lookup-Optimizations.patch b/Spigot-Server-Patches/0325-World-EntityHuman-Lookup-Optimizations.patch index 71d61b890..785be3f4c 100644 --- a/Spigot-Server-Patches/0325-World-EntityHuman-Lookup-Optimizations.patch +++ b/Spigot-Server-Patches/0325-World-EntityHuman-Lookup-Optimizations.patch @@ -1,11 +1,11 @@ -From c5e45cdd1991ea4afb82da70fc11ca2c59f070b6 Mon Sep 17 00:00:00 2001 +From a297d6fe589e774f7342aab72841f8cd259ac4a7 Mon Sep 17 00:00:00 2001 From: willies952002 Date: Mon, 30 Jul 2018 02:42:49 -0400 Subject: [PATCH] World EntityHuman Lookup Optimizations diff --git a/src/main/java/net/minecraft/server/World.java b/src/main/java/net/minecraft/server/World.java -index 397915a553..29877418c9 100644 +index e9da359e93..a370934684 100644 --- a/src/main/java/net/minecraft/server/World.java +++ b/src/main/java/net/minecraft/server/World.java @@ -79,6 +79,7 @@ public abstract class World implements GeneratorAccess, IIBlockAccess, AutoClose @@ -16,7 +16,7 @@ index 397915a553..29877418c9 100644 public final List k = Lists.newArrayList(); protected final IntHashMap entitiesById = new IntHashMap(); private final long G = 16777215L; -@@ -1061,6 +1062,8 @@ public abstract class World implements GeneratorAccess, IIBlockAccess, AutoClose +@@ -1062,6 +1063,8 @@ public abstract class World implements GeneratorAccess, IIBlockAccess, AutoClose EntityHuman entityhuman = (EntityHuman) entity; this.players.add(entityhuman); @@ -25,7 +25,7 @@ index 397915a553..29877418c9 100644 this.everyoneSleeping(); } -@@ -1103,6 +1106,7 @@ public abstract class World implements GeneratorAccess, IIBlockAccess, AutoClose +@@ -1104,6 +1107,7 @@ public abstract class World implements GeneratorAccess, IIBlockAccess, AutoClose entity.die(); if (entity instanceof EntityHuman) { this.players.remove(entity); @@ -33,7 +33,7 @@ index 397915a553..29877418c9 100644 // Spigot start for ( Object o : worldMaps.d ) { -@@ -1133,6 +1137,7 @@ public abstract class World implements GeneratorAccess, IIBlockAccess, AutoClose +@@ -1134,6 +1138,7 @@ public abstract class World implements GeneratorAccess, IIBlockAccess, AutoClose entity.die(); if (entity instanceof EntityHuman) { this.players.remove(entity); @@ -41,7 +41,7 @@ index 397915a553..29877418c9 100644 this.everyoneSleeping(); } -@@ -2661,6 +2666,8 @@ public abstract class World implements GeneratorAccess, IIBlockAccess, AutoClose +@@ -2662,6 +2667,8 @@ public abstract class World implements GeneratorAccess, IIBlockAccess, AutoClose @Nullable public EntityHuman a(String s) { @@ -50,7 +50,7 @@ index 397915a553..29877418c9 100644 for (int i = 0; i < this.players.size(); ++i) { EntityHuman entityhuman = (EntityHuman) this.players.get(i); -@@ -2670,10 +2677,15 @@ public abstract class World implements GeneratorAccess, IIBlockAccess, AutoClose +@@ -2671,10 +2678,15 @@ public abstract class World implements GeneratorAccess, IIBlockAccess, AutoClose } return null; @@ -66,7 +66,7 @@ index 397915a553..29877418c9 100644 for (int i = 0; i < this.players.size(); ++i) { EntityHuman entityhuman = (EntityHuman) this.players.get(i); -@@ -2683,6 +2695,10 @@ public abstract class World implements GeneratorAccess, IIBlockAccess, AutoClose +@@ -2684,6 +2696,10 @@ public abstract class World implements GeneratorAccess, IIBlockAccess, AutoClose } return null;