Skip to content

Commit

Permalink
Add materials for coarse dirt, podzol and mycelium, fixes #25
Browse files Browse the repository at this point in the history
  • Loading branch information
hea3ven committed Nov 28, 2015
1 parent 06a18d2 commit ebbb8aa
Show file tree
Hide file tree
Showing 5 changed files with 57 additions and 15 deletions.
1 change: 1 addition & 0 deletions CHANGELOG
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
* Add a portable ladder block.
* Add materials for coarse dirt, podzol and mycelium, fixes #25.
* Add compatibility for thaumcraft blocks.
* Add fence and fence gate block types.
* Add a GUI for the trowel when you shift-right click on the air, fixes #23.
Expand Down
Original file line number Diff line number Diff line change
@@ -1,12 +1,15 @@
package com.hea3ven.buildingbricks.core.materials.rendering;

import javax.vecmath.Vector3f;

import net.minecraft.block.BlockSlab;
import net.minecraft.block.state.IBlockState;
import net.minecraft.client.resources.model.ModelRotation;

import net.minecraftforge.client.model.IModel;
import net.minecraftforge.client.model.IModelState;
import net.minecraftforge.client.model.ModelLoader;
import net.minecraftforge.client.model.TRSRTransformation;
import net.minecraftforge.fml.relauncher.Side;
import net.minecraftforge.fml.relauncher.SideOnly;

Expand Down Expand Up @@ -51,23 +54,23 @@ public IModel getModel(IBlockState state, Material mat) {
public IModelState getModelState(IModelState modelState, IBlockState state) {
if (vertical) {
switch (BlockProperties.getSide(state)) {
default:
case NORTH:
modelState = ModelRotation.X0_Y0;
break;
case EAST:
modelState = ModelRotation.X0_Y90;
break;
case SOUTH:
modelState = ModelRotation.X0_Y180;
break;
case WEST:
modelState = ModelRotation.X0_Y270;
break;
default:
case NORTH:
modelState = ModelRotation.X0_Y0;
break;
case EAST:
modelState = ModelRotation.X0_Y90;
break;
case SOUTH:
modelState = ModelRotation.X0_Y180;
break;
case WEST:
modelState = ModelRotation.X0_Y270;
break;
}
} else {
modelState = BlockBuildingBricksSlab.getHalf(state) == BlockSlab.EnumBlockHalf.BOTTOM
? ModelRotation.X0_Y0 : ModelRotation.X180_Y0;
modelState = BlockBuildingBricksSlab.getHalf(state) == BlockSlab.EnumBlockHalf.BOTTOM ?
ModelRotation.X0_Y0 : new TRSRTransformation(new Vector3f(0, 0.5f, 0), null, null, null);
}
return super.getModelState(modelState, state);
}
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
{
"name": "Coarse",
"id": "buildingbrickscompatvanilla:dirt_coarse",
"type": "dirt",
"hardness": 0.5,
"textures": "minecraft:blocks/coarse_dirt",
"blocks": {
"full": { "id": "minecraft:dirt", "meta": 1 }
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
{
"name": "Mycelium",
"id": "buildingbrickscompatvanilla:dirt_mycelium",
"type": "dirt",
"hardness": 0.6,
"textures": {
"top": "minecraft:blocks/mycelium_top",
"side": "minecraft:blocks/mycelium_side",
"bottom": "minecraft:blocks/dirt"
},
"blocks": {
"full": "minecraft:mycelium"
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
{
"name": "Podzol",
"id": "buildingbrickscompatvanilla:dirt_podzol",
"type": "dirt",
"hardness": 0.5,
"textures": {
"top": "minecraft:blocks/dirt_podzol_top",
"side": "minecraft:blocks/dirt_podzol_side",
"bottom": "minecraft:blocks/dirt"
},
"blocks": {
"full": { "id": "minecraft:dirt", "meta": 2 }
}
}

0 comments on commit ebbb8aa

Please sign in to comment.