#help-development
1 messages ยท Page 1725 of 1
You have to turn it into a string
but
or just .toString()
get the ItemStack's itemmeta and store, apply the custom model data to it, and set the meta back to the item
ItemMeta meta = itemStack.getItemMeta();
meta.setCustomModelData(69);
itemStack.setItemMeta(meta);
np
what's the error message?
it should work fine, unless you are on some ancient API version?
NullPointerExceptionFactory
Oh it doesn't compile. Better cast it to something
yeah no idea why they always think casting fixes something ๐
they see red lines in their IDE and think it will work when the red lines are gone
Dog dog = new Dog();
Car car = (Car) dog;
but after all, intelliJ suggests people to cast stupid things sometime
unchecked cast 'Dog' to 'Car'
you're living in a parrallel universe
you def changed something in your warning settings then
cause i know that its included by default
but there is no setting about unchecked casts, or at least I dont find it
ah found it: Casting to incompatible interface
but I just reset the settings and its not enabled by default for me
lol no idea
it's even the paid version D:
What am i missing?
Bukkit.getScheduler().runTaskLater( damage.remove(), 100);
before damage.remove()
that won't work at all
then check the javadocs
?scheduling
runTaskLater's syntax is:
runTaskLater(Plugin, Runnable, Long)
or
runTaskLater(Plugin,Consumer<BukkitTask>,Long)
so basically
insert reference to your main class and wrap your "damage.remove()" inside a lambda, method reference or create a "real" runnable or consumer for it
if you don't know what a lambda is, just write this:
Bukkit.getScheduler().runTaskLater(myPlugin, () -> {
}, 100);
and then put the code that should be run later inside the { }. But a better way would be to try to understand what a lambda actually is. I used them for a year without knowing what I'm actually doing lol
does anyone have an idea on how I can make this better?
Right now the constructor takes two classes as input T and T[]. I'd rather have it to only take a T type but how can I get the generic array type of this then?
I love generics but haven't understand on how to get the array class type of a given T
I somehow doubt it's even possible
its not due to type erasure at compile time
sad
anyway, thanks, I used to spent hours on that until I settled with this ugly solution
how to remove the error (I hover over it idk what to do)
?learnjava
Here are some links to get you started on learning Java:
- https://www.codecademy.com/learn/learn-java
- https://www.sololearn.com/learning/1068
- https://www.learnjavaonline.org/
- https://programmingbydoing.com/
- https://docs.oracle.com/javase/tutorial/java/index.html
The last one is the only official one, however some of those concepts assume that you already know a bit about programming.
what is that even supposed to do
do you at least have a class called CustomModelData? ^^
It add CustomModelData to the item
so your question is "how can I add custom model data to an item?"
meta.setCustomModelData(69)
don't forget to set the meta back to the itemstack afterwards
add cast to what?
setCustomModelData expects an integer in like every version that I ever used
1.12.2 doesn't even have a setCustomModelData method
a guy lied to me
aaa
in 1.12.2 people used dirty workarounds
by overriding the texture for certain damage values
so what version 1.13? 1.16?
yeah... 1.12.2 is so much better with all the missing features
so, what do i have to put there?
a reference to an instance of your main class
I don't know your main class, so no idea
yep
didn't I already explain that you yesterday by passing your main instance using constructors?
yes
I mean static getters for the instance are also fine, but - you should stick to one thing and not do it like this today and then another way tomorrow
and i have it
either always pass a reference to your main class (when you need it), or always use a static getter to retrieve it. mixing both things up is like not very good
oooh
i just realized what i have wrong
nvm, sorry
ok, so ig this should work?
Yes
yes
"drink at your own risk" that reminds of something funny I found on quora
btw looks tasty lol
that doesnt hide the NBT tags
they are only shown because of the advanced tool tips
well the beetroot thing at least
๐ฆ feel like that should be default enabled in creative mode
yeah just checked it's really just F3+H
HIDE_ATTRIBUTES is for all those "Walking Speed +69%" I think
and the creative category
just add a bunch to a set
or just
add all effects to a collection and then do Collections.shuffle and get the first 3
just
Collections#shuffle ๐ฅด
You could also just use the array returned by PotionEffectType.values
<T> T randomElement(Collection<T> collection) {
if (collection.size() == 0) {
return null;
}
return collection.get(ThreadLocalRandom.current().nextInt(0, collection.size());
}
or hardcode 999999 possible combinations lol
I wouldn't use shuffle, personally.
that's basically the same as what I sent ๐
yes
I prefer speed over conciseness in most cases unless it really makes a difference in conciseness.
Why bother with the lower bound
But shuffling is much different from generating a random number.
be explicit!
Cache the array of Enum::values then use a SplittableRandom which yields an integer from 0 to index-1 would be my take (:
no
In fact when did random get a method that takes a lower bound
yeah I also find it better
What's SplittableRandom? :o
ThreadLocalRandom has it, Random doesn't
the two are very different
ThreadLocalRandom is for thread-safe operations as it confines the random instance to the current thread.
Doesnโt thread local random.current return a standard random
no
SplittableRandom is a random which can split itself whilst effectively where distribution is similar and randomness is dissimilar.
it returns a ThreadLocalRandom
no it returns threadlocalrandom ๐
current() meaning "current thread"
Thread local random should mostly be avoided
Ah I always store mine as a regular random
*unless you are working with thread-safe operations
Forgot extending exists
Do yall create a singleton instance when a class takes no parameters
public final class OnlyClassMethods implements Listener {
public static final OnlyClassMethods INSTANCE = new OnlyClassMethods();
private OnlyClassMethods() {}
// Methods
}
like listeners ^
You cannot reproduce a random behavior because the seed of the instance is bound to the thread
Layman's terms?
You can just use a SplittableRandom and invoke split on it
no
ok
well
not when I don't need it elsewhere
^^
SplittableRandom works good when it comes to parallelization
can you access threadlocalrandom in a different thread?
I love how someone just wanted three potion effects and now people are discussing about the (un)reproducable results of random, threadlocalrandom, etc bla bla like they are inventing a new cryptography thing ๐
Yea but thatโs not the intent of it
use SecureRandom :) /j
yeah, it would be horrible if people would know the exact server startup time to figure out whether they can eat this spider soup or not ๐
nandgame is frustrating
but uh yeah in all fairness, Jeff's impl is actually decent
I always use threadlocalrandom now ๐
get off my ide
thanks lol
SplittableRandom (:
although the fact it converts to array is... concerning
and also polymorphic methods exist
is 32 the max parameter size
I just needed it for exactly this purpose: get random enums etc
soooo nothing that would ever contain more like 1000 items
use the enum's values() array
(fun fact: did you know enums store all their values internally as an array called _VALUES? (at least, iirc that's the name))
I didnt phrase that right
like I have a list of 1000 strings, to get a random one
not just enums
just... a random entry from any collection
it's not meant for huge collections so I didn't bother to make the performance perfect, I just needed a generic method that worked
ohh
but if someone has a suggestion feel free to tell me ^^
actually you can't iirc
at least, you can't set it
there's specific checking for an enum's values array
I know this bc I tried to do that myself lol
why would you want to do that? ๐ฎ
expanding the enum's values :)
it's useful if you're doing some weird game mod framework shit
do you have any better idea? :/
Maybe with the use of unsafe?
yeah
you'd just have to get the field via getDeclaredField (if possible)
then get its offsets from Unsafe
Yuee
and then set it via Unsafe as well
Unsafe directly modifies memory as opposed to reflecting it
do you actually need to support other types of collections?
other than lists? yeah sometimes I have a Set of things or a Map
PlayerConsumeItemEvent
your item is actually eatable yes?
then what @young knoll said
are you also on 1.6? o0
Is it PlayerItemConsumeEvent?
oh yeah
sorry
it is
I didnt even realize when I googled it
btw how do you recognize your custom item?
like, how is it different from normal beetroot stews?
PersistentDataContainer
@eternal night is already replying lol
๐
?pdc
or this https://blog.jeff-media.com/persistent-data-container-the-better-alternative-to-nbt-tags/ @quaint mantle
the concept of null was the biggest mistake of programming languages to this point
how is it null-unsafe?
I always just use getOrDefault
yep ๐
the guy who created null coined it his "billion-dollar mistake," true fact
I love how PDC is like magic to so many people at first but everyone instantly loves it when they know it
simping for pdc
mainly bc null was a mistake that cost billions of dollars in damages lol
PDC wasn't magic to me
yeah I'd drink PDC's bath water
I just understood it as a way of storing data
tbh null can be handled so much better
yeah but another API way didnt exist beforehand
rust's Option is pretty fun
yes it is
unless you work with a version of Rust before ? existed
then use this:
in which case, have fun unwrapping your presents Options
how is the first tutorial outdated
what
it highlights the name chages from the previous API xD
read the entire article
yeah not that
I meant the first part
because he instantly went on to use customTag on ItemMeta and then said it's too much reading lol
:bruh:
Write what for you? There's literally an example for it in the text ๐
ItemMeta meta = myItemStack.getItemMeta();
meta.getPersistentDataContainer().set(someNamespacedKey, PersistentDataType.INTEGER, 1337);
myItemStack.setItemMeta(meta);
yeah well then
do it the disgusting way and check your item's lore to identify your item lol
Quick, someone get the lore changing plugin
RetardedAnvil: Adds a random lore from lore-checking plugins to all of your items
actually that would be a funny idea for anarchy servers
This is why you don't check lore
I'm bored, I'll write a PDCUtils class now
Write cool PDC types that we don't have
I already did that
A type to convert a location into a single int would be good too
with ExactChoice
Oh I thought ExactChoice compares ItemStacks
Not stack size
alright
How can I get all the valued entries from the list of items in the config file? I already retrieved the config file with FileConfiguration
items:
emptyBowl: BOWL
sword: IRON_SWORD
getConfig().getConfigurationSection("items")
then you can do getKeys(false) on that to get a list of all keys
Thanks
yeah that would be useful
I always just use Enums.getIfPresent instead
im here
to
repost
pls
i want to change the speed while the animation is happening
Didn't someone somewhere answer that?
Or maybe I'm confusing it with something else
oh well
I just realize
I already have a PDCUtils class lol
but I marked it deprecated because I didnt lik eit
we are all dead serious all the time
Material.matchMaterial is the preferred way iirc
yeah but most of the time I want to provide a fallback
so instead of having it null, I want to use just CHEST instead of sth and Enums.getIfPresent does that in one line ๐
Are you using an event or adding a ShapedRecipe?
Ah ok
That makes since
Sense
Lol I'm on my phone
Lol
Dark red title with red warning might look better
What is it for?
it gives 3 random potion effects IIRC
does any of you know how tf handles its own commandmap
i've searched the CraftServer DedicatedServer MinecraftServer classes
yet the best i found is the console command handling
do you want to know how it internally works, or just want to register your own new command?
internally
i already injected the commands i want to make injection more efficient since im wasting some resources rn by creating dummy wrappers
all I know is that the CommandMap is a private field inside SimplePluginManager called "commandMap"
that's everything ๐
fuck intellij cant search inside decompiled files
do u want to know about the nms or just the craftbukkit impl?
Anyone know how to damage a flint and steel?
get the item meta, cast it to Damageable
then set the damage and set the meta back to your itemstack
java.lang.ClassCastException: class org.bukkit.craftbukkit.v1_17_R1.inventory.CraftMetaItem cannot be cast to class org.bukkit.entity.Damageable when I try
wrong damagable
Wrong import
there are two
Thanks Obama
tip: read the full error ๐ when "entity" appears, it's probably not related to itemmeta ^^
i want to find NMS hook to craftbukkit commandmap
i think i found something on PlayerConnection class
I misread
public void chat(String s, boolean async) {
if (!s.isEmpty() && this.b.getChatFlags() != EnumChatVisibility.c) {
got it!
PlayerConnection.class
3 hours of searching
tons of classes
finally
yep
PlayerCommandPreprocessEvent event = new PlayerCommandPreprocessEvent(player, input, new LazyPlayerSet(this.e));
this.cserver.getPluginManager().callEvent(event);
there's our hook
quick question: what would you prefer here? Objects.requireNonNull or Validate.notNull, and why? (I can never decide and flip a coin then)
@Nullable
public static <T, Z> Z get(@NotNull final ItemStack holder,
@NotNull final String key,
@NotNull final PersistentDataType<T, Z> type) {
Objects.requireNonNull(holder.getItemMeta());
Validate.notNull(holder.getItemMeta());
return get(holder.getItemMeta(), getKey(key), type);
}
I use Objects::requireNonNull
i use Objects.requireNonNull
same
Validate is smaller visually, but Objects is part of standard library so I just use that
Just use both
lol
Validate::nonNull or Preconditions::checkNotNull require their respective libs which is annoying if you're working on something platform independent like both fabric, sponge and minestom
Architectury?
How do I interact with worldguard regions in my plugin?
ya
that's no problem, it's everything 100% bukkit and apache is included anyway, but yeah I also like Objects.requireNonNull more
but Architectury works via a combination of platform-dependent and platform-independent
thx
you specify a platform-independent API and then make a platform-dependent implementation
also you shouldnt follow how Bukkit codes its stuff anyways
One modloader just needs to start supporting the mods for the other :p
Bukkit is coded ass
cant that be done with architectury?
oh believe me
they're trying
that is what Architectury is
but yeah that's the goal of Patchwork
I've heard forge mods could run on fabric easily enough
without*
no lol (in response to Coll)
oh, yea, i didnt know if im late to this. But essentials has this mohist warning
im prolly super late lmao
PW isn't even finished
Didn't mean without any extra work, but apparently it wouldn't be too difficult
it's not even close to being finished I believe
oh it only supports forge and fabric though
does anyone have any idea why this doesnt run?
public void registerTimers() {
new BukkitRunnable() {
@Override
public void run() {
System.out.println("This should run every second");
}
}.runTaskTimer(this, 0L, 20L);
}```
i call registerTimers() in startup
because its queued to after the startup
the point of Patchwork is to allow Forge mods to run on Fabric Loader
At least fabric doesn't spend time freezing registries
yeh but it still doesnt print..
I adore Fabric
it is to quench the dying dreams of Forge fanboys who want to use certain Fabric mods
I havent used forge in years
you sure you actually called registerTimers() ๐
idk why
fabric can suck their useless refactors lol but else its pretty neat
oops
your code is not thread safe
are u doing that inside a loop
?
whoever just sent the ConcurrentModificationThing:
A lot of devs won't port to fabric so /shrug
you were adding to the collection while looping over it
like what?
ConcurrentModificationException means that you're executing non thread safe code
ohh
removing but still
How else can I do it?
Need to use iterator for that
didn't you use something like HashMap.put() inside the screenshot you removed?
@ivory sleet what refactors are useless
that was wrong screenshot
how do the exceptions for thread safety work tho now i wonder
oh
who throw and how throws that
in this situation, use an Iterator instead
https://github.com/bernie-g/geckolib/issues/148
https://github.com/FabricMC/yarn/pull/2131
so probably not useless but it isn't nice since it broke gecko lib during test env
How else can I remove while iterating?
e
That might be ListIterator
could be
Iterator<YourThing> it = YourCollection.iterator();
while(it.hasNext()) {
YourThing thing = it.next();
if(whatever) it.remove();
}
eh, that's just a problem with Yarn
or simply
YourCollection.removeIf((thing) -> ...);
yeah
Yeah
but many fabric mod devs use yarn tho
Yarn is still a nicer set of mappings over MCP imo
i was about to copy that
if you still got questions about that better make a thread
MCP is dead anyway
so it is and was a problem still
this chat is being very fast paced rn
there was a continued version iirc
Mojmap is cool but you can't use it if you want support in Fabricord
and iirc mojmaps doesnt map param names
Not like forge is using it anymore
probs
Tiny is a decent mapping format
although it could be made smaller
We can mojmap all 3 platforms now
Yeah
It is truly the future
Using parchments makes mojmaps acceptable
tbh i think forge will die someday
but I'd rather just stick with yarn
Fabric is good enough and flexible enough to beat forge
in which it becomes a problem due to the random and excessive refactors
I am trying to kick a player who is logging in if they have not accepted the server resource pack. However, if I try to set a message, it will not work, as if the player is kicked too fast they get an IOException message. I'm pretty sure this is based on ping. One solution would be to kick them a few seconds later (I don't like this, as it still shows them the world around them among other things). What is a better way to deny a player connection if they haven't accepted the server resource pack?
When you have a project that runs on 3 platforms, using the same mappings is very helpful
yeah true
?jd
?jd-s :p
That's for me np
it's also just nice to use the same set of mappings for any of your platforms since it means you don't need to re-learn mappings every now and then lol
1.17 has a server.properties method if you didnt know
(just reminder)
On 1.16.5 for now ;/
but otherwise do what is suggested above
Before we had to switch between MCP and whatever spigot used
I've never seen that event o.O will try it out, thanks
apple
Is it there something related to criticals hits in javadocs?
hmm I think you can calculate whether it is a critical hit or not
And something related to change how crit hits are executed?
I mean instead of jumping like chance or smth like that
"In melee combat, a critical hit occurs when a player attacks a mob while falling, including while coming down from a jump, but not while jumping up. The attack deals 150% of the attack's base damage (after strength is applied and beforeโ[JE only] / afterโ[BE only] enchantments or armor are applied). "
Easy enough to replicate, not so much to detect
But is it posible?
Not from what I can see
And change the crit damage
Not from what I can see
@young knoll well, so hypixel doesn't use spigot ig
Hypixel uses a modified version of spigot
I see
1.7.10 iirc
And plenty of NMS
Well i will gather more informaciรณn about crits to see if it is posible
I remember a dev saying they use the NMS itemstack because the bukkit one has too much overhead
How can I obtain number behind two dots? 139:1
sounds plausible actually
Split on ":" and parseInt
someone should benchmark the two
I think someone called Auxilor did
Yeah but I have only item
Or don't use the old numeric ids :p
I feel like I recognize that name
Then what can I do?
What is your goal
Yeah, former spigot user, now a full-time polymart guy /s
?paste
but he left this discord when we got rid of some trolls
mind sending me his benchmark?
let me see if I can find it
Basically I want to obtain item's type and store it in file. In case the item is Yellow wool it will be stored as WOOL and it will need some kind of "byte" to make it yellow.
the trolls were annoying af
getData.getData
Yeah it's like that, lemme try it
Is that where lax went
trying to use the ConfigurationSerializable (https://paste.md-5.net/otipawixol.java, https://github.com/WizardlyBump17/WLib/blob/main/core/src/main/java/com/wizardlybump17/wlib/config/Config.java) but it is giving me it:
oh he just used some System::nanoTime and compared iirc
eh that's fine
you might just benchmark it properly
I just wanna see his code
I'm not used to NMS ItemStack so I'm curious to see the differences
and whether it actually is faster
https://github.com/Auxilor/eco here's the code
still cant find the tests he made Ima ask him sec
@young knoll it's working, thanks for help :)
okay so maow he doesnt have it stored but apparently way way faster
Ludicrous Speed!

damn that's cool
oh me neither lol
Works perfectly and a lot cleaner. Thank you ๐
you havent registered your main class instance as a event listener first and foremost
you never yielded an error to console to begin with
so no doubt it wont pop up an error
he means an uncatched exception
How can you be charging people money when you canโt even register a listener :/
As if you have never forgotten to register a listener
charging people with money?
you're under arrest for money
๐ญ
๐
too drippy ๐ฅถ
Did ya forget an API version
Literally has a store link in the lore
Is getStringList("items"); the correct syntax to retrieve this list for a yml file? Or is something wrong with the YAML file itself?
items:
- emptyBowl: BOWL```
And yes I never have itโs the first thing you do :/
Well
That is not a string list, it's a section
A string list looks like this https://github.com/Coll1234567/MineTweaks/blob/master/src/main/resources/modules/wandering_trader.yml#L14
So for it to be a list it has to be like
items:
- Bowl
```?
yes
Beans
A better version of Vault
possibly
Make it such that we can choose what data type the currency can be, make it also platform independent and a good framework with base classes for making a thread safe implementation
Heya could anyone help me out here. I created a wrapper interface, which is used by both wrapper_12 and wrapper_17
In wrapper_12 there's the following code:
@Override
public ItemStack getSkullItemStack() {
return new ItemStack(Material.SKULL_ITEM, 1 , (short) 3);
}
and in wrapper_17 the following code:
@Override
public ItemStack getSkullItemStack() {
return new ItemStack(Material.PLAYER_HEAD);
}
This works well, except when I'm trying to build the jar. Then I get the 'cannot find symbol' error. How do I fix this?
yes you have
when
always
Listener is an interface
o
JavaPlugin serves kind of like an interface sometimes
CommandExecutor and TabCompleter also
oh yeah
i sorta understand how they work
WTF
if (SpigotConfig.replaceCommands.contains(wrapper.getName())) {
if (first) {
this.commandMap.register("minecraft", wrapper);
}
} else if (!first) {
this.commandMap.register("minecraft", wrapper);
lmao
lol wtf
this adds minecraft commands into bukkit commandmap
spigot needs a recode
might be due to decompilation
but commandMap returns null for these commands
^
So command api in NMS is completely overriden
even brigadier emulation of vanilla commands is done via bukkit command api
it utilizes Bukkit's VanillaCommandWrapper
An empty interface at that :p
to register commands in commandwrapper
don't you have a fuckin' Services Recruitment post?? how have you, a ""professional"" Java developer, never needed to make an interface?
lol
iโm not the dev there
i have a team
how are you in a dev team, when you've never created an interface
iโm not in a team
i have one
???????
he's the ceo of the team ๐ฐ
that means you're in the team tho
yes
if you are the owner of a team, you are in the team
i donโt code for the team
what...
i manage them
ye
and do marketing stuff
that still means you're part of it
business manager ๐ฎ
yes
I considered myself part of one of my old dev groups since I was the "Leader"
not spigot
Bukkit
bukkit itself is a fuckmess
Spigot just continued it for support for later versions
yeah bukkit was bad
Are you volunteering
nope bc nobody would use it
its not spigot's fault really
PulseBeat_02 I am estimating a full recode in 2 months thanks /s
๐ฅฒ
Bigot*
yeah git out or we commit murder
lets all be friends :p
it's Maow, I changed it like 1-2 years ago
unfortunately I don't find spending $10 to change a username a worthy usage of my money
I could change it but I doubt Im allowed to on my own
(in the dicord at least that is)
iโm gonna go clean up my discord server list lol
not if you're verified
it's $10 to change your Spigot username :p
did that last month lol, went from 200 to 20
and your Discord nickname must == your Spigot username if verified
oooo
nope
what is the point of it
contributing to open-source repos gives me anxiety
fair
too*
thx
Did u get a shirt
RIP
yeah lol
you can just pr for your friend's repo and ask them to add hacktoberfest label
lol
contributing to open-source repos gives me anxiety
How do big servers like hypixel roll out a plugin update without having to reboot their entire network?
I only have one programmer friend and all of his projects are way too complicated for me
they use docker first of all
Their servers reboot all the time anyway
secondly they dont do it all at once
its not like all of them reboot at once
they do it gradually
ohh
so there are fallbacks
wait, there is jdk 17
cope
he's got:
- Robotics shit
- Minecraft-in-Minecraft Fabric mod
- 3d game that utilizes a Rust-based Vulkan renderer on top of some Kotlin/JVM logic
ah, thank you!
i need a chiropractor
they have many backend servers haappi, in which they only shutdown some at each moment to update those
hello
greetings
im using the configuration serialization api
but when im trying to get an object
it is returning null
Why do u delegate serialization to itself lol
'-'
How Brigadier communication works in Spigot:
โข Craftbukkit implementation completely overrides brigadier parsing from PlayerConnection.class to its own Command API algorithm (PlayerConnection.class)
โข NMS adds commands to brigadier's command dispatcher
โข Whenever server launches, Spigot grabs CommandNode objects from Brigadier's command dispatcher and uses setVanillaCommands() method inside CraftServer.class to wrap those brigadier commands into Bukkit's command objects and add to its own CommandMap (not sure which commandMap contains the vanilla minecraft commands, because the plugin commandmap returns null?)
How Brigadier tab completion works in Spigot:
โข CraftBukkit implementation completely override brigadier tab completion from PlayerConnection.class to its broken tab completion api. Tab completion search algorithm of brigadier is completely disabled, not even implemented. (BukkitCommandWrapper.class)
โข When plugin gets enabled, all of its commands are grabbed from CommandMap via enablePlugins() method iirc
โข Method syncCommands() from CraftServer.class is executed which adds BukkitCommandWrapper brigadier wrappers of bukkit commands to datapackResources command dispatcher.
โข A commands packet is parsed async and sent getting sent via main thread to all players about the new commands. (in CraftServer.class somewhere)
โข Every time the player writes a tab completion packet is sent to the player manually without any brigadier nodes. (Not sure about this, need more info).
This needs change, it just so hacky and feels very strange. They should make some kind of converter for old command api to the brigadier because this api sucks
Maybe a pr?
Don't you dare suggest a PR
Bit late for that
Lynx ur back!
removed it and it did not worked
pls dont hurt me lol
it make take a year but I mean :x
also isn't it getSerializable()
๐ Seems like a horrible amount of work especially if the community has already figured out/build more frameworks that do a lot of stuff better/the same as brigadier
yeah true
only real issue is tab completion no? tho I am not too up to date on latest command frameworks
e.g. brigadier colouring
It doesnt use any node system from brigadier at all
and argument tokens
Why does this not work?
Its being called
that was big
or a better bin
should work?
it doesnt even use run() method
looks hacky
it just there as a dummy impl
lol
like
Maybe you could pull a generator API move
nothing looks wrong with it
Tazi weird, I mean should delete any flint and steal with the amount of 1
oh
and actually full deperecate the old command framework
still rewire it
No it tries to remove exactly 1 flint and steel
and just expose brigadiar
well ig i have the wrong code anyway because i need it to delete only the first flint and steel
tho brigadiar alaways has the issue of, it is impl detail technically
mojang could jank it out next release
nothing we can do about it
its not that easy, but i was surprised that vanilla commands are actually ran through bukkit command impl
i thought it was a separate handling
but that explains why /help commands has mojang commands in it
oh like creating abstractions for their commands or wym? (similar to how they abstracted lwjgl or whatever its called)
Well, it is a library they ship. I don't think there is any reason they would move away from it. But they could and at that point spigot would have to implement a compat layer from brigadiar to whatever they use then
oh yeah true
it will only remove one totally new flint and steel, not damaged ones
but yea, open a PR
ohhhhhhh
grab some feedback from the md_5
the

the max you could do from this is to create some sort of automatic tab completion generation


I'm deleting certain items from the world as soon as they are dropped using the following:
if(Boolean.parseBoolean(droppableItemInfo[1])) item.setAmount(-item.getAmount());
Is there a better way to do this, as 1 ghost of the item is visible when dropping
there we go
because node system would be a drastic change for commands in spigot
if everything in java is a pointer, why is storing high memory objects in collections bad? are they copied?
.remove()?
what is this in reference to
im just asking
ah I see
well, it's a strong reference
it would only be deleted when the collection is deleted (as that clears up the final strong reference to the object)
but if the collection isn't deleted for the lifecycle of the program, then you have that high memory object for longer than you need
well a lot nicer if the GC cannot remove a UUID compared to a Player with its whole world and chunk data referenced
yea
so if the object is no longer referenced, its still held in memory
i didnt think about that
like?
WeakReference
basically, the GC ignores WeakReferences
if one remains, it will still start collection if no strong references remain
there are some collection impls I've seen that use weak references
The world part of a location is a weak reference
believe soft references may also lose their referents
if jvm is running low on on heap mem
or smtng
๐
SoftReference is "don't GC ever unless running out of memory"
yeah
and then there's also PhantomReference which is "add reference to reference queue before GC"
yup
it's meant to be an alternative for finalize
finalize is a nightmare
since finalize got deprecated due to being somewhat unsafe in some cases
I believe Cleaner (internal in Java 8, public in Java 9+) provides an abstraction for PhantomReference?
take that back :gun_fingers:

@Override
protected void finalize() throws Throwable {
while (true) {
Thread.yield();
}
}
๐คก
indeed, pink LynxPlay would look great
this is stored in a Set<Region>, the destroy method would clear the rules, unless clearing the set would delete the object anyways?
Set<Region> set;
set.clear();
yeah I believe so
dumb question again
clear sets all values to null iirc?
i got brainwashed by c++
yeah maow
(also you can Region extends Closeable if you want to support ARM syntax)
I can see maow and conclure as data structure profs in their 60s
Boomer

^
arent you as old as me? almost
maybe a requirement for discord helper
do you mean that's how you see us now (as in you see us in our 60s) or that's how you'd see us in our 60s?
how I see you now xD
#general message
Conclure I'm old
Dang kids
poomer
z o o m e r
You see
I can see LynxPlay becoming a professional open source maintainer in his 60s :p
either of the two work
lol
cursed
I can see LynxPlay being the next Aikar after being paper mod ๐ณ
w- that's not legal??
what's more interesting is that minecraft commands are added to the commandMap later than any plugin's commands
wait is that legal in newer versions
oh didnt know that either
trying to get minecraft commands in onEnable() override would result you getting null
do you guys remember vipershow?
yea
what happened to him
idk
he lost motivation
so you'd have to queue a defered task that runs after startup then dovidas?
im really only here for the community
ok that is definitely not valid
did you call me lynxplayer xD
lmao
yea i guess?
oh fuck
interesting tho
vanillaCommands are added to commandMap whenever all of the plugins commands are added
Nope never happened
perfect xD
I'm here for the community (since y'all are more chill than either of the 2 popular modloader communities) and advice (that I shall steal to become Spigot's best paid plugin developer)
oo
paid plugins ๐
thats a big commitment certainly
๐
Have you considered time travel
wish we could turn back time
"yOu ShOuld Be EnJOYinG yOUR yOuth" -Quora
b-but I enjoy programming
being paid to do what I love is enjoying my youth
let me make money too
just give me fucking advice I WANT TO KNOW HOW I CAN MAKE MONEY WHEN I AM NOT OLD ENOUGH TO APPLY FOR A JOB YOU FUCKERS
to the good old days
when our mama sang us to sleep
but now we're stressed out
But now we have crippling depression
yeah that's pretty much the moral of the story lmao
WAKE UP, YOU NEED TO MAKE MONEY (yea)
Hey you, you're finally awake
death to you
You were trying to make money, along with that thief over there
my theories were true ๐
dovidas damn so 3 hours investigating this?
yes
nicely done
thanks
weather
yeah I did create a thread for this solely
Minecraft Weather Channel
there's really no way to use brigadier properly on spigot
:p in case we need some references
What's the forecast at time 1200?
Commodore...?
^
that's the thing
ye
oh I see what you mean
y'know the whole Spigot/Bukkit separation is very confusing
every command, even brigadier commands are going through bukkit command map
my life is a lie
Is there a way to keep doing something for as long as the player holds right click?
Not just once when they click
does the game send a hold packet?