Jump to content

[1.7.10]Containers and Guis[Solved]


hnsdieter

Recommended Posts

Dear Community,

 

Im pretty new to the scene and got a basic knowledge of modding I hope.

 

I followed the Guide for this on the wiki and figuered out how parts of it work.

As you might know the tutorial is outdated so Ive got a few questions:

 

When Im in game and shift click the items out, the items double like( 1, 2, 4, 8 and so on) what can I do to prevent mc from doing this? And I cant shift click into the bottom item slots.

 

How can I let the items spread out on break, the code seems not to work?[solved]

 

And the items in the gui are not saving, if i restart the world/server, how can I fix that?[solved]

 

Code:

package hnsdieter.chargecore.container;

import hnsdieter.chargecore.tileentity.BaseGeneratorTileEntity;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.entity.player.InventoryPlayer;
import net.minecraft.inventory.*;
import net.minecraft.item.ItemStack;
import net.minecraft.tileentity.TileEntity;


/**
* Created by Andy on 31.08.2014.
*/
public class ContainerGenerator extends net.minecraft.inventory.Container{

    protected BaseGeneratorTileEntity tileEntity1;

    public ContainerGenerator(InventoryPlayer inventoryPlayer, TileEntity te){
        tileEntity1 = (BaseGeneratorTileEntity) te;

        for (int i = 0; i < 3; i++){
            for (int j = 0; j < 3; j++){
                addSlotToContainer(new Slot(tileEntity1, j + i * 3, 62 + j * 18, 17 + i * 18));
            }
        }
        bindPlayerInventory(inventoryPlayer);
    }

    protected  void bindPlayerInventory(InventoryPlayer inventoryPlayer){
        for(int i = 0; i < 3; i++){
            for (int j = 0; j < 9; j++){
                addSlotToContainer(new Slot(inventoryPlayer, j + i * 9 + 9, 8 + j * 18, 84 + i * 18));
            }
        }

        for(int i = 0; i < 9; i++){
            addSlotToContainer(new Slot(inventoryPlayer, i, 8 + i * 18, 142));
        }
    }

    public ItemStack transferStackInSlot(EntityPlayer player, int slot){
        ItemStack stack = null;
        Slot slotObject = (Slot) inventorySlots.get(slot);

        if(slotObject != null && slotObject.getHasStack()){
            ItemStack stackInSlot = slotObject.getStack();
            stack = stackInSlot.copy();

            if(slot < 9){
                if(!this.mergeItemStack(stackInSlot, 0, 35, true)){
                    return null;
                }
            }else if(!this.mergeItemStack(stackInSlot, 0, 9, false)){
                return null;
            }

            if(stackInSlot.stackSize == 0){
                slotObject.putStack(null);
            }else{
                slotObject.onSlotChanged();
            }

            if(stackInSlot.stackSize == stack.stackSize){
                return null;
            }
            slotObject.onPickupFromSlot(player, stackInSlot);
        }
        return stack;
    }

    @Override
    public boolean canInteractWith(EntityPlayer player) {
        return tileEntity1.isUseableByPlayer(player);
    }
}

package hnsdieter.chargecore.gui;

import hnsdieter.chargecore.container.ContainerGenerator;
import hnsdieter.chargecore.reference.Reference;
import hnsdieter.chargecore.tileentity.BaseGeneratorTileEntity;
import net.minecraft.client.gui.inventory.GuiContainer;
import net.minecraft.entity.player.InventoryPlayer;
import net.minecraft.inventory.Container;
import net.minecraft.util.ResourceLocation;
import net.minecraft.util.StatCollector;
import org.lwjgl.opengl.GL11;

/**
* Created by Andy on 31.08.2014.
*/
public class GuiBaseGenerator extends GuiContainer {
    public GuiBaseGenerator(InventoryPlayer inventoryPlayer, BaseGeneratorTileEntity tileEntity) {
        super(new ContainerGenerator(inventoryPlayer, tileEntity));
    }

    protected void drawGuiContainerForegroundLayer(int par1, int par2){
        fontRendererObj.drawString("BaseGenerator", 8, 6, 4210752);
        fontRendererObj.drawString(StatCollector.translateToLocal("container.inventory"), 8, ySize - 96 + 2, 4210752);
    }

    @Override
    protected void drawGuiContainerBackgroundLayer(float p_146976_1_, int p_146976_2_, int p_146976_3_) {
        ResourceLocation texture = new ResourceLocation(Reference.ID + ":" + "/textures/gui/crafting.png");

        GL11.glColor4f(1.0F, 1.0F, 1.0F, 10.F);
        this.mc.renderEngine.bindTexture(texture);
        int x = (width - xSize) / 2;
        int y = (height - ySize) / 2;
        this.drawTexturedModalRect(x, y, 0, 0, xSize, ySize);
    }
}

package hnsdieter.chargecore.gui;

import cpw.mods.fml.common.network.IGuiHandler;
import hnsdieter.chargecore.container.ContainerGenerator;
import hnsdieter.chargecore.tileentity.BaseGeneratorTileEntity;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.tileentity.TileEntity;
import net.minecraft.world.World;

/**
* Created by Andy on 31.08.2014.
*/
public class GuiHandler implements IGuiHandler {

    @Override
    public Object getServerGuiElement(int ID, EntityPlayer player, World world, int x, int y, int z) {
        TileEntity tileEntity = world.getTileEntity(x, y, z);
        if(tileEntity instanceof BaseGeneratorTileEntity){
            return new ContainerGenerator(player.inventory, (TileEntity) tileEntity);
        }
        return null;
    }

    @Override
    public Object getClientGuiElement(int ID, EntityPlayer player, World world, int x, int y, int z) {
        TileEntity tileEntity = world.getTileEntity(x, y, z);
        if(tileEntity instanceof BaseGeneratorTileEntity){
            return new GuiBaseGenerator(player.inventory, (BaseGeneratorTileEntity) tileEntity);
        }
        return null;
    }
}

package hnsdieter.chargecore.tileentity;

import hnsdieter.chargecore.block.BaseGenerator;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.inventory.IInventory;
import net.minecraft.item.ItemStack;
import net.minecraft.nbt.NBTTagCompound;
import net.minecraft.nbt.NBTTagList;
import net.minecraft.tileentity.TileEntity;

/**
* Created by Andy on 31.08.2014.
*/
public class BaseGeneratorTileEntity extends TileEntity implements IInventory {

    private  ItemStack[] itemStacks;
    private  String invName;

    public BaseGeneratorTileEntity(int size, String displayName){
        itemStacks = new ItemStack[size];
        invName = displayName;
    }
    /*NBT*/
    @Override
    public void readFromNBT(NBTTagCompound nbtTagCompound){
        super.readFromNBT(nbtTagCompound);

        NBTTagList tagList = nbtTagCompound.getTagList("Inventory", 10);
        for (int i = 0; i < tagList.tagCount(); i++){
            NBTTagCompound nbtTagCompound1 = (NBTTagCompound)tagList.getCompoundTagAt(i);
            byte slot = nbtTagCompound1.getByte("Slot");
            if(slot >= 0 && slot < itemStacks.length){
                itemStacks[slot] = ItemStack.loadItemStackFromNBT(nbtTagCompound1);
            }
        }
    }

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

        NBTTagList tagList = new NBTTagList();
        for(int i = 0; i < itemStacks.length; i++){
            ItemStack itemStack = itemStacks[i];
            if(itemStack != null){
                NBTTagCompound nbtTagCompound1 = new NBTTagCompound();
                nbtTagCompound1.setByte("Slot", (byte) i );
                itemStack.writeToNBT(nbtTagCompound1);
                tagList.appendTag(nbtTagCompound1);
            }
        }
        nbtTagCompound.setTag("Inventory", tagList);
    }

    /*Inventory*/
    @Override
    public int getSizeInventory() {
        return itemStacks.length;
    }

    @Override
    public ItemStack getStackInSlot(int slot) {
        return itemStacks[slot];
    }

    @Override
    public ItemStack decrStackSize(int slot, int amount) {
        ItemStack itemStack = getStackInSlot(slot);
        if(itemStack != null){
            if(itemStack.stackSize <= amount){
                setInventorySlotContents(slot, null);
            }else {
                itemStack = itemStack.splitStack(amount);
                if(itemStack.stackSize == 0){
                    setInventorySlotContents(slot, null);
                }
            }
        }
        return itemStack;
    }

    @Override
    public ItemStack getStackInSlotOnClosing(int slot) {
        ItemStack itemStack = getStackInSlot(slot);
        if(itemStack != null){
            setInventorySlotContents(slot, null);
        }
        return itemStack;
    }

    @Override
    public void setInventorySlotContents(int slot, ItemStack stack) {
        itemStacks[slot] = stack;
        if(stack != null && stack.stackSize > getInventoryStackLimit()){
            stack.stackSize = getInventoryStackLimit();
        }
    }

    @Override
    public String getInventoryName() {
        if(hasCustomInventoryName() == true){
            return invName;
        }else{
            return null;
        }
    }

    @Override
    public boolean hasCustomInventoryName() {
        if (invName != null && invName.length() < 0) {
            return true;
        } else {
            return false;

        }
    }

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

    @Override
    public boolean isUseableByPlayer(EntityPlayer player) {
        return worldObj.getTileEntity(xCoord, yCoord, zCoord) == this &&
                player.getDistanceSq(xCoord + 0.5, yCoord + 0.5, zCoord + 0.5) < 64;
    }

    @Override
    public void openInventory() {

    }

    @Override
    public void closeInventory() {

    }

    @Override
    public boolean isItemValidForSlot(int p_94041_1_, ItemStack p_94041_2_) {
        return false;
    }
}

package hnsdieter.chargecore.block;

import cpw.mods.fml.common.eventhandler.SubscribeEvent;
import hnsdieter.chargecore.ChargeCore;
import hnsdieter.chargecore.tileentity.BaseGeneratorTileEntity;
import net.minecraft.block.Block;
import net.minecraft.block.material.Material;
import net.minecraft.entity.item.EntityItem;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.inventory.IInventory;
import net.minecraft.item.ItemStack;
import net.minecraft.nbt.NBTTagCompound;
import net.minecraft.tileentity.TileEntity;
import net.minecraft.world.World;
import net.minecraftforge.event.world.BlockEvent;

import java.util.Random;

/**
* Created by Andy on 31.08.2014.
*/
public class BaseGenerator extends BaseBlock {

    public BaseGenerator(Material material) {
        super(material);
    }

    @Override
    public boolean onBlockActivated(World world, int x, int y, int z, EntityPlayer player, int metadata, float what, float these, float are){
        TileEntity tileEntity = world.getTileEntity(x, y, z);
        if(tileEntity == null || player.isSneaking()){
            return false;
        }

        player.openGui(ChargeCore.instance, 0, world, x, y, z);
        return true;
    }

