#help-development
1 messages · Page 1156 of 1
Good to see usage of guard clauses
Personal nitpick, a space behind each comma. (Just like in this sentence)
And I would not use Objects.requireNonNull like this, simply create variable, check if null, if null just return
Wish you good night then :D
Using requireNonNull will just mean you get an exception in the logs, which may confuse whoever is using the plugin into thinking there is a bug in it.
I will do that but did the IntelliJ suggestion at the time since I was in the middle of bug fixing an issue and forgot to revert it
Knew it most likely wouldn’t be the issue but no harm in trying
Sorry if this is a dumb question but I'm trying to figure out how to create a command, I know you can do it in the plugin.yml or whatever but I was wondering if there's a a way to register it differently
I'm new to Java development as a whole
There is, but plugin.yml is the only supported way I know of
Just do it there
Ok
And I would recommend first learning Java before making plugins
Yes sir
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! 🎉
Awesome thank you
I’m doing them both at once since Java on the most part is a reasonably simple language and I have used other programming languages in the past so it’s just substituting syntax basically
Ye it is much, much easier to learn a new language once you know one.
But if you're new to programming as a whole, def. start with pure java basics.
Yeah honestly if someone wants to learn a language I would recommend a really simple language just to get the basics and “programmer” thinking down
As that makes other languages way easier to learn then just throwing them in the deep end and making them demotivated and unhappy with the results
I don't mean to say "if you want to do programming, learn java"
Java promotes itself as a versatile language that can run on lots of different devices
Is there many things Java can do (not just easier but that cannot be done otherwise) than python?
Because I would assume python is available on most of the same devices as Java
is there any better way to delegate all existing functions inside class when declaring its value class wrapper
its kind of very bloaty to write all of them
especially with operators
as im implementing value class of a data type
Are you doing java ?
Valhalla is not out yet..
(I probably just don't know the thing you're talking about)
hi
some roleplay servers use item frames as atm gui interface and you can interact with buttons and text inputs and ...
and a couple of servers have very similar atm gui's which work in the exact same way. is there a famous plugin that i cant find or they just hired the same developer?
kotlin
does anyone know what it is?
The channel you put it in first was the right channel. Just google it... https://www.spigotmc.org/resources/itemframe-touchscreens-advancedgui.83636/
That explains everything lul
idk that :D
sry😅
How hard are sign shop plugins to make is it not just commands and then logic to process the information written in the sign?
quite various ways to do it. for me when the user places a sign I read the text on it and if it contains "shop" then write the proper values onto the sign. when another player clicks the sign read the text and check for "shop" and that it isnt the shop owner, check the price text etc
Also if I wanted to make a skyblock like server would it be best to incorporate everything into 1 plugin or to use multiple plugins?
Multiple plugins that are efficient. when a event is not run, those plugins will go idle and take up no resources. mixing some is fine, you do want to avoid as many duplicate events as possible
Yeah I was thinking something like top line is item name eg DIRT or END_CRYSTAL and quantity then the next line is BUY or SELL depending on what you want and then the third line can be price
Yes, I grab the block id from the sign
Or I could make a gui thank then gives you a custom nbt sign could I not that already has the writing and maybe even incorporate clicking on signs with a block to set the item to buy / sell
its really easy you just need to break it down in your mind
Yeah that’s what I thought
Also do you have much experience with nbt management
I was wondering on how to check an items nbt tags
Like for example I could give a stick a magic tag and when you right click a dirt block with it then it gets turned into a grass block
if you are going as far as being able to sell custom items with custom tags, you minus well save the itemstack, or when someone clicks the sign duplicate a item from the chest. I honestly blacklisted selling custom items in a chest shop since it is complex to ensure people are not scamming
I believe I can set nbt tags in a /give command
when using spigot its better to use pdc over direct nbt
pdc is stored in nbt
?pdc
But I don’t know how to edit them with plugins / read them atm
So maybe signshops / claiming plugins are my next steps as well as learning persistent data
And slowly working my way towards being able to recreate my old favourite economy skyblock that ran out of funds for me and my friends
I’ll also fully comment, open source and upload the finished projects once I know they are solid and I start making user friendly configs for them so that then other people can enjoy them as well
If you know basic programming with java/spigot, you could try describing your needs to chatgpt for a code example. its possible it could give you a idea of how its done. just keep in mind you do need to know stuff so you can read it over and make sure there arent any mistakes
I have tried that before but I learnt that I prefer fully understanding the logic behind each reason for doing stuff and sometimes chatGpt is good because it gives a baseline but it’s always trained off already made stuff so I prefer learning everything I need to go off an make anything even stuff that hasn’t been made before which chatgpt just can’t do
Ignore the text blob
I am not using proper grammar on my phone lol
If you properly prompt, you can get a full explanation and comments. gpt does not use premade code. it reads from the spigot api javadocs and quickly runs the code in the background to some extent before typing out the answer for you.
Basic summary:
I find chatGPT helpful in some scenarios but usually it causes more harm than help. It stops me learning from my mistakes and understanding what I did wrong so I’ll just make more in the future. It also is not creative and can only give ideas based off of already created things so original plugins with cool new features which are what people like to see. Nobody wants a clone of the most popular plugin with nothing new to offer.
it sounds like you used a older model. try 4o, current lol
It’s just that my ideas usually shy away from the already made plugins in unique ways and so if I ask chatGpt to make a plan it would likely go and use hypixel and other big skyblock servers as inspiration as these servers are the most popular and documented
Yeah I think I was using GPT3
Maybe it’s changed but I’ll see
I’ll feed it some prompts and see if I get anything good or that aligns with my plan
try again with 4o. you will get significantly better responses.
3 is a joke compared to 4
Alright
Also I just realised I have 863 messages to MEE6 as I use it as a notepad
Lol
paste your existing script in the chat box and ask away. might be surprised
Send links to docs useful resources and just random things that come to mind that I think would be cool before I forget them
oi thats a lot to go back to lol. i use a discord channel and delete the msg when im done
I can’t get the chatGPT app as my iOS is not new enough 💀
Apple keeps delaying the updates
It’ll be 3 years before I get the current update
do you own a pc? use the website XD, just be sure you are logged in tho, only way to use the latest model and sync chats between pc and mobile
Yeah on my phone rn tho powered it off as I’m gonna sleep soon
I think I’m logged in on the phone browser anyway
tbh avoid that. wait till you get on your pc, its going to give good stuff and you are going to want to get up and go do work XD. best have a clear mind
maybe its just me but when im in bed using it for code, i always have to ask again when i get on pc cuz i forget my thought process
Ooh actually another thing I haven’t looked at is making certain blocks allow special redstone interaction or something like being able to make quartz blocks have a gui when you right click them and set the block to while it has redstone going in to pulse every so often or maybe redetone rng where it gets a pulse and “randomly” chooses a strength output
Idk if that’s easily possible tho but that’s going in the notepad
Gui and saving the data might be the harder parts
depends on what you are saving and loading. guis are pretty easy, im aware of making those but i still ask gpt for the base of it lol. Be very specific in your requests
Learn about CustomBlockData here:
https://www.spigotmc.org/threads/custom-block-data-persistentdatacontainer-for-blocks.512422/
depends on what you are saving.
why are u recommending people to use ai
like I get it's useful, I use it too, but why is that the first thing
the answer is in the message. once you know how to program a bit by yourself, a assistant can be helpful, especially since its not just giving you a plain answer it is teaching you why it did what it did. to me I have gotten better at programming by seeing gpt break things down and make complex things more simple.
until it gives you misinformation or straight up hallucinates
lot less likely with the latest 4 model. but, this is why i clearly stated you must know how to program to use it. if you ask dumb questions you will get dumb answers.
idk I don't have experience with 4 since it's paid but I've seen it make up shit a lot
its free
it is not
just need to be logged in
go try
It has limited usage tho, no ?
it gives you a certain amount and resets
yeah
anyway idk why we're recommending people to use ai for learning
I used it to make me a plan and order to develop the plugins in
I’ll leave the features and coding fully up to myself
for free a certain amount of messages then it has a 2h cooldown. during that period it switches to model 3. I bypass that by just switching tabs in chrome to another acct. i definitely would not recommend bothering with 3, it does hallucinate sometimes. but 4o... quite impressive
I assume for a skyblock plugin it’s just making a new dimension where no blocks naturally generating and then creating the starting template they chose and allocating it to a spot in that other dimension and teleporting the player there
Then save the players uuid and the assigned positions to a file so you know where to teleport them and where to end their claimed land
And stop them building outside land they don’t have permission to
hm yea. ive had similar done but for random generated bedwars sky islands. gpt made the world generation. you can generate yml file for the uuid per player
to save just coordinates of their island? yml.
But I think I’ll store player data in one folder of saved data and island data in another but it would store coordinates permissions upgrades and settings in the island one so I feel like I should use json
yes, store the player data separate from the island data, that will reduce the file queries for one
what the heck is umm files
That’s what I was thinking since I will also integrate a discord bot to search the data
Files are things on your computer that store data
There are many different types
smh
I am asking what file type umm is
oh, I read that wrong, it might not be a file at all
Wdym I don’t really understand the question?
Give some context and I can probably help more
. what does umm stand for
Oh
That was autocorrect
It was meant to be yml
.yml
Lol no my phone just autocorrects everything and if I turn it off I end up with so many wrong letters in words it’s not worth it
Especially annoying with names of things and anagrams
Always autocorrects them
see, I also was the same
but then I figured that I write perfectly good english in my laptop, so what's really the issue? That I have fat fingers
so I just bought a bigger phone kek
I did that took some getting used to and then broke the screen 3 times in 2 weeks
I’m rather accident prone
Then after spending a total of $500 on screen repairs for a new phone screen I cut my losses and went back to my old one I’ve had for years and never broken the screen of
Still debating whether to repair the newer one to use or if I just repair and sell it
use screen protector or change your diet
I use a screen protector
Also I’m not that heavy
I’m 78kg
14% body fat percent last time I checked
idk, i gave you two options and the first one still failed
I am 55kg bro, I just got fat fingers because that's my disposition lol
Yeah I hit a hole and bounced off a seat about 1/8 of a metre and landed on it
The other time it fell out of my pocket and landed face down on a concrete floor as I turned around
it is just inevitable when you use your phone a lot
The third time it fell off my desk when my cat hit it and landed on the corner of a metal box
also the fact that one trusts pockets way too much
The funniest part is I didn’t even use it that much
12 hrs in 2 weeks
because its always broken
Real
The most annoying part is it looks perfectly fine
Not so much as a scratch in the screen
You power it on and it’s black and blue swirls
A single white line through a black screen
Or in the case of it landing on the metal box that one actually made a dent in the screen
Oh right I got distracted forgot this was a help channel
Should have switched to #general
Wdym variations like a creeper hiss or smth?
Or ambient sound?
?img
Can't send images? That's because you're not verified! Use !verify to complete verification.
Alternatively, you can upload screenshots to any image hosting site and share the link.
Here's some screenshot utilities that you can use to upload images.
Lightshot: https://prnt.sc
Imgur: https://imgur.com/upload
Flameshot: https://flameshot.org
Like an enderman teleport has two different sounds to it
mob/endermen/portal and mob/endermen/portal2
What is the issue? Are you unable to play them both?
I'm asking how because the variables in spigot are only pitch and volume
It will be a different sound thing or are you trying to make an entity play sounds
I’d have to take a look at the docs
I’m still very new to spigot / plugin development
World#playSound
Yes but how do I play the variations?
Because I have this player.playSound(player.getLocation(), Sound.ENTITY_ENDERMAN_TELEPORT, 10, 1);
But there is no option to play "variation 2"
Take my word with a grain of salt, but I believe you have to use an RP with custom defined sounds to do this.
Not sure why but whenever i teleport my player to a different world and set his gamemode to creative, MC sets it back to survival mode.
p.teleport(spawnLoc);
MAIN.getPlayerStateManager().setState(owner, PlayerState.EDITOR);
p.setGameMode(GameMode.CREATIVE);
genTerrain(voidWorld);
I designed a death system and when a player hits another player the lastdamager is added, but there is a problem
When a player hits someone in a closed area in pvp, when I look at the console, it shows a damage of 0.0002, which causes the lastdamager to be added. And when the player jumps down and dies, the kill is added to the person who last hit in the pvp indoor area. What can I do about this?
Could I somehow set a world's gamemode type maybe?
None of my own plugins functions mess with the gamemode
Other than this code I just sent
Is Mutiverse installed?
U can
Download Multiverse Core
yep
I forgot exactly though
Im also using it as a dependency in my plugin
It has settings for that
/mv modify It was something like that, I forgot the rest
Maybe I could force the gamemode from my code?
try the "do it a tick later" trick :D
trying this
My plugin creats void worlds for players so I couldnt do it without code rly
Would need to hire someone to just run the command all day long
You have to use a sound seed to play varients. player.playSound(player.getLocation(), Sound.ENTITY_ENDERMAN_TELEPORT, SoundCategory.HOSTILE, 1.0f, 1.0f, 7969269512298706254L);
Heres a sound seed list i found, youll need to use CTRL+F to search. https://raw.githubusercontent.com/Owen1212055/mc-sound-seeds/main/sound_seeds.json
Yea It worked, i just set the worlds gamemode to Creative using MVcore
Thanks
Do you want to automate? Like creating the world in a certain game mode
That is terryfing
Yeah I did that, I'm creating worlds rn and using mvcore to automatically modify the gamemode of the world
So what's the problem? I didn't understand, can you explain?
I got it fixed alrdy
this fixed it
IKR, i had to do it to play a specific cave sound lol
?paste
how would I go about finding out how minecraft's magic text source (obfuscated text) works? I wanna make a separate app that mimics this text effect but idk how it works
Check the client code
I'd recommend setting up a fabric dev env
okay, how does one "check the client code"
Create a fabric client mod, generate sources and go to the classes
mache client my beloved
Only good thing about mache is the satisfying feeling you get after rm -r
link?
alright I got the code, now I just to find the right class xD thanks for the help 👍
I'd prefer if you didn't look at my code tbh
Kinda an invasion of privacy
"stays winning"
Yeah I am winning
I actually use satellite over mache thoigj
For no other reason than I have it readily setup xD
Hi, I'm currently trying to move a packet based Armor_Stand using ProtocolLib in 1.20.4. When the player moves around (they are a passenger of the armor_stand and I'm detecting the STEER_VEHICLE packet), the current code I have creates the armor stand, places the player ontop of it, and I have checks for when they move & output it to the player, my issue is when calling the Server.ENTITY_VELOCITY packet, it doesn't change anything on the player's screen or any other player and I'm not sure how to go about fixing it.
This is my code so far:
Armor Stand Spawn: https://pastebin.com/2NTpp9uV
Player Vehicle Steer: https://pastebin.com/aTwhaRxj
Any help would be amazing
Why not send the link to that one gh repo
Is there a way to test bukkit plugins directly in the IDE? (I'm using eclipse)
Could try MockBukkit doesn't cover every case though
thanks
Now let's say I saved the players' exit point, but when I say /mvtp skypvp, how will I teleport back to the exit point?
I want the players to be born in the same world they came from
anyone know how work with item displays
cause im actualy tweaking out over i
im tryna set a rotation to face the player at a specified distance
but its like jumping about whenever I move my players pov around
yesterday you said you wanted it to face teh same direction the player was looking. Today you want it facing the player?
i mean i tried that but i got some mixed results
this was my code for handling the rotation of it
None of what I told you to do yesterday is implemented in that code
You have gone off on a wierd cross product mess
i did what u told me to do, but that ended badly cause it was just tweaking out
so i just tried like some random stuff to make it work
ima retry today tho
?paste
no need to rotate about Y if you are already calculating teh vector from direction
well thats a lie
you do need to rotate, but its not going to work as you expect
Your ItemDisplay is always at the players location,m just translated to a distance
when you rotate its going to rotate about the ItemDisplays center
I did some tweaking and this is what i got https://paste.md-5.net/kohovodafu.cs
sometimes the visible part of the model isn't 3 blocks away
but i got the angle down
Hello, how can switch my whole minecraft server project using spigot mappings 1.7.10 to searge mappings 1.7.10 ?
Good old find and replace
that will take a good amount of time 😂
thanks anyway
let's do that
Hello, I have a problem: Enderpearls don't work on my server because of Spigot, and I have BungeeCord. How can I fix this?
10+ year old versions aren't supported here
fabric should have tooling
figure it out yourself <3
pretty sad, anyway
didn't you have another project to do completely with mappings
I feel like its kinda sad you don't know this
I have the client part using searge mappings (is that what you meant ?)
me
and me
Hello, I have a problem: Enderpearls don't work on my server because of Spigot, and I have BungeeCord. How can I fix this?
CVN
?notworking
"Does not working" is a useless statement. Please describe what exactly is not working, what you expect it to do, and what actually happens. If you get any console errors, also ?paste the entire stacktrace.
oh, I didn't understand the question correctly
so you have 1 project, that atleast teaches you something valuable and take away nothing from it? wild ah shit
searge mappings
... are you... trying to write code using func_xxxxxx_x notation? Why? lol
Yeah and he still says 1.7.10 is the best version LOL
I wasn't doing the mapper part, it was raydan
Searge mappings are intermediary mappings
It's so fun though!
Well, I want to merge the client and the server part of my project to make a common base
w h a t
#help-server and make sure to test without plugins
there is common code between both, right ?
not sure
there is
Didn't rad make the tester mainly
the only problem is :
- server (spigot mappings / searge mappings available, currently using spigot)
- client (searge mappings available, using them)
I did nothing p much
yes i test
My bad, I misunderstood
By searge do you mean mcp

forgot about it
Voldemap
Ngl I'd rather use backported yarn
on both server and client ? could be interesting
Those who shall not be mapped
Lmao
Our little CVN group is doing mappings again, ah, fuck this life
yeah !!!
the good old time
so my model gets slightly offset when looking up heres my code
https://paste.md-5.net/izopaladur.cs
it gets offset towards the player when looking up (0 to -90 degrees pitch)
I wrote some concerningly unstable software back then
how might i fix the slight ofset caused by the display entity
yeahh, seems like it was the case
wait
!!rule8 😡
I'm using the spigot base
so using mcp to decompile the server part will not be good ?
wrong discord
^ bump
(shit I'm cooked)
it'd be fine for the non-manually renamed elements, you'd have to cross-match the mappings in order to get mcp+spigot
but I'll lose the spigot part, right ?
if you do that, you won't
I'd just use legacy-fabric's yarn port if I were you, though
I can run mcp on the produced spigot jar ?
That's probably the best way
Idk much about mcp actually
and I apply that to my server and client part, right ?
yes
for the server it would be more complex since you'd have to adapt the legacy-fabric tooling but there's no way around that
this search remember me of old times...
humm
It will works if the current code base was actually edited ?
because I've already done changes to client
The times when you yoinked a ton of intermediary mappings from elsewhere or something else?

exactly
btw, I always knew this page like that
MCP my behated 💔
what do you think of this ?
https://github.com/phase/MinecraftMappings/tree/master
and it's wrote in kotlin @blazing ocean 😎
you're aware that this is kind of massive work just to have a common module for your plugin right
I know
I don't get why you'd even want this
because it is fun
if they are aware that it is dumb, then go off sis
nah, maybe I'll not merge
if you say that it's a massive amount of work, I don't have time for it
Me when writing FIR manually
I would FUCKING LOVE if there was a way to run the FIR parser on a kotlin snippet and turn it to FIR
maybe
no one ?
what's it for
I think it's to remap from different mappings
https://github.com/Techcable/SuperSrg this exists too
Rust :o
🤢
what the flip
Why is it open in google docs
If we make a Days top statistic, I will record how many days the player has logged into the server every day and make a top 5 statistic, how should I calculate the day count to be correct
thanks, I'll check that too
but I need to find mappings i think
pick one time, probably utc+0 at midnight, then keep track of the people who logged in from that point until 24 hours have passed
and at the midnight point, reset the count
and then count all online players again to be sure
because that means they have played on 2 days technically
To calculate the number of days of entry, what if we take the size of each player's day set?
I'm having trouble making it working sadge
that's literally in the readme...
what is a day set
How is this method?
do you just care about when they log in or when they keep playing
just count the days they logged in
then this is fine
what does sqlite have to do with this
also
do you just wanna keep track of how many days they have logged in
or also specifically the dates they did
nevermid nevermind I chose this because it will contain many systems to saved xd
The only thing that matters is how many days they have logged into the server in total. For example, if they logged in on October 17, this is counted as 1 day
If they did not log in on October 18 and 19
and logged in on October 20
this is also counted as 1 day. And they would have participated for a total of 2 days
along side the total amount of days they logged in
since time does not go backwards, you only need the last login
or I guess you can also save the first login for fun
but p sure mojang also saved that information
its good
9226563f-1b48-38e41b2d1-b4b400e0b646:
first_join_date: '2024-10-18'
Hello! How to open an anvil inventory for a player? I have created it but when I try to do any actions with that inventory it sends me an error. As I understood because it can't find location of anvil. How could I fix this?
My error:
https://paste.md-5.net/erahalasuf.cs
I would recommend using https://github.com/WesJD/AnvilGUI
it was part of the teams prefix/suffix
guys
I shot myself in the foot with this wave function collapse system
turns out this really doesn't work with module units bigger than the base module
I am not a happy camper right now
man oh man oh man this absolutely sucks ass
WAAAA
Why is there a method for openWorkbench but none for any of the other gui. i tried to create a gui with a InventoryType but it appears they have no functionality except for crafting table
will try thanks
oh, someone else is requesting gui as well lol ^^
thats anvil tho, wheres one for cartography, loom, stonecutter...
Are you on latest?
Haven't gotten around to deprecating that stuff yet it's on its way out yet:3
wdym? they are removing workbench?
Nah that method will be deprecated though
See MenuType
?jd-s
oi thats dumb. is md_5 making those changes or mc? i feel like it would be way better to add the rest of the guis instead
The API is being replaced
replaced with
declaration: package: org.bukkit.inventory, interface: MenuType
I have a few more additions yet to be merged but thosell be coming post 1.21.2 release
is that in 1.8?
fancy however does that properly give the functionality? because i tried using InventoryView and it only opens a fake version of the gui
Is CraftInventoryAnvil a thing for 1.8.9?
No it doesn't idk what you're on about
Kekw
miles rewrite menutype in 1.8
1.8 can burn
yeah backport it
im on about the fact that openWorkbench exist which opens a functional gui. however you cant do that with cartography, loom, stonecutter etc. it only opens a fake version that deletes your items when you place it in
Oh those are real but they're based on a weird internals
It's kinda weird which is why they're being replaced
Use latest and reap the benefits of my work :P
does anyone know when a MapRenderer's render() method is getting called
I am trying some stuff out related to images
but as soon as I save my image on the server resource files, the map is updated in game
leading me to believe render is called a ton of times
is that true?
it's called pretty frequently but I'm not sure what that has to do with your question
actually I can just print in the render method
well I was just wondering if there is any trigger for it
or if its just periodically
it seems to just be like every 5 ticks when the map itself is present in the player's inventory
I guess I just answered my own question
thanks
is here any diferrence between serverPlayer.connection.connection.send() and serverPlayer.connection.send()?
I can't find ServerGamePacketListenerImpl#send on Linkie so where did you even get that from
I don't know it just exists
what type is serverPlayer.connection? ServerGamePacketListenerImpl?
because that does not have a send function
View mod dependencies; Search up mappings; All on your web browser instead!
but the method is from
oh yeah that's athing
of course it is, otherwise i wouldn't be able to send
its in the right hand sidebar
ah found it thx
Can someone somehow execute a command whilst they have an inventory open
what could be the problem? its a 300x300 png
with a mod, sure
public static void roundStart() {
for (Player attack : getTeams()[0]) {
attack.teleport(ATTACK_HAVEN);
attack.getInventory().clear();
}
for (Player defense : getTeams()[1]) {
defense.teleport(DEFENSE_HAVEN);
defense.getInventory().clear();
}
currentRound += 1;
}
public static Inventory getInventory() {
return INVENTORY;
}
it makes to close everyone's ui when one player close. how to fix it?
so you should probably stop opening the same inventory to everyone
that solved
if (attackWin >= 1) {
for (Player p : players) {
p.getInventory().clear();
p.teleport(new Location(Bukkit.getWorld("world"), -158, 95, 45));
if (isAttack(p)) {
p.sendTitle(ChatColor.AQUA + "승리", ChatColor.GRAY + "게임 종료 " + attackWin + " | " + defenseWin);
} else if (isDefense(p)) {
p.sendTitle(ChatColor.RED + "패배", ChatColor.GRAY + "게임 종료 " + defenseWin + " | " + attackWin);
}
}
} else if (defenseWin >= 1) {
for (Player p : players) {
p.getInventory().clear();
p.teleport(new Location(Bukkit.getWorld("world"), -158, 95, 45));
if (isAttack(p)) {
p.sendTitle(ChatColor.RED + "패배", ChatColor.GRAY + "게임 종료 " + attackWin + " | " + defenseWin);
} else if (isDefense(p)) {
p.sendTitle(ChatColor.AQUA + "승리", ChatColor.GRAY + "게임 종료 " + defenseWin + " | " + attackWin);
}
}
}
this code makes spectators not to do tp
how to fix it
anybody that understands crash reports and help me figure out why my server is crashing?
Guys, I'm preparing a day tops, I'll write it in hologram style, but I can't find the Api, is there any other method
Why is there Korean 😭
In the loop just check if player is in spectator mode.
ok i take back my words about kotlin
why compilation of kotlin in JVM is so shitty
also, for default implementations in interfaces instead of using default keyword, just like in java, it creates a static class with static methods which it calls if method is not overridden in the implementation of the interface? like wtf
i like the syntax of kotlin, but i feel like unless they develop their own implementation of virtual machine, it would just be as always a hack on top Java syntax oriented JVM
have you considered not everyone on the internet is from a western English speaking country
I am unsure, but it was probably easier that way
besides, it doesn't really affect performance in any way
if they remove the main method with no arguments, then they'd have to change all references to it from outside kotlin, which is just a mess
but this just shows that JVM is really not a solution for Kotlin in long-term
I don't understand how you came to that conclusion
as it has to be compliant with JVM's rules of first-class citizenship to Java's syntax
sure JVM bytecode is abstract and doesnt really describe the syntax
but the thing is that JVM features is tailored for Java programming language
and outside of the JVM, they have to comply with LLVM rules or whatever other compiler imposes
and modifications and additions to the JVM bytecode instruction set would only happen only if Java lang needs it, not Kotlin or Scala or Groovy
you're right in the sense that Java is the one first-class citizen in the JVM, however that means little in terms of language archquitecture
the point of it being in the JVM is that in the end, it all ends up reduced to JVM bytecode, and so the top-class garbage collectors as well as the JIT compilers at hand, as well as huge instrospection features for free and the whole set of APIs that the JDK provides. The whole point of languages like kotlin, scala, groovy or jruby even is to take advantage of that and provide better DX
I love compiled kotlin code!
yea that's what i was talking about. I think this is because in Kotlin default impl in interfaces are implemented using static methods instead of native default instruction
but there's a toggle to use native default support
sadly its not turned on by default
thus you get mess like this
anyone know why this prevents the packets from ever being sent and lags the server
the server receives packets from the client fine
delayed with the same code
its prob some infinite loop but i should be filtering out the delayed packets
I am preparing a top 3 list, for example, let's say the one with the most kills,
I want to write how many kills these players get with their skins, but the skin thing is confusing.
Are you able to turn off enchants showing up in lore for custom enchantments
What is the “correct” or standard method for multi-menu interfaces using inventories. Also, what is the “correct” way to add descriptions and custom names to itemstacks
are all plugins loaded by the same class loader? ( in spigot)
Is there any way of getting all players on server and then calling method as many times as how many players are on server, and for each player independently?
loop Bukkit.getOnlinePlayers
i would need a plugin that could generate plots (in the same world, not another world with only plots)
and i would need to be able to interact with that plugin from my plugin, remove players from plots, add them etc
i dont really know if that makes sense, what do you think, do you know such plugin? maybe plotsquared but idk
this helped a lot, even it was simple, thanks a lot!
but im afraid thats complicated for me to make these plots, this entire topic is complicated for me so i decided to ask
i need to call the method more times, because it's and random team generator, if i would call it only one time, i would add all players to only one time
you can randomly select players from the list without repeating with List class
i think they just want a foreach
hi, do you have idea how i can create a license for my plugin ?
or a for loop over the player list
this question might seem kind of wack, but im going insane about this.
So basically i've recently saw article about Parse, dont validate approach which is basically handling validation at compile-time instead of runtime, so i've decided to experiment and i have this simple interface:
interface Registry<I : Registry.Identifier<V>, V> {
fun register(data: V): I
fun unregister(identifier: I)
fun get(identifier: I)
interface Identifier<V> {}
}
in this interface, register function returns Registry.Identifier object, which allows you to retrieve the data you've passed to the registry earlier via get function.
class TileRegistry : Registry<TileRegistry.Identifier, Tile> {
override fun register(data: Tile): Identifier {
TODO("Not yet implemented")
}
override fun unregister(identifier: Identifier) {
TODO("Not yet implemented")
}
override fun get(identifier: Identifier) {
TODO("Not yet implemented")
}
@JvmInline
value class Identifier private constructor(val key: Int) : Registry.Identifier<Tile>
}
this is a skeleton of registry implementation class, which in theory would return TileRegistry.Identifier, which you would use on only TileRegistry concrete class to get Tile objects.
so this part is fine,** i can only access the object with identifiers i've retrieved by registering object in the registry. Neat. i dont need to check at runtime if the provided key exists, because code already ensures its not going to happen.**
the problem now is that i cant do proper polymorphism anymore. I can downcast this concrete class down to Registry<TileRegistry.Identifier, Tile> which really brings no benefit since im still using concrete type of Registry.Identifier or Registry<*, Tile> which allows you to register Tile objects to the registry, but not retrieve it.
So, is this a good case to depend your code on concrete implementation of registry, instead of interface, because DIP principle states that you should rely on abstractions and not on concrete classes, but this doesnt get into account the fact that in that case i lose the ability to check the values at compile-time?
NOTE: i've provided code in kotlin, but you should get the point. Its more of architecture question
probs nobody here would understand what i meant by this, but i've tried sadcat~1
sounds like overengineered drivel
if you need concrete classes, use them
if the downside of this system means that you have to work around it to great lengths, its simply not worth it
if you want to get registered tiles, ofc you would use the concrete tileregistry
unless you mean something else
at what point does something become abstract enough to be used by other things
if you make your tileregistry an interface and only have 1 implementation, does using this tile registry interface now suddenly mean its abstract
yes ik, im just battling myself in my own mind over and argument whether some things should have an interface or not 😄
i guess it perfectly fine to use concrete impl in this case
well they need an interface if you are gonna have multiple implementations or if its API for something else
nah
there's no multiple impls of same thing
right
so then you should use the tile registry as is
the registry itself is already abstracted as the way its meant to work is covered by your interface (somewhat)
i.e. the place that gets these registered tiles does not need to know how the registry works, just how to use it
Well i'd have to pass this registry to the instance of World2D class, so i would probably allow generics to pass the Registry as Registry<T, Tile> and then if i would need to expose call to the registry i would use T as a identifier for that registry to fetch the Tile
so the most straightforward approach is to just use that tile registry
what do you gain from this
that way i wouldnt tie the World2D implementation to only TileRegistry implementation
because there is gonna be another registry that registers Tiles?
No, i just want to make this code as modular as it can be
in perfect sense i want to reinvent minecraft's registries in a way for my own standalone code
okay
well imo that doesnt make any sense
its just adding more layers for no reason
if you ever need a different way of registering tiles than what tile registry does, you either can just make tile registry more abstract and have multiple implementations, or you need other methods which means you probably have to change world2d to account for those changes
if using a registry of T and Tile means you need to cast in your world2d class, then you gain nothing, if that's not the case, i guess it doesnt matter either way
thats like arguing if its better to create an ArrayList list = new ArrayList() or List list = new ArrayList() if you just return a List anyways
no, i wouldnt use T for denoting Registry, i would use T for denoting Registry.Identifier
which would allow me to pass any Registry to World2D which returns Tile
right
might be overengineered for now
so you can register tiles with diferent keys?
currently no
im looking for a way to open up all the classes for extensions of my application
idk what you mean by that
basically im making a headless game without any rendering stuff and i want to have multiple renderers which would instanciate game logic later
Tile object currently holds only the basic intial logic part of the game, but i might need to hold Tile data which holds texture data for the renderer, etc
that's why i want to pass different types of registries
eh forget about it
are the types static or dynamic?
wdym
are the types always known or are they unknown types because they can be anything
right but you can only have 1 type of registry at the same time I imagine
otherwise you would just make new variables for the other regitry types
i guess im overengineering it
yes, unless im missing some other benefit
but I think there is none
I usually design for the end use, not for the class itself, like in the end your world might have different tile registries sure, but they would probably either be separate registries altogether or your Tile object has all information possible about a tile, in which case you only need a single registry. and then you agree on some key to access those tiles with (in this case an int I guess looking at your example)
in both cases you really need this abstract way of referring to your tiles, because the world knows exactly what it wants
hello everyone, can you tell me if there is a way to create an inventory that will be displayed with a modified gui from optifine?
Something like that: Inventory inventory = Bukkit.createInventory(null, 36, "name");?
Hey,
When a chunk is loaded by a plugin (without a ticket)
how long will the chunk stay loaded assuming there are no players nearby?
does it unload again straightaway the next tick?
undefined
I don't see why not, as long the name matches
who the heck uses optifine custom GUIs tho
nowadays people use fonts instead to achieve that, though it isn't as straightforward, it doesn't depend on optifine being present
which most people don't use in modern versions anyway
if anything, you could add a monitor listener to the chunk load/unload events, and then compare how long it takes
I assume it is dynamic for the most part, as it may unload chunks depending on RAM or so I imagine, but you can still test it out
Yeah thats what im thinking likely determines when unload occurs, time for science 😄
is there something I must do for this to be published to my local
I'm trying to look at the spigot source
will read the contributing guide ig
do I have to run applyPatches if I already ran buildtools, I wonder
You probably don’t want to depend on the raw server
The fact I've been contributing to spigot for a year and never actually git cloned spigot is wild
Depend on spigot
I am not trying to depend on spigot, I'm not making a plugin
I just want to look at the spigot source
I could just look at craftbukkit but I assume spigot is the one source of truth
?stash
I mean the decompiled source lol
Spigot adds like nothing tbh it's not worth it
Most of it is in CraftBukkit
yeah but I want to make sure it is the same as the source that people are running
Highly Optimized Tick Loop
💀 the most performant spigot patch
there's also some chunk patches, and I'm trying to look at the chunk loading/unloading behavior in spigot so eh, counter-productive to just look at craftbukkit but it'll do I guess
What are you trying to do
I am trying to look at the spigot source, no more, no less
rather specifically, I am trying to see when Spigot decides it is time for chunks to unload
for context
pretty sure chunk tickets are a CB thing
tickets are a vanilla mechanism
yeah but I think its handled within CB not spigot
I don't ever remember it being under a Spigot interface
it isn't an issue of whether spigot handles it in the API or not, but I'm more worried that Spigot may unadvertely have a patch that changes this behavior, hence why I'd rather look at that source
I don't know if it is the case, and it sounds counter-productive to look at every single patch to make sure it doesn't when I don't even know what affects the behavior
only patch spigot has relating to chunks is this onehttps://hub.spigotmc.org/stash/projects/SPIGOT/repos/spigot/browse/CraftBukkit-Patches/0071-Allow-Reading-Old-Large-Chunks.patch
there's also the add unload frozen chunks option
look, my resource pack perfectly sees a chest with the name "AM"
, but it does not perceive the same chest, but it is called through the command
Probably differences in how the inventory name is encoded
Spigot does some strange things with legacy text -> components
does Interaction have a BoundingBox? If not, how do I create one for it?
It has a size
You should be able to easily create a box from the width and height of it
Assuming just getting the bounding box doesn’t get you the right size, which it might
If I wanted to send an action bar message, and have it with 0 fade in/out time, how would I go about that?
It-
Doesn't have
Fade in or out
It does tho
Action bar messages?
It has like 0.75s fade-out
And no fade in
Okay so it does have fade out
Yes
Otherwise you can cancel the fade out by sending a blank action bar just before it fades out
I think these are like 1.17/1.18/1.19+
Yeah
Was just about to suggest that
Okay, now my question. If I wanted to create a minigame where after each game the world should be reset to its primordial state, what would be the most efficient way of doing so?
Like there's a custom build
I'm sending specifically action bar messages through https://hub.spigotmc.org/javadocs/spigot/org/bukkit/entity/Player.Spigot.html#sendMessage(net.md_5.bungee.api.ChatMessageType,net.md_5.bungee.api.chat.BaseComponent)
declaration: package: org.bukkit.entity, interface: Player, class: Spigot
But after each game the world should come back to its original state
I'm more asking if NMS or Packets are my only options for sending them with a set fade out time (I want 0)
You could just have it not save
(if you are restarting to get it to reset the state)
Or probably just having a second world
Have the first world inaccessible with the map, make another world that copies the first one, and then just delete the second one and keep making new ones
(I have no idea if this is possible or efficient whatsoever, it's the first thing to my mind)
I figured it out btw, IntelliJ pulled me one by ignoring my MAVEN_USER_HOME env var and deciding to use whatever maven repository it wanted, after changing IJ settings it indexed it fine
Am not
You can send regular titles with the fade in, out, and the time they stay
So I guess just copying the files
Just not the rest of the title types
Not sure if bukkit has a supported way of dynamically erasing worlds
Time to skid multiverse core
How do you unload a world?
Bukkit#unloadWorld
I suppose you can send an empty title and subtitle either way timings to set the times
it is a sync operation so I wouldn't recommend doing it too much
Ahh
That's sad
Is it explicitly sync?
Yes
paper 👀
Like AsyncCatcher guarded
it is the same in Paper
But unloading a world is fast
sadge
Does it have smthg?
unloading is fine, loading is what causes troubles
Loading one is also fast if you have a fixed spawn location and disable spawn chunks
I recall paper having async chunk loading
eh, I wouldn't exactly call it fast, but it is good enough
might need to init it sync
Ohoh
I see
no
I remember optimizing my packet sending from 2ms to 0.01ms
I could build multiple empires in 4ms
it does, but the load logic forces sync loading, suppose it does it best to generate the worlds
is it really? I remember it being more of an insane number
Not if spawn chunks are disabled and spawn location is fixed
hence why people just avoid creating worlds dynamically, you don't want to freeze the server while players are playing
maybe it is just a myth now then, since I do remember people advicing against it even while disabling those things
How do you disable those?
WorldCreator#setKeepSpawnInMemory
Spawn location requires a custom chunk generator
Though if you are loading a pre made world it should already be set
This is the only option, it's a client side limit, thanks
What is the easiest way to make a circle that no mob can enter, but players can
use location distance
and check nearby chunks for entities and players from the world
That's to check if the mob is in the circle if I'm not mistaking
How do you avoid triggering PlayerInteractEvent when dropping an item from an open inventory?
yeah, if distance is higher than circle wanted, tp at border or apply a knock back vector
I have found that DropItemEvent occurs after that event (so I can't e.g. add the player to a map and check that map in PlayerInteractEvent to cancel the event).
dropping items don't trigger that
They do.
do you press q to drop?
Both pressing q or dragging the item outside of the inventory space and clicking trigger it.
are you using vanilla client?
just wait a sec, i'm testing
NW, I solved it
Can you estimate the location an entity was at 1 tick ago
no, you can blame silly mojang code
i think its to do with dropping an item causing your hand to swing or something
is this recent tho?
Cause i'm not even sure
all my plugins seems to work fine despite this
idk, been a thing at least as long as i remember
just want to double check
method 4, setting blocks in a datapalette, is still not doable via spigot's api right?
Is it possible for me to interact with modded blocks usiing a plugin. I'm making a mine regeneration plugin and want it to handle modded blocks too. This is on a hybrid arclight server. Just want calrification what is possible, Thanks.
no
Yes it's possible
How you do that though is entirely up to arclights implementation
Usually they just extend the material enum to contain modded blocks as well
Got it thanks so the Arclight API will also be needed
no one ever asks how am i 😔
well no one cares about that
real
How are you Banana?
well at least md5 doesn't need to ask who I am
check out my cool module generator
the rollback feature is really annoying to get right
fix the rails pls it hurts
actually it's not even really bugged I'm just doing a shortcut on the paste
I just need to unshortcut it
was looking into the nms way of writing data faster because the large pastes are stupid slow
@echo basalt told you
why make fancy debug system when you can spam sout?
lol
oh wait actually i just remembered i made something cool too
how would that work out here?
it wouldnt
is every hologram a slice of the dungeon or it's just a location in the chamber?
there's a text entity at the center of each module stating what the module is and its rotation, then at all borders of each module stating all the valid borders that it can have
as well as what the border is
peak debugging
ah nice
if the system is working correctly (and it currently does) every border shares a common tag
which is why they always appear in pairs
like here?
right now I'm working on a somewhat tricky implementation of the rollback for the wave function collapse because it is not practical to keep a paste history (you run out of memory insanely quickly) and nuking a cell and neighbor cells does not work when you're working with compound modules that are multiple modules in size
like here
also every module randomizes a color so you can tell them apart
you see west takes path as a tag and east takes path as a tag so that's correct
you have schems for everything, is it not efficient to just paste back visited chambers?
or is there information specific to the seed
but even then, you could just paste the seed changes
it's not seeded, and keeping any kind of history is going to result into instantly running out of memory when we're talking about millions of modules
that's potentially hundreds of millions of datapoints you'd keep in a history
what about block states and restoring just the damage?
wait, does this infinitely generates?
it generates up to a radius you can pick, mostly just limited by server memory
I'm trying to get the benchmark to be that you can generate 50 chunk radius on 4gb of ram
i still think loading schems from disk, and having a history of the schems names to restore chambers is the best idea
not familiar with your work tho
how many players are supposed to be in this?
since it's a radius the scaling get whacky
flyweight it then
Why do you need history
use ints
there's no target player count, the core metrics are trying to generate up to 50 radius with 4gb of ram in a reasonable timespan but pregenerated
you don't need history
also reverting history is incredibly tricky
say that I have a chunk problem at 100, 20, 100
last time history saw that chunk might've been 100k chunk generations ago
are we going to roll back 100k chunks to fix that?
it would never end
what's a chunk problem?
it's sort of hard to explain but let me see what I can do
imagine two 3x1x3 modules
imagine they are getting generated simultaneously, alternating between the two
then it turns out their corners overlap
in a simple approach this is unfixable, because the simple approach just causes all neighbors of that corner to regenerate
but since both modules are 3x1x3 that only deletes the edges and it will invariably try to generate the same thing
now to compound the issue imagine this is something that happens at the very corner of a very large gen
that basically guarantees that the modules will have potentially tens or hundreds of thousands of modules generate before the collision is detected
oh, so it's a fit all the pieces in a given space problem
assuming you even have the memory overhead to do something like this you're stilli n trouble because you might be undoing minutes worth of generation per collision, and collisions are extremely frequent when you're dealing with compound modules
that's basically wfc in a nutshell
maybe you can fix this with math
if i do Bukkit#getOnlinePlayers() inside of a runtasktimer will it update everytime?
the solution I currently have is an evolution of the simple solution, where I keep a map of the chunks and if a chunk fails to find a solution within X attempts it increases the radius of neighbors it erases around itself, and then keeps growing the radius until it works
Context?
send a packet every x ticks to all players but without creating multiple tasks
the tweak I want to do now is to instead of bruteforcing neighbors I am going to check every possible combination of the already generated neighbors with all of their viable alternatives for the chunks they're in and see if any given combination results in any viable module getting placed in the module that is impossible, and if not to immediately do the radius culling of neighbors
which should be significantly faster and more accurate
Yes it will have the players at the time you call it
I mean yeah, getOnlinePlayers will always return the online players and if you run it in a task it will always retrieve all players online and update
hey god md 5!!!
thxx!
ty!!
there's also the option of making chambers that have sealed of entrances
that doesn't fix it AND it's bad for gameplay
the problem is overlapping compound modules here
i know
but i guess it changes your chunk where no space is empty generator to a a to b path
oh yeah, i forgot this is pre generated
so a to b is boring
my solution to this i think is to first get the list of the bounding boxes of the schems, then simulate with the bouning boxes the possible combinations to fit in a given space
that wouldn't work
i wanna rewatch https://www.youtube.com/watch?v=48sCx-wBs34 now since it reminds of your problem
i love veritasium
there's just a lot behind this system
surprisingly also a lot of the stuff that is recommended as the fastest solution for this online is just patently wrong, like prioritizing the modules with fewest options
that really doesn't work well
center out is basically infinitely better
I do center out then fewest options in my order
though fewest options might work if you have a lot of flexible/dead space, especially if you're only working in 2d
yeah, but where's the fun in that
I mean I'm sure there's a legitimate use for it in games that require a 2d map
I'd do it
oh yeah
i'm thinking of playing enter the gungeon
it has a dungeon like system for 2d
altho the number of chambers as far as i know is like 15
pretty much constant
actual wfc use is rare in games
honestly it's not trivial to use it as someone who is trying to get this to work in a way that makes sense
it's not the easiest to develop and worse yet it's not all that easy to make the initial modules for it either
plus if you're doing what I'm doing and want compound modules... honestly I haven't seen anyone do it
but it introduces some real problems on the base system
it's hard, but i'm sure there's a way to do it
I mean, there is
my way of doing it already currently works
it's just too slow for my liking
https://www.procjam.com/tutorials/wfc/
I saw this the other day, generates based on a sample image
yeah I saw it as well, not to diss 2d but 3d and compound modules is just a world apart
see spelunky
also it's very easy to do it for a few tiles but I am aiming to pool from hundreds or thousands
seems reasonable
also it looks like I optimized the memory situation way more than I thought
I'm actually using something like 2-3 gb of ram for that radius of 50
that's actually real nice
good job 😄
yeah I had to get rid of like 10 iterations of caching strategies for this one
but if I'm this good on memory I might reintroduce a couple of critical ones
This is why my dungeon generator was based on the jigsaw system Mojang uses
🥱 boring
what is that exactly?
my dungeon generator will have wfc and blackjack and hookers
It’s just a system to generate branching paths
Place starting room, loop over each connection point and attach another room to it, loop over all connection points in that new room and attach rooms to them, etc
ohh, so basically what i was talking earlier about enter the gungeon
yeah that's the very basic way of doing it
I was thinking of doing something similar at the start
but this just seemed like way more fun
and tbh it is
Isn’t wave function collapse designed to work on a grid though
yep
So you won’t get fancy branches going in all different directions
😏
that's why you do compound modules
I mean even in this basic demo you can already see we're playing around with that
and this is very early stages
you can design any kind of branching and pathing you want so long as it is built on top of a 16x16x16 basis, but you can string as many of them along as you want
so it shouldn't be constraining the design of what you're doing
though obviously some design choices will ultimately make the generation a bit slower
did you really not make it 3d?
I mean yeah I'm sure that can generate dungeons alright, though it would make unique module design pretty hard
Algorithm?
it's basically the opposite approach from mine where I am trying to place modules together, where it seems like you're trying to do rooms first and then presumably fill them at the end
what does the final result look like?
I never built any actual rooms, so idk
lol
you built the floor
that'll require some work tho 😄
you can also picture me riding a yatch into the sunset
yacht in sunset sounds cool
Actually building things is hard smh
Server owners can build their own dungeons gosh, they don’t pay me to do it
I even have models for the bosses that will be in there
00:34:59 good lord
that 34 min 50 radius generation
well
mission complete on the memory, time to sacrifice some of that for caching
good math
Yeah that’s an earlier version
damn
I really need to switch out of worldedit I think
I swear it's leaking memory
It does on reloads
on mass pasting
Ah, not sure
