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
Etzelia 2021-07-17 03:24:23 +00:00
parent bc339caad6
commit e2819f22b2
4 changed files with 60 additions and 8 deletions

36
.drone.yml 100644
View File

@ -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"

View File

@ -47,7 +47,7 @@
<dependency>
<groupId>xyz.etztech</groupId>
<artifactId>plugin-api</artifactId>
<version>1.0.8</version>
<version>1.0.7</version>
</dependency>
</dependencies>
@ -57,8 +57,8 @@
<url>https://hub.spigotmc.org/nexus/content/groups/public/</url>
</repository>
<repository>
<id>etztech-repo</id>
<url>https://repo.etztech.xyz/</url>
<id>canopy-repo</id>
<url>https://mvn.canopymc.net/</url>
</repository>
<repository>
<id>mvn-repo</id>

View File

@ -117,23 +117,34 @@ public class GriefAlertListener implements Listener {
@EventHandler
public void onBlockIgnite(BlockIgniteEvent event) {
if (event.getPlayer() != null &&
(event.getCause() == BlockIgniteEvent.IgniteCause.FLINT_AND_STEEL ||
event.getCause() == BlockIgniteEvent.IgniteCause.FIREBALL)) {
if (
event.getPlayer() != null &&
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);
}
}
@EventHandler
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);
}
}
@EventHandler
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);
}
}

View File

@ -21,6 +21,11 @@ grief:
below_y: 255
# y level lower limit
above_y: 20
# enabled alert types (ignition, tnt, or lava)
enabled:
- ignition
- tnt
- lava
# OreAlert
ore: