MC Modding
Please register and join the community!

[1.8.1] Structure Maker

View previous topic View next topic Go down

[1.8.1] Structure Maker

Post by Strengthowns on Sun Oct 16, 2011 6:46 am

Structure Maker
Spoiler:
mod_Namehere
Code:
package net.minecraft.src;

public class mod_Namehere extends BaseMod
{
   public static final Block Namehere;

    public mod_Namehere()
    {
       ModLoader.AddName(Namehere, "Namehere Block");      
      ModLoader.RegisterBlock(Namehere);
    }
   
   public String Version()
    {
        return "1.8.1";
    }

    static
    {
       Namehere = (new BlockNamehere(181, ModLoader.addOverride("/terrain.png", "/Namehere.png"))).setHardness(0.0F).setBlockName("Namehere");
    }
}

BlockNamehere
Code:
package net.minecraft.src;

public class BlockNamehere extends Block
{
    private World worldObj;

   protected BlockNamehere(int i, int j)
    {
        super(i, j, Material.ground);
    }
   
   public void onBlockClicked(World world, int i, int j, int k, EntityPlayer entityplayer)
    {         
        world.setBlockWithNotify(i, j + 1, k, Block.dirt.blockID);
      world.setBlockWithNotify(i, j + 2, k, Block.dirt.blockID);
      world.setBlockWithNotify(i, j + 3, k, Block.dirt.blockID);
      world.setBlockWithNotify(i, j + 4, k, Block.dirt.blockID);
      world.setBlockWithNotify(i, j + 5, k, Block.dirt.blockID);
      world.setBlockWithNotify(i, j + 6, k, Block.dirt.blockID);
      world.setBlockWithNotify(i, j + 7, k, Block.dirt.blockID);
      world.setBlockWithNotify(i, j + 8, k, Block.dirt.blockID);
    }
}

Help: mod_Namehere

1. Note: The way the code is done in this may look different but it makes things

Help: BlockNamehere

1. Everything is same as normal except for the "onBlockClicked" method.

2. In the "world.setBlockWithNotify" statements, the i, j, k letters stand for the coordinates x, y, z. After that it is saying what block it will put at those coordinates.

3. Optionally, if you are using the same block over and over and want to make it easier to write, you could set an integer like this:
Code:
   public void onBlockClicked(World world, int i, int j, int k, EntityPlayer entityplayer)
    {
      int block = Block.dirt.blockID;
         
        world.setBlockWithNotify(i, j + 1, k, block);
      world.setBlockWithNotify(i, j + 2, k, block);
      world.setBlockWithNotify(i, j + 3, k, block);
      world.setBlockWithNotify(i, j + 4, k, block);
      world.setBlockWithNotify(i, j + 5, k, block);
      world.setBlockWithNotify(i, j + 6, k, block);
      world.setBlockWithNotify(i, j + 7, k, block);
      world.setBlockWithNotify(i, j + 8, k, block);
    }

Then you would only have to write "block" to make it use dirt.

There you have it, a nice easy way to make a house or any structure you want!
avatar
Strengthowns
Admin

Posts : 79
Join date : 2011-06-14
Location : Right here!

View user profile http://www.mcmodding.4umer.com

Back to top Go down

Re: [1.8.1] Structure Maker

Post by dannydobbi on Tue Oct 25, 2011 3:43 am

could you help me, i dont understand how to make them spawn in different places


Last edited by dannydobbi on Tue Oct 25, 2011 3:56 pm; edited 1 time in total

dannydobbi
Member

Posts : 1
Join date : 2011-10-25

View user profile

Back to top Go down

Re: [1.8.1] Structure Maker

Post by austin56101 on Tue Oct 25, 2011 8:09 am

yeah ok i really dont understand how to make structures
i looked at the coding
Code:
 placeVoid(world, structureboundingbox, 1, 1, 1, 3, 3, 7, 0, 0, false);
        placeVoid(world, structureboundingbox, 1, 5, 1, 3, 9, 3, 0, 0, false);
        placeVoid(world, structureboundingbox, 1, 0, 0, 3, 0, 8, Block.cobblestone.blockID, Block.cobblestone.blockID, false);
        placeVoid(world, structureboundingbox, 1, 1, 0, 3, 10, 0, Block.cobblestone.blockID, Block.cobblestone.blockID, false);
        placeVoid(world, structureboundingbox, 0, 1, 1, 0, 10, 3, Block.cobblestone.blockID, Block.cobblestone.blockID, false);
        placeVoid(world, structureboundingbox, 4, 1, 1, 4, 10, 3, Block.cobblestone.blockID, Block.cobblestone.blockID, false);
        placeVoid(world, structureboundingbox, 0, 0, 4, 0, 4, 7, Block.cobblestone.blockID, Block.cobblestone.blockID, false);
        placeVoid(world, structureboundingbox, 4, 0, 4, 4, 4, 7, Block.cobblestone.blockID, Block.cobblestone.blockID, false);
        placeVoid(world, structureboundingbox, 1, 1, 8, 3, 4, 8, Block.cobblestone.blockID, Block.cobblestone.blockID, false);
        placeVoid(world, structureboundingbox, 1, 5, 4, 3, 10, 4, Block.cobblestone.blockID, Block.cobblestone.blockID, false);
        placeVoid(world, structureboundingbox, 1, 5, 5, 3, 5, 7, Block.cobblestone.blockID, Block.cobblestone.blockID, false);
        placeVoid(world, structureboundingbox, 0, 9, 0, 4, 9, 4, Block.cobblestone.blockID, Block.cobblestone.blockID, false);
        placeVoid(world, structureboundingbox, 0, 4, 0, 4, 4, 4, Block.cobblestone.blockID, Block.cobblestone.blockID, false);
        placeBlockAtCurrentPosition(world, Block.cobblestone.blockID, 0, 0, 11, 2, structureboundingbox);
        placeBlockAtCurrentPosition(world, Block.cobblestone.blockID, 0, 4, 11, 2, structureboundingbox);
        placeBlockAtCurrentPosition(world, Block.cobblestone.blockID, 0, 2, 11, 0, structureboundingbox);
        placeBlockAtCurrentPosition(world, Block.cobblestone.blockID, 0, 2, 11, 4, structureboundingbox);
        placeBlockAtCurrentPosition(world, Block.cobblestone.blockID, 0, 1, 1, 6, structureboundingbox);
        placeBlockAtCurrentPosition(world, Block.cobblestone.blockID, 0, 1, 1, 7, structureboundingbox);
        placeBlockAtCurrentPosition(world, Block.cobblestone.blockID, 0, 2, 1, 7, structureboundingbox);
        placeBlockAtCurrentPosition(world, Block.cobblestone.blockID, 0, 3, 1, 6, structureboundingbox);
        placeBlockAtCurrentPosition(world, Block.cobblestone.blockID, 0, 3, 1, 7, structureboundingbox);
        placeBlockAtCurrentPosition(world, Block.stairCompactCobblestone.blockID, func_35009_c(Block.stairCompactCobblestone.blockID, 3), 1, 1, 5, structureboundingbox);
        placeBlockAtCurrentPosition(world, Block.stairCompactCobblestone.blockID, func_35009_c(Block.stairCompactCobblestone.blockID, 3), 2, 1, 6, structureboundingbox);
        placeBlockAtCurrentPosition(world, Block.stairCompactCobblestone.blockID, func_35009_c(Block.stairCompactCobblestone.blockID, 3), 3, 1, 5, structureboundingbox);
        placeBlockAtCurrentPosition(world, Block.stairCompactCobblestone.blockID, func_35009_c(Block.stairCompactCobblestone.blockID, 1), 1, 2, 7, structureboundingbox);
        placeBlockAtCurrentPosition(world, Block.stairCompactCobblestone.blockID, func_35009_c(Block.stairCompactCobblestone.blockID, 0), 3, 2, 7, structureboundingbox);
        placeBlockAtCurrentPosition(world, Block.thinGlass.blockID, 0, 0, 2, 2, structureboundingbox);
        placeBlockAtCurrentPosition(world, Block.thinGlass.blockID, 0, 0, 3, 2, structureboundingbox);
        placeBlockAtCurrentPosition(world, Block.thinGlass.blockID, 0, 4, 2, 2, structureboundingbox);
        placeBlockAtCurrentPosition(world, Block.thinGlass.blockID, 0, 4, 3, 2, structureboundingbox);
        placeBlockAtCurrentPosition(world, Block.thinGlass.blockID, 0, 0, 6, 2, structureboundingbox);
        placeBlockAtCurrentPosition(world, Block.thinGlass.blockID, 0, 0, 7, 2, structureboundingbox);
        placeBlockAtCurrentPosition(world, Block.thinGlass.blockID, 0, 4, 6, 2, structureboundingbox);
        placeBlockAtCurrentPosition(world, Block.thinGlass.blockID, 0, 4, 7, 2, structureboundingbox);
        placeBlockAtCurrentPosition(world, Block.thinGlass.blockID, 0, 2, 6, 0, structureboundingbox);
        placeBlockAtCurrentPosition(world, Block.thinGlass.blockID, 0, 2, 7, 0, structureboundingbox);
        placeBlockAtCurrentPosition(world, Block.thinGlass.blockID, 0, 2, 6, 4, structureboundingbox);
        placeBlockAtCurrentPosition(world, Block.thinGlass.blockID, 0, 2, 7, 4, structureboundingbox);
        placeBlockAtCurrentPosition(world, Block.thinGlass.blockID, 0, 0, 3, 6, structureboundingbox);
        placeBlockAtCurrentPosition(world, Block.thinGlass.blockID, 0, 4, 3, 6, structureboundingbox);
        placeBlockAtCurrentPosition(world, Block.thinGlass.blockID, 0, 2, 3, 8, structureboundingbox);
        placeBlockAtCurrentPosition(world, Block.torchWood.blockID, 0, 2, 4, 7, structureboundingbox);
        placeBlockAtCurrentPosition(world, Block.torchWood.blockID, 0, 1, 4, 6, structureboundingbox);
        placeBlockAtCurrentPosition(world, Block.torchWood.blockID, 0, 3, 4, 6, structureboundingbox);
        placeBlockAtCurrentPosition(world, Block.torchWood.blockID, 0, 2, 4, 5, structureboundingbox);

