Jump to content

Recommended Posts

Posted

How could I refresh information while my gui is open, i am able to update the info on background(exit and enter the gui with new correct information) but the foreground doesnt show change

  • Replies 58
  • Created
  • Last Reply

Top Posters In This Topic

Top Posters In This Topic

Posted
	@Override
	protected void drawGuiContainerForegroundLayer(int mouseX, int mouseY) {
		String s = I18n.format("container.basic"); //Gets the formatted name for the block breaker from the language file
		String stomachDisplay = this.stomach;
		this.mc.fontRendererObj.drawString(s, this.xSize / 2 - this.mc.fontRendererObj.getStringWidth(s) / 2, 6, 4210752); //Draws the block breaker name in the center on the top of the gui
		this.mc.fontRendererObj.drawString(this.playerInv.getDisplayName().getFormattedText(), 8, 72, 4210752); //The player's inventory name
		this.mc.fontRendererObj.drawString(stomachDisplay, this.xSize / 2 - this.mc.fontRendererObj.getStringWidth(stomachDisplay) / 2, 20, 4210752);
		int actualMouseX = mouseX - ((this.width - this.xSize) / 2);
		int actualMouseY = mouseY - ((this.height - this.ySize) / 2);
		
	}

(^guiBasic^)stomachDisplay is changes values, i do understand that that its only called on process interact of my EntityLiving

Basic

	@Override
	public boolean processInteract(EntityPlayer player, EnumHand hand)
    {
		
		if (!this.world.isRemote)
		{			
			int basicID = this.getEntityId(); //for inputing into x/y/z in the opne gui to pass the entety id
			System.out.println("Player has interacted with the mob");	
			player.openGui(TestModHandler.instance, GuiHandler.BASIC, this.world, basicID, this.stomach, 0);	
		}
		return true;
    }

is there a method to refresh the gui while its open rather then going in and out

Posted

Instead of setting stomach in the GUI constructor, replace it with a call to the stomach information directly from the entity inside drawGuiContainerForegroundLayer.

Posted
package com.clowcadia.test.gui;

import java.util.ArrayList;
import java.util.List;

import com.clowcadia.test.TestModHandler;
import com.clowcadia.test.containers.ContainerBasic;
import com.clowcadia.test.npc.Basic;
import com.clowcadia.tutorial3.Reference;

import net.minecraft.client.gui.inventory.GuiContainer;
import net.minecraft.client.renderer.GlStateManager;
import net.minecraft.client.resources.I18n;
import net.minecraft.entity.Entity;
import net.minecraft.inventory.Container;
import net.minecraft.inventory.IInventory;
import net.minecraft.item.ItemStack;
import net.minecraft.util.ResourceLocation;
import net.minecraft.util.math.RayTraceResult;
import net.minecraft.util.text.TextFormatting;
import net.minecraft.world.World;
import net.minecraftforge.common.capabilities.ICapabilityProvider;
import net.minecraftforge.items.CapabilityItemHandler;

public class GuiBasic extends GuiContainer{
	
	private IInventory playerInv;
	private Entity entity;
	private String stomach;

	public GuiBasic(IInventory playerInv, Entity entity, String stomach) {
		super(new ContainerBasic(playerInv, entity));
		
		
		this.xSize=176;
		this.ySize=166;
		
		this.playerInv = playerInv;
		this.entity = entity;
		this.stomach = stomach;
	}

	@Override
	protected void drawGuiContainerBackgroundLayer(float partialTicks, int mouseX, int mouseY) {
		GlStateManager.color(1.0F, 1.0F, 1.0F,1.0F);
		this.mc.getTextureManager().bindTexture(new ResourceLocation(TestModHandler.modId, "textures/gui/container/basic.png"));
		this.drawTexturedModalRect(this.guiLeft, this.guiTop, 0, 0, this.xSize,this.ySize);
		
	}
	
	/**
	 * Draws the text that is an overlay, i.e where it says Block Breaker in the gui on the top
	 */
	@Override
	protected void drawGuiContainerForegroundLayer(int mouseX, int mouseY) {
		String s = I18n.format("container.basic"); //Gets the formatted name for the block breaker from the language file
		String stomachDisplay = this.stomach;
		this.mc.fontRendererObj.drawString(s, this.xSize / 2 - this.mc.fontRendererObj.getStringWidth(s) / 2, 6, 4210752); //Draws the block breaker name in the center on the top of the gui
		this.mc.fontRendererObj.drawString(this.playerInv.getDisplayName().getFormattedText(), 8, 72, 4210752); //The player's inventory name
		this.mc.fontRendererObj.drawString(stomachDisplay, this.xSize / 2 - this.mc.fontRendererObj.getStringWidth(stomachDisplay) / 2, 20, 4210752);
		int actualMouseX = mouseX - ((this.width - this.xSize) / 2);
		int actualMouseY = mouseY - ((this.height - this.ySize) / 2);
		
	}
	

}
package com.clowcadia.test.containers;

import com.clowcadia.test.npc.Basic;
import com.clowcadia.test.utils.Utils;

import net.minecraft.entity.Entity;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.inventory.Container;
import net.minecraft.inventory.IInventory;
import net.minecraft.inventory.Slot;
import net.minecraft.world.World;
import net.minecraftforge.common.capabilities.ICapabilityProvider;
import net.minecraftforge.items.CapabilityItemHandler;
import net.minecraftforge.items.IItemHandler;
import net.minecraftforge.items.SlotItemHandler;

public class ContainerBasic extends Container{
	public Entity entity;
	
	public ContainerBasic(IInventory playerInv, Entity entity) {
		this.entity = entity;
		
		
		IItemHandler handler = entity.getCapability(CapabilityItemHandler.ITEM_HANDLER_CAPABILITY, null); //Gets the inventory from our tile entity

		//Our tile entity slots
		this.addSlotToContainer(new SlotItemHandler(handler, 0, 8,8));
		
	//The player's inventory slots
		int xPos = 8; //The x position of the top left player inventory slot on our texture
		int yPos = 84; //The y position of the top left player inventory slot on our texture

		//Player slots
		for (int y = 0; y < 3; ++y) {
			for (int x = 0; x < 9; ++x) {
				this.addSlotToContainer(new Slot(playerInv, x + y * 9 + 9, xPos + x * 18, yPos + y * 18));
			}
		}

		for (int x = 0; x < 9; ++x) {
			this.addSlotToContainer(new Slot(playerInv, x, xPos + x * 18, yPos + 58));
		}
		Utils.getLogger().info("Finish ContainerBasic");
	}
	
	@Override
	public boolean canInteractWith(EntityPlayer player) {
		return !player.isSpectator();
	}
}

 

Posted
4 minutes ago, clowcadia said:

nvm now the value resets, i needed to stay the same(resets during reload)

What do you mean by reload - do you mean when you save and quit the game and open it again? Post your updated code.

 

5 minutes ago, clowcadia said:

Ok i figurdd it out, yea it works. just requires a method to get the value and value must stay static

The value definitely should not be static, because it relates to an instance of the entity/container.

Posted

ok, the only thing is changed is the string for stomachDisplay

	@Override
	protected void drawGuiContainerForegroundLayer(int mouseX, int mouseY) {
		String s = I18n.format("container.basic"); //Gets the formatted name for the block breaker from the language file
		stomachDisplay = Basic.getStomach();
		this.mc.fontRendererObj.drawString(s, this.xSize / 2 - this.mc.fontRendererObj.getStringWidth(s) / 2, 6, 4210752); //Draws the block breaker name in the center on the top of the gui
		this.mc.fontRendererObj.drawString(this.playerInv.getDisplayName().getFormattedText(), 8, 72, 4210752); //The player's inventory name
		this.mc.fontRendererObj.drawString(stomachDisplay, this.xSize / 2 - this.mc.fontRendererObj.getStringWidth(stomachDisplay) / 2, 20, 4210752);
		int actualMouseX = mouseX - ((this.width - this.xSize) / 2);
		int actualMouseY = mouseY - ((this.height - this.ySize) / 2);
		
	}

static did what i wanted to do but yes on save and open world it went to 0 not previous value

Posted

A static method is not going to do what you want it to do. You need to get the stomach value from the instance of your entity that's associated with the container, not statically from the entity class.

Posted (edited)

Add a non-static method to your entity class that returns the stomach value, then call that method on the entity (this.entity) from your container. You will first need to cast the entity to your entity class to be able to call the method (although it probably makes more sense to change the declared type of the entity field and the constructor parameter and cast it earlier on in the process).

 

Edit: and don't forget to post your updated code!

Edited by Jay Avery
Posted
this.mc.fontRendererObj.drawString(((Basic) this.entity).getStomach()+"", this.xSize / 2 - this.mc.fontRendererObj.getStringWidth(stomachDisplay) / 2, 20, 4210752);

Ok i believe this what you said i should do(will take suggestion once i get this working(the one about initiating and declaring prior to input)) but the value does not appear correct anymoe stays at 0 even after alteration

Posted

My entity

Quote

private final ItemStackHandler handler;
	private String tagStomach = "Stomach";
	private int stomach;	
	private int stomachCap = 800;
	
	public Basic(World world) 
	{			
		super(world);		
		this.handler = new ItemStackHandler(9); 
		this.stomach = 0;
		//Utils.getLogger().info("basic constructor" +this.stomach);
	}
	public int getStomach(){
		return stomach;
	}

 

 

Posted

Ok... Do you know how to create an instance of your entity in your class?

Apparently I'm addicted to these forums and can't help but read all the posts. So if I somehow help you, please click the "Like This" button, it helps.

Posted
this.mc.fontRendererObj.drawString(Basic.instance.getStomach()+"", this.xSize / 2 - this.mc.fontRendererObj.getStringWidth(stomachDisplay) / 2, 20, 4210752);

for

public class Basic extends EntityLiving implements  ICapabilityProvider{
	
	public static Basic instance;

gets

2017-03-06 21:07:57,827 WARN Unable to instantiate org.fusesource.jansi.WindowsAnsiOutputStream
2017-03-06 21:07:57,829 WARN Unable to instantiate org.fusesource.jansi.WindowsAnsiOutputStream
[21:07:57] [main/INFO] [GradleStart]: Extra: []
[21:07:57] [main/INFO] [GradleStart]: Running with arguments: [--userProperties, {}, --assetsDir, C:/Users/Andre/.gradle/caches/minecraft/assets, --assetIndex, 1.11, --accessToken{REDACTED}, --version, 1.11.2, --tweakClass, net.minecraftforge.fml.common.launcher.FMLTweaker, --tweakClass, net.minecraftforge.gradle.tweakers.CoremodTweaker]
[21:07:58] [main/INFO] [LaunchWrapper]: Loading tweak class name net.minecraftforge.fml.common.launcher.FMLTweaker
[21:07:58] [main/INFO] [LaunchWrapper]: Using primary tweak class name net.minecraftforge.fml.common.launcher.FMLTweaker
[21:07:58] [main/INFO] [LaunchWrapper]: Loading tweak class name net.minecraftforge.gradle.tweakers.CoremodTweaker
[21:07:58] [main/INFO] [LaunchWrapper]: Calling tweak class net.minecraftforge.fml.common.launcher.FMLTweaker
[21:07:58] [main/INFO] [FML]: Forge Mod Loader version 13.20.0.2228 for Minecraft 1.11.2 loading
[21:07:58] [main/INFO] [FML]: Java is Java HotSpot(TM) 64-Bit Server VM, version 1.8.0_121, running on Windows 10:amd64:10.0, installed at C:\Program Files\JDK
[21:07:58] [main/INFO] [FML]: Managed to load a deobfuscated Minecraft name- we are in a deobfuscated environment. Skipping runtime deobfuscation
[21:07:58] [main/INFO] [LaunchWrapper]: Calling tweak class net.minecraftforge.gradle.tweakers.CoremodTweaker
[21:07:58] [main/INFO] [GradleStart]: Injecting location in coremod net.minecraftforge.fml.relauncher.FMLCorePlugin
[21:07:58] [main/INFO] [GradleStart]: Injecting location in coremod net.minecraftforge.classloading.FMLForgePlugin
[21:07:58] [main/INFO] [LaunchWrapper]: Loading tweak class name net.minecraftforge.fml.common.launcher.FMLInjectionAndSortingTweaker
[21:07:58] [main/INFO] [LaunchWrapper]: Loading tweak class name net.minecraftforge.fml.common.launcher.FMLDeobfTweaker
[21:07:58] [main/INFO] [LaunchWrapper]: Loading tweak class name net.minecraftforge.gradle.tweakers.AccessTransformerTweaker
[21:07:58] [main/INFO] [LaunchWrapper]: Calling tweak class net.minecraftforge.fml.common.launcher.FMLInjectionAndSortingTweaker
[21:07:58] [main/INFO] [LaunchWrapper]: Calling tweak class net.minecraftforge.fml.common.launcher.FMLInjectionAndSortingTweaker
[21:07:58] [main/INFO] [LaunchWrapper]: Calling tweak class net.minecraftforge.fml.relauncher.CoreModManager$FMLPluginWrapper
[21:07:58] [main/ERROR] [FML]: The binary patch set is missing. Either you are in a development environment, or things are not going to work!
[21:08:00] [main/ERROR] [FML]: FML appears to be missing any signature data. This is not a good thing
[21:08:00] [main/INFO] [LaunchWrapper]: Calling tweak class net.minecraftforge.fml.relauncher.CoreModManager$FMLPluginWrapper
[21:08:00] [main/INFO] [LaunchWrapper]: Calling tweak class net.minecraftforge.fml.common.launcher.FMLDeobfTweaker
[21:08:01] [main/INFO] [LaunchWrapper]: Calling tweak class net.minecraftforge.gradle.tweakers.AccessTransformerTweaker
[21:08:01] [main/INFO] [LaunchWrapper]: Loading tweak class name net.minecraftforge.fml.common.launcher.TerminalTweaker
[21:08:01] [main/INFO] [LaunchWrapper]: Calling tweak class net.minecraftforge.fml.common.launcher.TerminalTweaker
[21:08:01] [main/INFO] [LaunchWrapper]: Launching wrapped minecraft {net.minecraft.client.main.Main}
2017-03-06 21:08:01,785 WARN Unable to instantiate org.fusesource.jansi.WindowsAnsiOutputStream
2017-03-06 21:08:01,820 WARN Unable to instantiate org.fusesource.jansi.WindowsAnsiOutputStream
2017-03-06 21:08:01,822 WARN Unable to instantiate org.fusesource.jansi.WindowsAnsiOutputStream
[21:08:02] [Client thread/INFO]: Setting user: Player638
[21:08:08] [Client thread/WARN]: Skipping bad option: lastServer:
[21:08:08] [Client thread/INFO]: LWJGL Version: 2.9.4
[21:08:09] [Client thread/INFO]: [STDOUT]: ---- Minecraft Crash Report ----
// Ooh. Shiny.

Time: 3/6/17 9:08 PM
Description: Loading screen debug info

This is just a prompt for computer specs to be printed. THIS IS NOT A ERROR


A detailed walkthrough of the error, its code path and all known details is as follows:
---------------------------------------------------------------------------------------

-- System Details --
Details:
	Minecraft Version: 1.11.2
	Operating System: Windows 10 (amd64) version 10.0
	Java Version: 1.8.0_121, Oracle Corporation
	Java VM Version: Java HotSpot(TM) 64-Bit Server VM (mixed mode), Oracle Corporation
	Memory: 4036465544 bytes (3849 MB) / 4260102144 bytes (4062 MB) up to 4260102144 bytes (4062 MB)
	JVM Flags: 3 total; -Xincgc -Xmx4096M -Xms4096M
	IntCache: cache: 0, tcache: 0, allocated: 0, tallocated: 0
	FML: 
	Loaded coremods (and transformers): 
	GL info: ' Vendor: 'NVIDIA Corporation' Version: '4.5.0 NVIDIA 369.09' Renderer: 'GeForce 920MX/PCIe/SSE2'
[21:08:09] [Client thread/INFO] [FML]: MinecraftForge v13.20.0.2228 Initialized
[21:08:09] [Client thread/INFO] [FML]: Replaced 232 ore recipes
[21:08:10] [Client thread/INFO] [FML]: Found 0 mods from the command line. Injecting into mod discoverer
[21:08:10] [Client thread/INFO] [FML]: Searching C:\Users\Andre\OneDrive\Documents\forge\1.11\run\mods for mods
[21:08:12] [Client thread/INFO] [FML]: Forge Mod Loader has identified 8 mods to load
[21:08:13] [Client thread/INFO] [FML]: Attempting connection with missing mods [minecraft, mcp, FML, forge, testmod, tutorial, tutorial2, tutorial3] at CLIENT
[21:08:13] [Client thread/INFO] [FML]: Attempting connection with missing mods [minecraft, mcp, FML, forge, testmod, tutorial, tutorial2, tutorial3] at SERVER
[21:08:14] [Client thread/INFO]: Reloading ResourceManager: Default, FMLFileResourcePack:Forge Mod Loader, FMLFileResourcePack:Minecraft Forge, FMLFileResourcePack:Test Mod, FMLFileResourcePack:Tutorial Mod, FMLFileResourcePack:Tutorial Mod 2, FMLFileResourcePack:Tutorial Mod 3
[21:08:15] [Client thread/INFO] [FML]: Processing ObjectHolder annotations
[21:08:15] [Client thread/INFO] [FML]: Found 444 ObjectHolder annotations
[21:08:15] [Client thread/INFO] [FML]: Identifying ItemStackHolder annotations
[21:08:15] [Client thread/INFO] [FML]: Found 0 ItemStackHolder annotations
[21:08:15] [Client thread/INFO] [FML]: Applying holder lookups
[21:08:15] [Client thread/INFO] [FML]: Holder lookups applied
[21:08:15] [Client thread/INFO] [FML]: Applying holder lookups
[21:08:15] [Client thread/INFO] [FML]: Holder lookups applied
[21:08:15] [Client thread/INFO] [FML]: Applying holder lookups
[21:08:15] [Client thread/INFO] [FML]: Holder lookups applied
[21:08:15] [Client thread/INFO] [FML]: Configured a dormant chunk cache size of 0
[21:08:15] [Forge Version Check/INFO] [ForgeVersionCheck]: [forge] Starting version check at http://files.minecraftforge.net/maven/net/minecraftforge/forge/promotions_slim.json
[21:08:15] [Client thread/INFO]: [STDOUT]: Tutorial Mod 2 is loading!
[21:08:15] [Forge Version Check/INFO] [ForgeVersionCheck]: [forge] Found status: UP_TO_DATE Target: null
[21:08:15] [Client thread/INFO] [tutorial3]: PreInit
[21:08:15] [Client thread/INFO] [tutorial3]: Registered Block: tin_ore
[21:08:15] [Client thread/INFO] [tutorial3]: Registered Block: block_breaker
[21:08:15] [Client thread/INFO] [tutorial3]: Registered Item: chip
[21:08:15] [Client thread/INFO] [tutorial3]: Registered Render For tin_ore
[21:08:15] [Client thread/INFO] [tutorial3]: Registered Render For block_breaker
[21:08:15] [Client thread/INFO] [tutorial3]: Registered Render For block_breaker
[21:08:15] [Client thread/INFO] [tutorial3]: Registered Render For chip
[21:08:15] [Client thread/INFO] [tutorial3]: Registered Render For chip
[21:08:15] [Client thread/INFO] [FML]: Applying holder lookups
[21:08:15] [Client thread/INFO] [FML]: Holder lookups applied
[21:08:15] [Client thread/INFO] [FML]: Injecting itemstacks
[21:08:15] [Client thread/INFO] [FML]: Itemstack injection complete
[21:08:20] [Sound Library Loader/INFO]: Starting up SoundSystem...
[21:08:20] [Thread-8/INFO]: Initializing LWJGL OpenAL
[21:08:20] [Thread-8/INFO]: (The LWJGL binding of OpenAL.  For more information, see http://www.lwjgl.org)
[21:08:20] [Thread-8/INFO]: OpenAL initialized.
[21:08:20] [Sound Library Loader/INFO]: Sound engine started
[21:08:28] [Client thread/INFO] [FML]: Max texture size: 16384
[21:08:28] [Client thread/INFO]: Created: 16x16 textures-atlas
[21:08:28] [Client thread/ERROR] [FML]: Exception loading model for variant tutorial2:counter#inventory for item "tutorial2:counter", normal location exception: 
net.minecraftforge.client.model.ModelLoaderRegistry$LoaderException: Exception loading model tutorial2:item/counter with loader VanillaLoader.INSTANCE, skipping
	at net.minecraftforge.client.model.ModelLoaderRegistry.getModel(ModelLoaderRegistry.java:153) ~[ModelLoaderRegistry.class:?]
	at net.minecraftforge.client.model.ModelLoader.loadItemModels(ModelLoader.java:336) ~[ModelLoader.class:?]
	at net.minecraft.client.renderer.block.model.ModelBakery.loadVariantItemModels(ModelBakery.java:175) ~[ModelBakery.class:?]
	at net.minecraftforge.client.model.ModelLoader.setupModelRegistry(ModelLoader.java:156) ~[ModelLoader.class:?]
	at net.minecraft.client.renderer.block.model.ModelManager.onResourceManagerReload(ModelManager.java:28) [ModelManager.class:?]
	at net.minecraft.client.resources.SimpleReloadableResourceManager.registerReloadListener(SimpleReloadableResourceManager.java:122) [SimpleReloadableResourceManager.class:?]
	at net.minecraft.client.Minecraft.init(Minecraft.java:541) [Minecraft.class:?]
	at net.minecraft.client.Minecraft.run(Minecraft.java:387) [Minecraft.class:?]
	at net.minecraft.client.main.Main.main(Main.java:118) [Main.class:?]
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[?:1.8.0_121]
	at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source) ~[?:1.8.0_121]
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) ~[?:1.8.0_121]
	at java.lang.reflect.Method.invoke(Unknown Source) ~[?:1.8.0_121]
	at net.minecraft.launchwrapper.Launch.launch(Launch.java:135) [launchwrapper-1.12.jar:?]
	at net.minecraft.launchwrapper.Launch.main(Launch.java:28) [launchwrapper-1.12.jar:?]
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[?:1.8.0_121]
	at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source) ~[?:1.8.0_121]
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) ~[?:1.8.0_121]
	at java.lang.reflect.Method.invoke(Unknown Source) ~[?:1.8.0_121]
	at net.minecraftforge.gradle.GradleStartCommon.launch(GradleStartCommon.java:97) [start/:?]
	at GradleStart.main(GradleStart.java:26) [start/:?]
Caused by: java.io.FileNotFoundException: tutorial2:models/item/counter.json
	at net.minecraft.client.resources.FallbackResourceManager.getResource(FallbackResourceManager.java:69) ~[FallbackResourceManager.class:?]
	at net.minecraft.client.resources.SimpleReloadableResourceManager.getResource(SimpleReloadableResourceManager.java:65) ~[SimpleReloadableResourceManager.class:?]
	at net.minecraft.client.renderer.block.model.ModelBakery.loadModel(ModelBakery.java:334) ~[ModelBakery.class:?]
	at net.minecraftforge.client.model.ModelLoader.access$1600(ModelLoader.java:126) ~[ModelLoader.class:?]
	at net.minecraftforge.client.model.ModelLoader$VanillaLoader.loadModel(ModelLoader.java:937) ~[ModelLoader$VanillaLoader.class:?]
	at net.minecraftforge.client.model.ModelLoaderRegistry.getModel(ModelLoaderRegistry.java:149) ~[ModelLoaderRegistry.class:?]
	... 20 more
[21:08:28] [Client thread/ERROR] [FML]: Exception loading model for variant tutorial2:counter#inventory for item "tutorial2:counter", blockstate location exception: 
net.minecraftforge.client.model.ModelLoaderRegistry$LoaderException: Exception loading model tutorial2:counter#inventory with loader VariantLoader.INSTANCE, skipping
	at net.minecraftforge.client.model.ModelLoaderRegistry.getModel(ModelLoaderRegistry.java:153) ~[ModelLoaderRegistry.class:?]
	at net.minecraftforge.client.model.ModelLoader.loadItemModels(ModelLoader.java:344) ~[ModelLoader.class:?]
	at net.minecraft.client.renderer.block.model.ModelBakery.loadVariantItemModels(ModelBakery.java:175) ~[ModelBakery.class:?]
	at net.minecraftforge.client.model.ModelLoader.setupModelRegistry(ModelLoader.java:156) ~[ModelLoader.class:?]
	at net.minecraft.client.renderer.block.model.ModelManager.onResourceManagerReload(ModelManager.java:28) [ModelManager.class:?]
	at net.minecraft.client.resources.SimpleReloadableResourceManager.registerReloadListener(SimpleReloadableResourceManager.java:122) [SimpleReloadableResourceManager.class:?]
	at net.minecraft.client.Minecraft.init(Minecraft.java:541) [Minecraft.class:?]
	at net.minecraft.client.Minecraft.run(Minecraft.java:387) [Minecraft.class:?]
	at net.minecraft.client.main.Main.main(Main.java:118) [Main.class:?]
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[?:1.8.0_121]
	at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source) ~[?:1.8.0_121]
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) ~[?:1.8.0_121]
	at java.lang.reflect.Method.invoke(Unknown Source) ~[?:1.8.0_121]
	at net.minecraft.launchwrapper.Launch.launch(Launch.java:135) [launchwrapper-1.12.jar:?]
	at net.minecraft.launchwrapper.Launch.main(Launch.java:28) [launchwrapper-1.12.jar:?]
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[?:1.8.0_121]
	at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source) ~[?:1.8.0_121]
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) ~[?:1.8.0_121]
	at java.lang.reflect.Method.invoke(Unknown Source) ~[?:1.8.0_121]
	at net.minecraftforge.gradle.GradleStartCommon.launch(GradleStartCommon.java:97) [start/:?]
	at GradleStart.main(GradleStart.java:26) [start/:?]
