#Yeah that why its pretty weird

1 messages ยท Page 1 of 1 (latest)

vivid saffron
#

which one iis wrong then

swift stirrup
#

I test all code you send

#

And none success

vivid saffron
#

the last one i sent has to be correct

#

cuz u said when the player has the bypass perm it should never cancel the event right?

vivid saffron
#

if you simply setup a system like this you can easily test it

        boolean permission = true;
        boolean buildMode = true;
        boolean user = true;

        boolean result = !((buildMode && user) || permission);
        System.out.println(result);

this one returns the correct result for each of these scenerios you listed

Permission: true, Mode: true, User: true = okay
Permission: false, Mode: false, User: true = okay
Permission: true: Mode: false, User: true = not okay
Permission: false, Mode: true, User: true = not okay

swift stirrup
#

ok

#

Hmn its weird

#

Let me write, how should be the finals result

#

Permission: true, Mode: true, User: true = un cancel the event
Permission: true, Mode: false, User: true = un cancel the event
Permission: false, Mode: true, User: true = uncancel the event
Permission: false, Mode: false, User: true = cancel the event

vivid saffron
swift stirrup
#

okay

#

Hhmn

#

Im exausted

#

I tried everything without successfull

vivid saffron
#

maybe just sleep on it ๐Ÿ˜„

swift stirrup
#

Wait bro

#

I thik i understand what happening

#

Let try your code again

#

so it would be setCancelled(!(buildMode && user) || permission);

vivid saffron
#

that should be it

#

actually no

#

thats not it

#

setCancelled(!((buildMode && user) || permission)); its this

swift stirrup
#

ok

#

I wil ltry it

#

Sorry for losting your time mate

vivid saffron
#

thats ok. i know how frustrating these things can be sometimes

swift stirrup
#

I havent test it tho, but now something else

#

would be free to give another small hand?

#

All this issue came from, the old issue trying to cancel the slot 40 from player inventory

#

So with this, know i have 1 problem down, just need to fix the last one and im done

#

๐Ÿ˜‚

vivid saffron
#

what do you mean cancel slot 40 ?

swift stirrup
#

Yea, slot 40 is the hand which was added for using a shield

#

I first tried to block it using PlayerInteractEvent but that caused issues because it was overiden the block break and place event, so i just removed all that code, and leave as it was in the first version

#

But when i put all as the old version, then i came up with this issue we were solving

#

And now i still need to find a way to cancel the usage for that hand where peply usually put the shield, food, etc, i dont call it OFF HAND, because OFF_HAND is that slot and also trigged when placing blocks

vivid saffron
#

couln't u just stop people from putting stuff into that slot?

swift stirrup
#

Yeah that is what i was going to try

vivid saffron
#

should be pretty easily possible

swift stirrup
#

When i testing irealize that i broken the block break and palce event

#

So all issues, came trying to cancel second hand usage via Player interact

#

๐Ÿ˜‚

vivid saffron
#

yikesss

swift stirrup
#

That shit make me lost around 4hrs more

#

Really thanks, i would have to block via InvClick and InvDrag right?

#

But will that block, putting items via letter F?

vivid saffron
#

there is a seperate event for that

#

PlayerSwitchHand or something

swift stirrup
#

oh ok

#

Sorry for sounding sutpid but first ime doing such a big mini game for 1.19

#

I wont lie im 1.8 coder but trying to only accept 1.16+ mc comissions

vivid saffron
#

yea i've done most of my work on 1.8 as well so

swift stirrup
#

Atleast someone who understand and dont shitty me for coding in legacy versions

vivid saffron
#

yeaa support for 1.8 isnt here at spigot haha

swift stirrup
#

yeah i know i think that the best option in this case is to remove the ability for using that old versions

#

So then you make everybody allign in the same way

vivid saffron
#

yea. but that will never happen ๐Ÿ˜„

swift stirrup
#

Hi?

#

Are you still alive bro?

vivid saffron
#

On my phone

#

But yea

swift stirrup
#

oh ok

swift stirrup
#

Hi bro

#

I finally have to came back for help ๐Ÿ’€

#
 
@Override
public boolean execute(CommandSender sender, String command, String[] args) {
  if (args.length < 1 && this.hasPermission(sender, this.permission)) {
    this.sendHelp(sender);
    return true;
  }
  BukkitArgument argument = this.getArgument(args[0]);
  if (argument == null) {
    text.send(sender, "Command.Invalid-Argument", "%prefix%", text.getString("General.Prefix"), "%argument%", args[0]);
    return true;
  }
  if (!this.hasPermission(sender, this.permission) || !this.hasPermission(sender, argument.getPermission())) {
    text.send(sender, "Command.Invalid-Permission", "%prefix%", text.getString("General.Prefix"));
    return true;
  }
  argument.execute(sender, command, Arrays.copyOfRange(args, 1, args.length));
  return false;
}```
#

I really love having logic issues

vivid saffron
#

what tha problem this time ๐Ÿ˜„

#

or did you fix this already.

swift stirrup
#

I finally fix it thanks tho

vivid saffron
#

aight :d

swift stirrup
#

Hi

#

Im again bro

#

Really sorry foir being annoying