Some more work on the multiblock system

This commit is contained in:
Modmuss50 2015-04-17 17:42:57 +01:00
parent b505eeaf30
commit 1eb3ef3db6
13 changed files with 158 additions and 27 deletions

View file

@ -0,0 +1,28 @@
package techreborn.api.multiblock;
import net.minecraft.tileentity.TileEntity;
public abstract class BaseMultiBlock implements IMultiBlock {
boolean isComplete = false;
TileEntity parent;
public BaseMultiBlock(TileEntity parent) {
this.parent = parent;
}
@Override
public boolean isComplete() {
return isComplete;
}
@Override
public TileEntity getController() {
return parent;
}
public void setIsComplete(boolean isComplete) {
this.isComplete = isComplete;
}
}

View file

@ -9,12 +9,17 @@ public interface IMultiBlock {
/**
* This is the name of the multiblock
*/
void getName();
String getName();
/**
* This check to see if the multiblock is complete
*/
boolean checkIfComplete(int x, int y, int z);
boolean checkIfComplete();
/**
* This check to see if the multiblock is complete
*/
boolean isComplete();
/**
* This is a list of all of the tiles that make up the multiblock

View file

@ -0,0 +1,7 @@
package techreborn.api.multiblock;
public interface IMultiBlockController {
IMultiBlock getMultiBlock();
}

View file

@ -3,7 +3,7 @@ package techreborn.api.multiblock;
public interface IMultiblockComponent {
/**
* This gets the multiblock type, allow for different meta data for different structures,
* This gets the instance of the multiblock , allow for different meta data for different structures,
*/
IMultiBlock getMultiblock(int meta);
Class getMultiblockType();
}

View file

@ -0,0 +1,17 @@
package techreborn.api.multiblock;
import net.minecraft.tileentity.TileEntity;
public class MultiBlockController extends TileEntity implements IMultiBlockController{
BaseMultiBlock multiBlock;
public MultiBlockController(BaseMultiBlock multiBlock) {
this.multiBlock = multiBlock;
}
@Override
public IMultiBlock getMultiBlock() {
return multiBlock;
}
}