#help-development

1 messages · Page 730 of 1

frank kettle
#

and then inside the HomeDatabase there's functions to return the homes location or set them, etc.

shadow night
#

Pretty intuitive variable names

young knoll
#

Single letter variable names aside

#

:p

frank kettle
#

it's just a plugin for "myself", why would variables matter that much if the classes aren't even that full of code?

lost matrix
#

?paste

undone axleBOT
eternal oxide
#

?paste teh WHOLE class

undone axleBOT
lost matrix
#

Class pls

frank kettle
#

both?

echo basalt
#

TIL

frank kettle
#

there goes my shitty code 😥 time to get insulted

lost matrix
#

All good, we've seen worse for sure

young knoll
frank kettle
#

I've kept some old habits that i've seen people to change

young knoll
#

We need to get MD to add a :givecode: emote

echo basalt
#

give code

frank kettle
#

?paste

undone axleBOT
echo basalt
#

I have so much shit to do today so I'll be watching in the back

young knoll
echo basalt
#

OW

#

EI

#

EI

#

NO

#

fuck this I'm out

kind hatch
#

Ima need to bleach my eyes real quick

young knoll
#

Poor lad

frank kettle
#

...

young knoll
#

Cmon guys it can't be that bad

echo basalt
#

ive worked with worse

lost matrix
kind hatch
wraith apex
young knoll
#

Okay that nested runnable isn't pretty

shadow night
#

Your bunny wrote

young knoll
#

But shh

echo basalt
young knoll
frank kettle
#

and it always worked so i kept the code

lost matrix
#

Ah missed that

frank kettle
#

this class was made like a year ago and has been working everytime

#

since it worked, never felt like changing uknow'

eternal oxide
#

Nothign in your code could cause that error. Paper moment.

young knoll
#

"It ain't pretty, but it works"

wraith apex
#

👍

young knoll
#

Like a 2006 Toyota Corolla

frank kettle
#

2 days ago I also came here with the same error of class not found in my plugin

#

and the error was from another class

kind hatch
frank kettle
shadow night
eternal oxide
#

Run a spigot server for a day. Put up with any lag

#

if you get no error its a Paper issue

kind hatch
#

My money is on their new plugin loader.

frank kettle
lost matrix
#

That could be a possibility...

frank kettle
#

cause i've had this error few months ago too.

#

like 4-5 months ago?

shadow night
lost matrix
#

That is very unusual. I would try to update my jdk and mc server jar.

kind hatch
eternal oxide
#

I've seen this error on Paper when casting null to a Class and trying to use it.

#

a simple null check prevented it

#

Run Spigot for a day and test

frank kettle
#

yeah i will run spigot for a day

#

my concern with it is, if it is paper fault, i will then have to "fix spigot" lag 😐

#

that will be annoying

#

one annoyance for a different one

#

why do i play this game

quaint mantle
#

Any 3d pathfinding libs written in java?

eternal oxide
#

I prefer no errors over better perfomance (most of the time)

wraith apex
#

Spigot internally uses a global class cache to cache classes loaded from other plugins in the event they're requested again by another plugin or spigot itself. This is done to prevent the same class being loaded twice which the JVM actually hates

echo basalt
frank kettle
#

im goign to try spigot now

#

server starting is already using 3x the performance...

#

oh boy, this will not be fun

#

it's going well guys

young knoll
#

Md reading this preparing to launch an ICBM:

wraith apex
#

💥

frank kettle
#

actually server is handling pretty well

#

always 20tps

eternal oxide
#

md was in on the discussion about this way back

frank kettle
#

idk why i changed to paper long ago

#

there was a time when server was hitting 13tps or so and i changed to paper and it fixed the issue

#

and since then i kept using paper for servers

#

🤔

eternal oxide
#

Most people change to paper because others tell them its better.

kind hatch
#

^

#

It's not all that much better in some cases

frank kettle
#

only issue im seeing is loading new chunks, feels like spigot stutters a bit sometimes

eternal oxide
#

I've used both and notice no noticable differences, but I do run everything local

opal juniper
#

chunk system and startup times is where you will see the difference on a local host 1 player server

frank kettle
#

yeah right now laoding new chunks is dropping tps a lot

#

i will try to do the chunksload later when everyone is off

#

and tomorrow i see if there's any other lag

upper hazel
#

luckPerms use placeholders for displayName prefix yes? But what will be if my plugin for rank use it too?

#

conflict?

lilac dagger
#

Just client side?

merry abyss
#
[17:11:37 WARN]: [AfterlifeWaves] Task #37 for AfterlifeWaves v1.0 generated an exception
java.lang.ExceptionInInitializerError: null
        at org.meyer.afterlifeplayerbase.services.PlayerScoreboard.UpdatePlayer(PlayerScoreboard.java:61) ~[AfterlifeWaves-1.0.jar:?]```
Im trying to call my Api plugin after 10 seconds.

Running onEnable
```java
        new BukkitRunnable() {
            @Override
            public void run() {
                PlayerService.getInstance().SavePlayer();
            }
        }.runTaskLater(this, 20 * 10);```

the playerService class:

```java
    private final static PlayerService playerService = new PlayerService();
    private final AfterlifePlayerAPI playerAPI = AfterlifePlayerBase.getPlayerAPI();

    public void SavePlayer() {
        playerAPI.UpdatePlayer(new PlayerModel("2d27a918-5994-413d-a535-e9c435425e9e", "Fange C", 1, 200));
    }

    public static PlayerService getInstance() {
        return playerService;
    }```
It then calls to my API that takes care of the updatePlayer();


```java
public class PlayerScoreboard implements AfterlifePlayerAPI
..other code...

@Override
    public boolean UpdatePlayer(PlayerModel playerModel) {
        AfterlifePlayerBase.getInstance().getLogger().severe("I was run!");
        if(PlayerSetting.getInstance().SetPlayerXp(playerModel)) {
            Player player = Bukkit.getPlayer(playerModel.getUUID());

            Scoreboard scoreboard = player.getScoreboard();
            Team teamXp = scoreboard.getTeam("waveXp");
            teamXp.suffix(Component.text(playerModel.getXp()));

            return true;
        }
        return false;
    }

My getPlayerAPI

    public static AfterlifePlayerAPI getPlayerAPI() {
        synchronized (AfterlifePlayerBase.class) {
            if (playerAPI == null) {
                playerAPI = new PlayerScoreboard();
            }
        }
        return playerAPI;
    }```

Can someone help me?
hasty prawn
merry abyss
# hasty prawn What is line 61 in PlayerScoreboard
if(PlayerSetting.getInstance().SetPlayerXp(playerModel)) {

it calls my settings class

public boolean SetPlayerXp(PlayerModel playerModel) {
        playerConfigSection.set(playerModel.getUUID(), ".Group" + playerModel.getGroup());
        playerConfigSection.set(playerModel.getUUID(), ".Level" + playerModel.getLevel());
        playerConfigSection.set(playerModel.getUUID(), ".Xp" + playerModel.getXp());
        return true;
    }```
