#help-archived

1 messages · Page 167 of 1

frigid ember
#

I know about this method, but are there others?

tiny dagger
#

not server side

#

and i don't know much about the client so..

abstract swallow
#

why does nocheat plus lag my players back

tiny dagger
#

oh it's not that good i guess

#

it should be doing it's check more smart than that

abstract swallow
#

lol

#

have you got a good working config

rare prairie
#

there are forums for that

abstract swallow
#

ok do u have a link

rare prairie
abstract swallow
#

thnaks

#

is no cheat plus 1.16.1 compatible

#

?????

rare prairie
#

use google

sturdy oar
#

??111 whats google never heard of it

rare prairie
#

what is windows

frigid ember
#

what is love

nimble stump
#

NCP is still around?

#

Geez

sturdy oar
#

How would the clientbound packet that shows text right above the inventory be called?

nimble stump
#

Which packet do you mean

#

The action bar?

sturdy oar
tiny dagger
#

why are people so hateful regarding a free anti cheat?

sturdy oar
#

Which packet do you mean
@nimble stump The text right above the inventory

nimble stump
#

Right so the action bar

#

It’s not the player list header/footer

sturdy oar
nimble stump
#

Yeah that’s the action bar

tiny dagger
#

yeah actionbar

#

lol

sturdy oar
#

Ok thank you , i had no idea it was called like that

tiny dagger
#

now you know

#

there is api for that nowdays btw

rare prairie
#

IChatBaseComponent

nimble stump
#

There’s the packet

tiny dagger
#

Player#spigot()#sendMessage(messageType, message);

nimble stump
#

It’s a game info chat message

sturdy oar
#

oh so it's a special chat message type

nimble stump
#

Also

#

That one apparently accepts the new JSON formatting

#

Instead of the legacy color codes

sturdy oar
#

im on 1.8.8 🤷‍♂️

tiny dagger
#

wow

nimble stump
#

Then yeah use the chat one

sturdy oar
nimble stump
#

Yes

#

That’s the one

formal nimbus
#

Hey guys 🙂

#

I need to store a bunch of objects into a file as part of my plugin

#

Is there any standard procedure for doing this?

sturdy oar
#

JSON i guess

#

with serialization\deserialization

formal nimbus
#

could you link me to a guide?

nimble stump
#

Alternatively

formal nimbus
#

I have no idea how to do any of those things ;-;

nimble stump
#

If you’re storing a lot of data

#

Write it as bytes

sturdy oar
#

in SQL?

nimble stump
#

Depends on what he needs

#

SQL could be overkill

formal nimbus
#

I'll explain what I have

#

I'm making a crate opening plugin

#

so on a server, you can get crates

#

when u right click on it

#

bunch fo items scroll across the screen

sturdy oar
#

yeah my option was probably what you needed

formal nimbus
#

u get the one which lands in the middlle

#

I need to store the objects inside the crate

#

and the weight of each item

sturdy oar
#

I actually had made such a plugin some time ago

formal nimbus
#

but I also am going to have multiple crates

#

I actually had made such a plugin some time ago
@sturdy oar cool

nimble stump
#

Use yaml configs

formal nimbus
#

guid plzz

nimble stump
#

Already built into spigot

formal nimbus
#

*guide

#

I have no idea how to do anything xD

sturdy oar
#

If it's going to be configurable by the user definetively don't use JSON

formal nimbus
#

it is

sturdy oar
#

9yo kids will be scared to edit .json files

formal nimbus
#

ah

nimble stump
formal nimbus
#

well I'm making it editable in game

#

so JSON could still work then

nimble stump
formal nimbus
#

my plan is to allow users to make they're own crates in game, and stick in all the items they want in game

sturdy oar
formal nimbus
#

and that will then be stored

#

ok thanks 🙂

nimble stump
#

If you use JSON you’ll need to shade in an external library

formal nimbus
#

I'll check them all out

nimble stump
#

Do you know how to do that?

sturdy oar
#

If you use JSON you’ll need to shade in an external library
@nimble stump no

formal nimbus
#

nope lmao

sturdy oar
#

GSON is already present at runtime

formal nimbus
#

as I said, I'm new to this 😮

nimble stump
#

Gson is shaded in now?

#

@formal nimbus I would recommend using the config system spigot has built in

formal nimbus
#

what do you mean by shaded in?

nimble stump
#

It’s very easy to use

formal nimbus
#

kk

#

sounds like a plan

nimble stump
#

No need to over complicate things

formal nimbus
#

hmm

sturdy oar
formal nimbus
#

If i use that, how easy will it be for people to edit the config file?

nimble stump
#

Very

formal nimbus
#

because I feel like being able to create crates in game and in the config file will be veru useful

#

kk good

nimble stump
#

@sturdy oar says deprecated

formal nimbus
#

because that means people can copy config file text

nimble stump
#

Yes

formal nimbus
#

rather than having to manually replicate crates

#

in game

nimble stump
#

It’s not that JSON is particularly difficult to edit

#

Lol

sturdy oar
#

Then it's somewhere else, but it must be shaded in , because 2 of my plugins entirely depend on GSON and i'm not shading it

nimble stump
#

¯_(ツ)_/¯

#

I mean it’s definitely in there

#

But if it’s deprecated it means they may remove it any time

tiny dagger
#

it was always in here

#

for a long time at least

formal nimbus
#

anyway, time to read these guides. Thx for help! I'll come back if I have any more issues

#

wait

nimble stump
#

Yes?

formal nimbus
#

@nimble stump are you a mineplex dev?

nimble stump
#

I was the lead dev until this month

formal nimbus
#

ah

cerulean musk
#

Guys i dont Want drop items on death. How can i make it ?

formal nimbus
#

yeah I heard a bunch of people resigned

#

sounds like the servers going to shit ):

nimble stump
#

The server’s doing very well

formal nimbus
#

it was a good server though ;-;

tiny dagger
#

teach me how to code mineplex style :d

nimble stump
#

I just left for a better paying job elsewhere

#

Nobody left out of dissatisfaction

formal nimbus
#

hmm, not as well as it used to do

rare prairie
#

Guys i dont Want drop items on death. How can i make it ?
PlayerDeathEvent#getDrops

nimble stump
#

@sturdy oar that’s a shit take

#

But ok

sturdy oar
#

my experience was trash

formal nimbus
#

@nimble stump who made SSM?

#

best game on the server in my opinion

nimble stump
#

defek6 and Chiss years and years ago

#

But it’s had a lot of people work on it since

formal nimbus
#

👍

sturdy oar
#

bought a product on mineplex, didn't receive it in 24hours, asked refund, got money back, got banned. If you think this is normal @nimble stump

nimble stump
#

Got money back from...

#

Chargeback?

sturdy oar
#

yes

nimble stump
#

That’s why you got banned

#

Lol

#

Chargebacks are an auto ban

sturdy oar
#

they didn't respect their 24h delivery

nimble stump
#

Technical difficulties do sometimes happen

rare prairie
#

bruh, dont play minecraft, just develop

tiny dagger
#

they offer refunds don't they

nimble stump
#

You should’ve gone through the support system, they could have easily sorted your rank out

#

It’s pretty standard across the board to ban chargebackers

sturdy oar
#

🤷‍♂️

tiny dagger
#

is mineplex hiring minigame devs ? 👀

formal nimbus
#

@nimble stump how does mineplex do it's double jump?

nimble stump
#

there’s a jobs page

formal nimbus
#

cause there's no way to detect somebody tapping space key in mid air

nimble stump
#

@formal nimbus yes there is

#

Toggle flight event

formal nimbus
#

ahh

grim halo
#

@formal nimbus ToggleFlightEvent

formal nimbus
#

give them flight for a split seccond

#

then take it away

#

and propell them

nimble stump
#

It never gives them flight

#

It cancels the toggle and applies a vector

formal nimbus
#

yuh

tiny dagger
#

but you need to give them flight on movement

#

or playerjumpevent on paper

#

that's kinda cool

nimble stump
#

Flight on movement’s no big deal

#

They never actually get to fly

quick arch
#

or Jump statistic increase on Spigot

formal nimbus
#

They never actually get to fly
@nimble stump unless the server lags

grim halo
#

Is there an event for statistic increase?

quick arch
#

There's an event, yes

nimble stump
#

That’s just client side @formal nimbus

formal nimbus
#

hmm

nimble stump
#

The client can do all sorts of dumb shit when the server lags

formal nimbus
#

I have managed to fly on mineplex though

#

like on ssm

quick arch
#

PlayerStatisticIncrementEvent

formal nimbus
#

lag for a second, it still happens

nimble stump
#

Your client can send movement packets sure

grim halo
#

But still the event will get fired a LOT. Its probably cheaper to just poll the statistic every tick. Or better is PlayerJumpEvent

nimble stump
#

Polling every tick sounds far more expensive than listening to the stat increment

quick arch
#

Pretty sure PlayerJumpEvent in Paper listens to the stat increase event

tiny dagger
#

smile just do a small check to trigger it on block change only

#

the event is not heavy if used correctly

#

it's just gonna show pain fast if used incorrectly

#

well that would be a bummer because internaly the server can tell when the player is jumping

grim halo
#

Oh thought it would fire for every statistic... in this case its probably cheaper. But there are some statistics that would mean the event would have gotten fired several times per tick per player so i thought polling was better.

tiny dagger
#

i think this way is a joke

zealous shore
#

I got

    mavenCentral()
    maven { url = 'https://hub.spigotmc.org/nexus/content/repositories/snapshots/' }
}

dependencies {
    compileOnly 'org.spigotmc:spigot:1.16.1.-R0.1-SNAPSHOT'
}```

in my build.gradle and when I try to build it i get this:
```Could not find org.spigotmc:spigot:1.16.1.-R0.1-SNAPSHOT.
Searched in the following locations:
  - https://repo.maven.apache.org/maven2/org/spigotmc/spigot/1.16.1.-R0.1-SNAPSHOT/maven-metadata.xml
  - https://repo.maven.apache.org/maven2/org/spigotmc/spigot/1.16.1.-R0.1-SNAPSHOT/spigot-1.16.1.-R0.1-SNAPSHOT.pom
  - https://hub.spigotmc.org/nexus/content/repositories/snapshots/org/spigotmc/spigot/1.16.1.-R0.1-SNAPSHOT/maven-metadata.xml
  - https://hub.spigotmc.org/nexus/content/repositories/snapshots/org/spigotmc/spigot/1.16.1.-R0.1-SNAPSHOT/spigot-1.16.1.-R0.1-SNAPSHOT.pom
Required by:
    project :```
subtle blade
#

Spigot server dependency is not hosted on the Nexus. Would be distributing the server jar

#

It should be in your local maven repository after running BuildTools as it local installs it for you

visual berry
#

guys how to check when a pressure plate is activated? (by a player or by an item)

subtle blade
#

PlayerInteractEvent with Action.PHYSICAL for the first one but I honestly don’t know if an event gets fired for items

visual berry
#

tried already... also doesn't work if the pressure plates are gold or iron ones

tiny dagger
#

well

#

because those triggers for heavier stuff

visual berry
#

they are not recognized in the PlayerInteractEvent, one way could be to use a PlayerMoveEvent and check if they step on a pressure plate, but it won't work with items

#

I need it to be working for both players and items

#

like that if they throw an item on the pressure plate and they don't have permission the pressure won't power on

zealous shore
subtle blade
#

—rev 1.16.1

zealous shore
#

Like this? java -Xmx1024M -jar BuildTools.jar -rev 1.16.1

visual berry
#

yea --rev 1.16.1 should work

zealous shore
#

Ok it worked thanks

frigid ember
#

Also @zealous shore you are looking for version "1.16.1.-R0....", you got an extra period in the before the -

zealous shore
#

yes i noticed that lol thanks

undone pine
#

need help, when i run buildtools it says java cannot be installed

grim halo
#

@undone pine What?... Install Java then i guess.

#

and the run the build tools with something like
java -jar BuildTools.jar

#

Go into your terminal and type

#

java -version

#

to see if you got java isntalled

subtle blade
#

mfw not having Java installed WeirdChamp What is this, 2002?

undone pine
#

i have java installed 🤦‍♂️ but it still doesnt work

visual berry
#

what version?

grim halo
#

java -version <- What did you get

left walrus
#

why the prefix of luckperms isn t showing

grim halo
#

Have you java installed @left walrus ?

left walrus
#

yes

grim halo
#

XDD

left walrus
#

lmao

#

can you answer my question?

grim halo
#
  1. Tell us what you did
  2. Tell us what you expected to happen
  3. Tell us what actually happened instead
left walrus
#
  1. i just installed luckperms
#
  1. the prefix isn t showing
#
  1. same
grim halo
bleak cipher
#

@left walrus do you have a chat plugin which applies them?

#

like essentialsx-chat

left walrus
#

i have essentials not x

grim halo
#

do you
have a
chat plugin

undone narwhal
#

Hello quick lazy question: what's the max progress value of a bossbar?

grim halo
#

1.0

undone narwhal
#

Thanks

sturdy oar
#

i have essentials not x
@left walrus why lmao

#

I don't see any reason to use Essentials over EssentialsX in 2020

grim halo
#

Maybe he runs 1.7

sturdy oar
#

😂

left walrus
#

@sturdy oar thanks i has an old version of essentials.

sturdy oar
#

yeah EssentialsX is the updated fork

left walrus
#

thanks

sturdy oar
#

👨‍⚖️ ok

covert bronze
#

Weeks ago I filled the SpigotMC CLA but did never get a response, anyone knows if they reply every petition?

subtle blade
#

I don't think they're ever replied to, but it's possible you would have access at this point

#

?stash

worldly heathBOT
subtle blade
#

If you have access to the PRs, you're good to go

frigid ember
#

tried toString'ing a Location but it shows like this in a .yml
Location{world=CraftWorld{name=world},x=86:
0,y=64:
0,z=187:
0,pitch=0:
0,yaw=0:
0}: 1594302452063

#

You could edit this by making your own toString right?

#

So I created this:

    public String locToString(Location loc){
        return loc.getWorld().getName()+","+loc.getBlockX()+","+loc.getBlockY()+","+loc.getBlockZ();
        }```
opal heron
#

Attributes is so confusing

frigid ember
#

but the main questions i what should this be replaced with rn?

        for (Location blocation : Bucket.blockLocation.keySet()) {
            getConfig().set(blocation.toString(), Bucket.blockLocation.get(blocation));
        }```, Created the weird setup in config. I want it to get the location from the locToString()
formal nimbus
frigid ember
#

config.yml isn't to be found

formal nimbus
#

but I have a config.yml?

#

o wait

#

no

#

I have a plguin.yml

#

*plugin.yml

frigid ember
#

:/

formal nimbus
#

shouldn't it create it automatically?

frigid ember
#

it should

formal nimbus
#

then why is it not creaitng it ;-;

#

*creating

frigid ember
#

try creating one and do it

formal nimbus
#

where do I make it?

frigid ember
#

next to ur plugin.yml

#

also a file

#

where do you even need the config for?

formal nimbus
#

what or where

frigid ember
#

do you store anything in it?

formal nimbus
#

yes

#

I'm storing crate objects

#

I'm going to break them down into primatives

#

store the primatives in the folder

#

then reconstruct them on load up from the primatives

frigid ember
#

create one, the same as plugin.yml

#

but without info in it

formal nimbus
#

k...

frigid ember
#

unless you got paths already

formal nimbus
#

wdym?

frigid ember
#

have you looked at a tutorial or something for creating custom configs?

formal nimbus
frigid ember
#

Would suggest that to understand it better

formal nimbus
#

have you looked at a tutorial or something for creating custom configs?
@frigid ember I have a guide but I thought keepign it simple would be better

frigid ember
#

what ide are u using?

formal nimbus
#

eclipse

#

ok I jsut reloaded with no errors

frigid ember
#

why are you making it like me jetcobblestone jetcobblestonecrates

#

include .

#

me.name.project

#

its ur choice ofc

#

but it will look clear

formal nimbus
#

¯_(ツ)_/¯

peak glade
#

hey

#

hello

frigid ember
#

hi

formal nimbus
#

hi

peak glade
#

how hub ?

formal nimbus
#

@frigid ember it has been made 😮

frigid ember
#

🙂

opal heron
#

Hm, still can't find a way to edit attributes.

peak glade
#

./sethub

formal nimbus
frigid ember
#

nice

opal heron
#

any1 messed around with this?

frigid ember
#

that was the easy part @formal nimbus

grizzled quiver
#

does spigot support gui? and how i make my server support it

frigid ember
#

the hard part is making it configurable

#

well not even that difficult

#

but storing/loading hashmaps is a bit difficult

covert bronze
#

I don't think they're ever replied to, but it's possible you would have access at this point
@subtle blade im not even able to log in. "You do not have permission to access Bitbucket". Should I resubmit the CLA?

formal nimbus
#

but storing/loading hashmaps is a bit difficult
@frigid ember I aint storing hashmaps, I've already written some code which should store a crate?

#

I've probably butchered it tohugh

#

*though

frigid ember
#

;D

formal nimbus
#

have I done anything bad here?

frigid ember
#

Which line should it be on

formal nimbus
#

😮

#

it has worked...

#

kind of

#

the itemStacks aren't great though :/

#

I don't think I'll be able to reconstruct an ItemStack from that ;-;

inland oxide
#

when you bug disappears when you add debugging code and you don't know why...

formal nimbus
#

lol

inland oxide
#

the issue was occuring, then coudn't nail down what packet it was overflowing in, but I think theres some sort of buffer overflow occuring that happens only in rare cases

mellow wave
#

You should be able to reconstruct an itemstack by using ConfigurationSection#getItemStack() @formal nimbus

formal nimbus
#

heh

#

example plz

#

do I need to save it any differently?

mellow wave
#

config.getItemStack("cool.location");

formal nimbus
#

o

#

okay cool

#

I'll give it a shot 😮

mellow wave
#

wdym? it just looks like your console is reading the colorcode a bit wrong

sturdy oar
#

Does Player#setGamemode requires the player to be online? If not how does one change the gamemode of a player that left the server

mellow wave
#

§ is for old color codes, hex is new and not all plugins support it

#

@sturdy oar I belive the player needs to be online, but you could set it when the player joins or leaves. You probably also modify the player file directly but I wouldn't suggest it

covert bronze
#

There is §x everywhere
@graceful wagon §x§0§0§8§0§8§0 would be #008080

sturdy oar
#

yeah that's what i thought

#

i'll just set it on PlayerQuitEvent

formal nimbus
#

is there anyway I can set a variable declaroid to a value inside of a config file?

sturdy oar
#

I was making a small plugin that gives spectator and action bar on death for 5 seconds, however i have to think of all possible cases, such as player quits during that

formal nimbus
#

actually...

mellow wave
#

ah cool didn't know Netsu :) I haven't used spigot 1.16 yet

formal nimbus
#

I don't think I need to do that....??

mellow wave
#

What exactly are you trying to do?

formal nimbus
#

o sorry

#

didn't see ur msg

#

I'm trying to make a function which loads my crates back in

#

@mellow wave

#

I've made this xD

#

the problem is

#

my list will just be filled with a bunch of crateObjects called 'crate'

#

I just tried running the function 😮

#

no errors

#

but I have no way of testing if it workjs xD

mellow wave
#

Yeah you need to make sure that you have a fail safe incase a user adds the wrong type of object in the config

formal nimbus
#

ah

#

how to do dat

#

try except?

#

what if I just yeet the entire thing in a try and catch

#

and if I get an error, just say 'invalid config'

#

how vague 😄

mellow wave
#

You could but if you use config.get<insert type here>("locationHere", defaultValue") then it should solve most of the issues

sturdy oar
#

com.comphenix.protocol.reflect.FieldAccessException: No field with type byte exists in class PacketPlayInChat. I've tried setting the Chat Packet Position, which is marked as "Byte" value in Wiki.vg, however it says that there are no fields of that type? Am I doing something wrong here?

formal nimbus
#

ah

#

so I can just throw in null

tiny dagger
#

why don't you check the nms too?

sturdy oar
#

me?

frigid ember
#

com.comphenix.protocol.reflect.FieldAccessException: No field with type byte exists in class PacketPlayInChat. I've tried setting the Chat Packet Position, which is marked as "Byte" value in Wiki.vg, however it says that there are no fields of that type? Am I doing something wrong here?
@sturdy oar so did you set the index as 0 or 1?

tiny dagger
#

yes fendi

sturdy oar
tiny dagger
#

it only has a string

sturdy oar
#

I'm on 1.8.8

#

i'll check NMS

frigid ember
#

the packets wiki has a backup copy for 1.8 in the history part

sturdy oar
#

yeah in fact

tiny dagger
#

still a string

sturdy oar
#

that's the screenshot i sent, it has a byte value

frigid ember
#

protocolib has a issue with explaining stuff like this...

tiny dagger
#

maybe it's client side

frigid ember
#

youre not the only one who encountered this issue

tiny dagger
#

wait nvm

#

since packets are the same both ways

frigid ember
#

try writing in index 1 and see if that works

sturdy oar
frigid ember
#

and try writing chat before byte (maybe it has an issue with that?)

sturdy oar
#

is wikivg wrong

frigid ember
#

it's not wrong, just confusing

daring oracle
#

Does anyone know a good plugin(s) I can use to make a menu item. I need an item that will execute a command on right-click and be locked on the 9th slot. If anyone knows a plugin that can do any of that I would be very grateful if they tell me which one because I can't seem to find any. I've already made a whole menu, but I want it to be accessible via a simple item.

frigid ember
#

and it may just count starting at 1 for no reason

formal nimbus
#

IT WORKKKKSKSSS

#

@mellow wave

mellow wave
#

Great

formal nimbus
#

I just loaded and used a crate from a config file :0

sturdy oar
#

Last time I used ProtocolLib index started at 0 tho

formal nimbus
#

that's actually suppeppreprpprepr cooool#

sturdy oar
#

at least for read

formal nimbus
#

big hype

covert bronze
mellow wave
#

Read what he just said instead

frigid ember
#

@sturdy oar there are multiple get byte methods for protocolib, have you tried them?

#

with PacketContainer I mean

sturdy oar
#

I'm trying what you told me but i don't think it has any effect

frigid ember
#

have you tried

#

looking up instances of that packet code on github

#

to see what others are doing?

sturdy oar
#

oh wait i think maybe i found the issue

frigid ember
#

hm?

sturdy oar
#

i was using Client instead of Server packet

#

the name are confusing

frigid ember
#

oh I see

#

yes

#

because

#

protocolib

sturdy oar
#

let's see if it works now

frigid ember
#

well it's just a string input

sturdy oar
frigid ember
#

I see

#

is this your first time on packets?

sturdy oar
#

on writing yes

#

I've realized that Bukkit API limits me too much

subtle blade
#

Note: PacketPlayIn = Client -> Server, PacketPlayOut = Server -> Client

sturdy oar
#

there's so many things that can't be done with Bukkit\Spigot , so i had to learn packets

frigid ember
#

there's also NMS as well

#

really lacking libraries for that except for that nbt library

sturdy oar
#

The next thing I'm going to do is place a "fake" player sleeping where the original one died

#

this is going to be fun

nimble oar
#

Version?

sturdy oar
#

?

nimble oar
#

What's the version you're doing this on?

sturdy oar
#

1.8.8

nimble oar
#

Oh yeah good luck :D

sturdy oar
#

i mean it's pretty much the same on 1.16 still

tiny pebble
#
    permissions:
    - smm.founder
    - smm.managegroups

Pretty sure someone asked this last night but I wasn't there for the answer.

How can I make the config write to the permissions key, adding to the list that smm.founder and smm.managegroups are in?

frigid ember
#

I think with that fendi

formal nimbus
#

hmmm

frigid ember
#

you just send a create player packet to a bunch of people

sturdy oar
#

yeah i know

formal nimbus
#

I have encountered a strange issue

frigid ember
#

spawn player packet yeah

#

very hard to do lol

formal nimbus
#

so I have this function:

#

most of it you can ignore

#

this part at the bottom is the important bit

nimble oar
#

@tiny pebble are you asking how to add another value to the permissions key?

formal nimbus
tiny pebble
#

yeppers

formal nimbus
#

when I call the function, I run a little debug

tiny pebble
#

to add it just like how the list is

formal nimbus
#

prints what's in the list

#

as well as how many items are in the list

nimble oar
#

@tiny pebble are you using YamlConfiguration configs?

tiny pebble
#

👍

formal nimbus
#

and also every time an item is added to the list, I send a message

#

the function is called twice, as we can see

#

but there are 4 items in the list

#

??

#

how does this make any sense?

nimble oar
#

@tiny pebble those are a list of strings, so you can get them using config.getStringList(path);

#

Then modify the list and save it

formal nimbus
#

I only call 'crateList.add(crate);' twice, yet 4 items are added?

tiny pebble
#

well I tried groupsConfig.getStringList("groups." + groupString + ".permissions").add(perm);, and it didn't add 🤔

formal nimbus
#

if you look at the list printed, each object added is repeated twice?

#

never mind, ignore everything i have said lmao

#

I'm just dumb

nimble oar
#

@tiny pebble
Create a new list object, add to that and then save it. It won't update with the way you did it

formal nimbus
#

I already incoperated the crate being added to the list when the crate is created

frigid ember
#
>.... [15:15:59 WARN]: Can't keep up! Is the server overloaded? Running 69817ms or 1396 ticks behind
>.... [15:16:02 INFO]: [WorldBorder] [Fill] 125 more chunks processed (1107139 total, ~2.8%) (free mem: 5214 MB)
>.... [15:16:07 INFO]: [WorldBorder] [Fill] 312 more chunks processed (1107451 total, ~2.8%) (free mem: 4990 MB)```
#

