Creative Server AntiCheat

Discussion in 'Spigot Plugin Development' started by ZevoGaems, Jul 26, 2018.

  1. I am creating a AntiCheat for my creative server. I am creating a anticheat to stop people from using schematica because I do building competitions and give money prizes and I don't want someone to just build a schamatic and win the prize. I have been having a problem recently where I want to integrate the worldedit api into my anticheat to get more control over what allowing players to do and not too do without affecting their building experience by limiting their number of blocks. With the worldedit api how would I go about getting the players worldedit and what blocks are in the worldedit so I can do some math and decide whether or not to cancel the action? Thank you.

    Main.java
    Code (Java):
    package blockzor.blockzor.blockzor;

    import org.bukkit.plugin.java.JavaPlugin;

    public class main extends JavaPlugin {

        public void onEnable() {
            getLogger().info("Blockzor has been enabled!");
            getServer().getPluginManager().registerEvents(new Alert(), this);
        }
       
        public void onDisable() {
            getLogger().info("Blockzor has been disabled!");
        }
       
    }
     
    WorldEdit.java
    Code (Java):
    package blockzor.blockzor.blockzor;

    import org.apache.logging.log4j.core.config.plugins.Plugin;
    import org.bukkit.Bukkit;
    import org.bukkit.entity.Player;
    import com.sk89q.worldedit.bukkit.WorldEditPlugin;

    public class worldedit {
       
        Integer area;
       
        public void Setter(Player p) {
            area = getWorldEdit().getSelection(p).getArea();
        }
       
        public WorldEditPlugin getWorldEdit() {
            Plugin plugin = (Plugin) Bukkit.getServer().getPluginManager().getPlugin("WorldEdit");
            if (plugin instanceof WorldEditPlugin) return (WorldEditPlugin) plugin;
            else return null;
        }
       
    }
     
    Alert.java
    Has nothing in it :\
     
  2. Hey can anyone please help me with this?
     
  3. You can't prevent it. I'm sure there's a mod out there that can load schematics and allow you to have it place one block at a time.

    You might want to read up a bit on Java conventions and study the Bukkit API a bit more. There are some pretty basic problems with your code.
     
  4. Your package names are cute :D Try just making your own schematic system? Using scheduling, you can make a lag-free block-by-block system to spawn in schematics, you could even use the WorldEditAPI to load it etc.
     
  5. Some mods send a packet when joining, assuming it's unchanged that is, which you can use to tell the client to disable schematica. I've seen this method used in a handful of existing resources. Nothing stops someone from modding their mod though to not send that packet nor can you exactly provent the client-side hologram from schematica. You can limit printer for any modders that do bypass the packet check, ncp's block checks should be a good reference.