mirror of
https://github.com/PaperMC/Paper.git
synced 2024-11-25 03:55:14 +01:00
Patches!!!
This commit is contained in:
parent
46be245976
commit
25dc4afafa
@ -7,26 +7,25 @@ Plugins leaking scoreboards will make this very expensive,
|
||||
let server owners debug it easily
|
||||
|
||||
diff --git a/src/main/java/co/aikar/timings/MinecraftTimings.java b/src/main/java/co/aikar/timings/MinecraftTimings.java
|
||||
index 4d861f9a58f8ea238471af22f387854d855b1801..678a31fb85947ee8807d02d0fe4e11a73d2dafaa 100644
|
||||
index 4d861f9a58f8ea238471af22f387854d855b1801..e8aad2eecd8263118e3eca9e2be84a00277bc15e 100644
|
||||
--- a/src/main/java/co/aikar/timings/MinecraftTimings.java
|
||||
+++ b/src/main/java/co/aikar/timings/MinecraftTimings.java
|
||||
@@ -46,6 +46,8 @@ public final class MinecraftTimings {
|
||||
@@ -46,6 +46,7 @@ public final class MinecraftTimings {
|
||||
|
||||
public static final Timing antiXrayUpdateTimer = Timings.ofSafe("anti-xray - update");
|
||||
public static final Timing antiXrayObfuscateTimer = Timings.ofSafe("anti-xray - obfuscate");
|
||||
+ public static final Timing scoreboardScoreSearch = Timings.ofSafe("Scoreboard score search"); // Paper - add timings for scoreboard search
|
||||
+
|
||||
|
||||
private static final Map<Class<?>, String> taskNameCache = new MapMaker().weakKeys().makeMap();
|
||||
|
||||
diff --git a/src/main/java/org/bukkit/craftbukkit/scoreboard/CraftScoreboardManager.java b/src/main/java/org/bukkit/craftbukkit/scoreboard/CraftScoreboardManager.java
|
||||
index f06f011375b9be307a858ccb6579f74942b1d325..24c5e6e3dd41e72d22819964bc8e77f0ebc2d089 100644
|
||||
index c7ca6210d6ae37fe95068c9baa5fb654f95307e0..cad42a0f3c016bf65181e50d139ae4e2fb9158a5 100644
|
||||
--- a/src/main/java/org/bukkit/craftbukkit/scoreboard/CraftScoreboardManager.java
|
||||
+++ b/src/main/java/org/bukkit/craftbukkit/scoreboard/CraftScoreboardManager.java
|
||||
@@ -113,9 +113,18 @@ public final class CraftScoreboardManager implements ScoreboardManager {
|
||||
|
||||
// CraftBukkit method
|
||||
public void getScoreboardScores(ObjectiveCriteria criteria, String name, Consumer<Score> consumer) {
|
||||
public void forAllObjectives(ObjectiveCriteria criteria, ScoreHolder holder, Consumer<ScoreAccess> consumer) {
|
||||
+ // Paper start - add timings for scoreboard search
|
||||
+ // plugins leaking scoreboards will make this very expensive, let server owners debug it easily
|
||||
+ co.aikar.timings.MinecraftTimings.scoreboardScoreSearch.startTimingIfSync();
|
||||
@ -34,7 +33,7 @@ index f06f011375b9be307a858ccb6579f74942b1d325..24c5e6e3dd41e72d22819964bc8e77f0
|
||||
+ // Paper end - add timings for scoreboard search
|
||||
for (CraftScoreboard scoreboard : this.scoreboards) {
|
||||
Scoreboard board = scoreboard.board;
|
||||
board.forAllObjectives(criteria, name, (score) -> consumer.accept(score));
|
||||
board.forAllObjectives(criteria, holder, (score) -> consumer.accept(score));
|
||||
}
|
||||
+ } finally { // Paper start - add timings for scoreboard search
|
||||
+ co.aikar.timings.MinecraftTimings.scoreboardScoreSearch.stopTimingIfSync();
|
@ -6,35 +6,26 @@ Subject: [PATCH] Execute chunk tasks mid-tick
|
||||
This will help the server load chunks if tick times are high.
|
||||
|
||||
diff --git a/src/main/java/co/aikar/timings/MinecraftTimings.java b/src/main/java/co/aikar/timings/MinecraftTimings.java
|
||||
index 678a31fb85947ee8807d02d0fe4e11a73d2dafaa..0fc4feb00940079c4eb9554a3a48d19cbbeeb7bc 100644
|
||||
index e8aad2eecd8263118e3eca9e2be84a00277bc15e..190f6727351bc1d4e071da095d2f6365de095379 100644
|
||||
--- a/src/main/java/co/aikar/timings/MinecraftTimings.java
|
||||
+++ b/src/main/java/co/aikar/timings/MinecraftTimings.java
|
||||
@@ -49,6 +49,8 @@ public final class MinecraftTimings {
|
||||
@@ -48,6 +48,8 @@ public final class MinecraftTimings {
|
||||
public static final Timing antiXrayObfuscateTimer = Timings.ofSafe("anti-xray - obfuscate");
|
||||
public static final Timing scoreboardScoreSearch = Timings.ofSafe("Scoreboard score search"); // Paper - add timings for scoreboard search
|
||||
|
||||
|
||||
+ public static final Timing midTickChunkTasks = Timings.ofSafe("Mid Tick Chunk Tasks");
|
||||
+
|
||||
private static final Map<Class<?>, String> taskNameCache = new MapMaker().weakKeys().makeMap();
|
||||
|
||||
private MinecraftTimings() {}
|
||||
diff --git a/src/main/java/net/minecraft/server/MinecraftServer.java b/src/main/java/net/minecraft/server/MinecraftServer.java
|
||||
index d74313b58b660f3c03b8a6db4f80b6b073b6b795..f7c1d07c95f7b67e32bd6679af88612aec74f54f 100644
|
||||
index 6f17e5631aace53f75e6badf514dbb77c50065b9..0a23cfeaba071c2179de1931caa86bc46462c338 100644
|
||||
--- a/src/main/java/net/minecraft/server/MinecraftServer.java
|
||||
+++ b/src/main/java/net/minecraft/server/MinecraftServer.java
|
||||
@@ -1285,6 +1285,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
|
||||
|
||||
private boolean pollTaskInternal() {
|
||||
if (super.pollTask()) {
|
||||
+ this.executeMidTickTasks(); // Paper - execute chunk tasks mid tick
|
||||
return true;
|
||||
} else {
|
||||
if (this.haveTime()) {
|
||||
@@ -2704,4 +2705,74 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
|
||||
}
|
||||
@@ -1347,8 +1347,79 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
|
||||
return flag;
|
||||
}
|
||||
// Paper end
|
||||
+
|
||||
|
||||
+ // Paper start - execute chunk tasks mid tick
|
||||
+ static final long CHUNK_TASK_QUEUE_BACKOFF_MIN_TIME = 25L * 1000L; // 25us
|
||||
+ static final long MAX_CHUNK_EXEC_TIME = 1000L; // 1us
|
||||
@ -104,32 +95,38 @@ index d74313b58b660f3c03b8a6db4f80b6b073b6b795..f7c1d07c95f7b67e32bd6679af88612a
|
||||
+ }
|
||||
+ }
|
||||
+ // Paper end - execute chunk tasks mid tick
|
||||
}
|
||||
+
|
||||
private boolean pollTaskInternal() {
|
||||
if (super.pollTask()) {
|
||||
+ this.executeMidTickTasks(); // Paper - execute chunk tasks mid tick
|
||||
return true;
|
||||
} else {
|
||||
if (this.tickRateManager.isSprinting() || this.haveTime()) {
|
||||
diff --git a/src/main/java/net/minecraft/server/level/ServerChunkCache.java b/src/main/java/net/minecraft/server/level/ServerChunkCache.java
|
||||
index 4e58f31e4852a0811f85596653f6db630a75b069..8907396dc21dbfb31ff15286a7daa2110f6e34c0 100644
|
||||
index e725dd92ae15f62b078bda3572d0663468f37939..1f7586b71c579d48de32a307c0ce543130f0851b 100644
|
||||
--- a/src/main/java/net/minecraft/server/level/ServerChunkCache.java
|
||||
+++ b/src/main/java/net/minecraft/server/level/ServerChunkCache.java
|
||||
@@ -571,6 +571,7 @@ public class ServerChunkCache extends ChunkSource {
|
||||
// Paper end
|
||||
Iterator iterator1 = list.iterator();
|
||||
@@ -566,6 +566,7 @@ public class ServerChunkCache extends ChunkSource {
|
||||
boolean flag1 = this.level.ticksPerSpawnCategory.getLong(org.bukkit.entity.SpawnCategory.ANIMAL) != 0L && this.level.getLevelData().getGameTime() % this.level.ticksPerSpawnCategory.getLong(org.bukkit.entity.SpawnCategory.ANIMAL) == 0L; // CraftBukkit
|
||||
Iterator iterator1 = list.iterator();
|
||||
|
||||
+ int chunksTicked = 0; // Paper
|
||||
while (iterator1.hasNext()) {
|
||||
ServerChunkCache.ChunkAndHolder chunkproviderserver_a = (ServerChunkCache.ChunkAndHolder) iterator1.next();
|
||||
LevelChunk chunk1 = chunkproviderserver_a.chunk;
|
||||
@@ -584,6 +585,7 @@ public class ServerChunkCache extends ChunkSource {
|
||||
|
||||
if (this.level.shouldTickBlocksAt(chunkcoordintpair.toLong())) {
|
||||
this.level.tickChunk(chunk1, k);
|
||||
+ if ((chunksTicked++ & 1) == 0) net.minecraft.server.MinecraftServer.getServer().executeMidTickTasks(); // Paper
|
||||
+ int chunksTicked = 0; // Paper
|
||||
while (iterator1.hasNext()) {
|
||||
ServerChunkCache.ChunkAndHolder chunkproviderserver_a = (ServerChunkCache.ChunkAndHolder) iterator1.next();
|
||||
LevelChunk chunk1 = chunkproviderserver_a.chunk;
|
||||
@@ -580,6 +581,7 @@ public class ServerChunkCache extends ChunkSource {
|
||||
if (this.level.shouldTickBlocksAt(chunkcoordintpair.toLong())) {
|
||||
this.level.timings.doTickTiles.startTiming(); // Spigot
|
||||
this.level.tickChunk(chunk1, l);
|
||||
+ if ((chunksTicked++ & 1) == 0) net.minecraft.server.MinecraftServer.getServer().executeMidTickTasks(); // Paper
|
||||
this.level.timings.doTickTiles.stopTiming(); // Spigot
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
diff --git a/src/main/java/net/minecraft/server/level/ServerLevel.java b/src/main/java/net/minecraft/server/level/ServerLevel.java
|
||||
index d65e3cfeb8c6e7d26c03af8870d328c2f4094541..8436a2a517c3cff92d017bb3bc4acbd2e590597e 100644
|
||||
index 938a07d2e90ea2516b064d930b38e8908be91055..81381a4b401046b2ea76627814c740dca73b9592 100644
|
||||
--- a/src/main/java/net/minecraft/server/level/ServerLevel.java
|
||||
+++ b/src/main/java/net/minecraft/server/level/ServerLevel.java
|
||||
@@ -215,6 +215,7 @@ public class ServerLevel extends Level implements WorldGenLevel {
|
||||
@@ -217,6 +217,7 @@ public class ServerLevel extends Level implements WorldGenLevel {
|
||||
private final StructureCheck structureCheck;
|
||||
private final boolean tickTime;
|
||||
private final RandomSequences randomSequences;
|
||||
@ -137,7 +134,7 @@ index d65e3cfeb8c6e7d26c03af8870d328c2f4094541..8436a2a517c3cff92d017bb3bc4acbd2
|
||||
|
||||
// CraftBukkit start
|
||||
public final LevelStorageSource.LevelStorageAccess convertable;
|
||||
@@ -1187,6 +1188,7 @@ public class ServerLevel extends Level implements WorldGenLevel {
|
||||
@@ -1206,6 +1207,7 @@ public class ServerLevel extends Level implements WorldGenLevel {
|
||||
if (fluid1.is(fluid)) {
|
||||
fluid1.tick(this, pos);
|
||||
}
|
||||
@ -145,7 +142,7 @@ index d65e3cfeb8c6e7d26c03af8870d328c2f4094541..8436a2a517c3cff92d017bb3bc4acbd2
|
||||
|
||||
}
|
||||
|
||||
@@ -1196,6 +1198,7 @@ public class ServerLevel extends Level implements WorldGenLevel {
|
||||
@@ -1215,6 +1217,7 @@ public class ServerLevel extends Level implements WorldGenLevel {
|
||||
if (iblockdata.is(block)) {
|
||||
iblockdata.tick(this, pos, this.random);
|
||||
}
|
||||
@ -154,12 +151,12 @@ index d65e3cfeb8c6e7d26c03af8870d328c2f4094541..8436a2a517c3cff92d017bb3bc4acbd2
|
||||
}
|
||||
|
||||
diff --git a/src/main/java/net/minecraft/world/level/Level.java b/src/main/java/net/minecraft/world/level/Level.java
|
||||
index 6bd9b680fa1e84d058ada2354fa6a5b876185dc4..795be71432c4d834004bcfb70a8d1927cf22bfda 100644
|
||||
index 58394bbf228f96f717e5318cd016caf9d2f09343..c6b590381b8464ff9d7410b833889af5238e206a 100644
|
||||
--- a/src/main/java/net/minecraft/world/level/Level.java
|
||||
+++ b/src/main/java/net/minecraft/world/level/Level.java
|
||||
@@ -918,6 +918,11 @@ public abstract class Level implements LevelAccessor, AutoCloseable {
|
||||
@@ -929,6 +929,11 @@ public abstract class Level implements LevelAccessor, AutoCloseable {
|
||||
// Spigot end
|
||||
} else if (this.shouldTickBlocksAt(tickingblockentity.getPos())) {
|
||||
} else if (flag && this.shouldTickBlocksAt(tickingblockentity.getPos())) {
|
||||
tickingblockentity.tick();
|
||||
+ // Paper start - execute chunk tasks during tick
|
||||
+ if ((this.tileTickPosition & 7) == 0) {
|
||||
@ -169,7 +166,7 @@ index 6bd9b680fa1e84d058ada2354fa6a5b876185dc4..795be71432c4d834004bcfb70a8d1927
|
||||
}
|
||||
}
|
||||
this.blockEntityTickers.removeAll(toRemove);
|
||||
@@ -932,6 +937,7 @@ public abstract class Level implements LevelAccessor, AutoCloseable {
|
||||
@@ -943,6 +948,7 @@ public abstract class Level implements LevelAccessor, AutoCloseable {
|
||||
public <T extends Entity> void guardEntityTick(Consumer<T> tickConsumer, T entity) {
|
||||
try {
|
||||
tickConsumer.accept(entity);
|
@ -7,10 +7,10 @@ Apparently the abstract block iteration was taking about
|
||||
75% of the method call.
|
||||
|
||||
diff --git a/src/main/java/net/minecraft/world/level/block/FarmBlock.java b/src/main/java/net/minecraft/world/level/block/FarmBlock.java
|
||||
index eb6056c5051e5e8a872a10dc993dbd5232787663..502dcba14da9d3dcefc61fdc349a4e1e1d94b478 100644
|
||||
index 6c1e8ba518c883aa5c079b4c94f068833609acc3..59bbdead2ebd8965d222540c7243dde051bbcc4b 100644
|
||||
--- a/src/main/java/net/minecraft/world/level/block/FarmBlock.java
|
||||
+++ b/src/main/java/net/minecraft/world/level/block/FarmBlock.java
|
||||
@@ -144,19 +144,27 @@ public class FarmBlock extends Block {
|
||||
@@ -151,19 +151,27 @@ public class FarmBlock extends Block {
|
||||
}
|
||||
|
||||
private static boolean isNearWater(LevelReader world, BlockPos pos) {
|
@ -90,10 +90,10 @@ index 0000000000000000000000000000000000000000..7d93652c1abbb6aee6eb7c26cf35d4d0
|
||||
+ }
|
||||
+}
|
||||
diff --git a/src/main/java/net/minecraft/server/level/ServerLevel.java b/src/main/java/net/minecraft/server/level/ServerLevel.java
|
||||
index 8436a2a517c3cff92d017bb3bc4acbd2e590597e..1c6cd0671b501dde08cace07043565efa4c740f1 100644
|
||||
index 81381a4b401046b2ea76627814c740dca73b9592..8144c2f519876a3e33150e4fbebea3aadaf5ce31 100644
|
||||
--- a/src/main/java/net/minecraft/server/level/ServerLevel.java
|
||||
+++ b/src/main/java/net/minecraft/server/level/ServerLevel.java
|
||||
@@ -839,6 +839,10 @@ public class ServerLevel extends Level implements WorldGenLevel {
|
||||
@@ -856,6 +856,10 @@ public class ServerLevel extends Level implements WorldGenLevel {
|
||||
entityplayer.stopSleepInBed(false, false);
|
||||
});
|
||||
}
|
||||
@ -104,7 +104,7 @@ index 8436a2a517c3cff92d017bb3bc4acbd2e590597e..1c6cd0671b501dde08cace07043565ef
|
||||
|
||||
public void tickChunk(LevelChunk chunk, int randomTickSpeed) {
|
||||
ChunkPos chunkcoordintpair = chunk.getPos();
|
||||
@@ -848,8 +852,10 @@ public class ServerLevel extends Level implements WorldGenLevel {
|
||||
@@ -865,8 +869,10 @@ public class ServerLevel extends Level implements WorldGenLevel {
|
||||
ProfilerFiller gameprofilerfiller = this.getProfiler();
|
||||
|
||||
gameprofilerfiller.push("thunder");
|
||||
@ -116,18 +116,19 @@ index 8436a2a517c3cff92d017bb3bc4acbd2e590597e..1c6cd0671b501dde08cace07043565ef
|
||||
|
||||
if (this.isRainingAt(blockposition)) {
|
||||
DifficultyInstance difficultydamagescaler = this.getCurrentDifficultyAt(blockposition);
|
||||
@@ -881,61 +887,68 @@ public class ServerLevel extends Level implements WorldGenLevel {
|
||||
@@ -898,7 +904,10 @@ public class ServerLevel extends Level implements WorldGenLevel {
|
||||
if (!this.paperConfig().environment.disableIceAndSnow) { // Paper
|
||||
for (int l = 0; l < randomTickSpeed; ++l) {
|
||||
if (this.random.nextInt(48) == 0) {
|
||||
- this.tickIceAndSnow(flag, this.getBlockRandomPos(j, 0, k, 15));
|
||||
- this.tickPrecipitation(this.getBlockRandomPos(j, 0, k, 15));
|
||||
+ // Paper start
|
||||
+ this.getRandomBlockPosition(j, 0, k, 15, blockposition);
|
||||
+ this.tickIceAndSnow(flag, blockposition, chunk);
|
||||
+ this.tickPrecipitation(blockposition, chunk);
|
||||
+ // Paper end
|
||||
}
|
||||
}
|
||||
} // Paper
|
||||
|
||||
+ // Paper start - optimise random block ticking
|
||||
@@ -906,54 +915,60 @@ public class ServerLevel extends Level implements WorldGenLevel {
|
||||
gameprofilerfiller.popPush("tickBlocks");
|
||||
timings.chunkTicksBlocks.startTiming(); // Paper
|
||||
if (randomTickSpeed > 0) {
|
||||
@ -149,6 +150,7 @@ index 8436a2a517c3cff92d017bb3bc4acbd2e590597e..1c6cd0671b501dde08cace07043565ef
|
||||
- if (iblockdata.isRandomlyTicking()) {
|
||||
- iblockdata.randomTick(this, blockposition1, this.random);
|
||||
- }
|
||||
+ // Paper start - optimize random block ticking
|
||||
+ LevelChunkSection[] sections = chunk.getSections();
|
||||
+ final int minSection = io.papermc.paper.util.WorldUtil.getMinSection(this);
|
||||
+ for (int sectionIndex = 0; sectionIndex < sections.length; sectionIndex++) {
|
||||
@ -179,9 +181,9 @@ index 8436a2a517c3cff92d017bb3bc4acbd2e590597e..1c6cd0671b501dde08cace07043565ef
|
||||
- gameprofilerfiller.pop();
|
||||
- }
|
||||
+ iblockdata.randomTick(this, blockposition2, this.randomTickRandom);
|
||||
+ // We drop the fluid tick since LAVA is ALREADY TICKED by the above method (See LiquidBlock).
|
||||
+ // TODO CHECK ON UPDATE (ping the Canadian)
|
||||
}
|
||||
+ // We drop the fluid tick since LAVA is ALREADY TICKED by the above method (See LiquidBlock).
|
||||
+ // TODO CHECK ON UPDATE (ping the Canadian)
|
||||
}
|
||||
}
|
||||
+ // Paper end - optimise random block ticking
|
||||
@ -190,14 +192,16 @@ index 8436a2a517c3cff92d017bb3bc4acbd2e590597e..1c6cd0671b501dde08cace07043565ef
|
||||
gameprofilerfiller.pop();
|
||||
}
|
||||
|
||||
- private void tickIceAndSnow(boolean raining, BlockPos pos) {
|
||||
@VisibleForTesting
|
||||
- public void tickPrecipitation(BlockPos pos) {
|
||||
- BlockPos blockposition1 = this.getHeightmapPos(Heightmap.Types.MOTION_BLOCKING, pos);
|
||||
- BlockPos blockposition2 = blockposition1.below();
|
||||
+ private void tickIceAndSnow(boolean raining, BlockPos.MutableBlockPos blockposition1, final LevelChunk chunk) { // Paper - optimise chunk ticking
|
||||
+ public void tickPrecipitation(BlockPos.MutableBlockPos blockposition1, final LevelChunk chunk) { // Paper - optimise chunk ticking
|
||||
+ // Paper start - optimise chunk ticking
|
||||
+ int normalY = chunk.getHeight(Heightmap.Types.MOTION_BLOCKING, blockposition1.getX() & 15, blockposition1.getZ() & 15) + 1;
|
||||
+ int downY = normalY - 1;
|
||||
+ blockposition1.setY(normalY);
|
||||
+ // Paper end - optimise chunk ticking
|
||||
Biome biomebase = (Biome) this.getBiome(blockposition1).value();
|
||||
|
||||
- if (biomebase.shouldFreeze(this, blockposition2)) {
|
||||
@ -206,16 +210,15 @@ index 8436a2a517c3cff92d017bb3bc4acbd2e590597e..1c6cd0671b501dde08cace07043565ef
|
||||
+ if (biomebase.shouldFreeze(this, blockposition1)) {
|
||||
+ org.bukkit.craftbukkit.event.CraftEventFactory.handleBlockFormEvent(this, blockposition1, Blocks.ICE.defaultBlockState(), null); // CraftBukkit
|
||||
}
|
||||
+ // Paper end - optimise chunk ticking
|
||||
|
||||
if (raining) {
|
||||
if (this.isRaining()) {
|
||||
int i = this.getGameRules().getInt(GameRules.RULE_SNOW_ACCUMULATION_HEIGHT);
|
||||
|
||||
+ blockposition1.setY(normalY); // Paper - optimise chunk ticking
|
||||
if (i > 0 && biomebase.shouldSnow(this, blockposition1)) {
|
||||
BlockState iblockdata = this.getBlockState(blockposition1);
|
||||
|
||||
@@ -953,12 +966,13 @@ public class ServerLevel extends Level implements WorldGenLevel {
|
||||
@@ -971,12 +986,13 @@ public class ServerLevel extends Level implements WorldGenLevel {
|
||||
}
|
||||
}
|
||||
|
||||
@ -306,7 +309,7 @@ index f0f764f36fb92c64ab2dc8a0a50c3f48321c3c9a..311625277a26c9c187025a1036978229
|
||||
public void getAll(IntConsumer action) {
|
||||
for(int i = 0; i < this.size; ++i) {
|
||||
diff --git a/src/main/java/net/minecraft/world/entity/animal/Turtle.java b/src/main/java/net/minecraft/world/entity/animal/Turtle.java
|
||||
index 652a8150f7343050b6da6c01f4e73a755138d491..5f57f13d50e051c621e401b63c0b55b3a2a73fa3 100644
|
||||
index 722e323d2ae3f4ac8aa3197fed79f7d926d5ccfa..f8c1dfc8e121a406955348a1ec00c264d73e73f7 100644
|
||||
--- a/src/main/java/net/minecraft/world/entity/animal/Turtle.java
|
||||
+++ b/src/main/java/net/minecraft/world/entity/animal/Turtle.java
|
||||
@@ -87,7 +87,7 @@ public class Turtle extends Animal {
|
||||
@ -319,10 +322,10 @@ index 652a8150f7343050b6da6c01f4e73a755138d491..5f57f13d50e051c621e401b63c0b55b3
|
||||
|
||||
public BlockPos getHomePos() {
|
||||
diff --git a/src/main/java/net/minecraft/world/level/Level.java b/src/main/java/net/minecraft/world/level/Level.java
|
||||
index 795be71432c4d834004bcfb70a8d1927cf22bfda..5e7a53d1cae4c94a08fb89d7599d183de21cdfaa 100644
|
||||
index c6b590381b8464ff9d7410b833889af5238e206a..fe263132ed204dbd1b939d92dc16eec40162fb76 100644
|
||||
--- a/src/main/java/net/minecraft/world/level/Level.java
|
||||
+++ b/src/main/java/net/minecraft/world/level/Level.java
|
||||
@@ -1380,10 +1380,18 @@ public abstract class Level implements LevelAccessor, AutoCloseable {
|
||||
@@ -1400,10 +1400,18 @@ public abstract class Level implements LevelAccessor, AutoCloseable {
|
||||
public abstract RecipeManager getRecipeManager();
|
||||
|
||||
public BlockPos getBlockRandomPos(int x, int y, int z, int l) {
|
@ -337,10 +337,10 @@ index 5f625acf04ddb56e3596d086252f9bfccfdb95f2..54c7f34ba3dc8466223e589702d0c93a
|
||||
protected void initChannel(Channel channel) {
|
||||
Connection.setInitialProtocolAttributes(channel);
|
||||
diff --git a/src/main/java/net/minecraft/server/network/ServerLoginPacketListenerImpl.java b/src/main/java/net/minecraft/server/network/ServerLoginPacketListenerImpl.java
|
||||
index b52c4d659fa4ea1a9119f932a381c4982f158deb..2e73c94f74be95a7d6ba58d5151c3090253bb9c6 100644
|
||||
index 833e17796a75c24eb4f2eb76ed00160229458e39..0c4fb4a7d4fcdc6d724beb13a16bd729a3c525cd 100644
|
||||
--- a/src/main/java/net/minecraft/server/network/ServerLoginPacketListenerImpl.java
|
||||
+++ b/src/main/java/net/minecraft/server/network/ServerLoginPacketListenerImpl.java
|
||||
@@ -222,12 +222,14 @@ public class ServerLoginPacketListenerImpl implements ServerLoginPacketListener,
|
||||
@@ -218,12 +218,14 @@ public class ServerLoginPacketListenerImpl implements ServerLoginPacketListener,
|
||||
}
|
||||
|
||||
SecretKey secretkey = packet.getSecretKey(privatekey);
|
@ -25,10 +25,10 @@ index fc32505422bebd52f5bcd6a6bb7525fa443ee8e0..78e540af673c47f77b5efec4719d5e14
|
||||
// Paper end
|
||||
}
|
||||
diff --git a/src/main/java/net/minecraft/network/protocol/PacketUtils.java b/src/main/java/net/minecraft/network/protocol/PacketUtils.java
|
||||
index 047fc7206131e0f36ab45d04e98b7a235431e342..6ac03dee902051a26493dba468d6a2f5cecfe066 100644
|
||||
index 7de24c39b460e43d27839b3821e67213508ece81..7297bca9224c12d7ace0e1967340d99436afafc1 100644
|
||||
--- a/src/main/java/net/minecraft/network/protocol/PacketUtils.java
|
||||
+++ b/src/main/java/net/minecraft/network/protocol/PacketUtils.java
|
||||
@@ -17,6 +17,24 @@ public class PacketUtils {
|
||||
@@ -18,6 +18,24 @@ public class PacketUtils {
|
||||
|
||||
private static final Logger LOGGER = LogUtils.getLogger();
|
||||
|
||||
@ -53,7 +53,7 @@ index 047fc7206131e0f36ab45d04e98b7a235431e342..6ac03dee902051a26493dba468d6a2f5
|
||||
public PacketUtils() {}
|
||||
|
||||
public static <T extends PacketListener> void ensureRunningOnSameThread(Packet<T> packet, T listener, ServerLevel world) throws RunningOnDifferentThreadException {
|
||||
@@ -26,6 +44,8 @@ public class PacketUtils {
|
||||
@@ -27,6 +45,8 @@ public class PacketUtils {
|
||||
public static <T extends PacketListener> void ensureRunningOnSameThread(Packet<T> packet, T listener, BlockableEventLoop<?> engine) throws RunningOnDifferentThreadException {
|
||||
if (!engine.isSameThread()) {
|
||||
engine.executeIfPossible(() -> {
|
||||
@ -62,7 +62,7 @@ index 047fc7206131e0f36ab45d04e98b7a235431e342..6ac03dee902051a26493dba468d6a2f5
|
||||
if (MinecraftServer.getServer().hasStopped() || (listener instanceof ServerCommonPacketListenerImpl && ((ServerCommonPacketListenerImpl) listener).processedDisconnect)) return; // CraftBukkit, MC-142590
|
||||
if (listener.shouldHandleMessage(packet)) {
|
||||
co.aikar.timings.Timing timing = co.aikar.timings.MinecraftTimings.getPacketTiming(packet); // Paper - timings
|
||||
@@ -50,6 +70,12 @@ public class PacketUtils {
|
||||
@@ -64,6 +84,12 @@ public class PacketUtils {
|
||||
} else {
|
||||
PacketUtils.LOGGER.debug("Ignoring packet due to disconnection: {}", packet);
|
||||
}
|
||||
@ -76,10 +76,10 @@ index 047fc7206131e0f36ab45d04e98b7a235431e342..6ac03dee902051a26493dba468d6a2f5
|
||||
});
|
||||
throw RunningOnDifferentThreadException.RUNNING_ON_DIFFERENT_THREAD;
|
||||
diff --git a/src/main/java/net/minecraft/server/level/ServerLevel.java b/src/main/java/net/minecraft/server/level/ServerLevel.java
|
||||
index 1c6cd0671b501dde08cace07043565efa4c740f1..e7e1ed9d3031bc5614cedc97d0261d22800e8479 100644
|
||||
index 8144c2f519876a3e33150e4fbebea3aadaf5ce31..844a708fa64fa023370f6a5ac386956f56b0545a 100644
|
||||
--- a/src/main/java/net/minecraft/server/level/ServerLevel.java
|
||||
+++ b/src/main/java/net/minecraft/server/level/ServerLevel.java
|
||||
@@ -1216,7 +1216,26 @@ public class ServerLevel extends Level implements WorldGenLevel {
|
||||
@@ -1237,7 +1237,26 @@ public class ServerLevel extends Level implements WorldGenLevel {
|
||||
|
||||
}
|
||||
|
||||
@ -106,7 +106,7 @@ index 1c6cd0671b501dde08cace07043565efa4c740f1..e7e1ed9d3031bc5614cedc97d0261d22
|
||||
++TimingHistory.entityTicks; // Paper - timings
|
||||
// Spigot start
|
||||
co.aikar.timings.Timing timer; // Paper
|
||||
@@ -1256,7 +1275,13 @@ public class ServerLevel extends Level implements WorldGenLevel {
|
||||
@@ -1277,7 +1296,13 @@ public class ServerLevel extends Level implements WorldGenLevel {
|
||||
this.tickPassenger(entity, entity1);
|
||||
}
|
||||
// } finally { timer.stopTiming(); } // Paper - timings - move up
|
||||
@ -122,10 +122,10 @@ index 1c6cd0671b501dde08cace07043565efa4c740f1..e7e1ed9d3031bc5614cedc97d0261d22
|
||||
|
||||
private void tickPassenger(Entity vehicle, Entity passenger) {
|
||||
diff --git a/src/main/java/net/minecraft/world/entity/Entity.java b/src/main/java/net/minecraft/world/entity/Entity.java
|
||||
index 80ab060e9252d3284f9696ef739e96a35fead3e4..43961098f06119a4ad7e2c6c6bdf16901b1e9ff5 100644
|
||||
index 430f36da1e40d8427f24994ab16e68da79f575d2..66bca8bd3cfb5956104d5d8bef4b34d84d3cf21f 100644
|
||||
--- a/src/main/java/net/minecraft/world/entity/Entity.java
|
||||
+++ b/src/main/java/net/minecraft/world/entity/Entity.java
|
||||
@@ -1024,7 +1024,42 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource {
|
||||
@@ -1029,7 +1029,42 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource, S
|
||||
return this.onGround;
|
||||
}
|
||||
|
||||
@ -168,7 +168,7 @@ index 80ab060e9252d3284f9696ef739e96a35fead3e4..43961098f06119a4ad7e2c6c6bdf1690
|
||||
if (this.noPhysics) {
|
||||
this.setPos(this.getX() + movement.x, this.getY() + movement.y, this.getZ() + movement.z);
|
||||
} else {
|
||||
@@ -1194,6 +1229,13 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource {
|
||||
@@ -1199,6 +1234,13 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource, S
|
||||
this.level().getProfiler().pop();
|
||||
}
|
||||
}
|
||||
@ -182,7 +182,7 @@ index 80ab060e9252d3284f9696ef739e96a35fead3e4..43961098f06119a4ad7e2c6c6bdf1690
|
||||
}
|
||||
|
||||
private boolean isStateClimbable(BlockState state) {
|
||||
@@ -4230,7 +4272,9 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource {
|
||||
@@ -4272,7 +4314,9 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource, S
|
||||
}
|
||||
|
||||
public void setDeltaMovement(Vec3 velocity) {
|
||||
@ -192,7 +192,7 @@ index 80ab060e9252d3284f9696ef739e96a35fead3e4..43961098f06119a4ad7e2c6c6bdf1690
|
||||
}
|
||||
|
||||
public void addDeltaMovement(Vec3 velocity) {
|
||||
@@ -4316,7 +4360,9 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource {
|
||||
@@ -4358,7 +4402,9 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource, S
|
||||
}
|
||||
// Paper end - fix MC-4
|
||||
if (this.position.x != x || this.position.y != y || this.position.z != z) {
|
@ -5,10 +5,10 @@ Subject: [PATCH] Reduce worldgen thread worker count for low core count CPUs
|
||||
|
||||
|
||||
diff --git a/src/main/java/net/minecraft/Util.java b/src/main/java/net/minecraft/Util.java
|
||||
index 25b2d7016b60ee9bad0a2fb4a2c7c8ee34af50eb..a17e61f6f59eae179b76179985a9bd7a32a7e40a 100644
|
||||
index e67a2aa92f9c9bb5a4ba9fc869aa738a43cd8595..7be16ce8c8582d8587c4d1cb4c099fa6fe5f1324 100644
|
||||
--- a/src/main/java/net/minecraft/Util.java
|
||||
+++ b/src/main/java/net/minecraft/Util.java
|
||||
@@ -148,7 +148,19 @@ public class Util {
|
||||
@@ -155,7 +155,19 @@ public class Util {
|
||||
|
||||
private static ExecutorService makeExecutor(String s, int priorityModifier) { // Paper - add priority
|
||||
// Paper start - use simpler thread pool that allows 1 thread
|
@ -7,7 +7,7 @@ Recently this has been taking up more time, so add a timings to
|
||||
really figure out how much.
|
||||
|
||||
diff --git a/src/main/java/co/aikar/timings/MinecraftTimings.java b/src/main/java/co/aikar/timings/MinecraftTimings.java
|
||||
index 0fc4feb00940079c4eb9554a3a48d19cbbeeb7bc..e6452bb4f29bf32600dbf8654365826600189bb5 100644
|
||||
index 190f6727351bc1d4e071da095d2f6365de095379..a5f10adde531c4657791d5d0797101a28bd3faa7 100644
|
||||
--- a/src/main/java/co/aikar/timings/MinecraftTimings.java
|
||||
+++ b/src/main/java/co/aikar/timings/MinecraftTimings.java
|
||||
@@ -47,6 +47,7 @@ public final class MinecraftTimings {
|
||||
@ -16,8 +16,8 @@ index 0fc4feb00940079c4eb9554a3a48d19cbbeeb7bc..e6452bb4f29bf32600dbf86543658266
|
||||
public static final Timing scoreboardScoreSearch = Timings.ofSafe("Scoreboard score search"); // Paper - add timings for scoreboard search
|
||||
+ public static final Timing distanceManagerTick = Timings.ofSafe("Distance Manager Tick"); // Paper - add timings for distance manager
|
||||
|
||||
|
||||
public static final Timing midTickChunkTasks = Timings.ofSafe("Mid Tick Chunk Tasks");
|
||||
|
||||
diff --git a/src/main/java/io/papermc/paper/chunk/system/scheduling/ChunkHolderManager.java b/src/main/java/io/papermc/paper/chunk/system/scheduling/ChunkHolderManager.java
|
||||
index 8e52ebe8d12f5da3d877b0e4ff3723229fb47db1..abd0217cf0bff183c8e262edc173a53403797c1a 100644
|
||||
--- a/src/main/java/io/papermc/paper/chunk/system/scheduling/ChunkHolderManager.java
|
@ -5,10 +5,10 @@ Subject: [PATCH] Fix merchant inventory not closing on entity removal
|
||||
|
||||
|
||||
diff --git a/src/main/java/net/minecraft/server/level/ServerLevel.java b/src/main/java/net/minecraft/server/level/ServerLevel.java
|
||||
index e7e1ed9d3031bc5614cedc97d0261d22800e8479..9cc9815aab6d0548c45e380ad3a90130c1d731d7 100644
|
||||
index 844a708fa64fa023370f6a5ac386956f56b0545a..4df6572f2babbaeece0c62750cc913a78af9c282 100644
|
||||
--- a/src/main/java/net/minecraft/server/level/ServerLevel.java
|
||||
+++ b/src/main/java/net/minecraft/server/level/ServerLevel.java
|
||||
@@ -2642,6 +2642,11 @@ public class ServerLevel extends Level implements WorldGenLevel {
|
||||
@@ -2680,6 +2680,11 @@ public class ServerLevel extends Level implements WorldGenLevel {
|
||||
// Spigot end
|
||||
// Spigot Start
|
||||
if (entity.getBukkitEntity() instanceof org.bukkit.inventory.InventoryHolder && (!(entity instanceof ServerPlayer) || entity.getRemovalReason() != Entity.RemovalReason.KILLED)) { // SPIGOT-6876: closeInventory clears death message
|
@ -11,10 +11,10 @@ encountering a command node with ASK_SERVER suggestions, however a
|
||||
modified client can send this packet whenever it wants.
|
||||
|
||||
diff --git a/src/main/java/com/mojang/brigadier/CommandDispatcher.java b/src/main/java/com/mojang/brigadier/CommandDispatcher.java
|
||||
index 94d1483bc6fe05c24720840ba861ebc6977f6062..c7cfb3b8ba3f64fb04dfebd5d724aa8d3f2698ab 100644
|
||||
index 858e41fba7dc285dd21a93f3918cc5de3887df5f..43018b34308eb12791616724e40c006b2141835c 100644
|
||||
--- a/src/main/java/com/mojang/brigadier/CommandDispatcher.java
|
||||
+++ b/src/main/java/com/mojang/brigadier/CommandDispatcher.java
|
||||
@@ -596,10 +596,14 @@ public class CommandDispatcher<S> {
|
||||
@@ -538,10 +538,14 @@ public class CommandDispatcher<S> {
|
||||
int i = 0;
|
||||
for (final CommandNode<S> node : parent.getChildren()) {
|
||||
CompletableFuture<Suggestions> future = Suggestions.empty();
|
@ -6,10 +6,10 @@ Subject: [PATCH] Don't respond to ServerboundCommandSuggestionPacket when
|
||||
|
||||
|
||||
diff --git a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
|
||||
index e6251951d677e2ac71e738070914997e01086be0..67d9e636b424a91ab1f1478b757016099ca915dc 100644
|
||||
index ef031bf9df047534e154fb3b288d76df3bed89cc..20b204c87bb7173d9e402a603009c4b8e56dd614 100644
|
||||
--- a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
|
||||
+++ b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
|
||||
@@ -735,6 +735,11 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl
|
||||
@@ -738,6 +738,11 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl
|
||||
}
|
||||
// Paper end
|
||||
// CraftBukkit end
|
@ -5,10 +5,10 @@ Subject: [PATCH] Ensure valid vehicle status
|
||||
|
||||
|
||||
diff --git a/src/main/java/net/minecraft/server/level/ServerPlayer.java b/src/main/java/net/minecraft/server/level/ServerPlayer.java
|
||||
index 0ee7c54e4e46bc35e5a7b01ddd408bdbe0e3d1c1..e45fc21532911aedacd99315386857e8e54ade32 100644
|
||||
index 5035609b0a4160c2671ee9939e2d8bbf17749370..4d39c57941dcefc2c507f69adea2b042bc78662b 100644
|
||||
--- a/src/main/java/net/minecraft/server/level/ServerPlayer.java
|
||||
+++ b/src/main/java/net/minecraft/server/level/ServerPlayer.java
|
||||
@@ -569,7 +569,7 @@ public class ServerPlayer extends Player {
|
||||
@@ -576,7 +576,7 @@ public class ServerPlayer extends Player {
|
||||
}
|
||||
}
|
||||
|
@ -8,10 +8,10 @@ This is because bukkit uses a separate head rotation field for yaw.
|
||||
This issue only applies to players.
|
||||
|
||||
diff --git a/src/main/java/net/minecraft/world/entity/Entity.java b/src/main/java/net/minecraft/world/entity/Entity.java
|
||||
index 43961098f06119a4ad7e2c6c6bdf16901b1e9ff5..aadc101d54a688330ff43ce5a63b65c57566b093 100644
|
||||
index 66bca8bd3cfb5956104d5d8bef4b34d84d3cf21f..9f966aad558a26f75846a4ae2e891a370376b90b 100644
|
||||
--- a/src/main/java/net/minecraft/world/entity/Entity.java
|
||||
+++ b/src/main/java/net/minecraft/world/entity/Entity.java
|
||||
@@ -1911,6 +1911,7 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource {
|
||||
@@ -1916,6 +1916,7 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource, S
|
||||
this.setXRot(Mth.clamp(pitch, -90.0F, 90.0F) % 360.0F);
|
||||
this.yRotO = this.getYRot();
|
||||
this.xRotO = this.getXRot();
|
||||
@ -19,7 +19,7 @@ index 43961098f06119a4ad7e2c6c6bdf16901b1e9ff5..aadc101d54a688330ff43ce5a63b65c5
|
||||
}
|
||||
|
||||
public void absMoveTo(double x, double y, double z) {
|
||||
@@ -1949,6 +1950,7 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource {
|
||||
@@ -1954,6 +1955,7 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource, S
|
||||
this.setXRot(pitch);
|
||||
this.setOldPosAndRot();
|
||||
this.reapplyPosition();
|
@ -5,10 +5,10 @@ Subject: [PATCH] prevent unintended light block manipulation
|
||||
|
||||
|
||||
diff --git a/src/main/java/net/minecraft/world/level/block/LightBlock.java b/src/main/java/net/minecraft/world/level/block/LightBlock.java
|
||||
index 6427302f53336fe035882d0a09e3e2d2d929d3b7..6eec44c484763f877aece6d9676ffc166bc10395 100644
|
||||
index a0fadee4be7c263ceaf1f4a987169b0f50308072..5e36baecd1e9fa02e00c250dd7ebe41e89fffeb7 100644
|
||||
--- a/src/main/java/net/minecraft/world/level/block/LightBlock.java
|
||||
+++ b/src/main/java/net/minecraft/world/level/block/LightBlock.java
|
||||
@@ -46,6 +46,7 @@ public class LightBlock extends Block implements SimpleWaterloggedBlock {
|
||||
@@ -54,6 +54,7 @@ public class LightBlock extends Block implements SimpleWaterloggedBlock {
|
||||
@Override
|
||||
public InteractionResult use(BlockState state, Level world, BlockPos pos, Player player, InteractionHand hand, BlockHitResult hit) {
|
||||
if (!world.isClientSide && player.canUseGameMasterBlocks()) {
|
@ -50,7 +50,7 @@ index f7f211b4f08a7f21a183078affd6f875aa30dd50..a8290624d8c5b19506f628d049984d2e
|
||||
// Paper start
|
||||
@Override
|
||||
diff --git a/src/main/java/org/bukkit/craftbukkit/block/CraftBlockStates.java b/src/main/java/org/bukkit/craftbukkit/block/CraftBlockStates.java
|
||||
index c9ef19bdeeb130561659ff8161bf4e196cf4f53f..e44cd3b8eef25a3e7eedbe8ae597d74585ecd627 100644
|
||||
index 2fe8f7dfefd6e1f9b06f1d4821894091a8e6400e..000724a070f7f053c14cb53ecc45f0ee14454c53 100644
|
||||
--- a/src/main/java/org/bukkit/craftbukkit/block/CraftBlockStates.java
|
||||
+++ b/src/main/java/org/bukkit/craftbukkit/block/CraftBlockStates.java
|
||||
@@ -19,6 +19,7 @@ import net.minecraft.world.level.block.entity.BeehiveBlockEntity;
|
||||
@ -61,7 +61,7 @@ index c9ef19bdeeb130561659ff8161bf4e196cf4f53f..e44cd3b8eef25a3e7eedbe8ae597d745
|
||||
import net.minecraft.world.level.block.entity.BrewingStandBlockEntity;
|
||||
import net.minecraft.world.level.block.entity.BrushableBlockEntity;
|
||||
import net.minecraft.world.level.block.entity.CalibratedSculkSensorBlockEntity;
|
||||
@@ -113,225 +114,62 @@ public final class CraftBlockStates {
|
||||
@@ -115,227 +116,64 @@ public final class CraftBlockStates {
|
||||
private static final BlockStateFactory<?> DEFAULT_FACTORY = new BlockStateFactory<CraftBlockState>(CraftBlockState.class) {
|
||||
@Override
|
||||
public CraftBlockState createBlockState(World world, BlockPos blockPosition, net.minecraft.world.level.block.state.BlockState blockData, BlockEntity tileEntity) {
|
||||
@ -291,6 +291,8 @@ index c9ef19bdeeb130561659ff8161bf4e196cf4f53f..e44cd3b8eef25a3e7eedbe8ae597d745
|
||||
- register(Material.SUSPICIOUS_SAND, CraftSuspiciousSand.class, CraftSuspiciousSand::new, BrushableBlockEntity::new);
|
||||
- register(Material.SUSPICIOUS_GRAVEL, CraftBrushableBlock.class, CraftBrushableBlock::new, BrushableBlockEntity::new);
|
||||
- register(Material.TRAPPED_CHEST, CraftChest.class, CraftChest::new, TrappedChestBlockEntity::new);
|
||||
- register(Material.CRAFTER, CraftCrafter.class, CraftCrafter::new, CrafterBlockEntity::new);
|
||||
- register(Material.TRIAL_SPAWNER, CraftTrialSpawner.class, CraftTrialSpawner::new, TrialSpawnerBlockEntity::new);
|
||||
+ // Paper start - simplify
|
||||
+ register(BlockEntityType.SIGN, CraftSign.class, CraftSign::new);
|
||||
+ register(BlockEntityType.HANGING_SIGN, CraftHangingSign.class, CraftHangingSign::new);
|
||||
@ -333,11 +335,13 @@ index c9ef19bdeeb130561659ff8161bf4e196cf4f53f..e44cd3b8eef25a3e7eedbe8ae597d745
|
||||
+ register(BlockEntityType.STRUCTURE_BLOCK, CraftStructureBlock.class, CraftStructureBlock::new);
|
||||
+ register(BlockEntityType.BRUSHABLE_BLOCK, CraftBrushableBlock.class, CraftBrushableBlock::new); // note: spigot still uses CraftSuspiciousSand impl for that block type
|
||||
+ register(BlockEntityType.TRAPPED_CHEST, CraftChest.class, CraftChest::new);
|
||||
+ register(BlockEntityType.CRAFTER, CraftCrafter.class, CraftCrafter::new);
|
||||
+ register(BlockEntityType.TRIAL_SPAWNER, CraftTrialSpawner.class, CraftTrialSpawner::new);
|
||||
+ // Paper end
|
||||
}
|
||||
|
||||
private static void register(Material blockType, BlockStateFactory<?> factory) {
|
||||
@@ -339,30 +177,33 @@ public final class CraftBlockStates {
|
||||
@@ -343,30 +181,33 @@ public final class CraftBlockStates {
|
||||
}
|
||||
|
||||
private static <T extends BlockEntity, B extends CraftBlockEntityState<T>> void register(
|
||||
@ -386,7 +390,7 @@ index c9ef19bdeeb130561659ff8161bf4e196cf4f53f..e44cd3b8eef25a3e7eedbe8ae597d745
|
||||
public static Class<? extends CraftBlockState> getBlockStateType(Material material) {
|
||||
Preconditions.checkNotNull(material, "material is null");
|
||||
return CraftBlockStates.getFactory(material).blockStateType;
|
||||
@@ -378,6 +219,13 @@ public final class CraftBlockStates {
|
||||
@@ -382,6 +223,13 @@ public final class CraftBlockStates {
|
||||
return null;
|
||||
}
|
||||
|
||||
@ -400,7 +404,7 @@ index c9ef19bdeeb130561659ff8161bf4e196cf4f53f..e44cd3b8eef25a3e7eedbe8ae597d745
|
||||
public static BlockState getBlockState(Block block) {
|
||||
// Paper start
|
||||
return CraftBlockStates.getBlockState(block, true);
|
||||
@@ -435,7 +283,7 @@ public final class CraftBlockStates {
|
||||
@@ -439,7 +287,7 @@ public final class CraftBlockStates {
|
||||
if (world != null && tileEntity == null && CraftBlockStates.isTileEntityOptional(material)) {
|
||||
factory = CraftBlockStates.DEFAULT_FACTORY;
|
||||
} else {
|
@ -57,7 +57,7 @@ index 0000000000000000000000000000000000000000..6bd0afddbcc461149dfe9a5c7a86fff6
|
||||
+ }
|
||||
+}
|
||||
diff --git a/src/main/java/net/minecraft/server/dedicated/DedicatedServer.java b/src/main/java/net/minecraft/server/dedicated/DedicatedServer.java
|
||||
index 96de992ea9bc9182ea6a30a33e86d7970b70611b..ab7cd594731aaa7b36f80fde00eada52f9e913a5 100644
|
||||
index 0008e63e96841c48fa039001f282ffa70c88494f..a305557e97d8719f5f82e70794d15242364ce136 100644
|
||||
--- a/src/main/java/net/minecraft/server/dedicated/DedicatedServer.java
|
||||
+++ b/src/main/java/net/minecraft/server/dedicated/DedicatedServer.java
|
||||
@@ -179,6 +179,16 @@ public class DedicatedServer extends MinecraftServer implements ServerInterface
|
@ -5,10 +5,10 @@ Subject: [PATCH] don't attempt to teleport dead entities
|
||||
|
||||
|
||||
diff --git a/src/main/java/net/minecraft/world/entity/Entity.java b/src/main/java/net/minecraft/world/entity/Entity.java
|
||||
index aadc101d54a688330ff43ce5a63b65c57566b093..21029c7e00f7815ac6f6c8931571e4259ea56742 100644
|
||||
index 9f966aad558a26f75846a4ae2e891a370376b90b..3a3cc572369f4eab96d748d97af97f02c49d2a37 100644
|
||||
--- a/src/main/java/net/minecraft/world/entity/Entity.java
|
||||
+++ b/src/main/java/net/minecraft/world/entity/Entity.java
|
||||
@@ -787,7 +787,7 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource {
|
||||
@@ -792,7 +792,7 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource, S
|
||||
// CraftBukkit start
|
||||
public void postTick() {
|
||||
// No clean way to break out of ticking once the entity has been copied to a new world, so instead we move the portalling later in the tick cycle
|
@ -5,10 +5,10 @@ Subject: [PATCH] Prevent excessive velocity through repeated crits
|
||||
|
||||
|
||||
diff --git a/src/main/java/net/minecraft/world/entity/LivingEntity.java b/src/main/java/net/minecraft/world/entity/LivingEntity.java
|
||||
index bbeb81980b847a65f8d57eb6caf26aae63ee2061..1e0dfa8e04e02e552d9233c12be915778bb6e09c 100644
|
||||
index 46e3f01c2158ec327a0daa232be1e7fb6d40a90e..73abe652304b20cc9549c578866c482647b92488 100644
|
||||
--- a/src/main/java/net/minecraft/world/entity/LivingEntity.java
|
||||
+++ b/src/main/java/net/minecraft/world/entity/LivingEntity.java
|
||||
@@ -2680,13 +2680,26 @@ public abstract class LivingEntity extends Entity implements Attackable {
|
||||
@@ -2677,13 +2677,26 @@ public abstract class LivingEntity extends Entity implements Attackable {
|
||||
return this.hasEffect(MobEffects.JUMP) ? 0.1F * ((float) this.getEffect(MobEffects.JUMP).getAmplifier() + 1.0F) : 0.0F;
|
||||
}
|
||||
|
@ -7,10 +7,10 @@ Subject: [PATCH] Remove client-side code using deprecated for removal
|
||||
Fixes warnings on build
|
||||
|
||||
diff --git a/src/main/java/net/minecraft/Util.java b/src/main/java/net/minecraft/Util.java
|
||||
index a17e61f6f59eae179b76179985a9bd7a32a7e40a..5c1503f5b173138fc9e918d5562a981ca8b66d06 100644
|
||||
index 7be16ce8c8582d8587c4d1cb4c099fa6fe5f1324..22dfe70df68b35e313f94b17a87e4121392b17b4 100644
|
||||
--- a/src/main/java/net/minecraft/Util.java
|
||||
+++ b/src/main/java/net/minecraft/Util.java
|
||||
@@ -910,17 +910,7 @@ public class Util {
|
||||
@@ -955,17 +955,7 @@ public class Util {
|
||||
}
|
||||
|
||||
public void openUrl(URL url) {
|
@ -5,7 +5,7 @@ Subject: [PATCH] Prevent sending oversized item data in equipment and metadata
|
||||
|
||||
|
||||
diff --git a/src/main/java/net/minecraft/network/syncher/EntityDataSerializers.java b/src/main/java/net/minecraft/network/syncher/EntityDataSerializers.java
|
||||
index 97da8896865ff0bdd4fe8f2155b0830b42051bb1..9ca897d92c5bdd2764d114c74d64c776674d6beb 100644
|
||||
index f9e15908143f4453c2a5817b412e8a13554553f0..06498788c169133bd563c5a87192b71802c4d4df 100644
|
||||
--- a/src/main/java/net/minecraft/network/syncher/EntityDataSerializers.java
|
||||
+++ b/src/main/java/net/minecraft/network/syncher/EntityDataSerializers.java
|
||||
@@ -42,7 +42,7 @@ public class EntityDataSerializers {
|
||||
@ -34,10 +34,10 @@ index e0802f1cb73a80b08482832c2b269ac8485d5c1a..8d2870c780c4c253f6570c7ef73f6e7c
|
||||
}
|
||||
|
||||
diff --git a/src/main/java/net/minecraft/world/entity/LivingEntity.java b/src/main/java/net/minecraft/world/entity/LivingEntity.java
|
||||
index 1e0dfa8e04e02e552d9233c12be915778bb6e09c..c2d06bd94c829e1e9cf00c20e5e2547c60d4b0ff 100644
|
||||
index 73abe652304b20cc9549c578866c482647b92488..f019f53efb1cd84a45f5e99d406a01b00dd0322e 100644
|
||||
--- a/src/main/java/net/minecraft/world/entity/LivingEntity.java
|
||||
+++ b/src/main/java/net/minecraft/world/entity/LivingEntity.java
|
||||
@@ -3191,7 +3191,10 @@ public abstract class LivingEntity extends Entity implements Attackable {
|
||||
@@ -3188,7 +3188,10 @@ public abstract class LivingEntity extends Entity implements Attackable {
|
||||
equipmentChanges.forEach((enumitemslot, itemstack) -> {
|
||||
ItemStack itemstack1 = itemstack.copy();
|
||||
|
||||
@ -49,7 +49,7 @@ index 1e0dfa8e04e02e552d9233c12be915778bb6e09c..c2d06bd94c829e1e9cf00c20e5e2547c
|
||||
switch (enumitemslot.getType()) {
|
||||
case HAND:
|
||||
this.setLastHandItem(enumitemslot, itemstack1);
|
||||
@@ -3204,6 +3207,34 @@ public abstract class LivingEntity extends Entity implements Attackable {
|
||||
@@ -3201,6 +3204,34 @@ public abstract class LivingEntity extends Entity implements Attackable {
|
||||
((ServerLevel) this.level()).getChunkSource().broadcast(this, new ClientboundSetEquipmentPacket(this.getId(), list));
|
||||
}
|
||||
|
@ -18,10 +18,10 @@ index 8d2870c780c4c253f6570c7ef73f6e7c2ccc46ad..0cbb5dd17c5b37ad90ce11a31b644707
|
||||
}
|
||||
}
|
||||
diff --git a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
|
||||
index 67d9e636b424a91ab1f1478b757016099ca915dc..2898712d34dc5dd1f2e505746c515f773de2b0d8 100644
|
||||
index 20b204c87bb7173d9e402a603009c4b8e56dd614..227bc753015b1c3e390df4f812f8f06d008036eb 100644
|
||||
--- a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
|
||||
+++ b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
|
||||
@@ -2551,8 +2551,8 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl
|
||||
@@ -2559,8 +2559,8 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl
|
||||
// Refresh the current entity metadata
|
||||
entity.getEntityData().refresh(ServerGamePacketListenerImpl.this.player);
|
||||
// SPIGOT-7136 - Allays
|
||||
@ -33,10 +33,10 @@ index 67d9e636b424a91ab1f1478b757016099ca915dc..2898712d34dc5dd1f2e505746c515f77
|
||||
}
|
||||
}
|
||||
diff --git a/src/main/java/net/minecraft/world/entity/LivingEntity.java b/src/main/java/net/minecraft/world/entity/LivingEntity.java
|
||||
index c2d06bd94c829e1e9cf00c20e5e2547c60d4b0ff..e0e9a1a0becd4754f4ee1a53e7a91206da22ac45 100644
|
||||
index f019f53efb1cd84a45f5e99d406a01b00dd0322e..f5f612c3114c10bff6cecea2900f3c8f79370fd4 100644
|
||||
--- a/src/main/java/net/minecraft/world/entity/LivingEntity.java
|
||||
+++ b/src/main/java/net/minecraft/world/entity/LivingEntity.java
|
||||
@@ -3193,7 +3193,7 @@ public abstract class LivingEntity extends Entity implements Attackable {
|
||||
@@ -3190,7 +3190,7 @@ public abstract class LivingEntity extends Entity implements Attackable {
|
||||
|
||||
// Paper start - prevent oversized data
|
||||
ItemStack toSend = sanitizeItemStack(itemstack1, true);
|
||||
@ -45,7 +45,7 @@ index c2d06bd94c829e1e9cf00c20e5e2547c60d4b0ff..e0e9a1a0becd4754f4ee1a53e7a91206
|
||||
// Paper end
|
||||
switch (enumitemslot.getType()) {
|
||||
case HAND:
|
||||
@@ -3207,6 +3207,77 @@ public abstract class LivingEntity extends Entity implements Attackable {
|
||||
@@ -3204,6 +3204,77 @@ public abstract class LivingEntity extends Entity implements Attackable {
|
||||
((ServerLevel) this.level()).getChunkSource().broadcast(this, new ClientboundSetEquipmentPacket(this.getId(), list));
|
||||
}
|
||||
|
@ -13,16 +13,11 @@ Co-authored-by: Noah van der Aa <ndvdaa@gmail.com>
|
||||
Co-authored-by: Lulu13022002 <41980282+Lulu13022002@users.noreply.github.com>
|
||||
|
||||
diff --git a/src/main/java/net/minecraft/world/level/block/CaveVinesBlock.java b/src/main/java/net/minecraft/world/level/block/CaveVinesBlock.java
|
||||
index e628b4d6683eb0bc4f83c12480ab750ecbc1599b..ead7b37122c76d43af2cdd17af7f0da8014efb26 100644
|
||||
index 95f897b9ef73c880aff1cfe35fe490683badfd44..54916c80720f219bf747250a2ff9a875f180c7a2 100644
|
||||
--- a/src/main/java/net/minecraft/world/level/block/CaveVinesBlock.java
|
||||
+++ b/src/main/java/net/minecraft/world/level/block/CaveVinesBlock.java
|
||||
@@ -47,9 +47,17 @@ public class CaveVinesBlock extends GrowingPlantHeadBlock implements Bonemealabl
|
||||
|
||||
@Override
|
||||
protected BlockState getGrowIntoState(BlockState state, RandomSource random) {
|
||||
- return super.getGrowIntoState(state, random).setValue(BERRIES, Boolean.valueOf(random.nextFloat() < 0.11F));
|
||||
+ // Paper start
|
||||
+ return this.getGrowIntoState(state, random, null);
|
||||
@@ -51,9 +51,17 @@ public class CaveVinesBlock extends GrowingPlantHeadBlock implements Bonemealabl
|
||||
return to.setValue(BERRIES, from.getValue(BERRIES));
|
||||
}
|
||||
|
||||
+ @Override
|
||||
@ -33,13 +28,18 @@ index e628b4d6683eb0bc4f83c12480ab750ecbc1599b..ead7b37122c76d43af2cdd17af7f0da8
|
||||
+ // Paper end
|
||||
+
|
||||
@Override
|
||||
public ItemStack getCloneItemStack(BlockGetter world, BlockPos pos, BlockState state) {
|
||||
return new ItemStack(Items.GLOW_BERRIES);
|
||||
protected BlockState getGrowIntoState(BlockState state, RandomSource random) {
|
||||
- return super.getGrowIntoState(state, random).setValue(BERRIES, Boolean.valueOf(random.nextFloat() < 0.11F));
|
||||
+ // Paper start
|
||||
+ return this.getGrowIntoState(state, random, null);
|
||||
}
|
||||
|
||||
@Override
|
||||
diff --git a/src/main/java/net/minecraft/world/level/block/CropBlock.java b/src/main/java/net/minecraft/world/level/block/CropBlock.java
|
||||
index c5608f72a8f2ad2640f32fa63c69a6ef69d746da..6365ddea0c23bc5d4009d98915f2b39aed2a0328 100644
|
||||
index 76c12b34aac276fc9375135dac1c2018fdd7d756..9550ce8588c6aa3ba4cbbbb86912eae2b452eb01 100644
|
||||
--- a/src/main/java/net/minecraft/world/level/block/CropBlock.java
|
||||
+++ b/src/main/java/net/minecraft/world/level/block/CropBlock.java
|
||||
@@ -84,6 +84,10 @@ public class CropBlock extends BushBlock implements BonemealableBlock {
|
||||
@@ -91,6 +91,10 @@ public class CropBlock extends BushBlock implements BonemealableBlock {
|
||||
modifier = world.spigotConfig.carrotModifier;
|
||||
} else if (this == Blocks.POTATOES) {
|
||||
modifier = world.spigotConfig.potatoModifier;
|
||||
@ -51,10 +51,10 @@ index c5608f72a8f2ad2640f32fa63c69a6ef69d746da..6365ddea0c23bc5d4009d98915f2b39a
|
||||
modifier = world.spigotConfig.wheatModifier;
|
||||
}
|
||||
diff --git a/src/main/java/net/minecraft/world/level/block/GrowingPlantHeadBlock.java b/src/main/java/net/minecraft/world/level/block/GrowingPlantHeadBlock.java
|
||||
index d123f476ce2573bf3b5ee964cf515e9b07c60cec..b325fdec8eb99ce57152a5c0fefa5059685276e4 100644
|
||||
index b74e61064926a7c7fb03286651ea52c150f86107..4ebdc4918131a15a1c91b45e8ceb1392bca20a81 100644
|
||||
--- a/src/main/java/net/minecraft/world/level/block/GrowingPlantHeadBlock.java
|
||||
+++ b/src/main/java/net/minecraft/world/level/block/GrowingPlantHeadBlock.java
|
||||
@@ -56,12 +56,18 @@ public abstract class GrowingPlantHeadBlock extends GrowingPlantBlock implements
|
||||
@@ -60,12 +60,18 @@ public abstract class GrowingPlantHeadBlock extends GrowingPlantBlock implements
|
||||
BlockPos blockposition1 = pos.relative(this.growthDirection);
|
||||
|
||||
if (this.canGrowInto(world.getBlockState(blockposition1))) {
|
||||
@ -75,10 +75,10 @@ index d123f476ce2573bf3b5ee964cf515e9b07c60cec..b325fdec8eb99ce57152a5c0fefa5059
|
||||
return (BlockState) state.cycle(GrowingPlantHeadBlock.AGE);
|
||||
}
|
||||
diff --git a/src/main/java/net/minecraft/world/level/block/MangrovePropaguleBlock.java b/src/main/java/net/minecraft/world/level/block/MangrovePropaguleBlock.java
|
||||
index 2aab37b35214432b472414a81c314e3b5e7f1201..cf240750aecc57d287efc986b471e66a860850ee 100644
|
||||
index 3c0b0732cdea6c98c58c9639be3a6971575df85b..7ee8832820dd3f0c97fc68cab40d23f58ed21c31 100644
|
||||
--- a/src/main/java/net/minecraft/world/level/block/MangrovePropaguleBlock.java
|
||||
+++ b/src/main/java/net/minecraft/world/level/block/MangrovePropaguleBlock.java
|
||||
@@ -89,7 +89,7 @@ public class MangrovePropaguleBlock extends SaplingBlock implements SimpleWaterl
|
||||
@@ -100,7 +100,7 @@ public class MangrovePropaguleBlock extends SaplingBlock implements SimpleWaterl
|
||||
@Override
|
||||
public void randomTick(BlockState state, ServerLevel world, BlockPos pos, RandomSource random) {
|
||||
if (!isHanging(state)) {
|
||||
@ -88,10 +88,10 @@ index 2aab37b35214432b472414a81c314e3b5e7f1201..cf240750aecc57d287efc986b471e66a
|
||||
}
|
||||
|
||||
diff --git a/src/main/java/net/minecraft/world/level/block/PitcherCropBlock.java b/src/main/java/net/minecraft/world/level/block/PitcherCropBlock.java
|
||||
index 20fdd6cc35bec8f707a83fb682257f68163ed6fc..aca205d641b4a87d093b140585cf04fa4fefca86 100644
|
||||
index c80a3ee02f3af146926a3611779fd0af298a8ac1..ba94ff948ccaddc16d3452306722759c115bb90a 100644
|
||||
--- a/src/main/java/net/minecraft/world/level/block/PitcherCropBlock.java
|
||||
+++ b/src/main/java/net/minecraft/world/level/block/PitcherCropBlock.java
|
||||
@@ -112,7 +112,7 @@ public class PitcherCropBlock extends DoublePlantBlock implements BonemealableBl
|
||||
@@ -119,7 +119,7 @@ public class PitcherCropBlock extends DoublePlantBlock implements BonemealableBl
|
||||
@Override
|
||||
public void randomTick(BlockState state, ServerLevel world, BlockPos pos, RandomSource random) {
|
||||
float f = CropBlock.getGrowthSpeed(this, world, pos);
|
@ -5,7 +5,7 @@ Subject: [PATCH] Add PlayerItemFrameChangeEvent
|
||||
|
||||
|
||||
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 dc999068891bfdfd4873ca939b4c4389d63f4415..a86472cce8e8fcde16d761842fe443a619f6e305 100644
|
||||
index 8289ea080aa297f75cdbc8d591d6efa6a0def0ea..63ef00eb6f93a471de1e9c2355099d9dd3a71dd9 100644
|
||||
--- a/src/main/java/net/minecraft/world/entity/decoration/ItemFrame.java
|
||||
+++ b/src/main/java/net/minecraft/world/entity/decoration/ItemFrame.java
|
||||
@@ -3,6 +3,7 @@ package net.minecraft.world.entity.decoration;
|
||||
@ -16,7 +16,7 @@ index dc999068891bfdfd4873ca939b4c4389d63f4415..a86472cce8e8fcde16d761842fe443a6
|
||||
import net.minecraft.core.BlockPos;
|
||||
import net.minecraft.core.Direction;
|
||||
import net.minecraft.nbt.CompoundTag;
|
||||
@@ -190,6 +191,13 @@ public class ItemFrame extends HangingEntity {
|
||||
@@ -185,6 +186,13 @@ public class ItemFrame extends HangingEntity {
|
||||
return true;
|
||||
}
|
||||
// CraftBukkit end
|
||||
@ -30,7 +30,7 @@ index dc999068891bfdfd4873ca939b4c4389d63f4415..a86472cce8e8fcde16d761842fe443a6
|
||||
this.dropItem(source.getEntity(), false);
|
||||
this.gameEvent(GameEvent.BLOCK_CHANGE, source.getEntity());
|
||||
this.playSound(this.getRemoveItemSound(), 1.0F, 1.0F);
|
||||
@@ -456,13 +464,26 @@ public class ItemFrame extends HangingEntity {
|
||||
@@ -451,13 +459,26 @@ public class ItemFrame extends HangingEntity {
|
||||
}
|
||||
}
|
||||
|
@ -5,10 +5,10 @@ Subject: [PATCH] Allow delegation to vanilla chunk gen
|
||||
|
||||
|
||||
diff --git a/src/main/java/org/bukkit/craftbukkit/CraftServer.java b/src/main/java/org/bukkit/craftbukkit/CraftServer.java
|
||||
index 443ffc28a387c6d29f841288da1bf93e45f30c9b..dbddca7d3188c7729d276159f2fb05300fdd97ed 100644
|
||||
index dcb3bc211b834aa6fd4cb19197debc93df3f4839..77ca534fda8bf1a36e51e857dcbc1d4f5fe5c6de 100644
|
||||
--- a/src/main/java/org/bukkit/craftbukkit/CraftServer.java
|
||||
+++ b/src/main/java/org/bukkit/craftbukkit/CraftServer.java
|
||||
@@ -2427,6 +2427,88 @@ public final class CraftServer implements Server {
|
||||
@@ -2459,6 +2459,88 @@ public final class CraftServer implements Server {
|
||||
return new OldCraftChunkData(world.getMinHeight(), world.getMaxHeight(), handle.registryAccess().registryOrThrow(Registries.BIOME), world); // Paper - Anti-Xray - Add parameters
|
||||
}
|
||||
|
@ -2204,10 +2204,10 @@ index d0a8092bf57a29ab7c00ec0ddf52a9fdb2a33267..392406722b0a040c1d41fdc1154d75d3
|
||||
private Direction(int id, int idOpposite, int idHorizontal, String name, Direction.AxisDirection direction, Direction.Axis axis, Vec3i vector) {
|
||||
this.data3d = id;
|
||||
diff --git a/src/main/java/net/minecraft/server/level/ServerPlayer.java b/src/main/java/net/minecraft/server/level/ServerPlayer.java
|
||||
index e45fc21532911aedacd99315386857e8e54ade32..97054a83f90cd1dc440b7c319c91014b237e36dc 100644
|
||||
index 4d39c57941dcefc2c507f69adea2b042bc78662b..eed929059c7ee445a9ae6dbf778c4e2638311ca0 100644
|
||||
--- a/src/main/java/net/minecraft/server/level/ServerPlayer.java
|
||||
+++ b/src/main/java/net/minecraft/server/level/ServerPlayer.java
|
||||
@@ -462,7 +462,7 @@ public class ServerPlayer extends Player {
|
||||
@@ -469,7 +469,7 @@ public class ServerPlayer extends Player {
|
||||
|
||||
if (blockposition1 != null) {
|
||||
this.moveTo(blockposition1, 0.0F, 0.0F);
|
||||
@ -2216,7 +2216,7 @@ index e45fc21532911aedacd99315386857e8e54ade32..97054a83f90cd1dc440b7c319c91014b
|
||||
break;
|
||||
}
|
||||
}
|
||||
@@ -470,7 +470,7 @@ public class ServerPlayer extends Player {
|
||||
@@ -477,7 +477,7 @@ public class ServerPlayer extends Player {
|
||||
} else {
|
||||
this.moveTo(blockposition, 0.0F, 0.0F);
|
||||
|
||||
@ -2226,10 +2226,10 @@ index e45fc21532911aedacd99315386857e8e54ade32..97054a83f90cd1dc440b7c319c91014b
|
||||
}
|
||||
}
|
||||
diff --git a/src/main/java/net/minecraft/server/players/PlayerList.java b/src/main/java/net/minecraft/server/players/PlayerList.java
|
||||
index b06f36138bfda3f9802ee15e57e1895d8fe16c54..9010da755303a9c5bb9a2fbacaf6bcfd6db9e3af 100644
|
||||
index 3b5a498a602b2cafb58a0130227eb6d4e8f3802d..c92545e3cd199c7e123f65d42ca8976d2da27509 100644
|
||||
--- a/src/main/java/net/minecraft/server/players/PlayerList.java
|
||||
+++ b/src/main/java/net/minecraft/server/players/PlayerList.java
|
||||
@@ -913,7 +913,7 @@ public abstract class PlayerList {
|
||||
@@ -911,7 +911,7 @@ public abstract class PlayerList {
|
||||
entityplayer1.forceSetPositionRotation(location.getX(), location.getY(), location.getZ(), location.getYaw(), location.getPitch());
|
||||
|
||||
worldserver1.getChunkSource().addRegionTicket(net.minecraft.server.level.TicketType.POST_TELEPORT, new net.minecraft.world.level.ChunkPos(location.getBlockX() >> 4, location.getBlockZ() >> 4), 1, entityplayer.getId()); // Paper
|
||||
@ -2239,10 +2239,10 @@ index b06f36138bfda3f9802ee15e57e1895d8fe16c54..9010da755303a9c5bb9a2fbacaf6bcfd
|
||||
entityplayer1.setPos(entityplayer1.getX(), entityplayer1.getY() + 1.0D, entityplayer1.getZ());
|
||||
}
|
||||
diff --git a/src/main/java/net/minecraft/world/entity/Entity.java b/src/main/java/net/minecraft/world/entity/Entity.java
|
||||
index 21029c7e00f7815ac6f6c8931571e4259ea56742..9541025ac61c0f71a4e1550b598b1e6bce278605 100644
|
||||
index 3a3cc572369f4eab96d748d97af97f02c49d2a37..3a0bae57ba9888849dd8227b29a79fb682077911 100644
|
||||
--- a/src/main/java/net/minecraft/world/entity/Entity.java
|
||||
+++ b/src/main/java/net/minecraft/world/entity/Entity.java
|
||||
@@ -1210,9 +1210,44 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource {
|
||||
@@ -1215,9 +1215,44 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource, S
|
||||
float f = this.getBlockSpeedFactor();
|
||||
|
||||
this.setDeltaMovement(this.getDeltaMovement().multiply((double) f, 1.0D, (double) f));
|
||||
@ -2290,7 +2290,7 @@ index 21029c7e00f7815ac6f6c8931571e4259ea56742..9541025ac61c0f71a4e1550b598b1e6b
|
||||
if (this.remainingFireTicks <= 0) {
|
||||
this.setRemainingFireTicks(-this.getFireImmuneTicks());
|
||||
}
|
||||
@@ -1392,32 +1427,86 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource {
|
||||
@@ -1397,32 +1432,86 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource, S
|
||||
}
|
||||
|
||||
private Vec3 collide(Vec3 movement) {
|
||||
@ -2393,7 +2393,7 @@ index 21029c7e00f7815ac6f6c8931571e4259ea56742..9541025ac61c0f71a4e1550b598b1e6b
|
||||
}
|
||||
|
||||
public static Vec3 collideBoundingBox(@Nullable Entity entity, Vec3 movement, AABB entityBoundingBox, Level world, List<VoxelShape> collisions) {
|
||||
@@ -2598,11 +2687,70 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource {
|
||||
@@ -2627,11 +2716,70 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource, S
|
||||
float f = this.dimensions.width * 0.8F;
|
||||
AABB axisalignedbb = AABB.ofSize(this.getEyePosition(), (double) f, 1.0E-6D, (double) f);
|
||||
|
||||
@ -2469,7 +2469,7 @@ index 21029c7e00f7815ac6f6c8931571e4259ea56742..9541025ac61c0f71a4e1550b598b1e6b
|
||||
}
|
||||
|
||||
diff --git a/src/main/java/net/minecraft/world/entity/decoration/ArmorStand.java b/src/main/java/net/minecraft/world/entity/decoration/ArmorStand.java
|
||||
index d972c59ec98e73d7ccd774e0f06c686251ffe4cf..9dcf28bdcb5770a191e62353a60c953731671283 100644
|
||||
index 483d8c627a60e04f66f0135a8d64e6d5366e0997..68fc2f614253f43ed9b09f54ca06aabb2bdd8fe3 100644
|
||||
--- a/src/main/java/net/minecraft/world/entity/decoration/ArmorStand.java
|
||||
+++ b/src/main/java/net/minecraft/world/entity/decoration/ArmorStand.java
|
||||
@@ -353,7 +353,7 @@ public class ArmorStand extends LivingEntity {
|
||||
@ -2495,7 +2495,7 @@ index a3eaf80b020c3bbc0306c5d17659ee661dfd275b..1b6f72932fbdd567a1534bcf15e8a610
|
||||
}
|
||||
|
||||
diff --git a/src/main/java/net/minecraft/world/level/ClipContext.java b/src/main/java/net/minecraft/world/level/ClipContext.java
|
||||
index ad2c533e9a0f0e2d97620b0e16200d7eeaedeefb..6cda651b7a44867947053538cb40e1126b4ba550 100644
|
||||
index 86a4f30c8784c602436ecf1c78efb0bdca4b7089..b0bea28e9261767c60d30fb0e76f4f3af8a5634e 100644
|
||||
--- a/src/main/java/net/minecraft/world/level/ClipContext.java
|
||||
+++ b/src/main/java/net/minecraft/world/level/ClipContext.java
|
||||
@@ -17,8 +17,8 @@ public class ClipContext {
|
||||
@ -2629,10 +2629,10 @@ index a25497eec004add7408a63b1a0f09e3fa443b324..9f892de55ab03367daed4c30cc44c9dd
|
||||
|
||||
// Paper start
|
||||
diff --git a/src/main/java/net/minecraft/world/level/Level.java b/src/main/java/net/minecraft/world/level/Level.java
|
||||
index 5e7a53d1cae4c94a08fb89d7599d183de21cdfaa..330ce28f128ff2e5ca80f0938ac3ea7b195e9d82 100644
|
||||
index fe263132ed204dbd1b939d92dc16eec40162fb76..dbabf221bb0d49a2632728a6d04ff3e55a7d5898 100644
|
||||
--- a/src/main/java/net/minecraft/world/level/Level.java
|
||||
+++ b/src/main/java/net/minecraft/world/level/Level.java
|
||||
@@ -297,6 +297,10 @@ public abstract class Level implements LevelAccessor, AutoCloseable {
|
||||
@@ -300,6 +300,10 @@ public abstract class Level implements LevelAccessor, AutoCloseable {
|
||||
this.entityLimiter = new org.spigotmc.TickLimiter(this.spigotConfig.entityMaxTickTime);
|
||||
this.tileLimiter = new org.spigotmc.TickLimiter(this.spigotConfig.tileMaxTickTime);
|
||||
this.chunkPacketBlockController = this.paperConfig().anticheat.antiXray.enabled ? new com.destroystokyo.paper.antixray.ChunkPacketBlockControllerAntiXray(this, executor) : com.destroystokyo.paper.antixray.ChunkPacketBlockController.NO_OPERATION_INSTANCE; // Paper - Anti-Xray
|
||||
@ -2643,7 +2643,7 @@ index 5e7a53d1cae4c94a08fb89d7599d183de21cdfaa..330ce28f128ff2e5ca80f0938ac3ea7b
|
||||
}
|
||||
|
||||
// Paper start
|
||||
@@ -338,6 +342,370 @@ public abstract class Level implements LevelAccessor, AutoCloseable {
|
||||
@@ -341,6 +345,370 @@ public abstract class Level implements LevelAccessor, AutoCloseable {
|
||||
return true;
|
||||
}
|
||||
// Paper end
|
||||
@ -3014,7 +3014,7 @@ index 5e7a53d1cae4c94a08fb89d7599d183de21cdfaa..330ce28f128ff2e5ca80f0938ac3ea7b
|
||||
@Override
|
||||
public boolean isClientSide() {
|
||||
return this.isClientSide;
|
||||
@@ -952,7 +1320,17 @@ public abstract class Level implements LevelAccessor, AutoCloseable {
|
||||
@@ -963,7 +1331,17 @@ public abstract class Level implements LevelAccessor, AutoCloseable {
|
||||
@Override
|
||||
public boolean noCollision(@Nullable Entity entity, AABB box) {
|
||||
if (entity instanceof net.minecraft.world.entity.decoration.ArmorStand && !entity.level().paperConfig().entities.armorStands.doCollisionEntityLookups) return false;
|
||||
@ -3034,10 +3034,10 @@ index 5e7a53d1cae4c94a08fb89d7599d183de21cdfaa..330ce28f128ff2e5ca80f0938ac3ea7b
|
||||
// Paper end
|
||||
|
||||
diff --git a/src/main/java/net/minecraft/world/level/block/Block.java b/src/main/java/net/minecraft/world/level/block/Block.java
|
||||
index 9522e646529f3d849471931b4b3c0d133e7fcfc5..6c6532e1e73154ab5e6cb18aea44d64870dbbf4f 100644
|
||||
index f0a85f1b48a911ffd8740df5ebe869e8f0371a58..7ac98b4e8b6dcc23777732d377ee73ae5671ebef 100644
|
||||
--- a/src/main/java/net/minecraft/world/level/block/Block.java
|
||||
+++ b/src/main/java/net/minecraft/world/level/block/Block.java
|
||||
@@ -277,7 +277,7 @@ public class Block extends BlockBehaviour implements ItemLike {
|
||||
@@ -284,7 +284,7 @@ public class Block extends BlockBehaviour implements ItemLike {
|
||||
}
|
||||
|
||||
public static boolean isShapeFullBlock(VoxelShape shape) {
|
||||
@ -3047,10 +3047,10 @@ index 9522e646529f3d849471931b4b3c0d133e7fcfc5..6c6532e1e73154ab5e6cb18aea44d648
|
||||
|
||||
public boolean propagatesSkylightDown(BlockState state, BlockGetter world, BlockPos pos) {
|
||||
diff --git a/src/main/java/net/minecraft/world/level/block/state/BlockBehaviour.java b/src/main/java/net/minecraft/world/level/block/state/BlockBehaviour.java
|
||||
index 96bdf69c8788aa0b1dff64789e6f13c856ee99ff..fc28bca0d31b01287f38405f795da577c6c89105 100644
|
||||
index 31dc96c371953eb7ca3d3b444b123ade1f24c909..84d7aeafafe1497d96dca2238b579007cbe27146 100644
|
||||
--- a/src/main/java/net/minecraft/world/level/block/state/BlockBehaviour.java
|
||||
+++ b/src/main/java/net/minecraft/world/level/block/state/BlockBehaviour.java
|
||||
@@ -815,6 +815,10 @@ public abstract class BlockBehaviour implements FeatureElement {
|
||||
@@ -882,6 +882,10 @@ public abstract class BlockBehaviour implements FeatureElement {
|
||||
this.instrument = blockbase_info.instrument;
|
||||
this.replaceable = blockbase_info.replaceable;
|
||||
this.conditionallyFullOpaque = this.isOpaque() & this.isTransparentOnSomeFaces(); // Paper
|
||||
@ -3061,7 +3061,7 @@ index 96bdf69c8788aa0b1dff64789e6f13c856ee99ff..fc28bca0d31b01287f38405f795da577
|
||||
}
|
||||
// Paper start - impl cached craft block data, lazy load to fix issue with loading at the wrong time
|
||||
private org.bukkit.craftbukkit.block.data.CraftBlockData cachedCraftBlockData;
|
||||
@@ -863,6 +867,52 @@ public abstract class BlockBehaviour implements FeatureElement {
|
||||
@@ -930,6 +934,52 @@ public abstract class BlockBehaviour implements FeatureElement {
|
||||
return this.conditionallyFullOpaque;
|
||||
}
|
||||
// Paper end - starlight
|
||||
@ -3114,7 +3114,7 @@ index 96bdf69c8788aa0b1dff64789e6f13c856ee99ff..fc28bca0d31b01287f38405f795da577
|
||||
|
||||
public void initCache() {
|
||||
this.fluidState = ((Block) this.owner).getFluidState(this.asState());
|
||||
@@ -874,6 +924,39 @@ public abstract class BlockBehaviour implements FeatureElement {
|
||||
@@ -941,6 +991,39 @@ public abstract class BlockBehaviour implements FeatureElement {
|
||||
this.opacityIfCached = this.cache == null || this.isConditionallyFullOpaque() ? -1 : this.cache.lightBlock; // Paper - starlight - cache opacity for light
|
||||
|
||||
this.legacySolid = this.calculateSolid();
|
||||
@ -3236,7 +3236,7 @@ index 55208b4889f4af60f2b2b66ed6b102b2cd0bb26b..e21f4c5aff3a8e97101f6efc1349fbec
|
||||
|
||||
if (!state.getBlock().hasDynamicShape() && !fromState.getBlock().hasDynamicShape()) {
|
||||
diff --git a/src/main/java/net/minecraft/world/phys/AABB.java b/src/main/java/net/minecraft/world/phys/AABB.java
|
||||
index f80783dc163997626850189f5647c06f9d15da6c..e3dbf3066337a482460238f8a94d854cf88adfa2 100644
|
||||
index b8443953de15066f32f629c0dd7e24bad750f558..67d595f75e0c3bffdb27b85b25ccd1f0bf1427d5 100644
|
||||
--- a/src/main/java/net/minecraft/world/phys/AABB.java
|
||||
+++ b/src/main/java/net/minecraft/world/phys/AABB.java
|
||||
@@ -25,6 +25,17 @@ public class AABB {
|
@ -8,10 +8,10 @@ Move collision logic to just the hasNewCollision call instead of getCubes + hasN
|
||||
CHECK ME
|
||||
|
||||
diff --git a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
|
||||
index 2898712d34dc5dd1f2e505746c515f773de2b0d8..5911fc7009a4bdf99f8016d440fbeb1ae9b44441 100644
|
||||
index 227bc753015b1c3e390df4f812f8f06d008036eb..01b4ee8cd74df6a2cedb81a6182fc4f8864f6e0e 100644
|
||||
--- a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
|
||||
+++ b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
|
||||
@@ -534,7 +534,7 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl
|
||||
@@ -537,7 +537,7 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl
|
||||
return;
|
||||
}
|
||||
|
||||
@ -20,7 +20,7 @@ index 2898712d34dc5dd1f2e505746c515f773de2b0d8..5911fc7009a4bdf99f8016d440fbeb1a
|
||||
|
||||
d6 = d3 - this.vehicleLastGoodX; // Paper - diff on change, used for checking large move vectors above
|
||||
d7 = d4 - this.vehicleLastGoodY - 1.0E-6D; // Paper - diff on change, used for checking large move vectors above
|
||||
@@ -550,6 +550,7 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl
|
||||
@@ -553,6 +553,7 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl
|
||||
}
|
||||
|
||||
entity.move(MoverType.PLAYER, new Vec3(d6, d7, d8));
|
||||
@ -28,7 +28,7 @@ index 2898712d34dc5dd1f2e505746c515f773de2b0d8..5911fc7009a4bdf99f8016d440fbeb1a
|
||||
double d11 = d7;
|
||||
|
||||
d6 = d3 - entity.getX();
|
||||
@@ -563,16 +564,24 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl
|
||||
@@ -566,16 +567,24 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl
|
||||
boolean flag2 = false;
|
||||
|
||||
if (d10 > org.spigotmc.SpigotConfig.movedWronglyThreshold) { // Spigot
|
||||
@ -56,7 +56,7 @@ index 2898712d34dc5dd1f2e505746c515f773de2b0d8..5911fc7009a4bdf99f8016d440fbeb1a
|
||||
entity.absMoveTo(d0, d1, d2, f, f1);
|
||||
this.player.absMoveTo(d0, d1, d2, this.player.getYRot(), this.player.getXRot()); // CraftBukkit
|
||||
this.send(new ClientboundMoveVehiclePacket(entity));
|
||||
@@ -658,7 +667,32 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl
|
||||
@@ -661,7 +670,32 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl
|
||||
}
|
||||
|
||||
private boolean noBlocksAround(Entity entity) {
|
||||
@ -90,7 +90,7 @@ index 2898712d34dc5dd1f2e505746c515f773de2b0d8..5911fc7009a4bdf99f8016d440fbeb1a
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -1235,7 +1269,7 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl
|
||||
@@ -1260,7 +1294,7 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl
|
||||
}
|
||||
|
||||
if (this.awaitingPositionFromClient != null) {
|
||||
@ -99,7 +99,7 @@ index 2898712d34dc5dd1f2e505746c515f773de2b0d8..5911fc7009a4bdf99f8016d440fbeb1a
|
||||
this.awaitingTeleportTime = this.tickCount;
|
||||
this.teleport(this.awaitingPositionFromClient.x, this.awaitingPositionFromClient.y, this.awaitingPositionFromClient.z, this.player.getYRot(), this.player.getXRot());
|
||||
}
|
||||
@@ -1328,7 +1362,7 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl
|
||||
@@ -1355,7 +1389,7 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl
|
||||
}
|
||||
}
|
||||
|
||||
@ -108,7 +108,7 @@ index 2898712d34dc5dd1f2e505746c515f773de2b0d8..5911fc7009a4bdf99f8016d440fbeb1a
|
||||
|
||||
d6 = d0 - this.lastGoodX; // Paper - diff on change, used for checking large move vectors above
|
||||
d7 = d1 - this.lastGoodY; // Paper - diff on change, used for checking large move vectors above
|
||||
@@ -1370,6 +1404,7 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl
|
||||
@@ -1397,6 +1431,7 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl
|
||||
|
||||
this.player.move(MoverType.PLAYER, new Vec3(d6, d7, d8));
|
||||
this.player.onGround = packet.isOnGround(); // CraftBukkit - SPIGOT-5810, SPIGOT-5835, SPIGOT-6828: reset by this.player.move
|
||||
@ -116,7 +116,7 @@ index 2898712d34dc5dd1f2e505746c515f773de2b0d8..5911fc7009a4bdf99f8016d440fbeb1a
|
||||
// Paper start - prevent position desync
|
||||
if (this.awaitingPositionFromClient != null) {
|
||||
return; // ... thanks Mojang for letting move calls teleport across dimensions.
|
||||
@@ -1388,11 +1423,23 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl
|
||||
@@ -1415,11 +1450,23 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl
|
||||
boolean flag2 = false;
|
||||
|
||||
if (!this.player.isChangingDimension() && d10 > org.spigotmc.SpigotConfig.movedWronglyThreshold && !this.player.isSleeping() && !this.player.gameMode.isCreative() && this.player.gameMode.getGameModeForPlayer() != GameType.SPECTATOR) { // Spigot
|
||||
@ -142,7 +142,7 @@ index 2898712d34dc5dd1f2e505746c515f773de2b0d8..5911fc7009a4bdf99f8016d440fbeb1a
|
||||
this.internalTeleport(d3, d4, d5, f, f1, Collections.emptySet()); // CraftBukkit - SPIGOT-1807: Don't call teleport event, when the client thinks the player is falling, because the chunks are not loaded on the client yet.
|
||||
this.player.doCheckFallDamage(this.player.getX() - d3, this.player.getY() - d4, this.player.getZ() - d5, packet.isOnGround());
|
||||
} else {
|
||||
@@ -1478,6 +1525,33 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl
|
||||
@@ -1505,6 +1552,33 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl
|
||||
}
|
||||
}
|
||||
|
@ -6,10 +6,10 @@ Subject: [PATCH] Fix tripwire state inconsistency
|
||||
This patch prevents updating and re-setting the tripwire when being removed in certain conditions
|
||||
|
||||
diff --git a/src/main/java/net/minecraft/world/level/block/TripWireBlock.java b/src/main/java/net/minecraft/world/level/block/TripWireBlock.java
|
||||
index 336ffc27ea75fd8fd037c20b931233dc611084f3..a4ceb86f2c1bbd7d76d07532ed8a512722b01381 100644
|
||||
index bbb7d1b03c78758d608e89129aacec151242831c..1a0c5fb62e80681604110e95c1ae7b3684c21946 100644
|
||||
--- a/src/main/java/net/minecraft/world/level/block/TripWireBlock.java
|
||||
+++ b/src/main/java/net/minecraft/world/level/block/TripWireBlock.java
|
||||
@@ -74,7 +74,7 @@ public class TripWireBlock extends Block {
|
||||
@@ -87,7 +87,7 @@ public class TripWireBlock extends Block {
|
||||
@Override
|
||||
public void onRemove(BlockState state, Level world, BlockPos pos, BlockState newState, boolean moved) {
|
||||
if (!moved && !state.is(newState.getBlock())) {
|
||||
@ -18,7 +18,7 @@ index 336ffc27ea75fd8fd037c20b931233dc611084f3..a4ceb86f2c1bbd7d76d07532ed8a5127
|
||||
}
|
||||
}
|
||||
|
||||
@@ -89,6 +89,12 @@ public class TripWireBlock extends Block {
|
||||
@@ -102,6 +102,12 @@ public class TripWireBlock extends Block {
|
||||
}
|
||||
|
||||
private void updateSource(Level world, BlockPos pos, BlockState state) {
|
||||
@ -31,37 +31,39 @@ index 336ffc27ea75fd8fd037c20b931233dc611084f3..a4ceb86f2c1bbd7d76d07532ed8a5127
|
||||
Direction[] aenumdirection = new Direction[]{Direction.SOUTH, Direction.WEST};
|
||||
int i = aenumdirection.length;
|
||||
int j = 0;
|
||||
@@ -104,7 +110,7 @@ public class TripWireBlock extends Block {
|
||||
@@ -117,7 +123,7 @@ public class TripWireBlock extends Block {
|
||||
|
||||
if (iblockdata1.is((Block) this.hook)) {
|
||||
if (iblockdata1.is(this.hook)) {
|
||||
if (iblockdata1.getValue(TripWireHookBlock.FACING) == enumdirection.getOpposite()) {
|
||||
- this.hook.calculateState(world, blockposition1, iblockdata1, false, true, k, state);
|
||||
+ this.hook.calculateState(world, blockposition1, iblockdata1, false, true, k, state, beingRemoved); // Paper - fix state inconsistency
|
||||
- TripWireHookBlock.calculateState(world, blockposition1, iblockdata1, false, true, k, state);
|
||||
+ TripWireHookBlock.calculateState(world, blockposition1, iblockdata1, false, true, k, state, beingRemoved); // Paper - fix state inconsistency
|
||||
}
|
||||
} else if (iblockdata1.is((Block) this)) {
|
||||
++k;
|
||||
diff --git a/src/main/java/net/minecraft/world/level/block/TripWireHookBlock.java b/src/main/java/net/minecraft/world/level/block/TripWireHookBlock.java
|
||||
index 4a516828e5c6abd63511ee7c93fcff11203cf8d0..004dce26ff073f1de52a84cd425c4f60fdab5e50 100644
|
||||
index 02b62ac13d4968f80cb0ae3702755d0f1d95e692..69629cc135e2b18725335bd2b91537021af2139a 100644
|
||||
--- a/src/main/java/net/minecraft/world/level/block/TripWireHookBlock.java
|
||||
+++ b/src/main/java/net/minecraft/world/level/block/TripWireHookBlock.java
|
||||
@@ -108,6 +108,12 @@ public class TripWireHookBlock extends Block {
|
||||
@@ -118,7 +118,13 @@ public class TripWireHookBlock extends Block {
|
||||
TripWireHookBlock.calculateState(world, pos, state, false, false, -1, (BlockState) null);
|
||||
}
|
||||
|
||||
public void calculateState(Level world, BlockPos pos, BlockState state, boolean beingRemoved, boolean flag1, int i, @Nullable BlockState iblockdata1) {
|
||||
- public static void calculateState(Level world, BlockPos pos, BlockState state, boolean flag, boolean flag1, int i, @Nullable BlockState iblockdata1) {
|
||||
+ public static void calculateState(Level world, BlockPos pos, BlockState state, boolean beingRemoved, boolean flag1, int i, @Nullable BlockState iblockdata1) {
|
||||
+ // Paper start - fix tripwire inconsistency
|
||||
+ this.calculateState(world, pos, state, beingRemoved, flag1, i, iblockdata1, false);
|
||||
+ calculateState(world, pos, state, beingRemoved, flag1, i, iblockdata1, false);
|
||||
+ }
|
||||
+
|
||||
+ public void calculateState(Level world, BlockPos pos, BlockState state, boolean beingRemoved, boolean flag1, int i, @Nullable BlockState iblockdata1, boolean tripWireBeingRemoved) {
|
||||
+ public static void calculateState(Level world, BlockPos pos, BlockState state, boolean beingRemoved, boolean flag1, int i, @Nullable BlockState iblockdata1, boolean tripWireBeingRemoved) {
|
||||
+ // Paper end
|
||||
Direction enumdirection = (Direction) state.getValue(TripWireHookBlock.FACING);
|
||||
boolean flag2 = (Boolean) state.getValue(TripWireHookBlock.ATTACHED);
|
||||
boolean flag3 = (Boolean) state.getValue(TripWireHookBlock.POWERED);
|
||||
@@ -141,6 +147,7 @@ public class TripWireHookBlock extends Block {
|
||||
boolean flag7 = (Boolean) iblockdata2.getValue(TripWireBlock.POWERED);
|
||||
Optional<Direction> optional = state.getOptionalValue(TripWireHookBlock.FACING);
|
||||
|
||||
flag5 |= flag6 && flag7;
|
||||
+ if (k != i || !tripWireBeingRemoved || !flag6) // Paper - don't update the tripwire again if being removed and not disarmed
|
||||
aiblockdata[k] = iblockdata2;
|
||||
if (k == i) {
|
||||
world.scheduleTick(pos, (Block) this, 10);
|
||||
if (optional.isPresent()) {
|
||||
@@ -156,6 +162,7 @@ public class TripWireHookBlock extends Block {
|
||||
boolean flag7 = (Boolean) iblockdata2.getValue(TripWireBlock.POWERED);
|
||||
|
||||
flag5 |= flag6 && flag7;
|
||||
+ if (k != i || !tripWireBeingRemoved || !flag6) // Paper - don't update the tripwire again if being removed and not disarmed
|
||||
aiblockdata[k] = iblockdata2;
|
||||
if (k == i) {
|
||||
world.scheduleTick(pos, block, 10);
|
@ -5,10 +5,10 @@ Subject: [PATCH] Forward CraftEntity in teleport command
|
||||
|
||||
|
||||
diff --git a/src/main/java/net/minecraft/world/entity/Entity.java b/src/main/java/net/minecraft/world/entity/Entity.java
|
||||
index 9541025ac61c0f71a4e1550b598b1e6bce278605..2d505eeff4ae0ba7417a2eab4dbe3adb47e3ca3e 100644
|
||||
index 3a0bae57ba9888849dd8227b29a79fb682077911..92b2e09ff556b1aad835f5e8e67e9af324ed964a 100644
|
||||
--- a/src/main/java/net/minecraft/world/entity/Entity.java
|
||||
+++ b/src/main/java/net/minecraft/world/entity/Entity.java
|
||||
@@ -3506,6 +3506,13 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource {
|
||||
@@ -3535,6 +3535,13 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource, S
|
||||
}
|
||||
|
||||
public void restoreFrom(Entity original) {
|
||||
@ -22,10 +22,10 @@ index 9541025ac61c0f71a4e1550b598b1e6bce278605..2d505eeff4ae0ba7417a2eab4dbe3adb
|
||||
CompoundTag nbttagcompound = original.saveWithoutId(new CompoundTag());
|
||||
|
||||
nbttagcompound.remove("Dimension");
|
||||
@@ -3592,10 +3599,10 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource {
|
||||
if (worldserver.getTypeKey() == LevelStem.END) { // CraftBukkit
|
||||
ServerLevel.makeObsidianPlatform(worldserver, this); // CraftBukkit
|
||||
@@ -3625,10 +3632,10 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource, S
|
||||
}
|
||||
}
|
||||
// CraftBukkit end
|
||||
- // CraftBukkit start - Forward the CraftEntity to the new entity
|
||||
- this.getBukkitEntity().setHandle(entity);
|
||||
- entity.bukkitEntity = this.getBukkitEntity();
|
@ -5,11 +5,11 @@ Subject: [PATCH] Improve scoreboard entries
|
||||
|
||||
|
||||
diff --git a/src/main/java/org/bukkit/craftbukkit/scoreboard/CraftObjective.java b/src/main/java/org/bukkit/craftbukkit/scoreboard/CraftObjective.java
|
||||
index 5a9adade82970d8101b946596370d104721ac086..58cd0a5fccb93b467ca5c31e9c9d5149cb85e30b 100644
|
||||
index da1e4496d78a2c1b258ff8bb316414cb8a662ba2..3157f3d2f9ce7af4a763203672817a7f5c7bd4fb 100644
|
||||
--- a/src/main/java/org/bukkit/craftbukkit/scoreboard/CraftObjective.java
|
||||
+++ b/src/main/java/org/bukkit/craftbukkit/scoreboard/CraftObjective.java
|
||||
@@ -145,6 +145,14 @@ final class CraftObjective extends CraftScoreboardComponent implements Objective
|
||||
return new CraftScore(this, entry);
|
||||
@@ -144,6 +144,14 @@ final class CraftObjective extends CraftScoreboardComponent implements Objective
|
||||
return new CraftScore(this, CraftScoreboard.getScoreHolder(entry));
|
||||
}
|
||||
|
||||
+ // Paper start
|
||||
@ -24,13 +24,13 @@ index 5a9adade82970d8101b946596370d104721ac086..58cd0a5fccb93b467ca5c31e9c9d5149
|
||||
public void unregister() {
|
||||
CraftScoreboard scoreboard = this.checkState();
|
||||
diff --git a/src/main/java/org/bukkit/craftbukkit/scoreboard/CraftScoreboard.java b/src/main/java/org/bukkit/craftbukkit/scoreboard/CraftScoreboard.java
|
||||
index 052389310826ee6b97cf27dfd952e0101fb2d097..a8c5bfc54ed2b8bd873f124c7080d73fe73a86ad 100644
|
||||
index 885addfdbae3730626b4f6b9781945496783c389..81889e30a634ac84d996f688d0a2466e9efa19ca 100644
|
||||
--- a/src/main/java/org/bukkit/craftbukkit/scoreboard/CraftScoreboard.java
|
||||
+++ b/src/main/java/org/bukkit/craftbukkit/scoreboard/CraftScoreboard.java
|
||||
@@ -233,4 +233,23 @@ public final class CraftScoreboard implements org.bukkit.scoreboard.Scoreboard {
|
||||
public Scoreboard getHandle() {
|
||||
return this.board;
|
||||
@@ -235,6 +235,26 @@ public final class CraftScoreboard implements org.bukkit.scoreboard.Scoreboard {
|
||||
this.board.setDisplayObjective(CraftScoreboardTranslations.fromBukkitSlot(slot), null);
|
||||
}
|
||||
|
||||
+ // Paper start
|
||||
+ @Override
|
||||
+ public ImmutableSet<Score> getScoresFor(org.bukkit.entity.Entity entity) throws IllegalArgumentException {
|
||||
@ -50,7 +50,10 @@ index 052389310826ee6b97cf27dfd952e0101fb2d097..a8c5bfc54ed2b8bd873f124c7080d73f
|
||||
+ return this.getEntryTeam(((org.bukkit.craftbukkit.entity.CraftEntity) entity).getHandle().getScoreboardName());
|
||||
+ }
|
||||
+ // Paper end
|
||||
}
|
||||
+
|
||||
// CraftBukkit method
|
||||
public Scoreboard getHandle() {
|
||||
return this.board;
|
||||
diff --git a/src/main/java/org/bukkit/craftbukkit/scoreboard/CraftTeam.java b/src/main/java/org/bukkit/craftbukkit/scoreboard/CraftTeam.java
|
||||
index 7900adb0b158bc17dd792dd082c338547bc1aa0a..27219bf2f16aed64c78623d44c3cc84aa9f47065 100644
|
||||
--- a/src/main/java/org/bukkit/craftbukkit/scoreboard/CraftTeam.java
|
@ -7,10 +7,10 @@ Subject: [PATCH] Entity powdered snow API
|
||||
public net.minecraft.world.entity.monster.Skeleton inPowderSnowTime
|
||||
|
||||
diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftEntity.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftEntity.java
|
||||
index 0c0e3727cc1d911a9949fcaf6dcd0820b172edc0..b17522b77382e8c781811ee4e176581ee1d40290 100644
|
||||
index 32fd3b7067894bc442bc5a74dbcf60164a8fd70f..c88cf1b476eb50a51c292f3c849513d653edde83 100644
|
||||
--- a/src/main/java/org/bukkit/craftbukkit/entity/CraftEntity.java
|
||||
+++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftEntity.java
|
||||
@@ -1397,5 +1397,10 @@ public abstract class CraftEntity implements org.bukkit.entity.Entity {
|
||||
@@ -1441,5 +1441,10 @@ public abstract class CraftEntity implements org.bukkit.entity.Entity {
|
||||
this.entity.setRot(location.getYaw(), location.getPitch());
|
||||
return !this.entity.valid && this.entity.level().addFreshEntity(this.entity, reason);
|
||||
}
|
@ -7,7 +7,7 @@ Subject: [PATCH] Add API for item entity health
|
||||
public net.minecraft.world.entity.item.ItemEntity health
|
||||
|
||||
diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftItem.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftItem.java
|
||||
index 953d3762292a4c15b063f9e237edf2f5c5362cb7..073643d7f83b974509cf2dd4ea41e3dd9cb90a0d 100644
|
||||
index cbdac5a439795d429a1364a7eafc4783cff51d54..b1bbab951ef9a3d2bd98cc54665ba824263542eb 100644
|
||||
--- a/src/main/java/org/bukkit/craftbukkit/entity/CraftItem.java
|
||||
+++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftItem.java
|
||||
@@ -98,6 +98,21 @@ public class CraftItem extends CraftEntity implements Item {
|
@ -10,10 +10,10 @@ when if this was fixed on the client, that wouldn't be needed.
|
||||
Mojira Issue: https://bugs.mojang.com/browse/MC-235045
|
||||
|
||||
diff --git a/src/main/java/net/minecraft/commands/CommandSourceStack.java b/src/main/java/net/minecraft/commands/CommandSourceStack.java
|
||||
index 7dfd18cfda943ea4486249e20d9763b8465c9601..0112035219b21550ca14fa1755c43a5547ca4136 100644
|
||||
index e58c2844356c71973d81b460a21aab795b506d77..20b2cbbc73f6420b6ace9746016527b90d9f01b9 100644
|
||||
--- a/src/main/java/net/minecraft/commands/CommandSourceStack.java
|
||||
+++ b/src/main/java/net/minecraft/commands/CommandSourceStack.java
|
||||
@@ -437,4 +437,20 @@ public class CommandSourceStack implements SharedSuggestionProvider, com.destroy
|
||||
@@ -447,4 +447,20 @@ public class CommandSourceStack implements ExecutionCommandSource<CommandSourceS
|
||||
return this.source.getBukkitSender(this);
|
||||
}
|
||||
// CraftBukkit end
|
||||
@ -35,10 +35,10 @@ index 7dfd18cfda943ea4486249e20d9763b8465c9601..0112035219b21550ca14fa1755c43a55
|
||||
+ // Paper end
|
||||
}
|
||||
diff --git a/src/main/java/net/minecraft/commands/Commands.java b/src/main/java/net/minecraft/commands/Commands.java
|
||||
index b201fd131864751bea1e926c6b23f9742eae1c8e..c704761bd5dae98f7c77780a4f7058b737fdb664 100644
|
||||
index 154cbcab900f4697f280a88d6307682a26f46bfc..0299b79f3643bf8c4f4da176c20fec64f4601228 100644
|
||||
--- a/src/main/java/net/minecraft/commands/Commands.java
|
||||
+++ b/src/main/java/net/minecraft/commands/Commands.java
|
||||
@@ -478,6 +478,7 @@ public class Commands {
|
||||
@@ -532,6 +532,7 @@ public class Commands {
|
||||
private void fillUsableCommands(CommandNode<CommandSourceStack> tree, CommandNode<SharedSuggestionProvider> result, CommandSourceStack source, Map<CommandNode<CommandSourceStack>, CommandNode<SharedSuggestionProvider>> resultNodes) {
|
||||
Iterator iterator = tree.getChildren().iterator();
|
||||
|
||||
@ -46,7 +46,7 @@ index b201fd131864751bea1e926c6b23f9742eae1c8e..c704761bd5dae98f7c77780a4f7058b7
|
||||
while (iterator.hasNext()) {
|
||||
CommandNode<CommandSourceStack> commandnode2 = (CommandNode) iterator.next();
|
||||
// Paper start
|
||||
@@ -504,6 +505,12 @@ public class Commands {
|
||||
@@ -558,6 +559,12 @@ public class Commands {
|
||||
|
||||
if (requiredargumentbuilder.getSuggestionsProvider() != null) {
|
||||
requiredargumentbuilder.suggests(SuggestionProviders.safelySwap(requiredargumentbuilder.getSuggestionsProvider()));
|
||||
@ -94,7 +94,7 @@ index 850db283bf12345e9e7d7e8e590dbe8135c6dce1..a71726cee91fb406875a4540c9fb7c0e
|
||||
|
||||
SharedSuggestionProvider.suggest((Iterable) iterable, suggestionsbuilder1);
|
||||
diff --git a/src/main/java/net/minecraft/commands/arguments/selector/EntitySelectorParser.java b/src/main/java/net/minecraft/commands/arguments/selector/EntitySelectorParser.java
|
||||
index 3e5774139132b58fa447bcdf622150c0c9733a86..799f34d1ddb6c504329637a5171d06a999c57c13 100644
|
||||
index 3d897ec6920eff6176ddac9f0442a997b9ef14fd..489b2ba7d4ef9c52a60db0c7e3fdd36226f5672d 100644
|
||||
--- a/src/main/java/net/minecraft/commands/arguments/selector/EntitySelectorParser.java
|
||||
+++ b/src/main/java/net/minecraft/commands/arguments/selector/EntitySelectorParser.java
|
||||
@@ -113,12 +113,19 @@ public class EntitySelectorParser {
|
||||
@ -118,12 +118,12 @@ index 3e5774139132b58fa447bcdf622150c0c9733a86..799f34d1ddb6c504329637a5171d06a9
|
||||
this.level = MinMaxBounds.Ints.ANY;
|
||||
this.rotX = WrappedMinMaxBounds.ANY;
|
||||
diff --git a/src/main/java/net/minecraft/commands/arguments/selector/options/EntitySelectorOptions.java b/src/main/java/net/minecraft/commands/arguments/selector/options/EntitySelectorOptions.java
|
||||
index a159ca2b6a2c6f3c69dbf4b499db57007d0df6aa..63c7c46eb5982a07b5dc0782d33e09c6c0fc44cf 100644
|
||||
index 7863833c9a761a2b9364ff572ec909ec5a4538c3..0b36bd0a02082e8ec0ebef537656547ee3f1d748 100644
|
||||
--- a/src/main/java/net/minecraft/commands/arguments/selector/options/EntitySelectorOptions.java
|
||||
+++ b/src/main/java/net/minecraft/commands/arguments/selector/options/EntitySelectorOptions.java
|
||||
@@ -69,6 +69,19 @@ public class EntitySelectorOptions {
|
||||
public static final DynamicCommandExceptionType ERROR_ENTITY_TYPE_INVALID = new DynamicCommandExceptionType((entity) -> {
|
||||
return Component.translatable("argument.entity.options.type.invalid", entity);
|
||||
return Component.translatableEscape("argument.entity.options.type.invalid", entity);
|
||||
});
|
||||
+ // Paper start
|
||||
+ public static final DynamicCommandExceptionType ERROR_ENTITY_TAG_INVALID = new DynamicCommandExceptionType((object) -> {
|
Loading…
Reference in New Issue
Block a user