World Trim/Fill task start events

This commit is contained in:
BuildTools 2016-01-12 20:47:10 +01:00
parent 9abf6ff938
commit dd4a8348be
4 changed files with 76 additions and 0 deletions

View File

@ -0,0 +1,36 @@
package com.wimbli.WorldBorder.Events;
import org.bukkit.event.Event;
import org.bukkit.event.HandlerList;
import com.wimbli.WorldBorder.WorldFillTask;
/**
* Created by Maximvdw on 12.01.2016.
*/
public class WorldBorderFillStartEvent extends Event
{
private static final HandlerList handlers = new HandlerList();
private WorldFillTask fillTask;
public WorldBorderFillStartEvent(WorldFillTask worldFillTask)
{
this.fillTask = worldFillTask;
}
@Override
public HandlerList getHandlers()
{
return handlers;
}
public static HandlerList getHandlerList()
{
return handlers;
}
public WorldFillTask getFillTask(){
return this.fillTask;
}
}

View File

@ -0,0 +1,36 @@
package com.wimbli.WorldBorder.Events;
import org.bukkit.event.Event;
import org.bukkit.event.HandlerList;
import com.wimbli.WorldBorder.WorldTrimTask;
/**
* Created by Maximvdw on 12.01.2016.
*/
public class WorldBorderTrimStartEvent extends Event
{
private static final HandlerList handlers = new HandlerList();
private WorldTrimTask trimTask;
public WorldBorderTrimStartEvent(WorldTrimTask trimTask)
{
this.trimTask = trimTask;
}
@Override
public HandlerList getHandlers()
{
return handlers;
}
public static HandlerList getHandlerList()
{
return handlers;
}
public WorldTrimTask getTrimTask(){
return this.trimTask;
}
}

View File

@ -12,6 +12,7 @@ import org.bukkit.Server;
import org.bukkit.World; import org.bukkit.World;
import com.wimbli.WorldBorder.Events.WorldBorderFillFinishedEvent; import com.wimbli.WorldBorder.Events.WorldBorderFillFinishedEvent;
import com.wimbli.WorldBorder.Events.WorldBorderFillStartEvent;
public class WorldFillTask implements Runnable public class WorldFillTask implements Runnable
@ -117,6 +118,7 @@ public class WorldFillTask implements Runnable
} }
this.readyToGo = true; this.readyToGo = true;
Bukkit.getServer().getPluginManager().callEvent(new WorldBorderFillStartEvent(this));
} }
// for backwards compatibility // for backwards compatibility
public WorldFillTask(Server theServer, Player player, String worldName, int fillDistance, int chunksPerRun, int tickFrequency) public WorldFillTask(Server theServer, Player player, String worldName, int fillDistance, int chunksPerRun, int tickFrequency)

View File

@ -13,6 +13,7 @@ import org.bukkit.Server;
import org.bukkit.World; import org.bukkit.World;
import com.wimbli.WorldBorder.Events.WorldBorderTrimFinishedEvent; import com.wimbli.WorldBorder.Events.WorldBorderTrimFinishedEvent;
import com.wimbli.WorldBorder.Events.WorldBorderTrimStartEvent;
public class WorldTrimTask implements Runnable public class WorldTrimTask implements Runnable
@ -88,6 +89,7 @@ public class WorldTrimTask implements Runnable
return; return;
this.readyToGo = true; this.readyToGo = true;
Bukkit.getServer().getPluginManager().callEvent(new WorldBorderTrimStartEvent(this));
} }
public void setTaskID(int ID) public void setTaskID(int ID)