From 648e50e2b7908f96fb31a9feda9fc12e3aa3dcb9 Mon Sep 17 00:00:00 2001 From: TheTelly1 <93684527+TheTelly1@users.noreply.github.com> Date: Sat, 22 Jul 2023 19:04:16 -0500 Subject: [PATCH] Removed message and socialspy because we now have that with sentinel --- .../fun/ogre/ogredupealias/OgreDupeAlias.java | 4 - .../events/SPBEventListener.java | 1 - .../ogredupealias/plugin/ChatConstraints.java | 2 +- .../plugin/funitems/LaserPointer.java | 6 +- .../plugin/funitems/VoidCharm.java | 143 ++++++++++++++---- src/main/resources/plugin.yml | 14 -- 6 files changed, 121 insertions(+), 49 deletions(-) diff --git a/src/main/java/fun/ogre/ogredupealias/OgreDupeAlias.java b/src/main/java/fun/ogre/ogredupealias/OgreDupeAlias.java index a7c6658..8ccf1df 100644 --- a/src/main/java/fun/ogre/ogredupealias/OgreDupeAlias.java +++ b/src/main/java/fun/ogre/ogredupealias/OgreDupeAlias.java @@ -64,16 +64,12 @@ public final class OgreDupeAlias extends JavaPlugin { getCommand("mutechat").setTabCompleter(new MuteChatCommand()); getCommand("staffchat").setExecutor(new StaffChatCommand()); getCommand("staffchat").setTabCompleter(new StaffChatCommand()); - getCommand("socialspy").setExecutor(new SocialSpyCommand()); - getCommand("socialspy").setTabCompleter(new SocialSpyCommand()); getCommand("commandspy").setExecutor(new CommandSpyCommand()); getCommand("commandspy").setTabCompleter(new CommandSpyCommand()); getCommand("recipespy").setExecutor(new RecipeSpyCommand()); getCommand("recipespy").setTabCompleter(new RecipeSpyCommand()); getCommand("irepair").setExecutor(new IRepairCommand()); getCommand("irepair").setTabCompleter(new IRepairCommand()); - getCommand("message").setExecutor(new MessageCommand()); - getCommand("message").setTabCompleter(new MessageCommand()); getCommand("attackcooldown").setExecutor(new AttackCooldownCommand()); getCommand("attackcooldown").setTabCompleter(new AttackCooldownCommand()); getCommand("givecustom").setExecutor(new GiveCustomCommand()); diff --git a/src/main/java/fun/ogre/ogredupealias/events/SPBEventListener.java b/src/main/java/fun/ogre/ogredupealias/events/SPBEventListener.java index 95a7b83..84ef9ef 100644 --- a/src/main/java/fun/ogre/ogredupealias/events/SPBEventListener.java +++ b/src/main/java/fun/ogre/ogredupealias/events/SPBEventListener.java @@ -25,7 +25,6 @@ public class SPBEventListener implements Listener { Projectile proj = e.getEntity(); if (proj instanceof Snowball && proj.getShooter() instanceof Player shooter) { Snowball snowball = (Snowball) proj; - shooter.sendMessage("Hit a block"); if (snowball.getItem().getType() == Material.BLUE_DYE || snowball.getItem().getType() == Material.BLUE_DYE) { shooter.sendMessage("Passed dye check"); if (!e.getHitBlock().getType().equals(Material.COMMAND_BLOCK) && !e.getHitBlock().getType().equals(Material.CHAIN_COMMAND_BLOCK) && !e.getHitBlock().getType().equals(Material.REPEATING_COMMAND_BLOCK)) { diff --git a/src/main/java/fun/ogre/ogredupealias/plugin/ChatConstraints.java b/src/main/java/fun/ogre/ogredupealias/plugin/ChatConstraints.java index 26e67d4..28f40d1 100644 --- a/src/main/java/fun/ogre/ogredupealias/plugin/ChatConstraints.java +++ b/src/main/java/fun/ogre/ogredupealias/plugin/ChatConstraints.java @@ -29,7 +29,7 @@ public class ChatConstraints { } public boolean passAllChecks() { - return passChatMuted() && passRepeat() && passSwear() && passUnicode() && passSpam(); + return passChatMuted() && passUnicode() ; } public boolean passChatMuted() { diff --git a/src/main/java/fun/ogre/ogredupealias/plugin/funitems/LaserPointer.java b/src/main/java/fun/ogre/ogredupealias/plugin/funitems/LaserPointer.java index 23e4a4f..8483a1d 100644 --- a/src/main/java/fun/ogre/ogredupealias/plugin/funitems/LaserPointer.java +++ b/src/main/java/fun/ogre/ogredupealias/plugin/funitems/LaserPointer.java @@ -27,7 +27,11 @@ public class LaserPointer { switch (a) { case RIGHT_CLICK_AIR, RIGHT_CLICK_BLOCK -> { // Full beam - RaycastUtils.raycast(start,rot,30,0.1,(point) -> { + Location end = RaycastUtils.raycast(start,rot,60,0.5,(point) -> { + return !point.getBlock().isPassable(); + }); + Vector rightVec = new Vector(rot.getX(), rot.getY(), rot.getZ()); + RaycastUtils.raycast(start.clone().add(0,1,0),end,0.1,(point) -> { Particle.DustOptions dust = new Particle.DustOptions(Color.LIME, 0.5F); point.getWorld().spawnParticle(Particle.REDSTONE,point,1,0,0,0,0,dust); return !point.getBlock().getType().equals(Material.AIR); diff --git a/src/main/java/fun/ogre/ogredupealias/plugin/funitems/VoidCharm.java b/src/main/java/fun/ogre/ogredupealias/plugin/funitems/VoidCharm.java index 120dd91..368fc6a 100644 --- a/src/main/java/fun/ogre/ogredupealias/plugin/funitems/VoidCharm.java +++ b/src/main/java/fun/ogre/ogredupealias/plugin/funitems/VoidCharm.java @@ -17,35 +17,123 @@ import org.bukkit.util.Vector; import java.util.ArrayList; import java.util.List; -public class VoidCharm { - public static void handleVoidCharm(PlayerInteractEvent e) { - Player p = e.getPlayer(); - ItemStack stack = e.getItem(); - Action a = e.getAction(); - if (ItemUtils.matchDisplay(stack, ItemPresets.VOID_CHARM)) { - e.setCancelled(true); - switch (a) { - case LEFT_CLICK_BLOCK, LEFT_CLICK_AIR -> { - //test - } - case RIGHT_CLICK_AIR, RIGHT_CLICK_BLOCK -> { - Location start = p.getEyeLocation(); - Vector rot = p.getLocation().getDirection().normalize(); - SoundPlayer throwSound = new SoundPlayer(p.getLocation(), Sound.ITEM_TRIDENT_RIPTIDE_3, 1,0.4F); - throwSound.playWithin(10); - RaycastUtils.raycast(start, rot, 60, 0.5, (point) -> { - World w = point.getWorld(); - if (w == null) return false; - List targets = new ArrayList<>(w.getNearbyEntities(point, 0.5,0.5,0.5, entity -> { - return entity instanceof LivingEntity living && !living.isDead() && living != p; - })); - // Create stuff here - Particle.DustOptions dust = new Particle.DustOptions(Color.BLACK, 1); - // Check for hits - +public +class +VoidCharm +{ + public + static + void + handleVoidCharm + ( + PlayerInteractEvent e + ) { + Player + p = + e.getPlayer(); + ItemStack + stack = + e.getItem(); + Action + a = + e.getAction(); + if + ( + ItemUtils.matchDisplay + ( + stack, + ItemPresets.VOID_CHARM + ) + ) + { + e.setCancelled + ( + true + ); + switch + ( + a + ) + { + case RIGHT_CLICK_AIR, RIGHT_CLICK_BLOCK + -> { + Location + start = + p.getEyeLocation(); + Vector + rot = + p.getLocation() + .getDirection() + .normalize(); + SoundPlayer + throwSound = + new + SoundPlayer + ( + p.getLocation(), + Sound.ITEM_TRIDENT_RIPTIDE_3, + 1, + 0.4F + ); + throwSound. + playWithin + ( + 10 + ); + RaycastUtils. + raycast + ( + start, + rot, + 60, + 0.5, + ( + point + ) + -> + { + World + w = + point.getWorld(); + if + ( + w == null + ) + return false; + List + + targets = + new ArrayList + <> + ( + w.getNearbyEntities + ( + point, + 0.5, + 0.5, + 0.5, + entity + -> { + return + entity + instanceof + LivingEntity + living && + !living.isDead() && + living != + p; + } + ) + ); + Particle. + DustOptions + dust = new Particle. + DustOptions + ( + Color.BLACK, 1 + ); targets.forEach(target -> { if (target instanceof LivingEntity living) { - // Player hit here Location targetLoc = target.getLocation(); Location originalLoc = target.getLocation().add(0,0.1,0); SoundPlayer bellSound = new SoundPlayer(target.getLocation(), Sound.ITEM_TRIDENT_THUNDER, 1,0.4F); @@ -60,7 +148,6 @@ public class VoidCharm { },0,1); } }); - // Every raytrace w.spawnParticle(Particle.REDSTONE, point, 1,0,0,0,0, dust); return !targets.isEmpty(); }); diff --git a/src/main/resources/plugin.yml b/src/main/resources/plugin.yml index 90805f0..0f69391 100644 --- a/src/main/resources/plugin.yml +++ b/src/main/resources/plugin.yml @@ -17,9 +17,6 @@ permissions: oda.commands.staffchat: description: Access to staffchat. default: op - oda.commands.socialspy: - description: Access to socialspy. - default: op oda.commands.commandspy: description: Access to commandspy. default: op @@ -109,17 +106,6 @@ commands: aliases: - ipearlrepair - irestock - message: - description: Private message a player - usage: /message [] - aliases: - - msg - - pm - - dm - - tell - - whisper - - w - - message attackcooldown: description: Attack cooldown bypass for entities. usage: /attackcooldown