Jump to content

[1.10.2] Loading custom gui for custom block


Messorix

Recommended Posts

I have made a custom block (flux grinder) which is loaded into the world perfectly fine.

I tried making a custom gui (so that it has a working second output slot), but not only am I having troubles aligning it properly, it also crashes once I hover over the place where the inputslot is being put right now (which is not aligned properly)

 

GuiFluxGrinder:

package com.messy.core.gui;

import java.awt.Color;
import java.util.ArrayList;
import java.util.List;

import com.messy.core.Reference;
import com.messy.core.containers.ContainerFluxGrinder;
import com.messy.core.tileentities.TileEntityFluxGrinder;

import net.minecraft.client.Minecraft;
import net.minecraft.client.gui.inventory.GuiContainer;
import net.minecraft.client.renderer.GlStateManager;
import net.minecraft.entity.player.InventoryPlayer;
import net.minecraft.util.ResourceLocation;
import net.minecraftforge.fml.relauncher.Side;
import net.minecraftforge.fml.relauncher.SideOnly;

@SideOnly(Side.CLIENT)
public class GuiFluxGrinder  extends GuiContainer
{
    private static final ResourceLocation texture = new ResourceLocation(Reference.MOD_ID + ":textures/gui/flux_grinder_gui.png");
    private final TileEntityFluxGrinder entity;

    public GuiFluxGrinder(InventoryPlayer player, TileEntityFluxGrinder entity)
    {
        super(new ContainerFluxGrinder(player, entity));
        
        xSize = 176;
        ySize = 166;
        
        this.entity = entity;
    }

    final int process_bar_xpos = 49;
    final int process_bar_ypos = 60;
    final int process_bar_icon_u = 176;
    final int process_bar_icon_v = 14;
    final int process_bar_width = 24;
    final int process_bar_height = 17;

    final int flame_xpos = 57;
    final int flame_ypos = 37;
    final int flame_icon_u = 176;
    final int flame_icon_v = 0;
    final int flame_width = 14;
    final int flame_height = 14;
    final int flame_x_spacing = 18;
    
    /**
     * Args : renderPartialTicks, mouseX, mouseY
     */
    @Override
    protected void drawGuiContainerBackgroundLayer(float partialTicks, int mouseX, int mouseY)
    {
    	Minecraft.getMinecraft().getTextureManager().bindTexture(texture);
    	GlStateManager.color(1.0f, 1.0f, 1.0f, 1.0f);
    	this.drawTexturedModalRect(this.guiLeft, this.guiTop, 0, 0, xSize, ySize);
    	
    	double processProgress = entity.fractionOfProcessingTimeComplete();
    	this.drawTexturedModalRect(this.guiLeft + process_bar_xpos, 
    			this.guiTop + process_bar_ypos, 
    			process_bar_icon_u, 
    			process_bar_icon_v, 
    			(int)(processProgress * process_bar_width), 
    			 process_bar_height);
    	
    	for ( int i = 0; i < entity.fuel_slots; i++)
    	{
    		double burnRemaining = entity.fractionOfFuelRemaining(i);
    		int yOffset = (int)((1.0 - burnRemaining) * flame_height);
    		
    		this.drawTexturedModalRect(guiLeft + flame_xpos + flame_x_spacing * i, 
    				guiTop + flame_ypos + yOffset, 
    				flame_icon_u, 
    				flame_icon_v + yOffset, 
    				flame_width, 
    				flame_height - yOffset);
    	}
    }
    
    @Override
    protected void drawGuiContainerForegroundLayer(int mouseX, int mouseY)
    {
    	super.drawGuiContainerForegroundLayer(mouseX, mouseY);

    	final int label_xpos = 5;
    	final int label_ypos = 5;
    	
    	fontRendererObj.drawString(entity.getDisplayName().getUnformattedText(), label_xpos, label_ypos, Color.DARK_GRAY.getRGB());
    	
    	List<String> text = new ArrayList<String>();
    	
    	if (isInRect(guiLeft + process_bar_xpos, guiTop + process_bar_ypos, process_bar_width, process_bar_height, mouseX, mouseY))
    	{
    		text.add("Progress:");
    		
    		int processPercentage = (int)(entity.fractionOfProcessingTimeComplete() * 100);
    		
    		text.add(processPercentage + "%");
    	}
    	
    	for(int i = 0; i < entity.fuel_slots; i++)
    	{
        	if (isInRect(guiLeft + flame_xpos + flame_x_spacing * i, guiTop + flame_ypos, flame_width, flame_height, mouseX, mouseY))
        	{
        		text.add("Fuel Time: ");
        		text.add(entity.secondsOfFuelRemaining(i) + "s");
        	}
    	}
    	
    	if (!text.isEmpty())
    	{
    		drawHoveringText(text, mouseX - guiLeft, mouseY - guiTop, fontRendererObj);
    	}
    }
    
    public static boolean isInRect(int x, int y, int xSize, int ySize, int mouseX, int mouseY)
    {
    	return ((mouseX >= x && mouseX <= x + xSize) && (mouseY >= y && mouseY <= y + ySize));
    }
}

 

GuiHandlerFluxGrinder:

package com.messy.core.gui;

import com.messy.core.containers.ContainerFluxGrinder;
import com.messy.core.tileentities.TileEntityFluxGrinder;

import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.util.math.BlockPos;
import net.minecraft.world.World;
import net.minecraftforge.fml.common.network.IGuiHandler;

public class GuiHandlerFluxGrinder implements IGuiHandler
{
public static final int FLUX_GRINDER_GUI = 34;
public static int getGUIID() { return FLUX_GRINDER_GUI; }

@Override
public Object getServerGuiElement(int ID, EntityPlayer player, World world, int x, int y, int z) {
	if (ID == FLUX_GRINDER_GUI)
	{
		return new ContainerFluxGrinder(player.inventory, (TileEntityFluxGrinder)world.getTileEntity(new BlockPos(x, y, z)));
	}
	return null;
}

@Override
public Object getClientGuiElement(int ID, EntityPlayer player, World world, int x, int y, int z) {
	if (ID == FLUX_GRINDER_GUI)
	{
		return new GuiFluxGrinder(player.inventory, (TileEntityFluxGrinder)world.getTileEntity(new BlockPos(x, y, z)));
	}
	return null;
}

}

 

Crashlog:

---- Minecraft Crash Report ----

// This doesn't make any sense!

 

Time: 8/3/16 9:45 AM

Description: Rendering screen

 

java.lang.ArrayIndexOutOfBoundsException: 0

at com.messy.core.tileentities.ModTileEntity.secondsOfFuelRemaining(ModTileEntity.java:57)

at com.messy.core.gui.GuiFluxGrinder.drawGuiContainerForegroundLayer(GuiFluxGrinder.java:108)

at net.minecraft.client.gui.inventory.GuiContainer.drawScreen(GuiContainer.java:132)

at net.minecraftforge.client.ForgeHooksClient.drawScreen(ForgeHooksClient.java:374)

at net.minecraft.client.renderer.EntityRenderer.updateCameraAndRender(EntityRenderer.java:1147)

at net.minecraft.client.Minecraft.runGameLoop(Minecraft.java:1139)

at net.minecraft.client.Minecraft.run(Minecraft.java:406)

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.messy.core.tileentities.ModTileEntity.secondsOfFuelRemaining(ModTileEntity.java:57)

at com.messy.core.gui.GuiFluxGrinder.drawGuiContainerForegroundLayer(GuiFluxGrinder.java:108)

at net.minecraft.client.gui.inventory.GuiContainer.drawScreen(GuiContainer.java:132)

at net.minecraftforge.client.ForgeHooksClient.drawScreen(ForgeHooksClient.java:374)

 

-- Screen render details --

Details:

Screen name: com.messy.core.gui.GuiFluxGrinder

Mouse location: Scaled: (182, 74). Absolute: (364, 331)

Screen size: Scaled: (427, 240). Absolute: (854, 480). Scale factor of 2

 

-- Affected level --

Details:

Level name: MpServer

All players: 1 total; [EntityPlayerSP['Messorix'/352, l='MpServer', x=3.70, y=68.00, z=1.64]]

