forked from xjboss/KCauldronX
Make configurable messages, close #244
This commit is contained in:
parent
955af15697
commit
0aad7977fc
@ -10,7 +10,7 @@
|
|||||||
import java.util.HashMap;
|
import java.util.HashMap;
|
||||||
import java.util.HashSet;
|
import java.util.HashSet;
|
||||||
import java.util.Iterator;
|
import java.util.Iterator;
|
||||||
@@ -1032,4 +1034,56 @@
|
@@ -1036,4 +1038,56 @@
|
||||||
throw new RuntimeException("WHAT?");
|
throw new RuntimeException("WHAT?");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -294,7 +294,21 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
public String allowUserToConnect(SocketAddress p_148542_1_, GameProfile p_148542_2_)
|
public String allowUserToConnect(SocketAddress p_148542_1_, GameProfile p_148542_2_)
|
||||||
@@ -372,6 +516,71 @@
|
@@ -352,7 +496,7 @@
|
||||||
|
}
|
||||||
|
else if (!this.func_152607_e(p_148542_2_))
|
||||||
|
{
|
||||||
|
- return "You are not white-listed on this server!";
|
||||||
|
+ return org.spigotmc.SpigotConfig.whitelistMessage;
|
||||||
|
}
|
||||||
|
else if (this.bannedIPs.func_152708_a(p_148542_1_))
|
||||||
|
{
|
||||||
|
@@ -368,10 +512,75 @@
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
- return this.playerEntityList.size() >= this.maxPlayers ? "The server is full!" : null;
|
||||||
|
+ return this.playerEntityList.size() >= this.maxPlayers ? org.spigotmc.SpigotConfig.serverFullMessage : null;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -33,7 +33,7 @@
|
|||||||
private final MinecraftServer field_147387_a;
|
private final MinecraftServer field_147387_a;
|
||||||
private final NetworkManager field_147386_b;
|
private final NetworkManager field_147386_b;
|
||||||
private static final String __OBFID = "CL_00001456";
|
private static final String __OBFID = "CL_00001456";
|
||||||
@@ -39,6 +56,52 @@
|
@@ -39,21 +56,94 @@
|
||||||
this.field_147386_b.setConnectionState(EnumConnectionState.LOGIN);
|
this.field_147386_b.setConnectionState(EnumConnectionState.LOGIN);
|
||||||
ChatComponentText chatcomponenttext;
|
ChatComponentText chatcomponenttext;
|
||||||
|
|
||||||
@ -85,8 +85,18 @@
|
|||||||
+
|
+
|
||||||
if (p_147383_1_.func_149595_d() > 5)
|
if (p_147383_1_.func_149595_d() > 5)
|
||||||
{
|
{
|
||||||
chatcomponenttext = new ChatComponentText("Outdated server! I\'m still on 1.7.10");
|
- chatcomponenttext = new ChatComponentText("Outdated server! I\'m still on 1.7.10");
|
||||||
@@ -54,6 +117,33 @@
|
+ chatcomponenttext = new ChatComponentText(java.text.MessageFormat.format(org.spigotmc.SpigotConfig.outdatedServerMessage, "1.7.10"));
|
||||||
|
this.field_147386_b.scheduleOutboundPacket(new S00PacketDisconnect(chatcomponenttext), new GenericFutureListener[0]);
|
||||||
|
this.field_147386_b.closeChannel(chatcomponenttext);
|
||||||
|
}
|
||||||
|
else if (p_147383_1_.func_149595_d() < 5)
|
||||||
|
{
|
||||||
|
- chatcomponenttext = new ChatComponentText("Outdated client! Please use 1.7.10");
|
||||||
|
+ chatcomponenttext = new ChatComponentText(java.text.MessageFormat.format(org.spigotmc.SpigotConfig.outdatedClientMessage, "1.7.10"));
|
||||||
|
this.field_147386_b.scheduleOutboundPacket(new S00PacketDisconnect(chatcomponenttext), new GenericFutureListener[0]);
|
||||||
|
this.field_147386_b.closeChannel(chatcomponenttext);
|
||||||
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
this.field_147386_b.setNetHandler(new NetHandlerLoginServer(this.field_147387_a, this.field_147386_b));
|
this.field_147386_b.setNetHandler(new NetHandlerLoginServer(this.field_147387_a, this.field_147386_b));
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
--- ../src-base/minecraft/net/minecraftforge/oredict/OreDictionary.java
|
--- ../src-base/minecraft/net/minecraftforge/oredict/OreDictionary.java
|
||||||
+++ ../src-work/minecraft/net/minecraftforge/oredict/OreDictionary.java
|
+++ ../src-work/minecraft/net/minecraftforge/oredict/OreDictionary.java
|
||||||
@@ -216,7 +216,7 @@
|
@@ -221,7 +221,7 @@
|
||||||
{
|
{
|
||||||
ShapedRecipes recipe = (ShapedRecipes)obj;
|
ShapedRecipes recipe = (ShapedRecipes)obj;
|
||||||
ItemStack output = recipe.getRecipeOutput();
|
ItemStack output = recipe.getRecipeOutput();
|
||||||
@ -9,7 +9,7 @@
|
|||||||
{
|
{
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
@@ -231,7 +231,7 @@
|
@@ -236,7 +236,7 @@
|
||||||
{
|
{
|
||||||
ShapelessRecipes recipe = (ShapelessRecipes)obj;
|
ShapelessRecipes recipe = (ShapelessRecipes)obj;
|
||||||
ItemStack output = recipe.getRecipeOutput();
|
ItemStack output = recipe.getRecipeOutput();
|
||||||
|
@ -2,9 +2,12 @@ package org.spigotmc;
|
|||||||
|
|
||||||
import java.io.File;
|
import java.io.File;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
|
import org.bukkit.Bukkit;
|
||||||
import org.bukkit.command.Command;
|
import org.bukkit.command.Command;
|
||||||
import org.bukkit.command.CommandSender;
|
import org.bukkit.command.CommandSender;
|
||||||
import org.bukkit.craftbukkit.util.CraftChatMessage;
|
import org.bukkit.craftbukkit.util.CraftChatMessage;
|
||||||
|
import org.bukkit.entity.Player;
|
||||||
|
|
||||||
public class RestartCommand extends Command
|
public class RestartCommand extends Command
|
||||||
{
|
{
|
||||||
@ -40,12 +43,14 @@ public class RestartCommand extends Command
|
|||||||
{
|
{
|
||||||
System.out.println( "Attempting to restart with " + SpigotConfig.restartScript );
|
System.out.println( "Attempting to restart with " + SpigotConfig.restartScript );
|
||||||
|
|
||||||
|
// Forbid new logons
|
||||||
|
net.minecraft.server.dedicated.DedicatedServer.allowPlayerLogins = false;
|
||||||
|
|
||||||
// Kick all players
|
// Kick all players
|
||||||
for ( net.minecraft.entity.player.EntityPlayerMP p : (List< net.minecraft.entity.player.EntityPlayerMP>) net.minecraft.server.MinecraftServer.getServer().getConfigurationManager().playerEntityList )
|
for (Player player : Bukkit.getOnlinePlayers()) {
|
||||||
{
|
player.kickPlayer(SpigotConfig.restartMessage);
|
||||||
p.playerNetServerHandler.kickPlayerFromServer(SpigotConfig.restartMessage);
|
|
||||||
p.playerNetServerHandler.netManager.isChannelOpen();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// Give the socket a chance to send the packets
|
// Give the socket a chance to send the packets
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
@ -67,7 +72,7 @@ public class RestartCommand extends Command
|
|||||||
// Actually shutdown
|
// Actually shutdown
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
net.minecraft.server.MinecraftServer.getServer().stopServer();
|
Bukkit.shutdown();
|
||||||
} catch ( Throwable t )
|
} catch ( Throwable t )
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
@ -88,7 +93,7 @@ public class RestartCommand extends Command
|
|||||||
{
|
{
|
||||||
Runtime.getRuntime().exec( new String[]
|
Runtime.getRuntime().exec( new String[]
|
||||||
{
|
{
|
||||||
"sh", file.getPath()
|
"/bin/sh", file.getPath()
|
||||||
} );
|
} );
|
||||||
}
|
}
|
||||||
} catch ( Exception e )
|
} catch ( Exception e )
|
||||||
|
Loading…
Reference in New Issue
Block a user