mirror of
https://github.com/PurpurMC/Purpur.git
synced 2026-02-17 08:27:43 +01:00
option to disable shulker box items from dropping contents when destroyed
This commit is contained in:
committed by
granny
parent
19a65e8dcf
commit
137ef963b1
@@ -8,3 +8,11 @@
|
||||
return customData.loadInto(blockEntity, level.registryAccess());
|
||||
}
|
||||
|
||||
@@ -264,6 +_,7 @@
|
||||
public void onDestroyed(ItemEntity itemEntity) {
|
||||
ItemContainerContents itemContainerContents = itemEntity.getItem().set(DataComponents.CONTAINER, ItemContainerContents.EMPTY);
|
||||
if (itemContainerContents != null) {
|
||||
+ if (itemEntity.level().purpurConfig.shulkerBoxItemDropContentsWhenDestroyed && this.getBlock() instanceof ShulkerBoxBlock) // Purpur - option to disable shulker box items from dropping contents when destroyed
|
||||
ItemUtils.onContainerDestroyed(itemEntity, itemContainerContents.nonEmptyItemsCopy());
|
||||
}
|
||||
}
|
||||
|
||||
@@ -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 -> {
|
||||
@@ -260,6 +261,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;
|
||||
|
||||
Reference in New Issue
Block a user