• 0

    posted a message on MCEdit: Minecraft World Editor (Now open source!)
    Hey. First of all, thanks for the great tool. MC Edit is helping me quite a lot in making my adventure map (with the new adventure mode).

    I could use your help in creating a filter.
    Here is the problem. I made a huge structure out of stone bricks and now I want a filter that will randomly pick stone bricks and replace them with cracked and mossy stone bricks. I've made the filter.

    The user picks block A (in my case stone bricks) and block B (in my case cracked or mossy stone bricks).
    He also inputs the chance of replacing the blocks (default 15%).

    And everything works fine if I want to change blocks with different ID's. But when I want to change blocks with same ID's but different .blockData, it doesn't work. It just replaces them with the first, default block ID (instead of placing cracked stone bricks, it will just place stone bricks).

    Here is my filter code:
    import random
    
    inputs = (
    ("Pick block A:", "blocktype"), #Block that will be replaced
    ("Pick block B:", "blocktype"), #Block that will replace it
    ("Chance", (15, 1, 100)),
    )
    
    def perform(level, box, options):
    chance = options["Chance"]
    blockTypeA = options["Pick block A:"].ID
    blockTypeB = options["Pick block B:"].ID
    changeChance = float(chance) / 100.0
    
    for x in xrange(box.minx, box.maxx): #nasty loop to go trough every block in the selection box
    for z in xrange(box.minz, box.maxz): #not sure if I could use the other 2 methods since
    for y in xrange(box.miny, box.maxy): #I don't see them checking every block separately.
    
    if level.blockAt (x, y, z) == blockTypeA:
    if random.random() < changeChance:
    level.setBlockAt(x, y, z, blockTypeB)
    
    level.markDirtyBox(box)


    I know I should use .blockData and manipulate it, but I really don't know how. TBH, I'm happy that I managed to make this filter work as it is considering that I don't know Python. Only Java, C++ and C#.

    I wouldn't be asking if I didn't need your help. But I asked around, people I know made some filter (but they completely ignored the message), posted a thread on Mod Discussion which was also ignored...

    I hope you can help me.
    But thanks anyways.

    EDIT:
    I made it work somehow. I looked at the level.py library and fount the setBlockDataAt command. I had some problems making it work, but it ended up working well. But get the feeling that something is off with my code.
    import random
    
    inputs = (
    ("Pick block A:", "blocktype"), #Picks the blocks that will be changed
    ("Pick block B:", "blocktype"), #picks the block to which it will change
    ("Chance", (15, 1, 100)),
    )
    
    def perform(level, box, options):
    chance = options["Chance"]
    blockTypeA = options["Pick block A:"].ID
    blockDataA = options["Pick block A:"].blockData
    blockTypeB = options["Pick block B:"].ID
    blockDataB = options["Pick block B:"].blockData
    
    changeChance = float(chance) / 100.0
    
    for x in xrange(box.minx, box.maxx):
    for z in xrange(box.minz, box.maxz):
    for y in xrange(box.miny, box.maxy):
    
    if level.blockAt(x, y, z) == blockTypeA:
    if level.blockDataAt (x, y, z) == blockDataA:
    if random.random () < changeChance:
    level.setBlockAt(x, y, z, blockTypeB)
    level.setBlockDataAt(x, y, z, blockDataB)
    
    level.markDirtyBox(box)


    I'm not sure if the "level.setBlockDataAt(x, y, z, blockDataB)" is included in the whole loop. I tested it and it all works well, but I'm used to have to use { and } in C++ when I want more than one command line to be included in a loop. But when I use t( and ) inn the code I always get a syntax error on the "level.setBlockDataAt(x, y, z, blockDataB)" line.

    I mean, it works fine in my tests, but I still feel like it's not the correct way to do. How does the program know what to include in the loop and what not. Is the "level.markDirtyBox(box)" also included in the loop because there is no way of telling what commands are and what aren't in it. If it is, it's just taking away resources for no reason because it's needed only once at the end of the filter to say that the selection needs to run a lightning check or whatever.
    Posted in: Minecraft Tools
  • 0

    posted a message on [help]MC-Edit filter
    Guys, I could really use your help. Please.
    Bump.
    Posted in: Mods Discussion
  • 0

    posted a message on [help]MC-Edit filter
    Hey.

    First of all, sorry if I made the thread in the wrong subforum. I've no idea where to post this. I wouldn't consider this as a mod, which is why I didn't post this in Mod development.

    To the problem. I've written a filter for MC Edit which will let you select 2 blocks and will randomly (you pick the chance) change block 1 with block 2 in the selected area. And the filter works nicely in all situation but one. When I need to change blocks with the same ID but different blockData, like Stone Bricks and Cracked Stone Bricks. Or wool with different colors. And I made the filter just because of that reason. I need to randomly swap stone bricks with cracked and mossy stone bricks in a big structure.

    How do I fix that?

    Filter code:
    import random
    
    inputs = (
      ("Pick block A:", "blocktype"), #Block that will be replaced
      ("Pick block B:", "blocktype"), #Block that will replace it
      ("Chance", (15, 1, 100)),
    )
    
    def perform(level, box, options):
      chance = options["Chance"]
      blockTypeA = options["Pick block A:"].ID
      blockTypeB = options["Pick block B:"].ID
      changeChance = float(chance) / 100.0
    
      for x in xrange(box.minx, box.maxx): #nasty loop to go trough every block in the selection box
        for z in xrange(box.minz, box.maxz): #not sure if I could use the other 2 methods since
          for y in xrange(box.miny, box.maxy): #I don't see them checking every block separately.
    
            if level.blockAt (x, y, z) == blockTypeA:
              if random.random() < changeChance:
                level.setBlockAt(x, y, z, blockTypeB)
    
      level.markDirtyBox(box)


    I know I have to use blockData, but I don't know how.
    Posted in: Mods Discussion
  • 0

    posted a message on [CTM?] Hollow Eyes
    A great map. I love it.

    Reddit brought me here. As soon as I read the story, I had to download it. :biggrin.gif:
    Question
    How did you make the pumpkins appear on the glowstone? I don't see any dispenser around, nor a pressure plate to activate it.
    Posted in: Maps
  • 0

    posted a message on Strongholds as bases
    I would like to do that and actually tried, but every stronghold I found had either a HUGE ravine going right trough it or several abounded mine shafts, so it wouldn't look to good and there would be to much to fix to bother.

    If someone had a seed with a entrance on the surface and no ravines and mine shafts, please post here or even better, write me a private message.
    Posted in: Survival Mode
  • 0

    posted a message on OBSIDIAN, Y U NO BREAK EASY?
    It should break faster, but still be explosion resistant.

    I don't really care about realism on this part, I just want to get 1 block per 5 seconds instead of 15. It's not hard to farm it, it's not dangerous, it's just plain and simple annoying.

    Why should I stand there and hold the mouse button for 15 seconds to get 1 (ONE) block. And God forbid you misplace it when building something. It just forces you into rage-quitting the game.

    Obsidian and Redstone ore should break at least 50% faster. I would prefer 66% (takes only 1/3 of the time it needs now).
    Posted in: Survival Mode
  • 0

    posted a message on Strongholds Updated
    Go in creative, get Ender Eye as item, go into that room and right-click the "broken" crystals to fix them.
    This will probably be a portal the the sky realm.
    Posted in: Seeds
  • 0

    posted a message on [Surv] Skyblock
    Quote from Mining_Jawa

    How I make bed? :sad.gif: :Sheep: :Sheep:


    You have 12 strings.
    4 strings = 1 wool

    Think with portals workbenches. :rolleyes:
    Posted in: Maps
  • 0

    posted a message on [Surv] Skyblock
    The idea is great, I just hate that it's on a snow biome.
    It ruined my cobblestone generator, it ruined my ONLY melon seed several times.
    Ruined many of my torches....

    The snow is a nice addition to make it harder, but it's to annoying. It's not something you can really control. It started snowing during the first day 4 out of 5 times I tried the map. It didn't snow only the first time, but that time I ****ed up the generator and got obsidian.

    Just change it to another biome, hopefully desert so that we don't have the annoying rain. Or maybe put it between a normal and a snow biome. Half of the island is snowy the other half is rainy.
    Posted in: Maps
  • 0

    posted a message on These biomes are to big!
    They could be a bit bigger.
    I don't like a big project being on 3 different biome. 1 end is in a desert, the other is under snow. no thanks.

    Notch just needs to make sure that you don't start on an empty small island without wood in middle of an ocean like I did several times.
    Posted in: Survival Mode
  • 0

    posted a message on Map problem
    I made a map in my main base, explored it completely.
    Then I go in the Nether, go far away, make a new portal, go to the overworld and find a village. I put a workbench in the center of the village, make a compass, make 9 paper, make a map and I get my old map. Every time I craft a map, it's always the first map.

    No matter where I go, where I craft the map, it's always the first one from my main base.
    I know that the center of the map should be the place where I crafted it, but it won't work.

    I use 1.9 prerelease 2. I have bought the game (not pirated).
    The world was created in 1.8, both maps in 1.9 prerelease 1 or 2.

    Help?
    Posted in: Survival Mode
  • 1

    posted a message on Around 180+ hours of work, destroyed
    And you didn't have a backup of what you make?
    I do a daily backup of my world which is a single player map. You have a server and don't have any update tools? You deserve this for being ignorant and thinking that no one would do that.
    Posted in: Survival Mode
  • 0

    posted a message on Which one is truly better, charcoal... or coal?
    People doing calculations seem to forget that you need to burn the logs in order to get charcoal.

    So basically, you need 9 charcoal to smelt 1 stack.
    1 charcoal to smelt 8 logs and get 8 c.coal. Those 8 to smelt the stack of whatever you want to smelt.
    Coal is more effective.
    We could also calculate the durability of tools needed.

    8 pickaxe uses is 8 coal.
    To get 8 charcoal you need 1 plank to smelt 1 log and get 1 charcoal. That's 2 logs. And you need 8 logs to be smelted by that 1 charcoal to get 8. So you use 10 times you axe.

    Trees are renewable coal is not? Maybe true, but I doubt I will ever get to the point where I mined all the coal AND used it all up. The "limited number of x" argument works only if the limited number is small and limits you. If the number is thousands of times bigger than the number you will ever need, that argument gets invalid.

    Finding coal before the first night? Unless you're on a small island without any caves and other land around you, you will find several coal deposits on the surface, visible by just walking around. So that's not a problem. Move more than 20 blocks from your spawn and there you have it. Finding coal is guarantied. Hell, you can also find enough Iron in your first day without even searching for it. Finding 10 iron in the first day is just to easy.

    So yeah, coal>charcoal.
    Easy to find, is an extra just for searching other ores, is an extra just for exploring, usually hides some iron behind it (not a fact, but iron is almost always close near coal, at least form my playing experience).
    Posted in: Survival Mode
  • 0

    posted a message on I'm disapointed in endermen...
    As far as I know Notch said he would make Enderman weaker and than buff them as needed. A to strong mob is worse than a to weak. If it's to strong, it can ruin the game until the next update. Doesn't work the other way.

    I hope they will get buffed the next version and get a new sound. Maybe some creepy whispering?
    Like "Steve", "don't hide", "we will find you", but just some creepy whispering that is almost unrecognizable. Or maybe played backwards. That would be really creepy. :biggrin.gif:
    Posted in: Survival Mode
  • 0

    posted a message on Weird Bedrock
    Well, there is no need for triple posting.

    Also, can someone post a picture of what you're talking about.
    Posted in: Survival Mode
  • To post a comment, please or register a new account.