Add block with custom model

This commit is contained in:
pjht 2018-02-09 17:45:51 -06:00
parent 2761f264f7
commit 5c192d9e19
5 changed files with 134 additions and 2 deletions

View File

@ -0,0 +1,24 @@
package com.pjht.ssspcore.block;
import net.minecraft.block.material.Material;
import net.minecraft.block.state.IBlockState;
public class BlockPedestal extends BlockBase {
public BlockPedestal() {
super(Material.ROCK, "pedestal");
}
@Override
@Deprecated
public boolean isOpaqueCube(IBlockState state) {
return false;
}
@Override
@Deprecated
public boolean isFullCube(IBlockState state) {
return false;
}
}

View File

@ -6,20 +6,24 @@ import net.minecraftforge.registries.IForgeRegistry;
public class ModBlocks {
public static BlockOre oreCopper = new BlockOre("ore_copper","oreCopper");
public static BlockPedestal pedestal = new BlockPedestal();
public static void register(IForgeRegistry<Block> registry) {
registry.registerAll(
oreCopper
oreCopper,
pedestal
);
}
public static void registerItemBlocks(IForgeRegistry<Item> registry) {
registry.registerAll(
oreCopper.createItemBlock()
oreCopper.createItemBlock(),
pedestal.createItemBlock()
);
}
public static void registerItemModels() {
oreCopper.registerItemModel(Item.getItemFromBlock(oreCopper));
pedestal.registerItemModel(Item.getItemFromBlock(pedestal));
}
}

View File

@ -0,0 +1,12 @@
{
"forge_marker": 1,
"variants": {
"normal": {
"model": "ssspcore:pedestal"
},
"inventory": {
"model": "ssspcore:pedestal",
"transform": "forge:default-block"
}
}
}

View File

@ -3,6 +3,7 @@ item.ingot_copper.name=Copper Ingot
# Blocks
tile.ore_copper.name=Copper Ore
tile.pedestal.name=Pedestal
#Creative Tabs
itemGroup.ssspcore=SSSP Core

View File

@ -0,0 +1,91 @@
{
"textures": {
"pedestal": "blocks/stonebrick",
"particle": "blocks/stonebrick"
},
"elements": [
{
"from": [3, 0, 3],
"to": [13, 11, 13],
"faces": {
"down": {
"uv": [0, 0, 10, 10],
"texture": "#pedestal",
"cullface": "down"
},
"north": {
"uv": [0, 0, 10, 11],
"texture": "#pedestal"
},
"south": {
"uv": [0, 0, 10, 11],
"texture": "#pedestal"
},
"west": {
"uv": [0, 0, 10, 11],
"texture": "#pedestal"
},
"east": {
"uv": [0, 0, 10, 11],
"texture": "#pedestal"
}
}
},
{
"from": [2, 11, 2],
"to": [14, 12, 14],
"faces": {
"down": {
"uv": [0, 0, 12, 12],
"texture": "#pedestal"
},
"north": {
"uv": [0, 0, 12, 1],
"texture": "#pedestal"
},
"south": {
"uv": [0, 0, 12, 1],
"texture": "#pedestal"
},
"west": {
"uv": [0, 0, 12, 1],
"texture": "#pedestal"
},
"east": {
"uv": [0, 0, 12, 1],
"texture": "#pedestal"
}
}
},
{
"from": [1, 12, 1],
"to": [15, 13, 15],
"faces": {
"down": {
"uv": [0, 0, 14, 14],
"texture": "#pedestal"
},
"up": {
"uv": [0, 0, 14, 14],
"texture": "#pedestal"
},
"north": {
"uv": [0, 0, 14, 1],
"texture": "#pedestal"
},
"south": {
"uv": [0, 0, 14, 1],
"texture": "#pedestal"
},
"west": {
"uv": [0, 0, 14, 1],
"texture": "#pedestal"
},
"east": {
"uv": [0, 0, 14, 1],
"texture": "#pedestal"
}
}
}
]
}