# Created by Djimusic # http://youtube.com/Djimusic # Submit bugs at http://djimusic.com/bug-report # Version: 1.0 # Private edited version - taswin from pymclevel import TAG_List from pymclevel import TAG_Byte from pymclevel import TAG_Int from pymclevel import TAG_Compound from pymclevel import TAG_Short from pymclevel import TAG_Double from pymclevel import TAG_String from pymclevel import TileEntity import math import random displayName = "Chunk Loaders" inputs = ( ("Allows Hopper Chunkloaders to be placed in the map", "label"), ("Y Value for Chunk Loaders",(5,2,255)), ("Towards Positive X - East", True), ("Towards Positive Z - South", True), ("Towards Negative X - West", True), ("Towards Negative Z - North", True) ) def CreateHopper(chunk,level,x,y,z,dam): level.setBlockAt(x, y, z, 154) level.setBlockDataAt(x, y, z, dam) newHopper = TileEntity.Create("Hopper") newHopper["Items"] = TAG_List() Items = newHopper["Items"] item = TAG_Compound() item["id"] = TAG_String("minecraft:skull") item["Damage"] = TAG_Short(3) item["Count"] = TAG_Byte(1) item["Slot"] = TAG_Byte(2) item["tag"] = TAG_Compound() item["tag"]["SkullOwner"] = TAG_String("taswin") item["tag"]["display"] = TAG_Compound() item["tag"]["display"]["Name"] = TAG_String("taswin's Head - Chunk Loader") item["tag"]["display"]["Lore"] = TAG_List() l1 = TAG_String("Do not remove from the hopper.") l2 = TAG_String("This item keeps the chunk loaders working.") item["tag"]["display"]["Lore"].append(l1) item["tag"]["display"]["Lore"].append(l2) newHopper["Items"].append(item) TileEntity.setpos(newHopper,(x,y,z)) chunk.TileEntities.append(newHopper) chunk.dirty = True def Error(Mes): raise Exception(Mes) def perform(level, box, options): PlaceY = options["Y Value for Chunk Loaders"] n = options["Towards Negative Z - North"] e = options["Towards Positive X - East"] s = options["Towards Positive Z - South"] w = options["Towards Negative X - West"] minx = int(box.minx/16)*16 minz = int(box.minz/16)*16 for x in xrange(minx, box.maxx, 16): for z in xrange(minz, box.maxz, 16): chunk = level.getChunk(x / 16, z / 16) for (chunk, slices, point) in level.getChunkSlices(box): (cx,cz) = chunk.chunkPosition ChunkX = cx * 16 ChunkZ = cz * 16 if (ChunkX,PlaceY,ChunkZ) in box: if n: CreateHopper(chunk,level,ChunkX,PlaceY,ChunkZ,2) if e: CreateHopper(chunk,level,ChunkX+15,PlaceY,ChunkZ,5) if s: CreateHopper(chunk,level,ChunkX,PlaceY,ChunkZ+15,3) if w: CreateHopper(chunk,level,ChunkX+15,PlaceY,ChunkZ+15,4)
Run
Reset
Share
Import
Link
Embed
Language▼
English
中文
Python Fiddle
Python Cloud IDE
Follow @python_fiddle
Browser Version Not Supported
Due to Python Fiddle's reliance on advanced JavaScript techniques, older browsers might have problems running it correctly. Please download the latest version of your favourite browser.
Chrome 10+
Firefox 4+
Safari 5+
IE 10+
Let me try anyway!
url:
Go
Python Snippet
Stackoverflow Question