A good bit of work

- Fixed infuse sprites
- Fixed liquid sprites
- Fixed Plastic Fence block states
- got Plastic Fence to render in block form
This commit is contained in:
aidancbrady committed 2016-05-04 23:37:21 -04:00
1 parent 115443f5f9
commit 13893bd705
24 files changed
+474 -88

No files matched your search

@@ -11,11 +11,14 @@ 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.client.renderer.block.statemap.StateMapperBase;
import net.minecraft.client.resources.model.ModelResourceLocation;
import net.minecraft.creativetab.CreativeTabs;
import net.minecraft.item.EnumDyeColor;
import net.minecraft.item.Item;
import net.minecraft.item.ItemStack;
import net.minecraft.util.BlockPos;
import net.minecraft.util.ResourceLocation;
import net.minecraft.world.IBlockAccess;
import net.minecraftforge.fml.relauncher.Side;
import net.minecraftforge.fml.relauncher.SideOnly;
@@ -37,8 +40,7 @@ public class BlockPlasticFence extends BlockFence
@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));
return this.getDefaultState().withProperty(colorProperty, EnumDyeColor.byMetadata(meta));
}
@Override
@@ -66,8 +68,10 @@ public class BlockPlasticFence extends BlockFence
@Override
public int getRenderColor(IBlockState state)
{
EnumColor colour = EnumColor.AQUA;
return (int)(colour.getColor(0)*255) << 16 | (int)(colour.getColor(1)*255) << 8 | (int)(colour.getColor(2)*255);
EnumDyeColor color = state.getValue(colorProperty);
EnumColor dye = EnumColor.DYES[color.getDyeDamage()];
return (int)(dye.getColor(0)*255) << 16 | (int)(dye.getColor(1)*255) << 8 | (int)(dye.getColor(2)*255);
}
@Override
@@ -75,4 +79,18 @@ public class BlockPlasticFence extends BlockFence
{
return getMetaFromState(state);
}
public static class PlasticFenceStateMapper extends StateMapperBase
{
@Override
protected ModelResourceLocation getModelResourceLocation(IBlockState state)
{
String properties = "east=" + state.getValue(EAST) + ",";
properties += "north=" + state.getValue(NORTH) + ",";
properties += "south=" + state.getValue(SOUTH) + ",";
properties += "west=" + state.getValue(WEST);
ResourceLocation baseLocation = new ResourceLocation("mekanism", "PlasticFence");
return new ModelResourceLocation(baseLocation, properties);
}
}
}