mirror of
https://github.com/Thorfusion/Mekanism-Community-Edition.git
synced 2026-11-22 12:59:41 +00:00
Cardboard Box block states and render
This commit is contained in:
1 parent
13893bd705
commit
4ecde79334
6 files changed
+94
-72
No files matched your search
@@ -0,0 +1,31 @@
|
||||
package mekanism.common.block.states;
|
||||
|
||||
import mekanism.common.block.BlockCardboardBox;
|
||||
import net.minecraft.block.properties.PropertyBool;
|
||||
import net.minecraft.block.state.BlockState;
|
||||
import net.minecraft.block.state.IBlockState;
|
||||
import net.minecraft.client.renderer.block.statemap.StateMapperBase;
|
||||
import net.minecraft.client.resources.model.ModelResourceLocation;
|
||||
import net.minecraft.util.ResourceLocation;
|
||||
|
||||
public class BlockStateCardboardBox extends BlockState
|
||||
{
|
||||
public static PropertyBool storageProperty = PropertyBool.create("storage");
|
||||
|
||||
public BlockStateCardboardBox(BlockCardboardBox block)
|
||||
{
|
||||
super(block, storageProperty);
|
||||
}
|
||||
|
||||
public static class CardboardBoxStateMapper extends StateMapperBase
|
||||
{
|
||||
@Override
|
||||
protected ModelResourceLocation getModelResourceLocation(IBlockState state)
|
||||
{
|
||||
String property = "storage=" + state.getValue(storageProperty);
|
||||
|
||||
ResourceLocation baseLocation = new ResourceLocation("mekanism", "CardboardBox");
|
||||
return new ModelResourceLocation(baseLocation, property);
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user