#help-development
1 messages · Page 510 of 1
Azure have a kubernetes container pay-per-use. It seems nice
Mye
If I check if an item is a "Splash_potion" will it return true for any kind of splash potion?
Material yes
can I somehow stop some Worlds from ticking until I want them to?
To save resources
Don’t load them
well I don't want to block the main thread when I want them to load
GuiManager created and functional, it was the 3 events. Issue Resolved
@slim wigeon could just have done this
Was that you that sent that Gui Thread?
Nop
Also, there is no ignoreCancelled = true in the handler. I just made a GuiManager and that fixed my issue
As shown here // Guis getServer().getPluginManager().registerEvents(new GuiManager(Arrays.asList( new InterfaceGui(), new GroupGui(), new PurchaseGui(), new SellGui() )), this);
There is
In that GuiManager```public class GuiManager implements Listener {
private List<AbstractGui> guis = new ArrayList<AbstractGui>();
public GuiManager(List<AbstractGui> guis) { this.guis = guis; }
@EventHandler
public void onInventoryClick(InventoryClickEvent event) {
Player player = (Player) event.getWhoClicked(); InventoryView invView = player.getOpenInventory();
for(AbstractGui gui : this.guis) {
if( invView.getTitle().equals(gui.getDisplayName()) ) { gui.onClick(event); return; }
}
}
}```
That is not possible by my current setup
Look at the source code and you see why
But don't think I will fix it if it was a chest that people have in inventories. I got a system that checks metadata anyway so I could not run into that issue
From ItemMagnet source code public boolean isItemValid(ItemStack item) { ItemMeta meta = item.getItemMeta(); DataContainer container = new DataContainer(meta); if( item.getType().equals(Material.NETHER_STAR) ) { if( container.isSet("itemID") ) { return container.stringGet("itemID").equals("itemMagnet"); } } return false; }
It’s still flawed
Yeah we came to that conclusion earlier, I updated it a bit further down
I know how to program, its just sometimes I need help. But soon as I heard someone say something about the 3 events, I instantly knew I needed a manager for the Guis. I have used Java to make a IRC bot using PircBot, that is when I first touched Java on the programming lang
Does someone know how to send titles on bungeecord?
I have absolutely zero use for this, this is purely out of curiosity
Is it possible to inject additional instances/values into an enum
You can intercept the loading of an enum and add stuff to it
But a plugin wouldn't be able to do that
how can i cut strings like that?:
example: hello %everybody%, my name is jack
to: hello %everybody% , my name is jack
by isolating %everybody% from the string?
Regex if you want to detect all placeholders. Otherwise you can just use replace if you want to replace that with a value
You can even make your app die due to the GC being an absolute idiot
no
i am using components
i want to put a clickevent on %everybody% and attach it to the message
Then you should have stated that in your first message
or just tell me how its done in components
I told you it's difficult to expose in Bukkit sanely 😛
I am quickly losing faith in humanity, more so than I thought possible
people playtesting my tower defense game can't figure out how to make a maze and maximize damage
I guess I really need to make a tutorial level that is just extremely easy because people are giving up on wave 7 when the softcap is 100 and the highscore would probably be in the 150s
how can fix cannot access xyzClass
Make it public? ;p
if its public and ur using ij clear caches and restart
Or if you didn't import the dependency do that
nvw content of my class got deleted idk why
Well you're definitely in the wrong place because this is Spigot ;p
You know write mods?
I have a mod running, I have a plugin running. Models are not visible on the client when logging in to the server
You can’t see the models on the client
Help?
No magma
We have no knowledge of Magma or how it works
I was wrong
It’s good, but it doesn’t see the model
How do I get the item default name like how ShopGUI+ works?``` if( event.getRawSlot() == 52 ) {
if( this.plugin.economy.has(player, price) ) {
this.plugin.economy.withdrawPlayer(player, price);
player.getInventory().addItem(new ItemStack(item.getType(),item.getAmount()));
player.sendMessage(String.join(" ", Arrays.asList(
ChatColor.GREEN+"Success! "+ChatColor.WHITE+"You have purchased "+meta.getLocalizedName()+" x"+item.getAmount(),
"for "+ChatColor.GREEN+"$"+price
)));
} else {
player.sendMessage(String.join(" ", Arrays.asList(
ChatColor.RED+"Error! "+ChatColor.WHITE+"You don't have "+ChatColor.GREEN+"$"+price+ChatColor.WHITE+" to purchase",
item.getType().toString()+" x"+item.getAmount()
)));
}
player.closeInventory(); return;
}```https://www.spigotmc.org/resources/shopgui-1-8-1-19.6515/
toString the type and format it
no
I was trying to think what I did for Factorio``` function func.itemTable(name,width,height,column_count)
if not height then height = 250; end
if not column_count then column_count = 2; end
local win = guiElem.add({type = "frame", style = 'inside_shallow_frame'}).add({type = "scroll-pane"})
win.style.width = width; win.style.height = height; win.style.padding = 4; local func = {}
local elem = win.add({type = "table", name = name, column_count = column_count})
function func.add(name)
local item = elem.add({
type = "sprite-button", style = "tool_button", sprite = "item/" .. name,
tooltip = game.item_prototypes[name].localised_name
})
local style = elem.style; style.width = 40; style.height = 40; style.padding = 0
end
return func
end```But I don't know, .localised_name must not be on MineCraft for some strange reason. I trying to avoid NMS if possible
Who helped me?
tf you mean no
no
@remote swallow please help my
Please wait 4 before sending another message /who fixed ?
I know that exists but as you notice, that code is Lua and we working with Java here. These 2 programming langs are not the same
what
I know it does, I used that multiple times. When I had a issue with my shop, I used it to send 3 class files
privat ?
Its not related to SpigotMC, that was something I should ask on a Factorio dev server. But the reason I sent that is so you see what I trying to do. I just trying to complete my shop. Adding shops without purchasing anything is my goal or anything in that case as I banned from Paypal
and the paste site isnt only spigot mc related, not even on the spigotmc.org domain
I know its owned by md_5
It's not fork
While I play Huuuge Casino and talking here, I could have got the name of a item working which I asked for help about. No NMS
Default item name is Nether Star for a example
I want to get that text
Type of plugin I making https://www.spigotmc.org/resources/shopgui-1-8-1-19.6515/
Console outputSuccess! You have purchased x1 for $20Item Material Glass
How to add an item to the inventory, in some range?
If the range is continuous
Just loop over the slot numbers
for (int slot = 4; slot <= 9; slot++) { setItem }
No, I'm not talking about random. I need to add an item to one of these slots using the addItem() method
addItem() adds an item to the first free slot.
and before that I have empty slots, I need to ignore them
setItem
setItem() doesn't work for me either, because it doesn't update the number of items that are already there.
get the current stack (if any) and add to the count
brother just loop
Hey i have this problem with HikariCP and java 8 and spigot 1.9 or 1.10, but in bungeecord the same thing work, but spigot won't
Try updating the MySQL driver
How ?
Shade and relocate a new version in your jar
That doesn't show shading nor relocation
i don't understand x)
i don't use maven on intellij
Gradle then?
._.
can you help me i'm lost
How did you even get HikariCP on to the server 💀
some other plugin shading it probs
can i screenshare to you ?
Regardless, that (probably) won't work. You need to use some kind of build tool. We recommend using maven or gradle
Using maven is the safest bet as it has the best documentation
Go look up maven tutorials
what i have to put in groupId
convention is to use the reverse domain - or email if you don't have that
(Reverse email being something like com.gmail.minecraftplayer27 for minecraftplayer27@gmail.com)
okay and now i need to reimport spigot with Maven ?
Yes
spigot isn't on maven central
?maven
The home of Spigot a high performance, no lag customized CraftBukkit Minecraft server API, and BungeeCord, the cloud server proxy.
mavenmaven
Depend on new version of driver
then shade and relocate
and tell Hikari to use new driver
idk what that mean
.
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-shade-plugin</artifactId>
<version>3.2.4</version>
<configuration>
<relocations>
<relocation>
<pattern>com.mysql.jdbc</pattern>
<shadedPattern>mysql-connector-java</shadedPattern>
</relocation>
</relocations>
</configuration>
<executions>
<execution>
<phase>package</phase>
<goals>
<goal>shade</goal>
</goals>
</execution>
</executions>
</plugin>
</plugins>
</build>```
it's good ?
how i do that
change the shadedPattern
yes but idk what to put in
com.gmail.minecraftplayer27.mysqlconnector
the plugin is not detected by the server ?
are the source and resource files in src/main/java and src/main/resources appropriately?
ok it's now detected, but error onEnable
and what is that certain error?
null with protocol lib implementation
i added protocol lib with maven
but doesn't work like previously even it's the same version
ok, everything fixed but not the mysql error 😢
bro ?
?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.
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.
Meh, this is a plain case of there not being a sufficent pool of people that have knowledge in the particular topic
Everything work just needed this... hikariConfig.setDriverClassName("com.mysql.cj.jdbc.Driver");
which topic?
java
Hmm... you know, there is a noClip tag now, for abstractArrow
I wonder if I can somehow use that...
SQL stuff
yeah we need more people versed in this
otherwise may need to wait several hours before someone like me is on to help XD
life saver
I should start with SQL heh.
But I still prefer my own flatfile databases for the moment
We can take the easy route and prevent you from leaving 
SQL is quite simple when you learn that way :
- making SQL request locally on the SQL interface
- using jdbc driver in java without spigot
- using jdbc in spigot plugin
there is more to SQL then just the programming side of it
I did the inverse way, that why I struggled with it because without basis it's depressing
Gotta design those schemas
And those indices
Well, other then learning this it does help though if you learn the system you are using because typically they end up having things built in that would make your programming a whole lot easier
I probably know decent amounts of general programming stuff (and API design common sense) that I don't expect SQL to be much of a pain for me.
But it still means that I'll be like "yeah, no idea what is going on" on code I did not write myself
Database design and SQL statements really aren't that hard
I would probably say the part where Geol would most likely not be familiar with is the other side of the SQL field, not the programming area or looking at code that interacts with SQL 😛
And well I already know how to structure databases and stuff (In fact I am currently doing ERMs and all that other database design stuff at school)
Using databases is quite straight forward. It does get painful if you support different databases and they handle transactions differently
Most of the time they are not, however it really depends on the design part. Most people who have bad DB designs is either because they just don't know or they really don't want to change their DB to be better XD
but, there is times though where designing a DB isn't going to be straight forward because you don't have enough information or know all the possible things you need to be aware about until you get further along in your program
I feel like it's hard to fail designing a relational database model. Unless there's a good reason not to you just avoid duplicating any data and you are good
Sure there are exceptions but usually those exceptions won't be there in a minecraft context
not for the typical plugin
the main problem I expect to occur is that changes later on can be quite painful
You can always migrate the data
yeah this was what I referring earlier in why a bad DB design exists
it isn't because they don't know, they just don't want to go through the time and trouble to change it
Ideally you'd not want to do that since that means a lot of code required for upkeep
yay we all love technical debt
Hello everyone. ProtocolLib does not work in the plugin
error:
Caused by: java.lang.NullPointerException: Cannot invoke "com.comphenix.protocol.ProtocolManager.sendServerPacket(org.bukkit.entity.Player, com.comphenix.protocol.events.PacketContainer)" because the return value of "com.comphenix.protocol.ProtocolLibrary.getProtocolManager()" is null
maven:
<repositories>
<repository>
<id>spigotmc-repo</id>
<url>https://hub.spigotmc.org/nexus/content/repositories/snapshots/</url>
</repository>
<repository>
<id>sonatype</id>
<url>https://oss.sonatype.org/content/groups/public/</url>
</repository>
<repository>
<id>dmulloy2-repo</id>
<url>https://repo.dmulloy2.net/repository/public/</url>
</repository>
</repositories>
<dependencies>
<dependency>
<groupId>org.spigotmc</groupId>
<artifactId>spigot-api</artifactId>
<version>1.12.2-R0.1-SNAPSHOT</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>org.projectlombok</groupId>
<artifactId>lombok</artifactId>
<version>RELEASE</version>
<scope>compile</scope>
</dependency>
<dependency>
<groupId>com.comphenix.protocol</groupId>
<artifactId>ProtocolLib</artifactId>
<version>4.8.0</version>
<scope>provided</scope>
</dependency>
</dependencies>
plugin.yml:
name: TestPlugin
version: '${project.version}'
main: me.imzontik.testplugin.TestPlugin
depend: [ProtocolLib]
commands:
createpacket:
That's why database versioning tools like liquibase exist
well, sometimes that debt was incurred like at the end of your project and so its like yeah I don't want to change this again now
Bold of you to assume I ever feel like a project is complete 😛
protocollib does need to exist on the server
protocollib is already on the server
is it enabled?
yes
then it is going to be something with your code then
or you need to wait for protocollib to be enabled first before your plugin
Well he is depending on it so that should get handled by spigot. Unless he's accessing in a static context
try updating the protocollib plugin installed on the server
after you make sure you only run your code after Protocollib fully initialized
unless you put it in the plugin.yml for depends, no spigot won't try to load something you depend on first
the problem has been solved, thanks
even then it may as well be useless as either protocollib initializes too late or the plugin loads too early
Don't be like Denvercoder9.
o.o
The plugin cannot load too early if you depend on another plugin
Obviously you can't rely on that when using static blocks but everything in the on enable will not run before the depending plugin is initialized (if it's installed)
static blocks is what I mean with too early
And then there are also plugins that initialize on the first tick - so even calling their APIs in the onEnable won't work.
But I am not sure if protocollib is one of those plugins
Yeah I also had to do that for one of my projects
since depending plugins need to register before I load all my contexts
Probably GSON, but I prefer org.json if you like less magic interfacing
magic??
reflection
Sometimes libs might use even darker magic
org.json documentation?
Search the world's information, including webpages, images, videos and more. Google has many special features to help you find exactly what you're looking for.
org.json:json documentation is pretty much only the javadocs
goggle .com documentation?
It's dead easy to figure out
💀
im really bored
also if you don't know how to Google
lol
the Main Point of the Website and i just didn't do it
i.e. String stringified = new JSONObject().put("key", "value").toString();
And vice-versa it'd be
JSONObject jsonified = new JSONObject("{\"kew\" = \"value\"}");
maybe ill just use jackson
isn't that one unmaintained?
no jackson is maintained and is also widely using in spring
spring != spring boot though
Yup and Spring itself is just the beans and wiring. Afaik spigot also started based on spring
doubt so
well it was widely used to run external jars. Doesn't sound that unfamiliar for plugins
a colleague told me. I never checked
I think Bukkit used to.
hm. I never heard about it being used
defo not anymore
They haven't been available ever since 1.8 if they ever included it
And I've checked out some old ass CB forks and I don't recall seeing something about spring
as I said. I was told it started with it, I never checked so I can't be sure about it. Although it would fit
I've seen a reference of avaje.ebean - perhaps you mean that?
Would have to ask the guy who told me. I just believed it since it would have made sense. If it's wrong then now I know
Dissected the spigot and cb sources (although latter only through that old ass fork I referenced before) and didn't find any mention of spring before the maven transition occured. After that it gets a bit difficult since dependencies cannot be easily searched for
It probably wasn't spigot. I just forgot that bukkit was a thing years ago. So yeah it was probably (craft)bukkit in its really early stages. Or he just mixed something up aswell
hello, does anybody have an idea of how to implement a system that detects if the player is holding interact? I'd guess somehow check for times between clicks or something maybe?
spring was not used for either
not sure who told you, but they are definitely wrong lol
that's it im making my own jackson fork
Retrofit 
I gotta use holds to move my armorstands better. For now, I just have teleports set up on interact which makes it look laggy if holding down tho
Well that's alright then. It made sense when he told me, based on the functionality that spring delivered.
so if I can detect when a player is holding down the interact, I can set the velocity
they are just armorstands that gotta be moved when clicking an item, but also when holding down it should constantly get moved
why don't you pick it up on first right click and lock it into position on the next?
Right click = Armorstand moves
second right click = Armorstand no longer moves
for holding down I gotta use velocity so it does not look laggy
since interacts are only getting called every like 200ms
(and would demolish performance)
because I also need single moves
then use leftclick or a different item
it is a ingame creator for armostands, they need to be moved precisely
its the same issue then
teleporting a single entity every tick won't demolish performance. Also you could create a packet based armorstand
well yeah I could wrap that and transfer it when the creator is done, but well, other players should see it too
so right there things are gonna get complicated
I want a precise realtime creator
Loop over players and send them the packet? The server does the same except that it still handles a real entity
not "input the position m8"
yeah but all that with wrapping and so on is just a lot more work than just... having a hold down system
But as I said, you don't need to use packets since moving a single entity (or even 100 entities) every tick won't hurt performance that much
players gotta move around while editing
that does not change the issue that it looks laggy tho
I don't know how you implemented the moving part but I'd just have an item that's a position adjustment tool. When selecting the armor stand you can move it around until you unselect it with another click
interacts get called like every 200ms or something
players gotta move around while editing
and 10x more time-consuming and annoying for users
I told you multiple times to not use "hold button". If you need single teleports either use another item or another click type (or check if the player is shifting during the click) or whatever suits best
because when having them input some random positions, they cannot see how it is gonna look in realtime
thats just not what is my plan of how it should work
Well you are engine limitated here 😅
don't need to
Hey I am using the PlayerMoveEvent to place a block under a player everytime the block under the player isnt a certain type of block. Though this works flawlessly most of the time when I go in between chunks it lags back. https://paste.md-5.net/sanafehuvo.cs
1 item in hotbar for every direction
what do you mean by "lags back"?
like this
Hello, I'm trying to replace the lore of a music disc to "Uncompleted!" (for bingo), but setting it to null like it says in the documentation doesn't work. It still shows the artist and title of the song.
ITEM_META.setDisplayName(ChatColor.RED + getDefaultItemName(materialToAdd));
ITEM_META.setLore(null);
List<String> LORE = new ArrayList<>();
LORE.add(ChatColor.GRAY + "Uncompleted!");
ITEM_META.setLore(LORE);
ITEM_TO_ADD.setItemMeta(ITEM_META);
that's the Server Lagging so Hard
i Remember that Thing from a Plugin Called PlugHack
from a While Ago
wtff
i made that plugin lmfao
I did
damn maybe i should bring it back
Yes, Please i want to Hack without Hacks
so basicly I can also set up a loop that gets started and renewed for every click
it contains the time of the latest click, and then I gotta compare it to the new event
its not tho 4 ghz cpu and 6 gb of ram for a paper server with 1 plugin and 1 player
Yeah, but the Server can't keep up with the Position of the Player at the Same time it Places Blocks under Him
that Happened to me when using PlugHack and i though it was that
and i Said Server but i meant Event
ur literally the second person to recognize me for that plugin it only has 300 downloads too
No one recognizes me :(
what about just a HashMap containing all players and the last time they clicked, then compare every interact call
why that
Because I don't have any plugins
yeah that also works
u think i got the most optimized code though? https://paste.md-5.net/sanafehuvo.java
the thing with using an infinite loop is that I can actually register my own listeners to it
so I don't have to modify the method manually, can just listen
I don't have any really popular ones either. In fact most here don't have any recognisable plugins.
Exception to that rule is mfnalex, but that is about it
and also have custom timing not being bound to every interact
I'm going to be making my first mistake in a few months I forked my friends plugin and I'm uploading my fork since he abandoned nd all
Hope no one downloads it
well, I mean it could be Better
but it's not Bad
it Works Great
Otherwise I'll have to deal with the people
Most of my plugins are forks too.
It's not that bad
I have to do a recode though
You should see my codebase vs his
It's like heaven and hell difference
that is standard once you are serious about forking
I never forked something lol
Essentials clone 1,003,728,472
accurate
I fork stuff for two reasons
I almost forked an entire database yesterday cuz I didn't agree with their design
I'll get around to just making my own from scratch though
to remember it because it is good or because I use it for something and therefore like to maintain it myself and fix whatever issues it has lol
I only use the fork feature because I legitimately either contribute to it or because I'm actually planning on rolling out a fork myself.
If I need to remember stuff it gets starred and forgotten
I don't use the star function because I hate being spammed about stuff about it
just because I like it doesn't mean I need to be notified about anything of it
seems you got it confused with the watch feature
last I was told it was changed
Unless you look at the "for you" tab that is
but I am stuck with the habit now and since it hurts no one I see no reason to change it
For some reason ITEM_META.addItemFlags(ItemFlag.HIDE_POTION_EFFECTS); hides the song/artist. Very confusing.
It's mostly us having a bad name for it
?stash
i need this one but it takes me here (2nd image)
Too old! (Click the link to get the exact time)
works fine for me ™️
otherwise just clone the entire repo and checkout the appropriate tag (so git checkout version/1.9.4 for you)
yeah i will try that if it doesnt work
i appreciate your help thanks man
Hey, i can't build with maven because i added a dependencie from jar file and when i build with maven i have the error package does not exist
never add jar files directly
Don't depend on jar files
the dependence i have isn't on maven
is it on github?
Which dependency is it?
then use my wonderful file:// repo hack
otherwise you could use jitpack
Vault 1.7.3 and Vault API 1.7
^^
Vault has maven
doesn't worked
system dependencies are deprecated Use install file to add it to maven local
Show us what you tried
Or file:// repos
dunno if directly pulling from gh with jitpack is any better
thats what i do to get my own fork as a dependency
okay, previously Vault didn't worked but now Vault is working
but i have same problem for Bukkit
i need Bukkit 1.9.4
^^
¯_(ツ)_/¯
import net.minecraft.server.v1_9_R2.PacketPlayOutScoreboardTeam; isn't working
You don't need packets for teams
why are you on 1.9 anyways
You need to run BuildTools and build 1.9.2
Then change the artifactId from spigot-api to spigot
?bt
what's next ?
Can I ask why you’re making this for Minecraft 1.9.2
because my plugin is for 1.9
Why do you want to make a plug-in for 1.9
because i prefer
That is a a new one
That's it
what does 1.9 do that 1.19 doesnt
Did you run it with —rev 1.9.2
Or whatever version
And then you can add spigot to your maven
Or 1.9.3 or whatever version it is
yes
it removes the other stuff
hey so i ended up using buildtools to get spigot src
which folders will i need to rebuild the spigot jar ?
yes but how can i use it with maven ?
It’s installed now
Into your local maven repo
All you have to do is add it to your Pom
Build tools automatically runs install
whats wrong with this
everything
> Could not resolve all files for configuration ':compileClasspath'.
> Could not find net.md-5:bungeecord-chat:1.12-SNAPSHOT.
Searched in the following locations:
- https://repo.maven.apache.org/maven2/net/md-5/bungeecord-chat/1.12-SNAPSHOT/maven-metadata.xml
- https://repo.maven.apache.org/maven2/net/md-5/bungeecord-chat/1.12-SNAPSHOT/bungeecord-chat-1.12-SNAPSHOT.pom
- https://hub.spigotmc.org/nexus/content/repositories/snapshots/net/md-5/bungeecord-chat/1.12-SNAPSHOT/maven-metadata.xml
- https://hub.spigotmc.org/nexus/content/repositories/snapshots/net/md-5/bungeecord-chat/1.12-SNAPSHOT/bungeecord-chat-1.12-SNAPSHOT.pom
- https://jitpack.io/net/md-5/bungeecord-chat/1.12-SNAPSHOT/maven-metadata.xml
- https://jitpack.io/net/md-5/bungeecord-chat/1.12-SNAPSHOT/bungeecord-chat-1.12-SNAPSHOT.pom
Required by:
project : > org.spigotmc:spigot-api:1.12.2-R0.1-SNAPSHOT:20180712.012057-156
Possible solution:
- Declare repository providing the artifact, see the documentation at https://docs.gradle.org/current/userguide/declaring_repositories.html
why
idk. will have to wait for someone who knows gradle
:(
how i add it ?
@wet breach add the Bungeecord repo
how i add spigot to mven after build tools
?maven
The home of Spigot a high performance, no lag customized CraftBukkit Minecraft server API, and BungeeCord, the cloud server proxy.
There
why am I being pinged?
Both of u
i ping normally for that
?gradle
damn
Lemme search for it
The home of Spigot a high performance, no lag customized CraftBukkit Minecraft server API, and BungeeCord, the cloud server proxy.
It’s the same as the normal one
Just do spigot instead of spigot api
For the artifact id
How do I make my plugins from version 1.16 to 1.19.4 compatible? Because of the API in the plugin .yml . And how do I do that, that plugin also works for other software?
And how can I use that on a 1.19 server?
Use what
I don't understand 😅
doesnt work
Make your plugin with the latest api version (spigot 1.19), and in plugin.yml just add "api-version: 1.16"
no, depend on 1.16
So now I just write my plugin for 1.16 and add to the api version: 1.16 or what? And that goes without any problems on 1.17, 1.18, 1.19 etc.
-<dependency>
<groupId>org.spigotmc</groupId>
<artifactId>spigot</artifactId>
<version>1.9.2</version>
<scope>provided</scope>
</dependency> ?
i imported Spigot but can't use import net.minecraft.server.v1_9_R2.PacketPlayOutPlayerInfo;
is it possible to just use the spigot folder here ? like copy it and modify then just compile ? i tried but the server.jar file doesnt get modified (i modified to leave message to see if it will change)
1.9.2????
why legacy support?
Version is 1.9_R2
They wanted to make a plug-in specifically for that version
Maybe with a -SNAPSHOT on the end
Can you tell me how to remove this spam from my console?
[23:25:47 INFO]: com.mojang.authlib.GameProfile@3aa883b5[id=<null>,name=1qY4msssRYG,properties={},legacy=false] (/193.35.18.113:51924) lost connection: Disconnected
1.9.2-R0.1-SNAPSHOT
why my maven plugin isn't detected by the Server ?
did you build it right?
i think
where did you place it?
plugins folder..............
reloaded server?
stop and restarted
errors?
nothing in the rcon
hey bro you can help me @tardy delta
?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!
lets not ping people
Did you use this?
why would you install instead of package
The plugin is then built on top of this and can be used. This is the simplest option
I find it the easiest this way
you find pointless steps the easiest way?
if it works for them, then its fine
I don't think it's pointless or is there a better alternative?
yeah, package
What exactly does that do?
compiles the plugin
lets think about what would happen with nasa if they decided to say "if it works its fine" 🤓
java.lang.NoClassDefFoundError: net/minecraft/server/v1_9_R2/IScoreboardCriteria$EnumScoreboardHealthDisplay
i have this error someone know why
What version is the server?
they do
indeed
What is the easiest way for me to query in the join file whether the value in the configuration for the join message is true or false? If true, a message should come and if false, none.
o.O
it literally should be like 1 method to grab it
not sure how that could be anymore simpler
if (config.getBoolean(whatever))
so?
if (config.getBoolean("joinNotification") === true) {
}
?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.
also === true 💀
I'm new to Java and have used PHP before
whyyyyy
?whereami
i don't get it
it is a java version error i guess
ik but i asked why did they use Java 20 in the First Place
oh, it was for You
the Classes are Paper ones
and you Posted it on Spigot
that's why md_5 Responded
The Meme Man fr
it was Hard for me to get it xD
i still need some help with NMS, after running buildtools with java -jar BuildTools.jar --rev 1.19.4 --remapped, i still cant use net.minecraft.server.v1_19_R3, though other packages withing net.minecraft.server can be used. the maven repository at C:\Users\<me>\.m2\repository\net\ has no minecraft folder in it, is that maybe the problem?
i could not find a detailed tutorial on the setup of nms anywhere, so if anyone can give me a link to like a yt video that would also be great
Isnt the version removed from NMS packages
?nms
Yeah it is
ok thank you i will take a look
ohhh
i see
thanks that was whats confusing me yesterday
so do i just use the same thing but in net.minecraft.server directly?
Let the IDE handle imports
How we cancel when a player try to move item on his inventory by pressin num key with another slot, inventory click event does'nt prevent that
It does
Hi, I've been working with nms a bit and I don't quiet understand the Item class. Where is the actual type/material of the item stored as item implements imaterial itself 🤔
?nocode
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.
An item is the material iirc
what is iirc? xD
if I recall correctly
ah I see so how would I create an nms ItemStack for example for an oak plank (without using asnmscopy or something like that)
@EventHandler
public void onClickInv(InventoryClickEvent e) {
Player player = (Player)e.getWhoClicked();
e.setCancelled(true);
}```
Try recreating on 1.19.4
new ItemStack(Items.STONE)
Ah i see they're all collected in the Items class thx
Mojang splits what spigot calls material into items and blocks
The Mojang version of material is only used to dictate the properties of things, like the breaking sound and such
It’s also gone in 1.20
Ah I see...I'm trying to get the bundle tooltip on to another item type and I thought it might be possible through the item class but I doubt it will work do you have any ideas if it's even possible I originally thought it was just a special tooltip that could be added to any itemstack but mojangs implementation seems more complex and tied to the BundleItem class
Are you making a mod?
no plugin
Then you can't add that bundle tooltip
ah man but how is it implemented?
Probably client side
^^
You could
The server doesn't care about how it is rendered
ok that's what I feared that the client checks for the type and then renders it
through a resource pack?
Yes
yeah good Idea I might do it 🙂
The bundle tooltip is 100% client-sided, yeah. Hardcoded onto the bundle specifically
I do wish they'd add that same tooltip to shulker boxes though. Missed opportunity tbh
Agreed
that was my idea that sucks
There are client mods for it though
Yeah but like D:
Vanilla, man. It can totally be vanilla
D: indeed
does anyone know how the new system works for changing an items name i know its with like item.displayname.append or something like that but i dont really know how components work and i couldnt find anything about it online
Functionality's already there! They've got separate tooltip renderers
Just gotta get Mojang to hire me
😂
so just use the deprecated one for now?
It’s not deprecated in spigot
it is in paper
📄
?whereami
MD loves that command
What can it be? I have Java 17 on the server and the plugin is also Java 17
It is a great command
Definitely not a version issue
It's a casting issue
String definitely != long
Long.parseString(long) 😂

