Advertisement
Purple_

Untitled

Nov 4th, 2014
3,002
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PyCon 1.76 KB | None | 0 0
  1. # Filter made by Purple_
  2. # http://www.youtube.com/ThatPurplePlant
  3.  
  4. from pymclevel import TAG_List
  5. from pymclevel import TAG_Byte
  6. from pymclevel import TAG_Int
  7. from pymclevel import TAG_Compound
  8. from pymclevel import TAG_Short
  9. from pymclevel import TAG_Double
  10. from pymclevel import TAG_Float
  11. from pymclevel import TAG_String
  12. from pymclevel import TAG_Long
  13. from pymclevel import TAG_Int_Array
  14. from numpy import zeros
  15.  
  16. # piano: air (0), Grass (2), Dirt (3), Leaves (18), sponge (19), wool (35)
  17. # double bass: wooden planks (5), wood (17), note block (25), bookshelf (47)
  18. # bass drum: stone (1), cobblestone (4), adminium (7), gold ore (14), iron ore (15), coal ore (16) lapis ore (21), lapis block (22), sandstone (24), moss stone (48), obsidian (49), redstone ore (73), netherrack (87), glowstone block (89)
  19. # snare drum: sand (12), gravel (13), clay block (82), soul sand (88)
  20. # click: glass (20)
  21.  
  22. displayName = "Note Blocks to Command Blocks"
  23.  
  24. inputs = (
  25.     ("Filter by Purple_","label"),
  26.     ("youtube.com/ThatPurplePlant","label"),
  27.     ("Selector", ("string", "value=@a[]")),
  28.     ("Volume",(1,1,100000000)),
  29.     ("Volume is the amount of blocks the sound will be heard from the given player. Increasing the value will increase the heard distance by 16 blocks.","label"),
  30. )
  31.  
  32. def perform(level, box, options):
  33.     for x in range(box.minx, box.maxx):
  34.         for y in range(box.miny, box.maxy):
  35.             for z in range(box.minz, box.maxz):
  36.                 if level.blockAt(x, y, z) == 25:
  37.                     ConvertNoteBlocksToCommandBlocks(level, x, y, z)
  38.                
  39. def ConvertNoteBlocksToCommandBlocks(level, x, y, z):
  40.     BlockIdUnder = level.blockAt(x, y-1, z)
  41.    
  42.     level.setBlockAt(x, y, z, 137)
  43.     control = TAG_Compound()
  44.    
  45.     chunk = level.getChunk(x / 16, z / 16)
  46.     chunk.TileEntities.append(control)
  47.     chunk.dirty = True
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement