Artisan Worktables 1.12

Artisan Worktables 1.12

3M Downloads

Unable to craft item when recipe is put in by another player

ChiriVulpes opened this issue ยท 7 comments

commented

Issue Description

This issue does not happen 100% of the time (I can reproduce it about every second attempt), and it may be related to who the first player in the server is: this last time I've reproduced I can only reproduce from the second player, and not the first.

What Happens

Player 1 opens the GUI and puts in a valid recipe. Player 2 opens the GUI and attempts to complete the recipe by pulling out the result item. The result item is a ghost item if shift-clicked, and immediately resets if it is picked up with left click.

Here is a video demonstration: https://puu.sh/zqsr7/05d8e317e4.mp4

Script

import mods.artisanworktables.Worktable;

Worktable.createRecipeBuilder("basic")
	.setShapeless([<minecraft:stick>])
	.addTool(<ore:carpenters_handsaw>, 1)
	.addOutput(<minecraft:diamond>)
	.create();

Happens with any recipe in any worktable, with any number of ingredients. I have not tested with workstations or workshops.

Affected Versions

  • Minecraft: 1.12.2
  • Forge: 14.23.2.2618
  • CraftTweaker: 1.12-4.1.4
  • Artisan Worktables: 1.12.2-1.15.23
  • Athenaeum: 1.12.2-1.9.5

(I also had JEI and JEI Integration installed)

commented

When playerA places a stick in the crafting grid, the recipe result slot for playerA is correctly updated on the server, but is not correctly updated for playerB as indicated by:

[11:24:08] [Server thread/INFO] [STDOUT]: [com.codetaylor.mc.artisanworktables.modules.worktables.gui.Container:detectAndSendChanges:671]: Player: EntityPlayerMP['Player896'/15969, l='world', x=9.94, y=78.00, z=109.54], Stack:1xitem.diamond@0
[11:24:08] [Server thread/INFO] [STDOUT]: [com.codetaylor.mc.artisanworktables.modules.worktables.gui.Container:detectAndSendChanges:671]: Player: EntityPlayerMP['Player372'/16153, l='world', x=12.10, y=78.00, z=107.90], Stack:1xtile.air@0

Container#updateRecipeOutput is only being triggered for one player on the server. Why?

It looks like a change to the underlying, wrapped IItemHandler does not trigger a call to the wrapping slot's onSlotChanged method. Only direct interaction by the player will trigger this, which in turn triggers the invocation of Container#updateRecipeOutput.

commented

Fixed in 1.12.2-1.15.25

commented

In your test, which mode was each player in? I assume creative, but I can't be sure. Just because I don't see it, doesn't mean it's not there.

commented

Also, correct me if I'm wrong, I'm assuming dedicated server?

How close to world origin, or initial spawn, were you?

commented

Dedicated server, at spawn (I spawned in and placed a table down right there, I can check exact coords if you need), both players were in creative. I reproduced previously with both players in survival, so I don't think that matters. I see you repro'd tho

commented

Yeah. I set it up exactly as you did in your video and used your script and it happened right away. Now the fun part. -.-

commented

I'm going to take some notes here.

  • The player that puts the stick in the grid can 100% always take out the diamond.
  • If playerA places a stick in the grid while playerB has the GUI open, playerA can 100% always remove the diamond, but playerB can't remove the diamond most of the time. Rarely playerB can remove the diamond.
  • If playerA places a stick in the grid while playerB has the GUI open, playerA can 100% always remove the diamond, but playerB can remove the diamond 100% of the time if playerB closes and re-opens the GUI.
  • If playerA places a stick in the grid and playerB opens the GUI after, playerA can 100% always remove the diamond and playerB can 100% always remove the diamond.
  • If playerA places a stick in the grid, playerB removes the stick and replaces the stick, playerB can 100% always remove the diamond.
  • If playerA places a stick in the grid, playerB removes the tool and replaces the tool, playerB can 100% always remove the diamond.

The above is always true if the roles of playerA and playerB are swapped, ie. playerB places the stick first.