Jump to content

Recommended Posts

Posted (edited)

In short, the NBT data of a tile entity isn't being loaded properly.


I've been messing with making a generator block which generates energy if given a certain type of fuel. That actual process of burning an item to generate power works fine, and it's saved to the tile entity fine too. I can burn something, exit the UI, reopen and everything is as it should be.

 

When I leave the game, the NBT data appears to be saved correctly too, because I added a debug print upon writing NBT data that outputs the current energy value. Having burned one item, this is always non-zero (as it should be).

If I rejoin the game though, I get various outputs. I also added a debug print when loading NBT data to output NBT data, but while the game is loading, it's called various times. I've added an output log in the spoiler below, so you can see exactly when the value is reset.

 

Output log:

Spoiler

Below I've provided the output log of doing the following actions, in order:

- Run game

- Load world

- Place down my "Ruby Generator" block

- Insert item which produces energy

- Open pause menu (which saves NBT data)

- Exit world

- Rejoin world

 

The issue occurs upon rejoining the world. The NBT data seems to be read correctly several times, outputting the correct value of 4320. There is also one time when it is not read correctly, and it outputs 0. This breaks the tile entity.

Note that the errors in the log are due to missing models. I have not textured the block yet.

 


[15:12:24] [main/INFO] [GradleStart]: Extra: []
[15:12:24] [main/INFO] [GradleStart]: Running with arguments: [--userProperties, {}, --assetsDir, C:/Users/Eigenaar/.gradle/caches/minecraft/assets, --assetIndex, 1.12, --accessToken{REDACTED}, --version, 1.12.2, --tweakClass, net.minecraftforge.fml.common.launcher.FMLTweaker, --tweakClass, net.minecraftforge.gradle.tweakers.CoremodTweaker]
[15:12:24] [main/INFO] [LaunchWrapper]: Loading tweak class name net.minecraftforge.fml.common.launcher.FMLTweaker
[15:12:24] [main/INFO] [LaunchWrapper]: Using primary tweak class name net.minecraftforge.fml.common.launcher.FMLTweaker
[15:12:24] [main/INFO] [LaunchWrapper]: Loading tweak class name net.minecraftforge.gradle.tweakers.CoremodTweaker
[15:12:24] [main/INFO] [LaunchWrapper]: Calling tweak class net.minecraftforge.fml.common.launcher.FMLTweaker
[15:12:24] [main/INFO] [FML]: Forge Mod Loader version 14.23.5.2768 for Minecraft 1.12.2 loading
[15:12:24] [main/INFO] [FML]: Java is Java HotSpot(TM) 64-Bit Server VM, version 1.8.0_241, running on Windows 10:amd64:10.0, installed at C:\Program Files\Java\jre1.8.0_241
[15:12:24] [main/ERROR] [FML]: Apache Maven library folder was not in the format expected. Using default libraries directory.
[15:12:24] [main/ERROR] [FML]: Full: C:\Users\Eigenaar\.gradle\caches\modules-2\files-2.1\org.apache.maven\maven-artifact\3.5.3\7dc72b6d6d8a6dced3d294ed54c2cc3515ade9f4\maven-artifact-3.5.3.jar
[15:12:24] [main/ERROR] [FML]: Trimmed: c:/users/eigenaar/.gradle/caches/modules-2/files-2.1/org.apache.maven/maven-artifact/3.5.3/
[15:12:24] [main/INFO] [FML]: Managed to load a deobfuscated Minecraft name- we are in a deobfuscated environment. Skipping runtime deobfuscation
[15:12:24] [main/INFO] [FML]: Detected deobfuscated environment, loading log configs for colored console logs.
2020-02-29 15:12:25,738 main WARN Disabling terminal, you're running in an unsupported environment.
[15:12:25] [main/INFO] [FML]: Ignoring missing certificate for coremod FMLCorePlugin (net.minecraftforge.fml.relauncher.FMLCorePlugin), we are in deobf and it's a forge core plugin
[15:12:25] [main/INFO] [FML]: Ignoring missing certificate for coremod FMLForgePlugin (net.minecraftforge.classloading.FMLForgePlugin), we are in deobf and it's a forge core plugin
[15:12:25] [main/INFO] [FML]: Searching D:\Desktop\MCMod\run\.\mods for mods
[15:12:25] [main/INFO] [LaunchWrapper]: Calling tweak class net.minecraftforge.gradle.tweakers.CoremodTweaker
[15:12:25] [main/INFO] [GradleStart]: Injecting location in coremod net.minecraftforge.fml.relauncher.FMLCorePlugin
[15:12:25] [main/INFO] [GradleStart]: Injecting location in coremod net.minecraftforge.classloading.FMLForgePlugin
[15:12:25] [main/INFO] [LaunchWrapper]: Loading tweak class name net.minecraftforge.fml.common.launcher.FMLInjectionAndSortingTweaker
[15:12:25] [main/INFO] [LaunchWrapper]: Loading tweak class name net.minecraftforge.fml.common.launcher.FMLDeobfTweaker
[15:12:25] [main/INFO] [LaunchWrapper]: Loading tweak class name net.minecraftforge.gradle.tweakers.AccessTransformerTweaker
[15:12:25] [main/INFO] [LaunchWrapper]: Calling tweak class net.minecraftforge.fml.common.launcher.FMLInjectionAndSortingTweaker
[15:12:25] [main/INFO] [LaunchWrapper]: Calling tweak class net.minecraftforge.fml.common.launcher.FMLInjectionAndSortingTweaker
[15:12:25] [main/INFO] [LaunchWrapper]: Calling tweak class net.minecraftforge.fml.relauncher.CoreModManager$FMLPluginWrapper
[15:12:27] [main/ERROR] [FML]: FML appears to be missing any signature data. This is not a good thing
[15:12:27] [main/INFO] [LaunchWrapper]: Calling tweak class net.minecraftforge.fml.relauncher.CoreModManager$FMLPluginWrapper
[15:12:27] [main/INFO] [LaunchWrapper]: Calling tweak class net.minecraftforge.fml.common.launcher.FMLDeobfTweaker
[15:12:27] [main/INFO] [LaunchWrapper]: Calling tweak class net.minecraftforge.gradle.tweakers.AccessTransformerTweaker
[15:12:27] [main/INFO] [GradleStart]: Remapping AccessTransformer rules...
[15:12:27] [main/INFO] [LaunchWrapper]: Loading tweak class name net.minecraftforge.fml.common.launcher.TerminalTweaker
[15:12:27] [main/INFO] [LaunchWrapper]: Calling tweak class net.minecraftforge.fml.common.launcher.TerminalTweaker
[15:12:27] [main/INFO] [LaunchWrapper]: Launching wrapped minecraft {net.minecraft.client.main.Main}
[15:12:28] [main/INFO] [minecraft/Minecraft]: Setting user: Player217
[15:12:31] [main/WARN] [minecraft/GameSettings]: Skipping bad option: lastServer:
[15:12:31] [main/INFO] [minecraft/Minecraft]: LWJGL Version: 2.9.4
[15:12:32] [main/INFO] [FML]: -- System Details --
Details:
	Minecraft Version: 1.12.2
	Operating System: Windows 10 (amd64) version 10.0
	Java Version: 1.8.0_241, Oracle Corporation
	Java VM Version: Java HotSpot(TM) 64-Bit Server VM (mixed mode), Oracle Corporation
	Memory: 794738376 bytes (757 MB) / 1038876672 bytes (990 MB) up to 1038876672 bytes (990 MB)
	JVM Flags: 3 total; -Xincgc -Xmx1024M -Xms1024M
	IntCache: cache: 0, tcache: 0, allocated: 0, tallocated: 0
	FML: 
	Loaded coremods (and transformers): 
	GL info: ' Vendor: 'NVIDIA Corporation' Version: '4.6.0 NVIDIA 436.30' Renderer: 'GeForce GTX 960/PCIe/SSE2'
