PneumaticCraft: Repressurized

PneumaticCraft: Repressurized

50M Downloads

Right click block drone action does not filter blocks correctly

JoJoDeveloping opened this issue ยท 3 comments

commented

Minecraft Version

1.16.5

Forge Version

36.0.14

Mod Version

1.16.5-2.6.5-CUSTOM (I am using DW20's 1.16 pack)

Describe your problem, including steps to reproduce it

I wanted to have a drone right-click certain blocks (with a hoe)
However, when I attempt to filter the drone to only right-click certain blocks (name dirt, grass), it does not work - the drone will not click any block at all. Similarly, if I attempt to blacklist farmland, the drone will still right-click farmland.

This program, for example, has a drone that refuses to click anywhere in the area, which did indeed contain a grass block: https://pastebin.com/wvE6Wt6n

Debugging is not helpful:
2021-02-10_21 58 52

commented

In "click item" mode, the filter is for the drone's held item, not the block being interacted with.

Unfortunately there's no solution to this problem, other than to ensure the blocks in the area being interacted with are all what you expect it to be. Sorry.

commented

In this case, the bug still persists, but is with the documentation - the manual explicitly states that the filter is for the block and the item used is the first item in the inventory:
2021-02-11_13 44 55

Anyway, we can also turn this into a feature request: Add a mode to the "right-click block" action that is default disabled, and when enabled creates an additional filter slot for the block

commented

I'll get the docs updated.

TBH the best way to handle this is really two separate progwidgets: one for right-click-item (taking two filters: the held item, and the interacted block), and one for right-click-block (taking just one filter: the interacted block). Progwidgets can't be recconfigured on the fly to change their textures or parameter definitions; they're registry items, initialised on startup.

I'll look at the feasibilty of a separate progwidget for the next major release. It'll also need some fixup code so older programs still work - possibly the most stable solution is to keep the old progwidget and mark it as "deprecated", and add two new progwidgets.