#help-development
1 messages · Page 1426 of 1
the only reason to use 1.12 is cause of modded
otherwise
nope
1.7.10 and 1.12.2 were one of the popular modded versions. idk the next ones so far
looking at prototcol specs, shouldn't you send a 1 instead of a 0 for reason 4 ?
real men play modded on 1.7
lmao
💪
💪
when i was like 10-12 i used to play 1.6.5
1.7 was when most mod developers thrived
like @plain quest
like witchery
you are sending 0
i want to see if what i want works with the regular respawn and if it doesn't i'll use the end screen
ah gl hf
but this isn't the problem at all
where did you bite the ender dragon
in the end
you bit it in the ass? sounds kinda gay
the dragon is female
basically perform any short of dimension change so players can see their new skin
i think that's the easier
cause i don't have to give them their items and stuff
(something that i would do if i were to kill them)
If I have for example an file sample.txt into my Maven resources folder, and I want to read the data, what do I need to do? I can't find anything on Google
i really like the name of ur plugin..
thanks
hi. Sorry for asking stuipid questions if I do.
But I could not find a tutorial how I can overwrite the default Minecraft "/kick" command with my own BungeeCord "/kick" command
If I try to run it it will always use the one of Minecraft. I tried to deactivate the command using the commands.yml but there it didnt do anything when I was using /kick
I guess location.world is null
using a spigot plugin?
damn. I hoped if there was a way without coding an extra Spigot plugin
You can also cancel on Bungee, because it will be called because a command is a command
hm okay. I will try that. Thanks
Ok np
cum core
does anyone know if stuff like List.of and the new methods that are available in Java 11 immutable?
do you actually know the preCommand event name in bungeecord?
Edit: Okay actually there is none
hey how can i clear cache without restarting server in plugin?
what cache?
like playerdata world every
/**
* Returns an unmodifiable list containing three elements.
*
* See <a href="#unmodifiable">Unmodifiable Lists</a> for details.
*
* @param <E> the {@code List}'s element type
* @param e1 the first element
* @param e2 the second element
* @param e3 the third element
* @return a {@code List} containing the specified elements
* @throws NullPointerException if an element is {@code null}
*
* @since 9
*/
static <E> List<E> of(E e1, E e2, E e3) {
return new ImmutableCollections.ListN<>(e1, e2, e3);
}
Do you mean you are manually editing the player data files?
Then why would you need to clear any cached playerdata?
that is dum
idk
caches are almost always soft referenced
oh nvm
it doesnt use native
i thought it did cause of the number of arguments
lmao
lol
show code
event.getEntity().setHealth(100);
}```
EntitySpawnEvent
oh nvm I had to cast it as a entity
Use CreatureSpawnEvent
Nah I just needed to use
if(event.getEntityType() == EntityType.BLAZE) {
Blaze blaze = (Blaze) event.getEntity();
blaze.setHealth(100);
}
not every LivingEntity is Damageable
Still
instanceof and cast to Damageable
You don't need to be listening to all entity spawns if you only care about living entities
myeah
?
strange
I would like to know if it is possible to update only one section of a chunk?
my IDE says there's no extends relationship there
Can anyone tell me how to do a gradient?
by splitting every character into its own chat component and then applying a incrementally shifted color value to each subsequent chat component
or just use adventure, i think it has gradients built in
or use IridiumColorAPI by @radiant aspen
Okay
I'll try it
idk if they actually made it I just know they contributed
what would an event be for when a player gets an item in their inventory
Someone sent some html code and had that in it so i looked it up
you'll need to listen to item pickup and inventory click and inventory drag events
did anyone in here use JDA before?
no none of us have unfortunately
Java Discord API?
yup
Yea what's up
what's that, is that like a STD
I'm trying to make a plugin that uses a discord bot
i have a question how would i make bossbar go from right to left in 10 seconds? my code: https://paste.md-5.net/ukufexuvij.cs
is there any method to get material type's default locale name?
I'd use maven (or gradle or something) and include JDA as a dependency
i mean yeah itemstacks
yeah
and just run it in the normal way in the main class?
it should work
yeah, purpur is downstream from paper
inside the on start method?
you can create a bot the same way using the JDABuilder
why its not specified for the material type instead
wait
nvm
in onEnable or something
that's just how the game works basically
https://github.com/Iridium-Development/IridiumColorAPI Just realised I replied to this like 30 mins late but whatever
materials don't really even exist on mojang's side
yeah and how to pass it to another class?
so I can send messages?
wdym
as you would pass anything to another object
you don't pass things "to another class"
this is OOP, you pass things to another object
Like I have an event that is from spigot and in this event I want to send a message on the discord server how?
it does actually there's nms enum class called Material
if that weird method returns the name of the item
yeah but they split them to item and block types iirc
what does .getLocalizedName() do then
Do you create your bot in your plugins' main class?
and have a getter method?
yes
what is that?
where are you even seeing that method on
in ItemMeta
for example, public JDA getJDA()
it seems that its responsible for serverside translations
let me check
oh, no
so it should be that this thing controls translations which server specifies
lol
Yeah shade it
its not the plugin
^^
how
the server may get information about the client's locale
but it can't do anything with that information
only the I18 localization is bundled in the server jar
Are you using maven or gradle?
it can't translate anything to anything other than it
store your JDA instance as a variable and create a getter method for it
is there a better way of replacing values in a config file with the next one in the list than
Main.get().getConfig().set("respawnLocations." + i + ".X" , Main.get().getConfig().get("respawnLocations." + (i+1) + ".X"));
Main.get().getConfig().set("respawnLocations." + i + ".Y" , Main.get().getConfig().get("respawnLocations." + (i+1) + ".Y"));
Main.get().getConfig().set("respawnLocations." + i + ".Z" , Main.get().getConfig().get("respawnLocations." + (i+1) + ".Z"));```
as for the difference between localizedname and i18 i'm not sure; localizedname might be the language mapping key
i mean maybe because server gets information about client's locale, server sends renamed itemstacks to the client back
server can't rename the itemstacks
server can't translate things to anything other than I18
because it doesn't have any other localizations bundled in
I use maven
i know
dude use variables
but maybe these methods will provide a way for the developer to translate itemstacks
and also wtf dont name your method get() at least man if you are going to use a singleton
and server would manage the packet handling for translated itemstacks
pretty sure locations implement ConfigurationSerializable
kind of doubtful
http://maven.apache.org/plugins/maven-shade-plugin/ read through the examples on how to use the shade plugin
tf is wrong with get
bad method name
its just a way to call the config file
eh you don't need to even shade it. its not that big
it gets the config file
just copy the classes into your jar file
and its short
but its better to shade it
rename the method to getConfig...
Hey. I have a list of Args in a command. Is it possible to remove an argument from a list of args?
im not gonna rename that in 2000 lines of codes
since you would need to handle updates of the classes manually if you don't shade it
you know you can just refactor the method
and the ide does it for you
If only IDEs had a feature to rename things
i guess near the immutablemap
for methods and variables and classes intellij can do it
i don't see a dot there
i think eclipse can also do it too?
Yeah
netbeans too
Oh lmao
netbeans more like bakedbeans
no but in all honesty that code looks horrfic lol. I can send a list of whats wrong
next time you complain about one of my methods names im gonna replace all classes with lowercase, change main to NonImportant, make all methods start with upper case and spam that in your dm with bots, vpn, and spammers
are we shitting on something
24 7
what are we shitting on
i dont give a shit. its your loss
lmao
how can i remove all bossbars player see?
when we tell you to do something
we dont force u to do it
we're just telling you for your own good
¯_(ツ)_/¯
it is until you read NonImportant.teleport.TeleportPlayer
Your loss on that one
idek what that means lmao
I don't have to read it
lol
you r having a hard time getting the joke arnt you?
lmao
no cause it makes no sense anyways...
anyways
how can i remove all bossbars player see?
your mom
2 far
hilarious
Can I remove an argument from a list of arguments
for(String arg : args) {
if (arg.contains("-p")) {
Prefix = arg;
// Remove "arg" from "args"
}
}
do replace
I have -pdfghdfghdfg I want to remove the argument starting with -p
use String#substring
build a new array with only the elements that do not get removed
i would pay someone for converting clientside translation files into java classes
args.remove(arg) ?
no
🤷♂️
1, its an array
really though if you're using -params, you should split on \s-\w rather than space
use an iterator
2, ConcurrentModificationException
Okok
Make it a list and use an iterator :p
build a new array/list with just the elements you don't remove
Probably the better idea ^
or merge the entire args array into a string and split it properly
using -params and splitting by space is dum
How can I store the JDA instance?
as you would store any other object
https://github.com/itxfrosty/DiscordLink look here
piece.getItem().isSimilar(e.getNewArmorPiece())
Why doesn't this work?
https://github.com/itxfrosty/DiscordLink/blob/master/DiscordLink-Spigot/src/main/java/me/itxfrosty/discordlink/managers/BotManager.java this class you can use
what the hell is piece, Hergon?
It is a custom object
hello, somebody knows if Player#performCommand fires PlayerCommandPreprocessEvent?
yes it calls all the command stuff
thank you
didn't help
wdym?
Hello, I have one question how can i start a countdown if a player execute a specific command my problem is just with the countdown
there's no built in coundown timer as far i know inside bukkit runnables
but you can implement it yourself easily
people usually use bukkitrunnables for countdowns
there's plenty of cooldown timers online which you can use
which utilise bukkit runnables
I want a small simple example not big like that with alot of complicated stuff
implementing one yourself might be a worthwhile excercise in how to work with schedulers, though
if you want TPS-indepedant countdowns you would need to use threads or thread pools with runnables
or bukkit async tasks 👀
bukkit async tasks have one tick delay iirc
yeah
0-50ms delay yeah
But I have the bot built in the Main class
as in, they will run at the start of the first available tick
if you schedule them just at the end of a tick they will run basically immediately
just use bukkit runnables
no one will notice 50ms delay, average human eye reaction is like 250ms anyways
let me see your code
@Override
public void onEnable() {
getConfig().options().copyDefaults();
saveDefaultConfig();
getServer().getConsoleSender().sendMessage(ChatColor.GREEN + "[<Plugin name>]: Plugin is enabled");
String token = getConfig().getString("token");
if (!(token == "")) {
try {
JDA jda = JDABuilder.createDefault(token).build();
jda.getPresence().setStatus(OnlineStatus.ONLINE);
} catch (LoginException e) {
e.printStackTrace();
}
}
}
don't send messages to consolesender
use your plugin's logger
getLogger().info()
I just want to say to the user that the plugin is enabled
yes
your plugin logger is your own, unique logger and you should use it for all of the messages you want to log
yeah ik
I don't want to log that message
but you are
it gets logged in the server log, but it can't be associated with your plugin
Spigot already has enabled messages for plugins
don't worry about it this is irrelevant now
you doing shit wrong is not irrelevant
private JDA jda;
public void onEnable() {
/* your regular onEnable bs */
this.jda = JDABuilder.createDefault(token).build();
this.jda.getPresence().setStatus(OnlineStatus.ONLINE);
}
public JDA getJDA() {
return this.jda;
}
thx
this. probably isnt needed but yknow
i use it
and what should I do in the other class
if i want the code to look better, or if the code is confusing i always use "this." or "super."
also to get it from another class its something like JDA jda = MyMain.getPlugin(MyMain.class).getJDA();
fair
Thank u so much
i tend to only use it on some plugins, my brain does weird shit
MyMain.getPlugin(MyMain.class).getJDA(); I would advise against that
ye
yea its an example (be it a bad one)
Use a singleton, or even better, dependency injection
java.lang.NoSuchMethodException: JavaPlugin.<init>(PluginLoader), the constructor: protected JavaPlugin(PluginLoader pluginLoader)
usage:
Constructor<?> javaPluginConstructor = pluginClass.getSuperclass().getConstructor(PluginLoader.class);
javaPluginConstructor.setAccessible(true);
this.plugin = (JavaPlugin) javaPluginConstructor.newInstance(this);
by a singleton, do you mean like private static MyPlugin instance; with a getInstance() method?
or am I smooth brain
It's my own class
Because the constructor must be private so people can't create instances with PluginLoader, and I want to create a new instance with PluginLoader
bukkit already enforces the singleton principle for javaplugins
bukkit will also be unable to load your plugin if it can't instantiate your main class
If I now make the constructor public and init, everything works
But I can't use with reflection
Does anyone how to put thescheduleSyncRepeatingTask into a map
map.put
private Map<String, Object> countdownMap = new HashMap<>();
private void test(Player player) {
countdownMap.put(player.getUniqueId(), Bukkit.getScheduler().get);
taskID = Bukkit.getScheduler().scheduleSyncRepeatingTask(Main.getInstance());
}
this doesent work
👀
Got an idea: I make the constructor public, and add a boolean so I can see it is instanced
that is literally what bukkit does already
And if true throw an Exception
So do you have an ideo
They are checking it with ClassLoader, not with a boolean
idea
so you dont want people to be able to get instances of your plugin?
I want them to use the public constructor without arguments
on a JavaPlugin?
they can get around that with reflection, no?
Yes, but I don't mind reflection for now
I just throw an exception if they try to create an instance, that always works
declare a no-arg constructor in the class that extends javaplugin
And a boolean so it works the first time, and then they can't create more instances
and then force these other classes to extend that class instead of javaplugin directly
Already done
then that is all you need
no-one can call the protected javaplugin constructor then
But I must get the constructor from the superclass, because otherwise reflection won't work
im sorry if this sounds confusing but i have made a file system. I am generating random String and ints. Does anyone know how i can save the String and ints for InventoryClickEvent?
i am so fucking lost on what you are even trying to do
Bukkit.getScheduler().scheduleSyncRepeatingTask(Main.getInstance()); can someone tell me how i can get from this the task id i know it need a runnable
why are you instantiating it with reflection again?
Ok I will explain again
public class JavaPlugin
{
public JavaPlugin() {}
public JavaPlugin(PluginLoader pluginLoader) ...
}
//From outside (in the API):
new JavaPlugin(PluginLoader);
//Class outside API which extends JavaPlugin must use the no-args constructor
public class Extender extends JavaPlugin
{
}
what
why are you manually instantiating your javaplugin
Because I got the class from the plugin.yml (I added an custom value)
???
Yes it is a bit complicated
The users which use my API must apply an annotation onto their JavaPlugin (from me). I force Bukkit to set the main to a custom class called BukkitPluginLoader (extends JavaPlugin), I also add an value to the plugin.yml which I will get later. In the onEnable of the BukkitPluginLoader I get the value (The actual annotated class), and there I want to create an new instance.
so the user of your api ends up with two classes extending javaplugin
No they only need to extend my own JavaPlugin
Because I force set the main into the plugin.yml to my own loader
And add the value of their main which I later get
and how does this differ from them just extending a class written by you that extends JavaPlugin
Because I make my API partly compatible with bungee and bukkit
Because for the most things they use the same system
But now an answer to my problem?
that sounds so haram
I will just make the constructor public from my JavaPlugin, and check with a boolean if the PluginLoader is already into the class
I don't know how Bukkit can make it with values
whats your issue ? cannot access protected constructor ?
the end user has to extend JavaPlugin on Bukkit and whatever else on Bungee anyway
what is the point
I am creating a class like Bukkit's JavaPlugin, but I have to parse some values to the class
simply split your implementation specific code into two implementation specific classes
And I want a no-args constructor for the user
and group your common implementation into a common class
and then have your end users extend the implementation specific classes
Not with reflection
you do not need reflection
Ok show the example then into code
you do not need to instantiate the javaplugin class yourself
if you want to use reflection, use Class#getDeclaredConstructor to access protected constructors
Oh I never knew that, thanks
Is this okay?
Now I get InstantiationException
Constructor<?> javaPluginConstructor = pluginClass.getSuperclass().getDeclaredConstructor(PluginLoader.class);
javaPluginConstructor.setAccessible(true);
this.plugin = (JavaPlugin) javaPluginConstructor.newInstance(this); //This
The method is correct but your map has the wrong key type. It should be UUID
My bad sry
the uuid var is of type String
why tf doesnt spigot implement methods which can get nms base values of modifiers
like
the NMS classes already store these attribute values
now i need to use compat classes
just to access those
thanks spigot
and paper was originally born from the spigot contribution process being too covered in red tape
idk, contributing to spigot isn't too much effort imho
i don't really contribute to anything ever so dunno
but supposedly they originally split off and forked it because it was too annoying to get any changes in
Nothing wrong with that xD But like complaining about missing API on an open project
paper has a different goal than spigot tbh
i think aikar and his disagreement with the skipping ticks thing was a large part
paper does a lot of things on improved performance and own custom logic on the server
spigot really just wants to represent the minecraft server in an API
I think spigot is doing a good job in the ecosystem ¯_(ツ)_/¯
that's ok, because NMS store these values anyways the only thing they need is to implement the methods to access the values
good job at slowly dying out
Can someone help me fix this error? https://gist.github.com/LPTP1Dev/7c87bd695218658c8c72acd1d132468c
check your dependencies
wait
no
are you running right version of java
its missing classes for some reason
Yeah I mean, being a a straight up representation of a code base developed by a weird swede in 2 days isn't really the best business model xD
i still can't figure out what that one guy was trying to achieve
I'm running
Java(TM) SE Runtime Environment (build 1.8.0_281-b09)
Java HotSpot(TM) Client VM (build 25.281-b09, mixed mode)```
like, where is he even going to read the plugin description file and do all of that shit
I guess he is wrapping plugin logic to act as a middleware between server and plugin
bukkit's not going to call his classes first, they'll be targeting the javaplugin the end user extended
idk xD ¯_(ツ)_/¯
meaning the constructor of the end user is already happening way before any of his code is even spinning
let people do dumb things I guess
absolutely incomprehensible
how i can check if entity is burning ?
get the fire ticks and compare them to 0
how can i make actionbar stay longer? all.spigot().sendMessage(ChatMessageType.ACTION_BAR, TextComponent.fromLegacyText(announceMessages.get(messageFromList)));
I don't think you do
it is just a chat message
no duration is send to the client
oh rip
just send it multiple times or smth
just want to make it stay for 50 seconds
probably start an async timer that runs every second
and have it send 50 times
tho that duration is a wild guess
why is async deprecated?
oh
Don't use those ones
those have been dead forever
use runTaskTimerAsynchronously
oh okaay
with the consumer
the one with bukkitrunnable is deprecated
@eternal night spigot-test is for noobs
pfft
shouldnt i use runTaskTimerAsynchronously?
Yes
getServer().getScheduler().runTaskTimerAsynchronously(this, task -> {
}, 0, 20);
?
instance.getServer().getScheduler().runTaskTimerAsynchronously(instance, new Runnable() {
@Override
public void run() {
for (Player all : instance.getServer().getOnlinePlayers()) {
all.spigot().sendMessage(ChatMessageType.ACTION_BAR, TextComponent.fromLegacyText(announceMessages.get(messageFromList)));
}
}
}, 0L, 20L);
You can skip the task part if you don't need it
ah
yeah
what is not working with that code tho xD
yea
are you sure this is what you are actually running xD
the method is definitely correct
timers execute repeatedly till cancelled
yes it is
e.getNewArmorPiece().equals(piece.getItem())
``` Why doesn't this work
otherwise it wouldnt send
any ideas why base value of attribute returns 6.0 as attack damage while in lore section of item it states its 7.0?
it doesn't have any modifiers
probably rounding
figured it out just put in bad method
whats wrong? https://paste.md-5.net/evurinucik.pl
the base attributes might be modifiers on the player's base attributes
the base damage attribute of the player is 1 so 1+6=7 makes some sort of sense
not sure about the attack speed
https://pastebin.com/GW1MSiBA How can in a event get health from the boss?
didnt you just do that?
Entity#getHealth()
attack speed wise, I think the default attack speed is 4.0 xD
so -2.4 gets it down to the 1.6
and yea, 6 adds to the one from player
lit
I thought weapons all said + x attack damage
I was under the impression that + x added to the base of 1
iirc the client displays it as x attack damage instead of +x
it's also in a different color than a regular attribute modifier
is there a way to add an invisile id to an item, i have a list of items, and i want to give the player the clicked item if he right clicks, and delete this item fron the gui if he presses left click, and delete this from the config file, my only idea was to add a number like 0:itemname and on inv click event take the item name, slip it by : and get the first arg and delete the item from the config file where the id is the same as the first arg in the item name
item type, name, lore, enchant, amount, etc can change
and damage
use the pdc
Does anyone know why my countdown doesent count -1
?ask
If you have a question, please just ask it. Don't look for staff or topic experts. Don't ask to ask or ask if people are awake or available. Just ask the question to the channel straight out, and wait patiently for a reply.
you don't need a map there
each instance of this TestCountdown has its own set of fields
you can store the countdown directly in an int field
as for why it doesn't count -1, dunno
?ask i am kinda new to skripting so i dont know much about it but i want to make it that when you /spawn you need to be out of combat and not moving or be hit for 5 seconds so yea (the combat thingy i have combatX plugin)
are you using skript
your compute call does not mutate the value given
or java
skript
die
then leave
Do you can say why my countdown doesent count -1
Why to you have two methods to remove the player
like i just said, dunno
your map#compute call
......
no ?
alright guess i go ask bukket
...........
^ that too
i did it but it doesent work
Not sure why you need Skript for this. Just use EssentialsX and put a 5 seconds teleport timer
Skript is way slower compared to java, any plugin that does something other than send a few messages you should use java
wait i can do that?
Yes
🥲
you want to switch now before it's even harder to switch
eventually it becomes impossible to switch and then you're truly fucked
🤮
?
EssentialsX is disgusting is my opinion.
Why?
Do you can say it why it doesent count every second -1?
just tell me how to use essentialX to do it
go ask the essentials people
I prefer to code my own
I agree, this is way better https://www.spigotmc.org/resources/serveressentials-essentials-for-skript.7190/
ah yes, the "i didn't write it so I won't use it"
lol
who are they now?
There's a setting called teleport-delay set it to 5
Join the skript discord, there you go
👀
damn you guys are pushing him out
whats the command for it tho
command for what?
its prob in the config no command
did anyone worked with attributes knows wtf is going on
it only happens whenever i switch from sword to sword
it doesn't happen if i switch it to some other item
like AIR
double attackDamage = Math.round((attributes.get(GenericAttributes.ATTACK_DAMAGE).iterator().next().getAmount() + event.getPlayer().getAttribute(Attribute.GENERIC_ATTACK_DAMAGE).getValue()) * 100) / 100d;
double attackSpeed = Math.round((attributes.get(GenericAttributes.ATTACK_SPEED).iterator().next().getAmount() + event.getPlayer().getAttribute(Attribute.GENERIC_ATTACK_SPEED).getValue()) * 100) / 100d;
forgive me for this spaghetti mess
kinda hard to read that
math.round shits round number to the 2nd decimal
attributes gets the attack damage and speed from multimap
and event's player attribute instance get the value of player attribute
multimaps are gay
regrettably
event.getPlayer().getAttribute(Attribute.GENERIC_ATTACK_DAMAGE).getValue()
that's the cause of glitch
i debugged it
but still can't seem to think why
when switching items this being set to currently held items attribute value
shouldn't it be updated
whenever i switch the item
because it seems the event is called before it happens
weird
most events are
concerning you get to cancel it, pretty sure you gotta do it this way xD
that's not what im achieving
im trying to get whole value of current players attribute
while changing held item
point is that since the event is cancellable it probably happens before any changes are made
i'm not really sure if there is a good way around that
need to find a way how to get past that
might just need to schedule a task
but interestingly
it works whenever i switch to air
it resets it
while instantly selecting another sword for example, doesnt
fixed it
.getValue() -> .getBaseValue()
base value method ensures to get value before any calculations are being done with the item attributes
neat
how can i serialize the clicked item? i have this so far https://paste.md-5.net/woxumefimo.cs
not working tho
i cant cast the event.getcurrentitem to an itemstack
System.out.println 👀
wat
you should be using a proper logger
? It already IS an ItemStack
can someone help me to understand a bit how people rly find dupes? Not like im trynna create smthing, it just interests me
I mean you gotta be rly creative
But like
mess around
But you gotta know certain things right
yea but how can i serialize that itemstack?
If you trynna use clients to make stuff work etc
the basics ig ¯_(ツ)_/¯
ItemStack.serialize()???
He ment deserialize
yea
i have this
int totalItems = new GetAllItems().getItems();
System.out.println("test1 " + totalItems);
System.out.println("test2 " + currentItem);
for(int items = 0; items < totalItems; items++){
ItemStack itemDes = ItemStack.deserialize(Main.get().getConfig().getConfigurationSection("items." + items).getValues(true));
System.out.println("test3 " + itemDes);
if(currentItem == itemDes){
System.out.println("here" + currentItem + itemDes);
}else{
System.out.println("not here " + items);
}
}
but the if is not working
cant see why
do NOT use ItemStack.deserialize
[18:15:00 INFO]: test2 ItemStack{GOLDEN_APPLE x 64, UNSPECIFIC_META:{meta-type=U
NSPECIFIC, display-name=ºrtest}}
[18:15:00 INFO]: test3 ItemStack{GOLDEN_APPLE x 64, UNSPECIFIC_META:{meta-type=U
NSPECIFIC, display-name=ºrtest}}
[18:15:00 INFO]: not here 0
[18:15:00 INFO]: test3 ItemStack{STAINED_GLASS_PANE x 64}
[18:15:00 INFO]: not here 1
[18:15:00 INFO]: test3 ItemStack{STAINED_GLASS_PANE x 64}
[18:15:00 INFO]: not here 2
[18:15:00 INFO]: test3 ItemStack{STAINED_GLASS_PANE x 64}
[18:15:00 INFO]: not here 3
[18:15:00 INFO]: test3 ItemStack{STAINED_GLASS_PANE x 64}
[18:15:00 INFO]: not here 4
[18:15:00 INFO]: test3 ItemStack{WOOL x 64, UNSPECIFIC_META:{meta-type=UNSPECIFI
C, display-name=ºrwhite}}
[18:15:00 INFO]: not here 5
[18:15:00 INFO]: test3 ItemStack{WOOL x 64, UNSPECIFIC_META:{meta-type=UNSPECIFI
C, display-name=ºrorange}}
[18:15:00 INFO]: not here 6
[18:15:00 INFO]: test3 ItemStack{WOOL x 64, UNSPECIFIC_META:{meta-type=UNSPECIFI
C, display-name=ºrº4magenta}}
[18:15:00 INFO]: not here 7
[18:15:00 INFO]: test3 ItemStack{WOOL x 64, UNSPECIFIC_META:{meta-type=UNSPECIFI
C, display-name=ºrº6light blue}}
[18:15:00 INFO]: not here 8
[18:15:00 INFO]: test3 ItemStack{WOOL x 1}
[18:15:00 INFO]: not here 9
[18:15:00 INFO]: test3 ItemStack{WOOL x 32, UNSPECIFIC_META:{meta-type=UNSPECIFI
C, display-name=ºrº6light blue, lore=[ºrºrº4test]}}
[18:15:00 INFO]: not here 10
[18:15:00 INFO]: test3 ItemStack{WOOL x 32, UNSPECIFIC_META:{meta-type=UNSPECIFI
C, display-name=ºrº6light blue, lore=[ºrºrº4test], enchants={LURE=0}, ItemFlags=
[HIDE_ENCHANTS]}}
[18:15:00 INFO]: not here 11
>```
why not
i get all the items in the cofig file
whats wrong with that lmao
Because its not the correct way to get ItemsStacks outr of a config
ConfigurationSection#getItemStack()
you dont need to use deserialize. use ConfigurationSection#getItemStack(path)
uhh, is the == intentional..?
myConfig.getItemStack("path.to.item.stack");
and to put it in, myConfig.set("path", itemStack);
^
and also pretty sure == is wrong here
== should be ItemStack#equals because its not the same instance
thank you everyone, once again you solved my problem and gave me the friendly reminder that i still dont know shit
haha
is Lombok any good or should I avoid it
It makes you lazy
so... bad?
It has its uses, if your project is MASSIVE
yea i suppose so
lombok is arguably useless
I used it for a while in some projects. Then I found I was forgetting how to do the most basic things.
unlike any other library for instance guava, caffeine or whatever you like lombok doesn't provide any meaningful value imo
for real? wow thats... bad lol
not really sure tbh, it was just a random question
I would say this, try it out at least
Its fun to experiment with if you have never used it
get your own opinion on it
I find everyone has an opinion, but mine is always right 🙂
fair enough lol
how to get config insttance in other classes?
probably want to pass the instance
Free getters, setters, tostring, equals, hashcode
You can generate setters and getters with almost any modern IDE. toString is also something you can generate with IDE and implementing it without lombok can arguably be advantageous since the implementation becomes more visible, same thing with hashCode and equals. Those can also be generated with an IDE and by not using lombok you can very easily change the implementation as I presume the annotations have some sort of default implementation.
i LOVE lombok 😌
not worth the headache imo
takes longer to write the annotation than to alt-ins and generate the methods
Garbage code that has to be updated all the time
Garbage code?
Waste of space
I mean its a compiler hack so the method will still be there
Then you're just using the wrong language
Thats not a reason to resort to compiler hacks
if only we could like, collapse sections of code, or something
impossible nny
The compiler literally has an annotation processing api
Lombok uses internal api that isnt supposed to be used
@jade perch you still got your lombok.txt?
Not sure I can remember the last time I made a change to a toString, equals or hashcode. Getters and setters I can agree are somewhat useful.
I can bring in an lombok.txt
?plsnolombok
Implementation details of lombok /=/ the features I described
read that.
I would fully support a less hacky version of lombok that does only the things I listed
Id say moving to a language like kotlin or simply relying on your IDE to generate them are the much better options
Also
Images are disabled here?
I disagree either of those is a better option
Are imgur links allowed?
Verify yourself
you disagree with many things
can someone help me? there is a file called delete in my minecraft server files!!! and its deleting protocol lib, i dont want protocol lib to be deleted!!!!
Too much of a hassle, sad
🥲
Reason for disagreement?
new covid strain deleted protocol lib
😄 but serious tho
Also, since I cant post images,
Why is Lombok bad?
- It's a compiler hack - the Java compiler isn't designed to modify code, so it can cause difficult to debug errors, or worse
- It requires an IDE plugin, so unless you've properly configured Maven, Gradle and your IDE, you'll get hundreds of compilation errors. This process takes time too, it's not easy
- Lombok'd code won't show in Javadocs
- The code generation is often unpredictable and difficult to debug, and often you'll have to do it "the hard way" anyway
- Java is supposed to be explicit, Lombok hides a lot of key functionality into a subtle annotation which can be easy to miss
- While IDEs support it with a plugin, it's usually more difficult to find specific things, like usages of a getter because they don't exist in the source code
- Finally, Lombok'd bytecode doesn't match the source code, so it causes a pretty annoying warning in IntelliJ
make sure to wear a mask so your system doesn't get infected
lol my copypasta was literally made in counter to that
you have failed
I’ve discussed the method reasons above, and moving languages is a silly solution that doesn’t solve the problem
Where is your copy pasta?
And lombok does show in javadocs
See bungeecord docs
Why is it a silly solution? You're clearly looking for features that that language provides
this sounds so much as PR speech
Saying that the hashCode, toString and equals have to be updated all the time isn't true. It very much depends on how the class looks. Then of course if you just want everything to be as short as possible java isn't probably the suited language and like nny said we can easily generate fresh hashCode, toString and equals methods which are not garbage. Then we have records which abstracts away hashCode, getters, setters, toString and equals which makes all of your listed annots quite useless.
Lmao, you were the dude
like we know it has bad things,but our fully researched profesionally trained olimpic programmers are making it the best
This txt file was already heavy debated and reasoned against on helpchat
lombok flamewars are fun
Netbeans doesn’t need an ide for lombok either
Literally none of those points apply to me
Who in there right minds uses netbeans these* days
few things apply to you
mojang lmao
looks at md
yes... he uses netbeans
Alright, fair enough then
my man is stuck in 2001
@ivory sleet have you used taskchain before?
still records will make lombok annots like @Getter and @HashCode pretty much useless
assume you only want to create a basic pojo
yeah
I haven't found a lombok plugin for windows notpad tbh
It's my new favorite
Records fill a different niche with some overlap
They’d replace maybe half of lombok usage for me
yeah
Id still say lombok is still a cheap attempt at what something else solves in a much better and concise way.
lmao what?
👀
why so
ikr thats why i use java 11
lol
lol
kekw
idk what was added in java 9
Java 16 when
someone deleted my message smh
reflection ban hammer was added in 9
1984
i dont bother checking the patchlogs i just code shit
Mainly jigsaw
i fundamentally disagree with reflection getting cucked in 9
not really
Yeah but now you have to expose
You could even open to specific other modules
can't f.e reflect into the fields of propietary classes from the java standard libraries
Not really
You can choose to stay in the unnamed modules part
the closest to that I've seen is some methodhandles hack
Well then you are just not using jigsaw xD
Jigsaw isnt forced to be used
but it was convoluted and pretty annoying to set up
complaining about how lombok uses hacks
You shouldnt
complaining can’t use hacks
MethodHandles* are not hacks
can't and will not are different things
the point is that I can choose not to use hacks
Lombok does much more than reflection
You can also choose not to use lombok?
It modifies bytecode
What logic is this
yes
I have nothing against the compiler hack as some depict lombok just think it's not meaningful 🤷
which is why I'm fundamentally fine with lombok's existence
Yes thats exactly what was suggested
Choose not to use it
🥲
So we decide which IDE is best next? 😛
groupmanager is bad
nah nah, do python vs java or something xD
pex is good then?
ever heard of haskell?
yes
or kotlin
i unironically use pex on prod
Haskell is for plebs
@sturdy venture
why so
Prolog or bust
FP good
it absolutely is
WHAT
NO NO N ONON ON ON
this is actually a really interesting read, going back into the early 2000s
haskell 🥰
YOU
whats happening
oh there's a caps filter
lol
LOL
Haskell good
cringe
=
Silence unverified user
if you don't use haskell in prod are you even a developer
i'm more verified than you are
Lynx knows whats up
so true
🤣 🤣 🤣 🤣 🤣 🤣 🤣
Were switch cases only implemented in Java 12?
yes indeed
many people didn't realise that java didn't actually have variables until java 5
Uh
switch expressions
oh I misread
No it’s good
no your lib is precious
programmers had to save something to a file if they wanted to avoid computing it more than once
and thus, the java serialization api was created
I think
to make this easier
like the nms?
Uh the api I think
o
Do you have a common module btw?
No
this is only spigot right now
i need to make common, nukkit
and stuff like that
Mhm
im going to count how many classes in my lib use the spigot import
and then i just need to create impl for those
let x = case y of
1 -> 2
_ -> error "lol'
Yeah just abstract the shit out of it
is there a way to get the command in TabCompleteEvent
so bukkit and spigot imports right
Yeah we can have a closer oloook tmrw need to study now heh
k lmao
Lol
i dont want the last part
if (event.getCompletions().equals(tabCompletions)) {
its not guarenteed to be my command
why you need the event??
declaration: package: org.bukkit.event.server, class: TabCompleteEvent
but you shouldnt need the event
im cancelling tab completion on the <eval>
Fer·nan·do Pó·ov
Fer·nan·do Pó·ov
what is watermc
how do i check if the player if holding a certain sword that i made.
get the held item and compare
that doesnt work
if(held_item.equals(Stabber.Stabber){} never works ):
wot u mean? github?