#help-archived

1 messages · Page 86 of 1

woeful mural
#

Either bind the server to your public IP or leave the IP blank, if you bind it to your local IP, only players on your network will be able to join

frigid ember
#

still nothing

#

can't join

#

Rip

#

ok

#

do i need a static ip for this to work?

#

@frigid ember @woeful mural

woeful mural
#

Should work with dynamic as well

frigid ember
#

should i enable dmz?

#

ok so i got in with "localhost"

#

but my friends can't join

frigid ember
#

@woeful mural @frigid ember

bronze marten
#

lol

frigid ember
#

@bronze marten what

bronze marten
#

well

#

as you said

#

you run your server on localhost xd

frigid ember
#

ok and

bronze marten
#

then only ppl on your network can join

#

ppl connected to ur router, if u didnt open any ports

frigid ember
#

then how do i make it not localhost?

bronze marten
#

buy a server or open port

frigid ember
#

how do i open a port

bronze marten
#

first option recommended tbh

#

idk, depends prob on your router thingee

#

search for it xd

frigid ember
#

i have a custom interface from my internet provider

#

for the router settings

#

so there's no tutorial for it

#

that's why im asking here

#

because from watching all the tutorials

#

i already did what i think is needed to do

#

but the port is still closed

#

@bronze marten

bronze marten
#

I really don't know lol, could also be windows which is blocking the port, idk

vernal basalt
#

Hi, i have a problem.

#

[Username] disconnected with: Kicked whilst connecting to Server: Failed to verify username!

#

Any idea how to fix this?

#

I am using latest 1.15.2 and i have bungecoord.

vernal spruce
#

thats a plugin doing it

vernal basalt
#

authme?

frigid ember
#

probabl

#

y

vernal basalt
#

this is the error

#

java.lang.IllegalArgumentException: Name and ID cannot both be blank
at com.mojang.authlib.GameProfile.<init>(GameProfile.java:26) ~[patched_1.15.2.jar:git-Paper-284]
at com.mojang.authlib.yggdrasil.YggdrasilMinecraftSessionService.fillGameProfile(YggdrasilMinecraftSessionService.java:186) ~[patched_1.15.2.jar:git-Paper-284]
at com.destroystokyo.paper.profile.PaperMinecraftSessionService.fillGameProfile(PaperMinecraftSessionService.java:37) ~[patched_1.15.2.jar:git-Paper-284]
at com.mojang.authlib.yggdrasil.YggdrasilMinecraftSessionService.fillProfileProperties(YggdrasilMinecraftSessionService.java:173) ~[patched_1.15.2.jar:git-Paper-284]
at com.destroystokyo.paper.profile.PaperMinecraftSessionService.fillProfileProperties(PaperMinecraftSessionService.java:30) ~[patched_1.15.2.jar:git-Paper-284]
at com.destroystokyo.paper.profile.CraftPlayerProfile.complete(CraftPlayerProfile.java:177) ~[patched_1.15.2.jar:git-Paper-284]
at net.minecraft.server.v1_15_R1.LoginListener$LoginHandler.fireEvents(LoginListener.java:313) ~[patched_1.15.2.jar:git-Paper-284]
at net.minecraft.server.v1_15_R1.LoginListener$1.run(LoginListener.java:212) ~[patched_1.15.2.jar:git-Paper-284]
at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source) [?:1.8.0_251]
at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source) [?:1.8.0_251]
at java.lang.Thread.run(Unknown Source) [?:1.8.0_251]

#

i know its paper

#

but with the spigot i have the same problem

#

i found out that this server is currently down

vernal spruce
#

its more of a bad user,are you running cracked?

velvet halo
#

@frigid ember

frigid ember
#

anyone know when PacketPlayOutEntity is sent?

wanton vine
#

it seems like once my TPS dips anywhere below 18, lava and water stop flowing on my server, its very annoying bc i run a skyblock server and people cant make cobble gens. Please help!

pastel basin
#

buy a better computer/host

wanton vine
#

?

#

Nobody is lagging tho

fleet crane
#

that sounds like you have a plugin doing weird things in a misguided attempt to stop lag

wanton vine
#

thats the thing

sick citrus
#

Having your TPS be below 20 is a sign the server is either badly coded or the machine is not powerful enough

#

And as I said yesterday, and as md5 just said, it's a plugin trying to stop the lag.

#

List your plugin and we might be able to help.

wanton vine
#

but the thing is nobody is experiencing lag, so it cant be that bad that it makes water and lava stop flowing

#

and i have a lot of plugins, im upgrading soon to fix the tps issue but here

sick citrus
#

They might not experience lag but the server still can't keep up properly.

wanton vine
#

i cant send a picture so can i just dm you

pastel basin
#

to send images here you need to get verified

sick citrus
#

@wanton vine you have the plugin ClearLag

#

I don't know if you need to look any further.

pastel basin
#

ClearLag does nothing to blocks

wanton vine
#

i looked in clearlag and it didnt say anything about lava and water

pastel basin
#

what plugins in your server work with blocks?

sick citrus
#

That's his plugin if anyone wants to try helping.

wanton vine
#

plz dont judge the amount, im getting rid of a good bit of them, these were mainly put in to test each one and remove one by one the ones I didnt enjoy, but I want the water/lava flow issue fixed first

sick citrus
#

If still try to get rid of ClearLag

#

It looks like the most obvious bet

#

It doesn't touch blocks but water flow isn't exactly a block

wanton vine
#

now if i delete the jar from a plugin, does it matter if i delete the config folder for it too? or will that not add any lag

#

@sick citrus

keen compass
#

doesn't matter if you leave behind the directory it created

#

if you don't want to delete the plugin in case it isn't the one you are looking for. just add .disable to end of its name

wanton vine
#

smart, thanks!

keen compass
#

Worldguard has config stuff for stopping water/lava flow

#

however, by default it doesn';t do that unless it has been configured to do so

#

there is also worldguard region flags as well that will do that

#

so if they modified the default region and added flags there, it can do it too

wanton vine
#

i enabled water and lava flow in the region already D:

keen compass
#

then make sure it isn't disabled in the config. The config will trump region flags

wanton vine
#

could it have something to do with 1.12 players joining on my 1.15.2 server? i am using viaversion and viabackwards

#

bc one of the guys had a good point, the issue didnt start until he joined, hes on 1.12.2

keen compass
#

could be, not entirely sure

wanton vine
#

seems to be fixed now

#

what plugins from my list could be handling chat format?

bronze marten
#

EssentialsChat, ChatItem, AutoBroadcast

#

why do u have so many essentials installed

wanton vine
#

they all came with essentialsx

bronze marten
#

well no you manually installed them

wanton vine
#

well it came in a zipped folder and i thought i needed all of them

bronze marten
#

u only need essentialsx, rest is pretty much blergh

#

maybe spawn and geoip

#

but rest nah

wanton vine
#

so my name in chat is now showing up as ZNChano %deluxetags% : CHAT

#

i removed the deluxe tags plugin

#

and idk what to do

#

i looked in essentials and its not there

frigid ember
#

hecky

#

is there any way to get the height from an EntityType?

#

there's a way of getting the height from an Entity

#

this is probably really obvious but i can't imagine spawning an entity from the EntityType, storing its height and then removing the entity is a very good idea

pastel basin
#

World#spawnEntity(Location, EntityType) or something

#

it will return an entity

#

get the location from that

frigid ember
#

ahhh heck, if i have to i'll do so, but i was thinking there was some sort of workaround

pastel basin
#

oh wait

frigid ember
#

thanks though :D

woeful mural
#

Is it somehow possible to get an org.bukkit.Color from string? I.e. if I have GREEN in my database, I'd like to get Color.GREEN but I only get the string from the database

pastel basin
#

you already have the location

woeful mural
pastel basin
#

you already have the location
if you are spawning the entity with World#spawnEntity(LOCATION, EntityType)

sick citrus
#

seems to be fixed now
@wanton vine so.. ClearLag ?

#

Is it somehow possible to get an org.bukkit.Color from string? I.e. if I have GREEN in my database, I'd like to get Color.GREEN but I only get the string from the database
@woeful mural

Color.fromString()?

woeful mural
#

Not a method of Color :/ Guess I'll make my own method for that

sick citrus
#

Needs to be uppercase

pastel basin
#

Is Color an enum?

sick citrus
#

Sorry its valueOf

pastel basin
#

if so you can do Color#valueOf

sick citrus
#

My bad

#

Needs to be uppercase a d exact

woeful mural
sick citrus
#

Also catch IllegalArgumentException

bronze marten
#

Color is not an enum iirc

#

its a class with static variables

sick citrus
#

It seems he's using valueOf on an instance

bronze marten
#

yep

sick citrus
#

Rather than the static method

keen compass
#

@frigid ember could try using getEntityClass​()

frigid ember
#

ooooh

#

thanks for the tip!

sick citrus
#

Oh it's not an enum?

#

Wth

bronze marten
#

its not

keen compass
#

EntityType is an enum, but contains methods in the Enum

#

getEntityClass() is one of them which returns the entity class that the type belongs to

bronze marten
#

You can use reflection to get the static variable with a string ¯_(ツ)_/¯

sick citrus
#

Meh reflection

keen compass
#

personally, I would just keep a list of the data for entity heights since a list already exists for such things

jaunty night
#

Is there anyway to create "custom" items in spigot using nms, similar to how you create custom entites?

bronze marten
#

whats wrong with reflection lol @sick citrus

keen compass
#

it isn't always optimal and can be slower then other methods

bronze marten
#

well yeah

sick citrus
#

If you can avoid it, avoid it, that's all.

#

Nothing wrong with it.

bronze marten
#

but you can cache methods

#

so you dont have to do class forname and getdeclr method

#

speeds up things greatly

sick citrus
#

Just slower than the rest and definitely feels more of a hack solution than proper coding.

bronze marten
#

and for the average call to reflection you wont notice it

keen compass
#

depends really

bronze marten
#

everything dpeends lol

sick citrus
#

I already noticed you're a little bit of a troll, you don't have to remind us in every instance

#

😜

bronze marten
#

? ok

keen compass
#

Generally should avoid reflection where you can though

#

should only be used if you have no better methods to do what you are wanting

bronze marten
#

I am just pointing out a solution for enum#valueOf on a class which has static methods

sick citrus
#

If you can avoid it, avoid it, that's all.
@sick citrus > Generally should avoid reflection where you can though
@keen compass

#

So basically

#

That conversation could have ended 5 minutes ago.

keen compass
#

yep

vernal spruce
#

But where would the fun be then?

keen compass
#

that is where imagination comes in 😉

pastel basin
#

@woeful mural
If you want to use reflection just use

try {
    Color color = (Color) Color.class.getField(string).get(null);
} catch (IllegalAccessException | NoSuchFieldException e) {
    e.printStackTrace();
}

But what I would do is add the names to a hashmap and assign a color value e.g.:

private static final HashMap<String, Color> colors = new HashMap<>();

static {
    colors.put("BLUE", Color.BLUE);
}
bronze marten
#

It's not always about the best solution, sometimes its also nice other solutions exist for the case you might need them. @sick citrus In the last few days I noticed you are always skeptical, replying on stuff thats not necessary and then circling the issue back to me which you basically started lol.

#

Just trying to help, if you dont like it, ignore

#

but I think this should stop here

wanton vine
#

@loud fox fixed it by removing some outdated plugins, I’m not sure which one fixed it specifically tho

#

Got my plugin number down to 64

frigid ember
#

nice

sick citrus
#

That number still seems high but you will see an improvement already

keen compass
#

While true it isn't always about the best solution, and that it is nice to be presented with other solutions. You should always yield to the better solutions and make note that the solution you present may not be the best. We should always strive to provide the best solutions whenever possible and make aware that while other solutions exist there is caveats to them in using those.

wanton vine
#

Yeah I’m still trying to remove more, but it’s a good start

sick citrus
#

The better solution will never be reflection

#

🐴

keen compass
#

reflection has its place just for most cases its not the best to use.

pastel basin
#

The better solution will never be reflection
ah yes, if I wanna use nms and make my plugin cross-version compatible just create a class to each version with each import

#

Reflection exists for a reason, sometimes you can't avoid it

jaunty night
#

I'm looking to create custom items using nms/spigot, I know you can create custom entities using NMS so I was wondering if you could do something similar with Items?

keen compass
#

For instance, if you wanted to dynamically do something without knowing what that something is because you can't know, reflection is the way to go,. Or there is something you want to do but there is no other way to do it but with reflection.

frigid ember
#

This is more of a netty question and not spigot.
Is it a good practice to send packets as serializable objects converted to byte arrays and then bytebufs? how could i send objects better or more efficiently?

keen compass
#

would be better to turn them into byte arrays since that is the only way to send packets

frigid ember
#

so its serializable object -> byte array -> bytebuf

#

i just said that

#

...

#

you send ByteBufs in netty

#

too

keen compass
#

I am just stating, that there is no other way to send a packet other then a series of bytes

frigid ember
#

bytebuf lets you write a byte array, char sequence

#

and int

#

and more

#

so there is a way

sick citrus
#

Id like to add a disclaimer to this channel.

CAREFUL: most of the answers you'll get here are written by people who don't know how to code.

frigid ember
#

what is more efficient

#

i want to send as small as possible

#

do you recommend zipping

#

not zipping

#

compressing

#

idk

sick citrus
#

XY problem

#

Why do you have to deal with netty packers in the first place?

frigid ember
#

?

sick citrus
#

Just wondering really

frigid ember
#

that doesnt answer

sick citrus
#

Netty packets

frigid ember
#

i said its unrelated to spigot

keen compass
#

just send it off immediately when you can, packets are relatively small. But if you want the most efficient data types, its going to be byte because no matter the data you throw at netty, netty has to turn that data into bytes. But if you turn it into bytes ahead of time, that is less for netty to do.

frigid ember
#

i do

floral isle
#

hi everyone i am creating a plugin that uses the nms code only that some classes does not let me access because they are private there is a way to access them

frigid ember
#

i convert the serializable object to a byte array

sick citrus
#

Also gzip the packets

frigid ember
#

and i write the byte array to netty

vernal spruce
#

Does it rly matter afterall you can async send packets..

frigid ember
#

ingive it to netty

sturdy oar
#

@floral isle ciao 😁

sick citrus
#

More efficient than zip altogether

floral isle
#

@sturdy oar salve

sturdy oar
#

anyway you have to use reflection

#

although I wouldn't recommend it

frigid ember
#

should i gzip

bronze marten
#

bzip2

keen compass
#

you can gzip packets, but I would probably not try to do so if the packet data is less then 64 bytes because there is no benefits to it since packets less then that size will be padded to that size anyways

sick citrus
#

You should gzip usually

pastel basin
#

hi everyone i am creating a plugin that uses the nms code only that some classes does not let me access because they are private there is a way to access them
You can do it with reflection, but some fields/methods are private for a reason, why are you working with them in the first place?

sick citrus
#

you can gzip packets, but I would probably not try to do so if the packet data is less then 64 bytes because there is no benefits to it since packets less then that size will be padded to that size anyways
@keen compass

True

frigid ember
#

its not more than 64 bytes

#

so i dont need it i guess

#

do i lose anything

#

doing it

sick citrus
#

Yeah no don't do it then

keen compass
#

you waste cpu cycles in doing it with no benefits to size

frigid ember
#

like performance from the sender

keen compass
#

if its less then 64bytes

frigid ember
#

gzipling it

#

ok

sturdy oar
#

why are you compressing packets?

#

I'm not getting it

sick citrus
#

I'd even say if it's more than 128 bytes.

floral isle
#

@pastel basin
#4146 i creating an npc plugin like citizens

frigid ember
#

ok ok

#

thanks

#

pce

floral isle
#

and some methods like getbukkitentity are private

sturdy oar
#

you have to use Reflection

bronze marten
frigid ember
#

use reflection

#

do you know reflection

sturdy oar
#

@bronze marten that method has been removed from Java 9+

floral isle
#

yes but i never use that

sturdy oar
#

it's now trySetAccessible

frigid ember
#

use it

#

ok

#

why does he use java 9

floral isle
#

ok thanks

sturdy oar
#

why would you use 8

keen compass
#

@sick citrus at 128bytes the packets get split up

frigid ember
#

i asked u

#

because everyone else does

#

and u

#

😅

keen compass
#

I use java 14

#

😉

sturdy oar
#

just because the majority is stupid, doesn't mean you sould stay on java 8 forever

frigid ember
#

.

#

lmao

#

???

sturdy oar
#

Java 11 is an LTS now, so I don't even bother giving support for 8

frigid ember
#

makes no sense x

#

d

jaunty night
#

new java versions have some good features I take advantage of

sturdy oar
#

^

frigid ember
#

ok

keen compass
#

Java 8 suffers from not having AOT (Ahead of Time compiling) as well as suffers from optimizations done in later versions

frigid ember
#

lambda

#

is hot

#

so i use dattttt

keen compass
#

Java 9 is when AOT was introduced

pastel basin
#

Like super fast gc? When I run minecraft on java 14 I get 50 more fps than with java 8

frigid ember
#

mk

jaunty night
#

lambda λ

frigid ember
#

?

keen compass
#

that is because they optimized the G1 GC @pastel basin in java 14

sturdy oar
#

I personally use GraalVM 11

frigid ember
#

gcc

#

llvm better

jaunty night
#

I'm more fond of Rust nowadays

keen compass
#

besides, towards the end of the year think its like September or November java 8 is going to be EOL

#

so eventually everyone will upgrade to java 11

sturdy oar
#

I hope everyone will update to minecraft 1.16 as well

#

although I highly doubt that

frigid ember
#

i doubt

#

cos i wont

#

lmao

sturdy oar
#

well Spigot 1.8 doesn't have Java >9 support

frigid ember
#

NOW DONT HATE

#

jeez yall hate 1.8 users leave us alone

pastel basin
#

There are stubborns like hypixel who doesn't likes newer versions

frigid ember
#

see

sturdy oar
#

Hypixel doesn't count

pastel basin
#

it should

sturdy oar
#

they probably not even rely on Bukkit's code

pastel basin
#

yes they do

frigid ember
#

leave them alone

keen compass
#

Hypixel has custom servers

frigid ember
#

u dislike it

#

many people here harass 1.8 users

keen compass
#

So while they might have bukkit code, they essentially have their own fork of it

frigid ember
#

its just annoying

#

ok

sturdy oar
#

well you are the minority

pastel basin
#

they use bukkit, im not sure if is spigot or a fork they made

#

but is definetely bukkit

keen compass
#

it is a fork they made that they use

#

otherwise how else are they using Slime and Seaweed for their servers lol

frigid ember
#

ok

#

whats wrong with it

#

lmao?

keen compass
#

wrong with what?

frigid ember
#

i accidentally had 1.15 thinking no diff lmao

#

spigot updates so dam fast

#

the server

#

latest snapshots

#

like bruhh

spring cradle
#

[Spigot 1.8.7] Send title method is deprecated. Do you know the method i need to use to replace this deprecated method ?

keen compass
#

don't think you really need to worry about deprecated methods in old mc versions

torn robin
#

you can't i believe

#

yeah i'd just use it

keen compass
#

I mean, not like 1.8 is going to get any updates XD

worthy lava
#

Is there a way to replace a recipe? With the Bukkit.recipeIterator()?

keen compass
#

so just use whatever is available to you

spring cradle
#

Ok ok, thanks

keen compass
#

should at the very least upgrade to 1.8.8

#

every version below that has big security flaws and 1.8.8 fixes some of those things

jaunty night
#

I'm looking to create custom items using nms/spigot, I know you can create custom entities using NMS so I was wondering if you could do something similar with Items?

#

I'm using 1.15.2 btw

keen compass
#

was referring to someone else lol

#

You can create custom items, but really depends what you mean custom

#

I mean, you can create items with the API, with all kinds of lore and metadata etc

jaunty night
#

Similar to how you create "custom" entitles, where they are based on a parent item

pastel basin
#

why not just creating the regular item and changing the data after?

keen compass
#

^

jaunty night
#

What if I need to add "Custom data".

keen compass
#

there is api methods for that

#

Metadata

pastel basin
#

use PersistentDataContainer

frigid ember
#

yea atleast 1.8.8

#

is good

pastel basin
#

Metadata is not persistent and is reset when the server shuts down

frigid ember
#

my guy frostalf

keen compass
#

Well I don't recommend usage of old versions, but at the very least use the versions that don't have big security flaws in them

jaunty night
#

Can I just use an ObjectOutputStream to convert a POJO into a byte array then just shove that in to an item?

pastel basin
#

yes

#

there is a PersistentDataType for that

#

PersistentDataType#BYTE_ARRAY

jaunty night
#

Oh

#

Cause I already set up something similar

#

where I have a POJO

#

and I made a custom data type for that

#

that converts it into a byte array

#

and back

keen compass
#

welp, I need sleep. You all have fun 😄

jaunty night
#

I was just wondering if there was a way to go "Full Custom" in a way

#

Because I'm unsure weather I could create a texture pack to add custom textures, similar to how Hypixel Skyblock texture packs work.

frigid ember
#

whether*

#

ok

pastel basin
#

I never played Hypixel Skyblock but whatever Hypixel can do with items you can do

#

since servers use packets

fluid garden
#

@jaunty night making custom textures for items that are just different in names is very simple, I could show you how to do this and even change enchantment texture to see what your enemies have on their sword and armor

jaunty night
#

So it doesn't matter the type it just matters the name, although the name of the items I will create will be mutable, not static so will that be an issue?

fluid garden
#

i dont think so

#

it worked fine for me

#

i even made swords break when they have a certain amount of damage

#

like the texture was only half of a sword

jaunty night
#

Cause I will have a sword called like a Forrest Sword and that sword may have a large amount of prefixes to go along with it

frigid ember
#

nice profile pic btw

#

looks noice

fluid garden
#

thx

#

made it myself xD

frigid ember
#

not u

#

well

#

urs is nice too

#

but i didnt mean u

#

i was being sarcastic to @jaunty night

#

but urs is nice

chrome edge
#

I generally use java thread feature for my background works. After some search I found that some of usage of java thread may be dangerous and unsafety for server. So where should I use spigot scheduler and java scheduler? I'd like to know your ideas and experiences about it.

fluid garden
#

@frigid ember xD sorry but thx anyway

frigid ember
#

yes its dangerous if u access bukkit

jaunty night
#

@frigid ember Hey, my pfp from half-life. One of the most revolutionary video games.

frigid ember
#

ok

#

nice quality

jaunty night
#

(it was made in 1995)

fluid garden
#

@jaunty night i played black mesa its really cool 🙂

chrome edge
#

So If I use java thread for my database stuffs, it's safe to use right?

remote socket
#

When you right click a block, I have a GUI that opens. (This GUI is managed in the InventoryClickEvent). How do I get the chest that was clicked?

pastel basin
#

