Jump to content

[1.7.2] [UNSOLVED] MetaData Block|Item drop & Metadata block crash


Recommended Posts

Posted

Hello.

 

I've created a metadata based block, but now I have a problem. This block drops everytime itself, but I want that this block drops an Item and that the same block with an other metadata drops an other item or more of the same item.

 

Here is my code:

 

package minecraftplaye.primevalforest.blocks;


import java.util.List;

import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
import minecraftplaye.primevalforest.util.ModCreativeTabsPF;
import net.minecraft.block.Block;
import net.minecraft.block.material.Material;
import net.minecraft.client.renderer.texture.IIconRegister;
import net.minecraft.creativetab.CreativeTabs;
import net.minecraft.init.Blocks;
import net.minecraft.item.Item;
import net.minecraft.item.ItemStack;
import net.minecraft.util.IIcon;
import net.minecraft.world.IBlockAccess;
import net.minecraft.world.World;
import net.minecraftforge.common.util.ForgeDirection;

public class BlockPFDeadLog extends Block
{

public static final String[] types = new String[] {"dead", "test"};

private IIcon[] textures;
private IIcon[] logHearts;

protected BlockPFDeadLog()
{
	super(Material.wood);

	this.setHardness(1.0F);
	this.setHarvestLevel("axe", 0);
	this.setResistance(2.5F);

	this.setStepSound(Block.soundTypeWood);
	this.setCreativeTab(ModCreativeTabsPF.primevalTab);
}

@Override
@SideOnly(Side.CLIENT)
public void registerBlockIcons(IIconRegister iconRegister)
{
	textures = new IIcon[types.length];
	logHearts = new IIcon[types.length];

	for(int i = 0; i < types.length; ++i)
	{
		if(i != 11)
		{
			textures[i] = iconRegister.registerIcon("primevalforest:log_" + types[i] + "_side");
			logHearts[i] = iconRegister.registerIcon("primevalforest:log_" + types[i] + "_heart");
		}
	}
}

@Override
@SideOnly(Side.CLIENT)
public IIcon getIcon(int side, int meta)
{
	int pos = meta & 12;

	if(pos == 0 && (side == 1 || side == 0) || pos == 4 && (side ==5 || side == 4) || pos == 8 && (side == 2 || side == 3))
	{
		return logHearts[(getTypeFromMeta(meta))];
	}
	else
	{
		return textures[(getTypeFromMeta(meta))];
	}
}

@Override
@SuppressWarnings({ "unchecked", "rawtypes" })
public void getSubBlocks(Item block, CreativeTabs creativeTabs, List list)
{
	for (int i = 0; i < 2; i++)
	{
		list.add(new ItemStack(this, 1, i));
	}
}

@Override
public void breakBlock(World world, int x, int y, int z, Block blocks, int par6)
{
	byte radius = 4;
	int bounds = radius + 1;

	if(world.checkChunksExist(x - bounds, y - bounds, z - bounds, x + bounds, y + bounds, z + bounds))
	{
		for(int i = -radius; i <= radius; ++i)
		{
			for(int j = -radius; j <= radius; ++j)
			{
				for(int k = -radius; k <=radius; ++k)
				{
					Block block = world.getBlock(x + i, y + j, z + k);

					if (block.isLeaves(world, x, y, z)) 
					{
						block.beginLeavesDecay(world, x + i, y + j, z + k);
					}
				}
			}
		}
	}
}

@Override
public int onBlockPlaced(World world, int x, int y, int z, int side, float hitX, float hitY, float hitZ, int meta)
{
	int type = getTypeFromMeta(meta);
	byte orientation = 0;

	switch (side)
	{
		case 0:
		case 1:
			orientation = 0;
			break;
		case 2:
		case 3:
			orientation = 8;
			break;
		case 4:
		case 5:
			orientation = 4;
	}

	return type | orientation;
}

@Override
public int getFlammability(IBlockAccess world, int x, int y, int z, ForgeDirection face)
{
	return Blocks.fire.getFlammability(this);
}

@Override
public int getFireSpreadSpeed(IBlockAccess world, int x, int y, int z, ForgeDirection face)
{
	return Blocks.fire.getEncouragement(this);
}

@Override
public boolean isFlammable(IBlockAccess world, int x, int y, int z, ForgeDirection face)
{
	return getFlammability(world, x, y, z, face) > 0;
}

@Override
public int damageDropped(int meta)
{
	return getTypeFromMeta(meta);
}

@Override
protected ItemStack createStackedBlock(int meta)
{
	// Args: block, stackSize, itemDamage
	return new ItemStack(this, 1, getTypeFromMeta(meta));
}

@Override
public int getRenderType()
{
	return 31;
}

@Override
public boolean canSustainLeaves(IBlockAccess world, int x, int y, int z)
{
	return true;
}

@Override
public boolean isWood(IBlockAccess world, int x, int y, int z)
{
	return true;
}

public String getWoodType(int meta)
{
	return types[getTypeFromMeta(meta)];
}

private static int getTypeFromMeta(int meta)
{
	return meta & 3;
}
}

 

 

