Jump to content

Recommended Posts

Posted

I just started updating my main mod to 1.8 but no matter what I do, minecraft always crashes with:

java.lang.IllegalArgumentException: Cannot set property PropertyDirection{name=facing, clazz=class net.minecraft.util.EnumFacing, values=[north, south, west, east]} as it does not exist in BlockState{block=null, properties=[]}

 

I want to make ( /update) a simple Block with textures that should rotate depending on a Direction.

 

Here is my main mod file:

 

 

package net.dimensionshift.mod;

import java.util.Iterator;

import net.dimensionshift.mod.block.BasicBlock;
import net.dimensionshift.mod.block.BlockAirDummy;
import net.dimensionshift.mod.block.BlockDummy;
import net.dimensionshift.mod.block.BlockGlassJar;
import net.dimensionshift.mod.block.BlockInvisibleBlock;
import net.dimensionshift.mod.block.BlockSimpleController;
import net.dimensionshift.mod.block.BlockSimpleTeleporter;
import net.dimensionshift.mod.block.BlockSunBlock;
import net.dimensionshift.mod.block.BlockTeleporter;
import net.dimensionshift.mod.enchantments.EnchantmentDimensionTravelingStabilisation;
import net.dimensionshift.mod.energy.BlockWire;
import net.dimensionshift.mod.energy.TileEntityBasicWire;
import net.dimensionshift.mod.event.EventHandlerDimensionShift;
import net.dimensionshift.mod.gui.GuiHandler;
import net.dimensionshift.mod.item.CustomItemBlock;
import net.dimensionshift.mod.item.ItemBasic;
import net.dimensionshift.mod.item.ItemDimensionIdentificationCrystal;
import net.dimensionshift.mod.item.ItemDust;
import net.dimensionshift.mod.proxies.DimensionShiftCommonProxy;
import net.dimensionshift.mod.tileentity.TileEntityAirDummy;
import net.dimensionshift.mod.tileentity.TileEntityGlassJar;
import net.dimensionshift.mod.tileentity.TileEntityInvisibleBlock;
import net.dimensionshift.mod.tileentity.TileEntitySimpleController;
import net.dimensionshift.mod.tileentity.TileEntitySimpleTeleporter;
import net.dimensionshift.mod.tileentity.TileEntityTeleporter;
import net.minecraft.block.Block;
import net.minecraft.block.material.Material;
import net.minecraft.creativetab.CreativeTabs;
import net.minecraft.enchantment.Enchantment;
import net.minecraft.init.Blocks;
import net.minecraft.init.Items;
import net.minecraft.item.Item;
import net.minecraft.item.ItemFood;
import net.minecraft.item.ItemStack;
import net.minecraft.potion.Potion;
import net.minecraft.stats.Achievement;
import net.minecraftforge.common.AchievementPage;
import net.minecraftforge.common.MinecraftForge;
import net.minecraftforge.common.config.Configuration;
import net.minecraftforge.oredict.OreDictionary;
import net.minecraftforge.fml.common.FMLCommonHandler;
import net.minecraftforge.fml.common.Mod;
import net.minecraftforge.fml.common.Mod.EventHandler;
import net.minecraftforge.fml.common.Mod.Instance;
import net.minecraftforge.fml.common.SidedProxy;
import net.minecraftforge.fml.common.event.FMLInitializationEvent;
import net.minecraftforge.fml.common.event.FMLPostInitializationEvent;
import net.minecraftforge.fml.common.event.FMLPreInitializationEvent;
import net.minecraftforge.fml.common.event.FMLServerStartingEvent;
import net.minecraftforge.fml.common.network.NetworkRegistry;
import net.minecraftforge.fml.common.registry.GameRegistry;
import net.minecraftforge.fml.relauncher.Side;
import net.minecraftforge.fml.relauncher.SideOnly;

@Mod(modid = DimensionShift.MODID, name = "DimensionShift", version = DimensionShift.VERSION)
public class DimensionShift {

public static final String MODID = "dimensionshift"; // setting MODID
public static final String VERSION = "Experimental v0.312"; // setting MODID
@Instance(MODID)
public static DimensionShift instance;

@SidedProxy(clientSide = "net.dimensionshift.mod.proxies.DimensionShiftClientProxy", serverSide = "net.dimensionshift.mod.proxies.DimensionShiftCommonProxy")
public static DimensionShiftCommonProxy proxy;

public static CreativeTabs tabDimensionShift = new CreativeTabs("tabDimensionShift") {
	@Override
	@SideOnly(Side.CLIENT)
	public ItemStack getIconItemStack() {
		return new ItemStack(Items.ender_eye, 1, 0);
	}

	@Override
	public Item getTabIconItem() {
		return null;
	}

};

// BLOCKS
public static Block blockDummy;

public static Block blockMachineBlock;

public static Block blockGlassJar;

public static Block blockSimpleControllerIdle;
public static Block blockSimpleControllerActive;

public static Block blockSimpleTeleporterIdle;
public static Block blockSimpleTeleporterActive;

public static Block blockTeleporterIdle;
public static Block blockTeleporterActive;

public static Block blockSunBlockIdle;
public static Block blockSunBlockActive;

public static Block blockInvisibleBlock;
public static Block blockAirDummy;

public static Block blockWireBasic;

// ITEMS
public static Item itemEnderDust;

public static Item itemEnderCrystal;

public static Item itemEnderLense;

public static Item itemDimensionIdentificationCrystal;

// GUI
public static final int guiIdSimpleController = 0;

public static final int guiIdSimpleTeleporter = 1;

public static final int guiIdTeleporter = 2;

// Enchantments
public static final Enchantment enchantmentDimensionTravelingStabilisation = new EnchantmentDimensionTravelingStabilisation(84, 5);

// Achievements
public static Achievement achievementEnderDust;

// AchievementPage
public static AchievementPage achievementPageDimensionShift;

/*
 * CONFIG FILE:
 */

@EventHandler
public void preInit(FMLPreInitializationEvent event) {

	Configuration config = new Configuration(event.getSuggestedConfigurationFile());

	// loading the configuration from its file
	config.load();





	// saving the configuration to its file
	config.save();



	// BLOCKS

	/*
	blockDummy = new BlockDummy(Material.ground, "blockDummy").setStepSound(Block.soundTypeStone).setResistance(10F);
	GameRegistry.registerBlock(blockDummy, "blockDummy");

	blockMachineBlock = new BasicBlock(Material.rock, "blockMachineBlock").setStepSound(Block.soundTypeMetal).setResistance(80F).setHardness(3F);
	GameRegistry.registerBlock(blockMachineBlock, "blockMachineBlock");

	*/

	blockSimpleControllerIdle = new BlockSimpleController(false).setHardness(3.5F).setStepSound(Block.soundTypeMetal).setCreativeTab(DimensionShift.tabDimensionShift).setUnlocalizedName("blockSimpleController");
	blockSimpleControllerActive = new BlockSimpleController(true).setHardness(3.5F).setStepSound(Block.soundTypeMetal).setLightLevel(0.7F).setUnlocalizedName("blockSimpleControllerActive");
	GameRegistry.registerBlock(blockSimpleControllerIdle, "blockSimpleController");
	GameRegistry.registerBlock(blockSimpleControllerActive, "blockSimpleControllerActive");
	GameRegistry.registerTileEntity(TileEntitySimpleController.class, "tileEntitySimpleController");


	/*
	blockSimpleTeleporterIdle = new BlockSimpleTeleporter(false).setHardness(3.5F).setStepSound(Block.soundTypeMetal).setCreativeTab(DimensionShift.tabDimensionShift).setBlockName("blockSimpleTeleporter");
	blockSimpleTeleporterActive = new BlockSimpleTeleporter(true).setHardness(3.5F).setStepSound(Block.soundTypeMetal).setLightLevel(0.7F).setBlockName("blockSimpleTeleporterActive");
	GameRegistry.registerBlock(blockSimpleTeleporterIdle, "blockSimpleTeleporter");
	GameRegistry.registerBlock(blockSimpleTeleporterActive, "blockSimpleTeleporterActive");
	GameRegistry.registerTileEntity(TileEntitySimpleTeleporter.class, "tileEntitySimpleTeleporter");

	blockTeleporterIdle = new BlockTeleporter(false).setHardness(3.5F).setStepSound(Block.soundTypeMetal).setCreativeTab(DimensionShift.tabDimensionShift).setBlockName("blockTeleporter");
	blockTeleporterActive = new BlockTeleporter(true).setHardness(3.5F).setStepSound(Block.soundTypeMetal).setLightLevel(0.7F).setBlockName("blockTeleporterActive");
	GameRegistry.registerBlock(blockTeleporterIdle, "blockTeleporter");
	GameRegistry.registerBlock(blockTeleporterActive, "blockTeleporterActive");
	GameRegistry.registerTileEntity(TileEntityTeleporter.class, "tileEntityTeleporter");

	blockSunBlockIdle = new BlockSunBlock(false).setHardness(3.5F).setStepSound(Block.soundTypeMetal).setCreativeTab(DimensionShift.tabDimensionShift).setBlockName("blockSunBlock");
	blockSunBlockActive = new BlockSunBlock(true).setHardness(3.5F).setStepSound(Block.soundTypeMetal).setLightLevel(0.7F).setBlockName("blockSunBlockActive");
	GameRegistry.registerBlock(blockSunBlockIdle, "blockSunBlock");
	GameRegistry.registerBlock(blockSunBlockActive, "blockSunBlockActive");

	blockInvisibleBlock = new BlockInvisibleBlock(Material.rock);
	GameRegistry.registerBlock(blockInvisibleBlock, "blockInvisibleBlock");
	GameRegistry.registerTileEntity(TileEntityInvisibleBlock.class, "tileEntityStoneBricks");

	blockAirDummy = new BlockAirDummy();
	GameRegistry.registerBlock(blockAirDummy, "blockAirDummy");
	GameRegistry.registerTileEntity(TileEntityAirDummy.class, "tileEntityAirDummy");

	blockGlassJar = new BlockGlassJar(Material.glass).setStepSound(Block.soundTypeWood).setBlockName("blockGlassJar");
	GameRegistry.registerBlock(blockGlassJar, CustomItemBlock.class, "blockGlassJar");
	GameRegistry.registerTileEntity(TileEntityGlassJar.class, "tileEntityGlassJar");

	blockWireBasic = new BlockWire().setBlockName("wireBasic");
	GameRegistry.registerBlock(blockWireBasic, "wireBasic");

	GameRegistry.registerTileEntity(TileEntityBasicWire.class, MODID + ":" + "BasicPipe");

	*/



	// ITEMS

	itemEnderDust = new ItemDust(64, "itemEnderDust");
	GameRegistry.registerItem(itemEnderDust, "itemEnderDust");

	itemEnderLense = new ItemBasic(16, "itemEnderLense");
	GameRegistry.registerItem(itemEnderLense, "itemEnderLense");

	itemEnderCrystal = new ItemBasic(64, "itemEnderCrystal");
	GameRegistry.registerItem(itemEnderCrystal, "itemEnderCrystal");

	itemDimensionIdentificationCrystal = new ItemDimensionIdentificationCrystal(1, "itemDimensionIdentificationCrystal");
	GameRegistry.registerItem(itemDimensionIdentificationCrystal, "itemDimensionIdentificationCrystal");



	//NetworkRegistry.INSTANCE.registerGuiHandler(this, new GuiHandler());



	Iterator<Item> itItem = Item.itemRegistry.iterator();
	while (itItem.hasNext()) {
		Item itemFood = itItem.next();
		if (itemFood instanceof ItemFood) {
			GameRegistry.addShapelessRecipe(new ItemStack(itemFood), new ItemStack(Items.potionitem, 1, OreDictionary.WILDCARD_VALUE), new ItemStack(itemFood));
			GameRegistry.addShapelessRecipe(new ItemStack(itemFood), new ItemStack(Items.potionitem, 1, OreDictionary.WILDCARD_VALUE), new ItemStack(Items.potionitem, 1, OreDictionary.WILDCARD_VALUE), new ItemStack(itemFood));
			GameRegistry.addShapelessRecipe(new ItemStack(itemFood), new ItemStack(Items.potionitem, 1, OreDictionary.WILDCARD_VALUE), new ItemStack(Items.potionitem, 1, OreDictionary.WILDCARD_VALUE), new ItemStack(Items.potionitem, 1, OreDictionary.WILDCARD_VALUE), new ItemStack(itemFood));
			GameRegistry.addShapelessRecipe(new ItemStack(itemFood), new ItemStack(Items.potionitem, 1, OreDictionary.WILDCARD_VALUE), new ItemStack(Items.potionitem, 1, OreDictionary.WILDCARD_VALUE), new ItemStack(Items.potionitem, 1, OreDictionary.WILDCARD_VALUE), new ItemStack(Items.potionitem, 1, OreDictionary.WILDCARD_VALUE), new ItemStack(itemFood));
			GameRegistry.addShapelessRecipe(new ItemStack(itemFood), new ItemStack(Items.potionitem, 1, OreDictionary.WILDCARD_VALUE), new ItemStack(Items.potionitem, 1, OreDictionary.WILDCARD_VALUE), new ItemStack(Items.potionitem, 1, OreDictionary.WILDCARD_VALUE), new ItemStack(Items.potionitem, 1, OreDictionary.WILDCARD_VALUE), new ItemStack(Items.potionitem, 1, OreDictionary.WILDCARD_VALUE), new ItemStack(itemFood));
			GameRegistry.addShapelessRecipe(new ItemStack(itemFood), new ItemStack(Items.potionitem, 1, OreDictionary.WILDCARD_VALUE), new ItemStack(Items.potionitem, 1, OreDictionary.WILDCARD_VALUE), new ItemStack(Items.potionitem, 1, OreDictionary.WILDCARD_VALUE), new ItemStack(Items.potionitem, 1, OreDictionary.WILDCARD_VALUE), new ItemStack(Items.potionitem, 1, OreDictionary.WILDCARD_VALUE), new ItemStack(Items.potionitem, 1, OreDictionary.WILDCARD_VALUE), new ItemStack(itemFood));
			GameRegistry.addShapelessRecipe(new ItemStack(itemFood), new ItemStack(Items.potionitem, 1, OreDictionary.WILDCARD_VALUE), new ItemStack(Items.potionitem, 1, OreDictionary.WILDCARD_VALUE), new ItemStack(Items.potionitem, 1, OreDictionary.WILDCARD_VALUE), new ItemStack(Items.potionitem, 1, OreDictionary.WILDCARD_VALUE), new ItemStack(Items.potionitem, 1, OreDictionary.WILDCARD_VALUE), new ItemStack(Items.potionitem, 1, OreDictionary.WILDCARD_VALUE), new ItemStack(Items.potionitem, 1, OreDictionary.WILDCARD_VALUE), new ItemStack(itemFood));
			GameRegistry.addShapelessRecipe(new ItemStack(itemFood), new ItemStack(Items.potionitem, 1, OreDictionary.WILDCARD_VALUE), new ItemStack(Items.potionitem, 1, OreDictionary.WILDCARD_VALUE), new ItemStack(Items.potionitem, 1, OreDictionary.WILDCARD_VALUE), new ItemStack(Items.potionitem, 1, OreDictionary.WILDCARD_VALUE), new ItemStack(Items.potionitem, 1, OreDictionary.WILDCARD_VALUE), new ItemStack(Items.potionitem, 1, OreDictionary.WILDCARD_VALUE), new ItemStack(Items.potionitem, 1, OreDictionary.WILDCARD_VALUE), new ItemStack(Items.potionitem, 1, OreDictionary.WILDCARD_VALUE), new ItemStack(itemFood));
		}
	}

	// BIOMES

	// CRAFTINGS

	/*
	GameRegistry.addShapelessRecipe(new ItemStack(itemEnderDust), new ItemStack(Items.redstone, 2), new ItemStack(Items.ender_pearl, 2));

	GameRegistry.addSmelting(itemEnderDust, new ItemStack(itemEnderCrystal, 1), 0.1f);

	GameRegistry.addRecipe(new ItemStack(itemEnderLense), " x ", "x x",
			'x', new ItemStack(itemEnderCrystal));

	GameRegistry.addRecipe(new ItemStack(blockMachineBlock), "xxx", "xyx", "xzx",
			'x', new ItemStack(Items.iron_ingot), 'y', new ItemStack(itemEnderDust), 'z', new ItemStack(Items.redstone));

	GameRegistry.addRecipe(new ItemStack(blockTeleporterIdle), "xcx", "xyx", "xzx",
			'x', new ItemStack(blockMachineBlock), 'y', new ItemStack(itemEnderDust), 'c', new ItemStack(itemEnderLense), 'z', new ItemStack(Items.redstone));

	GameRegistry.addRecipe(new ItemStack(blockSimpleControllerIdle), "xcx", "czc", "xyx", 'x', new ItemStack(blockMachineBlock), 'y', new ItemStack(blockTeleporterIdle), 'z', new ItemStack(Items.redstone), 'c', new ItemStack(itemEnderLense));

	GameRegistry.addRecipe(new ItemStack(blockSunBlockIdle), "xzx", "xcx", "yyy",
			'x', new ItemStack(blockMachineBlock), 'y', new ItemStack(itemEnderLense), 'z', new ItemStack(Items.redstone), 'c', new ItemStack(Blocks.glowstone));

	GameRegistry.addRecipe(new ItemStack(blockGlassJar), "xzx", "x x", "xxx",
			'x', new ItemStack(Blocks.glass), 'z', new ItemStack(Blocks.wooden_slab));


*/
	// POTIONS
	Potion[] potionTypes = null;
	/*
	 * for (Field f : Potion.class.getDeclaredFields()) {
	 * f.setAccessible(true); try { if (f.getName().equals("potionTypes") ||
	 * f.getName().equals("field_76425_a")) { Field modfield =
	 * Field.class.getDeclaredField("modifiers");
	 * modfield.setAccessible(true); modfield.setInt(f, f.getModifiers() &
	 * ~Modifier.FINAL);
	 * 
	 * potionTypes = (Potion[])f.get(null); final Potion[] newPotionTypes =
	 * new Potion[256]; System.arraycopy(potionTypes, 0, newPotionTypes, 0,
	 * potionTypes.length); f.set(null, newPotionTypes); } } catch
	 * (Exception e) {
	 * System.err.println("Severe error, please report this to the mod author:"
	 * ); System.err.println(e); } }
	 */

}

@EventHandler
public void Init(FMLInitializationEvent e) {

	// ACHIEVEMNET
	achievementEnderDust = new Achievement("achievementEnderDust", "enderDust", 0, 0, DimensionShift.itemEnderDust, null);

	// ACHIEVMENET PAGE
	achievementPageDimensionShift = new AchievementPage("Dimension Shift", achievementEnderDust);
	AchievementPage.registerAchievementPage(achievementPageDimensionShift);

}

@EventHandler
public void PostInit(FMLPostInitializationEvent e) {
	proxy.registerProxies();

	// EVENT HANDLER
	MinecraftForge.EVENT_BUS.register(new EventHandlerDimensionShift());
	FMLCommonHandler.instance().bus().register(new EventHandlerDimensionShift());

}

}

 

 

 

My block file:

 

 

 

package net.dimensionshift.mod.block;

import java.util.Random;

import net.dimensionshift.mod.DimensionShift;
import net.dimensionshift.mod.blockplacing.TeleportSimpleController;
import net.dimensionshift.mod.tileentity.TileEntitySimpleController;
import net.minecraft.block.Block;
import net.minecraft.block.BlockContainer;
import net.minecraft.block.material.Material;
import net.minecraft.block.properties.PropertyDirection;
import net.minecraft.block.state.BlockState;
import net.minecraft.block.state.IBlockState;
import net.minecraft.entity.EntityLivingBase;
import net.minecraft.entity.item.EntityItem;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.init.Blocks;
import net.minecraft.inventory.Container;
import net.minecraft.inventory.IInventory;
import net.minecraft.inventory.InventoryHelper;
import net.minecraft.item.Item;
import net.minecraft.item.ItemStack;
import net.minecraft.nbt.NBTTagCompound;
import net.minecraft.server.MinecraftServer;
import net.minecraft.tileentity.TileEntity;
import net.minecraft.tileentity.TileEntityFurnace;
import net.minecraft.util.BlockPos;
import net.minecraft.util.EnumFacing;
import net.minecraft.util.EnumParticleTypes;
import net.minecraft.util.MathHelper;
import net.minecraft.world.World;
import net.minecraftforge.fml.common.FMLCommonHandler;
import net.minecraftforge.fml.relauncher.Side;
import net.minecraftforge.fml.relauncher.SideOnly;

public class BlockSimpleController extends BlockContainer {

    public static final PropertyDirection FACING = PropertyDirection.create("facing", EnumFacing.Plane.HORIZONTAL);

private final boolean isActive;
private static boolean keepInventory;

private Random random = new Random();


public BlockSimpleController(boolean isActive) {
	super(Material.rock);

	this.setDefaultState(this.blockState.getBaseState().withProperty(FACING, EnumFacing.NORTH));
	this.isActive = isActive;

}


@Override
@SideOnly(Side.CLIENT)
public void randomDisplayTick(World world, BlockPos pos, IBlockState state, Random rand) {
	if (this.isActive) {

		float x1 = pos.getX() + random.nextFloat();
		float y1 = pos.getY() + 0.5F;
		float z1 = pos.getZ() + random.nextFloat();

		world.spawnParticle(EnumParticleTypes.PORTAL, x1, y1, z1, 0.0D, 0.0D, 0.0D);

	}
}

// always dropping not active version
@Override
public Item getItemDropped(IBlockState state, Random rand, int fortune) {
	return Item.getItemFromBlock(DimensionShift.blockSimpleControllerIdle);

}

// getting coordinates when added
@Override
public void onBlockAdded(World world, BlockPos pos, IBlockState state)  {
	super.onBlockAdded(world, pos, state);
	this.setDefaultDirection(world, pos, state);
}

@Override
public void breakBlock(World worldIn, BlockPos pos, IBlockState state) {
	if (!keepInventory) {// if block is not broken by update status function
            TileEntity tileentity = worldIn.getTileEntity(pos);

            if (tileentity instanceof TileEntityFurnace)
            {
                InventoryHelper.dropInventoryItems(worldIn, pos, (TileEntityFurnace)tileentity);
                worldIn.updateComparatorOutputLevel(pos, this);
            }
        }

	super.breakBlock(worldIn, pos, state);
}

private void setDefaultDirection(World worldIn, BlockPos pos, IBlockState state)
    {
        if (!worldIn.isRemote)
        {
            Block block = worldIn.getBlockState(pos.offsetNorth()).getBlock();
            Block block1 = worldIn.getBlockState(pos.offsetSouth()).getBlock();
            Block block2 = worldIn.getBlockState(pos.offsetWest()).getBlock();
            Block block3 = worldIn.getBlockState(pos.offsetEast()).getBlock();
            EnumFacing enumfacing = (EnumFacing)state.getValue(FACING);

            if (enumfacing == EnumFacing.NORTH && block.isFullBlock() && !block1.isFullBlock())
            {
                enumfacing = EnumFacing.SOUTH;
            }
            else if (enumfacing == EnumFacing.SOUTH && block1.isFullBlock() && !block.isFullBlock())
            {
                enumfacing = EnumFacing.NORTH;
            }
            else if (enumfacing == EnumFacing.WEST && block2.isFullBlock() && !block3.isFullBlock())
            {
                enumfacing = EnumFacing.EAST;
            }
            else if (enumfacing == EnumFacing.EAST && block3.isFullBlock() && !block2.isFullBlock())
            {
                enumfacing = EnumFacing.WEST;
            }

            worldIn.setBlockState(pos, state.withProperty(FACING, enumfacing), 2);
        }
    }

@Override
public boolean onBlockActivated(World worldIn, BlockPos pos, IBlockState state, EntityPlayer playerIn, EnumFacing side, float hitX, float hitY, float hitZ) {

	TileEntity tileEntity = worldIn.getTileEntity(pos);
	if (tileEntity == null || playerIn.isSneaking()) {
		return false;
	} else {
		playerIn.openGui(DimensionShift.instance, DimensionShift.guiIdSimpleController, worldIn, pos.getX(), pos.getY(), pos.getZ());

	}

	return true;

}

/**
 * Lets the block know when one of its neighbor changes. Doesn't know which
 * neighbor changed (coordinates passed are their own) Args: x, y, z,
 * neighbor Block
 */
@Override
public void onNeighborBlockChange(World worldIn, BlockPos pos, IBlockState state, Block neighborBlock) {
	if (!worldIn.isRemote) {
		if (worldIn.isBlockPowered(pos)) {
			TileEntity tileEntity = worldIn.getTileEntity(pos);
			if (tileEntity != null) {
				TileEntitySimpleController simpleController = (TileEntitySimpleController) tileEntity;
				if (simpleController.isReadyToTP()) {// checking if enough
														// energy is
														// available

					if (!worldIn.isRemote) {

						// reseting Energy
						simpleController.setDimensionEnergy(0);
						simpleController.setEnergy(0);

						MinecraftServer mServer = MinecraftServer.getServer();

						int dim = 0;

						if (worldIn.provider.getDimensionId() == 0) {
							dim = 9;
						}
						World dWorld = mServer.worldServerForDimension(dim);

						Side sidex = FMLCommonHandler.instance().getEffectiveSide();
						if (sidex == Side.SERVER) {

							TeleportSimpleController.start(worldIn, dWorld, pos.getX(), pos.getY(), pos.getZ());

						}
					}

				}
			}
		}
	}
}

// creating TileEntity
public TileEntity createNewTileEntity(World world) {
	return new TileEntitySimpleController();
}

    public IBlockState onBlockPlaced(World worldIn, BlockPos pos, EnumFacing facing, float hitX, float hitY, float hitZ, int meta, EntityLivingBase placer)
    {
        return this.getDefaultState().withProperty(FACING, placer.func_174811_aO().getOpposite());
    }

    public void onBlockPlacedBy(World worldIn, BlockPos pos, IBlockState state, EntityLivingBase placer, ItemStack stack)
    {
        worldIn.setBlockState(pos, state.withProperty(FACING, placer.func_174811_aO().getOpposite()), 2);

        if (stack.hasDisplayName())
        {
            TileEntity tileentity = worldIn.getTileEntity(pos);

            if (tileentity instanceof TileEntitySimpleController)
            {
                ((TileEntitySimpleController)tileentity).setCustomInventoryName(stack.getDisplayName());
            }
        }
    }

@Override
public TileEntity createNewTileEntity(World var1, int var2) {
	// TODO Auto-generated method stub
	return new TileEntitySimpleController();
}


public static void updateBlockType(boolean active, World worldIn, BlockPos pos)
    {
        IBlockState iblockstate = worldIn.getBlockState(pos);
        TileEntity tileentity = worldIn.getTileEntity(pos);
        keepInventory = true;

        if (active)
        {
            worldIn.setBlockState(pos, Blocks.lit_furnace.getDefaultState().withProperty(FACING, iblockstate.getValue(FACING)), 3);
            worldIn.setBlockState(pos, Blocks.lit_furnace.getDefaultState().withProperty(FACING, iblockstate.getValue(FACING)), 3);
        }
        else
        {
            worldIn.setBlockState(pos, Blocks.furnace.getDefaultState().withProperty(FACING, iblockstate.getValue(FACING)), 3);
            worldIn.setBlockState(pos, Blocks.furnace.getDefaultState().withProperty(FACING, iblockstate.getValue(FACING)), 3);
        }

        keepInventory = false;

        if (tileentity != null)
        {
            tileentity.validate();
            worldIn.setTileEntity(pos, tileentity);
        }
    }

@Override
public boolean hasComparatorInputOverride() {
	return true;
}

@Override
public int getComparatorInputOverride(World worldIn, BlockPos pos) {
	return Container.calcRedstoneFromInventory((IInventory) worldIn.getTileEntity(pos));
}

// idpicked????

}

 

 

 

My TE:

 

 

 

package net.dimensionshift.mod.tileentity;

import net.dimensionshift.mod.block.BlockSimpleController;
import net.dimensionshift.mod.energy.DimensionFuel;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.entity.player.InventoryPlayer;
import net.minecraft.inventory.Container;
import net.minecraft.inventory.ContainerFurnace;
import net.minecraft.inventory.ISidedInventory;
import net.minecraft.item.ItemStack;
import net.minecraft.nbt.NBTTagCompound;
import net.minecraft.nbt.NBTTagList;
import net.minecraft.server.gui.IUpdatePlayerListBox;
import net.minecraft.tileentity.TileEntityLockable;
import net.minecraft.util.EnumFacing;
import net.minecraftforge.fml.relauncher.Side;
import net.minecraftforge.fml.relauncher.SideOnly;

public class TileEntitySimpleController extends TileEntityLockable implements ISidedInventory, IUpdatePlayerListBox {

private String localizedName;

// What slots can be accesed from which side?
private static final int[] slots_top = new int[] { 0 };
// first take out items from slot 1, than from slot number 0
private static final int[] slots_bottom = new int[] { 1, 0 };
private static final int[] slots_sides = new int[] {};

// How many Slots does Block have
private ItemStack[] slots = new ItemStack[2];

// stored Dimension Energy
public int energy;

// stored Dimension Energy
public int dimensionEnergy;// = 0;

// needed Dimension Energy
public final int requiredDimensionEnergy = 2000;

// energy that has to be stored yet
public int dimensionEnergyCharging = 0;

// time until ready to tp
public final int tpTime = 1000;

// is receiving
public int timeUntillTp;

// needed to check if status has changed...
public boolean activeLastTick = false;

@Override
public void update() {

	// Will be set to true if anything has been done this round. Otherwise
	// it will be false
	boolean active = false;

	// getting rid of stack with size 0
	if (this.slots[1] != null) {
		if (this.slots[1].stackSize == 0) {
			this.slots[1] = this.slots[1].getItem().getContainerItem(this.slots[1]);
		}
	}

	// converting item to energy
	if (this.dimensionEnergyCharging > 0 && this.dimensionEnergy != this.requiredDimensionEnergy) {
		++this.dimensionEnergy;
		--this.dimensionEnergyCharging;

		active = true;
	}

	if (!this.worldObj.isRemote && this.slots[1] != null) {
		if (this.dimensionEnergyCharging == 0 && DimensionFuel.isItemFuel(slots[1])) {
			System.out.println("adding energy to charging and removing item from slot");
			this.dimensionEnergyCharging = DimensionFuel.getFuelValue(slots[1]);
			--this.slots[1].stackSize;
			active = true;
		}
	}

	// checking if status has changed
	if (active != this.activeLastTick) {
		BlockSimpleController.updateBlockType(active, this.worldObj, this.getPos());
		this.activeLastTick = active;
	}

}

@Override
public int getSizeInventory() {
	return this.slots.length;
}

@Override
public boolean hasCustomName() {
	return this.localizedName != null && this.localizedName.length() > 0;
}

@Override
public String getName() {
	return this.hasCustomName() ? this.localizedName : "container.simpleController";
}

public void setCustomInventoryName(String displayName) {
	this.localizedName = displayName;

}

@Override
public ItemStack getStackInSlot(int i) {
	return this.slots[i];
}

@Override
public ItemStack decrStackSize(int i, int j) {
	if (this.slots[i] != null) {
		ItemStack itemstack;

		if (this.slots[i].stackSize <= j) {
			itemstack = this.slots[i];

			this.slots[i] = null;
			return itemstack;
		} else {
			itemstack = this.slots[i].splitStack(j);

			if (this.slots[i].stackSize == 0) {
				this.slots[i] = null;
			}
			return itemstack;
		}
	}
	return null;
}

@Override
public ItemStack getStackInSlotOnClosing(int i) {
	if (this.slots[i] != null) {
		ItemStack itemstack = this.slots[i];
		this.slots[i] = null;
		return itemstack;
	}
	return null;
}

@Override
public void setInventorySlotContents(int i, ItemStack itemstack) {
	this.slots[i] = itemstack;

	if (itemstack != null && itemstack.stackSize > this.getInventoryStackLimit()) {
		itemstack.stackSize = this.getInventoryStackLimit();
	}
}


@Override
public int getInventoryStackLimit() {
	return 64;
}

@Override
public boolean isUseableByPlayer(EntityPlayer player) {
	return this.worldObj.getTileEntity(this.getPos()) != this ? false : player.getDistanceSq(this.getPos().getX() + 0.5D, this.getPos().getY() + 0.5D, this.getPos().getZ() + 0.5D) <= 64.0D;
}

@Override
public void openInventory(EntityPlayer playerIn) {

}

@Override
public void closeInventory(EntityPlayer playerIn) {

}

@Override
public boolean isItemValidForSlot(int i, ItemStack item) {

	if (i == 0) { // id card

		return true;
	} else if (i == 1) { // fuel
		return DimensionFuel.isItemFuel(item);
	} else {
		return false;
	}

}

@Override
public void writeToNBT(NBTTagCompound nbt) {
	super.writeToNBT(nbt);

	// saving energy
	nbt.setShort("DimensionEnergy", (short) this.dimensionEnergy);
	nbt.setShort("DimensionEnergyCharging", (short) this.dimensionEnergyCharging);
	nbt.setShort("Energy", (short) this.energy);

	// items
	NBTTagList list = new NBTTagList();
	for (int i = 0; i < slots.length; i++) {
		if (this.slots[i] != null) {
			NBTTagCompound compound = new NBTTagCompound();
			compound.setByte("Slot", (byte) i);
			this.slots[i].writeToNBT(compound);
			list.appendTag(compound);
		}
	}
	nbt.setTag("Items", list);

	if (this.hasCustomName()) {
		nbt.setString("CustomName", this.localizedName);
	}
	nbt.setBoolean("ActiveLastTick", this.activeLastTick);
}

@Override
public void readFromNBT(NBTTagCompound nbt) {
	super.readFromNBT(nbt);

	// items
	NBTTagList list = nbt.getTagList("Items", 10);
	this.slots = new ItemStack[this.getSizeInventory()];

	for (int i = 0; i < list.tagCount(); i++) {
		NBTTagCompound compound = list.getCompoundTagAt(i);
		byte b = compound.getByte("Slot");
		if (b >= 0 && b < this.slots.length) {
			this.slots[b] = ItemStack.loadItemStackFromNBT(compound);
		}

	}

	this.dimensionEnergy = nbt.getShort("DimensionEnergy");
	this.dimensionEnergyCharging = nbt.getShort("DimensionEnergyCharging");
	this.energy = nbt.getShort("Energy");

	if (nbt.hasKey("CustomName")) {
		this.localizedName = nbt.getString("CustomName");
	}
	this.activeLastTick = nbt.getBoolean("ActiveLastTick");

}

@Override
public int[] getSlotsForFace(EnumFacing side) {
	return side == EnumFacing.DOWN ? slots_bottom : (side == EnumFacing.UP ? slots_top : slots_sides);
}

@Override
public boolean canInsertItem(int index, ItemStack itemStackIn, EnumFacing direction) {
	return this.isItemValidForSlot(index, itemStackIn);
}

@Override
public boolean canExtractItem(int index, ItemStack itemStackIn, EnumFacing direction) {
	// if extracts from down slot 1(fuel) than true
	return direction == EnumFacing.DOWN || index == 1;
}

@SideOnly(Side.CLIENT)
public int getDimensionEnergyScaled(int heightDimensionEnergyBar) {
	return this.dimensionEnergy * heightDimensionEnergyBar / this.requiredDimensionEnergy;

}

public boolean isReadyToTP() {
	return this.dimensionEnergy == this.requiredDimensionEnergy;// &&
																// this.energy
																// ==
																// this.requiredEnergy;
}

public int getEnergy() {
	return energy;
}

public void setEnergy(int energy) {
	this.energy = energy;
}

public int getDimensionEnergy() {
	return dimensionEnergy;
}

public void setDimensionEnergy(int dimensionEnergy) {
	this.dimensionEnergy = dimensionEnergy;
}

@Override
public int getField(int id) {
	// TODO Auto-generated method stub
	return 0;
}

@Override
public void setField(int id, int value) {
	// TODO Auto-generated method stub

}

@Override
public int getFieldCount() {
	// TODO Auto-generated method stub
	return 0;
}

@Override
public void clear() {
        for (int i = 0; i < this.slots.length; ++i)
        {
            this.slots[i] = null;
        }

}

@Override
public Container createContainer(InventoryPlayer playerInventory,EntityPlayer playerIn) {
	return new ContainerFurnace(playerInventory, this);
}

@Override
public String getGuiID() {
	return "dimensionshift:simpleController";
}

}

 

 

 

Blockstates Active:

 

 

{
    "variants": {
    	"normal": { "model": "dimensionshift:blockSimpleControllerActive" },
    	"facing=north": { "model": "dimensionshift:blockSimpleControllerActive" },
    	"facing=south": { "model": "dimensionshift:blockSimpleControllerActive", "y": 180 },
    	"facing=west": { "model": "dimensionshift:blockSimpleControllerActive", "y": 270 },
    	"facing=east": { "model": "dimensionshift:blockSimpleControllerActive", "y": 90 },
}

}

 

 

 

Blockstates Idle:

 

 

{
    "variants": {
    	"normal": { "model": "dimensionshift:blockSimpleControllerIdle" },
    	"facing=north": { "model": "dimensionshift:blockSimpleControllerIdle" },
    	"facing=south": { "model": "dimensionshift:blockSimpleControllerIdle", "y": 180 },
    	"facing=west":  { "model": "dimensionshift:blockSimpleControllerIdle", "y": 270 },
    	"facing=east":  { "model": "dimensionshift:blockSimpleControllerIdle", "y": 90 },
}

}

 

 

 

BlockModel Active

 

 

{
    "parent": "block/orientable",
    "textures": {
        "top": "dimensionshift:blocks/blockSimpleController/top_active",
        "front": "dimensionshift:blocks/blockSimpleController/front",
        "side": "dimensionshift:blocks/blockSimpleController/side"
    }
}

 

 

 

 

BlockModel Idle

 

 

{
    "parent": "block/orientable",
    "textures": {
        "top": "dimensionshift:blocks/blockSimpleController/top_idle",
        "front": "dimensionshift:blocks/blockSimpleController/front",
        "side": "dimensionshift:blocks/blockSimpleController/side"
    }
}

 

 

 

 

 

Full crash:

 

 

16:16:07] [main/INFO] [GradleStart]: Extra: [--tweakClass, net.minecraftforge.fml.common.launcher.FMLTweaker]
[16:16:07] [main/INFO] [GradleStart]: Running with arguments: [--userProperties, {}, --assetsDir, /Users/Jakob/.gradle/caches/minecraft/assets, --assetIndex, 1.8, --accessToken, {REDACTED}, --version, 1.6, --tweakClass, net.minecraftforge.fml.common.launcher.FMLTweaker, --tweakClass, net.minecraftforge.fml.common.launcher.FMLTweaker, --tweakClass, net.minecraftforge.gradle.GradleStartCommon$GradleStartTweaker]
[16:16:07] [main/INFO] [LaunchWrapper]: Loading tweak class name net.minecraftforge.fml.common.launcher.FMLTweaker
[16:16:07] [main/INFO] [LaunchWrapper]: Using primary tweak class name net.minecraftforge.fml.common.launcher.FMLTweaker
[16:16:07] [main/WARN] [LaunchWrapper]: Tweak class name net.minecraftforge.fml.common.launcher.FMLTweaker has already been visited -- skipping
[16:16:07] [main/INFO] [LaunchWrapper]: Loading tweak class name net.minecraftforge.gradle.GradleStartCommon$GradleStartTweaker
[16:16:07] [main/INFO] [LaunchWrapper]: Calling tweak class net.minecraftforge.fml.common.launcher.FMLTweaker
[16:16:07] [main/INFO] [FML]: Forge Mod Loader version 8.0.20.1290 for Minecraft 1.8 loading
[16:16:07] [main/INFO] [FML]: Java is Java HotSpot(TM) 64-Bit Server VM, version 1.8.0_05, running on Mac OS X:x86_64:10.9.5, installed at /Library/Java/JavaVirtualMachines/jdk1.8.0_05.jdk/Contents/Home/jre
[16:16:07] [main/INFO] [FML]: Managed to load a deobfuscated Minecraft name- we are in a deobfuscated environment. Skipping runtime deobfuscation
[16:16:07] [main/INFO] [LaunchWrapper]: Calling tweak class net.minecraftforge.gradle.GradleStartCommon$GradleStartTweaker
[16:16:07] [main/INFO] [GradleStart]: Injecting location in coremod net.minecraftforge.fml.relauncher.FMLCorePlugin
[16:16:07] [main/INFO] [GradleStart]: Injecting location in coremod net.minecraftforge.classloading.FMLForgePlugin
[16:16:07] [main/INFO] [LaunchWrapper]: Loading tweak class name net.minecraftforge.fml.common.launcher.FMLInjectionAndSortingTweaker
[16:16:07] [main/INFO] [LaunchWrapper]: Loading tweak class name net.minecraftforge.fml.common.launcher.FMLDeobfTweaker
[16:16:07] [main/INFO] [LaunchWrapper]: Calling tweak class net.minecraftforge.fml.common.launcher.FMLInjectionAndSortingTweaker
[16:16:07] [main/INFO] [LaunchWrapper]: Calling tweak class net.minecraftforge.fml.common.launcher.FMLInjectionAndSortingTweaker
[16:16:07] [main/INFO] [LaunchWrapper]: Calling tweak class net.minecraftforge.fml.relauncher.CoreModManager$FMLPluginWrapper
[16:16:07] [main/ERROR] [FML]: The binary patch set is missing. Either you are in a development environment, or things are not going to work!
[16:16:08] [main/ERROR] [FML]: FML appears to be missing any signature data. This is not a good thing
[16:16:08] [main/INFO] [LaunchWrapper]: Calling tweak class net.minecraftforge.fml.relauncher.CoreModManager$FMLPluginWrapper
[16:16:08] [main/INFO] [LaunchWrapper]: Calling tweak class net.minecraftforge.fml.common.launcher.FMLDeobfTweaker
[16:16:08] [main/INFO] [LaunchWrapper]: Loading tweak class name net.minecraftforge.fml.common.launcher.TerminalTweaker
[16:16:08] [main/INFO] [LaunchWrapper]: Calling tweak class net.minecraftforge.fml.common.launcher.TerminalTweaker
[16:16:08] [main/INFO] [LaunchWrapper]: Launching wrapped minecraft {net.minecraft.client.main.Main}
[16:16:08] [Client thread/INFO]: Setting user: Player670
[16:16:10] [Client thread/INFO]: LWJGL Version: 2.9.2
[16:16:12] [Client thread/INFO] [MinecraftForge]: Attempting early MinecraftForge initialization
[16:16:12] [Client thread/INFO] [FML]: MinecraftForge v11.14.0.1290 Initialized
[16:16:12] [Client thread/INFO] [FML]: Replaced 204 ore recipies
[16:16:12] [Client thread/INFO] [MinecraftForge]: Completed early MinecraftForge initialization
[16:16:12] [Client thread/INFO] [FML]: Searching /Users/Jakob/git/DimensionShiftCore/mods for mods
[16:16:14] [Client thread/INFO] [FML]: Forge Mod Loader has identified 4 mods to load
[16:16:14] [Client thread/INFO] [FML]: Attempting connection with missing mods [mcp, FML, Forge, dimensionshift] at CLIENT
[16:16:14] [Client thread/INFO] [FML]: Attempting connection with missing mods [mcp, FML, Forge, dimensionshift] at SERVER
[16:16:14] [Client thread/INFO]: Reloading ResourceManager: Default, FMLFileResourcePack:Forge Mod Loader, FMLFileResourcePack:Minecraft Forge, FMLFileResourcePack:DimensionShift
[16:16:14] [Client thread/INFO] [FML]: Processing ObjectHolder annotations
[16:16:14] [Client thread/INFO] [FML]: Found 384 ObjectHolder annotations
[16:16:15] [Client thread/INFO] [FML]: Configured a dormant chunk cache size of 0
[16:16:15] [Client thread/INFO] [FML]: Applying holder lookups
[16:16:15] [Client thread/INFO] [FML]: Holder lookups applied
[16:16:15] [Client thread/ERROR] [FML]: Fatal errors were detected during the transition from PREINITIALIZATION to INITIALIZATION. Loading cannot continue
[16:16:15] [Client thread/ERROR] [FML]: 
mcp{9.05} [Minecraft Coder Pack] (minecraft.jar) Unloaded->Constructed->Pre-initialized
FML{8.0.20.1290} [Forge Mod Loader] (forgeSrc-1.8-11.14.0.1290-1.8.jar) Unloaded->Constructed->Pre-initialized
Forge{11.14.0.1290} [Minecraft Forge] (forgeSrc-1.8-11.14.0.1290-1.8.jar) Unloaded->Constructed->Pre-initialized
dimensionshift{Experimental v0.312} [DimensionShift] (bin) Unloaded->Constructed->Errored
[16:16:15] [Client thread/ERROR] [FML]: The following problems were captured during this phase
[16:16:15] [Client thread/ERROR] [FML]: Caught exception from dimensionshift
java.lang.IllegalArgumentException: Cannot set property PropertyDirection{name=facing, clazz=class net.minecraft.util.EnumFacing, values=[north, south, west, east]} as it does not exist in BlockState{block=null, properties=[]}
at net.minecraft.block.state.BlockState$StateImplementation.withProperty(BlockState.java:182) ~[forgeSrc-1.8-11.14.0.1290-1.8.jar:?]
at net.dimensionshift.mod.block.BlockSimpleController.<init>(BlockSimpleController.java:49) ~[bin/:?]
at net.dimensionshift.mod.DimensionShift.preInit(DimensionShift.java:165) ~[bin/:?]
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[?:1.8.0_05]
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) ~[?:1.8.0_05]
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[?:1.8.0_05]
at java.lang.reflect.Method.invoke(Method.java:483) ~[?:1.8.0_05]
at net.minecraftforge.fml.common.FMLModContainer.handleModStateEvent(FMLModContainer.java:515) ~[forgeSrc-1.8-11.14.0.1290-1.8.jar:?]
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[?:1.8.0_05]
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) ~[?:1.8.0_05]
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[?:1.8.0_05]
at java.lang.reflect.Method.invoke(Method.java:483) ~[?:1.8.0_05]
at com.google.common.eventbus.EventSubscriber.handleEvent(EventSubscriber.java:74) ~[guava-17.0.jar:?]
at com.google.common.eventbus.SynchronizedEventSubscriber.handleEvent(SynchronizedEventSubscriber.java:47) ~[guava-17.0.jar:?]
at com.google.common.eventbus.EventBus.dispatch(EventBus.java:322) ~[guava-17.0.jar:?]
at com.google.common.eventbus.EventBus.dispatchQueuedEvents(EventBus.java:304) ~[guava-17.0.jar:?]
at com.google.common.eventbus.EventBus.post(EventBus.java:275) ~[guava-17.0.jar:?]
at net.minecraftforge.fml.common.LoadController.sendEventToModContainer(LoadController.java:208) ~[forgeSrc-1.8-11.14.0.1290-1.8.jar:?]
at net.minecraftforge.fml.common.LoadController.propogateStateMessage(LoadController.java:187) ~[forgeSrc-1.8-11.14.0.1290-1.8.jar:?]
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[?:1.8.0_05]
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) ~[?:1.8.0_05]
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[?:1.8.0_05]
at java.lang.reflect.Method.invoke(Method.java:483) ~[?:1.8.0_05]
at com.google.common.eventbus.EventSubscriber.handleEvent(EventSubscriber.java:74) ~[guava-17.0.jar:?]
at com.google.common.eventbus.SynchronizedEventSubscriber.handleEvent(SynchronizedEventSubscriber.java:47) ~[guava-17.0.jar:?]
at com.google.common.eventbus.EventBus.dispatch(EventBus.java:322) ~[guava-17.0.jar:?]
at com.google.common.eventbus.EventBus.dispatchQueuedEvents(EventBus.java:304) ~[guava-17.0.jar:?]
at com.google.common.eventbus.EventBus.post(EventBus.java:275) ~[guava-17.0.jar:?]
at net.minecraftforge.fml.common.LoadController.distributeStateMessage(LoadController.java:118) [LoadController.class:?]
at net.minecraftforge.fml.common.Loader.preinitializeMods(Loader.java:514) [Loader.class:?]
at net.minecraftforge.fml.client.FMLClientHandler.beginMinecraftLoading(FMLClientHandler.java:243) [FMLClientHandler.class:?]
at net.minecraft.client.Minecraft.startGame(Minecraft.java:445) [Minecraft.class:?]
at net.minecraft.client.Minecraft.run(Minecraft.java:355) [Minecraft.class:?]
at net.minecraft.client.main.Main.main(Main.java:117) [Main.class:?]
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[?:1.8.0_05]
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) ~[?:1.8.0_05]
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[?:1.8.0_05]
at java.lang.reflect.Method.invoke(Method.java:483) ~[?:1.8.0_05]
at net.minecraft.launchwrapper.Launch.launch(Launch.java:135) [launchwrapper-1.11.jar:?]
at net.minecraft.launchwrapper.Launch.main(Launch.java:28) [launchwrapper-1.11.jar:?]
at net.minecraftforge.gradle.GradleStartCommon.launch(GradleStartCommon.java:78) [start/:?]
at GradleStart.main(GradleStart.java:45) [start/:?]
[16:16:15] [Client thread/INFO] [sTDOUT]: [net.minecraft.init.Bootstrap:func_179870_a:660]: ---- Minecraft Crash Report ----
// I bet Cylons wouldn't have this problem.

Time: 24.01.15 16:16
Description: Initializing game

java.lang.IllegalArgumentException: Cannot set property PropertyDirection{name=facing, clazz=class net.minecraft.util.EnumFacing, values=[north, south, west, east]} as it does not exist in BlockState{block=null, properties=[]}
at net.minecraft.block.state.BlockState$StateImplementation.withProperty(BlockState.java:182)
at net.dimensionshift.mod.block.BlockSimpleController.<init>(BlockSimpleController.java:49)
at net.dimensionshift.mod.DimensionShift.preInit(DimensionShift.java:165)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:483)
at net.minecraftforge.fml.common.FMLModContainer.handleModStateEvent(FMLModContainer.java:515)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:483)
at com.google.common.eventbus.EventSubscriber.handleEvent(EventSubscriber.java:74)
at com.google.common.eventbus.SynchronizedEventSubscriber.handleEvent(SynchronizedEventSubscriber.java:47)
at com.google.common.eventbus.EventBus.dispatch(EventBus.java:322)
at com.google.common.eventbus.EventBus.dispatchQueuedEvents(EventBus.java:304)
at com.google.common.eventbus.EventBus.post(EventBus.java:275)
at net.minecraftforge.fml.common.LoadController.sendEventToModContainer(LoadController.java:208)
at net.minecraftforge.fml.common.LoadController.propogateStateMessage(LoadController.java:187)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:483)
at com.google.common.eventbus.EventSubscriber.handleEvent(EventSubscriber.java:74)
at com.google.common.eventbus.SynchronizedEventSubscriber.handleEvent(SynchronizedEventSubscriber.java:47)
at com.google.common.eventbus.EventBus.dispatch(EventBus.java:322)
at com.google.common.eventbus.EventBus.dispatchQueuedEvents(EventBus.java:304)
at com.google.common.eventbus.EventBus.post(EventBus.java:275)
at net.minecraftforge.fml.common.LoadController.distributeStateMessage(LoadController.java:118)
at net.minecraftforge.fml.common.Loader.preinitializeMods(Loader.java:514)
at net.minecraftforge.fml.client.FMLClientHandler.beginMinecraftLoading(FMLClientHandler.java:243)
at net.minecraft.client.Minecraft.startGame(Minecraft.java:445)
at net.minecraft.client.Minecraft.run(Minecraft.java:355)
at net.minecraft.client.main.Main.main(Main.java:117)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:483)
at net.minecraft.launchwrapper.Launch.launch(Launch.java:135)
at net.minecraft.launchwrapper.Launch.main(Launch.java:28)
at net.minecraftforge.gradle.GradleStartCommon.launch(GradleStartCommon.java:78)
at GradleStart.main(GradleStart.java:45)

 

 

 

And here is a link to my github project: https://github.com/Jacky2611/DimensionShiftCore

 

Any ideas what I am doing wrong?

Here could be your advertisement!

Posted

Yeah, I had that idea when i started to work with blockstates. However, as long as I can't even get the basic stuff working it makes no sense to try something new.

Here could be your advertisement!

Posted

I already got everything working in 1.7.10. (2 block stuff, you should be able to change the branch on github to see it)

But now in 1.8 I have to change my texture rotation.

The problem is that minecraft crashes because something with my new blockstate property is not wrong.

Here could be your advertisement!

Posted

I still have this problem.

Whenever I try to launch the game I get the error that there are no properties defined in my blockstate file. I already checked my path and the names.

Has anyone an idea why this is happening?

 

EDIT: Could it be that I have to register this property somewhere at the client side?

Here could be your advertisement!

Posted

To your block class you need to add

protected BlockState createBlockState()
    {
        return new BlockState(this, new IProperty[]{FACING});
    }

as you haven't told Minecraft that there actually is a blockstate for the block but you are using it anyway.

Did you really need to know?

Posted

I already read your example mod (1-3) and tried to make my code as similar as just possible to yours. Was the first thing I did when I failed the first time.

 

EDIT: I register my blocks and the necessary client stuff in DimensionShiftBlocks. Please ignore the fact that everything related to my blockSimpleController is commented out.

https://github.com/Jacky2611/DimensionShiftCore/blob/master/src/main/java/net/dimensionshift/mod/DimensionShiftBlocks.java

Here could be your advertisement!

Posted

To your block class you need to add

protected BlockState createBlockState()
    {
        return new BlockState(this, new IProperty[]{FACING});
    }

as you haven't told Minecraft that there actually is a blockstate for the block but you are using it anyway.

Did you really need to know?

  • 2 years later...
Posted
On 1/25/2015 at 5:29 PM, CoderAtParadise said:

To your block class you need to add

 


protected BlockState createBlockState()
    {
        return new BlockState(this, new IProperty[]{FACING});
    }
 

 

as you haven't told Minecraft that there actually is a blockstate for the block but you are using it anyway.

