#help-development
1 messages · Page 789 of 1
?learnjava
Here are some links to get you started on learning Java:
- https://www.codecademy.com/learn/learn-java
- https://www.sololearn.com/learning/1068
- https://www.learnjavaonline.org/
- https://programmingbydoing.com/
- https://docs.oracle.com/javase/tutorial/java/index.html
The last one is the only official one, however some of those concepts assume that you already know a bit about programming.
this is actually wrong
Most people abuse static because they don;t understand it and their IDE suggested to make a field static so they can access it outside the instance.
a Specification governs but it doesn't dictate everything
lol
the JLS clearly specifies how an enhanced for loop has to work under the hood
its like the yaml spec for example, you can implement yaml yourself, but it only has to adhere to certain rules. Here is an example. Lets say the spec says that for something to be considered an Integer it must be a number. Cool, itt doesn't say Integer can't provide other methods other then those used for numbers. That is, you could add a convienient add method to Integer if you wanted, just as long as it returns what the spec deems as an Integer.
no where in the spec does it say it can't have an add method
nor does it say it must have one
This is implementation detail
because Integer is neither a language nor a VM feature
hence, implementation can be different then spec
you're mixing up weird things about the language spec and the Java SE API spec
So you create a new instance of a class every time you want to call a method?
And then the entire object gets discarded again.
whenever they interact, it is clearly written how they have to interact
because code blocks can only exist within TypeDeclarations as mentioned in Chapter 7 of the JLS
Just make one in main and pass it???
you can indeed deviate from the JLS just fyi, strictly speaking you only have to follow JLS if you want Oracle to see your JDK as official otherwise you are free to do whatever. But, in terms of implementation the JLS does govern some things, but it doesn't govern everything far from it and it never will.
Buzzwords
lol
if you'd read the JLS, you'd know that TypeDeclaration is not a buzzword, but it's clearly defined
but once again you lack to understand basic principles of java and ignore all the docs people send you
you don't even comprehend the difference between classes and instances
You can try that out for yourself and discover why this is a horrible idea
you are wrong again, the JDK consists of multiple specifications, including the Java Language Specification, the Java Virtual Machine Specification, and the Java SE API specification.
sure, which strictly speaking an implementation is free to deviate
I mean yeah if I write a java compiler that doesn't compile java it just slightly deviates from the language specification
no, implementations can not deviate, otherwise they are implementations of something else
I am doing it all the time
oh guess kotlin isn't real
Just like someone told me to
kotlin is not java
could have sworn it was a derivative of Java
so it does not have to follow the language specification
Good to know people give me terrible tips in that case
you're wrong again
and the java virtual machine has absolutely nothing to do with the java langauge
even lombok isn't java, it is a different language
So much 🧂 today.
Would be nice if you told me what JLC even is, saying JLC ch. 7 doesnt tell much at all
i don't understand how frostalf can be so confidently wrong
it must be otherwise you wouldn't be able to use Java in it lol. But whatever.
My guy, you dont even grasp half of the fundamentals of java.
There is nothing about any suggestions here you could even start to complain about.
I am going back to playing my games, I will check the implementation this weekend
you must be new here
whats goin on lol
noone knows anything
Brings back my memory mapped files discussion from the beginning 🙂
Nobody has told me what those fundamentals even are so
because you keep ignoring ?learnjava links
I think we did leave a few links to help you learn those
When I ask the person who uses it if they even know whats in any of those courses they respond with no
?learnjava
Here are some links to get you started on learning Java:
- https://www.codecademy.com/learn/learn-java
- https://www.sololearn.com/learning/1068
- https://www.learnjavaonline.org/
- https://programmingbydoing.com/
- https://docs.oracle.com/javase/tutorial/java/index.html
The last one is the only official one, however some of those concepts assume that you already know a bit about programming.
the last link is the Java API
How can they be certain that thry do contain everything needed if they haveng seen them
because the bot was setup by the staff
Thats not our responsibility. Why do you expect us to feed you the basics of a programming language
on a discord which focuses on an API written in this language?
The fundamentals are everything you are talking about, things you would learn from ?learnjava. Things like what is a class, what is an interface, what is static etc
what's wrong buddy
who told you to not use the Java API? You can't do anything in java without the Java API
or some kind of API
he means that someone told him not to use the oracle "tutorial"
not sure why you wouldn't, it won't necessarily teach you super advanced methods
but it will teach you proper methods
So why are you even using something that you wont elaborate about
well its not just a single paragraph
This question makes no sense.
oh here we go again with Dusk wanting to argue about learning fundamentals and pretending to not know them when they claim they are learning python -.-
in order to use python you would agree there are certain things you would have to know first right?
such as, how to declare variables, where you can declare them, how to assign them, unassign them etc
isn't python also OOP so fundamentals of java == fundamentals of python
those are fundamentals and they don't strictly apply to a specific language
I mentioned python once a ton of time ago
I didnt even weaponize it
Lol?
what the hell are you trying to prove rn
i skipped 99% of dialogue tho
That they are talking about something irrelevant
I distinctly remember you saying you are taking courses in python because your uni is requiring it
and it's kinda hard to read cuz most of it was blaming frostalf for not knowing java
Yes, and what about it?
I just mentioned it
Did I say that python is better than java or what
than what's relevant(your original question)?
Scroll up lol
You said you missed 99% of convo
yeah and also said it's kinda hard to find where it started
this has nothing to do with anything I remotely said
so can you just ask and stop arguing in dev chat
Your first paragraph uses the fact that I mentioned python once
my point is, is that python is a programming language, which also requires at the very least of knowing the fundamentals in order to use it
otherwise you will just have gibberish
maybe move to dms or random text channel not related
All programming languages require knowing the fundamentals and each language has a slightly different fundamentals needing to be learned but for the most part they are all relatively similar
some more so then others
Nobody needs help with anything rn
so if you learned some of the fundamentals of Python, why is it so hard to understand that you need to know the fundamentals of Java?
oh that's why you got like 5 learnjava answers 🙂
and what those may be or how to even look them up
At this point its just weaponized
why not
it's currently loading...(it's taking kinda too long for some reason)
i'm in verified
@storm crystal Here are your "relevant" questions with answers
What is this static with {}
A static initializer block to initialize classes when they are loaded
Why is there separate thing like that
Cant you just use constructor
No
And why you cant do it in constructor
Because it doesnt initialize statically
Why method needs to be static to access static shit
Fundamental java question. (They exists in different scopes)
Well people here told me to not make shit static
Rightfully so. Dont touch it for now as you dont seem to appreciate its importance.
good summarization
tho method doesn't need to be static to access static no?