So what must I change, that the block with metadata 0 drops as an example two sticks and the block with metadata 1 drops 6 coal?

Second problem can be found here: http://www.minecraftforge.net/forum/index.php/topic,20990.msg106490.html#msg106490

 

Bektor

Developer of Primeval Forest.

Posted

Use the getDrops method, you have full control over what is dropped in which circumstance if you use it.

Ok, thanks. So how need I to use this method? (adding the different items/block that should be dropped and the quantityDropped)

Developer of Primeval Forest.

Posted

Thanks. But it seems to be, that sometimes I get an crash by the Icon (in 3 from 7 world, that I created happend it...)

 

So here is my code:

 

package minecraftplaye.primevalforest.blocks;

import java.util.List;

import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
import minecraftplaye.primevalforest.util.ModCreativeTabsPF;
import net.minecraft.block.Block;
import net.minecraft.block.material.Material;
import net.minecraft.client.renderer.texture.IIconRegister;
import net.minecraft.creativetab.CreativeTabs;
import net.minecraft.init.Blocks;
import net.minecraft.item.Item;
import net.minecraft.item.ItemStack;
import net.minecraft.util.IIcon;
import net.minecraft.world.IBlockAccess;
import net.minecraft.world.World;
import net.minecraftforge.common.util.ForgeDirection;