Caused by: net.minecraft.client.renderer.block.model.ModelBlockDefinition$MissingVariantException
	at net.minecraft.client.renderer.block.model.ModelBlockDefinition.getVariant(ModelBlockDefinition.java:78) ~[ModelBlockDefinition.class:?]
	at net.minecraftforge.client.model.ModelLoader$VariantLoader.loadModel(ModelLoader.java:1253) ~[ModelLoader$VariantLoader.class:?]
	at net.minecraftforge.client.model.ModelLoaderRegistry.getModel(ModelLoaderRegistry.java:149) ~[ModelLoaderRegistry.class:?]
	... 20 more
[21:08:28] [Client thread/ERROR] [FML]: Exception loading blockstate for the variant tutorial2:counter#inventory: 
java.lang.Exception: Could not load model definition for variant tutorial2:counter
	at net.minecraftforge.client.model.ModelLoader.getModelBlockDefinition(ModelLoader.java:293) ~[ModelLoader.class:?]
	at net.minecraft.client.renderer.block.model.ModelBakery.loadBlock(ModelBakery.java:121) ~[ModelBakery.class:?]
	at net.minecraftforge.client.model.ModelLoader.loadBlocks(ModelLoader.java:248) ~[ModelLoader.class:?]
	at net.minecraftforge.client.model.ModelLoader.setupModelRegistry(ModelLoader.java:155) ~[ModelLoader.class:?]
	at net.minecraft.client.renderer.block.model.ModelManager.onResourceManagerReload(ModelManager.java:28) [ModelManager.class:?]
	at net.minecraft.client.resources.SimpleReloadableResourceManager.registerReloadListener(SimpleReloadableResourceManager.java:122) [SimpleReloadableResourceManager.class:?]
	at net.minecraft.client.Minecraft.init(Minecraft.java:541) [Minecraft.class:?]
	at net.minecraft.client.Minecraft.run(Minecraft.java:387) [Minecraft.class:?]
	at net.minecraft.client.main.Main.main(Main.java:118) [Main.class:?]
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[?:1.8.0_121]
	at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source) ~[?:1.8.0_121]
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) ~[?:1.8.0_121]
	at java.lang.reflect.Method.invoke(Unknown Source) ~[?:1.8.0_121]
	at net.minecraft.launchwrapper.Launch.launch(Launch.java:135) [launchwrapper-1.12.jar:?]
	at net.minecraft.launchwrapper.Launch.main(Launch.java:28) [launchwrapper-1.12.jar:?]
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[?:1.8.0_121]
	at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source) ~[?:1.8.0_121]
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) ~[?:1.8.0_121]
	at java.lang.reflect.Method.invoke(Unknown Source) ~[?:1.8.0_121]
	at net.minecraftforge.gradle.GradleStartCommon.launch(GradleStartCommon.java:97) [start/:?]
	at GradleStart.main(GradleStart.java:26) [start/:?]
Caused by: java.lang.RuntimeException: Encountered an exception when loading model definition of model tutorial2:blockstates/counter.json
	at net.minecraft.client.renderer.block.model.ModelBakery.loadMultipartMBD(ModelBakery.java:228) ~[ModelBakery.class:?]
	at net.minecraft.client.renderer.block.model.ModelBakery.getModelBlockDefinition(ModelBakery.java:208) ~[ModelBakery.class:?]
	at net.minecraftforge.client.model.ModelLoader.getModelBlockDefinition(ModelLoader.java:289) ~[ModelLoader.class:?]
	... 20 more
Caused by: java.io.FileNotFoundException: tutorial2:blockstates/counter.json
	at net.minecraft.client.resources.FallbackResourceManager.getAllResources(FallbackResourceManager.java:104) ~[FallbackResourceManager.class:?]
	at net.minecraft.client.resources.SimpleReloadableResourceManager.getAllResources(SimpleReloadableResourceManager.java:79) ~[SimpleReloadableResourceManager.class:?]
	at net.minecraft.client.renderer.block.model.ModelBakery.loadMultipartMBD(ModelBakery.java:221) ~[ModelBakery.class:?]
	at net.minecraft.client.renderer.block.model.ModelBakery.getModelBlockDefinition(ModelBakery.java:208) ~[ModelBakery.class:?]
	at net.minecraftforge.client.model.ModelLoader.getModelBlockDefinition(ModelLoader.java:289) ~[ModelLoader.class:?]
	... 20 more
[21:08:28] [Client thread/ERROR] [FML]: Exception loading model for variant tutorial2:counter#normal for blockstate "tutorial2:counter"
net.minecraftforge.client.model.ModelLoaderRegistry$LoaderException: Exception loading model tutorial2:counter#normal with loader VariantLoader.INSTANCE, skipping
	at net.minecraftforge.client.model.ModelLoaderRegistry.getModel(ModelLoaderRegistry.java:153) ~[ModelLoaderRegistry.class:?]
	at net.minecraftforge.client.model.ModelLoader.registerVariant(ModelLoader.java:260) ~[ModelLoader.class:?]
	at net.minecraft.client.renderer.block.model.ModelBakery.loadBlock(ModelBakery.java:153) ~[ModelBakery.class:?]
	at net.minecraftforge.client.model.ModelLoader.loadBlocks(ModelLoader.java:248) ~[ModelLoader.class:?]
	at net.minecraftforge.client.model.ModelLoader.setupModelRegistry(ModelLoader.java:155) ~[ModelLoader.class:?]
	at net.minecraft.client.renderer.block.model.ModelManager.onResourceManagerReload(ModelManager.java:28) [ModelManager.class:?]
	at net.minecraft.client.resources.SimpleReloadableResourceManager.registerReloadListener(SimpleReloadableResourceManager.java:122) [SimpleReloadableResourceManager.class:?]
	at net.minecraft.client.Minecraft.init(Minecraft.java:541) [Minecraft.class:?]
	at net.minecraft.client.Minecraft.run(Minecraft.java:387) [Minecraft.class:?]
	at net.minecraft.client.main.Main.main(Main.java:118) [Main.class:?]
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[?:1.8.0_121]
	at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source) ~[?:1.8.0_121]
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) ~[?:1.8.0_121]
	at java.lang.reflect.Method.invoke(Unknown Source) ~[?:1.8.0_121]
	at net.minecraft.launchwrapper.Launch.launch(Launch.java:135) [launchwrapper-1.12.jar:?]
	at net.minecraft.launchwrapper.Launch.main(Launch.java:28) [launchwrapper-1.12.jar:?]
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[?:1.8.0_121]
	at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source) ~[?:1.8.0_121]
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) ~[?:1.8.0_121]
	at java.lang.reflect.Method.invoke(Unknown Source) ~[?:1.8.0_121]
	at net.minecraftforge.gradle.GradleStartCommon.launch(GradleStartCommon.java:97) [start/:?]
	at GradleStart.main(GradleStart.java:26) [start/:?]
Caused by: net.minecraft.client.renderer.block.model.ModelBlockDefinition$MissingVariantException
	at net.minecraft.client.renderer.block.model.ModelBlockDefinition.getVariant(ModelBlockDefinition.java:78) ~[ModelBlockDefinition.class:?]
	at net.minecraftforge.client.model.ModelLoader$VariantLoader.loadModel(ModelLoader.java:1253) ~[ModelLoader$VariantLoader.class:?]
	at net.minecraftforge.client.model.ModelLoaderRegistry.getModel(ModelLoaderRegistry.java:149) ~[ModelLoaderRegistry.class:?]
	... 21 more
[21:08:29] [Client thread/INFO] [tutorial3]: Init
[21:08:29] [Client thread/INFO] [FML]: Injecting itemstacks
[21:08:29] [Client thread/INFO] [FML]: Itemstack injection complete
[21:08:29] [Client thread/INFO] [tutorial3]: PostInit
[21:08:29] [Client thread/INFO] [FML]: Forge Mod Loader has successfully loaded 8 mods
[21:08:29] [Client thread/INFO]: Reloading ResourceManager: Default, FMLFileResourcePack:Forge Mod Loader, FMLFileResourcePack:Minecraft Forge, FMLFileResourcePack:Test Mod, FMLFileResourcePack:Tutorial Mod, FMLFileResourcePack:Tutorial Mod 2, FMLFileResourcePack:Tutorial Mod 3
[21:08:34] [Client thread/INFO]: SoundSystem shutting down...
[21:08:34] [Client thread/WARN]: Author: Paul Lamb, www.paulscode.com
[21:08:34] [Sound Library Loader/INFO]: Starting up SoundSystem...
[21:08:34] [Thread-10/INFO]: Initializing LWJGL OpenAL
[21:08:34] [Thread-10/INFO]: (The LWJGL binding of OpenAL.  For more information, see http://www.lwjgl.org)
[21:08:34] [Thread-10/INFO]: OpenAL initialized.
[21:08:34] [Sound Library Loader/INFO]: Sound engine started
[21:08:40] [Client thread/INFO] [FML]: Max texture size: 16384
[21:08:40] [Client thread/INFO]: Created: 512x512 textures-atlas
[21:08:42] [Client thread/WARN]: Skipping bad option: lastServer:
[21:08:43] [Realms Notification Availability checker #1/INFO]: Could not authorize you against Realms server: Invalid session id
[21:08:56] [Server thread/INFO]: Starting integrated minecraft server version 1.11.2
[21:08:56] [Server thread/INFO]: Generating keypair
[21:08:57] [Server thread/INFO] [FML]: Injecting existing block and item data into this server instance
[21:08:57] [Server thread/INFO] [FML]: Applying holder lookups
[21:08:57] [Server thread/INFO] [FML]: Holder lookups applied
[21:08:57] [Server thread/INFO] [FML]: Loading dimension 0 (New World) (net.minecraft.server.integrated.IntegratedServer@21d313b9)
[21:08:57] [Server thread/INFO] [FML]: Loading dimension 1 (New World) (net.minecraft.server.integrated.IntegratedServer@21d313b9)
[21:08:57] [Server thread/INFO] [FML]: Loading dimension -1 (New World) (net.minecraft.server.integrated.IntegratedServer@21d313b9)
[21:08:57] [Server thread/INFO]: Preparing start region for level 0
[21:08:58] [Server thread/INFO] [testmod]: Reading Stomach
[21:08:59] [Server thread/INFO]: Changing view distance to 12, from 10
[21:09:00] [Netty Local Client IO #0/INFO] [FML]: Server protocol version 2
[21:09:00] [Netty Server IO #1/INFO] [FML]: Client protocol version 2
[21:09:00] [Netty Server IO #1/INFO] [FML]: Client attempting to join with 8 mods : [email protected],[email protected],[email protected],[email protected],[email protected],[email protected],[email protected],[email protected]_a
[21:09:00] [Netty Local Client IO #0/INFO] [FML]: [Netty Local Client IO #0] Client side modded connection established
[21:09:00] [Server thread/INFO] [FML]: [Server thread] Server side modded connection established
[21:09:00] [Server thread/INFO]: Player638[local:E:76fce12b] logged in with entity id 374 at (179.47596053662, 90.0, 227.5210949323458)
[21:09:00] [Server thread/INFO]: Player638 joined the game
[21:09:02] [Server thread/INFO]: Saving and pausing game...
[21:09:02] [Server thread/INFO]: Saving chunks for level 'New World'/Overworld
[21:09:02] [Server thread/INFO] [testmod]: Writing Stomach
[21:09:02] [Server thread/INFO]: Saving chunks for level 'New World'/Nether
[21:09:02] [Server thread/INFO]: Saving chunks for level 'New World'/The End
[21:09:02] [pool-2-thread-1/WARN]: Couldn't look up profile properties for com.mojang.authlib.GameProfile@765a0a0e[id=2107fded-a4bd-35bb-abc7-dae190b9909f,name=Player638,properties={},legacy=false]
com.mojang.authlib.exceptions.AuthenticationException: The client has sent too many requests within a certain amount of time
	at com.mojang.authlib.yggdrasil.YggdrasilAuthenticationService.makeRequest(YggdrasilAuthenticationService.java:79) ~[YggdrasilAuthenticationService.class:?]
	at com.mojang.authlib.yggdrasil.YggdrasilMinecraftSessionService.fillGameProfile(YggdrasilMinecraftSessionService.java:180) [YggdrasilMinecraftSessionService.class:?]
	at com.mojang.authlib.yggdrasil.YggdrasilMinecraftSessionService$1.load(YggdrasilMinecraftSessionService.java:60) [YggdrasilMinecraftSessionService$1.class:?]
	at com.mojang.authlib.yggdrasil.YggdrasilMinecraftSessionService$1.load(YggdrasilMinecraftSessionService.java:57) [YggdrasilMinecraftSessionService$1.class:?]
	at com.google.common.cache.LocalCache$LoadingValueReference.loadFuture(LocalCache.java:3524) [guava-17.0.jar:?]
	at com.google.common.cache.LocalCache$Segment.loadSync(LocalCache.java:2317) [guava-17.0.jar:?]
	at com.google.common.cache.LocalCache$Segment.lockedGetOrLoad(LocalCache.java:2280) [guava-17.0.jar:?]
	at com.google.common.cache.LocalCache$Segment.get(LocalCache.java:2195) [guava-17.0.jar:?]
	at com.google.common.cache.LocalCache.get(LocalCache.java:3934) [guava-17.0.jar:?]
	at com.google.common.cache.LocalCache.getOrLoad(LocalCache.java:3938) [guava-17.0.jar:?]
	at com.google.common.cache.LocalCache$LocalLoadingCache.get(LocalCache.java:4821) [guava-17.0.jar:?]
	at com.google.common.cache.LocalCache$LocalLoadingCache.getUnchecked(LocalCache.java:4827) [guava-17.0.jar:?]
	at com.mojang.authlib.yggdrasil.YggdrasilMinecraftSessionService.fillProfileProperties(YggdrasilMinecraftSessionService.java:170) [YggdrasilMinecraftSessionService.class:?]
	at net.minecraft.client.Minecraft.getProfileProperties(Minecraft.java:3056) [Minecraft.class:?]
	at net.minecraft.client.resources.SkinManager$3.run(SkinManager.java:138) [SkinManager$3.class:?]
	at java.util.concurrent.Executors$RunnableAdapter.call(Unknown Source) [?:1.8.0_121]
	at java.util.concurrent.FutureTask.run(Unknown Source) [?:1.8.0_121]
	at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source) [?:1.8.0_121]
	at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source) [?:1.8.0_121]
	at java.lang.Thread.run(Unknown Source) [?:1.8.0_121]
[21:09:06] [Server thread/INFO]: [STDOUT]: Player has interacted with the mob
[21:09:06] [Server thread/INFO] [testmod]: Finish ContainerBasic
[21:09:06] [Client thread/INFO] [testmod]: Finish ContainerBasic
[21:09:07] [Server thread/INFO]: Stopping server
[21:09:07] [Server thread/INFO]: Saving players
[21:09:07] [Server thread/INFO]: Saving worlds
[21:09:07] [Server thread/INFO]: Saving chunks for level 'New World'/Overworld
[21:09:07] [Server thread/INFO] [testmod]: Writing Stomach
[21:09:07] [Server thread/INFO]: Saving chunks for level 'New World'/Nether
[21:09:07] [Server thread/INFO]: Saving chunks for level 'New World'/The End
[21:09:07] [Server thread/INFO] [FML]: Unloading dimension 0
[21:09:07] [Server thread/INFO] [FML]: Unloading dimension -1
[21:09:07] [Server thread/INFO] [FML]: Unloading dimension 1
[21:09:07] [Server thread/INFO] [FML]: Applying holder lookups
[21:09:07] [Server thread/INFO] [FML]: Holder lookups applied
[21:09:08] [Client thread/FATAL]: Reported exception thrown!
net.minecraft.util.ReportedException: Rendering screen
	at net.minecraft.client.renderer.EntityRenderer.updateCameraAndRender(EntityRenderer.java:1191) ~[EntityRenderer.class:?]
	at net.minecraft.client.Minecraft.runGameLoop(Minecraft.java:1140) ~[Minecraft.class:?]
	at net.minecraft.client.Minecraft.run(Minecraft.java:407) [Minecraft.class:?]
	at net.minecraft.client.main.Main.main(Main.java:118) [Main.class:?]
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[?:1.8.0_121]
	at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source) ~[?:1.8.0_121]
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) ~[?:1.8.0_121]
	at java.lang.reflect.Method.invoke(Unknown Source) ~[?:1.8.0_121]
	at net.minecraft.launchwrapper.Launch.launch(Launch.java:135) [launchwrapper-1.12.jar:?]
	at net.minecraft.launchwrapper.Launch.main(Launch.java:28) [launchwrapper-1.12.jar:?]
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[?:1.8.0_121]
	at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source) ~[?:1.8.0_121]
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) ~[?:1.8.0_121]
	at java.lang.reflect.Method.invoke(Unknown Source) ~[?:1.8.0_121]
	at net.minecraftforge.gradle.GradleStartCommon.launch(GradleStartCommon.java:97) [start/:?]
	at GradleStart.main(GradleStart.java:26) [start/:?]
