#help-archived

1 messages ยท Page 33 of 1

vale slate
#

no it's a Interface

keen compass
#

doubt it, I think maybe a route went down and the BG's re-routed to a non optimal route

vale slate
#

called iTickable

#

well yes, and the Networkhandler tries to execute a Handshake with the client, in this time he unfortunatly holds the server

silent spindle
#

Is there no sort of timeout ?

keen compass
#

There is, 30 seconds

silent spindle
#

oof

#

that's a lot

vale slate
#

there is, you see it in your console

keen compass
#

standard TCP timeout

vale slate
#

^

silent spindle
#

I dont get any timeout or other errors

keen compass
#

because it didn't hit 30 seconds of no activity

silent spindle
#

ok

#

how can I protect server against that ?

#

(and why it does lag only every 2 minutes ?)

vale slate
#

well you can't protect your server against that

keen compass
#

you could lower the TCP timeout on the dedi but I don't recommend it. As I said I do believe a route went down to get to your servers and everyone is being re-routed sub optimally to a different route

vale slate
#

oh good god, now I need to explain how internet protocols work

keen compass
#

but you can only find that out with some network tools

#

if its a route issue there isn't much you can do except just wait

vale slate
#

or you contact the support of your host

keen compass
#

that too

silent spindle
#

okay, thanks a lot

vale slate
#

sorry, but we can't help further

silent spindle
#

wont bother you anymore

knotty karma
#

is there a way I can register a vanilla CavePopulator to my custom generator

silent spindle
#

thanks again, will come here when it's resolved

vale slate
#

well support was my job and is hobby

keen compass
#

ping plotter is a good tool to use sometimes to see if there is an issue with the route

#

I do believe its free to use for a period of time and then you have to buy it, but its handy sometimes

#

especially if it does show a problem on the route it gives you more information to give OVH support ๐Ÿ˜‰

frigid ember
#

Is it at all possible to "pose" an NPC or entity through the use of a plugin?

vale slate
#

is there a way I can register a vanilla CavePopulator to my custom generator
well some more information what you're doing would be helpful

#

Is it at all possible to "pose" an NPC or entity through the use of a plugin?
depends on the entity

frigid ember
#

Specifically a player entity.

keen compass
#

you mean disguise yourself as another entity?

frigid ember
#

Like, if I wanted to create a faux statue

#

Not pose as another entity, pose an entity

vale slate
#

yes you can do this, but only on the base of the precoded stuff

#

like swim or sneak

keen compass
#

oh, well probably better off using armor stands to put entities in a pose

frigid ember
#

Ah okay that makes sense

#

It's not possible to recreate an entire skin on an armor stand though, right?

vale slate
#

no, it is not mappable, at least as far as I know

vernal spruce
#

anyone got the nms for spawner?

vale slate
#

like the mappings?

vernal spruce
#

the methods a,b,c,d yeah

vale slate
#

Well if you are using NMS, you should be that advanced to recreate them from the methods

#

I think the mappings aren't online for 1.15

safe robin
#

im getting an NPE for some reason when i try to call YamlConfiguration.loadConfiguration(file) when the file is not null, can anyone help me out here? im pretty new to spigot development so apologies if im being small brain

vale slate
#

please show us the stacktrace and the sourcecode

safe robin
#

one sec, lemme put it in a pastebin, is that alright?

vale slate
#

sure

naive goblet
#

Not pastebin pls

vale slate
#

pastebin does what it's supposed to do

naive goblet
#

Except for giving me epilepsy?

vale slate
#

and I'm to old to use something newer ๐Ÿ˜‚

safe robin
naive goblet
#

Jesus dude

safe robin
#

._.

naive goblet
vale slate
#

for the right format there was no money left xD

safe robin
naive goblet
#

Send 1 with stacktrace

#

1 with entire class main

safe robin
#

oh boy

#

ill warn you now, my main class is not pretty as Im still learning how TO make it neat

naive goblet
#

Itโ€™s fine

#

