diff --git a/.gradle/8.8/executionHistory/executionHistory.bin b/.gradle/8.8/executionHistory/executionHistory.bin index 3c14da4..df54142 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 46e4aeb..6668018 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 cda3c7a..ef7976b 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 4d053c8..d7d0bd5 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 8b88de7..7e4510c 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 01aa801..d1985de 100644 Binary files a/.gradle/buildOutputCleanup/buildOutputCleanup.lock and b/.gradle/buildOutputCleanup/buildOutputCleanup.lock differ diff --git a/build/classes/java/main/CoswayUtil/CoswayUtil$AnchorShield$1.class b/build/classes/java/main/CoswayUtil/CoswayUtil$AnchorShield$1.class index cb71c74..a902926 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 f5b2622..8e88171 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 81ae2b0..6a260f7 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$4.class b/build/classes/java/main/CoswayUtil/CoswayUtil$AnchorShield$4.class index 5408110..1bf84df 100644 Binary files a/build/classes/java/main/CoswayUtil/CoswayUtil$AnchorShield$4.class and b/build/classes/java/main/CoswayUtil/CoswayUtil$AnchorShield$4.class differ diff --git a/build/classes/java/main/CoswayUtil/CoswayUtil$AnchorShield.class b/build/classes/java/main/CoswayUtil/CoswayUtil$AnchorShield.class index ef95358..0401802 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 0dd76ff..24849f9 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.9-RELEASE.jar b/build/libs/CoswayUtil-1.9-RELEASE.jar index 06576dc..134552a 100644 Binary files a/build/libs/CoswayUtil-1.9-RELEASE.jar and b/build/libs/CoswayUtil-1.9-RELEASE.jar differ diff --git a/build/resources/main/plugin.yml b/build/resources/main/plugin.yml index 647d9a1..c7cd8a5 100644 --- a/build/resources/main/plugin.yml +++ b/build/resources/main/plugin.yml @@ -16,4 +16,8 @@ commands: gravitygauntlet: description: "Gives the player a Gravity Gauntlet" usage: "/gravitygauntlet" - permission: CoswayUtil.GravityGauntlet \ No newline at end of file + permission: CoswayUtil.GravityGauntlet + getwand: + description: "Gives player a levitation wand" + usage: "/getwand" + permission: CoswayUtil.wand \ No newline at end of file diff --git a/build/tmp/compileJava/compileTransaction/stash-dir/CoswayUtil$1.class.uniqueId5 b/build/tmp/compileJava/compileTransaction/stash-dir/CoswayUtil$1.class.uniqueId0 similarity index 100% rename from build/tmp/compileJava/compileTransaction/stash-dir/CoswayUtil$1.class.uniqueId5 rename to build/tmp/compileJava/compileTransaction/stash-dir/CoswayUtil$1.class.uniqueId0 diff --git a/build/tmp/compileJava/compileTransaction/stash-dir/CoswayUtil$AnchorShield$1.class.uniqueId13 b/build/tmp/compileJava/compileTransaction/stash-dir/CoswayUtil$AnchorShield$1.class.uniqueId9 similarity index 91% rename from build/tmp/compileJava/compileTransaction/stash-dir/CoswayUtil$AnchorShield$1.class.uniqueId13 rename to build/tmp/compileJava/compileTransaction/stash-dir/CoswayUtil$AnchorShield$1.class.uniqueId9 index cb71c74..a902926 100644 Binary files a/build/tmp/compileJava/compileTransaction/stash-dir/CoswayUtil$AnchorShield$1.class.uniqueId13 and b/build/tmp/compileJava/compileTransaction/stash-dir/CoswayUtil$AnchorShield$1.class.uniqueId9 differ diff --git a/build/tmp/compileJava/compileTransaction/stash-dir/CoswayUtil$AnchorShield$2.class.uniqueId7 b/build/tmp/compileJava/compileTransaction/stash-dir/CoswayUtil$AnchorShield$2.class.uniqueId3 similarity index 87% rename from build/tmp/compileJava/compileTransaction/stash-dir/CoswayUtil$AnchorShield$2.class.uniqueId7 rename to build/tmp/compileJava/compileTransaction/stash-dir/CoswayUtil$AnchorShield$2.class.uniqueId3 index f5b2622..8e88171 100644 Binary files a/build/tmp/compileJava/compileTransaction/stash-dir/CoswayUtil$AnchorShield$2.class.uniqueId7 and b/build/tmp/compileJava/compileTransaction/stash-dir/CoswayUtil$AnchorShield$2.class.uniqueId3 differ diff --git a/build/tmp/compileJava/compileTransaction/stash-dir/CoswayUtil$AnchorShield$3.class.uniqueId4 b/build/tmp/compileJava/compileTransaction/stash-dir/CoswayUtil$AnchorShield$3.class.uniqueId6 similarity index 88% rename from build/tmp/compileJava/compileTransaction/stash-dir/CoswayUtil$AnchorShield$3.class.uniqueId4 rename to build/tmp/compileJava/compileTransaction/stash-dir/CoswayUtil$AnchorShield$3.class.uniqueId6 index 37cc95b..6a260f7 100644 Binary files a/build/tmp/compileJava/compileTransaction/stash-dir/CoswayUtil$AnchorShield$3.class.uniqueId4 and b/build/tmp/compileJava/compileTransaction/stash-dir/CoswayUtil$AnchorShield$3.class.uniqueId6 differ diff --git a/build/tmp/compileJava/compileTransaction/stash-dir/CoswayUtil$AnchorShield$4.class.uniqueId2 b/build/tmp/compileJava/compileTransaction/stash-dir/CoswayUtil$AnchorShield$4.class.uniqueId2 deleted file mode 100644 index 146f0de..0000000 Binary files a/build/tmp/compileJava/compileTransaction/stash-dir/CoswayUtil$AnchorShield$4.class.uniqueId2 and /dev/null differ diff --git a/build/tmp/compileJava/compileTransaction/stash-dir/CoswayUtil$AnchorShield.class.uniqueId7 b/build/tmp/compileJava/compileTransaction/stash-dir/CoswayUtil$AnchorShield.class.uniqueId7 new file mode 100644 index 0000000..0401802 Binary files /dev/null and b/build/tmp/compileJava/compileTransaction/stash-dir/CoswayUtil$AnchorShield.class.uniqueId7 differ diff --git a/build/tmp/compileJava/compileTransaction/stash-dir/CoswayUtil$AnchorShield.class.uniqueId9 b/build/tmp/compileJava/compileTransaction/stash-dir/CoswayUtil$AnchorShield.class.uniqueId9 deleted file mode 100644 index 540101a..0000000 Binary files a/build/tmp/compileJava/compileTransaction/stash-dir/CoswayUtil$AnchorShield.class.uniqueId9 and /dev/null differ diff --git a/build/tmp/compileJava/compileTransaction/stash-dir/CoswayUtil.class.uniqueId2 b/build/tmp/compileJava/compileTransaction/stash-dir/CoswayUtil.class.uniqueId2 new file mode 100644 index 0000000..24849f9 Binary files /dev/null and b/build/tmp/compileJava/compileTransaction/stash-dir/CoswayUtil.class.uniqueId2 differ diff --git a/build/tmp/compileJava/compileTransaction/stash-dir/CoswayUtil.class.uniqueId6 b/build/tmp/compileJava/compileTransaction/stash-dir/CoswayUtil.class.uniqueId6 deleted file mode 100644 index 0dd76ff..0000000 Binary files a/build/tmp/compileJava/compileTransaction/stash-dir/CoswayUtil.class.uniqueId6 and /dev/null differ diff --git a/build/tmp/compileJava/compileTransaction/stash-dir/GravityGauntlet.class.uniqueId0 b/build/tmp/compileJava/compileTransaction/stash-dir/GravityGauntlet.class.uniqueId0 deleted file mode 100644 index d11403e..0000000 Binary files a/build/tmp/compileJava/compileTransaction/stash-dir/GravityGauntlet.class.uniqueId0 and /dev/null differ diff --git a/build/tmp/compileJava/compileTransaction/stash-dir/PhantomDodge$1.class.uniqueId10 b/build/tmp/compileJava/compileTransaction/stash-dir/PhantomDodge$1.class.uniqueId10 deleted file mode 100644 index b8ab886..0000000 Binary files a/build/tmp/compileJava/compileTransaction/stash-dir/PhantomDodge$1.class.uniqueId10 and /dev/null differ diff --git a/build/tmp/compileJava/compileTransaction/stash-dir/PhantomDodge.class.uniqueId11 b/build/tmp/compileJava/compileTransaction/stash-dir/PhantomDodge.class.uniqueId11 deleted file mode 100644 index eff2eda..0000000 Binary files a/build/tmp/compileJava/compileTransaction/stash-dir/PhantomDodge.class.uniqueId11 and /dev/null differ diff --git a/build/tmp/compileJava/compileTransaction/stash-dir/ShadowStep.class.uniqueId8 b/build/tmp/compileJava/compileTransaction/stash-dir/ShadowStep.class.uniqueId8 deleted file mode 100644 index b63243a..0000000 Binary files a/build/tmp/compileJava/compileTransaction/stash-dir/ShadowStep.class.uniqueId8 and /dev/null differ diff --git a/build/tmp/compileJava/compileTransaction/stash-dir/WitherContract$1.class.uniqueId1 b/build/tmp/compileJava/compileTransaction/stash-dir/WitherContract$1.class.uniqueId1 deleted file mode 100644 index 1d9a4fa..0000000 Binary files a/build/tmp/compileJava/compileTransaction/stash-dir/WitherContract$1.class.uniqueId1 and /dev/null differ diff --git a/build/tmp/compileJava/compileTransaction/stash-dir/WitherContract$2.class.uniqueId3 b/build/tmp/compileJava/compileTransaction/stash-dir/WitherContract$2.class.uniqueId3 deleted file mode 100644 index ef78745..0000000 Binary files a/build/tmp/compileJava/compileTransaction/stash-dir/WitherContract$2.class.uniqueId3 and /dev/null differ diff --git a/build/tmp/compileJava/compileTransaction/stash-dir/WitherContract.class.uniqueId12 b/build/tmp/compileJava/compileTransaction/stash-dir/WitherContract.class.uniqueId12 deleted file mode 100644 index 6ce948a..0000000 Binary files a/build/tmp/compileJava/compileTransaction/stash-dir/WitherContract.class.uniqueId12 and /dev/null differ diff --git a/build/tmp/compileJava/previous-compilation-data.bin b/build/tmp/compileJava/previous-compilation-data.bin index 5c04820..ebc23a8 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 29ae4cf..31f0c22 100644 --- a/src/main/java/CoswayUtil/CoswayUtil.java +++ b/src/main/java/CoswayUtil/CoswayUtil.java @@ -70,15 +70,20 @@ public final class CoswayUtil extends JavaPlugin implements Listener { // Register TotemShield new TotemShield(this); // Register the ShadowStep listener + new MobLevitationWand(this); getServer().getPluginManager().registerEvents(new ShadowStep(this), this); - // Register command - this.getCommand("gravitygauntlet").setExecutor(new GravityGauntletCommand()); + //register levitation wand + Bukkit.getPluginManager().registerEvents(new MobLevitationWand(this), this); // Register the PhantomDodge listener getServer().getPluginManager().registerEvents(new PhantomDodge(this), this); // Register the WitherContract listener getServer().getPluginManager().registerEvents(new WitherContract(this), this); - Bukkit.getPluginManager().registerEvents(new MobLevitationWand(this), this); + // Register commands + this.getCommand("gravitygauntlet").setExecutor(new GravityGauntletCommand()); this.getCommand("getwand").setExecutor(new GiveWandCommand()); + + + } @Override diff --git a/src/main/java/CoswayUtil/MobLevitationWand.java b/src/main/java/CoswayUtil/MobLevitationWand.java index 547e037..09695a1 100644 --- a/src/main/java/CoswayUtil/MobLevitationWand.java +++ b/src/main/java/CoswayUtil/MobLevitationWand.java @@ -4,6 +4,8 @@ import org.bukkit.*; import org.bukkit.entity.*; import org.bukkit.event.EventHandler; import org.bukkit.event.Listener; +import org.bukkit.event.player.PlayerAnimationEvent; +import org.bukkit.event.player.PlayerAnimationType; import org.bukkit.event.player.PlayerInteractEvent; import org.bukkit.inventory.ItemStack; import org.bukkit.inventory.meta.ItemMeta; @@ -15,7 +17,7 @@ import java.util.HashMap; import java.util.UUID; public class MobLevitationWand implements Listener { - private final NamespacedKey wandKey = new NamespacedKey("your_plugin", "levitation_wand"); + private final NamespacedKey wandKey = new NamespacedKey("coswayutil", "levitation_wand"); private final HashMap levitatedMobs = new HashMap<>(); private final CoswayUtil plugin; @@ -53,6 +55,7 @@ public class MobLevitationWand implements Listener { } } + private boolean isLevitationWand(ItemStack item) { if (item == null || item.getType() != Material.STICK || !item.hasItemMeta()) return false; ItemMeta meta = item.getItemMeta(); @@ -78,6 +81,18 @@ public class MobLevitationWand implements Listener { Vector direction = player.getLocation().getDirection().normalize().multiply(5); Location newLocation = player.getLocation().add(direction); + World world = player.getWorld(); + + // Ensure the mob is not placed inside a solid block + while (newLocation.getBlock().getType().isSolid()) { + newLocation.add(0, 1, 0); // Move up until a free space is found + } + + // Ensure the mob is not underground + int highestY = world.getHighestBlockYAt(newLocation); + if (newLocation.getY() < highestY) { + newLocation.setY(highestY + 1); // Adjust to be above ground + } entity.teleport(newLocation); @@ -92,6 +107,7 @@ public class MobLevitationWand implements Listener { }.runTaskTimer(plugin, 0L, 2L); } + private void releaseMob(Player player) { Entity entity = levitatedMobs.remove(player.getUniqueId()); if (entity != null) { @@ -104,7 +120,7 @@ public class MobLevitationWand implements Listener { ItemStack wand = new ItemStack(Material.STICK); ItemMeta meta = wand.getItemMeta(); meta.setDisplayName(ChatColor.LIGHT_PURPLE + "Levitation Wand"); - meta.getPersistentDataContainer().set(new NamespacedKey("CoswayUtil", "levitation_wand"), PersistentDataType.STRING, "true"); + meta.getPersistentDataContainer().set(new NamespacedKey("coswayutil", "levitation_wand"), PersistentDataType.STRING, "true"); wand.setItemMeta(meta); return wand; }