Check for configurable grief types (#2)
New CI for main Add Drone Signed-off-by: Etzelia <etzelia@hotmail.com> Check for configurable grief types Signed-off-by: Etzelia <etzelia@hotmail.com> Reviewed-on: https://git.canopymc.net/Canopy/MineAlert/pulls/2 Reviewed-by: ZeroHD <joey@ahines.net> Co-Authored-By: Etzelia <etzelia@hotmail.com> Co-Committed-By: Etzelia <etzelia@hotmail.com>main latest
parent
bc339caad6
commit
e2819f22b2
|
@ -0,0 +1,36 @@
|
||||||
|
---
|
||||||
|
kind: pipeline
|
||||||
|
type: docker
|
||||||
|
name: compliance
|
||||||
|
|
||||||
|
steps:
|
||||||
|
- name: build
|
||||||
|
image: maven:3-openjdk-16
|
||||||
|
commands:
|
||||||
|
- mvn install
|
||||||
|
|
||||||
|
---
|
||||||
|
kind: pipeline
|
||||||
|
type: docker
|
||||||
|
name: release
|
||||||
|
|
||||||
|
trigger:
|
||||||
|
branch:
|
||||||
|
- main
|
||||||
|
event:
|
||||||
|
- push
|
||||||
|
|
||||||
|
steps:
|
||||||
|
- name: build
|
||||||
|
image: maven:3-openjdk-16
|
||||||
|
commands:
|
||||||
|
- mvn install
|
||||||
|
- name: gitea-release
|
||||||
|
pull: always
|
||||||
|
image: jolheiser/drone-gitea-main:latest
|
||||||
|
settings:
|
||||||
|
token:
|
||||||
|
from_secret: gitea_token
|
||||||
|
base: https://git.canopymc.net
|
||||||
|
files:
|
||||||
|
- "target/MineAlert-*.jar"
|
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