Advertisement
Kopasz7

Inverse replace

Oct 30th, 2012
179
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.62 KB | None | 0 0
  1. from pymclevel import MCSchematic
  2. from pymclevel import TileEntity
  3. from pymclevel import TAG_Compound
  4. from pymclevel import TAG_Short
  5. from pymclevel import TAG_Byte
  6. from pymclevel import TAG_String
  7. import random
  8.  
  9. displayName = "Inverse Replace"
  10.  
  11. inputs = (
  12.     ("Fill with", "blocktype"),
  13.     ("Leave", "blocktype"),
  14. )
  15.  
  16. def perform(level, box, options):
  17.     mat1 = options["Fill with"]
  18.     mat2 = options["Leave"]
  19.     for (chunk, slices, point) in level.getChunkSlices(box):
  20.         blocks = chunk.Blocks[slices]
  21.         blocks[blocks != mat2.ID] = mat1.ID
  22.         chunk.chunkChanged()
  23. def randomGen():
  24.     return int(random.random() * 99) + 1
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement