示例#1
0
$variants = array();
$i = 0;
$states = 0;
foreach ($heights as $height) {
    $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;
示例#2
0
<?php

$blocktype = "crop";
$croptypes = array("peas", "wheat", "tomatoes", "flax");
$cropshapes = array("doubletallcross", "wheat", "doubletallcross", "wheat");
$growthstages = array(9, 8, 13, 5);
$variants = array();
$i = 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) . '
示例#3
0
    }
    $variants[] = "\t\t" . '"cutout=false,metalandfacing=' . $metal . '-d": { "model": "vintagecraft:metalplate/' . $metal . '" }';
    $variants[] = "\t\t" . '"cutout=false,metalandfacing=' . $metal . '-u": { "model": "vintagecraft:metalplate/' . $metal . '", "x":180 }';
    $variants[] = "\t\t" . '"cutout=false,metalandfacing=' . $metal . '-n": { "model": "vintagecraft:metalplate/' . $metal . '", "x":90, "y": 180 }';
    $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)
{
示例#4
0
<?php

$blocktype = "rawore";
$rocktypes = array("andesite", "basalt", "claystone", "conglomerate", "diorite", "gneiss", "granite", "limestone", "marble", "quartzite", "schist", "shale", "gabbro", "sandstone", "redsandstone", "chert", "chalk", "kimberlite", "slate");
$oretypes = array("clay", "peat", "lignite", "bituminouscoal", "nativecopper", "limonite", "nativegold_quartz", "redstone", "diamond", "emerald", "lapislazuli", "cassiterite", "quartz", "rocksalt", "platinum", "ilmenite", "nativesilver_quartz", "sphalerite", "bismuthinite", "chromite", "sylvite_rocksalt", "olivine", "peridot_olivine", "galena", "sulfur");
$variants = array();
$i = 0;
foreach ($rocktypes as $rocktype) {
    foreach ($oretypes as $oretype) {
        $oreandrocktype = "{$oretype}-{$rocktype}";
        $variants[] = "\t\t\"oreandrocktype={$oreandrocktype}\": { \"model\": \"vintagecraft:rawore/{$oreandrocktype}\"}";
        file_put_contents("models/block/rawore/" . $oreandrocktype . ".json", getBlockModel("rawore", $oreandrocktype));
        file_put_contents("models/item/rawore/" . $oreandrocktype . ".json", getItemModel("rawore", $oreandrocktype));
    }
}
$cnt = ceil(count($rocktypes) * count($oretypes) / 16);
while ($cnt-- > 0) {
    if ($cnt == 1) {
        $cnt = "";
    }
    file_put_contents("blockstates/rawore{$cnt}.json", getBlockStates($variants));
}
genOverlays();
function getBlockStates($variants)
{
    return '{
	"variants": {
' . implode(",\r\n", $variants) . '
	}
}';
}
示例#5
0
        "facing=west,in_wall=true,open=true,treetype=' . $blocktype . '":  { "model": "vintagecraft:fencegate/' . $blocktype . '_open", "y": 90, "uvlock": true },
        "facing=north,in_wall=true,open=true,treetype=' . $blocktype . '": { "model": "vintagecraft:fencegate/' . $blocktype . '_open", "y": 180, "uvlock": true },
        "facing=east,in_wall=true,open=true,treetype=' . $blocktype . '":  { "model": "vintagecraft:fencegate/' . $blocktype . '_open", "y": 270, "uvlock": true }';
}
for ($i = 0; $i < ceil(count($blocktypes) / 1); $i++) {
    file_put_contents("blockstates/" . $blockclass . ($i > 0 ? $i + 1 : "") . ".json", getBlockStates($variants));
}
/********** 4. Stairs *************/
$blockclass = "stairs";
$subtypes = array("normal", "outer", "inner");
$variants = array();
foreach ($blocktypes as $blocktype) {
    $blockoutdir = "models/block/{$blockclass}/";
    $itemoutdir = "models/item/{$blockclass}/";
    foreach ($subtypes as $subtype) {
        file_put_contents($blockoutdir . $blocktype . "_{$subtype}.json", getBlockModel($subtype, $blockclass, $blocktype));
    }
    file_put_contents($itemoutdir . $blocktype . ".json", getItemModel($blockclass, $blocktype . "_normal"));
    $variants[] = '        "facing=east,half=bottom,shape=straight,treetype=' . $blocktype . '":  { "model": "vintagecraft:stairs/' . $blocktype . '_normal" },
        "facing=west,half=bottom,shape=straight,treetype=' . $blocktype . '":  { "model": "vintagecraft:stairs/' . $blocktype . '_normal", "y": 180, "uvlock": true },
        "facing=south,half=bottom,shape=straight,treetype=' . $blocktype . '":  { "model": "vintagecraft:stairs/' . $blocktype . '_normal", "y": 90, "uvlock": true },
        "facing=north,half=bottom,shape=straight,treetype=' . $blocktype . '":  { "model": "vintagecraft:stairs/' . $blocktype . '_normal", "y": 270, "uvlock": true },
        "facing=east,half=bottom,shape=outer_right,treetype=' . $blocktype . '":  { "model": "vintagecraft:stairs/' . $blocktype . '_outer" },
        "facing=west,half=bottom,shape=outer_right,treetype=' . $blocktype . '":  { "model": "vintagecraft:stairs/' . $blocktype . '_outer", "y": 180, "uvlock": true },
        "facing=south,half=bottom,shape=outer_right,treetype=' . $blocktype . '":  { "model": "vintagecraft:stairs/' . $blocktype . '_outer", "y": 90, "uvlock": true },
        "facing=north,half=bottom,shape=outer_right,treetype=' . $blocktype . '":  { "model": "vintagecraft:stairs/' . $blocktype . '_outer", "y": 270, "uvlock": true },
        "facing=east,half=bottom,shape=outer_left,treetype=' . $blocktype . '":  { "model": "vintagecraft:stairs/' . $blocktype . '_outer", "y": 270, "uvlock": true },
        "facing=west,half=bottom,shape=outer_left,treetype=' . $blocktype . '":  { "model": "vintagecraft:stairs/' . $blocktype . '_outer", "y": 90, "uvlock": true },
        "facing=south,half=bottom,shape=outer_left,treetype=' . $blocktype . '":  { "model": "vintagecraft:stairs/' . $blocktype . '_outer" },
        "facing=north,half=bottom,shape=outer_left,treetype=' . $blocktype . '":  { "model": "vintagecraft:stairs/' . $blocktype . '_outer", "y": 180, "uvlock": true },
        "facing=east,half=bottom,shape=inner_right,treetype=' . $blocktype . '":  { "model": "vintagecraft:stairs/' . $blocktype . '_inner" },
示例#6
0
        $itemoutdir = "models/item/{$blockclass}/";
        $modeltype = "all";
        if ($blockclass == "subsoil") {
            foreach ($organiclayers as $organiclayer) {
                $variants[] = "\t\t" . '"rocktype=' . $organiclayer . '-' . $blocktype . '": { "model": "vintagecraft:' . $blockclass . '/' . $organiclayer . '-' . $blocktype . '" }';
                file_put_contents($blockoutdir . $organiclayer . "-" . $blocktype . ".json", getBlockModel($modeltype, $blockclass, $blocktype, $organiclayer));
                file_put_contents($itemoutdir . $organiclayer . "-" . $blocktype . ".json", getItemModel($blockclass, $blocktype, $organiclayer));
            }
        } elseif ($blockclass == "stoneanvil") {
            foreach ($anvilstages as $anvilstage) {
                $variants[] = "\t\t" . '"rocktype=' . $blocktype . ',stage=' . $anvilstage . '": { "model": "vintagecraft:' . $blockclass . '/' . $blocktype . '-' . $anvilstage . '" }';
                file_put_contents($blockoutdir . $blocktype . "-" . $anvilstage . ".json", getBlockModel($modeltype, $blockclass, $blocktype, $anvilstage));
            }
            file_put_contents($itemoutdir . $blocktype . ".json", getItemModel($blockclass, $blocktype . "-2"));
        } else {
            file_put_contents($blockoutdir . $blocktype . ".json", getBlockModel($modeltype, $blockclass, $blocktype));
            file_put_contents($itemoutdir . $blocktype . ".json", getItemModel($blockclass, $blocktype));
            $variants[] = "\t\t" . '"rocktype=' . $blocktype . '": { "model": "vintagecraft:' . $blockclass . '/' . $blocktype . '" }';
        }
    }
    for ($i = 0; $i < ceil(count($blocktypes) / $availtypes[$blockclass]); $i++) {
        file_put_contents("blockstates/" . $blockclass . ($i > 0 ? $i + 1 : "") . ".json", getBlockStates($variants));
    }
}
foreach ($itemclasses as $itemclass) {
    foreach ($blocktypes as $blocktype) {
        $itemoutdir = "models/item/{$itemclass}/";
        file_put_contents($itemoutdir . $blocktype . ".json", getItemModel($itemclass, $blocktype));
    }
}
function getBlockStates($variants)