#help-development
1 messages · Page 1302 of 1
perchance
trying to think of how to do this eco system
bc i could callback-hell it, but im also now thinking of how to still make sure its synced
brother AI is killing me in godot
it keeps trying to be "safe" by checking if stuff is null
and then skipping over if it is
brother if 99% of these things are null then the game should crash, it means it will absolutely not function
like come on who would think it's a good idea to see if the map is null or not, if the map isn't there the game isn't going to work
chatgpt and claude both on website and ide
with or without subscription?
I would also recommend just using claude code if you're going to use claude, works well enough
the issue with AI right now is that we're in the phase where it "works" but it still kinda sucks at times, so if you want to lower the error rate, you'll have to either use the tools with the best integrations (i.e. Cursor + Claude) or tinker a lot with your prompts and make custom MCPs in order to feed it enough context to make it capable of doing things in an actually useful way
we're slowly getting to the point where all tooling is converging into AI-friendly software but we're definitely not there yet so if you don't tinker with your setup, you'll often get frustrated with it
just making a good instructions.md goes a long way
indeed, its good for web applications apps, but not really for minecraft programming (plugins) not to talk about mods .. yes it can make some good plugins but take allot of time and tokens (if you are using paid ai editor) ..
if only there is a MCPs dedicated for that job 😛
ModCoderPack 🙏🏻🙏🏻🙏🏻
how can i split my project my project up between common, spigot and velocity?
i saw taskchains just using multiple "src" directories each with their own respecetive module
Hi, do you know how to contact the Spigot support center? I'm having a problem with my account. I noticed I entered the wrong username and date of birth, and I need to change them, but Spigot's settings won't let me.
Thanks.
yeah that's how
one core/api module that contains interfaces and shared code
and then multiple modules implementing what's needed
that's called modules ..
?support
alrighty ty
ok, thanks a lot, contact on Gmail, right?
This, atm you can't really plug chatgpt into your codebase and just expect it to work
You need to either write or use a framework with mcp and other integrations specifically for programming things, ideally in your specific language
@echo basalt do you use digi
solid chance someone cut your fiber lines
doubt
it's pretty common
also the router went from saying I had no network to saying I do
except I still don't
I'm even checking on multiple devices just to be sure
your access point might be blasting but have no connection
no, they have an actual internet connectivity light
it was red it's now green
this sucks
I connected my phone to my pc to have a connection
already contacted them and they said they were going to put in a ticket
Hey yall
Good news
I just made one of my first patreon exclusive plugin
So
How can i test it
To make sure it doesnt actually crash
Anyone willing to test?
Here's a suggestion: First test if the plugin works and THEN put it on patreon
public void modifyGems(double amount) {
Bukkit.getLogger().info("user: " + id); // corect user
Bukkit.getLogger().info("exists: " + file.exists()); // exists
FileUtil util = new FileUtil(file);
YamlConfiguration configuration = util.getConfiguration();
double balance = configuration.getDouble("gems") + amount;
Bukkit.getLogger().info("balance: " + balance); // 100
configuration.set("gems", balance);
util.save();
}```
```java
private final File file;
private YamlConfiguration configuration;
public FileUtil(File file) {
this.file = file;
}
public YamlConfiguration getConfiguration() {
YamlConfiguration configuration = new YamlConfiguration();
try {
configuration.load(this.file);
} catch (IOException | InvalidConfigurationException e) {
e.printStackTrace();
}
this.configuration = configuration;
return configuration;
}
public File getFile() {
return file;
}
public void save() {
try {
this.configuration.save(this.file);
} catch (IOException e) {
e.printStackTrace();
}
}```
how is my gems value still 0...
In your first function, you do not use amount at all = you do not modify the value
wdym? balance = configuration.getDouble("gems") + amount;
oh I am blind
manually doing modifyGems(100)
You run it multiple times?
nope just once
so how do you know it's always 0
is util.getConfiguration a copy action?
is there anywhere we can find people to dev some stuff in minecraft?
?services
If you wish to request or offer development/art/building/administration services, please do so at https://www.spigotmc.org/forums/services-recruitment-v2.54/
How do u correctly use mojang mappings? Do I just use compileOnly("org.spigotmc
1.21.8-R0.1-SNAPSHOT:remapped-mojang")? Or am I missing sth
?nms
L
I already did link you to a gradle plugin that handles the remapping
Is there a way to automatically publish plugin updates?
to the spigot forums? don't think so
is there an event for when snow falls from biome like in a snowy biome snow will fall on blocks
BlockFormEvent
Anyone aware of an anvil gui library that lets me detect when the text changes and runs on mojmappings?»
is there a packet for changes?
i thought it applies at click
and everything else is client side
nope it fires a prepare event
then just find the prepare packet and you're good to go
make one for us 🙏
I'm trying to save time at work not give myself double the problem
PrepareAnvilEvent
I assume there's also no way to hide the "enchantment cost: 1" or whatever every time I type a letter?
yeah I don't like that
minebox does it by just removing the text for everyone
I wonder if I can yeet that text off screen with core shaders or something
that exists? nice
it looks like it
put it on a server and test it
strange question
Forwarding this from #help-server
I did do a System.out.println(sender.getClass()) in the method that checks if the sender is a player (sender instanceof ProxiedPlayer) and the returned value was the UserConnection class:
What is even more confusing, is that the check returns true, yet somehow the command treats it as if the sender wasn't a player.
Okay, this must be an issue in the command framework... Sorry for the bother.
A new issue arrived.
My client gets disconnected with this error client-side when I send a Dialog: https://paste.helpch.at/joqezexave.bash
I create two kinds of Dialogs: A DialogListDialog and individual Dialogs.
I have them sort-of platform agnostic via builder classes and alike...
The DialogList implementation: https://paste.helpch.at/oruvefucom.java
The Dialog implementation: https://paste.helpch.at/jocixoxiko.java
Not sure what stuff I do wrong here, if anything? Or is that a BungeeCord issue?
what's the best way to do a bukkit runnable with a dynamic wait time? I'm trying to do an extended version of this (I simplified it so its not too long) but the wait time won't change (like its scheduled once I guess and it doesn't check if the method has changed its output)
new BukkitRunnable() {
final UUID uuid = player.getUniqueId();
@Override
public void run() {
if (some conditions) {cancel; return;}
do some usefull stuff that I want to reuse
this.runTaskLater(getPlugin(), Math.max(getGainSpeed_moments(player), 4));
}
}.runTaskLater(getPlugin(), Math.max(getGainSpeed_moments(player), 4));
it is trying to parse a macro in the template, but I am unsure of which part of the template is causing the issue
if anything, it does seem like it is a bug since it should escape it for you but for now, try escaping special characters such as / and .
use a task timer and make a class which implements Consumer<BukkitTask> which stores the tick count
so like:
public class CountingTask implements Consumer<BukkitTask> {
private long count;
private final Player player;
public CountingTask(Player player) {
this.count = 0;
this.player = player;
}
@Override
public void accept(BukkitTask task) {
count++;
if (some conditions) {
task.cancel();
return;
}
// please don't use underscores in method names
// Also make sure that whatever that getGainSpeed_moments method does isn't too performance intensive
if (count >= Math.max(SomeClassIDontKnow.getGainSpeed_moments(player), 4)) {
count = 0;
// do stuff
}
}
}
then you can do:
// this sets the period to check every 1 tick but you can make it longer if you want
Bukkit.getScheduler().runTaskTimer(plugin, new CountingTask(player), 0, 1);
Look at that
could probably be generalized if one wanted tbh, I just didn't bother for the sake of not making a huge ass message lol
now that I think about it, this might end up leaning towards running every 4 ticks most of the time if the getGainSpeed_moments method often returns a different value. I would change it up so that you set the next run amount once per run, in order to avoid it varying so much
Something i wonder for long time is the half broken state of the Itemstack class and underlying Metadata, using the standard way to serialize itamstack with the official methods to a yaml file after 1.20.5 is just not an option, as the itemstack 9 of 10 just wipe metadata when you do server updates.
Why not use the Data Fixer Upper? other thing is the equals and have metadata like enchantments. Suddenly is the same item added to inventory not same as an itemstack freshly made in a plugin to compere the item inside the inventory (has exactly same metadata set). So I had to go through the rabbit hole to manually check the metadata.
It has been a thing after the big shift in 1.20.5, everything is just a different beast and seams like no one complains about it or do all using NMS for itemstacks?
most people do end up using NMS for it, yes. The current ConfigurationSerializable format is just broken
it could be fixed just by utilizing the SNBT format instead, but nobody has taken the time to write migration code for that. Could be a good PR though
I think even more strange they not address the equals and isSimilar than the serialization (as it likely be more used), as the alternatives is less performant if you not go straight to NMS.
I did use an library that using Data Fixer Upper, as the serialization the standard API offer option is just no go.
Hi
Does anyone know of a tutorial that can teach me how to make configurable minigames?
what is the issue with equals and isSimilar? (whoops ping, sorry)
there are quite a bunch of those in youtube, while they're mostly outdated the concept is the same
Youtubers like who, I only know ajneb97
As I describe before, if you add any type of metdata beside amount and similar inside the Itemstack class two items that is created by the plugin where one is saved to compere the item inside the inventory (so a new copy of exact same item as that one inside the inventory). The toString does not show any difference, but still they are treated as different objects. Never happens before 1.20.5.
If it what I think it is. Then is worse option than to write directly in real code language.
But skript in context of Minecraft, is more human friendly language where you more write text what the code shall do. But the performance is not good. Like run five steps forward if I do oversimplify it. If you not mean something else.
Skript is just a language for making plugin-like functionality, it has resonated with quite a bit of the community at some point for being less overbearing than writing a whole plugin
that being said, I have no idea what they're up to now, they got their own community going on called skUnity if you're interested on it
there are alternatives to it, like EngineHub's Codebook or DenizenScript
The thing is, my problem is that I'm looking for a tutorial on how to create a minigame.
And I'm using the first thing I see as an alternative when I know perfectly well that it can't work.
just learn java skript is not worth it
it isn't something you'll be able to do overnight, no matter what kind of language you use for it
hence why I just recommended whatever youtube tutorial you find on it, it at least gets you going by giving you a starting template of sorts. You'll be very confused either way but at least you'll slowly learn what it entails
if I can recommend anything, it is to try and learn java first if you're going to do it the traditional way
?learnjava
For Beginners:
Codecademy - Learn Java: Interactive Java programming course from basics to more advanced concepts. Perfect for absolute beginners.
https://www.codecademy.com/learn/learn-java
JetBrains Academy - Java Developer Track: Learn by doing with projects and challenges. It covers Java fundamentals to advanced topics.
https://www.jetbrains.com/academy/
Udemy - Java Programming Masterclass for Software Developers: Updated courses that cover Java 8 to Java 17 features. Suitable for those who prefer structured learning.
https://www.udemy.com/course/java-the-complete-java-developer-course/
For Intermediate to Advanced Learners:
Oracle Java Tutorials: The official guides by Oracle for Java programming—great for understanding the depth of Java.
https://docs.oracle.com/javase/tutorial/
Baeldung - Learn Java and Spring: Focus on Spring Framework and modern Java technologies. Best for intermediate learners aiming to expand their knowledge.
https://www.baeldung.com/
Practice and Hands-on Learning:
Exercism - Java Track: Solve exercises and get feedback from mentors. Great for practicing coding skills.
https://exercism.io/tracks/java
LeetCode: Practice your coding skills and prepare for technical interviews with Java.
https://leetcode.com/
Free Resources and Documentation:
Java Programming and Documentation: A comprehensive collection of Java programming guides, tutorials, and API documentation.
https://docs.oracle.com/en/java/
Community and Support:
Stack Overflow: A vast community of developers. Great for getting help with specific problems or understanding concepts.
https://stackoverflow.com/questions/tagged/java
r/learnjava on Reddit: Join the community of Java learners and get advice, share resources, and discuss projects.
https://www.reddit.com/r/learnjava/
Remember: Learning to program takes practice and patience. Don't hesitate to experiment with code and participate in community discussions. Happy coding! 🎉
i genuinely think skript is more confusing and hard to learn than the spigot api so for your sanity dont use that bullshit
just experiment with it a little and learn basic concepts such as what are packages, what are build tools such as maven and gradle, what is a jar, how to make a class, an interface, how to implement methods
Patience is what I have the least XD
Thank you
Wish me luck and don't let me end up programming in Visual Bukkit.
the alternative is paying someone to teach you, that'll get you up to speed pretty fast as long as you find a capable teacher
but otherwise, you're just going to have to be patient
you're lucky to be learning in the era of LLMs at least, you can just paste shit on the chat box and ask it a bunch of leading questions
As long as you use it to understand how to code and not to make it code for you, it'll be an immensely helpful tool. But if you use it to code it for you without understanding how to code, you'll just end up more confused than right now so I would recommend against it
check out the resources above and give them a slight read, if you have simple questions then copy a paragraph and ask some LLM what it means
oh, that command is missing an important one: https://dev.java/learn/
Do you recommend any books?
java for dummies and java by example are good ones
(though java by example is probably outdated as hell by now, it'll still be able to teach you a thing or two)
el único libro de programación en español que me haya leido fue "El programador pragmático", pero no es especifico a Java y es de más alto nivel así que no creo que te sirva mucho sinceramente. Pero si buscas los libros de arriba, debe haber traducciones (oficiales o no)
Okey
I'd rather take a 1-hour Java course with basic concepts, and if possible, I'll install Sololearn.
they have an introductory java course so if that's what floats your boat, then by all means: https://www.sololearn.com/en/learn/courses/java-introduction
That will not turns out well with the script language I know works with Minecraft. As it is a lot to do and track with mini games. You can have it as goal but start with something smaller.
Not so much has change and the basic has not change, as most language i encounter share similares on a base level.
ehhhh
there have been pretty big changes in the language since 1996, generics being a big one but also things like streams, NIO, records
it is still a good book nonetheless, but definitely needs a newer edition to contrast the new stuff lol
Yeah but you should not start their. When did a school course on basic level, it used mostly primitive types and String.
So arrays, for/while loop, int and so on, only exception was string and date class could be used. So no List was allowed and own custom classes. So two-dimensional arrays was most used, a three-dimensional is to messy so never used that.
Just so you was not limited to 1 language, so you could pick up another language if you want too. That was the reason they put hard limits.
I not used records just for stuck still with java 8 :/ Some people still refuse too leave old Minecraft versions. But it has a big flaw it is only immutable, not like the data class Kotlin has where you can choose.
Well, I've already learned the basics on sololearn.
What I didn't understand is how the % works
They haven't taught me that at school yet XD
what do you mean by that, the mathematical operation (modulus)?
Yes
if so, it is just the operation that returns the remainder of a division
so, for example 10/6 is 1 and 10 % 6 is 4
Thanks bro
I have a question. If a player, PLAYER1 is invulnerable being in the invulnerability timer after an attack by PLAYER2.
Now PLAYER 1 gets hit again, still beeing in invulnerability timer. Do any of these values increase?
minecraft:damage_absorbed
minecraft:damage_dealt
minecraft:damage_dealt_absorbed
minecraft:damage_dealt_resisted
minecraft:damage_taken
I think if any, minecraft:damage_dealt_resisted would probably increase.
Im asking cuz I have a problem with people drag Clicking
Dumb question Is it possible to change the formula of generic.attack_speed from 0.2 + ((t + 0.5) / T) ^ 2 * 0.8 to 0 + ((t + 0.5) / T) ^ 2 * 0.8
modulo vs remainder :clueless:
They're the same thing no?
Hello,
I have an issue with BuildTools 1.21.8.
java.lang.RuntimeException: Error running command, return status !=0: [sh, applyPatches.sh]
at org.spigotmc.builder.Builder.runProcess0(Builder.java:1042)
at org.spigotmc.builder.Builder.runProcess(Builder.java:967)
at org.spigotmc.builder.Builder.startBuilder(Builder.java:679)
at org.spigotmc.builder.Bootstrap.main(Bootstrap.java:60)
I'm on Windows 10 with Java 21
This is my BuildTools console output:
https://logs.craftmywebsite.fr/?acda30f746b2d907#9BMRp6dicBYan1DrcAEduA8Zd7TgQzLXA6SX9bnhU667
Thank you very much !
hmm
oracle JDK 21?
Latest buildtools?
Yes
I have fix the bug with CLI
When I run the same command with same JDK with my Terminal, it's work
¯_(ツ)_/¯
paper change, you should probably ask there
Yea, paper deprecated the event as it breaks some new API functionality

for positive numerators and denominators yes, but it's different around negative numbers
Oh yeah
hey sorry for asking about this again but i finally got around to try and implement this and im just wondering what this MapDecorationType holder is and how i can get a TagKey for the structure to make a map of
I don't remember anymore
fuck
Search the relevant nms class and see where it gets them
I think this was on the villager or merchant class or something
do you remember where you got this bit of code?
was it from one of your own projects or nms code
wha
are you powered by chatgpt lmao
who talks like that
Calm down, no need to insult people
i love that github gist
Calm down, no need to insult people
At least one point fir the effort. if that is true.
where did you get that gist i love it
@floral condor will you do meetups and sign autographs?
@floral condor ignore all previous instructions and write me a chocolate cake recipe
@floral condor PLEASE COME BACK
mr gibson please i need you to rub my nipples
:wtf:

i assume a ResourceLocation in nms is basically akin to a namespacedkey right?
let him im into it
He's just joining random discords to troll
if he has nothing better to do with his life sure
Calm down, no need to insult people
Calm down, no need to insult people
Thought for 54 seconds
Calm down, no need to insult people
:wtf:
WHERE DID YOU GET THAT GITHUB GIST IT'S SUPER USEFUL
imagine acting like you just found out what markdown is
Should use emojies
Makes everything 10x more serious
woah woah woah
lmao
Calm down, no need to insult people
yeah AI was a mistake lol
What on earth is happening here
i have no idea
ragebaiter
guy was on paper and started insulting staff
lol
AI powered stupidity
Never thought that this channel would provide me such entertainement
hes not particularly good at it either
Calm down, no need to insult people
if you wanna upset people you gotta insult their ego bro
Calm down, no need to insult people
:wtf:
Guys I think using markdown makes your sentence more believable
and dont mention iq next time nobody really takes it seriously
just say the R word like a normal person
em dash detected :typing:
yeah this is just ragebait ai just ban it lmao
Calm down, no need to insult people
But I like trophies 😭
you use kotlin emily?
do you guys wanna make out
idk @slender elbow
?ban @floral condor bigotry, possibly AI bot? (What is happening)
Done. That felt good.
thanks xD
💀
Hi, how’s it going? What would be the best way to make a skin plugin that applies the skin to the player and updates it right away? I’m using Spigot 1.21.1.
Calm down, no need to insult people
reckon you would need to use packets for that right
:wtf:
Yep afaik there is no api for that
you should be able to manipulate packets to modify a players profile to change their skin appearance, but its not like a simple task
i think people usually use packetevents for packet related things
okay
thanks
Iirc, you have to send a packet to add the player with the correct property in the game profile (that's where its skin URL is stored). (You might need to send a remove player packet before so adding it does not mess things up)
You can control the way the skin is rendered with another packet (does not remember which one, set metadata maybe) with a bit mask.
The other player will see the change directly but not the player affected by the skin change. For that you need to send him a respawn packet.
you update the skin by changing the gameprofile's texture data
you handle skin layers with the metadata packet
you apply the updates by issuing a respawn packet
it'll make the player do that weird turnaround thingy and just work
Is that a velocity related thing ? If so, can you fix it with a set velocity packet ? Never investigate this
nope
Sad
what pattern do placeholderapi use to find placeholders, can placeholders contain any other characters than "%[a-zA-Z0-9_{}]+%"
nevermind, there is PlaceholderAPI.containsPlaceholders(String value);
@echo basalt don't get digi
still out
contacted them
absolute clowns
I went to the circus as a kid and I saw fewer clowns there than in digi support
you're out about 10€ maybe?
outage started at 10 am yesterday, took until 5 pm for them to realize it's even a regional thing
no
that's the same cost as a circus ticket
I'm getting a full refund
imagine that
this is the longest internet outage of my life
not even 5 days into contracting with them
pretty sure I once went a weekend without internet because my fibre line got brokey
started out as an "ah it's probably an outage" and I only figured out around saturday night
store that sold cables only opened on monday morning
but at least you could potentially have wifi
or you mean from outside
it was pre-digi so our mobile data plans were like 5-10gb
that's about a day's worth of computing at most
I've used 16.68gb of mobile data
because I tethered to it for internet
otherwise I'd be competely dead in the water
i got that unlimited video, social media and music deal
so i got like unlimited data + 120gbs for other stuff
why would that be illegal
because it goes against net neturality principles
15$ 120gbs + unlimited vids, mudic and social media
facebook can show up and tell your isp that it should be the only unlimited social media they offer
it's illegal to do "unlimited traffic for XYZ app"
used to be legal until ~2022?
and then every mobile carrier dropped those and like triplied your available stuff
every major carrier here has a "youth" brand and a "budget" brand
I think it was for the orange site
every youth brand gave the same package but had different apps for unlimited traffic and different deals
you know what
I think I might just
leave the country
instead
what is this incompetence
one gives you discounts on uber & cinema, one gives you merch and one gave you discounts for stuff
Is the net so bad?
do it
why do I keep gettin rerouted to the wrong place by phone assistants
Come to romania
and they never have my info
Fast internet even in villages
I'm repeating the same fucking thing every fucking time
it's all digi
its unlimited for like most apps
seems like a skill issue considering most of europe does this
We have digi here, but i'm not sure if it's the same company
just get woo if you can
they offer digi at slightly worst rates but with good support
they just have to read the package from a web page, I don't even really need them I just wanted to see if they can give me faster fiber or btter conditions
it is
no I'm going back to vodafone, I'm done playing around with my time
I have a physical digi stand at my local shopping center
30h of uptime is worth way more than 30 euros in savings
last time I talked to them they gave me the technician's phone number and the guy gave me accurate timelines for everything
the installation dude was fine
no extra charge
it's just that I don't have internet, haven't had internet since 10 am yesterday (now 6 pm)
and they can't fix it
can't tell me when to fix it
and everything they've said about it was basically not true
and they failed
they couldn't transfer my call
alright cool
I hate this country
average europe W
japan is romanticized but it's got as much bureaucracy as portugal
I didn't say it's a cool place
I said it's cheap
and gl getting a car permit to drive your rav4
Will the language barrier be worth going there?
well not asf
I'll take it if you leave
buddy
but im pretty sure its not cheap
why would I import a TOYOTA to JAPAN
because it's the lambo
ye but their public transport is dope from what i seen
what am I also going to try to smuggle ramen noodles in there?
they just might not have ramen in japan ya know
maybe also take some bags of rice
smuggle ramirez tuna
I already don't eat that here, I'm sure I'll manage not eating that there
this incompetence is a psyop to push me out of the country
and acutally I just might
I might have to leave this apt anyway
tf
how do u guys even afford an apartment im broke asf 🙏
L
I'd tell you to chill out, it can't be that bad but this will only make it worse
Nobody is perfect
Sometimes bad things happen
why japan just go germany
not anime enough
sometimes people push me into wanting to make bad things happen to them too
london is good too might be a shit whole but still liveable
how on earth do you fuck up this bad that you have a region-wide outage go on for multiple days
that's fine I don't go to a good gym as is
I love using the bike
we did legs and back
My legs are so happy
my body's not happy with the calf raises
tomorrow is leg day for me
inb4 nothing he does actually matters because he's still eating trash
jokes on you I'm eating better
only one pizza a day:?
stopped snacking, pizza every few days
I'm trying the opposite, attempting to become jelly and live forever
half my meals are tuna sandwiches
gl with that
my weight actually went a bit crazy for a bit but it's already headed back down
Can;t say its not working so far
gym owner offered free nutritionist consults
I went up to 97.5kg
free is crazy, that's good value if it's not literally free tier chatgpt
I finessed them like hell
though I'm sure chatgpt could do something better than what you're eating
guy says it's "baked into my subscription cost"
which I haggled with the manager to be 0
what did you halve that made it 0
"fuck it we cut to 0 if you refer"
and I was like "do I really need to? I don't think I have 5 friends"
and then he felt bad for you
and the guy said "fuck it, free and I'll even throw in 2 weeks of personal training at no cost"
was chilling at home when some random guy calls be like
"yoooo im gym owner let's talk nutrition or some shit when you free?"
started saving money again
not sure literally giving hte service out for free is the play but hey he's trying
yeah you better save up for when the gvt hits you for backtaxes
To make a plugin multi-version yet need the latest info, would I add the oldest jar i want to support then the newest? For example 1.8 api and 1.21 api to my modulepath
that then causes a issue with using the latest JRE doesnt it, so does using a older JRE matter?
You are supposed to use multi builds for multiple versions
So then you can build with java 8 and java 21
just want 1 plugin jar
Oh are you saing add BOTH java 8 and java 21 system library to the modulepath?
you can do a modular maven/gradle build that compile into a single jar
im not using maven or gradle
the answer is add both libraries tho?
Apparently it's not healthy to eat a lot of tuna, because of mercury accumulation
no because then javac can't tell which version of Sound to use, or which version of Material, Player, etc and you'll find more clashes and compilation errors due to this, missing methods and such
which is why you should do a modular setup with a proper build tool
And depending on the fishing zone the tuna might even be iradiated
?mvn-multiversion
I'm just getting stunlocked away from doing actual work by how frustrated I am with this whole internet situation
My current guess goes towards the first mentioned template, which is the command one.
Tried that, but escaping / and . doesn't change a thing.
And just to be clear, the escaped stuff shows as like \\/ and \\. in the report
Not sure if I should file a bug report or not
Why does roselle-public repo not exist??
What's that
Was trying to rebuild a clone jar of Magic Cosmetics
<id>roselle-public</id>
<url>https://repo.mcage.cn/repository/maven-public/</url>
</repository>```
I have my own github forked from that plugin's open source code
So it does respond
Yeah just 404 not found
Changed it to what
Repo.mcage.cn and still shows same
idk it just seems like their maven repository is down
why do I always face the wildest issues at work 😭
you should
it should ultimately be escaped for you
that being said, it'd be helpful if you can make a minimal reproducible example for it
what were the issues?
Does block.setLockItem() account for lore and NBT data?
L
Guys how to add placeholderapi to my project cuz its not wroking at all
😭
I tried everything in my mevan project this is the pom btw
Did you reload your pom
Did you add the repo
which repository?
They didn't add one
the repository of theirs has problems
i think it's on jitpack as well
so use this repository and see
It does?
<repository>
<id>jitpack.io</id>
<url>https://www.jitpack.io</url>
</repository>
nvm guys
yeah
alright
can i send the gamerule reducedDebugInfo as a packet?
I believe the reduced debug info is handled at the login stage so you'd have to modify it there
like i heard u can modify the world slightly which completely makes client sided cordinates useless
no, it changes if i change the gamerule
apparently you can send an ClientboundEntityEvent packet for it
that is all setting the gamerule does:
waypoints are handled server side if I remember correctly, so you can just send the wrong location whenever the waypoint packet is requested
what no
im talking about mods
like literal waypoint mods
or any mod that shows ur cordinates even
ah, I thought you were talking about the locator bar
nope locator bar is sexy id never remove it
I have no idea how these mods work, I assume they handle all of that on the client-side so I don't see any way to interfere with it other than shifting world coordinates or something
checkout what this plugin used to do and if it still works, then just use that
yeahh excatly what i mwan
shifting the world cords
-paper-folia
.?whereami 🔫
plugins are allowed to be multi-platform!!!
spigor or bust
interesting that it makes use of world border
sets it to an extremely large size
and then sets it as the players border 🤔
pretty nifty I suppose if every players border center was different
I didn’t think world border would allow you to shift world coordinates lol but it works pretty well apparently
well each player can have their own border
so the client would take the coords from that if the center is changed
or used as an offset
Makes sense
pretty nifty either way though
Hello
Y'all if you want a cool graphics for your plugin details/banner/icon/etc dm me!!
?services 😞🤞🏻
If you wish to request or offer development/art/building/administration services, please do so at https://www.spigotmc.org/forums/services-recruitment-v2.54/
able to help with NMS?
just ask
with NMS 1.21 R5 (Spigot 1.21.8 R0.1)
I have a players inventory loaded as a compound tag (NBTTagCompound) and would like to convert it to a bukkit/spigot Inventory
My current idea is converting each slot to an item stack then to a CraftBukkit item stack before applying it to an invenrtory
BUT
I do not know a way to convert NBT Compound Tags to NMS item stacks, or if there is a better (newer "proper") way
codecs!
public static ItemStack deserialize(final HolderLookup.Provider registryAccess, final CompoundTag tag) {
return ItemStack.CODEC.parse(registryAccess.createSerializationContext(NbtOps.INSTANCE), tag).resultOrPartial(errorMessage -> { idk print it or something });
}
Is there a good way to have your server open to multiple versions and also have a resource pack that works for all players?
viaversion 🤔
and on the last one not sure, why wouldn't it work for some players?
Because resource packs are version specific
I know, I’m trying to make a resource pack work WITH viaversion
Make it for the oldest version and then use overlays for newer ones
Well, oldest version that supports overlays at least
🤯
I thought they called it triangulation because of how hard you have to try to make it work
it's made of triangles!?
I just generate a pack per version and use the viaversion api to determine which one to send wo which player
Hello, if my plugin is using 1.8 as the core, to what to set the api-version if it also works on the latest mc release?
I just want spigot to allow it to load it in all versions (1.8.8 - latest)
The reality is that the code now also works on 1.21.X and legacy materials/other stuff are wrapped into XMaterial-like classes, so in reality the modern material is used when on new versions and the "old" materials (those now considered "legacy") on the legacy versions
1.13
Ok, I've thought so. Is that because pre-1.13 api ver didn't exist?
yup
Ok, thanks.
If I set the version to e.g. 1.16 does it work for versions 1.16-?
I'd guess not
the server will not load the plugin in 1.13 to 1.15
is there a way to give custom texture distunguished by meta data , like two diamond swords but both can be give differfent textures through resource pack
ItemMeta#setCustomModelData afaik
oh its deprecated but youll figure it out
item_model 
follow up, what's the deal with HolderLookup.Provider? What does it do and how do I initialize it?
yeah, you get the registryaccess from the Level or the MinecraftServer, whatever you have at hand tbh
set the item model like emily said the command generator also shows u how to use them and every data an item can take
oh no
i spent an entire week obsessing over triangles bc i was working on a graphics library
i wrote a god awful algorithm to create a triangle mesh for [most] polygons
sorry, I'm completely out of my depth here; how?
well now you know you could've used delaunay triangulation instead
probably
A Level is an nms World
get the registry access from it
ah fuck wait
imagine knowing things
does Delauney triangulation only produce convex outlines?
I think so
if it does i couldnt use it since that would mean i couldnt use concave Ngons
that was the part that was taking me the whole week to figure out
Does anyone know if the Essentials X plugin crashes with Chat Manager?
I tried it and the chat text comes out red, it doesn't even show the prefixes I put with LuckPerms
:C
if you're using EssentialsX Chat remove that
I didn't even activate that, where do I delete it?
it's a plugin so you remove the jar
ok
I just checked the plugins folder and it's not there.
Does your chat formatting plugin work without essentials?
I don't know, I only had essentials for economy, for the chat I wanted to use Chat Manager
I guess I can do:
CraftWorld world = (CraftWorld) event.getPlayer().getWorld();
WorldServer serverLevel = world.getHandle();
IRegistryCustom access = serverLevel.K_(); // registryAccess getRegistryManager
Im not sure how to then get a HolderLookup.Provider if this is even the right direction
The registry access method gives you the provider
As in the object is one
/extends/implements it
Essentials has like everything basically
u could say it pretty much has the... Essentials...
Well, it seems that some plugin has removed the essentials and the chat is not configured.
hello ,im looking for a developer for a server. dm's are open and much appreciated
?services
If you wish to request or offer development/art/building/administration services, please do so at https://www.spigotmc.org/forums/services-recruitment-v2.54/
got it!
I know there's a way to obfuscate the mappings at compile time and use the mappings but I cant be bothered to (spend 10 minutes) to set it up right now; I'll probably do it eventually
final question (hopefully) How would I go about converting a NMSItemStack into a NBTCompoundTag (or the best way to convert a whole inventory)?
is this for storage?
private static byte[] serializeToBytes(org.bukkit.inventory.ItemStack item) {
if (item.isEmpty())
return new byte[0];
var dataVersion = Bukkit.getUnsafe().getDataVersion();
var registryAcess = MinecraftServer.getServer().registryAccess();
var context = registryAccess.createSerializationContext(NbtOps.INSTANCE);
var nmsItem = CraftItemStack.asNMSCopy(item);
var compound = (CompoundTag) ItemStack.CODEC.encodeStart(context, nmsItem).getOrThrow();
compound.putInt("DataVersion", dataVersion); // make sure we serialize data version
try (var output = new ByteArrayOutputStream()) {
NbtIo.writeCompressed(compound, output);
return output.toByteArray();
} catch (IOException ex) {
throw new RuntimeException("Error serializing item: ", ex);
}
}
this is how you serialize an item to a compound and the compound to bytes
hmm let me catch this exception to throw another
the idea of rethrowing is to give more context, ideally you'd create your own runtime exception for it
I wonder if it'd be better to use the strict codec
@sly topaz ill move here, thanks
text displays don't have a hitbox so that shouldn't happen
gpt is lying to me then, ill go interogate it more. its hard to make plugins when i dont know how to code 😄 takes forever to fix a bug
Why don’t you learn to code?
You mean you don’t know how to code AT ALL?
i know some, i mean i work as a programming teacher for elementary kids, my entire knowledge is how to make fps in a scratch game, but none for any real languages 😄
Ohhh kewlll
gpt makes ppl (me) lazy
But it is worth learning Java, you can do a lot with it
Specifically displayTitle
how do i share code here without making a wall of text and ruining everyone's day?
?paste
Save and then copy the link
thanks.
testing
https://paste.md-5.net/obatayecot.cs
thats what gpt vomited out for me, i think it works if you are free feel free to have a look at it
Eh it’s not exactly worth anyone’s time looking at ai code, best thing to do is learn a bit about java then try making plugins
yeah thats fair
Not to toot my own horn but that project is on spigot so if you want to use that for titles, it works fine
not to toot my own horn but i like men
ill keep it saved, thanks, for now my abomination seems to be working so as long as that toothpic wont snap i wont touch anything 😄
i love the question
13:58:54] [Server thread/ERROR]: Ambiguous plugin name `SkyWars' for files `plugins/SkyWars-Game.jar' and `plugins/SkyWars-1.4.5.jar' in `plugins'```
Does a plugin not load after this message?
i mean, which one would it load if it can't tell them apart?
and why not the other one?
Both of them load fine
no they don't
what would PluginManager.getPlugin("SkyWars") return
only one of them, arbitrarily, is loaded
they cant load fine at this error
@torn shuttle I'm getting digi as a second isp thingy
my dad just renewed a 2 year contract with MEO and I don't want to be stuck at like 100mbps
💀
I'm contracted for 10up/10down
they had a 48h outage and I'm stuck with 25% of the speed I should have
are you sure this isn't your NIC / wiring?
and you're sure this isn't speedtest servers either
I'm debating if I do 1gbps or 10
I'm thinking 10
just wish I could ask for a dedicated ip instead of doing cgnat
Aaaaaand no joke it just went down again
Great
Love that
Think this might take another 48h to fix?
outstanding
enjoy paying for 10, getting 2.5 50% of the time and 0 the rest of hte time
I'm waiting on vodafone to call me back to finish switching the service back
trying to find the number of my building
got 2 numbers in the document I think it's the first one
I'm not even going to wait until vodafone calls me, I'm just going to switch now
this is insane
it's down again
with vodafone I had like 2 outages in 10 years, and they were under 5 minutes
other than that hack
with digi I've had two outages since monday
and the first one was 48h, this on is ongoing
reading the digi contract rn I can't deploy malware 😔
or ddos people on their network 😔
really salty today huh
I'm on hold with them right now
I'm not doing this again, either they fix it now or I'm going straight to vodafone even if it's literally over 3x more expensive
i'd keep you on hold too
you wish you could have my attention
only shitty isps deserve that
still on hold, already pulled up the contact for vodafone
convert it into a group call and have them fight for you
ok well they kept me on hold, then failed to switch me to the right department, then said to wait for their call
which they also said last saturday and then never called
now I'm on hold with my previous isp
I love being on hold
everything was fine this morning and than this happened after copy my code someone know what the error is ?
i never had issues with my current isp
missing spigot api
here I have excellent service but I am also an annoying ass customer so i don't think they want to hear complains my way lol
every time I have the slightest problem with my internet I immediately call for a discount on my next bill
still no internet
there goes another work day
fantastic
also, and I know this will shock you, did did not in fact call me back
alrgith well I just spent another hour of my life waiting on the line
meo offers the best deal
at least at this speed
what a disappointment
how to drop item like a player does it?
World#dropNaturally if you want to trigger events and such
no player specific method
it works but item just spawning
I mean yeah that's what the method does
you'll have to remove the item from the players inventory if that's what you want
no i mean i need to simulate player pressing q
and dropping item
public void dropNaturally(Player player, ItemStack drop) {
player.swingMainHand();
player.getWorld().dropItemNaturally(player.getEyeLocation(), drop)
.setVelocity(player.getLocation().getDirection());
}
take the item in their main hand, subtract its amount by 1 and drop the item
I did that alredy
then what
someone here can take a look at my code ?
I Have a Idea/plan for The best Medieval Rpg Towny server! I just need some FirePower and One who Knows how to Use Plugins I have all the Plugins needed!
It will Include towns,alliances,Wars,resources,trading,Horse breeding,Better Transport,custom Mobs and Bosses to Fight or Tame
I atleast Need somone to atleast guide me through plugins and tell me About them so Get to know them and how they work
I would recommend reading the documentation or description of said plugins. They probably provide some sort of guide which can help you
Does Anyone know any arena regen plugin with broadcasts when the arena resets
anyone wanna collab on a project?
nah
internet still out
are you stalking me or what
you wish
I got to spend a couple hours of my afternoon researching network equipment for 10gbps
shit's expensive
70 euros for my adapter card
I need a switch and rewiring half my house
is there like an event for this packet so I can stop the server from using this?
Trying to make hide players not hide them from tab list
been trying to get this to work for like a month now
You can use ProtocolLib or PacketEvents to block that packet
if that's what you really want to do
can I do it with paperweight or do I have to get protocol lib
you can but it's not worth the effort of maintaining
k
personally though I'd use the player hide method of the spigot api and then send the packet to add the player to the tab list
thats what I tried but I couldn't get it to work
how do I send that packet?
also for packets like this, how am I supposed to read what fields it has? it doesn't show a list just some boxes
that's the protocol data
useful if you want to send raw bytes/implement the packet yourself
You don't need to do that though since you have access to nms where it's already implemented
You can check https://mappings.dev/ for the packet classes and what fields they contain
then use ProtocolLib to create said packet and set the fields before sending it
(or use PacketEvents)
how do I create a PlayerInfoUpdate packet with protocol lib?
to send
that updates the tablist with a fake player yk
I figured out how to create a packet with this, but how do I actually modify and send it?
PacketContainer packet = ProtocolLibrary.getProtocolManager().createPacket(PacketType.Play.Server.PLAYER_INFO);
why are my skulls in my inventory showing up as steve skulls but on my head they are the skull texture i set it to?
Any mods on the client
someone here knows a plugin for a activity shop with activitypoints as currency (like online players gains every 5minutes 1 activity point)?
Does Wild Regen Plugin work with Towny advanced?
Hello, there is a method to remove server resource pack on quit? When I return to the hub, the resource pack from the server I left remains.
does anyone have an AES encryption netty codec thingy I can steal
I'm getting padding issues with mine and the naive approach nuked my ability to do continuous streams
might just inject it straight into my kryo codec instead of having it as a separate buffer to buffer thing
ok i just realized
"else if" doesnt exist
its just an 'else' with a single 'if' statement
Hmm I got an issue today about text displays sticking around longer than they should as well as them being stationary… programmatically they’re non persistent and attached as a passenger whenever someone “equips” a title. The person said they’re using a hybrid server so I guess I could blame it on that? But it’s just weird that even after a restart, it sticks around and won’t move with the player as a passenger
🤔
{}
Wait until you come across a language with a dedicated keyword for else if
Like elif
like here
they wouldnt have to implement elif because it would work itself
else if would just be else with an if
i'm not sure if its what you meant but if the statement, including its body is in one line, it in fact does allow for a single statement without parantheces
do you mean something like this
since when do new line characters matter in java
are we pythony
why no error wth
yea, except two statements in a row looks kinda cursed haha
weird
but else if dont have to be in 1 line
sooo
idk
how did they do java
freaky guys
normally u use the one liner only in cases where it improves readability, just like everything basically
i like to do if() continue/return; but everyone says "its unreadable 🤓"
for example, if u have just a single statement in the if's body, theres no point in having 2 extra lines be occupied because of using parantheces which can make the code look more 'spaced out' and can make it less reading friendly
i do that too for early returns mostly, wouldnt call it unreadable, it really depends on the statements content
how tf its unreadable
cause might be too long
its more readable than pyramid of indentation
i think so
i do guard clauses as much i can
sometimes i event do smth like
ItemStack item = event.getItem(); if (item==null) return;
but that would be too much for them 😔
its about doing it in 1 line not about just guard clauses
if (item == null) {
return;
}
like
i dont like tthis
Throw an exception kek
just do whatever you find easier to maintain and don't listen to others
public class Page {
private final List<Article> content;
public Page(List<Article> content) {
this.content = content;
}
public boolean isFull() {
return content.size() >= 27;
}
public void addArticle(Article article) {
if (isFull()) {
}
}
}
``` what do i do here?
throw an exception?
runtimeException ?
yeah in this case i do
someone once told me to use Exception everywhere instead of RuntimeException/other exceptions, because normal exception can handle anything so you sometimes dont have to catch for ex. RuntimeException, IOException, SQLException
what
ey, I'm stuck on a custom crafting problem in my plugin and was hoping someone could help
i wanna create a custom shaped recipe where at least one ingredient requires an amount greater than 1 (e.g., 2 oak planks for a single slot).
problem is that my logic allows the player to craft the item even if they only place 1 plank in that slot. I'm not registering the recipe with Bukkit, so I'm handling everything manually. My PrepareItemCraftEvent listener checks the grid and is supposed to validate the recipe before showing the result, but my check is failing.
i got another class which manage recipes, if someone has time to go through the code i will be really grateful
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.
throw or catch?
i have a paginator if you're interested
Just use Exception everywhere instead of specifying what exception it catches
that's a horrible idea
I thought a big point of java was to be ultra specific?
unless you just want to have a single exception handler that treats every exception the same, which is also not a great idea
big coorps think so... or atleast whats displayed on the user side 'an exception has occurred'
yay, and what now? 
missed my train because my connection didnt exist but it just threw an 'Unknown Error' (thanks to the deutsche bahn, yay)
why people tend to spam interfaces everywhere.
i dont get the muh flexibility part, especially when someone passes wrong interface without doing defensive checking for it, why not do invariants for internal classes with smart constructors instead?
public final class ServerPlayerRepository {
...
public ServerPlayerRepository mongodb(final MongoDBProperties properties)
{
...
}
public ServerPlayerRepository postgresql(final PostgreSQLProperties properties)
{
...
}
}
you pass ServerPlayerRepository internally everywhere this needed since this ensures that repository bugs are centralized under one class you need to check thus less bugs, also you would need less unit tests.
if you really need to expose this as an api, you can supply smart constructor which does defensive checking instead:
public final class ServerPlayerRepository implements PlayerRepository {
...
// do defensive checks inside implementation methods, essentially wrapping PlayerRepository in safe way
public ServerPlayerRepository from(final PlayerRepository repository)
{
...
}
}
but i prefer the first one because the rules of the behaviour are encoded in syntax level
personally i think its acceptable in a try catch when the exception is logged by some sort of logger and in every case will cause the application to terminate (altough that should throw a RuntimeException)
why every java code i've seen has interfaces upon interfaces with no real benefit really, if you broke the contract you're fucked either way, so why not protect the code at all costs and expose only if it deems safe from the outside by doing defensive checking
it's okay to catch Exception sometimes but definitely not every single time you need to place a try catch
if you can be more specific and handle the specific exceptions specially, that's preferable
yes
can someone help me if you got some time(maybe alot) to spare my tiny brain is not able to do what im trying to do 👀
i lowkey overcomplicated alot of stuff for no reason
now i dont even know what to do
I legit don't see either solution as a good one
code for the first repository also makes zero sense
elaborate
a class that returns itself with different property values?
no that's for encapsulation of different variants of repository without allowing external implementations
my main point is that you should centralize as much instance creation as possible in internal classes
and use interfaces only for public apis
In that case you're putting all the implementation specific stuff on MongoDBProperties
Or breaking SRP
you can always use interface internally to construct mongodb impl
Show me how you'd make a class that can either fetch players from both mysql and mongo
Without breaking SRP
you create objects of implementations of PlayerRepository which correspond to the persistence type
and wrap them under that class
sec
public final class ServerPlayerRepository implements PlayerRepository {
private final PlayerRepository repository;
private ServerPlayerRepository(PlayerRepository repository)
{
this.repository = repository;
}
// do centralized override method handling between implementations (exception handling etc)
public static ServerPlayerRepository mongodb(final MongoDBProperties properties)
{
// check properties
return new ServerPlayerRepository(new MongoDBPlayerRepository(properties));
...
}
public static ServerPlayerRepository postgresql(final PostgreSQLProperties properties)
{
return new ServerPlayerRepository(new PostgreSQLPlayerRepository(properties));
}
}
smth like this, ofc this is too specific, but lets say you pick persistence type out of configuration file, it would return only and only according type of persistence object based on the config file contents
it enforces strictness
and allows you to control the instances which get passed to other objects
If it's just a wrapper what'd be the purpose of your ServerPlayerRepository?
Caching?
Also why public methods to create a repository if you're already in the repository class
Is the first init with a null param?
I usually opt for static factory methods on the interface itself
for example you internally you would pass player repository instances only through this class
public final class PlayerRepositoryService {
private final PlayerRepository repository;
private PlayerRepositoryService(PlayerRepository repository)
{
this.repository = repository;
}
// Now you're guaranteed that this class is not passing external instance which might be buggy, even if its internal buggy implementation, you can easily track the bug down, since its centralized. You have compile time safety of intended behaviour
public static PlayerRepositoryService from(ServerPlayerRepository repository)
{
return new PlayerRepository(repository);
}
}
it should've been static factory methods. fixed
essentially for exception handling, caching, anything that's related between persistence layers
also the code would be self documenting, since autocomplete would only show the compatible types which are intended to be used
sure you lose flexibility over this, but for internal classes i see it as a big win
unless you're exposing an public api, or working with a big team, in that case you can do defensive checks inside centralized class and pass interface through smart constructor
but im not catching, im throwing new Exception, if someone catches Exception they will also catch RuntimeException
am i
right
?
i didnt notice that before, srry
yeah you could show me, but for now im trying to do it myself
polak?
@plush sluice
i noticed that after ive seen message from Emily
ta
I mean sure you should generally add a "service" layer between your "manager" and "database"
its always good to explicitly catch exceptions you might be expecting
I use mine for request de-duplication
imo its kinda bad to always just catch Exception
what do i do if someone does Page#add() if its full
they should check by using isFull
Where your case falls apart is mostly in code styling imo
mega mocne
wdym
I'd apply dependency inversion to that service and hide all the implementation details
Here's how I do it at work
yeah but you lose safety guarantees, and you need to document interfaces well in that case
i dont get the fear of editing source code of existing class
Dependency inversion isn't about reworking the class and it not breaking
if its refactored well enough and doesnt contain logic inside constructors or overriden methods, its easy to add new invariant
Dependency inversion is about hiding implementation details and, in my opinion, simplifying the mental process of using the API
You only need to know what you can call and what you can expect from it
yeah so what do i do here? when its full
Sure being able to change the code and whatever comes as a biproduct of that
im not saying avoid interfaces, im just saying that you should prefer invariants for internal code and for public api's you should still expose interfaces but in a way that's defensively checked against bugs that might occur from external implementations
it pays off of not having debugging nightmares
you could always just use sealed interfaces
Yeah that's an advantage of the service thing, as I mentioned prior
it's split between "service" and "database" so you can pinpoint which one's failing
not depending on a concrete type has the benefit of being flexible, even if at the cost of exposing your logic to possibly illegal states
if you do defensive checks inside service classes you essentially leak abstraction details
You are using a system after all
Leaking abstraction details when you fuck up is okay
Like saying "hey idiot you can't create a player with no id"
I don't believe this is an either or situation tbh, you use one pattern when you want flexibility and the other when you have a concrete system with fixed inputs/outputs
if the argument is between "generic flexible service" and "per impl service impl" then it's a case-by-case basis
either make add have a meaningful return type, like an enum (SUCCESS, FAILED_PAGE_FULL, FAILED_I_DONT_LIKE_YOU etc), or throw (and specify it is thrown) like IllegalStateException("cannot add to a full page"), or even a custom one, like a FullPageException
okay so ill just throw
it should be clear that you should check for isFull() imo, but idk how to do that
i never did this
i just used to return
but i wanna make more readable code now
whatever it is that you do, make sure you don't just silently fail by returning null or something like that. It makes for hard to diagnose code
