Search in sources :

Example 11 with WorldTag

use of com.denizenscript.denizen.objects.WorldTag in project Denizen-For-Bukkit by DenizenScript.

the class WorldLoadsScriptEvent method onWorldLoads.

@EventHandler
public void onWorldLoads(WorldLoadEvent event) {
    world = new WorldTag(event.getWorld());
    this.event = event;
    fire(event);
}
Also used : WorldTag(com.denizenscript.denizen.objects.WorldTag) EventHandler(org.bukkit.event.EventHandler)

Example 12 with WorldTag

use of com.denizenscript.denizen.objects.WorldTag in project Denizen-For-Bukkit by DenizenScript.

the class WorldSavesScriptEvent method onWorldSaves.

@EventHandler
public void onWorldSaves(WorldSaveEvent event) {
    world = new WorldTag(event.getWorld());
    this.event = event;
    fire(event);
}
Also used : WorldTag(com.denizenscript.denizen.objects.WorldTag) EventHandler(org.bukkit.event.EventHandler)

Example 13 with WorldTag

use of com.denizenscript.denizen.objects.WorldTag in project Denizen-For-Bukkit by DenizenScript.

the class GameRuleCommand method execute.

@Override
public void execute(ScriptEntry scriptEntry) {
    WorldTag world = scriptEntry.getObjectTag("world");
    ElementTag gamerule = scriptEntry.getElement("gamerule");
    ElementTag value = scriptEntry.getElement("value");
    if (scriptEntry.dbCallShouldDebug()) {
        Debug.report(scriptEntry, getName(), world, gamerule, value);
    }
    if (!world.getWorld().setGameRuleValue(gamerule.asString(), value.asString())) {
        Debug.echoError(scriptEntry, "Invalid gamerule!");
    }
}
Also used : WorldTag(com.denizenscript.denizen.objects.WorldTag) ElementTag(com.denizenscript.denizencore.objects.core.ElementTag)

Example 14 with WorldTag

use of com.denizenscript.denizen.objects.WorldTag in project Denizen-For-Bukkit by DenizenScript.

the class PlayerChangesWorldScriptEvent method onPlayerChangesWorld.

@EventHandler
public void onPlayerChangesWorld(PlayerChangedWorldEvent event) {
    if (EntityTag.isNPC(event.getPlayer())) {
        return;
    }
    origin_world = new WorldTag(event.getFrom());
    destination_world = new WorldTag(event.getPlayer().getWorld());
    this.event = event;
    fire(event);
}
Also used : WorldTag(com.denizenscript.denizen.objects.WorldTag) EventHandler(org.bukkit.event.EventHandler)

Aggregations

WorldTag (com.denizenscript.denizen.objects.WorldTag)14 ElementTag (com.denizenscript.denizencore.objects.core.ElementTag)7 EventHandler (org.bukkit.event.EventHandler)6 DurationTag (com.denizenscript.denizencore.objects.core.DurationTag)3 LocationTag (com.denizenscript.denizen.objects.LocationTag)2 List (java.util.List)2 OfflinePlayer (org.bukkit.OfflinePlayer)2 World (org.bukkit.World)2 Player (org.bukkit.entity.Player)2 EntityTag (com.denizenscript.denizen.objects.EntityTag)1 PlayerTag (com.denizenscript.denizen.objects.PlayerTag)1 MapScriptContainer (com.denizenscript.denizen.scripts.containers.core.MapScriptContainer)1 FakeEntity (com.denizenscript.denizen.utilities.entity.FakeEntity)1 DenizenMapRenderer (com.denizenscript.denizen.utilities.maps.DenizenMapRenderer)1 MapImage (com.denizenscript.denizen.utilities.maps.MapImage)1 ScriptTag (com.denizenscript.denizencore.objects.core.ScriptTag)1 WeatherType (org.bukkit.WeatherType)1 WorldBorder (org.bukkit.WorldBorder)1 Entity (org.bukkit.entity.Entity)1 MapRenderer (org.bukkit.map.MapRenderer)1