#help-development
1 messages · Page 1215 of 1
-
run buildtools (creates required libraries on your computer) for applicable version
-
download project
-
open in IDE
-
run 'maven compile'
-
look in target folder
maybe-not-optional a update to java 21
you know how to for ubuntu?
It doesn't have a pom.xml file or whatever gradle file is
no this is about the github project
but you should just be able to make a pom.xml
just import from Git a basic project
Do I put anything the the pom file or leave it blank
well the usual stuff
ok
spigot dependency and plugin name specifically
is it easier to do gradle or maven
eh. i do maven bc im used to it. i honestly cant tell
Ive never done either so do you know how long it will take to make the file?
if I were you I'd not touch that BoatRace plugin
why
its package names are all wrong
ah
you will have to spend so much time just fixing every package
I can't find any other ice boat plugins literally anywhere
Ill just figure it out thanks for warning me tho
Looks like an upto date BoatRace plugin https://github.com/Cmrboy26/SimpleBoatRaces
with releases
thanks
hey so when i imported auraskills into my server, why are all the files different and also .ymls instead of .javas?
Because that's source code not a compiled plugin
does it matter which i use in my server?
Yes, it need to be compiled
alright, but what if i copy over the source code into the compiled code's folder? would the code i acutally want not turn into the compiled code?
No, you have to compile it yourself
You would need to use a build system to compile it
Auraskills comes compiled, just download that
sometimes, but not always. Typically requires some fixing to get it to work
yeah i did but its all .yml files
and i dont really know how to work with those
Where are you downloading it from
It's a jar
or are you trying to make your own modifications?
yeah that
and i downloaded it on modrinth, ran it on my server, then opened the resulting folder
You just downloaded the configurations then
clone it from github
ok, so when put the cloned folder into my plugins folder, the server can run it, and i can edit it as if it were a normal plugin right?
No you still have to compile the code
I would really recommend watching a video on java basics and how to compile a jar
HI, I have some coding practice question. When Im creating object based on file data. Should I create the object and just give that data true constructor or is just better to give constructor the file and get that data and assain fields insde the object it self? Constructor is kinda long bcs of that lol. Its mineable block so then Im saving that to map if all is set.
alr i got it, thanks
If i'm understanding whta you're saying, its better to assign variables from constructor or a builder method
or just serialize is properly
Basicly I have minable block witch have some location, maxHP, drops... and other thinks. Those thinks can be set in config file. I was thinking about 1 method:
new MinableBlock(Fie file){
#Read file
hp = file.getHP()
}
Or just this:
new MinableBlock(int hp, Location location){
this.hp = hp
this.location = location
}
I never used some builder method so I will need to lookup some example for that.
Just use Chunk NBT
I need that to be editable true config file so I cant
my question is just if its better to doit with 1st or 2nd method, what is better coding practice
thanks, thats how Im doing it but constructor kinda starting to be rly big lol, so I should add some another way to do that.
If you dont know how to work with ymls, what makes you think source files would be any easier?
Because the source files on the GitHub were all java files. The ones that I was looking at at the time were exclusively .yml files. It's not that I don't know how to work with .yml files necessarily, the best I've got is editing a config.yml, but I wasn't even sure there was any code in there to mess with
Alright.
hello. im trying to make items stay on a block using armour stands, but for some items it is too much to put them with a 1 block of y offset and they get stuck into the block. why doesn't it work when I try to add an y offset that is less than 1? it just seems to change nothing
Vector offset = new Vector(0, 0, 0);
if (ItemUtils.isSimilarIgnoreLore(itemToPut, SimsItem.WOODOO_DOLL, true)) {
offset = new Vector(0, 1, 0);
} else if (ItemUtils.isSimilarIgnoreLore(itemToPut, SimsItem.BLOOD_BAG, true)) {
offset = new Vector(0, 0.5, 0);
} else if (ItemUtils.isSimilarIgnoreLore(itemToPut, SimsItem.BONE, true)) {
offset = new Vector(0, 0.5, 0);
} else if (ItemUtils.isSimilarIgnoreLore(itemToPut, SimsItem.OCCULTISM_AMULET, true)) {
offset = new Vector(0, 0.5, 0);
}
ritualTable.setContainedItem(player, itemToPut, offset);
public void setContainedItem(Player player, ItemStack item, Vector offset) {
this.containedItem = item;
Location location = block.getLocation().clone().toBlockLocation().toCenterLocation().setDirection(player.getLocation().subtract(block.getLocation()).toVector());
itemArmorStand = location.getWorld().spawn(location.subtract(offset), ArmorStand.class, stand -> {
stand.setAI(false);
stand.setVisible(false);
stand.setBasePlate(false);
stand.setCustomName("ritual_table_item");
stand.setCustomNameVisible(false);
});
itemArmorStand.getEquipment().setHelmet(item);
}
Hello, where did CraftItemStack go with spigot 1.21.4 and what should I use instead?
dependencies {
compileOnly project(":common")
compileOnly("org.spigotmc:spigot:1.21.4-R0.1-SNAPSHOT") {
exclude group: "com.mojang", module: "*"
}
}
but
for some reason, CraftItemStack is shown as from version 1.21.3, but since 1.21.4 it doesn't exist at all.
well, have you run buildtools?
you need to run BT if you want to access internals
thx
then I just need to use spigot on the way out.jar as a dependency when compileOnly?
is https://hub.spigotmc.org/javadocs/bukkit/org/bukkit/event/world/LootGenerateEvent.html called when you try to open a naturally generated loot chest
thanks
I would think so, but try and see
I compiled version 1.21.4 and updated gradle, but nothing has changed. I still don't have access to 1.21.4 methods.
did you press the reload gradle button in IJ
bumb
but implementation only doesnt expose it for some reason
which is why you use api
yeap
oh right
but api doesnt work with shading into the jar
or maybe a different issue but i get NoSuchMethodException
shadow also shades api configurations
weird
take a look at your shaded jar
not at home rn
why you can't send screenshots here, you understand, it makes everything difficult...
?img
Can't send images? That's because you're not verified! Use !verify to complete verification.
Alternatively, you can upload screenshots to any image hosting site and share the link.
Here's some screenshot utilities that you can use to upload images.
Lightshot: https://prnt.sc
Imgur: https://imgur.com/upload
Flameshot: https://flameshot.org
is there any other possible cause for the exception?
i mean, are you relocating it?
!verify
Usage: !verify <forums username>
!verify ItsNayzu
i hope i do, im not sure it works tho
This account is already verified!
well you can also use image sites
because that account is already verified on @balmy cliff
show your entire buildscript
why do you need CraftItemStack anyway
uh dont have it on github yet
i can send it later
This is my old account that I lost access to.
it's hard to help without knowing the entire buildscript :p
true. ill look into it later
Can you give me a verification role, just please, so that I can send pictures?
.
no you need to email support from your forum account email to get the verification reset // see what rad said
it doesn't subtract the offset at all for some reason
hey intellectuals I seek your wisdom again
how could I go about, in a custom factions plugin, have custom mobs created that are friendly to said faction members but not others?
And of course only targeting players
My past custom mobs attempts also never save between server restarts so I'd like to know how to do that
Still need help?
yes
it doesn't work even like that:
public void setContainedItem(Player player, ItemStack item, Vector offset) {
this.containedItem = item;
Location location = block.getLocation().clone().toBlockLocation().toCenterLocation().setDirection(player.getLocation().subtract(block.getLocation()).toVector());
// Location locationWithOffset = location.clone().subtract(offset);
Location locationWithOffset = location.clone();
locationWithOffset.setX(locationWithOffset.getX() - offset.getX());
locationWithOffset.setY(locationWithOffset.getY() - offset.getY());
locationWithOffset.setZ(locationWithOffset.getZ() - offset.getZ());
System.out.println("offset: " + offset.getX() + " " + offset.getY() + " " + offset.getZ());
itemArmorStand = location.getWorld().spawn(locationWithOffset, ArmorStand.class, stand -> {
stand.setAI(false);
stand.setVisible(false);
stand.setBasePlate(false);
stand.setCustomName("ritual_table_item");
stand.setCustomNameVisible(false);
});
itemArmorStand.getEquipment().setHelmet(item);
System.out.println("location: " + LocationUtil.toString(location));
System.out.println("location with offset: " + LocationUtil.toString(locationWithOffset));
System.out.println("armourstand current: " + LocationUtil.toString(itemArmorStand.getLocation()));
}
if anyone could take a look at me question later 🦜 that would be cool 😢
Depends on how those "custom mobs" work, but mobs and players in one Team will not attack eachother.
^^ That or you use nms goals to make them behave like you want
For them to persist properly it's up to you to track their position and respawn them on chunk load and despawn on unload
?ban @agile ether ban evasion
Done. That felt good.
thanks concluwuwuwubuwuuwbe
oh were they ban evading 💀
oh not them again
for (OfflinePlayer guildMember : guild.getPlayers().keySet()) {
log(guildMember.getName());
if (!guildMember.isOnline()) continue;
sendMessage((Player) guildMember, plugin.lang.getGuildChatFormat()
.replace("%player_name%", sender.getName()).replace("%message%", message)
, false);
}
to start off, there are 2 guild members and they are both online
a message is sent and both of them receive it (the log line prints both their names too). good.
one of them leaves, and then rejoins the game
a message is sent and only the one who didnt log out gets the message. the log line still prints both their names
im checking whether the offlineplayer is online, and since both of them are in both cases, why does the message only get sent to both of them in the first case?
do not store/reference Player objects, use their UUID
get a new Player object when you need it
thats why i stored OfflinePlayer
but welp, guess i gotta store only UUID
for (OfflinePlayer guildMember : guild.getPlayers().keySet()) {
log(guildMember.getName());
if (!guildMember.isOnline()) continue;
log("2 "+guildMember.getName());
sendMessage((Player) guildMember, plugin.lang.getGuildChatFormat()
.replace("%player_name%", sender.getName()).replace("%message%", message)
, false);
}
in the second case, even the second log line here prints both their names, but only the one guy gets the message
Don;t cast the offline player to Player, use teh getPlayer() method in OfflinePlayer
i see.
it did not work
guildMember#getPlayer() instead of (Player) guildMember
made no difference
man. am i gonna have to switch it all out for UUIDs
the UUID never changes (unless your server is offline)
so just get a new Player object from the OfflinePlayer getUniqueId()
ye ik but i was hoping OfflinePlayer alone would be fine
it shoudl be
unless you are storing a Player reference somewhere and retaining a stale reference
i think im gonna switch over to UUIDs for the sake of my own sanity
a new Player object is created each login, so logging out and logging back in means the original Player object is invalid
UUID is safest
no
same object when they die, but they are temporarily removed from teh player map
Is it okay to develop a string parser based on the GraalVM Scripting API in my plugin? I'm worried that there might be issues regarding resource usage or optimization.
Hi, I'm looking for a way to use NMS on a large range of versions, my project has multiple modules and i'll handle the versions that way, I'm struggling to find a way to actually NMS, any ideas?
kk thanks
this is for maven, im using gradle, is there an equivalent?
idk of any guides that exist for gradle but its not hard, similar setup but parent shades submodules of nms vers using project('tag)
alright, thanks a lot
wait do i need to publish the shadedJar?
you mean for publishing to maven?
i heard it's bad practice, but tbh no idea, but shadow shades transitively from my experience
yea
hey, im using it right now: https://github.com/patrick-choe/mojang-spigot-remapper
but im having some trouble:
- which of these files is the one to use for the mojang mappings? (this is the output of buildtools)
Contribute to patrick-choe/mojang-spigot-remapper development by creating an account on GitHub.
- is there a way to change the path of the remap task?
if i have a string like
"(3*5)+7"
how can i convert this into an actual formula that i can calculate the value of and return, say in this case, 22
(the string may or may not have spaces)
@remote swallow sorry for the ping in case it annoys you, if so let me know and i wont do it again
use some math parser
,pings fine, you dont need to use any of the bt files for anything, just setup the task. if you use something to rename the jar output you need to tell the remap task that
from my experience the best way to handle math expressions is to have one method to do the following
if parentheses are present: replace the whole thing with a recursive call to this same method
else: parse the math
i think its time to copy parts of my parser from the time i made a programming language
or use that
kk ill try
hey, somebody really good with HikariCP dependency? I have a problem, one dude help me to use this database dependency instead of the "basic" one from java. I manage it to work, but now i am getting this error: https://pastes.dev/BHMpqFoZdJ
in all methods i am closign the connection after getting what i want, here i will send you the config:
HikariCP config: https://pastes.dev/JzlZHhfnE4
DB manager: https://pastes.dev/aEvy3C6na8
DB Schem: https://pastes.dev/ZoRAsgp12W
Tell me, how to fix it or what do you want me to send more? thx Guys
you need to run db interaction async
what do u mean? can you help me with that?
read this #help-development message
crunch
https://maven.radsteve.net/#/public/in/pratanumandal/expr4j/1.0 just self-published it
nice
//Interact with Inventory
@EventHandler
public void onInventoryInteract(InventoryClickEvent e) {
if (!(e.getView().getTitle().equals(skillTreeMenuName))) return;
if (e.getClickedInventory() != e.getView().getTopInventory()) return;
if (!(e.getWhoClicked() instanceof Player player)) return;
e.setCancelled(true);
}
This seems to work as intended. Someone somehow still managed to take items out of the Inventory. Someone knows why and how to fix it?
what the heck you trying to achieve? xD
that's not my code
new prompt time
When i set the explosion Radius of a wither skull it stays at 1 and doenst explode like the power i set it to. The debug Message gives me the value i set but idk why the explosion is so small. With the other mob Ghast i did the same and it worked
I know Trial Chambers and the Vaults are relatively new, but is there a way I can see what Vaults players have claimed?
-# Really new to plugin development, so any help would be massive, thanks
No that data is stored on the Vaults not the player
You'd need to track it yourself
With either a database or player pdc
?pdc
Let me rephrase:
The Vaults remember the player, or else they would allow a player to reclaim the loot of said vault.
Is there a way to extract that information in a usable format
I can't find anything
724, 6, -3632 has the following block data: {z: -3632, y: 6, config: {key_item: {id: "inecraft:ominous_trial_key", count: 1}, loot_table: "inecraft:chests/trial_chambers/reward_ominous"}, id: "inecraft:vault", server_data: {rewarded_players: [[I; 145043703, 131353225, -1271894333, 1934907291]], state_updating_resumes_at: 45932790L}, x: 724, shared_data: {}}
Ignoring the fact that I have to fix my console for not spitting all info, the data I need is stored in the block itself under server_data: {rewarded_players: []}
Yeah we don't have api exposed for that it looks like
darn, I'll have to figure it out then
Wonder if it can be exposed easily.
Probably can
That api is pretty blegh doesn't cover everything
Alright, I don't expect any code out of this ask, I'm just asking if it's possible with the current APIs:
- Detect when a player is within a structure, such as a Nether Fortress or Trial Chamber
- Check for certain blocks within that structure, such as Vaults
- Interaction Entity support.
- I would need to summon them at specific locations with specific sizes with a glowing effect
@Override
@NotNull
public String getIdentifier() {
return "guilds";
}
@Override
public String onRequest(OfflinePlayer player, @NotNull String params) {
if (params.equalsIgnoreCase("test")) {
return "success!";
}
if (params.equalsIgnoreCase("test2")) {
return "wow!";
}
return null; //
}
(PAPI integration)
%guilds_test% doesnt return "success!"
what am i doing wrong?
the docs are quite bare bones so im a little confused
are you registering it
well about that too
you also need to check for other events
// papi integration
if (Bukkit.getPluginManager().isPluginEnabled("PlaceholderAPI")) {
new PapiExpansion(this).register();
log("PAPI found. Initiating integration process...");
} else {
log("PAPI not found! Skipping integration process...");
}
papi is installed, it is softdepend and is in loadbefore
but it says papi not found every time
(papi loads in console)
also use `` pls
Which ones?
Should all be called InventorySomethingEvent
for shift clicks and right clicks
i don't rly remember
?javadoc
soft depend and loadbefore
cant you check the type of click in that event
it shouldnt be loadbefore it should only be a soft-depend
well it didnt work then either
shouldn't it be loadafter
i added loadbefore after i saw it didnt work, to test
that is softdepend
nah its reverse actually
XD
i need sree fpigot lessons
what do you have in ur plugin.yml
name: '${project.name}'
version: '${project.version}'
main: com.siliqon.cosmicGuilds.CosmicGuilds
api-version: '1.13'
prefix: '${project.name}'
load: STARTUP
authors: [ SiliQon ]
softdepend:
- "PlaceholderAPI"
description: '${project.description}'
have you ran a clean build
load startup 💀
wat
do you use maven
mvn clean package
There is ClickEvent, DragEvent, InteractEvent, MoveItem event.. you know which of these?
all sane people use maven
im not actually sure i used java years ago
im sane and i use gradle
that is incorrect
yeah rad i saw the link on your profile
never used gradle in my life
anyway um didnt work
Why Gradle is simply the Best
do you modify worlds for anyhting
no
remove the line
done
run a clean package again and check
?tas
never use load startup anymore
because it loads before worlds, papi doesnt
i c
unless you are absolutely sure you need it
I remember there was a way to run a server instance of Minecraft from within IDEA, how can I set that up again?
well, time to go crazy with papi
daddy
i just setup a profile which runs my server jar in my test server folder after it puts a copy of the jar in the plugins folder
saves so much time
the console log appears in IDEA terminal
also never used IDEA in my life
its just a profile if he wants i could copy paste that
psychopath behaviour
eclipse maven
If you want to share the config, I would gladly accept
too "i dont put butter on my toast" for me
well, but it's light and fast and distributed as a zip
alright, dms
https://github.com/jpenilla/run-task would be your best bet
however it is paper
and gradle
is it any better than Pen is ban
yeah sorry i forgot this discord hated modern things to an incredible level
run spigot when
it's just me
sploon™
also using old netbeans with Swing
Can the PDC grab vanilla values or does it only work with custom data put into it?
it can read stuff in the pdc container with namespaced keys it can create afaik
before pdc everything was stored in world file afair
you could technically just insert something random into pdc with data merge but its pointless
and now pdc is like separate thing for plugins to use
its just a section of the item meta
after you look at plugins i made it will produce more e's
not only
currently working on my biggest plugin yet
and my fingies huwt 😦
skill issue
get the statistic plugin
I've never had my fingers hurt from coding before lmao
whats the java real line count
light work
i swear pen is ban was like 1000
well most of the finger hurting is from the gah damn messages.yml file
1.6k loc is nothing
code configs >>>>>
i know, the last lua project i made had 12k LOC
statistic plugin?
but its a bit for a single day right
I have 56 minutes for the past two days
Adn about 500 hours of kotlin in the past year
because thats what heroes do
i have 44 minutes today and 50 minutes yesterday
i wanna learn kotlin so i can also dip my feet in android app dev for fun but i just cant be bothered to learn another forkin language
well i have insane motivation rn, watch my numbers drop to the floor in a week
would soming like
public enum enumname{enum1(Material.DIAMOND); }
work ?
cause uh it isnt for me
also Material isnt importing for me at all which is also weird
i have a solid 720 hours total on waka
no
update intellij
?tryitandsee
tas*
racist.
it doesnt thats why
just brutally import it
mainly Material isnt importing so i cant try it
?tryandsee
also plez use ``
?codeblock
You can use the discord code block format to display code or just text in a more pleasing way:
```java
public class MyPlugin extends JavaPlugin {
@Override
public void onEnable() {
}
}```
Becomes:
public class MyPlugin extends JavaPlugin {
@Override
public void onEnable() {
}
}```
so then you answered your own question
codeblock is easier on the eyes
i have like 650 tbh
public psa over, back to papi integration
i only started using it last year
when did you join
may 2024
i only have waka on IntelliJ otherwise i feel like some guy from waka woulda emailed me to close vscode for once

update intellij
i joined jan 2, 2023
i have 70 hours less whilst having jjoined a year and a couple months later than you
that's a tad bit concerning isn't it
only times i open IntelliJ is either when im getting paid to do it or the 3 am motivation
yeah becausei have like 6 month breaks
2023 was my bes tyear
last year was horrible
Well I'm using both already, so I'll adapt
Thank you again
welcome again
When i set the explosion Radius of a wither skull it stays at 1 and doenst explode like the power i set it to. The debug Message gives me the value i set but idk why the explosion is so small. With the other mob Ghast i did the same and it worked. Anyone has any idea why?
Does it work with commands? Might be a mc bug
What Tag is Yield? its not seperate in mcsatcker
Ohh i see that WitherSkull doenst have explosionPower tag only the fireball does. Why is it in the api then?
Is that a mc bug or an API bug?
wtf
this has to be the most cursed codebase i've ever seen
well at least it partially works
im in a rush of completing uni assignment
so i might as well just refactor this project
also why's there only one right/left shouldn't it be 2
it's like they said north is up, east is right, etc
idk
im refactoring this into enum class
for now
just to cleanup the codebase
i dont wanna mess with angle values as they're used for javafx image rotations for now
oh it's 2D?
yea
that would make more sense
what's even more weird that entity has two directions, one for moving and another for the same? i dont understand it
How does one convert the way minecraft stores UUIDs into actual UUIDs?
[I;57179296,818891836,-1944241363,-681820176] --> 03687ca0-30cf-4c3c-8c1d-3b2dd75c3ff0
UUID.fromByte maybe?
They're four ints, two of them make up the least significant bits and the other make up the most significant bits
doesnt it also depend on UUID version of how its being parsed?
How do I combine them to get the most and least significant bits?
Addition? A bit shift?
no idea
@Override
public @NotNull UUID fromTag(Tag<int[]> tag) {
int[] data = tag.getValue();
if (data.length != 4) {
ConsoleMessenger.bug("Could not parse UUID from file", this);
return UUID.randomUUID();
}
long mostSig = (long)data[0] << 32 | data[1] & 0xFFFFFFFFL;
long leastSig = (long)data[2] << 32 | data[3] & 0xFFFFFFFFL;
return new UUID(mostSig, leastSig);
}```
so yeah bit shift
here is the other way if you are interested ```java
@Override
public @NotNull Tag<int[]> toTag(UUID value) {
int[] data = new int[4];
long mostSig = value.getMostSignificantBits();
data[0] = (int)(mostSig >> 32);
data[1] = (int)mostSig;
long leastSig = value.getLeastSignificantBits();
data[2] = (int)(leastSig >> 32);
data[3] = (int)leastSig;
return new Tag.IntegerArrayTag(data);
}```
i will never understand bitshifting magic
its not that hard, it just looks scary, its arithmetic but on bit level
Thank you
np
I had a method to convert uuids to the 4-int format, but I couldn't figure out how to reverse it. :p
yeah
public static int[] toMCFormat(UUID uuid) {
long least = uuid.getMostSignificantBits();
long most = uuid.getLeastSignificantBits();
return new int[]{(int) (least >> 32), (int) least, (int) (most >> 32), (int) most};
}
its a bit of low level magic
you are just moving bits over by however many places
just know that the bits don't wrap around. So if you shift to the right, those bits are lost
yeah, just shift the bits
bitmasking tho
bitmasking is just where you are assigning meaning to invidual bits
0000-1111
now if you translate this to decimal its very easy to know that you only have values 0-15 and and that is how you get your 0x02 or so notations
so if its 0x08 then that means your mask is 1000
0x08 = 1000
0x07 = 0111
0x08 + 0x07 = 15 = 1111
so not that hard 😛
hey, should i make it more readable for users? and how
camps:
- area:
corner1: "100,64,100"
corner2: "200,80,200"
generation_area:
corner1: "120,64,120"
corner2: "150,80,150"
block_to_generate: "STONE"
generation_interval: 20
- area:
corner1: "300,64,300"
corner2: "400,80,400"
generation_area:
corner1: "320,64,320"
corner2: "350,80,350"
block_to_generate: "IRON_ORE"
generation_interval: 40
is it meant to ever be intentionally edited by users?
also why you storin location in string
im asking more about camps being a list
yes
then yes, make it readable
but how ?
IDK if you still need help for this, but when I wanted to convert the seperate ints into a UUID i looked through minecrafts jar to find the serialization for it (I see you either made the method or found it)
I assume you could do a similar thing and just find how MC is writing that data to the .dat file
well its pretty readable already, maybe make the key names a little more descriptive
how can i go about sorting a hashmap by values?
doesnt have to be in place
use a SortedMap instead, if you need order
isn'T that on key
you can use a comparator
huh
ah no my mistake
I mean, do you need it fully sorted, do you need only the largest/smallest value?
you are correct its still on key, you are just able to supply a comparator to order how you want
if you need it fully sorted just, new ArrayList(map.entrySet()) and then Collections.sort that with a comparator grabbing values
(then ask yourself how often you need this sorting and maybe find a better impl of this)
well
It took longer than expected for me to write this. :p
I am jank
its a leaderboard
sorting guilds by the amount of xp they have
Probably a PR to spigot
???
When i get the Target of an EnderDragon 1sec after changing his Phase its always null. Even when he launches a DragoBall the target with enderDragon.getTarget() is null why?
you have a reference to the vault block entity in that type
as the snapshot
make VaultServerData#getRewardedPlayers public
and just call that
don't do whatever the fuck this is
no, i was just asking about it being a list, but thanks
if you need inspiration, look at any of the other subtypes of CraftBlockEntityState
they all do that the same way
I didn't even know VaultServerData existed...
uuuf
i think im going to just rethink how to get the top guilds
fuck maps
or well ill still need maps but, a better approach nonetheless
What are you trying to make?
guild leaderboard sorted by guild xp
Guild is a custom class, which has all the guild data
i want a List<Guild> with the top x guilds by xp
i have a list of all Guild(s)
anything that is ordered and i can iterate over at the end, cuz the rankings cant just move around
Frick. Need to remember how to make patch files. :/
iirc spigot had some weird bash script somewhere
rebuildPatches? I only have makePatches and applyPatches
Hmm, I wonder why it doesn't work now.
I ran makePatches, but what else do I need to do to test the new CB jar?
I don't typically do these kinds of patches
So I am confused here
you dont really need to run make patches till the end
modify what you want, run package/install of cb and test
use cb as a dep in ur build system and the same cb jar as the server
Yea, I do that for normal stuff, but is it the same when adding in patches?
Does this just automatically get used?
when you want to push to git then makePatches and it will find the new file and make the patch
I have already ran makePatches, but I want to test this.
Do I need to make the PR first?
you can test without making the pr
all the patch matters for is git, bc you cant put nms on git
How though?
I have already made changes to bukkit and installed them.
I modified the net.minecraft VaultServerData file to make the method public.
The impl for CraftVault is now short.
@Override
public Set<UUID> getRewardedPlayers() {
return getTileEntity().getServerData().getRewardedPlayers();
}
Yet, I get errors when trying to test now.
So what am I missing here?
run the install goal on craftbukkit and run craftbukkit as the server
if that still doesnt work i have a final idea
Error I receive
clone that set
otherwise people will end up editing that set by acceident, I don't think that is what people want
or at least I wouldn't, maybe md vibes with that
reading that error, im confused how ur getting a no such method on bukkit if you installed bukkit too
the server they run compiles a wrong bukkit version I guess?
just, don't use build tools to build shit there, its ass
Hmm, I made the change to clone the set and I recompiled everything and it now works?
Java moment I swear
Oh well, now to do the PR.
Because this is a patch, do I need to exclude the file I added into the nms folder?
do not commit nms
of everything you can do, do not commit any nms
only thing that needs pushing is Craft classes + the most recent patch of the nms class
How come I don't have a patch file then?
run makePatches again, double check its in nms-patches/path/to/nms/file
(makePatches requires the decompile-abcdefg dir from bt passed as an arg)
You need to copy/paste the vanilla file from work/decompile-xxxxxx into the CraftBukkit directory (same package though), make the changes you need to make in the CraftBukkit project, then in the root of the CraftBukkit directory run ./makePatches 'path/to/work/decompile-xxxxxx'
The files in the work directory should stay vanilla. That's how the CraftBukkit scripts know what's changed
Then yeah, don't commit the NMS .java file, you want the generated .patch file instead
For some reason when I do that, there aren't any patch files that show up.
does it send any output to console?
And did you copy the files from decompile-xxxxxx into CraftBukkit but keep the work files clean?
that might do it
Yeah it's a new patch so you'd have to git add . it (or add it via whatever git program you're using)
if you use intellij just right click and git > add
There we go
Sick 😎
do i see a missing // CraftBukkit
Would rather a PAIL instead
ill let choco explain
+ public Set<UUID> getRewardedPlayers() { // PAIL - package private -> public
do pails not get cbnamed
I've always interpreted it as "please add in later" but I don't really know its true meaning lol. We use it for access changes so it can be added to the access transformer at a later date
Nope
how many pails actually get added to AT
It's usually done in the next MC update
And yes, that's all you need
You can tack on that comment into your patch manually though. Don't need to edit in source and regenerate. It's already a changed line
choco dont hide the fact you write all your patches manually

I'll leave it in the PR as well but the PAIL only has to be in the patch file. No need for it to be in CB 😄
javadocs are easy to fix, same for the craft class
Also, I don't think it's nullable 🤔 Is it?
I think the field can be empty
Seems like it's initialized and kept non-null
Do note that Collections.unmodifiableSet does not create a copy
Correct
Yeah I think it's fine
Yea, was about to scream given live BE would be rather yucky if that set starts changing
Doesn't this field being here on this specific vault and not the other one indicate that this field can be null?
Or is this just an ingame thing on how it displays data?
no
the codec just emits the default value (empty set) when writing
which is what you are doing when converting that to SNBT
Nullability of a type can't be inferred from the output of its data in SNBT. It's all code, babyyyy 😎
If Mojang chooses to unnecessarily write rewarded_players: [] into their SNBT, I'll eat my own shoe
Yeah like one of those "Is it cake!?" things but it's a shoe
im voting its the biggest fuck off winter boot cake shoe you can get made
Hi! Im currently making a plugin for a friend and i need an inventory name. When i try to use e.getWhoClicked().getOpenInventory().getTitle() i get this error:
[23:50:53 ERROR]: Could not pass event InventoryClickEvent to attachments v1.0.0-BETA
org.bukkit.event.EventException: null
at net.minecraft.server.MinecraftServer.d(MinecraftServer.java:203) ~[spigot-1.21-R0.1-SNAPSHOT.jar:4226-Spigot-146439e-2889b3a]
at net.minecraft.util.thread.IAsyncTaskHandler.B(SourceFile:136) ~[spigot-1.21-R0.1-SNAPSHOT.jar:4226-Spigot-146439e-2889b3a]
at net.minecraft.server.MinecraftServer.bv(MinecraftServer.java:1249) ~[spigot-1.21-R0.1-SNAPSHOT.jar:4226-Spigot-146439e-2889b3a]
at net.minecraft.server.MinecraftServer.B(MinecraftServer.java:1242) ~[spigot-1.21-R0.1-SNAPSHOT.jar:4226-Spigot-146439e-2889b3a]
at net.minecraft.util.thread.IAsyncTaskHandler.b(SourceFile:145) ~[spigot-1.21-R0.1-SNAPSHOT.jar:4226-Spigot-146439e-2889b3a]
at net.minecraft.server.MinecraftServer.b(MinecraftServer.java:1207) ~[spigot-1.21-R0.1-SNAPSHOT.jar:4226-Spigot-146439e-2889b3a]
at java.base/java.lang.Thread.run(Thread.java:1583) [?:?]
Caused by: java.lang.IncompatibleClassChangeError: Found interface org.bukkit.inventory.InventoryView, but class was expected
at attributes.Main.inventory_click_event(Main.java:118) ~[?:?]
at java.base/jdk.internal.reflect.DirectMethodHandleAccessor.invoke(DirectMethodHandleAccessor.java:103) ~[?:?]
at java.base/java.lang.reflect.Method.invoke(Method.java:580) ~[?:?]
at org.bukkit.plugin.java.JavaPluginLoader$1.execute(JavaPluginLoader.java:306) ~[spigot-api-1.21-R0.1-SNAPSHOT.jar:?]
... 21 more
Is there an alternative way to get inventory name without me having to rewrite half of my plugin??
If you are trying to make custom inventories, don't use title
how can i check then if the currently opened inventory is the specific one im looking for (not type but the custom one)?
You should have a manager which keeps track of all the inventories and match it with that list
check out this resource
Thanks! I will take a look at it tomorrow (its like 1am for me rn). Now just of curiosity - Is there an actuall method to get currently opened gui name or is it like completly inaccessible from 1.21+? Because you see im making a plugin for a very very small server and the source you sent seems a bit like an overkill for what im trying to do. And if there is not welp still thanks for the source i will make sure to check it out deeper tmr.
Yes, you can get it from the InventoryView
declaration: package: org.bukkit.inventory, interface: InventoryView
But keep in mind inventory name is the easiest thing to spoof, and there HAVE BEEN massive cases of exploits being used with it
So it's not "overkill" its the correct way of doing it
im aware of that but the server im talking about is 10~ players which are just one friend group and i assume they wont be trying to cheat on eachother
That's usually a version incompatability problem
I'm guessing you're using a jar artifact and not maven/gradle?
yup
then i am supposed to replace and external jar with a newer version?
if i understand correctly
yes, but Ideally you should be using a proper build tool manager
(and you should update your server)
not my server. im making plugin for a friend and thats their requirement
they should not be running plain 1.21
it has been superceeded by 1.21.1
you are physically not able to build 1.21 you will always build 1.21.1
hey i was wondering if its possible to transfer some features from 1 plugin to another. for example there is this combat log plugin i like that has no elytra use while in combat but doesnt kill on log and the other has no elytra off in combat but kills when someone logs out in combat, i was wondering if i could combine the two in some way?
Yes, if you know how to code it's a simple copy paste
i do not sadly
Then no
do u know if someone is able to do it for me?
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/
No ones going to do it for free
milage varies depending on model
Simple in the process, will still take at least an hour of testing
ah alright
there is most likely a way to make the combat log plugin that doesnt kill on log out kill them on log out
im guessing it has docs or a support discord that can help better than we can
or maybe they just didn't want to pay lol
m its done by an indemendant developer that doesnt rly speak english that i tried asking
yeah i dont have money to pay someone to fix a plugin for me
afaik combatlogx is able to do what you want with some configuration
ohh ok ill check it out thank you!
i tried putting newer version of spigot but it just like doest work at all. Its like it just stopped detecting imports
like makes the entire plugin go to trash kindof doest work
so i have no idea what to do at that point
?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
applies to all version after 1.18 too
thanks i have some errors tho with the build tools i will propablly try fixing them tomorrow because its way to late for it today but that turned out to be very helpfull
Actually i managed to fix it today
Thanks to all of you guys for help it works now have an amazing day!
sorry chat i have a noob question. I never been in contact with spigot API, this is my first time. I want to fix an old bukkit plugin then i decompiled it and adapt all outdated code. then i realized that i don't know how to compile it to .jar again correctly because what i get by decompiled are just codes, not a entire project. development document confused me, should i create a new project to copy all code in? what should i do?
Yeah make a new project and move the decompiled code there. Add all dependencies and fix all decompile errors
Then you can start updating
well... thank you! i'll try 😄
How does one post their plugins on spiggot or sell plugins on spiggot?
You need to pass the requirements first https://www.spigotmc.org/threads/premium-resource-guidelines.31667/
Once you do that, you will be able to create a resource with "Premium" as the category
Hey, when i use build tools it seems like it has some trouble with some versions
I've tried multiple times, the build is successful but it doesnt put the remappings in the .m2 folder
these are the versions it doesnt do that with: 1.21.2, 1.20.5, 1.20.3, any help?
im only missing those
Probably those version is removed because it contains security risk or game breaking stuff, so those version is not recommended to use at all.
so i should just not worry about those?
Yes probably
I remembered someone had this issue previously and md_5 answered it directly
ah i see
hey, does this by any chance mean that the nms are the same for those versions?
Quick question, why are players still able to interact with the enchanting table and the anvil as a spectator?
https://paste.md-5.net/ekahokahit.java
Do not cancel an event on MONITOR
Mostly yes
Yeah there's no reason at all to use the missing versions
Alright, thanks, do you also happen to know if there's a way to use Mojang mappings nms on 1.16.5? (Pre 1.17)
They are client compatible with the newer version, and are usually released only days later/with important fixes
1.17 is only 4.5 years old at this point lol
Yeah I've gone through the list of versions, each missing version will use the other working one
You'd want to manually remap the jar Ig, Ion think buildtools provided you mojmaps before 1.17 (even though they exist since 1.14)
Yeah they dont
How would I remap the jar? Is there documentation on it?
Or is there a way to give build tools the mappings and it works like that
What are you trying to do
Looking to use nms with Mojang mappings on 1.16.5 and perhaps even older versions, but for now I mainly care about 1.16.5
My plugin supports 1.16.5-1.21.4
Don't think there is documentation specifically for remapping a spigot jar to mojmaps, but it is certainly possible through an external remapper
You should be able to adapt the sample specialsource pretty easily
You'll just need to grab the Mojang mappings from Mojang
You mean the json file listed in the Minecraft wiki for each update?
Otherwise it should be basically the same, just not automatically installed to maven
Websites like mcassets actually let you easily download mappings iirc
Alright then, when I get back to my PC I'll try all of these things, thanks guys
?mappings
Compare different mappings with this website: https://mappings.dev/
uhhh, where's the guide that alex wrote
i've already used this guide for all other versions, but thanks
?paste
far too old to be used still
https://paste.md-5.net/udeyamatat.xml
The error is Caused by: java.lang.NoClassDefFoundError: io/github/Leonardo0013YT/UltraSkyWars/interfaces/Game
Any thoughts?
Sir, I use a version which is 11 years old
far too old to be used still
Tried shading
It didn't help as well
iirc you need to set the tile for any line to show up
and then update fields ig like current territory of the chunk you are standing in
I dont really know
wait what
1.17 wasnt that long ago right? right?
it quite literally feels like just last year
i keep failing to realise that its 1.21 already like what
?howold 1.17
Minecraft 1.17 is 3 years, 7 months old.
You'd be surprised
?howold 1.5.2
Minecraft 1.5.2 is 11 years, 8 months old.
:( ok
who the actual hell uses 1.5.2
i mean sure you can use it but what exactly do you need it for
i am extremely curious
?howold 1.21.4
Minecraft 1.21.4 is 1 month, 3 weeks old.
Minecraft 1.13 is 6 years, 6 months old.
?howold 1.4.7
Minecraft 1.4.7 is 12 years, 2 weeks old.
right
please dont spam this channel lol
didnt mean to
theres a rather large 1.5.2 modpack i played like 5 years ago
the oldest version ive played is 1.7-ish, also a modpack, now discontinued
but that was a long time ago
i dont get it tho, why stick to THAT old a version
no no playing it is fine, but actively supporting it is mental
TIL me and horses have a lot in common
mods add a lot of stuff. updated versions of MC has a lot of stuff now to the point you actually need decent hardware if you want to use everything it provides. 1.7 doesn't have all this which is fine if you intend to use mods anyways since they add the stuff you want to begin with and therefore it is manageable in terms of playing when you add stuff to nothing, versus adding more to what is already a lot
I routinely use versions like 1.7 or 1.8 as a base for custom servers since I don't have to spend time removing unneeded stuff since its not there
hm
however, what I don't support is people coming here wanting support for outdated stuff because they can't figure out how to maintain it lmao
that is annoying
But, but pvp
yeah, the spam clicky pvper's that can't be bothered to do anything more then that -.-
I never did like mc for pvp and it simply isn't designed for hardcore pvp and I doubt it ever will be
not as long as the client gets to dictate stuff lmao
I didn't pvp but I did like spam clicking after panicking the fuck out when mobs attacked me
Then there was something about jump attackign for more damage or something!? That was all beyond my abilities
lol
i used to do a lot of 1.8 pvp on hypickle but just grew out of it
I'm at work I'm not gonna open that link
its sfw* but ig it shows on your logs lol
*unless you toggle that
oh believe me, people make it work
i would know
sure people make it work while pulling their hair out
and then contribute to the bald people population because of it
the protocol is simply not designed for it and there is nothing you can do about it unless you have a custom client and fix the protocol
how do people go about grabbing the full displaynames of players for their plugins?
say a server owner set some rank prefix or whatever for their player with some plugin and some suffix with another plugin
how would i go about grabbing a player's full displayname (offlineplayer too)
sorry for another noob question, i'm new in spigot, do we have a faster way to test debug just like postman to javaweb? i'm just looping compile then put it in a server then join the server to test, i feel dumb and tired now...
hot reload exists
thank you 🙂 i'll read it now
do note that hotswapping doesn't work for everything
and sometimes you may need to create your own custom agent or modify an existing one
just depends what you are doing
some jdks like it more than others too
it might be easiest to depend on those plugins and manually arrange it
cough file locks cough
totally not speaking from experience here
when you do Server#getEntity(UUID) i assume this will return null if the given entity is in unloaded areas, right?
and if not, is the area loaded to make the given entity valid again
i saw that most plugins use Vault to handle prefixes, so i plan on taking it from vault
but i see vaultAPI's chat#getPlayerPrefix does not take offlineplayer, is it not possible to get the prefix/suffix of offline players?
You might be able to cast offlineplayer to the method
if not youll just have to pull from the actual saved data
if you cant convert the type i mean
ill try and see
ill cast offline to player and see if it works on my private server
still recommend the method instead of the cast tho
what is the correct method?
I just posted it
player is subinterface of offlineplayer
cant you go
if(! offlinePlayer instanceof Player player) return
//do something with player
alright well if the user's permissions plugin uses vault then rainbows and sunshine otherwise too bad
oh yeah i forgot that one existed
no, if the player is not online no Player object exists
only works if teh player is online
oh
which is why i didnt use it already
Yeah you might just have to construct it using the logic and data from the other plugins
public static String getPlayerDisplayName(Player player) {
return plugin.vaultChat.getPlayerPrefix(player)+player.getName()+plugin.vaultChat.getPlayerSuffix(player);
}
public static String getOfflinePlayerDisplayName(OfflinePlayer player) {
return plugin.vaultChat.getPlayerPrefix(null, player)+player.getName()+plugin.vaultChat.getPlayerSuffix(null, player);
}
i just did this
now to check it
hey qq if writing an api is it worth doing extremely detailed error handling?
depends
go on
what about assuming default values?
like?
defaults are fine, so long as you are not retunign it for ALL errors
like, player does not exist should not return a default value
oh i have an idea
if you are returning an error you may as well just throw the exception
make everything an object, which has to be instantiated with the desired error level / error handling type?
ie, throw / assume defaults for example
if I were using an API I'd rather know teh specific error rther than something you have wrapped it up in
exceptions or runtimeexceptions?
anyone whos using a chat system that doesnt use vault can cry me a river im not supporting anything other than vault for prefixes rn
@granite pond https://hub.spigotmc.org/javadocs/spigot/org/bukkit/block/Vault.html#getRewardedPlayers()
Just added in recent commit.
If you are using latest, just rerun BuildTools and voila.
not really much difference
i mean what you throw to the calling plugin ll
coz it means you have to handle it there if its not runtime
you throw the original error
fair enough
exception
making changes to it will only make teh dev and your life harder
they report an error to you, you then have to cross reference your error to try and figure out the original exception
what if its not an actual exception, but rather a 'the data you gave me is malformed'?
theres always a suitable exception, or you create your own
throwing yoru own exception is fine from your own API
noted
so long as its not being used to control the flow of the code
can you elaborate on that?
in your example of malformed data..
if you create an exception for MalformedDataException it should simply be an exception, they should not use it as a type of switch
excuse me, does anyone know how to encrypt php code? (closed source)
oh jesus i have the image of someone iteratively inputting data until it no logner throws an exceptoin
lol
To create a custom exception in Java, follow these steps:
Create a new class that extends Exception or one of its subclasses.
If you want your exception to be checked (meaning the compiler forces you to handle it), extend Exception.
If you want your exception to be unchecked (like RuntimeException), extend RuntimeException.
Provide constructors.
You'll typically want to provide at least two constructors:
A no-argument constructor.
A constructor that takes a string message as an argument.
u dont need to bc a web browser does not return php, but rather the website that php generates
are you thinking of encrypting php code you are going to distribute to prevent the customer reading it?
useful, but i share my project but don't want others to edit it, thanks
git blame
yeah, not going to happen
People will edit it
GOOD
and distribute it too
php code has to be readable by the php parser so can't be encrypted.
does anyone have a server for datapack help?
ohhhhh, thanks
Are you making a datapack?
no i someone elses, but i want it for new version since owner does not give any sign of life
tool Trims
I guess you could try making a post in the commands discord
lol
well you might live in america but here in europe we use proper bricks
lol
only because you didn't really have much of a choice since odds are your house is probably like 200 years old XD
ty
nah. we still build them outta bricks
the tradeoff of course is that we cant just copy paste them, they actually take years to build
true
Our slaves only knew how to make them out of bricks
were civilized here elgar, we call them 'working class'
lol
Oh and btw we do houses out of bricks so if there is a fire like in LA houses would survive : D we dont do houses out of paper, oh almost forgot or we do out of chirpici too, which its very strong material
Brick houses don't survive earthquakes as well so you'd need to account for that
if you know how to build yes
yea but we dont get earthquakes here kek
we had a tiny one about 15 years ago (UK) due to fracking.
the most exciting thing in middle europe in the last two decades was the partial eclipse in like 2014
I've seen one eclipse in my lifetime and that was around 1999 in teh UK
wierd as heck
partial or total
i wish the one here wouldve been total, it wouldve looked so much more amazing
I remember ghoing home to watch it with the girlfriend
i really really wanted to see the corona
the odd darkness was the wierdest thing
inner clock screaming eh?
it went totally silent as all the birds got so freaked
Its hard to describe the darkness. It isn't something you ever experience at any other time
sighs in too-broke-to-travel
I was lucky it was at my home 🙂
i dont remember a time when we got a total solar eclipse in my lifetime
i heard the next one in europe is in like six decades
If you get teh chance I'd recomend it, its quite the show
the next one here is in 2034 and its going to only barely scrape by my country
next looks to be in 2026
i dont even plan to be here that long
closest to you would be Spain
you dont know spainglish? bummer
it will reach from Iceland to spain and cover most of teh UK upto 96% in Cornwall (South West)
I live in SW UK so I'll be waiting for it
anyway, until 2034, back to IntelliJ
^ thats some dedication
could be a typo
one of those is clearly running SQL instructions
i dont remember using a more advanced form of java
or is it screaming at me
BOO! JAVA!
nothing scarier than having to use java
Yes!!! I was having issues with figuring out how the player somehow became 4 sets of seemingly arbitrary numbers. This will simplify things massively!
here in germany the next total is in like 2081 and 2135 😭
but i've seen many partial ones, next ones gonna be next year
the one from 1999 was also a total here
hey if i message
Thanks for buying this plugin!! Please join DC (link) in people who buy my plugin... is it a self promotion and violence of rules??
i have seen people do it so... lmk
guys, can someone explain me am I tripping or what
one of the allowed constructors
the constructor it cannot resolve
like what??
Gui gui = new Gui(player, 4, displayName);
}```
this(rowCountToMenuType.get(rowCount).create(player, component));
}```
what components are you using
@Override
public List<String> getSuggestions(CommandSender sender, String partialInput) {
if (validValues.isEmpty()) return new ArrayList<>();
List<String> suggestions = new ArrayList<>();
for (Integer validValue : validValues) {
if ((validValue + "").startsWith(partialInput))
suggestions.add(validValue+"");
}
return suggestions;
}
man I'm feeling lazy today
+ ""