Caused by: java.lang.NullPointerException
	at com.clowcadia.test.gui.GuiBasic.drawGuiContainerForegroundLayer(GuiBasic.java:58) ~[GuiBasic.class:?]
	at net.minecraft.client.gui.inventory.GuiContainer.drawScreen(GuiContainer.java:136) ~[GuiContainer.class:?]
	at net.minecraftforge.client.ForgeHooksClient.drawScreen(ForgeHooksClient.java:382) ~[ForgeHooksClient.class:?]
	at net.minecraft.client.renderer.EntityRenderer.updateCameraAndRender(EntityRenderer.java:1164) ~[EntityRenderer.class:?]
	... 15 more
[21:09:08] [Client thread/INFO] [STDOUT]: [net.minecraft.init.Bootstrap:printToSYSOUT:600]: ---- Minecraft Crash Report ----
// Everything's going to plan. No, really, that was supposed to happen.

Time: 3/6/17 9:09 PM
Description: Rendering screen

java.lang.NullPointerException: Rendering screen
	at com.clowcadia.test.gui.GuiBasic.drawGuiContainerForegroundLayer(GuiBasic.java:58)
	at net.minecraft.client.gui.inventory.GuiContainer.drawScreen(GuiContainer.java:136)
	at net.minecraftforge.client.ForgeHooksClient.drawScreen(ForgeHooksClient.java:382)
	at net.minecraft.client.renderer.EntityRenderer.updateCameraAndRender(EntityRenderer.java:1164)
	at net.minecraft.client.Minecraft.runGameLoop(Minecraft.java:1140)
	at net.minecraft.client.Minecraft.run(Minecraft.java:407)
	at net.minecraft.client.main.Main.main(Main.java:118)
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
	at java.lang.reflect.Method.invoke(Unknown Source)
	at net.minecraft.launchwrapper.Launch.launch(Launch.java:135)
	at net.minecraft.launchwrapper.Launch.main(Launch.java:28)
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
	at java.lang.reflect.Method.invoke(Unknown Source)
	at net.minecraftforge.gradle.GradleStartCommon.launch(GradleStartCommon.java:97)
	at GradleStart.main(GradleStart.java:26)


A detailed walkthrough of the error, its code path and all known details is as follows:
---------------------------------------------------------------------------------------

-- Head --
Thread: Client thread
Stacktrace:
	at com.clowcadia.test.gui.GuiBasic.drawGuiContainerForegroundLayer(GuiBasic.java:58)
	at net.minecraft.client.gui.inventory.GuiContainer.drawScreen(GuiContainer.java:136)
	at net.minecraftforge.client.ForgeHooksClient.drawScreen(ForgeHooksClient.java:382)

-- Screen render details --
Details:
	Screen name: com.clowcadia.test.gui.GuiBasic
	Mouse location: Scaled: (213, 119). Absolute: (427, 240)
	Screen size: Scaled: (427, 240). Absolute: (854, 480). Scale factor of 2