Chunk stats: MultiplayerChunkCache: 505, 505

Level seed: 0

Level generator: ID 00 - default, ver 1. Features enabled: false

Level generator options:

Level spawn location: World: (8,64,8), Chunk: (at 8,4,8 in 0,0; contains blocks 0,0,0 to 15,255,15), Region: (0,0; contains chunks 0,0 to 31,31, blocks 0,0,0 to 511,255,511)

Level time: 49048 game time, 4440 day time

Level dimension: 0

Level storage version: 0x00000 - Unknown?

Level weather: Rain time: 0 (now: false), thunder time: 0 (now: false)

Level game mode: Game mode: creative (ID 1). Hardcore: false. Cheats: false

Forced entities: 121 total; [EntityZombie['Zombie'/256, l='MpServer', x=81.16, y=25.00, z=-16.29], EntityCreeper['Creeper'/257, l='MpServer', x=82.23, y=54.00, z=-23.57], EntityZombie['Zombie'/258, l='MpServer', x=81.19, y=25.00, z=-11.49], EntityBat['Bat'/259, l='MpServer', x=80.51, y=27.10, z=-6.28], EntityHorse['Horse'/261, l='MpServer', x=82.95, y=88.00, z=48.88], EntityHorse['Horse'/262, l='MpServer', x=80.15, y=87.00, z=77.90], EntityHorse['Horse'/66, l='MpServer', x=-65.04, y=73.00, z=-16.42], EntityCreeper['Creeper'/67, l='MpServer', x=-70.50, y=17.00, z=-9.50], EntityCreeper['Creeper'/68, l='MpServer', x=-72.50, y=17.00, z=-8.50], EntityCreeper['Creeper'/69, l='MpServer', x=-73.50, y=17.00, z=-8.50], EntitySkeleton['Skeleton'/70, l='MpServer', x=-76.21, y=18.00, z=-9.51], EntitySkeleton['Skeleton'/71, l='MpServer', x=-73.58, y=17.00, z=-10.52], EntityHorse['Horse'/72, l='MpServer', x=-70.74, y=73.00, z=-6.63], EntityHorse['Horse'/73, l='MpServer', x=-69.60, y=73.00, z=-15.09], EntityBat['Bat'/74, l='MpServer', x=-69.30, y=35.10, z=52.39], EntityCreeper['Creeper'/79, l='MpServer', x=-58.50, y=26.00, z=-56.50], EntityCreeper['Creeper'/80, l='MpServer', x=-57.50, y=26.00, z=-59.50], EntitySpider['Spider'/81, l='MpServer', x=-57.93, y=50.00, z=-63.07], EntityHorse['Horse'/82, l='MpServer', x=-60.51, y=70.00, z=-25.90], EntitySkeleton['Skeleton'/84, l='MpServer', x=-57.50, y=21.00, z=15.50], EntitySpider['Spider'/85, l='MpServer', x=-61.33, y=73.00, z=14.56], EntityHorse['Horse'/86, l='MpServer', x=-49.70, y=88.00, z=69.09], EntityHorse['Horse'/87, l='MpServer', x=-51.15, y=89.00, z=68.18], EntityPlayerSP['Messorix'/352, l='MpServer', x=3.70, y=68.00, z=1.64], EntityRabbit['Rabbit'/97, l='MpServer', x=-44.03, y=74.00, z=-54.52], EntityZombie['Zombie'/98, l='MpServer', x=-44.80, y=26.00, z=-39.84], EntitySkeleton['Skeleton'/99, l='MpServer', x=-36.50, y=27.00, z=-46.50], EntityRabbit['Rabbit'/100, l='MpServer', x=-36.23, y=75.11, z=-42.47], EntityHorse['Horse'/101, l='MpServer', x=-33.01, y=75.00, z=-32.81], EntityHorse['Horse'/102, l='MpServer', x=-38.95, y=75.00, z=-39.88], EntitySquid['Squid'/103, l='MpServer', x=-40.60, y=62.00, z=-15.40], EntityBat['Bat'/104, l='MpServer', x=-37.15, y=26.00, z=2.41], EntityHorse['Donkey'/105, l='MpServer', x=-39.99, y=73.00, z=43.36], EntityHorse['Horse'/106, l='MpServer', x=-40.38, y=91.00, z=58.07], EntityHorse['Horse'/107, l='MpServer', x=-38.28, y=88.00, z=66.34], EntityBat['Bat'/112, l='MpServer', x=-19.62, y=13.04, z=-62.53], EntityBat['Bat'/113, l='MpServer', x=-15.43, y=10.86, z=-58.19], EntityHorse['Horse'/114, l='MpServer', x=-18.97, y=75.00, z=-51.56], EntityHorse['Horse'/115, l='MpServer', x=-25.15, y=74.00, z=-32.88], EntityRabbit['Rabbit'/116, l='MpServer', x=-30.62, y=74.00, z=-30.58], EntitySkeleton['Skeleton'/117, l='MpServer', x=-18.50, y=13.00, z=1.50], EntityHorse['Donkey'/118, l='MpServer', x=-22.14, y=69.00, z=36.07], EntityZombie['Zombie'/119, l='MpServer', x=-23.50, y=26.00, z=69.50], EntityBat['Bat'/127, l='MpServer', x=-15.51, y=12.60, z=-56.48], EntityBat['Bat'/128, l='MpServer', x=0.32, y=36.07, z=-66.94], EntityRabbit['Rabbit'/129, l='MpServer', x=-10.39, y=71.00, z=-68.68], EntityRabbit['Rabbit'/131, l='MpServer', x=-15.80, y=71.00, z=-75.29], EntityRabbit['Rabbit'/132, l='MpServer', x=-0.90, y=76.00, z=-42.81], EntityBat['Bat'/133, l='MpServer', x=-6.04, y=28.10, z=18.50], EntityHorse['Donkey'/134, l='MpServer', x=-15.86, y=70.00, z=29.01], EntitySkeleton['Skeleton'/135, l='MpServer', x=-9.50, y=20.00, z=39.50], EntityHorse['Donkey'/136, l='MpServer', x=-11.82, y=68.00, z=36.56], EntityHorse['Donkey'/137, l='MpServer', x=-14.41, y=69.00, z=43.96], EntityCreeper['Creeper'/138, l='MpServer', x=-0.50, y=32.00, z=58.50], EntitySkeleton['Skeleton'/145, l='MpServer', x=7.51, y=41.00, z=-74.33], EntityCreeper['Creeper'/146, l='MpServer', x=0.72, y=43.00, z=-68.75], EntityCreeper['Creeper'/147, l='MpServer', x=15.50, y=42.00, z=-66.50], EntityBat['Bat'/148, l='MpServer', x=0.83, y=36.10, z=-64.84], EntityZombie['Zombie'/149, l='MpServer', x=3.81, y=43.00, z=-66.50], EntityHorse['Horse'/150, l='MpServer', x=5.16, y=67.00, z=-70.11], EntitySkeleton['Skeleton'/151, l='MpServer', x=15.50, y=42.00, z=-63.50], EntityBat['Bat'/152, l='MpServer', x=5.95, y=31.10, z=5.73], EntitySkeleton['Skeleton'/165, l='MpServer', x=22.50, y=16.00, z=-71.50], EntityCreeper['Creeper'/166, l='MpServer', x=31.17, y=30.00, z=-57.54], EntitySkeleton['Skeleton'/167, l='MpServer', x=22.51, y=18.00, z=-60.76], EntitySkeleton['Skeleton'/168, l='MpServer', x=19.49, y=38.00, z=-63.69], EntityEnderman['Enderman'/169, l='MpServer', x=21.71, y=31.00, z=-23.48], EntityCreeper['Creeper'/170, l='MpServer', x=29.57, y=31.00, z=-28.20], EntityCreeper['Creeper'/171, l='MpServer', x=23.79, y=31.00, z=-24.48], EntityCreeper['Creeper'/172, l='MpServer', x=24.50, y=32.00, z=-28.50], EntityBat['Bat'/173, l='MpServer', x=26.46, y=32.10, z=-18.03], EntityEnderman['Enderman'/174, l='MpServer', x=23.47, y=32.00, z=-19.68], EntityBat['Bat'/175, l='MpServer', x=32.39, y=70.46, z=36.52], EntityZombie['Zombie'/190, l='MpServer', x=44.51, y=17.00, z=-49.78], EntityZombie['Zombie'/191, l='MpServer', x=33.50, y=35.00, z=-44.76], EntitySkeleton['Skeleton'/192, l='MpServer', x=39.50, y=15.00, z=-29.50], EntitySkeleton['Skeleton'/193, l='MpServer', x=41.50, y=15.00, z=-27.50], EntityCreeper['Creeper'/194, l='MpServer', x=37.50, y=15.00, z=-26.67], EntityBat['Bat'/195, l='MpServer', x=35.75, y=18.10, z=-22.25], EntityHorse['Horse'/196, l='MpServer', x=37.01, y=95.00, z=-31.92], EntityPig['Pig'/197, l='MpServer', x=45.25, y=95.00, z=-20.10], EntityHorse['Horse'/198, l='MpServer', x=41.86, y=95.00, z=-31.88], EntityHorse['Horse'/199, l='MpServer', x=44.38, y=82.00, z=25.10], EntityHorse['Horse'/200, l='MpServer', x=46.00, y=72.00, z=36.09], EntityHorse['Horse'/201, l='MpServer', x=30.04, y=67.00, z=48.99], EntitySkeleton['Skeleton'/202, l='MpServer', x=33.50, y=68.00, z=57.71], EntityBat['Bat'/203, l='MpServer', x=32.86, y=33.20, z=78.50], EntityCow['Cow'/210, l='MpServer', x=62.79, y=96.00, z=-44.55], EntityBat['Bat'/211, l='MpServer', x=63.09, y=41.06, z=-24.53], EntityPig['Pig'/212, l='MpServer', x=63.42, y=93.00, z=-22.51], EntityPig['Pig'/213, l='MpServer', x=62.45, y=92.00, z=-3.55], EntityHorse['Horse'/214, l='MpServer', x=63.83, y=91.00, z=-2.23], EntityHorse['Donkey'/215, l='MpServer', x=59.96, y=94.00, z=-1.86], EntityPig['Pig'/216, l='MpServer', x=63.83, y=92.00, z=14.19], EntityHorse['Horse'/217, l='MpServer', x=62.90, y=91.00, z=5.11], EntityPig['Pig'/218, l='MpServer', x=54.40, y=93.00, z=19.73], EntityHorse['Donkey'/219, l='MpServer', x=62.22, y=91.00, z=31.68], EntityHorse['Donkey'/220, l='MpServer', x=52.13, y=92.00, z=59.00], EntityHorse['Horse'/221, l='MpServer', x=61.87, y=92.00, z=54.02], EntityHorse['Horse'/222, l='MpServer', x=48.10, y=88.00, z=64.94], EntitySkeleton['Skeleton'/228, l='MpServer', x=69.08, y=49.00, z=-70.41], EntitySkeleton['Skeleton'/229, l='MpServer', x=78.99, y=50.00, z=-67.46], EntityCow['Cow'/230, l='MpServer', x=74.32, y=84.00, z=-76.52], EntityCreeper['Creeper'/231, l='MpServer', x=72.49, y=45.00, z=-48.17], EntityPig['Pig'/234, l='MpServer', x=78.59, y=97.00, z=-54.25], EntityCreeper['Creeper'/235, l='MpServer', x=65.55, y=20.00, z=-36.85], EntityPig['Pig'/236, l='MpServer', x=73.47, y=92.00, z=-33.75], EntityCreeper['Creeper'/237, l='MpServer', x=69.74, y=82.00, z=-32.47], EntityPig['Pig'/238, l='MpServer', x=70.71, y=96.00, z=-47.55], EntityHorse['Horse'/239, l='MpServer', x=70.89, y=96.00, z=-32.24], EntityPig['Pig'/240, l='MpServer', x=71.72, y=96.00, z=-39.49], EntityCow['Cow'/241, l='MpServer', x=73.22, y=96.00, z=-47.43], EntityZombie['Zombie'/242, l='MpServer', x=73.70, y=80.00, z=-31.30], EntityZombie['Zombie'/243, l='MpServer', x=62.51, y=84.00, z=-36.22], EntitySkeleton['Skeleton'/244, l='MpServer', x=70.70, y=24.00, z=-12.30], EntityHorse['Horse'/245, l='MpServer', x=77.94, y=88.00, z=-9.86], EntityPig['Pig'/246, l='MpServer', x=73.52, y=89.00, z=30.70], EntityPig['Pig'/247, l='MpServer', x=66.25, y=91.00, z=17.62], EntityHorse['Donkey'/248, l='MpServer', x=67.15, y=89.00, z=52.00], EntityCreeper['Creeper'/252, l='MpServer', x=81.84, y=20.00, z=-50.51], EntityZombie['Zombie'/253, l='MpServer', x=80.40, y=51.00, z=-60.01]]

Retry entities: 0 total; []

Server brand: fml,forge

Server type: Integrated singleplayer server

Stacktrace:

at net.minecraft.client.multiplayer.WorldClient.addWorldInfoToCrashReport(WorldClient.java:450)

at net.minecraft.client.Minecraft.addGraphicsAndWorldToCrashReport(Minecraft.java:2779)

at net.minecraft.client.Minecraft.run(Minecraft.java:427)

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

Operating System: Windows 8.1 (amd64) version 6.3

Java Version: 1.8.0_102, Oracle Corporation

Java VM Version: Java HotSpot 64-Bit Server VM (mixed mode), Oracle Corporation

Memory: 745681080 bytes (711 MB) / 1678245888 bytes (1600 MB) up to 7635730432 bytes (7282 MB)

JVM Flags: 2 total; -Xmx8g -Xms256m

IntCache: cache: 0, tcache: 0, allocated: 13, tallocated: 95

FML: MCP 9.32 Powered by Forge 12.18.1.2011 6 mods loaded, 6 mods active

States: 'U' = Unloaded 'L' = Loaded 'C' = Constructed 'H' = Pre-initialized 'I' = Initialized 'J' = Post-initialized 'A' = Available 'D' = Disabled 'E' = Errored

UCHIJAAAA mcp{9.19} [Minecraft Coder Pack] (minecraft.jar)

UCHIJAAAA FML{8.0.99.99} [Forge Mod Loader] (forgeSrc-1.10.2-12.18.1.2011.jar)

UCHIJAAAA Forge{12.18.1.2011} [Minecraft Forge] (forgeSrc-1.10.2-12.18.1.2011.jar)

UCHIJAAAA messycore{0.0.1} [Messy: Core] (bin)

UCHIJAAAA examplemod{1.0} [Example Mod] (bin)

UCHIJAAAA JEI{3.7.6.232} [Just Enough Items] (jei_1.10.2-3.7.6.232.jar)

Loaded coremods (and transformers):

GL info: ' Vendor: 'ATI Technologies Inc.' Version: '4.5.13431 Compatibility Profile Context 16.150.2211.0' Renderer: 'AMD Radeon HD 7900 Series'

Launched Version: 1.10.2

LWJGL: 2.9.4

OpenGL: AMD Radeon HD 7900 Series GL version 4.5.13431 Compatibility Profile Context 16.150.2211.0, ATI Technologies Inc.

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® Core i5-3570K CPU @ 3.40GHz

 

 

What am I missing here?

Link to comment
Share on other sites

  • Replies 79
  • Created
  • Last Reply

Top Posters In This Topic

Top Posters In This Topic

package com.messy.core.tileentities;

import com.messy.core.crafting.FluxGrinderRecipes;

import net.minecraft.item.ItemStack;

