pick 97420a31d The big reformat of 2020

This commit is contained in:
yueh
2020-06-16 21:41:28 +02:00
parent 5304b3febe
commit 5225ea426b
2252 changed files with 95466 additions and 118582 deletions
@@ -18,13 +18,12 @@
package appeng.block.spatial;
import java.util.Collections;
import java.util.List;
import net.minecraft.block.BlockRenderType;
import net.minecraft.block.material.Material;
import net.minecraft.block.BlockState;
import net.minecraft.block.material.Material;
import net.minecraft.block.material.MaterialColor;
import net.minecraft.block.material.PushReaction;
import net.minecraft.entity.Entity;
@@ -46,66 +45,64 @@ import net.minecraftforge.api.distmarker.OnlyIn;
import appeng.block.AEBaseBlock;
/**
* This block is used to fill empty space in spatial dimensions
* and delinates the border of a spatial dimensions's usable space.
* This block is used to fill empty space in spatial dimensions and delinates
* the border of a spatial dimensions's usable space.
*/
public class BlockMatrixFrame extends AEBaseBlock
{
public class BlockMatrixFrame extends AEBaseBlock {
private static final Material MATERIAL = new Material(MaterialColor.AIR, false, true, true, false, false, false, false, PushReaction.PUSH_ONLY);
private static final Material MATERIAL = new Material(MaterialColor.AIR, false, true, true, false, false, false,
false, PushReaction.PUSH_ONLY);
public BlockMatrixFrame()
{
super( Properties.create(MATERIAL).hardnessAndResistance(-1.0F, 6000000.0F).notSolid().noDrops() );
}
public BlockMatrixFrame() {
super(Properties.create(MATERIAL).hardnessAndResistance(-1.0F, 6000000.0F).notSolid().noDrops());
}
@Override
public BlockRenderType getRenderType(BlockState state) {
return BlockRenderType.INVISIBLE;
}
@Override
public BlockRenderType getRenderType(BlockState state) {
return BlockRenderType.INVISIBLE;
}
@Override
@OnlyIn( Dist.CLIENT )
public void fillItemGroup(ItemGroup group, NonNullList<ItemStack> itemStacks)
{
// do nothing
}
@Override
@OnlyIn(Dist.CLIENT)
public void fillItemGroup(ItemGroup group, NonNullList<ItemStack> itemStacks) {
// do nothing
}
@Override
public VoxelShape getCollisionShape(BlockState state, IBlockReader worldIn, BlockPos pos, ISelectionContext context) {
return VoxelShapes.fullCube();
}
@Override
public VoxelShape getCollisionShape(BlockState state, IBlockReader worldIn, BlockPos pos,
ISelectionContext context) {
return VoxelShapes.fullCube();
}
@Override
public VoxelShape getShape(BlockState state, IBlockReader worldIn, BlockPos pos, ISelectionContext context) {
// This also prevents any blocks from being placed on this block!
return VoxelShapes.empty();
}
@Override
public VoxelShape getShape(BlockState state, IBlockReader worldIn, BlockPos pos, ISelectionContext context) {
// This also prevents any blocks from being placed on this block!
return VoxelShapes.empty();
}
@Override
public boolean isValidPosition(BlockState state, IWorldReader worldIn, BlockPos pos) {
return false;
}
@Override
public boolean isValidPosition(BlockState state, IWorldReader worldIn, BlockPos pos) {
return false;
}
@Override
public void onExplosionDestroy( final World world, final BlockPos pos, final Explosion explosion )
{
// Don't explode.
}
@Override
public void onExplosionDestroy(final World world, final BlockPos pos, final Explosion explosion) {
// Don't explode.
}
@Override
public boolean propagatesSkylightDown(BlockState state, IBlockReader reader, BlockPos pos) {
return true;
}
@Override
public boolean propagatesSkylightDown(BlockState state, IBlockReader reader, BlockPos pos) {
return true;
}
@Override
public float getAmbientOcclusionLightValue(BlockState state, IBlockReader worldIn, BlockPos pos) {
return 1.0f;
}
@Override
public float getAmbientOcclusionLightValue(BlockState state, IBlockReader worldIn, BlockPos pos) {
return 1.0f;
}
@Override
public boolean canEntityDestroy( final BlockState state, final IBlockReader world, final BlockPos pos, final Entity entity )
{
return false;
}
@Override
public boolean canEntityDestroy(final BlockState state, final IBlockReader world, final BlockPos pos,
final Entity entity) {
return false;
}
}
@@ -18,16 +18,11 @@
package appeng.block.spatial;
import javax.annotation.Nullable;
import appeng.container.ContainerLocator;
import appeng.container.ContainerOpener;
import appeng.container.implementations.ContainerSpatialIOPort;
import appeng.fluids.container.ContainerFluidLevelEmitter;
import net.minecraft.block.Block;
import net.minecraft.block.material.Material;
import net.minecraft.block.BlockState;
import net.minecraft.block.material.Material;
import net.minecraft.entity.player.PlayerEntity;
import net.minecraft.item.ItemStack;
import net.minecraft.util.ActionResultType;
@@ -38,46 +33,43 @@ import net.minecraft.world.World;
import appeng.api.util.AEPartLocation;
import appeng.block.AEBaseTileBlock;
import appeng.container.ContainerLocator;
import appeng.container.ContainerOpener;
import appeng.container.implementations.ContainerSpatialIOPort;
import appeng.fluids.container.ContainerFluidLevelEmitter;
import appeng.tile.spatial.TileSpatialIOPort;
import appeng.util.Platform;
public class BlockSpatialIOPort extends AEBaseTileBlock<TileSpatialIOPort> {
public class BlockSpatialIOPort extends AEBaseTileBlock<TileSpatialIOPort>
{
public BlockSpatialIOPort() {
super(defaultProps(Material.IRON));
}
public BlockSpatialIOPort()
{
super( defaultProps(Material.IRON) );
}
@Override
public void neighborChanged(BlockState state, World world, BlockPos pos, Block blockIn, BlockPos fromPos,
boolean isMoving) {
final TileSpatialIOPort te = this.getTileEntity(world, pos);
if (te != null) {
te.updateRedstoneState();
}
}
@Override
public void neighborChanged( BlockState state, World world, BlockPos pos, Block blockIn, BlockPos fromPos, boolean isMoving )
{
final TileSpatialIOPort te = this.getTileEntity( world, pos );
if( te != null )
{
te.updateRedstoneState();
}
}
@Override
public ActionResultType onActivated(final World w, final BlockPos pos, final PlayerEntity p, final Hand hand,
final @Nullable ItemStack heldItem, final BlockRayTraceResult hit) {
if (p.isCrouching()) {
return ActionResultType.PASS;
}
@Override
public ActionResultType onActivated(final World w, final BlockPos pos, final PlayerEntity p, final Hand hand, final @Nullable ItemStack heldItem, final BlockRayTraceResult hit)
{
if( p.isCrouching() )
{
return ActionResultType.PASS;
}
final TileSpatialIOPort tg = this.getTileEntity( w, pos );
if( tg != null )
{
if( Platform.isServer() )
{
ContainerOpener.openContainer(ContainerSpatialIOPort.TYPE, p, ContainerLocator.forTileEntitySide(tg, hit.getFace()));
}
return ActionResultType.SUCCESS;
}
return ActionResultType.PASS;
}
final TileSpatialIOPort tg = this.getTileEntity(w, pos);
if (tg != null) {
if (Platform.isServer()) {
ContainerOpener.openContainer(ContainerSpatialIOPort.TYPE, p,
ContainerLocator.forTileEntitySide(tg, hit.getFace()));
}
return ActionResultType.SUCCESS;
}
return ActionResultType.PASS;
}
}
@@ -18,45 +18,38 @@
package appeng.block.spatial;
import appeng.block.AEBaseTileBlock;
import appeng.helpers.AEGlassMaterial;
import appeng.tile.spatial.TileSpatialPylon;
import net.minecraft.block.Block;
import net.minecraft.block.BlockState;
import net.minecraft.util.math.BlockPos;
import net.minecraft.world.IBlockReader;
import net.minecraft.world.World;
import appeng.block.AEBaseTileBlock;
import appeng.helpers.AEGlassMaterial;
import appeng.tile.spatial.TileSpatialPylon;
public class BlockSpatialPylon extends AEBaseTileBlock<TileSpatialPylon>
{
public class BlockSpatialPylon extends AEBaseTileBlock<TileSpatialPylon> {
public BlockSpatialPylon() {
super(defaultProps(AEGlassMaterial.INSTANCE));
}
public BlockSpatialPylon()
{
super( defaultProps(AEGlassMaterial.INSTANCE) );
}
@Override
public void neighborChanged(BlockState state, World world, BlockPos pos, Block blockIn, BlockPos fromPos,
boolean isMoving) {
final TileSpatialPylon tsp = this.getTileEntity(world, pos);
if (tsp != null) {
tsp.neighborChanged();
}
}
@Override
public void neighborChanged( BlockState state, World world, BlockPos pos, Block blockIn, BlockPos fromPos, boolean isMoving )
{
final TileSpatialPylon tsp = this.getTileEntity( world, pos );
if( tsp != null )
{
tsp.neighborChanged();
}
}
@Override
public int getLightValue( final BlockState state, final IBlockReader w, final BlockPos pos )
{
final TileSpatialPylon tsp = this.getTileEntity( w, pos );
if( tsp != null )
{
return tsp.getLightValue();
}
return super.getLightValue( state, w, pos );
}
@Override
public int getLightValue(final BlockState state, final IBlockReader w, final BlockPos pos) {
final TileSpatialPylon tsp = this.getTileEntity(w, pos);
if (tsp != null) {
return tsp.getLightValue();
}
return super.getLightValue(state, w, pos);
}
}