#help-development
1 messages · Page 509 of 1
sherlock. I said its not recommended to do it though /mnt/c
okay? its not like you are going to be assasinated for doing it
Using files on host from wsl is so fucking slow
I realized
if its that much faster on linux wouldnt it be somewhat smarter to just dual boot linux
^
oh, now I can sleep again. Thank you
dude
From what I can tell, it seems like you actually need to run two instances of intelliJ with your setup. One for your local changes, and then the WSL one for compiling.
I just tried to open a wsl project on my host. It doesnt work, even though IntelliJ supports wsl. I complained about it because me and someone else talked about IntelliJ problems a few days ago.
At a certain point, you have to ask yourself. Is it really worth the hassle you're going through?
Is it really that much faster? I remember back when I still used Windows that my compile times were roughly the same. Maybe it was a little bit slower than linux, but only by like 10 seconds or a minute at most on larger projects.
if it doenst work i will go back to run it on my local machine. I just expect some form of quality from a 300€ product yk.
patches are applied way faster
i stopped at like 30 minutes on my host, whereas the whole thing completed in like 15 minutes on my wsl
i do get the feeling that people eagerly jump on it being an x-y problem here
Are you talking about spigot patches or something else?
when in reality, a lot of people do have reasons to ask the questions they ask
I didnt even ask a question
but i am noob
what
For spigot patches???
doesnt matter. Technology is the same.
no
It actually does matter. Different software has different rules for compiling.
And project size also plays a role.
I'd just run linux bear 🐻 metal tbh
its git patches. wym different software
Take a chromium or firefox compile for instance.
They take at least 30 minutes.
It's partially due to their size, but they have several compilation steps and verification checks that run. I'd seldom say that it's similar to what buildtools does, but on a much larger scale.
And at least BuildTools has improved upon its compile times.
However, another part of it is your compilation environment. There are settings for thread allocation and even flags you can use to get more resources to use.
BuildTools takes 5 minutes to execute on windows and 2 minutes on my wsl
scale it
i didnt even notice it applying patches on linux but it was stuck like half a minute at applying patches for spigot-server
how i check if player holding a item ? i tried
e.getPlayer().getItemInHand() != null
but its always true
please use getItemInMainHand()
if you want to get the item in the main hand
you dont need to do the != just use #isAir()
it was better when you used to be able to just use null
@young knoll pr go
github?
oh nvm yeah thats what it is
nothing interesting in the class really
How do I go about creating a custom entity selector tag?
For example, if I wanted to be able to use /kill @e[type=#hostile], how do I register that #hostile tag?
I know that in my plugin I can simply use <Entity>.isHostile() to get if an entity is hostile, but how do I register that as an entity selector tag?
Or some other selector tag too, this is just an example
Idk. I have only been doing this for like the past week and a half but.
From what I learned you can get all the tags use a switch statement and maybe filter through all the entities in the world using the Arrays.stream .
But don't quote me on this
Coll
How do I shift a location in a forward direction
based on like which way it is facing
isEmpty
For what
Locations don't have a facing
Too lazy
They have a direction
I thought
So I want to move it forward
based on the direction

who
Locations can have a pitch and a yaw
Ya the direction
do something like this```java
Location loc = /* Your location /
Int distance = / Your desired distnace */
Vector direction = loc.getDirection()
Vector offset = direction.multiply(distance)
Location newLoc = loc.add(offset)
But that isn't really a direction, and most locations just have world, x, y, z
Is in kotlin, but you can extrapolate that into java
kotlin smh
Thats a new keyword what is lateinit
dont worry about that,
just loc is your existing location
and distance is how far you want to move
But what is late init
some kotlin thing
og
I just used that so intellij would autocomplete as if it were an actual Location
without actually having a Location
But yes if you have a vector you can just add it to a location
This ill work?
eyeLoc.add(eyeLoc.getDirection().multiply(.5))
u might wna set y zero, depending on what u're doing, then follow that up with a normalization
edited the original suggestion to be java
but yes, normalize your vectors
Whats normalization do?
Makes the length 1
The length of what?
The vector
So, ```java
eyeLoc.add(eyeLoc.getDirection().multiply(.5).normalize())
Tell the javadocs not me
Dang rekt
anyone has any idea what usr/glibc-compat/lib/libc is?
I think its the server trying to keep worlds up?
I'm trying to optimize my plugin but idk what that is
Magnitude and length are both valid terms dw
yeah it was sarcasm
a native method call from somewhere
r/whoosh
wdym by native method call
some example please
What is the default walk speed with like, plr.setWalkSpeed();
thanks 😊
yes plz
There’s no point in multiplying by 0.5 if you’re going to normalize right after
I am tryna shift it forward by half a block
thats what they told me to do
normizle it
Change the order
Normalize then multiply
No
A vector has both direction and magnitude
Normalization keeps direction the same but changes the magnitude to 1
If you want to go half a block forward, you would normalize it first to make the magnitude 1, then multiply by 0.5 to make magnitude 0.5 in the vector’s direction
I guess yeah
Kinda
i would hope not xD
Because they are the only admin listed on the site.
there isnt really much to manage, prs come in from everyone and the other staff can handle most stuff on the site
all md has to do is check prs are good and merge them
and the only one you will ever know about
🤨 wHa Wha.. did he do to the others...
he has to feed his kangaroo somehow
Lord
trade secrets
(He ate them)
Can someone sanity check why this custom event from a plugin API might not work?
Its a premium plugin so you cant really look at the underlying stuff but is there anything dumb in this particular class that would prevent it from triggering? https://github.com/Angeschossen/LandsAPI/blob/master/src/main/java/me/angeschossen/lands/api/events/LandOwnerChangeEvent.java
hey guys, I've seen recently some lives on twitch and tiktok that when some events are triggered like following the streamer or giving him a present or smt like that, something happens in the server, does anybody know how to achieve that?
find some rest api or java api for that platform and do stuff accordingly
okay, thanks
Anyone experimented running on demand server with kubernetes for instance ?
Is there another way to spawn mobs that can't be spawned with following method?
<T extends Entity> T spawn(@NotNull
Location location,
@NotNull
Class<T> clazz)
i.e. Camels?
Can camels not be spawned?
It throws an internal error and says they can't when I try it
there are a bunch of mobs that return false for isSpawnable() but the docs just say its because some things may require more information. Doesn't say how to spawn them though
?paste
Every mob can be spawned lol
Hey, how can i create custom events?
how would you create a fake invisible ender dragon death like in this plugin https://www.spigotmc.org/resources/prodigynightclub.58234/
effect like particle? no there isnt
?learnjava
Here are some links to get you started on learning Java:
- https://www.codecademy.com/learn/learn-java
- https://www.sololearn.com/learning/1068
- https://www.learnjavaonline.org/
- https://programmingbydoing.com/
- https://docs.oracle.com/javase/tutorial/java/index.html
The last one is the only official one, however some of those concepts assume that you already know a bit about programming.
Anyone wanna be an utter gem and have a crack at seeing there is any obvious problems here?
It's the one event I just can't get to trigger at all
The code where you call the event may be more useful
My brother in code I kid you not it's a single line method to log 'test test test' to the console
It was just to test if this thing even works
Not the listener
Ah I see what you meab
Well unfortunately the chap who made the plugib doesn't have it on gitbhub as its a premium
Was half hoping it'd be something dumb
So it didn't get that far
I mean it’s possible they just never call it
Hey I have an odd problem I am making a block that basically just stimulates the scaffold hack which i assume is simple but apparently not. I think i have narrowed it down to going in between chunks that cause the lag back. For example ill be using it and once it places the block that is bordering the chunk it lags back. I have no clue why this would be but here is the code.
Plus this is only happening on the prod server on the test server it works fine no lag. Tried resetting paper and spigot yml to the same thing too
Try calling the event youself and see if your listenerv picks it up
^^
If your listener is called, it's probably that they're not calling the event in the plugin
Anticheat?
What? I said it lags back not that its not working. It works just lags back
Nope
Are you sure?
Yeah?
If it works on one server but not the other, it's probably some sort of conflict
Well yeah but i removed all the variables same plugin list same spigot and paper yml and same server jar
Are all plugin configs the same?
They dont have configs
Not your plugin config
Yes ik
The other plugin configs
There is only 1 plugin during testing
Oh ok then I'm really not sure
Timings doesnt show any crazy lag either
I would like to implement a form of collision detection for a fake falling block I generate asynchronously. I send packets to players which spawn the block and give it a velocity, and their client then renders it travelling through space and eventually landing on some surface — I would like to be able to ‘time’ it so I send a packet around the time it collides with another block which destroys the fake falling block. I can do the math to calculate the fake falling block’s positions in space as it travels, giving me a list of locations to ‘check’ for the blocks inside, but I’m uncertain on if this is possible to do asynchronously, or if I need to call sync methods for all of this. Advise?
Basically, I want to get a block type at a location asynchronously. I strongly suspect this is impossible without caching chunk snapshots, but let me know.
packets/math can be done async, world changes have to be sync
I don’t want to change the world, I just want to get a block type.
reading from the world is only safe async if you use a chunk snapshot
Damn, you don’t think there are any plugins which automatically save chunk snapshots, do you? @eternal oxide
Yeah, I know — I just don’t want to make 30 snapshots every tick
Maybe I could snapshot the whole world every few minutes
I don’t need perfect fidelity
Ah
Yeah, that’s what I want to do
in which case you already know what chunk/chunks you need
the 4/9 chunks where it lands
you get all your fb's get teh 9 chunks where they land, grab snapshots and push to a Set
Set so it eliminates any duplicates
or instead of using fb created via packets you can create actual fb's and tag their pdc so you net notified when they land
every landing fb will trigger a https://hub.spigotmc.org/javadocs/spigot/org/bukkit/event/entity/EntityChangeBlockEvent.html
Yeah I know
I have a suspicion that lots of entities cause lag and I have various hurricane effects with like 50-100 fbs all flying around
I’d rather fake it with packets alone
ItemMeta class
/**
* Checks for existence of a display name.
*
* @return true if this has a display name
*/
boolean hasDisplayName();
/**
* Gets the display name that is set.
* <p>
* Plugins should check that hasDisplayName() returns <code>true</code>
* before calling this method.
*
* @return the display name that is set
*/
@NotNull
String getDisplayName();
Plugins should check that hasDisplayName() returns true before calling this method.
Why should I? Doesn't it return an empty string?
I mean, that is more implementation detail than anything tho
you are obviously free to check it that way
Ohh, I've found the implementation.
It really returns an empty string.
But I know why they suggest to do that.
That because, oppositely, setDisplayName an empty string will replace with the item's original name. That mean, empty string is treated as NOT hasDisplayName
how to build a plugin using gradle
gradlew build should do it on windows
./gradlew build on macos/linux
or are you asking for a setup ?
Hello, my friend can't destroy blocks on his server even in the op and I forgot how it was set, would anyone know please? Thank you.
Oh,sorry.
hey there, does anybody knows how can i split a chat component by each newline component?
If you have an array you could probably do instanceof checks
Otherwise unsure
How can i make a claiming system?
Like, how do i store the fata
Data and stuff
Got no idea
database
can you run spigotplayer.respawn() in playerdeathevent or do u need to wait a tick?
Why not try and see
hell nah not storing terrain data in db
At least if its not local
Well idk
I just wanna see how to claim stuff
Then storing is another thing
Easiest way is by chunk
Second easiest would be nice rectangular bounding boxes
Most complex would be fancy polygons
I like second one
So i had this idea of a wand like World Edit
And some commands
And a cache map like <Claim, String(this is the clan)>
But it should be with locations?
Shouldn't you use UUId for clans or a Clan Object
Seems like the best storage method to me
Yes also thats true
Bc i have this clan object
But when i load all the clan
I need the leader or the name so it doesnt matter
Lookup table 💪🏻
But
When player moves right, how i should know where's he at?
Like i think checking all claims everytime a player moves isnt a good idea
oh yes i want
Actually theres 3 different claims; Spawn Koth and Clan
Where Spawn is not pvp not build
Koth is not build
And clan is not buils
So ig bounding box doesnt work?
Hi, I'm trying to delete the info logs from mongodb "org.mongodb.driver" (and others afterwards). The problem is that I've tried a lot of things, but nothing seems to work
https://www.mongodb.com/docs/drivers/java/sync/current/fundamentals/logging/#logger-names you can probably get logger and set its logging level to error or smth
So I've got a project where I am modifying ore spawn rates in a cobblestone generator. It's all working fine, but I'd like to improve the spawn chance system.
Right now I have a variable called odds and if a random int between 1-100 is less than or equal to the odds, it uses that instead of cobblestone. The problem is that this only works if you have 1 option. If I have 2 ores that could spawn, and iron is at 20, and copper is at 10, then iron no longer has a 20% chance, it has a 20-10=10% chance. So then I have to set iron at 30, subtract copper and get 20. This would be non-ideal but ok, except that I want up to 6 ores. So then if I adjust any one of them, it changes the rest.
My initial thought is to put odds number of entries into an array or list, and then get a random entry. This seems inefficient. Is there a better way?
how would another 10% chance take away 10% of 20%? the odds are the same. you have the range from 0.0 to 1.0. 0.0~0.2 would be your first and 0.2~0.3 your second item. rest cobblestone
- BoundingBox represents something physically in game?
- I can create multiple BoundingBoxes (1 per clan)
the other idea of having a total items list and random picking is also a widely used method and totally legitim and not inefficient to use.
Hi
maybe even faster if done right
- It doesn't have to, but you can get the bounding box of an entity for example
- Yes
Not so.
If the random is 5, that is below 20 and so it should be iron. But since it is also below 10, it is instead copper. Therefore, you only get a 10% chance of it being iron, and a 20% chance of it being non-cobblestone.
Make a weighted random utility
what even
what are you doing
?paste your code
weighed random is bae
I played Deathwatch rpg and it had a percentile system.
I understand.
Be stupid with it and do 2 individual rolls
2 rolls, 1 for copper spawn chance. 1 for iron chance
Weighted has the exact same issue he is having.
More crap u put in, less chance of getting everything else
Me still here shaking my head when server owners wonder why adding more items to a fishing pool makes the rare stuff even rarer
Anyone knows if there is an api to check spigotmc linked accounts, it's to check if an user has a discord account linked
I dont think spigot has a public api for there website
we have something
I didn't even read what this was about, I just saw weighed probabilities being mentioned and I pogged all over my keyboard
Cool, didnt even know you guys had somethind 😄
Thanks!
If anyone needs it, this is the api for get an user profile information (included discord account linked):
https://api.spigotmc.org/simple/0.2/index.php?action=findAuthor&name={spigotmc_user}
Just replace {spigotmc_use} with the actual user
uh could anyone help me with this?
Sure with what?
[Server thread/ERROR]: Could not pass event CreatureSpawnEvent to ASIBUSABIUSBAIUS
java.lang.NullPointerException: Cannot invoke "org.bukkit.attribute.AttributeInstance.getBaseValue()" because the return value of "org.bukkit.entity.LivingEntity.getAttribute(org.bukkit.attribute.Attribute)" is null
so I made a plugin which generates a room when someone does /room
if(instanceof LivingEntity)
but this keeps happening
So why are you trying to spawn a creature?
you can use ?paste to get a pastbin link
?paste
What is IRoom.java
Iroom.java?
yep
Did u write it or copy?
c# man
abandoned
abandoned
Upload the file
the IRoom.java?
Yea
Also whats
Doors5();
Catwalk6();
QuartsKnight7();
MithrilCave();
Melon7();
Andeside2();
Are they schematics?
yeah
Do you have any eventlisteners?
nop
oh wait
if (event.getPlayer().getServer().getPort() == 25569)
player.teleport(new Location(Bukkit.getServer().getWorld("world"), -101.5, 41, -185.5, 0, 0));
if (event.getPlayer().getServer().getPort() == 25566)
player.teleport(new Location(Bukkit.getServer().getWorld("dungeon"), 0, 0, 0, 0, 0));```
got these 2
for dungeons
oh
probably want Bukkit.getWorlds().get(0) for overworld
put
try{
} catch (NullpointerException ex) {
Bukkit.getServer().getConsole().sendMessage("Error");
}
around it
you might be getting a player that doesnt exist
that would explain the null
Is there a way to Obfuscate my source code? Just to make it harder to read my source code
just dont publish the source code?
If you dont want it to be readed then why you publish it?
It can be decompiled
Im trying to add items to a villager, where do i modify price and stuff?
or how to do it correctly
I asking this because I seen it done on a plugin, I forgot which one but lets say that it was a paid plugin
if you want to publish it on spigot check the guidelines for allowed obsfucators if not use any you want
https://hub.spigotmc.org/javadocs/bukkit/org/bukkit/entity/Villager.html
Check this, use the Merchant interface methods (setRecipe)
declaration: package: org.bukkit.entity, interface: Villager
a good free, allowed, one i know of is allatori
Do I need source code for this or do I just drop the compiled jar file (Plugin) into the program?
how do i distribute the workload or handle heavy tasks?
?workdistro
Hey yall im working with mongodb for the first time and it seems to connect fine but when i try to read / write i get this error
Caused by: com.mongodb.MongoCommandException: Command failed with error 8000 (AtlasError): 'bad auth : authentication failed' on server ac-iqboryw-shard-00-01.pprhyoh.mongodb.net:27017. The full response is {"ok": 0, "errmsg": "bad auth : authentication failed", "code": 8000, "codeName": "AtlasError"}
bad auth : authentication failed
i thought it was because i was using incorrect username and password but ive triple checked them and theyre correct
Is your ip whitelisted
for right now its set to all ips
noob question: ive never touched spigot before. is there a generally recommended package structure?
Howdy, Im trying to make my mod communicate with my plugin using plugin channel, my mod can send and read packets however Im having trouble with reading them on the server
Im getting java.io.EOFException, however readUTF does not throw that exception so I cant just put It in a try block cause "Exception 'java.io.EOFException' is never thrown in the corresponding try block"
plugin reading packets function:
ByteArrayDataInput in = ByteStreams.newDataInput(bytes);
String test = in.readUTF();
log.info(test);
}```
overall a package for listeners, one for commands, one for data etc
I mean, what is the stack trace ?
beyond that, readUTF might not be implemented the same
iirc the minecraft implementation (that your mod presumably uses) uses a var int to denote the length
ive tried creating a new user and generating a new url and that also didnt work
Your connection string may be malformed or your ip may not be whitelisted make sure your password is correct as well
If none of these are issues you are wrong you're likely missing something
Make sure your password is inside your connection string
it is
String url = DatabaseConnectionInformation.getMongoUrl();
String password = DatabaseConnectionInformation.getMongoPassword();
return url.replace("password", password);
}```
ive printed the string by itself with this method and its correct
I use fabric, and yes it does - buffer looks something like this [4, 116, 101, 115, 116] (string of "test")
It isn't or you'd be authenticated
yea but googles byte streams does not
Well, java's DataInput doesn't
so I should just remove the first byte?
for ip im allowing access from anywhere
no, you should choose a single format for communication on both mod and server side
Hey I have an odd problem I am making a block that basically just stimulates the scaffold hack which i assume is simple but apparently not. I think i have narrowed it down to going in between chunks that cause the lag back. For example ill be using it and once it places the block that is bordering the chunk it lags back. I have no clue why this would be but here is the code.
maybe you haven't specified an authsource?
how do i do that
MongoClients.create(new ConnectionString("mongodb://" + username + ":" + password + "@" + ip + ":" + port + "/?authSource=" + authsource));
figure it out
I have the same issue as this person here: #help-development message
and this person here: #help-development message
The first one is unresolved and the second one's solution does not solve it.
The problem is that when the last person in a world logs out, unloading the world with unloadWolrd(world) fails. But if I dont do that and then delete the folder anyway I get the error messages seen in the above linked messages.
So how do I unload a world when it is not loaded by a player because they left the game?
Loop through all the players in the world
if there are none
then just unload
wait like a second just to be sure and delete the folder recursively
unloadWolrd(world) returns false
but only if its when the player quits. Not when they go to a different world
playerQuitEvent type deal
I play with worlds here and it works out fine
but you dont seem to delete the files
thats where my problem is. If your unload fails its no problem but if mine does I cant delete the file
ok nevermind, you do. I tried doing something similar as the CompletableFuture thing you do but it just ends up never deleting the files anyway since the unload will always fail no matter how long I wait
Its like I would need to unload before the player has fully disconnected
fixed! Thank you so much this has been an issue for days now
I teleport them to the main world and then check if I can unload
Anyone know if there is an entity metadata or something else I could use in a packet that would prevent the client from showing the entity slowing down (as in, sending a packet which will display the entity moving indefinitely in some direction)?
does anyone have any thoughts abt this?
I got a issue with my server shop. I click a group and if it contains in the shop somewhere, it goes straight to the purchase GUI (Skips the group GUI). How do I avoid this?
Its a plugin I wrote
how can we even help you if we don't know what you wrote in the code
tell us how did u make it
How do I fix this? I already invalidated the caches about 5 times and it is not working. I am using the latest version of IntelliJ Ultimate
reload maven or gradle
gradle
reload
which problem?
this
ho, I found the reason, forgot to add api-version
Where can i learn the basics for plugin development? i now have a very veryyyy basic information about java, but i want to start and learn in the procces
Hello, I would like to know if someone would know a library for an internalization system to integrate to my plugin? I could do it myself but I might as well take a tool that already exists !
what exactly you are looking for
I don't know if it's me you're answering but I'm looking for a system a bit like forge that allows you to define several language sheets with translations...
I found a way to do it using just math, rather than lists, arrays, or multiple rolls.
Basically you just take the intended odds, add them all together, and that's the odds for the highest. Then subtract the intended odds of the highest and that gets you the odds of the second highest. Work your way down iteratively, and you've done only math and numeric iterations, which are both super cheap.
So say we want 15% odds of coal, 10% odds of copper, and 5% odds of iron. Added, coal gets <30, copper gets <15, and iron gets <5. Works beautifully.
Why I keep getting told to ask here from #help-server ?
Are you asking about plugin development?
He is
Feel free to elaborate
I got a issue with my server shop. I click a group and if it contains in the shop somewhere, it goes straight to the purchase GUI (Skips the group GUI). How do I avoid this?
https://paste.md-5.net/ipopefidus.http
https://paste.md-5.net/ahevuxiloy.http
https://paste.md-5.net/tepedepuda.http
What's a group?
Simply canceling the event and adding ignoreCancelled = true in the eventhandler will probably do you some good.
You've got the InventoryClickEvent being monitored by all 3 classes O.o Interesting way of going about it.
@tall furnace You never look at ShopGUI+ before?
I tend to prefer sign shops, but I've seen ShopGUI at some point in the past
So you select a "group", as in an item that represents a type of material, say logs?
And when you click, it's going to the point where you purchase or sell a set amount instead of going to a window where you select exactly which material?
Config file I told my plugin to access1: name: Blocks icon: GRASS_BLOCK items: GRASS_BLOCK: purchase: 50 sell: 5 DIRT: purchase: 30 sell: 3 ...Ok, I have a GRASS_BLOCK as the icon as shown above which is in the shop list below. But if my issue is the 3 events, I will have to write a manager
Its just a icon you click to view sub items for the shops
It's actually possible to have listed sections. People should make use of that instead of typing 1 2 3 etc the whole time
Spigot's API for that is just broken
Looking it over, nothing is catching my eye right away that should be linked to your problem. Have you tried println debugging?
Listed sections within an inventory?
No in .yml files
Oooohhh, yeah. Looks ugly but yeah.
The number does allow for you to put them in any order though, and assign a slot based on the text of the key.
That number does not mean anything, I can type anything. But that is not the issue. I working on fixing the issue as shown above, going to see if adding a GuiManager works
https://github.com/CuriosityCore-Development/Lands-Landlord
First full plugin released. Feedback welcome :L
I cannot test your plugin, banned from Paypal
Less test it and more just "how it be look"
You wrote that Lands plugin is required to function
omfg no wayyyy
how did i do intricate javadocs
and
forget
private
💀
in every single class
*LandOwnerLimitCheck
See
there is proof im not an idiot
How i missed such a dumby basic thing
Eh
Raz's Rule
"Everyone screws up around 20% of the time"
Ill correct and boom easy
how am i supposed to check for a claimed chunk aka, if player permitted to place blocks in that chunk, not in a single block
What do you mean?
In general or for lands?
Trying to fix this
Original Issue
Now the shop does not even enable its self
@slim wigeon Ok well the way your going about this is not very good I recommend giving this a read: https://www.spigotmc.org/threads/a-modern-approach-to-inventory-guis.594005/#post-4553427
I might know what I need to do
config.save is for saving on already setted files, and .set is for new variables?
i am learning NMS, but currently i only can import things from org.bukkit.craftbukkit.v1_19_R3 but not net.minecraft.craftbukkit.v1_19_R3, my dependency is:
<dependencies>
<dependency>
<groupId>org.spigotmc</groupId>
<artifactId>spigot</artifactId>
<version>1.19.4-R0.1-SNAPSHOT</version>
<scope>provided</scope>
</dependency>
</dependencies>
Yes, you set the values in the config and use save() when your done setting them
Thanks!
Did you run BuildTools for 1.19.4?
yep i am pretty sure
try running it again
Are you trying to use the mappings?
yeah
Did you run BuildTools with the --remapped flag then?
no i just ran java -jar BuildTools.jar
Ok, well you need to run it with the --remapped flag.
oh i ran it again it seems to be downloading a lot
You should also specify the version.
Well there's your problem
ok i will thank you
You'll also need to update your pom with the classifier tag.
<dependency>
<groupId>org.spigotmc</groupId>
<artifactId>spigot</artifactId>
<version>1.19.4-R0.1-SNAPSHOT</version>
<classifier>remapped-mojang</classifier>
<scope>provided</scope>
</dependency>
can i save my config all like in the same line? if(word == "set"){ plugin.getConfig().set("players.id", player.getUniqueId(), "players.id.name", player.getName()); plugin.saveConfig(); }
ik the commas are wrong
No, you have to do each section individually.
k thanks
it still doesnt have net.minecraft.server.v1_19_R3
Reload your pom
Also just to make sure since I’m very new to spigot, the build tools ist the jar in the server folder right? Otherwise I would be really dumb to mess this part up
No, BuildTools is the program that you use to compile the server jar. Once it's done, the server jar file will be in the parent directory that you ran BuildTools in.
Hey! Help me, please. I am receiving a packet sent from the server by this method: https://paste.md-5.net/tigohaleki.cs
But when decoding in mod, I get empty values.
Decoding method: https://paste.md-5.net/qagadadoji.cs
first time i dont steal all the code lol
lands
how to check if player has offline acc or not?
nope still doesnt have it
How can i generate others persons config to check if i can see others people aboutme
you can't forcefully generate other plugin's configs unless you do some reflection hacks which I honestly wouldn't reccomend
What does your pom look like now?
you mean cracked ?
why would you do that
No i mean, like for testing generate like fake configs
support only online mode
can i send the whole thing in here?
add configs to your resources folder and disclude it from the build
?paste it
like this is my config when i generate : ```players:
9c4a8834-849b-4a71-91d6-b3b35650a534:
name: ChiruMC
aboutme: ASDASDASD
ok thanks
ye
just to verify whos cracked and whos not
I dont think i mean like that, i mean like just gen some players id and name and aboutme so i can see if with a command i can see their abouts me
put it a random unique id
and add an aboutme
https://namemc.com/ you could also just use NameMC to come up with UUID's
but honestly UUID#randomUUID() is easiest IMO
And you ran java -jar BuildTools.jar --rev 1.19.4 --remapped?
thanks yeah i didnt know where to get a players uuid
you'd have to setup a test env
for a case where you retrieve VIA UUID instead
in your case though I'd reccomend just using offline mode to test
it was intended for developers anywyas
yeah, but also where should i put the buildtools.jar when i want to run it?
take advantage of it
It can be just about anywhere except in the OneDrive folder. A folder on your desktop would be sufficent.
Oh yeah thanks!
if you use a client like MultiMC it just allows you to boot in offline mode
alright, i ran the command again but should i do anyhting with the outputted jar files?
You shouldn't need to. Not for NMS anyways. Unless you want to copy the latest spigot server jar to your server.
the spigot-1.19.4.jar
alright then
so does maven know where the jar is?
because i did not specify in intellij
I may sound dumb but where is the server-propeties? like idk why i dont see it, i always use a pterodactyl panel
nvm
is the config of paper i think
BuildTools installs everything to your local maven repo, so maven should be able to detect it once you reload your pom.
You may want to double check the buildtools logs, but if you already have a spigot jar, then it probably finished successfully.
I tried building it
K so for checking another players aboutme i have this setted up : Player targetPlayer = Bukkit.getPlayerExact(word); word is the args 0, but then i have this code : ``` } else if (plugin.getConfig().get("players."+targetPlayer.getUniqueId()+".aboutme") != null) {
//Another players aboutme
player.sendMessage(ChatColor.WHITE+targetPlayer.getName()+ChatColor.YELLOW+" About Me: "+ChatColor.WHITE+plugin.getConfig().get("players."+targetPlayer.getUniqueId()+".aboutme"));
}```
it isnt working
It's the file labeled server. You don't have file extensions visible.
oh
thanks 🫶
Is it even important? I am going to run the kotlin and main file,
But for me to run it I need the class path, not the file patj
then wait cause that may be
k no i still can see
this is my config : ```players:
9c4a8834-849b-4a71-91d6-b3b35650a534:
name: ChiruMC
aboutme: ASDASDASD
1781e3b2-8c92-4d53-8023-4c34b6e1d613:
name: Caca
aboutme: Me gusta la caca
when i do /aboutme Caca it says an internal error
then in the console says this : Caused by: java.lang.NullPointerException: Cannot invoke "Object.equals(Object)" because "targetPlayer" is null at commands.AboutMe.onCommand(AboutMe.java:59) ~[SimpleAboutMe-1.0.0.jar:?] at org.bukkit.command.PluginCommand.execute(PluginCommand.java:45) ~[purpur-api-1.19.4-R0.1-SNAPSHOT.jar:?] ... 23 more
Caca is not online probably
Bukkit.getPlayerExact will return online player
thanks
you can use Bukkit.getOfflinePlayer
thanks, will it work if the player is online?
yes
cool thanks
Player extends OfflinePlayer so as mentioned, yes.
how can i get the uuid by name, if OfflinePlayer asks for Uuid
offline player has a string varient
Only if you and chiro are done:
#help-development message
you can also use nick
i would guess it isnt made to have a kotlin compact path
why are you mixing java and kotlin
Oh yeah my bad
i was doing Player targetPlayer = Bukkit.getOfflinePlayer(word);
and it had to be like this OfflinePlayer targetPlayer = Bukkit.getOfflinePlayer(word);
it returns OfflinePlayer, not Player
How can I get the class path to the kotlin file?
thanks to all
what for, and if you are going to use kotlin you may be better using intellij
offline player works the same as player i guess
player instance is returned only if player is online
Yeah, i mean like when i use targetPlayer it will work the same as when the var was player right?
not exactly, for example you cant use pdc of offlineplayer, or send message to offline player
just a quick note if you dont fully know java getting help here will be a lot harder been as most of us use java and theres only a few that know kotlin
I know this may seem weird, but I need to run two files upon startup, I heard I cann do:
Main: CLASS_PATH, SECOND_CLASS
What
No
Oh okay thanks
that isnt valid yaml or something that will work if it was valid
Can you run multiple files on a plugin.yml? Also, does spigot relocate your scripts when it is in the server because I tried fetching something via class path as it said it wasnt there
wdym run multiple files, each plugin.yml is 1 plugin and spigot doesnt relocate anything by itself
then how come I couldnt get the classpath of a file?
no idea
You cannot have 2 main classes
looking at the screenshot the kotlin file wasnt in a package so theres 1 thing
i have fealing you are doing something really wrong
looks like it tbh
How do I run a kotlin file onEnable? is there a link
Kotlin file?
throw back to me saying "just a quick note if you dont fully know java getting help here will be a lot harder been as most of us use java and theres only a few that know kotlin"
You mean a Kotlin class file?
yes
Same way you run a java class file
Actually ima search it up
ok thanks
Like this?
public class Main {
public static void main(String[] args) throws IOException, InterruptedException {
Runtime.getRuntime().exec("java -cp /path/to/class/files MainClass");
}
}
Just a example
i highly doubt you should ever do that
yeah I kinda figured
Wtf
looking at what i can find online your kotlin file should be in src/main/java/your/package/ and should be Name.kt
What’s wrong with new MyClass()
Should I just register the kotlin class with spigot, and if I want to i can run new Class()
Or MyClass.staticMethod()
yeah I think that would be best
do you need to register other classes with spigot? other than main class
How does this involve Spigot? This is like running another program like cmd.exe file a example
It gonna look a tad bit confusing because I have to put a kotlin file in a package under src/main/java but if I have to I can
you cant put kotlin file in src/main/java
kotlin is weird i dont know kotlin i have to go off what i find online
Makes sense.
this says otherwise lol https://github.com/deanveloper/KotlinPlugin
So I just cant have src/main/kotlin as a class or sntin
you dont have a package in src/main/kotlin
KOTLIN 💀
Can I create one in the file path? then will it show up as src/main/kotlin
Oop, I cant create a package for the file editor
just gotta say this i would highly recommend not using kotlin for spigot and especially when you dont know java enough to convert code back and forth and getting help here while using kotlin will be 90 times harder
there is literally no reason to mix kotlin and java in spigot plugin
I created a package called kt.onutillities
^^
I still want help here but I want to have some kotlin in my plugin
why there isnt a reason
How do I convert a UUID to a username if the player has never joined the server?
learn kotlin after you learn java
Ik I have to use mojangs api just dont know how to
yeah, so later, after I learn java I can slowly transition more code to kotlin
Currently im only using kotlin for one thing, which is minor
transitioning code to kotlin wont help much
what do you use kotlin to do
lame
that doesnt work anymore unfortunately
sadly im using 1.8.9 too
there must be a way tho using mojang api
Mans said he's using 1.8.9 💀
Hi, now with the offline player, it doesnt send any error code, but it doesnt send the aboutme of the player
?paste

aye man if im paid to do it ill code any version
Some of us have standards
i do too thats why i charge more for it
I could probably get paid to suck dick
unless you pay me 2 million dollars im not going further back than 1.16
I don't want to though
😯
1.16 ain't that bad though.
It just gets worse the older you go.
yeah
Anyways, the API is fully documented here by the community, https://wiki.vg/Mojang_API
Query an end point, read the result as JSON, knock yourself out
Isn't that always up to date with the latest version?
only reason i said 1.16 was because 1.16.5 let us use java 16
Shadow...
thanks
This is a web API
Ohh, my bad.
.
I thought you linked the Protocol wiki link
i knew they documented packets not mojang api tho
This link applies to you as well @tranquil prairie
we need to get everyone with stash access to join as a reviewer for the component pr and approve it
Would be appreciated to get some eyes on it tbh
you know what we need to do
The more people that read over and review the changes the more likely md will be to merge it lol
wake sam up and get him to call md
Well I mean I pinged him privately. He'll see it when he sees it
Not worried about that
I just mean that I want to make sure I've not missed anything
https://hub.spigotmc.org/stash/projects/SPIGOT/repos/spigot/pull-requests/120/overview
do you think we'll ever merge bukkit and craftbukkit into one
but the pr looks done to me
How would that work
idk
You mean Spigot -> Bukkit?
magic
I think he meant Bukkit -> Spigot
Er, yeah, I knew what I meant
Unsure. Up to md whether or not he wants to drop Bukkit & CraftBukkit and migrate Spigot into source-level editing
Would require tooling update
spigot moves to gradle!?!?!
Oh we are going to code spigot in the source engine?
BuildTools would need adjusting, Spigots scripts would need changing, etc.
wouldnt buildtools stand the chance to get quicker
Eh, it's to be expected when migrating, but it would be nice to see everything under one org.spigot package.
Merging spigot into craftbukkit/Bukkit would be nice
Rather than having to separately deal with spigots 90 patches or whatever
That’s a breaking change
Well I guess you could comadore that
tbf I did kind of steamroll Coll's old PR https://hub.spigotmc.org/stash/projects/SPIGOT/repos/spigot/pull-requests/109/overview
when was coll called martoph
I haven't seen that name in a minute. hold up.
Hi, my targetedUser wich is the one that is putted after my command ex : "/aboutme user", and when i do it nothing happens, no error, no message, nothing
you just like
open them in notepad
Forgot that was Martoph that did that
is that not how you do it
fwiw, Spigot's fixup commit system is rather confusing and obscure if you're not more experienced with Git. Not to mention that it's not at all documented in the Spigot README
🙃
Adding new commits is. Editing existing patch files is not
I should probably PR that because I have a workflow for it
choco you should make a wiki
Choco
Yeah I figured out how to add new ones fairly easily
Me
do u live in toronto?
He lives on the very top point of the CN tower
im travelling there, where can i go as tourist
The CN tower
no
niagra falls
but
CN Tower & Ripley's Aquarium are the two immediate obvious answers
timmies
thats not that common
Try not to get mugged
damn
mugged?
do they come at you with knifes, guns or fists
damn
All 3
Robbed
idk
i think this is choco https://www.youtube.com/watch?v=dH5pRQwlxc4
1 in 8 hill out of Cromford, and some classic overtaking by two fowler ploughing engines, passing a Ruston road engine!
Probably not
like i see canada as a super secure country
But it’s on the news a lot
(compared to mine)
It will happen more in Toronto than anywhere else in Canada, but it's also close to the US border and is home of 4 million people
^
technically if theres a cave under the border couldnt you sneak guns in
and drugs
Not nearly as much as, say, Chicago though
If you're comparing to the states, it's nothing
if i dont get robbed here in colombia i dont think im not gonna get robbed in canada
Okay... comparing to Columbia, you're fine lol
COLOMBIA
PLEASE
SORRY
THANKS
Probably also safer than the surface of the sun
I'M UNCULTURED
Did you register the command?
I suppose we're in #help-development. #general would be ideal
yee
this is general
dank mémé
i never talk in general
that monster is what was holding back chooc with the component pr
Northern Canada is basically the backrooms
i wanna go to alberta
seems so normal
like
neutral state
Hi, my targetedUser wich is the one that is putted after my command ex : "/aboutme user", and when i do it nothing happens, no error, no message, nothing
https://paste.md-5.net/enaqomupay.java
Is there anything in your config file?
yes this : ```players:
9c4a8834-849b-4a71-91d6-b3b35650a534:
name: ChiruMC
aboutme: ASDASDASD
1781e3b2-8c92-4d53-8023-4c34b6e1d613:
name: Caca
aboutme: Me gusta la caca
2ec1a513-6e56-346b-bb5f-ddb2f63cc319:
name: ChiruMC
aboutme: jiasndiasdhas
Try sysouting the targetPlayer's uuid and see if it matches one in the config
It says I cant find org.json with this pom.xml https://paste.md-5.net/jecizaxuwu.xml
I removed kotlin from my project, maybe not now is good. Anyways, how do I reload a class for spigot? Like, reloading as in it will clear all varibles and stuff and go back to the original class
Sorry, but whats that?
Whats what?
System.out.println()
sysouting
Ah
oh okay
could it because i need to shade it?
^
What kind of class is it?
A java class
...
it didnt match
but i did this System.out.println(targetPlayer.getName()+targetPlayer.getUniqueId());
and it gave me this[21:22:57 INFO]: [SimpleAboutMe] Caca2f9b8e07-4a4e-3518-a00f-f273e926e974
but if i search that id
its a non existent player
What's in the class and what are you using it for?
I doubt that’s a non-existent uuid
i searched it in namemc and there isnt any users
oh wait
is it because i activated cracked?
Yeah finaly it was the uuid
is there a way to search uuid in offline mode in like a website like namemc
I'm using it for sign events
The easiest way would be to just replace the instance with a new one. I don't have any context so I don't know if it's the most efficient though.
How do I do that?
For events? What do you need to reset?
how do you want to "reset" a class
^
No, my whole class
What exactly are you trying to do?
A idea I had is de-registering and re-registering a class
can i make like my targeted user dont worry if the upercasses are right, cause if i search the aboutme of caca, it says he didnt set it up, but if i search the one of Caca it works
Basically, I tried for hours, something weird happens to my file after it does what its supposed to, and I cant run it again
so I thought, why not reload the class after it does its task if I ever need it again
I tried debugging
and fixing
this is a last resort
You have options like equalsIgnoreCase
Somehting happens to my class not file
Oh yeah that was it thxxx
?paste the class
I guarantee you that nothing super natural is happening to your class
What is "something weird" I have a hard time believing "resetting" the class is the best solution
Well I know what it is exactly, it may not be weird.
basically. two players click two diffrent signs, when they click, the sign text changes to [PLAYER(num) set], if two signs have that then it send the players to a arena, the issue is, I can only reset one of the signs
how can i do it here??? ```else if (plugin.getConfig().get("players."+targetPlayer.getUniqueId()+".aboutme") != null) {
//Another players aboutme
player.sendMessage(ChatColor.WHITE+targetPlayer.getName()+ChatColor.YELLOW+" About Me: "+ChatColor.WHITE+plugin.getConfig().get("players."+targetPlayer.getUniqueId()+".aboutme"));
}
else {
player.sendMessage(ChatColor.WHITE+targetPlayer.getName()+ChatColor.RED+" Doesnt have his about me setted up, make sure to tell him!");
}```
I thought it would be easier just to reload the class
?paste your class
You aren’t even using name
You are using uuid
yes, but when i define targetedPlayer OfflinePlayer targetPlayer = Bukkit.getOfflinePlayer(word);
Ah
like if i put /aboutme asd it isnt the same as doing /aboutme Asd
it doesnt count him as the same player
Yeah you’re kind of out of luck there afaik
Oh damn, well if anyone knows tell me thanks anyways!
if you save the file you can store a map with a lower case varient of the name mapped to the real varient
I don’t know if the Mojang api can handle case insensitive lookups
this means if you only need the about me of the stuff you save
i was thinking changing the method to searching by name instead of uuid but idk
you never reset the class variables that are related to each event, you should use a map and somewhat to track it or reset the variables after X seconds + resetting them when they're used
I need to reset it after the player dies
I cant do after a set amount of seconds
Thanks, ill leave it like thsi for now, ithought it would be easier
is there a way to get the player from an InventoryClickEvent?
event.getWhoClicked()
thanks
You'll get a HumanEntity, but if you need a Player, you can cast it to one
(Why is this like the one instance where you get a HumanEntity)
(a) old event, (b) that's what NMS provides us with
you could literally replace the event with a Player instead and it would be safe
Iirc there are a fair amount of casts in CraftEventFactory that convert human entities to player
Would changing it to player break things? Idk how the bytecode works in this case
Wouldn't break binary compat, no
More specific return types are fine
Just don't see it happening
?paste
what could this error be? https://paste.md-5.net/duniyoyevo.pl
is that the name is wrong?
Player is null and clicked item is null
k thanks
Is it good if I send player inventory data to BungeeCord and back? I mean, sending big data like this, does it cause any problems with BungeeCord? Or just fine?
Because I want to store player inventories there.
Ohh
Thank you!
I am making a minigame server, and I'm planning to use on demand servers to run the minigames instances. What's the best service (kubernetes, AWS servers, ...) ? And is it worth it? (It means that the game instances will start only when necessary and shutdown when no players are in)
Yeah I know, but the goal here is to reduce the bill, by paying servers by minutes of run
All right thanks! Forgot about Azure I'll have a look!
Trying to figure out my structure, not sure about the GUIs package, any opinions?
capital package names are a no go, use snake case
menus or guis are fine
C# moment
I'm gonna go ahead with all lowercase, thank you for bringing it to my attention
Thank you for your assistance good people of spigotmc discord <3
