MassiveCore - Merged Message Methods
This commit is contained in:
		@@ -53,7 +53,7 @@ public abstract class CmdFactionsAccessAbstract extends FactionsCommand
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
	public void sendAccessInfo()
 | 
						public void sendAccessInfo()
 | 
				
			||||||
	{
 | 
						{
 | 
				
			||||||
		sendMessage(Txt.titleize("Access at " + chunk.toString(PSFormatHumanSpace.get())));
 | 
							message(Txt.titleize("Access at " + chunk.toString(PSFormatHumanSpace.get())));
 | 
				
			||||||
		msg("<k>Host Faction: %s", hostFaction.describeTo(msender, true));
 | 
							msg("<k>Host Faction: %s", hostFaction.describeTo(msender, true));
 | 
				
			||||||
		msg("<k>Host Faction Allowed: %s", ta.isHostFactionAllowed() ? Txt.parse("<lime>TRUE") : Txt.parse("<rose>FALSE"));
 | 
							msg("<k>Host Faction Allowed: %s", ta.isHostFactionAllowed() ? Txt.parse("<lime>TRUE") : Txt.parse("<rose>FALSE"));
 | 
				
			||||||
		msg("<k>Granted Players: %s", describeRelationParticipators(ta.getGrantedMPlayers(), msender));
 | 
							msg("<k>Granted Players: %s", describeRelationParticipators(ta.getGrantedMPlayers(), msender));
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -45,7 +45,7 @@ public class CmdFactionsAdmin extends FactionsCommand
 | 
				
			|||||||
		String messageYou = Txt.parse("<i>%s %s <i>admin bypass mode.", msender.getDisplayName(msender), desc);
 | 
							String messageYou = Txt.parse("<i>%s %s <i>admin bypass mode.", msender.getDisplayName(msender), desc);
 | 
				
			||||||
		String messageLog = Txt.parse("<i>%s %s <i>admin bypass mode.", msender.getDisplayName(IdUtil.getConsole()), desc);
 | 
							String messageLog = Txt.parse("<i>%s %s <i>admin bypass mode.", msender.getDisplayName(IdUtil.getConsole()), desc);
 | 
				
			||||||
		
 | 
							
 | 
				
			||||||
		msender.sendMessage(messageYou);
 | 
							msender.message(messageYou);
 | 
				
			||||||
		Factions.get().log(messageLog);
 | 
							Factions.get().log(messageLog);
 | 
				
			||||||
	}
 | 
						}
 | 
				
			||||||
	
 | 
						
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -56,7 +56,7 @@ public class CmdFactionsCreate extends FactionsCommand
 | 
				
			|||||||
		ArrayList<String> nameValidationErrors = FactionColl.get().validateName(newName);
 | 
							ArrayList<String> nameValidationErrors = FactionColl.get().validateName(newName);
 | 
				
			||||||
		if (nameValidationErrors.size() > 0)
 | 
							if (nameValidationErrors.size() > 0)
 | 
				
			||||||
		{
 | 
							{
 | 
				
			||||||
			sendMessage(nameValidationErrors);
 | 
								message(nameValidationErrors);
 | 
				
			||||||
			return;
 | 
								return;
 | 
				
			||||||
		}
 | 
							}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -48,7 +48,7 @@ public class CmdFactionsFlagList extends FactionsCommand
 | 
				
			|||||||
		}
 | 
							}
 | 
				
			||||||
		
 | 
							
 | 
				
			||||||
		//Send messages
 | 
							//Send messages
 | 
				
			||||||
		sendMessage(Txt.getPage(messages, page, "Available Faction Flags", sender));
 | 
							message(Txt.getPage(messages, page, "Available Faction Flags", sender));
 | 
				
			||||||
	}
 | 
						}
 | 
				
			||||||
	
 | 
						
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -75,7 +75,7 @@ public class CmdFactionsFlagSet extends FactionsCommand
 | 
				
			|||||||
		{
 | 
							{
 | 
				
			||||||
			// Send message to sender
 | 
								// Send message to sender
 | 
				
			||||||
			msg("<h>%s <i>set a flag for <h>%s<i>.", msender.describeTo(msender, true), faction.describeTo(msender, true));
 | 
								msg("<h>%s <i>set a flag for <h>%s<i>.", msender.describeTo(msender, true), faction.describeTo(msender, true));
 | 
				
			||||||
			sendMessage(stateInfo);
 | 
								message(stateInfo);
 | 
				
			||||||
		}
 | 
							}
 | 
				
			||||||
		faction.msg("<h>%s <i>set a flag for <h>%s<i>.", msender.describeTo(faction, true), faction.describeTo(faction, true));
 | 
							faction.msg("<h>%s <i>set a flag for <h>%s<i>.", msender.describeTo(faction, true), faction.describeTo(faction, true));
 | 
				
			||||||
		faction.sendMessage(stateInfo);
 | 
							faction.sendMessage(stateInfo);
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -54,7 +54,7 @@ public class CmdFactionsFlagShow extends FactionsCommand
 | 
				
			|||||||
		}
 | 
							}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
		// Send messages
 | 
							// Send messages
 | 
				
			||||||
		sendMessage(messages);
 | 
							message(messages);
 | 
				
			||||||
	}
 | 
						}
 | 
				
			||||||
	
 | 
						
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -73,7 +73,7 @@ public class CmdFactionsHome extends FactionsCommandHome
 | 
				
			|||||||
			if (MPerm.getPermSethome().has(msender, faction, false))
 | 
								if (MPerm.getPermSethome().has(msender, faction, false))
 | 
				
			||||||
			{
 | 
								{
 | 
				
			||||||
				msender.msg("<i>You should:");
 | 
									msender.msg("<i>You should:");
 | 
				
			||||||
				msender.sendMessage(Factions.get().getOuterCmdFactions().cmdFactionsSethome.getUseageTemplate());
 | 
									msender.message(Factions.get().getOuterCmdFactions().cmdFactionsSethome.getUseageTemplate());
 | 
				
			||||||
			}
 | 
								}
 | 
				
			||||||
			
 | 
								
 | 
				
			||||||
			return;
 | 
								return;
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -78,7 +78,7 @@ public class CmdFactionsInviteList extends FactionsCommand
 | 
				
			|||||||
		});
 | 
							});
 | 
				
			||||||
		
 | 
							
 | 
				
			||||||
		// Send message
 | 
							// Send message
 | 
				
			||||||
		sendMessage(messages);
 | 
							message(messages);
 | 
				
			||||||
	}
 | 
						}
 | 
				
			||||||
	
 | 
						
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -66,7 +66,7 @@ public class CmdFactionsMap extends FactionsCommand
 | 
				
			|||||||
	{
 | 
						{
 | 
				
			||||||
		Location location = me.getLocation();
 | 
							Location location = me.getLocation();
 | 
				
			||||||
		List<String> message = BoardColl.get().getMap(msenderFaction, PS.valueOf(location), location.getYaw(), width, height);
 | 
							List<String> message = BoardColl.get().getMap(msenderFaction, PS.valueOf(location), location.getYaw(), width, height);
 | 
				
			||||||
		sendMessage(message);
 | 
							message(message);
 | 
				
			||||||
	}
 | 
						}
 | 
				
			||||||
	
 | 
						
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -40,7 +40,7 @@ public class CmdFactionsMotd extends FactionsCommand
 | 
				
			|||||||
		// Read
 | 
							// Read
 | 
				
			||||||
		if ( ! this.argIsSet(0))
 | 
							if ( ! this.argIsSet(0))
 | 
				
			||||||
		{
 | 
							{
 | 
				
			||||||
			sendMessage(msenderFaction.getMotdMessages());
 | 
								message(msenderFaction.getMotdMessages());
 | 
				
			||||||
			return;
 | 
								return;
 | 
				
			||||||
		}
 | 
							}
 | 
				
			||||||
		
 | 
							
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -57,7 +57,7 @@ public class CmdFactionsName extends FactionsCommand
 | 
				
			|||||||
		errors.addAll(FactionColl.get().validateName(newName));
 | 
							errors.addAll(FactionColl.get().validateName(newName));
 | 
				
			||||||
		if (errors.size() > 0)
 | 
							if (errors.size() > 0)
 | 
				
			||||||
		{
 | 
							{
 | 
				
			||||||
			sendMessage(errors);
 | 
								message(errors);
 | 
				
			||||||
			return;
 | 
								return;
 | 
				
			||||||
		}
 | 
							}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -48,7 +48,7 @@ public class CmdFactionsPermList extends FactionsCommand
 | 
				
			|||||||
		}
 | 
							}
 | 
				
			||||||
		
 | 
							
 | 
				
			||||||
		// Send messages
 | 
							// Send messages
 | 
				
			||||||
		sendMessage(Txt.getPage(messages, page, "Available Faction Perms", sender));
 | 
							message(Txt.getPage(messages, page, "Available Faction Perms", sender));
 | 
				
			||||||
	}
 | 
						}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -83,7 +83,7 @@ public class CmdFactionsPermSet extends FactionsCommand
 | 
				
			|||||||
		messages.add(Txt.titleize("Perm for " + faction.describeTo(msender, true)));
 | 
							messages.add(Txt.titleize("Perm for " + faction.describeTo(msender, true)));
 | 
				
			||||||
		messages.add(MPerm.getStateHeaders());
 | 
							messages.add(MPerm.getStateHeaders());
 | 
				
			||||||
		messages.add(Txt.parse(perm.getStateInfo(faction.getPermitted(perm), true)));
 | 
							messages.add(Txt.parse(perm.getStateInfo(faction.getPermitted(perm), true)));
 | 
				
			||||||
		sendMessage(messages);
 | 
							message(messages);
 | 
				
			||||||
		
 | 
							
 | 
				
			||||||
		// Inform faction (their message is slighly different)
 | 
							// Inform faction (their message is slighly different)
 | 
				
			||||||
		List<MPlayer> recipients = faction.getMPlayers();
 | 
							List<MPlayer> recipients = faction.getMPlayers();
 | 
				
			||||||
