#help-development

1 messages · Page 413 of 1

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
#

?paste your pom

undone axleBOT
tawny remnant
wet breach
#

Above the ping is a paste link with intellij throwing exceptions

#

Figured you might know something since you use intellij

tawny remnant
#

alex it happened after i added the pdc tags

eternal oxide
#

throw your jar in here

tawny remnant
#

that will leak my ip

eternal oxide
#

you have your IP in your plugin?

tawny remnant
#

sort of

wet breach
#

Lol

#

Dont worry ip addresses are not private anyways

tawny remnant
#

i think i know what it is tho

#

ill try smt and then tell you the outcome

round finch
#

lol no config for ip

wet breach
#

We have no code either

#

So we cant really help further

#

Anyways driving home now. So no more help from me until then

round finch
#

me.Danko.CSTMItems cannot be cast to class org.bukkit.plugin.Plugin

#

twice problem with casting

eternal oxide
#

its also about the loader, so probably shaded his own plugin somehow, or that class is not extending JavaPlugin

tawny remnant
#

fixed it

#

i might be kinda dumm but i did

#

it was my fault

#

i said instance = this in a non-Main class iykwim

young vine
#

That's API spigots fork of Bukkit added after paper

round finch
#

big error

quiet ice
#

Not, just in the autocompletion. Which still is nice enough. Perhaps ECJ was also made to only define it once in the bytecode, but we will continue to be haunted by the javadoc issues when using jetbrain's @NotNull/@Nullable

buoyant viper
#

laffs in using vscode rn

quiet ice
#

Isn't it using JDT too?

buoyant viper
#

idfk

#

ass pressure... bukkit wtf

terse ore
#

can someone use the command for spliting large tasks

eternal oxide
#

?workdistro

rough drift
buoyant viper
#

PlayerInteractEvent Action class

terse ore
#

one question, how could I create a world with only 1 iome?

#

like the world options in singleplayer

rough drift
#

oh

#

wait I see it

terse ore
#

there isn't a single biome :c

wet breach
quaint mantle
wet breach
#

Nope, came from bukkit

#

it is as the name implies though

#

as funny as it may seem, it is quite literal

quaint mantle
#

Bukkit is mojang's offical server software or I'm wrong?

wet breach
#

While mojang may own CB/Bukkit, Mojang has never used any code from it or even touched it

#

so no

#

Mojang didn't create CB/Bukkit either

rough drift
quaint mantle
#

So mojang use bukkit software as minecraft world?

rough drift
#

I cannot figure out how to actually make it rotate lmao

rough drift
#

mojang does not use bukkit

quaint mantle
#

Oh

young knoll
#

Wesley Wolfe, December 03, 2013

#

Blame them for ass pressure

#

:p

fluid river
#

i already told you 😉

oak locust
#

