- 47
- 0
Когда крашлог ругается на мой код, я примерно понимаю, что нужно делать, а когда вот так...
Код GuiRubberFactory:
Краш лог:
Код GuiRubberFactory:
Код:
package com.alternativemod.gui;
import org.lwjgl.opengl.GL11;
import com.alternativemod.blocks.RubberFactory;
import com.alternativemod.containers.RubberFactoryContainer;
import com.alternativemod.tile.entity.TileEntityRubberFactory;
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
import net.minecraft.client.gui.inventory.GuiContainer;
import net.minecraft.client.resources.I18n;
import net.minecraft.entity.player.InventoryPlayer;
import net.minecraft.util.ResourceLocation;
import net.minecraftforge.common.ForgeVersion.Status;
@SideOnly(Side.CLIENT)
public class GuiRubberFactory extends GuiContainer {
private static final ResourceLocation furnaceGuiTextures = new ResourceLocation("textures/gui/container/furnace.png");
private TileEntityRubberFactory tilefactory;
public GuiRubberFactory(InventoryPlayer invPlayer, TileEntityRubberFactory tile) {
super(new RubberFactoryContainer(invPlayer, tile));
this.tilefactory = tile;
}
protected void drawGuiContainerForegroundLayer(int par1, int par2){
String string = this.tilefactory.hasCustomInventoryName() ? this.tilefactory.getInventoryName() : I18n.format(this.tilefactory.getInventoryName(), new Object[0]);
this.fontRendererObj.drawString(string, this.xSize / 2 - this.fontRendererObj.getStringWidth(string), 6, 4210752);
this.fontRendererObj.drawString(I18n.format("container.inventory", new Object[0]), 8, this.ySize - 94, 4210752);
}
@Override
protected void drawGuiContainerBackgroundLayer(float var1, int var2, int var3) {
GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F);
this.mc.getTextureManager().bindTexture(furnaceGuiTextures);
int k = (this.width - this.xSize) / 2;
int l = (this.height - this.ySize) / 2;
this.drawTexturedModalRect(k, l, 0, 0, this.xSize, this.ySize);
int i1;
if (RubberFactory.isBurning)
{
i1 = this.tilefactory.getBurnTimeRemainingScaled(12);
this.drawTexturedModalRect(k + 56, l + 36 + 12 - i1, 176, 12 - i1, 14, i1 + 2);
}
i1 = this.tilefactory.getCookProgressScaled(24);
this.drawTexturedModalRect(k + 79, l + 34, 176, 14, i1 + 1, 16);
}
}
Краш лог:
Код:
---- Minecraft Crash Report ----
// I let you down. Sorry :(
Time: 28.11.15 11:21
Description: Rendering screen
java.lang.NullPointerException: Rendering screen
at net.minecraft.inventory.Slot.getStack(Slot.java:88)
at net.minecraft.client.gui.inventory.GuiContainer.func_146977_a(GuiContainer.java:219)
at net.minecraft.client.gui.inventory.GuiContainer.drawScreen(GuiContainer.java:114)
at net.minecraft.client.renderer.EntityRenderer.updateCameraAndRender(EntityRenderer.java:1137)
at net.minecraft.client.Minecraft.runGameLoop(Minecraft.java:1067)
at net.minecraft.client.Minecraft.run(Minecraft.java:962)
at net.minecraft.client.main.Main.main(Main.java:164)
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 net.minecraftforge.gradle.GradleStartCommon.launch(Unknown Source)
at GradleStart.main(Unknown Source)
A detailed walkthrough of the error, its code path and all known details is as follows:
---------------------------------------------------------------------------------------
-- Head --
Stacktrace:
at net.minecraft.inventory.Slot.getStack(Slot.java:88)
at net.minecraft.client.gui.inventory.GuiContainer.func_146977_a(GuiContainer.java:219)
at net.minecraft.client.gui.inventory.GuiContainer.drawScreen(GuiContainer.java:114)
-- Screen render details --
Details:
Screen name: com.alternativemod.gui.GuiRubberBase
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; [EntityClientPlayerMP['Player935'/171, l='MpServer', x=-241,96, y=5,62, z=-90,86]]
Chunk stats: MultiplayerChunkCache: 289, 289
Level seed: 0
Level generator: ID 01 - flat, ver 0. Features enabled: false
Level generator options:
Level spawn location: World: (-265,4,-139), Chunk: (at 7,0,5 in -17,-9; contains blocks -272,0,-144 to -257,255,-129), Region: (-1,-1; contains chunks -32,-32 to -1,-1, blocks -512,0,-512 to -1,255,-1)
Level time: 290388 game time, 10944 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: 17 total; [EntityCow['Cow'/64, l='MpServer', x=-292,94, y=4,00, z=-129,88], EntityBat['Bat'/160, l='MpServer', x=-166,59, y=4,71, z=-7,97], EntitySheep['Sheep'/65, l='MpServer', x=-289,50, y=4,00, z=-121,47], EntityBat['Bat'/161, l='MpServer', x=-168,83, y=14,77, z=-31,02], EntityHorse['Horse'/162, l='MpServer', x=-174,94, y=4,00, z=-15,06], EntityHorse['Horse'/67, l='MpServer', x=-281,28, y=4,00, z=-118,25], EntityHorse['Horse'/71, l='MpServer', x=-279,04, y=4,00, z=-41,90], EntityCow['Cow'/81, l='MpServer', x=-254,94, y=4,00, z=-159,88], EntityClientPlayerMP['Player935'/171, l='MpServer', x=-241,96, y=5,62, z=-90,86], EntityCow['Cow'/151, l='MpServer', x=-186,78, y=4,00, z=-168,34], EntityPig['Pig'/92, l='MpServer', x=-225,06, y=4,00, z=-164,97], EntityChicken['Chicken'/93, l='MpServer', x=-234,41, y=4,00, z=-151,59], EntityPig['Pig'/125, l='MpServer', x=-214,66, y=4,00, z=-169,81], EntityChicken['Chicken'/62, l='MpServer', x=-306,53, y=4,00, z=-152,97], EntityCow['Cow'/158, l='MpServer', x=-166,81, y=4,00, z=-158,19], EntityCow['Cow'/63, l='MpServer', x=-309,81, y=4,00, z=-81,81], EntityChicken['Chicken'/159, l='MpServer', x=-170,47, y=4,00, z=-124,44]]
Retry entities: 0 total; []
Server brand: fml,forge
Server type: Integrated singleplayer server
Stacktrace:
at net.minecraft.client.multiplayer.WorldClient.addWorldInfoToCrashReport(WorldClient.java:415)
at net.minecraft.client.Minecraft.addGraphicsAndWorldToCrashReport(Minecraft.java:2566)
at net.minecraft.client.Minecraft.run(Minecraft.java:984)
at net.minecraft.client.main.Main.main(Main.java:164)
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 net.minecraftforge.gradle.GradleStartCommon.launch(Unknown Source)
at GradleStart.main(Unknown Source)
-- System Details --
Details:
Minecraft Version: 1.7.10
Operating System: Windows 7 (x86) version 6.1
Java Version: 1.8.0_65, Oracle Corporation
Java VM Version: Java HotSpot(TM) Client VM (mixed mode), Oracle Corporation
Memory: 947547160 bytes (903 MB) / 1046937600 bytes (998 MB) up to 1046937600 bytes (998 MB)
JVM Flags: 3 total; -Xincgc -Xmx1024M -Xms1024M
AABB Pool Size: 0 (0 bytes; 0 MB) allocated, 0 (0 bytes; 0 MB) used
IntCache: cache: 0, tcache: 0, allocated: 0, tallocated: 0
FML: MCP v9.05 FML v7.10.99.99 Minecraft Forge 10.13.4.1448 4 mods loaded, 4 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.05} [Minecraft Coder Pack] (minecraft.jar)
UCHIJAAAA FML{7.10.99.99} [Forge Mod Loader] (forgeSrc-1.7.10-10.13.4.1448-1.7.10.jar)
UCHIJAAAA Forge{10.13.4.1448} [Minecraft Forge] (forgeSrc-1.7.10-10.13.4.1448-1.7.10.jar)
UCHIJAAAA alternativemod{0.0.1} [Alternative Mod] (bin)
GL info: ' Vendor: 'ATI Technologies Inc.' Version: '4.4.13283 Compatibility Profile Context 14.501.1003.0' Renderer: 'AMD Radeon HD 6520G'
Launched Version: 1.7.10
LWJGL: 2.9.1
OpenGL: AMD Radeon HD 6520G GL version 4.4.13283 Compatibility Profile Context 14.501.1003.0, ATI Technologies Inc.
GL Caps: Using GL 1.3 multitexturing.
Using framebuffer objects because OpenGL 3.0 is supported and separate blending is supported.
Anisotropic filtering is supported and maximum anisotropy is 16.
Shaders are available because OpenGL 2.1 is supported.
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)
Vec3 Pool Size: 0 (0 bytes; 0 MB) allocated, 0 (0 bytes; 0 MB) used
Anisotropic Filtering: Off (1)