1
0
Fork 0
mirror of https://github.com/PaperMC/Paper.git synced 2025-03-26 00:27:08 +01:00

More more more work

This commit is contained in:
Nassim Jahnke 2024-12-03 19:54:10 +01:00
parent 3af13e34fb
commit 39c2c1d5f7
252 changed files with 177 additions and 194 deletions
patches/server
API-for-creating-command-sender-which-forwards-feedb.patchAdd-API-for-item-entity-health.patchAdd-API-for-resetting-a-single-score.patchAdd-Adventure-message-to-PlayerAdvancementDoneEvent.patchAdd-BellRevealRaiderEvent.patchAdd-Block-isValidTool.patchAdd-BlockBreakBlockEvent.patchAdd-BlockFailedDispenseEvent.patchAdd-BlockPreDispenseEvent.patchAdd-Channel-initialization-listeners.patchAdd-DragonEggFormEvent.patchAdd-ElderGuardianAppearanceEvent.patchAdd-EntityBlockStorage-clearEntities.patchAdd-EntityDamageItemEvent.patchAdd-EntityDyeEvent-and-CollarColorable-interface.patchAdd-EntityInsideBlockEvent.patchAdd-EntityLoadCrossbowEvent.patchAdd-EntityMoveEvent.patchAdd-GameEvent-tags.patchAdd-HiddenPotionEffect-API.patchAdd-ItemFactory-getSpawnEgg-API.patchAdd-Mob-lookAt-API.patchAdd-PlayerArmSwingEvent.patchAdd-PlayerBedFailEnterEvent.patchAdd-PlayerChangeBeaconEffectEvent.patchAdd-PlayerDeepSleepEvent.patchAdd-PlayerFlowerPotManipulateEvent.patchAdd-PlayerItemFrameChangeEvent.patchAdd-PlayerKickEvent-causes.patchAdd-PlayerLecternPageChangeEvent.patchAdd-PlayerLoomPatternSelectEvent.patchAdd-PlayerNameEntityEvent.patchAdd-PlayerSetSpawnEvent.patchAdd-PlayerStonecutterRecipeSelectEvent.patchAdd-PlayerStopUsingItemEvent.patchAdd-PufferFishStateChangeEvent.patchAdd-Raw-Byte-Entity-Serialization.patchAdd-RegistryAccess-for-managing-Registries.patchAdd-ServerResourcesReloadedEvent.patchAdd-StructuresLocateEvent.patchAdd-System.out-err-catcher.patchAdd-TameableDeathMessageEvent.patchAdd-Unix-domain-socket-support.patchAdd-WorldGameRuleChangeEvent.patchAdd-a-should-burn-in-sunlight-API-for-Phantoms-and-S.patchAdd-back-EntityPortalExitEvent.patchAdd-basic-Datapack-API.patchAdd-bypass-host-check.patchAdd-cause-to-Weather-ThunderChangeEvents.patchAdd-config-option-for-worlds-affected-by-time-cmd.patchAdd-configurable-height-for-slime-spawn.patchAdd-critical-damage-API.patchAdd-environment-variable-to-disable-server-gui.patchAdd-fast-alternative-constructor-for-Rotations.patchAdd-getMainThreadExecutor-to-BukkitScheduler.patchAdd-hasCollision-methods-to-various-places.patchAdd-methods-to-find-targets-for-lightning-strikes.patchAdd-missing-IAE-check-for-PersistentDataContainer-ha.patchAdd-missing-InventoryType.patchAdd-missing-Validate-calls-to-CraftServer-getSpawnLi.patchAdd-missing-block-data-API.patchAdd-missing-forceDrop-toggles.patchAdd-missing-structure-set-seed-configs.patchAdd-missing-team-sidebar-display-slots.patchAdd-more-Campfire-API.patchAdd-more-LimitedRegion-API.patchAdd-more-WanderingTrader-API.patchAdd-more-advancement-API.patchAdd-option-to-fix-items-merging-through-walls.patchAdd-packet-limiter-config.patchAdd-paper-mobcaps-and-paper-playermobcaps.patchAdd-recipe-to-cook-events.patchAdd-root-admin-user-detection.patchAdd-sendOpLevel-API.patchAdd-support-for-Proxy-Protocol.patchAdd-toggle-for-always-placing-the-dragon-egg.patchAdd-world-settings-for-mobs-picking-up-loot.patchAdd-worldborder-events.patchAllow-adding-items-to-BlockDropItemEvent.patchAllow-changing-the-EnderDragon-podium.patchAllow-disabling-mob-spawner-spawn-egg-transformation.patchAllow-skipping-writing-of-comments-to-server.propert.patchAllow-using-signs-inside-spawn-protection.patchBucketable-API.patchBuffer-OOB-setBlock-calls.patchCache-resource-keys-and-optimize-reference-Holder-ta.patchChange-EnderEye-target-without-changing-other-things.patchCheck-requirement-before-suggesting-root-nodes.patchCollision-option-for-requiring-a-player-participant.patchConfig-option-for-Piglins-guarding-chests.patchConfigurable-door-breaking-difficulty.patchConfigurable-feature-seeds.patchConfigurable-item-frame-map-cursor-update-interval.patchConfigurable-max-block-light-for-monster-spawning.patchConfigurable-max-leash-distance.patchConfigurable-sculk-sensor-listener-range.patchCorrectly-check-if-bucket-dispenses-will-succeed-for.patchCustom-Potion-Mixes.patchDo-not-run-close-logic-for-inventories-on-chunk-unlo.patchDon-t-allow-digging-into-unloaded-chunks.patch

View file

@ -262,10 +262,10 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
@@ -0,0 +0,0 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl
public void handleMoveVehicle(ServerboundMoveVehiclePacket packet) {
PacketUtils.ensureRunningOnSameThread(packet, this, this.player.serverLevel());
if (ServerGamePacketListenerImpl.containsInvalidValues(packet.getX(), packet.getY(), packet.getZ(), packet.getYRot(), packet.getXRot())) {
if (ServerGamePacketListenerImpl.containsInvalidValues(packet.position().x(), packet.position().y(), packet.position().z(), packet.yRot(), packet.xRot())) {
- this.disconnect((Component) Component.translatable("multiplayer.disconnect.invalid_vehicle_movement"));
+ this.disconnect((Component) Component.translatable("multiplayer.disconnect.invalid_vehicle_movement"), org.bukkit.event.player.PlayerKickEvent.Cause.INVALID_VEHICLE_MOVEMENT); // Paper - kick event cause
} else if (!this.updateAwaitingTeleport()) {
} else if (!this.updateAwaitingTeleport() && this.player.hasClientLoaded()) {
Entity entity = this.player.getRootVehicle();
@@ -0,0 +0,0 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl
@ -287,15 +287,6 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
}
// CraftBukkit end
@@ -0,0 +0,0 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl
// Paper start - validate pick item position
if (!(packet.getSlot() >= 0 && packet.getSlot() < this.player.getInventory().items.size())) {
ServerGamePacketListenerImpl.LOGGER.warn("{} tried to set an invalid carried item", this.player.getName().getString());
- this.disconnect(Component.literal("Invalid hotbar selection (Hacking?)"));
+ this.disconnect(Component.literal("Invalid hotbar selection (Hacking?)"), org.bukkit.event.player.PlayerKickEvent.Cause.ILLEGAL_ACTION); // Paper - kick event cause
return;
}
this.player.getInventory().pickSlot(packet.getSlot()); // Paper - Diff above if changed
@@ -0,0 +0,0 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl
if (byteTotal > byteAllowed) {
ServerGamePacketListenerImpl.LOGGER.warn("{} tried to send a book too large. Book size: {} - Allowed: {} - Pages: {}", this.player.getScoreboardName(), byteTotal, byteAllowed, pageList.size());
@ -322,14 +313,14 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
ServerLevel worldserver = this.player.serverLevel();
@@ -0,0 +0,0 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl
this.dropCount++;
if (this.dropCount >= 20) {
ServerGamePacketListenerImpl.LOGGER.warn(this.player.getScoreboardName() + " dropped their items too quickly!");
- this.disconnect(Component.literal("You dropped your items too quickly (Hacking?)"));
+ this.disconnect(Component.literal("You dropped your items too quickly (Hacking?)"), org.bukkit.event.player.PlayerKickEvent.Cause.ILLEGAL_ACTION); // Paper - kick event cause
return;
this.dropCount++;
if (this.dropCount >= 20) {
ServerGamePacketListenerImpl.LOGGER.warn(this.player.getScoreboardName() + " dropped their items too quickly!");
- this.disconnect(Component.literal("You dropped your items too quickly (Hacking?)"));
+ this.disconnect(Component.literal("You dropped your items too quickly (Hacking?)"), org.bukkit.event.player.PlayerKickEvent.Cause.ILLEGAL_ACTION); // Paper - kick event cause
return;
}
}
}
@@ -0,0 +0,0 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl
this.player.resetLastActionTime();
} else {
@ -385,23 +376,23 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
}
@@ -0,0 +0,0 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl
// Spigot Start
if ( entity == this.player && !this.player.isSpectator() )
{
- this.disconnect( Component.literal( "Cannot interact with self!" ) );
+ this.disconnect( Component.literal( "Cannot interact with self!" ), org.bukkit.event.player.PlayerKickEvent.Cause.SELF_INTERACTION ); // Paper - kick event cause
return;
}
// Spigot End
// Spigot Start
if ( entity == this.player && !this.player.isSpectator() )
{
- this.disconnect( Component.literal( "Cannot interact with self!" ) );
+ this.disconnect( Component.literal( "Cannot interact with self!" ), org.bukkit.event.player.PlayerKickEvent.Cause.SELF_INTERACTION ); // Paper - kick event cause
return;
}
// Spigot End
@@ -0,0 +0,0 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl
}
}
}
- ServerGamePacketListenerImpl.this.disconnect((Component) Component.translatable("multiplayer.disconnect.invalid_entity_attacked"));
+ ServerGamePacketListenerImpl.this.disconnect((Component) Component.translatable("multiplayer.disconnect.invalid_entity_attacked"), org.bukkit.event.player.PlayerKickEvent.Cause.INVALID_ENTITY_ATTACKED); // Paper - add cause
ServerGamePacketListenerImpl.LOGGER.warn("Player {} tried to attack an invalid entity", ServerGamePacketListenerImpl.this.player.getName().getString());
}
});
- ServerGamePacketListenerImpl.this.disconnect((Component) Component.translatable("multiplayer.disconnect.invalid_entity_attacked"));
+ ServerGamePacketListenerImpl.this.disconnect((Component) Component.translatable("multiplayer.disconnect.invalid_entity_attacked"), org.bukkit.event.player.PlayerKickEvent.Cause.INVALID_ENTITY_ATTACKED); // Paper - add cause
ServerGamePacketListenerImpl.LOGGER.warn("Player {} tried to attack an invalid entity", ServerGamePacketListenerImpl.this.player.getName().getString());
}
});
@@ -0,0 +0,0 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl
// Paper start - auto recipe limit
if (!org.bukkit.Bukkit.isPrimaryThread()) {

View file

@ -10,7 +10,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
+++ b/src/main/java/net/minecraft/world/item/NameTagItem.java
@@ -0,0 +0,0 @@ public class NameTagItem extends Item {
Component component = stack.get(DataComponents.CUSTOM_NAME);
if (component != null && entity.getType().canSerialize()) {
if (component != null && entity.getType().canSerialize() && entity.canBeNameTagged()) {
if (!user.level().isClientSide && entity.isAlive()) {
- entity.setCustomName(component);
- if (entity instanceof Mob mob) {

View file

@ -0,0 +1,57 @@
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: Jake Potrebic <jake.m.potrebic@gmail.com>
Date: Fri, 27 Nov 2020 17:14:27 -0800
Subject: [PATCH] Add PlayerStonecutterRecipeSelectEvent
Co-Authored-By: MiniDigger | Martin <admin@minidigger.dev>
diff --git a/src/main/java/net/minecraft/world/inventory/StonecutterMenu.java b/src/main/java/net/minecraft/world/inventory/StonecutterMenu.java
index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644
--- a/src/main/java/net/minecraft/world/inventory/StonecutterMenu.java
+++ b/src/main/java/net/minecraft/world/inventory/StonecutterMenu.java
@@ -0,0 +0,0 @@ public class StonecutterMenu extends AbstractContainerMenu {
public StonecutterMenu(int syncId, Inventory playerInventory, final ContainerLevelAccess context) {
super(MenuType.STONECUTTER, syncId);
- this.selectedRecipeIndex = DataSlot.standalone();
+ this.selectedRecipeIndex = DataSlot.shared(new int[1], 0); // Paper - Add PlayerStonecutterRecipeSelectEvent
this.recipesForInput = SelectableRecipe.SingleInputSet.empty();
this.input = ItemStack.EMPTY;
this.slotUpdateListener = () -> {
@@ -0,0 +0,0 @@ public class StonecutterMenu extends AbstractContainerMenu {
return false;
} else {
if (this.isValidRecipeIndex(id)) {
- this.selectedRecipeIndex.set(id);
- this.setupResultSlot(id);
+ // Paper start - Add PlayerStonecutterRecipeSelectEvent
+ int recipeIndex = id;
+ this.selectedRecipeIndex.set(recipeIndex);
+ this.selectedRecipeIndex.checkAndClearUpdateFlag(); // mark as changed
+ paperEventBlock: if (this.isValidRecipeIndex(id)) {
+ final Optional<RecipeHolder<StonecutterRecipe>> recipe = this.recipesForInput.entries().get(id).recipe().recipe();
+ if (recipe.isEmpty()) break paperEventBlock; // The recipe selected does not have an actual server recipe (presumably its the empty one). Cannot call the event, just break.
+
+ io.papermc.paper.event.player.PlayerStonecutterRecipeSelectEvent event = new io.papermc.paper.event.player.PlayerStonecutterRecipeSelectEvent((Player) player.getBukkitEntity(), getBukkitView().getTopInventory(), (org.bukkit.inventory.StonecuttingRecipe) recipe.get().toBukkitRecipe());
+ if (!event.callEvent()) {
+ player.containerMenu.sendAllDataToRemote();
+ return false;
+ }
+
+ net.minecraft.resources.ResourceLocation key = org.bukkit.craftbukkit.util.CraftNamespacedKey.toMinecraft(event.getStonecuttingRecipe().getKey());
+ if (!recipe.get().id().location().equals(key)) { // If the recipe did NOT stay the same
+ for (int newRecipeIndex = 0; newRecipeIndex < this.recipesForInput.entries().size(); newRecipeIndex++) {
+ if (this.recipesForInput.entries().get(newRecipeIndex).recipe().recipe().filter(r -> r.id().location().equals(key)).isPresent()) {
+ recipeIndex = newRecipeIndex;
+ break;
+ }
+ }
+ }
+ }
+ player.containerMenu.sendAllDataToRemote();
+ this.selectedRecipeIndex.set(recipeIndex); // set new index, so that listeners can read it
+ this.setupResultSlot(recipeIndex);
+ // Paper end - Add PlayerStonecutterRecipeSelectEvent
}
return true;

View file

@ -782,8 +782,8 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
WritableRegistry<T> writableRegistry = new MappedRegistry<>(type.registryKey(), Lifecycle.experimental());
+ io.papermc.paper.registry.PaperRegistryAccess.instance().registerReloadableRegistry(type.registryKey(), writableRegistry); // Paper - register reloadable registry
Map<ResourceLocation, T> map = new HashMap<>();
String string = Registries.elementsDirPath(type.registryKey());
SimpleJsonResourceReloadListener.scanDirectory(resourceManager, string, ops, type.codec(), map);
SimpleJsonResourceReloadListener.scanDirectory(resourceManager, type.registryKey(), ops, type.codec(), map);
map.forEach((id, value) -> writableRegistry.register(ResourceKey.create(type.registryKey(), id), (T)value, DEFAULT_REGISTRATION_INFO));
diff --git a/src/main/java/org/bukkit/craftbukkit/CraftRegistry.java b/src/main/java/org/bukkit/craftbukkit/CraftRegistry.java
index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644
--- a/src/main/java/org/bukkit/craftbukkit/CraftRegistry.java

View file

@ -42,27 +42,6 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
// org.bukkit.craftbukkit.block.data.CraftLightable
diff --git a/src/main/java/org/bukkit/craftbukkit/block/impl/CraftCherryLeaves.java b/src/main/java/org/bukkit/craftbukkit/block/impl/CraftCherryLeaves.java
index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644
--- a/src/main/java/org/bukkit/craftbukkit/block/impl/CraftCherryLeaves.java
+++ b/src/main/java/org/bukkit/craftbukkit/block/impl/CraftCherryLeaves.java
@@ -0,0 +0,0 @@ public final class CraftCherryLeaves extends org.bukkit.craftbukkit.block.data.C
public void setWaterlogged(boolean waterlogged) {
this.set(CraftCherryLeaves.WATERLOGGED, waterlogged);
}
+
+ // Paper start
+ @Override
+ public int getMaximumDistance() {
+ return getMax(DISTANCE);
+ }
+
+ @Override
+ public int getMinimumDistance() {
+ return getMin(DISTANCE);
+ }
+ // Paper end
}
diff --git a/src/main/java/org/bukkit/craftbukkit/block/impl/CraftComposter.java b/src/main/java/org/bukkit/craftbukkit/block/impl/CraftComposter.java
index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644
--- a/src/main/java/org/bukkit/craftbukkit/block/impl/CraftComposter.java
@ -192,6 +171,27 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
+ public int getMaximumDistance() {
+ return getMax(CraftMangroveLeaves.DISTANCE);
+ }
+ // Paper end
}
diff --git a/src/main/java/org/bukkit/craftbukkit/block/impl/CraftParticleLeaves.java b/src/main/java/org/bukkit/craftbukkit/block/impl/CraftParticleLeaves.java
index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644
--- a/src/main/java/org/bukkit/craftbukkit/block/impl/CraftParticleLeaves.java
+++ b/src/main/java/org/bukkit/craftbukkit/block/impl/CraftParticleLeaves.java
@@ -0,0 +0,0 @@ public final class CraftParticleLeaves extends org.bukkit.craftbukkit.block.data
public void setWaterlogged(boolean waterlogged) {
this.set(CraftParticleLeaves.WATERLOGGED, waterlogged);
}
+
+ // Paper start
+ @Override
+ public int getMaximumDistance() {
+ return getMax(DISTANCE);
+ }
+
+ @Override
+ public int getMinimumDistance() {
+ return getMin(DISTANCE);
+ }
+ // Paper end
}
diff --git a/src/main/java/org/bukkit/craftbukkit/block/impl/CraftPinkPetals.java b/src/main/java/org/bukkit/craftbukkit/block/impl/CraftPinkPetals.java

View file

@ -30,7 +30,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
- if (structureplacement.isStructureChunk(placementCalculator, chunkcoordintpair.x, chunkcoordintpair.z)) {
+ if (structureplacement.isStructureChunk(placementCalculator, chunkcoordintpair.x, chunkcoordintpair.z, structureplacement instanceof net.minecraft.world.level.chunk.ChunkGeneratorStructureState.KeyedRandomSpreadStructurePlacement keyed ? keyed.key : null)) { // Paper - Add missing structure set seed configs
if (list.size() == 1) {
this.tryGenerateStructure((StructureSet.StructureSelectionEntry) list.get(0), structureAccessor, registryManager, randomstate, structureTemplateManager, placementCalculator.getLevelSeed(), chunk, chunkcoordintpair, sectionposition);
this.tryGenerateStructure((StructureSet.StructureSelectionEntry) list.get(0), structureAccessor, registryManager, randomstate, structureTemplateManager, placementCalculator.getLevelSeed(), chunk, chunkcoordintpair, sectionposition, dimension);
} else {
diff --git a/src/main/java/net/minecraft/world/level/chunk/ChunkGeneratorStructureState.java b/src/main/java/net/minecraft/world/level/chunk/ChunkGeneratorStructureState.java
index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644

View file

@ -14,7 +14,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
alsoShade(log4jPlugins.output)
+ implementation("io.netty:netty-codec-haproxy:4.1.97.Final") // Paper - Add support for proxy protocol
// Paper end
implementation("org.apache.logging.log4j:log4j-iostreams:2.22.1") // Paper - remove exclusion
implementation("org.apache.logging.log4j:log4j-iostreams:2.24.1") // Paper - remove exclusion
implementation("org.ow2.asm:asm-commons:9.7.1")
diff --git a/src/main/java/net/minecraft/server/network/ServerConnectionListener.java b/src/main/java/net/minecraft/server/network/ServerConnectionListener.java
index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644

View file

@ -16,4 +16,4 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
+
Spawner spawner = (Spawner) tileentity;
entitytypes = this.getType(itemstack);
entitytypes = this.getType(world.registryAccess(), itemstack);

View file

@ -9,11 +9,11 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
--- a/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 extends ServerCommonPacketListenerImpl
int i = this.player.level().getMaxY();
int i = this.player.level().getMaxY();
if (blockposition.getY() <= i) {
- if (this.awaitingPositionFromClient == null && worldserver.mayInteract(this.player, blockposition)) {
if (blockposition.getY() <= i) {
- if (this.awaitingPositionFromClient == null && worldserver.mayInteract(this.player, blockposition)) {
+ if (this.awaitingPositionFromClient == null && (worldserver.mayInteract(this.player, blockposition) || (worldserver.paperConfig().spawn.allowUsingSignsInsideSpawnProtection && worldserver.getBlockState(blockposition).getBlock() instanceof net.minecraft.world.level.block.SignBlock))) { // Paper - Allow using signs inside spawn protection
this.player.stopUsingItem(); // CraftBukkit - SPIGOT-4706
InteractionResult enuminteractionresult = this.player.gameMode.useItemOn(this.player, worldserver, itemstack, enumhand, movingobjectpositionblock);
this.player.stopUsingItem(); // CraftBukkit - SPIGOT-4706
InteractionResult enuminteractionresult = this.player.gameMode.useItemOn(this.player, worldserver, itemstack, enumhand, movingobjectpositionblock);

View file

@ -27,6 +27,6 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
if (this.isInSittingPose()) {
- if (distance > 10.0F) {
+ if (distance > (float) this.level().paperConfig().misc.maxLeashDistance.or(Leashable.LEASH_TOO_FAR_DIST)) { // Paper - Configurable max leash distance
this.dropLeash(true, true);
this.dropLeash();
}

View file

@ -162,8 +162,8 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
+ public static boolean mayPlaceItem(ItemStack stack, PotionBrewing potionBrewing) { // Paper - custom potion mixes
+ return stack.is(Items.POTION) || stack.is(Items.SPLASH_POTION) || stack.is(Items.LINGERING_POTION) || stack.is(Items.GLASS_BOTTLE) || potionBrewing.isCustomInput(stack); // Paper - Custom Potion Mixes
}
}
@Override
diff --git a/src/main/java/net/minecraft/world/item/alchemy/PotionBrewing.java b/src/main/java/net/minecraft/world/item/alchemy/PotionBrewing.java
index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644
--- a/src/main/java/net/minecraft/world/item/alchemy/PotionBrewing.java

View file

@ -66,12 +66,12 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
case START_DESTROY_BLOCK:
case ABORT_DESTROY_BLOCK:
case STOP_DESTROY_BLOCK:
+ // Paper start - Don't allow digging into unloaded chunks
+ if (this.player.level().getChunkIfLoadedImmediately(blockposition.getX() >> 4, blockposition.getZ() >> 4) == null) {
+ this.player.connection.ackBlockChangesUpTo(packet.getSequence());
+ return;
+ }
+ // Paper end - Don't allow digging into unloaded chunks
+ // Paper start - Don't allow digging into unloaded chunks
+ if (this.player.level().getChunkIfLoadedImmediately(blockposition.getX() >> 4, blockposition.getZ() >> 4) == null) {
+ this.player.connection.ackBlockChangesUpTo(packet.getSequence());
+ return;
+ }
+ // Paper end - Don't allow digging into unloaded chunks
this.player.gameMode.handleBlockBreakAction(blockposition, packetplayinblockdig_enumplayerdigtype, packet.getDirection(), this.player.level().getMaxY(), packet.getSequence());
this.player.connection.ackBlockChangesUpTo(packet.getSequence());
return;

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