Skip to content

Commit

Permalink
FEAT: exclude some devices from bulk recycling (#622)
Browse files Browse the repository at this point in the history
  • Loading branch information
Yarden-zamir authored Nov 22, 2024
2 parents 267a244 + 90fc154 commit 1e84ce7
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
2 changes: 1 addition & 1 deletion kubejs/server_scripts/base/features/bulkrecycle-command.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ function compactItems(player,keepOne){
player.inventory.allItems.toArray().forEach(
/** @param {Internal.ItemStack} i */
i=>{
if(i.hasTag("forge:devices")){
if(i.hasTag("forge:devices") && !i.hasTag("ptdye:recycle_excluded") && !i.hasNBT()){
let [_,type,fraction] = i.getTags()
.toList()
.filter((tag) => tag.location().path.startsWith("devices/"))[0]
Expand Down
2 changes: 2 additions & 0 deletions kubejs/server_scripts/base/features/devices.js
Original file line number Diff line number Diff line change
Expand Up @@ -490,6 +490,7 @@ if (true) {

deviceDefinitions.forEach((device) => {
if(!device.enable) return;

addToTag("forge:generics/devices", device.generic);
addToTag(`forge:generics/${device.tag.split(":")[1]}`, device.generic);
let generic_id = Item.of(device.generic).id; //support both ids and kjs items
Expand Down Expand Up @@ -546,6 +547,7 @@ if (true) {
true
); //let players transmute any device but don't show in craftables panel

if(device.recycleExcluded) addToTag("ptdye:recycle_excluded")
addToTag(device.tag + tagSuffix, item.id);
addStonecutting(included_device, device.generic);
});
Expand Down

0 comments on commit 1e84ce7

Please sign in to comment.