Jump to content

Recommended Posts

Posted

I have written code for a custom tree, but it doesn't generate no matter how much I tweak the code. I'm totally lost and don't know what to do.

If it helps, I copied the code used by WorldGenTrees and replaced some of the variables.

 

The relevant files are:

 

package insanegravy.herbcraft.common;

import java.util.Random;

import net.minecraft.src.IChunkProvider;
import net.minecraft.src.World;
import net.minecraft.src.WorldGenMinable;
import cpw.mods.fml.common.IWorldGenerator;

public class HerbcraftWorldGenerator implements IWorldGenerator {

@Override
public void generate(Random random, int chunkX, int chunkZ, World world,
		IChunkProvider chunkGenerator, IChunkProvider chunkProvider) {
	switch(world.provider.dimensionId) {
	case -1: generateNether(world, random, chunkX*16, chunkZ*16);
	case 0: generateSurface(world, random, chunkX*16, chunkZ*16);
	}
}

private void generateSurface(World world, Random random, int i, int j) {
	/*
	for (int n = 0; n < 30; n++) {
		int X = i + random.nextInt(16);
		int Z = j + random.nextInt(16);
		int Y = random.nextInt(61);

		(new WorldGenMinable(modHerbcraft.OreTin.blockID, 5)).generate(world, random, X, Y, Z);
	}

	for (int n = 0; n < 3; n++) {
		int X = i + random.nextInt(16);
		int Z = j + random.nextInt(16);
		int Y = random.nextInt(51);

		(new WorldGenMinable(modHerbcraft.OreAthentumite.blockID, 1)).generate(world, random, X, Y, Z);
	}*/

	for (int n = 0; n < 100; n++) {
		int X = i + random.nextInt(16);
		int Z = j + random.nextInt(16);
		int Y = random.nextInt();

		(new WorldGenObbywood(true)).generate(world, random, X, Y, Z);
	}
}

private void generateNether(World world, Random random, int i, int j) {

}

}

 

package insanegravy.herbcraft.common;

import java.util.Random;

import net.minecraft.src.Block;
import net.minecraft.src.Direction;
import net.minecraft.src.World;
import net.minecraft.src.WorldGenTrees;
import net.minecraft.src.WorldGenerator;


public class WorldGenObbywood extends WorldGenerator {
/** The minimum height of a generated tree. */
    private final int minTreeHeight;

    /** True if this tree should grow Vines. */
    private final boolean vinesGrow;

    /** The metadata value of the wood to use in tree generation. */
    private final int metaWood;

    /** The metadata value of the leaves to use in tree generation. */
    private final int metaLeaves;

    public WorldGenObbywood(boolean par1)
    {
        this(par1, 4, 0, 0, false);
    }

    public WorldGenObbywood(boolean par1, int par2, int par3, int par4, boolean par5)
    {
        super(par1);
        this.minTreeHeight = par2;
        this.metaWood = par3;
        this.metaLeaves = par4;
        this.vinesGrow = par5;
    }

    public boolean generate(World par1World, Random par2Random, int par3, int par4, int par5)
    {
        int var6 = par2Random.nextInt(3) + this.minTreeHeight;
        boolean var7 = true;

        if (par4 >= 1 && par4 + var6 + 1 <= 256)
        {
            int var8;
            byte var9;
            int var11;
            int var12;

            for (var8 = par4; var8 <= par4 + 1 + var6; ++var8)
            {
                var9 = 1;

                if (var8 == par4)
                {
                    var9 = 0;
                }

                if (var8 >= par4 + 1 + var6 - 2)
                {
                    var9 = 2;
                }

                for (int var10 = par3 - var9; var10 <= par3 + var9 && var7; ++var10)
                {
                    for (var11 = par5 - var9; var11 <= par5 + var9 && var7; ++var11)
                    {
                        if (var8 >= 0 && var8 < 256)
                        {
                            var12 = par1World.getBlockId(var10, var8, var11);

                            Block block = Block.blocksList[var12];

                            if (var12 != 0 &&
                               !block.isLeaves(par1World, var10, var8, var11) &&
                                var12 != Block.grass.blockID &&
                                var12 != Block.dirt.blockID &&
                               !block.isWood(par1World, var10, var8, var11))
                            {
                                var7 = false;
                            }
                        }
                        else
                        {
                            var7 = false;
                        }
                    }
                }
            }

            if (!var7)
            {
                return false;
            }
            else
            {
                var8 = par1World.getBlockId(par3, par4 - 1, par5);

                if ((var8 == Block.grass.blockID || var8 == Block.dirt.blockID) && par4 < 256 - var6 - 1)
                {
                    this.setBlock(par1World, par3, par4 - 1, par5, Block.dirt.blockID);
                    var9 = 3;
                    byte var18 = 0;
                    int var13;
                    int var14;
                    int var15;

                    for (var11 = par4 - var9 + var6; var11 <= par4 + var6; ++var11)
                    {
                        var12 = var11 - (par4 + var6);
                        var13 = var18 + 1 - var12 / 2;

                        for (var14 = par3 - var13; var14 <= par3 + var13; ++var14)
                        {
                            var15 = var14 - par3;

                            for (int var16 = par5 - var13; var16 <= par5 + var13; ++var16)
                            {
                                int var17 = var16 - par5;

                                Block block = Block.blocksList[par1World.getBlockId(var14, var11, var16)];

                                if ((Math.abs(var15) != var13 || Math.abs(var17) != var13 || par2Random.nextInt(2) != 0 && var12 != 0) &&
                                    (block == null || block.canBeReplacedByLeaves(par1World, var14, var11, var16)))
                                {
                                    this.setBlockAndMetadata(par1World, var14, var11, var16, modHerbcraft.Desertleaves.blockID, this.metaLeaves);
                                }
                            }
                        }
                    }

                    for (var11 = 0; var11 < var6; ++var11)
                    {
                        var12 = par1World.getBlockId(par3, par4 + var11, par5);

                        Block block = Block.blocksList[var12];

                        if (var12 == 0 || block == null || block.isLeaves(par1World, par3, par4 + var11, par5))
                        {
                            this.setBlockAndMetadata(par1World, par3, par4 + var11, par5, modHerbcraft.Desertwood.blockID, this.metaWood);

                            if (this.vinesGrow && var11 > 0)
                            {
                                if (par2Random.nextInt(3) > 0 && par1World.isAirBlock(par3 - 1, par4 + var11, par5))
                                {
                                    this.setBlockAndMetadata(par1World, par3 - 1, par4 + var11, par5, Block.vine.blockID, ;
                                }

                                if (par2Random.nextInt(3) > 0 && par1World.isAirBlock(par3 + 1, par4 + var11, par5))
                                {
                                    this.setBlockAndMetadata(par1World, par3 + 1, par4 + var11, par5, Block.vine.blockID, 2);
                                }

                                if (par2Random.nextInt(3) > 0 && par1World.isAirBlock(par3, par4 + var11, par5 - 1))
                                {
                                    this.setBlockAndMetadata(par1World, par3, par4 + var11, par5 - 1, Block.vine.blockID, 1);
                                }

                                if (par2Random.nextInt(3) > 0 && par1World.isAirBlock(par3, par4 + var11, par5 + 1))
                                {
                                    this.setBlockAndMetadata(par1World, par3, par4 + var11, par5 + 1, Block.vine.blockID, 4);
                                }
                            }
                        }
                    }

                    if (this.vinesGrow)
                    {
                        for (var11 = par4 - 3 + var6; var11 <= par4 + var6; ++var11)
                        {
                            var12 = var11 - (par4 + var6);
                            var13 = 2 - var12 / 2;

                            for (var14 = par3 - var13; var14 <= par3 + var13; ++var14)
                            {
                                for (var15 = par5 - var13; var15 <= par5 + var13; ++var15)
                                {
                                    Block block = Block.blocksList[par1World.getBlockId(var14, var11, var15)];
                                    if (block != null && block.isLeaves(par1World, var14, var11, var15))
                                    {
                                        if (par2Random.nextInt(4) == 0 && par1World.getBlockId(var14 - 1, var11, var15) == 0)
                                        {
                                            this.growVines(par1World, var14 - 1, var11, var15, ;
                                        }

                                        if (par2Random.nextInt(4) == 0 && par1World.getBlockId(var14 + 1, var11, var15) == 0)
                                        {
                                            this.growVines(par1World, var14 + 1, var11, var15, 2);
                                        }

                                        if (par2Random.nextInt(4) == 0 && par1World.getBlockId(var14, var11, var15 - 1) == 0)
                                        {
                                            this.growVines(par1World, var14, var11, var15 - 1, 1);
                                        }

                                        if (par2Random.nextInt(4) == 0 && par1World.getBlockId(var14, var11, var15 + 1) == 0)
                                        {
                                            this.growVines(par1World, var14, var11, var15 + 1, 4);
                                        }
                                    }
                                }
                            }
                        }

                        if (par2Random.nextInt(5) == 0 && var6 > 5)
                        {
                            for (var11 = 0; var11 < 2; ++var11)
                            {
                                for (var12 = 0; var12 < 4; ++var12)
                                {
                                    if (par2Random.nextInt(4 - var11) == 0)
                                    {
                                        var13 = par2Random.nextInt(3);
                                        this.setBlockAndMetadata(par1World, par3 + Direction.offsetX[Direction.footInvisibleFaceRemap[var12]], par4 + var6 - 5 + var11, par5 + Direction.offsetZ[Direction.footInvisibleFaceRemap[var12]], Block.cocoaPlant.blockID, var13 << 2 | var12);
                                    }
                                }
                            }
                        }
                    }

                    return true;
                }
                else
                {
                    return false;
                }
            }
        }
        else
        {
            return false;
        }
    }

    /**
     * Grows vines downward from the given block for a given length. Args: World, x, starty, z, vine-length
     */
    private void growVines(World par1World, int par2, int par3, int par4, int par5)
    {
        this.setBlockAndMetadata(par1World, par2, par3, par4, Block.vine.blockID, par5);
        int var6 = 4;

        while (true)
        {
            --par3;

            if (par1World.getBlockId(par2, par3, par4) != 0 || var6 <= 0)
            {
                return;
            }

            this.setBlockAndMetadata(par1World, par2, par3, par4, Block.vine.blockID, par5);
            --var6;
        }
    }
}

Posted

nevermind, heres your problem

for (int n = 0; n < 100; n++) {
   int X = i + random.nextInt(16);
   int Z = j + random.nextInt(16);
   int Y = random.nextInt();
   
   (new WorldGenObbywood(true)).generate(world, random, X, Y, Z);
  }

fix it to this

for (int n = 0; n < 100; n++) {
   int X = i + random.nextInt(16);
   int Z = j + random.nextInt(16);
   int Y = random.nextInt(10);
   
   (new WorldGenObbywood(true)).generate(world, random, X+(i*16), Y+64, Z+(j*16));
  }

in the generate you are only spawning trees in coords x 0-16, z 0-16

The Korecraft Mod

Posted

It still doesn't work. I've tried changing the boolean to false, but that doesn't seem to do anything. Also, unless I set the loop to have a small counter size, my client runs out of memory during world creation. Am I missing something?

Posted

yes, i thought it would be a bit laggy, the i=0;i<100;i++ means that the trees will try to spawn 100 times in a single chunk

The Korecraft Mod

Posted

Figures, but I'm still missing something. All of my ores spawn normally, but the trees don't appear at all. I also checked the chunk at (0,0), and there is nothing there. Am I missing a file, or did I type something incorrectly?

Posted

It's extending WorldGenerator. I copied the generate method from WorldGenTrees, but changed a couple of lines. For example, this line

 

this.setBlockAndMetadata(par1World, var14, var11, var16, Block.leaves.blockID, this.metaLeaves);

 

reads like this instead

 

this.setBlockAndMetadata(par1World, var14, var11, var16, modHerbcraft.Desertleaves.blockID, this.metaLeaves);

Posted
  On 12/27/2012 at 8:35 PM, insane_gravy said:

It's extending WorldGenerator. I copied the generate method from WorldGenTrees, but changed a couple of lines. For example, this line

 

this.setBlockAndMetadata(par1World, var14, var11, var16, Block.leaves.blockID, this.metaLeaves);

 

reads like this instead

 

this.setBlockAndMetadata(par1World, var14, var11, var16, modHerbcraft.Desertleaves.blockID, this.metaLeaves);

you need to set the this.metaLeaves to 0 because you are not using any metadata

The Korecraft Mod

Posted

Sorry about taking so long to post this.

 

tree file:

package insanegravy.herbcraft.common;

import java.util.Random;

import net.minecraft.src.Block;
import net.minecraft.src.Direction;
import net.minecraft.src.World;
import net.minecraft.src.WorldGenTrees;
import net.minecraft.src.WorldGenerator;


public class WorldGenObbywood extends WorldGenerator {
/** The minimum height of a generated tree. */
    private final int minTreeHeight;

    /** True if this tree should grow Vines. */
    private final boolean vinesGrow;

    /** The metadata value of the wood to use in tree generation. */
    private final int metaWood;

    /** The metadata value of the leaves to use in tree generation. */
    private final int metaLeaves;

    public WorldGenObbywood(boolean par1)
    {
        this(par1, 4, 0, 0, false);
    }

    public WorldGenObbywood(boolean par1, int par2, int par3, int par4, boolean par5)
    {
        super(par1);
        this.minTreeHeight = par2;
        this.metaWood = par3;
        this.metaLeaves = par4;
        this.vinesGrow = par5;
    }

    public boolean generate(World par1World, Random par2Random, int par3, int par4, int par5)
    {
        int var6 = par2Random.nextInt(3) + this.minTreeHeight;
        boolean var7 = true;

        if (par4 >= 1 && par4 + var6 + 1 <= 256)
        {
            int var8;
            byte var9;
            int var11;
            int var12;

            for (var8 = par4; var8 <= par4 + 1 + var6; ++var8)
            {
                var9 = 1;

                if (var8 == par4)
                {
                    var9 = 0;
                }

                if (var8 >= par4 + 1 + var6 - 2)
                {
                    var9 = 2;
                }

                for (int var10 = par3 - var9; var10 <= par3 + var9 && var7; ++var10)
                {
                    for (var11 = par5 - var9; var11 <= par5 + var9 && var7; ++var11)
                    {
                        if (var8 >= 0 && var8 < 256)
                        {
                            var12 = par1World.getBlockId(var10, var8, var11);

                            Block block = Block.blocksList[var12];

                            if (var12 != 0 &&
                               !block.isLeaves(par1World, var10, var8, var11) &&
                                var12 != Block.grass.blockID &&
                                var12 != Block.dirt.blockID &&
                               !block.isWood(par1World, var10, var8, var11))
                            {
                                var7 = false;
                            }
                        }
                        else
                        {
                            var7 = false;
                        }
                    }
                }
            }

            if (!var7)
            {
                return false;
            }
            else
            {
                var8 = par1World.getBlockId(par3, par4 - 1, par5);

                if ((var8 == Block.grass.blockID || var8 == Block.dirt.blockID) && par4 < 256 - var6 - 1)
                {
                    this.setBlock(par1World, par3, par4 - 1, par5, Block.dirt.blockID);
                    var9 = 3;
                    byte var18 = 0;
                    int var13;
                    int var14;
                    int var15;

                    for (var11 = par4 - var9 + var6; var11 <= par4 + var6; ++var11)
                    {
                        var12 = var11 - (par4 + var6);
                        var13 = var18 + 1 - var12 / 2;

                        for (var14 = par3 - var13; var14 <= par3 + var13; ++var14)
                        {
                            var15 = var14 - par3;

                            for (int var16 = par5 - var13; var16 <= par5 + var13; ++var16)
                            {
                                int var17 = var16 - par5;

                                Block block = Block.blocksList[par1World.getBlockId(var14, var11, var16)];

                                if ((Math.abs(var15) != var13 || Math.abs(var17) != var13 || par2Random.nextInt(2) != 0 && var12 != 0) &&
                                    (block == null || block.canBeReplacedByLeaves(par1World, var14, var11, var16)))
                                {
                                    this.setBlockAndMetadata(par1World, var14, var11, var16, modHerbcraft.Desertleaves.blockID, this.metaLeaves);
                                }
                            }
                        }
                    }

                    for (var11 = 0; var11 < var6; ++var11)
                    {
                        var12 = par1World.getBlockId(par3, par4 + var11, par5);

                        Block block = Block.blocksList[var12];

                        if (var12 == 0 || block == null || block.isLeaves(par1World, par3, par4 + var11, par5))
                        {
                            this.setBlockAndMetadata(par1World, par3, par4 + var11, par5, modHerbcraft.Desertwood.blockID, this.metaWood);

                            if (this.vinesGrow && var11 > 0)
                            {
                                if (par2Random.nextInt(3) > 0 && par1World.isAirBlock(par3 - 1, par4 + var11, par5))
                                {
                                    this.setBlockAndMetadata(par1World, par3 - 1, par4 + var11, par5, Block.vine.blockID, ;
                                }

                                if (par2Random.nextInt(3) > 0 && par1World.isAirBlock(par3 + 1, par4 + var11, par5))
                                {
                                    this.setBlockAndMetadata(par1World, par3 + 1, par4 + var11, par5, Block.vine.blockID, 2);
                                }

                                if (par2Random.nextInt(3) > 0 && par1World.isAirBlock(par3, par4 + var11, par5 - 1))
                                {
                                    this.setBlockAndMetadata(par1World, par3, par4 + var11, par5 - 1, Block.vine.blockID, 1);
                                }

                                if (par2Random.nextInt(3) > 0 && par1World.isAirBlock(par3, par4 + var11, par5 + 1))
                                {
                                    this.setBlockAndMetadata(par1World, par3, par4 + var11, par5 + 1, Block.vine.blockID, 4);
                                }
                            }
                        }
                    }

                    if (this.vinesGrow)
                    {
                        for (var11 = par4 - 3 + var6; var11 <= par4 + var6; ++var11)
                        {
                            var12 = var11 - (par4 + var6);
                            var13 = 2 - var12 / 2;

                            for (var14 = par3 - var13; var14 <= par3 + var13; ++var14)
                            {
                                for (var15 = par5 - var13; var15 <= par5 + var13; ++var15)
                                {
                                    Block block = Block.blocksList[par1World.getBlockId(var14, var11, var15)];
                                    if (block != null && block.isLeaves(par1World, var14, var11, var15))
                                    {
                                        if (par2Random.nextInt(4) == 0 && par1World.getBlockId(var14 - 1, var11, var15) == 0)
                                        {
                                            this.growVines(par1World, var14 - 1, var11, var15, ;
                                        }

                                        if (par2Random.nextInt(4) == 0 && par1World.getBlockId(var14 + 1, var11, var15) == 0)
                                        {
                                            this.growVines(par1World, var14 + 1, var11, var15, 2);
                                        }

                                        if (par2Random.nextInt(4) == 0 && par1World.getBlockId(var14, var11, var15 - 1) == 0)
                                        {
                                            this.growVines(par1World, var14, var11, var15 - 1, 1);
                                        }

                                        if (par2Random.nextInt(4) == 0 && par1World.getBlockId(var14, var11, var15 + 1) == 0)
                                        {
                                            this.growVines(par1World, var14, var11, var15 + 1, 4);
                                        }
                                    }
                                }
                            }
                        }

                        if (par2Random.nextInt(5) == 0 && var6 > 5)
                        {
                            for (var11 = 0; var11 < 2; ++var11)
                            {
                                for (var12 = 0; var12 < 4; ++var12)
                                {
                                    if (par2Random.nextInt(4 - var11) == 0)
                                    {
                                        var13 = par2Random.nextInt(3);
                                        this.setBlockAndMetadata(par1World, par3 + Direction.offsetX[Direction.footInvisibleFaceRemap[var12]], par4 + var6 - 5 + var11, par5 + Direction.offsetZ[Direction.footInvisibleFaceRemap[var12]], Block.cocoaPlant.blockID, var13 << 2 | var12);
                                    }
                                }
                            }
                        }
                    }

                    return true;
                }
                else
                {
                    return false;
                }
            }
        }
        else
        {
            return false;
        }
    }

    /**
     * Grows vines downward from the given block for a given length. Args: World, x, starty, z, vine-length
     */
    private void growVines(World par1World, int par2, int par3, int par4, int par5)
    {
        this.setBlockAndMetadata(par1World, par2, par3, par4, Block.vine.blockID, par5);
        int var6 = 4;

        while (true)
        {
            --par3;

            if (par1World.getBlockId(par2, par3, par4) != 0 || var6 <= 0)
            {
                return;
            }

            this.setBlockAndMetadata(par1World, par2, par3, par4, Block.vine.blockID, par5);
            --var6;
        }
    }
}

 

worldgen file:

package insanegravy.herbcraft.common;

import java.util.Random;

import net.minecraft.src.IChunkProvider;
import net.minecraft.src.World;
import net.minecraft.src.WorldGenMinable;
import cpw.mods.fml.common.IWorldGenerator;

public class HerbcraftWorldGenerator implements IWorldGenerator {

@Override
public void generate(Random random, int chunkX, int chunkZ, World world,
		IChunkProvider chunkGenerator, IChunkProvider chunkProvider) {
	switch(world.provider.dimensionId) {
	case -1: generateNether(world, random, chunkX*16, chunkZ*16);
	case 0: generateSurface(world, random, chunkX*16, chunkZ*16);
	}
}

private void generateSurface(World world, Random random, int i, int j) {
	/*
	for (int n = 0; n < 30; n++) {
		int X = i + random.nextInt(16);
		int Z = j + random.nextInt(16);
		int Y = random.nextInt(61);

		(new WorldGenMinable(modHerbcraft.OreTin.blockID, 5)).generate(world, random, X, Y, Z);
	}

	for (int n = 0; n < 3; n++) {
		int X = i + random.nextInt(16);
		int Z = j + random.nextInt(16);
		int Y = random.nextInt(51);

		(new WorldGenMinable(modHerbcraft.OreAthentumite.blockID, 1)).generate(world, random, X, Y, Z);
	}*/

	//for (int n = 0; n < 5; n++) {
		   int X = i + random.nextInt(16);
		   int Z = j + random.nextInt(16);
		   int Y = random.nextInt(10);
		   
		   (new WorldGenObbywood(false)).generate(world, random, X+(i*16), Y+64, Z+(j*16));
	//}
}

private void generateNether(World world, Random random, int i, int j) {

}

}

Posted
  Quote

//for (int n = 0; n < 5; n++) {

  int X = i + random.nextInt(16);

  int Z = j + random.nextInt(16);

  int Y = random.nextInt(10);

 

  (new WorldGenObbywood(false)).generate(world, random, X+(i*16), Y+64, Z+(j*16));

//}

 

although probably just for the text I'd like to point out by saying you have ' // ' in front of your for loop and at the end ' //} '. but i think that might be just for your example.

 

The Y layer you have selected is from 64 to 74. which is a good range, but you may want to make sure where you looking for the trees is around that layer. i know in some areas it can be higher or lower.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Announcements



  • Recently Browsing

    • No registered users viewing this page.
  • Posts

    • That is incorrect. Use the run.bat or run.sh to run the server.
    • Hello, I have been trying for days to create my server with forge-1.20.1-47.4.1-installer, which installs the server, but the forge-1.20.1-47.4.1.jar file, which is necessary to create the server, does not appear. I no longer know what to do. Help. hola buenas, llevo dias intentando poder hacer mi servidor con forge-1.20.1-47.4.1-installer el cual instalo el server, pero no aparece el archivo forge-1.20.1-47.4.1.jar , el cual es necesario para poder crear el server, ya no se que hacer ayuda.
    • Does this happen if you use the regular vanilla minecraft launcher? Also, unsure if TLauncher ever has a legit usage, as I have always seen it associated with software piracy, but if it has a legit mode, make sure it is using online mode so that it can authenticate your MS account to login. Aside from that, more information is likely needed. Post logs, as well as the paths you are placing files in (screenshots of your file explorer can be helpful as well).
    • I am using a third-party launcher that has pre-installed forge versions of Minecraft.  When I insert mods from CurseForge, I extract the files and as expected put them in the .mods folder. I am guessing that there is an error with the file transfer but I don't know for sure and sometimes I use Forge to test mods that I created before releasing previously on a different pc, so I don't know if it is the if it an extraction error but if are any tips or knowledge reply and I will read it. This is also will be kept on the forum for others that have the issues.
    • I make wires and i need connection 2 wires block. I have BooleanPropertys registered, but in mod loading it show Unknown the property in assets/wuntare/blockState. public static final BooleanProperty CONNECTED_NORTH = BooleanProperty.create("connected_north"); public static final BooleanProperty CONNECTED_SOUTH = BooleanProperty.create("connected_south"); public static final BooleanProperty CONNECTED_WEST = BooleanProperty.create("connected_west"); public static final BooleanProperty CONNECTED_EAST = BooleanProperty.create("connected_east"); public static final BooleanProperty CONNECTED_UP = BooleanProperty.create("connected_up"); public static final BooleanProperty CONNECTED_DOWN = BooleanProperty.create("connected_down"); public CopperWireWithoutInsulation0(Properties properties) { super(properties); this.registerDefaultState(this.stateDefinition.any() .setValue(CONNECTED_NORTH, false) .setValue(CONNECTED_SOUTH, false) .setValue(CONNECTED_WEST, false) .setValue(CONNECTED_EAST, false) .setValue(CONNECTED_UP, false) .setValue(CONNECTED_DOWN, false)); } @Override protected void createBlockStateDefinition(StateDefinition.Builder<Block, BlockState> builder) { builder.add(CONNECTED_NORTH, CONNECTED_SOUTH, CONNECTED_WEST, CONNECTED_EAST, CONNECTED_UP, CONNECTED_DOWN); } In this part blockState have problem "multipart": [ { "apply": { "model": "wuntare:block/copper_wire_without_insulation0" } }, { "when": { "connected_north": true }, "apply": { "model": "wuntare:block/copper_wire_without_insulation0_north" } },  
  • Topics

×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.