public class TileEntityFluxGrinder extends ModTileEntity
{
public static final int fuel_slots = 1;
public static final int input_slots = 2;
public static final int output_slots = 1;

public int[] burnTimeRemaining = new int[fuel_slots];
public int[] burnTimeInitial = new int[fuel_slots];

public static ItemStack getProcessingResultForItem(ItemStack stack){
	return ModTileEntity.getProcessingResultForItem(FluxGrinderRecipes.instance().getGrindingResult(stack));
}

@Override
public String getName() {
	return "container.tile_entity_flux_grinder.name";
}


public double fractionOfFuelRemaining(int fuelSlot) {
	return super.fractionOfFuelRemaining(fuelSlot, burnTimeInitial);
}

public void setCustomInventoryName(String displayName) {
}
}

 

package com.messy.core.tileentities;

import java.util.Arrays;

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.NBTTagIntArray;
import net.minecraft.nbt.NBTTagList;
import net.minecraft.network.NetworkManager;
import net.minecraft.network.Packet;
import net.minecraft.network.play.server.SPacketUpdateTileEntity;
import net.minecraft.tileentity.TileEntity;
import net.minecraft.tileentity.TileEntityFurnace;
import net.minecraft.util.ITickable;
import net.minecraft.util.math.MathHelper;
import net.minecraft.util.text.ITextComponent;
import net.minecraft.util.text.TextComponentString;
import net.minecraft.util.text.TextComponentTranslation;
import net.minecraft.world.EnumSkyBlock;

public class ModTileEntity extends TileEntity implements IInventory, ITickable {
public static final int fuel_slots = 0;
public static final int input_slots = 0;
public static final int output_slots = 0;
public static final int total_slots = fuel_slots + input_slots + output_slots;

public static final int first_fuel_slot = 0;
public static final int first_input_slot = first_fuel_slot + input_slots;
public static final int first_output_slot = first_input_slot + output_slots;

protected ItemStack[] itemStacks = new ItemStack[total_slots];

protected int[] burnTimeRemaining;
protected int[] burnTimeInitial;

protected short processTime;
protected static final short working_time_for_completion = 200;
protected int cachedNumberOfBurningSlots = -1;

public double fractionOfFuelRemaining(int fuelSlot, int[] burnTimeInitial) {
	double fraction;

	this.burnTimeInitial = burnTimeInitial;

	if (this.burnTimeInitial[fuelSlot] <= 0) {
		fraction = 0;
	} else {
		fraction = burnTimeRemaining[fuelSlot] / (double) burnTimeInitial[fuelSlot];
	}

	return MathHelper.clamp_double(fraction, 0.0, 1.0);
}

public int secondsOfFuelRemaining(int fuelSlot) {
	if (burnTimeRemaining[fuelSlot] <= 0) {
		return 0;
	}

	return burnTimeRemaining[fuelSlot] / 20;
}

public int numberOfBurningFuelSlots() {
	int burningCount = 0;

	for (int burnTime : burnTimeRemaining) {
		if (burnTime > 0) {
			++burningCount;
		}
	}

	return burningCount;
}

public double fractionOfProcessingTimeComplete() {
	double fraction = processTime / (double) working_time_for_completion;

	return MathHelper.clamp_double(fraction, 0.0, 1.0);
}

protected int burnFuel() {
	int burningCount = 0;
	boolean inventorychanged = false;

	for (int i = 0; i < fuel_slots; i++) {
		int fuelSlotNumber = i + first_fuel_slot;

		if (burnTimeRemaining[i] > 0) {
			--burnTimeRemaining[i];
			++burningCount;
		}

		if (burnTimeRemaining[i] == 0) {
			if (itemStacks[fuelSlotNumber] != null && getItemBurnTime(itemStacks[fuelSlotNumber]) > 0) {
				burnTimeRemaining[i] = burnTimeInitial[i] = getItemBurnTime(itemStacks[fuelSlotNumber]);
				--itemStacks[fuelSlotNumber].stackSize;
				++burningCount;
				inventorychanged = true;

				if (itemStacks[fuelSlotNumber].stackSize == 0) {
					itemStacks[fuelSlotNumber] = itemStacks[fuelSlotNumber].getItem()
							.getContainerItem(itemStacks[fuelSlotNumber]);
				}
			}
		}
	}

	if (inventorychanged) {
		markDirty();
	}

	return burningCount;
}

protected boolean canProcess() {
	return processItem(false);
}

protected void processItem() {
	processItem(true);
}

protected boolean processItem(boolean performProcess) {
	Integer firstSuitableInputSlot = null;
	Integer firstSuitableOutputSlot = null;
	ItemStack result = null;

	for (int inputSlot = first_input_slot; inputSlot < first_input_slot + inputSlot; inputSlot++) {
		if (itemStacks[inputSlot] != null) {
			result = getProcessingResultForItem(itemStacks[inputSlot]);

			if (result != null) {
				for (int outputSlot = first_output_slot; outputSlot < first_output_slot
						+ output_slots; outputSlot++) {
					ItemStack outputStack = itemStacks[outputSlot];

					if (outputStack == null) {
						firstSuitableInputSlot = inputSlot;
						firstSuitableOutputSlot = outputSlot;
						break;
					}

					if (outputStack.getItem() == result.getItem() && (!outputStack.getHasSubtypes()
							|| outputStack.getMetadata() == outputStack.getMetadata()
									&& ItemStack.areItemStacksEqual(outputStack, result))) {
						int combinedSize = itemStacks[outputSlot].stackSize + result.stackSize;

						if (combinedSize <= getInventoryStackLimit()
								&& combinedSize <= itemStacks[outputSlot].getMaxStackSize()) {
							firstSuitableInputSlot = inputSlot;
							firstSuitableOutputSlot = outputSlot;
							break;
						}
					}
				}

				if (firstSuitableInputSlot != null) {
					break;
				}
			}
		}
	}

	if (firstSuitableInputSlot == null) {
		return false;
	}

	if (!performProcess) {
		return true;
	}

	itemStacks[firstSuitableInputSlot].stackSize--;

	if (itemStacks[firstSuitableInputSlot].stackSize <= 0) {
		itemStacks[firstSuitableInputSlot] = null;
	}

	if (itemStacks[firstSuitableOutputSlot] == null) {
		itemStacks[firstSuitableOutputSlot] = result.copy();
	} else {
		itemStacks[firstSuitableOutputSlot].stackSize += result.stackSize;
	}

	markDirty();
	return true;
}

public static short getItemBurnTime(ItemStack stack)
{
	int burnTime = TileEntityFurnace.getItemBurnTime(stack);
	return (short) MathHelper.clamp_int(burnTime, 0, Short.MAX_VALUE);
}

public static ItemStack getProcessingResultForItem(ItemStack stack){
	return stack;
}

@Override
public void update() {
	if (canProcess()) {
		int numberOfFuelBurning = burnFuel();

		if (numberOfFuelBurning > 0) {
			processTime += numberOfFuelBurning;
		} else {
			processTime -= 2;
		}

		if (processTime < 0) {
			processTime = 0;
		}

		if (processTime >= working_time_for_completion) {
			processItem();
			processTime = 0;
		}
	} else {
		processTime = 0;
	}

	int numberBurning = numberOfBurningFuelSlots();

	if (cachedNumberOfBurningSlots != numberBurning) {
		cachedNumberOfBurningSlots = numberBurning;

		if (worldObj.isRemote) {
			worldObj.markBlockRangeForRenderUpdate(pos, pos);
		}

		worldObj.checkLightFor(EnumSkyBlock.BLOCK, pos);
	}
}

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

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

@Override
public ItemStack decrStackSize(int slotIndex, int count) {
	ItemStack itemStackInSlot = getStackInSlot(slotIndex);

	if (itemStackInSlot == null){
		return null;
	}

	ItemStack itemStackRemoved;

	if (itemStackInSlot.stackSize <= count)
	{
		itemStackRemoved = itemStackInSlot;
		setInventorySlotContents(slotIndex, null);
	}
	else
	{
		itemStackRemoved = itemStackInSlot.splitStack(count);

		if (itemStackInSlot.stackSize == 0)
		{
			setInventorySlotContents(slotIndex, null);
		}
	}

	markDirty();
	return itemStackRemoved;
}

@Override
public void setInventorySlotContents(int slotIndex, ItemStack stack) {
	itemStacks[slotIndex] = stack;

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

	markDirty();
}

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

@Override
public boolean isUseableByPlayer(EntityPlayer player) {
	if (this.worldObj.getTileEntity(this.pos) != this)
	{
		return false;
	}

	final double x_center_offset = 0.5;
	final double y_center_offset = 0.5;
	final double z_center_offset = 0.5;
	final double maximum_distance_sq = 8.0 * 8.0;

	return player.getDistanceSq(pos.getX() + x_center_offset, pos.getY() + y_center_offset, pos.getZ() + z_center_offset) < maximum_distance_sq;
}

public boolean isItemValidForFuelSlot(ItemStack stack) {
	return false;
}

public boolean isItemValidForInputSlot(ItemStack stack) {
	return false;
}

public boolean isItemValidForOutputSlot(ItemStack stack) {
	return false;
}

@Override
public NBTTagCompound writeToNBT(NBTTagCompound parentNBTTagCompound)
{
	super.writeToNBT(parentNBTTagCompound);

	NBTTagList dataForAllSlots = new NBTTagList();

	for (int i = 0; i < this.itemStacks.length; i++)
	{
		if (this.itemStacks[i] != null)
		{
			NBTTagCompound dataForThisSlot = new NBTTagCompound();
			dataForThisSlot.setByte("Slot", (byte)i);
			this.itemStacks[i].writeToNBT(dataForThisSlot);
			dataForAllSlots.appendTag(dataForThisSlot);
		}
	}

	parentNBTTagCompound.setTag("Items", dataForAllSlots);
	parentNBTTagCompound.setShort("ProcessTime", processTime);
	parentNBTTagCompound.setTag("BurnTimeRemaining", new NBTTagIntArray(burnTimeRemaining));
	parentNBTTagCompound.setTag("BurnTimeInitial", new NBTTagIntArray(burnTimeInitial));

	return parentNBTTagCompound;
}

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

	final byte nbt_type_compound = 10;
	NBTTagList dataForAllSlots = nbtTagCompound.getTagList("Items", nbt_type_compound);
	Arrays.fill(itemStacks, null);

	for (int i = 0; i < dataForAllSlots.tagCount(); i++)
	{
		NBTTagCompound dataForOneSlot = dataForAllSlots.getCompoundTagAt(i);
		byte slotNumber = dataForOneSlot.getByte("Slot");

		if (slotNumber >= 0 && slotNumber < this.itemStacks.length)
		{
			this.itemStacks[slotNumber] = ItemStack.loadItemStackFromNBT(dataForOneSlot);
		}
	}

	processTime = nbtTagCompound.getShort("ProcessTime");
	burnTimeRemaining = Arrays.copyOf(nbtTagCompound.getIntArray("BurnTimeRemaining"), fuel_slots);
	burnTimeInitial = Arrays.copyOf(nbtTagCompound.getIntArray("BurnTimeInitial"), fuel_slots);
	cachedNumberOfBurningSlots = -1;
}

@SuppressWarnings("rawtypes")
public Packet getDescriptionPacket()
{
	NBTTagCompound nbtTagCompound = new NBTTagCompound();
	writeToNBT(nbtTagCompound);
	final int metadata = 0;
	return new SPacketUpdateTileEntity(this.pos, metadata, nbtTagCompound);
}

public void onDataPacket(NetworkManager net, SPacketUpdateTileEntity pkt)
{
	readFromNBT(pkt.getNbtCompound());
}

@Override
public void clear() {
	Arrays.fill(itemStacks, null);
}

@Override
public String getName() {
	return "Set this first";
}

@Override
public boolean hasCustomName() {
	return false;
}

public ITextComponent getDisplayName()
{
	return this.hasCustomName() ? new TextComponentString(this.getName()) : new TextComponentTranslation(this.getName());
}

private static final byte process_field_id = 0;
private static final byte first_burn_time_remaining_field_id = 1;
private static final byte first_burn_time_initial_field_id = first_burn_time_remaining_field_id + (byte)fuel_slots;
private static final byte number_of_fields = first_burn_time_initial_field_id + (byte)fuel_slots;

@Override
public int getField(int id) {
	if (id == process_field_id)
	{	
		return 0;
	}

	if (id >= first_burn_time_remaining_field_id && id < first_burn_time_remaining_field_id + (byte)fuel_slots)
	{
		return burnTimeRemaining[id - first_burn_time_remaining_field_id];
	}

	if (id >= first_burn_time_initial_field_id && id < first_burn_time_initial_field_id + (byte)fuel_slots)
	{
		return burnTimeInitial[id - first_burn_time_initial_field_id];
	}

	System.err.println("Invalid field ID in TileInventoryProcessing.getField: " + id);
	return 0;
}

@Override
public void setField(int id, int value) {
	if (id == process_field_id)
	{
		processTime = (short)value;
	}
	else if (id >= first_burn_time_remaining_field_id && id < first_burn_time_remaining_field_id + fuel_slots)
	{
		burnTimeRemaining[id - first_burn_time_remaining_field_id] = value;
	}
	else if (id >= first_burn_time_initial_field_id && id < first_burn_time_initial_field_id + fuel_slots)
	{
		burnTimeInitial[id - first_burn_time_initial_field_id] = value;
	}
	else
	{
		System.err.println("Invalid field ID in TileInventoryProcessing.getField: " + id);
	}
}

@Override
public int getFieldCount() {
	return number_of_fields;
}

@Override
public boolean isItemValidForSlot(int index, ItemStack stack) {
	return false;
}

@Override
public ItemStack removeStackFromSlot(int slotIndex) {
	ItemStack stack = getStackInSlot(slotIndex);

	if (stack != null)
	{
		setInventorySlotContents(slotIndex, null);
	}

	return stack;
}

@Override
public void openInventory(EntityPlayer player) {
	// TODO Auto-generated method stub

}

@Override
public void closeInventory(EntityPlayer player) {
	// TODO Auto-generated method stub

}
}

Link to comment
Share on other sites

You never actually change how many slots you have :P

        public static final int fuel_slots = 0;
public static final int input_slots = 0;
public static final int output_slots = 0;
public static final int total_slots = fuel_slots + input_slots + output_slots;

VANILLA MINECRAFT CLASSES ARE THE BEST RESOURCES WHEN MODDING

I will be posting 1.15.2 modding tutorials on this channel. If you want to be notified of it do the normal YouTube stuff like subscribing, ect.

Forge and vanilla BlockState generator.

Link to comment
Share on other sites

I have changed the way I set the fields to their values in my TileEntityFluxGrinder class (see below)

 

package com.messy.core.tileentities;

import com.messy.core.crafting.FluxGrinderRecipes;

import net.minecraft.item.ItemStack;

public class TileEntityFluxGrinder extends ModTileEntity
{
private static boolean setupDone = false; 
public static final int fuel_slots = 1;
public static final int input_slots = 2;
public static final int output_slots = 1;

protected ItemStack[] itemStacks = new ItemStack[total_slots];

public static ItemStack getProcessingResultForItem(ItemStack stack){
	return ModTileEntity.getProcessingResultForItem(FluxGrinderRecipes.instance().getGrindingResult(stack));
}

@Override
public String getName() {
	return "container.tile_entity_flux_grinder.name";
}


public int numberOfBurningFuelSlots() {
	if (!setupDone)
	{
		total_slots = fuel_slots + input_slots + output_slots;
		first_input_slot = first_fuel_slot + input_slots;
		first_output_slot = first_input_slot + output_slots;
		burnTimeInitial = new int[fuel_slots];
		burnTimeRemaining = new int[fuel_slots];

		setupDone = true;
	}

	return super.numberOfBurningFuelSlots();
}

public void setCustomInventoryName(String displayName) {
}
}

 

Now whenever I open the Flux grinder, the whole thing just crashes:

 

---- Minecraft Crash Report ----

// I feel sad now :(

 

Time: 8/3/16 10:30 AM

Description: Ticking block entity

 

java.lang.ArrayIndexOutOfBoundsException: 2

at com.messy.core.tileentities.ModTileEntity.processItem(ModTileEntity.java:128)

at com.messy.core.tileentities.ModTileEntity.canProcess(ModTileEntity.java:115)

at com.messy.core.tileentities.ModTileEntity.update(ModTileEntity.java:199)

at net.minecraft.world.World.updateEntities(World.java:1940)

at net.minecraft.world.WorldServer.updateEntities(WorldServer.java:644)

at net.minecraft.server.MinecraftServer.updateTimeLightAndEntities(MinecraftServer.java:783)

at net.minecraft.server.MinecraftServer.tick(MinecraftServer.java:687)

at net.minecraft.server.integrated.IntegratedServer.tick(IntegratedServer.java:156)

at net.minecraft.server.MinecraftServer.run(MinecraftServer.java:536)

at java.lang.Thread.run(Unknown Source)

 

 

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

---------------------------------------------------------------------------------------

 

-- Head --

Thread: Server thread

Stacktrace:

at com.messy.core.tileentities.ModTileEntity.processItem(ModTileEntity.java:128)

at com.messy.core.tileentities.ModTileEntity.canProcess(ModTileEntity.java:115)

at com.messy.core.tileentities.ModTileEntity.update(ModTileEntity.java:199)

 

-- Block entity being ticked --

Details:

Name: null // com.messy.core.tileentities.TileEntityFluxGrinder

Block type: ID #220 (tile.flux_grinder // com.messy.core.blocks.BlockFluxGrinder)

Block data value: 4 / 0x4 / 0b0100

Block location: World: (5,68,1), Chunk: (at 5,4,1 in 0,0; contains blocks 0,0,0 to 15,255,15), Region: (0,0; contains chunks 0,0 to 31,31, blocks 0,0,0 to 511,255,511)

Actual block type: ID #220 (tile.flux_grinder // com.messy.core.blocks.BlockFluxGrinder)

Actual block data value: 4 / 0x4 / 0b0100

Stacktrace:

at net.minecraft.world.World.updateEntities(World.java:1940)

at net.minecraft.world.WorldServer.updateEntities(WorldServer.java:644)

 

-- Affected level --

Details:

Level name: Test world

All players: 1 total; [EntityPlayerMP['Messorix'/349, l='Test world', x=3.70, y=68.00, z=1.64]]

Chunk stats: ServerChunkCache: 625 Drop: 0

Level seed: 3487581621234629577

Level generator: ID 00 - default, ver 1. Features enabled: true

Level generator options:

Level spawn location: World: (8,64,8), Chunk: (at 8,4,8 in 0,0; contains blocks 0,0,0 to 15,255,15), Region: (0,0; contains chunks 0,0 to 31,31, blocks 0,0,0 to 511,255,511)

Level time: 50076 game time, 5468 day time

Level dimension: 0

Level storage version: 0x04ABD - Anvil

Level weather: Rain time: 4242 (now: false), thunder time: 115652 (now: false)

Level game mode: Game mode: creative (ID 1). Hardcore: false. Cheats: true

Stacktrace:

at net.minecraft.server.MinecraftServer.updateTimeLightAndEntities(MinecraftServer.java:783)

at net.minecraft.server.MinecraftServer.tick(MinecraftServer.java:687)

at net.minecraft.server.integrated.IntegratedServer.tick(IntegratedServer.java:156)

at net.minecraft.server.MinecraftServer.run(MinecraftServer.java:536)

at java.lang.Thread.run(Unknown Source)

 

-- System Details --

Details:

Minecraft Version: 1.10.2

Operating System: Windows 8.1 (amd64) version 6.3

Java Version: 1.8.0_102, Oracle Corporation

Java VM Version: Java HotSpot 64-Bit Server VM (mixed mode), Oracle Corporation

Memory: 386346064 bytes (368 MB) / 1666711552 bytes (1589 MB) up to 7635730432 bytes (7282 MB)

JVM Flags: 2 total; -Xmx8g -Xms256m

IntCache: cache: 0, tcache: 0, allocated: 13, tallocated: 95

FML: MCP 9.32 Powered by Forge 12.18.1.2011 6 mods loaded, 6 mods active

States: 'U' = Unloaded 'L' = Loaded 'C' = Constructed 'H' = Pre-initialized 'I' = Initialized 'J' = Post-initialized 'A' = Available 'D' = Disabled 'E' = Errored

UCHIJAAAA mcp{9.19} [Minecraft Coder Pack] (minecraft.jar)

UCHIJAAAA FML{8.0.99.99} [Forge Mod Loader] (forgeSrc-1.10.2-12.18.1.2011.jar)

UCHIJAAAA Forge{12.18.1.2011} [Minecraft Forge] (forgeSrc-1.10.2-12.18.1.2011.jar)

UCHIJAAAA messycore{0.0.1} [Messy: Core] (bin)

UCHIJAAAA examplemod{1.0} [Example Mod] (bin)

UCHIJAAAA JEI{3.7.6.232} [Just Enough Items] (jei_1.10.2-3.7.6.232.jar)

Loaded coremods (and transformers):

GL info: ~~ERROR~~ RuntimeException: No OpenGL context found in the current thread.

Profiler Position: N/A (disabled)

Player Count: 1 / 8; [EntityPlayerMP['Messorix'/349, l='Test world', x=3.70, y=68.00, z=1.64]]

Type: Integrated Server (map_client.txt)

Is Modded: Definitely; Client brand changed to 'fml,forge'

 

 

I guess you could call this progress :P

Link to comment
Share on other sites

