Check for configurable grief types
Signed-off-by: Etzelia <etzelia@hotmail.com>pull/2/head
parent
bc339caad6
commit
0310f0f827
6
pom.xml
6
pom.xml
|
@ -47,7 +47,7 @@
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>xyz.etztech</groupId>
|
<groupId>xyz.etztech</groupId>
|
||||||
<artifactId>plugin-api</artifactId>
|
<artifactId>plugin-api</artifactId>
|
||||||
<version>1.0.8</version>
|
<version>1.0.7</version>
|
||||||
</dependency>
|
</dependency>
|
||||||
</dependencies>
|
</dependencies>
|
||||||
|
|
||||||
|
@ -57,8 +57,8 @@
|
||||||
<url>https://hub.spigotmc.org/nexus/content/groups/public/</url>
|
<url>https://hub.spigotmc.org/nexus/content/groups/public/</url>
|
||||||
</repository>
|
</repository>
|
||||||
<repository>
|
<repository>
|
||||||
<id>etztech-repo</id>
|
<id>canopy-repo</id>
|
||||||
<url>https://repo.etztech.xyz/</url>
|
<url>https://mvn.canopymc.net/</url>
|
||||||
</repository>
|
</repository>
|
||||||
<repository>
|
<repository>
|
||||||
<id>mvn-repo</id>
|
<id>mvn-repo</id>
|
||||||
|
|
|
@ -117,23 +117,34 @@ public class GriefAlertListener implements Listener {
|
||||||
|
|
||||||
@EventHandler
|
@EventHandler
|
||||||
public void onBlockIgnite(BlockIgniteEvent event) {
|
public void onBlockIgnite(BlockIgniteEvent event) {
|
||||||
if (event.getPlayer() != null &&
|
if (
|
||||||
(event.getCause() == BlockIgniteEvent.IgniteCause.FLINT_AND_STEEL ||
|
event.getPlayer() != null &&
|
||||||
event.getCause() == BlockIgniteEvent.IgniteCause.FIREBALL)) {
|
this.plugin.getConfig().getStringList("grief.enabled").contains("ignition") &&
|
||||||
|
(
|
||||||
|
event.getCause() == BlockIgniteEvent.IgniteCause.FLINT_AND_STEEL ||
|
||||||
|
event.getCause() == BlockIgniteEvent.IgniteCause.FIREBALL
|
||||||
|
)
|
||||||
|
) {
|
||||||
addAlert(event.getPlayer(), event.getBlock().getLocation(), Lang.IGNITE_ALERT);
|
addAlert(event.getPlayer(), event.getBlock().getLocation(), Lang.IGNITE_ALERT);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@EventHandler
|
@EventHandler
|
||||||
public void onBlockPlace(BlockPlaceEvent event) {
|
public void onBlockPlace(BlockPlaceEvent event) {
|
||||||
if(event.getBlockPlaced().getType() == Material.TNT) {
|
if(
|
||||||
|
this.plugin.getConfig().getStringList("grief.enabled").contains("tnt") &&
|
||||||
|
event.getBlockPlaced().getType() == Material.TNT
|
||||||
|
) {
|
||||||
addAlert(event.getPlayer(), event.getBlock().getLocation(), Lang.TNT_ALERT);
|
addAlert(event.getPlayer(), event.getBlock().getLocation(), Lang.TNT_ALERT);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@EventHandler
|
@EventHandler
|
||||||
public void onBucketEmpty(PlayerBucketEmptyEvent event) {
|
public void onBucketEmpty(PlayerBucketEmptyEvent event) {
|
||||||
if(event.getBucket() == Material.LAVA_BUCKET) {
|
if(
|
||||||
|
this.plugin.getConfig().getStringList("grief.enabled").contains("lava") &&
|
||||||
|
event.getBucket() == Material.LAVA_BUCKET
|
||||||
|
) {
|
||||||
addAlert(event.getPlayer(), event.getBlock().getLocation(), Lang.LAVA_ALERT);
|
addAlert(event.getPlayer(), event.getBlock().getLocation(), Lang.LAVA_ALERT);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -21,6 +21,11 @@ grief:
|
||||||
below_y: 255
|
below_y: 255
|
||||||
# y level lower limit
|
# y level lower limit
|
||||||
above_y: 20
|
above_y: 20
|
||||||
|
# enabled alert types (ignition, tnt, or lava)
|
||||||
|
enabled:
|
||||||
|
- ignition
|
||||||
|
- tnt
|
||||||
|
- lava
|
||||||
|
|
||||||
# OreAlert
|
# OreAlert
|
||||||
ore:
|
ore:
|
||||||
|
|
Loading…
Reference in New Issue