mirror of
https://github.com/GTNewHorizons/Botania.git
synced 2026-11-17 10:55:17 +00:00
Fix double flowers fully, a couple more models
This commit is contained in:
1 parent
8cda41cdb8
commit
e2ac5ecad1
15 files changed
+296
-109
No files matched your search
@@ -2,6 +2,8 @@ package vazkii.botania.api.state;
|
||||
|
||||
import com.google.common.base.Predicate;
|
||||
import com.google.common.base.Predicates;
|
||||
import net.minecraft.block.BlockRailBase;
|
||||
import net.minecraft.block.BlockRailPowered;
|
||||
import net.minecraft.block.BlockRotatedPillar;
|
||||
import net.minecraft.block.properties.PropertyBool;
|
||||
import net.minecraft.block.properties.PropertyEnum;
|
||||
@@ -96,6 +98,9 @@ public class BotaniaStateProps {
|
||||
// BlockForestDrum
|
||||
public static final PropertyEnum<DrumVariant> DRUM_VARIANT = PropertyEnum.create("variant", DrumVariant.class);
|
||||
|
||||
// BlockGhostRail
|
||||
public static final PropertyEnum<BlockRailBase.EnumRailDirection> RAIL_DIRECTION = BlockRailPowered.SHAPE;
|
||||
|
||||
// BlockLightRelay
|
||||
public static final PropertyEnum<LuminizerVariant> LUMINIZER_VARIANT = PropertyEnum.create("variant", LuminizerVariant.class);
|
||||
|
||||
|
||||
@@ -3,6 +3,7 @@ package vazkii.botania.client.core.handler;
|
||||
import com.google.common.collect.ImmutableList;
|
||||
import com.google.common.collect.Iterables;
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.block.BlockDoublePlant;
|
||||
import net.minecraft.block.BlockFlower;
|
||||
import net.minecraft.block.BlockRailPowered;
|
||||
import net.minecraft.block.BlockSlab;
|
||||
@@ -188,6 +189,10 @@ public final class ModelHandler {
|
||||
registerItemModel(ModBlocks.ghostRail);
|
||||
registerItemModel(ModBlocks.shimmerrock);
|
||||
registerItemModel(ModBlocks.shimmerwoodPlanks);
|
||||
registerItemModel(ModBlocks.manaVoid);
|
||||
registerItemModel(ModBlocks.alchemyCatalyst);
|
||||
registerItemModel(ModBlocks.conjurationCatalyst);
|
||||
registerItemModel(ModBlocks.reedBlock);
|
||||
|
||||
// Blocks which share models with their item, and have only one variant to switch over
|
||||
registerVariantsDefaulted(ModBlocks.altGrass, AltGrassVariant.class, "variant");
|
||||
@@ -196,6 +201,7 @@ public final class ModelHandler {
|
||||
registerVariantsDefaulted(ModBlocks.forestDrum, DrumVariant.class, "variant");
|
||||
registerVariantsDefaulted(ModBlocks.livingrock, LivingRockVariant.class, "variant");
|
||||
registerVariantsDefaulted(ModBlocks.livingwood, LivingWoodVariant.class, "variant");
|
||||
registerVariantsDefaulted(ModBlocks.dreamwood, LivingWoodVariant.class, "variant");
|
||||
registerVariantsDefaulted(ModFluffBlocks.stone, FutureStoneVariant.class, "variant");
|
||||
registerVariantsDefaulted(ModFluffBlocks.biomeStoneA, BiomeStoneVariant.class, "variant");
|
||||
registerVariantsDefaulted(ModFluffBlocks.biomeStoneB, BiomeBrickVariant.class, "variant");
|
||||
@@ -257,6 +263,10 @@ public final class ModelHandler {
|
||||
}
|
||||
|
||||
private static void registerStateMappers() {
|
||||
// Ignore vanilla facing, variant in double flower
|
||||
ModelLoader.setCustomStateMapper(ModBlocks.doubleFlower1, (new StateMap.Builder()).ignore(BlockDoublePlant.VARIANT, BlockDoublePlant.field_181084_N).build());
|
||||
ModelLoader.setCustomStateMapper(ModBlocks.doubleFlower2, (new StateMap.Builder()).ignore(BlockDoublePlant.VARIANT, BlockDoublePlant.field_181084_N).build());
|
||||
|
||||
// Ignore redstone power state in some blocks
|
||||
ModelLoader.setCustomStateMapper(ModBlocks.starfield, (new StateMap.Builder()).ignore(BotaniaStateProps.POWERED).build());
|
||||
|
||||
@@ -270,6 +280,9 @@ public final class ModelHandler {
|
||||
ModelLoader.setCustomStateMapper(ModBlocks.shinyFlower, (new StateMap.Builder()).ignore(((BlockFlower) ModBlocks.shinyFlower).getTypeProperty()).build());
|
||||
ModelLoader.setCustomStateMapper(ModBlocks.buriedPetals, (new StateMap.Builder()).ignore(((BlockFlower) ModBlocks.buriedPetals).getTypeProperty()).build());
|
||||
|
||||
// Ignore in special flower to suppress errors (handled in custom statemapper in BlockSpecialFlower
|
||||
ModelLoader.setCustomStateMapper(ModBlocks.specialFlower, (new StateMap.Builder()).ignore(BotaniaStateProps.COLOR, ((BlockFlower) ModBlocks.specialFlower).getTypeProperty()).build());
|
||||
|
||||
// Ignore vanilla variant in walls
|
||||
ModelLoader.setCustomStateMapper(ModFluffBlocks.biomeStoneWall, (new StateMap.Builder()).ignore(BlockWall.VARIANT).build());
|
||||
ModelLoader.setCustomStateMapper(ModFluffBlocks.dreamwoodWall, (new StateMap.Builder()).ignore(BlockWall.VARIANT).build());
|
||||
@@ -355,6 +368,22 @@ public final class ModelHandler {
|
||||
ModelLoader.registerItemVariants(item, new ModelResourceLocation(name, "inventory"));
|
||||
ModelLoader.setCustomModelResourceLocation(item, color.getMetadata(), new ModelResourceLocation(name, "inventory"));
|
||||
}
|
||||
|
||||
item = Item.getItemFromBlock(ModBlocks.doubleFlower1);
|
||||
for (EnumDyeColor color : BotaniaStateProps.DOUBLEFLOWER_VARIANT_1.getAllowedValues()) {
|
||||
String name = GameData.getBlockRegistry().getNameForObject(ModBlocks.doubleFlower1).toString();
|
||||
String variant = "inventory_" + color.getName();
|
||||
ModelLoader.registerItemVariants(item, new ModelResourceLocation(name, variant));
|
||||
ModelLoader.setCustomModelResourceLocation(item, color.getMetadata(), new ModelResourceLocation(name, variant));
|
||||
}
|
||||
|
||||
item = Item.getItemFromBlock(ModBlocks.doubleFlower2);
|
||||
for (EnumDyeColor color : BotaniaStateProps.DOUBLEFLOWER_VARIANT_2.getAllowedValues()) {
|
||||
String name = GameData.getBlockRegistry().getNameForObject(ModBlocks.doubleFlower2).toString();
|
||||
String variant = "inventory_" + color.getName();
|
||||
ModelLoader.registerItemVariants(item, new ModelResourceLocation(name, variant));
|
||||
ModelLoader.setCustomModelResourceLocation(item, color.getMetadata() - 8, new ModelResourceLocation(name, variant));
|
||||
}
|
||||
}
|
||||
|
||||
private static void registerPavement() {
|
||||
|
||||
@@ -26,6 +26,7 @@ import net.minecraftforge.common.MinecraftForge;
|
||||
import net.minecraftforge.event.entity.minecart.MinecartUpdateEvent;
|
||||
import vazkii.botania.api.lexicon.ILexiconable;
|
||||
import vazkii.botania.api.lexicon.LexiconEntry;
|
||||
import vazkii.botania.api.state.BotaniaStateProps;
|
||||
import vazkii.botania.client.core.helper.IconHelper;
|
||||
import vazkii.botania.common.core.BotaniaCreativeTab;
|
||||
import vazkii.botania.common.item.block.ItemBlockMod;
|
||||
@@ -38,7 +39,6 @@ import net.minecraftforge.fml.relauncher.SideOnly;
|
||||
|
||||
public class BlockGhostRail extends BlockRailBase implements ILexiconable {
|
||||
|
||||
public static final PropertyEnum<EnumRailDirection> SHAPE = BlockRailPowered.SHAPE;
|
||||
private static final String TAG_FLOAT_TICKS = "Botania_FloatTicks";
|
||||
|
||||
public BlockGhostRail() {
|
||||
@@ -46,22 +46,22 @@ public class BlockGhostRail extends BlockRailBase implements ILexiconable {
|
||||
setCreativeTab(BotaniaCreativeTab.INSTANCE);
|
||||
MinecraftForge.EVENT_BUS.register(this);
|
||||
setUnlocalizedName(LibBlockNames.GHOST_RAIL);
|
||||
setDefaultState(blockState.getBaseState().withProperty(SHAPE, EnumRailDirection.NORTH_SOUTH));
|
||||
setDefaultState(blockState.getBaseState().withProperty(BotaniaStateProps.RAIL_DIRECTION, EnumRailDirection.NORTH_SOUTH));
|
||||
}
|
||||
|
||||
@Override
|
||||
public BlockState createBlockState() {
|
||||
return new BlockState(this, SHAPE);
|
||||
return new BlockState(this, BotaniaStateProps.RAIL_DIRECTION);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getMetaFromState(IBlockState state) {
|
||||
return state.getValue(SHAPE).getMetadata();
|
||||
return state.getValue(BotaniaStateProps.RAIL_DIRECTION).getMetadata();
|
||||
}
|
||||
|
||||
@Override
|
||||
public IBlockState getStateFromMeta(int meta) {
|
||||
return getDefaultState().withProperty(SHAPE, EnumRailDirection.byMetadata(meta));
|
||||
return getDefaultState().withProperty(BotaniaStateProps.RAIL_DIRECTION, EnumRailDirection.byMetadata(meta));
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -10,6 +10,8 @@
|
||||
*/
|
||||
package vazkii.botania.common.block;
|
||||
|
||||
import com.google.common.collect.ImmutableList;
|
||||
import com.google.common.collect.Lists;
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.block.BlockBush;
|
||||
import net.minecraft.block.BlockDoublePlant;
|
||||
@@ -30,6 +32,7 @@ import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.stats.StatList;
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
import net.minecraft.util.BlockPos;
|
||||
import net.minecraft.util.EnumFacing;
|
||||
import net.minecraft.world.IBlockAccess;
|
||||
import net.minecraft.world.World;
|
||||
import net.minecraftforge.common.IShearable;
|
||||
@@ -50,15 +53,13 @@ import java.util.List;
|
||||
import java.util.Random;
|
||||
|
||||
// Lots of copy paste from BlockDoublePlant because we can no longer extend it in 1.8.x
|
||||
public abstract class BlockModDoubleFlower extends BlockBush implements IGrowable, IShearable, ILexiconable {
|
||||
public static final PropertyEnum<BlockDoublePlant.EnumBlockHalf> HALF = BlockDoublePlant.HALF;
|
||||
public abstract class BlockModDoubleFlower extends BlockDoublePlant implements ILexiconable {
|
||||
private static final int COUNT = 8;
|
||||
|
||||
final int offset;
|
||||
final boolean second;
|
||||
|
||||
public BlockModDoubleFlower(boolean second) {
|
||||
super(Material.vine);
|
||||
this.second = second;
|
||||
this.setHardness(0.0F);
|
||||
this.setStepSound(soundTypeGrass);
|
||||
@@ -93,7 +94,7 @@ public abstract class BlockModDoubleFlower extends BlockBush implements IGrowabl
|
||||
|
||||
@Override
|
||||
public int damageDropped(IBlockState state) {
|
||||
return getMetaFromState(state.withProperty(HALF, BlockDoublePlant.EnumBlockHalf.LOWER));
|
||||
return 0;
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -106,11 +107,6 @@ public abstract class BlockModDoubleFlower extends BlockBush implements IGrowabl
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void grow(World world, Random rand, BlockPos pos, IBlockState state) {
|
||||
// todo 1.8.8 drop
|
||||
}
|
||||
|
||||
@Override
|
||||
public void harvestBlock(World p_149636_1_, EntityPlayer p_149636_2_, BlockPos pos, IBlockState state, TileEntity te) {
|
||||
if(p_149636_1_.isRemote || p_149636_2_.getCurrentEquippedItem() == null || p_149636_2_.getCurrentEquippedItem().getItem() != Items.shears || state.getValue(HALF) == BlockDoublePlant.EnumBlockHalf.LOWER)
|
||||
@@ -185,7 +181,10 @@ public abstract class BlockModDoubleFlower extends BlockBush implements IGrowabl
|
||||
@Override
|
||||
public List<ItemStack> onSheared(ItemStack item, IBlockAccess world, BlockPos pos, int fortune) {
|
||||
ArrayList<ItemStack> ret = new ArrayList<ItemStack>();
|
||||
ret.add(new ItemStack(this, 1, getMetaFromState(world.getBlockState(pos).withProperty(HALF, BlockDoublePlant.EnumBlockHalf.LOWER))));
|
||||
if (world.getBlockState(pos.down()).getBlock() == this
|
||||
&& world.getBlockState(pos.down()).getValue(HALF) == EnumBlockHalf.LOWER) {
|
||||
ret.add(new ItemStack(this, 1, getMetaFromState(world.getBlockState(pos.down()))));
|
||||
}
|
||||
return ret;
|
||||
}
|
||||
|
||||
@@ -205,14 +204,9 @@ public abstract class BlockModDoubleFlower extends BlockBush implements IGrowabl
|
||||
p_149666_3_.add(new ItemStack(p_149666_1_, 1, i));
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getRenderType() {
|
||||
return LibRenderIDs.idDoubleFlower;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void randomDisplayTick(World par1World, BlockPos pos, IBlockState state, Random par5Random) {
|
||||
int hex = ((EnumDyeColor) state.getValue(second ? BotaniaStateProps.DOUBLEFLOWER_VARIANT_2 : BotaniaStateProps.DOUBLEFLOWER_VARIANT_1)).getMapColor().colorValue;
|
||||
int hex = state.getValue(second ? BotaniaStateProps.DOUBLEFLOWER_VARIANT_2 : BotaniaStateProps.DOUBLEFLOWER_VARIANT_1).getMapColor().colorValue;
|
||||
int r = (hex & 0xFF0000) >> 16;
|
||||
int g = (hex & 0xFF00) >> 8;
|
||||
int b = (hex & 0xFF);
|
||||
@@ -227,93 +221,18 @@ public abstract class BlockModDoubleFlower extends BlockBush implements IGrowabl
|
||||
return LexiconData.flowers;
|
||||
}
|
||||
|
||||
|
||||
|
||||
/** BEGIN COPY BlockDoublePlant **/
|
||||
|
||||
@Override
|
||||
public void setBlockBoundsBasedOnState(IBlockAccess worldIn, BlockPos pos)
|
||||
{
|
||||
this.setBlockBounds(0.0F, 0.0F, 0.0F, 1.0F, 1.0F, 1.0F);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean canPlaceBlockAt(World worldIn, BlockPos pos)
|
||||
{
|
||||
return super.canPlaceBlockAt(worldIn, pos) && worldIn.isAirBlock(pos.up());
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void checkAndDropBlock(World worldIn, BlockPos pos, IBlockState state)
|
||||
{
|
||||
if (!this.canBlockStay(worldIn, pos, state))
|
||||
{
|
||||
boolean flag = state.getValue(HALF) == BlockDoublePlant.EnumBlockHalf.UPPER;
|
||||
BlockPos blockpos = flag ? pos : pos.up();
|
||||
BlockPos blockpos1 = flag ? pos.down() : pos;
|
||||
Block block = (Block)(flag ? this : worldIn.getBlockState(blockpos).getBlock());
|
||||
Block block1 = (Block)(flag ? worldIn.getBlockState(blockpos1).getBlock() : this);
|
||||
|
||||
if (!flag) this.dropBlockAsItem(worldIn, pos, state, 0); //Forge move above the setting to air.
|
||||
|
||||
if (block == this)
|
||||
{
|
||||
worldIn.setBlockState(blockpos, Blocks.air.getDefaultState(), 2);
|
||||
}
|
||||
|
||||
if (block1 == this)
|
||||
{
|
||||
worldIn.setBlockState(blockpos1, Blocks.air.getDefaultState(), 3);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean canBlockStay(World worldIn, BlockPos pos, IBlockState state)
|
||||
{
|
||||
if (state.getBlock() != this) return super.canBlockStay(worldIn, pos, state); //Forge: This function is called during world gen and placement, before this block is set, so if we are not 'here' then assume it's the pre-check.
|
||||
if (state.getValue(HALF) == BlockDoublePlant.EnumBlockHalf.UPPER)
|
||||
{
|
||||
return worldIn.getBlockState(pos.down()).getBlock() == this;
|
||||
}
|
||||
else
|
||||
{
|
||||
IBlockState iblockstate = worldIn.getBlockState(pos.up());
|
||||
return iblockstate.getBlock() == this && super.canBlockStay(worldIn, pos, iblockstate);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onBlockPlacedBy(World worldIn, BlockPos pos, IBlockState state, EntityLivingBase placer, ItemStack stack)
|
||||
{
|
||||
worldIn.setBlockState(pos.up(), this.getDefaultState().withProperty(HALF, BlockDoublePlant.EnumBlockHalf.UPPER), 2);
|
||||
}
|
||||
|
||||
@Override
|
||||
public IBlockState getActualState(IBlockState state, IBlockAccess worldIn, BlockPos pos)
|
||||
{
|
||||
if (state.getValue(HALF) == BlockDoublePlant.EnumBlockHalf.UPPER)
|
||||
{
|
||||
public IBlockState getActualState(IBlockState state, IBlockAccess worldIn, BlockPos pos) {
|
||||
if (state.getValue(HALF) == BlockDoublePlant.EnumBlockHalf.UPPER) {
|
||||
IBlockState iblockstate = worldIn.getBlockState(pos.down());
|
||||
|
||||
if (iblockstate.getBlock() == this)
|
||||
{
|
||||
state = state.withProperty(BotaniaStateProps.COLOR, iblockstate.getValue(BotaniaStateProps.COLOR));
|
||||
if (iblockstate.getBlock() == this) {
|
||||
PropertyEnum<EnumDyeColor> prop = second ? BotaniaStateProps.DOUBLEFLOWER_VARIANT_2 : BotaniaStateProps.DOUBLEFLOWER_VARIANT_1;
|
||||
state = state.withProperty(prop, iblockstate.getValue(prop));
|
||||
}
|
||||
}
|
||||
|
||||
return state;
|
||||
return state.withProperty(VARIANT, EnumPlantType.SUNFLOWER).withProperty(field_181084_N, EnumFacing.SOUTH);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean removedByPlayer(World world, BlockPos pos, EntityPlayer player, boolean willHarvest)
|
||||
{
|
||||
//Forge: Break both parts on the client to prevent the top part flickering as default type for a few frames.
|
||||
IBlockState state = world.getBlockState(pos);
|
||||
if (state.getBlock() == this && state.getValue(HALF) == BlockDoublePlant.EnumBlockHalf.LOWER && world.getBlockState(pos.up()).getBlock() == this)
|
||||
world.setBlockToAir(pos.up());
|
||||
return world.setBlockToAir(pos);
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
@@ -4,23 +4,28 @@ import net.minecraft.block.BlockDoublePlant;
|
||||
import net.minecraft.block.state.BlockState;
|
||||
import net.minecraft.block.state.IBlockState;
|
||||
import net.minecraft.item.EnumDyeColor;
|
||||
import net.minecraft.util.EnumFacing;
|
||||
import vazkii.botania.api.state.BotaniaStateProps;
|
||||
|
||||
// White to Gray
|
||||
public class BlockModDoubleFlower1 extends BlockModDoubleFlower {
|
||||
public BlockModDoubleFlower1() {
|
||||
super(false);
|
||||
setDefaultState(blockState.getBaseState().withProperty(HALF, BlockDoublePlant.EnumBlockHalf.LOWER).withProperty(BotaniaStateProps.DOUBLEFLOWER_VARIANT_1, EnumDyeColor.WHITE));
|
||||
setDefaultState(blockState.getBaseState()
|
||||
.withProperty(field_181084_N, EnumFacing.SOUTH)
|
||||
.withProperty(VARIANT, EnumPlantType.SUNFLOWER)
|
||||
.withProperty(HALF, BlockDoublePlant.EnumBlockHalf.LOWER)
|
||||
.withProperty(BotaniaStateProps.DOUBLEFLOWER_VARIANT_1, EnumDyeColor.WHITE));
|
||||
}
|
||||
|
||||
@Override
|
||||
public BlockState createBlockState() {
|
||||
return new BlockState(this, HALF, BotaniaStateProps.DOUBLEFLOWER_VARIANT_1);
|
||||
return new BlockState(this, field_181084_N, VARIANT, HALF, BotaniaStateProps.DOUBLEFLOWER_VARIANT_1);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getMetaFromState(IBlockState state) {
|
||||
int meta = ((EnumDyeColor) state.getValue(BotaniaStateProps.DOUBLEFLOWER_VARIANT_1)).getMetadata();
|
||||
int meta = state.getValue(BotaniaStateProps.DOUBLEFLOWER_VARIANT_1).getMetadata();
|
||||
if (state.getValue(HALF) == BlockDoublePlant.EnumBlockHalf.UPPER) {
|
||||
meta |= 8;
|
||||
}
|
||||
|
||||
@@ -4,6 +4,7 @@ import net.minecraft.block.BlockDoublePlant;
|
||||
import net.minecraft.block.state.BlockState;
|
||||
import net.minecraft.block.state.IBlockState;
|
||||
import net.minecraft.item.EnumDyeColor;
|
||||
import net.minecraft.util.EnumFacing;
|
||||
import vazkii.botania.api.state.BotaniaStateProps;
|
||||
|
||||
// Silver to black
|
||||
@@ -11,17 +12,21 @@ public class BlockModDoubleFlower2 extends BlockModDoubleFlower {
|
||||
|
||||
public BlockModDoubleFlower2() {
|
||||
super(true);
|
||||
setDefaultState(blockState.getBaseState().withProperty(HALF, BlockDoublePlant.EnumBlockHalf.LOWER).withProperty(BotaniaStateProps.DOUBLEFLOWER_VARIANT_2, EnumDyeColor.SILVER));
|
||||
setDefaultState(blockState.getBaseState()
|
||||
.withProperty(field_181084_N, EnumFacing.SOUTH)
|
||||
.withProperty(VARIANT, EnumPlantType.SUNFLOWER)
|
||||
.withProperty(HALF, BlockDoublePlant.EnumBlockHalf.LOWER)
|
||||
.withProperty(BotaniaStateProps.DOUBLEFLOWER_VARIANT_2, EnumDyeColor.SILVER));
|
||||
}
|
||||
|
||||
@Override
|
||||
public BlockState createBlockState() {
|
||||
return new BlockState(this, HALF, BotaniaStateProps.DOUBLEFLOWER_VARIANT_2);
|
||||
return new BlockState(this, field_181084_N, VARIANT, HALF, BotaniaStateProps.DOUBLEFLOWER_VARIANT_2);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getMetaFromState(IBlockState state) {
|
||||
int meta = ((EnumDyeColor) state.getValue(BotaniaStateProps.DOUBLEFLOWER_VARIANT_2)).getMetadata() - 8;
|
||||
int meta = state.getValue(BotaniaStateProps.DOUBLEFLOWER_VARIANT_2).getMetadata() - 8;
|
||||
if (state.getValue(HALF) == BlockDoublePlant.EnumBlockHalf.UPPER) {
|
||||
meta |= 8;
|
||||
}
|
||||
|
||||
@@ -15,6 +15,7 @@ import net.minecraft.block.BlockRotatedPillar;
|
||||
import net.minecraft.block.material.Material;
|
||||
import net.minecraft.block.state.BlockState;
|
||||
import net.minecraft.block.state.IBlockState;
|
||||
import net.minecraft.entity.EntityLivingBase;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.util.BlockPos;
|
||||
@@ -47,7 +48,7 @@ public class BlockReeds extends BlockRotatedPillar implements ILexiconable {
|
||||
|
||||
@Override
|
||||
public int getMetaFromState(IBlockState state) {
|
||||
switch (((EnumFacing.Axis) state.getValue(BotaniaStateProps.AXIS_FACING))) {
|
||||
switch (state.getValue(BotaniaStateProps.AXIS_FACING)) {
|
||||
case Z: return 8;
|
||||
case X: return 4;
|
||||
case Y:
|
||||
@@ -67,6 +68,11 @@ public class BlockReeds extends BlockRotatedPillar implements ILexiconable {
|
||||
return getDefaultState().withProperty(BotaniaStateProps.AXIS_FACING, axis);
|
||||
}
|
||||
|
||||
@Override
|
||||
public IBlockState onBlockPlaced(World worldIn, BlockPos pos, EnumFacing facing, float hitX, float hitY, float hitZ, int meta, EntityLivingBase placer) {
|
||||
return getStateFromMeta(meta).withProperty(BotaniaStateProps.AXIS_FACING, facing.getAxis());
|
||||
}
|
||||
|
||||
@Override
|
||||
public Block setUnlocalizedName(String par1Str) {
|
||||
GameRegistry.registerBlock(this, ItemBlockMod.class, par1Str);
|
||||
|
||||
@@ -45,6 +45,11 @@ public class BlockManaVoid extends BlockModContainer implements ILexiconable, IP
|
||||
MinecraftForge.EVENT_BUS.register(this);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getRenderType() {
|
||||
return 3;
|
||||
}
|
||||
|
||||
@SubscribeEvent
|
||||
@SideOnly(Side.CLIENT)
|
||||
public void onTextureStitch(TextureStitchEvent.Pre evt) {
|
||||
|
||||
Reference in new issue
Block a user