#development
1 messages ยท Page 18 of 1
but what about the fact that a checkpoint is a location
even tho they are at the same line (road width)
| A - - C - - - | //Checkpoint
| - - - B - - - |
if C is a checkpoint, the player A should be in 1st place
but since when looping the B is closest to the last checkpoint
it would be 1st and A the 2nd place
same with finish line, how would i handle correctly that
how can I allow the player to switch between proxies? I couldn't find anything useful on Google
Hey, whats the best way to find all classes inside a package using Kotlin? (at runtime)
that's generally something that should be avoided, and while there are tools to find all classes in a package, that doesn't necessarily match the source code representation (especially with kotlin)
is there a particular reason why that should be avoided?
yes
oh
sorry, I meant to ask what the particular reason is xD
sorry lmao i couldnt resist
I know xD
the main issue is that it's kinda fragile, as ywell said it's usually relying on classes matching the source which isnt always true, there could be lots of other generated classes that will break things
it also usually involves a big (many MB) library and some performance cost
if you need it then something is probably badly designed
cough serviceloader cough
that does make sense 
Well I am not quite sure how to achieve it other wise. Basically I am creating alot of recipes, and the Recipe class itself has just one job, make the shapedRecipe, I have a class that does the registering itself.
So I don't have alot of references in my "RecipeRegisterClass" I thought it would be the best to "auto discover" all the recipes
but I guess I will just have to reference all the recipes in some way
you think the auto discovery is a nice idea?
Since you are 212% better in Coding then me, you probably have a good Idea if you throw in a random Java thing. Soooo what is your cool idea? xD
Ohhh I know what that is now
@icy shadow is serviceloader a good idea? never worked with it
according to this: https://pedrorijo.com/blog/java-service-loader/ yea
afaik it's more for having different possible implementations of 1 thing, but only selecting 1
ohh nvm
its for that
but its weird
I need to declare the implementations inside the meta-inf
never mind, google came to clutch https://github.com/google/auto/tree/master/service
Actually it is very overkill, but I do want to learn something new, so ima try it anyway
thanks alot Mr. Mitten
np
i would argue classpath scanning is more overkill
Does anyone know why this doesn't work?
(I can't upload images here for some reason)
You won't be able to upload images here directly to avoid spam, so please use https://imgur.com/upload or similar service to upload images/screenshots.
The [0] feature is limited to arrays
to get the first value from a list you need to use uh
List#get
Oh I see, that's weird I could've sworn I've used [0] on a List before, but thanks it seems to work now!
im attempting to replicate all the chest interactions onto a specific block and this is what i got, it works but sneaking and interacting does not allow me to place blocks as a chest would:
if (item != null) {
// player can right click with any item in hand
// if player has item in their hand and sneak, they can use that item
if (!item.getType().equals(Material.AIR) || (!item.getType().equals(Material.AIR) && !player.isSneaking())) {
event.setCancelled(true);
}
}
this works:
if (player.isSneaking() && (!item.getType().isAir() || item.getType().isEdible())) return;
if (!player.isSneaking() && !item.getType().isAir()) event.setCancelled(true);
๐
Because you canceled the event. You have to set the block.
Guava has a util to do classpath scanning super easy, and it is built in paper afaik
ยฏ_(ใ)_/ยฏ
a lot of that stuff isn't needed but I'm just showing my usecase
I find the autoservice with the ServiceLoader api to be quite nice
Hello, I'm having an issue with formatting of placeholders, I've attempted to format strings that are meant to go on a scoreboard using the String.format(), for example:
https://cdn.discordapp.com/attachments/968239967836987414/1023085687198711808/unknown.png?size=4096
But on the actual scoreboard, they end up formatting like this:
https://cdn.discordapp.com/attachments/968239967836987414/1023085799287312426/unknown.png?size=4096
Any insight into what the problem may be would be greatly appreciated.
What are you trying to do
Format the strings so that the left part is left justified while the number is right justified
I'm not a genius or anything, but just as a test, try removing the %5 in the second return, what does it look like without that
without the %5 the second piece gets cut off entirely
Oh, well. Good luck ๐
I'm thinking it might have something to do with the font not being equally spaced
Doesn't work with kotlin tho :/
I have a link for a ksp impl
Actually I'm on mobile I'm just going to link you a build file
JAVA 8
CODE
System.out.println(false ? Double.parseDouble("2") : Integer.parseInt("2"));
if (false) {
System.out.println(Double.parseDouble("2"));
} else {
System.out.println(Integer.parseInt("2"));
}```
**OUTPUT**
2.0
2```
For whatever reason, the first value is a double. Do you guys know why?
umm, no?
System.out.println(false ? Double.parseDouble("2") : Integer.parseInt("2"));
yes?
That is a better question
does that work? I tried exactly that and it didn't. But I see you have an interface and an abstract, maybe that makes it work?
Works for me, I don't think it needs an abstract class just the interface I believe
hmm let me try
What does it do if true is set
same thing
Double as well?
Try using an expression that evaluates false instead
Like 1==2
still a double
does slimeworldmanager unload the world from their end if bukkit.unloadworld is called?
i know they do some caching by default with the serialized slimeworlds
but does that ever get unloaded
OUTPUT
4.0
Yeah that makes sense now
The compiler is autoboxing the value so they're both double instead of one or the other.
I already have the block and stuff set, I was just showing the interactions you must perform to the block
I see, thanks
It does but it potentially has the same problems
How would i create a websocket client in java 18 without any libraries?
i have tried multiple google searches for it but many of them require libraries or are on a different java version
java version shouldnt matter
Then you're not using j18
oh
That message is saying your language is too old to use the new feature
but it is java 18 tho or i am stupid (high chance)
Click that thing that says to set the language level
Probably just got set to that after clicking it.
Should work theoretically now
same error
What build system are you using? Gradle?
oh it turns out the language level got set back to java 8 again
its working now
ty
Woot
bump
So i have these listeners:
@Override
public void onOpen(WebSocket webSocket) {
getLogger().severe("WEBSOCKET CONNECTED");
}
@Override
public CompletionStage<?> onText(WebSocket webSocket, CharSequence data, boolean last) {
System.out.print("Text received");
getLogger().severe("WEBSOCKET TEXT RECEIVED");
Bukkit.broadcastMessage("WEBSOCKET SHIT RECEIVED");
return null;
}
};````
But the onText doesnt get called at all, the on open does get called, anyone that knows what could have gone wrong?
I have a weird issue, when I'm trying to loop through all entities in the world while the server have 1+ players it's finding them all,
but once the server empty from players it's not finding them all and gives less results, why is it?
The current code:
if (entity.getType() == EntityType.ARMOR_STAND) {
entity.remove();
}
}```
Someone told me here about on chunk loaded but I have no clue how to do it that way, someone can help me with that please? (:
are you just trying to clean up armor stands on a world?
if yes, listen to chunk unload, then loop through entities in that chunk
world.getEntities only lists the entities that are loaded
aka if the chunk is unloaded, it wont show up on that list
@vestal talon
I did it in a function like:
public void clearAction() {
for (Entity entity : Bukkit.getWorld(CustomPlugin.getInstance().getMainManager().getDataManager().mainWorld).getEntities()) {
if (entity instanceof ArmorStand) {
entity.remove();
}
}
}
How can I use the event that way?
listen to ChunkUnloadEvent
then event.getChunk.getEntities to get entities in that chunk
how do i do it within the function?
Alright thanks (:
~~Hey, does anyone know how I can get my script working. It doesn't work and I'm not sure what to add/change:
if region is "AFK"
set metadata tag "entered-region-at" of player to now
every 1 minute:
loop all players:
if difference between now and metadata tag "entered-region-at" of player is 1 minutes:
execute console command "cr give to %player% AFK 1"
set metadata tag "entered-region-at" of player to now```~~ moved to [#general-plugins](/guild/164280494874165248/channel/164280494874165248/)
#general-plugins probably a better place
Why is this throwing null pointer
// null pointer on this line
player.sendMessage(messages.getColorized(Messages.EDITOR_WORLD_EXISTS))
//Messages enum
enum class Messages {
EDITOR_WORLD_NOT_SCHEMATIC,
EDITOR_WRONG_USAGE,
EDITOR_WORLD_EXISTS,
EDITOR_WORLD_CREATE_START,
EDITOR_WORLD_CREATE_FINISH,
EDITOR_WORLD_COMPLETE_START,
EDITOR_WORLD_COMPLETE_FINISH,
NO_PERMISSION
}
class MessageConfig(plugin: Plugin, fileName: String) : YamlConfig(plugin, fileName) { // just a YamlConfiguration extension
operator fun get(message: Messages) = this.getString(message.name.lowercase())
fun getMessage(message: Messages) = this.getString(message.name.lowercase())
fun getColorized(message: Messages) = this.getString(message.name.lowercase())!!.colorize() // this is somehow null
}
// this is in the message config file
editor_wrong_usage: "Wrong Usage!\n Usage: /wwe <create|edit|delete|complete|cancel> [worldName]"
editor_world_not_schematic: "The world you are in is not a schematic!"
editor_world_create_start: "Creating an editor world. This may take a while!"
editor_world_create_finish: "World created! Teleporting..."
editor_world_complete_start: "Closing template editor. This will save the template as a serialized file!"
editor_world_complete_finish: "Serialization complete. Template saved in WandererWorlds\serialized_worlds"
no_permission: "You dont have permission to use this command."
editor_world_exists: "World already exists!"
am i tired or what, it was working last compile now broke somehow without any changes
no friendly NPE message?
marked the parts it tells me as null above as comments
its somehow not reading config
but the file is created properly if deleted so its not the file name being wrong
Caused by: java.lang.NullPointerException
at dev.peopo.wandererworlds.config.messages.MessageConfig.getColorized(MessageConfig.kt:11) ~[wanderer-worlds-1.1.0.jar:?]
at dev.peopo.wandererworlds.commands.editor.EditorCreate.onCommand(EditorCreate.kt:25) ~[wanderer-worlds-1.1.0.jar:?]
at dev.peopo.wandererworlds.commands.EditorCommand.onCommand(EditorCommand.kt:37) ~[wanderer-worlds-1.1.0.jar:?]
at org.bukkit.command.PluginCommand.execute(PluginCommand.java:45) ~[paper-api-1.18.2-R0.1-SNAPSHOT.jar:?]
... 21 more
i havent coded in kotlin yet (should definitely learn) but probably the problem is in YamlConfig ig
open class YamlConfig(private val plugin: Plugin, fileName: String) : YamlConfiguration() {
private val file: File
private val fileName: String
init {
if (fileName.endsWith(".yml")) this.fileName = fileName
else this.fileName = "$fileName.yml"
logger.info("Loading $fileName...")
file = File(plugin.dataFolder, this.fileName)
if (!file.exists()) {
file.parentFile.mkdirs()
this.saveDefault()
}
this.load()
logger.info("$fileName loaded.")
}
fun saveDefault() {
plugin.saveResource(fileName, false)
}
fun load() {
try {
super.load(file)
} catch (e: Exception) {
logger.severe("An error has occurred while loading the config file!")
}
}
fun save() {
try {
super.save(file)
} catch (e: Exception) {
e.printStackTrace()
}
}
}
highly doubt it
its so weird, rolled back my commit to when it used to work and it still throws null pointer
that colorize extension is also null safe right?
yeah
kotlin does not have null pointers unless you specifically allow it
fun getColorized(message: Messages) = this.getString(message.name.lowercase())!!.colorize() // this is somehow null
^ is where the null is 100%
this.getString on YamlConfig is returning null
which is just YamlConfiguration
try iterating the config key set and see what keys the actual map has?
idk just debug the shit out of everything
editor_world_complete_finish: "Serialization complete. Template saved in WandererWorlds\serialized_worlds"
๐ง I don't like that \s
oh shit
thats probably it
its probably escaping
yeah that was it
@lyric gyro thank you!
you're welcome ๐
kotlin 
so called "null safe" language
so called "null safe" language
null safe!!
so true
but also
Emilu
Emilu
they should make kotlin but instead of fun main you write public static void main that would be funny i think
composition > inheritance
I'm on mobile D:
then you have even less excuse
public static void main string args
function composition relieved
where is the function inheritance huh!!
in scala you can extend function types lmao
what!
Wdym
Whatevs[I, O] extends (I => O)
What is that
what is there to override
.apply
lmao
seems kinda useful
I did L extends (L => L) the other day and started to build lambda calculus functions with it
cuz you know
or BaseStream<T, S extends BaseStream<T, S>>
so it's like UnaryOperator<L>
yeah
But L in itself is a UnaryOperator
so UnaryOperator<UnaryOperator<UnaryOperator<UnaryOperator<UnaryOperator<...
spiral eyes
you could do L extends UnaryOperator<L>
but that's not really a proper function type
cuz java
true
hang on
is there even a valid value for that type
except the identity function
L => L
well no
you can return another function that isn't the input
e.g. TRUE: L = a => b => a
that is a function that takes a, but it returns a function that ignores its input and returns the captured a
yeah i was just confused about the type
but i forgot u dont have anything that's not a function in the LC
i was thinking like Int => Int
well i suppose you dont do anything
just like a "pure" turing machine doesnt really do anything
i find it intriguing how a Turing machine describes a physical machine but LC is more abstract and it's just .. whatever it is, but they define the same thing
how do you "build" a LC machine?
im not sure you could
but i cant elaborate
that is an interesting thought experiment though
You just have a lambda basically
PaperMC updated snakeyml in 1.19.2 which limits yaml file size. Someone knows if they will revert that change?
doubt it
whats the file size? ๐
I mean that's a lot to be fair

what do you have thats over 3mbs anyway
even big dm menus are a few kbs or 1mb at max
chances are they are using yml as a database
does java sets compare through hash?
nah hashing is fine
just need to know if they compare reference or hash
so i can implement hash method to the stuff i store
ah, okay
ex if you set it to always return 0, it will still work, but won't be as optimized
overriding both of them to be safe i guess
๐
it covers both cases no?
welp sorted then
data of heads are saved in a .yml file
I guess i have only 2 options, sqlite or json

you could also use separate yml files
if you want them to be accessible to users manually
- Snake now limits the length of a document to 3MB by default, Paper increases this to 64MB by default, due to plugins (mis)using YAML files as databases
feel like their use case is one where its kinda okay
you would probably want users to edit the settings of the heads
yeah but paper doesn't put the 3 mb limit like he said, it increases it lol
ah, yeah
(mis)using
if they are hitting 64mb though thats kinda
I mean bc they updated snakeyml xddd but where is what you said? Someone tested in the build released 2 days ago and it was 3mb, what you sent is in a new build? 
well if you use snakeyaml directly, you need to configure it yourself
or it was spigot instead of paper

why would one ever do that to themselves
idk, people are weird sometimes
Configurate uses snakeyaml, dunno that they adjust that size
Hey I have a quick question, is it smart to prepare statements like this?
private void checkTables(){
try (Connection connection = connectionKeeper.connection();
PreparedStatement statement = connection.prepareStatement("""
CREATE TABLE IF NOT EXISTS Coins (
player_uuid varchar(36) primary key,
coins BIGINT
);
""")
) {
statement.executeUpdate();
} catch (SQLException e) {
throw new CoinsDBException("An error occurred while checking tables.", e);
}
}
Incase its unclear, inside the () of the try, this will get a connection and also prepare the statment, and in the actual try block it will execute it.
Wouldn't it be better to just put in the connection inside the () of the try? Since I think once the connection gets auto-closed the preparedstatement will be picked up by GC
I'd leave it that way. While correctly implemented drivers should be able to deal with the latter, it's definitely not worse to have both as resources
(and the GC only comes afterwards, the resources should be closed properly at that point already)
better be safe than sorry
I thought so too, eg HikariCP should be able to handle it just fine. so both ways would be acceptable, in this case defining it inside the resources and inside the try block right?
hikaricp will actually go nuts if you don't close shit
this!
I'm pretty sure you have to close the statement btw
try with resource block aka try(closable here)
yes
otherwise it wouldn't compile
although not sure which order they get closed
as defined in the JLS :p
afaik you gotta close statement first
don't you have to put the statement in try with resources too
oh you mean which one to close first
yeah
wait if you close the connection
isn't that the database connection?
so you're reconnecting each time?

oh
it returns to pool
on close
https://docs.oracle.com/javase/specs/jls/se18/html/jls-14.html#jls-14.20.3
Resources are initialized in left-to-right order.
Resources are closed in the reverse order from that in which they were initialized
but i declared it in top to bottom 
so its perfect
also in the code above, he didn't close statement at all
dkim
that is exactly what the twr is for
its in the try block
so it closes automatically?
yes
try(closeable) {}
but what if you don't want it to close but you want it to be in try with resources
no
in {}
statement is in {}
is basically same as try - catch - finally close here
meanwhile kotlin
a.use {
b.use {
c.use {
}
}
}
I'm talking about statement, not connection
so
it still closes?
Wow
thats cool
the statement is declared in the resources block too
B.A.A.S - Too many caps!
No need to shout.
Barry's Anti Abuse System | v1.4.7
Ha
dkim both the connection and the statement are inside the parenthesis
B.A.A.S - Too many caps!
No need to shout.
Barry's Anti Abuse System | v1.4.7
OHHHHHHHHHHHHHHH_ _ _ _ _ _
Get fucked
B.A.A.S - Too many caps!
No need to shout.
Barry's Anti Abuse System | v1.4.7
do we get to shout if we boost
Good ol bass
no
damn
im just abusing a bypass
how does one get a bypass lmao
and none of the admins are online ๐
boost1inb

Does BAAS even exist anymore
B.A.A.S - Too many caps!
No need to shout.
Barry's Anti Abuse System | v1.4.7

I'm on discord
Search the world's information, including webpages, images, videos and more. Google has many special features to help you find exactly what you're looking for.
click that ^
and then are you on firefox or chrome or edge
Opera
oh
ew
mask
fem
I have a question
There is no time to wait! Ask your question @dusky harness!
if some data is lost throughout the internet
like if you were calling a REST API
how would the api function
or is it just so reliable
that it never loses any bytes
thats what packet loss is
If I had to guess it probably verifies the integrity of the packet sent
but I never do that with mine
something like TCP
internet protocol is smarter than that though
There is no time to wait! Ask your question @kotlin =!
I think it signals that packet is malformed and send a new packet?
with checksums and shit, a single byte is probably recoverable
It's been a long time since I've studied TCP
the server signals to send it again
TCP is very back and forth
but what if my client library doesn't support that
where is nialls meme about tcp
Bad library
that perfectly sums up tcp
if your client library doesnt support the TCP protocol then it cant even use the internet
then you can't connect to the internet
how's it know that I'm following the protocol 100% tho
a protocol is a protocol, if you don't follow a protocol then you can't use the protocol
it's like
hello i'm going to send you this
ok i'm ready to receive this
ok i'm sending this
ok i'm receiving this
ok i'm still sending this
ok i'm still receiving this
ok i finished sending this
ok i finished receiving
have a nice day
you too
if any of those messages don't come through then the protocol says to try again / send an error
there's a Tom Scott video to link here somewhere
how can i get a yamlconfiguration as a file?
wait
does the router do this or does the network library do this
Ask it
?
ask nicely
Time to tell a story about idempotency, computer science, and the Night of the Multiple Orders. โข Sponsored by Dashlane โtry 30 days for free at: https://www.dashlane.com/tomscott
MORE BASICS: https://www.youtube.com/playlist?list=PL96C35uN7xGLLeET0dOWaKHkAlPsrkcha
Written with Sean Elliott https://twitter.com/SeanMElliott/
Directed by Tomek
G...
the low level networking libraries in your OS typically
oh
it's not built into the hardware
so like ktor doesn't do it
no
but Windows does
i think
thanks Brister Mitten
you tell windows "hey send this to this address using this protocol, take care of the rest"
๐คฃ
This is good
i got it
well
i dont care
I don't use linux so its just Windows for now :(
very much recommend watching this
good
extremely common tom scott W
anyone have any profile picture recommendations
yes
does anyone know how how to "convert" a YamlConfiguration into a File?
does it even store the file?
I don't see why it would store the file
no i just want to make it into a File
d;YamlConfiguration#saveToString
@NotNull
public abstract String saveToString()```
Saves this FileConfiguration to a string, and returns it.
String containing this configuration.
public void save(@NotNull File file)
throws IllegalArgumentException, IOException```
Saves this FileConfiguration to the specified location.
If the file does not exist, it will be created. If already exists, it will be overwritten. If it cannot be overwritten or created, an exception will be thrown.
This method will save using the system default encoding, or possibly using UTF8.
file - File to save to.
IllegalArgumentException - Thrown when file is null.
IOException - Thrown when the given file cannot be written to for any reason.
oh
i dont want to save it to a file, i just want to turn it into a File
what
huh
that does not make sense
they dont hold any hard reference to files
a YamlConfiguration is not attached to any file in particular
^
if you want to keep track of a config and file then you'l have to encapsulate that into a separate class
YamlConfigurationButWithFile
so i have to save the yaml to a temporary file and then use new File(path) to get it as a File?
?
what
why do you need "it as a file" to begin with?
trying to compare YamlConfiguration with a file: https://stackoverflow.com/questions/61555920
Huh
Well, again, a YamlConfiguration is not attached to any File in particular, you load any file you want into a YC and use it, but it could be any file into any yc
i know
i need it as a File cause i cant do:
objectMapper.readTree(YamlConfiguration));```it has to be
```java
objectMapper.readTree(File));```
you can't get a file from a yamlconfig
that is not a thing that exists
if you want to check if 2 configs are equal then just compare getValues()
oh
wouldnt recommend that, yaml is messy so they might get encoded differently
wtf
here srnyx
:D
thanks
np
Is possible via JS to trigger normal input form events when setting the value of an Input arbitrarily? I am having issues because the validations on the fields are not triggered when I use input.value = "blah" on my JS code (an userscript).
ye thats what i was worried about
ill use what u said brister (values comparing), ty
np
in future please just say what your end goal is because that was classic xy problem
wait if i have this:
key1: value1
key2:
key3: value3
key2: value2```what would that look like when i use `getValues()`?
more precisely, what would be the map's value for key2?
another map
yes
alr, ty
ok to be more specific im trying to compare a YamlConfiguration created by the plugin and a YamlConfiguration loaded from a file
blue: YamlConfiguration created by plugin
red: YamlConfiguration loaded from file
https://img.srnyx.xyz/java_52LJi8Oxfw.png
they should be the same, but for some reason red has more stuff
that's probably intentional
it loads stuff as memory sections
i wont lie im not sure what the end goal here is but
try saving to a string and then loading it back to trigger YamlConfiguration#convertMapsToSections
kinda cursed but
but
at that point i'd rather load the file into YamlConfig and compare both's saveToString
do it
alright
when are you coming over?
i need to adjust my schedule tho so please let me know
what time works best for you?
wait but you guys are in different timezones
really?
you do know
yeah you do know
you're not welcome
np
am I welcome
thanks bm
you're not welcome
oh
you're not aiden
plot twist
im not not aiden
๐คฏ
Hahaha
thanks
no problem
problem
there's no time to wait! ask your question @lyric gyro
no need to shout
pwd
epic
whats the first thing you think of
the linux command?
epic
actually that was a lie
oh
the first thing i thought was pwn
@icy shadow hello i need some help with this plugin private mines how can i integrate it with essentials
because it's funny
yeah so you get a metal object and then stick it into an electrical socket, that will integrate it
because im not
i am an expert in private mines plugins
B.A.A.S - Too many caps!
No need to shout.
Barry's Anti Abuse System | v1.4.7
B.A.A.S - Too many caps!
No need to shout.
Barry's Anti Abuse System | v1.4.7
thats old news dkim
contributers 
or don't
wdym
what
why would they dont
you heard me
What do you mean
is it bad
they are making a prison server
huh
@UntouchedOdin0 thoughts?
who?
Kyle
asked
Mister Controversy
god i am so funny
no
what do u mean no
dont be silly
B.A.A.S - Too many caps!
No need to shout.
Barry's Anti Abuse System | v1.4.7 @kotlin = You're sending messages too quickly.
Hello there
:)
๐ค
every lang with semicolons = bad
hgdfjgldfkgfdpj
fniosfidf
emiofksgd {}
Excuse me?
hey whats up
those are your coding skills
how dare you
I see youre idling.
Procrastinating eh? ;)
oh yes
a very important what?
No favourite IDE arguments.
vim is the best
i feel like the eclipse vs intellij debate has moved on
it's just not a thing anymore
now it's kotlin vs java
Its ij vs vscode now
vim
vi
v
_ _
i really dont think it is
in my 27 years of coding spigot plugins ive seen about 2 people say they use vscode
good
so true
Kickin my ass i see
They do say โuhโ
there's something to be said about a guy with a hammer seeing everything as a nail
you're kicking your own ass by using vscode
which is quite anatomically impressive but not very useful otherwise
yea
Some people like that type of thing
actually
As long as ij lags out, ill use vscode so its its own fault
it's*
Im lazy
First one
well done
Thanks
I see how it is. Well. Bye i guess

