#help-archived

1 messages ยท Page 46 of 1

frigid ember
#

yep

lusty vortex
#

Why not just make a local server on your computer?

frigid ember
#

oh,

junior acorn
#

looking for a plugin that will generate a nether end for every world so if they go through portal in mine world for resources compared to main world nether where it might be more protected and meant more for home building

#

is this possible, please let me know i would really appreciate it

median wing
#

@junior acorn Could you elaborate more clearly? I don't quite understand what you mean

lusty vortex
#

Possible, but I've never seen a plugin that does that

median wing
#

Is he looking for a different nether world with custom resources than the main nether world?

junior acorn
#

per world portal

#

to put it simply

lusty vortex
#

Per world nether, or per world portal

junior acorn
#

per world nether

median wing
#

oh so each world would have a different nether that gives different resources?

junior acorn
#

yes exactly

#

wondering if this is possible

lusty vortex
#

yes

median wing
#

That's actually a nice idea

#

it is possible

lusty vortex
#

But you need to either make it, or have someone else do it

median wing
#

@junior acorn do you mean like having custom mobs or like chests and structures?

#

per world nether

junior acorn
lusty vortex
#

I would just make a separate server for each "world" at that point

junior acorn
#

but that is outdated

lusty vortex
#

Still outdated?

junior acorn
#

havent tested it on latest

#

i would have to try it

median wing
#

interesting idea though

junior acorn
#

for example if you go to a nether portal in world mine you would go to mine_nether but if you go to nether portal in world spawn you would end up in spawn_nether where you can setup where this would be disabled and enabled and other settings

#

that is the best way i can explain it

atomic niche
#

i dont know how to find the plugins folder

median wing
#

you could do something though, it may not be the real nether, maybe have someone build a different nether for each world set it up with multiverse and have different things in them., that could be an easier way.

#

for each world

atomic niche
#

can someone help me i downloaded a enchant all command plugin but i dont know where to put it for it to work

median wing
#

@atomic niche Do you not see a plugin folder in your server?

atomic niche
#

i just dont know where to find it

median wing
#

screenshots?

atomic niche
#

ooooooooooh now i see it sorry ๐Ÿ˜…

median wing
#

It's all good haha

#

btw @lusty vortex thank you very much for your help, it worked!

junior acorn
#

some of the plugins were premium plugins the old versions were free but sometimes when they continue the plugin they start charging, i have to find other ways around by that i mean other plugins still working on my server having trouble finding certain replacement command for essentials still

