-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
6 changed files
with
216 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
49 changes: 49 additions & 0 deletions
49
src/main/java/com/github/mori01231/lifecore/Pve0CommandExecutor.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,49 @@ | ||
package com.github.mori01231.lifecore; | ||
|
||
import org.bukkit.ChatColor; | ||
import org.bukkit.command.Command; | ||
import org.bukkit.command.CommandExecutor; | ||
import org.bukkit.command.CommandSender; | ||
import org.bukkit.entity.Player; | ||
|
||
import java.io.ByteArrayOutputStream; | ||
import java.io.DataOutputStream; | ||
import java.io.IOException; | ||
|
||
import static org.bukkit.Bukkit.getServer; | ||
|
||
public class Pve0CommandExecutor implements CommandExecutor { | ||
@Override | ||
public boolean onCommand(CommandSender sender, Command command, String label, String[] args) { | ||
|
||
if (sender instanceof Player){ | ||
Player player = (Player) sender; | ||
String playerName = player.getName(); | ||
|
||
if(LifeCore.getInstance().getConfig().getBoolean("use-pve-command-as-teleport")){ | ||
String pve = LifeCore.getInstance().getConfig().getString("pve-teleport"); | ||
getServer().dispatchCommand(getServer().getConsoleSender(), "mvtp " + playerName + " " + pve); | ||
sender.sendMessage(ChatColor.translateAlternateColorCodes('&',"&3ダンジョンロビーにテレポートしました。" )); | ||
|
||
}else{ | ||
// create bytearray for sending player to server | ||
ByteArrayOutputStream b = new ByteArrayOutputStream(); | ||
DataOutputStream out = new DataOutputStream(b); | ||
try { | ||
out.writeUTF("Connect"); | ||
out.writeUTF("lifepve"); | ||
} catch (IOException e) { | ||
// never happens | ||
} | ||
player.sendPluginMessage(LifeCore.getInstance(), "BungeeCord", b.toByteArray()); | ||
} | ||
|
||
} | ||
else{ | ||
sender.sendMessage(ChatColor.translateAlternateColorCodes('&',"&3このコマンドはコンソールから使用できません。" )); | ||
} | ||
|
||
|
||
return true; | ||
} | ||
} |
49 changes: 49 additions & 0 deletions
49
src/main/java/com/github/mori01231/lifecore/Pve1CommandExecutor.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,49 @@ | ||
package com.github.mori01231.lifecore; | ||
|
||
import org.bukkit.ChatColor; | ||
import org.bukkit.command.Command; | ||
import org.bukkit.command.CommandExecutor; | ||
import org.bukkit.command.CommandSender; | ||
import org.bukkit.entity.Player; | ||
|
||
import java.io.ByteArrayOutputStream; | ||
import java.io.DataOutputStream; | ||
import java.io.IOException; | ||
|
||
import static org.bukkit.Bukkit.getServer; | ||
|
||
public class Pve1CommandExecutor implements CommandExecutor { | ||
@Override | ||
public boolean onCommand(CommandSender sender, Command command, String label, String[] args) { | ||
|
||
if (sender instanceof Player){ | ||
Player player = (Player) sender; | ||
String playerName = player.getName(); | ||
|
||
if(LifeCore.getInstance().getConfig().getBoolean("use-pve-command-as-teleport")){ | ||
String pve = LifeCore.getInstance().getConfig().getString("pve-teleport"); | ||
getServer().dispatchCommand(getServer().getConsoleSender(), "mvtp " + playerName + " " + pve); | ||
sender.sendMessage(ChatColor.translateAlternateColorCodes('&',"&3ダンジョンロビーにテレポートしました。" )); | ||
|
||
}else{ | ||
// create bytearray for sending player to server | ||
ByteArrayOutputStream b = new ByteArrayOutputStream(); | ||
DataOutputStream out = new DataOutputStream(b); | ||
try { | ||
out.writeUTF("Connect"); | ||
out.writeUTF("lifepve1"); | ||
} catch (IOException e) { | ||
// never happens | ||
} | ||
player.sendPluginMessage(LifeCore.getInstance(), "BungeeCord", b.toByteArray()); | ||
} | ||
|
||
} | ||
else{ | ||
sender.sendMessage(ChatColor.translateAlternateColorCodes('&',"&3このコマンドはコンソールから使用できません。" )); | ||
} | ||
|
||
|
||
return true; | ||
} | ||
} |
49 changes: 49 additions & 0 deletions
49
src/main/java/com/github/mori01231/lifecore/Pve2CommandExecutor.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,49 @@ | ||
package com.github.mori01231.lifecore; | ||
|
||
import org.bukkit.ChatColor; | ||
import org.bukkit.command.Command; | ||
import org.bukkit.command.CommandExecutor; | ||
import org.bukkit.command.CommandSender; | ||
import org.bukkit.entity.Player; | ||
|
||
import java.io.ByteArrayOutputStream; | ||
import java.io.DataOutputStream; | ||
import java.io.IOException; | ||
|
||
import static org.bukkit.Bukkit.getServer; | ||
|
||
public class Pve2CommandExecutor implements CommandExecutor { | ||
@Override | ||
public boolean onCommand(CommandSender sender, Command command, String label, String[] args) { | ||
|
||
if (sender instanceof Player){ | ||
Player player = (Player) sender; | ||
String playerName = player.getName(); | ||
|
||
if(LifeCore.getInstance().getConfig().getBoolean("use-pve-command-as-teleport")){ | ||
String pve = LifeCore.getInstance().getConfig().getString("pve-teleport"); | ||
getServer().dispatchCommand(getServer().getConsoleSender(), "mvtp " + playerName + " " + pve); | ||
sender.sendMessage(ChatColor.translateAlternateColorCodes('&',"&3ダンジョンロビーにテレポートしました。" )); | ||
|
||
}else{ | ||
// create bytearray for sending player to server | ||
ByteArrayOutputStream b = new ByteArrayOutputStream(); | ||
DataOutputStream out = new DataOutputStream(b); | ||
try { | ||
out.writeUTF("Connect"); | ||
out.writeUTF("lifepve2"); | ||
} catch (IOException e) { | ||
// never happens | ||
} | ||
player.sendPluginMessage(LifeCore.getInstance(), "BungeeCord", b.toByteArray()); | ||
} | ||
|
||
} | ||
else{ | ||
sender.sendMessage(ChatColor.translateAlternateColorCodes('&',"&3このコマンドはコンソールから使用できません。" )); | ||
} | ||
|
||
|
||
return true; | ||
} | ||
} |
49 changes: 49 additions & 0 deletions
49
src/main/java/com/github/mori01231/lifecore/Pve3CommandExecutor.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,49 @@ | ||
package com.github.mori01231.lifecore; | ||
|
||
import org.bukkit.ChatColor; | ||
import org.bukkit.command.Command; | ||
import org.bukkit.command.CommandExecutor; | ||
import org.bukkit.command.CommandSender; | ||
import org.bukkit.entity.Player; | ||
|
||
import java.io.ByteArrayOutputStream; | ||
import java.io.DataOutputStream; | ||
import java.io.IOException; | ||
|
||
import static org.bukkit.Bukkit.getServer; | ||
|
||
public class Pve3CommandExecutor implements CommandExecutor { | ||
@Override | ||
public boolean onCommand(CommandSender sender, Command command, String label, String[] args) { | ||
|
||
if (sender instanceof Player){ | ||
Player player = (Player) sender; | ||
String playerName = player.getName(); | ||
|
||
if(LifeCore.getInstance().getConfig().getBoolean("use-pve-command-as-teleport")){ | ||
String pve = LifeCore.getInstance().getConfig().getString("pve-teleport"); | ||
getServer().dispatchCommand(getServer().getConsoleSender(), "mvtp " + playerName + " " + pve); | ||
sender.sendMessage(ChatColor.translateAlternateColorCodes('&',"&3ダンジョンロビーにテレポートしました。" )); | ||
|
||
}else{ | ||
// create bytearray for sending player to server | ||
ByteArrayOutputStream b = new ByteArrayOutputStream(); | ||
DataOutputStream out = new DataOutputStream(b); | ||
try { | ||
out.writeUTF("Connect"); | ||
out.writeUTF("lifepve3"); | ||
} catch (IOException e) { | ||
// never happens | ||
} | ||
player.sendPluginMessage(LifeCore.getInstance(), "BungeeCord", b.toByteArray()); | ||
} | ||
|
||
} | ||
else{ | ||
sender.sendMessage(ChatColor.translateAlternateColorCodes('&',"&3このコマンドはコンソールから使用できません。" )); | ||
} | ||
|
||
|
||
return true; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters