Port patch to 1.19

This commit is contained in:
embeddedt 2023-04-11 11:19:23 -04:00
parent 357b9af52f
commit 47959cddef
No known key found for this signature in database
GPG Key ID: A69433EC199B5613

View File

@ -178,14 +178,14 @@ public abstract class ModelBakeryMixin {
gatherModelMaterials(materialSet);
}
@Redirect(method = "processLoading", at = @At(value = "INVOKE", target = "Ljava/util/Map;forEach(Ljava/util/function/BiConsumer;)V", ordinal = 0), remap = false)
@Redirect(method = "<init>", at = @At(value = "INVOKE", target = "Ljava/util/Map;forEach(Ljava/util/function/BiConsumer;)V", ordinal = 0))
private void fetchStaticDefinitions(Map<ResourceLocation, StateDefinition<Block, BlockState>> map, BiConsumer<ResourceLocation, StateDefinition<Block, BlockState>> func) {
map.forEach((loc, def) -> blockStateFiles.add(loc));
}
@Redirect(method = "processLoading", at = @At(value = "INVOKE", target = "Lnet/minecraft/world/level/block/state/StateDefinition;getPossibleStates()Lcom/google/common/collect/ImmutableList;", ordinal = 0))
@Redirect(method = "<init>", at = @At(value = "INVOKE", target = "Lnet/minecraft/world/level/block/state/StateDefinition;getPossibleStates()Lcom/google/common/collect/ImmutableList;", ordinal = 0))
private ImmutableList<BlockState> fetchBlocks(StateDefinition<Block, BlockState> def) {
blockStateFiles.add(def.any().getBlock().getRegistryName());
blockStateFiles.add(ForgeRegistries.BLOCKS.getKey(def.any().getBlock()));
return ImmutableList.of();
}