Removed message and socialspy because we now have that with sentinel

This commit is contained in:
TheTelly1
2023-07-22 19:04:16 -05:00
parent f41c28a995
commit 648e50e2b7
6 changed files with 121 additions and 49 deletions

View File

@@ -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());

View File

@@ -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)) {

View File

@@ -29,7 +29,7 @@ public class ChatConstraints {
}
public boolean passAllChecks() {
return passChatMuted() && passRepeat() && passSwear() && passUnicode() && passSpam();
return passChatMuted() && passUnicode() ;
}
public boolean passChatMuted() {

View File

@@ -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);

View File

@@ -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<Entity> 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
<Entity>
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();
});

View File

@@ -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 <player> [<message>]
aliases:
- msg
- pm
- dm
- tell
- whisper
- w
- message
attackcooldown:
description: Attack cooldown bypass for entities.
usage: /attackcooldown