#help-development
1 messages Β· Page 295 of 1
it does what? o0
it turns the string "true" into a byte?
Because Mojang interprets the string true as a Boolean or something
Idk
Been a while
I remember this very weird bug when deserializing itemstacks that have "json-looking" text stored as String in it's PDC
It's shit, stay away from pdc and yaml
and it would break everything and throw exceptions
Like the combo
e.g.
ItemStack item = ...;
ItemMeta meta = item.getItemMeta();
meta.getPDC().set(..., "{\"name\": \"mfnalex\"}");
config.set("myitem", item);
ItemStack item = config.getItemStack("myitem"); // <-- huge exception
I wonder if this was fixed meanwhile? I once opened a jira issue and md_5 said it's indeed a bug but he won't be able to fix it without breaking other stuff
It has not
damn
Everything as a byte array is the vibe
I should add a new data type to MorePersistentDataTypes lol
DataType.STRING_CONTAINING_JSON
Or just, again, don't use spigots item yaml shit
then what else are we supposed to use?
Papers item to byte blob XD
but
- more than 30% of servers use spigot
- then it's not human readable anymore
D:
paper should just contribute upstream more π
Not really possible
why not? honest question, why is this not possible?
The people that contribute those patches would have to sign the cla
Else they cannot be contributed
what's the problem with signing it?
That some people don't want to ? Or that people who have written the patches just aren't around
Can't force them
Lol
well that's sad
I mean it takes like 30 seconds to sign it
and it doesnt have any downsides or anything
What ?
which downside does it have?
yeah sure, I mean it's an open source project
who the fuck contributes to an open source project and then later says "ha you cannot use it, I wrote it"
makes no sense in my eyes
imho you already give the rights away by contributing to any open source thing, automatically. it's like... inherent to the idea of creating a PR
Not at all o.o
not sure if I phrased it correctly
my english is only good enough for small talk and to talk about pickles
My MIT licenced Code still forces every sucker that uses it to include the licence and a credit
Spigot doesn't have to do shit
hm I don't really think I get what you mean
I mean, my paper patches will have my mail and username as credit. If we ever get rid of them and move them to commits, I'll be the author of that commit etc
Spigot just, absorbs your stuff
You loose any form of ownership of the code
Which is the entire point so no one can trash them like Bukkit
yeah okay but what are you going to do with the ownership? sell it to someone or what?
or make paper remove it again when you don't feel like contributing anymore?
I mean it's a licence discussion. This is more about moral and concept than anything else lol
honest question, I cannot think of a legimite reason why keeping the ownership would be relevant
No like a single plugin gives two shits about licencing
so MiniDigger could just say "Nah I don't feel like MiniMessage should be in paper anymore" and then they'd have to remove it again ? or am I misunderstanding sth lol
i think I'm misunderstanding sth
But at this point it's also just a dumb business move to contribute to spigot lol XD
it's also always a question about where copyright starts and where it ends. for example I added these 4 translation key methods to spigot (well I PRed them) and then found out that paper does it basically exactly the same way. One could now say that I "stole" this but I wrote this shit myself. I mean it's just a few lines - now the question is, if two people write the same code without having copied each other, does that count as "stealing" that code?
because if that'd be the case, then every Hello World program would basically be stolen from s/o else
I even accidentally used the same variable names haha
nmsItemStack e.g.
but tbh how else would one call an NMS itemstack
Yea it's a iffy thing obviously
Especially with how some fixes just, fhere is only one way to fix them
Or API that just, makes sense
exactly
Hence no one is going completely nuts about this kind of stuff
that's also why I had this discussion with this dude on paper's discord about the bukkit api
Quick Question. Would a valid method(this was suggested to me and it doesn't seem like it would work but I want to run it by some people who know more than me) to turn players completely invisible(armor and all) be to basically move their armor to an armor stand that is set to be invisible?
I mean cmon, obv an interface that represents a player is called Player
why not just use Player#setVisible(false) ?
There is also player#hide and show
oh yeah
player hide prevents the player from taking damage.
It does yea
then use setVisible(false)
I am pretty sure it is
hide(...) basically makes it hidden completely from clients (they dont know this entity exists), while setVisible(false) just makes it not "render" them
unless I am mistaken
But anyway, I mean no one is going nuts and screaming at spigot if something similar is submitted to them. Obviously don't like it too much because well, the extra apis we add is an advantage for us.
Don't know what setVisibke does tbh
.setVisible on a player doesn't work
well this one dude on stash sent a kinda passive aggressive comment lol
that already made me not wanna contribute anything anymore haha
Well, md used to be rather careful on anything looking remotely like paper patches
hm what about a potion effect with ambient effects set to false?
doesnt prevent armor visibility
No need to move the armour to an armorstand tho
but isn't that what the CLA is for? I mean, I basically assured that everything I contribute is "my work", that's part of what the CLA says
People do a lot of things
so even if I stole it from paper, that'd be my responsibility and not Spigot's
Well yea, does not hurt to still check
Does spigot have the sendEquipmentChange stuff
Might be better here for armour
IIRC the CLA basically just says this:
"Everything I contribute was done by me and I have the rights of that code. But now it's yours. If I fucked up, that's my responsibility"
yes
Yet you'll also double check the road before crossing a cross walk just in case a car does not see you
Sure it wouldn't be your fault but safe is safe
sure
No?
it has no effect on armor
how weird
How do you write to a yml file?
do you have a FileConfiguration object?
If so, call save(File) on it
Pdc for plugins when then
btw is there any official docs or something that notify about api changes in paper? I know that spigot doesn't have any so I always miss the new stuff
half of the people here are banned from your discord
Every like 2 weeks or month
Otherwise twitter gets the same post
If you use that
Once I finish my thingy, I should start making YouTube shorts covering API changes
There needs to be like a little changelog thing for the api on the website for it
that'd be nice
for spigot I usually just stalk this but it's a pain https://hub.spigotmc.org/stash/projects/SPIGOT/repos/bukkit/commits
It's not so bad lol
yeah well but it also has entries like "Updated SnakeYaml" and stuff which are useless if you just want to see api changes
so yeah it's not perfect but it's okay
I'd rather like to see some blog posts or sth
e.g. when PlayerProfile was added in 1.18.1, NOBODY knew about it
I want to see md_5 becoming a tiktoker
I'd follow for sure
Famous af
all his videos are shit
he's just lipsyncing some songs or similar
i never understood tiktok
Neither really.
on the other hand, there's many things I don't understand
I am a tax lawyer but I couldn't do my own tax returns lol
oooh TeleportCause.DISMOUNT was finally added
hi verano
we all saw you typing
What would the best way, for having a common sender for bungee and spigot?
create an interface that declares all the methods you need, then create a bungee module and a spigot module with a wrapper class for the underlying sender that implements your interface and just delegates the stuff to the underlying object
Yeah i did the interface but i dont understand how i wrap it
we got geyser, to make bedrock players join java servers. we got viaversion to make 1.19 players join 1.8 servers. we got mohist to run spigot plugins on forge (well, more or less...).
When will we have a thing that allows spigot plugins to run on bungee lmao
maven or gradle?
Maven
you create two modules. E.g. MyAPI-spigot and MyAPI-bungee
Also there is more, there is a way for playing mc via netscape
public class SpigotCommandSender implements MyUniversalCommandSender {
private final CommandSender sender;
public SpigotCommandSender(CommandSender /* the spigot one */ sender) {
this.sender = sender;
}
@Override /* declared in your MyUniversalCommandSender interface */
public String getName() {
return sender.getName();
}
}
basically like how CraftPlayer etc works
this would be in your spigot module. then you do the same for your bungee module
however I don't see many usecases for this. Bukkit and Bungee player objects are extremely different
yeah i thought something like that and then how i would call it via the Command?
I mean, all they have in common is that they have a name, a uuid, and that you can send messages. oh and that they can have permissions
that's basically all they have in comm on
wdym?
Im doing it for my cmd framework that why
your command framework would then just take a MyUniversalCommandSender instead of a bukkit or bungee one
yeah i know that
from spigot you'd just do new SpigotCommandSender(theActualSpigotCommandSender)
I have smth like this public abstract boolean execute(Sender sender, String[] args);
same for bungee
Let start from begining, how would you do the command registration for bungee/spigot
I dont really understand the delegation part between diff platforms
uwu
?jd-s
What?
chads like me know everything by heart
I know how to register command on spigot and bungee, just dont know how to create the command framework so its support both of them
Mainly the delegation part
verano sometimes I think you're living in a different world lol
I wasn't talking to you
I'm doing a trivia in #bot-commands brb
ohh ok
if there is a list of player names in the plugin comfig.yml file, how would i get them as an OfflinePlayer[]?
Get them via the uuid/name
I'd use a stream
imagine your config looks like this:
players:
- mfnalex
- verano
then you could turn that into a list of offlineplayers like this: (1 sec, gotta type)
for(String user : userDataFile.getConfigurationSection("Users.").getKeys(false)) {
OfflinePlayer player = Bukkit.getOfflinePlayer(UUID.fromString(user));
if(player.isOnline()) {
getUserDataMap().put(UUID.fromString(user), new ConcurrentHashMap<>());
}
}
This is an example from my own plugin.
List<OfflinePlayer> players = getConfig().getStringList("players").stream()
.map(Bukkit::getOfflinePlayer)
.collect(Collectors.toList());
@sterile token why are you not in #bot-commands ?
Im not playing ΒΏ? Im lost, what did happened
If im not wrong when you compile, the comments are ignored
i need it a Lot
Yeah, i'd say the comments were ignored.
So if you write any docs in the code, during compile they are just ignore
if im not wrong they will be always remove
a compiled class file wont have comments/javadocs p sure
yeah
no matter what compiler u use
You will have to generate the docs, from those comments
Its not posible
On IJ there is a tool for that
No
If you are using maven they will be downloaded im not sure how that works sorry
if u do it through maven i believe itll be a separate jar called like <artifactId>-<version>-sources.jar
yeah
The problem is that you will have to upload it too
That are the main reason in my case of having my own remote maven repo for coding, so i just deploy my libraries there and i dont need to care about that type of things
If you want people to be able to see the code after compiling. You need to attach sources
This will also leave the comments in place as well
If you are using BukkItRunnable, you can just call the cancel method
Also i will recommend using the spigot docs, for this type of questions
?jd-s
@sterile token Thanks, that worked!
Your welcome, now you know you can alays use the docs for those questions
hi
i am implementing a command right now. The command is called join and when a player uses the join command, it takes the name of the game as an argument, and it looks through a hashmap for that name and runs a runnable.
and passes the onCommand() method's arguments to the runnable.
here is what the code looks like.
games.get(gameName).run(sender, cmd, label, args);
i am getting a red underline on this code, how do i register a runnable that has parameters as well?
i was looking into consumers but they seem to only take one argument at most.
assuming ur not using the Runnable for anything other than run(), make a class that has a method that takes in those parameters
like
public class YourClass
public void theMethod(CommandSender sender, Command command, String label, String[] args) {
// do stuff
}
}```
oh ok
then i could use like i show below, right?
YourClass name = new YourClass() {
public void theMethod(CommandSender sender, Command command, String label, String[] args) {
// do stuff
}
};```
yeah
okay, just making sure since i have not really done a lot of java programming.
also, can i perhaps create another class that implements or extends Runnable?
yeah
public class YourClass implements Runnable {
@Override
public void run() {
// do stuff
}
}```
Runnable is an interface last i rmemeber, so non-interfaces use implements keyword
?learnjava will probably help u on ur adventures too @quaint mantle
Here are some links to get you started on learning Java:
- https://www.codecademy.com/learn/learn-java
- https://www.sololearn.com/learning/1068
- https://www.learnjavaonline.org/
- https://programmingbydoing.com/
- https://docs.oracle.com/javase/tutorial/java/index.html
The last one is the only official one, however some of those concepts assume that you already know a bit about programming.
There are BiConsumers but it's also possible to define your own functional interfaces.
Note that they're primarily intended for lambdas.
@FunctionalInterface
interface QuadConsumer<T1, T2, T3, T4> {
void accept(T1 t1, T2 t2, T3 t3, T4 t4);
}
void myMethod(QuadConsumer<String, String, String, String> consumer) {
consumer.accept("michael", "it's", "your", "birthday");
}
myMethod((s1, s2, s3, s4) => {
// ...
});
I typed that on phone.
Kill me.
Is it possible to modify something's texture ingame?
By sending packets or something like that?
hi i am looking for some plugin devs that can help me with a server dm me if you are interested you will get more info if you sent me
Via a plugin? Probably not. You'd want to have the server send a resource pack.
Isn't there hidden packets that makes the java client change the texture?
Ok thanks
OK. I give up plugin licensing is a mess
What's your problem
hi i am looking for some plugin devs that can help me with a server dm me if you are interested you will get more info if you sent me
Don't spam your advertisement
ok
is there a way to avoid unchecked cast here? (projectile is of EntityType)
player.launchProjectile((Class<? extends Projectile>) projectile.getEntityClass());
How can I change the bot's "playing: whatever" or "watching: whatever" using DiscordSRV's API?
It uses JDA iirc
So do it through JDA
Hello friends , i have a bit of problem with json saving :
so the description is a single line , but its add each word in new list .. how i can fix that? or is this how its looks like?
iam not sure if iam doing something wrong .. :
desc + effects + i will also add requirments
@twin venture use a string for the description, not a String array of words
Yeah youre using a list its going to implement each string on its own
Well if you use gson, you could always define a typeadapter for it
projectile.getClass?
it'll just give EntityType.class?
Wait what?
projectile is EntityType
yeah i deserialize it
Well then deserialize it to the Class
You canβt really avoid the unchecked cast then
k guess ill just suppress it then
So store the projectile class somewhere in your code after deserializing
And check that it extends projectile.class
its a list am i not wrong?
like this :
"hi this first perk, yes its amazing"
I think i understand what ur doing
Thats a string
Of course you can define what a list is based of a string
But semantically
Do u want ',' to mean new line?
Thats a string
yes new line .
It's not a json problem
ok i will try today thx ..
Is there a way I can just listen for all serverbound packets using protocolLib?
You could always do a for loop π
how to upload a premium resource??
read the thread to it
?premium
found it ```java
PacketType.Play.Client.getInstance().values()
What should I do If I want to create a playtime system but I can get the information about weekly/monthly playtime for the players.
https://hub.spigotmc.org/javadocs/spigot/org/bukkit/Statistic.html#PLAY_ONE_MINUTE i guess you can use this
declaration: package: org.bukkit, enum: Statistic
or just manually calculate it
i hate to say it but i think u need to check it against the Material class
and then obv some wools wont have a chat color
like Brown
Could you explain what you want to achieve in a bit more detail? What version are we talking about? Just "native" chat colors (&[a-f0-9klmnr]) or do you want to include "custom" hex colors?
You can approximate this to orange
Or, if you support hex colours, then yeah you can just use the hex colour for brown wool lol
the version is 1.19.2 and i just wanna include all colors of wool.
but i have another problem right now.
so, i dont want players to be able to change anything in their inventory; the players should not be able to move any items, drop any items or place them or use them, i want every item in their inventories to remain in their original slots, how can i do it?
I tried the InventoryClickEvent but there does not seem to be a method called getPlayer() to get the Player object because I wanna check the player against a list of players to determine if the event should be cancelled for that player or not.
can any1 explain how to actually read server crash stack traces.
cuz all the threads get dumped but idk which one is actually causing issues
getWhoClicked
No getPlayer for click event
Can you send it?
You're going to have to accept a compromise on exactness then, as you cannot perfectly depict all wool colors using chat colors only.
IIRC, it was InventoryClickEvent#getWhoClicked, which is a HumanEntity, and needs to be checked against Players by the call of instanceof Player.
Whoops, didn't see that, xD:
How to handle multiple queries at once? I set up HikariCP connection pool, but after spamming 3-5 times query on command, it crashes.
Transaction or smh? Is it possible
what crashes
Connection
?paste crash log
Mind showing some code?
jvm crash π€‘
try {
PreparedStatement preparedStatement = getConnection().prepareStatement(query);
int x = 0;
if (!query.contains("?") && args.length == 0) return preparedStatement;
for (String var : args) {
x++;
preparedStatement.setString(x, var);
}
return preparedStatement;
}
catch (SQLException error) {
error.printStackTrace();
}
return null;
}
public void executeQuery(PreparedStatement preparedStatement) {
if (isNotConnected()) return;
ProxyServer.getInstance().getScheduler().runAsync(instance, ()-> {
try {
preparedStatement.execute();
preparedStatement.getConnection().close();
}
catch (SQLException error) {
error.printStackTrace();
}
});
}``` executing query methods
i once made the jvm crash with worldedit :)
not closing statements too, very good
and x should start at 1
don't close the connection when using Hikari
ah youre incrementing it before :/
doesnt it just return it then to the pool?
i always closed them and never had issues
no it closes it and forces Hikari to open a new one
π€‘
So leave only execute()?
no?
Yes I believe so
I actually ran out of connections when testing it due to hikari having to open new connections all the time

ProxyConnection::close iirc from Hikari just lends the connection back to the HikariPool instance
ofc with proper locking mechanisms
In my experience it didn;t, but I may be wrong
Hmm, maybe the pool was configured in that way then
but by default hikari should abide by the object pool pattern
String INSERT = "INSERT INTO user_codes (code) VALUES ";
for (String code: codes) INSERT += "('" + code + "'), ";
INSERT = INSERT.substring(0, INSERT.length() - 2);
PreparedStatement preparedStatement = mySQLDatabase.prepareStatement(INSERT);
ProxyServer.getInstance().getScheduler().runAsync(instance, ()-> mySQLDatabase.executeQuery(preparedStatement));
}``` After testing it with command /codes (prefix) (amount of codes)
It just stops responding
Use batch for multiple inserts
Instead of VALUES (x), (y), (z)?
multiple insert queries into batch
be sure to conn.setAutoCommit(false); and then enable it after
as when using batch you have to call commit yourself
It seems I do close my connection using Hikari
as I use a try with resources
What about refreshing? For example UPDATE query?
update can batch too
Sure, thanks
And the last question, how to sync properly? For example once a second or smh? When players would start to query data with commands
For example 10 players will execute command at once
Just async for every query or
you keep relevant data in memory and push to sql when changed. interval depending on how important the data is
Is there anywhere I can find which java versions are compatible with which minecraft version? As far as I know mc 1.16 is up to java 16, and above requires java 17?
All versions below 1.16 are 8, 1.17 is 16 and all higher are 17
would java 17 work with mc 1.16?
You can even use Java 17 with Spigot 1.8 if the software and the plugins support it
Not true, I am unable to run buildtools for 1.16 with java 17 installed
nope, a clean spigot server on 1.16.5 requires java 16 max to run (on linux at least which shouldn't be any different). Therefore you can't use java 17 for 1.16 plugins since java 16 doesn't know what to do with java 17 files
Guess I'll have to drop support for 1.16 then. Trying to use an api compiled on java 17
plotsquared
Cant u use a version of that api which is compiled on j16?
one of my codevelopers looked into it and the latest version on j16 was for max 1.17
I was already going to drop 1.16 though when mc 1.20 comes out. Might as well do it earlier
only 3.3% of my users still use 1.16.5 and they can just keep using the old release
Ye
So if youβre masochistic enough
You could work with abstractions
As by the means of having one module per version
(Or method+varhandles/reflection)
Yeah no, I have already abstracted our code to be compatible with a forge (as in common code with an implementation for each) and I am never doing that stuff again if I can help it
Its easier with spigot
Because you have the spigot api
And forge api consisting of events mostly (bit different)
It will only be a small part of the plugin, so not going to bother
Alr gl then
Might as well drop 1.17 then since only 2.7% uses it
is Bukkit's scheduler's delayed tasks reliable (cuz ticks per second isn't constant right?), or should i use java's executor for scheduling delayed tasks?
Depends on what you want to use it for I suppose
like ability cooldowns
Is it bukkit bound?
sometimes yes sometimes no
You want server ticks for that, because that would mean that if the server lags, abilities are slowed too, so bukkit scheduler
I'm trying to make a cannon but I am having trouble making the cannonballs fire in the correct direction. I am currently summoning falling blocks. How should I go about doing this
Well i donβt know if SES is much better
the direction of the cannonball should be the same as the armorstand's rotation that I use for the cannon btw
Cuz I assume you want to jump back to the server thread when executing the tasks areg?
yeah
Go with bukkit scheduler
k thanks
Cuz with SES you will want to have another ES which is gonna cause sone latency already + a delegation back to the bukkit scheduler
This is also a good idea yeah, just save when the last ability was used, and when someone tries to use it, check if the time since then is greater then the cooldown, if yes then they may use it
so i need a set to be concurrent if i am modifying it from task run via BukkitRunnabel#runTaskLaterAsynchronously, right?
nvm I did it
yes
just run a sync task
ConcurrentHashMap.newKeySet() else
is it better than Collections.synchronizedSet(new HashSet<>())?
What would the best way to be to determine the air block just prior to the block determined by a raycast?
subtract teh vector from the hit location
Depends
Its faster
Collections.synchronizedSet just wraps the synchronized keyword around all interactions iirc
Yep
No what you said is correct
;-;
Why with app store??
idk how to install from tar.gz :/
Just use dpkg
no
cd jetbrains-toolbox-1.27.2.13801
sudo dpkg -i jetbrains-toolbox-something.deb```
if you mean about alex he changed his actual discord name
cafebabe doesnt/cant add a nick if it matches your current name
lol
no clue
i think that might still keep the nick
been as its already been applied
Before that export the tar.gz file mb
i dont have a deb file but whatever i can run that toolbox file
I'm using mac silicon rn so i dont know whats inside that tar sorry ;D
just install ij off the jetbrains website
In this video I will show how To Install IntelliJ IDEA on Ubuntu 22.04 LTS | Create and Run Java "Hello World" Program on IntelliJ IDEA Community IDE.
How to install Oracle JDK17 (Java 17) Link:
https://youtu.be/snN--wBu3xw
Gears List:
Apple AirPods Pro: https://amzn.to/3QYEKtj
Fire TV Stick: https://amzn.to/3AjYCkA
Apple AirPods: https://amz...
got it

intellij blocking
whats the max length of GUI Title?
[15:58:07 INFO]: [CODES] foo0s65WOa7
[15:58:07 INFO]: [MANAGER] Creating statement...
[15:58:07 INFO]: [MANAGER] Created statement!
[15:58:07 INFO]: [MYSQL] Executing batch...
[15:58:07 INFO]: [MYSQL] Executing batch after if...
[15:58:07 INFO]: [MYSQL] Trying to send data!
codes bar 1
[15:58:10 INFO]: [CODES] barGi7kQLsR
[15:58:10 INFO]: [MANAGER] Creating statement...
[15:58:10 INFO]: [MANAGER] Created statement!
[15:58:10 INFO]: [MYSQL] Executing batch...
[15:58:10 INFO]: [MYSQL] Executing batch after if...
[15:58:10 INFO]: [MYSQL] Trying to send data!
codes dan 1
[15:58:16 INFO]: [CODES] danJHHlHnbg
[15:58:16 INFO]: [MANAGER] Creating statement...
[15:58:16 INFO]: [MANAGER] Created statement!
[15:58:16 INFO]: [MYSQL] Executing batch...
[15:58:16 INFO]: [MYSQL] Executing batch after if...
[15:58:16 INFO]: [MYSQL] Trying to send data!
codes que 1
[15:58:24 INFO]: [CODES] que57xJTwFu
[15:58:24 INFO]: [MANAGER] Creating statement...
[15:58:24 INFO]: [MANAGER] Created statement!
[15:58:24 INFO]: [MYSQL] Executing batch...
[15:58:24 INFO]: [MYSQL] Executing batch after if...
[15:58:24 INFO]: [MYSQL] Trying to send data!
codes pug 1
[15:58:34 INFO]: [CODES] pugu8FwfpY6
[15:58:34 INFO]: [MANAGER] Creating statement...``` Hmm, after 4 queries, executing function does not run
are you closing yoru statement?
Connection? Nope
PreparedStatement
I will test with closing statement
one sec
if (isNotConnected()) return;
// goes here and prints nothing, no exception nor executing
try {
ProxyServer.getInstance().getLogger().info("[MYSQL] Trying to send data...");
preparedStatement.executeBatch();
preparedStatement.close();
ProxyServer.getInstance().getLogger().info("[MYSQL] Data has been sent! Closing statement...");
}
catch (SQLException error) {
error.printStackTrace();
}
}```
the last one only created the statement
Hello, I'm storing a Map containing both an itemstack and another object in a data.db file. I'd like to delete the Map if the itemStack no longer exists (example player died in lava and the item got burnt or item was thrown in the void, etc), does anyone know any method or event I could use to accomplish this?
listen to item drop, inventory click ect events and check if it was that item, if it was remove the map
Ok thanks!
?paste
you should not use exceptions to control code flow
What should you do then
Panic and shutdown the server
Oh wait lol he is literally using it to do something
I thought you meant like don't use exceptions and throw stuff
ahh lol
Oh yeah, no that's horrible lol
Theoretically, you should be able to check if the statement is closed. Anywhere you're accepting a PreparedStatement you should have an open connection. You can't get a PreparedStatement instance without a connection
So if you really want to make that check, you can check if (preparedStatement.isClosed())
Okay thanks
?learnjava
Here are some links to get you started on learning Java:
- https://www.codecademy.com/learn/learn-java
- https://www.sololearn.com/learning/1068
- https://www.learnjavaonline.org/
- https://programmingbydoing.com/
- https://docs.oracle.com/javase/tutorial/java/index.html
The last one is the only official one, however some of those concepts assume that you already know a bit about programming.
What should I use to obfuscate remapped nms classes in gradle?
is there a way how to use SpecialSource for gradle projects?
theres some special source plugins on gradle otherwise you would need to use paperweight userdev
np lol
I have Integer x. Lets say it has value of 10
I want to convert it to multiple sets of Strings, which are Negative Spaced || https://paste.md-5.net/ideqaserah.java ||
So if I want to return to beginning with those characters, I would need to somehow convert it to
(NEGATIVE 8)(NEGATIVE 2)
So far I tried this:
https://paste.md-5.net/quwazorodi.java
Resulted in this error:
How to program an anti-ban listener?
check if the player is banned on async pre login event
if they are remove them from the ban list
if I want to copy a world multiple times to have multiple versions of the same world which files do I need to delete to make sure that I don't get mc to think I'm trying to load the same world multiple times?
cant you just rename them and mc says its different
no
worlds have an id file somewhere
if two of the same id try to load in mc locks the second one
I believe the Spigot API uses the folder name
could be level.dat or session.lock
so its fine
mc still locks it
I already got the session.lock, I was wondering if there was more
trying to document this so I stop getting lost
might be in level.dat if its not session
it's annoying because you brick the world when you get it wrong
and it's a bit tricky to test on this setup
backups
yeah I have them, still annoying
It shows me an error when there's no try n catch
Well you're allowed to use try and catch. We're not telling you not to. We're saying that use of a try catch to handle the flow of logic is wrong. Your isNotConnected() method is an inappropriate use of try/catch
Your executeBatch() method can be changed to use PreparedStatement's isClosed() method instead, but I ultimately think that checking whether or not the statement is closed is a bit redundant given that you're only able to get a statement instance from an open connection
Regardless,
public void executeBatch(PreparedStatement preparedStatement) {
ProxyServer.getInstance().getLogger().info("[MYSQL] Checking if connected...");
// if (isNotConnected()) return; // Replace this
try {
// With this
if (preparedStatement.isClosed() {
return;
}
// ^^^
ProxyServer.getInstance().getLogger().info("[MYSQL] Trying to send data...");
preparedStatement.executeBatch();
preparedStatement.close();
ProxyServer.getInstance().getLogger().info("[MYSQL] Data has been sent! Closing statement...");
}
catch (SQLException error) {
error.printStackTrace();
}
}```
try{
steal(choco, heart);
} catch (Exception ex){
jail(this, 10000);
]
I don't actually know if isClosed() throws an SQLException. If it doesn't, you can pull that up a bit
Cringe
impossible
?ischocoreal
No, Choco is not real. I was not programmed to say this by Sam.
that's a lovely heart you have there, shame if someone were to put it on the black market
I heard they're making a romcom movie about that, it's called dum and dummer
She's not Mrs. Choco. yet
so you're saying we have a chance choco
she will be, from what your saying, which is all that matters
are your dogs going to be ring bearers
if by that you mean they'll be eating the rings then yes
instead of them carrying them in their mouth or on their back they eat them and take a dump when they are needed
Btw, just curious, is this still an active issue? I don't know how much a version-independent and color-accurate solution is of importance to you, but: It wouldn't be a big deal to get the current server version, go to mojang's version manifest and find the corresponding client.jar url, extract the assets folder, query all block PNG files, calculate their average RGB color and store this information into a JSON-based table, which you can then load when the plugin loads. You version supports hex-colors, and that would most definitely give you the most accurate results available, for all blocks - not only for wool.
Otherwise, the quick and easy way would just be a lookup-table implemented as a switch-case block, where you match materials to chat-colors, obviously.
bump
?paste
Item name not changing on checks
Hello, I have a pvp server for me and my friends, and, when fighting, damage sometimes gets dealt withtout "cooldown", even though there should be 10(?) ticks of invincibility when a player gets damage. What could be causing this? I have no plugins on my server that mess with damage events. I hope it's possible to see in the video
isnt that just default minecraft
default?
what server version
the server is 1.8.9, but I play on 1.7.10 with viarewind
not sure then
we've experienced something similar on newer versions, might just be an mc thing
also I believe it's an entire 20 ticks of invincibility
1 second?
I play lots of pvp, and I'm pretty sure it's .5 seconds
or at least something very close to that
might be a via rewind thing
I was also thinking of that, I think i'll remove it and try it out
Is it tho, at such an old version? I still remember how clickspeed was always a huge topic, which wouldn't make sense with cooldowns as huge as 500ms.
checked 1.19 src and it's 20, could be different for 1.7/1.8 though, haven't played those for ages
lmao when 1.8 isn't old enough already, so yuo install viarewind so you can use even older versions lmao
preference
I directly compared it to the damage of a server at the same version, it's way slower than on my server
what year was 1.8?
?1.8
Too old! (Click the link to get the exact time)
Yeah, because there have always been ways to artificially increase the hit delay, and many server owners did that to improve the game experience for non-tryharders, lol.
Did that help? Otherwise, you could try overriding it programmatically.
Didn't try it yet, hold on
heya!
im looking to store information inside of an item. when someone will right/left click while holding it, itll run a command.
will persistendatacontainers work? when the item is first made, ill give it some data and check for it when the player tries to interact
didnt work.
I'm going insane, prepareStatement's function stops after few runs https://paste.md-5.net/royofolise.md
yes, pdc will work
alright, thank you!
Looks like this is manipulating the delay you're after, although I haven't tested it myself: https://hub.spigotmc.org/javadocs/bukkit/org/bukkit/entity/LivingEntity.html#setMaximumNoDamageTicks(int)
You could just set a desired number of ticks on a player when they join, which will then be active until they leave (AFAIK), and thus in effect all the time.
declaration: package: org.bukkit.entity, interface: LivingEntity
thanks, I'll try it. Even after deleting all my plugins except for viarewind (because i tested it already) and multiverse it didnt get fixed, so I'll have a look at the multiverse config too if your method doesn't work.
That suggests that nobody else alters this delay, and it might just be what 1.8 actually defaults to (which I'd also remember it as, delays have been introduced in 1.9). You could also print out the getter of that delay onJoin, to see for yourself what it defaults to.
A jar added to your resources folder will not be loaded by the classLoader
What other plugin does this work for? I'd actually be curious about that.
shouldnt you be shading stuff you want to run as a plugin
or add the jar to the class loader
dependencies are not resources folder
seems like you're right, and servers actually use methods to alter it. I set max no damage ticks for players to 20 when they join, sadly no results. Thanks for the help though
But you understand why we think that it doesn't work that way, right? Yes, if the plugin-loader has been instructed to load jars from resources/ into the path, then sure, it would work. But what loader does this?
Usually, you either shade your dependencies into your plugin or specify them in the plugin.yml for the server to provide them (which I never did, due to the fear of the server not doing it's job properly).
ugh never do that
Did you print out the old value, as I suggested above? This could assure you that your code actually ran and took effect.
you remove it from your resources and shade properly
I printed it out, it says 20, one line after that I set it to 20 too.
did you write the api yourself? is it a maven project too?
and this is on the same event that changes join messages so it works 100%
then just mvn install the api project
after that, add it as dependency to the other plugin, set the scope to "compile" and shade it
second headline https://blog.jeff-media.com/common-maven-questions/
np π
This is so weird... Feels like another event subscriber alters it later on, but you said that you removed all other plugins already. Would you mind sharing your server jar with me, so I could give it a quick try locally? I'd actually be interested in what's keeping this setting from being applied.
Sorry, I don't think I can do that. You'd have to download the whole server too because some plugins don't work without each other and so on... I'll try finding another way
bump 2x
Just meant the server.jar, to make sure we're on the same version. But I think you mentioned 1.8.8, so I'm just going to set up one of those.
paper probably still host 1.8 paperclip jars
ohh, sure, here you go. PaperSpigot though, I hope I'm not on the wrong discord
Thanks! :). This is a general minecraft-server thing, I'd say it does not at all matter which "flavor" it is.
Another strange thing I noticed tho, this only occurs when another player attacks me, AND when he's crit damaging me
as in the video
therefore it might be hard to test this locally
Server returned HTTP response code: 403 for URL: https://s3.amazonaws.com/Minecraft.Download/versions/1.8.8/minecraft_server.1.8.8.jar, alrighty, going back to my 1.8.8 spigot jar, xDD. Shouldn't make any difference anyways.
nice lol
update buildtools
Didn't build anything myself tho, wonder how @spring pike got it running, xD.
i don't even know
it was 6 months ago and in my whole history of making servers I never had anything to do with buildtools
if you ran a spigot server you would have
or did you use get bukkit
Okay, there's actually always a delay on my server, so it sadly seems like I really cannot reproduce this issue.
just shade it. set the scope to "compile" and add the maven-shade-plugin including the confiuration. then just do mvn package and you'll have a .jar with the API shaded in
I downloaded the paper spigot jar man im confused
what is paper spigot
yes
is that some fork of paper
it's a spoon of paper
make sense
pretty sure it's archived here https://papermc.io/downloads
oh thats just paper
?fork
SpigotMC maintains the Spigot server. If you are using a fork of Spigot (such as Paper, Airplane, Purpur, or other derivative works), you should seek support in the appropriate Discord servers.
Sorry, I completely missed this video! Seems like a player can double-hit when critting, which I can also reproduce. This seems to be desired behaviour on that version tho.
my game client says PaperSpigot 1.8.8 when viewing my server in the list
huh paper removed their quiz for old versions
guess they used paper spigot as a brand before
Do you have any idea how to remove the "double crit hits"?
new spigot logo confirmed
what is that
duh obviously that is a siphon for kitchen sink with flexible drain hose - 100% waterproof - tubular siphon with two appliance connections + connection seals.
Hmm, I think the only way to really find out how (as just googling it didn't yield much for me) is to have a look through the hit logic in NMS. I don't have a de-obfuscated jar laying around, give me a quick second, I'll have a look at the topic and get back to you.
something trap?
hm I am not expert when it comes to spigots and siphons. Maybe ask md_5 about it
NMS, the three letters I hoped I'd never come across again
can't you just check whether it's a crit hit in EntityDamageByEntityEvent and then do a cooldown
A trap for what, tho? The stinky gases are blocked due to the air-tight seal the water in the u-bend creates.
no clue what this is for, but I love it
Yeah, that would be the easiest solution, I guess.
I already put a cooldown, even without critting
i think thats a replacement for a ubend
NMS is the foundation of everything we modders work on, no way to avoid it. It's your friend, obfuscation just makes it a clusterfuck to work with.
but why would anyway block the stinky gases instead of enjoying them freely?
Didn't work?
nope π¦
Could you show an excerpt of the event you wrote? Did you cancel the event within the cooldown period?
I put it into the same event that reduces overall attack damage, so don't worry about the other stuff
and no i didnt
That's not really what I meant. Going to give you an example in a second.
== for enums
I'd create a cooldown class (https://github.com/JEFF-Media-GbR/JeffLib/blob/master/core/src/main/java/com/jeff_media/jefflib/data/Cooldown.java) and then manually cancel the event if a player still has cooldown
sure
I'll optimize it in a second
I'd do it like this basically
private final Cooldown cooldown = new Cooldown();
@EventHandler
public void onCritHit(EntityDamageByEntityEvent event) {
if(cooldown.hasCooldown(event.getEntity())) {
event.setCancelled(true);
return;
}
cooldown.setCooldown(event.getEntity(), 500, TimeUnit.MILLISECONDS);
}
ofc also check the damage cause and the damage amount and stuff
noted, thanks
(the Cooldown class is what I sent above in the github link)
oh didn't see it, appreciated
alex i have a question
NO
sad
well ok
I'll just wait for BlvckBytes answer
can i have a like 2gb server on ur ptero because everytime i attempt to run mc, a server and intellij my computer just dies
I really don't get why the event has no API for checking for critical damage... I had to first research the requirements of critical hits before I could get to actually thinking about the solution itself, haha
ok. do you have admin perms already?
yeah
thanks
np
greggs π€€
Ideas for perk event system
i dont care
that's the bridge vlan on the proxmox host
i cant have port 69696
no it only goes up to 65535 or sth lol
nice
want me to add a cpu limit, also do i add a swap size
ptero seems cool tbh
the server has enough free ram, just use whatever amount you like lol
oma how much do you pay for that?
if i have something like that i will make the best server i can xd
that's just a VM in proxmox. here's the actual host
and it costs roughly 100β¬ + 19% VAT per month
6 should be enough lol
if it's not enough, you can still raise it later
can you give me the link?
theres something weird ive noticed that i do
if im specifying ram for servers i do 1024 x gb size
and use that mb
germany and finland
i know them
Cannot seem to get that event to trigger twice, can you give it a shot? Here's the test code: https://paste.md-5.net/royimoxeta.java
Check your logs for the cancel message, I cannot get it to show up, and the event also only triggers once in general.
Maybe this is some sort of internal bug? I really lost connection to 1.8.8, as it has been ages since I actively worked with it.
how much disk space do i get
I'll test it, takes a minute or two
there's 418G left so choose yourself
Take your time, I'm not in a hurry! :)
immediate thought is 50gb, then i think what will i ever use that would need that ill use like 20gb lol
he problem i must pay a setup fee . :
im so fucking confused how the fuck does this work
what the hell
Those 32 cores seem like they could use some more usage, :).
yeah epic, do some heavy worldedit stuff
How do i make theese dependencies work?
did you add the spigot reopsitory?
repository*
also why would you add all those api versions
#1060646223075360829 anyone made a perk system can give me ideas xd?
you should use one spigot-api, not a hundred
I want my plugin to work on other versions
if you dont use nms do the above
if you want to do 1.16.5+ then use spigot-api 1.16.5
I have Integer x.
I have some Strings whose are Negative Spaced Characters.
I want to transfer that Integer, into biggest possible combination of those Strings
for example:
"pseudo code"
Integer xToBackspace = 20;
String outputed = "{NEG16}{NEG4}";
I somehow want to create a function, that will generate that outputed
Heres my current try:
https://paste.md-5.net/enamuyeren.java
Use case:
https://paste.md-5.net/yenobukito.cs
If you're missing a version, you could always install it into your local maven repository by running build-tools for that revision.
but that's just the api, it's in the spigot maven repo
@dry yacht I read through your code, 2 things. .#isOnGround() is deprecated, and the HashMap may be final. Should I ignore this?
I know, I'm just saying that, because I often just don't even bother with specifying the spigot repo.
there's no good alternative to isOnGround, just use it
and whether the map is final or not doesnt matter
true lol
should i use snapshots or releases? And if releases how should the dependencies look
Uhh
thankfully github copilot always adds the repo for me
Wbay are u doing?
rooster.jeff-media.com is redirecting to public ip right?
imma explain it to u in dms?
you can just use jeff-media.com:30069
thanks
Sure
Yes, ignore this. Sadly, the API gods have not provided us mortals with a better interface for checking critical damage yet.
sue them
dude what how the fuck does this work please tell me
That question just hurts my brain, tbh, xD
Like, waaaay too little context.
its on a thread
its printing, calling a function on the same fucking thread, which should print something, but it doesnt
it just printing the first thing
and other functionality in the stupid function doesnt work either
im so confused
Would be great to know what worker is and how it's set up.
Btw, seems unrelated, but sometimes the issue with printing can be unflushed buffers too. Like, you print something but it hasn't yet been flushed to the output device. But in this case, this is not an issue, as you print over and over again, and println internally flushes, iirc.
1 sec
Make sure you're using the right worker instance
i had it as a not static class first
but i thought that might be broken or smth
so i made it use di
with a static class
anyone know how to make github actions work with buildtools ?
for UpdaterThread
Please tell us the specific workflow you want to implement using github actions, and what's the actual issue you're facing.
@dry yacht thanks so much man, it works. You're a livesaver
Well as you know buildTools does stuff on maven local and my github action compiles and releases the jar as a latest release
do you already have a workflow file?
It works? Holy moly, I never thought that it would, lol. What a weird case! I'm very happy to hear that I could help you tho, :)).
Yeah, but what do you need from build-tools? Are you implementing against any NMS-APIs? Because the spigot APIs are available on a public repo.
Thanks
just removed the prints, the console gets clustered really quickly π
im wondering if i like make it method synchronized that changes a field x, will that synchronize on the whole object and prevent modifications on other fields too for threads that dont have the lock acquired?
Oh yeah, of course, they were just meant as a means to quickly debug your local situation, xD. You can now also make the map final, btw, as I forgot to do that and it's good practise (as it will never be reassigned during it's lifetime).
Is it possible to disable the chest open animation?
or is there a dif bwteen synchronized (this) and synchronized in a method declaration
hmm that will probably allow only one thread to enter that method and wont lock on the whole object
sometimes im asking weird questions
Very likely locks the whole object, especially if the target member is not another allocation in memory itself. But I don't think that Java in general locks on such a granular level automatically, without you specifically instructing it to.
I'm sorry idk what to actually do here.
I'm trying to convert my pack to a plugin but people keep acting really weird...
Like as if I'm not even allowed to be around them or learn how to do it.
hmm
Huh? That sounds mean, :(. By pack you mean resource-pack?
how do I set up gh actions so they can compile something with spigot remapped?
Yea I make optifine packs that require cit files
remapped: false # Optional
@dry yacht I been working on them for years now
id think that this locks the whole object java void setI(int i) { synchronized(this) { this.i = i; } }
and synchronized in the header only prevents two threads from calling setI at the same time
thx olivo
Optifine packs, hmm... Sadly have absolutely no experience with that topic, but I'm sure somebody might be able to pick up on it in this channel.
Is there a way I can remove a set of entities upon server unload (reload/stop)? So far, entities have to be in loaded chunks to be removed. I've tried loading the chunks, removing them, then unloading the chunks but that doesn't seem to fix the issue. I don't really want to keep the chunks loaded all the time to save memory because my plugin uses these entities heavily all around the world.
Of course it does, as the semantics suggest.
ye never actually used it before
Same, just a gut feeling, lol.
Well, I did, but I never properly read up on it's inner workings.
once wrote a chat app that uses Object#notify and Object#wait for sending and receiving messages :/
@dry yacht
As far as I understand. I'm able to convert my Json models to a yem or something to load into a plugin
I seen it in the quality armory plugin
But idk how to make my own plugin that's the issue
All you do is send a resource pack
declaration: package: org.bukkit.entity, interface: Player
@chrome beacon yea but
I want to make people stuff
Not just for my self so I was gonna start making pack plugins
Something along the lines of a method which removes all entities from a given world based on a <Entity, Boolean> predicate when called? Or do you already have a handle on these entities because you created them earlier?
I already have a handle on them, but I do remove them based on a predicate
for (world in Bukkit.getWorlds()) {
for (entity in world.entities) {
if (EntityUtils.hasFlag(entity, EntityFlag.REMOVE_ON_SHUTDOWN)) {
entity.remove()
}
}
}
I don't understand the problem?
I'm having a problem adding lands
what's the problem?
If I want to give someone trust on lands
Uhm you are probably in the wrong place for this. Ask in the discord of the developer of your target plugin also since your not a dev #help-server
You are always best off asking the developer though
Well, that's not what I meant by having a handle on them. You're still querying the whole server. I meant something along the lines of you having spawned them earlier, kept them in a list or map and now want to remove them.
Okay, and your issue is (probably) that the entities you want to remove are not showing up in your loops because their containing chunk got unloaded, right?
Just trying to understand your problem first.
damn
That would probably be the case, yeah
Would you suggest I save them in a collection to later on query it and remove these entities in a loop instead of fetching all of the world's entities?
Well.
I believe that I should attempt to learn how to do this.
But I'm scared because there is already a lotta work I gotta make but I'm still willing to try @chrome beacon
how is it still not 1000 or 999 whatever
How do you assign that entity flag to entities? Or rather when?
ah wait i print the i before the threads are done
Was just about to say this, but I thought that executor.shutdown() might join on these threads. Guess it didn't.
ok returns 1000 when doing awaitTermination
I assign the flag upon entity creation. It's just a metadata flag
oh i thought ExecutorService#join was a thing
oh this also works
not two times shutdown
Okay, that's what I thought. Then I'd say that it would be best to keep a local variable in the class which creates entities that keeps track of them, for later removal.
That collection should probably only be weakly referencing it's items, as I guess one of your spawned entities can die and be garbage collected later on, and you might run the risk of creating a memory-leak otherwise.
I'm not sure how bukkit internally handles entities, and if Entity#remove throws if that entity has been unloaded by the server. Your main issue is that you do not want to get as low level as modifying world NBT data yourself, which the entity should know it's exact place in and be able to remove itself.
I'd advise you to try the collection approach and see if you encounter any further errors.
What else, three times?
one maybe ,-,
what A ThreadPoolExecutor will automatically adjust the pool size (see getPoolSize) according to the bounds set by corePoolSize (see getCorePoolSize) and maximumPoolSize (see getMaximumPoolSize). When a new task is submitted in method execute(Runnable), if fewer than corePoolSize threads are running, a new thread is created to handle the request, even if other worker threads are idle.
@dry yacht it turns out your method of fixing the critical double hits worked, but only kinda. Sometimes my friend couldn't hit me at all for a second, sometimes the old issue came through again.... idk what to do now
Does anyone know why I would be getting "CraftWorld cannot be resolved to a type?" Like is the craftbukkit stuff not in the api? When I take it into luyten my api has it
That's why I left those debug prints in there, so you could check it's behaviour and check for when it actually cancels the event and when it detects critical damage, to maybe find out where it misbehaves.
what is spigot artifact?
are you using maven or gradle?
I left them in there at first, I just didn't notice the inconsistencies because we only tested it for a few seconds
maven
a WeakReference collection seems to have fixed the issue, thank you. It appears I was attempting to get all loaded entities in the world and removing them but I, of course, wouldn't be able to remove those that were unloaded
just change 'spigot-api' in the dependency in your pom.xml to spigot
thanks ill try that
Great! It's best to keep a "pointer" (weak ref) to your own created entity, rather than to query all chunks of all worlds (a ton!) to find them later on, based on some flags. You just cut out the middleman.
Add them back and check for cancellations which shouldn't apply, for example. I cannot really debug that system, as I cannot reproduce it locally.
It's hard to find out which cancellations shouldn't apply, since there are many instances of critical damage when fighting
I know, welcome to the world of debugging, :p! It does seem to me like this is a bug in general, something weird with the minecraft-server version 1.8.8. You could try reducing the 500ms to like, idk, 200ms (four ticks), if the delays seem to be too long when in quick combat.
hello,
I've wrote this class for Bukkit's Location serialization:
https://pastebin.com/vDDR1WUs
And using it like this:
Gson gson = new GsonBuilder().excludeFieldsWithoutExposeAnnotation().create();
List<JsonElement> countriesToWrite = new ArrayList<>();
for (Country country : countries)
{
countriesToWrite.add(gson.toJsonTree(country, Country.class));
}
try (FileWriter writer = new FileWriter(playerFile))
{
gson.toJson(countriesToWrite, new TypeToken<List<JsonElement>>()
{
}.getType(), writer);
} catch (IOException e)
{
e.printStackTrace();
}
Country class don't have any Location at all, but Plot (and there are plots in country.plots) have this:
@JsonAdapter(LocationSerializer.class)
@Expose
@Getter
@Setter
private Location corner1;
@JsonAdapter(LocationSerializer.class)
@Expose
@Getter
@Setter
private Location corner2;
The problem is, that when I'm using the code #2 for saving json, it gives me stackoverflow error (recursion). Why? :/
why excludeFieldsWithoutExposeAnnotation()
why not? I don't want them
it says 11 and 25
And what are those lines
Oh, right, you don't see it in pastebin. Im sorry
As i remember, 11 was just a class name and everything, and 25 was setting z in serialize
We can't help without seeing code
If you want it on this site, here it is:
https://paste.md-5.net/giyoxoxuza.java
What do i set my api version as if i want the plugin to work on multiple versions?
In plugin.yml
whatever version of the api you are coding with
1.13
Well whenever i put it as anything else than the version im using on the server it doesn't load. And i want one plugin file to work with all versions
you sure about that
cuz thats not how api-version works
I just get this error but the 1.12 changes to whatever i enter:
[22:41:32 ERROR]: Could not load 'plugins\DiscordServerStatus-1.0.jar' in folder 'plugins'
org.bukkit.plugin.InvalidPluginException: Unsupported API version 1.12
at org.bukkit.craftbukkit.v1_13_R2.util.CraftMagicNumbers.checkSupported(CraftMagicNumbers.java:226) ~[server.jar:git-Spigot-1a3504a-06534f2]
at org.bukkit.plugin.java.JavaPluginLoader.loadPlugin(JavaPluginLoader.java:131) ~[server.jar:git-Spigot-1a3504a-06534f2]
at org.bukkit.plugin.SimplePluginManager.loadPlugin(SimplePluginManager.java:332) ~[server.jar:git-Spigot-1a3504a-06534f2]
at org.bukkit.plugin.SimplePluginManager.loadPlugins(SimplePluginManager.java:252) [server.jar:git-Spigot-1a3504a-06534f2]
at org.bukkit.craftbukkit.v1_13_R2.CraftServer.loadPlugins(CraftServer.java:325) [server.jar:git-Spigot-1a3504a-06534f2]
at net.minecraft.server.v1_13_R2.DedicatedServer.init(DedicatedServer.java:213) [server.jar:git-Spigot-1a3504a-06534f2]
at net.minecraft.server.v1_13_R2.MinecraftServer.run(MinecraftServer.java:698) [server.jar:git-Spigot-1a3504a-06534f2]
at java.lang.Thread.run(Thread.java:750) [?:1.8.0_352]
It should be 1.13
^
And then it will work 1.13+?
wasn't api-version added in 1.13 ofc it would make sense it doesn't work with anything below that
if you are using 1.12 api don't bother adding it I'm pretty sure legacy mode will be activated
Any version. Versions below 1.13 doesn't read the api-version setting in the plugin.yml
yeah api version was added in 1.13
I coded it using 1.19 but im almost not using any spigot api stuff at all other than simple commands and send chat messages
Yeah
I get this error now. Do i need to change the java version im using in intellij?
/DiscordServerStatus has been compiled by a more recent version of the Java Runtime (class file version 55.0), this version of the Java Runtime only recognizes class file versions up to 52.0
Yes you need to use Java 8
Okay
Is it a maven setting or intellij setting?
Change the 11's to 8?
yeah
I changed the 11 to 8 and i have this in the project structure but i still get the same error
1.8 iirc, not 8
In pom.xml?
Yes
Im still getting the same error :/
[23:06:16 ERROR]: Could not load 'plugins\DiscordServerStatus-1.0.jar' in folder 'plugins'
org.bukkit.plugin.InvalidPluginException: java.lang.UnsupportedClassVersionError: com/gampis/discordserverstatus/DiscordServerStatus has been compiled by a more recent version of the Java Runtime (class file version 55.0), this version of the Java Runtime only recognizes class file versions up to 52.0
https://stackoverflow.com/questions/53642402/why-do-i-see-open-jdk-1-8-instead-of-java-8
I always thought that 1.x === x, as they at some point in time started to take the minor version number and use it as a standalone version number.
55 refers to Java 11, so you're still compiling with 11.
Can you share your whole pom.xml in it's current state please?
Ok
They dropped the 1. In Java 9 and above
Just paste it in or should i use some website?
?paste
But specifying Java 1.8 as 8 will be fine with all java compilers.
Did you run clean before package once? And please make sure that you actually overwrite the file in your plugins/ folder, as that's often the issue too.
I don't understand the first thing you said but the file has changed because the time last changed is correct
Well, how do you usually initialize compilation? I use IntelliJ's maven window.
I just press install
Then press clean first, then do your usual thing
Maven tries to cache compilation units and strives to compile as little as necessary, so it may be stuck at not re-compiling the necessary parts because it hasn't been noticed of the version-change properly. You can force a complete rebuild by running clean first.
It worked! Thanks alot for your help
Happy to hear! :).
Damn, I forgot to uncheck that. I'm sure it'll bother me a million times with "do you want to update" now, :(.
lol why would you evern uncheck that
Living dangerously
Because I don't want to update to Ventura, as I always postpone updates as long as possible to let them mature further. Doesn't seem like they have fixed anything I'm interested in anyways.
security matches moment
i make a tab complete yesterday, and it was working fine, but now i ge this error
error:
https://paste.md-5.net/ruwifenema.bash
main class:
https://paste.md-5.net/qovihogifa.cpp
data manager class:
https://paste.md-5.net/vixigudelu.java
tab completor class:
https://paste.md-5.net/beyocufuka.java
Is it possible to disable the chest open animation?
your config section is null on wtptab.java line 27
but security patches
great!
np
show your config.yml
or whichever file the data manager thing reads
SHARE A PIIC
you said your lobby works
so I want to see a screenshot of your lobby lol
:<
what like
In what sense
