#development
1 messages ยท Page 146 of 1
val size: Int this quite literally implies it cannot change
cause I want to use isLetter
yeah I know, so it should be var size: Int, which is still a property
with gradle or what?
pretty sure that's an extension function with no need for an import
im just using the intelliJ builder
you should have the stdlib already then
it doesnt show up
if you have access to Char and Int and such you do
^
are you trying to do it on a Char?
I would not be surprised if you were trying to do it on a String or something
i found it i needed to do import java.lang.Character.
uh
ye
but then you need a private setter, and the immutable collection types have to implement a setter (even if it just throws an exception)
That does not sound right
Kotlin has its own platform-independent Text stuff under kotlin.text.
okay well Kotlin bad, do properties not have a way to say "only getter and no setter"?
ooo ill use that instead
it works
that is quite literally the correct way to do it lmao
you shouldn't even need to import anythign?!
do properties not have a way to say "only getter and no setter"?
that is whatvalis, but it's misleading
kotlin bad yes
no
nvm it didnt work
hmm okay yeah Kotlin bad
๐
dude send some code, you shouldn't need to import anything
it is literally just part of the prelude lmao
?paste
Paste Services
When asking for help with a config/menu/code issue please use our paste bin:
(we prefer it over pastebin.com)
โข HelpChat Paste - How To Use
@dusky harness scram
๐ญ
yes
:)
not how you use it
isLetter is a method on Chars
Char#isLetter
you do index.isLetter()
index is a char
he thought school was only for 1 day! he mad ๐คฃ ๐ญ
what?
so you do Char.isLetter()
global constants? lmao
oh tyty that makes more sense
yea but he also puts it as a parameter
dude have you never once actually used OOP langs before
ยฏ_(ใ)_/ยฏ
State bad
definitely a c programmer
no he didn't, that's not a class
We need more useless pure programs
im a C programmer ;-;
not in a year
๐
We all need to touch a language called grass
๐จ
possibly also one called women
Oh thats covered 
oh?
wdym
๐ท
Yugi gets bitches?
no
damn
I have a feeling encripion's countLetters function is going to be easily replaced with a stream lmao
stream in kotlin ๐คข
as it should be
yeah whatever the equivalent is
you know what i'm talking about
kotlin ๐คข
YESSS
Or
ah
@tacit quail
I am proud to say it is still pinned in #dev-general
also all this time I've read your name as "encryption"
just found out its encripion
elaborate?
damn I didn't know Kotlin has cute method references with ::
Is there a reason that chunks are 16x16 or is it just random numbers
what @dusky harness sent
involving many carefully arranged parts or details; detailed and complicated in design and planning.
16 is a multiple of 2
thats how i pronounce it
Yeah but why not something like 32x32 or 64x64 why 16 it just seems random
if countLetters() just gives the number of letters in a given string, you can replace that with a single method call in the standard library lmao
THIS EXISTS?!?!??!?!?
I mean you want kinda small chunk sizes for performance and stuff
less "clutter"
No, its an elaborate scheme by the US government
having lots of small ones is preferable to having a ton of big ones
my time
Kotlin has a lot of things
just ask
and you shall receive
๐
yeah dude, going from C to Kotlin is kind of a wild trip
that they want to hide from us
cause Kotlin is very high level and has a very nice standard library lol
im never going back to C
it feels like assembly compared to this
I mean it pretty much is
a lot of useless and bad things too
even though i love kotlin
C is painful lol
then don't use it ๐ฅด
some library stuff they have is just pain
this is a whole new world
you can use shadow's minimize if you want to reduce jar size too
try rust its a lot better
Also, swift is pretty great, feels a lot like kotlin with some extra features
i cant describe this feeling
Oh I have lmao, it has its own flaws though
firstNotNullOfOrNull ๐ฅฒ
swift is fun
yes! I quite like Swift man, especially the try? operator
and @dusty frost , I did end up with the exact issue I mentioned about kotlin in swift
I have used that before ๐
๐
yeah like 2 years ago
yeaaa
i dont remember much except i like it
which one? lol
it does but its a lot better then C for saftey and java for performance.
kotlin is a little similar to swift I've heard
type inference
yes but it is a lot harder to write programs in as they are forced to be correct and stuff
yes
XCode seems to be pretty shit at traversing code
Sometimes you can check callers and it wont really show you
ios development requires a mac โน๏ธ
I cant, its for work, I dont have a mac for personal use
Swift in general pretty much requires a mac lol
ah jeez
Fleet moment coming soon
I disagree that is one of the selling points is your writing good code.
I agree it is good code, my point is that it's hard to write
with rust?
student :))
And a lot of valid programs aren't allowed because they're still defining the rules
might be free in the student thing
@dusky harness the .count(is letter) works but is there something for words and sentances im assuming not that seems very unecesary
Student license cant be used commercially
not sure, it's part of the student thing though probs
wdym
ah
wouldnt say its harder honestly for rust
they don't have to know ;)
The company knows ๐ฅฒ , they check
OH MY GOD
shit what really
Yea
C programming has killed me
I disagree its pretty simple when u start to work with he language a bit more
for a function right
wdym
I mean the existence of the borrow checker makes a lot of stuff a pain. I read an entire ass book of ways to make linked lists in Rust because of the borrow checker rules
val isValid = char.count { it.isLetter || it.isWhitespace || somethingElse }```
i dont make a variable with this i make a expression
Like it is definitely harder in a lot of ways for most people, it does make better programs, and trust me I sing the praises of Rust very often, but it is not without faults
oh i guess i do make a variable
you can still do that
it doesn't matter
variables just hold data
and I myself have literally turned to Go to make a compiled quick program lol
it is much easier to not worry about borrow checking
Mhm
question
languages like C, Go, Rust, etc - since they compile natively, do you have to be on that OS to compile for that language?
oh gee, people talking about rust. it would be a shame if i said something wacky like "rust bad"!
Go good
no
var total_words = text.count {it.isWhitespace() } is this the right use?
Rust bad
no, cross compliation is a thing
LLVM and GCC do it
ummm
Inefficient
Uhhh
yes but ```kt
val totalWords = text.count(Char::isWhitespace)
see that's kind of what I'm saying lol, I quite like Rust and I think it is really doing some great work in making programs a lot more correct
but holy shit it's pretty hard to use
Have you tried switching from C to Circuit Boards
oh ty i was questioning cause for is letter i was using that
Great transition
leave languages, just design a chip for what you want to do 
Yes!
at least to my experience, I am a lot more used to thinking in easily mutable languages with a garbage collector lmao
wait but you'd still have 3 executables
right?
one for mac, linux, and windows
this
@dusky harness so is there a way i can do this for punctuation but exclude certain types of punctuation or do i do it the old fashion way with if statements?
you can write your own little filter method and use that
or check if each char is in a certain Set
there are a lot of high level ways lol
My brother in christ i know nothing about kotlin syntax
Char::isWhitespace is literally just referencing the extension function called isWhitespace
you could just make your own filter function
that takes a char and returns true/false based on if it's good
you can do ```kt
val punctuation = setOf('!', ',', '.')
val stuff = word.count(punctuation::contains) // or count { it in punctuation }
see bam that was one of the things I said too
so do this for punctuation?
yeah don't worry about that right now
do what this says
that's more clear and easier
ily
oh god inline
yeah he spelled it wrong lmao
Why am I getting this error even thought I am on 1.18.2 and the Y level should go down to -64? https://www.toptal.com/developers/hastebin/uxuqupexum.properties
the terrain update stuff was in 1.19
I think
unless im mixing up 1.17 and 1.18
I'm mixing those up
right
A
you are
okay
1.18 is the terrain
that's a plugin issue with KrownedStacker
gotta go ask them
I am the dev
๐
idk what's the issue
oh lol
at io.github.idoomful.bukkitutils.statics.MaterialUtils.getBlocksInChunk(MaterialUtils.java:79) ~[KrownedStacker-1.0.0 (2).jar:?] what's that
ugh
you're getting blocks from a chunk
not from a world
d;spigot Chunk#getBLock
yeah but chunks should be 384 blocks tall
@NotNull
Block getBlock(int x, int y, int z)```
Gets a block from this chunk
the Block
x - 0-15
y - world minHeight (inclusive)
z - 0-15
cause it goes -64-320
yeah yeah I know
kinda weird
I Didn't realise what version they were on
i guess you could go look at the code for org.bukkit.craftbukkit.v1_18_R2.CraftChunk.validateChunkCoordinates lol
was literally on my way looking for that
xD
it just goes back to nms chunk
getminheight and getmaxheight
it has its min and max provided thru parameters.
wasn't there some sort of setting for world height in server.properties?
maybe there's some conflict with that?
which then goes to LevelHeightAccessor#getMinBuildHeight and LevelHeightAccessor#getMaxBuildHeight
btw what are you using to see all this?
paperweight
int getMinBuildHeight();
default int getMaxBuildHeight() {
return this.getMinBuildHeight() + this.getHeight();
}
oh. I went to the spigot hub
I can't find the source code
nope. doesn't seem to be there. at least not on 1.19
seems to trace back to DimensionType
protected static final DimensionType DEFAULT_OVERWORLD = create(OptionalLong.empty(), true, false, false, true, 1.0D, false, false, true, false, true, -64, 384, 384, BlockTags.INFINIBURN_OVERWORLD, OVERWORLD_EFFECTS, 0.0F);
the -64 is minimumY
so
ยฏ_(ใ)_/ยฏ
wait. did height change in the nether?
nope
and end?
protected static final DimensionType DEFAULT_NETHER = create(OptionalLong.of(18000L), false, true, true, false, 8.0D, false, true, false, true, false, 0, 256, 128, BlockTags.INFINIBURN_NETHER, NETHER_EFFECTS, 0.1F);
protected static final DimensionType DEFAULT_END = create(OptionalLong.of(6000L), false, false, false, false, 1.0D, true, false, false, false, true, 0, 256, 256, BlockTags.INFINIBURN_END, END_EFFECTS, 0.0F);
nope
@errant kraken is the world you got the chunk in maybe an end world or a nether world?
idk what world this error came from, I'll have to ask
apparently the nether doesn't go below Y 0
yeah it doesn't
there we go
your mum
was walking down the street
fuck you automod
Fuck up
How do I pass an ItemStack to HoverEvent so I can show it in chat?
I've tried this but it shows air ```
final JSONObject itemJSON = new JSONObject(dyn.getOnHover().getItem().serialize());
final BaseComponent[] componentItem = new BaseComponent[] { new TextComponent(itemJSON.toJSONString())};
hover = new HoverEvent(HoverEvent.Action.SHOW_ITEM, componentItem);```
Hello everyone !
I have a little problem with Guilds plugin ...
Here is my error:
java.lang.NullPointerException: Cannot invoke "me.glaremasters.guilds.api.GuildsAPI.getGuild(org.bukkit.OfflinePlayer)" because the return value of "me.glaremasters.guilds.Guilds.getApi()" is null
How can this be null ? ๐ค
Some clarifications: I getthe API after the server has loaded, being careful that everything is loaded
are u shading the api by any chance
Uhm sooo, an issue I am having rn, is I have this method to store data:
public void storeCache() {
var startTime = System.currentTimeMillis();
var players = Bukkit.getOnlinePlayers();
var stats = cache.getStatistics();
for (var p : players) {
var user = cache.getUsers().get(p);
if (user != null) json.getFileData().insert("data." + p.getUniqueId(), SerialManager.toString(user));
}
json.getFileData().insert("stats.generators-placed", stats.getPlacedGenerators());
json.set("stats.lockers-placed", stats.getPlacedLockers());
var endTime = System.currentTimeMillis();
var difference = (endTime - startTime);
getLogger().info("Successfully synced cache with the database. It took a total of " + difference + "ms (" + (difference / 1000) + "s)");
getLogger().info("Users: " + json.singleLayerKeySet("data").size() + " | File size: " + json.getFile().length() + " bytes | Online Players: " + Bukkit.getOnlinePlayers().size());
}
And the thing is, it basically deletes all the data, and only sets the data for the players online. Like, should it behave like this? Cause rn, it's deleting data of offline users.... shouldn't it just set the data it needs, without touching the other keys? For context, I am using a library called SimplixStorage.
๐
Can I ask you to help me remove this shading please ?
I don't know why he's shading everythink even tho I don't want to
what build tool are u using
Maven
add <scope>provided</scope> to the dependency i believe
Has anyone used partitions with lettuce
if so could you please explain how it works and how to use it cus the docs and examples are so confusing
I want to round the result of the equation in the last line to an Int how could i go about doing that?
got it i used .roundToInt()
Hi,
I'm having an issue with my server where it crashes. There isn't a crash report, just warnings in the console about tasks not disabling.
This seems to be the class causing it, and it seems to have something to do with chunks loading. If anyone has any idea I would really appreciate it. Thanks!
https://github.com/Fisher2911/SkyblockLevels/blob/master/src/main/java/io/github/fisher2911/skyblocklevels/entity/EntityManager.java
(I know some of it is a mess, if you want to point out what I could improve I would appreciate that too)
Also please ping me if you respond
Is there a more simple way of getting a players "session online" time? Instead of saving the time a player logged on and then taking that time agains the current time?
dont think so
Alright
not hard to just maintain a map of players with their login times though
And do i need to save that to a file or can i like save it temporarly?
nvm got it
you can definitely save it temporarily, if you just need the current session time i see no reason to store login timestamps in a file
Yeah... but how?
you can use a Map<UUID, Long>
type of map probably doesnt matter much but if you're accessing it async make sure it's thread safe
Alright, will look into it! Thanks!
any ideas here? (sorry for bumping this out)
Seems the API you are using is old or just shit, why havenโt you made your own? they arenโt too difficult for simple stuff you can even just use .yml (although not advised for large amounts of data)
Any ideas?
https://img.olziedev.com/iW775151H757511ay_v.png currently updating a plugin from spigot 1.16.5, to 1.18.2. Whats the method to set their position and get their yaw/pitch using nms?
Fair enough, havent created one cause I have no idea where to start
And I dont want to messup anything since this is being used in an server with 80+ players
Got any errors or stacktraces we can follow? (like the warnings)
can someone link me the gist that had methods to serialize itemstacks to base64 please?
thank you โค๏ธ
made a faq ?base64-serialization
nice
btw Gson is available in spigot 1.17-1.19 correct?
idk where I can check this
other than importing every spigot version and checking
cool cool. just making sure. I heard some lib was removed in newer versions but I don't remember what. I assumed it wasn't gson since it showed up with the 1.19 api
I believe they're removing apache commons
good I hate apache
Ye
does anyone have some good Java tutorials for beginners?
Online Courses:
Online courses are also great for learning java. Some websites that offer them are:
- Coursera - Free unless you want a certificate
- PluralSight - Great courses from what I've seen. Mostly Paid
- Udemy - Never used them myself but they seem to all or at least most be paid.
My first ever course was one from Coursera. - I can say it was pretty good at introducing me to the programming world as a whole not just java.
Oracle Docs:
Oracle docs can help a lot at learning and understanding java:
- Start with this,
- Breeze through this (skipping stuff that doesn't seem relevant like bitwise operators),
- Hit this.
They're the first three from this larger thing which you should definitely go through overall. But those three should be enough for slightly better understanding of what is happening here without feeling like a huge time sink.
That one is a small part of this larger site wherein "Essential Java Classes" and "Collections" also have good useful stuff
Other services:
Some other cool services that will help you learn java are:
As you can see there are plenty of good ways to learn as long as you're willing to invest the time. Have fun learning!
Close enough
I remember having this issue, I have a different damage system so actually I deal damage with player.damage when I need to kill a player and on the damage event i check if its a precise number I kill the player without canceling the damage otherwise the health is removed but not from the actual healthbar infact i cancel the damage event, the issue is that if I put the entityDamager in the player.damage(60,entityDamager) the damage is somehow 31.0
Weird question but
How do I open a jar file so that.. the program inside it launches?
It opens as a zip file by default
I am looking through program files/java/jdk-17.0.3.1/bin but I can't find any exe that works
you'd need java.exe or javaw.exe, and you'd need to do like java -jar this_is_jar.jar to run it
On my old computer I could just do "open with... java something"
Why do I have to do all that now
Windows bad, I suppose?
Ffs
you have to do it with command prompt, maybe the old button was a shortcut?
In my entire life I opened jar files on every single computers just by double clicking on it
What the hell ๐ข
Just confused honestly
sadge
You just have to make it an executable jar instead of just a jar
jpackage relieved
I mean there's no good reason to update at all xD
also have you guys heard the leaks? apparently windows 12 will be a thing
Windows11 has worked fine for me
โค๏ธ
Is there any way to make minimessage work with legacy codes? I'm trying to add support for minimessage without breaking everything so people have time to adjust
no
your best bet is some sort of string substitution (i.e. replacing all &a with <red> or something), but it won't be a 100% match because of the leaky nature of the legacy format
Statement statement = getConnection().createStatement();
String sql = "CREATE TABLE IF NOT EXISTS minions(location varchar(36) primary key, level int, generated int, skin int, fuel int, shipping int, upgrade int, upgrade2 int, chest int, currentResources int)";
statement.execute(sql);
statement.close();
}```
what am I doing wrong here
telling whats wrong would be helpfuol
not using hikaricp
It even throws an exception in the newest versions if you have a legacy format 
yea lol
What I did for my plugin was to give them a tool to update the config
People gotta move forward
A good example that I like to use is something like this &6&LE&C&LW&D&LA&B&LR&A&LD&E&LS. -
<b><gold>E<red>W<light_purple>A<aqua>R<green>D<yellow>S</b> I think we can both agree that the first one is totally impossible to read
Yea, I'm thinking more for players who aren't gonna be immediately used to minimessage, so I want to provide a way to have a transition period where both &6 and <gold> work
<nerd>
You can do that somehow.. deserialize using legacy serializer, serialize with mini and then deserialize again with mini, but ๐ฌ
you can migrate people's config for them by using legacy deserializer chained into a minimessage serializer (remember it works both ways), which is what paper did recently
that won't work because the serializer will escape pre-existing tags
Hmm, fair
Yea I tested that and had issues, but its working enough for now to just replace &1 with <dark_blue> lol
Hey guys, quick question.
So i have made a custom player class: https://paste.helpch.at/mijumohevo.java
and then a team class: https://paste.helpch.at/orubofumey.cs
My issue is im saving with Mongo, and im getting circular refrencing on the SPlayer instance inside of the team class. I assume this is because i have an instance of the team class inside of the sPlayer class, but i need to be able to get the player's team from the instance. How can i do that?
it's onEnable, not OnEnable, lowercase o
Startup Log Location
Your latest startup log can be found in the logs folder of your
server directory, labeled as latest.log.
Please copy the contents and paste them to a paste service.
Type ?paste for more information.
Paste Services
When asking for help with a config/menu/code issue please use our paste bin:
(we prefer it over pastebin.com)
โข HelpChat Paste - How To Use
Anyone?
Why do you need an instance of the team from their class? Can't you just have a method in the team to get the player?
Can you DM me, please?
I'd prefer not. If you have a question just ask it here. That way if there's a solution found, others will be able to reference it if they have a similar issue!
This is a bit of a non-public question, so it is necessary in DM
Not like โHow toโฆโ
You can shoot a message to Barry or wait on someone else who might have an answer. I gotta get back to work.
I guess i could, but what if i wanted to get a player's team?
I guess i could just do a string name
Who is Barry?
bot
error?
You can send a message to Barry and it will be received by the admins, @hurtlay
Well ok
send plugin yml
in the log
you sent
there is nothing trying to enable plugin Test2 
can you send the file
you are putting in plugins folder
aight
weird, what if you restart and not reload?
oh wait nvm
.
Send the main class
? Paste
?paste
Paste Services
When asking for help with a config/menu/code issue please use our paste bin:
(we prefer it over pastebin.com)
โข HelpChat Paste - How To Use
Oh u changed it
Wait what's the issue?
Since in the log above
It enqvles
Enables
Oh I see
Hmm
Try getLogger().info("test")
The maybe broadcast doesn't work until the server is enabled
I'll get on my pcin half an hour and see exactly what it does
Hmm
In chat?or u mean console
How did you get on the server before the server started
In onEnable no players will be on the server so the logger will work
And is better since it prefixes it with [Test2] :))
Maybe spigot changed it
Ig
Logger > print/broadcast only to console
Usually
Unless for some case u don't want the preifx
Reload :/
cause that's not a thing?
ah that's what you're doing
thought you were typing in broadcastmsg lmao
there is something like this im pretty sure
not sure if you have to use the loop
are you able to do * users
when specifying the users
player.*
not sure the syntax
but when specifying certain player
are you able to do that?
Could someone help me through looping through this?
data:
fbfbfe36-a993-410f-abc9-85ea7fcf55b4: '�test'```
you have to be more specific than "looping through this"
Basically, I want to loop through my yaml file to get the player name from the output of the players command /realname (nick)
so just use a loop until you find the matching UUID?
Well, the realname command is to find the player from the nick
i need to loop through each value to find the right one, but i want to get the key to then translate it into a player name
if variableForPlayerCommandInput == current row in the config
return the value that the UUID has as a string
``` thats how i would do it
idk syntax ๐
the value of player when you get it is given as a UUID by default so you're good there
you could potentially run into the issue that w players have the same nick name
what i would do is have 2 maps
first map: String -> List<UUID> | nickname to list of player UUIDs (since there could be 2 people with the same nick name)
second map: UUID -> String | player UUID to real name
yes you could skip the 2 map process and just have a String -> List<String> map but i'd typically use it in more than one place and having both maps might be useful. as for loading the yml to the maps, just loop through the keys and get the corresponding value and load it
you could also call Bukkit.getPlayer(uuid).getName() instead of the second map, ill leave it up to you tho
I would just not allow players to share the same nickname.
Seems like a lot of hassle
yeah but the whole idea of a nickname is to be someone else essentially lol
also when loading the maps make sure to strip the color off the nick names as that would be a whole other headache
Thx guys!
You shouldn't allow same nicks, kinda makes it easy to impersonate people
@mental cypress, https://github.com/PlaceholderAPI/Javascript-Expansion/pull/67 can you accept?
At least this will protect the server owners a little from exploit
^ @grim oasis, what is needed for acceptance?
Why would that even be needed since it's permission based?
Cuz this is the only way to protect the dedicated server where this expansion is located
Huh?
Just read it
Yea but how would you "exploit" it, if the command is permission based, if the people you've given permission for the command exploit stuff, then you kind of deserve it..
People hack accounts with the perms to do this and use it for selfish purposes
that's not an exploit then
don't ping me #rules
And?
help
Statement statement = getConnection().createStatement();
String sql = "CREATE TABLE IF NOT EXISTS minions(location varchar(36) primary key, level int, generated int, skin int, fuel int, shipping int, upgrade int, upgrade2 int, chest int, currentResources int)";
statement.execute(sql);
statement.close();
}```
uhm, so, currently I am using this to get an armorstand by it's id and delete it.
ArmorStand as = (ArmorStand) Bukkit.getEntity(uuid);
if (as != null) as.remove();
The question is, does Bukkit.getEntity() only check loaded chunks? If so, that would explain the issues I am having.
I thought the docs mentioned it but yeah I'm fairly certain it only gets loaded entities aka entities from loaded chunks
Hmm, okay, so, I would have to load those chunks that I aim for right?
or is there another better way of doing it?
I mean otherwise the server would need to load all chunks until it finds an entity with that uuid
I mean, if I know the exact location, I could load the chunk, remove it, and unload it right?
also if this is a special entity handled by you, you could remove it on chunk unload from the world, store data you need about it and then either spawn it back when chunk is loaded or don't spawn it at all if you want to remove it
that sounds like a good approach
(you should use async chunk loading when using paper though)
could you provide the docs for it?
or wait
what's the command again
lol
its d;
me not understand how the command works, will just use old google
there are several World#getChunkAtAsync methods
d;paper World#getChunkAtAsync
@NotNull
default CompletableFuture<Chunk> getChunkAtAsync(int x, int z)```
Requests a Chunk to be loaded at the given coordinates This method makes no guarantee on how fast the chunk will load, and will return the chunk to the callback at a later time. You should use this method if you need a chunk but do not need it immediately, and you wish to let the server control the speed of chunk loads, keeping performance in mind. The future will always be executed synchronously on the main Server Thread.
Future that will resolve when the chunk is loaded
x - X Coord
z - Z Coord
I mean, but that's to get the chunk, not load it right?
Requests a Chunk to be loaded at the given coordinates
d;paper World#unloadChunk
boolean unloadChunk(@NotNull @NotNull Chunk chunk)```
Safely unloads and saves the Chunk at the specified coordinates
This method is analogous to unloadChunk(int, int, boolean) where save is true.
true if the chunk has unloaded successfully, otherwise false
chunk - the chunk to unload
the server does that by itself
oh
wait wut
unless you specifically set a ticket
how exactly does the server know "ok, time to unload this"
?
Also, what happens if I request several times the same chunk to be loaded async? Does it have some type of queue?
the server knows where the players are, and the chunks out of view distance can be unloaded
that's all the ticket system stuff
so, it loads it for a few seconds?
it will check if there's already a request I assume, but it should be safe
yes
Okay, also, so, I can send the request, but how would I wait for it to be completed to execute the rest.
Since the rest of the code requires the chunk to be loaded.
there are methods that return a CompletableFuture and there are methods that take a Consumer
never actually worked with CompletableFuture
so instead of waiting in terms of blocking, you can just "listen" to the completion of the future or let the server deal with running your consumer
oof deprecated
did you meant this? ^^ I am actually very confused rn
does that even compile? I'd assume that you'd need to specify if you want to call the "new" method that takes a consumer or if you want to use the "old" method that takes the pre java 8 World.ChunkLoadCallback
you can just extract it to a variable, like
Consumer<Chunk> consumer = chunk -> { /*do cool things here */};
passing that variable to the method should work fine then and use the proper method
As my professor used to say, "If you're blaming the code/computer, you're making at least 2 mistakes"
your professor is right
we should be programming on paper
they used to make us code on notepad on first year (especially on exams etc)
i still dont know why
Coding on paper in the beginning is nice to help you understand what your code does
2-3 pages to write a queue class lmao.
I did it for 4 years in my highschooll.... I think I got enough of that lmao
first years i understand, but i dont see why care about syntax then
pseudo code on paper makes sense to understand the logic
nah. I had to write entire programs.
had to make queue, stack, they also gave us a phrase for example and then we had to write a program using what we learnt during our OOP class. it was something like, someone eats a pealed apple and some superhero flies and something else
xD
oh man my first programming class was all in Notepad for like HTML/CSS/JS stuff
this basically
but it was for java for me
we've done c#. no web this year
it's really interesting to see how people learn to code, cause I've been programming for like 10 years now, so like, some people literally just kept using notepad and javac for Java and everything
I was like "dude, imagine the time savings you'll have when your IDE can tell you while you're coding what minor syntax errors you have"
yeah
it was insane, they would spend more time tabbing out, javacing, going back to add a semicolon, and then repeating than they were actually coding
I've only been coding for 1 year before uni and I'm not that good but still. damn it was a pain
I had to take 3 exams at one of my classes... all on paper, all 6+ pages
then I introduced all my friend group to IntelliJ/PyCharm and now they're all addicts
i personally didnt mind the paper exam thingy
as long as they dont grade on exact syntax
I did Java in fucking Netbeans in school ๐ฅฒ
with pseudo code paper is quite fine
Paper exams are good for like, asking questions about understanding and stuff
but if you want to test coding, just have them code???
at least you did java
this basically and for following code
as in "whats the output" type questions
in first year especially
every single test in my software engineering class in university was wishy-washy short answer questions, no actual help with, ya know, software engineering, or any practice or anything
afterwards, they dont teach much in languages anyway
fucking hate those, it's always some dumb like C-style throwback gotcha of the order of increment and decrement operators
its more design patterns etc
i dont mind em, but hate it when they throw an exception in it
as a gotcha
or rather a compile error
like please
I mean they're good for like, maybe first year students?
but guess what, in the real world, you can just run your fucking code lmao
try-it-and-see is the motto
i disagree to a certain extend
a lot of times you need to learn someone elses code
so i think its still somewhat relevant
yeah so you can run their code?
easy peasy
it's okay to pick up like the absolute basics of language syntax and stuff like if statements
not always, you can test and such
but it very quickly devolves into dumb pedantry like int x = 2; x--; --x; x++; and then it's like "waht is the value of x as each line gets executed or something
when can you not run code you're trying to learn?
i can't think of any scenarios
this i dont agree with myself either
but i feel like its easy to say that its useless right now
since your brain kinda gets wired to read it after a while
if people are writing code like that, they shouldn't be
that doesn't teach you anything useful
i dont feel like i can comment that it was useless with my current knowledge
I call it the fall of education
i feel like making them do it once on notepad is semi usefull still
but like constantly i see no point
Donโt worry these ridiculous demands exist everywhere I was asked to code on a paper
just so they know how to use the console without an ide
what lol? do you often encounter obtuse pre/postfix increment/decrement conundrums in your real code?
no, what i meant is i cant comment much as to if it helped to wire my brain to be able to read it or not
if that makes sense
i see it as pointless now, but thats with hindsight
regardless, that isn't code you encounter
ofc not
i would be down with like real useful coding encounters
you encounter shit like that
but this dumb contrived shit is awful
and i'd rather people be learning how to read real code lmao
this
maybe it's cause i was self taught like way before my university programming classes but that shit was awful man
another thing i realized since i semi worked
while i was studying back then
that the graduates kinda sucked
oh yeah
way too many people just like, do their basic university classes and nothing more
they don't know git, they don't know how to work with actual code, etc.
gateway university coding classes are trash ngl
there's no substitute for real world experience when it comes to programming, and computer science is mostly about theory (as the name alludes to)
this
rest practical stuff
nah
I learned so much more when I started working, even more than when I was doing it mostly as a hobby
software engineering is the title for pure programming
its mostly software still
but you also need to take hardware classes
similiar to electrical engineering
and a lot of programming design
you took a similar amount of hardware classes to what electric engineers take?
because holy shit we have like 2 hardware classes
it's mostly theory, stuff like foundations of computation theory, turing machines, finite automoton, etc.
oh. that's a lot of classes.
i mean meh not really
universities in america do a credit system, most classes are 3 credit-hours, and you usually end up taking 15 credit hours on average
but like, i did 6 classes last semester and it wasn't that bad
yeah. I used to have 12 classes in 8th grade. but this year, I had 7 classes every semester
and out of the 7, 2 were sport and english, wich we never did
its credits for us as well
major classes are 4
minor ones are 3 usually
and you average 18 - 22 per semester
jesus christ
that is very bizarre lol, as the acceptable range for "full-time student" is 12-18 credit hours here
how many hours is that per week?
12-18
that's time spent in lectures
not including homework
not including homework or lab work
you spend 25 hours a week in lectures? what the fuck
we have credits here as well but they work completely different. you basically get credits if you pass the class and if you don't, you pay to take the exam again. and every credit costs like 200 RON or something (40-50 USD), and you can take the exam twice a year. And every class gives you a predifined amount of credits if you pass them
oh damn.
its.. not that bad honestly
we have a MWF/TTH schedule
not familiar with the acronym
monday wednesday friday / tuesday thursday
so classes are on either of those sections of days
yeah it's 5 days for us too?
8:30 to.. 5:30pm basically
in university?
ya
the point of university is that you get to be free, do whatever you want, plan your schedule how you see fit
MWF classes are 50 minutes long, and TTH classes are 90 minutes long
its 50 for us
or maybe 80
slots? ๐
but since not that many sections open up
per class
you end up staying with a fucked program
our "slots" are just like back to back from like 8am to 6pm
but you only end up taking like 2/3 classes per day
waking up at 7:30 to be at uni at 8 for 2 hours then going back home to be back at uni at 14 then going back home and back to uni at 17
lmao
ye its to match
9:00-9:50 etc
that was my wednesday this past semester
so you get off at 12:20 to 13:30
the fact that you have a "legal lunch break" is so bizarre lol
you aren't compelled to be at university here, you just go if you want
what the fuck lol
but you lose like 10% of the grade
its not exactly in the grade itself
but there is like 10% of the grade to be collected
in the class
through questions etc
which happen at random basically so
we need to go to 50% of the classes. not laboratories. otherwise they won't let us take the exam for that class. but most teachers don't really care about that.
yeah, same but with a grade requirement
to take the finals
"collect 40% of the grade until the final or you fail by default"
all this i dont mind much, but some classes are prerequisites to others obviously
we don't have grades during the semester. its just the final exam that matters. tho every teacher can chose to change that. a teacher gave us 3 exams and the final grade was the average, another just gave us a bunch of homework and it mattered for 50% of the final grade, etc.
and some open at only one semester
"collect" is such a weird word to me lol
so you fail 3 credits out of 21
and you add a year
since prerequisites push all classes by 1
well yeah some classes are only taught like Spring Semester Even Years
so if you're doing a 4 year degree, you have literally two changes to take them
english only wtf lol
since the highschool english edication
i guess it's a useful skill
education* sucks major ass
its more so that they can understand the classes
since the classes themselves are in english
especially at the better unis
ah yeah
english is like the language of the world or whatever lol
i am quite grateful to be a native speaker
its kinda useless for the average joe honestly
i use it a lot, but i skipped the year regardless so eh
i mean if they want to use any part of the internet not specifically designed for their language, it's pretty good
yeah, but its more that
especially useful in a programming degree lol
if you use a language in your native area only
you end up with a really botched version
you can semi read but speaking and understanding
is out of the question
since the person teaching is at B level at max
what country is this btw?
i mean like the vast majority of stuff is in english, no?
yes and no, turkish communities for basically everything is quite big
especially for programming, there aren't like any languages that aren't english-based with keywords and stuff
i mean how big could they possibly be, there's billions of english speakers and at most like a few hundred million turkish speakers
70-80 million says Wikipedia
yes and no, the thing is
population here is quite young
unlike the west
๐คจ
so % of people existing in the internet is quite a bit higher
i am not sure what kind of point you're trying to make lol
trying to say that the communities arent as small as they sound basically
obviously way smaller than the english speaking side
but proportionally to the population its quite big
they exist in completely bubbles though and as circlejerks usually
so i tend to use the english side more personally
ah nice nice
you from the usa?
or uk?
america, sadly lmao
i mean, its a nice country
though maybe luckily for the lightness of my education?
i mean, you are speaking to a guy from turkey so

we got a semi dictatorial mustache man at the helm
yeah probably a bit weird of a comparison, sorry lol
just a few steps backwards from where the us was a bit ago
some stuff from usa is insane even from here
funny enough
abortion law especially
Do BungeeCord config.ymls work the same way as Spigot? Can I create it, then in the main file say smth like getConfig.options.cooyDefaults?
Hello, is there any way to return a placeholder on multiple line?
For example a lore like this:
Hello line 1
this is line 2
loop through the lines and parse it
I can't
I'm creating a placeholder that is going to be used with deluxemenus for example
DM parses placeholders everywhere so
You could either have seperate placeholders like for each line, and it'd split accordingly, or you can try adding \n for it to line break ( not sure if that works )
matt's config > all
It's just a fork of ConfigMe
Repository: maven("https://repo.triumphteam.dev/snapshots/")
Dependency: implementation("me.mattstudios:triumph-config:1.0.5-SNAPSHOT")
Well Iโm gonna have to wait a week to add it. I donโt actually have WiFi at home so Iโm legit using a computer without internet lmfao
But Ty anyway
SettingsManager settingsManager = SettingsManager
.from(new File("plugins/" + plugin.getDescription().getName() + "/config.yml"))
.configurationData(Config.class)
.create();
it doesn't have any documentation tho
Itโs fine, I might be able to figure it out by myself
Will start working on it next week then, thank you
Config.class is a class that implements SettingsHolder
And this is a basic config entry
@Path("menu.pickaxe-shop.filler")
public static Property<String> PICKAXE_SHOP_FILLER = Property.create("PURPLE_STAINED_GLASS_PANE");
and you'll figure out the rest, it's really easy and fast to use
it's the only sad part for me
Anyone know how I can import multiple spigot versions with gradle?
Gradle by default seems to only import the latest one
you will really need multiple modules for that
not exactly
you only change the version specific code
but yeah i guess basically
https://github.com/knightzmc/VersionedGradle i've got an example of how to do it here
Ohh let me a take a look
Thank you
What I was trying to do is just have individual classes handling the NMS for different versions that were all called from one central class
yeah that's basically exactly what that example does
you have an abstract interface that you can use throughout the plugin and then you just get a version specific implementation
Yeah
Yeah now that I look at it, thats exactly what I'm doing now but without the seperate gradle files.
Ill just go ahead and implement that system
Thanks for your help
no problem
Imagine not using build-logic
dunno what that is
i dont believe so
what do you need it for?
๐คจ
do you mean PersistentDataContainer?
that's basically just nbt
so either use NBT-API or NMS
depending on how much self-loathing you feel
the api is definitely easier
at a cost of slightly bigger jar size
Hey Brister. How were you able to reference classes that were in seperate modules?
I setup the versioned gradle syetem, but I'm not able to access classes across modules
you can depend on other modules
look at the build.gradle files
the only issue is that you can often get circular dependencies which are a pain in the ass
but that setup will work for the basics
Oh I didn't see that
๐คฆ
Thanks again
Oof circular dependency error
hello
I've got a strange unexpected behaviour in my plugin
I'd appreciate any help
so, I have this very simple code:
public String color(String text) {
String colored = ChatColor.translateAlternateColorCodes('&', text);
return colored;
}
with import org.bukkit.ChatColor;
but when I use it, it only removes the color codes without applying colors to the text
Bukkit.getConsoleSender().sendMessage(chat.color("&fPlugin enabled."));
output:
so
is that the only way youve tested it?
because the "console" will be colored differently than expected
try a color other that white maybe
It depends if your console supports ANSI color coding
there's also the problem with &d
Bukkit.getConsoleSender().sendMessage(chat.format("&fVersion: &d%version%&f."));
using paper 1.18
what does chat.format do
ah, this
you arent even supposed to use Strings
its deprecated for Paper
You are supposed to use Adventure components
public String format(String text) {
text = text.replaceAll("%plugin_name%", resource.name);
text = text.replaceAll("%version%", resource.version);
text = text.replaceAll("%built_prefix%", resource.prefix);
text = color(text);
return text;
}
didn't know, sorry
where can I find docs on that?
ah, I see
(It's automatically shaded into Paper jar)
thanks
hey
i gave it a look
so, if I wanted to use all the functions from the MiniMessage, the support for color codes (&a and so) would have to be dropped, and in the config files color codes should be specified by its format (<color>)?
Correct
I've registered a listener that uses ChatChatEvent but it's not being triggered according to my breakpoints, has this event been tested?
the fuck is a ChatChatEvent
when the chat sends a chat of it's own accord
i get that it's WIP, but you don't make a multiplatform plugin by tying the public API to a specific platform, lol
I mean either case the answer is "yes"


