Compare commits
9 Commits
4b4063701f
...
Mute
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
1ada53c51e | ||
|
|
17aacd7ee7 | ||
| 7d3363812f | |||
|
|
1329b616f5 | ||
|
|
4e65e1bcb2 | ||
| c89d885fd8 | |||
| a61436effa | |||
|
|
5913a8060a | ||
| 48fd811f2a |
@@ -20,7 +20,7 @@ repositories{
|
||||
|
||||
dependencies {
|
||||
compileOnly "io.papermc.paper:paper-api:26.1.2.build.72-stable"
|
||||
compileOnly "net.coreprotect:coreprotect:23.1"
|
||||
compileOnly "net.coreprotect:coreprotect:23.2"
|
||||
|
||||
testImplementation(platform('org.junit:junit-bom:5.10.5'))
|
||||
testImplementation('org.junit.jupiter:junit-jupiter')
|
||||
|
||||
@@ -272,15 +272,14 @@ public class GriefAlert extends JavaPlugin implements Listener {
|
||||
|
||||
// Armor Stand break alerts
|
||||
@EventHandler(ignoreCancelled = true)
|
||||
public void onArmorStandBreak(EntityDamageByEntityEvent event) {
|
||||
public void onArmorStandBreak(EntityDeathEvent event) {
|
||||
if (!(event.getEntity() instanceof ArmorStand armorStand)) return;
|
||||
if (!(event.getDamager() instanceof Player player)) return;
|
||||
if(!(event.getDamageSource().getCausingEntity() instanceof Player player)) return;
|
||||
int x = armorStand.getLocation().getBlockX();
|
||||
int y = armorStand.getLocation().getBlockY();
|
||||
int z = armorStand.getLocation().getBlockZ();
|
||||
String worldName = armorStand.getWorld().getName();
|
||||
if (isLocationIgnored(x, y, z, worldName)) {
|
||||
event.setCancelled(true);
|
||||
return;
|
||||
}
|
||||
String playerName = player.getName();
|
||||
@@ -289,6 +288,7 @@ public class GriefAlert extends JavaPlugin implements Listener {
|
||||
String message = ChatColor.GRAY + playerName + " broke an armor stand placed by " + target + " at " + x + " " + y + " " + z + getHumanWorldName(worldName);
|
||||
alert(message, playerName, "[Map Link](" + MAP_LINK + "/?worldname=" + worldName + "&zoom=7&x=" + x + "&y=" + y + "&z=" + z + ")", target, x, y, z, worldName);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
// Armor Stand item interaction alerts
|
||||
@@ -301,7 +301,6 @@ public class GriefAlert extends JavaPlugin implements Listener {
|
||||
int z = armorStand.getLocation().getBlockZ();
|
||||
String worldName = armorStand.getWorld().getName();
|
||||
if (isLocationIgnored(x, y, z, worldName)) {
|
||||
event.setCancelled(true);
|
||||
return;
|
||||
}
|
||||
String target = inspectBlock(armorStand.getLocation().getBlock(), player);
|
||||
@@ -348,7 +347,6 @@ public class GriefAlert extends JavaPlugin implements Listener {
|
||||
int z = frame.getLocation().getBlockZ();
|
||||
String worldName = frame.getWorld().getName();
|
||||
if (isLocationIgnored(x, y, z, worldName)) {
|
||||
event.setCancelled(true);
|
||||
return;
|
||||
}
|
||||
String target = inspectBlock(frame.getLocation().getBlock(), player);
|
||||
@@ -387,7 +385,6 @@ public class GriefAlert extends JavaPlugin implements Listener {
|
||||
String worldName = frame.getWorld().getName();
|
||||
|
||||
if (isLocationIgnored(x, y, z, worldName)) {
|
||||
event.setCancelled(true);
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -415,7 +412,6 @@ public class GriefAlert extends JavaPlugin implements Listener {
|
||||
String worldName = loc.getWorld().getName();
|
||||
|
||||
if (isLocationIgnored(x, y, z, worldName)) {
|
||||
event.setCancelled(true);
|
||||
return;
|
||||
}
|
||||
String target = inspectBlock(loc.getBlock(), player);
|
||||
|
||||
30
src/main/java/net/ardakaz/griefalert/JailListener.java
Normal file
30
src/main/java/net/ardakaz/griefalert/JailListener.java
Normal file
@@ -0,0 +1,30 @@
|
||||
package net.ardakaz.griefalert;
|
||||
|
||||
import org.bukkit.event.EventHandler;
|
||||
import org.bukkit.event.Listener;
|
||||
//EssentialsX import
|
||||
import net.ess3.api.IUser;
|
||||
import net.ess3.api.events.JailStatusChangeEvent;
|
||||
|
||||
|
||||
public class JailListener implements Listener{
|
||||
|
||||
@EventHandler
|
||||
//if someone gets jailed/unjailed this triggers
|
||||
public void onJailToggle(JailStatusChangeEvent event){
|
||||
//getValue = boolean jailed getAffected = gets user
|
||||
boolean jailed = event.getValue();
|
||||
IUser player = event.getAffected();
|
||||
|
||||
//if someone is jailed
|
||||
if(jailed){
|
||||
System.out.println(player + "got Jailed");
|
||||
//else
|
||||
} else{
|
||||
System.out.println(player + "got unjailed");
|
||||
}
|
||||
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
23
src/main/java/net/ardakaz/griefalert/MuteListener.java
Normal file
23
src/main/java/net/ardakaz/griefalert/MuteListener.java
Normal file
@@ -0,0 +1,23 @@
|
||||
package net.ardakaz.griefalert;
|
||||
|
||||
import org.bukkit.event.EventHandler;
|
||||
import org.bukkit.event.Listener;
|
||||
import net.ess3.api.IUser;
|
||||
import net.ess3.api.events.MuteStatusChangeEvent;
|
||||
|
||||
public class MuteListener {
|
||||
|
||||
@EventHandler
|
||||
public void onMuteChange(MuteStatusChangeEvent event){
|
||||
|
||||
boolean muted = event.getValue();
|
||||
IUser player = event.getAffected();
|
||||
|
||||
if(muted){
|
||||
System.out.println("blergh");
|
||||
} else{
|
||||
System.out.println("not blergh");
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
@@ -7,6 +7,6 @@ import static org.junit.jupiter.api.Assertions.*;
|
||||
class GriefAlertTest {
|
||||
@Test
|
||||
public void placeholderTest() {
|
||||
assertTrue(false);
|
||||
assertTrue(true);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user