My code has that, but still doesn't load the block states. Here is my github, you could make a pull request if you find the error https://github.com/bignose956/bignose956

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

    • It is 1.12.2 - I have no idea if there is a 1.12 pack
    • Okay, but does the modpack works with 1.12 or just with 1.12.2, because I need the Forge client specifically for Minecraft 1.12, not 1.12.2
    • Version 1.19 - Forge 41.0.63 I want to create a wolf entity that I can ride, so far it seems to be working, but the problem is that when I get on the wolf, I can’t control it. I then discovered that the issue is that the server doesn’t detect that I’m riding the wolf, so I’m struggling with synchronization. However, it seems to not be working properly. As I understand it, the server receives the packet but doesn’t register it correctly. I’m a bit new to Java, and I’ll try to provide all the relevant code and prints *The comments and prints are translated by chatgpt since they were originally in Spanish* Thank you very much in advance No player is mounted, or the passenger is not a player. No player is mounted, or the passenger is not a player. No player is mounted, or the passenger is not a player. No player is mounted, or the passenger is not a player. No player is mounted, or the passenger is not a player. MountableWolfEntity package com.vals.valscraft.entity; import com.vals.valscraft.network.MountSyncPacket; import com.vals.valscraft.network.NetworkHandler; import net.minecraft.client.Minecraft; import net.minecraft.network.syncher.EntityDataAccessor; import net.minecraft.network.syncher.EntityDataSerializers; import net.minecraft.network.syncher.SynchedEntityData; import net.minecraft.server.MinecraftServer; import net.minecraft.server.level.ServerPlayer; import net.minecraft.world.entity.EntityType; import net.minecraft.world.entity.Mob; import net.minecraft.world.entity.ai.attributes.AttributeSupplier; import net.minecraft.world.entity.ai.attributes.Attributes; import net.minecraft.world.entity.animal.Wolf; import net.minecraft.world.entity.player.Player; import net.minecraft.world.entity.Entity; import net.minecraft.world.InteractionHand; import net.minecraft.world.InteractionResult; import net.minecraft.world.item.ItemStack; import net.minecraft.world.item.Items; import net.minecraft.world.level.Level; import net.minecraft.world.phys.Vec3; import net.minecraftforge.event.TickEvent; import net.minecraftforge.eventbus.api.SubscribeEvent; import net.minecraftforge.network.PacketDistributor; public class MountableWolfEntity extends Wolf { private boolean hasSaddle; private static final EntityDataAccessor<Byte> DATA_ID_FLAGS = SynchedEntityData.defineId(MountableWolfEntity.class, EntityDataSerializers.BYTE); public MountableWolfEntity(EntityType<? extends Wolf> type, Level level) { super(type, level); this.hasSaddle = false; } @Override protected void defineSynchedData() { super.defineSynchedData(); this.entityData.define(DATA_ID_FLAGS, (byte)0); } public static AttributeSupplier.Builder createAttributes() { return Wolf.createAttributes() .add(Attributes.MAX_HEALTH, 20.0) .add(Attributes.MOVEMENT_SPEED, 0.3); } @Override public InteractionResult mobInteract(Player player, InteractionHand hand) { ItemStack itemstack = player.getItemInHand(hand); if (itemstack.getItem() == Items.SADDLE && !this.hasSaddle()) { if (!player.isCreative()) { itemstack.shrink(1); } this.setSaddle(true); return InteractionResult.SUCCESS; } else if (!level.isClientSide && this.hasSaddle()) { player.startRiding(this); MountSyncPacket packet = new MountSyncPacket(true); // 'true' means the player is mounted NetworkHandler.CHANNEL.sendToServer(packet); // Ensure the server handles the packet return InteractionResult.SUCCESS; } return InteractionResult.PASS; } @Override public void travel(Vec3 travelVector) { if (this.isVehicle() && this.getControllingPassenger() instanceof Player) { System.out.println("The wolf has a passenger."); System.out.println("The passenger is a player."); Player player = (Player) this.getControllingPassenger(); // Ensure the player is the controller this.setYRot(player.getYRot()); this.yRotO = this.getYRot(); this.setXRot(player.getXRot() * 0.5F); this.setRot(this.getYRot(), this.getXRot()); this.yBodyRot = this.getYRot(); this.yHeadRot = this.yBodyRot; float forward = player.zza; float strafe = player.xxa; if (forward <= 0.0F) { forward *= 0.25F; } this.flyingSpeed = this.getSpeed() * 0.1F; this.setSpeed((float) this.getAttributeValue(Attributes.MOVEMENT_SPEED) * 1.5F); this.setDeltaMovement(new Vec3(strafe, travelVector.y, forward).scale(this.getSpeed())); this.calculateEntityAnimation(this, false); } else { // The wolf does not have a passenger or the passenger is not a player System.out.println("No player is mounted, or the passenger is not a player."); super.travel(travelVector); } } public boolean hasSaddle() { return this.hasSaddle; } public void setSaddle(boolean hasSaddle) { this.hasSaddle = hasSaddle; } @Override protected void dropEquipment() { super.dropEquipment(); if (this.hasSaddle()) { this.spawnAtLocation(Items.SADDLE); this.setSaddle(false); } } @SubscribeEvent public static void onServerTick(TickEvent.ServerTickEvent event) { if (event.phase == TickEvent.Phase.START) { MinecraftServer server = net.minecraftforge.server.ServerLifecycleHooks.getCurrentServer(); if (server != null) { for (ServerPlayer player : server.getPlayerList().getPlayers()) { if (player.isPassenger() && player.getVehicle() instanceof MountableWolfEntity) { MountableWolfEntity wolf = (MountableWolfEntity) player.getVehicle(); System.out.println("Tick: " + player.getName().getString() + " is correctly mounted on " + wolf); } } } } } private boolean lastMountedState = false; @Override public void tick() { super.tick(); if (!this.level.isClientSide) { // Only on the server boolean isMounted = this.isVehicle() && this.getControllingPassenger() instanceof Player; // Only print if the state changed if (isMounted != lastMountedState) { if (isMounted) { Player player = (Player) this.getControllingPassenger(); // Verify the passenger is a player System.out.println("Server: Player " + player.getName().getString() + " is now mounted."); } else { System.out.println("Server: The wolf no longer has a passenger."); } lastMountedState = isMounted; } } } @Override public void addPassenger(Entity passenger) { super.addPassenger(passenger); if (passenger instanceof Player) { Player player = (Player) passenger; if (!this.level.isClientSide && player instanceof ServerPlayer) { // Send the packet to the server to indicate the player is mounted NetworkHandler.CHANNEL.send(PacketDistributor.PLAYER.with(() -> (ServerPlayer) player), new MountSyncPacket(true)); } } } @Override public void removePassenger(Entity passenger) { super.removePassenger(passenger); if (passenger instanceof Player) { Player player = (Player) passenger; if (!this.level.isClientSide && player instanceof ServerPlayer) { // Send the packet to the server to indicate the player is no longer mounted NetworkHandler.CHANNEL.send(PacketDistributor.PLAYER.with(() -> (ServerPlayer) player), new MountSyncPacket(false)); } } } @Override public boolean isControlledByLocalInstance() { Entity entity = this.getControllingPassenger(); return entity instanceof Player; } @Override public void positionRider(Entity passenger) { if (this.hasPassenger(passenger)) { double xOffset = Math.cos(Math.toRadians(this.getYRot() + 90)) * 0.4; double zOffset = Math.sin(Math.toRadians(this.getYRot() + 90)) * 0.4; passenger.setPos(this.getX() + xOffset, this.getY() + this.getPassengersRidingOffset() + passenger.getMyRidingOffset(), this.getZ() + zOffset); } } } MountSyncPacket package com.vals.valscraft.network; import com.vals.valscraft.entity.MountableWolfEntity; import net.minecraft.network.FriendlyByteBuf; import net.minecraft.server.level.ServerLevel; import net.minecraft.server.level.ServerPlayer; import net.minecraft.world.entity.Entity; import net.minecraft.world.entity.player.Player; import net.minecraftforge.network.NetworkEvent; import java.util.function.Supplier; public class MountSyncPacket { private final boolean isMounted; public MountSyncPacket(boolean isMounted) { this.isMounted = isMounted; } public void encode(FriendlyByteBuf buffer) { buffer.writeBoolean(isMounted); } public static MountSyncPacket decode(FriendlyByteBuf buffer) { return new MountSyncPacket(buffer.readBoolean()); } public void handle(NetworkEvent.Context context) { context.enqueueWork(() -> { ServerPlayer player = context.getSender(); // Get the player from the context if (player != null) { // Verifies if the player has dismounted if (!isMounted) { Entity vehicle = player.getVehicle(); if (vehicle instanceof MountableWolfEntity wolf) { // Logic to remove the player as a passenger wolf.removePassenger(player); System.out.println("Server: Player " + player.getName().getString() + " is no longer mounted."); } } } }); context.setPacketHandled(true); // Marks the packet as handled } } networkHandler package com.vals.valscraft.network; import com.vals.valscraft.valscraft; import net.minecraft.resources.ResourceLocation; import net.minecraftforge.network.NetworkRegistry; import net.minecraftforge.network.simple.SimpleChannel; import net.minecraftforge.network.NetworkEvent; import java.util.function.Supplier; public class NetworkHandler { private static final String PROTOCOL_VERSION = "1"; public static final SimpleChannel CHANNEL = NetworkRegistry.newSimpleChannel( new ResourceLocation(valscraft.MODID, "main"), () -> PROTOCOL_VERSION, PROTOCOL_VERSION::equals, PROTOCOL_VERSION::equals ); public static void init() { int packetId = 0; // Register the mount synchronization packet CHANNEL.registerMessage( packetId++, MountSyncPacket.class, MountSyncPacket::encode, MountSyncPacket::decode, (msg, context) -> msg.handle(context.get()) // Get the context with context.get() ); } }  
  • Topics

×
×
  • Create New...

Important Information

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