killermc_

duelsroom is a plugin that allows you to duel a player when you enter a region. it will create a glass border that traps the two players until one of them dies or leaves the area and theres a cooldown till glass drops when a player dies with worldguard support and hook with anti bug abuse

Kodari AI
KodariJul 11 at 10:08 am 11
DuelsRoom
DuelsRoom starts player duels when two players enter the same configured WorldGuard region. It creates a temporary glass border around the arena, traps both participants inside, detects deaths and area exits, and restores the arena after a configurable cooldown. The plugin prevents block breaking, block placement, explosions, piston manipulation, bucket abuse, teleport escapes, and configurable command-based exploits while providing reload and leave commands for administrators and participants.
killermc_

The compilation failed with this error:

code
Compilation failed with 6 error(s):

ERROR in src/main/java/com/kodari/duelsroom/worldguard/WorldGuardHook.java at line 6: cannot find symbol
import com.sk89q.worldguard.protection.regions.ApplicableRegionSet;
                                              ^
  symbol: class ApplicableRegionSet
  location: package com.sk89q.worldguard.protection.regions

ERROR in src/main/java/com/kodari/duelsroom/worldguard/WorldGuardHook.java at line 7: cannot find symbol
import com.sk89q.worldguard.protection.regions.CuboidProtectedRegion;
                                              ^
  symbol: class CuboidProtectedRegion
  location: package com.sk89q.worldguard.protection.regions

ERROR in   src/main/java/com/kodari/duelsroom/worldguard/WorldGuardHook.java at line 6: cannot find symbol
  import com.sk89q.worldguard.protection.regions.ApplicableRegionSet;
                                                ^
  symbol: class ApplicableRegionSet
  location: package com.sk89q.worldguard.protection.regions

ERROR in   src/main/java/com/kodari/duelsroom/worldguard/WorldGuardHook.java at line 7: cannot find symbol
  import com.sk89q.worldguard.protection.regions.CuboidProtectedRegion;
                                                ^
  symbol: class CuboidProtectedRegion
  location: package com.sk89q.worldguard.protection.regions

ERROR in src/main/java/com/kodari/duelsroom/worldguard/WorldGuardHook.java at line 6: cannot find symbol
import com.sk89q.worldguard.protection.regions.ApplicableRegionSet;
                                              ^
  symbol: class ApplicableRegionSet
  location: package com.sk89q.worldguard.protection.regions

ERROR in src/main/java/com/kodari/duelsroom/worldguard/WorldGuardHook.java at line 7: cannot find symbol
import com.sk89q.worldguard.protection.regions.CuboidProtectedRegion;
                                              ^
  symbol: class CuboidProtectedRegion
  location: package com.sk89q.worldguard.protection.regions


=== COMPILATION ERROR ANALYSIS ===

MISSING CLASSES:
  - ApplicableRegionSet
  - CuboidProtectedRegion
ACTION: Create these classes or check imports

FILES TO INVESTIGATE:
  - src/main/java/com/kodari/duelsroom/worldguard/WorldGuardHook.java
  -   src/main/java/com/kodari/duelsroom/worldguard/WorldGuardHook.java

Please fix this error by creating a new artifact with the corrected code.

Kodari AI
KodariJul 11 at 10:09 am 4

Fixed WorldGuardHook.java for WorldGuard 7.x:

  • Moved ApplicableRegionSet to com.sk89q.worldguard.protection

  • Replaced CuboidProtectedRegion with ProtectedCuboidRegion

  • Updated the cuboid type check accordingly

Kodari can make mistakes. Review important code before using.
Files
src
build.gradle
settings.gradle
Code
10 802
src/main/java/com/kodari/duelsroom/DuelsRoomPlugin.java
package com.kodari.duelsroom;

import com.kodari.duelsroom.command.DuelsRoomCommand;
import com.kodari.duelsroom.listener.DuelListener;
import com.kodari.duelsroom.manager.DuelManager;
import com.kodari.duelsroom.worldguard.WorldGuardHook;
import org.bukkit.plugin.Plugin;
import org.bukkit.plugin.java.JavaPlugin;

public class DuelsRoomPlugin extends JavaPlugin {

    private DuelManager duelManager;

    @Override
    public void onEnable() {
        saveDefaultConfig();

        WorldGuardHook worldGuardHook = null;
        Plugin worldGuard = getServer().getPluginManager().getPlugin("WorldGuard");

        if (worldGuard != null && worldGuard.isEnabled()) {
            worldGuardHook = new WorldGuardHook();
        } else {
            getLogger().warning("WorldGuard was not found. Configured duel regions cannot be used.");
        }

        duelManager = new DuelManager(this, worldGuardHook);

        getServer().getPluginManager().registerEvents(new DuelListener(duelManager), this);

        DuelsRoomCommand command = new DuelsRoomCommand(duelManager);
        getCommand("duelsroom").setExecutor(command);
        getCommand("duelsroom").setTabCompleter(command);
    }

    @Override
    public void onDisable() {
        if (duelManager != null) {
            duelManager.shutdown();
        }
    }

    public DuelManager getDuelManager() {
        return duelManager;
    }
}