Patches!
This commit is contained in:
		
					parent
					
						
							
								27c46717f6
							
						
					
				
			
			
				commit
				
					
						babd22019c
					
				
			
		
					 19 changed files with 48 additions and 41 deletions
				
			
		| 
						 | 
				
			
			@ -37,7 +37,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
 | 
			
		|||
+            this.player.clientBrandName = brandPayload.brand();
 | 
			
		||||
+        }
 | 
			
		||||
+        // Paper end - Brand support
 | 
			
		||||
         if (!(packet.payload() instanceof ServerboundCustomPayloadPacket.UnknownPayload)) {
 | 
			
		||||
         if (!(packet.payload() instanceof DiscardedPayload)) {
 | 
			
		||||
             return;
 | 
			
		||||
         }
 | 
			
		||||
@@ -0,0 +0,0 @@ public abstract class ServerCommonPacketListenerImpl implements ServerCommonPack
 | 
			
		||||
| 
						 | 
				
			
			@ -28,16 +28,13 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
 | 
			
		|||
+        // 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) {
 | 
			
		||||
| 
						 | 
				
			
			@ -9,17 +9,15 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
 | 
			
		|||
--- a/src/main/java/net/minecraft/server/level/ServerLevel.java
 | 
			
		||||
+++ b/src/main/java/net/minecraft/server/level/ServerLevel.java
 | 
			
		||||
@@ -0,0 +0,0 @@ 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()));
 | 
			
		||||
         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
 | 
			
		||||
         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);
 | 
			
		||||
             this.getServer().getPlayerList().broadcastAll(new ClientboundSetDefaultSpawnPositionPacket(pos, angle));
 | 
			
		||||
         }
 | 
			
		||||
 
 | 
			
		||||
diff --git a/src/main/java/org/bukkit/craftbukkit/CraftWorld.java b/src/main/java/org/bukkit/craftbukkit/CraftWorld.java
 | 
			
		||||
index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644
 | 
			
		||||
--- a/src/main/java/org/bukkit/craftbukkit/CraftWorld.java
 | 
			
		||||
| 
						 | 
				
			
			@ -8,12 +8,12 @@ diff --git a/src/main/java/net/minecraft/world/item/ItemStack.java b/src/main/ja
 | 
			
		|||
index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644
 | 
			
		||||
--- a/src/main/java/net/minecraft/world/item/ItemStack.java
 | 
			
		||||
+++ b/src/main/java/net/minecraft/world/item/ItemStack.java
 | 
			
		||||
@@ -0,0 +0,0 @@ public final class ItemStack {
 | 
			
		||||
@@ -0,0 +0,0 @@ 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
 | 
			
		||||
| 
						 | 
				
			
			@ -24,13 +24,13 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
 | 
			
		|||
@@ -0,0 +0,0 @@ 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)) {
 | 
			
		||||
| 
						 | 
				
			
			@ -50,10 +50,10 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
 | 
			
		|||
     }
 | 
			
		||||
 
 | 
			
		||||
     @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
 | 
			
		||||
         world.scheduleTick(pos, (Block) this, FireBlock.getFireTickDelay(world.random));
 | 
			
		||||
| 
						 | 
				
			
			@ -68,15 +68,27 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
 | 
			
		|||
     }
 | 
			
		||||
 
 | 
			
		||||
+    // 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
 | 
			
		||||
     }
 | 
			
		||||
@@ -0,0 +0,0 @@ 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 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644
 | 
			
		||||
--- a/src/main/java/net/minecraft/world/level/portal/PortalShape.java
 | 
			
		||||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue