mirror of
https://github.com/GTNewHorizons/ForestryMC.git
synced 2026-11-19 19:49:54 +00:00
Big code cleanup
This commit is contained in:
1 parent
1b58077904
commit
a3363fb4bc
132 files changed
+1587
-1863
No files matched your search
@@ -10,57 +10,68 @@
|
||||
******************************************************************************/
|
||||
package forestry.greenhouse.multiblock;
|
||||
|
||||
import javax.annotation.Nonnull;
|
||||
import javax.annotation.Nullable;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Collection;
|
||||
import java.util.List;
|
||||
|
||||
import forestry.api.greenhouse.IInternalBlock;
|
||||
import forestry.api.greenhouse.IInternalBlockFace;
|
||||
import net.minecraft.util.BlockPos;
|
||||
import net.minecraft.util.EnumFacing;
|
||||
import net.minecraft.world.World;
|
||||
|
||||
import forestry.api.greenhouse.IInternalBlock;
|
||||
import forestry.api.greenhouse.IInternalBlockFace;
|
||||
|
||||
public class InternalBlock implements IInternalBlock {
|
||||
@Nonnull
|
||||
private final BlockPos pos;
|
||||
@Nonnull
|
||||
private final World world;
|
||||
private final List<IInternalBlockFace> faces = new ArrayList(6);
|
||||
@Nonnull
|
||||
private final List<IInternalBlockFace> faces = new ArrayList<>(6);
|
||||
@Nullable
|
||||
private final IInternalBlock root;
|
||||
|
||||
public InternalBlock(World world, BlockPos pos) {
|
||||
public InternalBlock(@Nonnull World world, @Nonnull BlockPos pos) {
|
||||
this.world = world;
|
||||
this.pos = pos;
|
||||
this.root = null;
|
||||
|
||||
for(EnumFacing facing : EnumFacing.VALUES){
|
||||
for (EnumFacing facing : EnumFacing.VALUES) {
|
||||
this.faces.add(new InternalBlockFace(facing, getPos().offset(facing), false));
|
||||
}
|
||||
}
|
||||
|
||||
public InternalBlock(World world, BlockPos pos, EnumFacing rootFace, IInternalBlock root) {
|
||||
public InternalBlock(@Nonnull World world, @Nonnull BlockPos pos, EnumFacing rootFace, @Nonnull IInternalBlock root) {
|
||||
this.world = world;
|
||||
this.pos = pos;
|
||||
this.root = root;
|
||||
|
||||
for(EnumFacing face : EnumFacing.VALUES){
|
||||
for (EnumFacing face : EnumFacing.VALUES) {
|
||||
this.faces.add(new InternalBlockFace(face, getPos().offset(face), face == rootFace));
|
||||
}
|
||||
}
|
||||
|
||||
@Nonnull
|
||||
@Override
|
||||
public World getWorld() {
|
||||
return world;
|
||||
}
|
||||
|
||||
@Nonnull
|
||||
@Override
|
||||
public BlockPos getPos() {
|
||||
return pos;
|
||||
}
|
||||
|
||||
@Nonnull
|
||||
@Override
|
||||
public Collection<IInternalBlockFace> getFaces() {
|
||||
return faces;
|
||||
}
|
||||
|
||||
@Nullable
|
||||
@Override
|
||||
public IInternalBlock getRoot() {
|
||||
return root;
|
||||
@@ -68,7 +79,7 @@ public class InternalBlock implements IInternalBlock {
|
||||
|
||||
@Override
|
||||
public boolean equals(Object obj) {
|
||||
if(!(obj instanceof IInternalBlock)){
|
||||
if (!(obj instanceof IInternalBlock)) {
|
||||
return false;
|
||||
}
|
||||
IInternalBlock internalBlock = (IInternalBlock) obj;
|
||||
|
||||
Reference in new issue
Block a user