public class BlockPFLog extends Block
{

public static final String[] types = new String[] {"silver", "unknown"};

private IIcon[] textures;
private IIcon[] logHearts;

protected BlockPFLog()
{
	super(Material.wood);

	this.setHardness(2.0F);
	this.setHarvestLevel("axe", 0);
	this.setResistance(5.0F);

	this.setStepSound(Block.soundTypeWood);
	this.setCreativeTab(ModCreativeTabsPF.primevalTab);
}

@Override
@SideOnly(Side.CLIENT)
public void registerBlockIcons(IIconRegister iconRegister)
{
	textures = new IIcon[types.length];
	logHearts = new IIcon[types.length];

	for(int i = 0; i < types.length; ++i)
	{
		if(i != 11)
		{
			textures[i] = iconRegister.registerIcon("primevalforest:log_" + types[i] + "_side");
			logHearts[i] = iconRegister.registerIcon("primevalforest:log_" + types[i] + "_heart");
		}
	}
}

@Override
@SideOnly(Side.CLIENT)
public IIcon getIcon(int side, int meta)
{
	int pos = meta & 12;

	if(pos == 0 && (side == 1 || side == 0) || pos == 4 && (side ==5 || side == 4) || pos == 8 && (side == 2 || side == 3))
	{
		return logHearts[(getTypeFromMeta(meta))];
	}
	else
	{
		return textures[(getTypeFromMeta(meta))];
	}
}

@Override
@SuppressWarnings({ "unchecked", "rawtypes" })
public void getSubBlocks(Item block, CreativeTabs creativeTabs, List list)
{
	for (int i = 0; i < 2; i++)
		list.add(new ItemStack(this, 1, i));
}

@Override
public void breakBlock(World world, int x, int y, int z, Block blocks, int par6)
{
	byte radius = 4;
	int bounds = radius + 1;

	if(world.checkChunksExist(x - bounds, y - bounds, z - bounds, x + bounds, y + bounds, z + bounds))
	{
		for(int i = -radius; i <= radius; ++i)
		{
			for(int j = -radius; j <= radius; ++j)
			{
				for(int k = -radius; k <=radius; ++k)
				{
					Block block = world.getBlock(x + i, y + j, z + k);

					if (block.isLeaves(world, x, y, z)) 
					{
						block.beginLeavesDecay(world, x + i, y + j, z + k);
					}
				}
			}
		}
	}
}

@Override
public int onBlockPlaced(World world, int x, int y, int z, int side, float hitX, float hitY, float hitZ, int meta)
{
	int type = getTypeFromMeta(meta);
	byte orientation = 0;

	switch (side)
	{
		case 0:
		case 1:
			orientation = 0;
			break;
		case 2:
		case 3:
			orientation = 8;
			break;
		case 4:
		case 5:
			orientation = 4;
	}

	return type | orientation;
}

@Override
public int getFlammability(IBlockAccess world, int x, int y, int z, ForgeDirection face)
{
	return Blocks.fire.getFlammability(this);
}

@Override
public int getFireSpreadSpeed(IBlockAccess world, int x, int y, int z, ForgeDirection face)
{
	return Blocks.fire.getEncouragement(this);
}

@Override
public boolean isFlammable(IBlockAccess world, int x, int y, int z, ForgeDirection face)
{
	return getFlammability(world, x, y, z, face) > 0;
}

@Override
public int damageDropped(int meta)
{
	return getTypeFromMeta(meta);
}

@Override
protected ItemStack createStackedBlock(int meta)
{
	// Args: block, stackSize, itemDamage
	return new ItemStack(this, 1, getTypeFromMeta(meta));
}

@Override
public int getRenderType()
{
	return 31;
}

@Override
public boolean canSustainLeaves(IBlockAccess world, int x, int y, int z)
{
	return true;
}

@Override
public boolean isWood(IBlockAccess world, int x, int y, int z)
{
	return true;
}

public String getWoodType(int meta)
{
	return types[getTypeFromMeta(meta)];
}

private static int getTypeFromMeta(int meta)
{
	return meta & 3;
}
}

 

 

and here is the crash:

 

---- Minecraft Crash Report ----
// I'm sorry, Dave.

Time: 07.07.14 15:38
Description: Unexpected error

java.lang.ArrayIndexOutOfBoundsException: 2
at minecraftplaye.primevalforest.blocks.BlockPFLog.getIcon(BlockPFLog.java:69)
at net.minecraft.block.Block.getIcon(Block.java:554)
at net.minecraft.client.renderer.RenderBlocks.getBlockIcon(RenderBlocks.java:8198)
at net.minecraft.client.renderer.RenderBlocks.renderStandardBlockWithAmbientOcclusion(RenderBlocks.java:4655)
at net.minecraft.client.renderer.RenderBlocks.renderStandardBlock(RenderBlocks.java:4236)
at net.minecraft.client.renderer.RenderBlocks.renderBlockLog(RenderBlocks.java:4257)
at net.minecraft.client.renderer.RenderBlocks.renderBlockByRenderType(RenderBlocks.java:254)
at net.minecraft.client.renderer.WorldRenderer.updateRenderer(WorldRenderer.java:181)
at net.minecraft.client.renderer.RenderGlobal.updateRenderers(RenderGlobal.java:1545)
at net.minecraft.client.renderer.EntityRenderer.renderWorld(EntityRenderer.java:1178)
at net.minecraft.client.renderer.EntityRenderer.updateCameraAndRender(EntityRenderer.java:1011)
at net.minecraft.client.Minecraft.runGameLoop(Minecraft.java:944)
at net.minecraft.client.Minecraft.run(Minecraft.java:835)
at net.minecraft.client.main.Main.main(SourceFile:103)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
at java.lang.reflect.Method.invoke(Unknown Source)
at net.minecraft.launchwrapper.Launch.launch(Launch.java:134)
at net.minecraft.launchwrapper.Launch.main(Launch.java:28)