thats the church and i dont understand anything about it xD
well the placements at least lol
is there a program i can use the i build it on there then it gen this code?
avatar
austin56101
Moderator
Moderator

Posts : 85
Join date : 2011-10-22
Age : 21
Location : Cali!

View user profile

Back to top Go down

Re: [1.8.1] Structure Maker

Post by Strengthowns on Tue Oct 25, 2011 8:39 am

I don't know where you got that code from, just use my sort of code.
avatar
Strengthowns
Admin

Posts : 79
Join date : 2011-06-14
Location : Right here!

View user profile http://www.mcmodding.4umer.com

Back to top Go down

Re: [1.8.1] Structure Maker

Post by groxmapper on Tue Oct 25, 2011 1:42 pm

Strengthowns wrote:I don't know where you got that code from, just use my sort of code.

He got it from actual Structure**** files used to generate villages, strongholds and I think nether fortresses. Stuff in there's a fair bit more complicated than normal generation. (prolly so everything fits together in pieces?)
avatar
groxmapper
Member

Posts : 27
Join date : 2011-10-24

View user profile

Back to top Go down

Re: [1.8.1] Structure Maker

Post by austin56101 on Tue Oct 25, 2011 4:59 pm

Yeah I did
But do you know of a program?^
avatar
austin56101
Moderator
Moderator

Posts : 85
Join date : 2011-10-22
Age : 21
Location : Cali!

View user profile

Back to top Go down

Re: [1.8.1] Structure Maker

Post by lcass on Tue Oct 25, 2011 6:11 pm

Ok austin all the bits that go 10,5,0,2,3, there the coords of the blocks also thats notch's he uses a seperate class file for the npc village that converts it into a readable coord format

lcass
Member

Posts : 145
Join date : 2011-10-24
Location : england

View user profile http://www.youtube.com/user/thealcasgroup

Back to top Go down

Re: [1.8.1] Structure Maker

Post by the undecided t on Wed Oct 26, 2011 3:29 am

use his cod eit works fine
avatar
the undecided t
Helper

Posts : 45
Join date : 2011-10-20
Age : 21

View user profile http://www.blacklistgaming.org/forums