Hey, I am currently working on a Lobby System Plugin and I am encountering the following issue:
Players get a few different items (server selector, cosmetics menu, etc...) and when they click on a specific item (by right, left clicking or by clicking it with the cursor) they open another inventory. but when they click on the item with the cursor, they create a ghost-item when reopening the inventory. It's hard to describe but here is a short clip of what is happening: ||https://streamable.com/ubdo74||
I am using this Eventhandler to cancel the InventoryClickEvent and to open other Inventories:

    @EventHandler
    public void onMenuClick(InventoryClickEvent event) {
        Player player = (Player) event.getWhoClicked();
        event.setCancelled(true);
        if (!(event.getCurrentItem() == null)) {
            if (event.getCurrentItem().hasItemMeta()) {
                if (event.getCurrentItem().getItemMeta().getDisplayName().equalsIgnoreCase
                        (ChatColor.AQUA + "Server Selector " + ChatColor.DARK_GRAY + "(Right Click)")) {
                    serverGui serverGui = new serverGui();
                    player.openInventory(serverGui.getInventory());

                } else if (event.getCurrentItem().getItemMeta().getDisplayName().equalsIgnoreCase
                        (ChatColor.AQUA + "Cosmetics " + ChatColor.DARK_GRAY + "(Right Click)")) {
                    cosmeticsGui cosmeticsGui = new cosmeticsGui();
                    player.openInventory(cosmeticsGui.getInventory());

                } else if (event.getCurrentItem().getItemMeta().getDisplayName().equalsIgnoreCase
                        (ChatColor.WHITE + "Players: " + ChatColor.GREEN + "Visible" + ChatColor.DARK_GRAY + " (Right Click)")) {
                    player.closeInventory();
                    player.sendMessage(Main.getInstance().prefix + ChatColor.RED + "Feature coming soon");
                }
            }
        }
    }
}```
terse ore
fluid river
#

and

wet breach
#

which is the irony

fluid river
#

@terse ore

warm mica
fluid river
#

is link not working for me only tho?

warm mica
#

and don't get a new ItemMeta each time, that is inefficient as it is being cloned each time

fluid river
#

^

young knoll
#

Yo where can I get jree fava lessons

oak locust
fluid river
warm mica
#

and structuring it can help you to find the cause

fluid river
#

cool streamable is blocked in russia

#

vpn made it work again

warm mica
#

are they blocking everything now like china

fluid river
#

no

#

sanctions

wet breach
warm mica
#

ah

fluid river
#

guys just leave ru

fluid river
#

i teach Fava

oak locust
fluid river
#

can you throw this item or place it after you get it

oak locust
# warm mica No problem

i am currently learning java and spigot developement and you are most definitely not helping me do that

wet breach
#

just ignore them 🙂

warm mica
oak locust
terse ore
fluid river
#

well, you can try setting

terse ore
#

can I dm you or make a thread to keep things clear

oak locust
fluid river
#

event.setCursor(null)

#

also before opening a new inv

oak locust
#

@warm mica don't act like you are superior to me or whatever just because you are more experienced

fluid river
#

close old one

oak locust
vale ember
#

Is there a way I can enable a plugin from a jar i just downloaded from code?

fluid river
#

Player#closeInventory()

fluid river
#

you can try using File class to get the .jar

#

and then some reflection ig

vale ember
#

I want to make an auto updater that does not require a restart. I download the jar from the web and want to enable it

fluid river
#

^^

oak locust
# fluid river close old one

i was already thinking about that, but it looks a bit less smooth. But if it is necessary i will implement that

wet breach
#

unless you are going to use reflection and hook into spigots class loader you will need to restart

fluid river
#

^^

oak locust
# warm mica What?

just shut your goofy ass up and stop harassing people without that much knowledge

warm mica
#

getta hell out of here

wet breach
oak locust
wet breach
#

you don't need to engage them

fluid river
#

if you stream the result

warm mica
wet breach
#

for the ghost item problem

oak locust
oak locust
wet breach
#

I don't see anything in the code above you posted that would cause it

#

so the only other thing in that code is servergui

fluid river
#

is servergui a lib or smth

#

or just other class from own plugin

oak locust
#

a class from my plugin

wet breach
#

its their Class for creating the GUI and tracking it

brisk estuary
#

have you guys tried the new UI on intellij?

wet breach
#

some probably have

oak locust
#

i jave servergui (the actual inventory holder) and serverguihandler (its a listener)

warm mica
brisk estuary
#

Preferences -> Appearance & Behavior -> Enable new UI

warm mica
#

it looks like vs code now, that's interesting

oak locust
fluid river
#

ez

fluid river
warm mica
#

It looks really nice

oak locust
fluid river
#

?arrow

#

what's this command name

#

@wet breach

#

help me pls

wet breach
#

for?

fluid river
#

arrow antipattern command

#

i forgor

wet breach
#

don't think I have seen or heard that command before

warm mica
#

There should be a list of commands

#

that bot has so many of them

wet breach
#

there is if you know where to look

warm mica
fluid river
#

just sent the link bot sends

oak locust
wet breach
#

you should return early if possible, but there is cases where you have no choice but to nest if statements

#

just because you don't like the look, doesn't mean it is bad because this is more or less under style/formatting which you can do in your own IDE

#

my IDE, I can collapse code I don't need to look at

#

therefore, its a none issue in what style/format people use as long as its pretty consistent and sane lol

vale ember
#

is it possible to run a bukkit code with value computed asynchronously via CompletableFuture without freezing the server? I'm trying this:

CompletableFuture.supplyAsync(updater::tryDownloadLatestVersion)
                .thenAccept(updater::disableOldAndEnableNew);
#

but it throws exception

#

saying plugin cant be disabled asynchronously

young knoll
#

You could wrap it with Scheduler.runTask

vale ember
#

so i download the file synchronously?

young knoll
#

No

fluid river
#

you disable synchronously

young knoll
#

You disable the plugin synchronously

warm mica
vale ember
#

like this?

        Bukkit.getScheduler().runTask(plugin, () -> {
            CompletableFuture.supplyAsync(updater::tryDownloadLatestVersion)
                    .thenAccept(updater::disableOldAndEnableNew);
        });
warm mica
#

No

#

Only the part where you call updater::disableOldAndEnableNew

#

Right now you are synchronizing that the completable is being called async

vale ember
#

like this?

CompletableFuture.supplyAsync(updater::tryDownloadLatestVersion)
                        .thenAccept(it -> {
                            Bukkit.getScheduler().runTask(plugin, () -> updater.disableOldAndEnableNew(it));
                        });
vale ember
#

thanks!

wet breach
#

+1 to the new person helping

fluid river
#

?

wet breach
#

hmm, now to remember the command for cafebabe to keep track

#

?karma

#

!karma

#

.karma

#

guess we don't have that anymore as well

#

all well

fluid river
#

why does cba exist

wet breach
#

?cba

undone axleBOT
#

Frostalf#3075 definitely regrets to for the most part inform you that unfortunately, they essentially are unable to definitely assist with definitely your enquiry, which essentially is fairly significant. Please simply really ask again later or possibly kind of ask someone else about this enquiry, demonstrating that the person that ran this command generally regrets to kind of inform you that unfortunately, they for the most part are unable to generally assist with actually your enquiry in a subtle way. Thank you very sort of much for kind of your time and the person that ran this command specifically wishes you a really good day, so the person that ran this command really regrets to actually inform you that unfortunately, they literally are unable to definitely assist with very your enquiry, or so they particularly thought.

fluid river
#

just for spamming reason

#

?cba

undone axleBOT
#

carefall#2257 definitely regrets to for the most part inform you that unfortunately, they essentially are unable to definitely assist with definitely your enquiry, which essentially is fairly significant. Please simply really ask again later or possibly kind of ask someone else about this enquiry, demonstrating that the person that ran this command generally regrets to kind of inform you that unfortunately, they for the most part are unable to generally assist with actually your enquiry in a subtle way. Thank you very sort of much for kind of your time and the person that ran this command specifically wishes you a really good day, so the person that ran this command really regrets to actually inform you that unfortunately, they literally are unable to definitely assist with very your enquiry, or so they particularly thought.

wet breach
#

now that you have read that

#

what do you think cba means

#

😉

warm mica
#

CafeBAbe

fluid river
#

cba means didn't read lol

warm mica
#

zyzz😎

wet breach
#

the clean version of cba meaning is couldn't better assist

#

fun fact about cafebabe

#

you used to be able to engage in conversation with her

#

sadly she has been silenced so, that is no longer possible

warm mica
#

this seems like a perfect opportunity to integrate the chatgpt api

wet breach
#

she has an AI attached

#

that allowed her to talk to you 🙂

#

not always smart, but was good enough and she would sometimes make fun of you as well lol

fluid river
#

and then the guy goes "omg bot is so rude..."

wet breach
#

depends on what her comment was

#

sometimes it would be a nice burn

remote swallow
#

ive always known it as cant be arsed

wet breach
remote swallow
#

oh

#

i havent turned my brain on

vale ember
#

why is it that if i disable a plugin and then load and enable the same plugin from different jar and try to execute a command from that plugin internal error occurs saying that the previous version of the plugin is disabled?

hazy parrot
#

Not sure that you can swap plugin jars while server is running

mighty pier
#

should i delete an object or do i leave it to garbace gollector

vale ember
hazy parrot
mighty pier
#

ok

wet breach
#

so you are correct

hazy parrot
vale ember
#

No, I just disable it with plugin manager and delete the file

hazy parrot
#

Yeah that won't work

wet breach
#

the jvm loads all the classes onto the path

#

hence why you can delete the file while the server is running and the plugin still works in the server 😉

#

so you need to use reflection and a javagent to do what is called hotswapping of classes

hazy parrot
#

And imo it's not really worth, just restart server

wet breach
#

yeah, restarting is not that bad lol

vale ember
#

Yeah it's just that someone requests an auto updater for my plugin which wouldn't require restart 🤷‍♂️

wet breach
#

unfortunately, that isn't something that is going to be easily doable and they will just have to live with restarting

#

if you really want to implement it, I gave you the keywords/things to research

vale ember
#

I don't think I'm gonna go that deep, but thanks anyway!

remote swallow
#

ig an example would be how plugwoman unloads and loads stuff

#

i think, no idea though

mighty pier
#

send best sqlite implementation

wet breach
#

sqlite driver

#

not sure if you are going to get better then that

kind hatch
# remote swallow i think, no idea though

Nah, it hardly does anything differently from its original fork. It still the same old PluginManager#disablePlugin and PluginManager#enablePlugin but with some extra steps on the disable part.

wispy wyvern
#

how can i prevent blocks from placing within a radius of a specific block type

#

so for example, i place a gold_block, and within 5 blocks of radius i want to despawn any blocks placed

remote swallow
wispy wyvern
#

so i can only place any other block that is 5 blocks aways from the target block

kind hatch
remote swallow
#

ah

#

now im confused how plug woman doesnt kill low spec servers but plugman does

wet breach
#

probably because the former catches exceptions the latter doesn't

#

catches and handles the exceptions

quaint mantle
#

hello.

remote swallow
#

ah

quaint mantle
#

i am concerned.

#

for some reason, block break events on my server are being cancelled and i cannot discern why.

flint coyote
#

Spawn protection?

quaint mantle
#

i am looking at all the event handlers registered, none of them appear to have event.setCancelled(true); and are registered as block break events.

quaint mantle
#

how do i turn off that?

kind hatch
#

Set it to 0

flint coyote
#

in the server.properties file

quaint mantle
#

lol that confused me so much.

#

another question, what is material for crops as in things placed in the world called?

#

nvm.

golden turret
#

WHEAT

#

I think

#

1.13

remote swallow
#

different for each crop iirc

golden turret
#

yes

#

POTATO

#

CARROT

#

and etc

quaint mantle
#

it is POTATOES for potatoes probably.

golden turret
#

yes

#

bukkit should have different enums for items and blocks

#

that would be a lot easier

flint coyote
#

They could differ between items and blocks but they try to stay as close as possible to mojang

golden turret
#

sad

#

mojang bad

flint coyote
#

Well, I think it gets worse now that microsoft owns it - but that's not the channel to discuss about this

quaint mantle
#

microsoft probably has owned mojang for very long now.

#

too late to discuss that.

#

but yep, mojang and microsoft bad.

#

very bad.

flint coyote
#

I mean so far so good. The problem I have with them developing minecraft is that they will probably start cancelling mc-java-edition in the next 3 years

#

I don't wanna be forced to play Bugrock-Edition 😢

flint coyote
#

No they stated that they will continue developing both versions for now

wet breach
#

which is most likely the reason why they won't

quaint mantle
#

what do you mean?

wet breach
#

well, everyone uses the vanilla client because mojang maintains it. If they stopped updating the Java edition, this allows the community to start adding their own stuff since no more updates from mojang

flint coyote
#

Even if the java community would take matters into their own hands I still expect 90+% of players to shift to bedrock edition at this point.
Since java edition will not be in the same launcher anymore, not downloadable on minecraft.net etc.

flint coyote
#

I know they already exist but the majority of players probably won't bother downloading a custom launcher to play a minecraft version that has far less players.

The only real chance for survival I see is to keep crossplay with bedrock up in java edition

wet breach
#

not really, plenty still play on java edition

#

far more then you are implying

quaint mantle
flint coyote
#

I would expect atleast 2/3 of players on bedrock, even though there are no official numbers.
Bedrock supports all platforms and not just PC

quaint mantle
kind hatch
#

I'd probably quit Minecraft altogether if they discontinued the java edition. It's the only damn edition that runs on linux atm. I could potentially play dungeons through Steam, but I bought it through Microsoft themselves.

flint coyote
quaint mantle
#

mojang does a terrible job of updating the game, just have them no longer update the game and instead let the modmakers do it.

hybrid spoke
#

java > bedrock

wet breach
quaint mantle
#

mojang could just provide a modding api of sorts if anything.

wet breach
#

simply because not all PC players play bedrock

kind hatch
wet breach
hybrid spoke
#

only thing thats cool is that you can let the clients load custom stuff directly in bedrock

quaint mantle
#

who?

wet breach
#

in case you don't know who that is, that is the person who tried to kill bukkit

quaint mantle
#

what?

kind hatch
#

I thought that was Wolverness?

wet breach
#

Wolverness DMCA'ed after

quaint mantle
#

what?

kind hatch
#

?dmca

undone axleBOT
wet breach
#

EvilSeph is also the only bukkit dev member to be forced to resign from Mojang too

quaint mantle
#

Bukkit api was sued??

kind hatch
#

You're not referring to DarkSeraphim are you?

wet breach
#

but he was the one that was supposed to create a mc mod api type thing but either failed or never did it

quaint mantle
#

mojang owns bukkit?

hybrid spoke
#

failed, got mad and griefed LUL

wet breach
quaint mantle
#

what?

wet breach
#

they have for several years now

quaint mantle
#

they own spigot?

wet breach
#

its no secret

#

no

quaint mantle
#

what is going on?

wet breach
#

Spigot is built on top of CraftBukkit/Bukkit

quaint mantle
#

yep.

wet breach
#

CraftBukkit/Bukkit is owned by Mojang

quaint mantle
#

it is?

#

i did not know.

wet breach
#

However Mojang doesn't touch it or do anything with it, and has left it for the community to maintain

quaint mantle
#

nor they should probably.

#

they do a terrible job of maintaining a block game, with over 1000 employees lol.

#

with billions of dollars.

wet breach
#

However because they own it, they prevented exactly what they wanted to prevent. Someone like EvilSeph attempting to kill off the project

quaint mantle
#

not to mention microsoft's trillions of dollars.

kind hatch
quaint mantle
#

it says they have like 1000 employees when you google it?

wet breach
#

Well I mean employee does't mean developer

quaint mantle
#

hm.

flint coyote
#

They count all the spigot devs /s

wet breach
#

they could be counting the janitors for all we know 😛

quaint mantle
#

but even then, with so much money, they should probably be doing a better job maintaining a block game perhaps?

flint coyote
#

True. Maybe they got 1 janitor per room

wet breach
#

but yeah employee doesn't mean developer. In terms of developers its like 30 some odd people

wet breach
quaint mantle
#

microsoft is a trillion dollar company.

#

its more money than some countries combined.

wet breach
#

Indeed, but it isn't going to give Mojang a trillion dollars to spend or play with

flint coyote
#

Microsofts focus is certainly not minecraft

wet breach
#

nor could they

eternal night
#

time to kill windows, we need more money allocated to minecraft

wet breach
#

lol

quaint mantle
#

ok.

flint coyote
#

What really gets them all their money is probably MS office or business server licenses and support

wet breach
#

Enterprise

#

is what makes them their money

#

customers like DoD for example

quaint mantle
#

who?

kind hatch
wet breach
#

Department of Defense

#

its in the US

quaint mantle
#

ok.

flint coyote
#

Kinda ironic that DoD uses Windows. Unless they use it to test windows vulnerabilities lol

quaint mantle
#

maybe the latter, to hack into everyone's computers perhaps?

#

potential conspiracy?

wet breach
hasty prawn
wet breach
#

serialize it and save it to file

kind hatch
#

Serialize it and write it to disk.

quaint mantle
#

the config file system probably does that already.

flint coyote
wet breach
#

depends how they want to save it

wet breach
quaint mantle
#

microsoft's servers are hosted on linux?

wet breach
#

especially in terms of remote user environments, the ability to create them on the fly and setup with CAC

kind hatch
#

Did you save those changes to disk?

#

FileConfiguration#save()

wet breach
#

the closest you could get on the linux side with slim clients is network booting, but windows provides it in a completely different way

flint coyote
#

That's true, yet still instead of investing billions of dollars into microsoft enterprise and support you could hire people to develop what is needed

wet breach
#

no

#

cheaper to just let microsoft handle it

#

and it doesn't cost billions of dollars either

#

its more like millions

flint coyote
#

Now that I'm thinking about it - they get a discount by collecting the taxes from every sale anyway

wet breach
#

military isn't taxed....

flint coyote
#

Microsoft is

kind hatch
#

You know, I'm kinda surprised that linux doesn't have similar alternatives to what Microsoft offers at this point. At least on the enterprise side.

wet breach
#

Government contracts are not taxed

flint coyote
#

Oh I did not know that

kind hatch
wet breach
#

I am pretty sure it is most likely due to the fact the under taking to replicate such a system

#

not only do you have to develop a server

#

but you have to develop a client as well to go with it

#

windows desktop works with the windows server because both are designed to be that way specifically. It isn't like some addition that comes from an outside source to make it possible lol

kind hatch
#

Sure, but you'd think with all of the containerization that linux is capable of that something would have come along. Like docker instances that could be managed like windows VMs.

wet breach
#

well the remote desktop environments are not really VM's

flint coyote
#

And it has to be a lot cheaper/better than what microsoft delivers to actually make people (especially large companies that have adapted to windows for decades) swap. Would be like all those smaller mobile phone companies against Samsung/Apple and maybe Google

wet breach
#

I mean they kind of are but at same time are not

wet breach
thorn crypt
#

Yo, Is it normal that when I just persistant data on a bow it work and when I disconnected and then reconnect, the persistant data wont work ?

I mean, I set a data named "bow_type" and if when a shoot is made with and the value is "fire_ball" it will launch a fireball instead of the arrow.

But when I do it a first time it work, and will work UNTIL I disconnect and reconnect

kind hatch
#

Are you sure you are setting PDC data and not Metadata?

wet breach
#

and are you sure you are actually saving it

thorn crypt
thorn crypt
flint coyote
wet breach
#

so no, microsoft doesn't have a monopoly

#

as I said, everyone has to be given equal opportunity with the government contracts 🙂

flint coyote
#

But Google doesn't offer a server OS (or any OS, besides Android)

wet breach
#

While true, they do offer GPS and Maps and some other stuff

flint coyote
#

Yeah what I meant is the monopoly in terms of (server) OS

wet breach
#

Oh Microsoft still doesn't

#

DoD also uses Redhat

flint coyote
#

And googles monopoly (that is currently shrinking) is a search engine

brisk estuary
#

Internet Explorer

wet breach
#

googles monopoly is its maps for enterprise side

#

search engine for the consumer side

flint coyote
#

The latter took a hard hit. And if microsoft should manage to make bing viable with their OpenAI investment it might get worse

kind hatch
#

Oh, well if you're using bungee, then you'll need to call ConfigurationProvider#save()

wet breach
flint coyote
#

That's true. No other company is close to beating google maps. The closest it gets is probably apple maps

wet breach
#

but yeah when it comes to the US government, its allowed to save money but it simply can't just not hand out government contracts either

flint coyote
#

But with all the cheap android devices using google maps, apple has not nearly enough data to compete with google

flint coyote
wet breach
#

And since most open source software companies are not competing for government contracts because they are not there to make bids or represented, you tend to see corporations like microsoft or google getting the contracts because they made the bids for it.

wet breach
flint coyote
#

Oh now I get it. Yeah someone would actually have to start a business based on Linux and be competition for microsoft/google. Which ofc would be a huge investment and a loooong way

quaint mantle
#

is there an event for stepping on pressure plates or stepping on tripwires perhaps?

flint coyote
#

Interact event should work. You can somehow check for PHYSICAL. Lemme check the docs

wet breach
#

that is exactly what you would check for

#

Action.Physical

flint coyote
#

Action == Action.PHYSICAL, ye

#

Btw frostalf since I see you answering questions here quite a lot - do you know how spigot determines spots to spawn mobs?

Is there any way to get a random "natural" spawn location to summon a mob?

wet breach
#

most of it is from mojang

flint coyote
#

Well then let me rephrase: Does Spigot offer a possibility to get a spawning position for a specific mob?

Lets say I want to spawn a zombie - I would need a 2 block space with light level 0 and it can not be like 3 blocks around a player.

#

Maybe it's more than 3. Idk the exact monster spawn rules

#

And it probably differs for mobs from spawners aswell

#

While I can implement all those rules myself - mojang has logic to enforce that somewhere in their code. So it would be cool to just reuse it

kind hatch
wet breach
#

spawners have different rules then natural spawned mobs

#

and shadow gave you the link to pretty much read everything in regards to spawning

#

all spigot does or hooks into, other then allowing from the api to spawn stuff, is providing configuration to limit spawns and amounts

#

it doesn't actually change the prediction code or anything

#

now whether or not could you hook into this code is a different matter entirely, fortunately the odds are probably yes with NMS and reflection, the unfortunate part is that the odds are that all this prediction code is probably spread out in a number of classes and not just a single few lol

flint coyote
#

That's sad. I would really like to just spawn mobs "naturally".
For a custom mob plugin I am currently waiting for a zombie to spawn, then cancelling that spawn and spawning my custom zombie instead.

Would be cleaner to simply call something like

Location loc = World.getRandomViableSpawnLocation(EntityType.ZOMBIE, player.getLocation());
loc.spawnCreature(...);
#

I might try with reflection then. I did the same to add pathfinder and other goals to already existing entities

fluid river
#

isn't that the only way tho

#

for pathfinding

flint coyote
#

You can do it without reflection if you spawn new entities. You still need NMS obviously

fluid river
#

oh

wet breach
flint coyote
#

That's what I do. I was hoping for a better solution that is not based on other entities spawning :D

hybrid spoke
#

implementing your own spawn system

wet breach
#

while that might sound better

#

you are still having to cancel the entity for your custom one

flint coyote
#

Yup that's why I added a chance aswell. So you don't disable normal mobs.

#

In simple terms -> On zombie spawn if the chance of 5% is met, spawn custom and cancel normal zombie, otherwise do nothing

hybrid spoke
#

thats the way to go

wet breach
#

well if are not completely removing the normal mob that your custom is based off of, you can just create some random algo for spawning it

fluid river
#

get the location of new spawned mob

wet breach
#

but if you are swapping between them like above, that is the way to go or keep it

fluid river
#

and in scheduler spawn your own after 1 minute if light level haven't changed 😉

#

gonna fuck up your cpu ig

flint coyote
#

Save all Locations a mob spawned and remove them when light level changes. Lemme just buy 128GB of RAM for my server 😛

wet breach
#

just cycle stuff through the paging

flint coyote
#

Yeah I guess I'll take a look at mojangs code / keep the current solution for now.
It's not that bad that less normal mobs spawn when custom mobs exist

#

Would have been cool to spawn like 10 custom mobs at natural locations if a certain event is triggered but guess I'll have to deal without that for now

flint coyote
#

At some point you will have every non obstructed block in that list

#

(that is at ground level)

fluid river
#

truee

#

but in 1 minute block would be removed from the list anyways

#

so depends on player amount

#

and loaded chunks amount

flint coyote
#

You don't want to delete the Locations. In case the chunk gets loaded again you need them.

BUT: You can save them per chunk and only load the chunks locations on chunk load and persist them on unload

fluid river
#

anyways that's so fucked up

#

why are we even discussing

flint coyote
#

In that case you don't even need that much RAM. Just a lot of storage space 😛

#

Idk. I won't do that anyway. It's a horrible solution

fluid river
#

ik

#

just random idea i get in my hand at 3:00

flint coyote
#

I could do it for a worst practice example 🤔

fluid river
#

everyday

#

hey fabsi

#

do you have 1 min of free time

#

and a local serv

flint coyote
#

I do have a local server, why?

wet breach
#

pull them from the file when they are needed

flint coyote
#

Yup. Yet still you would have to recheck and re-save all Locations when the light level changes.

wet breach
#

nope

#

depends how the file is structured

flint coyote
#

Well but you need the light level in the file. Otherwise you will loop through wrong blocks while trying to find a valid spawn location

wet breach
#

well sine you only need the relevant locations around a given area you can always check to see if the light levels changed at that point and just remove the ones no longer valid

#

but essentially how you would store it is like a grid system

#

but you wouldn't use human readable text since you can't store stuff efficiently like that nor could you really represent 3 dimensions visually in a file anyways

#

2 dimensions if we don't care about the y value

flint coyote
#

That would also work, ye. It could cause lag when a large area was lighted up after the last spawn and thousands of blocks are checked and overwritten before a spot was found (or none at all)

wet breach
#

memory mapping wouldn't cause lag

#

as the memory mapped file is separate from the program

#

and because it is a memory mapped file you can also use another process that checks

thorn crypt
#

What can I do to make a custom bow, like I want to add a data to a bow with "fireball".

wet breach
#

what I mean by this is, you could if you wanted just have a background process that reads region files and checks your memory mapped file

wet breach
#

because memory mapped files are not locked to a single process

fluid river
#

?pdc

thorn crypt
# fluid river pdc

I wanted to do that, and I did that, but when I disconnect and reconnect, the custom bow don't work

fluid river
#

umm

#

show your code

#

that's really weird

thorn crypt
#

Like I made a fireball bow and it was shooting fireball and I disconnecd reconnected and it stopped shooting fireball

fluid river
#

pdc's are not touched with restarts

wet breach
#

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

thorn crypt
fluid river
#

w8ing

flint coyote
fluid river
#

...

wet breach
thorn crypt
# fluid river show your code

Bow :

ItemStack fireballBow = new ItemStack(Material.BOW);
            ItemMeta fireballBowMeta = fireballBow.getItemMeta();
            fireballBowMeta.setDisplayName(fireball_bow_name);
            fireballBowMeta.setLore(Collections.singletonList(fireball_bow_lore));
            fireballBowMeta.getPersistentDataContainer().set(new NamespacedKey(MyCustomBow.getPlugin(MyCustomBow.class), "bow_type"), PersistentDataType.STRING, "fire_ball");
            fireballBow.setItemMeta(fireballBowMeta);
            player.getInventory().addItem(fireballBow);

OnShoot

public class bowShootListener implements Listener {

    @EventHandler
    private void onShoot(EntityShootBowEvent event) {
        if (!(event.getEntity() instanceof Player)) return;
        Player player = (Player) event.getEntity();
        ItemStack bow = event.getBow();
        Entity arrow = event.getProjectile();
        if (bow.getItemMeta().getPersistentDataContainer().getOrDefault(new NamespacedKey(MyCustomBow.getPlugin(MyCustomBow.class), "bow_type"), PersistentDataType.STRING, "-1") == "fire_ball") {
            arrow.remove();
            player.launchProjectile(Fireball.class);
        } else if (bow.getItemMeta().getPersistentDataContainer().getOrDefault(new NamespacedKey(MyCustomBow.getPlugin(MyCustomBow.class), "bow_type"), PersistentDataType.STRING, "-1") == "lightning") {
            arrow.getPersistentDataContainer().set(new NamespacedKey(MyCustomBow.getPlugin(MyCustomBow.class), "bow_type"), PersistentDataType.STRING, "lightning");
        } else if (bow.getItemMeta().getPersistentDataContainer().getOrDefault(new NamespacedKey(MyCustomBow.getPlugin(MyCustomBow.class), "bow_type"), PersistentDataType.STRING, "-1") == "tnt") {
            arrow.getPersistentDataContainer().set(new NamespacedKey(MyCustomBow.getPlugin(MyCustomBow.class), "bow_type"), PersistentDataType.STRING, "lightning");

        }
    }
}
wet breach
#

and I know how it can be used in some pretty creative ways

#

also, memory mapped files if the server dies for whatever reason

#

get saved on their own by the OS as it is OS managed

#

not process managed

flint coyote
#

Is there any disadvantage compared to a usual file?

wet breach
#

also it is a handy way for two programs to communicate too if need be

flint coyote
#

That's stored like every 5 minutes and on shutdown?

wet breach
fluid river
#

what is this "-1" thing for

wet breach
#

those are the only two disadvantages

fluid river
#

oh i see

wet breach
#

you can memory map files in 2 ways

fluid river
#

try debugging this

thorn crypt
fluid river
#

cuz from what i see it should work

wet breach
#

you can either load the entire file into memory or you can just load partial and just have a buffer that loads and unloads as you go through the file

fluid river
#

even if you reconnect

thorn crypt
thorn crypt
fluid river
#

also, try .equals()

#

instead of ==

#

for string comparison

thorn crypt
#

Ok i'll try

fluid river
#

cuz you know, gc is working around both string pool and heap

thorn crypt
#

Oh it work now

#

The problem was the == yes

fluid river
#

never compare strings with ==

#

or at least do

thorn crypt
#

I replaced with .equals() and work perfectly

fluid river
#

yourString.intern() == "fire_bow".intern()

thorn crypt
#

What intern for ? I never saw that

fluid river
#

putting it string pool

#

afair

thorn crypt
#

Oh okay, thanks you !

flint coyote
fluid river
fluid river
thorn crypt
fluid river
#

today i gave free java lessons

thorn crypt
#

It's a pleasure x)

fluid river
#

dear diary,

wet breach
#

snakeyaml the lib that spigot depends and extends a bit, loads plugin configs into memory

#

and then for custom configs if you make use of the appropriate methods and retain a reference also loads files into memory

#

hence why there is a MemoryConfiguration in the API

#

but this type of memory loading is different as its done through the process

#

and not through the OS in terms of memory mapping

buoyant violet
#

how can i install java 16 without login in oracle?

eternal oxide
#

Adopt OpenJDK

fluid river
#

eclipse temurin

#

or i can just send you zip or exe

#

of oracle jdk

#

@buoyant violet

wispy wyvern
#

guys, how could i prevent players from placing the same block type as my target block within 5 block radius?

#

lets suppose i have a beacon placed randomly, and i dont want players to be able to place a block less than 5 blocks away

fluid river
#

blockplaceevent

#

in case guy wants NxN blocks radius, distance won't work well

#

cuz distance is just operating with xyz sphere

#

three nested for loops

#

for x y z

#

or bounding box at least

#

cuz distance is operating with default maths

#

if block is 3 blocks away on x

#

and 4 blocks away on z

#

distance is 5

#

cuz dist = sqrt((x0-x1)^2 + (y0-y1)^2 + (z0-z1)^2)

young knoll
#

Manhattan distance

wispy wyvern
#

so, what do i do exactly? xD

fluid river
#

?jd-s

undone axleBOT
fluid river
#

BoundingBox#contains(placedBlockX, placedBlockY, placedBlockz)

wispy wyvern
#

ultimately, what i wanna do is a custom money machine for rankup servers, which will then merge to an already placed machine within the defined radius

fluid river
#

w8

#

your beacon is custom block

#

or just a simple one

wispy wyvern
#

beacon was an example

#

i'll use gold block for my machine

fluid river
#

is it a custom block with nbt on chunk or smth

#

or just a simple block

#

with coords in config or smth

wispy wyvern
#

no, at the moment will be just a normal gold_block

fluid river
#

then

wispy wyvern
#

it has a custom name, but not any nbt

fluid river
#

when you just place a golden block

#

you loop through all blocks in radius 5

#

and if there is another golden block

#

with custom name

#

you cancel the blockplace + send message

sterile token
#

Why people don't read the Docs i mean they are there to give us (the devs) facilites while coding 💀💀

fluid river
#

?

sterile token
#

Yeah Lot of people ask simple questions which can be self answered ig they ** read the Docs

#

Is not dificulta and don't take more than 5m to read the Docs about what y are trying to use

fluid river
#

who are you talking about

#

rn

sterile token
#

💀🤡

fluid river
#

somebody triggered you or smth

sterile token
#

Triggered ?

fluid river
#

made your ass burn

#

so you are now typing here 😉

sterile token
#

🤔🤔

wispy wyvern
#

i just asked a question man, dont hunt me for the rest of my life

sterile token
#

Sorry i make You thought that

wispy wyvern
#

i mean, you came here tilting after i asked a question so... xD

sterile token
#

I mean i was on fired caused a dm question

#

Now calma down i just realize You where asking smth related. My bad

fluid river
#

))

#

is your code working now

#

@wispy wyvern

#

or you haven't tried anything yet

wispy wyvern
#

i didnt even try, i thought man wanted me dead or some

sterile token
#

Custom model on 1.8.8 r3? It's there any api / library

sterile token
#

I'm really weird these days

#

I havent mucho free time to code so that males me mad

wispy wyvern
#

im joking, don't worry

sterile token
#

Oh jajaja i don't cath jokes, i'm really weird

wispy wyvern
#

even if it was for me, it's true that I should read the docs

sterile token
#

Shity cellphone corrector

tardy delta
#

Imagine not having free time

wispy wyvern
sterile token
sterile token
tardy delta
#

Why are you on discord then

sterile token
#

If need smth just dms me

sterile token
wispy wyvern
#

is there a way i can create like a int radius = 5 then it makes the thing

sterile token
regal geyser
#

anyone knows why i am not getting the another onCommand function?

fluid river
#

for (double x = block.getX() - 5; x <= block.getX() +5; x++) {

}

#

and same for y and z

fluid river
#

if (block.getWorld().getBlockAt(x, y, z).getType() == Material.GOLD_BLOCK) return;

wispy wyvern
regal geyser
#

i code java too, but kotlin is just simpler

wispy wyvern
fluid river
#

and y too

sterile token
regal geyser
fluid river
#

you put this if inside those nested loops

sterile token
regal geyser
#

i am not here to discuss programming langs, just trynna get some help, so if u can't help, try not to bother me

sterile token
#

Okay generations facts 💀💀

echo basalt
sterile token
#

I don't catch it

echo basalt
#

npc animation scripts

wispy wyvern
# fluid river you put this if inside those nested loops

so, this?

for (double x = block.getX() - 5; x <= block.getX() +5; x++) {
            for (double z = block.getZ() - 5; z <= block.getZ() +5; z++) {
                for (double y = block.getY() - 5; y <= block.getY() +5; y++) {
                    if (block.getWorld().getBlockAt((int) x, (int) y, (int) z).getType() == Material.GOLD_BLOCK) return;
                }
            }
        }
echo basalt
sterile token
echo basalt
#

yea

#

I'm just making scripts atm

sterile token
#

Wow looks really good

echo basalt
#

imma make some look and lookentity stuff

sterile token
#

Indirectly a simple IA

echo basalt
#

yea

#

basic AI, no variables no nothing

#

made it in like 2 hours

#

the dialogue system is something else I have

sterile token
#

Ai? I clnfused it with IA

#

Arent fue same?

echo basalt
#

AI is the english name

#

IA is your localized name

wispy wyvern
sterile token
#

Ohhh ok right that males more sense nos

fluid river
#

no, the block you currently place

echo basalt
#

dialogues look like this

#

and I can associate code with buttons

wispy wyvern
#

oh, so this will create a radius of 5 around the block im placing and unplace if theres is a gold_block within the bounding box?

sterile token
echo basalt
#

yea I did

#

config-wise it's the same

tardy delta
#

I was working on a pathfunding algorithm in class today, maybe some day ill be able to implement mob ai

fluid river
#

but this algorithm would run for every golden block placed on the server

#

but we can't do anything about it

wispy wyvern
#

that's fine, it would be only placed inside plots which are all more than 5 blocks away from each other

#

so this will just prevent the player from placing my custom block too close

#

and i'll then try to make a way of merging the blocks into the existing one, so it stacks

sterile token
echo basalt
#

but the new menu engine has a whole layer, element & selection system

sterile token
#

Oh My bad i understand what ever haha

echo basalt
#

menu system is complex now

sterile token
#

Im really tired i havent sleep

#

Oh lol it's such a huge library*

wispy wyvern
echo basalt
#

This new animation scripting system integrates npcs and dialogues together

#

you can also reload dialogues and scripts in runtime

sterile token
#

Oh Nice

#

Buts is the same lib

#

?

wispy wyvern
#

you know spawners? that stacks mobs and then you get loot from, lets say, 245x rabbits?

#

same idea, but with a machine

echo basalt
#

it's like 750kb rn

wispy wyvern
#

and btw, it didn't prevent my block from placing

sterile token
sterile token
#

?paste

undone axleBOT
fluid river
#

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

sterile token
#

Oh such a good cmd, it's must be smth new

fluid river
#

idk

wispy wyvern
fluid river
#

is your listener registered

#

and why do you need blockAgains and boundingbox

wispy wyvern
#

the boundingbox i thought i would need it

#

and block against was my first attempt to remove block when i placed them against another gold block

#

and it worked, but its not used so

#

only block is used

fluid river
#

so

fluid river
wispy wyvern
#

yes

fluid river
#

does your logger log smth

wispy wyvern
#

yes

#

whenever i place a block

fluid river
#

well you forgot to cancel the event

#

before return;

wispy wyvern
#

i tried cancelling the event without the return

#

would it make a difference?

fluid river
#

you need to both cancel and return

wispy wyvern
#

ok

fluid river
#

cancel
return

wispy wyvern
#

doesn't let me place any block

fluid river
#

near gold one

#

or just anywhere

wispy wyvern
#

anywhere

#

it logs whenever i place a block

#

and then removes it

fluid river
#

can you send your latest version of code

#

oh i see

#

i'm dumb

#

your block is also in the radius 5

#

which you just placed

#

you need to add one more if

#

or

#

try cancelling the event before loop

#

and after the loop setCancelled(false);

#

so if loop haven't found any golden block in radius 5, code goes to the next line after loop

#

which is setCancelled(false)

#
@EventHandler
public void onMachinePlace(BlockPlaceEvent event) {
    Block block = event.getBlock();
    if (block.getType() != Material.GOLD_BLOCK) return;
    event.setCancelled(true):
    for (double x = block.getX() - 5; x <= block.getX() +5; x++) {
        for (double z = block.getZ() - 5; z <= block.getZ() +5; z++) {
            for (double y = block.getY() - 5; y <= block.getY() +5; y++) {
                if (block.getWorld().getBlockAt((int) x, (int) y, (int) z).getType() == Material.GOLD_BLOCK) {
                    Bukkit.getLogger().info("Gold block within 5 block radius.");
                    return;
                }
            }
        }
    }
    event.setCancelled(false);
}```
#

