mirror of
https://github.com/PaperMC/Paper.git
synced 2025-08-05 22:52:13 -07:00
even moar patches
This commit is contained in:
@@ -22,8 +22,8 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
|
|||||||
implementation("org.spongepowered:configurate-yaml:4.1.2") // Paper - config files
|
implementation("org.spongepowered:configurate-yaml:4.1.2") // Paper - config files
|
||||||
implementation("commons-lang:commons-lang:2.6")
|
implementation("commons-lang:commons-lang:2.6")
|
||||||
+ implementation("net.fabricmc:mapping-io:0.3.0") // Paper - needed to read mappings for stacktrace deobfuscation
|
+ implementation("net.fabricmc:mapping-io:0.3.0") // Paper - needed to read mappings for stacktrace deobfuscation
|
||||||
runtimeOnly("org.xerial:sqlite-jdbc:3.41.2.2")
|
runtimeOnly("org.xerial:sqlite-jdbc:3.42.0.0")
|
||||||
runtimeOnly("com.mysql:mysql-connector-j:8.0.32")
|
runtimeOnly("com.mysql:mysql-connector-j:8.0.33")
|
||||||
runtimeOnly("com.lmax:disruptor:3.4.4") // Paper
|
runtimeOnly("com.lmax:disruptor:3.4.4") // Paper
|
||||||
@@ -0,0 +0,0 @@ tasks.check {
|
@@ -0,0 +0,0 @@ tasks.check {
|
||||||
}
|
}
|
||||||
@@ -624,7 +624,7 @@ diff --git a/src/main/java/org/spigotmc/WatchdogThread.java b/src/main/java/org/
|
|||||||
index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644
|
index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644
|
||||||
--- a/src/main/java/org/spigotmc/WatchdogThread.java
|
--- a/src/main/java/org/spigotmc/WatchdogThread.java
|
||||||
+++ b/src/main/java/org/spigotmc/WatchdogThread.java
|
+++ b/src/main/java/org/spigotmc/WatchdogThread.java
|
||||||
@@ -0,0 +0,0 @@ public final class WatchdogThread extends io.papermc.paper.util.TickThread // Pa
|
@@ -0,0 +0,0 @@ public class WatchdogThread extends Thread
|
||||||
log.log( Level.SEVERE, "During the run of the server, a plugin set an excessive velocity on an entity" );
|
log.log( Level.SEVERE, "During the run of the server, a plugin set an excessive velocity on an entity" );
|
||||||
log.log( Level.SEVERE, "This may be the cause of the issue, or it may be entirely unrelated" );
|
log.log( Level.SEVERE, "This may be the cause of the issue, or it may be entirely unrelated" );
|
||||||
log.log( Level.SEVERE, org.bukkit.craftbukkit.CraftServer.excessiveVelEx.getMessage());
|
log.log( Level.SEVERE, org.bukkit.craftbukkit.CraftServer.excessiveVelEx.getMessage());
|
||||||
@@ -633,7 +633,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
|
|||||||
{
|
{
|
||||||
log.log( Level.SEVERE, "\t\t" + stack );
|
log.log( Level.SEVERE, "\t\t" + stack );
|
||||||
}
|
}
|
||||||
@@ -0,0 +0,0 @@ public final class WatchdogThread extends io.papermc.paper.util.TickThread // Pa
|
@@ -0,0 +0,0 @@ public class WatchdogThread extends Thread
|
||||||
}
|
}
|
||||||
log.log( Level.SEVERE, "\tStack:" );
|
log.log( Level.SEVERE, "\tStack:" );
|
||||||
//
|
//
|
@@ -9,8 +9,8 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
|
|||||||
--- a/build.gradle.kts
|
--- a/build.gradle.kts
|
||||||
+++ b/build.gradle.kts
|
+++ b/build.gradle.kts
|
||||||
@@ -0,0 +0,0 @@ dependencies {
|
@@ -0,0 +0,0 @@ dependencies {
|
||||||
runtimeOnly("org.apache.maven.resolver:maven-resolver-connector-basic:1.7.3")
|
runtimeOnly("org.apache.maven.resolver:maven-resolver-connector-basic:1.9.10")
|
||||||
runtimeOnly("org.apache.maven.resolver:maven-resolver-transport-http:1.7.3")
|
runtimeOnly("org.apache.maven.resolver:maven-resolver-transport-http:1.9.10")
|
||||||
|
|
||||||
+ testImplementation("io.github.classgraph:classgraph:4.8.47") // Paper - mob goal test
|
+ testImplementation("io.github.classgraph:classgraph:4.8.47") // Paper - mob goal test
|
||||||
testImplementation("junit:junit:4.13.2")
|
testImplementation("junit:junit:4.13.2")
|
@@ -21,7 +21,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
|
|||||||
@@ -0,0 +0,0 @@ public class MapItem extends ComplexItem {
|
@@ -0,0 +0,0 @@ public class MapItem extends ComplexItem {
|
||||||
int j2 = (j / i + k1 - 64) * i;
|
int j2 = (j / i + k1 - 64) * i;
|
||||||
int k2 = (k / i + l1 - 64) * i;
|
int k2 = (k / i + l1 - 64) * i;
|
||||||
Multiset<MaterialColor> multiset = LinkedHashMultiset.create();
|
Multiset<MapColor> multiset = LinkedHashMultiset.create();
|
||||||
- LevelChunk chunk = world.getChunk(SectionPos.blockToSectionCoord(j2), SectionPos.blockToSectionCoord(k2));
|
- LevelChunk chunk = world.getChunk(SectionPos.blockToSectionCoord(j2), SectionPos.blockToSectionCoord(k2));
|
||||||
+ LevelChunk chunk = world.getChunkIfLoaded(SectionPos.blockToSectionCoord(j2), SectionPos.blockToSectionCoord(k2)); // Paper - Maps shouldn't load chunks
|
+ LevelChunk chunk = world.getChunkIfLoaded(SectionPos.blockToSectionCoord(j2), SectionPos.blockToSectionCoord(k2)); // Paper - Maps shouldn't load chunks
|
||||||
|
|
@@ -86,17 +86,17 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
|
|||||||
+ return false;
|
+ return false;
|
||||||
+ }
|
+ }
|
||||||
+ // Paper end - prevent retracting when we're facing the wrong way
|
+ // Paper end - prevent retracting when we're facing the wrong way
|
||||||
|
BlockState iblockdata1 = (BlockState) state.setValue(PistonBaseBlock.EXTENDED, true);
|
||||||
|
|
||||||
if (!world.isClientSide) {
|
if (!world.isClientSide) {
|
||||||
boolean flag = this.getNeighborSignal(world, pos, enumdirection);
|
|
||||||
@@ -0,0 +0,0 @@ public class PistonBaseBlock extends DirectionalBlock {
|
@@ -0,0 +0,0 @@ public class PistonBaseBlock extends DirectionalBlock {
|
||||||
BlockState iblockdata1 = (BlockState) ((BlockState) Blocks.MOVING_PISTON.defaultBlockState().setValue(MovingPistonBlock.FACING, enumdirection)).setValue(MovingPistonBlock.TYPE, this.isSticky ? PistonType.STICKY : PistonType.DEFAULT);
|
BlockState iblockdata2 = (BlockState) ((BlockState) Blocks.MOVING_PISTON.defaultBlockState().setValue(MovingPistonBlock.FACING, enumdirection)).setValue(MovingPistonBlock.TYPE, this.isSticky ? PistonType.STICKY : PistonType.DEFAULT);
|
||||||
|
|
||||||
world.setBlock(pos, iblockdata1, 20);
|
world.setBlock(pos, iblockdata2, 20);
|
||||||
- world.setBlockEntity(MovingPistonBlock.newMovingBlockEntity(pos, iblockdata1, (BlockState) this.defaultBlockState().setValue(PistonBaseBlock.FACING, Direction.from3DDataValue(data & 7)), enumdirection, false, true));
|
- world.setBlockEntity(MovingPistonBlock.newMovingBlockEntity(pos, iblockdata2, (BlockState) this.defaultBlockState().setValue(PistonBaseBlock.FACING, Direction.from3DDataValue(data & 7)), enumdirection, false, true));
|
||||||
+ world.setBlockEntity(MovingPistonBlock.newMovingBlockEntity(pos, iblockdata1, (BlockState) this.defaultBlockState().setValue(PistonBaseBlock.FACING, Direction.from3DDataValue(data & 7)), enumdirection, false, true)); // Paper - diff on change
|
+ world.setBlockEntity(MovingPistonBlock.newMovingBlockEntity(pos, iblockdata2, (BlockState) this.defaultBlockState().setValue(PistonBaseBlock.FACING, Direction.from3DDataValue(data & 7)), enumdirection, false, true)); // Paper - diff on change
|
||||||
world.blockUpdated(pos, iblockdata1.getBlock());
|
world.blockUpdated(pos, iblockdata2.getBlock());
|
||||||
iblockdata1.updateNeighbourShapes(world, pos, 2);
|
iblockdata2.updateNeighbourShapes(world, pos, 2);
|
||||||
if (this.isSticky) {
|
if (this.isSticky) {
|
||||||
@@ -0,0 +0,0 @@ public class PistonBaseBlock extends DirectionalBlock {
|
@@ -0,0 +0,0 @@ public class PistonBaseBlock extends DirectionalBlock {
|
||||||
}
|
}
|
||||||
@@ -122,13 +122,13 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
|
|||||||
/** @deprecated */
|
/** @deprecated */
|
||||||
@Deprecated
|
@Deprecated
|
||||||
public boolean canBeReplaced(BlockState state, BlockPlaceContext context) {
|
public boolean canBeReplaced(BlockState state, BlockPlaceContext context) {
|
||||||
- return this.material.isReplaceable() && (context.getItemInHand().isEmpty() || !context.getItemInHand().is(this.asItem()));
|
- return state.canBeReplaced() && (context.getItemInHand().isEmpty() || !context.getItemInHand().is(this.asItem()));
|
||||||
+ return this.material.isReplaceable() && (context.getItemInHand().isEmpty() || !context.getItemInHand().is(this.asItem())) && (state.isDestroyable() || (context.getPlayer() != null && context.getPlayer().getAbilities().instabuild)); // Paper
|
+ return state.canBeReplaced() && (context.getItemInHand().isEmpty() || !context.getItemInHand().is(this.asItem())) && (state.isDestroyable() || (context.getPlayer() != null && context.getPlayer().getAbilities().instabuild)); // Paper;
|
||||||
}
|
}
|
||||||
|
|
||||||
/** @deprecated */
|
/** @deprecated */
|
||||||
@@ -0,0 +0,0 @@ public abstract class BlockBehaviour implements FeatureElement {
|
@@ -0,0 +0,0 @@ public abstract class BlockBehaviour implements FeatureElement {
|
||||||
return ((Block) this.owner).builtInRegistryHolder();
|
return this.legacySolid;
|
||||||
}
|
}
|
||||||
|
|
||||||
+ // Paper start
|
+ // Paper start
|
||||||
@@ -137,15 +137,15 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
|
|||||||
+ }
|
+ }
|
||||||
+ // Paper end
|
+ // Paper end
|
||||||
+
|
+
|
||||||
public Material getMaterial() {
|
public boolean isValidSpawn(BlockGetter world, BlockPos pos, EntityType<?> type) {
|
||||||
return this.material;
|
return this.getBlock().properties.isValidSpawn.test(this.asState(), world, pos, type);
|
||||||
}
|
}
|
||||||
@@ -0,0 +0,0 @@ public abstract class BlockBehaviour implements FeatureElement {
|
@@ -0,0 +0,0 @@ public abstract class BlockBehaviour implements FeatureElement {
|
||||||
}
|
}
|
||||||
|
|
||||||
public PushReaction getPistonPushReaction() {
|
public PushReaction getPistonPushReaction() {
|
||||||
- return this.getBlock().getPistonPushReaction(this.asState());
|
- return this.pushReaction;
|
||||||
+ return !isDestroyable() ? PushReaction.BLOCK : this.getBlock().getPistonPushReaction(this.asState()); // Paper
|
+ return !this.isDestroyable() ? PushReaction.BLOCK : this.pushReaction; // Paper
|
||||||
}
|
}
|
||||||
|
|
||||||
public boolean isSolidRender(BlockGetter world, BlockPos pos) {
|
public boolean isSolidRender(BlockGetter world, BlockPos pos) {
|
||||||
@@ -164,6 +164,6 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
|
|||||||
+ }
|
+ }
|
||||||
+ }
|
+ }
|
||||||
+ // Paper end - prevent destroying unbreakable blocks
|
+ // Paper end - prevent destroying unbreakable blocks
|
||||||
if (k < 0 && !this.level.getBlockState(temp).getMaterial().isSolid()) {
|
if (k < 0 && !this.level.getBlockState(temp).isSolid()) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
@@ -31,7 +31,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
|
|||||||
+ double vec3d_dx = player.getX() - this.entity.getX();
|
+ double vec3d_dx = player.getX() - this.entity.getX();
|
||||||
+ double vec3d_dz = player.getZ() - this.entity.getZ();
|
+ double vec3d_dz = player.getZ() - this.entity.getZ();
|
||||||
+ // Paper end - remove allocation of Vec3D here
|
+ // Paper end - remove allocation of Vec3D here
|
||||||
double d0 = (double) Math.min(this.getEffectiveRange(), io.papermc.paper.chunk.PlayerChunkLoader.getSendViewDistance(player) * 16); // Paper - per player view distance
|
double d0 = (double) Math.min(this.getEffectiveRange(), ChunkMap.this.viewDistance * 16);
|
||||||
- double d1 = vec3d.x * vec3d.x + vec3d.z * vec3d.z;
|
- double d1 = vec3d.x * vec3d.x + vec3d.z * vec3d.z;
|
||||||
+ double d1 = vec3d_dx * vec3d_dx + vec3d_dz * vec3d_dz; // Paper
|
+ double d1 = vec3d_dx * vec3d_dx + vec3d_dz * vec3d_dz; // Paper
|
||||||
double d2 = d0 * d0;
|
double d2 = d0 * d0;
|
@@ -11,7 +11,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
|
|||||||
@@ -0,0 +0,0 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Tic
|
@@ -0,0 +0,0 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Tic
|
||||||
@Override
|
@Override
|
||||||
public void handlePickItem(ServerboundPickItemPacket packet) {
|
public void handlePickItem(ServerboundPickItemPacket packet) {
|
||||||
PacketUtils.ensureRunningOnSameThread(packet, this, this.player.getLevel());
|
PacketUtils.ensureRunningOnSameThread(packet, this, this.player.serverLevel());
|
||||||
- this.player.getInventory().pickSlot(packet.getSlot());
|
- this.player.getInventory().pickSlot(packet.getSlot());
|
||||||
+ // Paper start - validate pick item position
|
+ // Paper start - validate pick item position
|
||||||
+ if (!(packet.getSlot() >= 0 && packet.getSlot() < this.player.getInventory().items.size())) {
|
+ if (!(packet.getSlot() >= 0 && packet.getSlot() < this.player.getInventory().items.size())) {
|
@@ -1,50 +0,0 @@
|
|||||||
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
|
||||||
From: Spottedleaf <Spottedleaf@users.noreply.github.com>
|
|
||||||
Date: Mon, 27 Apr 2020 02:48:06 -0700
|
|
||||||
Subject: [PATCH] Reduce MutableInt allocations from light engine
|
|
||||||
|
|
||||||
We can abuse the fact light is single threaded and share an instance
|
|
||||||
per light engine instance
|
|
||||||
|
|
||||||
diff --git a/src/main/java/net/minecraft/world/level/lighting/BlockLightEngine.java b/src/main/java/net/minecraft/world/level/lighting/BlockLightEngine.java
|
|
||||||
index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644
|
|
||||||
--- a/src/main/java/net/minecraft/world/level/lighting/BlockLightEngine.java
|
|
||||||
+++ b/src/main/java/net/minecraft/world/level/lighting/BlockLightEngine.java
|
|
||||||
@@ -0,0 +0,0 @@ import org.apache.commons.lang3.mutable.MutableInt;
|
|
||||||
public final class BlockLightEngine extends LayerLightEngine<BlockLightSectionStorage.BlockDataLayerStorageMap, BlockLightSectionStorage> {
|
|
||||||
private static final Direction[] DIRECTIONS = Direction.values();
|
|
||||||
private final BlockPos.MutableBlockPos pos = new BlockPos.MutableBlockPos();
|
|
||||||
+ private final MutableInt mutableInt = new MutableInt(); // Paper
|
|
||||||
|
|
||||||
public BlockLightEngine(LightChunkGetter chunkProvider) {
|
|
||||||
super(chunkProvider, LightLayer.BLOCK, new BlockLightSectionStorage(chunkProvider));
|
|
||||||
@@ -0,0 +0,0 @@ public final class BlockLightEngine extends LayerLightEngine<BlockLightSectionSt
|
|
||||||
if (direction == null) {
|
|
||||||
return 15;
|
|
||||||
} else {
|
|
||||||
- MutableInt mutableInt = new MutableInt();
|
|
||||||
+ //MutableInt mutableint = new MutableInt(); // Paper - share mutableint, single threaded
|
|
||||||
BlockState blockState = this.getStateAndOpacity(targetId, mutableInt);
|
|
||||||
if (mutableInt.getValue() >= 15) {
|
|
||||||
return 15;
|
|
||||||
diff --git a/src/main/java/net/minecraft/world/level/lighting/SkyLightEngine.java b/src/main/java/net/minecraft/world/level/lighting/SkyLightEngine.java
|
|
||||||
index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644
|
|
||||||
--- a/src/main/java/net/minecraft/world/level/lighting/SkyLightEngine.java
|
|
||||||
+++ b/src/main/java/net/minecraft/world/level/lighting/SkyLightEngine.java
|
|
||||||
@@ -0,0 +0,0 @@ import org.apache.commons.lang3.mutable.MutableInt;
|
|
||||||
public final class SkyLightEngine extends LayerLightEngine<SkyLightSectionStorage.SkyDataLayerStorageMap, SkyLightSectionStorage> {
|
|
||||||
private static final Direction[] DIRECTIONS = Direction.values();
|
|
||||||
private static final Direction[] HORIZONTALS = new Direction[]{Direction.NORTH, Direction.SOUTH, Direction.WEST, Direction.EAST};
|
|
||||||
+ private final MutableInt mutableInt = new MutableInt(); // Paper
|
|
||||||
|
|
||||||
public SkyLightEngine(LightChunkGetter chunkProvider) {
|
|
||||||
super(chunkProvider, LightLayer.SKY, new SkyLightSectionStorage(chunkProvider));
|
|
||||||
@@ -0,0 +0,0 @@ public final class SkyLightEngine extends LayerLightEngine<SkyLightSectionStorag
|
|
||||||
if (level >= 15) {
|
|
||||||
return level;
|
|
||||||
} else {
|
|
||||||
- MutableInt mutableInt = new MutableInt();
|
|
||||||
+ //MutableInt mutableint = new MutableInt(); // Paper - share mutableint, single threaded
|
|
||||||
BlockState blockState = this.getStateAndOpacity(targetId, mutableInt);
|
|
||||||
if (mutableInt.getValue() >= 15) {
|
|
||||||
return 15;
|
|
Reference in New Issue
Block a user