diff --git a/build.gradle b/build.gradle index 2081b5e..d4a4497 100644 --- a/build.gradle +++ b/build.gradle @@ -22,9 +22,9 @@ group= "com.bebehp.mc.eewreciever" // http://maven.apache.org/guides/mini/guide- archivesBaseName = "EEWReciever" minecraft { - version = "1.10.2-12.18.1.2011" + version = "1.11.2-13.20.0.2206" runDir = "eclipse" - mappings = "snapshot_20160518" + mappings = "snapshot_20161220" } jar { diff --git a/src/main/java/com/bebehp/mc/eewreciever/ChatUtil.java b/src/main/java/com/bebehp/mc/eewreciever/ChatUtil.java index 774e92d..9a780bb 100644 --- a/src/main/java/com/bebehp/mc/eewreciever/ChatUtil.java +++ b/src/main/java/com/bebehp/mc/eewreciever/ChatUtil.java @@ -15,7 +15,7 @@ public abstract class ChatUtil { public static void sendPlayerChat(final ICommandSender target, final ITextComponent... components) { for (final ITextComponent line : components) { - target.addChatMessage(line); + target.sendMessage(line); } } @@ -23,7 +23,7 @@ public static void sendServerChat(final ITextComponent... components) { final PlayerList player = FMLCommonHandler.instance().getMinecraftServerInstance().getPlayerList(); for (final ITextComponent line : components) { - player.sendChatMsg(line); + player.sendMessage(line); } } diff --git a/src/main/java/com/bebehp/mc/eewreciever/client/ClientAuthChecker.java b/src/main/java/com/bebehp/mc/eewreciever/client/ClientAuthChecker.java index 22d467d..cfa669e 100644 --- a/src/main/java/com/bebehp/mc/eewreciever/client/ClientAuthChecker.java +++ b/src/main/java/com/bebehp/mc/eewreciever/client/ClientAuthChecker.java @@ -20,11 +20,11 @@ public class ClientAuthChecker { @SubscribeEvent public void onTick(final ClientTickEvent event) { final Minecraft mc = Minecraft.getMinecraft(); - if (EEWRecieverMod.accessToken == null && notification && mc.isSingleplayer() && event.phase == Phase.END && mc.thePlayer != null) { - final EntityPlayer player = Minecraft.getMinecraft().thePlayer; - player.addChatComponentMessage(ChatUtil.byText("[EEWReciever]Twitter連携認証(緊急地震速報)がされていません!")); - player.addChatComponentMessage(ChatUtil.byText("/eew setup でセットアップを開始します")); - player.addChatComponentMessage(ChatUtil.byText("Twitter連携を無効にするには、configを変更し再起動して下さい")); + if (EEWRecieverMod.accessToken==null&¬ification&&mc.isSingleplayer()&&event.phase==Phase.END&&mc.player!=null) { + final EntityPlayer player = Minecraft.getMinecraft().player; + player.sendMessage(ChatUtil.byText("[EEWReciever]Twitter連携認証(緊急地震速報)がされていません!")); + player.sendMessage(ChatUtil.byText("/eew setup でセットアップを開始します")); + player.sendMessage(ChatUtil.byText("Twitter連携を無効にするには、configを変更し再起動して下さい")); notification = false; } } diff --git a/src/main/java/com/bebehp/mc/eewreciever/common/EEWCommandBase.java b/src/main/java/com/bebehp/mc/eewreciever/common/EEWCommandBase.java index 164299c..9f39979 100644 --- a/src/main/java/com/bebehp/mc/eewreciever/common/EEWCommandBase.java +++ b/src/main/java/com/bebehp/mc/eewreciever/common/EEWCommandBase.java @@ -42,12 +42,12 @@ public EEWCommandBase(final TweetQuakeSetup tweetQuakeSetup) { } @Override - public String getCommandName() { + public String getName() { return "eewreciever"; } @Override - public List getCommandAliases() { + public List getAliases() { return Arrays.asList("eew"); } @@ -55,7 +55,7 @@ public List getCommandAliases() { public abstract int getRequiredPermissionLevel(); @Override - public String getCommandUsage(final ICommandSender icommandsender) { + public String getUsage(final ICommandSender icommandsender) { return "/eewreciever Tipe "; } @@ -208,7 +208,7 @@ public void execute(final MinecraftServer server, final ICommandSender icommands } @Override - public List getTabCompletionOptions(final MinecraftServer server, final ICommandSender sender, final String[] astring, @Nullable final BlockPos pos) { + public List getTabCompletions(final MinecraftServer server, final ICommandSender sender, final String[] astring, @Nullable final BlockPos pos) { if (astring.length<=1&&(ConfigurationHandler.debugMode||!limitInDebugMode())) { return getListOfStringsMatchingLastWord(astring, "p2p", "twitter", "setup", "deletesettings", "enable", "disable"); } else if (astring.length==1) { diff --git a/src/main/java/com/bebehp/mc/eewreciever/server/ServerAuthChecker.java b/src/main/java/com/bebehp/mc/eewreciever/server/ServerAuthChecker.java index 18a27e7..5c6db1f 100644 --- a/src/main/java/com/bebehp/mc/eewreciever/server/ServerAuthChecker.java +++ b/src/main/java/com/bebehp/mc/eewreciever/server/ServerAuthChecker.java @@ -16,14 +16,14 @@ public class ServerAuthChecker { @SideOnly(Side.SERVER) @SubscribeEvent public void onPlayerLogin(final PlayerEvent.PlayerLoggedInEvent event) { - final String name = event.player.getGameProfile().getName(); + final String name = event.player.getGameProfile().getName(); if (notification) { if (isOP(name)) { - event.player.addChatComponentMessage(ChatUtil.byText("[EEWReciever]Twitter連携認証(緊急地震速報)がされていません!")); - event.player.addChatComponentMessage(ChatUtil.byText("/eew setup でセットアップを開始します")); - event.player.addChatComponentMessage(ChatUtil.byText("Twitter連携を無効にするには、configを変更し再起動して下さい")); + event.player.sendMessage(ChatUtil.byText("[EEWReciever]Twitter連携認証(緊急地震速報)がされていません!")); + event.player.sendMessage(ChatUtil.byText("/eew setup でセットアップを開始します")); + event.player.sendMessage(ChatUtil.byText("Twitter連携を無効にするには、configを変更し再起動して下さい")); } else { - event.player.addChatComponentMessage(ChatUtil.byText("[EEWReciever]Setupされていません。OPに連絡して下さい。")); + event.player.sendMessage(ChatUtil.byText("[EEWReciever]Setupされていません。OPに連絡して下さい。")); } } } @@ -31,7 +31,7 @@ public void onPlayerLogin(final PlayerEvent.PlayerLoggedInEvent event) { private boolean isOP(final String name) { final String[] opPlayers = FMLCommonHandler.instance().getMinecraftServerInstance().getPlayerList().getOppedPlayerNames(); for (final String line : opPlayers) { - if (line == name) + if (line==name) return true; } return false;