even more work

This commit is contained in:
Aurora 2021-06-13 16:14:18 +02:00
parent 0ea382b41d
commit 8af12b17c1
No known key found for this signature in database
GPG key ID: 89839F67B53656AD
16 changed files with 40 additions and 38 deletions

View file

@ -2,7 +2,7 @@ From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: Aikar <aikar@aikar.co>
Date: Fri, 29 May 2020 20:29:02 -0400
Subject: [PATCH] Synchronize DataPaletteBlock instead of ReentrantLock
1.17: Mini have fun I don't want to die
Mojang has flaws in their logic about chunks being concurrently
wrote to. So we constantly see crashes around multiple threads writing.

View file

@ -2,7 +2,7 @@ From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: Shane Freeder <theboyetronic@gmail.com>
Date: Sun, 9 Jun 2019 03:53:22 +0100
Subject: [PATCH] incremental chunk saving
1.17: saved for MM
diff --git a/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java b/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java
index ffe9b1a63d78925e1d77b9e730aef42fed6d58fa..1278d09f70c1e97607ef20d87a178dc252c7f723 100644

View file

@ -2,7 +2,9 @@ From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: stonar96 <minecraft.stonar96@gmail.com>
Date: Mon, 20 Aug 2018 03:03:58 +0200
Subject: [PATCH] Anti-Xray
stonar96 — Today at 15:49
I'm just here to watch you suffer :smile:
You can skip it if you want and I can do it later.
diff --git a/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java b/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java
index 1278d09f70c1e97607ef20d87a178dc252c7f723..c45493e88bf7e8811be2759ff9ac19e3fe9d938a 100644

View file

@ -2,7 +2,7 @@ From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: Shane Freeder <theboyetronic@gmail.com>
Date: Sun, 28 Jul 2019 00:51:11 +0100
Subject: [PATCH] Mark entities as being ticked when notifying navigation
1.17: Check how this is done after rework
diff --git a/src/main/java/net/minecraft/server/level/ServerLevel.java b/src/main/java/net/minecraft/server/level/ServerLevel.java
index 7a09bc921827958f58290bd3d6f19984bb34a8f6..a811ced17721b70bb51837f47e466c2261db2466 100644

View file

@ -2,7 +2,7 @@ From 0000000000000000000000000000000000000000 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
1.17: figure this out after methods got moved
Hoppers searching for items and minecarts is the most expensive part of hopper ticking.
We keep track of the number of minecarts and items in a chunk.
If there are no items in the chunk, we skip searching for items.

View file

@ -2,7 +2,7 @@ From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: Spottedleaf <Spottedleaf@users.noreply.github.com>
Date: Mon, 8 Jul 2019 00:13:36 -0700
Subject: [PATCH] Use getChunkIfLoadedImmediately in places
1.17: figure out moved entitiy stuff again
This prevents us from hitting chunk loads for chunks at or less-than
ticket level 33 (yes getChunkIfLoaded will actually perform a chunk
load in that case).

View file

@ -2,7 +2,7 @@ From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: Spottedleaf <Spottedleaf@users.noreply.github.com>
Date: Fri, 19 Jul 2019 03:29:14 -0700
Subject: [PATCH] Reduce sync loads
1.17: more entity stuff that someone has to figure out!
This reduces calls to getChunkAt which would load chunks.
This patch also adds a tool to find calls which are doing this, however

View file

@ -2,7 +2,7 @@ From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: kickash32 <kickash32@gmail.com>
Date: Mon, 3 Jun 2019 02:02:39 -0400
Subject: [PATCH] Implement alternative item-despawn-rate
1.17: kickash32 want's to do that later
diff --git a/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java b/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java
index 1ee2cced100626e48eb36ee14f84b9257c79a2f8..b913cd2dd0cd1b369b3f7b5a9d8b1be73f6d7920 100644

View file

