mirror of
https://github.com/Thorfusion/Mekanism-Community-Edition.git
synced 2026-11-28 07:36:01 +00:00
Fix salt texture, start on plastic fence render
This commit is contained in:
1 parent
01a03ecbcf
commit
115443f5f9
15 files changed
+126
-29
No files matched your search
@@ -1,11 +1,15 @@
|
||||
package mekanism.common.block;
|
||||
|
||||
import static mekanism.common.block.states.BlockStatePlastic.colorProperty;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import mekanism.api.EnumColor;
|
||||
import mekanism.common.Mekanism;
|
||||
import net.minecraft.block.BlockFence;
|
||||
import net.minecraft.block.material.Material;
|
||||
import net.minecraft.block.properties.IProperty;
|
||||
import net.minecraft.block.state.BlockState;
|
||||
import net.minecraft.block.state.IBlockState;
|
||||
import net.minecraft.creativetab.CreativeTabs;
|
||||
import net.minecraft.item.EnumDyeColor;
|
||||
@@ -13,8 +17,6 @@ import net.minecraft.item.Item;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.util.BlockPos;
|
||||
import net.minecraft.world.IBlockAccess;
|
||||
import net.minecraft.world.World;
|
||||
import net.minecraft.util.EnumFacing;
|
||||
import net.minecraftforge.fml.relauncher.Side;
|
||||
import net.minecraftforge.fml.relauncher.SideOnly;
|
||||
|
||||
@@ -25,6 +27,25 @@ public class BlockPlasticFence extends BlockFence
|
||||
super(Material.clay);
|
||||
setCreativeTab(Mekanism.tabMekanism);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected BlockState createBlockState()
|
||||
{
|
||||
return new BlockState(this, new IProperty[] {NORTH, EAST, WEST, SOUTH, colorProperty});
|
||||
}
|
||||
|
||||
@Override
|
||||
public IBlockState getStateFromMeta(int meta)
|
||||
{
|
||||
return this.getDefaultState().withProperty(NORTH, false).withProperty(EAST, false)
|
||||
.withProperty(WEST, false).withProperty(SOUTH, false).withProperty(colorProperty, EnumDyeColor.byMetadata(meta));
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getMetaFromState(IBlockState state)
|
||||
{
|
||||
return state.getValue(colorProperty).getMetadata();
|
||||
}
|
||||
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
@@ -45,9 +66,8 @@ public class BlockPlasticFence extends BlockFence
|
||||
@Override
|
||||
public int getRenderColor(IBlockState state)
|
||||
{
|
||||
EnumColor colour = EnumColor.DYES[getMetaFromState(state)];
|
||||
EnumColor colour = EnumColor.AQUA;
|
||||
return (int)(colour.getColor(0)*255) << 16 | (int)(colour.getColor(1)*255) << 8 | (int)(colour.getColor(2)*255);
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
Reference in new issue
Block a user