2019-02-14 23:08:53 +00:00
|
|
|
--- a/net/minecraft/client/renderer/model/ModelBakery.java
|
|
|
|
+++ b/net/minecraft/client/renderer/model/ModelBakery.java
|
2019-07-20 03:33:15 +00:00
|
|
|
@@ -97,7 +97,7 @@
|
2019-05-23 23:02:15 +00:00
|
|
|
private final Set<ResourceLocation> field_217848_D = Sets.newHashSet();
|
|
|
|
private final BlockModelDefinition.ContainerHolder field_209610_F = new BlockModelDefinition.ContainerHolder();
|
|
|
|
private final Map<ResourceLocation, IUnbakedModel> field_217849_F = Maps.newHashMap();
|
|
|
|
- private final Map<Triple<ResourceLocation, ModelRotation, Boolean>, IBakedModel> field_217850_G = Maps.newHashMap();
|
|
|
|
+ private final Map<Triple<ResourceLocation, net.minecraftforge.common.model.IModelState, Boolean>, IBakedModel> field_217850_G = Maps.newHashMap();
|
|
|
|
private final Map<ResourceLocation, IUnbakedModel> field_217851_H = Maps.newHashMap();
|
|
|
|
private final Map<ResourceLocation, IBakedModel> field_217852_I = Maps.newHashMap();
|
|
|
|
private final AtlasTexture.SheetData field_217853_J;
|
2019-09-11 14:00:32 +00:00
|
|
|
@@ -142,12 +142,19 @@
|
2019-08-15 18:03:57 +00:00
|
|
|
|
|
|
|
p_i51735_4_.func_219895_b("special");
|
|
|
|
this.func_217843_a(new ModelResourceLocation("minecraft:trident_in_hand#inventory"));
|
|
|
|
+ for (ResourceLocation rl : getSpecialModels()) {
|
|
|
|
+ // Same as func_217843_a but without restricting to MRL's
|
|
|
|
+ IUnbakedModel iunbakedmodel = this.func_209597_a(rl);
|
|
|
|
+ this.field_217849_F.put(rl, iunbakedmodel);
|
|
|
|
+ this.field_217851_H.put(rl, iunbakedmodel);
|
|
|
|
+ }
|
|
|
|
p_i51735_4_.func_219895_b("textures");
|
|
|
|
Set<String> set = Sets.newLinkedHashSet();
|
|
|
|
Set<ResourceLocation> set1 = this.field_217851_H.values().stream().flatMap((p_217838_2_) -> {
|
2019-09-11 14:00:32 +00:00
|
|
|
return p_217838_2_.func_209559_a(this::func_209597_a, set).stream();
|
|
|
|
}).collect(Collectors.toSet());
|
|
|
|
set1.addAll(field_177602_b);
|
|
|
|
+ net.minecraftforge.client.ForgeHooksClient.gatherFluidTextures(set1);
|
|
|
|
set.forEach((p_217833_0_) -> {
|
|
|
|
field_177603_c.warn("Unable to resolve texture reference: {}", (Object)p_217833_0_);
|
|
|
|
});
|
|
|
|
@@ -288,7 +295,7 @@
|
2019-07-20 03:33:15 +00:00
|
|
|
{
|
|
|
|
lvt_13_5_ = this.field_177598_f.func_199004_b(resourcelocation1).stream().map((p_217839_1_) -> {
|
2019-05-23 23:02:15 +00:00
|
|
|
try (InputStream inputstream = p_217839_1_.func_199027_b()) {
|
2019-07-20 06:27:31 +00:00
|
|
|
- Pair<String, BlockModelDefinition> pair2 = Pair.of(p_217839_1_.func_199026_d(), BlockModelDefinition.func_209577_a(this.field_209610_F, new InputStreamReader(inputstream, StandardCharsets.UTF_8)));
|
|
|
|
+ Pair<String, BlockModelDefinition> pair2 = Pair.of(p_217839_1_.func_199026_d(), BlockModelDefinition.fromJson(this.field_209610_F, new InputStreamReader(inputstream, StandardCharsets.UTF_8), p_209598_1_));
|
2019-07-20 03:33:15 +00:00
|
|
|
return pair2;
|
2019-02-14 23:08:53 +00:00
|
|
|
} catch (Exception exception1) {
|
2019-05-23 23:02:15 +00:00
|
|
|
throw new ModelBakery.BlockStateDefinitionException(String.format("Exception loading blockstate definition: '%s' in resourcepack: '%s': %s", p_217839_1_.func_199029_a(), p_217839_1_.func_199026_d(), exception1.getMessage()));
|
2019-09-11 14:00:32 +00:00
|
|
|
@@ -404,7 +411,12 @@
|
2019-05-23 23:02:15 +00:00
|
|
|
|
|
|
|
@Nullable
|
|
|
|
public IBakedModel func_217845_a(ResourceLocation p_217845_1_, ISprite p_217845_2_) {
|
|
|
|
- Triple<ResourceLocation, ModelRotation, Boolean> triple = Triple.of(p_217845_1_, p_217845_2_.func_188048_b(), p_217845_2_.func_188049_c());
|
2019-06-08 05:02:23 +00:00
|
|
|
+ return getBakedModel(p_217845_1_, p_217845_2_, this.field_177609_j::func_195424_a, net.minecraft.client.renderer.vertex.DefaultVertexFormats.field_176599_b);
|
|
|
|
+ }
|
2019-07-16 17:17:30 +00:00
|
|
|
+
|
2019-06-08 05:02:23 +00:00
|
|
|
+ @Nullable
|
|
|
|
+ public IBakedModel getBakedModel(ResourceLocation p_217845_1_, ISprite p_217845_2_, java.util.function.Function<ResourceLocation, net.minecraft.client.renderer.texture.TextureAtlasSprite> textureGetter, net.minecraft.client.renderer.vertex.VertexFormat format) {
|
2019-05-23 23:02:15 +00:00
|
|
|
+ Triple<ResourceLocation, net.minecraftforge.common.model.IModelState, Boolean> triple = Triple.of(p_217845_1_, p_217845_2_.getState(), p_217845_2_.func_188049_c());
|
|
|
|
if (this.field_217850_G.containsKey(triple)) {
|
|
|
|
return this.field_217850_G.get(triple);
|
|
|
|
} else {
|
2019-09-11 14:00:32 +00:00
|
|
|
@@ -412,11 +424,11 @@
|
2019-05-23 23:02:15 +00:00
|
|
|
if (iunbakedmodel instanceof BlockModel) {
|
|
|
|
BlockModel blockmodel = (BlockModel)iunbakedmodel;
|
|
|
|
if (blockmodel.func_178310_f() == field_177606_o) {
|
|
|
|
- return field_217854_z.func_209579_a(this.field_177609_j::func_195424_a, blockmodel).func_217644_a(this, blockmodel, this.field_177609_j::func_195424_a, p_217845_2_);
|
2019-06-08 05:02:23 +00:00
|
|
|
+ return field_217854_z.func_209579_a(textureGetter, blockmodel).func_217644_a(this, blockmodel, textureGetter, p_217845_2_);
|
2019-05-23 23:02:15 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2019-06-08 05:02:23 +00:00
|
|
|
- IBakedModel ibakedmodel = iunbakedmodel.func_217641_a(this, this.field_177609_j::func_195424_a, p_217845_2_);
|
|
|
|
+ IBakedModel ibakedmodel = iunbakedmodel.bake(this, this.field_177609_j::func_195424_a, p_217845_2_, format);
|
|
|
|
this.field_217850_G.put(triple, ibakedmodel);
|
|
|
|
return ibakedmodel;
|
|
|
|
}
|
2019-09-11 14:00:32 +00:00
|
|
|
@@ -471,6 +483,10 @@
|
2019-08-15 18:03:57 +00:00
|
|
|
return this.field_225367_M;
|
|
|
|
}
|
|
|
|
|
|
|
|
+ public Set<ResourceLocation> getSpecialModels() {
|
|
|
|
+ return java.util.Collections.emptySet();
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
@OnlyIn(Dist.CLIENT)
|
|
|
|
static class BlockStateDefinitionException extends RuntimeException {
|
|
|
|
public BlockStateDefinitionException(String p_i49526_1_) {
|