#help-development
1 messages · Page 1916 of 1
you can't read text written to console using System.in unless you send the whole thing using enter
yea cuz of that
im not sure about thaz
maybe it would be an idea to dissect the GUI part from the minecraft server software
i stopped looking for that
mc somehow manages that
ppl just can do "?" or "help" and see the cmds ^^
what
thats the only option we have
the low level mechanisms you are looking for is the shell environment. Otherwise your most basic command line which is prompt does not facilitate this at all.
reason why you need to know commands off the top of your head in these basic prompts 😛
or query the available commands
Isnt it the same using a Long or Date as timestamp?
technically can if you are listening for key presses
Hi any one can tell me what packet should i use to rotate armor stand position NMS stuff ?
separate system then in since that refers to input
sounds simple but is there any api for that in java?
probably
there's a C library called GNU readline
it allows fancy things that is used in linux stuff like nano, htop, vim, emacs
Why using C with Java?
still cant find any similar in java :/
how to check if blocks is crops
You can use JNI. For example you create a method on C that you can call from Java
But you should load first the ddl and then calling the methods
still readline is hardly documented. quite time consuming to find a working example
you can access C/C++ libraries using JNI in Java just fyi
For command line on console you can use the one that uses Spigot/Bungee
which is????? 😂
Jansi
thank you 🙏
How do I change nametags of players? the name above their head?
Thank you (w/out using plugin) just like, java code
do u want to color them
yep and also add rank name w/ 16 chars +
use scoreboards then
please elaborate
scoreboard team prefix
make a scoreboard team add the player to it set prfix
prefix
then boom
how does nametagedit api plugin do it ?
any one know packet to rotate armor stand
you need a packet why
is this efficient ?
hi md_5 😊
How do I get the itemStack responsible for breaking a block in BlockBreakEvent
yep fake armor stand
better than fucking with nms and packets for such a simple task
event.getPlayer().getInventory().getItemInMainHand()
iirc
Well when u are here there I tried to do this without packet but in craft Player there is vehicle check which dosn't allow teleportation player
because check is before PlayerTeleportEvent.
So all other plugins like essentials teleport command get blocked when u have passenger and there is no way to dismount passenger because teleport method is cancelled by that vehicle check.
Would be nice to have some PrePlayerTeleportEvent where it would be possible to remove passengers and add them back after teleportation.
So I am forced to use packets and benefits are no dismounting when player goes in water and no problem with teleportation.
I know there was some glitches with player teleporting with passenger but like I said PrePlayerTeleportEvent would help a lot
So that is why I use packets and now i got all running just not sure how to rotate armor stand with player
custom model set up on armor stand head
you can set the direction of the armor stand do the same direction your player's head is looking
well that will look weird
I need body rotation
like if you move your head
your wings will move
I am not sure what packet is for that
i love the idea of having those wings in my head somehow
it is plugin and custom resource pack
wings on head
xd
Why would you....
oh man xD if they would know how things work ... or at least have some experience before abusing stuff
Ah lol you can?
And that date its converted to what format? UTC? EST?
Hi, can you help me identify an error in writing a line of code in the datapack?
How do I make "this" potion part of the code
Here is an excerpt
{
"item": "minecraft:potion{potion:"long_invisibility"}"
}
When added to the world, it cannot define this potion.What do I need to do?
Why using json?
Json it shouldnt be used to save/keep data. Cuz json its only a data type format
Is there a better and more convenient option?
Yes of course
Its called Yaml
You should use yaml files for saving/getting data from plugins
And if you want something more complete a database like Mysql or MongoDB
or use plaintext
And also you have online Json parsers which told you what wrong
He is just writing the datapack, isnt he?
👍
I need to think about it
For plugins never use Json, just use Yaml or Database
Is there a way to get build tools to output the spigot jar with the version in the title? IE how paper has Paper-1.18.1-177.jar
Why? Gson is cool
Yes , I just create a datapack with different
a set of information
I have say it many times
Json = DATA TYPE FORMAT
😡
What
Json a should only be used as Data strucutre
why
json is way reliable than the builtin yaml config stuff. not ignoring io exceptions
I wont fight I only will repeat the same. Json its not designe for persisting data
json and yaml are both way to serialize structured data
none is better or worse
still need to parse/serializebon every load/save
yaml has more support for bukkit, like item serialization
I mean yaml is a superset of json. So you can use json in your yaml configs if that's what you prefer
adding spigot to the build path seems good until i try to import, it just says org.bukkit.craftbukkit and org.bukkit.craftbukkit.bootstrap as the options and when i try otherwise, i get a unresolved symbol error
?bootstrap
Bootstrap Jar
The main spigot-1.18.jar is now a bootstrap jar which contains all libraries. You cannot directly depend on this jar. You should depend on Spigot/Spigot-API/target/spigot-api-1.18-R0.1-SNAPSHOT-shaded.jar, or the entire contents of the bundler directory from your server, or use a dependency manager such as Maven or Gradle to handle this automatically.
Please read the release notes for further information: https://www.spigotmc.org/threads/9-years-of-spigotmc-spigot-bungeecord-1-18-1-18-1-release.534760/#post-4305163
thank you
yes iirc
I think the question was whether the file is read everytime when doing sth like getConfig().getString(...)
spigot wold be bad if that were true
speeghurt
Is difficult to put the player head in tab lines?
what
json is better than yaml for saving data
it does not require indent
yaml is more like for humans
Like I want to do this:
when you do tab, before your name appear your head
I have seen that its possible but coudlnt find how to do it
Also hello, how to make sure that it is this effect of the potion that needs to be created by any object?
How do I point this potion in the datapack code line?
I don't really use bitbucket, is there a way to git clone without having an account?
(specifically the spigotmc bitbucket)
This is me wanting to actually play with the source code a bit, that's why I ask
Buildtools downloads the source code
yeah but it deletes it when the jar is finished doesn't it?
No, why would it do that
Maybe I'm doing something weird then
you can also try to make PR with good stuff ... but cool stuff always need a lot of time from md5 >:D
In any case, Bitbucket has a very prominent clone button
But you're gonna need buildtools to compile it anyway
that requires applying for an account, and I just want to play around for now, maybe later when I understand this more
oh my god it does
I truly am an idiot
You're still gonna want to use buildtools
np that was more a little offensive to make md5 add a event with an PR that: BlockDamgeAbortEvent
Run buildtools and look in the folder, all repos and source are there
Oh I see the problem, the script I was using deletes everything when the jar was finished
my Jenkins build has the source still, so I was very confused
I don't need the script anymore, so at least this will save me a bit of mistakes
How can i set armorstand marker only for client? Probably using packets, but when i trying to do it, it is changing on the server too
why is it important to the server that it is marker or not ?
I want to put a passenger on the armorstand. When the armorstand is the marker, it loses the hitbox size, so the passenger will be at the bottom, I would like not to change the passenger position, but get rid of the armorstand hitbox
Anyone have an answer for this issue?
wdym "it doesn't work"?
When the corpse is created after the player “dies”, it gets put into spectator because the player is in spectator, if I change the players game mode the npcs game mode will change as well.
I thought that it might be because I’m creating the npcs game profile using the players uuid but if I try and use a random uuid the npc doesn’t show up
you also have to send a packet to let players know that a new player "joined"
again, just for tinkering purposes, if I want to build a buildtools jar, do I just run maven in the buildtools folder?
If the entity gets put into spectator can't you just send a packet to make it not in spectator
by packages, am I able to achieve this?
Md5 I love how you find a way to contimues working on the Project
I am trying to keep data on a trident when a player throws and picks it up. I can set data using PDC no problem. I can set this data on the entity itself or the itemstack. The data is saved when the trident is on the ground. However, when I pick the trident up, the data is gone. how can I keep this data?
Which packet would I send
Is EntityPickupItemEvent?
ClientboundAddEntityPacket
and
ClientboundSetEntityDataPacket
e.g. I do this to show fake entities to players
@Override
public void showEntityToPlayer(@NotNull final Object entity, @NotNull final org.bukkit.entity.Player player) {
PacketUtils.sendPacket(player, new ClientboundAddEntityPacket((Entity) entity));
PacketUtils.sendPacket(player, new ClientboundSetEntityDataPacket(((Entity)entity).getId(), ((Entity)entity).getEntityData(), true));
}
Does anyone know how to add children to a path in .yml without using Spigot's built in methods - i.e do it just with SnakeYML?
that doesn't seem to be called when I pickup a trident
according to this, it should work though :/
@delicate lynx
declaration: package: org.bukkit.event.player, class: PlayerPickupArrowEvent
this should work
I assume you talk about "thrown" tridents that are stuck somewhere instead of normal "item" tridents, right? If so: PlayerPickupArrowEvent
Are those custom classes that you made, the ClientboundAddEntityPacket
is it normal that on EntityPotionEffectEvent, when the effect is added both newEffect and OldEffect are null is that normal and how do i get the effect that was added?
In what case
Hi guys I’m running spigot 1.8 trying to use dlog4j JVM arguments to secure my server how ever it just says error and class doesn’t exist when launching server please help
Build tools version latest
- #help-server this is for development.
sigh
build a current upto date spigot jar and it is secure
when you throw a potion
See this is an or. One or the other has to be true. What Action is occuring?
So then getNewEffect would be not null
it is null
So when you use a splash potion the getNewEffect is null?
And did the player get affected by the potion?
yes
?paste
that's my code
when you modify the potion effect
it works
but when you add it it doesnt
if you didnt already have that effect its null
Wait so to get this right you know what the old effect is right?
You do a useless null check up here because one of them will always be null by nature of the event
You're then checking if it's changed which it's not because it's ADDED so it goes to the else to get the old effect but there is not old effect because you're adding a new effect?
In my opinion this code is super messy and should be heavily cleaned up before continuing as it's extremely unclear what you want to do here
lol no
that's the normal class name
what's your MC version @cold pawn ?
you have to use mojang-mapped to get the proper class names. if you just use normal spigot.jar as dependency you only get the obfuscated and renamed mappings
Any one knows how to ride and control the ender dragon?
just like ./hack it
controlling is only possible by using a fake entity like an invisible boat
shesh
I’m still using 1.16
I thought it was because O couldn’t call an instance of it 😅
But yeah that would make sense, how I figure out what I’m suppose to call then?
Sorry i looked at the wrong pic
lol yeah I was about to ask what you meant
Literally study the code base
And figuring out yourself
Hey guys, I've created a 1.18 plugin but I want to support 1.16 and 1.17 as well. I'm not using any features not supported by those older versions but my plugin still won't load on them.. should I change the native version of the plugin to the oldest supported version or is there a better way?
yes, you need to code against the oldest version you want to support
Yes, downgrade plugin.yml's api-version
@Override
public void showEntityToPlayer(@NotNull final Object entity, @NotNull final Player player) {
final PacketPlayOutSpawnEntity packetSpawn = new PacketPlayOutSpawnEntity((Entity) entity);
PacketUtils.sendPacket(player, packetSpawn);
final PacketPlayOutEntityMetadata packetMeta = new PacketPlayOutEntityMetadata(((Entity)entity).getId(), ((Entity)entity).getDataWatcher(), true);
PacketUtils.sendPacket(player, packetMeta);
}
This is the same method that I already sent, for 1.16 @cold pawn
Ok yeah I'll do that thanks
"still won't load"?
?notworking
"Does not working" is a useless statement. Please describe what exactly is not working, what you expect it to do, and what actually happens. If you get any console errors, also ?paste the entire stacktrace.
I know why it's not loading (API version too new) but I'm just wondering if there are steps for supporting older versions that I wasn't aware of
That are better than just straight up turning down the version in my plugin.yml
oh yeah just set api-version to the lowest version you want to support
(I always use 1.13 lol)
Lol I can prolly turn it all the way down to that
Since I'm not using netherite or new blocks or anything
I always do 1.14 lol cuz that's the village and pillage update
yeah I also don't actually support 1.13
it's just what I ALWAYS use in my plugin.yml because that's what my pom generator always spits out for me to copy paste
Im making cosmetic plugin, so there is "no" way to ride the ender dragon?
ride, yes. control, not without fake entities and a bunch of NMS
Can you explain a bit about " fake entities"
you want to make the player be a passenger of a boat, or minecart, etc. Then you can check in VehicleMoveEvent when the player pressed movement keys and then apply the velocity somehow on the real enderdragon
of course the boat, minecart etc should be invisible
but tbh it's very very complicated if you want to do it properly
what exactly do you want to do? disguise the player as enderdragon?
if so there's libraries for that, e.g. LibsDisguises (no idea whether it's still maintained but it was very popular some years ago)
I want to make player riding the ender dragon at the end of the match (like hypixel 's victory dance)
no idea about hypixel but yeah you're gonna have a bad time if you don't use LibsDisguises etc
you could basically just kill the original dragon, then disguise the player as dragon
how do I edit the particle trails of an arrow?
Like changing the pattern to the snowflake particle
You’d have to intercept the particle packet and change it to the snowflake particle
it still
but it probably too stable for the author to update it
so he only updates once in a while
how would I do that?
I tried this but the entity is still not visible
There are quite a few threads online about it, I’d recommend ProtocolLib tho
Yeah with Ptc. Lib its everything easy
Are there ways to like simulate fake events?
Like, simulate a fake PlayerConsumeItemEvent or whatever it's called?
Or any event
MockBukkit allows it
But in principle, you can just invoke the event with plugin manager
Just make sure to not do it infinitely recursively
my pc lags with other ide
Is there a guide into turining an existing project so it works with gradle
In intellij
add a build.gradle and settings.gradle and then run gradle wrapper
IDEA will be able to detect the new buildscripts and sync up with Gradle
anyone know why this code isnt working? im not getting any errors, and i use this EXACT same code all over my plugin
public class OnRespawnEvent implements Listener {
private Classes main;
public OnRespawnEvent(Classes classes){
this.main = classes;
}
@EventHandler
public void onRespawn(PlayerRespawnEvent e) {
Player ply = e.getPlayer();
UUID plyID = ply.getUniqueId();
String calledClass = main.getConfig().getString(String.valueOf(plyID));
// String realClass = CustomConfig.get().getString(calledClass);
if (calledClass != null) {
for (String section : CustomConfig.get().getConfigurationSection(calledClass + ".effects.").getKeys(false)) {
PotionEffectType type = PotionEffectType.getByName(CustomConfig.get().getString(calledClass + ".effects." + section + ".type"));
int potency = CustomConfig.get().getInt(calledClass + ".effects." + section + ".potency");
ply.addPotionEffect(new PotionEffect(type, Integer.MAX_VALUE, potency));
}
}
}
}```
say if i've got a location and i want to select a cube using a radius, how would i go about getting the max/min of the x,z?
Does it matter what folders all the files are in
yes
Player press E to open their inventory, and then move x item to offhand slot
Is there any way to check which item is it, and then cancel it ?
probably
declaration: package: org.bukkit.event.inventory, enum: ClickType
i tried to called the PlayerSwapHandItemsEvent event but it's only fired if player swap item using their hotkey (default is F)
This is an inventory event not a PlayerSwap event
code here, it's actually cancel when player press F
Yes but you're talking about an in inventory event right?
declaration: package: org.bukkit.event.inventory, class: InventoryClickEvent
This is probably really dumb but I don't know how to make this found 💀
Shouldn't that be 1.16.5 anyways
I don't know of any API changes from 1.16.1 to 1.16.5
I doubt any part of it that I'm using would
But still the plugin wouldn't load on 1.16.2 or something if I set it to 1.16.5
Either way
Idk how to make it any version because they're all not found
That makes no sense
The version in the pom.xml only controls what version you're linking against
It has no bearing on the actual functionality of the plugin
When it was set to 1.18 it didn't load on 1.17
It just said "api version is too new"
Yea it is
API was a typo lol
Without that it still wasn't found but that doesn't matter
Cause I wasn';t even looking in the right place
Did you make sure you register the event in ur main class?
Delay adding the effects by 1 tick
can someone link me a hikaricp tutorial?
I can't cast Bukkit.getOfflinePlayer() to type OfflinePlayer (it says that the required type is player) yet the function then causes an error saying that the OfflinePlayer can't be converted to Player. How can I get around this?
ty
offlinePlayer.getPlayer
However this will not work ud player is not online
how to use Consumer class?
I need to be able to access data from the player e.g. their statistics while they're offline
Which is why I've been using getOfflinePlayer
There's methods to get statistics on offline player
I know that, but my issue is that I can't ever use the offline player I got because of the issue I mentioned above
If I cast it to Player, it causes an error when I try to get the offline player
If I cast it to OfflinePlayer, the IDE gives me red squiggly
Show the code
Ok
You cant use offline player on method which takes player
Getting offline player by name is also bad practice
Hi! So I finished my first plugin (just repairing an open source one and updating plugins and dependencies) and when I go to put it in my server is says "[23:50:07 ERROR]: Could not load 'plugins/Core.jar' in folder 'plugins'" with no other errors. Any help?
Send the log file
In pastebin
?paste
The log is the .log.gz right?
Should be a latest.log open and dump into paste and send link
Well there you go there's your answer
I have no clue what thats saying
Read it to me
The second line says what
Gotta let them understand how to read errors
It says that but my protocol lib doesn't error in the console while building or in the pom.xml
Do you have the dependency jar in the plugin folder?
No. I didn't think it was a plugin.
Try that
Yea maybe I should do things and not be an idiot
this is dumb mainly because anyone who runs 1.16 isn't going to be running outdated minor versions. It is the same thing with 1.8. You don't have people running 1.8 over 1.8.8 for obvious reasons.
How does literally every plugin on spigot say 1.16.x 1.17.x then
because the changes in a minor version does not affect the API
🌮
otherwise that would be a major version change
Yea so I should be able to support all versions and not just 1.16.5
I think I already did that
How can I make right clicking an item give it a 50 second cooldown?
I was looking in the wrong place when I sent that screenshot
I've already fixed that issue lol
what I am saying is support the highest minor version of a major version and you will be fine
and can claim safely you support 1.16 to whatever
Hmm
Doesn't the plugin then spit a big error because its version is 1.16.5 and the server version is 1.16.1 or whatever?
who is running 1.16.1 over 1.16.5?
Not sure if the plugin worked or not so imma log in but I got a BUNCH of errors.https://paste.md-5.net/qujisibufi.md @vocal cloud
Probably some insane person
so you want to support that one single person over everyone else being sane and using the highest minor version because of security fixes by mojang/spigot?
It just makes sense that nothing will have changed relevant to my plugin between 1.16 and 1.16.5 so I will support 1.16 so they can run it on all 5 versions
if you like making it more difficult on yourself sure go for it I guess
I can't help if people don't follow the advice of more experienced people
Isn't it just setting the number to 1.16 instead of 1.16.5?
Cuz I just did this
And now it supports all of them
Doesn't it?
Did I misunderstand how that works?
I probably did
no, I am saying stop making it harder on yourself to attempt to support all the minor versions when there is no benefit in doing so
@vocal cloud it keeps crashing my server and can't download any of the dependencies.
There’s nothing wrong with supporting more versions if it’s trivial
Seems like it’s trivial here
Why can't you download any of the dependencies?
Yea I would understand that if it meant changing my code to support the versions - but I'm not doing that, I'm just removing two characters in my plugin.yml lol
Yeah that should be fine @short raptor
It keeps saying this and crashes after starting fully https://paste.md-5.net/qujisibufi.md
You're screwed lmfao. That's disgusting
I don't have the time to go look through the changes between the minor versions but sometimes, a minor version contains a security exploit and by supporting that version you essentially support security flaws 🙂
you just leaving me at that...
but hey do you though people love hard work like this it seems XD
What you're looking at right there is actually disgusting
What is it
One person making their plugin not support a version is not going to force someone to upgrade if they don’t want to
The entire difference is two characters.................... lol
That most likely means there’s a reason they aren’t upgrading
In MY case at least
That's some runtime byte code manipulation
nope but if more developers did that it would
What does that mean
Well for starters it's a terrible way for a plugin to exist
I believe developers have an inherent responsibility to not encourage using software that contains security flaws
Huh?
I just am trying to get this open source plugin to work. Is there any way to fix it?
That’s your personal opinion, has nothing to do with “experience”
Let people do what they want with their minecraft servers 😂
Use a shaded version of the jar? Doesn't the output for the plugin have a shaded variant?
The hell does that mean
it does have to do with experience, because only those without the experience support such things
When you built it into a jar file it should have a shaded version as well
I don't know of experienced developers who encourage use of outdated software just because
Nope, just a single jar.
That’s just not true lmao
There’s a reason plenty of large networks still run 1.8
I assume you're Core is the plugin you're updating right?
and yes.
It's got to have some sort of xml file called pom.xml
Being a large network has nothing to do with experience, just means you are popular
or gradle
Yea it has pom.xml
its like saying because someone is popular on youtube they should be a finance adviser
Send that in pastebin
when they are most likely terrible at finance
Except those large networks have teams of experienced developers
Not exactly true
again popularity does not mean experience
and you answer for all large networks?
People sometimes cut corners paying staff and instead pay low amounts for unexpirienced staff
The hiring process isn’t noticeably different
that didn't answer the question
God this plugin makes me sick. Lmfao reflection to download dependencies what a joke.
Replace their build with this and try it https://paste.md-5.net/nikojihogi.xml
If we’re paying a full time job’s salary then yes, we look for experienced candidates
Not who I’m talking about
Still not answering the question, do you answer for all large networks?
Not the whole thing just the build section
wdym replace their build with that? You mean the whole pom.xml?
I speak for where I work and where colleagues of mine work
It has a <build></build> section replace it with what I sent
Oh wait. You mean just the build section
Collectively decades of experience in development being put towards servers running 1.8
So no, experience does not mean forcing the latest version just because
Holy my intellij does not like copy paste
so no you don't, you can only say for where you work right. Which doesn't make up all of the networks available. You are one of however many large networks. Which it is a popularity contest. You can have the most shitty software running and still be popular
You said experience
Probably going to need to refresh maven after
It says the version for maven-shade-plugin is now invalid
Wait nvm. Fixed it
Nvm broke again
@vocal cloud what did you do to maven-shade
experience has nothing to do with popularity. Which means those who run outdated software tend to not be experienced to begin with. But as I said before, the large networks are not large because they have experienced developers it is because they won the popularity contest. Its like trying to saying google is the best because they are bigger. Which is not true at all.
Once again, you’re conflating experience with your idea of quality
Experience is time in industry
you run package?
The larger networks can afford to pay for the experienced developers, so that’s who works there
anyways I am done with this debate if you like to encourage outdated software so be it
smart idea.
My job is to maximize retention and profit, not to evangelize the latest software update
That’s where my experience goes
Man yall need to take this argument to DM's
@vocal cloud it says this now ```Compilation failure
Bad service configuration file, or exception thrown while constructing Processor object: javax.annotation.processing.Processor: Provider network.palace.core.plugin.processor.PluginInfoProcessor not found
of course it is, why would I have expected you to care 🙂
Also the maven-shade-plugin still doesn't work
Bro shut up and go somewhere else
no thanks
Like actually
but you are free to mute
please do
Good idea
we are trying to fix something
That's exactly my reasoning - there are some people who aren't on the latest version for whatever reason, and it takes two keystrokes to support everything else. Why should I lose those users?
To recap, there’s no need to belittle developers asking for help because they’re supporting multiple versions. Be a more positive influence on the community
@vocal cloud the maven-shade-plugin still has the error and I get this ```Compilation failure
Bad service configuration file, or exception thrown while constructing Processor object: javax.annotation.processing.Processor: Provider network.palace.core.plugin.processor.PluginInfoProcessor not found
You’re absolutely right, if someone has a reason they don’t want to update then it’s not your job to make them. If it’s no extra effort for you, go ahead and support that version. Seems like you already figured out how
I belittle people who support buggy and security flawed software because they prefer to maximize profits above everything else. I can at least do my part to attempt to educate why supporting such things is actually bad and not support the developers that do so.
If you want to do the opposite I am not stopping you
I am preventing no one from doing anything
not that I could anyways 😛
If you don’t want to help you don’t have to, but there’s no reason to belittle others asking for help
🤡
IMO I don't support outdated versions of minecraft but I don't go out of my way to bother others about it. Just leads to unnecessary arguments.
It’s 2:30am I’m just running my phone battery down 😂
Then take it to DMs
Anyways, as I said I am done with the debate, you haven't convinced me what you have said was better 😛
God no, I’m not opening my DMs to him 😂
I don't DM anyways
Then take it to #general
also you guys know there is threads?
Not going to lie I forgot about that feature
Discord added like 20 things recently and I can't keep up
yeah I have hard time keeping up with some new things too lol
Try swapping the configuration in the plugin for build with
<configuration>
<source>16</source>
<target>16</target>
<compilerArgument>-proc:none</compilerArgument>
</configuration>
See if that gets rid of that error
The maven-shade-plugin still errors saying its not a thing
Should look like this https://paste.md-5.net/azeyudinak.xml
Guys... i need your input... Why should md5 add a BlockDamageAbortEvent ?
whats the use-case ?
what do you need javax for?
Nope doesn't work
It should. Works for me at least.
No clue, not my plugin. I am updating an open source plugin
Let me try package again I guess
Don't think its gonna work tho
in the recent versions of Java, I think at 1.12 Javax was removed from the JDK and is now its own package deal that needs to be installed separately
I ran package and now I am getting all these errors for cannot find symbol
where do I find it
I have java 17 installed
yes that means you don't have JavaX installed
because its not part of the JDK anymore and thus not installed by default
which why you are having problems most likely
1.11 of java and below javax is part of the JDK
but versions after that it is removed
I can't find it
then I am not sure what happened to it either way it annoys me to that some things were removed from the JDK
So java 11 works with it?
but at least now you know what is most likely your problem and thus can most likely solve it 🙂
last I known it should have it, but I could be wrong just look at the changelog
Maybe, but I also realized in my search that Javax is part of the JCP's so also still possibly you don't have the one that is required
I just want to kill this thing
Anyways they change too much in Java these days -.-
good news with Javax is that if you don't have it you can most likely add it as a dependency with maven
Remove the <compilerArgument>-proc:none</compilerArgument> if that's throwing errors. Ugh is the source code public somewhere? Do you have it forked?
Yea let me send the git link
I am interesting in looking at it too
This is the original unmodified link https://github.com/PalaceInteractiveArchive/Core
never had this much problem with shading except with sealed jars
Why are you trying to use this disaster
Because the project I am making is an exact replica of the server and one of the plugins I need for the server uses that.
so is there a reason you need the annotation processor?
I mean you are just trying to compile it right?
This is the pom.xml I have rnhttps://paste.md-5.net/lecikehaye.xml
if that is the case you can just remove the annotation processing from maven
how
but not telling maven to process anything, because from the looks of it the annotation for the project you linked is for displaying errors in maven
doesn't appear it does anything else
the main thing is getting it to work
since I tried using it and the plugin wouldnt work
It'd help if they didn't do reflection bullshit for the missing dependencies
okay, finally got java 11
but it appears you might need a jsr dependency not entirely sure, I generally don't mess with annotations as I don't like them XD
well I would comment out the annotation processing to see what happens
That's the hard part. You'll probably need to figure out which annotations it is first and then manually setup maven to figure them out
if it compiles test it out, but like I said it doesn't appear that the annotation does anything except process code on compiling
to then display errors to maven log
or halt the compile process or fail it
Changing java sdk right now
So are you doing this for 1.12?
Yea
By asking the developer and not asking here cause this is for development help?
For 1.12?
It says "Module Core SDK 11 is not compatible with the source version 16
8 even works for 1.12 but you'll need to make sure your pom is switched to whatever you're using
this should be 11
or 1.8
or w/e you're building it with
well I don't see why you need the annotation processing
and now I get a bunch of "bannot find symbol"
Send it in a pastebin
What do I sent
The error
the annotation processor being used in that project which is Messenger is for the compiler output
It litterally just says this as the error invalid method reference
There's no way to convert an OfflinePlayer to a Player is there.. I don't want to copypaste my whole code just so I can create a second function that accepts OfflinePlayer as input lol
you might need to clear your cache
since intelliJ crashed
it didn't just took a while to work
Found the full error
Player extends OfflinePlayer
so yes you can
If you get the OfflinePlayer there might not be an OnlinePlayer to represent it
you can cast OfflinePlayer to Player or there should be a method in OfflinePlayer to get a Player object
however, as Mike said
I can't do that when the player is offline
Which is the whole reason I have my OfflinePlayer
then I am not sure why you would need to convert it to a Player object
if they really are offline
A player object only really works if the player is online
@vocal cloud @wet breach
Well I have my function, in which access some parts of the Player/OfflinePlayer object, but since Java is statically typed I'm forced to create two functions to work with both of those even though, to my code, it doesn't matter which it is
try running the clean build cycle and then build it again
E.g. both Player and OfflinePlayer have .isOp()
already did
weird then o.O
it didn't do this before when it was calling from the plugins and not the new code @vocal cloud sent me
See you can now restore the old code
And see if with 11 it works
but I imagine it's going to do the reflection bullshit again
I have no idea where the old code is
it will
thats what I mean
If you pulled it from github you can rollback the file
you don't need two functions for those things, there is methods in the API for checking if a player is online or offline, but Player objects inherits everything from OfflinePlayer. You technically can make a partial player object if you really wanted or what seems like the better choice would be to create your own wrappers for these things.
no way am I doing that. I spent 3 hours updating all of the plugins
FOUND IT
went back to an old pastebin
Rolling back the file doesn't change dependencies
okay so it still does the same thing and I have no idea what I did to make it do this
This function has over 100 lines & I want to avoid duplicating 90% of my file, but my player variable here could be either OfflinePlayer or Player. All I want is to either find a way to make it accept both datatypes or convert one of the datatypes to the other
clean maven first
I have several times. It still wont work. Says "Cannot find symbol
maven clean is erroring?
if you want it to accept both, then make it OfflinePlayer because Player can be casted to OfflinePlayer if need be or vice versa
😮 Ok I'll do that
Coming from Python to Java typing is hard lol
and offlineplayer has a method for checking if they are online
It just keeps saying this https://paste.md-5.net/evovacicul.coffeescript
Omg that's so smart I didn't think of that
Thank you so much lol
I can do you one better though if you really want
someone help me my brain is about to explode
Please do because now I'm experiencing pain over fucking variable scope
public void checkPlayer(OfflinePlayer | Player player)
a little unknown fact is you can use or in the constructor too 😛
Personally I wouldn't use that junk project 
WTF
I have to for my other plugin which HAS to work to be able to
just make sure before you use API from the player object you check first they are not offline
@wet breach do you know anything else I can do?
I am puzzled just as you are but as I said the annotation processor doesn't seem necessary so, I would try to compile without the annotation stuff
you are a liar
How do I do that
😨
give me a sec to load up my IDE
just don't setup the stuff in the pom?
If you're joking about that consider your life ended
That or trick solves my entire problem so easily
wdym
I can't bear for it to not be real
tbh that doesnt make any sense
I think he needs two different methods
how do I restore using the github
well hold on I don't have a fast computer to load stuff XD
one for OfflinePlayer and one for Player
he can use the same same for the method tho
I'm aware of overloading but I didn't wanna do that because my method is quite long and I'd like to avoid such a big copy paste
I don't need to change the code within the method at all to make it work with either OfflinePlayer or Player
Well they could do that too, but at minimum they can use OfflinePlayer becaues of casting, but I am quite positive Java accepts or in the constructor 🤔
It's just the datatype the function accepts that's being annoying
i mean, you can do something like this
Could you send me the version of the pom.xml I need to get this to work
player extends offline player
Yea I tried to do that but I got stuck with stupid variable stuck in the scope of my IF statement
<compilerArgument>-proc:none</compilerArgument> comment this out or remove it to not have the compiler try to process anything
otherwise as far as your errors go though, they seem more like cache problems and really don't know what is the cause of those new errors except that
🙄 my player variable gets stuck inside the if because of scoping and my issue with datatypes just comes right back
the only other thing that I could see causing the problem would be that the dependency is compiled with a higher version of java then what you are trying to compile with
Its telling me this now ```Compilation failure
Bad service configuration file, or exception thrown while constructing Processor object: javax.annotation.processing.Processor: Provider network.palace.core.plugin.processor.PluginInfoProcessor not found
You are trying to shade in core right?
yea
since we don't need annotation you could probably comment out lombok dependency too
So I know you missed it @wet breach so I'll show you what happens when they don't https://paste.md-5.net/qujisibufi.md
well then....
Possibly the dumbest shit I've ever seen
might need to have that changed then
I mean you could just put the libraries in there
Yeah if it was shaded this wouldn't happen
since it is a fork of a project, I would go about changing that
I GOT IT TO WORK I THINK
did commenting out the dependency I said work?
no but it fixed the other thing
because your next problem is now going to be needing to shade in dependencies it does require
but now it wants me to have javaX again...
what the hell is it with this thing and javaX
yeah I would just go about checking that reflection stuff
how
already is
You just need to find where the reflection is being used to download the libraries which makes no sense since maven could download those things before and shade them in
its 3:30 AM and I still can't solve this
how do I shade them though
with the maven shade plugin
I have available elements to put into the project when making the artifact
that is already in the pom, and then adding to the dependencies the tag to compile them instead of saying they are provided
yeah but when I shade it wants javaX
Bad service configuration file, or exception thrown while constructing Processor object: javax.annotation.processing.Processor: Provider network.palace.core.plugin.processor.PluginInfoProcessor not found
I fixed it.
I can't believe
it was that stupid
NEVERMIND
It shaded all the dependencies but I still get "Cannot Find Symbol"
but there is some other areas in regards to reflection that would need to be removed, I can't exactly tell you. This is part of being a developer sometimes 😛
alright now time to load that IDE so I can check out that or thing
Do you want the updated version?
you can send it if you want, but like I said the annotation is there because of reflection
remove the reflection and annotation isn't necessary. But the reflection is there because it downloads the libraries it needs at runtime which is dumb
when it could have shaded them in
but where is the reflection
Look for something that loads dependencies
well I guess it isn't dumb to load libraries at runtime, but I don't think reflection would be necessary for such things 🤔
The only thing I could think of is the maven repository
version: '${project.version}'
main: me.fanisus.tutorial.Main
api-version: 1.18
description: This is description
website: This is website
author: Fanisus
commands:
setspawn:
description: My N
usage: /<command>
aliases: ["sethome"]
spawn:
description: Test
usage: /<command
aliases: ["home"]
www:
description: command
usage: /<command>```
This is my plugin.yml
How do i set permission so that only operator can use www command
Imo using reflection to download then build the classes and load them is kinda cringe when you could shade
well yes, but spigot enforces a size limit
so I can see where it is necessary to download dependencies instead
Can someone just tell me the answer. My brain hurts and its going on 4 AM and I have a big day tomorrow.
just I don't think it was necessary to use reflection was all
Hire someone to do it if you can't
I tried but no one uses intellij from what I can find on fiverr
intelliJ isn't necessary
I personally use netbeans but it doesn't mean the project compiles differently because of such
help
?services
If you wish to request or offer development/art/building/administration services, please do so at https://www.spigotmc.org/forums/services-recruitment-v2.54/
When Bukkit loads a plugin, it needs to know some basic information about it. It reads this information from a YAML file, 'plugin.yml'. This file consists of a set of attributes, each defined on a new line and with no indentation.
A command block starts with the command's name, and then has a list of attributes.
A permission block starts wit...
it describes all the attributes you can use including permission ones
inferno.*:
[optional permission attributes]
inferno.flagate:
[optional permission attributes]
inferno.burningdeaths:
[optional permission attributes]```
whats? inferno
the complete permission path
which is whatever you decided it to be
but its using it as an example
can you spoonfeed me one line of code, i really dont understand
description: Just a command Testeral
usage: /<command>
permission:```
what permission i need to use so only op can use it
add default: op to your permission to default them to op people automatically
What's the equivalent of that but defaulting to everyone is allowed? default: *?
if you want it to be everyone, then either set it to true or no op
@vocal cloud if I just installed the .jar file into the plugins folder that it was reflecting would that work?
I FREAKIN DID IT
LETS GO
OML
OML
OML
lol
alright, sounds like you are making progress then 🙂
I don't know how to fix this though 😬 ```Source option 5 is no longer supported. Use 7 or later.
Language level is invalid or missing in pom.xml. Current project JDK is 17. Specify language level in Core
Google it
i am right now lol
under the compiler tag in the pom, you need to set the source and target tags
if you are using java 11, highest you can set it is java 11 😉
then you can set it to 17 or anything below 🙂
don't recommend if you are using java 12 or higher that you compile for lesser then 12 though due to some changes that make it difficult to sometimes compile that far back XD
I set it to 17 and it says this now ```Compilation failure
Bad service configuration file, or exception thrown while constructing Processor object: javax.annotation.processing.Processor: Provider network.palace.core.plugin.processor.PluginInfoProcessor not found
the same
frickin error
try 16
I wonder if the reflection being used is making use of obsolete reflection methods 🤔
if that is the case, then odds are you could only compile for java 8-10 unless you go change that reflection stuff like I recommended earlier since you have control of the source anyways
when I opened it originally everything was java 11
just because you forked it or whatever doesn't mean you are not allowed to make changes to fit your needs XD
now I remember why I normally keep my IDE open
keeping it closed for too long means I have to wait for maven central unpacking >>
time to start learning it seems
public void onUAR(UltimateAutoRestartRestartEvent event) {
UltimateAutoRestartAPI.setInterval(UltimateAutoRestart.getInstance(), 60);
Bukkit.getScheduler().scheduleSyncDelayedTask(plugin, new Runnable() {
@Override
public void run() {
Bukkit.broadcastMessage(ChatColor.GREEN + "click on vote to delay the restart");
TextComponent message = new TextComponent(ChatColor.RED + "click this to vote");
message.setClickEvent(new ClickEvent(ClickEvent.Action.RUN_COMMAND, "/restartvote"));
Bukkit.getServer().spigot().broadcast(message);
}
}, 20L); //20 Tick (1 Second) delay before run() is called
for (Player player : Bukkit.getOnlinePlayers()) {
PermissionAttachment attachment = player.addAttachment(plugin, 1200);
attachment.setPermission("voterestart.vote", true);
}
}```
in this the permission gets added but the text component is not getting broadcasted
Well you are scheduling the broadcast before the permissions are set. Maybe try reversing that and then call the run code after?
tried that
I HATE THICK FRICKIN PLUGIN
Anyone help please. Bad service configuration file, or exception thrown while constructing Processor object
Its 4 AM and I am tired
Hire someone to do it
If nothing is working go to sleep. Usually helps quite a bit
Being tired does not help at all
for(int i = 0; i < 35; i++) {
if(player.getInventory().getContents().equals(Material.ARROW)) {
if(event.getAction().equals(Action.RIGHT_CLICK_AIR) ||
event.getAction().equals(Action.RIGHT_CLICK_BLOCK)) {
if(player.getInventory().getItemInMainHand().getItemMeta().getDisplayName().equals(ChatColor.BLUE + "Artisanal ShortBow")) {
Arrow a = (Arrow) loc.getWorld().spawnEntity(loc, EntityType.ARROW);
Vector v = loc.getDirection().multiply(0.7692307692307692);
a.setVelocity(v);
player.getInventory().getItem(i).setAmount(player.getInventory().getItem(i).getAmount() - 1);
}
}
}else {
event.setCancelled(true);
}
}``` Would this work?
then how would I be able to get the material?
Get the item in the slot and then material from that
alr
thanks
how about
player.getInvetory.getType.equals
?
Which is the slot
I can just
Inventory#getItem(i).equals()
yes?
since i
is looping thru the players inventory
and will get the item
Use getItemInMainHand since I assume that's what you want
no
I want to loop thru the players inventory
the whole 35 slots
I believe
36
yes
Just loop over getContents
^
as you said, get contents doesnt take in a material
and I need to get the material
is there any reason to use ChatColor enums instead of §+code when sending colored messages?
it might be unnecessary optimization (since String concatenation is more expensive than hardcoding into messages like "§4hello red")
Because using the color character is meaningless
Also the compiler probably optimizes it to a fixed string anyway
Readability i think
Does it?
Ok I was wrong, not sure why I thought you could that. Maybe I was thinking of something else. Anyways the original way I said to do it, least common ancestor superclass which in your case is going to be OfflinePlayer because Player extends from that. Second, you can easily check from the OfflinePlayer object if they are online in the beginning of the method and if they are, switch the object back over to Player instead.
But meh color codes sucks anyways
at byte code compile time? idk
I might change the actual implementation of the ChatColor class, so it would break the message
At jit compile, more likely
I doubt. On literals, maybe, but not on enums
Yeah
(use components)
Java 0/10
I mean jit is always good but you shouldn’t rely on it rly
Spigot 0/10
I managed to fix it by turning my Players into OfflinePlayer and then getting the online version (if available) for a couple of parts that needed an online player
Components for a simple coloured message is a pain
there is Message Formatting or String Formatting where you don't need to do that as you said. Second, the API takes care of sending the message appropriately due to encoding(not usually a common problem but from time to time happens) So because the API/Code is already setup to send the codes appropriately adding that character and code yourself can screw it up as well as just make it harder for your code to be dynamic/changeable since you now hardcoded it instead.
LinearComponents.linear(NamedTextColor.RED, text("Red text u know "), NamedTextColor.BLUE, text("sssss"));
``` 😎
do you have to use the Enums? No, but might as well make use of the API if it is there instead of making it harder on yourself
cant argue with that. thanks 🙏
not too much different from
String text = ChatColor.RED + "Red text u know" + ChatColor.BLUE + "sssss";
depends which string formatter you make use of
🥶
how do i register a listener which i can then unregister later
HandlerList.unregisterAll
wont that unregister all listeners of that one event
i want to unregister one listener for all events it captures
is there a way to do that?
it is generally recommended to use a string builder though instead of doing string concatenation(AKA using +). How you can know when to use one or the other, is if what you concatenating are constants then using + is going to be better because the compiler will just inline it easily, but if they are not constants then you probably should use something like StringBuilder or String.format to format your strings as overall it will be more optimal at runtime as well as compiler being more easily able to optimize better.
You can pass a class instances to unregisterAll
aThis is a static method which takes listener
yeah i know but will i have to do that for all events it captures?
Thats a static method..
okay so i can just do like
Event.getHandlerList().unregisterAll(...);
``` and it will work for everything
what
HandlerList.unregisterAll(listener0
orbyfied I believe each HandlerList instance for every event is stored somewhere, whether it is in a static list or not idr but there’s a method to get those and unregister those as such
HandlerList.unregisterAll();
``` you mean this?
Ye
oooh
Can anyone help me with this? It's spamming it into console:
[11:53:52 WARN]: [Residence] Task #61 for Residence v5.0.1.1 generated an exception java.lang.NoSuchMethodError: 'void io.github.thebusybiscuit.slimefun4.libraries.dough.protection.ProtectionManager.registerModule(org.bukkit.Server, java.lang.String, java.util.function.Function)' at com.bekvon.bukkit.residence.slimeFun.SlimefunManager.lambda$0(SlimefunManager.java:23) ~[Residence.jar:?] at org.bukkit.craftbukkit.v1_18_R1.scheduler.CraftTask.run(CraftTask.java:103) ~[paper-1.18.1.jar:git-Paper-177] at org.bukkit.craftbukkit.v1_18_R1.scheduler.CraftScheduler.mainThreadHeartbeat(CraftScheduler.java:483) ~[paper-1.18.1.jar:git-Paper-177] at net.minecraft.server.MinecraftServer.tickChildren(MinecraftServer.java:1547) ~[paper-1.18.1.jar:git-Paper-177] at net.minecraft.server.dedicated.DedicatedServer.tickChildren(DedicatedServer.java:480) ~[paper-1.18.1.jar:git-Paper-177] at net.minecraft.server.MinecraftServer.tickServer(MinecraftServer.java:1470) ~[paper-1.18.1.jar:git-Paper-177] at net.minecraft.server.MinecraftServer.runServer(MinecraftServer.java:1264) ~[paper-1.18.1.jar:git-Paper-177] at net.minecraft.server.MinecraftServer.lambda$spin$0(MinecraftServer.java:317) ~[paper-1.18.1.jar:git-Paper-177] at java.lang.Thread.run(Thread.java:833) ~[?:?]
thanks
there is various methods for the listeners. Just makes sure you read the javadocs because some methods act on your listener only, your plugin only or you could just unregister all listeners regardless lol
?jd
Everything should be static
yeah lets go back to the C
Lol
I don't really see where it would matter in this case? o.O
Unit testing