8 Commits

Author SHA1 Message Date
urtypicalblahajlunatic
17aacd7ee7 i think this update should add jail Listenerthat works? 2026-07-02 00:00:06 +02:00
7d3363812f Merge pull request 'changed Armorstand Logic' (#3) from armorstand-DeathLogic into main
Reviewed-on: #3
2026-06-27 14:38:18 +00:00
urtypicalblahajlunatic
1329b616f5 debugged and fixed EntityDeathEvent 2026-06-27 16:21:36 +02:00
urtypicalblahajlunatic
4e65e1bcb2 armorstand changed from EntityHitEvent to EntityDeathEvent, SHOULD cause less fake errors 2026-06-27 14:29:49 +02:00
c89d885fd8 Update src/main/java/net/ardakaz/griefalert/GriefAlert.java
2nd try to frickign update this BS
(also removed cancel stuff)
2026-06-27 10:55:30 +00:00
a61436effa Update src/main/java/net/ardakaz/griefalert/GriefAlert.java
removed some unneeded cancel events
2026-06-27 10:48:19 +00:00
ThePindabaas
5913a8060a bump co version + change test to always succeed 2026-06-27 11:45:36 +02:00
48fd811f2a Merge pull request 'add-gradle project' (#1) from add-gradle into main
Reviewed-on: #1
2026-06-27 09:33:29 +00:00
4 changed files with 35 additions and 9 deletions

View File

@@ -20,7 +20,7 @@ repositories{
dependencies { dependencies {
compileOnly "io.papermc.paper:paper-api:26.1.2.build.72-stable" 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(platform('org.junit:junit-bom:5.10.5'))
testImplementation('org.junit.jupiter:junit-jupiter') testImplementation('org.junit.jupiter:junit-jupiter')

View File

@@ -272,15 +272,14 @@ public class GriefAlert extends JavaPlugin implements Listener {
// Armor Stand break alerts // Armor Stand break alerts
@EventHandler(ignoreCancelled = true) @EventHandler(ignoreCancelled = true)
public void onArmorStandBreak(EntityDamageByEntityEvent event) { public void onArmorStandBreak(EntityDeathEvent event) {
if (!(event.getEntity() instanceof ArmorStand armorStand)) return; 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 x = armorStand.getLocation().getBlockX();
int y = armorStand.getLocation().getBlockY(); int y = armorStand.getLocation().getBlockY();
int z = armorStand.getLocation().getBlockZ(); int z = armorStand.getLocation().getBlockZ();
String worldName = armorStand.getWorld().getName(); String worldName = armorStand.getWorld().getName();
if (isLocationIgnored(x, y, z, worldName)) { if (isLocationIgnored(x, y, z, worldName)) {
event.setCancelled(true);
return; return;
} }
String playerName = player.getName(); 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); 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); 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 // Armor Stand item interaction alerts
@@ -301,7 +301,6 @@ public class GriefAlert extends JavaPlugin implements Listener {
int z = armorStand.getLocation().getBlockZ(); int z = armorStand.getLocation().getBlockZ();
String worldName = armorStand.getWorld().getName(); String worldName = armorStand.getWorld().getName();
if (isLocationIgnored(x, y, z, worldName)) { if (isLocationIgnored(x, y, z, worldName)) {
event.setCancelled(true);
return; return;
} }
String target = inspectBlock(armorStand.getLocation().getBlock(), player); String target = inspectBlock(armorStand.getLocation().getBlock(), player);
@@ -348,7 +347,6 @@ public class GriefAlert extends JavaPlugin implements Listener {
int z = frame.getLocation().getBlockZ(); int z = frame.getLocation().getBlockZ();
String worldName = frame.getWorld().getName(); String worldName = frame.getWorld().getName();
if (isLocationIgnored(x, y, z, worldName)) { if (isLocationIgnored(x, y, z, worldName)) {
event.setCancelled(true);
return; return;
} }
String target = inspectBlock(frame.getLocation().getBlock(), player); String target = inspectBlock(frame.getLocation().getBlock(), player);
@@ -387,7 +385,6 @@ public class GriefAlert extends JavaPlugin implements Listener {
String worldName = frame.getWorld().getName(); String worldName = frame.getWorld().getName();
if (isLocationIgnored(x, y, z, worldName)) { if (isLocationIgnored(x, y, z, worldName)) {
event.setCancelled(true);
return; return;
} }
@@ -415,7 +412,6 @@ public class GriefAlert extends JavaPlugin implements Listener {
String worldName = loc.getWorld().getName(); String worldName = loc.getWorld().getName();
if (isLocationIgnored(x, y, z, worldName)) { if (isLocationIgnored(x, y, z, worldName)) {
event.setCancelled(true);
return; return;
} }
String target = inspectBlock(loc.getBlock(), player); String target = inspectBlock(loc.getBlock(), player);

View 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");
}
}
}

View File

@@ -7,6 +7,6 @@ import static org.junit.jupiter.api.Assertions.*;
class GriefAlertTest { class GriefAlertTest {
@Test @Test
public void placeholderTest() { public void placeholderTest() {
assertTrue(false); assertTrue(true);
} }
} }