#help-development
1 messages · Page 508 of 1
Are you getting them as a string or something?
https://prnt.sc/Q6zB8cS5EGNt - I downloaded SRC it works fine but it wont let me make the .java
.java are the class files. You need to expand the com.developed... as there will already be class files
I meant make the plugin
Oh you mean compile it into a .jar file
ye
sry
trying to edit the files to my liking I bought plugin and src but it wont let me make it into a jar
Adding the src isn't enough. You need to make sure you have setup the ide for it. Make sure you have things like gradle or maven (depending what is used for the build file etc..
Having the Minecraft Development Plugin for Intellij is also very handy
You'll also need to make sure you have the correct java version.
You should probably install the Minecraft Development plugin for the ide first
I got that
had that folr a while
At the top right, you probably should add the build configurations in (where it says current file)
Otherwise when you try to run it, it won't know what you're wanting to do
Top right, where current file is, click on the drop down and edit configurations
ok done
What did you add for the configurations
Click the plus sign and add one for maven, since you said its done in maven
which one
left or right
Ok
?? There's one 1 + sign
Now give it a name, then you can just use something like clean install for the command line, then make sure you set the working directory to the project.
Assuming I click this src
If that's the project you want to build then yes
I cant click ok
ok
"Apply", "Ok", "Run" should that work
Try and see
Should be better using clean package, isn't it?
🤷 haven't used maven in ages I always used clean install
Which API version is being used for the plugin
17
Not 20, you want 17
y
Yes
lol
which config do you meant?
[INFO] Scanning for projects...
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 0.081 s
[INFO] Finished at: 2023-05-10T06:43:01+01:00
[INFO] ------------------------------------------------------------------------
[ERROR] The goal you specified requires a project to execute but there is no POM in this directory (C:\Users\ozowe\Downloads\ConeticMC\SourceCodes\ESpawners-0.0.1_source_from_cfr). Please verify you invoked Maven from the correct directory. -> [Help 1]
[ERROR]
[ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch.
[ERROR] Re-run Maven using the -X switch to enable full debug logging.
[ERROR]
[ERROR] For more information about the errors and possible solutions, please read the following articles:
[ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/MissingProjectException
There's no pom.xml
Do you have your pom?
Create new file and name it pom.xml
Should I add from old plugin
Well check if there is a build file first
Do that but be careful on changing all the needed
ok done
It should appear them a maven window saying: "Maven project found" then click Load maven script
nono
[ERROR] The build could not read 1 project -> [Help 1]
[ERROR]
[ERROR] The project (C:\Users\ozowe\Downloads\ConeticMC\SourceCodes\ESpawners-0.0.1_source_from_cfr\pom.xml) has 1 error
[ERROR] Non-readable POM C:\Users\ozowe\Downloads\ConeticMC\SourceCodes\ESpawners-0.0.1_source_from_cfr\pom.xml: input contained no data
[ERROR]
[ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch.
[ERROR] Re-run Maven using the -X switch to enable full debug logging.
[ERROR]
[ERROR] For more information about the errors and possible solutions, please read the following articles:
[ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/ProjectBuildingException
Process finished with exit code 1
I added the pom
show me your pom
oh I see
?paste
Clicked that
then clicked run again
send me your pom
The pom is what everyone seeks
🤖
That's why it won't work. You need to actually add stuff to it
I raccomend you one thing, create a new project and name as your plugin should be, changing all params, at the end drop your old src in the src/java folder
Maven script is automatically created by the ide
It appears they didnt originally create a maven project so odds are they also dont have the appropriate structure
Obv use the Minecraft development project
No, they downloaded source code and tried to build that without any ide setup
Interesting
What do you guys think about old school eclipse users?
What about them?
Eclipse is still as heavily used as Intellij
We have like 2 or 3 devs here that are regulars that use eclipse
The part that stills uses Eclipse to build Minecraft projects
So not sure what you are trying to imply in regards to those who use it
In my opinion that's not worth it
There's really nothing wrong with Eclipse, a lot of people prefer it.
Starting from the IDE itself which is still slow as it was
Not entirely sure what your opinion of the ide has to do with other people using it
I've used 1 time to make a spigot plugin and that was a slow process
Like it does not affect you at all in what ide other people are using
I'm not caring in other people opinions
ok the plugin didnt load ima make a new thing
So we have to care about yours?
And I'm not intended to change them opinions
It was just a sharing of thoughts about your preferences
How do you know it didn't load, What did it say? Where there any errors?
[06:49:28 ERROR]: Could not load 'plugins/ESpawners-1.0.jar' in folder 'plugins'
org.bukkit.plugin.InvalidDescriptionException: Invalid plugin.yml
at org.bukkit.plugin.java.JavaPluginLoader.getPluginDescription(JavaPluginLoader.java:178) ~[paper-api-1.18.2-R0.1-SNAPSHOT.jar:?]
at org.bukkit.plugin.SimplePluginManager.loadPlugins(SimplePluginManager.java:159) ~[paper-api-1.18.2-R0.1-SNAPSHOT.jar:?]
at org.bukkit.craftbukkit.v1_18_R2.CraftServer.loadPlugins(CraftServer.java:418) ~[paper-1.18.2.jar:git-Paper-388]
at net.minecraft.server.dedicated.DedicatedServer.initServer(DedicatedServer.java:288) ~[paper-1.18.2.jar:git-Paper-388]
at net.minecraft.server.MinecraftServer.runServer(MinecraftServer.java:1164) ~[paper-1.18.2.jar:git-Paper-388]
at net.minecraft.server.MinecraftServer.lambda$spin$0(MinecraftServer.java:316) ~[paper-1.18.2.jar:git-Paper-388]
at java.lang.Thread.run(Thread.java:833) ~[?:?]
Caused by: java.io.FileNotFoundException: Jar does not contain plugin.yml
... 7 more
You don't have a plugin.yml
..
Send me your plugin.yml
WHERE IS IT
That isnt what you asked. You didnt ask about preference. You asked us what our opinion was on other people using eclipse
It should be generated by the ide
mb caps
Src/Java/resources
Not always the case, i've always created mine
As I said, I'm not making people guilty of the Eclipse use, I was wondering what you guys think about the argument
bump
I dont got a src
Show your file structure
Ima just make a new project
Where all the java class files are
Drop your old src in the new src folder
This is why you don't download source code and try to get it to run without knowing what you're actually doing
Reason why im here
Send a screen of the project roots
Like a folder structure
There is no argument to be made. I am not going to argue about what others use since it doesnt affecte me, and is not relevant in whether they use something else or not. I suggest a better line of topic then trying to discuss other people preferring an ide you do not like
I'm not going to argue to anyone, chill
Maybe I didn't formulated the right sentence
I am chill. Just pointing out talking about other peoples preferences is dumb. If instead you wanted to talk about the differences between the ides and not why someone would prefer one over the other that would be different.
I don't think saying I don't prefer Eclipse make me bad to others who use it
If I was here to speak about others business, I wouldn't be here
Then dont ask us to comment on opinions of unnamed people for using something you dont prefer. There isnt anything to discuss there.
The question itself was pointing on the IDE not on the people them self, but it doesn't matter chill
Then word your statements or questions better
And not sure why you keep assuming i am upset by telling me to chill. If you dont like being called out on something in a public space then dont make comments or statements in a public space.
Did you work it out
no
If you are going to make a new project. Make sure you make a maven project
I did
Then show us the folder/file structure that you have for the project. Or create a new maven project is it generates the correct folder structure.
I made it with src and everything
uploaded it
but now plugin doesnt work
I done something wrong
Doesn't work how? What does it say? Any errors?
Just send a project folders structure
They probably didnt put the source they downloaded in the directory
That or build or plugin file wrong or something similar.
wym
Do you know what is like a folder tree
Like the one you see in the left top corner
Expand the src folder.
Ok, open the src folder
Okay, that's a start. It should atleast build and load. What does it say when you try?
Ok, listen, you have to take your old src folder (starting from com.spawmersgui and drop into the new com.spawnersgui folder)
It works
wyn
It works but when I upload to my server
the code isnt working
The problem is that nocode is in there
Isn't working how? Did you copy the src files from the one you downloaded.
So you have to copy your old one
You can't just say "isn't working" that is useless
I dont got a old one
The one you've decompiled
You do
All .java files are the classes
Go on com
ok
Show us what's in the com folder
I'm at school actually
Double click
Double click
Ok ctrl + a
All that stuff, add it to the src\com.spawnergui folder
And drop it in your new com.spawnersgui folder in intellij
Then make sure you update the plugin.yml and pom.xml with the new main class
Let's make him take his time
It may be best if both are not trying to help with the same thing to avoid confusing them further
how do you make a clickable text message
You'd need to use a component
which component
and where do i access that
TextComponent can do it if I remember correctly. Haven't played with components for a while
wont let me
uh
i can't find TextComponent in Spigot-API
OK odne
done
net.md_5.bungee.api.chat.TextComponent
oh so its
bundled by spigot-api?
Yes
ah
?jd
?jd-bc
?jd-bcc
wait what's te difference between bungeecord chat and bungeecord
bungeecord chat is specifically for chat
bungeecord is only for bungee but bungee chat is just for chat so is bundled by spigot
but it seems like they're using the same import
this is the import net.md_5.bungee.api.chat
BungeeCord-Chat 1.16-R0.4 API
is this the right api
it says 1.16 e
wdym 1.16 e?
Can anyone help
It says 1.16 but that's fine
Yes if you want 1.16 this is the right api
It should be included in your spigot api dependency
The home of Spigot a high performance, no lag customized CraftBukkit Minecraft server API, and BungeeCord, the cloud server proxy.
Now read this ^^
Oh cool I didn't know that guide existed
but i have Spigot 1.19
alright ill check that out
Again it's fine. Just ignore the javadoc version
That sould be exactly what your looking for@astral pilot
So what's the problem
from here
Where is the rest of the folder name. You had com.spawnersgui now it's just com
You need to put it in the spawnersgui folder
commands, data, events, plugin, util and ESpawners.java need to be in the spawnersgui folder.
^^
All that was in the old src has to been moved on the new src, in your case commands, data, events, plugins, util and Espawners.java is all you need from the old src
Then just move it on src/main/java/com/spawnersgui, here you have putted all in the com folder not in the spawnersgui
Yep
...
Well, you don't need a new folder to upload it to. Just upload it directly to com.spawnergui
bruh
Just take the old stuff and move it in the com.spawnersgui
Yeah last time u told me to do that I did it wrong
I did that here
'cause you made it in the com folder
so tf I do then
Not in the com.spawnersfui
dude it's not hard
Double click
Again
Ok stop here
Yes
Yes
Yes
Y
ok done
Change your main class to ESpawners
name: SpawnerGUI
version: '${project.version}'
main: com.espawners.ESpawners
api-version: 1.18
Ok, now go on your pom
okie
<groupId>com</groupId>
<artifactId>ESpawners</artifactId>
<version>1.0</version>
<packaging>jar</packaging>
<name>ESpawners</name>
?paste Paste it here
is it possible to make a new line message in ComponentBuilder
if so how do you do it
wdym like create a new lime?
Does /n not work?
Try to run it
idk haven't tried
try it
\n*
my b
Which version of Java are you using?
idk
In theory, you are using an older version of Java, to fix this you should just click on the context action where it flags you the error, and click to upgrade to jdk 16
jdk 17*
They are wanting 1.18 though, so need 17
Can't run using 16?
Never tried it
Nope 1.18 was built with 17
how I do that
Go on project structure
where that
Left
Top Left: File > Project Structure
⬅️
try changing sdk default to 17 maybe?
The pom has 1.8 selected
oh right
how I fix it
@quaint mantle change the 1.8 in the pom to 17
Yep
yep
package net.milkbowl.vault.chat does not exist
@jagged monolith can you find it for me? I'm at school xd
I got it
<repositories>
<repository>
<id>jitpack.io</id>
<url>https://jitpack.io</url>
</repository>
</repositories>
<dependencies>
<dependency>
<groupId>com.github.MilkBowl</groupId>
<artifactId>VaultAPI</artifactId>
<version>1.7</version>
<scope>provided</scope>
</dependency>
</dependencies>
It is another dependency
<dependency>
<groupId>com.github.brcdev-minecraft</groupId>
<artifactId>shopgui-api</artifactId>
<version>3.0.0</version>
<scope>provided</scope>
</dependency>
[INFO] Scanning for projects...
[INFO]
[INFO] ---------------------------< com:SpawnerGUI >---------------------------
[INFO] Building SpawnerGUI 1.0
[INFO] --------------------------------[ jar ]---------------------------------
[WARNING] The POM for com.github.brcdev-minecraft:shopgui-api:jar:latest is missing, no dependency information available
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 0.374 s
[INFO] Finished at: 2023-05-10T08:42:27+01:00
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal on project SpawnerGUI: Could not resolve dependencies for project com:SpawnerGUI:jar:1.0: com.github.brcdev-minecraft:shopgui-api:jar:latest was not found in https://repo.papermc.io/repository/maven-public/ during a previous attempt. This failure was cached in the local repository and resolution is not reattempted until the update interval of papermc-repo has elapsed or updates are forced -> [Help 1]
[ERROR]
[ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch.
[ERROR] Re-run Maven using the -X switch to enable full debug logging.
[ERROR]
[ERROR] For more information about the errors and possible solutions, please read the following articles:
[ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/DependencyResolutionException
Process finished with exit code 1
I added
<dependency>
<groupId>com.github.brcdev-minecraft</groupId>
<artifactId>shopgui-api</artifactId>
<version>latest</version>
<scope>provided</scope>
</dependency>
Show where you added it
ok it worked
next
patterns in switch statements are a preview feature and are disabled by default.
Send your pom
Update your language level in the project structure or change the switch statements
Where is it flagging?
17
Change the lanugage level
set it to "X" iirc to use preview features
or well, one of the options should say preview :p
i think its too simple
Nah, it's cleaner and more modern. I like it.
yo it says HoverEvent is deprecated, what should I use instead?
?jd-bcc
It's only depreciated for public HoverEvent(HoverEvent.Action action, BaseComponent[] value)
It wants you to use net.md_5.bungee.api.chat.hover.content
Instead of BaseComponent[]
ah
You probably just want text
There any good guides out there for javadocs in intelij?
I've mucked around with the doc comments and the tool in inteli ultimate.
But I'm struggling to figure out how to make an overview page for the whole documentation (like the main screen of the spigot docs).
I'm very much someone who enjoys having a complete project so if anyone could send me in the right direction to add more detailed javadoc functionality that'd be grand.
Tried finding guides but there doesn't seem to be much that links general practice with the intelij tools :S
Already looked at it.
Unless I'm blind it gives little to no help on how to make overview pages for a whole project.
In a dream I found a javadoc for nms
wow never heard it
What do you mean, javadocs in the classes using comments or explanation of the methods?
No I mean I generate a whole project but there is no "overview" page.
That's like "this is the docs for the plugin, here are all the packages"
package index
This^
Yeah thats exactly what I'm asking chief ^_^
Cheers for the help either way
weird
why is the events getting
registered on the other text too
Text1: [Button1]
Text2: [Button2]
^^^^^
Button1 ClickEvent and HoverEvent gets called here
why is that
Send your code
BaseComponent[] repoButton = new ComponentBuilder("[Click Here]\n").bold(true).color(net.md_5.bungee.api.ChatColor.GREEN)
.event(new ClickEvent(ClickEvent.Action.OPEN_URL, "https://test.com/"))
.event(new HoverEvent(HoverEvent.Action.SHOW_TEXT, new Text("Visit the repo"))).create();
BaseComponent[] helpButton = new ComponentBuilder("[Click Here]\n").bold(true).color(net.md_5.bungee.api.ChatColor.GREEN)
.event(new ClickEvent(ClickEvent.Action.OPEN_URL, "https://google.com/"))
.event(new HoverEvent(HoverEvent.Action.SHOW_TEXT, new Text("View Help"))).create();
BaseComponent[] messageComponent = new ComponentBuilder("\n")
.append("Repository: ").color(net.md_5.bungee.api.ChatColor.BLUE).bold(true).append(repoButton)
.append("Commands: ").color(net.md_5.bungee.api.ChatColor.BLUE).bold(true).append(helpButton)
.append("").create();
@unkempt peak
Hello, how can I generate worldedit schematics in new chunks ?
Your saying the click event for repoButton is being called for helpButton?
no its being called on .append("Commands: )
like when you hover on Commands: text
it calls the repoButton()
soo @unkempt peak
I don't want to change the default world generation, I just want to add a structure
1sec I'm going to debug your code
I'm not sure what is happening
@astral pilotcan you send the rest of your code?
BaseComponent[] repoButton = new ComponentBuilder("[Click Here]\n").bold(true).color(net.md_5.bungee.api.ChatColor.GREEN)
.event(new ClickEvent(ClickEvent.Action.OPEN_URL, "https://github.com/FlamingH0rse/OptimisedHoppers"))
.event(new HoverEvent(HoverEvent.Action.SHOW_TEXT, new Text("Visit the repo"))).create();
BaseComponent[] helpButton = new ComponentBuilder("[Click Here]\n").bold(true).color(net.md_5.bungee.api.ChatColor.GREEN)
.event(new ClickEvent(ClickEvent.Action.OPEN_URL, "https://github.com/FlamingH0rse/OptimisedHoppers"))
.event(new HoverEvent(HoverEvent.Action.SHOW_TEXT, new Text("View Help"))).create();
BaseComponent[] messageComponent = new ComponentBuilder("\n")
.append("OptimisedHoppers\n").color(net.md_5.bungee.api.ChatColor.AQUA).bold(true)
.append(" \n")
.append("An open-source plugin that aims at optimising\n").color(net.md_5.bungee.api.ChatColor.GOLD).bold(false)
.append("item movements by hoppers on Minecraft\n").color(net.md_5.bungee.api.ChatColor.GOLD).bold(false)
.append("servers\n").color(net.md_5.bungee.api.ChatColor.GOLD).bold(false)
.append(" \n")
.append("Repository: ").color(net.md_5.bungee.api.ChatColor.BLUE).bold(true).append(repoButton)
.append("Commands: ").color(net.md_5.bungee.api.ChatColor.BLUE).bold(true).append(helpButton)
.append("").create();
p.spigot().sendMessage(messageComponent);
aight i sent the whole thing @unkempt peak
basically Commands: shouldn't have any events associated with it
ive made a plugin where you can import particle effects from blender and everything works great, but is there a way to spawn more than 16k particles (preferably with as little lagg as possible) or is that the max amount no matter what you do
You can spawn as many as you want. However to do it without lag on the server side you need to utilize packets. Client may lag though
The API just sends packets
So you don't need to use them directly
but yeah the client will lag
Well they are entities so the api registers them with the server and thus the lag from server is the server keeping track of them
particles aren't entities
nor does it need to keep track of them
btw i fixed it
.append("Commands: ").event((ClickEvent) null).event((HoverEvent) null)
adding null to it fixed it
huh
That is strange
I have no idea why the event was applied like that but yeah that works. for some reason the events seem to apply to all text until a new event is added.
Block block = world.getBlockAt(x, y, z);
if (block instanceof Directional directionalBlock)
Bukkit.broadcastMessage("test");
The block is a Stairs block, which extends Directional, so why does this not print "test"?
yea
Anyone here knows how to use ChatPaginator
Because Directional and Stairs is BlockData
block.getBlockData() instanceof ... etc
?ask
If you have a question, please just ask it. Don't look for staff or topic experts. Don't ask to ask or ask if people are awake or available. Just ask the question to the channel straight out, and wait patiently for a reply. Make sure you use the right channel regarding the topic of your question. Create a thread in case the channel is already in use!
What is ChatPaginator actually for?
I've noticed BlockFace has values like EAST_NORTH_EAST and EAST_SOUTH_EAST, what blocks use them?
The ChatPaginator takes a raw string of arbitrary length and breaks it down into an array of strings appropriate for displaying on the Minecraft player console.
From the javadoc
Skulls
i meant the paginate..
it says "returns a ChatPage"
what can I do with the ChatPage
Well you can send the lines to a player or whatever really
It's a util class for pagination
idk how to use it and the docs doesn't seem to give much info to it
how
int pagenumber = 1;
String testString = "awoipef";
ChatPaginator.ChatPage page = ChatPaginator.paginate(testString, pagenumber);
System.out.println(page);
declaration: package: org.bukkit.util, class: ChatPaginator, class: ChatPage
I checked that
i know it returns "ChatPage"
but what can I do with that "ChatPage"
Read the link I sent
I did.
then you have the answer to your question
huh?
No i don't
it doesn't say how do I send that in chat
nor how to change page
it says it automatically sets the page
but when setting strings that has a lot of characters
it gives ArrayOutOfBoundsException
It gives an array of strings
You loop and send
Which page is set in the paginate method
wait loop?
I thought it gives a page
like there would be page 1 page 2 whatsoever
and the page contains lines
You probably didn't read the link I sent
Even though I told you to
I did?
i went to the docs first
before asking here
so there's no changePage() or something like that?
No
Is there a way to show citizen(or entity) for only specific player?
Umm.. Is it impossible to do that with player.show() method?
maybe I was confused with showing / hiding player lol
I tried to learn nms and using packet. It was always so hard 😦
Does anyone know how I can adapt the following code for 1.19? There is no inventory.getName() anymore. https://prnt.sc/zOjr4HNljmuF
.getTitle() maybe?
Oh I've just seen the photo
I'm here to ask a quick question, I know it's not entirely on the spigot topic yet it's still about minecraft and I have nowhere else to ask, So feel free to remove it if it's not appropiate.
I'm currently trying to make a Minecraft server from scratch, I almost have the entire login sequence, There's just one thing that confuses me, in the login packet in the vanilla protocol it expects a UUID, Which given responds with a error refering to a too long buffer size, Even though the string is within the limits, Anyone have any idea what it could be ( It is encrypted in AES CFB ) and I verified that it works, As I can send the disconnect packet with text 🙂
You need to get the view
Also why are you writing code like that
Hello, I received your ping.
It's surely related to the emotes feature.
Disable it in config.yml and run /iazip to regenerate your pack.
There is probably no way to fix that other than disabling emotes.
Anyway I doubt this channel is the correct one since it's called "help-development". Next time please ask on my Discord server or on my forum.
Did you check if uuid was set?
The uuid has not been set yet, I'm currently attempting to set it myself upon the login packet.
Yes it expects a Guid right? ( Globally unique identifier )
Yes but not the string
Does it expect raw bytes? instead of a prefixed string?
Ah, Minecrafts special Shahash?
There is 128bits to represent a uuid
Turn those 128bits into a long
There is no hashing required
So if I understand it correctly, You're saying I'd need a buffer with the size of a 128bit container and turn that container back into bytes? 🤔
Ah, I think I get it, This way you'd get unique numbers whilst still working with numbers to ensure people can't guess them x)
You are really over thinking this
That tends to be my downfall x)
Thank you for your patience with me so far though, I appreciate it
Anyways driving home now. Will have to wait for someone else to jump in to help.
👍🏿 Have a good day, once again thank you for the pointers I have things to try again 🙂
Thank to your explanation I just solved it!
Wooo! 
I don't know if it's common to post the solution, But I'll post it here
in C# you can use something called a big integer to handle all kinds of magical operations
BigInteger integer = new BigInteger(new byte[]{ 1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16}); such as putting a bytes in there of any size to create a buffer which can be interpretted as a integer
This way the next person doesn't have to go through my suffering xD
Yes.
And this is primarily java
Fair you got me there :p once again tyvm I was stuck on this for weeks x)
Np
java has a BigInteger as well
I would like to see a plugin that allows you to design an inventory in game and then convert it to Java code. :9
but how?
wouldn't help a lot since you cannot add functionality ingame which is the most effort. Setting some items in a slot is done in a matter of minutes
event.getView()
there is no view in the inventory.java?
how do you mean?
inventoryclickevent
The designing part isn't a lot of effort.
The on click open another inventory or write something into a config or whatever is
it just bugs me :D
so it no longer works without InventoryClickEvent?
Well it won't get you far with dynamic inventories either
i think helps me a lot especially if you put your own inventory manager in there or something
Having your own inventory api reduces the effort drastically. smile made a guide on it
yes but i just think it would be cool if you could design your inventory directly in the game and then convert it to code. i often have the problem that i mix up the numbers or can't find the item tags.. yk ? :7
well it wouldn't be hard to create a basic version of that. The problem would be the optimization (e.g. looping over slots with the same item instead of setting them one by one)
isnt this already right from the basic stuff? https://prnt.sc/zOjr4HNljmuF
all you need to do is save it in a txt or smth
I would still do it with a decent API for GUIs before creating something like that but yes it looks about right. Might want to add itemMeta with display name and lore aswell
And you can store the inventory in a file on the server on close
yes i was planning to do that :s
best in a txt file
yaap ik
Also why not make it a .java 😄
if i adapt it for an api like this i think its really easy for basic inventories
i hate coding and design inventories in java :D
Birb
Did you reload maven after adding it
You can try to update intellij
You could also disable experimental JDK features
Shouldn't be much reason to use them
how?
However IJ allows you to do that. I don't use it
Also note that your server must be running on the same or newer version as the version of the jar that you compiled
Do you really need the features of these new versions? If you are not making use of them then you may as well just use jdk17
anyone knows how to get a file from a ZipEntry?
// mock code
fun doZipStuff(file: File) {
val zipFile = ZipFile(file)
for (entry in zipFile.entries()) {
if (entry.isDirectory) continue
if (!entry.name.endsWith(".json")) continue
val jsonStuff = doJsonStuff(/* where do I get the file from? */)
}
}
perhaps getting the content of the file would also be sufficient, but I don't know how to do that either
Are you using gson? Then you may also pass a reader to parse it. To create it use new InputStreamReader(is, StandardCharsets.UTF8)
nope, I'm using Configurate, and I think that getting the contents of the file would indeed be sufficient 🙂
i'm not versed in terms of IO at all haha, should step that up at some point. would this read the contents?
zipFile.getInputStream(entry).readAllBytes()
Make sure to close the inputstream:
for (InputStream is = ... ) {
}
This ensures that it is being closed after the bracket
And then you may use is to readAllBytes
shouldn't it be try
Oh, right
ok, ty 🙂
I hope Configurate can read it like this lol
val mainNode = GsonConfigurationLoader.builder()
.lenient(true)
.buildAndLoadString(String(bytes))
Also make sure to pass the charset to the string constructor if you are using an older version of java
Ascii is the default value for older versions
Where's the statistic again for what amount of servers are running certain minecraft versions?
Ah, sure, ty
bStats
thx
?help
selfrole Add or remove a selfrole from yourself.
cleanup Base command for deleting messages.
embedset Commands for toggling embeds on or off.
info Shows info about CafeBabe.
licenseinfo Get info about Red's licenses.
mydata Commands which interact with the data CafeBabe has about...
set Commands for changing CafeBabe's settings.
uptime Shows CafeBabe's uptime.
findcog Find which cog a command comes from.
names Show previous names and nicknames of a member.
userinfo Show information about a member.
listcases List cases for the specified member.
reason Specify a reason for a modlog case.
permissions Command permission management tools.
Can someone help me with EntityDeathEvent ? ^^
?ask
If you have a question, please just ask it. Don't look for staff or topic experts. Don't ask to ask or ask if people are awake or available. Just ask the question to the channel straight out, and wait patiently for a reply. Make sure you use the right channel regarding the topic of your question. Create a thread in case the channel is already in use!
please
If you have a question, please just ask it. Don't look for staff or topic experts. Don't ask to ask or ask if people are awake or available. Just ask the question to the channel straight out, and wait patiently for a reply. Make sure you use the right channel regarding the topic of your question. Create a thread in case the channel is already in use!
i don't know how it works
What would be the logic in creating help command with pages
oh my god
i used ?ask to output this
please open your eyes and read what it says
wow calm
and then follow the advise
this is not the first time you did this
i'm a french guy i'm not sure to understand all i read
you gonna ask or not
Si vous avez une question, n'hésitez pas à la poser. Ne cherchez pas de personnel ou d'experts en la matière. Ne demandez pas à demander ou à savoir si des personnes sont réveillées ou disponibles. Posez simplement votre question au canal concerné et attendez patiemment une réponse. Assurez-vous d'utiliser le bon canal en fonction du sujet de votre question. Créez un fil de discussion au cas où le canal serait déjà utilisé !
Traduit avec www.DeepL.com/Translator (version gratuite)
ty
.
EntityDeathEvent help
It’s hard to answer a programming question without code
Oh no! You ran into a problem. But no worries, people are willing to help, but first they need to see your code. This is because otherwise, they would be providing help based on guesses instead of concrete knowledge. Whether it be a compile error, runtime error, or an unexpected output, I'm sure that if you were to provide code, you'd receive a quick solution.
hi when using the worldedit api to spawn a new schematic, does it take the same amount of time no matter what blocks there are or does it take less time if some of the blocks in the schematic are already there?
context: i want to setup an arena system and spawn the schematic of the arena, but i want to know if its worth it to remember where each arena is placed to just paste some of the blocks of the schematic, or if i should just spawn the new arena X blocks away
You don’t want dots in your package names?
same problem
If you want to make one in the upper package just erase it from the name when you’re making it
But there probably is a way to fix it
But also then you would get separate folders for your base package
That everything is in
I'm not sure about which one you're talking. I mostly just rate resources that I might find useful in the future because I like them. please send the link here, I might find a use for it right now, as I'm working rn
ah, I don't think I need it in my current project unfortunately, but it seems useful for my other project
can you have conditional append in new ComponentBuilder(")
like append something whenever a certain condition is met
yeah I've rated it because I saw that it was quite extensive and intuitive to use
oh nvm i think this can be done by ternary operator
I'll take a deeper look and see if I find anything that could be of use
how do I make ProtocolLib's whitelist listen to all packets?
ok got it:
like so
Set<PacketType> types = new HashSet<>();
for(PacketType type : PacketType.values())
types.add(type);
if I were to nitpick, I'd just outline a couple typos lol
- "get's" -> "gets" (Basic Usage)
- "to" should be in black color for readability (Chaining)
- "there is' -> "there are" (Chaining) (though i think that's valid in spoken english?)
- broken unordered list in PersistentData (see attachment)
- "With" -> "with" (Adding the dependency)
in my opinion typo-less text looks more professional
overall I can't give you any more feedback yet unfortunately, this builder looks like it'd satisfy all my needs xD
i think you just need to delete the list and create it from scratch
for some reason unordered lists just occasionally break
you are using dark mode so it might seem normal to you
1 sec
if I could ask you to return the favor with a readability check that'd be cool haha, but don't worry if you do not want to
Is there any way to calculate moon's phase / current location?
I've got a CONTRIBUTING.md that might be hard to read, so if you want to, I could give you the link and you could just proofread it
same here haha
can you elaborate a bit?
oh, let me explain
if you put it in one sentence:
Contributions that only focus on fixing code style, or only optimize something, or only add unit tests, or only add/remove easter eggs are not welcome.
you did help me notice that the "only" was missing in the last bullet point, I've edited that now
thanks 🙂
Is there some permission event that lets me check if some permission is added to the player?
with vault api or even spigot api?
design question! (API)
I'm refactoring my API and I've noticed that I'm currently using this enum:
public enum EnchantmentLoadResponse {
LOADED,
RELOADED,
NOT_FOUND
}
for a method of
EnchantmentLoadResponse loadEnchantment(String enchantmentName);
on more than one occasion, I've heard that using enum responses is a bad practice and exceptions should be thrown if something has gone wrong, but in this particular case I feel like the usage is fine, as there are 2 valid outcomes (LOADED/RELOADED) and 1 invalid (NOT_FOUND), and the API user might need to know whether the enchantment has been loaded or unloaded (though, honestly, I can't think of a such usecase). should I just make it return void and throw an exception when the enchantment wasn't found, or should I leave it as is?
No, though permissions management plugins really should create a custom event for it so that it can be detected. I'll add that to mine in my upcoming update.
another question, in PluginManager#registerEvent, what is the listener field for, if I'm handling the behavior in the 4th argument lambda?
it's for a class that implements Listener
yeah but like
what's the point of it
manager.registerEvent(trigger.eventClass, object: Listener {}, EventPriority.NORMAL, { _, event ->
// I handle my event here
}, plugin)
the listener object that I provide here is empty. is this valid or am I doing it wrong
i hate exceptions so your enum looks fine to me xD
haha
i hate unwinding the stack
I am trying to allign text, for a scoreboard like idea in chat. but so far i'm coming short. here's my code: https://pastebin.com/3rjZbTuJ the padright function at the bottom is the one that should control the length of spaces to add after a name
Pastebin.com is the number one paste tool since 2002. Pastebin is a website where you can store text online for a set period of time.
are my lengths for every character correct? or is my math off somehow?
the code has set a number till the " : " mark. which i have set to 100, then from the 100 it takes off the length of the name, and fill the remaining space with spaces. except somewhere it doesn't work
and it checks the length of the displayname
maybe the space is only 2
idk just an idea I had
also it will fail when you choose a resource pack with another font
2 for sure not
What you try making?
damn :/ hasn't even thought about that
4?
a scoreboard system. i have a mini game plugin and the idea is to show the top scores in chat with a command, but then with the scores alligned so it looks better
yeah sadly tabs are not a thing so there would probably be no way to space it out equally
😦
I think you need task in onenable
task to do what
Run animation
:/
like a hologram? floating text?
Booths
run what animation
doesn't that meddle with fonts too?
you arent making any sense xD
XD
booths? xD
My brains = 😴😴😴
good morning to you too :p
Are you know how make plugin bungeecord 1.19
idk, never touched bungee, I use spigot
Oof
How come it says it isn't a valid mob? Am I missing something? ```java
public final HashMap<UUID, Integer> spawnedEntityNpcDataMap = new HashMap<>();
public void spawnMob(int id, Location location) {
NpcData npcData = this.main.getNpcManager().getNpcData(id);
if (npcData == null) {
Bukkit.getLogger().info("(!!!) Invalid Npc spawn attempt: " + id);
return;
}
int npcDataId = this.main.getNpcManager().getNpcId(npcData.getName());
this.spawnedEntityNpcDataMap.put(mob.getUniqueId(), npcDataId);
Bukkit.broadcastMessage(mob.getUniqueId() + " has spawned in");
} java
@EventHandler
public void mobDamage(EntityDamageByEntityEvent event) {
if (!(event.getDamager() instanceof Player))
return;
UUID uuid = event.getEntity().getUniqueId();
if (!this.spawnedEntityNpcDataMap.containsKey(uuid)) {
Bukkit.broadcastMessage(uuid + " isn't a valid mob");
return;
}
}```
You try make with citizen plugin?
I am not using the citizens plugin nor am I using any of their APIs
maybe the event gets triggered by another mob?
the 2 broadcast messages are showing up with the same UUIDs
First message is when the mob spawned, second message when I punched the mob
You can find with entity name?
well it doesnt say it spawned in
This might be a hard task, this is what I have for my waypoint system```public class WaypointNamePrompt extends StringPrompt {
private GpsCompass compass = new GpsCompass();
public String getPromptText(ConversationContext content) {
return "Enter Waypoint Name:";
}
public Prompt acceptInput(ConversationContext content, String input) {
Player player = (Player) content.getForWhom();
ItemStack item = player.getInventory().getItemInMainHand(); ItemMeta meta = item.getItemMeta();
if( compass.isItemValid(item) ) {
DataContainer container = new DataContainer(meta); WaypointManager wpManager = new WaypointManager(container.stringGet("Waypoints"),27);
wpManager.add(input, player.getLocation()); container.stringSet("Waypoints",wpManager.toString()); item.setItemMeta(meta);
player.sendRawMessage(ChatColor.GREEN+"Success! "+ChatColor.WHITE+"Waypoint saved as \""+input+"\"");
return END_OF_CONVERSATION;
} else {
player.sendRawMessage(ChatColor.RED+"Error! "+ChatColor.WHITE+"Please switch to your gps compass");
return this;
}
}
}```Now I have a server shop, how do I do this with my server shop as well and get the itemstack of what I click like for a example "ShopGUI+". That plugin uses GUI either than prompts
since the entitydamagebyentityevent extends entitydamageevent, if you get an entitydamageevent which was caused by an entity can you just cast it across?
code changed
print the map when ou handle the event
are you using nms?
yeah then you cant use the anvil inventory like that
yes or use someone elses plugin
print the whole map when you are handling the event, maybe its not in there
@last temple Copy my code if you trying to get user input, that is the only way to go without NMS. But make sure to edit the code after you insert it into your source code
There
Got the wrong message
But that is the right one containing the code
first line is when it spawned in, second line is the entire map printed out, third line is when I hit the mob.
It does exist inside of it, so I don't get why it can't find it.
after the npc was spawned in. I just tried prnting it before the NPC got damaged and now the map is printing out as empty.
yeah just as I thought
I try to avoid NMS if possible. We should not bypass the API when there is no reason to. Like for a example, NMS is required to create NPCs, read anvil inventories. But don't be scared to use it, its not like the registry on Windows where one value change, the os breaks
how many of these objects do you have
like what class is this in
same
thats why I use other peoples stuff xD
It's in a NpcEvents class. This is the only variable being utilized java public final HashMap<UUID, Integer> spawnedEntityNpcDataMap = new HashMap<>();
I'll post code to a site hold on
and where do you make the NpcEvents class
maybe there are multiple
with their own maps
try printing stuff after the check
only one found in the entire project (includes libraries)
you are right omg, there are multiple instances 😂
Just know if you use NMS and the server is 1.16 for a example, it cannot work on newer versions. That is one of the reasons I say to avoid it
you cracked the case lol
lmao
Thank you hahaha
yeah but like I said, I just use other peoples stuff
and rn I am only using 1 dependency that uses nms
which is AnvilGUI
im confident it will be updated quickly after a new version comes out
You right, same with Vault. APIs are useful for things like this
anyways, is it possible to instantiate a Player object myself?
What you mean? In a for loop?
no
I just want to make a fake player
I dont care about them actually being an entity
just a player object
A bot I see, or NPC. I don't know how, I looked at the NPC one point but I did not go deep into it
no not an NPC
I just need to pretend like I am using players since then I can easily test some stuff
instead of making my own fake player objects
would be much faster to just use the existing Player
Like this? https://dev.bukkit.org/projects/fake-players
I don't know how its done
There might be a source code somewhere that you can look at
or actually not like that
how to find out in which direction the player turned his head?
why do you need this
necessary)
for what
the best you can probably do is get their look direction and compare that to some previous one you saved
never make collections public
Okay noted. Curious though. Is that for efficiency reasons or formatting?
code style
Cool cool
you should write methods that interact with your collection instead of exposing it to the outside world and let them do whatever they want with it
At the moment I use dependency injection throughout my codebase to ensure there aren't open collections
Forgot to make this one private or rather didn't think it'd make a difference
it's changed now 😄
uhh probably want some manager class for that collection, thinking about scalability
but ye not too bad to do it with di
What is the vaild ConversationContext types? I trying to use only number for this shop I making
wdym the valid conversationcontext types?
I was thinking NumericPrompt, don't know how to use it. Looking at the docs as we speak
well I never used the conversation stuff since I didnt know it existed
but numeric prompt sounds like the thing you want to use
You right, its something I want to use, still looking at it
UGH
Still getting this damn error despite entirely deleting my .m2, running BuildTools 1.18.2, and cutting everything else out from the plugin:
[13:37:43 ERROR]: Error occurred while enabling untitled123233 v1.0-SNAPSHOT (Is it up to date?)
java.lang.NoSuchMethodError: 'net.minecraft.world.level.block.state.BlockState net.minecraft.world.level.block.Block.stateById(int)'
at org.example23132.untitled123233.Untitled123233.onEnable(Untitled123233.java:12) ~[testingaesopian.jar:?]
at org.bukkit.plugin.java.JavaPlugin.setEnabled(JavaPlugin.java:264) ~[paper-api-1.18.2-R0.1-SNAPSHOT.jar:?]
at org.bukkit.plugin.java.JavaPluginLoader.enablePlugin(JavaPluginLoader.java:370) ~[paper-api-1.18.2-R0.1-SNAPSHOT.jar:?]
at org.bukkit.plugin.SimplePluginManager.enablePlugin(SimplePluginManager.java:541) ~[paper-api-1.18.2-R0.1-SNAPSHOT.jar:?]
at org.bukkit.craftbukkit.v1_18_R2.CraftServer.enablePlugin(CraftServer.java:560) ~[paper-1.18.2.jar:git-Paper-388]
at org.bukkit.craftbukkit.v1_18_R2.CraftServer.enablePlugins(CraftServer.java:474) ~[paper-1.18.2.jar:git-Paper-388]
at net.minecraft.server.MinecraftServer.loadWorld0(MinecraftServer.java:665) ~[paper-1.18.2.jar:git-Paper-388]
at net.minecraft.server.MinecraftServer.loadLevel(MinecraftServer.java:432) ~[paper-1.18.2.jar:git-Paper-388]
at net.minecraft.server.dedicated.DedicatedServer.initServer(DedicatedServer.java:316) ~[paper-1.18.2.jar:git-Paper-388]
at net.minecraft.server.MinecraftServer.runServer(MinecraftServer.java:1164) ~[paper-1.18.2.jar:git-Paper-388]
at net.minecraft.server.MinecraftServer.lambda$spin$0(MinecraftServer.java:316) ~[paper-1.18.2.jar:git-Paper-388]
at java.lang.Thread.run(Thread.java:833) ~[?:?]
Here's the plugin's only class:
public final class Untitled123233 extends JavaPlugin {
@Override
public void onEnable() {
// Plugin startup logic
Bukkit.getConsoleSender().sendMessage("Initializing.");
net.minecraft.world.level.block.Block.stateById(5);
}
@Override
public void onDisable() {
// Plugin shutdown logic
}
}
That was not working, using StringPrompt and throwing this in. https://www.baeldung.com/java-check-string-number
Here's the Pom
https://paste.md-5.net/uvaxawedoz.xml
java.lang.NoSuchMethodError means that specific method doesn't exist in on the server you are using.
Also
?paste your text walls
@kind hatch I mean, that method SHOULD exist, however, that's the issue.
Well, there's a few things you could try.
- Use the latest version of the
maven-shade-plugin(3.4.1) - Remove the
paper-apidependency as it could be interfering. - Remove the configuration goal to
createDependencyReducedPomas false is already the default.
Made all those changes, the error remains.
Do I need to run the manual commands somewhere?
At the bottom of the Spigot forum post; these ->
java -cp $HOME/.m2/repository/net/md-5/SpecialSource/1.11.0/SpecialSource-1.11.0-shaded.jar:$HOME/.m2/repository/org/spigotmc/spigot/1.18-R0.1-SNAPSHOT/spigot-1.18-R0.1-SNAPSHOT-remapped-mojang.jar net.md_5.specialsource.SpecialSource --live -i $PLUGIN.jar -o $PLUGIN-obf.jar -m $HOME/.m2/repository/org/spigotmc/minecraft-server/1.18-R0.1-SNAPSHOT/minecraft-server-1.18-R0.1-SNAPSHOT-maps-mojang.txt --reverse
java -cp $HOME/.m2/repository/net/md-5/SpecialSource/1.11.0/SpecialSource-1.11.0-shaded.jar:$HOME/.m2/repository/org/spigotmc/spigot/1.18-R0.1-SNAPSHOT/spigot-1.18-R0.1-SNAPSHOT-remapped-obf.jar net.md_5.specialsource.SpecialSource --live -i $PLUGIN-obf.jar -o $PLUGIN.jar -m $HOME/.m2/repository/org/spigotmc/minecraft-server/1.18-R0.1-SNAPSHOT/minecraft-server-1.18-R0.1-SNAPSHOT-maps-spigot.csrg
You shouldn't have to. How are you compiling it currently?
I go to the top of Intellij, click build => build project
Well there's your mistake.
You have to use the maven tab.
It's on the right side. You select your module, go to lifecycle and then double click package
Or if you have default goals setup, you can just click that run button
ah, for the last three years i've only ever used build project lol
Yeaa, it seems to be a common mistake. I think it's just due to poor teaching as most tutorials still do everything the old way instead of teaching how to use a dependency management tool.
Quick question, which of these are my actual plugin, though?
original-untitled123233-1.0-SNAPSHOT
untitled123233-1.0-SNAPSHOT
untitled123233-1.0-SNAPSHOT-remapped
untitled123233-1.0-SNAPSHOT-remapped-obf
The 2nd one
One without a -
You sure? Must be a custom setting I have mine always been the normal jar
He listed 4, the first one started with original-
Oh I thought that was the folder name lol
FINALLY
GOD DAMN
[13:57:38 INFO]: Preparing start region for dimension minecraft:the_nether
[13:57:38 INFO]: Time elapsed: 40 ms
[13:57:38 INFO]: Preparing start region for dimension minecraft:the_end
[13:57:38 INFO]: Time elapsed: 38 ms
[13:57:38 INFO]: Enabling untitled123233 v1.0-SNAPSHOT
[13:57:38 INFO]: Initializing.
[13:57:38 INFO]: Running delayed init tasks
[13:57:38 INFO]: Done (2.224s)! For help, type "help"
[13:57:38 INFO]: Timings Reset
No error
sweet
thanks
is there some way i can upvote you for helping
Probably not on discord. Maybe on the forums, but I hardly use those anymore. I'm just a lurker there now. :3
i wonder if md would add another bot to cafebabe that aded reputation
+rep helped me with codez
yeayh
-rep mean and smelly :c
the -rep would be a w eird one
bc you could just get all ur friends to -rep someone bc you dont like them
Yea, rep systems are easily abused. I think that's part of the reason why there are no negative emotes on the forums.
Although that doesn't stop people from using them sarcastically.
Like the optimism one.
it would prob end up at +rep with either a 5 min global delay per person, or a 5 min delay for 1 person to rep that person again
Does BlockExplodeEvent | EntityExplodeEvent get fired from a .createExplosion() method in World interface?
my plugin somehow stopped working from this morning xd
Peobably not
But try it and see
Idk cuz neither a TNT fires that
and yesterday it was working somehow
same loaded plugin
TNT should fire EntityExplodeEvent
Shouldn't be fired BlockExplode as well?
No TNT becomes an entity before it explodes
Yeah I know that, but I never used EntityExplode since Block works fine
idk at this point
You should be using both
Actually I do
I tried debbuging to figure it out and none of them gets fired
I even tried listening TNTPrimeEvent in paper starting from 1.14
i need to do this.
i am using playerMoveEvent for that
createExplosion should fire the block explode event
It does. It was working fine until today
but it doesn't work correctly
why does it not work correctly
I understand what you mean now. IntelliJ is so bad. I can not set my jdk to the wsl one because everytime I select it intelliJ freezes. I hate it.
Try running Intellij from WSL if you aren't already
You can run it from CLI
vertical movement seems to work fine
but how do I connect to it? with gateway I suppose
yes, but if you turn the camera to the other side of the world, it works differently
Why are you trying to run intellij from 1) the command line and 2) through WSL?
So they can use their WSL JDK
I need a wheel. 1,2,3,4,5,6,7,8. But, the problem is probably in the negative values. Idk what to do
i do
Then what's the issue?
....
I don't have full context here.
Personally I would just not use the JDK from WSL
I just saw WSL and started asking questions.
maven needs it
Maven can use your local one.
Just don't run maven from WSL then
If you like bash you can always install git bash
You can configure it to whatever you want. I'd recommend you switch it to local though.
There's overhead when communicating between Windows and WSL
^
?xy be like
Asking about your attempted solution rather than your actual problem
Can't you transfer files from WSL to your main OS?
You can
Or is that not a thing?
lol
Yea, so I don't see the issue here.
If you transfer your project files to Windows, and run everything locally, there shouldn't be that big a deal.
patches are applied faster on linux. Thats why i have to use wsl. Its recommended to have the project on wsl. Why do you just not accept that I would love to use my local stuff but I have to use wsl in order for it to work properly.
there would
and you cant just run the apply patches on linux but have ij open on windows because?
It's not that I don't understand that, but usually development environments are all local. It's just a weird setup you have going on.
Truth be told, I don't even know that much about WSL because I just run linux myself. Although I can tell you if passthrough is allowed then you should be able to get things working provided you just point everything to the right location.
just have the entire project on windows and just run the apply patches in that dir from wsl
