In this thread, we'll share and discuss filter scripts we've written for MCEdit's Filter tool.
For users:
Filter scripts are a way of adding functionality to MCEdit. To install a script, select the Filter tool and click the blue word "Filter" to open the filters folder. Place the script (a ".py" file) in this folder, then cancel and reselect the Filter tool.
For example: select everything in the CODE block further down, paste it into Notepad, save the file as "treegen.py", and place it in the filters folder. Reselect the tool, then look for the new "Treegen" option in the Filter: menu.
For coders:
A filter script has one function, 'perform', which is given access to the current level and selection. A filter can also provide an "inputs" array, telling MCEdit what kind of options the filter should have. Read the 'filterdemo.py' included with MCEdit to learn how to access blocks in the level and work with the selection box, and about the different types of inputs available. Being familiar with pymclevel will help you a lot.
For convenience, here's a fairly well commented tree-generating script that was requested a while back:
# treegen.py
#
# Random tree-generation with density option
import random
from pymclevel import MCSchematic
#Use the inputs variable to tell MCEdit we want a Density option. See filterdemo.py for more info.
inputs = (
("Density", (10, 1, 100)), #Integer input, default: 10, min: 1, max: 100.
)
#The perform function is where we receive a reference to the level object, a BoundingBox object for the current selection, and an options dict holding the options the user specified.
def perform(level, box, options):
density = options["Density"]
treeChance = 0.05 * float(density) / 100.0 #Scale Density input to the range 0.0% - 5.0%
treeSchematic = makeTreeSchematic()
#Visit each column and check the top block for dirt or grass
#Adjust the min and max inward because the tree is 5x5
for x in xrange(box.minx+2, box.maxx-2):
for z in xrange(box.minz+2, box.maxz-2):
#Loop through the column from top to bottom until we find the top block
for y in reversed(xrange(box.miny, box.maxy)):
block = level.blockAt(x, y, z)
if block != 0: #found the first non-air block
if block == 2 or block == 3: #dirt or grass
if random.random() < treeChance:
#copy the tree from the schematic
#this may place part of the tree outside of the selection box
#meaning it cannot be undone. need to check y to make sure the
#tree stays within the bounds.
level.copyBlocksFrom(treeSchematic, treeSchematic.bounds, (x-2, y+1, z-2))
break; #next column
def makeTreeSchematic():
schem = MCSchematic(shape = (5,6,5)) #shape is x,y,z
#Here I use array slicing to fill out the different parts of the tree.
#Leaves, crown
schem.Blocks[1] = [
[0, 18, 0],
[18, 18, 18],
[0, 18, 0],
]
schem.Blocks[1] = 18
#Leaves, midsection
schem.Blocks[:,:,2:4] = 18
#Trunk
schem.Blocks[2,2,0:5] = 17
return schem
(This script is also included with MCEdit, but stuck in the 'demo' folder)
Here are a few links into the MCEdit thread where folks have posted filters they've made.
Small, simple, tiny request. I need a filter that spreads ores out over the selected area replacing stone. I need it for my series of Maja's Lost Island Adventure (Link in my sig). For now I'm working on the V4 of the map. And so far I have been using a brush with random small sizes and placed the ores underground randomly. So could any of you dear coders make a filter that "replaces" random stones into ores? Don't make them generate too far from each other. The ore height
rule doesn't matter. So diamonds and gold can spawn at any height. If you see the pics on my topic you will see what I mean about the rule. As the sea level on my map is at height of 8-9 blocks. The veins should be the same like in MC. Diamonds 2-5, gold ~4, coal ~10, iron 3-6 and lapiz ~2.
Thank you. Keeping an eye on this topic. I will credit you in the topic. Helping me makes my map popular, which will make you popular at the same time :smile.gif:
I would like to request a dungeon filter. You know, to generate dungeons in my flat world. I don't like making my own dungeons, mainly because I would just stuff the chests full of diamonds or something. Please make it possible.
Rollback Post to RevisionRollBack
I just took the Minecraft Noob test! Check out what I scored. Think you can beat me?!
I'm experiencing issues with the terrain generation causing the level of new chunks to mismatch existing data. I suspect this was caused by a Minecraft update or bug. Checking this thread it seems others here have had the same issue. I tried the Smooth filter but was disapointed in the result.
I've developed a "decliff" filter that seems to do a much better job with this specific issue See before and after screen shots below:
Things to note:
1. Changes are averaged across width of selection so select more of either side of cliff for more subtle change
2. Cliff must be parallel to the long edge of the selection
3. Ensure selection goes below ground level and above any trees/ground on cliff top
Raise/Lower option allows limit of only raising the cliff base or lowering the cliff top.
from numpy import zeros, array
import itertools
from pymclevel import alphaMaterials
am = alphaMaterials
# Consider below materials when determining terrain height
blocks = [
am.Stone,
am.Grass,
am.Dirt,
am.Bedrock,
am.Sand,
am.Sandstone,
am.Clay,
am.Gravel,
am.GoldOre,
am.IronOre,
am.CoalOre,
am.LapisLazuliOre,
am.DiamondOre,
am.RedstoneOre,
am.RedstoneOreGlowing,
am.Netherrack,
am.SoulSand,
am.Glowstone
]
terrainBlocktypes = [b.ID for b in blocks]
terrainBlockmask = zeros((256,), dtype='bool')
# Truth table used to calculate terrain height
# trees, leaves, etc. sit on top of terrain
terrainBlockmask[terrainBlocktypes] = True;
inputs = (
# Option to limit change to raise_cliff_floor / lower_cliff_top
# Default is to adjust both and meet somewhere in the middle
("Raise/Lower", ("Both", "Lower Only", "Raise Only")),
)
#
# Calculate the maximum adjustment that can be made from
# cliff_pos in direction dir (-1/1) keeping terain at most
# maxstep blocks away from previous column
def maxadj(heightmap, slice_no, cliff_pos, dir, pushup, maxstep, slice_width):
ret = 0
if dir < 0:
if cliff_pos < 2: return 0
end=0
else:
if cliff_pos > slice_width - 2: return 0
end=slice_width-1
for cur_pos in range(cliff_pos, end, dir):
if pushup:
ret = ret + \
max([0, maxstep - dir * heightmap[slice_no, cur_pos] + \
dir * heightmap[slice_no, cur_pos + dir]])
else:
ret = ret + \
min([0,-maxstep + dir * heightmap[slice_no, cur_pos] - \
dir * heightmap[slice_no, cur_pos + dir]])
return ret
#
# Raise/lower column at cliff face by adj and decrement change as we move away
# from the face. Each level will be at most maxstep blocks from those beside it.
#
# This function dosn't actually change anything, but just sets array 'new'
# with the desired height.
def adjheight(orig, new, slice_no, cliff_pos, dir, adj, can_adj, maxstep, slice_width):
cur_adj = adj
prev = 0
done_adj = 0
if dir < 0:
end=1
else:
end=slice_width-1
if adj == 0 or can_adj == 0:
for cur_pos in range(cliff_pos, end, dir):
new[slice_no, cur_pos] = orig[slice_no, cur_pos]
else:
for cur_pos in range(cliff_pos, end, dir):
if adj > 0:
done_adj = done_adj + \
max([0,maxstep - orig[slice_no, cur_pos] + \
orig[slice_no, cur_pos + dir]])
if orig[slice_no, cur_pos] - \
orig[slice_no, cur_pos + dir] > 0:
cur_adj=max([0, cur_adj-orig[slice_no, cur_pos] + \
orig[slice_no, cur_pos + dir]])
prev=adj-cur_adj
else:
done_adj = done_adj + \
min([0,-maxstep + \
orig[slice_no, cur_pos] - \
orig[slice_no, cur_pos + dir]])
if orig[slice_no, cur_pos] - \
orig[slice_no, cur_pos + dir] > 0:
cur_adj=min([0, cur_adj + orig[slice_no, cur_pos] - orig[slice_no, cur_pos + dir]])
prev=adj-cur_adj
new[slice_no, cur_pos] = max([0, orig[slice_no, cur_pos] + cur_adj])
if cur_adj != 0 and \
abs(prev) < abs(int(adj*done_adj/can_adj)):
cur_adj = cur_adj + (prev - int(adj*done_adj/can_adj))
prev = int(adj*done_adj/can_adj)
new[slice_no, end] = orig[slice_no, end]
def perform(level, box, options):
if box.volume > 16000000:
raise ValueError, "Volume too big for this filter method!"
RLOption = options["Raise/Lower"]
schema = level.extractSchematic(box);
schema.removeEntitiesInBox(schema.bounds)
schema.removeTileEntitiesInBox(schema.bounds)
terrainBlocks = terrainBlockmask[schema.Blocks]
coords = terrainBlocks.nonzero();
# Swap values around so long edge of selected rectangle is first
# - the long edge is assumed to run parallel to the cliff face
# and we want to process slices perpendicular to the face
# heightmap will have x,z (or z,x) index with highest ground level
if schema.Width > schema.Length:
heightmap = zeros((schema.Width, schema.Length), dtype='float32')
heightmap[coords[0], coords[1]] = coords[2]
newHeightmap = zeros((schema.Width, schema.Length), dtype='uint16')
slice_count=schema.Width
slice_width=schema.Length
else:
heightmap = zeros((schema.Length, schema.Width), dtype='float32')
heightmap[coords[1], coords[0]] = coords[2]
newHeightmap = zeros((schema.Length, schema.Width), dtype='uint16')
slice_count=schema.Length
slice_width=schema.Width
nonTerrainBlocks = ~terrainBlocks
nonTerrainBlocks &= schema.Blocks != 0
for slice_no in range(0, slice_count):
cliff_height=0
# determine pos and height of cliff in this slice
for cur_pos in range(0, slice_width-1):
if abs(heightmap[slice_no,cur_pos] - \
heightmap[slice_no,cur_pos+1]) > abs(cliff_height):
cliff_height= \
heightmap[slice_no,cur_pos] - \
heightmap[slice_no,cur_pos+1]
cliff_pos=cur_pos
if abs(cliff_height) < 2:
# nothing to adjust - just copy heightmap to newHightmap
adjheight(heightmap, newHeightmap, slice_no, 0, 1, 0, 1, 1, slice_width)
continue
# Try to keep adjusted columns within 1 column of their neighbours
# but ramp up to 4 blocks up/down on each column when needed
for max_step in range(1,4):
can_left=maxadj(heightmap,slice_no,cliff_pos,-1,cliff_height<0,max_step,slice_width)
can_right=maxadj(heightmap,slice_no,cliff_pos+1,1,cliff_height>0,max_step,slice_width)
if can_right < 0 and RLOption == "Raise Only": can_right=0
if can_right > 0 and RLOption == "Lower Only": can_right=0
if can_left < 0 and RLOption == "Raise Only": can_left=0
if can_left > 0 and RLOption == "Lower Only": can_left=0
if cliff_height < 0 and can_right - can_left < cliff_height:
if abs(can_left) > abs(can_right):
adj_left=-1*(cliff_height - max([int(cliff_height/2), can_right]))
adj_right=cliff_height + adj_left
else:
adj_right=cliff_height - max([int(cliff_height/2), -can_left])
adj_left=-1*(cliff_height - adj_right +1)
else:
if cliff_height > 0 and can_right - can_left > cliff_height:
if abs(can_left) > abs(can_right):
adj_left=-1*(cliff_height - min([int(cliff_height/2), can_right]))
adj_right=cliff_height + adj_left
else:
adj_right=cliff_height - min([int(cliff_height/2), -can_left]) -1
adj_left=-1*(cliff_height - adj_right)
else:
adj_right=0
adj_left=0
continue
break
adjheight(heightmap, newHeightmap, slice_no, cliff_pos, -1, adj_left, can_left, max_step, slice_width)
adjheight(heightmap, newHeightmap, slice_no, cliff_pos+1, 1, adj_right, can_right, max_step, slice_width)
# OK, newHeightMap has new height for each column
# so it's just a matter of moving everything up/down
for x, z in itertools.product(xrange(1, schema.Width - 1), xrange(1, schema.Length - 1)):
if schema.Width > schema.Length:
oh = heightmap[x, z];
nh = newHeightmap[x, z]
else:
oh = heightmap[z, x];
nh = newHeightmap[z, x]
delta = nh - oh
column = array(schema.Blocks[x, z])
# Keep bottom 5 blocks, so we don't loose bedrock
keep=min([5,nh])
Waterdepth=0
# Detect Water on top
if column[oh+1:oh+2] == am.WaterStill.ID or \
column[oh+1:oh+2] == am.Ice.ID:
for cur_pos in range(oh+1,schema.Height):
if column[cur_pos:cur_pos+1] != am.WaterStill.ID and \
column[cur_pos:cur_pos+1] != am.Ice.ID: break
Waterdepth=Waterdepth + 1
if delta == 0:
column[oh:] = schema.Blocks[x, z, oh:]
if delta < 0:
# Moving column down
column[keep:delta] = schema.Blocks[x, z, keep-delta:]
column[delta:] = am.Air.ID
if Waterdepth > 0:
# Avoid steping small lakes, etc on cliff top
# replace with dirt 'n grass
column[nh:nh+1] = am.Grass.ID
column[nh+1:nh+1+delta] = am.Air.ID
if delta > 0:
# Moving column up
column[keep+delta:] = schema.Blocks[x, z, keep:-delta]
# Put stone in gap at the bottom
column[keep:keep+delta] = am.Stone.ID
if Waterdepth > 0:
if Waterdepth > delta:
# Retain Ice
if column[nh+Waterdepth:nh+Waterdepth+1] == am.Ice.ID:
column[nh+Waterdepth-delta:nh+1+Waterdepth-delta] = \
am.Ice.ID
column[nh+1+Waterdepth-delta:nh+1+Waterdepth] = am.Air.ID
else:
if Waterdepth < delta - 2:
column[nh:nh+1] = am.Grass.ID
column[nh+1:nh+1+Waterdepth] = am.Air.ID
else:
# Beach at the edge
column[nh-4:nh-2] = am.Sandstone.ID
column[nh-2:nh+1] = am.Sand.ID
column[nh+1:nh+1+Waterdepth] = am.Air.ID
schema.Blocks[x, z] = column
level.copyBlocksFrom(schema, schema.bounds, box.origin);
So I copied that really awesome looking filter code in a .txt file and saved it as a .py file. Then I put that file in MCEditData\filters and when I tried to click on the filters option, the program just froze. After a few restarts, I finally got an error:
Error during <function showPanel at 0x0000000004DC0278>:
IndentationError('expected an indented block',
('C:\\Users\\(Me)\\Desktop\\Minecraft\\MCEdit-64bit\\MCEditData\\filters\\decliff.py', 47, 10, ' if cliff_pos < 2: return 0\n'))
Am I doing something wrong or did I just find a bug?
OMG! Decliff is exactly what I needed too :ohmy.gif: Sweet
Is someone going to make the "looks simple to make" plugin? D: It's not only useful for me but for many other map creators that make survivals and so on :smile.gif: Please help us :smile.gif:
Small, simple, tiny request. I need a filter that spreads ores out over the selected area replacing stone. I need it for my series of Maja's Lost Island Adventure (Link in my sig). For now I'm working on the V4 of the map. And so far I have been using a brush with random small sizes and placed the ores underground randomly. So could any of you dear coders make a filter that "replaces" random stones into ores? Don't make them generate too far from each other. The ore height
rule doesn't matter. So diamonds and gold can spawn at any height. If you see the pics on my topic you will see what I mean about the rule. As the sea level on my map is at height of 8-9 blocks. The veins should be the same like in MC. Diamonds 2-5, gold ~4, coal ~10, iron 3-6 and lapiz ~2.
Thank you. Keeping an eye on this topic. I will credit you in the topic. Helping me makes my map popular, which will make you popular at the same time :smile.gif:
General outline for an ore-regenerating function that uses Minecraft's natural algorithm:
First, create a temporary level filled with only solid stone from bottom to top, for as many chunks as was requested. Make sure the chunks are marked "TerrainPopulated: 0". Then, invoke the Minecraft Server on that level (using MCServerChunkGenerator, maybe) to force Minecraft to create ores among the solid stone. Finally, copy ores from the temporary level to the target level only in places where the target level has solid stone.
General outline for an ore-regenerating function that uses Minecraft's natural algorithm:
First, create a temporary level filled with only solid stone from bottom to top, for as many chunks as was requested. Make sure the chunks are marked "TerrainPopulated: 0". Then, invoke the Minecraft Server on that level (using MCServerChunkGenerator, maybe) to force Minecraft to create ores among the solid stone. Finally, copy ores from the temporary level to the target level only in places where the target level has solid stone.
I made 8x8 chunks, turned everything into Stone (Except the bedrock layer), CTRL+A'ed, Chunk Control and then Create and Minecraft Server (yes. I added 1.8.1 server.jar to the folder so I could see that it was "listed" on that popup. Then it loaded and after it was done, nothing new has happened. I did "Show Hidden Ores" and it didn't find anything.
However, Where is that "TerrainPopulated: x" thingy? Maybe that's why it didn't generate any ores?
Found out but still. I think it would be easier for all the survival map creators just have a simple Ore Generator :/ Could you (Or anyone else) please do that? 'Puppy eyes'
Like this Ores to generate: Coal [ ], Iron [ ], Gold [ ], Diamond [ ], Lapiz [ ] (You select multiple ores) Generate in: Stone [ ], Dirt [ ], Gravel [ ] Natural algorithm: Yes ( ), No ( ) (No would generate the ores in random heights, like diamond at the top and so on) Natural distance between ores: Yes ( ), No ( ) (No would place ores close to each other, Yes would place them like they are in MC) Generate in veins: Yes ( ), No ( ) (No would generate them in single blocks, Yes would generate them in veins where they are in "groups"
Hello? Did you even see my post codewarrior? I don't like making my own dungeons, so can someone please make a procedurally generated dungeon filter? Like this:
Spawner:
Skeleton []
Spider []
Zombie[]
Creeper(for exploding goodness)[]
Spider[]
Cave Spider(surrounded in web blocks)[]
Maybe Enderman spawner?
Silverfish []
Looks at the map, searches for portal blocks (quicker than Obsidian I guess) deletes all Nether portals and fills the empty frame with surrounding terrain (or air/water) if applicable.
I'd have a stab at it but learning the whole thing would take me days. =/
Rollback Post to RevisionRollBack
How to deal with ignorance (in life, and on forums): The Zen way... Stay cool and polite, treat people as you wish to be treated, rise above your impatience. Everyone is ignorant of something at any point in their lives, including you.
Just thought I'd give my filters a plug. They now all have wrappers for MCEdit, available on my scripts page (see the sig) or from the associated forum threads.
LineRailmakes powered rail tracks with supported bridges and tunnels.
WizardMountainrips up big chunks of land, like you always see those evil wizards doing. Kind of like the old "floating" land type, or the Aether mod.
StarStonemakes craters. Can also be used to place just boulders for ore deposits and the like.
Forestermakes huge trees. Seriously, these things can get really big.
The all come in both stand-alone and filter flavors. Check out the associated threads if you're interested! Thanks again to CodeWarrior for making this great editor!
Has anyone even started on a filter to make ore deposits? Im in real bad need of such, I am so sick of placing these blocks by hand in my custom maps.
I have ALMOST just finished one. I'm testing it right now, and it worked on a simple 2x2 block (as in 32x32 grid). It does all the main ores at the same time: Coal, Gold, Iron, Diamond, Redstone, Lapis Lazuli, Clay, Gravel, and Dirt. The clay, gravel, and dirt are included because those have a tendency to appear underground as well. I also added in code to make the clusters not all appear the same and have different orientations.
I'm also going to make a trimmed version of this one, which simply is a less "busy" dialogue box to fill out and only does only one left the the user's choice. The dialogue box will likely completely fill your screen...
You specify the percentage you want the particular block to replace (default stone). You specify the range of the cluster size.
To prevent it from doing a particular ore, keep the percentage at 0.
The minecraft default percentages and ore sizes are listed if the information was available.
I'll post the python scripts to my long outdated (~10 years... middle school?) website for download. I'll also post some pictures at some point.
Also, given the manner that I coded it, it should work extremely well with large selection boxes (provided most of it is the material to be replaced). It follows an expanding search algorithm from random points to place a cluster instead of calculating percentages on each box.
I had some silly bugs from this being in python and those <= vs < on the upper bounds of for loops. Don't want to edit outside the box!
Also updated the algorithm. When it starts to get too slow (it should start out fast and continually get slower), it changes algorithms to one that would start out slow and get faster. As a result, the calculations and updates are done fairly quickly, and you are updated within reason in the command box. If anyone finds any bugs, please let me know, but I'm fairly confident they are both bug-free and user-fool proof. There are also a fair amount of comments, so you might learn a thing or two studying it.
There are two different scripts available thus far.
VeinCreator.py and Ores.py.
VeinCreator is the vanilla version of Ores, being just one type of block being replaced with another at a certain percentage within the box and target cluster sizes.
Ores takes Vein Creator to a new level. You choose the block to replace, and then using preferred % and cluster sizes, fills in coal, gold, iron, diamond, redstone, lapis lazuli, clay, gravel, and dirt. Sorry about the large box, but the defaults are set to replace with nothing. There's more descriptions on my website.
I'm sorry Majataka that I don't have it quite to your specifications for a one clicker, but you should still be able to do everything/figure it out with these two tools. If you want individuals, have the vein minimum and maximum both be 1. For a natural distance, mine is completely random. You'd have to do some math and do the filter over multiple selection boxes. Same goes for the natural algorithm. I'd suggest doing it in multiple layers along Y, and that would not take too long as the code runs very quickly. The rows/%/vein sizes are displayed when setting inputs for both filters.
Enjoy!
darthvader45, I'll get to work on a dungeon filter. This one may take multiple days to pound out. That one may take awhile, though, and I have a LOT of classwork to catch up on from being sick!
Geethebluesky, if I can figure out how things work without selection boxes, I can probably do that one for you too relatively quickly. As far as coding tasks go, that is pretty simple. Just a giant search to look for portal blocks, sampling the block ID's around it, and replacing the obsidian and portal ID's. This sounds like a day project, but as I said earlier, I don't have many days to work. I probably won't be able to seriously code stuff until mid-December after my Phys 580 final.
OH MY GOD! I CAN'T THANK YOU ENOUGH! I LOVE YOU! Seriously. Good job for what you did. The One click thing wasn't necessary. I like your idea more! Hope Corewarrior notices it and adds it in the next Stable! Love you <333 no gay
brezeeg I love you! These should be added to MCedit by default! Maybe submit them over and see if they could come standard? :3
There is an issue with the Ore Vein Creator, the filter window spans much taller then my screen, so now I can't deselect it or another filter :sad.gif:
Also bug in the Simple Block Vein Creator
If I set the % to say #.#0 it would remove the last 0 and make it #.#
# = any number
So if I wanted it to be 0.70, I'd have to make it 0.71 otherwise it would set to just 0.7%
For users:
Filter scripts are a way of adding functionality to MCEdit. To install a script, select the Filter tool and click the blue word "Filter" to open the filters folder. Place the script (a ".py" file) in this folder, then cancel and reselect the Filter tool.
For example: select everything in the CODE block further down, paste it into Notepad, save the file as "treegen.py", and place it in the filters folder. Reselect the tool, then look for the new "Treegen" option in the Filter: menu.
For coders:
A filter script has one function, 'perform', which is given access to the current level and selection. A filter can also provide an "inputs" array, telling MCEdit what kind of options the filter should have. Read the 'filterdemo.py' included with MCEdit to learn how to access blocks in the level and work with the selection box, and about the different types of inputs available. Being familiar with pymclevel will help you a lot.
For convenience, here's a fairly well commented tree-generating script that was requested a while back:
(This script is also included with MCEdit, but stuck in the 'demo' folder)
Here are a few links into the MCEdit thread where folks have posted filters they've made.
viewtopic.php?f=1022&t=15522&start=2100#p3000321
viewtopic.php?f=1022&t=15522&start=2250#p3238156
viewtopic.php?f=1022&t=15522&start=2190#p3131766
Feel free to post any filters you make in this thread to make them easier to find.
"We will absolutely not keep in mind what external mapeditors will have to do to read data from the disk, that makes no sense whatsoever." - Grum
A procedurally generated mountain filter please! It is so hard to make realistic mountains!
rule doesn't matter. So diamonds and gold can spawn at any height. If you see the pics on my topic you will see what I mean about the rule. As the sea level on my map is at height of 8-9 blocks. The veins should be the same like in MC. Diamonds 2-5, gold ~4, coal ~10, iron 3-6 and lapiz ~2.
Thank you. Keeping an eye on this topic. I will credit you in the topic. Helping me makes my map popular, which will make you popular at the same time :smile.gif:
Click me ☟ and join us!
I just took the Minecraft Noob test! Check out what I scored. Think you can beat me?!
To take the test, check out
https://minecraftnoobtest.com/test.php
Don't click this link, HE is haunting it...
(original post)
"We will absolutely not keep in mind what external mapeditors will have to do to read data from the disk, that makes no sense whatsoever." - Grum
So I copied that really awesome looking filter code in a .txt file and saved it as a .py file. Then I put that file in MCEditData\filters and when I tried to click on the filters option, the program just froze. After a few restarts, I finally got an error:
Error during <function showPanel at 0x0000000004DC0278>:
IndentationError('expected an indented block',
('C:\\Users\\(Me)\\Desktop\\Minecraft\\MCEdit-64bit\\MCEditData\\filters\\decliff.py', 47, 10, ' if cliff_pos < 2: return 0\n'))
Am I doing something wrong or did I just find a bug?
Thank you!
Is someone going to make the "looks simple to make" plugin? D: It's not only useful for me but for many other map creators that make survivals and so on :smile.gif: Please help us :smile.gif:
Click me ☟ and join us!
Yes, Ore filter is what I wanted to say. That would be epic yeah.
Click me ☟ and join us!
First, create a temporary level filled with only solid stone from bottom to top, for as many chunks as was requested. Make sure the chunks are marked "TerrainPopulated: 0". Then, invoke the Minecraft Server on that level (using MCServerChunkGenerator, maybe) to force Minecraft to create ores among the solid stone. Finally, copy ores from the temporary level to the target level only in places where the target level has solid stone.
"We will absolutely not keep in mind what external mapeditors will have to do to read data from the disk, that makes no sense whatsoever." - Grum
I made 8x8 chunks, turned everything into Stone (Except the bedrock layer), CTRL+A'ed, Chunk Control and then Create and Minecraft Server (yes. I added 1.8.1 server.jar to the folder so I could see that it was "listed" on that popup. Then it loaded and after it was done, nothing new has happened. I did "Show Hidden Ores" and it didn't find anything.
However, Where is that "TerrainPopulated: x" thingy? Maybe that's why it didn't generate any ores?
Found out but still. I think it would be easier for all the survival map creators just have a simple Ore Generator :/ Could you (Or anyone else) please do that? 'Puppy eyes'
Like this
Ores to generate: Coal [ ], Iron [ ], Gold [ ], Diamond [ ], Lapiz [ ] (You select multiple ores)
Generate in: Stone [ ], Dirt [ ], Gravel [ ]
Natural algorithm: Yes ( ), No ( ) (No would generate the ores in random heights, like diamond at the top and so on)
Natural distance between ores: Yes ( ), No ( ) (No would place ores close to each other, Yes would place them like they are in MC)
Generate in veins: Yes ( ), No ( ) (No would generate them in single blocks, Yes would generate them in veins where they are in "groups"
Click me ☟ and join us!
Spawner:
Skeleton []
Spider []
Zombie[]
Creeper(for exploding goodness)[]
Spider[]
Cave Spider(surrounded in web blocks)[]
Maybe Enderman spawner?
Silverfish []
Rewards:
Chest []
Double Chest []
Danger:
Lava []
TNT []
Double Spawner []
Arrow Traps []
Try to see if that can be made
I just took the Minecraft Noob test! Check out what I scored. Think you can beat me?!
To take the test, check out
https://minecraftnoobtest.com/test.php
Don't click this link, HE is haunting it...
Looks at the map, searches for portal blocks (quicker than Obsidian I guess) deletes all Nether portals and fills the empty frame with surrounding terrain (or air/water) if applicable.
I'd have a stab at it but learning the whole thing would take me days. =/
How to deal with ignorance (in life, and on forums): The Zen way... Stay cool and polite, treat people as you wish to be treated, rise above your impatience. Everyone is ignorant of something at any point in their lives, including you.
LineRailmakes powered rail tracks with supported bridges and tunnels.
WizardMountainrips up big chunks of land, like you always see those evil wizards doing. Kind of like the old "floating" land type, or the Aether mod.
StarStonemakes craters. Can also be used to place just boulders for ore deposits and the like.
Forestermakes huge trees. Seriously, these things can get really big.
The all come in both stand-alone and filter flavors. Check out the associated threads if you're interested! Thanks again to CodeWarrior for making this great editor!
I have ALMOST just finished one. I'm testing it right now, and it worked on a simple 2x2 block (as in 32x32 grid). It does all the main ores at the same time: Coal, Gold, Iron, Diamond, Redstone, Lapis Lazuli, Clay, Gravel, and Dirt. The clay, gravel, and dirt are included because those have a tendency to appear underground as well. I also added in code to make the clusters not all appear the same and have different orientations.
I'm also going to make a trimmed version of this one, which simply is a less "busy" dialogue box to fill out and only does only one left the the user's choice. The dialogue box will likely completely fill your screen...
You specify the percentage you want the particular block to replace (default stone). You specify the range of the cluster size.
To prevent it from doing a particular ore, keep the percentage at 0.
The minecraft default percentages and ore sizes are listed if the information was available.
I'll post the python scripts to my long outdated (~10 years... middle school?) website for download. I'll also post some pictures at some point.
Also, given the manner that I coded it, it should work extremely well with large selection boxes (provided most of it is the material to be replaced). It follows an expanding search algorithm from random points to place a cluster instead of calculating percentages on each box.
http://www.brezeegerland.com/Minecraft/index.htm
I had some silly bugs from this being in python and those <= vs < on the upper bounds of for loops. Don't want to edit outside the box!
Also updated the algorithm. When it starts to get too slow (it should start out fast and continually get slower), it changes algorithms to one that would start out slow and get faster. As a result, the calculations and updates are done fairly quickly, and you are updated within reason in the command box. If anyone finds any bugs, please let me know, but I'm fairly confident they are both bug-free and user-fool proof. There are also a fair amount of comments, so you might learn a thing or two studying it.
There are two different scripts available thus far.
VeinCreator.py and Ores.py.
VeinCreator is the vanilla version of Ores, being just one type of block being replaced with another at a certain percentage within the box and target cluster sizes.
Ores takes Vein Creator to a new level. You choose the block to replace, and then using preferred % and cluster sizes, fills in coal, gold, iron, diamond, redstone, lapis lazuli, clay, gravel, and dirt. Sorry about the large box, but the defaults are set to replace with nothing. There's more descriptions on my website.
I'm sorry Majataka that I don't have it quite to your specifications for a one clicker, but you should still be able to do everything/figure it out with these two tools. If you want individuals, have the vein minimum and maximum both be 1. For a natural distance, mine is completely random. You'd have to do some math and do the filter over multiple selection boxes. Same goes for the natural algorithm. I'd suggest doing it in multiple layers along Y, and that would not take too long as the code runs very quickly. The rows/%/vein sizes are displayed when setting inputs for both filters.
Enjoy!
darthvader45, I'll get to work on a dungeon filter. This one may take multiple days to pound out. That one may take awhile, though, and I have a LOT of classwork to catch up on from being sick!
Geethebluesky, if I can figure out how things work without selection boxes, I can probably do that one for you too relatively quickly. As far as coding tasks go, that is pretty simple. Just a giant search to look for portal blocks, sampling the block ID's around it, and replacing the obsidian and portal ID's. This sounds like a day project, but as I said earlier, I don't have many days to work. I probably won't be able to seriously code stuff until mid-December after my Phys 580 final.
~Dan
OH MY GOD! I CAN'T THANK YOU ENOUGH! I LOVE YOU! Seriously. Good job for what you did. The One click thing wasn't necessary. I like your idea more! Hope Corewarrior notices it and adds it in the next Stable! Love you <333 no gay
Click me ☟ and join us!
There is an issue with the Ore Vein Creator, the filter window spans much taller then my screen, so now I can't deselect it or another filter :sad.gif:
Also bug in the Simple Block Vein Creator
If I set the % to say #.#0 it would remove the last 0 and make it #.#
# = any number
So if I wanted it to be 0.70, I'd have to make it 0.71 otherwise it would set to just 0.7%