Plethora Peripherals

Plethora Peripherals

3M Downloads

consume() called on manipulator with bound introspection module sometimes errors.

Wojbie opened this issue ยท 5 comments

commented

I have noticed that in some cases (was not able to determine exact cause for this but i think it might be related to death or teleportation) when user tried to call consume on slot in inventory using bound introspection module in manipulator it errors with this message:
obraz
All other methods work correctly and transfer items around to and from inventory, only consume seems to be broken and it persist on quit/reconnect. Only way to fix this i found was removing and re-placing introspection module onto manipulator.

EDIT: Some additional testing leads me to believe that indeed teleprting might is one of ways to trigger this issue.

EDIT2: I have did some more testing and it regullary triggers when i come back after not playing for some time. Considering that it is in offline chunkloaded chunk my current guess is that its caused by manipulator and bound introspection module getting loaded after server restart without bound player on server.

commented

Re #89, you think that everybody running into #85 was running into this instead?

commented

I think those are 2 separate issues? They might be related code wise but one involves item movement and other involves just .consume failing.

commented

val player = fromContext(context, PlayerEntity::class.java) ?:
throw IllegalArgumentException("No player associated with inventory")

I have a hunch that this needs to subtarget an EntityIdentifier instead, much like getPlayerContext does for getInventory itself:

EntityIdentifier.Player player = fromSubtarget(ctx.context, EntityIdentifier.Player.class);
if (player == null) throw new LuaException("Must be run on a player");

But would need to be able to consistently reproduce it to know for sure if that's the problem

commented

But would need to be able to consistently reproduce it to know for sure if that's the problem

I knew i was forgetting something sorry! I could swear i posted reproduction steps.

Reproduction steps on singleplayer:

  1. bind introspection module and place it in manipulator.
  2. place computer next to it in world.
  3. quit world
  4. rejoin world
  5. run
man = peripheral.find("manipulator")
inv = man.getInventory()
inv.consume(1)

obraz

commented

Reproduction steps for this issue no longer seem to cause it? It is possible some changes in source code has fixed this issue?

EDIT: No this issue still happened on multiplayer. It does not show up as Java Exception anymore tho.
obraz
obraz