BetterNether

BetterNether

30M Downloads

[Bug] Villagers cant use BetterNether Barrels as Jobsite

xanthian opened this issue · 8 comments

commented

What happened?

As title suggests.

BetterNether

7.0.6

BCLib

2.0.16

Fabric API

0.57.0

Fabric Loader

0.14.8

Minecraft

1.19

Relevant log output

n/a

Other Mods

n/a
commented

Will be fixed in the next BetterNether version

commented

Should be available now in 7.0.7

commented

Awesome!

I'm going to come clean, I raised this as I'm stuck trying to fix my POI mixin after updating mod to 1.19, interested to see how you did it.
Too confusing to work out though lol

Interestingly, with your mod installed, it works with any barrel from any mod as long as they have the appropriate tag.

commented

Yes, as long as a Block has the c:barrel or c:workstation/fishermen tag, it will be included.

The BCLib solution can register a Block-Tag for a POI, and when the world is loaded it will read which Blocks are assigned to that tag and all BlockStates for those Blocks to the PoiType.

You can use BCLib as a dependency and add other Tags for other POI-Types as well. ;)

commented

As easy as it would be to sort my solution, I don't really like to require additional dependencies with my mods :)

thank you for the explanation.

commented

Understandable. In that case have a look at this:
https://github.com/quiqueck/BCLib/blob/dcdaf4838d46905044624a73672edf6b5bbf741a/src/main/java/org/betterx/bclib/mixin/common/PoiTypeMixin.java#L21-L25
This part overrides the test for the POI-Object itself. In our case we test the BlockState against a Tag.

That however will not suffice, you also need to add the additional BlockStates to Map the game maintains to speed up the look up (after all that test is done whenever any BlockState in the game changes. This is done here:
https://github.com/quiqueck/BCLib/blob/dcdaf4838d46905044624a73672edf6b5bbf741a/src/main/java/org/betterx/bclib/api/v2/poi/PoiManager.java#L60-L84

We call this method after the world and it's DataPacks get loaded (since we rely on Tags). That is why we create a copy of the original state and restore it for every new world we load. But (if you do not depend on Tags) you can simply add your states to that List at any point after the game die initialise the vanilla Poi-Types.

If you do this before a world is loaded, it should also be compatible with BCLib, otherwise there may be conflicts.

commented

Hi, Using 7.0.9 it seems there is another mod breaking the barrel poi.
Composters work fine.

Sorry this is a bit of working out..

Other mods installed that have barrels :
Better Nether (dont work) - Mixin
Blockus (dont work) - No support
Charm (work) - Uses Access Widener to implement (https://github.com/svenhjol/Charm)
Compact Storage (work) - Uses Access Widener to implement (witchica/compact-storage@a442001)
Minekea (dont work) - No support
Reinforced Barrels (work) - Uses Mixin (Aton-Kish/reinforced-barrels@fea6527)
Variant Barrels (dont work) - No support

Removed Reinforced Barrels
Better Nether (work)
Blockus (work)
Charm (work)
Compact Storage (work)
Minekea (dont work)
Variant Barrels (work)

Removed Compact Storage
Better Nether (dont work)
Blockus (dont work)
Charm (work)
Minekea (dont work)
Reinforced Barrels (work)
Variant Barrels (dont work)

I suspect the issue based on this is Reinforced Barrels.

commented

issue resolved by reinforced barrels dev