@ -2,7 +2,7 @@ From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: kickash32 <kickash32@gmail.com>
Date: Mon, 19 Aug 2019 01:27:58 +0500
Subject: [PATCH] implement optional per player mob spawns
1.17: kickash will take a look at this; has to be figured out again because of changes
diff --git a/src/main/java/co/aikar/timings/WorldTimingsHandler.java b/src/main/java/co/aikar/timings/WorldTimingsHandler.java
index 24eac9400fbf971742e89bbf47b0ba52b587c4eb..b818a7451d45d2ab7d4678f0065ada9017d8a631 100644

View file

@ -5,7 +5,7 @@ Subject: [PATCH] Show blockstate location if we failed to read it
diff --git a/src/main/java/org/bukkit/craftbukkit/block/CraftBlockEntityState.java b/src/main/java/org/bukkit/craftbukkit/block/CraftBlockEntityState.java
index 730fda7f0bf02400d349959e9cc2aafaed000b21..66aee7635cd9260d97ae9dd2e9a2a0590fe3c433 100644
index 9a30770a2f68e1253afe3ca8ecdae19c988248f9..2b2c9e58eabe148c994152d2596e29a313be921b 100644
--- a/src/main/java/org/bukkit/craftbukkit/block/CraftBlockEntityState.java
+++ b/src/main/java/org/bukkit/craftbukkit/block/CraftBlockEntityState.java
@@ -19,6 +19,8 @@ public class CraftBlockEntityState<T extends BlockEntity> extends CraftBlockStat

View file