Back to top Go down

Re: [1.8.1] Structure Maker

Post by lcass on Wed Oct 26, 2011 4:10 pm

look if yo uwant a demo on how to use it I will gladly do one here is my code. it makes a hut (need to fix the doors)
Code:
package net.minecraft.src;

public class hut extends Block
{
    private World worldObj;

  protected hut(int i, int j)
    {
        super(i, j, Material.ground);
    }
 
  public void onBlockClicked(World world, int i, int j, int k, EntityPlayer entityplayer)
    {       
     world.setBlockWithNotify(i, j, k, Block.planks.blockID);
     world.setBlockWithNotify(i, j, k+1, Block.planks.blockID);
     world.setBlockWithNotify(i, j, k+2, Block.planks.blockID);
     world.setBlockWithNotify(i, j, k+3, Block.planks.blockID);
     world.setBlockWithNotify(i, j, k+4, Block.planks.blockID);
     world.setBlockWithNotify(i, j, k+5, Block.planks.blockID);
     world.setBlockWithNotify(i+1, j, k, Block.planks.blockID);
     world.setBlockWithNotify(i+1, j, k+1, Block.planks.blockID);
     world.setBlockWithNotify(i+1, j, k+2, Block.planks.blockID);
     world.setBlockWithNotify(i+1, j, k+3, Block.planks.blockID);
     world.setBlockWithNotify(i+1, j, k+4, Block.planks.blockID);
     world.setBlockWithNotify(i+1, j, k+5, Block.planks.blockID);
     world.setBlockWithNotify(i+2, j, k, Block.planks.blockID);
     world.setBlockWithNotify(i+2, j, k+1, Block.planks.blockID);
     world.setBlockWithNotify(i+2, j, k+2, Block.planks.blockID);
     world.setBlockWithNotify(i+2, j, k+3, Block.planks.blockID);
     world.setBlockWithNotify(i+2, j, k+4, Block.planks.blockID);
     world.setBlockWithNotify(i+2, j, k+5, Block.planks.blockID);
     world.setBlockWithNotify(i+3, j, k, Block.planks.blockID);
     world.setBlockWithNotify(i+3, j, k+1, Block.planks.blockID);
     world.setBlockWithNotify(i+3, j, k+2, Block.planks.blockID);
     world.setBlockWithNotify(i+3, j, k+3, Block.planks.blockID);
     world.setBlockWithNotify(i+3, j, k+4, Block.planks.blockID);
     world.setBlockWithNotify(i+3, j, k+5, Block.planks.blockID);
     world.setBlockWithNotify(i+4, j, k, Block.planks.blockID);
     world.setBlockWithNotify(i+4, j, k+1, Block.planks.blockID);
     world.setBlockWithNotify(i+4, j, k+2, Block.planks.blockID);
     world.setBlockWithNotify(i+4, j, k+3, Block.planks.blockID);
     world.setBlockWithNotify(i+4, j, k+4, Block.planks.blockID);
     world.setBlockWithNotify(i+4, j, k+5, Block.planks.blockID);
     world.setBlockWithNotify(i+5, j, k, Block.planks.blockID);
     world.setBlockWithNotify(i+5, j, k+1, Block.planks.blockID);
     world.setBlockWithNotify(i+5, j, k+2, Block.planks.blockID);
     world.setBlockWithNotify(i+5, j, k+3, Block.planks.blockID);
     world.setBlockWithNotify(i+5, j, k+4, Block.planks.blockID);
     world.setBlockWithNotify(i+5, j, k+5, Block.planks.blockID);
     world.setBlockWithNotify(i, j+1, k, Block.planks.blockID);
     world.setBlockWithNotify(i+2, j+1, k+1, Block.chest.blockID);
     world.setBlockWithNotify(i+3, j+1, k+1, Block.chest.blockID);
     world.setBlockWithNotify(i+1, j+1, k+1, Block.workbench.blockID);
     world.setBlockWithNotify(i+3, j+1, k+3, Block.torchWood.blockID);
     world.setBlockWithNotify(i+1, j+1, k, Block.planks.blockID);
     world.setBlockWithNotify(i+2, j+1, k, Block.planks.blockID);
     world.setBlockWithNotify(i+3, j+1, k, Block.planks.blockID);
     world.setBlockWithNotify(i+4, j+1, k, Block.planks.blockID);
     world.setBlockWithNotify(i+5, j+1, k, Block.planks.blockID);
     world.setBlockWithNotify(i+5, j+1, k+1, Block.doorWood.blockID);
     world.setBlockWithNotify(i+5, j+1, k+2, Block.planks.blockID);
     world.setBlockWithNotify(i+5, j+1, k+3, Block.planks.blockID);
     world.setBlockWithNotify(i+5, j+1, k+4, Block.planks.blockID);
     world.setBlockWithNotify(i+5, j+1, k+5, Block.planks.blockID);
     world.setBlockWithNotify(i+4, j+1, k+5, Block.planks.blockID);
     world.setBlockWithNotify(i+3, j+1, k+5, Block.planks.blockID);
     world.setBlockWithNotify(i+2, j+1, k+5, Block.planks.blockID);
     world.setBlockWithNotify(i+1, j+1, k+5, Block.planks.blockID);
     world.setBlockWithNotify(i, j+1, k+5, Block.planks.blockID);
     world.setBlockWithNotify(i, j+1, k+4, Block.planks.blockID);
     world.setBlockWithNotify(i, j+1, k+3, Block.planks.blockID);
     world.setBlockWithNotify(i, j+1, k+2, Block.planks.blockID);
     world.setBlockWithNotify(i, j+1, k+1, Block.planks.blockID);
     world.setBlockWithNotify(i, j+1, k, Block.planks.blockID);
     world.setBlockWithNotify(i, j+2, k, Block.planks.blockID);
     world.setBlockWithNotify(i, j+2, k+1, Block.planks.blockID);
     world.setBlockWithNotify(i, j+2, k+2, Block.glass.blockID);
     world.setBlockWithNotify(i, j+2, k+3, Block.glass.blockID);
     world.setBlockWithNotify(i, j+2, k+4, Block.glass.blockID);
     world.setBlockWithNotify(i, j+2, k+5, Block.planks.blockID);
     world.setBlockWithNotify(i+1, j+2, k+5, Block.planks.blockID);
     world.setBlockWithNotify(i+2, j+2, k+5, Block.glass.blockID);
     world.setBlockWithNotify(i+3, j+2, k+5, Block.glass.blockID);
     world.setBlockWithNotify(i+4, j+2, k+5, Block.glass.blockID);
     world.setBlockWithNotify(i+5, j+2, k+5, Block.planks.blockID);
     world.setBlockWithNotify(i+5, j+2, k+4, Block.planks.blockID);
     world.setBlockWithNotify(i+5, j+2, k+3, Block.glass.blockID);
     world.setBlockWithNotify(i+5, j+2, k+2, Block.glass.blockID);
     world.setBlockWithNotify(i+5, j+2, k, Block.planks.blockID);
     world.setBlockWithNotify(i+4, j+2, k, Block.planks.blockID);
     world.setBlockWithNotify(i+3, j+2, k, Block.glass.blockID);
     world.setBlockWithNotify(i+2, j+2, k, Block.glass.blockID);
     world.setBlockWithNotify(i+1, j+2, k, Block.glass.blockID);
     world.setBlockWithNotify(i, j+2, k, Block.planks.blockID);
     world.setBlockWithNotify(i, j+3, k, Block.planks.blockID);
     world.setBlockWithNotify(i, j+3, k+1, Block.planks.blockID);
     world.setBlockWithNotify(i, j+3, k+2, Block.planks.blockID);
     world.setBlockWithNotify(i, j+3, k+3, Block.planks.blockID);
     world.setBlockWithNotify(i, j+3, k+4, Block.planks.blockID);
     world.setBlockWithNotify(i, j+3, k+5, Block.planks.blockID);
     world.setBlockWithNotify(i+1, j+3, k, Block.planks.blockID);
     world.setBlockWithNotify(i+1, j+3, k+1, Block.planks.blockID);
     world.setBlockWithNotify(i+1, j+3, k+2, Block.planks.blockID);
     world.setBlockWithNotify(i+1, j+3, k+3, Block.planks.blockID);
     world.setBlockWithNotify(i+1, j+3, k+4, Block.planks.blockID);
     world.setBlockWithNotify(i+1, j+3, k+5, Block.planks.blockID);
     world.setBlockWithNotify(i+2, j+3, k, Block.planks.blockID);
     world.setBlockWithNotify(i+2, j+3, k+1, Block.planks.blockID);
     world.setBlockWithNotify(i+2, j+3, k+2, Block.planks.blockID);
     world.setBlockWithNotify(i+2, j+3, k+3, Block.planks.blockID);
     world.setBlockWithNotify(i+2, j+3, k+4, Block.planks.blockID);
     world.setBlockWithNotify(i+2, j+3, k+5, Block.planks.blockID);
     world.setBlockWithNotify(i+3, j+3, k, Block.planks.blockID);
     world.setBlockWithNotify(i+3, j+3, k+1, Block.planks.blockID);
     world.setBlockWithNotify(i+3, j+3, k+2, Block.planks.blockID);
     world.setBlockWithNotify(i+3, j+3, k+3, Block.planks.blockID);
     world.setBlockWithNotify(i+3, j+3, k+4, Block.planks.blockID);
     world.setBlockWithNotify(i+3, j+3, k+5, Block.planks.blockID);
     world.setBlockWithNotify(i+4, j+3, k, Block.planks.blockID);
     world.setBlockWithNotify(i+4, j+3, k+1, Block.planks.blockID);
     world.setBlockWithNotify(i+4, j+3, k+2, Block.planks.blockID);
     world.setBlockWithNotify(i+4, j+3, k+3, Block.planks.blockID);
     world.setBlockWithNotify(i+4, j+3, k+4, Block.planks.blockID);
     world.setBlockWithNotify(i+4, j+3, k+5, Block.planks.blockID);
     world.setBlockWithNotify(i+5, j+3, k, Block.planks.blockID);
     world.setBlockWithNotify(i+5, j+3, k+1, Block.planks.blockID);
     world.setBlockWithNotify(i+5, j+3, k+2, Block.planks.blockID);
     world.setBlockWithNotify(i+5, j+3, k+3, Block.planks.blockID);
     world.setBlockWithNotify(i+5, j+3, k+4, Block.planks.blockID);
     world.setBlockWithNotify(i+5, j+3, k+5, Block.planks.blockID);

    
    
    }
}
think of i,j,k = 0 as starting point i+1 is x+1 from the origonal point where you placed the block I suggest drawing down each level and then doing that