goodbye
ah fuck i have a lot of work to do 
same
also
this is very unrelated but
the launderette double charged me and the dryer didnt fully dry the clothes so i needed to use it twice
so i have spent a whole ยฃ10 on a single load of washing
how many clothes are we talking about?
just one outfit?
no
๐คจ
clothe
https://github.com/apocas/node-whmcs
For those familiar with the node package, whmcs. I'm having an issue using a API key/secret- I get an error message stating that username property is required. What could I be doing wrong?
what if i looped thru all the keys from one yaml and compared their values to the other one?
that'll be the exact same as equals lol
unless you fuzzy compare MemorySection and Map
which is even more effort
Write a wrapper that converts a memory section to a map then compare
@icy shadow this ended up working:
yaml1.saveToString().equals(yaml2.saveToString());```
Did we ever find out why they were doing this
so that when im saving files it doesnt save/overwrite a file it doesnt need to
...
if the files are the same then there's nothing to overwrite
it's an idempotent operation ๐ค
free my boy @dusky harness
so true
i mean I could
well it said on my scp that the file was changed
is that really such a big problem
You've unmuted dkim19375#6351!
๐ญ
it really is
When I'm op the ui opens but when I'm not op it gives me error
That's nuts
๐ฑ
is there a cleaner way to have a world without file?
I currently override serverlevel but trying to see if there is a non nms method
doubt
then does anyone know if I need to register the custom worlds anywhere other than nms server. levels?
I went through nms source but thats the only place I could find that needs to be registered
Guys check my plugin https://www.spigotmc.org/resources/hypixel-sky-block-menu.105468/
Ok sorry
thats just sad
Anyone good with image work in java?
My goal is to take java assets and punch them together for images being sent by my bot to discord. Example: Player dies with a diamond pickaxe in their hand. So I have to create the inventory image with the player puppet, their skin applied within the inventory as well as the item held just like the ingame inventory. I know this is... not the easiest task.
I'm currently looking at libraries and I'm rather unsure. I know that I want generation to be as fast as possible, but I'd also like the option for additional effects. Any ideas, suggestions, pointers? If it was your task, what would you use and why?
Haven't done anything like that before but have you tried looking into making some sort of web api that you can request generated pics from?
I have no idea what the actual generation method would be though lol
no point, just adds delay for no reason
imageJ is okay afaik
i have not used it myself though
Was just about to say that someone posted in showcase exactly what you want but the post was made by you xD
#showcase message
Yea, exactly that. Currently, I rely on interactive chat discordsrv addon providing the image methods and my plan is to get away from that dependency. Sometimes, with that, images (especially ones that have many layers such as inv + puppet + items held + full inventory + armor) take up to 7 seconds to come back - something I'd like to fix in my version.
I'm trying to make a projectile invisible. I know I need to use packets for this, but I don't know how to get the packet I require. I found that I need the PacketPlayOutEntityDestroy, but I don't know how to get it. I can't find the class path for it anywhere, anyone who knows?
you using remapped?
if so to find the mojang remapped name of the spigot class use https://nms.screamingsandals.org/
for mojang, its ClientboundRemoveEntitiesPacket
how to code command to check player inventory and take item in this?
cast sender to player, get player inventory, inventory.removeItem(itemstack);
the event player invent?
you can get the player's inventory from the player object


clearly not taking this seriously so you wont get any serious help from me
i would spoonfeed, if i and only i want to, not because someone else told me to
That was actually very useful, I managed to get and instantiate the Packet. However, I can't send it lol :> I get this: java.lang.NoSuchFieldException: playerConnection Here is my code```java
try {
Object packet = Class.forName("net.minecraft.network.protocol.game.PacketPlayOutEntityDestroy")
.getConstructor(int[].class).newInstance(new int[] { p.getEntityId() });
for (Player player : p.getWorld().getPlayers()) {
Object handle = player.getClass().getMethod("getHandle").invoke(player);
Object playerConnection = player.getClass().getField("playerConnection").get(handle);
playerConnection.getClass().getMethod("sendPacket", getNMSClass("Packet"))
.invoke(playerConnection, packet);
}
} catch (Exception e) {
e.printStackTrace();
}
oh, reflection. how fun
has Player been cast to CraftPlayer?
It has not no
you need to do that, not sure how that works with reflection
I'm supporting 1.14-1.19 so I didn't think that worked
Casting to craftplayer I mean
public class YourCommand implements CommandExecutor {
public boolean onCommand(CommandSender sender, Command cmd, String label, String[] args) {
if(!(sender instanceof Player player))
return true;
PlayerInventory playerInv = player.getInventory();
ItemStack diamond = new ItemStack(Material.DIAMOND);
playerInv.removeItem(diamond);
return true;
}
}
actually, if it didnt work it would fail at getHandle
hmm
maybe its renamed something else
yay...
how to create new pack have command
pack?
package
b
its not playerConnection, its b
oh
I just saw that as well lol
what version are you using rn to test with?
why create package with command ;-;
rn it is 1.19
1.19.0?
Yus
beacause this dontunavailable
Not login my account
what about connection?