@ -17,13 +17,14 @@ This should fully solve all of the issues around it so that only natural
influences natural spawns.
diff --git a/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java b/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java
index c45493e88bf7e8811be2759ff9ac19e3fe9d938a..384cb363eed794551bee6b0ec11ba1be92a3d7ac 100644
index 090958a30ce20ff01ae77d4cd821a167474f0214..baf33659b021c89cbd02560cbfd9b0ddf205f0e2 100644
--- a/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java
+++ b/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java
@@ -464,6 +464,16 @@ public class PaperWorldConfig {
maxAutoSaveChunksPerTick = getInt("max-auto-save-chunks-per-tick", 24);
@@ -401,4 +401,15 @@ public class PaperWorldConfig {
private void preventMovingIntoUnloadedChunks() {
preventMovingIntoUnloadedChunks = getBoolean("prevent-moving-into-unloaded-chunks", false);
}
+
+ public boolean countAllMobsForSpawning = false;
+ private void countAllMobsForSpawning() {
+ countAllMobsForSpawning = getBoolean("count-all-mobs-for-spawning", false);
@ -33,15 +34,13 @@ index c45493e88bf7e8811be2759ff9ac19e3fe9d938a..384cb363eed794551bee6b0ec11ba1be
+ log("Using improved mob spawn limits (Only Natural Spawns impact spawn limits for more natural spawns)");
+ }
+ }
}
+
public boolean antiXray;
public EngineMode engineMode;
public int maxChunkSectionIndex;
diff --git a/src/main/java/net/minecraft/world/level/NaturalSpawner.java b/src/main/java/net/minecraft/world/level/NaturalSpawner.java
index e23875ae07c23fed1161ea070e63bbc3a30168a0..0fb69f9194078e5e05e36ed909eb48424b6465b4 100644
index 30ba1e3cb75d994770b006b9dfd6669000a9c1a4..e20a645e28a2e503c02b2bd89424e95506a2e6df 100644
--- a/src/main/java/net/minecraft/world/level/NaturalSpawner.java
+++ b/src/main/java/net/minecraft/world/level/NaturalSpawner.java
@@ -79,6 +79,13 @@ public final class NaturalSpawner {
@@ -85,6 +85,13 @@ public final class NaturalSpawner {
MobCategory enumcreaturetype = entity.getType().getCategory();
if (enumcreaturetype != MobCategory.MISC) {
@ -53,5 +52,5 @@ index e23875ae07c23fed1161ea070e63bbc3a30168a0..0fb69f9194078e5e05e36ed909eb4842
+ }
+ // Paper end
BlockPos blockposition = entity.blockPosition();
long j = ChunkPos.asLong(blockposition.getX() >> 4, blockposition.getZ() >> 4);
long j = ChunkPos.asLong(SectionPos.blockToSectionCoord(blockposition.getX()), SectionPos.blockToSectionCoord(blockposition.getZ()));

View file

@ -25,11 +25,11 @@ P3) Solutions for 1) and especially 2) might not be future-proof, while this
server-internal fix makes this change future-proof.
diff --git a/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java b/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java
index 384cb363eed794551bee6b0ec11ba1be92a3d7ac..1ee2cced100626e48eb36ee14f84b9257c79a2f8 100644
index baf33659b021c89cbd02560cbfd9b0ddf205f0e2..4c177a383b277debe8a7c02a70d029d862e6b048 100644
--- a/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java
+++ b/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java
@@ -507,4 +507,9 @@ public class PaperWorldConfig {
Bukkit.getLogger().warning("You have enabled permission-based Anti-Xray checking - depending on your permission plugin, this may cause performance issues");
@@ -411,5 +411,10 @@ public class PaperWorldConfig {
log("Using improved mob spawn limits (Only Natural Spawns impact spawn limits for more natural spawns)");
}
}
+
@ -38,11 +38,12 @@ index 384cb363eed794551bee6b0ec11ba1be92a3d7ac..1ee2cced100626e48eb36ee14f84b925
+ disableRelativeProjectileVelocity = getBoolean("game-mechanics.disable-relative-projectile-velocity", false);
+ }
}
diff --git a/src/main/java/net/minecraft/world/entity/projectile/Projectile.java b/src/main/java/net/minecraft/world/entity/projectile/Projectile.java
index d385fb6eee5000951c350b6ced5669dc3dcce725..ca3d936433cd47caa4e0335e41246b1c4ce0eb99 100644
index 7311923d36ee872b4331d84f80709bb6cee61086..69f439851fe1ff07d827eaed274940a5783d5f6c 100644
--- a/src/main/java/net/minecraft/world/entity/projectile/Projectile.java
+++ b/src/main/java/net/minecraft/world/entity/projectile/Projectile.java
@@ -129,7 +129,7 @@ public abstract class Projectile extends Entity {
@@ -161,7 +161,7 @@ public abstract class Projectile extends Entity {
this.shoot((double) f5, (double) f6, (double) f7, modifierZ, modifierXYZ);
Vec3 vec3d = user.getDeltaMovement();

View file

@ -5,7 +5,7 @@ Subject: [PATCH] offset item frame ticking
diff --git a/src/main/java/net/minecraft/world/entity/decoration/HangingEntity.java b/src/main/java/net/minecraft/world/entity/decoration/HangingEntity.java
index e0bf8c6c838b18a0c55b6f3317033e892b631f5c..3277a56bcf3831f8d3c9fa9168c608b369eed7e4 100644
index acea1c03afb5b3e522edb072fd1c3f9b5c3edccc..ca9decf85dd1af0baf0d34a48aa67cbb9f4eb586 100644
--- a/src/main/java/net/minecraft/world/entity/decoration/HangingEntity.java
+++ b/src/main/java/net/minecraft/world/entity/decoration/HangingEntity.java
@@ -35,7 +35,7 @@ public abstract class HangingEntity extends Entity {

View file

@ -7,13 +7,13 @@ If the Bukkit generator already has a spawn, use it immediately instead
of spending time generating one that we won't use
diff --git a/src/main/java/net/minecraft/server/MinecraftServer.java b/src/main/java/net/minecraft/server/MinecraftServer.java
index 643d75b999c3da006eaaab11f4acd77e807683d4..753e6f609189c589514739bea80007bace3c89d2 100644
index 40e48c3f1199b127066732e3c8a6d40c232215b2..f00839eab02277bf10b742c88fadc4aa9e89e7e0 100644
--- a/src/main/java/net/minecraft/server/MinecraftServer.java
+++ b/src/main/java/net/minecraft/server/MinecraftServer.java
@@ -628,12 +628,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
} else if (debugWorld) {
iworlddataserver.setSpawn(BlockPos.ZERO.above(), 0.0F);
@@ -678,12 +678,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
worldProperties.setSpawn(BlockPos.ZERO.above(80), 0.0F);
} else {
ChunkGenerator chunkgenerator = world.getChunkSource().getGenerator();
- BiomeSource worldchunkmanager = chunkgenerator.getBiomeSource();
- Random random = new Random(world.getSeed());
- BlockPos blockposition = worldchunkmanager.findBiomeHorizontal(0, world.getSeaLevel(), 0, 256, (biomebase) -> {
@ -24,7 +24,7 @@ index 643d75b999c3da006eaaab11f4acd77e807683d4..753e6f609189c589514739bea80007ba
// CraftBukkit start
if (world.generator != null) {
Random rand = new Random(world.getSeed());
@@ -649,6 +644,15 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
@@ -699,6 +694,15 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
}
}
// CraftBukkit end

View file

@ -7,14 +7,14 @@ The problem was we were checking isExpired() on the entry, but if it
was expired at that point, then it would be null.
diff --git a/src/main/java/net/minecraft/server/players/PlayerList.java b/src/main/java/net/minecraft/server/players/PlayerList.java
index 7412765020854caabd32fb6f4fffcf7f4bf6dba7..e6eebb8f6f48cc55fc8fb114c959b8fbec4b8472 100644
index c7956664427ca97544d1b47992a62c95d2fc9690..6f9bd5da1504af296e7ee2a69d8afdd3bc4cfd5e 100644
--- a/src/main/java/net/minecraft/server/players/PlayerList.java
+++ b/src/main/java/net/minecraft/server/players/PlayerList.java
@@ -603,8 +603,10 @@ public abstract class PlayerList {
@@ -599,8 +599,10 @@ public abstract class PlayerList {
Player player = entity.getBukkitEntity();
PlayerLoginEvent event = new PlayerLoginEvent(player, hostname, ((java.net.InetSocketAddress) socketaddress).getAddress(), ((java.net.InetSocketAddress) loginlistener.connection.getRawAddress()).getAddress());
- if (getBans().isBanned(gameprofile) && !getBans().get(gameprofile).hasExpired()) {
- if (this.getBans().isBanned(gameprofile) && !this.getBans().get(gameprofile).hasExpired()) {
- UserBanListEntry gameprofilebanentry = (UserBanListEntry) this.bans.get(gameprofile);
+ // Paper start - Fix MC-158900
+ UserBanListEntry gameprofilebanentry;

View file

@ -5,10 +5,10 @@ Subject: [PATCH] Prevent consuming the wrong itemstack
diff --git a/src/main/java/net/minecraft/world/entity/LivingEntity.java b/src/main/java/net/minecraft/world/entity/LivingEntity.java
index 046a05925739005080af35c4be984303b575bf68..f8917123547615dd624e3e428ec1bf6450c7b7d8 100644
index 1dabdba428c10e65b634b6e2036f993c4be186a7..5def2e0379373b126a1b2281b0859b39443fc4ac 100644
--- a/src/main/java/net/minecraft/world/entity/LivingEntity.java
+++ b/src/main/java/net/minecraft/world/entity/LivingEntity.java
@@ -3198,15 +3198,18 @@ public abstract class LivingEntity extends Entity {
@@ -3548,15 +3548,18 @@ public abstract class LivingEntity extends Entity {
this.entityData.set(LivingEntity.DATA_LIVING_ENTITY_FLAGS, (byte) j);
}
@ -31,7 +31,7 @@ index 046a05925739005080af35c4be984303b575bf68..f8917123547615dd624e3e428ec1bf64
}
}
@@ -3279,6 +3282,7 @@ public abstract class LivingEntity extends Entity {
@@ -3629,6 +3632,7 @@ public abstract class LivingEntity extends Entity {
this.releaseUsingItem();
} else {
if (!this.useItem.isEmpty() && this.isUsingItem()) {
@ -39,7 +39,7 @@ index 046a05925739005080af35c4be984303b575bf68..f8917123547615dd624e3e428ec1bf64
this.triggerItemUseEffects(this.useItem, 16);
// CraftBukkit start - fire PlayerItemConsumeEvent
ItemStack itemstack;
@@ -3313,8 +3317,8 @@ public abstract class LivingEntity extends Entity {
@@ -3663,8 +3667,8 @@ public abstract class LivingEntity extends Entity {
}
this.stopUsingItem();