like this

wispy wyvern
#

i'll try

fluid river
#

if this doesn't work, then you need one more line in the loop

heavy mural
wispy wyvern
fluid river
#

your dependency

fluid river
heavy mural
#
    <dependency>
            <groupId>org.spigotmc</groupId>
            <artifactId>spigot</artifactId>
            <version>1.19.3-R0.1-SNAPSHOT</version>
            <scope>provided</scope>
            <classifier>remapped-mojang</classifier>
        </dependency>```
Thought this dependency would cover it hmm
wispy wyvern
#

idk, i need to go now, i'll try again later

#

see ya, and thanks for the help anyways

fluid river
#
@EventHandler
public void onMachinePlace(BlockPlaceEvent event) {
    Block block = event.getBlock();
    if (block.getType() != Material.GOLD_BLOCK) return;
    int pX = block.getBlockX(), pY = block.getBlockY(), pZ = block.getBlockZ();
    for (int x = pX - 5; x <= pX + 5; x++) {
        for (int y = pY - 5; y <= pY + 5; y++) {
            for (int z = pZ - 5; z <= pZ + 5; z++) {
                if (x == pX && y == pY && z == pZ) continue;
                if (block.getWorld().getBlockAt(x, y, z).getType() == Material.GOLD_BLOCK) {
                    Bukkit.getLogger().info("Gold block within 5 block radius.");
                    event.setCancelled(true);
                    return;
                }
            }
        }
    }
}```
#

