From 2be72d6453015041f31e1df58d3a7f6ce39229db Mon Sep 17 00:00:00 2001 From: "U-NIFLHEIM\\Lax" Date: Mon, 18 Apr 2016 06:18:34 -0700 Subject: [PATCH] Sponsored by: Emacs --- .gitignore | 62 +++++++++++++++++++ README.md | 1 + pom.xml | 47 ++++++++++++++ .../poweredbyhate/trollplus/TrollPlus.java | 51 +++++++++++++++ .../trollplus/Trolls/CommandBolt.java | 37 +++++++++++ .../trollplus/Trolls/CommandBurn.java | 34 ++++++++++ .../trollplus/Trolls/CommandFakeop.java | 27 ++++++++ .../trollplus/Trolls/CommandFreeze.java | 50 +++++++++++++++ .../trollplus/Trolls/CommandJarcode.java | 45 ++++++++++++++ src/main/resources/plugin.yml | 9 +++ 10 files changed, 363 insertions(+) create mode 100644 .gitignore create mode 100644 README.md create mode 100644 pom.xml create mode 100644 src/main/java/net/poweredbyhate/trollplus/TrollPlus.java create mode 100644 src/main/java/net/poweredbyhate/trollplus/Trolls/CommandBolt.java create mode 100644 src/main/java/net/poweredbyhate/trollplus/Trolls/CommandBurn.java create mode 100644 src/main/java/net/poweredbyhate/trollplus/Trolls/CommandFakeop.java create mode 100644 src/main/java/net/poweredbyhate/trollplus/Trolls/CommandFreeze.java create mode 100644 src/main/java/net/poweredbyhate/trollplus/Trolls/CommandJarcode.java create mode 100644 src/main/resources/plugin.yml diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..5897951 --- /dev/null +++ b/.gitignore @@ -0,0 +1,62 @@ +.idea/ +*.iml +target/ +*.class + +# Mobile Tools for Java (J2ME) +.mtj.tmp/ + +# Package Files # +*.jar +*.war +*.ear + +# virtual machine crash logs, see http://www.java.com/en/download/help/error_hotspot.xml +hs_err_pid* + +# ========================= +# Operating System Files +# ========================= + +# OSX +# ========================= + +.DS_Store +.AppleDouble +.LSOverride + +# Icon must end with two \r +Icon + +# Thumbnails +._* + +# Files that might appear on external disk +.Spotlight-V100 +.Trashes + +# Directories potentially created on remote AFP share +.AppleDB +.AppleDesktop +Network Trash Folder +Temporary Items +.apdisk + +# Windows +# ========================= + +# Windows image file caches +Thumbs.db +ehthumbs.db + +# Folder config file +Desktop.ini + +# Recycle Bin used on file shares +$RECYCLE.BIN/ + +# Windows Installer files +*.cab +*.msi +*.msm +*.msp diff --git a/README.md b/README.md new file mode 100644 index 0000000..dcdc7a5 --- /dev/null +++ b/README.md @@ -0,0 +1 @@ +A free version of https://www.spigotmc.org/resources/trollplus-50-off-for-one-day.20394/ that respects your software freedom(s). \ No newline at end of file diff --git a/pom.xml b/pom.xml new file mode 100644 index 0000000..1533f02 --- /dev/null +++ b/pom.xml @@ -0,0 +1,47 @@ + + + 4.0.0 + net.poweredbyhate + TrollPlus + 0.1 + + clean package + ${project.name} + ${basedir}/src/main/java + + + . + true + ${basedir}/src/main/resources/ + + *.yml + + + + + + maven-compiler-plugin + 2.3.2 + + 1.7 + 1.7 + + + + + + + spigot-repo + https://hub.spigotmc.org/nexus/content/groups/public/ + + + + + org.spigotmc + spigot-api + 1.9.2-R0.1-SNAPSHOT + + + \ No newline at end of file diff --git a/src/main/java/net/poweredbyhate/trollplus/TrollPlus.java b/src/main/java/net/poweredbyhate/trollplus/TrollPlus.java new file mode 100644 index 0000000..461816f --- /dev/null +++ b/src/main/java/net/poweredbyhate/trollplus/TrollPlus.java @@ -0,0 +1,51 @@ +package net.poweredbyhate.trollplus; + +import net.poweredbyhate.trollplus.Trolls.CommandBolt; +import net.poweredbyhate.trollplus.Trolls.CommandBurn; +import net.poweredbyhate.trollplus.Trolls.CommandFakeop; +import net.poweredbyhate.trollplus.Trolls.CommandFreeze; +import net.poweredbyhate.trollplus.Trolls.CommandJarcode; +import org.bukkit.Bukkit; +import org.bukkit.ChatColor; +import org.bukkit.event.EventHandler; +import org.bukkit.event.Listener; +import org.bukkit.event.player.PlayerJoinEvent; +import org.bukkit.plugin.java.JavaPlugin; + +/** + * Created by Lax on 4/18/2016. + */ +public class TrollPlus extends JavaPlugin implements Listener{ + + public void onEnable() { + Bukkit.getPluginManager().registerEvents(this, this); + enableCommands(); //List of commands to make: http://q.awsmpwrd.com/iVZx.png + } + + public void enableCommands() { + getCommand("burn").setExecutor(new CommandBurn(this)); + getCommand("freeze").setExecutor(new CommandFreeze(this)); + getCommand("bolt").setExecutor(new CommandBolt(this)); + //getCommand("special").setExecutor(new CommandSpecial(this)); I have yet to check what a fucking AK-47 is. + getCommand("fakeop").setExecutor(new CommandFakeop(this)); //not done + getCommand("jarcode").setExecutor(new CommandJarcode(this)); + } + + String[] ad = { + "&d____----====[ &cSponsored by GNU/Emacs&d ]====----____", + "&aGet emacs for your linux distro now!", + "&bhttps://www.gnu.org/software/emacs/", + + "&aThis troll plugin is sponsored by Emacs!", + "&aEmacs is the one true editor that respects your software freedoms", + " " + }; + + + @EventHandler + public void onJoin(PlayerJoinEvent ev) { + for (String s : ad) { + ev.getPlayer().sendMessage(ChatColor.translateAlternateColorCodes('&', s)); + } + } +} diff --git a/src/main/java/net/poweredbyhate/trollplus/Trolls/CommandBolt.java b/src/main/java/net/poweredbyhate/trollplus/Trolls/CommandBolt.java new file mode 100644 index 0000000..60007a2 --- /dev/null +++ b/src/main/java/net/poweredbyhate/trollplus/Trolls/CommandBolt.java @@ -0,0 +1,37 @@ +package net.poweredbyhate.trollplus.Trolls; + +import net.poweredbyhate.trollplus.TrollPlus; +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; + +/** + * Created by Lax on 4/18/2016. + */ +public class CommandBolt implements CommandExecutor { + + TrollPlus plugin; + + public CommandBolt(TrollPlus trollPlus) { + this.plugin = trollPlus; + } + + + @Override + public boolean onCommand(CommandSender sender, Command command, String s, String[] args) { + if (sender.hasPermission("trollplus.bolt")) { + if(args.length == 0 && sender instanceof Player) { + Player p = (Player) sender; + p.getLocation().getWorld().strikeLightning(p.getLocation()); + } else if (Bukkit.getPlayer(args[0]) != null && sender.hasPermission("trollplus.bolt.others")) { + Player p = Bukkit.getPlayer(args[0]); + p.getLocation().getWorld().strikeLightning(p.getLocation()); + } + } + sender.sendMessage(ChatColor.RED+ "No Permz"); + return false; + } +} diff --git a/src/main/java/net/poweredbyhate/trollplus/Trolls/CommandBurn.java b/src/main/java/net/poweredbyhate/trollplus/Trolls/CommandBurn.java new file mode 100644 index 0000000..bc8fb32 --- /dev/null +++ b/src/main/java/net/poweredbyhate/trollplus/Trolls/CommandBurn.java @@ -0,0 +1,34 @@ +package net.poweredbyhate.trollplus.Trolls; + +import net.poweredbyhate.trollplus.TrollPlus; +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; + +/** + * Created by Lax on 4/18/2016. + */ +public class CommandBurn implements CommandExecutor { + + TrollPlus plugin; + + public CommandBurn(TrollPlus trollPlus) { + this.plugin = trollPlus; + } + + @Override + public boolean onCommand(CommandSender sender, Command command, String s, String[] args) { + if (sender.hasPermission("trollplus.burn")) { + if(args.length == 0 && sender instanceof Player) { + ((Player) sender).setFireTicks(200); + } else if (Bukkit.getPlayer(args[0]) != null && sender.hasPermission("trollplus.burn.others")) { + Bukkit.getPlayer(args[0]).setFireTicks(200); + } + } + sender.sendMessage(ChatColor.RED+ "No Permz"); + return false; + } +} diff --git a/src/main/java/net/poweredbyhate/trollplus/Trolls/CommandFakeop.java b/src/main/java/net/poweredbyhate/trollplus/Trolls/CommandFakeop.java new file mode 100644 index 0000000..87be094 --- /dev/null +++ b/src/main/java/net/poweredbyhate/trollplus/Trolls/CommandFakeop.java @@ -0,0 +1,27 @@ +package net.poweredbyhate.trollplus.Trolls; + +import net.poweredbyhate.trollplus.TrollPlus; +import org.bukkit.command.Command; +import org.bukkit.command.CommandExecutor; +import org.bukkit.command.CommandSender; + +import java.util.ArrayList; + +/** + * Created by Lax on 4/18/2016. + */ +public class CommandFakeop implements CommandExecutor { + + ArrayList fakeopz = new ArrayList<>(); + + TrollPlus plugin; + public CommandFakeop(TrollPlus trollPlus) { + this.plugin = trollPlus; + } + + @Override + public boolean onCommand(CommandSender sender, Command command, String s, String[] args) { + return false; + } + +} diff --git a/src/main/java/net/poweredbyhate/trollplus/Trolls/CommandFreeze.java b/src/main/java/net/poweredbyhate/trollplus/Trolls/CommandFreeze.java new file mode 100644 index 0000000..4c0c76b --- /dev/null +++ b/src/main/java/net/poweredbyhate/trollplus/Trolls/CommandFreeze.java @@ -0,0 +1,50 @@ +package net.poweredbyhate.trollplus.Trolls; + +import net.poweredbyhate.trollplus.TrollPlus; +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; +import org.bukkit.scheduler.BukkitRunnable; + +/** + * Created by Lax on 4/18/2016. + */ +public class CommandFreeze implements CommandExecutor { + + TrollPlus plugin; + public CommandFreeze(TrollPlus trollPlus) { + this.plugin = trollPlus; + } + + @Override + public boolean onCommand(final CommandSender sender, Command command, String s, final String[] args) { + if (sender.hasPermission("trollplus.freeze")) { + if (args.length == 0 && sender instanceof Player) { + ((Player) sender).setWalkSpeed(0); + ((Player) sender).setFlySpeed(0); + new BukkitRunnable() { + @Override + public void run() { + ((Player) sender).setWalkSpeed(0.2F); + ((Player) sender).setFlySpeed(0.1F); + } + }.runTaskLater(plugin, 200); + } else if (Bukkit.getPlayer(args[0]) != null && sender.hasPermission("trollplus.freeze.others")) { + Bukkit.getPlayer(args[0]).setWalkSpeed(0); + Bukkit.getPlayer(args[0]).setFlySpeed(0); + new BukkitRunnable() { + @Override + public void run() { + Bukkit.getPlayer(args[0]).setWalkSpeed(0.2F); + Bukkit.getPlayer(args[0]).setFlySpeed(0.1F); + } + }.runTaskLater(plugin, 200); + } + sender.sendMessage(ChatColor.RED+ "No Permz"); + } + return false; + } +} diff --git a/src/main/java/net/poweredbyhate/trollplus/Trolls/CommandJarcode.java b/src/main/java/net/poweredbyhate/trollplus/Trolls/CommandJarcode.java new file mode 100644 index 0000000..2d67d00 --- /dev/null +++ b/src/main/java/net/poweredbyhate/trollplus/Trolls/CommandJarcode.java @@ -0,0 +1,45 @@ +package net.poweredbyhate.trollplus.Trolls; + +import net.poweredbyhate.trollplus.TrollPlus; +import org.bukkit.command.Command; +import org.bukkit.command.CommandExecutor; +import org.bukkit.command.CommandSender; +import org.bukkit.entity.Player; +import org.bukkit.scheduler.BukkitRunnable; + +import java.util.Random; + +/** + * Created by Lax on 4/18/2016. + */ +public class CommandJarcode implements CommandExecutor { + + TrollPlus plugin; + String[] jarcodes = { //oh and + jarcode + "install fucking gentoo you pleb", + "use emacs you sack of shit", + "this server doesn\'t support your software freedom", + "emacs is the one true editor, emacs is love, emacs is life", + "i secretly love laxwashere" + }; + String rant = "What the fuck did you just fucking say about me, you little bitch? I’ll have you know I graduated top of my class in the Navy Seals, and I’ve been involved in numerous secret raids on Al-Quaeda, and I have over 300 confirmed kills. I am trained in gorilla warfare and I’m the top sniper in the entire US armed forces. You are nothing to me but just another target. I will wipe you the fuck out with precision the likes of which has never been seen before on this Earth, mark my fucking words. You think you can get away with saying that shit to me over the Internet? Think again, fucker. As we speak I am contacting my secret network of spies across the USA and your IP is being traced right now so you better prepare for the storm, maggot. The storm that wipes out the pathetic little thing you call your life. You’re fucking dead, kid. I can be anywhere, anytime, and I can kill you in over seven hundred ways, and that’s just with my bare hands. Not only am I extensively trained in unarmed combat, but I have access to the entire arsenal of the United States Marine Corps and I will use it to its full extent to wipe your miserable ass off the face of the continent, you little shit. If only you could have known what unholy retribution your little “clever” comment was about to bring down upon you, maybe you would have held your fucking tongue. But you couldn’t, you didn’t, and now you’re paying the price, you goddamn idiot. I will shit fury all over you and you will drown in it. You’re fucking dead, kiddo."; + + public CommandJarcode(TrollPlus trollPlus) { + this.plugin = trollPlus; + } + + Random r = new Random(); + @Override + public boolean onCommand(final CommandSender commandSender, Command command, String s, String[] strings) { + if (commandSender.hasPermission("trollplus.jarcode") && commandSender instanceof Player) { + ((Player) commandSender).chat(rant); + new BukkitRunnable() { + @Override + public void run() { + ((Player) commandSender).chat("oh and " + jarcodes[r.nextInt(jarcodes.length)]); + } + }.runTaskLater(plugin, 40); + } + return false; + } +} diff --git a/src/main/resources/plugin.yml b/src/main/resources/plugin.yml new file mode 100644 index 0000000..dfa64f9 --- /dev/null +++ b/src/main/resources/plugin.yml @@ -0,0 +1,9 @@ +main: net.poweredbyhate.trollplus.TrollPlus +author: LaxWasHere +version: 0.1 +commands: + burn: + freeze: + bolt: + fakeop: + jarcode: \ No newline at end of file