Skip to content

Commit

Permalink
Move POI collection optimization to fabric only package
Browse files Browse the repository at this point in the history
Fixes incompatibility with NeoForge POI Type registration logic
#594
  • Loading branch information
2No2Name committed Nov 28, 2024
1 parent b7262b7 commit b5c0bbf
Show file tree
Hide file tree
Showing 5 changed files with 18 additions and 39 deletions.

This file was deleted.

1 change: 0 additions & 1 deletion common/src/main/resources/lithium.mixins.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@
"ai.pathing.WalkNodeEvaluatorMixin",
"ai.poi.PoiManagerMixin",
"ai.poi.PoiSectionMixin",
"ai.poi.PoiTypesMixin",
"ai.poi.SectionStorageMixin",
"ai.poi.fast_portals.PoiManagerMixin",
"ai.poi.fast_portals.PortalForcerMixin",
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
package net.caffeinemc.mods.lithium.mixin.ai.poi;
package net.caffeinemc.mods.lithium.fabric.mixin.collections.poi_types;

import it.unimi.dsi.fastutil.objects.Reference2ReferenceOpenHashMap;
import net.caffeinemc.mods.lithium.common.world.interests.types.PointOfInterestTypeHelper;
import net.minecraft.world.entity.ai.village.poi.PoiType;
import net.minecraft.world.entity.ai.village.poi.PoiTypes;
import net.minecraft.world.level.block.state.BlockState;
Expand All @@ -24,7 +23,5 @@ public class PoiTypesMixin {

static {
TYPE_BY_STATE = new Reference2ReferenceOpenHashMap<>(TYPE_BY_STATE);

PointOfInterestTypeHelper.init(TYPE_BY_STATE.keySet());
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
@MixinConfigOption(description = "Uses fastutil hashmap for POI Types")
package net.caffeinemc.mods.lithium.fabric.mixin.collections.poi_types;

import net.caffeinemc.gradle.MixinConfigOption;
//Not on NeoForge, as it also replaces the map
23 changes: 12 additions & 11 deletions fabric/src/main/resources/lithium-fabric.mixins.json
Original file line number Diff line number Diff line change
@@ -1,24 +1,25 @@
{
"package" : "net.caffeinemc.mods.lithium.fabric.mixin",
"required" : true,
"compatibilityLevel" : "JAVA_21",
"plugin" : "net.caffeinemc.mods.lithium.mixin.LithiumMixinPlugin",
"refmap" : "lithium-fabric.refmap.json",
"injectors" : {
"defaultRequire" : 1
"package": "net.caffeinemc.mods.lithium.fabric.mixin",
"required": true,
"compatibilityLevel": "JAVA_21",
"plugin": "net.caffeinemc.mods.lithium.mixin.LithiumMixinPlugin",
"refmap": "lithium-fabric.refmap.json",
"injectors": {
"defaultRequire": 1
},
"overwrites" : {
"conformVisibility" : true
"overwrites": {
"conformVisibility": true
},
"mixins" : [
"mixins": [
"block.hopper.LevelMixin",
"collections.poi_types.PoiTypesMixin",
"compat.transfer_api.TransferApiHelperMixin",
"compat.worldedit.LevelChunkMixin",
"entity.collisions.fluid.EntityMixin",
"experimental.entity.block_caching.fluid_pushing.EntityMixin",
"util.inventory_change_listening.BlockEntityMixin",
"util.inventory_change_listening.ChestBlockEntityMixin"
],
"client" : [
"client": [
]
}

0 comments on commit b5c0bbf

Please sign in to comment.