Grindr, GUI, Container.

This commit is contained in:
Sebastian Hartte
2020-06-02 22:52:35 +02:00
parent cf9ab8a13b
commit 2de3a2ecee
65 changed files with 509 additions and 495 deletions
@@ -26,7 +26,7 @@ import net.minecraft.block.BlockState;
import net.minecraft.entity.player.PlayerEntity;
import net.minecraft.item.ItemStack;
import net.minecraft.util.ActionResultType;
import net.minecraft.util.EnumBlockRenderType;
import net.minecraft.util.BlockRenderType;
import net.minecraft.util.Hand;
import net.minecraft.util.math.BlockPos;
import net.minecraft.util.math.BlockRayTraceResult;
@@ -71,9 +71,9 @@ public class BlockInscriber extends AEBaseTileBlock
}
@Override
public EnumBlockRenderType getRenderType( BlockState state )
public BlockRenderType getRenderType( BlockState state )
{
return EnumBlockRenderType.MODEL;
return BlockRenderType.MODEL;
}
@Override
@@ -35,6 +35,7 @@ import net.minecraft.util.Direction;
import net.minecraft.util.math.AxisAlignedBB;
import net.minecraft.util.math.BlockPos;
import net.minecraft.world.IBlockReader;
import net.minecraft.world.IWorld;
import net.minecraft.world.IWorldReader;
import net.minecraft.world.World;
import net.minecraftforge.api.distmarker.Dist;
@@ -116,7 +117,7 @@ public class BlockLightDetector extends AEBaseTileBlock implements IOrientableBl
}
@Override
public boolean isValidOrientation( final World w, final BlockPos pos, final Direction forward, final Direction up )
public boolean isValidOrientation(final IWorld w, final BlockPos pos, final Direction forward, final Direction up )
{
return this.canPlaceAt( w, pos, up.getOpposite() );
}
@@ -148,7 +149,7 @@ public class BlockLightDetector extends AEBaseTileBlock implements IOrientableBl
}
@Override
public void neighborChanged( BlockState state, World world, BlockPos pos, Block blockIn, BlockPos fromPos )
public void neighborChanged( BlockState state, World world, BlockPos pos, Block blockIn, BlockPos fromPos, boolean isMoving )
{
final Direction up = this.getOrientable( world, pos ).getUp();
if( !this.canPlaceAt( world, pos, up.getOpposite() ) )
@@ -125,11 +125,12 @@ public class BlockQuartzFixture extends AEBaseBlock implements IOrientableBlock
return state;
}
// FIXME @Override
// FIXME public boolean isValidOrientation( final World w, final BlockPos pos, final Direction forward, final Direction up )
// FIXME {
// FIXME return this.canPlaceAt( w, pos, up.getOpposite() );
// FIXME }
@Override
public boolean isValidOrientation( final IWorld w, final BlockPos pos, final Direction forward, final Direction up )
{
// FIXME: I think this entire method -> not required, but not sure... are quartz fixtures rotateable???
return this.canPlaceAt( w, pos, up.getOpposite() );
}
private boolean canPlaceAt( final IWorldReader w, final BlockPos pos, final Direction dir )
{
@@ -172,16 +173,16 @@ public class BlockQuartzFixture extends AEBaseBlock implements IOrientableBlock
}
// FIXME: Replaced by the postPlaceupdate stuff above, but check item drops!
// @Override
// public void neighborChanged( BlockState state, World world, BlockPos pos, Block blockIn, BlockPos fromPos )
// {
// final Direction up = this.getOrientable( world, pos ).getUp();
// if( !this.canPlaceAt( world, pos, up.getOpposite() ) )
// {
// this.dropTorch( world, pos );
// }
// }
//
@Override
public void neighborChanged( BlockState state, World world, BlockPos pos, Block blockIn, BlockPos fromPos, boolean isMoving )
{
final Direction up = this.getOrientable( world, pos ).getUp();
if( !this.canPlaceAt( world, pos, up.getOpposite() ) )
{
this.dropTorch( world, pos );
}
}
private void dropTorch( final World w, final BlockPos pos )
{
final BlockState prev = w.getBlockState( pos );
@@ -27,10 +27,11 @@ import net.minecraft.block.material.Material;
import net.minecraft.block.BlockStateContainer;
import net.minecraft.block.BlockState;
import net.minecraft.entity.Entity;
import net.minecraft.util.EnumBlockRenderType;
import net.minecraft.util.BlockRenderType;
import net.minecraft.util.Direction;
import net.minecraft.util.math.AxisAlignedBB;
import net.minecraft.util.math.BlockPos;
import net.minecraft.world.IWorld;
import net.minecraft.world.IWorldReader;
import net.minecraft.world.World;
import net.minecraftforge.common.property.ExtendedBlockState;
@@ -63,7 +64,7 @@ public class BlockSkyCompass extends AEBaseTileBlock implements ICustomCollision
}
@Override
public boolean isValidOrientation( final World w, final BlockPos pos, final Direction forward, final Direction up )
public boolean isValidOrientation(final IWorld w, final BlockPos pos, final Direction forward, final Direction up )
{
final TileSkyCompass sc = this.getTileEntity( w, pos );
if( sc != null )
@@ -79,7 +80,7 @@ public class BlockSkyCompass extends AEBaseTileBlock implements ICustomCollision
}
@Override
public void neighborChanged( BlockState state, World world, BlockPos pos, Block blockIn, BlockPos fromPos )
public void neighborChanged( BlockState state, World world, BlockPos pos, Block blockIn, BlockPos fromPos, boolean isMoving )
{
final TileSkyCompass sc = this.getTileEntity( world, pos );
final Direction forward = sc.getForward();
@@ -178,9 +179,9 @@ public class BlockSkyCompass extends AEBaseTileBlock implements ICustomCollision
}
@Override
public EnumBlockRenderType getRenderType( BlockState state )
public BlockRenderType getRenderType( BlockState state )
{
return EnumBlockRenderType.ENTITYBLOCK_ANIMATED;
return BlockRenderType.ENTITYBLOCK_ANIMATED;
}
@Override
@@ -101,7 +101,7 @@ public class BlockTinyTNT extends AEBaseBlock implements ICustomCollision
}
@Override
public void neighborChanged( BlockState state, World world, BlockPos pos, Block blockIn, BlockPos fromPos )
public void neighborChanged( BlockState state, World world, BlockPos pos, Block blockIn, BlockPos fromPos, boolean isMoving )
{
if( world.isBlockIndirectlyGettingPowered( pos ) > 0 )
{