hasty prawn
#

?paste the whole error and the PlayerSetting class

undone axleBOT
merry abyss
quaint mantle
#

What’s the best way to see 1.8 and 1:12 intervals

merry abyss
#

feels like yesterday though :P

#

1.8 release

eternal night
merry abyss
#

Haven't played since then, just recently got back into minecraft

quaint mantle
#

I’m adding multi version support

#

And I need to add support for packet entities on 1.8

hasty prawn
#

It tells you whats wrong.

Cannot cast org.meyer.afterlifewaves.AfterlifeWaves to org.meyer.afterlifeplayerbase.AfterlifePlayerBase

In your getInstance() method.

#

@merry abyss ^

lilac dagger
#

Why not 1.7.10

#

It was even faster

#

The chunks somehow were super fast

merry abyss
hasty prawn
#

I reckon whatever line 34 in AfterlifePlayerBase is the problem

lilac dagger
#

Synchronized does nothing there

hasty prawn
#

Run the plugin again and see what the line is then

quaint mantle
merry abyss
#

My own api library

#

wth is going on now

[17:31:57 ERROR]: [DirectoryProviderSource] Error loading plugin: Directory 'plugins\AfterlifeWaves-1.0.jar' failed to load!
java.lang.RuntimeException: Directory 'plugins\AfterlifeWaves-1.0.jar' failed to load!
        at io.papermc.paper.plugin.provider.source.FileProviderSource.registerProviders(FileProviderSource.java:59) ~[paper-1.19.4.jar:git-Paper-550]```
quaint mantle
wispy marten
#

Does anyone know how to compile premium plugins like oraxen?

merry abyss
#

The api is responsible for updating player data as well as the scoreboard data

chrome beacon
quaint mantle
chrome beacon
#

if you're a user buy the plugin

#

?

wispy marten
merry abyss
young knoll
#

Did someone say

#

?stacktrace

undone axleBOT
hasty prawn
#

please stacktrace?

chrome beacon
merry abyss
#

let me refrase Student

wispy marten
merry abyss
#

?paste

undone axleBOT
chrome beacon
merry abyss
chrome beacon
hasty prawn
wispy marten
hasty prawn
#

Nah we need the AfterlifePlayerBase class I think

chrome beacon
#

Both

hasty prawn
merry abyss
#

My afterlifewave class:

package org.meyer.afterlifewaves;

import org.bukkit.plugin.java.JavaPlugin;
import org.bukkit.scheduler.BukkitRunnable;
import org.meyer.afterlifewaves.services.PlayerService;
import org.meyer.afterlifewaves.settings.WaveSettings;

public final class AfterlifeWaves extends JavaPlugin {

    @Override
    public void onEnable() {
        // Plugin startup logic
        WaveSettings.getInstance().LoadWaves();

        new BukkitRunnable() {
            @Override
            public void run() {
                PlayerService.getInstance().SavePlayer();
            }
        }.runTaskLater(this, 20 * 10);
    }

    @Override
    public void onDisable() {
        // Plugin shutdown logic
    }

    public static AfterlifeWaves getInstance() {
        return getPlugin(AfterlifeWaves.class);
    }
}

my afterlifeplayerbase class:


public final class AfterlifePlayerBase extends JavaPlugin {

    private static AfterlifePlayerAPI playerAPI;

    @Override
    public void onEnable() {
        // Plugin startup logic
        Bukkit.getPluginManager().registerEvents(new PlayerJoinListener(), this);
        PlayerSetting.getInstance().loadPlayers();
    }

    @Override
    public void onDisable() {
        // Plugin shutdown logic
    }

    public static AfterlifePlayerAPI getPlayerAPI() {
        synchronized (AfterlifePlayerBase.class) {
            if (playerAPI == null) {
                playerAPI = new PlayerScoreboard();
            }
        }
        return playerAPI;
    }

    public static AfterlifePlayerBase getInstance() {
        return getPlugin(AfterlifePlayerBase.class);
    }
}
chrome beacon
# wispy marten cause im broke

Then no we're not going to help you. The source code is there for people to contribute not for you to get the plugin free

hasty prawn
#

These are 2 different plugins right

merry abyss
#

Yes

wispy marten
chrome beacon
#

Then ask them to give you a jar

wispy marten
wispy marten
hasty prawn
#

It shouldn't be too hard for you to figure out how to compile it yourself, do some googling.

vapid anvil
#

you don't know how to compile, or you don't know how to google

wispy marten
#

idk what to search up

hasty prawn
wispy marten
#

see im kinda stupid

hasty prawn
#

Which, with an API, DI is probably better.

chrome beacon
# wispy marten

Oraxen is a paid plugin, to use it you must purchase a license on spigotmc.org
How convenient of you to cut off the first part

merry abyss
#

I was planning to change it however I do not believe it’s the cause of my problem

hasty prawn
#

It definitely is because Java is telling you that is the problem

#

getInstance() is the issue method and there's only one line in it

chrome beacon
#

Yeah he won't activly try to stop you

#

That doesn't mean they want you to or allow you to

merry abyss
#

Okay I’ll try in a bit thanks for the help

#

Why does DI syntax look so weird in Java

viscid fulcrum
#

Sorry wrong channel

frank kettle
#

oh damn, i was answering the question

hasty prawn
#

?di

undone axleBOT
hasty prawn
viscid fulcrum
frank kettle
viscid fulcrum
#

Yeah something like that

sullen wharf
#

What's the event that triggers when a TNT breaks a block?

quaint mantle
young knoll
#

EntityExplodeEvent

quaint mantle
sullen wharf
#

I'm trying to use BlockExplodeEvent but it wasn't working

hasty prawn
#

TNT is an entity thats why

sullen wharf
#

ye

#

primedtnt

#

Working! Thanks 😉

twilit creek
#

Hello, i have an question, where in the Bukkit/Spigot src is the getDataFolder(); or the dataFolder initialized? I want to know how bukkit/spigot getting the dataFolder from a plugin.

frank kettle
#

boys @young knoll @eternal oxide @kind hatch @wraith apex @lost matrix

#

we got an issue

#

i changed to spigot jar

#

and again ClassNotFound

#

so its not cause of the paper version on the server, spigot also can come up with the error

eternal oxide
#

thats different

frank kettle
#

its still givign the ClassNotFound when the class is from the own plugin

eternal oxide
#

it is

#

what is it erroring in onDisable

frank kettle
#

on disable it quickly saves the data before shutting down the server

#

which works every restart

#

but this time it randomly gave that error

eternal oxide
#

different class?

frank kettle
#

the data also happen to be saved when a player leaves, but i restarted and nobody left the server yet after i changed jar

eternal oxide
#

last time it was HomeDatabase?

frank kettle
#

like i said before

#

its a random class that gets "disabled"

#

happens randomly

#

never the same

#

2 days ago when i came here with same issue it was a "LocalDatabase" class

#

it looks like after a while, a class that hasnt been used "gets disabled"

eternal oxide
#

its always upon instancing a Class though

frank kettle
#

its when i call a class...

#

wdym by instancing?

eternal oxide
#

new

frank kettle
#

shouldnt u "instance" classes?

#

i see u do it for events and such anyways

#

also isnt that the only way to call a class and use it?

eternal oxide
#

yes you should, when its needed

#

however its better to store a reference to the instance and use that when you need it until you discard

frank kettle
#

ok, imagine u have a code that you use several times through your events/commands, how would you do to call it?

#

cause i heard to not use static functions in the past

eternal oxide
#

in your case you are calling new Database(Player) often

#

you should instead store the first instance and reuse it

frank kettle
#

Database just has the code to save on the mysql

frank kettle
#

imagine you have a funcion saveOnDb(Player, column, data)

#

how should I do it then?

eternal oxide
#

I wonder...

#

if you are frequently creating a new class everyu time you want to save, if you are not cleaning up some reference

#

I still don;t see how it's failing with that error though

frank kettle
#

so perhaps classes "disappear" cause i make too many "new class"?

#

is that even a thing?

#

i asked 2 days ago, and people said there was no reason for classes to be disabled due to too much variables or classes called 🤔

#

this is an odd error

eternal oxide
#

its very odd

frank kettle
#

the server isnt even using that much memory to "disable shit"

shadow night
#

Is this discussion about the ClassNotFound error still going on?

frank kettle
#

yeah happened again with spigot jar

#

with a different class

shadow night
#

I wonder (idk) if there is malware that can cause that

eternal oxide
#

is your project on git?

frank kettle
#

local on my intellij idea project 🤔

lean widget
#

You can get that error if your jar file was being / got replaced during server shutdown

eternal oxide
#

do you get any startup errors/warnings about javaassist?

frank kettle
#

no errors on startup

lean widget
#

Or you uploaded the file while the server is on

frank kettle
frank kettle
lean widget
#

You should only update when it's offline

frank kettle
#

what

#

since when?

eternal oxide
#

this is an error he and one other is having about a running server. no plugin changes

merry abyss
#

@hasty prawn I cant get this depedency injection thing to work

frank kettle
#

the error happens after a while with classes that havent been used

shadow night
#

This is a deep rabbit hole, at this point I personally would say "fuck it" and remake the whole project

frank kettle
#

im remaking the project already

eternal oxide
#

@smoky oak Chime in if you ever found a fix for your issue.

lean widget
#

It doesn't matter, just don't update the jar file while the server is one

frank kettle
#

this has happened before with other project

frank kettle
#

and no other plugins is giving error

#

it's just mine in particular

eternal oxide
#

oh, are you live updating yrou jar?

eternal oxide
#

the class not found/def error

frank kettle
smoky oak
#

yea, i keep that code u sent me in my jar

#

hasnt happened yet

eternal oxide
#

ok cool

#

another person here having same issue, but it looks like his is due to updating teh jar with the server running

lean widget
merry abyss
#

Can someone provide an example of Injection a service class. And then using it on another plugin?

frank kettle
#

the error appears randomly after a while

eternal oxide
# frank kettle no

Don;t update jars with the server running, it can cause old/new class instances issues like you are seeing

frank kettle
#

so server goes completely off and then goes on

#

🤔 why should that be an issue?

eternal oxide
#

doesn't matter. its not safe

frank kettle
#

yours says on disable

#

mine isn't on disable, it can happen anytime

#

also on that thread he was reloading the server

#

I fully restart mine

lean widget
#

Regardless, don't live update the jar file

shadow night
#

Is there an event for when a plugin is reloaded because of a /reload?

eternal oxide
#

yes

shadow night
#

And what is the event?

eternal oxide
#

?jd-s search load

undone axleBOT
eternal oxide
#

ServerLoadEvent

merry abyss
#

?depedencyinjection

#

?di

undone axleBOT
shadow night
smoky oak
#

i dont bother with reload anymore tbh

#

i just treat 'unload' as 'shutdown'

#

everything gets removed and re-initialized

prime reef
#

i hate dependency injection so much that i wrote a library to do it

#

it's so annoying to manually do all this shit

#

also impractical for large plugins

lost matrix
#

There is already a library from google for that.

prime reef
#

and it didn't do what I wanted it to

#

the library i wrote does a bunch of other shit too, so

lost matrix
#

But i dont like CDIs as it hides so much important information.
Proper di helps you tremendously with creating a clean design.

prime reef
#

Also, I despise using large libraries, so I try to avoid it unless it's something that would be insanely time-consuming to do myself

prime reef
#

not doubting you, genuinely curious because I don't like a lot of Java paradigms

#

I work in C++ for my day job, so

#

Also, pretty much no large corporate codebase is clean, but I'm sure I don't need to tell you that tbh

lost matrix
winter flower
#

Using pom.xml is there a way to make the application run a console command after packaging to a .jar?

prime reef
#

yeah, I work for a game publisher, so

hazy parrot
prime reef
#

there's no such thing as "design philosophy" other than "does it work? cool, it's someone else's problem that it runs like shit and is borderline incomprehensible even to the guy who wrote it"

prime reef
winter flower
prime reef
#

maven is

#

not intuitive

#

but I dislike gradle even more LMAO

#

once you get a handle on maven, it's pretty clear how it works, but gradle just feels like "magic"

prime reef
#

I think for your case you'd want to see if you can find a plugin for it then add it to your build stage (denoted by <build> tags)

hazy parrot
#

Send your current pom and what u tried

winter flower
#

Alright

prime reef
#
<build>
  <plugins>
    <plugin>
      <!-- your plugin stuff goes here -->
    </plugin>
  </plugins>
</build>```

