diff --git a/.gradle/8.8/executionHistory/executionHistory.bin b/.gradle/8.8/executionHistory/executionHistory.bin index 4173651..1b66319 100644 Binary files a/.gradle/8.8/executionHistory/executionHistory.bin and b/.gradle/8.8/executionHistory/executionHistory.bin differ diff --git a/.gradle/8.8/executionHistory/executionHistory.lock b/.gradle/8.8/executionHistory/executionHistory.lock index 44f0bdf..6012c51 100644 Binary files a/.gradle/8.8/executionHistory/executionHistory.lock and b/.gradle/8.8/executionHistory/executionHistory.lock differ diff --git a/.gradle/8.8/fileHashes/fileHashes.bin b/.gradle/8.8/fileHashes/fileHashes.bin index 85c7de5..8e6ac1e 100644 Binary files a/.gradle/8.8/fileHashes/fileHashes.bin and b/.gradle/8.8/fileHashes/fileHashes.bin differ diff --git a/.gradle/8.8/fileHashes/fileHashes.lock b/.gradle/8.8/fileHashes/fileHashes.lock index 785adfb..ffd54fd 100644 Binary files a/.gradle/8.8/fileHashes/fileHashes.lock and b/.gradle/8.8/fileHashes/fileHashes.lock differ diff --git a/.gradle/8.8/fileHashes/resourceHashesCache.bin b/.gradle/8.8/fileHashes/resourceHashesCache.bin index fc0f5f0..40450fb 100644 Binary files a/.gradle/8.8/fileHashes/resourceHashesCache.bin and b/.gradle/8.8/fileHashes/resourceHashesCache.bin differ diff --git a/.gradle/buildOutputCleanup/buildOutputCleanup.lock b/.gradle/buildOutputCleanup/buildOutputCleanup.lock index e245583..b7f539d 100644 Binary files a/.gradle/buildOutputCleanup/buildOutputCleanup.lock and b/.gradle/buildOutputCleanup/buildOutputCleanup.lock differ diff --git a/.gradle/file-system.probe b/.gradle/file-system.probe index 1659231..3cb4317 100644 Binary files a/.gradle/file-system.probe and b/.gradle/file-system.probe differ diff --git a/build/classes/java/main/CoswayUtil/CoswayUtil$1.class b/build/classes/java/main/CoswayUtil/CoswayUtil$1.class index a85c07a..fc79f98 100644 Binary files a/build/classes/java/main/CoswayUtil/CoswayUtil$1.class and b/build/classes/java/main/CoswayUtil/CoswayUtil$1.class differ diff --git a/build/classes/java/main/CoswayUtil/CoswayUtil$AnchorShield$1.class b/build/classes/java/main/CoswayUtil/CoswayUtil$AnchorShield$1.class index 692a984..d1bf742 100644 Binary files a/build/classes/java/main/CoswayUtil/CoswayUtil$AnchorShield$1.class and b/build/classes/java/main/CoswayUtil/CoswayUtil$AnchorShield$1.class differ diff --git a/build/classes/java/main/CoswayUtil/CoswayUtil$AnchorShield$2.class b/build/classes/java/main/CoswayUtil/CoswayUtil$AnchorShield$2.class index f8f036d..050bfc9 100644 Binary files a/build/classes/java/main/CoswayUtil/CoswayUtil$AnchorShield$2.class and b/build/classes/java/main/CoswayUtil/CoswayUtil$AnchorShield$2.class differ diff --git a/build/classes/java/main/CoswayUtil/CoswayUtil$AnchorShield$3.class b/build/classes/java/main/CoswayUtil/CoswayUtil$AnchorShield$3.class index f9c238d..09feac4 100644 Binary files a/build/classes/java/main/CoswayUtil/CoswayUtil$AnchorShield$3.class and b/build/classes/java/main/CoswayUtil/CoswayUtil$AnchorShield$3.class differ diff --git a/build/classes/java/main/CoswayUtil/CoswayUtil$AnchorShield.class b/build/classes/java/main/CoswayUtil/CoswayUtil$AnchorShield.class index 21ecbb3..2ca762b 100644 Binary files a/build/classes/java/main/CoswayUtil/CoswayUtil$AnchorShield.class and b/build/classes/java/main/CoswayUtil/CoswayUtil$AnchorShield.class differ diff --git a/build/classes/java/main/CoswayUtil/CoswayUtil.class b/build/classes/java/main/CoswayUtil/CoswayUtil.class index ebe5868..d9c9e5c 100644 Binary files a/build/classes/java/main/CoswayUtil/CoswayUtil.class and b/build/classes/java/main/CoswayUtil/CoswayUtil.class differ diff --git a/build/libs/CoswayUtil-1.7-BETA.jar b/build/libs/CoswayUtil-1.7-BETA.jar index 2d3e455..718c9dd 100644 Binary files a/build/libs/CoswayUtil-1.7-BETA.jar and b/build/libs/CoswayUtil-1.7-BETA.jar differ diff --git a/build/tmp/compileJava/compileTransaction/stash-dir/CoswayUtil$AnchorShield$1.class.uniqueId4 b/build/tmp/compileJava/compileTransaction/stash-dir/CoswayUtil$AnchorShield$1.class.uniqueId4 deleted file mode 100644 index 1e950dd..0000000 Binary files a/build/tmp/compileJava/compileTransaction/stash-dir/CoswayUtil$AnchorShield$1.class.uniqueId4 and /dev/null differ diff --git a/build/tmp/compileJava/compileTransaction/stash-dir/CoswayUtil$AnchorShield$2.class.uniqueId1 b/build/tmp/compileJava/compileTransaction/stash-dir/CoswayUtil$AnchorShield$2.class.uniqueId1 deleted file mode 100644 index be0630a..0000000 Binary files a/build/tmp/compileJava/compileTransaction/stash-dir/CoswayUtil$AnchorShield$2.class.uniqueId1 and /dev/null differ diff --git a/build/tmp/compileJava/compileTransaction/stash-dir/CoswayUtil$AnchorShield$3.class.uniqueId2 b/build/tmp/compileJava/compileTransaction/stash-dir/CoswayUtil$AnchorShield$3.class.uniqueId2 deleted file mode 100644 index 23f3bb5..0000000 Binary files a/build/tmp/compileJava/compileTransaction/stash-dir/CoswayUtil$AnchorShield$3.class.uniqueId2 and /dev/null differ diff --git a/build/tmp/compileJava/compileTransaction/stash-dir/CoswayUtil$AnchorShield.class.uniqueId3 b/build/tmp/compileJava/compileTransaction/stash-dir/CoswayUtil$AnchorShield.class.uniqueId3 deleted file mode 100644 index 76d7d98..0000000 Binary files a/build/tmp/compileJava/compileTransaction/stash-dir/CoswayUtil$AnchorShield.class.uniqueId3 and /dev/null differ diff --git a/build/tmp/compileJava/compileTransaction/stash-dir/CoswayUtil$AnchorShield.class.uniqueId4 b/build/tmp/compileJava/compileTransaction/stash-dir/CoswayUtil$AnchorShield.class.uniqueId4 new file mode 100644 index 0000000..2ca762b Binary files /dev/null and b/build/tmp/compileJava/compileTransaction/stash-dir/CoswayUtil$AnchorShield.class.uniqueId4 differ diff --git a/build/tmp/compileJava/compileTransaction/stash-dir/CoswayUtil.class.uniqueId0 b/build/tmp/compileJava/compileTransaction/stash-dir/CoswayUtil.class.uniqueId0 deleted file mode 100644 index eb5ca56..0000000 Binary files a/build/tmp/compileJava/compileTransaction/stash-dir/CoswayUtil.class.uniqueId0 and /dev/null differ diff --git a/build/tmp/compileJava/previous-compilation-data.bin b/build/tmp/compileJava/previous-compilation-data.bin index c743b18..9b900a3 100644 Binary files a/build/tmp/compileJava/previous-compilation-data.bin and b/build/tmp/compileJava/previous-compilation-data.bin differ diff --git a/src/main/java/CoswayUtil/CoswayUtil.java b/src/main/java/CoswayUtil/CoswayUtil.java index b00895a..02c45be 100644 --- a/src/main/java/CoswayUtil/CoswayUtil.java +++ b/src/main/java/CoswayUtil/CoswayUtil.java @@ -18,7 +18,7 @@ import org.bukkit.scheduler.BukkitRunnable; import org.bukkit.util.RayTraceResult; import org.jetbrains.annotations.NotNull; import org.bukkit.potion.PotionEffectType; - +import org.bukkit.block.data.type.RespawnAnchor; import java.util.HashMap; import java.util.Map; @@ -49,13 +49,13 @@ public final class CoswayUtil extends JavaPlugin { double z = radius * Math.sin(phi) * Math.sin(theta); Location particleLoc = center.clone().add(x, y, z); - player.getWorld().spawnParticle(Particle.ENCHANT, particleLoc, 1, 0, 0, 0, 0); + player.getWorld().spawnParticle(Particle.DUST, particleLoc, 1, 0, 0, 0, 0, new Particle.DustOptions(Color.AQUA, 0.5F)); } } } } } - }.runTaskTimer(this, 0, 10); // Runs every 10 ticks (0.5 seconds) + }.runTaskTimer(this, 0, 2); // Runs every 10 ticks (0.5 seconds) } @@ -125,12 +125,13 @@ public final class CoswayUtil extends JavaPlugin { public class AnchorShield implements Listener { private final Map activeAnchors = new HashMap<>(); private final int RING_RADIUS = 25; - private final int FUEL_DECREASE_TIME = 5 * 60 * 20; // 5 minutes in ticks + private final int FUEL_DECREASE_TIME = 1 * 60 * 20; // 5 minutes in ticks public void clearActiveAnchors() { for (ArmorStand marker : activeAnchors.values()) { if (marker != null && !marker.isDead()) { marker.remove(); // Remove the ArmorStand from the world + serverMessage("removed marker"); } } activeAnchors.clear(); // Clear the HashMap @@ -191,6 +192,9 @@ public final class CoswayUtil extends JavaPlugin { public void run() { if (!activeAnchors.containsKey(loc)) { cancel(); + serverMessage("anchors active: " + activeAnchors.toString()); + serverMessage("active loc: "+loc); + serverMessage("cancel runnable initiated 1"); return; } createParticleRing(loc); @@ -228,25 +232,35 @@ public final class CoswayUtil extends JavaPlugin { @Override public void run() { if (!activeAnchors.containsKey(loc)) { + serverMessage("anchor mapping did not match, removed anchor: "+loc); cancel(); + serverMessage("cancel runnable initiated 2"); return; } - Block block = loc.getBlock(); + Block block = loc.clone().subtract(0,2,0).getBlock(); + RespawnAnchor anchorData = (RespawnAnchor) block.getBlockData(); if (block.getType() != Material.RESPAWN_ANCHOR) { + serverMessage(String.valueOf(block.getType())); removeMarker(loc); cancel(); + serverMessage("cancel runnable initiated 3"); return; } - int fuelLevel = block.getBlockData().getAsString().contains("charges=") ? - Integer.parseInt(block.getBlockData().getAsString().split("charges=")[1].substring(0, 1)) : 0; + int fuelLevel = anchorData.getCharges(); if (fuelLevel > 0) { - Bukkit.dispatchCommand(Bukkit.getConsoleSender(), "data merge block " + loc.getBlockX() + " " + loc.getBlockY() + " " + loc.getBlockZ() + " {Charges:" + (fuelLevel - 1) + "}"); + anchorData.setCharges(anchorData.getCharges() - 1); + block.setBlockData(anchorData); // Apply the new data + loc.getBlock().getWorld().playSound(loc,Sound.BLOCK_BEACON_DEACTIVATE,10,0); + loc.getBlock().getWorld().playEffect(loc,Effect.TRIAL_SPAWNER_DETECT_PLAYER,1); + serverMessage("depleted anchor charge"); } else { removeMarker(loc); + serverMessage("removed anchor shield for no fuel"); cancel(); + serverMessage("cancel runnable initiated 4"); } } }.runTaskTimer(CoswayUtil.this, FUEL_DECREASE_TIME, FUEL_DECREASE_TIME); @@ -256,6 +270,7 @@ public final class CoswayUtil extends JavaPlugin { if (activeAnchors.containsKey(loc)) { activeAnchors.get(loc).remove(); activeAnchors.remove(loc); + serverMessage("force removed shield mapping"); } }