/* SevTech: Ages Block Harvest Drops Event Script This script allows us to change the drops from a block using the drops mapping. We can add as many drops as we want and define the amount of said drops to "drop". Note: These scripts are created and for the usage in SevTech: Ages and other modpacks curated by DarkPacks. You can use these scripts for reference and for learning but not for copying and pasting and claiming as your own. */ import crafttweaker.block.IBlock; import crafttweaker.event.BlockHarvestDropsEvent; import crafttweaker.event.IBlockEvent; import crafttweaker.events.IEventManager; import crafttweaker.item.IItemStack; import crafttweaker.item.WeightedItemStack; /* Block Drops Mapping This needs to be a string name of the block to change the drop for. MUST include the meta at the end if needed. Then you can fill the array with the IItemStacks you want to drop. */ static blockHarvestDrops as WeightedItemStack[][string] = { "galacticraftplanets:asteroids_block:4": [ .weight(1.0), .weight(1.0) ], "twilightforest:castle_door:0": [ .weight(1.0) ], "twilightforest:castle_door:1": [ .weight(1.0) ], "twilightforest:castle_door:2": [ .weight(1.0) ], "twilightforest:castle_door:3": [ .weight(1.0) ], // Primal Stones (When broken should drop the cobble not the stone) "primal:blue_stone" : [ .weight(1.0) ], "primal:common_stone": [ .weight(1.0) ], "primal:sarsen_stone": [ .weight(1.0) ], "primal:scoria_stone": [ .weight(1.0) ], "primal:porphyry_stone": [ .weight(1.0) ], "primal:purpurite_stone": [ .weight(1.0) ], "primal:ferro_stone": [ .weight(1.0) ], "primal:carbonate_stone": [ .weight(1.0) ], "primal:terracotta_block": [ .weight(1.0) ], "primal:mud_dried": [ .weight(1.0) ], "primal:nether_earth": [ .weight(1.0) ], "primal:nether_stone": [ .weight(1.0) ], "primal:eroded_end_stone": [ .weight(1.0) ], "primal:desiccated_stone": [ .weight(1.0) ], "primal:soul_stone": [ .weight(1.0) ], "primal:night_stone": [ .weight(1.0) ], "primal:ciniscotta_block": [ .weight(1.0) ], "primal:ortho_stone": [ .weight(1.0) ], "primal:schist_green_stone": [ .weight(1.0) ], "primal:schist_blue_stone": [ .weight(1.0) ] }; /* Add event listener */ function init() { events.onBlockHarvestDrops(function (event as BlockHarvestDropsEvent) { var blockId = event.block.definition.id; if (event.block.meta != 0) { blockId += ":" ~ event.block.meta; } // Skip overrides if the block is silk touched if (event.silkTouch) { return; } var hasOverride = !isNull(blockHarvestDrops[blockId]); if (hasOverride) { for i, block in blockHarvestDrops[blockId] { if (i == 0) { event.drops = [block]; } else { event.drops += block; } } } }); }