From d8a224e0faabec9da37cb3622ddd4b3ead6167a9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Emmanuel=20Beno=C3=AEt?= Date: Thu, 7 Jul 2016 14:06:53 +0200 Subject: [PATCH] Throne - Missing rotation methods --- TODO.txt | 1 - src/java/mmm/deco/DThroneBlock.java | 16 ++++++++++++++++ 2 files changed, 16 insertions(+), 1 deletion(-) diff --git a/TODO.txt b/TODO.txt index 1780ba1..e895a7b 100644 --- a/TODO.txt +++ b/TODO.txt @@ -1,7 +1,6 @@ Part ASM? Description ------------------------------------------------------------------------------------------------------- deco No Armchairs -deco No Thrones deco No Copper pots deco No Copper plates deco No Lanterns diff --git a/src/java/mmm/deco/DThroneBlock.java b/src/java/mmm/deco/DThroneBlock.java index dc54e1a..a5e5da1 100644 --- a/src/java/mmm/deco/DThroneBlock.java +++ b/src/java/mmm/deco/DThroneBlock.java @@ -32,6 +32,8 @@ import net.minecraft.tileentity.TileEntity; import net.minecraft.util.BlockRenderLayer; import net.minecraft.util.EnumFacing; import net.minecraft.util.EnumHand; +import net.minecraft.util.Mirror; +import net.minecraft.util.Rotation; import net.minecraft.util.math.AxisAlignedBB; import net.minecraft.util.math.BlockPos; import net.minecraft.util.math.RayTraceResult; @@ -202,6 +204,20 @@ public class DThroneBlock } + @Override + public IBlockState withRotation( final IBlockState state , final Rotation rot ) + { + return state.withProperty( DThroneBlock.FACING , rot.rotate( state.getValue( DThroneBlock.FACING ) ) ); + } + + + @Override + public IBlockState withMirror( final IBlockState state , final Mirror mirrorIn ) + { + return state.withRotation( mirrorIn.toRotation( state.getValue( DThroneBlock.FACING ) ) ); + } + + // ************************************************************************************************* // BLOCK PLACEMENT // *************************************************************************************************