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.
@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
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");
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.
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]
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
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
0
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
0
{
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,...
0
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.
0
0
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...
}
0
In FMLinitlizationEvent ?
0
0
Texturing items + Proxy--->
Block texturing --->
Fixed Link
0
GameRegistry.registerTileEntity(TileEntityGrinder.class, "TileEntityGrinder");
0
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]
0
i need help for 1.8
0
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
0
1
0