This repository has been archived by the owner on Jul 27, 2019. It is now read-only.
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
8 changed files
with
224 additions
and
31 deletions.
There are no files selected for viewing
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
77 changes: 77 additions & 0 deletions
77
src/main/java/com/cnaude/purpleirc/GameListeners/PrismListener.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,77 @@ | ||
package com.cnaude.purpleirc.GameListeners; | ||
|
||
import com.cnaude.purpleirc.PurpleBot; | ||
import com.cnaude.purpleirc.PurpleIRC; | ||
import com.cnaude.purpleirc.TemplateName; | ||
import me.botsko.prism.events.PrismBlocksDrainEvent; | ||
import me.botsko.prism.events.PrismBlocksExtinguishEvent; | ||
import me.botsko.prism.events.PrismBlocksRollbackEvent; | ||
import me.botsko.prism.events.PrismCustomPlayerActionEvent; | ||
import org.bukkit.event.EventHandler; | ||
import org.bukkit.event.Listener; | ||
|
||
/** | ||
* | ||
* @author cnaude | ||
*/ | ||
public class PrismListener implements Listener { | ||
|
||
private final PurpleIRC plugin; | ||
|
||
/** | ||
* | ||
* @param plugin | ||
*/ | ||
public PrismListener(PurpleIRC plugin) { | ||
this.plugin = plugin; | ||
} | ||
|
||
/** | ||
* | ||
* @param event | ||
*/ | ||
@EventHandler | ||
public void onPrismBlocksRollbackEvent(PrismBlocksRollbackEvent event) { | ||
plugin.logDebug("onPrismBlocksRollbackEvent caught"); | ||
for (PurpleBot ircBot : plugin.ircBots.values()) { | ||
ircBot.gamePrismRollback(event.onBehalfOf(), event.getQueryParameters()); | ||
} | ||
} | ||
|
||
/** | ||
* | ||
* @param event | ||
*/ | ||
@EventHandler | ||
public void onPrismBlocksDrainEvent(PrismBlocksDrainEvent event) { | ||
plugin.logDebug("onPrismBlocksDrainEvent caught"); | ||
for (PurpleBot ircBot : plugin.ircBots.values()) { | ||
ircBot.gamePrismDrainOrExtinguish(TemplateName.PRISM_DRAIN, event.onBehalfOf(), event.getRadius(), event.getBlockStateChanges()); | ||
} | ||
} | ||
|
||
/** | ||
* | ||
* @param event | ||
*/ | ||
@EventHandler | ||
public void onPrismBlocksExtinguishEvent(PrismBlocksExtinguishEvent event) { | ||
plugin.logDebug("onPrismBlocksExtinguishEvent caught"); | ||
for (PurpleBot ircBot : plugin.ircBots.values()) { | ||
ircBot.gamePrismDrainOrExtinguish(TemplateName.PRISM_EXTINGUISH, event.onBehalfOf(), event.getRadius(), event.getBlockStateChanges()); | ||
} | ||
} | ||
|
||
/** | ||
* | ||
* @param event | ||
*/ | ||
@EventHandler | ||
public void onPrismCustomPlayerActionEvent(PrismCustomPlayerActionEvent event) { | ||
plugin.logDebug("onPrismCustomPlayerActionEvent caught"); | ||
for (PurpleBot ircBot : plugin.ircBots.values()) { | ||
ircBot.gamePrismCustom(event.getPlayer(), event.getActionTypeName(), | ||
event.getMessage(), event.getPluginName()); | ||
} | ||
} | ||
} |
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
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
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