Started work on the multiBlock
This commit is contained in:
parent
77fb5949b9
commit
2901466288
2 changed files with 276 additions and 2 deletions
|
@ -1,17 +1,23 @@
|
|||
package techreborn.tiles;
|
||||
|
||||
import codechicken.multipart.MultiPartRegistry;
|
||||
import erogenousbeef.coreTR.multiblock.MultiblockRegistry;
|
||||
import erogenousbeef.coreTR.multiblock.MultiblockWorldRegistry;
|
||||
import techreborn.multiblocks.MultiBlockCasing;
|
||||
import erogenousbeef.coreTR.multiblock.MultiblockControllerBase;
|
||||
import erogenousbeef.coreTR.multiblock.MultiblockValidationException;
|
||||
import erogenousbeef.coreTR.multiblock.rectangular.RectangularMultiblockTileEntityBase;
|
||||
import techreborn.multiblocks.MultiblockImplosionCompressor;
|
||||
|
||||
public class TileMachineCasing extends RectangularMultiblockTileEntityBase {
|
||||
|
||||
int ticks;
|
||||
boolean isStarShape = false;
|
||||
|
||||
@Override
|
||||
public boolean canUpdate()
|
||||
{
|
||||
// No need to update this.
|
||||
return false;
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -29,12 +35,20 @@ public class TileMachineCasing extends RectangularMultiblockTileEntityBase {
|
|||
@Override
|
||||
public MultiblockControllerBase createNewMultiblock()
|
||||
{
|
||||
if(isStarShape)
|
||||
{
|
||||
return new MultiblockImplosionCompressor(worldObj);
|
||||
}
|
||||
return new MultiBlockCasing(worldObj);
|
||||
}
|
||||
|
||||
@Override
|
||||
public Class<? extends MultiblockControllerBase> getMultiblockControllerType()
|
||||
{
|
||||
if(isStarShape)
|
||||
{
|
||||
return MultiblockImplosionCompressor.class;
|
||||
}
|
||||
return MultiBlockCasing.class;
|
||||
}
|
||||
|
||||
|
@ -72,4 +86,17 @@ public class TileMachineCasing extends RectangularMultiblockTileEntityBase {
|
|||
{
|
||||
return (MultiBlockCasing) super.getMultiblockController();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void updateEntity() {
|
||||
super.updateEntity();
|
||||
if(getMultiblockController() == null || !getMultiblockController().isAssembled()){
|
||||
ticks ++;
|
||||
if(ticks == 20){
|
||||
isStarShape = !isStarShape;
|
||||
ticks = 0;
|
||||
//TODO recalculate multiblock
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue