mirror of
https://github.com/PurpurMC/Purpur.git
synced 2026-02-17 08:27:43 +01:00
Upstream has released updates that appear to apply and compile correctly Paper Changes: PaperMC/Paper@4d111a3 Un-experimentalize Entity TP APIs (#9964) PaperMC/Paper@2182d47 Update mapping-io (#9975) PaperMC/Paper@9993eb9 Updates documentation in EntityEquipment.java (#9992) PaperMC/Paper@2184fbc Log correct recipes and advancement count on server start (#9978) PaperMC/Paper@8bda1f7 Remove unnecessary durability check in ItemStack#isSimilar (#9979) PaperMC/Paper@977a729 [ci skip] Correct Windows requiring path to gradlew (#9976) PaperMC/Paper@3766afa [ci skip] Add mention of FQ imports (#9994) PaperMC/Paper@40872ec Fix CraftMetaItem#addAttributeModifier duplication check (#9995) PaperMC/Paper@ffa4115 Configurable Dry and Wet Farmland Tick Rates (#9968) PaperMC/Paper@37bee09 Restore vanilla entity drops behavior (#7650) PaperMC/Paper@5cbd535 Fix Mushroom cow stew api (#9934) PaperMC/Paper@8e061ce Add Structure check API (#9062) PaperMC/Paper@9271ee7 Dont resend blocks on interactions (#9413) PaperMC/Paper@931781c [ci skip] rebuild patches
53 lines
3.4 KiB
Diff
53 lines
3.4 KiB
Diff
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
|
From: William Blake Galbreath <Blake.Galbreath@GMail.com>
|
|
Date: Thu, 27 May 2021 04:04:23 -0500
|
|
Subject: [PATCH] ShulkerBox allow oversized stacks
|
|
|
|
This fixes PaperMC/Paper#4748 where breaking a shulkerbox in survival mode
|
|
with oversized itemstacks would cause a "chunk ban". This fixes it by always
|
|
creating an itemstack using the TileEntity's NBT data (how it handles it for
|
|
creative players) instead of routing it through the LootableBuilder.
|
|
|
|
diff --git a/src/main/java/net/minecraft/server/level/ServerPlayerGameMode.java b/src/main/java/net/minecraft/server/level/ServerPlayerGameMode.java
|
|
index ea28ac7cc590aea0e3ac778e597d807412708756..dce9f57806052337c9256d45e95b4b84a88bf852 100644
|
|
--- a/src/main/java/net/minecraft/server/level/ServerPlayerGameMode.java
|
|
+++ b/src/main/java/net/minecraft/server/level/ServerPlayerGameMode.java
|
|
@@ -428,7 +428,7 @@ public class ServerPlayerGameMode {
|
|
|
|
ItemStack mainHandStack = null; // Paper
|
|
boolean isCorrectTool = false; // Paper
|
|
- if (this.isCreative()) {
|
|
+ if (this.isCreative() || (this.level.purpurConfig.shulkerBoxAllowOversizedStacks && block instanceof net.minecraft.world.level.block.ShulkerBoxBlock)) { // Purpur
|
|
// return true; // CraftBukkit
|
|
} else {
|
|
ItemStack itemstack = this.player.getMainHandItem();
|
|
diff --git a/src/main/java/net/minecraft/world/level/block/ShulkerBoxBlock.java b/src/main/java/net/minecraft/world/level/block/ShulkerBoxBlock.java
|
|
index d5fe3b8e2f5a8899f6afeb0600764284a617f261..2b513fc2f6c33963e43093cb08594bff946d72fa 100644
|
|
--- a/src/main/java/net/minecraft/world/level/block/ShulkerBoxBlock.java
|
|
+++ b/src/main/java/net/minecraft/world/level/block/ShulkerBoxBlock.java
|
|
@@ -135,7 +135,7 @@ public class ShulkerBoxBlock extends BaseEntityBlock {
|
|
public void playerWillDestroy(Level world, BlockPos pos, BlockState state, Player player) {
|
|
BlockEntity blockEntity = world.getBlockEntity(pos);
|
|
if (blockEntity instanceof ShulkerBoxBlockEntity shulkerBoxBlockEntity) {
|
|
- if (!world.isClientSide && player.isCreative() && !shulkerBoxBlockEntity.isEmpty()) {
|
|
+ if (world.purpurConfig.shulkerBoxAllowOversizedStacks || (!world.isClientSide && player.isCreative() && !shulkerBoxBlockEntity.isEmpty())) { // Purpur
|
|
ItemStack itemStack = getColoredItemStack(this.getColor());
|
|
blockEntity.saveToItem(itemStack);
|
|
if (shulkerBoxBlockEntity.hasCustomName()) {
|
|
diff --git a/src/main/java/org/purpurmc/purpur/PurpurWorldConfig.java b/src/main/java/org/purpurmc/purpur/PurpurWorldConfig.java
|
|
index e50d8cb072acd403c285fee9a0df80e4d5946846..49416c3d1c8a8d3cb3882ea9394898ff4eb73118 100644
|
|
--- a/src/main/java/org/purpurmc/purpur/PurpurWorldConfig.java
|
|
+++ b/src/main/java/org/purpurmc/purpur/PurpurWorldConfig.java
|
|
@@ -657,6 +657,11 @@ public class PurpurWorldConfig {
|
|
}
|
|
}
|
|
|
|
+ public boolean shulkerBoxAllowOversizedStacks = false;
|
|
+ private void shulkerBoxSettings() {
|
|
+ shulkerBoxAllowOversizedStacks = getBoolean("blocks.shulker_box.allow-oversized-stacks", shulkerBoxAllowOversizedStacks);
|
|
+ }
|
|
+
|
|
public boolean slabHalfBreak = false;
|
|
private void slabSettings() {
|
|
slabHalfBreak = getBoolean("blocks.slab.break-individual-slabs-when-sneaking", slabHalfBreak);
|