median wing
#
                    for (int y = -1; y<= 0; ++y) {
                        for (int z = -1; z<= 1; ++z) {``` anyone know how I can make this for loop do a 3x3x1?
#

right now it's doing a 3x3x2

junior acorn
#

i dont understand that language, is that java code?

median wing
#

Yah

#

it's Java

frigid ember
#

@median wing you've got it set up to do -1, 0, 1 then -1, 0 then -1, 0, 1

#

Remove the y loop if you'd like to do only one there?

median wing
#

@frigid ember Isn't it already -1,0,1 then -1,0 then -1,0,1?

frigid ember
#

That's what you're doing yeah, but you asked for how to make it into a 3x3x1

#

So remove the Y loop

#

You only need 1 value, not the two

#

@median wing When you say 3x3x1 do you mean x * z * y?

median wing
#
                    for (int y = -1; y<= 0; ++y) {
                        for (int z = -1; z<= 1; ++z) {
                                assert dirblock != null;
                                block.getLocation();
                                dirblock.getRelative(x,y,z).breakNaturally(explosive_pickaxe);
                                player.playSound(player.getLocation(), Sound.ENTITY_GENERIC_EXPLODE, 30, 0);```
#

this is my code

frigid ember
#

@median wing When you say 3x3x1 do you mean x * z * y?
@frigid ember

median wing
#

yah

#

like this

frigid ember
#

In that case you only need 1 value; right now you're doing y = -1 and y = 0, so instead just pick one

median wing
frigid ember
#

Do you want y = -1 or y = 0?

#
 for(int x=-1; x<=1; ++x) {
                        for (int z = -1; z<= 1; ++z) {
                                assert dirblock != null;
                                block.getLocation();
                                dirblock.getRelative(x,-1,z).breakNaturally(explosive_pickaxe);
                                player.playSound(player.getLocation(), Sound.ENTITY_GENERIC_EXPLODE, 30, 0);```
median wing
#

Oh okay

frigid ember
#

Because your loop as you said was doing -1,0,1 then -1,0 then -1,0,1?, so of course it'd break two blocks - you only want one y value, so you make it
-1,0,1 then -1 then -1,0,1 or -1,0,1 then 0 then -1,0,1

median wing
#

Ah, it makes more sense now

#

thank you

#

I'm a try it out now real quick

#

I'll tell ya if it works

frigid ember
#

Np gl

median wing
#

It didn't work

#

idk why

cold wharf
#

Is it possible to get player's time played?

frigid ember
#

how do you cast an nms entity to a org.bukkit.entity.Entity

whole prism
#

doesnt NMS entity have getBukkitEntity?

lusty vortex
#

@frigid ember Just getBukkitEntity()

#

Bukkit Entitiy's don't extend the NMS entitiy. It's just a wrapper

frigid ember
#

oh

#

thanks

#
net.minecraft.server.v1_8_R1.Entity en = wor.a(id);
org.bukkit.entity.Entity entity = en.getBukkitEntity();```
#

basically that

lusty vortex
#

Yeah

frigid ember
#

now i am makign something

#

trying to support many versions

#

its so tiring

#

i must manually import each version

lusty vortex
#

Yup

frigid ember
#

I don't want to use reflection

#

lol

#

for each version

lusty vortex
#

Most people just use the same folder naming scheme as bukkit

#

Then load it through some means

frigid ember
#

what

lusty vortex
#

As in

#

myplugin.v1_8_R1.CustomPig
myplugin.v1_8_R2.CustomPig

#

ect

frigid ember
#

ok, i heard reflection is slow, what makes reflection slow

#

i want to have my stuff optimized as possible

#

i was so used to reflection

lusty vortex
#

The fact it's not straight bytecode

#

field lookup, ect

#

Rarely, if ever gets hit by the JIT

frigid ember
#

ok

#

can you explain why straight bytecode is better

digital sphinx
vast hinge
#

Probably

frigid ember
#

how do i cast a org.bukkit.entity.Player to an net.minecraft.server.....*.*EntityPlayer

#
net.minecraft.server.v1_8_R1.EntityPlayer ePlayer = ((org.bukkit.craftbukkit.v1_8_R1.entity.CraftPlayer)player).getHandle();```// like this?
#

player is an org.bukkit.entity.Player

#

will this work or nah

#

Is it possible to get player's time played?
@cold wharf Yes with the normal minecraft statistic, placeholderapi has a placeholder for it
(Sorry Retrooper, not ignoring you: personally have no clue)

#

It didn't work
@median wing Were you able to get it to work? If not send over your code

cold wharf
#

@frigid ember how do I get that?

#

How do I access the API?

frigid ember
#

ok

#

i think im correct

#

i am probs

#

thanks for responding tho

#

OfflinePlayer#getStatistic(Statistic.PLAY_ONE_MINUTE)

public static final Statistic PLAY_ONE_MINUTE
Name is misleading, actually records ticks played.```
#

So when you get that, divide by 20 and you have the seconds they played, etc etc.

cold wharf
#

Divide by 20

#

?

median wing
#

@frigid ember I got it to work afterwards I just had to use 0 instead of - 1, thank you so much I appreciate it!

frigid ember
#

@median wing ahh okay have fun!

#

Yes @cold wharf 1 second = 20 ticks

cold wharf
#

Ahh got ir

#

It*

#

I read it in docs it is in ticks oki

#

So I will have to completely code the playtime by using seconds? Like converting it to minutes then hours, days, etc...?

frigid ember
#

hello How do I access the int variables in PacketPlayOutEntityVelocity?

#

@lusty vortex ?

#

they are all private

#

(without reflection)

lusty vortex
#

@frigid ember You need to use reflection

frigid ember
#

ok

lusty vortex
#

๐Ÿคทโ€โ™‚๏ธ

frigid ember
#

:c

lusty vortex
#

Some stuff it's unavoidable

frigid ember
#

ok

lusty vortex
#

Just cache the field

frigid ember
#

i didnt ?

lusty vortex
#

So you aren't constantly looking it up

frigid ember
#

whats that

#

i never used hashChache

#

orwhatever]

lusty vortex
#

Like set the "Field" object to

#

Field myField = <here>

#

U get what I mean?

frigid ember
#

yes?

#

ik fields

#

but idk chaching

#

ima just use reflection

tiny dagger
#

fields are a part of what reflections are tbh

frigid ember
#

i said ik fields

lusty vortex
#

I mean cacheing as

#

Maintain that field somewhere

#

So you don't have to constantly get it

frigid ember
#

ok

#

Oh

#

ok

#

good idea

tiny dagger
#

set it outside the method as a static private

frigid ember
#

thanks for repeating

#

jk

#

ok

tiny dagger
#

i've said more but okay :p

frigid ember
#

why static

#

I just said jk

#

changed mind

tiny dagger
#

static

frigid ember
#

i said why static

tiny dagger
#

as in you don't have to init it every time you call a new object

#

it's initiating the first time you interact with that class and that's that

frigid ember
#

ok

#

i see

tiny dagger
#

that's the proper use of the static keyword imo

frigid ember
#

i got the point

#

can u perhaps be like less repetitive, like when i say i see or i got it i got it

silk bane
#

MethodHandle gang

tiny dagger
#

well i just make sure you get it :p

frigid ember
#

ik

#

i see your point

thick lintel
#

how do i create a custom dragon (or 4) in game with a plugin/with code? or is it impossible?

tiny dagger
#

i hope you have in mind nms because i doubt you can make a dragon do exactly what you want by using bukkit

silk bane
#

choco made a lovely dragonbattle api which lets you do a few things

#

you don't get full control tho

frigid ember
#

then make your own bro

silk bane
#

no bro

frigid ember
#

ok

#

bro

#

fork his version @silk bane

silk bane
#

no bro u do it bro

frigid ember
#

no you are the one who says it doesnt give you full control

#

I don't need it xd

silk bane
#

i don't need it either bro

#

i'm just stating facts bro

frigid ember
#

ok

#

bro

vast hinge
#

chill bros

frigid ember
#

ok sis

rigid nacelle
#

Step bros

cursive flax
#

Hello, does anyone has a good tutorial about creating a basic minigame ?

frigid ember
#

You cant have two in a row dont ask me why

#

ChatColor.GREEN + "" + ChatColor.BOLD

#

#general already answered

#

ask james gosling

#

lmao

#

please do not post it in here too

#

I'd say choose to only post your question here or only on the forum.

lusty vortex
#

private static final HandlerList handlers = new HandlerList();

#

public static HandlerList getHandlerList() {
return handlers;
}

#

public HandlerList getHandlers() {
return handlers;
}

frigid ember
#

he had that

#

oh

lusty vortex
#

No

#

He does super.

frigid ember
#

unoveride them

#

yea

#

i just quickly ran over the code and was confused why it nulled

#

they have nice docs

#

im not too familiar with their api tho, sorry

bronze marten
#

Could you link me to their docs? Only found the enginehub thing tbh

frigid ember
#

what you sent are the ddocs anyway

#

havbe a look at examples sicne i see you have looked at the concepts

bronze marten
#

Hmm I think I fully looked through their doc thing and did not find anything about an AbstractDelegateExtent example or sth

frigid ember
#

hm

#

is registering neede

#

needed

bronze marten
#

yes

#

Thats done using the EventBus#register()

frigid ember
#

ok so u registered.

#

hm, idk I don't use worldedit api xd

bronze marten
#

But I don't think registering is the problem here because 1 is printed to the console in the @Subscribe block

frigid ember
#

what about 2

#

did you register 2

bronze marten
#

its not, thats my q about haha

frigid ember
#

im talking about 2 here, isnt 2 the problem

#

idk

#

LMao

bronze marten
#

but you dont register an Extent

#

you register ur listener which listens for EditSessionEvent, and I just set the Extent of that event to my extent

frigid ember
#

ok

bronze marten
#

ill try their discord xd

frigid ember
#

they have one?

#

why ask a spigot community lmao

#

about worldedit api

bronze marten
#

link invalid @_@

#

bruh nvm

#

discord acting stupid

frigid ember
#

any better plugin than advancedban for bungeecord?

#

User purplexdev has disconnected, reason: Internal Exception: java.lang.NoClassDefFoundError: net/minecraft/server/v1_8_R1/World

I get this console eror when I attempt to join, I didn't import World class anywhere tho, but my server is spigot 1.8.8

#

fnaly

silk bane
#

v1_8_R3 is 1.8.8

lusty vortex
#

U need to find the full exception

frigid ember
#

ik

#

where

#

thats all i get

#

i dont see any line

lusty vortex
#

Maybe turn on debug

silk bane
#

v1_8_R3 is 1.8.8

lusty vortex
#

debug=true

#

In properties

#

server.properties

frigid ember
#

okl

crimson sandal
#

Hey does anyone know how I can make Maven get the current version based on the current version in plugin.yml

#

I'm using the Plugin-annotations library too

frigid ember
#

what

#

get what current version?

crimson sandal
#

Of the plugin, my update checker uses the latest version on spigotmc and last time I forgot to change the value so I had to wait another 24 hours for bukkit to approve the update.

#

@Plugin(name = "ChestsPlusPlus", version = "1.15 v1.3")

#

So I'd like Maven to append 1.15 v1.3 to the current jar

#

I'm not sure if Maven can read any variables directly from classes though?

hoary parcel
#

Define the version in maven and let maven replace a var in your source

crimson sandal
#

That would make more sense

inland meteor
#

any better plugin than advancedban for bungeecord?
@frigid ember LiteBans is pretty good

frigid ember
#

thanks

#

anyone knows scoreboard-r alternative? now on 1.15.2 it's just spamming your console :/

sturdy oar
#

You can reach mojang api

#

I've done that once with NodeJS, wasn't hard either

urban glacier
#

Hi do anyone of you use UltimateHome?

#

Hi do anyone of you use UltimateHome? if yes how did you use it without op everyone thx

dusty topaz
pallid sapphire
#

Are there any plugins that add various clothes?

vast hinge
#

Clothes?

pallid sapphire
#

Please tell me if anyone knows.

#

yes

#

dress

#

various dress

#

plugins

#

outfit plugins

#

isnt it..?

wanton delta
#

Uh what ?

frigid ember
#

i keep getting internal exceptions

#

when listening to packets

jade frigate
#

how to make a void world

sturdy oar
#

there are many different ways

jade frigate
#

and which plugins do I need?

#

so

sturdy oar
#

you don't need plugins tbh

jaunty night
#

Through plugins or through server settings

jade frigate
#

I think I already have multi verse core, isn't there another plugin extention to that?

jaunty night
#

Cause you can just create an empty superflat world and boom

sturdy oar
#

you can use server.properties' generator settings with a custom world

#

or a plugin if you're not comfortable with that stuff

jade frigate
#

does anyone know anything about multi worse core?

jaunty night
#

There's a thread on it somewhere

#

Hold on lemme find it

frigid ember
#

thanks for ignor me

sturdy oar
#

no problem

frigid ember
#

yup

jaunty night
#

As much as I love 1.8, don't expect people to support outdated versions.

jade frigate
#

I'm on 1.15

frigid ember
#

i never imported 1.8

#

thats the issue

#

i explained dat

jaunty night
#

I wasn't talking to you k9

jade frigate
#

i see

frigid ember
#

it gives me noclassexception, for importing 1.8, but i didnt

#

it led to an empoty constructor

#

the whole project

#

i didnt import

#

1.8

jade frigate
#

Atom do you know anything about the multiverse core plugin?

jaunty night
#

Not really

sturdy oar
#

I've used MultiVerse plugin

jade frigate
#

lemme see

#

@sturdy oar my friend said that he used the same and it didn't work

sturdy oar
#

then your friend doesn't know how to use it I guess

jade frigate
#

I invited him to the server now @sturdy oar

sturdy oar
#

well you should just contact that resource's author, I'm not the one who made it.

jade frigate
#

wait he can't write until 8 minutes

sturdy oar
#

otherwise just learn how to use level-type and generator-settings in the server.properties

#

pretty sure you can cleate void world from there

hot fable
#

How can I transform from string Location{world=CraftWorld{name=Survival},x=936.3635795673218,y=70.0,z=63.546793984847405,pitch=12.006668,yaw=-1.1398733} to Location?

sturdy oar
#

you are reading from json?

hot fable
#

no

#

getting from sqlite

lusty vortex
#

Anyone ever have issues with SMTP emails?

#

Mine will send to 90% of email services. But when it comes to foreign emails, even just a foreign yahoo domain, it doesn't reach

frigid ember
#

How can I delete my spigotmc account?
I've already sended mails to deletion@spigotmc.org or at support@spigotmc.org but didn't get an answer for weeks. I also reported my account with the reason "delete me".
What can I do?

#

when ddi u send a mail

#

to deletion

#

About 4 weeks ago

#

wow

#

Or maybe even a bit longer

#

report your account

#

for deletion

#

Already done

#

But nothing happend

tiny dagger
#

maybe.. wait?

frigid ember
#

Yes about 4-6 weeks ago...

tiny dagger
#

then you didn't explained clear enough why you want it deleted

frigid ember
#

But I told them why it's important for me to delete the account

vernal spruce
#

How do you guys save config to also contain comments?๐Ÿค”

#

are you using a writer rather than the api?

tiny dagger
#

probabily they copy it directly from inside the jar?

vernal spruce
#

hmm

frigid ember
#

Do you guys have any idea what I can do to delete my account? :/

vernal spruce
#

why?

subtle blade
#

Is it terribly urgent? I can't imagine it is

frigid ember
#

Yes for me it's terribly urgent, because of personal reasons

subtle blade
#

Your life depends on the deletion of your spigotmc account?

vernal spruce
#

monkaS

tiny dagger
#

inb4 yes

frigid ember
#

@subtle blade no... what does such an answer brings...

#

But for me the deletion of my account is important...

vernal spruce
#

You see.. problem is with what you posted,your account can be anonymised,so the posts will remain but the account can't be used anymore..

subtle blade
#

From all the account deletion requests I can see, none of them are urgent as the majority of them have no forum posts and no public contributions

#

It's not urgent

#

That being said, md is the only one who has the ability to delete accounts. He will get to it whenever because you have to realize that you are on a public service

trim void
#

Context: I'm running SpigotMC on a Raspberry Pi 4. It's connected via ethernet directly to the router. The public IP has a domain name assigned to it configured specifically for a Minecraft server.
Problem: Late last night the wifi shutdown. I assume ethernet continued to work as this morning I found that the wifi would restore upon disconnecting the Pi from ethernet. Reconnecting the Pi via ethernet does not cause direct problems, however any attempt to ssh or even connect to the pi shuts the wifi down. Also worth noting that the Pi connected via ethernet worked fine for several hours, but started having problems just over an hour after the public was assigned to a domain name. That being said, the server worked for well over an hour before seeing network issues.

subtle blade
#

SpigotMC does not collect any personal information nor does it distribute it, if that was your concern

vernal spruce
#

why are you running a minecraft server on a microp?

subtle blade
#

Anything available to SpigotMC is public on your profile which is all changeable

trim void
#

beside the point

subtle blade
#

(except birthdate which isn't, for some reason lol)

#

We serious don't recommend running a server on a pi. It was not designed for that and they often fail as a result

blissful verge
#

How could I make a plugin which increases the enchantment level of the item in your hand, depending on what you wnat

#

So basically you can enchant a pickaxe by 1 extra level in effiency

vernal spruce
#

you loop through all enchantments,remove the one and add it again with 1 level higher?

subtle blade
#

Get enchantment level, +1, remove enchantment, re-set enchantment

#

;P

blissful verge
#

well

trim void
#

It's an experiment, for very low user counts

blissful verge
#

I suck a coding

#

I guess not happening

frigid ember
#

Yes... but it is possible that they delete my account?

subtle blade
#

Only md_5 and he does it whenever he gets the time

#

More often than not, it's not a pressing matter

frigid ember
#

anyone knows something like scoreboard-r but with 1.15.2 support and not spamming into your console every few minutes?

#

Yes I understand this :)
But do you think he will delete my account when he reads my email?

vernal spruce
#

spamming your console? have you reported that issue?

cloud sparrow
#

That can take awhile so don't expect it anytime soon though if you sent a email.

subtle blade
#

If the account has no significant contributions, generally it's fine for deletion

#

It's just a matter of whenever md has the time

frigid ember
#

Ok thanks a lot!!
Now I'm a bit calmed down ๐Ÿ˜‰

trim void
#

I suppose because the Pi is not reccomended there is no support to be had on this issue

vernal spruce
#

well its a microprocessor

#

its not supposed to be used for this

#

also Arduino king

subtle blade
#

Well it's not that it's not supported. It's just that there are significant cons to running it on a pi

#

Storage and performance being the biggest issues

vernal spruce
#

would a pi burn with 1.14? ๐Ÿค”

#

dem chunks

frigid ember
#

So just looking for a general opinion... If I re-developed a semi-original game I have to have a similar gameplay of a mix between Mineplex's and Hypixel's Cakewars/Bedwars, would that be of interest to anyone? I feel like it would be redundant, but at the same thing I believe it would make my game a bit more interesting and give it more dynamic.

cloud sparrow
#

The latest that can run on a Pi is 1.12.2.

vernal spruce
#

@frigid ember people copy minigames from others always

#

they are always interested for others

cloud sparrow
#

Anything above isn't possible without issues.

trim void
#

Despite that, I donโ€™t believe this problem has anything to do with the Pi specifically.

cloud sparrow
#

And is unstainable for the Pi to handle.

vernal spruce
#

i mean

#

compare a dedicated hardware to the pi

nocturne glen
#

โ˜น๏ธ

trim void
#

This is a network related problem, perhaps something to do with port forwarding

nocturne glen
#

mh

cloud sparrow
#

I wasn't saying that wasn't the issue I was talking about running 1.14 on a Pi isn't suggested as it won't be sustainable.

trim void
#

Still beside the point

#

Id like to understand the problem so I may avoid it regardless of how I decide to run my Pi

#

Which, full disclosure, Iโ€™ll seriously reconsider using it to run the server based on your advice

dusky herald
#

Does net.md_5.bungee.api.chat classes, the BaseComponent, TextComponents and all that work without having BungeeCord on the server?

tiny dagger
#

isn't that a library on itself?

#

i'm pretty sure it is

dusky herald
#

I havent tested yet, just curious.

#

That's what I was thinking.

subtle blade
#

Yes it does

#

It's shaded into Spigot

main cave
#

(but minimessages is better)

tiny dagger
#

how's the time complexity?

verbal silo
#

@scarlet nova it looks like a plugin named ultimatefriends is the problem

scarlet nova
#
16:18:22 [SEVERE] Exception in thread "main"

16:18:22 [SEVERE] java.lang.ClassCastException: java.lang.String cannot be cast to java.util.Map

16:18:22 [SEVERE] at net.md_5.bungee.conf.YamlConfig.getListeners(YamlConfig.java:253)

16:18:22 [SEVERE] at net.md_5.bungee.conf.Configuration.load(Configuration.java:85)

16:18:22 [SEVERE] at net.md_5.bungee.BungeeCord.start(BungeeCord.java:273)

16:18:22 [SEVERE] at net.md_5.bungee.BungeeCordLauncher.main(BungeeCordLauncher.java:62)

16:18:22 [SEVERE] at net.md_5.bungee.Bootstrap.main(Bootstrap.java:15) ```
#

Can someone help me

#

@verbal silo I don't have that problem anymore, I think

verbal silo
#

ok

scarlet nova
#

how can I fix that?

subtle blade
#

Looks like a stupid plugin being stupid

#

Send the stacktrace their way

scarlet nova
#

what?

subtle blade
#

The plugin UltimateFriends is causing that issue. Send the error to the author of that plugin

scarlet nova
#
16:18:22 [SEVERE] Exception in thread "main"

16:18:22 [SEVERE] java.lang.ClassCastException: java.lang.String cannot be cast to java.util.Map

16:18:22 [SEVERE] at net.md_5.bungee.conf.YamlConfig.getListeners(YamlConfig.java:253)

16:18:22 [SEVERE] at net.md_5.bungee.conf.Configuration.load(Configuration.java:85)

16:18:22 [SEVERE] at net.md_5.bungee.BungeeCord.start(BungeeCord.java:273)

16:18:22 [SEVERE] at net.md_5.bungee.BungeeCordLauncher.main(BungeeCordLauncher.java:62)

16:18:22 [SEVERE] at net.md_5.bungee.Bootstrap.main(Bootstrap.java:15) ```

@scarlet nova This error?

#

is caused by ultimate friends?

#

@subtle blade

subtle blade
#

Yes, but send the paste you'd sent in #general

#

More context = better

#

That small snippet there doesn't tell us anything, but the pastebin does

scarlet nova
#

ok

subtle blade
#

Yea, I know. Send it to the author of UltimateFriends lol

#

It's a bug from that plugin

scarlet nova
#

uh, ok

subtle blade
#

The one you sent initially

lilac echo
#

Hi, i have problem i'm not getting notification when new plugin or resource getting update

scarlet nova
lilac echo
#

@subtle blade

scarlet nova
#

@subtle blade I removed Ultimate Friends And It's still showing the error!

gloomy magnet
#

hello. I purchase a resource but am not able to download the plugin, it still prompts me to make purchase

hoary parcel
#

Contact the author

vast hinge
#

imagine having wings and not being able to fly @verbal silo

boreal tiger
#

I'm using a bukkit runnable to spawn entites from a queue. Sometimes I have to spawn n entities of the same type.
To avoid adding duplicates to the queue my queue consisted of a ConcurrentLinkedQueue with a pair of Enemy (the class which holds the entity type) and Integer (the amount of Enemies to spawn of that same type).

However this defeats the purpose of the queue to spawn entities in a more controlled way.

Using Collections#nCopies works but this seems like a waste of memory. Does Collections#nCopies just create a collection with n references to the same instance or does it make a new copy of that instance n times?

#

The javadoc says Returns an immutable list consisting of n copies of the specified object. The newly allocated data object is tiny (it contains a single reference to the data object).

hoary parcel
#

What's wrong about duplicates in your queue?

wraith apex
#

^

boreal tiger
#

nothing wrong I was just wondering if Collections#nCopies would be wasting memory

hoary parcel
#

I would just keep the queue with duplicates entires

#

As it will also have your order and stuff

boreal tiger
#

cool ๐Ÿ‘Œ . The javadoc says The newly allocated data object is tiny (it contains a single reference to the data object).
Does this mean it doesnt create an entirely new instance?

#

just tested it ๐Ÿ‘ it does use the same instance

vivid imp
#

Please help:
Console sending:
.................................................................................

In FTP files:
bin
boot
dev
etc
home
initrd.img
initrid.img.old
lib
lib32
lib64
libx32
lost+found
media
mnt
plugins
proc
root
run
sbin
srv
sys
tmp
urs
var
vmlinuz
vmlinuz.old
at.cpu.txt
deploy.sh
installimage.conf
installimage.debug
log.cron
logb.txt
logb2.txt
t_cpu_ms36.txt
tmpc.txt
tsql.txt

narrow crypt
#

Could someone help me , im probably doing something wrong, Im saving chests to chestloot.yml and get them later.
but somehow when i save them first with: chestloot.set("loot." + args[0].toString(), chestinv);
where args[0] is the name given by user and chestinv is the chest inventory
Now when i try to get it with:

@SuppressWarnings("unchecked")
         List<ItemStack> theinv = (List<ItemStack>) chestloot.get("loot." + args[0].toString());
         ItemStack[] invarray = (ItemStack[]) theinv.toArray(new ItemStack[theinv.size()]);
``` it doenst work and gives the error:
```console
java.lang.ClassCastException: [Lorg.bukkit.inventory.ItemStack; cannot be cast to java.util.List

but it does work on chests i saved before a restart/reload

subtle blade
#

You'll probably want to getList() instead

lusty vortex
#

Is it even possible to get an ItemStack list from the config? I thought it was only individual entries

subtle blade
#

Sure. A Yaml list is just a list of objects

#

If they're serializable, absolutely you can

vivid imp
#

Please help:
Console sending:
.................................................................................

In FTP files:
bin
boot
dev
etc
home
initrd.img
initrid.img.old
lib
lib32
lib64
libx32
lost+found
media
mnt
plugins
proc
root
run
sbin
srv
sys
tmp
urs
var
vmlinuz
vmlinuz.old
at.cpu.txt
deploy.sh
installimage.conf
installimage.debug
log.cron
logb.txt
logb2.txt
t_cpu_ms36.txt
tmpc.txt
tsql.txt

sacred wave
#

Hi, it's me again with noobish question... Is there some simpler way to prevent player from getting rid of item? Prevent dropping is simple, it is much worse with inventories as I would like them to still be able to move the item around in their inventory, but do not allow moving it into chest etc... I know there is InventoryClickEvent but it covers sooo many things and I guess it will be hell writing the conditions for that. So the thing I am looking for is something will the result of this event be user is moving item out of their inventory?

#

@vivid imp Ahoj ๐Ÿ™‚ Can you provide more info rather than list of files from unix?

subtle blade
#

InventoryClickEvent's getClickedInventory() will be null if they click outside of their inventory

sacred wave
#

@subtle blade Even when they click into a chest inventory?

subtle blade
#

You could check if the clicked inventory isn't an instanceof PlayerInventory. Should cover what you need

#

Will also ensure nullability. If it's null, won't be an instance of PlayerInventory

#
if ((event.getClickedInventory() instanceof PlayerInventory)) {
    event.setCancelled(true);
    return; // If clicked outside of inventory or of any non-player inventory
}```
vivid imp
#

I reset the server, but the console still writes: ............................................................ and hosting writes to me that my server is very overloaded: /

#

that's all i know ...

sacred wave
#

@vivid imp Well I would contact support of the hosting... I guess they will be able to help you more

vivid imp
#

and before resetting I did something in FTP and said I didn't have permission: /

#

ok

sacred wave
#

@subtle blade yup, it seems pretty straightforward, so I don't need to check getAction that much, except for shiftclicking etc... Thank you!

subtle blade
#

Yep, sounds about right

sacred wave
#

@subtle blade and what is the difference between getClickedItem and getCursor? Javadoc is not very helpful. When I click Item and I have it in hand it is cursor and if i click/shiftClick item it is currentItem?

subtle blade
#

getClickedItem() is the item being clicked in the slot. getCursor() is the item on your cursor (i.e. you have it picked up already and are trying to move it to another slot)

sacred wave
#

ok, thank you!

frigid ember
#

How do I stock the villager shops? It says 'Item unavailable' when I try to use it.

#

How do I fix that?

#

Anyone?? Hello?

sacred wave
#

@frigid ember can you provide more info? Some code or something... There is not much to catch on here...

snow willow
#

hi

frigid ember
#

Like, when I use the villager shops, and try to buy items, it says 'Item unavailable'. How do I fix this?

#

@sacred wave

snow willow
#

Can someone help me... I need help deleting a plugin on my server, because its preventing me from deleting it cause its a jar file

#

someone please help... ๐Ÿ˜„

sacred wave
#

@frigid ember ok, again, you just repeated your original question. Are you trying to write plugin and using the plugin restock Items? Or are you just playing vanilla minecraft? Really, it is hard to help you with this little info...

frigid ember
#

Sorry.
I'll figure it out eventually. Thanks anyway!

hasty forge
#

hi people help me please

sacred wave
#

@snow willow isn't the server running while are you deleting the plugin?

snow willow
#

uhhh

#

lemme see

sacred wave
#

@snow willow also OS of the server?

snow willow
#

whats a "Os"

#

?

sacred wave
#

@frigid ember I would try to help you but with this little info, I really can't, sorry...

#

@snow willow Operating system

snow willow
#

oohhhhh

#

Yay thank you it deletes now ๐Ÿ˜„

sacred wave
#

@snow willow so it is windows ๐Ÿ™‚

snow willow
#

๐Ÿ™‚

#

lol

#

Im just starting out my server rn, so i would let u join but the problem is i dont wanna give my ip4

hasty forge
#

players die and immediately respawn when they drink a potion to increase health. how to solve the problem?

snow willow
#

lol

#

is it a plugin?

#

cursed plugin?

sacred wave
#

@snow willow I don't have a time, but thanks ๐Ÿ™‚

snow willow
#

@sacred wave wut

narrow crypt
#

so i want to save and load inventories from and to a yaml.
what is the way to go
something like this?
save inv as itemstack[]: ItemStack[] chestinv = chestblock.getInventory().getContents();

sacred wave
#

Im just starting out my server rn, so i would let u join but the problem is i dont wanna give my ip4
@snow willow

snow willow
#

ohhhh

#

yea lol

#

well... Thank you for helping me ๐Ÿ™‚

sacred wave
#

@snow willow np ๐Ÿ™‚

snow willow
#

Slight smile ๐Ÿ™‚

#

lol

#

what do u think is the safest way to change the ip of a minecraft server

#

so its not the ip4

#

like a website that is safe

#

to change my ip

sacred wave
#

@snow willow well that is not easy thing to do... If you want to hide your IP I would suggest using proxy (BungeeCord)

snow willow
#

How would I get bungeecord?

#

or proxy

#

well the same thing

sacred wave
#

@snow willowYou would download it, but you will need a hosting for it...

snow willow
#

@sacred wave can I use my spigot server?

sacred wave
#

@snow willow you can but then, it will have the IP you want to hide...

snow willow
#

ohhh

#

so what type of hosting would i need tho?

#

or could I just buy a domain.... Which is risky

sacred wave
#

@snow willow well I guess any hosting that would run minecraft as long as they suppor BungeeCord... But I am fairly new with Bungee, so I will not give you much info here...

#

@snow willow domain will not hide you IP...

gleaming totem
#

Youโ€™d need to hosting and to buy a domain.

sacred wave
#

@snow willow I can get IP from domain in 20 seconds...

gleaming totem
#

Plus IPs are always out there itโ€™s just how the internet works

snow willow
#

wut

gleaming totem
#

The only way you can hide an IP is if no one connects to the server.

snow willow
#

but

sacred wave
#

@snow willow: @gleaming totem is right...

#

if you want someone to connect to the server, they need to know the IP...

snow willow
#

why cant you buy a domain for the server... and then it'll change the ip

#

for the server

subtle blade
#

IP address != domain

sacred wave
#

@snow willow buying domain doesn't change an IP... It is just a name for it so you don't need to remeber it...

subtle blade
#

Domain --> Ip address

dusty topaz
snow willow
#

how did u find that?

sacred wave
#

@snow willow so behind every domain is an IP address

subtle blade
#

Literally ping mineplex.com in your terminal lol

dusty topaz
#

some show an ipv6 though

gleaming totem
#

A domain just points to an IP so itโ€™s easier in the eyes. Itโ€™s easier to remember โ€œgoogle dot comโ€ instead of a string of random numbers

dusty topaz
#

i'm not a networking guy so i'm unsure why that is but it's effectively the same ๐Ÿคทโ€โ™‚๏ธ

snow willow
#

what hosting thingy do I need?

gleaming totem
#

Any hosting that will host a bungee cord proxy, since it sounds like thatโ€™s what you want

sacred wave
#

@snow willow well in that case I would get full MC hosting ๐Ÿ™‚

gleaming totem
#

Before you buy hosting just ask if they support bungee

snow willow
#

ok

#

how much would they normaly cost tho?

gleaming totem
#

That is if you really want to set up a network with a hub and multiple servers!

snow willow
#

i wanna do that

#

but how much do bungee servers cost

gleaming totem
#

Depends on the host, usually around $1-$2 per GB of ram

snow willow
#

normaly

#

oh

#

well

#

I can do that

sacred wave
#

@snow willow bungee is free... hosting - it depends...

snow willow
#

ok

#

can u give me a link to a minecraft hosting website that supports bungee

gleaming totem
#

Basically all of them do if you have one in mind I could check for you if youโ€™d like.

sacred wave
#

but it is just example I don't know any hosting personally

#

so I can't judge quality/price etc...

snow willow
#

is that the one you use?

gleaming totem
#

Iโ€™d say find one with the cheapest price possible!

sacred wave
#

@snow willow nope I use VPS hosting which hosts full server and then I run mc on it...

#

and as it is not powerful enough, I run Bungee there and usually host MC from my personal PC ๐Ÿ˜„

snow willow
#

cool! well ill think about it

sacred wave
#

so basically I have the same usecase as you ๐Ÿ˜„

snow willow
#

I'll think about it... but when I want people on my server ill just switch to Vps hosting or something

#

or shockbyte

#

idk

#

ill find some

#

and ill switch to it

#

sometime

#

well thank you guys for your help im gonna go now! bye ๐Ÿ˜„

sacred wave
#

@snow willow for "production" it is the safest bet... I run my server for just family and friends ๐Ÿ™‚

#

np see ya ๐Ÿ™‚

snow willow
#

k

#

thank you, bye

dusty topaz
#

I'm probably being stupid but I can't find a scenario in which meta is null?

sacred wave
#

@dusty topaz because ItemMeta is marked as Nullable?

dusty topaz
#

why though

sacred wave
#

@dusty topaz well I was wondering that too, but then, I am not an expert here, so I just decided to ignore it and pray ๐Ÿ˜„

rigid nacelle
#

Because it's nullable. smart

dusty topaz
#

Going to check the source of craftitemfactory, but I'm pretty sure it can't return null

rigid nacelle
#

How come it not?

#

I'm pretty sure it can.

sacred wave
#

@dusty topaz @Nullable public ItemMeta getItemMeta() { return this.meta == null ? Bukkit.getItemFactory().getItemMeta(this.type) : this.meta.clone(); }

dusty topaz
#

perhaps it does it the material is air

rigid nacelle
#

Otherwise most of my plugins wouldn't have thrown an NPE upon usage without a ItemStack#hasItemMeta() check.

dusty topaz
#

getItemMeta() returns a new meta if hasItemMeta is false

rigid nacelle
#

Weird, it's nullable though.

#

Try it on an item that does not have anything at all, you'll see what I mean.

dusty topaz
#

my reasoning being that CraftItemFactory#getItemMeta (or perhaps the clone implementation) can return null

#

there will be a reason it's marked as nullable

rigid nacelle
#

Most definitely.

subtle blade
#

If pulled from a vanilla item, it can be null

#

If just freshly created it wonโ€™t be

dusty topaz
#

vanilla item?

rigid nacelle
#

and that's our answer.

subtle blade
#

i.e. from an inventory

#

Or literally anywhere from vanilla lol

dusty topaz
#

As in if I craft an item and try and get the meta of it it will be null?

rigid nacelle
#

Crafted, chests in shafts etc I guess.

dusty topaz
#

that doesn't make sense to me, since it checks this:

#
return this.meta == null ? Bukkit.getItemFactory().getItemMeta(this.type) : this.meta.clone();
#

so if the meta is null it creates a new meta

rigid nacelle
#

๐Ÿคท

sacred wave
#

@dusty topaz but this can return null: Bukkit.getItemFactory().getItemMeta(this.type) , I guess

remote socket
#

Is it possible to get a Block or Location from a chunk and x y z

sacred wave
#

`public interface ItemFactory {

/**
 * This creates a new item meta for the material.
 *
 * @param material The material to consider as base for the meta
 * @return a new ItemMeta that could be applied to an item stack of the
 *     specified material
 */
@Nullable
ItemMeta getItemMeta(@NotNull final Material material);

`

hasty forge
dusty topaz
#

it can only return null if the material is air though

sacred wave
#

@dusty topaz I don't know that but even if that is the case, there is your answer to when ItemMeta can be null...

dusty topaz
#

unless some of the sub calls it makes are null

#

then air is the only case in which it can be

#

which is reason enough i suppose

rigid nacelle
#

All we need to know is that it is possible that it's null. :smart:

dusty topaz
#

@remote socket yes you can

#

World#getChunk#getBlock

remote socket
#

๐Ÿ‘๐Ÿป ty

dusty topaz
#

should get the block relative to the chunk

rigid nacelle
#

Yeah, there's a World#getChunkAt(x, z) (block and location as well FYI).

dusty topaz
#

yeah, i meant getChunkAt

#

sometimes forget the names, but its self explanatory usually

rigid nacelle
#

Definitely is. Auto-completion in an IDE will most likely lead the user to it.

dusty topaz
#

I think I'm going to elect to leave them and just have it spit NPEs lol

rigid nacelle
#

Not final. mad

sacred wave
dusty topaz
#

why would i make it final

rigid nacelle
#

I mean.. you're not reassigning it, aye?

subtle blade
#

I don't finalize local vars either unless absolutely necessary. I hate it

rigid nacelle
#

๐Ÿคท

dusty topaz
#

yeah, i'd only do that if i need it in a lambda function or something

subtle blade
#

Same goes with method params

sacred wave
#

I am signing under that ๐Ÿ˜„

rigid nacelle
#

I agree when it comes to method parameters, that I hate.

sacred wave
#

But they require it in my job ๐Ÿ˜ฆ

dusty topaz
#

my 'job' is mainly working with decompiled code

sacred wave
#

thanks to autocleanup

dusty topaz
#

so i have to put up with it ๐Ÿ™‚

rigid nacelle
#

yikez

hasty forge
#

how to solve fake death?*

wicked island
#

can i get help on how to start a server?

cloud sparrow
#

get a server jar in a folder.

#

create a run.bat following the format to run it (if you want to be able to close it easier)

#

run it (accept EULA) and restart.

#

boom a server on ur own pc

narrow crypt
#

okay so im confused, can someone tell me what i am doing wrong
So i save chests to chestloot.yml and load it with java ItemStack[] contents = chestloot.getList("loot." + chestnames.get(listnumber)).toArray(new ItemStack[0]); but the problem is if i save a chest in the main class to chestloot.yml it can't load it, it does know it exists since the keys in the chestloot.yml increase (i printed that out in console before and after save) but it gives me a java.lang.NullPointerException: null

#

the one way it does work is if i put FileConfiguration data = YamlConfiguration.loadConfiguration(new File(Main.plugin.getDataFolder(), "data.yml")); above the chestloading

#

but i dont want to declare the data file so often

#
public class Main extends JavaPlugin{
    public static Main plugin;
    public FileConfiguration data;
    public FileConfiguration chestloot;
    @Override
    public void onEnable() {
        
        plugin = this;
        plugin.saveDefaultConfig();
        data = YamlConfiguration.loadConfiguration(new File(Main.plugin.getDataFolder(), "data.yml"));
``` I declared it like this
#

and the class where it loads:

public class Lightning implements Listener {
    private final Main plugin;
    FileConfiguration config = Main.plugin.getConfig();
    
    FileConfiguration data;
    FileConfiguration chestloot;
    
    
    
    public Lightning(Main main) {
        plugin = main;
        config = main.getConfig();
        data = plugin.data;
        chestloot = plugin.chestloot;
#

i'd be happy if anyone could help me :D

dusty topaz
#

can you give the stack trace you get given

#

and the line of code that relates to

narrow crypt
#

the error

#

and line 153:

#
ItemStack[] contents = chestloot.getList("loot."  + chestnames.get(listnumber)).toArray(new ItemStack[0]);
cloud sparrow
#

chestloot might be null

#

or chestnames

vernal spruce
#

is there a way to directly get nutritional values from a food or enum it is?

cloud sparrow
#

have a method that requires the enum to store a value?

#

with a getNutritionalValue() method

vernal spruce
#

so there is a method?

#

nvm just got it now

narrow crypt
#

imma check the chestnames

#

i gotta tell, it only gives the error if i save it and load it within the same uptime

#

if i restart or reload the issue is gone and the previous saved chest works fine

gleaming totem
#

So sounds like some error with saving and updating the config file?

narrow crypt
#

yes i think so

gleaming totem
#

Are you reloading the config before pulling the chest info from it?

upper hearth
#

Are you saving it as soon as you put it in, or only onDisable?

narrow crypt
#

ill show my saving

#

btw, if i put FileConfiguration data = YamlConfiguration.loadConfiguration(new File(Main.plugin.getDataFolder(), "chestloot.yml"));; works

#
chestloot.set("loot." + args[0].toString(), chestinv);
                      player.sendMessage(ChatColor.translateAlternateColorCodes('&', "&2&l[Airdrop] &r&aSaved &c" + args[0].toString() + " &ato the storage!"));
                                
                                    try {
                                        chestloot.save(new File(plugin.getDataFolder(), "chestloot.yml"));
                                    }
                                 catch (IOException e) {
                                    e.printStackTrace();
                                }
#

i also have a command that will get all the keys from the chestloot.yml and if i run that right after the saving, it does include the newly made chest

upper hearth
#

data.yml and chestloot.yml? Are they the same thing?

narrow crypt
#

no they are not

#

oh

#

i meant Fileconfiguartion chestloot = blablbal "chestloot.yml"

upper hearth
#

Just check that chestloot and chestnames aren't null

#

Probably chestloot is if you're able to fix it by declaring right before

narrow crypt
#

chestnames is a list of all the keynames from the chests

#

hmm

zenith siren
#

I got a weird bug. I'm trying to disable join messages but when I do event.setJoinMessage("") in a PlayerJoinEvent then it sends an empty line instead of disabling it

upper hearth
#

try putting null instead

sacred wave
#

@subtle blade if (ItemDropFlag.getItemFlag(e.getCursor()) == ItemDropFlag.BOUND) { if (!(e.getClickedInventory() instanceof PlayerInventory)) { e.setCancelled(true); return; } }

So, this almost works, but if I pick the item and keep clicking into foreign inventory sometimes I am able to. :/

narrow crypt
#

but Dessie

#

if i save "chest1" and restart the server

#

then save "chest2"

#

then i trigger my command which summons a random chest, if chest1 gets loaded it works

#

but if chest2 get loaded it gives error

upper hearth
#

Could be chestnames.get(listnumber) when you save a new chest are you adding it to chestnames?

narrow crypt
#

if i trigger the spawncommand it first makes a list of all the keys in the config named "chestnames"

#

so that list is updated before it choses a chest

#

ill try printing all contents of the chestloot.yml before loading the chest

#

loot, loot.h, loot.hhh it does see the new chest

#

i saved a chest named hhh and then did the summonchest and i made it so it prints all keys before summoning

#

@upper hearth Any ideas?

rigid nacelle
#

What's the issue here?

narrow crypt
#

Well its quite complicated

#

im saving chests to a yaml file using:

chestloot.set("loot." + args[0].toString(), chestinv);

and with another command summoning a random chest in that yaml file using:

ItemStack[] contents = chestloot.getList("loot."  + chestnames.get(listnumber)).toArray(new ItemStack[0]);
#

the chest loading works semi

upper hearth
#

Next possibility is getList() is returning null.

narrow crypt
#

if i save a chest, reload server, load chest it works

#

but if i save chest, load chest it doesnt

#

hmm its so weird cause why would it find the list if the plugin restarts

upper hearth
#

Saving issue I suppose. If you save a chest before reloading what does the YML look like?

narrow crypt
#

ill show

upper hearth
#

And what does it look like after you reload

rigid nacelle
#

Let's begin at the way you're saving. Data stuff should be loaded on enable and saved on disable. This way it's easier to access the data needed and modify whatever you feel like, there's even more to it.

upper hearth
#

You should serialize the Inventory to save it

narrow crypt
#

wdym dessie?

#

this is how i save the chestinventory @rigid nacelle

rigid nacelle
#

You should be loading the data on enable and save it on disable.

#

Access it through a map of player's data.

narrow crypt
#

So its not possible to acces the new chest if you save it without restarting?

#

i mean it is possible

#

but

upper hearth
#

Serialization allows you to read and write the entire inventory to/from a base64 string

narrow crypt
#

ah

dusty topaz
#

how do you serialize that?

#

inventory isn't serializable

#

(to my knowledge)

narrow crypt
#

So simple sayed, i'd have to convert inventory to a string?

#

and save that in the file

#

then read it and convert it back to inventory?

upper hearth
#

Inventory isn't but ItemStack is @dusty topaz

#

So you can serialize the contents

frigid ember
#

Can anyone here transcribe music?

dusty topaz
#

ItemStack isn't a base64 sting when deserialized

#

afaik

upper hearth
#

If you use this I think it is base64

#

Also yes that's what you would do Rik

narrow crypt
#

but the weird thing is that if i put FileConfiguration chestloot = YamlConfiguration.loadConfiguration(new File(Main.plugin.getDataFolder(), "chestloot.yml")); the line above the loading it works absolutely fine

dusty topaz
#

yeah if you use that it is base64

#

but just deserializing an itemstack it will just be like

#
item:
 ==: org.bukkit.itemstack 
 type: blah
 amount: blah
#

etc

#

@narrow crypt why don't you iterate over the files contents before you need to use them

#

to debug what is in the FileConfiguration you have

narrow crypt
#

ill try that

#

i already printed every key and it did included the new one

#

but you mean also the content of the new one i guess @dusty topaz ?

dusty topaz
#

if the key is there, the value should also be

#

so why not print both

narrow crypt
#

can i print a itemstack?

dusty topaz
#
    public String toString() {
        StringBuilder toString = (new StringBuilder("ItemStack{")).append(this.getType().name()).append(" x ").append(this.getAmount());
        if (this.hasItemMeta()) {
            toString.append(", ").append(this.getItemMeta());
        }

        return toString.append('}').toString();
    }
#

yup

sacred wave
#

can confirm that

#

just tried that ๐Ÿ˜„

narrow crypt
#

how should i loop through it then

#

haha

#

i got it to print all keys

#

xD

dusty topaz
#

FileConfiguration#getKeys gets all the keys

#

then just get the value from said key

narrow crypt
#
 -----------------
[20:45:38 INFO]: -----------------
[20:45:38 INFO]: null
[20:45:38 INFO]: -----------------
[20:45:38 INFO]: -----------------
#

alright thats clear

#

its null

#

the value is null, it did save the name tho

dusty topaz
#

show me the code where you set it

narrow crypt
#

but is says all of them are null, even the ones i saved earlier

#

that do work when i summon them

dusty topaz
#

how are you loading your config

narrow crypt
#
chestloot.set("loot." + args[0].toString(), chestinv);
                                player.sendMessage(ChatColor.translateAlternateColorCodes('&', "&2&l[Airdrop] &r&aSaved &c" + args[0].toString() + " &ato the storage!"));
                                
                                    try {
                                        chestloot.save(new File(plugin.getDataFolder(), "chestloot.yml"));
                                    }
                                 catch (IOException e) {
                                    e.printStackTrace();
                                }
#

that is the saving part

dusty topaz
#

that is not how you want to be saving

narrow crypt
#

oof

dusty topaz
#

just follow the convention in this and you'll be fine

narrow crypt
#

lol

#

i got told that was a good way to.....

balmy meteor
#

So a quick question to see if I understand this correctly. PaperMC/PaperSpigot/SpigotMC has a separate 'world' for each dimension (overworld, nether and end). Am I correct in my assumption that settings don't 'carry over'? Like off i set keepInventory in the overworld it's doesn't apply to the others? Is that for all commands? Difficulty etc?

narrow crypt
#

thanks avrovulcan

dusty topaz
#

pretty sure I answered you in general Nils...

narrow crypt
#

ill look into it tomorrow i think

#

im done for now

balmy meteor
#

Yes. I just moved the topic.

narrow crypt
#

thank you so much for your patience :D

dusty topaz
#

... but you got the answer

narrow crypt
#

i mean, changing all the savings

#

ill do that tomorrow

dusty topaz
#

talking to nils

#

good luck tomorrow!

narrow crypt
#

oh okay

#

thank you

balmy meteor
#

Yup. But I was wondering if that ment everything?

dusty topaz
#

every gamerule? yup

narrow crypt
#

btw, i favorited the website when you sent it to me earlier haha

balmy meteor
#

@dusty topaz thanks. Then I got my answer.

#

Would have been a good thing to know. We learned this the hard way...๐Ÿ˜‚

#

@dusty topaz Just one more question, sorry for being such a noob ๐Ÿ˜• Does this include teams and such? I have all the players sorted in groups according to what community they come from. Will this to have to be set per dimension?

dusty topaz
#

uh, i don't think so with teams

#

only gamerules are per world

#

not too sure though

balmy meteor
#

Okay. Thanks anyway ๐Ÿ˜ I'll ask my players if it shows up in the nether and end. I really hope it does cuz that's a lot of typing...

sacred wave
#

Ok, can someone try this: @EventHandler public void onInventoryClick(final InventoryClickEvent e) { Bukkit.getLogger().info("BOO"); if (e.getCursor() != null && e.getCursor().getType() == Material.BEACON) { if (!(e.getClickedInventory() instanceof PlayerInventory)) { e.setCancelled(true); } } }
When you register this event and pick a Beacon from your inventory and try to put it into a chest, it should be canceled. However if I hold the Beacon and keep clicking into chest inventory there is about 10% chance the event is not called at all and is not cancelled.. Or I am just stupid and don't see something...

dusty topaz
#

well, first of all I would replace the instanceof with

#
if (e.getClickedInventory().getType() != InventoryType.PLAYER)
#

but then you can also just

#

event.setCancelled(e.getClickedInventory().getType() != InventoryType.PLAYER)

sacred wave
#

well getType could return null...

dusty topaz
#

then check if the inventory is null

sacred wave
#

*getClickedInventory...

#

but the thing is that the BOO message is not outputted sometimes...

#

so I guess the event is not called at all...

#

but it should be as I keep doing the same thing...

dusty topaz
#

i'll test it

sacred wave
#

Thank you!

dusty topaz
#

Yeah, I can get it in the inventory

sacred wave
#

So it is a bug... :/

rigid nacelle
#

I agree with the approach that Avro mentioned. Implicit else is the way to go.

haughty sundial
#

Hey guys just a quick question i can't find a way to add a potion effect to a user for a certain amount of time. Can somebody give me an example?

dusty topaz
#

Player#addPotionEffect?

haughty sundial
#

I tried that. But it doesn't seem like i can add a certain amount of time and such

sacred wave
#

p.addPotionEffect(new PotionEffect(PotionEffectType.SPEED, 200, 11));

dusty topaz
#

PotionEffectโ€‹(@NotNull PotionEffectType type, int duration, int amplifier)

haughty sundial
#

Ahhh yes thank you!

subtle blade
#

I've always preferred PotionEffectType.WHATEVER.createPotionEffect() ๐Ÿ˜„

#

Just a convenience method but it looks a little nicer

dusty topaz
#

does it cache potion effects

sacred wave
#

@rigid nacelle @dusty topaz Ok I will use the getType... ๐Ÿ™‚ But I am afraid it won't help me...

subtle blade
#

No, creates a new one every time. You should create constants for your own potion effects

dusty topaz
#

yeah, using get type won't fix that

#

not sure what is causing that

frigid ember
#

viaversion or protocolsupport?
or both

sacred wave
#

Well I know the packet is not lost as the item stays in the chest, and I don't see that much under the hood so I can't tell...

dusty topaz
#

@frigid ember i dont know why you bother asking if you dont read the answer

#

both plugins do the same thing (protocl support)

#

as for which is better its probably your own choice to make

sacred wave
#

@dusty topazDo you have latest spigot?

dusty topaz
#

yep

#

i think perhaps its an inventorydragevent being called

#

when its not calling the click event

#

and you'd need to cancel the drag event anyway

sacred wave
#

Will try that....

#

@dusty topaz ha! that seems to do the job, so not a bug at the end... Thank you!

dusty topaz
#

๐Ÿ‘ make sure you can't shift click them in too

#

since the click will be in the players inventory

sacred wave
#

yup I had it already implemented, just wanted to post as simple sample as possible

#

@dusty topaz @EventHandler public void onInventoryClick(final InventoryClickEvent e) { if (e.isCancelled()) { return; } if (ItemDropFlag.getItemFlag(e.getCursor()) == ItemDropFlag.BOUND) { if (e.getClickedInventory() == null || e.getClickedInventory().getType() != InventoryType.PLAYER) { e.setCancelled(true); return; } } if (ItemDropFlag.getItemFlag(e.getCurrentItem()) == ItemDropFlag.BOUND) { switch (e.getAction()) { case MOVE_TO_OTHER_INVENTORY: case CLONE_STACK: e.setCancelled(true); return; } } }

dusty topaz
#

๐Ÿ‘

#
    public static void serialize(Coinflip coinflip, String path, FileConfiguration config) {
        config.set(path + ".uuid", owner.toString());
        config.set(path + ".amount", amount);
    }

#

Any better way to do serialization than this?

#

I would ideally want to return a configuration section that they can use config#set(path, flip.serialize(path, config));

fleet burrow
sacred wave
#

I don't know structure of the class but maybe if values are stored in map, then you can just iterate? @dusty topaz

fleet burrow
#

Should I separate each inventory page into a class? Is this single responsibility?

dusty topaz
#

it's just got two fields

sacred wave
#

Then I guess this is fine...

dusty topaz
#

just wondering if its possible to create ConfigurationSection

fleet burrow
#

I feel like it is an over exaggeration of it

sacred wave
#

@dusty topaz I guess you can create a section

dusty topaz
#

I meant without passing in a fileconfiguration object ^^

haughty sundial
#

Anyone knows why my ${project.version} placeholder is not taking the version and just leaving the placeholder there in the plugin.yml file?

#

I'm using Eclipse

fleet burrow
#

I feel like it is an over exaggeration of it
@fleet burrow this is in a class named MachineInventoryImpl so is that enough?

dusty topaz
#

@fleet burrow I don't think that would be single responsibility

#

depends what you class as functionality

sacred wave
#

ah, there is the catch....

dusty topaz
#

is the functionality just one inventory or handling all inventories

#

regardless i'd put them in different classes

fleet burrow
#

one inventory

#

each instance is an open inventory

#

that would be like 15 classes

sacred wave
#

@dusty topaz then from my little knowledge, you can't without the FC instance :/

haughty sundial
#

Anyone knows why my ${project.version} placeholder is not taking the version and just leaving the placeholder there in the plugin.yml file? The placeholder is functional in the pom.xml just not in the plugin.yml and I'm using Eclipse if that helps*

dusty topaz
#

@fleet burrow you probably shouldn't create a new object for each inventory

#

in some cases that's unavoidable (if its player specific) but if it's a static inventory you can just have a shared instance without issues

fleet burrow
#

Yeah, I know :P
It's player specific

dusty topaz
#

in which case you should definitely have a separate class per inventory

#

since you'll want to track who is in what inventory

fleet burrow
#

Well, It's "Machine" specific

#

has nothing to do with the player really

dusty topaz
#

other people probably know more about the single responsibility principle than I but it sounds like you should be splitting them up :p

fleet burrow
#

I guess I could have a static field in the a machine object that points to an inventory of the machine

#

would be much better

#

thanks for giving me the idea though ๐Ÿ™‚

frigid ember
#

Now I dont know what causes this but when someone is kicked by my plugin, you can no longer join (sometimes, like a 20% chance). You just get kicked with Disconnected in the client and nothing prints out in console like you never even joined
usually when it happens handleDisconnection() called twice is printed after the person is kicked

#

Could it be my plugin maybe or protocollib or something else

dusty topaz
#

how are you kicking them

#

Player#kick()?

frigid ember
#

yeah in a task

dusty topaz
#

is the task async?

frigid ember
#

No idea

dusty topaz
#

show some code

frigid ember
#
                pd.setViolations(0);
                violations.remove(pd);
                pd.isbeingpunished = false;
                p.kickPlayer(Main.getInstance().removalMessage);
            }, 1l);```
dusty topaz
#

try increasing the tick to 2L, but I'm unsure why that is happening

#

also ensure p.isOnline before kicking I guess

#

ยฏ_(ใƒ„)_/ยฏ

median hill
#

hi, have a really big problem, i have a VPS with 8GB of ram but the server only use about 1-3GB, we dont know what it is, anyone have a clue?

#

(we have 8gb in the config.yml)

dusty topaz
#

there is no config option to specify the ram usage

#

and it doesn't need to use all allocated

#

and you also shouldn't allocate all the ram to the server

median hill
#

we also tried it with 7 and 6 bit still the same

dusty topaz
#

it doesn't need to use all of it

median hill
#

the problem is the TPS start to fall down

tiny dagger
#

leak

median hill
#

cause we have about 16 people

dusty topaz
#

then your issue isn't really to do with ram

#

show timings if you have them?

tiny dagger
#

depends tho

crimson sandal
#

Hey, if I'm saving to a YamlConfiguration quite often should I be doing that in a background task?

tiny dagger
#

why...

dusty topaz
#

you shouldn't be writing to a file often

tiny dagger
#

would you do that?

median hill
#

what do you mean by timing (new in this sorry)

dusty topaz
#

/timings report

sacred wave
#

@dusty topaz actually /timings paste creates link...

dusty topaz
#

๐Ÿคทโ€โ™‚๏ธ i don't use it often

#

dawon is likely correct

#

/timings paste, not report :p

sacred wave
#

I used it today for the first time ๐Ÿ˜„

#

and if you go through report it sends you to a webpage informing that you should use paste ๐Ÿ˜„

uneven kraken
median hill
crimson sandal
#

I'm storing a bunch of ItemStack Lists from a custom inventory and serialising them. And so each time the inventory gets closed or some other setting I've just been saving directly to the file then, obviously everything is still in memory. I'm just thinking that save() is running on the main thread

tiny dagger
#

if you expect slow data do it async

dusty topaz
#

why don't you just cache them and save them on a timer

#

and onDisable

#

IO is slow

crimson sandal
#

Yeah I already save in onDisable and then also whenever a setting is changed.

dusty topaz
#

then you don't need to save it when a setting is changed

#

just on disable

sacred wave
#

actually when speeking of speeds, how is it with PersistentDataContainers?

#

are they cached? or written/read to disk directly

ripe token
#

How i does my skyblock island regen auto every 5m

#

Plz tell me

crimson sandal
#

I guess I don't I was just wary of server crashes, since there could become some discrepancies between the world and the config file

dusty topaz
#

Hence you save on a timer

crimson sandal
#

They are cached yeah

dusty topaz
#

If the server crashes some data loss is expected

#

Better than doing IO every click

ripe token
#

How i does my skyblock island regen auto every 5m

sacred wave
#

@crimson sandal awesome thank you

crimson sandal
#

Oh wait

ripe token
#

How i does my skyblock island regen auto every 5m????

crimson sandal
#

I thought you were asking me if my data was cached

sacred wave
#

@crimson sandal nope ๐Ÿ˜„

#

nvm

crimson sandal
#

I'm assuming they are stored in memory though...

dusty topaz
#

Caching data in memory is no where near as intensive as IO

sacred wave
#

I would too, just wanted to be sure

crimson sandal
#

Yeah, I use one currently to store a players UUID to a sign.

sacred wave
#

I am saving game info into a chest at 1,1,1 ๐Ÿ˜„

dusty topaz
#

why not just save it in memory

crimson sandal
#

Well that sounds peculiar

median hill
dusty topaz
#

can't really expand those timings - i suppose it's timings v1 and not v2

sacred wave
#

@dusty topaz well I have it in memory, I save it there onDisable and load it onEnable ๐Ÿ™‚