super truncated
winter flower
#

I replaced install with package

prime reef
#

aye

winter flower
#

it was just mainly confusing for me as I'm not really used to maven configurations

lost matrix
# prime reef yeah, I work for a game publisher, so

Ah. Ive helped a friend get through his game dev studies and one thing that really stood out to me is the lack
of industry standards. In java enterprise you have well know, and established standards. Game development is kind
of a free for all in that regard.

prime reef
#

okay so what this is gonna do is execute an executable on install

#

that's what that plugin does

#
  <configuration>
          <executable>do-something.sh</executable>
          <workingDirectory>/some/dir</workingDirectory>
          <arguments>
             <argument>--debug</argument>
             <argument>with_great_effect</argument>
          </arguments>
        </configuration>```
winter flower
#

Well I do understand that much but I didn't really understand where to place it exactly

prime reef
#

in this section you'd want to replace do-something.sh with whatever your script is

#

what do you mean? in your pom?

winter flower
#

Yes

prime reef
#

says right at the top

#

under build/plugins

somber night
#

im trying to make a shapeless recipe with exact choice (custom nether star + glass bottle) for a custom potion, but for some reason the recipe only works when its just 1 of each item, why would that be? (lines 282-304 is the shapless recipe) https://paste.md-5.net/uyediwukap.cs

winter flower
#

My issue here is, I have 2 build plugins

prime reef
#

just add another

#

there's not a limit

winter flower
#

Got it

prime reef
#

i mean, probably, but you won't reasonably hit it

lost matrix
winter flower
#

Thanks alot dude

prime reef
prime reef
somber night
winter flower
winter flower
prime reef
prime reef
#

never worked with them

somber night
prime reef
#

I thought you were trying to do something like "this recipe takes 4 coal in this slot to craft 1 item" or something, but

lost matrix
shadow gazelle
#

Is there a way to tell who fired a projectile?

somber night
prime reef
shadow gazelle
#

Maybe it's in the projectile and I'm being stupid, but I've never been able to find that in the event or there

prime reef
#

getshooter or getowner or whatever in Projectile

prime reef
#

can't remember the details

#

but yeah

shadow gazelle
#

So it's in the projectile and not the event

prime reef
#

yeah, you don't necessarily need the event

winter flower
prime reef
lost matrix
somber night
lost matrix
winter flower
prime reef
#

hey how terrible of an idea would it be to write a plugin that simulates players

somber night
shadow gazelle
#

Seems like getEntity is overwritten and returns the projectile

prime reef
prime reef
shadow gazelle
#

I meant the shooter part

quiet ice
#

What would be a good name for a Set where elements are stored in a 3D grid that is dissected in three (or more) "layers" of increasing granularity where as individual portions (Chunks or regions) of the layers are removed from the map once a defined keepalive threshold bound to the portion has been reached, while the TTL is increased for every request (that is add and contains) and decreased for every period of inactivity within the portion of the layer?

prime reef
#

wait, what?

shadow gazelle
#

He was saying you have the shooter in the event

#

But that doesn't seem to be the case

prime reef
#

you could always just name it Terry and leave a snarky comment on it, though

lost matrix
quiet ice
prime reef
#

shooter can be null afaik

shadow gazelle
#

Yes

prime reef
#

like a dispenser

quiet ice
#

Oh, and it is concurrent in true geolykt fashion 😎

prime reef
shadow gazelle
#

It seemed like he was saying that you could get it from the actual event

prime reef
#

actually this sounds like something I was sketching out

#

tl;dr generating navmeshes on chunks that haven't had block modifications in a while

#

i'm gathering that you want to do something with inactivity in parts of a world, but not sure what the purpose is exactly

#

name it something related to its purpose, not how it functions

quiet ice
# prime reef I gathered as much lmao

Basically I want to mark a given block with a flag for caching reasons. Should that flag (or one close to it) not be queried for some time the region around the flag is simply discarded

prime reef
#

so you've basically got a hierarchy of spatial regions going on?

#

like a BSP?

lost matrix
#

Well i guess you can cross out the expiry as thats implied in cache

#

So SpatialCacheSet maybe

prime reef
#

not strictly a bsp, but i guess a bvh

quiet ice
prime reef
#

gotcha, it does sound a bit niche

prime reef
#

(a chunk is effectively a volume, so)

quiet ice
lilac dagger
#

Just send packets of said npc

lost matrix
#

I was kind of wondering how the insertion strategy looks like. Imagine inserting something into a chunk that is about to expire.

prime reef
#

it's very clear what it does

#

but it's also very Java™️

prime reef
quiet ice
#

it should've been ConcurrentRegionatedIntIntToObjectMap - but I think when I first thought out of this design it didn't come to me that I maybe want to have it concurrent

prime reef
#

but it's not my system

prime reef
quiet ice
#

Not all that much interestingly enough since most lower stuff is allocated as-needed

quiet ice
#

But the big issue with it is that it doesn't deallocate and has terrible iteration times

lost matrix
#

How does it grow?

#

Nvm just read the comment

quiet ice
#

Basically you have an array of "Cells" - so when growing you simply set a newly created cell atomically

lost matrix
somber night
quiet ice
#

But RegionatedIntIntToObjectMap isn't that thread-safe actually - but it was only meant to have a single thread writing to it and multiple reading from it. But this foresight was mainly caused by the map being created when I was still dabbling with concurrency

prime reef
#

me when synchronized block

quiet ice
#

Me when ConcurrentModificationException when using the iterator

prime reef
#

you could most likely redo this in a way that's thread-safe with minimal or no atomics/synchronized blocks

#

i don't know your code at all but food for thought https://www.youtube.com/watch?v=zULU6Hhp42w

Despite all of the recent interest, concurrency in standard C++ is still barely in its infancy.
This talk uses the primitives supplied by C++14 to build a simple, reference, implementation of a task system. The goal is to learn to write software that doesn’t wait.

NDC Conferences
https://ndc-london.com
https://ndcconferences.com

▶ Play video
quiet ice
#

Oh I defo can rewrite the map to be concurrent

prime reef
#

actually working on something with this right now at work

ivory sleet
prime reef
#

or i would be, if I was working today

#

woke up at 8 only to spend the next 4 hours being violently ill 😎 but that's neither here nor there

#

forgive my ignorance but can't you circumvent CMEs by just using array traversal instead of iterators

quiet ice
prime reef
#

C++ is so much nicer about this stuff lmao

prime reef
#

yeah if it's a dynamically sized array that's a pain

#

though I'd say that a dynamically sized array could still be largely nonvolatile and thread-safe until it hits a resize operation, at which point you'd want to lock

quiet ice
#

The fact that atomics in Java don't allow CAS for over 64 bits of memory isn't super nice

prime reef
#

java atomics are wacky

#

just cache align everything and use SIMD, easy

quiet ice
#

I think CAS in general is a bit ... unintuitive, If I dare to say

prime reef
#

me when outdated SSE align macros from 10+ years ago are in every struct

ivory sleet
#

nah java atomics arent that wacky

#

u just gotta understand VarHandle

#

its the closest to c++ ull get with java

prime reef
#

even though Java was my first language at age 11 lmao

ivory sleet
#

yea lol

prime reef
#

it's like the childhood friend you drifted away from and you're still in touch but you don't really know what they're up to anymore

quiet ice
#

VarHandle is nice and all but it sadly doesn't support arrays iirc. You gotta use the unsafe for that which sucks

ivory sleet
#

it does

#

to some extent at least

lost matrix
#

Yeah. Dereference a shared nptr and boom, core dumped, have fun. Or accessing already freed memory. Hmm jucy C++ problems
with suicide inducing exceptions.

prime reef
#

eh, it's not that bad

#

i almost never have issues with those things actually

ivory sleet
#

MethodHandles::arrayElementVarHandle is what u'd use, tho I suspect its gonna be rather handicapped so yea geol prob not the support u want

prime reef
#

I do take issue with C++ templating though

#

pain in the ass

shadow gazelle
#

How should I do something to a projectile while it flies through the air? Check if it meets my requirements in ProjectileLaunch then store it somewhere and follow it in an entity move event and do what I want while it flies?

prime reef
#

it has python-level type erasure syndrome

ivory sleet
#

tbh just rust

#

:]

lost matrix
ivory sleet
#

rust is perfect in most ways

prime reef
#

unfortunately, using anything other than C++ isn't an option at work

#

which sucks because I'm fucking sick of it

#

I like the language but god I despise our codebase

#

I'd quit if I didn't need the money lmao

#

it's that bad

shadow gazelle
prime reef
#

ah alright

#

I'd still just track it in a runnable or something

#

less overhead

floral drum
#

weee

lost matrix
quiet ice
shadow gazelle
prime reef
lost matrix
#

I thought you work in game development

prime reef
#

I work for a game publisher, but specifically I do rendering

#

the engine is in-house and older than I am

shadow gazelle
#

lol

prime reef
#

yeah.

lost matrix
#

ok...

prime reef
#

reason I clarified publisher is because I don't work on a specific game, just this stupid proprietary engine

shadow gazelle
#

So you work with the engine and not on it?

prime reef
#

Actually sorry no - I don't even work with the actual engine, I work with the multiple codebases we have for the tools the studios use to work on the games 💀

ivory sleet
prime reef
#

which are objectively poorly optimized garbage

#

that's not stuck-up junior syndrome, literally everyone agrees

lost matrix
prime reef
#

it's just that we don't have time to fix it

#

because Shareholders™️

lost matrix
#

Business value

floral drum
ivory sleet
#

I mean VarHandle allows u to access it with semantics of volatile

quiet ice
shadow gazelle
#

Does Kotlin have something like Java's
thing instanceof OtherThing otherThing?

echo basalt
#

doesn't concurrenthashmap also use Unsafe

shadow gazelle
#

I know there's thing is otherThing, but I can't figure out anything like that

quiet ice
stray parrot
#

I don't have all the functions in MinecraftServer.getServer(), am I importing it wrong? (I am using gradle)
implementation "org.spigotmc:spigot:1.18.2-R0.1-SNAPSHOT"

ivory sleet
floral drum
#

I'm pretty sure

#

oh right

#

hm

quiet ice
floral drum
#

you modified it

shadow gazelle
#

Yeah, Java's dynamic casting or whatever the hell it is

ivory sleet
#

Which atomic class ru looking at?

tender shard
lost matrix
ivory sleet
#

In kotlin its called smart cast instead of pattern matching I believe tho

shadow gazelle
#

Not even close to the right name

#

There

#

Pattern matching lol

#

Wait that might be wrong too

quiet ice
ivory sleet
#

Yeah i got a bit scared there for a moment, but that’s cool

floral drum
#
var casted: OtherThing? = thing as? OtherThing;

If I'm correct?

#

And then check if it's null, if so, it's not the type

stray parrot
ivory sleet
#

Tho maybe CHM still uses unsafe

#

I suspect not

stray parrot
shadow gazelle
floral drum
#

if (casted == null) {
return;
}

#

I guess

shadow gazelle
#

I should just explain what I want lol

lethal python
#

is there a page anywhere that covers good practice for making plugins that use custom item models? like how do i design a plugin that adds a custom item to be compatible with other plugins that have their own resource packs i am new

mellow snow
#

Hello, How can I check if a player drop an item? NOT a specific item. An example: I want when player drop an item send the message: "Player1 dropped: stone_block"

lost matrix
shadow gazelle
#
if (event.entity.shooter is Player) {
    // somehow make event.entity.shooter player so I can access it with that instead of the long call
}
lethal python
smoky oak
smoky oak
shadow gazelle
#

Kotlin, not Java

smoky oak
#

ah

#

good luck

#

no ide

#

aa

stray parrot
floral drum
#

Not experienced in kotlin

lethal python
floral drum
#

so don't blame me if that aint working

mellow snow
#

Hello, How can I check if a player drop an item? NOT a specific item. An example: I want when player drop an item send the message: "Player1 dropped: stone_block"

prime reef
ivory sleet
mellow snow
prime reef
#

it does work, wym

ivory sleet
#

Of u gonna use pdc

prime reef
#

though

#

i'm not sure if it works with the hotkey drop or if you just drop it from inventory

mellow snow
#

Idk what's the problem

#

an example of code?

prime reef
#

you probably didn't set up your event handler correctly

#

show me your code

lethal python
mellow snow
#

@EventHandler
public void PlayerDropItemEvent(PlayerDropItemEvent event) {

    Player p = event.getPlayer();

    if(!p.hasPermission("thelogger.bypass")) {


    }

}
prime reef
#

nothing is going to happen in that code block

#

it's empty

mellow snow
#

I know

prime reef
#

also, use something like hatebin to paste code snippets

mellow snow
#

because Idk how to code this

#

I try a thousend of times

#

but still not work

prime reef
#

Is this in a class that implements Listener? Do you instantiate the class somewhere and register it as a listener?

ivory sleet
prime reef
#

code snippets or bust

#

because this should work just fine

lethal python
mellow snow
#

How can I check if player drop an item?

prime reef
#

literally that event

ivory sleet
#

Yeah but I mean regarding custom model data

prime reef
#

it's always worked fine for me lol

ivory sleet
#

Just set it and get it

mellow snow
#

the codeline for check if a miss something

young knoll
#

Your textures would have to be manually merged with other packs anyway

ivory sleet
#

There is really no bad practice u can cook up I believe lol

chrome beacon
#

They want to avoid conflicts during that merging

young knoll
#

However yes, avoiding conflicting CMD would make that easier

lethal python
#

how do i avoid collisions with other resource packs

young knoll
#

Not much you can do other than pick a random range of numbers and hope

prime reef
#

there are over 2 billion ints

lethal python
#

there are only 0-999999 options

chrome beacon
#

Wait it's capped?

#

Not int limit?

prime reef
#

it shouldn't be?

lethal python
#

i think so

prime reef
#

weird

#

even so

#

that's quite a few fucking options

chrome beacon
#

As I said above you could probably use the hashcode of the namespace

prime reef
#

I would seriously not worry about this, resource pack compatibility is just not great right now

lethal python
#

yes but i just wanted to make absolutely sure

chrome beacon
#

Assuming it isn't capped to smth lower than int limit

prime reef
#

what you CAN do is make your stuff configurable

lethal python
#

so if a plugin uses a custom resource pack is it normal for it to be incompatible with other resource-pack-using plugins?

stray parrot
young knoll
#

It is indeed capped

ivory sleet
lethal python
#

ok cool i will do that too

ivory sleet
#

So that when collisions happen its an easy fix

chrome beacon
lethal python
#

col where did u find it's capped

mellow snow
#

pls help me with the drop event

#

I don't understand it

lethal python
#

what don't u understand

young knoll
#

It's capped at 7 digits

mellow snow
#

How the event have to work

young knoll
#

And can't start with 0

chrome beacon
undone axleBOT
lethal python
#

captaininja i reocmmend u watch kody simpson spigot tutorial or read that link

mellow snow
#

I know how an event work, but I don't understand how I have to check if player drop a random block and then send message "Player1 drop: Block"

floral drum
#

data assigned to that specific Particle

#

like Redstone has DustOptions I'm pretty sure

#

Yes

#

For some

young knoll
#

Type Parameters:
T - the data based based on the type of the effect

prime reef
#

someone wrote a post on these a while ago

young knoll
#

That says based twice

twin venture
prime reef
#

but no idea how outdated it is

prime reef
twin venture
#

yeah that can work too

prime reef
#

using string parsing is both slow and unreliable

#

there might be a field for whether a it's a block now actually

twin venture
#

he may or may not use old versions :p

young knoll
#

If you want to know if it's a block there is Material.isBlock

distant wave
#

can someone tell me what does this mean? those are fields in the class

prime reef
#

the error is not related to those underlines

ivory sleet
#

Location has a field of type WeakReference<World>

#

and that is not really accessible through reflection to any module

prime reef
#

oh mb i misunderstood

ivory sleet
#

its a goofy error if u havent encountered it before

#

doesnt say much

prime reef
#

yeah that's a weird one

#

it looked like some kind of botched JDK setup at a glance

ivory sleet
#

lmao

young knoll
#

Are you trying to json something

prime reef
#

would firmly recommend not using spigot's config API btw

young knoll
#

What did it do to you

prime reef
#

too much manual setup

#

i wrote one that uses jackson instead

#

works much better

ivory sleet
#

isnt that even more manual to setup?

#

but jackson is valid definitely

prime reef
#

It was a pain to write

#

but it works very well

ivory sleet
#

mye fair

prime reef
#

i have my qualms with my own implementation but

shadow gazelle
#

What kind of task should I use for something like applying an arrow trail?

ivory sleet
#

those run task timers

#

sounds most appropriately

shadow gazelle
#

I need a quick explanation sheet every time I need one of these lol

prime reef
young knoll
#

They aren't terrible with 1 tick between

#

At least for normal speed arrows

distant wave
prime reef
#

they are horrific even for max charge arrows

#

they look like shit

shadow gazelle
prime reef
#

very spotty

ivory sleet
young knoll
#

Meh

prime reef
young knoll
#

You can always do some vector math to max em more dense

ivory sleet
#

most likely u gonna have to write a custom type adapter for Location

distant wave
prime reef
shadow gazelle
prime reef
distant wave
prime reef
#

that's why

shadow gazelle
#

I thought you meant it could only run a certain amount of times total or something

young knoll
#

You would just need whatever gravity vector minecraft uses

prime reef
#

you need to write a custom serialization adapter

distant wave
#

then what should i use bruh

prime reef
#

gson is a pain in the ass imo

ivory sleet
#

most likely u gonna have to write a custom type adapter for Location

distant wave
ivory sleet
#

just use gson

#

and write that type adapter

lilac dagger
#

Best api is the one you don't have to make adapters for

ivory sleet
#

no?

prime reef
#

take it from someone who wrote a bigass jackson-spigot integration, including a user-"friendly" way of easily creating serialization type adapters

lilac dagger
#

Unless is json

#

They have a different definition for what an adapter is

prime reef
ivory sleet
young knoll
#

Isn't that fairly easy to do tho

ivory sleet
#

depends

prime reef
#

never run into these issues with jackson honestly, not saying you should use it

i am saying i don't know why they happen

lilac dagger
#

I guess they're done well?

ivory sleet
#

I mean they might encapsulate a reference queue coll

distant wave
#

can i just use World instead of Reference<World>?

ivory sleet
#

in which things become a bit more intricate

young knoll
#

You can if you want

#

But Location doesn't

prime reef
#

yeah Location is the issue here

lilac dagger
prime reef
#

is it that gson can't serialize WeakReference?

young knoll
#

You just need an adapter that goes from that -> world name and vice versa

lilac dagger
#

Like memory leaks

young knoll
#

yes

distant wave
#

so if i serialize the world name?

ivory sleet
#

yes anhwylder

prime reef
#

because if so, yeah, you need to write the adapter

distant wave
#

and then get it

young knoll
#

It tries to with reflection, but fails

prime reef
#

yes

#

God I wish I could change my spigot username

lilac dagger
#

You can if you donate to md

prime reef
#

💀

lilac dagger
#

You get a cool badge also

#

And dark theme

prime reef
#

bribing him to take my usual username from whoever might have it

young knoll
#

Man has to fund spigot somehow :p

mellow snow
lilac dagger
#

Actually themes in general

prime reef
#

Material#getBlock

#

or isBlock

#

sorry, it's the latter lmao

lilac dagger
mellow snow
prime reef
lilac dagger
#

Pretty sure it had 0 threads/posts

prime reef
young knoll
#

What the fuck is a method

lilac dagger
#

Md is understanding, just try

prime reef
echo basalt
#

memory leaks are so fun

#

I wonder how weakref works

young knoll
#

You should ask @worldly ingot how much he loves having to use choco_dev

prime reef
# lilac dagger Md is understanding, just try

oh I wasn't saying I wouldn't LOL just expressing my general confusion that people take that username, which is simultaneously distinct and not cringe, and then don't use the platform lol

echo basalt
#

or if it's some hardcoded jvm bs

ivory sleet
prime reef
#

yeah refs are

#

something

#

I generally don't use them unless I have to

distant wave
#

wrote a quick wrapper, what do you think?

ivory sleet
#

well the parent field T referent in Reference is treated with special care

prime reef
#

if gson will eat it, it's fine

ivory sleet
#

thats not at all what I meant

distant wave
#

you meant serializer for the data class right?

ivory sleet
#

what I mean is that you extend the class TypeAdapter<Location> (its from gson itself)

lilac dagger
#

That's a wrapper, not an adapter

ivory sleet
#

and then u write ur own rule of how serializing and deserializing a Location object should work

worldly ingot
lethal python
#

what's this abotu usernames

lilac dagger
#

I hope discord loves the change

stray parrot
#

Hello, how can i use remapped mojang library?
atm i only have this:
implementation "org.spigotmc:spigot:1.18.2-R0.1-SNAPSHOT"

young knoll
#

?nms

chrome beacon
young knoll
#

Ah yeah

#

So pretty much userdev or some random plugin

bronze crystal
#

In order to gain access to the recipies I need a CraftingInventory object. how do I get it? I need it to craft items in the background while the Player is using s custom inventory

somber night
bronze crystal
upper hazel
#

if i have 5 dependency this big project in plugin?

#

or "base developer project"

ivory sleet
#

not that big

visual tide
upper hazel
ivory sleet
#

depends on what dependencies

#

why the question? lol

upper hazel
#

dependencies

#

wg, vault etc.

ivory sleet
#

sounds like a decently sized plugin?

visual tide
#

what a plugin does is usually a better indicator of "size" than the number of dependencies

somber night
#

how can i make a custom item thats an uncraftable splash potion have a white/no color instead of that bright pink/purple

stray parrot
merry abyss
#

Can't i use timed tasks with bukkit?

eternal oxide
stray parrot
#

alr ty

upper hazel
#

someone who know good tutoral for create gui

merry abyss
# upper hazel someone who know good tutoral for create gui

How to make a GUI in Minecraft using custom inventories and items. GUI menus are popular on big networks and let players choose options in a menu-like manner.

This GUI menu tutorial is split into two. This is the first part for beginners. Bukkit is severely limited when you want to create multi-page menus, GUI animations etc., so in the next p...

▶ Play video
upper hazel
#

with button objects etc

#

thenks

merry abyss
#

I belive he also has a more advanced video related to the topic

upper hazel
merry abyss
#

Can you eloborate then?

upper hazel
#

modern approaches of "serious and user-friendly" gui

#

"real gui"

#

how say it

young knoll
#

?gui

#

darn

upper hazel
#

this tutorial for who not know base knowledge obaut inventory

upper hazel
#

thenks

#

oh this better

#

oh what the @subcommand?

#

i want it too

#

oh demm this annotation

#

this hard use?

#

this be my first try

tall dragon
#

its from aikar command framework

upper hazel
#

thf

#

oh good this not plugin

tall dragon
#

no. its a library

#

a very good one imo

merry abyss
#

?paste

undone axleBOT
upper hazel
#

this so big for bukkit command

#

i think i can use 1 annotation

merry abyss
upper hazel
#

well bc some null object exists in your class?

tall dragon
#

that aint a nullpointer

#

thats a classcastexception

upper hazel
#

oh lol

tall dragon
#

cuz ur tryna cast ur PlayerBase class to a Plugin

merry abyss
#

What would be the approach instead?

tall dragon
#

u have both these plugins installed?

#

this makes little sense

#

ru shading the api or something

merry abyss
#

Dont know what that means. I've just created a plugin(api) for keeping track of my playerdata and scoreboard. And then on my AfterlifeWaves(plugin) i'd like to call a method that updates the scoreboard

tall dragon
#

so u have 2 seperate plugins

merry abyss
#

Yes

tall dragon
#

honestly just create instance in onEnable

#

idk tbh

merry abyss
#

I already instaciated it

glass mauve
#

I have this in my build.gradle:

dependencies {
    implementation 'com.github.ben-manes.caffeine:caffeine:3.1.6'
    // ...
}
#

and still get this:

[21:39:49] [Server thread/ERROR]: Error occurred while enabling FrameUI v1.0 (Is it up to date?)
java.lang.NoClassDefFoundError: com/github/benmanes/caffeine/cache/Caffeine
        at me.squidxtv.frameui.api.cache.ImageCacheImpl.<init>(ImageCacheImpl.java:25) ~[?:?]
        at me.squidxtv.frameui.FrameUI.onEnable(FrameUI.java:52) ~[?:?]
        at org.bukkit.plugin.java.JavaPlugin.setEnabled(JavaPlugin.java:266) ~[spigot-api-1.20.1-R0.1-SNAPSHOT.jar:?]
        at org.bukkit.plugin.java.JavaPluginLoader.enablePlugin(JavaPluginLoader.java:342) ~[spigot-api-1.20.1-R0.1-SNAPSHOT.jar:?]
        at org.bukkit.plugin.SimplePluginManager.enablePlugin(SimplePluginManager.java:480) ~[spigot-api-1.20.1-R0.1-SNAPSHOT.jar:?]
        at org.bukkit.craftbukkit.v1_20_R1.CraftServer.enablePlugin(CraftServer.java:544) ~[spigot-1.20.1-R0.1-SNAPSHOT.jar:3843-Spigot-b41c46d-4be756e]
        at org.bukkit.craftbukkit.v1_20_R1.CraftServer.enablePlugins(CraftServer.java:458) ~[spigot-1.20.1-R0.1-SNAPSHOT.jar:3843-Spigot-b41c46d-4be756e]
        at net.minecraft.server.dedicated.DedicatedServer.e(DedicatedServer.java:220) ~[spigot-1.20.1-R0.1-SNAPSHOT.jar:3843-Spigot-b41c46d-4be756e]
        at net.minecraft.server.MinecraftServer.w(MinecraftServer.java:973) ~[spigot-1.20.1-R0.1-SNAPSHOT.jar:3843-Spigot-b41c46d-4be756e]
        at net.minecraft.server.MinecraftServer.lambda$0(MinecraftServer.java:304) ~[spigot-1.20.1-R0.1-SNAPSHOT.jar:3843-Spigot-b41c46d-4be756e]
        at java.lang.Thread.run(Thread.java:1589) ~[?:?]
Caused by: java.lang.ClassNotFoundException: com.github.benmanes.caffeine.cache.Caffeine
        at org.bukkit.plugin.java.PluginClassLoader.loadClass0(PluginClassLoader.java:147) ~[spigot-api-1.20.1-R0.1-SNAPSHOT.jar:?]
        at org.bukkit.plugin.java.PluginClassLoader.loadClass(PluginClassLoader.java:99) ~[spigot-api-1.20.1-R0.1-SNAPSHOT.jar:?]
        at java.lang.ClassLoader.loadClass(ClassLoader.java:521) ~[?:?]
        ... 11 more
merry abyss
#

Or do you mean i have to instaciate the AfterlifePlayerbase(api) inside my onenable?

eternal night
glass mauve
#

wouldnt it run automatically when running build?

eternal night
#

no

glass mauve
#

ah ok mb

#

thanks

eternal night
#

usually you have either the build task or assemble task depend on it

tall dragon
#

even though its not best practise either

merry abyss
#

I already have the getinstance on my api

tall dragon
#

yea but its using getPlugin for some reason

#

why not call getPlugin from ur other plugin then

merry abyss
#
    public static PlayerScoreboard getPlayerscoreBoard() {
        return playerscoreBoard;
    }
    public static AfterlifePlayerBase getInstance() {
        return afterlifePlayerBase;
    }```
tall dragon
#

so ur getting the instance to then call a static method?

#

that makes no sense

#

u can also call getPlayerscoreboard directly then

merry abyss
#

Shouldn't i call the main class when trying to access it from my AfterlifeWaves?

somber night
#

so ive been testing my plugin and noticed that when i use one of the custom items it consumes 2 at a time instead of 1, i have no idea where i couldve gone wrong, but its most likeley between lines 334 & 580, if you are extremely bored and feel like helping figure it out heres the code: https://paste.md-5.net/sukolepula.cs

tall dragon
tall dragon
#

sure

glass mauve
#

I have problems to load an path from inside the resources folder.
my file is in my plugins resources/model/model.xml and I need it as a java.nio.file.Path

Caused by: java.nio.file.FileSystemNotFoundException
        at jdk.nio.zipfs.ZipFileSystemProvider.getFileSystem(ZipFileSystemProvider.java:156) ~[jdk.zipfs:?]
        at jdk.nio.zipfs.ZipFileSystemProvider.getPath(ZipFileSystemProvider.java:142) ~[jdk.zipfs:?]
        at java.nio.file.Path.of(Path.java:208) ~[?:?]
        at me.squidxtv.testing.commands.SpawnTestScreenCommand.<clinit>(SpawnTestScreenCommand.java:26) ~[?:?]
        ... 10 more

