handle a few random errors that popped up in my server log
This commit is contained in:
		| @@ -170,7 +170,12 @@ public class Commands { | |||||||
| 		if (Conf.aliasHelp.contains(command)) { | 		if (Conf.aliasHelp.contains(command)) { | ||||||
| 			int page = 1; | 			int page = 1; | ||||||
| 			if (tokens.size() > 0) { | 			if (tokens.size() > 0) { | ||||||
| 				page = Integer.parseInt(tokens.get(0)); | 				try { | ||||||
|  | 					page = Integer.parseInt(tokens.get(0)); | ||||||
|  | 				} | ||||||
|  | 				catch (NumberFormatException e) { | ||||||
|  | 					// wasn't an integer | ||||||
|  | 				} | ||||||
| 			} | 			} | ||||||
| 			help(me, page); | 			help(me, page); | ||||||
| 		} else if (Conf.aliasLeave.contains(command)) { | 		} else if (Conf.aliasLeave.contains(command)) { | ||||||
|   | |||||||
| @@ -43,7 +43,7 @@ public class FactionsBlockListener extends BlockListener { | |||||||
| 		Coord coord = Coord.parseCoord(block); | 		Coord coord = Coord.parseCoord(block); | ||||||
| 		Faction otherFaction = Board.get(player.getWorld()).getFactionAt(coord); | 		Faction otherFaction = Board.get(player.getWorld()).getFactionAt(coord); | ||||||
| 		 | 		 | ||||||
| 		if (otherFaction.id == 0) { | 		if (otherFaction == null || otherFaction.id == 0) { | ||||||
| 			return true; // This is no faction territory. You may build or break stuff here. | 			return true; // This is no faction territory. You may build or break stuff here. | ||||||
| 		} | 		} | ||||||
| 		 | 		 | ||||||
| @@ -92,7 +92,7 @@ public class FactionsBlockListener extends BlockListener { | |||||||
| 		Coord blockCoord = Coord.from(block.getLocation()); | 		Coord blockCoord = Coord.from(block.getLocation()); | ||||||
| 		Faction otherFaction = Board.get(player.getWorld()).getFactionAt(blockCoord); | 		Faction otherFaction = Board.get(player.getWorld()).getFactionAt(blockCoord); | ||||||
| 		 | 		 | ||||||
| 		if (otherFaction.id != 0 && myFaction != otherFaction) { | 		if (otherFaction != null && otherFaction.id != 0 && myFaction != otherFaction) { | ||||||
| 			me.sendMessage(Conf.colorSystem+"You can't use "+TextUtil.getMaterialName(material)+" in the territory of "+otherFaction.getTag(myFaction)); | 			me.sendMessage(Conf.colorSystem+"You can't use "+TextUtil.getMaterialName(material)+" in the territory of "+otherFaction.getTag(myFaction)); | ||||||
| 			//otherFaction.sendMessage(me.getNameAndRelevant(otherFaction)+Conf.colorSystem+" tried to use "+TextUtil.getMaterialName(material)+" in your territory"); | 			//otherFaction.sendMessage(me.getNameAndRelevant(otherFaction)+Conf.colorSystem+" tried to use "+TextUtil.getMaterialName(material)+" in your territory"); | ||||||
| 			return false; | 			return false; | ||||||
|   | |||||||
		Reference in New Issue
	
	Block a user
	 
				 Brettflan
					Brettflan