lcass
Member

Posts : 145
Join date : 2011-10-24
Location : england

View user profile http://www.youtube.com/user/thealcasgroup

Back to top Go down

Re: [1.8.1] Structure Maker

Post by IRRob on Thu Oct 27, 2011 3:51 am

this might sound really stupid but... could someone help me on the X,Y and Z axis pait please(i,j and k) Razz
avatar
IRRob
Member

Posts : 2
Join date : 2011-10-27
Age : 20
Location : liverpool

View user profile

Back to top Go down

Re: [1.8.1] Structure Maker

Post by the undecided t on Thu Oct 27, 2011 3:56 am

that is the whole thing... what exactly do you need help with
avatar
the undecided t
Helper

Posts : 45
Join date : 2011-10-20
Age : 21

View user profile http://www.blacklistgaming.org/forums

Back to top Go down

Re: [1.8.1] Structure Maker

Post by austin56101 on Thu Oct 27, 2011 3:58 am

this does seem pretty complex, ima hold up on it for a while Smile
avatar
austin56101
Moderator
Moderator

Posts : 85
Join date : 2011-10-22
Age : 21
Location : Cali!

View user profile

Back to top Go down

Re: [1.8.1] Structure Maker

Post by IRRob on Thu Oct 27, 2011 4:00 am

