Generate fences and fence gates blockstates

This commit is contained in:
Vincent Lee committed 2020-01-17 18:17:02 -06:00
1 parent e535b05ad0
commit 73685b3e8e
23 files changed
+269 -81

No files matched your search

@@ -0,0 +1,48 @@
{
"multipart": [
{
"apply": {
"model": "botania:block/dreamwood_fence_post"
}
},
{
"when": {
"north": "true"
},
"apply": {
"model": "botania:block/dreamwood_fence_side",
"uvlock": true
}
},
{
"when": {
"south": "true"
},
"apply": {
"model": "botania:block/dreamwood_fence_side",
"y": 180,
"uvlock": true
}
},
{
"when": {
"west": "true"
},
"apply": {
"model": "botania:block/dreamwood_fence_side",
"y": 270,
"uvlock": true
}
},
{
"when": {
"east": "true"
},
"apply": {
"model": "botania:block/dreamwood_fence_side",
"y": 90,
"uvlock": true
}
}
]
}
@@ -0,0 +1,80 @@
{
"variants": {
"facing=north,in_wall=false,open=false": {
"model": "botania:block/dreamwood_fence_gate",
"y": 180,
"uvlock": true
},
"facing=south,in_wall=false,open=false": {
"model": "botania:block/dreamwood_fence_gate",
"uvlock": true
},
"facing=west,in_wall=false,open=false": {
"model": "botania:block/dreamwood_fence_gate",
"y": 90,
"uvlock": true
},
"facing=east,in_wall=false,open=false": {
"model": "botania:block/dreamwood_fence_gate",
"y": 270,
"uvlock": true
},
"facing=north,in_wall=true,open=false": {
"model": "botania:block/dreamwood_fence_gate_wall",
"y": 180,
"uvlock": true
},
"facing=south,in_wall=true,open=false": {
"model": "botania:block/dreamwood_fence_gate_wall",
"uvlock": true
},
"facing=west,in_wall=true,open=false": {
"model": "botania:block/dreamwood_fence_gate_wall",
"y": 90,
"uvlock": true
},
"facing=east,in_wall=true,open=false": {
"model": "botania:block/dreamwood_fence_gate_wall",
"y": 270,
"uvlock": true
},
"facing=north,in_wall=false,open=true": {
"model": "botania:block/dreamwood_fence_gate_open",
"y": 180,
"uvlock": true
},
"facing=south,in_wall=false,open=true": {
"model": "botania:block/dreamwood_fence_gate_open",
"uvlock": true
},
"facing=west,in_wall=false,open=true": {
"model": "botania:block/dreamwood_fence_gate_open",
"y": 90,
"uvlock": true
},
"facing=east,in_wall=false,open=true": {
"model": "botania:block/dreamwood_fence_gate_open",
"y": 270,
"uvlock": true
},
"facing=north,in_wall=true,open=true": {
"model": "botania:block/dreamwood_fence_gate_wall_open",
"y": 180,
"uvlock": true
},
"facing=south,in_wall=true,open=true": {
"model": "botania:block/dreamwood_fence_gate_wall_open",
"uvlock": true
},
"facing=west,in_wall=true,open=true": {
"model": "botania:block/dreamwood_fence_gate_wall_open",
"y": 90,
"uvlock": true
},
"facing=east,in_wall=true,open=true": {
"model": "botania:block/dreamwood_fence_gate_wall_open",
"y": 270,
"uvlock": true
}
}
}
@@ -0,0 +1,48 @@
{
"multipart": [
{
"apply": {
"model": "botania:block/livingwood_fence_post"
}
},
{
"when": {
"north": "true"
},
"apply": {
"model": "botania:block/livingwood_fence_side",
"uvlock": true
}
},
{
"when": {
"south": "true"
},
"apply": {
"model": "botania:block/livingwood_fence_side",
"y": 180,
"uvlock": true
}
},
{
"when": {
"west": "true"
},
"apply": {
"model": "botania:block/livingwood_fence_side",
"y": 270,
"uvlock": true
}
},
{
"when": {
"east": "true"
},
"apply": {
"model": "botania:block/livingwood_fence_side",
"y": 90,
"uvlock": true
}
}
]
}
@@ -0,0 +1,80 @@
{
"variants": {
"facing=north,in_wall=false,open=false": {
"model": "botania:block/livingwood_fence_gate",
"y": 180,
"uvlock": true
},
"facing=south,in_wall=false,open=false": {
"model": "botania:block/livingwood_fence_gate",
"uvlock": true
},
"facing=west,in_wall=false,open=false": {
"model": "botania:block/livingwood_fence_gate",
"y": 90,
"uvlock": true
},
"facing=east,in_wall=false,open=false": {
"model": "botania:block/livingwood_fence_gate",
"y": 270,
"uvlock": true
},
"facing=north,in_wall=true,open=false": {
"model": "botania:block/livingwood_fence_gate_wall",
"y": 180,
"uvlock": true
},
"facing=south,in_wall=true,open=false": {
"model": "botania:block/livingwood_fence_gate_wall",
"uvlock": true
},
"facing=west,in_wall=true,open=false": {
"model": "botania:block/livingwood_fence_gate_wall",
"y": 90,
"uvlock": true
},
"facing=east,in_wall=true,open=false": {
"model": "botania:block/livingwood_fence_gate_wall",
"y": 270,
"uvlock": true
},
"facing=north,in_wall=false,open=true": {
"model": "botania:block/livingwood_fence_gate_open",
"y": 180,
"uvlock": true
},
"facing=south,in_wall=false,open=true": {
"model": "botania:block/livingwood_fence_gate_open",
"uvlock": true
},
"facing=west,in_wall=false,open=true": {
"model": "botania:block/livingwood_fence_gate_open",
"y": 90,
"uvlock": true
},
"facing=east,in_wall=false,open=true": {
"model": "botania:block/livingwood_fence_gate_open",
"y": 270,
"uvlock": true
},
"facing=north,in_wall=true,open=true": {
"model": "botania:block/livingwood_fence_gate_wall_open",
"y": 180,
"uvlock": true
},
"facing=south,in_wall=true,open=true": {
"model": "botania:block/livingwood_fence_gate_wall_open",
"uvlock": true
},
"facing=west,in_wall=true,open=true": {
"model": "botania:block/livingwood_fence_gate_wall_open",
"y": 90,
"uvlock": true
},
"facing=east,in_wall=true,open=true": {
"model": "botania:block/livingwood_fence_gate_wall_open",
"y": 270,
"uvlock": true
}
}
}
@@ -50,7 +50,7 @@ public class BlockstateProvider extends BlockStateProvider {
protected void registerStatesAndModels() {
Registry.BLOCK.stream().filter(b -> LibMisc.MOD_ID.equals(b.getRegistryName().getNamespace()))
.forEach(b -> {
if (b instanceof FenceBlock || b instanceof FenceGateBlock || b instanceof PaneBlock
if (b instanceof PaneBlock
|| b instanceof WallBlock
|| b instanceof FlowerBlock || b instanceof BlockAltar || b == ModBlocks.tinyPotato
|| b instanceof BlockRedString || b instanceof BlockFloatingFlower || b instanceof BlockModMushroom
@@ -79,6 +79,16 @@ public class BlockstateProvider extends BlockStateProvider {
ModelFile inner = models().getExistingFile(prefix("block/stairs/" + name + "_inner"));
ModelFile outer = models().getExistingFile(prefix("block/stairs/" + name + "_outer"));
stairsBlock((StairsBlock) b, stair, inner, outer);
} else if (b instanceof FenceBlock) {
ModelFile post = models().getExistingFile(prefix("block/" + name + "_post"));
ModelFile side = models().getExistingFile(prefix("block/" + name + "_side"));
fourWayBlock((FenceBlock) b, post, side);
} else if (b instanceof FenceGateBlock) {
ModelFile gate = models().getExistingFile(prefix("block/" + name));
ModelFile gateOpen = models().getExistingFile(prefix("block/" + name + "_open"));
ModelFile wall = models().getExistingFile(prefix("block/" + name + "_wall"));
ModelFile wallOpen = models().getExistingFile(prefix("block/" + name + "_wall_open"));
fenceGateBlock((FenceGateBlock) b, gate, gateOpen, wall, wallOpen);
} else if (b instanceof BlockAltGrass) {
ModelFile model = models().getExistingFile(prefix("block/" + name));
getVariantBuilder(b).partialState().setModels(new ConfiguredModel(model),
@@ -1,19 +0,0 @@
{
"multipart": [
{
"apply": { "model": "botania:block/fences/dreamwood_fence_post" }
},
{ "when": { "north": "true" },
"apply": { "model": "botania:block/fences/dreamwood_fence_side", "uvlock": true }
},
{ "when": { "east": "true" },
"apply": { "model": "botania:block/fences/dreamwood_fence_side", "y": 90, "uvlock": true }
},
{ "when": { "south": "true" },
"apply": { "model": "botania:block/fences/dreamwood_fence_side", "y": 180, "uvlock": true }
},
{ "when": { "west": "true" },
"apply": { "model": "botania:block/fences/dreamwood_fence_side", "y": 270, "uvlock": true }
}
]
}
@@ -1,20 +0,0 @@
{
"variants": {
"facing=south,in_wall=false,open=false": { "model": "botania:block/fence_gates/dreamwood_fence_gate", "uvlock": true },
"facing=west,in_wall=false,open=false": { "model": "botania:block/fence_gates/dreamwood_fence_gate", "uvlock": true, "y": 90 },
"facing=north,in_wall=false,open=false": { "model": "botania:block/fence_gates/dreamwood_fence_gate", "uvlock": true, "y": 180 },
"facing=east,in_wall=false,open=false": { "model": "botania:block/fence_gates/dreamwood_fence_gate", "uvlock": true, "y": 270 },
"facing=south,in_wall=false,open=true": { "model": "botania:block/fence_gates/dreamwood_fence_gate_open", "uvlock": true },
"facing=west,in_wall=false,open=true": { "model": "botania:block/fence_gates/dreamwood_fence_gate_open", "uvlock": true, "y": 90 },
"facing=north,in_wall=false,open=true": { "model": "botania:block/fence_gates/dreamwood_fence_gate_open", "uvlock": true, "y": 180 },
"facing=east,in_wall=false,open=true": { "model": "botania:block/fence_gates/dreamwood_fence_gate_open", "uvlock": true, "y": 270 },
"facing=south,in_wall=true,open=false": { "model": "botania:block/fence_gates/dreamwood_fence_gate_wall", "uvlock": true },
"facing=west,in_wall=true,open=false": { "model": "botania:block/fence_gates/dreamwood_fence_gate_wall", "uvlock": true, "y": 90 },
"facing=north,in_wall=true,open=false": { "model": "botania:block/fence_gates/dreamwood_fence_gate_wall", "uvlock": true, "y": 180 },
"facing=east,in_wall=true,open=false": { "model": "botania:block/fence_gates/dreamwood_fence_gate_wall", "uvlock": true, "y": 270 },
"facing=south,in_wall=true,open=true": { "model": "botania:block/fence_gates/dreamwood_fence_gate_wall_open", "uvlock": true },
"facing=west,in_wall=true,open=true": { "model": "botania:block/fence_gates/dreamwood_fence_gate_wall_open", "uvlock": true, "y": 90 },
"facing=north,in_wall=true,open=true": { "model": "botania:block/fence_gates/dreamwood_fence_gate_wall_open", "uvlock": true, "y": 180 },
"facing=east,in_wall=true,open=true": { "model": "botania:block/fence_gates/dreamwood_fence_gate_wall_open", "uvlock": true, "y": 270 }
}
}
@@ -1,19 +0,0 @@
{
"multipart": [
{
"apply": { "model": "botania:block/fences/livingwood_fence_post" }
},
{ "when": { "north": "true" },
"apply": { "model": "botania:block/fences/livingwood_fence_side", "uvlock": true }
},
{ "when": { "east": "true" },
"apply": { "model": "botania:block/fences/livingwood_fence_side", "y": 90, "uvlock": true }
},
{ "when": { "south": "true" },
"apply": { "model": "botania:block/fences/livingwood_fence_side", "y": 180, "uvlock": true }
},
{ "when": { "west": "true" },
"apply": { "model": "botania:block/fences/livingwood_fence_side", "y": 270, "uvlock": true }
}
]
}
@@ -1,20 +0,0 @@
{
"variants": {
"facing=south,in_wall=false,open=false": { "model": "botania:block/fence_gates/livingwood_fence_gate", "uvlock": true },
"facing=west,in_wall=false,open=false": { "model": "botania:block/fence_gates/livingwood_fence_gate", "uvlock": true, "y": 90 },
"facing=north,in_wall=false,open=false": { "model": "botania:block/fence_gates/livingwood_fence_gate", "uvlock": true, "y": 180 },
"facing=east,in_wall=false,open=false": { "model": "botania:block/fence_gates/livingwood_fence_gate", "uvlock": true, "y": 270 },
"facing=south,in_wall=false,open=true": { "model": "botania:block/fence_gates/livingwood_fence_gate_open", "uvlock": true },
"facing=west,in_wall=false,open=true": { "model": "botania:block/fence_gates/livingwood_fence_gate_open", "uvlock": true, "y": 90 },
"facing=north,in_wall=false,open=true": { "model": "botania:block/fence_gates/livingwood_fence_gate_open", "uvlock": true, "y": 180 },
"facing=east,in_wall=false,open=true": { "model": "botania:block/fence_gates/livingwood_fence_gate_open", "uvlock": true, "y": 270 },
"facing=south,in_wall=true,open=false": { "model": "botania:block/fence_gates/livingwood_fence_gate_wall", "uvlock": true },
"facing=west,in_wall=true,open=false": { "model": "botania:block/fence_gates/livingwood_fence_gate_wall", "uvlock": true, "y": 90 },
"facing=north,in_wall=true,open=false": { "model": "botania:block/fence_gates/livingwood_fence_gate_wall", "uvlock": true, "y": 180 },
"facing=east,in_wall=true,open=false": { "model": "botania:block/fence_gates/livingwood_fence_gate_wall", "uvlock": true, "y": 270 },
"facing=south,in_wall=true,open=true": { "model": "botania:block/fence_gates/livingwood_fence_gate_wall_open", "uvlock": true },
"facing=west,in_wall=true,open=true": { "model": "botania:block/fence_gates/livingwood_fence_gate_wall_open", "uvlock": true, "y": 90 },
"facing=north,in_wall=true,open=true": { "model": "botania:block/fence_gates/livingwood_fence_gate_wall_open", "uvlock": true, "y": 180 },
"facing=east,in_wall=true,open=true": { "model": "botania:block/fence_gates/livingwood_fence_gate_wall_open", "uvlock": true, "y": 270 }
}
}
@@ -1,3 +1,3 @@
{
"parent": "botania:block/fence_gates/dreamwood_fence_gate"
"parent": "botania:block/dreamwood_fence_gate"
}
@@ -1,3 +1,3 @@
{
"parent": "botania:block/fence_gates/livingwood_fence_gate"
"parent": "botania:block/livingwood_fence_gate"
}