Code cleanup

This commit is contained in:
LemADEC 2017-07-17 21:28:27 +02:00
parent 12efbbba02
commit 42c4070b4a
4 changed files with 14 additions and 14 deletions

View file

@ -51,14 +51,14 @@ public class Commons {
.replaceAll("(" + CHAR_FORMATTING + ".)", "");
}
public static void addChatMessage(final ICommandSender sender, final String message) {
if (sender == null) {
WarpDrive.logger.error("Unable to send message to NULL sender: " + message);
public static void addChatMessage(final ICommandSender commandSender, final String message) {
if (commandSender == null) {
WarpDrive.logger.error("Unable to send message to NULL commandSender: " + message);
return;
}
final String[] lines = updateEscapeCodes(message).split("\n");
for (String line : lines) {
sender.addChatMessage(new ChatComponentText(line));
commandSender.addChatMessage(new ChatComponentText(line));
}
// logger.info(message);

View file

@ -579,7 +579,7 @@ public class TileEntityShipController extends TileEntityAbstractInterfaced imple
if (arguments.length == 1) {
this.nameTarget = (String) arguments[0];
}
return new Object[] {nameTarget};
return new Object[] { nameTarget };
}
@Override

View file

@ -432,11 +432,11 @@ public class TileEntityShipCore extends TileEntityAbstractEnergy implements ISta
for (int i = 0; i < controller.players.size(); i++) {
final String playerName = controller.players.get(i);
final EntityPlayerMP player = MinecraftServer.getServer().getConfigurationManager().func_152612_a(playerName);
final EntityPlayerMP entityPlayerMP = MinecraftServer.getServer().getConfigurationManager().func_152612_a(playerName);
if ( player != null
&& isOutsideBB(aabb, MathHelper.floor_double(player.posX), MathHelper.floor_double(player.posY), MathHelper.floor_double(player.posZ))) {
summonPlayer(player);
if ( entityPlayerMP != null
&& isOutsideBB(aabb, MathHelper.floor_double(entityPlayerMP.posX), MathHelper.floor_double(entityPlayerMP.posY), MathHelper.floor_double(entityPlayerMP.posZ)) ) {
summonPlayer(entityPlayerMP);
}
}
}
@ -446,11 +446,11 @@ public class TileEntityShipCore extends TileEntityAbstractEnergy implements ISta
for (int i = 0; i < controller.players.size(); i++) {
final String playerName = controller.players.get(i);
final EntityPlayerMP player = MinecraftServer.getServer().getConfigurationManager().func_152612_a(playerName);
final EntityPlayerMP entityPlayerMP = MinecraftServer.getServer().getConfigurationManager().func_152612_a(playerName);
if ( player != null && playerName.equals(nickname)
&& isOutsideBB(aabb, MathHelper.floor_double(player.posX), MathHelper.floor_double(player.posY), MathHelper.floor_double(player.posZ))) {
summonPlayer(player);
if ( entityPlayerMP != null && playerName.equals(nickname)
&& isOutsideBB(aabb, MathHelper.floor_double(entityPlayerMP.posX), MathHelper.floor_double(entityPlayerMP.posY), MathHelper.floor_double(entityPlayerMP.posZ)) ) {
summonPlayer(entityPlayerMP);
return;
}
}

View file

@ -211,7 +211,7 @@ public class Dictionary {
+ "- NoMass: this entity doesn't count when calculating ship volume/mass (default: Galacticraft air bubble).\n"
+ "- LeftBehind: this entity won't move with your ship (default: Galacticraft air bubble).\n"
+ "- NonLivingTarget: this non-living entity can be targeted/removed by weapons (default: ItemFrame, Painting).\n"
+ "- LivingWithoutAir: this living entity doesn't need air to live (default: vanilla zombies and skeletons.");
+ "- LivingWithoutAir: this living entity doesn't need air to live (default: vanilla zombies and skeletons).");
ConfigCategory categoryEntityTags = config.getCategory("entity_tags");
String[] taggedEntitiesName = categoryEntityTags.getValues().keySet().toArray(new String[0]);