#help-development
1 messages · Page 730 of 1
Pretty intuitive variable names
it's just a plugin for "myself", why would variables matter that much if the classes aren't even that full of code?
?paste
?paste teh WHOLE class
Class pls
both?
TIL
there goes my shitty code 😥 time to get insulted
All good, we've seen worse for sure
I've kept some old habits that i've seen people to change
We need to get MD to add a :givecode: emote
?paste
I have so much shit to do today so I'll be watching in the back
Ima need to bleach my eyes real quick
Poor lad
...
Cmon guys it can't be that bad
ive worked with worse
Nothing too out of the ordinary. Could probably be condensed to 20% of what its now but nothing game breaking.
HomeDatabase class pls
Shhh, don't make it obvious I was joking
if your gonna squirm like a kid instead of help then leave
Okay that nested runnable isn't pretty
Your bunny wrote
But shh
thank you for replying to the message saying that I was leaving with "then leave"

@lost matrix Ain't this it?
i dont like it either.,.. i made it few months ago
and it always worked so i kept the code
Ah missed that
this class was made like a year ago and has been working everytime
since it worked, never felt like changing uknow'
Nothign in your code could cause that error. Paper moment.
"It ain't pretty, but it works"
thank you for contributing literally nothing to the conversation
👍
Like a 2006 Toyota Corolla
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
Hey! It was an alright vehicle for the time. smdhsentjklhsaetja
this was the class:
https://paste.md-5.net/icamuduhiz.java
Is this a spammail?
Run a spigot server for a day. Put up with any lag
if you get no error its a Paper issue
My money is on their new plugin loader.
when did this come out?
That could be a possibility...
My money is from 1982
That is very unusual. I would try to update my jdk and mc server jar.
Some time in June. IIRC
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
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
Any 3d pathfinding libs written in java?
I prefer no errors over better perfomance (most of the time)
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
I mean you have Pathetic
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
Md reading this preparing to launch an ICBM:
💥
md was in on the discussion about this way back
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
🤔
Most people change to paper because others tell them its better.
only issue im seeing is loading new chunks, feels like spigot stutters a bit sometimes
I've used both and notice no noticable differences, but I do run everything local
chunk system and startup times is where you will see the difference on a local host 1 player server
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
luckPerms use placeholders for displayName prefix yes? But what will be if my plugin for rank use it too?
conflict?
Just client side?
[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?
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;
}```
?paste the whole error and the PlayerSetting class
What’s the best way to see 1.8 and 1:12 intervals

Haven't played since then, just recently got back into minecraft
I’m adding multi version support
And I need to add support for packet entities on 1.8
It tells you whats wrong.
Cannot cast org.meyer.afterlifewaves.AfterlifeWaves to org.meyer.afterlifeplayerbase.AfterlifePlayerBase
In your getInstance() method.
@merry abyss ^
you reckon this is the problem?
private final AfterlifePlayerAPI playerAPI = AfterlifePlayerBase.getPlayerAPI();```
Because im using the synchronized
```java
public static AfterlifePlayerAPI getPlayerAPI() {
synchronized (AfterlifePlayerBase.class) {
if (playerAPI == null) {
playerAPI = new PlayerScoreboard();
}
}
return playerAPI;
}```
I reckon whatever line 34 in AfterlifePlayerBase is the problem
Synchronized does nothing there
its empty ;://
Run the plugin again and see what the line is then
I know that this isn't related to the topic, but what library is this?
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]```
What does it do?
Does anyone know how to compile premium plugins like oraxen?
The api is responsible for updating player data as well as the scoreboard data
Just like any Java project
Good thing to have actually.
i dont know how to :/
Im applying all my C# knowledge for this project xD
what
We cannot help without the full stacktrace; Please paste it here: https://paste.md-5.net
please stacktrace?
Whenever someone says that it almost always ends bad... usually it turns out they only have Unity knowledge and don't understand basic concepts
Never been a fan of unity. I was proffesional with c# as a backend developer
let me refrase Student
i downloaded the master zip file now what
?paste
Why are you trying to compile it
@hasty prawn https://paste.md-5.net/jaxejeyisu.bash
Show your AfterlifeWaves class
Still says line 34 so
cause im broke
Nah we need the AfterlifePlayerBase class I think

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);
}
}
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
These are 2 different plugins right
Yes
but the creator himself says he doesnt care as long as u dont redistribute
Then ask them to give you a jar
bro :/
It shouldn't be too hard for you to figure out how to compile it yourself, do some googling.
i did
idk how
you don't know how to compile, or you don't know how to google
probably both
idk what to search up
I've no idea why it's telling you that error, but I would just change the way you're getting your instance to Singleton or use DI. Should fix the problem either way.
see im kinda stupid
Which, with an API, DI is probably better.
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
I was planning to change it however I do not believe it’s the cause of my problem
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
so? read the second part
Yeah he won't activly try to stop you
That doesn't mean they want you to or allow you to
Sorry wrong channel
oh damn, i was answering the question
?di
Guide to dependency injection: https://www.spigotmc.org/wiki/using-dependency-injection/
Whats weird about it
Oh sorry can you answer it in #help-server
i was answering in a way of you creating the plugin, but if you asked on server I assume you're looking for a plugin made by someone else
Yeah something like that
What's the event that triggers when a TNT breaks a block?
You can also check for explosion or smth.
EntityExplodeEvent
Thats it
I'm trying to use BlockExplodeEvent but it wasn't working
TNT is an entity thats why
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.
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
thats different
its still givign the ClassNotFound when the class is from the own plugin
on disable it quickly saves the data before shutting down the server
which works every restart
but this time it randomly gave that error
different class?
the data also happen to be saved when a player leaves, but i restarted and nobody left the server yet after i changed jar
last time it was HomeDatabase?
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"
its always upon instancing a Class though
new
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?
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
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
in your case you are calling new Database(Player) often
you should instead store the first instance and reuse it
Database just has the code to save on the mysql
@eternal oxide
imagine you have a funcion saveOnDb(Player, column, data)
how should I do it then?
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
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
its very odd
Is this discussion about the ClassNotFound error still going on?
I wonder (idk) if there is malware that can cause that
is your project on git?
local on my intellij idea project 🤔
You can get that error if your jar file was being / got replaced during server shutdown
do you get any startup errors/warnings about javaassist?
no errors on startup
Or you uploaded the file while the server is on
i update the file and when its fully on the plugins folder, I then shutdown
that shouldnt be an issue
You should only update when it's offline
this is an error he and one other is having about a running server. no plugin changes
@hasty prawn I cant get this depedency injection thing to work
the error happens after a while with classes that havent been used
This is a deep rabbit hole, at this point I personally would say "fuck it" and remake the whole project
im remaking the project already
@smoky oak Chime in if you ever found a fix for your issue.
It doesn't matter, just don't update the jar file while the server is one
this has happened before with other project
i do it all the time
and no other plugins is giving error
it's just mine in particular
oh, are you live updating yrou jar?
which one lol
the class not found/def error
Server is online, I upload the file to the plugins folder, and once it says it's been uploaded, I then restart the server.
ok cool
another person here having same issue, but it looks like his is due to updating teh jar with the server running
And that error appears before that restart right?
Can someone provide an example of Injection a service class. And then using it on another plugin?
no
the error appears randomly after a while
Don;t update jars with the server running, it can cause old/new class instances issues like you are seeing
but i restart after, not reload
so server goes completely off and then goes on
🤔 why should that be an issue?
doesn't matter. its not safe
https://www.spigotmc.org/threads/weird-noclassdeffounderror-on-plugin-disabling.546582/ same thing, look at blablubbabc reply
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
Regardless, don't live update the jar file
Is there an event for when a plugin is reloaded because of a /reload?
yes
And what is the event?
?jd-s search load
ServerLoadEvent
Guide to dependency injection: https://www.spigotmc.org/wiki/using-dependency-injection/
I see, server load event + type RELOAD
i dont bother with reload anymore tbh
i just treat 'unload' as 'shutdown'
everything gets removed and re-initialized
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
There is already a library from google for that.
and it didn't do what I wanted it to
the library i wrote does a bunch of other shit too, so
But i dont like CDIs as it hides so much important information.
Proper di helps you tremendously with creating a clean design.
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
Such as?
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
Ive seen some very concerning code in enterprise projects. But i was also at a company that had a very
intuitive design philosophy which resulted in quite maintainable code.
Using pom.xml is there a way to make the application run a console command after packaging to a .jar?
yeah, I work for a game publisher, so
There is sure some maven plugin, search it up
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"
yeah, maven offers support for something like this, I use it to copy my shaded jar to my test server plugin directory
Tried searching but I couldn't really understand anything which is why I resorted to here
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"
Which part u don't understand
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)
Send your current pom and what u tried
Alright
<build>
<plugins>
<plugin>
<!-- your plugin stuff goes here -->
</plugin>
</plugins>
</build>```
super truncated
Current pom.xml: https://paste.md-5.net/govimaquwo.xml
What I tried was the resource from here: https://stackoverflow.com/questions/39087922/run-a-script-after-maven-install
Which I had a hard time even understand how to implement
I replaced install with package
aye
it was just mainly confusing for me as I'm not really used to maven configurations
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.
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>```
Well I do understand that much but I didn't really understand where to place it exactly
in this section you'd want to replace do-something.sh with whatever your script is
what do you mean? in your pom?
Yes
see: this
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
My issue here is, I have 2 build plugins
Got it
i mean, probably, but you won't reasonably hit it
The minecraft crafting system doesnt support ingredients with multiple amounts.
Thanks alot dude
you'd need to implement a custom crafting interface to use multiple of an item
you'd just wanna slap that in after the last </plugin> in your pom, but before </plugins>
whats that mean...? i wanna be able to add like 64 of each and be able to craft 64 of the potion (like regular crafts)
Yeah I understand that much lmao, thank you tho
Minecraft only works with 1 amount in the normal crafting interface sadly
aye lmao
need some more info on your use case, can't you just shift click the item and it'll craft as many as possible? i actually don't know how spigot parses custom craft events
never worked with them
but the other recipes work fine, which is confusing
I thought you were trying to do something like "this recipe takes 4 coal in this slot to craft 1 item" or something, but
Try to explain your problem again. Maybe i misunderstood you.
^
Is there a way to tell who fired a projectile?
not that, itd be like "1 coal = 1 item, 32 coal = 32 items"
Yeah, ProjectileLaunchEvent
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
getshooter or getowner or whatever in Projectile
declaration: package: org.bukkit.entity, interface: Projectile
So it's in the projectile and not the event
yeah, you don't necessarily need the event
Added this line btw: https://paste.md-5.net/eyuzupopeb.xml
and my IDE is not liking it, it's erroring saying Element plugin is not allowed here
that's because it needs to be under the <plugins> tag
In the launch event you have the shooter as well as other information.
You can add data to the Projectile there via its PDC if you need more than just the shooter.
vanillacrafts allow you to add any amount of items (for example 64 planks can craft up to 64 buttons) and i want that to be the same
pdcs are a blessing
That should work just fine.
Got it, works now, thank you.
aye, grand
hey how terrible of an idea would it be to write a plugin that simulates players
You can?
the thing is if i add 2 of each material the result is null
Seems like getEntity is overwritten and returns the projectile
Yeah, I wrote a wrapper for handling PersistentDataContainers but they're not too bad at baseline
a projectile is an entity
I meant the shooter part
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?
wait, what?
He was saying you have the shooter in the event
But that doesn't seem to be the case
you'll...have to elaborate on what you're doing.
you could always just name it Terry and leave a snarky comment on it, though
That sounds like you need 4 class names and not one set name
Some very elaborate caching datastructures
You don't, but you can get the projectile, which has a shooter.
shooter can be null afaik
Yes
like a dispenser
Oh, and it is concurrent in true geolykt fashion 😎
I gathered as much lmao
It seemed like he was saying that you could get it from the actual event
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
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
SpatialExpiryCacheSet...
Well i guess you can cross out the expiry as thats implied in cache
So SpatialCacheSet maybe
not strictly a bsp, but i guess a bvh
Not for libraries. I want to make it sorta generic so I can easily reuse it for any project in the future - and perhaps allow others to use it
gotcha, it does sound a bit niche
this is pretty generic while being accurate, unless it's actually a bounding volume hierarchy
(a chunk is effectively a volume, so)
Well it is sorta like https://github.com/Geolykt/Presence/blob/main/src/main/java/de/geolykt/presence/common/util/RegionatedIntIntToObjectMap.java but 3D instead of 2D and also having the expiry constraints to make it not overflow the JVM's memory given enough time
Just send packets of said npc
I was kind of wondering how the insertion strategy looks like. Imagine inserting something into a chunk that is about to expire.
the name of that class gave me an aneurysm
it's very clear what it does
but it's also very Java™️
I feel like that would intrinsically flag it as keepalive or whatever
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
but it's not my system
also christ how much memory does this thing eat
Not all that much interestingly enough since most lower stuff is allocated as-needed

But the big issue with it is that it doesn't deallocate and has terrible iteration times
Basically you have an array of "Cells" - so when growing you simply set a newly created cell atomically
Problem solved?
i have a few things i gotta do, ill ping you when i see if you want
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
me when synchronized block
Me when ConcurrentModificationException when using the iterator
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
Oh I defo can rewrite the map to be concurrent
actually working on something with this right now at work
exploring var handle be like :>
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
I've recently created https://github.com/Starloader-project/stianloader-concurrent/blob/main/src/main/java/org/stianloader/concurrent/ConcurrentInt62Set.java which I personally consider to be very concurrent (even has an iterator!), though I am not super happy at it not supporting #equals and #hashCode but what can you do?
C++ is so much nicer about this stuff lmao
Yeah, until the array shrinks
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
The fact that atomics in Java don't allow CAS for over 64 bits of memory isn't super nice
I think CAS in general is a bit ... unintuitive, If I dare to say
me when outdated SSE align macros from 10+ years ago are in every struct
nah java atomics arent that wacky
u just gotta understand VarHandle
its the closest to c++ ull get with java
i work with a lot of low level C++ stuff so Java's abstractions are weird to me
even though Java was my first language at age 11 lmao
yea lol
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
VarHandle is nice and all but it sadly doesn't support arrays iirc. You gotta use the unsafe for that which sucks
Yeah. Dereference a shared nptr and boom, core dumped, have fun. Or accessing already freed memory. Hmm jucy C++ problems
with suicide inducing exceptions.
MethodHandles::arrayElementVarHandle is what u'd use, tho I suspect its gonna be rather handicapped so yea geol prob not the support u want
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?
it has python-level type erasure syndrome
there is no entity move event
The higher level you get, the nicer it gets. After a few layers, it can get manageable. I currently still feel safer writing rust tbh.
rust is perfect in most ways
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
Oh, it's a Paper event
weee
oof. You guys use an engine?
I have no clue what that does. I guess I'll stick with my AtomicXArray
That was my idea if the launch event couldn't keep track of it past the launch
an engine for what?
It cannot, no
I thought you work in game development
I work for a game publisher, but specifically I do rendering
the engine is in-house and older than I am
lol
yeah.
ok...
reason I clarified publisher is because I don't work on a specific game, just this stupid proprietary engine
So you work with the engine and not on it?
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 💀
Ah yeah well AtomicArray delegates to that VarHandle impl
which are objectively poorly optimized garbage
that's not stuck-up junior syndrome, literally everyone agrees

Business value
weee volatile
I mean VarHandle allows u to access it with semantics of volatile
No, it uses the sun Unsafe
Does Kotlin have something like Java's
thing instanceof OtherThing otherThing?
doesn't concurrenthashmap also use Unsafe
I know there's thing is otherThing, but I can't figure out anything like that
Yeah
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"
What version ru on geol
"is"
I'm pretty sure
oh right
hm
java 17 I think?
you modified it
Yeah, Java's dynamic casting or whatever the hell it is
Which atomic class ru looking at?
you're using the obfuscated mappings, is that on purpose?
Did you run BuildTools for that version?
Yes
In kotlin its called smart cast instead of pattern matching I believe tho
Not even close to the right name
There
Pattern matching lol
Wait that might be wrong too
Ah no, I had another J8 project open and eclipse defaulted to that. J17 seems to actually use VarHandles
Yeah i got a bit scared there for a moment, but that’s cool
var casted: OtherThing? = thing as? OtherThing;
If I'm correct?
And then check if it's null, if so, it's not the type
Not really, I am not using it on purpose, I am just trying to get all the functions
I ran
java -jar BuildTools.jar --remapped --rev 1.17
What about in an if statement though?
I should just explain what I want lol
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
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"
namespace. Add the plugin name
And you expected a non-remapped 1.18 version to pop out? 
if (event.entity.shooter is Player) {
// somehow make event.entity.shooter player so I can access it with that instead of the long call
}
i thought custom model data had to be a number
isnt it a resource pack path?
if(entity instanceof Player player)
Kotlin, not Java
Sorry, I don't really know how to use those, I am kind of new into this
val shooter: Any = event.entity.shooter;
if (shooter is Player) {
shooter.getName();
}```
Not experienced in kotlin
no it's an int like in the itemmeta
so don't blame me if that aint working
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"
isn't there just a PlayerDropItemEvent
Well I have a nice practice regarding name spaces
It doesn't workk AAA
it does work, wym
Of u gonna use pdc
though
i'm not sure if it works with the hotkey drop or if you just drop it from inventory
how do you use namespaces when custommodeldata is an int. how do you namespace an int
@EventHandler
public void PlayerDropItemEvent(PlayerDropItemEvent event) {
Player p = event.getPlayer();
if(!p.hasPermission("thelogger.bypass")) {
}
}
Hashcode?
I know
also, use something like hatebin to paste code snippets
Is this in a class that implements Listener? Do you instantiate the class somewhere and register it as a listener?
Well likely you gonna have to use the PDC api for identifying custom items no?
yes
that isn't what im talking about
How can I check if player drop an item?
literally that event
Yeah but I mean regarding custom model data
it's always worked fine for me lol
Just set it and get it
the codeline for check if a miss something
Your textures would have to be manually merged with other packs anyway
There is really no bad practice u can cook up I believe lol
They want to avoid conflicts during that merging
However yes, avoiding conflicting CMD would make that easier
how do i avoid collisions with other resource packs
Not much you can do other than pick a random range of numbers and hope
there are over 2 billion ints
there are only 0-999999 options
it shouldn't be?
i think so
As I said above you could probably use the hashcode of the namespace
I would seriously not worry about this, resource pack compatibility is just not great right now
yes but i just wanted to make absolutely sure
Assuming it isn't capped to smth lower than int limit
what you CAN do is make your stuff configurable
so if a plugin uses a custom resource pack is it normal for it to be incompatible with other resource-pack-using plugins?
i don't really know how to use those cus i am kind of new into this, could you please help me?
It is indeed capped
Usually we provide configs for that
ok cool i will do that too
So that when collisions happen its an easy fix
:mojank:
col where did u find it's capped
what don't u understand
It's capped at 7 digits
How the event have to work
And can't start with 0
?eventapi
captaininja i reocmmend u watch kody simpson spigot tutorial or read that link
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"
data assigned to that specific Particle
like Redstone has DustOptions I'm pretty sure
Yes
For some
Type Parameters:
T - the data based based on the type of the effect
someone wrote a post on these a while ago
That says based twice
event.getDropedItem().getItemStack().getType().name().contains("BLOCK)
but no idea how outdated it is
use isSolid or something instead tbh
yeah that can work too
using string parsing is both slow and unreliable
there might be a field for whether a it's a block now actually
he may or may not use old versions :p
If you want to know if it's a block there is Material.isBlock
can someone tell me what does this mean? those are fields in the class
mouse over them. your ide will tell you
the error is not related to those underlines
yes
Location has a field of type WeakReference<World>
and that is not really accessible through reflection to any module
oh mb i misunderstood
lmao
Are you trying to json something
would firmly recommend not using spigot's config API btw
What did it do to you
not at all
It was a pain to write
but it works very well
mye fair
i have my qualms with my own implementation but
What kind of task should I use for something like applying an arrow trail?
I need a quick explanation sheet every time I need one of these lol
to be honest with you, arrow trails are really annoying because of the tick limit
what fix would you recommend tho?
As in a limit for how many times a task can fire?
very spotty
well what r u trying todo
Meh
server updates 20 times per second
You can always do some vector math to max em more dense
most likely u gonna have to write a custom type adapter for Location
i need to store position of place
that's what I do yes
I know
how are you even serializing this
gson
that's why
I thought you meant it could only run a certain amount of times total or something
You would just need whatever gravity vector minecraft uses
you need to write a custom serialization adapter
then what should i use bruh
gson is a pain in the ass imo
most likely u gonna have to write a custom type adapter for Location
aint using jackson tho
Best api is the one you don't have to make adapters for
no?
take it from someone who wrote a bigass jackson-spigot integration, including a user-"friendly" way of easily creating serialization type adapters
doesn't really exist, you need to define serialization behavior for stuff somehow
tbh I havent ever seen any orm like lib providing adapters for WeakReference and SoftReference (and PhantomReference)
Isn't that fairly easy to do tho
depends
never run into these issues with jackson honestly, not saying you should use it
i am saying i don't know why they happen
I guess they're done well?
I mean they might encapsulate a reference queue coll
can i just use World instead of Reference<World>?
in which things become a bit more intricate
yeah Location is the issue here
Yes, but you might have issues
is it that gson can't serialize WeakReference?
You just need an adapter that goes from that -> world name and vice versa
Like memory leaks
yes
so if i serialize the world name?
yes anhwylder
because if so, yeah, you need to write the adapter
and then get it
It tries to with reflection, but fails
You can if you donate to md
💀
bribing him to take my usual username from whoever might have it
Man has to fund spigot somehow :p
I don't want to specify what block I drop
Actually themes in general
we addressed this
Material#getBlock
or isBlock
sorry, it's the latter lmao
I got mine but it was a dead account
an example?
nobody who goes by dewyn is EVER active on anything
Pretty sure it had 0 threads/posts
it's really straightforward, I can't spoonfeed you a literal single method call
What the fuck is a method
Md is understanding, just try
just glad I could snag it on discord lmao
You should ask @worldly ingot how much he loves having to use choco_dev
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
or if it's some hardcoded jvm bs
correct
wrote a quick wrapper, what do you think?
well the parent field T referent in Reference is treated with special care
if gson will eat it, it's fine
no
thats not at all what I meant
you meant serializer for the data class right?
what I mean is that you extend the class TypeAdapter<Location> (its from gson itself)
That's a wrapper, not an adapter
and then u write ur own rule of how serializing and deserializing a Location object should work
Stupid fucking dumb idiot update >:((
what's this abotu usernames
I hope discord loves the change
Hello, how can i use remapped mojang library?
atm i only have this:
implementation "org.spigotmc:spigot:1.18.2-R0.1-SNAPSHOT"
?nms
Since you're using Gradle you'll need to find a plugin that supports remapping
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
for some reason, it only worked after rebuilding the code 3 times but not changing anything, but it works
do you need vanilla recipes?
Yes
declaration: package: org.bukkit, class: Bukkit
declaration: package: org.bukkit, class: Bukkit
not that big
method -> meth-OD -> methamphetamine overdose
average or simple)
sounds like a decently sized plugin?
what a plugin does is usually a better indicator of "size" than the number of dependencies
how can i make a custom item thats an uncraftable splash potion have a white/no color instead of that bright pink/purple
i've been trying to figure it out but i can't seem to get it. can anyone help me?
Can't i use timed tasks with bukkit?
Spigot uses Maven so if you want to use anythign else you are on your own.
alr ty
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...
I belive he also has a more advanced video related to the topic
no this not what i mean
Can you eloborate then?
this tutorial for who not know base knowledge obaut inventory
thenks
oh this better
oh what the @subcommand?
i want it too
oh demm this annotation
this hard use?
this be my first try
?paste
well bc some null object exists in your class?
oh lol
cuz ur tryna cast ur PlayerBase class to a Plugin
What would be the approach instead?
u have both these plugins installed?
this makes little sense
ru shading the api or something
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
so u have 2 seperate plugins
Yes
I already instaciated it
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
Or do you mean i have to instaciate the AfterlifePlayerbase(api) inside my onenable?
are you running the shadowJar task / have the shadow plugin
wouldnt it run automatically when running build?
no
usually you have either the build task or assemble task depend on it
id just do
private static Plugin instance
instance = this in onEnable
public static Plugin getInstance(){
return instance;
}
even though its not best practise either
I already have the getinstance on my api
yea but its using getPlugin for some reason
why not call getPlugin from ur other plugin then
Why cant i use AfterlifePlayerBase.getInstance().getPlayerScoreboard? Both are marked as public static inside my main
public static PlayerScoreboard getPlayerscoreBoard() {
return playerscoreBoard;
}
public static AfterlifePlayerBase getInstance() {
return afterlifePlayerBase;
}```
so ur getting the instance to then call a static method?
that makes no sense
u can also call getPlayerscoreboard directly then
Shouldn't i call the main class when trying to access it from my AfterlifeWaves?
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
you should. but something very weird is going on on ur part not sure tbh. somehow ur AfterlifePlayerBase thinks its AfterlifeWaves
Can I dm you?
sure
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
and you're definitely including this in your packaged .jar, right?
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
Since it's in a jar you need to create a zip file system for your jar
how do I do that?
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
Better option is to use JavaPlugin’s getResource() method instead
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
Isn't there computeIfabsent?
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
its caffeine cache
Ah
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
How can I make a loading screen using shader cores /// for example :
isnt this channel about plugins?
Under the name of "Development" I think it enters
I think appropriate question
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
#help-server for help with plugin configuration and server troubleshooting
#help-development for plugin development and general development help
The man is right
We don't need to argue
🥹
Shaders fall under development though. :p
but how is this related to Spigot/BungeeCord
Thank you, but there is no source, so I just came here.
I think shaders are very difficult
They typically are. I haven't messed with them but I think @echo basalt has.
whomst ping
With "Bungecord" to customize the loading screen when you switch to another world
You've messed with mc shaders before right? Maybe you could help the guy. :p
I don't know shit about setting mc shaders up, but if it's shader code we're talking, I can probably help
thats possible with bungeecord?
I work with HLSL, but GLSL isn't a stretch to translate
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
Try Paths#get
its the same as Path.of
Logically yes, look, for example, I made a custom loading screen, but I want it with pictures:
Well you can use them in a shader pack, but it's more of a no but actually yes
funny
?
oh dear god is it some kind of middleware solution
So, for example, I will take 1 photo and turn it into what and do it with shader core.
You don't use shaders to modify the title screen
You just modify the title screen
Or replace the resources with a resourcepack
With mixins
i mean interesting
Yeah, doesn't make sense to use shaders on the title screen
also Paths.java recommends using Path.of instead
Well it's just a loading screen, so I think you can use just an image
yeah i was stuck on Java 8
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
I found 2 packs that used it, but /// first reosurcepck
"but /// first resourcepack" what
I mean, how can they add these things using shader cores?
First of all, what the hell are shader cores
I want to add it too, but I have found 2 sources so far, there are no others around
I don't know him 😅
I just said what it says but it says they are made with flutter shader
Resource packs support GLSL shaders
Oh right
They're non-standard and always subject to change, but they refer to them as "core shaders"
But they don't replace game textures
A now I get it, so is there an editor or a place to make it on the site?
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
I think that putting snowflakes around means that he is putting a picture, but how?
Those can't change textures, though
Is there something I'm missing like the loading screen is animated?
The snowflakes likely aren't textures. Shaders can draw literally anything you want