@@ -92,7 +92,7 @@ public class CmdFactionsPermSet extends FactionsCommand
 | 
				
			|||||||
		for (MPlayer recipient : recipients)
 | 
							for (MPlayer recipient : recipients)
 | 
				
			||||||
		{
 | 
							{
 | 
				
			||||||
			messages.add(0, Txt.parse("<h>%s <i>set a perm for <h>%s<i>.", msender.describeTo(recipient, true), faction.describeTo(recipient, true)));
 | 
								messages.add(0, Txt.parse("<h>%s <i>set a perm for <h>%s<i>.", msender.describeTo(recipient, true), faction.describeTo(recipient, true)));
 | 
				
			||||||
			recipient.sendMessage(messages);
 | 
								recipient.message(messages);
 | 
				
			||||||
		}
 | 
							}
 | 
				
			||||||
	}
 | 
						}
 | 
				
			||||||
	
 | 
						
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -56,7 +56,7 @@ public class CmdFactionsPermShow extends FactionsCommand
 | 
				
			|||||||
		}
 | 
							}
 | 
				
			||||||
		
 | 
							
 | 
				
			||||||
		// Send messages
 | 
							// Send messages
 | 
				
			||||||
		sendMessage(messages);
 | 
							message(messages);
 | 
				
			||||||
	}
 | 
						}
 | 
				
			||||||
	
 | 
						
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -113,7 +113,7 @@ public class CmdFactionsStatus extends FactionsCommand
 | 
				
			|||||||
		});
 | 
							});
 | 
				
			||||||
		
 | 
							
 | 
				
			||||||
		// Send message
 | 
							// Send message
 | 
				
			||||||
		sendMessage(messages);
 | 
							message(messages);
 | 
				
			||||||
	}
 | 
						}
 | 
				
			||||||
	
 | 
						
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -571,7 +571,7 @@ public class EngineMain extends EngineAbstract
 | 
				
			|||||||
			for (Faction nearbyFaction : nearbyFactions)
 | 
								for (Faction nearbyFaction : nearbyFactions)
 | 
				
			||||||
			{
 | 
								{
 | 
				
			||||||
				if (claimnear.has(newFaction, nearbyFaction)) continue;
 | 
									if (claimnear.has(newFaction, nearbyFaction)) continue;
 | 
				
			||||||
				msender.sendMessage(claimnear.createDeniedMessage(msender, nearbyFaction));
 | 
									msender.message(claimnear.createDeniedMessage(msender, nearbyFaction));
 | 
				
			||||||
				event.setCancelled(true);
 | 
									event.setCancelled(true);
 | 
				
			||||||
				return;
 | 
									return;
 | 
				
			||||||
			}
 | 
								}
 | 
				
			||||||
