Formatting fixes

This commit is contained in:
Sebastian Hartte
2020-06-22 01:30:16 +02:00
parent 3e0bfec882
commit 8350ae5f45
6 changed files with 91 additions and 89 deletions
@@ -18,25 +18,12 @@
package appeng.block.networking; package appeng.block.networking;
import appeng.api.parts.IFacadeContainer; import java.util.EnumSet;
import appeng.api.parts.IFacadePart; import java.util.List;
import appeng.api.parts.PartItemStack; import java.util.Random;
import appeng.api.parts.SelectedPart;
import appeng.api.util.AEColor; import javax.annotation.Nullable;
import appeng.api.util.AEPartLocation;
import appeng.block.AEBaseTileBlock;
import appeng.client.render.cablebus.CableBusBakedModel;
import appeng.client.render.cablebus.CableBusBreakingParticle;
import appeng.client.render.cablebus.CableBusRenderState;
import appeng.core.sync.network.NetworkHandler;
import appeng.core.sync.packets.PacketClick;
import appeng.helpers.AEGlassMaterial;
import appeng.integration.abstraction.IAEFacade;
import appeng.parts.ICableBusContainer;
import appeng.parts.NullCableBusContainer;
import appeng.tile.AEBaseTile;
import appeng.tile.networking.TileCableBus;
import appeng.util.Platform;
import net.minecraft.block.Block; import net.minecraft.block.Block;
import net.minecraft.block.BlockState; import net.minecraft.block.BlockState;
import net.minecraft.client.Minecraft; import net.minecraft.client.Minecraft;
@@ -69,10 +56,25 @@ import net.minecraft.world.World;
import net.minecraftforge.api.distmarker.Dist; import net.minecraftforge.api.distmarker.Dist;
import net.minecraftforge.api.distmarker.OnlyIn; import net.minecraftforge.api.distmarker.OnlyIn;
import javax.annotation.Nullable; import appeng.api.parts.IFacadeContainer;
import java.util.EnumSet; import appeng.api.parts.IFacadePart;
import java.util.List; import appeng.api.parts.PartItemStack;
import java.util.Random; import appeng.api.parts.SelectedPart;
import appeng.api.util.AEColor;
import appeng.api.util.AEPartLocation;
import appeng.block.AEBaseTileBlock;
import appeng.client.render.cablebus.CableBusBakedModel;
import appeng.client.render.cablebus.CableBusBreakingParticle;
import appeng.client.render.cablebus.CableBusRenderState;
import appeng.core.sync.network.NetworkHandler;
import appeng.core.sync.packets.PacketClick;
import appeng.helpers.AEGlassMaterial;
import appeng.integration.abstraction.IAEFacade;
import appeng.parts.ICableBusContainer;
import appeng.parts.NullCableBusContainer;
import appeng.tile.AEBaseTile;
import appeng.tile.networking.TileCableBus;
import appeng.util.Platform;
public class BlockCableBus extends AEBaseTileBlock<TileCableBus> implements IAEFacade { public class BlockCableBus extends AEBaseTileBlock<TileCableBus> implements IAEFacade {
@@ -352,23 +354,19 @@ public class BlockCableBus extends AEBaseTileBlock<TileCableBus> implements IAEF
// do nothing // do nothing
} }
@Override @Override
public BlockState getFacadeState( IBlockReader world, BlockPos pos, Direction side ) public BlockState getFacadeState(IBlockReader world, BlockPos pos, Direction side) {
{ if (side != null) {
if( side != null ) IFacadeContainer container = this.fc(world, pos);
{ if (container != null) {
IFacadeContainer container = this.fc( world, pos ); IFacadePart facade = container.getFacade(AEPartLocation.fromFacing(side));
if( container != null ) if (facade != null) {
{ return facade.getBlockState();
IFacadePart facade = container.getFacade( AEPartLocation.fromFacing( side ) ); }
if( facade != null ) }
{ }
return facade.getBlockState(); return world.getBlockState(pos);
} }
}
}
return world.getBlockState( pos );
}
@Override @Override
public VoxelShape getShape(BlockState state, IBlockReader w, BlockPos pos, ISelectionContext context) { public VoxelShape getShape(BlockState state, IBlockReader w, BlockPos pos, ISelectionContext context) {
@@ -18,26 +18,24 @@
package appeng.integration.abstraction; package appeng.integration.abstraction;
import javax.annotation.Nonnull;
import javax.annotation.Nullable;
import net.minecraft.block.BlockState; import net.minecraft.block.BlockState;
import net.minecraft.util.Direction; import net.minecraft.util.Direction;
import net.minecraft.util.math.BlockPos; import net.minecraft.util.math.BlockPos;
import net.minecraft.world.IBlockReader; import net.minecraft.world.IBlockReader;
import team.chisel.ctm.api.IFacade; import team.chisel.ctm.api.IFacade;
import javax.annotation.Nonnull;
import javax.annotation.Nullable;
/** /**
* Neat abstraction class for All the IFacade interfaces. * Neat abstraction class for All the IFacade interfaces.
* *
* @author covers1624 * @author covers1624
*/ */
public interface IAEFacade extends IFacade public interface IAEFacade extends IFacade {
{
BlockState getFacadeState( IBlockReader world, BlockPos pos, @Nullable Direction side ); BlockState getFacadeState(IBlockReader world, BlockPos pos, @Nullable Direction side);
@Nonnull @Nonnull
@Override @Override
@@ -47,7 +45,8 @@ public interface IAEFacade extends IFacade
@Nonnull @Nonnull
@Override @Override
default BlockState getFacade(@Nonnull IBlockReader world, @Nonnull BlockPos pos, @Nullable Direction side, @Nonnull BlockPos connection) { default BlockState getFacade(@Nonnull IBlockReader world, @Nonnull BlockPos pos, @Nullable Direction side,
@Nonnull BlockPos connection) {
return getFacadeState(world, pos, side); return getFacadeState(world, pos, side);
} }
@@ -18,16 +18,6 @@
package appeng.items.parts; package appeng.items.parts;
import appeng.api.AEApi;
import appeng.api.exceptions.MissingDefinitionException;
import appeng.api.features.AEFeature;
import appeng.api.parts.IAlphaPassItem;
import appeng.api.util.AEPartLocation;
import appeng.core.AEConfig;
import appeng.core.AppEng;
import appeng.facade.FacadePart;
import appeng.facade.IFacadeItem;
import appeng.items.AEBaseItem;
import net.minecraft.block.Block; import net.minecraft.block.Block;
import net.minecraft.block.BlockRenderType; import net.minecraft.block.BlockRenderType;
import net.minecraft.block.BlockState; import net.minecraft.block.BlockState;
@@ -47,6 +37,17 @@ import net.minecraft.util.text.ITextComponent;
import net.minecraft.world.EmptyBlockReader; import net.minecraft.world.EmptyBlockReader;
import net.minecraftforge.registries.ForgeRegistries; import net.minecraftforge.registries.ForgeRegistries;
import appeng.api.AEApi;
import appeng.api.exceptions.MissingDefinitionException;
import appeng.api.features.AEFeature;
import appeng.api.parts.IAlphaPassItem;
import appeng.api.util.AEPartLocation;
import appeng.core.AEConfig;
import appeng.core.AppEng;
import appeng.facade.FacadePart;
import appeng.facade.IFacadeItem;
import appeng.items.AEBaseItem;
public class ItemFacade extends AEBaseItem implements IFacadeItem, IAlphaPassItem { public class ItemFacade extends AEBaseItem implements IFacadeItem, IAlphaPassItem {
/** /**
@@ -18,6 +18,29 @@
package appeng.parts; package appeng.parts;
import java.io.IOException;
import java.util.*;
import javax.annotation.Nullable;
import net.minecraft.block.BlockState;
import net.minecraft.entity.Entity;
import net.minecraft.entity.LivingEntity;
import net.minecraft.entity.player.PlayerEntity;
import net.minecraft.item.Item;
import net.minecraft.item.ItemStack;
import net.minecraft.nbt.CompoundNBT;
import net.minecraft.network.PacketBuffer;
import net.minecraft.tileentity.TileEntity;
import net.minecraft.util.Direction;
import net.minecraft.util.Hand;
import net.minecraft.util.math.AxisAlignedBB;
import net.minecraft.util.math.BlockPos;
import net.minecraft.util.math.Vec3d;
import net.minecraft.world.IBlockReader;
import net.minecraft.world.World;
import net.minecraftforge.common.util.Constants;
import appeng.api.AEApi; import appeng.api.AEApi;
import appeng.api.config.YesNo; import appeng.api.config.YesNo;
import appeng.api.exceptions.FailedConnectionException; import appeng.api.exceptions.FailedConnectionException;
@@ -38,27 +61,6 @@ import appeng.helpers.AEMultiTile;
import appeng.me.GridConnection; import appeng.me.GridConnection;
import appeng.parts.networking.PartCable; import appeng.parts.networking.PartCable;
import appeng.util.Platform; import appeng.util.Platform;
import net.minecraft.block.BlockState;
import net.minecraft.entity.Entity;
import net.minecraft.entity.LivingEntity;
import net.minecraft.entity.player.PlayerEntity;
import net.minecraft.item.Item;
import net.minecraft.item.ItemStack;
import net.minecraft.nbt.CompoundNBT;
import net.minecraft.network.PacketBuffer;
import net.minecraft.tileentity.TileEntity;
import net.minecraft.util.Direction;
import net.minecraft.util.Hand;
import net.minecraft.util.math.AxisAlignedBB;
import net.minecraft.util.math.BlockPos;
import net.minecraft.util.math.Vec3d;
import net.minecraft.world.IBlockReader;
import net.minecraft.world.World;
import net.minecraftforge.common.util.Constants;
import javax.annotation.Nullable;
import java.io.IOException;
import java.util.*;
public class CableBusContainer extends CableBusStorage implements AEMultiTile, ICableBusContainer { public class CableBusContainer extends CableBusStorage implements AEMultiTile, ICableBusContainer {
@@ -18,9 +18,9 @@
package appeng.parts; package appeng.parts;
import appeng.api.parts.SelectedPart; import java.util.EnumSet;
import appeng.api.util.AEColor; import java.util.Random;
import appeng.client.render.cablebus.CableBusRenderState;
import net.minecraft.entity.Entity; import net.minecraft.entity.Entity;
import net.minecraft.entity.LivingEntity; import net.minecraft.entity.LivingEntity;
import net.minecraft.entity.player.PlayerEntity; import net.minecraft.entity.player.PlayerEntity;
@@ -33,8 +33,9 @@ import net.minecraft.world.World;
import net.minecraftforge.api.distmarker.Dist; import net.minecraftforge.api.distmarker.Dist;
import net.minecraftforge.api.distmarker.OnlyIn; import net.minecraftforge.api.distmarker.OnlyIn;
import java.util.EnumSet; import appeng.api.parts.SelectedPart;
import java.util.Random; import appeng.api.util.AEColor;
import appeng.client.render.cablebus.CableBusRenderState;
public interface ICableBusContainer { public interface ICableBusContainer {
@@ -18,9 +18,9 @@
package appeng.parts; package appeng.parts;
import appeng.api.parts.SelectedPart; import java.util.EnumSet;
import appeng.api.util.AEColor; import java.util.Random;
import appeng.client.render.cablebus.CableBusRenderState;
import net.minecraft.entity.Entity; import net.minecraft.entity.Entity;
import net.minecraft.entity.LivingEntity; import net.minecraft.entity.LivingEntity;
import net.minecraft.entity.player.PlayerEntity; import net.minecraft.entity.player.PlayerEntity;
@@ -31,8 +31,9 @@ import net.minecraft.util.math.Vec3d;
import net.minecraft.world.IBlockReader; import net.minecraft.world.IBlockReader;
import net.minecraft.world.World; import net.minecraft.world.World;
import java.util.EnumSet; import appeng.api.parts.SelectedPart;
import java.util.Random; import appeng.api.util.AEColor;
import appeng.client.render.cablebus.CableBusRenderState;
public class NullCableBusContainer implements ICableBusContainer { public class NullCableBusContainer implements ICableBusContainer {