#help-development
1 messages ยท Page 658 of 1
he doesn't need to yeah
nnnnnnnnnnnnnnnnnnot exactly? i have absolutely no idea about maven
refresh maven as noob said
yeah, that is... how?
Intelij maven window right wide of screen
are you using intellij
theres a button to refresh
eclipse...
the ECLIPSE incident
right click pom update project
ew
cant say that infront of elgarl
IJ on top
why
he uses eclipse
LMAO
Right click pom.xml -> Maven -> Update Project
i got it yeah, nice
hello how can I make armorstend pet plugin so it will be following player using velocity?
u need an ide
you can change the scope on your annotations dependency to provided as it's not used at runtime
do you know java
ArmorStand armorStand = entry.getValue();
Location targetLocation = player.getLocation().add(1, 0, 0);
Vector direction = targetLocation.subtract(entry.getValue().getLocation()).toVector();
armorStand.setVelocity(direction.getVelocity().normalize().multiply(1.2));
so?
4 lines of code will definitely not help anyone help you
bounces?
also instead of doing velocity.normalize().multiply(1.2)
try velocity.multipliy(0.2)
or something like that
yea it bounces in player's location because it can't hit it directly
every 5 ticks
he has to normalize as he's using locations as vectors so it will not be a unit vector
You need to have a minimum follow distance and only set velocity if outside that
else you are setting a velocity even if it's on the player
use direction.length()
what does it return?
no idea what you mean by bounces
I don't do dm
cursed
ah yes 18+ warning
on point 18+
if (p.hasPermission java herb("commandcooldown." + cmd + possible.get(i))) {```
if (p.hasPermission("commandcooldown." + cmd + possible.get(i))) {
}
but then it will be slooow
no it won't
which is why you need a minimum distance
where should I place is this is the problem I've tried everywhere lol
can u send the whole code
but otherwise do what?
increase teh 1.2 distance to 1.5
too big
or whatever you need to stop it bouncing
if I teleport it wont bounce because the locations will be equal
public void onCommand(PlayerCommandPreprocessEvent e) {
Player p = e.getPlayer();
if (plugin.cooldowns.containsKey(p.getName()) && !p.hasPermission("commandcooldown.override")) {
HashMap<String, Long> commands = plugin.cooldowns.get(p.getName());
String cmd = e.getMessage().substring(1, e.getMessage().contains(" ") ? e.getMessage().indexOf(' ') : e.getMessage().length());
if (plugin.delays.containsKey(cmd)) {
ArrayList<Integer> possible = plugin.delays.get(cmd);
Integer min = null;
for (int i = 0; i < possible.size(); ++i) {
if (p.hasPermission("commandcooldown." + cmd + possible.get(i))) {
}```
collisions off
?paste
How can i set a permission like core.worlds.* and make it work? I used .setPermission on a PermissionAttachment but it seems that the * doens't work.
ussually permission plugins automatically handle the * wildcard
it does not require any work on your side
how did you disable collisions? As disabling gravity also disables collisions but then it would not be affected by velocity
unless ur making a permission plugin
in spigot or paper.yml i dont remember
there is no setting to prevent collisions in spigot.yml
which means you still have collisions
yea i'm making my own plugin to manage most of the features of my server, including permissions and ranks. I have them working but i have this issue with * and i have no idea how to make it work.
then in paper.yml
@lavish vortex what even is that code btw that will not work
you can not move an armorstand using velocity to stop inside a collision box
I can move it
using velocity
yes
collisions are just off thats it
I guarantee they are not
yes, they are
They are not or your stand would not "bounce"
you need to set a follow distance so it's not trying to move inside the players collision box.
it bounces because of the velocity
ah
I sent the image
it goes towards location everytime making it bounce
then you did not add a check for the length as I told you to do
I did
show code
`<dependency>
<groupId>org.mariadb.jdbc</groupId>
<artifactId>mariadb-java-client</artifactId>
<version>2.7.2</version> <!-- Make sure you use the latest version -->
</dependency>
<!-- https://mvnrepository.com/artifact/mysql/mysql-connector-java -->
<dependency>
<groupId>mysql</groupId>
<artifactId>mysql-connector-java</artifactId>
<version>8.0.33</version>
</dependency>
<dependency>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-shade-plugin</artifactId>
<version>3.5.0</version>
<type>maven-plugin</type>
</dependency>
<dependency>
<groupId>net.md-5</groupId>
<artifactId>bungeecord-api</artifactId>
<version>1.20-R0.1-SNAPSHOT</version>
<scope>provided</scope>
</dependency>`
What dependency do i not need?
or do I need them all
maven shade plugin is not a dependency
huh?
it goes in a plugins section
Location playerLocation = player.getLocation();
Location targetLocation = playerLocation.clone().add(1, 0, 0);
Vector direction = targetLocation.subtract(armorStand.getLocation()).toVector();
double distance = direction.length();
double minimumFollowDistance = 1.0;
if (distance > minimumFollowDistance) {
direction.normalize();
double speed = 1.2;
armorStand.setVelocity(direction.multiply(speed));
}
oh but the plugin works without it than
oh btw. can I make armorstand a marker and use velocity somehow?
you get teh length before normalizing
so I should use it after?
btw what about this?
because I cant hit blocks etc. through the armorstand
does anyone know? And i'm not using another permission plugin, i am making the permission plugin
okay
you have to parse all child perms if you want to implement wildcards
oh btw. can I make armorstand a marker and use velocity somehow?
but what about this, I want my armorstand to not block interactions
try it and see?
try what
as a marker
I set armorstand.setMarker(true) and velocity didnt work
then you have your answer ๐
so I can't? that sucks
yea follow the player
do you need to interact with it?
nope, just follow
then you shoudl probably look at DisplayEntities
I'm sorry what
do { // while not updated inside the loop we must wait for the main thread to sum
System.out.println(workers.size() + " | " + chunkPositionMap.size()); // REMOVING THIS BREAKS EVERYTHING
} while (chunkPositionMap.size() != workers.size());
Any ideas?
Hello Guys can anyone show me how I can catch this error?
[18:59:00 ERROR]: [org.bukkit.configuration.serialization.ConfigurationSerialization] Could not call method 'public static org.bukkit.Location org.bukkit.Location.deserialize(java.util.Map)' of class org.bukkit.Location for deserialization
java.lang.IllegalArgumentException: unknown world
at org.bukkit.Location.deserialize(Location.java:1140) ~[purpur-api-1.20.1-R0.1-SNAPSHOT.jar:?]
at jdk.internal.reflect.DirectMethodHandleAccessor.invoke(DirectMethodHandleAccessor.java:104) ~[?:?]
at java.lang.reflect.Method.invoke(Method.java:578) ~[?:?]
at org.bukkit.configuration.serialization.ConfigurationSerialization.deserializeViaMethod(ConfigurationSerialization.java:85) ~[purpur-api-1.20.1-R0.1-SNAPSHOT.jar:?]
at org.bukkit.configuration.serialization.ConfigurationSerialization.deserialize(ConfigurationSerialization.java:127) ~[purpur-api-1.20.1-R0.1-SNAPSHOT.jar:?]
at org.bukkit.configuration.serialization.ConfigurationSerialization.deserializeObject(ConfigurationSerialization.java:207) ~[purpur-api-1.20.1-R0.1-SNAPSHOT.jar:?]
at org.bukkit.configuration.file.YamlConstructor$ConstructCustomObject.construct(YamlConstructor.java:58) ~[purpur-api-1.20.1-R0.1-SNAPSHOT.jar:?]
at org.yaml.snakeyaml.constructor.BaseConstructor.constructObjectNoCheck(BaseConstructor.java:264) ~[snakeyaml-2.0.jar:?]
at org.yaml.snakeyaml.constructor.BaseConstructor.constructObject(BaseConstructor.java:247) ~[snakeyaml-2.0.jar:?]
at org.bukkit.configuration.file.YamlConstructor.construct(YamlConstructor.java:37) ~[purpur-api-1.20.1-R0.1-SNAPSHOT.jar:?]
at org.bukkit.configuration.file.YamlConfiguration.fromNodeTree(YamlConfiguration.java:163) ~[purpur-api-1.20.1-R0.1-SNAPSHOT.jar:?]
at org.bukkit.configuration.file.YamlConfiguration.loadFromString(YamlConfiguration.java:120) ~[purpur-api-1.20.1-R0.1-SNAPSHOT.jar:?]
at org.bukkit.configuration.file.FileConfiguration.load(FileConfiguration.java:160) ~[purpur-api-1.20.1-R0.1-SNAPSHOT.jar:?]
at org.bukkit.configuration.file.FileConfiguration.load(FileConfiguration.java:128) ~[purpur-api-1.20.1-R0.1-SNAPSHOT.jar:?]
at org.bukkit.configuration.file.YamlConfiguration.loadConfiguration(YamlConfiguration.java:309) ~[purpur-api-1.20.1-R0.1-SNAPSHOT.jar:?]
at at.spawn.spawn.loadConfig(spawn.java:105) ~[spawn-1.0-RELEASE.jar:?]
at at.spawn.spawn.onEnable(spawn.java:71) ~[spawn-1.0-RELEASE.jar:?]
at org.bukkit.plugin.java.JavaPlugin.setEnabled(JavaPlugin.java:281) ~[purpur-api-1.20.1-R0.1-SNAPSHOT.jar:?]
at io.papermc.paper.plugin.manager.PaperPluginInstanceManager.enablePlugin(PaperPluginInstanceManager.java:189) ~[purpur-1.20.1.jar:git-Purpur-2023]
at io.papermc.paper.plugin.manager.PaperPluginManagerImpl.enablePlugin(PaperPluginManagerImpl.java:104) ~[purpur-1.20.1.jar:git-Purpur-2023]
at org.bukkit.plugin.SimplePluginManager.enablePlugin(SimplePluginManager.java:507) ~[purpur-api-1.20.1-R0.1-SNAPSHOT.jar:?]
at org.bukkit.craftbukkit.v1_20_R1.CraftServer.enablePlugin(CraftServer.java:653) ~[purpur-1.20.1.jar:git-Purpur-2023]
at org.bukkit.craftbukkit.v1_20_R1.CraftServer.enablePlugins(CraftServer.java:564) ~[purpur-1.20.1.jar:git-Purpur-2023]
at net.minecraft.server.dedicated.DedicatedServer.initServer(DedicatedServer.java:311) ~[purpur-1.20.1.jar:git-Purpur-2023]
at net.minecraft.server.MinecraftServer.runServer(MinecraftServer.java:1117) ~[purpur-1.20.1.jar:git-Purpur-2023]
at net.minecraft.server.MinecraftServer.lambda$spin$0(MinecraftServer.java:323) ~[purpur-1.20.1.jar:git-Purpur-2023]
at java.lang.Thread.run(Thread.java:1623) ~[?:?]
is there anyway that AsyncPlayerPreLoginEvent#disallow doesn't logging 2 times?
You're using purpur api? Idk how much we can help
Wait a sec i try it in spigot
You accessed yrou config too early, before worlds were loaded
Can you explain that comment? Sout is "slow" so I assume that is enoght time to finish some computation happening async
https://paste.md-5.net/ebipekizap.md <- spigot server error message
https://paste.md-5.net/ujafohomek.java <- bungeecord
https://paste.md-5.net/ayuqibodoh.java <- spigot plugin main class
https://paste.md-5.net/nezidosibe.java <- spigot plugin listener class
Why am I getting this error?
how do I kill an instance of a CommandExecutor from inside itself
wow, the ender dragon is so hard coded
Okay and how can i fix this?
Btw; If I use a spigot server no error comes only in paper!
plugin.language is null probably
We use/Support Spigot here, not Paper
I have a CommandExecutor that starts a countdown. If the countdown reaches 0 before a specific user input happens, i want the whole instance to cancel
yes but why? plugin.language is the result of the pluginmessaging
guessing that message wont come through until after the player joins
so I should wait like 20 ticks?
no
no lol
80?
you send that message when you get teh response from bungee
Are you sure that Command Executor is starting countdown? It's interface that executes when command even happens
you do not wait
how do I know when I get the response?
in PMC
dont wait at all, use a callback
can I have an example?
i guess it would be the implemented OnCommand(), but i figured that was implied
Can you send code
@EventHandler public void onPlayerJoin(PlayerJoinEvent event) { event.getPlayer().sendMessage("debug"); plugin.requestLanguage(event.getPlayer()).thenAccept(language -> { event.getPlayer().sendMessage("Your language is " + language); }); }
completeable futures are goat
spigot
buildtools
NO
caps
you just need to install buildtools
Waiting for the main thread to finish making chunk snapshots
and add spigot as a dep
Once I have all of them I can sum them up
no
you dont?
?nms
personally I use protocollib
public class command implements CommandExecutor {
@Override
public boolean onCommand(CommandSender sender, Command command, String label, String[] args) {
Player player = (Player) sender;
ScheduledThreadPoolExecutor sched = new ScheduledThreadPoolExecutor(1);
ScheduledFuture<?> future = sched.schedule(() -> check(), 90, TimeUnit.SECONDS);
TextComponent msg = new TextComponent("click here");
msg.setClickEvent(new ClickEvent(ClickEvent.Action.RUN_COMMAND, "trigger objective"))
BaseComponent[] components = new ComponentBuilder().append(msg).create();
player.spigot().sendMessage(components);
//code to await input (to be written)
return true;
}
private void check() {
//cancel other method
}
}
Why does Java not throw exceptions that you don't catch, so fkn annoying AHHH
Let this be a warning to all that'll read this msg of voew:
Code in try-catches only throw exceptions if you catch them!
So smth like this won't throw a "DivideByZero" exception:
final int zero = 0;
try {
final FileReader reader = new FileReader("some file ig");
reader.read() / zero;
reader.flush();
reader.close();
}
catch (IOException e) { e.printStackTrace(); }
no, an uncaught exception will be passed up the chain
@EventHandler
public void onPlayerJoin(PlayerJoinEvent event) {
event.getPlayer().sendMessage("debug");
plugin.requestLanguage(event.getPlayer()).thenAccept(language -> event.getPlayer().sendMessage("Your language is " + language));
}
why is this happening?
1.18.2 is before Mojang mappings, but also... Paper
No
Mojmaps started in 1.17.1
However, I have had situations where the exception was never thrown. So I only knew something was off, but not where, when, why or how.
Mojmaps were nto implemented in Spigot until around 1.18.5 I thiought
1.18.4
why do you want to ceate your own over using citizens?
creating yoru own you have to manage code for every version you want to support
Don't make new thread pool on every command execution
Also you can just call cancel() on future
They had to remove some versions due to file size limit I believe
search my post history. I uploaded a zip for fakeplayer about a month or two back for 1.19.3
that would be called if the trigger was triggered. I want to cancel the to-be-written listener when future runs out of time. Thus the Check()
Citizens supports 1.19.4, you should just update - using an outdated patch-version isn't a good idea anyway
Have smth like Map<UUID, Future<>> and in event I which you want to cancel it get future from map and cancel it
Updating a server is simple, there are plenty of online guides - TL;DR you just stop your server, update the server jar, update all plugins to versions that support the new version, and start it back up (but again, there are plenty of guides with more detail)
im not worried about cancelling future. After the timer starts, it watches the scoreboard for the trigger. If the trigger is never triggered, how would i kill the instance there.
I'm afraid I don't understand what you mean by "killing instance" if its not canceling future
so cancelling future would stop the timer before it runs out of time. when the timer runs out of time it calls another method. In the same method future is created in, a listener is created in. I want the method future calls to cancel the listener
its all teh code you need to spawn fake players
just pull what you need
maven
If I remember I had it spawn one in teh Listener when a player joins
its just demo code
so probably in FakePlayer
yep
?img
Can't send images? That's because you're not verified! Use !verify to complete verification.
Alternatively, you can upload screenshots to any image hosting site and share the link.
Here's some screenshot utilities that can use to upload images.
Lightshot: https://prnt.sc
Imgur: https://imgur.com/upload
Flameshot: https://flameshot.org
where tf did the convert to kotlin go, brand new project
first time dealing with it, it always had that option
installed it from ubuntu software
hmm
it works with classes
also just noticed there is a new UI
wdym?
Am I wasting my time with spigot tutorials, or should I just jump in and starting coding?
If you know java do a first plugin tutorial
I absolutly don't know if u can find updated ones, there aren't any up to date tutorials out there
orr at least I didn't find any
https://youtu.be/_baQRSDb3pc @fossil coral
In this episode, I show you how to use permissions with your Minecraft plugins. This involves setting permissions for commands, adding permissions to the plugin.yml, and also checking for permissions in the plugin code. #minecraft
Code: https://github.com/Spigot-Plugin-Development-Tutorial/permissions
Join the Community! - https://discord.gg/co...
This guy is really good but I feel like I'm selling myself short by just watching tutorials
Up to date I believe too
Can someone explain why PersistentDataContainer#get(key, PersistentDataType.STRING) returns an object instead of a string?
because it's a single method
so it's guaranteed to be null or String?
Hello. I imported remapped minecraft-server and i get error package net.minecraft.server.v1_20_R1 does not exist
Bellow is my pom.yml ๐ฅ
thew return is always an object no matter what type you ask for
how tf did I never find this
you kinda can't
minecraft generation is chaotic
so you can only know by generating that part
(With some... obvious exceptions -> flat worlds)
yeah
random generation occurs when loading player chunks??
no
but biomes can only be determined by either loading or generating the corresponding area
I mean, unless when creating the world, it will no longer be known in advance where the sea is
?
thats not known in advance
what's better?
- save the Quest class to the list in the plugin, and then work with it, and then only save it to the database.
- create a Quest class, store it in the database, and then when you need to perform all sorts of functions for it
the coordinates and the seed enter a chaotic generative algorithm based on perlin noise
But what about the seed of the world, etc.
with the help of seed, they will find out where the dungeons are, etc.
if possible keep it in memory as much as possible. I/O has multiple annoyances to work around, one of which is how slow it is
by pseudo-generating the world
well, if so, then the location is not chaotic because the coordinates are the same
in bioms
well that may be true, but you have to run the algorithm for biome generation to actually know what biome there is
so the first way is better?
imo yes
okay, thanks
so the only way to find all sea biomes is by literally running the algorighm for biomes over all coordinates
and good luck with that
how do i get this stupid nms class in my project?
download all pieces huh?
remove the 2 deps crossed out here
then reload maven
I moved on from plugin messaging, way to annoying
now why is this error happening? I shaded the deps
don't you need that both on build and on the server?
?
the mariadb driver
yes
Class.forName("org.mariadb.jdbc.Driver"); is not found
how can I make it found? lol
whats ur pom looking like
I'm trying to remember if shading is supposed to include the thing youre linking
wait but this was working on bungeecord I think its something else thats messed up
what about the loading of chunks by the player?
๐
end check biom
have you ran buildtools with --remapped flag already
Package name is wrong
yes
oh ye it is
Thatโs what they used. Dependency is correct. Just the import is wrong
try {
Class.forName("org.mariadb.jdbc.Driver");
} catch (SQLException | ClassNotFoundException e) {
e.printStackTrace();
getLogger().severe("Failed to connect to the database or load the configuration!");
}
if its not finding the driver what do I do?
just use hikari cp
whats that
a sql lib
that handles all the connection stuff for you
and adds a connection pool
so that should be the only dependencys?
yes
https://www.baeldung.com/hikaricp check this @wary topaz
This is how i setup a mysql connection pool https://github.com/The-Epic/EpicSpigotLib/blob/master/epicspigotlib-core/src/main/java/me/epic/spigotlib/storage/MySQLConnectionPool.java
thank you so much
why?
EpicEbic how can I access UUID
like if I put uuid into the thing it will return the language
of the players prefered
or atleast how can I execute a query
try(Connection connection = myDataSource.getConnection();
PreparedStatement preparedStatement = connection.prepareStatement("SELECT Lang FROM Players WHERE UUID = ?");
) {
preparedStatement.setString(1, myUuidAsString);
ResultSet result = preparedStatement.executeQuery();
...
shouldnt the prep statement be in the try-with-resources
tysm
yes, my bad
the creation of the prepared statement also belongs into the try ( ... ) part
i edited it
how can i get a items remaining durability
cause getDurability returns very weird things
cast to https://hub.spigotmc.org/javadocs/spigot/org/bukkit/inventory/meta/Damageable.html and getDamage
declaration: package: org.bukkit.inventory.meta, interface: Damageable
Is there any good docs about sending messages to Bungee
the sql is on a different machine how can I get rid of this reror
ignore it pretty much
it is only warning
ignore it
Unable to resolve sysmbol players?
is it not inquotes
it is
msot likely something with intellij ultimate
ignore
and its db stuff
alr ill ignore
u can most likely disable the inspection
done
not very
that is pretty cursed
would prefer for a Class.forname with a paper class but ig that works
if you consider craftbukkit to be a paper-based fork, then it works ๐
or mohist
or catserver
WHOS THE GUY WHO WANTED TO SEE MY PROJECT?
NOT ME
WHAT PROJECT IS IT
help me
yeah true, but still, the detection is cursed
then ask something
i have problem whit vault plugin
how is this a development question?
you're missing HikariCP in runtime classpath
you arent shading hikaricp
did you shade it?
god damn
Fucking multi instace limbo there was a guy who was exited about it
its in ur pom
@alpine urchin wanna see it?
what even is modern loading strategy?
what the heck is that
its the shade?
no it isnt
its default build system (intellij)
Use maven
thats intellij artifacts
you shade inside ur pom.xml
then do not use build artifacts if you use maven
Hi, how to get slot of item that player picked up?
this is how to shade using maven https://blog.jeff-media.com/common-maven-questions/
InventoryClickEvent
event.getClicked() iirc
i think they mean picked up as in EntityPickupItemEvent
oh
use maven tab
you havent been building with maven
yes I have
run maven package
oh
if you have used maven, then why did you show a screenshot of IJ build artifacts? >.<
have you been pressing the big green hammer
well after you click this you can then probably use run button to repeat the same task
so you can close the tab afterwards
@brave bear does your plugin load before vault?
how do i know?
Have you added vault in plugin yml as dependency?
yes
Can you show it
im getting the same erro message
manifold's syntax is cursed
send a screenshot of what you are now pressing to build
did you even use the .jar compiled by maven?
yes i did
where did you take it from?
๐
if i want rtp my structure in biom i need for loop?
and where did you take the .ajr from?
where did you now take the jar from
.jar *
all ok bye bye and thanks <3
` 2023-08-06T17:05:50-04:00
[INFO] ------------------------------------------------------------------------
[WARNING]
[WARNING] Plugin validation issues were detected in 3 plugin(s)
[WARNING]
[WARNING] * org.apache.maven.plugins:maven-compiler-plugin:3.8.1
[WARNING] * org.apache.maven.plugins:maven-shade-plugin:3.2.4
[WARNING] * org.apache.maven.plugins:maven-resources-plugin:3.3.0
[WARNING]
[WARNING] For more or less details, use 'maven.plugin.validation' property with one of the values (case insensitive): [BRIEF, DEFAULT, VERBOSE]
[WARNING]
Process finished with exit code 0
`
where from
where did you take the .jar from
where intellij compiles my plugin
intellij does not compile your plugin
maven now compiles your plugin
so you are still using your old non-maven .jar
so I cant use intellij build anymore?
no
no
why are oyu using maven in the first place if you don't wanna use it
No, I need to check after picking up an item whether the slot in the hotbar that the item in is the same one the player is using
alex get the blog out
i love maven?
you arent using it though
which one? how to change th eoutput directory, or how to create a basic plugin w/ maven?
output dir
how do I change mavens output directly
In any case, I need to find out if the item picked up by the player is in his hands
blame EU for that cookie banner
wrong message
then you'll have to manually check the inventory for the first matching slot
y.
[21:09:09 INFO]: Paper: Using OpenSSL 3.0.x (Linux x86_64) cipher from Velocity.
[21:09:10 WARN]: [org.bukkit.craftbukkit.v1_20_R1.legacy.CraftLegacy] Initializing Legacy Material Support. Unless you have legacy plugins and/or data this is a bug!
[21:09:16 WARN]: Legacy plugin Lobbymanager v1.0 does not specify an api-version.
[21:09:16 ERROR]: [ModernPluginLoadingStrategy] Could not load plugin 'Lobbymanager.jar' in folder 'plugins'
org.bukkit.plugin.InvalidPluginException: java.lang.NoClassDefFoundError: com/zaxxer/hikari/HikariDataSource
at io.papermc.paper.plugin.provider.type.spigot.SpigotPluginProvider.createInstance(SpigotPluginProvider.java:127) ~[paper-1.20.1.jar:git-Paper-108]
at io.papermc.paper.plugin.provider.type.spigot.SpigotPluginProvider.createInstance(SpigotPluginProvider.java:35) ~[paper-1.20.1.jar:git-Paper-108]
at io.papermc.paper.plugin.entrypoint.strategy.modern.ModernPluginLoadingStrategy.loadProviders(ModernPluginLoadingStrategy.java:116) ~[paper-1.20.1.jar:git-Paper-108]
at io.papermc.paper.plugin.storage.SimpleProviderStorage.enter(SimpleProviderStorage.java:39) ~[paper-1.20.1.jar:git-Paper-108]
at io.papermc.paper.plugin.entrypoint.LaunchEntryPointHandler.enter(LaunchEntryPointHandler.java:36) ~[paper-1.20.1.jar:git-Paper-108]
at org.bukkit.craftbukkit.v1_20_R1.CraftServer.loadPlugins(CraftServer.java:508) ~[paper-1.2
nice ip you got there
?paste your pom
oh no >_<
looks good. you are still using the wrong .jar
no I upload my plugin to pterodactyl
i highly doubt it, it doesn't even end in plugins/
delete the old jar on ptero and downloads, then build again making sure the profile is enabled and the upload the new jar
C:\Users\ethga\OneDrive\Desktop\BetterServer\Lobbymanager\target\Lobbymanager-1.0.jar
did you use this .jar?
oh uhh no
thats crazy, you dont have the proifle enabeld it looks like
have you even read the blog post about how to change the output directory
or did you just copy / paste it without reading it
i copy an pasted it ๐
yeah well then read it again pls
ima ujst do it the lazy way
it takes 1 button press
you do realize that all you gotta do is click one checkbox right?
just read and look at the pictures
wait checjkbox?
i literally wrote down every step
thin arrow
it works!
as expected ๐
this is what happens when you read the instructions
show ur code
btw you should update your maven-shade-plugin to 3.5.0 in case you ever update your java version
what's the issue?
it is supposed to say "en"
why? no
result.getString("xyz")
it helps if you use google
why
why arent you just .toString
does it really matter?
no
don't you have to call next() on the resultset?
dont remember
you have to
been a while since i did mysql
but half of these issues are very basic and can be solved in 1 google search, eg "Oh whats this? ResultSet? never heard of it, ill google it to see how to use it"
String lang = null;
if(rs.next()) {
lang = rs.getString("Lang");
}
rs is the resultset
while or if is better
if is better than if?
while(rs.hasNext() most likely
hehe 1
im going to bed before i start a fight
and even if you'd use while - then you would also only ever get one entry
`@EventHandler
public void onPlayerJoin(PlayerJoinEvent event) {
event.getPlayer().sendMessage("debug");
try (Connection connection = plugin.sql.getConnection()) {
PreparedStatement preparedStatement = connection.prepareStatement("SELECT Lang FROM Players.PlayerData WHERE UUID = ?");
preparedStatement.setString(1, String.valueOf(event.getPlayer().getUniqueId()));
ResultSet result = preparedStatement.executeQuery();
if (result.next()) {
String lang = result.getString("Lang");
event.getPlayer().sendMessage(lang);
} else {
event.getPlayer().sendMessage("No language data found for you in the database.");
}
} catch (SQLException e) {
event.getPlayer().sendMessage("An error occurred while fetching your language data.");
// You can also log the error for debugging:
// e.printStackTrace();
}
}
`
this should work
let me test it
that sql might be wrong, i dont remember the correct format lol
You're welcome ๐
good night
gn
You what
why doesnt this work
?notworking
"Does not working" is a useless statement. Please describe what exactly is not working, what you expect it to do, and what actually happens. If you get any console errors, also ?paste the entire stacktrace.
it literally doesnt work. returns null
just nothing
i dont know how else to explain it
there is no error code nothing
it just does nothing
Does the item have a display name set
it can;t return null
isnt display name just the items name?
getMeta can though
You guess?
No its the anvil / custom name
Is it null or an empty string?
okay well how do i get the name of the item then
empty string ig
You cant, its language specific
The best way is to send translatable components
oh well that sucks
sounds complicated
But as olivo said you can display it
getTranslationKey was PRed by some genius for this
cant i just get whats its called on english? fk multi langual
cough
You can get the typeโs name and lower case it
?nms
Which version? And why craftbukkit
And replace _ with spaces
i mean yh okay ig i will do that
Instead of Spigot
he's on 1.18.2 I think
In that case: ?nms
?bootstrap
Bootstrap Jar
The main spigot-1.18.jar is now a bootstrap jar which contains all libraries. You cannot directly depend on this jar. You should depend on Spigot/Spigot-API/target/spigot-api-1.18-R0.1-SNAPSHOT-shaded.jar, or the entire contents of the bundler directory from your server, or use a dependency manager such as Maven or Gradle to handle this automatically.
Please read the release notes for further information: https://www.spigotmc.org/threads/9-years-of-spigotmc-spigot-bungeecord-1-18-1-18-1-release.534760/#post-4305163
?nms
Preferably this ^
all we will do is repeat whats already on that page
man bots are really getting out of hand https://voyager.minedojo.org/
yeees
TECHNICALLY with Mojmaps it's just NM :D
technically you're a nerd
depends - there's ofc also classes in n.m.s
There are, yes
run in same folder
obviously you have to run that command in the folder where you downloaded buildtools to
READ
was that an option? I have 25 bug reports I would love to see you tackle
I was just goign to go "Connecting..." ๐
there's a suspicous stew typing
I didn't know you discriminated against specific stews, I see how it is
lol
you have not read the buildtools isntructions
don;t run it on your desktop
Please do not run in a path with special characters!
Read what it tells you
OneDrive = bad nightmare
you mean don't run it on onedrive
oh yeah one drive too
desktop is fine
- onedrive not allowed
- spaces in path not allowed
- special chars in path not allowed
wtf just move it to somewhere else
no he's correct
C:\BuildTools, whatever
windows for some reason defaults to this garbage now
it's a recent thing, my laptop was doing the same thing
I don;t have OneDrive in windows 7 ๐
you also don't have security updates in windows 7 I believe
I have all I want
hell yeah brother
chicken wings
don't let these nerds stop you from downloading freedom viruses
yum, I just ate sweet and sour chicken balls
did somebody say freedom?
you also dont have onedrive if you nuke it from your pc
๐บ๐ธ
๐ญ
or if you use a proper OS
๐
just as much effort
hell yeah brother, you tell 75% of people using computers that they are not actually using an operating system
Now Patience...
so much freedom today
downwoading apache maven and git for windows
I'm crying bbq tears
I said "proper" os
doesnt apple do that w icloud lol
yep
MS in your shit stealing all your Pron
also a fake os
ur desktop and documents are cloud folders
it asks you if you want that
if you click no, it doesn't do that
microsoft asks u if u want onedrive too
I believe Windows does that too
if you're not using TempleOS are you even using a computer
it still installs it, but defo doesnt /use/ it
idk, magma claimed that it does it by default
I'm on windows 11 and also don't have any onedrive enabled
you can toggle it off on a fresh install but the default prompt is allowing it
how to use BlockDisplay or sth like that, I dont have it in my spigot project (1.18.2)
1.19.4+
you can probably safely update to 1.19.4, almost nobody uses versions between 1.18.2 and 1.19.3
yeah well 6.8% on 1.19.2, for whatever reason
I'm trying to make a plugin where you can disable certain enchanted books from appearing in villager trades. Is there a way to go through each possible villager trade and remove them from potentially appearing?
either that, or is there some way to reroll a villager trade if it contains a blacklisted item
listen to VillagerAcquireTradeEvent
and cancel it if the recipe's result is an enchanted book
that just deletes the recipe
I want to reroll it
so you have a higher chance of getting whitelisted enchants
then get the villager's loot table and grab a random other recipe
sth like this should do
@EventHandler
public void onTradeAquire(VillagerAcquireTradeEvent event) {
MerchantRecipe recipe = event.getRecipe();
if(recipe.getResult().getType() != Material.ENCHANTED_BOOK) return;
MerchantRecipe newRecipe = new MerchantRecipe(getRandomLoot(event.getEntity()), recipe.getUses(), recipe.getMaxUses(), recipe.hasExperienceReward(), recipe.getVillagerExperience(), recipe.getPriceMultiplier());
event.setRecipe(newRecipe);
}
public static ItemStack getRandomLoot(AbstractVillager villager) {
Inventory inv = Bukkit.createInventory(null, 9);
LootTable lootTable = villager.getLootTable();
lootTable.fillInventory(inv, ThreadLocalRandom.current(), new LootContext.Builder(villager.getLocation()).lootedEntity(villager).build());
return inv.getItem(0);
}
that would use the same ingredients so you might wanna change that somehow, idk
also I'm not sure if the LootTable actually consists of the potentional trade results or whether it's just their kill drops
you'll have to try it
yeah that's what I was worried about, let me check
but since there's one loot table per villager type, they prooobably contain the recipe results
otherwise it'd make little sense to have separate loot tables i guess
prolly they forgot to update the jar
and since no plugin cries for an update they just use it as is
but will it work for 1.18.2 and below players? using viaversion
item displays didn't exist in 1.18.2
if that doesn't work you can still get a truly random villager recipe using NMS -> VillagerTrades$ItemListing#getOffer(Entity, RandomSource) and turn that into a bukkit recipe
continue with this after the buildtools part
it installed it into your local maven
hey wait
did you run it with --remapped
oh nvm i thought it made an additional file
carry on
replace it
replace
basically just add the <classifier> part to your dependency
and get rid of api
oh yeah
and remove -api
didnt see that
omg freak me
not really
basically you only needed to run buildtools and adjust the dependency and copy the specialsource part
I think it is the kill drops, because it's only returning null for the new recipe
well then you gotta use NMS i guess
alternatively try LootTables.VILLAGER_<PROFESSION>
np
did you register the listener
why do you keep repeating the mistakes I already told you about yesterday?
you'r enot using the consumer to spawn the entity and you also recreate a new useless random everytime
you also didnt add any debug output at the top of your listener
ooh angry alex!
I'm tired of people asking for help then ignoring every advive
the error is also obvious and you'd have easily found it out yourself by printing out m.getType()
you need to check the event's getNewState() instead
fair enough 
because the block is still AIR when that event is called
also why is the block called "m" and what's "GG" supposed to mean. and the creeper's name is "bz"? why aren't you using proper variable names
what are your thoughts on the bracket formatting alex?
Sometimes you gotta make sure
What if your short eventually grows up and becomes a long one day?
I modded a code base one time that was written in C# and
The dev literally never used proper types for half of it
@EventHandler
public void OnGrow( BlockGrowEvent event) {
Block m = (Block) ((BlockEvent)event).getBlock();
if((((Material)((Block)m).getType()) == (Material) Material.BAMBOO)) {
int $_GG = (int) ((Random)new Random()).nextInt((int)200);
if ((int)$_GG >= (int)1) {
Bukkit.broadcastMessage(((String)(CharSequence)"FUNCA"));
Creeper asd = (Creeper)((World)((Block)m).getWorld()).spawnEntity(m.getLocation().add((double)0.0D, (double)1.0D, (double)0.0D), (EntityType) EntityType.CREEPER);
asd.setCustomName(ChatColor.translateAlternateColorCodes((char)'&', (String)"&a&lLeave Creeper"));
asd.setSilent((boolean)true);
asd.addPotionEffect((PotionEffect) new PotionEffect((PotionEffectType) PotionEffectType.SLOW_FALLING, (int) 39999600, (int) 0));
asd.addPotionEffect((PotionEffect) new PotionEffect((PotionEffectType) PotionEffectType.INVISIBILITY, (int) 20*20, (int) 1));
}
}
}
did I miss anything?
He just used the any type everywhere and casted to the type he wanted
Oh this code is just wonderful
you forgot to cast the BlockGrowEvent
Oh, true
mb
fixed it, i casted it to BlockEvent
aint no point in casting it to the specific event type
The fucking (Random) new Random() is so silly oml
personally this is my favorite (String)(CharSequence)"FUNCA"
Hey you never know what constructing a class will return
Yeah the JVM might just spit out the wrong type eventually
And actually you should probably just make extra sure you're using the right type by casting twice, since the cast could give you the wrong type too
all caps method name
public class BambooGrowListener implements Listener {
private final Random random = new Random();
@EventHandler
public void spawnCreeperOnBambooGrow(BlockGrowEvent event) {
if (event.getNewState().getType() != Material.BAMBOO) {
return;
}
int chance = random.nextInt(200);
if (chance < 1) {
return;
}
Location location = event.getBlock().getLocation().add(0.0, 1.0, 0.0);
location.getWorld().spawn(location, Creeper.class, CreatureSpawnEvent.SpawnReason.CUSTOM, creeper -> {
creeper.setCustomName(ChatColor.translateAlternateColorCodes('&', "&a&lLeave Creeper"));
creeper.setSilent(true);
creeper.addPotionEffect(new PotionEffect(PotionEffectType.SLOW_FALLING, 39999600, 0));
creeper.addPotionEffect(new PotionEffect(PotionEffectType.INVISIBILITY, 20 * 20, 1));
});
}
}
I couldn't go to bed without sending the proper version
idk why it didnt copy the new lines properly
C# programmer detected
so me so true so real
love c#
been programming in it
Oh no
making games in it is so much fun
its crazy its like when i code in java i hate my life and i have the opposite of fun
when i code in c# i have fun doing it
Is anyone available to help me in vocal that I'm not good at writing in English?
Oh yeah I can relate to hating your life when coding Java
This isn't really the server for that
๐ฅฒ
Honestly I can't remember a time when I had fun coding.
It's always closer to
relief
Anyway so yeah hah funni coffee language
maybe kotlin would be better but it scares me
Run.
I need to check only a piece of the name of a luckperms group
You've mentioned Kotlin, they're coming for you.
i have a little question. how can i get NoClassDefFoundError to class i had never used ๐
can you send the entire stack trace
you haven't remapped your .jar
the whole error
?nms
Don't you know that the people in this server will shove sticks up their asses if you do so much as mention either Kotlin or Rust?
^
lol
i love rust despite having used it like once and not doing any actual projects in it
i did
but its great i love it
no you have not
@whole surge are you using special source
[22:14:39] [Thread-26/WARN]: Caused by: java.lang.NoClassDefFoundError: net/minecraft/world/level/ItemLike
[22:14:39] [Thread-26/WARN]: at MineA4.jar//su.haku.quinowell.player.CanvasSection.<init>(CanvasSection.java:36)
[22:14:39] [Thread-26/WARN]: at MineA4.jar//su.haku.quinowell.player.VideoFrame.<init>(VideoFrame.java:31)
[22:14:39] [Thread-26/WARN]: at MineA4.jar//su.haku.quinowell.render.RenderWorker.call(RenderWorker.java:24)
[22:14:39] [Thread-26/WARN]: at MineA4.jar//su.haku.quinowell.render.RenderWorker.call(RenderWorker.java:11)
[22:14:39] [Thread-26/WARN]: at java.base/java.util.concurrent.FutureTask.run(FutureTask.java:264)
[22:14:39] [Thread-26/WARN]: at java.base/java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:539)
[22:14:39] [Thread-26/WARN]: at java.base/java.util.concurrent.FutureTask.run(FutureTask.java:264)
[22:14:39] [Thread-26/WARN]: at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1136)
[22:14:39] [Thread-26/WARN]: at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:635)
[22:14:39] [Thread-26/WARN]: ... 1 more
[22:14:39] [Thread-26/WARN]: Caused by: java.lang.ClassNotFoundException: net.minecraft.world.level.ItemLike
[22:14:39] [Thread-26/WARN]: at org.bukkit.plugin.java.PluginClassLoader.loadClass0(PluginClassLoader.java:185)
[22:14:39] [Thread-26/WARN]: at org.bukkit.plugin.java.PluginClassLoader.loadClass(PluginClassLoader.java:152)
[22:14:39] [Thread-26/WARN]: at java.base/java.lang.ClassLoader.loadClass(ClassLoader.java:520)
[22:14:39] [Thread-26/WARN]: ... 10 more```
you have NOT remapped your .jar
I was working on an operating system in Rust (https://github.com/maow-tty/tokyo) and it was actually pretty nice.
oh yea you sent that a while ago
?nms
^
I would check only the first part of the group name for example:
LSPDAGENT I want to check only if there is lspd
seems very cool
But yeah so things to note about Kotlin
It's not that similar to Java
It introduces a lot of its own unique concepts as it's very focused on syntactic sugar
you are right. thanks...
If there were a programming language spectrum, you'd have one side that's all about imperative paradigms and explicit logic (Assembly)
And the other side would be declarative and implicit logic (Kotlin)
- The type system functions differently to Java in a number of ways (generics work differently, companion objects, objects, receiver types)
- There are certain convenience features that are actually pretty nice, i.e. type aliasing, import aliasing, extension methods, top-level functions.
- It does not run as fast as regular Java, you are sacrificing a bit of performance for (subjective) comfort, the Kotlin stdlib, and multi-platform (Native, JS, and JVM).
- Kotlin is very focused around DSLs (domain-specific languages, i.e. APIs that look like their own programming languages) and functional programming.
- This is actually the main reason why it's the language of choice for Android. It allows you to declare UIs in code using a much more eloquent API.
Generally speaking, it's actually pretty nice to code in. I'd recommend you read the online docs rather than go through Koans though.
it's obvious because your stacktrace refers to ItemLike which is a mojang mapped class name, while the spigot-mapped name would be IMaterial
Oh yeah also there's coroutines, that's pretty neat.
I would check only the first part of the group name for example:
LSPDAGENT I want to check only if there is lspd
Please help me I want to sleep 
substring, contains, startsWith, ...
an example ? :D
if("asd".startsWith("a")) {
// "asd" starts with "a"
love you
I ship it
This is pretty much why I had originally left. Got sick of hearing an undetailed "Kotlin bad" or "Rust bad" every single time I brought up either language.
I get it, you give blowjobs to Duke on a daily basis. Not my business, let me like the languages I like.
Latin is pretty cool
Theres a latin Wikipedia
I'm gonna get called a weeb for this but I've always been more partial to East Asian languages lol
Japanese is fascinating linguistically
Hello Guys, if i compile my Bukkit Plugin i've got this error:
[ERROR]
[ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch.
[ERROR] Re-run Maven using the -X switch to enable full debug logging.```
if i re-run the BuildTool ``java -jar BuildTools.jar --rev 1.20.1``, it works. So if i restart my IDE it no longer works, how to fix it?
To see the full stack trace of the errors, re-run Maven with the -e switch.
then ?paste it
or just use -X
mvn clean package -X
firstly: i haven't used this ItemLike
well. i remapped it and it still can't find some crap
you still ahven't remapped it properly
you are now mapping it to obfuscated mappings
`nms
?nms
do it like there ^
you are supposed to use the .jar that's simply called "YourPlugin-Version.jar" and not "YourPlugin-Version-remapped-obf.jar" or anything
ะฐะฐะฐะฐะฐะฐ ะฑะปั
the remapped-obf .jar is basically an interim stage - first it takes your mojang mapped .jar, then remaps it to obfuscated mappings (the remapped-obf.jar) and then remaps that again to spigot mappings. In the default specialsource config (the one from my blog post, which is also found in the spigot 1.17 announcement) the spigot-mapped .jar will replace your original mojang mapped .jar, so yeah it's just MyPlugin-1.0.jar
then you haven't run buildtools for 1.18.2 with the --remapped flag
then why did you use the 1.18.2 mappings?
a bit magic and it's working. Thank you very much
ufghhhhhhh
https://paste.md-5.net/gequruwina.java <-sql management
why is this happeninggg
because you just insert another row
your original table looked like this:
| UUID | Lang |
|------|------|
| 1234 | en |
and now it looks like this
| UUID | Lang |
|------|------|
| 1234 | en |
| 1234 | hi |
can I drop all of them btw?
DELETE FROM Tablename WHERE UUID = ?
to insert OR change you do INSERT INTO ... ON DUPLICATE KEY UPDATE
that requires having the UUID column as primary key
INSERT INTO Tablename (UUID, Lang) VALUES (?, ?) ON DUPLICATE KEY UPDATE Lang=?
but as said, your table must have the primary key set to the uuid column
btw you should think about using consistent column names
CREATE TABLE IF NOT EXISTS `Tablename` (
`uuid` VARCHAR(36) NOT NULL,
`language` VARCHAR(2) DEFAULT NULL,
PRIMARY KEY (`uuid`)
);
idk what you're talking about
are you trying to create a fake player or what?
if so have you even sent the packets to the online players?
which packet?
i guess you have to send the AddPlayerPacket first
and then the other one
?
i guess you have to send the AddPlayerPacket first
and then the other one
no
Have you taken a look at the login sequence on wiki.vg?
It should help at least somewhat.
While you don't need to emulate the actual login (i.e. authentication and compression and such - which isn't even possible since those include C2S packets), there is a bit more to it than just sending a player info packet afaik.
Actually I might be mistaken.
Looking at wiki.vg suggests it's Player Info Update -> Spawn Player
does it show up in chat?
the name
does the name of the player show up in chat's tabcomplete?
wdym "the player who run the command"?
and I meant the name of the player you added
not who ran the command
it's obvious that an actual online palyer shows up there
Their Protocol page details all the fields and requirements for packets.
except the proper name of that packet lol
Eh it's usually not too far off from the proper name
then how do you expect them to show up in the tab list if you didnt give them any name?
Something to note is that they've existed longer than Mojmap has
yeah but why don't they at least add the proper name now that it's available
Laziness?
idk which packets are needed for the tab list
I'm quite stumped. Essentially I have a system in which I send tasks to the main thread to be queued (I need chunksnapshots which can not be created asynchronously. I essentially halt the main process of my scheduler until I recieve ALL ChunkSnapshots back (These chunk snapshots run separate calculation tasks so computing time isn't wasted while waiting). Once all tasks are processed on the main thread my code should start working again. However, it only does 'sometimes'
https://paste.md-5.net/otedigotan.cs
Essentially if I uncomment the System.out.println(workers.size() + " | " + chunkPositionMap.size()); inside of my while loop (a debug used to check and make sure all workers are recieved) my code processes as normally, however as soon as I comment this debug, it stops processing and never proceeds on past the while loop (ending in an infinite loop. Now I was a bit curious why this would happen so I took a look at the recompiled jar code when the sysout is commented and nothing seems out of ordinary https://paste.md-5.net/fuzosopina.cs. I'm confused beyond belief and would want to know a somewhat technical reason why this occurs
Problem solved, instead of using a while loop to manage task collection I used CountDownLatch from java.util.concurrent and used CountDownLatch#await. In the main thread tasks after retrieving and adding the worker to my list of workers I called CountDownLatch#countDown
That would indicate a syncronization issue
Im rather unsure if cdl is the best choice here
ah I see
change your map type and iterate instead of a for loop
A ConcurrentSkipListMap would work well for you
as you are doing it all async its slow access won;t be anissue
I'm guessing your issue is your async thread is trying to start work before the main thread has finished accessing your Map causing the locked thread. the sysout is just enough to delay it and allow it to be released
using an iterator and a skipList will solve that
hello team.
I have a plugin which uses an sqlite database... just wondering if this design setup will cause issues on a big scale of things and if there is a better way to go about this.
@EventHandler
public void onPlayerHit(EntityDamageByEntityEvent event) {
if (!(event.getDamager() instanceof Player)) return;
if (!(event.getEntity() instanceof Player)) return;
Player attacker = (Player) event.getDamager();
Player victim = (Player) event.getEntity();
Optional<String> attackerGang = gangAPI.getPlayerGangName(attacker.getUniqueId().toString());
Optional<String> victimGang = gangAPI.getPlayerGangName(victim.getUniqueId().toString());
if (attackerGang.isPresent() && victimGang.isPresent()) {
if (attackerGang.get().equals(victimGang.get()) && !attackerGang.get().equals("Wilderness")) {
event.setCancelled(true);
attacker.sendMessage(Msg.color("&eYou cannot hurt&c " + victim.getName()));
}//if
}//if
}//onPlayerHit
gangAPI.getPlayerGangName
public Optional<String> getPlayerGangName(String uuid) {
Optional<String> answer;
try(Connection conn = DriverManager.getConnection(gangDatabase.getPath());
PreparedStatement statement = conn.prepareStatement(
"SELECT gang_name FROM players WHERE uuid = ?;"
)
) {
statement.setString(1, uuid);
ResultSet resultSet = statement.executeQuery();
if (resultSet.next()) {
answer = Optional.ofNullable(resultSet.getString("gang_name"));
}//if
else {
answer = Optional.empty();
}//else
}//try
catch (SQLException e) {
answer = Optional.empty();
}//catch
return answer;
}//getPlayerGangName
Is it bad to send a query like that every time a player gets hit by another player?
cache gangs, don;t query live
but wat about my memowy :(
it doesnt use much, store only necessary informations not ResultSet or anything
ik I'm joking
adding this on his is rip to perfomrance
yea but if he wanted to add this on hit he could believe in losing memory xd
quereing every time you need data is like the ultimate way to kill performance on top of that they're using Optional which does no service to both CPU and Memory performance
Optional in java is super slow
streams too
streams aren't bad compared to optional tbh. Streams have good performance once warmed up
worse performance compared to for loop
Optional is just a useless wrapper for a null check
I can see its use in API design, but not internally
it doesnt do much but shouldnt be used in hot code or similar
not really
if anything the memory footprint is marginally larger, but unless you are running with -Xint the performance difference is actually negligible
unless you are insane like mojang and you like to run them in very hot spots l m a o
[02:12:38 INFO]: [com.zaxxer.hikari.HikariDataSource] Players-Connection-Pool - Starting...
[02:12:38 INFO]: [com.zaxxer.hikari.HikariDataSource] Players-Connection-Pool - Start completed.
Can I remove this message?
ThrownPotion has no setBasePotionData() method
The PotionMeta of the ItemStack you're setting via #setItem() would though
how can i check if my json file is empty?
Two options, depends on how you want to define "empty". If you just want {}, then parse the JSON and check if the json object has any keys. If you want to check the there are no characters in the file, read the file's contents as a string, check if isEmpty() (or isBlank(), whichever you want), do what you want, then parse that string into JSON
I mean I don't rly have any objects to parse other than gson and file
I can just to file.toString().isEmpty()?
Well, no, because a File object's #toString() doesn't return the contents of the file
yeah
You'll have to read the contents with a buffered reader
thats what i thought aswel
You can Google about file reading. It's just regular Java there
I can just use an inputstreamer
Lots of articles on it
i guess