like, if i wanted say a 10x10x10 square would the coords be i+10 k+10 j+10.(or something like that?) oh and hi again its ftmproductions from youtube Very Happy
avatar
IRRob
Member

Posts : 2
Join date : 2011-10-27
Age : 20
Location : liverpool

View user profile

Back to top Go down

Re: [1.8.1] Structure Maker

Post by groxmapper on Thu Oct 27, 2011 4:29 am

IRRob wrote:like, if i wanted say a 10x10x10 square would the coords be i+10 k+10 j+10.(or something like that?) oh and hi again its ftmproductions from youtube Very Happy

Code:
int size = 10;
for(int x = 0; x < size; x++)
{
for(int y = 0; y < size; y++)
{
for(int z = 0; z < size; z++)
{
world.setBlockWithNotify(i + x, j + y, k + z, 1);
}
}
}

This would make a 10 X 10 filled (NOT hollow) block of stone. This is the most basic way of doing it; it has no checks to see if it would fit and has no checks for any other random requirement; it will work every time.
avatar
groxmapper
Member

Posts : 27
Join date : 2011-10-24

View user profile

Back to top Go down

Re: [1.8.1] Structure Maker

Post by the undecided t on Thu Oct 27, 2011 5:22 am

lol my code for a house does not use any loops... 1 line of code per block... lots of lines!
avatar
the undecided t
Helper

Posts : 45
Join date : 2011-10-20
Age : 21

View user profile http://www.blacklistgaming.org/forums

Back to top Go down

Re: [1.8.1] Structure Maker

Post by lcass on Thu Oct 27, 2011 11:09 am

the undecided t wrote:lol my code for a house does not use any loops... 1 line of code per block... lots of lines!
how did you do it then I would like to know belive me I plan on making a mansion block I cant really be botherd doing what I am now

lcass
Member

Posts : 145
Join date : 2011-10-24
Location : england

View user profile http://www.youtube.com/user/thealcasgroup

Back to top Go down

Re: [1.8.1] Structure Maker

Post by ikke009 on Thu Oct 27, 2011 11:25 am

Then you use the setblockwithnotify method as described above your post. you put a line of this:
world.setBlockWithNotify(i, j + 1, k, Block.dirt.blockID);

for every block, right now the j + 1 stand for it sets a block 1 block above the block you clicked, since j = y and y is the vertical axis
if you want to make a 3x3 square with the block you click in the middle it would be:
Code:
      world.setBlockWithNotify(i, j, k, Block.dirt.blockID);     
world.setBlockWithNotify(i + 1, j, k, Block.dirt.blockID);     
world.setBlockWithNotify(i - 1, j, k, Block.dirt.blockID);     
world.setBlockWithNotify(i + 1, j, k + 1, Block.dirt.blockID);     
world.setBlockWithNotify(i, j, k + 1, Block.dirt.blockID);     
world.setBlockWithNotify(i - 1, j, k + 1, Block.dirt.blockID);     
world.setBlockWithNotify(i, j, k - 1, Block.dirt.blockID);     
world.setBlockWithNotify(i + 1, j, k - 1, Block.dirt.blockID);     
world.setBlockWithNotify(i - 1, j, k - 1, Block.dirt.blockID);
avatar
ikke009
Member

Posts : 65
Join date : 2011-10-24
Age : 22
Location : The netherlands

View user profile

Back to top Go down

Re: [1.8.1] Structure Maker

Post by lcass on Thu Oct 27, 2011 7:11 pm

No I don't mean like that I mean like in theudecidedT's code he got from the village my items change ALOT

lcass
Member

Posts : 145
Join date : 2011-10-24
Location : england

View user profile http://www.youtube.com/user/thealcasgroup

Back to top Go down

Re: [1.8.1] Structure Maker

Post by The Snoo on Wed Nov 09, 2011 8:07 pm

Love the tutorials. Especially this one. Smile Curious, is there a way to randomly place a certain block in in the structure? Like, for instance, the occasional mossy cobblestone in a cobble structure? It would be nice to randomize the structures a bit so that they're not always the same.

The Snoo
Member

Posts : 1
Join date : 2011-11-09

View user profile

Back to top Go down

Re: [1.8.1] Structure Maker

Post by lcass on Thu Nov 10, 2011 12:50 am

How would I make the structure generate in the world

lcass
Member

Posts : 145
Join date : 2011-10-24
Location : england

View user profile http://www.youtube.com/user/thealcasgroup

Back to top Go down

Re: [1.8.1] Structure Maker

Post by Sponsored content


Sponsored content


Back to top Go down

View previous topic View next topic Back to top


 
Permissions in this forum:
You cannot reply to topics in this forum