    @Override
    public void breakBlock(World world, int x, int y, int z, Block block, int par6){
        Random rand = new Random();

        BaseGeneratorTileEntity tileEntity = (BaseGeneratorTileEntity) world.getTileEntity(x, y, z);

        if(tileEntity != null) {
            for (int i = 0; i < tileEntity.getSizeInventory(); i++) {
                ItemStack itemStack = tileEntity.getStackInSlot(i);

                if (itemStack != null) {
                    float rx = rand.nextFloat() * 0.8F + 0.1F;
                    float rz = rand.nextFloat() * 0.8F + 0.1F;

                    EntityItem entityItem;

                    for (float ry = rand.nextFloat() * 0.8F + 0.1F; itemStack.stackSize > 0; world.spawnEntityInWorld(entityItem)) {

                        int j1 = rand.nextInt(21) + 10;

                        if (j1 > itemStack.stackSize) {
                            j1 = itemStack.stackSize;
                        }

                        itemStack.stackSize -= j1;
                        entityItem = new EntityItem(world, (double) ((float) x + rx), (double) ((float) y + rz), (double) ((float) z + ry));
                        float factor = 0.05F;
                        entityItem.motionX = rand.nextGaussian() * factor;
                        entityItem.motionY = rand.nextGaussian() * factor + 0.2F;
                        entityItem.motionZ = rand.nextGaussian() * factor;

                        if (itemStack.hasTagCompound()) {
                            entityItem.getEntityItem().setTagCompound((NBTTagCompound) itemStack.getTagCompound().copy());
                        }
                    }
                }
            }
            world.func_147453_f(x, y, z, block);
        }
        super.breakBlock(world, x, y, z, block, par6);
    }

    public TileEntity createNewTileEntity(World world, int par2){
        return  new BaseGeneratorTileEntity(9, "BaseGenerator");
    }
}

Link to comment
Share on other sites

You need to add this to tile entity:

@Override
public Packet getDescriptionPacket() {
NBTTagCompound tag = new NBTTagCompound();
writeToNBT(tag);
return new S35PacketUpdateTileEntity(xCoord, yCoord, zCoord, 1, tag);
}
@Override
public void onDataPacket(NetworkManager net, S35PacketUpdateTileEntity pkt) {
readFromNBT(pkt.func_148857_g());
}

This is supposed to solve not saving, because it synchronises tiles.

Link to comment
Share on other sites

After a closer look at TileEntityChest I came up with this solution, but it still doesnt work:

package hnsdieter.chargecore.tileentity;

import hnsdieter.chargecore.block.BaseGenerator;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.inventory.IInventory;
import net.minecraft.inventory.ISidedInventory;
import net.minecraft.item.ItemStack;
import net.minecraft.nbt.NBTTagCompound;
import net.minecraft.nbt.NBTTagList;
import net.minecraft.network.NetworkManager;
import net.minecraft.network.Packet;
import net.minecraft.network.play.server.S35PacketUpdateTileEntity;
import net.minecraft.tileentity.TileEntity;

/**
* Created by Andy on 31.08.2014.
*/
public class BaseGeneratorTileEntity extends TileEntity implements ISidedInventory{

    private  ItemStack[] itemStacks;
    private  String invName;

    public BaseGeneratorTileEntity(int size, String displayName){
        itemStacks = new ItemStack[size];
        invName = displayName;
    }



    /*NBT*/
    @Override
    public void readFromNBT(NBTTagCompound nbtTagCompound){
        super.readFromNBT(nbtTagCompound);

        NBTTagList tagList = nbtTagCompound.getTagList("Inventory", 10);
        for (int i = 0; i < tagList.tagCount(); i++){
            NBTTagCompound nbtTagCompound1 = (NBTTagCompound)tagList.getCompoundTagAt(i);
            byte slot = nbtTagCompound1.getByte("Slot");
            if(slot >= 0 && slot < itemStacks.length){
                itemStacks[slot] = ItemStack.loadItemStackFromNBT(nbtTagCompound1);
            }
        }
    }

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

        NBTTagList tagList = new NBTTagList();
        for(int i = 0; i < itemStacks.length; i++){
            ItemStack itemStack = itemStacks[i];
            if(itemStack != null){
                NBTTagCompound nbtTagCompound1 = new NBTTagCompound();
                nbtTagCompound1.setByte("Slot", (byte) i );
                itemStack.writeToNBT(nbtTagCompound1);
                tagList.appendTag(nbtTagCompound1);
            }
        }
        nbtTagCompound.setTag("Inventory", tagList);
    }

    @Override
    public void updateEntity(){
        super.updateEntity();
    }

    /*Inventory*/
    @Override
    public int getSizeInventory() {
        return itemStacks.length;
    }

    @Override
    public ItemStack getStackInSlot(int slot) {
        return itemStacks[slot];
    }

    @Override
    public ItemStack decrStackSize(int slot, int amount) {
        if(this.itemStacks != null){
            ItemStack item;
            if(this.itemStacks[slot].stackSize <= amount){
                item = this.getStackInSlot(slot);
                this.setInventorySlotContents(slot, null);
                this.markDirty();
                return item;
            }else{
                item = this.getStackInSlot(slot).splitStack(amount);
                if(this.itemStacks[slot].stackSize == 0){
                    this.setInventorySlotContents(slot, null);
                }
                this.markDirty();
                return  item;
            }
        }else{
            return null;
        }
    }

    @Override
    public ItemStack getStackInSlotOnClosing(int slot) {
        if(itemStacks[slot] != null){
            ItemStack item = this.itemStacks[slot];
            this.itemStacks[slot] = null;
            return item;
        }else{
            return null;
        }
    }

    @Override
    public void setInventorySlotContents(int slot, ItemStack stack) {
        itemStacks[slot] = stack;
        if(stack != null && stack.stackSize > getInventoryStackLimit()){
            stack.stackSize = getInventoryStackLimit();
        }
        this.markDirty();
    }

    @Override
    public String getInventoryName() {
        if(hasCustomInventoryName() == true){
            return invName;
        }else{
            return null;
        }
    }

    @Override
    public boolean hasCustomInventoryName() {
        if (invName != null && invName.length() < 0) {
            return true;
        } else {
            return false;

        }
    }

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

    @Override
    public boolean isUseableByPlayer(EntityPlayer player) {
        return worldObj.getTileEntity(xCoord, yCoord, zCoord) == this &&
                player.getDistanceSq(xCoord + 0.5, yCoord + 0.5, zCoord + 0.5) < 64;
    }

    @Override
    public Packet getDescriptionPacket() {
        NBTTagCompound tag = new NBTTagCompound();
        writeToNBT(tag);
        return new S35PacketUpdateTileEntity(xCoord, yCoord, zCoord, 1, tag);
}
    @Override
    public void onDataPacket(NetworkManager net, S35PacketUpdateTileEntity pkt) {
        readFromNBT(pkt.func_148857_g());
    }

    @Override
    public void openInventory() {

    }

    @Override
    public void closeInventory() {

    }

    @Override
    public boolean isItemValidForSlot(int p_94041_1_, ItemStack p_94041_2_) {
        return false;
    }
}

Link to comment
Share on other sites

For the Inventory not saving, what debugging have you tried?

If you are using Eclipse you can set-up debug points around writeToNBT and readFromNBT at different points and see if it actually writes/reads your items. Then you can figre out if it's a problem with the saving/loading or if there's a problem with the inventory slots etc.

Or if you are not using Eclipse, use good old prints(System.out.println).

 

 

Link to comment
Share on other sites

After struggling with similar problems on this thread http://www.minecraftforge.net/forum/index.php/topic,22360.msg114869.html#msg114869, it was pointed out to me that the gui should be opened on the server side only:

 

if (!world.isRemote) {
        player.openGui(ChargeCore.instance, 0, world, x, y, z);
        return true;
}

 

If you put printlns in your two gui handler methods, you can see what effect this has on how they are called.

 

The suggestion by MultiMote to use InventoryBasic will reduce the amount of code you are writing and help pinpoint the problem. Give your tile entity an InventoryBasic instead of implementing IInventory:

 

public class BaseGeneratorTileEntity extends TileEntity {

    IInventory inventory = new InventoryBasic("BaseGenerator", false, 9);

Link to comment
Share on other sites

After a closer look with the println() I saw that the NBT data are written and readed if I place the Block, when i close the world they are written, but if i reopen they give me this crashlog I must totally missed the last days as I was trying to make it work:

 

java.lang.InstantiationException: hnsdieter.chargecore.tileentity.BaseGeneratorTileEntity
at java.lang.Class.newInstance(Class.java:359)
at net.minecraft.tileentity.TileEntity.createAndLoadEntity(TileEntity.java:127)
at net.minecraft.world.chunk.storage.AnvilChunkLoader.loadEntities(AnvilChunkLoader.java:525)
at net.minecraftforge.common.chunkio.ChunkIOProvider.callStage2(ChunkIOProvider.java:41)
at net.minecraftforge.common.chunkio.ChunkIOProvider.callStage2(ChunkIOProvider.java:12)
at net.minecraftforge.common.util.AsynchronousExecutor.skipQueue(AsynchronousExecutor.java:344)
at net.minecraftforge.common.util.AsynchronousExecutor.getSkipQueue(AsynchronousExecutor.java:302)
at net.minecraftforge.common.chunkio.ChunkIOExecutor.syncChunkLoad(ChunkIOExecutor.java:12)
at net.minecraft.world.gen.ChunkProviderServer.loadChunk(ChunkProviderServer.java:146)
at net.minecraft.world.gen.ChunkProviderServer.loadChunk(ChunkProviderServer.java:121)
at net.minecraft.server.MinecraftServer.initialWorldChunkLoad(MinecraftServer.java:315)
at net.minecraft.server.integrated.IntegratedServer.loadAllWorlds(IntegratedServer.java:79)
at net.minecraft.server.integrated.IntegratedServer.startServer(IntegratedServer.java:96)
at net.minecraft.server.MinecraftServer.run(MinecraftServer.java:455)
at net.minecraft.server.MinecraftServer$2.run(MinecraftServer.java:762)

 

And if I give the TileEntity InventoryBasic I need to bind the Container and GUI manually, or not?

Link to comment
Share on other sites

Ive got a cnstructur is it a matter if i got parameters in there?

 

    private  ItemStack[] itemStacks;
    private  String invName;

    public BaseGeneratorTileEntity(int size, String displayName){
        itemStacks = new ItemStack[size];
        invName = displayName;
    }

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



  • Recently Browsing

    • No registered users viewing this page.
  • Posts

