#help-development

1 messages · Page 406 of 1

quaint mantle
#

^

hazy parrot
#

there is not one language i learned trough courses, but doing projects im interested in

#

well, aside from c and cpp for uni

remote swallow
#

saveDefaultConfig exists on spigot not bungee

rotund ravine
#

You should try hoogling more Petrr

#

The first line is sortof false

#

It’s stricly for the root level of the jar.

#

And a file named

hazy parrot
#

resources folder is java

remote swallow
#

resources is java

#

resources folder is still java

rotund ravine
#

It does

hazy parrot
#

it will just compile to root dir of jar, that is what resources is used for, bungee doesn't know to handle it ig

remote swallow
#

iirc bungee doesnt have saveResource

rotund ravine
#

You can just implement it yourself i guess

#

Not that hard

remote swallow
#

that can be simplified a lot

rotund ravine
#

getDefaultConfig

remote swallow
#

new File(getDataFolder(), "config.yml" no need for the path or the / which would break on diffeernt file systems

rotund ravine
#

Idk man

#

Just use a config framework

#

Easy

remote swallow
#

no you wont and yes it does work

rotund ravine
trim surge
#

anyone know how i stop gradle generating test dirs

rotund ravine
#

You can just delete it

#

Or yknow

#

Ignore it

tender shard
#

which test directory do you even mean?

hazy parrot
#

src/test i assume

rotund ravine
#

Ya

#

I think

rotund ravine
tender shard
#

I was never gone lol

#

just not online that often

rotund ravine
#

You still have your maven addiction?

tender shard
#

do you mean whether still I prefer maven over gradle? If so yes, and that will probably never change

echo basalt
#

oh god I haven't seen alex in a while

#

what happened? got too wasted and slept for a week?

rotund ravine
#

Some addiction center

#

For maven

tender shard
#

i went to rehab on feb 26 or sth like that

#

or 25th or 27th

#

idk

rotund ravine
#

Did you rehab?

tender shard
#

it works like this: you arrive there with a BAC of 3 permille, then they throw benzodiapecines into your mouth and reduce that dosage every day until you're at 0, then you stay for another few days, then you go home sober again lol

rotund ravine
#

Why benzos?

#

I mean i guess

#

But quite the hefty medication

tender shard
#

because it works like alcohol on the gaba system

rotund ravine
#

Yeah; i figured. Still quite hefty

tender shard
#

I got 20mg diazepam the first two days, then 5mg less every day

rotund ravine
#

I see

tender shard
#

plus drugs against erm... whats it called

echo basalt
#

drugs against humanity

tender shard
#

against seizures

echo basalt
#

wait no that's the wrong thing

rotund ravine
#

Still, doesn’t sort root of the problem.

tender shard
#

my root problem is anxiety issues

regal scaffold
#

?paste

undone axleBOT
rotund ravine
regal scaffold
tender shard
#

i can send the translated doctor's letter, one sec

rotund ravine
#

Sure

regal scaffold
rotund ravine
#

Recursive wroom wroom

#

Blame @tender shard for his weird pdcutil

regal scaffold
#

Wait is this because of that?

rotund ravine
#

I eman

#

It’s due to your code

#

But his code too

regal scaffold
#

Well

rotund ravine
#

Show me the class

regal scaffold
#

As in

class Ser1 implements ConfigurationSerializable {

  private Ser2 ser2;

}

class Ser2 {}
rotund ravine
#

Make other one serializable too

regal scaffold
#

What I did was change Ser2 to serializable

#

Yes, done that

#

Added the serialize and deserialize

tender shard
rotund ravine
#

You sure you didn’t do?

As in

class Ser1 implements ConfigurationSerializable {

  private Ser2 ser2;

class Ser2 {}

}

regal scaffold
#

I did it after

#

rn it's

#
class Ser1 implements ConfigurationSerializable {

  private Ser2 ser2;

}

class Ser2 implements ConfigurationSerializable {

}
#

In Ser2 i'm storing a

Map<Enum, Integer>

#

Could that be why?

rotund ravine
#

me.tomisanhues2.ultrastorage.data.UltraChestUpgrades

#

What’s this class

regal scaffold
#

Ser2

#

?paste

undone axleBOT
rotund ravine
#

To me your errors look like it trying to find it, but it’s a subclass and not a seperate class like you are describing

regal scaffold
rotund ravine
#

Can i get the top of it too

regal scaffold
#

Package? yes

#
package me.tomisanhues2.ultrastorage.data;

import me.tomisanhues2.ultrastorage.UltraStorage;
import me.tomisanhues2.ultrastorage.utils.Cases;
import me.tomisanhues2.ultrastorage.utils.UpgradeType;
import org.bukkit.configuration.serialization.ConfigurationSerializable;
import org.jetbrains.annotations.NotNull;

import java.util.HashMap;
import java.util.Map;

UltraChestUpgrade

rotund ravine
#

Fun

regal scaffold
#

I'm kinda confused lol

rotund ravine
#

Well

#

Remove the jar fully and build it again check the pdc data with some debugging before trying

#

Again

regal scaffold
#

I can't even get that far

#

If I place a new chest which will contain that data I get error

tender shard
#

you haven't registered your class

#

ConfigurationSerialization.registerClass(MyClass.class)

regal scaffold
#

................................

tender shard
#

did you do that?

regal scaffold
#

Guess for which one I didn't

#

Thanks alex

tender shard
#

it's explained in the javadocs for ConfigurationSertializable

rotund ravine
#

Oh that is required?

regal scaffold
#

Uhhh wait

#

Wait a second

#

I never registered my first class

#

And it was working perfectly

#

tf

rotund ravine
#

Thought it was just for nicer names

#

Haven’t used the bukkit serializable system in ages

tender shard
#

it says it's required

regal scaffold
tender shard
#

serializing works without it, but not deserializing

regal scaffold
#

In this example, The first serializable works perfectly for both ser and deser without it

#

I'll register both ig?

rotund ravine
#

Go for it

echo basalt
#

haven't used the bukkit serializable system in ages

tender shard
#

you should register all your classes that implement ConfigurationSerializable, at least that's what the docs say, and what I always do

regal scaffold
#

Alright rebuiulding

#

Alright

#

We have advanced to a different error

sudden harbor
#

does somebody know something that prevents drowns from spawning in the world?

regal scaffold
#

?paste

undone axleBOT
rotund ravine
regal scaffold
tender shard
regal scaffold
#

I'm reading through it rn

tender shard
#

"replacement" is null

#

in placeholderutils line 23

rotund ravine
#

🤞🏼

regal scaffold
#

Yes yes

#

Working on it

torpid blaze
#

Sorry, I just looked a bit around but I still don't realy understand what I did wrong in combination with static. :c

midnight shore
molten hearth
#

now pay up

trim surge
hazy parrot
worldly mountain
#

Maybe not the most usual question, but does anyone have some good ideas for portfolio projects?

midnight shore
hazy parrot
#

why are you implementing this and for serialize method just return same map

midnight shore
zealous osprey
midnight shore
#

removed

hazy parrot
#

that is point of serializer

harsh badge
#

I’m having an issue I have 2 different plugins w maven and plug-in 1 relies on plugin 2 to build and plugin 2 relies on plugin 1 so when I use mvn install it won’t let me because I didn’t install the first one

midnight shore
hazy parrot
harsh badge
#

How do I fix it then?

hazy parrot
#

get rid of that loop somehow

regal scaffold
#

How can I change the default return value of an enum

#

For example

enum Test {
  Test1("path")
}

Can I make Test.Test1 return the path by default?

midnight shore
regal scaffold
#

Meh, .value it is

midnight shore
#

wdym?

remote swallow
#

whats going on

tawdry parcel
#

Is there a way I can change the leave message of a player that gets banned?

eternal oxide
#

if your plugin is doing the banning, kick them first and provide the message, then ban them

tawdry parcel
earnest prawn
#

Is there an API to easily get permissions with the highest weight and some custom value, like prefix.x.y where x is the weight and y is the value? No idea what's the name for them

tawdry parcel
#

no I mean this leave message

#

but then it's always this leave message. I want it so that only when a player is kicked or banned should another leave message appear

hazy parrot
dry yacht
#

Isn't there a disconnect-reason?

tawdry parcel
#

and how If I kick the player?

earnest prawn
analog thicket
hazy parrot
dry yacht
earnest prawn
#

Dunno, some plugins use it

tawdry parcel
#

yeah but If I want to make a custom leave msg that should appear when I kick a player

hazy parrot
analog thicket
analog thicket
#

No where near done with the animaiton tho

dry yacht
tawdry parcel
analog thicket
#

I'm thinking about rotating like 10 armorstands around it, then stop them at different angles, last but not least make them rotate fast around the chest, and then it chooses a random one.

dry yacht
analog thicket
fallen fjord
#

any1 who knows a good vid to learn how to code npc's in 1.19(.x)?

spice shoal
#

someone know how to cancell the event (BlockExplodeEvent) for all items in game?

fallen fjord
#

e.setCancelled(true) ig

#

lol

spice shoal
fallen fjord
#

i just type it short xd

#

only in dc tho

#

encrypt it

#

and encrypt the encrypted code

#

and put that into binary

#

idk

dry yacht
#

You gotta encrypt it using ROT13 twice, that'll be uncrackable

remote swallow
#

make sure to use random single letters for var names too

spice shoal
fallen fjord
#

i dont

tawdry parcel
dry yacht
fallen fjord
#

play sound on player?

#

what do you want to happen to the <okayer>?

tender shard
#

why do you bother about it

smoky oak
#

is there a collection with o(1) contains or is the best ill get o(n)?

smoky oak
hazy parrot
#

HashSet

eternal night
#

yes ?

#

^

smoky oak
#

ill use hashset if i cant get this to work. I'm trying to get a list<string> into a enumset

#

but i cant find a proper conversion method anywhere

eternal night
#

you can just, stream that ?

smoky oak
#

well

#

i got this far

#
ItemsList.stream()
                .map(Material::getMaterial)
                .collect(Collectors.toSet());
#

but i dont know what to tell the collect method to get an enum set

eternal night
#
List.of("STONE", "DIAMOND").stream()
    .map(Material::valueOf)
    .collect(Collectors.toCollection(() -> EnumSet.noneOf(Material.class)));
#

matchMaterial is something different

#

that uses the item ids

#

presumably preferable

#

but /shrug

tender shard
#

I'd do it like lynx did it

    public static <E extends Enum<E>> EnumSet<E> asEnumSet(Class<E> enumClass, List<String> list) {
        return list.stream().map(s -> Enum.valueOf(enumClass, s)).collect(Collectors.toCollection(() -> EnumSet.noneOf(enumClass)));
    }
#

and for material, do not use enumsets

eternal night
#

that too

#

those are gonna break hopefully sooner than later

drowsy garnet
#

I have a problem with my Minecraft Server
Always i try to start it send me this

tender shard
smoky oak
eternal night
#

no

#

not in that method

#

as the enum type is a parameter

smoky oak
#

ah

#

thats smart

eternal night
#

again tho, for materials

#

don't use enum set

#

use a hashset

smoky oak
#

why?

#

isnt material an enum

eternal night
#

not for much longer

smoky oak
#

wouldnt it break in either case then?

eternal night
#

hopefully

#

if you don't use an enum set you are fine

analog thicket
#

Is it possible to make a method for a Bukkitrunnable and use that in a Bukkitrunnable?

tender shard
smoky oak
#

wait

#

Collectors.toSet doesnt let me do it as hashset

tender shard
smoky oak
#

is set lookup o(1) too or is it slower?

analog thicket
#

Yeah, but would I work instantaneously? if i then need to run the same Runnable but with different values?

eternal night
#

toSet uses a hashset

smoky oak
#

k

tender shard
tender shard
smoky oak
#

ah thanks. also on a different note, does this only work on class identifiers?

.removeIf(removeSet::contains)
eternal night
#

I guess not no, no guarantee about the set type

smoky oak
#

well the error is weird

eternal night
#

but like

#

O(1) is overrated

smoky oak
#

it says like 'required: collection, provided: boolean'

#

nvmind im an idiot

#

im comparing itemStack to material lol

ornate patio
#

is there a built in method to get a list of all entity types that are mobs

#

entityType instanceof Mob?

#

like directly?

#

i need the entityTypes tho

tender shard
tender shard
tender shard
#

EntityType is an enum, it'll never be instanceof anything other than itself and Enum and Object

eternal night
#
Arrays.stream(EntityType.values())
    .filter(e -> e.getEntityClass() != null)
    .filter(e -> Mob.class.isAssignableFrom(e.getEntityClass()))
    .collect(Collectors.toList());
ornate patio
#
EntityType[] allEntityTypes = EntityType.values();
// remove ender dragon and wither
for (EntityType entityType : EXCLUDE_TYPES) {
    allEntityTypes[entityType.ordinal()] = null;
}

// resize array
int size = 0;
for (EntityType entityType : allEntityTypes) {
    if (entityType != null && !entityType.name().contains("MINECART") && entityType.isAlive()) {
        size++;
    }
}
eternal night
ornate patio
#

etc

tender shard
eternal night
#

it is not xD

tender shard
#

I remember I once needed sth like that but there was no such thing. however that might have been like 5 years ago

eternal night
#

nah that was like

#

all the way back

#

its how it internally does spawning

#

so like, ever since spawn(Class<? extends Entity>) existed I guess

tender shard
#

then I'm probably confusing it with sth else

eternal night
#

probably yee

#

it was a thing in 1.8

tender shard
#

oh ok

eternal night
#

that docs page is so dysfunctional 😭

tender shard
#

yeah lol

#

iframes 🥲

quaint mantle
#

How can I create a new persistent data container?

eternal night
#

via the context of an existing one

quaint mantle
#

How do I do that?

#

Nevermind lol

fallen fjord
#

How do i make a npc plugin?

#

like

#

i need a good tutorial

river oracle
#

Citizens is easiest way I think

remote swallow
river oracle
#

I'd just use Citizen's API

remote swallow
#

yea

worldly ingot
#

I don't know about reading Citizen's code lol

torn shuttle
#

anyone know how to link to a discord room that has a space in the name in a way that makes sense?

#

I'm having a hard time with it

analog thicket
#

How would i add a delay to my for loop. Thread.Sleep does not seem to work. That pauses everything.

#

?

tall dragon
#

?scheduling

undone axleBOT
remote swallow
#

?scheduling

tall dragon
#

HA

remote swallow
#

frick

analog thicket
#

Oh fuck

#

i forgot about scheduling

#

Thats akward

hazy parrot
#

Is it possible to get effective motd as docs on Bukkit.getMotd() are a bit misleading, its returning motd defined in server.properties, what if some plugin override that ?

analog thicket
# remote swallow frick

Wait im already using a BukkitRunnable and i gotta use a for loop in that. Because i need to repeat the same task but with different values 8 times? how would it be possible to use schedulers for that?

hazy parrot
#

hmm, not sure that i will be able to ping it in real scenario

torpid blaze
#

Not, I rewrote my Config Class so there are no static classes anymore and used DI to pass it ot the other classes. But I still have the same issue... :c
https://paste.md-5.net/ulorofehis.cpp

ocean hollow
#

Can I put a chicken on a player and tie a leash to it?

worldly ingot
#

I'm pretty sure players can have passengers, so yeah probably

ocean hollow
#

she is with a leash. but not on the player's head

hazy parrot
hazy parrot
#

same as most c-family languages

#

or nearly every language to be percise

eternal oxide
#

just Stream.of(players).map(Player::name).collect(Collectors.toList());

#

whichever the classes are on Bungee

#

all you have to do with that code is replace players with whatever bungee provides as the list of players

#

and Player::name is the class/method to fetch the players name

#

?jd

eternal oxide
#

so first one is ProxyServer#getPlayers

#

and second one becomes ProxiedPlayer::getDisplayName

quiet ice
#

they just refer to methods

eternal oxide
#

yeah, get your server instance

quiet ice
#

Depending on the person the difference is between static vs non-static

eternal oxide
#

thats because you havn;t got yoru proxy instance

#

try ProxyServer.getInstance().getPlayers()

#

?notworking

undone axleBOT
#

"Does not working" is a useless statement. Please describe what exactly is not working, what you expect it to do, and what actually happens. If you get any console errors, also ?paste the entire stacktrace.

rotund ravine
#

?nocode

undone axleBOT
#

It’s hard to answer a programming question without code
Oh no! You ran into a problem. But no worries, people are willing to help, but first they need to see your code. This is because otherwise, they would be providing help based on guesses instead of concrete knowledge. Whether it be a compile error, runtime error, or an unexpected output, I'm sure that if you were to provide code, you'd receive a quick solution.

eternal oxide
#

delete ProxyServer#

rotund ravine
#

Was about to write not the second P haha

eternal oxide
#

🙂

#

Some are

rotund ravine
#

I’d hope not

#

But this is spigot

#

The discord is spigot haha

eternal oxide
#

its for both but we rarely get any bungee questions

rotund ravine
#

It wasn’t meant to say he can’t ask bungee questions, but rather spigot is full of dumb people

eternal oxide
#

ah

rotund ravine
#

What errors does it show if u hover over it

eternal oxide
#

I hope Prixied was a typo

rotund ravine
#

Dumb

#

Not you

#

Code rq again

#

?jd-b

remote swallow
#

?jd-bc

ivory sleet
#

Stream::of takes an array, no?

eternal oxide
#

ah true

#

in which case you can just stream straight from teh getPlayers

#
ProxyServer.getInstance().getPlayers().stream().map(ProxiedPlayer::getDisplayName).collect(Collectors.toList());```
rotund ravine
#

Gl

tardy delta
#

Stream.of(T...) calling Arrays.stream 💀

ivory sleet
#

vararg

orchid gazelle
#

Does PlayerQuitEvent fire before the player leaves?

analog thicket
tender shard
#

ofc it happens after the player clicks on "Disconnect"

orchid gazelle
#

yeah obviously

tender shard
#

but it happens before the player left the server "server-side"

orchid gazelle
#

ah ok

tender shard
#

you still have a valid entity during that event

orchid gazelle
#

thanks, thats what I wanted to know

thorn crypt
#

Is there a way with spigot directly to know if a plugin got an update ?

remote swallow
thorn crypt
#

Thanks 😅

tawdry echo
#

i have question about scoreboards, i have to create scoreboard for player once when he join and manipulating this one?

frank kettle
#

Depends of the scoreboard you trying to achieve

#

Maybe start by trying to actually create a scoreboard

#

And actually search online before on how to make a scoreboard, there's so many threads, it's pointless to be asking here such thing.

#

There's many great tutorials that can help you like a bukkit/spigot tutorial thread or YouTube which explain step by step instead of here

tardy delta
#

does anyone knows whether a packet is being sent (and if so, which one) when i click on an item in the crafting book to display the preview of the items?

tardy delta
#

the thing is that im listening for the recipe request packet from the client (on minestom) and it only gives me a recipe id, which i get the recipe from but if the player is able to craft this recipe, i have to move the items required into the crafting grid to let the player take the result out, but i cant know which variant of a recipe is being used, for example you can craft sticks with oak planks, spruce planks etc so idk which items to place

#

so i kinda have to know what items are displayed there somehow

tender shard
#

recipe request packet?

#

can't find anything like that in craftbukkit

#

also fuck you IJ, why is there no regex search for classes

tardy delta
tender shard
#

I dislike IJ more and more every day

smoky oak
#
rSection:
  ANCIENT_DEBRIS: "NETHERRACK"

why is this Optional.empty instead of... you know, ANCIENT_DEBRIS?
getConfigurationSection("rSection").getKeys(false).stream().findFirst().toString()

tender shard
#

i never understood wiki.vg, they use their own weird names for everything

tardy delta
#

then gets responded to with a 0x2F Place Ghost Recipe

tender shard
#

hmm

tardy delta
#

ye the names are ass

tender shard
#

I wonder what the actual packet names are

tardy delta
#

lemme see

tender shard
#

this is the only classes that have "Recipe" in their names in craftbukkit

smoky oak
#

also isnt that search bar regex supported

#

i thought it was

tender shard
#

no, that one doesn't have it

#

only the regular Search thing

#

this one

#

but that's kinda a weird workaround as it e.g. wouldn't show classes from dependencies

#

it's not possible to use regex in the usual "Search class" thing

#

the "Shift-Shift" menu doesn't support regex at all

tardy delta
#

clientbound means sent by client right

#

that shit confuses me

tender shard
#

clientbound means "TO the client"

tardy delta
#

bruh

eternal oxide
#

bound as in destination

tender shard
#

yeah

#

headed to the client

eternal oxide
#

not tied to the client 🙂

smoky oak
#

i mean, its also called outbound and inbound

#

whats so confusing about clientbound heading to the client

tender shard
#

yeah but whether it's outbound or inbound depends on whether you are the server or client 😄

eternal oxide
#

I can see it

tardy delta
#

me dealing with 3 packet descriptions now

eternal oxide
#

client bound could mean it's bound to the client so comes from the client

#

however it's not that meaning

tender shard
#

yeah both names are a bit weird

#

ServerToClientEntitySpawnPacket lol

quaint mantle
#

?di

undone axleBOT
tender shard
#

ServerTellsClientThatANewEntityHasBeenSpawnedPacket

smoky oak
#

bleh

eternal oxide
#

looks good to me 🙂

tender shard
#

but only your config included in the .jar contains it

#

maybe?

smoky oak
#

i am using getConfig from the jar itself for testing purposes without saveDefaultConfig()

tardy delta
tender shard
#

save the config, and only after that call getConfig(), then check if it works now

#

I remember that using the "included config only" leads to weird issues like this

eternal oxide
#

unless you set it as default

smoky oak
#

WHAT.

#

how the fuck

#

i mean

#

it works with string lists

#

wtf

tender shard
#

yeah but the funny thing is that if you do a config like this:

name: mfnalex

and then you just do getConfig().getString("name"), it DOES return "mfnalex" even when not saving the config, and not setting any default values

#

it's kinda weird

smoky oak
#

i know that part since getStringList on a config section returns the list

#

but getkeys fails

tardy delta
#

brr there both a serverbound place recipe and a clientbound one

tender shard
#

yeah it's only ConfigurationSections that behave weird

smoky oak
#

whyyyyyyyy

tardy delta
#

no way iwas confused

smoky oak
#

anyways thanks for the help

tender shard
#

np

smoky oak
#

id never have found that

#

you know i expect code from other people to work

tardy delta
#

💀

#

mojang name be like: ServerBoundPlaceRecipePacket, minestom be like: ClientCraftRecipeRequest \💀

tender shard
#

oh

#

wrong reply

smoky oak
#

😄

tender shard
#

I hate that you cannot just remove the "replied to" thing

smoky oak
#

^^

tender shard
#

one can only remove the whole message and send it again

smoky oak
#

😛

tender shard
#

so annoying

smoky oak
#

tardy delta
#

discord moment

tender shard
#

i wonder whether the API could remove the "replied to"

smoky oak
#

🚫

tardy delta
#

lets make our own discord

tender shard
#

be damned, discord

eternal oxide
#

with blackjack and hookers

smoky oak
#

⚒️

#

♣️

tender shard
tardy delta
#

elgarl going wild

safe ibex
#

How would I get the material type of a clicked item in an inventory?

tardy delta
#

event.getClickedItem().getMaterial() or smth ig

safe ibex
#

Like e.g. event.getCurrentItem()....

safe ibex
rotund ravine
#

getType

tardy delta
#

ah getType()

#

messing with minestom too much

safe ibex
#

Ah thanks

smoky oak
#

btw world.getType is deprecated but i cannot find a 'modern' version for it?

safe ibex
#

I mean it'd be more logical to make it .getMaterial but hey oh well 🤣

#

Thanks

rotund ravine
#

?jd-s

undone axleBOT
smoky oak
tardy delta
#

ok not much here

smoky oak
#

is it some part of meta

smoky oak
#

wdym

#

says deprecated for me

tender shard
#

you said getType

#

not getWorldType

smoky oak
#

wait

#

what does gettype do then

tender shard
#

getType() is like getBlock(...).getType()

smoky oak
#

dang it

#

doesnt solve my issue

#

i need to know if normal, nether, end

tender shard
tender shard
#

getDimension()

#

sth like that

#

wait

rotund ravine
safe ibex
#

If I wanted to pass a variable to a click listener from a command, how would I be able to do so?

tender shard
#

getEnvironment it is

#

pre 1.18 it's part of World, 1.18+ it is part of WorldInfo (which World extends)

tardy delta
#

where you clickin on

safe ibex
smoky oak
#

so just world.getEnvironment

#

thx

untold stirrup
#

some one know how i can edit the combat and the knockback

tardy delta
#

map lookup id say, idk how your stuff is set up

tender shard
rotund ravine
bitter umbra
#

Hello, can any plugin dev help me with some questions? I am not able to add spigot 1.19.3 correctly to Eclipse 😦

tender shard
smoky oak
#

i only know IJ sorry

eternal oxide
#

Eclipse with maven?

tender shard
#

if you are not using any build tool (although you should use one):

#

?bootstrap

undone axleBOT
#

Bootstrap Jar
The main spigot-1.18.jar is now a bootstrap jar which contains all libraries. You cannot directly depend on this jar. You should depend on Spigot/Spigot-API/target/spigot-api-1.18-R0.1-SNAPSHOT-shaded.jar, or the entire contents of the bundler directory from your server, or use a dependency manager such as Maven or Gradle to handle this automatically.

Please read the release notes for further information: https://www.spigotmc.org/threads/9-years-of-spigotmc-spigot-bungeecord-1-18-1-18-1-release.534760/#post-4305163

rotund ravine
tender shard
#

ah so intel

#

I am so mad at my 2017 macbook because it has the butterfly issue

#

and I only realized that after the warranty was long gone

rotund ravine
#

butterfly?

tender shard
#

the keyboard with these ultra slim keys

rotund ravine
#

oh

tender shard
rotund ravine
#

mine works fine thank god

smoky oak
#

well i prever like 1mm keys but then again im nothing but a highly functioning sociopath

tender shard
#

my 2017 has this issue and I always thought it was my fault for getting tobacco into the keyboard

#

turned out it wasn't my fault

rotund ravine
smoky oak
#

the keyboard part not the sociopath part btw

#

i know some of you will get that wrong

safe ibex
tender shard
#

well I got the m2 now anyway

rotund ravine
undone axleBOT
#

It’s hard to answer a programming question without code
Oh no! You ran into a problem. But no worries, people are willing to help, but first they need to see your code. This is because otherwise, they would be providing help based on guesses instead of concrete knowledge. Whether it be a compile error, runtime error, or an unexpected output, I'm sure that if you were to provide code, you'd receive a quick solution.

tender shard
#

with apple care so I can also spill whatever onto it and getting it replaced

rotund ravine
#

?askgoodquestion

undone axleBOT
safe ibex
rotund ravine
rotund ravine
undone axleBOT
#

It’s hard to answer a programming question without code
Oh no! You ran into a problem. But no worries, people are willing to help, but first they need to see your code. This is because otherwise, they would be providing help based on guesses instead of concrete knowledge. Whether it be a compile error, runtime error, or an unexpected output, I'm sure that if you were to provide code, you'd receive a quick solution.

rotund ravine
#

?askgodoquestion

safe ibex
#

Like I don't have code for it that's the point

tender shard
safe ibex
smoky oak
#

?ask

undone axleBOT
#

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. Make sure you use the right channel regarding the topic of your question. Create a thread in case the channel is already in use!

safe ibex
#

wow

smoky oak
#

i mean

#

type out your issue

#

cant be that hard

rotund ravine
#

What's a "click listener", what type of variable do you want to pass. How is your setup structured? @safe ibex

quiet ice
tender shard
#

or in a normal field or in a map or whatever

#

?xy

undone axleBOT
quiet ice
#

There are other ways of doing it (static manager or whatever) but it all amounts to the same thing

rotund ravine
#

It does not.

smoky oak
safe ibex
#

I made a click listener for a GUI made with an inventory. I want to pass a variable to the click listener for conditional logic.

#

How would I attempt that is my question

quiet ice
#

The only interesting way of doing it is to create the listener on the fly but chances are that is not appropriate

tender shard
#

create a Map<UUID,Whatever> that stores your stuff if it's per player

quiet ice
tender shard
#

or a Map<Inventory,Whatever> if it's per inventory

smoky oak
#

i feel like im missing context

safe ibex
#

Yeah that works

smoky oak
#

if you want to pass a variable why dont you do so during init

#

unless its primitive its pass by reference

quiet ice
tender shard
#

because this variable is probably different for every player and/or inventory

rotund ravine
#

So there is code?

rotund ravine
#

Then it's not just a question.

tender shard
tender shard
safe ibex
quiet ice
rotund ravine
#

@safe ibex I'd think not haha

safe ibex
#

But yeah thanks for the map suggestion 👍

quiet ice
#

Unless you have Map<UUID, Inventory>, Map<Inventory, Value> but that'd catch my attention

smoky oak
# tender shard getEnvironment it is

I feel like theres a better way to do this lol

boolean isHigh = chunk.getWorld().getEnvironment()== World.Environment.NORMAL;
int a = isHigh ? 320 : 256;
int b = isHigh ? -63 : 0;
tender shard
#

I usually keep a Map<UUID,GUIContext> or similar, where GUIContext is just a data class that holds all information I need (e.g. current open GUIType (enum, e.g. MAIN_MENU, etc), and whatever other shit I need

tender shard
#

and what's "a" or "b"?

smoky oak
#

that solves that problem

#

for(int y = b; y < a; y++){

#

also

rotund ravine
tardy delta
tender shard
#

yeah rather call it maxHeight and minHeight

smoky oak
#

i always forget if you can put getters in loop heads

rotund ravine
smoky oak
#

like

#

does it call it once when the loop starts

smoky oak
#

or every time

rotund ravine
#

It compares each time.

tardy delta
#

i better add block placement rules quick

smoky oak
#

location + blockFace

dry yacht
smoky oak
#

ye

#

i cached it

rotund ravine
#

JIT probably does it at some point, pray to our lord and saviour

smoky oak
#

i dont understand why we cant just tell the jvm 'please compile EVERYTHING' and enjoy the speed

rotund ravine
#

Have you used eclipse?

smoky oak
#

yes

#

i forgotten EVERYTHING

rotund ravine
#

They have some weird feature that allows you to compile even with errors

tender shard
#

I hate the plexus eclipse compiler

tardy delta
#

when i do download sources, isnt it downloaded here?

tender shard
#

not sure how IJ does it

#

if you do it directly via maven: yes

#

it should be there

#

you can try to manually run mvn dependency:sources

tardy delta
#

i did that: "reduce load time and indexing via download sources" thhing

tender shard
#

or if you also want javadocs: mvn dependency:sources dependency:resolve -Dclassifier=javadoc

#

or tell maven to always do it automatically in settings.xml:#

#
<settings>
    <profiles>
        <profile>
            <id>downloadSources</id>
            <properties>
                <downloadSources>true</downloadSources>
                <downloadJavadocs>true</downloadJavadocs>
            </properties>
        </profile>
    </profiles>

    <activeProfiles>
        <activeProfile>downloadSources</activeProfile>
    </activeProfiles>
</settings>
tardy delta
#

ok

torpid blaze
#

Hey,
I have a problem with yml files.
I have a custom map object with I want to save in a HashMap in the yml file to access the data with it by its name. my problem is, that after updating one map, my key for the whole maps Map is null.

So I save my maps datas under maps.mapname
After updating a maps data, the keys under map. is null when trying to get them.

Someone before sad it was because of the file in memory getting set to null so I rewrote my whole Config management, but I still have the same issue.

Has anyone any idea why this happenes?

tardy delta
twin venture
#

Hi question , if i for some reason decided to use packets to spawn custom armorstand , the best way i can do that is using ProtocolLib bcz it support all minecraft version ?

undone axleBOT
#

It’s hard to answer a programming question without code
Oh no! You ran into a problem. But no worries, people are willing to help, but first they need to see your code. This is because otherwise, they would be providing help based on guesses instead of concrete knowledge. Whether it be a compile error, runtime error, or an unexpected output, I'm sure that if you were to provide code, you'd receive a quick solution.

rotund ravine
#

?notworking

undone axleBOT
#

"Does not working" is a useless statement. Please describe what exactly is not working, what you expect it to do, and what actually happens. If you get any console errors, also ?paste the entire stacktrace.

twin venture
tender shard
tardy delta
#

heeheehee

rotund ravine
#

?jd-bc

tardy delta
#

no clue what the dif even is

tender shard
#

then otherPlayer is null

twin venture
#

error :
com.comphenix.protocol.reflect.FieldAccessException: No field with type java.util.UUID exists in class PacketPlayOutSpawnEntity.
at com.comphenix.protocol.reflect.StructureModifier.writeInternal(StructureModifier.java:369) ~[?:?]
at com.comphenix.protocol.reflect.StructureModifier.write(StructureModifier.java:349) ~[?:?]
at dev.skypvp.core.provider.lootbox.SkyPvPLootBoxManagerProvider.spawnArmorStand(SkyPvPLootBoxManagerProvider.java:393) ~[?:?]

code :

#

ideas? xd

tender shard
#

it cannot be not null, otherwise you wouldnt get this error

#

it definitely is null. print out "otherPlayer" to console

#

it'll say "null"

rotund ravine
twin venture
tender shard
#

which MC version?

torpid blaze
tender shard
#

in 1.19.3 it definitely has a UUID field

twin venture
torpid blaze
#

?paste

undone axleBOT
twin venture
#

i know i know , 1.8.8 is old

tender shard
twin venture
#

1.8.8

tender shard
#

ProtocolLib does NOT mean your stuff works in all versions

twin venture
#

i know, i will make code for each version

#

just wana get it work first ..

tender shard
#

well then just get rid of protocollib and use the vanilla packets

rotund ravine
#

🤮

tender shard
#

just decompile that packet in 1.8 and you'll see what fields it needs

twin venture
tender shard
twin venture
rotund ravine
tender shard
#

example:

NMS:

MyPacket packet = new MyPacket(someUUID, 1, 2, "mfnalex");

ProtocolLib:

MyPacket packet = new MyPacket();
packet.getUUIDs().set(1, someUUID);
packet.getIntegers().set(1, 1);
packet.getIntegers().set(2, 2);
packet.getStrings().set(1, "mfnalex");
#

using NMS you can directly see how the packet is constructed. ProtocolLib is just weird messy reflection

rotund ravine
zealous osprey
#

Quick command question, cause I don't want to make a custom one if I don't need to... but how do you teleport a player to a different location and world using the /tp command in 1.12.2?
Cause newer versions have /execute as @s in world run tp ~ ~1 ~, but 1.12.2 doesn't have that

twin venture
quaint tapir
#

`Wither wither = location.getWorld().spawn(location, Wither.class);
wither.setCustomName(ChatColor.DARK_RED + "Wither" + ChatColor.WHITE + " ( " + ChatColor.GREEN + "4000" + ChatColor.WHITE + " )");
wither.setCustomNameVisible(true);
Attributable witherAt = wither;

    AttributeInstance damage = witherAt.getAttribute(Attribute.GENERIC_ATTACK_DAMAGE);
    AttributeInstance health = witherAt.getAttribute(Attribute.GENERIC_MAX_HEALTH);
    AttributeInstance speed = witherAt.getAttribute(Attribute.GENERIC_MOVEMENT_SPEED);
    speed.setBaseValue(10);
    health.setBaseValue(4000);
    wither.setHealth(4000);
    damage.setBaseValue(100);`
tender shard
quaint tapir
#

I'm struggling to change the hp and damage of a wither

#

can anyone helpp

tender shard
#

people think "ah, protocollib, it will always work" but that's bullshit, one still has to check how the packet works in every version

tender shard
torpid blaze
# rotund ravine and show me how you are using the config manager

For Example:

LinkedHashMap<String, JumpMap> maps = new LinkedHashMap<>();
if ((LinkedHashMap<String, JumpMap>) mc.getConfigurationSection("jumpMaps") != null)
maps.putAll((LinkedHashMap<String, JumpMap>) mc.getConfigurationSection("jumpMaps"));

maps.put("test", new JumpMap());
mc.set("jumpMaps", maps);
rotund ravine
#

I want to see your loads and saves too @torpid blaze

twin venture
#

is there a website i can see how to use protocollib for 1.8.8 ?

unique gate
#

hey I'm having difficulty resending chunks to the player after changing the biome of loaded chunks (I could just tp them away and then back, but it's kind of jank)

torpid blaze
tender shard
rotund ravine
torpid blaze
#

?paste

#

?paste

undone axleBOT
tender shard
#

?toothpaste

rotund ravine
#

sets your things to an empty map

small hawk
#

Hi, guys, I am a little bit stuck with my plugin. Let's say u can create Cases in config.yml, I am using PDC to detect keys and cases and so on. The system will work, when u click lime dye u get 1 random item from case that appears in config. But when clicking Lime Dye to "open the chest", i don't know how to detect which case from config am I opening, any ideas how to detect that?
Here's a screenshot below what custom GUI looks like, Netherite Blocks imitates items, that will be placed there in the future

torpid blaze
#

yea

torpid blaze
#

So it shouldn't be empty anymore

rotund ravine
#

Upload your project to github

torpid blaze
torpid blaze
tender shard
#

why not just assign a unique PDC value to every item, then check which one was clicked?

small hawk
rotund ravine
#

what cas

#

which lime dye is lcicked?

#

or choosing a random thing+

tender shard
#

I don't really understand the issue, I guess

small hawk
#

Ye it's very hard to explain my concept

unique gate
#

is there anyone who is good with packets that i could speak to

undone axleBOT
#

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. Make sure you use the right channel regarding the topic of your question. Create a thread in case the channel is already in use!

tender shard
#

@rotund ravine

#

is there anyone who is good with packets @rotund ravine ?

tardy delta
#

not me atleast

rotund ravine
#

You'd probably need to send the whole chunk again @unique gate

#

or you can change their view distance to 0 and up again probably

unique gate
#

oh the view distance might work

#

i was trying to do something like this

#
                    net.minecraft.server.v1_8_R3.Chunk nmsChunk = ((CraftWorld) world).getHandle().getChunkAt(hippoPlayer.getPlayer().getLocation().getBlockX(), hippoPlayer.getPlayer().getLocation().getBlockZ());
                    final EntityPlayer ep = ((CraftPlayer) player).getHandle();
                    ep.playerConnection.sendPacket(new PacketPlayOutMapChunk(nmsChunk, false, 0));```
#

but i was getting chunk error

hazy parrot
#

Can I somehow get motd from server list ping inside of my plugin aside from manually pinging it (can't really listen for event as motd have to be getted on request)

fluid river
#

?pdc

tender shard
#

your own server's motd?

fluid river
#

@mossy gazelle

fluid river
#

you mean if motd is controlled by another plugin or just written in yml

#

and you just want to get current text

tender shard
#

you could try to call a ServerListPingEvent and then check the result

mossy gazelle
fluid river
mossy gazelle
#

Brain = Dead

fluid river
#

?pdc

tender shard
#

instead of "dummy motd", better use the original motd from the server config

echo basalt
#

that's from server.properties and afaik there's no bukkit getter

#

so you gotta use reflections or nms to fetch it

#

thanks mojang

tender shard
#

wdym?

#

Bukkit.getMotd()

echo basalt
#

o

tender shard
#

just do Bukkit.getMotd() for the default one

echo basalt
#

I'm idiot

tender shard
#

you're Illusion

echo basalt
#

tf is this

fluid river
#

illusory brain

#

hello alex

tender shard
echo basalt
#

it is

tender shard
echo basalt
#

used in the craft scheduler

tender shard
#

hm not in 1.19.3

tardy delta
#

not even an AtomicInteger

fluid river
#

you need jree fava lessons?

tardy delta
#

i need free minestom lessons

fluid river
#

hello brush

tardy delta
#

hello sir

twin venture
#

hi , just a question idk why but i can't use this class :
WrapperPlayServerSpawnEntity

#

i have protocollib added into my plugin

fluid river
#

and?

twin venture
#

its just not there ..

fluid river
#

some more description

tender shard
fluid river
#

is it even provided in protocollib

tender shard
#

no

twin venture
fluid river
#

or in this specific version you are currently using

tender shard
#

it's from PacketWrapper which is dead, more or less

fluid river
#

maybe he is on 1.5.2

#

😉

twin venture
#

no 1.8.8 xd

#

but

echo basalt
twin venture
#

i want to support till 1.19

#

xd

tardy delta
tender shard
#

then you should just write one module per NMS version and send the packets directly through NMS

#

instead of messing with protocollib or outdated wrapper libraries

twin venture
#

alright thanks again .. will do

tender shard
#

also supporting "all versions" is pretty useless, nobody e.g. uses 1.14.3

#

just go for 1.8.8, 1.12.2, and 1.16+

#

all versions inbetween are totally dead

worldly ingot
#

just go for 1.8.8, 1.12.2, and 1.16+ 1.19.3
FTFY

tender shard
#

or be superior and go for latest only

small hawk
#

Can i access BlockState in InventoryClickEvent by InventoryHolder, is that even possible ?

echo basalt
#

or be superior

#

and refuse to support anything but 1.4

tender shard
#

the only other versions besides the ones I mentioned is 1.7.X and that's at 0.6%

worldly ingot
#

InventoryHolder can be a BlockState so you just need to instanceof and cast accordingly

echo basalt
#

people keep saying the inventory holder system is obsolete

#

Edit; it is.

worldly ingot
#

If you're implementing InventoryHolder you're doing it wrong

#

But that wasn't their question

tender shard
#

check if the InventoryHolder is instanceof BlockInventoryHolder, then you can do getBlock().getState()

worldly ingot
#

No reason to

#

The InventoryHolder itself can be a BlockState

#

Chest for instance is an InventoryHolder

tender shard
#

yeah true

small hawk
#

well, sounds great, cause i use shulkerbox as a custom gui and i need PDC from block state, maybe that will solve my issue

tender shard
#

I wonder which blocks are BlockInventoryHolder but NOT Container

pseudo hazel
#

maybe beacons or some shit

tender shard
#

hm maybe

#

too lazy to test it lol

worldly ingot
#

None. All blocks that have persistent inventories are BlockInventoryHolders

echo basalt
#

I am still waiting for the day when me and alex drop the diss-album against choco

worldly ingot
tender shard
#

let's rather do an album against oliver, it's called "mmm" and the cover is a screenshot of windows taskmanager

echo basalt
#

sure

small hawk
echo basalt
#

I feel like that oliver album would be more of a trap thing

#

more energetic

#

mmm, microwave, feel his soul die when I ride this wave
olive is the one which god should save
olive's the one that's gon' misbehave

dug his grave, forgot but not forgave
the way this rave is going, standing's quite the brave
slaving to this trade, like lemonade, we're not the same, flags being waived

tender shard
#

yeah like the sound you get when you get a bluescreen while some audio is playing

#

that's probably how most trap songs got created

echo basalt
#

just something fast

tender shard
#

oliver switches between win10 and win11 more often than I change my bedsheet. and I change those twice a week

tender shard
#

PluginManager#callEvent

hazy parrot
#

Thanks Alex 👍

tender shard
#

np

#

it's quite a dirty solution but there is no better way

twin venture
rotund ravine
hazy parrot
tender shard
#

Well ok its a tiny bit misleading

#

It says it returns what’s displayed in the server list

echo basalt
#

imma keep writing lyrics

#

thinking boom-bap

tender shard
#

LeGuernic

tender shard
#

"small additions"
>200 files changed

echo basalt
#

I could feel it was a mac picture but it took me way too long to find out why

tender shard
#

btw here's how I'd properly do the "effective motd" stuff:

public final class ServerUtils {

    private static final InetAddress LOCALHOST;

    static {
        InetAddress tmpLocalhost;
        try {
            tmpLocalhost = InetAddress.getLocalHost();
        } catch (final UnknownHostException ignored) {
            tmpLocalhost = null;
        }
        LOCALHOST = tmpLocalhost;
    }

    /**
     * Gets the effective MOTD (after plugins might have changed it)
     * 
     * @return The effective MOTD
     */
    public static String getEffectiveMotd() {
        if(LOCALHOST == null) {
            return Bukkit.getMotd();
        }
        ServerListPingEvent event = new ServerListPingEvent(LOCALHOST.getHostName(), LOCALHOST, Bukkit.getMotd(), Bukkit.getOnlinePlayers().size(), Bukkit.getMaxPlayers());
        Bukkit.getPluginManager().callEvent(event);
        return event.getMotd();
    }
onyx fjord
#

and buttons on left

echo basalt
#

I was like

#

"that font is too rounded off"

tender shard
#

client side decorations? wdym lol

pseudo hazel
#

and traffic light buttons

echo basalt
#

and then I zoomed off

#

and saw the traffic light buttons

onyx fjord
remote swallow
onyx fjord
#

but window decorations

tender shard
#

no clue what you mean with "client"

pseudo hazel
#

well I get my decorations from the server

echo basalt
#

if you look carefully

remote swallow
#

whats the io domain

echo basalt
#

the mac font is much more rounded

echo basalt
remote swallow
#

you dont have the money

echo basalt
#

jokes on you

pseudo hazel
analog thicket
#

I CANNOT get this shit centered DAMN

echo basalt
#

I can actually afford illusion.dev now

#

it's just that my depressed ass doesn't feel like paying for anything

#

I usually spend 300$ per week on my basic expenses but this week I spent a whole like 80$

#

and I'm getting paid tomorrow

remote swallow
#

did that guy sell it

echo basalt
#

still available

#

it was a private offer

tardy delta
#

300$ a week lol

echo basalt
#

this week I was just like

tardy delta
#

seems like a lot to me

echo basalt
#

"fuck it a protein shake for lunch is more than enough"

#

and paid a whole 1$

#

I was also gonna order food last night but spent 3 hours staring at my choices and just didn't pick anything

quasi raptor
#

why spigot why

quasi raptor
#

125 a month

echo basalt
#

I've probably burned like 200$ total in minecraft merch

#

but them minecraft PJs look nice so I don't mind

quasi raptor
#

no i dont need merch

#

oh sorry

echo basalt
#

I haven't played the game for fun for the past like 4 years

quasi raptor
#

i missunderstanded

tardy delta
#

me trying to figure out packets that dont exist

echo basalt
quasi raptor
echo basalt
#

Oh damn

tardy delta
#

people told me to ask it to the forge/fabric users

echo basalt
#

today is one of those once-in-a-year days where I think about my life choices and why the fuck I decided to make minecraft plugins for a living instead of actually socializing like other high schoolers

tardy delta
#

socializing 💀

lost matrix
echo basalt
#

It's not even fun anymore

#

I spend half my days making microsoft word features so I can render a text box in a map, that goes into an imaginary item-frame that only the player can see

#

and wondering if I can use the image hash in a way to not send duplicate packets

lost matrix
#

oof

#

Sounds like fun to me

tardy delta
#

damn the fabric tutorial actually helps me to implement recipes in minestom 💀

echo basalt
#

I made my own textbox algo that automatically wraps around

#

and if it can't wrp around, it scales the text down just a bit

#

I also tried implementing dithering but it tanked performance skullWazowski

quasi raptor
#

is this even spigot related 💀

echo basalt
#

uhh

#

it uses like 2 lines of NMS

#

so sure

quasi raptor
#

lets go

echo basalt
#

Actually what if I convert the image data to base64 and keep track of what hashes each player has 🤔

#

Associate each hash to an ID

tender shard
pseudo hazel
#

yeah I do give apple that

#

it is pleasant to look at

tender shard
#

it looks especially awesome in real life, I got 3456x2234 pixels on just 16 inches

pseudo hazel
#

lmao

tender shard
#

on screenshots it might look weird in such a high resolution

pseudo hazel
#

thats like eye resolution

#

your screenshot looks fine

#

like not 100% sharp but what would you expect from such a drastic resize

tender shard
#

yeah on 1920x1080 it'll look blurry

twin venture
#

hi , so after few tries i got something ,
xd
just testing with packets xd

tender shard
#

You never set object 1

brave sparrow
#

Looks like this.l is null

#

Lol

tender shard
#

Only 0, 2 and 3

#

ProtocolLib is so annoying, id just get rid of it

twin venture
#

what will be the object 1 ?

tender shard
#

Idk

twin venture
#

great

tender shard
#

Welcome to ProtocolLib

twin venture
#

thanks

tender shard
#

Youd see instantly what it is if youd use the actual nms packet 😄

heavy mural
#

Hmmm I was trying to find a solution for armorstands (as passenger) falling off players when they submerge in water. I found this in an old post (https://www.spigotmc.org/threads/armorstands-used-for-permanently-visible-mob-name-tags-fall-off-in-water.109947/) with the same issue but don't really know what they mean by it. Do you guys happen to know?
Anyways, I played around with it a bit and it appears that you can workaround the dismounting by adding a buffer entity in between to prevent the interaction of "two living entities will separate if they enter water".

twin venture
#

ok i fixed 1 bug xd

#

noice less errors

#

[01:28:33 ERROR]: java.lang.NullPointerException: Cannot invoke "net.minecraft.server.v1_8_R3.DataWatcher.a(net.minecraft.server.v1_8_R3.PacketDataSerializer)" because "this.l" is null