[15:12:32] [main/INFO] [FML]: MinecraftForge v14.23.5.2768 Initialized
[15:12:32] [main/INFO] [FML]: Starts to replace vanilla recipe ingredients with ore ingredients.
[15:12:32] [main/INFO] [FML]: Replaced 1036 ore ingredients
[15:12:32] [main/INFO] [FML]: Searching D:\Desktop\MCMod\run\.\mods for mods
[15:12:33] [main/INFO] [FML]: Forge Mod Loader has identified 6 mods to load
[15:12:33] [main/WARN] [FML]: ****************************************
[15:12:33] [main/WARN] [FML]: * The API JustEnoughItemsAPI from source C:\Users\Eigenaar\.gradle\caches\modules-2\files-2.1\mezz.jei\jei_1.12.2\4.14.4.267\c669793e57527b8d8b5085b06a786524f98c6cbf\jei_1.12.2-4.14.4.267.jar is loaded from an incompatible classloader. THIS WILL NOT WORK!
[15:12:33] [main/WARN] [FML]: *  at net.minecraftforge.fml.common.ModAPIManager$APIContainer.validate(ModAPIManager.java:114)
[15:12:33] [main/WARN] [FML]: *  at net.minecraftforge.fml.common.ModAPIManager.registerDataTableAndParseAPI(ModAPIManager.java:174)
[15:12:33] [main/WARN] [FML]: *  at net.minecraftforge.fml.common.ModAPIManager.manageAPI(ModAPIManager.java:232)
[15:12:33] [main/WARN] [FML]: *  at net.minecraftforge.fml.common.Loader.loadMods(Loader.java:567)
[15:12:33] [main/WARN] [FML]: *  at net.minecraftforge.fml.client.FMLClientHandler.beginMinecraftLoading(FMLClientHandler.java:232)
[15:12:33] [main/WARN] [FML]: *  at net.minecraft.client.Minecraft.init(Minecraft.java:513)...
[15:12:33] [main/WARN] [FML]: ****************************************
[15:12:34] [main/INFO] [FML]: Attempting connection with missing mods [minecraft, mcp, FML, forge, experimentalmod, jei] at CLIENT
[15:12:34] [main/INFO] [FML]: Attempting connection with missing mods [minecraft, mcp, FML, forge, experimentalmod, jei] at SERVER
[15:12:34] [main/INFO] [minecraft/SimpleReloadableResourceManager]: Reloading ResourceManager: Default, FMLFileResourcePack:Forge Mod Loader, FMLFileResourcePack:Minecraft Forge, FMLFileResourcePack:Experimental Mod, FMLFileResourcePack:Just Enough Items
[15:12:34] [main/INFO] [FML]: Processing ObjectHolder annotations
[15:12:34] [main/INFO] [FML]: Found 1168 ObjectHolder annotations
[15:12:34] [main/INFO] [FML]: Identifying ItemStackHolder annotations
[15:12:34] [main/INFO] [FML]: Found 0 ItemStackHolder annotations
[15:12:34] [Thread-3/INFO] [FML]: Using sync timing. 200 frames of Display.update took 171685293 nanos
[15:12:34] [main/INFO] [FML]: Configured a dormant chunk cache size of 0
[15:12:34] [Forge Version Check/INFO] [forge.VersionCheck]: [forge] Starting version check at http://files.minecraftforge.net/maven/net/minecraftforge/forge/promotions_slim.json
[15:12:35] [Forge Version Check/INFO] [forge.VersionCheck]: [forge] Found status: UP_TO_DATE Target: null
[15:12:35] [main/INFO] [FML]: Applying holder lookups
[15:12:35] [main/INFO] [FML]: Holder lookups applied
[15:12:35] [main/INFO] [FML]: Applying holder lookups
[15:12:35] [main/INFO] [FML]: Holder lookups applied
[15:12:35] [main/INFO] [FML]: Applying holder lookups
[15:12:35] [main/INFO] [FML]: Holder lookups applied
[15:12:35] [main/INFO] [FML]: Applying holder lookups
[15:12:35] [main/INFO] [FML]: Holder lookups applied
[15:12:35] [main/INFO] [FML]: Injecting itemstacks
[15:12:35] [main/INFO] [FML]: Itemstack injection complete
[15:12:38] [Sound Library Loader/INFO] [minecraft/SoundManager]: Starting up SoundSystem...
[15:12:38] [Thread-5/INFO] [minecraft/SoundManager]: Initializing LWJGL OpenAL
[15:12:38] [Thread-5/INFO] [minecraft/SoundManager]: (The LWJGL binding of OpenAL.  For more information, see http://www.lwjgl.org)
[15:12:38] [Thread-5/INFO] [minecraft/SoundManager]: OpenAL initialized.
[15:12:38] [Sound Library Loader/INFO] [minecraft/SoundManager]: Sound engine started
[15:12:43] [main/INFO] [FML]: Max texture size: 16384
[15:12:43] [main/INFO] [minecraft/TextureMap]: Created: 512x512 textures-atlas
[15:12:44] [main/ERROR] [FML]: Exception loading model for variant experimentalmod:ruby_generator#burning=true,facing=east for blockstate "experimentalmod:ruby_generator[burning=true,facing=east]"
net.minecraftforge.client.model.ModelLoaderRegistry$LoaderException: Exception loading model experimentalmod:ruby_generator#burning=true,facing=east with loader VariantLoader.INSTANCE, skipping
	at net.minecraftforge.client.model.ModelLoaderRegistry.getModel(ModelLoaderRegistry.java:161) ~[ModelLoaderRegistry.class:?]
	at net.minecraftforge.client.model.ModelLoader.registerVariant(ModelLoader.java:235) ~[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:223) ~[ModelLoader.class:?]
	at net.minecraftforge.client.model.ModelLoader.setupModelRegistry(ModelLoader.java:150) ~[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:121) [SimpleReloadableResourceManager.class:?]
	at net.minecraft.client.Minecraft.init(Minecraft.java:559) [Minecraft.class:?]
	at net.minecraft.client.Minecraft.run(Minecraft.java:421) [Minecraft.class:?]
	at net.minecraft.client.main.Main.main(Main.java:118) [Main.class:?]
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[?:1.8.0_241]
	at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source) ~[?:1.8.0_241]
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) ~[?:1.8.0_241]
	at java.lang.reflect.Method.invoke(Unknown Source) ~[?:1.8.0_241]
	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_241]
	at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source) ~[?:1.8.0_241]
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) ~[?:1.8.0_241]
	at java.lang.reflect.Method.invoke(Unknown Source) ~[?:1.8.0_241]
	at net.minecraftforge.gradle.GradleStartCommon.launch(GradleStartCommon.java:97) [start/:?]
	at GradleStart.main(GradleStart.java:25) [start/:?]
Caused by: net.minecraft.client.renderer.block.model.ModelBlockDefinition$MissingVariantException
	at net.minecraft.client.renderer.block.model.ModelBlockDefinition.getVariant(ModelBlockDefinition.java:83) ~[ModelBlockDefinition.class:?]
	at net.minecraftforge.client.model.ModelLoader$VariantLoader.loadModel(ModelLoader.java:1175) ~[ModelLoader$VariantLoader.class:?]
	at net.minecraftforge.client.model.ModelLoaderRegistry.getModel(ModelLoaderRegistry.java:157) ~[ModelLoaderRegistry.class:?]
	... 21 more
[15:12:44] [main/ERROR] [FML]: Exception loading blockstate for the variant experimentalmod:ruby_generator#burning=true,facing=east: 
java.lang.Exception: Could not load model definition for variant experimentalmod:ruby_generator
	at net.minecraftforge.client.model.ModelLoader.getModelBlockDefinition(ModelLoader.java:269) ~[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:223) ~[ModelLoader.class:?]
	at net.minecraftforge.client.model.ModelLoader.setupModelRegistry(ModelLoader.java:150) ~[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:121) [SimpleReloadableResourceManager.class:?]
	at net.minecraft.client.Minecraft.init(Minecraft.java:559) [Minecraft.class:?]
	at net.minecraft.client.Minecraft.run(Minecraft.java:421) [Minecraft.class:?]
	at net.minecraft.client.main.Main.main(Main.java:118) [Main.class:?]
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[?:1.8.0_241]
	at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source) ~[?:1.8.0_241]
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) ~[?:1.8.0_241]
	at java.lang.reflect.Method.invoke(Unknown Source) ~[?:1.8.0_241]
	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_241]
	at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source) ~[?:1.8.0_241]
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) ~[?:1.8.0_241]
	at java.lang.reflect.Method.invoke(Unknown Source) ~[?:1.8.0_241]
	at net.minecraftforge.gradle.GradleStartCommon.launch(GradleStartCommon.java:97) [start/:?]
	at GradleStart.main(GradleStart.java:25) [start/:?]
Caused by: java.lang.RuntimeException: Encountered an exception when loading model definition of model experimentalmod:blockstates/ruby_generator.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:265) ~[ModelLoader.class:?]
	... 20 more
Caused by: java.io.FileNotFoundException: experimentalmod:blockstates/ruby_generator.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:265) ~[ModelLoader.class:?]
	... 20 more
[15:12:44] [main/ERROR] [FML]: Exception loading model for variant experimentalmod:ruby_generator#burning=false,facing=south for blockstate "experimentalmod:ruby_generator[burning=false,facing=south]"
net.minecraftforge.client.model.ModelLoaderRegistry$LoaderException: Exception loading model experimentalmod:ruby_generator#burning=false,facing=south with loader VariantLoader.INSTANCE, skipping
	at net.minecraftforge.client.model.ModelLoaderRegistry.getModel(ModelLoaderRegistry.java:161) ~[ModelLoaderRegistry.class:?]
	at net.minecraftforge.client.model.ModelLoader.registerVariant(ModelLoader.java:235) ~[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:223) ~[ModelLoader.class:?]
	at net.minecraftforge.client.model.ModelLoader.setupModelRegistry(ModelLoader.java:150) ~[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:121) [SimpleReloadableResourceManager.class:?]
	at net.minecraft.client.Minecraft.init(Minecraft.java:559) [Minecraft.class:?]
	at net.minecraft.client.Minecraft.run(Minecraft.java:421) [Minecraft.class:?]
	at net.minecraft.client.main.Main.main(Main.java:118) [Main.class:?]
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[?:1.8.0_241]
	at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source) ~[?:1.8.0_241]
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) ~[?:1.8.0_241]
	at java.lang.reflect.Method.invoke(Unknown Source) ~[?:1.8.0_241]
	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_241]
	at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source) ~[?:1.8.0_241]
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) ~[?:1.8.0_241]
	at java.lang.reflect.Method.invoke(Unknown Source) ~[?:1.8.0_241]
	at net.minecraftforge.gradle.GradleStartCommon.launch(GradleStartCommon.java:97) [start/:?]
	at GradleStart.main(GradleStart.java:25) [start/:?]
Caused by: net.minecraft.client.renderer.block.model.ModelBlockDefinition$MissingVariantException
	at net.minecraft.client.renderer.block.model.ModelBlockDefinition.getVariant(ModelBlockDefinition.java:83) ~[ModelBlockDefinition.class:?]
	at net.minecraftforge.client.model.ModelLoader$VariantLoader.loadModel(ModelLoader.java:1175) ~[ModelLoader$VariantLoader.class:?]
	at net.minecraftforge.client.model.ModelLoaderRegistry.getModel(ModelLoaderRegistry.java:157) ~[ModelLoaderRegistry.class:?]
	... 21 more
[15:12:44] [main/ERROR] [FML]: Exception loading model for variant experimentalmod:ruby_generator#burning=true,facing=south for blockstate "experimentalmod:ruby_generator[burning=true,facing=south]"
net.minecraftforge.client.model.ModelLoaderRegistry$LoaderException: Exception loading model experimentalmod:ruby_generator#burning=true,facing=south with loader VariantLoader.INSTANCE, skipping
	at net.minecraftforge.client.model.ModelLoaderRegistry.getModel(ModelLoaderRegistry.java:161) ~[ModelLoaderRegistry.class:?]
	at net.minecraftforge.client.model.ModelLoader.registerVariant(ModelLoader.java:235) ~[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:223) ~[ModelLoader.class:?]
	at net.minecraftforge.client.model.ModelLoader.setupModelRegistry(ModelLoader.java:150) ~[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:121) [SimpleReloadableResourceManager.class:?]
	at net.minecraft.client.Minecraft.init(Minecraft.java:559) [Minecraft.class:?]
	at net.minecraft.client.Minecraft.run(Minecraft.java:421) [Minecraft.class:?]
	at net.minecraft.client.main.Main.main(Main.java:118) [Main.class:?]
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[?:1.8.0_241]
	at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source) ~[?:1.8.0_241]
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) ~[?:1.8.0_241]
	at java.lang.reflect.Method.invoke(Unknown Source) ~[?:1.8.0_241]
	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_241]
	at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source) ~[?:1.8.0_241]
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) ~[?:1.8.0_241]
	at java.lang.reflect.Method.invoke(Unknown Source) ~[?:1.8.0_241]
	at net.minecraftforge.gradle.GradleStartCommon.launch(GradleStartCommon.java:97) [start/:?]
	at GradleStart.main(GradleStart.java:25) [start/:?]
Caused by: net.minecraft.client.renderer.block.model.ModelBlockDefinition$MissingVariantException
	at net.minecraft.client.renderer.block.model.ModelBlockDefinition.getVariant(ModelBlockDefinition.java:83) ~[ModelBlockDefinition.class:?]
	at net.minecraftforge.client.model.ModelLoader$VariantLoader.loadModel(ModelLoader.java:1175) ~[ModelLoader$VariantLoader.class:?]
	at net.minecraftforge.client.model.ModelLoaderRegistry.getModel(ModelLoaderRegistry.java:157) ~[ModelLoaderRegistry.class:?]
	... 21 more
[15:12:44] [main/ERROR] [FML]: Exception loading model for variant experimentalmod:ruby_generator#inventory for item "experimentalmod:ruby_generator", normal location exception: 
net.minecraftforge.client.model.ModelLoaderRegistry$LoaderException: Exception loading model experimentalmod:item/ruby_generator with loader VanillaLoader.INSTANCE, skipping
	at net.minecraftforge.client.model.ModelLoaderRegistry.getModel(ModelLoaderRegistry.java:161) ~[ModelLoaderRegistry.class:?]
	at net.minecraftforge.client.model.ModelLoader.loadItemModels(ModelLoader.java:302) ~[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:151) ~[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:121) [SimpleReloadableResourceManager.class:?]
	at net.minecraft.client.Minecraft.init(Minecraft.java:559) [Minecraft.class:?]
	at net.minecraft.client.Minecraft.run(Minecraft.java:421) [Minecraft.class:?]
	at net.minecraft.client.main.Main.main(Main.java:118) [Main.class:?]
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[?:1.8.0_241]
	at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source) ~[?:1.8.0_241]
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) ~[?:1.8.0_241]
	at java.lang.reflect.Method.invoke(Unknown Source) ~[?:1.8.0_241]
	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_241]
	at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source) ~[?:1.8.0_241]
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) ~[?:1.8.0_241]
	at java.lang.reflect.Method.invoke(Unknown Source) ~[?:1.8.0_241]
	at net.minecraftforge.gradle.GradleStartCommon.launch(GradleStartCommon.java:97) [start/:?]
	at GradleStart.main(GradleStart.java:25) [start/:?]
Caused by: java.io.FileNotFoundException: experimentalmod:models/item/ruby_generator.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$1400(ModelLoader.java:115) ~[ModelLoader.class:?]
	at net.minecraftforge.client.model.ModelLoader$VanillaLoader.loadModel(ModelLoader.java:861) ~[ModelLoader$VanillaLoader.class:?]
	at net.minecraftforge.client.model.ModelLoaderRegistry.getModel(ModelLoaderRegistry.java:157) ~[ModelLoaderRegistry.class:?]
	... 20 more
[15:12:44] [main/ERROR] [FML]: Exception loading model for variant experimentalmod:ruby_generator#inventory for item "experimentalmod:ruby_generator", blockstate location exception: 
net.minecraftforge.client.model.ModelLoaderRegistry$LoaderException: Exception loading model experimentalmod:ruby_generator#inventory with loader VariantLoader.INSTANCE, skipping
	at net.minecraftforge.client.model.ModelLoaderRegistry.getModel(ModelLoaderRegistry.java:161) ~[ModelLoaderRegistry.class:?]
	at net.minecraftforge.client.model.ModelLoader.loadItemModels(ModelLoader.java:296) ~[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:151) ~[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:121) [SimpleReloadableResourceManager.class:?]
	at net.minecraft.client.Minecraft.init(Minecraft.java:559) [Minecraft.class:?]
	at net.minecraft.client.Minecraft.run(Minecraft.java:421) [Minecraft.class:?]
	at net.minecraft.client.main.Main.main(Main.java:118) [Main.class:?]
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[?:1.8.0_241]
	at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source) ~[?:1.8.0_241]
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) ~[?:1.8.0_241]
	at java.lang.reflect.Method.invoke(Unknown Source) ~[?:1.8.0_241]
	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_241]
	at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source) ~[?:1.8.0_241]
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) ~[?:1.8.0_241]
	at java.lang.reflect.Method.invoke(Unknown Source) ~[?:1.8.0_241]
	at net.minecraftforge.gradle.GradleStartCommon.launch(GradleStartCommon.java:97) [start/:?]
	at GradleStart.main(GradleStart.java:25) [start/:?]
Caused by: net.minecraft.client.renderer.block.model.ModelBlockDefinition$MissingVariantException
	at net.minecraft.client.renderer.block.model.ModelBlockDefinition.getVariant(ModelBlockDefinition.java:83) ~[ModelBlockDefinition.class:?]
	at net.minecraftforge.client.model.ModelLoader$VariantLoader.loadModel(ModelLoader.java:1175) ~[ModelLoader$VariantLoader.class:?]
	at net.minecraftforge.client.model.ModelLoaderRegistry.getModel(ModelLoaderRegistry.java:157) ~[ModelLoaderRegistry.class:?]
	... 20 more
