#help-development

1 messages · Page 792 of 1

serene sigil
#

how?

eternal oxide
#

Spigot API

young knoll
#

inb4 legacy version

serene sigil
#

how do i turn this method to the PlayerProfile thing?

#
public ItemStack getCustomTextureHead(String value) {
        ItemStack head = new ItemStack(Material.SKULL_ITEM, 1, (short)3);
        SkullMeta meta = (SkullMeta) head.getItemMeta();
        GameProfile profile = new GameProfile(UUID.randomUUID(), "");
        profile.getProperties().put("textures", new Property("textures", value));
        Field profileField = null;
        try {
            profileField = meta.getClass().getDeclaredField("profile");
            profileField.setAccessible(true);
            profileField.set(meta, profile);
        } catch (IllegalArgumentException | IllegalAccessException | NoSuchFieldException | SecurityException e) {
            e.printStackTrace();
        }
        head.setItemMeta(meta);
        return head;
    }```
rotund ravine
#

Don’t do that

#

Don’t be a dummy

#

?skull

#

Hmmm

serene sigil
#

lol

#

yea i want to get a custom skull form base64

rotund ravine
serene sigil
#

ok

rotund ravine
#

You will get a shitton of warnings in console if u do that

serene sigil
#

oh

#

i see

rotund ravine
#

`[15:23:39 WARN]: Found inconsistent skull meta, this should normally not happen and is not a Bukkit / Sp igot issue, but one from a plugin you are using. Bukkit will attempt to fix it this time for you, but may not be able to do this every time.

If you see this message after typing a command from a plugin, please report this to the plugin developer they should use the api instead of relying on refl ection (and doing it the wrong way).`

young knoll
#

Oh hey that's the new message

serene sigil
#

and what is URL skinUrl = ...;?

eternal oxide
#

new URL(...

serene sigil
#

i know what what is the url?

#

namemc url?

rotund ravine
eternal oxide
#

the mincraft skin url

serene sigil
#

how do i get that?

eternal oxide
#

one sec

#

?paste for me

undone axleBOT
eternal oxide
#

use as you like

young knoll
#

Ew base64

#

So much longer than just the url

eternal oxide
#

it is, but it's just an example

#

there is a method there to pull the url

#

private String getURLFromBase64(String base64) {

storm crystal
#

how did the other way of spawning entities with Consumer Interface look like?

serene sigil
#

so i need to use the public ItemStack getHeadByProfile(UUID id, String name, String base64Texture) method?

rotund ravine
#

Yep

serene sigil
#

so what is UUID id again?

eternal oxide
#

any random id unless you are using an actual player

rotund ravine
#

@storm crystal link me the method in javadoc and i’ll tell u

serene sigil
storm crystal
#

I think I asked the question wrong

#

Someone mentioned there that there is another way of spawning a custom entity

#

as in with custom name, armor etc.

#

instead of spawning it and then editing it

#

like the other way around

eternal oxide
#

UUID.random

serene sigil
#

ohh isee now

eternal oxide
#

or something close

serene sigil
#

and what is the String name argument?

eternal oxide
#

the name that will show on the skull

serene sigil
#

ohh

#

okay

#

and the last is the base 64 right?

eternal oxide
#

yes

serene sigil
#

how do i get that from a namemc profile?

rotund ravine
#

Cry

eternal oxide
#

lol

serene sigil
#

lol

eternal oxide
#

easiest way for you to learn, run that texture through the private method in that code and sysout the result

serene sigil
#

nvm i got it

#

it works

#

ty guys

rotund ravine
#

Ur welcome

#

That’ll be 25$ for my time

#

Elgar took longer and answered more questions, so he’ll take 85$

serene sigil
#

lol

rotund ravine
#

Pleae deposit them into this bank account

#

92852592

eternal oxide
#

missing a few digits there 🙂

rotund ravine
#

Sh

wary harness
#

Hey so I builded system which tracks blocks which are placed by player for older version under 1.16 because they don't have PDC
so for each chunk I got file which stores locations of placed block but only specific ones like Ores
I track them so player can place it again and mine it to get rewards and abuse natural generate block rewars system

#

I am currently saving on chunk unloadevent

#

and load chung load event

#

is that ok

rotund ravine
#

Sure

wary harness
#

or shuld I save data on shutdown

#

and load on chunk load

#

or what I said up is good enought for preformance

ornate patio
#

How can I modify the behavior of a dispenser firing a specific item

knotty aspen
#

BlockDispenseEvent?

#

If you want to shoot a different item, cancel it and shoot your own using the BlockProjectileSource from the dispenser

proud badge
#

Why does the onBlockBreak event sometimes trigger multiple times for the same block?

rotund ravine
#

?

proud badge
#

broke a block once and the event triggered 2-7 times

wary harness
rotund ravine
#

Seems sketchy

wary harness
#

like remove other stuff you got and then test

proud badge
#

there arent any other plugins on my server

#

test server

rotund ravine
#

Logs?

proud badge
#

this is the stacktrace

#

if thats what you mean

rotund ravine
#

That’s unrelated

quaint mantle
#

can someone help me, I made a plugin on IntelliJ Idea and build it into a .jar file and it worked, but then out of no where it start failing and crashing the server, I didn't even do any change to the code. I even tried to creating a new project and transffering the code to the new project but it still crashes the server.

young knoll
#

?stacktrace

undone axleBOT
quaint mantle
river oracle
#

@ivory sleet did u die :(

frail crystal
#

how do i test to see if an itemstack is a certain item?

river oracle
#

depends on what you mean by certain item

frail crystal
#

same item but not nbt or anything

#

like to see if its a minecraft:stick

rotund ravine
#

type

river oracle
#

ItemStack#getType

frail crystal
#

is isSimilar for NBT and stuff?

rotund ravine
#

Yes

river oracle
#

isSimilar compares the data of the item

#

getType just returns the ItemType

rotund ravine
#

Material

frail crystal
river oracle
rotund ravine
river oracle
#

?jd-s

undone axleBOT
frail crystal
#

thanks

quaint mantle
#

I made a plugin and it keeps crashing the server even tho it was working just fine a few hours ago, I didn't even made any changes into it.

rotund ravine
#

Exclude dependencies that are signed

quaint mantle
#

dependencies?

#

which ones?

rotund ravine
#

How would i know

quaint mantle
#

Then what do you mean by excluding dependencies that are signed? I don't see anything about it in the crash report. I'm just confused

hazy parrot
#

what deps are u using

#

show your pom

frail crystal
#

where can i find my plugin after building?

hazy parrot
#

you have to exclude their META-INF

hazy parrot
quaint mantle
#

that is my pom, how do I exclude the META-INF?

rotund ravine
#

Put essentials as provided

quaint mantle
rotund ravine
#

In the pom

clever lantern
#

how can i disable beacon effects for all players?

quaint mantle
inner mulch
#

hey, has anyone an idea on how to change a players nametag (above the head) to a color gradient? I've seen other servers do this, but i dont know how they do it :(

rotund ravine
#

Set essentials to scope provided haha

river oracle
#

shading essentials ftw

quaint mantle
rotund ravine
#

You see how all your other dependencies

#

Has a line that says provided?

#

In the pom

#

Essentials wants that one too

#

So be a good daddy

quaint mantle
#

oh xd

zealous osprey
#

How do you call those integration things for websites?
Like the youtube player that can be added to a website.

young knoll
#

embed?

zealous osprey
#

Not sure; I'm looking for something like that for Blockbench. Cause I want a user to be able to upload a file and then display it.

young knoll
#

I don't think that exists

#

You'd have to make one

hazy parrot
#

iframe ?

storm crystal
#

how is mysql implementation in java called?

hazy parrot
#

you mean driver ?

storm crystal
#

the thingy that lets you do mysql stuff inside java right away

#

I want to find its documentation

rotund ravine
#

Google it

storm crystal
#

yeah the thing is that I dont know name and describing it didnt really work

hazy parrot
#

hibernate and jpa ?

knotty aspen
#

your description here also isn't working lol

#

the driver? the part of Java itself that deals with SQL, like PreparedStatement and so on?

zealous osprey
quaint mantle
# hazy parrot you have to exclude their META-INF

Do you know how I can exclude the files ending with (.DSA, .RSA, .SF) in the META-INF? I figured that it was those file what was crashing the server, but everytime that I updated the plugin those files com back again.

hazy parrot
#

idk if that is thing u want

zealous osprey
#

maybe, thanks

hazy parrot
#

np

young knoll
#

Wait is blockbench availible on the web?

hazy parrot
young knoll
#

Ah okay

#

That makes things much easier

zealous osprey
#

yeah

rotund ravine
#

Show pom @quaint mantle

quaint mantle
rotund ravine
#

Then it shouldn’t include anything that is signed

quaint mantle
rotund ravine
#

I would need to see the pom again i guess

#

Also how are you building it

quaint mantle
#

I tried cleaning it first and the rebuild it, it didnt work. Then I just tried to rebuild it and it didnt work, then building it like normal and it didnt work.

rotund ravine
#

Would need to know the tasks you ran as well as pom when ur back

quaint mantle
#

I may have the pom, I remember that I made a repository

rotund ravine
#

Ye shouldn’t be shading anything anymore

#

Would love to see the insides of the jar file when u got time

quaint mantle
storm crystal
#

xd

quaint mantle
#

I've looked online and this appear. Would this work? : <configuration>
<filters>
<filter>
<artifact>:</artifact>
<excludes>
<exclude>META-INF/.SF</exclude>
<exclude>META-INF/
.DSA</exclude>
<exclude>META-INF/*.RSA</exclude>
</excludes>
</filter>
</filters>
<createDependencyReducedPom>false</createDependencyReducedPom>
</configuration>

queen niche
#

What is the right way to spawn a armor stand display entity?

young knoll
#

Which one

storm crystal
#

how would I want to cache this kind of data where player has different datatypes under each statistic?

young knoll
#

an armor stand or a display entity?

queen niche
young knoll
#

Item, Block, or Text?

queen niche
#

an armor stand

#

I guess its the entity.display

young knoll
#

Okay armor stands and display entities are completely different things

#

Which one do you want

queen niche
#

nvm I guess im wrong then. I thought you could spawn an armor stand display entity

young knoll
#

no

#

Sadly there is no EntityDisplay, only item block and text

queen niche
#

I see. Thanks!

young knoll
#

Although it would be nice, hey @Mojang hit me up and i'll code it for you

storm crystal
#

im kinda confused on how to handle the fact that there are integers, strings etc. in values

#

like key : value where key would be like deaths etc.

young knoll
#

HashMap<UUID, MyDataObject>

storm crystal
#

what is MyDataObject

young knoll
#

Where MyDataObject has fields + getters for all the different values

storm crystal
#

isnt there really a table to store different data types

young knoll
#

I mean sure

storm crystal
#

like in python I could just do x = [1, "d"]

young knoll
#

But that is messy

rotund ravine
#

?pojo

young knoll
#

Make a class so you have concrete types

storm crystal
#

what is this class supposed to do

young knoll
#

Hold values

storm crystal
#

like okay I have fields that are declared somewhere

#

but whats a getter

young knoll
#

A method to get the value from a field

storm crystal
#

isnt field just declared

#

and like standing

tranquil harness
young knoll
#
public class MyDataObject {

    private String nickname;
    private int level;

    public MyDataObject(String nickname, int level) {
        this.nickname = nickname;
        this.level = level;
    }

    public String getNickname() {
        return this.nickname;
    }

    public void setNickname(String nickname) {
        this.nickname = nickname;
    }

    public int getLevel() {
        return this.level;
    }

    public void setLevel(int level) {
        this.level = level;
    }
}
#

Have an example

storm crystal
#

okay but I am supposed to make separate class for each column?

#

like deaths level rank etc.?

young knoll
#

No, just a seperate field

storm crystal
#

and how do I put it into map

young knoll
#

map.put(key, value)

storm crystal
#

no how do I put MyDataObject

#

Map<UUID, new MyDataObject()>?

glad prawn
#

Map<UUID, MyDataObject>

storm crystal
#

so I make it static?

young knoll
#
Map<UUID, MyDataObject> map = ...

MyDataObject value = new MyDataObject(...);
map.put(someUUID, value);
storm crystal
#

isnt that too much

#

cant I make like 1 instance per player

#

or just 1 instance

heavy mural
#

Hey,
The entity I've spawned stops rendering at 5 chunks distance, even though my view distance is 6.

This caused the player to not see the entity when they are too far away of it I'm the y-axis. Is there anyway I could fix this?

I've tried:
Setting high view distance of the entity display. (Spigot)
Setting higher simulation distance (server.properties)
Setting high shouldrenderatsqrtdistance (net.minecraft)
Setting high entity-broadcast-range-percentage (server.properties)
Setting high entity-tracking-range (Spigot.yml)

Am I missing a Setting that could help me render an entity on a higher y-axis distance between the player and the entity?

young knoll
storm crystal
young knoll
#

what

storm crystal
#

you get value form MyDataObject and you put it to map for that UUID

#

but you gotta do it as many times as there are columns

young knoll
#

You create a new MyDataObject with the data of all the columns

#

And put that in the map for the uuid

storm crystal
#

like so that I dont have to hardcode 3 getters

#

for instance

hazy parrot
#

"hardcode getters"

#

i hope you wouldn't add 5 new columns every day to your database

storm crystal
#

what?

#

Id have to make separate class for each database that Id have to make

hazy parrot
#

why is it problem to add 3 getters

storm crystal
#

its not scalable

hazy parrot
#

you define your model once, there is nothing to scale...

storm crystal
#

well Id have several different databases and what if I decide to make like 2 more columns in player database

hazy parrot
#

you add two more getters

#

adding 2 more columns isn't something you gonna do every day

lost matrix
storm crystal
#

what the fuck

#

I dont know at this point

lost matrix
# storm crystal what the fuck

Just came here. Saving data to files is a totally valid approach.
And again: Different people can have different opinions. I dont understand why this shocks you every other day.

storm crystal
#

someone else tells me to do the other thing

river oracle
#

I think you're too reliant on advice here tbh if it changes the direction of your entire project

lost matrix
#

There are formats which are more viable for data storage, like json.
Yml is also fine, but i would def consider it a configuration format.

storm crystal
#

I want to make database (OR WHATEVER) to store player stats, enemies to spawn, weapon data etc.

river oracle
knotty aspen
#

just store everything as binary blobs in a file

#

alternatively, do the Wynncraft and store things in a chest at a specific position in the world

lost matrix
lost matrix
eternal night
#

Do you plan on having Highscores

#

Or generally any cross player data gathering

storm crystal
#

I dont know if what I want to do will need it or not

lost matrix
eternal night
#

I mean

#

Meh XD

#

If you wanna just smack JSON into places

#

Mongo ?

lost matrix
#

If i expect <1k players then i just sacrifice 50MB ram and dump everything into memory smileybolb

knotty aspen
#

tbh if you don't know what you want, stick with something simple like json/yaml and files

#

if you don't know if you need a DB, you probably don't

eternal night
#

Can always move into a DB Lager

#

Later

lost matrix
#

Hmm Lager

eternal night
#

Keep your logic abstract enough to switch down the line

storm crystal
#

I want to make database for:

  • players: custom base attack, armor, resistances, deaths, money, etc.
  • lootboxes: items, item datas, odds
  • weapons: custom statistics, special things like PDCs
  • enemies: health, armor, attack, drops, level scaling etc.
#

thats just it

lost matrix
storm crystal
#

and I already bothered to download xampp and start rewriting my plugin

lost matrix
#

The frequency at which data is changed for only online players is pretty much irrelevant for your choice of persistence.

#

It only matters if you take the accessibility of your data into account.
For example top lists, or computing statistics, etc (Or scaling way beyond what the average mc server needs)

grim hound
#

I just save it async at world save event

#

And it works just fine

#

Just remember to have the file write synchronized

storm crystal
#

well fuck this shit ill do it in mysql just to be left alone at last and make it work

grim hound
#

Do you have a mysql server?

#

And is it for public use?

storm crystal
#

why would it be public

grim hound
#

Cuz this is all fuqin

#

Plugin development

#

And mostly public ones

storm crystal
#

database is only for me

#

lol

serene sigil
#

hi guys how to make it so the minecart doesnt stop when the player stands on the rails?

#

it should keep its velocity

molten hearth
#

alr so i already asked this earlier but id like to know if anyone else has input on this, what would be a good way to know if a player broke a block with PlayerInteractEvent

young knoll
#

Uhh

#

Check if the block they click is instant breakable I guess

molten hearth
# torn badge What are you trying to do?

im cancelling an interact event when left clicking a block bc i have some custom beheavior when a noteblock is punched (beheavior that conflicts with vanilla beheavior)

#

but i still want the noteblocks to be breakable

torn badge
#

I mean at the time InteractEvent is fired you don’t know if the block will be broken since the player can just stop before

molten hearth
#

yeah well thats my issue

#

because blockbreakevent wont fire if interact is cancelled

storm crystal
#

https://www.spigotmc.org/threads/how-to-sqlite.56847/ I found this post about using SQLite as database, from what I understand it makes database (.db files) in server files and requires no external database working in background

torn badge
#

Could use shift click to differentiate

storm crystal
molten hearth
storm crystal
#

well using this SQLite method + caching it to not lose any data

torn badge
storm crystal
#

when would I want to use several servers at once?

#

I mean

#

how big of a project would it have to be?

torn badge
#

If you have a network and need multiple servers to access the data

storm crystal
#

I just want to make a rather smaller mmo rpg styled server

#

not anything super huge

torn badge
torn badge
storm crystal
#

okay thats pog

#

would you still recommend caching data even if it was locally in server files under .db files?

torn badge
#

Depends on query complexity, caching is always a good solution if you have very heavy queries or data you use frequently

storm crystal
#

id use data pretty much all the time

torn badge
#

And consider handling your queries asynchronous

storm crystal
#

to spawn mobs, get weapon statistics and such

warm mica
torn badge
#

But don’t forget that any thread will lock the file until it has finished its operation

storm crystal
#

do you have any resources on setting actions async?

torn badge
#

Any Java Multithreading explanation should help you out with the basics

molten hearth
#

so i manually play the notes using some block pdc

molten hearth
storm crystal
#

Thank

warm mica
lost matrix
#

You should never, ever do any IO on the main thread

#

Also: Always throw away (and close) your connections. Get a new connection for every single request.

ivory sleet
lost matrix
#

Yes, mr clube is right

ivory sleet
#

mr smiley is just as right :)

lost matrix
#

As long as your closeConnection method checks for null values, this looks ok

young knoll
#

Try with resources best

river oracle
#

@sterile axle I'm curious about something why does my char array need to be 5 here to capture the entirety of the word exit shouldn't that take up 4 positions within a char array
0: e, 1: x, 2:i, 3:t

  char input[5];
  while (strcmp("exit", input) != 0) {
    printf("command: ");
    fgets(input, 5, stdin);
    printf("%s\n", input);
  }

However, if I use only 4 the array gets cut off and the output looks like

command: exit
exi
command: t

when expanding to 5 the array works as expected

command: exit
exit
command: 
lost matrix
#

C or C++ ?

#

Looks like pure C to me, right?

river oracle
#

its pure C

lost matrix
#

Your strings are terminated by a null character

river oracle
#

? explain further

#

why exactly

sterile axle
lost matrix
# river oracle ? explain further

Its like a memory address which signals that the string ends here. '\0'
Strings in C are terminated with it so you can have a pointer to the start of your character array, without
having to know its length. You simply traverse the memory block until you hit the null character, which terminates the string.

sterile token
#

I need some help about a school project which i have some doughts about its designing. At momment i have done the next things basic things for it https://paste.md-5.net/yuhoqajile.java. I would be really thankfull if you can take a look at it. Its somethign really simple and without much effort hehe

sterile axle
#

Java strings are also null terminated but it handles it transparently and you never have to worry about it

#

but C does not do that for you

#

it's how it can tell that the string is over

young knoll
#

Reminds me of gameboy assembly

sterile axle
#

strlen for example goes char by char and increments a number for each char it sees, infinitely, until it finds \0

young knoll
#

Lots of terminator characters there

sterile axle
#

if it doesn't ever find \0, that loop won't stop until it reads memory it doesn't own

sterile axle
#

then you segfault and program crashes

river oracle
#

I forgot strings are just char arrays for some reason

sterile axle
#

printf("%s", stringhere) will print char by char until it finds \0. if it doesn't find one it'll keep printing each memory address forever until it reads and tries to print memory it doesn't own then your program crashes

young knoll
#

Java strings are byte arrays

#

Extra fancy

lost matrix
sterile axle
#

strings in any language are arrays of chars, it's just an abstraction around that. you either have a char array and a length to know how long the array is, or the array is null terminated so you can tell the array is over

#

c just doesn't do anything for you

#

you do it yourself

young knoll
#

In the original Pokémon games your inventory was terminated by a special byte

sterile token
slender elbow
#

pascal strings best

young knoll
#

If you got rid of the byte somehow you got to see arbitrary data as items

#

Yay

sterile axle
#

mc protocl also uses length-prefixed strings which is interesting

#

<length>char,char,char,char,char,char,...

lost matrix
slender elbow
#

char,char,binks

sterile axle
#

anyway @river oracle this isn't just strings, you will also find this pattern any time you want to have an array of something you don't necessarily know the length of, you just put your shit in the array and then add a \0 at the end, and when looping you'd do something like ```
while (*array) {
//use the element
++array;
}

#

and when you hit the \0, the loop ends

#

or you have two params, the array and size and you can use a for loop

#

common C patterns

slender elbow
#

need to dereference for the condition but yeah ^^

sterile axle
#

oh yea forgot that

lost matrix
sterile axle
#

C has ruined me

slender elbow
#

like really really bad

river oracle
young knoll
#

Quick someone write ++ in 17 cpu instructions

river oracle
remote swallow
#

Install java use java method delete java

#

Boosh

sterile token
#
private User obtain(String email) throws SQLException {
  try (PreparedStatement statement = this.mysql.getConnection().prepareStatement(Queries.UserObtain)) {
    ResultSet result = statement.executeQuery();
    return result.next() ? new User(result) : null;
  }
}```
what can i return in the next method? Because null cant be returned because the method is used on my user signup method
lost matrix
slender elbow
#

movfuscator to the rescue :kappa:

lost matrix
lost matrix
#

...

sterile token
#

sorry cellphone dc is wrokign for the ash

lost matrix
#
if(result == null) {
  return null;
}

?

sterile token
#

i cant return null

#

because i use the obtain method on top for handling user losgin

sterile axle
#

throw an exception then. if it's null, it's null. you have no choice but to try again or give up and print and error message.

#

idk what you want

sterile token
#

let me explain ok?

sterile axle
#

you want to magically say "oh i got null", "but nvm I don't want null"

#

"let me just pretend it didn't happen here is ur resultset"

lost matrix
#

Handle possible null values then.
You dont need this to be in an ternary op

sterile token
sterile axle
#

i am so confused what the issue is

lost matrix
#

Then throw an IllegalStateException or something

lost matrix
sterile axle
#

this is basic error handling, if it cannot be null, and you cannot return null, but it's null anyway you got a problem

#

throw an exception

#

that's what exceptions are for

slender elbow
#

An exception that signals something was null, even

sterile axle
#

heh

lost matrix
#

-.-

sterile token
#

i just dont know how to proper explain myself

sterile axle
#

use chatgpt and write in your native language and tell it to make an explanation in english then

young knoll
#

You could just kill the jvm

#

Always a good option

lost matrix
#

System.exit()
And no further explanation

river oracle
#

fuck Smile beat me to it

lost matrix
#

hehe

sterile token
#

Frame#dispose() better idea KEKW

sterile axle
#

me in C:

"o fuk my pointer is NULL."

exit(1)
lost matrix
#

Oh yeah. Bind a dll and call it via JNI. Just set your whole jvm mem to 0x0

sterile axle
#

easy

sterile token
#

why you trolling me? i was trying to get helped

sterile axle
#

but seriously if you can't explain yourself, then go write to chatgpt your entire message in your native language and say "translate to english" and it will do a much better job than you are doing

#

and then we can probably help you

#

maybe

raw epoch
#

hey i'm trying to prevent Creative player to move items from their inventory but the creative mode duplicate items when the event is cancelled, does anyone has a solution ? Thanks !

sterile axle
#

but from what you are explaining, to my understanding, you have an object that should not be null, but you're worried it's null anyway. so check if it's null, if it is, you know you're in an illegal state, throw an illegal state exception or something

#

that's all you can do, you can't just magically recover

lost matrix
# sterile token why you trolling me? i was trying to get helped

What prevents you from doing this:

    public boolean signin(String email, String password) throws SQLException {
        User user = this.users.containsKey(email) ? this.users.get(email) : obtain(email); // Can return null
        if(user == null) {
          return false;
        }
        return user.getPassword().equals(password);
    }
young knoll
#

What’s the unsafe call to destroy the jvm

#

Kek

river oracle
raw epoch
#

hmm you're maybe right

river oracle
#

Creative mode is weird

young knoll
#

Yeah creative is mostly client side

#

Maximum jank

river oracle
#

it doesn't like telling the server what its doing

raw epoch
#

fuck it x') nothing important thx anyway !

young knoll
sterile token
river oracle
#

hold up I'm helping him I think I can do this I just have to read in spanish lol which isn't exactly allowed here

lost matrix
# sterile token oh lmao really i just overcomplicate too much myself

Or if you need a more granular response: Create an enum.

    public enum LoginResult {
        SUCCESS,
        UNKNOWN_USER,
        WRONG_PASSWORD,
        ALREADY_LOGGED_IN
    }

    public LoginResult signin(String email, String password) throws SQLException {
        User user = this.users.containsKey(email) ? this.users.get(email) : obtain(email); // Can return null
        if(user == null) {
            return LoginResult.UNKNOWN_USER;
        }
        if(user.getPassword().equals(password)) {
            return LoginResult.SUCCESS;
        } else {
            return LoginResult.WRONG_PASSWORD;
        }
    }
lost matrix
#

And ignore the comment 🙂

wary harness
#

how to fix this

Bukkit will attempt to fix it this time for you, but may not be able to do this every time.
If you see this message after typing a command from a plugin, please report this to the plugin developer, they should use the api instead of relying on reflection (and doing it the wrong way).```
I used this code for years
lost matrix
#

Spigot has an API for that

wary harness
#

from when

lost matrix
#

Idk. 1.16.5 ? 1.17. Something like that

wary harness
#

class?

#

or method name

lost matrix
exotic obsidian
#

hello

#

"statement.close();"

#

is it important?

lost matrix
#

Depends. Only if you want your server to run properly.

exotic obsidian
#

some programmers don't used it

#

so that's why i'm asking

sterile axle
#

if you wrap the prepared statement in a try (PreparedStatement stmt = ...) {} then close() is called automatically

#

Otherwise you need to call it, or you leak connections

#

If others are not using it and are not using try-with-resources (above) then they are coding incorrectly

lost matrix
sterile axle
#

porgammers rule

paper viper
#

Woah, new orange helpers?

lost matrix
young knoll
#

Pretty sure the profile api was 1.18

#

Man JEPs hurt my brain

slender elbow
#

can't hurt when you don't have one

wet breach
young knoll
wet breach
#

The downside is until the system closes it, those jdbc resources are now occupied and not free for something else to use it

young knoll
#

I just want to determine if/when a feature is finished

#

Gotta follow a trail of endless links smh

wet breach
#

So it is good practice to close out resources once you are done with them

slender elbow
#

eh, "it depends"

wary harness
#

Profile thing is not working @lost matrix