for (int inputSlot = first_input_slot; inputSlot < first_input_slot + inputSlot; inputSlot++) {

Just be glad a null pointer exception was caused before a different one was.

VANILLA MINECRAFT CLASSES ARE THE BEST RESOURCES WHEN MODDING

I will be posting 1.15.2 modding tutorials on this channel. If you want to be notified of it do the normal YouTube stuff like subscribing, ect.

Forge and vanilla BlockState generator.

Link to comment
Share on other sites

After fixing that, it still crashed but with a different log:

 

---- Minecraft Crash Report ----

// Ooh. Shiny.

 

Time: 8/3/16 10:52 AM

Description: Ticking block entity

 

java.lang.NullPointerException: Ticking block entity

at com.messy.core.tileentities.ModTileEntity.numberOfBurningFuelSlots(ModTileEntity.java:65)

at com.messy.core.tileentities.TileEntityFluxGrinder.numberOfBurningFuelSlots(TileEntityFluxGrinder.java:38)

at com.messy.core.tileentities.ModTileEntity.update(ModTileEntity.java:221)

at net.minecraft.world.World.updateEntities(World.java:1940)

at net.minecraft.client.Minecraft.runTick(Minecraft.java:1886)

at net.minecraft.client.Minecraft.runGameLoop(Minecraft.java:1118)

at net.minecraft.client.Minecraft.run(Minecraft.java:406)

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.messy.core.tileentities.ModTileEntity.numberOfBurningFuelSlots(ModTileEntity.java:65)

at com.messy.core.tileentities.TileEntityFluxGrinder.numberOfBurningFuelSlots(TileEntityFluxGrinder.java:38)

at com.messy.core.tileentities.ModTileEntity.update(ModTileEntity.java:221)

 

-- Block entity being ticked --

Details:

Name: null // com.messy.core.tileentities.TileEntityFluxGrinder

Block type: ID #220 (tile.flux_grinder // com.messy.core.blocks.BlockFluxGrinder)

Block data value: 4 / 0x4 / 0b0100

Block location: World: (5,68,1), Chunk: (at 5,4,1 in 0,0; contains blocks 0,0,0 to 15,255,15), Region: (0,0; contains chunks 0,0 to 31,31, blocks 0,0,0 to 511,255,511)

Actual block type: ID #220 (tile.flux_grinder // com.messy.core.blocks.BlockFluxGrinder)

Actual block data value: 4 / 0x4 / 0b0100

Stacktrace:

at net.minecraft.world.World.updateEntities(World.java:1940)

 

-- Affected level --

Details:

Level name: MpServer

All players: 1 total; [EntityPlayerSP['Messorix'/348, l='MpServer', x=3.70, y=68.00, z=1.64]]

Chunk stats: MultiplayerChunkCache: 505, 505

Level seed: 0

Level generator: ID 00 - default, ver 1. Features enabled: false

Level generator options:

Level spawn location: World: (8,64,8), Chunk: (at 8,4,8 in 0,0; contains blocks 0,0,0 to 15,255,15), Region: (0,0; contains chunks 0,0 to 31,31, blocks 0,0,0 to 511,255,511)

Level time: 50207 game time, 5599 day time

Level dimension: 0

Level storage version: 0x00000 - Unknown?

Level weather: Rain time: 0 (now: false), thunder time: 0 (now: false)

Level game mode: Game mode: creative (ID 1). Hardcore: false. Cheats: false

Forced entities: 118 total; [EntityBat['Bat'/256, l='MpServer', x=80.51, y=27.10, z=-6.28], EntityHorse['Horse'/260, l='MpServer', x=80.15, y=87.00, z=77.90], EntityHorse['Horse'/63, l='MpServer', x=-73.90, y=69.00, z=-26.00], EntityCreeper['Creeper'/64, l='MpServer', x=-68.32, y=17.00, z=-8.43], EntityCreeper['Creeper'/65, l='MpServer', x=-69.04, y=17.00, z=-11.07], EntityCreeper['Creeper'/66, l='MpServer', x=-73.50, y=17.00, z=-8.50], EntitySkeleton['Skeleton'/67, l='MpServer', x=-73.66, y=18.00, z=-4.78], EntitySkeleton['Skeleton'/68, l='MpServer', x=-72.48, y=18.00, z=-11.27], EntityZombie['Zombie'/69, l='MpServer', x=-74.25, y=17.00, z=-8.52], EntityHorse['Horse'/70, l='MpServer', x=-68.66, y=73.00, z=-6.86], EntityHorse['Horse'/71, l='MpServer', x=-65.79, y=73.00, z=-11.44], EntityBat['Bat'/72, l='MpServer', x=-69.30, y=35.10, z=52.39], EntityCreeper['Creeper'/78, l='MpServer', x=-58.50, y=26.00, z=-56.50], EntityCreeper['Creeper'/79, l='MpServer', x=-57.50, y=26.00, z=-59.50], EntitySpider['Spider'/80, l='MpServer', x=-58.95, y=51.00, z=-61.99], EntityHorse['Horse'/81, l='MpServer', x=-60.97, y=70.00, z=-25.85], EntitySkeleton['Skeleton'/82, l='MpServer', x=-57.50, y=21.00, z=15.50], EntitySpider['Spider'/83, l='MpServer', x=-54.24, y=73.00, z=19.62], EntityHorse['Horse'/84, l='MpServer', x=-48.66, y=88.00, z=71.36], EntityPlayerSP['Messorix'/348, l='MpServer', x=3.70, y=68.00, z=1.64], EntitySkeleton['Skeleton'/99, l='MpServer', x=-38.26, y=27.00, z=-48.46], EntityRabbit['Rabbit'/100, l='MpServer', x=-44.79, y=74.03, z=-54.08], EntityZombie['Zombie'/101, l='MpServer', x=-46.52, y=23.00, z=-45.26], EntityRabbit['Rabbit'/102, l='MpServer', x=-36.29, y=75.25, z=-43.78], EntityHorse['Horse'/103, l='MpServer', x=-37.52, y=75.00, z=-41.74], EntitySquid['Squid'/104, l='MpServer', x=-38.77, y=62.33, z=-15.31], EntityBat['Bat'/105, l='MpServer', x=-37.16, y=27.20, z=3.71], EntityHorse['Donkey'/106, l='MpServer', x=-40.01, y=72.00, z=43.01], EntityHorse['Horse'/107, l='MpServer', x=-40.16, y=90.00, z=52.92], EntityHorse['Horse'/108, l='MpServer', x=-43.15, y=91.00, z=63.89], EntityHorse['Horse'/109, l='MpServer', x=-38.11, y=88.00, z=67.42], EntityBat['Bat'/112, l='MpServer', x=-18.25, y=14.10, z=-58.41], EntityHorse['Horse'/113, l='MpServer', x=-18.98, y=75.00, z=-51.81], EntityHorse['Horse'/114, l='MpServer', x=-21.07, y=75.00, z=-39.90], EntityHorse['Horse'/115, l='MpServer', x=-29.68, y=75.00, z=-33.89], EntityRabbit['Rabbit'/116, l='MpServer', x=-30.48, y=74.00, z=-30.27], EntitySkeleton['Skeleton'/117, l='MpServer', x=-18.49, y=13.00, z=-0.24], EntityHorse['Donkey'/118, l='MpServer', x=-19.84, y=69.00, z=36.62], EntityZombie['Zombie'/119, l='MpServer', x=-23.50, y=26.00, z=69.50], EntityRabbit['Rabbit'/127, l='MpServer', x=-10.39, y=71.00, z=-68.68], EntityRabbit['Rabbit'/128, l='MpServer', x=-13.39, y=71.00, z=-74.93], EntityRabbit['Rabbit'/129, l='MpServer', x=-0.90, y=76.00, z=-42.81], EntityBat['Bat'/130, l='MpServer', x=-6.04, y=28.10, z=18.50], EntityHorse['Donkey'/131, l='MpServer', x=-15.86, y=70.00, z=29.01], EntitySkeleton['Skeleton'/132, l='MpServer', x=-9.50, y=20.00, z=39.50], EntityHorse['Donkey'/133, l='MpServer', x=-11.82, y=68.00, z=36.56], EntityHorse['Donkey'/134, l='MpServer', x=-14.99, y=68.00, z=41.16], EntityCreeper['Creeper'/135, l='MpServer', x=-0.50, y=32.00, z=58.50], EntitySkeleton['Skeleton'/141, l='MpServer', x=7.51, y=41.00, z=-74.33], EntityCreeper['Creeper'/142, l='MpServer', x=0.72, y=43.00, z=-68.75], EntityCreeper['Creeper'/143, l='MpServer', x=15.50, y=42.00, z=-66.50], EntityBat['Bat'/144, l='MpServer', x=0.83, y=36.10, z=-64.84], EntityZombie['Zombie'/145, l='MpServer', x=3.81, y=43.00, z=-66.50], EntityBat['Bat'/146, l='MpServer', x=8.75, y=35.10, z=-64.25], EntityHorse['Horse'/147, l='MpServer', x=6.59, y=67.00, z=-71.01], EntitySkeleton['Skeleton'/148, l='MpServer', x=15.50, y=42.00, z=-63.50], EntityBat['Bat'/149, l='MpServer', x=5.95, y=31.10, z=5.73], EntitySkeleton['Skeleton'/160, l='MpServer', x=22.50, y=17.00, z=-67.71], EntitySkeleton['Skeleton'/161, l='MpServer', x=22.24, y=37.00, z=-65.18], EntitySkeleton['Skeleton'/162, l='MpServer', x=24.29, y=18.00, z=-55.49], EntityCreeper['Creeper'/163, l='MpServer', x=31.69, y=27.00, z=-63.93], EntityZombie['Zombie'/164, l='MpServer', x=29.60, y=34.00, z=-42.08], EntityCreeper['Creeper'/165, l='MpServer', x=28.88, y=30.00, z=-22.79], EntityCreeper['Creeper'/166, l='MpServer', x=23.79, y=31.00, z=-24.48], EntityCreeper['Creeper'/167, l='MpServer', x=30.39, y=16.00, z=-25.51], EntityEnderman['Enderman'/168, l='MpServer', x=18.86, y=31.00, z=-19.50], EntityCreeper['Creeper'/169, l='MpServer', x=27.34, y=32.00, z=-27.44], EntityBat['Bat'/170, l='MpServer', x=26.46, y=32.10, z=-18.03], EntityEnderman['Enderman'/171, l='MpServer', x=25.85, y=32.00, z=-28.95], EntityHorse['Horse'/172, l='MpServer', x=26.79, y=66.00, z=47.84], EntityBat['Bat'/173, l='MpServer', x=20.43, y=66.73, z=62.43], EntityZombie['Zombie'/188, l='MpServer', x=34.55, y=14.01, z=-49.90], EntitySkeleton['Skeleton'/189, l='MpServer', x=39.50, y=15.00, z=-29.50], EntitySkeleton['Skeleton'/190, l='MpServer', x=41.50, y=15.00, z=-27.50], EntityBat['Bat'/191, l='MpServer', x=35.75, y=18.10, z=-22.25], EntityHorse['Horse'/192, l='MpServer', x=37.10, y=95.00, z=-31.93], EntityPig['Pig'/193, l='MpServer', x=37.45, y=95.00, z=-24.68], EntityHorse['Horse'/194, l='MpServer', x=33.18, y=93.00, z=-20.99], EntityHorse['Horse'/195, l='MpServer', x=44.41, y=82.00, z=25.10], EntityHorse['Horse'/196, l='MpServer', x=44.12, y=72.00, z=34.08], EntityCreeper['Creeper'/207, l='MpServer', x=62.73, y=21.00, z=-38.79], EntityCow['Cow'/208, l='MpServer', x=59.06, y=96.00, z=-45.26], EntityBat['Bat'/209, l='MpServer', x=65.49, y=41.22, z=-23.60], EntityPig['Pig'/210, l='MpServer', x=63.42, y=93.00, z=-22.51], EntityHorse['Horse'/211, l='MpServer', x=58.31, y=95.00, z=-6.95], EntityHorse['Donkey'/212, l='MpServer', x=56.03, y=95.00, z=-4.11], EntityHorse['Horse'/213, l='MpServer', x=51.02, y=93.00, z=1.15], EntityPig['Pig'/214, l='MpServer', x=61.58, y=93.00, z=0.05], EntityHorse['Donkey'/215, l='MpServer', x=62.97, y=90.00, z=29.89], EntityPig['Pig'/216, l='MpServer', x=63.50, y=93.00, z=16.25], EntityPig['Pig'/217, l='MpServer', x=61.30, y=93.00, z=25.50], EntityHorse['Donkey'/218, l='MpServer', x=52.04, y=92.00, z=58.14], EntityHorse['Horse'/219, l='MpServer', x=53.56, y=93.00, z=56.00], EntityHorse['Horse'/220, l='MpServer', x=54.42, y=89.00, z=74.68], EntitySkeleton['Skeleton'/225, l='MpServer', x=69.08, y=49.00, z=-70.41], EntitySkeleton['Skeleton'/226, l='MpServer', x=79.58, y=50.00, z=-66.73], EntityCow['Cow'/227, l='MpServer', x=68.56, y=90.00, z=-72.61], EntityCreeper['Creeper'/228, l='MpServer', x=77.66, y=21.00, z=-51.90], EntityCreeper['Creeper'/229, l='MpServer', x=72.49, y=45.00, z=-48.17], EntityCow['Cow'/232, l='MpServer', x=71.09, y=96.00, z=-48.51], EntityPig['Pig'/233, l='MpServer', x=74.46, y=93.00, z=-35.39], EntityZombie['Zombie'/234, l='MpServer', x=67.39, y=85.16, z=-35.66], EntityZombie['Zombie'/235, l='MpServer', x=74.51, y=79.00, z=-35.15], EntityPig['Pig'/236, l='MpServer', x=67.69, y=96.00, z=-45.22], EntityPig['Pig'/237, l='MpServer', x=75.51, y=97.00, z=-45.71], EntityCreeper['Creeper'/238, l='MpServer', x=78.35, y=52.00, z=-23.50], EntityCreeper['Creeper'/239, l='MpServer', x=65.57, y=84.00, z=-30.77], EntityHorse['Horse'/240, l='MpServer', x=66.33, y=96.00, z=-27.40], EntitySkeleton['Skeleton'/241, l='MpServer', x=70.70, y=24.00, z=-12.30], EntityHorse['Horse'/242, l='MpServer', x=77.94, y=88.00, z=-9.86], EntityPig['Pig'/243, l='MpServer', x=68.45, y=89.00, z=30.45], EntityPig['Pig'/244, l='MpServer', x=65.48, y=91.00, z=20.04], EntityHorse['Donkey'/245, l='MpServer', x=65.30, y=91.00, z=52.03], EntityHorse['Horse'/246, l='MpServer', x=73.79, y=88.00, z=52.16], EntityHorse['Horse'/247, l='MpServer', x=73.89, y=86.00, z=77.00], EntityZombie['Zombie'/250, l='MpServer', x=80.40, y=51.00, z=-60.01], EntityPig['Pig'/254, l='MpServer', x=83.53, y=97.00, z=-43.79], EntityZombie['Zombie'/255, l='MpServer', x=81.16, y=25.00, z=-16.29]]

Retry entities: 0 total; []

Server brand: fml,forge

Server type: Integrated singleplayer server

Stacktrace:

at net.minecraft.client.multiplayer.WorldClient.addWorldInfoToCrashReport(WorldClient.java:450)

at net.minecraft.client.Minecraft.addGraphicsAndWorldToCrashReport(Minecraft.java:2779)

at net.minecraft.client.Minecraft.run(Minecraft.java:427)

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

Operating System: Windows 8.1 (amd64) version 6.3

Java Version: 1.8.0_102, Oracle Corporation

Java VM Version: Java HotSpot 64-Bit Server VM (mixed mode), Oracle Corporation

Memory: 964775352 bytes (920 MB) / 1675624448 bytes (1598 MB) up to 7635730432 bytes (7282 MB)

JVM Flags: 2 total; -Xmx8g -Xms256m

IntCache: cache: 0, tcache: 0, allocated: 13, tallocated: 95

FML: MCP 9.32 Powered by Forge 12.18.1.2011 6 mods loaded, 6 mods active

States: 'U' = Unloaded 'L' = Loaded 'C' = Constructed 'H' = Pre-initialized 'I' = Initialized 'J' = Post-initialized 'A' = Available 'D' = Disabled 'E' = Errored

UCHIJAAAA mcp{9.19} [Minecraft Coder Pack] (minecraft.jar)

UCHIJAAAA FML{8.0.99.99} [Forge Mod Loader] (forgeSrc-1.10.2-12.18.1.2011.jar)

UCHIJAAAA Forge{12.18.1.2011} [Minecraft Forge] (forgeSrc-1.10.2-12.18.1.2011.jar)

UCHIJAAAA messycore{0.0.1} [Messy: Core] (bin)

UCHIJAAAA examplemod{1.0} [Example Mod] (bin)

UCHIJAAAA JEI{3.7.6.232} [Just Enough Items] (jei_1.10.2-3.7.6.232.jar)

Loaded coremods (and transformers):

GL info: ' Vendor: 'ATI Technologies Inc.' Version: '4.5.13431 Compatibility Profile Context 16.150.2211.0' Renderer: 'AMD Radeon HD 7900 Series'

Launched Version: 1.10.2

LWJGL: 2.9.4

OpenGL: AMD Radeon HD 7900 Series GL version 4.5.13431 Compatibility Profile Context 16.150.2211.0, ATI Technologies Inc.

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® Core i5-3570K CPU @ 3.40GHz

 

 

As you can see, it seems very familiar...

burnTimeRemaining has to be the cause, but I'm not sure in what way

Link to comment
Share on other sites

Weird I'm pretty sure that the error is caused by burnTimeRemaining being null when numverOfBurningFuelSlots(); is called

VANILLA MINECRAFT CLASSES ARE THE BEST RESOURCES WHEN MODDING

I will be posting 1.15.2 modding tutorials on this channel. If you want to be notified of it do the normal YouTube stuff like subscribing, ect.

Forge and vanilla BlockState generator.

Link to comment
Share on other sites

TileEntityFluxGrinder is the flux grinder's entity class (since it is a custom 3d model)

ModTileEntity is the parent class where most of the logic of it is stored, so that other entity classes can be as clean as possible without losing the same functionality.

 

Basic coding design afaik

Link to comment
Share on other sites

Well... Didn't realize that you meant that :P

My bad :P

 

The functionality is based around it making the block in question work like a machine with a way of processing items.

I'm making the flux grinder first, but flux furnace will be next for example.

 

A bit similar to Thermal expansions pulverizer and redstone furnace.

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.

Announcements




×
×
  • Create New...

Important Information

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