?paste
How can i make this work in different pages? : https://paste.md-5.net/xopiwufoxa.cs, i have it setted up for 36 slots, and i want to set it up heads till the 27 slot then on a next page, also i dont know how can i test this out, as it is for online players
?paste
pages = players % slots per page;
two things, how can i make a new inventory per page https://paste.md-5.net/ajamikuyog.cs
hmm
playersCounted++;
String aboutMe = plugin.getConfig().getString("players." + onlinePlayer.getUniqueId()+".aboutme");
if(playersCounted <= 27){
if (aboutMe != null && !aboutMe.isEmpty()) {
ItemStack skull = new ItemStack(Material.PLAYER_HEAD);
SkullMeta skullMeta = (SkullMeta) skull.getItemMeta();
skullMeta.setOwningPlayer(onlinePlayer);
skullMeta.setDisplayName(onlinePlayer.getName());
ArrayList<String> lore = new ArrayList<>();
lore.add(ChatColor.GREEN+"Click to read my about me!");
skullMeta.setLore(lore);
skull.setItemMeta(skullMeta);
inventory.addItem(skull);
}
}
else if (playersCounted > 27){
playersCounted = 0;
page++;
}
}```
i did this
but i dont know how to create a new inventory per pagwe
and dont know how to test it like with fake players idk
yeah i was thinking that, so i have the buttons also
How could i set it like, when clicking on my item, in my event code like changing to the next 27 players
Have an int
Set that int to the current page x items per page
And then start at that index when adding items
i have it already ```//Else
int maxPlayersPerPage = 27;
int playersInPage = 0;
for (Player onlinePlayer : Bukkit.getOnlinePlayers()) {
playersInPage++;
String aboutMe = plugin.getConfig().getString("players." + onlinePlayer.getUniqueId()+".aboutme");
if(playersInPage <= maxPlayersPerPage){
if (aboutMe != null && !aboutMe.isEmpty()) {
ItemStack skull = new ItemStack(Material.PLAYER_HEAD);
SkullMeta skullMeta = (SkullMeta) skull.getItemMeta();
skullMeta.setOwningPlayer(onlinePlayer);
skullMeta.setDisplayName(onlinePlayer.getName());
ArrayList<String> lore = new ArrayList<>();
lore.add(ChatColor.GREEN+"Click to read my about me!");
skullMeta.setLore(lore);
skull.setItemMeta(skullMeta);
inventory.addItem(skull);
}
}
}
player.openInventory(inventory);
but i dont know how to make it like the next 27
make a int index?
and if index is 2 what ?
Then start at 2 x 27
I use a list of items for mine for easy index based access
Array works too
how so?
list.get(index)
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.
Lists are great
isnt this for finite lists? like not infinite
They are basically arrays that automatically handle resizing
A list can’t be infinite
well but it will work for online players
K thanks
Can someone explain me whats the difference between all of this, i dont understand the javadocs
asynchronously means off of the main thread (database, file read/write, and other IO should be done async so it doesn't pause the main thread)
later and timer should be pretty self explanatory
Do note most of the Bukkit api is not thread safe
Okay
i assume timer is like
10h 30m 23s -> 10h 30m 22s?
and that way
timer is a repeating task, later is running a task later, async stuff runs on another thread
mostly used for io
k
ChatGPT teached me :/ bruh, is there a way to check if it works, as i dont have 30 online users to test if the pages work
should i store player statistics/data in a mysql server or a redis server
Replace it with something you do have a lot of
All materials with isItem = true is a good test
the timer is in server ticks
How can i get from Maven the real bungeecord like the spigot webtools
You know that redis is inmemory right?
yes
How would saving statistics there make sense then
idk
It would not be persistent
Just never stop the server
Yeah or that ^
I dont know what i did wrong
but iclick next page
then nothing happens
and if i close and open again it looks like the next pag
but then i go back and do the same and still like is like there isnt a player anymore its wierd
This is my commands at the end the command List is the one im talking about https://paste.md-5.net/exuyabocos.java
and this is my event : https://paste.md-5.net/odebacikun.java
I know for it to update automatticly i have to reopen the inventory the wierd thing is that i dissapear when clicking next
How can i add the real bungeecord on Maven like we add spigot with buildtools
Welp, i gave up as it wasnt that necesary thanks for the help tho, when i get to more complex stuff and learned more java ill try again!
there is no "real" bungeecord like there is spigot
bungeecord has no weird nms logic
it is not a fork or anything, purely standalone
Someone can see this?
Im trying to do a decreasing timer
and well
i think its wrong?
why are there abstract elements
is that class extended by anything?
its supposed
to
oh damn
i just
thinked about it
this shouldnt be abstract
and also you can create the runnable first
ill do it again
and then use
start(){
runnable.runTaskTimer(HCF.getInstance(), 20,
getDuration());
}
and there is like no setter for timer values?
hmm
yeh that would do
and well the runnable
and make it long (lowercase l), Pls 
.
if you do the loop like 100 time there will be objects be created
If you can use a primitive over a wrapper, do it. long > Long. int > Integer. boolean > Boolean, etc.
It's not about object creation, it's about wrapping and unwrapping values
In a loop specifically, the compiler would probably optimize the unboxing outside the loop anyways (where possible)
creating objects is the JVMs greatest purpose 
now here should i start to make remaining - 20?
& they're stack variables when in a method anyways. Not like you're heap allocating
there is no need to create new object in this case:l
you can move the new BukkitRunnable to the class constructer and then do
runnable.runTaskTimer()
Long
Value suffixes. You can use L for long, D for double, F for float
- im making an rpg system and have an abstract class, Pool, which is extended into other stuff like Health and Energy
- im using gson to save all this as json, and i need to write a TypeAdapter for Pool
- i cant return Pool from the read method because Pool is abstract
is there a way around this, or am i going to have to make TypeAdapters for each specific pool instead?
uhh
great question
maybe save the pool type along the data itself?
and then get the type adapter
So you're trying to make an RPG whilst you're new to programming?
that doesn't sound like the best idea
do you know how i might do this
You can just append an object to the gson itself
how can I tell if an item has a custom name that was made in an anvil
just check if its italics?
getDisplayName returns null if it's the default name
Is Location block = e.getTo().clone().subtract(0, 1, 0) the exact same as Block block = to.getBlock().getRelative(BlockFace.DOWN)
yes
Orrrr, hasDisplayName()
And the second code is faster right?
i want to differentiate between having set the name in a plugin and having set it in an anvil
cuz cloning uses more resources
Let's check the internals!
also one returns a block and the other returns a location so
yeah ik but yk what i mean ill get the location of the block
Alright so first thing
but i remember seeing somewhere that cloning is slow
so they are the same in preformance?
pretty much
damn
lmao do u have any micro optimizations for this? https://paste.md-5.net/amadupixad.java
I cant think of any other ways to optimize
I wouldn't call getBlock that many times
re-use values and all
Honestly I'd rather focus on code quality rather than micro optimization
thats true didnt notice that
Like you can do a few things to improve here
well it currently lags back in between chunks with this code on a good server without anyone on it so im trying to get the most performance out of it
alright any performance onces though?
lmao yeah im pretty tired and didnt notice that
setData and setType, hmm
there might be a way to set both at the same time
which lets you like
not modify the block twice
so I want to loop through all players on the server over the course of a couple ticks
but I've realized a slight issue with this idea
wait setData is not a thing
so I started like this
are you on 1.8 🤨
but since its a collection I can't safely cast it to a list
why would you want to cast it
and stream().toList() doesn't guarantee the same order every time
because I want to """loop""" through that list over a couple ticks
welcome to java 12
one player every tick
ehh that's not as performant
or every run of the runnable at least
imagine half your players are afk
the alternative is doing every single player each tick
they all have to be checked eventually
One thing is like
you need to check if the player's block changes
because PlayerMoveEvent like
im checking if they have old versions of items in their inventories that need to be updated
because attributes or something changed
if you look around
there is a setIdAndType method but its deprecated and id have to rework code for a negligible difference
lmao
is it just lore or are you changing proper data?
proper data
hm
i already have a method that can update old versions of items
and a method that can scan a player's inventory for old versions of items that need to be updated
i just want to really make sure I don't miss any events or anything
so nothing slips past
- Tile entities (ChunkLoadEvent), so any container, item frames etc
- Dropped item entities
- PlayerJoinEvent player inventory and enderchest
- Any drop item event
should be it
scheduler seems wasteful imo
You want to random access a Collection?
What about an Iterator?
And if you never want it to end, you can use Iterators.cycle()
BlockGrowEvent?
BlockSpreadEvent
No
That's only when it goes from same block to one next to it
Not when it grows
What is a good way to provide my API to the end application here...
I have a setup like this
api
core
modules
submodule1
submodule2
essentially core is the intermediary between all the submodules and I don't want to expose dirty implementation to the api section because I need access to one class in the core module. I should note this is all bundled as one jar I'm just only exposing the API module when depending.
I setup an interface in my api that is implemented in core in order to implement all the API, but I'm not really sure what to do from here
Not even a thing
BlockFromToEvent doesn't apply either
hmm
Singleton
Services and Providers?
Does a BlockEvent print out anything when a crystal grows?
Mye but that’s bukkit local
Unless you may use jpms
But like, a singleton for ur api is always fine
(To the public api consumers)
That's an abstract class
Careful that event fires a lot
^
Whats Event firing?
Plugins can listen to events using listeners
Event firing, means that all listeners that listen to specific events (like block break for ex.), receive that event and can modify its outcome
BlockPhysicsEvent specifically is called a lot, because it's responsible for things like block updates, sand falling etc
there is no something to findFirstNotFull() method?
Event being called
filter(smth -> smth!=null).first()
how to use it in inventory?
how to use what
id do a manual loop cuz those inventory methods are weird
hello, i am working on a custom spigot and need to modify the kb, this is where i can do it right ?
public abstract class EntityLiving extends Entity {
...
public void a(Entity entity, float f, double d0, double d1) {
if (this.random.nextDouble() >= this.getAttributeInstance(GenericAttributes.c).getValue()) {
this.ai = true;
float f1 = MathHelper.sqrt(d0 * d0 + d1 * d1);
float f2 = 0.4F;
this.motX /= 2.0D;
this.motY /= 2.0D;
this.motZ /= 2.0D;
this.motX -= d0 / (double) f1 * (double) f2;
this.motY += (double) f2;
this.motZ -= d1 / (double) f1 * (double) f2;
if (this.motY > 0.4000000059604645D) {
this.motY = 0.4000000059604645D;
}
}
}
...
}
Which server version?
1.8.8
ay thanks man
ow man i struggled to understand that stuff this would have been very useful lol
thanks alot
NMS is just about finding the right thing
how do you know which _a function is it though ?
Sorry?
Then search for your method
public void a(Entity entity, float f, double d0, double d1) {
ohhhhh
mb i just looked here
so that would be a(Entity arg0, float arg1, double arg2, double arg3)