with

Path.of(SpawnTestScreenCommand.class.getResource("/model/model.xml").toURI())
#

the getResource seems to be working, but Path.of cant find it somehow

prime reef
#

and you're definitely including this in your packaged .jar, right?

glass mauve
#

the getResource doenst throw anything so I think so

#

the exception is coming from Path.of

#

let me check though

#

yeah it exists in the jar

chrome beacon
glass mauve
#

how do I do that?

chrome beacon
#

FileSystem fs = FileSystems.newFileSystem(<uri of jar>);
fs.getPath("/model/model.xml")

#

Now this might be a bit of an xy problem

#

What is the goal here

worldly ingot
#

Better option is to use JavaPlugin’s getResource() method instead

glass mauve
#

ok let me explain real quick

#

I have an library which I want to test, the library generates something by a model as an xml file.
now the model is generated with this method:

public static @NotNull ScreenModel of(@NotNull Path xml) {}

the path is needed because I want to support relative paths inside the xml
imagine the model is referencing an image which is on the same level of the
xml and my library should automatically scan and get the image that way:

<?xml version="1.0" encoding="UTF-8"?>
<screen xmlns="http://www.squidxtv.me/schema/frameui/v1/frameui.xsd"
        id="test-frame"
        width="5"
        height="3"
        background-image="@{../images/bgmarker.png}">
    <div id="first-div" width="640" height="384" border-color="#FFFFFF" border-width="1"/>
