Change the way CopperBlockSet generates block models

- If the specified name and end texture name are equal, then generate a cube_all model instead. Purely for neatness' sake.
This commit is contained in:
FortressNebula 2022-02-03 20:18:27 +00:00
parent 00555ff572
commit f86149b66a

View file

@ -4,6 +4,7 @@ import java.util.EnumMap;
import java.util.HashMap;
import java.util.Locale;
import java.util.Map;
import java.util.Objects;
import java.util.function.Supplier;
import org.apache.commons.lang3.ArrayUtils;
@ -228,10 +229,18 @@ public class CopperBlockSet {
String path = block.getRegistryName()
.getPath();
String baseLoc = ModelProvider.BLOCK_FOLDER + "/" + blocks.generalDirectory + getWeatherStatePrefix(state);
ResourceLocation texture = prov.modLoc(baseLoc + blocks.getName());
ResourceLocation endTexture = prov.modLoc(baseLoc + blocks.getEndTextureName());
prov.simpleBlock(block, prov.models()
.cubeColumn(path, texture, endTexture));
if (Objects.equals(blocks.getName(), blocks.getEndTextureName())) {
// End texture and base texture are equal, so we should use cube_all.
prov.simpleBlock(block, prov.models().cubeAll(path, texture));
} else {
// End texture and base texture aren't equal, so we should use cube_column.
ResourceLocation endTexture = prov.modLoc(baseLoc + blocks.getEndTextureName());
prov.simpleBlock(block, prov.models()
.cubeColumn(path, texture, endTexture));
}
}
@Override