I only use threads for tasks that may be heavy on performance and affect the flow of my software, so instead of running on the main thread and freezing the application when the task started just run it on a thread and if it fails and consume too much memory the thread is killed and not the whole application

frigid ember
#

id say use a bukkit async task

#

its real simple

#

nop

#

e

remote socket
#

Maybe I can use target block

silk bane
#

inventoryopenevent?

pastel basin
#

When you right click a block, I have a GUI that opens. (This GUI is managed in the InventoryClickEvent). How do I get the chest that was clicked?
@remote socket Did you try PlayerInteractEvent and get the clicked block?

#

Store it somewhere and access it in InventoryClickEvent

remote socket
#

I can just use target block

pastel basin
#

the player can always turn their head

brave vector
#

my server get crash when loading map (52mb size)

#

how can i fix it

tiny dagger
#

more ram maybe?

#

or see if the version matches

remote socket
#

@pastel basin How can they turn their head when in an inventory

#

Anyways, how would I get an ArrayList<int> of integers between X and Y

pastel basin
#

@pastel basin How can they turn their head when in an inventory
@remote socket If the server lag and the inventory doesn't open right away they will be facing another block

#

not everyone has 0ms of ping

blissful verge
#

Are there any mob hp bar plugins out there that are free?

#

If not how can I make one?

brave vector
#

or see if the version matches
@tiny dagger well i set heap size to 10gb lol

tiny dagger
#

i don't know why it crashed tho

#

the error might give an indication

#

i mean it sure would

brave vector
#

well it crash because the timeout

tulip pendant
#

Someone help me develop my minecraft java sever please

frigid ember
#

Is there any way to open a inventory for a ProxiedPlayer?

#

I mean via Bungeecord

naive goblet
#

Talk with the fallback servers? So you'd probably need to have a plugin in the fallback servers as well

frigid ember
#

no

#

u cant open inventories in bungeecord api

naive goblet
#

Not directly

#

But he can open a message channel between the proxy and fallback.

frigid ember
#

How can i talk to the proxy?

#

to change the server?

cloud crater
#

you can just use the bungeeutil API plugin

naive goblet
#

^

frigid ember
#

@tulip pendant please don't ask this type of questions here and hire staff within the releated spigotmc forum section.

tulip pendant
#

