diff --git a/.gradle/8.8/executionHistory/executionHistory.bin b/.gradle/8.8/executionHistory/executionHistory.bin index df54142..ca0ed96 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 6668018..ea867e6 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 ef7976b..f340066 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 d7d0bd5..b93feeb 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 7e4510c..634ae36 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 d1985de..be7f799 100644 Binary files a/.gradle/buildOutputCleanup/buildOutputCleanup.lock and b/.gradle/buildOutputCleanup/buildOutputCleanup.lock differ diff --git a/build.gradle b/build.gradle index 4756060..43d90fd 100644 --- a/build.gradle +++ b/build.gradle @@ -3,7 +3,7 @@ plugins { } group = 'com.newt-tech' -version = '1.9-RELEASE' +version = '1.10-RELEASE' repositories { mavenCentral() diff --git a/build/classes/java/main/CoswayUtil/CoswayUtil$AnchorShield.class b/build/classes/java/main/CoswayUtil/CoswayUtil$AnchorShield.class index 0401802..8840a93 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/GiveWandCommand.class b/build/classes/java/main/CoswayUtil/GiveWandCommand.class new file mode 100644 index 0000000..5746ceb Binary files /dev/null and b/build/classes/java/main/CoswayUtil/GiveWandCommand.class differ diff --git a/build/classes/java/main/CoswayUtil/MobLevitationWand$1.class b/build/classes/java/main/CoswayUtil/MobLevitationWand$1.class new file mode 100644 index 0000000..33eb1ac Binary files /dev/null and b/build/classes/java/main/CoswayUtil/MobLevitationWand$1.class differ diff --git a/build/classes/java/main/CoswayUtil/MobLevitationWand.class b/build/classes/java/main/CoswayUtil/MobLevitationWand.class new file mode 100644 index 0000000..032615c Binary files /dev/null and b/build/classes/java/main/CoswayUtil/MobLevitationWand.class differ diff --git a/build/libs/CoswayUtil-1.9-RELEASE.jar b/build/libs/CoswayUtil-1.9-RELEASE.jar index 134552a..7ed4185 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/tmp/compileJava/compileTransaction/stash-dir/CoswayUtil$1.class.uniqueId0 b/build/tmp/compileJava/compileTransaction/stash-dir/CoswayUtil$1.class.uniqueId6 similarity index 100% rename from build/tmp/compileJava/compileTransaction/stash-dir/CoswayUtil$1.class.uniqueId0 rename to build/tmp/compileJava/compileTransaction/stash-dir/CoswayUtil$1.class.uniqueId6 diff --git a/build/tmp/compileJava/compileTransaction/stash-dir/CoswayUtil$AnchorShield$1.class.uniqueId9 b/build/tmp/compileJava/compileTransaction/stash-dir/CoswayUtil$AnchorShield$1.class.uniqueId16 similarity index 100% rename from build/tmp/compileJava/compileTransaction/stash-dir/CoswayUtil$AnchorShield$1.class.uniqueId9 rename to build/tmp/compileJava/compileTransaction/stash-dir/CoswayUtil$AnchorShield$1.class.uniqueId16 diff --git a/build/tmp/compileJava/compileTransaction/stash-dir/CoswayUtil$AnchorShield$2.class.uniqueId3 b/build/tmp/compileJava/compileTransaction/stash-dir/CoswayUtil$AnchorShield$2.class.uniqueId8 similarity index 100% rename from build/tmp/compileJava/compileTransaction/stash-dir/CoswayUtil$AnchorShield$2.class.uniqueId3 rename to build/tmp/compileJava/compileTransaction/stash-dir/CoswayUtil$AnchorShield$2.class.uniqueId8 diff --git a/build/tmp/compileJava/compileTransaction/stash-dir/CoswayUtil$AnchorShield$3.class.uniqueId6 b/build/tmp/compileJava/compileTransaction/stash-dir/CoswayUtil$AnchorShield$3.class.uniqueId5 similarity index 100% rename from build/tmp/compileJava/compileTransaction/stash-dir/CoswayUtil$AnchorShield$3.class.uniqueId6 rename to build/tmp/compileJava/compileTransaction/stash-dir/CoswayUtil$AnchorShield$3.class.uniqueId5 diff --git a/build/tmp/compileJava/compileTransaction/stash-dir/CoswayUtil$AnchorShield$4.class.uniqueId3 b/build/tmp/compileJava/compileTransaction/stash-dir/CoswayUtil$AnchorShield$4.class.uniqueId3 new file mode 100644 index 0000000..1bf84df Binary files /dev/null and b/build/tmp/compileJava/compileTransaction/stash-dir/CoswayUtil$AnchorShield$4.class.uniqueId3 differ diff --git a/build/tmp/compileJava/compileTransaction/stash-dir/CoswayUtil$AnchorShield.class.uniqueId7 b/build/tmp/compileJava/compileTransaction/stash-dir/CoswayUtil$AnchorShield.class.uniqueId11 similarity index 87% rename from build/tmp/compileJava/compileTransaction/stash-dir/CoswayUtil$AnchorShield.class.uniqueId7 rename to build/tmp/compileJava/compileTransaction/stash-dir/CoswayUtil$AnchorShield.class.uniqueId11 index 0401802..80e0a49 100644 Binary files a/build/tmp/compileJava/compileTransaction/stash-dir/CoswayUtil$AnchorShield.class.uniqueId7 and b/build/tmp/compileJava/compileTransaction/stash-dir/CoswayUtil$AnchorShield.class.uniqueId11 differ diff --git a/build/tmp/compileJava/compileTransaction/stash-dir/CoswayUtil.class.uniqueId2 b/build/tmp/compileJava/compileTransaction/stash-dir/CoswayUtil.class.uniqueId7 similarity index 100% rename from build/tmp/compileJava/compileTransaction/stash-dir/CoswayUtil.class.uniqueId2 rename to build/tmp/compileJava/compileTransaction/stash-dir/CoswayUtil.class.uniqueId7 diff --git a/build/tmp/compileJava/compileTransaction/stash-dir/GiveWandCommand.class.uniqueId12 b/build/tmp/compileJava/compileTransaction/stash-dir/GiveWandCommand.class.uniqueId12 new file mode 100644 index 0000000..5746ceb Binary files /dev/null and b/build/tmp/compileJava/compileTransaction/stash-dir/GiveWandCommand.class.uniqueId12 differ diff --git a/build/tmp/compileJava/compileTransaction/stash-dir/GravityGauntlet.class.uniqueId0 b/build/tmp/compileJava/compileTransaction/stash-dir/GravityGauntlet.class.uniqueId0 new file mode 100644 index 0000000..d11403e Binary files /dev/null and b/build/tmp/compileJava/compileTransaction/stash-dir/GravityGauntlet.class.uniqueId0 differ diff --git a/build/tmp/compileJava/compileTransaction/stash-dir/MobLevitationWand$1.class.uniqueId2 b/build/tmp/compileJava/compileTransaction/stash-dir/MobLevitationWand$1.class.uniqueId2 new file mode 100644 index 0000000..33eb1ac Binary files /dev/null and b/build/tmp/compileJava/compileTransaction/stash-dir/MobLevitationWand$1.class.uniqueId2 differ diff --git a/build/tmp/compileJava/compileTransaction/stash-dir/MobLevitationWand.class.uniqueId9 b/build/tmp/compileJava/compileTransaction/stash-dir/MobLevitationWand.class.uniqueId9 new file mode 100644 index 0000000..032615c Binary files /dev/null and b/build/tmp/compileJava/compileTransaction/stash-dir/MobLevitationWand.class.uniqueId9 differ diff --git a/build/tmp/compileJava/compileTransaction/stash-dir/PhantomDodge$1.class.uniqueId13 b/build/tmp/compileJava/compileTransaction/stash-dir/PhantomDodge$1.class.uniqueId13 new file mode 100644 index 0000000..b8ab886 Binary files /dev/null and b/build/tmp/compileJava/compileTransaction/stash-dir/PhantomDodge$1.class.uniqueId13 differ diff --git a/build/tmp/compileJava/compileTransaction/stash-dir/PhantomDodge.class.uniqueId14 b/build/tmp/compileJava/compileTransaction/stash-dir/PhantomDodge.class.uniqueId14 new file mode 100644 index 0000000..eff2eda Binary files /dev/null and b/build/tmp/compileJava/compileTransaction/stash-dir/PhantomDodge.class.uniqueId14 differ diff --git a/build/tmp/compileJava/compileTransaction/stash-dir/ShadowStep.class.uniqueId10 b/build/tmp/compileJava/compileTransaction/stash-dir/ShadowStep.class.uniqueId10 new file mode 100644 index 0000000..b63243a Binary files /dev/null and b/build/tmp/compileJava/compileTransaction/stash-dir/ShadowStep.class.uniqueId10 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 new file mode 100644 index 0000000..1d9a4fa Binary files /dev/null and b/build/tmp/compileJava/compileTransaction/stash-dir/WitherContract$1.class.uniqueId1 differ diff --git a/build/tmp/compileJava/compileTransaction/stash-dir/WitherContract$2.class.uniqueId4 b/build/tmp/compileJava/compileTransaction/stash-dir/WitherContract$2.class.uniqueId4 new file mode 100644 index 0000000..ef78745 Binary files /dev/null and b/build/tmp/compileJava/compileTransaction/stash-dir/WitherContract$2.class.uniqueId4 differ diff --git a/build/tmp/compileJava/compileTransaction/stash-dir/WitherContract.class.uniqueId15 b/build/tmp/compileJava/compileTransaction/stash-dir/WitherContract.class.uniqueId15 new file mode 100644 index 0000000..6ce948a Binary files /dev/null and b/build/tmp/compileJava/compileTransaction/stash-dir/WitherContract.class.uniqueId15 differ diff --git a/build/tmp/compileJava/previous-compilation-data.bin b/build/tmp/compileJava/previous-compilation-data.bin index ebc23a8..92aea0f 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 31f0c22..873819d 100644 --- a/src/main/java/CoswayUtil/CoswayUtil.java +++ b/src/main/java/CoswayUtil/CoswayUtil.java @@ -81,6 +81,7 @@ public final class CoswayUtil extends JavaPlugin implements Listener { // Register commands this.getCommand("gravitygauntlet").setExecutor(new GravityGauntletCommand()); this.getCommand("getwand").setExecutor(new GiveWandCommand()); + getServer().getPluginManager().registerEvents(new LaunchStick(this), this); @@ -98,6 +99,9 @@ public final class CoswayUtil extends JavaPlugin implements Listener { setScale(player, Float.parseFloat(args[0])); } } + if (cmd.getName().equalsIgnoreCase("throw") && sender instanceof Player player) { + player.getInventory().addItem(LaunchStick.createLaunchStick()); + } if (cmd.getName().equalsIgnoreCase("throw") && sender instanceof Player player) { Player Target = getNearestPlayer(player,10); if(Target == null) { @@ -414,6 +418,8 @@ public final class CoswayUtil extends JavaPlugin implements Listener { private void removeMarker(Location loc) { Location newloc = loc.clone().add(0,1,0); + loc.getBlock().getWorld().playSound(loc,Sound.ITEM_TOTEM_USE,10,0); + loc.getBlock().getWorld().playEffect(loc,Effect.ENDER_DRAGON_DEATH,1); if (activeAnchors.containsKey(loc)) { activeAnchors.get(loc).remove(); activeAnchors.remove(loc); diff --git a/src/main/java/CoswayUtil/LaunchStick.java b/src/main/java/CoswayUtil/LaunchStick.java new file mode 100644 index 0000000..2722b7e --- /dev/null +++ b/src/main/java/CoswayUtil/LaunchStick.java @@ -0,0 +1,95 @@ +package CoswayUtil; + +import org.bukkit.ChatColor; +import org.bukkit.Material; +import org.bukkit.World; +import org.bukkit.enchantments.Enchantment; +import org.bukkit.entity.Player; +import org.bukkit.event.EventHandler; +import org.bukkit.event.Listener; +import org.bukkit.event.entity.EntityDamageEvent; +import org.bukkit.event.player.PlayerInteractEvent; +import org.bukkit.event.player.PlayerMoveEvent; +import org.bukkit.inventory.ItemStack; +import org.bukkit.inventory.meta.ItemMeta; +import org.bukkit.util.Vector; + +import java.util.Collections; +import java.util.HashSet; +import java.util.Set; + +public class LaunchStick implements Listener { + private final CoswayUtil plugin; + private final Set noFallPlayers = new HashSet<>(); + private final double LAUNCH_POWER = 4.0; // Adjust this to change launch strength + + public LaunchStick(CoswayUtil plugin) { + this.plugin = plugin; + plugin.getServer().getPluginManager().registerEvents(this, plugin); + } + + // Event handler for right-clicking with the launch stick + @EventHandler + public void onPlayerUseLaunchStick(PlayerInteractEvent event) { + Player player = event.getPlayer(); + ItemStack item = player.getInventory().getItemInMainHand(); + + if (!isLaunchStick(item)) return; + + event.setCancelled(true); + + // Get the direction the player is looking and apply launch + Vector direction = player.getLocation().getDirection().normalize().multiply(LAUNCH_POWER); + direction.setY(direction.getY() + 0.5); // Add slight upward boost + player.setVelocity(direction); + + // Add player to no-fall damage list + noFallPlayers.add(player); + + player.sendMessage(ChatColor.GREEN + "You launched yourself forward!"); + } + + // Prevent fall damage for launched players + @EventHandler + public void onPlayerFallDamage(EntityDamageEvent event) { + if (event.getEntity() instanceof Player player) { + if (noFallPlayers.contains(player) && event.getCause() == EntityDamageEvent.DamageCause.FALL) { + event.setCancelled(true); + noFallPlayers.remove(player); // Remove player once they hit the ground + } + } + } + + // Detect when a player lands on the ground and reset no-fall + @EventHandler + public void onPlayerLand(PlayerMoveEvent event) { + Player player = event.getPlayer(); + World world = player.getWorld(); + if (noFallPlayers.contains(player)) { + if (player.isOnGround()) { + noFallPlayers.remove(player); + } + } + } + + // Check if an item is the launch stick + private boolean isLaunchStick(ItemStack item) { + if (item == null || item.getType() != Material.CARROT_ON_A_STICK || !item.hasItemMeta()) return false; + ItemMeta meta = item.getItemMeta(); + return meta.hasDisplayName() && meta.getDisplayName().equals(ChatColor.LIGHT_PURPLE + "Launch Stick"); + } + + // Method to create the Launch Stick + public static ItemStack createLaunchStick() { + ItemStack item = new ItemStack(Material.CARROT_ON_A_STICK); + ItemMeta meta = item.getItemMeta(); + if (meta != null) { + meta.setDisplayName(ChatColor.LIGHT_PURPLE + "Launch Stick"); + meta.setLore(Collections.singletonList(ChatColor.GOLD + "Click to launch forward")); + meta.addEnchant(Enchantment.UNBREAKING, 1, true); + item.setItemMeta(meta); + } + return item; + } +} +