Change loading models (WIP)

This commit is contained in:
Aleksey 2021-05-17 17:56:21 +03:00
parent 8b94c91ea5
commit 87f8699dbb
64 changed files with 532 additions and 476 deletions

View file

@ -7,19 +7,18 @@ import net.minecraft.core.Registry;
import net.minecraft.resources.ResourceLocation;
import net.minecraft.world.level.block.Block;
import ru.betterend.blocks.basis.PedestalBlock;
import ru.betterend.patterns.Patterns;
public class PedestalVanilla extends PedestalBlock {
public PedestalVanilla(Block parent) {
super(parent);
}
@Override
public String getModelString(String block) {
protected Map<String, String> createTexturesMap() {
ResourceLocation blockId = Registry.BLOCK.getKey(parent);
String name = blockId.getPath().replace("_block", "");
Map<String, String> textures = new HashMap<String, String>() {
return new HashMap<String, String>() {
private static final long serialVersionUID = 1L;
{
put("%mod%", blockId.getNamespace() );
@ -29,17 +28,5 @@ public class PedestalVanilla extends PedestalBlock {
put("%bottom%", "polished_" + name);
}
};
if (block.contains("column_top")) {
return Patterns.createJson(Patterns.BLOCK_PEDESTAL_COLUMN_TOP, textures);
} else if (block.contains("column")) {
return Patterns.createJson(Patterns.BLOKC_PEDESTAL_COLUMN, textures);
} else if (block.contains("top")) {
return Patterns.createJson(Patterns.BLOCK_PEDESTAL_TOP, textures);
} else if (block.contains("bottom")) {
return Patterns.createJson(Patterns.BLOCK_PEDESTAL_BOTTOM, textures);
} else if (block.contains("pillar")) {
return Patterns.createJson(Patterns.BLOCK_PEDESTAL_PILLAR, textures);
}
return Patterns.createJson(Patterns.BLOCK_PEDESTAL_DEFAULT, textures);
}
}