Reload a chunk that = world hole

Discussion in 'Archived: Plugin Requests' started by Cecell, Feb 4, 2012.

  1. Offline

    Cecell


    Plugin category: World Editing & Management

    Suggested name: ChunkReloader

    A bit about me: I'm a plugin dev who frequents plugin requests looking for good ideas, or a good cause, or just the offer of a bit of pizza (I do love pizza) and wanted to make an example of how to properly format a plugin request post. Don't ask me what plugins I've created, no really, don't.

    What I want: I'd like to see perhaps properly formatted posts, or at least an attempt beyond the average all caps scrawl that has come to dominate this forum.
    What people need to learn is that it's much easier to read a nicely formatted post, even if it's a bit longer than it needs to be, you can easily identify key points via proper formatting.
    Also: skim-reading much easier with paragraphs! ;) As an idea - people who've read this and formatted their post accordingly can put [FORMATTED] in their post title, and people will know they've taken the extra time to make their post readable and give the relevant information out.

    Ideas for commands: /fixchunk (Please do not use "/chunk" as that is currently used by Orebfuscator.)

    Ideas for permissions: i don't see a need for this as a warmup can be applied using other plugins to prevent spamming.

    Willing to pay up to: I think this plugin will stand on its own and be quite popular.

    When I'd like it by: "Yesterday, though obviously it'll take a while before anyone more than a few takes notice of this post, I'll keep bumping it." - Good answer lol

    Similar plugin requests: None that i'm aware of

    Devs who might be interested in this: @TnT @ChrizC @codename_B (yes I tagged myself)​


    I think a plugin that simply allows a player to reload the chunk in which they are standing in case of them spawning in a world hole etc would be very popular and/or useful. This is more common inexplicably on some servers but it seems that some clients have the problem more often that others as well. This generates lag from tons of player logging out and right back in. Especially if you use mcbans. NOTE: I am not requesting a plugin which will //regen (regenerate) a chunk. This would be a plugin that would force a client reload of the current chunk upon receipt of a command. There are plugin packages that have a command that does this but you have to accept the entire package which causes mega conflicts with existing plugins.


    Someone who had no interest in expending the effort to accomplish this task tossed over this code and said this code was what was used to accomplish this. I know NOTHING about coding plugins and therefore have no idea what to do with this or how to do whatever that is.


    public FixChunk(Command plugin) {
    this.plugin = plugin;
    }

    @Override
    public boolean onCommand(CommandSender cs, Command cmd, String label, String[] args) {
    if (cmd.getName().equalsIgnoreCase("fixchunk")) {
    if (!plugin.isAuthorized(cs, "commands.fixchunk";)) {
    Utils.dispNoPerms(cs);
    return true;
    }
    if (!(cs instanceof Player)) {
    cs.sendMessage(ChatColor.RED + "This command is only available to players!");
    return true;
    }
    Player p = (Player) cs;
    Chunk c = p.getLocation().getChunk();
    boolean worked = p.getWorld().refreshChunk(c.getX(), c.getZ());
    if (worked) {
    cs.sendMessage(ChatColor.BLUE + "The chunk you're standing in has been reloaded!");
    }
    if (!worked) {
    cs.sendMessage(ChatColor.RED + "The chunk could not be reloaded.");
    }
    return true;
    }
    return false;
    }



    Thanks
    Cecell!
     
  2. Offline

    AStevensTaylor

    Why couldn't you do it automatically, i.e. if a player is below y=0, do a resend of the chunk, and teleport the player up to the highest block
     
  3. Offline

    Brian_Entei


    That's a cool solution, but what if the chunk were a skyworld chunk?(Like in skyblock)
     

Share This Page