A detailed walkthrough of the error, its code path and all known details is as follows:
---------------------------------------------------------------------------------------

-- Head --
Stacktrace:
at minecraftplaye.primevalforest.blocks.BlockPFLog.getIcon(BlockPFLog.java:69)
at net.minecraft.block.Block.getIcon(Block.java:554)
at net.minecraft.client.renderer.RenderBlocks.getBlockIcon(RenderBlocks.java:8198)
at net.minecraft.client.renderer.RenderBlocks.renderStandardBlockWithAmbientOcclusion(RenderBlocks.java:4655)
at net.minecraft.client.renderer.RenderBlocks.renderStandardBlock(RenderBlocks.java:4236)
at net.minecraft.client.renderer.RenderBlocks.renderBlockLog(RenderBlocks.java:4257)
at net.minecraft.client.renderer.RenderBlocks.renderBlockByRenderType(RenderBlocks.java:254)
at net.minecraft.client.renderer.WorldRenderer.updateRenderer(WorldRenderer.java:181)
at net.minecraft.client.renderer.RenderGlobal.updateRenderers(RenderGlobal.java:1545)
at net.minecraft.client.renderer.EntityRenderer.renderWorld(EntityRenderer.java:1178)

-- Affected level --
Details:
Level name: MpServer
All players: 1 total; [EntityClientPlayerMP['Gamer_ABC'/274, l='MpServer', x=1955,52, y=98,77, z=2768,96]]
Chunk stats: MultiplayerChunkCache: 225, 225
Level seed: 0
Level generator: ID 00 - default, ver 1. Features enabled: false
Level generator options: 
Level spawn location: World: (192,64,256), Chunk: (at 0,4,0 in 12,16; contains blocks 192,0,256 to 207,255,271), Region: (0,0; contains chunks 0,0 to 31,31, blocks 0,0,0 to 511,255,511)
Level time: 6108 game time, 6108 day time
Level dimension: 0
Level storage version: 0x00000 - Unknown?
Level weather: Rain time: 0 (now: false), thunder time: 0 (now: false)
Level game mode: Game mode: creative (ID 1). Hardcore: false. Cheats: false
Forced entities: 127 total; [EntityClientPlayerMP['Gamer_ABC'/274, l='MpServer', x=1955,52, y=98,77, z=2768,96], EntityBat['Bat'/309, l='MpServer', x=1881,25, y=56,18, z=2720,48], EntitySkeleton['Skeleton'/310, l='MpServer', x=1887,50, y=54,00, z=2729,50], EntityBat['Bat'/311, l='MpServer', x=1877,94, y=54,27, z=2723,63], EntityChicken['Chicken'/312, l='MpServer', x=1879,16, y=64,00, z=2735,94], EntityChicken['Chicken'/313, l='MpServer', x=1887,56, y=64,00, z=2743,47], EntityBat['Bat'/314, l='MpServer', x=1885,10, y=31,82, z=2771,73], EntityZombie['Zombie'/323, l='MpServer', x=1892,50, y=54,00, z=2728,50], EntityZombie['Zombie'/324, l='MpServer', x=1891,50, y=54,00, z=2728,50], EntityBat['Bat'/325, l='MpServer', x=1885,05, y=54,04, z=2723,95], EntityChicken['Chicken'/326, l='MpServer', x=1895,34, y=64,00, z=2741,16], EntityChicken['Chicken'/327, l='MpServer', x=1893,47, y=64,00, z=2751,34], EntityZombie['Zombie'/328, l='MpServer', x=1890,50, y=15,00, z=2756,50], EntityZombie['Zombie'/329, l='MpServer', x=1904,03, y=37,00, z=2778,53], EntityZombie['Zombie'/330, l='MpServer', x=1900,50, y=35,00, z=2779,50], EntityBat['Bat'/331, l='MpServer', x=1895,14, y=33,55, z=2776,42], EntityBat['Bat'/332, l='MpServer', x=1898,45, y=33,77, z=2776,45], EntityCreeper['Creeper'/333, l='MpServer', x=1888,81, y=31,00, z=2842,34], EntityChicken['Chicken'/334, l='MpServer', x=1900,50, y=69,00, z=2843,50], EntityChicken['Chicken'/335, l='MpServer', x=1901,69, y=69,00, z=2846,81], EntityBat['Bat'/338, l='MpServer', x=1913,90, y=40,78, z=2711,52], EntitySquid['Squid'/339, l='MpServer', x=1916,53, y=61,00, z=2709,61], EntitySquid['Squid'/340, l='MpServer', x=1916,47, y=61,60, z=2714,47], EntitySpider['Spider'/341, l='MpServer', x=1910,78, y=42,69, z=2725,55], EntitySpider['Spider'/342, l='MpServer', x=1911,50, y=46,00, z=2740,50], EntityBat['Bat'/343, l='MpServer', x=1909,72, y=46,37, z=2742,49], EntityZombie['Zombie'/344, l='MpServer', x=1918,50, y=31,00, z=2828,50], EntityChicken['Chicken'/345, l='MpServer', x=1906,50, y=69,00, z=2842,50], EntityChicken['Chicken'/346, l='MpServer', x=1907,50, y=69,00, z=2842,50], EntityChicken['Chicken'/347, l='MpServer', x=1904,50, y=69,00, z=2842,50], EntityChicken['Chicken'/348, l='MpServer', x=1905,50, y=69,00, z=2847,50], EntityChicken['Chicken'/349, l='MpServer', x=1909,47, y=70,00, z=2847,53], EntityCreeper['Creeper'/365, l='MpServer', x=1928,50, y=25,00, z=2704,50], EntityBat['Bat'/366, l='MpServer', x=1934,15, y=37,14, z=2740,69], EntityPig['Pig'/367, l='MpServer', x=1929,97, y=70,00, z=2782,84], EntityPig['Pig'/368, l='MpServer', x=1921,67, y=68,67, z=2780,47], EntityPig['Pig'/369, l='MpServer', x=1921,37, y=69,00, z=2782,71], EntityPig['Pig'/370, l='MpServer', x=1917,93, y=70,00, z=2779,47], EntitySkeleton['Skeleton'/371, l='MpServer', x=1920,53, y=32,00, z=2829,72], EntityCreeper['Creeper'/372, l='MpServer', x=1923,50, y=36,00, z=2822,50], EntityCreeper['Creeper'/380, l='MpServer', x=1944,53, y=14,07, z=2702,37], EntityCreeper['Creeper'/381, l='MpServer', x=1943,63, y=14,02, z=2703,97], EntityZombie['Zombie'/382, l='MpServer', x=1945,50, y=25,00, z=2700,50], EntityCreeper['Creeper'/383, l='MpServer', x=1941,50, y=25,00, z=2702,50], EntityPig['Pig'/384, l='MpServer', x=1943,88, y=64,00, z=2753,97], EntityPig['Pig'/385, l='MpServer', x=1942,50, y=69,00, z=2842,50], EntityPig['Pig'/386, l='MpServer', x=1937,18, y=69,00, z=2849,13], EntityPig['Pig'/387, l='MpServer', x=1938,31, y=69,00, z=2843,69], EntityPig['Pig'/388, l='MpServer', x=1946,44, y=72,00, z=2847,47], EntityPig['Pig'/395, l='MpServer', x=1958,94, y=65,00, z=2742,47], EntityPig['Pig'/396, l='MpServer', x=1957,13, y=65,00, z=2742,59], EntityPig['Pig'/397, l='MpServer', x=1957,22, y=65,00, z=2740,84], EntityEnderman['Enderman'/398, l='MpServer', x=1966,78, y=51,00, z=2824,84], EntityPig['Pig'/399, l='MpServer', x=1954,75, y=68,00, z=2816,26], EntityPig['Pig'/400, l='MpServer', x=1964,31, y=69,00, z=2825,88], EntityPig['Pig'/401, l='MpServer', x=1959,90, y=68,00, z=2814,18], EntityPig['Pig'/402, l='MpServer', x=1970,69, y=69,00, z=2822,49], EntityCreeper['Creeper'/406, l='MpServer', x=1973,56, y=22,00, z=2691,00], EntityCreeper['Creeper'/407, l='MpServer', x=1982,50, y=38,00, z=2695,50], EntityCreeper['Creeper'/408, l='MpServer', x=1981,50, y=38,00, z=2695,50], EntityCreeper['Creeper'/409, l='MpServer', x=1972,50, y=41,00, z=2702,50], EntityItem['item.tile.mushroom'/410, l='MpServer', x=1976,22, y=12,13, z=2707,88], EntityItem['item.tile.mushroom'/411, l='MpServer', x=1981,59, y=13,13, z=2707,09], EntityZombie['Zombie'/412, l='MpServer', x=1983,50, y=23,00, z=2705,50], EntityZombie['Zombie'/413, l='MpServer', x=1972,84, y=25,00, z=2713,50], EntityZombie['Zombie'/414, l='MpServer', x=1973,69, y=25,00, z=2713,50], EntityBat['Bat'/415, l='MpServer', x=1979,36, y=27,92, z=2717,78], EntitySkeleton['Skeleton'/416, l='MpServer', x=1978,44, y=41,00, z=2711,25], EntityCreeper['Creeper'/417, l='MpServer', x=1977,47, y=41,00, z=2709,91], EntityCreeper['Creeper'/418, l='MpServer', x=1973,50, y=41,00, z=2705,50], EntityZombie['Zombie'/419, l='MpServer', x=1975,31, y=41,00, z=2708,69], EntityZombie['Zombie'/420, l='MpServer', x=1977,02, y=38,00, z=2719,08], EntitySkeleton['Skeleton'/421, l='MpServer', x=1976,10, y=38,00, z=2719,65], EntityZombie['Zombie'/422, l='MpServer', x=1979,50, y=39,00, z=2717,94], EntityCreeper['Creeper'/423, l='MpServer', x=1980,53, y=29,00, z=2721,99], EntityCreeper['Creeper'/424, l='MpServer', x=1980,31, y=29,00, z=2724,25], EntityBat['Bat'/425, l='MpServer', x=1968,56, y=16,04, z=2720,15], EntityCreeper['Creeper'/426, l='MpServer', x=1972,64, y=38,00, z=2719,56], EntitySkeleton['Skeleton'/427, l='MpServer', x=1977,10, y=38,00, z=2720,50], EntityCow['Cow'/428, l='MpServer', x=1981,50, y=63,00, z=2725,22], EntityCow['Cow'/429, l='MpServer', x=1977,84, y=65,00, z=2734,50], EntityCow['Cow'/430, l='MpServer', x=1983,50, y=65,00, z=2734,50], EntityCow['Cow'/431, l='MpServer', x=1979,56, y=65,00, z=2731,50], EntitySkeleton['Skeleton'/432, l='MpServer', x=1982,50, y=29,00, z=2740,50], EntityPig['Pig'/433, l='MpServer', x=1976,47, y=66,00, z=2807,75], EntityPig['Pig'/434, l='MpServer', x=1970,97, y=68,00, z=2823,63], EntityPig['Pig'/435, l='MpServer', x=1971,81, y=70,00, z=2822,47], EntityPig['Pig'/436, l='MpServer', x=1972,13, y=68,00, z=2823,47], EntityPig['Pig'/437, l='MpServer', x=1983,06, y=66,00, z=2836,38], EntityEnderman['Enderman'/446, l='MpServer', x=1992,53, y=37,00, z=2704,44], EntityCreeper['Creeper'/447, l='MpServer', x=1996,50, y=37,00, z=2705,50], EntitySkeleton['Skeleton'/448, l='MpServer', x=1990,06, y=40,00, z=2716,88], EntityCreeper['Creeper'/449, l='MpServer', x=1987,47, y=32,39, z=2722,50], EntityCreeper['Creeper'/450, l='MpServer', x=1988,50, y=29,00, z=2744,50], EntityWitch['Witch'/451, l='MpServer', x=1998,97, y=20,00, z=2751,69], EntityBat['Bat'/452, l='MpServer', x=1982,64, y=35,15, z=2733,40], EntityPig['Pig'/453, l='MpServer', x=1998,63, y=64,00, z=2785,16], EntityPig['Pig'/454, l='MpServer', x=1993,65, y=64,00, z=2791,50], EntityPig['Pig'/455, l='MpServer', x=1987,47, y=66,00, z=2796,47], EntityPig['Pig'/456, l='MpServer', x=1989,46, y=64,00, z=2792,22], EntityPig['Pig'/457, l='MpServer', x=1990,22, y=65,00, z=2812,36], EntityPig['Pig'/458, l='MpServer', x=1990,94, y=65,00, z=2814,88], EntityCreeper['Creeper'/464, l='MpServer', x=2006,50, y=55,00, z=2691,50], EntityWitch['Witch'/465, l='MpServer', x=2005,57, y=39,00, z=2714,68], EntitySkeleton['Skeleton'/466, l='MpServer', x=2007,50, y=39,00, z=2712,50], EntityItem['item.tile.gravel'/467, l='MpServer', x=2014,69, y=27,13, z=2746,88], EntitySkeleton['Skeleton'/468, l='MpServer', x=2005,70, y=19,01, z=2753,05], EntityCreeper['Creeper'/469, l='MpServer', x=2006,50, y=22,00, z=2749,50], EntityCreeper['Creeper'/470, l='MpServer', x=2007,50, y=20,00, z=2767,50], EntitySquid['Squid'/471, l='MpServer', x=2013,53, y=61,44, z=2752,63], EntityCreeper['Creeper'/472, l='MpServer', x=2007,50, y=20,00, z=2770,50], EntityCreeper['Creeper'/473, l='MpServer', x=2006,50, y=20,00, z=2768,50], EntityCreeper['Creeper'/474, l='MpServer', x=2007,50, y=21,00, z=2775,50], EntityCreeper['Creeper'/475, l='MpServer', x=2007,50, y=21,00, z=2772,50], EntityPig['Pig'/476, l='MpServer', x=2002,28, y=65,00, z=2819,19], EntityZombie['Zombie'/478, l='MpServer', x=2025,53, y=33,00, z=2701,91], EntityCreeper['Creeper'/479, l='MpServer', x=2033,49, y=13,49, z=2711,53], EntityZombie['Zombie'/480, l='MpServer', x=2028,50, y=13,00, z=2711,50], EntityZombie['Zombie'/481, l='MpServer', x=2025,31, y=14,00, z=2710,44], EntityZombie['Zombie'/482, l='MpServer', x=2026,38, y=14,00, z=2713,44], EntitySkeleton['Skeleton'/483, l='MpServer', x=2030,50, y=14,00, z=2708,50], EntityItem['item.tile.gravel'/484, l='MpServer', x=2018,59, y=26,13, z=2746,13], EntityItem['item.tile.gravel'/485, l='MpServer', x=2018,38, y=21,13, z=2747,88], EntitySkeleton['Skeleton'/486, l='MpServer', x=2023,31, y=27,00, z=2737,50], EntitySkeleton['Skeleton'/487, l='MpServer', x=2028,50, y=25,00, z=2741,50], EntityBat['Bat'/488, l='MpServer', x=2030,10, y=23,04, z=2749,06], EntityBat['Bat'/489, l='MpServer', x=2021,81, y=21,75, z=2746,25]]
Retry entities: 0 total; []
Server brand: fml,forge
Server type: Integrated singleplayer server
Stacktrace:
at net.minecraft.client.multiplayer.WorldClient.addWorldInfoToCrashReport(WorldClient.java:368)
at net.minecraft.client.Minecraft.addGraphicsAndWorldToCrashReport(Minecraft.java:2382)
at net.minecraft.client.Minecraft.run(Minecraft.java:864)
at net.minecraft.client.main.Main.main(SourceFile:103)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
at java.lang.reflect.Method.invoke(Unknown Source)
at net.minecraft.launchwrapper.Launch.launch(Launch.java:134)
at net.minecraft.launchwrapper.Launch.main(Launch.java:28)

