#help-archived
1 messages · Page 132 of 1
can I add a screen here
ok i try / skript reload 1 that is so skript homemade and then he says / skript help and then i do that and then comes / skript help wtf is this problem man
this is my problem
fix it a.u.b
ok i try / skript reload 1 that is so skript homemade and then he says / skript help and then i do that and then comes / skript help wtf is this problem man https://imgur.com/a/BOSqdQJ
[
22:18
]
this is my problem
[
22:18
]
fix it a.u.b
have u tried /help skript
noo yes
Whattttttttt
of course wooh I really wouldn't have tried that
Can you please make a list like the following vvvv
What you want:
The step you did:
What is wrong:
[
22:18
]
this is my problem
[
22:18
]
fix it a.u.b
[
22:18
]
ok i try / skript reload 1 that is so skript homemade and then he says / skript help and then i do that and then comes / skript help wtf is this problem man https://imgur.com/a/BOSqdQJ
[
22:18
]
this is my problem
fix it a.u.b
[
22:18
]
this is my problem
[
22:18
]
fix it a.u.b
[
22:18
]
ok i try / skript reload 1 that is so skript homemade and then he says / skript help and then i do that and then comes / skript help wtf is this problem man https://imgur.com/a/BOSqdQJ
[
22:18
]
this is my problem
[
22:18
]
fix it a.u.b
The Minecraft Development addon for IntelliJ only supports 1.12 and above. Is there a way for the plugin to work for earlier versions or do I need to make the plugin from scratch?
Doesn't skript have it's own discord?
Make a plugin "from Scratch" is actually easy cause the plugin only generate a main class and a pom.xml file
i think it noth
Will take you about 2min
@frigid ember You need to ask the dev on the plugin page
Is there a way to increase mobs sizes?
Do I need to have a hierarchy like main - java, then my package ?
@frigid ember Just go to the page where you downloaded your "skript" plugin and click the "discussion" button on the right, then ask help here
is there a way to disable certain world edit permissions like superpickaxe ?
@subtle wedge If you use maven, I recommend you generate your project by intellij selecting "Maven Project" the nyou main, java etc will be automatically generated
@frigid ember I don't know. You have to find it, you found the plugin then find it again lmao !
Should I be using Maven for plugins?
@wheat summit mobs size ? Like Giant Zombies and big Slimes ?
I use Maven/Gradle for plugins as it just helps me to manage dependencies.
Like Pigs or Zombies
@twilit orchid Yes, just check the worldedit page for permissions
Wondering if I can scale up my Pig boss and make it 3 or 5x bbigger than a normal one
@undone narwhal but how do i disable it tho
@wheat summit impossible unfortunately
@twilit orchid Use a perm plugin like LukePerms
@subtle wedge I strongly recommend using Maven or Gradle
Could that work>
Nop
Alright thanks
Minecraft Client won't understand
Well one more question, is there a way to make a nonhostile mob hostile?
I know I can set it's pathfinder goals
You have to change its AI and goals
How do I setup using Maven though?
Ok
I never did that before but there are a lot of tuts online @wheat summit
Ok thanks
(double check the version)
@subtle wedge After creating a maven project, just edit your pom.xml and add your dependencies
Alright
I have
#spigotcraft is an example of DiscordSRV
Any errors ?
https://hastebin.com/feracowuni.xml (The version is red)
Factions Server ;p
Looks fine, will still recommend updating for a lot of performance fixes and exploit fixes tho.
I'm trying to make passive mobs aggressive though I'm not really sure how to make a hit effect, all I really see is taking health away like here:
public void c() {
this.e.setGoalTarget(this.d, EntityTargetEvent.TargetReason.CLOSEST_PLAYER, true);
this.d.setHealth(this.d.getHealth() - 5);
}
Is there a better way to do it?
@undone narwhal I've updated my proxy to Velocity, but the feature I'm missing is an antibot. Do you know a good one?
So, what build system u using?
I have watched a video talking about deluxetags, and I have followed all the instructions. The problem is that, I need to change a chat setting from the essentials plugin in order for deluxetags to "show the tag". But, I have Bssentials and it doesn't have this chat setting, so I don't know what to do.
Well, I actually recommend you directly asking the developer of Bssentials cause I don't know this plugin sorry
Oh, ok, I will
@neat pulsar You still have the option of installing a plugin which allows to use bungee plugins on velocity
But i asked more like: "how does an anti bot work"?
Cause if it's not too hard I can maybe make it
Is here any experienced developer? I have one question, i mean its not code problem its more like a tip 😂
I guess I'm an "experienced developer" ^^
Listening to you, some others may join to help you too
Y'all, I just wanted to say I have the server up and running, AND I can make myself an operator without crashing. Thank you so much for the directions to go back to rev 2694. I am once again "cool" with the kiddos.
its already fixed
I know there's a setHealth method though I'm wondering if there's some method that actually makes it looks like the player was hit?
Trying to make passive mobs into hostile and not sure how to make them attack besides setting health
There ya go! 😄
you'd think people would at least test their PR 😐
In that case, will remove the pin
I mean at least it compiled
It did! Though it errors on client join lol
Not sure how he could have missed it had it been tested
@wheat summit I haven't understand sorry
?
When you lower the health it shows the hit animation afaik
Doesn't apply knockback it looks like
Yeah you have to send knockback yourself
Calculate the proper vector and apply it
Isn't there a #damage method ?
I don't know about sound
I would think there is Rolyn
There might be @undone narwhal I haven't done too much in that area before
Well I haven't looked
@wheat summit I think this method will apply the sound + animation + a small knockback which is not "direction based"
Setting health will?
strange
I thought I checked that thanks though
So something like this sould work?
this.d.damageEntity(DamageSource.mobAttack(this.e), 100);
D is a player and E is an entity
Yes it does
The fact that you have to clarify that should be enough reason for you to change your variable names lol
Thanks a lot! I am stupid sometimes and can not see methods
Well it is in a pathfinder class
You should avoid single-character var names (with the exception of loops)
And they use this.d and this.e which I also feel like is stupid
Ah it's NMS. Disregard
They're named that was because they're obfuscated as such. Figured this was just code you had written
Ohh ok
Is there a way to make them what they were actually called or not/
It does annoy me a lot
Mojang has mappings but aside from that, no
You can use the mappings as reference but you can't apply them
Ok thanks
Ahh this is being weird now
Only when I don't hit the entity with a pathfinder I made it won't attack me
Sorry
so im having troubles with my spigot server, i have retried with no plugins, new map, etc etc. i dont think this is a server side issue as im using a hosting service "shockbyte" fuggin ISP would make me pay more to port forward. any help would be appreciated! i looked through the crash logs and couldnt find anything suspect. when i attempt to log in i get "internal exception: java.IOException: Connection reset by peer.
Only when I don't hit it then it attacks
seems to be the same issue with OP
When I hit it it stops attacking and runns around me
only works when i deop myself
server crashes
Whats a great chest shop plugin for 1.15.2
Can't seem to find one that is well supported
Don't mind if its premium
Ok, Donald you should be getting errors in logs or console though
If not then the run.bat may not be set up right I guess
ive tried with and without plugins, that pastebin was with one plugin that is working . the server is working as long as i dont OP myself.
i have some command blocks but they are doing pretty trivial things
Ok
Seems like the plugin or command blocks are looping upon eachother
I'm not really sure though
what issue did @peak reef have?
Not sure
The latest spigot file had something wrong in it, so I had to go back to rev 2694 when I made the server.
And now it works and now I'm cool. 😉
update again @feral bane there was a broken build last night
for some reason, players on my server keep getting kicked due to the keep alive timeout
and it's happening over and over again
You too @peak reef! The commit was reverted so you're okay to build latest again
(although doesn't matter too much as the 2 commits since then just invert one another - no changes since your build)
Whew. 🙂 And my kids discovered that they can /kittycannon so I probably won't be doing any work on the thing under after they go to bed! LOL!
That's fair! Was my favourite command when I was younger too ;P
I'll force my children to use my plugins in the future 😈
kittycannon LOL
It just yeets cats
my favourite command was /kill
Is there to increase durability of all stuff?
hey, whenever I join my server, the server crashes
it plops out this error message
17.06 19:20:12 [Server] User Authenticator #2/INFO UUID of player ThatHomo_ is 94ea4791-f974-45ab-9a16-2235109694a6
17.06 19:20:12 [Server] Server thread/ERROR Encountered an unexpected exception
17.06 19:20:12 [Server] INFO java.lang.StackOverflowError: null
17.06 19:20:12 [Server] INFO at java.util.LinkedHashMap.afterNodeInsertion(LinkedHashMap.java:299) ~[?:1.8.0_241]
17.06 19:20:12 [Server] INFO at java.util.HashMap.putVal(HashMap.java:664) ~[?:1.8.0_241]
17.06 19:20:12 [Server] INFO at java.util.HashMap.put(HashMap.java:612) ~[?:1.8.0_241]
17.06 19:20:12 [Server] INFO at com.mojang.brigadier.tree.CommandNode.addChild(CommandNode.java:102) ~[spigot-1.15.2.jar:git-Spigot-a99063f-cb701f6]
Do custom blocks with meta data keep their details when they are placed and picked up? Could I use this fact to create a special crafting table, for instance, that makes crafting certain materials more viable?
Metadata is not persistent across server restarts nor when picked up
In fact, that block position maintains the Metadata
If you were to put a block there that sets metadata, break it and place some other block, that block still has the metadata until it's removed
NBT on a tile entity is a different story, Minecraft removes tile entities on block change, so that can be ignored. Though still not kept on the item when picked up
So if I were to encapsulate a specific material inside a custom class, and then save the details of the class and reload them upon a restart, could I use its position when placed to activate custom crafting screens?
ah
not when its picked up
unfortunate
hmm
You have to store that in the item's NBT when it's broken, yea
Then account for that when placing it as well
I better look into this NBT business more
Bukkit has a nice "NBT API" for custom NBT with items, blocks and entities (soon chunks?). PersistentDataHolders
1.14+, but modern versions = modern API
PersistentDataContainer
Yes, but those that can access containers are holders
PersistentDataContainer is only newer version tho
1.14+, but modern versions = modern API
Oh I didn't see you say that
I tried looking through the docs of PersistantDataContainer, but it is very confusing. Is there a video you guys know of that I could look at that explains it well?
Most likely not as it's relatively new
It's not terribly difficult. The generics make it scarier than it really is
NamespacedKey myUniqueKey = new NamespacedKey(plugin, "my_key"); // Ideally this would be a constant, public static and final field
PersistentDataContainer container = item.getItemMeta().getPersistentDataContainer();
container.set(myUniqueKey, PersistentDataType.STRING, "Hello world!");
String helloWorld = container.get(myUniqueKey, PersistentDataType.STRING);```
Just as an example
(you would have to re-set ItemMeta in this case because the data container needs to be re-applied, just like any other change to ItemMeta... this is an example, you get it)
interesting, thank you for the example
Would the data stay saved upon place and pickup?
No, you still have to handle that
Though it will persist across restarts for tile entities and items
Unfortunately, just regular blocks (non-tile entities - like grass, stone, sand, etc. most blocks really) do not have NBT. You have to handle that yourself as well
At least for the items you can use the data containers to keep track of which item should do what, but in terms of blocks, you're likely better off writing some sort of block wrapper
I love wrappers
I'll likely do that. I'll definitely keep the PersistantStorageContainer in mind however
Some object where you can hold the necessary data, map from Block to your data type, fetch where necessary. Read/write from/to file on startup and shutdown
Y'know how it goes 😄
Perfect!
I appreciate your help
Pleasure
How to make a custom item? Like the worldedit wand so you can detect left click or whatever you want to do with it
@fleet crane seems to be broken but just in a different way now, as an OP i dont have access to typical minecraft commands such as teleport, gamemode etc etc . .
i have a problem with making myself a server operator on my server
this is what it says in console
[ERROR] Encountered an unexpected exception
java.lang.StackOverflowError: null
at java.util.stream.AbstractPipeline.evaluate(AbstractPipeline.java:241) ~[?:1.8.0_212]
at java.util.stream.ReferencePipeline.collect(ReferencePipeline.java:499) ~[?:1.8.0_212]
at com.mojang.brigadier.tree.CommandNode.addChild(CommandNode.java:110) ~[spigot-1.15.2.jar:git-Spigot-a99063f-cb701f6]
at net.minecraft.server.v1_15_R1.CommandDispatcher.a(CommandDispatcher.java:313) ~[spigot-1.15.2.jar:git-Spigot-a99063f-cb701f6]
at net.minecraft.server.v1_15_R1.CommandDispatcher.a(CommandDispatcher.java:305) ~[spigot-1.15.2.jar:git-Spigot-a99063f-cb701f6]
at net.minecraft.server.v1_15_R1.CommandDispatcher.a(CommandDispatcher.java:315) ~[spigot-1.15.2.jar:git-Spigot-a99063f-cb701f6]
at net.minecraft.server.v1_15_R1.CommandDispatcher.a(CommandDispatcher.java:305) ~[spigot-1.15.2.jar:git-Spigot-a99063f-cb701f6]
You're creating an infinite recursion loop
lol
i have not installed any plugins or anything
I think there was an issue with one of the builds of spigot, maybe try updating?
I thought that was an NPE not a SOE?
StackOverflowError: null
it only does that whenever i join the server
wasnt there something about a broken build or smt
i am using the latest build but idk
You're right - I just skimmed it at the time. It seems to have been the same one
You need to either use --rev 2694 or the latest (2696)
i did --rev latest
(I assume 2695 was the issue since the pin choco had to build 2694 instead is gone)
whens the last time you used buildtools
today
i think they were talking about a broken build earlier
wanna try again? im not really basing this off of any info other than jsut to try
ok
Yes, it looks like the 2696 should have fixed the 2695 issue
not sure when 2696 was released
5h ago
what was the pr that broke it 👀 im curious
https://just-paste.it/0S3sCXySnK
Does anyone know what this could be related to?
A problem with the DeluxeAnnounce plugin - let the devleoper know.
Does anyone have a good example for doing message configuration?
nvm I did it with reflection.
My bad for the broken PR 😓 didn’t realise I had a plug-in that was messing with the CommandDispatcher when I tested it
its always brigadier huh...
I had a friend who make a command lib as a joke before brigadier, and then brigadier came out and it was like exactly the same LOL
at least for some commands you just send a node graph to the client without additional autocompletions...
kind of like it that way
I like having a ton of control by just sending a new list after every character
Also saves database lookups
What happened was certain commands being redirected in a circle and causing a stack overflow
Because I don't have to grab all the data and map it all to strings, I just send the data for the autocompletion they need
lol that's a pretty horrible bug lol
can’t tell if you’re sarcastic knowing you...
Oh no I'm dead serious
If, for each of my commands, I had to pre-gen the autofill for each layer of subcommand, I'd have a pretty big issue
Because some of the autofills aren't exactly the simplest and do involve database lookups on data that may not be in cache
@gusty swallow a quick look and I already saw it...
I don’t wanna bother looking at code but I assume the pr was unnecessary
Well, suggestions are still broken for redirected commands
the suggestion logic just needs a complete rework
Well... really the redirection logic
Although I don’t see an easy way to fix it now that I know there’s cyclic redirections going on
Just make cyclic redirections impossible by detecting that your graph is not, in fact, a tree.
Well, Mojang themselves are the ones doing it with vanilla commands
Which vanilla thing is cyclic?
‘/execute align | axes’
If you enter it, you would notice suggestions just stop after the first subcommand
What you could do is, as you're walking the graph, check to see if you've already walked the node you're suggesting, and if you have, then just abort
they broke the suggests as well??
Sounds straightforward to me
It was already broken to begin with, I just tried (and failed) to fix that
ah
You don't even need recursion for this though, that's the dumb thing
Just use a stack and a set for checking repeats
What you could do is, as you're walking the graph, check to see if you've already walked the node you're suggesting, and if you have, then just abort
@gleaming helm that could work but I’m not sure what’s Spigot’s policy on changing method signatures is
What was broken with vanilla redirections?
If they’re okay with it then sure
Recursive loops @frigid ember
@gusty swallow Don't use recursion and you don't need to change the method sig
There are plenty of ways to solve the problem without recursion
There are, but recursion’s the least invasive/requires the least changes
Use a stack for your DFS tree
And every time you try to push onto the stack
Just confirm that you haven't seen it using the set
And if you have seen it before, then break
And if not, add it to the set
True true
That 1. eliminates recursion, which isn't really great to do anyways (as we've seen), and 2. eliminates your infinite looping problem without changing method signatures
Wait hmmm
That won’t work either
Redirection is final, using a Set & Stack won’t fix the problem 100%, since the destination must be set before a command is created.
How would that matter though?
Other thing you could do to avoid the method signature change is
Overload your method as it is now (or make a new one with another name with different params) and then
Just call your new adjusted recursive one
If the set you’re passing is null, create a new one
And then just add yourself to the set, if you already exist, return no suggestions.
That one should be even more trivial than the last
(And if you do not exist, just do the rest of the method as normal)
Because we’re trying to create a copy of the graph with a few rules. Thinking about it again, it isn’t as simple as a method signature change now. There’s something wrong with how Brigadier was created.
A copy cannot be made before it’s destination is set.
The destination that point to copy cannot be resolved since copy hasn’t been made yet (see the first point)
Thinking about it as a graph is stupid, should never have been done in the first place
Thinking about it as a tree (which is just a graph with no cycles) is the proper way.
The thing is it has cycles that needs to be dealt with
I’m doing the recursion this way, you effectively delete the cycles
By refusing to walk edges that create cycles.
So aborting if it detects cyclic directions?
Exactly
That’s why you change the message signature
You pass in what you’ve already seen, and if you’ve already seen YOURSELF, you stop and return nothing.
I know I know, but would we just be effectively ignoring suggestions for cyclic directions then?
You would be returning that “there are no suggestions” if your suggestions have already been returned
What that does in effect is block all cycles
It effectively deletes all edges that that will result in cycles, which converts your cyclic graph to a tree.
Am I making sense?
Yup, it still kinda bumps me that suggestions for cyclic directions would still be broken but I guess it’s better than nothing?
I do have another more radical alternative which is to use reflection to modify the destination after a command is created which I use in my own lib and works. I’m pretty sure that won’t pass.
How would you support suggestions for cycles without creating recursion?
It works because a copy is created, and added before we look at the redirection
That is an impossible task unless, at SOME number of layers, you stop making new suggestions.
That sounds like a really bad idea
So it would find the redirected command in the look-up map and set the destination accordingly
So here’s the trick
@gleaming helm you can thank me for not having to pregen it
🙂
1.13 was going to remove server side completions, I spammed them hard to keep it
The trick is, pass a reference to a set into the recursive function
If you do not exist in the set, add yourself, and continue
If you DO exist in the set, return no suggestions
Which effectively kills that branch
thankfully,i think mojang ran into needing it themselves for vanilla so it mandated it, but dinnerbone originally said 'maybe later'
Please for the love of god no, I need my dynamic tab complete 😦
oh god
Remember, we cannot “add ourselves” because at that point because we haven’t been created yet, sounds strange but yeah
That’s what’s happening in the original code
Add some other identifier like the class name or something like that
Anything that identifies you uniquely
you need to prob maintain a set of processed nodes and avoid recursion of an already processed node
and point to original ref and NOT a clone
That’s exactly what I’m discussing how to do
create a hashset, add it to method signature
(That’s exactly what I suggested)
so do that 😛
Mojang’s original code creates a clone of each command for serialisation
yes to avoid it changing mid process
but you can point to the already cloned node
clone the root of the tree, then clone each level going down
there are no ID's here, need to use object identity
well i guess the path+type is sorta a key
/foo bar <baz>
foo literal
bar literal
baz argument
Is it unique? Is it always accessible? Is it deterministic? Then it’s a key, use it.
The result of getClass() should be all of those things
As far as I understand mojang’s command system
clone the root of the tree, then clone each level going down
@timid valley
The thing is, a clone’s redirection cannot be set once it has been created.
I don’t understand why this is so convoluted, is there literally no way to identify a node?
yes, and that clones redirection should be pointing to something that already exists
so im saying just set it to the reference
Wdym by “reference”?
ugh ima have to dig up that code you did, i dont fully know details of redirect stuff beyond the little bit of me seeing it when i was working on brig
.forward receives a ref to anotehr CommandNode
so what part blew up recursively? was it the json serialization?
Lemme just write some example code, maybe it will help
So here,was (CommandNode) map.get(argumentbuilder.getRedirect()
Returning null?
class Command {
final Command destination;
Command(Command destination) {
this.destination = destination;
}
}
The gist of the problem is CommandNode being designed like this the above
And you have Command A pointed to Command B, and Command B pointed to Command A
It is impossible to initialize one without the other
yes which is why its not actually done in the ctor 🙂
Just an example
And so my suggestion is store that “command a” identifier, and if you’ve suggested for it already, don’t suggest for it again
Alternatively, put a cap on the amount of layers that can be suggested
That could work
back up to what the issue actually was in mojangs code. in your example, was B being cloned before A, therefor the (CommandNode) map.get(argumentbuilder.getRedirect() returned null?
In the original code, if B was cloned after A, it will just return null, yes
and is that what is happening?
In the original yes, it breaks suggestions for recursive commands
try /execute align|axis
i think your solution is far off from how to fix that
Notice that suggestions exist to exist after the first subcommand
whoops
cease to exist*
when was the last time a commit was made to the brigadier repo?
option 1 is that this scenario force invokes the base code to go ahead and inject the reference into map then set it as mojang intends if its not found already
option 2 is to build a "pending node references" map that as soon as the dependent node is initialized later, it goes back and fills in any reference depending on this node
My solution was to eagerly visit B, to get that nailed down before cloning A. which backfired really badly when recursive commands are in play
The lowest hanging fruit here is just to stop completing after you’re n layers deep in recursion
I think you’ll find n can be quite high
dont worry about depth, its an abstract framework
But obviously we worry about infinite depth
with my option 2 recursion isnt even an issue on force initializing
well, you're welcome to have a go at it 😛
yes itll go on priority 3231233123 on my list of things to work on
Feelsbadman
option 3 which I used in my lib was to modify the destination field in A once B has been cloned. 🤔
thats what my option 2 is....
Anyone knows how to fix this crash error 'Exception in server tick loop'?
Well what you could also do is add a blocker, but make it only activate on some depth of cycles in the graph
well, to be fair, the issue here isnt brigadier, it's mc's binding to brig
So like you’re allowed to cycle 3 times for example before it cuts you off
Curious but how would you implement option 2 without reflection? @timid valley
I mean reflection
fml
as a new spigot pr done correctly 😛
;o ?
Oh lol
I guess I'll try implement option 2 and if that fails do the blocking thing Kevin suggested
Would be much easier if Brigadier had mutable nodes instead.
Wondering if they would accept such a PR
make an ArrayListMultimap of <CommandNode, CommandNode> for dependents
when this fails: argumentbuilder.redirect((CommandNode) map.get(argumentbuilder.getRedirect()));
do pending.add(argumentbuilder.getRedirect(), commandnode);
err wait
ah shit dang builders
i guess you could abort this instance, do what i just suggested
and once dependent is done, go back and reinvoke this with sourcecommandnode
and retry again after
bleh, easier to force process the redirect target
Personally I would just use reflection to set the destination. It seems a lot less complicated imo
Already have a ghetto implementation of it, https://github.com/Pante/Chimera/blob/stable/commons/src/main/java/com/karuslabs/commons/command/tree/TreeWalker.java
actually heh slightly harder to force process because you dont know the parent
so storing a pending ref is prob only option here
So much unnecessary recursion tho
Yeah I’m saying inside of mojang’s code the recursion is completely unnecessary
There are much better ways to solve this problem without recursion
Recursion is much neater than manually using a stack in this case imo
Yeah except which one is more maintainable
As demonstrated by the length of this conversation
Personally I lean towards recursion being more maintainble, since the stack isn't explicitly managed by you
I meannn
😐
I prefer not to change the method signature when I want to modify the behavior of my loops
(Where possible and reasonable)
🤷 well it's really down to personal pref I guess, for tree traversal and stuff I would go with recursion any day
for smaller trees, sure... but for large trees.... I'll take loops any day of the week
recursion on big things almost never ends well
I'll see if I can fix the issue again when I have the time. I'll probs try a more general fix with the 2nd option that Aikar mentioned. Probably using reflection? Otherwise I'll try block rediected commands after 2-3 levels.
Thanks for the help
Hm?
it will cause children to be registered in a different order, but I can say from experience that order doesn't matter. we've removed the sorting even from CommandNode in paper and I have a PR open to remove it from Brigadier too
I'm trying to use getConfig() in my events class but it won't let me get it, how do I fix this?
use mainclass.getConfig()
mainclass is your main class name
private [mainclassname] plugin;
this.plugin = plugin;
``` that is the constructor
``` plugin.getConfig();``` and this is in the code
doesn’t no order scramble literals and arguments?
now it says
Non-static method 'getConfig()' cannot be referenced from a static context
its a onPlayerJoin event btw
ye that shouldn't matter
private [mainclassname] plugin; this.plugin = plugin; ``` that is the constructor ``` plugin.getConfig();``` and this is in the code
did you put it in the constructer though?
I just tested it and it should work...
@frigid ember nothing depends on order
the execution code does not even look at .getChildren()
it inspects literals and arguments as separate lists
I have no idea how brigadier works
it builds a command tree and tries to route input to the correct command node based on said input
for me to support args before literals in ACF I also need to move to a tree style
its on my infinite recursion to do list
I question if you actualyl do it if you have to say "probably"
a tree is pretty defined on how it works lol
No @steady cedar your command lib doesn't support infinite recursive loops of commands
A tree doesn't contain cycles
You'd think mojang has 2 brain cells
nothing wrong with what mojang designed
just a flaw in the dispatcher file
order has to be guaranteed with cyclic deps like that
tbh it sounds kinda dumb to me to be able to redirect commands in an infinite manner, and then expect server code to be able to recursively generate all possible autocomplete parameters
if A depends on B, B needs to be init before A, and that's not happening is what the bug is
Sounds a bit like an impossible task
i dont think you understand whats going on lol
1 command can jump into another command
Can you just initialize them all and THEN build the completion?
so once you elave command A's context and now in a sub command execution context, authority of completions is delegated to the current context
ideally this issue could of been solved is if redirects stored identifiers and not references to objects
would simplify the json too
How do you generate the json
Because clearly you end up with an identifier in the json
My question specifically is, how do you get that specific identifier
oh right it doesnt use json for this
I still am failing to see how there is no way to get a unique identifier for a command, when the whole command can be identified SOMEHOW when you type it in game.
it assigns each node an incrementing ID
then the redirect simply writes an int on what ID it points to
oh so they're using BFS
BFS?
Wait so they're already using BFS where's the recursion
this is not same code as before
the code before builds the map to pass to this
public PacketPlayOutCommands(RootCommandNode<ICompletionProvider> rootcommandnode) {
this.a = rootcommandnode;
yeah ok i think the fix to this issue is to apply the packets code here too
just move packet code to be done here instead and generate the bytes directly and avoid intermediate clone
Wait
Wait this is so much simpler
Why not just completely start over once you see a redirect
So like when the user types the pipe character
wat
Just start a brand new like...
So you're telling me that
this is computing static data about the command tree that is sent on login/world change
All possible combinations of redirecting from what to what else and everything
ALL of that shit
Has to be precomputed
yes
That is the most retarded thing I've ever heard
its called a command tree
no its really not
the client has a full understanding of the commands the server supports
and stuff like ACF even can supply subcommands so client already knows about them w/o even asking server
including writing hint text and param names
But my point is, generating all possible combinations of redirects is an impossible task
Nah, it isn't.
It cannot be feasably done
it's not lol
Technically speaking you can, it's just
its statically analyzable
the code clearly works for execution already
Assuming a large number of possible redirects and an infinite redirect length you run out of memory LONG before you're finished
infinite redirect length makes you run out of memory lol
its not that complicated
What you need is for the client to understand how redirects work
it doesn't have to infinitely recurse
And then the server doesn't NEED to do redirects
It just tells the client what the syntax and completions are for each individual command
And the client (being the intelligent thing that it is) just looks up the proper syntax when you start typing a redirected command
look, I think I qualify as an expert on command frameworks lol... mojang did alright. It's not a bad design. It's just got a bug that needs to be fixed
The bug is in the design
The bug in the design is the server has this impossible task of generating every single possible redirect
you clearly dont understand the ssytem
When redirects could EASILY be handled by the client
No I don't understand why it has to be this complicated, because this really isn't a hard problem to solve
it's not, your making it harder than it is
Does the server, or does it not, need to generate all of the possible redirects?
define what you expect a "possible redirect" is?
/command | other subcommand | another one
the server is in full control of the command tree
nope
does not
because thats not how the system works at all
In a properly designed system, it would generate:
command
other
- subcommand
another - one
And the client would be able to assemble the rest of the completions from only that data
{name: "command", type: "literal", children: [ {name: "other", type: "literal", children: [ { name: "subcommand", type: "literal", children: [ { name: "arg1", type: "argument", completions: ["foo1, "foo2", "foo3" ] } ] } ] } ] }
thats an example
if you type /command other subcommand foo, foo1, foo2 and foo3 can be suggested w/o asking server
Yeah I get that
That's all fine and dandy
But how do redirections come into play here
then take [ {name: "foo", children: [ { name: "arg1", type: "argument", completions: ["foo1", "Foo2" ] } ] }, {name: "command", children: {name: "redirect", redirect: "foo" } } ]
When you type /foo redirect foo, that foo actually picks up the first nodes "foo1, Foo2" completions
that can all be done on client
when the parser sees the redirect, it jumps back to the map to find the node its referencing
oh i guess in this csase it might be /command redirect foo foo1, unless the redirect goes to the argument node instead
So if the server is just generating that JSON then this shouldn't be tricky at all
And it seems the parser already works so
it does, its simply a flaw in the intermediate copy is all
it has to intermediate copy to remove nodes you dont have perms for
Which intermediate copy
CommandDispatcher, the code pante is trying to fix
it builds an intermediate copy of filtered results
then passes it to the packet object
the packet object turns that into bits
Within that recursive thing couldn't you just check if the permission exists, and if it doesnt, just return null?
And then in the calling function, if you get null back, just ignore the whole thing and don't even complete the subcommand
this is maybe even easier to fix by simply storing the ORIGINAL node in the reference for redirect
and in the packet class, any time a redirect is found, do the map lookup to find cloned
Or, when you turn it into bits, you know the player at that point, so just omit the ones where perms aren't valid
And then you also avoid re-generating the tree for each player
You just prune it for each
In other words, compute the whole tree once, and then when you want to send it to a player, prune out the nodes they don't have perms for
In theory, this should be dumb simple
I have a question, how much of a difference would someone see from upgrading from an i5 2500 to a ryzen 5 1600af
would you say it would be a worthwhile upgrade
this is ONLY for a minecraft server btw
seems like a pretty major upgrade to me
comparing frequency doesn't work across architectures
doing this and then in the packet in the 2 lines that do map.get, make them
map.get(cloneMap.get(node.getRedirect()))
so it gets a ref to the clone after everythings done processing
i'm considering upgrading from my 2500 to that, thanks to kevin my server is much much more stable now however it does still lag when more people are on, a bigger reason tho is cause I have over 200gb of movies and stuff for a home media server on my pc and it's taking up too much space lmao
Or, when you turn it into bits, you know the player at that point, so just omit the ones where perms aren't validAnd then you also avoid re-generating the tree for each player
You just prune it for each
In other words, compute the whole tree once, and then when you want to send it to a player, prune out the nodes they don't have perms for
leave redirect pointing to the uncloned ref and let packet code deref it
if it was just for the minecraft server I wouldnt consider it nearly as worth it
the intermediate is whats doing the pruning kevin
unless I had way more ppl on
What I'm saying is what if you do the pruning when you're ready to send the list
which is what i said to a degree
except inverse impl
you dont want to do this logic in the serializer, that happens asynchronously
packets are designed to give it static data at construction
Why should any of this be handled on the main game tick anyways?
and then it rewrites it to bits at serialize time
because the state can change
world change etc
hmmm....
but as you can see in my screenshot we do have partial async processing here, but we mainly did that before we fixed the performance issues of brigadier
but its still heavy, so the async portion is like a few hundred milli now vs the multiple seconds it could be before
Not sure why the "generate the fully tree once, then prune for each player" strategy isn't worth considering
So you're stuck on making the pruning work then?
the pruning works, its purely a chicken and egg problem in cyclic references
This whole thing is overcomplicated and the design decisions don't make much sense to me
Why should there be cyclic references in the thing you're pruning
And why not just remove the entire cyclic reference
Any chance you could poke Mojang into fixing the issue? @timid valley 😛
If it cannot be reached anyways
sure I can, but its too late for 1.16
I’ll be happy if it makes it into whatever subsequent bug fix release they have next
they didnt even look at my current PR lol
Feelsbadman
though this isnt an issue with brigadier, its minecraft code
Yup, but it is affecting vanilla commands too if that’s any additional motivation
yep, so def worth filing a bug if one doesnt exists
do u guys think 1.16 servers will be more difficult to run than 1.15 servers
At this point I’m wondering if it’s worth the effort pring the fix if there’s going to be an eventual Mojang fix
theyve got a FEW optimizations in, but of course the new features will prob add more lag that undoes any gains
well, has to be a PR if you ever want it fixed on 1.15 or 1.16
true
well this could prob qualify for a point release
Well I don’t mind waiting a little if it means I don’t have to do anything lol, I’m lazy
Only thought about PRing it since i wanted to reduce the tech burden on my own lib
looking at this code, im actually not even sure why this crap even needs to clone the refs
They’re doing some weird stuff to the clone before sending it
now of course my own code depends on the clone 😛
Replacing the suggestionprovider with a ASK_SERVER implementation
otherwise cant do per player modifications
I mean the private void a(CommandNode<CommandListenerWrapper> commandnode, CommandNode<ICompletionProvider> commandnode1, CommandListenerWrapper commandlistenerwrapper, Map<CommandNode<CommandListenerWrapper>, CommandNode<ICompletionProvider>> map) { method
Yup they’re doing that to replace the SuggestionProvider
From my understanding anyways
but it doesnt NEED to be.
public static SuggestionProvider<ICompletionProvider> b(SuggestionProvider<ICompletionProvider> suggestionprovider) {
return suggestionprovider instanceof CompletionProviders.a ? suggestionprovider : CompletionProviders.a;
Could be done at packet level
only half?
well, i can say that the future is positive
things will improve some
they are making good and big changes internally to improve quality, hired new people
did the dumbass that use a stream to count all of the blocks in a chunk when it gets loaded get fired?
_>
I don't think so, but I think I yelled at them enough about streams that they agreed its an issue
LOL
now, how much they revert is the question
Welp, just gonna wait for them to fix it heh :p
is there any way to set the plugin version from code?
Im using a spigot 1.15.2 server and my server doesnt have the /server command can anyone help me fix this issue?
or is it not on 1.15.2 servers
Asking about your attempted solution rather than your actual problem
@lofty otter
?
i have a bungeecord server do you need to config it for it to work
your question is an xy problem
alright ill give you my problem
@cursive lily no, make sure youre connecting to bungeecord and not the spigot server
port :25577 by default
i want to only change one line when i update the version
in the build.gradle
which gets put into my common gradle module
instead of 3 different plugin.ymls
ok
in maven you would do this by making plugin.yml a filtered resource and putting version: ${project.version}
idk about gradle
so you can set yml properties from a maven xml?
yes. Im sure gradle can too but I dont know gradle so cant help you
the way im doing it in gradle is with blossom, it replaces string literals with what you give it
try googling for filtered resource gradle
looking into it, thanks
if youre doing it then whats the issue?
the code for it is in my common build.gradle, not in each platform build.gradle
and i dont really want to copy all the blossom code to each build.gradle
Is it possible to make sign that the player is not able to delete the text at specific line?
yeah so this aint workin, dont know what im doing wrong
root build.gradle:
subprojects {
...
processResources {
filter ReplaceTokens, tokens: [
"version": version
]
}
...
}
and ive tried the following three things in the plugin.yml:
- Not including the
versionproperty at all - Setting
version: "" - Setting
version: "version"
in case 1 the plugin doesnt load because of a missing version and 2 & 3 it leaves the version as whats in the plugin.yml
im not even sure whether the "version" key under ReplaceTokens refers to the property or the value
Hello!
I'd like to save an object of type Map<String, Inventory> when the plugin unload and load it when the plugin loads. I can look all I want, but I can't figure out how to do it at all. Could somebody help me? At least give me a direction of what to look for?
public Map<String, Inventory> loadInventories() {
Map<String, Inventory> inv = new HashMap<String, Inventory>();
return inv;
}
public void saveInventories(Map<String,Inventory> inv) {
}
I'd convert inventory contents to json and put it in a database
Right, but is it actually possible? Inventory is a gui and I'd need to keep it as a gui
I also read something about Serializable things but I still don't fully understand it, I'm quite new to Java 😅
Yeah so Inventory isn't by default a serializable object. The materials however inside the inventory are.
What I would recommend is Map<Integer, ItemStack> where Integer is the slot/position of the itemstack.
Oh okay
What did you want the String to be in your map? The name of your inventory?
It is an identifier for the inventory. Each team has an inventory and the string is the id of the team
Alright so your best bet is to create an encapsulation/wrapper class to store the id and map of items.
If you want to ignore sorted inventories then I would not worry about the map and just store it in a list.
Wait what's the problem with your first idea? Map<String,Map<Integer,ItemStack>>
I'm still not sure how to convert from one to another but that seems possible, isnt it?
That is never what I referred too.
Ow sorry
public class Data {
private int id;
private Map<Integer, ItemStack> inventory;
}
``` Something like this is what I referred too.
id would be a String in my case but yeah I could do that
Then you can serialize this data to a json object. (I recommend to look into GSON for this.)
Awesome 😄
You could also just create a class that implements ConfigurationSerializable
https://hub.spigotmc.org/javadocs/spigot/org/bukkit/configuration/serialization/ConfigurationSerializable.html
And serialize the inventory contents using that.
That way, you could use ConfigurationSection#get to get an instance of your custom inventory (wrapper)
im getting this error on plugin load: java.lang.IllegalArgumentException: No enum constant org.bukkit.Material.WOODEN_HOE
any ideas on how to fix?
plugin says it works from version 1.8 and im running 1.8.8 spigot
And I'm not a big fan of reinventing the wheel 🙂
reinventing the wheel is what makes you understand the whole concept tho
I suppose it depends on the specific "wheel" we're talking about. I'd say 90% of the time a custom implementation of something that already exists would be worse than the tried and tested existing "wheel".
If you're reinventing the wheel as a training exercise, then I'd say it's fine. But for production code, I'd try and avoid it.
Does anyone here use Intellij and github?
I made a repo in an organization, and when I tried to push my project to the repo it failed
?ask
If you have a question, please just ask it. Don't look for staff or topic experts. Don't ask to ask or ask if people are awake or available. Just ask the question to the channel straight out, and wait patiently for a reply.
*was rejcted
i'm pretty sure it tells you more than that
and if it doesn't a screenshot would help
Check git log
How
In the git window
Console tab
Git pull --allow-diverged-histories or smth
It was --allow-unrelated-histories, but thank you, it works now 🙂
how to convert my world from 1.14.4 to 1.15.2?
ok so im using servers.pro and someone who is kind enof give me your gmail to sand you a vid and tel me what did i did wrong
@jade ibex You use the --forceUpgrade flag - read more (e.g): https://www.spigotmc.org/threads/bukkit-craftbukkit-spigot-bungeecord-1-15-1.407454/
Hello! We have a little oddity. When we break any blocks that have variations (5: 1,5: 2,5: 3. 35:1, 35: 2 etc) in the inventory they are replaced by 1 value 5:6 =====> 5: 1. If you have a stack of red wool in your hands and you break any block, all wool will be replaced with white. Here is a list of plugins
Go through disabling every plugin and retry it every time
player.getLevel gets the current exp level right?
oop I mean the total level, like level 30 to enchant a max thing in the enchantment table
I think I worded what I said above wrong - if I wanted to check if someone had 30 levels for something to happen, .getLevel would be the right thing ye?
i have a server with offline mode, how can i show skins in tablist? i know it is possible because servers like strongcraft and extremecraft are cracked yet can.
whoever can help me out gets a cookie lol 🍪
one can hope
You won't
We don't support offline servers (unless it's BungeeCord but it has its own authentication)
Hi, when do youu expect 1.16 SPigot release? Could it be 23.6. after version release?
@ Renzo
Really, we don't know. Could be day of, could be a few days after. I can assure you that it's going to be at least June 23rd
Any way to remove the "you've been banned from this server" when you log in so it just displays the reason?
can i make a sideways beacon particle
@neat orbit use Fastlogin
How do I make it on ItemJoin that the item with the player head is the skin of the player that is holding it?
do you want to change player's skin to player's hold item when joins server?
do you want to change player's skin to player's hold item when joins server?
@fair abyss
Yes, like what Hypixel does for their "Profile" item.
Thanks, Govindas.
you're welcome
When's vanilla 1.16 going to be released?
I don't recall it being public yet
So Spigot 1.16 is going to be released at least then
;P
inbf asking 0.036ms after actual release "when spigot release"
inbf?
inb4, inbf, "in before"
Predicting an event will occur in the future before it happens
http://fastutil.di.unimi.it/docs/it/unimi/dsi/fastutil/objects/Object2ObjectMap.html
Why use a HashMap when you can use this Object2ObjectMap 🧐
Truly fabulous
You can't 🙂 It's an interface
Well the ArrayMap implementation
what does this mean ? The javadoc is not very clear for me
@sturdy oar it’s the walk speed for a player. The server can set a walk speed. Negative is backwards, and 0.2 is vanilla.
If you set walk speed to negative, when the player presses W they’ll go backwards
lol i had no idea that existed
does that value get increased when a speed potion is drank by the player?
oh ok, i thought i could use it for potions. I was wrong
I'll apply speed formula myself
No. Just give the player the speed effect
no i mean i am calculating player max velocity
speed will increase by 20% for each level
You can always lift the vanilla math for calculating speed
Although I don’t really understand what you’re trying to do
I am just calculating the player's maximum velocity based on their info.
For example if they have a speed II potion i get (0.20 * level * 4.32) + 4.32 for walk speed
If you set walk speed to negative, when the player presses W they’ll go backwards
I actually didn't even know that lol. I've never messed with walk speed
Where do these numbers come from?
4.32 what
Oh are you trying to make an anticheat or something?
If so there are better ways to write speed checks
Don’t check in movement rate per second, check in movement rate per tick.
That way you can check each flying packet
im doing an average on the last second
Calculate the delta, determine block friction, determine any ascension or desention, etc.
Ngl that’s a horrible way to write a speed check, can think of so many ways to false flag it
I would start by looking into friction and strafe checks
and see how they work
i already am aware, for example that if you jump from an high place you have an higher velocity at the moment you start walking on land
Movement speed prediction is quite tricky, there are many many edge cases.
At the moment im doing a FastWalk check
so i only check the movement on ground
Speed will give me some troubles later 😢
This is a proper friction check ^
This does get bypassed by some clients that do obey friction. Predicting velocity is the next step for catching them. Idk if he has a velocity prediction check tho
Hello. I have a bungeecord server, but does anyone know a plugin that instantly allows a global chat between servers. So I don't have to do for example: /global Hey there!. To do global chatting, I just want it to be automatically a global chat
if you're doing a movement check, keep in mind that speed modifiers exist, like potion effects or attributes
there is so much stuff nowdays involving movement it's insane :d
One of my speed checks is literally more than 400 lines long
It's crazy the amount of edge cases you have to account for
attributes have been in the game for about 7 years
i don't think Player#getWalkSpeed is even accounted for in some anti cheats
It should be in most
well i had a user who had a problem regarding it
Any anticheat that doesn't pull the base walk value from there is just dumb
or maybe didn't accounted for 0 i dunno
a good anticheat should account for all potential modifiers
well yeah
but then you remember they support 1.8.8
so no version would be the best in term of quality
Attributes have been in MC since 1.6.1
wait you're right
i guess they weren't exposed in 1.8.8 nvm
yeah you're definetly right
But they existed in 1.8 and were exposed with the bukkit api
Not sure what your point is
i had to use them for some entity stuff
I think walkspeed existed for even longer
there is no point anymore
First line of my speed check literally grabs the value out of getWalkSpeed()
double moveSpeed = player.getWalkSpeed() * player.getWalkSpeed() * 25;
why 25 tho?
It's a micro optimization
I need to multiply the walk speed by 5 and square it
With a vanilla walk speed of 0.2, the result is a moveSpeed value of 1.
hm, looks like the Attribute API only got added in 2016
well walkspeed was in the api but not the attribute api
well i ain't doing 1.8 stuff
making proper checks is already a nightmare
supporting multiple versions would kill me
the movement speed API is from 2012, so not supporting that is kinda unforgiveable
What he's saying is, not supporting changing the walk speed is unforgiveable, even for a 1.8 anticheat
when did you start making plugins?
it's when I started studying Java
Hey
does anyone know how i can make an scoreboard?
I want it to be imported from my config.yml
guys when I run something with a runTask, does it happen in the same tick?
it would run next tick isent it
is it possible to prevent players from connecting to bungeecord when the main spigot server is offline?
It would just kick them if the fallback server is not online
@heady geode No, it'll be run on the next tick
I see, tnx
does anyone know how i can make an scoreboard?
@sullen harness .