#help-archived

1 messages · Page 132 of 1

gleaming helm
#

If you want an answer, you're going to need to explain your problem

frigid ember
#

can I add a screen here

gleaming helm
frigid ember
#

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

mystic chasm
#

oh also here's my crash report if anyone knows how to read them:)

frigid ember
#

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

mystic chasm
#

have u tried /help skript

frigid ember
#

noo yes

undone narwhal
#

Whattttttttt

frigid ember
#

of course wooh I really wouldn't have tried that

undone narwhal
#

Can you please make a list like the following vvvv

What you want:
The step you did:
What is wrong:

frigid ember
#

https://imgur.com/a/BOSqdQJ

[
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

#

https://imgur.com/a/BOSqdQJ

[
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

undone narwhal
#

THIS

#

is

#

just

#

horrible

gleaming helm
#

I swear to fucking god

#

This does not help us help you

subtle wedge
#

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?

frigid ember
#

Doesn't skript have it's own discord?

undone narwhal
#

Make a plugin "from Scratch" is actually easy cause the plugin only generate a main class and a pom.xml file

frigid ember
#

i think it noth

undone narwhal
#

Will take you about 2min

#

@frigid ember You need to ask the dev on the plugin page

frigid ember
#

i try than scratch

#

but is that a good program

wheat summit
#

Is there a way to increase mobs sizes?

subtle wedge
#

Do I need to have a hierarchy like main - java, then my package ?

undone narwhal
#

@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

frigid ember
#

have you al link maybe

#

for scratch

twilit orchid
#

is there a way to disable certain world edit permissions like superpickaxe ?

undone narwhal
#

@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 !

subtle wedge
#

Should I be using Maven for plugins?

undone narwhal
#

@wheat summit mobs size ? Like Giant Zombies and big Slimes ?

wheat summit
#

Well not specifically Giant Zombies and Slimes

#

Anything mainly

odd knoll
#

I use Maven/Gradle for plugins as it just helps me to manage dependencies.

wheat summit
#

Like Pigs or Zombies

undone narwhal
#

@twilit orchid Yes, just check the worldedit page for permissions

wheat summit
#

Wondering if I can scale up my Pig boss and make it 3 or 5x bbigger than a normal one

twilit orchid
#

@undone narwhal but how do i disable it tho

undone narwhal
#

@wheat summit impossible unfortunately

wheat summit
#

Aw ok

#

Thanks anyways

undone narwhal
#

@twilit orchid Use a perm plugin like LukePerms

wheat summit
#

Wait

#

If I extended a Slime or Giant class then and made the ID of a pig?

undone narwhal
#

@subtle wedge I strongly recommend using Maven or Gradle

wheat summit
#

Could that work>

undone narwhal
#

Nop

subtle wedge
#

Alright thanks

undone narwhal
#

Minecraft Client won't understand

wheat summit
#

Oh ok

#

Thanks though

undone narwhal
#

You have to edit the client too if you want to edit the size

#

np

wheat summit
#

Well one more question, is there a way to make a nonhostile mob hostile?

#

I know I can set it's pathfinder goals

undone narwhal
#

You have to change its AI and goals

subtle wedge
#

How do I setup using Maven though?

wheat summit
#

Ok

undone narwhal
#

I never did that before but there are a lot of tuts online @wheat summit

wheat summit
#

Ok thanks

undone narwhal
#

(double check the version)

#

@subtle wedge After creating a maven project, just edit your pom.xml and add your dependencies

subtle wedge
#

Alright

mystic chasm
#

ayo rolyn

#

have you ever used the discordsrv plugin

subtle wedge
#

I have

undone narwhal
#

Is it a spigot plugin ?

#

Never used it

#

Yes 4r8 ?

subtle blade
mystic chasm
#

yeah it's a spigot plugin

#

whenever i use it my server crashes when i load terrain

undone narwhal
#

Any errors ?

subtle wedge
sturdy oar
#

1.8.8 API

#

🤮

#

tbh

subtle wedge
#

Factions Server ;p

bold anchor
#

Looks fine, will still recommend updating for a lot of performance fixes and exploit fixes tho.

wheat summit
#

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?

neat pulsar
#

@undone narwhal I've updated my proxy to Velocity, but the feature I'm missing is an antibot. Do you know a good one?

frigid ember
bold anchor
#

So, what build system u using?

frigid ember
#

Eclipse?

lean fiber
#

could someone help me via DM with a problem I am having with tags?

#

Thanks

undone narwhal
#

@neat pulsar Never used an anti bot. What's it exactly ?

#

@lean fiber Why in DM?

lean fiber
#

Well, it is for not bothering you

#

Well, I explain it

neat pulsar
#

Antibot is basily protects you from mcspam.to or other bot spawmming websites

lean fiber
#

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.

undone narwhal
#

Well, I actually recommend you directly asking the developer of Bssentials cause I don't know this plugin sorry

lean fiber
#

Oh, ok, I will

undone narwhal
#

@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

frigid ember
#

Is here any experienced developer? I have one question, i mean its not code problem its more like a tip 😂

undone narwhal
#

I guess I'm an "experienced developer" ^^

#

Listening to you, some others may join to help you too

peak reef
#

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.

subtle blade
#

😄 Happy to help

#

That bug should hopefully be fixed by tonight

fleet crane
#

its already fixed

wheat summit
#

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

subtle blade
#

There ya go! 😄

fleet crane
#

you'd think people would at least test their PR 😐

subtle blade
#

In that case, will remove the pin

fleet crane
#

I mean at least it compiled

subtle blade
#

It did! Though it errors on client join lol

#

Not sure how he could have missed it had it been tested

undone narwhal
#

@wheat summit I haven't understand sorry

wheat summit
#

?

gleaming helm
#

When you lower the health it shows the hit animation afaik

wheat summit
#

Doesn't apply knockback it looks like

gleaming helm
#

Yeah you have to send knockback yourself

wheat summit
#

Oh ok

#

Sound as well?

gleaming helm
#

Calculate the proper vector and apply it

undone narwhal
#

Isn't there a #damage method ?

gleaming helm
#

I don't know about sound

wheat summit
#

I would think there is Rolyn

gleaming helm
#

There might be @undone narwhal I haven't done too much in that area before

wheat summit
#

Well I haven't looked

undone narwhal
#

@wheat summit I think this method will apply the sound + animation + a small knockback which is not "direction based"

wheat summit
#

Setting health will?

undone narwhal
#

Yes

#

Entity#damage(healthToRemove)

wheat summit
#

It doesn't when I use it...

#

Oh

undone narwhal
#

strange

wheat summit
#

Ok I see now thanks!

#

Though you meant setting health not the damage method

undone narwhal
#

Ohw

#

Okay

wheat summit
#

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

subtle blade
#

The fact that you have to clarify that should be enough reason for you to change your variable names lol

wheat summit
#

Thanks a lot! I am stupid sometimes and can not see methods

#

Well it is in a pathfinder class

subtle blade
#

You should avoid single-character var names (with the exception of loops)

wheat summit
#

And they use this.d and this.e which I also feel like is stupid

subtle blade
#

Ah it's NMS. Disregard

wheat summit
#

Yep

#

It's fine

subtle blade
#

They're named that was because they're obfuscated as such. Figured this was just code you had written

wheat summit
#

Ohh ok

#

Is there a way to make them what they were actually called or not/

#

It does annoy me a lot

subtle blade
#

Mojang has mappings but aside from that, no

#

You can use the mappings as reference but you can't apply them

wheat summit
#

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

feral bane
#

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.

wheat summit
#

Only when I don't hit it then it attacks

feral bane
#

seems to be the same issue with OP

wheat summit
#

When I hit it it stops attacking and runns around me

feral bane
#

only works when i deop myself

wheat summit
#

Anything in console?

#

So is the server just crashing?

#

Has it been started before?

feral bane
#

server crashes

wheat summit
#

Ok, there should be stuff in a crash log then

#

Or stuff in console

rich salmon
#

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

feral bane
#

this is the same issue @peak reef was habing

#

having

wheat summit
#

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

feral bane
wheat summit
#

Are you sure you don't have any plugins?

#

Or command blocks?

feral bane
#

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

wheat summit
#

Ok

#

Seems like the plugin or command blocks are looping upon eachother

#

I'm not really sure though

feral bane
#

what issue did @peak reef have?

wheat summit
#

Not sure

peak reef
#

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. 😉

fleet crane
#

update again @feral bane there was a broken build last night

pastel condor
#

for some reason, players on my server keep getting kicked due to the keep alive timeout

#

and it's happening over and over again

subtle blade
#

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)

peak reef
#

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!

subtle blade
#

That's fair! Was my favourite command when I was younger too ;P

sturdy oar
#

I'll force my children to use my plugins in the future 😈

gleaming helm
#

kittycannon LOL

sturdy oar
#

It just yeets cats

silk bane
#

my favourite command was /kill

sturdy oar
#

Sure

#

Mine is

#

/suicide

limber summit
#

Is there to increase durability of all stuff?

spiral siren
#

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]

