#help-development
1 messages · Page 1959 of 1
future is async
Idk if I still have the code
ye thats why i ask
WhenComplete runs when the future is complete
it will get executed instantly
yeah it'll get executed but wont get what h want
if you do find it please tell me
probably
ah so i would need to put it in the whenComplete
i recommend it yeah
Just use get()
it will execute but probably will now load what u want it to
🤡
isnt .join() better, conclude once told me about it and it worked fine
and encapsulate them
i fail to encapsulate them due to shutdown
it will halt the thread
yea
lagging the server so no
until the task is complete
?paste
i should learn more about threads smh
This is why I prefer Flows over Futures
And also spigot mapped
Don't use futures, they are utterly pointless
what is a Flow?
java.util.concurrent.Flow, J9+ exclusive
Go with the flowwww
It works with a publisher-subscriber model, so it won't force you to constantly poll whether it has completed yet
Concurrency is life
Don't talk anything bad about my java.util.concurrent package
i assume getNBTData(Entity en) is
net.minecraft.server.v1_16_R3.Entity nmsEntity = ((CraftEntity) en).getHandle();
NBTTagCompound nbtTagCompound = new NBTTagCompound();
en.save(nbtTagCompound);
return nbtTagCompound;``` @young knoll
first time working with nms ive found this in google
i do know that this will only work in 1.16
but is possibly how you did it
it's at least something
alr tysm
how do you remove 1 itemstack from the player, for example if im holding 2 diamonds i only want to remove 1, not 2
Get the item stack, use itemStack.setAmount(), then set that item stack in the slot.
setAmount works
They do it's called setAmount with a lower number
lol
do you know any mods / plugins for stone drop for version 1.18?
What do you mean by stone drop?
what I mean is that every amount of stone that is excavated, the raw materials are dropped out
Thats just how vanilla works...
If you want to change drops on your server ill just blatantly recommend you the plugin i just re.wrote.
You can edit the drops of stones there. And anything else in fact:
https://www.spigotmc.org/resources/advanced-drop-manager.65396/
Or a datapack
thanks
anyone know what might cause this?
is super vague
trying to maven install
think the pom could be the issue?
If I remove properties
I get this
Problem solved then, don't use Lombok 
So it compiles now? If not show the rest of the log
🤦
does not compile
that is all it says >_>
o
I'm trying to install
should i be doing compile?
You can click up the stack on the left to see more
I only know how to get the trace when using the terminal. Could you please do that?
There you go.
maven compiler plugin
yeah works now
Also 8 shouldnt work
its 1.7 1.8 9 10 11
8 is 1.8
well it compiled 🤔
or will it not work on the server?
Either they added support for that naming scheme or it defaulted back to 5 lol
Maybe the compiler plugin has a dumdum filter for that
i'm a total noob at this how would i implement faster crop growth rate?
you want to make crops grow faster ?
if i say continue; in a for loop it will go for the next run right?
it will abort the current run and skip to the next run
thx thats what i meant
is there an equivalent to BlockReed.canPlace in the api?
Guys how can I return some items in the crafting grid when the craft is done? Like when you craft cakes with milk it gives you an empty bucket
CraftItemEvent
Yeah but how can I set the grid
getInventory.setItem
And that inventory will be the grid right?
yes
all crops or just in a range ? with api or without api ?=
all crops lmao what's api
not only the grid also result
the API is what you mainly use for coding plugins (provides Player obj, Location and more ... also Events)
like api as using another separate plugin is that what you mean
NMS would be code from minecraft itself which changes mostly every update
Application programming interfaces
Block.canPlace(BlockData)
neat ty
yes i want to use api
just use the gamerule and set the randomTickSpeed higher
using api and affect all blocks would need you to check every world, every chunk, every block and thats rly bad ....
If you set the randomTickSpeed higher that’s going to impact anything using it, not just crops
^^
yes i was about to say
i want to make all crops to grow slower but then change its growth speed when a player does something
maybe changing something in the TickEvent?
oh i thought i saw it
Here’s what you could do (not necessarily the optimized solution):
On any chunk load, check all the blocks in that chunk for a crop. Cache these crops in a map or something similar.
On any block break/place/physics/etc if a crop gets planted add it to the cache, if it gets removed remove it from the cache
On chunk unload remove all the crops in that chunk from the cache
^ That also works
Then you tick those crops at the rate you want and that will be their growth
so I asked a question a while ago, and i found an answer
In a single-core CPU, we may get concurrency but NOT parallelism.
so I was right
should i make a separate method to check on the db if an user exists or should i just try to load them and check if its != null?
i mean im loading the user when they log in
to access the db without blocking the main thread
oh
you meant loading all the data of player
at auth
Either
i would still load it
because there's bigger chance that the connecting player would log on
i think best thing is to load it so i could store it in a variable and wolk with it if its nonnull
If that’s what you’re trying to do then do that
But if you’re ONLY trying to see if they exist, you can just check if it’s in the database
Highly dependent on what you’re actually trying to do
Each thread is created in Java 8 will consume about 1MB as default on OS 64 bit
oh no
my precious 1mb of ram
when the player joins, i want to check if they have played before (and not in terms of: they have joined the server before, but they actually chose a kingdom to play in (im making a kingdom server)) and when true, im loading their data or otherwise im creating a new user on the database
what's the database key in bukkit.yml? Can all plugins use it?
and how do i save / fetch bans from a database, removing the need of the banned-players file?
no no im not saving their data when they havent chosen a kingdom to play with (im making a kingdom server)
i would just lazily load all the data of the player to the memory
Hi there, I need to get nms class named "NetworkManager" (spigot mapings), how can I get it?
because as i said there's bigger chance that the player played on the server before
lmao imagine 2k users
You should do that in the AsyncLoginPreprocess because you can block the thread there.
or just an completablefuture?
Embedded systems
embedded h2 db 😌
Sure but then you would have to initially block every interaction with/from the player until everything got safely loaded.
@tardy delta load the data on the AsyncPlayerPreLoginEvent
im kicking them if it fails to load them
lul hand full of megs
No need for a completablefuture
Because that event happens async already
Make the database call in there
hmm people told me to not do that because there is no getPlayer() method and the uuid might be fake
users might have a ban too
what if the server is cracked
Yes but imagine if he joins and instantly tries to execute commands that use his data. Confusion if it doesnt work and possible errors/data corruption.
Then the UUID would always be fake
🤔
@tardy delta you just unload their data after x ticks if they never actually complete the join
You dont need a player to load data. Just his UUID.
And as alex stated this happens after auth
^
hmm could give it a try
umm... Can someone explain this to me please:
I mean... maybe I am stupid but
That’s the event you’re supposed to use for loading data off the main thread on player connect
but loading data sync feels like a pain
It’s not a pain
is there any fancy way to do file deletion async
Plenty of libraries for that
Doesnt java just auto unbox this?
or FJP
You are using the wrapper instead of the primative.
Bukkit.getScheduler().runTaskAsynchronously()
your getForcePowerLevel method doesnt return a boolean?
i dont have plugin instance
thats what it says
no
JavaPlugin.getPlugin(YourPlugin.class);
it returns an int
Ok so im not tripping. You can pass Integer as an int parameter.
Yes, happens automatically
But if the Integer is null you get an exception
throws an npe iirc
In C/C++ but not Java
the method also says getForceLevel, not really something that would return a boolean
that's not very good (internally its bunch of runtime class checking and casting)
?di
Guide to dependency injection: https://www.spigotmc.org/wiki/using-dependency-injection/
singleton brr
it returns an int so
you cant use it in an if statement unless you do like < or > or something
🥲
that's what I wanted to do
but
that's the problem
it says that it requires a boolean
but
@tender shard you said something why not to load players in the asyncprelogin event right?
lmao
learn java
isnt it that difficult
Is there a way to use hex color codes with TextComponents while the text input can be configurable? To clarify, would it be possible to take a message like this "&7Hi there, #03A9F4Nothixal" and have it automatically converted to the proper colors?
I currently have a method that does this for chat messages, but when I want to add something like a link or hover text, it doesn't return the right color. I'm trying to avoid hard coding messages whenever possible.
it requires an int
it expects a boolean
It’s returning an int, you need to apply an operator to that int to make it a boolean expression
^^
It’s the event you want
Your problem is this
if(241) {
// Do stuff
}
C++ moment lol
Map<Player, List<Pair<Integer, Pair<ItemStack, ObjectDataFile<List<ItemStack>>>>>>
generic moment 🥴
How about you dont do that and create a ton of new classes
If you see nested collections then it is 100% time for new classes
wtf
this looks so messy
it is
can someone help me figure out why this isnt dropping anything?
Pastebin.com is the number one paste tool since 2002. Pastebin is a website where you can store text online for a set period of time.
are the log messages printed?
yes it is logging out every block broken but it drops nothing
not hitting any else statements
because the statement in your if is true?
cat 
yes
I don't think the code you've sent is causing the issue
unless my config file is formatted wrong
no errors, i do have another issue though where when i run the command to toggle the plugin on or off. it doesnt toggle off
what does define 'if the user has played before'? the usercache.json?
always says "Autosmelt toggled "on"
so im assuming theres an issue with my getters and setters
most likely
hold on
oh actually no, at least for spigot 1.8
hmm its a boolean flag that becomes true when the 'readExtraData' method id called
Is it possible to add a value to an Enum with code?
1.8 💀
is it possible to get generic type class at compile time
like
List<Integer>.class // not legal
probs not
I mean, java erases generic types
(it checks if the player has a UUID.dat file in world/playerdata)
because this is not cpp templates
yes, kind of
dovidas non reifiable types iirc
^
but not of a standard variable / field
you create an anonymous "subtype" that at compile time enforces the type by passing it to the supertype type parameter in its declaration
only becomes true when this method inside craftplayer is called, it has a boolean field in 1.17.1
TypeToken<List<String>> list = new TypeToken<List<String>>() {};
spigot includes by default
how does it get it tho
no, enums can't be changed on runtime
how do i exclude an array to not be deserialized in gson?
class ListString implements List<String> would require to know the type even at runtime dovidas
transivite
only not be deserialized, i want it to serialize
hmmm
wouldnt this work this.getClass().getTypeParameters()
so i can deserialize it with a type adaptor i found
handy
idk what exact call the type token does
but by deriving a class with generic type parameters and then pass the types would result in non erasure
so then with reflection you're basically able to pick the type up
yea
i saw this this.getClass().getTypeParameters() on stackoverflow long before
and it stated the same
since gson can't serialize item stacks
that whenever subclass defined a type for a generic, you can get its subclass types
You could also use TypeTools :)
(Note: that one uses constant pool hacks)
I mean there are some ugly tricks to bypass that
the only way to solve this probs is to wrap around the object
call it without 'this'?
Unless you modify the class while it's loading ;)
meh
you could declare a Consumer<? super SuperType> in the super constructor, very ugly but works
enums are constants
(presupposing you in fact have control of the super class)
if you wanna dynamically add values, don't use enums
use EnumSet if you want to group enums
Whitz no
Ty i was just curious
the entire purpose of enums are that all of its instances are in principle known at compile time
he literally answered it
someone please help me with this before i pull my hair off https://paste.md-5.net/zacobitohi.bash
to another person
happens
seems somehow you're constructing an itemmeta object without any args which is illegal?
im not sure though
what exactly are you trying to do
are you deserializing objects with gson?
i am trying to persistently store menu items (itemstacks) in a menus.json
i am exposing false the itemstacks
for deserailization
just use yaml like a normal person
when snail speed
anyway how would i fix that
I mean valid json is valid yaml essentially
since i started java like 2 weeks ago and i suck
well if you have a giant json (which i do) it will be faster
yml is slower
correct
especially if the file is giant
well the file size is bigger though
depends
if yoy have giant json files you are doing something wrong
no
i am making a menu plugin
yes
and menus require items
and itemstacks + itemmetas are big strings
so the json will be huge if you have like 11 items
serialized items and an iventory can contains max 52 stacks or something so there is a limit at your file size 
yes
both can be huge and small, like whatever you do in json can be done in yaml
*feels like a god, when he serializes items in nbt*
yeah but the only reason json is used is to persistantly store it
u use commands to make menus
itemstacks in databases is also pain
Is it possible to make an entity glow only for specific players?
well its primarily good at representing a set of data values in a key pair format
Not with paper 😎
idk
binary, obviously
anyway how would i construct an itemmeta object with args
like, you have any alternatives? Break down everything into tables? No, thanks
declaration: package: org.bukkit.inventory, interface: ItemFactory
i have an EntityDamageByENtityEvent and it detects when a fireblal explosion happens, and then sets the damage to all nearby entities in a certain radius. this is what i want it to do:
Fireball Explodes
Set damage, add damage to a variable/map
Set damage to all nearby entities, for each entity that is damaged also add damage to the same variable/map
After that, it will send a message to the player like "Your fireball hit 3 entities for 22 damage" but it sends it multiple times, because the event is being called and then its also going through the nearby entities at the same time
im trash at explaining
what's point
Base64 is just encoded bytes but fat
idk maybe more readable
don't listen for entity damage, but for fireball's explosion
EntityExplodeEvent?
But idgaf i store UUID's as BINARY(16)
ok but then i cant set the damage
how do i use this
you can send binary data via address bar
Anybody know how to make a NPC into a shop that works with essentials and vault?
well did you use gson?
on the web
wdym you can't
i used it for everything but itemstacks
in that case you might have to implement a TypeAdapter or JsonSerializer/Deserializer (iirc the name)
without loading the picture itself, like HTML does
just check for entities around and damage them
sounds somewhat dumb
@ivory sleet dms bro
'PlayerDropItemEvent(org.bukkit.entity.Player, org.bukkit.entity.Item)' in 'org.bukkit.event.player.PlayerDropItemEvent' cannot be applied to '()'
why?
Yes but I can't call rn Grenade, talking w/ some others, please respect that
did you read the error
creating new event with wrong constructor?
static
ah it's not the constructor
https://paste.md-5.net/jihotutisi.cs this is my load items method
bc i want to set a custom amount of damage
it runs everytime the server enables
so
i presume this is what is causing the error
since loadmenus worked without this
no need for static
ok cancel the entitydamagebyentity event and damage the players by yourself in entityexplodeevent
good idea
I think i found my issue, there is something wrong with my main command not actually toggling on and adding/setting the player to the Hashset
veri pog
i'm just gonna use org.json to deserialize
or use the api 🧠
how
org.json is deprecated
ItemStacks are ConfigurationSerilizable
you can use gson to JsonObject for similar thing
^
gson does not work with deserializing item stacks, i need an alternate way to deserialize it
It does if you make your own type adapter
it does if you define an ItemMeta serializer
Or
what do i do with this info
You can save them directly to yml with spigots configuration API
json configuration api wen
*for legal reasons this is a joke, json is not a config language
oo md5 technically tho
mongo support when
an impl for it like JsonConfiguration would be nice
mongo storage api wen
thanks for volunteering
What about toml
mongo is for noobs
morphia integration when
not ini files
What about .png configs
omg true
genius
presuming no one else already prd it
Spigot config api is still bad
👀
Does it support jpg you reckon?
ConfigurationSerializable
.exe configs
Discord based configs
pretty sure Ive seen this before
no shot
though I mean gui configs are already super popular
unfortunately

Love you
And text files are hard
can i do rust with intellij
this is why mum doesn't fucking love you
vine boom
❤️
ok i will stop joking in help dev
bro wtf
You have a girlfriend choco, you don’t need purples love
MD however is single 4 life
Be careful that doesn’t change to 0 guinea pigs and a slightly fat cat
dw they'd be pretty hard to digest
anyhow will do once ya go thro the contrib license requests x)
they are fatter than base64 bytes
np
I guess Vasastan would be it, might have forgotten that but you got the street I live on, so hopefully enough 😅
ye it appears in google maps so good enough
how do i serialize my arraylist to yml
getConfig().set("test", list)
Assuming the list contents are serializable ^
this is why md_5 is cool
wow i spent 13 fricking hours on making a json when i could have just done that the whole time
p a i n
but if i wanted to put what i got into an array how would i do so
List.toArray
lists are better than arrays..... but list has a toArray method
toArray = very cring
no i mean the data it gets, how would i put it IN to that array
Cast it
since arrays are wiped after the server gets shut down
get(“path”) returns an object you can cast
(cast to List)
(Isn’t there also a get method that takes a class)
oh yeah
wanna date md_5?
Lol
getList(String, Class) or something
only if ur a hot grill
grill hmm
George Forman?
very hot
only for you 😉
getConfig().get("Menus"); ok so if i put this in onenable the arraylist menuitems would automatically get filled with the data in the yml?
menuitems = getConfig().get("Menus");
thanks
getStringList() would be better i guess
If it’s a string list
whats the difference between getList() which returns a List<?> and get() after casting it to a list?
you could use both
nothing
"Does not working" is a useless statement. Please describe what exactly is not working, what you expect it to do, and what actually happens. If you get any console errors, also ?paste the entire stacktrace.
we need to change that command
sorry
the bot command does not work
anyways
what's the database key in bukkit.yml? Can all plugins use it?
and how do i save / fetch bans from a database, removing the need of the banned-players file?
sorry
USE A PASTE
etf
i will i forgot
doesnt exist in spigot for like 5 years
i'll put 5 bucks on 1.8
oh appears I am slow in the head
what about the second part!
was on old buklit forums without bothering to check the post date
the second part is just using a database, up to you how you implement it
AsyncPlayerPreLoginEvent -> Check database -> deny login if banned
(and do that with a blocking task - the event is async)
i am stupid
can I prevent spigot from opening the file or will it just not have any sort of performance impact?
so I don't have to use the scheduler?
just dont use the file
reading an empty file on startup aint gonna hurt performance
good point
Yeah don't use the scheduler if you're accessing the database in the AsyncPlayerPreLoginEvent
hey Choco while you are here can you fix the notworking command for the grammar mistake?
notworking command?
?notworking
"Does not working" is a useless statement. Please describe what exactly is not working, what you expect it to do, and what actually happens. If you get any console errors, also ?paste the entire stacktrace.
oh lol
the first quoted part, is a mess lol
"does not work" I presume?
That was intended
yeah
I think its meant to be bad english?
^
o okay
same for any other Async events? (asyncplayerchat)
Yeah pretty much
I figured it meant to be Does not work, rather than working
"it no work"
Well, depends on what you're doing I suppose, haappi
If you want to prevent a player from logging in, that requires a block. If you're logging chat or something, you can do that async even in the async chat event without issue
Just an unnecessary schedule is all
Why is it illegal to implement https://hub.spigotmc.org/javadocs/bukkit/org/bukkit/inventory/RecipeChoice.html?
Most interfaces in Bukkit aren't legal for implementation unless otherwise stated
Ah
What purpose would you have to introduce a new implementation?
Are they going to be made sealed when sealed types come out?
Damn
I want to add custom recipes using ItemStacks and i want to have a less strict way to match the items which ExactChoice doesn't do
You can make use of a prepare craft event
And using the Inventory update event (can't remember the exact name) is kinda buggy
For Geyser users
Hm okay
if I remember it correctly, it is because the way how the class is converted to nms class
there is harcoded switch for the spigot classes
It's converted to an NMS class?
I think, that it is, but idk if I remember it correctly, I'll try to find it
What does that mean?
Ah okay
default RecipeItemStack toNMS(RecipeChoice bukkit, boolean requireNotEmpty) {
RecipeItemStack stack;
if (bukkit == null) {
stack = RecipeItemStack.a;
} else if (bukkit instanceof MaterialChoice) {
stack = new RecipeItemStack(((MaterialChoice)bukkit).getChoices().stream().map((mat) -> {
return new StackProvider(CraftItemStack.asNMSCopy(new ItemStack(mat)));
}));
} else {
if (!(bukkit instanceof ExactChoice)) {
throw new IllegalArgumentException("Unknown recipe stack instance " + bukkit);
}
//some code
}
sadly, when you look at the rest of the code, it doesn't pass the test function to nms, probably because it has non nms argument
Ah rip
Sadly you cant define custom Predicates for ingredients
MD has been asked about that
Something to do with how to handle them being attached to a plugin
Yeah, it's considered leaky
unregistering those recipes could be tricky because you dont know the context of the implementation
Is there no library that implements a simple interface to do this then?
Btw, Is there any way how to get LoginResult params forwarded by bungeecord without using protocol lib to listen to the handshake packet and parsing the host header myself?
I know, that I can also get the nms player connection and get it from the connection, but I need to get it already at the login state
when this runs on onenable, it doesnt put the yml data in the array
MenuStorageUtil.menus = (ArrayList<Menu>) config.get("Menus");
Please send full code. Join link, copy-paste your code, press CTRL + S and then copy the url of the link
?paste
alright
Thanks. i will try to help you
So let me ask again if i have understand, you have a runnable right?
what is a runnable? sorry i am new to spigot stuff lol
Sorry sorry i missunderstand onenable with runnable. My bad
Are you havign any inssue on console?
Ok, so you are just getting an empty array list?
yes
How you are saving menus?
by using the config.yml
config.set("Menus", MenuStorageUtil.menus);
(you can see this in the paste)
Allright
Wait, you shouldnt be saving on on enable
Like, you should update values (config ones) when important changes are done.
the config does not save in onenable
it saves when i use commands
https://paste.md-5.net/ihepugatuj.java (menu.java)
Allright
https://paste.md-5.net/efuzojehib.cs (menustorageutil.java), used for sorting
Wait how looks your config can i see and screenshot?
Allright and please check if content its save to the file
item-lore-visible: true
item-name-visible: true
Menus:
menuitems:
- ==: org.bukkit.inventory.ItemStack
type: REDSTONE_BLOCK
meta:
==: ItemMeta
meta-type: UNSPECIFIC
display-name: red
lore:- coolred
name: poo
size: 54
- coolred
all contents
You should use a Map<String, Menu> and when updating you simply put that new menu in the map.
ok
This way your findMenu, deleteMenu and updateMenu methods become each a single line
how would i do this, or, which class would i do this in?
I have a strange problem. When I use Allatori-8.0-Demo to obfuscate my plugin to level 1, the event 'AsyncPlayerChatEvent' does not work for me. Does anyone have an idea what this could be?
Instead of the ArrayList you simply use a HashMap
ok
is it possible to detect player collision with an entity?
You need to keep the annotation
There is no event for that. There are only some quite expensive approaches.
What do you mean?
The @EventHandler annotation. Keep it. Allatori likely removes it
Make it private final and non static
ok
What do I have to do so that he does not remove it?
how do i put it in config yml then?
And you should too 
If you want to have per player maps. But i dont know your data structuring so public static might work. Strongly recommend against that.
When I decompile the encrypted date, it looks like the whole method is removed
when paid plugin
I had a premium resource that was also open sourced 🙂
(keyword: had. I really, really dislike maintaining premium resources so I'm done with them now)
well i open source my free stuff
like when i modded fnf
i would open source that
but there is no point charging 40 bucks for a massive plugin when people can compile it themselves imo
anyways this is a help channel so i will stop talking
i dont rlly like doing premium resources
if im honest it makes me feel like im obligated to keep it updated
whats wrong?
i made an arraylist a list and now when the plugin enables the data folder doesn't come up
@SuppressWarnings("unchecked")
@Override
public void onEnable() {
getLogger().info("Enabling MagnificentMenus LITE by Magnumsrt!");
config.addDefault("item-lore-visible", true);
config.addDefault("item-name-visible", true);
config.set("Menus", MenuStorageUtil.menus);
MenuStorageUtil.menus = (List<Menu>) config.get("Menus");
plugin = this;
config.options().copyDefaults(true);
}
why are you supressing the warnings
also you dont have a savedefault for the config
is this using custom config or normal bukkit config
normal bukkit
i like to say if you need a suppress warning you might be doing it wrong
your going to want to do config.savedefaultconfig
^
the config will not show up unless you save it
if you have to supress the warnings then yeah something is probably incorrect
I remember Eclipse use to suggest the first thing to fix anything was suppress warnings lol
~2015 eclipse or earlier lmao
smart
btw anyone who needs to make an updatechecker but doesnt want to spend an hour on very simple code
heres a reference
enjoy an hour of your life saved
Kek
Java Coding Conventions: https://www.oracle.com/java/technologies/javase/codeconventions-namingconventions.html
fix. it.
Anyone remember the guy trying to make everything one line. This reminded me of that guy
its something i do lol
then unlearn it
it looks off if i dont put capitalization
yep. I knew a dev that lived by that (other than the one that u mentioned)
why would someone do that
it just makes everyones life harder
the grammar mishap doesnt affect my plugin so idc
Learn how to do it right because otherwise people are going to spend more time complaining about your convention breaking than helping you
^ this tbh
pissing off good developers with my terrible code is a trait of mine
It's not terrible code. It's the wrong convention
why do people get so salty over punctuation in something that isnt even suppost to be seen if you arent deliberately trying to access it
pissing of good developers by being a bad developer is a trait of Mine
its cause you aint following java conventions
Because if you ever need help you show it to people who know it. Or if you ever get a job doing it you'll be laughed out of any interview
too bad
Absolutely. You're also not forced to be right on a test
Java Coding Conventions: https://www.oracle.com/java/technologies/javase/codeconventions-namingconventions.html
except im far from the stage where i can get an actual job in programming
And you'll stay that way forever with that attitude
plus all this code is getting revamped anyways
so it will probably be corrected
if im not lazy that is
Also that javat articles whole point is that it's a convention not a rule because it will compile with wrong convention. It still recommends using them
needs to be fixed to use try with resources so that it auto closes out the connection when its done
convention fixed
i saw someone say that in bedwars once
no i cannot change UpdateChecker btw
NewVersion -> newVersion, localplugin -> localPlugin
cause i remember seeing someone mistake a constructor for a method
that person is just stupid
you can fix it to use try with resources though which won't change the method

also have u still not closed the connection or am I blind?
theres like a million other incorrectly named methods in the plugin
that is why I am recommending try with resources 😛
bump
but im not even gonna bother fixing those cause this plugin is getting entirely revamped
yeah thats the best frostalf
cause i havent got around to fixing that yet
it's one fucking line
cause of grammar.exe not found
i know im not dumb
grammar.dll was not found
lol
ignoring extension, booting up skygamez
apireader and new ver also dont need to be global vars but that aint the biggest thing
time for another episode of roast my code
Hey, someone can help me with scoreboard teams? Up to 1.12.2 the prefix in tab list colours the nick of the player, but in 1.13+ the name its in white 😦
why does my yml array look like this?
Menus:
- !!me.magnumsrt.MagnificentMenus.Menu
menuitems:- ==: org.bukkit.inventory.ItemStack
type: REDSTONE_BLOCK
meta:
==: ItemMeta
meta-type: UNSPECIFIC
display-name: red
lore:- coolred
name: placeholder
size: 54
- coolred
- ==: org.bukkit.inventory.ItemStack
The raw unprocessed data
how do i take out the bits that i dont want
Your going to have to first get the array
Then for the config part
You’ll have to take the array data
And put stuff in your yml file that is specific to each part of the array you want
Also I don’t recommend using yml for data storage
Use json
Use gson
it doesnt work with item stacks
It does if you make an adapter
yeah idk how to make one
Its just a matter of ItemStack -> String and String -> ItemStack
Can be done by either (de)serializing them Map<String, Object> provided by Spigot
thanks
or with an BukkitObjectOutputStream which produces a byte[] that is base64 encoded afterwards
Is there any easy way to take two chat colors , and a string, and turn it into a gradient?
Ive done it before, but I lost that code
Definitely is a way
Guy answered with a bit of code you can use
Thanks
It’s javascript tho
So u know make it work n all that
It also only gets 1 value for the middle but you can see how he converts the hex to rgb values and then u can just loop through each color
how would i use this in a method
How do I stop logging in console and direct it to something like a discord webhook instead?
Is it even possible to disable logging chat?
How can i get all players around a location in radius of 5 and if they are there send them a message saying you are close
World#getNearbyEntities()
Takes a Location and an x, y, and z radius
(and an optional Predicate so you can check if the entity is an instance of Player)
Thanks
I was trying to do the same he was asking. And no one give an amazing answer
@lost matrix sorry for the ping but i am trying to load the itemstack and other data from the same file, how would i go about this?
with your adaptor
help
What do I write in the commands.yml to make a custom /discord command?
I already tried this:
discord:
- "say https://discord.gg/spigotmc"
It prints in chat "[player] https://discord.gg/spigotmc"
I just want it to print alone the link, not to mention, the link is not even clickable??
Use tellraw
thanks
in luckperms, the permission for /discord would simply just be "discord" right?
Hey, I need some help with creating a multi-module Maven projects, I got an error while compiling with mvn package. It says "Process terminated", and I'm stuck right now.
Error: https://paste.md-5.net/acadumibay.cs
Source Code: https://github.com/aglerr/MavenModuleTest
I'm 27 and mature enough to talk retirement
If i have a custom item for a player and i want that item to damage nearby entities what would i use for that? i know how to get the radius around a player but not sure how to do it for an item that was placed
Mark the item with NBT data or something and detect the item when being placed.
