#help-development

1 messages · Page 398 of 1

quaint mantle
#

i am running it in an async thread.

sterile axle
#

Looks ok to me yes

quaint mantle
#

i dont do http requests in the main thread lol.

rotund ravine
#

That’s good

sterile axle
#

I'm not sure if update() can throw an exception but if it does, then technically it's not handled there

#

But the docs don't say that it does

#

So i think you're ok

quaint mantle
#

.get() method there throws an Exception.

#

but i am throwing the exception anyway, to worry about later.

sterile axle
#

Yeah but only if the future is cancelled or it completes exceptionally

rotund ravine
#

It will probably throw one if he’s rate limited

sterile axle
#

True

quaint mantle
#

does mojang rate-limit their apis?

#

this may run more than just a few times.

sterile axle
#

Only if you smash it super hard.

rotund ravine
#

^

sterile axle
#

you could implement your own caching to avoid the rate limit

#

but, in most cases, it doesn't come up

quaint mantle
#

does the server not cache on its own?

#

whenever a player joins?

#

can i not use that?

sterile axle
#

it does

quaint mantle
#

how do i get it?

rotund ravine
#

According to google. 600 requests in 10 min is their limit.

quaint mantle
wet breach
#

there is 2 rate limits depending on what you are doing

sterile axle
#

yes; you can modify your code a bit for that

quaint mantle
#

i am just gonna use the locally stored username.

#

but how do i get it?

wet breach
#

600 is for player lookups, and then there is another for general API

quaint mantle
#

i assume server stores a player username because it also has to store stuff like player statistics?

rotund ravine
#

Ehh, it’s probably in some json

#

Else it’s in their player.dat file

rotund ravine
quaint mantle
#

May use namemc

sterile axle
#
public static String getPlayerUsername (String uuid) throws Exception {
        OfflinePlayer offlinePlayer = Bukkit.getOfflinePlayer(uuid);
        PlayerProfile playerProfile = offlinePlayer.getPlayerProfile();

        if (offlinePlayer.isOnline()) {
            return playerProfile.getName();
        } else if (playerProfile.getName() != null) {
            // server had it cached
            return playerProfile.getName();
        } else {
            // have to request it
            CompletableFuture<PlayerProfile> completableFuture = playerProfile.update();

            playerProfile = completableFuture.get();
        
            return playerProfile.getName();
        }
}
rotund ravine
#

Don’r think so @quaint mantle

quaint mantle
#

I think there less limits

sterile axle
#

you can clean that up a bit

#

but the essence is there

rotund ravine
quaint mantle
#

the server caches it?

#

ok.

sterile axle
#

it saves it in the world data yes

quaint mantle
#

i just randomly tossed in a uuid.

#

of a player that possibly never joined the server, ok then.

sterile axle
#

if they never joined the server ever, it will request every time

#

the server only caches it if they join once and leave

quaint mantle
#

i dont think i need data of players that never joined in this case, so just the offline player object might be sufficient actually.

rotund ravine
#

👌🏻

sterile axle
#

yea if they have joined at least once you shouldn't even need to worry about the profile. data should be in OfflinePlayer

remote swallow
#

iirc OfflinePlayer.hasPlayedBefore then you can probably check there data

charred blaze
slim pier
#

How to remove recipes?

rough ibex
slim pier
#

some

rotund ravine
#

?jd-s

undone axleBOT
rotund ravine
#

Recipeiterator

#

Look for it

sullen marlin
#

RecipeIterator#remove

slim pier
#

thanks

quaint mantle
#

What's the best way to edit .jar plugin file? (add more function, edit public, private etc...)

remote swallow
#

get the source

slim pier
#

recipe remove when reload?

lost matrix
rough ibex
slim pier
#

when server reloading then my custom recipe delete

regal scaffold
#

How can I add sections in IntelliJ to like group pieces of code so it's more organized?

lost matrix
#

You speaking about packages?

rough ibex
#

or just visually?

regal scaffold
#

Visually

#

Like just individual classes

rough ibex
#

In the tree view you can Show Members

regal scaffold
#

Like I want to group different methods in the file itself

#

Ah fair

#

I can fold everything and move it around

remote swallow
#

am i correct in saying an srv record for http/https is _xmpp for server, _tcp for protcol, 10 priority, 5 weight, port, target domain

rough ibex
#

Look for 'separators'

lost matrix
#

Prio on http is rarely used

lost matrix
remote swallow
#

adding reposlite to domain with repo.domain

#

bc it has a port

lost matrix
#

And what do you need xmpp for then?

remote swallow
#

no idea

#

i was just following stuff i found online KEKW

lost matrix
#

classic 😄

charred blaze
eternal oxide
#

because you remove both the payer and target from duels when either dies or quits

charred blaze
#

umm

#

wait when i do return; in CommandPreProccessEvent it cancells?

eternal oxide
#
Duels.requests.remove(player.getUniqueId());```
charred blaze
eternal oxide
#

um no returnign shoudl not cancel

charred blaze
#

if (!Duels.requests.containsKey(player.getUniqueId())) {
return;
}

#

so it wouldnt be cancelled right?

#

whats wrong

eternal oxide
#

if they were correctly removed

charred blaze
charred blaze
eternal oxide
#

bothrequest.getIsInGame() and Duels.requests.containsKey(player.getUniqueId()) is true in your onCommand if they can;t issue commands

charred blaze
#

but why

#

didnt i remove player's uuid from requests?

#

ill do some debugging...

eternal oxide
#

did you? I see a remove but no clue what is behind the code you've shown

#

add debug so you can see

heavy mural
#
  @EventHandler
  public void onPlayerInteract(PlayerInteractEvent event) {
    Player player = event.getPlayer();
    Block clickedBlock = event.getClickedBlock();
    if (clickedBlock == null) {
      return;
    }
    Material material = clickedBlock.getType();
    boolean interactable = material.isInteractable();
    player.sendMessage(material.toString());

    if (!interactable) {
      player.sendMessage("test");
      return;
    }
    player.sendMessage("test2");
}```

Hello,
I wrote out this little class for my 1.19.3 server but it keeps saying "test" even though I click on levers, buttons and doors. 

I also print the Material and it states that I am clicking in levers, buttons and doors yet it returns "test". Which means they are not interactable. Why could this be?

If I click on any other blocks it also presents me with "test".

In the documentation it states that it should work for the purpose I want to use it for, but I might've missed something?
https://hub.spigotmc.org/javadocs/spigot/org/bukkit/Material.html#isInteractable()
charred blaze
#

everything is interactable (as i know)

regal scaffold
#

Is there a better way to locally organize a file? I collapsed it all to be sendable here

eternal oxide
#

um use camel case for variable namesMaterial Material = clickedBlock.getType(); boolean interactable = Material.isInteractable();

regal scaffold
#

It's like 300 lines long

eternal oxide
#
boolean interactable = material.isInteractable();```
heavy mural
charred blaze
#

but cannot you interact on blocks?

heavy mural
heavy mural
eternal oxide
#

where are you displaying that message as it's not in the preprocess

charred blaze
#

this code is yesterday's

#

wait ill upload you latest code

eternal oxide
#

might be helpful

charred blaze
#

(it wasnt working on yestarday too btw)

eternal oxide
#

there was no message from the PlayerQuitEvent

charred blaze
#

oh right

#

ill add debugging

#

ill just print target's and player's uuids on both events

#

i think that l be enough

#

i think they arent same

#

QuitEvent isnt executing at all lol

heavy mural
charred blaze
#

issue was in this statement. one "!" missing. wasted 2 days. lmao

coral shuttle
#

Can you get the ChatColor of a display name on an item using ItemMeta?

tacit drift
heavy mural
#

I also noticed that if I click on new blocks like deepslate it sends me that it's "AIR"

eternal oxide
#

missing API version in plugin.yml?

heavy mural
#

yah could be it

heavy mural
eternal oxide
#

api-version: 1.19

heavy mural
#

ty

#

Ah that fixed it all

#

Huge

#

ty

eternal oxide
#

no idea what you are actually asking

#

add a random offset?

#

loc.clone().add(random, 0, random)

#

then get highest block

#

because when altering the location you may be inside something

#

create a method which takes a location and returns a cloned location plus a random offset

#

you can do all yoru safety checks in there

regal scaffold
#

Man, updating a hologram still requires the player to reconnect

#

I wonder if maybe a good solution is destroying the current hologram and spawning a new one...

#

Seems like a big waste

#

Or, removing the lines and readding them without deleting the object

lost matrix
regal scaffold
#

Yessir

#

At this point smile

#

I'm using all your stuff bruh

#

Stop

lost matrix
regal scaffold
#

Man, up to this point I was using DecentHolograms as a dependency

#

It doesn't seem terrible to implement my own but...

lost matrix
#

Well DecentHolograms is not bad. They support updating lines on the fly.

regal scaffold
#

Well, I'm trying to do pages with DH

#

And I just can't

#

It just won't update unless the player doesn't reconnect, so I assume, unload/reload chunk

remote swallow
#

DecentHolograms.update iirc

regal scaffold
#

I've done all 6 different versions of it

#

hologram#update
hologram#updateAll()
hologram#swap
DHAPI#updateHologram

#

It just refuses to update unless reconnect

#

When I say update, I mean, change the page

lost matrix
#

There is still the possibility that you update the wrong hologram

regal scaffold
#

So alternatively, I can just remove all the lines

#

No, impossible, using the same object

lost matrix
#

Hm

regal scaffold
#

I checked the data for the hologram too

#

And it contains 2 pages, and the swap actually does execute. and it does swap. Only updates for the player view when I reconnect

#

?paste

undone axleBOT
regal scaffold
#

These are my test cases

#

I've tried 20 things before that

#

Even thought it was a delay issue lol

#

Like I said, the page changes for the user view when I reconnect

lost matrix
#

Hm let me test that out

regal scaffold
#

Damn thanks!

#

I can send a vid if you need in 10 seconds

lost matrix
#

Ill just read the api real quick, all good

regal scaffold
#

I wanted to add clickable holograms sincde it's literally done in 1 up to date plugin but I thought about a good workaround with just the 1 hologramClickEvent

regal scaffold
#

What

#

tf

lost matrix
#

Really only a few lines

regal scaffold
#

Oh you're doing it differently

#

Alright that makes sense

#

Appreciate it a lot

lost matrix
#

Wait... they even have native page support

regal scaffold
#

Yes which I did use

#

Now I wonder

#

Is it better to implement my own

#

Or, is it worth it

#

DH is so used,

rotund ravine
#

Ignore me

#

?jd-s

undone axleBOT
quaint mantle
#

is there a way to compile and launch minecraft at the same time just like with modding?

#

something does not seem to work and i keep having to just compile the jar, stop the server, copy and paste it, start the server again, join the game, and keep doing it over and over.

#

it is kind of making me sick.

tacit drift
quaint mantle
#

especially when debugging stuff that requires a lot of trial and error.

tacit drift
#

but I hope that people do switch to DH as it seems a lot better

hybrid spoke
#

?bing it

undone axleBOT
quaint mantle
#

bing?

hybrid spoke
#

bing.

quaint mantle
#

bing?

tacit drift
#

Look at how Fabric does it

#

probably gonna need to use gradle

quaint mantle
#

this is painful.

hybrid spoke
#

its a configuration, no specific build tool needed

quaint mantle
#

so, what is the configuration?

#

aside from the bad choice of search engine though?

hybrid spoke
#

as i said

#

?bing it

undone axleBOT
hybrid spoke
quaint mantle
#

i dont use bing.

#

anyway.

hybrid spoke
#

who the fuck cares

analog thicket
#

Hey im having a little problem, with my crate plugin. So atm im making a check if a player quits the server, but if there isnt anyone to load the crate stuff it does not work. But if there is a player to load it it works fine.. How would i fix this?

#

If that makes sense

tacit drift
#

Ask the Bing AI how to do it

quaint mantle
#

is the ai actually good?

tacit drift
#

it's ChatGPT but connected to the internet

hybrid spoke
tacit drift
#

so it's actually godly

quaint mantle
#

it is?

tacit drift
#

yeah

regal scaffold
#

CMI's hologram implementation

tacit drift
#

and isn't as censored

regal scaffold
#

Is about 3k lines

#

That's insane

eternal oxide
lost matrix
regal scaffold
#

It's the only one out there that has clickable holograms which is updated. Was just wondering how they do it

quaint mantle
#

can it write code and do math like chatgpt?

hybrid spoke
analog thicket
quaint mantle
#

oh no i am already distracted.

analog thicket
#

kinda hard to explain

hybrid spoke
#

you can give the chunk a pluginticket so it wont unload

eternal oxide
#

add a plugin chunk ticket until you have finished with the chunk

hybrid spoke
#

and once you removed the stuff remove the ticket

remote swallow
#

i see dh more

remote swallow
regal scaffold
#

Either way, DH only supports single action per hologram and HD doesn't support any

remote swallow
#

because they use armor stands

regal scaffold
#

That's not the issue tho

remote swallow
#

dh can also do papi and block display

#

which is cool

regal scaffold
#

Because I wanted clickable buttons

lost matrix
#

There is probably a more resourceful way than keeping the chunk loaded.
For example remove the stuff the next time your chunk is loaded.

tacit drift
#

Hd also has papi

#

but anyway

regal scaffold
#

I wanted to have clickable stuff in the GUI like CMI does it ( Apologies for the terrible example )

lost matrix
regal scaffold
#

See but I don't think it's worth doing all that

lost matrix
#

*Because click on air are not registered

regal scaffold
#

But how has no one done it

lost matrix
#

I got that in my personal lib 😛

regal scaffold
#

Why out of everyone, cmi is the only one to have it

#

Ok that's just toxic

#

Leak 👀

lost matrix
#

You need click boxes and then work with vectors on those boxes.
The boxes can be accomplished by packet based invisible entities.

analog thicket
#

Is there a way to make a single onPlayerQuit. I use player.isOnline, and if the player isn't it removes, but this wont work if there isn't a player loading.

But if i try making a onPlayerQuitEvent i can't register the armorstand and all that.

regal scaffold
#

I'm still gonna implement my own like in your guide

analog thicket
#

Im so bad at explaining

#

-.-

remote swallow
#

whats your end goal

analog thicket
#

I want to remove the armor stand and reset their open status

#

if they leave

regal scaffold
#

Do you use CF in all your plugins smile?

eternal oxide
analog thicket
eternal oxide
#

that question makes no sense

#

in the quit event the player will still be online

#

and there is no reason you can;t get the armorstand in the quit event

analog thicket
#

Okay so i have a armor stand. If a make a quit event i need to add

stand.remove()

But i can't if i dont have the stand?

eternal oxide
#

then get the stand you want to remove

analog thicket
#

onPlayerQuit(stand); Like this right?

eternal oxide
#

no

rotund ravine
#

No

#

?learnjava!

undone axleBOT
eternal oxide
#

PlayerQuitEvent

analog thicket
#

Yeah i know

#

i aint stupid

rotund ravine
#

Seems like it. No offense

eternal oxide
#

ok bye, end of support from me

analog thicket
#

but i would still need to send the stand from the animation event?

#

and for that i need ìf(!player.IsOnline) in alot of places

rotund ravine
#

You would need to pass it yes. You can not pass it to your eventhandler in the parameters

eternal oxide
#

?basics

undone axleBOT
eternal oxide
#

no you don't, your questions are crazy and unrelated

analog thicket
eternal oxide
#

you must already have yoru stand referenced somewhere

analog thicket
#

Yep i do

eternal oxide
#

so you fetch that in your quit event

analog thicket
#

oooh

eternal oxide
#

fetchign the stand has no relation to wether the player is online or not

analog thicket
#

I think i get it now

#

Thanks

quaint mantle
#

best way to create custom inventories with cancelled clicks? for some reason when i did it with the oninventoryclick event and cancelled it, it create duping methods all over my game (might have to do with viaversion idk)

ivory sleet
#

I like InventoryHolder based inventory designs

quaint mantle
#

hi

quaint mantle
eternal oxide
#

I like an inventory Map<Inventory, Consumer> design

quaint mantle
ivory sleet
#

Well, its hard to state the exact source of your problems without having any code to look at

undone axleBOT
ivory sleet
eternal oxide
#

event

quaint mantle
#

nvm, i am not familiar with the ? commands.

#

on this server.

#

i used a system where i put a custom tag on an item and just if u click any item it checks if it has that tag and if it does it cancels it

eternal oxide
#

Consumer<InventoryEvent>

tardy delta
#

why did those idiots at mojang not just specify "tag": "coals" instead of giving me an unexpected array that breaks my parser

ivory sleet
#

Why not :)

ivory sleet
tardy delta
#

also wrapping a json object was a bad decision but atleast it looks cleaner

ivory sleet
#

Fourteen I have an idea which might sound crazy

tardy delta
ivory sleet
#

You shade in entire nms jar

graceful oyster
#

So ingame you can send titles to players using /title command, and this covers titles, subtitles and actionbars.
/title <targets> (title|subtitle|actionbar) <title> /title <targets> times <fadeIn> <stay> <fadeOut>
Does anyone know how to send actionbar messages to players in spigot? I can only see methods for titles and subtitles.

ivory sleet
#

And use its recipe classes instead of writing ur own hehe

tardy delta
#

uhm

ivory sleet
#

Then Player.Spigot#sendMessage(ChatMessageType, …)

tardy delta
#

still should have a minestom impl of the recipes, id rather use the nms recipe parser if that even exists

#

just lemme have fun lol

ivory sleet
#

I was just joking a bit, cause their recipe classes kind of are coupled with other nms stuff

#

:>

tardy delta
#

heehee

quaint mantle
#

are you making a minecraft mod?

tardy delta
#

nah, working on a server impl

regal scaffold
#

@lost matrix Do you have any premium plugins?

lost matrix
#

Nope

ivory sleet
#

He doesnt, but I bet he can turn Survival fly crystal into one, once it becomes actively developed on again

lost matrix
#

XD

#

No pls no

ivory sleet
#

Oh yes, definitely looking forward to that

tardy delta
#

is that stuff thinking im on linux or what

regal scaffold
#

Why have you decided not to make any with all your knowledge smile?

ivory sleet
#

Premium plugins are effort taking

#

dont get me wrong, you can probably have some fun and earn great deal

regal scaffold
#

He has the knowledge though, he could easily make one

#

I wonder if there's another reason

quaint mantle
#

do you ever get an error that does not make sense no matter how many times you look at the code?

ivory sleet
#

Yep

#

When I worked with bytecode manipulation

tardy delta
#

error at line 150 when my code has only 120 lines

quaint mantle
#

you what?

ivory sleet
#

That shit trolled the living soul out of me

quaint mantle
#

why are you working with bytecode?

ivory sleet
#

Ehm, cause nms stupid

quaint mantle
#

nms?

ivory sleet
#

Native minecraft source

lost matrix
quaint mantle
eternal oxide
#

Mnay reasons to use bytecode. Code inection is but one. I did a lot of it on teh game Neverwinter Nights

quaint mantle
#

imagine having as much money as mojang and microsoft and still make struggle to make a good block game.

ivory sleet
lost matrix
#

Its python. Thats basically scripting in my books.,

regal scaffold
#

Smile why you lying huh

ivory sleet
#

I think some limitations lay within the language of Java

regal scaffold
#

I was expecting my javadocs and source code

ivory sleet
#

But that will as time goes fix itself

lost matrix
regal scaffold
#

Smile over here promising us stuff on his plugins

#

And blatantly lying

#

rip

ivory sleet
#

Fr

regal scaffold
quaint mantle
#

minecraft, a billion dollar game, owned by a trillion dollar multinational corporation with probably like 1000 employees working at mojang, all for a block game.

regal scaffold
#

Premium plugin potential

quaint mantle
#

still so terrible.

ivory sleet
#

O shit, Eclipse user

quaint mantle
#

probably not even too good.

lost matrix
#

I want this deleted but i dont know how...

regal scaffold
#

Former

#

Report yourself

#

Like the plugin

ivory sleet
regal scaffold
#

And change description and title to "delete please"

ivory sleet
#

Cause then people could have horizontally scalable servers

ivory sleet
#

Dont u dare

quaint mantle
#

you could use nginx with bungeecord.

#

not sure how you are gonna get the players to sync up.

ivory sleet
#

Sorry but bungee isn’t that… well, ehm, scalable

quaint mantle
#

?paste

undone axleBOT
ivory sleet
#

Its fine tho

regal scaffold
#

redis bungee

#

lol

ivory sleet
#

And yeah nginx isnt bad

#

But this hasnt anything to do with web servers etc

quaint mantle
#

but you could use nginx though.

ivory sleet
#

So that’ll just be involving redundant layers

regal scaffold
#

What for lol

quaint mantle
#

or any other reverse proxy i guess.

regal scaffold
#

What does nginx accomplish in minecraft server

ivory sleet
#

Yea

regal scaffold
#

xd

quaint mantle
#

it load balances.

ivory sleet
#

^

#

Also yes

#

Redis could be quite necessary

#

(Presupposing its correctly configured)

quaint mantle
#

i guess you could maintain a cache with that.

#

to use across servers.

ivory sleet
#

Yea, and for message broking, probably rabbit?

#

Actually, it might not even be worth using rabbit

quaint mantle
#

there are better message queues probably than redis though.

ivory sleet
#

Just a simple socket

tardy delta
#

is this a json comment lol?

ivory sleet
#

Yes

#

Really cursed ikr

tardy delta
#

ive probably been doing too much html

quaint mantle
tardy delta
#

it wouldnt surprise me if gson would load the comment into the json object too 💀

ivory sleet
#

Pjoens

#

Use getClickedInventory

#

iirc

quaint mantle
#

just cancel it when its that inventory?

#

yep.

ivory sleet
#

Yes

quaint mantle
#

also why does my intellij sometimes take up 60% of my cpu and then freezes, any1 know that here?

#

because it is written in java.

#

just make sure you are not running background tasks.

ivory sleet
quaint mantle
#

well im kinda hosting a server and a database locally on my pc, also a game

#

make sure maven or something else isnt running the background all the time probably.

quaint mantle
#

well the cancel works the same as before, the half duping thing is still there

#

i can send a video showing what i mean if it helps

ivory sleet
#

Yeah sure

#

That’d certainly clarify the issue

tardy delta
#

ig that works

#

i can now begin to load the other 500 recipes 💀

ivory sleet
#

Epic

tardy delta
#

man stealing the gui

ivory sleet
#

1 sec

#

?jd-s

undone axleBOT
ivory sleet
#

You need to handle InventoryDragEvent also

#

iirc?

lost matrix
#

How about you do this:
If a player clicks a gui -> cancel the event.
No exceptions. Simply cancel the event.

#

And drag is not fired if click was cancelled

ivory sleet
#

Yeah good point

lost matrix
#

Wait you are checking the nbt tag of every item that was clicked? ...

quaint mantle
#

well i used to

#

not anymore

quaint mantle
#

i can still grab items but i cant put them in my inventory anymore

#

oh i can

#

just not place

#

do u think its a viaversion problem

lost matrix
#

If you are experiencing ghost items then that could be caused by viaversion.
But cancelling the InventoryClickEvent will simply prevent a player from doing
anything to the inventory at all (At least on the server side).

quaint mantle
#

yea its the ghost items part

#

is there any way to fix that?

native gale
green prism
#

Hello! What's the easiest way to create that 5/4/3/2/1 start Timer-Title?

tardy delta
#

?scheduling

undone axleBOT
lost matrix
green prism
tardy delta
#

just run a task every second which decrements a timer and cancels itself when 0

native gale
lost matrix
#

proxy being bungeecord

native gale
#

Okay

regal scaffold
#

Smile, what if I give each armor stand a UUID and then check clickable with packets

quaint mantle
#

what if instead of via version i based my plugin on 1.7.10 or 1.8

#

nah bad idea

lost matrix
green prism
#

How can I get a BukkitRunnable Task ID?

regal scaffold
#

Ah makes sense

#

Man

#

So let me get this straight smile

#

You get the middle of the hologram on click

#

And then use vectors to see where it clicked

native gale
tardy delta
# green prism How can I get a BukkitRunnable Task ID?

no no no, do it like this: java AtomicInteger countdown = new AtomicInteger(5); Bukkit.getScheduler().runTaskTimer(plugin, task -> { int time = countdown.getAndDecrement(); if (time == 0) { task.cancel(); return; } // broadcast }, 20);

lost matrix
lost matrix
ivory sleet
#

singleton array (:

tardy delta
#

ye i was thinking about creating a class too but too much type work

ivory sleet
#

Why the clown :(

lost matrix
#
    new BukkitRunnable() {
      private int counter = 0;
      @Override
      public void run() {
        if(--counter == 0) {
          this.cancel();
        }
      }
    }.runTaskTimer(this, 20, 20);

Something like this

ivory sleet
#

Its a fairly reasonable solution

#

int count[] = {0};

#

or sth

tardy delta
#

var count = {0} hmm

native gale
lost matrix
#

apache MutableInt is also viable.

ivory sleet
#

Didnt that get yeeted

regal scaffold
tardy delta
#

IntSets.Singleton lol

lost matrix
#

Or you do this and increment the counter via reflections

    Object obj = new Object() {
      int counter = 0;
    };
ivory sleet
#

just use var

#

It will expose the counter field

tardy delta
#

🤔

#

im having js flashbacks now

lost matrix
#

XD yes but then you dont need reflections

ivory sleet
#

Yeaaa

tardy delta
#

oh vars on class level arent working

native gale
#

Well, okay, what I want to achieve in pseudocode ```onSomethingHappened() {
Broadcast a message to every player on the server;

if (BungeeCord is enabled) {
Also, broadcast this message to every player on all other servers as well;
}
}

lost matrix
#

Alright i think this is the best solution:

    var veryNecessaryVar = new CraftWorld(null, null, null, null) {
      static transient volatile AtomicReference<MutableInt> counter = new AtomicReference<>(new MutableInt());
    };

    new BukkitRunnable() {
      @Override
      public void run() {
        if (veryNecessaryVar.counter.get().decrementAndGet() == 0) {
          this.cancel();
        }
      }
    }.runTaskTimer(this, 20, 20);
lost matrix
sinful kiln
#

Wouldn't a CraftServer instance be better than a CraftWorld?

regal scaffold
#

int counter = 0

#

What's going on there that is different

rotund ravine
#

It’s a joke lol

regal scaffold
#

Ok bro I quit lol

ivory sleet
#

the variable must be effectively final, since it gets mutated inside the lambda

regal scaffold
#

I was actually so confused

native gale
lost matrix
tardy delta
#

could alwyays create an anonymous Consumer<BukkitTask> with that field

#

but uhh a record?

native gale
#

Well, anyways, let it be

#

I just had hope that there's a simpler way

orchid gazelle
#

Hi. I want to have entities(mainly armorstands in invisible which just display some visual things like a specific head). Is this gonna be realistic to be performant? And if yes, how would I minimalize the performance needed?

#

Note that this is a massive amount of entities, like 50-100 per chunk on a populated chunk

