-
-
Notifications
You must be signed in to change notification settings - Fork 40
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add BannerControlSessionStartedEvent & TownPlunderedEvent (#923)
* add BannerControlSessionStartedEvent * add TownPlunderedEvent * Update src/main/java/com/gmail/goosius/siegewar/playeractions/PlaceBlock.java --------- Co-authored-by: tlm920 <timo@timomcgrath.com> Co-authored-by: LlmDl <LlmDlio@gmail.com>
- Loading branch information
1 parent
8777353
commit 1075945
Showing
4 changed files
with
89 additions
and
0 deletions.
There are no files selected for viewing
38 changes: 38 additions & 0 deletions
38
src/main/java/com/gmail/goosius/siegewar/events/BannerControlSessionStartedEvent.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
package com.gmail.goosius.siegewar.events; | ||
|
||
import com.gmail.goosius.siegewar.objects.BannerControlSession; | ||
import com.gmail.goosius.siegewar.objects.Siege; | ||
import org.bukkit.Bukkit; | ||
import org.bukkit.event.Event; | ||
import org.bukkit.event.HandlerList; | ||
import org.jetbrains.annotations.NotNull; | ||
|
||
public class BannerControlSessionStartedEvent extends Event { | ||
private static final HandlerList handlers = new HandlerList(); | ||
private final Siege siege; | ||
private final BannerControlSession bannerControlSession; | ||
|
||
public BannerControlSessionStartedEvent(Siege siege, BannerControlSession bannerControlSession) { | ||
super(!Bukkit.getServer().isPrimaryThread()); | ||
this.siege = siege; | ||
this.bannerControlSession = bannerControlSession; | ||
} | ||
|
||
@NotNull | ||
@Override | ||
public HandlerList getHandlers() { | ||
return handlers; | ||
} | ||
|
||
public static HandlerList getHandlerList() { | ||
return handlers; | ||
} | ||
|
||
public Siege getSiege() { | ||
return siege; | ||
} | ||
|
||
public BannerControlSession getBannerControlSession() { | ||
return bannerControlSession; | ||
} | ||
} |
43 changes: 43 additions & 0 deletions
43
src/main/java/com/gmail/goosius/siegewar/events/TownPlunderedEvent.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
package com.gmail.goosius.siegewar.events; | ||
|
||
import com.gmail.goosius.siegewar.objects.Siege; | ||
import com.palmergames.bukkit.towny.object.Town; | ||
import org.bukkit.entity.Player; | ||
import org.bukkit.event.Event; | ||
import org.bukkit.event.HandlerList; | ||
import org.jetbrains.annotations.NotNull; | ||
import org.jetbrains.annotations.Nullable; | ||
|
||
public class TownPlunderedEvent extends Event { | ||
private static final HandlerList handlers = new HandlerList(); | ||
private final Siege siege; | ||
private final Player player; | ||
|
||
public TownPlunderedEvent(Siege siege, Player player) { | ||
this.siege = siege; | ||
this.player = player; | ||
} | ||
|
||
@NotNull | ||
@Override | ||
public HandlerList getHandlers() { | ||
return handlers; | ||
} | ||
|
||
public static HandlerList getHandlerList() { | ||
return handlers; | ||
} | ||
|
||
public Siege getSiege() { | ||
return siege; | ||
} | ||
|
||
@Nullable | ||
public Town getTown() { | ||
return siege.getTown(); | ||
} | ||
|
||
public Player getPlayer() { | ||
return player; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters