reformatted all src files (#141)

This commit is contained in:
YoungOnion
2022-09-17 05:08:02 -06:00
committed by GitHub
parent 3328bfcda2
commit 9011273229
1056 changed files with 88127 additions and 110597 deletions
@@ -19,8 +19,12 @@
package appeng.block.storage;
import javax.annotation.Nullable;
import appeng.api.util.AEPartLocation;
import appeng.block.AEBaseTileBlock;
import appeng.client.UnlistedProperty;
import appeng.core.sync.GuiBridge;
import appeng.tile.storage.TileDrive;
import appeng.util.Platform;
import net.minecraft.block.material.Material;
import net.minecraft.block.state.BlockStateContainer;
import net.minecraft.block.state.IBlockState;
@@ -36,65 +40,51 @@ import net.minecraftforge.common.property.ExtendedBlockState;
import net.minecraftforge.common.property.IExtendedBlockState;
import net.minecraftforge.common.property.IUnlistedProperty;
import appeng.api.util.AEPartLocation;
import appeng.block.AEBaseTileBlock;
import appeng.client.UnlistedProperty;
import appeng.core.sync.GuiBridge;
import appeng.tile.storage.TileDrive;
import appeng.util.Platform;
import javax.annotation.Nullable;
public class BlockDrive extends AEBaseTileBlock
{
public class BlockDrive extends AEBaseTileBlock {
public static final UnlistedProperty<DriveSlotsState> SLOTS_STATE = new UnlistedProperty<>( "drive_slots_state", DriveSlotsState.class );
public static final UnlistedProperty<DriveSlotsState> SLOTS_STATE = new UnlistedProperty<>("drive_slots_state", DriveSlotsState.class);
public BlockDrive()
{
super( Material.IRON );
}
public BlockDrive() {
super(Material.IRON);
}
@Override
public BlockRenderLayer getBlockLayer()
{
return BlockRenderLayer.CUTOUT;
}
@Override
public BlockRenderLayer getBlockLayer() {
return BlockRenderLayer.CUTOUT;
}
@Override
protected BlockStateContainer createBlockState()
{
return new ExtendedBlockState( this, this.getAEStates(), new IUnlistedProperty[] {
SLOTS_STATE,
FORWARD,
UP
} );
}
@Override
protected BlockStateContainer createBlockState() {
return new ExtendedBlockState(this, this.getAEStates(), new IUnlistedProperty[]{
SLOTS_STATE,
FORWARD,
UP
});
}
@Override
public IBlockState getExtendedState( IBlockState state, IBlockAccess world, BlockPos pos )
{
TileDrive te = this.getTileEntity( world, pos );
IExtendedBlockState extState = (IExtendedBlockState) super.getExtendedState( state, world, pos );
return extState.withProperty( SLOTS_STATE, te == null ? DriveSlotsState.createEmpty( 10 ) : DriveSlotsState.fromChestOrDrive( te ) );
}
@Override
public IBlockState getExtendedState(IBlockState state, IBlockAccess world, BlockPos pos) {
TileDrive te = this.getTileEntity(world, pos);
IExtendedBlockState extState = (IExtendedBlockState) super.getExtendedState(state, world, pos);
return extState.withProperty(SLOTS_STATE, te == null ? DriveSlotsState.createEmpty(10) : DriveSlotsState.fromChestOrDrive(te));
}
@Override
public boolean onActivated( final World w, final BlockPos pos, final EntityPlayer p, final EnumHand hand, final @Nullable ItemStack heldItem, final EnumFacing side, final float hitX, final float hitY, final float hitZ )
{
if( p.isSneaking() )
{
return false;
}
@Override
public boolean onActivated(final World w, final BlockPos pos, final EntityPlayer p, final EnumHand hand, final @Nullable ItemStack heldItem, final EnumFacing side, final float hitX, final float hitY, final float hitZ) {
if (p.isSneaking()) {
return false;
}
final TileDrive tg = this.getTileEntity( w, pos );
if( tg != null )
{
if( Platform.isServer() )
{
Platform.openGUI( p, tg, AEPartLocation.fromFacing( side ), GuiBridge.GUI_DRIVE );
}
return true;
}
return false;
}
final TileDrive tg = this.getTileEntity(w, pos);
if (tg != null) {
if (Platform.isServer()) {
Platform.openGUI(p, tg, AEPartLocation.fromFacing(side), GuiBridge.GUI_DRIVE);
}
return true;
}
return false;
}
}