-- Affected level --
Details:
	Level name: MpServer
	All players: 1 total; [EntityPlayerSP['Player638'/374, l='MpServer', x=179.48, y=90.00, z=227.52]]
	Chunk stats: MultiplayerChunkCache: 602, 602
	Level seed: 0
	Level generator: ID 00 - default, ver 1. Features enabled: false
	Level generator options: 
	Level spawn location: World: (256,64,176), Chunk: (at 0,4,0 in 16,11; contains blocks 256,0,176 to 271,255,191), Region: (0,0; contains chunks 0,0 to 31,31, blocks 0,0,0 to 511,255,511)
	Level time: 29869 game time, 29869 day time
	Level dimension: 0
	Level storage version: 0x00000 - Unknown?
	Level weather: Rain time: 0 (now: true), thunder time: 0 (now: false)
	Level game mode: Game mode: creative (ID 1). Hardcore: false. Cheats: false
	Forced entities: 121 total; [EntityCreeper['Creeper'/41, l='MpServer', x=103.50, y=32.00, z=166.50], EntityBat['Bat'/42, l='MpServer', x=106.57, y=30.10, z=179.76], EntitySkeleton['Skeleton'/43, l='MpServer', x=103.50, y=19.00, z=287.50], EntityPig['Pig'/44, l='MpServer', x=109.46, y=93.00, z=304.74], EntityPig['Pig'/46, l='MpServer', x=104.37, y=91.00, z=304.72], EntityCreeper['Creeper'/58, l='MpServer', x=125.50, y=39.00, z=206.05], EntityPig['Pig'/59, l='MpServer', x=123.64, y=97.00, z=301.49], EntitySpider['Spider'/65, l='MpServer', x=140.50, y=37.00, z=235.50], EntityCow['Cow'/66, l='MpServer', x=138.78, y=100.00, z=227.50], EntityCow['Cow'/67, l='MpServer', x=132.77, y=104.00, z=236.29], EntityCow['Cow'/68, l='MpServer', x=139.38, y=101.00, z=226.48], EntityCow['Cow'/69, l='MpServer', x=134.14, y=101.00, z=232.61], EntityLlama['Llama'/70, l='MpServer', x=144.48, y=101.00, z=226.34], EntityPig['Pig'/71, l='MpServer', x=143.53, y=95.00, z=253.02], EntityPig['Pig'/72, l='MpServer', x=141.50, y=94.00, z=276.32], EntityBat['Bat'/73, l='MpServer', x=127.22, y=20.71, z=295.90], EntityPig['Pig'/74, l='MpServer', x=129.49, y=98.00, z=292.38], EntityPig['Pig'/75, l='MpServer', x=132.35, y=98.00, z=298.76], EntityPig['Pig'/76, l='MpServer', x=131.62, y=95.00, z=304.27], EntityPig['Pig'/84, l='MpServer', x=148.24, y=80.00, z=157.34], EntityPig['Pig'/85, l='MpServer', x=150.73, y=86.00, z=169.46], EntityZombie['Zombie'/86, l='MpServer', x=155.80, y=76.00, z=211.50], EntitySpider['Spider'/87, l='MpServer', x=159.75, y=73.00, z=208.93], EntityCreeper['Creeper'/88, l='MpServer', x=154.20, y=83.00, z=217.56], EntityWitch['Witch'/89, l='MpServer', x=154.50, y=83.00, z=212.71], EntitySkeleton['Skeleton'/90, l='MpServer', x=154.50, y=83.00, z=209.52], EntityCow['Cow'/91, l='MpServer', x=154.53, y=101.00, z=218.15], EntityBat['Bat'/92, l='MpServer', x=148.25, y=31.41, z=231.50], EntitySkeleton['Skeleton'/93, l='MpServer', x=158.26, y=81.00, z=227.46], EntityPig['Pig'/94, l='MpServer', x=148.32, y=95.00, z=287.73], EntityPig['Pig'/95, l='MpServer', x=145.46, y=92.00, z=291.26], EntitySheep['Sheep'/110, l='MpServer', x=175.84, y=61.82, z=168.39], EntityCow['Cow'/111, l='MpServer', x=164.20, y=101.00, z=188.50], EntityCreeper['Creeper'/112, l='MpServer', x=164.50, y=20.00, z=200.50], EntitySkeleton['Skeleton'/113, l='MpServer', x=165.18, y=103.67, z=203.69], EntityZombie['Zombie'/114, l='MpServer', x=170.81, y=107.00, z=202.62], EntityZombie['Zombie'/115, l='MpServer', x=164.59, y=71.00, z=211.05], EntityLlama['Llama'/116, l='MpServer', x=163.53, y=80.00, z=222.49], EntityZombie['Zombie'/117, l='MpServer', x=169.50, y=105.00, z=212.30], EntityBat['Bat'/118, l='MpServer', x=162.55, y=28.87, z=223.50], EntityLlama['Llama'/119, l='MpServer', x=176.99, y=81.00, z=236.50], EntityLlama['Llama'/120, l='MpServer', x=167.75, y=82.00, z=226.50], EntityCreeper['Creeper'/121, l='MpServer', x=172.50, y=53.00, z=255.50], EntityCow['Cow'/122, l='MpServer', x=166.68, y=99.00, z=263.45], EntityPig['Pig'/123, l='MpServer', x=172.49, y=104.00, z=274.23], EntityCow['Cow'/124, l='MpServer', x=160.34, y=101.00, z=291.90], EntityBat['Bat'/137, l='MpServer', x=190.75, y=48.10, z=203.75], EntityBat['Bat'/138, l='MpServer', x=176.66, y=41.61, z=215.28], EntityCreeper['Creeper'/139, l='MpServer', x=189.50, y=49.00, z=219.50], EntitySkeleton['Skeleton'/140, l='MpServer', x=181.69, y=41.00, z=219.54], EntityZombie['Zombie'/141, l='MpServer', x=185.50, y=45.00, z=227.77], Basic['entity.BasicNPC.name'/142, l='MpServer', x=177.50, y=90.00, z=227.50], EntitySkeleton['Skeleton'/143, l='MpServer', x=187.13, y=96.00, z=255.89], EntitySkeleton['Skeleton'/144, l='MpServer', x=185.68, y=96.00, z=257.48], EntitySkeleton['Skeleton'/145, l='MpServer', x=183.51, y=96.00, z=255.72], EntityCow['Cow'/152, l='MpServer', x=206.33, y=65.00, z=157.46], EntityCow['Cow'/153, l='MpServer', x=196.18, y=64.00, z=153.17], EntityCow['Cow'/154, l='MpServer', x=201.21, y=66.00, z=157.83], EntityCow['Cow'/155, l='MpServer', x=206.57, y=63.00, z=165.77], EntitySheep['Sheep'/156, l='MpServer', x=199.71, y=66.00, z=164.55], EntitySquid['Squid'/157, l='MpServer', x=193.40, y=60.00, z=185.60], EntitySquid['Squid'/158, l='MpServer', x=202.48, y=60.21, z=188.18], EntitySquid['Squid'/159, l='MpServer', x=200.57, y=61.48, z=179.38], EntityZombie['Zombie'/160, l='MpServer', x=201.70, y=14.00, z=219.67], EntitySkeleton['Skeleton'/161, l='MpServer', x=203.01, y=68.00, z=208.19], EntitySpider['Spider'/162, l='MpServer', x=207.30, y=86.00, z=219.09], EntityCreeper['Creeper'/163, l='MpServer', x=193.12, y=91.00, z=243.46], EntitySpider['Spider'/164, l='MpServer', x=202.50, y=23.00, z=251.50], EntitySkeleton['Skeleton'/165, l='MpServer', x=197.49, y=84.00, z=280.70], EntitySkeleton['Skeleton'/166, l='MpServer', x=197.50, y=84.00, z=279.94], EntitySkeleton['Skeleton'/167, l='MpServer', x=196.50, y=84.00, z=279.34], EntityBat['Bat'/176, l='MpServer', x=210.02, y=23.08, z=163.37], EntitySheep['Sheep'/177, l='MpServer', x=209.20, y=63.00, z=164.49], EntitySquid['Squid'/178, l='MpServer', x=215.20, y=62.27, z=179.34], EntityBat['Bat'/179, l='MpServer', x=222.75, y=15.10, z=176.75], EntityBat['Bat'/180, l='MpServer', x=211.33, y=13.33, z=182.73], EntityCreeper['Creeper'/181, l='MpServer', x=223.50, y=23.00, z=206.50], EntitySkeleton['Skeleton'/182, l='MpServer', x=211.55, y=71.00, z=205.78], EntitySpider['Spider'/183, l='MpServer', x=213.96, y=26.00, z=243.05], EntityItem['item.item.egg'/439, l='MpServer', x=223.06, y=104.00, z=265.35], EntityPlayerSP['Player638'/374, l='MpServer', x=179.48, y=90.00, z=227.52], EntityZombie['Zombie'/184, l='MpServer', x=222.50, y=18.00, z=260.50], EntitySpider['Spider'/185, l='MpServer', x=216.99, y=19.00, z=259.01], EntitySpider['Spider'/186, l='MpServer', x=219.09, y=19.00, z=256.91], EntityChicken['Chicken'/187, l='MpServer', x=223.53, y=104.00, z=265.13], EntitySkeleton['Skeleton'/188, l='MpServer', x=217.50, y=39.00, z=302.50], EntityBat['Bat'/197, l='MpServer', x=240.39, y=41.90, z=159.34], EntityPig['Pig'/198, l='MpServer', x=227.51, y=66.00, z=152.25], EntityZombie['Zombie'/199, l='MpServer', x=228.74, y=31.00, z=161.44], EntitySkeleton['Skeleton'/200, l='MpServer', x=218.77, y=38.00, z=165.50], EntitySkeleton['Skeleton'/201, l='MpServer', x=230.31, y=52.00, z=191.50], EntityBat['Bat'/202, l='MpServer', x=231.79, y=35.69, z=198.76], EntityBat['Bat'/203, l='MpServer', x=228.49, y=34.45, z=202.41], EntityBat['Bat'/204, l='MpServer', x=229.68, y=24.10, z=210.04], EntityZombie['Zombie'/205, l='MpServer', x=233.50, y=20.00, z=222.50], EntityCreeper['Creeper'/206, l='MpServer', x=228.50, y=24.00, z=219.50], EntityCreeper['Creeper'/207, l='MpServer', x=228.50, y=24.00, z=219.50], EntityBat['Bat'/208, l='MpServer', x=223.45, y=21.18, z=216.71], EntityChicken['Chicken'/209, l='MpServer', x=230.85, y=113.00, z=256.91], EntityItem['item.item.egg'/210, l='MpServer', x=234.75, y=95.00, z=274.74], EntityChicken['Chicken'/211, l='MpServer', x=232.69, y=105.00, z=274.58], EntityLlama['Llama'/212, l='MpServer', x=231.51, y=105.00, z=287.89], EntityLlama['Llama'/213, l='MpServer', x=235.10, y=103.00, z=302.53], EntityPig['Pig'/218, l='MpServer', x=246.51, y=64.00, z=156.67], EntityWitch['Witch'/219, l='MpServer', x=254.78, y=39.00, z=173.52], EntityBat['Bat'/220, l='MpServer', x=242.81, y=25.10, z=191.23], EntityCreeper['Creeper'/221, l='MpServer', x=244.50, y=42.00, z=174.29], EntityBat['Bat'/222, l='MpServer', x=242.75, y=38.04, z=177.02], EntitySkeleton['Skeleton'/223, l='MpServer', x=242.50, y=19.00, z=266.50], EntityZombie['Zombie'/224, l='MpServer', x=241.52, y=18.00, z=258.73], EntitySpider['Spider'/225, l='MpServer', x=242.50, y=19.00, z=264.60], EntitySpider['Spider'/226, l='MpServer', x=238.30, y=19.65, z=254.80], EntitySheep['Sheep'/227, l='MpServer', x=242.14, y=95.00, z=263.45], EntitySheep['Sheep'/228, l='MpServer', x=241.20, y=95.00, z=263.57], EntityChicken['Chicken'/229, l='MpServer', x=244.51, y=92.00, z=287.07], EntitySheep['Sheep'/230, l='MpServer', x=259.10, y=95.00, z=289.43], EntitySkeleton['Skeleton'/239, l='MpServer', x=258.44, y=27.00, z=183.76], EntitySkeleton['Skeleton'/241, l='MpServer', x=259.22, y=27.00, z=187.49], EntityZombie['Zombie'/245, l='MpServer', x=258.50, y=19.00, z=220.50], EntityZombie['Zombie'/246, l='MpServer', x=258.50, y=19.00, z=224.50], EntityZombie['Zombie'/247, l='MpServer', x=254.30, y=18.00, z=231.70]]
	Retry entities: 0 total; []
	Server brand: fml,forge
	Server type: Integrated singleplayer server
