LittleTiles

LittleTiles

12M Downloads

Light Structure Problem

TheBlueCrystal opened this issue ยท 12 comments

commented

Hello,
I'm sorry to have to bother you again.
I tried to create a lightsource in LT and failed catastrophically.
What I tried to do is:

  • created a LT block in world.
  • created a little blueprint from this block
  • set it to structure-type light, level 15, rightclickable
  • tried to place this blueprint in world

it said that there are not enough ingredients - and wanted 1 glowstone-dust.
I have a stack of glowstone dust in my inventory (the little bag does not allow me to add items, only blocks).
I also tried holding the glowstone dust offhand.
I also tried in creative mode, where the blueprint places the block sucessfully, but the structure does not emit any light.
I finally tried to add some glowstone blocks to the little bag, which (expectingly) also didn't workt.

What am I doing wrong here? Or is there some problem with the taking of the ingredients?

Little-Tiles Version: LittleTiles_v1.5.30_mc1.12.2.jar
Forge-Version: forge-1.12.2-14.23.5.2855

Thank you very much in advance for your time!

commented

Test it myself and it worked just fine in survival. There were some issues with ingredients, but these should be fixed in 1.5.30. Not sure if you are on a server (that make be the difference). Anyway I fixed a thing related to the ingredients. Maybe try out the newest version.

I will close this issue for now, because it worked fine for me. If the issue still persists just reply here and I will reopen it.

commented

It needs to be in your inventory, it worked just fine for me. Are you in singleplayer or server?

commented

Hello CreativeMD,
thank you for the update!

I've tried version 1.5.31, but I'm sorry, the problem with not taking the glowstone dust in survival mode still persists.
I've tried in different ways - having Glowstone dust in my inventory, tried to "give" the glowstone to the littlebag, holding the glowstonedust offhand, next to the little recipe, also tried to craft the little recipe in the little workbench - there it also says that there is 1 glowstonedust missing. If I may ask - where is the glowstone dust supposed to be supplied? Any tutorials I found for light-structures are using creative mode, where it doesn't care about supplies.

commented

I'm in singleplayer, playing my own (private) modpack with actually 535 mods in it. (I can give you the list if you want to look through it). I have a few mods under suspicion to may be interfering. I'll try to test without these mods. If you say, it works for you, I have at least the confidence and hope to being able to track that down.

Thank you allready for your time!

commented

Hello CreativeMD,

I've tracked down the problem in the meanwhile - at least to the root cause. The problem is, that the glowstone dust in game is not the original item from minecraft. The LittleStructureRegistry registers the LightScrutureType with an ItemStack of the original item from minecraft while in PreInitialization event. Later on some mod (I suspect Quark to be the culprit here) replaces the original Minecraft item with an advanced one that also can be placed in world like redstone. When the LittleIngredients Class tries to "take" the glowstone from the inventory, it compares it's cached ItemStack against the inventory stacks and does not "see" the glowstone stacks in there becaus the originally created ItemStack still contains the original minecraft glowstone dust item, and this does not macht the actual item in game.

I've tried to write an updated ItemStack of the glowstone dust item in game into the LittleStructureRule of the LightStructure and it works like a charm.

Would it perhaps be possible to move the initialization of the LittleStructureRegistry into the PostInizialisation event? At that time the final item should allready be in place and can be found at "minecraft:glowstone_dust" resource location.

Thank you very much in advance!

commented

Can you try out if the newest version of LittleTiles fixes your issue?

commented

Thank you very much! I will try the newest version and let you know, if it works. (Albeit this may take some time, Minecraft takes about 1 hour and 8 minutes to start up with the 535 Mods-pack :) )

commented

The question is does the mod replace the item in Items.GLOWSTONE_DUST? If yes I could just use a supplier instead.

commented

Yes, it does. The item that is initially created by Minecraft and the item that is used later in game (and is referenced by Items.GLOWSTONE_DUST) differ.

commented

Hello,
I've just tested the latest version and the new just-in-time-getter-methods work perfectly!
Thank you very much again!

But ... sadly there arose another problem: (I can open another issue for it, if you prefer).

If you try to put any block from player-inventory into the LittleBag (using it's GUI), the block "disappears" (is not visible in the LittleBag grid) and the client throws a NPE:

[12:52:39] [Client thread/ERROR] [EventApi]: Catching java.lang.reflect.InvocationTargetException: null at sun.reflect.GeneratedMethodAccessor180.invoke(Unknown Source) ~[?:?] at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[?:1.8.0_202] at java.lang.reflect.Method.invoke(Method.java:498) ~[?:1.8.0_202] at com.n247s.api.eventapi.eventsystem.EventApiCallHandler.callEventMethod(EventApiCallHandler.java:291) ~[EventApiCal> at com.n247s.api.eventapi.eventsystem.EventApiCallHandler.CallInstancesInOrder(EventApiCallHandler.java:82) [EventApi> at com.n247s.api.eventapi.eventsystem.EventApiCallHandler.CallInstances(EventApiCallHandler.java:35) [EventApiCallHan> at com.creativemd.creativecore.common.event.CreativeCoreCallHandler.CallInstances(CreativeCoreCallHandler.java:17) [C> at com.creativemd.creativecore.common.event.CreativeCoreEventBus.raiseEvent(CreativeCoreEventBus.java:59) [CreativeCo> at com.creativemd.creativecore.common.gui.container.SubContainer.raiseEvent(SubContainer.java:95) [SubContainer.class> at com.creativemd.creativecore.common.gui.CoreControl.raiseEvent(CoreControl.java:76) [CoreControl.class:?] at com.creativemd.creativecore.common.gui.controls.container.SlotControl.onPacketReceive(SlotControl.java:86) [SlotCo> at com.creativemd.creativecore.common.gui.ContainerControl.receivePacket(ContainerControl.java:41) [ContainerControl.> at com.creativemd.creativecore.common.packet.gui.ContainerControlUpdatePacket.executeClient(ContainerControlUpdatePac> at com.creativemd.creativecore.common.packet.PacketReciever$1.run(PacketReciever.java:86) [PacketReciever$1.class:?] at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511) [?:1.8.0_202] at java.util.concurrent.FutureTask.run(FutureTask.java:266) [?:1.8.0_202] at net.minecraft.util.Util.runTask(Util.java:529) [h.class:?] at net.minecraft.client.Minecraft.runGameLoop(Minecraft.java:1088) [bib.class:?] at net.minecraft.client.Minecraft.run(Minecraft.java:3942) [bib.class:?] at net.minecraft.client.main.Main.main(SourceFile:123) [Main.class:?] at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[?:1.8.0_202] at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) ~[?:1.8.0_202] at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[?:1.8.0_202] at java.lang.reflect.Method.invoke(Method.java:498) ~[?:1.8.0_202] 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:?] Caused by: java.lang.NullPointerException at com.creativemd.littletiles.common.util.ingredient.LittleInventory.give(LittleInventory.java:311) ~[LittleInventory> at com.creativemd.littletiles.common.container.SubContainerBag.onSlotChange(SubContainerBag.java:115) ~[SubContainerB> ... 26 more
I've took a brief look into the code (it's the part that you added in the fix for the LittleBag-ingredients
(commit 804cc56)).

You added a call to inventory.give() with overflow as an argument in com/creativemd/littletiles/common/container/SubContainerBag.java. However this argument can be null (as of the if-statement in line 108). The give() method does not check it's argument for being null before use, and the try-catch clause only catches a NotEnoughSpaceException.

Can you please have a look? - Thank you very, very much in advance!

(Since the add() call is executed before the exception is thrown, the bag content is okay (and shown correctly after closing and reopening the bag-GUI) - so it's not a show-stopper, just an "annoyance" :) )

commented

You are about to solve the problems on your own! Glad to hear that the first problem is fixed, the second one should be fixed in the newest pre-release. Thank you very much for reporting this issue and furthermore helping out to get it fixed. Hope things will work from here on.

commented

Thank you very much! :)