#Yeah that why its pretty weird
1 messages ยท Page 1 of 1 (latest)
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?
which combination of values are not giving you the desired outcome then
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
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
yea thats exactly what this does
maybe just sleep on it ๐
Wait bro
I thik i understand what happening
Let try your code again
so it would be setCancelled(!(buildMode && user) || permission);
that should be it
actually no
thats not it
setCancelled(!((buildMode && user) || permission)); its this
thats ok. i know how frustrating these things can be sometimes
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
๐
what do you mean cancel slot 40 ?
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
couln't u just stop people from putting stuff into that slot?
Yeah that is what i was going to try
should be pretty easily possible
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
๐
yikesss
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?
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
yea i've done most of my work on 1.8 as well so
Atleast someone who understand and dont shitty me for coding in legacy versions
yeaa support for 1.8 isnt here at spigot haha
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
yea. but that will never happen ๐
oh ok
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
I finally fix it thanks tho
aight :d