diff --git a/src/main/java/implementslegend/mod/vaultfaster/fixatedBlockIDs.kt b/src/main/java/implementslegend/mod/vaultfaster/fixatedBlockIDs.kt index 1c75b6b..01ff7b5 100644 --- a/src/main/java/implementslegend/mod/vaultfaster/fixatedBlockIDs.kt +++ b/src/main/java/implementslegend/mod/vaultfaster/fixatedBlockIDs.kt @@ -17,9 +17,9 @@ import net.minecraftforge.registries.ForgeRegistry val BLOCKS by lazy { val data = (ForgeRegistries.BLOCKS as ForgeRegistry).values - val result = IdMapper(data.maxOf { (it as IndexedBlock).registryIndex }+1) - data.forEach { - result.addMapping(it,(it as IndexedBlock).registryIndex) + val result = IdMapper(data.count()/*data.maxOf { (it as IndexedBlock).registryIndex }+1*/) + data.forEachIndexed { index, it -> + result.addMapping(it,index) } result } diff --git a/src/main/java/implementslegend/mod/vaultfaster/mixin/MixinBlockRegistryIndex.java b/src/main/java/implementslegend/mod/vaultfaster/mixin/MixinBlockRegistryIndex.java index 1d29784..1629d9f 100644 --- a/src/main/java/implementslegend/mod/vaultfaster/mixin/MixinBlockRegistryIndex.java +++ b/src/main/java/implementslegend/mod/vaultfaster/mixin/MixinBlockRegistryIndex.java @@ -1,6 +1,8 @@ package implementslegend.mod.vaultfaster.mixin; +import implementslegend.mod.vaultfaster.FixatedBlockIDsKt; import implementslegend.mod.vaultfaster.interfaces.IndexedBlock; +import net.minecraft.world.level.block.Block; import net.minecraft.world.level.block.state.BlockBehaviour; import net.minecraftforge.registries.ForgeRegistries; import net.minecraftforge.registries.ForgeRegistry; @@ -16,10 +18,13 @@ public class MixinBlockRegistryIndex implements IndexedBlock { private int registryIndex = -1; @Override public int getRegistryIndex() { + /* if(registryIndex<0){ registryIndex= ((ForgeRegistry)ForgeRegistries.BLOCKS).getID((BlockBehaviour) (Object)this); } return registryIndex; + */ + return FixatedBlockIDsKt.getIdForBlock((Block)(Object) this); } @Override