PneumaticCraft: Repressurized

PneumaticCraft: Repressurized

50M Downloads

Milking Drone Crash

Nachtflame opened this issue ยท 6 comments

commented

Minecraft Version

1.12.2

Forge Version

forge-14.23.3.2676

Mod Version

0.6.7-210

Describe your problem, including steps to reproduce it

Drone attempting to milk a cow (with more than one bucket), attempts to return the milk bucket to 'slot 40', causing crash. Occurs in both Single-player and on Server.

Any other comments?

crash-2018-07-01_14.36.46-server.txt

commented

Seems like the issues comes only when you have a stack of buckets that the drone has picked up instead of just 1. If you force it to only grab 1 bucket it will work without crashing but that is not how every person might do it or want to do it.

commented

This would likely be caused by the attempt to split the stack into the filled & empty buckets, but of course drones only have 1 inventory slot by default. Have you tried this with a drone with a dispenser upgrade added?

Best fix is probably just to prevent the bucket being used if there's no room in the inv to move it to. Alternatively, the filled bucket could be dropped on the ground.

I'll do some testing with this anyway.

commented

Yea my first attempt was a drone with 5 dispenser upgrades (thinking it could milk 5 times since milk buckets don't stack), which crashed the server I was playing on. Went to single player and got the same crash, and when using a drone with a full stack of dispenser upgrades it didn't crash but it still failed to work with multiple buckets.

commented

OK, this is fixed in dev now. If the drone doesn't have room in its inventory (which will be the case if it has multiple buckets and no dispenser upgrades), it'll milk the cow, and drop the milk bucket. So you can end up with a bunch of milk buckets on the ground, but I think this is reasonable behaviour. Your options are:

  • Enough Dispenser upgrades to match the number of empty buckets the drone has
  • Limit the number of buckets imported by the drone
  • Let milk buckets get dropped, and collect them some other way (another drone or maybe some kind of ender hopper - several mods add those)
commented

Ah, slot 40 is the player's offhand slot. Drones don't have an offhand slot (hey, drones don't even have hands).

Should be easy enough to fix by overriding InventoryPlayer#storeItemStack in EntityDrone$InventoryFakePlayer to not ever try the offhand slot.

commented

Fixed in 0.7.0 release