Small pot fix, potted inflexia

This commit is contained in:
paulevsGitch 2021-07-31 15:44:41 +03:00
parent 757ed82817
commit 533dd7c92c
5 changed files with 30 additions and 11 deletions

View file

@ -381,15 +381,18 @@ public class FlowerPotBlock extends BaseBlockNotFull implements RenderLayerProvi
.add();
}
else {
for (ResourceLocation location : modelCache.keySet()) {
if (location.getPath().equals(modelPath.getPath())) {
model.part(location)
.setTransformation(offset)
.setCondition(state -> state.getValue(PLANT_ID) == compareID)
.add();
break;
}
}
ResourceLocation loc = Registry.BLOCK.getKey(plants[i]);
modelPath = new ResourceLocation(loc.getNamespace(), "block/" + loc.getPath() + "_potted");
Map<String, String> textures = Maps.newHashMap();
textures.put("%modid%", loc.getNamespace());
textures.put("%texture%", loc.getPath());
Optional<String> pattern = Patterns.createJson(BasePatterns.BLOCK_CROSS, textures);
UnbakedModel unbakedModel = ModelsHelper.fromPattern(pattern);
modelCache.put(modelPath, unbakedModel);
model.part(modelPath)
.setTransformation(offset)
.setCondition(state -> state.getValue(PLANT_ID) == compareID)
.add();
}
}