#help-development
1 messages · Page 799 of 1
I do understand you Dusk, I actually do
I thought utilizing screeching "think harder" is only used by teachers
Honestly it's hard to attempt to get you to understand when we're virtual and typing on keyboards with 4 people
it's difficult
sorry we couldn't help you
maybe try somewhere else
that's why most programmers learn it by try-it-and-see (you write code, figure out why it doesn't work, revise)
and by reading posted resources that attempt to explain a topic from top to bottom
for example, a disconnect we had here is that you asked about methods for each data type
we of course answered that you don't need them, because we thought you were asking about methods for each data column to write and read form the database
instead of from the object, which is very very standard Java. We weren't thinking about getters at all because that's just a common thing we write every day
well maybe that should be an indication
nice seeing how you are proud of that
considering its a simple sqllite issue ai chatbots should help
He doesn’t trust them
Cause they can’t use the 2nd law of thermodynamics
certified troll
Just saying my sql example earlier was entirely written by bing
if they can mess up with wikipedian definitions so badly
Bro
I am not going to use them for such stuff
here
ai is fine for trying to get explanations or code exaples to base on
this is 3 years old and honestly probably absolute trash
but it's code that (iirc) worked and is what you want
I mean yeah you resort to either copypaste ai/articles or ?learnjava
I wouldnt expect more from you
@compact haven He’s looking for more abstract implementations
wdym abstract implementation
I am on my phone and knows it can write properly, i vetted it slightly so it didn’t include more than needed nor was wrong.
Obviously i am taking the lazy approach
Base Database interface and then implemtations for each subsequent different database
wdym different database, different engines?
Well flatfiles etc.
Well what I sent has that
SQLHandler implements the StorageHandler, and JSONHandler implements StorageHandler
can i just
My bad only saw part of it lol
make connection manager, each class for table with getter setter and not use interfaces at all?
yep
That’s what we told you to do
^ our pseudo that I hand wrote on Discord and JanTuck asked Bing did not include interfaces at all
alg
hi! is there an event when player brushes sus sand and gravel? I want to avoid any timers that are required with interact event
well imillusion did use interfaces so I thought they are important
because that's honestly a concept you should understand before using databases
Brushes?
so search up in google "What are Java Interfaces and how to use them"
what do I even implement interfaces for in databases
like interface for each table manager
No, an interface for each storage medium
whats storage medium
so say you want to give server admins the choice of storing it in json, sqlite, mysql, or mongo db
yes, i want to create delayed task to convert normal gravel back to suspicious again
then you'd have an abstract management class that you interact with, then implementations of each ( json, sqlite, mysql, or mongo db) to write to those databases
What?
so my manager class would have to be abstract and I just extend it in main class?
look at what I sent, the ChatMacro link is probably easier to understand
go through the code and see how I use it
archeology stuff. Player brushes suspicious gravel, it converts to normal gravel after that. I want to set delayed task for converting that block to suspicious gravel again for other players
Didn’t even know brushes existed
Then probably no event other than mentioned
Hacker
is it possible to implement images in item/entity lore/names?
probably
um, thanks?
Try some shitty font schenanigans i guess
it's probably possible with font bullshit in resource packs
it's probably not easy. I personally never done it
why is it shitty and bullshit
Because you can't just give an image to the client to render in chat, in an item lore, etc
because you need negative space and custom font stuff with color and everything
you need to turn it into different unicode characters and make sure the client has a resource pack to render each unicode character
It’s just cancerous to do and extremely tedious so it’s shitty and bullshit
You can either add the full image to a font
Or you can build it pixel by pixel until the client crashes from the massive NBT tag
lel
that would just be a custom texture for a unicode font
is there a way to "dress up" hostile entities as players?
Oh my
yeah something like that
might be able to spawn a fake player and add the ai to it
I think that’s too advanced for you
like for instance you got citizens I think? for making player NPCs
^ but if you want to actually make aggressive zombies look like a player
you'd need to intercept render and movement packets, etc.
Citizens does have a nice API
and make them send player equivalent packets, or the packet with a fake player ID instead
I was thinking about making zombie invisible and just smashing fake player onto it
I dont think there is other way of making any entity retextured
There def is. But, yeah i won’t tell
you are like the most helpful person here
Thank you
lmao
I dont think I ever resolved a problem with your answer/explanation
Tells me a lot about you.
a lot of us can give great help or no help
nah no way it was great help of any kind 😭
oh we can give bad help too
My help is an acquired taste
normally first few messages get good help, depending on the reaction to the help or just general messages can then change the type type of help you get in the future
audacity to call me troll and then straight up saying "if we dont like you we can give you shitty help on purpose" xd
very professional attitude
guys what is this
The usual dusktaler moment
no1 is entitled to be "professional", but it is appreciated to keep the attitude reasonable
not sure why you find this surprising lol
sunday, 9pm, help-development
I decided to not tell him of a way i felt was too advanced for him and would result in a million questions in here instead of selfsearching online. This is based on the previous conversation about interfaces which took way more than a few hours to solve now
hey frost are you any good with quaternion rotations?
Yeah i mean obviously it’s been an ongoing issue
wouldn't say good per say but I understand it lol
I've got a problem
okay I didnt necessarily mean that I except professional help
I just figured out what's happening
we dont get paid to help here if we want to help we will if you have a bad attiude people just dont want to help
but giving bad/harmful help on purpose on a help channel? xd
He was talking to us and telling us to not dumb on you
I have basically a series of angles which are all rotating, and they are tied in a hierarchy. I need to make it so if i rotate the base angle, the child angles also rotate
not wanting to help =/= giving bad help on purpose, and I did say several times that if you dont want to help, then do not do it
its rare to get bad help which is lucky
thing is I got that to work but only "locally" i.e. it doesn't take the fact these angles are located in different spatial locations
ok so far that isn't difficult
I am aware that I should be using a matrix to combine these but uh
it's not going good chief
they are in different places?
I still dont get how to use interface because looks like I wont be needing it at all
yeah
if Im gonna just use sqlite
Of course
most people dont end up giving bad help it mostly happens with mega mega trolls
really we're talking about the basics of making a 3d model skeleton here
if you only have 1 storage type there isnt really a need for interfaces
ok that is what you meant they are in different places
I was thinking like large distances
if you have multiple different storage types interfaces would be needed
Idk how to prove to anyone that im not a troll so I just ignore it
not hat it would really matter
just sqlite and apparently one .db file with several tables and thats it
but the problem is that if I use "local" rotations these do not rotate correctly
because the x axis for one is the z axis for another one
correct
depending on where they are in space
so I am taking with this spiral, it should move the center, top and arms in the same direction in the same way?
well makes sense why I didnt get why i'd need interface in my case
cuz I dont need it
like what @compact haven said, if you give server admins the option to use json, mysql, sqlite, etc you would need interfaces to make writing the code easier
nobody is gonna be an admin
this is the debug model, this is for a systemic approach as you might imagine but it's a decent example of the problem
with my current approach one of the arms clips completely incorrectly because it sort of tumbles instead of raising up
you are going to have to develop some kind of object that tracks the relative to the other
do I need to make connection database manager class abstract?
its a great way to learn interfaces also great for public plugins
Do you expect people to build against the database connection for random DB's?
really it's just the bit where I take the existing euler angles of the parent and the bone and turn it into a bone angle rotated by the parent by the global coordinate system that I'm struggling with
Oh no alf
I am not going to make a single public plugin
idk what it means
i mean with abstract
I can just type extends
with non abstract
I need to make instance and shit
any idea frost?
abstract you also can't instantiate directly either
it really doesn't seem too complex, if you already know the angles that need to be rotated and how much, and you already have an object that tracks the relative positioning of one from the other, then I don't see where it is hard to just make the stuff move?
you also already have a coordinate system of the thing around it
I guess the hard part is mapping internal coords to external ones?
the real hard part is figuring out which part of this is actually bugged
it works almost entirely correctly
ah yeah, debugging part probably be hard lol
but it starts getting whacky when the parents are rotating
I was thinking it might be because I'm experincing a mismatch between rotation reference points
that could be a possibility
but the thing is it's really only happening to one axis which I'm having a hard time explaining
I don't know
I'm very tired
I think I'm done for today, this project is truly a curse
it's so close
I just want to be done with it
so I make insert and retrieve methods manually for each table in my database or can I scale it?
hard to say, possible there is some mis-step in the order of things happening where in some circumstance the calculation is performed wrong, only way to debug this would be to have it output to a file every step
managed to get confirmation just now by playing around with the model editor, it's a rotation reference point issue
didn't know you had a model editor lol
I need to figure out the math to rotate the bone's coordinates by the parent's rotation
the screenshots I sent are from the model editor I'm using, blockbench
this is it in mc
nice
yeah its hard to debug this from outside only because the way everything is supposed to rotate is really arbitrary in the sense it is really up to you how you want it to rotate based on the parent lol
it's really hard when the behavior is close and only messes up under specific scenarios
like if they did a twirl, there is no like standard in how the arms should move other then it should rotate with the body
pretty neat though you are doing this in MC
not that it makes it any easier
why does IJ force me to deal with unhandled SQL exception?
because sql exceptions have to be handled
sql can throw a few different exceptions depending on what you are doing. Lets say you don't have perms, sql will return an error for that, or if your query is incorrect
you wouldn't know this was the case unless sql exception was thrown
Checked exceptions they are called
how do I remake it so that it makes database if its not present?
wait nvm it works im getting different exception
I ask before writing everything to avoid getting banned from the Discord. Are you open-minded here? If I talk to you about Custom JAR, 1.8.8, bedwars1058, KB Hit, PvP, and Practice Server, will I get attacked or banned? I'm asking because I got banned from the Paper Discord for this.
SQLite driver creates one if the file is not present
There is no strict policy against any of those, but you will get quite a few annoyed comments from pretty much
any programming community if you ask for support on software from almost a decade ago.
check my message history and see that I havent got banned there at all
yeah they are quite open minded
Won't get banned but most people aren't willing to help if A. You aren't using spigot and B. Your using legacy plugins, or servers
you won't get banned
so you can be happy to know that 🙂
Use latest 😏
Mind sharing your jdbc url?
I forgor to use ) at the end of statement
k
wow that was cold
as for getting attacked, I don't know what you define as such, but there may be people who may tell you to stop using outdated software or to upgrade lol
Indeed, I had only asked if anyone knew of reliable custom JARs that do not lower the server TPS and are not viruses or backdoors, and they banned me.
you were kicked lol
what is Lombok getter and setter annotations?
to be fair, its not like discord notifies you which it was
so nothing bad if I dont use them?
😄
Lombok is an annotation processor. It generates code while you compile.
Stay far away from it until you mastered the basics.
@dry hazel
good even
saying it this way makes me wanna put @Getter and @Setter
I wont stop you from engaging even further into self-destructing behavior.
lmao for using one annotation?
problems with annotation processors like Lombok comes in the form of when it generates problems. It is problematic in debugging it since the code it adds is actually not present in the source
By "attacks," I mean they told me everything, such as games like Bedwars similar to those on Hypixel are in version 1.20.2, and so on.
Why?
i hope you can figure out to actually add lombok
We did not.
You can just store it as a string, or a specific json type in some databases
We said they were not on any version
please don't make stuff up, and move on. This isn't the place to bring up other servers, and you just brought 1.8 repeatedly without reason after being told its not supported
But generally if you are using json in sql you may be misusing SQL
they are explaining what they mean by attacks since I mentioned it
do I make retrieve and set for each database table?
Yes. Using lombok is a decision which has to be done very carefully as it will cripple you without a doubt
if you dont fully understand its strenghts and drawbacks.
@storm crystal
Imagine an alternate dimension where people got stuck on something even older than 1.8
Like what if it was 1.1
lol
The whole modding community in shambles

I think people still rock 1.7.10 for “pvp” reasons.
there is something older, just surprised more are not stuck on it from spigot 😛
I know @wet breach There was no real attacks other than telling him to stop using old versions etc.
Leaving that aside I have to write here or in another channel like #help-server to ask for information for when it concerns Jars, I wrote here to see if then I should not use PizzaSpigot as a base and create one myself
#help-server for server help
how to code so whenever my sword in minecraft gets a player kill it uogrades its sharpness level
Interact entities
what the heck is pizzaspigot?
If you want to create your custom jar, then this channel. Otherwise #help-server
Okay but what about entity displays
I remember seeing Armor Stands for the first time and getting so excited I forgot to use them until 1.17.
Oh wait :(
He doesn’t he wants to find one
Do anyone know how I can do so my custom sword gets a sharpness level each kill I get on a player?
listen to the EntityDeathEvent, get the killer if its not null, get the weapon, upgrade its enchantment level
not sure why its called pizzaspigot when they are a fork of paper
Did that fork even add anything XD
anyways, do note that any issues with forks we can't really help with here
can I make it in place where getters and setters are?
that fork doesn't seem to change anything
Spigot forks have wacky names
Thank you very much very kind, you know if it's hard to do it I'm a Full-Stack but I haven't developed something that big yet
At least it isn’t $300
that fork is just a copy of the Paper repo 3 years ago, lol
? Ur question does not make sense
Is there somewhere I can find code like that? Because I can’t really code in Java tbh
True I guess
If you can't code in java this isn't the right channel
Tho I don't see any added commits XD
It doesnot
Does it remove any
Idk
make playerstatsretrieve and playerstatsget
Mobile client is ass
Naive approach:
- Listen to the EntityDeathEvent
- Check if deceased entity is Player
- Get killer from deceased
- Get his weapon
- Upgrade it
Why is this naive?
Players get rewarded a kill, even if the last damage source was environmental like lave, drowning or falldamage.
This approach wont account for indirect kills. Only for lasthits.
yes, the one that fixed log4j for 1.8
True no I know but in many servers I saw the one in F3 I mean the BedWars ones in other TacoSpigot only MozzarellaSpigot is missing 😄 PS: I am Italian
No you do not
so that fork doesn't even have the log4j fix, thats concerning
why
Good fork
Run 1.8
so you collecting fork versions that relate to food?
Cause PlayerStats should not handle how to insert and select from the database
time to use log4j exploit to forcefully upgrade the server to latest
Ah good that one really killed the tps
That’s be funny leave em a little note too
so what do I use it for
shame so many servers are insecure
And should do
Good
If you really have to run 1.8, at least use something like PandaSpigot that is maintained
No I'm just looking for the best base from which to make my own Jar 1.8.8 for PvP or buy one already made
the best one to use as a base would be spigot itself
since its official and isn't touched by others doing who knows what
Why do you hate urself lynx
Does it cost $300
Make it $500.
For factions
Does it have async daylight cycle?
Obviously it pulls from folia
Async itemstacks
Oh wow
To understand I only developed a plugin that I never released based initially on Paper api then I saw how much they expressly sucked and I switched to spigot ones and I had 0 problems because of those api it took me 2 years and I initially thought it was me sucking at programming then in the end it was their very limited API I couldn't do anything with it
Speaking of Folia… does that support plugins yet?
Yes
It just breaks a lot of em
I don’t know.
Yes you need to adapt stuff for folia
Sure, if you write them 🙂
Yeah you gotta explicitly mark them supported as well
technically still does
Just asm plugins to patch their runnables
It was written in present tense wasn’t it?
Smh
I read it the opposite
¯_(ツ)_/¯
It happens, i misread stuff all the time
Patient journals. Oh ur a man? Woman walks in /s
Had a trans man the other day. I was unsure which gender they were cause of some journal notes
Confused me
Are there any resources to getting started with plugin dev?
Google probably has a ton
Lol never really thought much on this. This must suck for the medical side
Luckily just psych clinicals. But yesh it can suck a bit
Most of them won’t mind if you ask. Unless they’re the “twitter” kind of person.
Didn’t need to ask after meeting them
I think if I was working medical the scenario I would hate would be the intake, because they would clearly mark the gender they are not and then your expectations are wildly inaccurate
Oh that’s true, but i think most will say biological gender nowadays on the forms if they are given any
not in the US
well in some states it just says gender and they can't get upset because in some states they have laws that allow them to specify the other gender XD
We get their social security number too, sadly that can be changed as well
No social security number doesn't change fortunately
Ours doesn’t change usually
the only acceptable excecption is identity fraud but their new number still points to the old one
Ours does not
Atleast we don’t get access to that
The person in question had half his journal missing cause it was on the other identity number
nice
maybe anyone know what has changed with ComponentBuilder on 1.20.2? My item tooltips in chat just stopped working, without any errors or even warnings
is that okay?
cb.event(new HoverEvent(HoverEvent.Action.SHOW_ITEM, new Item(item.getType().getKey().toString(), 1, ItemTag.ofNbt(item.getItemMeta().getAsString()))));
Sure
what does folia change in terms of development
Scheduling works differently and interactions between tick regions need to be synchronized
Probably also some stuff when interacting with the world
is it worth switching to it
Really depends on your use case. I would only use it with 100% hand tailored plugins from yourself
and with a good reason for needing tick regions.
pretty sure many recommended this of you
Yeah...
But dusk is a bit truculent when it comes to suggestions
just because something else may be better, doesn't necessarily mean it is easier
and configs in your situation would be fine anyways
like a survival server with custom mobs, dungegons and such
?
u need to give the player uuid and such
no one plays with chat components? I have this code for making [item] in chat, and it just refuses to work on 1.20.2, but worked flawlessly on 1.20.1:
cb.append(Util.colors("&7"), ComponentBuilder.FormatRetention.FORMATTING);
cb.event(new HoverEvent(HoverEvent.Action.SHOW_ITEM, new Item(item.getType().getKey().toString(), 1, ItemTag.ofNbt(item.getItemMeta().getAsString()))));
if (itemMeta != null && itemMeta.hasDisplayName()) {
cb.appendLegacy("§8[§7" + itemMeta.getDisplayName() + qty + "§8]");
} else {
cb.appendLegacy("§8[§7");
cb.append(new TranslatableComponent(item.getTranslationKey()));
cb.appendLegacy(qty + "§8]§f");
}```
what are you even asking
Don’t
I literally need it
No you do not
u do +1
You should have locally cached them in your handler
Then you locally fetch the cached object
And add one
On shutdown or a scheduled task you save the dirty stats and that’s that
Does anyone know where to start to create your own jar based on Spigot
?buildtools
Just check out the version u need
1.8.8?
Yes
?
Maps
Cache ur retrived values on join
Usually it's possible to run it with Java 17, usually h ow I saw on GitHub custom jars that all have .sh and .patch files in fact I was expecting that
Where it makes sense
You can edit that after checking it out
You need to define a scope for your data. The lifecycle.
When does your data need to live, when can it get written back to rest.
In your case, the lifecycle is bound to a players session.
This means you load the data, once a player joins, and unload it when he quits.
(Periodically saving everything every few min. is a good practice)
Now what does loading and saving mean in your case?
The default approach is the following:
- Write a manager class
- This manager class contains a
Map<UUID, YourData>where it maps players UUID to your data - Player joins: You load from DB into your manager
- Player quits: You remove from manager and save back to DB
Here is a more in-depth guide for data in general
https://www.spigotmc.org/threads/working-with-data.562421/
Lets see him chew on getting the basic loading/saving done.
Suggesting a scheduled task for saving is a finish move that needs to be prepared. 
how do I access playerStats from this
What does "this" refer to?
#get
I got lost
A data map is usually managed by a manager.
I already have like 3 managers that doesnt help
Cant have enough of them 🙂
you need a key to access the value of a map
the thing is that
would a repository class be good for this
PlayerStats literally has UUID in it
?
since then you need to conjure one out thin air
work with what you got
you only have the player quit event at that point
What type of designer pattern do you guys recommend for GSON. Here's my problem:
I want a JsonParser (this class name is already taken by GSON) with static methods, but you can register your own parsers to it anywhere you want and parse stuff too. Should I use a singleton, make everything static, or?
barely anything helps
Why do you need a JsonParser if Gson already has one?
It does
He told you in your scope you only really have the playerdeathevent
it has limited parsing abilitites
Now extract a uuid from that
Basically im using GSON still but I want to make a wrapper for it
exactly, you have a map that takes a uuid to give you a playerstat instance back, so you just need to get the uuid
@EventHandler
public void onQuit(PlayerQuitEvent event) {
UUID playerId = event.getPlayer().getUniqueId();
PlayerStats stats = playerStatsCache.remove(playerId);
playerStatsManager.insertPlayerStats(stats);
}

great what do I do with a player now
player.getuniqueid maybe?
lol...
what he thinks folia is
bro thinks my 30kx30k server has 32 chunks
188927463 Core cpu incoming
I have a utility class which handles this by creating a new Gson instance every time a new adapter is registered
(also a wrapper)
wait you guys dont use threadrippers?
what did you call it?
that's like my main issue lol
i thought about AdaptedJsonParser
like that?
Does it adapt? Does it parse something?
yes
yes I guess
You can replace the get by remove
No
but the only thing is that it will probably be a static only class
But yes
nah listen listen
if every chunk isnt threaded
is it actually multithreaded
I hope you understand what your maps actually do though
like that?
do you know how many chunks are loaded with a render distance of about 10?
its quite a lot
no i think
That’s exactly what he posted before so yes
he is getting somewhere w this
Let him cook
how about every 2 chunks 😎
nuh uh
no
like
store data
and thats it
yes
how about this
but you seem to be posting the code as if you didnt know
bro responds here but not to my dm
thats why I asked
Sure
U lucked out though
Imagine if it returned a clone
SORRY im slow alr
idc
This is how i handled it:
https://paste.md-5.net/abejotewuz.cs
I think this has to be the biggest spoon feed in history
not what I replied to, but maybe you know 😛
I think he just had enough
Looks good. But your playerStatsCache should be in a different class
He didn’t even use it though
its not the specific thing I am referring to, I mean as a whole
Yeah at this point we all should be added as developers in the plugin.yml to be honest
doesnt work
I agree
so it doesnt look good
Now you troubleshoot
You can figure this one out yourself. NPEs are pretty easy to troubleshoot.
Did u restart ur server after updating the plugin?
Add debug messages and find out what is happening
this doesnt work for sure
Add debug messages and find out what is happening
Lets impose a feeding stop for now. This NPE can be figured out, im sure.
I know it doesnt fucking work because my stats arent even zero'ed
NPE is solved
one uppercase missing
thats whatever totally right now
I am talking about something different
It will only update the database on join and exit
On join -> it loads
On quit -> it saves
Did you consider the case
On join -> it loads : But nothing is in your DB bc its your first join?
He is all over the place now, sending random screenshots and ranting...
Figure out which sql statement is wrong and fix it
should i code on notepad++ or directly notepad
yes
I loved learning about databases too
ok?
idk I took it from there
but I didnt even make any syntax mistakes
Sqllite doesn’t known some of the more fancy keywords
so I remove duplicate key statement?
You rewrite the statement
how
mongodb or .yml for 400 player network?
planning to switch from mongo to due to costs sadly
Learn sql syntax
I think SQLite has some "insert or replace" shenanigans you could use
It do
finally fucking works
I can go to sleep
picking databases was the worst mistake of my life
I agree
well now im forced to use them
cba rewriting it for n'th time
do I make Hash<UUID, SomethingStats> manager for each table or a general one?
We told you that it adds a ton of complexity and that you needed to learn a whole new programming language for it...
Each of your data classes should get its own manager to hold your data while its in memory
so each data table?
I wouldnt phrase it like that because one class can have relations to several tables.
For example if it contains a collection.
it wont dont worry about it
so in general
data table Something should have:
- Something - it holds getters and setters
- SomethingManager - it retrieves data from db into cached version and the reverse when saving
- SomethingCacheManager - used in SomethingManager to manage caching
Sure. If you create a new data class, then it needs its own table and its own manager for in-memory storage and its own
DAO for loading/saving from/to DB
Close enough
whats not ok
.
Also cachemanager and manager does not need to be so exclusive
Just for phrasing:
Manager -> Usually in-memory only
DAO (DataAccessObject) -> loading/saving data
So for a Class "SomethingData"
I would create
SomethingManager holding a Map<Key, Something>
And a SomethingDAO transferring data between your Manager and the Database.
But doesnt need to be named DAO. This is one example i wrote recently
I read that as ero
Thats on you 
okay so
when I want to make command
/deaths
Id get those deaths from cache
not from db
y?
db is only for saving data to make it persistent
yy?
*There are some cases where you still get your data from DB, but thats for another day
bold of you assume im gonna mentally persist through it
Emo
If you continue writing code, then you will probably become a decent dev eventually
actually knowing programming would definitely help you with this
well I picked on java bcs I found python a bit boring
Wait... i thought you where younger. Still in school.
because instead of just knowing that vulnerabilities can come from an application you would actually have a deeper understanding beyond that
I am 19
soon-to-be 20

but programming and cybersecurity go together 🙂
mostly script languages
Well as long as it isn’t written somewhere no jobs can check it
script languages just help you do things, programming languages help you understand the extent an application vulnerability can have as well as how to combat it
idk im only 3 months into uni
so far we got maths
maths
and maths
and basics of telecommunication
they want to sieve unworthy with linear algebra and mathematical analysis
already half didnt pass first exam wave
Well, I did anti-cybersecurity in the military 🙂
the opposite of what you are going to school for
well you are a fossil
most of it is probably outdated
it isn't
military revolves around using old shit so in military context no
but in general context yeah
we may have old equipment, but bold of you to assume it never updated
also, we have plenty of equipment that is modern
such as our ID database stuff 😄
I probably could have retrofitted one of the dishes to do that
not sure if it would have been effective nor can I think of a scenario it would have helped XD
When the sky submarines come for you obv
ah yes, the sky subs
so called security specialists when I distract their EM signal with one tiny funny device
tin foil hat?
but yeah, anything and everything is relevant in terms of cybersecurity. Even if its old it still has relevance. For example zip bombs are still effective because some developers forget to not assume anything about the zip file
taught Optic about that one 🙂
at one point his malware scanner was susceptible to such a thing
Jar bombs 💪🏻
yep, you could have one 🙂
lol, 96
28
I am 32
But it feels like 23...
96, but it feels like
my condolences in serving in military
not sure why you are sorry
I have no regrets about it 🙂
idk I saw that meme one day and thought it must be kinda rough
Lol
the irony here, freedom is paid in the currency of blood 🙂
well "freedom"
not that US government is any great just saying
:v
its better then North Korean Government
Doesn’t say a lot
the fact that you needed to use NKr as comparison says a lot yeah
no there is other countries
China, Russia, Israel, Iran, Dubai, Many countries on the Continent of Africa
The US isn’t all it’s made out to be, but it’s not too bad either.
come on, now mention Afghanistan that has pretty much no established government since ages
Me watching help-dev slowly sliding into politics again
Just another day
It’s gods intended purpose for this channel
don't worry I will make sure it slides the other way 🙂
Poland is pretty cool
never been there so I don't really know
0
yeah seeing my grandma for the last time at the funeral was indeed haunting experience
Feels like i am at my clinicals again
lol
ure a nurse?
Student nurse ye
We probably have different terms here, but no i haven’t decided on what to do after my 3,5 years.
NP = Nurse Practitioner
Might join the military as a nurse for a bit
I see, i will probably get a masters. Though it’ll probably be more specialized like CCN or Anesthetics
its kinda funny cuz I went into uni without any interested in cybersec
this wouldn't be spigot if help-dev didn't slowly turn into political discourse
Ah got it
Just become a blackhat hacker and extort money 👌🏻 /s
Are you actually able to change the Bukkit logger level
Whenever i try to it doesnt work and when i search it online it seems no one else can either
register a handler for the level you want
Hello, i got a NPE in a Bukkit.createInventory
in that one.
Checked kit.getDisplayName(); and it works, it does have the displayname, it isnt null
KitInventory extends InventoryGUI that in the constructor calls that method
its a custom one from me
?stacktrace
We cannot help without the full stacktrace; Please paste it here: https://paste.md-5.net
just makes return ChatColor.translateAlternateColorCodes('&', txt)
abstraction goes brr
Try printing out the values
kit.getDisplayName()
lemme give you code
KitInventory: https://paste.md-5.net/elokepixas.cs
InventoryGUI: https://paste.md-5.net/fubaracima.java
GKitInventory (calls KitInventory): https://paste.md-5.net/ogezijafil.cs
So if you remove cc.translate and just pass kit.getDisplayName what happens
Wht happens if you print out kit in the method
then print it with CC translate too after the fact
its samething
just tried it
its null when i create the KitInventory instance
but before it isnt
maybe it is because the InventoryGUI constructor calls createinventory?
Perhaps
like
InventoryGUI constructor is first than KitInventory so that way the KitInventory kit instance is null cause his constructor executes later?
I guess
and what happens if i delete InventoryGUI#createInventory?
like its a abstract class
fuck
damn
what can i do
I'm going to teach you something cool
hopefully you find it useful in the future
hmm
okay
Is it generics? We love generics
i havent seen generics in school
damn
Ah
i feel like im not going to understand a single fuck of functional
Fair enough, I accidentally made a functional interface the other day and was confused
its really easy dw
@weak meteor I ran out of the character limit for nitro
so
I'ma need a bit more time
where does kit come from?
dont worry
dw I've got it frost <3
I'm fully explaining the problem
“It’s really easy”
“I exceeded the character limit”
a List<Kit> from .json
yea
Kit isnt null btw
well I'm talking through each thing very carefully
it is, but I'm still writing out why be patient for a bit :P
something is null somewhere and you said earlier there was a null that you pointed to in your SS
therefore we need to trace it to where it originates
its okay
its null in KitInventory constructor but not before i call the constructor
Couple things to preffice on why you are having an issue first off I'll educate you a bit more on how java constructors work.
Essentially when inherited the parent constructor always runs first. you may know this when in obvious examples such as below
public class MyParentClass {
public MyParentClass(int arbitraryNumber) {
// do stuff
}
}
Now in this example we'll make a child class
public class MyChildClass extends MyParentClass {
public MyChildClass() {
super(5); // we must ALWAYS provide a super method first seeing as the parent constructor moust be run first
int thisStuff = 51;
}
}
as you see in my admittedly weird example. The super() call calls the parents constructor first no matter what. This is true even if the parent constructor has no parameters in its class.
Now let's pretend that MyParentClass is simply has a constructor with no arguments.
public class MyChildClass extends MyParentClass {
public MyChildClass() {
super(); // super is inferred
int thisStuff = 51;
}
}
as you see the super() method can still be there. But when the parent class has no arguments its usually inferred which is why this syntax is allowed
public class MyChildClass extends MyParentClass {
public MyChildClass() {
int thisStuff = 51;
}
}
This doesn't change the fact that MyParentClass runs before MyChildClass.
Now lets get on about how to solve your problem in more relevant terms.
Right now you have an abstract InventoryGUI.java class which has the method
protected abstract Inventory createInventory();
This method in more simpler terms supplies your class's constructor with an Inventory value.
Now lets look at the issues with your implementation within KitInventory.java
firstly we can note that KitInventory extends InventoryGUI
private final Kit kit;
public KitInventory(Kit kit) {
this.kit = kit;
}
Knowing about what I said earlier we can infer that super is called within the constructor above like so
private final Kit kit;
public KitInventory(Kit kit) {
super();
this.kit = kit;
}
@Override
protected Inventory createInventory() {
return Bukkit.createInventory(null, 9*5, CC.translate(kit.getDisplayName()));
}
As you can imagine right now we have quite the predicament. createInventory is being run before kit is assigned.
There are 2 solutions here. One is admittedly much better than the other, but I'll go through in explaing both.
First I'll talk about the naive solution
we can make a simple change to InventoryGUI for this naive solution to work. Firstly we add Kit to the constructor
public InventoryGUI(Kit kit){
inventory = this.createInventory(kit);
}
Next we add kit to this.createInventory
protected abstract Inventory createInventory(Kit kit);
Now I'll explain why this solution is naive. You're essentially killing your abstraction as you likely noticed. You've now bound your general InventoryGUI class to Kit and tightly coupled them. This obviously isn't Ideal especially if you want to easily use your GUI elsewhere.
Now I'll explain the better approach to solving this problem.
If we take a look back at your original method createInventory
protected abstract Inventory createInventory();
We see all it really does is supply an inventory. Well cool enough java actually has a method built in to solve this
we can equate createInventory to something java has built in already, its called a Supplier. Suppliers just return a value! isn't that neat. that's exactly what your createInventory method does.
so now we can make some neat tweaks. to your class
First off lets remove that pesky createInventory method from InventoryGUI
public InventoryGUI(){
inventory = null;
}
Alright, but now how do we assign the inventory that we have no method to inherit?
That's where the Supplier comes in a supplier allows you to pretty much inline a method I'll give an example after I implement it
public InventoryGUI(Supplier<Inventory> inventoryCreator){
inventory = inventoryCreator.get();
}
nice now how would we apply this. I will use your example that previously errored as an example and hopefully you'll beable to understand the power of Suppliers
public KitInventory(Kit kit) {
// error no super arguments
this.kit = kit;
}
Now we must use the super keyword as our parent constructor has an argument.
public KitInventory(Kit kit) {
super(() -> {
return Bukkit.createInventory(null, 9*5, CC.translate(kit.getDisplayName())); // kit is now in scope
});
this.kit = kit;
}
Now this is neat we have all the power of the createInventory method but none of the draw backs. All of the data we need from the constructor is now in scope. the kit variable will nolonger be null because we have access to it from the constructor parameter.
@weak meteor
// we must ALWAYS provide a super method first seeing as the parent constructor moust be run first
https://openjdk.org/jeps/447 btw, hope its gonna get merged
Pog
Friends, I realized that I was transferring and using the classes from my previous projects in all of my minecrft plugins and that I was repeating my codes in most places, so I decided to code a core project to prevent this. When I examined some core projects, I noticed that they added an API module and coded the interfaces of most of the classes they would code in this API module, but they do not need polymorphism anywhere, but if they want to add a module for a different platform such as nukkit, it will not be that difficult to create classes that implement these interfaces. In short, my question is, is there any benefit in putting the interface of each class that I will code in the api module and the bukkit module in this api module?
you know what else I hope gets merged soon
https://hub.spigotmc.org/stash/projects/SPIGOT/repos/craftbukkit/pull-requests/1282/overview
How do i do this
ive been trying to figure this out without asking but i have no clue how 😅
GKitInventory also extends InventoryGUI
So the changes will affect him
yeah just change GKitInventory to use a supplier as well
I mean if GKitInventory functions as normal the move to a supplier won't break anything
Virtual entity vs inventory pr
yea
Who’s cooler 😎
but what should i give?
me
I fixed 9 jira issues what about you
i got no Inventory instance to return
show GKitInventory
oh nvm
unless you understand
I revived an old dead pr
yea just thought what i had to do
Which idk I think is cool
got it
okay okay time to try
u are awesome
thats actually insane
i'll take notes of that
thank you so much for the knowledge lol
I made a PR to remove sign ticking
.
Its still in the queue 😭
part of me thinks Inventory PR will be merged first lo
how can i register a static event listener if at all possible?
another question
this is used only on this context?
like working with parent and child?
no, Suppliers have a ton of uses
you got one that i can check?
I leverage java.util.function API a ton
Logger.getLogger("").addHandler(new MyHandler());
well, I have one with functions not really suppliers though
https://hub.spigotmc.org/stash/projects/SPIGOT/repos/craftbukkit/browse/src/main/java/org/bukkit/craftbukkit/inventory/util/CraftInventoryBuilder.java?at=9ab601463301a822f2db99de72215d373b155e52
this class isn't really that readable unfortunately
The stringg in GetLogger should be one that matches a logger that already exists
oh Functionals is all the .functions package?
optionally you could create a new logger instead and register the levels you want it to record
Function<T, V>
Consumer<T>
Supplier<T>
etc
you can also make your own FunctionalInterfaces as displayed by the link I sent
yea this isnt readable
but cool to know
add some JavaDoc comments in there and its fine 🙂
okay thats better
😈 that's my code Inventory PR Ftw
Docs are for nerds
I’d really like to see the ArmorEquipEvent pr get merged but from what I’ve been told it’s not technically dead
The author is just busy
yeah they provided more then what I was going to do
I'm in a good mood right now be glad you caught me when I was happy
when I'm mad I would probably have not exceeded the nitro character limit
HAHAHA okay
thanks btw
Weird flex but okay
i heard about Immutable Maps like
a year ago
its smth like ImmutableMap<K, V, V, ...>, right ?
<K, V, V, ...> 🤔
idk if its true or not
Map is key-value structure
thats why im asking
so its only K and V
idk why would you have 2 same generic parameters
not sure if that would even compile
Your probably thinking about a table
yeah, that wont compile
lemme google it
Tables are cool it's how SQL stores data
It's more applicable in databases than most core scenarios
yeah
But it's also important to note not all tables have a primary key
they should 😭
in core scenarios its really un-useful?
idk how to say it on english
like !useful to say it in java
they should
the really should
like DynamoDB ones
I mostly use no sql so no clue what's standard tbh
yeah if there is no natural primary key, autoincrement one should be used
how would i make a NMS mob's custom AI persist through server restarts?
Json is great
can i talk on spanish in here?
No
k
English only
What would the world be like without .json?
that sounds shitty asf in english
in spanish is better
No hablo español anyways
Just say the word in spanish
Ans hope optic isn't lurking
que sería del mundo sin .json