From a888795be5c3214ee07f1eedb24e13da08abcd04 Mon Sep 17 00:00:00 2001 From: NorbiPeti Date: Sat, 23 Dec 2017 21:04:06 +0100 Subject: [PATCH] Fiiiiiiixes --- .../sznp/virtualcomputer/BukkitRenderer.java | 2 +- .../src/sznp/virtualcomputer/Commands.java | 271 +++++++++--------- .../sznp/virtualcomputer/DirectRenderer.java | 6 + .../sznp/virtualcomputer/MCFrameBuffer.java | 26 +- .../MouseLockerPlayerListener.java | 61 ++-- .../src/sznp/virtualcomputer/PluginMain.java | 21 +- 6 files changed, 202 insertions(+), 185 deletions(-) diff --git a/VirtualComputer/src/sznp/virtualcomputer/BukkitRenderer.java b/VirtualComputer/src/sznp/virtualcomputer/BukkitRenderer.java index 9e66f00..ac881bc 100644 --- a/VirtualComputer/src/sznp/virtualcomputer/BukkitRenderer.java +++ b/VirtualComputer/src/sznp/virtualcomputer/BukkitRenderer.java @@ -36,7 +36,7 @@ public class BukkitRenderer extends MapRenderer implements IRenderer { MapView map = IRenderer.prepare(id, world); map.addRenderer(this); this.startindex = startindex; - image = new BufferedImage(640, 480, BufferedImage.TYPE_INT_RGB); + image = new BufferedImage(128, 128, BufferedImage.TYPE_INT_RGB); } private int progress = 0; diff --git a/VirtualComputer/src/sznp/virtualcomputer/Commands.java b/VirtualComputer/src/sznp/virtualcomputer/Commands.java index e87b112..bf7b042 100644 --- a/VirtualComputer/src/sznp/virtualcomputer/Commands.java +++ b/VirtualComputer/src/sznp/virtualcomputer/Commands.java @@ -1,135 +1,136 @@ -package sznp.virtualcomputer; - -import org.bukkit.Bukkit; -import org.bukkit.command.Command; -import org.bukkit.command.CommandExecutor; -import org.bukkit.command.CommandSender; -import org.bukkit.entity.Player; - -public class Commands implements CommandExecutor { - - @Override - public boolean onCommand(CommandSender sender, Command cmd, String label, String[] args) { - switch (cmd.getName().toLowerCase()) { - case "computer": { - if (args.length == 0) - return false; - switch (args[0].toLowerCase()) { - case "start": - case "poweron": - case "on": - case "startup": - PluginMain.Instance.Start(sender); - break; - case "stop": - case "poweroff": - case "off": - case "shutdown": - case "kill": - PluginMain.Instance.Stop(sender); - break; - case "powerbutton": - case "pwrbtn": - case "powerbtn": - PluginMain.Instance.PowerButton(sender); - break; - case "reset": - case "restart": - PluginMain.Instance.Reset(sender); - break; - case "fix": - case "fixscreen": - PluginMain.Instance.FixScreen(sender); - break; - case "key": - case "press": - case "presskey": - case "keypress": - if (args.length < 2) { - sender.sendMessage("§cUsage: /computer key [down/up|duration(ticks)]"); - return true; - } - if (args.length < 3) - PluginMain.Instance.PressKey(sender, args[1], ""); - else - PluginMain.Instance.PressKey(sender, args[1], args[2]); - break; - case "mouse": - boolean showusage = true; - if (args.length < 6) { - // Command overloading, because I can :P - if (args.length > 4) // 4 "); - sender.sendMessage("§cOr: /computer mouse