cleanup bugfix patch

This commit is contained in:
Lulu13022002 2024-10-29 16:54:40 +01:00
parent 49eae0d5fb
commit d576cfc234
No known key found for this signature in database
GPG key ID: 491C8F0B8ACDEB01
16 changed files with 45 additions and 67 deletions

View file

@ -5166,7 +5166,7 @@ index 59bc334ade71c106e01e54db8d21fb65563dd3f1..b9ab241b930edc63a39dbbcf14cd0b5e
}
diff --git a/src/main/java/net/minecraft/server/level/ChunkMap.java b/src/main/java/net/minecraft/server/level/ChunkMap.java
index 952936754cbe5a6fae543d19432599e30eb495b0..3bb6eaabe8f62b556a52b83227b48f8324a9d0f0 100644
index ad2d29b106df33965090be521d4f945601965a00..261943f1f188643793a72bd239dfc5fe604e3b99 100644
--- a/src/main/java/net/minecraft/server/level/ChunkMap.java
+++ b/src/main/java/net/minecraft/server/level/ChunkMap.java
@@ -174,6 +174,12 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider

View file

@ -9,7 +9,7 @@ from triggering monster spawns on a server.
Also a highly more effecient way to blanket block spawns in a world
diff --git a/src/main/java/net/minecraft/server/level/ChunkMap.java b/src/main/java/net/minecraft/server/level/ChunkMap.java
index 3bb6eaabe8f62b556a52b83227b48f8324a9d0f0..b8aff86c8533ea92b0244ea85ed786073c4053a8 100644
index 261943f1f188643793a72bd239dfc5fe604e3b99..985ba48a5ac027d3c3dcd9b710b53748508966fb 100644
--- a/src/main/java/net/minecraft/server/level/ChunkMap.java
+++ b/src/main/java/net/minecraft/server/level/ChunkMap.java
@@ -1098,7 +1098,9 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider

View file

@ -8,7 +8,7 @@ Sets tracking range of watermobs to animals instead of misc and simplifies code
Also ignores Enderdragon, defaulting it to Mojang's setting
diff --git a/src/main/java/net/minecraft/server/level/ChunkMap.java b/src/main/java/net/minecraft/server/level/ChunkMap.java
index b8aff86c8533ea92b0244ea85ed786073c4053a8..0c5eb6ee56710b1ff71714b2090fbccd6da8456b 100644
index 985ba48a5ac027d3c3dcd9b710b53748508966fb..5f85d7f7ec57fc1b0375e62a8e8e3e8783f34193 100644
--- a/src/main/java/net/minecraft/server/level/ChunkMap.java
+++ b/src/main/java/net/minecraft/server/level/ChunkMap.java
@@ -1598,6 +1598,7 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider

View file

@ -7,7 +7,7 @@ Suspected case would be around the technique used in .stopRiding
Stack will identify any causer of this and warn instead of crashing.
diff --git a/src/main/java/net/minecraft/server/level/ChunkMap.java b/src/main/java/net/minecraft/server/level/ChunkMap.java
index 0c5eb6ee56710b1ff71714b2090fbccd6da8456b..5963f38e050c1ea5c77dde91028d306dfe9b94ba 100644
index 5f85d7f7ec57fc1b0375e62a8e8e3e8783f34193..396310a51480cf0d1ea4c0959d3f8e4ed77b99e3 100644
--- a/src/main/java/net/minecraft/server/level/ChunkMap.java
+++ b/src/main/java/net/minecraft/server/level/ChunkMap.java
@@ -1298,6 +1298,13 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider

View file