young knoll
#

Status: Integrated

#

Is that a good sign

slender elbow
#

for example, panama's vector api is on its 7th preview round (or was it incubator?), but it's just waiting for some valhalla jep (value types I think)

#

yep

#

which jep

young knoll
#

454

slender elbow
#

ah

#

yeah

#

for jdk 22, very nice

river oracle
#

what jep is 454

slender elbow
#

ffm

lost matrix
#

^

river oracle
#

what is ffm

slender elbow
#

foreign function & memory

river oracle
#

ahhh

slender elbow
#

"jni but not bad"

river oracle
#

I see

lost matrix
young knoll
#

What’s the next LTS

#

25?

slender elbow
#

uh probably

wary harness
#

Well I am using spigot 1.20.2 api

river oracle
#

then it should def work

#

you're doing something wrong

lost matrix
young knoll
#

Ah it’s every 2 years

#

Got it

wet breach
lost matrix
young knoll
#

Granted Mojang hasn’t moved to 21 yet

#

So F

sterile axle
#

@river oracle funny coincidence. C23 apparently added bool, true and false as keywords apparently. so importing stdbool would have done nothing at best and at worst would have conflicted with the actual keywords

#

not sure why that was happening though other than C23 isn't ready for real use and was probably a bug you encountered

young knoll
#

Woah C invented booleans

sterile axle
#

wot

sterile token
# exotic obsidian

please the colors!! Not most of us are acustom to seeing sun light hahaha

young knoll
#

Like vampires

pastel axle
#

I'm attempting to update a very old plugin to work with modern Spigot versions, and before I understand how the plugin works, I want to just update it as-is. The problem is, it uses a whole lot of NMS (which I will remove in future). The issue I'm running into is, I've configured maven to use the remapped spigot.jar, but the functions aren't being properly remapped, and I'm a little out of my depth.

#

It's using the right file, reportedly. Just.. the file doesn't have the right mappings?

weak meteor
#

yo

#

so i wanna check if args of a command are empty or not, so lets say the command is /ik create <name> <slot> right?

balmy hull
#

I'm using nms to make a custom projectile entity, and use bukkit for most of my other effects for the entity. When I create an instance of the entity class in my effects class, the methods it inherits from class WitherSkull nor the methods i've created appear as hints/suggestions and I'm wondering whether this is an ide error conflicted between similiar methods with bukkit and the remapped nms methods, anyone got any ideas?

weak meteor
#

so, if name is not given

#

how do i check?

#

args[1] != null doesnt work

sullen wharf
#

No wait

remote swallow
#

args.length == 2

sullen wharf
#

Ye that

weak meteor
#

AH

#

yea

#

thanks

sullen wharf
#

Check for lenght < arg number

weak meteor
#

I never understood completely how to use Gson and well, create, edit, and delete .json files, where can i see a good forum post or yt tutorial?

#

Never found a good one

balmy hull
#

also is using bounding boxes a good method of checking for collisions for my custom projectile?

umbral ridge
#

?json

#

?gson

#

😣

#

@weak meteor

weak meteor
#

Another question

#

if im making a Kits plugin, whats the best way to represent the kit, a class or interface?

#

Cause, multiple plugins use interfaces to represent players, factions, etc.

wet breach
#

So categories of kits is what i meant not the individual kits and then have a config setting for setting a kits category

eternal orchid
#

is there a way to cancel a player's shield blocking an attack?

quaint mantle
#

is there a shield disable event?

eternal orchid
quaint mantle
#

yeah im just using the PlayerStatisticIncrementEvent for it

thorny pendant
#

When using itemsadder or oraxen, how do I keep my FPS from dropping when I'm surrounded by custom furniture?

torn shuttle
thorny pendant
#

Is there a better way, I noticed they are all armor stands

#

Lots of armor stands keep my FPS down

torn shuttle
#

better?

#

yeah

#

so little known fact you can also just buy the parent company, microsoft, and then change the OS for windows to be more performant such that when you play minecraft on it you will get even more fps

#

I don't exactly know how much the market price for buying microsoft nowadays is though

thorny pendant
#

I'll call the CEO of Microsoft. I'll buy his company by next week.

torn shuttle
#

next week? You really shouldn't be living paycheck to paycheck like that

#

chatgpt says you should be looking at about 2.5 trillion usd to buy microsoft so you might have to cut back on the caviar for a couple of days if you want to buy it

knotty aspen
#

if those plugins used display entities instead of armor stands you could just set proper culling values and that would improve FPS

#

so its not like Mojang needs to fix that, those plugins just need to use the stuff mojang made for this specific usecase lol

torn shuttle
#

to be clear mojang should definitely be looking at ways of optimizing idle entity overhead

#

it's really bad

knotty aspen
#

well, for ticking entities yes

#

but 1800 display entities at once def work without any major performance issues

torn shuttle
#

I ran benchmarks yesterday, server-side I can handle about 14000 ticking armorstands but client-side my insane cutting-edge desktop build starts getting stuttering drops with about 1k entities

knotty aspen
#

the client will try to tick all those armor stands, so yeah

torn shuttle
#

it's not good

knotty aspen
#

doesn't help they are living entities because mojank

torn shuttle
#

hence me saying they should be optimizing them

knotty aspen
torn shuttle
#

well I made my system to try to be entity-agnostic where possible so I will be trying it out with display entities real soon

knotty aspen
#

they are so much nicer in absolutely everything tbh

#

And you usually need less of them because you can transform them freely

torn shuttle
#

she's a beaut

#

how would you need less of them

#

you still have the same bone count regardless

#

unless you mean they can handle large scales

bitter rune
#

does this generate any number between 1 and 100 ? double lottery = random.nextDouble() * 1001;

#

1000*

knotty aspen
#

depends on what you are doing, for bones its probably not helpful

#

but I am doing entity models and animations completely clientside with shaders at this point tbh, way easier

torn shuttle
#

with shaders? I'm assuming you're modding then

knotty aspen
#

no, vanilla shaders

torn shuttle
#

how does that work?

knotty aspen
#

basically this for the client with a server resourcepack and a plugin to control animations and stuff

#

only downside is enabling shaders in Iris/optifine will break the animations. but its a PvP server so people really don't play with Optifine/Iris shaders that much

torn shuttle
knotty aspen
#

vanilla has shaders since 1.17. and with a shader, you can change how things are rendered. this basically puts the entire model in a texture, and uses a shader to render a model from that texture

torn shuttle
knotty aspen
#

well that is what the shader is doing

torn shuttle
#

well yeah but how are you distributing that shader

#

to the client

#

or is it built around a vanilla shader somehow

knotty aspen
#

The shader is part of the server resourcepack

#

"shader" isn't just shadows on the ground as its often used in minecraft context, its just a part of the rendering pipeline. You can also do things like turn the screen upside down, render portals like in the Portal games, etc

torn shuttle
#

I've written some shader code before, I am aware

#

I was just wondering if it was even possible to pass custom shader data via rsp

#

didn't know it was

knotty aspen
#

yeah its kinda undocumented, classic mojang feature

torn shuttle
#

so does that override the default shader insantly?

knotty aspen
#

yeah

heady wasp
#

hey everyone, i'm trying to store locations in a .yml file and also read them as a Location. i'm a little confused on this.

torn shuttle
#

that's kinda whacky

#

I assume you're sort of limited in bone control though, right?

torn shuttle
#

since it's client-side

knotty aspen
#

passing data to the shader itself from the server is a bit tricky, but using a colored item like a potion works

#

yeah I am not doing any individual bone control and thats probably also not possible

torn shuttle
#

yeah figures

#

anything even close to touching ik would be either insanely hard to pull off or straight up impossible

knotty aspen
#

Main use case are siege weapons, so I really only need to do play and stop an animation

#

they don't exactly walk

torn shuttle
#

yeah I mean this is honestly an insane system for a lot of unique applications, it breaks a lot of set conventions for mc

#

fortunately it doesn't really invalidate the work I've been doing on my own end since mine focuses on applications where you do need very precise bone control

knotty aspen
#

main issue (and probably not really fixable) is that both Optifine and Iris will overwrite vanilla shaders if you enable their shader stuff

torn shuttle
#

yeah no you're screwed on that one for sure

#

and it's a shame too because stuff like OF is pretty popular

knotty aspen
#

And vanilla shaders are limited in some ways right now, so for actual fancy rendering optifine-compatible shaders are superior

#

Like I am not even sure you can get the sun position lol

torn shuttle
#

buddy

#

what sun

#

there is no sun

#

what do you think this is, pbr with directional lighting?

knotty aspen
#

well, there is a time of day

torn shuttle
#

get outta here

#

it's all global illumination with a basic code that crawls from the top of the world to the bottom to set brightness levels

#

there is no concept of a sun

knotty aspen
#

there is PBR though

#

Complementary with Iris has PBR

torn shuttle
#

the only pbr vanilla minecraft devs know is pabst blue ribbon at the end of a work day

exotic obsidian
#

Hello

knotty aspen
#

You really don't like Mojangs work lol

torn shuttle
#

it's not a criticism

#

I don't think mc looks better with pbr

#

I do wish it had better lighting though

#

and performance

#

if I liked pbr I'd use a shader that either uses or emulates that effect

knotty aspen
#

its only something I use for screenshots. all those fancy graphical effects annoy me otherwise

torn shuttle
#

same, pretty much

#

if I had an infinite amount of time I'd go and make my own custom shaders that are more soft toon shaders than pbr

#

those work better with mc in my opinion but it takes a lot of work to get them just right

exotic obsidian
#

How can i save player data like kills, death in hashmap then transfer it to database?

pastel axle
#

I'm starting to understand my issue a little better. Why are the class names different for remapped-mojang vs not? I thought it was just function signatures and such?

#

If I use remapped spigot, net.minecraft.world.level.chunk.IChunkProvider doesn't exist. If I use standard spigot, it exists but has obfuscated function names.

proud badge
#

are SQL injections possible within the minecraft chat

dry hazel
pastel axle
#

Hmm, what do I do in that case?

dry hazel
#

just use mojang's mappings

#

if you want to convert from spigot to mojang names:

#

?mappings

undone axleBOT
pastel axle
#

oh sweet

#

that's perfect, thanks!

#

bookmarking that for sure

eternal oxide
#

You are asking basic Java questions there.

torn shuttle
eternal oxide
#

I hate coffee so neither 🙂

torn shuttle
#

wow

#

he's a coffee racist

#

I can't believe it

eternal oxide
#

I love the smell, just hate the taste

torn shuttle
#

that's fine, just do what I'm doing right now and enjoy a cup after nose surgery so I can't taste shit

#

for all I know I could be drinking bleach right now

eternal oxide
#

Nose surgery? Enlargement?

torn shuttle
#

yeah I kept getting ads for pills on my email that say ENLARGE YOUR NOSE

#

you know how everyone wants to enlarge their nose

eternal oxide
#

yep I've considered it

torn shuttle
#

for sure

#

I got myself a nice villager nose

eternal oxide
#

ha

#

Ladies gonna love that

torn shuttle
#

once it's fully healed up I should be able to snort all cocaine within 50 feet of me, even if it's still packaged

#

sort of like kirby but less drugged up

warped shell
#

is it ok to backup a server while its running?

#

i plan to use tar and pigz to backup a server once per day

wet breach
# warped shell is it ok to backup a server while its running?

Depends what exactly you are backing up. if it is just world files sure as long as you disable world saving. I have a script that is setup where you can just make a cron job if you want to look at it. Does other nifty things and i have alternatives too

warped shell
#

why is world saving an issue? is it file access between threads?

#

here is my bash for saving

timestamp=$(date +"%Y%m%d_%H%M%S")
backup_filename="backup_${timestamp}.tar.gz"
num_threads=6

cd "$source_directory" || exit

tar -cf - . | pigz -p "$num_threads" > "$destination_directory/$backup_filename"

echo "Backup completed at $(date)"

find "$destination_directory" -name "backup_*.tar.gz" -type f -mtime +21 -exec rm {} \;```
wet breach
wet breach
#

Realized i dont have a backup command implemented on that. But that service script does a lot regardless lol

#

When i get home i will look into updating it to add backup command

old cloud
#

Is it possible to dynamically listen for events? I Wonder how the skript plugin does it because it doesnt know which events it will Need beforehand

wet breach
old cloud
storm crystal
# torn shuttle I got myself a nice villager nose

Pov: I see a cute guy...
meme,minecraft meme,big noses,memes,hairstyles for big noses,haircuts for women with big noses,villager,hairstyles for women with big noses,villagers,long nose surgery,long nose pliers,long nose videos,long nose,nose ring,long nose gar,nose,long nose shark,frosty long nose,red nose,ryan's daddy,nose shaping,nose contour,...

▶ Play video
#

She wouldnt know that

#

💀

wet breach
old cloud
#

So how does it do that dynamically?

wet breach
#

Skript itself is a spigot plugin made in java. Skript scripts are what interface with skript plugin and tells it what it needs. All the skript plugin is doing is playing middleman between two languages

old cloud
#

That wasnt really my question

wet breach
#

But skript also uses generics too

old cloud
#

Yes but how would you dynamically create a class that contains a Methode that does what was defined in some textfile

wet breach
#

Generics

#

As i keep saying

old cloud
#

…?

#

Still dont know how

wet breach
#

Generics lets you take in objects of unknown type and do something with them

wet breach
old cloud
#

Yes but still dont know how this helps me achieving the thing

wet breach
#

Cant achieve something you dont understand so you have some learning to do 😉

old cloud
#

lmao 😂

#

So you cant help me alright

wet breach
#

Its not that i cant help. Generics is not something i can teach in 5 minutes

old cloud
#

I know what generics are.

wet breach
#

Its like its own topic in java itself lol

old cloud
#

The point is that i dont understand how this would help me achieving

wet breach
#

Because generics is where java derives some of its dynamics from

torn shuttle
old cloud
#

Thats like saying „please fix this car, you can use my Tools for it“ - Me knowing which Tools to use doesnt Tell me how to repair it.

You only Tell me to use generics @wet breach

#

Not how to use them to get the thing working…

storm crystal
torn shuttle
wet breach
old cloud
#

Thats the Point why i was asking the question in the First Place

wet breach
#

Then you have learning to do

old cloud
#

Ye Tell me

torn shuttle
#

note that the channel says help-development not teach-me-development

old cloud
#

Ye i Need help

#

On how to Register an Event without knowing which Event it will be at compile time

storm crystal
torn shuttle
wet breach
storm crystal
torn shuttle
wet breach
#

The unknown type part is where the dynamics come in as you dont necessarily need to know what event just that it is one

#

You can figure the type out by checking it against the event types until one is true

#

Now you have your type

storm crystal
wet breach
#

Then you would have a general listener class that you create new instances of feeding it your now gathered info

#

And then register it

#

Now this is obviously an over simplification of the process.

torn shuttle
#

ah it seems as though I have played myself

#

I forgot this encrypted volume was like 4tb large

wet breach
#

Lol

torn shuttle
#

yeah so updating its encryption is going to take... a while

wet breach
#

It would be faster if you have another 4tb volume

#

Then its a simple transfer

torn shuttle
#

it would be faster to encrypt, it would not be faster to transfer

#

the transfer speed is shockingly slow

#

to be clear this is a vm

wet breach
torn shuttle
#

what a great question

wet breach
#

You can speed it up by mounting the vm file on the host

old cloud
#

Thankyou @frostalf

torn shuttle
#

it's a mix of how the files are transfered and what files i'm transfering

#

because files are fun this is basically tranfering them one by one but also encrypting them one by one, and this is mostly millions of tiny files

#

maybe tens of millions

wet breach
#

Why are you not using drive encryption?

torn shuttle
#

and I can't buffer them into a zipped file because, well, you know, that would be another 4ish tb of buffer I would need on a bunch of different places

#

you mean encrypt the entire drive?

wet breach
#

Yeah

torn shuttle
#

it's an 11tb drive I'm using for more than just that vm

#

hell at one point it wasn't even the only vm on that drive

wet breach
#

Its a vm so why are you stuffing everything onto a single drive when you can have as many drives as you want

torn shuttle
#

I'm not stuffing everything into a single drive

#

I have something like 25tb of storage

wet breach
#

Well obviously your setup is flawed somewhere lol

torn shuttle
#

how's that?

#

can a man not have a 4tb vm?

rotund ravine
#

Lol

torn shuttle
#

I'm pretty sure that's the 21st ammendment

valid burrow
wet breach
#

I have about as much storage space as you do and tranaferring large bits of data takes me a couple minutes even inside a vm

torn shuttle
#

inside a vm is fine, it's from an encrypted vm to my os when it's for, say, 11 million individual files that things start getting spicy

wet breach
torn shuttle
#

but I do agree that I might be doing something wrong with my vms regardless, more often than not I get glacial performance out of them

wet breach
#

Also vms can make use of hardware directly

#

That means it doesnt need a virtual hdd

torn shuttle
#

I have tried just about every option that is available to me in vmware

wet breach
#

Which is where you probably went wrong when it comes to large data lol

#

You obviously didnt setup a discrete volume on the host hardware for the vm. If you did your transfer speed would be faster as the vm isnt emulating hdd hardware

torn shuttle
#

you mean like partitioning my hdd so that that gets assigned to the vm alone?

wet breach
#

That would have been ideal

torn shuttle
#

yeah no I didn't do that

#

I mean I'm fine with it, somehow every other time I open this thing I end up adding another tb to it so I don't want to deal with resizing partitions every few months

wet breach
#

Dont have to do that either. You can just let the vm access hdd directly to save stuff keep vm os in its own vm hdd

torn shuttle
#

guess I'll maybe look into that in a year when it's done reencrypting

wet breach
#

Lol

torn shuttle
#

the progress bar actually moved, shocking

wet breach
#

🤔

shadow night
#

What's going on here

wet breach
#

Better hope no power failures happen lmao

torn shuttle
#

yeah was thinking the same thing

#

thank god I don't live in south africa right now

#

meh everything in these is discardable anyway

wet breach
#

Do you have a battery backup?

torn shuttle
#

nah I should get one some day but honestly in the last 10 years there have been 3 power outages

shadow night
#

Tf ya guys talking about

wet breach
#

Nice

torn shuttle
#

only a single time did an outage take more than 2 minutes

wet breach
#

Yeah power failures for me are rare too

torn shuttle
#

the rest were just instantly out and back

#

I think it was maybe 4 minutes for the longest one

wet breach
#

But i had a power failure take a hdd with it though

torn shuttle
#

I am really playing russian roulette for the outages because every time I basically have to guess the encryption passwords for my NAS

wet breach
#

Because the power surged like 3 times which over loaded my surge protector just enough

torn shuttle
#

if it goes down I'm not sure I can get it back up lol

#

I should write that one down and put it in my safe

wet breach
#

Lol

wet breach
shadow night
#

Well

#

Tech stuff can be from nothing to anything

wet breach
#

Indeed. I just didnt want you to feel ignored

shadow night
#

Well, nice

#

Thanks ig

wet breach
#

Magma has a weird vm setup and is decrypting 4tb transferring it and rencrypting it

#

And its taking forever for him

shadow night
#

The only vm I have is the ubuntu one hosted on my laptop that I use to do stuff with mcp lol

wet breach
#

So o told him an alternative setup that could speed stuff up and then said pray you dont have a power failure

#

Think that sums it up

shadow night
#

Power failure would be ass

#

But isn't that pretty rare

rotund ravine
#

Depends on ur location i guess

shadow night
#

Well, here it's rare

bitter rune
#

someonemine mind looking at my save and load and seeing why some of my values arent saving? when others are

rotund ravine
#

?ask

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!

bitter rune
#

my currency variable isnt being persistent on relog, or server restart, but if i just quit out of the game it saves correclty to file... here is all the java files associated with it

https://pastebin.com/hBmY9YLL

lost matrix
bitter rune
lost matrix
rough drift
#

Should I use a StringBuilder here instead of just directly typing the query (the data is controlled, no user input, easier to use a StringBuilder)

lost matrix
bitter rune
#

no, its when i log back in and increment the variable again it resets

#

everything else is persistent, and i am pretty sure its saving just like everything else so dont know what gives

lost matrix
upper hazel
#

how itemsAdder creates custom blocks in caves without creating a problem with armourstand dimming

young knoll
#

Noteblocks im pretty sure

upper hazel
#

there are 3 types of blocks and one of them creates an armorstand

#

in wiki

#

itemAdder

lost matrix
#

They create a spawner. Inside the spawned entity is displayed.
They stop it from rotating, set a block in its head and scale it so it barely covers the spawner.

Thats how it was done a while back.

upper hazel
round finch
#

this might be a back to java moment but...
my question is: how do you use interfaces and what is it for

#

i could google it but i just wanted to hear

upper hazel
#

this is why itemAdder can create 3d texture?

young knoll
#

Noteblocks have way more than 25 states

#

I think it’s near 1000 now

upper hazel
#

and is it really possible to expand the texture?

upper hazel
young knoll
#

Should still be quite a few

#

Noteblocks have 850 states in 1.16.5

upper hazel
#

I checked when I clicked on the block. after the 25th attempt the note returned to position 0

young knoll
#

1150 in 1.20

#

Yeah but you have all the different instruments

#

And also powered/unpowered

upper hazel
#

different noteBlocks?

young knoll
#

17 instruments x 25 notes x 2 powered states

#

(23 instruments now)

wet breach
upper hazel
#

and how to get them? I've only seen 1 in minecraft

#

17 different noteblocks

#

use 1 texture?

hybrid turret
#

If I understand the code in JavaPlugin.java right, shouldn‘t there be a warning everytime I restart/reload my server and the config.yml already exists?
(JavaPlugin 217:17)

upper hazel
#

and 1 model?

young knoll
#

They are all states of the same block

#

And yes they all use one texture

#

Change the instrument by changing the block below the noteblock

upper hazel
#

oh

wet breach
young knoll
#

Or in the case of plugins you just spoof it

lost matrix
# round finch this might be a back to java moment but... my question is: how do you use interf...

An interface is for defining a behavior. For example:
This interface defines a behavior. X goes in, Y comes out.
But we have no idea what the actual implementation is.

public interface BlockDestroyer {
  void destroyBlock(Block block);
}

At this point we can already use this interface.

  public SomeListener(BlockDestroyer destroyer) {
    this.destroyer = destroyer;
  }
  
  private final BlockDestroyer destroyer;
  
  @EventHandler
  public void onClick(PlayerInteractEvent event) {
    Block block = event.getClickedBlock();
    if(block == null) {
      return;
    }
    this.destroyer.destroyBlock(block);
  }

We simply use this interface, and trust that the implementation does what we expect.
At this point we dont need an implementation. But as soon as we want to create an instance, we need to pass some BlockDestroyer.
Here are two simple implementations for our earlier behavior.

public class BlockExploder implements BlockDestroyer {
  @Override
  public void destroyBlock(Block block) {
    block.getWorld().createExplosion(block.getLocation(), 5.0F);
  }
}
public class BlockVanisher implements BlockDestroyer {
  @Override
  public void destroyBlock(Block block) {
    block.setType(Material.AIR);
  }
}

Our implementations can then be used and we can swap them out depending on what we want

  @Override
  public void onEnable() {
    BlockDestroyer destroyerA = new BlockExploder();
    BlockDestroyer destroyerB = new BlockVanisher();
    
    Bukkit.getPluginManager().registerEvents(new SomeListener(destroyerA), this);
    // or
    Bukkit.getPluginManager().registerEvents(new SomeListener(destroyerB), this);
  }
young knoll
upper hazel
#

so does the environment change notes?

young knoll
#

850 states in 1.16, 1150 now

wet breach
upper hazel
#

that is, depending on the environment, the note block will change?

#

and also this is why more than 25 notes

#

hm

#

This means that at the moment there are 3 ways to create blocks with custom textures. These are note blocks, spawners, armor stands?

young knoll
#

In 1.16.5, yeah

wet breach
#

Sponges

young knoll
#

Sponges?

lost matrix
#

Display entities

upper hazel
#

and more frames

wet breach
#

You can replace them if you want for custom blocks

young knoll
#

No display entities in 1.16 :p

#

Why sponges

lost matrix
#

Oh we on 16

wet breach
#

Because they are typically not useful

young knoll
#

Sure but

lost matrix
#

lol...

young knoll
#

Wouldn’t be my first choice

upper hazel
#

when you create base sponges really need

wet breach
young knoll
#

Well yeah because they used to be unused

#

They aren’t now

wet breach
#

Could even use barrier block for custom blocks

upper hazel
#

so you can see

#

this barriers

young knoll
#

Leaves and tripwire also have a bunch of states you can use

upper hazel
#

hm

young knoll
#

Leaves for transparent custom blocks and tripwire for non solid blocks

round finch
#

great exemple

upper hazel
#

all oop this polymorphism

round finch
#

``i just learned a few days ago it was possible to do someting similer to this...

Creeper Creeper = (Creeper creeper) -> Creeper.SomethingMethod()``

shadow night
#

looks like a lambda of some kind

glad prawn
round finch
#

trying to find the exact code

#

but it was along of the lines of that

#

starts ecplise

wet breach
round finch
#

more mindblowing stuff

lost matrix
#

What are you guys saying??

wet breach
#

That is equivalent to this

#

int i = ((Integer)get()).intValue()

round finch
#

what i saw was spigot related

eternal night
round finch
#

to some entity

young knoll
#

I prefer player.getPlayer().getPlayer().getPlayer().getPlayer().getPlayer().getPlayer()

wet breach
#

But i think you were surprised you could double cast?

lost matrix
eternal night
#

pfft, I like block.getLocation().getBlock()

round finch
#

also add many loops

#

and threads

wet breach
eternal night
#

✨ async player getter ✨

young knoll
#

Location.getBlock().getRelative(face).getLocation

eternal night
#

NODDERS smart

young knoll
#

Smh getRelative in location when

lost matrix
eternal night
#

everyone is just trolling smh

round finch
#

not me

wet breach
#

But i was using it to demonstrate double casting and what the equivalent was without that

eternal night
#

double casting ? xD

young knoll
#

Sometimes you gotta make real sure it got casted

wet breach
eternal night
#

you just explained auto unboxing in a shitty way xD

#

idk what the concept of "double casting" is

#

like

young knoll
#

SkullMeta skullMeta = (SkullMeta) (SkullMeta) (SkullMeta) (SkullMeta) meta;