here it is

#

should work 99%

#

@wispy wyvern

rose aspen
#

Hello friends, do you know any good "image map api"?

Currently i'm working on a coupon project, where players can interact with fancy looking Material.FILLED_MAP items.
I tried the built-in map api, but somehow after a server restart, the map gets empty and won't stack with the new "same maps".

fluid river
#

🚨

tawny remnant
livid dove
fluid river
#

cancelling block placement of gold if there is another gold block nearby

young knoll
#

Can’t have too much gold in one place

fluid river
#

yes

young knoll
#

Might cause a local economic collapse

fluid river
#

true

tawny remnant
#

the cooldown one?:

heavy mural
# fluid river your dependency

are you sure?

import org.bukkit.craftbukkit.v1_19_R2.CraftWorld;
import net.minecraft.network.protocol.game.ClientboundSetEntityDataPacket;
import net.minecraft.world.entity.Entity;
import net.minecraft.world.entity.EntityType;
import net.minecraft.world.entity.decoration.ArmorStand;
import net.minecraft.world.level.Level;
import net.minecraft.network.Connection;
import net.minecraft.network.protocol.Packet;
import net.minecraft.network.protocol.game.ClientboundAddEntityPacket;```
all other imports seem to work, just not the EntityArmorStand one
fluid river
#

it should be ArmorStand i guess

heavy mural
#

hmm okay

fluid river
#

EntityArmorStand might be nms one

heavy mural
#

yah I am trying to get the nms one

tawny remnant
#

meaning?

livid dove
tawny remnant
#

meaning

#

how do i fix it

heavy mural
#

hmm

young knoll
#

EntityArmorStand was the spigot mapping name iirc

fluid river
#

need to change 5 to radius

tender shard
#

now paper stopped updating their javadocs

fluid river
#

the only possible reason

#

if you are getting nms one

tender shard
#

paper added a boolean to all SErverListPingEvent constructors, making it incompatible with spigot again, and don't even mention that in their javadocs

fluid river
#

cool

#

hello alex

tender shard
#

hi

young knoll
#

The mojmap import is

#

import net.minecraft.world.entity.decoration.ArmorStand;

fluid river
#

how's it goin'

heavy mural
#

so that would work too?

tawny remnant
fluid river
#

it would be armorstand too, but not org.bukkit.entity

tender shard
#

cooldowns is null

fluid river
#

your cooldowns map is null

tender shard
#

btw why are yo uusing a plain map? I usually use a proper class for cooldowns so you don't have to recode the whole logic if you need a second cooldown

fluid river
#

maybe use 👀 to read 📖

heavy mural
#

My problem might've been that I join on 1.19.4 (latest). While my code with NMS is 1.19.3 (Things might've changed)

#

oops

young knoll
#

No

#

.4 contains a ton of server content

heavy mural
#

ah nonetheless still errors, welp time to attempt fix

#

Caused by: java.lang.ClassNotFoundException: net.minecraft.world.entity.decoration.ArmorStand sadge times

tender shard
#

you didnt remap your jar

#

?nms

heavy mural
#

thought I did :o

#

I'll redo

tender shard
#

if you would have remapped, it would be called net.minecraft.world.entity.decoration.EntityArmorStand instead

heavy mural
tender shard
#

what the heck are you doing

#

in your code you must use the remapped name

#

which is just ArmorStand

#

?nms

young knoll
#

And then maven will remap things when you build

livid dove
# fluid river cringe

Ready for the big cringe?

Block place event

If its Gold block:
Grab x,y,z and save to an array list that is within a hashmap of chunks and lists (saved somewhere and initialised on enable).

Look for any locations that is:

Block-5<Location<Block+5

You've just turned a max of 125 loops into potentially less than 10

keen horizon
#

Could anyone help me merge 2 plugins so they both work at the same time they are simple combat plugins dual weild and perry plugin

livid dove
#

I could have a gander ^_^

undone axleBOT
tender shard
#

or are you trying to do this yourself? if so, what's the issue

keen horizon
pseudo hazel
#

i see

#

should be just about editing some event then right

#

like where it checks for the hand to parry

keen horizon
#

Ye

#

I would prefer if it was like i could use my dual weilding when not shifting and only perry when shifting which is in the config for dual weilding but not for perrying

livid dove
#

Does anyone have documentation for why a lot of nbt tags are stupid smooth brain and cause server lag?

I know of the concept but wanted to do some more reading up on the issue

keen horizon
pseudo hazel
#

well I know nothing about the plugins you are trying to use

#

first of all do you have the source code for both of them?

keen horizon
#

no

tender shard
#

edit: I'm stupid, looked at the wrong version

keen horizon
pseudo hazel
#

?

#

how do you know its only 2 class files if you dont have it

keen horizon
#

i opened it with win rar

pseudo hazel
#

oh I see

#

so its obfuscated then

tender shard
#

?services

undone axleBOT
keen horizon
young knoll
#

See paper is in kind of a weird place

#

It has a much bigger share of servers than spigot, but that is only because it supports 99% of spigot plugins

pseudo hazel
#

it means they garbled it up so noone can read it

keen horizon
#

o

#

so it cant be edited

pseudo hazel
#

I mean unless you can read what the class files say

tender shard
young knoll
#

I mean if they break compat with spigot plugins their share will drop

wet breach
tender shard
#

there's many things incompatible to spigot, it's just that it's usually small things and plugin devs use workarounds to support both

#

e.g. the monster of a class I just send

wet breach
#

I simply don't care to support paper

young knoll
#

I mean I can't lie their API is wonderful

#

But spigot is just too established for it to be practical

wet breach
#

easier to base off spigot then it is paper in my opinion

tender shard
keen horizon
tender shard
#

edit: I'm stupid, looked at the wrong version

young knoll
#

Yeah that seems weird

tender shard
#

it's not even in the javadocs

#

according to the docs, the constructors are the same

young knoll
#

What even is the boolean

tender shard
#

but in reality, paper's constructors have an additional boolean parameter in every single one

tender shard
young knoll
#

Isn't chat preview gone

tender shard
#

I don't know

young knoll
#

Mojang removed it

wet breach
#

so nothing to worry about then 🙂

tender shard
#

I'm forced to use paper 1.19.2 because in 1.19.3 they added their shitty paper-plugin.yml so MockBukkit doesn't work on 1.19.3 yet

young knoll
#

Ah

#

That's probably why

wet breach
#

one day they will stop depending on spigot

young knoll
#

And their share will plummet

wet breach
#

fine by me

young knoll
#

They would need to have a place to upload paper plugins first

wet breach
#

they do

young knoll
#

Kind of

#

It's just a forums

tender shard
#

did anybody actually ever use hangar?

wet breach
#

they have a beta thing called hangar

young knoll
#

Oh did hanger actually make it to beta?

opal juniper
#

yep

#

its quite good actually when it isnt hanging

young knoll
#

heh

#

No premium tho, how else will people exploit server owners make money

wet breach
#

anyways, I will be glad once paper is its own thing and then I don't have to hear about it hopefully anymore 🙂

tender shard
#

well people regularly join my discord because my plugins don't run on fabric

young knoll
#

And then devs will be forced to support it

wet breach
#

not me

young knoll
#

And then you'll need yet another implementation module

wet breach
#

people can complain all they want if my plugins don't work on some implementation I don't support anyways

#

not going to make me do anything about it lol

grizzled oasis
#

its possible to pick the particle of a specific block and use World#spawnParticle

wet breach
#

o.O

tall dragon
tall dragon
#

it will also play the block break sound tho. not sure if you can do it with just the particles

#

probably with packets but idk with the api

young knoll
#

You can

#

BLOCK_CRACK - Uses BlockData as DataType
BLOCK_DUST - Uses BlockData as DataType

grizzled oasis
tall dragon
tall dragon
#

and u supply BlockData of whatever block u wanna display particles as T

grizzled oasis
tender shard
#

why is there both a listener and an EventExecutor? Which of those am I going to use for the actual event listening logic? o0

wet breach
#

or if you have an event class that extends

tender shard
#

it's actually to listen to normal events, I've used it before

#

it's so weird lol

eternal night
#

generally only ever implemented by the server

#

would not touch that if possible

tender shard
#

hm the javadocs don't say anything about it, and it's declared in PluginManager, not in SimplePluginManager

#

I just need it for a test class

eternal night
#
EventExecutor executor = new EventExecutor() {
    @Override
    public void execute(@NotNull Listener listener, @NotNull Event event) throws EventException {
        try {
            if (!eventClass.isAssignableFrom(event.getClass())) {
                return;
            }
            // Spigot start
            boolean isAsync = event.isAsynchronous();
            if (!isAsync) timings.startTiming();
            method.invoke(listener, event);
            if (!isAsync) timings.stopTiming();
            // Spigot end
        } catch (InvocationTargetException ex) {
            throw new EventException(ex.getCause());
        } catch (Throwable t) {
            throw new EventException(t);
        }
    }
};
#

this is the impl

#

basically its job is to trigger the listener event

#

or "execute" the listener

#

people do some nasty stuff in there from time to time

tender shard
#

weird, why is it in PluginManager and not in SimplePluginManager then :/

eternal night
#

you can do some dynamic type registration with it

tender shard
#

if I wanna return a CompletableFuture of which I already have the value, I'd do it like this right?

    public static CompletableFuture<String> getEffectiveMotd() {
        if(LOCALHOST == null) {
            return CompletableFuture.completedFuture(Bukkit.getMotd());
        }
        // Otherwise do some actual async stuff and use supplyAsync
opal juniper
#

yep

tender shard
#

thx

opal juniper
#

or do like some either thing but that looks good to me

tender shard
#

I wonder what the listener is needed for

#
    @Test
    public void testMotdEvent() throws ExecutionException, InterruptedException {
        getServer().getPluginManager().registerEvent(ServerListPingEvent.class, new Listener() {
            @EventHandler
            public void onListPing(ServerListPingEvent event) {
                System.out.println("Listener called");
            }
        }, org.bukkit.event.EventPriority.NORMAL, (listener, event) -> {
            System.out.println("EventExecutor called");
        }, getPlugin());

        String motd = ServerUtils.getEffectiveMotd().get();
        System.out.println("Motd: " + motd);
    }

this only prints "EventExecutor called"