Updated Upstream (Paper)

This commit is contained in:
AlphaKR93
2023-03-30 12:56:38 +09:00
parent e5e84f55ab
commit 424e876c7c
6 changed files with 27 additions and 29 deletions

View File

@@ -3026,7 +3026,7 @@ index 877498729c66de9aa6a27c9148f7494d7895615c..acd7468ee3c86d3456e96e4ec3d7e6a4
Util.logAndPauseIfInIde("Detected setBlock in a far chunk [" + i + ", " + j + "], pos: " + pos + ", status: " + this.generatingStatus + (this.currentlyGenerating == null ? "" : ", currently generating: " + (String) this.currentlyGenerating.get()));
hasSetFarWarned = true;
diff --git a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
index 24d48fb4a63c2db19c7f957ad2260415fe1db9fe..ae3c1bd67c144fe971d4df6df2ca171b431b6fc5 100644
index e6e1c46a01961d47a774e34e430c8eacda22d558..dd53bc05595c6ea7afff23f11e0f54e90078684f 100644
--- a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
+++ b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
@@ -261,6 +261,7 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Tic
@@ -3307,7 +3307,7 @@ index 24d48fb4a63c2db19c7f957ad2260415fe1db9fe..ae3c1bd67c144fe971d4df6df2ca171b
player.getBukkitEntity().setResourcePackStatus(packStatus);
this.cserver.getPluginManager().callEvent(new PlayerResourcePackStatusEvent(this.getCraftPlayer(), packStatus)); // CraftBukkit
// Paper end
@@ -2353,7 +2444,7 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Tic
@@ -2354,7 +2445,7 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Tic
do {
instant1 = (Instant) this.lastChatTimeStamp.get();
if (timestamp.isBefore(instant1)) {
@@ -3316,7 +3316,7 @@ index 24d48fb4a63c2db19c7f957ad2260415fe1db9fe..ae3c1bd67c144fe971d4df6df2ca171b
}
} while (!this.lastChatTimeStamp.compareAndSet(instant1, timestamp));
@@ -2490,7 +2581,7 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Tic
@@ -2491,7 +2582,7 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Tic
}
}
// Paper End
@@ -3325,7 +3325,7 @@ index 24d48fb4a63c2db19c7f957ad2260415fe1db9fe..ae3c1bd67c144fe971d4df6df2ca171b
if ( org.spigotmc.SpigotConfig.logCommands ) // Spigot
this.LOGGER.info(this.player.getScoreboardName() + " issued server command: " + s);
@@ -2500,7 +2591,7 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Tic
@@ -2501,7 +2592,7 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Tic
this.cserver.getPluginManager().callEvent(event);
if (event.isCancelled()) {
@@ -3334,7 +3334,7 @@ index 24d48fb4a63c2db19c7f957ad2260415fe1db9fe..ae3c1bd67c144fe971d4df6df2ca171b
return;
}
@@ -2513,7 +2604,7 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Tic
@@ -2514,7 +2605,7 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Tic
java.util.logging.Logger.getLogger(ServerGamePacketListenerImpl.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
return;
} finally {
@@ -3343,7 +3343,7 @@ index 24d48fb4a63c2db19c7f957ad2260415fe1db9fe..ae3c1bd67c144fe971d4df6df2ca171b
}
}
// CraftBukkit end
@@ -2779,6 +2870,7 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Tic
@@ -2780,6 +2871,7 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Tic
AABB axisalignedbb = entity.getBoundingBox();
if (axisalignedbb.distanceToSqr(this.player.getEyePosition()) < ServerGamePacketListenerImpl.MAX_INTERACTION_DISTANCE) {
@@ -3351,7 +3351,7 @@ index 24d48fb4a63c2db19c7f957ad2260415fe1db9fe..ae3c1bd67c144fe971d4df6df2ca171b
packet.dispatch(new ServerboundInteractPacket.Handler() {
private void performInteraction(InteractionHand enumhand, ServerGamePacketListenerImpl.EntityInteraction playerconnection_a, PlayerInteractEntityEvent event) { // CraftBukkit
ItemStack itemstack = ServerGamePacketListenerImpl.this.player.getItemInHand(enumhand);
@@ -2792,6 +2884,8 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Tic
@@ -2793,6 +2885,8 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Tic
ServerGamePacketListenerImpl.this.cserver.getPluginManager().callEvent(event);
@@ -3360,7 +3360,7 @@ index 24d48fb4a63c2db19c7f957ad2260415fe1db9fe..ae3c1bd67c144fe971d4df6df2ca171b
// Entity in bucket - SPIGOT-4048 and SPIGOT-6859a
if ((entity instanceof Bucketable && entity instanceof LivingEntity && origItem != null && origItem.asItem() == Items.WATER_BUCKET) && (event.isCancelled() || ServerGamePacketListenerImpl.this.player.getInventory().getSelected() == null || ServerGamePacketListenerImpl.this.player.getInventory().getSelected().getItem() != origItem)) {
entity.getEntityData().resendPossiblyDesyncedEntity(player); // Paper - The entire mob gets deleted, so resend it.
@@ -3343,6 +3437,12 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Tic
@@ -3344,6 +3438,12 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Tic
}
}
}
@@ -3373,7 +3373,7 @@ index 24d48fb4a63c2db19c7f957ad2260415fe1db9fe..ae3c1bd67c144fe971d4df6df2ca171b
boolean flag1 = packet.getSlotNum() >= 1 && packet.getSlotNum() <= 45;
boolean flag2 = itemstack.isEmpty() || itemstack.getDamageValue() >= 0 && itemstack.getCount() <= 64 && !itemstack.isEmpty();
@@ -3449,11 +3549,17 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Tic
@@ -3450,11 +3550,17 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Tic
for (int i = 0; i < signText.size(); ++i) {
FilteredText filteredtext = (FilteredText) signText.get(i);
@@ -3394,7 +3394,7 @@ index 24d48fb4a63c2db19c7f957ad2260415fe1db9fe..ae3c1bd67c144fe971d4df6df2ca171b
}
SignChangeEvent event = new SignChangeEvent((org.bukkit.craftbukkit.block.CraftBlock) player.getWorld().getBlockAt(x, y, z), this.player.getBukkitEntity(), lines);
this.cserver.getPluginManager().callEvent(event);
@@ -3475,6 +3581,16 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Tic
@@ -3476,6 +3582,16 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Tic
@Override
public void handleKeepAlive(ServerboundKeepAlivePacket packet) {
@@ -3411,7 +3411,7 @@ index 24d48fb4a63c2db19c7f957ad2260415fe1db9fe..ae3c1bd67c144fe971d4df6df2ca171b
//PacketUtils.ensureRunningOnSameThread(packet, this, this.player.getLevel()); // CraftBukkit // Paper - This shouldn't be on the main thread
if (this.keepAlivePending && packet.getId() == this.keepAliveChallenge) {
int i = (int) (Util.getMillis() - this.keepAliveTime);
@@ -3525,6 +3641,7 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Tic
@@ -3526,6 +3642,7 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Tic
private static final ResourceLocation CUSTOM_UNREGISTER = new ResourceLocation("unregister");
private static final ResourceLocation MINECRAFT_BRAND = new ResourceLocation("brand"); // Paper - Brand support
@@ -3419,7 +3419,7 @@ index 24d48fb4a63c2db19c7f957ad2260415fe1db9fe..ae3c1bd67c144fe971d4df6df2ca171b
@Override
public void handleCustomPayload(ServerboundCustomPayloadPacket packet) {
@@ -3549,6 +3666,13 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Tic
@@ -3550,6 +3667,13 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Tic
ServerGamePacketListenerImpl.LOGGER.error("Couldn\'t unregister custom payload", ex);
this.disconnect("Invalid payload UNREGISTER!", org.bukkit.event.player.PlayerKickEvent.Cause.INVALID_PAYLOAD); // Paper - kick event cause
}
@@ -19072,7 +19072,7 @@ index b91effe91dad2e1aeea0ea31140f7432833b343f..bb628bd3fe8b185f356968697b17e1c4
if (!world.addFreshEntity(entitywither, SpawnReason.BUILD_WITHER)) {
return;
diff --git a/src/main/java/net/minecraft/world/level/block/entity/AbstractFurnaceBlockEntity.java b/src/main/java/net/minecraft/world/level/block/entity/AbstractFurnaceBlockEntity.java
index 2a786c9fd29dc2139cf487fa645cd43345d60167..507b3756238ec3054232b805a9b689be6ea12e25 100644
index a3f073066f6e2eea8964461ad2b0409ade202f35..5cd7b4e7065070bf9fcc34b621dba2ccba99a573 100644
--- a/src/main/java/net/minecraft/world/level/block/entity/AbstractFurnaceBlockEntity.java
+++ b/src/main/java/net/minecraft/world/level/block/entity/AbstractFurnaceBlockEntity.java
@@ -44,6 +44,7 @@ import net.minecraft.world.level.Level;