anyone know why is this shit?

#
    private void saveDataBlocks() {
        for (Location blocation : Bucket.blockLocation.keySet()) {
            getConfig().set(locToString(blocation), Bucket.blockLocation.get(blocation));
        }```
I also need to get the value of the hashmap, how would I fit that  in here?
#

worldborder loading so slow

#

and having 0tps

#

Make another for-loop but than with Bucket.blockLocation.values()?

#

or is there another way:p

nimble oar
#

@frigid ember Bucket.blockLocation.get(location) ?

frigid ember
#

?

nimble oar
#

What do you mean by value of the hashmap?

#

An index?

frigid ember
#

public static final HashMap<Location, Long> blockLocation = new HashMap<>();

#

the Long

tiny pebble
#

got it to work! thank ya 😛

nimble oar
#

Am I not getting something here? you're already getting the long value at Bucket.blockLocation.get(blocation)

frigid ember
#

oohh whut

#

but thats a shitty number xd

#

in the config.yml but thanks

nimble oar
#

:D

formal nimbus
#

guys, how to convert a string to an int?

nimble oar
#

Integer.valueOf(string)

formal nimbus
#

ah

#

thx

covert bronze
#

@formal nimbus

formal nimbus
#

hmm

covert bronze
#

It handles all the data loading

formal nimbus
#

but I just did it ;-;

covert bronze
#

huh

frigid ember
#

@frigid ember the only two time I worked with worldborder, it was slow as fuck, I don't remember the ideal configuration I found (I believe it was 4 chunks per tick? Don't know exactly), but having no players while it generates chunks helped a lot with the crashes lol

formal nimbus
#

wait

#

what is this for?

covert bronze
#

It reconstruct the objects used to generate the saved files

formal nimbus
#

cool

#

it doesn't matter now tho

#

I just got my stuff to work

#

and the config is really easy to edit

#

well, creating the ItemStacks in a config file I guess isn't

#

but that's why I'm also going to have an in game way to create them

frigid ember
#

@frigid ember is there any better plugin

#

or way to do it faster? this is slow af

#

If there is, I don't know of any

peak marten
#

Is anyone aware of the *@r @e @p etc selectors not working in command blocks for custom plugins?

mellow wave
#

If you want faster world gen then upgrade the host. Worldgeneration takes time

#

@peak marten Selectors only work in vanilla commands or plugins that has addedd support for it. If the selectors doesn't work then you probably have essentials installed which is overriding the commands. This can be bypassed by adding minecraft: before the command

peak marten
#

So the command block is unable to determine the nearest or a random player if it is not a vanilla command?

#

someone is asking me why /somecommand @p is not working

frigid ember
#

I do however know of another "version" of a Minecraft server that is not made in Java, it does save the worlds in the same format, and you can tweak a lot of values for world generation and it is blazing fast. I could have used that for world generation and upload it to the server later
But again, it's not Java, and it's most definitely not spigot (and it's 1.12.2)

mellow wave
#

Command blocks are only running the command. It's up to the plugin developers to make the selectors work

peak marten
#

I'm the plugin developer, so how do I make the selectors work then?

#

I need to manually code the logic ?

#

for nearest, random, etc .. ?

mellow wave
#

Yes

peak marten
#

really?

#

lol

mellow wave
#

I belive so I haven't seen anything better

frigid ember
#

I believe you can make some voodoo magic to hook your plugin with Brigadier and the selectors will work

mellow wave
#

^

peak marten
#

voodoo is always nice

frigid ember
#

But that's a bit next level, for me at least lol

mellow wave
#

Yeah I've never even tried to use Brigadier

peak marten
#

This also looks interesting:

#

most likely that is the solution

mellow wave
#

Looks cool never seen it before, bookmarked for later use

frigid ember
#

Oo that's interesting

covert bronze
#

There is a methor for plugins to use selectors

peak marten
#

it's from md5

covert bronze
#

Bukkit#selectEntities()

frigid ember
#

That's exactly what the demo is showing lol

mellow wave
#

Yeah

frigid ember
#

Never heard of it

grim halo
#

So basically getServer().selectEntities( sender, arg )
and arg is @p for example

frigid ember
#

Looks like it is

pastel sierra
#

How do I make custom names to not show?

#

the isCustomNameVisible()

#

seem to only get the result

#

ok i found it

#

nvm

frigid ember
#

👍

fringe cairn
#

I've created a PersistentDataType for storing UUIDs in persistent data (with a lot of help from here), but whenever I'm trying to use container.has(UUIDKey, uuidType) to check if anything is set, I'm getting a null pointer exception, and I'm not sure if its something wrong with my container, or if its something wrong with the PDT I made. If anyone wants to look this over heres the code, null pointer exception on line 9 https://pastebin.com/7A5wwt1T

frigid ember
#
        private final HashMap<Location, Long> blockLocation = new HashMap<>();
        public void checkBuckets() {    
            new BukkitRunnable() {
                @Override
                public void run() {
                    for(Location b : blockLocation.keySet()){
                          long placeTime = blockLocation.get(b);
                          if ((placeTime + 2000L) <= System.currentTimeMillis())
                            {
                              b.getBlock().setType(Material.AIR);
                              blockLocation.remove(b);
                            }
                        }
                }
            }.runTaskTimer(this.plugin, 0L, 100L);//20=1s
        }```
im using this but after the restart when I saved the hashmap and loaded it
the water doesnt get removed
#

this is just the part that should check wether there is information in the hashmap

sturdy oar
#

@frigid ember sorry if I ping you , however you seemed experienced with this:
do you know if it's possible to send a player in the sleeping animation, but without actually spawning it?

rare prairie
#

im using this but after the restart when I saved the hashmap and loaded it
the water doesnt get removed
Are you sure you loaded properly the data from your data file to the memory?

frigid ember
#

yes

rare prairie
#

can we see that

frigid ember
#
    private void loadData() {
        if(getConfig().getConfigurationSection("data.playerdata") != null) {
            for (String str : getConfig().getConfigurationSection("data.playerdata").getKeys(false)) {
            Location blocation = (Location) getConfig().get("data.playerdata");
            long seconds = getConfig().getLong(str);
            Bucket.blockLocation.put(blocation, seconds);
            
        }
        }
    }
    
    private void saveDataBlocks() {
        for (Location blocation : Bucket.blockLocation.keySet()) {
            getConfig().set(locToString(blocation), Bucket.blockLocation.get(blocation));
        }
        saveConfig();
    }
    
    public String locToString(Location loc){
        return "Location: "+loc.getWorld().getName()+", "+loc.getBlockX()+", "+loc.getBlockY()+", "+loc.getBlockZ();
        }```
#

loadData(); in onEnable saveData(); in onDisable ofc

#
            Location blocation = (Location) getConfig().get("data.playerdata");``` Maybe its this part
#

must be it than

#

only part where I have my doubts about

#

cuz the path leads to the whole config.yml part basically

rare prairie
#

There are things that should be changed:

  • First, in getConfig().getConfigurationSection != null, use getConfig#isConfigurationSection its better
  • Don't use Map.keySet, use instead .entrySet to iterate all data, so you can get safely the Long from the memory hashmap.

Also data.playerdata actually is a ConfigurationSection?

frigid ember
#

@rare prairie how would I get the Location on loadData()?

rare prairie
#

use list instead and cast to List<Location>

frigid ember
#

out of the config.yml

desert kraken
frigid ember
#

In server.properties

#

Broadcast something to ops

#

broadcastCommandsToOps I believe

desert kraken
#

okay thankyou 😄 sorry if i interrupted some important chat or something

frigid ember
#

nah bro ur good:D

#

It's all good

#

can someone help me im new to spigot and i got this error when i want to enter this thing:
java -jar BuildTools.jar --rev 1.15.2
and then i got this message that i believe its an error:
BuildTools requires at least 512M of memory to run (1024M recommended), but has only detected 247M.
can someone help me because im new here ;-; so im stuped

crisp widget
#

You need more ram

frigid ember
#

@rare prairie List<Location> sorry how exactly in this Location blocation =

pastel sierra
#

The setCustomNameVisible(value) isn't working I set the value to false and then even logged the value to check if it's false but the name is still visible when hovering over the mob

frigid ember
#

You need more ram
my laptop ram?

pastel sierra
#

Yes

crisp widget
#

Yeah, that's saying you only have 247M available

pastel sierra
#

Probably close all other programs that might be taking significant portion of your RAM maybe

frigid ember
#

ohh ok thanks its working now 😄

pastel sierra
#

The setCustomNameVisible(value) isn't working I set the value to false and then even logged the value to check if it's false but the name is still visible when hovering over the mob
oh it's working I misunderstood what visibility false actually meant

frigid ember
#

@rare prairie List<Location> sorry how exactly in this Location blocation =
? ;p

pastel sierra
#

Is there a way to have multiple ender dragon fights active at once?

#

becuase the EnderDragon.Phase is static

tiny pebble
#

I have a PlayerJoinEvent that checks for a players permission group within my custom config, and adds their permission on join. It works, but if I update my config and save it, I have to reload the server to get it to apply again. I'd rather have it so they can just leave and join again. Is there a way I can make it so it doesn't need to reload?

#

TL;DR the config only actually updates when the server is reloaded, can it just update whenever I save it or nah?

rare prairie
#

? ;p
@frigid ember

List<Location> list = (List<Location>) getConfig().get("data");
frigid ember
#

ohh that'll get it?

rare prairie
#

if that a list of location

frigid ember
#

Type safety: Unchecked cast from Object to List<Location>

covert bronze
#

I have a PlayerJoinEvent that checks for a players permission group within my custom config, and adds their permission on join. It works, but if I update my config and save it, I have to reload the server to get it to apply again. I'd rather have it so they can just leave and join again. Is there a way I can make it so it doesn't need to reload?
@tiny pebble you can schedule a task that checks if the date of last modification of the file has changed, and then, reload the data

rare prairie
#

Type safety: Unchecked cast from Object to List<Location>
add a suppresswarning above that

#

or ignore it

tiny pebble
#

hm alright, i'll see what i can do with that

frigid ember
#

Bucket.blockLocation.put(blocation, seconds);

#

but my hashmap is Location, Long

#

and now I have to set put(List, Long) Basically

rare prairie
#

use for loop to add locations

frigid ember
#

locations are already added

#

they only need to be get out of the config

rare prairie
#

bruh, I'm said this how you can

tiny pebble
#

@covert bronze is there any sort of eventhandler for checking for the configuration or nah hahaha that would just make it easier if anything 😛

#

i doubt there is just wondering

rare prairie
#
@SuppressWarnings("unchecked")
List<Location> loc = (List<Location>) config.get("data.loc");
if (loc == null) {
    return;
}

for (Location l : loc) {
    map.put(time, l);
}
#

they only need to be get out of the config

tiny pebble
#

Does JavaPlugin#reloadConfig() reload every config, or just config.yml? I have a custom config

rare prairie
#

only config.yml

#

its default

tiny pebble
#

alright

cold jewel
tiny pebble
#

Weird question, is there a way to convert a String to a Player, or something similar? Basically a way to get Player from their display name... so the opposite of Player#getDisplayName()

tiny dagger
#

because you need to set the datawatcher that shows the outer layer

tiny pebble
#

ah i could do a loop through all UUIDs of all online players, seeing if it equals a player display name..?

cold jewel
#

because you need to set the datawatcher that shows the outer layer
@tiny dagger And how I can do this?

rare prairie
#

Weird question, is there a way to convert a String to a Player, or something similar? Basically a way to get Player from their display name... so the opposite of Player#getDisplayName()
getDisplayName returns the colored and/or chat thing, use Player#getName, Bukkit#getPlayer

tiny dagger
#

datawatcher.set(bt, (byte) 0xFF);
this is how it would look on 1.14.4

tiny pebble
#

ah okay

cold jewel
#

datawatcher.set(bt, (byte) 0xFF);
this is how it would look on 1.14.4
@tiny dagger I'm using 1.12.2

tiny dagger
#

well find the datawatcher for 1.12,2 then :p

cold jewel
#

ahhaha, ok, I will search about it, if I need some help, i quote you, thx man

tiny dagger
#

no problem

tiny pebble
#

Alright so basically... I want to get the user's UUID from their name, because I already have the name and it's set up like that for my config. The reason why doesn't matter. But, my goal here is to get their UUID from their name as said. So, is there a way to get their UUID from their name, being the Player#getName()?

#

preferably without a whole buncha for loops since thats the way i know how to do it, though if there is a much less complicated procedure that would be lovely

tiny dagger
#

Bukkit.getOfflinePlayer("test");

#

OfflinePlayer is not null

#

therefore you can get it's uuid

subtle blade
#

You shouldn't be storing names as persistent data to begin with

#

They can change

tiny dagger
#

^

#

not sure why people want names as keys still lol

tiny pebble
#

I know, I was going to have a way to listen to a name change and reset the config, but meh

#

actually i guess i'll work on making it based from uuid's, having the names in another config

tiny dagger
#

keep names as a value

#

and switch it on every quit/join

tiny pebble
#

yeah that makes sense

wraith thicket
#

Getting an offline player from their name is blocking if player has never played on the server before

#

You can try and parse usercache.json for name->uuid conversions though

subtle blade
#

At that point you'd just use Bukkit#getOfflinePlayer(). That's where it pulls from

wraith thicket
#

Yes, but it'll also pull from the server if it can't find one

#

Which for me usually takes more than a second.

frosty cave
#

commands cant have spaces

#

you can have arguments in the command

#

or you could make another command that just runs /warp shop as the sender or something

tiny pebble
#

No, the command would be in the yml file. If it were /warp shop, warp would be in plugin.yml. In your CommandExecutor class, you would just do an if statement to check for your arguments.

if (args[0].equalsIgnoreCase("warp") {
  ...
}
#

Also just wanted to say Bukkit#getOfflinePlayer(String) is deprecated, so idk why that was recommended to me. I have the players stored as UUIDs, though I don't want a command to execute using the player's UUID, and rather using the string. So could I go from string to Player to UUID...? Haha this is getting out of hand for me

rare prairie
#

you can

wraith thicket
#

Now, if you know the player has joined, then you'd be fine using that.

tiny pebble
#

Ah, I see! Sorry for the misinterpretation, that's on me

wraith thicket
#

You didn't necessarily misinterpret anything 🙂

spare frost
#

Yo. How do I manually make the player glide?

#

I made sure that the player 1) is in the air, 2) has an elytra

wraith thicket
spare frost
#

I tried doing .setGliding(true) but that did not work

#

Tried that.

#

I'm on version 1.12.2 BTW

wraith thicket
#

Not sure about legacy versions. You'll have to do your own debugging

spare frost
#

Okay

reef sparrow
#

Can anyone explain me a few things about the Paper Timings

wraith thicket
#

Paper is a fork of Spigot - you'd be better off discussing it on their discord

reef sparrow
#

ok thx anyway

spare frost
#

@wraith thicket What are the things that toggle off gliding?

wraith thicket
#

Same method, pass false

spare frost
#

I know, what are the things that you do in minecraft that toggle off gliding?

#

automatically

wraith thicket
#

When you hit a wall/ground? I don't know - you can try it and see

reef sparrow
#

Can anyone help me with some questions about the Paper Timings

rare prairie
#

In the proper server, go to paper

wraith thicket
#

Search for the fork on google - you'll find their website along with their discord

spare frost
#

Wait, what does .setGliding() even do? Does it make it so you don't have to click on the spacebar?

wraith thicket
#

Javadocs I linked to:
"Makes entity start or stop gliding. This will work even if an Elytra is not equipped, but will be reverted by the server immediately after unless an event-cancelling mechanism is put in place."

spare frost
reef sparrow
#