Stacktrace:
	at net.minecraft.client.multiplayer.WorldClient.addWorldInfoToCrashReport(WorldClient.java:451)
	at net.minecraft.client.Minecraft.addGraphicsAndWorldToCrashReport(Minecraft.java:2774)
	at net.minecraft.client.Minecraft.run(Minecraft.java:428)
	at net.minecraft.client.main.Main.main(Main.java:118)
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
	at java.lang.reflect.Method.invoke(Unknown Source)
	at net.minecraft.launchwrapper.Launch.launch(Launch.java:135)
	at net.minecraft.launchwrapper.Launch.main(Launch.java:28)
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
	at java.lang.reflect.Method.invoke(Unknown Source)
	at net.minecraftforge.gradle.GradleStartCommon.launch(GradleStartCommon.java:97)
	at GradleStart.main(GradleStart.java:26)

-- System Details --
Details:
	Minecraft Version: 1.11.2
	Operating System: Windows 10 (amd64) version 10.0
	Java Version: 1.8.0_121, Oracle Corporation
	Java VM Version: Java HotSpot(TM) 64-Bit Server VM (mixed mode), Oracle Corporation
	Memory: 3713214640 bytes (3541 MB) / 4260102144 bytes (4062 MB) up to 4260102144 bytes (4062 MB)
	JVM Flags: 3 total; -Xincgc -Xmx4096M -Xms4096M
	IntCache: cache: 0, tcache: 0, allocated: 13, tallocated: 95
	FML: MCP 9.38 Powered by Forge 13.20.0.2228 8 mods loaded, 8 mods active
	States: 'U' = Unloaded 'L' = Loaded 'C' = Constructed 'H' = Pre-initialized 'I' = Initialized 'J' = Post-initialized 'A' = Available 'D' = Disabled 'E' = Errored
	UCHIJAAAA	minecraft{1.11.2} [Minecraft] (minecraft.jar) 
	UCHIJAAAA	mcp{9.19} [Minecraft Coder Pack] (minecraft.jar) 
	UCHIJAAAA	FML{8.0.99.99} [Forge Mod Loader] (forgeSrc-1.11.2-13.20.0.2228.jar) 
	UCHIJAAAA	forge{13.20.0.2228} [Minecraft Forge] (forgeSrc-1.11.2-13.20.0.2228.jar) 
	UCHIJAAAA	testmod{1.0.0} [Test Mod] (bin) 
	UCHIJAAAA	tutorial{1.0_a} [Tutorial Mod] (bin) 
	UCHIJAAAA	tutorial2{1.0.0} [Tutorial Mod 2] (bin) 
	UCHIJAAAA	tutorial3{0.0.1} [Tutorial Mod 3] (bin) 
	Loaded coremods (and transformers): 
	GL info: ' Vendor: 'NVIDIA Corporation' Version: '4.5.0 NVIDIA 369.09' Renderer: 'GeForce 920MX/PCIe/SSE2'
	Launched Version: 1.11.2
	LWJGL: 2.9.4
	OpenGL: GeForce 920MX/PCIe/SSE2 GL version 4.5.0 NVIDIA 369.09, NVIDIA Corporation
	GL Caps: Using GL 1.3 multitexturing.
Using GL 1.3 texture combiners.
Using framebuffer objects because OpenGL 3.0 is supported and separate blending is supported.
Shaders are available because OpenGL 2.1 is supported.
VBOs are available because OpenGL 1.5 is supported.

	Using VBOs: Yes
	Is Modded: Definitely; Client brand changed to 'fml,forge'
	Type: Client (map_client.txt)
	Resource Packs: 
	Current Language: English (US)
	Profiler Position: N/A (disabled)
	CPU: 4x Intel(R) Core(TM) i7-6500U CPU @ 2.50GHz
[21:09:08] [Client thread/INFO] [STDOUT]: [net.minecraft.init.Bootstrap:printToSYSOUT:600]: #@!@# Game crashed! Crash report saved to: #@!@# C:\Users\Andre\OneDrive\Documents\forge\1.11\run\.\crash-reports\crash-2017-03-06_21.09.08-client.txt
AL lib: (EE) alc_cleanup: 1 device not closed
Java HotSpot(TM) 64-Bit Server VM warning: Using incremental CMS is deprecated and will likely be removed in a future release

 

Posted

Ok. Did you try Entity entity = new Entity(); ? replace Entity with your entity

Apparently I'm addicted to these forums and can't help but read all the posts. So if I somehow help you, please click the "Like This" button, it helps.

Posted

Your above post ^ is NOT the way to create an instance! Learn some java.

Apparently I'm addicted to these forums and can't help but read all the posts. So if I somehow help you, please click the "Like This" button, it helps.

Posted

After you create an instance call your entity from the variable declaration and do what Jay Avery told you to.

Apparently I'm addicted to these forums and can't help but read all the posts. So if I somehow help you, please click the "Like This" button, it helps.

Posted

Ok post your whole container class i am going to look at it I just realized that the instance was not what Jay Avery meant.

Apparently I'm addicted to these forums and can't help but read all the posts. So if I somehow help you, please click the "Like This" button, it helps.

Posted (edited)
package com.clowcadia.test.gui;

import java.util.ArrayList;
import java.util.List;

import com.clowcadia.test.TestModHandler;
import com.clowcadia.test.containers.ContainerBasic;
import com.clowcadia.test.npc.Basic;
import com.clowcadia.tutorial3.Reference;

import net.minecraft.client.gui.inventory.GuiContainer;
import net.minecraft.client.renderer.GlStateManager;
import net.minecraft.client.resources.I18n;
import net.minecraft.entity.Entity;
import net.minecraft.inventory.Container;
import net.minecraft.inventory.IInventory;
import net.minecraft.item.ItemStack;
import net.minecraft.util.ResourceLocation;
import net.minecraft.util.math.RayTraceResult;
import net.minecraft.util.text.TextFormatting;
import net.minecraft.world.World;
import net.minecraftforge.common.capabilities.ICapabilityProvider;
import net.minecraftforge.items.CapabilityItemHandler;

public class GuiBasic extends GuiContainer{
	
	private IInventory playerInv;
	private Entity entity;
	private String stomachDisplay;
	private GuiBasic basic= new Basic

	public GuiBasic(IInventory playerInv, Entity entity) {
		super(new ContainerBasic(playerInv, entity));
		
		
		this.xSize=176;
		this.ySize=166;
		
		this.playerInv = playerInv;
		this.entity = entity;
	}

	@Override
	protected void drawGuiContainerBackgroundLayer(float partialTicks, int mouseX, int mouseY) {
		GlStateManager.color(1.0F, 1.0F, 1.0F,1.0F);
		this.mc.getTextureManager().bindTexture(new ResourceLocation(TestModHandler.modId, "textures/gui/container/basic.png"));
		this.drawTexturedModalRect(this.guiLeft, this.guiTop, 0, 0, this.xSize,this.ySize);
		
	}
	
	/**
	 * Draws the text that is an overlay, i.e where it says Block Breaker in the gui on the top
	 */
	@Override
	protected void drawGuiContainerForegroundLayer(int mouseX, int mouseY) {
		String s = I18n.format("container.basic"); //Gets the formatted name for the block breaker from the language file
		this.mc.fontRendererObj.drawString(s, this.xSize / 2 - this.mc.fontRendererObj.getStringWidth(s) / 2, 6, 4210752); //Draws the block breaker name in the center on the top of the gui
		this.mc.fontRendererObj.drawString(this.playerInv.getDisplayName().getFormattedText(), 8, 72, 4210752); //The player's inventory name
		this.mc.fontRendererObj.drawString(((Basic) this.entity).getStomach()+"", this.xSize / 2 - this.mc.fontRendererObj.getStringWidth(stomachDisplay) / 2, 20, 4210752);
		int actualMouseX = mouseX - ((this.width - this.xSize) / 2);
		int actualMouseY = mouseY - ((this.height - this.ySize) / 2);
		
	}
	

}

 

Edited by clowcadia
Previous suggestion
Guest
This topic is now closed to further replies.

Announcements




×
×
  • Create New...

Important Information

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