@ -31,7 +31,7 @@ delays anymore.
public net.minecraft.server.level.ChunkMap addEntity(Lnet/minecraft/world/entity/Entity;)V
diff --git a/src/main/java/net/minecraft/server/level/ChunkMap.java b/src/main/java/net/minecraft/server/level/ChunkMap.java
index 5963f38e050c1ea5c77dde91028d306dfe9b94ba..352675e0b835d5f04576db6599e8840754a40340 100644
index 396310a51480cf0d1ea4c0959d3f8e4ed77b99e3..0f8fc275af95750871aa6917aa12053f75c112f7 100644
--- a/src/main/java/net/minecraft/server/level/ChunkMap.java
+++ b/src/main/java/net/minecraft/server/level/ChunkMap.java
@@ -1305,6 +1305,7 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider

View file

@ -7,7 +7,7 @@ Reference2BooleanOpenHashMap is going to have
better lookups than HashMap.
diff --git a/src/main/java/net/minecraft/server/level/ChunkMap.java b/src/main/java/net/minecraft/server/level/ChunkMap.java
index 352675e0b835d5f04576db6599e8840754a40340..b92a889d0b0c46c1fa247d770f303d7d37dfc36c 100644
index 0f8fc275af95750871aa6917aa12053f75c112f7..51a6735b35e73175680e61c2d67d4adbedf305c9 100644
--- a/src/main/java/net/minecraft/server/level/ChunkMap.java
+++ b/src/main/java/net/minecraft/server/level/ChunkMap.java
@@ -1514,7 +1514,7 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider

View file

