Patching patched patched patches

This commit is contained in:
Nassim Jahnke 2022-12-07 21:16:54 +01:00
parent eac356d807
commit 00dec09758
325 changed files with 362 additions and 534 deletions

View File

@ -29,13 +29,13 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
--- a/src/main/java/net/minecraft/server/level/ServerPlayer.java --- a/src/main/java/net/minecraft/server/level/ServerPlayer.java
+++ b/src/main/java/net/minecraft/server/level/ServerPlayer.java +++ b/src/main/java/net/minecraft/server/level/ServerPlayer.java
@@ -0,0 +0,0 @@ public class ServerPlayer extends Player { @@ -0,0 +0,0 @@ public class ServerPlayer extends Player {
public boolean isRealPlayer; // Paper
public double lastEntitySpawnRadiusSquared; // Paper - optimise isOutsideRange, this field is in blocks public double lastEntitySpawnRadiusSquared; // Paper - optimise isOutsideRange, this field is in blocks
public final com.destroystokyo.paper.util.misc.PooledLinkedHashSets.PooledObjectLinkedOpenHashSet<ServerPlayer> cachedSingleHashSet; // Paper public final com.destroystokyo.paper.util.misc.PooledLinkedHashSets.PooledObjectLinkedOpenHashSet<ServerPlayer> cachedSingleHashSet; // Paper
public PlayerNaturallySpawnCreaturesEvent playerNaturallySpawnedEvent; // Paper
+ public org.bukkit.event.player.PlayerQuitEvent.QuitReason quitReason = null; // Paper - there are a lot of changes to do if we change all methods leading to the event + public org.bukkit.event.player.PlayerQuitEvent.QuitReason quitReason = null; // Paper - there are a lot of changes to do if we change all methods leading to the event
public ServerPlayer(MinecraftServer server, ServerLevel world, GameProfile profile, @Nullable ProfilePublicKey publicKey) { public ServerPlayer(MinecraftServer server, ServerLevel world, GameProfile profile) {
super(world, world.getSharedSpawnPos(), world.getSharedSpawnAngle(), profile, publicKey); super(world, world.getSharedSpawnPos(), world.getSharedSpawnAngle(), profile);
diff --git a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java diff --git a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644 index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644
--- a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java --- a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java

View File

@ -71,7 +71,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
--- a/src/main/java/net/minecraft/world/level/material/WaterFluid.java --- a/src/main/java/net/minecraft/world/level/material/WaterFluid.java
+++ b/src/main/java/net/minecraft/world/level/material/WaterFluid.java +++ b/src/main/java/net/minecraft/world/level/material/WaterFluid.java
@@ -0,0 +0,0 @@ public abstract class WaterFluid extends FlowingFluid { @@ -0,0 +0,0 @@ public abstract class WaterFluid extends FlowingFluid {
return true; return world.getGameRules().getBoolean(GameRules.RULE_WATER_SOURCE_CONVERSION);
} }
+ // Paper start + // Paper start

View File

@ -56,12 +56,12 @@ diff --git a/src/main/java/net/minecraft/world/level/block/ButtonBlock.java b/sr
index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644 index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644
--- a/src/main/java/net/minecraft/world/level/block/ButtonBlock.java --- a/src/main/java/net/minecraft/world/level/block/ButtonBlock.java
+++ b/src/main/java/net/minecraft/world/level/block/ButtonBlock.java +++ b/src/main/java/net/minecraft/world/level/block/ButtonBlock.java
@@ -0,0 +0,0 @@ public abstract class ButtonBlock extends FaceAttachedHorizontalDirectionalBlock @@ -0,0 +0,0 @@ public class ButtonBlock extends FaceAttachedHorizontalDirectionalBlock {
@Override @Override
public void entityInside(BlockState state, Level world, BlockPos pos, Entity entity) { public void entityInside(BlockState state, Level world, BlockPos pos, Entity entity) {
+ if (!new io.papermc.paper.event.entity.EntityInsideBlockEvent(entity.getBukkitEntity(), org.bukkit.craftbukkit.block.CraftBlock.at(world, pos)).callEvent()) { return; } // Paper + if (!new io.papermc.paper.event.entity.EntityInsideBlockEvent(entity.getBukkitEntity(), org.bukkit.craftbukkit.block.CraftBlock.at(world, pos)).callEvent()) { return; } // Paper
if (!world.isClientSide && this.sensitive && !(Boolean) state.getValue(ButtonBlock.POWERED)) { if (!world.isClientSide && this.arrowsCanPress && !(Boolean) state.getValue(ButtonBlock.POWERED)) {
this.checkPressed(state, world, pos); this.checkPressed(state, world, pos);
} }
diff --git a/src/main/java/net/minecraft/world/level/block/CactusBlock.java b/src/main/java/net/minecraft/world/level/block/CactusBlock.java diff --git a/src/main/java/net/minecraft/world/level/block/CactusBlock.java b/src/main/java/net/minecraft/world/level/block/CactusBlock.java

View File

@ -197,8 +197,8 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
--- a/src/main/java/net/minecraft/server/MinecraftServer.java --- a/src/main/java/net/minecraft/server/MinecraftServer.java
+++ b/src/main/java/net/minecraft/server/MinecraftServer.java +++ b/src/main/java/net/minecraft/server/MinecraftServer.java
@@ -0,0 +0,0 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa @@ -0,0 +0,0 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
this.packRepository.setSelected(dataPacks);
this.worldData.setDataPackConfig(MinecraftServer.getSelectedPacks(this.packRepository)); this.worldData.setDataConfiguration(worlddataconfiguration);
this.resources.managers.updateRegistryTags(this.registryAccess()); this.resources.managers.updateRegistryTags(this.registryAccess());
+ io.papermc.paper.registry.PaperRegistry.clearCaches(); // Paper + io.papermc.paper.registry.PaperRegistry.clearCaches(); // Paper
new io.papermc.paper.event.server.ServerResourcesReloadedEvent(cause).callEvent(); // Paper new io.papermc.paper.event.server.ServerResourcesReloadedEvent(cause).callEvent(); // Paper
@ -225,9 +225,9 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
--- a/src/test/java/org/bukkit/support/AbstractTestingBase.java --- a/src/test/java/org/bukkit/support/AbstractTestingBase.java
+++ b/src/test/java/org/bukkit/support/AbstractTestingBase.java +++ b/src/test/java/org/bukkit/support/AbstractTestingBase.java
@@ -0,0 +0,0 @@ public abstract class AbstractTestingBase { @@ -0,0 +0,0 @@ public abstract class AbstractTestingBase {
MultiPackResourceManager resourceManager = new MultiPackResourceManager(PackType.SERVER_DATA, Collections.singletonList(new VanillaPackResources(ServerPacksSource.BUILT_IN_METADATA, "minecraft"))); LayeredRegistryAccess<RegistryLayer> layers = RegistryLayer.createRegistryAccess();
// add tags and loot tables for unit tests layers = WorldLoader.loadAndReplaceLayer(resourceManager, layers, RegistryLayer.WORLDGEN, RegistryDataLoader.WORLDGEN_REGISTRIES);
REGISTRY_CUSTOM = RegistryAccess.builtinCopy().freeze(); REGISTRY_CUSTOM = layers.compositeAccess().freeze();
+ // Paper start + // Paper start
+ try { + try {
+ java.lang.reflect.Field field = io.papermc.paper.registry.PaperRegistry.class.getDeclaredField("REGISTRY_ACCESS"); + java.lang.reflect.Field field = io.papermc.paper.registry.PaperRegistry.class.getDeclaredField("REGISTRY_ACCESS");
@ -238,5 +238,5 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
+ } + }
+ // Paper end + // Paper end
// Register vanilla pack // Register vanilla pack
DATA_PACK = ReloadableServerResources.loadResources(resourceManager, REGISTRY_CUSTOM, Commands.CommandSelection.DEDICATED, 0, MoreExecutors.directExecutor(), MoreExecutors.directExecutor()).join(); DATA_PACK = ReloadableServerResources.loadResources(resourceManager, REGISTRY_CUSTOM, FeatureFlags.REGISTRY.allFlags(), Commands.CommandSelection.DEDICATED, 0, MoreExecutors.directExecutor(), MoreExecutors.directExecutor()).join();
// Bind tags // Bind tags

View File

@ -95,7 +95,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
+ this.disconnect(Component.translatable("multiplayer.disconnect.idling"), org.bukkit.event.player.PlayerKickEvent.Cause.IDLING); // Paper - kick event cause + this.disconnect(Component.translatable("multiplayer.disconnect.idling"), org.bukkit.event.player.PlayerKickEvent.Cause.IDLING); // Paper - kick event cause
} }
this.chatPreviewThrottler.tick(); }
@@ -0,0 +0,0 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Tic @@ -0,0 +0,0 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Tic
return this.server.isSingleplayerOwner(this.player.getGameProfile()); return this.server.isSingleplayerOwner(this.player.getGameProfile());
} }
@ -115,13 +115,13 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
public void disconnect(final Component reason) { public void disconnect(final Component reason) {
- this.disconnect(PaperAdventure.asAdventure(reason)); - this.disconnect(PaperAdventure.asAdventure(reason));
+ this.disconnect(PaperAdventure.asAdventure(reason), org.bukkit.event.player.PlayerKickEvent.Cause.UNKNOWN); + this.disconnect(PaperAdventure.asAdventure(reason), org.bukkit.event.player.PlayerKickEvent.Cause.UNKNOWN);
+ }
+
+ public void disconnect(final Component reason, PlayerKickEvent.Cause cause) {
+ this.disconnect(PaperAdventure.asAdventure(reason), cause);
} }
- public void disconnect(net.kyori.adventure.text.Component reason) { - public void disconnect(net.kyori.adventure.text.Component reason) {
+ public void disconnect(final Component reason, PlayerKickEvent.Cause cause) {
+ this.disconnect(PaperAdventure.asAdventure(reason), cause);
+ }
+
+ public void disconnect(net.kyori.adventure.text.Component reason, org.bukkit.event.player.PlayerKickEvent.Cause cause) { + public void disconnect(net.kyori.adventure.text.Component reason, org.bukkit.event.player.PlayerKickEvent.Cause cause) {
// Paper end // Paper end
// CraftBukkit start - fire PlayerKickEvent // CraftBukkit start - fire PlayerKickEvent
@ -247,8 +247,8 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
- this.disconnect(Component.translatable("multiplayer.disconnect.illegal_characters")); - this.disconnect(Component.translatable("multiplayer.disconnect.illegal_characters"));
+ this.disconnect(Component.translatable("multiplayer.disconnect.illegal_characters"), org.bukkit.event.player.PlayerKickEvent.Cause.ILLEGAL_CHARACTERS); // Paper - add cause + this.disconnect(Component.translatable("multiplayer.disconnect.illegal_characters"), org.bukkit.event.player.PlayerKickEvent.Cause.ILLEGAL_CHARACTERS); // Paper - add cause
} else { } else {
if (this.tryHandleChat(packet.message(), packet.timeStamp(), packet.lastSeenMessages())) { Optional<LastSeenMessages> optional = this.tryHandleChat(packet.message(), packet.timeStamp(), packet.lastSeenMessages());
// this.server.submit(() -> { // CraftBukkit - async chat
@@ -0,0 +0,0 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Tic @@ -0,0 +0,0 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Tic
@Override @Override
public void handleChatCommand(ServerboundChatCommandPacket packet) { public void handleChatCommand(ServerboundChatCommandPacket packet) {
@ -256,26 +256,50 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
- this.disconnect(Component.translatable("multiplayer.disconnect.illegal_characters")); - this.disconnect(Component.translatable("multiplayer.disconnect.illegal_characters"));
+ this.disconnect(Component.translatable("multiplayer.disconnect.illegal_characters"), org.bukkit.event.player.PlayerKickEvent.Cause.ILLEGAL_CHARACTERS); // Paper + this.disconnect(Component.translatable("multiplayer.disconnect.illegal_characters"), org.bukkit.event.player.PlayerKickEvent.Cause.ILLEGAL_CHARACTERS); // Paper
} else { } else {
if (this.tryHandleChat(packet.command(), packet.timeStamp(), packet.lastSeenMessages())) { Optional<LastSeenMessages> optional = this.tryHandleChat(packet.command(), packet.timeStamp(), packet.lastSeenMessages());
this.server.submit(() -> {
@@ -0,0 +0,0 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Tic @@ -0,0 +0,0 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Tic
private boolean tryHandleChat(String message, Instant timestamp, LastSeenMessages.Update acknowledgment) { private Optional<LastSeenMessages> tryHandleChat(String message, Instant timestamp, LastSeenMessages.Update acknowledgment) {
if (!this.updateChatOrder(timestamp)) { if (!this.updateChatOrder(timestamp)) {
ServerGamePacketListenerImpl.LOGGER.warn("{} sent out-of-order chat: '{}'", this.player.getName().getString(), message); ServerGamePacketListenerImpl.LOGGER.warn("{} sent out-of-order chat: '{}'", this.player.getName().getString(), message);
- this.disconnect(Component.translatable("multiplayer.disconnect.out_of_order_chat")); - this.disconnect(Component.translatable("multiplayer.disconnect.out_of_order_chat"));
+ this.disconnect(Component.translatable("multiplayer.disconnect.out_of_order_chat"), org.bukkit.event.player.PlayerKickEvent.Cause.OUT_OF_ORDER_CHAT); // Paper - kick event cause + this.disconnect(Component.translatable("multiplayer.disconnect.out_of_order_chat"), org.bukkit.event.player.PlayerKickEvent.Cause.OUT_OF_ORDER_CHAT); // Paper - kick event ca
return false; return Optional.empty();
} else if (this.player.isRemoved() || this.player.getChatVisibility() == ChatVisiblity.HIDDEN) { // CraftBukkit - dead men tell no tales } else if (this.player.isRemoved() || this.player.getChatVisibility() == ChatVisiblity.HIDDEN) { // CraftBukkit - dead men tell no tales
this.send(new ClientboundSystemChatPacket(Component.translatable("chat.disabled.options").withStyle(ChatFormatting.RED), false)); this.send(new ClientboundSystemChatPacket(Component.translatable("chat.disabled.options").withStyle(ChatFormatting.RED), false));
@@ -0,0 +0,0 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Tic @@ -0,0 +0,0 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Tic
} this.detectRateSpam(s); // Spigot
}
if (!message.verify(chatsender)) { +<<<<<<< HEAD
- this.disconnect(Component.translatable("multiplayer.disconnect.unsigned_chat")); +=======
+ private boolean verifyChatMessage(PlayerChatMessage message) {
+ ChatSender chatsender = this.player.asChatSender();
+ ProfilePublicKey profilepublickey = chatsender.profilePublicKey();
+
+ if (profilepublickey != null) {
+ if (profilepublickey.data().hasExpired()) {
+ this.player.sendSystemMessage(Component.translatable("chat.disabled.expiredProfileKey").withStyle(ChatFormatting.RED));
+ return false;
+ }
+
+ if (!message.verify(chatsender)) {
+ this.disconnect(Component.translatable("multiplayer.disconnect.unsigned_chat"), org.bukkit.event.player.PlayerKickEvent.Cause.UNSIGNED_CHAT); // Paper - kick event cause + this.disconnect(Component.translatable("multiplayer.disconnect.unsigned_chat"), org.bukkit.event.player.PlayerKickEvent.Cause.UNSIGNED_CHAT); // Paper - kick event cause
return false; + return false;
} + }
} + }
+
+ if (message.hasExpiredServer(Instant.now())) {
+ ServerGamePacketListenerImpl.LOGGER.warn("{} sent expired chat: '{}'. Is the client/server system time unsynchronized?", this.player.getName().getString(), message.signedContent().plain());
+ }
+
+ return true;
+ }
+
+>>>>>>> Add PlayerKickEvent causes
// Spigot start - spam exclusions
private void detectRateSpam(String s) {
// CraftBukkit start - replaced with thread safe throttle
@@ -0,0 +0,0 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Tic @@ -0,0 +0,0 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Tic
// this.chatSpamTickCount += 20; // this.chatSpamTickCount += 20;
if (this.chatSpamTickCount.addAndGet(20) > 200 && !this.server.getPlayerList().isOp(this.player.getGameProfile())) { if (this.chatSpamTickCount.addAndGet(20) > 200 && !this.server.getPlayerList().isOp(this.player.getGameProfile())) {
@ -286,11 +310,18 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
} }
@@ -0,0 +0,0 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Tic @@ -0,0 +0,0 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Tic
}
private void handleValidationFailure(Set<LastSeenMessagesValidator.ErrorCondition> reasons) { }
ServerGamePacketListenerImpl.LOGGER.warn("Failed to validate message from {}, reasons: {}", this.player.getName().getString(), reasons.stream().map(LastSeenMessagesValidator.ErrorCondition::message).collect(Collectors.joining(","))); +<<<<<<< HEAD
- this.disconnect(Component.translatable("multiplayer.disconnect.chat_validation_failed")); +=======
+
+ }
+
+ private void handleValidationFailure(Set<LastSeenMessagesValidator.ErrorCondition> reasons) {
+ ServerGamePacketListenerImpl.LOGGER.warn("Failed to validate message from {}, reasons: {}", this.player.getName().getString(), reasons.stream().map(LastSeenMessagesValidator.ErrorCondition::message).collect(Collectors.joining(",")));
+ this.disconnect(Component.translatable("multiplayer.disconnect.chat_validation_failed"), org.bukkit.event.player.PlayerKickEvent.Cause.CHAT_VALIDATION_FAILED); // Paper - kick event cause + this.disconnect(Component.translatable("multiplayer.disconnect.chat_validation_failed"), org.bukkit.event.player.PlayerKickEvent.Cause.CHAT_VALIDATION_FAILED); // Paper - kick event cause
+>>>>>>> Add PlayerKickEvent causes
} }
@Override @Override
@ -313,8 +344,8 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
} }
// Spigot End // Spigot End
@@ -0,0 +0,0 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Tic @@ -0,0 +0,0 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Tic
// CraftBukkit end
} }
// CraftBukkit end
} else { } else {
- ServerGamePacketListenerImpl.this.disconnect(Component.translatable("multiplayer.disconnect.invalid_entity_attacked")); - ServerGamePacketListenerImpl.this.disconnect(Component.translatable("multiplayer.disconnect.invalid_entity_attacked"));
+ ServerGamePacketListenerImpl.this.disconnect(Component.translatable("multiplayer.disconnect.invalid_entity_attacked"), org.bukkit.event.player.PlayerKickEvent.Cause.INVALID_ENTITY_ATTACKED); // Paper - add cause + ServerGamePacketListenerImpl.this.disconnect(Component.translatable("multiplayer.disconnect.invalid_entity_attacked"), org.bukkit.event.player.PlayerKickEvent.Cause.INVALID_ENTITY_ATTACKED); // Paper - add cause

View File

@ -28,7 +28,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
+ return InteractionResult.PASS; + return InteractionResult.PASS;
+ } + }
+ // Paper end + // Paper end
world.playSound(player, player.getX(), player.getY(), player.getZ(), SoundEvents.BEEHIVE_SHEAR, SoundSource.NEUTRAL, 1.0F, 1.0F); world.playSound(player, player.getX(), player.getY(), player.getZ(), SoundEvents.BEEHIVE_SHEAR, SoundSource.BLOCKS, 1.0F, 1.0F);
- BeehiveBlock.dropHoneycomb(world, pos); - BeehiveBlock.dropHoneycomb(world, pos);
+ // Paper start - Add PlayerShearBlockEvent + // Paper start - Add PlayerShearBlockEvent
+ for (org.bukkit.inventory.ItemStack itemDrop : event.getDrops()) { + for (org.bukkit.inventory.ItemStack itemDrop : event.getDrops()) {

View File

@ -124,44 +124,44 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
@@ -0,0 +0,0 @@ public class MerchantMenu extends AbstractContainerMenu { @@ -0,0 +0,0 @@ public class MerchantMenu extends AbstractContainerMenu {
itemstack = itemstack1.copy(); itemstack = itemstack1.copy();
if (index == 2) { if (slot == 2) {
- if (!this.moveItemStackTo(itemstack1, 3, 39, true)) { - if (!this.moveItemStackTo(itemstack1, 3, 39, true)) {
+ if (!this.moveItemStackTo(itemstack1, 3, 39, true, true)) { // Paper + if (!this.moveItemStackTo(itemstack1, 3, 39, true, true)) { // Paper
return ItemStack.EMPTY; return ItemStack.EMPTY;
} }
- slot.onQuickCraft(itemstack1, itemstack); - slot1.onQuickCraft(itemstack1, itemstack);
- this.playTradeSound(); - this.playTradeSound();
+ // slot.onQuickCraft(itemstack1, itemstack); // Paper - moved to after the non-check moveItemStackTo call + // slot1.onQuickCraft(itemstack1, itemstack); // Paper - moved to after the non-check moveItemStackTo call
+ // this.playTradeSound(); + // this.playTradeSound();
} else if (index != 0 && index != 1) { } else if (slot != 0 && slot != 1) {
if (index >= 3 && index < 30) { if (slot >= 3 && slot < 30) {
if (!this.moveItemStackTo(itemstack1, 30, 39, false)) { if (!this.moveItemStackTo(itemstack1, 30, 39, false)) {
@@ -0,0 +0,0 @@ public class MerchantMenu extends AbstractContainerMenu { @@ -0,0 +0,0 @@ public class MerchantMenu extends AbstractContainerMenu {
return ItemStack.EMPTY; return ItemStack.EMPTY;
} }
+ if (index != 2) { // Paper - moved down for slot 2 + if (slot != 2) { // Paper - moved down for slot 2
if (itemstack1.isEmpty()) { if (itemstack1.isEmpty()) {
slot.set(ItemStack.EMPTY); slot1.set(ItemStack.EMPTY);
} else { } else {
@@ -0,0 +0,0 @@ public class MerchantMenu extends AbstractContainerMenu { @@ -0,0 +0,0 @@ public class MerchantMenu extends AbstractContainerMenu {
} }
slot.onTake(player, itemstack1); slot1.onTake(player, itemstack1);
+ } // Paper start - handle slot 2 + } // Paper start - handle slot 2
+ if (index == 2) { // is merchant result slot + if (slot == 2) { // is merchant result slot
+ slot.onTake(player, itemstack1); + slot1.onTake(player, itemstack1);
+ if (itemstack1.isEmpty()) { + if (itemstack1.isEmpty()) {
+ slot.set(ItemStack.EMPTY); + slot1.set(ItemStack.EMPTY);
+ return ItemStack.EMPTY; + return ItemStack.EMPTY;
+ } + }
+ +
+ this.moveItemStackTo(itemstack1, 3, 39, true, false); // This should always succeed because it's checked above + this.moveItemStackTo(itemstack1, 3, 39, true, false); // This should always succeed because it's checked above
+ +
+ slot.onQuickCraft(itemstack1, itemstack); + slot1.onQuickCraft(itemstack1, itemstack);
+ this.playTradeSound(); + this.playTradeSound();
+ slot.set(ItemStack.EMPTY); // itemstack1 should ALWAYS be empty + slot1.set(ItemStack.EMPTY); // itemstack1 should ALWAYS be empty
+ } + }
+ // Paper end + // Paper end
} }

View File

@ -74,7 +74,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
--- a/src/main/java/net/minecraft/world/inventory/SmithingMenu.java --- a/src/main/java/net/minecraft/world/inventory/SmithingMenu.java
+++ b/src/main/java/net/minecraft/world/inventory/SmithingMenu.java +++ b/src/main/java/net/minecraft/world/inventory/SmithingMenu.java
@@ -0,0 +0,0 @@ public class SmithingMenu extends ItemCombinerMenu { @@ -0,0 +0,0 @@ public class SmithingMenu extends ItemCombinerMenu {
// CraftBukkit end }
} }
+ org.bukkit.craftbukkit.event.CraftEventFactory.callPrepareResultEvent(this, RESULT_SLOT); // Paper + org.bukkit.craftbukkit.event.CraftEventFactory.callPrepareResultEvent(this, RESULT_SLOT); // Paper

View File

@ -99,16 +99,16 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
+ structures = HolderSet.direct(paperRegistry::getMinecraftHolder, event.getConfiguredStructures()); + structures = HolderSet.direct(paperRegistry::getMinecraftHolder, event.getConfiguredStructures());
+ } + }
+ // Paper end + // Paper end
ChunkGeneratorStructureState chunkgeneratorstructurestate = world.getChunkSource().getGeneratorState();
Map<StructurePlacement, Set<Holder<Structure>>> map = new Object2ObjectArrayMap(); Map<StructurePlacement, Set<Holder<Structure>>> map = new Object2ObjectArrayMap();
Iterator iterator = structures.iterator(); Iterator iterator = structures.iterator();
diff --git a/src/main/java/net/minecraft/world/level/levelgen/structure/Structure.java b/src/main/java/net/minecraft/world/level/levelgen/structure/Structure.java diff --git a/src/main/java/net/minecraft/world/level/levelgen/structure/Structure.java b/src/main/java/net/minecraft/world/level/levelgen/structure/Structure.java
index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644 index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644
--- a/src/main/java/net/minecraft/world/level/levelgen/structure/Structure.java --- a/src/main/java/net/minecraft/world/level/levelgen/structure/Structure.java
+++ b/src/main/java/net/minecraft/world/level/levelgen/structure/Structure.java +++ b/src/main/java/net/minecraft/world/level/levelgen/structure/Structure.java
@@ -0,0 +0,0 @@ public abstract class Structure { @@ -0,0 +0,0 @@ public abstract class Structure {
public static final Codec<Structure> DIRECT_CODEC = Registry.STRUCTURE_TYPES.byNameCodec().dispatch(Structure::type, StructureType::codec); public static final Codec<Structure> DIRECT_CODEC = BuiltInRegistries.STRUCTURE_TYPE.byNameCodec().dispatch(Structure::type, StructureType::codec);
public static final Codec<Holder<Structure>> CODEC = RegistryFileCodec.create(Registry.STRUCTURE_REGISTRY, DIRECT_CODEC); public static final Codec<Holder<Structure>> CODEC = RegistryFileCodec.create(Registries.STRUCTURE, DIRECT_CODEC);
protected final Structure.StructureSettings settings; protected final Structure.StructureSettings settings;
+ static { io.papermc.paper.world.structure.PaperConfiguredStructure.init(); } // Paper + static { io.papermc.paper.world.structure.PaperConfiguredStructure.init(); } // Paper
@ -212,3 +212,16 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
+ System.setOut(out); + System.setOut(out);
+ } + }
+} +}
diff --git a/src/test/java/org/bukkit/support/AbstractTestingBase.java b/src/test/java/org/bukkit/support/AbstractTestingBase.java
index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644
--- a/src/test/java/org/bukkit/support/AbstractTestingBase.java
+++ b/src/test/java/org/bukkit/support/AbstractTestingBase.java
@@ -0,0 +0,0 @@ public abstract class AbstractTestingBase {
REGISTRY_CUSTOM = layers.compositeAccess().freeze();
// Paper start
try {
- java.lang.reflect.Field field = io.papermc.paper.registry.PaperRegistry.class.getDeclaredField("REGISTRY_ACCESS");
+ java.lang.reflect.Field field = io.papermc.paper.registry.PaperRegistry.class.getDeclaredField("REGISTRgY_ACCESS");
field.trySetAccessible();
field.set(null, com.google.common.base.Suppliers.ofInstance(REGISTRY_CUSTOM));
} catch (ReflectiveOperationException ex) {

View File

@ -26,8 +26,8 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
+ } + }
+ // Paper end + // Paper end
public static DamageSource sting(LivingEntity attacker) { public static DamageSource fallingBlock(Entity attacker) {
return new EntityDamageSource("sting", attacker); return (new EntityDamageSource("fallingBlock", attacker)).damageHelmet();
diff --git a/src/main/java/net/minecraft/world/entity/player/Player.java b/src/main/java/net/minecraft/world/entity/player/Player.java diff --git a/src/main/java/net/minecraft/world/entity/player/Player.java b/src/main/java/net/minecraft/world/entity/player/Player.java
index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644 index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644
--- a/src/main/java/net/minecraft/world/entity/player/Player.java --- a/src/main/java/net/minecraft/world/entity/player/Player.java

View File

@ -8,7 +8,7 @@ diff --git a/src/main/java/net/minecraft/server/network/ServerLoginPacketListene
index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644 index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644
--- a/src/main/java/net/minecraft/server/network/ServerLoginPacketListenerImpl.java --- a/src/main/java/net/minecraft/server/network/ServerLoginPacketListenerImpl.java
+++ b/src/main/java/net/minecraft/server/network/ServerLoginPacketListenerImpl.java +++ b/src/main/java/net/minecraft/server/network/ServerLoginPacketListenerImpl.java
@@ -0,0 +0,0 @@ public class ServerLoginPacketListenerImpl implements TickablePacketListener, Se @@ -0,0 +0,0 @@ public class ServerLoginPacketListenerImpl implements ServerLoginPacketListener,
public void fireEvents() throws Exception { public void fireEvents() throws Exception {
String playerName = ServerLoginPacketListenerImpl.this.gameProfile.getName(); String playerName = ServerLoginPacketListenerImpl.this.gameProfile.getName();
java.net.InetAddress address = ((java.net.InetSocketAddress) ServerLoginPacketListenerImpl.this.connection.getRemoteAddress()).getAddress(); java.net.InetAddress address = ((java.net.InetSocketAddress) ServerLoginPacketListenerImpl.this.connection.getRemoteAddress()).getAddress();

View File

@ -33,11 +33,11 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
}).orElse(itemstack); }).orElse(itemstack);
@@ -0,0 +0,0 @@ public class CampfireBlockEntity extends BlockEntity implements Clearable { @@ -0,0 +0,0 @@ public class CampfireBlockEntity extends BlockEntity implements Clearable {
CraftItemStack source = CraftItemStack.asCraftMirror(itemstack); CraftItemStack source = CraftItemStack.asCraftMirror(itemstack);
org.bukkit.inventory.ItemStack result = CraftItemStack.asBukkitCopy(itemstack1); org.bukkit.inventory.ItemStack result = CraftItemStack.asBukkitCopy(itemstack1);
- BlockCookEvent blockCookEvent = new BlockCookEvent(CraftBlock.at(world, pos), source, result); - BlockCookEvent blockCookEvent = new BlockCookEvent(CraftBlock.at(world, pos), source, result);
+ BlockCookEvent blockCookEvent = new BlockCookEvent(CraftBlock.at(world, pos), source, result, (org.bukkit.inventory.CookingRecipe<?>) recipe.map(CampfireCookingRecipe::toBukkitRecipe).orElse(null)); // Paper + BlockCookEvent blockCookEvent = new BlockCookEvent(CraftBlock.at(world, pos), source, result, (org.bukkit.inventory.CookingRecipe<?>) recipe.map(CampfireCookingRecipe::toBukkitRecipe).orElse(null)); // Paper
world.getCraftServer().getPluginManager().callEvent(blockCookEvent); world.getCraftServer().getPluginManager().callEvent(blockCookEvent);
if (blockCookEvent.isCancelled()) { if (blockCookEvent.isCancelled()) {

View File

@ -9,9 +9,9 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
--- a/src/main/java/net/minecraft/server/players/PlayerList.java --- a/src/main/java/net/minecraft/server/players/PlayerList.java
+++ b/src/main/java/net/minecraft/server/players/PlayerList.java +++ b/src/main/java/net/minecraft/server/players/PlayerList.java
@@ -0,0 +0,0 @@ public abstract class PlayerList { @@ -0,0 +0,0 @@ public abstract class PlayerList {
public final PlayerDataStorage playerIo;
private boolean doWhiteList; private boolean doWhiteList;
private final RegistryAccess.Frozen registryHolder; private final LayeredRegistryAccess<RegistryLayer> registries;
private final RegistryAccess.Frozen synchronizedRegistries;
- protected final int maxPlayers; - protected final int maxPlayers;
+ protected int maxPlayers; public final void setMaxPlayers(int maxPlayers) { this.maxPlayers = maxPlayers; } // Paper - remove final and add setter + protected int maxPlayers; public final void setMaxPlayers(int maxPlayers) { this.maxPlayers = maxPlayers; } // Paper - remove final and add setter
private int viewDistance; private int viewDistance;

View File

@ -11,9 +11,9 @@ diff --git a/src/main/java/net/minecraft/world/entity/ai/gossip/GossipContainer.
index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644 index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644
--- a/src/main/java/net/minecraft/world/entity/ai/gossip/GossipContainer.java --- a/src/main/java/net/minecraft/world/entity/ai/gossip/GossipContainer.java
+++ b/src/main/java/net/minecraft/world/entity/ai/gossip/GossipContainer.java +++ b/src/main/java/net/minecraft/world/entity/ai/gossip/GossipContainer.java
@@ -0,0 +0,0 @@ import net.minecraft.util.VisibleForDebug; @@ -0,0 +0,0 @@ import org.slf4j.Logger;
public class GossipContainer { public class GossipContainer {
private static final Logger LOGGER = LogUtils.getLogger();
public static final int DISCARD_THRESHOLD = 2; public static final int DISCARD_THRESHOLD = 2;
- private final Map<UUID, GossipContainer.EntityGossips> gossips = Maps.newHashMap(); - private final Map<UUID, GossipContainer.EntityGossips> gossips = Maps.newHashMap();
+ private final Map<UUID, GossipContainer.EntityGossips> gossips = Maps.newHashMap(); public Map<UUID, GossipContainer.EntityGossips> getReputations() { return this.gossips; } // Paper - add getter for reputations + private final Map<UUID, GossipContainer.EntityGossips> gossips = Maps.newHashMap(); public Map<UUID, GossipContainer.EntityGossips> getReputations() { return this.gossips; } // Paper - add getter for reputations
@ -63,7 +63,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
+ // Paper end + // Paper end
} }
static class GossipEntry { static record GossipEntry(UUID target, GossipType type, int value) {
diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftVillager.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftVillager.java diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftVillager.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftVillager.java
index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644 index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644
--- a/src/main/java/org/bukkit/craftbukkit/entity/CraftVillager.java --- a/src/main/java/org/bukkit/craftbukkit/entity/CraftVillager.java
@ -84,7 +84,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
public CraftVillager(CraftServer server, net.minecraft.world.entity.npc.Villager entity) { public CraftVillager(CraftServer server, net.minecraft.world.entity.npc.Villager entity) {
@@ -0,0 +0,0 @@ public class CraftVillager extends CraftAbstractVillager implements Villager { @@ -0,0 +0,0 @@ public class CraftVillager extends CraftAbstractVillager implements Villager {
public static VillagerProfession bukkitToNmsProfession(Profession bukkit) { public static VillagerProfession bukkitToNmsProfession(Profession bukkit) {
return Registry.VILLAGER_PROFESSION.get(CraftNamespacedKey.toMinecraft(bukkit.getKey())); return BuiltInRegistries.VILLAGER_PROFESSION.get(CraftNamespacedKey.toMinecraft(bukkit.getKey()));
} }
+ +
+ // Paper start - Add villager reputation API + // Paper start - Add villager reputation API

View File

@ -19,12 +19,12 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
+ } + }
+ public CompletableFuture<Void> reloadResources(Collection<String> dataPacks, io.papermc.paper.event.server.ServerResourcesReloadedEvent.Cause cause) { + public CompletableFuture<Void> reloadResources(Collection<String> dataPacks, io.papermc.paper.event.server.ServerResourcesReloadedEvent.Cause cause) {
+ // Paper end + // Paper end
RegistryAccess.Frozen iregistrycustom_dimension = this.registryAccess(); RegistryAccess.Frozen iregistrycustom_dimension = this.registries.getAccessForLoading(RegistryLayer.RELOADABLE);
CompletableFuture<Void> completablefuture = CompletableFuture.supplyAsync(() -> { CompletableFuture<Void> completablefuture = CompletableFuture.supplyAsync(() -> {
Stream<String> stream = dataPacks.stream(); // CraftBukkit - decompile error Stream<String> stream = dataPacks.stream(); // CraftBukkit - decompile error
@@ -0,0 +0,0 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa @@ -0,0 +0,0 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
this.packRepository.setSelected(dataPacks);
this.worldData.setDataPackConfig(MinecraftServer.getSelectedPacks(this.packRepository)); this.worldData.setDataConfiguration(worlddataconfiguration);
this.resources.managers.updateRegistryTags(this.registryAccess()); this.resources.managers.updateRegistryTags(this.registryAccess());
+ new io.papermc.paper.event.server.ServerResourcesReloadedEvent(cause).callEvent(); // Paper + new io.papermc.paper.event.server.ServerResourcesReloadedEvent(cause).callEvent(); // Paper
// Paper start // Paper start

View File

@ -146,14 +146,12 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
+ final @Nullable ServerPlayer player; + final @Nullable ServerPlayer player;
+ final @Nullable CommandSourceStack commandSourceStack; + final @Nullable CommandSourceStack commandSourceStack;
+ final Component originalMessage; + final Component originalMessage;
+ final boolean isPreview;
+ +
+ public ChatDecorationProcessor(final MinecraftServer server, final @Nullable ServerPlayer player, final @Nullable CommandSourceStack commandSourceStack, final net.minecraft.network.chat.Component originalMessage, final boolean isPreview) { + public ChatDecorationProcessor(final MinecraftServer server, final @Nullable ServerPlayer player, final @Nullable CommandSourceStack commandSourceStack, final net.minecraft.network.chat.Component originalMessage) {
+ this.server = server; + this.server = server;
+ this.player = player; + this.player = player;
+ this.commandSourceStack = commandSourceStack; + this.commandSourceStack = commandSourceStack;
+ this.originalMessage = PaperAdventure.asAdventure(originalMessage); + this.originalMessage = PaperAdventure.asAdventure(originalMessage);
+ this.isPreview = isPreview;
+ } + }
+ +
+ public CompletableFuture<ChatDecorator.Result> process() { + public CompletableFuture<ChatDecorator.Result> process() {
@ -190,11 +188,12 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
+ +
+ final Component initialResult = input.message().component(); + final Component initialResult = input.message().component();
+ final AsyncChatDecorateEvent event; + final AsyncChatDecorateEvent event;
+ //TODO
+ if (this.commandSourceStack != null) { + if (this.commandSourceStack != null) {
+ // TODO more command decorate context + // TODO more command decorate context
+ event = new AsyncChatCommandDecorateEvent(true, player, this.originalMessage, this.isPreview, initialResult); + event = new AsyncChatCommandDecorateEvent(true, player, this.originalMessage, false, initialResult);
+ } else { + } else {
+ event = new AsyncChatDecorateEvent(true, player, this.originalMessage, this.isPreview, initialResult); + event = new AsyncChatDecorateEvent(true, player, this.originalMessage, false, initialResult);
+ } + }
+ this.post(event); + this.post(event);
+ if (!event.isCancelled() && !event.result().equals(initialResult)) { + if (!event.isCancelled() && !event.result().equals(initialResult)) {
@ -1902,8 +1901,8 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
- }, chatExecutor); - }, chatExecutor);
- }; - };
+ // Paper start - moved to ChatPreviewProcessor + // Paper start - moved to ChatPreviewProcessor
+ return ChatDecorator.create((sender, commandSourceStack, message, isPreview) -> { + return ChatDecorator.create((sender, commandSourceStack, message) -> {
+ final io.papermc.paper.adventure.ChatDecorationProcessor processor = new io.papermc.paper.adventure.ChatDecorationProcessor(this, sender, commandSourceStack, message, isPreview); + final io.papermc.paper.adventure.ChatDecorationProcessor processor = new io.papermc.paper.adventure.ChatDecorationProcessor(this, sender, commandSourceStack, message);
+ return processor.process(); + return processor.process();
+ }); + });
+ // Paper end + // Paper end

View File

@ -9,11 +9,11 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
--- a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java --- a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
+++ b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java +++ b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
@@ -0,0 +0,0 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Tic @@ -0,0 +0,0 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Tic
int i = this.player.level.getMaxBuildHeight(); int i = this.player.level.getMaxBuildHeight();
if (blockposition.getY() < i) { if (blockposition.getY() < i) {
- if (this.awaitingPositionFromClient == null && this.player.distanceToSqr((double) blockposition.getX() + 0.5D, (double) blockposition.getY() + 0.5D, (double) blockposition.getZ() + 0.5D) < 64.0D && worldserver.mayInteract(this.player, blockposition)) { - if (this.awaitingPositionFromClient == null && this.player.distanceToSqr((double) blockposition.getX() + 0.5D, (double) blockposition.getY() + 0.5D, (double) blockposition.getZ() + 0.5D) < 64.0D && worldserver.mayInteract(this.player, blockposition)) {
+ if (this.awaitingPositionFromClient == null && this.player.distanceToSqr((double) blockposition.getX() + 0.5D, (double) blockposition.getY() + 0.5D, (double) blockposition.getZ() + 0.5D) < 64.0D && (worldserver.mayInteract(this.player, blockposition) || (worldserver.paperConfig().spawn.allowUsingSignsInsideSpawnProtection && worldserver.getBlockState(blockposition).getBlock() instanceof net.minecraft.world.level.block.SignBlock))) { // Paper - sign check + if (this.awaitingPositionFromClient == null && this.player.distanceToSqr((double) blockposition.getX() + 0.5D, (double) blockposition.getY() + 0.5D, (double) blockposition.getZ() + 0.5D) < 64.0D && (worldserver.mayInteract(this.player, blockposition) || (worldserver.paperConfig().spawn.allowUsingSignsInsideSpawnProtection && worldserver.getBlockState(blockposition).getBlock() instanceof net.minecraft.world.level.block.SignBlock))) { // Paper - sign check
this.player.stopUsingItem(); // CraftBukkit - SPIGOT-4706 this.player.stopUsingItem(); // CraftBukkit - SPIGOT-4706
InteractionResult enuminteractionresult = this.player.gameMode.useItemOn(this.player, worldserver, itemstack, enumhand, movingobjectpositionblock); InteractionResult enuminteractionresult = this.player.gameMode.useItemOn(this.player, worldserver, itemstack, enumhand, movingobjectpositionblock);

View File

@ -8,7 +8,7 @@ diff --git a/src/main/java/net/minecraft/world/level/block/entity/BeaconBlockEnt
index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644 index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644
--- a/src/main/java/net/minecraft/world/level/block/entity/BeaconBlockEntity.java --- a/src/main/java/net/minecraft/world/level/block/entity/BeaconBlockEntity.java
+++ b/src/main/java/net/minecraft/world/level/block/entity/BeaconBlockEntity.java +++ b/src/main/java/net/minecraft/world/level/block/entity/BeaconBlockEntity.java
@@ -0,0 +0,0 @@ public class BeaconBlockEntity extends BlockEntity implements MenuProvider { @@ -0,0 +0,0 @@ public class BeaconBlockEntity extends BlockEntity implements MenuProvider, Name
return (BeaconBlockEntity.hasSecondaryEffect(this.levels, this.primaryPower, this.secondaryPower)) ? CraftPotionUtil.toBukkit(new MobEffectInstance(this.secondaryPower, BeaconBlockEntity.getLevel(this.levels), BeaconBlockEntity.getAmplification(this.levels, this.primaryPower, this.secondaryPower), true, true)) : null; return (BeaconBlockEntity.hasSecondaryEffect(this.levels, this.primaryPower, this.secondaryPower)) ? CraftPotionUtil.toBukkit(new MobEffectInstance(this.secondaryPower, BeaconBlockEntity.getLevel(this.levels), BeaconBlockEntity.getAmplification(this.levels, this.primaryPower, this.secondaryPower), true, true)) : null;
} }
// CraftBukkit end // CraftBukkit end
@ -35,7 +35,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
public BeaconBlockEntity(BlockPos pos, BlockState state) { public BeaconBlockEntity(BlockPos pos, BlockState state) {
super(BlockEntityType.BEACON, pos, state); super(BlockEntityType.BEACON, pos, state);
@@ -0,0 +0,0 @@ public class BeaconBlockEntity extends BlockEntity implements MenuProvider { @@ -0,0 +0,0 @@ public class BeaconBlockEntity extends BlockEntity implements MenuProvider, Name
} }
if (blockEntity.levels > 0 && !blockEntity.beamSections.isEmpty()) { if (blockEntity.levels > 0 && !blockEntity.beamSections.isEmpty()) {
@ -44,7 +44,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
BeaconBlockEntity.playSound(world, pos, SoundEvents.BEACON_AMBIENT); BeaconBlockEntity.playSound(world, pos, SoundEvents.BEACON_AMBIENT);
} }
} }
@@ -0,0 +0,0 @@ public class BeaconBlockEntity extends BlockEntity implements MenuProvider { @@ -0,0 +0,0 @@ public class BeaconBlockEntity extends BlockEntity implements MenuProvider, Name
} }
public static List getHumansInRange(Level world, BlockPos blockposition, int i) { public static List getHumansInRange(Level world, BlockPos blockposition, int i) {
@ -59,7 +59,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
AABB axisalignedbb = (new AABB(blockposition)).inflate(d0).expandTowards(0.0D, (double) world.getHeight(), 0.0D); AABB axisalignedbb = (new AABB(blockposition)).inflate(d0).expandTowards(0.0D, (double) world.getHeight(), 0.0D);
List<Player> list = world.getEntitiesOfClass(Player.class, axisalignedbb); List<Player> list = world.getEntitiesOfClass(Player.class, axisalignedbb);
@@ -0,0 +0,0 @@ public class BeaconBlockEntity extends BlockEntity implements MenuProvider { @@ -0,0 +0,0 @@ public class BeaconBlockEntity extends BlockEntity implements MenuProvider, Name
} }
private static void applyEffects(Level world, BlockPos pos, int beaconLevel, @Nullable MobEffect primaryEffect, @Nullable MobEffect secondaryEffect) { private static void applyEffects(Level world, BlockPos pos, int beaconLevel, @Nullable MobEffect primaryEffect, @Nullable MobEffect secondaryEffect) {
@ -78,7 +78,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
BeaconBlockEntity.applyEffect(list, primaryEffect, j, b0, true, pos); // Paper - BeaconEffectEvent BeaconBlockEntity.applyEffect(list, primaryEffect, j, b0, true, pos); // Paper - BeaconEffectEvent
@@ -0,0 +0,0 @@ public class BeaconBlockEntity extends BlockEntity implements MenuProvider { @@ -0,0 +0,0 @@ public class BeaconBlockEntity extends BlockEntity implements MenuProvider, Name
} }
this.lockKey = LockCode.fromTag(nbt); this.lockKey = LockCode.fromTag(nbt);
@ -86,7 +86,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
} }
@Override @Override
@@ -0,0 +0,0 @@ public class BeaconBlockEntity extends BlockEntity implements MenuProvider { @@ -0,0 +0,0 @@ public class BeaconBlockEntity extends BlockEntity implements MenuProvider, Name
} }
this.lockKey.addToTag(nbt); this.lockKey.addToTag(nbt);

View File

@ -16,7 +16,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
+ +
public ServerGamePacketListenerImpl(MinecraftServer server, Connection connection, ServerPlayer player) { public ServerGamePacketListenerImpl(MinecraftServer server, Connection connection, ServerPlayer player) {
this.lastChatTimeStamp = new AtomicReference(Instant.EPOCH); this.lastChatTimeStamp = new AtomicReference(Instant.EPOCH);
this.lastSeenMessagesValidator = new LastSeenMessagesValidator(); this.lastSeenMessages = new LastSeenMessagesValidator(20);
@@ -0,0 +0,0 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Tic @@ -0,0 +0,0 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Tic
private static final ResourceLocation CUSTOM_REGISTER = new ResourceLocation("register"); private static final ResourceLocation CUSTOM_REGISTER = new ResourceLocation("register");
private static final ResourceLocation CUSTOM_UNREGISTER = new ResourceLocation("unregister"); private static final ResourceLocation CUSTOM_UNREGISTER = new ResourceLocation("unregister");

Some files were not shown because too many files have changed in this diff Show More