#[MEGA THREAD] Get Your Code Reviewed or Review Others
1 messages · Page 14 of 1
That's what math is for
Ig though it makes sense if the server lags now that I think about it
Because of the server lags the time would he wrong
so what? i asked how to do it before and they told me to do it like that
this is also wrong because the scheduler uses ticks afaik and not ms
you'd need to convert it to seconds and then do * 20
not ms
oh
what do i actually do..
i think my solution is right but i think i forvot to multiply
Yeah they were originally correct I made a nitpick without thinking about the full issues that could arise given your server isn't at 20tps
okay cool thsnks
this means "target" folder?
okay thanks im new to github
and git
can i just name my main class "Plugin" instead of "Main" if i dont want to name it with the name of plugin or something
okay i think thats not a good idea either
give it some name
Name it after your project
yea ^
okay but i never liekd it
For example, if your project is named, foodgiver, name your main class FoodGiver
You could also have Plugin as a suffix
oh, can i just name it FoodGiverMain
Like so - FoodGiverPlugin
yes
I usually will just do (project name)Plugin
Oh
Purple said that already kek
yepp
Your main class should at least have plugin in the name, I think this is general plugin dev semantics when it comes to spigot anyway just makes it clear what the main class is
hm
https://paste.md-5.net/edefafewec.java I wrote this overnight and it probably has some kind of issue, but it works decently well in my testing.
that looks like chatgpt wrote it
well, it is a flood fill algorithm, it looks fine to me
thats all I needed to hear
I like the recursive approach more as it is easier to grasp
but the stack based approach is fine too
my plugin adds co2 poisoning
if you stay in a small area for too long
or there's too many people in an area
ohh I asked chatgpt about different flood algorithm impls and the breadth-first one looks pretty clean too:
public long floodFillBFS(World world, Location origin, long limit) {
Set<Location> visited = new HashSet<>();
Queue<Location> queue = new LinkedList<>();
queue.add(origin);
long volume = 0;
while (!queue.isEmpty()) {
if (limit >= 0 && volume >= limit) break;
Location current = queue.poll();
if (!visited.add(current)) continue; // Already visited
if (current.getY() < world.getMinHeight() || current.getY() >= world.getMaxHeight()) return Long.MAX_VALUE;
Material blockType = current.getBlock().getType();
if (!blockType.isOccluding()) {
volume++;
for (Vector dir : DIRECTIONS) {
Location neighbor = current.clone().add(dir);
queue.add(neighbor);
}
}
}
return volume;
}
yeah, only difference is the stack and the randomization of directions
i also store a vector instead of a whole location
if anything, I'd recommend using a normal random instead of thread local random for this kind of thing
that way you can unit test the thing properly
TLR is faster
you should use a specialized random though
if you need perf at least use a SplittableRandom
it's even faster
what
SplittableRandom has a different use-case
which is, being consistent across parallalel streams as far I remember
it isn't a matter of performance
they're all pretty fast on their own right
but the semantics for each one of these implementations are different
It's just randomizing the directions
I'm not generating keys here
so speed is good
speed isn't relevant to this
It's doing this randomization for every block
if you wanted to unit test the algorithm, then you can't do that with ThreadLocalRandom, as the seed will never be the same
In an area, it's randomly possible for it to always pick the direction that leads to open air
but for small certainly enclosed volumes, that randomization of directions doesn't affect anything
I see what you say but it's not really something I'm testing for, not that scenario. In that case, it'll either return MAX_VALUE or the limit, which is fine
use a splittablerandom
I just changed it yes
Its possible w some weird asm testing libraries iirc
but if u need that, ur app prob sucks
Either way don’t we have the RandomGenerator interface to abstract over now?
not all random instances follow that iirc
Which ones dont?
some library ones such as XorShift128 or whatever, it's one of the fastest implementations but I don't recall if it follows the interface
Nah its also backed behind RandomGenerator
It’d really make no sense if all the algorithms weren’t
Added configurability
https://github.com/NazarXeXe/XeXeGui/blob/main/tests/src/main/kotlin/XeXeGuiPlugin.kt#L25
https://github.com/NazarXeXe/XeXeGui/blob/main/tests/src/main/resources/config.yml (config.yml)
Added subrotues
https://github.com/NazarXeXe/XeXeGui/blob/main/tests/src/main/kotlin/RouteCommandTest.kt#L69
Need feedback :)
why does most of this code feel so similar to what we do at brawls
anyway, looks very cool. if you want some inspiration, may wanna check out https://github.com/mcbrawls/slate (shameless promo)
are users able to seperate components out of the GUI though?
as in, have them in a seperate class
Yep
that's cool
yeah pretty much. what we do is pretty much just
object ConfiguredTiles {
val QUEUE_BUTTON = tile { ... }
fun playerProfile(player: StandalonePlayerReference): Tile
}
same for the actual GUI objects, this is where I love those kinds of builders
I'm not sure I fully understand the routing thing though
Switch between GUIs like in a browser
ah

I'm currently just using interfaces-kotlin 
Might switch to yours once it's finished, we'll see
public class PartyConfiguration extends Configuration {
private final List<String> inviteMessage;
private final List<String> leaveMessage;
public PartyConfiguration() {
super("party");
inviteMessage = new ArrayList<>();
leaveMessage = new ArrayList<>();
loadJoinMessage();
loadLeaveMessage();
}
private void loadLeaveMessage() {
// empty the list first
leaveMessage.clear();
// load the messages
leaveMessage.addAll(getStringList("leave-message"));
}
private void loadJoinMessage() {
// empty the list first
inviteMessage.clear();
// load the messages
inviteMessage.addAll(getStringList("invite-message"));
}
public @NotNull List<Component> getInviteMessage(@NotNull Player inviter, @NotNull Player invitee) {
List<Component> formattedInviteMessage = new ArrayList<>();
LegacyComponentSerializer serializer = LegacyComponentSerializer.builder().build();
for (String message : inviteMessage) {
// Replace the %player% placeholder
formattedInviteMessage.add(serializer.deserialize(message
.replace("%invitee%", inviter.getName())
.replace("%inviter%", invitee.getName())
));
}
return formattedInviteMessage;
}
public @NotNull List<Component> getLeaveMessage(@NotNull Player player) {
List<Component> formattedLeaveMessage = new ArrayList<>();
LegacyComponentSerializer serializer = LegacyComponentSerializer.builder().build();
for (String message : leaveMessage) {
// Replace the %player% placeholder
formattedLeaveMessage.add(serializer.deserialize(message.replace("%player%", player.getName())));
}
return formattedLeaveMessage;
}
}``` erm can i do better?
the actual configuration class is taken from https://github.com/mfnalex/JeffLib/blob/master/core/src/main/java/com/jeff_media/jefflib/data/Config.java
my 2 cents would probably to extract the "formatting" to an external method which you can reuse.
you woulnt have to create a new LegacyComponentSerializer for every message
You can also just have a static legacy serializer somewhere
This is my first time creating a plugin soo can someone give some feedback on it?
please don't use ansi codes
especially in log files
Bukkit has methods for that.
@hexed heart This isn't completely necessary, but some people like to utilize "packages", little subfolders if you will which store Listeners and Commands respectively.
i mean i only have 2 classes
one for listeners
and one for a reload command
thats it
ReloadCommand feels very chatgpt
I understand, I was just saying when it gets bigger.
and main one
you have 3 
main class dont count eheheh
why
what should i name it then?
// Show correct usage after incorrect arguments
if (sender instanceof ConsoleCommandSender) {
plugin.getLogger().info("Usage: /nocreeperexplosion reload");
}
if (sender instanceof Player) {
sender.sendMessage(ChatColor.RED + "Usage: /nocreeperexplosion reload");
}
Whats the point in the distinction, just do if not instance of player.
No its not about naming
the content
@Override
public List<String> onTabComplete(CommandSender sender, Command command, String label, String[] args) {
List<String> suggestions = new ArrayList<>();
if (sender instanceof Player player) {
if (player.hasPermission("nocreeperexplosion.reload")) {
if (args.length == 1) {
if ("reload".startsWith(args[0].toLowerCase())) {
suggestions.add("reload");
}
}
}
}
return suggestions;
}
Whats the point of this?
ohh paramater, duh.
tab complete
Yeah I thought this was a standalone command but realized now it's /nocreeperexplosion reload
Also you dont need to do:
private final Plugin plugin = NoCreeperExplosion.getPlugin();
Because you can just pass the singleton instance directly.
So. For instance:
public class ReloadCommand implements TabExecutor {
private final JavaPlugin plugin;
public ReloadCommand(JavaPlugin plugin) {
this.plugin = plugin;
}
... // Your other stuff will go here
?di
Guide to dependency injection: https://www.spigotmc.org/wiki/using-dependency-injection/
Yeah
Also general practice, try to avoid massive nesting.
// Check arguments
if (args.length == 1 && args[0].equalsIgnoreCase("reload")) {
// Reload the configuration
plugin.reloadConfig();
// Send confirmation in console
plugin.getLogger().info(ANSI_GREEN + "Configuration reloaded successfully." + ANSI_RESET);
// Notify the player
if (sender instanceof Player) {
sender.sendMessage(ChatColor.GREEN + "Configuration reloaded successfully.");
}
return true;
}
Could just simply be:
if (!sender.hasPermission("nocreeperexplosion.reload")) {
sender.sendMessage(ChatColor.RED + "You do not have permission to reload the configuration.");
return true;
}
// Validate arguments
if (args.length != 1 || !args[0].equalsIgnoreCase("reload")) {
sendUsage(sender);
return true;
}
oooo
isnt this called a guard clause
yes
i like guard clauses
then why aren't you using them
sorry
idk i just call him john
Dude you dont have to apologize to us! This is a code review afterall.
As with most of the improvements you could make, they may not directly impact the performance of your plugin, but they can be as simple as readibility and good habit.
also what does singleton mean
In object-oriented programming, the singleton pattern is a software design pattern that restricts the instantiation of a class to a singular instance. It is one of the well-known "Gang of Four" design patterns, which describe how to solve recurring problems in object-oriented software. The pattern is useful when exactly one object is needed to c...
Not sending you links to drown you in stuff you cant keep up with, its just because i genuinely cant explain it :)
// Show correct usage after incorrect arguments
if (sender instanceof Player) {
sender.sendMessage(ChatColor.RED + "Usage: /nocreeperexplosion reload");
} else plugin.getLogger().info("Usage: /nocreeperexplosion reload");```
like this right? if player use .sendMessage, if NOT player then just do getLogger
also i just like the static getter method more
instead of the injection ahh method
You're right, it may look cleaner, but theres always reasons why we do things "the right way".
its like, using both feet for your car pedals might seem easier than switching, it can cause accidents, theres always reasons for these things :)
oh but isnt the static getter method more easier and safer
uhm
you can just call the getPlugin() method anywhere
that's the singleton pattern
it's not "safer"
why not
because why would it be safer
not safer, but id say simpler
Guide to dependency injection: https://www.spigotmc.org/wiki/using-dependency-injection/
Its listed all under * Why not to use the static singleton pattern*
okay
also any comments about the config.yml?
purrrrrfect
as an absolute beginner i shouldnt really worry on perfecting everything
got my first plugin out
feeling happy :)
and thats what matters
you can check it out now, i changed some stuff just like u said
Name your packages lowercase
Why are you registering two different instances of the reload command
Also no need to send the command usage like that
either return false or just send it to the sender
Not to the logger
Don't hardcode ANSI, not all consoles support it
You already seem to have gotten this feedback though
Should fix it before asking again
when you answer it sometimes feels like you are yelling at me lol, i think he has the same feeling
but i dont want the reload command, shuld i just use the java file wataching api whatever that is?
i just came back to that code xD sorry for replying that late
I mean you can, but prob aint necessary
thats like if u wanna monitor all file updates
so what do i do :c
i need to have config which player can edit both in file and through minecraft (command etc) so what do i do if not reloading and saving every time?
Me in particular???
use class with all settings
no, people
what does it change
public class CreeperListeners implements Listener {
private final NoCreeperExplosion plugin;
private boolean shouldCreeperGrief;
private boolean shouldCreeperDamageEntities;
private boolean shouldCreeperDamagePlayers;
private boolean shouldCreeperSpawn;
private boolean shouldCreeperTarget;
private boolean shouldCreeperDamageTamedAnimals;
public CreeperListeners(NoCreeperExplosion plugin) {
this.plugin = plugin;
loadConfigValues();
}
public void loadConfigValues() {
shouldCreeperGrief = plugin.getConfig().getBoolean("creeper-explosion-grief");
shouldCreeperDamageEntities = plugin.getConfig().getBoolean("creeper-damage-entities");
shouldCreeperDamagePlayers = plugin.getConfig().getBoolean("creeper-damage-players");
shouldCreeperSpawn = plugin.getConfig().getBoolean("disable-creeper-spawning");
shouldCreeperTarget = plugin.getConfig().getBoolean("disable-creeper-aggression");
shouldCreeperDamageTamedAnimals = plugin.getConfig().getBoolean("creeper-damage-pets");
}
// Disables creeper griefing
@EventHandler
public void onCreeperExplode(EntityExplodeEvent event) {
if (shouldCreeperGrief) {
return;
}
if (event.getEntity().getType() == EntityType.CREEPER) {
event.setCancelled(true);
}
}```
is there any error you getting?
Why are you loading your config values in the initializer?
yeah that's too
well i was reading the config values in each event
then one guy said, thats resource intensive
so i did this
load it once

no but is there anything wrong with the logic or process
btw i'm just a intermediate, just started coding a little bit
When Cloudy introduced themselves, it seemed as though they were in the same boat as you. Not sure what you expect them to review.
idk about preformance
exactly lol
ooh me too, but im a newbie
i suck more
soo what do you say about the code? is it good? upto standards? 👍🏽
This is wrong. Each time you invoke .getConfig() you are getting the state of the config that was initalized in memory when the config was loaded to begin with. It isn't reading the file eachtime, if that were the case it would mean that whenever you updated the config, the values would update in realtime, but as we know that's why plugins require reload commands.
There is no difference in just reading from normal memory. And if anything, if you wanted to "pre-initialize" these variables (regardless if it is required or not) why not do it in Main, instead of every listener or an arbritrary listener.
Reading from memory is what you do when you retrieve a variable value irrespective.
what would you do here, read the values and store it in Main
No. I would literally just do plugin.getConfig().getBoolean("creeper-explosion-grief"); wherever i need it.
ooh
As I told you, who-ever that dev was, is wrong. There is no performance problem.
so that guy who said "its better to just read the values once" is dum-
Yes because it is already being read the moment the plugin starts. Everytime you run getConfig you arent re-reading the file, you're simply retrieving values from an existing object YamlConfiguration
no i said idk about preformance, cuz i don't know actually
i didn't say there was preformance issues
it seemed fine
I'm not talking about you.
He said some other dev told him to handle configuration values like that to save resources
^
oooooooooooooooooooh, so what im doing here is actually just making things more complicated
... miss understood
Yes.
yo what tutorial series are you watching? Orrr are you one of those 😨 the doc readers
??
lol
yeah
are you watching a tutorial series?
i just watched a Java course on youtube and understood the syntax and that's it
and bukkit API stuff i search for
nah
ohh so you havent started a spigot course
...docs
i just search on internet not necessarily docs
watch kody's series, its pretty good
have you made any projects
i learne basic stuff from him like listeners and commands and guis
sad thing i haven't made any "official" or a finished project plugin
Not everyone watches YT vids :) I never learnt java
so how you learne?
you never learnt java? me too (maybe thats why i suck)
What I mean is, I never actually watched any videos, read any books, courses, or sites about Java OR Kotlin.
Learning by doing is always the best way but make sure to get some fundamentals in first
SO TRUE!!!
dude i wanna be your student 😭
nah you don't
well i wanna learn along with you
i once tried "co-learning" with someone i found on a discord server. Literally 1 day later, he went back to playing hypixel bedwars on feather client 24 hours a day
using feather client is crazy
if you want to learn from someone, don't learn from me lol
ikr
i just started
and his whole motive to learn spigot development was because he wanted to backdoor in his friend's smp
me too, well 3 months ago but i procrastinate too much and my brain is bad at processing information quickly
I learnt spigot in 2021 because diamondfire is too expensive
what's diamond fire
Block coding
I know you said this a couple messages up, but I was still thinking about this cus I relate to it. learning by following is pointless. I tried to learn python when i was maybe 11?, but I dont think the inspiration and innovation was fully there. I was just following what a guy was writing on YouTube, no ideas of my own and nothing to help me expand my knowledge.
When I eventually revisited it, for a purpose when I wanted to make a program, I found it easier to learn when I had a drive and purpose.
In terms of Java I never actually bothered learning Java when I picked it up, since I already was proficient in C and thus fundamental programming concepts, Java was easy to pick up with never really reading, just had to practice
relatable
just that I do NOT want to touch C/C++ again
one of retros projects got this treatmnet
do you concider yourself an expert?
Which one of us?
both lol, cuz i have questions
stuff on servers i can't figure out how they do stuff
like mcc or any server that is like bedrock servers: fancy animations and models
oh i know
they use blockbench to make the models, and bedrock has a lot of support from mojang for these type of stuff
Bedrock server impl are ass rn
like theres a plugin in blockbench callled "Entity Wizard" which will compile everything for you and make an "addon" for you
Not completely. I don’t have any plugins of my own. Just contributions to existing plugins, but pretty popular ones. .
"addon" is like the equivelant to mods in java but worse
you can add me if you ever wanna ask about plugins or servers though. Although I haven’t made much I do have a good understanding of textures and models and shit.
if you wanna make cool animations and models in java, you gotta use a plugin like modelengine which basically translates your models and animations into java edition
i want to figure out how they got the animations from just a file and transformed it into a item display and animated it in minecraft
yea, those wizards will make you an 'addon', just like a datapack
isn't it pay walled?
ehhh kinda
modelengine is sort of a freemium plugin
i think you can import upto 12 models for free, then you gotta pay
i want to recreate it
Well I know a good bit about resourcepacks, font fuckery and shadery
it doesn't seem easy but...
theres this one thing
You're gonna lose interest after few hours of coding 😂
Just use AnimatedJava
but its not plugins
what's that?
Because it cannot generate a jar
a plugin in blockbench
It's a blockbench plugin which you can use to create animations, it generates a datapack which you can add, which will add functions and triggers for those animations
Ohhhhh
rad shhh
?
for once i wanna be the guy who can give the answers
but i want a plugin not a datapack
Why?
cuz fun
model engine is the only way then
I've used it a lot
We were working on Fabric integration for AJ a bit ago, not sure what the state of that is
CloudyHI, you are just like me lol. I had these same questions like a few days ago
yeah
It requires being good at trigonometry and quaternions in general
so i have to learn those first
You can't just decide which vertex goes where lmao
unless you're doing some stupid fuckery with shaders
like really fucking stupid
no
I mean you CAN use them but that would be a stupid ass unstable fuckery shitshow
orrr you could not try to recreate this complicated shit
why not
Get back to spigot coding fr
its too big, requires a lot of experience and skill
and you cant do it alone
I mean, you can
you need more devs in on it
More important part is time
Magma did it mostly alone afaik
stop it rad, stop giving him hope that he can rebuild effiel tower by himself
magma is big brain
Fuck off IJ, parsing a 650 line kotlin file can't be that hard
lol
intellij be like: lemme just check those ,
and ;
wanna code a plugin together? something simpler than fricking modelengine itself
You typically don't use semicolons in kotlin but sure
oh really?
that shows i didn't use it before lol
the only place I actually have a ; is in fonts
i use Java for now
good decision (I'm saying this to annoy rad)
Thanks raydan
yes
yes
yes
?img
Can't send images? That's because you're not verified! Use !verify to complete verification.
Alternatively, you can upload screenshots to any image hosting site and share the link.
Here's some screenshot utilities that you can use to upload images.
Lightshot: https://prnt.sc
Imgur: https://imgur.com/upload
Flameshot: https://flameshot.org
Cloudy, have you tried tiramisu before?
man you crazy
how th did you make that
i don't remember actually lol
??? whatttt how?
this is what i need exactly
well maybe but
how do you show your mouse without rotating your head? and interacting
and can you tell where is the mouse location?
you can change a player's camera regardless of their position
btw cool textures
You made this or someone else
bunch of maths
me :)
im gonna go crazy
Marry me.
is it just symbols?
I had to make textures for these using my sprite system since unicode block symbols apparently don't have a fixed width
oh
anyway this should really go to #general
must*
can i unverify myself?
this account name is so old i hate it
hello jana7_gamer
?changename
Name changes on the forums are granted to those who have donated to the project. Donations are processed manually and generally take up to 24 hours. The donation widget can be found on the home page of SpigotMC at: https://www.spigotmc.org/.
damn lmaoo
bro this is tooo cringe
thank god i chose a normal name
sad
ik but isn't he taking a precentage of payed plugins?
but paying to change a username is crazy
no afaik
whats afaik
as far as i know
oh
He's an attorney, which is close enough to a lawyer
Check his LinkedIn if you want confirmation
me when I pull up to wolvereness' lawsuit on sploon with md_5 as my attourney
And md takes no money from spigot that we know of
afaik you are a very handsome man
Don't tell voss u said that
real
ngl that'd be funny as shit
no idea
entity
bedrock or modded or optifine
i mean what are you trying to make
oh you wanna use model engine?
then just create a generic model i think, and upload the .bbm file to the "blueprints" folder in ModelEngine
in plugins folder?
in the ModelEngine folder
oh ok
#general
so your model won't be messed up
ok
tysm
can someone review code i totally made and wasnt made by an ai and im asking people here to make sure the code is efficient and ddoesnt ruin my server pleaseandthankyou
if you don't know how to code I'm not going to waste my time on ChatGPT code
if you have a question and actually know how to code #help-development
otherwise hire someone AI can't replace a software engineer
this channel is for code review and I highly doubt anyone here wants to review ChatGPT
ive been looking.
online and in the minecraft forums and on the discord
chat gpt was my last resort 😭
i dont really like the use of AI but im kinda on my last straws here ngl
but understandable
just take the few months it takes and learn how to code or pay someone
coding is a beneficial skill anyways
It is indeed
A few months is a long time.
not really in the grand scheme of things, but if you want something immediately that's what money is for
true
Wowzers
Sigma sigma boy sigma boy sigma boy
oh god I haven't even gotten to the error messages
"You are not sigma" as insufficient permission is wild 💀
} catch (Exception e) {
sender.sendMessage("Report this to a sigma");
e.printStackTrace();
}```
https://www.youtube.com/watch?v=PSnPOYeTW-0
this man is out of his mind
Adding bodies to my procedural spider.
Previous Videos:
2. https://youtu.be/r70xJytj0sw
Source Code:
https://github.com/TheCymaera/minecraft-spider
World Download:
Spider Garden: https://www.planetminecraft.com/project/spider-garden/
Ambertry Forest: https://www.planetminecraft.com/project/ambertry-forest/
All...
what does that have to do with this thread
i have a question, he said in his video at around 5:55 that servers are able to get inputs directly
to ask a question
in 1.21.4
oh ok
go to #help-development
ConfigurationSection dailyConfig = this.file.getConfig().getConfigurationSection(s);
String requirement = "";
//Current types
String typeName = dailyConfig.getString("Type");
String entity = dailyConfig.getString("Entity");
String block = dailyConfig.getString("Block");
String item = dailyConfig.getString("Material");
//Check for different types.
if (typeName.equalsIgnoreCase(String.valueOf(DailyTypes.KILL_WITH_ITEM))) {
requirement = entity;
} else if (typeName.equalsIgnoreCase(String.valueOf(DailyTypes.KILL))) {
requirement = entity;
} else if (typeName.equalsIgnoreCase(String.valueOf(DailyTypes.DAMAGE))) {
requirement = entity;
} else if (typeName.equalsIgnoreCase(String.valueOf(DailyTypes.MINE))) {
requirement = block;
} else if (typeName.equalsIgnoreCase(String.valueOf(DailyTypes.OBTAIN))) {
requirement = item;
}
int amount = dailyConfig.getInt("Amount");
DailyType type = new DailyType(dailyConfig.getString("Type"));
return new DailyRequirements(requirement, amount, type);
}```
Eh.. no
eh?
Can be better
Learning, whats the problem?
Let's say I want to add another type
I'll have to duplicate code
There's no way to do it via API and there's no need for DailyTypes to be an enum
The first, simplest improvement we can do (without fixing a flawed structure) is making the association between daily type and config "string"
You can do this with a map or you can embed it in your enum
(KILL -> Entity, MINE -> Block)
If you want a proper structure you can either have a "TypeRequirement" enum/interface (ENTITY, BLOCK, MATERIAL) or make types abstract and have them load their own values from the config
I forgot about interfaces, I did this before. Let me redo some stuff and come back. I thought it was a bit repetitive thats why i came here
Repetition means you can abstract it away
I can never find a good use for enums tbh
In short you want to make it so any plugin can add custom requirements / objectives without having to fork
Their use-cases are quite limited
Interfaces give the flexibility of enums without the drawbacks
Only time you want enums is when you want an inflexible structure
I do this type of stuff sometimes, not the best ofc but it works
Like for example, ClickType being limited to LEFT, RIGHT and MIDDLE_CLICK
ew
That can be an interface
can it be tho?
it'd make no sense for it to be
and you can have a class of constants
like BrushModes that just holds all the builtin modes
I want to be able to add a paint bucket via API
that looks like a rust enum xD
what makes you assume there is API
they shouldn't, so fuck them
the issue is that this mode is not a closed set of things it could be
don't make me use unsafe to modify your manager classes to allow custom tools
its pretty easily feasible to just add more stuff
If it's open to extension make it an interface
but then again I am hypocritical since my message translations are done with an enum
you'd have to add a button (because they are hardcoded) and since this is a mod you should probably do fabric asm
we have a couple enum classes at work
make your lib add buttons automagically
And they also can't have functions or abstract stuff, you have to use a giant match everytime 
not for specific entries tho
right
https://pastes.dev/TZ73NsWo7i Need some feedback for this lil custom item system
I feel like I should not store a key as string in PDC
Kotlin scares me
Kotlet
Yeah
I don't really have any better idea though
Item sprites only have the key and custom model data as identifiers
and custom model data also depends on what item
so can't use that for comparison
why dont you create a custom PersistentDataType for NamespacedKey if you want to store the full key?
I guess I could use the registry idx of the sprite?
You have two issues with this:
persistentDataContainer.set(TYPE_KEY, PersistentDataType.STRING, key.toString())
1: when ur converting the NamespacedKey to a string and back, thats just introducing a potential for errors and loses type safety.
2: I think string comparisions are slower than primitive types or direct references comparisons.
Like I said, mayb make a datatype?
object NamespacedKeyDataType : PersistentDataType<String, NamespacedKey> {
override fun getPrimitiveType() = String::class.java
override fun getComplexType() = NamespacedKey::class.java
override fun toPrimitive(complex: NamespacedKey): String = complex.toString()
override fun fromPrimitive(primitive: String): NamespacedKey = NamespacedKey.fromString(primitive)!!
}
Yeah I guess I could, but that would still be somewhat inefficient
Also that data type would barely change anything fyi
I should probably just do this
persistentDataContainer.set(TYPE_KEY, PersistentDataType.INTEGER, itemId)
?
yea
yeah do it
persistentDataContainer.set(TYPE_KEY, PersistentDataType.INTEGER, BlockBrawlItems.indexOf(this@BlockBrawlItem)) feels a bit silly considering it assumes that the current instance is registered
eh ig I could make teh function open
Okay, after restarting this code i think i got it. First time using enums like this.
public enum DailyTypeEnum {
DAMAGE(new DailyType("damage"), "Entity"),
KILL(new DailyType("kill"),"Entity"),
KILL_WITH_ITEM(new DailyType("kill_with_item"),"Entity"),
OBTAIN(new DailyType("obtain"), "Item"),
MINE(new DailyType("mine"), "Block");
private final String objective;
private final DailyType dailyType;
DailyTypeEnum(DailyType dailyType, String objective) {
this.dailyType = dailyType;
this.objective = objective;
}
public DailyType dailyType() {
return this.dailyType;
}
public String objective() {
return this.objective;
}
}```
```java
public DailyRequirements getDailyRequirements(String name) {
ConfigurationSection dailySection = this.getConfig().getConfigurationSection(name);
int amount = dailySection.getInt("Amount");
DailyTypeEnum dailyTypeEnum = DailyTypeEnum.valueOf(dailySection.getString("Type").toUpperCase());
return new DailyRequirements(dailyTypeEnum.objective(), amount, dailyTypeEnum.dailyType());
}```
the yml its grabbing from
KILL_ZOMBIE_WITH_AXE:
Type: kill_with_item
Entity: zombie
Item: iron_axe
Amount: 10
Rewards:
Commands:
home: "/maxhomes {player} 1"```
The idea to the enum is to detect what daily type it is and to select which field it needs: kill > Entity etc
and that also makes it easier for if i release the plugin for people to add their own daily objectives. by just making a new constant
HUG(new DailyType("hug"), "Entity")```
since we like objects and enums maybe String objective could be replaced
no need to call your enum class enum
but thats just preference
It's just odd. Like calling your Main class "MainClass"
presumably you do wanna deal with error handling, in this case DailyTypeEnum.valueOf() throws on a misinput (try catch)
I love my CoolPluginEntryMainClassJavaClass
CoolPluginEntryMainClassJavaClass.kt
CoolPluginEntryMainClassJavaClassKotlinMainPluginClassKt.kt
SuperUltraMegaCoolAwesomePluginEntryPointMainClassImplementationHandlerFactoryJavaClassBaseAbstractImplKotlinCompanionMainPluginInterfaceKtExtension.kt
.bak
Never said I liked them just didn't know a better way. What would I replace objective with? that detects what the type is looking for in the config
KILL_ZOMBIE_WITH_AXE:
Type: kill_with_item
Entity: zombie
Item: iron_axe
Amount: 10
Rewards:
Commands:
home: "/maxhomes {player} 1"
if its type is kill_with_item than it looks for Entity: zombie
I just thought it was better than switch cases or if statements
Registry!
let me google this
so just using a model pretty much?
probably store it in a hashmap
I mean what you’re doing can be seen as somewhat advanced data driven parsing where the value of one node influences how the data is parsed and used from other nodes
this made my brain go durrrrrr
xD
If you can resolve it with polymorphism, that is finding a different implementation of how to read the config depending on that initial value I think you’re all set
Ideally you define some interface and then u map “kill with item” | “obtain” | … | etc to an implementation of that interface dependent on what u need
I kinda started this but didn't get nowhere with it.
public interface Types {
void setEntity(Daily daily, EntityType entityType);
void setBlock(Daily daily, Block block);
void setItemStack(Daily daily, ItemStack itemStack);
}```
Do you want like a skeleton for how I’d do it (more or less)?
Anyway enums are cool, they have nice semantics but they are often somewhat too imperative in Java and a lot of the times you benefit from distancing yourself from those, especially since they don’t support type parameters (generics) and enforce recompilation on modification - worth mentioning a lot of java library devs tend to define an interface on top of an enum (letting the enum implement that interface) as to not troll ur future self
Material.class
like calling your int int
no
😔
final int int40 = 40
nooo since its keyword lol
print(int40 + 10)
is it an actual keyword tho
if (boolean == true) {
return true;
} else if (boolean == false) {
return false
}
yes
as in, hardcoded into the compiler
what
idk what u mean bro
🐧
i dont know about ints
i think its an int
my friend is angry at java because he has to write boolean not bool
after googling I have come to the conclusion that it looks like a keyword
Intellisense 
I mean you can change the highlights lol
imagine having reserved keywords for primitives
imagine having primitives
this post was made by the kotlin gang
im joking 😭
kotlin does not have primitiveS? what
Imagine boxing
Always was always will br
what
well more like a boolean is made of ints
its not like a boolean only takes up a single bit
Qubits would like to speak with you
Nerds would like to argue with you about the current practicality of quantum computers
more like the forever practicality
I strongly believe quantum computers aren't going to be the next thing, but something else like photonic computing
though there's also photonic quantum computing but we don't talk about that
🙏
I try not to be super speculative about technology because tech likes to prove us wrong
it's fine to be speculative, it feels good to be proven wrong about something you have no expectations and see it actually succeeded
when it comes to quantum computing, it just feels like the next nuclear fusion
we're just perpetually 30 years away from it
30 more years bro it'll happen
quantum computing or nuclear fusion? One's been pushing that deadline for a while now lol
Nuclear fusion fs I mean its only gonna be 30 years maybe in a few years it'll be down to 29.9998 years
crosing fingers 🤞
I think a year ago or so we gained energy from the reaction excluding all the energy that was poured in lol
I remember seeing it all over the news I looked at the science impressive but not power plant impressive
the science of it always looks impressive, it is the results that leave things to be desired
besides with such complex pieces, one starts to wonder just how more complex does it have to get in order for it to be actually usable
then again, chip processing got to that point where it is unfathomably complex process and it became economically feasible so I won't completely ditch the idea of it just being that complex
nope
that would mean more overhead for storing a single bool
usually variables are just in registers with a set amount of space
oka
a boolean uses 64 bits on an x64 system i believe
boolean size in Java is VM dependent
many booleans may be able to be packed into bytes
8 booleans in 1 byte
By default it takes up 4bytes on the stack. However it is typically backed by an integer like most things. Only stuff requiring to be 64bits is backed by 64bits.
Now granted there is nothing requiring jvms to back booleans by an integer or anything else
However as for the stack goes it will always take up 4 bytes
If you're not busy that'd be great.
ive completely redone this again
no enums just classes
?paste
now im trying to figure this out.
public interface Types {
void type(Type type);
void objective(Objective objective);
}```
its doing as i want. im just tired of redoing this now
If you're willing to get fancy with your interfaces you can do more than that
with abstract objectives :)
For example, your damage zombie quest would consist of:
- Quest metadata (name="damage a zombie?")
- Quest objectives ([type="mob-damage", target="zombie", amount=1])
- Quest rewards ([type="item", item=ItemStack{DIAMOND x 100}])
might be worth looking into the factory pattern
types would go into a factory registry
I'd do something like
public interface QuestObjectiveProvider {
QuestObjective provide(MyPlugin plugin, ConfigurationSection data);
}
public class QuestObjectiveRegistry {
private final Map<String, QuestObjectiveProvider> providers = Map.of(
"kill-mob", KillMobsObjective::new // add more here or rework the class to be a proper registry, im lazy
);
public QuestObjective load(String id, ConfigurationSection data) {
MyPlugin plugin = ...; // DI this or whatever
QuestObjectiveProvider provider = this.providers.get(id);
if (provider == null) {
return null;
}
return provider.provide(plugin, data);
}
}
and you can do your objectives however, a quick an easy way is to make them interfaces that register themselves or whatever
another way is to have objective types and dedicated listeners for them
up to you
public class KillMobsObjective extends AbstractObjective {
private final Collection<EntityType> targets;
private final int amount;
public KillMobsObjective(MyPlugin plugin, ConfigurationSection data) {
// load stuff
subscribe(EntityDeathEvent.class, this::handleDeath);
}
private void handleDeath(EntityDeathEvent event) {
LivingEntity entity = event.getEntity();
...
Player killer = entity.getKiller();
...
addProgress(killer, 1);
}
}
type deal
Adding progress can trigger a chain of events that leads to the quest being complete and rewards being handed out
Keep in mind this is just one of the ways of doing it, doesn't mean it's the right one
Thanks for this, im going to look into providers because that confuses me.
In short KillMobsObjective::new gets converted to an interface
Looks a bit like this
public class QuestObjectiveRegistry$1 implements QuestObjectiveProvider {
@Override
public QuestObjective provide(MyPlugin plugin, ConfigurationSection data) {
return new KillMobsObjective(plugin, data);
}
}
And this only works because the constructor signature matches the interface method's
Yeeting all these "provider impls" into a map allows us to basically create an instance of whatever subtype we want based on a string input
Meaning
"kill-mobs" -> KillMobsObjective
"mine-blocks" -> MineBlocksObjective
So registery is pretty much your own hashmap system in a sense.
It uses a map
But it doesn't map "A" to "B"
It maps to an interface that creates a new object of a given subtype
And it's an interface because we need different parameters for different quests
I took a glimpse at somebodys explanation on youtube and was like huh so a model with a map? xD
still very new to to programming. so anything thats not hashmaps and basic stuff is foreign to me
yeah you can explain it like a champ so i guess you know this pattern xD
so if i do it this way i gotta restart all this again xD
It happens, that's the process of learning
tell me how bad this is https://github.com/MrArcane/Dailies
using System.out is -1 point
It’s barely acceptable
- By looking at the commit message, it seems that you used github's file upload feature instead of properly initializing a git repository for your project, I recommend learning what git is and if you are uncomfortable with a terminal, use github desktop or something
- You didn't seem to use a build system either, take a look at maven or gradle, that will help tracking dependencies of your projects so people aren't left wondering what you use on it
Yeah i was using intelij and for some reason its messed up
He is using maven
the pom is just not at root
oh you're right, I just didn't see it at the root yeah
yeah for some reason intelij and github doesn't wanna connect so i just gave up and copied the files over
well other than that, there are some minor things like using sysout for logging and naming a class "File", but it looks fine logic wise
Idk what else to name it lol\
dailiesFileReader or something
it seems to manage the dailies configuration so just DailyConfiguration or something
though atm the abstraction seems a bit pointless since all the work is being done in DailyFile now anyways
the reason File is a bad name is simply because it isn't descriptive of what the class does at all, and it conflicting with the JDK's File class name only makes that worse
but if it is just going to be used for this project, it's eh, not the end of the world either
just not a good rule of thumb
the comments in the classes also lead me to believe you used AI to some extent to generate code, which is fine if you take the time to understand what it is doing but I strongly recommend not just mindlessly copying the files when learning otherwise you're not going to progress much
what comments
the ones in the DailyFile class
oh
doesnt really look like AI to me
I make comments like that all the time
maybe I am an AI 💀
it could be either way nowadays honestly, I might be reading too much into it however the advise still applies
yeah
no its a file wrapper
nope thats just so when i come back to it at some point i can understand it 😂
I've redone this part 3 times, i first did it in dailyManager and was like that isnt right because DailyFile should know its own contents because i just did stuff like
public String getString(String s) {
this.file.getConfig().getString(s);
}
AI is pointless for beginners. @woeful pasture taught me that awhile back.
At this point i've learned almost everything from this discord and by trial and error.. I appreciate everything everyone has taught me. i took that and been redoing my main plugin for awhile
That’s good, I do think AI can be helpful in explaining concepts etc, but you’re always in for a ride if you go down that route - sometimes AI is just gonna mega troll you no skibidi
never say that again
wtf is that even a saying...
Anything that could be imrpoverd here?
private void yeetTheOhioCheck(Player frfr) {
if (frfr.hasPermission("brainrot.ohio")) {
giveAura(frfr);
}
}
private void giveAura(Player noCapPlayer) {
noCapPlayer.setGlowing(true);
getServer().getScheduler().runTaskLater(this, () -> {
noCapPlayer.setGlowing(false);
noCapPlayer.sendMessage(ChatColor.AQUA + "skibidi aura just got real quiet");
}, 200L);
}
private void rizzCheck(Player respectfully) {
if (Math.random() < 0.5) {
respectfully.sendMessage(ChatColor.GREEN + "NO CAP YOU GOT THE RIZZ FR FR");
giveSkibidiEffect(respectfully);
} else {
respectfully.sendMessage(ChatColor.RED + "NAH BRO YOU GOT NEGATIVE RIZZ, BACK TO OHIO");
}
}
private void giveNegativeCanthalEffect(Player canthalPlayer) {
canthalPlayer.addPotionEffect(new PotionEffect(PotionEffectType.SLOW, 400, 1));
canthalPlayer.sendMessage(ChatColor.GRAY + "That negative canthal tilt got you slowed, bro.");
}
Instead I will now review your 5 month old code from this repository https://github.com/abb3v/Anvil
Overall the project isn't horrible, however I have a couple nitpicks, one the project name makes very little sense. The name "Anvil" Doesn't really tell us what its doing, until I read the code I had no clue this was a silk spawner mod. Pesronally not a huge fan of gradle groovy but that's okay I guess. Another thing is if you're going to have a mod maybe you should update it. your minecraft version is 1.21 things have changed a decent amount. I wonder about the necessity of BlockAttackHandler considering how little is done I really don't see the point of not just making it inline. Also not a huge fan of the hardcoded message I see in there, this really isn't friendly to users who don't speak english. Seeing as you're using the Fabric API why not use their EnchantmentHelper.getLevel(enchantment, itemStack) method which returns 0 if the item isn't present. The appearance of hasSilkTouch and hasFortune really makes no sense you could probably get rid of this entire class too be completely honest.
THIS IS HORRIFIC
screw you 😭
Why did you go digging through my profile just for that
Anyways, the name & Tagline is AI generated.
okay idc
think twice something constructive will be reviewed whether you like it or not, its the way the world works. You come to a code review channel you get a review you don't have to like it
Okay what r u getting toxic for? I meant my code is horrific.
I'm just a troll 
I'm going to be honest. I never learnt Java. I only learnt java to contribute to Meteor Client. I only really have programmed in C before.
My friend asked me to build a mod that would prevent them from accidentally breaking spawners on an SMP, so I made that shit in under 30mins. I literally NEVER touched Fabric before or after that.
okay back to watching anime I wish you had more recent projects what's with all the forks bro
oh god only C wtf 💀
do you like only do embedded systems
and kernel dev??
What forks?
Yeah
meanwhile my arduino rots in my drawer :*(
Also, there was a reason why I didnt use "EnchantmentHelper.getLevel". And I cant remember why. I knew it was a thing, but I purposefully didnt use it, and I cant remember why.
I've not touched fabric in my life lol I'm not fit to like actually review a fabric mod
When I made that Mod, I was planning on making an Options UI, where you could set it to prevent or Warn, and change the messages, but I wasnt bothered learning lol.
But also what forks?
I do have more recent projects
yeah you forked a couple repos the past few weeks
Yeah cus I contributed back
Although its not on my Profile, I've added a lot to the codebase for https://modrinth.com/plugin/lifestealz
and also, im not sure, is it safe to delete a repo after the PR is merged?
yeah it is
that's what I usually do unless I frequent contributions
gotcha
gitlab's merge request page even has a 'delete source branch?' option so yes it's fine
I usually don't in case I will ever need it anymore
If you force compiler to accept it then it will work
Just gotta do bytecode fuckeru
eclipse
Because obfuscators do that
Kotlin accepts it
they also just rename it fyi
Alright so I'm ready to ban this person
🙏
can you ban neon too
Been there. Done that
do it again
Wasn't me. But we are a collective
aw
yeah were all rad clones
No I tease :p
You could mayyybeee try to cut down on ARMOR_EFFECTS.put("Blaze", new PotionEffect[]{ by instead making an enum
Map<String, Object[][]> effectsData = Map.of(
"Blaze", new Object[][]{
{PotionEffectType.FIRE_RESISTANCE, 0},
{PotionEffectType.SPEED, 0},
{PotionEffectType.RESISTANCE, 1}
},
"Iron", new Object[][]{
{PotionEffectType.SPEED, 0},
{PotionEffectType.REGENERATION, 1},
{PotionEffectType.STRENGTH, 2}
},
"Slime", new Object[][]{
{PotionEffectType.SLOWNESS, 0},
{PotionEffectType.JUMP_BOOST, 0},
{PotionEffectType.JUMP_BOOST, 1}
},
"Silverfish", new Object[][]{
{PotionEffectType.SPEED, 0},
{PotionEffectType.STRENGTH, 0},
{PotionEffectType.HEALTH_BOOST, 3}
},
"Chicken", new Object[][]{
{PotionEffectType.SLOW_FALLING, 0},
{PotionEffectType.SPEED, 0},
{PotionEffectType.STRENGTH, 1}
}
);
I wouldn't consider this an improvement
it bypasses repeated code?
How is it removing anything repeated?
It's the same number of lines but with less type safety
and more memory
I meant, it reduced the time needed to write it
You wouldnt have to do:
new PotionEffect(PotionEffectType.xxx, inf, 0, false, false),
new PotionEffect(PotionEffectType.xxx, inf, 0, false, false),
new PotionEffect(PotionEffectType.xxx, inf, 3, false, false)
});
you could have a method do that, which iterates over an object.
But you're right about the memory and typesafety and I apolgoize.
I understand!
anytime you see yourself using Object, maybe you're not doing it well
lol thanks, I take your feedback
and also 2D arrays are just ew
in general
nesting data like that indicates you might want to flatten it
Could be done without losing type richness, but yea a bit too much abstraction over some method invocations
Records
Database stuff, will be glad to hear any feedback
Lombok ❌

Why
I get that it's confusing to use lombok for fields access modifiers, but what's the problem with lombok itself? I think getters and setters annotations are very handful sometimes
just use PotionEffect?
https://github.com/Psikuvit/BetterQuests (ignore the mysql I just put it to test smth)
iirc InventoryHolder should not be used
?gui
As The Inventory guy you know I gotta say something. If you want an example on how to NOT implement Inventories in spigot its this. Please leverage the ideas of this thread. If you were on a later version you could use the new MenuType and MenuType builder API, but if you're outdated atleast just do a proper wrap job. If you're interested why InventoryHolder sucks so much look here.
Wouldn't it be smarter to allow players to have the option to do multiple quests at once? This seems awfully limiting.
Further based off the last point this entire manager is kinda limited with what kind of features it allows.
I personally don't love QuestType as an enum. I feel like you could implement some logic in each QuestType to help for example knowing what event each quest type should be handled on more dynamically.
ConfigUtils is a bad name IMHO this is more a config wrapper than anything. Utils, to me, gives the indication there are common static utility methods being used, that's just not the case.
Not sure what Type, is but it either needs to be scrapped or just be given a better more inutitive naming. Maybe NPCType? Also not a huge fan that this is an Enum either this could be dynamic registry loaded from a config file easily
Use components with Minedown / MiniMessage or support hex you're in 1.16.5 we have hex support on that version https://github.com/Psikuvit/BetterQuests/blob/master/src/main/java/me/psikuvit/betterQuests/utils/Utils.java#L17-L22
Overall in my opinion the code you have isn't dynamic enough its very explicit, which is fine if you have no plans to ever release it and only use it for yourself, but the minute you release a plugin I feel like such a design becomes unsatisfactory.
should I use an abstract class or what
tell me what you would do in this situation
You were told, twice.
Click the link and follow those instructions.
I am not talking about the gui
Then what are you talking about
Could be done with just configs
If you're repeating code and it can be a config let the end user repeat themselves
Point point = Point.measurement(getName())
.time(System.currentTimeMillis(), WritePrecision.MS);
Thread.getAllStackTraces().keySet()
.stream()
.map(thread -> thread.getState().name())
.collect(Collectors.groupingBy(Function.identity(), Collectors.counting()))
.forEach(point::addField);```
Working on refactoring this whole project, tell me how its looking
https://github.com/MrArcane/Core
A minecraft core plugin to handle essential tasks. Contribute to MrArcane/Core development by creating an account on GitHub.
in your player data, I'd recommend not splitting the getters and setters
https://github.com/MrArcane/Core/blob/804cace0352fdcf6e8418e21769e1001c3324651/src/main/java/me/arkallic/core/command/home/MaxHomesCommand.java#L57 not sure if this else block is even needed, since it always returns. and please don't send coloured messages to console
same applies to the managers
MessageHandler should just be a util class
in your sendCentredMessage you're hardcoding some magic numbers and assuming the player uses the default font which isn't ideal
and don't have SCREAMING_SNAKE_CASE locals pls, that naming is reserved for statics
By that you mean keep the two together im guessing?
Thanks for that, fixed it. as i said still working on it.
removed else block and colors from console messages.
as for this, i just used someone elses code to get an idea, i dont even use it now. Removed.
Alright i just pushed a lot to that repository. hows it looking?
I mean sure buts kinda besides the point - not really a code review more of a design and requirement review at that point
Its much better than before
YAY! learning! i did a thing
Should I break this big class into separate classes
What I did was have the manager (this class) connect all the other classes and provide high level methods
i love how hastebin thought that's kotlin
hastebin is mentally ill
What kind of cache do you use?
Just a concurrent hash map
https://paste.md-5.net/nicijicuwu.java
I have made yet another registry system
why are all registries freezeable
Well you don't have to freeze them
yeah but the option is there
Yes ofc
what if i dont want someone to freeze my registry
You should probably make that known
what if they dont care and freeze my registry
Get fucked ig 🤷
that sounds like design error
Tell me ebic!
okay so here is an example for a great registry system with credit of @woeful pasture https://github.com/PineappleDevelopmentGroup/Pineapple/tree/dev/pineapple-common/src/main/java/sh/miles/pineapple/collection/registry
You think I should instead make FreezableRegistry type?
yuh
mmmkay
seperate it out so if you want a freeze able registry it gets defined on the type
which means someone cant just break your registries for fun
sounds better indeed
now pull a mojank and force them frozen after creation
kek
was thinking about that actually just cuz I was meme-ing earlier with this design
you can add a freeze field too
there is
@junior holly if you want another reference here is another system I made
https://paste.md-5.net/gebanatuge.java Registry.java
https://paste.md-5.net/jihaterope.java Holder.java
its probably "less good" I usually prefer making some Holder or Option esque object to return because java's base one is trash
generally the point is to force you to handle it in some way
Is there a difference between just using a boolean and making a registryLifecycle object as you did?
you could use a boolean, but my goal was to allow for different lifecycles for example my registry allows removals, but you can only remove during "Bootstrap", but you can add after the bootstrap phase
and then you have the frozen state
I used an enum here, but you could also do this with a singular byte
Idk I guess I kinda just figure no operations should be allowed when frozen, but in your case it sounds a bit more usecase specific
To be fair though, this system I was trying to keep simple
well the frozen state isn't the only state I have, yeah its more use case specific this is for a stand alone game I'm making I'm trying to allow feeding from some data files
this would happen durring bootstrap for my game files, but during "additions only" for any modifications
right yeah that makes sense
The holder is a sort of object wrapper?
Is this for like type safety or what
I see
well from mojangs pov they use the entire holder thing a bit more motivated
its in combination with dfu where data transformation optimizations and difference between data is being decoded and encoded
then knowing if a certain value persay is registered or not, becomes crucial for both the client and the server
iirc there's 2 types of holders mainly, those that are contained in the registry, and those that aren't
Correct
You can have a holder that contains a type that does not exist in the registry
https://paste.md-5.net/disapumuma.java
I've put off this project for so long now, but finally came back and redid the round queue system, what do we think?
I was thinking of splitting the RoundQueueManager logic as I'm handling both player and round queues, but the actual round queue isn't heavy in terms of operations performed so I'm not sure if it matters...
public RoundQueueManager() {
this.roundHandler = NDGManager.getInstance().getRoundHandler();
this.queuedRounds = new HashSet<>();
this.playerQueue = new HashMap<>();
for (Division division : Division.values()) {
this.playerQueue.put(division, new HashMap<>());
}
// This wasn't supposed to create a new dataManager instance
this.playerDataManager = new PlayerDataManager();
// Changed to:
this.playerDataManager = NDGManager.getInstance().getPlayerDataManager():
}```
ha ha
sir what the fuck
?
what kind of fucking theme and font is that
uh don't worry about that, people always tell me that
I also use fucked theme
I guess they just don't understand
I use eclipse theme in intellij, it's op
That killed my eyes to try and read. Color blind?
fuck replied to wrong one, oh well
At least he doesn’t use comic sans
Someone will If you post your github link
Lol learn how to use version control please.
Git is an important tool
Smth happened with branches?
Or what'
Btw I will create new repository
I was do with this many times
these are jar files
not source files
it looks like you maven published your content to github
Alr
https://github.com/RaydanOMGr/BasicModInfoParser review my libs code pls
Doesn't use kotlin gradle and uses jitpack not @dense leaf rep
🔫
I'll transfer it to rads repo later and I will eventually get to rewriting my groovy gradles into kotlin gradles
Dude check the branches. He has a commands branch, a config branch, it’s so weird. It’s like each package he turned into a branch
Long story
me on my way to make a separate repo for each method