Some more work on the multiblock system
This commit is contained in:
parent
b505eeaf30
commit
1eb3ef3db6
13 changed files with 158 additions and 27 deletions
28
src/main/java/techreborn/api/multiblock/BaseMultiBlock.java
Normal file
28
src/main/java/techreborn/api/multiblock/BaseMultiBlock.java
Normal 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;
|
||||
}
|
||||
}
|
|
@ -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
|
||||
|
|
|
@ -0,0 +1,7 @@
|
|||
package techreborn.api.multiblock;
|
||||
|
||||
public interface IMultiBlockController {
|
||||
|
||||
IMultiBlock getMultiBlock();
|
||||
|
||||
}
|
|
@ -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();
|
||||
}
|
||||
|
|
|
@ -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;
|
||||
}
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue