Skip to content

Commit

Permalink
Add dChunk.refresh_chunk mechanism
Browse files Browse the repository at this point in the history
For reloading biomes and stuff!
  • Loading branch information
Morphan1 committed Jan 28, 2015
1 parent bf5213e commit 7833a3e
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 6 deletions.
13 changes: 13 additions & 0 deletions src/main/java/net/aufdemrand/denizen/objects/dChunk.java
Expand Up @@ -420,6 +420,19 @@ public void adjust(Mechanism mechanism) {
getWorld().regenerateChunk(getX(), getZ());
}

// <--[mechanism]
// @object dChunk
// @name refresh_chunk
// @input None
// @description
// Refreshes the chunk, sending any changed properties to players.
// @tags
// None
// -->
if (mechanism.matches("refresh_chunk")) {
getWorld().refreshChunk(getX(), getZ());
}

if (!mechanism.fulfilled())
mechanism.reportInvalid();

Expand Down
Expand Up @@ -4,10 +4,7 @@
import net.aufdemrand.denizen.scripts.containers.core.CommandScriptContainer;
import net.aufdemrand.denizen.tags.BukkitTagContext;
import net.aufdemrand.denizen.utilities.depends.Depends;
import net.aufdemrand.denizencore.objects.Element;
import net.aufdemrand.denizencore.objects.aH;
import net.aufdemrand.denizencore.objects.dList;
import net.aufdemrand.denizencore.objects.dObject;
import net.aufdemrand.denizencore.objects.*;
import net.aufdemrand.denizencore.tags.TagManager;
import net.citizensnpcs.api.CitizensAPI;
import net.citizensnpcs.api.npc.NPC;
Expand Down Expand Up @@ -78,9 +75,8 @@ public boolean testPermission(CommandSender target) {
npc = dNPC.mirrorCitizensNPC(citizen);
}
// <permission> is built into Bukkit... let's keep it here
// TODO: script arg?
for (String line : TagManager.tag(permissionMessage.replace("<permission>", getPermission()),
new BukkitTagContext(player, npc, false, null, false, null)).split("\n")) {
new BukkitTagContext(player, npc, false, null, false, new dScript(script))).split("\n")) {
target.sendMessage(line);
}
}
Expand Down

0 comments on commit 7833a3e

Please sign in to comment.