#dev-general
1 messages · Page 609 of 1
Hmm I think I'll just focus more on using DI instead of passing one dependency, as the main class and just using getters from there
I've actually overused it a lot
Okay so I have a class where I use the main dependency to get 3 other dependencies, but the class is only about 100 lines. So should I really pass all 3 dependencies through the constructor or just keep using the 3 getters?
What type of class is it
BRB need to eat :3
aight
My main class is a lot cleaner now https://paste.helpch.at/baqilepiki.java
oo
yeah
im backl
but like valdemar
I was thinking whilst enthusiastically eating
here are some reasons we avoid this class that is a dependency of every other class:
- It gets really hard to see what our classes really depend on
- It sometimes gets hard to reuse the code as that plugin instance always has to be passed
- (Harder to unit test)
lmao
Yeah this is the main reason why I dont like it
- It gets really hard to see what our classes really depend on
I guess 3 instances are better than the main class instance then, right?
yeah
like I can add you to a project I work on
if you want some sort of image how it might look without
https://i.imgur.com/djEIQbG.png 🤔 should I just renew it in jetbrains or wait for github dev pack to expire?
Jetbrains is a little better at keeping track of it than github
My JB license expired like 2 years before the gh did 
wait what
👀

ig ill just renew jetbrains license then 🥲
although i thought github required a renewal each year
lol
oh its every 2 years
whoops
ez 😌
now time to do the same with unity
nono i meant github
also
is unity still in dev pack
🥺
i can't find
D:
Yeah that's what I mean, github student expired 1 year after jb student for me
nvm
and re-apply on or after your expiration date.
For a uni course, we have to analyze an open source project. Explore the architecture (modules, what's communicating with what etc.)
Do you know any cool projects that would be fun to look into? I was thinking OBS / Open Broadcast Software could be interesting. Any other ideas?
ShareX is fine ig
Sending 1 packet with 1 player online every tick shouldn't cause lag right?
(Using ProtocolLib)
doubt it
the game sends many more packets to many more players in smaller timeframes
you'll be fineeee
How long did it take for other people to got copilot? Are they still doing pre-releases? Ive been on the waitlist since october and nothing
It’s causing lag already lol.
which packet you sending lol
if its a large ass packet then maybe
string = string.replace("\u00A7", "&"); // Replace § with &
string = argsRegex.matcher(string).replaceAll("%$1%");```
Is there any way to do these replacements without re-assigning the `string`?
StringBuilder?
Strings aren’t supposed to be mutable so I don’t see it being possible
You can possibly use reflection
is there a way to change the root directory for a server
so that i don't need to have the server jar in the same directory as the world files, configs, etc
Just change the startup command to the location of your jar.
yes
that
i was too slow ☹️
if you have a .bat file for ex it'd be bat java -jar folder/where/jar/is/server.jar and the file structure is ```
world/etc
plugins/etc
folder/
where/
jar/
is/
server.jar
im 99% sure that should work
thank you dkim, i was drawing a blank for a moment there
np 🥰
it's working for me right now
the working directory is where the server files will be created
you're good, no worries
My sincerest apologies, I hope I can be forgiven
i'll think about it
Is it bad form to create your own file systems in java? By that i mean actually implementing the FileSystem interface and stuff... I want to create paths from URI's(like referencing a jar online) and that seems to be the only way to do it
does java only let you specify memory limits with 2^x units like kb, mb, gb? or can it also use (10^3)^x units like kib, mib, gib
to follow that up, can kubernetes use something besides (10^3)^x units like kib, mib, gib 🥲
I'm fairly certain you can instantiate different kinds of FileSystem, I know you can e.g. have one pointing inside a zip file and traverse it with it
well i know you can do it, just wondering if it is a bad idea... I think for now im just gonna have my thing downloading the artifacts it needs to some temp directory just so everything doesnt get messy, but i kinda wanna look at it in the future
Why is it a bad idea?
I'm not saying to extend it and "create your own"
But get one
they dont have one implemented for my purposes 😦
They dont support http or https
as far as i can tell
shh
smh
hiii guys i need help.
i want to make a spawn.yml file on using a command /setspawn
ok
Hey
just finished confirguring food, farming, ores, and mob drops shop ;-; took 2 hrs smh
not even half way
Anyone that uses Nautilus is there a way to navigate folders in a terminal using cd and then open a gui directly in that folder?
so for example I open a terminal I do cd Downloads and then somehow do nautilus and it would open directly in Downloads and not in home?
ah
its literally just nautilus .
What's best for a portfolio, being a dev in a big freelancing team or a server with about 200 active players?
Former I’d say
Former?
why not both
I don't have the time for both at the same time
Above link is my message link with a scammer who looted away all my axies & funds from my Ronin Wallet by phishing. This profile is spamming everyone looting all their assets of Axie Infinity games players. Can we know the person behind these anyway? I complained at Ronin support team & also cyber crime portal. Pls help
guys does anyone know how to refresh scoreboard
Plz anyone can tell how can i add command on an playerEvent?
Hm?
?
It mean if player usr that command, so playerEvent get trigger
In this case i am using player damage event and also velocity event
Did u not understand or something else?
No, I do not, sorry
Ok, so can you tell me that, if player type /<command> he get knockback
?
Now did you understand?
Plz
kai
Yes
are you saying you want players to be able to toggle whether or not things happen to them after they run a command
No, like did u know clutch plugin?
Well it does that, just player type command and get knockback without damage. And he has to just clutch with blocks
I am new so i dont know things
so you want the player to be launched into the air when they run a command?
Ye
that's pretty straightforward
all you have to do is set the player's velocity to whatever you want it to be
by setting the y component of the velocity
no problem 👍
Are u dev?
i develop, yes
nice, keep at it
i took classes on java in high school
gg
and am now taking various programming and similar classes in uni
but i'm also teaching myself a lot of things to fill in the gaps
U pro
not yet but hopefully soon 🥲
U will
thanks lol
ivan = pro
if I have a method call inside an async scheduler
the method is processed by it?
or main thread?
if you call a method async, then the code in the method will also be ran async
I have a question for how bedwars plugins operate, do they have a single server per game, so the bedwars plugin only handles one game, or is it world based. and which one is better/easier/more efficient?
Smaller scale it’s done per world I would assume, and at a larger scale done per server
ivan is AI if you dont know btw
o.o
who told you
do you know about Hypixel?
They do make new servers for each game
but that's hypixel... with 80k-100k players on daily
yeah
yeah they do
pretty sure they posted dev blogs on their forums about this. so if you're willing to search you might find those interesting
I am building a network, and I am trying to make it as easy as possible to scale and contract the network
well you could just google hypixel dev blog # (# is a number) and you'll find quite a few of their blogs explaining a lot of interesting stuff
alright
damn. the old version of ivan was dumb af
Also, does Hypixel run their own fork of a spigot server?
or a least a custom version of minecraft?
a very very modified version yes
and a 1.7.10 version as well
dammit i told me to keep quiet about it
i've been looking into the same thing, the best way to scale dynamically is to use containers to deploy servers, then manage them with an orchestration tool like kubernetes
this will let you launch new minecraft instances across multiple physical machines and even into the cloud, all while keeping that layer hidden from the plugin perspective
theres also some special made minecraft server managers that use this stuff like pterodactyl panel i believe
https://i.imgur.com/XyCqQRq.png
suggestion: add this button to @ruby crater
whats the EnumParticle for 1.17.1
how
Seems to be automatically added to all verified public bots
Actually no need to be verified just public
Ah nvm it's not automatic, on the dev panel go to oauth2, on the authorization method do "in-app authorization"
Hey! Does anyone know how to load my plugin last, after all other plugins? I'm trying to create "server startup commands" plugin so when everything is loaded correctly, then plugin runs some commands.
Or maybe some event I could use...
Schedule a task, I think they are only run once the server is done loading
Ahhaa, nice, did not know such thing existed. Thank you!
Np
Can Github Copilot center a div?
Help me reach 2000 subscribers
I read ALL comments so tell me what I should do next, I'll try my best to make it happen :)
I asked Github Copilot if it will replace developers (𝘴𝘩𝘰𝘤𝘬𝘪𝘯𝘨):
https://www.youtube.com/watch?v=s-XGQOE8E1g&list=PL2MNP01WPojSi62YxOAZdZUf57wtPwPSp&index=2
𝙑𝙎 𝘾𝙤𝙙𝙚 𝙏𝙝𝙚𝙢𝙚
https://marketpl...
help
i need helo
someonepls
my mic aint workin when im on a call
but generallyt works
who do i tag?
@everyone
The 'everyone' mention is disabled so you can't annoy people.
?not-discord
Looking for discord support?
HelpChat is a Minecraft plugin and development support server and is not affiliated with discord in any way.
If you require support from discord, we recommend you to visit their official support website at https://support.discord.com
On this website, you can read their FAQs, or open a support ticket if necessary.
doesnt help
that's not a suggestion. that's telling you this is not discord support. if you want support from them you should probably contact them thru: https://support.discord.com
then wha ti s this
What premium plugins does HelpChat have/own?
none. Clip however has like 3 and then Glare has 2 of his own. (those 2 are admins here. they're not owned by helpchat tho). There's other community members that have premium plugins and use helpchat as a help server but those are not related with helpchat.
What r they?
AutoSell, DeluxeChat and EzRanksPro. He also used to have MineCrates but that one is not maintained anymore. hasn't been for 3 years now
and Glare has Guilds and VoteParty
DeluxeChat 
having issues with the chat. %player% or %player_name% placeholders are not working
i get the prefix and tag but not the playername, is anyone able to help?
?player
Player placeholder not working? If you are using a plugin which supports PlaceholderAPI, and the %player% placeholder doesn't work, then change it to %player_name% and download the player expansion.
Commands:
/papi ecloud download player
/papi reload
#placeholder-api in the future btw
it worked, thank you!
https://chrome.google.com/webstore/detail/octotree-github-code-tree/bkhaagjahfmjljalopjnoealnfndnagc
why does iij now know how to show the value of a constant in kotlin 🥲
and I like the final val 🤣
😌
There’s this guy on twitter who keeps arguing about how he wants to structure his API.
I told him to give it a rest…
hopefully he didn't get too graph-ic
@vagrant token Can you accept my friend request?
you are too sus bro your def imposter
ORIGINAL DRIP MADE BY Leonz https://youtu.be/grd-K33tOSM
ngl they be looking kinda fye with all that drip on 😳😲🤑
discord server: https://discord.gg/JMCh6Gb
Can packets be sent async?
actually maybe you do send packets sync
i'm not sure how mc packets work but if you expect any sort of response you shouldn't send them on the main thread
however if they're only sent in 1 direction and you dont want a reply you can send them sync
it probably doesn't matter much either way (if you dont need a response) tbh unless you're sending an inordinate amount of packets
It uses ProtocolLib if that makes a difference
The runnable seems to take up a lot of the tick in the timings report
try sending it async and see if it helps the timings
thats the best way to know for sure if you want to do that
Okay cool, thanks for the help
I might be mis-remembering this, but I heard async tasks don't show up on timings so I'm going to see if I am doing anything else dumb first
they likely won't since they don't run on the main thread
which is good as that also means they can't waste server tick time
Yeah
You won't be able to upload images here directly to avoid spam, so please use https://imgur.com/ to upload images/screenshots.
You can also use a screenshot service like gyazo or jinx and post those links here.
They’re queued to some netty thread iirc so basically synced somewhere else iirc
Hey... Has any one tried SSHJ or JSCH for SFTP Transfers?
Or something that works?




Used to annotate a constructor/factory parameter to indicate that returned object (X) will close the resource when X is closed.
basically something like uh a new InputStreamReader(in) or a new BufferedWriter(writer) etc, when you close those, in and writer are also closed
the idea of a main thread doesnt really exist once you get to that point
it's all async, just using the netty thread pool
hey
How much do you guys think would be a fair amount for a world generation plugin just to spawn flowers on the world surface?
Ping please
Opinions on this particle I made? It works similarly to how redstone dust does, where it can have any color you want.
It's not exactly a showcase, just looking for some feedback as I am not sure if maybe each frame should last less/more, or if the particle itself just doesnt look good idk
kinda looks like butterflies
anyone know how can i get the deluxechat thing?
looks fucking cool, I'm still discovering on how to do them 🙃
can any staff give me the role to deluxechat?
I mean I am using the fabric api
Yeah, probably also because for some reason frame 4 would play at the beginning of the animation which made it look weird
oh though it was using an rp, really cool tho
https://paste.helpch.at/orabigigam.java
Does it make sense that this causes lag?
With 3 people online
server lag or client lag?
because that's still a task that's gonna take at least a few milliseconds running multiple times every tick
you should be able to run it async
Successfully checked that user for new purchases!
yeah, assuming that doesn't work you need to link
and if you are linked, then wait for the next db update
Below is how long ago each plugin's buyers list were updated:
1d 10h 16m
14h 53m 52s
23h 27m 53s
102d 18h 6m
23h 27m 58s
1d 10h 16m
Server, I switched to async
Minecrates 102d lol
Is there a list anywhere of what dependencies Spigot/Paper expose to plugins? Like JDBC and stuff
not that I'm aware of but ij can show you
ooh how
go to the gradle tab
dependencies
then go to spigot
and you can expand spigot's dependency tree
oh, that'll only work for the api actually
looks like apache commons, gson, guava, and snakeyaml?
yeah that's what the api provides but I forgot there's more in the server jar
your best bet would be to look at the pom yourself
I don't think there's much else you can do
I lied
depend on spigot (nms) through maven local then you can use ij's dependency thing to see what it provides
Is this actually worth to do/use?
(Not the plugin, just the way it stores data since it is outdated)
not worth it
at that point just use a database
databases are also 'centralized' the way that claims to be, but they are indexed and can be traversed much much faster than straight files like that seems to use
Honestly I like the idea of this, having one place, my trouble comes down to if you wanted to reset a particicular plugin then you're kinda fucked, and as Ivan said you basically have a db for that "centralised" purpose
it's also making a bunch of really weird claims that i can't imagine are actually true
like it's purpose being 'to save storage space' - even though all it does is keep data in one file instead of spreading it across several - i guess you're saving inodes but not any significant amount
Yeah 😂 you aren't saving file space really
Just one less file
which is what, 1kb if that
yeah lmao
and any extremely marginal benefits you might see from the reduction in file count would be offset by all of the boilerplate data stored in this central system, like plugin namespaces in json being tracked for every individual player
Yeah 😂
Database you mean like mongo, MySQL etc?
This one also seems cool. Although it’s only flatfiles
What in the world
Yeah it will always be private, can’t be reassigned to public, duh /s
Is that in simplixstorage? Xd
Yeah it's in the screenshot in the page
lombok 🥲
wait what
bruh
I love that sometimes it's final Type other it's val, very consistent
is val a data type?
It's the same as var
But works on Java 8 cuz Lombok will just compile it to final Type
ah thats what you meant
Ah yeah xD
See I think flatfile works perfect for everything, only time I'd say use a db is if you want to display stats on your website
According to them, it’s enterprise level xd
Otherwise flatfile, sqlite etc works amazingly even for larger sites or servers
Or cross server stuff lol
ye aha
Couldn’t you still not use a database for cross server stuff?
Can’t you like, use websockets or something like that
technically yeah
Between servers
Yeah aha, redis pubsub is like websockets, allows you to send a message across
Oh k
then receive on other end for example
Ye you would receive it and store it in a flatfile in that server itself
https://twitter.com/levelsio this guy uses sqlite for everything and his sites make tons 😂 its comical because he doesn't stick to normal methods
🌍https://t.co/BjTozWBvme
🛰https://t.co/t5KKic3kUc
👩💻https://t.co/2LTtgB64fV
🧔https://t.co/0lBrLhXmCW
📕https://t.co/67GOdjMBIA
✈️https://t.co/igWjAuMrjv
💡https://t.co/5iD7kQcmiz
🤳https://t.co/C6agjljPZb
📈https://t.co/8X1ZnmVScM
🛬https://t.co/IvcMyYsZq1
#Bitcoin
92842
125899
Like he doesn't use autoscaling etc
So with websites you can set it up so it uses maybe little to no ram cpu etc, and then when more visitors come, it automatically adds more ram etc, until its no longer needed
But services like this often cost money, sometimes its more affordable if your site is inactive for half the day
hello, i need help with something shuld i jsut ask my question here or someone pm?
idk if im the correcet place even 😛
I like the concept, but I'd personally probably only apply that type of logic if I was building a custom server, because if only half your plugins convert, its pointless
yes
Uh, I dont think we are speaking about the same plugin
I wasnt speaking about coredata
Simplixstorage is the one that lets you store data in json, yaml and toml
what do you even want to do?
Uh, store data?
I am looking for a general purpose storage api
Found simplixstorage, which got my attention
I personally use sqlite whenever I can and it fits my needs
I would use it in most if not all my plugins.
LuckPerms for instance, uses H2 for flat storage (or.. yaml)
H2?
I dont know that one
H2 is free SQL database written in Java
So, I am better off using sqlite in your opinion?
Aka mysql too since they are almost the same
In terms of usage
SQLite is amazing if you dont need a database
if you want a lib for databases, there's HikariCP
Yeah this 100%, people underestimate sqlite
but for most apps its amazing
https://github.com/brettwooldridge/HikariCP https://github.com/brettwooldridge/HikariCP#popular-datasource-class-names
HikariCP + jOOQ
joooq]
exposed for java? Looks interesting
Yeah pretty similar
can any staff help me ? i dont have the deluxechat role
when have you purchased the plugin?
pass 24 hour
=check @round parcel
Successfully checked that user for new purchases!
there
thank you!
np
i need help
There is no time to wait! Ask your question @novel crystal!
my fish is not moving anymore when i came back from giving it a walk
give it mouth to gills resuscitation
Could not HEAD 'https://repo.mattstudios.me/artifactory/public/me/mattstudios/triumph-config/1.0.5-SNAPSHOT/maven-metadata.xml'. Received status code 521 from server

aw shit
use offline gradle
yeah, already did that
👍
hi
I relinked my spigotmc account, but I didn't get receive for the plugin role I purchased, what should I do?
what plugin did you purchase and when?
Could not get head? Happens bro
Stay strong
is JOOQ really that good? I'm doing some spicy database stuff soon and I was pondering what ORM to use
Yoooo golang got generics
finally
I can make an implementation of streams
so I don't have to use so many for loops
Weak
MC community dislike this comment
it's spicy! but you'll get the most advantages from it when the db is already settled/designed etc. For prototyping it kinda becomes an annoyance because you can't take full advantage of it
namely code gen
yeah, thoughts on Exposed?
idk never used it
recommendations of any kind then?
yeah lol
I've barely touched sql in java besides the jdbc api and jooq, but I'd trust the one made by hikari dude to be good lol
Exposed is nice if you're using Kotlin
I don't see myself moving out of jooq if i need to interface with db's from java again, lol
i'm also lazy to learn new technologies that are direct competitors with something I already use
lmao what is this!!! https://github.com/brettwooldridge/HikariJSON
maybe? 👀
btw note that it doesn't work with spigot (if you want to relocate)
🤷 but theres a github issue on it and i haven't gotten it to work either
🤷
ah it has to do with relocating Kotlin
oh
man using convention plugins for multi-project gradle setups feels so bigbrain and so tidy and clean
rather than whacky ass subprojects/allprojects configuration
what are those?
oh i think i remember u mentioning it before
but
i was too lazy to look further into it
hmm
it takes a tad bit to get used to it but it's so nice
you don't want to know how annoying it was
to not have streams
I had to have loops everywhere
filtering
and mapping
life is soo hard /s
yeah I'm hesitant about Go
it seems kinda cool but looks horribly ugly and annoying to write
@half harness apply for dev role when
i did months ago :(((((
Last time it was brought up piggy just said he had been lazy so IDK if he got started on them again or not
yeah he's been going through some apps lately
last week at least
piggy if you see this
if i put any repos on my app
dont look at those (and dont look at bedwars)
😃
xD
he went thru some yeah. accepted and rejected some.
just looked at https://github.com/dkim19375/MagicItems and realized I still have the bin folder
🥲 🥲
(dont look at that either)
ah, back when i didn't use kts
🤢
bin
@half harness I have question
Hello
Why use extension functions
like for
Event listeners
In spigot
I’m just curious
Oh
the story of my life
Such intriguing story
that 🥲
and
uhh i just do it to keep it more shorter
ex kt private fun BlockBreakEvent.onBreak() { player.sendMessage("Broke block at ${block.location}") } vs ```kt
private fun onBreak(event: BlockBreakEvent) {
event.player.sendMessage("Broke block at ${event.block.location}")
}
btw
by "that"
i meant
Ah
what blitz said
And then you also inline it?
Ah
i inline it
fun test() = something() this? or something else
Isn’t there an inline keyword?
i accidentally deleted the whole plugins folder from my test server 💀
o
💀
oh boy. that reminds me of when I've reset windows and forgot to push most projects to github
Similar to how lombok extension functions work
I think
Since they also get inlined
note: if you've got a copyToServer task in gradle, never run cleanCopyToServer
wdym
Basically to change the receiver of the function, reduces event. calls
Can also be done with onBreak(event: BlockBreakEvent) = with (event) {
wait is that a plugin
I think I did that and it didnt delete the other files, hmm
private fun onBreak(event: BlockBreakEvent) = event.let {
with(it) {
println("cool event: ${player.name}")
}
}
```\:)
I both love and hate it.
I don't know what other language to choose though, since I'm trying to write a discord bot that runs at a reasonable speed
what’s the point of with btw?
same reason that I do extension function
except that u use with if it's not a function
like
I used to use TS for all this, but it's just stupid how many layers of compilation and such that need to happen
ah
calls the function block with the given receiver
kotlin 🤩
It allows you to use this but as the given object
Oo
also ```kt
fun test() {
fun other() {
}
}
Well isn’t that a bit confusing tho?
Oh right
btw. if you want good documentation (when matt's not arownd bcz the reost of us are dumb), kotlinlang.org docs are pretty good
well
you can use this@outerFunction to clarify
🤷
Blitz good point
Ah yeah that’s nice
JVM is still not compiled unfortunately
I really mean it tho. that's what I do. if you literally google with Kotlin you will get this: https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/with.html which explains it pretty well + references other stuff to make sure you understand those as well
oh u mean machine code?
Got a commission and he demands the plugin to be written in kotlin because "performance" apparently
Maybe, but it is useful for stuff like
a.doA
a.doB
..
a.doX
a.doY
a.doZ
A good example imo would be spawning an armor stand amd then modify its properties (setVisible, serBase, setCustomName, setCustomNameVisible and other 10 methods)
That's what I meant by "Reasonable Speed"
wot
LMAOO
I think you'd be surprised how good the JVM is
I've been doing a lot of reading about optimizations and stuff in the hotspot jvm
It's probably better than Go in a lot of areas
i mean for a discord bot
how so?
Golang is compiled directly to machine code
So is code that runs frequently in the jvm
And that doesn't mean anything
yup, I know
I think it's safe to assume hotspot jvm is the single best JIT runtime environment
Brainfuck can be compiled to machine code and is still slow
well yes
It beats compiled languages often too
I should start taking advantage more often of the features kotlin has. At this point I could just use java and miss almost nothing.
yeah
Maybe a sign of

nah. I like kotlin
I very recently read an article comparing the performance of Go and Java, and Java won almost all of them due to runtime optimizations like lock elision with escape analysis
wild, java is about 6x faster with binary trees
2 things I have no idea what they mean
Yeah man
It's kind of crazy how good the JVM is
with, let, also, apply, use, run, all really cool but kinda only useful in certain places
I never thought it was that good but god damn
500 seconds vs like 1
python bruh
anyway, still worth learning go
yeah people REALLY undermine how good the jvm can really be
true
moral of the story is learn rust
https://benchmarksgame-team.pages.debian.net/benchmarksgame/fastest/go-rust.html
^ run is nice in combination with ?: and then a return
Yeah
recently I learned that some (not all, it depends on what is called) reflection operations will actually be optimized into generated compiled code (which is undoubtedly faster than any kind of reflection op) via interfaces, similar to that of method references
use is awesome for closable things, it's basically an auto try catch finally
Ye, very nice
My favorite feature is !! i love npes
if anything it's slower lol

it unsurprisingly beats java in every possible way
anyone has a map of miencraft legacy colors and their hex values please?
Mhm, delete object;
Google does
ty emily!!
I know but used like 3 different searches and couldn't find one
lol
I like that github mobile app has support for links to certain line(s) 🥲
believe me I got pretty good at googling. when I don't find anything on 3 whole google pages, something's wrong
minecraft wiki 🙃
yes. that
Is it possible to change spawner rates in a plugin? and not just in the bukkit.yml
And upgrade the rates, for specific spawners using PDC
I think I would in this case, to identify them and store their upgrades in the plugin. Since the spawners are upgradeable
Not sure how I would do it yet but yeah
Ye exactly
tho you would have to take those values and do something with them to upgrade the spawner speeds
Problem is that it needs to be compatible down to 1.8... And I hate just clean NBT
using reflection
It's a mess
pdc doesnt exist below 1.14
Oh wow yeah it also supports entities, nice
i dont think you even need to have them download the plugin
Yeah they've got a dependency in maven-public repo
SQL looks hard
currently in the process of learning how to use sqlite to store data and wow its complex
I've got a plugin that uses sqlite for reference if you want
Well an interface with MySQL and SQLite iirc
What is it you need to be able to do with SQL?
literally just to store a world,x,y,z location whenever the recorder makes an update
such as block break, piston event, etc
i was looking at core protect and how its done in that plugin and it has wid,x,y,z in one table and wid,worldname in another
So if you need to store X Y Z I would have them as separate columns
Quick glimpse on mobile this looks neat
Tyty
world | x | y | z |
thats how im storing them
in 4 seperate columns
not in one big string
Phew
I purchased Guilds. I didn't received role My spigot account already linked someone staff check?
Is it a good practice to close sql connection after ive finished the sqlite task i wanted to do
always
How long ago was it purchased?
i did it
but org.sqlite.SQLiteException: [SQLITE_BUSY] The database file is locked (database is locked)
which proceeds to lag the server to fuck
unless it's a one time thing, I wouldn't recommend you to close the connection, only do it on disable
closing/open connections are quite intensive
how do i check if the connection automatically closed itself?
Connection#isClosed
does sqlite ever close the connection?
🤷♂️
Anyone know of a similar mod to replay mod that is supported in 1.18.1 forge?
I purchased for yesterday
Should be good now.
hikaricp 😌
I don't think using a connection pool is any beneficial for sqlite as connecting to it locks the whole file for itself
Faaaairly sure
how would i go about running async select queries?
public boolean hasBeenBrokenBefore(World world,int x,int y,int z) {
if (world == null) {return false;}
PreparedStatement statement = prepareStatement("SELECT EXISTS (SELECT wid,x,y,z FROM fc_block WHERE wid = "+getWorldID(world.getName())+" AND x = "+x+" AND y = "+y+" AND z = "+z+")" );
try {
ResultSet rs = statement.executeQuery();
return rs.getBoolean(1);
} catch(Exception e) {
e.printStackTrace();
}
return false;
}
i want to run this async, wasnt sure if you could async select queries
as someone else said they couldnt get it to work
Right so what you really want is to be able to run that async, yet get the return value immediately on the method call
its not possible is it
No, to return the value immediately you need to wait until the query is finished
What you can do is issue a callback for when the value is available, and then do something with it
Easiest way is probably something like this
CompletableFuture.supplyAsync(() -> {
/* query */
}).thenAccept(value -> {
/* use value */
});
Keep in mind that by the time you process the value, the method you called all that from will have long exited
This isn't an issue if you're e.g. sending feedback, running command, those can be delayed without issues. But if you do need the value immediately e.g. in an event you want to cancel, you will either a) have to block until it's done, or b) use a cache and load things before they're used
i just needed a method to store what blocks have been broken before so i can figure out if to give skill xp or not
a cache?
Yes, a cache
basically a Map you use to pre-store values before you need them because querying for them is expensive etc
load the data from sqlite into memory and save them every so often and on plugin disable
PDC would be better right?
you cant use pdc on blocks that dont have tile entity data
^
im storing every block, every dirt, stone and gravel.
I mean you could store the data in the chunk PDC, but not in the block itself
That's a good solution nonetheless
I would go for Chunk PDC rather than HashMaps
i was thinking of having the data based on the chunk
thats true 😃
tho had no idea how to actually go about doing that
Also that's flawed, not the same as the actual persistence API, that's tied to the location rather than the block data itself (e.g. a chest or a sign which you can clone and transfer in creative)
originally i just had a hashset of locations, if the location was in the hashset then it was modified by a player, it was removed on if the block was made by a cobblegen for example
hmm..yeah...true...but for storing who placed the block it would be fine right?
it worked fine, only issue is i had no idea how to store it.
i dont care who placed the block, im not logging that
its specific for if it had be modified by a player
You need it to be persistent?
And boom there's your cache
between restarts
then y not JSON?
i tried gson, it was hell.
store the data of the set when you are shutting down the server...
i couldnt get json to work that was the issue
y lol?
gson is great
Try a file-system API something like SimplixStorage or any other lib...if you feel Gson is hard
Hi @quiet depot Did you know HikariJSON is a thing?
On Kotlin, Kotlin serialize works great for Json

so scrap using sqlite and use json?
For Java, I've used Moshi and Jackson. Both work not too bad as well
HikkariJSON!!! what is that?
I would prefer JSON Over SQLite if you are writing that much data
i literally only was to read and write worldname,x,y,z. thats it. if json is faster then sqlite then ill take it
hmm..thats cool...did he publish it?
For both cases I'd suggest loading in onEnable, saving in onDisable, use the Set anytime in-between and forget about the rest
I linked it earlier today, search from:me has:link
I wanna try it out, it's not like I really need hyperspeed json processing but still lol
he didn't publish it right? no repo or so..might need to include in the project itself
Oh you mean published in a maven repo, no clue
https://github.com/brettwooldridge/HikariJSON/issues/8
i don't think so...seems like he himself abandoned it
i had the idea of on chunk load query the database and load the data from those specific chunks into the hashset and then on chunk unload save the data from those same chunks
ofcourse ondisable save all the chunk data
maybe an async save here and there
chunk x | chunk y | relational x y z | world
so 6 columns
yeah...you could do that in chunk load event...but still if using SQL it would be still be a a resonable load to the server if the server has a decent player size
How can I send toast when a player logs into the server. For example, "TEST JOIN THE GAME"?
https://hub.spigotmc.org/javadocs/bukkit/org/bukkit/event/player/PlayerJoinEvent.html
Listen to the event and either set it as a welcome message or send a new message to the player
@nocturne remnant
How do I add an achievement toast?
Real chads use .txt
Fastest performance out there 🙅♂️ 🧢
real chads dont need databases
You'll need to create an advancement
It's quite a rabbit hole
True
Persistent data? Imagine
Temporary data? Real shit
I'd suggest looking for an API
that is definitely the opposite way to go, especially if your data is relational in any way
I think I’d much rather go with SQLite over JSON too, if I was having to write to it
Flatfile scales rather poorly in my experience, plus it's just nicer to be able to use any database engine
yeah, i misspoke, i kinda don't consider sqlite flatfile for some reason even though it objectively is
that and H2
Ahhh right
Yeah I agree then, JSON I wouldn’t use especially for lots of data
Or even worse still
Storing fuck tons in 1 file
yeah if you really want JSON, go Mongo at least
flatfile
Yeah
what is the definition
A flat… file piggy smh
sqllite is a file, .db
Jk
json is a file, .json
But is it flat
is one human readable?
Hello! Can anyone help me to get TPS?
This doesn't work: double[] tps = Bukkit.getServer().spigot().getTPS()
also it probably doesn't return an array
What's the difference between #development and #dev-general ?
But if he want to query each time a player placed a block and retrieve it then is it wise?
lol ok, thanks.
storing large amounts of data like that is absolutely a good idea to use SQL-based for the querying capabilities
looking through all that JSON is going to make you want to commit die
oo...then my understanding were wrong....
Or use the blocks PDC.
i thought it would take much larger resource to query request
that was my first suggestion
If they're making like a CoreProtect knockoff, would not be good to store it in PDC
to be fair, i have absolutely no idea what they're making
if i am not wrong...he just want to log whether the block is placed by a player or not
haha
but as emily suggest, it can sometimes clone data....
well if you want a list of all blocks placed by a player, it might be worth doing both
then you can tell if an individual block was, plus you have a queryable list as well
If you don't care who placed the block you can also just check if the block exists in the initial chunk generation.
.
Spot on then? Lol
oh pfft lol
oo..is there something like that?
I'm not 100% sure but yes I think something is possible.
remember the method name or so?
It wouldn't be just 1 method. You would have to write something to get the initial blocks from the chunk generation. If it's not in that list it was placed by a player.
Hanging out ... of course if you are considered a dev
🤓
No, that's #developer-chat
Cause you're not a dev 😉
Tell that to my 5 stars on my github repo 😎
by any chance you an Indian?
We got another one seeing stars. Take him to the asylum.
No chance
And you're not the first one asking lol
please help me
i have a plugin Leader Heads 3.1.8.3 And PlaceHolderApi 2.9.2, i create a hologram with top kills and deaths, but kill and deaths always stay in 0, i dont understand please help
#placeholder-api I'd say
what?
Ask there
No cap
Did you want one? Like are you asking for it?
yea it's rainy outside and his hair is getting wet
😩
Lol
Not the only thing getting wet
💯
The floor bruh the floor is getting wet chill out
I'm going to give my old laptop to my sister and need to purchase a new notebook as secondary device.
Its purpose will be software development, so it should be beefy enough to run Jetbrains software well (PHPStorm/WebStorm, DataGrip, etc.)
Should have 3+ hours battery life, 15" and not too chonky.
Any suggestions? Looking to spend less than $1000. Refurbished is fine too.
I'd say get a one with good CPU, any modern one should be beefy enough
oh no. I'd personally say get one without a CPU
I believe they want laptop suggestions xD. not what the laptop should contain
I said good
Laptop suggestions can vary
Maybe they don't like X
And want more of a Y
It's better to know what you should look for in it
There are a lot of laptop models that are beefy enough to run intellij
get the framework laptop
it's fancy, repairable, upgradable, albeit a bit expensive compared to the mass market laptops
you can get decent specs on it for ~1100 usd
yeah. but he said he has less than 1k
then he can get slightly less decent specs for 1k 🤷
do you need help unclogging a drain
peeling potatos, perhaps
Looking for discord support?
HelpChat is a Minecraft plugin and development support server and is not affiliated with discord in any way.
If you require support from discord, we recommend you to visit their official support website at https://support.discord.com
On this website, you can read their FAQs, or open a support ticket if necessary.
looks like you joined one too many l33t hacking servers
when you have a low budget, framework should not be a recommendation in my opinion. It is more expensive and he probably doesn't care about the modularity
1k is not a low budget
you can get a laptop that meets his criteria for less than half of that
but he said he mentioned he would like to spend under 1k. the cheapest prebuild from framework is 1k.
the diy starts at 750
I guess he could go DIY
He needs a laptop, not a pc
the framework laptop is a laptop
it is a laptop xD
you get the parts and put them together. framework is a modular laptop
i am using correct terms
Misread
just its a laptop
Yeah I know abt the framework laptop
insta banned
they're joking, we don't know. we're not discord
yeah like M0ii said its probably just a warning for now
as long as you are not actively participating in the 'cybercrime' the message mentioned you're probably safe
you're not... right?
sounds like a pyramid scheme
artin if you're this worried just talk to actual discord support like blitz said initially
as they said in that warning, you should be reporting and leaving. or just leaving.
