From 6d848fc4bf208e75d744907b3a990f1f82bd1d4d Mon Sep 17 00:00:00 2001 From: Jake Potrebic Date: Thu, 17 Jun 2021 10:11:00 -0700 Subject: [PATCH] remove remaining POMs --- Paper-MojangAPI/pom.xml | 204 ------------- patches/api/Add-FastUtil-to-Bukkit.patch | 17 -- patches/api/Adventure.patch | 65 ----- .../api/Better-AnnotationTest-printout.patch | 36 --- patches/api/Build-system-changes.patch | 100 ------- patches/api/Convert-project-to-Gradle.patch | 271 ++++++++++++++++++ patches/api/Use-ASM-for-event-executors.patch | 22 -- .../Ability-to-apply-mending-to-XP-API.patch | 21 +- patches/server/Adventure.patch | 2 + ...d-mobs-to-jump-and-take-water-damage.patch | 8 +- .../Asynchronous-chunk-IO-and-loading.patch | 11 +- ...tator-target-events-and-improve-impl.patch | 16 +- ...le-Keep-Spawn-Loaded-range-per-world.patch | 20 +- patches/server/Entity-Origin-API.patch | 14 +- patches/server/Entity-fromMobSpawner.patch | 2 +- .../Entity-load-save-limit-per-chunk.patch | 2 +- ...geEvent-not-firing-for-all-use-cases.patch | 9 +- ...ix-client-lag-on-advancement-loading.patch | 14 +- ...k-Priority-Urgency-System-for-Chunks.patch | 2 +- ...-for-CanPlaceOn-and-CanDestroy-NBT-v.patch | 15 +- ...Load-Chunks-for-Login-Asynchronously.patch | 8 +- patches/server/MC-Utils.patch | 32 --- ...-isOutsideRange-to-use-distance-maps.patch | 2 +- patches/server/Timings-v2.patch | 8 - .../Use-ConcurrentHashMap-in-JsonList.patch | 8 +- ...tance-map-to-optimise-entity-tracker.patch | 14 +- 26 files changed, 303 insertions(+), 620 deletions(-) delete mode 100644 Paper-MojangAPI/pom.xml diff --git a/Paper-MojangAPI/pom.xml b/Paper-MojangAPI/pom.xml deleted file mode 100644 index 7712a8723c..0000000000 --- a/Paper-MojangAPI/pom.xml +++ /dev/null @@ -1,204 +0,0 @@ - - - 4.0.0 - - com.destroystokyo.paper - paper-parent - dev-SNAPSHOT - - - com.destroystokyo.paper - paper-mojangapi - 1.16.5-R0.1-SNAPSHOT - jar - - Paper-MojangAPI - https://github.com/PaperMC/Paper - API additions that utilize Mojang Specific API's - - - - 1.8 - 1.8 - UTF-8 - - - - - spigotmc-public - https://hub.spigotmc.org/nexus/content/groups/public/ - - - sonatype - https://oss.sonatype.org/content/groups/public/ - - - minecraft-libraries - Minecraft Libraries - https://libraries.minecraft.net - - - - - - spigotmc-public - https://hub.spigotmc.org/nexus/content/groups/public/ - - - - - - com.destroystokyo.paper - paper-api - ${project.version} - provided - - - - com.mojang - brigadier - 1.0.17 - compile - - - - it.unimi.dsi - fastutil - 8.2.2 - provided - - - - org.jetbrains - annotations - 18.0.0 - provided - - - - junit - junit - 4.13.1 - test - - - org.hamcrest - hamcrest-library - 1.3 - test - - - org.ow2.asm - asm-tree - 7.3.1 - test - - - - - clean install - - - org.apache.maven.plugins - maven-compiler-plugin - 3.8.1 - - - - org.codehaus.plexus - plexus-compiler-eclipse - 2.8.5-spigotmc - - - - - org.apache.maven.plugins - maven-jar-plugin - 2.4 - - - - org.bukkit - - - - - - org.apache.maven.plugins - maven-shade-plugin - 3.2.1 - - - package - - shade - - - - - ${project.build.directory}/dependency-reduced-pom.xml - - true - - - - - - - - development - - false - - - - - org.apache.maven.plugins - maven-checkstyle-plugin - 3.1.0 - - - process-classes - - check - - - - - checkstyle.xml - true - - - - com.puppycrawl.tools - checkstyle - 8.29 - - - - - org.codehaus.mojo - animal-sniffer-maven-plugin - 1.18 - - - process-classes - - check - - - - - - org.codehaus.mojo.signature - java18 - 1.0 - - - - - - - - diff --git a/patches/api/Add-FastUtil-to-Bukkit.patch b/patches/api/Add-FastUtil-to-Bukkit.patch index 2b49ada8de..4a25bbe2e4 100644 --- a/patches/api/Add-FastUtil-to-Bukkit.patch +++ b/patches/api/Add-FastUtil-to-Bukkit.patch @@ -17,20 +17,3 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 compileOnly("org.apache.maven:maven-resolver-provider:3.8.1") compileOnly("org.apache.maven.resolver:maven-resolver-connector-basic:1.7.0") -diff --git a/pom.xml b/pom.xml -index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644 ---- a/pom.xml -+++ b/pom.xml -@@ -0,0 +0,0 @@ - - - -+ -+ it.unimi.dsi -+ fastutil -+ 8.2.2 -+ provided -+ - - commons-lang - commons-lang diff --git a/patches/api/Adventure.patch b/patches/api/Adventure.patch index 0b3a7ebd09..3e4c252de3 100644 --- a/patches/api/Adventure.patch +++ b/patches/api/Adventure.patch @@ -22,71 +22,6 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 compileOnly("org.apache.maven:maven-resolver-provider:3.8.1") compileOnly("org.apache.maven.resolver:maven-resolver-connector-basic:1.7.0") -diff --git a/pom.xml b/pom.xml -index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644 ---- a/pom.xml -+++ b/pom.xml -@@ -0,0 +0,0 @@ - 1.8 - 1.8 - UTF-8 -+ 4.7.0 - - - -@@ -0,0 +0,0 @@ - - - -+ -+ -+ -+ -+ net.kyori -+ adventure-bom -+ ${adventure.version} -+ pom -+ import -+ -+ -+ -+ -+ - -+ -+ -+ net.kyori -+ adventure-api -+ -+ -+ net.kyori -+ adventure-text-serializer-gson -+ -+ -+ net.kyori -+ adventure-text-serializer-legacy -+ -+ -+ net.kyori -+ adventure-text-serializer-plain -+ -+ - - it.unimi.dsi - fastutil -@@ -0,0 +0,0 @@ - https://javadoc.io/doc/org.yaml/snakeyaml/1.27/ - https://javadoc.io/doc/org.jetbrains/annotations-java5/20.1.0/ - https://javadoc.io/doc/net.md-5/bungeecord-chat/1.16-R0.4/ -+ -+ https://jd.adventure.kyori.net/api/${adventure.version}/ -+ https://jd.adventure.kyori.net/text-serializer-gson/${adventure.version}/ -+ https://jd.adventure.kyori.net/text-serializer-legacy/${adventure.version}/ -+ https://jd.adventure.kyori.net/text-serializer-plain/${adventure.version}/ -+ - - - diff --git a/src/main/java/co/aikar/timings/TimingsReportListener.java b/src/main/java/co/aikar/timings/TimingsReportListener.java index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644 --- a/src/main/java/co/aikar/timings/TimingsReportListener.java diff --git a/patches/api/Better-AnnotationTest-printout.patch b/patches/api/Better-AnnotationTest-printout.patch index 6fecb54dfe..de65d3c1e4 100644 --- a/patches/api/Better-AnnotationTest-printout.patch +++ b/patches/api/Better-AnnotationTest-printout.patch @@ -4,42 +4,6 @@ Date: Thu, 3 Dec 2020 14:04:57 -0800 Subject: [PATCH] Better AnnotationTest printout -diff --git a/pom.xml b/pom.xml -index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644 ---- a/pom.xml -+++ b/pom.xml -@@ -0,0 +0,0 @@ - true - - -+ -+ org.apache.maven.plugins -+ maven-surefire-plugin -+ 2.22.2 -+ -+ -+ -+ listener -+ io.papermc.paper.JunitEventListener -+ -+ -+ -+ - - org.apache.maven.plugins - maven-javadoc-plugin -diff --git a/src/test/java/io/papermc/paper/JunitEventListener.java b/src/test/java/io/papermc/paper/JunitEventListener.java -new file mode 100644 -index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 ---- /dev/null -+++ b/src/test/java/io/papermc/paper/JunitEventListener.java -@@ -0,0 +0,0 @@ -+package io.papermc.paper; -+ -+import org.junit.runner.notification.RunListener; -+ -+public class JunitEventListener extends RunListener { -+} diff --git a/src/test/java/org/bukkit/AnnotationTest.java b/src/test/java/org/bukkit/AnnotationTest.java index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644 --- a/src/test/java/org/bukkit/AnnotationTest.java diff --git a/patches/api/Build-system-changes.patch b/patches/api/Build-system-changes.patch index 46fd3b53e2..3ad242cff8 100644 --- a/patches/api/Build-system-changes.patch +++ b/patches/api/Build-system-changes.patch @@ -24,103 +24,3 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 compileOnly(annotations) testCompileOnly(annotations) -diff --git a/pom.xml b/pom.xml -index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644 ---- a/pom.xml -+++ b/pom.xml -@@ -0,0 +0,0 @@ - - 4.0.0 -+ -+ com.destroystokyo.paper -+ paper-parent -+ dev-SNAPSHOT -+ - -- org.spigotmc -- spigot-api -+ com.destroystokyo.paper -+ paper-api - 1.17-R0.1-SNAPSHOT - jar - -- Spigot-API -- https://www.spigotmc.org/ -+ Paper-API -+ https://github.com/PaperMC/Paper - An enhanced plugin API for Minecraft servers. - - -- true -+ - 1.8 - 1.8 - UTF-8 - - -- -+ - -- spigotmc-releases -- https://hub.spigotmc.org/nexus/content/repositories/releases/ -+ sonatype -+ https://oss.sonatype.org/content/groups/public/ - -- -- spigotmc-snapshots -- https://hub.spigotmc.org/nexus/content/repositories/snapshots/ -- -- -+ - - - -@@ -0,0 +0,0 @@ - 2.6 - compile - -+ -+ -+ com.google.code.findbugs -+ jsr305 -+ 1.3.9 -+ compile -+ -+ -+ -+ com.googlecode.json-simple -+ json-simple -+ 1.1.1 -+ compile -+ - - - com.google.guava -@@ -0,0 +0,0 @@ - - - -+ clean install - - - net.md-5 -@@ -0,0 +0,0 @@ - org.apache.maven.plugins - maven-compiler-plugin - 3.8.1 -- -- -- eclipse -- - - - org.codehaus.plexus -@@ -0,0 +0,0 @@ - - - -+ ${project.build.directory}/dependency-reduced-pom.xml - - true - diff --git a/patches/api/Convert-project-to-Gradle.patch b/patches/api/Convert-project-to-Gradle.patch index 931b4e5e45..a6ab454b53 100644 --- a/patches/api/Convert-project-to-Gradle.patch +++ b/patches/api/Convert-project-to-Gradle.patch @@ -3,6 +3,9 @@ From: Kyle Wood Date: Thu, 10 Dec 2020 20:50:33 -0800 Subject: [PATCH] Convert project to Gradle +The pom.xml file is deleted in this patch so the patch will fail to +apply if there are changes made to it from upstream - thus notifying us +that changes were made. diff --git a/.gitignore b/.gitignore index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644 @@ -87,3 +90,271 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 + "https://javadoc.io/doc/net.md-5/bungeecord-chat/1.16-R0.4/" + ) +} +diff --git a/pom.xml b/pom.xml +deleted file mode 100644 +index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 +--- a/pom.xml ++++ /dev/null +@@ -0,0 +0,0 @@ +- +- +- 4.0.0 +- +- org.spigotmc +- spigot-api +- 1.17-R0.1-SNAPSHOT +- jar +- +- Spigot-API +- https://www.spigotmc.org/ +- An enhanced plugin API for Minecraft servers. +- +- +- true +- 1.8 +- 1.8 +- UTF-8 +- +- +- +- +- spigotmc-releases +- https://hub.spigotmc.org/nexus/content/repositories/releases/ +- +- +- spigotmc-snapshots +- https://hub.spigotmc.org/nexus/content/repositories/snapshots/ +- +- +- +- +- +- commons-lang +- commons-lang +- 2.6 +- compile +- +- +- +- com.google.guava +- guava +- 21.0 +- compile +- +- +- +- com.google.code.gson +- gson +- 2.8.0 +- compile +- +- +- net.md-5 +- bungeecord-chat +- 1.16-R0.4 +- jar +- compile +- +- +- org.yaml +- snakeyaml +- 1.28 +- compile +- +- +- +- org.apache.maven +- maven-resolver-provider +- 3.8.1 +- provided +- +- +- org.apache.maven.resolver +- maven-resolver-connector-basic +- 1.7.0 +- provided +- +- +- org.apache.maven.resolver +- maven-resolver-transport-http +- 1.7.0 +- provided +- +- +- +- org.jetbrains +- annotations-java5 +- 21.0.1 +- provided +- +- +- +- junit +- junit +- 4.13.1 +- test +- +- +- org.hamcrest +- hamcrest-library +- 1.3 +- test +- +- +- org.ow2.asm +- asm-tree +- 9.1 +- test +- +- +- +- +- +- +- net.md-5 +- scriptus +- 0.4.1 +- +- +- initialize +- +- describe +- +- +- +- +- +- org.apache.maven.plugins +- maven-compiler-plugin +- 3.8.1 +- +- +- eclipse +- +- +- +- org.codehaus.plexus +- plexus-compiler-eclipse +- 2.8.8 +- +- +- org.eclipse.jdt +- ecj +- 3.24.0 +- +- +- +- +- org.apache.maven.plugins +- maven-jar-plugin +- 3.2.0 +- +- +- +- false +- +- +- org.bukkit +- +- +- +- +- +- org.apache.maven.plugins +- maven-shade-plugin +- 3.2.3 +- +- +- package +- +- shade +- +- +- +- +- +- +- *:* +- +- META-INF/MANIFEST.MF +- +- +- +- +- true +- +- +- +- org.apache.maven.plugins +- maven-javadoc-plugin +- 3.2.0 +- +- +- https://guava.dev/releases/21.0/api/docs/ +- https://javadoc.io/doc/org.yaml/snakeyaml/1.27/ +- https://javadoc.io/doc/org.jetbrains/annotations-java5/20.1.0/ +- https://javadoc.io/doc/net.md-5/bungeecord-chat/1.16-R0.4/ +- +- +- +- +- +- +- +- +- development +- +- false +- +- +- +- +- org.apache.maven.plugins +- maven-checkstyle-plugin +- 3.1.1 +- +- +- process-classes +- +- check +- +- +- +- +- checkstyle.xml +- true +- +- +- +- com.puppycrawl.tools +- checkstyle +- 8.39 +- +- +- +- +- org.codehaus.mojo +- animal-sniffer-maven-plugin +- 1.19 +- +- +- process-classes +- +- check +- +- +- +- +- +- org.codehaus.mojo.signature +- java18 +- 1.0 +- +- +- +- +- +- +- +- diff --git a/patches/api/Use-ASM-for-event-executors.patch b/patches/api/Use-ASM-for-event-executors.patch index 253f11b2c0..e5e3fdfac4 100644 --- a/patches/api/Use-ASM-for-event-executors.patch +++ b/patches/api/Use-ASM-for-event-executors.patch @@ -18,28 +18,6 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 compileOnly("org.apache.maven:maven-resolver-provider:3.8.1") compileOnly("org.apache.maven.resolver:maven-resolver-connector-basic:1.7.0") -diff --git a/pom.xml b/pom.xml -index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644 ---- a/pom.xml -+++ b/pom.xml -@@ -0,0 +0,0 @@ - 9.1 - test - -+ -+ -+ org.ow2.asm -+ asm -+ 9.0 -+ -+ -+ org.ow2.asm -+ asm-commons -+ 9.0 -+ - - - diff --git a/src/main/java/com/destroystokyo/paper/event/executor/MethodHandleEventExecutor.java b/src/main/java/com/destroystokyo/paper/event/executor/MethodHandleEventExecutor.java new file mode 100644 index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 diff --git a/patches/server/Ability-to-apply-mending-to-XP-API.patch b/patches/server/Ability-to-apply-mending-to-XP-API.patch index a28e8ae045..973490692e 100644 --- a/patches/server/Ability-to-apply-mending-to-XP-API.patch +++ b/patches/server/Ability-to-apply-mending-to-XP-API.patch @@ -9,23 +9,6 @@ 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/world/entity/ExperienceOrb.java b/src/main/java/net/minecraft/world/entity/ExperienceOrb.java -index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644 ---- a/src/main/java/net/minecraft/world/entity/ExperienceOrb.java -+++ b/src/main/java/net/minecraft/world/entity/ExperienceOrb.java -@@ -0,0 +0,0 @@ public class ExperienceOrb extends Entity { - } - } - -+ public final int durToXp(int i) { return durabilityToXp(i); } // Paper OBFHELPER - private int durabilityToXp(int repairAmount) { - return repairAmount / 2; - } - -+ public final int xpToDur(int i) { return xpToDurability(i); } // Paper OBFHELPER - private int xpToDurability(int experienceAmount) { - return experienceAmount * 2; - } diff --git a/src/main/java/net/minecraft/world/item/enchantment/EnchantmentHelper.java b/src/main/java/net/minecraft/world/item/enchantment/EnchantmentHelper.java index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644 --- a/src/main/java/net/minecraft/world/item/enchantment/EnchantmentHelper.java @@ -80,12 +63,12 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 + orb.spawnReason = org.bukkit.entity.ExperienceOrb.SpawnReason.CUSTOM; + orb.setPosRaw(handle.getX(), handle.getY(), handle.getZ()); + -+ int i = Math.min(orb.xpToDur(amount), itemstack.getDamageValue()); ++ int i = Math.min(orb.xpToDurability(amount), itemstack.getDamageValue()); + org.bukkit.event.player.PlayerItemMendEvent event = org.bukkit.craftbukkit.event.CraftEventFactory.callPlayerItemMendEvent(handle, orb, itemstack, i); + i = event.getRepairAmount(); + orb.discard(); + if (!event.isCancelled()) { -+ amount -= orb.durToXp(i); ++ amount -= orb.durabilityToXp(i); + itemstack.setDamageValue(itemstack.getDamageValue() - i); + } + } diff --git a/patches/server/Adventure.patch b/patches/server/Adventure.patch index 847731b40a..e267dbfbf2 100644 --- a/patches/server/Adventure.patch +++ b/patches/server/Adventure.patch @@ -2349,6 +2349,8 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 + final java.util.Optional event = net.minecraft.core.Registry.SOUND_EVENT.getOptional(name); + if (event.isPresent()) { + this.getHandle().connection.send(new net.minecraft.network.protocol.game.ClientboundSoundEntityPacket(event.get(), io.papermc.paper.adventure.PaperAdventure.asVanilla(sound.source()), entity, sound.volume(), sound.pitch())); ++ } else { ++ this.getHandle().connection.send(new ClientboundCustomSoundPacket(name, io.papermc.paper.adventure.PaperAdventure.asVanilla(sound.source()), entity.position(), sound.volume(), sound.pitch())); + } + } + diff --git a/patches/server/Allow-nerfed-mobs-to-jump-and-take-water-damage.patch b/patches/server/Allow-nerfed-mobs-to-jump-and-take-water-damage.patch index c24386b509..bda84e8246 100644 --- a/patches/server/Allow-nerfed-mobs-to-jump-and-take-water-damage.patch +++ b/patches/server/Allow-nerfed-mobs-to-jump-and-take-water-damage.patch @@ -49,7 +49,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 - if (!this.aware) return; // CraftBukkit + if (!this.aware) { // Paper start - Allow nerfed mobs to jump, float and take water damage + if (goalFloat != null) { -+ if (goalFloat.validConditions()) goalFloat.update(); ++ if (goalFloat.validConditions()) goalFloat.tick(); + this.getJumpControl().tick(); + } + if ((this instanceof net.minecraft.world.entity.monster.Blaze || this instanceof net.minecraft.world.entity.monster.EnderMan) && isInWaterRainOrBubble()) { @@ -78,9 +78,3 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 @Override public boolean canUse() { return this.mob.isInWater() && this.mob.getFluidHeight(FluidTags.WATER) > this.mob.getFluidJumpThreshold() || this.mob.isInLava(); - } - -+ public void update() { this.tick(); } // Paper - OBFHELPER - @Override - public void tick() { - if (this.mob.getRandom().nextFloat() < 0.8F) { diff --git a/patches/server/Asynchronous-chunk-IO-and-loading.patch b/patches/server/Asynchronous-chunk-IO-and-loading.patch index 562ba0122c..93a2954b0e 100644 --- a/patches/server/Asynchronous-chunk-IO-and-loading.patch +++ b/patches/server/Asynchronous-chunk-IO-and-loading.patch @@ -1534,7 +1534,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 + + try { + chunkData.chunkData = chunkManager.getChunkData(this.world.getTypeKey(), -+ chunkManager.getWorldPersistentDataSupplier(), chunkData.chunkData, chunkPos, this.world); // clone data for safety, file IO thread does not clone ++ chunkManager.overworldDataStorage, chunkData.chunkData, chunkPos, this.world); // clone data for safety, file IO thread does not clone + } catch (final Throwable ex) { + PaperFileIOThread.LOGGER.error("Could not apply datafixers for chunk task: " + this.toString(), ex); + this.complete(ChunkLoadTask.createEmptyHolder()); @@ -2360,15 +2360,6 @@ diff --git a/src/main/java/net/minecraft/server/level/ChunkMap.java b/src/main/j index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644 --- a/src/main/java/net/minecraft/server/level/ChunkMap.java +++ b/src/main/java/net/minecraft/server/level/ChunkMap.java -@@ -0,0 +0,0 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider - private final ThreadedLevelLightEngine lightEngine; - private final BlockableEventLoop mainThreadExecutor; - public final ChunkGenerator generator; -- private final Supplier overworldDataStorage; -+ private final Supplier overworldDataStorage; public final Supplier getWorldPersistentDataSupplier() { return this.overworldDataStorage; } // Paper - OBFHELPER - private final PoiManager poiManager; - public final LongSet toDrop; - private boolean modified; @@ -0,0 +0,0 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider public void close() throws IOException { try { diff --git a/patches/server/Call-player-spectator-target-events-and-improve-impl.patch b/patches/server/Call-player-spectator-target-events-and-improve-impl.patch index 083ad71631..8a2c107d50 100644 --- a/patches/server/Call-player-spectator-target-events-and-improve-impl.patch +++ b/patches/server/Call-player-spectator-target-events-and-improve-impl.patch @@ -55,12 +55,12 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 + // Validate + if (entity != this) { + if (entity.isRemoved() || !entity.valid || entity.level == null) { -+ MinecraftServer.LOGGER.info("Blocking player " + this.toString() + " from spectating invalid entity " + entity.toString()); ++ MinecraftServer.LOGGER.info("Blocking player " + this + " from spectating invalid entity " + entity); + return; + } + if (this.isImmobile()) { + // use debug: clients might maliciously spam this -+ MinecraftServer.LOGGER.debug("Blocking frozen player " + this.toString() + " from spectating entity " + entity.toString()); ++ MinecraftServer.LOGGER.debug("Blocking frozen player " + this + " from spectating entity " + entity); + return; + } + } @@ -85,15 +85,3 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 } @Override -diff --git a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java -index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644 ---- a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java -+++ b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java -@@ -0,0 +0,0 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Ser - this.a(x, y, z, yaw, pitch, PlayerTeleportEvent.TeleportCause.UNKNOWN); - } - -+ public final void teleport(double d0, double d1, double d2, float f, float f1, PlayerTeleportEvent.TeleportCause cause) { this.a(d0, d1, d2, f, f1, cause); } // Paper - OBFHELPER - public void a(double d0, double d1, double d2, float f, float f1, PlayerTeleportEvent.TeleportCause cause) { - this.a(d0, d1, d2, f, f1, Collections.emptySet(), true, cause); - } diff --git a/patches/server/Configurable-Keep-Spawn-Loaded-range-per-world.patch b/patches/server/Configurable-Keep-Spawn-Loaded-range-per-world.patch index b2cacab732..be49f3160a 100644 --- a/patches/server/Configurable-Keep-Spawn-Loaded-range-per-world.patch +++ b/patches/server/Configurable-Keep-Spawn-Loaded-range-per-world.patch @@ -111,7 +111,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 + for (int x = -tickRadius; x <= tickRadius; x += 16) { + for (int z = -tickRadius; z <= tickRadius; z += 16) { + // radius of 2 will have the current chunk be level 31 -+ chunkproviderserver.addRegionTicket(TicketType.START, new ChunkPos(spawn.add(x, 0, z)), 2, Unit.INSTANCE); ++ chunkproviderserver.addRegionTicket(TicketType.START, new ChunkPos(spawn.offset(x, 0, z)), 2, Unit.INSTANCE); + } + } + @@ -120,17 +120,17 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 + // add border along x axis (including corner chunks) + for (int x = -radiusInBlocks; x <= radiusInBlocks; x += 16) { + // top -+ chunkproviderserver.addRegionTicket(TicketType.START, new ChunkPos(spawn.add(x, 0, radiusInBlocks)), 1, Unit.INSTANCE); // level 32 ++ chunkproviderserver.addRegionTicket(TicketType.START, new ChunkPos(spawn.offset(x, 0, radiusInBlocks)), 1, Unit.INSTANCE); // level 32 + // bottom -+ chunkproviderserver.addRegionTicket(TicketType.START, new ChunkPos(spawn.add(x, 0, -radiusInBlocks)), 1, Unit.INSTANCE); // level 32 ++ chunkproviderserver.addRegionTicket(TicketType.START, new ChunkPos(spawn.offset(x, 0, -radiusInBlocks)), 1, Unit.INSTANCE); // level 32 + } + + // add border along z axis (excluding corner chunks) + for (int z = -radiusInBlocks + 16; z < radiusInBlocks; z += 16) { + // right -+ chunkproviderserver.addRegionTicket(TicketType.START, new ChunkPos(spawn.add(radiusInBlocks, 0, z)), 1, Unit.INSTANCE); // level 32 ++ chunkproviderserver.addRegionTicket(TicketType.START, new ChunkPos(spawn.offset(radiusInBlocks, 0, z)), 1, Unit.INSTANCE); // level 32 + // left -+ chunkproviderserver.addRegionTicket(TicketType.START, new ChunkPos(spawn.add(-radiusInBlocks, 0, z)), 1, Unit.INSTANCE); // level 32 ++ chunkproviderserver.addRegionTicket(TicketType.START, new ChunkPos(spawn.offset(-radiusInBlocks, 0, z)), 1, Unit.INSTANCE); // level 32 + } + } + public void removeTicketsForSpawn(int radiusInBlocks, BlockPos spawn) { @@ -143,7 +143,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 + for (int x = -tickRadius; x <= tickRadius; x += 16) { + for (int z = -tickRadius; z <= tickRadius; z += 16) { + // radius of 2 will have the current chunk be level 31 -+ chunkproviderserver.removeRegionTicket(TicketType.START, new ChunkPos(spawn.add(x, 0, z)), 2, Unit.INSTANCE); ++ chunkproviderserver.removeRegionTicket(TicketType.START, new ChunkPos(spawn.offset(x, 0, z)), 2, Unit.INSTANCE); + } + } + @@ -152,17 +152,17 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 + // remove border along x axis (including corner chunks) + for (int x = -radiusInBlocks; x <= radiusInBlocks; x += 16) { + // top -+ chunkproviderserver.removeRegionTicket(TicketType.START, new ChunkPos(spawn.add(x, 0, radiusInBlocks)), 1, Unit.INSTANCE); // level 32 ++ chunkproviderserver.removeRegionTicket(TicketType.START, new ChunkPos(spawn.offset(x, 0, radiusInBlocks)), 1, Unit.INSTANCE); // level 32 + // bottom -+ chunkproviderserver.removeRegionTicket(TicketType.START, new ChunkPos(spawn.add(x, 0, -radiusInBlocks)), 1, Unit.INSTANCE); // level 32 ++ chunkproviderserver.removeRegionTicket(TicketType.START, new ChunkPos(spawn.offset(x, 0, -radiusInBlocks)), 1, Unit.INSTANCE); // level 32 + } + + // remove border along z axis (excluding corner chunks) + for (int z = -radiusInBlocks + 16; z < radiusInBlocks; z += 16) { + // right -+ chunkproviderserver.removeRegionTicket(TicketType.START, new ChunkPos(spawn.add(radiusInBlocks, 0, z)), 1, Unit.INSTANCE); // level 32 ++ chunkproviderserver.removeRegionTicket(TicketType.START, new ChunkPos(spawn.offset(radiusInBlocks, 0, z)), 1, Unit.INSTANCE); // level 32 + // left -+ chunkproviderserver.removeRegionTicket(TicketType.START, new ChunkPos(spawn.add(-radiusInBlocks, 0, z)), 1, Unit.INSTANCE); // level 32 ++ chunkproviderserver.removeRegionTicket(TicketType.START, new ChunkPos(spawn.offset(-radiusInBlocks, 0, z)), 1, Unit.INSTANCE); // level 32 + } + } + // Paper end diff --git a/patches/server/Entity-Origin-API.patch b/patches/server/Entity-Origin-API.patch index 1cfe024b49..edbd46b7a9 100644 --- a/patches/server/Entity-Origin-API.patch +++ b/patches/server/Entity-Origin-API.patch @@ -4,18 +4,6 @@ Date: Tue, 1 Mar 2016 23:45:08 -0600 Subject: [PATCH] Entity Origin API -diff --git a/src/main/java/net/minecraft/nbt/ListTag.java b/src/main/java/net/minecraft/nbt/ListTag.java -index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644 ---- a/src/main/java/net/minecraft/nbt/ListTag.java -+++ b/src/main/java/net/minecraft/nbt/ListTag.java -@@ -0,0 +0,0 @@ public class ListTag extends CollectionTag { - return new long[0]; - } - -+ public final double getDoubleAt(int i) { return this.getDouble(i); } // Paper - OBFHELPER - public double getDouble(int index) { - if (index >= 0 && index < this.list.size()) { - Tag tag = this.list.get(index); diff --git a/src/main/java/net/minecraft/server/level/ServerLevel.java b/src/main/java/net/minecraft/server/level/ServerLevel.java index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644 --- a/src/main/java/net/minecraft/server/level/ServerLevel.java @@ -89,7 +77,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 + originWorld = nbt.getUUID("Paper.OriginWorld"); + } + this.originWorld = originWorld; -+ origin = new org.bukkit.util.Vector(originTag.getDoubleAt(0), originTag.getDoubleAt(1), originTag.getDoubleAt(2)); ++ origin = new org.bukkit.util.Vector(originTag.getDouble(0), originTag.getDouble(1), originTag.getDouble(2)); + } + // Paper end + diff --git a/patches/server/Entity-fromMobSpawner.patch b/patches/server/Entity-fromMobSpawner.patch index ed801b9908..d543dca00e 100644 --- a/patches/server/Entity-fromMobSpawner.patch +++ b/patches/server/Entity-fromMobSpawner.patch @@ -29,7 +29,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 } catch (Throwable throwable) { @@ -0,0 +0,0 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource, n this.originWorld = originWorld; - origin = new org.bukkit.util.Vector(originTag.getDoubleAt(0), originTag.getDoubleAt(1), originTag.getDoubleAt(2)); + origin = new org.bukkit.util.Vector(originTag.getDouble(0), originTag.getDouble(1), originTag.getDouble(2)); } + + spawnedViaMobSpawner = nbt.getBoolean("Paper.FromMobSpawner"); // Restore entity's from mob spawner status diff --git a/patches/server/Entity-load-save-limit-per-chunk.patch b/patches/server/Entity-load-save-limit-per-chunk.patch index d9ff7f1848..32bee0a40f 100644 --- a/patches/server/Entity-load-save-limit-per-chunk.patch +++ b/patches/server/Entity-load-save-limit-per-chunk.patch @@ -54,7 +54,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 final Spliterator spliterator = entityNbtList.spliterator(); return StreamSupport.stream(new Spliterator() { -+ final Map, Integer> loadedEntityCounts = new java.util.HashMap<>(); // Paper ++ final java.util.Map, Integer> loadedEntityCounts = new java.util.HashMap<>(); // Paper public boolean tryAdvance(Consumer consumer) { return spliterator.tryAdvance((nbtbase) -> { EntityType.loadEntityRecursive((CompoundTag) nbtbase, world, (entity) -> { diff --git a/patches/server/Fix-SpawnChangeEvent-not-firing-for-all-use-cases.patch b/patches/server/Fix-SpawnChangeEvent-not-firing-for-all-use-cases.patch index 7be67b972a..37d56dfc09 100644 --- a/patches/server/Fix-SpawnChangeEvent-not-firing-for-all-use-cases.patch +++ b/patches/server/Fix-SpawnChangeEvent-not-firing-for-all-use-cases.patch @@ -9,13 +9,6 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 --- a/src/main/java/net/minecraft/server/level/ServerLevel.java +++ b/src/main/java/net/minecraft/server/level/ServerLevel.java @@ -0,0 +0,0 @@ public class ServerLevel extends net.minecraft.world.level.Level implements Worl - } - // Paper end - -+ public final void setSpawn(BlockPos blockposition, float f) { this.setDefaultSpawnPos(blockposition, f); } // Paper - OBFHELPER - public void setDefaultSpawnPos(BlockPos pos, float angle) { - // Paper - configurable spawn radius - BlockPos prevSpawn = this.getSharedSpawnPos(); //ChunkCoordIntPair chunkcoordintpair = new ChunkCoordIntPair(new BlockPosition(this.worldData.a(), 0, this.worldData.c())); this.levelData.setSpawn(pos, angle); @@ -32,7 +25,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 try { Location previousLocation = this.getSpawnLocation(); - world.levelData.setSpawn(new BlockPos(x, y, z), angle); -+ world.setSpawn(new BlockPos(x, y, z), angle); // Paper - use WorldServer#setSpawn ++ world.setDefaultSpawnPos(new BlockPos(x, y, z), angle); // Paper - use WorldServer#setSpawn + // Paper start - move to nms.World // Notify anyone who's listening. diff --git a/patches/server/Fix-client-lag-on-advancement-loading.patch b/patches/server/Fix-client-lag-on-advancement-loading.patch index 994ad58f0a..5a6d5ed3aa 100644 --- a/patches/server/Fix-client-lag-on-advancement-loading.patch +++ b/patches/server/Fix-client-lag-on-advancement-loading.patch @@ -14,18 +14,6 @@ To ensure the client still receives the updated advancement data, we manually reload the advancement data for all players, which normally takes place as a part of the datapack reloading. -diff --git a/src/main/java/net/minecraft/server/PlayerAdvancements.java b/src/main/java/net/minecraft/server/PlayerAdvancements.java -index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644 ---- a/src/main/java/net/minecraft/server/PlayerAdvancements.java -+++ b/src/main/java/net/minecraft/server/PlayerAdvancements.java -@@ -0,0 +0,0 @@ public class PlayerAdvancements { - - } - -+ public final void sendUpdateIfNeeded(ServerPlayer entityPlayer) { this.flushDirty(entityPlayer); } // Paper - OBFHELPER - public void flushDirty(ServerPlayer player) { - if (this.isFirstPacket || !this.visibilityChanged.isEmpty() || !this.progressChanged.isEmpty()) { - Map map = Maps.newHashMap(); diff --git a/src/main/java/org/bukkit/craftbukkit/util/CraftMagicNumbers.java b/src/main/java/org/bukkit/craftbukkit/util/CraftMagicNumbers.java index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644 --- a/src/main/java/org/bukkit/craftbukkit/util/CraftMagicNumbers.java @@ -39,7 +27,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 + //MinecraftServer.getServer().getPlayerList().reload(); + MinecraftServer.getServer().getPlayerList().getPlayers().forEach(player -> { + player.getAdvancements().reload(MinecraftServer.getServer().getAdvancements()); -+ player.getAdvancements().sendUpdateIfNeeded(player); ++ player.getAdvancements().flushDirty(player); + }); + // Paper end diff --git a/patches/server/Implement-Chunk-Priority-Urgency-System-for-Chunks.patch b/patches/server/Implement-Chunk-Priority-Urgency-System-for-Chunks.patch index 457745365e..fd56bd0ba8 100644 --- a/patches/server/Implement-Chunk-Priority-Urgency-System-for-Chunks.patch +++ b/patches/server/Implement-Chunk-Priority-Urgency-System-for-Chunks.patch @@ -321,7 +321,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 private final BlockableEventLoop mainThreadExecutor; + final java.util.concurrent.Executor mainInvokingExecutor; // Paper public final ChunkGenerator generator; - private final Supplier overworldDataStorage; public final Supplier getWorldPersistentDataSupplier() { return this.overworldDataStorage; } // Paper - OBFHELPER + public final Supplier overworldDataStorage; private final PoiManager poiManager; @@ -0,0 +0,0 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider diff --git a/patches/server/Implement-an-API-for-CanPlaceOn-and-CanDestroy-NBT-v.patch b/patches/server/Implement-an-API-for-CanPlaceOn-and-CanDestroy-NBT-v.patch index 2f9d8bcb77..a6acb9bc2b 100644 --- a/patches/server/Implement-an-API-for-CanPlaceOn-and-CanDestroy-NBT-v.patch +++ b/patches/server/Implement-an-API-for-CanPlaceOn-and-CanDestroy-NBT-v.patch @@ -4,19 +4,6 @@ Date: Wed, 12 Sep 2018 18:53:55 +0300 Subject: [PATCH] Implement an API for CanPlaceOn and CanDestroy NBT values -diff --git a/src/main/java/net/minecraft/commands/arguments/blocks/BlockStateParser.java b/src/main/java/net/minecraft/commands/arguments/blocks/BlockStateParser.java -index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644 ---- a/src/main/java/net/minecraft/commands/arguments/blocks/BlockStateParser.java -+++ b/src/main/java/net/minecraft/commands/arguments/blocks/BlockStateParser.java -@@ -0,0 +0,0 @@ public class BlockStateParser { - private final boolean forTesting; - private final Map, Comparable> properties = Maps.newLinkedHashMap(); // CraftBukkit - stable - private final Map vagueProperties = Maps.newHashMap(); -- private ResourceLocation id = new ResourceLocation(""); -+ private ResourceLocation id = new ResourceLocation(""); public final ResourceLocation getBlockKey() { return this.id; } // Paper - OBFHELPER - private StateDefinition definition; - private BlockState state; - @Nullable diff --git a/src/main/java/org/bukkit/craftbukkit/inventory/CraftMetaItem.java b/src/main/java/org/bukkit/craftbukkit/inventory/CraftMetaItem.java index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644 --- a/src/main/java/org/bukkit/craftbukkit/inventory/CraftMetaItem.java @@ -374,7 +361,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 + if (isTag) { + key = blockParser.getTag(); + } else { -+ key = blockParser.getBlockKey(); ++ key = blockParser.id; + } + + if (key == null) { diff --git a/patches/server/Load-Chunks-for-Login-Asynchronously.patch b/patches/server/Load-Chunks-for-Login-Asynchronously.patch index f14b159f86..c4118f64f2 100644 --- a/patches/server/Load-Chunks-for-Login-Asynchronously.patch +++ b/patches/server/Load-Chunks-for-Login-Asynchronously.patch @@ -108,12 +108,6 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 import net.minecraft.network.protocol.game.ClientboundGameEventPacket; import net.minecraft.network.protocol.game.ClientboundInitializeBorderPacket; @@ -0,0 +0,0 @@ public abstract class PlayerList { - private static final SimpleDateFormat BAN_DATE_FORMAT = new SimpleDateFormat("yyyy-MM-dd 'at' HH:mm:ss z"); - private final MinecraftServer server; - public final List players = new java.util.concurrent.CopyOnWriteArrayList(); // CraftBukkit - ArrayList -> CopyOnWriteArrayList: Iterator safety -- private final Map playersByUUID = Maps.newHashMap(); -+ private final Map playersByUUID = Maps.newHashMap();Map getUUIDMap() { return playersByUUID; } // Paper - OBFHELPER - private final UserBanList bans; private final IpBanList ipBans; private final ServerOpList ops; private final UserWhiteList whitelist; @@ -173,7 +167,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 + } + + public ServerPlayer getActivePlayer(UUID uuid) { -+ ServerPlayer player = this.getUUIDMap().get(uuid); ++ ServerPlayer player = this.playersByUUID.get(uuid); + return player != null ? player : pendingPlayers.get(uuid); + } + diff --git a/patches/server/MC-Utils.patch b/patches/server/MC-Utils.patch index 6a2ede310b..65d3549a96 100644 --- a/patches/server/MC-Utils.patch +++ b/patches/server/MC-Utils.patch @@ -2274,14 +2274,6 @@ diff --git a/src/main/java/net/minecraft/core/BlockPos.java b/src/main/java/net/ index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644 --- a/src/main/java/net/minecraft/core/BlockPos.java +++ b/src/main/java/net/minecraft/core/BlockPos.java -@@ -0,0 +0,0 @@ public class BlockPos extends Vec3i { - return d == 0.0D && e == 0.0D && f == 0.0D ? this : new BlockPos((double)this.getX() + d, (double)this.getY() + e, (double)this.getZ() + f); - } - -+ @Deprecated public final BlockPos add(int i, int j, int k) {return this.offset(i, j, k);} // Paper - OBFHELPER - @Override - public BlockPos offset(int i, int j, int k) { - return i == 0 && j == 0 && k == 0 ? this : new BlockPos(this.getX() + i, this.getY() + j, this.getZ() + k); @@ -0,0 +0,0 @@ public class BlockPos extends Vec3i { return super.rotate(rotation).immutable(); } @@ -3473,29 +3465,6 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 @Override public void tell(R runnable) { -diff --git a/src/main/java/net/minecraft/world/entity/EntityType.java b/src/main/java/net/minecraft/world/entity/EntityType.java -index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644 ---- a/src/main/java/net/minecraft/world/entity/EntityType.java -+++ b/src/main/java/net/minecraft/world/entity/EntityType.java -@@ -0,0 +0,0 @@ import java.util.List; - import java.util.Optional; - import java.util.Spliterator; - import java.util.Set; // Paper -+import java.util.Map; // Paper - import java.util.UUID; - import java.util.function.Consumer; - import java.util.function.Function; -@@ -0,0 +0,0 @@ public class EntityType implements EntityTypeTest { - return this.dimensions.height; - } - -- @Nullable -- public T create(Level world) { -+ public T create(Level world) { return this.create(world); } // Paper - OBFHELPER -+ @Nullable public T create(Level world) { // Paper - OBFHELPER - return this.factory.create(this, world); - } - diff --git a/src/main/java/net/minecraft/world/entity/LivingEntity.java b/src/main/java/net/minecraft/world/entity/LivingEntity.java index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644 --- a/src/main/java/net/minecraft/world/entity/LivingEntity.java @@ -3689,7 +3658,6 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 } - public static long asLong(int chunkX, int chunkZ) { -+ @Deprecated public static long pair(final BlockPos pos) { return asLong(pos.getX() >> 4, pos.getZ() >> 4); } // Paper - OBFHELPER + public static long asLong(int chunkX, int chunkZ) { return (long)chunkX & 4294967295L | ((long)chunkZ & 4294967295L) << 32; } diff --git a/patches/server/Optimize-isOutsideRange-to-use-distance-maps.patch b/patches/server/Optimize-isOutsideRange-to-use-distance-maps.patch index 04e1fd8c40..c3a6ca949c 100644 --- a/patches/server/Optimize-isOutsideRange-to-use-distance-maps.patch +++ b/patches/server/Optimize-isOutsideRange-to-use-distance-maps.patch @@ -41,7 +41,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 --- a/src/main/java/net/minecraft/server/level/ChunkMap.java +++ b/src/main/java/net/minecraft/server/level/ChunkMap.java @@ -0,0 +0,0 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider - return MinecraftServer.getServer().applyTrackingRangeScale(vanilla); + return MinecraftServer.getServer().getScaledTrackingDistance(vanilla); } // Paper end - use distance map to optimise tracker + // Paper start - optimise PlayerChunkMap#isOutsideRange diff --git a/patches/server/Timings-v2.patch b/patches/server/Timings-v2.patch index f94075712b..61202a2bda 100644 --- a/patches/server/Timings-v2.patch +++ b/patches/server/Timings-v2.patch @@ -1526,14 +1526,6 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 } @Nullable -@@ -0,0 +0,0 @@ public class EntityType implements EntityTypeTest { - return this.dimensions.height; - } - -- public T create(Level world) { return this.create(world); } // Paper - OBFHELPER - @Nullable public T create(Level world) { // Paper - OBFHELPER - return this.factory.create(this, world); - } @@ -0,0 +0,0 @@ public class EntityType implements EntityTypeTest { return this.updateInterval; } diff --git a/patches/server/Use-ConcurrentHashMap-in-JsonList.patch b/patches/server/Use-ConcurrentHashMap-in-JsonList.patch index f4ac347fbc..bf93199f9f 100644 --- a/patches/server/Use-ConcurrentHashMap-in-JsonList.patch +++ b/patches/server/Use-ConcurrentHashMap-in-JsonList.patch @@ -56,7 +56,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 private final File file; - private final Map map = Maps.newHashMap(); + // Paper - replace HashMap is ConcurrentHashMap -+ private final Map map = Maps.newConcurrentMap(); private final Map getBackingMap() { return this.map; } // Paper - OBFHELPER ++ private final Map map = Maps.newConcurrentMap(); + private boolean e = true; + private static final ParameterizedType f = new ParameterizedType() { + public Type[] getActualTypeArguments() { @@ -83,7 +83,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 + // Paper start + // this.g(); + // return (V) this.d.get(this.a(k0)); // CraftBukkit - fix decompile error -+ return (V) this.getBackingMap().computeIfPresent(this.getKeyForUser(key), (k, v) -> { ++ return (V) this.map.computeIfPresent(this.getKeyForUser(key), (k, v) -> { + return v.hasExpired() ? null : v; + }); + // Paper end @@ -96,7 +96,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 public boolean isEmpty() { - return this.map.size() < 1; + // return this.d.size() < 1; // Paper -+ return this.getBackingMap().isEmpty(); // Paper - readability is the goal. As an aside, isEmpty() uses only sumCount() and a comparison. size() uses sumCount(), casts, and boolean logic ++ return this.map.isEmpty(); // Paper - readability is the goal. As an aside, isEmpty() uses only sumCount() and a comparison. size() uses sumCount(), casts, and boolean logic } protected String getKeyForUser(K profile) { @@ -127,7 +127,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 + this.d.remove(this.a(k0)); + }*/ -+ this.getBackingMap().values().removeIf(StoredUserEntry::hasExpired); ++ this.map.values().removeIf(StoredUserEntry::hasExpired); + // Paper end } diff --git a/patches/server/Use-distance-map-to-optimise-entity-tracker.patch b/patches/server/Use-distance-map-to-optimise-entity-tracker.patch index 5c194be9ac..5b77fa2478 100644 --- a/patches/server/Use-distance-map-to-optimise-entity-tracker.patch +++ b/patches/server/Use-distance-map-to-optimise-entity-tracker.patch @@ -5,18 +5,6 @@ Subject: [PATCH] Use distance map to optimise entity tracker Use the distance map to find candidate players for tracking. -diff --git a/src/main/java/net/minecraft/server/MinecraftServer.java b/src/main/java/net/minecraft/server/MinecraftServer.java -index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644 ---- a/src/main/java/net/minecraft/server/MinecraftServer.java -+++ b/src/main/java/net/minecraft/server/MinecraftServer.java -@@ -0,0 +0,0 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop