Jump to content

[1.18.2] Modifying PoiType sets


InspectorCaracal

Recommended Posts

My mod adds several new beehives, but the mechanism I used in 1.16.5 to make bees actually use them doesn't seem to be working any more in 1.18.2

This is where I patch the POI set in 1.16.5

And this is the version updated for 1.18.2:

    private void setup(final FMLCommonSetupEvent event) {
        Runnable patch_hives = () -> {
            try {
                LOGGER.debug("Modifying POI register for beehives");
                   final Set<BlockState> HIVES = ImmutableList.of(Blocks.BEEHIVE, ModBlocks.OAK_BEEHIVE.get(), ModBlocks.DARK_OAK_BEEHIVE.get(), ModBlocks.SPRUCE_BEEHIVE.get(), ModBlocks.ACACIA_BEEHIVE.get(), ModBlocks.BIRCH_BEEHIVE.get(), ModBlocks.JUNGLE_BEEHIVE.get()).stream().flatMap((block) -> {
                          return block.getStateDefinition().getPossibleStates().stream();
                       }).collect(ImmutableSet.toImmutableSet());
                   
                   ObfuscationReflectionHelper.setPrivateValue(PoiType.class, PoiType.BEEHIVE, HIVES, "f_27325_");
            } catch (Exception e) {
                LOGGER.error(e);
            }
            
           };
        event.enqueueWork(patch_hives);
    }

However, this updated function is resulting in bees ignoring my new hives and only using vanilla hives and nests. Did I update something incorrectly? Or is there a new/better way to do this?

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.



×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.