Its fast when I login my account by number it says unable to login in discord
this is not discord support
lmao
connection?
this
Hmm?
?not-discord
Looking for discord support?
HelpChat is a Minecraft plugin and development support server and is not affiliated with discord in any way.
If you require support from discord, we recommend you to visit their official support website at https://support.discord.com
On this website, you can read their FAQs, or open a support ticket if necessary.
instead of b try connection
Ahh, I see. Lemme try
last thing i could think of
cant upload image
You won't be able to upload images here directly to avoid spam, so please use https://imgur.com/upload or similar service to upload images/screenshots.
o wait
Ugh java.lang.NoSuchFieldException: connection
not have commands package
please learn english
getHandle gets the EntityPlayer, so you would have to get it from the object handle
yeah i see
you need to get field b from your handle object
help me
not from the player object
how to add command
add command
yes,in my plugin
Oh, so handle.getClass().getField("b").get(handle)?
check tutorials in the internet
yes i think
Lets see then :>
i dont understand
something like that
unlucky
Because they already made the command, I don't understand what they do
how old are you
let's stay on channel topic
how?
That did work, but of course there is another problem lol, though I'm sure it is the last one at least heh. So, I can't send the packet to the player since java.lang.ClassNotFoundException: net.minecraft.network.protocol.game.Packet, it is this row playerConnection.getClass().getMethod("a",getNMSClass("Packet")).invoke(playerConnection, packet).
I'll just have to find the class path of the Packet class though
please learn java before coding spigot plugins
Add spigot to your build path or dependency manager.
@proud pebble, I've managed to get it to work now. Thank you so much for the help! Now 1.14-1.19 support awaits me lol. Thank you so much though!
you changed the class to net.minecraft.network.protocol.Packet ?
added
i didnt do much tbh
and the next tip?
Indeed
You did, the website you sent at the start was very useful :>
id say that the only thing thatll change between 1.14 and 1.19 would be some class path changes and maybe a change to the obfuscated character
or if its not obfuscated name then to its current stated name
sounds like fun /s
@hoary scarab help
i kinda hate this sentiment because you can very easily learn java using spigot and it seems like it's completely a slap in the face and disregards whatever the user is asking how to do, it seems so much more helpful to say to focus on learning java conventions.
Saying to learn java before spigot plugins is essentially saying "lol quit plugins, its too hard for you" 
instead of saying, I recommend looking into how _x_ language is used to help with the plugin, you're just saying to just stop entirely
i disagree, using the spigot api well requires a pretty strong understanding of OOP and java fundamentals and if you dont have that before you're only making things harder for yourself
you might be able to make something work but it'll be a gigantic mess that barely works
I never actually learned java. All my knowledge/experience was started from spigot.
no wonder
i agree with that much, but saying to just completely disregard using spigot api entirely is plain stupid to me
it's completely unhelpful
trying to code plugins with 0 java knowledge is equally unhelpful
-> user asks for help on how to do something
-> developer tells them to learn how to do it and nothing else
-> user got nowhere
oh sure i wouldnt use it as an excuse to not help someone
people so often just tell people to learn the language without pointing them any direction on how
but 9/10 times if someone doesnt have java knowledge they wont even understand any helpful explanation
giv cod
but in 9/10 cases people just say "learn java" and give no directions from that point on
citation needed
learn-java moment
?learn-java
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!
thanks <@&333634764085133313>
even then that's still limited imo
limited how lmao
this + the amount of people that just want the code is also quite high usually
those are literally the starting points
they come back with the same type questions constantly
yeah they're the starting points but even then it can take a really extended amount of time to get to the point
and thats normal, you kinda have to deal with the pain





