Skip to content
This repository has been archived by the owner on Mar 9, 2024. It is now read-only.

Commit

Permalink
Fixing all the models.
Browse files Browse the repository at this point in the history
Everything finally works properly in both gui and third person.

Stairs suck...
  • Loading branch information
renevo committed Mar 9, 2016
1 parent 097cd19 commit 619e6e9
Show file tree
Hide file tree
Showing 11 changed files with 56 additions and 48 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@
import net.minecraft.client.resources.model.ModelResourceLocation;
import net.minecraft.item.Item;
import net.minecraft.item.ItemBlock;
import net.minecraft.item.ItemSlab;
import net.minecraft.util.ResourceLocation;
import net.minecraftforge.client.event.ModelBakeEvent;
import net.minecraftforge.client.model.IFlexibleBakedModel;
Expand Down Expand Up @@ -39,7 +38,7 @@ public void onBake(ModelBakeEvent event) {
}
// only item blocks that use this class
Object o = Item.itemRegistry.getObject(identifier);
if(!(o instanceof ItemBlock)) {
if(!(o instanceof ItemBlockMeta)) {
continue;
}
ItemBlock item = (ItemBlock) o;
Expand Down Expand Up @@ -75,7 +74,7 @@ public void onBake(ModelBakeEvent event) {
IFlexibleBakedModel bakedBlockModel = (IFlexibleBakedModel) event.modelRegistry.getObject(blockLoc);
if(bakedBlockModel != null) {
bakedBlockModel = new BlockItemModelWrapper(bakedBlockModel);
event.modelRegistry.putObject(blockLoc, bakedBlockModel);
//event.modelRegistry.putObject(blockLoc, bakedBlockModel);

if(first) {
// silence the error
Expand Down
12 changes: 6 additions & 6 deletions src/main/java/com/renevo/nethercore/common/ClientProxy.java
Original file line number Diff line number Diff line change
Expand Up @@ -37,14 +37,14 @@ public void registerModels() {

// individual items
Item itemToAdd;
/*

// stairs
itemToAdd = Item.getItemFromBlock(NetherCoreBlocks.blockNetherStoneStairs);
ModelLoader.setCustomModelResourceLocation(itemToAdd, 0, new ModelResourceLocation(Util.getResource("stairs_stone"), "facing=west,half=bottom,shape=straight"));
ModelLoader.setCustomModelResourceLocation(itemToAdd, 0, new ModelResourceLocation(Util.getResource("stairs_stone"), "inventory"));
itemToAdd = Item.getItemFromBlock(NetherCoreBlocks.blockNetherStoneBrickStairs);
ModelLoader.setCustomModelResourceLocation(itemToAdd, 0, new ModelResourceLocation(Util.getResource("stairs_stone_brick"), "facing=west,half=bottom,shape=straight"));
ModelLoader.setCustomModelResourceLocation(itemToAdd, 0, new ModelResourceLocation(Util.getResource("stairs_stone_brick"), "inventory"));
itemToAdd = Item.getItemFromBlock(NetherCoreBlocks.blockNetherStoneCobbleStairs);
ModelLoader.setCustomModelResourceLocation(itemToAdd, 0, new ModelResourceLocation(Util.getResource("stairs_stone_cobble"), "facing=west,half=bottom,shape=straight"));
ModelLoader.setCustomModelResourceLocation(itemToAdd, 0, new ModelResourceLocation(Util.getResource("stairs_stone_cobble"), "inventory"));

// slabs
itemToAdd = Item.getItemFromBlock(NetherCoreBlocks.blockNetherHalfSlab);
Expand All @@ -54,8 +54,8 @@ public void registerModels() {

// grass
itemToAdd = Item.getItemFromBlock(NetherCoreBlocks.blockNetherGrass);
ModelLoader.setCustomModelResourceLocation(itemToAdd, 0, new ModelResourceLocation(Util.getResource("nether_grass"), "burning=false"));
*/
ModelLoader.setCustomModelResourceLocation(itemToAdd, 0, new ModelResourceLocation(Util.getResource("nether_grass"), "inventory"));


// items
itemToAdd = NetherCoreItems.netherSpore;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@ public String getUnlocalizedName(ItemStack stack) {
return super.getUnlocalizedName(stack) + "." + name;
}

@SuppressWarnings("unchecked")
public static void setMappingProperty(Block block, IProperty<?> property) {
((ItemBlockMeta) Item.getItemFromBlock(block)).mappingProperty = property;
}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
{
"forge_marker": 1,
"defaults": {
"transform": "forge:default-block",
"textures": {
"particle": "minecraft:blocks/netherrack",
"bottom": "minecraft:blocks/netherrack",
Expand All @@ -11,6 +12,7 @@
"model": "grass_normal"
},
"variants": {
"inventory": [{}],
"burning=false": [
{ "model": "grass_normal" },
{ "model": "grass_normal", "y": 90 },
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
{
"forge_marker": 1,
"defaults": {
"transform": "forge:default-block",
"model": "minecraft:cube_all",
"textures": {
"all": "nethercore:blocks/nether_stone"
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
{
"forge_marker": 1,
"defaults": {
"transform": "forge:default-block",
"model": "half_slab",
"textures": {
"bottom": "nethercore:blocks/nether_stone",
Expand Down
14 changes: 14 additions & 0 deletions src/main/resources/assets/nethercore/blockstates/stairs_stone.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
{
"forge_marker": 1,
"defaults": {
"transform": "forge:default-block",
"model": "stairs",
"textures": {
"bottom": "nethercore:blocks/nether_stone",
Expand All @@ -10,6 +11,19 @@
"uvlock": true
},
"variants": {
"inventory": [{
"model": "stairs",
"transform": {
"thirdperson": {
"rotation": [ -0.37275863, -0.113441154, 0.9197686, 0.046988916 ],
"translation": [ 0, 0.09375, -0.171875 ],
"scale": [ 0.375, 0.375, 0.375 ]
},
"gui": {
"rotation": [ 0, 180, 0, 0 ]
}
}
}],
"facing=east,half=bottom,shape=straight": {
"model": "stairs"
},
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
{
"forge_marker": 1,
"defaults": {
"transform": "forge:default-block",
"model": "stairs",
"textures": {
"bottom": "nethercore:blocks/nether_stone_brick",
Expand All @@ -10,6 +11,19 @@
"uvlock": true
},
"variants": {
"inventory": [{
"model": "stairs",
"transform": {
"thirdperson": {
"rotation": [ -0.37275863, -0.113441154, 0.9197686, 0.046988916 ],
"translation": [ 0, 0.09375, -0.171875 ],
"scale": [ 0.375, 0.375, 0.375 ]
},
"gui": {
"rotation": [ 0, 180, 0, 0 ]
}
}
}],
"facing=east,half=bottom,shape=straight": {
"model": "stairs"
},
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
{
"forge_marker": 1,
"defaults": {
"transform": "forge:default-block",
"model": "stairs",
"textures": {
"bottom": "nethercore:blocks/nether_stone_cobble",
Expand All @@ -10,6 +11,19 @@
"uvlock": true
},
"variants": {
"inventory": [{
"model": "stairs",
"transform": {
"thirdperson": {
"rotation": [ -0.37275863, -0.113441154, 0.9197686, 0.046988916 ],
"translation": [ 0, 0.09375, -0.171875 ],
"scale": [ 0.375, 0.375, 0.375 ]
},
"gui": {
"rotation": [ 0, 180, 0, 0 ]
}
}
}],
"facing=east,half=bottom,shape=straight": {
"model": "stairs"
},
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
{
"forge_marker": 1,
"defaults": {
"transform": "forge:default-block",
"model": "minecraft:wall_post",
"textures": {
"wall": "nethercore:blocks/nether_stone_cobble"
Expand Down
39 changes: 0 additions & 39 deletions src/main/resources/assets/nethercore/models/item/defaultitem.json

This file was deleted.

0 comments on commit 619e6e9

Please sign in to comment.