:(

frigid ember
#

you can just use the bungeeutil API plugin
@cloud crater Can i use it via maven?

cloud crater
#

it works through maven yes

naive goblet
#

You may certainly ask support about spigot and bungee related questions DogLover. But there exist recruitment channels on the forum I think.

cloud crater
frigid ember
#

it works through maven yes
@cloud crater thx for the help

#

bruh

#

😂

cloud crater
#

using api's is nothing bad, no good beating yourself up if there are open source Lib's* out there that will help massively 🙂

frigid ember
#

yup

naive goblet
#

Don't post that stuff here either Retrooper. I don't want to minimod but certainly this channel is for help.

#

#general Exists for off-topic related stuff.

frigid ember
naive goblet
#

Depends what're your going to use probably.

#

Usage of Player would probably not break any mechanics?

frigid ember
#

why no respond dms conclure

cloud crater
#

not sure if the dev has added higher then 1.12 support

naive goblet
#

Retrooper spammy

cloud crater
#

but you can test.

frigid ember
#

how

#

they aren’t

#

.

#

but you can test.
@cloud crater ok

cloud crater
#

@frigid ember that dm ss if funny 🙂

frigid ember
#

ik

#

xd

sturdy oar
#

What method does one use to check if a string matches a regex in any place?

frigid ember
#

I guess you could use the equals method

sturdy oar
#

no??

#

I have a RegEx , it's clearly finding matches, but both Matcher#lookingAt() and Matcher#matches() return false

sick citrus
#

Show your code

sturdy oar
sick citrus
#

Your code I said

sturdy oar
#

... my code does exactly what that webpage does , but ok

sick citrus
#

#rtfm

sturdy oar
#

yeah that's what I was asking

#

Is there a method that returns true if any part of the string matches

#

or I'll just have to split the string by spaces and check each word

sick citrus
#

how about find() ??

sturdy oar
#

Mhh, i guess I could use that.

limber moth
#

Hi All, does anyone here have experience with Redis API? I can identify a players proxy if they are on the same proxy as another server and if they are not, but I cant figure out how can I send plugin message from one proxy to another

#

Is it possible with the Redis api to forward a plugin message to another proxy?

naive goblet
#

Never worked w/ it but it should be unless?

frigid ember
remote socket
#
Caused by: java.lang.NullPointerException
        at me.jameslloyd.ichest.events.ChestGUIClick.clickEvent(ChestGUIClick.java:71) ~[?:?]
#
if (e.getClickedInventory().getTitle() != null) {```

How can i not get NPE when doing nullcheck
limber moth
#

should be essentials.motd ?

#

@frigid ember

frigid ember
#

idk let me check

limber moth
frigid ember
#

yeah that did not help lol

limber moth
#

might be another permission there too possibly

frigid ember
#

the website not the perm

silk bane
#

is getClickedInventory null

frigid ember
#

my bad

limber moth
#

it gives a full list of permissions

#

which are useful

frigid ember
#

yeah i know

#

but does not give you a default list of the 999 perms on the plugin

#

lmao

limber moth
#

you can filter easily

frigid ember
#

ik

naive goblet
#

@remote socket I mean send more code

#

Because most cases where NPE appears it has to do with invoking undeclared fields.

frigid ember
#

@limber moth yeah that did not work

#

wait that is suppost to be the perm

remote socket
#
@EventHandler
    public void clickEvent(InventoryClickEvent e) {
        Player player = (Player) e.getWhoClicked();
        if (e.getClickedInventory() != null && e.getClickedInventory().getTitle() != null) {
            if (e.getClickedInventory().getTitle().equals(plugin.chestMenuTitle)) {
                switch(e.getRawSlot()) {

                    //blocks stored in iChest
                    case 20:
                        blockClick(e, 1);
                        break;
                    case 21:
                        blockClick(e, 2);
                        break;
                    case 22:
                        blockClick(e, 3);
                        break;
                    case 23:
                        blockClick(e, 4);
                        break;
                    case 24:
                        blockClick(e, 5);
                        break;

                    //exit button
                    case 31:
                        player.closeInventory();
                        break;
                }
                e.setCancelled(true);
            }
        }
    }
#

I added to it

naive goblet
#

chestMenuTitle

#

what is this field?

frigid ember
#

@limber moth it worked 👍

naive goblet
#

Also don't compare titles. It's better to compare references then Royal

oak stump
naive goblet
#

[15:06:06 WARN]: java.lang.IllegalArgumentException: Cannot set already-set enchantment

#

Idk what this exactly means but you're trying to re-register something or set something that is registered alr?

oak stump
#

ye i checked through

#

but i cant find it

naive goblet
#

can u send the entire class

#

where the error occurs

oak stump
#

huh

#

i sent everything

#

well

#

not everything

#

but the classes the errors are

naive goblet
#

hmm

#

Enchantment.registerEnchantment() shouldn't throw an exception

oak stump
#

its really odd

naive goblet
#
    public static void registerEnchantment(Enchantment enchantment) {
        if (!byId.containsKey(enchantment.id) && !byName.containsKey(enchantment.getName())) {
            if (!isAcceptingRegistrations()) {
                throw new IllegalStateException("No longer accepting new enchantments (can only be done by the server implementation)");
            } else {
                byId.put(enchantment.id, enchantment);
                byName.put(enchantment.getName(), enchantment);
            }
        } else {
            throw new IllegalArgumentException("Cannot set already-set enchantment");
        }
    }
#

You're enchant id is most likely already registered or something

oak stump
#

ill set it to like 200

#

and test

#

oh

#

found it

#

in the enchantment class it was registered with an id of 70 and in main 75

naive goblet
#

You should make a constant of the id

oak stump
#

yep

#

imma make a new enchantment to test something

#

cuz it is not applying speed

#

so

naive goblet
#

I mean the id is never gonna change so having it constant accesible is okay.

#

speed or velocity?

oak stump
#

speed

#

i have made an event for when someone equips armor but it is not applying speed so

#

and i have tried a few different api on spigot which dont wanna work

naive goblet
#

You never registered speedenchantments listener?

oak stump
#

did i not

naive goblet
#

not what I can see

oak stump
#

lol how would i do it with an enchantment?

naive goblet
#

Bukkit.getPluginManager().registerEvents(speed, this);

oak stump
#

the thing is

#

i tried that

#

and i said i had registered it twice

#

hmmm

#

lemme try again

exotic sage
#

hello, i had a minecraft server on bukkit 1.12.2, and recently i changed the version for SPIGOT 1.12.2, but since this changement, we can't PVP, break or build in survival.

#

can somebody help me ?

vernal spruce
#

you have certain options now

#

to disable/enable pvp,and spawn protection

#

if its a friends only server,might as well op everyone to solve the issue

exotic sage
#

already did that, and its not

#

its a minigames server

#

so its breaking every games we have lol

vernal spruce
#

hmm in that case why not simply go back?

exotic sage
#

because our TNTRUN plugin is working only with SPIGOT 😦

#

where can i find theses options on SPIGOT ?

#

to disable/enable pvp,and spawn protection
@vernal spruce

vernal spruce
#

actually seems theyr in normal config

#

server.proprieties pvp=true spawn-protection=16

exotic sage
#

already did, (i have a spawn-protection set to 0 bc its useless to change it)

#

it seems like the players are in "survival" mode, but the survivalmod is like adventure modd

#

i can't even point at blocks

vernal spruce
#

Thats a way of some plugins to block players from destroying blocks

#

might be one of them

exotic sage
#

i'm searching

vernal spruce
#

Hmm this returns the classic DROPPED_ITEM entity? Returns: ItemDrop entity created as a result of this method

#

Talking about world.dropItem

subtle blade
#

Heh... ItemDrop

#

That's some old school Bukkit right there

frigid ember
#

Item

#

1.7

#

choco

#

i have a q

subtle blade
#

i have a a

frigid ember
#

not about spigot tho just generally mc

#

why doesnmc name mc like this

#

1.8

#

1.8.8

#

not 1.8.1

#

and for the other versions

subtle blade
#

wat

frigid ember
#

1.15 doesn’t exist server side also

#

only 1.15.2

subtle blade
#

It exists?

frigid ember
#

mk but 1.8.1 client doesnt exist

#

why are some versions missing

subtle blade
#

It definitely does ;P

frigid ember
#

where is it

subtle blade
#

in the launcher?

frigid ember
#

1.8.2?

#

all of em

subtle blade
#

Same thing

frigid ember
#

these snapshots?

vernal spruce
#

@subtle blade how would i go about storing a head texture?

frigid ember
#

by uuid of the player

vernal spruce
#

do i create a fake player with and assign that to it?

frigid ember
#

its from

vernal spruce
#

custom one stored locally

#

not by player

frigid ember
#

ok

subtle blade
#

1.8.1 is just below that

frigid ember
#

wtf

#

didnt apepar for@me

#

appear

#

why doesnt optifine do for all

#

or spigot exists for all

#

spigot 1.8.1 doesnt exist

#

or does it

#

1.8.1 just example

#

couldnt find it thru maven for example i think

subtle blade
#

Correct. 1.8.1 server does not exist

frigid ember
#

why

#

why are some missing

#

and how is it possible for 1.8.0 clients to join 1.8.8

subtle blade
#

Protocol didn't change between 1.8.0 - 1.8.2

frigid ember
#

ok

subtle blade
#

The protocol doesn't always have to change. That's why there's no 1.8.9 server

frigid ember
#

why can clients join 1.8.8

subtle blade
#

Sometimes it's just client-sided or just server-sided changes

frigid ember
#

mk

#

i see

subtle blade
#

So long as no packets are added, removed or changed, the protocol won't change

frigid ember
#

ok

#

i get it now

subtle blade
#

As far as 1.8.0 - 1.8.2 are concerned, they're under the same protocol specification. The server sees them as one and the same 🙂

frigid ember
#

why did craftbukkit add diff packages

#

for each version

#

like wth

#

wont it take years transferring the files too xd

#

why did they do that

#

i dont see one benefiting anything

subtle blade
#

It didn't. That's CraftBukkit

frigid ember
#

i wanted to correct just now

subtle blade
#

The vanilla server has proper packages. CraftBukkit relocates everything to a single package

frigid ember
#

lmao

#

why

#

did cb do this

subtle blade
#

To discourage use of NMS

#

Or at least keep developers aware that things are prone to change

#

Names change, things get mapped, things get patched

frigid ember
#

do you support nms usage

#

or reflection

#

which

subtle blade
#

If you're able to write a PR to Bukkit so API can be added for what you're doing, I support that

frigid ember
#

whats pr

subtle blade
#

If there's no chance it's getting into Bukkit, reflection is iffy because it will only work on CraftBukkit implementations (or its derivatives)

frigid ember
#

pull request

subtle blade
#

Actually, will technically only work on CB anyways lol

frigid ember
#

ok

#

What was that bug that the server could access minecraft files

#

why did spigot do some changes to cb nms

subtle blade
#

Was a resource pack exploit Fatal

frigid ember
#

u even added comments xd

#

//spigot start

subtle blade
#

All changes made by CraftBukkit are denoted with CraftBukkit comments. As with Spigot

frigid ember
#

Guys

subtle blade
#

It's to state what's Spigot and what's vanilla

frigid ember
#

and last question why does everyone say spigot is poorly written

#

or craftbukkit

subtle blade
#

Because they don't know any better

#

It's a culmination of a decades worth of work

frigid ember
#

Hello everyone -quick help with Scoreboards

subtle blade
#

?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
#

directed to me?

#

I want to display data to the user that is only related to THEM - their kills, their deaths, etc. But, I also want to show team data (positions controlled, etc)

subtle blade
#

No

#

Each player can have their own scoreboard (Player#setScoreboard()) so you may create one for just them, insert data just for them. For any shared data, you have to pull it from some third source. You can insert whatever you'd like as a score

#

They're just Strings

frigid ember
#

I've tried multiple avenues to accomplish this - building a scoreboard for each player and registering a new team each time

#

just i saw u online and as ur staff on spigot u might know how the answer to these question

tall jacinth
#
        animals-every: 6000
        animals-for: 1000```What do these do
subtle blade
#

?config

#

Shit, thought there was a command for that lol

frigid ember
#

oof

subtle blade
frigid ember
#

@subtle blade yes, but the issue is then that the player is not on the same team when you create a new scoreboard each time

#

Fore xample

#

?dogfacs

#

?dogfacts

worldly heathBOT
#

Perky-eared dogs hear sounds better than floppy-eared dogs.

frigid ember
#

If I have 2 players. Player 1 joins team 1, player 2 joins team 2

#

where do u get the facts

#

or do you hard code them

#

team 1 and team 2 are registered independently on each scoreboard

tall jacinth
#

It's not in the configuration documentation

frigid ember
#

?catfacts

worldly heathBOT
#

Many people in China consider cats a "warming" food that is perfect to eat during the winter

frigid ember
#

Or clearer still, player 1 joins team 1 and player 2 joins team 1

#

wth man remove dat

#

Because team 1 has been registered on player 1's scoreboard AND player 2's scoreboard, the game does not know that these players are on the same team

#

So they do not show up as being on the same team in-game

#

Thus this is a problem

#

Team 1 on player 1's scoreboard is a different object than Team 1 on player 2's scoreboard

#

I need them to be on the same team. But when you try to pull from the same static scoreboard build, you cannot then show individual player data without showing that same data to all players on the team

subtle blade
#

Right... however is that not the purpose of the global scoreboard?

frigid ember
#

Yes

subtle blade
#

Sorry I'm not super familiar with the scoreboard API as others may be. I don't use it often

frigid ember
#

I have multiple "nations". Each nation is essentially a team.

#

Each nation(or team) has a population of players

#

All players in the server should see the same data

#

in terms of nations. For example, if a nation has 7 towns, then all players in the server should see that team 1 has 7 towns. But, all players in the server should not see player 1's kills

#

I cannot find a way to do this, and am starting to suspect I will have to use NMS w/ reflection

vernal spruce
#

well isnt that nice,i have to use reflection to set a head to a non-existing player texture

tall jacinth
#
        animals-max-per-tick: 4
        animals-every: 1200
        animals-for: 100
        monsters-max-per-tick: 8
        monsters-every: 400
        monsters-for: 100
        villagers-max-per-tick: 4
        villagers-every: 600
        villagers-for: 100
        flying-monsters-max-per-tick: 8
        flying-monsters-every: 200
        flying-monsters-for: 100```Does no one know what these do?
subtle blade
#

Where are you seeing that?

#

Is this a downstream configuration? Are you running Spigot?

vernal spruce
#

i think its spigot default config

subtle blade
#

It's not. We don't have those options

frigid ember
#

@subtle blade Sorry to keep bothering - another question for you. Is it possible to assign multiple scoreboards to a single user?

subtle blade
#

afaik no 😦

vernal spruce
#

eeh it works ```private void buildMedPack(){
ItemStack head = new ItemStack(Material.PLAYER_HEAD, 1);
GameProfile skin1803103601 = new GameProfile(UUID.fromString("f017c5f5-e70e-4b16-9cb7-a82fcb1af9c3"), "skin1803103601");
skin1803103601.getProperties().put("textures", new Property("textures", "ewogICJ0aW1lc3RhbXAiIDogMTU4OTcyOTE0Nzk5MiwKICAicHJvZmlsZUlkIiA6ICJhNmE3MzI2NjZhZTI0YjIwYWQyNmIzYWZkZWZjNmM1MCIsCiAgInByb2ZpbGVOYW1lIiA6ICJNeXN0aWNHYW1lck1hbiIsCiAgInNpZ25hdHVyZVJlcXVpcmVkIiA6IHRydWUsCiAgInRleHR1cmVzIiA6IHsKICAgICJTS0lOIiA6IHsKICAgICAgInVybCIgOiAiaHR0cDovL3RleHR1cmVzLm1pbmVjcmFmdC5uZXQvdGV4dHVyZS9lNTgwYzBlYWYzZTFkMGFlNWE0MmQ5NjY0MWJlZGMyNTFhZGQ2ZjA5NzI1NDI3OWJhYTJmNjI5OWNjZTYzMjcwIgogICAgfQogIH0KfQ==", "rXy8bq+RjMJiawajWDm2+N7jV+kCGwqYSmOLth5A7is0uyR8Aqe9DDcxUdAAdHJd+JOx5/KY9EmO8ExobQ0kt2sarJLlnkVQa3o+gEeadFj9DA6VwsWWki2qqAvgZQsQOe3w41UF9M3C96Z/EIBR8hZp8kG73WKwA3xQ9b6juk5PxDSGEuJbnpYZW5fxraOSmElMFqWJelU22z15I1nqk6aWzwa9WHh/ywX0Hy4BvqWvwqNhBoxHREwQ8TOLyairKxlo9YX/Q+0OaRHa120vynLKH2jtBH3qD2XUugnopyN4eoCos2uOkFE2T4zeBKkUSE10xNuMpowKXZlmXEi4qGh+KGcY1b284vvXX4Muztx8kxp+xSe5vAxVGSVqkRR7gt0yK1DCxlkgBCWERoNoBR81oNqON6Ild/rdhQBEZsTW/SuCsPTQa+GR6uOeNadyXSM6tSG8CAxaon0urrbNoy9rud3dQCrcwbkpzhdsQwaROWGhsdUaHfrSZ6z7wxHQTiAC8QLiy4NukyHfp5w3vMbUbs+6LCT774MdSo4hioCKalwHXfaDXHrXxPKjsfYCmDTRehBBioQpBakIv4vb3upWdo7WFgjzau83PljVP4lYfqaO3bktZtcLWT0VtYAbsbXH6JROrhNH1LIeGomUcP5ZjJeTYCc9IqbbvEV1oyQ="));
SkullMeta headMeta = (SkullMeta) head.getItemMeta();
try {
Field profileField = headMeta.getClass().getDeclaredField("profile");
profileField.setAccessible(true);
profileField.set(headMeta, skin1803103601);

    } catch (IllegalArgumentException | NoSuchFieldException | SecurityException | IllegalAccessException error) {
        error.printStackTrace();
    }
    head.setItemMeta(headMeta);
    medpack=head;
}```
frigid ember
#

was that at me

vernal spruce
#

look at that pile of shaite

frigid ember
#

the afaik no thing

subtle blade
#

Yes

frigid ember
#

also what does afaik mean

subtle blade
#

As far as I know

frigid ember
#

I've seen others use it & idk what it means

#

Ah

#

Gotchya

#

Well, I'm guessing reflection is going to be the only way to do this

subtle blade
#

What's the purpose of the teams?

#

I know it's per nation but like, why?

#

What benefit does the teams give you?

frigid ember
#

So the name above their head & in the tab list will be the color of their team

subtle blade
#

Ah

frigid ember
#

yeah - I want that bit, but I can't have that if they are not all part of the same team structure

vernal spruce
#

lol wut

frigid ember
#

The way Teams are handled, whether it be through Craftbukkit or the actual NMS source, is not good IMO

subtle blade
#

You can blame vanilla for that

vernal spruce
#

boy thats a huge error stack

frigid ember
#

@subtle blade Yeah I assumed as much

#

I was looking through their class & they have no setter for teams, which is insane to me

vernal spruce
#

wut my brain hurts..

#

how can same thing throw a huge ass error on paper but not on spigot

#

wut

subtle blade
#

because they make changes?

frigid ember
#

Paper sucks

#

Lagged the hell out of my server when I used it

subtle blade
#

specifically they make changes to the game profile stuff and actually expose it

vernal spruce
#

so dropping a custom textured head on the ground on paper bricks it

#

fine by me

#

the focus was spigot so if any paper guys will use it too bad..

high aurora
#

heya. as 1.16 will be here soon i wonder if we still have chunk-errors between versions like it used to be back in my days?

wind dock
#

is downloading a cracked plugin off black spigot illegal?

vernal spruce
#

what you think

wind dock
#

Idk

#

thats why im asking?

frigid ember
#

How would I save an ArrayList of Recipes to the config? or just save it in general?

vernal spruce
#

you are asking if decompiling and sharing a premium plugin is illegal..

#

god dammit outdated spigot again

wind dock
#

just say yes or no please....

vernal spruce
#

its pretty obvious that it is

wind dock
#

Oh

frigid ember
#

guys its faster to create a new arraylist than clear

#

thank me later

vernal spruce
#

why are my medkits floating to narnia?

#
        Item it = (Item) item;
        it.setPickupDelay(Integer.MAX_VALUE);
        it.setGravity(false);```
stuck goblet
#

I cant yoin my Server

vernal spruce
#

Thats strange why do i have to keep forcing a vector on a item to not float to narnia?

#
        new BukkitRunnable(){
            Vector v = new Vector(0,0,0);

            @Override
            public void run() {
                if(!toCancel.isValid()){
                    this.cancel();
                    return;
                }
            toCancel.setVelocity(v);
            }
        }.runTaskTimer(pl,0,1);
    }```
cold wharf
#

How to check if a packet has been sent?

wooden tree
#

@stuck goblet wat does it says

frigid ember
#

in what

#

clienr side or server side

#

or generally just netty

#

how would I save a ton of recipes that I made so when I restart the server they stay
They are randomly generated recipes but I want to be able to save them between restarts

wind dock
#

im using grantx and luckperms and for some reason when i grant a rank it says it granted it but didnt actually grant it. any fix? this is an example of my ranks

subtle blade
#

Not sure I understand. Recipes will be registered whenever your plugin starts

#

Why do you need to save them?

frigid ember
#

I randomly shuffled all the recipes around but I want to save them because my friends and I want to do an smp with those random recipes but we don't want them to change between restarts

subtle blade
#

Right. Best option is to just find a format to write them to file and then read them accordingly

#

Really there isn’t another approach. They have to be written to file one way or another

frigid ember
#

ok
so I would have to make a different format for each recipe type? Like Shaped, shapeless, furnace, etc?

stuck goblet
#

Internal Server Error @frigid ember

frigid ember
#

@frigid ember @woeful mural I fixed it.. turns out you DO need a static IP address

#

whats the best way to evaluate a string in java

#

is there a way inbuilt in java

#

c# has data tables

#

what about java

#

by best i mean efficient

#

java 8(dont hate on me)

celest light
#

What do you mean by evaluate?

#

I think you mean to turn strings into a more useful datatype, like a 2d array or a collection, etc. Is that right?

#

I also have my own question: anyone know how I can change what blocks a ravager can destroy?

frigid ember
#

no

#

string text = “(2 + 3) * (5 / 2)”;

#

get result

celest light
#

Is it just mathematics in your string, or are you wanting to have actual code in there as well?

#

If you're looking to allow people to do something like paste executable code in books, I don't know of a native Java 8 mechanism for doing that. There are libraries that read and run code (javascript comes to mind), that might be helpful.

#

Oh, the compiler API is older than I remembered. It might work. BUT, you need to trust these code sources a lot -- you're allowing them to run arbitrary code on your server.

naive mountain
#

What does this mean: "Query - Incorrect magic!" <- just spams console with this

frigid ember
#

Hey guys, question about tile entities and client lag.

For some reason, I keep seeing new players join but instantly leaving. It "seems" like it doesn't happen often and when I ask players to go to /spawn to see if they get fps drops, they say they're "fine".

But I've been seeing this join/leave/join again more and I feel like it could be something wrong with the server. Too many entities at spawn? Some sort of server lag? (tps has been almost perfect for almost a month for us, though). Or is it some sort of client lag?

Any ideas?

celest light
#

So they could run a command that deletes everything on the filesystem, for example.

frigid ember
#

In our spawn, there's quite a few holograms, npcs, some signs, empty enderchests for design, a nether portal that's used for something else. I wonder if this could cause these join/leaves

But the holograms are set to not appear unless the player is near

#

Hey guys, how to I get a MapPalette from Color

49
48
    public static void main(String args[]) {
    System.out.print(MapPalette.matchColor(Color.BLUE));
    System.out.print(MapPalette.BLUE);
    }
inland depot
#

Just out of curiosity, what causes the most lag in a plugin?

frigid ember
#

depends on the plugin

inland depot
#

like I know that runnables can cause a ton of lag

#

but is there any time when they're fairly efficient?

subtle blade
#

When they don’t do something stupid lol

inland depot
#

could you explain what causes the most lag with them?

#

i'm gonna take a guess and say loops with tons of entries is one of the causes

subtle blade
#

Anything that may take a long time to process is inevitably going to be taxing on a server

#

Yes

#

Though I made something recently that does structure detection based on the block a player is looking at and then drawing a box outline of particles around the target block and it doesn’t affect the server

#

It depends on how you implement it

#

Lemme find it (on my phone lol)

inland depot
#

I'm just curious because I'm working on a core plugin for my factions server and I sometimes get the "is the server overloaded?" message

naive mountain
#

I am constantly having issues with BungeeCord. It's not working properly I think. It's crashing.
I got 2 VPS's on one there's a bungeecord server that connects to my hub. I've got another VPS that I just set a few iptable rules on forwarding 25565 traffic to my bungeecord VPS.

For some reason it happens sometimes that when someone joins or SOMETHING, I'm not sure. The BungeeCord server starts receiving "Query - Incorrect Magic" and it crashes my proxy server.

inland depot
#

but looking back its probably because i'm testing the plugin on a localhost server off of my laptop with ~1GB allocated

zinc ingot
#

the amount of ram shouldnt overly matter for a factions plugin

#

i cant imagine anything like that taking up more than 1gb

#

you're most likely doing some strange checks, or doing calculations with things in a suboptimal fashion

inland depot
#

well its not the only plugin lol

#

i have Essentials, HolographicDisplays, SaberFactions, LuckPerms, Multiverse, PAPI, ProtocolLib, Vault, my custom enchants plugin, my kits plugin and my server's core plugin

#

like its not terrible

inland depot
#

i've just noticed the messages

subtle blade
#

No toll on the server

zinc ingot
#

idk, have you tried it with only the bare minimum for your factions core?

inland depot
#

haven't yet

#

once again i dont think its a serious problem

#

but once i go to release it i'll make sure everything is good

#

and i only get the overload messages after reloading a few times

#

and i was really just curious to hear your opinions about what causes the most lag, so thanks 🙂

velvet scaffold
#

java.lang.RuntimeException: org.bukkit.configuration.InvalidConfigurationException: while parsing a block mapping
in 'string', line 62, column 3:

#

how do i fix this error when trying to start my server?

inland depot
#

send a screenshot or link to a pastebin of your yml file

velvet scaffold
#

bukkit.yml or spigot.yml?

inland depot
#

the config file

#

first of all

#

send a pastebin of your error message

velvet scaffold
#

(this happened when trying to move from spigot latest to paper latest btw, might be asking in the wrong place)

inland depot
#

ok now send a pastebin of your spigot config file "spigot.yml"

velvet scaffold
inland depot
#

try moving the lines "merge-radius" and "exp: -1" to where the others are

#

like

#

the indentation should be the same

velvet scaffold
#

right

#

ill try this thank you

inland depot
#
default:
  merge-radius: 1
  exp: -1
  verbose: true
  hopper-amount: 1
  # etc
#

@velvet scaffold should look similar to this

velvet scaffold
#

fixed it thank you so much

inland depot
#

no problem!

frigid ember
#
Ambiguous method call. Both
getOnlinePlayers
()
in Bukkit and
getOnlinePlayers
()
in Bukkit matc``` any clue why i get this?
vernal spruce
#

try with getServer().getonlineplayers

#

also what even is that

#

its not java

subtle blade
#

It's an IDE warning because he's using Bukkit 1.7

vernal spruce
#

ahh i see

keen compass
#

or could be an IDE warning of using the two of the same dependencies

inland depot
#

I'm getting an object in a class using the code:

private FactionsManager factionsManager = new FactionsManager();
``` but it returns null. I also have an instance of the class in my main class, so I tried that but it also returned null. The class doesn't have a constructor, so I don't know why it's returning null. If someone could help me that'd be great. Thanks!
frigid ember
#
        for (int i = 0; i < worldMap.colors.length; i++) {
            Bukkit.getConsoleSender().sendMessage(String.valueOf(worldMap.colors[i]));
            worldMap.colors[i] = 0;
        }
keen compass
#

because you set them 0?

frigid ember
#

Thats after I send the values to the console though

keen compass
#

do you ever clear out the list?

frigid ember
#

No

keen compass
#

then that would be why especially if you are re-using that list

#

you are updating the values in the list, instead might be better to just remove them? o.O

celest light
#

Anyone know where I should be resolving the craftbukkit api from? gradlew build isn't finding it, and I have this in my gradle repositories section:
`
mavenLocal()
jcenter()

// copied from https://www.spigotmc.org/wiki/spigot-gradle/
maven {
    url = 'https://hub.spigotmc.org/nexus/content/repositories/snapshots/'

    // As of Gradle 5.1, you can limit this to only those
    // dependencies you expect from it
    content {
        includeGroup 'org.bukkit'
        includeGroup 'org.spigotmc'
    }
}
maven { url = 'https://oss.sonatype.org/content/repositories/snapshots' }
maven { url = 'https://oss.sonatype.org/content/repositories/central' }

`

#

These are the imports in my code:
import org.bukkit.craftbukkit.v1_15_R1.entity.CraftMonster; import org.bukkit.craftbukkit.v1_15_R1.entity.CraftRavager;

#

And in dependencies:
compileOnly 'org.bukkit:craftbukkit:1.15.2-R0.1-SNAPSHOT'

keen compass
#

you need the actual server jar, which you need to build yourself

#

?bt

worldly heathBOT
celest light
#

Hmm, but I ran BuildTools successfully. java -jar BuildTools.jar

keen compass
#

but you are also going to need to update your gradle file to point to that built version instead of trying to get it remotely since it doesn't exist remotely

celest light
#

Maybe buildtools only builds spigot by default?

keen compass
#

API is hosted, but for NMS stuff the server jar is not hosted resmotely

celest light
#

I hoped the mavenLocal() line would pick up the local build?

keen compass
#

yes BuildTools only builds spigot

#

by default

#

but you should only need spigot since it contains craftbukkit

celest light
#

oh, maybe Iv'e made this problem for myself by changing dependencies.

#

That was it. i changed the dependencies to compileOnly 'org.spigotmc:spigot:1.15.2-R0.1-SNAPSHOT' and it works. Thank you very much.

keen compass
#

you are welcome

sturdy oar
#

Should saving data (from Java) to a database be a blocking or non-blocking operation?

#

every 5 minutes

subtle blade
#

Preferably that wouldn't be blocking. IO should be async

sturdy oar
#

Ok thank you

woeful mural
sturdy oar
#

not sure , but your map may have corrupted or invalid chunks?

woeful mural
#

Idk I've never seen the error "Failed to verify username" before, but got it on my survival server 2 days ago and today on my skyblock server twice :S

keen compass
#

Its quite possible mojang has some services down

#

if your server can't contact mojang servers, it can't authenticate which gives you Failed to verify username

woeful mural
#

Hm I see

frigid ember
#

oof

faint pebble
#

anyone knows the plugin that sets all players on the server selected skin and they can't change it?

young dawn
#

How do I put empty lines on scoreboards?

tiny dagger
#

that is easy

#

just put an empty line

#

unless you're using scores to do it in which case good luck

#

jk

#

if you use scores

#

you can use color codes

frigid ember
#

how do i stop a ender pearl from colliding?

tiny dagger
#

to have multiple scores

#

in 1.12+ i think

#

you can ovveride the colliding method

frigid ember
#

which is?

tiny dagger
#

something with movingblock

frigid ember
#

i am doing p.spigot().setCollidesWithEntities(false);

#

but like

tiny dagger
#

nah

frigid ember
#

it errors saying spigot() isnt a method now

tiny dagger
#

that disables all collision

frigid ember
#

yes that what i need

tiny dagger
#

i dunno

frigid ember
#

its for hub

tiny dagger
#

it might not be a thing

subtle blade
#

Depend on Spigot, not Bukkit

tiny dagger
#

setcollidable i think

frigid ember
#

i have imported Spigot.

subtle blade
#

Also, yes, entities have a setCollidable() method

tiny dagger
#

do you get a nomethodfound error?

#

or an exception

#

unsupported

#

or something like that

frigid ember
#

let me see what it was

#

ah thats funny now it works

tiny dagger
#

is there actually a setcollidablewithentities?

frigid ember
#

mhm

#

hmh

crimson sandal
#

Material's aren't serializable are they?

frigid ember
#
aused by: java.lang.NullPointerException
        at me.l3ilkojr.hubcore.Items.impl.EnderButt.getItemType(EnderButt.java:25) ~[?:?]
        at me.l3ilkojr.hubcore.Listeners.PlayerListener.onEntityDismound(PlayerListener.java:169) ~[?:?]``` what could possible be null here?
#
    @Override
    public ItemStack getItemType(Player player) {
        lore.add(StringUtil.format("&6GoldenPvP"));
        lore.add(StringUtil.format("&5EnderButt"));

        ItemStack itemStack = new ItemStack(Material.ENDER_PEARL, 16);
        ItemMeta itemMeta = itemStack.getItemMeta();
        itemMeta.setDisplayName(StringUtil.format("&5EnderButt"));
        itemStack.setItemMeta(itemMeta);
        itemMeta.setLore(lore);
        itemStack.setItemMeta(itemMeta);
        return itemStack;
    }```
tiny dagger
#

their name() is a serialization in itself james

crimson sandal
#

Hmm well I basically want to serialize a RecipeChoice

tiny dagger
#

i think you can implement your own serialization

crimson sandal
#

Yeah I was kinda hoping private HashMap<Character, List<Material>> choices; Would be serializable

tiny dagger
#

well it's not that hard i think to do it

#

i think you can use json

#

for better serialization

#

but as for yml

#

it's pretty restricted

frigid ember
#

do you guys know how to convert an object to bytw array and back WITHOUT serializable

#

like i want to be able to send an object HelloWorld class instance for example, and it has some serializable objects in it maybe, and i want to covert it toan byte array and convert it back by casting.

#

the reason i need this is in sending packets(not mc related)

#

i wanna send for example HelloWorld packet, but not have them have the same import

#

and same serialuid

#

is there a simpler way

#

or must i use serializable

twilit roost
#

Hello I was wondering is there a plugin where if a mob enters a certain area it would be killed. I use the region command and it stops them from spawning but they can still enter the area and i was wondering if there is a way to auto kill them when they enter the region.

slim hemlock
#

hey if I have a method in my constructor for another method, does the code in the constructor run before the method whose constructor it's in ever runs?

#

I feel like it does right

inland depot
#

How do I merge mobs in spigot?

tall pewter
#

Hey, so I've been getting this message, every time I reload my tablist plugin and whenever I swap to servers (bungeecord) that include more than 1 player. It kicks me from the game and says IllegalArgumentException : Team ... already exists in this scoreboard.... I have updated everything and made sure that my tablist plugin isn't the cause. I really don't know what else could possibly cause the issue, and i believe the only way would be that somewhere, somehow, a former plugins data has been stored that's causing this error. Any help would be greatly appreciated.

naive goblet
#

Entity#getNearbyEntites Ultra?

#

And use some repeating tasks perhaps?

cloud crater
#

@twilit roost if you know about coding, use WorldGuard’s api and get region entry

naive goblet
#

nimsy send code?

tall pewter
#

wdym send code?

#

you mean the full error?

naive goblet
#

stacktrace would be useful as well

cloud crater
#

try#catch

naive goblet
#

wym

pastel condor
#

e.PrintStacktrace()

#

something like that

#

in the try catch

naive goblet
#

just catching an exception isn't smart and wouldn't solve the problem

pastel condor
#

if you print the stack trace it helps you debug

cloud crater
#

^

naive goblet
#

Nope

#

The exception is already thrown when he invokes a specific method.

twilit roost
#

@cloud crater is there anywhere we i can see some expiation about how it works ?

pastel condor
#

maybe you could show us where it breaks?

naive goblet
#

also methods starts with lowercase fierceeo

tall pewter
pastel condor
#

yeah I always mess that up

#

I name them whatever I want

#

I got to fix that

cloud crater
inland depot