Decided to post my filter from another thread here so it doesn't get lost in the endless abyss that is the MCForum.
I created 3 very useful command block filters that allow you to manipulate command block commands.
Command Block Search and Replace
Allows you to search and replace text in command block commands. Very useful for changing entity types or adding new NBT data with the summon or setblock commands.
Command Block Exporter and Importer
Two extremely powerful filters that are very easy to use. Simply select the blocks you want and type in a file name that will save to the MCEdit folder. You can also specify a specific directory to save to. All of the commands will be exported to an external text file which can be manipulated and then imported back using the import filter. The creativity is up to you!
I am looking to groom a 1.6.2 server but I want to keep all of the user generated structures and such. There are far to many of them to find them all with MCedit due to the server size of 40 people. This tool does exactly what I want to do: https://code.google....-chunk-deleter/ (searches for specific block types in the chunks and keeps those chunks) but it is out of date and doesn't currently function with the new save format. Can anyone either create an MCedit filter script that does the exact same thing, or point me in the direction of something that already exists? Again this is for 1.6.2 and the hope is to prepare the server for 1.7.2.
I could make this,but I don´t know , how to seperate the Selcetion in its chunk and colpete it into chunks.If someone can tell me,I will make it.
I have a Question:
########## Fast data access ##########
from pymclevel import ChunkNotPresent
GlobalChunkCache = {}
GlobalLevel = None
def getChunk(x, z):
global GlobalChunkCache
global GlobalLevel
chunkCoords = (x>>4, z>>4)
if chunkCoords not in GlobalChunkCache:
try:
GlobalChunkCache[chunkCoords] = GlobalLevel.getChunk(x>>4, z>>4)
except ChunkNotPresent:
return None
return GlobalChunkCache[chunkCoords]
def blockAt(x, y, z):
chunk = getChunk(x, z)
if chunk == None:
return 0
return chunk.Blocks[x%16][z%16][y]
def dataAt(x, y, z):
chunk = getChunk(x, z)
if chunk == None:
return 0
return chunk.Data[x%16][z%16][y]
def tileEntityAt(x, y, z):
chunk = getChunk(x, z)
if chunk == None:
return 0
return chunk.tileEntityAt(x, y, z)
########## End fast data access ##########
What does this and
global GlobalLevel
GlobalLevel = level
in many MCEdit FIlters do adn how to use Chunk and global commands.If someone can tell me about this,it would be very nice.
So... the global keyword makes a variable global. Variables in fuctions are local, which means if you have the same variable in two functions (e.g. radius) and you set that viariable to 5 in the first function, and to 10 to the other and then print them (by calling the function), the first will print 5 and the second will print 10. Enough of that though, let's get to the global keyword. Code example:
def randomFunction():
global radius
radius = 10
print 10
def printFunction():
global radius #I don't think this line is needed, just to make sure though I put it.
print radius
#run the first function to set the the radius to 10
randomFunction()
#and then run the other one and check the results
printFunction()
#this prints 10
(This next sentence might confuse you) Think of it like this: global stores variables in the cloud, like cloud storage. Then, you call the variables' values with the global keyword. I hope you get it. If you don't, go to this page to see more.
########## Fast data access ##########
from pymclevel import ChunkNotPresent
GlobalChunkCache = {}
GlobalLevel = None
def getChunk(x, z):
global GlobalChunkCache
global GlobalLevel
chunkCoords = (x>>4, z>>4)
if chunkCoords not in GlobalChunkCache:
try:
GlobalChunkCache[chunkCoords] = GlobalLevel.getChunk(x>>4, z>>4)
except ChunkNotPresent:
return None
return GlobalChunkCache[chunkCoords]
def blockAt(x, y, z):
chunk = getChunk(x, z)
if chunk == None:
return 0
return chunk.Blocks[x%16][z%16][y]
def dataAt(x, y, z):
chunk = getChunk(x, z)
if chunk == None:
return 0
return chunk.Data[x%16][z%16][y]
def tileEntityAt(x, y, z):
chunk = getChunk(x, z)
if chunk == None:
return 0
return chunk.tileEntityAt(x, y, z)
########## End fast data access ##########
and chunk commands.
Hmmm.... cutting the selection to chunks seems difficult to me... You could always do it with a for loop (idk how though), but that will be slow... And all those chunk stuff basically do, from what I can tell, the same thing as level.blockAt(x, y, z) would do, for example.. (I am not sure about this though).
I don´t know how to recreate chunks with a filter,but you could just use MCEdit´s Repop-function to repop chunks you want to repop.I´m sorry,but I will take a look at pymclevel,if I can make it.
It doesn't necessarily have to interact with the chunks. Really what I'm looking for is the ability to scan the world for selected block types and create a safe zone around them, then regenerate the rest. I would normally do it manually, but there are too many users to get all the locations by hand. Does this make it any easier?
Quick suggestion/idea to T_Horger. I looked up in the pymclevel files to find a way to make a "safe zone", as Omega_Ultima suggested, around the chunks that you won't want to be deleted and found that you could perhaps export temporarily the chunks you want to be saved to a schematic (a temp one), delete the rest ones and then reimport them back in (this will probably eat a lot of memory though). Just an idea.
Quick suggestion/idea to T_Horger. I looked up in the pymclevel files to find a way to make a "safe zone", as Omega_Ultima suggested, around the chunks that you won't want to be deleted and found that you could perhaps export temporarily the chunks you want to be saved to a schematic (a temp one), delete the rest ones and then reimport them back in (this will probably eat a lot of memory though). Just an idea.
Well, I don't really have to explain anything since everything you need is in filter demo (just realized this). Another way of doing this is would be to get the coords of two corner blocks, then bind them to variables and "tell" MCEdit to remove everything else except for that.
Well, I don't really have to explain anything since everything you need is in filter demo (just realized this). Another way of doing this is would be to get the coords of two corner blocks, then bind them to variables and "tell" MCEdit to remove everything else except for that.
My only question would be, do I have to know which chunks (manually locate each players property) or is there a feature to scan for particular block ID's that can locate them all for me?
My only question would be, do I have to know which chunks (manually locate each players property) or is there a feature to scan for particular block ID's that can locate them all for me?
You can locate certain Block IDs with the use of a for loop (most common way), but the block(s) must be inside the selection box.
Yeah guys I am kind of stuck for some reason for about a week now. I can't find what's the problem, but I am sure it's a stupid one which I can't see for some reason. Anyways, here is the code, check it out and if you find anything, let me know
# Filter by Lazini
# You can modify, reuse or distribute this filter.
# If you do so, make sure to give credit to Lazini
displayName = "Pyramid Maker"
inputs = (
("Method", ("Square Pyramid", "Cover Whole Bottom")),
)
def perform(level, box, options):
width = box.maxx - box.minx
depth = box.maxz - box.minz
cWidth = width/2
cDepth = depth/2
method = options["Method"]
if method == "Square Pyramid":
for x in xrange(cWidth, cWidth+5):
for y in xrange(box.miny, box.maxy):
for z in xrange(cDepth, cDepth+5):
level.setBlockAt(x,y,z,10) # This does not work for some reason, it returns None if you print it... Any help?
I created 3 very useful command block filters that allow you to manipulate command block commands.
Command Block Search and Replace
Allows you to search and replace text in command block commands. Very useful for changing entity types or adding new NBT data with the summon or setblock commands.
Command Block Exporter and Importer
Two extremely powerful filters that are very easy to use. Simply select the blocks you want and type in a file name that will save to the MCEdit folder. You can also specify a specific directory to save to. All of the commands will be exported to an external text file which can be manipulated and then imported back using the import filter. The creativity is up to you!
Download Here - CommandBlockFilters.zip
(Thanks to SethBling for his movecommandblockcoords filter.)
MCEdit: Minecraft World Editor
MCEdit: Minecraft World Editor
Hmmm.... cutting the selection to chunks seems difficult to me... You could always do it with a for loop (idk how though), but that will be slow... And all those chunk stuff basically do, from what I can tell, the same thing as level.blockAt(x, y, z) would do, for example.. (I am not sure about this though).
MCEdit: Minecraft World Editor
Plz
- Buggi -
My Humble YouTube Channel
https://www.youtube.com/c/FlexibleGames
Featuring in-depth and technical gameplay with games like Minecraft, Factorio, and others.
Here's an ore filter by jsa: http://www.mediafire.com/download/3pa9o3e8r9xkg2s/ore_gen.py
Does anyone have the filter where it gives options for each ore?
- Buggi -
My Humble YouTube Channel
https://www.youtube.com/c/FlexibleGames
Featuring in-depth and technical gameplay with games like Minecraft, Factorio, and others.
Did you get enough information to try and make this?
It doesn't necessarily have to interact with the chunks. Really what I'm looking for is the ability to scan the world for selected block types and create a safe zone around them, then regenerate the rest. I would normally do it manually, but there are too many users to get all the locations by hand. Does this make it any easier?
MCEdit: Minecraft World Editor
This. I want this. Show me the way oh great one.
MCEdit: Minecraft World Editor
My only question would be, do I have to know which chunks (manually locate each players property) or is there a feature to scan for particular block ID's that can locate them all for me?
MCEdit: Minecraft World Editor
MCEdit: Minecraft World Editor
http://dragcave.net/image/T6TgI.gif
MCEdit: Minecraft World Editor
MCEdit: Minecraft World Editor