how I can get all generated Chunks in a List or Collection

wraith thicket
#

You can't and don't want to either

#

The issues is, a semi-large server could have generated literally millions of chunks

sleek tree
#

Hi, I’m just wondering why checking for left click air always returns false?

void onAbility(PlayerInteractEvent e){
  if(e.getAction() == Action.LEFT_CLICK_AIR) {
//do stuff
}
}```

Just a quick example but the //doStuff will never run because for some reason the event always returns false
nimble solar
#

Do you have the @ EventHandler annotation and register the event?

sleek tree
#

So if later on I’m trying to check if the event has been cancelled to run other code, it’s always already cancelled

#

Yeah yeah that’s just quick code I’m doing to showcase my point

nimble solar
#

I've personally never had this issue before

sleek tree
#

All the code worked beforehand but now in latest spigot it’s always returning false

#

Let me pull up some of the actual code

wraith thicket
#

It's because when you click the air - nothing is supposed to happen

#

The javadocs are quite clear:
"This event will fire as cancelled if the vanilla behavior is to do nothing (e.g interacting with air)"

sleek tree
#

But we have a plugin that makes stuff happen when you left click air

wraith thicket
#

Great

sleek tree
#

xd

wraith thicket
#

But that doesn't mean the event will be uncancelled, unless you set it to be

sleek tree
#

but we can't check for it being cancelled as it's always cancelled

#

can i paste some code

wraith thicket
#

?paste

sleek tree
#

i'll cut out unnecesary parts

wraith thicket
#

?paste

sleek tree
#

?paste

worldly heathBOT
wraith thicket
#

But what you can do is set the event as not cancelled in the LOWEST priority event handler

#

And then have other handlers at normal priority

lyric cypress
#

In the newest version of spigot, even with no plugins

#

there is a lot of lag

#

and the server times out

sleek tree
#

try Paper

reef sparrow
#

I hope you understand what I think

tiny pebble
#

Is there a way to check if a ConfigurationSection's keys have a key of their own all at once? Checking the keys of a key's key 🤔
Basically:

groups:
  a:
    users:
  b:
  c:
  d:

I want to check if ANY of groups' keys have users, such as a does. But I don't want to loop through, because then it checks a, then b, thenc, so on

tiny dagger
#

isSection

#

so for each configuration

#

check the keys gotten if they are sections on their own

tiny pebble
#

so just... isConfigurationSection("users")? I don't have to give a direct path? If I do give a direct path I'd have to provide whether it's a, b, c, or d

tiny dagger
#

yeah

tiny pebble
#

huh, didn't think that would work

tiny dagger
#

there is no way to just parse for those without actually knowing

subtle blade
#

But what you can do is set the event as not cancelled in the LOWEST priority event handler
And then have other handlers at normal priority
LOWEST is called second to last

#

Actually, nevermind. Ignore me lol

#

You're right haha

wraith thicket
#

It's good to be right 🙂

subtle blade
#

Proof that those priority names still fuck with me despite it being 6 years working with 'em

wraith thicket
#

They're not all that intuitive

#

@reef sparrow
You can't get a list of generated chunks. Best I can think of is to use the method I provided above and simply start from some x and y values and start iterating until some other x and y.
However, bare in mind that, you will need to spread this out between multiple ticks. Loading chunk takes time (and memory!).

tiny pebble
#

@tiny dagger Still seemed to run the way I didn't want it to. Made a check to see if the ConfigurationSection existed, and even when it existed under Section d, it ran.

#

Trying to check all 4 sections as one to see if it includes the one section

wraith thicket
#

You can't "check all sections at once"

tiny dagger
#

going backwards is much harder

tiny pebble
#

alrighty, that was the original question, i can find a way around it just wanted to know if it was possible 😛

tiny dagger
#

if there was such a method it wouldn't be done different tho

reef sparrow
#

@reef sparrow
You can't get a list of generated chunks. Best I can think of is to use the method I provided above and simply start from some x and y values and start iterating until some other x and y.
However, bare in mind that, you will need to spread this out between multiple ticks. Loading chunk takes time (and memory!).
@wraith thicket Ok and I know that this would take a lot off memory

tiny dagger
#

but do you work with files directly?

#

you should just store them in memory and save them if needed only

reef sparrow
#

But are there a method to generate a specific chunk?

wraith thicket
reef sparrow
#

But can I get the chuk when its not even generated

wraith thicket
#

No - that makes no sense

#

A chunk defines/holds the stuff that's generated within it

#

If it's not been generated, getting it would mean you'd get an empty container

#

I mean you can get it when it's not been generated, but the result will be that it will be generated and the chunk you get is the generated chunk

reef sparrow
#

I think you didnt understand me so when a chunk is never been entered by a player before can I get this chunk by getChunkAt()

wraith thicket
#

Yes, you can use the method to get it. If it's not previosuly been generated, it will be generated by calling that method

#

But again, doing that over and over again will freeze your server while this is happening and if you do it for enoug chunks, it'll crash

reef sparrow
#

Okay but can I get a chunk without trying to generate it

wraith thicket
#

@reef sparrow - no, you cannot. Like I said above, that makes no sense

#

@tranquil edge It depends on the code. Perhaps the one you're referring to uses gradle instead?

frigid ember
#
[22:37:33 WARN]: [DelayBuckets] Task #11 for DelayBuckets v1.0 generated an exception
java.util.ConcurrentModificationException: null
        at java.util.HashMap$HashIterator.nextNode(Unknown Source) ~[?:1.8.0_251]
        at java.util.HashMap$KeyIterator.next(Unknown Source) ~[?:1.8.0_251]
        at me.Lazinq.DelayBuckets.objects.Bucket$1.run(Bucket.java:54) ~[?:?]
        at org.bukkit.craftbukkit.v1_12_R1.scheduler.CraftTask.run(CraftTask.java:76) ~[server.jar:git-Spigot-dcd1643-e60fc34]
        at org.bukkit.craftbukkit.v1_12_R1.scheduler.CraftScheduler.mainThreadHeartbeat(CraftScheduler.java:361) [server.jar:git-Spigot-dcd1643-e60fc34]
        at net.minecraft.server.v1_12_R1.MinecraftServer.D(MinecraftServer.java:739) [server.jar:git-Spigot-dcd1643-e60fc34]
        at net.minecraft.server.v1_12_R1.DedicatedServer.D(DedicatedServer.java:406) [server.jar:git-Spigot-dcd1643-e60fc34]
        at net.minecraft.server.v1_12_R1.MinecraftServer.C(MinecraftServer.java:679) [server.jar:git-Spigot-dcd1643-e60fc34]
        at net.minecraft.server.v1_12_R1.MinecraftServer.run(MinecraftServer.java:577) [server.jar:git-Spigot-dcd1643-e60fc34]
        at java.lang.Thread.run(Unknown Source) [?:1.8.0_251]```
#

my plugin gives me an error but it works :/

#

