PneumaticCraft: Repressurized

PneumaticCraft: Repressurized

43M Downloads

Ability for drones to interact with item frames

johalun opened this issue ยท 1 comments

commented

Describe the feature

As discussed on Discord, drones can not currently interact with item frame entities and it would be great to have this feature. For example

  • put item in item frame
  • take out item from item frame
  • rotate item in item frame

Reasons why it should be considered

Drones can already interact with other kinds of (living?) entities, it makes sense to extend this to non-living entities (item frames).

Additional details

No response

commented

Something a little more generic could have wider applications:

  • Left Click Entity (with sneak toggle) - left clicks an entity
  • Right Click Entity (with sneak toggle) - this already exists for living entities, but the sneak toggle is new
  • Condition: Entity Inventory - Takes an Area and optional Item Filters. Without item filters, simply returns true if the entity has an inventory component, false otherwise. With item filters, returns true if the entity has an inventory component and those items specified by flters exist inside it. Item filters to the left are blacklist, to the right are whitelist. Has associated common config option (false by default) to allow checking player entity inventories.

I know I'm making an assumption that an item frame has some magic "inventory component", but if it doesn't, it may still be possible to fake with the facade pattern which I think is fairly safe to do for item frames as they're a vanilla item. It would also be convenient if the behavior of the Universal Sensor in comparator mode gets a special-case treatment for a block which has an attached item frame, otherwise can just place an actual comparator and read that.

With this, a drone would now be capable of facilitating interacting with item frames:

  • Use Condition: Entity Inventory without item filters or a Universal Sensor in Comparator mode with a zero equality check to check if the item frame contains an item.
  • Use Left Click Entity while the drone has an item equipped on an empty item frame to place the item the drone is carrying into the item frame.
  • Use Left Click Entity on an item frame that is displaying an item to take the item out of the frame (using the vanilla default behavior, so a 'pick up item' piece will be needed to actually retrieve the item)
  • Use Right Click Entity on an item frame that is displaying an item to rotate the item.
  • Use the Universal Sensor along with a Block Tracker Upgrade in Comparator Mode set to monitor the block position the item frame is attached to, to measure the comparator level of the item frame, which allows you to get its current rotation remotely, which you can store in a variable to be read by programs.

But, in addition to item frames, we can now do things like monitor the fuel level of a furnace minecart and stock it when necessary purely with drones.