Jump to content

Help
Latest News Article

MCEdit Filter Scripts


34 replies to this topic

#1

  • Location: Big Island

Posted 19 March 2011 - 07:08 AM

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.

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.
MCEdit: Minecraft World Editor
The sun rises in the +X and sets in the -X. Clouds travel -X.

Register or log in to remove.

#2

Posted 28 July 2011 - 09:14 AM

Those links are not working for me, they all link back to the original MCEdit thread, first post.

Anyway, here's a link to my "flood fill" filter:

DOWNLOAD:
http://www.marco83.c...od-fill-filter/

Video:
http://www.youtube.c...h?v=-9ICsgr-OCo

#3

Posted 29 July 2011 - 07:18 PM

I would like to request one please!

A procedurally generated mountain filter please! It is so hard to make realistic mountains!

#4

  • Location: Norway
  • Minecraft: Majataka

Posted 12 August 2011 - 09:46 AM

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 :)
Posted Image

#5

  • Location: In Herobrine's lair, beating the living crap out of him with Notch's personal sword! Where else?

Posted 20 August 2011 - 04:00 PM

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.
Posted Image

#6

  • Location: Big Island

Posted 31 August 2011 - 04:07 PM

Here's a filter developed by DrRomz that will smooth out cliffs along one dimensions:

(original post)

View PostDrRomz, on 27 August 2011 - 01:05 AM, said:

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:

Posted Image

Posted Image

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);

MCEdit: Minecraft World Editor
The sun rises in the +X and sets in the -X. Clouds travel -X.

#7

Posted 03 September 2011 - 12:04 AM

View Postcodewarrior, on 31 August 2011 - 04:07 PM, said:

Here's a filter developed by DrRomz that will smooth out cliffs along one dimensions:

(original post)

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?
Posted Image

#8

Posted 06 September 2011 - 09:01 AM

View PostEvanAsgarnis, on 03 September 2011 - 12:04 AM, said:

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?
DrRomz updated his original post with a download link that doesn't have these errors ;)
http://www.minecraft...ost__p__7648793

#9

Posted 14 September 2011 - 01:23 PM

Decliff is exactly what I've been looking for!

Thank you!

#10

  • Location: Norway
  • Minecraft: Majataka

Posted 21 September 2011 - 05:15 PM

OMG! Decliff is exactly what I needed too :o 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 :) Please help us :)

View PostMajataka, on 12 August 2011 - 09:46 AM, said:

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 :)

Posted Image

#11

Posted 25 September 2011 - 09:45 PM

An ore filter, that would put in ores replacing stone for a whole chunk would be amazing.

#12

  • Location: Norway
  • Minecraft: Majataka

Posted 12 October 2011 - 05:12 PM

View PostBlobthe15, on 25 September 2011 - 09:45 PM, said:

An ore filter, that would put in ores replacing stone for a whole chunk would be amazing.
Yes, Ore filter is what I wanted to say. That would be epic yeah.
Posted Image

#13

  • Location: Big Island

Posted 12 October 2011 - 06:39 PM

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.
MCEdit: Minecraft World Editor
The sun rises in the +X and sets in the -X. Clouds travel -X.

#14

  • Location: Norway
  • Minecraft: Majataka

Posted 19 October 2011 - 05:28 PM

View Postcodewarrior, on 12 October 2011 - 06:39 PM, said:

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"
Posted Image

#15

  • Location: In Herobrine's lair, beating the living crap out of him with Notch's personal sword! Where else?

Posted 23 October 2011 - 06:15 PM

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 []

Rewards:
Chest []
Double Chest []

Danger:
Lava []
TNT []
Double Spawner []
Arrow Traps []



Try to see if that can be made
Posted Image

#16

  • Location: The Netherlands
  • Minecraft: twannie1997

Posted 29 October 2011 - 08:36 PM

View Postdarthvader45, on 20 August 2011 - 04:00 PM, said:

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.

Yes, I want this too!

Zkyo said:

An enderman teleported into my basement at some point, and re-arranged all the "natural" blocks in there.

#17

    Taiine

    Obsidian Miner

  • Members
  • 1453 posts
  • Location: In a mine somewhere
  • Minecraft: Taiine

Posted 05 November 2011 - 07:31 PM

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.

#18

  • Location: High-altitude desert biome

Posted 14 November 2011 - 12:42 AM

I'd like to request a portal wipe filter...

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.

#19

  • Minecraft: dudecon

Posted 19 November 2011 - 05:41 AM

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!

#20

    brezeeg

    Out of the Water

  • Members
  • 4 posts

Posted 19 November 2011 - 07:31 PM

View PostTaiine, on 05 November 2011 - 07:31 PM, said:

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.