@ -28,9 +28,6 @@ https://bugs.mojang.com/browse/MC-259571
https://bugs.mojang.com/browse/MC-262422
Fix lightning being able to hit spectators
https://bugs.mojang.com/browse/MC-224454
Fix mobs attempting to pathfind through azalea blocks
https://bugs.mojang.com/browse/MC-263999
Fix mobs breaking doors not spawning block break particles
@ -60,6 +57,7 @@ https://bugs.mojang.com/browse/MC-273635
== AT ==
public net/minecraft/world/entity/Mob leashInfoTag
public net/minecraft/server/level/ChunkMap anyPlayerCloseEnoughForSpawning(Lnet/minecraft/world/level/ChunkPos;)Z
Co-authored-by: William Blake Galbreath <blake.galbreath@gmail.com>
Co-authored-by: Spottedleaf <Spottedleaf@users.noreply.github.com>
@ -90,19 +88,6 @@ index 6854ca4d4fec2b4fa541c3fabf63787665572609..e7b444a10b244828827b3c66c5346520
}
}
diff --git a/src/main/java/net/minecraft/server/level/ChunkMap.java b/src/main/java/net/minecraft/server/level/ChunkMap.java
index b92a889d0b0c46c1fa247d770f303d7d37dfc36c..e1c69c3c8e4809c7ccd2e1e12ee8538ab4bd3d5c 100644
--- a/src/main/java/net/minecraft/server/level/ChunkMap.java
+++ b/src/main/java/net/minecraft/server/level/ChunkMap.java
@@ -1078,7 +1078,7 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider
}
- boolean anyPlayerCloseEnoughForSpawning(ChunkPos pos) {
+ public boolean anyPlayerCloseEnoughForSpawning(ChunkPos pos) { // Paper - public
// Spigot start
return this.anyPlayerCloseEnoughForSpawning(pos, false);
}
diff --git a/src/main/java/net/minecraft/server/level/ServerLevel.java b/src/main/java/net/minecraft/server/level/ServerLevel.java
index f3f93e8cbc2a5c9d0a3841ec7de010477bfd976a..d01f42aad003c7b0ea5700d32109eed4a264fa4c 100644
--- a/src/main/java/net/minecraft/server/level/ServerLevel.java
@ -235,7 +220,7 @@ index 14b47d6fa189f2a666b12ef7e7708d204c2b0452..4c6dc427b90012b0945e073dd905dc7e
}
diff --git a/src/main/java/net/minecraft/world/entity/decoration/ItemFrame.java b/src/main/java/net/minecraft/world/entity/decoration/ItemFrame.java
index 30af4cbb17148c247a46c0346419d6c838dbc9d2..65f7f1f98f415a564aadb440d3a67143699e43db 100644
index 30af4cbb17148c247a46c0346419d6c838dbc9d2..d431ee93cd7e87a24ff4079288facd089053d725 100644
--- a/src/main/java/net/minecraft/world/entity/decoration/ItemFrame.java
+++ b/src/main/java/net/minecraft/world/entity/decoration/ItemFrame.java
@@ -272,6 +272,14 @@ public class ItemFrame extends HangingEntity {
@ -246,7 +231,7 @@ index 30af4cbb17148c247a46c0346419d6c838dbc9d2..65f7f1f98f415a564aadb440d3a67143
+ @Nullable
+ @Override
+ public net.minecraft.world.entity.item.ItemEntity spawnAtLocation(ServerLevel serverLevel, ItemStack stack) {
+ return this.spawnAtLocation(serverLevel, stack, getDirection().equals(Direction.DOWN) ? -0.6F : 0.0F);
+ return this.spawnAtLocation(serverLevel, stack, this.getDirection() == Direction.DOWN ? -0.6F : 0.0F);
+ }
+ // Paper end
+
@ -335,54 +320,25 @@ index 8aab6f68f576fb022eb59798585e264f5aafbc69..edd6017937a7f20a1b43fa15204ec130
}
diff --git a/src/main/java/net/minecraft/world/level/block/entity/trialspawner/TrialSpawnerData.java b/src/main/java/net/minecraft/world/level/block/entity/trialspawner/TrialSpawnerData.java
index e64a30577e9000e5c4d22fd3d9cf8a9381c5c459..b9690f31d410e82d833b2ca805df2fa68abcb6d1 100644
index e64a30577e9000e5c4d22fd3d9cf8a9381c5c459..a49f83784f85f5420091692aae588ef067aa5fcd 100644
--- a/src/main/java/net/minecraft/world/level/block/entity/trialspawner/TrialSpawnerData.java
+++ b/src/main/java/net/minecraft/world/level/block/entity/trialspawner/TrialSpawnerData.java
@@ -101,17 +101,19 @@ public class TrialSpawnerData {
@@ -101,9 +101,9 @@ public class TrialSpawnerData {
this.ejectingLootTable = rewardLootTable;
}
- public void reset() {
+ public void reset(TrialSpawner logic) { // Paper - Fix TrialSpawner forgets assigned mob; MC-273635
this.currentMobs.clear();
this.nextSpawnData = Optional.empty();
- this.resetStatistics();
+ this.resetStatistics(logic);
}
- public void resetStatistics() {
+ public void resetStatistics(TrialSpawner logic) { // Paper - Fix TrialSpawner forgets assigned mob; MC-273635
this.detectedPlayers.clear();
this.totalMobsSpawned = 0;
this.nextMobSpawnsAt = 0L;
this.cooldownEndsAt = 0L;
+ this.nextSpawnData = Optional.empty();
- this.nextSpawnData = Optional.empty();
+ if (!logic.getConfig().spawnPotentialsDefinition().isEmpty()) this.nextSpawnData = Optional.empty(); // Paper - Fix TrialSpawner forgets assigned mob; MC-273635
this.resetStatistics();
}
public boolean hasMobToSpawn(TrialSpawner logic, RandomSource random) {
diff --git a/src/main/java/net/minecraft/world/level/block/entity/trialspawner/TrialSpawnerState.java b/src/main/java/net/minecraft/world/level/block/entity/trialspawner/TrialSpawnerState.java
index 83cdeee5e2ce115ff696a5afc5465dc4301779b9..027d5c4117feba1e152d0ecf9923aef77ba72207 100644
index 83cdeee5e2ce115ff696a5afc5465dc4301779b9..192ee216b617d3533f592e62719b6d75d20b5a96 100644
--- a/src/main/java/net/minecraft/world/level/block/entity/trialspawner/TrialSpawnerState.java
+++ b/src/main/java/net/minecraft/world/level/block/entity/trialspawner/TrialSpawnerState.java
@@ -68,7 +68,7 @@ public enum TrialSpawnerState implements StringRepresentable {
case INACTIVE -> trialSpawnerData.getOrCreateDisplayEntity(logic, world, WAITING_FOR_PLAYERS) == null ? this : WAITING_FOR_PLAYERS;
case WAITING_FOR_PLAYERS -> {
if (!logic.canSpawnInLevel(world)) {
- trialSpawnerData.resetStatistics();
+ trialSpawnerData.resetStatistics(logic); // Paper - Fix TrialSpawner forgets assigned mob; MC-273635
yield this;
} else if (!trialSpawnerData.hasMobToSpawn(logic, world.random)) {
yield INACTIVE;
@@ -79,7 +79,7 @@ public enum TrialSpawnerState implements StringRepresentable {
}
case ACTIVE -> {
if (!logic.canSpawnInLevel(world)) {
- trialSpawnerData.resetStatistics();
+ trialSpawnerData.resetStatistics(logic); // Paper - Fix TrialSpawner forgets assigned mob; MC-273635
yield WAITING_FOR_PLAYERS;
} else if (!trialSpawnerData.hasMobToSpawn(logic, world.random)) {
yield INACTIVE;
@@ -145,7 +145,7 @@ public enum TrialSpawnerState implements StringRepresentable {
yield ACTIVE;
} else if (trialSpawnerData.isCooldownFinished(world)) {
@ -392,3 +348,25 @@ index 83cdeee5e2ce115ff696a5afc5465dc4301779b9..027d5c4117feba1e152d0ecf9923aef7
yield WAITING_FOR_PLAYERS;
} else {
yield this;
diff --git a/src/main/java/net/minecraft/world/level/portal/TeleportTransition.java b/src/main/java/net/minecraft/world/level/portal/TeleportTransition.java
index cf27b0d6a9fe53b9f91090db4740776b335a2e9b..7d5909431f98f7e8b84d740bba9c044fec6d8e96 100644
--- a/src/main/java/net/minecraft/world/level/portal/TeleportTransition.java
+++ b/src/main/java/net/minecraft/world/level/portal/TeleportTransition.java
@@ -53,7 +53,7 @@ public record TeleportTransition(ServerLevel newLevel, Vec3 position, Vec3 delta
}
public TeleportTransition(ServerLevel worldserver, Entity entity, TeleportTransition.PostTeleportTransition teleporttransition_a, PlayerTeleportEvent.TeleportCause cause) {
- this(worldserver, findAdjustedSharedSpawnPos(worldserver, entity), Vec3.ZERO, 0.0F, 0.0F, false, false, Set.of(), teleporttransition_a, cause);
+ this(worldserver, findAdjustedSharedSpawnPos(worldserver, entity), Vec3.ZERO, worldserver.getSharedSpawnAngle(), 0.0F, false, false, Set.of(), teleporttransition_a, cause); // Paper - MC-200092 - fix first spawn pos yaw being ignored
// CraftBukkit end
}
@@ -69,7 +69,7 @@ public record TeleportTransition(ServerLevel newLevel, Vec3 position, Vec3 delta
}
public static TeleportTransition missingRespawnBlock(ServerLevel world, Entity entity, TeleportTransition.PostTeleportTransition postDimensionTransition) {
- return new TeleportTransition(world, findAdjustedSharedSpawnPos(world, entity), Vec3.ZERO, 0.0F, 0.0F, true, false, Set.of(), postDimensionTransition);
+ return new TeleportTransition(world, findAdjustedSharedSpawnPos(world, entity), Vec3.ZERO, world.getSharedSpawnAngle(), 0.0F, true, false, Set.of(), postDimensionTransition); // Paper - MC-200092 - fix spawn pos yaw being ignored
}
private static Vec3 findAdjustedSharedSpawnPos(ServerLevel world, Entity entity) {

View file

@ -5,7 +5,7 @@ Subject: [PATCH] Player Entity Tracking Events
diff --git a/src/main/java/net/minecraft/server/level/ChunkMap.java b/src/main/java/net/minecraft/server/level/ChunkMap.java
index e1c69c3c8e4809c7ccd2e1e12ee8538ab4bd3d5c..53e180e230d5a1652f3e19193243c37095d6b39e 100644
index 51a6735b35e73175680e61c2d67d4adbedf305c9..8b5d11aceb77135c917c3581f4db792ef4b647ec 100644
--- a/src/main/java/net/minecraft/server/level/ChunkMap.java
+++ b/src/main/java/net/minecraft/server/level/ChunkMap.java
@@ -1586,7 +1586,11 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider

View file

@ -18,7 +18,7 @@ index 3cdcc4f44608d24550f2a8c6f3f5ce675d7777c5..7118e1f806af98159ec292f9340d7e40
if (worldmap != null) {
diff --git a/src/main/java/net/minecraft/world/entity/decoration/ItemFrame.java b/src/main/java/net/minecraft/world/entity/decoration/ItemFrame.java
index 65f7f1f98f415a564aadb440d3a67143699e43db..d6f835320014c07f9d174d05929ed8cc16a10c10 100644
index d431ee93cd7e87a24ff4079288facd089053d725..bbdaaa1cc0b4aed28bc39385508d221055b99d4d 100644
--- a/src/main/java/net/minecraft/world/entity/decoration/ItemFrame.java
+++ b/src/main/java/net/minecraft/world/entity/decoration/ItemFrame.java
@@ -51,6 +51,7 @@ public class ItemFrame extends HangingEntity {

View file

@ -6,7 +6,7 @@ Subject: [PATCH] Configurable entity tracking range by Y coordinate
Options to configure entity tracking by Y coordinate, also for each entity category.
diff --git a/src/main/java/net/minecraft/server/level/ChunkMap.java b/src/main/java/net/minecraft/server/level/ChunkMap.java
index 53e180e230d5a1652f3e19193243c37095d6b39e..5da3eee41ba0cbec5932cf9a7dac53777a2463fb 100644
index 8b5d11aceb77135c917c3581f4db792ef4b647ec..5b993cb8a99c6a0257b9d3d93162f9b2fff552b0 100644
--- a/src/main/java/net/minecraft/server/level/ChunkMap.java
+++ b/src/main/java/net/minecraft/server/level/ChunkMap.java
@@ -1577,7 +1577,17 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider

View file

@ -5,7 +5,7 @@ Subject: [PATCH] Don't check if we can see non-visible entities
diff --git a/src/main/java/net/minecraft/server/level/ChunkMap.java b/src/main/java/net/minecraft/server/level/ChunkMap.java
index 5da3eee41ba0cbec5932cf9a7dac53777a2463fb..bf6d5f9e23387da845d6fe246c9013ec4d13cfb1 100644
index 5b993cb8a99c6a0257b9d3d93162f9b2fff552b0..7483f9f2639c58a4f43e264211791f4377e1db64 100644
--- a/src/main/java/net/minecraft/server/level/ChunkMap.java
+++ b/src/main/java/net/minecraft/server/level/ChunkMap.java
@@ -1590,7 +1590,7 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider

View file

@ -18,7 +18,7 @@ index a043ac10834562d357ef0b5aded2e916e2a0d056..74276c368016fcc4dbf9579b2ecbadc9
@VisibleForTesting
static long encode(double value) {
diff --git a/src/main/java/net/minecraft/server/level/ChunkMap.java b/src/main/java/net/minecraft/server/level/ChunkMap.java
index bf6d5f9e23387da845d6fe246c9013ec4d13cfb1..9b64dfe8f1727519673cc87be2398d43601e68ef 100644
index 7483f9f2639c58a4f43e264211791f4377e1db64..7317c353edab8b11d9d94e257f968ac49284f47a 100644
--- a/src/main/java/net/minecraft/server/level/ChunkMap.java
+++ b/src/main/java/net/minecraft/server/level/ChunkMap.java
@@ -1572,10 +1572,14 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider

View file

@ -24141,7 +24141,7 @@ index d9ad32acdf46a43a649334a3b736aeb7b3af21d1..fae17a075d7efaf24d916877dd5968eb
public static final int RADIUS_AROUND_FULL_CHUNK = FULL_CHUNK_STEP.accumulatedDependencies().getRadius();
public static final int MAX_LEVEL = 33 + RADIUS_AROUND_FULL_CHUNK;
diff --git a/src/main/java/net/minecraft/server/level/ChunkMap.java b/src/main/java/net/minecraft/server/level/ChunkMap.java
index 9b64dfe8f1727519673cc87be2398d43601e68ef..c11ba8d9e97a68cda1811b570f0df117e6c38138 100644
index 7317c353edab8b11d9d94e257f968ac49284f47a..cb3850939955ae068d4776c835522e0b8f228984 100644
--- a/src/main/java/net/minecraft/server/level/ChunkMap.java
+++ b/src/main/java/net/minecraft/server/level/ChunkMap.java
@@ -108,7 +108,7 @@ import org.slf4j.Logger;

View file

@ -48,7 +48,7 @@ index f6e1deb2f849d8b01b15cfa69e2f6cd5f2b1512b..f66e40326c510aa3267542b1a24ed75d
entityTrackerEntry.getLastSentYRot(),
entity.getType(),
diff --git a/src/main/java/net/minecraft/server/level/ChunkMap.java b/src/main/java/net/minecraft/server/level/ChunkMap.java
index c11ba8d9e97a68cda1811b570f0df117e6c38138..c7a9a22d84583764fc1cbcc1bdeb01a339d33687 100644
index cb3850939955ae068d4776c835522e0b8f228984..f1999729cd1c00071c5e1835ee49ea5fcafa7b05 100644
--- a/src/main/java/net/minecraft/server/level/ChunkMap.java
+++ b/src/main/java/net/minecraft/server/level/ChunkMap.java
@@ -1271,6 +1271,7 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider

View file

@ -5,7 +5,7 @@ Subject: [PATCH] Optional per player mob spawns
diff --git a/src/main/java/net/minecraft/server/level/ChunkMap.java b/src/main/java/net/minecraft/server/level/ChunkMap.java
index c7a9a22d84583764fc1cbcc1bdeb01a339d33687..c9e5df9a598a1211aeba88920e774b0f765b3a14 100644
index f1999729cd1c00071c5e1835ee49ea5fcafa7b05..4896c3ba81ead769972fa9efdbe563d4006e4401 100644
--- a/src/main/java/net/minecraft/server/level/ChunkMap.java
+++ b/src/main/java/net/minecraft/server/level/ChunkMap.java
@@ -229,8 +229,26 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider

View file

@ -6,7 +6,7 @@ Subject: [PATCH] Improve cancelling PreCreatureSpawnEvent with per player mob
diff --git a/src/main/java/net/minecraft/server/level/ChunkMap.java b/src/main/java/net/minecraft/server/level/ChunkMap.java
index c9e5df9a598a1211aeba88920e774b0f765b3a14..f4b578c7f839f58da265f2cbcb53e5654ca3edc8 100644
index 4896c3ba81ead769972fa9efdbe563d4006e4401..5b3a886c624b36557cbfaccdc3fb05a46a4ba36a 100644
--- a/src/main/java/net/minecraft/server/level/ChunkMap.java
+++ b/src/main/java/net/minecraft/server/level/ChunkMap.java
@@ -246,8 +246,25 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider