#help-development

1 messages ยท Page 277 of 1

kindred valley
#

Right here to help as i can. Ping

sullen marlin
#

pong

kindred valley
gilded knot
#

cheerio

formal bear
#

Why does it not work?

kindred valley
#

Wdym not work

#

?notworking

undone axleBOT
#

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

gilded knot
#

hm

#

ok

gilded knot
ornate mantle
#

does a java.util.ArrayList remember the order its in?

ornate mantle
#

splendid

tardy delta
remote swallow
undone axleBOT
tardy delta
#

that

maiden thicket
#

gamerule immediateRespawn ?

gilded knot
gilded knot
tall dragon
#

u cant make another instance of ur class that extends JavaPlugin

gilded knot
#

Right

remote swallow
#

Use di

gilded knot
gilded knot
tall dragon
gilded knot
#

1.19.2

remote swallow
gilded knot
#

shit yep

#

then that class is unnecessary lmao

tall dragon
gilded knot
gilded knot
#

current ones are either outdated or are just shit

tall dragon
#

thats interesting im working on an annihilation plugin as well haha

gilded knot
#

Oh damn

#

it's theoretically not that hard

#

Since I'm still a beginner, it's a bit lengthy for me

tall dragon
#

it can be

#

mine for example has to be fully modular to support adding multiple different game types easily

#

as the server im making it for has a few different versions of the game.

gilded knot
#

My progress so far

#

just working on the teamRespawn event

#

when player dies

#

get their team

#

get their team spawn

#

spawn them there

tall dragon
#

u have ur naming conventions the wrong way arround ๐Ÿ˜„

tardy delta
#

class names start with an uppercase character

gilded knot
#

Right, so I had it right the first time round

tall dragon
#

packages are all lower case

gilded knot
#

ohh

#

shi right

#

xD

#

thanks ๐Ÿ‘Œ

#

I mean

#

what's the point in doing it?

#

It still works for me

tall dragon
#

its just minimal naming conventions set by oracle.

gilded knot
#

Right

tall dragon
#

it makes your code more readable as well.

gilded knot
#

aight

tardy delta
#

go to c++ and suffer

green prism
#

Holder doesn't get set. Can you help me, please?

     this.holder = new FurnaceHolder("smartFurnace");

        Inventory inventory = Bukkit.createInventory(holder, InventoryType.FURNACE, Legacy.translate(title));

CustomHolderClass:

@AllArgsConstructor
public class FurnaceHolder implements InventoryHolder {
    String inventory;


    @Override
    public Inventory getInventory() {
        return null;
    }
}
fathom carbon
#

How do i filter out specific console logs?

#

I tried adding a filter but that doesnt work for some reason

glossy venture
green prism
# glossy venture show errors? or explain the problem you are experiencing and when in the code al...
  1. No errors, but obviously I can't use the IF Condition to check if the Clicked/Closed/Opened inventory is that furnace.

  2. https://www.spigotmc.org/threads/custom-inventoryholders.253149/
    Never had this problem before (using that class), switched from Paper to Spigot and here we are.

#

The problem happens only with this furnace inventory.

austere gull
#

guys am trying to develop a custom plugin for my server, I want to use the essentialsx's player head thing

glossy venture
austere gull
green prism
# glossy venture can you get the holder from the inventory view?
    public FurnaceGui build() {
        this.holder = new FurnaceHolder("smartFurnace");

        Inventory inventory = Bukkit.createInventory(holder, InventoryType.FURNACE, Legacy.translate(title));
        for(int i = 0; i < elements.size(); i++) {
            inventory.setItem(i, edit(elements.get(i).getStack(), elements.get(i).getCustomModelData(), elements.get(i).getDisplayname(), elements.get(i).getLore()));
        }
        System.out.println(inventory.getHolder() == null); // ! THIS RETURNS TRUE


        this.inventory = inventory;
        return this;
    }
#

Holder doesn't get set (Look at the comment inside the code)

#

Okay, It's correct

glossy venture
#

bukkit might do some checks, maybe try setting that inventory in the holder and have it returned by getInventory()

fervent prawn
#

My code with PlaceholderAPI:

String withoutPlaceholdersSet = "%player_name% &ajoined the server! He/she is rank &f%vault_rank%";
String withPlaceholdersSet = PlaceholderAPI.setPlaceholders(event.getPlayer(), withoutPlaceholdersSet);
event.setJoinMessage(withPlaceholdersSet);```

But the join message in the game is "%player_name% joined the server! He/she is rank %vault_rank%"

There are no errors in the console. Player is registered expansion. 
How to fix it?
glossy venture
#

this is the source code behind it

green prism
#

NICE

glossy venture
#

rip

#

you could make like a custom furnace gui with a chest gui

#

or something

#

or just check the getInventory instance, might work but i dont know if it would be identical

green prism
#

... That's why, sometimes, I prefer using Paper

glossy venture
#

all the types that are set to DEFAULT_CONVERTER can be used with a holder

#

others will just ignore lol

green prism
#

that's no-sense

glossy venture
#

it creates a tile entity to display the furnace gui

#

i think

#

but it doesnt store the holder anywhere

tender shard
glossy venture
#

also why is spigot making shit a pain in the ass

#

the package is just org.bukkit.craftbukkit in the source

green prism
#

What could I do to identify that inventory...

glossy venture
#

but when you try to use it in code its org.bukkit.craftbukkit.stupidfuckingversionstring

tender shard
glossy venture
#

yeah

#

key them by inventory instance

tender shard
glossy venture
#

idk if identity is consistent tho

green prism
#

right?

glossy venture
#

yeah

green prism
#

thank y'all

glossy venture
#

but dont register a new listener for each gui

tender shard
#

usually you will want to create a map

gilded knot
#

getting these errors, A little confused

green prism
tender shard
#
Map<UUID,Inventory> invMap = new HashMap<>();
#

sth like this

gilded knot
tender shard
#

then check if the map contains your inventory

tender shard
gilded knot
tender shard
#

wait a second

glossy venture
# green prism thank y'all

do something like

Map<Inventory, FurnaceGui> customInventoryMap = new HashMap<>();

@EventHandler
void clickEvent(InventoryClickEvent event) {
  FurnaceGui gui = customInventoryMap.get(event.getClickedInventory());
  if (gui == null) return;
  
  gui.onClick(event);
}
gilded knot
#

aight

tender shard
#

here I explained both concepts (static getter & DI)

gilded knot
#

sweet

glossy venture
#

will you only allow one player at once?

tender shard
#

damn this sentence is fucked UUUUP

green prism
tender shard
#

NO

glossy venture
#

but thats slow

tender shard
#

yes

glossy venture
#

using a map is not that hard bruh

glossy venture
#

then just do your code in FurnaceGui.onClick(...)

tender shard
#

if you don't understand how maps work, tell us, and we'll explain it to you

glossy venture
#

and otherwise youll have to make sure the listeners are unregistered and shit

#

when youre done

#

this is much easier

tender shard
#

exactly

#

you should only have one GUI listener

glossy venture
#

i use one listener for every single gui of any type

tender shard
#

one to rule them all

green prism
#

Good idea

#

Thank you orby ๐Ÿ™‚

tender shard
#

nobody ever thanks me ๐Ÿฅฒ

glossy venture
#

np

tender shard
#

trying to write archetypes lmao

glossy venture
#

what the fuck is an archetype

tender shard
#

don't you use maven?

glossy venture
#
  • use grdaldle
tender shard
#

gradle doesn't even have archetypes

#

an archetype is like a "template" for a whole project

glossy venture
#

you can include one file in gralde

#

in groovy

#

to set up a whole module

tender shard
#

wow, one file

glossy venture
#

with one line of code

#

paperweight userdev + javadocs + publishing set up in one line

tender shard
#

basically this is an archetype in maven

glossy venture
#

ah

tender shard
#

and then it generates plugin.yml, main class, pom.xml, and other stuff

daring elm
#

waht is curently supported java ida?

tender shard
#

choose whatever you like

#

most people will tell you to use IntelliJ

#

including me

daring elm
#

Waht is the best software for java?

tender shard
#

imho IntelliJ

daring elm
#

i am using visual studio

tender shard
gilded knot
#

thanks

tender shard
#

no problem, glad I could help

tender shard
daring elm
#

Yes

glossy venture
tender shard
#

you are better off switching to IntelliJ

daring elm
#

i make my all stuff on code

tender shard
#

for real

#

VSCode is nice but it doesn't come close to IJ

glossy venture
#

true

#

vouch

daring elm
#

but i`am Backend dev. im learn curently java ida

glossy venture
#

intellij has faster intellisense as well

green prism
#

How can I check if the listener is already registered?

tender shard
glossy venture
tender shard
#

I mean you should know when you register your listeners

glossy venture
#

and then make sure its never registered again

daring elm
#

oh wow inteliji have loot of features o,O

tender shard
#

ofc it does

green prism
#

Guys... FurnaceGUI is like Bukkit.createInventory()...
It's called more than once

tender shard
#

There's a reason why everyone considers IJ to be the best java IDE ๐Ÿ˜„

green prism
#

and it needs data

#

hmh

glossy venture
#

that doesnt register a listener

green prism
#

// Nothing to see here

tender shard
#

nooo?!

glossy venture
#

have a FurnaceGuiManager

tender shard
#

wtf are you doing

glossy venture
#

class

#

with the map

#

and which is a listener

tender shard
#

yeah

glossy venture
#

bruh

green prism
#

bruh

round finch
#

Wtf

gilded knot
tender shard
#

they probably just used "null" as example, chill out lol

gilded knot
daring elm
#

is community edition Inteliji ok ?

gilded knot
gilded knot
#

It's good, I use it

daring elm
#

ok spigot

daring elm
#

Waht is that lol

gilded knot
#

CE = Community Edition

daring elm
#

Ahh ok

#

Lol

gilded knot
daring elm
#

inteliji req Java or installed automatic?

cobalt marlin
gilded knot
#

(don't worry about the setCancelled() thing)

gilded knot
#

https://adoptium.net/ get it from here

Eclipse Adoptium provides prebuilt OpenJDK binaries from a fully open source set of build scripts and infrastructure. Supported platforms include Linux, macOS, Windows, ARM, Solaris, and AIX.

cobalt marlin
gilded knot
#

or from oracle website

daring elm
gilded knot
#

that works too

#

Wait

#

No

#

You need development kit

#

not JDK

gilded knot
#

wow

#

xD

cobalt marlin
#

no image perms ๐Ÿ˜”

tardy delta
#

?img

undone axleBOT
gilded knot
#

Just make sure to get JDK

cobalt marlin
#

you didn't copy the full url

gilded knot
#

??

cobalt marlin
#

yes

gilded knot
daring elm
#

ok i can Intelliji install with step java installation?

gilded knot
#

You can also have multiple versions of java

daring elm
#

for me is 17 but 1.13 Server

gilded knot
#

For plugins, I suggest using this

#

It's a simple GUI that lets you set-up specific types of plugins

#

Like Spigot, Paper etc

#

Set your depends

#

etc, etc

daring elm
gilded knot
#

and for theme, I personally use this

daring elm
#

ok i install Adoptium & Java SE

gilded knot
gilded knot
#

Java SE is for Minecraft clients

#

lol

daring elm
daring elm
#

XD

gilded knot
#

Download the JDK from Adoptium

#

simple as that

daring elm
#

ok i make it

#

run with administrator or normal?

gilded knot
#

administrator

daring elm
gilded knot
#

Automatically sets up a basic spigot plugin for you

daring elm
#

ah lol i dont have see it

#

any guide to learn 1.19.3 api? ๐Ÿฅฒ

#

i see items give cmd minecraft:

hazy parrot
#

Intellij can install jdk automatically

gilded knot
gilded knot
#

plugins

#

It should be similar for Windows

#

if not, the same

proper notch
#

File -> Settings when not on macos btw

gilded knot
#

^

daring elm
gilded knot
daring elm
#

better design as windows ๐Ÿ˜ฆ

#

woah i like english dev community in german all toxic ๐Ÿ’€

gilded knot
#

lmao

#

it's called help-development for a reason

daring elm
#

i am learn new stuff and another peoples say to me "Skid you cant development" sorry i am beginner .-. xD

quiet ice
kindred valley
unique urchin
#

Hi

#

I need a loggin plugin

noble crown
#

Hi, how can i hide player to another player without removing it from playerlist? I'm currently using hideEntity method

tardy delta
#

Player#setVisible?

noble crown
#

i can try it, thanks

#

there's no setVisible method in Player class ๐Ÿ˜ฆ

noble crown
#

without removing it from playerlist

gilded knot
noble crown
#

oh

#

okay

#

xd

gilded knot
#

xD

noble crown
#

i'll try it

#

thanks

gilded knot
#

np

eternal oxide
#

Player#hidePlayer

gilded knot
eternal oxide
#

only by sending a packet

tardy delta
#

doesnt setInvisible makes them invisible to other players but doesnt hide them for tablist?

#

heard somebody say that

rough drift
#

let me check for you

#

Straight from the mc sourcecode

tardy delta
#

why are they allowing player to be null tho

#

what class is that?

rough drift
#

Entity.class

noble crown
#

from nms?

rough drift
#

nah I have a fabric project open

tardy delta
#

wdym thats an interface

#

couldnt find it in CraftEntity

rough drift
#

I am looking at the genSources code

#

this isn't NMS

#

not bukkit

#

not spigot

#

just mc generated sources using fabric mappings

#

the logic is the same though

gilded knot
#

๐Ÿค”

tardy delta
#

npe incoming

gilded knot
rough drift
tardy delta
#

get ninjad

rough drift
#

fuc

gilded knot
#

brug

noble crown
tardy delta
#

hmm whats CraftEntity#getHandle returning

rough drift
#

server & client

#

looking at both

gilded knot
noble crown
tardy delta
#

what class

rough drift
#

you should check for that

tardy delta
#

oh probably cant look into that sourcecode

rough drift
#

there's the stash

gilded knot
rough drift
#

no

#

you did not

gilded knot
#

yep i did

tardy delta
#

need the class name then

noble crown
gilded knot
#

it was outside screenshot

rough drift
tardy delta
gilded knot
#

ยฏ_(ใƒ„)_/ยฏ

tardy delta
#

cuz its not needed

rough drift
#

check if get returns null when you run the get op

gilded knot
#

aight

rough drift
#

also, why is the hashmap public but there is a method to get from it??

tardy delta
#

if youre going to make a program that must be fast it wont if you do that kind of stuff

gilded knot
#

I can't compile until this is fixed

rough drift
tardy delta
#

hashmap is too slow for my parser \๐Ÿ˜ข

#

made my own data structure to store functions

rough drift
#

they have like Int2ObjectHashMap and shit

#

for every primitive

#

it's a great lib

gilded knot
tardy delta
#

hashmap wise i would need a Map<String, T>

rough drift
#

*Biased: It was made in italy

rough drift
#

wait

tardy delta
#

well actually i cant have the string

hazy parrot
tardy delta
#

im looking thro a char array dynamically

#

i dont know where my string ends

#

so ig my current approach is fine

#

and String#indexOf is slow

#

hmm yes

rough drift
#

yeah

#

it's gh is weird

kindred valley
tender shard
tardy delta
#

theres like nothing inside of those damn packages

kindred valley
#

Performance

#

My ide fucked up after using them

tardy delta
#

:/

tender shard
#

huh never had a problem with that

#

but I'm also using the ultimate version, but I doubt that there's any difference in regards to this

hazy parrot
tender shard
#

yeah

gilded knot
#

fixed it

kindred valley
#

Yes

#

But yeah i dont know why it fucked my ide up

#

I coded with 20fps

tardy delta
#

i used to play minecraft with 15 fps so dont complain

gilded knot
#

i used to play roblox with 20 fps

#

Small question

#

When you setBedSpawnLocation

#

does it reset after the world is regenerated?

#

by regenerated I mean unloaded and a blank clone of the world is unloaded

kindred valley
#

Hunger games with 15 fps

#

But coding is even harder

noble crown
#

any ideas how can i get full spigot jar with nms with yarn/fabric mappings?

chrome beacon
#

Probably better to learn and use mojmaps

#

You can use screamingsandals to compare mappings

green prism
#

Olivo is our god

tardy delta
#

still wondering how sandals can scream \๐Ÿค”

noble crown
#

but why is it better to use mojang mappings?

chrome beacon
#

They're complete (exept params), easy to use and the same on each platform

noble crown
#

okay

#

thx

tender shard
#

?switchmappings

tender shard
#

read both

#

TL;DR: you won't get any yarn mapped spigot .jar unless you create it yourself

#

why not just use mojang mappings?

noble crown
tender shard
noble crown
#

gradle

tender shard
#

you will have a very bad time if you don't use mojang mappings

#

idk if there's any gradle plugin to switch yarn<>obf mappings

#

all I know is that it easily works with mojang<>obfmappings

tender shard
#

because there's no gradle plugin that does this

noble crown
tender shard
#

idk anything about gradle

#

I can only help you with maven

noble crown
#

okay, so i can try with maven

tall dragon
#

@tender shard since ur the pdc champ. would u have any idea why this doesnt work?, its sets the pdc fine. but when i click the block the pdc is empty.. https://paste.md-5.net/osupuqiruw.cs

eternal oxide
#

you need to state.update() as you are working oni a snapshot

tardy delta
#

looking at stash is fun

keen lake
#

Hi guys. I came across very weird thing. Every time I spawn an endermite with plugin it dies immediately. It does get spawned but straight up dies. I could not even debug damage cause with EntityDamageEvent. Any ideas how to fix this?

tardy delta
#

other plugins?

#

like worldguard

keen lake
#

Huh, maybe OldCombatMechanics could be causing this?

tardy delta
#

try removing other plugins

lime jolt
#

@EventHandler
public void anvilDmg(EntityDamageByBlockEvent e) {
Block block = e.getDamager();
if(block != null && block.getType() == Material.ANVIL) {
e.setDamage(1000000);
}
}

#

why does this not kill a player when the anvil hits them

glossy venture
tardy delta
#

they could just comment it out

glossy venture
#

yeah

opal juniper
#

when you are working with patches, it is soooo much better

tardy delta
#

\๐Ÿค”

opal juniper
#

cause if more stuff is added inside the if statement, you dont have to then go and comment that as well you can just leave it on the if

tardy delta
#

/**/

opal juniper
#

go look at some paper patches

tardy delta
#

dunno what that stuff is even supposed to do

charred blaze
#

how do i set world's time to night?
this one isnt working
world.setTime(12 * 1000);

tardy delta
#

how tf is that rendered

#

ive seen those files before but they always look horrible

opal juniper
#

how is what rendered?

#

i mean patch files arent supposed to be edited by hand so it doesnt need to be easy

tardy delta
#

ugh

tender shard
tender shard
#

?help

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.

tender shard
#

help

#

@charred blaze can you help me pls

charred blaze
tender shard
#

I need help

charred blaze
#

in what

tender shard
#

help

charred blaze
#

aa

#

thats easy

#

google it

tender shard
#

oh yeah there's a beatles song

#

thanks

#

!

charred blaze
tender shard
#

anyway I just wanted to say:

#

don't just say "help" but rather ask your original question again

charred blaze
tender shard
#

I know

#

anyway, just post your question again

charred blaze
#

aint that spam?

tender shard
#

just do it, I am too lazy to scroll up

charred blaze
#

how do i set world's time to night?
this one isnt working
world.setTime(12 * 1000);

tender shard
#

I think 12000L is mid-day

#

try to set it to 0

charred blaze
#

0 is day

#

im using it for /day

tender shard
#

hmmm try using 18000 or sth

charred blaze
#

k

tender shard
#

0 is probably "morning" then

charred blaze
#

aaa

tender shard
#

0 is 6am or 8am or sth

charred blaze
#

intresting

tender shard
#

so 12000 is "noon"

#

sth like that

#

it's a bit weird

charred blaze
#

yea it workd

#

how do i reset playertime?

#

(set it to current world's time)

gleaming grove
#

As I remember to get nested class you need to do something like Class.find("ExapleClass$NestedClass")

tardy delta
#

isnt $ used as a separator for inner class?

#

ahh

tender shard
#

but you can call your classes whateer you like

tender shard
#

wdym

gleaming grove
#

I'm on the phone so would be hard to explain whole process I can later send you full example

charred blaze
#

how do i reset playertime?(set it to current world's time)

tardy delta
quiet ice
#

Although I don't know whether that is correct as I rarely use those signs

tender shard
tardy delta
#

yep it does

quiet ice
#

Yeah, then it is an issue caused by incompatible encoding standards

tardy delta
#

only a bunch of warnings

quiet ice
#

Since newer JDKs use UTF-8 and many editors still use whatever the device standard is

tender shard
#

my plugins always look like this lmao

#

and no, that's not inner classes

#

they are indeed called like that

quiet ice
#

As in those are obfuscated

tender shard
#

yeah obv

#

I didn't name that like this myself

tardy delta
#

datei

#

imagine not having it in english

#

und die konfiguration

quiet ice
#

I believe recaf might be choosing the system default by default

tender shard
#

yeah

#

it does

tardy delta
#

im thinking about putting my whole os in english

tender shard
#

it didnt make it use german on purpose

tardy delta
#

worst mistake i made

quiet ice
#

what that

#

Or is the mistake it not being in english in the first place?

tardy delta
#

uhu

tender shard
#

uwu*

quiet ice
#

does not compute.

tardy delta
#

uwu does not compute?

tender shard
#

uwu does compute

tardy delta
#

english confuses me

#

\๐Ÿ’€

rare rover
#

would there be a way of doing this?

    public static Class<?> parseClass(String name) {
        try {
            return Class.forName(name);
        } catch (ClassNotFoundException e) {
            e.printStackTrace();
        }
        return null;
    }

    public static void test() {
        Class<Location> locationClass = (Class<Location>) parseClass("org.bukkit.Location");

        PlayerVariable<locationClass> thing = new PlayerVariable<>(Bukkit.getPlayer("OutSpending"), "test", null);
    }``` i'm just wondering
echo basalt
rare rover
#

and why is because i want to use json for storage so i would also store the class then parse it back to it

rotund ravine
#

It is possible.

rare rover
#

and how would i do that?

#

this is just an option, i ain't using it right now

tardy delta
#

a way of doing what

#

literally gets a class

rare rover
#

so i can store whatever i want

tardy delta
#

use gson

#

and write typeadapters

rare rover
#

oh..

#

that would work too

#

xD

gleaming grove
#

?paste

undone axleBOT
gleaming grove
tardy delta
#

whats that supposed to do

gleaming grove
#

get certain enum value with reflections

tardy delta
#

๐Ÿคจ

#

what about valueof

#

dont need to recompute name method for each constant too

#

clazz.getMethod("name")

gleaming grove
#

I was thinking about it

#

but

#
        Method valueOf=  clazz.getDeclaredMethod("valueOf");
#

this code throws exception

tardy delta
#

what exception

gleaming grove
#

noSuchMethod

#

wreid

tardy delta
#

shouldnt Method nameMethod = Enum.class.getDeclaredMethod("name") work?

echo basalt
#

fake metadata

vague swallow
#

Is it possible to make a fireball invisible?

#

And is there a way to give it a time until it disappears automaticly

#

?

echo basalt
#

With nms/packets, just send an entity destroy packet to the player

vague swallow
#

how can I do that?

echo basalt
#

Are you any familiar with packets?

vague swallow
#

no

vague swallow
echo basalt
#

Read the packets section

vague swallow
#

alright, thank you!

echo basalt
#

You might need the mappings part too

#

also one of the images ain't rendering grr

#

Updated the post to include image urls

dry yacht
tardy delta
dry yacht
#

Damn, it's a lot smaller than bukkit's byte[]

#

[18:30:48 INFO]: length=146 length=643

tardy delta
#

looks like the code for my reflective pojo mapper

dry yacht
quiet ice
#

Paper has a method to serialize itemstacks that passes through that one thing known to be a performance killer

dry yacht
quiet ice
echo basalt
dry yacht
echo basalt
#

reflection

dry yacht
#

But the custom binary format really manages to squeeze it together

dry yacht
echo basalt
quiet ice
echo basalt
#

the weak will perish

dry yacht
quiet ice
#

Next to no people use plain spigot. This server is only alive for historical reasons and due to paper being paper

sterile token
dry yacht
echo basalt
#

paper is nice as a software, the community is not that great however

#

just like all things honestly

quiet ice
#

Exactly.

sterile token
echo basalt
#

most games are like that

dry yacht
quiet ice
#

Verifier error

sterile token
echo basalt
#

aren't you like 15?

sterile token
echo basalt
#

close enough

sterile token
#

Yeah haha

tender shard
#

lmao

sterile token
#

Its really accurate

echo basalt
#

I've been working since I was 11-12, doesn't really matter

#

I just don't see the appeal of alcohol

sterile token
#

Alchool make you say 100x stupid things and all the time than normally

echo basalt
#

how low can I go

#

I already say stupid shit all the time

quiet ice
#

I have never worked myself (If you ignore all the FOSS stuff I am doing, which should be considered working in itself) - and the only alcohol I consume is the occasional cider from Aldi (which has next to no alcohol)

tender shard
#

alcohol doesn't make you say stupid things. it rather makes you do stupid things. for example, yesterday, I was sad about my dead cat. then I joined this "yo my pet died" discord. and now I'm not only sad about my own cat, but also about everone else's

vague swallow
echo basalt
#

there's this fancy custom burger place

#

I go there, get a cider

#

get a nice borger

#

That's the only alcohol I ever drink

quiet ice
#

that seems like an odd combination

echo basalt
#

It's like

#

artesanal

#

mfs here drink beer with everything, which is even worse

quiet ice
#

I can guess that

#

Oh @dry yacht by the way: The reason BukkitObjectOutputStream performs so badly is because java serialization sucks. It's not as bad as YAML serialisation, but it has similar overhead as the full class name is written for each object alongside the name and descriptors of fields and more. It's disturbing really

orchid gazelle
dry yacht
# quiet ice Oh <@697274381587447899> by the way: The reason BukkitObjectOutputStream perform...

Yes, it is disturbing. I'm not really willing to use such an API in any of my projects. Since I got into C, all this overhead is really hurting my feelings, as I've grown more conscious of it. Sometimes you really cannot do better in Java - cause it's Java, but with this topic you just can, as I proved with my stupid simple serializer. There surely is a reason why "they" didn't do it that way, which I yet have to trip up on.

quiet ice
#

Generally with java you can do better. My RegionatedIntIntToObjectMap is a perfect example of it. I highly doubt that it is a C-specific thing (outside of C not providing the sluggish niceties)

dry yacht
#

You can (almost) always do "better", but sometimes just not as good as in a language which offers you full control. What implementation are you talking about there, is it public?

tender shard
#

the ObjectOutputSteam is way better than the yaml struff

lethal knoll
#

Hey all, someone asked me to make my plugin compatible with the isAFK() method of the purper software. My question is, what is the easiest way to achieve this?

dry yacht
# quiet ice <https://github.com/Geolykt/Presence/blob/main/src/main/java/de/geolykt/presence...

Oh wow, that looks very interesting! I'm already pretty tired and feel like I need a break, but I'll definitely get back to that, thank you. I love how you documented everything with proper explanations.

Looks like it's used in a region claiming plugin, which is something I was daydreaming about just recently. I asked myself how I would ever manage to look up regions by an (x|y) point inside of it's area definition efficiently. Don't yet know if you solved that with this map, but it still looks like a nice general solution.

quiet ice
#

This one is a chunk-aligned plugin, but you can definetly use that for faster lookups

dry yacht
#

It feels to me like going on a more granular level than chunks is insanity anyways, but I'd still love to try it, haha

thin lantern
#

how i can get current tick number or execute some code every so i can count ticks myself?

rotund ravine
thin lantern
dry yacht
rotund ravine
thin lantern
#

ticks elapsed since start

quiet ice
#

have a task that runs every tick which increments an AtomicLong

vague swallow
#

Is there an event that gets triggered when a crossbow is getting charged?

rotund ravine
quiet ice
#

Although I'd just store the bounding boxes of your regions on a per-chunk basis instead of a per-block basis

quaint mantle
#

how can i get the players client version

chrome beacon
#

Use the api of the plugin allowing multiple versions

quaint mantle
#

???

#

im just trying to get the players version that they're on

chrome beacon
#

Otherwise it will be the same as the server

quaint mantle
chrome beacon
#

For example if you're using via version use the via version api

rotund ravine
#

If so it'll be through there, if not it'll be = to the same major update as the server.

quaint mantle
#

I just wanna grab what version the user is on, example if the server is 1.19.3 then if the user tries joining just on 1.18.2 then it kicks them saying they cant use 1.18.2

rotund ravine
#

It already does that.

quaint mantle
#

Yeah but i dont wanna use viaversion

rotund ravine
#

Go use protocollib though.

quaint mantle
#

as i said

quaint mantle
chrome beacon
#

Vanilla will already block versions that don't match the server version

#

And it will tell the user what version they should be on

quaint mantle
#

Yes but i wanna use a custom message

#

not none of that boring white msg saying outdated version use 1.19 for ex,

opal juniper
#

is there any way of knowing where in the tick you are

rotund ravine
chrome beacon
echo basalt
#

usually nms stuff runs first

#

then bukkit schedulers

opal juniper
#

i am aware of the tick loop. im spreading work over ticks though and wondered if you can tell where in the tick you are

echo basalt
#

you're usually always at the end

#

:)

opal juniper
#

because then I know how much time i have

#

because I am setting a tonne of blocks

rotund ravine
#

you always have time

opal juniper
#

and dont want the tps to ๐Ÿ“‰

echo basalt
#

if you're using paper, you have a TickStartEvent that you can use to limit stuff towards the end of the tick

#

so like

#

start = System.currentTimeMillis

opal juniper
#

yeah I am aware of their event

echo basalt
#

then you do stuff

opal juniper
#

but this is spigot sir

echo basalt
#

yeh

opal juniper
#

coding

echo basalt
#

in that case you can't know how much time you have until the next tick

rotund ravine
#

well

opal juniper
#

i refuse to believe

#

brb

rotund ravine
#

you can probably use a different thread and do some syncing somehow and then keep that running. Though any amount of lag will through it off and u need to resync.

opal juniper
#

@echo basalt

#

it stores the tick times

rotund ravine
#

what type of field?

opal juniper
#

I guess there is no way of knowing if there are scheduler things after you

#

but you could account for that

rotund ravine
#

so farmland?

opal juniper
rotund ravine
#

can't find anything, so most likely just playerinteractevent

#

Well

#

IF it's dirt it's not grass is it

#

If it's grass it's not dirt is it?

#

Change the or to an &&

#

Then what will happen

#

Change the or to and

#

in your if statement

#

It can not be an or

#

It's quite literally what i said.

#

IF not grass return. (returns on dirt)
If not dirt return. (returns on grass)

#

if not grass and dirt return.

#

Use or

#

It does

#

It will literally return if it's anything else but those two

#

if you do &&

#

yes

#

No

#

You are not thinking in the correct terms.

#

You are returning

#

Not continueing

#

no

#

if (event.getClickedBlock().getType() != Material.DIRT || event.getClickedBlock().getType() != Material.GRASS_BLOCK) return; -> if (event.getClickedBlock().getType() != Material.DIRT && event.getClickedBlock().getType() != Material.GRASS_BLOCK) return;

#

Let's try again.

#

We pass a grass block to the event:

IF block is not dirt or grass, return and do not cancel. It is not dirt, since it's grass so we return and do not cancel.

We pass a dirt block to the event:

IF block is not dirt or grass, return and do not cancel. It is not grass, since it's dirt so we return and do not cancel.

#

You want to check if it's not both, and then return. Else cancel the event.

#

I might be too tired let me think about it for a sec.

#

did you try my weird brain thing.

vague swallow
#

how can I check if a player keeps holding left click after clicking?

vague swallow
#

oh yes sounds very easy

rotund ravine
#
Current type: GRASS_BLOCK
Testing 'type != Material.GRASS_BLOCK && type != Material.DIRT'
false
Testing 'type != Material.GRASS_BLOCK || type != Material.DIRT'
true

Current type: DIRT
Testing 'type != Material.GRASS_BLOCK && type != Material.DIRT'
false
Testing 'type != Material.GRASS_BLOCK || type != Material.DIRT'
true

Current type: STONE
Testing 'type != Material.GRASS_BLOCK && type != Material.DIRT'
true
Testing 'type != Material.GRASS_BLOCK || type != Material.DIRT'
true
#

So

#

As i said && is and

vague swallow
#

Whats the name of the firework rocket entity?

#

well when I spawn it it doesn't appear as a rocket

#

its invisible or something

rotund ravine
#

How are you spawning it

opal juniper
#

Hmm how do i speed this up

#

the .save operation takes a while cause IO

echo basalt
#

then do allOf

kindred valley
#

Hello ping for help

opal juniper
echo basalt
#

yeah

opal juniper
#

coolio

echo basalt
#

use join instead of get to avoid trycatching

opal juniper
#

oke

#

hmmm i got a cast exception

quaint mantle
#
@EventHandler
    public void onPlayerPreLogin(AsyncPlayerPreLoginEvent event) {
        ViaAPI api = Via.getAPI();
        int version = api.getPlayerVersion(Bukkit.getServer().getPlayer(event.getUniqueId()));
        if (version >= 758) {
            event.allow();
        } else {
            event.disallow(AsyncPlayerPreLoginEvent.Result.KICK_OTHER, "This server only allows Minecraft versions 1.18.2 to 1.19.3. Please update your game to join.");
        }
    }

Why does this not work..... like there is no errors, but it just wont let me login with version 1.18.2, on a 1.19.3 server, i get no errors, i registered all events in the onEnable part, i implemented Listener, idk what im doing wrong,

opal juniper
buoyant viper
buoyant viper
#

also make sure ur also using like ViaBackwards i think

opal juniper
buoyant viper
remote swallow
#

They do have a config option for that

quaint mantle
#

wat line??

#

or what am i looking for in the config

opal juniper
#

@echo basalt forgot that it needed to be on-main because I was using the World#getChunkAt#getPDC

echo basalt
#

cache the chunk pdcs or something

#

like

#

gather all the pdcs and then do the future stuff?

opal juniper
#

i think i have made something

vague swallow
#

I want to make a for loop for all ender crystals, how can I do that?

#

I got for(EnderCrystal e : but don't know what to put here)

opal juniper
#
    public static void saveAllClouds(Set<Cloud> clouds) {

        Map<UUID, Set<Cloud>> cloudMap = new HashMap<>();
        Map<ChunkCoord, PersistentDataContainer> persistentDataContainerMap =
                clouds.stream().collect(Collectors.toMap(Cloud::getChunkCoordPair, cloud ->
                        Bukkit.getWorld(cloud.getWorld())
                                .getChunkAt(cloud.getChunkCoordPair().getX(), cloud.getChunkCoordPair().getZ())
                                .getPersistentDataContainer()));

        List<CompletableFuture<Void>> completableFutures = clouds.stream().map(cloud ->
                CompletableFuture.runAsync(() -> putAndSave(cloud, cloudMap, persistentDataContainerMap))).toList();
        CompletableFuture[] futures = completableFutures.toArray(CompletableFuture[]::new);

        CompletableFuture.allOf(futures).join();
echo basalt
#

yeah

#

that stream ugh

#

Hella odd the way you're doing pdc

daring elm
#

waht is the KEY to adding java for my project building (Intelliji free version)

echo basalt
#
public CompletableFuture<Void> saveCloud(Cloud cloud) {
  ChunkCoord chunkCoords = cloud.getChunkCoordPair();
  World world = Bukkit.getWorld(cloud.getWorld());
  PersistentDataContainer pdc = world.getChunkAt(chunkCoords.getX(), chunkCoords.getY());

  return CompletableFuture.runAsync(() -> {
    ...
  }
}
#

Want to cache it? it's gonna be a bit weirder

daring elm
#

Why sending my Console this?
Can't keep up! Is the server overloaded? Running 6853ms or 137 ticks behind

humble tulip
#

What are you doing?

#

Are you sleeping the thread?

crude estuary
buoyant viper
daring elm
daring elm
crude estuary
#

Dude...

echo basalt
#
private static final Map<Long, PersistentDataContainer> chunkCache = new ConcurrentHashMap<>();
private static final Map<Long, CompletableFuture<PersistentDataContainer>> chunkFutures = new ConcurrentHashMap<>();

private static PersistentDataContainer getContainerFast(Chunk bukkitChunk) { // run this async :)
    long key = bukkitChunk.getChunkKey();
    if (chunkCache.containsKey(key)) {
        return chunkCache.get(key);
    }

    if (chunkFutures.containsKey(key)) {
        return chunkFutures.get(key).join();
    }

    if (Bukkit.isPrimaryThread()) {
        PersistentDataContainer container = bukkitChunk.getPersistentDataContainer();
        chunkCache.put(key, container);
        return container;
    }

    CompletableFuture<PersistentDataContainer> future = CompletableFuture.supplyAsync(
        () -> getContainerFast(location), MainThreadExecutor.MAIN_THREAD_EXECUTOR);

    future.exceptionally(throwable -> {
        throwable.printStackTrace();
        return null;
    });

    chunkFutures.put(key, future);
    return future.join();
}

@opal juniper

crude estuary
#

nvm, i'm not Gonna say it, it's Serious Help

echo basalt
#

make sure to evict entries after like 30 seconds

humble tulip
#

/timing on

#

Let the server run a bit

#

Then /timings paste

daring elm
#

Ok

crude estuary
#

What Processor are you using?

obsidian drift
#

Is there an easy way to require stacked items in a ShapedRecipe?

daring elm
echo basalt
#

You'll also need the main thread executor

crude estuary
#

You mean wait a Second?

echo basalt
#

Then, to use such code

#

get all bukkit chunks

gusty bough
#

Hey, I have this code which permits to place sugar cane without water nearby. It works perfectly excepts that it doesn't play sound associated with block placed. Any idea how to solve this?

@EventHandler
    public void onBlockPlace(BlockPlaceEvent event) {
        if (event.getBlockPlaced().getType() != Material.SUGAR_CANE) {
            return;
        }

        if (event.getBlockAgainst().getType() != Material.AIR) {
            return;
        }

        List<Material> authorizedMaterials = Arrays.asList(Material.DIRT, Material.GRASS_BLOCK, Material.SAND, Material.RED_SAND);
        if (!authorizedMaterials.contains(event.getBlockAgainst().getRelative(BlockFace.DOWN).getType())) {
            return;
        }
        
        event.setBuild(true);
    }
echo basalt
#

and do a future to get the container

#

it caches n such

#

I use that code in a similar way to flood-fill chunk snapshots and detect stuff

#

went from ~1k bps to ~30k

daring elm
# crude estuary What Processor are you using?
    ,g$$$$$$$$$$$$$$$P.       ----------
  ,g$$P"     """Y$$.".        OS: Debian GNU/Linux 11 (bullseye) x86_64
 ,$$P'              `$$$.     Host: KVM/QEMU (Standard PC (i440FX + PIIX, 1996) pc-i440fx-7.1)
',$$P       ,ggs.     `$$b:   Kernel: 5.10.0-20-amd64
`d$$'     ,$P"'   .    $$$    Uptime: 8 hours, 30 mins
 $$P      d$'     ,    $$P    Packages: 936 (dpkg)
 $$:      $$.   -    ,d$$'    Shell: zsh 5.8
 $$;      Y$b._   _,d$P'      Resolution: 1280x800
 Y$$.    `.`"Y$$$$P"'         Terminal: /dev/pts/0
 `$$b      "-.__              CPU: AMD EPYC-Rome (4) @ 2.794GHz
  `Y$$                        GPU: 00:02.0 Vendor 1234 Device 1111
   `Y$$.                      Memory: 3439MiB / 18000MiB

crude estuary
#

2.794GHz

#

that's why is lagging my guy

#

what an Epic Speed

echo basalt
#

frequency doesn't matter THAT much compared to other aspects

#

an epyc cpu isn't that strong with single-core workloads

crude estuary
#

๐Ÿคจ ๐Ÿ“ธ

echo basalt
#

like

#

there are pentiums that reach 6ghz

#

7 even

crude estuary
#

and this Reaches 2.794

#

per Core

echo basalt
#

this can probably wreck the pentium with certain tasks

crude estuary
#

and Minecraft uses 3 Cores at Max

echo basalt
#

You can have a cpu that does a lot more per clock cycle

echo basalt
#

no

crude estuary
#

i think it does

echo basalt
#

I write a lot of my plugins to benefit from multithreading

vague swallow
#

I got for(EnderCrystal e : but don't know what to put here)

echo basalt
#

and absolutely wreck 16-core cpus :)

crude estuary
#

you Mean Plugins

#

i mean the Core

#

Minecraft is Mostly Single Threaded

echo basalt
#

sure the core itself doesn't use that much

tardy delta
#

MainThreadExecutor.MAIN_THREAD_EXECUTOR

crude estuary
echo basalt
#

fuck off

crude estuary
#

xD

echo basalt
tardy delta
#

should definitly increase my os gui scale

crude estuary
tardy delta
echo basalt
#

you're rating cpus purely based on clock speed

tardy delta
#

actually doesnt look bad on the screen but stuff is damn small

crude estuary
echo basalt
#

That's... not how it works

#

single-core performance is the main deal

#

Multi-core is secondary

buoyant viper
#

single core performance go brrrrrrrrrr

echo basalt
#

clock speed is just a multiplier for such performance

crude estuary
#

if the Aplication is Made to use it

echo basalt
#

so if we have half as many clocks per second, on the same cpu, we can expect around half the performance

crude estuary
#

Minecraft is not

#

at Least Java Edition

echo basalt
#

Minecraft uses:

  • 1 thread for the main server stuff
  • a thread for each player online (network, IO)
  • some versions may benefit from multi-threaded world loading etc
buoyant viper
#

Minecraft java edition is made to multithread

opal juniper
#

@buoyant viper

crude estuary
#

Yeah 1 Thread for the Main Server Stuff

#

what does that Include?

echo basalt
buoyant viper
crude estuary
#

Yeah, Basically almost Everything

echo basalt
#

loop through entities, do random ticks, fire events, handle movement

#

Stuff like world loading or player IO is done separately

tardy delta
#

time to make it multithreaded

buoyant viper
#

there is that one mod trying to multithread world ticking

crude estuary
#

and Chunk Generation thanks to Paper

echo basalt
#

Minestom go brr

crude estuary
#

Yeah

#

Because it's Rewritten

tardy delta
#

havent used it

echo basalt
#

Multithread != "1 more thread"

crude estuary
#

Completely

crude estuary
#

it's Processes

echo basalt
#

it means it will take as many as it can (some algorithms prefer to take more threads than others) and spread the workload

faint tide
#

hey, I've got a question regarding multiple versions support for nms. I understand the concept with the interface and the copies of the different versions, except the problem for me which I don't understand is: I don't use nms version specific... I use it to get to Mojang:

import com.mojang.authlib.GameProfile;
import com.mojang.authlib.properties.Property;

So this is not version specific. which means making copies of the class with the interface doesn't help me right?
What method do I use to make my plugin multi-version compatible?

echo basalt
#

Now, since it is mostly single-cored

crude estuary
#

But i mean, a Process can't Divide itself

echo basalt
#

we should look for a strong single-core performance cpu

#

intel gamer cpus are usually chosen because they're more focused on that

echo basalt
#

like the i9-9900k, 12900k etc

buoyant viper
crude estuary
#

and this Dude is Running a 2.794GHz Amd Epyc Processor (Probably Hosting)

#

That's not for Minecraft

echo basalt
crude estuary
#

is Runs so Bad

opal juniper
echo basalt
#

Yes, but that's a feature of this specific cpu

opal juniper
#

getChunkKey

crude estuary
echo basalt
#

ah

tardy delta
#

paper is like async spigot

#

\๐Ÿค”

opal juniper
#

i will just find the src

tardy delta
#

change my mind

echo basalt
#
    /**
     * @return The Chunks X and Z coordinates packed into a long
     */
    default long getChunkKey() {
        return getChunkKey(getX(), getZ());
    }

    /**
     * @param loc Location to get chunk key
     * @return Location's chunk coordinates packed into a long
     */
    static long getChunkKey(@NotNull Location loc) {
        return getChunkKey((int) Math.floor(loc.getX()) >> 4, (int) Math.floor(loc.getZ()) >> 4);
    }

    /**
     * @param x X Coordinate
     * @param z Z Coordinate
     * @return Chunk coordinates packed into a long
     */
    static long getChunkKey(int x, int z) {
        return (long) x & 0xffffffffL | ((long) z & 0xffffffffL) << 32;
    }
#

here

buoyant viper
crude estuary
#

xD

echo basalt
tardy delta
#

thats a thiniking emoji

buoyant viper
tardy delta
#

fuck im so bad at typing on this keyboard

echo basalt
#

LIGHT MODE AAAAAAAAA

crude estuary
tardy delta
#

LOL

crude estuary
#

xD

buoyant viper
echo basalt
crude estuary
buoyant viper
#

im doing a one week challenge all apps on light mode

tardy delta
echo basalt
#

Blaming the clock speed entirely isn't gonna be that helpful

#

example: threadripper

#

or an underclocked intel cpu

tardy delta
buoyant viper
echo basalt
#

Some operations are simply more optimized at a hardware level

crude estuary
#

You usually Prefer Older CPUs with Higher Clock Speed for Minecraft

tardy delta
#

<?><?>

crude estuary
#

Change my Mind

echo basalt
#

I don't

crude estuary
#

Just Test it

tardy delta
#

|| ||

#

|| ||

echo basalt
#

I actually handle a fleet of multiple machines, and have each machine's hardware picked out for whatever task I'll run

buoyant viper
#

no way there be some fuckin incompatible emojis

#

its the Thinking emoji

echo basalt
#

I'm currently writing a system that is extremely multi-core heavy

tardy delta
#

unicode

crude estuary
echo basalt
#

As in: tons of database operations, lots of async

tardy delta
#

\๐Ÿ‘€

echo basalt
#

So I'll probably go for a threadripper or xeon system

tardy delta
#

fuck atleast this one is normal

echo basalt
#

Because only nms is running in the main thread at this stage

tardy delta
#

go for the amd epyc

echo basalt
#

nah

tardy delta
#

128 cores i believe

echo basalt
#

amd epyc is way too extreme on multi-threading