</screen>

where bgmarker.png is also in /resources/images/bgmarker.png
now I am also unsure if this will even work because I load the image like this:

        URI documentLocation = URI.create(element.getOwnerDocument().getDocumentURI());
        Path path = PathUtils.convert(Path.of(documentLocation), result);
        try {
            return Optional.of(IMAGE_CACHE.getOrLoad(path));
        } catch (IOException e) {
            return Optional.empty();
        }

where element is the org.w3c.dom.Element
and reading works like this:

    @Override
    public @NotNull BufferedImage getOrLoad(@NotNull Path path) throws IOException {
        BufferedImage image = cache.getIfPresent(path);
        if (image == null) {
            image = ImageIO.read(Files.newInputStream(path));
            cache.put(path, image);
        }
        return image;
    }

probably wont really work correctly

lilac dagger
#

Isn't there computeIfabsent?

glass mauve
#

but instead of a path I could just take in an InputStream directly but then I am not sure if element.getOwnerDocument().getDocumentURI() will have the information fo the path

glass mauve
lilac dagger
#

Ah

glass mauve
#

so I have no idea how to correctly load in resources from another plugins

#

that use my library

#

and I dont want to let the user of my library supply all images, I want to automate it

eternal valve
#

How can I make a loading screen using shader cores /// for example :

glass mauve
eternal valve
#

I think appropriate question

glass mauve
#

I dont think so, you want some client side changes

#

check the channels description

#

Serious Spigot and BungeeCord programming/development help | Ask development-related questions here

kind hatch
eternal valve
#

We don't need to argue

#

🥹

kind hatch
#

Shaders fall under development though. :p

glass mauve
#

but how is this related to Spigot/BungeeCord

eternal valve
#

I think shaders are very difficult

kind hatch
#

They typically are. I haven't messed with them but I think @echo basalt has.

prime reef
#

Shaders are alright

#

but

#

I'm a rendering engineer LMAO

echo basalt
#

whomst ping

prime reef
#

so I'm biased

#

I literally work in computer graphics 💀

eternal valve
kind hatch
prime reef
#

mc shaders are GLSL, aren't they

#

since LWJGL

echo basalt
#

Not directly

#

there's a guy at work that plays with shaders

#

he isn't here tho

prime reef
#

I don't know shit about setting mc shaders up, but if it's shader code we're talking, I can probably help

glass mauve
prime reef
#

I work with HLSL, but GLSL isn't a stretch to translate

kind hatch
#

Don't you have experimental stuff that have resourcepack shaders? Or am I thinking of Lynx?

#

Someone with a pink name has messed with them. :3

glass mauve
#

its the same as Path.of

eternal valve
shadow gazelle
glad prawn
glass mauve
#

?

prime reef
eternal valve
shadow gazelle
#

You don't use shaders to modify the title screen

#

You just modify the title screen

#

Or replace the resources with a resourcepack

shadow gazelle
glad prawn
lilac dagger
#

Yeah, doesn't make sense to use shaders on the title screen

glass mauve
#

also Paths.java recommends using Path.of instead

shadow gazelle
#

Well it's just a loading screen, so I think you can use just an image

glad prawn
#

yeah i was stuck on Java 8

shadow gazelle
#

But all you can do is replace the resources that are used there

#

If you want anything else you need mixins

#

Or Forge/Fabric if you would rather render over

eternal valve
shadow gazelle
#

"but /// first resourcepack" what

eternal valve
eternal valve
shadow gazelle
#

First of all, what the hell are shader cores

eternal valve
#

I want to add it too, but I have found 2 sources so far, there are no others around

eternal valve
#

I just said what it says but it says they are made with flutter shader

worldly ingot
#

Resource packs support GLSL shaders

shadow gazelle
#

Oh right

worldly ingot
#

They're non-standard and always subject to change, but they refer to them as "core shaders"

shadow gazelle
#

But they don't replace game textures

eternal valve
worldly ingot
#

The logo is probably a simple texture replacement but the colour change is likely done by a shader

#

You could just download the texture pack and find out how they did it :P nothing is hidden

#

Can open shader files with a simple text editor of your choice

#

Should be .fsh for fragment shaders and .vsh for vertex shaders

eternal valve
shadow gazelle
#

Those can't change textures, though

#

Is there something I'm missing like the loading screen is animated?

worldly ingot
#

The snowflakes likely aren't textures. Shaders can draw literally anything you want