use of com.teamwizardry.wizardry.common.block.BlockManaBattery in project Wizardry by TeamWizardry.
the class TileManaBattery method update.
@Override
public void update() {
super.update();
if (getBlockType() == ModBlocks.MANA_BATTERY && !((BlockManaBattery) getBlockType()).isStructureComplete(getWorld(), getPos()))
return;
if (getBlockType() != ModBlocks.CREATIVE_MANA_BATTERY) {
for (BlockPos relative : poses) {
BlockPos target = getPos().add(relative);
TileEntity tile = world.getTileEntity(target);
if (tile instanceof TilePearlHolder) {
if (!((TilePearlHolder) tile).isPartOfStructure) {
((TilePearlHolder) tile).isPartOfStructure = true;
((TilePearlHolder) tile).structurePos = getPos();
((TilePearlHolder) tile).setAllowOutsideSucking(false);
tile.markDirty();
}
}
}
} else {
CapManager manager = new CapManager(getWizardryCap());
manager.setMana(manager.getMaxMana());
manager.setBurnout(0);
}
}
Aggregations