#dev-general
1 messages · Page 22 of 1
It allows the StringBuilder to change value without having its reference changed?
yeah you can add and remove characters etc
a String is basically unmodifiable on the inside
Great alright
Now for a question that has nothing to do with all of the above, how do I get a Material object off of BlockState?
idk
docdex is actually useless
gettype
getType returns material as emily said
what version of spigot are you using
1.19.2
restart ij
or just type it in manually and see if it compiles
ij suggestions r probs just ducked
declaration: package: org.bukkit.block, interface: BlockState
it's definitely a method
Is it in 1.19.2 for sure? might jsut be 19.3
what's the full name of that BlockState you're using? with the package included
it's definitely been around for a lot longer than 1.19
OH wait, youre right I'm using a worldEdit blockState
yeah then that'd be the blocktype if you're using worldedit
Hmm, how can I check if it's a specific Material?
how do you compare enum values
Well, I don't know how to get the Material of the WE BlockState
So I guess Ill have to compare it to something else other than a Material Enum
Why would they make it BlockType(s) I had to look for some time
block types are stored in the balls
you're wrong
I'm using FAWE API. Is it possible to change blocks in a ClipBoard before pasting it in?
I tried it with the deprecated setBlock(BlockVector3 vector3, B Block); method of ClipBoard but blocks wont change
BukkitAdapter has a couple methods for converting them
Integer x = 1;
int y = x + x;
How many variables are being boxed and how many unboxed?
1 boxed 1 unboxed?
1 boxed 2 unboxed?
1 boxed?
None?
I'm not doing your homework, nice try
i had never heard of boxed and unboxed variables, and i think i know the answer
is that actually a homework question?
most likely
None of the those right? It would be 2 unboxing?
Wouldn't that be the same as int y = x.intValue + x.intValue?
I could be very wrong here though
Oh wait, no I see it does box once
i think 1 boxed, 1 unboxed
^ must be right
boxed once, unboxed twice
Surely it only unboxes once since it's the same reference?
but you're getting it twice
That is true, I suppose I assumed it would be "optimized" to only do it once
the compiler won't really do such thing, but the runtime vm most certainly will
So does (un)boxing only happen during compilation then?
no, I mean that the compiler won't optimise it
when it's compiled it effectively does this
Integer x = Integer.valueOf(1);
int y = x.intValue() + x.intValue();
the runtime will eventually notice that doing that is pointless and it'll just discard the whole thing because nothing is actually being used
Ah
smart runtime
[Wed 09:37:23 INFO Server/LoginListener] UUID of player Taneax is eac22ee0-6eaf-4593-9e3c-a6744f737195
[Wed 09:37:23 INFO Server/PlayerList] Taneax[/95.222.29.77:60880] logged in with entity id 613 at ([world]-1585.8150453412288, 151.5410174010605, 202.96888092210804)
[Wed 09:37:23 INFO Server/PlayerConnection] Taneax lost connection: Internal Exception: net.minecraft.network.PacketEncoder$PacketTooLargeException: PacketTooLarge - PacketPlayOutScoreboardTeam is 2110927. Max is 2097152
No one can join my server anymore idk why... Please help me!! ):::
https://pastebin.com/uQR10wMD
Well well well, seems like one of your plugins is attempting to send a scoreboard team packet bigger than the maximum size, try disabling your plugins to find the culprit
How does barry do the spigot verification command?
faith, trust, and pixie dust
I thought the admins manually update the buyer list but there's like a force check command
so
¯_(ツ)_/¯
wa
Do you recommend running file reading/writing asynchronously?
yes, but that necessarily mean it's the best thing to do
What-
I assume they meant "...that doesn't necessarily..."
Zod is correct, lol
Yes that's what I assumed as well but I thought he might be making some joke
imo file handling should be async when handling large/big files?
Well, in my case, I never know when things can get big, but I'm thinking of using MongoDB anyway because file reading/writing is garbo
It all depends on what you‘re actually doing
Hi, someone know how to make on discord player profile "minecraft server status" with ip, logo, website etc.? sorry for my bad eng btw :/
What?
Sorry wrong ping. Accidently made a mistake pinging you.
Click settings, then click at profile. There you can change your about me.
think they mean rich present lol
does anyone have some documentation for how to properly handle in-memory objects that are read from a database?
I'm facing an issue with a plugin that I'm working on for Quests. The User object that contains info about completed quests, current active quest & its progress are read from a database and then the data is saved on an interval and some quests are reset daily / weekly. The problem that I'm facing must have something to do with players joining when the quests are reset, resulting in two objects for the same user existing in memory or something like that.
Calling runTaskAsync and adding to an arraylist doesn't work. Anyone have any idea?
100% different
Different
uh okay
uhm tried using synchronizedList?
seems like a concurrency issue
What object is that
Aka something like this Collections.synchronizedList(arrayList);
unsure if it's exactly like this, can't recall 100%
it should return a List object if I recall correctly
and then you can use it inside the asynctask
but that requires every access to the list to be synchronized using the returned instance. You can't use arrayList directly anymore
also, that likely isn't a good solution to whatever your problem is
uhm hmm
CopyOnWriteList? isn't that thread-safe too?
CopyOnWriteArrayList*
although yeah, do you need it to be async?
the real solution is to not mix mutability and concurrency
think we need more context
it is, but at a heavy cost (copying every time you write)
yeah...
there are more efficient concurrent data structures if you actually need them
Although... it might not be a big deal if it's not used in a loop or smt
fair enough, was just stating some that I remembered lol
not a concurrency expert
At the end, think we need more context on where this is being used
Maybe there's another way of doing it while avoiding all that
hopefully
t h i s
The real solution is to not use mutability*
What I'm trying to do is grab info from a File async and then add the object I'm creating to a list
but it doesn't work
real
So, I've made so that an async method accesses the files creates the object and then adds the list but it never occurs
the question is why are you doing this
^
I feel like accessing files synchronously might cause lag
but as we've mentioned before, you cant just mix mutability and multithreading and hope for the best. it just won't work
well yeah
but why does it need to modify the list, what's going on?
Alright to be more specific, I'm reading through the files then creating Arena objects for my ArenaManager
that sounds like you can fully create that list on a different thread
How do I hold one consistent thread? If I go with runTaskAsync it'll call a different thread every time
well do all the work in one task
but tbh if you do that e.g. on startup only, there isn't much reason to do it async
yeah if you're reading on startup performance doesnt matter
or rather, doing it synchronously is fine
Okay great then I'm dumb
xD
Anyone have any idea why my runTaskTimerAsynchronously runs only one time then never again?
we are not akinator
we don't just know your code
and whatever
you can also read the docs
^^
Well, apparently, I guess it's just Spigot's problem.
I used the deprecated method with the BukkitRunnable and it worked just fine. The new version of the method with the Consumer just denies to work
don't blame the API before blaming your use of it
tens of thousands of people tested this code
Well, I mean, I just ran the code with the Bukkit Runnable and it worked
Jesus why do people keep denying to share code
because humans are stupid
Share code
We can't help you without it
I'm fine I'll just keep using a BukkitRunnable I don't really mind
post it anyways, itll bother people if you dont
It won't bother people if he doesn't rn
it does bother me at least that people ask for help and expect for us to be genies and automatically solve their problems
and when we ask for a simple thing that will help us help them, they refuse
I know whether I'm supposed to send my code or not. I make sure I send my code when it is code specific, but I'm sure the stuff I mentioned is general hence no code needed
everyone interested in helping you asked for code, don't think it's up to the person asking for help to decide what we need tbh
but you do you
No, I mean, I get why people asked for my code but since BukkitRunnable worked and Consumer didn't, I suppose it's a Spigot thing
My code didn't have anything specific anyway so that's why I didn't mind sharing it. It was a simple async and the contents didn't really matter
So, no, I didn't expect you to be a genie
Exactly our point, an api widely used, no one ever had issues with it besides you, it's an obvious user error (99.8% chance) hence why we asked for code
Funnily enough, google spying me, popped this up: https://blog.codinghorror.com/the-first-rule-of-programming-its-always-your-fault/
You know the feeling. It's happened to all of us at some point: you've pored
over the code a dozen times and still can't find a problem with it. But there's
some bug or error you can't seem to get rid of. There just has to be something
wrong with
Yes, I get your point, but since I saw that BukkitRunnable worked just fine why bother elaborating
Isn't that literally an outdated method?
You know, the ones specifically meant to not be used anymore?
And it is beneficial to still elaborate, since it benefits both you, and IF it's actually an issue in the api, it can be reported and fixed.
It's basically a Win/Win
But anyways, it's past
for(Mine mine : main.getManager().getMines()){
if(!mine.getRegion().contains(b.getX(),b.getY(),b.getZ())) e.setCancelled(true);
}
I have this code here, and I don't want them to be able to break if the block is not in the region of one of the mines. How could I optimize this?
b is Block
for(Mine mine : main.getManager().getMines()){
if(mine.getRegion().contains(b.getX(),b.getY(),b.getZ())){
break;
}
e.setCancelled(true);
}
or
boolean found = false;
for(Mine mine : main.getManager().getMines()){
if(mine.getRegion().contains(b.getX(),b.getY(),b.getZ())){
found = true;
break;
}
}
if(!found) e.setCancelled(true);
If I were to make a service team bot that had literally everything, and either charged an upfront or subscription, would there actually be a consumer market for that kind of product? Not sure if I should invest time into it without there being a actual market for it. It would also include a web panel where a lot could be done for admins outside of discord.
Indeed better approach but return; would be much more favorable I believe
It depends on several factors such as the features offered, the target market, the pricing model, and the competition.
There is certainly a demand for service bots in the market, especially within the gaming and customer support communities on Discord. Having a bot that includes a web panel and provides a wide range of features could potentially be attractive to businesses and organizations.
However, it is also important to consider the competition in the market and the pricing model that you choose. If there are already similar products in the market, it may be challenging to compete unless you offer unique or additional features.
In terms of pricing, the upfront or subscription model could work, depending on the target market and the value that the bot provides. A subscription model could be a good choice if the bot provides ongoing support and maintenance, while an upfront model could be suitable if the bot provides a one-time solution.
In summary, there could be a consumer market for a service team bot with a wide range of features and a web panel, but it is important to carefully consider the target market, competition, and pricing model before investing time into developing it.
yeah, one of my main concerns is why would they use mine over hiring someone to make one for them.
what is your WPM btw, you made that whole thing in like a minute
Sweet.
Not much I suppose.
AdamGPT
no kidding
?
he is commenting on how what you said is very similar to something ChatGPT or GPT 3.0 could've made
(if you dont know what ChatGPT is, its a highly advanced AI that is as smart as the internet)
I didn't know about that stuff for sure.
not sure if that is sarcastic lol
Beep Boop fetching data
Does anyone know if WorldGuard works async to check regions etc?
I use translator and grammarly to chat. I don't understand english much, I could say.
interesting
Copy- paste.
Entiendo.
idk why, but I love watching this
even funnier since it's entirely made by ChatGPT (with some modifications and fixes)
scrapping
yes.
dumb ass question but, I have been setting up a wsl for ubuntu to use neovim (dont ask why), and I'm wondering if it is possible to install bspwm to have a window manager
I tried
I failed
.
Why
Everyone use ChatGPT these days.
Somehow my school hasn't blocked it yet on their wifi, English class is going right down the toilet. ChatGPT has written like 90% of what is turned in lol
Yeah
I just don't like the idea of our future generation cheating their way through school. They won't be able to properly perform in any technical or demanding job down the road without extra classes to retouch where they cheated.
Like, what would think of your surgeon used ChatGPT to cheat their way through med school
I don't care, it just shows on how much the achool system sucks. Hopefully they will notice it now and change it.
People don't get good grades from learning, they get it froms tests, so why learn if you can just cheat and get the same results?
or well, get looked at in the same way.
You say that likes it's something new.
It's not, but the open access part is relatively new
Cheating is new yeah
Talking about "cheating"
Oh well, I just think using AI is far more powerful in terms of replacing actual learning and thinking, and is far more accessible compared to regular cheating. Idk, I am not a school admin or anything, just my opinion
Like, I could pay my smart friend to write me an essay, or go to openai, give it the prompt, and call it good.
I mean yes methods are becoming simpler... but people have been cheating their way through life for years.
Yeah I don't think they were suggesting otherwise
They seemed to be speaking more about a fear of a rise in cheating
I was just commenting on how much easier and more widespread it's become
And it's also harder to compete with a literal computer in terms of college and job acceptance (if it gets that far)
Wait @inner umbra how do you have two rank roles?
I get that. But you know the saying "cheaters gonna cheat" the easier it gets for people to cheat at anything the harder others will have to work against it. Some may slip through, but eventually someone/something will catch them lacking.
I think the bot fucked up when I tier'ed lol
I just wrote a page to add to this conversation but figured nobody would read that.
I think ChatGPT should be forbidden in some cases and special sections added where you can google and of course, use GPT as that would prepare you for a job, where it isn't forbidden.
The school system doesn't suck, it's just a bit (very much) outdated and not adjusted for learning to use online tools to simplify the job.
Disagree
Ok
I agree with that statement. The current school system is not built for modern society and its tools.
I read that as "school system sucks"
lol
it's a memorization game
literally
memorize good? Pog, you get good grades and you are very "intelligent"
intelligent lost it's meaning with this school system
(mainly focusing on mine, since every country has a slightly different system, although all suck lol, minus maybe Finland and Sweden)
I completely disagree
opinions
The U.S. (or at least my state/school system) is moving the right direction. Like, for biology, we were given a bunch of material, and to learn it we did a bunch of hands on labs. We never did any worksheets, or presentations. Everything was hands on and we learned through questions and curiosity. At the end, the test was another lab, that we had to do on our own using the skillsets and knowledge we learned in the other labs before it. We were graded on how well we did the lab, like if we used the right population selection methods and made sure all extraneous variables were accounted for. This obviously wont work for every subject, but I know my parent's had nothing close to this experience when they went school.
And, it really limits the amount of cheating that is possible.
Things like math are different, but for subjects like science that is the right way to go about it. Hands on is best in almost every situation. We even have a class where we were given a specific topic, and we have to find a question that doesn't have a clear answer, and spend the entire year researching it. Finding scientific journals and coming to various conclusions off of them. We also can run our own labs and things to find the answers we need. Its really interesting because each student can pick their own path, but in the end they all learn the process of experimenting and finding ways to answer the seeming "unanswerable" questions. It is a lot of really useful life skills, and almost all of it can't be cheated on (mostly) because it is information that isnt compiled. Its a bunch of various bits and pieces that you have to piece together.
Sorry if that wall of text is a lot to read, just trying to express that at least my school district is moving in the right direction.
As said, depends alot on the country
bro who cares
idk
people who still care about their education?
or the future of it for their children
sure, but arguing about it in a minecraft help server won't change it lol
Uhm how do y'all make methods with consumers, which rely on an event?
Okay this sounds confusingly explained lol.
Uhm, lets say, if I were to add an item to an inventory and I want to make it execute smt when clicked, using a consumer, how would I make that method?
(just an example to explain what I mean, not the actual use case)
you can look at triumph-gui, basically you keep the track of items and their actions, and if the item clicked has an action associated, just pass the event to the consumer
public void yourMethod(Consumer<EventHere> consumer)?
confusion
eh it's done in kotlin though, isn't it?
no
I wish
fun yourFun(block: EventHere.() -> Unit) 😔
so I basically store for ex. in a hashmap the item and the consumer/action, then listen to the event and check that list and voila?
uh yeah
I am just a bit confused with the "pass the event to the consumer" part
consumer.accept(event)
I think okhttp (?) has its code written in like kotlin and makes it java-compatible
I'm 20% sure on that
or at least some of its code
actually that would mean that the entire kotlin stdlib would be shaded in
which probably isn't ideal
I dont think they do anything special to make it java compatible
but since triumph-gui is a library for mc and the plugins are usually coded in java, would be annoying to shade 4mb of kotlin
true
Yeah it's nothing about compatibility but size, people already complain about 200kb libs lol
uh so basically (sorry to disturb), I listen the click event, then get the clicked item and check if it's the same of the hashmap and if it is, I get the consumer, accept it with the event?
items = map<Whatever, Item>
class Item {
ItemStack itemstack
Consumer<Event> consumer
}
onEvent {
items.get(whatEver).getConsumer().accept(event)
}
consumer#accept is nothing more than a normal class with a method ClassForListener#processEvent(event)
what's whatever in this case? confusion
okay, understood, tysm
final Player[] targett = {null};
if(target == null) {
Bukkit.getScheduler().runTaskAsynchronously(main, t -> {
targett[0] = Bukkit.getOfflinePlayer(args[1]).getPlayer();
});
}
Why does it allow for a final one element array to go through but not a single object?
"to go through"?
a) thats a bad idea, you cant share state between threads like that (it will almost certainly just be null by the time your synchronous code runs). your best option is CompleteableFutures
b) a normal value is just a reference on the stack. by the time the lambda runs, theres no guarantee that the stack still contains the reference so you can't just change it. with a final array, you can copy the reference to the array, which will be on the heap and so still exists by the time the lambda runs
targettt has been set as final before, your attempting to set a new value to the final variable, which you cant.
that's not what they were asking
it's for the same reason why x is still 3 here```java
void a() {
int x = 3;
b(x);
}
void b(int x) {
x = 4;
}
but it's 4 here ```java
void a() {
int[] x = new int[]{3};
b(x);
}
void b(int[] x){
x[0] = 4;
}
How do I wait for Async response?
Is it guaranteed I'll geta value?
or better, do you recommend a better way to check whether an offline player exists? It seems to take a whole second to make sure the offline player is null even though I'm the only registered player in the game so I suppose it checks for every single account?
Or.. I could go through all the files and check if their file exists?
I thought the server had an Offline Player list ?
that doesnt answer the question
No, by exists I mean that I create a file for every player
so if it doesn't exist, that player was never on the server
But I don't know how slow it is to iterate through all file names
E.g. if I have 10.000 player files registered
why would you need to iterate all the names?
Isn't that java's default
what
for example
?
i dont believe so
it just goes directly to that path and sees if its there
also why dont you just do Bukkit.getPlayer(String)
thats not the same thing
getPlayer(); returns someone approximating the name or if noone such that is online it returns the first player it finds im pretty sure
getPlayerExact(); returns the exact player
your pc would perform absolutely terribly if the operating/file system didnt have some way of checking if a file exists without iterating lmao
anyway
getPlayer returns the player ignoring case
i think this is a contender for the biggest XY problem ever
true that
getPlayerExact if that ex8sts would only get the player if the username is exactly that
they clearly said that they want to check if an offline player exists
yes
also yeah no getPlayer tries to find the closest match
then why the Bukkit.getOfflinePlayer().getPlayer() call?
who knows, misunderstanding presumably
Yes
That means it does or it doesn't?
it does
but in future:
- dont prematurely optimise, it's a waste of time
- dont just try to guess how things perform, you'll probably be wrong
- if you really wanted to know how File#exists works you couldve just looked at the source code lol
like afaik Bukkit.getOfflinePlayer(String) uses the mojang api to get the players uuid to then check the files
About the File#exists, I already knew I just had a brainfart at that moment
Yes, I realized but I thought the server saved an Offline LIst
yeah ik
Thanks Mr Brist
or even better, dont make any assumptions based on implementation detail and just go by what the public API says
i found the getPlayer methods in CraftServer, but theres no mention of offline player
i think you need glasses
trying to find it while scrolling on mobile isnt fun, id just use ctrl+f if i was on my pc
Error occurred while enabling Test v1.0-SNAPSHOT (Is it up to date?)
java.lang.ClassCastException: class kyriakum.com.main.EconomyAPI cannot be cast to class kyriakum.com.main.EconomyAPI (kyriakum.com.main.EconomyAPI is in unnamed module of loader org.bukkit.plugin.java.PluginClassLoader @4d367900; kyriakum.com.main.EconomyAPI is in unnamed module of loader org.bukkit.plugin.java.PluginClassLoader @63d6dae6)
private Economy economy;
@Override
public void onEnable() {
EconomyAPI api = (EconomyAPI) Bukkit.getServer().getPluginManager().getPlugin("EconomyAPI");
economy = api.getEconomy();
System.out.println(economy.getMoney("kyriakum"));
}
I'm trying to set up an API but it doesn't seem to work
what
what does it mean by is in unnamed module of loader
you're not using modules and org.bukkit.plugin.java.PluginClassLoader is the classloader
it's not really important that bit
anyway you're probably shading the api in your other plugin
dont do that
gradle or maven?
actually, for gradle use compileOnly and for maven <scope>provided</scope> or none (default is provided iirc)
^
I'm not using gradle or maven

I'm just doing it manually through Project Structure on Intellij IDEA
why
I mean, the tutorial I'm watching does it like that
time to find a proper tutorial
Hahahah
im not joking sadly
I know I know
teaching how to use libraries using that shit should be illegal 
So, I have the scope to system. It still gets the same error.
<dependency>
<groupId>kyriakum.com</groupId>
<artifactId>main</artifactId>
<version>1.0</version>
<scope>system</scope>
<systemPath>C:/Users/kyrohuge/Desktop/Server here/plugins/EconomyAPI.jar</systemPath>
</dependency>
It definitely keeps shading the plugin my Test plugin is bigger than the API
yo what happened to hastebin
I deleted it
Maven 😳💀👹🤮
pastes.dev >
gradle 😚🥵🍑😩
I figured it out. Thanks guys
provided scope didn't work for some reason? I dont know. I just did maven clean install and grabbed the unshaded file
I find the XML structure difficult to read, or even in its most readable; cluttered.
Functionally I've never used maven, but gradle has honestly been a breeze once I familiarized myself with it a bit.
2% of dudes
🤣🤣
https://youtu.be/U4ogK0MIzqk nice video
My attempt at creating a little chess playing program!
Think you can beat it? Give it a go over here: https://sebastian.itch.io/chess-ai
If you'd like to support the creation of more videos (and get early access to new content), I'd greatly appreciate the support here: https://www.patreon.com/SebastianLague
Project Source:
https://github.com/S...
how do you even start using bits to represent things (piece type and color in this video)
wrong chat @drowsy briar
{
"parent": "minecraft:item/generated",
"textures": {
"layer0": "minecraft:item/elytra"
},
"overrides": [
{
"predicate": {
"custom_model_data": 3
},
"model": "melonsmp:item/cupids_wings"
}
]
}
```This changes my elytra item with custommodeldata=3 to my custom texture, but how do I change the entity texture for this item?
CIT isn't a vanilla minecraft thing, you can try using Optifine but it won't show for vanilla players
I keep doing mvn clean install mvn compile even changed the version and the project keeps installing an old version. Any ideas?
afaik you cant change the entity texture, you can change the base texture but not for a specific model data
did you change the version in the pom.xml?
weird
did you click the little maven button?
the V button
you gotta do that every time you make a change to the pom.xml afaik
I even restarted intellij
I'm telling you the project is being installed as if the classes never changed
I keep making new versions and everythign
It just denies to give me the new classes
It doesn't even build the correct artifact??? I don't know whats going on but its really annoying
reinstall intellij?
Did u do
- Invalidate caches and restart
- Repair IDE
Both in Files menu
Even if there was an error with maven, I don't get why there would be an error with building the artifact
Oh if building doesn't work then it's not intellij issue
It does, it just builds the old project
Also odd how you say artifact... How are you making the jar
No matter how I change it
It's like it's frozen
I just do build artifact
But it's the same for the jar through mvn install
Use mvn clean package
Don't do any artifact thinfs
That's intellij own build tool
I've always been doing it like this
You don't wanna be using 2 tools
It always worked fine
For 1 projecy
.
Run mvn clean package
And if there is an error, send the error and the pom.xml
After I do that what then
Look in target folder
(double click control and type mvn clean package)
And if this doesn't work I cant help much anymore since I'm on phone and I don't use maven
Make sure you're copying the right jar to the right place
This is likely the issue then
I mean, I just have the pom.xml set up and I let it do its thing
What'd u use to see if it's the right jar
wdym
Like a decompiler?
Yes
I guess my only solution here is to copy paste the whole project on a new file?
Yes
Ok
else I don't have any other resort
awwmann
@queen saffron Sorry to tag, but you know more stuff about texture packs? Happen to know why my trident isn't rendering?
When i put my custom model in line 4, it renders fine for all tridents
No worries, Im not sure what it is about tridents but they dont seem to work all the time for some reason.
I've been struggling with it aswell
You reckon you know why?
I've been stuck for 30 minutes lol, chat ai doesn't help sadly
Uhhh honestly, not sure. But I do know that tridents are even trickier than let's say, a bow.
@queen saffron Are you 100% sure it's even possible?
Like, isn't this another thing that is impossible to do in vanilla
Yes I am, I've managed to do it before but it's weird xD
If you can, try and look up other texture packs that have custom tridents or something, that's how I learn a lot.
Well I did
All I find is stuff that override the global texture, and I got that working haha
Did you check the .jar file for mc and see how they do it?
No
Might be worth it
is there a straightforward way to set the final damage dealth for an EntityDamageEvent
i could theoretically get the ratio between the original raw and original final damage and use that to approximate the raw damage i would need to deal, i guess
but this has to be a common enough thing that there's better ways ;-;
COPILOT?
(☞ ͡° ͜ʖ ͡°)☞
just set the health of the target to health - damage you want and cancel the event?
although that may look buggy af
@drowsy briar i've already told you, next time you are out
ok chill lol
You are posting the same message in multiple channels without even looking at the topic, and you shouldnt cross-post anyways

Uh oh
It has been warning about deprecated things that'll be removed in 8.0 for like 6 versions now ;p
oh shadow finally removed it?
average dkim ignoring warnings
bruh
you have to enable smart mode
it was enabled btw
oh
i couldn't get it to work so i just opened up webstorm
fleet bad
true!
@half harness About yesterday and the maven file not installing..? Well, I was wrong, it was installing properly I just changed the function and it already was most optimized hence changing it made the jd-gui decompile it as the optimized way I had it before, if you get what I mean
Uhm what's better, to make several classes for x types, or have one single Enum type with one class only? (For context, I have several enum types, with one class that has a map with Enum as key, but mongodb doesn't accept Enum so, I have to choose)
I mean, an enum constant is represented as a string, nothing special
Uh welp, should probably mention I am using a en2do (entity-to-document) framework
apparently they handle it a bit differently?
was just finding a quick alternative
then it is a bad framework if it can't (de)serialize enums
Also, speaking about the generic type Enum
it supports normal enums
just not the generic type Enum
and apparently that's a mongo thing too
generic type?
wtf
no
those are primitives (maybe)
generic is Something<T> => T
They aren't concrete
welp
int, char, boolean, etc are primitives
Integer is something else though
why are you using that anyways
Allows to have multiple types of Enums as key in a map
Could they
well, look into making your own type adapter for enums
smh like {value: VALUE, type: EnumType}
yeah
it probably doesn't allow Enum<> because it needs to know the type so it can get the constant when the object is deserialized
oh yeah understood
so your suggestion is making an interface and implement it on every enum?
and use that?
Why?
yeah thats what i thought
Cause I am trying to organize my enums instead of having everything in a single one
Aka Material, Info, Stat, etc.
Those technically are stored the same way
but to avoid having to make a class with a map, etc for each type
I wanted to make a single one for only one type
I'm still ocnfused about what you're trying to do, can you post your code?
Uh kinda hard rn, since it's not the same anymore since I am doing some testing. But basically, I have several enum classes, each represent a type of data of an item, in this case Material, Information, Statistic, etc. Then I have this class called ItemProperties, which has a map that is supposed to hold the type and value of that type. And to prevent the need to have a clone of this class for each type, I tried using Enum as the key of that type, since it would accept any of the enums if that makes sense?
Essentially making a wrapper for it
Are you taking about the Bukkit Material enum?
no, totally unrelated to minecraft, this is for a discord bot
it's a type of wiki for games, and those items are items in a game
Materials are the materials needed to craft that item
Do you have each material as an enum? You haven't learn anything from bukkit? XD
it's like 10 materials sooo
doesn't really matter
uhm is it normal for when mongodb stores an object, it only displays if it's empty or not in the collection?
i don't know
i don't know
💀
i need help
There is no time to wait! Ask your question @tiny vault!
There is no time to wait!
how can I force gradle to redownload dependency?
I have
implementation ('com.github.M0diis:M0-PLLib:dev')
when I push the code to the remote, it automatically builds and uploads the artifact to the releases with the same dev tag.
unfortunately if I refresh the gradle it still shows me the old code of the dependency.
If I have a class in my project like a Team class which will hold various variables (e.g. The players in the Team, the color etc.) and I want to have each team saved in a Database (Doesn't matter (files,mysql anything)) and then when the plugin runs I'll have a TeamManager that checks through and lists all the Teams. How should I go about changing the values in the database? Should I implement the code in the functions of the getters and setters of the Team class or should there be like another class?
I think you can try to delete the library from the .m2 cache
The Team class should not be responsible of writing/reading from database
by default it's in C:\Users\<name>\.m2?
What I've done is I've made some extra methods in the TeamManager that reads when the plugin starts but also writes with something like addPlayer(Team team, Player player) is that fine?
yes
ah, ok, I moved it elsewhere lol
gradle --refresh-dependencies
I thought libraries still end there
nope
but yeah, there's also gradle cache 😵
Edit: C:\Users\<user>\.gradle\caches\modules-2\files-2.1
Is what I've done good practice?
do I just
rm -rf $HOME/.gradle/caches 🥴
yes
show some code
it's fine just to yeet it the fuck out, right? it will just take extra long time to redownload everything again?
yes
sheesh
public void createNewGuild(String guildName, String owner){
Guild guild = new Guild(guildName, owner);
try {
conf.set(PATH + guild.getGuildName() + ".owner", owner);
conf.set(PATH + guild.getGuildName() + ".officers", guild.getOfficers());
conf.set(PATH + guild.getGuildName() + ".members", guild.getMembers());
conf.set(PATH + guild.getGuildName() + ".gems", guild.getGems());
conf.set(PATH + guild.getGuildName() + ".upgrades.coin_mult", guild.getUpgrades().getCoinMult());
conf.set(PATH + guild.getGuildName() + ".upgrades.gem_mult", guild.getUpgrades().getGemMult());
conf.save(main.getGuildFileManager().getFile());
guilds.add(guild);
} catch (IOException e) {
e.printStackTrace();
}
}
Here's a createNewGuild method
uh
looks fine ig
could extract out the repetitition with a configurationsection but thats a fairly minor gripe
Make a custom configuration class with a configuration builder 🤓
dont use the bukkit config system 😁
I'm just wondering if for example I get to make like 15 different upgrades should I try looping or should I do one by one like I've done here? Because I haven't thought through how I'll know which is which and stuff.
conf.set(PATH + guild.getGuildName() + ".upgrades.gem_mult", guild.getUpgrades().getGemMult());```
Here I fetch the 'Upgrades'
I have 2 Upgrades atm
a Coin multiplier and a gem mult
if you're repeating something 15 times then that is almost certainly an indication of wanting a loop
Also, I'd like to ask, if many people have created their guilds and I decide to add a new Upgrade on the new Version, should write code that loops through the whole file and adds the extra value on each guild?
probably
ty crazyauctions for making me do a 4 hour rollback on my server 🙏
rofl
never using their shit again 😴
best designed spigot plugin
been using it for a while now, everything seemed fine for the most part
I suppose it's time to write my own auction plugin 😴
Is there a way to minimize code complexity when making Commands?
there's always a way
I always have like 50 different ifs
For each different purpose
The player is not online, The player is having pizza, The player has blocked you I dont know
extract the repeating if logic to other validation methods if u wish
It's just if you don't have each seperate and have a method for all 3 for example, you won't be able to return 3 different values
unless you make a method that returns a String
they've actually rewritten the plugin afaik
well, you can make it a boolean and if the validation method returns false for ex. you return in the onCommand logic
or, as you said, you can return a string as a error message, if it's not null, then send and return
possibilities are endless(ish)
but yeah, I don't suggest them :X I've personally couldn't find a GOOD auction plugin
any recommendations?
I've had memory issues with the second, and the author was inactive at that time iirc
really cba to write my own ah plugin 😩
yeah I feel you xD I wanted to, but it was so time consuming
but that's the way to go on long term tbh
that is true indeed
I've rewritten most of the plugins we use by myself
no need to rely on other devs updating it or waiting to fix a bug
I'm not the type to say "custom means better every time", but this is the case for AH imo
delusionalauctions v1.0
corrrect
or you install an IJ extension https://plugins.jetbrains.com/plugin/4509-statistic
sheesh
uh, what's the name again for this thing in IJ?
Edit: found it https://plugins.jetbrains.com/plugin/18824-codeglance-pro
been using it for a while now, lifesaver for scrolling
do you know how to make it stop highlight with yellow things that are not used
not used & IJ suggestions actually
ah nvm, I see where it gets that from, IJ does the same thing but on the side of the file
good, good
but nothing here
I want to take my eyes off 🫢
spark vs essentials tps, what gives?
My NameTags are interfering with the Sidebar Scoreboard. Any ideas?
Nvm I just did player.getScoreboard() instead
essentials just uses the one provided by the api, and spark calculates it afaik

wtf is that, jdk / paper??
It's a project, actually I should check Kotlin, it's probably an insane amount
Takes too long I give up
wdym a project
and, my bad, for a second I thought that's files not lines of code, I forgot that's what M0dii asked for 😬
Does anyone know if it is possible to copy the value of a static field in IJ? I have some fields that are composed by two other constants, and I need the final value to test something
The constant looks like this, and I would like to copy the final value (the one after =)
wdym by copy, where are you copying it to o.o
On clipboard, sorry if I wasn't clear
i see
there's this "Copy / Paste Special" menu, but it doesn't have what I need 😦
if you just need the value to test something you can make a quick and dirty main and print the final value >:)
xD I can just navigate to the other constants and copy their value, I just need smth quick xD
Scratch file?
hm?
Quickest way imo
maybe you can find an extension which does what you want
talking about copy, this is smth I wanted for so long and idk why is not included by default https://plugins.jetbrains.com/plugin/17756-copy-git-link
?
-.- how
alt + enter
O M F G
that's the most obvious place where a settings like this would be p.p thanks em
lol np
I just opened this plugin after a two month break, and the build.gradle is broken for some reason
damn. that's crazy
The weird thing is that I haven't touched it
It can be because of cache
oh should I invalidate cache?
it looks like it is searching on my machine for the jar, but can't find it so its failing
can I force it to download it?
Are you using intellij?
make sure offline mode is not enabled
well actually, offline mode is not limited to intellij but I only know how to enable/disable there
gradle shadowJar --refresh-dependencies
this should force it to try fetching dependencies again
Thank you
Can also right click the project on the gradle tab and refresh it there
Removing caches didnt work. Any more ideas?
Regarding this issue
Or could this be an IDE thing? Should I Invalidate caches on IJ Idea?
Though it's still pretty annoying if it did work. I want the jar to be updated locally each time the release is updated on the remote by the dev tag.
I tried this, and i'm still getting the error. Its not searching on my machine, but it can't find it at the repo either
not sure why..
when I go to the link it says 404 - Repository with ID="central" not found
is mavencentral not a thing?
mavenCentral()
i mean i have that in there
look, I'm a web dev now
wow
sorry to hear that
that
pro tip: don't use create react app, use vite instead
i do think cra's default screen is very pretty though
here's a guide on why and a way to migrate
Thanks for the tip, Star, I will check this out tomorrow
I don't enjoy anything that requires a design either 
use sveltekit with astro
well you'd use either sveltekit or astro
or you could use just plain svelte with astro if you wanted
how could I delete a plugin .jar file on server exit?
deleteOnExit works fine on my VPS except that on my PC, LuckPerms doesn't want to delete 💀
other plugins work fine
is there some other thing I can do?
or is deleteOnExit the best there is
sounds like a permission issue
sounds like a skill issue
wdym?
sounds like it doesn't have permission to delete that file
epic windows moment i'm guessing
how do I give it permission? 🥲
the thing is, it works with many other plugins
just not with luckperms 🤔
Could be the handshake to make sure the bot is connected.
probably this
or something related
hmm okay, ty, was just curious on what it was
pov: you don't understand the scale of the ptero graphs
Well, I don't have the slightest idea of English so I don't know how this issue of the discord channels with the gringos is going
let me be me
#bot-commands for bot convos
What do you think a reasonable world border size would be for 20+ players?
10
12
More than that
why
At least 2
prob 3
Well, hot take, but ever considered 1?
prob 10-20k, id say 16383
-42
7 >
source?
gotta be honest idk how to use github properly
smh
if u cba learning git just download gh desktop
yeah its sitting in my desktop right now
imma learn github after c# lol
make constraintType an enum
example usage: include events to listen on
also usage of determining which even type was triggered
gonna make it in a moment
recaf doesnt allow me to add source files so i have to make a workaround myself
anyway the commits are in simplepluginmanager, abstract events(playerevent, worldevent, etc), registeredlistener, timedregisteredlistener, javapluginloader
just these classes
yeah i was testing out recaf for fun lmao
thats the reason why i made this project in the first place
what's recaf
https://github.com/Col-E/Recaf
edit jars as easy as slicing butters
deals with bytecode directly you dont even have to resolve dependencies yourself
oh that's pretty cool
like the best java tool i have seen in a while
you should def learn git early though
it's very doable to learn it alongside a new language
think so, git is very powerful and i should be able to play with it when i do trash projects
chances are I might like typescript after I get over all the JS bullshit (dependency management, config files and whatever else) - this syntax is so similar to java ❤️
typescript is bullshit-free version of javascript
or i personally call it c#script (peculiarly similar to c#)
no more dynamic typing they track all the type comparisons for you
I don't know about C#, but yeah, looks nice
if you really wanna know the details of how i started working on this tho
implement handlerlists and their getters in all abstract superclasses of events (playerevent,worldevent, etc)
rewrite annotations in eventhandler, and add annotations parameters in registeredlisteners,
override firevent methods by making the firevent method call events in registered listeners in handlerlists of abstract events too
im hoping to turn this into an nms spigot like with all the abilities to easily mess with nms packets, worlds and internal methods idk
just as a test project of some sort
why 1.8.4 and why spigot though
i like og mc and paper is hard to mod using recaf 
gonna mod other jar and server versions later
just for fun, for now
"og mc"
lmao
and using recaf for something like that is absolutely cursed
@cinder flare since I can't find this anywhere I'm gonna ask you xD Does vite or cra influence how the code is written? Like, do you need to use a special format for each of them or they handle only the dev environment and compilation?
and using recaf for something like that is absolutely cursed
like yall just pull out the source files and resolve all the dependencies yourself? with the manifest?
is this question related to spigot or what I'm asking?
no they just bundle, CRA uses Webpack whereas Vite uses Vite
CRA uses like Babel and tsc and Webpack, Vite just has all those things built in, plus nice code splitting + HMR
ah, that's great then
a fun way to ease yourself into thinking about this is, if you follow I think either the React tutorial or the Next.js tutorial, it has you build a React app from scratch just using a plain .html file
then you add Babel and React and react-dom and it starts to work
i just invoke the methods without using babel
what lol
Thank you star
ofc ofc, I'm really just starting to get super into React and stuff but I have stumbled my way through figuring that shit out lol
i've had a few attempts to learn front-end but I never succeeded 🤣
front end is a pain in the ass
i'm really starting to like it honestly lol
the React model of thinking about things is kinda good
and components just make building UIs really damn nice
All the paper forks are able to deal with that stuff easily
Use fabric
randomly found this in the server root folder, any idea wtf is this?
not sure what the server owner was doing lmao
well thats most likely a virus
yeah
if you use docker I guess you are fine with just reinstalling the things from that server
otherwise 😬 reinstall everything
look more like a prank for me
idk better safe than sorry
please send to me in dm
you can literally see it
oh yeah i forgot about that!
i am having an excellent time with it
only problem being that JetBrains applications are written in Java which doesn't yet have support for Wayland natively, so there's some really fucking ugly window decorations around it
but hey, they might be fixing it in Java 21 😉
only 8 more months to go
the ip doesn't work though
@wind patio please upload stdio script in DM
we need to run a malware test against it
ghidra and ida pro or recaf is ready
probably <command to gzip everything>
we are fully armed and are preparing for any inbound attacks
seems like the script was never ran, no stdio in tmp lol
yeah well the closest thing I found was this
and the flag (the person who reported) matches my country lol
wrong channel
and is not the first time I tell you this channel is not for plugin support
sorry
I'm new around here, it will take time to learn the rules 😦
that guy must hate weebs so much
to have every script of his called weebs or sth like that
update: this shit is very cool, I got the Windows fonts and everything so it's looking really good, if not for that stupid ass window decoration I can't seem to change in any way, shape, or form
so close to just being the perfect machine, Windows for games and Linux fully for development
Why run jetbrains in wsl
so it can access the native wsl filesystem and use LF endings and run git quickly and install dependencies in linux versions instead of windows etc, etc, etc,
it is quite slow accessing stuff from WSL in Windows IJ
so that I can run Linux and get all the things I actually want like wheels
so that I don't have to restart and use a desktop environment I don't like very much
I see
like we're so close
it's literally just the window decorations
i do have Fedora on a dual boot, but swapping and setting up all my shit and everything is a real pain in the ass yk
I've been using dual boot for ages and it's awesome, sometimes fedora or manjaro and i dev there and game on windows
yeah i've been getting away with some light development by storing the files in WSL, running like npm in WSL, then editing with the VSC remote extension
And it only takes a few seconds to reboot so that's a disadvantage i can cope with
if the IJ remote explorer thing was actually like, good, I would quite like it lol
a few seconds?!
do you have fast boot on or something lol
i live in fear of filesystem corruption from that shit
well that's what fast boot does
Nope
it saves shit to the hard drive in an incomplete state so that it can just resume it instantly upon startup
Don't have fastboot enablrd
makes accessing it from another computer very dangerous
huh
how many seconds is a few
like 60?
or like 4
Like 10
it takes 10 seconds from when you click restart in Windows to when you are in your desktop environment in linux?
Windows takes longer, but linux to windows about 10-15 seconds until I'm in log in
But im not 101% sure
damn
yeah still just the whole context switch and like having to reopen and resume all my apps and stuff is a major downer for me
and stuff like discord streaming not working (at least in Wayland w/ an nvidia gpu for me) is a huge deal breaker
But i agree, it sucks sometimes
okay guys september 20ish and they might add native support for wayland
then i also gotta wait for jetbrains to update their jdk used to the latest... and fix their actual window decorations...
man being on the bleeding edge really sucks sometimes
you can use webcord
it's just discord
but it has wayland support
The only thing I am aware of it not supporting is push to talk
Oh that's pretty cool, no push to talk is kinda bizarre lol

