diff --git a/src/main/java/implementslegend/mod/vaultfaster/mixin/LazyStructureTemplate.java b/src/main/java/implementslegend/mod/vaultfaster/mixin/LazyStructureTemplate.java index 27d5374..bcb265b 100644 --- a/src/main/java/implementslegend/mod/vaultfaster/mixin/LazyStructureTemplate.java +++ b/src/main/java/implementslegend/mod/vaultfaster/mixin/LazyStructureTemplate.java @@ -42,7 +42,7 @@ public abstract class LazyStructureTemplate implements LazyObject { @Shadow private Set tags; private AtomicReference> initializationTask = new AtomicReference<>(CompletableFuture.completedFuture(Unit.INSTANCE)); - private HashSet preInitTags = new HashSet<>(); + //private HashSet preInitTags = new HashSet<>(); private static ExecutorService LAZY_LOADING_EXECUTOR = Executors.newSingleThreadExecutor((runnable)->{ var thread = new Thread(runnable); @@ -73,7 +73,7 @@ private void initializeIfNot(){ } catch (Exception e){ e.printStackTrace(); } - tags.addAll(preInitTags); + //tags.addAll(preInitTags); return Unit.INSTANCE; }, LAZY_LOADING_EXECUTOR); }else intTask = initializationTask.get(); @@ -93,12 +93,13 @@ private void initializeIfNot(){ @Inject(method={"getEntities"},at = @At("HEAD"),remap = false) private void invokeLazyInit2(EntityPredicate filter, PlacementSettings settings, CallbackInfoReturnable> cir){initializeIfNot();} - @Inject(method={"addTag"},at = @At("HEAD"),remap = false) - private void invokeLazyInit3(ResourceLocation tag, CallbackInfo ci){preInitTags.add(tag);} + /* + @Inject(method={"addTag"},at = @At("HEAD"),remap = false,cancellable = true) + private void invokeLazyInit3(ResourceLocation tag, CallbackInfo ci){preInitTags.add(tag);if(initializationTask.get()==null)ci.cancel();} @Inject(method={"hasTag"},at = @At("HEAD"),remap = false,cancellable = true) private void invokeLazyInit4(ResourceLocation tag, CallbackInfoReturnable cir){if(preInitTags.contains(tag))cir.setReturnValue(true); else initializeIfNot();} @Inject(method={"getTags"},at = @At("HEAD"),remap = false) - private void invokeLazyInit5(CallbackInfoReturnable> cir){initializeIfNot();} + private void invokeLazyInit5(CallbackInfoReturnable> cir){initializeIfNot();}*/ } diff --git a/src/main/java/implementslegend/mod/vaultfaster/mixin/MixinPartialBlock.java b/src/main/java/implementslegend/mod/vaultfaster/mixin/MixinPartialBlock.java index b8f475f..7ccde40 100644 --- a/src/main/java/implementslegend/mod/vaultfaster/mixin/MixinPartialBlock.java +++ b/src/main/java/implementslegend/mod/vaultfaster/mixin/MixinPartialBlock.java @@ -31,7 +31,12 @@ public class MixinPartialBlock implements IndexedBlock { public int getRegistryIndex(){ if(id==null)regIdx=-666; if(regIdx==-69420){ - regIdx= FixatedBlockIDsKt.getIdForBlock(((ForgeRegistry) ForgeRegistries.BLOCKS).getValue(this.id)); + var block = ((ForgeRegistry) ForgeRegistries.BLOCKS).getValue(this.id); + if(block.getRegistryName()!=this.id) { + if (block.getRegistryName().equals(this.id)) this.id = block.getRegistryName();//resource location deduplication, not sure if it helps + else ; + } + regIdx= FixatedBlockIDsKt.getIdForBlock(block); if(regIdx==0 ) { var resName = ((PartialBlockIDAccessor)this).getId(); if(!resName.getNamespace().equals("minecraft") && !resName.getPath().equals("air")) regIdx=-666;