• 0

    posted a message on 1.8 Custom Furance [Need Help]
    package com.expansion.handler;

    import com.expansion.main.Main;
    import com.expansion.tileentity.TileEntityGrinder;

    import net.minecraft.client.gui.inventory.GuiFurnace;
    import net.minecraft.entity.player.EntityPlayer;
    import net.minecraft.inventory.ContainerFurnace;
    import net.minecraft.tileentity.TileEntity;
    import net.minecraft.util.BlockPos;
    import net.minecraft.world.World;
    import net.minecraftforge.fml.common.network.IGuiHandler;
    import net.minecraftforge.fml.common.network.NetworkRegistry;

    public class GuiHandler implements IGuiHandler {

    @Override
    public Object getServerGuiElement(int ID, EntityPlayer player, World world, int x, int y, int z) {

    TileEntity te;

    switch (ID){

    case 0:

    BlockPos blockpos = new BlockPos(x,y,z);
    te = world.getTileEntity(blockpos);

    if(te != null && te instanceof TileEntityGrinder){
    return new ContainerFurnace(player.inventory, (TileEntityGrinder)te);
    }
    break;

    }
    return null;



    }

    @Override
    public Object getClientGuiElement(int ID, EntityPlayer player, World world, int x, int y, int z) {
    TileEntity te;
    switch(ID){

    case 0:
    BlockPos blockpos = new BlockPos(x,y,z);
    te = world.getTileEntity(blockpos);

    if (te != null && te instanceof TileEntityGrinder){
    return new GuiFurnace(player.inventory, (TileEntityGrinder)te);

    }
    break;
    }
    return null;
    }


    public GuiHandler(){
    NetworkRegistry.INSTANCE.registerGuiHandler(Main.instance, this);
    }
    }





    it gives me error at NetworkRegistry.INSTANCE.registerGuiHandler(Main.instance, this); Where do i now make mistake
    Posted in: Modification Development
  • 0

    posted a message on 1.8 Custom Furance [Need Help]
    public boolean onBlockActivated(World worldIn, BlockPos pos, IBlockState state, EntityPlayer playerIn, EnumFacing side, float hitX, float hitY, float hitZ)
    {
    if (worldIn.isRemote)
    {
    return true;
    }
    else
    {
    TileEntity tileentity = worldIn.getTileEntity(pos);

    if (tileentity instanceof TileEntityGrinder)
    {
    playerIn.displayGUIChest((TileEntityGrinder)tileentity);
    }

    return true;
    }
    }



    fix me here with your code,...
    Posted in: Modification Development
  • 0

    posted a message on 1.8 Custom Furance [Need Help]
    1.7.10....i need help with 1.8
    If you know how to post about 1.8 post it...do not post things from 1.7.10...it no longer works in 1.8
    x , y, z are replaced by blockPos 1 thing. that's why it dose not work.
    Posted in: Modification Development
  • 0

    posted a message on 1.8 Custom Furance [Need Help]
    @Ohrm everything is in 2 classes tileentity and machineblock....Container is 3th class that i see in there, Looking at valina code there is no GUI class for furnace...atleast i am not aware of it
    Posted in: Modification Development
  • 0

    posted a message on Furnace tileentity, gui and container
    Updated
    MainClass : http://pastebin.com/Kzc2fqLq
    Block Init/register : http://pastebin.com/B8GAyr39
    BlockGrinderMachine : http://pastebin.com/LmwYsK3s
    TileEntityGrinder : http://pastebin.com/vpbSTQu2


    Do i need Gui for furnace and Container?
    Cuz i do not see anywhere called.



    It exist in valila MC but i do not see it being called anywhere

    edit :

    TileEntity calls ContainerFuranace
    public Container createContainer(InventoryPlayer playerInventory, EntityPlayer playerIn)
    {
    return new ContainerFurnace(playerInventory, this);
    }

    and Gui
    public String getGuiID()
    {
    return "minecraft:furnace"; <---text not a class...
    }
    Posted in: Modification Development
  • 0

    posted a message on 1.8 Custom Furance [Need Help]
    GameRegistry.registerTileEntity(TileEntityGrinder.class, "TileEntityGrinder"); is this how you register tile entity?
    In FMLinitlizationEvent ?
    Posted in: Modification Development
  • 0

    posted a message on 1.8 Custom Furance [Need Help]
    Do not have any
    Posted in: Modification Development
  • 0

    posted a message on 'this.setBlockTextureName' Substitute? (Read First Reply)
    Follow my tutorials how to get em textured at https://www.youtube.com
    Texturing items + Proxy--->
    Block texturing --->


    Fixed Link
    Posted in: Modification Development
  • 0

    posted a message on 1.8 Custom Furance [Need Help]
    Did register tileentity in load FMLInitializationEvent and it still shows Just name without Fuel slot, smelting slot or output slot
    GameRegistry.registerTileEntity(TileEntityGrinder.class, "TileEntityGrinder");
    Posted in: Modification Development
  • 0

    posted a message on 1.8 Custom Furance [Need Help]
    I've changed that and it showed me container:furnace ...without gui for furnace...i managed to change name ...but i still do not get the gui or valila looking furnace gui.

    Updated TileentityGrinder : http://pastebin.com/6s2yRU36
    Updated GrinderMachineBlock : http://pastebin.com/5J8tJd8e

    now it show my inventory with above "Grinder" cuz i changed "container:furnace" to "Grinder"

    And here is an error log 16:50:59] [Server thread/ERROR] [FML]: A TileEntity type com.expansion.tileentity.TileEntityGrinder has throw an exception trying to write state. It will not persist. Report this to the mod author
    java.lang.RuntimeException: class com.expansion.tileentity.TileEntityGrinder is missing a mapping! This is a bug!
    at net.minecraft.tileentity.TileEntity.writeToNBT(TileEntity.java:77) ~[TileEntity.class:?]
    at com.expansion.tileentity.TileEntityGrinder.writeToNBT(TileEntityGrinder.java:161) ~[TileEntityGrinder.class:?]
    at net.minecraft.world.chunk.storage.AnvilChunkLoader.writeChunkToNBT(AnvilChunkLoader.java:382) [AnvilChunkLoader.class:?]
    at net.minecraft.world.chunk.storage.AnvilChunkLoader.saveChunk(AnvilChunkLoader.java:183) [AnvilChunkLoader.class:?]
    at net.minecraft.world.gen.ChunkProviderServer.saveChunkData(ChunkProviderServer.java:246) [ChunkProviderServer.class:?]
    at net.minecraft.world.gen.ChunkProviderServer.saveChunks(ChunkProviderServer.java:305) [ChunkProviderServer.class:?]
    at net.minecraft.world.WorldServer.saveAllChunks(WorldServer.java:938) [WorldServer.class:?]
    at net.minecraft.server.MinecraftServer.saveAllWorlds(MinecraftServer.java:363) [MinecraftServer.class:?]
    at net.minecraft.server.integrated.IntegratedServer.tick(IntegratedServer.java:140) [IntegratedServer.class:?]
    at net.minecraft.server.MinecraftServer.run(MinecraftServer.java:478) [MinecraftServer.class:?]
    at java.lang.Thread.run(Unknown Source) [?:1.8.0_31]
    Posted in: Modification Development
  • 0

    posted a message on 1.8 Custom Furance [Need Help]
    That thread is for 1.7.10 or i am mistaken...cuz as fair i remmmeber this.setTextureName is removed from 1.7.10 and added diffrent sutff.
    i need help for 1.8
    Posted in: Modification Development
  • 0

    posted a message on 1.8 Custom Furance [Need Help]
    TileentityGrinder : http://pastebin.com/nnUweb3B

    GrinderMachineBlock : http://pastebin.com/MjCNjmgn

    Whatever i right-click on block nothing happens....where is error in my code.
    I know that I just copied and pasted form vanila code....i can't seems to set my custom Tileentity to work
    Posted in: Modification Development
  • 0

    posted a message on Furnace tileentity, gui and container
    Can you make tutorial?
    Posted in: Modification Development
  • 1

    posted a message on Crash whenever I try to add a new mob.
    Same ID...change id of mob
    Posted in: Modification Development
  • 0

    posted a message on Furnace tileentity, gui and container
    You say TileEntity and furnace class only? what about GUI....and other stuff?
    Posted in: Modification Development
  • To post a comment, please .