#help-development
1 messages · Page 1594 of 1
how would i go about making a balance for the player?
ive made a balance hashmap
but how should i store the keys?
UUID, Double
^
should i create a key when players join?
^ either use pdc or store it in a yaml or db
i reccommend the first way more than the latter
ah ok
?pdc
but how/when should i make keys for the persistentdatacontainer?
if it doesnt exist when they join
is it fine if i make one each time a new player joins
^
read this
mhm
they are very cool
indeed
anyone know how to fix this com.zaxxer.hikari.pool.HikariPool$PoolInitializationException: Failed to initialize pool: Cannot load connection class because of underlying exception: 'java.lang.NumberFormatException: For input string: "3306:3306"'.
What do you mean 3,0 & 6 are all numbers 
hey, has anyone worked with the jda in bungeecord?
ye
the entire string isnt a valid number tho
Yeah… it was a joke…
how can I register a class with a ListenerAdapter in OnEnable?
from jda?
ye
Caused by: java.sql.SQLException: Unknown initial character set index '255' received from server. Initial client character set can be forced via the 'characterEncoding' property.
the racist was finally banned!
the racist? i'm pretty sure that was a random pfp for another alt
discord mods at their finest
yep
This
yeah, quite sad.
doing nothing about racism
and all other isms too
bruh
he deleted it
probably md5 lurking
they don't want shit
Nah bet it was imagine or conclure
for not doing shit about racism
was unsure if that was nnyak
Eyyyyyyy
😐
but the reply confirms it
Anyways, back to #general
anyways his behavior in this channel would get him banned nonetheless, red the dialogue
🔴
How could I store temporary meta data (until server is rebooted) inside of a block when a user places it?
I mean you could map the location to the data
I just want to store the data temporarily, not long term. Was looking for a situation using meta data to store the information on the block itself
what is temporarily?
From the time it is placed until the server is rebooted
transient?
Cause temporarily to me means memory
oh so weak data
Correct
yeah well is this any type of block?
who said i was a person?
rebooted, including reloads?
So just store it in a hashmap or something lmao
Yeah, when the player places the block I would like to tag it
metadata
INSERT INTO `kitCooldown`(`UUID`, `Name') VALUES (\"%s\", \"%s\")", player.getUniqueId().toString(), player.getName()) I got this right how come it's not actually being showed in my sql database?
That's what I initially had in mind, just unsure of how to do it
use an actual prepared statement
True
I AM
you’re not
``` PreparedStatement psa = conn.prepareStatement(String.format("INSERT INTO kitCooldown(UUID, `Name') VALUES ("%s", "%s")", player.getUniqueId().toString(), player.getName()));
Second
that’s a format string
Shit
well imagine metadata would only be possible for tile entities
use the PS properly
why
remove “%s” and replace it with ?, you can replace r those placeholders with PreparedStarament#setString etc
don’t use a format string
also it seems like you’re trying to insert into 4 columns, but have only given 2
no
why would I replace it with ?
If I was gonna use ? wouldn't I need String.format
i wish to learn how to detect player open their own inventory
all i think accept that is
runnable check
for opened inventory
so server doesn't tell if a player inventory is open right?
woaw that sucks
how would i make the "hack"
so setString(0, player.getUniqueId().toString()
prepared statements start from index 1
I have a problem with my plugin my server keeps saying this ```
?paste show code
put I don't have a null or anything in my EntityDeathEvent ```public void onDeathEntity(EntityDeathEvent e) {
if(e.getEntity().getKiller().equals(EntityType.PLAYER)) {
e.getEntity().getWorld().dropItem(e.getEntity().getLocation(), new ItemStack(rmats, im));
}
}
whats in rmd.java line 57
this java if(e.getEntity().getKiller().equals(EntityType.PLAYER)) {
did I do this correct ```java
PreparedStatement psa = conn.prepareStatement(String.format("INSERT INTO kitCooldown(UUID, `Name') VALUES ("?", "?")"));
psa.setString(1, player.getUniqueId().toString());
psa.setString(2, player.getName());
Can anyone help me, I'm trying to get a value from config.yml, but it always gives an error, what can I do?
I do know java just spigot is new to me
rg.bukkit.command.CommandException: Unhandled exception executing command 'spawn' in plugin Tutorial v1.0
at org.bukkit.command.PluginCommand.execute(PluginCommand.java:46) ~[spigot.jar:git-Spigot-c3c767f-33d5de3]
at org.bukkit.command.SimpleCommandMap.dispatch(SimpleCommandMap.java:141) ~[spigot.jar:git-Spigot-c3c767f-33d5de3]
at org.bukkit.craftbukkit.v1_8_R1.CraftServer.dispatchCommand(CraftServer.java:646) ~[spigot.jar:git-Spigot-c3c767f-33d5de3]
at net.minecraft.server.v1_8_R1.PlayerConnection.handleCommand(PlayerConnection.java:1115) [spigot.jar:git-Spigot-c3c767f-33d5de3]
at net.minecraft.server.v1_8_R1.PlayerConnection.a(PlayerConnection.java:950) [spigot.jar:git-Spigot-c3c767f-33d5de3]
at net.minecraft.server.v1_8_R1.PacketPlayInChat.a(PacketPlayInChat.java:26) [spigot.jar:git-Spigot-c3c767f-33d5de3]
at net.minecraft.server.v1_8_R1.PacketPlayInChat.a(PacketPlayInChat.java:53) [spigot.jar:git-Spigot-c3c767f-33d5de3]
at net.minecraft.server.v1_8_R1.PacketHandleTask.run(SourceFile:13) [spigot.jar:git-Spigot-c3c767f-33d5de3]
at java.util.concurrent.Executors$RunnableAdapter.call(Unknown Source) [?:1.8.0_301]
at java.util.concurrent.FutureTask.run(Unknown Source) [?:1.8.0_301]
at net.minecraft.server.v1_8_R1.MinecraftServer.z(MinecraftServer.java:696) [spigot.jar:git-Spigot-c3c767f-33d5de3]
at net.minecraft.server.v1_8_R1.DedicatedServer.z(DedicatedServer.java:316) [spigot.jar:git-Spigot-c3c767f-33d5de3]
at net.minecraft.server.v1_8_R1.MinecraftServer.y(MinecraftServer.java:634) [spigot.jar:git-Spigot-c3c767f-33d5de3]
at net.minecraft.server.v1_8_R1.MinecraftServer.run(MinecraftServer.java:537) [spigot.jar:git-Spigot-c3c767f-33d5de3]
there's more, but I can't send
at java.lang.Thread.run(Unknown Source) [?:1.8.0_301]
Caused by: java.lang.IllegalArgumentException: Plugin already initialized!
at org.bukkit.plugin.java.PluginClassLoader.initialize(PluginClassLoader.java:122) ~[spigot.jar:git-Spigot-c3c767f-33d5de3]
at org.bukkit.plugin.java.JavaPlugin.<init>(JavaPlugin.java:66) ~[spigot.jar:git-Spigot-c3c767f-33d5de3]
at net.diego.tutorial.ConfigGenerator.<init>(ConfigGenerator.java:6) ~[?:?]
at net.diego.commands.spawn.SpawnCommand.onCommand(SpawnCommand.java:18) ~[?:?]
at org.bukkit.command.PluginCommand.execute(PluginCommand.java:44) ~[spigot.jar:git-Spigot-c3c767f-33d5de3]
... 14 more
Caused by: java.lang.IllegalStateException: Initial initialization
at org.bukkit.plugin.java.PluginClassLoader.initialize(PluginClassLoader.java:125) ~[spigot.jar:git-Spigot-c3c767f-33d5de3]
at org.bukkit.plugin.java.JavaPlugin.<init>(JavaPlugin.java:66) ~[spigot.jar:git-Spigot-c3c767f-33d5de3]
at net.diego.tutorial.Main.<init>(Main.java:13) ~[?:?]
at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method) ~[?:1.8.0_301]
at sun.reflect.NativeConstructorAccessorImpl.newInstance(Unknown Source) ~[?:1.8.0_301]
at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(Unknown Source) ~[?:1.8.0_301]
at java.lang.reflect.Constructor.newInstance(Unknown Source) ~[?:1.8.0_301]
at java.lang.Class.newInstance(Unknown Source) ~[?:1.8.0_301]
at org.bukkit.plugin.java.PluginClassLoader.<init>(PluginClassLoader.java:76) ~[spigot.jar:git-Spigot-c3c767f-33d5de3]
at org.bukkit.plugin.java.JavaPluginLoader.loadPlugin(JavaPluginLoader.java:131) ~[spigot.jar:git-Spigot-c3c767f-33d5de3]
at org.bukkit.plugin.SimplePluginManager.loadPlugin(SimplePluginManager.java:329) ~[spigot.jar:git-Spigot-c3c767f-33d5de3]
at org.bukkit.plugin.SimplePluginManager.loadPlugins(SimplePluginManager.java:251) ~[spigot.jar:git-Spigot-c3c767f-33d5de3]
at org.bukkit.craftbukkit.v1_8_R1.CraftServer.loadPlugins(CraftServer.java:291) ~[spigot.jar:git-Spigot-c3c767f-33d5de3]
at org.bukkit.craftbukkit.v1_8_R1.CraftServer.reload(CraftServer.java:744) ~[spigot.jar:git-Spigot-c3c767f-33d5de3]
at org.bukkit.Bukkit.reload(Bukkit.java:534) ~[spigot.jar:git-Spigot-c3c767f-33d5de3]
at org.bukkit.command.defaults.ReloadCommand.execute(ReloadCommand.java:25) ~[spigot.jar:git-Spigot-c3c767f-33d5de3]
at org.bukkit.command.SimpleCommandMap.dispatch(SimpleCommandMap.java:141) ~[spigot.jar:git-Spigot-c3c767f-33d5de3]
at org.bukkit.craftbukkit.v1_8_R1.CraftServer.dispatchCommand(CraftServer.java:646) ~[spigot.jar:git-Spigot-c3c767f-33d5de3]
at org.bukkit.craftbukkit.v1_8_R1.CraftServer.dispatchServerCommand(CraftServer.java:632) ~[spigot.jar:git-Spigot-c3c767f-33d5de3]
at net.minecraft.server.v1_8_R1.DedicatedServer.aM(DedicatedServer.java:353) ~[spigot.jar:git-Spigot-c3c767f-33d5de3]
at net.minecraft.server.v1_8_R1.DedicatedServer.z(DedicatedServer.java:317) ~[spigot.jar:git-Spigot-c3c767f-33d5de3]
... 3 more
I use new to register commands
Nms 1_8_R1 long time no see
no
public class ConfigGenerator extends JavaPlugin{
public String configGetter(String value) {
return getConfig().getString(value);
}
public void worldSetter(String value, World world) {
getConfig().set(value, world);
}
public void coordSetter(String value, double coord) {
getConfig().options().copyDefaults(true);
getConfig().set(value, coord);
}
}
I'm starting today
Would it be interesting to gather all inventories in a single plugin, in a single eventhandler or make each inventory in its respective plugin?
[23:35:20 WARN]: java.sql.SQLException: Parameter index out of range (1 > number of parameters, which is 0).
PreparedStatement psa = conn.prepareStatement(String.format("INSERT INTO `kitCooldown`(`UUID`, `Name') VALUES (?, ?)"));
psa.setString(1, player.getUniqueId().toString());
psa.setString(2, player.getName());
In terms of performance, each plugin would be better for its inventory and eventhandler, or a plugin that works as an api, pulling inventories.
No it's not
How can I get a value from my config.yml?
LMAO monkey retard code
My stuff isn't being saved in the database
it's not even being put it in there
It really is, Its doing absolutely nothing there
hsuh
yes boss
What would a delay code be?
?scheduling
😋
There it is 🙂
uh > [23:42:25 WARN]: java.sql.SQLException: Parameter index out of range (1 > number of parameters, which is 0).
PreparedStatement psa = conn.prepareStatement("INSERT INTO `kitCooldown`(`UUID`, `Name') VALUES (?, ?)");
psa.setString(1, player.getUniqueId().toString());
psa.setString(2, player.getName());
I got it
This error occurs if you dont have enough placeholders in your query
This narrows it down to several thousand possible causes.
O_o
1.17.1 Protocollib achivement detection on achivement open?
Protocollib is complete new for me
declaration: package: org.bukkit.event.player, class: PlayerAdvancementDoneEvent
wdym on achievement open
what would be those causes
...
Ah im dumb
You want him to list several thousand causes???
Yes
but still thats not enough info
you mad man
"Only true programmers can list all the possible causes"
You are actually executing the statement right?
yes
You got the right jdbc driver, right?
um
I don't even have the drivers
If you mean this com.mysql.jdbc.Driver then yes
I'm using Hikari
disclaimer, i have no idea what im talking about
||are you sure that the psa.setString starts at 1 and not 0?||
The user that executes the sql server has the privileges to write to the designated disk, right?
You have the proper login credentials.
The code is actually executed.
No exception is thrown while the code is being executed.
And so on...
SQL placeholders are parsed starting with 1 as the first index
how would i be able to get block materials with a 1.17 plugin in a 1.12 server?
I keep getting
[09:24:46 WARN]: Exception in thread "pool-5-thread-1" java.lang.NoSuchFieldError: SHULKER_BOX
[09:24:46 WARN]: at com.justdoom.flappyanticheat.checks.movement.groundspoof.GroundSpoofA.handle(GroundSpoofA.java:85)
[09:24:46 WARN]: at com.justdoom.flappyanticheat.packet.processor.ReceivingPacketProcessor.lambda$handle$0(ReceivingPacketProcessor.java:16)
[09:24:46 WARN]: at java.util.ArrayList.forEach(Unknown Source)
[09:24:46 WARN]: at com.justdoom.flappyanticheat.packet.processor.ReceivingPacketProcessor.handle(ReceivingPacketProcessor.java:16)
[09:24:46 WARN]: at com.justdoom.flappyanticheat.listener.NetworkListener.lambda$onPacketPlayReceive$0(NetworkListener.java:18)
[09:24:46 WARN]: at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source)
[09:24:46 WARN]: at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
[09:24:46 WARN]: at java.lang.Thread.run(Unknown Source)
yes
line is
if(block.getType() == Material.SHULKER_BOX){
yes
im a pro
Make a version check and then use Material.valueOf()
There is also a plugin that deals with this stuff called XMaterial. Not sure if its being updated.
go to the material class/enum/whatever and then use ide search and type "shulker" ( make sure its not case sensitive search ) and replace ( this is a joke )
lol...
thanks, ill have a look atthe plugin
Btw shulker boxes are colored. So you need to use something like BLUE_SHULKER_BOX
how long do you wait after sending the request? maybe its timing out and u dont wait long enough for a timeout error
Could be anything
ok try waiting like 5 minutes
or if you know the default timeout time, wait that + 30 seconds
How about you provide some proper information about your case and then i will consider giving it a second thought
um
How do I have to get a value in a config.yml?
well
I don't know what else to give you
MySQL returned an empty result set (i.e. zero rows). (Query took 0.0003 seconds.)
The home of Spigot a high performance, no lag customized CraftBukkit Minecraft server API, and BungeeCord, the cloud server proxy.
In this link it is written for me to put plugin.saveDefaultConfig();, but what would be defined in this plugin?
I did do that
it should give the method saveDefaultConfig in that page somewhere, i think
oh ok
Inserts dont fetch any information like selects do.
To check if something was written to the DB you should either do it by code (select query) or log into your db and print the table
so
And make sure you actually have a table with that name
I think the table names are also case sensitive. So make sure they match up.
They do
Then everything should be fine
Does your db run in a container?
yea it works
And pls send the whole method that contains your prepared statement
Connection conn = Core.getInstance().getData().getConnection();
PreparedStatement psa = conn.prepareStatement("INSERT INTO kitCooldown(UUID, Name, Time, Kit) VALUES (?, ?, ?, ?)");
psa.setString(1, player.getUniqueId().toString());
psa.setString(2, player.getName());
psa.setInt(3, 1);
psa.setString(4, "p");
conn.close();
psa.close();
You dont even execute the statement. You just prepare and then close the connection.
It's in a command
So?
when you close the connection you lose the PS
You send nothing to the database. You prepare a nice statement and then you dont send it to the DB.
so uh
psa.executeUpdate();
Before you close the connection
If you would have sent the whole code before you could have spared me all the guessing -.-
When you're trying to test enderman stealing blocks and non of them are even bothering to steal them 🤦
it has to be above them i think
not ground level
Yeap just read it lol
Oh look at that it works
Can using a function to add hexadecimal color support often generate lag?
wait if I store something in a hashmap and restart the "Server" will it still be there?
no
Ok that's what I thought
you got to store it in a file or database
No. Thats saved to memory not disk
speed up tricks?
Read above
yes i see
How do I use the world variable in config.yml?
For example, I previously defined in config.yml the world by Location, how can I use this world in location
Main.plugin.getConfig().set("spawn.world", p.getLocation().getWorld().getName());
it was defined as world
Bukkit.getWorld(String)
World w = Bukkit.getWorld(String);
thanks
tip
if you want to make mutiple locations in one word you could do just as exemple
Worlds . WorldName . Number or name (id) . X
Worlds . WorldName . Number or name (id). Y
Worlds . WorldName . Number or name (id). Z
Tha fk is "Discord Helper" and why does imaginedev qualify for it (jk)
you're mean
Just was wondering what happened here while i was gone for a month or so ^^
Discord helpers, uh well not much really
Btw if you dont need to parse user input then worlds should be serialized using their UUID instead of their name
tomorrow i will try to figure more about achievement check "hack" for inventory open
bye bye to all the great helpers here there is enjoying their time! 
Interesting idea. Pls share then.
got the idea from some guy who send me it
it was on spigot forum
what
sleep deprived
i was more confused on the first sentence lol, what are you going to make?
PlayerOpenInventory Check
oh to see when a player opens achievement gui?
oh that
Im pretty sure i saw it somewhere else, i will send you the link if i can find it, is it ok to ping if i find it?
i wish that i could copy it XD
i'm unfamiler to it
ProtocolLibrary.getProtocolManager().addPacketListener(new PacketAdapter(YOUR_PLUGIN_HERE, PacketType.Play.Client.CLIENT_COMMAND){
@Override
public void onPacketReceiving(PacketEvent event){
if(event.getPacket().getClientCommands().read(0) == EnumWrappers.ClientCommand.OPEN_INVENTORY_ACHIEVEMENT){
Player player = event.getPlayer();
//Do something
}
}
});
this?
it gonna be challenge to learn wtihout no previus knowledge
i tried that but it isn't seem to work
my version is 1.17.1
which part doesnt work? not firing?
all i need is to check openned
ok but which part does not work
does the code not get called
ie. that statement is never satisfied
if you are developing with hacks in mind there is more to worry about, and its not just hacks but anything that optimizes network might do this
it won't import
if you have a better option send it
what wont import
and most of the code is just red in my ecplise
if you have a better option send it
i think you imported protocollib incorrectly...
do you use maven or gradle
then dont complain about them you already warned us once thats enough
i used external jar
its not pointless
it will work
so literally every fucking person uses a hacked client. good to know
you are incorrect. literally incorrect. thats all i have to say
im 99% sure what he meant is that he was making hacky code to do it
do you use maven or gradle
right now for this project (this plugin) what do you use
my idea is to check for PlayeropenIventory place fake Item using packet to cleint
place a book in off hand
ok but are you using maven?
like in the shield slot
do you have a maven.xml
yes
do you have these lines of code in it:
<repository>
<id>dmulloy2-repo</id>
<url>https://repo.dmulloy2.net/repository/public/</url>
</repository>
<dependency>
<groupId>com.comphenix.protocol</groupId>
<artifactId>ProtocolLib</artifactId>
<version>4.6.0</version>
</dependency>
@round finch
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 https://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>spigot</groupId>
<artifactId>spigotmc</artifactId>
<version>0.0.1-SNAPSHOT</version>
<repositories>
<!-- This adds the Spigot Maven repository to the build -->
<repository>
<id>spigot-repo</id>
<url>https://hub.spigotmc.org/nexus/content/repositories/snapshots/</url>
</repository>
</repositories>
<dependencies>
<!--This adds the Spigot API artifact to the build -->
<dependency>
<groupId>org.spigotmc</groupId>
<artifactId>spigot-api</artifactId>
<version>1.17.1-R0.1-SNAPSHOT</version>
<scope>provided</scope>
</dependency>
</dependencies>
</project>
yes
ok so add these
to the respective places
ill spoonfeed
if needed
if not needed, then reload your maven xml
and see if the errors persist
😉 yes please wink wink
ok
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 https://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>spigot</groupId>
<artifactId>spigotmc</artifactId>
<version>0.0.1-SNAPSHOT</version>
<repositories>
<!-- This adds the Spigot Maven repository to the build -->
<repository>
<id>spigot-repo</id>
<url>https://hub.spigotmc.org/nexus/content/repositories/snapshots/</url>
</repository>
<repository>
<id>dmulloy2-repo</id>
<url>https://repo.dmulloy2.net/repository/public/</url>
</repository>
</repositories>
<dependencies>
<!--This adds the Spigot API artifact to the build -->
<dependency>
<groupId>org.spigotmc</groupId>
<artifactId>spigot-api</artifactId>
<version>1.17.1-R0.1-SNAPSHOT</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>com.comphenix.protocol</groupId>
<artifactId>ProtocolLib</artifactId>
<version>4.6.0</version>
<scope>provided</scope>
</dependency>
</dependencies>
</project>
spoonfeeding a pom is not spoonfeeding, its just pure laziness
ik the indents are completely fucked, just reformat the code if u want those fixed
aka spoonfeeding++
after putting this reload your maven config @round finch
well yes i think, i dont use eclipse
is there something like PreparedStatement#getString
cant you check the javadocs?
no changes
ok did u get any errors while reloading the maven config
nope no errors
You need to update the project configuration manually. Project -> Maven -> Update Configuration
Also set checkbox: Update Project Configuration from pom
this is how you should upate the config apparently
Is ResultSet reliable?
just successfull build
do this please @round finch
Yes
still same thing
the protocollib stuff is all red?
yes
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 https://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>spigot</groupId>
<artifactId>spigotmc</artifactId>
<version>0.0.1-SNAPSHOT</version>
<repositories>
<!-- This adds the Spigot Maven repository to the build -->
<repository>
<id>spigot-repo</id>
<url>https://hub.spigotmc.org/nexus/content/repositories/snapshots/</url>
</repository>
<repository>
<id>dmulloy2-repo</id>
<url>https://repo.dmulloy2.net/repository/public/</url>
</repository>
</repositories>
<dependencies>
<!--This adds the Spigot API artifact to the build -->
<dependency>
<groupId>org.spigotmc</groupId>
<artifactId>spigot-api</artifactId>
<version>1.17.1-R0.1-SNAPSHOT</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>com.comphenix.protocol</groupId>
<artifactId>ProtocolLib</artifactId>
<version>4.6.0</version>
</dependency>
</dependencies>
</project>
ok
is it right?
change the artifactId of protocollib from ProtocolLib to ProtocolLib-API
and then redo #help-development message
and then check again
@round finch ||sorry for putting so many pings im not sure if u see the messages and i dont really have patience to wait like 10 minutes ||
it is all okay 
[ERROR] Failed to execute goal on project spigotmc: Could not resolve dependencies for project spigot:spigotmc:jar:0.0.1-SNAPSHOT: com.comphenix.protocol:ProtocolLib-API:jar:4.6.0 was not found in https://hub.spigotmc.org/nexus/content/repositories/snapshots/ during a previous attempt. This failure was cached in the local repository and resolution is not reattempted until the update interval of spigot-repo has elapsed or updates are forced -> [Help 1]
[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.
[ERROR]
[ERROR] For more information about the errors and possible solutions, please read the following articles:
[ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/DependencyResolutionException
@blazing lintel
h u h
oh
its cached
wait hold on what
oh
force updates
i think you can click [help 1] so maybe there is steps there to force updates
Failed to execute goal on project itsvollx: Could not resolve dependencies for project itsvollx:itsvollx:jar:0.0.1-SNAPSHOT: com.comphenix.protocol:ProtocolLib-API:jar:4.6.0 was not found in https://hub.spigotmc.org/nexus/content/repositories/snapshots/ during a previous attempt. This failure was cached in the local repository and resolution is not reattempted until the update interval of spigot-repo has elapsed or updates are forced -> [Help 1]
dafug
well idk anything about eclipse so i cant help that much at this point
but do this and try again
added scope
<dependency>
<groupId>com.comphenix.protocol</groupId>
<artifactId>ProtocolLib-API</artifactId>
<version>4.6.0</version>
<scope>provided</scope>
</dependency>
the -U switch will tell maven to force updates
otherwise maven won’t try to resolve the dependency again until tomorrow
what sql type would I use for a Long
BIGINT
don’t reload lol

close inventory on reload?
executeQuery still executes it correct?
if it is a query yes
ok
save the last inventory to a map
if they interact with the inventory close it
What's the max parameterIndex you can have
as many parameters you have in your statement?
hm ok
Is it recommended to do this ```java
if (result.getString("UUID") == null) {
conn.close();
psa.close();
return time = 0;
} else if (result.getString("Cooldown") == null) {
conn.close();
psa.close();
return time = 0;
like closing the connection every statement
ideally you would use a try with resources block, your connections will be auto closed
ok am I going absolutely crazy? new HashSet<Block>(tested) and adding to it will not affect the original Set will it?
try and catch?
no it will have the same objects but it won’t affect the original set at all
try with resources, this is something you can google
Yeah thats what I thought. I must be tired and my logic is failing somewhere 😦
I got it
hey so ive been working on a plugin for a while and all my past versions have worked but i added like two more class files and now whenever i join the server the world refuses to render, the used ram goes wild, the server freezes, and i get timed out. im not doing anything out of the ordinary and im not running any files that have nested loops or anything of that nature. there really is no reason that itd be acting up like this. do yall think i just have a shite pc or do you think im just rarted and that theres an easy fix for this. lmk pls
also just for a little context bc that was quite vague, all i had in earlier versions were custom commands and joining/quitting messages, the newest version has a listener that listens for whenever a player right clicks with a certain item in hand. maybe its something to do with that?
hey how do i make my newly made server public for friends to join
not sure if this is the right channel to ask in since no one is responding to me in #help-server
yes in #help-server
oh thanks i guess
how do i connect a command to an array list
what to you mean by connect?
if you mean arguments, they are provided by the application of CommandExecutor#onCommand(command, sender, label, args) method
like i need to make a command that when i execute it, it shows a list of certain names
@lucid jacinth post code otherwise nobody can help
player.sendMessage(arr.toString())?
import bs goes here
public class PlayerInteractionListener implements Listener {
private Main plugin;
public PlayerInteractionListener(Main plugin) {
this.plugin = plugin;
Bukkit.getPluginManager().registerEvents(this, plugin);
}
@EventHandler
public void onPlayerInteraction(PlayerInteractEvent e) {
Player p = e.getPlayer();
Action act = e.getAction();
if (act.equals(Action.RIGHT_CLICK_AIR) || act.equals(Action.RIGHT_CLICK_BLOCK)) {
Gun gun = new Gun();
if (e.getItem().equals(gun.getGun())) {
Snowball s = p.launchProjectile(Snowball.class);
s.setGravity(false);
}
}
}
}
thats whats prob causing the issue but idk why or how
so I'm getting java java.sql.SQLException: Illegal operation on empty result set here java if (res.getString("UUID") == null) { return time = 0; I was doing some research and it was about using PreparedStatement#next but I don't understand why to use it instead of what I'm doing
uh show the gun class
interesting java.lang.IllegalArgumentException: Direction's magnitude is 0!
direction between two blocks
import bs goes here
public class Gun {
private ItemStack item;
public Gun() {
item = new ItemStack(Material.WOODEN_HOE);
ItemMeta meta = item.getItemMeta();
//modify all metadata
meta.setUnbreakable(true);
meta.setDisplayName("Gun");
}
public ItemStack getGun() {
return item;
}
}
this makes no mathematical sense
none
blocks were definately apart
I'll drop locations all together and work with Blocks and see if it persists
so your previous version without this player interact was fine right
before the gun came into existance right
no i added Gun and the listener at the same time
theyre both additions in the newest version
Hey there!
how can I only allow mobs to avoid players for a certain period of second?
pathfindergoal only can used when it spawn
You can manually set the target of a monster to null, and cancel the target events
Then stop cancelling the events when you want the mobs to be able to target again
Hey how can I use spring boot with spigot. This code doesn't work. I am trying to work with spring JPA to save block changes.
@SpringBootApplication
public class SpaceSaverPlugin extends JavaPlugin {
@Override
public void onEnable() {
getLogger().info("Plugin Enabled");
SpringApplication.run(SpaceSaverPlugin.class, "");
Server server = getServer();
if (server != null) {
server.getPluginManager().registerEvents(new SpaceSaverListener(), this);
}
}
@Override
public void onDisable() {
getLogger().info("Plugin Disabled");
}```
@EventHandler
@Bean
public void onBlockPlace(BlockPlaceEvent event, BlockRepository repository) {
repository.save(new Block(event.getBlock()));
for (Block block : repository.findAll()) {
System.out.println(block.getBlock().toString());
}
}
But I get this when I run runServer
> Main class name has not been configured and it could not be resolved
Oh my god
thanks you! but is there any way to make mob avoid player?
like they scary
As in, run away from?
Oh
No, not directly
Depending on the mob there are things you can do
For example, spawn an invisible cat to scare off creepers
Alternatively you could just push the mobs away from the player
ah thanks you!
With NMS you can modify entity pathfinder goals
You can give them the ai goals to avoid players, but have fun figuring out how to do that
Oh, I didn't know I could change pathfindergoal even after the mob was spawned.
You can
I heard Paper has a pathfinder goal api if you’re maybe using the paper api
I haven’t looked at it myself though
Hello! how can I store data(String) in itemstack?
TMI: we can't use persistantdataconatiner in itemstack (Only in chest,echest, hopper)
Uh, you can put PDC on item stack, well item meta technically.
no, we can't use pdc in itemstack. and I don't want use itemmeta sorry
Why?
What do you need then?
is there any way to store data in itemstack?
pdc occurs error
ItemMeta man, idk why you don't want to use item meta
I don't want to edit lore
or displayname
or encahntment
OH
thanks you
does PersistantDataContainer or MetaData better on mob for optimazation?
depends of course
but i can't really tell because I've never used metadata or pdc on entity.
but honestly it shouldn't make a big of difference
they're both not gonna impact performance at all
thanks you again!
NEW QUEST
how can I set last damager of entity? (for entity#getLastKiller())
getLastDamage you mean?
is there a method for that?
then you need to manually do that
uh
you can listen for
EntityDamageEvent
check if he has totem
if no, cancel the event
get a damaging entity from the player that you want to set the kill to
target that entity to the dying person
and it'll be done
(not ez)
private Object getHandle(Player player) {
try {
Method getHandle = this.getPlayerHandle==null?this.getPlayerHandle = player.getClass().getDeclaredMethod("getHandle", null):this.getPlayerHandle;
// I think this is probably the simplest way to do this?
return getHandle.invoke(player, getHandle);
} catch (Exception e) {
e.printStackTrace();
return null;
}
}
private void setKiller(Player player, Player killer) {
try {
Object playerHandle = getHandle(player);
Object killerHandle = killer == null?null:getHandle(killer);
Field nmsPlayer = this.getPlayerKiller==null?this.getPlayerKiller = playerHandle.getClass().getDeclaredField("killer"):this.getPlayerKiller;
nmsPlayer.set(playerHandle, killerHandle);
} catch (Exception e) {
e.printStackTrace();
}
}
I found this, Thread from bukkit: https://bukkit.org/threads/have-to-set-a-killer.125443/
Hello. I have a problem. I want to set killer of player/entity, but i don't know how.
Example:
@EventHandler
public void...
What? no
thanks you anyway
hm?
Why would you need NMS for that
You can also use Player#damage
oh well, it was picked from the thread
I linked it.
uh huh, pdc is enough for that
Anyone here familiar with hex color with bungee chatcolor api?
its not for bungee tho
and it works for since hex codes per string just doesn't work for multiple per string
Who Looking For A Developer At Survival Minecraft Multiplayer Cracked or Premium DM
Can you disable climbing with twisting vines etc? With datapacks or anything
Could you do this just reverse? https://www.spigotmc.org/threads/wall-climbing.54991/
is there a way to get the friendly name from an EntityType?
Check if the entity is an instance of monster
I know, i am a noob with Developing. I am a beginning Developer. But i have a question! How can i find the path for a yaml?
Anyone know why this has started returning null? Entity e = Bukkit.getEntity(uuid); I use it to delete entities on server start from a list from file. I've confirmed the entities exist, and have same uuids after restart
Are the entities in unloaded chunks?
Yeah, it's on a server start so there's no players loading chunks yet. I've had this working before, but now that I think about it, it may have been in spawn chunks when testing.
More then likely
Could check on ChunkLoadEvent
What's a smart way to do this then? For context, my plugin creates entities that players cannot pickup, and armorstands that cannot be interacted with. It deletes these entities after x number of seconds, but I have a backup for when the server stops/crashes while the entities still exist and want to make sure they get deleted.
Just keep the timers going but only respawn them on chunk load
Would I just be able to do that same check on a chunk load? Would that get intensive if I'm checking for 30+ entities every chunk load?
timers end on restart, it's only ~5 seconds
Uh... kinda. May want to pass the list of entities async
Alright, cheers. Thanks for the help 😄
np
public class CopeCommand implements CommandExecutor {
@Override
public boolean onCommand(CommandSender sender, Command cmd, String label, String[] args) {
if (sender instanceof Player) {
Player player = (Player) sender;
Bukkit.broadcastMessage(player.getName() + " has coped");
return true;
}
// If the player (or console) uses our command correct, we can return true
return true;
}
}
I have built multiple times
and restarted the server
I know, i am a noob with Developing. I am a beginning Developer. But i have a question! How can i find the path for a yaml?
yet the space is missing
is there a way to stop a bukkit runnable runTaskTimer?
What space?
player.getName() + " has coped"
Depending on how you built the runnable...
cancel()
Bukkit.cancelTask(id);
okay thx 😉
^
There is only 1 space in the quotes
I have to add 2?
Only 1 in the code you show
If you recently made the change, make sure you don't have 2 jars sitting in your plugin jar or something.
wdym?
Oh I see what you mean sorry. I had to look at the image again
Only thing I can think of is you aren't restarting your server.
if you didn't have the space the first time, and then went into your code and added it, make sure you have the new version running on your test server. idk how many times I've tried fixing a bug that I had already fixed just because I didnt use the right version
how can i set a taskID to a Runnable?
I did
a couple of times
Show the code of how you create the runnable
int id = Bukkit.getServer().getScheduler().scheduleSyncRepeatingTask(plugin, new Runnable() {
thats how I do it
if you're not doing repeating, change to whatever you're using ofc
@stone sinew i think i know how i try it
I rebuilt added the new one and restarted
a couple of times
change the text completely to something different and see if that change shows up, if not, your newest one isn't going in right. should be a quick n easy test
or you can use a decompiler to look at the code of the jar you're using
had to delete the old build
?paste
is this class right and good? https://paste.md-5.net/mevoxezatu.java
return false is on the outside of his if statement.... but it looks like hes missing opening brackets.
Such as checking what the name of the command is
no i register the command in the main
i have a lost question: what does return true mean in the onCommand method? I think it means that the command is triggered right? and return false means the opposite?
@opal juniper @stone sinew
Return false means that it will send the command usage from teh plugin.yml
ok so how can i add something like "on consume give regen 3"
It tells the api that the command wasn't ran.
and when do i have to use return true? @opal juniper @stone sinew
usually just have your check the command name. But its up to you.
I am making basically a custom permission system to suit my needs. whats a good way to store permissions that the players have?
i register all my commands in my main so i dont have to return true right?
Like jeff said if you don't return true it will output the usage from plugin.yml
oh okay so then it everytime sends the ussage even if the command was correct
can i gen number of online players on disable?
:))
or is there an event that triggers before the event is begining the "stopping" process
Yeah you can do that I suppose.
onDisable called before the player got kicked afaik
yeah, just get the size of the offline players.
you just shouldnt do anything delayed or async
Does anyone know how to get a player's mods on a spigot server using the Custom payloads forge sends?
Ask the author of "HackedServer"
?paste
and send plugin.yml
I guess I'm getting somewhere.. but idk, thanks for the help tho.
delhome:
description: Delete an existing home.
usage: /<command> <name>
aliases: [removehome]
permission: better.warps.del.home.command
/delhome <name> works, but /removehome <name> doesnt
send error
this
the "new" discord feature is for that
have you updated discord in the last 3 months?
you just have to click "expand"
Zoi#0001 definitely regrets to for the most part inform you that unfortunately, they essentially are unable to definitely assist with definitely your enquiry, which essentially is fairly significant. Please simply really ask again later or possibly kind of ask someone else about this enquiry, demonstrating that the person that ran this command generally regrets to kind of inform you that unfortunately, they for the most part are unable to generally assist with actually your enquiry in a subtle way. Thank you very sort of much for kind of your time and the person that ran this command specifically wishes you a really good day, so the person that ran this command really regrets to actually inform you that unfortunately, they literally are unable to definitely assist with very your enquiry, or so they particularly thought.
send code
that wasn't difficult
getCommand("delhome").setExecutor(new DelHomeCommand());
getCommand("delhome").setTabCompleter(new HomeCommandCompletion());
btw im using HomeCommandCompletion twice, is that a problem?
wdym you use it twice?
im using it on the delhome and the home command
cmd
public class DelHomeCommand implements CommandExecutor {
public static String messageNoNameDelHome;
public static String messageHomeDeleted;
@Override
public boolean onCommand(CommandSender sender, Command cmd, String label, String[] args) {
if (!(sender instanceof Player player)) {
sender.sendMessage("[Better Warps] Only a real player can use this command.");
return true;
}
String[] parsedArgs = BetterWarps.parseArgs(args);
if (parsedArgs.length < 1) {
player.sendMessage(messageNoNameDelHome);
return true;
}
String name = parsedArgs[0];
for (int i = 0 ; i < BetterWarps.homes.get(player).size(); i++) {
if (BetterWarps.homes.get(player).get(i).rawName.equalsIgnoreCase(name.replaceAll("§.?", ""))) {
Warp home = BetterWarps.homes.get(player).remove(i);
Database.delHome(player, home);
BetterWarps.initializePlayerHomesInventory(player);
player.sendMessage(messageHomeDeleted);
return true;
}
}
player.sendMessage(BetterWarps.messageHomeDoesNotExistsChat);
return true;
}
}
completion
public class HomeCommandCompletion implements TabCompleter {
@Override
public List<String> onTabComplete(CommandSender sender, Command cmd, String arg, String[] args) {
if (!(sender instanceof Player player)) return new ArrayList<>();
if (args.length == 1) {
return BetterWarps.homes.get(player).stream()
// get all home names without color
.map(home -> home.rawName)
// filter all home names that start with the command argument
.filter(home -> home.startsWith(args[0]))
// add quotes to home names with spaces
.map(home -> home.contains(" ") ? "\"" + home + "\"" : home)
// convert it back to a list
.collect(Collectors.toList());
}
else
return new ArrayList<>();
}
}
now that i think about it, i also need to use the parseArgs thing in the tab competer
cz.thezak.Warps.Utils.Title.getNMSClass(String)" is null
How do servers handle multiple minigames? Do they just load the desired minigame plugin n then unload all the others?
depends
and what is cz.thezak.blabla.etc??
You can do it cross server
or all in one
really depends on how big they are
like if java errors were readable
or maybe you just don't know how to read them :/
Wdym by the term cross server?
across multiple servers
Ah
So if i wanted to play a particular minigame id have the plugin redirect me to a different server?
you can
and then on that server have a plugin for that minigame
no
Is this what mc servers usually do?
Yes
for bedwars
skywars
ect
yes
ok thanks for the help, really appreciated
Oh i see ty
np
np
What is the difference between Player and EntityPlayer
Player is an instance of the player. EntityPlayers is the player entity
declaration: package: org.bukkit.entity, interface: Player
I thought an instance of player would be an entity tho
An instance of player is an instance of the player not just the entity of a "human"
So wb smth like Creeper and EntityCreeper for example
Spigot docs
Btw what exactly is a handle? I see a lot of getHandle functions being used in tutorials
Cant find docs for gethandle
It returns the connection of the object. The data being sent essentially
Ah ok
How can I change the message if somebody dies through another player? PlayerDeathEvent and EntityDamageByEntityEvent don't support this
Oh nvm had EntityDeathEvent and not PlayerDeathEvent
I know, i am a noob with Developing. I am a beginning Developer. But i have a question! How can i find the path for a yaml?
You mean config files?
sure
declaration: package: org.bukkit.configuration, interface: Configuration
hey @eternal oxide dont mean to bother you but did you get anywhere with teh pathfinding? if not i will have a look now
I played with it last night. I got it workgin, but not accurate yet
my algorithm isn;t quite right
just started to look into it again today
oh cool, wdym by not accurate?
occasionally it would not find a path when it should have
does anyone know the development language for bedrock plugins ?
is it like c or something
yeah - it is written in c ++ but afaik it doesn't support plugins
Depends on the server software
Geyser is a spigot plugin the creates a bedrock bridge.
Also has its own bedrock server software.
Thats the only one I know of.
is there a simpler way of scanning for a structure than loading in that area of the world and manually programming a check for every block?
ie
for(int x = start; x <= end; x++){
for(int y...
}
What type of structure? Could use StructureGrowEvent.getBlocks()
custom structures
maybe i should have clarified
sorry
so the answer's no?
i need to manually do it?
yeah. Gotta loop through the blocks some how
how do i read a map from a config.yml file? something like this
some-map:
entry1: value1
entry2: value2
entry3: value3
i stored the map doing config.set("some-map", Map.of("entry1", "value1", "entry2", "value2", ...)), but trying to read it with getMapList("some-map") gives me an error: ClassCastException: class java.util.ArrayList cannot be cast to class java.util.Map (java.util.ArrayList and java.util.Map are in module java.base of loader 'bootstrap')
what is a map list? and why there is no getMap method?
try casting (might give errors) or try getKeys("some-map",false)
you can get the keys
just iterate over them and do put(key, value)
its not a MapList
just get
will return a MemorySection (if you have reloaded the config)
if not you will get a Map back
that worked, thanks
is there a way to add nbt data, eg {display:{Name:'{"text":"erere"}'},BlockEntityTag:{SpawnData:{id:"minecraft:chicken"},SpawnPotentials:[{Weight:1,Entity:{id:"minecraft:chicken"}}]}} to an ItemStack without messing with nms?
?pdc
not nms but persistent data yes
i thought you cant use that on vanilla values?
like display
in python i can write a dictionary for items like this
swords = {
"wooden sword": {
"damage": 5
"price": 10
},
"stone sword": {
"damage": 7
"price": 20
}
}
how would i do smth similar in java? i know that i have to use hashmaps but how would i make a hashmap to fit this sort of format?
you can;t.
and set its name / damage / price
so there's no way to do that or
what precisely are you trying to do as there may be API methods to do what you want without diving to nms
the example i showed above
getting an itemstack with those nbt tags
ok you are not understanding.
forget about NBT and NMS>
What are you trying to do to the ItemStack?
drop it naturally
yes
so what are you diving to NBT tags and nms for?
not sure if im honest
Hey, Im making a license system.
package me.mtaddons.Tutorial;
import org.bukkit.configuration.file.FileConfiguration;
import org.bukkit.configuration.file.YamlConfiguration;
import org.bukkit.entity.Player;
import org.bukkit.event.EventHandler;
import org.bukkit.event.Listener;
import org.bukkit.event.player.PlayerJoinEvent;
import org.bukkit.plugin.java.JavaPlugin;
public final class TutorialMain extends JavaPlugin implements Listener {
FileConfiguration config = getConfig();
@Override
public void onEnable() {
if(!new AdvancedLicense("Y7NG-T7OG-84OT-0CZK", "https://mtaddons.000webhostapp.com/verify.php", this).register()) return;
getConfig().options().copyDefaults(true);
saveConfig();
//config.addDefault("YouAreAwesome", true);
//config.options().copyDefaults(true);
//saveConfig();
//getServer().getPluginManager().registerEvents(this, this);
}
//@EventHandler
//public void onPlayerJoin(PlayerJoinEvent event) {
//Player player = event.getPlayer();
//if (config.getBoolean("YouAreAwesome")) {
//player.sendMessage("You are awesome!");
//} else {
//player.sendMessage("You are not awesome...");
//}
//}
@Override
public void onDisable() {
}
}
This is what i have now
so you can see the "Y7.............." license is the license
if that is correct from the site it will enable the plugin
that is working
but now i want to make a config file with this text:
Setup:
License: "Paste your license here"
and if you paste your license there it will check if its correct or not
how can i make that?
Sorry for the length of this video, I wanted to be as detailed as possible. This episode I show you guys how to create a config.yml for your plugin and add functionality in your code to be able to access the data in the config file and also to be able to set the data. Stay Updated!! 👁
⭐ Kite is a free AI-powered coding assistant that will help ...
k
public class ItemForSale {
private String name;
private Material itemType;
private long price;
public ItemForSale(String name, Material itemType, long price) {
this.name = name;
this.itemType = itemType;
this.price = price;
}
public String getName() {
return name;
}
public Material getItemType() {
return itemType;
}
public long getPrice() {
return price;
}
}
does this class look fine
yeah looks good
its fine but it only supports basic items
you want to use an ItemStack instead if you wanna support NBT etc
yh this is just some sort of item data container
so private ItemStack item, private long price
which will hold price too
if you only need to store basic items its fine
oh u can add attributes to existing classes?
oh nvm i misunderstood smth
oh also if you want to persist it between restarts, it should implement either Serializable or ConfigurationSerializable
depending on if you prefer default java serialization or bukkit serialization
ah ok ty
i wish i had an easy way to check playerinventory open
Isn’t there an event for that
no because player inventory is client side
sadly 😔
https://hub.spigotmc.org/javadocs/spigot/org/bukkit/event/inventory/InventoryOpenEvent.html so this doesn’t work then?
declaration: package: org.bukkit.event.inventory, class: InventoryOpenEvent
If I have a stream from lets say a (non-java.util.concurrent) collection obtained through Collection#stream(), can one safely modify the source collection (add/remove) concurrently while I'm still using the stream
it doen't tigger on pressing e
Oh fair
Yes
anything i've been suffering
A stream itself won’t trace back to its source
procotolib doesn't wanna work and achivementDoneevent doesn't work for me
and what happens if the state of objects in the collection gets changed by calling setters?
Then those will be changed in the stream also
By invoking Collection#stream() it simply creates a new stream holding references to the elements in the collection while losing any contact with the collection itself. It just pulls in what’s necessary.
never really read into it, just wanted to make sure cheers
Yeah have a good one
i would like some sort of solution for this 
Someone knows why my JsonObject dont has a method called "has" and "getString"?
using gson?
import org.json.simple.JSONObject;
uh why json simple
use gson or jackson or moshi
jsonsimple is outdated as hell iirc
and ftw gson is included in spigot
Java 1.8 has Gson?
for the win gson? 
Gson is the best
I personally find the json reference implementation best
This is because my getDataContainer gets a JSONObject output.
But i dont want to change all the code.
Then make it deserialize it to JsonObject
the lazy way would be to just serialize it to string and then back, but this is very inefficent
I only want to convert JSONObject to JsonObject in this part ;-
you have to compare two Materials with == right?
You can compare enums in at least 3 ways
i mean it is the "best practice" iirc, coding convention
at least, its the way most common people do it
equals, name, ordinal and instance comparision
Only instance comparision is null safe, so most people use it
and instance comparison is ==?
@opal juniper My algorithm is getting better. It always find the target now. It does also find over 700 thousand paths to get there, but its improving
Yea
or .equals()
😳, i mean i guess the amount of paths is a function of the distance to a certain degree. what sorta path are you taking with the algo?
.equals is equals
I allow it a maximum of 20 nodes it can try to get to teh destination.
You should have opted in for one JSON framework and not multiple. Java unfortunately does not have a giant inbuilt library that holds all the classes all the libraries wish to use, so you have to use 200 classes for basically the same thing and need to manually convert it back and forth.
But even with a giant inbuilt library, most library devs will still create their own classes because "oooh, android does not work with that shiny library"
and it checks every permutation of every BlockFace for every possible node
strings are objects
as long as you know that they have to be interned, yes
yeah ik
If not, no, not at all
That seems, expensive 🙃
okeeee
You compare most things with the equals methods in java - there are a few things (1 instance = 1 state structures - such as enums or interned strings) that allow for "good" instance comparison support
That being said, sometimes it may be recommended or even required to use instance comparision instead of equals despite the object structure usually not supporting it, but these cases will be rather rare so you should bother about them
My plugin is getting the value of a dependency plugin that many of the plugins I use use it.
Okay, then you are forced to convert it manually.
so, someone have any idea to make implement lag compensation ?
depends on context
what
well, lag compensation will be quite different for a game that has a ping implementation that can be easily spoofed compared to a telegraphing service
well I didn't understand anything, I just wanted to know how to take a previous position from other players and emulate it
is the angle in degrees or radians?
rad
why tf is it in rads
You can easily convert degrees to radians tho
As for why, it's because that's what Java's Math class uses.
unless you are developing an anticheat I do not think that this is an issue
lol geol
I read it as "what tf is rads"
unit of radiation in fallout 4 🙂
player rotation is given in degrees tho from -180 to 180
While radians are more or less obscure for humans, they make more sense in most mathematical application
Which is why within the UI rotation is often given in degrees where as internally it may or may not be in radians
right
Hello, I wanted to know what the getClikedBlock returns.
Google your question before asking it:
https://www.google.com/
?jd
I know but there is just mark that it returns the block but what the itemstack or the rental because I need the rental
the.. rental?
location ?
oh
sorry im french
well it returns Block
and if you clicked through to the javadoc you would also see a method https://hub.spigotmc.org/javadocs/spigot/org/bukkit/block/Block.html#getLocation()
thank you
JSONObject varfd = profile.getDataContainer("arUtilsBedWars", "favorites").getAsJsonObject();
JsonObject favoritedata = new JsonParser().parse(varfd.toString()).getAsJsonObject();
this will work?
You are using two diff Json objects
I need to use 2 diff json objects
The dependency plugin uses JSONObject, but i need to use JsonObject.
This convert method works?
Try it and see
What libraries are both of them from?
I believe the top one is gson which is one of the best
when i try getting item.getItemMeta().getDisplayName() it keeps returning an empty string
what am i doing wrong?
getItemMeta
It's probably not named anything then
Get the Material name is all I know of
Format it how you want then, replace _ with spaces and use StringUtils.capitalizeFully
ig that can work yh
so after a bit of researching, i realised stringutils is part of apache library
do i just download that and chuck that in externallibraries folder?
It should be included with Spigot
nothing comes up 😦
without nms that is not possible
Try StringUtil
how can i check the enchantment of an item? like this?: if(event.getItem().getItemMeta().getEnchants().equals(Enchantment.whatever))
That being said, I think you could use translation keys? I never did it myself so idk
.containsKey?
okay
I've always just parsed the Material name, might not be the best way but it works lmao
err it doesnt contain any capitalize methods under it
It is somewhat working after 1.13 but earlier it would be a desasterous idea
True, I always build against latest though
if .getEnchants() returns a collection it is .contains, if it returns a map it is .containsKey
Try WordUtils
There's about a billion utils named similarly and I can't remember what methods are under what lmao
🤔
u reckon its better to take some capitalize method off of stack overflow or dl the apache library for this?
I'm fairly certain the apache library is already included in Spigot
What's the one liner? Curious now
replaceAll supports RegEx in Java 8 I thought
im checking the directory list and it only shows bukkit and spigotmc libraries
its probably not a good idea to import a 2mb library just to capitalize the first letters of words 😭
cant find the method :/ searched spigot capitalize and there doesnt seem to be any methods like that under spigot
Hello juice man
what is the difference between the spigot environment and the spigot api?
spigot environment is the server
i only have spigot api in my external libraries folder
the api is purely spigot / bukkit shit
ah
@opal juniper ok I have the algo quite good. So long as you are reasonably close
what about if you are not... does it shit the bed?
it will fail to find a path
ohhhh