-- System Details --
Details:
Minecraft Version: 1.7.2
Operating System: Windows 7 (amd64) version 6.1
Java Version: 1.8.0_05, Oracle Corporation
Java VM Version: Java HotSpot(TM) 64-Bit Server VM (mixed mode), Oracle Corporation
Memory: 36928672 bytes (35 MB) / 270008320 bytes (257 MB) up to 3810525184 bytes (3634 MB)
JVM Flags: 0 total; 
AABB Pool Size: 17299 (968744 bytes; 0 MB) allocated, 1652 (92512 bytes; 0 MB) used
IntCache: cache: 0, tcache: 0, allocated: 1, tallocated: 14
FML: MCP v9.03 FML v7.2.207.1103 Minecraft Forge 10.12.1.1103 4 mods loaded, 4 mods active
mcp{9.03} [Minecraft Coder Pack] (minecraft.jar) Unloaded->Constructed->Pre-initialized->Initialized->Post-initialized->Available->Available->Available->Available
FML{7.2.207.1103} [Forge Mod Loader] (forgeBin-1.7.2-10.12.1.1103.jar) Unloaded->Constructed->Pre-initialized->Initialized->Post-initialized->Available->Available->Available->Available
Forge{10.12.1.1103} [Minecraft Forge] (forgeBin-1.7.2-10.12.1.1103.jar) Unloaded->Constructed->Pre-initialized->Initialized->Post-initialized->Available->Available->Available->Available
primevalforest{Dev Build 8b - Beta 0.1.0} [Primeval Forest] (bin) Unloaded->Constructed->Pre-initialized->Initialized->Post-initialized->Available->Available->Available->Available
Launched Version: 1.7
LWJGL: 2.9.0
OpenGL: GeForce GTX 660/PCIe/SSE2 GL version 4.4.0, NVIDIA Corporation
Is Modded: Definitely; Client brand changed to 'fml,forge'
Type: Client (map_client.txt)
Resource Packs: []
Current Language: Deutsch (Deutschland)
Profiler Position: N/A (disabled)
Vec3 Pool Size: 2313 (129528 bytes; 0 MB) allocated, 790 (44240 bytes; 0 MB) used
Anisotropic Filtering: Off (1)

 

 

And yes, I know that this is a different class, then  the class with the getDrops method (well, exact the same classes, only one method is different and the sub-blocks...)

 

Bektor

Developer of Primeval Forest.

Posted

Yes, I understand my code and no, I'm didn't know how to fix this. (The String types has a size of 2, I've 4 images, 2 for the side and 2 for the top, because I have 2 blocks and the getSubBlocks methods creates 2 sub blocks...)

And well, the error is very obvious for you, but not for me (I hate ArrayIndexOutOfBoundsException, thats the error where I'm failing really often by fixing it and most time I give up after a few hours....and mostly I getting this error by 2D-Java Games by the screen rendering...but thats an other story...)

Developer of Primeval Forest.

Posted

You have 2 icons. But somehow you have a block that has a metadata which makes your code access the 3 element (index 2).

Ok, but how could I fix it (tried it with the getTypeFromMeta method, but didn't work)

Developer of Primeval Forest.

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



×
×
  • Create New...

Important Information

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