#help-development

1 messages · Page 302 of 1

buoyant viper
dawn mirage
#

I figured it out, I had an old api-version in my plugin.yml

hearty latch
#

i made a plugin i setup config and other class with no error but when i start server and see my plugin it load but then i can't see other folder for that plugin pls help

rotund ravine
#

?askgoodquestion

undone axleBOT
rotund ravine
#

?paste

undone axleBOT
hearty latch
remote swallow
#

give us code

#

give us what is meant to hapen

hearty latch
#

o

remote swallow
#

?paste it

undone axleBOT
rotund ravine
#

😬

hearty latch
remote swallow
#

you would need saveDefaultCOnfig() on enable and you need di if you want the config in other locations

hearty latch
#

where i put "saveDefaultCOnfig()"

remote swallow
#

onEnable

hearty latch
#

public void onEnable(saveDefaultCOnfig()) {

#

?

remote swallow
#

you put it in the method

#

?learnjava

undone axleBOT
hearty latch
remote swallow
#

public void onEnable() {
    saveDefaultConfig()
}
#

?learnjava!

undone axleBOT
severe lava
#

hi

#

i want a help

remote swallow
#

its quite obviously you on an alt tbh, and your config isnt in the resources folder or you arent building correctly

severe lava
#

but i built

sterile breach
#

Hi, its possible to, when a command is runed with an external plugin, change plauer amont in ping' protocole ? (When player /vanish ) i want remove 1 in server list

remote swallow
undone axleBOT
sterile breach
severe lava
rotund ravine
#

@sterile breach It’s methods in the player interface

rotund ravine
remote swallow
severe lava
sterile breach
remote swallow
severe lava
#

any solution to fix ?

rotund ravine
#

?learnjava!

undone axleBOT
rotund ravine
#

@severe lava @hearty latch

remote swallow
#

also you dont have a config there

severe lava
#

i got it

wet breach
#

show me it

remote swallow
#

i found a way around that lol

#

i just changed the format of the config

#

and it worked

wet breach
#

still curious lol

remote swallow
#

one sec

#

all on these

wet breach
#

alright so I looked at it, and I compared it to mine

#

only thing I can assume is that there is something wrong with how you are using/setting the ConfigurationSection object

#

in all of my projections, I indirectly use that object and not on its own lol

#

glad you got it working though

remote swallow
#

okay quick question

#

ive got a config serializable class, is there a way to make it not write the ==: ItemStack when it saves

wet breach
#

ok after I had my smoke

#

I figured out your problem

#

calling getConfigurationSection() on the configurationsection object means you are trying to get another ConfigurationSection below it

remote swallow
#

wouldnt that be the section inside it

wet breach
#

==: means that is an object

remote swallow
#

ah

wet breach
#

you can have multiple objects serialized and that is how to separate them

wet breach
#

items, is easy to set because it is at the top

#

but then you would have to specify the path to the next config section, which isn't just "Enchants"
it would be items.elytra.Enchants

remote swallow
#

i thought configSection("sectio") would get the section inside of that section

wet breach
#

nope

#

I can show you an example

rigid schooner
#

i need help

wet breach
wet breach
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!

wet breach
#

as you can see from the code I linked @remote swallow even though I loop over 2 config sections, I still have to provide the path to what is the Config Section

#

however the handy thing though is if you started with a ConfigSection object of items, pretty sure you could probably omit items for the starting of the path

#

not entirely sure

remote swallow
#

well yeah because thats on a get config not a configuration section

wet breach
#

but yeah that is the only thing I could figure

#

the path not being quite right

remote swallow
#

wouldnt the path inherit

#

been as its configSection.getConfigSection

rigid schooner
#

i need to wipe the world each time the server starts (or stop), with that i mean remove all of the blocks and entity

my plugin generates map for players to play in and, when each of them quit, saves everything into file (like one chunk assigned to one player)

after each session there are some unused chunks that i don't need and i was thinking instead of clearing each one separately maybe there is a way to wipe the entire map

wet breach
#

well if it did as I stated that would mean you could omit Items from the starting of the path in the next section object

#

but would still need to add elytra.Enchants

remote swallow
remote swallow
rigid schooner
#

is there some easy method that overwrite world folder (but not playerdata) ?

remote swallow
#

probably not

rigid schooner
remote swallow
#

ah, you would probably need to have the world saved somewhere else that will never change and just replace the region files or whichever

wet breach
rigid schooner
#

i could delete the world, but then when it starts it gets generated again by minecraft vanilla

#

would work if we could add something that always generates empty void world (possibile with a different biome than void)

wet breach
#

you can define the generation of chunks if you wanted

tall citrus
#

Im doing a simple /setspawn & /spawn plugin, when I set the spawn point, I have an error, how can i paste it?

remote swallow
#

?paste

undone axleBOT
tall citrus
remote swallow
#

wahts line 33 of setspawn.java

wet breach
tall citrus
#

?paste

undone axleBOT
rigid schooner
#

can you indicate me doc to these methods?

remote swallow
#

whats Files()

tall citrus
#

?paste

undone axleBOT
wet breach
wet breach
#

when I did such things I used bash to do it

#

but that isn't as straight forward to do 😛

rigid schooner
#

which folder should i overwrite? i dont want to touch playerdata

wet breach
#

playerdata has its own directory

rigid schooner
rigid schooner
wet breach
#

if you use bash the hard part is detecting when the server has stopped lol

#

yes

remote swallow
rigid schooner
wet breach
#

most likely

rigid schooner
#

wdym most likely

remote swallow
#

make a method in your main class to get the spawn from the Files instance you would probably be creating their

native gale
#

Hello! What are implications of this?

remote swallow
#

you would need to pass the yaml config through from main to get it from that instance of the clas

wet breach
#

so if you wanted to invoke bash from onDisable() yeah you can probably do that

rigid schooner
#

but you're not 100% sure

#

also, do region folder contains entities? i might need to clear those too

wet breach
#

nope because it depends on your ability to be able to do such things, also if the server takes too long to shutdown it will force shutdown

wet breach
rigid schooner
rigid schooner
tall citrus
#

IT WORKS @remote swallow IM GONNA SCK YOUR nevermind

wet breach
#

oh that is right, I think entities get their own directory now

pseudo hazel
#

btw if you keep removing all chunks, how can players ever rejoin and not fall into the void

remote swallow
#

the chunk would be regernated or be re-existing before they join

rigid schooner
#

thank you, last thing i need to make sure. will the server support this or will it force shutdown as you said?

wet breach
#

that is something you will have to test

#

not everything can always be guaranteed lol

rigid schooner
#

it'll be like 100x9x100 or smt close

wet breach
#

if I were you, I would probably from the onDisable invoke a cron job that waits a few seconds for the server to stop

#

does its thing, and then invokes the script to start the server again

#

this way, you don't have something that might prevent the server from shutting down

rigid schooner
#

hmm

wet breach
rigid schooner
#

i was hoping i could just make the world generate void each startup

pseudo hazel
#

surely you can do that

rigid schooner
pseudo hazel
#

create a new void world and move the playerdata over

#

and then remove the old world

wet breach
#

there is multiple ways to do this

rigid schooner
wet breach
#

and no single way that is the best

pseudo hazel
#

too much why

rigid schooner
#

playerdata folder gets bigger for each player and never clears

wet breach
#

but that is what you wanted

#

you didn't want to clear the playerdata stuff

rigid schooner
#

yes that's true but maybe it gets too big to be moved, regions instead get cleared each time

#

isn't that something that might cause problems?

wet breach
#

it will never be too big to move and besides the two things I described doesn't move that directory anyways

#

we are just trying to clear the world files leaving everything else in place and clearing entities if you want those cleared and lighting since that has its own directory. But everything in the region directory

#

and then either re-generating your world via code or just copy world files back in

rigid schooner
#

lighting what is that

#

re-generating your world via code sounds good

#

is that possible?

#

like, can a plugin modify the world generation?

wet breach
#

it contains data on light level stuff for blocks and the world

wet breach
#

just it isn't exactly easy

rigid schooner
#

because it's not java

wet breach
#

it is

rigid schooner
#

ok i'll do that

#

summon a custom world each startup

wet breach
#

good luck 🙂

rigid schooner
#

wait

#

how do i do it

wet breach
#

depends on how much control over the generation you need

rigid schooner
#

would be super cool if EventHandler onMapGeneration event

#

we had something like that

wet breach
#

there is a worldload event

rigid schooner
#

i'm looking into that

wet breach
#

but I told you the easy ways to do this, going the route of tapping into world generation is one of the hard ways or can be

rigid schooner
#

is it?

#

i need very basic starting world

wet breach
#

well, just pick a way you want to do it, and do that

rigid schooner
#

you suggest playing with the folders instead of world gen

wet breach
#

yep

rigid schooner
#

alright thank you so much

wet breach
#

because you don't need world gen for what you are wanting to accomplish although you could use it

#

if you were wanting custom chunks being generated on the fly

#

then you would need world gen for that lol

rigid schooner
#

that sounds very cool but i agree its way too much for what i need

rigid schooner
pseudo hazel
#

but so what do you actually want to do, does the world need to be completely empty or does it need to be filled with a block

#

because that limits your options

rigid schooner
#

both are good options to me

pseudo hazel
rigid schooner
#

make sense

#

ty all

acoustic widget
#

Hello, is there any way to prevent to being disconnected from the server when using debug with intelij ? debug works very well, but if I'm to slow and don't play next steps, I'm disconnected from the server

native gale
#

Only if you have a way to break the execution of the client as well

acoustic widget
#

ok ty

unkempt peak
#

Hey does anyone know how I could increase the distance a Dolphin starts the SwimWithPlayerGoal? I'm trying to make so the doplhin follows the player and can give them dolphin's grace from a longer distance

tall citrus
#

Hi! i created my first plugin, can i send it here?

rotund ravine
tall citrus
rotund ravine
tall citrus
#

all the src?

#

like the suorce code?

rotund ravine
#

Yes, we do not care about plugins, but if you want someone to point obvious errors in your source you can do that.

soft viper
#

I am trying to connect player to another server in bungeecord

#

Player player = (Player) sender;
ByteArrayDataOutput out = ByteStreams.newDataOutput();
out.writeUTF("Connect");
out.writeUTF("main");
player.sendPluginMessage(CommonVariables.plugin, "bungeecord:main", out.toByteArray());

#

What am i doing wrong?

rotund ravine
#

Many things

soft viper
#

Its guide for bungee plugin

#

But im trying to do it with spigot and plugin messages

rotund ravine
#

?pluginmsg

#

?messaging

#

?pluginmessaging

wet breach
#

?message

#

?channels

#

?messagechannels

#

guess we don't have a command for it

soft viper
wet breach
#

no it isn't

rotund ravine
#

You didn’t try did you?

soft viper
#

I cant register channel named "BungeeCord"

rotund ravine
#

Retry and show me how you are doing it

soft viper
#

Ok

#

Oh, sorry, i tried to use channel like "BungeeCord:main" and got an exception like "Channel must be lowercase and must contain ":" in its name", but "BungeeCord" works fine

#

Player player = (Player) sender;
ByteArrayDataOutput out = ByteStreams.newDataOutput();
out.writeUTF("Connect");
out.writeUTF("main");
player.sendPluginMessage(CommonVariables.plugin, "BungeeCord", out.toByteArray());

#

But i still cant connect someone

soft viper
wet breach
#

?paste

undone axleBOT
humble tulip
wet breach
#

in which case you can stop or rather pause at certain points

#

which this would cause any client to disconnect

humble tulip
#

Ya ik

#

I wonder if i can write an intellij plugin to do this

humble tulip
#

Stop netty timeout and send keepalives to the player when debugger is on

wet breach
#

you would need to hook into the degugger

#

since it isn't intellij itself doing it

humble tulip
#

Yep ik

#

It's a connection timeout

wet breach
#

well obviously lol but it isn't like the server running in the debugger could do anything since execution of everything is paused lol

acoustic widget
humble tulip
#

Which is why I'm wondering if an intellij plugin can be written to solve this

tardy delta
#

with an iterator you can?

wet breach
#

you can

tardy delta
#

ik i can call clear but wanna try smth

wet breach
#

iterator on the other hand you can't remove while iterating at the same time

#

basically it comes down to this. You can't read as you remove lol

#

for iterator

tardy delta
#

ah

wet breach
#

why do you need an interface to just obtain plugin instance?

#

second the way you are registering your command I guess it works, just never seen it done this way.

#

I am not entirely sure what the issue is, except the way you are obtaining a plugin instance

#

?di

undone axleBOT
soft viper
hybrid spoke
tardy delta
#

ah remove doesnt switch to next

#

still illegalstate

hybrid spoke
#

yeah no shit sherlock

rotund ravine
#

Switch them

hybrid spoke
#

the other way around

rotund ravine
#

Goes from top to buttom remember

tardy delta
#

ah it stands before thr element

#

i also use that stuff for college

hybrid spoke
#

the javadoc says it all

sullen marlin
#

Is the plugin enabling correctly? The command in plugin.yml?

#

Code looks more or less ok

rotund ravine
#

Yes

sullen marlin
#

Yes

soft viper
#

Yes, everything is ok in plugin.yml

rotund ravine
#

Show us

#

?paste

undone axleBOT
soft viper
rotund ravine
#

What does the console log when enabæing the plugin?

soft viper
#

Nothing interesting, no errors

rotund ravine
#

Show us

#

?paste

undone axleBOT
soft viper
#

Ill check it again

#

Give me a minute

#

just loading and enabling

humble tulip
#

Paste your entire latest.log

quaint mantle
#

I tried scheduling the value to return 100 ms later, hell even 1 second later but it's still no use.

        try {
            return executor.schedule(() -> serverName, 100, TimeUnit.MILLISECONDS).get();
        } catch (InterruptedException | ExecutionException e) {
            e.printStackTrace();
            return null;
        }
soft viper
humble tulip
#

So how do you upload the plugin?

#

Use a callback

humble tulip
#

Create a Callback<String> and store it in a Map<UUID, Callback<String>> map

tardy delta
#

or cf

#

like is player::sendPluginMessage even blocking?

humble tulip
#

Not sure

#

Maybe not

tardy delta
humble tulip
#

It's the same as all other packet sending no?

tardy delta
#

ye believe so

#

ive never used it so didnt really know

humble tulip
#

Cba

quaint mantle
humble tulip
#

To use them rly

#

@quaint mantle return a new completable future

#

Store it in a map

#

When bungee replies

#

See if the player has a completeable future in the map

#

And call complete

quaint mantle
#

Ok

tardy delta
#

looks like async issues

soft viper
#

Ok, thanks for all, now it works fine

tardy delta
#

why storing cfs in a map? cant you just add handlers to them?

humble tulip
#

Wdym handlers?

tardy delta
#

::thenAccept

humble tulip
#

Not for plugin messages

#

You can send a plugin message

#

And then you need to wait until bumgee responds

#

When bungee responds, spigot calls a method telling you there's an incoming plugin msg

tardy delta
#

ah

hushed spindle
#

does anyone happen to know if player entities on an offline server aren't by spigot considered "Players"

#

my custom damage system seems to be having issues specifically on cracked servers so im wondering what technical differences there are between offline and online

wet breach
#

we don't support offline mode servers

#

not sure what the deal is with people coming here lately asking for help to pirate something

eternal oxide
#

The only difference between online and offline servers is the players UUID

hushed spindle
#

i dont know either man but a quarter of my users use offline mode and they're all having the same issue

wet breach
#

sounds like they should buy mc

#

and for others to stop supporting pirating

#

but hey that is your choice, doesn't mean spigot supports it though

hushed spindle
#

ok

humble tulip
#

@hushed spindle player entities are co sidered players

#

All my test servers are offline mode so i can join with multiple accs

#

And my plugins work

quaint mantle
#

hi

#
public class OnPlayerJoin implements Listener {

    @EventHandler
    public void onPlayerJoinEvent (PlayerJoinEvent event) {
        Player player = event.getPlayer();

        PlayerDataStore playerData = new PlayerDataStore(player);
    }
}
#
    public PlayerDataStore (Player player) {
        this.player = player;
        this.status = IDLE;
        this.game = NO_GAMES;

        this.data.put("AllowPVP", "false");

        if (!playerDataStores.containsKey(player)) {
            playerDataStores.put(player, this);
        }
    }```
hybrid spoke
#

hi

#
public class ChunkInvalidateListener implements Listener {

    @EventHandler
    public void onBurn(BlockBurnEvent event) {
        handleEvent(event.getBlock());
    }
vale ember
#

for how many ticks should i make a player invulnerable so that they won't receive any damage from lighting right after striking it?

quaint mantle
#
    public static PlayerDataStore getPlayerDataStore (Player player) throws Exception {
        if (!playerDataStores.containsKey(player)) {
            throw new Exception("Player not found in store.");
        }
        else {
            return playerDataStores.get(player);
        }
    }```
hybrid spoke
#

if so you can just do the effect

quaint mantle
#

when i do getPlayerDataStore(player);, it says there is no player with that player object.

hybrid spoke
#

or use the damage event to cancel it

vale ember
#

just World#strikeLightining

hybrid spoke
#

which doesnt do any damage

vale ember
#

i want it to damage other players

#

i wanna make only 1 player immune

#

i am canceling the event

quaint mantle
#

even though when i joined the game, it registered the player object.

vale ember
#

i just wanna know for how long should i do it cuz i don't wanna make that player immune from ALL lightinings

pseudo hazel
#

probably like 1 tick

vale ember
#

1 ticks doesn't work

quaint mantle
#
private static HashMap<Player, PlayerDataStore> playerDataStores = new HashMap<Player, PlayerDataStore>();```
#

i am storing player data in a hashmap.

quaint mantle
#

how do i store playerData? Can i just store the Player object?

#

or does it not work when i query for the object later?

hybrid spoke
#

well you could

#

but it will be null once the player left

#

why

quaint mantle
vale ember
quaint mantle
#

it just dies.

#

does the player object become null when the player dies?

pseudo hazel
#

probably

hybrid spoke
#

i am guessing he needs it while the player is online, so storing the player is fine

quaint mantle
#

i have this code right here.

#

ArrayList takes linear time to search.

#

same with LinkedList.

pseudo hazel
#

a map to search for keys too

quaint mantle
#

what do you mean?

pseudo hazel
#

or a set

quaint mantle
#

HashMap is O(1) time almost.

#

amortized at most.

wet breach
#

it is up to a point

pseudo hazel
#

yes if you are searching a value with a key

hybrid spoke
#

why not?

wet breach
#

eventually as you put more objects into the map it is impossible to keep that O(1) time lol

pseudo hazel
#

no it isnt

#

its still O(1)

hybrid spoke
#

not if the hashes collide

wet breach
#

no

quaint mantle
#

it is amortized probably.

wet breach
#

At a certain point if you store too many objects in a HashMap it starts to lose its time advantage

hybrid spoke
#

the worst case is O(n)

wet breach
#

because you can't have infinite time

quaint mantle
#

i know.

pseudo hazel
#

well yes but time notation doesnt day anything about the actual time it takes iirc

quaint mantle
#

to maintain an amortized O(1) time like Dynamic Arrays?

wet breach
#

its just simply impossible

quaint mantle
#

hm ok.

#

i am not storing a lot of data anyway.

#

unless my server really becomes popular if i can manage to actually launch this server and minigame i have been working on.

#

in that case i can use an AVL Tree.

#

if i find too much lag.

wet breach
#

sure, and its fine for small data sets. I was only pointing out to whoever was saying it was O(1) and I was merely adding the caveat only up to a certain point that it is lol

quaint mantle
#

hm.

pseudo hazel
#

anyways, storing players as uuid is more space efficient in like most cases

quaint mantle
#

okay, i will just use the UUID.

maiden thicket
#

avl tree

#

war flashbacks

#

aka last quarter flashbacks

wet breach
quaint mantle
#

it is a balanced binary search tree.

pseudo hazel
#

well yeah i guess

maiden thicket
#

the only thing i remember are BST, quicksort, a bit of hashmaps, queues, stacks, BFS and DFS from my dsa class

quaint mantle
#

AVL Tree is one of possibly many balanced binary search trees.

maiden thicket
#

loll

pseudo hazel
#

i suppose in runtime it doesnt really matter

#

unless you are like copying player objects left and right

wet breach
#

storing a string in a map could take up more space then an object

#

mainly because that is the exception to the rule of object reference

pseudo hazel
#

well i was talking about uuid

#

but i get your point

humble tulip
quaint mantle
#

time to refactor my code to use player UUIDs now.

humble tulip
#

After cancel damage

#

Set player vulnerable

quaint mantle
#

just cancel the lightning event?

pseudo hazel
#

no cancel entity damage event

quaint mantle
#

ah that.

humble tulip
#

@vale ember lemme see how you're tagging the player to make them invulnerable

pseudo hazel
#

then you would just need a way to determine the origin of the bolt to see which players to cancel

humble tulip
#

Are you adding them to a set or something?

quaint mantle
#

you can get the damager and check if its lightning.

#

probably.

hearty latch
#

how i solve ?

dry yacht
# hearty latch how i solve ?

Not at all, you just ignore it, as they still didn't provide us with an alternative API for the one they had to mark as deprecated.

hearty latch
#

ok

chrome beacon
#

It's deperacted because the client decides if it's on the ground or not

dry yacht
#

Still, the local state machine has to also decide this. Otherwise, you can easily bypass the anti-fly ticker, for example. Deprecating this interface is plain stupidity.

chrome beacon
#

You can easily bypass the anti-fly

hearty latch
#

hmm yes]

dry yacht
#

If you spoof the one ground flag every now and then. But it's obvious that that's impossible if you know the coords of the player and the ground-level. How could you ever let the client decide on such an important flag, that's insanity.

hearty latch
#

my anticheat have many feature

quaint mantle
#

can i create more worlds in spigot?

chrome beacon
#

Yes

quaint mantle
#

like another overworld dimension?

chrome beacon
#

Yes

#

Use the WorldCreator

quaint mantle
#

does each world run in its own thread?

#

or is there a way to run each world in its own thread?

chrome beacon
#

Depends on the version

quaint mantle
#

1.19.2

chrome beacon
#

Then yes some things are handled on their own thread

quaint mantle
#

i am actually running the spigot plugin on a paper server as well.

quaint mantle
#

like removing an entire 100x100x100 cube of blocks?

chrome beacon
wet breach
#

even if a single world has its own thread, it doesn't mean that thread can't be lagged

quaint mantle
#

i know that.

floral drum
#

Blocks in a world are not multi-threaded and can only be modified by the server thread

#

if I remember correctly

wet breach
#

that is correct

quaint mantle
#

oh.

wet breach
#

because at some point it still has to synchronize

quaint mantle
#

that might be an issue.

floral drum
#

What are you trying to do exactly?

quaint mantle
#

its a minigame.

floral drum
#

Ah

quaint mantle
#

where a lot of blocks a removed and put back programmatically.

chrome beacon
#

?workdistro

quaint mantle
#

and if there a lot of instances of the minigame running at the same time, it could be laggy.

quaint mantle
chrome beacon
#

almost

wet breach
#

sounds like you need to have a custom server implementation

quaint mantle
#

a task scheduler, yeah.

chrome beacon
#

Minestom uwu

quaint mantle
#

even coding a small minigame needs so much code.

chrome beacon
#

Probably too advanced for you though

quaint mantle
#

no, it is not.

warm mica
chrome beacon
#

If it gets laggy get more servers and link them with Bungeecord

warm mica
#

The hashCode of the player is equal to the hashCode of the UUID

#

and the equals method is basically just checking the UUID as well

chrome beacon
#

Just to be safe use a weak map

tardy delta
#

of Player?

warm mica
#

Meaning that the Map treats it basically the same as an UUID. The only problem may only occur with it not being flushed properly and thus causing memory leaks

wet breach
#

UUID is independent of the player object

sage dragon
#

If I set the custom name of a mob, but set persistent to false, will it despawn like a non-named mob?

quaint mantle
floral drum
#

how did it go?

quaint mantle
#

way more work to program.

warm mica
quaint mantle
#

anyway, tell me more about bungeecord, how does it work?

chrome beacon
warm mica
#

Otherwise it'd be better to just keep the player reference itself, especially if you plan to work with it afterwards as well

quaint mantle
chrome beacon
#

So then there's no need to automate it

floral drum
#

making a multi-instanced system for an island thing is so cool imo

chrome beacon
#

So not much code is needed

#

if any

hearty latch
#

what heppning

quaint mantle
#

yeah, i should probably try to launch the server first.

#

making a minecraft server is so difficult.

hearty latch
#

error

chrome beacon
#

Can be spoofed

chrome beacon
floral drum
#

woo AABB

fluid river
#

ABAB

floral drum
#

isn’t it AABB? (Axis-Aligned Bounding Box)

chrome beacon
#

It is

fluid river
#

lol wat

fluid river
#

no context ABAB

floral drum
#

ABCABC

fluid river
#

EFG

floral drum
#

where’s D?

fluid river
#

you can get that D later

floral drum
#

oh my… 😻

#

age? lmao

fluid river
#

19

#

deanon

floral drum
#

thank god

opal juniper
floral drum
chrome beacon
#

People don't read docs anymore

opal juniper
#

I do

pseudo hazel
#

i got it linked on my desktop

chrome beacon
tardy delta
#

proud

floral drum
fluid river
#

politics

floral drum
#

meow

echo basalt
#

block em

fluid river
#

russian meow sound

#

мяу

fluid river
echo basalt
#

joe asked

fluid river
#

i wish joe mama well

tardy delta
#

joe biden

fluid river
#

joseph bistar

#

Joe Stalin

tardy flame
opal juniper
#

Hey i have that

tardy flame
#

Normal day

fluid river
chrome beacon
fluid river
chrome beacon
#

Any docs

fluid river
#

i read my certificate of adoption today

chrome beacon
#

Just like anything else in Java

#

Just make a bunch of classes

#

and then use the maven shade plugin or shadow

last bolt
#

Guys, how in god's name do you load a list of ConfigurationSerializable objects out of a config yaml?

chrome beacon
#

to put it in your jar and use the classes like normal

#

Yeah

#

Yes

#

And then use the maven shade plugin to include in your other projects jar

#

Make sure to relocate

#

You need to shade

#

Setting scope to compile won't shade without the maven shade plugin

last bolt
#

I'm trying to load lists of objects from my config.yml, which looks something like this: https://paste.md-5.net/zeridulivo.makefile
objectA and objectB are both registered ConfigurationSerializable.
If I try to 'getConfigurationSection' on either of them I get null.
What is the correct way to load lists of objects like this?

hybrid spoke
opal juniper
#

not pathetic docs 🤓

#

my docs are amazing though

#

Gitbook is pretty

hybrid spoke
#

why dont you do that for pathetic

opal juniper
#

cause it takes ages!!

hybrid spoke
#

rather letting me do it and complain about my english

hybrid spoke
opal juniper
#

i get easily distracted. had to go to a coffee shop to get some work done yesterday

chrome beacon
#

Yeah

fluid river
last bolt
#

Which I can't cast to my type.

tardy delta
#

doesnt it return a List<?>?

#

or Object whatever

last bolt
#

The IDE says it returns a list of Objects but if I run it, I get a "java.util.LinkedHashMap cannot be cast to class.MyClass" error

tardy delta
#

cast it to List<MyClass>?

#

(List<MyClass>) config.getList(whatever)

hybrid spoke
tardy delta
#

if its configuration serializable ig that shouldnt be a problem

opal juniper
#

generics are goofy

hybrid spoke
#

generics are beautiful

last bolt
#

I hate yaml.

hybrid spoke
#

generify everything

tardy delta
#

typedef struct<T>

#

fuck

#

template

fluid river
#

cpp guy comes in

tardy delta
#

cpp moment

glossy venture
#

whats the most compact and fast string storage format

tardy delta
#

compact is probably the opposite of fast

glossy venture
#

like format to store objects as a string

tardy delta
#

compact -> byte array

hybrid spoke
#

json probably?

glossy venture
#

aight

hybrid spoke
#

otherwise base64

tardy delta
#

binary?

glossy venture
#

have to do that to use redis

last bolt
#

Yeah, for (MyClass myClass : (List<MyClass>) config.getList("myObjects")) {} doesn't work.

tardy delta
#

why not

last bolt
#

class java.util.LinkedHashMap cannot be cast to class MyClass

chrome beacon
#

That error doesn't match the code though

tardy delta
#

youre casting it to a List<MyClass>

pseudo hazel
#

how did you save the file

glossy venture
#

you need to make sure yaml knows that its your custom object

last bolt
#

How?

pseudo hazel
#

how did you store the object in the first place?

last bolt
#

I wrote it in config.yaml and then verified the yaml.

glossy venture
# last bolt How?

have MyClass implement ConfigurationSerializable, implement the serialization and just store the objects directly

hybrid spoke
#

isnt there a method where you can pass in the type as a parameter

glossy venture
#

for manual shit add ==: my.package.MyClass or use a method which automatically parses the yaml objects into MyClass

tardy delta
#

anyone who has used this stuff?

last bolt
tardy delta
#

ofc the console says that?

bright aurora
hybrid spoke
#

thats.. normal?

pseudo hazel
#

what would you like the console to say xD

chrome beacon
#

ngl that code looks copy pasted

hybrid spoke
#

did you had fun hitting your enter button or what happened there

tardy delta
#

doing a new bukkitrunnable in a run method 💀

echo basalt
#

man just signed up for copilot and spammed TAB

bright aurora
last bolt
tardy delta
#

copilot writes even better stuff

echo basalt
#

it learns from your code

#

if you only write garbage

hybrid spoke
#

understandable if he has one of those

echo basalt
#

I gotta get myself one of those

#

I like bashing empty lines a lot

#

I swear I'm not the only one making 25 empty lines

undone axleBOT
fluid river
echo basalt
#

you like empty lines?

fluid river
#

y?

tardy delta
#

i dont

#

i only like comments

fluid river
#

line between class declaration and first method/field in class

echo basalt
#

yes

tardy delta
#

ew

fluid river
#

line between last field and first method

echo basalt
#

line between variable assignment and if checks

#

line between field and constructor

#

line between constructor and method

fluid river
#

lines between methods

echo basalt
#

ofc

fluid river
#

lines between imports and class decl

echo basalt
#

line between groups of variables

#

so I get variables from an object

#

line

fluid river
#

and ofc line between imports and package

echo basalt
#

if checks

#

line

#

assign new varabies

#

line

fluid river
#

never had lines between ifs and what's inside/after

hybrid spoke
#

if the if is > 3 lines, there is a space between the header and the content

#

just like with everything else

fluid river
echo basalt
#

yeah no

hybrid spoke
#

space between the method header and the if

#

and between the if and the switch

fluid river
#

never had this rly

echo basalt
#

here's a solid example with comments

hybrid spoke
#

google codestyle sucks

hybrid spoke
echo basalt
#

I follow google style but with line wrapping set at 160

echo basalt
hybrid spoke
#

also i would probably put bytes and its usecase together

#

just like the random and characters

echo basalt
#

well

hybrid spoke
#

well the characters could be a constant

echo basalt
#

true

#
  • value from function

  • assignment

  • function

  • assignment

  • loop

  • return

hybrid spoke
#

and by that let alone random and put bytes and chars together

echo basalt
#

I don't like to mix functions with regular assignment

glossy venture
#

i just put newline between shit when i think it does something else

echo basalt
#

yeah that

tardy delta
echo basalt
#

love those

#

usually meaningless

#

except for that one time that half your IDE breaks

tardy delta
#

visualvm

#

docs are stupid

#

i got a vm but idk how to run that shit

warm spire
#

I am trying to make a lifesteal system could anyone tell me if the code below is correct?

package me.redstoneroxxstar.lifestealplugin.Events;

import org.bukkit.ChatColor;
import org.bukkit.entity.Player;
import org.bukkit.event.EventHandler;
import org.bukkit.event.Listener;
import org.bukkit.event.entity.PlayerDeathEvent;

public class PlayerKill implements Listener {

    @EventHandler
    public void onKill(PlayerDeathEvent e){
        Player victim = (Player) e.getEntity();
        Player killer = (Player) e.getEntity().getKiller();
        victim.setMaxHealth(victim.getMaxHealth()-1);
        killer.setMaxHealth(killer.getMaxHealth()+1);
    }
}
tardy delta
#

youre assuming the killer is a player

echo basalt
#

also ew naming events as e

vale ember
#

it'll throw ClassCastException if player dies with other cause

#

also Player::setMaxHealth is deprecated, you should use attribute modifiers instead

tardy delta
#

bruh what

vale ember
#

also why don't use victim instead of e.getEntity() in killer's assignment

tardy delta
#

im really wondering what this is

#

well apart from the errors, it seems to work

undone spindle
#

is it possible to drag items from inventory to custom gui?

#

cus inventory is locked

tardy delta
#

uh yes?

undone spindle
#

could you give me a refrence or something pls😅

tardy delta
#

wdym moving items from your inv to a opened chest or smth?

quaint mantle
#

does MCP usually take forever on copying assets...

tardy delta
#

by code?

undone spindle
#

imagine i want to drag these to the fishing menu

#

with code yes

#

but i can't pick the items in inventory up they are locked

tardy delta
#

drag what to what

undone spindle
#

those enchantment books to the slots between the yellow and green glass

pseudo hazel
#

why are they locked

undone spindle
#

uhm tbh i don't know

#

i have not locked anything in code

tardy delta
#

cuz event.setCancelled(true)

pseudo hazel
#

are you cancelling events?

undone spindle
#

yes i have not done that

pseudo hazel
#

can you show the code for this ui?

#

i assume you also cant drag anyhing from the top menu down or out

undone spindle
#

tho i might have seen my mistake🤡

#

with a super random return cus i was getting an annoying error

grizzled oasis
#
import net.minecraft.nbt.NBTTagCompound;
import net.minecraft.nbt.NBTTagList;

Hi, im using 1.19.2 and in the minecraft class this are missing how i can use them?

rotund ravine
#

Why would you use them?

#

?pdc

tardy delta
grizzled oasis
rotund ravine
#

Using pdcs

#

It’s not that hard

grizzled oasis
# rotund ravine It’s not that hard

i can't use them because i copy the item with NMS, from 1.18.2 worked fine but not on 1.19.2

    public ItemBuilder removeCustomNBT(String key) {
        if (!this.is.hasItemMeta()) {
            ItemMeta meta = this.is.getItemMeta();
            this.is.setItemMeta(meta);
        }
        net.minecraft.world.item.ItemStack nmsitemstack = CraftItemStack.asNMSCopy(this.is.clone());
        NBTTagCompound tag = nmsitemstack.u();
        tag.r(key);
        nmsitemstack.c(tag);
        this.is = CraftItemStack.asBukkitCopy(nmsitemstack);
        return this;
    }
covert yacht
#

Hello, how can i build a wool of a specific color from its data value ?

I tried using Material.WOOL (WOOL cannot be resolved or is not a field) as a base but nothing seems to work 🤔

covert yacht
#

1.19.3

pseudo hazel
#

iirc they just have separate names like BLUE_WOOL

rotund ravine
#

Yes ^

#

Past 1.13 there is no longer any data values

covert yacht
#

I saw that but i was wondering if there was a way to build them manually as i have the color value but not the material itself

pseudo hazel
#

make a map

#

from datavalue to material

rotund ravine
#

Just do it the proper way

pseudo hazel
#

in my plugin i have a flexcolor enum that has a bunch of colored blocks that I can get by using the enum value

rotund ravine
pseudo hazel
#

well yes

tardy delta
rotund ravine
#

Datavalues are deprecated

pseudo hazel
#

thats what I was suggesting

hearty latch
#

evrything is working but when i run plugin and type a command it evrytime come this
any solution ?

onyx fjord
#

any gud gui libs? (paging and all that shit)
must be shaded, not a plugin
also the smaller the better

pseudo hazel
#

for me the "datavalues" are just enum constants

rotund ravine
#

Show me the enum class

pseudo hazel
#

not at my pc rn

onyx fjord
#

inventory framework?

hearty latch
onyx fjord
#

good idea to show entire class

#

?paste

undone axleBOT
rotund ravine
pseudo hazel
#

but its something like this BLUE("Blue", Material.BLUE_WOOL, Material.BLUE_BANNER, etc..)

#

for every color

rotund ravine
#

Then u already have the wool

pseudo hazel
#

yea i do

#

i was suggesting it for the guy that had the issue

hearty latch
rotund ravine
undone axleBOT
rotund ravine
#

Full class please

hearty latch
#

hmm

rotund ravine
onyx fjord
#

doesnt it just stop

#

at the return true

rotund ravine
#

Weææ

hearty latch
#

ops

rotund ravine
#

It only returns true if he has less than 2 args otherwise it breaks

hearty latch
warm dagger
#

hello i was trying me make commands and i am using 1.19.3

rotund ravine
warm dagger
undone axleBOT
rotund ravine
#

full error

warm dagger
#

the java code of the hunter

rotund ravine
warm dagger
#
name: Manhunt
version: '${project.version}'
main: io.github.codecraftplugin.manhunt.Main
api-version: 1.19
authors: [ CodeCraft ]
description: a manhunt plugin
commands:
  hunter:
    description: set a player as a hunter
rotund ravine
#

why are you running "plugin.getCommand("hunter").setExecutor(this);" in the commandexecutor too

fluid river
warm spire
#

I'm new to plugin development

fluid river
#

well, then go to ?jd-s

#

?jd-s

undone axleBOT
fluid river
#

type Event in search tab, and voila, you have 99 events listed

warm dagger
#

new Hunter()

#

but that does not work either

fluid river
#
getCommand("hunter").setExecutor(new Hunter());``` in main class
rotund ravine
#

He already does that

#

But he also does it in his class.

fluid river
#

disgisting

fluid river
warm dagger
#

so what do you think the error is

pseudo hazel
#

remove it from the hunter class and just do it in main

fluid river
rotund ravine
#

Do it in one place

fluid river
#

you might have some problems with lower/upper case

#

in your code or plugin.yml

rotund ravine
#

@fluid river he already posted everything please check instead of blindly giving advice haha

fluid river
#

too lazy

pseudo hazel
#

yikes

warm dagger
#

give me second let check if it is a server issue

#

how to check the version of the server

rotund ravine
pseudo hazel
#

maybe you just need to rebuild

warm dagger
#

seems like this server is a 1.19.2

#
[21:13:09] [Server thread/INFO]: This server is running CraftBukkit version 3636-Spigot-d90018e-941d7e9 (MC: 1.19.3) (Implementing API version 1.19.3-R0.1-SNAPSHOT)
[21:13:09] [Server thread/INFO]: You are 1 version(s) behind```
quaint mantle
#

?contribute (sending for myself)

pseudo hazel
#

then why is it running craftbukkit 1.19.3

#

still that shouldnt really matter

#

like i said have you tried rebuilding the plugin jar?

warm dagger
#

yeah

pseudo hazel
#

hmm

warm dagger
#

just figured it it was error with the plugin that was runing i think intellij was not able to remove the old one so it failled

pseudo hazel
#

oh

warm dagger
#

once stoping the server and doing it again fixed

pseudo hazel
#

nice

#

I usually just copy the files over instead of telling intellij to put them in the plugins folder automatically

pseudo hazel
#

why are you checking the command name in the execution

hearty latch
#

wttdym

pseudo hazel
#

line 35

#

or wait nvm

#

you arent using an executor

hearty latch
#

yes

pseudo hazel
#

can you try loggin like the command name it found

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.

pseudo hazel
#

like before the first line of the oncommand function

#

print the command.getname to check if its correct

soft saddle
#

Hewwo, there's a way to remove the Honey Block properties for mobs?

quaint mantle
#

so i made som changes to NMS and tried exporting using the package thing in maven as shown in screenshot, but it just gives me error "No Message"

warm dagger
#

hi so how to give player a permission

quaint mantle
#

hello, having some trouble setting up MythicMobs and ModelEngine resourcepack if anyone wants to help give it a go, i've been stuck on an issue for a couple days now. Can't seem to figure out the problem.

quaint mantle
#

Black / Purple textures is all i'm seeing for Custom Mobs.

#

texture pack problem

#

this is my resource pack

#

assets and pack.mcmeta

#

is it not able to find where the textures are or something?

#

for 1.19.3 ^

worn tundra
#

Did you apply the 1.19.3 texture pack fix?

#

With the atlases

quaint mantle
#

hm don't think so.

worn tundra
#

Watch this

quaint mantle
#

awesome i'll give it a go, thx guys.

#

so for ModelEngine do you create an atlases folder inside the modelengine resourcepack folder too?

#

to path ur custom textures from there?

glossy venture
#

how can i stop BungeeCord from attempting to connect me to a server before i can handle it in my plugin
now its connecting twice, once to the BungeeCord chosen one i think and once to the code chosen one

echo basalt
#

you make a fancy plugin on bungee that does shit for you

glossy venture
#

yeah ive done that

austere cove
#

how are you handling it in your plugin?

glossy venture
#

but i assume, since its in post login event, BungeeCord beats me to it and connects first

#

i cant find any methods in LoginEvent or PreLoginEvent though

echo basalt
#

ServerConnectEvent

glossy venture
#

oh yeah

#

and then check if the source is null ig?

echo basalt
#

ServerSwitchEvent

#

yeah those

austere cove
#

Can't you just set your preferred server in ClientConnectEvent

glossy venture
#

nah

austere cove
#

..why not?

glossy venture
#

theres no method for it

austere cove
#

yes there is

#

ListenerInfo#getServerPriority()

glossy venture
#

ah

#

is lower index higher priority or other way around

#

though ill probably still use server connect event because im not gonna rewrite all this shit

quaint mantle
#

Someone please help

#

pets are black and purple idk what to do

austere cove
#

afaik it's as simple as

@EventHandler
public void onConnect(@NotNull ClientConnectEvent event) {
    event.getListener().getServerPriority().insert(0, "my-preferred-server");
}
glossy venture
#

this works too tho

worldly ingot
quaint mantle
#

Yes i'm on 1.19.3

#

I tried uploading the atlases and directing it to my textures

worldly ingot
#

Yeah, it's likely an atlas issue. I'm not all too familiar with them just yet, but that's like 95% of the reason peoples resource packs are missing textures 😅

quaint mantle
#

dang this is all i've got

#

{
"type": "single",
"source": "textures/entity/nocsy_otter_v2",
"prefix": "textures/entity/nocsy_otter_v2/"
},

fluid river
#

?paste

undone axleBOT
quaint mantle
#

that's in atlases/blocks.json

#

for modelengine

#

nvm found it

#

if anyone else is having this issue

silver sand
#

Hey guys, what Java version is required to code for 1.8 spigot? (Helping a friend, not willingly using 1.8)

pseudo hazel
#

probably like java 8 or 7

silver sand
#

that's it couldn't remember which, thank you

silver sand
#

Thanks

pseudo hazel
#

google says java 8

midnight shore
silver sand
#

[ERROR] Failed to execute goal on project ModelMaker: Could not resolve dependencies for project me.will0mane.plugins:ModelMaker:jar:1.0-SNAPSHOT: Could not find artifact org.spigotmc:spigot:jar:1.17.1-R0.1-SNAPSHOT in spigotmc-repo (https://hub.spigotmc.org/nexus/content/repositories/snapshots/) -> [Help 1]

#

make sure you have the correct repo in your maven file

midnight shore
#

Well, but its the right repo because i can build it on my computer

silver sand
#

how strange

pseudo hazel
#

lol 🫙

silver sand
#

ahahah

midnight shore
#

wdym?

silver sand
#

it was in my message cause i didn't format it

pseudo hazel
#

nothing I was distracted

midnight shore
#

oh ok

chrome beacon
#

You can use spigot-api if you're not using any nms

pseudo hazel
#

maybe change spigot to spigot-api in artifactId

midnight shore
vast raven
#

I never tested before what happens what if 2 differents plugins listens for the same event to cancel it, with the MONITOR priority

chrome beacon
pseudo hazel
#

because the link shown in the error does not have a org.spigotmc:spigot

midnight shore
chrome beacon
#

You can host your own maven repo

midnight shore
pseudo hazel
vast raven
#

mhhmh

#

so to have the actual final say I have to load a plugin before the world and have the letter Z

midnight shore
#

do i have to have a server?

chrome beacon
#

Yes ofc

midnight shore
#

i need this to work 24/7

midnight shore
#

so its probably not an option

vast raven
midnight shore
#

any other online ones?

pseudo hazel
#

because its purely based on the order they are loaded

midnight shore
#

how do i upload the repo on maven central?

vast raven
quaint mantle
#

Anyone help with this?

#

.

quaint mantle
#

Item not re setting to update lore on click

pseudo hazel
# vast raven this order is based on the pre-world and alphabet I guess

not really, I think its pretty much random or based on like filesize, you can somewhat shuffle your plugin using some options in plugin.yml https://bukkit.fandom.com/wiki/Plugin_YAML

BukkitWiki

When Bukkit loads a plugin, it needs to know some basic information about it. It reads this information from a YAML file, 'plugin.yml'. This file consists of a set of attributes, each defined on a new line and with no indentation.

A command block starts with the command's name, and then has a list of attributes.

A permission block starts wit...

#

like load_before or softdepend

lusty stream
#

does anyone know what's this and why its consuming so much ram

quaint mantle
#

are sessions IDs sent to the server?

midnight shore
quaint mantle
#

so how does the server verify that a player owns minecraft?