Beispiel #1
0
    $basemodel = getBaseBlockModel($height);
    file_put_contents("models/block/orepile/base_{$height}.json", getBaseBlockModel($height));
}
foreach (array("false", "true") as $burning) {
    foreach ($oretypes as $oretype) {
        foreach ($heights as $height) {
            $filename = "orepile/{$oretype}_{$height}";
            if ($burning == "true") {
                $filename .= "_burning";
            }
            $variants[] = "\t\t\"burning={$burning},height={$height},oretype={$oretype}\": { \"model\": \"vintagecraft:{$filename}\"}";
            file_put_contents("models/block/{$filename}.json", getBlockModel($oretype, $height, $burning));
        }
    }
}
file_put_contents("blockstates/orepile.json", getBlockStates($variants));
function getBlockStates($variants)
{
    return '{
	"variants": {
' . implode(",\r\n", $variants) . '
	}
}';
}
function getBaseBlockModel($height)
{
    $nheight = $height + 1;
    return '{
    "__comment": "Model generated using MrCrayfishs Model Creator (http://mrcrayfish.com/modelcreator/)",
    "textures": {
        "texture": "#material",
Beispiel #2
0
    $variants[] = "\t\t" . '"cutout=false,metalandfacing=' . $metal . '-s": { "model": "vintagecraft:metalplate/' . $metal . '", "x":90 }';
    $variants[] = "\t\t" . '"cutout=false,metalandfacing=' . $metal . '-w": { "model": "vintagecraft:metalplate/' . $metal . '", "x":90, "y":90 }';
    $variants[] = "\t\t" . '"cutout=false,metalandfacing=' . $metal . '-e": { "model": "vintagecraft:metalplate/' . $metal . '", "x": 90, "y":270 }';
    $variants[] = "\t\t" . '"cutout=true,metalandfacing=' . $metal . '-d": { "model": "vintagecraft:metalplate/' . $metal . '-cutout" }';
    $variants[] = "\t\t" . '"cutout=true,metalandfacing=' . $metal . '-u": { "model": "vintagecraft:metalplate/' . $metal . '-cutout", "x":180 }';
    $variants[] = "\t\t" . '"cutout=true,metalandfacing=' . $metal . '-n": { "model": "vintagecraft:metalplate/' . $metal . '-cutout", "x":90, "y": 180 }';
    $variants[] = "\t\t" . '"cutout=true,metalandfacing=' . $metal . '-s": { "model": "vintagecraft:metalplate/' . $metal . '-cutout", "x":90 }';
    $variants[] = "\t\t" . '"cutout=true,metalandfacing=' . $metal . '-w": { "model": "vintagecraft:metalplate/' . $metal . '-cutout", "x":90, "y":90 }';
    $variants[] = "\t\t" . '"cutout=true,metalandfacing=' . $metal . '-e": { "model": "vintagecraft:metalplate/' . $metal . '-cutout", "x": 90, "y":270 }';
    $numstates += 6;
    file_put_contents("models/block/metalplate/{$metal}.json", getBlockModel("metalplate", $metal));
    file_put_contents("models/block/metalplate/{$metal}-cutout.json", getBlockModel("metalplate-cutout", $metal));
    file_put_contents("models/item/metalplate/{$metal}.json", getItemModel("metalplate", $metal));
}
for ($i = 0; $i < ceil($numstates / 16) + 1; $i++) {
    file_put_contents("blockstates/metalplate" . ($i > 0 ? $i + 1 : "") . ".json", getBlockStates($variants));
}
function getBlockStates($variants)
{
    return '{
	"variants": {
' . implode(",\r\n", $variants) . '
	}
}';
}
function getBlockModel($blockclass, $blocktype)
{
    $base = 'base';
    if ($blockclass == 'metalplate-cutout') {
        $base = 'base-cutout';
    }
Beispiel #3
0
$states = 0;
foreach ($croptypes as $idx => $croptype) {
    for ($stage = 0; $stage < $growthstages[$idx]; $stage++) {
        $filename = "crops/{$croptype}-stage{$stage}";
        $variants[] = "\t\t\"croptypeandstage={$croptype}-stage{$stage}\": { \"model\": \"vintagecraft:{$filename}\"}";
        $states++;
        file_put_contents("models/block/{$filename}.json", getBlockModel($croptype, $cropshapes[$idx], $stage));
    }
    file_put_contents("models/item/seeds/{$croptype}.json", getSeedItemModel($croptype));
}
$cnt = ceil($states / 16);
while ($cnt > 0) {
    if ($cnt == 1) {
        $cnt = "";
    }
    file_put_contents("blockstates/crops{$cnt}.json", getBlockStates($variants));
    $cnt--;
}
function getBlockStates($variants)
{
    return '{
	"variants": {
' . implode(",\r\n", $variants) . '
	}
}';
}
function getBlockModel($croptype, $cropshape, $stage)
{
    if ($cropshape == "wheat") {
        return '{
	"parent": "vintagecraft:block/crops/' . $cropshape . '",
Beispiel #4
0
        "facing=north,half=top,shape=outer_right,treetype=' . $blocktype . '":  { "model": "vintagecraft:stairs/' . $blocktype . '_outer", "x": 180, "y": 270, "uvlock": true },
        "facing=east,half=top,shape=outer_left,treetype=' . $blocktype . '":  { "model": "vintagecraft:stairs/' . $blocktype . '_outer", "x": 180, "y": 90, "uvlock": true },
        "facing=west,half=top,shape=outer_left,treetype=' . $blocktype . '":  { "model": "vintagecraft:stairs/' . $blocktype . '_outer", "x": 180, "y": 270, "uvlock": true },
        "facing=south,half=top,shape=outer_left,treetype=' . $blocktype . '":  { "model": "vintagecraft:stairs/' . $blocktype . '_outer", "x": 180, "y": 180, "uvlock": true },
        "facing=north,half=top,shape=outer_left,treetype=' . $blocktype . '":  { "model": "vintagecraft:stairs/' . $blocktype . '_outer", "x": 180, "uvlock": true },
        "facing=east,half=top,shape=inner_right,treetype=' . $blocktype . '":  { "model": "vintagecraft:stairs/' . $blocktype . '_inner", "x": 180, "uvlock": true },
        "facing=west,half=top,shape=inner_right,treetype=' . $blocktype . '":  { "model": "vintagecraft:stairs/' . $blocktype . '_inner", "x": 180, "y": 180, "uvlock": true },
        "facing=south,half=top,shape=inner_right,treetype=' . $blocktype . '":  { "model": "vintagecraft:stairs/' . $blocktype . '_inner", "x": 180, "y": 90, "uvlock": true },
        "facing=north,half=top,shape=inner_right,treetype=' . $blocktype . '":  { "model": "vintagecraft:stairs/' . $blocktype . '_inner", "x": 180, "y": 270, "uvlock": true },
        "facing=east,half=top,shape=inner_left,treetype=' . $blocktype . '":  { "model": "vintagecraft:stairs/' . $blocktype . '_inner", "x": 180, "y": 90, "uvlock": true },
        "facing=west,half=top,shape=inner_left,treetype=' . $blocktype . '":  { "model": "vintagecraft:stairs/' . $blocktype . '_inner", "x": 180, "y": 270, "uvlock": true },
        "facing=south,half=top,shape=inner_left,treetype=' . $blocktype . '":  { "model": "vintagecraft:stairs/' . $blocktype . '_inner", "x": 180, "y": 180, "uvlock": true },
        "facing=north,half=top,shape=inner_left,treetype=' . $blocktype . '":  { "model": "vintagecraft:stairs/' . $blocktype . '_inner", "x": 180, "uvlock": true }';
}
for ($i = 0; $i < ceil(count($blocktypes) / 2); $i++) {
    file_put_contents("blockstates/" . $blockclass . ($i > 0 ? $i + 1 : "") . ".json", getBlockStates($variants));
}
// modeltypes
//   cube_column
//   cube_all
//
function getBlockStates($variants)
{
    return '{
	"variants": {
' . implode(",\r\n", $variants) . '
	}
}';
}
function getBlockModel($modeltype, $blockclass, $blocktype)
{