Update forge and Sound options for Alarm (#1435)

* Update forge and Sound options for Alarm

* Revert changes to gradle wrapper properties

* Cleanup imports

* Removed sneaky debugging stuff
This commit is contained in:
Dimmerworld 2018-02-10 22:53:11 +11:00 committed by Modmuss50
parent 38933ca8a8
commit 9349ffe264
11 changed files with 90 additions and 7 deletions

View file

@ -30,6 +30,7 @@ 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.entity.player.EntityPlayer;
import net.minecraft.tileentity.TileEntity;
import net.minecraft.util.EnumBlockRenderType;
import net.minecraft.util.EnumFacing;
@ -81,6 +82,21 @@ public class BlockAlarm extends BaseTileBlock {
return new BlockStateContainer(this, FACING, ACTIVE);
}
@Override
public boolean onBlockActivated(World worldIn, BlockPos pos, IBlockState state, EntityPlayer playerIn, EnumHand hand, EnumFacing facing, float hitX, float hitY, float hitZ) {
TileAlarm tileEntity = (TileAlarm)worldIn.getTileEntity(pos);
if (tileEntity == null) {
return super.onBlockActivated(worldIn, pos, state, playerIn, hand, facing, hitX, hitY, hitZ);
}else {
if(!worldIn.isRemote) {
if(playerIn.isSneaking()) {
tileEntity.rightClick();
}
}
}
return true;
}
@Override
public int getMetaFromState(IBlockState state) {
int facingInt = state.getValue(FACING).getIndex();