-
Notifications
You must be signed in to change notification settings - Fork 55
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #32 from mrquentin/main
Susy Facing Blockstate Interface and Gregtech Dryer
- Loading branch information
Showing
25 changed files
with
107 additions
and
102 deletions.
There are no files selected for viewing
35 changes: 35 additions & 0 deletions
35
src/main/java/supersymmetry/api/blocks/ISuSyHorizontalOrientable.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 |
---|---|---|
@@ -0,0 +1,35 @@ | ||
package supersymmetry.api.blocks; | ||
|
||
import net.minecraft.block.BlockHorizontal; | ||
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.item.ItemStack; | ||
import net.minecraft.util.EnumFacing; | ||
import net.minecraft.util.Mirror; | ||
import net.minecraft.util.Rotation; | ||
import net.minecraft.util.math.BlockPos; | ||
import net.minecraft.world.World; | ||
|
||
public interface ISuSyHorizontalOrientable { | ||
|
||
PropertyDirection FACING = BlockHorizontal.FACING; | ||
|
||
IBlockState getStateForPlacement(World worldIn, BlockPos pos, EnumFacing facing, float hitX, float hitY, float hitZ, int meta, EntityLivingBase placer); | ||
int getMetaFromState(IBlockState state); | ||
IBlockState getStateFromMeta(int meta); | ||
BlockStateContainer createBlockState(); | ||
|
||
default void onBlockPlacedBy(World worldIn, BlockPos pos, IBlockState state, EntityLivingBase placer, ItemStack stack) { | ||
worldIn.setBlockState(pos, state.withProperty(FACING, placer.getHorizontalFacing().getOpposite()), 2); | ||
} | ||
|
||
default IBlockState withRotation(IBlockState state, Rotation rot) { | ||
return state.withProperty(FACING, rot.rotate((EnumFacing) state.getValue(FACING))); | ||
} | ||
|
||
default IBlockState withMirror(IBlockState state, Mirror mirrorIn) { | ||
return state.withRotation(mirrorIn.toRotation((EnumFacing)state.getValue(FACING))); | ||
} | ||
} |
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
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
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
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
Oops, something went wrong.