-
Notifications
You must be signed in to change notification settings - Fork 1
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
1 parent
b003482
commit 5b8c86e
Showing
2 changed files
with
87 additions
and
87 deletions.
There are no files selected for viewing
26 changes: 13 additions & 13 deletions
26
...ain/java/tk/trollagent/fly/SimpleFly.java → ...ain/java/de/trollagent/fly/SimpleFly.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 |
---|---|---|
@@ -1,13 1,13 @@ | ||
package tk.trollagent.fly; | ||
|
||
import org.bukkit.plugin.java.JavaPlugin; | ||
import tk.trollagent.fly.commands.Fly; | ||
|
||
public final class SimpleFly extends JavaPlugin { | ||
|
||
@Override | ||
public void onEnable() { | ||
getCommand("fly").setExecutor(new Fly()); | ||
} | ||
|
||
} | ||
package de.trollagent.fly; | ||
|
||
import de.trollagent.fly.commands.Fly; | ||
import org.bukkit.plugin.java.JavaPlugin; | ||
|
||
public final class SimpleFly extends JavaPlugin { | ||
|
||
@Override | ||
public void onEnable() { | ||
getCommand("fly").setExecutor(new Fly()); | ||
} | ||
|
||
} |
148 changes: 74 additions & 74 deletions
148
.../java/tk/trollagent/fly/commands/Fly.java → .../java/de/trollagent/fly/commands/Fly.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 |
---|---|---|
@@ -1,75 1,75 @@ | ||
package tk.trollagent.fly.commands; | ||
|
||
import org.bukkit.Bukkit; | ||
import org.bukkit.ChatColor; | ||
import org.bukkit.command.Command; | ||
import org.bukkit.command.CommandExecutor; | ||
import org.bukkit.command.CommandSender; | ||
import org.bukkit.entity.Player; | ||
|
||
public class Fly implements CommandExecutor { | ||
@Override | ||
public boolean onCommand(CommandSender sender, Command command, String label, String[] args) { | ||
if (sender instanceof Player) { | ||
|
||
Player player = (Player) sender; | ||
|
||
if (args.length == 1) { | ||
if (player.hasPermission("simplefly.fly.other")) { | ||
Player target = Bukkit.getPlayer(args[0]); | ||
if (player.getServer().getPlayer(args[0]) != null) { | ||
if (target.getAllowFlight() == true) { | ||
target.setAllowFlight(false); | ||
target.sendMessage(ChatColor.RED "Flight mode activated!"); | ||
sender.sendMessage(ChatColor.RED "Flight mode deactivated for " target.getDisplayName() "!"); | ||
} else { | ||
target.setAllowFlight(true); | ||
target.sendMessage(ChatColor.GREEN "Flight mode activated!"); | ||
sender.sendMessage(ChatColor.GREEN "Flight mode activated for " target.getDisplayName() "!"); | ||
} | ||
return false; | ||
} else { | ||
sender.sendMessage(ChatColor.RED "The Player is not Online"); | ||
} | ||
} else { | ||
sender.sendMessage(ChatColor.RED "You dont have the Permission!"); | ||
} | ||
} else if (args.length == 0) { | ||
if (player.hasPermission("simplefly.fly.self")) { | ||
if (player.getAllowFlight() == true) { | ||
player.setAllowFlight(false); | ||
player.sendMessage(ChatColor.RED "Flight mode deactivated!"); | ||
} else { | ||
player.setAllowFlight(true); | ||
player.sendMessage(ChatColor.GREEN "Flight mode activated!"); | ||
} | ||
} else { | ||
sender.sendMessage(ChatColor.RED "You dont have the Permission!"); | ||
return false; | ||
} | ||
} | ||
return false; | ||
}else { | ||
if (args.length == 1) { | ||
Player target = Bukkit.getPlayer(args[0]); | ||
if (sender.getServer().getPlayer(args[0]) != null) { | ||
if (target.getAllowFlight() == true) { | ||
target.setAllowFlight(false); | ||
target.sendMessage(ChatColor.RED "Flight mode deactivated!"); | ||
sender.sendMessage(ChatColor.RED "Flight mode deactivated for " target.getDisplayName() "!"); | ||
} else { | ||
target.setAllowFlight(true); | ||
target.sendMessage(ChatColor.GREEN "Flight mode activated!"); | ||
sender.sendMessage(ChatColor.GREEN "Flight mode activated for " target.getDisplayName() "!"); | ||
} | ||
return false; | ||
} else { | ||
sender.sendMessage(ChatColor.RED "The Player is not Online"); | ||
} | ||
} else { | ||
sender.sendMessage(ChatColor.RED "The console can not fly, please type in a player name!"); | ||
} | ||
}return false; | ||
|
||
} | ||
package de.trollagent.fly.commands; | ||
|
||
import org.bukkit.Bukkit; | ||
import org.bukkit.ChatColor; | ||
import org.bukkit.command.Command; | ||
import org.bukkit.command.CommandExecutor; | ||
import org.bukkit.command.CommandSender; | ||
import org.bukkit.entity.Player; | ||
|
||
public class Fly implements CommandExecutor { | ||
@Override | ||
public boolean onCommand(CommandSender sender, Command command, String label, String[] args) { | ||
if (sender instanceof Player) { | ||
|
||
Player player = (Player) sender; | ||
|
||
if (args.length == 1) { | ||
if (player.hasPermission("simplefly.fly.other")) { | ||
Player target = Bukkit.getPlayer(args[0]); | ||
if (player.getServer().getPlayer(args[0]) != null) { | ||
if (target.getAllowFlight() == true) { | ||
target.setAllowFlight(false); | ||
target.sendMessage(ChatColor.RED "Flight mode activated!"); | ||
sender.sendMessage(ChatColor.RED "Flight mode deactivated for " target.getDisplayName() "!"); | ||
} else { | ||
target.setAllowFlight(true); | ||
target.sendMessage(ChatColor.GREEN "Flight mode activated!"); | ||
sender.sendMessage(ChatColor.GREEN "Flight mode activated for " target.getDisplayName() "!"); | ||
} | ||
return false; | ||
} else { | ||
sender.sendMessage(ChatColor.RED "The Player is not Online"); | ||
} | ||
} else { | ||
sender.sendMessage(ChatColor.RED "You dont have the Permission!"); | ||
} | ||
} else if (args.length == 0) { | ||
if (player.hasPermission("simplefly.fly.self")) { | ||
if (player.getAllowFlight() == true) { | ||
player.setAllowFlight(false); | ||
player.sendMessage(ChatColor.RED "Flight mode deactivated!"); | ||
} else { | ||
player.setAllowFlight(true); | ||
player.sendMessage(ChatColor.GREEN "Flight mode activated!"); | ||
} | ||
} else { | ||
sender.sendMessage(ChatColor.RED "You dont have the Permission!"); | ||
return false; | ||
} | ||
} | ||
return false; | ||
}else { | ||
if (args.length == 1) { | ||
Player target = Bukkit.getPlayer(args[0]); | ||
if (sender.getServer().getPlayer(args[0]) != null) { | ||
if (target.getAllowFlight() == true) { | ||
target.setAllowFlight(false); | ||
target.sendMessage(ChatColor.RED "Flight mode deactivated!"); | ||
sender.sendMessage(ChatColor.RED "Flight mode deactivated for " target.getDisplayName() "!"); | ||
} else { | ||
target.setAllowFlight(true); | ||
target.sendMessage(ChatColor.GREEN "Flight mode activated!"); | ||
sender.sendMessage(ChatColor.GREEN "Flight mode activated for " target.getDisplayName() "!"); | ||
} | ||
return false; | ||
} else { | ||
sender.sendMessage(ChatColor.RED "The Player is not Online"); | ||
} | ||
} else { | ||
sender.sendMessage(ChatColor.RED "The console can not fly, please type in a player name!"); | ||
} | ||
}return false; | ||
|
||
} | ||
} |