#development
1 messages · Page 93 of 1
The PluginLoader is the only way right?
Or does that even download it into the libraries directory? Isn't that just for the jar
no - you could also do it even before the spigot libraries feature existed
such as by using slimjar
you can choose whatever directory so that it doesn't always download it every time the server starts
you could binary search the plugins
- delete libraries folder
- remove half the plugins
- see if kotlin appears
- if so, bring back half of the remaining removed plugins, and if not, remove half of the current plugins
- repeat
until you narrowed it down to 1 plugin
Yeah I wanted to avoid doing this, but it's probably necessary
wait hold on
why do you care about kotlin being installed 
are you sure this is necessary
Having linkage errors, loader constraint violation
Basically it's a system of plugins where they MUST get the kotlin version from the core, which shades it, but they get it from somewhere else
I'm assuming the libraries from server as it's downloaded there and I've disabled all plugins that shaded kotlin
I'm pretty sure paper has isolated classloaders, and I assume spigot isolates the libraries as well (unless the plugins depend on each other)
if you remove all other plugins, then does the error occur?
Nope, it works when they're the only 2 plugins on the server
Wdym by isolated classloaders?
huh, interesting
I don't have enough knowledge about this stuff to figure out why 🙃
oh wait or maybe a plugin shades it without relocating
Well, it happens because EcoCrates must use the instance of kotlin which is provided by Eco (the core), but it gets it from the server libraries
I've disabled all plugins that shades kotlin, other than Eco
why not just have them all have kotlin in the server libraries?
Looked through all the jars and disabled all with the org.jetbrains.whatever package
kotlin uses the kotlin package
Some of the are premium plugins, which is very annoying
Yeah that's it
I think it's kotlindsl or something but yeah
I found the ones that shaded kotlin and disabled them
I think I'll just have to binary search for the issue and then work from there
And then hope that it's an easy fix
alr yeah for now that'll probably help identify the issue
but I just realized that this is a public plugin 🥲 so just saying "this plugin won't work with x" I feel like shouldn't be the final solution
but finding the problem plugin is a good step to finding the real issue
Yeah, because the plugins do work by themselves, it's when using them with more plugins that's the issue
Yeah probably the best plan
wait then how do EcoCrates get kotlin access
or wait
nevermind
It uses kotlin but doesnt shade it, it requires the instance from eco
mhm
I need someone who is experienced at php to help me add a login system to my litebans interface
50€ and I can do it for you
i dont got that type of cash sadly
help a brother out man
please
its very unlikely that you will find someone to do it for free
time to learn some php it sounds like
php is a very marketable skill you wont regret learning it tbh
ye
any good sources to learn from that you know?
yeah, internet
i dont know php, but in my experience you should not be overly concerned with finding the best source when learning something new
this applies to anything
there is an abundance of information out there nowadays, your job is to pick one and start from there
WHAT IS THIS
This video has been removed for violating YouTube's Terms of Service@stiff cape
I'm using Skript to make "soulbound" items with a specific lore line not drop on death and be returned after respawn. The skript saves and gives the item back correctly — that part works.
The problem is: the item still drops when the player dies.
set {_uuid} to victim's uuid
clear {soulbound.items::%{_uuid}%::*}
loop all items in victim's inventory:
if lore of loop-item contains "&8(&7Soulbound&8)":
add loop-item to {soulbound.items::%{_uuid}%::*}
remove loop-item from victim's inventory
on player respawn:
loop {soulbound.items::%player's uuid%::*}:
give loop-value to player
delete {soulbound.items::%player's uuid%::*}```
can anyone help solve this issue?
Could you fix it for me, I'm confused
set {_uuid} to victim's uuid
clear {soulbound.items::%{_uuid}%::*}
loop all items in victim's inventory:
if lore of loop-item contains "&8(&7Soulbound&8)":
add loop-item to {soulbound.items::%{_uuid}%::*}
remove loop-item from drops
on player respawn:
loop {soulbound.items::%player's uuid%::*}:
give loop-value to player
delete {soulbound.items::%player's uuid%::*}```
Victim is already dead so the item has dropped
so it went into the items dropped method
Ok thank you ill try htis
It still drops
@weary finch
set {_uuid} to victim's uuid
clear {soulbound.items::%{_uuid}%::*}
loop drops:
if lore of loop-item contains "&7Soulbound":
add loop-item to {soulbound.items::%{_uuid}%::*}
remove loop-item from drops
on player respawn:
loop {soulbound.items::%player's uuid%::*}:
give loop-value to player
delete {soulbound.items::%player's uuid%::*}```
Try now @swift portal
Ok, go back to that previous
Any idea on why this doesn't work?
You could ask skript discord
Alright will do thank you!
Unresolved dependency: 'me.clip:placeholderapi🫙2.11.6'
Why, when
<repository>
<id>placeholderapi</id>
<url>https://repo.extendedclip.com/releases/</url>
</repository>
and
<dependency>
<groupId>me.clip</groupId>
<artifactId>placeholderapi</artifactId>
<version>2.11.6</version>
<scope>provided</scope>
</dependency>
@hushed badge@pulsar ferry@dawn viper
@wheat carbon
Same problem — when you go to the repository in browser, it says "Not Found."
Where should Maven find the file when there's nowhere to download it from?
in browser u need the /#/ to view the index, maven will find it from the link above
okay, i downloaded and will add with local lib
Error
I already assign default value to the interface but why there still warning that calling fetch can return null ?
The warning isn’t about the return value of the fetch method but of the getAnnotation call
I guess it‘s not smart enough there to understand the previous if covers that
oh i checked and get annotation is nullable so i guess that is where the warning is
Hello im currently coding and doing a texture pack to go with some custom items that i am making im running it all on 1,21.4 so doing texturepack since the change this is a first and its invisble wonder if anyone cant help https://paste.helpch.at/vabalojago.json and heres how its all laid out https://imgur.com/a/Tjqa6fY
You won't be able to upload images here directly to avoid spam, so please use https://imgur.com/upload or similar service to upload images/screenshots.
Hello everyone,
I'm not sure if this is the correct channel for my question .. please let me know if I should post elsewhere.
I'm trying to disable the highlight for inventory slots, or ideally, make it so that the highlight appears only over the item itself within the slot (see this example: https://gyazo.com/8c0f6208a12bdda3e8041569a84514af).
I've seen several Minecraft servers implement this, but I haven't figured out how to achieve it. Any guidance would be appreciated!
Are you using https://itemsadder.devs.beer/ ?
Cause that pic is 100% made with ItemsAdder
No Thats a screen shot from a server (not mine) and for my own gui I am not using itemsadder
I'm saying that the server you took the screenshot on is using ItemsAdder
I am using my texture pack with my own plugin that I am developping
That's how those servers are making custom GUIs like that
They're not just changing the texture of the inventory
Oh so the item highlight thing is linked to itemsAdder?
What they do is that they change the way a font looks for special characters and then they just show those characters
So instead of fx.
$ being $ it would show an image
does that make sense?
Coz I know how to add a custom texture ... it's just that the slot highlight is annoying and ruining the menu I made (ok leme reread what you wrote)
so the menu is actually the inventory title text that is covering the whole inventory
and thats why the highlight isn't shown
since the "image" from the custom font from ItemsAdder is covering it
same way that ItemsAdder can give you custom emojis in chats. It's just a special character that they've changed the font of
This is an example from their docs
smile:
permission: smile
show_in_gui: true
path: "font/emoji/smile.png"
symbol: "鄿"
scale_ratio: 9
y_position: 8
then here the symbol is changed to the image
so the image is shown when you type the symbol in chat or show it in the tablist etc
as the font itself is changed
They change it with a resourcepack tho, so you could technically do it yourself
I know how to add custom textured Items and the texture for the gui. All I'm struggling with right now is the hover animation on an inventory slot that is limited only to the borders of the item's texture. And not the whole item slot.
here is another example of me hovering the sorting button https://gyazo.com/ab326625ccff48e0fa76b69f9af8be06
Imagine you have a font, and you wanna change how the letter A looks
now imagine that you put a picture on that A instead of a normal bitmap font looking A
Now imagine if you scale that image so it's way bigger than what the A originally was
Now you got a font with an A that looks like an image, and this way you can cover the whole menu with just a symbol
the image you sent is the exact same. Here I'm just guessing that they're ofc still putting a ui over the inventory so that the vanilla highlight is being covered, and then they just put an item in the menu with that texture and move the item around
Notice how big the gap is from the coin and up to the "infinibag"
that's cause the top row of the inventory is in between
Damn okay I am not sure I understood you fully. I don't know how I'll be able to implement that in my own plugin + texturepack without relying on itemsadder
It's not the easiest thing no
Does anyone have experience with/know if its possible to have custom models (something like ModelEngine) appear on bedrock with geysermc?
not me
Hi
When trying to use Protoweaver in my paper backend server, I get this error here: https://paste.helpch.at/ajeyoxofoh.php
Does it look like it would be an issue with the plugin itself, or could it be something with my docker containers?
Just by a quick glance
i tried investigating, and when looking into https://maven-central.storage-download.googleapis.com/maven2, it does give an error
So could it be that the dependency's repository has been moved?
Can we see how you are importing the maven in your gradle?
It's not my plugin, and the issue is with a library of that plugin
The issue is with what you said. If you try to go to https://repo1.maven.org/maven2/org/bouncycastle/bcpkix-jdk18on/1.81/ - it posts. However if you go to https://maven-central.storage-download.googleapis.com/maven2/org/bouncycastle/bcpkix-jdk18on/1.81/ it does not
No such object: maven-central/maven2/org/bouncycastle/bcpkix-jdk18on/1.81/
I don't understand what I am meant to be doing then, I'm sorry
What version and what platform are you using?
Paper, 1.21.7
Im going to import the project on my intellij and see if any issues arise
Yeah I have been trying to do that too
There isn't any issues whatsoever though
From what I can tell
I've been at it for two hours, if you find anything lmk
Did you try building it? it might be an issue with his maven
same error?
Nope, no error whatsoever when building
No I mean when running the build
Oh, yeah it's the same errors still
Ah, Its a paper issue
Simple issue is to require the libraries but import from the jar
What do you mean? Like, have the .jar in the plugins folder?
No
What do you mean then?
Nvm, I found the library
bouncy_version=1.81
papermc is on 1.75
change that to 1.75
and well his is uhhh blank
so it wont work even with the fix
https://repo1.maven.org/maven2/me/mrnavastar/r/1.0.9/
as you can see paper hasn't added his repo correctly
Are you saying to rebuild it changing the version to 1.75?
in plugin.yml and gradle.properties, Change it to 1.75
Like I said, That wont fix it though because his repo on paper does not include his library
as you see here, Its only the pom.xml
Right, so I should just wait for him to fix it then? :/
at org.eclipse.aether.internal.impl.DefaultArtifactResolver.resolve(DefaultArtifactResolver.java:473) ~[maven-resolver-impl-1.9.18.jar:1.9.18]
at org.eclipse.aether.internal.impl.DefaultArtifactResolver.resolveArtifacts(DefaultArtifactResolver.java:261) ~[maven-resolver-impl-1.9.18.jar:1.9.18]
at org.eclipse.aether.internal.impl.DefaultRepositorySystem.resolveDependencies(DefaultRepositorySystem.java:353) ~[maven-resolver-impl-1.9.18.jar:1.9.18]
at org.bukkit.plugin.java.LibraryLoader.createLoader(LibraryLoader.java:112) ~[paper-api-1.21.7-R0.1-SNAPSHOT.jar:?]
at io.papermc.paper.plugin.provider.type.spigot.SpigotPluginProvider.createInstance(SpigotPluginProvider.java:125) ~[paper-1.21.7.jar:1.21.7-26-533d93c]
... 9 more
Caused by: org.eclipse.aether.transfer.ArtifactNotFoundException: Could not find artifact me.mrnavastar:r:jar:1.0.9 in central (https://maven-central.storage-download.googleapis.com/maven2)
at org.eclipse.aether.connector.basic.ArtifactTransportListener.transferFailed(ArtifactTransportListener.java:42) ~[maven-resolver-connector-basic-1.9.18.jar:1.9.18]
at org.eclipse.aether.connector.basic.BasicRepositoryConnector$TaskRunner.run(BasicRepositoryConnector.java:417) ~[maven-resolver-connector-basic-1.9.18.jar:1.9.18]
at org.eclipse.aether.util.concurrency.RunnableErrorForwarder.lambda$wrap$0(RunnableErrorForwarder.java:66) ~[maven-resolver-util-1.9.18.jar:1.9.18]
at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1144) ~[?:?]
at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:642) ~[?:?]
... 1 more```
See, I fixed the bouncycastle thing and now it says that
It might be a paper issue
Im trying one more thing @dense galleon
Okay thank you so much I really appreciate it
The plugin is online, does it work? No idea
thats up to you!
modifications to make:
plugin.yml - In Paper
author: MrNavaStar
version: 'debug-build'
main: me.mrnavastar.protoweaver.loader.Paper
api-version: '1.13'
load: STARTUP
libraries:
- org.apache.fury:fury-core:0.10.3
- io.netty:netty-codec-http:4.1.97.Final
- io.netty:netty-codec-http2:4.1.97.Final
- org.bouncycastle:bcpkix-jdk18on:1.75```
gradle.properties:
`bouncy_version=1.75`
build.gradle:
``` repositories {
maven { url "https://repo1.maven.org/maven2" }
mavenCentral()
maven { url "https://maven.minecraftforge.net/" } // Forge
maven { url "https://repo.papermc.io/repository/maven-public/" } // Paper + Velocity
maven { url "https://api.modrinth.com/maven/" } // Modrinth
}```
@dense galleon
ah nevermind, Wont work. needs a custom class loader
I had to do a massive work around
Api version 1.13??
You really working hard on this im really thankful
You don't have to keep going it's okay
hey guys i need some help im trying to make a custom token enchantment system when i click on the enchantment in the menu it doesnt actually give me the enchantment and it doesnt pull the token from my inventory
Post the code
level_1:
display_name: "&aLevel 1"
material: hdb-2492
slot: 10
lore:
- "&7Requirement: 30 mins"
- "&eStatus: %playtimerewardsplus_level_1_status%"
click_commands:
- '[player] playtimerewardsplus claim 1'
this is the code i have been using to create a deluxmenu and i assigned a headdatabase head to it idk why its not showing in the menu
can someone help ?
Hello ! Is it possible to find the source of DeluxeMenus 1.13.6 please?
1.8.8
1.12.2
1.13.2
1.16.5
1.20.2
v1.10.5
v1.13.7
v1.14.0 - Latest
v1.14.0 - Latest
v1.14.0 - Latest
do you have headdatabase installed?
id assume to use that you gotta have it installed
Ik ofc it is installed
does console say anything when the menu loads?
Nuh ntg
Everything is normal in console
do any1 of you have bitcoin mining programs to mine ? or any people actually mining ?
I’m still a beginner Java coder but is passing the main plugin instance as static as bad as people make it out to be?
Don't do it it's going to create a supermassive black hole in the center of the planet
i dont recommend this to u have much other options as getting it in a static way
general "issues" with static/Singleton patterns
but tbh like
it doesn't really matter
it's literally against best practice to reload the server anyway or to mess with plugins being disabled at runtime
which is when this would cause an issue anyway
like I wouldn't really necessarily say any of these apply to JavaPlugin instance
you already don't have control over its lifetime
If I have 5 plugins that all depend on a Core plugin, and all five of those also require TriumphCMD, am I better off shadowing it in my core plugin's API jar or shadowing it in each plugin?
I guess you could try to shadow it, some plugins cause massive JAR sizes when shadowed, for me when I shadowed PacketEvents into a core, the jar was 4MB when standalone its like 240kB. I'm not as experienced as a lot of people here, but personally I don't like it cause as I said it causes massive jar size increases
look at shadow documentation
you can exclude everything you don't need
and you can legit js unzip jar files to see what got included if you're not sure
don't even need decompilation
Does anyone know if BaseCommand has been removed from triumphcmd in 2.0.0-BETA-3?
how much extra work is it though? as ive said I am no expert still learning so tips are welcome 😄
google it
What is the way to register a simple %example%?
(I have the placeholderAPI 2.10.9 dependency LATEST)
it's something i try to avoid
sometimes you need a Plugin instance but you should always try to avoid needing your plugin class
3500 lines so far and zero dependencies on my JavaPlugin instance
- 2.10.9 is not latest version of PlaceholderAPI.
- You can find documentation on how to create a placeholder, right here: https://wiki.placeholderapi.com/developers/creating-a-placeholderexpansion/
thanks
why
is there like a concrete reason
don't just throw SOLID at me 😭 cause that shit controversial
Well because of the reasons you mentioned for one thing
how do any of these apply here
It’s really easy for your plugin class to end up being a god object which is inherently bad design
#1 and #2 I don't think apply to the literal Java plugin instance
Especially when trying to do automated testing
what do you need to get exposed that's different with automated testing
like what do people use that for
well if you avoid needing an instance of your plugin then you don’t have to worry about getting an instance in a testing environment
also @icy shadow do you never use Kotlin Objects then (if you write Kotlin)
I try to avoid it where possible
well I mean
I actually don't get this
why does that change with static vs. passed plugin instance
you can't easily provide a test double if its static
this is the issue in that scenario that I see
hm?
I mean that this is only an issue if you're hardcoding numbers in the first place
like again I'm still kinda missing a concrete reason for not having just a static plugin instance
like the whole point of statics is they exist once throughout the lifetime of your application
this is something that other things shouldn't really be touching in bukkit in the first place
I read someone mentioning that if you don't do that then it's easier for GC to clean it on reload, but looking at the actual data, that object is usually tiny
I think kotlin objects are different though because they’re kind of a separate thing entirely, compared to a singleton class with funky initialisation logic that literally can’t exist in some environments
kotlin object is in practice just a Singleton
i don't know if their logic is actually different?
like for example this is independent of whether plugin instance is static or not
Ideally you shouldn’t need a plugin instance at all
But constructors are almost always better than static access because they make the graph of dependencies much more obvious. Suppose you’re running a unit test on some class which statically accesses the plugin. Your test fails at runtime (maybe not consistently) because the plugin static is null because you’re not running it in a bukkit environment. Compare that to if it was needed in the constructor: clear, obvious, compile-time error because it needs a plugin instance
this is fair
well I mean in this case though
the only difference is you waste time testing something incorrectly
cause you're using that instance there either way
but
Ohh
no I see your point
again, you should avoid needing a plugin instance as much as possible
In cases where you do need it then you should inject it because then you can mock it etc for testing, or provide a different implementation for different platforms
I don't get what you mean by "different platforms"
why would plugin instance differ between those
Other server platforms
You can make one codebase compatible with forge and spigot and bungee and whatever else
test doubles as in mocks
or stubs
yeah
don't have it hard-coded anyway
or just... vary the object that provides those numbers
this and testing is actually a very compelling reason, you abstract over Bukkit in all your code as well?
cause then this is like
if we're telling people not to use static plugin instances, tell them to abstract over Bukkit as well
Yeah you should try to do that too although it’s often harder
Making a fully platform agnostic implementation is a big task don’t get me wrong
It’s not always worth the effort
Doing proper inversion of control to avoid referencing a static variable is much simpler than abstracting away all the server logic, so it’s more digestible advice to give
1 sec
yeah but in practice when most people aren't running an external testing suite nor multiple platforms, it's not a hugeee deal
Ngl I kinda realized this before but was too lazy to fix it 😭
But maybe now that you mentioned it as well, it's time to fix my habit...
it's really easy to keep doing forward
cause J's... initialize the constructors
but lwk like
kotlin objects are really cool twin 😭
and having a lateinit field seems sketchy cause it's not enforced by compiler
well technically that's the case anyway
I can't remember the last time I used lateinit
I js have lateinit plugin instance in companion object of main class
I don't actually know why I do that
I don't remember
I don't think JavaPlugin can be object?
You could simplify it a bit with JavaPlugin.getPlugin
Or avoid it entirely 🤩
probably yeah
Yeah it can't
is there a performance cost on this
On startup? No
ah yeah you right
I wonder if this works consistently in Kotlin object
it should right?
Wdym
in an object can you have like val instance = JavaPlugin.get....
I don't remember when initialization there is exactly
Although you might have to make it lazy
What about things like the Logger
I was thinking this
but actually still like
Val instance by lazy { Java Plugin. GetPlugin(My Plugin::Class.java)} ignore formatting I'm on phone
but there's no difference between this and static
If you only need plugin instance for the logger, does it not make sense to make it static
Well yeah
there's still no abstraction
It just makes your static code a bit nicer
it's completely identical
That's why I said you could alternatively not use static
like tbh the only good argument here so far is when you have platform independency
yeah but what's the difference there still except for what I just mentioned
like this makes perfect sense to me
Difference between the code I put or not using static?
Bm already explained basically what I would say ig (altho I really just quickly skimmed the convo)
And I'm on phone
But I guess it's also about building a good habit for when you do other things other than create plugins
Sure, bukkit makes it kinda unneeded in some ways
But I assume you're going to code on other stuff other than bukkit someday
latter is actually a very fair point yeah
it's good practice ig
but I'ma still say it's definitely not the biggest sin new devs commit
I remember someone being cautious about putting an if statement in a tick loop cause they thought it was too performance intensive 😭
Oh boy
Premature optimization...
lwk the root of all evil
I still think it’s a good habit to get into
that's fair
Even if it doesn’t do MUCH practical difference it teaches you how to do it right
Does anyone knows ow to achieve this : https://gyazo.com/cb9091db5e8a6542a55c623e05e0aa3c
Hovering over a model gives you this item tool tip and if you click on it you get the gui to buy it
resourcepack to show tooltip via title text / actionbar / bossbar
raycast to see when player looking at furniture / clicking on it
Has anyone ever encountered deluxemenus not registering menus that exist within the gui_menus folder?
for example, i have a menu called "scene_townsfolk_cook_edit.yml", but when i'm in game and type, "/dm open scene_townsfolk_cook_edit", it tells me that the menu does not exist
Did you register the menu in the config.yml?
Does anyone know how I can make my server for usa,europe,asia. I think I need 1usa,1europe,1asia proxies and I need to connect them to my lifesteal server with one domain
Why bother? I dont think you will actually get any latency benefit
itll just show better ping in the server browser, but ingame ull still have the ping that comes from the actual paper server
I thought it would help because I wanted to be like this server but thanks for the information
Well yea ull connect to the proxy faster, but the connection still has to travel to the real server
so it just gives the illusion of better ping
I dont think theres an actual way to reduce ping, cause speed of light, only way to improve ping is to get a better route to the client, you could set up a proxy near the client and hope that ur proxy recieves better routing than the client, but will that be the case, doubt it.
if im wrong id be glad to know
multiproxy is only really helpful for, like, minigames or skyblock, where you can actually run a proxy and servers in the region, so you'd have minigame/skyblock servers in NA, EU, Asia, and a proxy in each region that connects to their regional servers
anything like a SMP, Factions, Towny, roleplay, where you'd want one server for everyone to share is kinda out of the question unless you want to have different SMP/Factions/etc servers per region as well but that stinks
Im not really sure how proxies behave under the hood but ive heard that after the initial connection, you are just connected straight to the actual server and data gets sent directly to it, or do all the packets still get passed thru the proxy?
no, you are still connected to the proxy
unless you are transferred, but that only works for semi-modern clients, idk when the transfer packet was introduced exactly
neither the transfer packet nor a proxy are a replacement for each other, they are both useful to what they do, and can work in conjunction
Fair makes sense
Hey yall is there a way to set items in the player's inventory using https://github.com/DevNatan/inventory-framework ?
I get an out of bounds error since it tries to set it in the main inventory
Does anyone know the @SuppressWarnings name for Unsubstituted expression warning when using @Pattern?
does it not show up in like the quick actions?
No it doesn't
it should, but alternatively you can @Subst("example string matching pattern") the variable or whatever
does the second response help? https://intellij-support.jetbrains.com/hc/en-us/community/posts/206313549-What-Does-PrintFormat-Unsubstituted-expression-Mean
Hi,I'm seeing an inspection warning that says only "Unsubstituted expression" on a parameter to a method call. It appears this is related to the use of the IntelliLang @PrintFormat annotation on th...
looks like it's a non compile-time constant expression that it can't analyze
Yeah I'm using Adventure Keys and I'm storing / reading the string value which is what causes the issue
I'd rather not turn off the inspection completely, but I also haven't been able to find a name for the suppress warnings
Yeah it just feels weird doing that because it would just be a completely random string lol, but if I have to I'll just do @Subst(suppresswarning")
out of curiosity, what's the code that's creating this warning?
since I feel like you should use a valid example value instead of "suppresswarning" 🥲
woah wait @Pattern is pretty cool
didn't know this existed
wait it doesn't work :(
oh nevermind it just doesn't work in kotlin :(
This is an example
public void loadSomeData() {
String keyString = getStringFromDatabase("some_key");
Key key = Key.key(keyString);
}
ohh
yeah just slap a @Subst("some_key") on the variable
u can suppress any editor warnings like this
or u can disable it from flagging non constant values which is what i did
u r a bad inspection
☹️
generally there is a reason why people use the pattern annotation
still it would make more sense to carry over the pattern to the source whenever possible
Oh thank you, I thought that the option appeared on its own, I didn't realize it could be done that way
Yeah it's just nice being able to suppress it in some cases, like loading a string from a database that you know has the correct pattern, but there is no way for the code to know that
depends on the context imo
its fine with adventure cuz it @KeyPattern annotations are easy to use
but sometimes its annoying like if its not a parameter
It's also really aggressive about how many warnings it gives, like sometimes it warns on 5 separate lines for one method call
wasn't there a gradle plugin for paper that allows to start a test server or I remember wrong?
nvm found it https://github.com/jpenilla/run-task/tree/master
Hey, how can I use text colors in deluxemenus config, for displaynames, lore, etc? I want to be able to use any color in hex or rbg or any other format
probably just minimessage format, like most of the plugins nowadays
Hi, I'd like to know how to buy and sell custom items with Deluxe Menus. Could someone tell me how to do it? Thanks. ^^
most of the times ud just take money and use the plugins give command for that item
What I'm really looking for is that some custom items are necessary to be able to execute a teleportation command, for example.
you want deluxemenus to create custom items for you?
That you need 3 custom coins to enter a dungeon for example
3 custom coins created with mythicmobs
thats a fun one
But I don't know if there is any click requirement in deluxemenus that includes those custom items.
You can use the CheckItem-Expansion for a good enough way to check
and i assume u wanna remove the coins too, not really sure how to go about that
Of course, that's exactly what I want
Same as with vanilla items, but they must be custom, if someone could give me an example I would be very grateful. 😊
yea not sure, you can try writing a minecraft:clear cmd with the data for those items only
but its all kinda messy
ideally ud have a plugin providing a placeholder for the item amounts and removing
but maybe im wrong
¯_(ツ)_/¯
Well, thanks anyway for responding.
I've tried that format, its not working tho :/
Does anyone here have experience working with core shaders? I'm currently trying to modify my hotbar away from the vanilla standards
join Shader Labs discord
it's googlable
hello
Bat bat = (Bat) world.spawnEntity(location, EntityType.BAT);
bat.setAI(false);
bat.setGlowing(true);
bat.setInvulnerable(true);
bat.setPersistent(true);
bat.setRemoveWhenFarAway(false);
return bat;
}``` when i spawn the bat its falling through blocks because its in the "hanging state" how can i make it actually fly in place?
I believe there's a setAwake method you can use
right im an idiot thanks
XD
Currently working on a treecapitator imitation plugin, its working mostly but its giving kinda spotty results of the max amount of blocks its actually broken, currently got what feels like a bandaid fix by double checking the locations to make sure they arent trying to rebreak an already broken location.
basically my code that generates the next blocks to check and then break seems to be giving alot of duplicate coordinates and im not sure if theres something i can do to make it not have those duplicates
i was original using a List<Location> to store the points. switched to a Set<Location> to make the locations not be applied for whats already in the list but it was doing the same thing, so i tried using a Triplet of the x y and z coordinate but it also gave the same result of around 29-32 blocks broken even tho my max block break cap is 35.
mainly wondering if theres a better way to do this or where my code is flawed and giving these duplicate coordinate locations
the idea of my logic is to take a block location, check 1 block around it so 26 possible coordinates, add any coordinates that match that block type to a list, break the original block and then repeat till either it runs out of blocks to check since there isnt enough connected or hits a max block break cap of 35 blocks, tho the max cap is dynamic. i have noticed that theres alot of duplicate blocks being checked and wasnt sure if there was a better way to do it so that it only checks the block's location once
im mainly wanting to filter them just for the fact that it might be laggy to check the block's data for ones that are already air but im probs doing it at such a small scale that its a nonissue
if you're getting duplicate coordinate locations in a Set, use a record instead of a Triplet
your overall approach is fine
js standard iterative BFS
i don't know java Triplet specifics tbh but i js suspect they don't override the hashCode() and isEquals() functions properly, record should do that
is looping every player every 1 tick and getting values from cache is better than per-player runnable that is every 1tick? like 100 runnables (1 per player) vs 1 runnable that loops all players?
i am making a speedrun timer
the single runnable with player loop is checking if player isSpeedrunning()
the per-player doesnt do that
its cancelled immediately on onFinish
literally everything, it's the kind of question that isnt really a yes/no answer
java performance is difficult to reason about like that
best thing to do is try both and benchmark
Side note, but do you need to update the action bar every tick?
Yes, i need to show the miliseconds
smothly
@Override
public void run() {
Bukkit.getOnlinePlayers().forEach(player -> {
Arena arena = ArenaManager.getArenaByPlayer(player);
if(arena != null && arena.isStarted) {
long czas = System.currentTimeMillis()-arena.startTime;
player.sendActionBar(ChatUtil.fix(getConfig().getString("messages.timerActionbar").replace("{time}", TimeUtil.formatTime(time))));
}*/
}
});
}
}.runTaskTimer(this, 3L, 2L);```
it looks like that
yeah it still depends
.
i originally had a List<Locations>, changed it to a Set<Location>, which i thought would stop the duplicates, but it didnt so i tried a Set<Triplet> instead, same thing still had duplicates, i even decided to try manually looping through the set to check for duplicates and still wouldnt get the correct result. so im assuming more then likely its adding to the hashset block locations that no longer have logs in them, which would explain why my check to see if the block is a log or not does actually allow my code to do the full maxblock cap of 35 rather then what it was doing before of 29-32 blocks
also glad to know that im actually be doing it in a good way
ill check out records and see if that stops the duplicates
something else that ive just thought of is that at the end of the loop through the original list of locations, perhaps when im doing getBlock#setType(Material.AIR) its not being processed till the next tick, which means later on if i have multiple block locations having their 1 block radius around them being checked its picking up the blocks that have been queued to change to a different material but havent actually changed yet, another thing that would explain why its having air blocks being picked up since when they were checked they would be a wood log before the next tick which updates them to being air
ill try making another list to check through thatll contain block locations that have been modified already through my code but might not have had their block material updated yet and to skip if that location is the same
Can anyone know how can i makkke a toggle menu example if I click on A example item suppose Stone it convert into end stone and it lore change to hello and if I click again it return backk to stone and lore change to hi and I need thhis in 1 menu
i tried deleting the world folder to reset stats.yml but it didnt work
what should i do
I try to update an old project and I get this error when I compile:
C:/Users/dumit/.gradle/caches/modules-2/files-2.1/org.jetbrains/annotations/26.0.2/c7ce3cdeda3d18909368dfe5977332dfad326c6d/annotations-26.0.2.jar!/META-INF/annotations.kotlin_module: Module was compiled with an incompatible version of Kotlin. The binary version of its metadata is 1.9.0, expected version is 1.6.0.
I've updated adventure-api to latest version and it comes with org.jetbrains:annotations:26.0.0 and excluding it doesn't do anything
implementation("net.kyori:adventure-api:$adventureVersion") {
exclude group: "org.jetbrains", module: "annotations"
}
implementation("net.kyori:adventure-platform-bukkit:$adventurePlatformVersion") {
exclude group: "org.jetbrains", module: "annotations"
}
implementation("net.kyori:adventure-text-minimessage:$adventureVersion") {
exclude group: "org.jetbrains", module: "annotations"
}
I know I could update to kotlin 1.9.0 but I don't really want to bother
Dude Kotlin is already on 2.2.0 and you don't even want to update it to 1.9.0 :')
:(((((
it was supposed to be a quick library update to support 1.21.x
fine, I will do it :((
I feel like kotlin v2 doesn't really have many breaking changes though
or at least I haven't run into any that I remember
except for android
so im trying to import the foundation library but there is a plugin that is supposed to stop it from shading all the libaries but i cant get it to work. https://paste.helpch.at/vucininohe.xml
Does anyone know what i did wrong?
😕
hello, the idea of making an homes plugins and a team plugins came to my mind but i don't want to make both in the same .jar i want to make them work one alone of the other but i would love to integrate some stuff of one to the other for example the homes one i want to integrate an item in the gui of the homes that it's the team home how can i make the 2 communicate? (Sorry if it's a stupid question but I'm really new to creating API or whatever can make them communicate)
i fixed one thing but its still broken. https://paste.helpch.at/eledowikiw.xml
you mistyped github as gethub
oh
i fixed that but the file is still massive
can you send your new pom.xml and also open up your jar file with any unzip program (you might have to rename .jar to .zip first) - what do you see?
seems to work fine for me
make sure you're running mvn clean package
if that still doesn't work, try to create a folder and put only the pom.xml in there (that's how I tested it)
then, that should work
you can then slowly add in files until you locate the problem
https://github.com/sspacepro/test i created a blank project pasted the pom.xml and it still does not work?
https://i.imgur.com/nIT4Hh4.png
this is what I see
but you see all the other files in target/test-1.0.0-Alpha.jar?
from mvn clean package
is that the same as running clean in lifecycle?
intellij?
ya
press ctrl twice and type mvn clean package
how big is your jar file
from the test project
Ok so not i get that in the target folder do i just always use that instead of the file in the out folder or what do i do with the cleaned file in target
no you never use the out folder
iirc the original file in the target folder is without any shading
and the other file is with shading - this is the one you want to use
and the out folder I believe is generated by IntelliJ's own build tool instead of maven
yo thx your an absolute legend I have been trying to get this to work for days.
np
this isn't the first time I've seen this happen, but it's been a while so I didn't think of it - whoops 🥲
but it's good that it's all fixed now 👍
chat-format: "&f{prefix}{player_name}{deluxetags_tag}: &f{message}"
Why deluxetags_tag dont work?
What chat plugin
yo sup everyone, does anyone havbe any idea how to make a plugin that recreates hypixel skyblocks breaking speed for mining
If you’re using one of the latest versions you can set the players block break speed attribute to zero and send the block damage packet yourself
Otherwise you do the same thing but instead give the player mining fatigue -1
^
Hey is it possible to enable player inventory clicks while a DeluxeMenu GUI is opened?
No.
I have a .sh file I'm running with an intellji configuration, but whenever intellji runs the file it's unable to run java commands, anyone know why?
I'm able to run it fine in terminal
what does it say
bro isn't PATHing correctly
gotta learn somehow
line 1: java command not found
works fine in terminal and normal shell code works but java doesnt work when intellji runs it
yeah no it's probably a PATH issue tbh
any suggestions before I google very intensely
i mean step 1 would be to just echo $PATH in the beginning of the script
and see what it has
but you might just need to do an absolute path for the java installation
like /usr/bin/javac or whatever
add java to path
are there any libraries for making inventories, that you guys would recommend?
both TriumphTeam/triumph-gui and stefvanschie/IF are pretty popular
will have a look, thanks
do you guys offer support for custom model data texturepacks (for 1.21.4+)
What plugin(s)?
DeluxeMenus does
no plugins, just raw texturing
and custom model data based textures
Oh, I haven't dove into that.
I am getting this error even when PAPI is loading correctly java.lang.NoClassDefFoundError: me/clip/placeholderapi/expansion/PlaceholderExpansion
its softdepended and no error in pom file
[PlaceholderAPI] Enabling PlaceholderAPI v2.11.6 [20:26:19 INFO]: [PlaceholderAPI] Fetching available expansion information...
Have a load before in you plugin.yml
it will load my plugin before PAPI
I don't think that's ideal
No... load-before: PlaceholderAPI will load PlaceholderAPI before yours
Oh oops
hello can anyone help me to setup my costum GUI with itemadder and dulexmenu
is like PNG files not yml
how is every1
I'm doing great, how are you? Although this is a weird channel to ask that
I'm good :D i wanted to see what fellow devs where up to
just working on some of my open source plugins
oh nice, what one are you working on currently? Or do you prefer to bounce between projects?
well, im bouncing around between my commission, my open source stuff and the stuff i use for my own network XD
makes sense
I decided its a good idea to update some of my public plugins as I kinda havnt touched them in a few weeks
i find the things I'm always motivated to work on are the things I want to use
you should give them readmes
thats why alot of my open source stuff i use for my own network
yep, best source of inspiration
no idea if i have them or not
I am the type of person to use very few public plugins and code everything myself for the most part (with my team aswell) there are certain things i will use as im happy with the quality like luckperms for one, fawe worldguard but things like essentials i have fully custom done
same lol
https://github.com/CoPokBl/EsTools
i just noticed how messy my github was
im cleaning that up now
i was posting on my spigotMC
how do you do that Bstats things
with the interactive graph
DO NOT CONTRIBUTE CODE WITH JAVA 9+ FEATURES
Stuck in 2014 
wdym
well the plugin supports every major Minecraft release ever
so java 8 it is
it's just bstats
ahh
wheres the docs i might just be blind
bStats collects data for plugin authors. Get started now!
okay im just blind
but who is benefitting from that?
I'd be extremely unhappy if I had to touch java 8

someone using something different to you must be very hard to deal with
java 21 is just better please no java 8 😭
21 is a more fun number than 8 even though i do love 8 im around it too much
21 definitely has nice features
and makes java way better
but the point of EsTools is maximum compatibility
I don't see any point in that, but sounds like a very fun project for you
Idea
Minimum compatibility plugin
Almost impossible to use
With the users setups
that sounds like something SirYwell would love to make
and then it could get major breaking changes every week
stop talking shit
We generally try to keep compatibility as long as the maintenance burden isn't too high and as long as there are actually people using a version
Otherwise we wouldn't target Java 17/21 :)
oh look java 25, ||~~ gonna took another 100 year for it to power 3 billion devices~~||
wait until you find out that it never actually ran on 3 billion devices
today maybe but not back then when that install screen was made
If anyone is looking for a project:
The developer of the legendary MyPet plugin (a very unique and old plugin for pets) seems to have become inactive.
If anyone wants to help with updating it, feel free to reach out on the MyPet Discord to “haeherfeder”.
okay scurok
okay Emily
okay ixume
now i look scitzo
aren't you?
😔
Best way to remove "temporary" blocks placed when server restart? (locations are stored in a map)
loop and remove 🧌
yeah I just remove them in onDisable
Issue is that when doing that in onDisable as i remember it didnt save it correctly and when forced world save it caused light issues, can you confirm it works as intended? 
at least last time i tested it was like that
hmm it worked fine the last time I tried. but its been a while so not sure. The only issue with that is if the server force crashes, your onDisable method won't get called.
just save it to disk continuously and check it again on startup
or have a command for it
What are the temporary blocks? You might be able to get away with just sending the blocks as packets depending on what you need the blocks for.
something like ixume said, you could save them in a persistent state, such as a file, and then delete them in onEnable instead
this way you avoid it not working when your server crashes too.
Blocks that players can place and interact with them as real blocks (for minigame like ffa)
Maybe a yaml file? 
If it’s a mini game, you could just not save the world
It's for a ffa, not an skywars and I was trying to avoid that tbh xd
I mean, the map is meant to be ephemeral, no? then not saving (or having a template world you copy over and load the copy on each start) is what makes sense the most
Hi, you can add a command to reset the metadata specific to all players, like the remove command, msi with an all in the player args
Thanks if you think about doing it, I don't have time to modify the source code myself !
lmfao
java.lang.NoClassDefFoundError: me/clip/placeholderapi/expansion/PlaceholderExpansion
why is this happening on my plugin
PAPI is loading fine
add papi into plugins folder
and I have correct dependency
[23:52:13 INFO]: [PlaceholderAPI] Enabling PlaceholderAPI v2.11.6
[23:52:13 INFO]: [PlaceholderAPI] Placeholder expansion registration initializing... [23:52:13 INFO]: 0 placeholder hook(s) registered!
everything seems fine in my project
did you add placeholderapi as a depend in your plugin.yml/paper-plugin.yml ?
softdepend: PlaceholderAPI
don't you need to specify it in array format
name: ExamplePlugin
version: 1.0
author: author
main: your.main.path.Here
softdepend: ["PlaceholderAPI"] #
did you shade and relocate PAPI in your jar?
Dms
Struggling to understand the concept of callbacks with CompletableFutures
I've been reading articles left and right to no avail
for a CompletableFuture "cf1":
cf1.thenApply(fn).thenAccept(csc).thenRun(run)
^ what will that pipeline actually do?
it's probably better with a more realistic example than just cf1, fn, csc, and run
you can js ask AI for simple stuff like this
I did.
what is the issue
CompletableFuture.supplyAsync(() -> "oop sucks")
.thenApply(string -> "wisdom: " + string) // "oop sucks" -> "wisdom: oop sucks"
.thenAccept(string -> System.out.println(string)) // prints "wisdom: oop sucks"
.thenRun(() -> System.out.println("completed")); // runs and prints "completed"
you are basically "scheduling" tasks for when the future completes with a result, the thenApply will prepend the string "wisdom: " to the resulting string once the first future completes, then it will take that transformed result and print it, once that completes it will run the final runnable
I mean this makes sense at a surface level, I just don't get whats actually going on under the hood.
why is each thenX method creating a brand new CompletableFuture, and how is the scheduling actually handled?
you should just read the docs
I would have understood if it was returning the same CompletableFuture and it was just popping a stack post-completion
hell, read the source code
you'll get a better explanation and deeper understanding than from others telling you
I didn't show up here not trying to learn it in advance. I'm coming here to ask after exhausting all options you've already suggested me to do
not understanding the documentation means you didn't try hard enough to understand it
do you have something to contribute or are you just here to ridicule
to put it bluntly, it just stores your function/runnable/etc in a list of "run after this completes"
it returns a new one because you might be changing the type of the future (e.g. Future<String> to Future<Integer>), for that you need a new object, and so you can attach multiple callbacks to one future without affecting the result others take; if you are performing more work asynchronously then the first future will complete first, but the second future will complete after that other work is done, etc
I think you're taking a bad approach to learning
thanks for the unsolicited observation, now let me actually respond to/read from the person here whos actually trying to help me
struggle in learning is fine, and this is something that has abundant resources online about it
and what do you do when it's something more niche and there are fewer resources on whatever you're learning
do you really think you are being helpful in saying "go read the source code" "you'll get a better explanation than what others are telling you" "you're taking a bad approach at learning"
I could have been nicer yeah that's my bad
but if the sentiment makes him less likely to ask others for help and instead try to figure it out himself in the future then that's a good thing I think
almost anyone can learn almost anything
in a 1st world country
programming is especially one thing which has an abundance of places to do that
also, if since wanted to know what's under the hood, were you gonna explain the whole pipeline to him?
like this genuinely is the type of thing that is better googled
if the sentiment makes him less likely to ask others for help [...] then that's a good thing
i...
sure
whatever makes you sleep at night
I feel like I backed up what I said pretty reasonably 😭
I don't think asking others for help on things that have better resources should be done
yes it can sometimes be more efficient
but as soon as you're asking someone to write paragraphs for you, especially on this, it's likely you'll find a better resource online
like if I asked in chat "how does the network protocol work? like behind the scenes"
i don't think there's anything wrong with asking someone else with a different wording or a little assistance to help clear things up
how did you conclude that I didn't try to figure it out myself first? Why did you immediately assume that I did no due dilligence before asking here?
Also, by your logic this channel is pointless and should be closed
are you not understanding something with the methodology of how completable futures are architected? or with how asynchronous tasks are done in general?
I feel like your initial question was unclear
don't strawman me 😭
I think there's lots of things that are really useful to ask about, often because they are quite domain specific and have less information online
but also a lot of the questions here shouldn't be asked yeah
lots of people simply don't google
there was a conversation here about static plugin references and I learned a good bit there, that was a good discussion for example because it was more complex and domain specific
thats one way to look at things -- "it was useful to me so its relevant"
I don't think youre evil or stupid or something for asking the question
man
I'm like genuinely trying here
you strawmanning me so hard 😭
😭
you never even answered this either
genuinely asking
I think I get what you mean--what I understood when I read an article this morning was that this "list" structure works by every "Completion" instance containing a reference to the future before it (or after it)
So basically, cf1 finishes executing and runs postComplete which will then invoke its Completion instance, which in turn invokes its associated future which in turn invokes its completion instance etc etc.
So basically what happens is when you do thenX on an existing future, and assume the initial task has finished already:
-
you are setting its
Completionfield to be a new Completion (lets call itthenCompute) which actually has a new CompletableFuture as state -
it then calls postComplete() which will then invoke the Completion instance which will invoke its attached future (either inline or async). This attached future can also have a Completion instance that it invokes etc etc
I'll bite actually, It's incredibly dismissive and unhelpful when someone comes to a place for questions and support, to tell them to go elsewhere and find the support all by themselves and just a worthless contribution, I don't think they're asking for the whole declaration of independence to be explained but if someone can spare the time to explain something in a way someone else is actually able to/more effectively understand, there's no actual issue there
If you really want to push for self sufficient research, give them a vague explanation and provide links to sources for them to research in case they haven't, while also answering the question, even if vague (#development message this wasn't very complicated or longwinded of an explanation and neither was this #development message), Pushing someone away from actually receiving help has a significant longrunning negative impact
300 people a day would come in here asking how to make commands or do whatever with plugins, the solution was never to just tell them to learn java and come back later, It was always give them the answer, while also giving them resources to look into it more
Personally, I can write stuff all day, do circles on people but if i have to sit and read lengthy, in depth documentation, i literally cannot do it, i do not absorb any of the information at all. In reality, You don't know any of the people who are asking for help, nor the ways they learn things the best. Sitting at your chair with drool down your face, crusted on the desk, reading books and source code might work for you. It doesn't work for everybody else
Going back to the CompletableFuture (CF) topic, what I currently understand is that callbacks will actually instantiate and assign a Completion object as a field of the CF instance. After the CF finishes its execution, it calls CF#postComplete which will in turn invoke Completion#tryFire(SYNC/ASYNC), which will in turn invoke that Completion's own CF (for simplicity, lets just go with a synchronous callback).
The aforementioned event will repeat recursively.
whatsup over in the dev channel?
ngl I don't really like this change
because like no one knows about linked roles
dev general died :p
that exists!
crazy
i didnt know about it XD
now in it XD
you're right I should have provided an article or resource instead of being that dismissive
i find this to be a changeable thing for people, learning styles, but I get how it's difficult
I don't know if I necessarily agree with "pushing away people from getting help has a long running negative impact" in a field like programming specifically
it's definitely a negative in some circumstances
but I am trying to push for self sufficiency
though I understand why I didn't do that well above
my point was kinda that this thing right here was not hard to clean by just looking at the implement in code
like genuinely not trying to be condescending, but in this case his question seemed to be like directly answered by just looking at the implementation, and not even necessitating anything deep
I agree I was rude and unamicable, but I genuinely feel like this was the simplest way for him to get his question answered
if I'm wrong please tell me how
like if your question can be answered by looking at a (simple, which is true here) function implementation, is it wrong of me to say that you should do that before asking other people?
Controversial take but I think trying to make an understanding of the implementation to understand the high levels is not very helpful
Just like the stream api, it’s designed in a way that you don’t need to understand the implementations
You’re more or less correct but I’m not sure if it’s helping your understanding of the type as a whole
I agree w this ^
unless you're performance maxxing, you don't usually need to know these specifics
I like to minimize my performance
i like to maximize my minimizing
I get what you mean -- I just have this pedantic thing where I want to at least know how it broadly works before I use it. I know enough about how the stream api works under the hood such that I can dismiss the full intrinsics of it
I just don't want it to feel like magic per se. Like when I was studying reflection, I just needed to know the general idea of how it works, that is, that it uses JVM intrinsics to pull data about classes from the metaspace at runtime--I don't actually need to know how it does it exactly, but having an understanding of it helps in ensuring that I'm not just applying mindless libraries with no understanding
I think that depends very much on the library, some libraries are easier to just apply in a brain-dead fashion, whilst other libraries require more profound knowledge.
good day everyone, if someone includes the deluxmenus plugin once, please help, I need to hide on the leather bib *painted, I use nbt_int: 'HideFlags:63' for this, but then Hide_attributes: true disappears. also with potion, help, hide it effect
If I wrote in the wrong chat, I apologize.
всем добрый день, если кто-то разбирается в плагине deluxmenus можете пожалуйста помочь, мне нужно скрыть у кожанного нагрудника *крашеный, я для этого я использую nbt_int: 'HideFlags:63' но тогда пропадает hide_attributes: true. также с зельем, помогите еще пожалуйста скрыть его
heyyyyy #general-plugins
I feel like I have to "earn" the privilege of applying libraries mindlessly. If I can't at least to a degree implement the code im leveraging, then how am I learning to be a better programmer at all?
I mean yea thats fair and ofc it depends on how exactly u see the term better, i think a problem with being pedantic about knowing+understanding everything is that it can at times compromise on for example productivity
apart from the costs, will I find a devs here interested in creating such a infrastructure like minehut.com for me freelance? Message me privately
im trying to make an own plugin but im getting errors
i included an plugin.yml but the error is still there:
[15.08 22:44:50.154] WARN : [CityBuild-Builder-1/WARN]: [15.08 22:44:50.143] ERROR: Error loading plugin: java.lang.IllegalArgumentException: Directory 'plugins/.paper-remapped/AutoEffectsPlugin-1.0-SNAPSHOT.jar' does not contain a paper-plugin.yml or plugin.yml! Could not determine plugin type, cannot load a plugin from it!
[15.08 22:44:50.155] WARN : [CityBuild-Builder-1/WARN]: java.lang.RuntimeException: java.lang.IllegalArgumentException: Directory 'plugins/.paper-remapped/AutoEffectsPlugin-1.0-SNAPSHOT.jar' does not contain a paper-plugin.yml or plugin.yml! Could not determine plugin type, cannot load a plugin from it!
[15.08 22:44:50.155] WARN : [CityBuild-Builder-1/WARN]: at io.papermc.paper.plugin.provider.source.FileProviderSource.registerProviders(FileProviderSource.java:85)
[15.08 22:44:50.156] WARN : [CityBuild-Builder-1/WARN]: at io.papermc.paper.plugin.provider.source.DirectoryProviderSource.registerProviders(DirectoryProviderSource.java:52)
[15.08 22:44:50.157] WARN : [CityBuild-Builder-1/WARN]: at io.papermc.paper.plugin.provider.source.DirectoryProviderSource.registerProviders(DirectoryProviderSource.java:17)
[15.08 22:44:50.157] WARN : [CityBuild-Builder-1/WARN]: at io.papermc.paper.plugin.util.EntrypointUtil.registerProvidersFromSource(EntrypointUtil.java:15)
[15.08 22:44:50.157] WARN : [CityBuild-Builder-1/WARN]: at io.papermc.paper.plugin.PluginInitializerManager.load(PluginInitializerManager.java:113)
[15.08 22:44:50.157] WARN : [CityBuild-Builder-1/WARN]: at net.minecraft.server.Main.main(Main.java:111)
[15.08 22:44:50.157] WARN : [CityBuild-Builder-1/WARN]: at io.papermc.paper.PaperBootstrap.boot(PaperBootstrap.java:21)
[15.08 22:44:50.157] WARN : [CityBuild-Builder-1/WARN]: at org.bukkit.craftbukkit.Main.main(Main.java:281)
[15.08 22:44:50.158] WARN : [CityBuild-Builder-1/WARN]: at io.papermc.paperclip.Paperclip.lambda$main$0(Paperclip.java:42)
[15.08 22:44:50.158] WARN : [CityBuild-Builder-1/WARN]: at java.base/java.lang.Thread.run(Thread.java:1447)
[15.08 22:44:50.158] WARN : [CityBuild-Builder-1/WARN]: Caused by: java.lang.IllegalArgumentException: Directory 'plugins/.paper-remapped/AutoEffectsPlugin-1.0-SNAPSHOT.jar' does not contain a paper-plugin.yml or plugin.yml! Could not determine plugin type, cannot load a plugin from it!
[15.08 22:44:50.158] WARN : [CityBuild-Builder-1/WARN]: ... 10 common frames omitted
Did you make a plugin.yml?
yes:
name: AutoEffectsPlugin
version: 1.0
main: AutoEffectsPlugin
api-version: 1.20
i dont know if thats enough for my code
and i am using IntelliJ
How are you creating your plugin jar?
im making it over cmd with "mvn clean package"
also, just making sure - there's no other errors below this, right?
i have many errors in my code o-o
Startup Log Location
Your latest startup log can be found in the logs folder of your
server directory, labeled as latest.log.
Please copy the contents and paste them to a paste service.
Type ?paste for more information.
What folder is it in
jup im uing cloudnet ...
i knew it i forgot something
also that's a lot of red-
yes
oh and the package should be just skygamb.de (the main/java isn't part of the package since that's a Maven thing)
which means your plugin.yml should have this instead: ```yml
main: skygamb.de.AutoEffectsPlugin
https://i.imgur.com/EnFqs53.png
name: AutoEffectsPlugin
version: 1.0
main: skygamb.de.AutoEffectsPlugin
api-version: 1.20
make sure to change lien 1 of AutoEffectsPlugin.java to ```java
package skygamb.de;
or how did you even get to this state anyways-
a friend helped me and the said he is better then me and then we stranded at that sate
alright yeah seems fine
I don't use maven, so this is kind of a guess, but on the very right side of your screen, you should see a maven button
or actually
just double click shift and type "reload maven"
and lmk what happens after that
i dont see anything red 
wdym?
this is what I mean btw
this is what i meant
wait can you show your whole IntelliJ screen
I want to see if I can find the maven button
i did that 
oh it changed lol but it's the m at the top right
click that and then what does it show?
ah yeah that's the button
now the test
but also, small tip - if you double shift again and type mvn clean package
in the future, you'll be able to just run it again by pressing Shift + F10 (or clicking the "play button" at the top right)
shift and F10 dont work 
oh
IntelliJ Community Edition
did you run this
with the double shift
or actually no
sorry
it's double ctrl
that worked
no errors in console thats a good thing
oh no...
there is an error:
@EventHandler
public void onPlayerJoin(PlayerJoinEvent event) { <------------
Player player = event.getPlayer();
player.addPotionEffect(new PotionEffect(PotionEffectType.SPEED, 6000, 1));
player.sendMessage(ChatColor.GREEN + "Willkommen " + ChatColor.YELLOW + player.getName() + ChatColor.GREEN + "!");
}
}
its gray but everything else is blue:
https://i.imgur.com/L2PTEuT.png
you can ignore that
?startuplog
Startup Log Location
Your latest startup log can be found in the logs folder of your
server directory, labeled as latest.log.
Please copy the contents and paste them to a paste service.
Type ?paste for more information.
Directory 'plugins/.paper-remapped/AutoEffectsPlugin-1.0-SNAPSHOT.jar' does not contain a paper-plugin.yml or plugin.yml! Could not determine plugin type, cannot load a plugin from it
Have you moved the plugin.yml file to src/main/resources/ as suggested above?
yes
Also, can you change the debugging mode for cloudnet? I see most of these are DEBUG level logs and it is very hard to see trough all that noise
Can you send a screenshot of the file structure right now please?
how can i change it my friend made the server for me
That I don't know.
i set it off
I'm not sure this will work, but try right clicking the src directory, and click Mark directory as and select Sources Root if it is available.
Also, right click resources directory, and click Mark directory as and select Resources Root if it is available.
what option there? https://i.imgur.com/QHm2L9Y.png
None. It is already marked as sources root. Try the same for resources, and if it is already marked as Resources Root, don't click anything
bruh i am stupid... 🤦♂️
i had the wrong Effect set:
player.addPotionEffect(new PotionEffect(PotionEffectType.SPEED, 6000, 1));
thank you for the help
hey
is this peak kotlin programming
kotlin {
jvmToolchain(targetJavaVersion)
compilerOptions {
freeCompilerArgs.addAll(
"-Xno-call-assertions",
"-Xno-param-assertions",
"-Xno-receiver-assertions"
)
}
}
Why?
null checks were slowing down part of my code by 50%
I could have rewritten that (and eventually I'm going to, not for this reason but for performance) but physics engine is intensive, so release builds should avoid any sort of unnecessary safeties, as those can be checked in debug builds along with other invariant checking
also Kotlin coroutines are actually so awesome
they're ~10% more performant on my machine than fixed thread pool for CPU bound tasks
Hello everyone, please advise best way to use MiniMessage#deserialize with placeholders in a string. Does parsing Component each time to insert placeholders create unnecessary load? Is it better to use TextReplacementConfig, or can I just use MiniMessage#deserialize? Thank for answer
using mm each time is fine
unless you are parsing tens of thousands of components every second or something ridiculous
you can minimize performance cost by just checking if previous string is equal to current string
very simple optimization that will probably cover you
if you have repetitive rapidly swapping states you could technically cache it but like
^
remember to benchmark if you're unsure!
I need some feature suggestions. Im making an alternative to tebex, its already gonna be 50% cheaper any features people would want to see included
Thanks for answer!
I heard that replacing will be faster than parsing, that's just why I wanted to ask about it
test it out :)
well, you'd also need to keep track of placeholders, which if you are doing anything mildly dynamic (such as piping PAPI through MiniMessage) is not all that feasible
I was assuming their usecase is something like text -> papi -> MM, so I was saying to only regenerate MM if previous output from papi is different from current
I may have misunderstood though
i was thinking a minimessage string containing a <papi:foo_bar> tag
ah ic
I lied. It depends. As always.
in a renderer server i have this method run at the end of each loop cycle to update the server on what object need to be render or removed from rendering
private void updateBatches() {
List<GameObject> updateList = new ArrayList<>(updatedGameObjects);
updatedGameObjects.clear();
List<GameObject> removeList = new ArrayList<>(removedGameObjects);
removedGameObjects.clear();
for (GameObject go: removeList) {
destroyObject(go);
}
for (GameObject go : updateList) {
if (!go.isRemoved()) addGameObject(go);
}
}
the updateGameObjects and the removedGameObjects are where update or remove call end up in. does these two list thread save enough for me to do a copy and clear when i run update or do i need to use synchronized list ?
are you sure you need the game objects as a list
queues are much better for concurrency
since you're talking about rendering i'm assuming you're having gameobjects be updated from outside of this thread. for this the easiest thing is to have the gameobjects list be private and have a "queueRemove(GameObject go)" and "queueAdd(GameObject go)" or something of the sort which adds to a threadsafe structure like a ConcurrentLinkedQueue, and then in your render loop you can iterate through it at the start/end of your tick
you want these queues separated from your main object list because you don't want objects to be added or removed during stepping
also CopyOnWriteArrayList is probably the best concurrent list implementation IF you NEED to use a list in a game context since its doubtful you have elements moving in and out more than youre reading them. but prefer Queues because they are an inherently better data structure for concurrency (the "index" nature of lists make them unreliable for concurrency)
the queue list is updated via method call so the problem im worry is that when the batch update started some object might be send to remove need update or addition , which will affect the live list the the renderer is iterating over
avoid having anything outside of that class accessing the queue
it's fine if an object is added to one of the queues while it's being iterated over - that's the safety with concurrent structures
however you do need to make sure that in the queueRemove and queueAdd methods here, that the objects are obtained and cleared from that queue atomically
otherwise they might not get removed / added
something like this (getAndClear must be atomic)
private fun processToRemove() {
val ss = bodiesToRemove.getAndClear()
for (body in ss) {
kill(body)
}
}
i don't know 100% if this is the best implementation but i have never had any issues with it and it works, i just use an AtomicReference<List<T>> in my physics engine
so i can write stuff like this very easily
fun getAndClear(): List<T> {
return items.getAndSet(emptyList())
}
w full safety
well im currently doing this:
public void queueObjectForAddition(GameObject go) {
queueObjectForUpdate(go);
}
// Add a game object to the removal list and remove it from the update list.
public void queueObjectForRemoval(GameObject go) {
updatedGameObjects.remove(go);
if (!removedGameObjects.contains(go)) removedGameObjects.add(go);
}
public void queueObjectForUpdate(GameObject go) {
if (!updatedGameObjects.contains(go) && !removedGameObjects.contains(go)) updatedGameObjects.add(go);
}
private void addGameObject(GameObject go) {
List<SpriteRenderer> sps = go.getComponents(SpriteRenderer.class);
for (SpriteRenderer sprite : sps) {
addSprite(sprite);
}
List<TextRenderer> ts = go.getComponents(TextRenderer.class);
for (TextRenderer txt : ts) {
addText(txt);
}
}
the renderer doesnt care about the object itself, it end goal is to extract renderable component out of the object.
if you wanted full thread safety, queueObjectForUpdate isn't technically safe because those lists could get modified between the if statement and updatedGameObjects.add(go), you need to either synchronize or make it atomic
w concurrent stuff you have to remember that you cannot ever trust the state of something between 2 statements without some other guarantee
i could minimize the risk by limit where the logic server can access the renderer call right ? Currently object add remove or update operation on the logic thread is queue into the scene, the scene collect the queue then process it at the end of each loop cycle. So for now the the access is sequential so it should be ok?
if you don't have different threads accessing it concurrently then it's safe yeah, I don't exactly I understand your architecture so I can't give a very detailed answer
i use server system, where a task like logic and renderer task is assigned a thread for the engine's entire runtime
if they're on different threads you have to synchronize/atomic in places like this
the risk is you randomly don't have objects added into the scene
or removed
or whatever the thread does
if you're not modifying the list a crazy bunch and want smth simple just use AtomicReference
https://github.com/Ruskei/Udar/blob/main/src/main/kotlin/com/ixume/udar/AtomicList.kt
no synchronization needed and perfectly safe
& very easy to implement
i'm glad that the scene is a logic thing
why so many collections
I am sure it does the job but it looks like a fragile design to me
what do you know about fragile design anyway
uuid = string is more concerning tbh
tbf I wonder how unoptimized Runway is lol... I convert components to string, replace text, parse PAPI (maybe) and convert to MM again lmao
and that being for each component
for each packet
nothing 🐸
root, added, removed, are 100% necessary, first one is necessary (though it should be UUID, not Strong)
last 2 I'm not sure but seems reasonable
other than it being String
if all of them are managed in a few methods w high locality of behavior it's pretty fine
well, I don't know the whole context and how are they used, so it's difficult to tell
why it is concerning ?
the uuid is actually stored as string for the object
the value is generated and converted to string when the object first created and it is serialized when save and on load
i don't see why it is a bad sign right now could you explain?
2 added and removed queue are essential, the root collection is for quick access (so you don't have to filter and stream everytime), and the component collection is for path access (similar to the $CollisionShape2D thing you can do in gdscript)
Why aren’t you using UUID?
componentsByUUID.put(“not a uuid”)
if the component carry a uuid that is not a uuid, wouldnt the system use the malformed uuid to get the component with malformed uuid ?
it’s still a bad practice to allow malformed ids in the first place
Also using UUID will be faster because it has a much more simple hash function
i see, thanks for clarify that
public class MyCoolUUID {
private final String original;
private final UUID uuid;
public MyCoolUUID(String possiblyMalformedUuid) {
this.original = possiblyMalformedUuid;
UUID parsed;
try {
parsed = UUID.fromString(possiblyMalformedUuid);
} catch (IllegalArgumentException e) {
// Oops
String sanitized = sanitize(possiblyMalformedUuid);
try {
parsed = UUID.fromString(sanitized);
} catch (Exception ex) {
// Whatever lol
parsed = UUID.randomUUID();
}
}
this.uuid = parsed;
}
private static String sanitize(String s) {
// Force it into the "8-4-4-4-12" UUID format B)
String hexOnly = s.replaceAll("[^0-9a-fA-F]", "");
hexOnly = (hexOnly + "00000000000000000000000000000000").substring(0, 32);
return hexOnly.replaceFirst(
"(\\p{XDigit}{8})(\\p{XDigit}{4})(\\p{XDigit}{4})(\\p{XDigit}{4})(\\p{XDigit}{12})",
"$1-$2-$3-$4-$5"
);
}
}
💀
I would not use the string unless the id is exposed to an user (config, database, commands) tbh
i just made a discord bot that uses ai to read your promt and sets up an entire discord server roles channels catagories ect for you in 5 seconds
well i do need to serialize that to a file with gson....
gson supports UUIDs
i was gonna say bro, any serialization framework will do that for you
SQL libraries serialize it to/from bytes if your SQL server supports it
not kotlinx.serialization 😐
recently found https://github.com/sksamuel/hoplite tho which looks nice
yeah i'm the #1 Hoplite lover bro lol
to be fair, I think they now automatically support the Kotlin-native UUID
they just couldn't do the JVM UUID for multiplatform reasons
making up half of hoplite mentions in this server 🙃
I guess making a jvm specific module for just serializers would be a bit overkill
oh it does? the more you know i guess
you mean the opt-in experimental Uuid? 
like bruh it's just two u64 how hard can it be
Which isn't serializable by default either 
As for why it's experimental, basically any Kotlin feature has to be experimental for a few releases before it's marked as stable even if it is as simple as a class :')
Ah wait quick update on that, it's not @Serializable but it is internally serializable by kotlinx.serialization, i guess it makes sense
imagine not using polaris smh
Do you use it? lol
I used it in some past plugin I had done
kinda like it
Oh interesting
I am gonna rewrite Runway, still checking what I will use
since I technically do have my own config system xD
but might go with yours as it is probably much better/safer than mine
I don't trust myself xd
I also need to see how in the world I am gonna optimize runway's parser
I have no idea how I will do it... caching? idk
I never did benchmarks in the current way, but I'd assume it sucks at performance in bigger servers
oo this kinda cool
https://github.com/xMrAfonso/Runway/blob/master/src/main/java/me/mrafonso/runway/util/ProcessHandler.java#L56 this does not look pretty xd
meowza
?
idk
setting config values :(
don't question it
that's the least of my worries
Hi guys, am I able to ask for help regarding java stuff here or just MC specific?
yeah java stuff works too
Regarding constructors and Inheritance, if I have a constructor in a subclass am I able to use a this statement in a constructor and a super() in the next constructor?
If I understood your question correctly, this is allowed, for ex.:
class Parent {
Parent() {
// Parent constr
}
Parent(String msg) {
// Parent constr with args
}
}
class Child extends Parent {
Child() {
this("Child without args");
}
Child(String args) {
super(args); // super();
// Child with args
}
}
hmm i see
actually, I have never seen "this" being used like that
that's just constructor overloading/chaining
similarly
public void methodWithoutArgs() {
methodWithArgs("Hello");
}
public void methodWithArgs(String arg) {
// ...
}
