Looking through your code, you already have "GeneralWorld.WorldType.isStock(world)" in line 127 which does the check, no?