[15:12:44] [main/FATAL] [FML]: Suppressed additional 4 model loading errors for domain experimentalmod
[15:12:44] [main/INFO] [FML]: Applying holder lookups
[15:12:44] [main/INFO] [FML]: Holder lookups applied
[15:12:45] [main/INFO] [jei]: Created: 256x128 textures-atlas
[15:12:45] [main/INFO] [FML]: Injecting itemstacks
[15:12:45] [main/INFO] [FML]: Itemstack injection complete
[15:12:45] [main/INFO] [jei]: Starting JEI...
[15:12:45] [main/INFO] [jei]: Registering recipe categories...
[15:12:45] [main/INFO] [jei]: Registering recipe categories took 31.12 ms
[15:12:45] [main/INFO] [jei]: Registering mod plugins...
[15:12:45] [main/INFO] [jei]: Registering mod plugins took 216.2 ms
[15:12:45] [main/INFO] [jei]: Building recipe registry...
[15:12:45] [main/INFO] [jei]: Building recipe registry took 114.1 ms
[15:12:45] [main/INFO] [jei]: Building ingredient list...
[15:12:45] [main/INFO] [jei]: Building ingredient list took 83.08 ms
[15:12:45] [main/INFO] [jei]: Building ingredient filter...
[15:12:45] [main/INFO] [jei]: Building ingredient filter took 149.3 ms
[15:12:45] [main/INFO] [jei]: Building bookmarks...
[15:12:45] [main/INFO] [jei]: Building bookmarks took 8.345 ms
[15:12:45] [main/INFO] [jei]: Building runtime...
[15:12:46] [main/INFO] [jei]: Building runtime took 156.9 ms
[15:12:46] [main/INFO] [jei]: Starting JEI took 1.040 s
[15:12:46] [main/INFO] [FML]: Forge Mod Loader has successfully loaded 6 mods
[15:12:46] [main/WARN] [minecraft/GameSettings]: Skipping bad option: lastServer:
[15:12:46] [main/INFO] [mojang/NarratorWindows]: Narrator library for x64 successfully loaded
[15:12:47] [Realms Notification Availability checker #1/INFO] [mojang/RealmsClient]: Could not authorize you against Realms server: Invalid session id
[15:12:48] [Server thread/INFO] [minecraft/IntegratedServer]: Starting integrated minecraft server version 1.12.2
[15:12:48] [Server thread/INFO] [minecraft/IntegratedServer]: Generating keypair
[15:12:49] [Server thread/INFO] [FML]: Injecting existing registry data into this server instance
[15:12:49] [Server thread/INFO] [FML]: Applying holder lookups
[15:12:49] [Server thread/INFO] [FML]: Holder lookups applied
[15:12:49] [Server thread/INFO] [FML]: Loading dimension 0 (New World) (net.minecraft.server.integrated.IntegratedServer@6da5a3a5)
[15:12:50] [Server thread/INFO] [minecraft/AdvancementList]: Loaded 488 advancements
[15:12:50] [Server thread/INFO] [FML]: Loading dimension -1 (New World) (net.minecraft.server.integrated.IntegratedServer@6da5a3a5)
[15:12:50] [Server thread/INFO] [FML]: Loading dimension 1 (New World) (net.minecraft.server.integrated.IntegratedServer@6da5a3a5)
[15:12:50] [Server thread/INFO] [minecraft/MinecraftServer]: Preparing start region for level 0
[15:12:51] [Server thread/INFO] [minecraft/MinecraftServer]: Preparing spawn area: 55%
[15:12:51] [Server thread/INFO] [FML]: Unloading dimension -1
[15:12:51] [Server thread/INFO] [FML]: Unloading dimension 1
[15:12:51] [Server thread/INFO] [minecraft/IntegratedServer]: Changing view distance to 12, from 10
[15:12:52] [Netty Local Client IO #0/INFO] [FML]: Server protocol version 2
[15:12:52] [Netty Server IO #1/INFO] [FML]: Client protocol version 2
[15:12:52] [Netty Server IO #1/INFO] [FML]: Client attempting to join with 6 mods : [email protected],[email protected],[email protected],[email protected],[email protected],[email protected]
[15:12:52] [Netty Local Client IO #0/INFO] [FML]: [Netty Local Client IO #0] Client side modded connection established
[15:12:52] [Server thread/INFO] [FML]: [Server thread] Server side modded connection established
[15:12:52] [Server thread/INFO] [minecraft/PlayerList]: Player217[local:E:a06cb039] logged in with entity id 198 at (130.59074287948133, 64.0, 260.3894459816243)
[15:12:52] [Server thread/INFO] [minecraft/MinecraftServer]: Player217 joined the game
[15:12:54] [Server thread/INFO] [minecraft/IntegratedServer]: Saving and pausing game...
[15:12:54] [Server thread/INFO] [minecraft/MinecraftServer]: Saving chunks for level 'New World'/overworld
[15:12:54] [pool-2-thread-1/WARN] [mojang/YggdrasilMinecraftSessionService]: Couldn't look up profile properties for com.mojang.authlib.GameProfile@6b2706f1[id=54b70f4a-db80-304b-b6ee-afcd086c6623,name=Player217,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:3716) [guava-21.0.jar:?]
	at com.google.common.cache.LocalCache$Segment.loadSync(LocalCache.java:2424) [guava-21.0.jar:?]
	at com.google.common.cache.LocalCache$Segment.lockedGetOrLoad(LocalCache.java:2298) [guava-21.0.jar:?]
	at com.google.common.cache.LocalCache$Segment.get(LocalCache.java:2211) [guava-21.0.jar:?]
	at com.google.common.cache.LocalCache.get(LocalCache.java:4154) [guava-21.0.jar:?]
	at com.google.common.cache.LocalCache.getOrLoad(LocalCache.java:4158) [guava-21.0.jar:?]
	at com.google.common.cache.LocalCache$LocalLoadingCache.get(LocalCache.java:5147) [guava-21.0.jar:?]
	at com.google.common.cache.LocalCache$LocalLoadingCache.getUnchecked(LocalCache.java:5153) [guava-21.0.jar:?]
	at com.mojang.authlib.yggdrasil.YggdrasilMinecraftSessionService.fillProfileProperties(YggdrasilMinecraftSessionService.java:170) [YggdrasilMinecraftSessionService.class:?]
	at net.minecraft.client.Minecraft.getProfileProperties(Minecraft.java:3181) [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_241]
	at java.util.concurrent.FutureTask.run(Unknown Source) [?:1.8.0_241]
	at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source) [?:1.8.0_241]
	at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source) [?:1.8.0_241]
	at java.lang.Thread.run(Unknown Source) [?:1.8.0_241]
[15:12:54] [main/INFO] [minecraft/AdvancementList]: Loaded 44 advancements
[15:12:59] [Server thread/INFO] [STDOUT]: [com.m3rein.experimentalmod.blocks.tileentity.TileEntityRubyGenerator:writeToNBT:124]: Writing tile entity data. Energy=0
[15:12:59] [Server thread/INFO] [STDOUT]: [com.m3rein.experimentalmod.blocks.tileentity.TileEntityRubyGenerator:writeToNBT:124]: Writing tile entity data. Energy=0
[15:13:06] [Server thread/INFO] [minecraft/IntegratedServer]: Saving and pausing game...
[15:13:06] [Server thread/INFO] [minecraft/MinecraftServer]: Saving chunks for level 'New World'/overworld
[15:13:06] [Server thread/INFO] [STDOUT]: [com.m3rein.experimentalmod.blocks.tileentity.TileEntityRubyGenerator:writeToNBT:124]: Writing tile entity data. Energy=4320
[15:13:11] [Server thread/INFO] [minecraft/MinecraftServer]: Stopping server
[15:13:11] [Server thread/INFO] [minecraft/MinecraftServer]: Saving players
[15:13:11] [Server thread/INFO] [minecraft/NetHandlerPlayServer]: Player217 lost connection: Disconnected
[15:13:11] [Server thread/INFO] [minecraft/MinecraftServer]: Player217 left the game
[15:13:11] [Server thread/INFO] [minecraft/NetHandlerPlayServer]: Stopping singleplayer server as player logged out
[15:13:11] [Server thread/INFO] [minecraft/MinecraftServer]: Saving worlds
[15:13:11] [Server thread/INFO] [minecraft/MinecraftServer]: Saving chunks for level 'New World'/overworld
[15:13:11] [Server thread/INFO] [FML]: Unloading dimension 0
[15:13:11] [Server thread/INFO] [FML]: Applying holder lookups
[15:13:11] [Server thread/INFO] [FML]: Holder lookups applied
[15:13:14] [Server thread/INFO] [minecraft/IntegratedServer]: Starting integrated minecraft server version 1.12.2
[15:13:14] [Server thread/INFO] [minecraft/IntegratedServer]: Generating keypair
[15:13:14] [Server thread/INFO] [FML]: Injecting existing registry data into this server instance
[15:13:14] [Server thread/INFO] [FML]: Applying holder lookups
[15:13:14] [Server thread/INFO] [FML]: Holder lookups applied
[15:13:14] [Server thread/INFO] [FML]: Loading dimension 0 (New World) (net.minecraft.server.integrated.IntegratedServer@37d02a20)
[15:13:14] [Server thread/INFO] [minecraft/AdvancementList]: Loaded 488 advancements
[15:13:14] [Server thread/INFO] [FML]: Loading dimension -1 (New World) (net.minecraft.server.integrated.IntegratedServer@37d02a20)
[15:13:14] [Server thread/INFO] [FML]: Loading dimension 1 (New World) (net.minecraft.server.integrated.IntegratedServer@37d02a20)
[15:13:14] [Server thread/INFO] [minecraft/MinecraftServer]: Preparing start region for level 0
[15:13:15] [Server thread/INFO] [STDOUT]: [com.m3rein.experimentalmod.blocks.tileentity.TileEntityRubyGenerator:readFromNBT:112]: Reading tile entity data. Energy=4320
[15:13:15] [Server thread/INFO] [FML]: Unloading dimension -1
[15:13:15] [Server thread/INFO] [FML]: Unloading dimension 1
[15:13:15] [Server thread/INFO] [minecraft/IntegratedServer]: Changing view distance to 12, from 10
[15:13:15] [Netty Local Client IO #1/INFO] [FML]: Server protocol version 2
[15:13:15] [Netty Server IO #3/INFO] [FML]: Client protocol version 2
[15:13:15] [Netty Server IO #3/INFO] [FML]: Client attempting to join with 6 mods : [email protected],[email protected],[email protected],[email protected],[email protected],[email protected]
[15:13:15] [Netty Local Client IO #1/INFO] [FML]: [Netty Local Client IO #1] Client side modded connection established
[15:13:15] [Server thread/INFO] [FML]: [Server thread] Server side modded connection established
[15:13:15] [Server thread/INFO] [minecraft/PlayerList]: Player217[local:E:42a52096] logged in with entity id 3802 at (129.1751563474092, 64.0, 260.8763083908221)
[15:13:15] [Server thread/INFO] [minecraft/MinecraftServer]: Player217 joined the game
[15:13:16] [Server thread/INFO] [minecraft/IntegratedServer]: Saving and pausing game...
[15:13:16] [Server thread/INFO] [minecraft/MinecraftServer]: Saving chunks for level 'New World'/overworld
[15:13:16] [main/INFO] [STDOUT]: [com.m3rein.experimentalmod.blocks.tileentity.TileEntityRubyGenerator:readFromNBT:112]: Reading tile entity data. Energy=0
[15:13:16] [main/INFO] [minecraft/AdvancementList]: Loaded 44 advancements
[15:13:16] [Server thread/INFO] [STDOUT]: [com.m3rein.experimentalmod.blocks.tileentity.TileEntityRubyGenerator:writeToNBT:124]: Writing tile entity data. Energy=4320

 

 

TileEntityRubyGenerator:

Spoiler

package com.m3rein.experimentalmod.blocks.tileentity;

import com.m3rein.experimentalmod.energy.CustomEnergyStorage;
import com.m3rein.experimentalmod.init.ModItems;

import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.item.Item;
import net.minecraft.item.ItemStack;
import net.minecraft.nbt.NBTTagCompound;
import net.minecraft.tileentity.TileEntity;
import net.minecraft.util.EnumFacing;
import net.minecraft.util.ITickable;
import net.minecraft.util.text.ITextComponent;
import net.minecraft.util.text.TextComponentTranslation;
import net.minecraftforge.common.capabilities.Capability;
import net.minecraftforge.energy.CapabilityEnergy;
import net.minecraftforge.items.CapabilityItemHandler;
import net.minecraftforge.items.ItemStackHandler;

public class TileEntityRubyGenerator extends TileEntity implements ITickable
{
	public ItemStackHandler handler = new ItemStackHandler(1);
	private CustomEnergyStorage storage = new CustomEnergyStorage(10000);
	private String customName;
	
	public int burnTime = 0;
	public int burnValue = 0;
	
	@Override
	public void update()
	{
		boolean update = false;
		if (!this.world.isRemote)
		{
			if (isBurning())
			{
				this.burnTime--;
				this.setEnergyStored(this.getEnergyStored() + this.burnValue);
				update = true;
			}
			if (!isBurning())
			{
				if (!handler.getStackInSlot(0).isEmpty() && isItemFuel(handler.getStackInSlot(0)))
				{
					this.burnTime = 30;
					this.burnValue = getEnergyValue(handler.getStackInSlot(0));
					handler.getStackInSlot(0).shrink(1);
					update = true;
				}
				else
				{
					this.burnTime = 0;
					this.burnValue = 0;
					update = true;
				}
			}
		}
		if (update) this.markDirty();
	}
	
	public boolean isBurning()
	{
		return this.burnTime > 0;
	}
	
	public boolean isItemFuel(ItemStack stack)
	{
		return getEnergyValue(stack) > 0;
	}
	
	public int getEnergyValue(ItemStack stack)
	{
		Item item = stack.getItem();
		if (item == ModItems.RUBY) return 2;
		else if (item == ModItems.RUBY_SWORD || item == ModItems.RUBY_HOE) return 4;
		else if (item == ModItems.RUBY_PICKAXE || item == ModItems.RUBY_AXE) return 3;
		else if (item == ModItems.RUBY_SHOVEL) return 2;
		else if (item == ModItems.RUBY_HELMET) return 10;
		else if (item == ModItems.RUBY_CHESTPLATE) return 16;
		else if (item == ModItems.RUBY_LEGGINGS) return 14;
		else if (item == ModItems.RUBY_BOOTS) return 8;
		else if (item == ModItems.RUBY_INFUSED_APPLE) return 16;
		else if (item == ModItems.SUPER_RUBY_INFUSED_APPLE) return 144;
		return 0;
	}
	
	@Override
	public <T> T getCapability(Capability<T> capability, EnumFacing facing) 
	{
		if (capability == CapabilityEnergy.ENERGY) return (T) this.storage;
		if (capability == CapabilityItemHandler.ITEM_HANDLER_CAPABILITY) return (T) this.handler;
		return super.getCapability(capability, facing);
	}
	
	@Override
	public boolean hasCapability(Capability<?> capability, EnumFacing facing) 
	{
		if (capability == CapabilityEnergy.ENERGY) return true;
		if (capability == CapabilityItemHandler.ITEM_HANDLER_CAPABILITY) return true;
		return super.hasCapability(capability, facing);
	}
	
	@Override
	public void readFromNBT(NBTTagCompound compound) 
	{
		super.readFromNBT(compound);
		this.handler.deserializeNBT(compound.getCompoundTag("Inventory"));
		this.burnTime = compound.getInteger("BurnTime");
		this.burnValue = compound.getInteger("BurnValue");
		this.customName = compound.getString("DisplayName");
		this.storage.readFromNBT(compound);
		System.out.println("Reading tile entity data. Energy=" + String.valueOf(this.storage.getEnergyStored()));
	}
	
	@Override
	public NBTTagCompound writeToNBT(NBTTagCompound compound) 
	{
		super.writeToNBT(compound);
		compound.setTag("Inventory", this.handler.serializeNBT());
		compound.setInteger("BurnTime", this.burnTime);
		compound.setInteger("BurnValue", this.burnValue);
		compound.setString("DisplayName", getDisplayName().toString());
		this.storage.writeToNBT(compound);
		System.out.println("Writing tile entity data. Energy=" + String.valueOf(this.storage.getEnergyStored()));
		return compound;
	}
	
	@Override
	public ITextComponent getDisplayName() 
	{
		return new TextComponentTranslation("container.ruby_generator.name");
	}
	
	public int getEnergyStored()
	{
		return this.storage.getEnergyStored();
	}
	
	public void setEnergyStored(int value)
	{
		this.storage.setEnergyStored(value);
	}
	
	public int getMaxEnergyStored()
	{
		return this.storage.getMaxEnergyStored();
	}
	
	public int getField(int id)
	{
		switch(id)
		{
		case 0:
			return this.getEnergyStored();
		case 1:
			return this.burnTime;
		default:
			return 0;
		}
	}
	
	public void setField(int id, int value)
	{
		switch (id)
		{
		case 0:
			this.setEnergyStored(value);
		case 1:
			this.burnTime = value;
		}
	}
	
	public boolean isUsableByPlayer(EntityPlayer player)
	{
		return this.world.getTileEntity(this.pos) != this ? false : player.getDistanceSq((double) this.pos.getX() + 0.5d, (double) this.pos.getY() + 0.5d, (double) this.pos.getZ() + 0.5d) <= 64d;
	}
}

 

 

CustomEnergyStorage:

Spoiler

package com.m3rein.experimentalmod.energy;

import net.minecraft.nbt.NBTTagCompound;
import net.minecraft.util.math.MathHelper;
import net.minecraftforge.energy.EnergyStorage;

public class CustomEnergyStorage extends EnergyStorage
{
	public CustomEnergyStorage()
	{
		super(9);
	}
	
	public CustomEnergyStorage(int capacity)
    {
        super(capacity, capacity, capacity, 0);
    }

    public CustomEnergyStorage(int capacity, int maxTransfer)
    {
        super(capacity, maxTransfer, maxTransfer, 0);
    }

    public CustomEnergyStorage(int capacity, int maxReceive, int maxExtract)
    {
        super(capacity, maxReceive, maxExtract, 0);
    }

    public CustomEnergyStorage(int capacity, int maxReceive, int maxExtract, int energy)
    {
    	super(capacity, maxReceive, maxExtract, energy);
    }
    
    @Override
    public int receiveEnergy(int maxReceive, boolean simulate) 
    {
    	return super.receiveEnergy(maxReceive, simulate);
    }
    
    @Override
    public int getEnergyStored() 
    {
    	return super.getEnergyStored();
    }
    
    public void setEnergyStored(int value)
    {
    	this.energy = MathHelper.clamp(value, 0, this.capacity);
    }
    
    @Override
    public int getMaxEnergyStored() 
    {
    	return super.getMaxEnergyStored();
    }
    
    @Override
    public boolean canExtract() 
    {
    	return super.canExtract();
    }
    
    @Override
    public boolean canReceive() 
    {
    	return super.canReceive();
    }
    
    public void readFromNBT(NBTTagCompound compound)
    {
    	this.energy = compound.getInteger("Energy");
    	this.capacity = compound.getInteger("Capacity");
    	this.maxReceive = compound.getInteger("MaxReceive");
    	this.maxExtract = compound.getInteger("MaxExtract");
    }
    
    public void writeToNBT(NBTTagCompound compound)
    {
    	compound.setInteger("Energy", this.energy);
    	compound.setInteger("Capacity", this.capacity);
    	compound.setInteger("MaxReceive", this.maxReceive);
    	compound.setInteger("MaxExtract", this.maxExtract);
    }    
}

 

 

If relevant, ContainerRubyGenerator:

Spoiler

package com.m3rein.experimentalmod.blocks.container;

import com.m3rein.experimentalmod.blocks.tileentity.TileEntityRubyGenerator;

import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.entity.player.InventoryPlayer;
import net.minecraft.inventory.Container;
import net.minecraft.inventory.IContainerListener;
import net.minecraft.inventory.Slot;
import net.minecraft.item.ItemStack;
import net.minecraftforge.items.CapabilityItemHandler;
import net.minecraftforge.items.IItemHandler;
import net.minecraftforge.items.SlotItemHandler;

public class ContainerRubyGenerator extends Container
{
	private final TileEntityRubyGenerator tileentity;
	private int energy, burnTime;
	
	public ContainerRubyGenerator(InventoryPlayer player, TileEntityRubyGenerator tileentity) 
	{
		this.tileentity = tileentity;
		this.energy = this.tileentity.getEnergyStored();
		this.burnTime = this.tileentity.burnTime;
		IItemHandler handler = tileentity.getCapability(CapabilityItemHandler.ITEM_HANDLER_CAPABILITY, null);
		
		this.addSlotToContainer(new SlotItemHandler(handler, 0, 78, 35));
		
		for (int y = 0; y < 3; y++)
		{
			for (int x = 0; x < 9; x++)
			{
				this.addSlotToContainer(new Slot(player, x + y * 9 + 9, 8 + x * 18, 84 + y * 18));
			}
		}
		
		for (int x = 0; x < 9; x++)
		{
			this.addSlotToContainer(new Slot(player, x, 8 + x * 18, 142));
		}
	}

	@Override
	public boolean canInteractWith(EntityPlayer playerIn) 
	{
		return this.tileentity.isUsableByPlayer(playerIn);
	}
	
	@Override
	public void updateProgressBar(int id, int data) 
	{
		this.tileentity.setField(id, data);
	}
	
	@Override
	public void detectAndSendChanges() 
	{
		super.detectAndSendChanges();
		
		for (int i = 0; i < this.listeners.size(); i++)
		{
			IContainerListener listener = (IContainerListener) this.listeners.get(i);
			if (this.energy != this.tileentity.getEnergyStored()) listener.sendWindowProperty(this, 0, this.tileentity.getField(0));
			if (this.burnTime != this.tileentity.burnTime) listener.sendWindowProperty(this, 1, this.tileentity.getField(1));
		}
		
		this.energy = this.tileentity.getField(0);
		this.burnTime = this.tileentity.getField(1);
	}
	
	@Override
	public ItemStack transferStackInSlot(EntityPlayer playerIn, int index)
	{
		ItemStack stack = ItemStack.EMPTY;
		Slot slot = (Slot) this.inventorySlots.get(index);
		
		if (slot != null && slot.getHasStack())
		{
			ItemStack fuel = slot.getStack();
			stack = fuel.copy();
			
			if (index >= 0 && index < 27)
			{
				if (!this.mergeItemStack(fuel, 27, 36, false)) return ItemStack.EMPTY;
			}
			else if (index >= 27 && index < 36)
			{
				if (!this.mergeItemStack(fuel, 0, 27, false)) return ItemStack.EMPTY;
			}
			else if (!this.mergeItemStack(fuel, 0, 36, false))
			{
				return ItemStack.EMPTY;
			}
			
			if (fuel.isEmpty()) slot.putStack(ItemStack.EMPTY);
			else slot.onSlotChanged();
			
			if (fuel.getCount() == stack.getCount()) return ItemStack.EMPTY;
			slot.onTake(playerIn, fuel);
		}
		return stack;
	}
}

 

 

BlockTileEntity, which is essentially what the block class is of the ruby generator:

Spoiler

package com.m3rein.experimentalmod.blocks;

import java.util.Random;

import com.m3rein.experimentalmod.Main;
import com.m3rein.experimentalmod.blocks.tileentity.TileEntityCulinaryFurnace;
import com.m3rein.experimentalmod.blocks.tileentity.TileEntityRubyGenerator;
import com.m3rein.experimentalmod.init.ModBlocks;
import com.m3rein.experimentalmod.utilities.handlers.ConfigHandler;

import net.minecraft.block.ITileEntityProvider;
import net.minecraft.block.material.Material;
import net.minecraft.block.state.IBlockState;
import net.minecraft.entity.item.EntityItem;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.item.Item;
import net.minecraft.item.ItemStack;
import net.minecraft.tileentity.TileEntity;
import net.minecraft.util.EnumFacing;
import net.minecraft.util.EnumHand;
import net.minecraft.util.math.BlockPos;
import net.minecraft.world.World;

public class BlockTileEntity extends BlockBase implements ITileEntityProvider
{
	public int GUI_ID = 0;
	public Class<TileEntity> teClass;
	
	public BlockTileEntity(String name, Material material, int GUI_ID, Class<? extends TileEntity> teClass)
	{
		super(name, material);
		this.GUI_ID = GUI_ID;
		this.teClass = (Class<TileEntity>) teClass;
	}
	
	@Override
	public Item getItemDropped(IBlockState state, Random rand, int fortune)
	{
		return Item.getItemFromBlock(this);
	}
	
	@Override
	public ItemStack getItem(World worldIn, BlockPos pos, IBlockState state)
	{
		return new ItemStack(this);
	}
	
	@Override
	public boolean onBlockActivated(World worldIn, BlockPos pos, IBlockState state, EntityPlayer playerIn, EnumHand hand, EnumFacing facing, float hitX, float hitY, float hitZ)
	{
		if (!worldIn.isRemote)
		{
			playerIn.openGui(Main.instance, this.GUI_ID, worldIn, pos.getX(), pos.getY(), pos.getZ());
		}
		return true;
	}
	
	@Override
	public TileEntity createNewTileEntity(World worldIn, int meta)
	{
		try
		{
			return teClass.newInstance();
		}
		catch (IllegalAccessException | InstantiationException e)
		{
			System.out.println("Could not create TileEntity object.");
		}
		return null;
	}
}

 

 

If anyone knows what causes this odd behaviour, please let me know. If I've forgotten to share the necessary information to debug this issue, my apologies. I'm quite new to this scene.

Edited by M3rein
Accidentally nested my spoilers.
Posted

1.12 is no longer supported on this forum.

Please update to a modern version of Minecraft to receive support.

This is my Forum Signature, I am currently attempting to transform it into a small guide for fixing easier issues using spoiler blocks to keep things tidy.

 

As the most common issue I feel I should put this outside the main bulk:

The only official source for Forge is https://files.minecraftforge.net, and the only site I trust for getting mods is CurseForge.

If you use any site other than these, please take a look at the StopModReposts project and install their browser extension, I would also advise running a virus scan.

 

For players asking for assistance with Forge please expand the spoiler below and read the appropriate section(s) in its/their entirety.

Spoiler

Logs (Most issues require logs to diagnose):

Spoiler

Please post logs using one of the following sites (Thank you Lumber Wizard for the list):

https://gist.github.com/100MB Requires member (Free)

https://pastebin.com/: 512KB as guest, 10MB as Pro ($$$)

https://hastebin.com/: 400KB

Do NOT use sites like Mediafire, Dropbox, OneDrive, Google Drive, or a site that has a countdown before offering downloads.

 

What to provide:

...for Crashes and Runtime issues:

Minecraft 1.14.4 and newer:

Post debug.log

Older versions:

Please update...

 

...for Installer Issues:

Post your installer log, found in the same place you ran the installer

This log will be called either installer.log or named the same as the installer but with .log on the end

Note for Windows users:

Windows hides file extensions by default so the installer may appear without the .jar extension then when the .log is added the log will appear with the .jar extension

 

Where to get it:

Mojang Launcher: When using the Mojang launcher debug.log is found in .minecraft\logs.

 

Curse/Overwolf: If you are using the Curse Launcher, their configurations break Forge's log settings, fortunately there is an easier workaround than I originally thought, this works even with Curse's installation of the Minecraft launcher as long as it is not launched THROUGH Twitch:

Spoiler
  1. Make sure you have the correct version of Forge installed (some packs are heavily dependent on one specific build of Forge)
  2. Make a launcher profile targeting this version of Forge.
  3. Set the launcher profile's GameDir property to the pack's instance folder (not the instances folder, the folder that has the pack's name on it).
  4. Now launch the pack through that profile and follow the "Mojang Launcher" instructions above.

Video:

Spoiler

 

 

 

or alternately, 

 

Fallback ("No logs are generated"):

If you don't see logs generated in the usual place, provide the launcher_log.txt from .minecraft

 

Server Not Starting:

Spoiler

If your server does not start or a command window appears and immediately goes away, run the jar manually and provide the output.

 

Reporting Illegal/Inappropriate Adfocus Ads:

Spoiler

Get a screenshot of the URL bar or copy/paste the whole URL into a thread on the General Discussion board with a description of the Ad.

Lex will need the Ad ID contained in that URL to report it to Adfocus' support team.

 

Posting your mod as a GitHub Repo:

Spoiler

When you have an issue with your mod the most helpful thing you can do when asking for help is to provide your code to those helping you. The most convenient way to do this is via GitHub or another source control hub.

When setting up a GitHub Repo it might seem easy to just upload everything, however this method has the potential for mistakes that could lead to trouble later on, it is recommended to use a Git client or to get comfortable with the Git command line. The following instructions will use the Git Command Line and as such they assume you already have it installed and that you have created a repository.

 

  1. Open a command prompt (CMD, Powershell, Terminal, etc).
  2. Navigate to the folder you extracted Forge’s MDK to (the one that had all the licenses in).
  3. Run the following commands:
    1. git init
    2. git remote add origin [Your Repository's URL]
      • In the case of GitHub it should look like: https://GitHub.com/[Your Username]/[Repo Name].git
    3. git fetch
    4. git checkout --track origin/master
    5. git stage *
    6. git commit -m "[Your commit message]"
    7. git push
  4. Navigate to GitHub and you should now see most of the files.
    • note that it is intentional that some are not synced with GitHub and this is done with the (hidden) .gitignore file that Forge’s MDK has provided (hence the strictness on which folder git init is run from)
  5. Now you can share your GitHub link with those who you are asking for help.

[Workaround line, please ignore]

 

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.