use of com.bluepowermod.tile.tier3.TileCircuitDatabase in project BluePower by Qmunity.
the class BlockCircuitDatabase method onBlockActivated.
@Override
public boolean onBlockActivated(World world, int x, int y, int z, EntityPlayer player, int par6, float par7, float par8, float par9) {
if (super.onBlockActivated(world, x, y, z, player, par6, par7, par8, par9)) {
TileCircuitDatabase database = (TileCircuitDatabase) world.getTileEntity(x, y, z);
database.clientCurrentTab = 0;
if (!world.isRemote) {
BPNetworkHandler.INSTANCE.sendTo(new MessageSendClientServerTemplates(new ItemStackDatabase().loadItemStacks()), (EntityPlayerMP) player);
}
return true;
} else {
return false;
}
}
use of com.bluepowermod.tile.tier3.TileCircuitDatabase in project BluePower by Qmunity.
the class MessageCircuitDatabaseTemplate method handleServerSide.
@Override
public void handleServerSide(EntityPlayer player) {
if (deleting) {
if (TileCircuitDatabase.hasPermissions(player)) {
ItemStackDatabase stackDatabase = new ItemStackDatabase();
stackDatabase.deleteStack(stack);
BPNetworkHandler.INSTANCE.sendToAll(new MessageSendClientServerTemplates(stackDatabase.loadItemStacks()));
}
} else {
TileEntity te = player.worldObj.getTileEntity(x, y, z);
if (te instanceof TileCircuitDatabase) {
((TileCircuitDatabase) te).copyInventory.setInventorySlotContents(0, stack);
player.openGui(BluePower.instance, GuiIDs.CIRCUITDATABASE_MAIN_ID.ordinal(), player.worldObj, x, y, z);
}
}
}
Aggregations