mirror of
https://github.com/PurpurMC/Purpur.git
synced 2026-02-19 09:27:43 +01:00
add back pufferfish patches
This commit is contained in:
@@ -1,52 +0,0 @@
|
||||
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 fe207cd67517de05b0da84d55c4218357f0274dc..7ddc9a7ff7b1d6de234ea5b1c8f4246d6ba7976d 100644
|
||||
--- a/src/main/java/net/minecraft/server/level/ServerPlayerGameMode.java
|
||||
+++ b/src/main/java/net/minecraft/server/level/ServerPlayerGameMode.java
|
||||
@@ -429,7 +429,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 b51155ad12515b2d0dd0f202580b9f455c114d9a..dd6c82a418ee299d7a5614cb0260949c198b4149 100644
|
||||
--- a/src/main/java/net/minecraft/world/level/block/ShulkerBoxBlock.java
|
||||
+++ b/src/main/java/net/minecraft/world/level/block/ShulkerBoxBlock.java
|
||||
@@ -137,7 +137,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 3965a9f456d7815a4f375bc5792f888a38c149ef..e508637fabd5b8688230f6e6aed82480f5c513e9 100644
|
||||
--- a/src/main/java/org/purpurmc/purpur/PurpurWorldConfig.java
|
||||
+++ b/src/main/java/org/purpurmc/purpur/PurpurWorldConfig.java
|
||||
@@ -678,6 +678,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);
|
||||
Reference in New Issue
Block a user