#help-development

1 messages · Page 2038 of 1

tender shard
#

if bukkit will ever introduce modules, I am pretty sure that new NamespacedKey(String,String) will be inaccessible

#

so yeah I will never ever use any deprecated methods

glossy venture
#
NamespacedKey.fromString("_:" + key);
new NamespacedKey("_", key);
grim ice
#

and it's not worth using a deprecated internal method and breaking its contract

glossy venture
#

which one

#

k sure

grim ice
#

just for that small readability you can fix

#

with a comment

grim ice
#

agree? mfn

strong parcel
#

I tried your method, but I do not know how to get what is being damaged by the lightning.

glossy venture
#

but it wouldnt make sense to hide a constructor to then introduce a whole fromString fancy parsing method that does the exact same thing

grim ice
#

it does

#

when you're breaking a method contract

glossy venture
#

why have the contract

grim ice
tender shard
#

shit

#

I must have an error in my thoughts

#

why doesn't this work

glossy venture
#

what the hell does that do

tender shard
#
package com.jeff_media.morepersistentdatatypes;

import org.bukkit.NamespacedKey;
import org.bukkit.persistence.PersistentDataAdapterContext;
import org.bukkit.persistence.PersistentDataContainer;
import org.bukkit.persistence.PersistentDataType;
import org.jetbrains.annotations.NotNull;


import javax.xml.stream.events.Namespace;
import java.util.Collection;

public class DataCollection
        <C extends Collection<D>,D extends PersistentDataType<?,D>>
        implements PersistentDataType<PersistentDataContainer,C> {

    private static final String MUST_NOT_BE_NULL = "Collections stored in a PersistentDataContainer must not contain any null values.";

    private final Class<C> collectionClazz;
    private final Class<D> dataTypeClazz;

    public DataCollection(Class<C> collectionClazz, Class<D> dataTypeClazz) {
        this.collectionClazz = collectionClazz;
        this.dataTypeClazz = dataTypeClazz;
    }

    @NotNull
    @Override
    public Class<PersistentDataContainer> getPrimitiveType() {
        return PersistentDataContainer.class;
    }

    @NotNull
    @Override
    public Class<C> getComplexType() {
        return collectionClazz;
    }

    @NotNull
    @Override
    public PersistentDataContainer toPrimitive(@NotNull C collection, @NotNull PersistentDataAdapterContext persistentDataAdapterContext) {
        PersistentDataContainer pdc = persistentDataAdapterContext.newPersistentDataContainer();
        int index = 0;
        for(D data : collection) {
            if(data == null) {
                throw new IllegalArgumentException(MUST_NOT_BE_NULL);
            }
            pdc.set(getKey(index++),dataTypeClazz,data);
        }
    }

    @NotNull
    @Override
    public C fromPrimitive(@NotNull PersistentDataContainer persistentDataContainer, @NotNull PersistentDataAdapterContext persistentDataAdapterContext) {
        return null;
    }

    private static NamespacedKey getKey(final int name) {
        return getKey(String.valueOf(name));
    }

    private static NamespacedKey getKey(final String name) {
        return NamespacedKey.fromString("_:" + name);
    }
}
#

it allows to save collections to a PersistentDataContainer

glossy venture
#

jezus

#

ah

tender shard
#

but yeah hm

tardy delta
#

what format does it use internally? 👀

glossy venture
#

oh the toPrimitive converts it to a map or something

tardy delta
#

strings?

tender shard
#

ooooh I found the error

#

I am stupid

glossy venture
#

that can be serialized

tender shard
#

I need a third generic type

#

I am so stupid lol

#

I wanted to save a PersistentDataType<?,PersistentDataType<?,?>>

#

that doesn't make sense

glossy venture
#

ah yes of course

fervent gate
#

Is there an event for the player rotating it's head?

tender shard
#

PlayerMoveEvent

fervent gate
#

Didn't know that included that, thx

grim ice
#

every mouse or keyboard movement counts for it

grim ice
glossy venture
#

yeah

grim ice
#

jk ik ur still working on it

glossy venture
#

nah but i get so confused by that shit

grim ice
#

and my lib comments are still kinda messed up from older versions

glossy venture
#

it looks intimidating

grim ice
#

not really

glossy venture
#

at first glance

brisk ravine
#

hey all Im in need of some assistance with a plugin im using. Its suppose to give a player a heart each time they get an achievement but when ever I use it on a paper server the hearts are only visual and dont actually boost the players health. Where as it doesnt work on a spigot server. It will load the plugin like normal and even allow you to run the start command but it doesnt give you extra hearts when getting an advancement

grim ice
#

DataCollection is a class that needs a collection of D and its named C. D should extends persistent data type of <?, D>. DataCollections also implements PersistentDataType<PersistentDataContainer, C>

#

simple

lime jolt
#

does anyone know how to reset a plugin without having to restart the server

tardy delta
rough drift
#

?learnjava (i only need the links go on with your convo)

undone axleBOT
tardy delta
tardy delta
#

^^

tender shard
brisk ravine
# tardy delta does it work on a spigot server?

It doesnt. It will allow me to load the plugin and it will also allow me to issue the start command even giving me the go ahead in chat but once i get an achievement nothing happens and it gives me an error in my serer log

tender shard
#

I have no idea on how to continue in the pdc.set method

lime jolt
grim ice
#

not the developer :)

#

but whats ur problem

#

even though you know way more than me maybe i can help dunno

undone axleBOT
tender shard
# grim ice but whats ur problem

check the line with ???

public class DataCollection
        <C extends Collection<D>, T extends PersistentDataType<?,D>, D>
        implements PersistentDataType<PersistentDataContainer,C> {

    private static final String MUST_NOT_BE_NULL = "Collections stored in a PersistentDataContainer must not contain any null values.";

    private final Class<C> collectionClazz;
    private final T dataType;

    public DataCollection(Class<C> collectionClazz, T dataType) {
        this.collectionClazz = collectionClazz;
        this.dataType = dataType;
    }

    @NotNull
    @Override
    public Class<PersistentDataContainer> getPrimitiveType() {
        return PersistentDataContainer.class;
    }

    @NotNull
    @Override
    public Class<C> getComplexType() {
        return collectionClazz;
    }

    @NotNull
    @Override
    public PersistentDataContainer toPrimitive(@NotNull C collection, @NotNull PersistentDataAdapterContext persistentDataAdapterContext) {
        PersistentDataContainer pdc = persistentDataAdapterContext.newPersistentDataContainer();
        int index = 0;
        for(D data : collection) {
            if(data == null) {
                throw new IllegalArgumentException(MUST_NOT_BE_NULL);
            }
            pdc.set(getKey(index++), ???, ???);
        }
    }
tardy delta
#

whoah alex

#

you need a persistent data type?

brisk ravine
#

I took a screenshot of it but didnt copy paste it since its on my server pc

tender shard
tardy delta
#

🤔

tender shard
#

I think I get it

grim ice
#

@tender shard ur not restricting the type of Collection

wary harness
#

any one can tell how it this done

grim ice
#

i can also use Collection<Integer>

grim ice
#

and u wont cry about it

tender shard
#

it can be any collection that can be instantiated with an empty constructor

lime jolt
#

...

#

//this?

wary harness
grim ice
#

No

tardy delta
wary harness
#

I am curious how they rotate player hands and body

tender shard
tardy delta
#

there's a bug too, when you do such a thing and rightclick, it kicks you

tardy delta
#

is it a spigot plugin?

brisk ravine
tardy delta
#

lol is it a popular plugin?

grim ice
brisk ravine
#

"this plugin requires a papermc/spigot server to run"

tardy delta
#

or are you just using a wrong server version?

brisk ravine
#

Im using the server version from the video they posted

#

The plugin was created by FredtheDoggy

tardy delta
#

lol how old is that video

brisk ravine
#

Im also in his discord

#

A couple weeks

#

they used 1.18.2 because they had the new caves and what not

tender shard
#

I GOT IT WORKING

brisk ravine
grim ice
#

how :o

#

congratz

tender shard
#
public class DataCollection
        <C extends Collection<D>, T extends PersistentDataType<?,D>, D>
        implements PersistentDataType<PersistentDataContainer,C> {

    private static final String MUST_NOT_BE_NULL = "Collections stored in a PersistentDataContainer must not contain any null values.";

    private final Class<C> collectionClazz;
    private final PersistentDataType<?,D> persistentDataType;

    public DataCollection(Class<C> collectionClazz, T persistentDataType) {
        this.collectionClazz = collectionClazz;
        this.persistentDataType = persistentDataType;
    }

    @NotNull
    @Override
    public PersistentDataContainer toPrimitive(@NotNull C collection, @NotNull PersistentDataAdapterContext persistentDataAdapterContext) {
        PersistentDataContainer pdc = persistentDataAdapterContext.newPersistentDataContainer();
        int index = 0;
        for(D data : collection) {
            if(data == null) {
                throw new IllegalArgumentException(MUST_NOT_BE_NULL);
            }
            pdc.set(getKey(index++), persistentDataType, data);
        }
    }
#

well of course not done yet but the only hard part is done

brisk ravine
grim ice
#

yeah u just did what i told u :o

#

which u prob had the idea of before me saying it kek

tender shard
tender shard
grim ice
elfin atlas
#

Question when I'll try to spawn Block_Crack particle how can I set the block type?

grim ice
#

yeah

tender shard
#

yeah of course the first one is the data type and the second the data 😄

grim ice
#

yeah so what was the matter lol

tender shard
#

the problem was I used the generic type T in the persistentDataType field instead of declaring it to be PersistentDataType<?,D>

glossy venture
#

are there pdc data types that serialize into binary directly?

tender shard
#

yes

glossy venture
#

how do you make one

tender shard
#

PersistentDataType.BYTE 😛

glossy venture
#

bruh

#

top 10 bruh moments of 2022

tender shard
#

the builtin datatypes all are mapped 1:1

#

byte = byte, byte[] = byte[], ...

#

int = int

grim ice
#

T extends PersistentDataType<?,D>

#

you changed nothing?

tender shard
#

I changed it in the field

grim ice
#

or am i misunderstanding

tender shard
tender shard
grim ice
#

yeah you just used its parent

#

did that fix anything

tender shard
#

yes, the toPrimitive thing is working

glossy venture
#

i have another controversial coding opinion but idk if i should post it

quaint mantle
#

post it

tender shard
#

post it

glossy venture
#

nbt is better

tender shard
#

or get rekd

glossy venture
#

L

tender shard
#

NBT is like the small ugly drunk grandfather of PDC

glossy venture
#

lmfao

tender shard
#

I mean

glossy venture
#

agree, but hes buff

tender shard
#

without NBT there wouldn't be PDC

grim ice
#

abstraction is cool

glossy venture
#

i just dont like how pdc is implemented in this case

grim ice
#

pdc > nbt

glossy venture
#

and nbt serializes straight to binary

tender shard
#

the question is only now

#

how to use it

#

lmao

glossy venture
#

nice

grim ice
#

the comment doesnt explain anything

#

Lol

#

C extends Collection
// C is a collection
no way

glossy venture
#

its a start

tender shard
#

lmao this will get messy

#

I think I'm still doing something wrong here

glossy venture
#

you know i actually got a small adrenaline rush from posting nbt is better lmfao

#

thought i would have to run from the entire development community

#

nah

#

more types

#

its kinda cool i checked it out

hasty prawn
#

kinda

grim ice
#

it is cool

#

abstraction

glossy venture
#

persistent data types

glossy venture
quaint mantle
glossy venture
#

but it is cool

quaint mantle
grim ice
#

yeah it does

#

?

#

what does that change

quaint mantle
#

no

grim ice
#

nms bad

quaint mantle
#

i know packets but not minecraft packets

grim ice
#

little to no abstraction

hasty prawn
#

What are you trying to do sysdm

tender shard
hasty prawn
#

Isn't there like 189237 forum threads on that lol

tardy delta
#

lets add (@ for help) behind my name too

hasty prawn
#

Ah KEKW

grim ice
#

btw sysdm ur website has a misspelling

#

u spelled experience as experince

unreal quartz
#

Literally unusable

tardy delta
#

:(

grim ice
#

Doubt

glossy venture
#

bruh

tardy delta
#

i dont have a fancy orange name color

grim ice
#

fourteen how many years?

unreal quartz
#

Fantastic website

tardy delta
#

uhh

unreal quartz
#

Literally all I can see 😂

tardy delta
#

lemme think

grim ice
#

fourteen doesnt suck afaik

tardy delta
#

2 years java

#

and then some other stuff

glossy venture
#

looks pretty cool tho

#

on desktop

#

at least

grim ice
#

thats not little

tardy delta
#

im learning fast 🤣🤣

#

lol theres not much there

grim ice
#

whats the most complicated thing u know if u remember @tardy delta

tardy delta
#

UUUUH

glossy venture
#

code battle

grim ice
#

how do u not understand english

glossy venture
#

who more experienced

grim ice
#

lol what

tender shard
#

I need help D:

grim ice
#

no you read it

glossy venture
tardy delta
grim ice
#

mostly everyone knows these

#

u dont know what comments are

glossy venture
#

yeah they do

#

its most common practices

grim ice
#

no talk about oop

#

u literally got confused over it before

tardy delta
#

lol i dont know all those abbreviations

#

only oop

#

and abstraction polymorphism and design patterns

grim ice
#

Yeah i guess

#

cant get cocky here among yall 💀

tardy delta
#

i always confuse the names lol but i know how to implement them

grim ice
#

yeah

#

but like

#

being cocky here

#

is a death wish

unreal quartz
ivory sleet
#

to some extent yes

tardy delta
#

kiss is 💋

grim ice
undone axleBOT
#

If you have a question, please just ask it. Don't look for staff or topic experts. Don't ask to ask or ask if people are awake or available. Just ask the question to the channel straight out, and wait patiently for a reply. Make sure you use the right channel regarding the topic of your question. Create a thread in case the channel is already in use!

hasty prawn
#

Have you tried Mob#getNavigation().createPath()

grim ice
#

I love to use this

glossy venture
#

i dont know all the acronyms but its a bit unfair to go by coding practices by an obscure name. if you stated all of them in normal terms i bet most people would know a good amount of them

grim ice
#

especially on mfn

#

JK

ivory sleet
#

mind sending a msg link?

#

probably not

tardy delta
#

lol dry is just avoiding repeating code

#

makes sense to do that by default

tender shard
# grim ice ?ask

well on compile time, it works. but a bit hard-to-read. I'll probably turn it into a static constructor

#

and then see if it really works lmao

glossy venture
#

why did u use the constructor here

ivory sleet
#

2Hex explain humble objects principle

glossy venture
#

bruh

tender shard
glossy venture
#

ah

tender shard
#

no

#

list will not work

#

check out the code:

tardy delta
glossy venture
#

dude List is uninstantiable

tender shard
grim ice
#

@ivory sleet i actually dont know that

ivory sleet
#

the implementation is important sysdm

tender shard
#

I am instantiating the list with reflection

ivory sleet
#

so liskovs sub principle doesnt apply

grim ice
#

however i know the ones he mentioned

#

xD

tender shard
#

yeah that won't work

#

because my DataType expects an ArrayList

#

or well

#

when reading, it requires ArrayList

tardy delta
#

List is an interface lol

tender shard
#

when writing, a list is fine

grim ice
#

abstraction is hiding impl details, can be done in multiple ways using interfaces and abstract classes

tender shard
#

it wouldn't work with a list

grim ice
#

a short one

tender shard
#

well it would work with a list if one only needs to write to PDC, and not read

grim ice
#

explain it for me then

#

Though I wanna see yours

hasty prawn
#

thats basically what he said

#

You just reworded it lol

ivory sleet
#

Humble objects principle is a principle applied when designing design in multi threaded environments, it states that any object which encapsulates logic that does not relate to multi threading and concurrency must be isolated into its own object rather than combined and exposed to multi threading and concurrency details. This should help testing.

grim ice
#

Lol

glossy venture
#

exactly what he said

ivory sleet
#

Abstraction is yeah detail hiding, expose high level terms such as what but avoid how

grim ice
#

well

glossy venture
#

but do you need to know all these principles to write a program? or are they just something that you do automatically

grim ice
#

each class can be replaced with its super class

#

im thinking of an example

ivory sleet
#

it can enhance the design of a system orbyfied

#

it becomes significantly important in enterprise and team projects

glossy venture
#

good practice should come with experience, not knowing what the good practice is called and where it comes from

#

might help on an interview

ivory sleet
#

altho it is quite difficult to master them as they only focus on general problems and not exceptional cases that you will run into frequently

cosmic pelican
#

@glossy venture Have you worked for an actual company?

#

Or are you some kid who learned Java via Spigot?

glossy venture
#

no im 14

cosmic pelican
#

Then don't comment on things you know nothing about.

glossy venture
ivory sleet
#

these "good practices" that have been discovered have over the years been turned into theorems, principles and patterns

grim ice
#

yeah

grim ice
glossy venture
#

it might help on an interview

cosmic pelican
#

^

glossy venture
#

you do up experience by learning them

cosmic pelican
glossy venture
#

idk if "you do up" is english but you know what i mean

cosmic pelican
ivory sleet
#

For all A and B there exists an A and B such that A and B can be expressed in terms of S. Then if and only if exposed to A, then A must be substitutable to B.

cosmic pelican
#

You can make a program, and have it run. Doesn't mean it's a good program.

grim ice
glossy venture
#

im saying its the other way around

grim ice
#

right>

ivory sleet
#

2hex

#

yes

#

general idea is to create a delegate for the logic itself

#

and let it be wrapped around the concurrency accountable object

grim ice
#

forgor

quaint mantle
#

guys i have a probelm with titles api i imported titleapi with
import com.connorlinfoot.titleapi.TitleAPI;

and in the player join event i put this

        TitleAPI.sendTabTitle(event.getPlayer(), "Players Online:", "Tell your friends!");```

and if i join in the server not work
grim ice
#

since like

#

an object does only what it should do well

ivory sleet
#

SRP is extremely shallow tho

grim ice
#

adding the logic of concurency

glossy venture
ivory sleet
#

what is defined as one responsibility tho?

grim ice
#

will add another thing to do

ivory sleet
#

its not exactly clear

glossy venture
grim ice
#

for example

ivory sleet
#

as its very interpretative

#

If you go full on srp you might as well just have one function per class

quaint mantle
grim ice
#

a class shouldnt have a method to kill a player and to say hello in chat

hasty prawn
glossy venture
ivory sleet
glossy venture
cosmic pelican
#

You are way out of your field here. You have no idea who you're talking to

ivory sleet
#

because when you can formalize practice into theory you become a far more powerful programmer

glossy venture
#

i dont think ur getting my point

quaint mantle
cosmic pelican
#

Your point is retarded, and invalid.

glossy venture
#

help

ivory sleet
cosmic pelican
# hasty prawn You have a massive ego.

Because I earned it.

I have 8 years of experience with Java. I work with Lunar Client developers, and have been offered positions by numerous large networks such as PvPWars.

ivory sleet
#

For instance you often see List<O> list = new LinkedList<>();

grim ice
#

Yeah i get that

ivory sleet
#

now that would be changeable to ArrayList right?

hasty prawn
grim ice
#

yeah

ivory sleet
#

since ArrayList and LinkedList offers the same functionality

grim ice
#

thats polymorphism right

#

thats what we're talkin about?

ivory sleet
#

then we can simply expose the variable in terms of List instead of ArrayList or LinkedList

#

well

grim ice
#

or r we talking about liskov principle

ivory sleet
#

liskov substitution principle does imply polymorphistic existence

cosmic pelican
grim ice
#

i know that and its greek origin

ivory sleet
#

anyhow

#

2Hex

hasty prawn
ivory sleet
#

For instance

grim ice
#

yes

cosmic pelican
hasty prawn
cosmic pelican
#

But he's acting like it. I suggest you stick to things that concern you. This is none of your business, random.

hasty prawn
#

Lmfao

ivory sleet
#

its fine to sometimes do
ImmutableList l = ImmutableList.of()
or
IdentityHashMap m = new IdentityHashMap<>();

altho this is usually very questionable
EnumMap<X> m = EnumMap.of(X.class);

^do u know why 2hex?

undone axleBOT
glossy venture
#

was to copy

#

into a thread

#

move on

cosmic pelican
#

LOL

#

That was funny

ivory sleet
#

Guys lets not be rude now

cosmic pelican
#

Nah he's cool

#

That made me laugh

ivory sleet
#

alr, dont want this chat to turn into a principle and validation of experience source war

glossy venture
cosmic pelican
#

LMAOOOO

grim ice
#

idk

#

LOL

cosmic pelican
ivory sleet
#

its fine to argue but avoid heating it up 😄

ivory sleet
#

IdentityHashMap breaks the contract of Map and ImmutableList breaks the contract of List

#

however EnumMap does not break the contract of Map

#

2hex

grim ice
#

ISTG I KNEW THAT

ivory sleet
#

ye

glossy venture
grim ice
#

I WAS GONNA SAY IT BUT I DELETED IT LMFAO

ivory sleet
#

🥲

#

ye

cosmic pelican
grim ice
#

but then i thought EnumMap accepts 1 param and Map accepts 2 so i deleted it

cosmic pelican
#

Thank you

ivory sleet
#

ah

#

well thats it basically

cosmic pelican
#

@glossy venture Admitting you're wrong is a part of learning.

glossy venture
#

what facts

ivory sleet
#

altho people still do Map m = new IdentityHashMap(), mostly due to convenience

glossy venture
ivory sleet
#

and has nothing to do with liskovs sub principle

glossy venture
#

but i stand by my point

cosmic pelican
# glossy venture what facts

That learning design patterns, principles, and practices that are proven to work make you a better developer than others.

ivory sleet
#

so yeah 2hex

#

its more of a mathematical principle

cosmic pelican
glossy venture
grim ice
#

so using e.g Inter Impl is better than Impl Impl

tardy delta
#

IdentityHashMap map = new IdentityHashMap() too long

ivory sleet
#

uh

#

var map

#

if u hate verbosity that much

tardy delta
#

java8+ lol

cosmic pelican
ivory sleet
#

everything under java 17 is deplorable, sorry for your loss

grim ice
#

because it abstracts away the impl details, achieves polymorphism, then encourages LSP

tardy delta
#

xd

ivory sleet
#

well object oriented programming sucks to some extent also 2hex

grim ice
#

I'm in love with it

ivory sleet
#

if you wanna continue :>

#

nah

grim ice
#

i always struggle when trying to learn any language that isnt oop

glossy venture
#

sysdm just sent a bunch of acronyms and then i stated "you dont need to know what those acronyms mean to be able to use those principles, you might not have even known you were using them because its such common practice"

ivory sleet
#

it almost always sucks, but it provides a decent solution, tho never the correct one, just not the wrong one

glossy venture
#

but if i understood wrong, then thats on me

sharp bough
#

what should i use for normal messages in the console? sout or getLogger().info(ChatColor.<color> + "message goes here"); ?

cosmic pelican
#

99% of developers in this community are retards

tardy delta
#

i prefer logger

glossy venture
grim ice
#

ig

ivory sleet
#

because functional is gonna twist your mind

grim ice
#

also @cosmic pelican you definitely wasted time on these 8 years, because those 8 years will never increase, theyre always an eight, due to your ego lol

ivory sleet
#

and procedural is just oo but less powerful

quaint mantle
#

@glossy venture the chat it's bugget can you open a new ?

tardy delta
grim ice
#

and oop makes sense

cosmic pelican
cosmic pelican
#

I don't let my ego get in the way of facts.

ivory sleet
#

let me tell you the issue of object orientation then 2hex

cosmic pelican
#

^^^

glossy venture
#

i learnt it by making other stuff first

#

before moving on and then back to spigot

quaint mantle
grim ice
mellow edge
#

oh xd

cosmic pelican
glossy venture
cosmic pelican
#

You just started a useless argument because you're butthurt.

quaint mantle
glossy venture
#

oh sure ill open a new one

quaint mantle
#

okay

glossy venture
#

i agree but they can learn

cosmic pelican
grim ice
#

you know fucking shit if youve been learning for 8 years and you still act like this

cosmic pelican
#

I haven't been learning for 8 years.

#

I said I've been programming in Java for 8 years.

grim ice
#

yeah?

cosmic pelican
#

That's a dumb argument.

glossy venture
#

what?

#

you mean not using spigot

grim ice
#

and i bet someone like

glossy venture
#

i dont get what ur saying sorry

tardy delta
#

?paste

undone axleBOT
cosmic pelican
#

My guy, all you have to back up your statements is my attitude. Get over it, and cry.

grim ice
#

Redempt who has a similar amount of years of experience as you

#

knows way better than you do lo

cosmic pelican
#

Idk who redempt is

#

Sounds like a random

glossy venture
#

i know

hasty prawn
glossy venture
#

he said "an API"

glossy venture
#

yeah

#

oh yeah i agree

cosmic pelican
#

Spigot's community maybe, not MC in general.

hasty prawn
#

Well that's where we are, isn't it? 😛

cosmic pelican
#

In a combination.

ivory sleet
#

I remember when someone used to call Spigot a "Minecraft Performance Software Engine"

glossy venture
#

thats why the ?learnjava command exists, sadly like noone ever listens, but thats because they want to get straight into development

hasty prawn
#

True

cosmic pelican
#

I see people here that work for large servers.

#

@quaint mantle works for AkumaMC

glossy venture
#

without doing the "boring" stuff

cosmic pelican
#

@faint sage works for Lunar Client

#

@weary geyser works for MineWars

#

And the list goes on but I don't want to bother a bunch of people

tender shard
#

okay I got a question. What would you prefer?

DataType.asList(DataType.ITEM_STACK)
or
DataType.list(DataType.ITEM_STACK)
??
cosmic pelican
#

At some point but sold it for a large sum.

cosmic pelican
#

Still has the entire VanityMC & Mythonia management backing it.

tender shard
cosmic pelican
#

Literally 🤣

#

He gets the server 1k+ alone.

#

He changed it to the cat!

#

Well

#

It's changed a couple times

#

but the Lil Peep one is the OG, yes.

#

Yeah haha

#

sysdm and I are still in the Management GC for MW loool

faint sage
#

🦛

cosmic pelican
#

HAHAHAHA

#

SPACEMC

#

Dude I remember that

#

That was so long ago

#

Old name?

faint sage
#

what was the drama i missed

cosmic pelican
#

Meh I don't remember it anyway

glossy venture
#

big stupid argument

cosmic pelican
glossy venture
#

was kind of fun

tardy delta
#

lol

cosmic pelican
#

lmaoo

#

Gizmo?

#

Oh god

#

Of course lol

#

Callum isn't a random

#

he's a very "spooky hacker man" KEKHYPER

#

He used to think he was spooky

#

LOL

#

Pls dont ddoz me

#

I am scared of ddoz

#

😮

#

😭

quaint mantle
cosmic pelican
#

Feel free to lmk in dms

quaint mantle
#

not gonna talk about it tbh

#

priv stuff

cosmic pelican
#

fair

glossy venture
#

im stupid

#

ah yes

rough drift
#

would updating an item stack from PlayerInteractEvent updat e it in the inv?

ivory sleet
#

ye

#

I think so

glossy venture
#

yeah its passed by reference right

ivory sleet
glossy venture
#

for objects it passes object references

rough drift
#

stuff in classes update tho

glossy venture
#

which are 64 bit values i think

ivory sleet
#

well in the eyes of Java

cosmic pelican
#

Yeah

ivory sleet
#

they even mention in their specs that the language only provides pass by value

#

ofc objects are just references under the hood

cosmic pelican
#

LMAO

#

NO WAY

glossy venture
rough drift
#

if i do

MyStuff stuff = //

stuff(myStuff);

// if i edit myStuff.something it will also be edited after the method call
cosmic pelican
#

Yikes

rough drift
#

what happened

rough drift
#

LMFAO

#

why'd they get demoted

glossy venture
#

what happened

tender shard
#

OMG YOU CAN'T BELIEV HOW HAPPY I AM

hexed hatch
#

what a smart boy

hasty prawn
ivory sleet
tender shard
#

now I can just do

pdc.get(someKey,DataType.asList(DataType.ITEM_STACK))
ivory sleet
#

thats useful

tender shard
#

yeah but now...

#

I gotta add maps

ivory sleet
#

isnt that alr added

#

or well

tender shard
#

builtin is almost nothing

ivory sleet
#

PersistentDataContainer.PDC_TYPE

#

or sth

#

ah

#

right

tender shard
#

yeah, PersistentDataType.TAG_CONTAINER

#

but that only maps NamespacedKeys to data

#

I want to make it work with HashMap<Object,Object>

ivory sleet
#

oo

hasty prawn
#

:o

tender shard
#

my Lists and Sets already work with every possible custom data type

hexed hatch
#

how

tender shard
#

one sec

hexed hatch
#

he's a witch, burn him

hasty prawn
#

he's too smart peepoRiot

safe edge
#

I need to add dependecy for this version if I want this to start working ?

chrome beacon
#

Yes

tender shard
grim ice
#

btw

hasty prawn
tender shard
#

yeah the description isn't lying

grim ice
#

why not just use jitpackio

tender shard
#

"adds a ton of new persistent data types"

tender shard
#

jitpack is the slowest, worst repo ever

#

yes

grim ice
tender shard
#

so why not just use it for my public stuff as well

grim ice
#

what if u dont

ivory sleet
#

central :3

grim ice
#

maven central?

ivory sleet
#

ye

grim ice
#

isnt it complicated to get it in there

#

lmao

tender shard
#

if I ever find out on how to upload sth to central, I'd use that

ivory sleet
#

ye

#

or well

#

sorta

#

I am using nexus also

#

but central is nice

tender shard
#

but I like selfhosting anyway, this way I can also see how many people roughly use my stuff

#

oh and another downside of central:

grim ice
#

de toute facon, j'ai besoin d'une idee d'un library

tender shard
#

you cannot redeploy and I tend to upload stuff with forgotten debug messages

grim ice
#

ok french is prob not allowed

tender shard
#

oh

#

then my stuff wouldn't work there anyway

grim ice
#

i need an idea for a library

tender shard
grim ice
#

milked

tender shard
#

a worse commandhandler

grim ice
#

i need a new idea

#

like the one i made

#

ive never seen one like it without nms

tender shard
#

I always just come up with library ideas when I discover I already made the same thing twice

#

e.g. parsing custom recipes

grim ice
#

oh

tender shard
#

I already made that half a year ago though

grim ice
#

how to get a recipe materials

tender shard
muted sand
#

is there an event that fires when a FallingBlock turns into a regular block-?

grim ice
#

for example

eternal night
#

EntityChangeBlockEvent

muted sand
eternal night
#

o.O ?

muted sand
#

or i am just plain stupid

grim ice
#

Recipe.getMaterials() returns {DIAMOND, DIAMOND, DIAMOND, DIAMOND, DIAMOND, DIAMOND, DIAMOND, DIAMOND, DIAMOND}

#

for a diamond block

tender shard
grim ice
#

that alr exists

#

u just checked my github

#

lol

muted sand
#

yea probably

muted sand
tender shard
#

that's on my todo list already :3

grim ice
#

kekw

#

idea robber! POLICE HELP

#

jk

tender shard
#

is reflection allowed though?

grim ice
#

no

tender shard
#

why not

#

then it'll just get messy

grim ice
#

Nope

#

check my github

tender shard
#

reflection good for many things

grim ice
#

I did it without nms

#

or reflection

tender shard
#

but does it serialize to readable text?

grim ice
#

No

#

well yeah

#

it does

#

to text you choose

tender shard
#

can you show an example of a serialized entity?

grim ice
#

fr example

#

serializin

#

an entity to

#

"dumbIdiot"

#

then u can convert dumbIdiot to the entity back

tender shard
#

so it's not really serialized to text

grim ice
#

its kind of a kv pair

#

but i used "Serializer" since it would be easier to understand like that

tender shard
#

we need sth like "serialize(pig)" which turns it into a json that you can copy over to another server, and then deserialize it

grim ice
#

Lol

#

good luck wasting time on that

#

that would be cool though

tender shard
#

well one could probably easily get all field values with reflection

#

at least everything serializable

grim ice
#

yae

#

but messy

tender shard
#

UUID, name, health, attributes, ...

ivory sleet
#

gson could probably deal with that rather sophisticatedly

grim ice
#

btw mfn

tender shard
ivory sleet
#

nope

grim ice
#

do u know how i serialized chunks and entities

#

without nms

#

or reflect

ivory sleet
#

gson has failed me many times

tender shard
grim ice
#

yes

#

kekw

tender shard
#

yay

#

yeah that's why I asked whether you could turn them into actual text

#

or byte[] or whatever

grim ice
#

did u see someone else saying it or did u actually guess

#

u can

tender shard
#

I guessed that because this way it's saved internally

grim ice
#

theyre stored in world file but u can change that

#

to another file

tender shard
hexed hatch
#

alex do you want your next big challenge

tender shard
#

even if the json just consists of a byte array

tender shard
lean gull
#

how do i use a custom font in item lore?

hexed hatch
#

data driven potion recipes

tender shard
#

but I still have to add maps to my lib

hexed hatch
#

and make the brewing stands work with custom materials somehow with packet fuckery

grim ice
#

i dont even know how the structures look inside a world file

#

ill try that LMFAO

grim ice
#

nms is cringe

hexed hatch
#

what are you a liberal

tender shard
#

I only use a tiny amount of NMS in JeffLib

grim ice
#

still

#

usage of nms

#

cringe

tender shard
#

e.g. sending packets or changing materials maxStackSize

grim ice
#

u were prob forced but

#

cringe

tender shard
grim ice
#

ik

#

the fact that its required is cringe

tender shard
#

e.g. my StackResize plugin just needs NMS, there is simply no other way

grim ice
#

what does it do

hexed hatch
#

considering forking spigot and adding data driven potion recipes

#

I want it to be formatted with json files like Mojang does it for the recipes and shit

lean gull
hexed hatch
#

Nope. That lore is something you have to set yourself

ivory sleet
hexed hatch
#

gpu accelerate my ass

grim ice
#

btw

#

how to get the materials

ivory sleet
grim ice
#

of a recipe

tender shard
grim ice
#

I like that a lot

tender shard
#

yeah I'll upload it in a few days

grim ice
#

amazing

tender shard
#

some things are still buggy

hexed hatch
#

and in containers?

tender shard
grim ice
hexed hatch
#

If so, I want that on my private survival server immediately

grim ice
#

i can loop the entryset

lean gull
#

how do i put a text component in item lore

hexed hatch
#

I have some auto potion machines and the storage of those motherfuckers is atrocious

hexed hatch
#

You put a string in item lore with spigot

grim ice
#

lets hope the getIngMap replaces null with air

#

it prbo deosnt

lean gull
#

mfnalex told me u can

hexed hatch
#

mfnalex is wrong

lean gull
#

how do i use font in item lore then

tender shard
hexed hatch
#

You die.

#

Simple as that

tender shard
#

I guess 99% of people here actually use paper lol

hexed hatch
#

Instantaneous death

tender shard
#

I mean, everyone uses paper to test, spigot takes way too long to start the server lol

hexed hatch
#

The Paper Inquisition is nigh

tender shard
#

yeah and paper is like 2 seconds for all worlds lol

#

only times when I actually use spigot is when I am debugging since 3 hours and can't find a reason why it behaves so weird

lean gull
tender shard
#

then I have to make sure it's not a paper bug

tender shard
grim ice
#

wait yall dont go pee when ur server is starting

#

??

#

wow

#

dehydrated fucks

#

more.

#

no.

#

i still have plenty

#

of liquid

hexed hatch
#

Not sure if it'll work but it's worth a shot

lean gull
#

i did

dire marsh
#

Spigot be like:
Preparing spawn area: 0%

lean gull
#

it still counts as a text component

grim ice
#

that takes 1 min max

dire marsh
#

2Hex most patient person here

grim ice
#

guess you wouldnt live a few seconds with my biological family

hexed hatch
#

You could look into the Paper api, I feel like it'd have something for that

tender shard
#

fuck the system

grim ice
#

LOL

#

String

hexed hatch
#

Of course it does

#

I wish spigot would just eat the good parts of the paper api

dire marsh
#

adventure is great for tooltips and stuff

#

absolute hell if you want a simple string with lots of colours

tender shard
#

fuck the system a bit more

lean gull
#

papermc Component doesn't have font

dire marsh
#

what?

hexed hatch
lean gull
#

no pls i beg

hexed hatch
#

There is no escape

tender shard
#

I have to admit, until a few months ago I always thought a Map is also a Collection

hexed hatch
#

I'm genuinely annoyed that spigot lacks a proper api for making items and entities nbt files

tender shard
hexed hatch
#

no that takes effort alex

#

I don't do that

tender shard
#

oh

#

relatable

lean gull
#

who what where when

tender shard
#

yo help

#

are there any commonly used maps or collections

grim ice
#

mfn

tender shard
#

that don't have a no-args constructor?

grim ice
#

are arrays collections

tender shard
#

no

#

lol

grim ice
#

makes sense

tender shard
#

Arrays implement Iterable<T> though

grim ice
#

well then

tender shard
#

collections must have an add(E) method

#

which arrays don't have

grim ice
#

a map is a (sort of collection) of nodes :troll:

tender shard
#

also remove(Object)

grim ice
#

yeah

#

but yk

#

u collect in it :)

tender shard
#

collections are flawed though

#

they have an add method but there are MANY collections that don't allow adding items

#

so why is add part of the interface

#

it makes no real sense

grim ice
#

I in SOLID

#

:o

tender shard
#

what is I in SOLID?

#

I have never studied any computer stuff

hexed hatch
#

indigo

tender shard
#

do you people do

void asd(final @NotNull C asd)

or

void asd(@NotNull final C asd)

?

hexed hatch
#

The latter, like a normal, sane, functional human

tender shard
#

I never remember the "proper" way lol

#

but yeah I guess the second one makes sense since fields mostly also look like this

@NotNull
private final C asd;
grim ice
lavish hemlock
#

Interface Segregation Principle

tender shard
#

another "style" question

tardy delta
#

i like Lists.newArrayList(T... elem)

tender shard
#

would you move the red part into the try catch block?

lavish hemlock
#

Yeah, I would

tender shard
#

I thought so too when I looked at this

tardy delta
#

a bit cleaner

lavish hemlock
#

Yeah it's less jarring.

tender shard
#

I think I'll have this piece of shit done in an hour

#

then I'll celebrate by staying awake till 7 am doing nothing

#

Maow was that you who had a lib for collections in PDC?

#

or was that redempt?

lavish hemlock
#

Nah I haven't made any libs

#

I've been planning on working on a GUI lib though

tender shard
#

hm then it must have been redempt or someone else

#

that would be nice

#

there are many but I never liked any of those

#

why can't interfaces have private fields >.<

shadow owl
#

Anyone know if there is a replacement for LocalDateTime for Spigot? Since timing in Spigot aren't necessarily aligned with real-world times?

#

eg: server isn't always running at 20 tps

lavish hemlock
#

Just convert LocalDateTime to ticks

#

I've done it before, it works just fine

tender shard
lavish hemlock
#

LocalDateTime represents a real date and time

shadow owl
#

I want the time between some time captured in the past and time captured now, but yea, I guess I can use the tick values

lavish hemlock
#

You can return the amount of seconds between "now" and another instance of LocalDateTime

#

and then secs * 20 to get the ticks

tender shard
lavish hemlock
#

I've not seen any evidence that suggests the TPS matters in that conversion

tardy delta
#

or just compare a long with system.currentimemillis?

lavish hemlock
tender shard
#

doesn't java have timers builtin that run at a specified actual time?

tardy delta
#

ye

shadow owl
#

Yes. But basically, I'm checking for the time since a scheduled task was scheduled

tardy delta
#

forgot the name

shadow owl
#

So 1). schedule task and store tick count, and then 2). compare current tick count to stored tick count

torn oyster
#

how would i get the name of an inventory

shadow owl
tender shard
#

I wonder why there's no Inventory#getTitle

neon nymph
#

Ello guys, could someone explain how "ascent" and "height" works in texture packs? Specifically...

"type":"bitmap","file":"path","ascent":2,"height":42,"chars":["ꌖ"]}
``` These
tender shard
#

wtf are those weird symbols on the right? I've never seen that before

#

nothing

#

my brackets are rainbow colored 😄

#

they are different depending on the nesting

#

ah I think it's the code folding

#

weird, I've never seen that before

#

not much, only installed a plugin for fancy bracket colors

#

but that was months ago

#

and I only saw this now lol

minor fox
#

It’s matching with my git edits atleast

tender shard
#

yeah you're right

#

thanks:D

#

mystery solved

quaint mantle
#

hi alex ❤️

tender shard
#

wow all those generics hurt my brain

lavish hemlock
#

they tend to do that

quaint mantle
#

generics are cool

lavish hemlock
#

yeah

tender shard
#

of course they are

lavish hemlock
#

type parameters are necessary if you ask me

tender shard
#

but they are also very disturbing

lavish hemlock
#

i n d e e d

tender shard
#

I am so happy when I'm done with this lib

quaint mantle
#

pog

tender shard
#

collections, arrays and maps for all datatypes

#

e.g.

PersistentDataType type = DataType.asHashMap(DataType.UUID,DataType.asList(DataType.ITEM_STACK));
#

that would return a PDC datatype with which you can store and load a HashMap<UUID,List<ItemStack>>

lavish hemlock
#

woah

a CommandHandöer?

lavish hemlock
#

Reminds me of like, type tokens... in a weird way

tender shard
#

no idea what that is, tbh 😄

quaint mantle
#

gson typetokens

lavish hemlock
#

com.google.common.reflect.TypeToken :p

quaint mantle
#

serialization

tender shard
#

never used that

lavish hemlock
#

It's a reflective utility for capturing a parameterized type

quaint mantle
#

aw

lavish hemlock
#

typically used in libs like Gson for type parameter information within serialization/deserialization

tender shard
#

oh ok, i'm a total gson noob

#

I can use json web apis and that's about it

lavish hemlock
#

iirc...

final Type type = new TypeToken<List<String>>(){}.getType();
quaint mantle
#

yea I think it's that

lavish hemlock
#

Pretty sure Guava's TypeToken is a little cleaner but yeah

tender shard
#

is there any map impl that allows null as key?

lavish hemlock
#

Maybe

tender shard
#

which one?

#

I mean any common one

lavish hemlock
#

I thought HashMap allowed so?

tender shard
#

fr?

#

oh okay. well I'll just disallow this for now

lavish hemlock
#

Oh yeah btw

tender shard
#

since PDC doesn't support null

lavish hemlock
#

Have you considered checking out Lamp?

#

Just sayin', it's a pretty good command lib

#

no need to reinvent the wheel a 20th time

#

Fair 'nough ig

tender shard
#

is it true that the following are actually valid for a NamespacedKey?

.:some-key
-:some-key
_:some-key
#

the docs say

Namespaces may only contain lowercase alphanumeric characters, periods, underscores, and hyphens.

#

so I guess that's fine?

#

awesome

#

first

#

wait

#

depends I guess

#

SubPermission sounds like "node" is also needed as permission

#

add both

#

SubPermission requires the base permission too

#

Just Permission on a subcommand does not require the base permission

#

ACF simply uses CommandPermission

#

so in ACF you have a CommandPermission on the class itself, and a CommandPermission on the SubCommand

#

no idea whether both are required for subcommand

#

so if you make it two annotations, SubPermission and Permission, it's clear what it does

#

:wassup:

#

I've pinged @ Nullable and @ NotNull on github sooo many times lol

#

without it, noone's gonna use it

#

i guess

#

I really wish java would enforce a proper naming scheme