Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #Name: events.zs
- #Author: Keaft
- import crafttweaker.events.IEventManager;
- import crafttweaker.command.ICommandManager;
- import crafttweaker.event.IEventCancelable;
- import crafttweaker.item.IItemStack;
- import crafttweaker.block.IBlock;
- print("Initializing 'events'...");
- function merge(array1 as string[], array2 as string[]) as string[]{
- for stringitem in array1 {
- array2 += stringitem;
- }
- return array2;
- }
- var droptorches as string[] = [
- "minecraft:torch",
- "atum:palm_torch",
- "atum:deadwood_torch",
- "atum:limestone_torch",
- "atum:bone_torch",
- "atum:pharaoh_torch",
- "inspirations:torch_lever",
- "aether_legacy:ambrosium_torch",
- "thebetweenlands:sulfur_torch",
- "tconstruct:stone_torch",
- "torchmaster:mega_torch",
- // "torchmaster:mega_torch:1",
- "torchmaster:terrain_lighter"
- ];
- // Just cancel the event as this uses unique circumstances of placing light sources. Supremium axe for instance.
- var canceltorches as string[] = [
- "mysticalagriculture:miners_torch"
- ];
- var alltorches as string[] = merge(droptorches, canceltorches);
- events.onBlockPlace(function(weaklightbeneath as crafttweaker.event.BlockPlaceEvent){
- print(weaklightbeneath.block.definition.id);
- if (weaklightbeneath.player.dimension == 66){
- for itemCheck in alltorches {
- if(weaklightbeneath.block.definition.id == itemCheck){
- weaklightbeneath.player.sendStatusMessage("The atmosphere extinguishes the flame.");
- weaklightbeneath.player.dropItem(true);
- weaklightbeneath.cancel();
- }
- }
- }
- });
- // var playercheck = weaklightbeneath.player;
- // var itemcheck = weaklightbeneath.block;
- // print(playercheck.name as string);
- // print(playercheck.dimension as string);
- // print(itemcheck.definition.displayName as string);
- // playercheck.dropItem(true);
- // weaklightbeneath.cancel();
- // playercheck.dropItem(<minecraft:torch>);
- print("Initialized 'events'");
Advertisement
Add Comment
Please, Sign In to add comment