- Add the Codota plugin to your IDE and get smart completions
private void myMethod () {Connection c =
DataSource dataSource;dataSource.getConnection()
String url;DriverManager.getConnection(url)
IdentityDatabaseUtil.getDBConnection()
- Smart code suggestions by Codota
}
public static void assignMultiBlock(World world, BlockPos master, List<BlockPos> servants) { TileEntity masterBlock = world.getTileEntity(master); if(!(masterBlock instanceof IMasterLogic)) { throw new IllegalArgumentException("Master must be of IMasterLogic"); } // assign master to each servant for(BlockPos pos : servants) { if(world.isBlockLoaded(pos)) { TileEntity slave = world.getTileEntity(pos); if(slave instanceof MultiServantLogic && slave.getWorld() != null) { ((MultiServantLogic) slave).overrideMaster(master); IBlockState state = world.getBlockState(pos); world.notifyBlockUpdate(pos, state, state, 3); } } } } }
@Deprecated public boolean setMaster(BlockPos pos) { if(!this.hasMaster || this.world.getBlockState(this.master) != this.state || (this.world .getBlockState(this.master) .getBlock() != this.masterBlock)) { this.overrideMaster(pos); return true; } else { return false; } }
@Override public boolean verifyMaster(IMasterLogic logic, World world, BlockPos pos) { if(this.hasMaster) { return this.hasValidMaster(); } else { this.overrideMaster(pos); return true; } }