Jump to content

Pythonschlange

Members
  • Posts

    42
  • Joined

  • Last visited

Everything posted by Pythonschlange

  1. Well, they're not completely identical but very similar. They all have differend models, textures and names. The function is mostly the same.As i said it's a chain that leads from "Block_Brocken_Bedrock_0_out_of_8" to "FullyBrockenBedrock".
  2. Well the Block Block_Brocken_Bedrock_7_out_of_8 is part of a chain of blocks that remove themselves after 1/4 sec. (Block_Brocken_Bedrock_0_out_of_8 ->Block_Brocken_Bedrock_2_out_of_8 -> ... -> Block_Brocken_Bedrock_7_out_of_ The Block: "Block_Brocken_Bedrock_0_out_of_8" is created by right-clicking a normal bedrock with the "Portable Void". At the end of the chain the block (Block_Brocken_Bedrock_7_out_of_ gets repleaced by the Block "FullyBrockenBedrock", removes the item "Portable Void" and adds the dragon egg to the inventory. Just in case: Block_Brocken_Bedrock_0_out_of_8.class: package blocks; import java.util.Random; import org.Python.StuffForMC.StuffForMC; import cpw.mods.fml.relauncher.Side; import cpw.mods.fml.relauncher.SideOnly; import tileEntitys.TileEntityFullyBrockenBedrock; import tileEntitys.TileEntityBrockenBedrock0outof8; import net.minecraft.block.Block; import net.minecraft.block.BlockContainer; import net.minecraft.block.material.Material; import net.minecraft.client.Minecraft; import net.minecraft.client.renderer.texture.IIconRegister; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.tileentity.TileEntity; import net.minecraft.util.MathHelper; import net.minecraft.world.World; public class Block_Brocken_Bedrock_0_out_of_8 extends BlockContainer{ public Block_Brocken_Bedrock_0_out_of_8(Material material) { super(material); this.setCreativeTab(StuffForMC.tabStuffForMC); this.setLightLevel(1.0F); this.setHardness(5.0F); this.setStepSound(Block.soundTypeStone); this.setBlockName("Block_Brocken_Bedrock_0_out_of_8"); } public void onBlockAdded(World world, int x, int y, int z){ EntityPlayer entity = Minecraft.getMinecraft().thePlayer; if(entity!=null&&world!=null){ int le = MathHelper.floor_double((double)(entity.rotationYaw * 4.0F / 360.0F) + 0.5D) & 3; world.setBlockMetadataWithNotify(x, y, z, le, 2); } world.scheduleBlockUpdate(x, y, z, this, this.tickRate(world)); } public void updateTick(World world, int x, int y, int z, Random random){ EntityPlayer entity = Minecraft.getMinecraft().thePlayer; if(true){ world.setBlock(x, y, z, StuffForMC.blockBrockenBedrock1outof8, 0, 2); } if(true){ world.playSoundEffect((double)x + 0.5D, (double)y + 0.5D, (double)z + 0.5D, "mob.zombie.woodbreak", 1.0F, 1.0F); } world.scheduleBlockUpdate(x, y, z, this, this.tickRate(world)); } @Override public int tickRate(World world) { return 25; } public int getRenderType(){ return -1; } public boolean isOpaqueCube() { return false; } public boolean renderAsNormalBlock() { return false; } @Override public TileEntity createNewTileEntity(World p_149915_1_, int p_149915_2_) { return new TileEntityBrockenBedrock0outof8(); } @SideOnly(Side.CLIENT) public void registerBlockIcons(IIconRegister iconRegister){ this.blockIcon = iconRegister.registerIcon("StuffForMC" + ":" + "Iconbrockenbedrock0outof8"); } } Block_Brocken_Bedrock_1_out_of_8.class: package blocks; import java.util.Random; import org.Python.StuffForMC.StuffForMC; import cpw.mods.fml.relauncher.Side; import cpw.mods.fml.relauncher.SideOnly; import tileEntitys.TileEntityBrockenBedrock1outof8; import net.minecraft.block.Block; import net.minecraft.block.BlockContainer; import net.minecraft.block.material.Material; import net.minecraft.client.Minecraft; import net.minecraft.client.renderer.texture.IIconRegister; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.tileentity.TileEntity; import net.minecraft.util.MathHelper; import net.minecraft.world.World; public class Block_Brocken_Bedrock_1_out_of_8 extends BlockContainer { public Block_Brocken_Bedrock_1_out_of_8(Material material) { super(material); this.setCreativeTab(StuffForMC.tabStuffForMC); this.setLightLevel(1.0F); this.setHardness(5.0F); this.setStepSound(Block.soundTypeStone); this.setBlockName("Block_Brocken_Bedrock_1_out_of_8"); } public void onBlockAdded(World world, int x, int y, int z){ EntityPlayer entity = Minecraft.getMinecraft().thePlayer; if(entity!=null&&world!=null){ int le = MathHelper.floor_double((double)(entity.rotationYaw * 4.0F / 360.0F) + 0.5D) & 3; world.setBlockMetadataWithNotify(x, y, z, le, 2); } world.scheduleBlockUpdate(x, y, z, this, this.tickRate(world)); } public void updateTick(World world, int x, int y, int z, Random random){ EntityPlayer entity = Minecraft.getMinecraft().thePlayer; if(true){ world.setBlock(x, y, z, StuffForMC.blockBrockenBedrock2outof8, 0, 2); } if(true){ world.playSoundEffect((double)x + 0.5D, (double)y + 0.5D, (double)z + 0.5D, "mob.zombie.woodbreak", 1.0F, 1.0F); } world.scheduleBlockUpdate(x, y, z, this, this.tickRate(world)); } @Override public int tickRate(World world) { return 5; } public int getRenderType(){ return -1; } public boolean isOpaqueCube() { return false; } public boolean renderAsNormalBlock() { return false; } @Override public TileEntity createNewTileEntity(World p_149915_1_, int p_149915_2_) { return new TileEntityBrockenBedrock1outof8(); } @SideOnly(Side.CLIENT) public void registerBlockIcons(IIconRegister iconRegister){ this.blockIcon = iconRegister.registerIcon("StuffForMC" + ":" + "Iconbrockenbedrock1outof8"); } } Block_Brocken_Bedrock_2_out_of_8.class: package blocks; import java.util.Random; import net.minecraft.block.Block; import net.minecraft.block.BlockContainer; import net.minecraft.block.material.Material; import net.minecraft.client.Minecraft; import net.minecraft.client.renderer.texture.IIconRegister; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.tileentity.TileEntity; import net.minecraft.util.MathHelper; import net.minecraft.world.World; import org.Python.StuffForMC.StuffForMC; import cpw.mods.fml.relauncher.Side; import cpw.mods.fml.relauncher.SideOnly; import tileEntitys.TileEntityBrockenBedrock0outof8; import tileEntitys.TileEntityBrockenBedrock2outof8; public class Block_Brocken_Bedrock_2_out_of_8 extends BlockContainer{ public Block_Brocken_Bedrock_2_out_of_8(Material material) { super(material); this.setCreativeTab(StuffForMC.tabStuffForMC); this.setLightLevel(1.0F); this.setHardness(5.0F); this.setStepSound(Block.soundTypeStone); this.setBlockName("Block_Brocken_Bedrock_2_out_of_8"); } public void onBlockAdded(World world, int x, int y, int z){ EntityPlayer entity = Minecraft.getMinecraft().thePlayer; if(entity!=null&&world!=null){ int le = MathHelper.floor_double((double)(entity.rotationYaw * 4.0F / 360.0F) + 0.5D) & 3; world.setBlockMetadataWithNotify(x, y, z, le, 2); } world.scheduleBlockUpdate(x, y, z, this, this.tickRate(world)); } public void updateTick(World world, int x, int y, int z, Random random){ EntityPlayer entity = Minecraft.getMinecraft().thePlayer; if(true){ world.setBlock(x, y, z, StuffForMC.blockBrockenBedrock3outof8, 0, 2); } if(true){ world.playSoundEffect((double)x + 0.5D, (double)y + 0.5D, (double)z + 0.5D, "mob.zombie.woodbreak", 1.0F, 1.0F); } world.scheduleBlockUpdate(x, y, z, this, this.tickRate(world)); } @Override public int tickRate(World world) { return 5; } public int getRenderType(){ return -1; } public boolean isOpaqueCube() { return false; } public boolean renderAsNormalBlock() { return false; } @Override public TileEntity createNewTileEntity(World p_149915_1_, int p_149915_2_) { return new TileEntityBrockenBedrock2outof8(); } @SideOnly(Side.CLIENT) public void registerBlockIcons(IIconRegister iconRegister){ this.blockIcon = iconRegister.registerIcon("StuffForMC" + ":" + "Iconbrockenbedrock2outof8"); } } Block_Brocken_Bedrock_3_out_of_8.class: package blocks; import java.util.Random; import net.minecraft.block.Block; import net.minecraft.block.BlockContainer; import net.minecraft.block.material.Material; import net.minecraft.client.Minecraft; import net.minecraft.client.renderer.texture.IIconRegister; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.tileentity.TileEntity; import net.minecraft.util.MathHelper; import net.minecraft.world.World; import org.Python.StuffForMC.StuffForMC; import cpw.mods.fml.relauncher.Side; import cpw.mods.fml.relauncher.SideOnly; import tileEntitys.TileEntityBrockenBedrock0outof8; import tileEntitys.TileEntityBrockenBedrock3outof8; public class Block_Brocken_Bedrock_3_out_of_8 extends BlockContainer{ public Block_Brocken_Bedrock_3_out_of_8(Material material) { super(material); this.setCreativeTab(StuffForMC.tabStuffForMC); this.setLightLevel(1.0F); this.setHardness(5.0F); this.setStepSound(Block.soundTypeStone); this.setBlockName("Block_Brocken_Bedrock_3_out_of_8"); } public void onBlockAdded(World world, int x, int y, int z){ EntityPlayer entity = Minecraft.getMinecraft().thePlayer; if(entity!=null&&world!=null){ int le = MathHelper.floor_double((double)(entity.rotationYaw * 4.0F / 360.0F) + 0.5D) & 3; world.setBlockMetadataWithNotify(x, y, z, le, 2); } world.scheduleBlockUpdate(x, y, z, this, this.tickRate(world)); } public void updateTick(World world, int x, int y, int z, Random random){ EntityPlayer entity = Minecraft.getMinecraft().thePlayer; if(true){ world.setBlock(x, y, z, StuffForMC.blockBrockenBedrock4outof8, 0, 2); } if(true){ world.playSoundEffect((double)x + 0.5D, (double)y + 0.5D, (double)z + 0.5D, "mob.zombie.woodbreak", 1.0F, 1.0F); } world.scheduleBlockUpdate(x, y, z, this, this.tickRate(world)); } @Override public int tickRate(World world) { return 5; } public int getRenderType(){ return -1; } public boolean isOpaqueCube() { return false; } public boolean renderAsNormalBlock() { return false; } @Override public TileEntity createNewTileEntity(World p_149915_1_, int p_149915_2_) { return new TileEntityBrockenBedrock3outof8(); } @SideOnly(Side.CLIENT) public void registerBlockIcons(IIconRegister iconRegister){ this.blockIcon = iconRegister.registerIcon("StuffForMC" + ":" + "Iconbrockenbedrock3outof8"); } } Block_Brocken_Bedrock_4_out_of_8.class: package blocks; import java.util.Random; import net.minecraft.block.Block; import net.minecraft.block.BlockContainer; import net.minecraft.block.material.Material; import net.minecraft.client.Minecraft; import net.minecraft.client.renderer.texture.IIconRegister; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.tileentity.TileEntity; import net.minecraft.util.MathHelper; import net.minecraft.world.World; import org.Python.StuffForMC.StuffForMC; import cpw.mods.fml.relauncher.Side; import cpw.mods.fml.relauncher.SideOnly; import tileEntitys.TileEntityBrockenBedrock0outof8; import tileEntitys.TileEntityBrockenBedrock4outof8; public class Block_Brocken_Bedrock_4_out_of_8 extends BlockContainer{ public Block_Brocken_Bedrock_4_out_of_8(Material material) { super(material); this.setCreativeTab(StuffForMC.tabStuffForMC); this.setLightLevel(1.0F); this.setHardness(5.0F); this.setStepSound(Block.soundTypeStone); this.setBlockName("Block_Brocken_Bedrock_4_out_of_8"); } public void onBlockAdded(World world, int x, int y, int z){ EntityPlayer entity = Minecraft.getMinecraft().thePlayer; if(entity!=null&&world!=null){ int le = MathHelper.floor_double((double)(entity.rotationYaw * 4.0F / 360.0F) + 0.5D) & 3; world.setBlockMetadataWithNotify(x, y, z, le, 2); } world.scheduleBlockUpdate(x, y, z, this, this.tickRate(world)); } public void updateTick(World world, int x, int y, int z, Random random){ EntityPlayer entity = Minecraft.getMinecraft().thePlayer; if(true){ world.setBlock(x, y, z, StuffForMC.blockBrockenBedrock5outof8, 0, 2); } if(true){ world.playSoundEffect((double)x + 0.5D, (double)y + 0.5D, (double)z + 0.5D, "mob.zombie.woodbreak", 1.0F, 1.0F); } world.scheduleBlockUpdate(x, y, z, this, this.tickRate(world)); } @Override public int tickRate(World world) { return 5; } public int getRenderType(){ return -1; } public boolean isOpaqueCube() { return false; } public boolean renderAsNormalBlock() { return false; } @Override public TileEntity createNewTileEntity(World p_149915_1_, int p_149915_2_) { return new TileEntityBrockenBedrock4outof8(); } @SideOnly(Side.CLIENT) public void registerBlockIcons(IIconRegister iconRegister){ this.blockIcon = iconRegister.registerIcon("StuffForMC" + ":" + "Iconbrockenbedrock4outof8"); } } Block_Brocken_Bedrock_5_out_of_8.class: package blocks; import java.util.Random; import net.minecraft.block.Block; import net.minecraft.block.BlockContainer; import net.minecraft.block.material.Material; import net.minecraft.client.Minecraft; import net.minecraft.client.renderer.texture.IIconRegister; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.tileentity.TileEntity; import net.minecraft.util.MathHelper; import net.minecraft.world.World; import org.Python.StuffForMC.StuffForMC; import cpw.mods.fml.relauncher.Side; import cpw.mods.fml.relauncher.SideOnly; import tileEntitys.TileEntityBrockenBedrock0outof8; import tileEntitys.TileEntityBrockenBedrock5outof8; public class Block_Brocken_Bedrock_5_out_of_8 extends BlockContainer{ public Block_Brocken_Bedrock_5_out_of_8(Material material) { super(material); this.setCreativeTab(StuffForMC.tabStuffForMC); this.setLightLevel(1.0F); this.setHardness(5.0F); this.setStepSound(Block.soundTypeStone); this.setBlockName("Block_Brocken_Bedrock_5_out_of_8"); } public void onBlockAdded(World world, int x, int y, int z){ EntityPlayer entity = Minecraft.getMinecraft().thePlayer; if(entity!=null&&world!=null){ int le = MathHelper.floor_double((double)(entity.rotationYaw * 4.0F / 360.0F) + 0.5D) & 3; world.setBlockMetadataWithNotify(x, y, z, le, 2); } world.scheduleBlockUpdate(x, y, z, this, this.tickRate(world)); } public void updateTick(World world, int x, int y, int z, Random random){ EntityPlayer entity = Minecraft.getMinecraft().thePlayer; if(true){ world.setBlock(x, y, z, StuffForMC.blockBrockenBedrock6outof8, 0, 2); } if(true){ world.playSoundEffect((double)x + 0.5D, (double)y + 0.5D, (double)z + 0.5D, "mob.zombie.woodbreak", 1.0F, 1.0F); } world.scheduleBlockUpdate(x, y, z, this, this.tickRate(world)); } @Override public int tickRate(World world) { return 5; } public int getRenderType(){ return -1; } public boolean isOpaqueCube() { return false; } public boolean renderAsNormalBlock() { return false; } @Override public TileEntity createNewTileEntity(World p_149915_1_, int p_149915_2_) { return new TileEntityBrockenBedrock5outof8(); } @SideOnly(Side.CLIENT) public void registerBlockIcons(IIconRegister iconRegister){ this.blockIcon = iconRegister.registerIcon("StuffForMC" + ":" + "Iconbrockenbedrock5outof8"); } } Block_Brocken_Bedrock_6_out_of_8.class: package blocks; import java.util.Random; import net.minecraft.block.Block; import net.minecraft.block.BlockContainer; import net.minecraft.block.material.Material; import net.minecraft.client.Minecraft; import net.minecraft.client.renderer.texture.IIconRegister; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.tileentity.TileEntity; import net.minecraft.util.MathHelper; import net.minecraft.world.World; import org.Python.StuffForMC.StuffForMC; import cpw.mods.fml.relauncher.Side; import cpw.mods.fml.relauncher.SideOnly; import tileEntitys.TileEntityBrockenBedrock0outof8; import tileEntitys.TileEntityBrockenBedrock6outof8; public class Block_Brocken_Bedrock_6_out_of_8 extends BlockContainer{ public Block_Brocken_Bedrock_6_out_of_8(Material material) { super(material); this.setCreativeTab(StuffForMC.tabStuffForMC); this.setLightLevel(1.0F); this.setHardness(5.0F); this.setStepSound(Block.soundTypeStone); this.setBlockName("Block_Brocken_Bedrock_6_out_of_8"); } public void onBlockAdded(World world, int x, int y, int z){ EntityPlayer entity = Minecraft.getMinecraft().thePlayer; if(entity!=null&&world!=null){ int le = MathHelper.floor_double((double)(entity.rotationYaw * 4.0F / 360.0F) + 0.5D) & 3; world.setBlockMetadataWithNotify(x, y, z, le, 2); } world.scheduleBlockUpdate(x, y, z, this, this.tickRate(world)); } public void updateTick(World world, int x, int y, int z, Random random){ EntityPlayer entity = Minecraft.getMinecraft().thePlayer; if(true){ world.setBlock(x, y, z, StuffForMC.blockBrockenBedrock7outof8, 0, 2); } if(true){ world.playSoundEffect((double)x + 0.5D, (double)y + 0.5D, (double)z + 0.5D, "mob.zombie.woodbreak", 1.0F, 1.0F); } world.scheduleBlockUpdate(x, y, z, this, this.tickRate(world)); } @Override public int tickRate(World world) { return 5; } public int getRenderType(){ return -1; } public boolean isOpaqueCube() { return false; } public boolean renderAsNormalBlock() { return false; } @Override public TileEntity createNewTileEntity(World p_149915_1_, int p_149915_2_) { return new TileEntityBrockenBedrock6outof8(); } @SideOnly(Side.CLIENT) public void registerBlockIcons(IIconRegister iconRegister){ this.blockIcon = iconRegister.registerIcon("StuffForMC" + ":" + "Iconbrockenbedrock6outof8"); } } Block_Brocken_Bedrock_7_out_of_8.class: (above) Portable Void: package items; import java.util.List; import org.Python.StuffForMC.StuffForMC; import cpw.mods.fml.relauncher.Side; import cpw.mods.fml.relauncher.SideOnly; import net.minecraft.block.Block; import net.minecraft.client.resources.Language; import net.minecraft.creativetab.CreativeTabs; import net.minecraft.init.Blocks; import net.minecraft.init.Items; import net.minecraft.item.Item; import net.minecraft.item.ItemStack; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.util.DamageSource; import net.minecraft.world.World; public class Item_Portable_Void extends Item { public Item_Portable_Void() { setCreativeTab(StuffForMC.tabStuffForMC); setMaxStackSize(1); setUnlocalizedName("Item_Portable_Void"); setTextureName("StuffForMC:PortableVoid"); } @SideOnly(Side.CLIENT) public boolean isFull3D() { return true; } public boolean onItemUse(ItemStack itemStack, EntityPlayer entity, World world, int x, int y, int z, int l, float a, float b, float c){ float var4 = 1.0F; //Events Block activate = Blocks.bedrock; //exeptions Block ex1 = StuffForMC.blockBrockenBedrock0outof8; Block ex2 = StuffForMC.blockBrockenBedrock1outof8; Block ex3 = StuffForMC.blockBrockenBedrock2outof8; Block ex4 = StuffForMC.blockBrockenBedrock3outof8; Block ex5 = StuffForMC.blockBrockenBedrock4outof8; Block ex6 = StuffForMC.blockBrockenBedrock5outof8; Block ex7 = StuffForMC.blockBrockenBedrock6outof8; Block ex8 = StuffForMC.blockBrockenBedrock7outof8; Block block = world.getBlock(x, y, z); if(block!=ex1 && block!=ex2 && block!=ex3 && block!=ex4 && block!=ex5 && block!=ex6 && block!=ex7 && block!=ex8){ if (block == activate){ world.playRecord("portal.travel", x, y, z); world.setBlock(x, y, z, StuffForMC.blockBrockenBedrock0outof8); }else{ world.playRecord("mob.zombie.woodbreak", x, y, z); world.setBlock(x, y, z, Blocks.air); } } return true; } }
  3. I want the item "Portable void" to be removed and the "dragon egg" to be added (replace "Portable void" with "dragon egg"). Now I kind of don´t know how to do that.
  4. How do I do this? (Example, please)
  5. My problem is that the "entity.inventory.consumeInventoryItem(StuffForMC.itemPortableVoid)" removes the Item in my inventory, until i Right-click the slot where it was before. If i do this the Item will appear again. I played around with it but couldn't find a solution ("!world.isRemote" didn't work) The Block class: package blocks; import java.util.Random; import net.minecraft.block.Block; import net.minecraft.block.BlockContainer; import net.minecraft.block.material.Material; import net.minecraft.client.Minecraft; import net.minecraft.client.renderer.texture.IIconRegister; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.init.Blocks; import net.minecraft.inventory.InventoryBasic; import net.minecraft.item.ItemStack; import net.minecraft.tileentity.TileEntity; import net.minecraft.util.MathHelper; import net.minecraft.world.World; import org.Python.StuffForMC.StuffForMC; import cpw.mods.fml.relauncher.Side; import cpw.mods.fml.relauncher.SideOnly; import tileEntitys.TileEntityBrockenBedrock0outof8; import tileEntitys.TileEntityBrockenBedrock7outof8; public class Block_Brocken_Bedrock_7_out_of_8 extends BlockContainer{ public Block_Brocken_Bedrock_7_out_of_8(Material material) { super(material); this.setCreativeTab(StuffForMC.tabStuffForMC); this.setLightLevel(1.0F); this.setHardness(5.0F); this.setStepSound(Block.soundTypeStone); this.setBlockName("Block_Brocken_Bedrock_7_out_of_8"); } public void onBlockAdded(World world, int x, int y, int z){ EntityPlayer entity = Minecraft.getMinecraft().thePlayer; if(entity!=null&&world!=null){ int le = MathHelper.floor_double((double)(entity.rotationYaw * 4.0F / 360.0F) + 0.5D) & 3; world.setBlockMetadataWithNotify(x, y, z, le, 2); } world.scheduleBlockUpdate(x, y, z, this, this.tickRate(world)); } public void updateTick(World world, int x, int y, int z, Random random){ EntityPlayer entity = Minecraft.getMinecraft().thePlayer; if(true){ world.setBlock(x, y, z, StuffForMC.blockFullyBrockenBedrock, 0, 2); } if(true){ world.playSoundEffect((double)x + 0.5D, (double)y + 0.5D, (double)z + 0.5D, "mob.zombie.woodbreak", 1.0F, 1.0F); } if(true){ entity.inventory.consumeInventoryItem(StuffForMC.itemPortableVoid); } if(true){ entity.inventory.addItemStackToInventory(new ItemStack(Blocks.dragon_egg, 1)); } world.scheduleBlockUpdate(x, y, z, this, this.tickRate(world)); } @Override public int tickRate(World world) { return 5; } public int getRenderType(){ return -1; } public boolean isOpaqueCube() { return false; } public boolean renderAsNormalBlock() { return false; } @Override public TileEntity createNewTileEntity(World p_149915_1_, int p_149915_2_) { return new TileEntityBrockenBedrock7outof8(); } @SideOnly(Side.CLIENT) public void registerBlockIcons(IIconRegister iconRegister){ this.blockIcon = iconRegister.registerIcon("StuffForMC" + ":" + "Iconbrockenbedrock7outof8"); } }
  6. *facepalm* I found the problem I forgot to register it in the main class. Well 6 hours of searching for some silly mistake -.- Anyways thanks for your help For all who are having the same problem, just register your Tileentity with "GameRegistry.registerTileEntity(tileEntityClass, id);" in the preInit of your main.class
  7. Nope. Just tried it, the blocks stopped rendering and it still crashing if I want to remove the Block (with the "world.setBlock(x, y, z, Blocks.air)" command) .
  8. The Clientproxy(were I registered it): package org.Python.StuffForMC; import cpw.mods.fml.client.registry.ClientRegistry; import renderer.ItemRenderFullyBrockenBedrock; import renderer.RenderBrockenBedrock1outof8; import renderer.RenderBrockenBedrock2outof8; import renderer.RenderBrockenBedrock3outof8; import renderer.RenderBrockenBedrock4outof8; import renderer.RenderBrockenBedrock5outof8; import renderer.RenderBrockenBedrock6outof8; import renderer.RenderBrockenBedrock7outof8; import renderer.RenderFullyBrockenBedrock; import renderer.RenderBrockenBedrock0outof8; import tileEntitys.TileEntityBrockenBedrock1outof8; import tileEntitys.TileEntityBrockenBedrock2outof8; import tileEntitys.TileEntityBrockenBedrock3outof8; import tileEntitys.TileEntityBrockenBedrock4outof8; import tileEntitys.TileEntityBrockenBedrock5outof8; import tileEntitys.TileEntityBrockenBedrock6outof8; import tileEntitys.TileEntityBrockenBedrock7outof8; import tileEntitys.TileEntityFullyBrockenBedrock; import tileEntitys.TileEntityBrockenBedrock0outof8; import net.minecraft.client.renderer.tileentity.TileEntitySpecialRenderer; import net.minecraft.item.Item; import net.minecraftforge.client.MinecraftForgeClient; public class StuffForMCClientProxy extends StuffForMCProxy { @Override public void registerRenders(){ //Fully Brocken Bedrock TileEntitySpecialRenderer render1 = new RenderFullyBrockenBedrock(); ClientRegistry.bindTileEntitySpecialRenderer(TileEntityFullyBrockenBedrock.class, render1); MinecraftForgeClient.registerItemRenderer(Item.getItemFromBlock(StuffForMC.blockFullyBrockenBedrock), new ItemRenderFullyBrockenBedrock(render1, new TileEntityFullyBrockenBedrock())); //BrockenBedrock0outof8 TileEntitySpecialRenderer render2 = new RenderBrockenBedrock0outof8(); ClientRegistry.bindTileEntitySpecialRenderer(TileEntityBrockenBedrock0outof8.class, render2); //BrockenBedrock1outof8 TileEntitySpecialRenderer render3 = new RenderBrockenBedrock1outof8(); ClientRegistry.bindTileEntitySpecialRenderer(TileEntityBrockenBedrock1outof8.class, render3); //BrockenBedrock2outof8 TileEntitySpecialRenderer render4 = new RenderBrockenBedrock2outof8(); ClientRegistry.bindTileEntitySpecialRenderer(TileEntityBrockenBedrock2outof8.class, render4); //BrockenBedrock3outof8 TileEntitySpecialRenderer render5 = new RenderBrockenBedrock3outof8(); ClientRegistry.bindTileEntitySpecialRenderer(TileEntityBrockenBedrock3outof8.class, render5); //BrockenBedrock4outof8 TileEntitySpecialRenderer render6 = new RenderBrockenBedrock4outof8(); ClientRegistry.bindTileEntitySpecialRenderer(TileEntityBrockenBedrock4outof8.class, render6); //BrockenBedrock5outof8 TileEntitySpecialRenderer render7 = new RenderBrockenBedrock5outof8(); ClientRegistry.bindTileEntitySpecialRenderer(TileEntityBrockenBedrock5outof8.class, render7); //BrockenBedrock6outof8 TileEntitySpecialRenderer render8 = new RenderBrockenBedrock6outof8(); ClientRegistry.bindTileEntitySpecialRenderer(TileEntityBrockenBedrock6outof8.class, render8); //BrockenBedrock7outof8 TileEntitySpecialRenderer render9 = new RenderBrockenBedrock7outof8(); ClientRegistry.bindTileEntitySpecialRenderer(TileEntityBrockenBedrock7outof8.class, render9); } public void registerTileEntitySpecialRenderer(){ } }
  9. Crash report: ---- Minecraft Crash Report ---- // This doesn't make any sense! Time: 18.07.15 04:00 Description: Ticking memory connection java.lang.RuntimeException: class tileEntitys.TileEntityFullyBrockenBedrock is missing a mapping! This is a bug! at net.minecraft.tileentity.TileEntity.writeToNBT(TileEntity.java:96) at net.minecraftforge.common.util.BlockSnapshot.<init>(BlockSnapshot.java:52) at net.minecraftforge.common.util.BlockSnapshot.<init>(BlockSnapshot.java:81) at net.minecraftforge.common.util.BlockSnapshot.getBlockSnapshot(BlockSnapshot.java:107) at net.minecraft.world.World.setBlock(World.java:515) at net.minecraft.world.World.setBlock(World.java:681) at items.Item_Portable_Void.onItemUse(Item_Portable_Void.java:41) at net.minecraftforge.common.ForgeHooks.onPlaceItemIntoWorld(ForgeHooks.java:456) at net.minecraft.item.ItemStack.tryPlaceItemIntoWorld(ItemStack.java:142) at net.minecraft.server.management.ItemInWorldManager.activateBlockOrUseItem(ItemInWorldManager.java:422) at net.minecraft.network.NetHandlerPlayServer.processPlayerBlockPlacement(NetHandlerPlayServer.java:593) at net.minecraft.network.play.client.C08PacketPlayerBlockPlacement.processPacket(C08PacketPlayerBlockPlacement.java:74) at net.minecraft.network.play.client.C08PacketPlayerBlockPlacement.processPacket(C08PacketPlayerBlockPlacement.java:122) at net.minecraft.network.NetworkManager.processReceivedPackets(NetworkManager.java:241) at net.minecraft.network.NetworkSystem.networkTick(NetworkSystem.java:182) at net.minecraft.server.MinecraftServer.updateTimeLightAndEntities(MinecraftServer.java:726) at net.minecraft.server.MinecraftServer.tick(MinecraftServer.java:614) at net.minecraft.server.integrated.IntegratedServer.tick(IntegratedServer.java:118) at net.minecraft.server.MinecraftServer.run(MinecraftServer.java:485) at net.minecraft.server.MinecraftServer$2.run(MinecraftServer.java:752) A detailed walkthrough of the error, its code path and all known details is as follows: --------------------------------------------------------------------------------------- -- Head -- Stacktrace: at net.minecraft.tileentity.TileEntity.writeToNBT(TileEntity.java:96) at net.minecraftforge.common.util.BlockSnapshot.<init>(BlockSnapshot.java:52) at net.minecraftforge.common.util.BlockSnapshot.<init>(BlockSnapshot.java:81) at net.minecraftforge.common.util.BlockSnapshot.getBlockSnapshot(BlockSnapshot.java:107) at net.minecraft.world.World.setBlock(World.java:515) at net.minecraft.world.World.setBlock(World.java:681) at items.Item_Portable_Void.onItemUse(Item_Portable_Void.java:41) at net.minecraftforge.common.ForgeHooks.onPlaceItemIntoWorld(ForgeHooks.java:456) at net.minecraft.item.ItemStack.tryPlaceItemIntoWorld(ItemStack.java:142) at net.minecraft.server.management.ItemInWorldManager.activateBlockOrUseItem(ItemInWorldManager.java:422) at net.minecraft.network.NetHandlerPlayServer.processPlayerBlockPlacement(NetHandlerPlayServer.java:593) at net.minecraft.network.play.client.C08PacketPlayerBlockPlacement.processPacket(C08PacketPlayerBlockPlacement.java:74) at net.minecraft.network.play.client.C08PacketPlayerBlockPlacement.processPacket(C08PacketPlayerBlockPlacement.java:122) at net.minecraft.network.NetworkManager.processReceivedPackets(NetworkManager.java:241) -- Ticking connection -- Details: Connection: net.minecraft.network.NetworkManager@79445130 Stacktrace: at net.minecraft.network.NetworkSystem.networkTick(NetworkSystem.java:182) at net.minecraft.server.MinecraftServer.updateTimeLightAndEntities(MinecraftServer.java:726) at net.minecraft.server.MinecraftServer.tick(MinecraftServer.java:614) at net.minecraft.server.integrated.IntegratedServer.tick(IntegratedServer.java:118) at net.minecraft.server.MinecraftServer.run(MinecraftServer.java:485) at net.minecraft.server.MinecraftServer$2.run(MinecraftServer.java:752) -- System Details -- Details: Minecraft Version: 1.7.10 Operating System: Windows 7 (amd64) version 6.1 Java Version: 1.8.0_51, Oracle Corporation Java VM Version: Java HotSpot(TM) 64-Bit Server VM (mixed mode), Oracle Corporation Memory: 800160264 bytes (763 MB) / 1037959168 bytes (989 MB) up to 1037959168 bytes (989 MB) JVM Flags: 3 total; -Xincgc -Xmx1024M -Xms1024M AABB Pool Size: 0 (0 bytes; 0 MB) allocated, 0 (0 bytes; 0 MB) used IntCache: cache: 0, tcache: 0, allocated: 13, tallocated: 95 FML: MCP v9.05 FML v7.10.85.1230 Minecraft Forge 10.13.2.1230 4 mods loaded, 4 mods active mcp{9.05} [Minecraft Coder Pack] (minecraft.jar) Unloaded->Constructed->Pre-initialized->Initialized->Post-initialized->Available->Available->Available->Available FML{7.10.85.1230} [Forge Mod Loader] (forgeSrc-1.7.10-10.13.2.1230.jar) Unloaded->Constructed->Pre-initialized->Initialized->Post-initialized->Available->Available->Available->Available Forge{10.13.2.1230} [Minecraft Forge] (forgeSrc-1.7.10-10.13.2.1230.jar) Unloaded->Constructed->Pre-initialized->Initialized->Post-initialized->Available->Available->Available->Available StuffForMCID{1.0.1} [stuff For MC] (bin) Unloaded->Constructed->Pre-initialized->Initialized->Post-initialized->Available->Available->Available->Available Profiler Position: N/A (disabled) Vec3 Pool Size: 0 (0 bytes; 0 MB) allocated, 0 (0 bytes; 0 MB) used Player Count: 1 / 8; [EntityPlayerMP['Player486'/189, l='Neue Welt', x=-10,38, y=68,87, z=-119,82]] Type: Integrated Server (map_client.txt) Is Modded: Definitely; Client brand changed to 'fml,forge' tile entity class: package tileEntitys; import net.minecraft.tileentity.TileEntity; public class TileEntityFullyBrockenBedrock extends TileEntity{ }
  10. I made an custom rendered block, it works just fine. It renders in my hand as it should and in the world as it should, but if I want to remove it with "world.setBlock(x, y, z, Blocks.air);" my game crashes. I figured out that the tileentity I created to custom render my block causes the crash, but I can't find a way to fix it. The block: package blocks; import org.Python.StuffForMC.StuffForMC; import cpw.mods.fml.relauncher.Side; import cpw.mods.fml.relauncher.SideOnly; import tileEntitys.TileEntityFullyBrockenBedrock; import javafx.scene.control.Tab; import net.minecraft.block.Block; import net.minecraft.block.BlockContainer; import net.minecraft.block.material.Material; import net.minecraft.client.renderer.texture.IIconRegister; import net.minecraft.tileentity.TileEntity; import net.minecraft.world.World; public class Block_Fully_Brocken_Bedrock extends BlockContainer { public Block_Fully_Brocken_Bedrock(Material material) { super(material); this.setCreativeTab(StuffForMC.tabStuffForMC); this.setLightLevel(1.0F); this.setHardness(5.0F); this.setStepSound(Block.soundTypeStone); this.setBlockName("Block_Fully_Brocken_Bedrock"); } public int getRenderType(){ return -1; } public boolean isOpaqueCube() { return false; } public boolean renderAsNormalBlock() { return false; } @Override public TileEntity createNewTileEntity(World p_149915_1_, int p_149915_2_) { return new TileEntityFullyBrockenBedrock(); } @SideOnly(Side.CLIENT) public void registerBlockIcons(IIconRegister iconRegister){ this.blockIcon = iconRegister.registerIcon("StuffForMC" + ":" + "fullybrockenbedrockbreakingpartickles"); } } Item that should remove it: package items; import org.Python.StuffForMC.StuffForMC; import cpw.mods.fml.relauncher.Side; import cpw.mods.fml.relauncher.SideOnly; import net.minecraft.block.Block; import net.minecraft.creativetab.CreativeTabs; import net.minecraft.init.Blocks; import net.minecraft.init.Items; import net.minecraft.item.Item; import net.minecraft.item.ItemStack; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.util.DamageSource; import net.minecraft.world.World; public class Item_Portable_Void extends Item { public Item_Portable_Void() { setCreativeTab(StuffForMC.tabStuffForMC); setMaxStackSize(1); setUnlocalizedName("Item_Portable_Void"); setTextureName("StuffForMC:WorkScope"); } @SideOnly(Side.CLIENT) public boolean isFull3D() { return true; } public boolean onItemUse(ItemStack itemStack, EntityPlayer entity, World world, int x, int y, int z, int l, float a, float b, float c) { float var4 = 1.0F; Block g = Blocks.bedrock; Block block = world.getBlock(x, y, z); if (block != g) { world.playRecord("mob.zombie.woodbreak", x, y, z); world.setBlock(x, y, z, Blocks.air); } else { world.playRecord("mob.zombie.woodbreak", x, y, z); world.setBlock(x, y, z, StuffForMC.blockFullyBrockenBedrock); } return true; } }
  11. I'll look it up, thanks to both of you
  12. Could you give me an example, because by now I have no idea how to use that and I'm slowly getting tired (were I live it's almost 0:00)
  13. I still don't know why it resets anytime, so yeah...help?
  14. Oh.. I thought it was ment to just generate once. So I see my mistake here. Ok...then how am i able to solve that problem?
  15. I'm sorry but I really don't get what you're trying to say. I don't see the problem in the Cliend or Server thing, because it works fine without all "test" variables. If I remove all "test"variables it works perfectly, but infinitly often and I want it to work just once. So i figured this variable thing out that was supposed to limit the onItemUse event to one use. That seems to work fine as well, untill the if part closes of and something decides to undo enything that happens in the if part.
  16. Ok, I now have even more questions: 1) to a): why not? How I'm able to store them then? 2) to b): why? I need an explanation
  17. Well my Problem is that whenever I activate the onItemUse event the block, I Clicked on, get's replaced with air and the sound get's played, just as planed, but right after that the air block get´s replaced again with the block that was there before and i don't know why MC does that .I want the item to work once but without removing or destroying it. (sorry for probably bad English I'm no native speaker) Here is my Code:
×
×
  • Create New...

Important Information

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