This repository has been archived by the owner on Apr 22, 2019. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 347
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Bump Forge to 2125 and update MCP names
- Loading branch information
Showing
2 changed files
with
33 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
30 changes: 30 additions & 0 deletions
30
src/main/java/com/pahimar/ee3/block/BlockInfusedStoneSlab.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,10 +1,40 @@ | ||
package com.pahimar.ee3.block; | ||
|
||
import com.pahimar.ee3.block.base.BlockBase; | ||
import net.minecraft.block.properties.PropertyDirection; | ||
import net.minecraft.block.state.BlockStateContainer; | ||
import net.minecraft.block.state.IBlockState; | ||
import net.minecraft.entity.EntityLivingBase; | ||
import net.minecraft.util.EnumFacing; | ||
import net.minecraft.util.math.BlockPos; | ||
import net.minecraft.world.World; | ||
|
||
public class BlockInfusedStoneSlab extends BlockBase { | ||
|
||
public static final PropertyDirection FACING = PropertyDirection.create("facing"); | ||
|
||
public BlockInfusedStoneSlab() { | ||
super("infused_stone_slab"); | ||
setDefaultState(blockState.getBaseState().withProperty(FACING, EnumFacing.UP)); | ||
} | ||
|
||
@Override | ||
public IBlockState getStateFromMeta(int meta) { | ||
return getDefaultState().withProperty(FACING, EnumFacing.getFront(meta & 7)); | ||
} | ||
|
||
@Override | ||
public int getMetaFromState(IBlockState state) { | ||
return state.getValue(FACING).getIndex(); | ||
} | ||
|
||
@Override | ||
protected BlockStateContainer createBlockState() { | ||
return new BlockStateContainer(this, FACING); | ||
} | ||
|
||
@Override | ||
public IBlockState onBlockPlaced(World worldIn, BlockPos pos, EnumFacing facing, float hitX, float hitY, float hitZ, int meta, EntityLivingBase placer) { | ||
return this.getDefaultState().withProperty(FACING, facing); | ||
} | ||
} |