Jump to content
Search In
  • More options...
Find results that contain...
Find results in...

[1.7.10] [SOLVED] Problem with custom rendered Blocks


Pythonschlange
 Share

Recommended Posts

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;
	}
}

Link to comment
Share on other sites

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{

}

Link to comment
Share on other sites

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(){

}
}

Link to comment
Share on other sites

*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 :D

For all who are having the same problem, just register your Tileentity with "GameRegistry.registerTileEntity(tileEntityClass, id);" in the preInit of your main.class

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
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.

 Share



×
×
  • Create New...

Important Information

By using this site, you agree to our Privacy Policy.