NullPointer Error when AE2 Autocrafting

Found a bug? Post it here. NOTE - Please post script-specific questions in the scripting help.

NullPointer Error when AE2 Autocrafting

Postby MissPotatoGaming » Wed Oct 01, 2014 4:30 am

Seeing as it's kinda late, I'm going to keep this short, simple, and to the point. Sorry about that.

When a script is using the ".reuse()" and other syntax that do same general ideas AE2 spews out a Null Pointer expectation. My assumption is that it tries to dump the items into the "players" inventory. Even though the player is technically a clump of over-done machine blocks with no place to stare said items. Other mods that use this idea as "returning items" have no problem doing so. An example of which would be blood magic's Lava Crystals.

This error has been placed on the AE2 Github but it seems like most others agree it roots from MT3.

: [Select all] [/] [] ()
[23:39:14] [Server thread/ERROR] [AE2:S]: Error: java.util.concurrent.ExecutionException : java.lang.RuntimeException: java.lang.NullPointerException
java.util.concurrent.ExecutionException: java.lang.RuntimeException: java.lang.NullPointerException
at java.util.concurrent.FutureTask.report(Unknown Source)
at java.util.concurrent.FutureTask.get(Unknown Source)
at appeng.container.implementations.ContainerCraftConfirm.func_75142_b(ContainerCraftConfirm.java:178)
at net.minecraft.entity.player.EntityPlayerMP.func_70071_h_(EntityPlayerMP.java:212)
at net.minecraft.world.World.func_72866_a(World.java:2043)
at net.minecraft.world.WorldServer.func_72866_a(WorldServer.java:648)
at net.minecraft.world.World.func_72870_g(World.java:2007)
at net.minecraft.world.World.func_72939_s(World.java:1860)
at net.minecraft.world.WorldServer.func_72939_s(WorldServer.java:489)
at net.minecraft.server.MinecraftServer.func_71190_q(MinecraftServer.java:636)
at net.minecraft.server.MinecraftServer.func_71217_p(MinecraftServer.java:547)
at net.minecraft.server.integrated.IntegratedServer.func_71217_p(IntegratedServer.java:111)
at net.minecraft.server.MinecraftServer.run(MinecraftServer.java:427)
at net.minecraft.server.MinecraftServer$2.run(MinecraftServer.java:685)
Caused by: java.lang.RuntimeException: java.lang.NullPointerException
at appeng.crafting.CraftingJob.run(CraftingJob.java:218)
at java.util.concurrent.Executors$RunnableAdapter.call(Unknown Source)
at java.util.concurrent.FutureTask.run(Unknown Source)
at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
at java.lang.Thread.run(Unknown Source)
Caused by: java.lang.NullPointerException
at appeng.util.Platform.getPlayer(Platform.java:915)
at appeng.crafting.CraftingTreeProcess.request(CraftingTreeProcess.java:192)
at appeng.crafting.CraftingTreeNode.request(CraftingTreeNode.java:177)
at appeng.crafting.CraftingJob.run(CraftingJob.java:150)
... 5 more]
GeSHi © Codebox Plus



And as for the script here is a shortened version that only shows the effected errors.

: [Select all] [/] [] ()
//var
val pressCalculation = <appliedenergistics2:item.ItemMultiMaterial:13>;
//Make the Pressed Raw Material.
recipes.addShaped(circuitCalculation * 1, [[null, <minecraft:piston>.reuse(), null], [null, pureCertus, null], [null, pressCalculation.reuse(), null]]);
GeSHi © Codebox Plus


Once again, sorry if this comes off rude, I wanted to get this out before I went to sleep. Have a good night/day!
MissPotatoGaming
 

Re: NullPointer Error when AE2 Autocrafting

Postby MissPotatoGaming » Wed Oct 01, 2014 4:34 am

Silly me, probably would help if I'd given you the versions of the mods I'm using. And the steps to do so. I would of just edited the last post, but didn't see it.

Minecraft: v1.7.10
MineTweak: v3.0.2B
Applied Energistics 2: vRV1.stable.1

Set up a simple AE2 crafting system.
Set up a pattern to autocraft a recipe with .reuse() as one of the items.
Attempt to craft.
Get error in chat, and in console.
MissPotatoGaming
 

Re: NullPointer Error when AE2 Autocrafting

Postby MissPotatoGaming » Wed Oct 01, 2014 4:40 am

Sorry, I really need to not do this when I'm tired. The MnieTwaker version is 3.0.8B! I made an account now too, so that should solve my future derps.
MissPotatoGaming
 
Posts: 2
Joined: Wed Oct 01, 2014 4:37 am

Re: NullPointer Error when AE2 Autocrafting

Postby zangetsu_MG » Tue Dec 02, 2014 7:27 am

I had the same problem and Googe gave me this thread as the top result. I too dislike the AE2 Inscribers and was attempting to add a similar recipe.

My best guess is that when AE2 tries to show the confirm craft dialog, it runs through all the patterns needed to complete the task. When it gets to the pattern encoded with a .reuse() recipe something goes wrong because AE2 isn't a player so the reused item can't go into the players inventory, and AE2 doesn't really have a crafting table inventory to put the item back into either, so when AE2 looks for an inventory to put the .reuse item into, it the find inventory code returns a null, then boom NullPointerException.

Technical Shizzle Wizzle Useless investigative tale here.

And Four hours later:

It's an AE bug. In appeng.util.Platform.openGUI it can call EntityPlayer.openGui by passing in the world object from tile. this getWorldObj() code falls all the back to this code in codechicken.multipart.TMultipart:

var tile:TileMultipart = _
def world = if(tile == null) null else tile.getWorldObj

since CableBusPart never sets the tile defined in TMultipart, a call to CableBustPart.getWorldObj returns null. Then much much later on appeng.util.Platform.GetPlayer throws NullPointerException. Because the world parameter is null.

So either CableBusPart needs to implement tile(), getWorldObj() or appeng.util.Platform.openGui needs to change to not get the world from the tile and always get the world from the player, because come on, why would you want to open a gui in any world aside from the one with the player?

I'm thinking that something about MineTweaker's code for .reuse() eventuallly causes a call to appeng.util.Platform.GetPlayer, but I didn't study MineTweaker that closely, as the trail of breadcrumbs never lead me there.

Good luck convincing the AE2 devs of this.
zangetsu_MG
 

Re: NullPointer Error when AE2 Autocrafting

Postby Stan » Tue Dec 02, 2014 8:05 am

Ah, haven't gotten into this issue for a long time. MineTweaker does indeed try to retrieve the player before it uses recipes with transformations, so that would explain why this bug gets triggered in that occasion.
User avatar
Stan
Site Admin
 
Posts: 258
Joined: Fri Jul 11, 2014 9:04 pm

Re: NullPointer Error when AE2 Autocrafting

Postby Zangetsu_MG » Tue Dec 02, 2014 8:30 pm

Well if you can fix it without nagging AE2, that would be cool, but really it should be allright for MT to interact with the players because AE2 specifically (attempts to) provide a fake player. If that were working MT wouldn't have any trouble.
Zangetsu_MG
 

Re: NullPointer Error when AE2 Autocrafting

Postby sycokawody » Fri Nov 29, 2019 10:17 am

thanks
This is the script that is written in the java form and it has a lot of different programs to show. In spite of different uses write my thesis paper so that you can develop the sense of different options to present the further updates.
sycokawody
 
Posts: 1
Joined: Fri Nov 29, 2019 10:15 am


Return to Issues and bugs

Who is online

Users browsing this forum: No registered users and 1 guest