    • My forge 1.12.2 server is very slow and laggy. The reason is probably because every 5 seconds, the console spits out this message (or smth like it):   Running 15ms behind! Is the server overloaded? Skipping 60 ticks (example, but keeps sending messages just like it)   I've been trying to allocate ram to fix this issue. How can I do this on 1.12.2? There is no jvm args.txt, like in 1.20.1.  
    • I am trying to play an old modpack on curseforge but I can't even get to the main screen before this error message pops up. Can anyone tell me how to fix this?     pw.mods.fml.common.LoaderException: java.lang.ExceptionInInitializerError     at cpw.mods.fml.common.LoadController.transition(LoadController.java:163)     at cpw.mods.fml.common.Loader.loadMods(Loader.java:544)     at cpw.mods.fml.client.FMLClientHandler.beginMinecraftLoading(FMLClientHandler.java:208)     at net.minecraft.client.Minecraft.func_71384_a(Minecraft.java:480)     at net.minecraft.client.Minecraft.func_99999_d(Minecraft.java:878)     at net.minecraft.client.main.Main.main(SourceFile:148)     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:497)     at net.minecraft.launchwrapper.Launch.launch(Launch.java:135)     at net.minecraft.launchwrapper.Launch.main(Launch.java:28) Caused by: java.lang.ExceptionInInitializerError     at java.lang.Class.forName0(Native Method)     at java.lang.Class.forName(Class.java:348)     at cpw.mods.fml.common.ProxyInjector.inject(ProxyInjector.java:59)     at cpw.mods.fml.common.FMLModContainer.constructMod(FMLModContainer.java:512)     at sun.reflect.GeneratedMethodAccessor4.invoke(Unknown Source)     at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)     at java.lang.reflect.Method.invoke(Method.java:497)     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 cpw.mods.fml.common.LoadController.sendEventToModContainer(LoadController.java:212)     at cpw.mods.fml.common.LoadController.propogateStateMessage(LoadController.java:190)     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:497)     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 cpw.mods.fml.common.LoadController.distributeStateMessage(LoadController.java:119)     at cpw.mods.fml.common.Loader.loadMods(Loader.java:513)     ... 10 more Caused by: com.google.gson.JsonSyntaxException: java.lang.IllegalStateException: Expected BEGIN_ARRAY but was STRING at line 1 column 1     at com.google.gson.Gson.fromJson(Gson.java:815)     at com.google.gson.Gson.fromJson(Gson.java:768)     at com.google.gson.Gson.fromJson(Gson.java:717)     at com.google.gson.Gson.fromJson(Gson.java:689)     at net.ilexiconn.llibrary.client.ClientProxy.<clinit>(ClientProxy.java:34)     ... 35 more Caused by: java.lang.IllegalStateException: Expected BEGIN_ARRAY but was STRING at line 1 column 1     at com.google.gson.stream.JsonReader.beginArray(JsonReader.java:338)     at com.google.gson.internal.bind.ArrayTypeAdapter.read(ArrayTypeAdapter.java:70)     at com.google.gson.Gson.fromJson(Gson.java:803)     ... 39 more A detailed walkthrough of the error, its code path and all known details is as follows: --------------------------------------------------------------------------------------- -- System Details -- Details:     Minecraft Version: 1.7.10     Operating System: Windows 10 (amd64) version 10.0     Java Version: 1.8.0_51, Oracle Corporation     Java VM Version: Java HotSpot(TM) 64-Bit Server VM (mixed mode), Oracle Corporation     Memory: 482358976 bytes (460 MB) / 1571815424 bytes (1499 MB) up to 3280994304 bytes (3129 MB)     JVM Flags: 3 total; -XX:HeapDumpPath=MojangTricksIntelDriversForPerformance_javaw.exe_minecraft.exe.heapdump -Xmx3520m -Xms256m     AABB Pool Size: 0 (0 bytes; 0 MB) allocated, 0 (0 bytes; 0 MB) used     IntCache: cache: 0, tcache: 0, allocated: 0, tallocated: 0     FML: MCP v9.05 FML v7.10.99.99 Minecraft Forge 10.13.4.1566 151 mods loaded, 151 mods active     States: 'U' = Unloaded 'L' = Loaded 'C' = Constructed 'H' = Pre-initialized 'I' = Initialized 'J' = Post-initialized 'A' = Available 'D' = Disabled 'E' = Errored     UC    mcp{9.05} [Minecraft Coder Pack] (minecraft.jar)      UC    FML{7.10.99.99} [Forge Mod Loader] (forge-1.7.10-10.13.4.1566-1.7.10.jar)      UC    Forge{10.13.4.1566} [Minecraft Forge] (forge-1.7.10-10.13.4.1566-1.7.10.jar)      UC    appliedenergistics2-core{rv2-stable-10} [AppliedEnergistics2 Core] (minecraft.jar)      UC    CodeChickenCore{1.0.7.47} [CodeChicken Core] (minecraft.jar)      UC    MobiusCore{1.2.5} [MobiusCore] (minecraft.jar)      UC    NotEnoughItems{1.0.5.120} [Not Enough Items] (NotEnoughItems-1.7.10-1.0.5.120-universal.jar)      UC    voltzenginepreloader{0.0.1} [Voltz Engine Preloader] (minecraft.jar)      UC    <CoFH ASM>{000} [CoFH ASM] (minecraft.jar)      UC    FastCraft{1.25} [FastCraft] (fastcraft-1.25.jar)      UC    debug{1.0} [debug] (denseores-1.6.2.jar)      UC    ExtendedPotions{1.2} [Extended Potions] (ExtendedPotions-MC1.7.10-1.2.jar)      UC    securitycraft{v1.8.13} [SecurityCraft] ([1.7.10] SecurityCraft v1.8.13.jar)      UC    DamageIndicatorsMod{3.2.0} [Damage Indicators] ([1.7.10]DamageIndicatorsMod-3.2.0.jar)      UC    movillages{1.4.2} [Mo' Villages] ([1.7.10]MoVillages-1.4.2.jar)      UC    Baubles{1.0.1.10} [Baubles] (Baubles-1.7.10-1.0.1.10.jar)      UC    adventurebackpack{1.7.10-0.8b} [Adventure Backpack] (adventurebackpack-1.7.10-0.8c.jar)      UC    AnimationAPI{1.2.4} [AnimationAPI] (AnimationAPI-1.7.10-1.2.4.jar)      UC    appliedenergistics2{rv2-stable-10} [Applied Energistics 2] (appliedenergistics2-rv2-stable-10.jar)      UC    ArchimedesShips{1.7.10 v1.7.1} [Archimedes' Ships] (ArchimedesShips-1.7.1.jar)      UC    bookshelf{1.0.4.187} [Bookshelf] (Bookshelf-1.7.10-1.0.4.187.jar)      UC    betterboat{1.1.0} [Better Boat] (BetterBoat-1.7.10-1.1.0.jar)      UC    betterbuilderswands{0.8.1} [Better Builder's Wands] (BetterBuildersWands-0.8.1-1.7.10r92+aec06c3.jar)      UC    BiblioCraft{1.11.7} [BiblioCraft] (BiblioCraft[v1.11.7][MC1.7.10].jar)      UC    Mantle{1.7.10-0.3.2.jenkins191} [Mantle] (Mantle-1.7.10-0.3.2b.jar)      UC    Natura{2.2.0} [Natura] (natura-1.7.10-2.2.0.1.jar)      UC    BiomesOPlenty{2.1.0} [Biomes O' Plenty] (BiomesOPlenty-1.7.10-2.1.0.1889-universal.jar)      UC    BiblioWoodsBoP{1.9} [BiblioWoods Biomes O'Plenty Edition] (BiblioWoods[BiomesOPlenty][v1.9].jar)      UC    ExtrabiomesXL{3.16.4} [ExtrabiomesXL] (extrabiomesxl_1.7.10-3.16.4.jar)      UC    BiblioWoodsEBXL{1.4} [BiblioWoods ExtraBiomesXL Edition] (BiblioWoods[ExtraBiomesXL][v1.4].jar)      UC    IC2{2.2.827-experimental} [IndustrialCraft 2] (industrialcraft-2-2.2.827-experimental.jar)      UC    CoFHCore{1.7.10R3.1.4} [CoFH Core] (CoFHCore-[1.7.10]3.1.4-329.jar)      UC    Forestry{4.2.16.64} [Forestry for Minecraft] (forestry_1.7.10-4.2.16.64.jar)      UC    BiblioWoodsForestry{1.7} [BiblioWoods Forestry Edition] (BiblioWoods[Forestry][v1.7].jar)      UC    BiblioWoodsNatura{1.5} [BiblioWoods Natura Edition] (BiblioWoods[Natura][v1.5].jar)      UC    ThermalFoundation{1.7.10R1.2.6} [Thermal Foundation] (ThermalFoundation-[1.7.10]1.2.6-118.jar)      UC    ThermalExpansion{1.7.10R4.1.5} [Thermal Expansion] (ThermalExpansion-[1.7.10]4.1.5-248.jar)      UC    BigReactors{0.4.3A} [Big Reactors] (BigReactors-0.4.3A.jar)      UC    Thaumcraft{4.2.3.5} [Thaumcraft] (Thaumcraft-1.7.10-4.2.3.5.jar)      UC    Botania{r1.8-249} [Botania] (Botania r1.8-249.jar)      UC    BuildCraft|Core{7.1.23} [BuildCraft] (buildcraft-7.1.23.jar)      UC    BuildCraft|Transport{7.1.23} [BC Transport] (buildcraft-7.1.23.jar)      UC    BuildCraft|Factory{7.1.23} [BC Factory] (buildcraft-7.1.23.jar)      UC    BuildCraft|Silicon{7.1.23} [BC Silicon] (buildcraft-7.1.23.jar)      UC    BuildCraft|Robotics{7.1.23} [BC Robotics] (buildcraft-7.1.23.jar)      UC    BuildCraft|Energy{7.1.23} [BC Energy] (buildcraft-7.1.23.jar)      UC    BuildCraft|Builders{7.1.23} [BC Builders] (buildcraft-7.1.23.jar)      UC    Railcraft{9.12.2.0} [Railcraft] (Railcraft_1.7.10-9.12.2.0.jar)      UC    TwilightForest{2.3.7} [The Twilight Forest] (twilightforest-1.7.10-2.3.7.jar)      UC    ForgeMultipart{1.2.0.345} [Forge Multipart] (ForgeMultipart-1.7.10-1.2.0.345-universal.jar)      UC    chisel{2.9.5.11} [Chisel] (Chisel-2.9.5.11.jar)      UC    CarpentersBlocks{3.3.8.1} [Carpenter's Blocks] (Carpenter's Blocks v3.3.8.1 - MC 1.7.10.jar)      UC    ChickenChunks{1.3.4.19} [ChickenChunks] (ChickenChunks-1.7.10-1.3.4.19-universal.jar)      UC    chunkpregenerator{2.1} [Chunk Pregenerator] (Chunk Pregenerator V1.7.10-2.1.jar)      UC    customnpcs{1.7.10d} [CustomNpcs] (CustomNPCs_1.7.10d(29oct17).jar)      UC    PTRModelLib{1.0.0} [PTRModelLib] (Decocraft-2.4.2_1.7.10.jar)      UC    props{2.4.2} [Decocraft] (Decocraft-2.4.2_1.7.10.jar)      UC    dldungeonsjdg{1.11.0} [Doomlike Dungeons] (DoomlikeDungeons-1.11.0-MC1.7.10.jar)      UC    DynamicLights{1.3.9a} [Dynamic Lights] (Dynamic Lights-1.3.9a-MC1.7.10.jar)      UC    emeraldmod{3.5.1} [EmeraldMod] (Emerald-Mod-1.7.10_1.jar)      UC    Mekanism{9.1.1} [Mekanism] (Mekanism-1.7.10-9.1.1.1031.jar)      UC    EnderIO{1.7.10-2.2.8.381} [Ender IO] (EnderIO-1.7.10-2.2.8.381.jar)      UC    EnderStorage{1.4.7.37} [EnderStorage] (EnderStorage-1.7.10-1.4.7.37-universal.jar)      UC    Waila{1.5.10} [Waila] (Waila-1.5.10_1.7.10.jar)      UC    extracells{2.3.14} [Extra Cells 2] (ExtraCells-1.7.10-2.3.14b200.jar)      UC    ExtraUtilities{1.2.12} [Extra Utilities] (extrautilities-1.2.12.jar)      UC    fastleafdecay{1.4} [Fast Leaf Decay] (FastLeafDecay-1.7.10-1.4.jar)      UC    FoodExpansion{1.0} [Food Expansion] (FoodExpansion1.1.1-mc1.7.10.jar)      UC    FpsReducer{mc1.7.10-1.10.3} [FPS Reducer] (FpsReducer-mc1.7.10-1.10.3.jar)      UC    FTBL{1.0.18.2} [FTBLib] (FTBLib-1.7.10-1.0.18.3.jar)      UC    FTBU{1.0.18.2} [FTBUtilities] (FTBUtilities-1.7.10-1.0.18.3.jar)      UC    fw{1.3.0} [Fullscreen Windowed] (FullscreenWindowed-1.7.10-1.3.0b.jar)      UC    gravestone{0.7.10.3} [Gravestone] (GraveStone Mod 0.7.10.3.jar)      UC    GrimoireOfGaia{1.0.0} [Grimoire of Gaia 3] (GrimoireOfGaia3-1.7.10-1.2.7.jar)      UC    TConstruct{1.7.10-1.8.8.build988} [Tinkers' Construct] (TConstruct-1.7.10-1.8.8.jar)      UC    voltzengine{1.9.14.302} [Voltz Engine] (VoltzEngine-1.7.10-1.9.14b302.jar)      UC    icbm{2.15.4.497} [ICBM] (ICBM-1.7.10-2.15.4b497.jar)      UC    icbmclassic{2.16.2.205} [ICBM-Classic] (ICBM-classic-1.7.10-2.16.2b205.jar)      UC    infinitycraft{1.0.0} [Infinity Craft] (infinitycraft-1.0.jar)      UC    InventoryPets{1.4.9.9b} [Inventory Pets] (inventorypets-1.7.10-1.4.9.9b-universal.jar)      UC    IronChest{6.0.62.742} [Iron Chest] (ironchest-1.7.10-6.0.62.742-universal.jar)      UC    ItsRainingFood{1.0.2} [It's Raining Food] (itsrainingfood-1.7.10-1.0.4.jar)      UC    JABBA{1.2.2} [JABBA] (Jabba-1.2.2_1.7.10.jar)      UC    journeymap{5.1.4p2} [JourneyMap] (journeymap-1.7.10-5.1.4p2-unlimited.jar)      UE    llibrary{1.5.1} [LLibrary] (llibrary-1.5.1-1.7.10.jar)      UE    jurassicraft{1.5.0} [JurassiCraft] (JurassiCraft-1.4.0.jar)      UC    LogisticsPipes{0.9.3.132} [Logistics Pipes] (logisticspipes-0.9.3.132.jar)      UC    lootbags{2.0.17} [Loot Bags] (LootBags-1.7.10-2.0.17.jar)      UC    magicalcrops{1.7.2 - 0.1 ALPHA} [Magical Crops] (magicalcrops-1.7.10_0.1.jar)      UC    MagicBees{2.4.4} [Magic Bees] (magicbees-1.7.10-2.4.4.jar)      UC    malisiscore{1.7.10-0.14.3} [MalisisCore] (malisiscore-1.7.10-0.14.3.jar)      UC    malisisdoors{1.7.10-1.13.2} [Malisis' Doors] (malisisdoors-1.7.10-1.13.2.jar)      UC    MekanismGenerators{9.1.1} [MekanismGenerators] (MekanismGenerators-1.7.10-9.1.1.1031.jar)      UC    MekanismTools{9.1.1} [MekanismTools] (MekanismTools-1.7.10-9.1.1.1031.jar)      UC    MobProperties{1.0.2} [Mob Properties] (MobProperties-1.7.10-1.0.2.jar)      UC    morechisels{@VERSION@} [More Chisels] (MoreChisels-1.7.10-1.0-28.jar)      UC    Morpheus{1.7.10-1.6.21} [Morpheus] (Morpheus-1.7.10-1.6.21.jar)      UC    MouseTweaks{2.4.4} [Mouse Tweaks] (MouseTweaks-2.4.4-mc1.7.10.jar)      UC    cfm{3.4.7} [§9MrCrayfish's Furniture Mod] (MrCrayfishFurnitureModv3.4.7(1.7.10).jar)      UC    MutantCreatures{1.4.9} [Mutant Creatures] (MutantCreatures-1.7.10-1.4.9.jar)      UC    NEIAddons{1.12.14.40} [NEI Addons] (neiaddons-1.12.14.40-mc1.7.10.jar)      UC    NEIAddons|Developer{1.12.14.40} [NEI Addons: Developer Tools] (neiaddons-1.12.14.40-mc1.7.10.jar)      UC    NEIAddons|AppEng{1.12.14.40} [NEI Addons: Applied Energistics 2] (neiaddons-1.12.14.40-mc1.7.10.jar)      UC    NEIAddons|Botany{1.12.14.40} [NEI Addons: Botany] (neiaddons-1.12.14.40-mc1.7.10.jar)      UC    NEIAddons|Forestry{1.12.14.40} [NEI Addons: Forestry] (neiaddons-1.12.14.40-mc1.7.10.jar)      UC    NEIAddons|CraftingTables{1.12.14.40} [NEI Addons: Crafting Tables] (neiaddons-1.12.14.40-mc1.7.10.jar)      UC    NEIAddons|ExNihilo{1.12.14.40} [NEI Addons: Ex Nihilo] (neiaddons-1.12.14.40-mc1.7.10.jar)      UC    neiintegration{1.1.2} [NEI Integration] (NEIIntegration-MC1.7.10-1.1.2.jar)      UC    NEIlootbags{1.1.3} [NEIlootbags] (NEIlootbags-1.7.10-1.1.3.jar)      UC    NetherOres{1.7.10R2.3.1} [Nether Ores] (NetherOres-[1.7.10]2.3.1-22.jar)      UC    OreSpawn{1.7.10.20.3} [OreSpawn] (orespawn-1.7.10-20.3.zip)      UC    origin{8.0.3} [Origin] (Origin-1.7.10-8.0.3.jar)      UC    addonscrewdriver{1.0.0} [OriginAddonScrewdriver] (Origin-1.7.10-8.0.3.jar)      UC    getalltheseeds{1.7.10a} [Pam's Get all the Seeds!] (Pam's Get all the Seeds 1.7.10a.jar)      UC    harvestcraft{1.7.10j} [Pam's HarvestCraft] (Pam's HarvestCraft 1.7.10Lb.jar)      UC    simplerecipes{1.7.10a} [Pam's Simple Recipes] (Pam's Simple Recipes 1.7.10a.jar)      UC    pandorasbox{2.0.1} [Pandora's Box] (PandorasBox-2.1.jar)      UC    ProjectE{1.7.10-PE1.10.1} [ProjectE] (ProjectE-1.7.10-PE1.10.1.jar)      UC    MrTJPCoreMod{1.1.0.33} [MrTJPCore] (MrTJPCore-1.1.0.33-universal.jar)      UC    ProjRed|Core{4.7.0pre12.95} [ProjectRed Core] (ProjectRed-1.7.10-4.7.0pre12.95-Base.jar)      UC    ProjRed|Transmission{4.7.0pre12.95} [ProjectRed Transmission] (ProjectRed-1.7.10-4.7.0pre12.95-Integration.jar)      UC    ProjRed|Transportation{4.7.0pre12.95} [ProjectRed Transportation] (ProjectRed-1.7.10-4.7.0pre12.95-Mechanical.jar)      UC    ProjRed|Compatibility{4.7.0pre12.95} [ProjectRed Compatibility] (ProjectRed-1.7.10-4.7.0pre12.95-Compat.jar)      UC    ProjRed|Integration{4.7.0pre12.95} [ProjectRed Integration] (ProjectRed-1.7.10-4.7.0pre12.95-Integration.jar)      UC    ProjRed|Illumination{4.7.0pre12.95} [ProjectRed Illumination] (ProjectRed-1.7.10-4.7.0pre12.95-Lighting.jar)      UC    ProjRed|Expansion{4.7.0pre12.95} [ProjectRed Expansion] (ProjectRed-1.7.10-4.7.0pre12.95-Mechanical.jar)      UC    ResourceLoader{1.3} [Resource Loader] (ResourceLoader-MC1.7.10-1.3.jar)      UC    Roguelike{1.5.0} [Roguelike Dungeons] (roguelike-1.7.10-1.5.0b.jar)      UC    runicdungeons{1.1.7b} [Runic Dungeons] (RunicDungeons-1.1.7b.jar)      UC    secretroomsmod{4.7.1} [The SecretRoomsMod] (secretroomsmod-1.7.10-4.7.1.413.jar)      UC    StorageDrawers{1.7.10-1.10.9} [Storage Drawers] (StorageDrawers-1.7.10-1.10.9.jar)      UC    Teletubbies{0.5.4} [Teletubbies] (Teletubbies-1.7.10-0.5.4.jar)      UC    TextureGeneratorLib{0.2} [TextureGeneratorLib] (TextureGeneratorLib-1.7.10_vBeta2.jar)      UC    Translocator{1.1.2.16} [Translocator] (Translocator-1.7.10-1.1.2.16-universal.jar)      UC    vampirism{0.7.9} [Vampirism] (Vampirism-1.7.10-0.7.9.jar)      UC    VeinMiner{0.36.0_1.7.10-28a7f13} [Vein Miner] (VeinMiner-1.7.10-0.36.0.496+28a7f13.jar)      UC    VeinMinerModSupport{0.36.0_1.7.10-28a7f13} [Mod Support] (VeinMiner-1.7.10-0.36.0.496+28a7f13.jar)      UC    voltzenginemodcompat{1.9.14.302} [Voltz Engine Mod Compatibility Loader] (VoltzEngine-1.7.10-1.9.14b302.jar)      UC    voltzenginemodflag{1.9.14.302} [VoltzEngine mod protection, flag, and region system] (VoltzEngine-1.7.10-1.9.14b302.jar)      UC    WailaHarvestability{1.1.6} [Waila Harvestability] (WailaHarvestability-mc1.7.10-1.1.6.jar)      UC    wawla{1.3.1} [What Are We Looking At] (Wawla-1.0.5.120.jar)      UC    witchery{0.24.1} [Witchery] (witchery-1.7.10-0.24.1.jar)      UC    WTFCore{1.7} [WhiskyTangoFox's Core] (WTFCore-1.7.10_v1.7.jar)      UC    CaveBiomes{1.6} [WhiskyTangoFox's CaveBiomes] (WTFCaveBiomes-1.7.10_v1.6.jar)      UC    YAFM{1.0.3} [Yet Another Food Mod] (yafm-1.0.3.jar)      UC    McMultipart{1.2.0.345} [Minecraft Multipart Plugin] (ForgeMultipart-1.7.10-1.2.0.345-universal.jar)      UC    ForgeRelocation{0.0.1.4} [ForgeRelocation] (ForgeRelocation-0.0.1.4-universal.jar)      UC    MCFrames{1.0} [MCFrames] (ForgeRelocation-0.0.1.4-universal.jar)      UC    RelocationFMP{0.0.1.2} [RelocationFMP] (ForgeRelocationFMP-0.0.1.2-universal.jar)      UC    denseores{1.0} [Dense Ores] (denseores-1.6.2.jar)      UC    ForgeMicroblock{1.2.0.345} [Forge Microblocks] (ForgeMultipart-1.7.10-1.2.0.345-universal.jar)      GL info: ' Vendor: 'NVIDIA Corporation' Version: '4.6.0 NVIDIA 536.23' Renderer: 'NVIDIA GeForce RTX 3090 Ti/PCIe/SSE2'     AE2 Version: stable rv2-stable-10 for Forge 10.13.2.1291     Mantle Environment: Environment healthy.     CoFHCore: -[1.7.10]3.1.4-329     ThermalFoundation: -[1.7.10]1.2.6-118     ThermalExpansion: -[1.7.10]4.1.5-248     TConstruct Environment: Environment healthy.     NetherOres: -[1.7.10]2.3.1-22
    • Update your AMD/ATI drivers - get the latest drivers from their website - do not update via system
    • I've been having this problem for a really long time now, i can run fabric fine and all but i want to play forge. I've tried to: Update my drivers, reinstall forge, reinstall minecraft. But after all of that, i still have the problem. Here is my crash report; https://paste.ee/p/w0FDJ Help!!  
  • Topics

×
×
  • Create New...

Important Information

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