I like to nitpick (:

vale slate
#

where should I start my tour of code destruction

naive goblet
#

Lol

safe robin
naive goblet
#

Let me go on my pc

safe robin
#

shoot i didnt realize i would have to leave this soon, please tag me or dm me (if that's allowed) if you happen to find any clues please, sorry about leaving you guys like this ;-;

naive goblet
#

I will see what I can do

safe robin
#

thx veri muches

vale slate
#

np

keen compass
#

first, the parent will always exist that is the plugin datafolder, if it doesn't then you have more problems then just the plugin fyi, second the way you create the directory is incorrect as you are using the method to create a file, not a directory

vale slate
#

public final class
I'm getting worried, since this thing spreads like a virus

naive goblet
#

Huh

#

final in a class means itโ€™s no longer extendable?

subtle blade
#

Correct

vale slate
#

yes

naive goblet
#

final Main is good?

wicked atlas
#

I have what I'm pretty sure is a dumb mistake, which is good since it means it'll be easily fixable. My plugin isn't even loaded, can anyone help me figure out why?

vale slate
#

I am just concerned that everybody is making everything final today

naive goblet
#

Well final should be used ?

keen compass
#

I would be more worried about static then final ๐Ÿ˜›

naive goblet
#

Except if you want to reassign a variable later

subtle blade
#

You have no reason to finalize your main class because even if it does get extended, it canโ€™t be initialized. The class path will throw an exception

vale slate
#

Frost is right I think

subtle blade
#

Itโ€™s a class path enforced singleton

naive goblet
#

statics isnโ€™t as bad as everyone says. Overall itโ€™s kind of wrong blaming everything on staticโ€™s if you know when to use static

vale slate
#

the problem is most people don't know

hoary parcel
#

I hate brigadier

naive goblet
#

it takes 2 seconds to get some knowledge how static works ;/

hoary parcel
vale slate
#

it takes years to know where to use it and how to use it properly

#

I have what I'm pretty sure is a dumb mistake, which is good since it means it'll be easily fixable. My plugin isn't even loaded, can anyone help me figure out why?
@wicked atlas is an exception thrown

narrow basin
vale slate
#

at some point

naive goblet
#

Takes years?

hoary parcel
#

@narrow basin some skript doesnt work with 1.15

vale slate
wicked atlas
hoary parcel
#

or more like com.gmail.thelimeglass.Books.EffOpenBook doesnt work with 1.15

wicked atlas
#

the compiled jar is in the plugins directory

vale slate
#

or more like com.gmail.thelimeglass.Books.EffOpenBook doesnt work with 1.15
am I stupid or is this a strange package

hoary parcel
#

not really

vale slate
#

[16:12:41] [Server thread/ERROR]: Could not load 'plugins/totems.jar' in folder 'plugins': uses the space-character (0x20) in its name
@wicked atlas

#

never saw gmail

hoary parcel
#

ppl use their email as package name if they dont own a domain

wicked atlas
#

oh I apparently missed that

#

ok but it doesn't

name: TotemNotification
version: 0.0.0
main: com.github.redstoneguy12.totemnotification.TotemNotification
api-version: 1.15
description: Sends a chat message when someone pops their totem
vale slate
#

ppl use their email as package name if they dont own a domain
honestly I never saw that, till today

hoary parcel
#

com.github is another one many use

vale slate
#

that one I saw a lot

#

and I understand

#

but gmail

#

is there a accidental space in there redstone?

#

at the begin or end

#

but that should be cut out

#

the Strings are trimmed

wicked atlas
#

that's the exact file from the jar, and no there's not

silk bane
#

why not buy a domain name for no reason other than to feel safe using it for your group id?

wicked atlas
#

because no credit card

vale slate
#

I think the github option is more reasonable than gmail

wicked atlas
#

oh now it loads

#

I changed nothing but ok

vale slate
#

well then, have fun

naive goblet
#

redstoneguy, wish my problems would have been solved like yours :o

vale slate
#

NMS problems magically solve themselfs if you delete the world folders

#

and guess who didn't know that

naive goblet
#

Ight

unreal hedge
#

If you stress about readability, static will be one of your nightmares as well ๐Ÿ˜ฆ

vale slate
#

I'm the good old singleton fanatic

naive goblet
#

Depends but certainly

unreal hedge
#

I generally just use framework and hierarchies xD

naive goblet
#

Everyone should (:

vale slate
#

Static has its purpose, but not everything needs to be static

naive goblet
#

Good purposes

vale slate
#

yes

#

it has its very own purpose, but some people don't understand

#

Well I'm the person who multithreads his plugins

naive goblet
#

his?

vale slate
#

wdym

naive goblet
#

Well I'm the person who multithreads his plugins

#

His?

wicked atlas
#

he's referring to himself

vale slate
#

this sentence is totally fine I think

wicked atlas
#

yeah that's a normal thing to say

naive goblet
#

Grammatically wrong

vale slate
#

yeah the tense is wrong

#

sorry

#
spigot-api
    Copyright(c) 2012-2020 SpigotMC Pty. Ltd.
    https://www.spigotmc.org/
    Public License
        https://www.spigotmc.org/wiki/public-license/

Does this count as attribution or needs it more things?

naive goblet
#

Think it counts ?

lean knot
#

@zenith palm can you update my nicname please my name was changed on forum

naive goblet
#

Yes update mine as well

zenith palm
#

@zenith palm can you update my nicname please my name was changed on forum
@lean knot Please PM me on the forums with your current discord name (not the nickname on this server) eg: VitaniNecro #0624

naive goblet
#

Can I as well?

zenith palm
#

Yip

lean knot
#

how do i pm you on forums?

naive goblet
#

Itโ€™s through starting a conversation right?

zenith palm
#

Updated your name @naive goblet

naive goblet
#

โค๏ธ

vale slate
#

so lets conclude

zenith palm
#

done @lean knot

vale slate
#

incredibly bad joke

vernal spruce
#

anybody needs a boat?

naive goblet
#

Yes my dude

vernal spruce
#

Gotta have some relaxing time in the quest of setting that shit into a itemstack for 2hr

naive goblet
#

Enjoy (:

vale slate
#

I have a not relaxing time convincing the pose vector of an armorstand to do what I want

orchid acorn
#

How to get mods

vale slate
#

plugins or mods?

#

for mods you're asking on the wrong platform

vernal spruce
#

How would this look as nbttag? {ArmorItems:[{Count:1,id:diamond_boots}, {Count:1,id:diamond_leggings}, {Count:1,id:diamond_chestplate}, {Count:1,id:diamond_helmet}]}

#

cant figure it out

sweet hemlock
#

Boat spawner

#

lmao

vernal spruce
#

hey.. it was fun

vale slate
#

the Tnt spawner still is the best

sweet hemlock
#

Now imagine armor stand spawner

vale slate
#

imagine a armorstand fountain spawner

#

I did this by accident

bronze marten
#

Fish spawner

sweet hemlock
#

armor stand spawner that spawns with initial velocity

bronze marten
#

Or, falling sand spawner

sweet hemlock
#

why not go crazy and just put them stands on bats

#

boom, halloween themed spawner

#

xD

dusty topaz
#

What would be the most efficient way to check if the first n items in lists are equal

bronze marten
#

uh

#

for loop?

vale slate
#

for loop get the 0 element and check all against that, I suppose

dusty topaz
#

that's not what i meant

#

sort of like doing list1.equals(list2)

#

but only checking the first n items as opposed to all items

wanton delta
#

well

sweet hemlock
#

Yeah, for loop

dusty topaz
#

is there a more efficient way than a for loop

#

awh ok

wanton delta
#

nope

#

for loop

vale slate
#

there is a compare function

bronze marten
#

No lmao its a O(n) problem

vale slate
#

but I never used that

bronze marten
#

You cannot make it more efficient xd

wanton delta
#

^^

#

O(n) is pretty much the fastest lol

bronze marten
#

No

#

Logn

sweet hemlock
#
int ct;
for (int i = 0; i < a.length; i++)
   if a.get(i) == b.get(i) ct++;
#

else break;

wanton delta
#

"pretty much"

bronze marten
#

O(1) is cool

#

๐Ÿ˜‚

wanton delta
#

i need to look into time complexity a bit more

vernal spruce
#

@bronze marten hue hue hue,you just solved my problems

vale slate
#

if this is the thing you worry about in your efficiency, then you are a real pro

vernal spruce
wanton delta
#

i get the basic idea but need to study it more :p

bronze marten
#

Beatiful @vernal spruce

dusty topaz
#

i just worry since it will be checking on a lot of events

#

well, enchant apply events

wanton delta
#

dont worry

dusty topaz
#

maybe not that bad

sweet hemlock
#

keep the list as short as possible and you should be good I guess

dusty topaz
#

yeah lists are only the lore

bronze marten
#

As long as your n does not exceed a few million ur fine

dusty topaz
#

just trying to ignore success and destroy rates when comparing

wanton delta
#

people often are worried that their code will be unoptimized and super slow

#

its a lot faster than what you think

sweet hemlock
#

^

vale slate
#

if you worry make a system millis before the operation and one after it and print the difference

sweet hemlock
#

I used to worry a lot lol

bronze marten
#

@vale slate bruh literally the worst xd

wanton delta
#

you should only be worrying if its a big operation

bronze marten
#

Never do that xd

vale slate
#

just for debug

bronze marten
#

Especially with java in a JVM environment xd

vale slate
#

I know it's inaccurate

bronze marten
#

But sure it can be nice too see it run fast xd but dont expect it to run always like that

sweet hemlock
#

Would there be any benefit to putting the said code in an async thread?

wanton delta
#

no

sweet hemlock
#

Thanks, wanted to make sure

vale slate
#

definitely no

dusty topaz
#
                    int count = 0;
                    for (; count < lore.size() - 2; count++) {
                        if (lore.get(count).equals(compLore.get(count))) {
                            count++;
                        }
                        else {
                            break;
                        }
                    }
                    return count == lore.size() - 2;
#

That look right?

vale slate
#

what the heck is going on with that formatting

wanton delta
#

well no

dusty topaz
#

I always use {}

bronze marten
#

Too much identation

sweet hemlock
#

you're doing count++ twice

wanton delta
#

youre using count++ twice

dusty topaz
#

ah yeah

#

alright yeah

#

i see

sweet hemlock
#

just do if (!lore...) break;

dusty topaz
#

ye

wanton delta
#

use a foreach loop

#

and break if its not matching

#

and update count if it does

sweet hemlock
#

can't do a foreach in that case?

wanton delta
#

yes

#

get all the strings in lore

dusty topaz
#

i don't think i can ^^

wanton delta
#

iterate through them

#

add to count if it matches

#

if it doesnt break

sweet hemlock
#

since it's comparing one list to another

meager lantern
wanton delta
#

oh i totally forgot about that part

#

youre right

sweet hemlock
#

You can use foreach and an iterator tho

dusty topaz
#

okay, i've got a working algorithm

vale slate
#

If you want to compare two whole lists if all elements match there is a more efficient way to do that

bronze marten
#

@meager lantern try clearing cache?

meager lantern
#

I mean it's showing up both in-game and in my browser

#

So it's not a browser cache issue

#

What version is it showing for you?

bronze marten
#

2.1.7

meager lantern
#

It should say 2.2.0

vale slate
#

2.2.0

meager lantern
#

Or actually I just updated it to 2.2.1

keen moth
#

Takes a bit to update

meager lantern
#

Ah okay

vale slate
#

Mine is updated, it's a cloudflare cache thing

bronze marten
#

Had some issues with that page as well tbh, ended up using github tags now

meager lantern
#

Right, so the edge server I'm connecting to has it cached

#

I could just switch over to GitHub as well, I've uploaded all of my releases there as well

bronze marten
#

Can spigot maybe disable the caching for that page? xd

#

Cloudflare has page rules right?

vale slate
#

I don't think they can, maybe if they have the huge enterprise plan

vernal spruce
#

Any body got any ideea how i can translate this into nbttag in code? ArmorItems:[{},{},{},{Count:1,id:diamond_helmet}]

bronze marten
#

You get a few page rules for free tho

hoary parcel
meager lantern
#

Oh sick!

vale slate
#

Any body got any ideea how i can translate this into nbttag in code? ArmorItems:[{},{},{},{Count:1,id:diamond_helmet}]
I don't know how it is called anymore

hoary parcel
meager lantern
#

I was wondering why there was a legacy path, but not a new path

#

When did this come out? Probably ages ago

hoary parcel
#

last month

meager lantern
#

Oh nevermind then

hoary parcel
#

if something is missing, yell at @pale crow ๐Ÿ˜„

#

if its working, send tacos to @pale crow

meager lantern
#

Hahah, I just need the version so all should be good ๐Ÿ˜‰

pale crow
#

The hell you talking about

hoary parcel
#

the new api you build

pale crow
#

Caching is like 5 hours

bronze marten
#

Oof

pale crow
#

I have no idea how the legacy API works tho, I'm assuming it does the same thing I do which is just db.

bronze marten
#

arent there events called when a resource updates or sth? Then just updste the resource cache version?

frigid ember
#

what does a legacy vsrsion mean

#

ping me if u answer

pale crow
#

there are no events

#

It's only 5 hours. Y'all can wait.

#

Lol

bronze marten
#

Mh ill stick to github then

#

๐Ÿ˜‚

pale crow
#

?

#

The code is on GitHub...

bronze marten
#

No i mean for fetching version for my plugins

pale crow
#

How you fetching version of plugins with github

radiant pollen
#

@frigid ember legacy means old and replaced by something newer

vale slate
#

there is a github api for that

bronze marten
#

Git tags

pale crow
#

Lmao ok

bronze marten
#

And then just use github api indeed

unreal hedge
#

So I want to create my first modular project, any advice on where I should start?

pale crow
#

Well, if that works for you great. Most people posting resources don't even use git let alone tag their versions

#

But releasing more than once in a 5 hour period smells like bad developer to me and is not an argument for reducing the cache time in the api

meager lantern
#

It's no so much that, we'd like to notify users the second a new version comes out

#

Or within let's say 10 minutes

vale slate
#

well releasing is not working like that

pale crow
#

So what? Are you repeatedly hitting the API every 10 minutes?

#

How does your checker work

meager lantern
#

Yup, it hits the API every 10 minutes

vale slate
#

It is a notifier build in Github, if you update a source the software will be notified

pale crow
#

What the fuck

vale slate
#

at least the one I use does that

#

Yup, it hits the API every 10 minutes
@meager lantern that's what i call bad practice

pale crow
#

we dont have webhooks

#

which is what you're talking about mfm

#

anyway, yeah hitting it every 10 mins is a shit idea. every hit you renew that 5 hour cache period

vale slate
#

yeah, there is a github api for java using webhooks

pale crow
#

ye i thought you were suggesting to add webhooks to the spigot api

meager lantern
#

Yeah, there's no way for me to get a callback from the API, which I've got to periodically call the API

safe robin
#

alright im back, i read through the comments and suggestions you guys had on my Main class and I made some adjustments (most notably changing parent.createFile() to parent.mkdirs(), at least i think this is what you guys suggested), but im still getting the same NPE, ill post the hastebin below so that you guys dont have to scroll all the way up https://hasteb.in/vilasuhu.gradle

meager lantern
#

It's not so much bad practice as there's no other option, the API has no rate limit and no guidance as to how often we're allowed to use it

vale slate
#

ye i thought you were suggesting to add webhooks to the spigot api
It would be a nice feature

pale crow
#

polling at that scale is bad practice

#

you could reduce the frequency

meager lantern
#

But is a rolling cache? I've been using the Legacy API up until now and it seems to me up until not too long ago it was either not cached or at least not a rolling cache

vale slate
#

even if it would not be cached, if your update checker frequency is 5hrs there is no problem to it

meager lantern
#

Granted even if I were to poll it every 5+ hours, then there would be too many users polling it to cause it to ever release the cache

pale crow
#

thats correct and as for adding webhooks to this, we more than likely cannot as we'd have to add user reg, auth, whatever and we're simply not doing that

#

it caches per user.

#

its not per resource.

vale slate
#

yes to be more specific, per region (also)

pale crow
#

if you hit it, you get a 5 hour cache.
if another person hits it, they get a 5 hour cache.

#

that line of code applies the cache to the requestor's browser

#

and then yes, behind that is the CF cache

meager lantern
#

I mean y'all were talking about Cloudflare's cache earlier

pale crow
#

there is the browser cache, then CF cache

vale slate
#

and the OS cache

#

on some systems

bronze marten
#

Browser cache can be cleared, CF not

meager lantern
#

Yeah, well my resource doesn't respect the cache header sent to it

pale crow
#

ok, then you dont have to worry about it

#

i believe CF is set to the same amount of time though

#

which is my point, there is no point in polling every 10 minutes

#

you're just wasting your and spigot's bandwidth

#

reduce your polling period

vale slate
#

CF is complicated as it splits it also to the regional servers

pale crow
#

if you want to yell at someone and tell them to change it, that'll be md_5

#

i only made that api to use in my resource, and md made it public

meager lantern
#

Well I'm wasting my users and spigot's bandwidth
But yeah, I don't think there has always been a cache, as it always seemed to update quite quickly

vale slate
#

I only give auto updates out if a user specifically registers for those

meager lantern
#

Either that or it was a short one

pale crow
#

regardless, polling every 10 minutes is stupid. if i found that any of my plugins were sending net requests every 10 minutes forever i would remove them from my server hands down

#

i'd only update check onEnable or on a way less frequent scale

#

that's ridiculous

bronze marten
#

on admin player join

#

And on server startup

#

Is my approach

vale slate
#

I'll stay with my webhooks

pale crow
#

webhooks wouldn't even work in this case for a public plugin

vale slate
#

true

pale crow
#

we'd have the same problem every time he updates

#

we'd have to send X requests

#

X being how many are running his shit

vernal spruce
vale slate
#

I balanced them to do not update all the same

#

time

pale crow
#

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

bronze marten
#

Idc thats githubโ€™s problem if a lot of ppl start downloading releases at the same xd

meager lantern
#

Again, if there's no API key or guidance as to how frequently users should be allowed to poll an API, then I'm going to poll it as often as I see fit

But now that there's a long cache on it, I'll be toning that down to 5 hours

pale crow
#

im not saying that is a guideline or rule

#

im saying that it's a shit idea for you to put into a plugin

wheat summit
#

Hey! I tried entering an end portal and it didn't work, there are plugins, does anyone know the cause?

vale slate
#

Hey! I tried entering an end portal and it didn't work, there are plugins, does anyone know the cause?
@wheat summit a little more specific on there

meager lantern
#

I'm aware that it's not a guideline, I'll be changing it solely because of the CF cache

wheat summit
#

I used end eyes to get to a portal and tried entering it on activating and I fell through

vale slate
#

well contact the server owner

#

if you are not the owner we can't help you

pale crow
#

im not even talking about cache at this point, im talking about being a sane person and caring about the people that use your plugin. if you don't, then...whatever you can stop reading. if you do? what the fuck are you doing???? just do it onEnable and when someone with perms logs in. what's the point in polling for updates? it's ridiculous mate.

wheat summit
#

Oh I'm talking with them, they don't know the problem either

#

Should I put a list of plugins here?

radiant pollen
#

@wheat summit Tell them to check the bukkit.yml

vale slate
#

Should I put a list of plugins here?
please send them here directly

wheat summit
#

Ok, is there a portal option in there?

#

Ok

radiant pollen
#

allow end

vale slate
#

@wheat summit Tell them to check the bukkit.yml
and that

wheat summit
#

Allow ende is true

#

I'll get the plugin list

vale slate
#

yes

meager lantern
#

Caring about my the people that use my plugin? It's a document the size of just a few bytes every 10 minutes?

#

That's less than some of the packets being sent hundreds of times a second on the server

vale slate
#

I think we should drop this discussion

hoary parcel
#

just dont

pale crow
#

okay, whatever. i don't have time for this literally retarded ass bullshit

meager lantern
#

I could understand this being an issue from Spigot's side

hoary parcel
#

why is this so hard to understand?

vale slate
#

okay, whatever. i don't have time for this literally retarded ass bullshit
please mind your language

meager lantern
#

That makes sense

digital sphinx
#

So i downloadet a Spigot 1.15.2 jar. But its outdatet. SO i get build tools and type java -jar BuildTools.jar --rev 1.15.2 . But he said git dont work. So i want to make it manualy. But i dont find the github page from spigot

hoary parcel
#

mild swearing is allowed kill crafter

digital sphinx
#

Can somebody send me the link

austere flame
#

did you install git on your computer Adrian?

digital sphinx
#

I have a debian 10 server

lone rapids
#

Anyone see something wrong with line 62?

digital sphinx
#

i dont know. But its a essentail or not?

lone rapids
#

Supposed to be a nullpointervalue there

austere flame
#

im p sure buildtools needs a git install to work

radiant pollen
#

@lone rapids getDisplayName is nullable.

bronze marten
#

Why are you repeating stuff so many times

austere flame
#

otherwise publishing straight downloads for spigot is illegal, that's the whole reason og bukkit got shut down a few years go

radiant pollen
#

actually wait

#

hmm

bronze marten
#

Just initialize a reference to the object u need

vale slate
#

@lone rapids you should check the other way around

frigid ember
#

Help me please

radiant pollen
#

?ask

worldly heathBOT
#

If you have a question, please just ask it. Don't look for staff or topic experts. Don't ask to ask or ask if people are awake or available. Just ask the question to the channel straight out, and wait patiently for a reply.

frigid ember
#

I have a problem with GoldenCrates

vale slate
#

very specific

naive goblet
#

@lone rapids When checking strings, Enums and primitives. Using switch is preferable

radiant pollen
#

@lone rapids Taken from the docs for getDisplayName(): Plugins should check that hasDisplayName() returns true before calling this method.

naive goblet
#

Itโ€™s probably Nullable then?

lone rapids
#

.

#

Ye thanks

#

I'm adding a statement rn

radiant pollen
#

The docs say not null, but that line indicates otherwise I guess...?

frigid ember
#

I put the golencrates.user permission on the player but he doesn't have access to the crates

vale slate
#

or simply turn around the equals statement

naive goblet
#

Air will return null Zax iirc

old barn
#

How can I check if the player has the empty inventory?
if(p.getinventory().getcontents().lenght == 0) is work?

bronze marten
#

What

vale slate
#

whut

radiant pollen
#

"proper"

#

Wdym?

old barn
#

Im not english bro '-' sry

vale slate
#

^

frigid ember
#

Does anyone help me?

lone rapids
#

I think he essentially means what I was doing

vale slate
#

oh now I understand

radiant pollen
#

@frigid ember I've never used that plugin before. Is there a wiki for it?

lone rapids
#

Hard you have to compare the getInventory to an inventory object you created I think

naive goblet
#
switch (item.getDisplayName()) {
case โ€œstring1โ€: {
//code
break;
}
//case ...
default:
  //if no cases are found 
``` @lone rapids
frigid ember
#

I think so

radiant pollen
#

Read the wiki. There's probably other permissions you need to add.

frigid ember
#

I got the plugin from the site and got permission from there but it doesn't work

vale slate
#

Please contact the developer first @frigid ember

naive goblet
#

When making items with meta etc you should make some type of ItemBuilder Nemesis.

lone rapids
#

Conclure, that is confusing sir. My java level is not there yet. What does the switch do? ๐Ÿ˜ฎ

#

oh

frigid ember
#

There is no discord and they do not even enter the site

lone rapids
#

I have an ItemStack method

naive goblet
#

Okay so switch is instead of checking strings with if, else if, else if etc

tiny dagger
#

More control rather than an if else statement @lone rapids

old barn
#

How can I check if the player has the empty inventory?
if(p.getinventory().getcontents().lenght == 0) is work?

haughty stag
#

@old barn I think inventory#getContents#length will always return the size of the inventory, and if it was empty it would just be full of air/null

quasi seal
#

Hello, is there any algorithm to paste schematics like villages in minecraft in a world ? Knowing the fact that the world is already created ?

naive goblet
#

public class ItemBuilder<T> implements Supplier<T> {
    private final ItemStack itemStack;
    private final List<Consumer<T>> metaList = new LinkedList<>();

    public ItemBuilder(@Nonnull final ItemStack itemStack) {
        this.itemStack = itemStack;
    }

    public ItemBuilder<T> withName(@Nonnull final String string) {
        return withMeta(meta -> meta.setDisplayName(string));
    }

    private ItemBuilder<T> withMeta(@Nonnull final Consumer<T> consumer) {
        metaList.add(consumer);
        return this;
    }
    
    @Override
    public ItemStack get() {
        final ItemMeta itemMeta = itemStack.getItemMeta();
        metaList.forEach(e -> e.accept(itemMeta));
        itemStack.setItemMeta(itemMeta);
        return this.itemStack;
    }
}
``` I mean some ItemBuilder like this or just methods to add stuff returning the ItemBuilder then a build method that turns into an ItemStack
#

(Mortal)

lone rapids
#

(Okay) I will look at that, thank you Conclure

haughty stag
naive goblet
#

Maybe generics is too advanced for that wait let me write some simplified stuff

vale slate
#

I just wanted to say

frigid ember
#

How to set a players exp?

#

What can I do if I have neither a wiki nor a discord?

rapid yacht
#

Hey guys, I have a GTA server, including a ton of pvp. Now i'm having trouble choosing a version for it, 1.8.8 is the home of pvp, and where everything was originally setup on my server, 1.12.2 is more updated, allows for longer nametags, but not so good for pvp, and imo isn't a good look for a GTA server, Can I get some opinions please? ๐Ÿ™‚

lone rapids
#

player.setLevel(int number); I think aimorris

naive goblet
#

class Builder {
private final Material material;
private int count = 1;
private String name = null;
public Builder(Material material) {
  this.material = material;
}
public Builder setName(String name) {
this.name = name;
return this;
}
public ItemStack toItemStack() {
  ItemStack item = new ItemStack(material, count);
  ItemMeta meta = item.getItemMeta();
  meta.setDisplayName(name);
  item.setItemMeta(meta);
  return item;
}```
frigid ember
#

nope

naive goblet
#

Mortal something like this perhaps

lone rapids
#

TheSisquatch, do you have google? O.o

radiant pollen
#

@frigid ember setExp()

frigid ember
#

I searched for nothing

radiant pollen
#

@rapid yacht 1.8 pvp is trash, imo. How is 1.12 not a good look for a server?

naive goblet
#

Wrong

haughty stag
#

People don't like change.

naive goblet
#

Non of them are very good Iโ€™d say

frigid ember
austere flame
#

@rapid yacht 1.12 w/ a 1.8 combat plugin

bronze marten
#

Go 1.8 or 1.15, no in between

#

๐Ÿ˜‚

rapid yacht
#

@radiant pollen I mean it isn't rlly a good look for a GTA server imo

radiant pollen
#

how tho

#

why

rapid yacht
#

@austere flame it doesn't rlly feel the same, does it?

#

idk it's just a feeling

#

it doesn't go together

lone rapids
#

Thank you conclure

austere flame
#

ig but tbh i really like the 1.9+ combat so ๐Ÿคทโ€โ™€๏ธ

naive goblet
#

So you can add a method to change the size

radiant pollen
#

@frigid ember setExp is a method on Player. what does getPlayer() return?

naive goblet
#

And maybe lore ?

frigid ember
#

A player?..

radiant pollen
#

What version are you on

frigid ember
#

Oh wait it returns a HumanEntity

radiant pollen
#

My server is 1.15 pvp and I think it's more fun than 1.8.

#

Yeah I thought so.

#

I mean, I've changed literally everything about the PVP so it wouldn't matter if it was 1.8 or 1.15 but you get it

quasi seal
#

Hello, is there any algorithm to paste schematics like villages in minecraft in a world ? Knowing the fact that the world is already created ?

junior acorn
#

hello everyone, i have an issue with group manager says format is correct but when i load up server i get a big error saying the file is wrong but i double checked it using online yaml checker

#

this file is driving me crazy

#

๐Ÿ˜ฆ

naive goblet
#

private List<String> lore;
public Builder setLore(String... lore) {
lore = Arrays.stream(lore).map(Utils::color).collect(Collectors.toList());
return this;
}
@lone rapids

lone rapids
frigid ember
#

Can anyone help me solve the problem with GoldenCrates please?

naive goblet
#

Uhm itโ€™s decent

lone rapids
#

Didn't accept an array tho, for lore

naive goblet
#

I can be on pc tommorow so can probably help you more then

radiant pollen
#

@frigid ember We didn't make the plugin. If there's no wiki or doc then we can't really help

wheat summit
#

Sorry for the late reply though here's the list of plugins we have:
Plugins (77): KitsPreview, MazeGenerator, PlaceholderAPI, PlugMan, CustomDrops, ViaVersion, NBTAPI, ViaBackwards, LuckPerms, ClearLag, WorldBorder, BuycraftX, BannerBoard, Votifier, Multiverse-Core, ProtocolLib, MovingDevApi, VotingPlugin, BlowableObsidians, BanGUI, MVdWPlaceholderAPI, FastAsyncWorldEdit, IPWhitelist, mcMMO, ItemStacker, Vault, EnhancedPlayTime, ViaRewind, BlockParticles, FastAsyncVoxelSniper, Trading, HolographicDisplays, Marriage, RewardPRO, ActionAPI, VoxelSniper, PlayerVaults, HubBasics, Bank, ShopGUIPlus, WorldEdit, CustomEnderChest, Essentials, HeroBounty, Citizens, DiscordSRV, CrazyAuctions, EssentialsChat, Parkour, Lottery, CrazyCrates, LeaderHeadsRevamped, WorldGuard, Factions, Quests, EssentialsProtect, EssentialsAntiBuild, CommandNPC, CombatLogX, EssentialsSpawn, BungeeTabListPlus, CompatNoCheatPlus, KoTH, SilkSpawners, ShopGUIPlusSilkSpawnersBridge, NoCheatPlus, ECore, WGCustomFlags, ProCosmetics, StackMob, NeoMoreTPPlus, CrazyEnvoy, WGPlayerDamageFlags, CrazyEnchantments, MyPet, Jobs, TreeAssist

lone rapids
#

Ahh cool man

naive goblet
#

You can change the last parameter mortal till String... lore

wheat summit
#

We're not sure if any off them are stopping the end

junior acorn
#

this is my error for group manager:

naive goblet
#

Then lore is
List<String> lore = Arrays.asList(lore);

frigid ember
#

It's a wiki but I don't know where to go

radiant pollen
#

@wheat summit Check the essentials config, the multiverse config, the worldborder config, hubbasics. I image all of those could be messing with it.

junior acorn
#

can someone translate for me please

#

would really appreciate it

naive goblet
#

And you can then write item(Material material, String name, String loreline1, String loreline2);

#

Since you used varargs in the last parameter

wheat summit
#

Ok thanks

radiant pollen
#

@frigid ember You either created the crate wrong or they don't actually have the permission.

keen moth
junior acorn
#

i did run it through YAML parser and it says it was ok

#

i check it twice

keen moth
#

probably not in a format that groupmanager likes

#

send your groups.yml

#

?paste

worldly heathBOT
junior acorn
#

this is my gm:

#

i copy and paste to yaml checker and it says it passed

digital sphinx
#

I have now install git and have now so much new things on my Server. I only want a Spigot.jar is it so Hard? ๐Ÿ˜ญ ๐Ÿ˜ญ ๐Ÿ˜ญ
Please help i dont understand englisch very well. So i read, Readme.md but it dont get me forward. Please help

radiant pollen
#

@digital sphinx what was the error when you ran buildtools

frigid ember
#

I have copied the permission from the plugin site, or I think I need to install the latest version, as the version I have I think has been fixed

digital sphinx
#

No error but i get 6 new folders and in Spigot is no spigot.jar

keen compass
#

?bt

worldly heathBOT
radiant pollen
#

Go to /Spigot/Spigot-Server/target

#

It's really not hard to look through some folders dude

junior acorn
#

i just checked again:

digital sphinx
#

Go to /Spigot/Spigot-Server/target
@radiant pollen There is in the Spgot folder only CraftBukkit Patches and Bukkit Patches and .git

radiant pollen
#

Then you didn't run buildtools correctly or it hasn't finished.

digital sphinx
#

it was finished i type "java -jar BuildTools.jar --rev 1.15.2"

keen compass
#

did you follow the buildtools guide ?

keen moth
#

Try saving your config file in UTF-8 and try again @junior acorn

vale slate
#

it was finished i type "java -jar BuildTools.jar --rev 1.15.2"
@digital sphinx please send your latest build log

digital sphinx
radiant pollen
#

Try it again @digital sphinx

keen moth
#

Make sure the entity is an armorstand, cast to armorstand. profit.

vale slate
#

setArms(true)

digital sphinx
#

@digital sphinx please send your latest build log
@vale slate If i copy and paste in Discord, discord crash

radiant pollen
#

You should verify

vale slate
#

well paste it to a pasteserver

radiant pollen
#

with your spigot account

junior acorn
#

does it matter what format file is under is YAML picky when it comes to txt unicode format

#

?

frigid ember
#

If I delete the GoldenCrates plugin and add a newer one, is it possible to work?

vale slate
#

If I delete the GoldenCrates plugin and add a newer one, is it possible to work?
@frigid ember ask the developer, we are not omniscient

junior acorn
#

omg is works

#

resaved as UTF-8

#

idk why that matters

vale slate
#

it's the encoding

frigid ember
#

Well, the developer has not joined since 2015

#

๐Ÿ™‚

junior acorn
#

thank you for the help

#

โค๏ธ

frigid ember
#
  GameMode oldGameMode;

  @EventHandler
  public void onInventoryOpen(InventoryOpenEvent e) {
    if (e.getInventory() instanceof EnchantingInventory) {
      GameMode oldGameMode = e.getPlayer().getGameMode();
      e.getPlayer().setGameMode(GameMode.CREATIVE);
    }
  }

  @EventHandler
  public void onInventoryClose(InventoryCloseEvent e) {
    if (e.getInventory() instanceof EnchantingInventory) {
      e.getPlayer().setGameMode(oldGameMode);
    }
  }

The enchanting inventory opening works fine, my gamemode is set to creative. But then when I close the enchanting inventory, my gamemode doesn't get set back?

radiant pollen
#

@frigid ember What are you talking about? The plugin was updated yesterday...

junior acorn
#

thanks @keen moth

keen moth
#

np ๐Ÿ™‚

frigid ember
#

Nevermind, I'm blind and didn't read console.

digital sphinx
#

with your spigot account
@radiant pollen I am 15. So under 16 . It would be illigal. Because the EU say no data collection for people under 16.

frigid ember
#

yes

keen moth
#

why are you appending to the ZERO constant

#

just use new EulerAngle(...)

vale slate
#

^

keen moth
#

also they're in radians, not degrees ๐Ÿ˜‰

vale slate
#

@radiant pollen I am 15. So under 16 . It would be illigal. Because the EU say no data collection for people under 16.
@digital sphinx not quite correct

keen moth
#

it's stupid bc nms uses degrees but bukkit uses radians ๐Ÿค”

vale slate
#

you need your parents to approve

vernal spruce
vale slate
#

it's stupid bc nms uses degrees but bukkit uses radians ๐Ÿค”
@keen moth and forge uses degrees from 0 to 100

keen moth
#

wat

naive stratus
#

Anyone here knows what makes the Eye of Ender fly when its thrown? And can I use it to make an item do something similar?

frigid ember
#

What if you need 101 degrees?

vale slate
#

setVelocity

digital sphinx
#

you need your parents to approve
@vale slate So i can make it tommorow. Because i live in UTC +1 Its now 1 am

naive goblet
#

@naive stratus hmm

keen moth
#

he means its capped at 100, i.e it gets clamped. 101 = 1

vale slate
#

What if you need 101 degrees?
@frigid ember I wasn't precise 90 degrees are 100 ndegrees

digital sphinx
#

Or i can also make a illigaly thing. But i dont want go in Prison.

vale slate
#

not for that

naive stratus
#

setVelocity could work I guess, but I would not get the same effect. It can be done ofc, but I would really like to avoid that

frigid ember
#

What are you in for? I made a Discord account when I was only 15 ๐Ÿ˜ฆ

vale slate
#

setVelocity could work I guess, but I would not get the same effect. It can be done ofc, but I would really like to avoid that
@naive stratus it will

#

else you can use shoot

#

or whatever it is called

naive stratus
#

I will give it a shot... Heh.. ๐Ÿ˜

vale slate
#

Or i can also make a illigaly thing. But i dont want go in Prison.
@digital sphinx The only one who would get problems is md_5 if he would know that you are doing it

keen moth
#

it's in radians not degrees @frigid ember

digital sphinx
#

@digital sphinx The only one who would get problems is md_5 if he would know that you are doing it
@vale slate okay

vale slate
#

I'm off now it's 1AM for me, bye

naive stratus
#

Anyone has an idea of what event the eye of ender fires when it starts flying?

#

I want to cancel it and set my own direction/velocity

#

Thought of using PlayerInteractEvent and cancel that, but it can only give me an ItemStack. Need an Item for setVelocity.

radiant pollen
#

It's PlayerInteractEvent.

naive goblet
#

ProjectileLaunchEvent?

vale slate
#

you need a entity

radiant pollen
#

You spawn an Item and then setVelocity()

dusty topaz
#

ProjectileLaunchEvent

#

yeah

vale slate
#

EnderSignal is no Projectile

naive stratus
#

@radiant pollen True, that could work. Will do that.

frigid ember
#

Why is Spigot API so shit?

radiant pollen
#

wtf do you mean

dusty topaz
#

Ah

naive goblet
#

EntitySpawnEvent jens?

dusty topaz
#

For ender eye, @naive stratus you want to EntitySpawnEvent

#

cast to EnderSignal

#

set target

naive stratus
#

Beautiful! Thank you. Even better.

radiant pollen
#

Oh I got the impression he was trying to launch some other item like an ender eye...

#

but yeah if you're just trying to shoot an ender eye then do that

naive stratus
#

Yeah I probably explain it a little bad. Sorry ๐Ÿ˜›

#

/giphy You're all awesome

#

Oh... But you get what I mean.

dusty topaz
#

I thank you for the attempt โค๏ธ

vernal spruce
#

Hmm boys,should i register a listener for each individual object or everything in one?

frigid ember
#
  GameMode oldGameMode;
  int oldExp;

  @EventHandler
  public void onInventoryOpen(InventoryOpenEvent e) {
    if (e.getInventory() instanceof EnchantingInventory) {
      Player p = (Player) e.getPlayer();

      oldExp = p.getTotalExperience();
      oldGameMode = p.getGameMode();
      e.getPlayer().setGameMode(GameMode.CREATIVE);
    }
  }

  @EventHandler
  public void onInventoryClose(InventoryCloseEvent e) {
    if (e.getInventory() instanceof EnchantingInventory) {
      Player p = (Player) e.getPlayer();

      p.setGameMode(oldGameMode);
      p.setTotalExperience(oldExp);
    }
  }

Any ideas why my experience isn't getting set back to how it was before the enchanting table was opened? The gamemode works perfectly.

vale slate
#

I'm trying to shoot an armorstand in a curve with the item in the hand aligning tangential to the flight curve, that is a pain

dusty topaz
#

setTotalExperience isn't xp

#

it's a culmination of all xp ever

frigid ember
#

oh

naive goblet
#

getTotalExp aswell

dusty topaz
#

you want to setExp and setLevel

#

not setTotalExp

frigid ember
#

I mean

naive goblet
#

@vernal spruce Specify

frigid ember
#

getTotalExperience() - Gets the players total experience points.

#

easy mistake to make

naive goblet
#

Yeah it could be more clear

dusty topaz
#

nah its clear

radiant pollen
#

no it isnt

frigid ember
#

I had troubles with this too :/

dusty topaz
#

you just need to understand that minecraft stores xp and levels

#

not just xp

#

so perhaps clarification would be desirable but it's correct

naive goblet
#

โ€œGets the players total experience points from all levelsโ€

#

Would be more clear

dusty topaz
#

'Gets the players total experience earned' or something yeah

frigid ember
#

Wait so I have to getExp and getLevel and then setExp and setLevel?

dusty topaz
#

ye

frigid ember
#

ok

radiant pollen
#

I always had the impression that the total exp methods were the exp required for how many levels you have + your current exp progress

vernal spruce
#

@naive goblet custom object,let's say a block made to do something,wich should stop certain events from happening,best example,a custom entity who opens a certain inventory when right clicked

radiant pollen
#

so if you used them, it would take care of level and exp progress for next level at once

frigid ember
#

yo, sorry to interrupt but I have a question about packets

#

This used to work before 1.15 and now doesnt :/

keen compass
#

ask away

frigid ember
#

packets of what

#

chips?

naive goblet
#

I mean having every event in one listener class isnโ€™t smart

keen compass
#

sounds normal for packets

#

but continue on

frigid ember
#

heh

naive goblet
#

I think the handlers are classwise

frigid ember
#

has to do with entity metadata

#

I had this lovely way of making holographic text with EntityArmorStands

vernal spruce
#

@naive goblet thing im asking,is it bad to have a listener for each object rather than piling em all in one?

frigid ember
#

gonna post some code ofo

keen compass
#

ah, entity metadata isn't required no more and gets sent as a separate packet

frigid ember
#

ah!

naive goblet
#

Send code

silk bane
#

avoid registering/unregistering listeners frequently

frigid ember
#

            Player player = Bukkit.getPlayer(sender.getName());
            Location loc = player.getLocation();
            
            WorldServer s = ((CraftWorld) loc.getWorld()).getHandle();
            EntityArmorStand stand = new EntityArmorStand(s, loc.getX(), loc.getY(), loc.getZ());
       
            stand.setLocation(loc.getX(), loc.getY(), loc.getZ(), 0, 0);
            stand.setCustomName(new ChatComponentText("Test text"));
            stand.setCustomNameVisible(true);
            stand.setInvisible(true);
            stand.setNoGravity(true);
            stand.setMarker(false);
            stand.setSmall(true);

            PacketPlayOutSpawnEntityLiving packet = new PacketPlayOutSpawnEntityLiving(stand);
            ((CraftPlayer)player).getHandle().playerConnection.sendPacket(packet);
#

this is just with a command at this point

#

also tried this

naive goblet
#

@vernal spruce send the listener

frigid ember
#

            PacketPlayOutEntityMetadata meta = new PacketPlayOutEntityMetadata(stand.getId(), new DataWatcher(stand), true);
            ((CraftPlayer)player).getHandle().playerConnection.sendPacket(meta);
#

still seems to be appearing as a regular old ArmorStand though :U

keen compass
#

so, when using packets, entity metadata may or may not be there and just no longer required to be in that packet. So sometimes the metadata gets sent as another packet especially if metadata gets added to the entity afterwards

naive goblet
#

It really depends on what type of event listeners as well

#

Like the PlayerMoveEvent gets fired pretty frequently and itโ€™s wise having its own class for it in most cases

radiant pollen
#

Why does that matter?

silk bane
#

it doesn't matter.

vernal spruce
#

one of the events '//Events
@EventHandler
public void onRClick(PlayerInteractEntityEvent e) {
if(e.getRightClicked().equals(cat)) {
e.setCancelled(true);
if(e.getPlayer().equals(p)) {
pl.playerM.managePlayer(p);
pl.playerM.getHandle(p).setHandler(new GuiHandle(p,cc));;
}
}
}'

frigid ember
#

hm, alright - since I'm still a bit new to packets though, should i be sending the EntityMetadata packet before it spawns or after?

keen compass
#

after

vernal spruce
#

listened on each instance of the object

keen compass
#

entity metadata packet comes after the entity spawn packet

vernal spruce
#

events like those wich dont get fired often

frigid ember
#

ah, alright - ye, I have it open in a separate window, but the code above seems to not be doing the thing

naive goblet
#

Stellrow I think you can keep it in one eventhandler if youโ€™re down casting

frigid ember
#

there's a boolean at the end though, which I couldn't find on the wiki - maybe that is it

dusty topaz
#

yeah it isn't on there, that's weird ..

naive goblet
#

Why does that matter?
It matters. All event methods gets fired somewhere right? Firing an event frequently with a big code can take on the performance.

#

Well it depends on the code obviously

radiant pollen
#

If the event code is the same for each instance of the entity, you shouldn't put it in the class. You're duplicating code.

#

You're also not using any object fields. Everything in there is from the event or static.

vernal spruce
#

im using instance variables

radiant pollen
#

So there's no point in having it as part of the object.

vernal spruce
#

egetrightclicked equals cat points to object entity

#

getplayer equals p points to object's player

radiant pollen
#

oh okay i missed that

vernal spruce
#

np

naive goblet
#

Is that an event to open guis?

vernal spruce
#

yes,it will open a gui on right click

#

it does*

naive goblet
#

I mean have you tried InventoryHolder ? With abstract methods that fires on event?

vernal spruce
#

havent got into it yet

#

that code it's pretty old

naive goblet
#

It works better than comparing titles

vernal spruce
#

its not rly comparing titles..

#

public GuiHandle(Player pp,CustomConfig config) {
this.cfg=config;
this.p= pp;
openMenu(p);

naive goblet
#

Yeah but I mean I suppose you have different GUIs depending on entity interacted with right?

vernal spruce
#

this is the constructor for it

#

yes

#

it will create a gui based of the config given

naive goblet
#

Hmm you have same config for all or different ones ?

vernal spruce
#

each player has one

#

created with theyr uuid..

naive goblet
#

Each Player has one for each Entity?

vernal spruce
#

its a pets plugin,only 1 per player

#

wich holds his pet's info

bronze marten
#

Player pp xd

naive goblet
#

Oh

#

lol

bronze marten
#

Reconsider that part

vernal spruce
#

i know how the players on the server i made this for are

#

they deserve it๐Ÿ˜‚

naive goblet
#

Stellrow have you worked with abstraction?

vernal spruce
#

not yet,don't think it will be that hard

naive goblet
#

Well I strongly suggest involving yourself into it. Itโ€™s really insane stuff once you learn it (:

#

Very useful

nova mural
#

abstraction is a good time

vernal spruce
#

it can't be that hard to quickly learn it

unreal hedge
#

Can't you just compare the entity's UUID's?

vernal spruce
#

they are deleted/spawned on player join/leave

naive goblet
#

:0

vernal spruce
#

i mean theyr invincible,they have skills,they always teleport to the player..

#

dont think i should let them free without the owner

naive goblet
#

Seems fair enough

vernal spruce
#

They mostly get annoying as you can't just hit them/easly move them

unreal hedge
#

Isn't there a type of metadata you can attach to entities?

#

You should probably query for that first, before checking if it's that particular entity.

vernal spruce
#

it's better to have them removed so there wont be 400 custom entities roaming the server for no reason..

#

i have a list holding each object

unreal hedge
#

Imagine whenever someone attaches a leash to some random animal or tries to feed one or attacks a monster

naive goblet
#

Metadatable

unreal hedge
#

Every single time, it's going to search for that lol

vernal spruce
#

rightclick is disabled on the pets,it only opens the gui if owner did it

#

also im just checking if the clicked entity is equal to mine

#

so its not rly doing much just checking if its the same

#

rather than looping thourgh anything

naive goblet
#

Do it your way. If you feel for a round of nitpicks just go here (:

vernal spruce
#

i will have to switch to abstract inventory holder

#

as it seems the best way to handle this

naive goblet
#

Yahhh

#

Thatโ€™s what I use even if md_5 triggers himself on the misleading interface InventorHolder

vernal spruce
#

feels bad that i have to kill compatibility to use nbt

keen moth
#

not rly, just modularize your project

vernal spruce
#

im lazy... also i didn't do it once yet

#

as im on eclipse

naive goblet
#

Migrate to IJsmilingBlackGuyWithFingerOnHead

vernal spruce
#

tried.. couldnt get it to work,it got stuck at the way i get plugin instance

#

so threw it in the bin

naive goblet
#

:/

#

Isnโ€™t it the same?

vernal spruce
#

I use JavaPlugin.getPlugin to grab my plugin

naive goblet
#

DI exists

unreal hedge
#

As do I, but I usually use hierarchies where I can for that.

vernal spruce
#

the only reason its because its shorter

naive goblet
#

Wew static

vernal spruce
#

private PetsMain pl = JavaPlugin.getPlugin(PetsMain.class);

naive goblet
#

It should only be used where static is needed

#

such as in the static block

bronze marten
#

I donโ€™t get the static hate

#

Its nice

naive goblet
#

Send ur code :0

vernal spruce
#

never used it so far

bronze marten
#

Just be careful as a developer

naive goblet
#

Well thing is obviously you already know but static is never getting gcโ€™d so theyโ€™re kept in memory

bronze marten
#

Sure

#

But for some thing u dont want them ro be gcโ€™d

naive goblet
#

Yeah

vernal spruce
#

dem block of config messages

naive goblet
#

Imagine constants

wanton delta
#

hi everyone what is the event for picking up an arrow

naive goblet
#

And sometimes itโ€™s better to create new instances instead of bombing your gc

#

PickupItemEvent

#

Or smtng

wanton delta
#

ah

#

i saw that

#

wasnt sure

naive goblet
#

Whether an arrow entity can be picked up depends on its status

wanton delta
#

theres also PlayerPickupArrowEvent

#

couldve looked on the docs ๐Ÿ˜…

#

but it also triggers pickup item event... which is strange

frigid ember
#

hi everyone what is the event for picking up an arrow
theres also PlayerPickupArrowEvent

vernal spruce
#

is that a thing?

wanton delta
#

deprecated

vernal spruce
#

oh boy

#

called out

ashen stirrup
#

Just listen for when a player picks up an item and check if itโ€™s an arrow?

unreal hedge
#

@wanton delta if an arrow is on the ground as a dropped item, it would only trigger PlayerPickUpItemEvent (or whatever it is called), otherwise it would trigger both x)

wanton delta
#

yea

#

which i find funny

#

because im actually detecting a trident being picked up

#

but saying event.getItem() instanceof Trident amuses me

frigid ember
#

If the server is stopped, will that trigger PlayerQuitEvent?

#

yep, any time the player leaves the server, PlayerQuitEvent is fired

#

though i am not exactly sure - when the plugin is disabled, it might not

#

or it might error out

vernal spruce
#

on server stop there is a chance

#

for the listener to be unregistered

#

so it might miss on that..

unreal hedge
#

I'm not sure if PlayerQuitEvent fires if the player is kicked

#

Doesn't PlayerKickEvent fire?

#

If that's even a thing..

vernal spruce
#

most used holograms plugin i should use for api?

#

or should i just screw it and spawn it myself?

ashen stirrup
#

most used holograms plugin i should use for api?
If youโ€™re looking for an API, I recommend HolographicDisplays

#

I'm not sure if PlayerQuitEvent fires if the player is kicked
It should

vernal spruce
#

so holographicdisplays its the go to plugin?

#

looking for compatibility with as many server as i can

ashen stirrup
#

Probably

vernal spruce
#

k,thank you

safe robin
#

ive been getting (almost, in different locations but on the same method call) the same exact NPE over and over again when calling YamlConfiguration.loadConfiguration(file) as well as when i tried to do YamlConfiguration.loadConfiguration(reader), hastebin for my (perhaps disgusting looking as im new to spigot development) main class here https://hasteb.in/kulayujo.gradle
as well as the stacktrace here
https://hasteb.in/gowexiju.sql
as stated earlier, im new to plugin development, so any help is appreciated

#

i've looked at tutorials given to me but none of them seem to be for what I want: a custom config file that saves my data of type HashMap<Player, TreeSet<TenzepitTag>> as well as HashMap<Player, String>

#

(and TenzepitTag is indeed serializable, as I found out it needed to be not too long ago lol)

haughty stag
#

How should I handle the storage of custom inventories? Is it smarter for each one to have its own file within a dedicated folder, or all in 1 file? The amount of inventories depend on the server. Also, should they save their contents to said file on every inventory change or save periodically, onDisable, exc? Seems like the former could invoke possibly hundreds of saves a minute depending on the use.

austere flame
#

dedicated folders sounds a lot easier to manage from the owner pov and it allows you to organize further or leave room for future functionality by letting you have more than one file in each folder

gloomy flower
#

DankRaft, by any chance you got an answer for Pitt's problem? xd

austere flame
#

I really don't know how to approach that, the best idea I can think of is going with a custom JSON

haughty stag
#

@austere flame Thought so, just wanted some confirmation.

#

@gloomy flower I'm looking into it now.

gloomy flower
#

eyyy ty ty

frigid ember
rotund fulcrum
#

yo i need help with EssentialsX sign shop

my problem:
can't sell music discs via sign shop

my players want it bad

upper hearth
#

@frigid ember Just open the other GUI?

safe robin
#

Dexty, you can call the method player.openInventory(Inventory), at least i think that's what it is

rotund fulcrum
#

yo i need help with EssentialsX sign shop

my problem:
can't sell music discs via sign shop

my players want it bad
update:
only record_13 sells

upper hearth
#

Is there an error for the other records?

rotund fulcrum
#

yes

upper hearth
#

What is it

rotund fulcrum
#

well im trying to sell the entire collection

#

im putting in the names off of an ID list for 1.8.8

#

nor the IDs work

#

it says "Invalid ID" or "Invalid name."

mossy zenith
#

any good, complete, guides on custom enchantments? I have made my enchantment. I can enchant items with it. however 2 things: Name of my custom enchantment does not display on the enchanted item, and when applying to item from a book it disappears entirely.

#

I think I may have found solution for book, but not sure because i haven't been able to try it just yet. But as far as name not showing up idk what to do

upper hearth
#

@rotund fulcrum What does your sign look like?

rotund fulcrum
#

[Buy]
1
record_(recordname/number)
$100

#

@upper hearth

upper hearth
#

And you're on 1.8?

rotund fulcrum
#

yes

haughty stag
#

@safe robin Do you know how to read stacktraces? It seems on the line 94 the only thing that could cause an NPE is the reader. But I don't see any issues with the reader or the file, however in the stacktrace the error is issued at method convertMapsToSections. I looked at that area in the file, specifically line 73 (of org.bukkit.file.YamlConfiguration). It's only ran if it isn't null, so something must be wrong with PaperMC which is what you are using or the serialization.

By the way, you should look into programming in OOP. Your Main file should really just exist to initiate everything else, house its instance, exc. To work with configuration, especially multiple different configs, you should have a separate class for each config, and it extends YamlConfiguration. Here is an example.

https://github.com/Ugleh/RedstoneProximitySensor/blob/master/src/main/java/com/ugleh/redstoneproximitysensor/config/LanguageConfig.java
And here is where I reference it: https://github.com/Ugleh/RedstoneProximitySensor/blob/master/src/main/java/com/ugleh/redstoneproximitysensor/RedstoneProximitySensor.java#L56

mossy zenith
#

still nogo on the book issue... yea i need a better guide or something.

safe robin
#

tbh its probably wrong with my serialization call, ill check it out. i have taken some courses in java but have really never applied it to a real application like spigot plugins so i definitely understand that my encapsulation and stuff needs to be better. im hoping that with practice my ability to code in java and other OOP will get better, but thanks so much for the response

wanton delta
#
        trident.remove();
        Vector vec = trident.getVelocity();

        EntityThrownTrident thrownTrident = new EntityThrownTrident(((CraftTrident) trident).getHandle().getWorld(),
                ((CraftPlayer) shooter).getHandle(), CraftItemStack.asNMSCopy(new ItemStack(Material.TRIDENT)));
        thrownTrident.fromPlayer = EntityArrow.PickupStatus.DISALLOWED;
        thrownTrident.shooter = shooter.getUniqueId();
        thrownTrident.getBukkitEntity().setVelocity(vec);
        ((Trident) thrownTrident.getBukkitEntity()).setShooter(shooter);

        ((CraftTrident) trident).getHandle().getWorld().addEntity(thrownTrident, CreatureSpawnEvent.SpawnReason.CUSTOM);
#

it semes to

#

run into a stackoverflow error

#

((CraftTrident) trident).getHandle().getWorld().addEntity(thrownTrident, CreatureSpawnEvent.SpawnReason.CUSTOM); at there

#

?paste

worldly heathBOT
wanton delta
#

anyone have a clue lol

#

i think its claiming the world is null? but im not entirely sure

velvet halo
#

Then check if the world is null ๐Ÿ˜‰

#

I haven't really touched any NMS but keep going back until something is null to make sure.

wanton delta
#

yea whats strange is that its fine for an egg entity lol

#

        Location loc = egg.getLocation();
        Vector vec = egg.getVelocity();

        EntityArrow eArrow = new EntityTippedArrow(((CraftEgg) egg).getHandle().getWorld(), loc.getX(), loc.getY(), loc.getZ());
        eArrow.fromPlayer = EntityArrow.PickupStatus.DISALLOWED;
        eArrow.shooter = shooter.getUniqueId();
        eArrow.getBukkitEntity().setVelocity(vec);

        Arrow arrow = (Arrow) eArrow.getBukkitEntity();
        arrow.setShooter(shooter);

        ((CraftEgg) egg).getHandle().getWorld().addEntity(eArrow, SpawnReason.CUSTOM);```
haughty stag
#

@mossy zenith Have you created a class that extends CustomEnchant and registered it? I don't know how you created your enchantment.

mossy zenith
#

extends Enchantment actually

#

and registered for sure

#

like i said it all works except you don't see the name of the enchantment on the item

#

and the book won't transfer enchantment to other items when you put them in anvil together

haughty stag
#

Sorry, your right. Should extends Enchantment.

mossy zenith
#

yea then i did all the overrides

#

and made an event listener for my enchantments actual ability

haughty stag
#

The reason the name isn't showing up is because Minecraft runs on localization and custom enchants don't. What does getName() in your custom enchant return?

rotund fulcrum
#

yo i need help with EssentialsX sign shop

my problem:
can't sell music discs via sign shop

my players want it bad

wanton delta
#

oh i see what happens

#

addEntity() seems to trigger ProjectileLaunchEvent

mossy zenith
#

@haughty stag it returns Bane of Ender as proposed in the code

haughty stag
#

Is that your enchantment name?

mossy zenith
#

yea

#
    @Override
    public String getName() {
        return "Bane of Ender";
    }```
wanton delta
#

if i may ask

#

what r u trying to do

mossy zenith
#

custom enchantments, this one in particular deals more damage to endermen, endermites, and ender dragon

wanton delta
#

and whats the problem youre running into

mossy zenith
#

the enchantment does not show up on the item, even though it's been applied and works

#

the effects are definitely applying and working

#

it takes an enderman out with 2 hits, no other enchantments on diamond sword

#

at max enchantment level

wanton delta
#

so it just doesnt show up

mossy zenith
#

right

wanton delta
#

ok

#

let me look at what i got

#

because i managed to get it working

#

does it add the glint?

#

or nothing

mossy zenith
#

okay thanks, glint?

wanton delta
#

like the

#

animation

mossy zenith
#

oh you mean like the little glow?

#

yea

wanton delta
#

ohhh

#

so youre having trouble setting the lore?

mossy zenith
#

lore?

wanton delta
#

well

#

so the item is glowing right

mossy zenith
#

I need to set item lore?

wanton delta
#

it just doesnt have the enchantment name in the item

mossy zenith
#

right

wanton delta
#

Yep, the only way i know around that is adding the lore yourself

mossy zenith
#

hold up

#

sec

#

i can do that in like a minute

#
    public void onEnchant(EnchantItemEvent event)
    {
        Map<Enchantment, Integer> theEnchantments = event.getEnchantsToAdd();
        if(theEnchantments.get(this).equals(null))
        {
            return;
        }
        ItemStack theItem = event.getItem();
        ItemMeta theMeta = theItem.getItemMeta();
        List<String> theLore = theMeta.getLore();
        theLore.add(ChatColor.DARK_PURPLE+"Bane of Ender"+ChatColor.RESET+" ?");
        theMeta.setLore(theLore);
        theItem.setItemMeta(theMeta);
    }```
#

should it look something like that?

#

or am I going about this the wrong way?

wanton delta
#

looks fine to me

mossy zenith
#

cool

#

thanks for the info

wanton delta
#

ya np

rapid yacht
#

I recently switched to 1.12.2 from 1.8.8 and i'm opped, when I type commands for the plugin SexyMOTD, it says you do not have permission!

#

What's the issue here?

haughty stag
#

ask SexyMOTD?

rapid yacht
#

๐Ÿ˜ญ

#

ok mr ugleh

haughty stag
#

That's me.

frigid ember
haughty stag
#

What do you want? If you want a gap just don't set an item in that location.

frigid ember
#

how ?

haughty stag
#

How are you creating the GUI now?

frigid ember
haughty stag
#

I still don't even understand what you want. Define "gap".

#

Do you want the barriers there and thats just an example photo?

frigid ember
#

like this, but im using skript.. and skript in 1.14.4+ spamming my console, and thats why im create plug

unreal hedge
#

You trying to make a custom enchantment?

haughty stag
#

You don't want the barriers?

frigid ember
#

yea

haughty stag
#

Yes to who?

frigid ember
#

yo you

haughty stag
#

If you don't want the barriers then just remove the part of the code that adds them

frigid ember
#

You trying to make a custom enchantment?
@unreal hedge no im not, i wana make the gui

unreal hedge
#

ohhh

radiant pollen
#

@frigid ember Just don't put anything in those slots...?

haughty stag
#

@unreal hedge The person wanting custom enchants, @mossy zenith has said he already registered it.

frigid ember
#

but the item move in frist slot

unreal hedge
#

My bad

radiant pollen
#

What method are you calling to add items?

unreal hedge
#

If you want the item in the first slot, you need to add it to slot '0'

#

Not slot '1'

radiant pollen
#

Use setItem() instead of addItem()

#

setItem let's you put an index

haughty stag
#

@frigid ember You create an itemstack, and then you set the item into the inventory slot. This is how that works. The first slot is 0, everything in code starts at 0.