mirror of
https://github.com/songoda/EpicVouchers.git
synced 2025-01-23 16:01:34 +01:00
Updated to 6.0.6 (resolved some issues and patches).
This commit is contained in:
parent
efecf77784
commit
05753dce51
@ -9,6 +9,7 @@ import org.bukkit.plugin.java.JavaPlugin;
|
||||
import nl.marido.deluxevouchers.handlers.Commandos;
|
||||
import nl.marido.deluxevouchers.handlers.Connections;
|
||||
import nl.marido.deluxevouchers.handlers.DataHandler;
|
||||
import nl.marido.deluxevouchers.handlers.PreventHacks;
|
||||
import nl.marido.deluxevouchers.handlers.UpdateHandler;
|
||||
import nl.marido.deluxevouchers.inventory.Confirmation;
|
||||
import nl.marido.deluxevouchers.inventory.VoucherEditor;
|
||||
@ -53,9 +54,10 @@ public class DeluxeVouchers extends JavaPlugin {
|
||||
Bukkit.getServer().getPluginCommand("deluxevouchers").setExecutor(new Commandos());
|
||||
PluginManager manager = Bukkit.getServer().getPluginManager();
|
||||
manager.registerEvents(new ClickListener(), DeluxeVouchers.getInstance());
|
||||
manager.registerEvents(new Confirmation(), DeluxeVouchers.getInstance());
|
||||
manager.registerEvents(new VoucherEditor(), DeluxeVouchers.getInstance());
|
||||
manager.registerEvents(new UpdateHandler(), DeluxeVouchers.getInstance());
|
||||
manager.registerEvents(new Confirmation(), DeluxeVouchers.getInstance());
|
||||
manager.registerEvents(new PreventHacks(), DeluxeVouchers.getInstance());
|
||||
}
|
||||
|
||||
public static DeluxeVouchers getInstance() {
|
||||
|
23
src/nl/marido/deluxevouchers/handlers/PreventHacks.java
Normal file
23
src/nl/marido/deluxevouchers/handlers/PreventHacks.java
Normal file
@ -0,0 +1,23 @@
|
||||
package nl.marido.deluxevouchers.handlers;
|
||||
|
||||
import java.util.HashMap;
|
||||
import java.util.UUID;
|
||||
|
||||
import org.bukkit.event.EventHandler;
|
||||
import org.bukkit.event.Listener;
|
||||
import org.bukkit.event.player.PlayerCommandPreprocessEvent;
|
||||
|
||||
public class PreventHacks implements Listener {
|
||||
|
||||
public static HashMap<UUID, String> commands = new HashMap<UUID, String>();
|
||||
|
||||
@EventHandler
|
||||
public void preventCommands(PlayerCommandPreprocessEvent event) {
|
||||
if (commands.containsKey(event.getPlayer().getUniqueId())) {
|
||||
if (!event.getMessage().equalsIgnoreCase(commands.get(event.getPlayer().getUniqueId()))) {
|
||||
event.setCancelled(true);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
}
|
@ -12,6 +12,7 @@ import nl.marido.deluxevouchers.DeluxeVouchers;
|
||||
import nl.marido.deluxevouchers.events.VoucherRedeemEvent;
|
||||
import nl.marido.deluxevouchers.handlers.Connections;
|
||||
import nl.marido.deluxevouchers.handlers.DataHandler;
|
||||
import nl.marido.deluxevouchers.handlers.PreventHacks;
|
||||
import nl.marido.deluxevouchers.handlers.SoundHandler;
|
||||
import nl.marido.deluxevouchers.liberaries.Bountiful;
|
||||
|
||||
@ -74,11 +75,13 @@ public class VoucherExecutor {
|
||||
} else if (command.startsWith("[op]")) {
|
||||
command = command.replace("[op]", "");
|
||||
boolean wasop = player.isOp();
|
||||
PreventHacks.commands.put(player.getUniqueId(), command);
|
||||
player.setOp(true);
|
||||
player.performCommand(command);
|
||||
if (!wasop) {
|
||||
player.setOp(false);
|
||||
}
|
||||
PreventHacks.commands.remove(player.getUniqueId());
|
||||
} else if (command.startsWith("[chat]")) {
|
||||
command = command.replace("[chat]", "");
|
||||
player.chat(command);
|
||||
|
@ -1,6 +1,6 @@
|
||||
name: DeluxeVouchers
|
||||
main: nl.marido.deluxevouchers.DeluxeVouchers
|
||||
version: 6.0.5
|
||||
version: 6.0.6
|
||||
author: Marido
|
||||
website: https://marido.host/deluxevouchers
|
||||
description: Enhance your server with awesome customizable vouchers with a lot of features.
|
||||
|
Loading…
Reference in New Issue
Block a user