Skip to content

Commit 74c2d06

Browse files
committed
exclude devices from bulk recycling
it can exclude based on the tag "ptdye:recycle_excluded" and categorically refuses to recycle items with nbt, so that blocks with items inside like drawers cannot have their contents annihilated.
1 parent 658b817 commit 74c2d06

File tree

2 files changed

+3
-1
lines changed

2 files changed

+3
-1
lines changed

kubejs/server_scripts/base/features/bulkrecycle-command.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ function compactItems(player,keepOne){
1010
player.inventory.allItems.toArray().forEach(
1111
/** @param {Internal.ItemStack} i */
1212
i=>{
13-
if(i.hasTag("forge:devices")){
13+
if(i.hasTag("forge:devices") && !i.hasTag("ptdye:recycle_excluded") && !i.hasNBT()){
1414
let [_,type,fraction] = i.getTags()
1515
.toList()
1616
.filter((tag) => tag.location().path.startsWith("devices/"))[0]

kubejs/server_scripts/base/features/devices.js

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -486,6 +486,7 @@ if (true) {
486486

487487
deviceDefinitions.forEach((device) => {
488488
if(!device.enable) return;
489+
489490
addToTag("forge:generics/devices", device.generic);
490491
addToTag(`forge:generics/${device.tag.split(":")[1]}`, device.generic);
491492
let generic_id = Item.of(device.generic).id; //support both ids and kjs items
@@ -542,6 +543,7 @@ if (true) {
542543
true
543544
); //let players transmute any device but don't show in craftables panel
544545

546+
if(device.recycleExcluded) addToTag("ptdye:recycle_excluded")
545547
addToTag(device.tag + tagSuffix, item.id);
546548
addStonecutting(included_device, device.generic);
547549
});

0 commit comments

Comments
 (0)