@@ -691,7 +691,7 @@ public class EngineMain extends EngineAbstract
 | 
				
			|||||||
		if (mplayer.isMapAutoUpdating())
 | 
							if (mplayer.isMapAutoUpdating())
 | 
				
			||||||
		{
 | 
							{
 | 
				
			||||||
			List<String> message = BoardColl.get().getMap(mplayer, chunkTo, player.getLocation().getYaw(), Const.MAP_WIDTH, Const.MAP_HEIGHT);
 | 
								List<String> message = BoardColl.get().getMap(mplayer, chunkTo, player.getLocation().getYaw(), Const.MAP_WIDTH, Const.MAP_HEIGHT);
 | 
				
			||||||
			mplayer.sendMessage(message);
 | 
								mplayer.message(message);
 | 
				
			||||||
		}
 | 
							}
 | 
				
			||||||
		else if (factionFrom != factionTo)
 | 
							else if (factionFrom != factionTo)
 | 
				
			||||||
		{
 | 
							{
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -359,7 +359,7 @@ public class MPerm extends Entity<MPerm> implements Prioritized, Registerable
 | 
				
			|||||||
		Rel rel = mplayer.getRelationTo(hostFaction);
 | 
							Rel rel = mplayer.getRelationTo(hostFaction);
 | 
				
			||||||
		if (hostFaction.isPermitted(this, rel)) return true;
 | 
							if (hostFaction.isPermitted(this, rel)) return true;
 | 
				
			||||||
		
 | 
							
 | 
				
			||||||
		if (verboose) mplayer.sendMessage(this.createDeniedMessage(mplayer, hostFaction));
 | 
							if (verboose) mplayer.message(this.createDeniedMessage(mplayer, hostFaction));
 | 
				
			||||||
		
 | 
							
 | 
				
			||||||
		return false;
 | 
							return false;
 | 
				
			||||||
	}
 | 
						}
 | 
				
			||||||
@@ -382,7 +382,7 @@ public class MPerm extends Entity<MPerm> implements Prioritized, Registerable
 | 
				
			|||||||
			{
 | 
								{
 | 
				
			||||||
				if (verboose && !hasTerritoryAccess)
 | 
									if (verboose && !hasTerritoryAccess)
 | 
				
			||||||
				{
 | 
									{
 | 
				
			||||||
					mplayer.sendMessage(this.createDeniedMessage(mplayer, hostFaction));
 | 
										mplayer.message(this.createDeniedMessage(mplayer, hostFaction));
 | 
				
			||||||
				}
 | 
									}
 | 
				
			||||||
				return hasTerritoryAccess;
 | 
									return hasTerritoryAccess;
 | 
				
			||||||
			}
 | 
								}
 | 
				
			||||||
 
 | 
				
			|||||||
		Reference in New Issue
	
	Block a user