subtle blade
#

Update

#

Was fixed just an hour ago

spiral siren
#

oh

#

thank you

#

its a spigot error

subtle blade
#

Yes

#

untested PR snuck through

rotund orbit
#

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?

subtle blade
#

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

rotund orbit
#

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

subtle blade
#

You have to store that in the item's NBT when it's broken, yea

#

Then account for that when placing it as well

rotund orbit
#

I better look into this NBT business more

subtle blade
#

Bukkit has a nice "NBT API" for custom NBT with items, blocks and entities (soon chunks?). PersistentDataHolders

#

1.14+, but modern versions = modern API

sturdy oar
#

PersistentDataContainer

subtle blade
#

Yes, but those that can access containers are holders

gleaming helm
#

PersistentDataContainer is only newer version tho

subtle blade
#

1.14+, but modern versions = modern API

gleaming helm
#

Oh I didn't see you say that

rotund orbit
#

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?

subtle blade
#

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)

rotund orbit
#

interesting, thank you for the example

#

Would the data stay saved upon place and pickup?

subtle blade
#

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

rotund orbit
#

I love wrappers

#

I'll likely do that. I'll definitely keep the PersistantStorageContainer in mind however

subtle blade
#

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 😄

rotund orbit
#

haha yup

#

did that for chunks for claimed chunks

subtle blade
#

Perfect!

rotund orbit
#

I appreciate your help

subtle blade
#

Pleasure

bitter tendon
#

How to make a custom item? Like the worldedit wand so you can detect left click or whatever you want to do with it

feral bane
#

@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 . .

frigid ember
#

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]
wraith thicket
#

You're creating an infinite recursion loop

frigid ember
#

and it repeats it 7000 times]

#

idkh

pastel condor
#

lol

frigid ember
#

i have not installed any plugins or anything

pastel condor
#

I think there was an issue with one of the builds of spigot, maybe try updating?

frigid ember
#

ok

#

i am using the latest 1.15.2 build

wraith thicket
#

I thought that was an NPE not a SOE?

pastel condor
#

StackOverflowError: null

frigid ember
#

it only does that whenever i join the server

wanton delta
#

wasnt there something about a broken build or smt

frigid ember
#

i am using the latest build but idk

wraith thicket
#

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)

frigid ember
#

i did --rev latest

wraith thicket
#

(I assume 2695 was the issue since the pin choco had to build 2694 instead is gone)

wanton delta
#

whens the last time you used buildtools

frigid ember
#

today

wanton delta
#

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

frigid ember
#

ok

wraith thicket
#

Yes, it looks like the 2696 should have fixed the 2695 issue

wanton delta
#

not sure when 2696 was released

wraith thicket
#

5h ago

wanton delta
#

yea

#

that would explain it i guess

subtle blade
#

Yeah it was only just fixed a few hours ago

#

Run again and it's fixed

wanton delta
#

what was the pr that broke it 👀 im curious

subtle blade
#

change to how command nodes are sorted

#

*redirected, rather

frigid ember
wraith thicket
#

A problem with the DeluxeAnnounce plugin - let the devleoper know.

velvet halo
#

Does anyone have a good example for doing message configuration?

velvet halo
#

nvm I did it with reflection.

gusty swallow
#

My bad for the broken PR 😓 didn’t realise I had a plug-in that was messing with the CommandDispatcher when I tested it

frigid ember
#

its always brigadier huh...

gleaming helm
#

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

frigid ember
#

at least for some commands you just send a node graph to the client without additional autocompletions...

#

kind of like it that way

gleaming helm
#

I like having a ton of control by just sending a new list after every character

#

Also saves database lookups

gusty swallow
#

What happened was certain commands being redirected in a circle and causing a stack overflow

gleaming helm
#

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

frigid ember
#

can’t tell if you’re sarcastic knowing you...

gleaming helm
#

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

frigid ember
#

@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

gusty swallow
#

Well, suggestions are still broken for redirected commands

gleaming helm
#

the suggestion logic just needs a complete rework

#

Well... really the redirection logic

gusty swallow
#

Although I don’t see an easy way to fix it now that I know there’s cyclic redirections going on

gleaming helm
#

Just make cyclic redirections impossible by detecting that your graph is not, in fact, a tree.

gusty swallow
#

Well, Mojang themselves are the ones doing it with vanilla commands

gleaming helm
#

Which vanilla thing is cyclic?

gusty swallow
#

‘/execute align | axes’

#

If you enter it, you would notice suggestions just stop after the first subcommand

gleaming helm
#

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

frigid ember
#

they broke the suggests as well??

gleaming helm
#

Sounds straightforward to me

gusty swallow
#

It was already broken to begin with, I just tried (and failed) to fix that

frigid ember
#

ah

gleaming helm
#

You don't even need recursion for this though, that's the dumb thing

#

Just use a stack and a set for checking repeats

gusty swallow
#

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

frigid ember
#

What was broken with vanilla redirections?

gusty swallow
#

If they’re okay with it then sure

gleaming helm
#

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

gusty swallow
#

There are, but recursion’s the least invasive/requires the least changes

gleaming helm
#

What's wrong with just using a stack

#

And then using a set to check for duplicates

gusty swallow
#

Might use a stack as suggested

#

Yeah

#

Makes sense too

gleaming helm
#

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

gusty swallow
#

True true

gleaming helm
#

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

gusty swallow
#

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.

gleaming helm
#

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)

gusty swallow
#

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)

gleaming helm
#

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.

gusty swallow
#

The thing is it has cycles that needs to be dealt with

gleaming helm
#

I’m doing the recursion this way, you effectively delete the cycles

#

By refusing to walk edges that create cycles.

gusty swallow
#

So aborting if it detects cyclic directions?

gleaming helm
#

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.

gusty swallow
#

I know I know, but would we just be effectively ignoring suggestions for cyclic directions then?

gleaming helm
#

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?

gusty swallow
#

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.

gleaming helm
#

How would you support suggestions for cycles without creating recursion?

gusty swallow
#

It works because a copy is created, and added before we look at the redirection

gleaming helm
#

That is an impossible task unless, at SOME number of layers, you stop making new suggestions.

#

That sounds like a really bad idea

gusty swallow
#

So it would find the redirected command in the look-up map and set the destination accordingly

gleaming helm
#

So here’s the trick

timid valley
#

@gleaming helm you can thank me for not having to pregen it

gleaming helm
#

🙂

timid valley
#

1.13 was going to remove server side completions, I spammed them hard to keep it

opal bay
#

👀

#

thank you

gleaming helm
#

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

timid valley
#

thankfully,i think mojang ran into needing it themselves for vanilla so it mandated it, but dinnerbone originally said 'maybe later'

gleaming helm
#

Please for the love of god no, I need my dynamic tab complete 😦

frigid ember
#

oh god

gusty swallow
#

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

gleaming helm
#

Add some other identifier like the class name or something like that

#

Anything that identifies you uniquely

timid valley
#

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

gleaming helm
#

That’s exactly what I’m discussing how to do

timid valley
#

create a hashset, add it to method signature

gleaming helm
#

(That’s exactly what I suggested)

timid valley
#

so do that 😛

gusty swallow
#

Mojang’s original code creates a clone of each command for serialisation

timid valley
#

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

gleaming helm
#

Just point to literally any unique identifier for that node

#

LITERALLY any ID

timid valley
#

there are no ID's here, need to use object identity

gleaming helm
#

So point to the class

#

Problem solved

timid valley
#

well i guess the path+type is sorta a key

#

/foo bar <baz>

foo literal
bar literal
baz argument

gleaming helm
#

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

timid valley
#

theres only 3 clases lol

#

well 2 really

gusty swallow
#

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.

gleaming helm
#

I don’t understand why this is so convoluted, is there literally no way to identify a node?

timid valley
#

yes, and that clones redirection should be pointing to something that already exists

#

so im saying just set it to the reference

gusty swallow
#

Wdym by “reference”?

timid valley
#

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

frigid ember
#

i need to study brigadier thoroughly

#

clearly my understanding is weak

timid valley
#

.forward receives a ref to anotehr CommandNode

#

so what part blew up recursively? was it the json serialization?

gusty swallow
#

Lemme just write some example code, maybe it will help

timid valley
gusty swallow
#
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

timid valley
#

yes which is why its not actually done in the ctor 🙂

gusty swallow
#

Just an example

gleaming helm
#

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

gusty swallow
#

That could work

timid valley
#

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?

gleaming helm
#

So you never select more than 20 down

#

For example

gusty swallow
#

In the original code, if B was cloned after A, it will just return null, yes

timid valley
#

and is that what is happening?

gusty swallow
#

In the original yes, it breaks suggestions for recursive commands

#

try /execute align|axis

timid valley
#

i think your solution is far off from how to fix that

gusty swallow
#

Notice that suggestions exist to exist after the first subcommand

#

whoops

#

cease to exist*

frigid ember
#

when was the last time a commit was made to the brigadier repo?

timid valley
#

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

gusty swallow
#

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

gleaming helm
#

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

timid valley
#

dont worry about depth, its an abstract framework

gleaming helm
#

But obviously we worry about infinite depth

timid valley
#

with my option 2 recursion isnt even an issue on force initializing

gusty swallow
#

well, you're welcome to have a go at it 😛

timid valley
#

yes itll go on priority 3231233123 on my list of things to work on

gusty swallow
#

Feelsbadman

#

option 3 which I used in my lib was to modify the destination field in A once B has been cloned. 🤔

timid valley
#

thats what my option 2 is....

gusty swallow
#

Oh oof

#

Idk, working with Brigadier is gonna break my sanity one day

woeful gorge
#

Anyone knows how to fix this crash error 'Exception in server tick loop'?

gleaming helm
#

Well what you could also do is add a blocker, but make it only activate on some depth of cycles in the graph

timid valley
#

well, to be fair, the issue here isnt brigadier, it's mc's binding to brig

gleaming helm
#

So like you’re allowed to cycle 3 times for example before it cuts you off

gusty swallow
#

Curious but how would you implement option 2 without reflection? @timid valley

#

I mean reflection

#

fml

timid valley
#

as a new spigot pr done correctly 😛

gusty swallow
#

;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

timid valley
#

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

gusty swallow
#

^

#

They don't return the same instances

#

SO yeahhh

timid valley
#

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

gusty swallow
#

Personally I would just use reflection to set the destination. It seems a lot less complicated imo

timid valley
#

actually heh slightly harder to force process because you dont know the parent

#

so storing a pending ref is prob only option here

gleaming helm
#

So much unnecessary recursion tho

timid valley
#

wont be any recursion

#

outside of mojangs current code

gleaming helm
#

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

gusty swallow
#

Recursion is much neater than manually using a stack in this case imo

gleaming helm
#

Yeah except which one is more maintainable

#

As demonstrated by the length of this conversation

gusty swallow
#

Personally I lean towards recursion being more maintainble, since the stack isn't explicitly managed by you

#

I meannn

gleaming helm
#

😐

gusty swallow
#

Can't argue with that

#

😛

gleaming helm
#

I prefer not to change the method signature when I want to modify the behavior of my loops

#

(Where possible and reasonable)

gusty swallow
#

🤷 well it's really down to personal pref I guess, for tree traversal and stuff I would go with recursion any day

gleaming helm
#

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

gusty swallow
#

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

timid valley
#

sec

#

im mocking up an idea

#

or more so doing it but you can run with it

gusty swallow
#

Hm?

timid valley
#

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

sage summit
#

I'm trying to use getConfig() in my events class but it won't let me get it, how do I fix this?

naive jungle
#

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
frigid ember
#

doesn’t no order scramble literals and arguments?

sage summit
#

now it says

Non-static method 'getConfig()' cannot be referenced from a static context

its a onPlayerJoin event btw

naive jungle
#

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...

timid valley
#

@frigid ember nothing depends on order

#

the execution code does not even look at .getChildren()

#

it inspects literals and arguments as separate lists

steady cedar
#

I have no idea how brigadier works

timid valley
#

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

steady cedar
#

Uhm

#

I do that with my current command library I think

#

Yeah I probably do that

timid valley
#

I question if you actualyl do it if you have to say "probably"

steady cedar
#

yeah I have a language barrier problem

#

lol

timid valley
#

a tree is pretty defined on how it works lol

gleaming helm
#

No @steady cedar your command lib doesn't support infinite recursive loops of commands

#

A tree doesn't contain cycles

steady cedar
#

but why would

#

it do that

#

lol

gleaming helm
#

You'd think mojang has 2 brain cells

timid valley
#

nothing wrong with what mojang designed

#

just a flaw in the dispatcher file

#

order has to be guaranteed with cyclic deps like that

gleaming helm
#

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

timid valley
#

if A depends on B, B needs to be init before A, and that's not happening is what the bug is

gleaming helm
#

Sounds a bit like an impossible task

timid valley
#

i dont think you understand whats going on lol

steady cedar
#

This seems a bit over-complicated

#

lol

timid valley
#

1 command can jump into another command

gleaming helm
#

Can you just initialize them all and THEN build the completion?

timid valley
#

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

steady cedar
#

yeah so that's what I do

#

yeyeye

#

I can understand now

timid valley
#

ideally this issue could of been solved is if redirects stored identifiers and not references to objects

#

would simplify the json too

steady cedar
#

This is massively over-engineered if that's the idea

#

lol

gleaming helm
#

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

timid valley
#

oh right it doesnt use json for this

gleaming helm
#

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.

timid valley
#

it assigns each node an incrementing ID

#

then the redirect simply writes an int on what ID it points to

gleaming helm
#

oh so they're using BFS

timid valley
#

BFS?

gleaming helm
#

Wait so they're already using BFS where's the recursion

timid valley
#

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

gleaming helm
#

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

timid valley
#

wat

gleaming helm
#

Just start a brand new like...

timid valley
#

no your thinking all wrong

#

this has nothing to do with input from client

gleaming helm
#

So you're telling me that

timid valley
#

this is computing static data about the command tree that is sent on login/world change

gleaming helm
#

All possible combinations of redirecting from what to what else and everything

#

ALL of that shit

#

Has to be precomputed

timid valley
#

yes

gleaming helm
#

That is the most retarded thing I've ever heard

timid valley
#

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

gleaming helm
#

But my point is, generating all possible combinations of redirects is an impossible task

steady cedar
#

Nah, it isn't.

gleaming helm
#

It cannot be feasably done

timid valley
#

it's not lol

steady cedar
#

Technically speaking you can, it's just

timid valley
#

its statically analyzable

steady cedar
#

in my opinion a waste of time

#

¯_(ツ)_/¯

timid valley
#

the code clearly works for execution already

gleaming helm
#

Assuming a large number of possible redirects and an infinite redirect length you run out of memory LONG before you're finished

timid valley
#

its an issue with order for completions

#

nope

steady cedar
#

infinite redirect length makes you run out of memory lol

timid valley
#

its not that complicated

gleaming helm
#

What you need is for the client to understand how redirects work

timid valley
#

it doesn't have to infinitely recurse