quaint mantle
#
    @EventHandler
    public void onPlayerJoinEvent (PlayerJoinEvent event) {
        Bukkit.getScheduler().runTaskAsynchronously(ChunkClaimsPlugin.getThisPlugin(), () -> {
            new TrustedPlayersData(event.getPlayer());
        });
    }```
#
    private static HashMap<Player, TrustedPlayersData> playerDataHashMap = new HashMap<Player, TrustedPlayersData>();

    public TrustedPlayersData (Player player) {
        this.player = player;

        playerDataHashMap.put(player, this);
    }```
#

it returns null when i tried to get the TrustedPlayerData object for the player key.

hazy parrot
#

Any reason for you doing it async?

#

Also use uuid for key

quaint mantle
#

no way.

#

i forgot to register the event handlers.

#

i have been fiddling with this for a while now.

#

and it was this simple.

#

bruh.

quaint mantle
hazy parrot
#

There is no reason to run this piece of code async

quaint mantle
#

whenever things dont need to run on the same thread as the game.

hazy parrot
#

Nothing here is blocking

quaint mantle
#

mostly performance i guess.

#

to keep up the tps.

#

i do that with most things.

hazy parrot
#

Async == performance uwu

quaint mantle
#

is it not?

#

as long as you have the cpu cores/threads maybe?

#

i know it looks like a few lines of code there.

#

could probably do it on the main game thread but i just did it out of habit i suppose.

hazy parrot
#

With making .put method async, you get exactly 0 performance boost

quaint mantle
#

why?

hazy parrot
#

Because... put is not blocking, it runs nearly instantly

quaint mantle
#

blocking?

hazy parrot
#

Yeah blocking, like network and io operations

quaint mantle
#

meaning it already branches out into a separate thread on its own?

#

without me having to put it in a separate thread?

hazy parrot
#

No lmao, it's just cheap operation

quaint mantle
#

ok.

echo basalt
quaint mantle
#

ik it might not be if you dont have threads available.

echo basalt
#

The overhead of feeding it to a thread pool which eventually runs async is bigger than the operation itself

quaint mantle
#

async != multithreaded.

echo basalt
#

yes

quaint mantle
#

what about disk io?

#

with a database of some sort?

echo basalt
#

IO is recommended to do async because it's a blocking operation

#

but inserting data to a hashmap is not

#

Unless you're pairing that data with IO

#

which is odd

#

In that case, I'd use a ConcurrentHashMap

quaint mantle
#

then.. is there a point to running stuff async?

lost matrix
#

javas concurrent package is godsend

hazy parrot
quaint mantle
#

and that is it?

hazy parrot
#

Disk io and network requests mostly

echo basalt
#

For example making chunk snapshots and parsing millions of blocks

quaint mantle
#

yeah i use it for that kind of heavy operation.

echo basalt
#

clearly inserting data into a hashmap is a heavy operation

#

regardless

#

If you actually want to do such crazy operations

#

The CompletableFuture class will help you

#

And before you decide to use other threads anything other than IO

#

Do a lil benchmark and see if the result is acceptable enough

#

as in

#

"if I run this multiple times will the server absolutely die"

#

and

quaint mantle
echo basalt
#

uhh no

twilit roost
#

CompletableFuture's run Async right?
So I can use Thread.sleep?

echo basalt
hazy parrot
#

If you want to use it, you are most likely doing smth wrong

echo basalt
#

Pretty sure you can just make executors that have a delay

twilit roost
#

Im waiting for some instance to be avalaible

quaint mantle
#

HashMaps don't really promise O(1) lookup though, do they?

hazy parrot
#

Doesn't complete just blocks the thread?

twilit roost
#

nope
its asymc

quaint mantle
#

in that case it might be better to use async operations?

echo basalt
#

it's not async

#

you're still doing a while loop n the same thread

#

you're just... returning your instance as a future

#

which is braindead

twilit roost
#

I meant not CompletableFuture#complete im using #get to finish the task

hazy parrot
#

Yeah, cf.comolete just blocks the thread until it's finished

echo basalt
#

not just that

onyx fjord
#

logback gud or nah?

echo basalt
#

the while loop is a busy-wait type deal

twilit roost
#

like so

echo basalt
#

oh hell naw

hazy parrot
#

Lmao

lost matrix
twilit roost
hazy parrot
#

I see that most guys here need coroutines 😂

lost matrix
twilit roost
tall dragon
#

you just have you completablefuture code wrong

#

the way u have it setup will still block the thread

hazy parrot
lost matrix
twilit roost
hazy parrot
#

You can't just "return" smth if you are running code async

echo basalt
#

.

hazy parrot
#

I mean bare result, not wrapped in cf

quaint mantle
hazy parrot
#

That is not exactly return

quaint mantle
#

yep.

tall dragon
twilit roost
echo basalt
#

edited the CF guide to be a bit more explicit about errors

tall dragon
ivory sleet
twilit roost
#

welp the problem is, I don't have a clear way to test this
so I just have to hope it will work fine

ivory sleet
#

awesome :3

echo basalt
#

Any place in specific?

twilit roost
#

Arrow For One
a minigame

ivory sleet
#

under plugin development I reckon

twilit roost
tall dragon
#

i c

echo basalt
#

how tf

echo basalt
ivory sleet
#

hmm, I can try to make it look a bit nicer once im done with my valo game

echo basalt
#

alr

#

I'll DM you the bb code

ivory sleet
#

oh no

#

u can post it

#

I can edit the wiki page after I think?

echo basalt
#

ugh

#

ok

ivory sleet
#

ye

echo basalt
#

there

ancient plank
ivory sleet
#

lmao

quaint mantle
#

guys

#

i need help

#

io.netty.handler.codec.DecoderExepction: java.lang.RuntimeException

#

some nbt storage shit

#

cant join my own server

#

ill send the full error message rq

regal scaffold
#

Has anyone seen this before

tardy delta
regal scaffold
#

Just click anything

lost matrix
regal scaffold
#

tf I just clicked it myself

lost matrix
#

Oh now im in

regal scaffold
#

Look at what it is

tall dragon
#

bruv the the text is so small i cant even read it

remote swallow
#

its only 6 now?

#

?1.8

undone axleBOT
regal scaffold
#

Open the link

regal scaffold
#

I still don't fully understand wtf it is after reading it

#

I think it's a sort of fork

remote swallow
#

it is

torn shuttle
#

quaternions more like cringetornions

lost matrix
#

Ok but what does it do? What makes it worth 50 bucks...

tall dragon
regal scaffold
#

Just on 1 website it has 500 purchases at 50usd each

#

No clue that's what I'm trying to figure out

#

Like wut

regal scaffold
#

What can possibly be worth even 50 bucks

#

Which, might I add smile

#

Read the one that says enterprise monthly, on the right side

lost matrix
#

So its a pure 1.8 fork which makes working with this version bearable

regal scaffold
#

It has even more features

lost matrix
#

Meh

tardy delta
regal scaffold
#

I'm still confused with what it really makes it worth lol

fierce whale
#

Is there a way to make vehicle?
How can I detect player moving and move the vehicle?

tardy delta
#

tf am i looking at

regal scaffold
#

looool brush

#

I have no clue either

#

So it's a mix of paper, spigot, taco and their own

tardy delta
#

let them have fun ig

regal scaffold
#

I just stumbled upon it and was hoping maybe someone here had heard of it before and had comments

tall dragon
#

pretty sure all the old faction servers used stuff like this

#

mainly for tnt cannon fixes/optimizations

regal scaffold
#

This this is expensive

#

Wut

#

Then, besides paying to use it

#

You need to get custom plugins that can actually take advantage of it

#

But we have asynctabcomplete

#

I wonder if it's up to date with optimization features from spigot/paper too

#

Like I bet a bunch of this stuff is now implemented into spigot/paper directly

#

Oh man those are some cool EventHandlers tho hehehe

tardy delta
#

this better works

#

uhh no errors?

#

does assert do anything by default?

flint elk
regal scaffold
#

?plugin.yml

tardy delta
#

dang it works

undone axleBOT
#
CafeBabe Help Menu
*Red V3*
**__Admin:__**

selfrole Add or remove a selfrole from yourself.

**__Cleanup:__**

cleanup Base command for deleting messages.

**__Core:__**

embedset Commands for toggling embeds on or off.
info Shows info about CafeBabe.
licenseinfo Get info about Red's licenses.
mydata Commands which interact with the data CafeBabe has about...
set Commands for changing CafeBabe's settings.
uptime Shows CafeBabe's uptime.

**__Downloader:__**

findcog Find which cog a command comes from.

**__Mod:__**

names Show previous names and nicknames of a member.
userinfo Show information about a member.

**__ModLog:__**

listcases List cases for the specified member.
reason Specify a reason for a modlog case.

**__Permissions:__**

permissions Command permission management tools.

eternal night
tardy delta
#

switched it to an exception and it works lol

#

still looking for a way to remove a path from a directory stream tho

flint elk
tardy delta
#

probably have to manually keep track of the files i wanna skip

#

hmm that works ig

icy beacon
#

what would this be in kotlin?

for (int x = -radius; x <= radius; x++)

this does not work ("For-loop range must have an iterator() method") and looking it up doesn't show anything useful:

for (x in -radius..radius)
#

a double

tardy delta
#

damn when from 545 to 824 recipes

icy beacon
#

?

#

adding step 1 doesn't change anything either

#

ah

#

wait

#

this works for some reason

private fun trampleCrops(player: Player, radius: Int) {
  for (x in -radius..radius) { ... }
tall dragon
#

ye cuz its an int there

icy beacon
#

why can't i do it with doubles

tall dragon
#

how would you loop from -3.5 to 4.6 for example

icy beacon
#

step?

#

and until

#

why not lol

tardy delta
#

kotlin fun bruh

tall dragon
#

it could work that way i agree. but clearly kotlin devs do not agree

icy beacon
#

guess i could go with a while loop if i really had to

#

it's ok to use int for me now though

#

tyty

quaint mantle
#

Guys how do i fix this: io.netty.handler.codec.DecoderExepction: java.lang.RuntimeException tried to read NBT tag that was too big; tried to allocate: 2097181 where max allowed: 2097152

#

i cant join my server

tall dragon
icy beacon
#

in this case yeah it could be an int

remote swallow
#

most likely a book and quil bomb

icy beacon
#

because blocks are 1 block wide (makes sense)

tall dragon
#

yea

icy beacon
#

but what if they weren't

leaden wind
#

Heyo, anyone know how to setup bungee cord? the youtube videos arent telling stuff

icy beacon
#

what if they add horizontal slabs someday 😳

quaint mantle
quaint mantle
leaden wind
tall dragon
leaden wind
flint elk
remote swallow
quaint mantle
remote swallow
#

you pretty much have to either delete your playerdata or modify it so you dont have that item stack

icy beacon
remote swallow
flint elk
icy beacon
#

like, description: ""

quaint mantle
icy beacon
#

yeah

#

or just use {}

#

could work too i think

remote swallow
tall dragon
#

cant a bunch of other things potentially contain this nbt tag @remote swallow ?

icy beacon
#

for the command decl

quaint mantle
#

isnt playerdata u just delete the one file that has ur UUID

remote swallow
#

did you delete both uuid.dat and uuid.dat-old

flint elk
remote swallow
#

you compiling utf8?

quaint mantle
#

my full UUID: 5e970a62-309d-46c3-be43-3002bdd1c1ce

icy beacon
flint elk
#
author: Lukas
version: 1.0
api-version: 1.19
main: wtf.pastix.Main

commands:
  setlocation:
    description: Command to set Locations.```
icy beacon
#

invalid CEN header (bad signature)

remote swallow
icy beacon
#

this seems like an encoding something problem

#

not sure

remote swallow
#

compile utf8

quaint mantle
icy beacon
#

probably this could help you

remote swallow
#

restart

remote swallow
#

yes

quaint mantle
#

ok

quaint mantle
remote swallow
#

not much else you could do

quaint mantle
#

but luckily i had a stash where i saved my coordinates wich my e cheest only had items that were in the stash too

#

cause i had a massive area where i duped shit

flint elk
#

at org.bukkit.plugin.java.JavaPluginLoader.getPluginDescription(JavaPluginLoader.java:166) ~[spigot-api-1.19.3-R0.1-SNAPSHOT.jar:?]

remote swallow
#

maven or gradle

flint elk
#

maven

remote swallow
# flint elk maven

in the properties tag add <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>

flint elk
#

is already there

remote swallow
#

that makes it weirder

flint elk
#
<project xmlns="http://maven.apache.org/POM/4.0.0"
         xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
         xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
    <modelVersion>4.0.0</modelVersion>
    <parent>
        <groupId>wtf.pastix</groupId>
        <artifactId>limeserver</artifactId>
        <version>1.0-SNAPSHOT</version>
    </parent>

    <artifactId>Lobby</artifactId>

    <properties>
        <maven.compiler.source>17</maven.compiler.source>
        <maven.compiler.target>17</maven.compiler.target>
        <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
    </properties>

    <repositories>
        <repository>
            <id>spigot-repo</id>
            <url>https://hub.spigotmc.org/nexus/content/repositories/snapshots/</url>
        </repository>

        <repository>
            <id>minecraft-repo</id>
            <url>https://libraries.minecraft.net/</url>
        </repository>
    </repositories>

    <dependencies>
        <dependency>
            <groupId>org.spigotmc</groupId>
            <artifactId>spigot-api</artifactId>
            <version>1.19.3-R0.1-SNAPSHOT</version>
            <scope>provided</scope>
        </dependency>

        <dependency>
            <groupId>com.mojang</groupId>
            <artifactId>authlib</artifactId>
            <version>1.5.21</version>
            <scope>provided</scope>
        </dependency>

        <dependency>
            <groupId>org.apache.httpcomponents</groupId>
            <artifactId>httpclient</artifactId>
            <version>4.5.10</version>
        </dependency>
    </dependencies>

</project>```
leaden wind
#

where can i download bungee cord?

leaden wind
#

oki

crimson mulch
#

Is bungeecord open source ?

flint elk
#

I dont think so

leaden wind
#

W

crimson mulch
flint elk
#

job not jobs

leaden wind
#

ah

orchid gazelle
#

Its open-sourced

leaden wind
#

this would work for 1.16.5?

crimson mulch
#

yes

flint elk
leaden wind
#

okii

#

ty

flint elk
#

Ew, pterodactyl

leaden wind
#

bru

flint elk
#

There is a Pterodactyl egg for Bungeecord

crimson mulch
#

Eww

leaden wind
#

oki?

flint elk
#

use this instead

torn shuttle
#

man

#

finally got my quaternion rotations to work

#

all this because I was too lazy to draw a basic graph of what my issue was

#

what a waste of time

orchid gazelle
icy beacon
#

md_5 has a very interesting code style to say the least

crimson mulch
#

hahahaha

#

fax

torn shuttle
orchid gazelle
#

Im actually getting eye-cancer when seing brackets in the next line like in cs lmao

icy beacon
#

+1

torn shuttle
#

also my issue was that I just forgot to apply the translation

icy beacon
#

and the spaces after parentheses

torn shuttle
#

so it wasn't even the quaternion

icy beacon
#

that's the weirdest shit

#

but hey if it works it works

torn shuttle
#

it was me forgetting to transform it back to world values

orchid gazelle
#

Bruh

crisp arch
#

difference between DUST_COLOR_TRANSITION, BLOCK_DUST, and FALLING_DUST?

icy beacon
#

uh

crisp arch
#

im making a simple ring particle around the player, which should i use?

icy beacon
#

try all ig

#

just use them all one by one with a delay

#

and see which one works best

orchid gazelle
#

I got the rotations running but iirc the next problem is that its getting desync because the client has some weird shit to calculate player model rotations when the player is moving

torn shuttle
#

I think

orchid gazelle
#

Even reversed the client to find all the shit for body thresholds etc lma8

torn shuttle
#

particles are a pain in genral

orchid gazelle
#

Agreed

crisp arch
#

but what is the difference between blockdust and fallingdust

torn shuttle
#

yeah player rotations seem to be hit and miss

#

I was just rotating abstract cuboid rays

#

but hey

#

now I have proper rays implemented into my custom scripting language

crisp arch
#

in minecraft it just combines block_dust and falling_dust into one

torn shuttle
#

they have a hitbox and aabb checks against the player hitbox

orchid gazelle
#

Im doing raytracing with it, I know the pain man

torn shuttle
#

it's called gaming we do a little gaming

orchid gazelle
#

But movement keeps desyncing my boxes =(

torn shuttle
#

yeah mc isn't exactly the most accurate game with that kind of thing

icy beacon
#

h

orchid gazelle
#

Well its just the client showing the model by calculating a lot of weird shit with movement and so on

#

Im syncing an exact hitbox with player limbs to the actual VISUAL model of the player

torn shuttle
#

I do somewhat wonder why it is that sometimes modelengine decides that accurate rotations are for losers and makes my model parts fling off to the next postal code

orchid gazelle
#

lol

torn shuttle
#

I think it has a rounding issue or smth

orchid gazelle
#

Since when does modelengine work for players to animate???

#

I wasted like 20 hours researching on that

torn shuttle
#

players to animate?

#

not sure what you mean

orchid gazelle
#

Player-Animations

#

With modelengine

torn shuttle
#

I mean you can cheat them in pretty trivially

orchid gazelle
#

Gotta def. look on that someday

torn shuttle
#

I don't think there's an "official" guide on how to do it but the theory of it is real easy

crisp arch
#

omg

#

ok

#

so block dust literally is just the particles u get when breaking a block 💀

orchid gazelle
#

Have you figured how the movements affect the player model yet?

crisp arch
#

if u want textured dust u use block dust but if u want colored dust u use falling dust

#

sigh

torn shuttle
#

just make a 1:1 model of the player, get the player skin, project that skin to the model (make sure you uv map it right ahead of time) and then whenever you want to run a custom animation just make the player invisible and spawn an invisible stand-in to pretend it's them and have that run the animation

orchid gazelle
#

because the client seems to have some formula depending on the camera, velocity and direction

torn shuttle
#

never cared to look too deeply into it

orchid gazelle
#

Oh I did, at least I tried to lol

torn shuttle
#

modifying the players is a pain, you can hardly ever get minecraft to smoothly play along

orchid gazelle
#

Its such a massive rabbithole you literally wanna jump out of the window

torn shuttle
#

I guess I've implemented artificial hitboxes but man this is one hell of a first implementation of these

orchid gazelle
#

I actually got ALL the basics of syncing the model

#

And that with exact ray-checks and also with exact body-part detection

#

But movements? Yuck

#

How the heck does this garbage work

quaint tapir
#

event.getPlayer.damage( 10 );
when I do this it does 5 hearts no matter what armor
How do I make it do "natural" damage where it's not just changing their health by 5 hearts

#

do I have to check for armor levels of the player?

tawdry echo
#

Call entitydamageevent i think

twin venture
#

hi , iam remaking my kit system , and i was wondering if i can use NBT library to check if player have a kit ? or ?

quaint mantle
#

guys why does the enchantment limit cap at 255 instead of 32k

#

has it something to do with 1.16.5 or spigot

eternal oxide
#

255 would indicate it's a byte index

chrome beacon
fresh timber
#

im trying to make bows on my server but for some reason when you shoot the arrow just goes straight throuh the person... hitting ppl normally with hand or melee weapon works but for some reason bows just shoot right through ppl anyone know how this could've happened like certain code I might've accidently used or a spigot setting or something that I coulda used to mess this up?

chrome beacon
#

Sounds like you might want to share your code

fresh timber
#

yea but I have a lot of code

#

I can show u the part where I handle damage events and stuff ig tho

chrome beacon
#

Github uwu

quaint mantle
#

can i change the cap to 32k instead of 255 somehow

chrome beacon
#

You can make a mod

#

Or not use vanilla enchants and make "fake" ones with lore

fresh timber
#

I have a custom hp system for rpg game

regal scaffold
#

That's a 400 line event handler

fresh timber
#

ok

quaint mantle
fresh timber
#

just add lore and check if it has lore then do whatever custom enchant does if the item has that lore

regal scaffold
#

No, you can make your own custom enchantments

quaint mantle
#

whats the command

regal scaffold
#

There is no command for it. you have to make your own plugin

quaint mantle
#

oh

#

k

regal scaffold
#

You need to extend the the Enchantment.class and then use reflection to force bukkit to register your enchantment

eternal night
#

👀💀

eternal night
#

Sidenote, doing so is 100% unsupported

regal scaffold
#

Terrible way of doing it

regal scaffold
eternal night
#

What

chrome beacon
eternal night
#

Oh

sterile token
fresh timber
#

y

#

ive always done it and it works fine xd

#

but im not detecting items by name or lore im detecting enchants by using the lore

eternal night
#

Why XD

#

PDC is vibing right there