at me.Lazinq.DelayBuckets.objects.Bucket$1.run(Bucket.java:54) ~[?:?] = for (Location b : blockLocation.keySet()){

#

blockLocation = hashmap name

wraith thicket
#

You're most likely removing an item from the map while iterating over it

#

Don't do that.

frigid ember
#

im replacing it with air yes

#

b.getBlock().setType(Material.AIR);

#

what should I do instead to remove it? 😐

grim halo
#

Depends. You can use a Iterator for removing elements while iterating.
Or you can create a new collection, store all elements that should be removed after iteration in it and
use the removeAll bulk operation to remove all elements in the origin collection.

#

There is also a fancy way with streams...

frigid ember
#

hmmm

grim halo
#

@reef sparrow What are you trying to do? I wrote a chunk pregenerator so maybe i can help you.

reef sparrow
#

@grim halo So i thought I can make a plugin that load a chunk than clear all entities and than unload the chunk and all this with every generated chunk so I can do a hardly entity clear when nobody is on the server
I hope you understand what I think

grim halo
#

Yes. So your problem is getten every generated chunk without generating new ones right?

frigid ember
#
                    for (Location b : blockLocation.keySet()){
                          long placeTime = blockLocation.get(b);
                          if ((placeTime + 750L) <= System.currentTimeMillis()){
                              b.getBlock().setType(Material.AIR);
                              blockLocation.remove(b);
                            }```
#

itss saying my problem is in here

reef sparrow
#

Yes. So your problem is getten every generated chunk without generating new ones right?
@grim halo Yes right

grim halo
#

Ok so the simplest way is letting the user specify a radius in chunks, then starting at -x -z and looping through x, z.
You can check if a chunk is generated with:

#

from World

wraith thicket
#

lol

#

I already told them that

grim halo
#

XD

reef sparrow
#

Yes i know but is there another way without specifiying a radius

grim halo
#

Then whats the problem? Does he want to absolutely get every chunk

reef sparrow
#

Then whats the problem? Does he want to absolutely get every chunk
@grim halo Eyery GENERATED chunk ...yes

grim halo
#

Ah ok. Thats a bit more tricky. I believe you need to read the region files then

wraith thicket
#

Which is not within the API

reef sparrow
#

F+ck...xD

#

okay than i think i wount do that anymore xD

grim halo
#

So... the files are named like this:
r.x.z...
So you got x and z. The problem is that you cant just take thos coordinates and multiply them by 4 bacause a region file could
contain 4 or only one chunk... So if you dont mind generating SOME chunks. You can just parse the file names

reef sparrow
#

Okay no thats too hard for me i think

grim halo
#

Or you combine those numbers with World#isChunkGenerated

#

Hm... ill try something.

reef sparrow
#

Ok so I dont even know how exactly I implement that IDEA in a plugin

tulip orchid
#

guys what plugin is causing anti fish farm, its like disallows u to fish in a specific place and it says there is no fish here

reef sparrow
#

guys what plugin is causing anti fish farm, its like disallows u to fish in a specific place and it says there is no fish here
@tulip orchid in 1.16 or above this is a vanilla minecraft function

tulip orchid
#

i know but my server is 1.14.4

reef sparrow
#

Oh ok

fringe cairn
#

how can I check if a persistentdatacontainer is null? it says container==null is always false, but I get null pointer exceptions when I get the container from a block thats not a tile entity

reef sparrow
#

so make an try and catch or the throw argument

#

And in the catch you return null

fringe cairn
#

arent try catches pretty expensive?

wraith thicket
#

Not all blocks have persistent data

fringe cairn
#

I need to run this check on every hopper move item event

#

I know, I want to detect if the block doesn't and skip it

reef sparrow
#

than use the throw argument I think this is not such expensive

fringe cairn
#

okay\

wraith thicket
#

You can simply check if the BlockState is an instance PersistentDataHolder

#

And if it is, cast and use #getPersistenDataContainer

#

The container will not be null

reef sparrow
#

are timing reports expensive when i turn it on and wait a hole day or something

wraith thicket
#

However, PersistentDataContainer#get may very well return null, which means the key is not set

fringe cairn
#

okay, so how do I check if blockstate is an instance of persistent dataholder

wraith thicket
#

You do an instanceof check...

grim halo
#

@reef sparrow

  public static List<int[]> loadedChunkCoords(final World world) {
    final List<int[]> coords = new ArrayList<>();

    // List region files
    for (final File regionFile : new File(world.getWorldFolder() + File.separator + "region").listFiles()) {
      final String[] split = regionFile.getName().split("\\.");
      // Parse region X and Z
      final int regionX = Integer.parseInt(split[1]);
      final int regionZ = Integer.parseInt(split[2]);
      // Loop over all potential chunks
      for (int x = 0; x < 4; x++) {
        for (int z = 0; z < 4; z++) {
          final int chunkX = regionX * 4 + x;
          final int chunkY = regionZ * 4 + z;
          // If chunk is generated add to List
          if (world.isChunkGenerated(chunkX, chunkY)) {
            coords.add(new int[]{chunkX, chunkY});
          }
        }
      }
    }

    return coords;
  }
fringe cairn
#

like this blockToCheck.getState() instanceof PersistentDataHolder?

reef sparrow
#

@reef sparrow

  public static List<int[]> loadedChunkCoords(final World world) {
    final List<int[]> coords = new ArrayList<>();

    // List region files
    for (final File regionFile : new File(world.getWorldFolder() + File.separator + "region").listFiles()) {
      final String[] split = regionFile.getName().split("\\.");
      // Parse region X and Z
      final int regionX = Integer.parseInt(split[1]);
      final int regionZ = Integer.parseInt(split[2]);
      // Loop over all potential chunks
      for (int x = 0; x < 4; x++) {
        for (int z = 0; z < 4; z++) {
          final int chunkX = regionX * 4 + x;
          final int chunkY = regionZ * 4 + z;
          // If chunk is generated add to List
          if (world.isChunkGenerated(chunkX, chunkY)) {
            coords.add(new int[]{chunkX, chunkY});
          }
        }
      }
    }

    return coords;
  }

@grim halo and this returns all generated chunks in one list?

wraith thicket
#

@fringe cairn Yes

grim halo
#

Im not 100% sure if the chunks line up like this but i think it will list all chunk coordinates of the world

#

But its quite a heavy method. You should probably disect it and split the task over several ticks.

wraith thicket
#

Don't regions have 32 chunks, not 4?

reef sparrow
#

Yeah but did I get also the non generated chunks in this list

grim halo
#

Ah

wraith thicket
#

Well, 32 x 32 chunks

grim halo
#

right. drives_a_ford is right

#

So replace the 4s with 32s

#

Try reading the code line by line including the comments. Then you should be able to answer your question yourself.
If not: Dont use this code or you might freeze your server.

#

I kind of eyeballed them

#

Should be fine though

lapis plinth
#

Anyone here familiar with NMS?

#

How do I import it to my maven pom.xml, etc

paper basin
#

skip the "repo" section

grim halo
#

If you run BuildTools then the source code should be installed in your maven repo.

lapis plinth
#

O shit

#

was i supposed to use buildtools within the project folder?

wraith thicket
#

No

frigid ember
#

no

lapis plinth
#

huh

wraith thicket
#

It'll install the necessary things in your local repo, for me it's the .m2/repository folder. And Maven will know to pull from there.

lapis plinth
#

Ah ok

#

so whats the import thingy?

#

like whats the dependency and repository

zealous shore
#

mavenLocal() is the repository

wraith thicket
agile girder
#

Help

#

My server starts and then my whole nodes shuts down

#

The penultimate line of that log shows the "Can't keep up! Is the server overloaded? Running 7066ms or 141 ticks behind"

fringe cairn
#

how can I tell if a block is a double chest?

grim halo
paper basin
#

does Entity#getTicksLived() returns the amount of ticks from when the entity has spawned, or does it return the amount of ticks where the Entity#tick method has been called?

agile girder
#

That's not the error, I already removed that plugin and try to run the server

subtle blade
#

mfw "BUILDTOOLS SHIT" lol. 11/10 directory name

grim halo
#

@NarutoGames1 Then... dont show us an old log...

agile girder
#

Well

#

My server keeps crashing

#

I mean

#

My Node keeps shutting down

agile girder
#

I can't get a new Log

keen compass
#

@paper basin returns the amount of ticks it has been alive since it was spawned

lapis plinth
#

Lmao buildtools shit best folder name

paper basin
#

@keen compass yeah but I mean
it can be alive without being ticked by the server

keen compass
#

it is an nbt data that gets stored with the entity

#

not exactly possible to not tick an entity entirely

#

usually what it means by not ticking entities, is that it isn't doing anything with its AI

paper basin
#

in my case it's a projectile, I want to check if the projectile is moving or not because out of range

grim halo
#

Every entity gets ticked unless its not loaded...

keen compass
#

That is pretty much what I said

paper basin
#

then comes my question: Entity#getTicksLived() will return the same value again and again unless the server starts ticking it again, right?

keen compass
#

no

#

it always gets updated

paper basin
#

aw

keen compass
#

I stated what it means to not tick entities

#

it refers to their AI

paper basin
#

well, I will test and tell you

keen compass
#

Its an NBT data part of all entities

#

gets saved when they are unloaded

paper basin
#

but the projectile entity isn't unloaded

keen compass
#

then it won't get saved until then, but doesn't mean it won't update the ticksLived() lol

paper basin
#

Entity#isValid returns true

keen compass
#

anyways if you want to know if an arrow is still moving, not sure how exactly you are doing this

#

but you could just use its velocity

paper basin
#

well, I was right

#

Entity#getTicksLived() freezes when the entity is no longer ticked because too far away from players

#

no, the projectile's velocity stays the same in that case
the entity is just no longer moved

keen compass
#

technically when you get too far away from players it gets unloaded

#

its the same thing with chunks. Chunks don't immediately get unloaded, but they go in a sort of cache first for a bit of time before being fully unloaded. But entity activation range affects when entities will get unloaded

paper basin
#

maybe it does not work like this for projectiles

tiny pebble
#

I am aware that I keep asking this in different forms, but here goes.

With getKeys(true), I receive all of the keys as well as their keys. Such as: keya keya.keyb keya.keyb.keyc. So, is it possible to check if anything consists of one key? Like, *.keyc? rather than specifying the path?

If it isn't possible then that's fine, I just want to find a way around my problem haha

keen compass
#

what exactly is your problem?

paper basin
#

no, #getKeys(boolean) returns just a map, not a searching algorithm

#

you will have to code one yourself or find a good one on the internet

keen compass
#

keyc doesn't necessarily mean it is the same key as a key that belongs to the path before that one. So you can technically have two keyc's but they are both different

#

what you can do however, is create loops using getKeys()

wraith thicket
#

In order to check if there's anything ending with .keyc, you'll need to iterate over the Set of returned keys and check

keen compass
#

a better more optimal way would probably to memory map the file and check it that way instead of using yaml and some regex to do it. But either way works lol. But maybe you could explain why you would need something like this? o.O

#

you can dynamically loop through paths without actually hardcoding the path btw

wraith thicket
#

It's probably because they've not thought through their data scheme enough

tiny pebble
#

I'm doing a check to see if a ConfigurationSection named users exists within any key, and if it doesn't I want it to create one that I consider it being its default. Though I'm pretty sure I found a work-around not requiring all of this confusion lol

keen compass
#

that is a possibility and probably the case

tiny pebble
#

and yeah that too probably

#

considering I'm only a few months into coding with java, that is most likely the case 😂

wraith thicket
#

If you need to search some data, a database is also a great tool 🙂

keen compass
#

You could re-organize your data so that you don't actually have to do that

wraith thicket
#

should*

terse locust
#

how does nested Serializables work.
For example,

public Map<String, Object> serialize() {
  Map<String, Object> map = new HashMap<>();
  map.put(KEY, anotherSerializable);
  return map;
}

How does spigot pass the anotherSerializable back?
If I got the Map<String, Object from spigot in my deserialize method, what should I expect to find when I do map#get(KEY)?

#

sorry for cutting in btw

tiny pebble
#

Ah okay, I'll look for a better way to organize it

keen compass
#

Anyways your options are either read the file line by line, which is the more optimal method but harder to code or you can create recursive loop to find what you are looking for

tiny pebble
#

no worries, pretty sure that was the solution

keen compass
#

@terse locust there is two answers to that, either it means another object that is capable of being serialized or because of the vagueness you gave it means an object that has already been serialized.

#

so you can either expect an object that can be serialized

#

or serialized data of an object

terse locust
#

right

#

I meant the raw unserialized serializable

tiny pebble
#

Also I do just want to say thank you for being so kind and patient with me :)
I know not everything I ask is confusing, but some of it is when I'm overworked. Not many servers respond well when I speak nonsense, but thanks for helping me!

terse locust
#

so I can expect to get a Map<String, Object> which I can deserialize myself then?

keen compass
#

You are welcome, most of us here are patient 🙂

#

You mean which you can serialize if you are talking about unserialized serializable

terse locust
#

I'm trying to deserialize

#

serializing is not so much the issue

keen compass
#

Then the answer is what you said

terse locust
#

righty, thanks

frigid ember
#

best event for checking boats placed?

wraith thicket
#

PlayerInteractEvent most likely

graceful shard
#

Hey guys, Im trying to set permissions from my plugin using attachment.setPermission(permission, true); that kinda works, like when given the permission a player can execute the commands, but the client doesnt show its possible. (It just makes the message red as you are writing and says it is an error)

#

do i need to do something else?

keen compass
#

doesn't it also throw an entity spawn event as well @wraith thicket ?

wraith thicket
#

I'd assume so, but the interact event could allow you to retain the boat

#

It depends on what they want to do, though

#

But since they wanted the "place" event, I figured that one was more appropriate

frigid ember
#

VehicleCreateEvent?

#

or is that something different? 😐

#

easiest thing is I think indeed playerinteractevent check entity in hand & check if it right clicks on water

wraith thicket
#

That one should work as well

keen compass
#

that would work too

wraith thicket
#

But it all depends on what you want to achieve

keen compass
#

boat extends Vehicle

frigid ember
#

ohh than I'll try that

#

I want it to remove vehicles after x seconds

#

but no one has to be in it for the timer to start

covert bronze
#

@graceful shard try calling Permissible#recalculatePermissions

keen compass
#

then that would be the best event to use then

frigid ember
#

ok I'll work with that one 🙂

keen compass
#

actually I lied

frigid ember
#

:/

keen compass
#

@frigid ember best event to use for your case is VehicleExitEvent

#

since you want the timer to start when they exit

frigid ember
#

but what if the player places it and doesnt actually enters te vehicle

keen compass
#

could use both 😄

graceful shard
#

@graceful shard try calling Permissible#recalculatePermissions
@covert bronze hm that didnt seem to help

frigid ember
#

:p

keen compass
#

Well now you have two events to use to your advantage 😉

#

good luck

#

can use the createvent for a timer if they don't enter it. Cancel the timer if they do. When they exit, create a new timer for when to remove it.

frigid ember
#

VehicleCreateEvent doesnt has a player variable :/

#

only vehicle

#

How would I check if there actually are players in the vehicle

keen compass
#

getPassengers()

#

so getVehicle().getPassengers()

graceful shard
keen compass
#

for the create event you can get the vehicles location and detect players nearby

#

players are not going to be farther then about 2-3 blocks

undone narwhal
#

Is there TerrainGenerator for 1.16?

frigid ember
#

if (e.getVehicle().getPassengers() != e.getVehicle().getLocation().add(2, 2, 2)) {

#

so something like this

keen compass
#

to detect players?

frigid ember
#

to detect if they are in a range of the vehicle

#

of 2b

keen compass
#

getPassengers() returns a list of players or player in a vehicle, not outside of it

#

for outside of it, you would create a loop to check 2-3 blocks away

#

for players

#

this is one of those use cases where the optimal way to loop is to use bitshifting, but if you don't know what that is I recommend to stick with the traditional way of looping 😛

frigid ember
#

well I rather just delete it after 5min if the player isnt inside

#

so not even a range

keen compass
#

actually a better way is to grab the chunk from the boats location, and use getNearbyEntities. And only grab the players

#

and see how far they are from said boat