mirror of
https://github.com/PurpurMC/Purpur.git
synced 2026-02-17 16:37:43 +01:00
Upstream has released updates that appear to apply and compile correctly Paper Changes: PaperMC/Paper@26734e8 Updated Upstream (Bukkit/CraftBukkit/Spigot) (#7454) PaperMC/Paper@4a745f9 Optimize Util#sequence (#7115) PaperMC/Paper@2c8d48c Make Panda implement Sittable (#7414) PaperMC/Paper@2c4a589 Fix issues with LimitedRegion (#7343) PaperMC/Paper@3d91eca Fix cancelled snow bucket placement (#6751) PaperMC/Paper@9567753 Don't load plugins prefixed with a dot (#7392) PaperMC/Paper@92c777d Fix PlayerProfile BukkitObject serialization, deprecate setName and setId for removal (#7471) PaperMC/Paper@e6898ff Fix IllegalArgumentException for /paper mobcaps command (#7472) PaperMC/Paper@a8f2d67 - properly fix IllegalArgumentException in `/paper mobcaps` command Pufferfish Changes: pufferfish-gg/Pufferfish@22f20b2 Fix sentry bug
41 lines
2.5 KiB
Diff
41 lines
2.5 KiB
Diff
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
|
From: William Blake Galbreath <blake.galbreath@gmail.com>
|
|
Date: Mon, 5 Jul 2021 20:23:08 -0500
|
|
Subject: [PATCH] option to disable shulker box items from dropping contents
|
|
when destroyed
|
|
|
|
|
|
diff --git a/src/main/java/net/minecraft/world/item/BlockItem.java b/src/main/java/net/minecraft/world/item/BlockItem.java
|
|
index 8f3b9b8784f0d7b137a1ad87655ee8bad801b59d..8a5f6d955577a8f8a63a846169a63fe9685b6321 100644
|
|
--- a/src/main/java/net/minecraft/world/item/BlockItem.java
|
|
+++ b/src/main/java/net/minecraft/world/item/BlockItem.java
|
|
@@ -294,7 +294,7 @@ public class BlockItem extends Item {
|
|
|
|
@Override
|
|
public void onDestroyed(ItemEntity entity) {
|
|
- if (this.block instanceof ShulkerBoxBlock) {
|
|
+ if (this.block instanceof ShulkerBoxBlock && entity.level.purpurConfig.shulkerBoxItemDropContentsWhenDestroyed) {
|
|
ItemStack itemstack = entity.getItem();
|
|
CompoundTag nbttagcompound = BlockItem.getBlockEntityData(itemstack);
|
|
|
|
diff --git a/src/main/java/org/purpurmc/purpur/PurpurWorldConfig.java b/src/main/java/org/purpurmc/purpur/PurpurWorldConfig.java
|
|
index 719612684b4d5f72589576bb69c2d6c908bdc485..0b14878546df0217fa83eabfc26f6ede84f8ebb2 100644
|
|
--- a/src/main/java/org/purpurmc/purpur/PurpurWorldConfig.java
|
|
+++ b/src/main/java/org/purpurmc/purpur/PurpurWorldConfig.java
|
|
@@ -213,6 +213,7 @@ public class PurpurWorldConfig {
|
|
public int enderPearlCooldownCreative = 20;
|
|
public float enderPearlEndermiteChance = 0.05F;
|
|
public int glowBerriesEatGlowDuration = 0;
|
|
+ public boolean shulkerBoxItemDropContentsWhenDestroyed = true;
|
|
private void itemSettings() {
|
|
itemImmuneToCactus.clear();
|
|
getList("gameplay-mechanics.item.immune.cactus", new ArrayList<>()).forEach(key -> {
|
|
@@ -257,6 +258,7 @@ public class PurpurWorldConfig {
|
|
enderPearlCooldownCreative = getInt("gameplay-mechanics.item.ender-pearl.creative-cooldown", enderPearlCooldownCreative);
|
|
enderPearlEndermiteChance = (float) getDouble("gameplay-mechanics.item.ender-pearl.endermite-spawn-chance", enderPearlEndermiteChance);
|
|
glowBerriesEatGlowDuration = getInt("gameplay-mechanics.item.glow_berries.eat-glow-duration", glowBerriesEatGlowDuration);
|
|
+ shulkerBoxItemDropContentsWhenDestroyed = getBoolean("gameplay-mechanics.item.shulker_box.drop-contents-when-destroyed", shulkerBoxItemDropContentsWhenDestroyed);
|
|
}
|
|
|
|
public double minecartMaxSpeed = 0.4D;
|