naughty_nugget_

Make Dynmap compatable basic claim plugin

  • /Nation create (name) sends a message in chat for everyone to see XXXX has created a nation called XXXX
  • /nation claim or /n claim claims the chunk you are standing on
  • /n auto claim claims all chunks that you enter if you walk around a circle make it so all the chunks inside the permiter become part of that claim and show it on the dynmap hwnever you leave or enter a claim have a smalkl message in the chat saying eneting or leaveing XXXX

Show the claims as green on the dynmap

Kodari AI
KodariNov 15 at 10:07 am 1
NationClaims
NationClaims is a Minecraft Bukkit/Spigot plugin that adds Dynmap-compatible chunk claiming for player-created nations. Players create nations via /nation create, which broadcasts a chat announcement. Chunks are claimed with /nation claim or automatically via /nation auto claim, which claims every chunk entered and fills interior chunks when walking in a perimeter. All claims display as green regions on Dynmap. Entering or leaving a claimed area triggers a small chat message indicating the nation name. The plugin integrates with Dynmap's API to render live-updating claim boundaries and provides intuitive nation-based land management.
  • Create a Java Paper plugin with nation creation, manual claims, and /n auto claim.

  • Persist nations and chunk claims; auto-claim loop interiors and announce claim entry/exit.

  • Add an optional Dynmap marker overlay that draws claims in green without requiring Dynmap to compile.

Created the NationClaims plugin with persistent nation/chunk data, /nation create <name>, /n claim, and toggleable /n auto claim. Auto-claim marks chunks as you enter them and fills the enclosed area when you return to your starting chunk. Players receive claim entry/exit messages, and Dynmap displays claims as green areas when Dynmap is installed.

Kodari can make mistakes. Review important code before using.
Files
src
build.gradle
Code
10 686
src/main/java/com/kodari/nationclaims/NationClaimsPlugin.java
package com.kodari.nationclaims;

import org.bukkit.Bukkit;
import org.bukkit.plugin.java.JavaPlugin;
import org.bukkit.scheduler.BukkitTask;

public class NationClaimsPlugin extends JavaPlugin {
    private ClaimManager claimManager;
    private AutoClaimManager autoClaimManager;
    private DynmapHook dynmapHook;
    private BukkitTask dynmapRefreshTask;

    @Override
    public void onEnable() {
        dynmapHook = new DynmapHook(this);
        claimManager = new ClaimManager(this);
        autoClaimManager = new AutoClaimManager(this);
        getCommand("nation").setExecutor(new NationCommand(this));
        Bukkit.getPluginManager().registerEvents(new ClaimListener(this), this);
        dynmapHook.refresh();
    }

    @Override
    public void onDisable() {
        if (dynmapRefreshTask != null) {
            dynmapRefreshTask.cancel();
        }
    }

    public ClaimManager getClaimManager() {
        return claimManager;
    }

    public AutoClaimManager getAutoClaimManager() {
        return autoClaimManager;
    }

    public void refreshDynmap() {
        if (dynmapHook == null) {
            return;
        }
        if (dynmapRefreshTask != null) {
            dynmapRefreshTask.cancel();
        }
        dynmapRefreshTask = Bukkit.getScheduler().runTaskLater(this, dynmapHook::refresh, 10L);
    }
}