gleaming helm
#

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

timid valley
#

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

gleaming helm
#

The bug is in the design

timid valley
#

no its not

#

the recursion explosion today wasnt mojangs fault, that was pante's

gleaming helm
#

The bug in the design is the server has this impossible task of generating every single possible redirect

steady cedar
#

It's not impossible just

#

I find it really dumb

timid valley
#

you clearly dont understand the ssytem

gleaming helm
#

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

timid valley
#

it's not, your making it harder than it is

gleaming helm
#

Does the server, or does it not, need to generate all of the possible redirects?

timid valley
#

define what you expect a "possible redirect" is?

gleaming helm
#

/command | other subcommand | another one

timid valley
#

the server is in full control of the command tree

#

nope

#

does not

#

because thats not how the system works at all

gleaming helm
#

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

timid valley
#

{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

gleaming helm
#

Yeah I get that

#

That's all fine and dandy

#

But how do redirections come into play here

timid valley
#

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

gleaming helm
#

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

timid valley
#

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

gleaming helm
#

Which intermediate copy

timid valley
#

CommandDispatcher, the code pante is trying to fix

gleaming helm
#

ohh ok I see

#

Well...

timid valley
#

it builds an intermediate copy of filtered results

#

then passes it to the packet object

#

the packet object turns that into bits

gleaming helm
#

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

timid valley
#

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

gleaming helm
#

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

quaint sinew
#

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

gleaming helm
#

Your base frequency is actually a downgrade

#

As is turbo

fleet crane
#

seems like a pretty major upgrade to me

#

comparing frequency doesn't work across architectures

gleaming helm
#

ehh I suppose you're right

#

Yeah it's an upgrade

#

idk how "worth it" it is

timid valley
#

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

quaint sinew
#

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

gleaming helm
#

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

timid valley
#

leave redirect pointing to the uncloned ref and let packet code deref it

quaint sinew
#

if it was just for the minecraft server I wouldnt consider it nearly as worth it

timid valley
#

the intermediate is whats doing the pruning kevin

quaint sinew
#

unless I had way more ppl on

gleaming helm
#

What I'm saying is what if you do the pruning when you're ready to send the list

timid valley
#

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

gleaming helm
#

Why should any of this be handled on the main game tick anyways?

timid valley
#

and then it rewrites it to bits at serialize time

#

because the state can change

#

world change etc

gleaming helm
#

hmmm....

timid valley
#

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

gleaming helm
#

Not sure why the "generate the fully tree once, then prune for each player" strategy isn't worth considering

timid valley
#

it does....

#

thats literally what this code does

gleaming helm
#

So you're stuck on making the pruning work then?

timid valley
#

the pruning works, its purely a chicken and egg problem in cyclic references

gleaming helm
#

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

timid valley
#

because there is

#

thats not the issue

gleaming helm
#

And why not just remove the entire cyclic reference

gusty swallow
#

Any chance you could poke Mojang into fixing the issue? @timid valley 😛

gleaming helm
#

If it cannot be reached anyways

timid valley
#

sure I can, but its too late for 1.16

gusty swallow
#

I’ll be happy if it makes it into whatever subsequent bug fix release they have next

timid valley
#

they didnt even look at my current PR lol

gusty swallow
#

Feelsbadman

timid valley
#

though this isnt an issue with brigadier, its minecraft code

gusty swallow
#

Yup, but it is affecting vanilla commands too if that’s any additional motivation

timid valley
#

yep, so def worth filing a bug if one doesnt exists

quaint sinew
#

do u guys think 1.16 servers will be more difficult to run than 1.15 servers

timid valley
#

not really

#

nothing too concerning with 1.16

gusty swallow
#

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

timid valley
#

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

quaint sinew
#

true

timid valley
#

well this could prob qualify for a point release

gusty swallow
#

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

timid valley
#

looking at this code, im actually not even sure why this crap even needs to clone the refs

gusty swallow
#

They’re doing some weird stuff to the clone before sending it

timid valley
#

now of course my own code depends on the clone 😛

gusty swallow
#

Replacing the suggestionprovider with a ASK_SERVER implementation

timid valley
#

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

gusty swallow
#

Yup they’re doing that to replace the SuggestionProvider

#

From my understanding anyways

timid valley
#

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

gusty swallow
#

True that

#

Then again it’s Mojang lol, half the stuff they do is questionable

gleaming helm
#

only half?

timid valley
#

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

gleaming helm
#

did the dumbass that use a stream to count all of the blocks in a chunk when it gets loaded get fired?

timid valley
#

_>

#

I don't think so, but I think I yelled at them enough about streams that they agreed its an issue

gleaming helm
#

LOL

timid valley
#

now, how much they revert is the question

gusty swallow
#

Welp, just gonna wait for them to fix it heh :p

lofty otter
#

is there any way to set the plugin version from code?

cursive lily
#

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

fleet crane
#

/server is a bungeecord command

#

you need bungeecord in addition to spigot

#

?xy

worldly heathBOT
fleet crane
#

@lofty otter

lofty otter
#

?

cursive lily
#

i have a bungeecord server do you need to config it for it to work

fleet crane
#

your question is an xy problem

lofty otter
#

alright ill give you my problem

fleet crane
#

@cursive lily no, make sure youre connecting to bungeecord and not the spigot server

#

port :25577 by default

lofty otter
#

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

cursive lily
#

ok

fleet crane
#

in maven you would do this by making plugin.yml a filtered resource and putting version: ${project.version}

#

idk about gradle

lofty otter
#

so you can set yml properties from a maven xml?

fleet crane
#

yes. Im sure gradle can too but I dont know gradle so cant help you

lofty otter
#

the way im doing it in gradle is with blossom, it replaces string literals with what you give it

fleet crane
#

try googling for filtered resource gradle

lofty otter
#

looking into it, thanks

fleet crane
#

if youre doing it then whats the issue?

lofty otter
#

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

heady jolt
#

Is it possible to make sign that the player is not able to delete the text at specific line?

lofty otter
#

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:

  1. Not including the version property at all
  2. Setting version: ""
  3. 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

frigid ember
#

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 😅

velvet halo
#

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.

frigid ember
#

Oh okay

velvet halo
#

What did you want the String to be in your map? The name of your inventory?

frigid ember
#

It is an identifier for the inventory. Each team has an inventory and the string is the id of the team

velvet halo
#

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.

frigid ember
#

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?

velvet halo
#

That is never what I referred too.

frigid ember
#

Ow sorry

velvet halo
#
public class Data {
  private int id;
  private Map<Integer, ItemStack> inventory;
}
``` Something like this is what I referred too.
frigid ember
#

id would be a String in my case but yeah I could do that

velvet halo
#

Then you can serialize this data to a json object. (I recommend to look into GSON for this.)

frigid ember
#

Okay!

#

Seems good

velvet halo
#

Awesome 😄

wraith thicket
steady cedar
#

Not a big fan of that system, personally

#

but it works

tawdry raven
#

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

fleet crane
#

Obviously it doesn't work

#

Contact the author or update your server

wraith thicket
#

And I'm not a big fan of reinventing the wheel 🙂

tiny dagger
#

reinventing the wheel is what makes you understand the whole concept tho

wraith thicket
#

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.

remote socket
#

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

wraith thicket
#

?ask

worldly heathBOT
#

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.

remote socket
#

*was rejcted

tiny dagger
#

i'm pretty sure it tells you more than that

#

and if it doesn't a screenshot would help

remote socket
#

That's it

hoary parcel
#

Check git log

remote socket
#

How

hoary parcel
#

In the git window

remote socket
hoary parcel
#

Console tab

remote socket
#

Theres a .md file in the repo

#

How do I sync it

hoary parcel
#

Pull

#

Git pull --allow-diverged-histories or smth

remote socket
#

Git pull --allow-diverged-histories or smth
It was --allow-unrelated-histories, but thank you, it works now 🙂

jade ibex
#

how to convert my world from 1.14.4 to 1.15.2?

mental marten
#

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

hoary parcel
#

Yeah I always forget

#

I remember when I see the error message ^^

wraith thicket
west pulsar
#

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

cosmic lion
#

Go through disabling every plugin and retry it every time

barren yarrow
#

player.getLevel gets the current exp level right?

tiny dagger
#

nope

#

the getlevel is the number

#

getexp is the percentage bar

barren yarrow
#

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?

neat orbit
#

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 🍪

vapid kindle
#

set your server to online-mode

#

not sure you'll get support for a cracked server 😉

neat orbit
#

one can hope

subtle blade
#

You won't

#

We don't support offline servers (unless it's BungeeCord but it has its own authentication)

fervent cipher
#

Hi, when do youu expect 1.16 SPigot release? Could it be 23.6. after version release?

subtle blade
#

@ 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

wanton delta
#

'Release Candidate 1'

#

ok mojang

#

funny guy

snow crane
#

Any way to remove the "you've been banned from this server" when you log in so it just displays the reason?

hollow thorn
#

can i make a sideways beacon particle

frigid ember
#

@neat orbit use Fastlogin

gray plume
#

How do I make it on ItemJoin that the item with the player head is the skin of the player that is holding it?

fair abyss
#

do you want to change player's skin to player's hold item when joins server?

gray plume
#

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.

neat orbit
#

Thanks, Govindas.

frigid ember
#

you're welcome

subtle blade
#

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

bronze marten
#

inbf asking 0.036ms after actual release "when spigot release"

fossil shoal
#

inbf?

subtle blade
#

inb4, inbf, "in before"

#

Predicting an event will occur in the future before it happens

frigid ember
#

Truly fabulous

subtle blade
#

You can't 🙂 It's an interface

frigid ember
#

Well the ArrayMap implementation

subtle blade
#

Has a bunch of implementations like ObjectToIntMap though

#

Prevents object unboxing

frigid ember
#

Yeah those make sense

#

specifically this one is not exactly useful

sturdy oar
gleaming helm
#

@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.

sturdy oar
#

how can a player speed be negative

#

oh ok

gleaming helm
#

If you set walk speed to negative, when the player presses W they’ll go backwards

sturdy oar
#

lol i had no idea that existed

#

does that value get increased when a speed potion is drank by the player?

gleaming helm
#

The essentials /speed command modifies that.

#

No potions are completely different

sturdy oar
#

oh ok, i thought i could use it for potions. I was wrong

#

I'll apply speed formula myself

gleaming helm
#

No. Just give the player the speed effect

sturdy oar
#

no i mean i am calculating player max velocity

#

speed will increase by 20% for each level

gleaming helm
#

You can always lift the vanilla math for calculating speed

#

Although I don’t really understand what you’re trying to do

sturdy oar
#

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

subtle blade
#

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

gleaming helm
#

Where do these numbers come from?

sturdy oar
#

hardcoded velocities

#

you simply cannot walk faster than 4.32

gleaming helm
#

4.32 what

sturdy oar
#

of course, without cheating

#

blocks/s

gleaming helm
#

Oh are you trying to make an anticheat or something?

#

If so there are better ways to write speed checks

sturdy oar
#

im trying

#

this is the data i obtained

gleaming helm
#

Don’t check in movement rate per second, check in movement rate per tick.

#

That way you can check each flying packet

sturdy oar
#

im doing an average on the last second

gleaming helm
#

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

sturdy oar
#

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

gleaming helm
#

Movement speed prediction is quite tricky, there are many many edge cases.

sturdy oar
#

At the moment im doing a FastWalk check

#

so i only check the movement on ground

#

Speed will give me some troubles later 😢

gleaming helm
#

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

vale whale
#

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

vapid kindle
#

if you're doing a movement check, keep in mind that speed modifiers exist, like potion effects or attributes

tiny dagger
#

there is so much stuff nowdays involving movement it's insane :d

gleaming helm
#

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

vapid kindle
#

attributes have been in the game for about 7 years

tiny dagger
#

i don't think Player#getWalkSpeed is even accounted for in some anti cheats

gleaming helm
#

It should be in most

tiny dagger
#

well i had a user who had a problem regarding it

gleaming helm
#

Any anticheat that doesn't pull the base walk value from there is just dumb

tiny dagger
#

or maybe didn't accounted for 0 i dunno

vapid kindle
#

a good anticheat should account for all potential modifiers

tiny dagger
#

well yeah

#

but then you remember they support 1.8.8

#

so no version would be the best in term of quality

vapid kindle
#

Attributes have been in MC since 1.6.1

tiny dagger
#

wait you're right

#

i guess they weren't exposed in 1.8.8 nvm

#

yeah you're definetly right

gleaming helm
#

But they existed in 1.8 and were exposed with the bukkit api

#

Not sure what your point is

tiny dagger
#

i had to use them for some entity stuff

vapid kindle
#

I think walkspeed existed for even longer

tiny dagger
#

there is no point anymore

gleaming helm
#

First line of my speed check literally grabs the value out of getWalkSpeed()

#

double moveSpeed = player.getWalkSpeed() * player.getWalkSpeed() * 25;

tiny dagger
#

why 25 tho?

gleaming helm
#

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.

vapid kindle
#

hm, looks like the Attribute API only got added in 2016

gleaming helm
#

This is literally code copied out of a 1.8 anticheat

#

soooo

tiny dagger
#

well walkspeed was in the api but not the attribute api

sturdy oar
#

well i ain't doing 1.8 stuff

#

making proper checks is already a nightmare

#

supporting multiple versions would kill me

vapid kindle
#

the movement speed API is from 2012, so not supporting that is kinda unforgiveable

sturdy oar
#

that does not mean nothing

#

so many things are different from 1.8 to 1.15.2

gleaming helm
#

What he's saying is, not supporting changing the walk speed is unforgiveable, even for a 1.8 anticheat

sturdy oar
#

oh i misunderstood

#

i never developed a plugin for 1.8 🤷‍♂️ tbh

steady cedar
#

when did you start making plugins?

sturdy oar
#

it's when I started studying Java

sullen harness
#

Hey

#

does anyone know how i can make an scoreboard?

#

I want it to be imported from my config.yml

heady geode
#

guys when I run something with a runTask, does it happen in the same tick?

#

it would run next tick isent it

kind crow
#

is it possible to prevent players from connecting to bungeecord when the main spigot server is offline?

brave gulch
#

It would just kick them if the fallback server is not online

wraith thicket
#

@heady geode No, it'll be run on the next tick

heady geode
#

I see, tnx

sullen harness
#

does anyone know how i can make an scoreboard?
@sullen harness .