This commit is contained in:
Owen1212055 2024-04-24 08:11:27 -04:00
parent cc4614854a
commit 5be858e9b7
No known key found for this signature in database
GPG Key ID: 2133292072886A30
19 changed files with 85 additions and 78 deletions

View File

@ -5,7 +5,7 @@ Subject: [PATCH] Fix some rails connecting improperly
diff --git a/src/main/java/net/minecraft/world/level/block/BaseRailBlock.java b/src/main/java/net/minecraft/world/level/block/BaseRailBlock.java
index e9fbbca04105370226bf5a264ba6ea96e09c3f10..93398cf061a8609f0b77a5e7f8340870019b9824 100644
index f9b6db516fa0788a6d4d40fa7ea2039cd3282b24..0961f6f5e627debe0bf02670d922e6d3388ba631 100644
--- a/src/main/java/net/minecraft/world/level/block/BaseRailBlock.java
+++ b/src/main/java/net/minecraft/world/level/block/BaseRailBlock.java
@@ -68,6 +68,7 @@ public abstract class BaseRailBlock extends Block implements SimpleWaterloggedBl
@ -17,7 +17,7 @@ index e9fbbca04105370226bf5a264ba6ea96e09c3f10..93398cf061a8609f0b77a5e7f8340870
return state;
diff --git a/src/main/java/net/minecraft/world/level/block/DetectorRailBlock.java b/src/main/java/net/minecraft/world/level/block/DetectorRailBlock.java
index 41452abc7b761858ff2f3ff6a833b09c16fded4f..17242c24d73c9ffb1c976a45925f85d1aa9e96b3 100644
index e5534fd35a8f9736cc25471e9f0feaa8da88c85d..55a97da8786ec0ae98abe56876c00f4678ba0007 100644
--- a/src/main/java/net/minecraft/world/level/block/DetectorRailBlock.java
+++ b/src/main/java/net/minecraft/world/level/block/DetectorRailBlock.java
@@ -77,6 +77,7 @@ public class DetectorRailBlock extends BaseRailBlock {

View File

@ -5,10 +5,10 @@ Subject: [PATCH] Brand support
diff --git a/src/main/java/net/minecraft/server/level/ServerPlayer.java b/src/main/java/net/minecraft/server/level/ServerPlayer.java
index 8729fb23a7d7700fbccba03d07382091134c6549..7c7e3d541733ea1784f8b90acbc8b1aecb6d7859 100644
index 0019e5313523521b4f1607dfc391d47c55961a48..a182ab1c06c4644e9c14d7a2eff2620d827dfb2c 100644
--- a/src/main/java/net/minecraft/server/level/ServerPlayer.java
+++ b/src/main/java/net/minecraft/server/level/ServerPlayer.java
@@ -273,6 +273,7 @@ public class ServerPlayer extends Player {
@@ -289,6 +289,7 @@ public class ServerPlayer extends Player {
public boolean isRealPlayer; // Paper
public final com.destroystokyo.paper.util.misc.PooledLinkedHashSets.PooledObjectLinkedOpenHashSet<ServerPlayer> cachedSingleHashSet; // Paper
public com.destroystokyo.paper.event.entity.PlayerNaturallySpawnCreaturesEvent playerNaturallySpawnedEvent; // Paper - PlayerNaturallySpawnCreaturesEvent
@ -17,10 +17,10 @@ index 8729fb23a7d7700fbccba03d07382091134c6549..7c7e3d541733ea1784f8b90acbc8b1ae
public ServerPlayer(MinecraftServer server, ServerLevel world, GameProfile profile, ClientInformation clientOptions) {
super(world, world.getSharedSpawnPos(), world.getSharedSpawnAngle(), profile);
diff --git a/src/main/java/net/minecraft/server/network/ServerCommonPacketListenerImpl.java b/src/main/java/net/minecraft/server/network/ServerCommonPacketListenerImpl.java
index e69043316372d98b122ed3788fda79cdd36849e8..6597e6e9987ddb5906909c22704fdfb6557aee8e 100644
index 96b5e033aab4e1ee090af77a871e643dbf6300a4..215da3c52dc7b9e92c23f352fa7cffc2fb3d8a1a 100644
--- a/src/main/java/net/minecraft/server/network/ServerCommonPacketListenerImpl.java
+++ b/src/main/java/net/minecraft/server/network/ServerCommonPacketListenerImpl.java
@@ -55,6 +55,7 @@ public abstract class ServerCommonPacketListenerImpl implements ServerCommonPack
@@ -66,6 +66,7 @@ public abstract class ServerCommonPacketListenerImpl implements ServerCommonPack
private volatile boolean suspendFlushingOnServerThread = false;
public final java.util.Map<java.util.UUID, net.kyori.adventure.resource.ResourcePackCallback> packCallbacks = new java.util.concurrent.ConcurrentHashMap<>(); // Paper - adventure resource pack callbacks
private static final long KEEPALIVE_LIMIT = Long.getLong("paper.playerconnection.keepalive", 30) * 1000; // Paper - provide property to set keepalive limit
@ -28,7 +28,7 @@ index e69043316372d98b122ed3788fda79cdd36849e8..6597e6e9987ddb5906909c22704fdfb6
public ServerCommonPacketListenerImpl(MinecraftServer minecraftserver, Connection networkmanager, CommonListenerCookie commonlistenercookie, ServerPlayer player) { // CraftBukkit
this.server = minecraftserver;
@@ -110,6 +111,11 @@ public abstract class ServerCommonPacketListenerImpl implements ServerCommonPack
@@ -131,6 +132,11 @@ public abstract class ServerCommonPacketListenerImpl implements ServerCommonPack
@Override
public void handleCustomPayload(ServerboundCustomPayloadPacket packet) {
@ -37,10 +37,10 @@ index e69043316372d98b122ed3788fda79cdd36849e8..6597e6e9987ddb5906909c22704fdfb6
+ this.player.clientBrandName = brandPayload.brand();
+ }
+ // Paper end - Brand support
if (!(packet.payload() instanceof ServerboundCustomPayloadPacket.UnknownPayload)) {
if (!(packet.payload() instanceof DiscardedPayload)) {
return;
}
@@ -141,6 +147,15 @@ public abstract class ServerCommonPacketListenerImpl implements ServerCommonPack
@@ -162,6 +168,15 @@ public abstract class ServerCommonPacketListenerImpl implements ServerCommonPack
try {
byte[] data = new byte[payload.readableBytes()];
payload.readBytes(data);
@ -57,10 +57,10 @@ index e69043316372d98b122ed3788fda79cdd36849e8..6597e6e9987ddb5906909c22704fdfb6
} catch (Exception ex) {
ServerGamePacketListenerImpl.LOGGER.error("Couldn\'t dispatch custom payload", ex);
diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
index 587689c5d4f24c3cb40218b0a1e62e7d10a94a7a..7c98519b13326acd8c9c871c0fbd0b8d52f80af2 100644
index 665ba6c4b2f6968b1311217dad9c3306c0895c07..777f48d31b8b1d3a47471caba00ffb77a335c03b 100644
--- a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
+++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
@@ -3058,6 +3058,13 @@ public class CraftPlayer extends CraftHumanEntity implements Player {
@@ -3123,6 +3123,13 @@ public class CraftPlayer extends CraftHumanEntity implements Player {
// Paper end
};

View File

@ -5,10 +5,10 @@ Subject: [PATCH] Add playPickupItemAnimation to LivingEntity
diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftLivingEntity.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftLivingEntity.java
index d84503ab329ebeb4c74f10f9897661ee6799e3d3..87033a5d8dd5b67475657c3749f428a8e841a2f2 100644
index a5026d470b8651ddf4b79fc29cbc598ac55217ff..aff940a7bacf53571f8e7bcd520419994596ebb3 100644
--- a/src/main/java/org/bukkit/craftbukkit/entity/CraftLivingEntity.java
+++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftLivingEntity.java
@@ -992,4 +992,11 @@ public class CraftLivingEntity extends CraftEntity implements LivingEntity {
@@ -977,4 +977,11 @@ public class CraftLivingEntity extends CraftEntity implements LivingEntity {
}
}
// Paper end - entity jump API

View File

@ -5,23 +5,21 @@ Subject: [PATCH] Fix SpawnChangeEvent not firing for all use-cases
diff --git a/src/main/java/net/minecraft/server/level/ServerLevel.java b/src/main/java/net/minecraft/server/level/ServerLevel.java
index 9af1877321356348ad96b92ae8c5f4811bef50ac..2e42e09d3fa19e5a16374ee6ac1677dd2b2004f1 100644
index 6a30ae257158267918c7114494005be528ac05dc..ccc5e57bfaaa51b05c66349475212f2079a4428c 100644
--- a/src/main/java/net/minecraft/server/level/ServerLevel.java
+++ b/src/main/java/net/minecraft/server/level/ServerLevel.java
@@ -1726,9 +1726,11 @@ public class ServerLevel extends Level implements WorldGenLevel {
public void setDefaultSpawnPos(BlockPos pos, float angle) {
// Paper start - Configurable Keep Spawn Loaded range per world
BlockPos prevSpawn = this.getSharedSpawnPos();
+ Location prevSpawnLoc = this.getWorld().getSpawnLocation(); // Paper - Call SpawnChangeEvent
//ChunkCoordIntPair chunkcoordintpair = new ChunkCoordIntPair(new BlockPosition(this.worldData.a(), 0, this.worldData.c()));
@@ -1668,7 +1668,9 @@ public class ServerLevel extends Level implements WorldGenLevel {
float f1 = this.levelData.getSpawnAngle();
if (!blockposition1.equals(pos) || f1 != angle) {
+ org.bukkit.Location prevSpawnLoc = this.getWorld().getSpawnLocation(); // Paper - Call SpawnChangeEvent
this.levelData.setSpawn(pos, angle);
+ new org.bukkit.event.world.SpawnChangeEvent(this.getWorld(), prevSpawnLoc).callEvent(); // Paper - Call SpawnChangeEvent
this.getServer().getPlayerList().broadcastAll(new ClientboundSetDefaultSpawnPositionPacket(pos, angle));
}
this.levelData.setSpawn(pos, angle);
+ new org.bukkit.event.world.SpawnChangeEvent(this.getWorld(), prevSpawnLoc).callEvent(); // Paper - Call SpawnChangeEvent
if (this.keepSpawnInMemory) {
// if this keepSpawnInMemory is false a plugin has already removed our tickets, do not re-add
this.removeTicketsForSpawn(this.paperConfig().spawn.keepSpawnLoadedRange * 16, prevSpawn);
diff --git a/src/main/java/org/bukkit/craftbukkit/CraftWorld.java b/src/main/java/org/bukkit/craftbukkit/CraftWorld.java
index b437f582c36ab9a5b06129ef1b36dd14432c0c31..afb65de5fbff44b4ca455c778030c3387c2dafc8 100644
index d4697f2f4c71001dba2cc3a69d54f27809766595..4d75cf0ec9e835b4274297275d52f08a6a65aeca 100644
--- a/src/main/java/org/bukkit/craftbukkit/CraftWorld.java
+++ b/src/main/java/org/bukkit/craftbukkit/CraftWorld.java
@@ -269,12 +269,14 @@ public class CraftWorld extends CraftRegionAccessor implements World {

View File

@ -5,7 +5,7 @@ Subject: [PATCH] Add moon phase API
diff --git a/src/main/java/org/bukkit/craftbukkit/CraftRegionAccessor.java b/src/main/java/org/bukkit/craftbukkit/CraftRegionAccessor.java
index a9d3dbabd40e731dbe7db6cb957ed6d5b9856580..bb9b4ff9f5c983ef6fe0b295bc868bc1125921d5 100644
index 089b8351168d7b4f55e75b3cfd4c2b72e829bd1c..9801f78f1d44fd5a72fbdb319681b683e8fb85c4 100644
--- a/src/main/java/org/bukkit/craftbukkit/CraftRegionAccessor.java
+++ b/src/main/java/org/bukkit/craftbukkit/CraftRegionAccessor.java
@@ -505,4 +505,11 @@ public abstract class CraftRegionAccessor implements RegionAccessor {

View File

@ -9,10 +9,10 @@ the game, immediately stop the server to prevent data corruption.
You can override this functionality at your own peril.
diff --git a/src/main/java/net/minecraft/world/level/chunk/storage/ChunkSerializer.java b/src/main/java/net/minecraft/world/level/chunk/storage/ChunkSerializer.java
index cbc8e95c8f890f0c0eb717d4d2ae3f427dc260d8..3b046dc106b96b7ca2b148d605e8b7c97453d033 100644
index b3f8df13e97cbde7dd914b42004d186f90b78646..2ca1f01ab59000949cbde1766c9811a72dbfb4ff 100644
--- a/src/main/java/net/minecraft/world/level/chunk/storage/ChunkSerializer.java
+++ b/src/main/java/net/minecraft/world/level/chunk/storage/ChunkSerializer.java
@@ -84,6 +84,10 @@ public class ChunkSerializer {
@@ -86,6 +86,10 @@ public class ChunkSerializer {
public static final String BLOCK_LIGHT_TAG = "BlockLight";
public static final String SKY_LIGHT_TAG = "SkyLight";
@ -23,7 +23,7 @@ index cbc8e95c8f890f0c0eb717d4d2ae3f427dc260d8..3b046dc106b96b7ca2b148d605e8b7c9
public ChunkSerializer() {}
// Paper start - guard against serializing mismatching coordinates
@@ -99,6 +103,15 @@ public class ChunkSerializer {
@@ -101,6 +105,15 @@ public class ChunkSerializer {
}
// Paper end - guard against serializing mismatching coordinates
public static ProtoChunk read(ServerLevel world, PoiManager poiStorage, ChunkPos chunkPos, CompoundTag nbt) {

View File

@ -6,10 +6,10 @@ Subject: [PATCH] Prevent headless pistons from being created
Prevent headless pistons from being created by explosions or tree/mushroom growth.
diff --git a/src/main/java/net/minecraft/world/level/Explosion.java b/src/main/java/net/minecraft/world/level/Explosion.java
index b057a67a416928ae30bd407b3da982b73ae3be03..2d1fe6af7923ad4a0143f2d3fd28abc85e6092c1 100644
index b54a5c496ea7f1999c1b10219e72e9ce79921c99..aa81144975fa66bcdb3d107e2a461b6d62d8e59e 100644
--- a/src/main/java/net/minecraft/world/level/Explosion.java
+++ b/src/main/java/net/minecraft/world/level/Explosion.java
@@ -205,6 +205,15 @@ public class Explosion {
@@ -206,6 +206,15 @@ public class Explosion {
if (f > 0.0F && this.damageCalculator.shouldBlockExplode(this, this.level, blockposition, iblockdata, f)) {
set.add(blockposition);

View File

@ -7,10 +7,10 @@ Add a new event, BellRingEvent, to trigger whenever a player rings a
village bell. Passes along the bell block and the player who rang it.
diff --git a/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java b/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java
index b72fba605ea2c2ea88fee90058fb2ccc30197c95..657df7b4aa8c4a19bf8e085d8235aa0d1a1b08da 100644
index a5253dc7fc611e599ab83c08bf4ce71afc4ee3c5..f0e1bb3d9e4254d2c32f28fb715ea429c7646cec 100644
--- a/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java
+++ b/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java
@@ -368,10 +368,11 @@ public class CraftEventFactory {
@@ -367,10 +367,11 @@ public class CraftEventFactory {
return tradeSelectEvent;
}

View File

@ -5,10 +5,10 @@ Subject: [PATCH] Add zombie targets turtle egg config
diff --git a/src/main/java/net/minecraft/world/entity/monster/Zombie.java b/src/main/java/net/minecraft/world/entity/monster/Zombie.java
index 408cbb80df72cf67e5228a76b7f267281e1752ab..67aaa688b4db0c4304699fdd983730cdb4a68058 100644
index a2816b5334e962aee4beeac116e1c8543fa89808..eacfdfb47299af6900bd39595da8daedb640b959 100644
--- a/src/main/java/net/minecraft/world/entity/monster/Zombie.java
+++ b/src/main/java/net/minecraft/world/entity/monster/Zombie.java
@@ -109,7 +109,7 @@ public class Zombie extends Monster {
@@ -106,7 +106,7 @@ public class Zombie extends Monster {
@Override
protected void registerGoals() {

View File

@ -8,10 +8,10 @@ the world per tick, this attempts to reduce the impact that join floods
has on the server
diff --git a/src/main/java/net/minecraft/network/Connection.java b/src/main/java/net/minecraft/network/Connection.java
index 44e62675a2d612a8d727d9ce6db5fb85d1a0bcc8..1113380f6f142d2faf36191aae158c747bed5bb9 100644
index 9885dec92cd26dec61c303dda687b0f910d49749..68d5be903a0d13e59c9e4bd6d85baaf0773547a0 100644
--- a/src/main/java/net/minecraft/network/Connection.java
+++ b/src/main/java/net/minecraft/network/Connection.java
@@ -415,14 +415,29 @@ public class Connection extends SimpleChannelInboundHandler<Packet<?>> {
@@ -437,12 +437,26 @@ public class Connection extends SimpleChannelInboundHandler<Packet<?>> {
}
}
@ -28,16 +28,13 @@ index 44e62675a2d612a8d727d9ce6db5fb85d1a0bcc8..1113380f6f142d2faf36191aae158c74
+ // Paper end - Buffer joins to world
PacketListener packetlistener = this.packetListener;
if (packetlistener instanceof TickablePacketListener) {
TickablePacketListener tickablepacketlistener = (TickablePacketListener) packetlistener;
if (packetlistener instanceof TickablePacketListener tickablepacketlistener) {
+ // Paper start - Buffer joins to world
+ if (!(this.packetListener instanceof net.minecraft.server.network.ServerLoginPacketListenerImpl loginPacketListener)
+ || loginPacketListener.state != net.minecraft.server.network.ServerLoginPacketListenerImpl.State.VERIFYING
+ || Connection.joinAttemptsThisTick++ < MAX_PER_TICK) {
tickablepacketlistener.tick();
+ }
+ // Paper end - Buffer joins to world
+ } // Paper end - Buffer joins to world
}
if (!this.isConnected() && !this.disconnectionHandled) {

View File

@ -5,34 +5,34 @@ Subject: [PATCH] Fix hex colors not working in some kick messages
diff --git a/src/main/java/net/minecraft/server/network/ServerHandshakePacketListenerImpl.java b/src/main/java/net/minecraft/server/network/ServerHandshakePacketListenerImpl.java
index 08a7461a92ae84cac69e4bb57a099d1f35ff1c1a..9b611fc277baf99a5d24b30a11f0efa77b22693f 100644
index bc15794e0a3909ab9ceeded35158bea4c23fb45a..bcdb2cc4c735d939bdd0e9b7ec5246f51e57f299 100644
--- a/src/main/java/net/minecraft/server/network/ServerHandshakePacketListenerImpl.java
+++ b/src/main/java/net/minecraft/server/network/ServerHandshakePacketListenerImpl.java
@@ -77,14 +77,16 @@ public class ServerHandshakePacketListenerImpl implements ServerHandshakePacketL
}
// CraftBukkit end
if (packet.protocolVersion() != SharedConstants.getCurrentVersion().getProtocolVersion()) {
- MutableComponent ichatmutablecomponent;
@@ -108,14 +108,16 @@ public class ServerHandshakePacketListenerImpl implements ServerHandshakePacketL
}
// CraftBukkit end
if (packet.protocolVersion() != SharedConstants.getCurrentVersion().getProtocolVersion()) {
- MutableComponent ichatmutablecomponent;
+ net.kyori.adventure.text.Component adventureComponent; // Paper - Fix hex colors not working in some kick messages
if (packet.protocolVersion() < SharedConstants.getCurrentVersion().getProtocolVersion()) { // Spigot - SPIGOT-7546: Handle version check correctly for outdated client message
- ichatmutablecomponent = Component.literal( java.text.MessageFormat.format( org.spigotmc.SpigotConfig.outdatedClientMessage.replaceAll("'", "''"), SharedConstants.getCurrentVersion().getName() ) ); // Spigot
if (packet.protocolVersion() < SharedConstants.getCurrentVersion().getProtocolVersion()) { // Spigot - SPIGOT-7546: Handle version check correctly for outdated client message
- ichatmutablecomponent = Component.literal( java.text.MessageFormat.format( org.spigotmc.SpigotConfig.outdatedClientMessage.replaceAll("'", "''"), SharedConstants.getCurrentVersion().getName() ) ); // Spigot
+ adventureComponent = net.kyori.adventure.text.serializer.legacy.LegacyComponentSerializer.legacySection().deserialize(java.text.MessageFormat.format(org.spigotmc.SpigotConfig.outdatedClientMessage.replaceAll("'", "''"), SharedConstants.getCurrentVersion().getName())); // Spigot // Paper - Fix hex colors not working in some kick messages
} else {
- ichatmutablecomponent = Component.literal( java.text.MessageFormat.format( org.spigotmc.SpigotConfig.outdatedServerMessage.replaceAll("'", "''"), SharedConstants.getCurrentVersion().getName() ) ); // Spigot
} else {
- ichatmutablecomponent = Component.literal( java.text.MessageFormat.format( org.spigotmc.SpigotConfig.outdatedServerMessage.replaceAll("'", "''"), SharedConstants.getCurrentVersion().getName() ) ); // Spigot
+ adventureComponent = net.kyori.adventure.text.serializer.legacy.LegacyComponentSerializer.legacySection().deserialize(java.text.MessageFormat.format(org.spigotmc.SpigotConfig.outdatedServerMessage.replaceAll("'", "''"), SharedConstants.getCurrentVersion().getName())); // Spigot // Paper - Fix hex colors not working in some kick messages
}
}
+ Component ichatmutablecomponent = io.papermc.paper.adventure.PaperAdventure.asVanilla(adventureComponent); // Paper - Fix hex colors not working in some kick messages
+
this.connection.send(new ClientboundLoginDisconnectPacket(ichatmutablecomponent));
this.connection.disconnect(ichatmutablecomponent);
} else {
this.connection.send(new ClientboundLoginDisconnectPacket(ichatmutablecomponent));
this.connection.disconnect(ichatmutablecomponent);
} else {
diff --git a/src/main/java/net/minecraft/server/network/ServerLoginPacketListenerImpl.java b/src/main/java/net/minecraft/server/network/ServerLoginPacketListenerImpl.java
index f4ed58b03876c35f8964a8a1b8ce89961b9ee6d3..a7da99ac31bbcb8b6f1814a2d5509c7067aafb08 100644
index 88dfd9d66fbd1583407814978a1fd68edd386519..5fa0947bd6029f37d786488b44ec23090c45963a 100644
--- a/src/main/java/net/minecraft/server/network/ServerLoginPacketListenerImpl.java
+++ b/src/main/java/net/minecraft/server/network/ServerLoginPacketListenerImpl.java
@@ -99,7 +99,7 @@ public class ServerLoginPacketListenerImpl implements ServerLoginPacketListener,
@@ -126,7 +126,7 @@ public class ServerLoginPacketListenerImpl implements ServerLoginPacketListener,
// CraftBukkit start
@Deprecated
public void disconnect(String s) {

View File

@ -5,32 +5,32 @@ Subject: [PATCH] PortalCreateEvent needs to know its entity
diff --git a/src/main/java/net/minecraft/world/item/ItemStack.java b/src/main/java/net/minecraft/world/item/ItemStack.java
index 4a6e128c62c890c34b62f826d586ae6a424e7f01..9d2d305a5e66b9f3d94f6464736f5bb40adae591 100644
index 86aae218fb760d12e254dcf252c9f78c0ba856d5..a80f09d61b3b0d8bc5c5bec7c9df17327bd94b57 100644
--- a/src/main/java/net/minecraft/world/item/ItemStack.java
+++ b/src/main/java/net/minecraft/world/item/ItemStack.java
@@ -480,7 +480,7 @@ public final class ItemStack {
@@ -493,7 +493,7 @@ public final class ItemStack implements DataComponentHolder {
net.minecraft.world.level.block.state.BlockState block = world.getBlockState(newblockposition);
if (!(block.getBlock() instanceof BaseEntityBlock)) { // Containers get placed automatically
- block.getBlock().onPlace(block, world, newblockposition, oldBlock, true);
+ block.getBlock().onPlace(block, world, newblockposition, oldBlock, true, context); // Paper - pass context
- block.onPlace(world, newblockposition, oldBlock, true);
+ block.onPlace(world, newblockposition, oldBlock, true, context); // Paper - pass context
}
world.notifyAndUpdatePhysics(newblockposition, null, oldBlock, block, world.getBlockState(newblockposition), updateFlag, 512); // send null chunk as chunk.k() returns false by this point
diff --git a/src/main/java/net/minecraft/world/level/block/BaseFireBlock.java b/src/main/java/net/minecraft/world/level/block/BaseFireBlock.java
index e707553bbddf84bc48ec7186da00c3eb0632946d..839469c1249829b42e752e5a1b613550c3f65bba 100644
index 233236733537e036d3a37a3102f3ca6b887d076f..da4fd07f75aefb53b03e40c668f6c4a23693ffcb 100644
--- a/src/main/java/net/minecraft/world/level/block/BaseFireBlock.java
+++ b/src/main/java/net/minecraft/world/level/block/BaseFireBlock.java
@@ -144,12 +144,19 @@ public abstract class BaseFireBlock extends Block {
@Override
public void onPlace(BlockState state, Level world, BlockPos pos, BlockState oldState, boolean notify) {
protected void onPlace(BlockState state, Level world, BlockPos pos, BlockState oldState, boolean notify) {
+ // Paper start - UseOnContext param
+ this.onPlace(state, world, pos, oldState, notify, null);
+ }
+
+ @Override
+ public void onPlace(BlockState state, Level world, BlockPos pos, BlockState oldState, boolean notify, net.minecraft.world.item.context.UseOnContext context) {
+ protected void onPlace(BlockState state, Level world, BlockPos pos, BlockState oldState, boolean notify, net.minecraft.world.item.context.UseOnContext context) {
+ // Paper end - UseOnContext param
if (!oldState.is(state.getBlock())) {
if (BaseFireBlock.inPortalDimension(world)) {
@ -43,42 +43,54 @@ index e707553bbddf84bc48ec7186da00c3eb0632946d..839469c1249829b42e752e5a1b613550
}
}
diff --git a/src/main/java/net/minecraft/world/level/block/FireBlock.java b/src/main/java/net/minecraft/world/level/block/FireBlock.java
index 65b2873ca8032a64a4968b7587637644df1aeca5..c5116d12f3c073f0a8695a8cd00545e6d947644d 100644
index ceaa2a7048afc4955d3695af5291e83a79d83c5d..5dad1aa26a8908cba6a08398a4bad27f31d4c2c0 100644
--- a/src/main/java/net/minecraft/world/level/block/FireBlock.java
+++ b/src/main/java/net/minecraft/world/level/block/FireBlock.java
@@ -368,8 +368,10 @@ public class FireBlock extends BaseFireBlock {
}
@Override
- public void onPlace(BlockState state, Level world, BlockPos pos, BlockState oldState, boolean notify) {
- protected void onPlace(BlockState state, Level world, BlockPos pos, BlockState oldState, boolean notify) {
- super.onPlace(state, world, pos, oldState, notify);
+ // Paper start - UseOnContext param
+ public void onPlace(BlockState state, Level world, BlockPos pos, BlockState oldState, boolean notify, net.minecraft.world.item.context.UseOnContext context) {
+ protected void onPlace(BlockState state, Level world, BlockPos pos, BlockState oldState, boolean notify, net.minecraft.world.item.context.UseOnContext context) {
+ super.onPlace(state, world, pos, oldState, notify, context);
+ // Paper end - UseOnContext param
+ // Paper end - UseOnContext param
world.scheduleTick(pos, (Block) this, FireBlock.getFireTickDelay(world.random));
}
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 6f60622f2dad5f82fb24505612e7e3a32722ab93..c7b6377aafd32f67eb8ba4dedd7cce5841b2d58d 100644
index da8b97c590fb38f65dee2e8a881a2f7ad658b5e7..939d116ea940d52b319e08a11f08d1ccc406cb76 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
@@ -163,6 +163,13 @@ public abstract class BlockBehaviour implements FeatureElement {
@@ -155,6 +155,12 @@ public abstract class BlockBehaviour implements FeatureElement {
DebugPackets.sendNeighborsUpdatePacket(world, pos);
}
+ // Paper start - UseOnContext param
+ @Deprecated
+ public void onPlace(BlockState state, Level world, BlockPos pos, BlockState oldState, boolean notify, net.minecraft.world.item.context.UseOnContext context) {
+ protected void onPlace(BlockState state, Level world, BlockPos pos, BlockState oldState, boolean notify, net.minecraft.world.item.context.UseOnContext context) {
+ this.onPlace(state, world, pos, oldState, notify);
+ }
+ // Paper end - UseOnContext param
+
/** @deprecated */
@Deprecated
public void onPlace(BlockState state, Level world, BlockPos pos, BlockState oldState, boolean notify) {
protected void onPlace(BlockState state, Level world, BlockPos pos, BlockState oldState, boolean notify) {
org.spigotmc.AsyncCatcher.catchOp("block onPlace"); // Spigot
}
@@ -1080,6 +1086,12 @@ public abstract class BlockBehaviour implements FeatureElement {
this.getBlock().updateIndirectNeighbourShapes(this.asState(), world, pos, flags, maxUpdateDepth);
}
+ // Paper start
+ public void onPlace(Level world, BlockPos pos, BlockState state, boolean notify, net.minecraft.world.item.context.UseOnContext context) {
+ this.getBlock().onPlace(this.asState(), world, pos, state, notify, context);
+ }
+ // Paper end
+
public void onPlace(Level world, BlockPos pos, BlockState state, boolean notify) {
this.getBlock().onPlace(this.asState(), world, pos, state, notify);
}
diff --git a/src/main/java/net/minecraft/world/level/portal/PortalShape.java b/src/main/java/net/minecraft/world/level/portal/PortalShape.java
index 9fc4997277dd199cf6cffccceb3a9735398c5356..912cee9ec45876f831ca230b59a1be3b48ce6aa5 100644
index 766884046e2c22da4cb99712ff09d1f439394523..935ae100d3672cf493ebb6a3e6f70442ea22219b 100644
--- a/src/main/java/net/minecraft/world/level/portal/PortalShape.java
+++ b/src/main/java/net/minecraft/world/level/portal/PortalShape.java
@@ -190,7 +190,14 @@ public class PortalShape {