ofc not
well he did say static exists in different scopes
Test
passed


Why do you rewrite it
If i alr got answered
Tf
/**
* Tests whether the tests run
*/
@Test
public void test() {
System.out.println("Test");
}

idk why but i often declare a test method and then dont run a test but rather just execute code and print results
which is probably stupid
@AfterEach
public void secret() {
TestSuit.complete(copyAlexsAnswer());
}
i wish toolchains would support source/target. this feels so bad
java {
sourceCompatibility = JavaVersion.VERSION_1_8
targetCompatibility = JavaVersion.VERSION_1_8
if (JavaVersion.current() < JavaVersion.VERSION_17) {
throw RuntimeException("Java 17 or higher is required to build.")
}
}
wat
why is java 17 required to build if you're gonna target java 8?
u still on about that alex smh
but afaik you can have both anyway?
because some optional dependencies are java 17
you should use the release flag regardless
there's a separate flag for that
and how is that called?
thx I'll check that later
ideally toolchain should be set and release flag used instead of source/target (that is kind of "deprecated", release flag ensures some api availability things)
What fish types are actually catchable? I have cod, puffer, salmon, and tropical
keep in mind that anything regarding loot tables can be modified with data packs and plugins, that's showing the default things
i love how in every game you can fish random junk like leather boots but in reality it never happens
fishing must be so disappointing in real life
beat me to it
imagine you wanna fish a rotten leather boot but all you get is a salmon
lol
dynamite fishing
Scuba diving
magnetic leather?
TIL there are different rates in jungle biomes
you'd think it would be different in swamps too but i guess not xd
they should add mosquitoes and swamps are absolutely swarmed with them
yeah and they'll give you malaria potion effect
💀
then you have to find a black priest to give you malaria vaccine like in far cry 2
^ you after they bite you
thanks
Can I give pdc to item in gui
Can I edit its lore while its in this gui as well?
the same
How do I make gui that can store items for each player and let him take them out like enderchest
Just create one Inventory per player and put them in a Map<UUID, Inventory>
Whats delegate
Do i need to make it like that when i want to make skill tree gui for each player
this would be for anything gui related specific to a player
If you get a bit more experience then this is a good guide
https://www.spigotmc.org/threads/a-modern-approach-to-inventory-guis.594005/#post-4553427
IF by stefvanschie 💪🏻
Define a bitmore experience
Having worked with interfaces and/or abstract classes
Is there no other way
There is plenty of ways
Like if I want to open inventory and have an itemstack that would tell players experience, cant I just make its lore formatted with value of that player's stat taken from config?
What
That shit is just confusing as hell
Sure. You can just open an inventory for a player, fill it with custom items which have custom lore, and cancel any interaction.
Thats the general idea of GUIs
Im not sure if PDCs would be usefull here.
Maybe if you want to detect clicks on certain items.
save exp to pdc, and add placeholder to lore %exp% which would take the value and show it
so well, if you decide to rewrite how your lore looks, you don't need to recode logic ig
well, pdc should be on the player, not on itemstack as i think about it
cuz saving exp for each player to config is kinda 💩
But
The item
Is not an item until the inventory open?
It’s supposed to represent it in the invetory
It’s a menu
The item doesn’t exist until he wants to show it
yeah so well, each time you open the gui, you just add an item to it
Yes, and pdc is useless there
Pdc is still useless
you need to set it's lore to player's stat value
Unless you save their experience to the player pec
aight so im trying to use the scheduler seperate threads thingy to do a database lookup for the coreprotect API. Any way instead of just running the command for me to send it back to the main thread with information so I can do some if statements?
which should probably be in pdc
that's what i said lol
set player exp to pdc
No you said items prc
not to config
Pdc
if i add variables to an arraylist is that data persistent?
persistent over a restart? no
I already have things being saved to file... just a pain I need to just redo how i save things and use procedures with parameters so i dont have to add so much every time i want to save a new variable
This will get better the more you write code.
Ensuring your code to be serializable is a big part of designing your structure.
some1 now how can i allow teleport with ender pearls combat +
I added a fishing skill and made the sneaking skill ive been working one have xp and levels, along with a monster hunting skill. my first skill was mining and it took me 6 months to do, these three skills were just a few hours
Hi, I'm using a seperate thread for my DB lookup. How could I pass information back to my main thread/class?
In short: Start a bukkit task
CompletableFuture + runTask
D + N
What is the best way to manage sql connections in plugin?
Hikari?
Hot take, hikari is overkill for most plugins
Wpuld rather overkill than underkill haha
Imagine how much storage space of spigot resources is used up by the same few third-party artifacts shaded in in every other resource
brutal
A lot
yeah probably like 7 gigabytes
Woah
that's a lot of gigabytes
That’s more than 1 gb

it's more than 6.8
Not too sure about that. Any prove?
Just truss
7 - 6.8 = 1. Oh i guess it isn’t more than 6.8
Dou you have good tutorial how to corectly use it? In spigot every is old
Ask choco
It's really simple
Depending on your use case you probably don't need Hikari tbf
One sec
Steel is very right in saying that it's overkill in a lot of situations :p
Good boy
I'm making statistics plugin, integrated with discord, so basic java sql will be enought?
wherres the rest of the settings
or the config then source
so uh i want to make a custom items name localized so i can add my item name to the en_us.json for example. how would i do this?
Ah yes pooling on sqlite where writes are sequential anyways
Right, SQLite is one of those situations where it's not at all necessary :p
anybody could help?
Hence the simple part
simple is not always better
Yes I know it does nothing for SQLite but it's easier to just use it for all database options in a plugin :p
like would i have to add a custom key to the item name or something? i know the en_us.json can be change using a resource pack
You would set the items name to a TranslationComponent
butttt you need NMS for that on spigot
not for long
Blame @worldly ingot
hmm ok thanks i'll look into it
why lol?
He is working on the PR for components :p
but what if there's like 150k players and my plugin does an sql operation on playermove event
choco is forced to run them manually
(i can't change it the client demands it that way )
just cope harder
Then you should redesign your approach
Which plugin is responsible for plots or what is the best plugin for plots or, so to speak, plots so that each player has their own plots and another cannot build and dismantle on them
Like any plot plugin probably if you don't repeat the same message over all the channels
i will use mongodb then
thanks
mongodb the best database to scale with ™️
Only for the playrtmoveevent
I mean.. depends if you understand what sharding is used for, beyond its buzzword explanation for scaling.
How can I create a config for my plugin in 1.20 (bungeecord)? can someone give me a little code snippet or explain how to do this ?
I have not found anything that works can you give me a link ?
Why did u go directly to a video lol
only watch videos as a last resort
?paste
at least someone who helps thank you 🙂
I mean
The home of Spigot a high performance, no lag customized CraftBukkit Minecraft server API, and BungeeCord, the cloud server proxy.
Together with
?jd
Bungeecord javadoc
?learnjava
Here are some links to get you started on learning Java:
- https://www.codecademy.com/learn/learn-java
- https://www.sololearn.com/learning/1068
- https://www.learnjavaonline.org/
- https://programmingbydoing.com/
- https://docs.oracle.com/javase/tutorial/java/index.html
The last one is the only official one, however some of those concepts assume that you already know a bit about programming.
sigh
Who we sighing over this time
You can take an educated guess
Elgar?
clearly the bot
can someone tell me the args for running a forge 1.12.2 client with its mods
I tested note blocks and their connection with textures and realized that there are not 800 states, but 24....
this is the wrong discord server xD
ok
this is for plugins mostly, im sure forge has a discord server as well
ok thanks
Probably toxic
so all in all is oracle tutorial useful or not really
Yes
if you already know some programming concepts
idk it just looks the most professional out of forementioned ones
w/o unnecessary shit like "create an account" or "buy our pro version" type deal
What can I do to remove the leads that are dropped in EntityUnleashEvent?
I think it fires EntityDropItemEvent
So I tried getting the entity from fishing but it doesn't call entity until you catch the fish, instead I just put all the fish in an array list and used random, cancelled the normal fishing event and just have fish being caught
You want to replace the items with the fish entity?
Meh, i personally wouldnt suggest it
Why
Pretty much yeah, so you catch what you hook
Because i dont like it
What do you imagine how saving an entire world would look like?
no i mean not in file
No
in list
Ah i see. The general rule is:
Dont have references to live game objects like Player, Entity, World, Chunk etc.
Because you asked
but why so many people do this?
some people probably like it
give options to see what people want to do
But your comment is meaningless if you dont say why you dont like it
Feel free to have this opinion
the objects exist as there loaded, eg a player exists while their online once they leave that object should be deleted but if something saves a reference to it it cant
I asked if that java tutorial is fine, you said no and didnt want to elaborate, so Id assume you talk nonsense and proceed
Both are live game objects. You can def use them if you are extremely careful, but generally it is considered bad practice
doesn't it just become null
Then assume that 👍
When a client joins a NEW Player Object is created.
If the client disconnects and rejoins another NEW Player Object is created.
no
Not if you hold a reference to it. If you have a List<World> and one of the worlds get unloaded, then you produced a memory leak
If you hold a reference to the first Player Object it will be invalid after a relog
I understand that the extra data is saved in the sheet?
Player of second login will not equal Player of first login
this means that it is bad to store references to temporary objects
then i think need use id
As 7smile7 said, if you hold a reference to an Object Bukkit tried to discard you are forcing it to be held in memory and not removed.
yes, id is perfect
but for some reason this rule is not followed by many people. Because of this, the problem of leakage is relevant, as I understand it?
yes
And it’s also impossible to pass as input to methods?
generally holding a reference to the 3 base worlds is fine, as they can't be unloaded. But it's good practice to never hold a reference.
you can pass to a method, just don;t retain a reference
As I understand it, storing temporary data in a list prevents the memory from being cleared and prevents it from being used?
yes
for some reason gradle is using an old version of my project and i cant seem to fix it ive been trying for like 2 days now
no matter what i set as the version in the dependency
it seems to always use the same version
the JAR hosted on jitpack has all classes
Is this problem less "problematic" in C++?
yet im missing recent ones when i try to use them in my project
its not an intellij issue either, it doesnt compile
ive deleted ~/.gradle/, project/.gradle/ and invalidated caches multiple times but im still having the issue
if i go to .gradle/caches/modules-2/files-2.1 and i find my dependency, it has the old version downloaded instead of the one i specified in my build.gradle
ive tried both gradle version 7.3 and 8.3
yes as C+ is mostly pointers on a stack
cool
I thought it was because programmers have to clear memory themselves
They do, but also objects are not the same in C++
Java Garbage Collector does the job of the memory management you have to do yourself in C++
smart pointers 😉 (basically for people who are afraid of normal pointers)
are you talking about the garbage collector?
this mini garbage collector?
raii container
I wouldn't call it like that
then why dev call this "smart"
No
it just automatically frees memory addresses
when the object is destroyed
so its semi automatic
no
java was made before AI
semi-mine garbage collector👍
calling them smart is weird tbh
that doesn't mean the GC
doesn't get updated or new ones come out
major updates
probably wont happen
It has happened
as most users are stuck on old versions
G1GC is a major improvement and it began in 1.8
now we have ZGC I think it is
so not sure what makes you think the GC's are not being updated or added to
is there any comparison to spigot vs paper in plugin making?
at this point you probably can't really say paper is proper fork of spigot
too much is different about it at this point
definitely not made to be AI
at least
in the next 5 years
guys, i know, it's offtop, but who can make 3d models using art reference?
idk where i can ask about this
is it worth overriding hash and equals for classes that are not used in List?
maybe not, but AI isn't going to be better at the GC'ing
point is though GC does routinely get updates
and we do every once in while get a new GC to play around with
so just because something came out later then java, doesn't mean java can't or won't include it
it all depends how Oracle feels
IC
im not asking which is better lol
im asking what each has to offer
you got a reply to that on the Paper discord as well, at this point just look what API Paper adds and changes and make your own decision
hey @river oracle how long am i supposed to be patient for lol
ok
I dont expect to get unbiased information since "muh open source war"
?services if anything
If you wish to request or offer development/art/building/administration services, please do so at https://www.spigotmc.org/forums/services-recruitment-v2.54/
ah damn
lol
yea ive gotten no response from spigot(staff) and github is like 'were overworked we aint doing this'
im so tilted
as I said, at this point paper and spigot are vastly different. It used to be that paper added optimizations and improvements, but they have since gone beyond that making drastic changes to the server code that deviates from vanilla mechanics. Spigot strives to not change vanilla mechanics if it doesn't have to.
so paper is better if you have more aspirations?
there is configs that affect mob spawn limits, and by default spawn rate is reduced
for example
you can also mess with the ticking of some things such as how far or close entities activate and do stuff
yeah for the most part its vanilla defaults
occcasionally spigot will fix some bugs if its necessary too
what is vanilla default
but if its not detrimental spigot leaves it alone for Mojang to fix
if its a mojang bug
Redstone, massively
Not really Spigot, Craftbukkit originally. Lots of advanced redstone contraptions don't work as they should
why not just say who can help and who can't? for what these redirects?
Paper has alternative current as a redstone implementation you can use that will improve some of those things, but not everything
why wont they just fix them
cuz mojang is owned by microsoft
Some of that was done to allow for events and other plugin stuff
Some of that is just old 2012 code that nobody wants to touch
because technically some of the redstone stuff is bugs and some of those bugs actually caused memory leaks or other problems
and
and then what Malfrador said too
why does it stop spigot devs from fixing stuff
Breaking compatibility, mostly
oh thats true too
People somehow ended up expecting their plugin last updated in 2015 to still work in 2023
ton of legacy stuff
legacy materials
and methods rarely get remoed
usually they just get deprecated
until one day you find out they no longer work
but at that point it really is out of date
whats the point of making plugin if itll get outdated either way
ideally you would maintain it
you can always update it
To have additional functionality in the game
You realize we'd all be dead with that attitude
I assume you arent in ur mood today are you
Why bother making a steam engine as it's going to be outdated soon
I'll be in my cave not bothering to discover fire.
I mean steam engine did kill a ton of people
fire too
so yeah kinda sucks to invent something so dangerous
so do combustion engines
for a sec was i 'did i switcch to the factorio discord'?
The steam engine also made the lives of millions easier
because people here help with development questions and most people available for recruitment to do what you want don't look in here
eeeh
that is because advertising here for services and the related is against the rules 🙂
and the only acceptable place is the forums
especially lives of people having to work 14hrs a day for 6 days a week in steam powered factories
14 hour shifts are not that bad
okay
how would it be possible to "wait to load" the players inventory?
like for example when the player joins, their inventory is blank and then after the player runs a command their sever inventory is loaded
do i just copy the inventory to a hashmap, clear it, and set it later? how do i prevent the player losing their inventory if the server crashes
or is there a better way to do it
then go and work in one
I work 10 hour shifts 4 days a week 🙂
I am a tire technician. I do nothing but lift tires for 10 hours 💪
youd work twice as much in a week
If you mess with inventories like that you are almost guaranteed to introduce some dupe mechanic due to crashes
for most likely half your current wage
yeah. i guess i should just not mess with it
well $12/hr is not bad
When a player quits: Save the inventory to disk (file or DB) and clear his player inventory
When a player joins: Load his inventory from disk back
pre tax or post tax
obviously that is pre-tax. Who posts hourly wage as post tax?
also clear it on join. If the server crashed the inventory will not have been saved/wiped
positng ur wage pre tax is like posting ur private area length but counting spine
lol
you are living with post tax money
Sure, everyones taxes are different though
my income is $0
cuz i work in europe
but I make about $24/hr and am guaranteed 40 hours a week 😄
I can work more then 40 hours however, just have no real need to
unless I just want a bit extra money
i wish i could find a job that pays that much
and I am about to get a promotion, which guarantees a raise 😄
would you prefer to live in US where you cant even afford proper diabetes care due to how private companies abuse insulin price?
or where food quality is beyond trash
yall just want my life insurance payout
yep that was the secret plan all along XD
cant wait to see your small business get raided by protesters trying to excuse themselves with good intentions
bleh i just wish Github would have enough staff to process DMCA's timely
this whole week (read last 7 days) has been crap
business I work for is not small, and it will never be raided by protestors 🙂
im not talking to you
lol
That's not even true if you don't know about anything other then sensational news stop spouting it about
Food quality is fine here
nah I doubt it
US is like pinnacle of processed food
Fr
unprocess the cow rn 
My processed meat is always so bloody I wish they just left thr blood at the factory
It is driven by capitalism. You can choose what to eat.
If you wanna eat processed food, then you can do that.
If you wanna live as a vegetarian, only eating organic stuff, you can do that as well.
Its literally a choice.
you miss on one tiny thing
accessibility
I will say yes the US has a variety of processed foods. Not all of them are healthy as well as unhealthy, but this assumes that some how magically the US just has no food that is not processed either. Like, what did the livestock that the US has just dissappear ? lmao
there is also vegetables and fruits and the sorts that still get sold
so there is plenty of everything
not just processed foods
The problem a lot of USs population is facing: They dont care what they eat, and they eat way too much.
I just couldnt imagine having corn syrup in every second meal i stuff into my face.
Lol I am glad its not in everything, or at least not the stuff I get anyways
Anyways. Wrong channel for this discussion.
you said yourself that its basically general2 when no one needs help
or maybe it was someone else
you get the point
No i dont
Ah there it is, thx
not the end of the world if its off-topic as long as there is no actual channel related discussion going on
lol
someone is being very combative today
maybe not but in general, what the staff says is final and goes else risk the severe penalties
says so in the rules
you can always be the first if you try hard enough
that is because they vanished
one of the nice things of discord is, no one ever really knows if someone gets forcefully removed except for staff lmao
not like its going to send the rest of us some kind of notification
maybe one day you will just see md5 pop in here and just like randomly ban someone
I mean discord bans are only ip
how can i disable redstone
sure, but you never get your blue name back 🙂
by using a plugin that does that
forgetting your discord name here is linked to your spigot account
yeah but nothing stops you from making another one theoretically
yes its against the rules and if its found out, its just a never end of cat and mouse with you never knowing when your account gets banned
no way to do that using spigot?
i dont care so much if staff bans people as that they dont seem to respond to me lol
have i really annoyed em that much?
there is no built-in option for that, no
redstone is a kind of block update so u can cancel it, but theres no in-spigot way to do it
idk, they have yet to come back for me to ask them
I want to plan plugin part that would manage inventory GUIs and make them functional (something like in hypixel skill levels and such), what classes should I think of to make it scalable?
helpful
like, if you have a class that displays the GUI or smth, the initializator should be like guiDisplay(guiInterface)
You probably want to think about a system which is agnostic of usage. Meaning you try to not think about what the GUIs are going
to be used for, but how to write code that could be used by any type of GUI implementation.
This thought process often leads to abstraction.
Uhh
But one thing is for sure: You want a manager class
These ones
id have to learn interfaces then yeah
well, interfaces or superclasses would probably be really helpful here
ah time for them to learn about singletons
whats button, inventorysession, and paged
I think you should probably use one of the many GUI libraries out there.
No need to reinvent the wheel. It lets you focus on whats important.
Also: Writing a scalable and stable GUI library is quite hard.
I dont want to rely on external shit
bro wtf
gradle debug log:
2023-11-13T21:22:27.836+0100 [DEBUG] [org.gradle.api.internal.artifacts.ivyservice.resolveengine.graph.builder.NodeState] dependency: com.github.slatepowered.veru:veru-java8:26c299753a from-conf: api to-conf: null is filtered.
...
2023-11-13T21:22:27.972+0100 [DEBUG] [org.gradle.internal.operations.DefaultBuildOperationRunner] Build operation 'Resolve veru-java8-7631c74.jar (com.github.slatepowered.veru:veru-java8:7631c74)' started
it recognizes the dependency version as 26c299753a, and then it just starts using version 7631c74 for some fucking reason
did you tell gradle to use latest?
Button is a class for a button in the inventory, session manages the currently opened inventory + history, and paged is an inventory with multiple pages for a large number of items
no i told it to use exactly version 26c299753a
how could i log previous bans / mutes or whatever to a mysql database player? or maybe a ressource?
VERU_COMMIT = "26c299753a"
api "com.github.slatepowered.veru:veru-java8:${project.VERU_COMMIT}"
also, are you sure that the other is not a short commit id?
uh button as in functional button?
like if you click it does stuff?
what I mean is, is that short commit id the same id that points to the long form id?
but it looks like it completely ignores the version parameter
and just uses a previous value
no
oh ok
but what if I want 2 buttons to have different mechanics when clicked
the long id is 26c299753a of which the short one is 26c2997 im pretty sure
yes
I cant make method that would take entire function as an input
You kinda can
try using the short one instead?
Functional interfaces ftw
this is the primary reason I stopped bothering with jitpack
it was cool and nice when it started, but has since gone downhill
you've had this exact issue?
whats the point of getAction and getProvider
oh k
not the exact one, I had issues one time when it came to tags
well its very convenient for this when it works
jitpack is ironically picky
its normal to create getters
yeah Ive got no idea how to read it correctly
??
what the fuck does this arrow mean
it just blatantly states "well fuck your declared version ima use this one"
ohhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhh
is there a way to do a stress test on a minecraft server to see if the dedicated server runs correctly with a certain number of players connected?
grab a cracked client and run the server with multiple cracked instances?
thats the only idea i have
no I'm not doing this for >200 instances
I've seen something to do that but I can't remember the name.
try spark?
Spark is a profiler
I don’t think it supports stress testing
Well, connects other clients to the server
https://www.spigotmc.org/resources/stress.79374/
This kind of stress tests for chunk loading and entities
god thank you
i think you might be confusing god with 7smile7
twss?
An .ar domain that's either a Argentina domain or an assult rifle domain and I'm not sure which it is
certainly not a rifle
Hmhm okay okay
interesting
I thought its because emily is a pirate, arrr
you might be onto something now
I dont get how the session is supposed to work like
and well, does manager have utility methods that you just invoke that create lets say 9x4 GUI thats filled with unnamed glass panes etc,?
okay I actually cant figure out what agnostic of usage means
how do i properly log player related stuff like bans in a mysql database?
Just write it in there. Nothing special really.
Meaning it should be generalized without knowing how it is used for later on
yeah, but how? do i create a columns for each ban a player had, do i create a player table and add all of the bans as an entry or do i create a table logging all the bans as entries?
One table, each entry is one ban.
You can also have different tables for different types of bans if you like.
can I make on inventory click listener checking if clicked item has PDC that would be String with key "button:" and if it has one it would do stuff later on based on that value? like button:nextpage etc.
one table with every player's bans?
One table with all bans that ever occurred for any player.
im pretty confused on what to work at in my plugin right now to be honest
is it normal wait more than 14 days to upload a premium resource?
if I should implement new stuff or rewrite old stuff to look better for future
okay, but will it lag when i look for all the bans of 1 exact player when there are a bunch of entries?
You should never do any IO on the main thread in the first place. So that shouldnt be a problem
wait what??
In events or anything run by spigot. Never read files or access a databse etc.
It will lag out your server really quickly.
It usually looks like this
i would be loading all the previous bans into the cache and then acces it via commands ingame, would that be okay?
(of the player that joins)
Meh. Its probably okay if you have a smaller or medium server.
But sounds not very useful or clean to me.
as long as the amount of those banned doesn't exceed your memory 🙂
probably shouldn't use offline player objects for it
should just store the uuids and then grab offline player objects as you need them
no im not loading all of them
well you said loading all previous bans into a cache
not sure what you think a cache is o.O
.
that shouldn't be an issue then because I would imagine there wouldn't be many previously banned
Well in that case its fine. But you still need to be able to unban players which are not online.
Or lookup data for offline players etc.
okay, thanks
Anyone knows how could i fix "Connection refused" error on mysql? getting that when accessing database from other vps
Port is probably not open. But show your exception
it is open
you need to enable in mysql config to listen for outside connections, and then you need to setup users to be allowed connections from the host ip or hostname
by default mysql listens on the loop back
where do i enable listening to outside connections
you mean this
im dumb as fuk
when i moved files i forgot to change mysql adress so it was set to localhost:3306
why tf does it say this
Generic array creation. Always fun.
We need a bit more context
it works so i dont really care
the warning is judt snnyoing
ill prob mive away from streams later
Can you just do what it suggests?
is there a cleaner way to check if a button is currently depressed other than event.getClickedBlock().isBlockIndirectlyPowered()
cause that also means that if i run a power source into this button it will no longer work
idk when that would ever happen
but im just wondering if theres a way to check if the button in depressed other than indirect power or a cooldown
i believe you can check the state of the button
but you probs need to cast it to button first
grab the block data, cast to switch https://hub.spigotmc.org/javadocs/bukkit/org/bukkit/block/data/type/Switch.html
wait what
@brisk jetty
ahh ok
Ty
i was trying to figure out what a button was classified as
for some reason its "Switch"
huh
bukkit api names are NOT consistent with english in game
for example potion effects or enchantments are also fuccked
Yeahh
im learning it all slowly 😅
that makes it into an object array which means i cant cast it to CompletableFuture[] so nah i cant
anyone know java site that has exercises, not necessarily theory?
Jetbrains academy
If you want coding challenges then you can take a look at code-wars
Otherwise Jetbrains academy for learning exercises
yeah latter
Yo skibidi toilet in java?
Does crafting regular shaped recipes allow for items with PDC data?
like if I want to prevent a custom item nether star from crafting a beacon, would I use a PDC key or do I need to intercept PreCraft?
For preventing with a specific item I'm pretty sure you'd need pre-craft for that, conversely if you wanted to only accept specific PDC I'm pretty sure that's possible with recipes now adays
event.getAction()
provides more understandable and expressive code, which makes it simpler to comprehend and update
Get the BlockData of the button, cast appropriately, and use that
ty
Yeah this is what I ended up doing
Ty
whats the longest string you can have as a persistentdatacontainer
As the key or value?
Actually it doesn’t really matter
There’s no defined limit on either
Strings are capped at 2,147,483,647 bytes
And NBT values will eventually become overloaded if they get too big, tho I have no idea when that happens
I think for chunks it’s 4mb?
ah
yeah
it's actually 65535
if (utflen > 65535)
throw new UTFDataFormatException(
"encoded string too long: " + utflen + " bytes");
F
just tryna see
if theres a way to store large number of block locations
in some easy way
like a hundred thousand locations
I would use a database
I just found out that Windows has an HTTP server API built into it and it goes all the way back to Windows XP
It feels so weird lol
And client too ofc
is it possible to cast blocks to TileState s? specifically ntoeblocks
what da hell
how does one convert a block to a tile entity then
or is there a better alternative for some sort of PDC for in-world blocks
why is the default of EventHandler to call the method regardless of cancelled?
isnt that so counterintuitive?
tell that to {{git blame}} 11 years ago
also does BlockExplodeEvent not work for tnt explosions? I'm positive I'm registering it and it's not being invoked
?blockpdc
Learn about CustomBlockData here:
https://www.spigotmc.org/threads/custom-block-data-persistentdatacontainer-for-blocks.512422/
THANKS G
primed tnt is an entity, so the entityexplodeevent is called
but if it explodes a block?
no, it's the entity itself that explodes
blockexplode is for things like respawn anchors and beds in nether/end
don't think there are other cases but yeah
appreciate it, ty
pretty sure it is
oh his personal one? i never joined back after the doomsday
i should do that one day
oh yeah
World.createExplosion also fires the block explode event
would firing NotePlayEvent not play the sound for nearby players?
Events are generally not tied to the stuff that causes them
Ie firing block break event doesn’t break the block
ah i see thank you
so do you have any idea what alternative i have to play a noteblock sound at a position
because only players have the playNote method
not blocks
x-x
or am i with my hands tied behind my back and forced to do the funni getNearbyEntities
(i dont think the performance will find it funny)
Probably just regular playSound
yeah it kinda just fucks me up
because now i cant pass Instrument, Note to it
reflection here i come
💯
Alternatively world#getPlayers and some distanceSquared checks
Or a map/table of instrument/note -> sound
yeah thanks i will
im trying to figure out
how the fuck
the notes work
when i use playSound
im guessing its the pitch but
bit confusing
I believe so
ayo
Might be nice to add that to Note or Tone
PR? 😳 👉 👈
Maybe™️
Bruh
i (chatgpt) figured out a formula
Bruh it take me longer to fix ChatGPT code then to actually code it myself
Use black box or something it’s easier
Idk
Seems like a skill issue
Obv not hha
Load Priority Issue
do u know how long I spent coming up with the formula for this LMFAOOon
ChTgpt gave me a formula that was broken past 12 (the formula was actually the same for everything, but both me n chatgpt didn't know)
Note IDs to Pitch
I was under the impression 0-12 and 13-24 used different formulas
Why would there need to be formulas for pitch?
I mean idk they have a formula for calculating it
2 ^ ((12 - pitch) / 12)
ya
type deal
how sleep deprived do you need to be in order to not achieve that
yeah about that LMFAO
because I'm pretty damn sleep deprived and managed to do it
This works for 12 to 36
bro sees math where there mathn't be math
nah because the first few numbers are negative
If you go to 132 to 136 it has a dramatic drop lmao
here technically if you want to be fancy
I meant -12 to 36
Using any number in that range for pitch gives a nice slow down pitch in terms of graph
private static final int NOTEBLOCK_RANGE = 24;
private static final int HALF_RANGE = NOTEBLOCK_RANGE / 2;
private static float calculatePitch(int step) {
return Math.pow(2, (HALF_RANGE - step) / HALF_RANGE);
}
Instead of like a steep drop
#1173863938459439206 still broken but with a different error of the same thing tho
love it!
Progress
not really
oh yeah frosty the conference "starts" today
the exact same thing is broken
got my badge n shit
still load priority issue
But now you have a different error
So its something
At least that is easy to fix
nope
because its the exact same issue as i had before
except yall made me remove lateinit
so its the exact same issue but in a different way
Just use the server load event before doing stuff
This should ensure plugins have initialized. But what are you initializing ?
Typically plugins dont require you to initialize them
Or even some libs
trusty chatgpt gave me this lol
Hmm
(it in fact did not work)
That last one might be interesting
F
ur telling me it was here whe whole time
smhsmh
not me copy and pasting every single formula, putting it into chatgpt and asking it for a formula that produces such formulas
i can see documentation great documentation of code places, but is there any website that also shows examples of the code being used? some things i just dont understand just by reading what inputs they can take
tabnine provides code snippets
tabnein
how can i cancel player turning head
?paste
There should be more to this exception below
is there a Good way to get all connected slime blocks
Recursion idk
public void onJoin(PlayerJoinEvent event) {
Player player = event.getPlayer();
for (Rank rank : Rank.values()) {
player.sendMessage(rank.rankName);
}
}
public enum Rank {
ADMIN ("ADMIN", "ADMIN | ", 1, ""),
DEV ("DEVELOPER", "DEV | ", 2, ""),
public String rankName;
public Component rankPrefix;
public int rankPriority;
public String rankPermission;
Rank (String rankName, String rankPrefix, int rankPriority, String rankPermission) {}
}```
why is rank.rankName null if i try to send it to the player?
Because you never set it
isnt an enum always set?
Rank (String rankName, String rankPrefix, int rankPriority, String rankPermission) {}
Not if you never assign the variable
you need to set it in the constructor
You are just declarinng the params
okay, thank you
looking for opinions on this, think this looks good?
Looks good but see if you can get rid of the overlapping numbers
also the arrows bouncing off does look a bit weird
the plugin has custom arrows so i figured them bouncing off was do you dont have to spend them to test your damage
ill give em a little more space so they dont overlap
You could make them stick to the armor stand