#development
1 messages · Page 53 of 1
ask the plugin dev is devolopment section look at the resource spigot page
MySQL can run more than 50,000 simple queries per second on commodity server hardware
according to google 🤷
🙏
yes I did not intend to turn to the yaml/json,
At first I was just thinking of doing it this way:
when something needs to be changed -> sql query
but for perfs it's not terrible, what was suggested to me,
create a hashmap which the uid (key) and in value an instance of a class which contains the equivalent of the columns,
then at the start of the server I transfer the database into my hashmap, and all my modifications I make them inside this one, then every 5 minutes I save the hashmap in the database.yes I did not intend to turn to the yaml/json,
At first I was just thinking of doing it this way:
when something needs to be changed -> sql query
but for perfs it's not terrible, what was suggested to me,
create a hashmap which the uid (key) and in value an instance of a class which contains the equivalent of the columns,
then at the start of the server I transfer the database into my hashmap, and all my modifications I make them inside this one, then every 5 minutes I save the hashmap in the database.
whhhat is the best?
ah i can use cafeine else
sounds good
but saving might cause lag spike
is it possible to save using another thread?
If you mean save to a database, all database ops should be done off the main thread
database and IO ops
Mhm
good so I cache memory with coffe, I add the player when he connects, but saving the cache may be laggy?
well actually 🤓☝️
Shut up, it is fast
even if it's fast it will always be better to go through the cache no?
instead of what?
directly from requests
So I'm using reflection to get methods and because of mojangs obfuscation I can't just get method by name and return type.
So I made a method ```java
public Method getByParameters(String name, Class<?> returnType, Class<?>...parameterTypes);
The trouble I am having is I use `Arrays.equals(parameterTypes, method.getParameterTypes())` but if the parameter type is `t` or `Object` it fails.
Is there a method in java I can use to test for that or should I just make another loop for parameters?
Examples of why parameterTypes have to be checked.
DataWatcher (1.8)
```public <T> void a(int i, T t0)
public boolean a()
public static void a(List<WatchableObject> list, PacketDataSerializer packetdataserializer)
public void a(PacketDataSerializer packetdataserializer)
private static void a(PacketDataSerializer packetdataserializer, WatchableObject datawatcher_watchableobject)```
How are you calling getByParameters
... Don't think you read the question.
So you dont want it to work you just want to check if it doesnt work?
... ?
If a methods parameterTypes contains t or Object Ex; [int, int, Object]
the passed parameterTypes will always be false. Ex; [int, int, Dog]
I want to know if there is already a method that checks parameterTypes or if I should loop through them myself.
Why would there be a method specifically for checking if any of the parameters are Object or a TypeVariable lmao
And ofc what are you expecting?
I don't think you're understanding the question...
I'm currently using Arrays.equals() to check of both arrays are equal to each other...
If the method parameterTypes contains Object nothing will match unless I specifically specify Object in the passed parameterTypes.
I'm asking if there is an already made method that matches Object to anything while also matching the arrays.
So far I'm leaning on just making another loop to do this myself but would prefer a cleaner option.
if the parameter types contain Object.class you want nothing to match or nothing is matching?
also you can't check for type variables using the Method.getParameterTypes() method
... idk how else to explain at this point lol
Please just reread the initial message. I'm probably just gonna make my own loop.
you want a method that is like Arrays.equals but if a parameter's type is a type variable or Object.class you want it to fail?
thats literally what you said
ignore me switching accs in the middle of this
lol
also good job yapper!!
also i found a method
its on Class[] and its called equalsAndNoObjectOrTypeVariables(Class<?>[])
it can detect if the class implements TypeVariable
It should pass.
if the parameter type is t or Object it fails.
It does fail... but if you read the question I want a method that won't fail
if you notice here I was asking what's called a "clarifying question". I wanted to know if the issue was that it wasn't matching or if the issue was that you wanted to make it not match.
Do you understand the initial question? I think sparky is finally catching on.
5 messages above.
im talking about this question which you didnt answer and said i didnt understand
Not necessarily
I know why it doesn't work... they aren't equal lol. Hence why I asked if there was already a method or if I should make my own.
let me ask you a question
how are you going to check if one of the parameters is a type variable
if your using getParameterTypes
I'm not on pc so can't check what it would return. Gonna assume it would just be object or class.
and then how are you going to put the type variable in the getByParameters method
it returns a Class<?>[]
sigh I'll explain it better when I get back on pc.
smacks you on the face you fool
you also havent answered this
cuz assuming the method does what you said it should work completely fine if the method is generic or has an Object parameter
why are you cooking the man
im also confused as to why getByParameters is needed when its pretty much the exact same as Class.getMethod
also am i a genius or how did this work
public Method findMethod(Class<?> declaringClass, String name, Class<?> returnType, Class<?>... parameterTypes) {
for (Method method : declaringClass.getMethods()) {
if (method.getName().equals(name) && method.getReturnType().equals(returnType) && Arrays.equals(method.getParameterTypes(), parameterTypes)) {
return method;
}
}
return null;
}
public <T> void method1(T t) {}
public void method2(Object o) {}
findMethod(AwesomeClass.class, "method1", void.class, Object.class);
findMethod(AwesomeClass.class, "method2", void.class, Object.class);
private void getMethodByParameterTypes(Class<?> location, String name, Class<?> type, Class<?>...parameterTypes) {
method = Stream.of(location.getDeclaredMethods())
.filter(method -> name.equals(method.getName())
&& (type == null || (type != null && !method.getReturnType().equals(type)))
&& (Arrays.equals(parameterTypes, method.getParameterTypes())))
.findFirst().orElse(null);
if(method == null) {
methodLoop: for(Method m : location.getDeclaredMethods()) {
m.setAccessible(true);
if(!m.getName().equals(name))
continue;
if(type != null && !m.getReturnType().equals(type))
continue;
if(parameterTypes.length != m.getParameterTypes().length)
continue;
Class<?>[] methodParams = m.getParameterTypes();
for(int i = 0; i < methodParams.length; i++) {
if(methodParams[i] instanceof Object)
continue;
if(!methodParams[i].equals(parameterTypes[i]))
continue methodLoop;
}
method = m;
}
}
}
```Went ahead and just made my own.
1.8 and 1.16.5 working. Gotta do a bit more to get to 1.20 and versions in between.
if (methodParams instancrof Object) 💀
6-7 years yeah?
Surely in ur 6-7 years you wouldve also heard of Objects.equals()
Also all those &&s can be changed into chained filter calls
And heard of enhanced for?
Also ur not reusing the arrays returned by getParameterTypes
Theres also a method for doing getParaneterTypes().length that doesnt require any array allocations
I love watching the blocked messages counter go up xD
ok 6-7 years
how i can check external placeholder output like
if (placeholder.equals("1") {
return "asd";
}
if (placeholder.equals("2") {
return "dsa";
}
External? Do you mean PlaceholderAPI?
Bumping your question won't get it answered any faster.
What do you mean "external"
another plugin, it uses placeholderapi
In IDE it says this is OK Command entrycmd = (Command) entry.getKey(); but when I compile and run I get casting error
Need more info
Hey, maybe a random question.. but has someone here experience with php/laravel?
Got a short question
randomly casting is basically always a bad idea
That too yeah
» Give the helpers some details
» Ask suitable questions
» Be polite
» Wait
ok a good place to readup on understanding casting a command
Give the helpers some details
We have no clue what you're trying to do right now
I'm trying to check if a player has a perm to allow a sub command to be added to a list for tab completion
public static function addFavorite($user, $flight): bool{
if (Favorite::where('flight_id', $flight->id)->where("user_email", $user->email)->first()){
return false;
}else{
Favorite::updateOrInsert([
'user_email' => $user->email,
'flight_id' => $flight->id
], [
'user_email' => $user->email,
'flight_id' => $flight->id,
'flight_number' => $flight->flightNumber,
'airport_departure' => $flight->flightLegs[0]->departureInformation->airport->nameLangTranl,
'airport_arrival' => $flight->flightLegs[0]->arrivalInformation->airport->nameLangTranl,
'date_departure' => $flight->flightScheduleDate,
'country_departure' => $flight->flightLegs[0]->departureInformation->airport->city->country->nameLangTranl,
'country_arrival' => $flight->flightLegs[0]->arrivalInformation->airport->city->country->nameLangTranl,
]);
return true;
}
}```
Whats wrong on these lines?
```php
'airport_departure' => $flight->flightLegs[0]->departureInformation->airport->nameLangTranl,
'airport_arrival' => $flight->flightLegs[0]->arrivalInformation->airport->nameLangTranl,```
An example of the JSON output it reads:
https://hastebin.com/share/nugacotila.php
Don't mind the code if it is that bad, bit new
Show more code
Ex we have no idea what entry is
why do you have decompiled code there
just relealised entry is determined in oncommand section https://paste.helpch.at/iwibaqejuk.java
I think you'll just want to ask the question.
well I'm blind as fuck
sorry about that
Hahaha no problem man
But solved the problem with chat gpt
didn't know that you could do that
awesome thing
BossBar bossbar = null;
for (@NotNull Iterator<KeyedBossBar> it = Bukkit.getBossBars(); it.hasNext(); ) {
BossBar bossBar = it.next();
Bukkit.getLogger().info(bossBar.getTitle());
if (bossBar.getPlayers().contains(target)){
bossbar = bossBar;
}
}
Whenever i try to run it, bossbar is null, and the bossbar in the iterations title is also null
can someone help please
why dont you just check the permission again?
theres no need to do casting or anything like that, legit just a simple Player#hasPermission(String)
@EventHandler(priority = EventPriority.HIGH)
public void onInteract(PlayerInteractEvent e) {
if(e.getAction() == Action.LEFT_CLICK_BLOCK && e.getClickedBlock().getType().toString().contains("SIGN")) {
if(chestShopMethods.hasChest(e.getClickedBlock())) {
Chest chest = (Chest) e.getClickedBlock().getRelative(0, -1, 0).getState();
HashMap<Integer, ItemStack> returnedItems = chest.getBlockInventory().addItem(new ItemStack(signMaterial, amount));
if (targetOnline != null && chainArray.contains("S")) {
if (p.getInventory().containsAtLeast(new ItemStack(signMaterial), amount)) {
for(ItemStack items : returnedItems.values()) {
if(returnedItems != null) {
p.sendMessage("Map contains Amount:" + items.getAmount());
p.sendMessage("Map contains Material: " + items.getType());
double rest = (amount - items.getAmount()) * unitPrice;
ItemStack removed = new ItemStack(signMaterial, amount - items.getAmount());
chest.getBlockInventory().addItem(removed);
p.getInventory().removeItem(removed);
p.sendMessage("Du erhälst: " + rest);
}
}
p.sendMessage("Hast alles verkauft!");
p.getInventory().removeItem(new ItemStack(signMaterial, amount));
chest.getBlockInventory().addItem(new ItemStack(signMaterial, amount));
} else
p.sendMessage("Hats nicht genug zum Verkauf!");
}
}
}
}
}
I am creating a chestShop and now I want to create the sell section. So if the chest of the shop is full or can't fit the whole amount, the player sells the left free amount. However , even if the inventory of the shop is full, it still removes the items from the seller's (Player) inventory...
Here are my variables :
String input = ChatColor.stripColor(s.getLine(0));
String output = input.substring(input.indexOf('[') +1, input.indexOf(']'));
Player p = e.getPlayer();
Player targetOnline = Bukkit.getPlayer(output);
OfflinePlayer targetOffline = Bukkit.getOfflinePlayer(output);
Material signMaterial = Material.matchMaterial(ChatColor.stripColor(s.getLine(1)));
String[] chain = s.getLine(3).split(" ");
List<String> chainArray = Arrays.asList(chain);
int amount = Integer.parseInt(s.getLine(2));
double costs = Double.parseDouble(chainArray.get(chainArray.indexOf("S") +1));
double unitPrice = costs / amount;
@proud pebblenot sure how to do that within the loop of tabcompletetion
this works for first arg but breaks the 2nd arg tabcompletion https://paste.helpch.at/ixeqomozeb.csharp
if (args.length == 2 && args[0].equalsIgnoreCase("add") && sender.hasPermission("autorank.add")) {
commands.add("...");
}
only issue with that method really is the constant repeating yourself for each argument length
something id do is go look at another plugin's source and see how they handled multiple arguments autocompletion
what I have works, just don't filter out if player don't have perm
im still so glad i made my own shitty command lib
making it yourself is just super nice for if you want to change things later
i think alot of people will eventually make their own handling of commands eventually because the way i just described is actually quite annoying and repetitive
hence the reason I have been trying to make it work inside a loop
im just happy cause even though its almost definitely not the best it just works
and for like 2 plugins in a row it made things 10x more convenient
personally highly recommend making your own bad command lib
why a bad one? can I make a good one?
even if it's not the "optimal" way to do it
you can
but at least make a bad one
imo
if you want to make a good one go ahead though
also how do you suggest tab completion of any number?
Heloo I want to fake the item a player is currently holding and thus, want to send the WrapperPlayServerSetSlot packet, although I have no idea what windowID or stateID is
pls help thx
the current one I use has a tab completion for numbers
best i can think of is a list of numbers premade then just use that
for example in vanilla when putting the number for amplifier when doing the potion effect command
does that even tab complete
i believe so
im not sure if it does i might be dumb though
ill quickly boot up a 1.19 client and send a screenshot of what i mean
BossBar bossbar = null;
for (@NotNull Iterator<KeyedBossBar> it = Bukkit.getBossBars(); it.hasNext(); ) {
BossBar bossBar = it.next();
Bukkit.getLogger().info(bossBar.getTitle());
if (bossBar.getPlayers().contains(target)){
bossbar = bossBar;
}
}
Whenever i try to run it, bossbar is null, and the bossbar in the iterations title is also null
can someone help please
okie
have you checked if the iterator itself is empty?
im confused
i'm trying to identify a bossbar
it.hasNext() will be false if it's empty
why would it be empty at all?
if theres no more bossbars
cause the bossbar exists
but then the code in the loop wouldnt run
ok it seems like it doesnt actually autofill the number but it has the [<seconds>] thing
the for loop runs but returns empty
it sets bossbar to null again
and then the error is on the line where i try to set the bossbars progress
it says it's null
is it printing out the bossbar title
where are you getting "target" from
do
Bukkit.getLogger().info(bossBar.getPlayers().contains(target));
before the if check
i'm using bukkit.getplayer(string)
are you sure that player with that name exists then
this gives me an error
yes
cause it gets the scoreboard
it'd cause an error at the scoreboard if the player didn't exist
wha
here's the full script
Player target = Bukkit.getPlayer(args[0]);
Scoreboard scoreboard = target.getScoreboard();
Objective objective = scoreboard.getObjective(target.getUniqueId().toString());
BossBar bossbar = null;
for (@NotNull Iterator<KeyedBossBar> it = Bukkit.getBossBars(); it.hasNext(); ) {
BossBar bossBar = it.next();
Bukkit.getLogger().info(bossBar.getTitle());
Bukkit.getLogger().info(bossBar.getPlayers().contains(target));
if (bossBar.getPlayers().contains(target)){
bossbar = bossBar;
}
}
double number = Double.parseDouble(args[1]) / 100;
File userdata = new File("plugins/BloodBar/UserData/"+target.getUniqueId()+".yml");
FileConfiguration userdataconfig = YamlConfiguration.loadConfiguration(userdata);
bossbar.setProgress(number);
objective.getScore("Blood: "+ userdataconfig.getInt("BloodAmount")+"/"+userdataconfig.getInt("BloodMax")).resetScore();
objective.getScore(ChatColor.RED + "Blood: "+number+"/100");
ah okay
where are you getting args[0] from?
it's a command
here's a screenshot for readbility
nvm i can't send
screenshots
if its from a command then send the whole command class?
also paste.helpch.at exists aswell
also i tried this
and it returned null
which bit returned null
the snippet of code you sent
yes but which bit
the logger just said null idk
post the full error?
one sec
Cannot invoke "org.bukkit.boss.BossBar.setProgress(double)" because "bossbar" is null
idk what it's called but it requires using brigadier commands - you can't do it in spigot api
example libraries that support this feature:
- https://github.com/lucko/commodore (tab completion)
- https://github.com/JorelAli/CommandAPI (full command api)
it's basically just the param name
ooh interesting
Does MiniMessageAPI support 1.8.9 to 1.20?
yes
Does the addItem Method also return a hashmap of the not added Items, when every Item could be stored inside of an Inventory?
it attempts to add all of the items
so the map would be empty
ok, but there would be the value ItemStack(Material, 0) ?
ah, no it wouldn't
shit
Because I am trying to do a chestShop and I've also got the option to sell stuff. If the chest is full, the player won't be able to sell items. If there's a rest of space, then it sells the rest of the items
for (ItemStack items : returnedItems.values()) {
int rest = amount - items.getAmount();
double difference = unitPrice * rest;
ItemStack restItem = new ItemStack(signMaterial, rest);
chest.getBlockInventory().addItem(restItem);
p.getInventory().removeItem(restItem);
p.sendMessage("Du erhälst: " + difference + " für das Verkaufen von " + rest + " " + signMaterial);
}
}
Variables:
Sign s = (Sign) e.getClickedBlock().getState();
String input = ChatColor.stripColor(s.getLine(0));
String output = input.substring(input.indexOf('[') +1, input.indexOf(']'));
Player p = e.getPlayer();
Player targetOnline = Bukkit.getPlayer(output);
OfflinePlayer targetOffline = Bukkit.getOfflinePlayer(output);
Material signMaterial = Material.matchMaterial(ChatColor.stripColor(s.getLine(1)));
String[] chain = s.getLine(3).split(" ");
List<String> chainArray = Arrays.asList(chain);
int amount = Integer.parseInt(s.getLine(2));
That's my code
wdym
oh
Oops, forgot some:
double unitPrice = costs / amount;
Chest chest = (Chest) e.getClickedBlock().getRelative(0, -1, 0).getState();
HashMap<Integer, ItemStack> returnedItems = chest.getBlockInventory().addItem(new ItemStack(signMaterial, amount));
No, depends if there's space inside of the chest. If the chest is empty, you can sell everything. If it has space for a bit, it you can sell the items it can store and if there's no space, you won't be able to sell items at all
The chestShop does not belong to the player who wants to sell items
you can either:
A) add the returned items back into the player's inventory (safe, recommended)
B) Simulate addItem happening with "fake inventories and items" (not recommended): https://hub.spigotmc.org/stash/projects/SPIGOT/repos/craftbukkit/browse/src/main/java/org/bukkit/craftbukkit/inventory/CraftInventory.java?at=69e196f79694328abc03f36f3543ba071e56c963#263-326
if I'm understanding correctly
my problem is that it won't remove the items of the player's inventory, the rest works
This method: p.getInventory().removeItem(restItem); should remove them from the Inventory, however it won't and I don't know why
Du erhältst* btw
oops
I still don't quite understand what you're trying to do
You want it to remove items but only those that fit into the chest?
Exactl
Just add the returnedItems to the player inventory
It works only when he's not able to add all items into the inventory. If he's able to, so if the returned Items would be null, it won't remove the items from his inventory
null?
Ohh I see
you should check if it's empty
null collections are a sin
wait im so confused
Just do player.getInventory().removeItem(new ItemStack(signMaterial, amount));
and dont add/remove the returned items
I am sorry, my brain is already rotting lol. I've been stuck for several hours now.
try that please
but then it will remove all the items, even if the inventory is already full or not?
oh holdon
var lostAmount = 0;
if (!returnedItems.isEmpty()) {
lostAmount = returnedItems.values().stream().findFirst().get().getAmount();
}
player.getInventory().removeItem(new ItemStack(signMaterial, amount - lostAmount));```
@nova minnow
ok, yeah I am dumb. Thank you 😄
I've finished school, so I've basically got holidays now 
yep
well congrats!
Thank you 😄
What do you guys recommend using minimessageapi or code support for hexolors,gradients and &colors
I use codes for the basic things (like bold, or the original colors) and minimessage for the more advanced (hex, gradients etc.)
why
it's shorter
&lbold &agreen
I cant get it to work on lower versions.
define lower versions
Getting an error when i'm starting my server
^
and send that error
I can't send files in there 😦
yeah that's dumb
Easily paste your Minecraft logs to share and analyse them.
you're probably using a new version of minimessage that is not compatible with the old version of adventure in 1.16
outdated paper version
Don't
depend on 1.16.4 api
why?
you just gotta salt back then it works
really salty
@high needle
and shade adventure & minimessage etc
yeah just shade that and send via bungee components
why?
adventure is already shaded inside paper
minimessage doesn't support that version
bro never heard of spigot
that's why they're getting that error
well you need to use an older version of minimessage
So remove AdventrueAPI and just use Minimessage?
its not spigot; it's an older version of adventure
it didn't release back in 1.16.5
im 99% sure
I ran into this issue before and I checked the versions
shading a new version of adventure into an old server would probably break more things than it would fix
if you have shaded stuff you wont need to depend on different versions
no?
no?
not without relocation
oh lol
yeah but im guessing they want to release it on spigot for example
So remove AdventrueAPI and just use Minimessage?
And then i'm good to go I gues?
no - show me your pom.xml or build.gradle(.kts)
then you can not use the native Adventure paper methods
correct
which kinda sucks tbh
I paid a dev to make the plugin XD
oh
then ask them bruh
But i like to know things about it.
wait i just read your second log
you can't run this plugin in 1.8
unless you shade & relocate adventure and set (build tool) api version to 1.8
Ah okay! Yea i paid him like 90$ to make an trail plugin.
o
yeah tell him this
it's a simple fix
welll
yea
if he's already using 1.9+ api
then you should've mentioned to him that you wanted 1.8 in the beginning
but if not
then it's a simple fix
for whatever reason you want to support all versions
It's not going to be a simple fix if they're already using the native adventure methods
ah true
maybe not simple fix but not too difficult fix either
(kotlin = simple fix 😌)
well
Running a network and factions need to be on 1.8 for cannoning ect.
And Skyblocks support 1.12
nah, just reaaaly repetitive
ohhhh
why didn't your dev test on 1.8?
^
fr supporting 1.8 in 2023 is cringe
He said he already spent alot of time coding it.
yeah
okay maybe not simple, but time-consuming fix*
did you tell him in the beginning that you wanted 1.8?
1.8 to 1.20 Support.
then he should do that
Idk the best versions anymore for Skyblock, Factions, Prisons ect
since now you're paying for a plugin that doesn't even do what you asked
When I think about it, you could:
Serialize minimessage string with the shaded serializer into a shaded (relocated) component
Deserialize it back to legacy stirng with the shaded (relocated) deserializer
And then serialize the string back to the native component via the native serializer
It's via Fiverr so i'm safe if it's not what i ask for he doenst get paid and i get my money back
Kinda cursed, but it should work
no the MiniMessageImpl.<clinit> is where the error is coming from
so you can't make the instance itself
Yeah, adding things to the requirements without paying for those additions is cringe as fuck and scammy
then if you explicitly told him 1.8-1.20 at the beginning, he should've done that
And it's basicly an copy from PlayerParticles.
I just want to be able to create the Particles in a config.yml
And people should be open the GUI en select an trail
I haven't used fiverr so idk how it all works
oh
💀
I mean besides all the click/hover/etc I guess it'll work... 💀
I guess it's still better than editing all of those .sendMessage calls
And it's basicly an copy from PlayerParticles.
I just want to be able to create the Particles in a config.yml
And people should be open the GUI en select an trail
How much do you guys normally charge for this?
I don't do plugin development for money
9/10times you get scammed or paid a pittance
I just stick to the same person
yeah, you need to have upfront payments
True! I just want to know i'm not getting over charged 😛
The average™️ Java developer's salary in the us is about 50$/hr
select a trail
does PlayerParticles already have trails?
well
think about how many hours the developer put into this
first of all this kind of mc dev is different
It is, hence why I don't do it for money
Why?
Is MC plugin development easier than developing some website's backend?
I wouldn't say so.
Yep! But people are able to create them by them selfs via an gui.
I just want to be able that i'm able to create the trails via an trails.yml
And poeple can only open the gui and select the trails where they have permissions ons.
i mean sure, you can charge it, but if ppl have the ability to search, you're getting no customers
that's true
Yes it is
Well, if you think so
However, working with backend frameworks seemed way less bullshity than working with bukkit api
Not really
https://builtbybit.com/threads/advanced-plugin-development-fast-work-high-quality-plugins-very-experienced.673673/
ex this guy is extremely experienced, and he "only" charges $20/hour
which is a lot compared to how much i charge
You don’t have to worry at all about networking with plugins
I mainly meant the software part
Not the sysadmin part
The guy i'm working with is also asking 20$/hour
¯_(ツ)_/¯
That’s part of the software
Define what you mean by "worry about networking"
All the programming for it and figuring out how to implement it
._.
The Bukkit API also makes interacting with Minecraft pretty easy
in the end, it comes down to "supply and demand" or whatever it is
That is indeed true
That too
if u can find customers with 50/hr and they are happy, then thats a good price
yo same!!
People who have a 50$/hr work won't do bukkit plugins for 20$/hr
Advanced fast high qulity experienced plus ultra +++
Have some worth, charge well for your work 😤
how much do you charge? lol
varies ¯_(ツ)_/¯
average per hour
cause I charge like 20/h and I am not that experienced lol
you shouldn't devalue yourself tbh
idk
i dont go based off hourly because like for ex, if i spend an hour debugging an issue that takes a couple lines to fix, that's $20 for a couple lines
¯_(ツ)_/¯
still time you spent.
like if you made a /baltop gui, how much would you charge for that
the features being previous/next pages and each item would be player heads - nothing too special
For instance, I work for a server, like 15 hours per month, and get paid 375$ per month
👀
actually more than 20 per hour lol
probably 20 bucks
frameworks already have paginated guis
lol
exactly
I would only do the base, add proper configurations, async sorting if there is no specific api provided and voila
shouldn't be more than an hour
ah yeah i had to do async something
its been a while so i dont remember the details
not really, hard to find jobs on those areas, my portfolio isn't really the best, which is why I will be working in several projects this summer, both in and out of minecraft.
Oh I thought this so many times...
uh?
I always tell myself "Yeah, this is going to be done in a hour" Then I find out how short can an hour be
Probably a skill issue tho
I mean, estimates are hard to do, but on these small things, hard to miss, it's really not that much to do with the right tools like frameworks.
in bigger projects, yeah, I have missed estimates several times
I usually multiply my ETA by four before I tell it to someone else
But yeah, this one should be simple
x4 seems too much
if the project is already over 15 hours
4x would be 60h lol
that's quite a massive difference
in this public Map<List<String>, AutorankCommand> getRegisteredCommands() { return this.registeredCommands; } is the getRegisteredCommands part of Spigot or?
no?
You're making the method
so it can't be part of spigot
ok, just trying to understand this command manager, SO I can make changes
is there a way to add all commands to a list?
list.addAll(commands)
¯_(ツ)_/¯
thats to easy
cmdarray.addAll(commands);``` not quite liking that
it don't seem to give me the results I'm looking for, guess I will keep reading
uh
lol
thats a really simple thing to do
also 375$ for 15 hours
damn i need to apply as a dev somewhere
so what would u price it as?
using vault as dependecy?
or writing on economy
but lets say we have existing economy system
vault
ok
idk i did it before but i dont remember what i charged
lets say now + -
$10 💀
If you spend 3 hours debugging and 2 minutes fixing, do you charge practically nothing?
Time you work is time you're paid
No one will want you with your stupid attitude
yeah, this is something I sometimes switchup, I have a rule, if debugging takes more than 1 hour, I will count it
u also?
my attitude is fine
the idiots here that do xy problem or hey can u code for me for free? both of those cases should never be asked here
and telling learn java first or so (at least java basics) and they will say no im good at java and will send us AI Generated code
I can speak for literally 98% of the people in here that your attitude is everything but fine
not up to you to decide which cases should or should not be asked here
i also didnt ask for your opinion
"my attitude is fine"
so please if u go that way rude way
you are a floating joke in this server
" " < deal with ur self.
and u r a pixels guy
?
😂
why u laugh its a fact
😂
most of people here are total dogshit
😂
🐒
yes you are
¯_(ツ)_/¯
no no really why?
why is your profile picture so warped
its a random picture from gallery
but that guy put his blurry ass everywhere
😭
I'm trying to load a HashMap file like HashMap<String, Integer> from the FileConfiguration that I structured like
users:
Me:
food:
Apple: 7
Banana: 4
Watermellon: 2
I tried to get them by List<String> and then iterate through them and put them into a new HashMap (and place user's food and amount) but I having hard time to figure a clean way to do that
I haven't used bukkit's configuration for like 2 years now, but there should be something like ConfigurationSection#getKeys
So get the keys and their values and parse them with Integer.parseInt
can you show me an example how?
and why you not using configurationFile ?
I prefer configurate with HOCON
Not on a computer rn, are you in a hurry?
Hello
kinda but of course take your time
a list in bukkit config api is '-' u neeed to use cs#getkeys... and loop
u also can write custom file reader/writer cloud be easier to work with then bukkit snakeyaml shit which is full of problems anyway
But how?
for (String g : this.dataBase.getConfigurationSection("users." + u + ".food").getKeys(false)) {
}
how can I irritate through key value?
can you help?
I'm trying to have Entry<String, Intenger> and irritate through entrySet but I can't figure the right way
In the code snippet you sent you're literally doing that
oh you mean getting the values?
Just simply ConfigurationSection#get
how exactly?
var config = getConfig();
// get the section
var section = config.getConfigurationSection("users.user.food");
// Iterate over the keys and values
for (Map.Entry<String, Object> entry : section.getValues(false).entrySet()) {
var key = entry.getKey(); //Apple, Banana or smth
var value = entry.getValue(); // 1, 2 or smth
if (value instanceof Integer integer) {
// Do integer stuff
}
}
Here's one way
alternatively you could iterate over the keys and then just get their values
Is there a way to asynchronously create EntityPlayer in newer versions?
Well I would like to keep all my create and spawn code together for my NPC's. I could create sync then spawn async but wanna know before I go down that route.
var.
new EntityPlayer(M,W,G) runs World.getEntities() which throws an async error.
well then it's not safe to run it async
I know that lol.
So is there no other objects extending EntityHuman that I can create without sync?
I don't know, but generally doing anything about entities async is just a guarantee for issues of some sort
yeah. Unfortunate they added a parameter in new versions to the PacketPlayOutNamedEntitySpawn.
uh how would you check if a (paper) plugin was reloaded via /reload or reloaders like plugman?
Don't think you can. They both run onDisable()
... actually I think you can check what class ran a method
I think you can use a method from thread to see which class called the method. I'd have to dig for the code though.
what about plugman reloading?
ahh
I don't know what "also" is meant to imply, but yes I also value my own time, and so should you, as much of a novice as you are, $10 is still shit.
@worn jasper
String calledBy = Thread.currentThread().getStackTrace()[2].getClassName(); Is how I check what called the method in a few cases.
StackWalker.getInstance(StackWalker.Option.RETAIN_CLASS_REFERENCE).getCallerClass()
is way more performance-friendly
I didn't check what was posted lol
Been digging for that variable for a bit .
is it possible to get the 2nd caller?
like keep going "back in time"
you can use the stackwalker for that yes
it evaluates the stack lazily
streams stuff
ohhhh i see
where would I use this though? in what even in this case?
onDisable?
you would use that to figure out what class called the current method
hey, if I want to check if the server supports 1.20 with xmaterial
XMaterial.supports(version), the version parameter should be just 20 right?
or how does it work? it is suposed to be an int
/**
* Checks if the specified version is the same version or higher than the current server version.
*
* @param version the major version to be checked. "1." is ignored. E.g. 1.12 = 12 | 1.9 = 9
* @return true of the version is equal or higher than the current version.
* @since 2.0.0
*/
public static boolean supports(int version) {
return Data.VERSION >= version;
}```
so yeah, just 20
the day minecraft 2.0 comes out

full rewrite wouldn't be "pog" for anyone
what would have to happen to define 2.0.0
it has no api so it can't follow semver
🥲
besides the server software etc having to be changed, a rewrite would be a major W for minecraft itself.
its code sucks and is old af.
java 31 you mean
would never happen, would break so many mechanics
eg redstone
it would be a W just like the Netscape rewrite
Is there any way to run a async task using Bungee API
or just use the bungee scheduler?
I found how to do it but I now have no idea about how can I run a sync task in async task
there is no "sync" in bungee
there is no tick thread
something is sync or async with respect to some thread
what are you trying to do exactly?
I have a web server that listens for requests and when it gets one it should run ingame commands
yeah realistically you can just dispatch them from any thread, since there is no tick thread you have to run that in sync with
Does that also mean I don't have to run db operations async since everything is async :d
🥴
well
I haven't used bungee in a long time but for ex if you run a 1 second operation on player join, then the player will have to wait 1 more second to join
again, sync/async with respect to some other thread
you don't wanna be doing blocking tasks in sync with the netty threads, for example
I would be surprised if bungee didn't jump to its own thread to process packets and dispatch events
but, at the same time, I wouldn't
when in doubt, static cachedthreadpool 😌
Doesn't bungee have SQLite drivers shaded? I get No suitable driver found for error
That would be a no 
Than how can I store data in a Bungee plugin :d
🥴
You shade the driver by yourself
Imagine having to answer that 🫡
any idea why whenevr I try to generate a spigot 1.20.1 plugin my console keeps on spitting out errors? https://pastes.dev/Psi3RYaNvY
seems you're pointing to your class incorrectly in your plugin.yml
can you send the class
and the class?
there is only one class so far and it's called MobLag
Yes, you sent your plugin.yml
oh you wanted me to send the class I'm so sorry
np
open your .jar maybe with winrar or something, is the class in there?
yup
capitalization
change ur plugin.yml to MobLag
such a stupid thing to overlook lol
often is
regardless thank you 😄
fr
famous typos
lovely stuff 😂
and you just sit there mindlessly for god knows how long debugging the dumbest overlook ever...
🙃
Here, take the L
I'm gonna go crazy
in gradle, I have ```kt
plugins {
// stuff
id("io.github.dkim19375.dkim-gradle") version "1.3.4"
}
// stuff
But if I change that to version `1.3.9` (which is in mavenLocal()), it doesn't work!
This is my settings.gradle.kts: ```kt
pluginManagement {
repositories {
mavenLocal()
gradlePluginPortal()
}
}
rootProject.name = "DkimGradle"
```and the error: ```kt
A problem occurred configuring root project 'DkimGradle'.
> Could not resolve all files for configuration ':classpath'.
> Could not find me.dkim19375:DkimGradle:1.3.9.
Searched in the following locations:
- file:/C:/Users/dkim19375/.m2/repository/me/dkim19375/DkimGradle/1.3.9/DkimGradle-1.3.9.pom
- https://plugins.gradle.org/m2/me/dkim19375/DkimGradle/1.3.9/DkimGradle-1.3.9.pom
Required by:
project : > io.github.dkim19375.dkim-gradle:io.github.dkim19375.dkim-gradle.gradle.plugin:1.3.9
Possible solution:
- Declare repository providing the artifact, see the documentation at https://docs.gradle.org/current/userguide/declaring_repositories.html
Entire build.gradle.kts: https://pastes.dev/7vEnhpIIWr (latest not pushed to github)
Rest of the files: https://github.com/dkim19375/DkimGradle
where's it getting me.dkim19375.DkimGradle from?
ok I had to add ```kt
pluginManagement {
resolutionStrategy {
eachPlugin {
if (requested.id.name == "dkim-gradle") {
useModule("${requested.id.namespace}:${requested.id.name}:${requested.version}")
}
}
}
}
but why?
idk
and if I publish, then it also goes to io.github.dkim19375:dkim-gradle, but publishes to me.dkim19375:DkimGradle as well :(((((((((
https://paste.helpch.at/visukuniri.java
Whenever i try to run it, bossbar is null, and the bossbar in the iterations title is also null
can someone help please
You have two different BossBar variables, bossBar and bossbar
bossBar is the one in the iterator
i know i have 2 different variables
can you show the code that shows that the bossbars are null?
like wherever the debug or errors are
after the iteration i try to set the found bossbars progress
it says the bossbar is null
show the error
it just says bossbar is null
where?
what is "it"?
my crystal ball
also I didn't really look too closely but a couple things
- name
bossbarto likeplayerBossBarjust to prevent any errors - don't use
contains(target), because each player might have multiplePlayerinstances - instead, you can either use streams or loop through and compare the UUIDs
Thanks for the advice but it won't run
what's the error?
I'll ask here maybe someone knows:
How to get player armor points in spigot 1.8.8? (No, cannot use Player#getAttribute as thats 1.9+)
I know i'll probable need nms or something, someone?
we wont help u
armor points?
just write it bruh
no reason to make things more complicated
make an enum of amount of how much each piece is worth
??????????
they're wondering if there's an already-existing method/attribute/variable in 1.8 so that they don't have to rewrite it (also to prevent rewriting in the future)
that's the whole point of them asking - they likely already know they can just write it, but want to know if there's a built-in way too
Tony was born with this information. It is beneath them to consider questions.
Tony is our god, he knows everything 😮
he is stuck at it for too long
and theree are only 16 armor parts in game
so ;l
so?
so time > to trash?
you can just say something like "I'd recommend just making an enum of all of the armor pieces because I don't think there is a simple way"
no code provided even no stacktrace he is low life idiot certificated
maybe he's new?
Or just doesn't know how to ask questions correctly
Better to tell him "Can you show the stacktrace? We can't help without it"
not "we wont help u"
u r right i guess sorry to the guy who cant think of an enum..
can you stop talking like this
it's not helping anyone any more vs talking like how I suggested
i always help when deserved dkim
this is HelpChat; if you feel they don't deserve it, simply say nothing
when people ask correctly and nicely and provoide info and dont say its just say null
it's not DecideWhoShouldGetHelpedChat
correct
if you think they don't "deserve" it, help them deserve it
im wrong ur right but let us have free speech here please.
u asked him code or stacktrace he just man its null
what
his code is nuclear power plant schematic or something we wont see the stacktrace or the code how should we help him
okay but you just said "we wont help u"
How does that help them? In HelpChat
i help other saving time with the monkey
if you don't want to help with these questions, simply say nothing
a lot of ppl who sees questions here do not respond
because they don't know how to help with the issue
if you don't know how to help with it, just don't respond
u r right but its too hard to watch how someone beat old lady without stop him
u probably suggest to watch
i dont think so
them tell them how to stop
"beating old lady"?
what
yeah how you can tell a maniac to stop
if you don't know, don't say anything
u cant they wont understand
dont know what we asked him for code or stacktrace 3 times
then ask again 🤷
stop stop the old lady already bleeds to death
take action at right time.
please lets keep this chat for devs or who try to be and not for AI code which gives them nulls.
that's not AI code
how about keeping this chat for helping
"we wont help u" does not help
its legit begin applied to player
he probably did Player player;
that poop code printer AI
.
u r right u won im out.
Tony I haven't seen any of your code, how do we know you aren't an AI?
Bossbar foo;
//call
foo.baz //null
Save this chat for the experts 🤓
Also, holy shit this is wild to say.
Are you real?
Variable is uninitialized 🤓
Doesn't have to be, hence the null?
well it does have to be because you never assign anything to it 🤓
I don't have the mental capacity to explain to you that you do not need to initialize a variable, it will just be null.
Actually you do unless it's a field 🤓
I stg stop pinging me.
ok
what are you on
Not this guild anymore holy shit
oh i didnt mean to ping u
(he left btw, wanted to let you know since u were responding to him)
oh
I love that every support request eventually turns into a 100messages long argument with Tony
It’s always the people who know the least that argue the most
@sonic nebula stop being toxic and deviate from the dubject. Last warning.
I sent him my code you nimwit, the error is i shit you not "bossbar is null" maybe read the conversation before jumping to conclusions
Cannot invoke "org.bukkit.boss.BossBar.setProgress(double)" because "bossbar" is null
what's the stacktrace?
what?
send the whole logs
Use https://paste.helpch.at/ for errors, logs and configs. So we don't spam the discord.
In this code:
BossBar bossbar = null;
for (@NotNull Iterator<KeyedBossBar> it = Bukkit.getBossBars(); it.hasNext(); ) {
BossBar bossBar = it.next();
Bukkit.getLogger().info(bossBar.getTitle());
Bukkit.getLogger().info(String.valueOf(bossBar.getPlayers().contains(target)));
if (bossBar.getPlayers().contains(target)){
bossbar = bossBar;
}
}
The bossbar remains null
you need to find out why it hasn't been assigned
i tried to use a for loop the same way i did for looping through players
you know you can just do
for (KeyedBossBar bossBar : Bukkit.getBossBars())
and my ide suggested this instead
and it didn't compile?
oh my god
i can't believe i sparked all of this through sheer stupidity
My bad, apparently getBossBars really only returns an iterator
just peak bukkit api stupidity ig
Anyways, back to the original topic
If I had to guess, this condition is always false:
if (bossBar.getPlayers().contains(target)){
bossbar = bossBar;
}
what are you even trying to do?
I'd guess so because i tried printing the iterated bossbar's title and it just said null
I'm trying to assign every player a bossbar, but i don't know any way i can identify bossbars
so i thought to check every bossbar and check if the target player exists in that bossbar
Honestly I've never worked with bossbars before in Bukkit, so you may want to wait for someone who did. Anyways, I suggest you attach the debugger and add a breakpoint on the if condition
Still, thanks for trying to help and not calling me a monkey like the other guy
If you don't know how to attach a debugger, I suggest you consult this guide: https://www.spigotmc.org/wiki/intellij-debug-your-plugin/
I suggest you to use the method 3 there
for (KeyedBossBar bossBar : (Iterable<? extends KeyedBossBar>) Bukkit::getBossBars) { } 
How do people turn Chinese chars into image from texture pack?
I prefer to not decompile an resource .
Thanks 🙏
Like custom blocks, entities, guis, items, armors etc.
3D models and invisible mob
yeah those 2 are the best
And writing custom hit box
thanks, will bookmark them
Using modelengine is generally the best (and most sane) way to add custom animated entities
Display entities 😌
On the topic of modelengine, I'm honestly surprised the demo version isn't obfuscated
thanks to that, the demo block can be removed in a few minutes
He doesn't care iirc
based
It stops most people
that's true
Kinda sucks I think the custom armors won’t work in Dino versions
wtf are dino versions?
According to what the guide says
Custom armor is 1.17+ yeah
Below 1.7
below 1.7?
But the text magic will work 🙂
Does anyone even use that?
1.17
well honestly there's no reason to use anything older than the latest version unless you still didn't cope with the new combat mechanics
It’s not about combat mechanics
Or you didn't cope with the horrible performance of 1.13+
Any good server finds their own way around the combat mechanics
The combat mechanics are easy to rewrite
honestly the old combat mechanics was kinda boring
it just depended on who clicked faster
^
False
It was limited anyway
Because hit delay that is applied to entity once it gets hitted
But old mechanics were shit and boring it’s true
So I have a method on my plugin to check all invalid generator, this is the code https://paste.helpch.at/ixoxubanov.typescript and I'm looking the more efficient way to approach this, currently this method is running on sync task once on plugin start and it has around 15k+ active generators so it would take long time to check all invalid generator and can possibly crash the server 💀.
can you show a spark report? just so that we can see exactly where the most compute time is taking place
Couldn't get one right now, I need to restart my server but it already has players in there. My guess is that it will load the chunks of 15k+ active generators.
oh do you not have spark already?
but I'd recommend splitting it up then
into different ticks
ex 200 generators per tick
or 150 generators per tick - 5 total seconds to run
Since it's only executed once on plugin start, the percentage is lower now.
can u make a new profiler?
or do you intentionally have it on only once for a specific reason
if so then ig we can see later
That's a great idea honestly, how can I achieve something like that?
you can make a BukkitRunnable
and then runTaskTimer
and then once it's finished with all the generators, you can cancel()
but are you able to make a new profiler?
when does the invalidate code run?
On plugin start, only once.
ohhhhh
ohhh that's what you meant
I thought you meant the spark profiler is only started once
Yeah that's what I meant, so the spark profiler doesn't have the details anymore.
next time you restart the server 🥲
can you add like an /invalidate command? (for debug)
You could also test out the BukkitRunnable method
I don't have a test server right now but I tested it on my localhost, and it keeps crashing my thing so I need to delete the data
alr
I'll try the splitting up thingy.
hello is there a way to execute command like a datapack?
Is there something like DatapackCommandSender?
I have a plugin which stores stats to a database, the onPlayerJoin event is fine, it checks if the data exists if it doesnt then it inserts it otherwise it updates it, but my onPlayerQuit doesn't work, what am I doing wrong
public void onPlayerJoin(PlayerJoinEvent event) {
String playerName = event.getPlayer().getName();
PlayerData playerData = getPlayerDataFromDatabase(playerName);
double balance = VaultAPI.getEconomy().getBalance(event.getPlayer());
if (playerData != null) {
playerData.setBalance(balance);
updatePlayerDataInDatabase(playerData);
} else {
playerData = new PlayerData(playerName, balance);
playerDataMap.put(playerName, playerData);
insertPlayerDataIntoDatabase(playerData);
}
}
@EventHandler
public void onPlayerQuit(PlayerQuitEvent event) {
String playerName = event.getPlayer().getName();
PlayerData playerData = playerDataMap.get(playerName);
if (playerData != null) {
Economy economy = VaultAPI.getEconomy();
if (economy != null) {
double balance = economy.getBalance(event.getPlayer());
playerData.setBalance(balance);
updatePlayerDataInDatabase(playerData);
playerDataMap.remove(playerName);
} else {
Bukkit.getLogger().warning("Economy is null");
}
}
}```
You don't add the data in the map if it exists
if (playerData != null) {
playerData.setBalance(balance);
updatePlayerDataInDatabase(playerData);
}```
Oh, Oopsies
When I had the plugin working in game version 1.20.1, the console gave me the following warning.
My server core is paper-1.20.1-63.
[02:20:08 WARN]: java.lang.ClassNotFoundException: net.minecraft.server.v1_20_R1.MinecraftServer
[02:20:08 WARN]: at java.base/java.net.URLClassLoader.findClass(URLClassLoader.java:445)
[02:20:08 WARN]: at java.base/java.lang.ClassLoader.loadClass(ClassLoader.java:588)
[02:20:08 WARN]: at java.base/java.lang.ClassLoader.loadClass(ClassLoader.java:521)
[02:20:08 WARN]: at java.base/java.lang.Class.forName0(Native Method)
[02:20:08 WARN]: at java.base/java.lang.Class.forName(Class.java:391)
[02:20:08 WARN]: at java.base/java.lang.Class.forName(Class.java:382)
[02:20:08 WARN]: at com.extendedclip.papi.expansion.server.ServerExpansion.<init>(ServerExpansion.java:61)
[02:20:08 WARN]: at java.base/jdk.internal.reflect.DirectConstructorHandleAccessor.newInstance(DirectConstructorHandleAccessor.java:67)
[02:20:08 WARN]: at java.base/java.lang.reflect.Constructor.newInstanceWithCaller(Constructor.java:500)
[02:20:08 WARN]: at java.base/java.lang.reflect.Constructor.newInstance(Constructor.java:484)
[02:20:08 WARN]: at [占位符]PlaceholderAPI-2.11.3.jar//me.clip.placeholderapi.expansion.manager.LocalExpansionManager.createExpansionInstance(LocalExpansionManager.java:443)
[02:20:08 WARN]: at [占位符]PlaceholderAPI-2.11.3.jar//me.clip.placeholderapi.expansion.manager.LocalExpansionManager.register(LocalExpansionManager.java:173)
[02:20:08 WARN]: at java.base/java.util.stream.ReferencePipeline$3$1.accept(ReferencePipeline.java:197)
[02:20:08 WARN]: at java.base/java.util.stream.ReferencePipeline$2$1.accept(ReferencePipeline.java:179)
[02:20:08 WARN]: at java.base/java.util.ArrayList$ArrayListSpliterator.forEachRemaining(ArrayList.java:1625)
[02:20:08 WARN]: at java.base/java.util.stream.AbstractPipeline.copyInto(AbstractPipeline.java:509)
[02:20:08 WARN]: at java.base/java.util.stream.AbstractPipeline.wrapAndCopyInto(AbstractPipeline.java:499)
[02:20:08 WARN]: at java.base/java.util.stream.ReduceOps$ReduceOp.evaluateSequential(ReduceOps.java:921)
[02:20:08 WARN]: at java.base/java.util.stream.AbstractPipeline.evaluate(AbstractPipeline.java:234)
[02:20:08 WARN]: at java.base/java.util.stream.ReferencePipeline.collect(ReferencePipeline.java:682)
[02:20:08 WARN]: at [占位符]PlaceholderAPI-2.11.3.jar//me.clip.placeholderapi.expansion.manager.LocalExpansionManager.lambda$registerAll$4(LocalExpansionManager.java:356)
[02:20:08 WARN]: at [占位符]PlaceholderAPI-2.11.3.jar//me.clip.placeholderapi.util.Futures.lambda$null$0(Futures.java:46)
[02:20:08 WARN]: at org.bukkit.craftbukkit.v1_20_R1.scheduler.CraftTask.run(CraftTask.java:101)
[02:20:08 WARN]: at org.bukkit.craftbukkit.v1_20_R1.scheduler.CraftScheduler.mainThreadHeartbeat(CraftScheduler.java:480)
[02:20:08 WARN]: at net.minecraft.server.MinecraftServer.w(MinecraftServer.java:1112)
[02:20:08 WARN]: at net.minecraft.server.MinecraftServer.lambda$spin$0(MinecraftServer.java:318)
[02:20:08 WARN]: at java.base/java.lang.Thread.run(Thread.java:1623)
How can I fix the ━/\u2501 character from appearing as a question mark (in console/terminal, not MC-related)?
I tried both kt configureEach { if (this is JavaCompile) { options.encoding = "UTF-8" } } and kt withType<JavaCompile> { options.encoding = "UTF-8" } and put properties org.gradle.jvmargs=-Dfile.encoding=UTF-8 in the gradle.properties, and all my IJ stuff is set to UTF-8, but it's still showing as a question mark :/
trying to make a progress bar
thats because it would be found at net.minecraft.server.MinecraftServer
nms hasnt included the version in the paths for quite along time
then maybe the console doesn't support it?
I should've mentioned this but for some reason, if I click the play button next to the main function, it works, but not if I run gradle run
which opens in the same terminal (I think? Same window at least)
And it also doesn't work with java -jar Program.jar
what happens if you add -Dfile.encoding=UTF-8?
java -Dfile.encoding=UTF-8 -jar Program.jar?
still not working :/
build.gradle.kts: https://pastes.dev/wAnTfkbFdf
Main.java: https://pastes.dev/awcCKv33Ik
In Windows Terminal -> PowerShell 7, windows command uses characters such as █ for a loading bar
But in that same terminal, if I run ./gradlew run, and print out █, it shows up as ?
I'll try building a jar and running java -jar
edit: so those work, but not the original line from the original message
how do I fix it?
In IntelliJ, none of the characters work :(
when using gradle run
but it works when pressing the play button for some reason
no idea
Fixed - but only on my machine, I wasn't able to find out why my program wasn't outputting correctly
https://stackoverflow.com/a/57134096/14105665
Anyone know how to disable the coroutine debugger or smth?
In my jar, I have a _COROUTINE folder, with the files _BOUNDARY.class, _CREATION.class, ArtificialStackFrames.class, and CoroutineDebuggingKt.class
It seems to be coming from org.jetbrains.kotlinx:kotlinx-coroutines-core, but I cannot find any information about those files (do I relocate them? are they important at all? Just seems like debugging stuff...)
Guys how do I execute vanilla commands without outputing to console and broadcasted to ops using bukkit api?
Anyone understand what the problem is? It should just be a basic config thing, but maybe I'm missing something
public static void rewardPlayer(Player killer, Entity victim, Economy economy)
{
killRewardsConfig = Lithium.getInstance().getConfig().getConfigurationSection("kill-rewards");
String targetType = victim.getType().getName();
if(!killRewardsConfig.contains("rewards"))
{
Bukkit.getConsoleSender().sendMessage("kill-rewards.rewards : null");
return;
}
if(!killRewardsConfig.getConfigurationSection("rewards").contains(targetType)) // ERROR HERE
{
Bukkit.getConsoleSender().sendMessage("kill-rewards.rewards." + targetType + " : null");
return;
}
...```
Caused by: java.lang.IllegalArgumentException: Path cannot be null
at org.apache.commons.lang.Validate.notNull(Validate.java:192) ~[patched_1.8.8.jar:git-PandaSpigot-110]
at org.bukkit.configuration.MemorySection.getDefault(MemorySection.java:718) ~[patched_1.8.8.jar:git-PandaSpigot-110]
at org.bukkit.configuration.MemorySection.get(MemorySection.java:198) ~[patched_1.8.8.jar:git-PandaSpigot-110]
at org.bukkit.configuration.MemorySection.contains(MemorySection.java:106) ~[patched_1.8.8.jar:git-PandaSpigot-110]
at net.leonemc.lithium.utils.BalancingUtils.rewardPlayer(BalancingUtils.java:41) ~[?:?]
at net.leonemc.lithium.listener.DeathListener.onPlayerDeath(DeathListener.java:164) ~[?:?]
at jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[?:?]
at jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:77) ~[?:?]
at jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[?:?]
at java.lang.reflect.Method.invoke(Method.java:568) ~[?:?]
at org.bukkit.plugin.java.JavaPluginLoader$1.execute(JavaPluginLoader.java:300) ~[patched_1.8.8.jar:git-PandaSpigot-110]
... 35 more
What is on this line BalancingUtils.java:41 ?
if(!killRewardsConfig.getConfigurationSection("rewards").contains(targetType))
targetType is null most likely
yeah thats definitely gonna be it, thanks
You're welcome
getName() is deprecated
thats the one
.name()
thanks
deprecated does not mean doesnt work
using deprecated program elements is really bad practice and should be avoided for a huge array of reasons.
i used to hate components because i didn't look in to them. then i tried them + minimessage and they're op
like >>>>>>>>
its not
u clearly have no knoweldge then with bukkit API
many thngs that dont have replacement are deprecatted in bukkit
ap
API
so
You can disagree, but don't start attacking me. It's okay to be wrong you know. That's how you learn.
How is deprecation related to the bukkit api?
please dont get into conversation without knowing backgrounds thanks.
For anyone reading this curious about getname(), I believe it was deprecated in 1.12 or maybe 1.13. It's been a long time. Instead of using getname() you should use getkey(). Effectively the same functionality, but not a magic number id, so it's much more powerful and does everything getname() did but better. I have no clue why TonyFalk is so upset over this. Probably just isn't confident in his own abilities or something...
ill give u short answer many of bukkit methods are despracted before they release new
you dont own me. thanks.
didnt ask you for your opinion your welcome
are you real
~out
tony please get your emotions under control I'm embarrassed for you.
im asking how not understanding what deprecation is (which they actually do) means they have no knowledge of the bukkit api?
did bro just do a discord signoff XD. This has to be a character right?
BoxWithoutATop is literally correct
if an element is deprecated it just means its use is discouraged

