#help-development
1 messages · Page 1914 of 1
I think that is his equals()
wow xD
shall i count that?
public static boolean equals(Object... args) {
Validate.isTrue(args.length % 2 == 0);
for (int i = 0; i < args.length - 1;) {
if (!args[i].equals(args[i++])) return false;
}
return true;
}```
static equals O.o i would rename it
wont u need to override it
i dont know if it would work
im making like an utility method instead of doing stuff like this
its fine but the name is already used
See Objects.equals
equals is perfectly fine
only takes two params x
I wanted to say that it is perfectly legal to name your method like that
lemme try to run that code
lol wtf
it works 👀
Why does it only accept an even number of args
because its supposed to work with pairs
Ah
I see
i think its ++i smh
intellij.
How do i make this spit out the actual documentation again?
are yo uusing maven?
ye
pressing shift twice doesnt do that
check this
go to any bukkit file (decompiled)
then at the top "Download Sources"
or just
pres sshift twice
enter "Download Sources"
then choose "Sources AND documentation"
idk if it works for spigot, but it should work for spigot-api
thanks that did it
i see alot of utils
i needed to click on 'edit sources' tho to get that bar at the top
cant you ctrl click it?
How can i build my plugin without maven or gradle?
i can but the bllue bar with 'download sources' doesnt show up that way
it's a library 😄
why do you want that
that's like asking "how can I fly a plane without altimeter, navigation and autopilot"
yeah 😄
just dont make a plugin lol
If you're asking this question, it means you, yourself, cannot build a plugin without Maven or Gradle.
I could walk you down the complicated path of manually compiling shit with javac but you don't want to do that.
And I don't want to do that either.
is because my mcdev plugin only gives me the option to start a project from the template for 1.16 <
i didnt want to mean that
well you can easy modify the result of creating it with that template O.o
or just like
you just need to know what the pom is if your using maven template
modify one line in your pom.xml or build.gradle 😐
What mcdev plugin is that? If you're using that Minecraft development plugin on intellij, it might be time to update it
Because the newest version does support 1.18
maybe is that
ty
How do I
A good question
get the direction of a block on a blockplaceevnet
How do you?
If I knew how i do i wouldtn ask
How can i implement JDA with maven?
By adding it as a dependency
no but fr
how do i turn that in a .class?
just use SlimefunItems.class
Okay why did you want to do that
i am editing slimefun items to be in portuguese brazil
this is in english, but when i traduce i want to know what to do
WHAT THE HELL
You need to download the entire slimefun peoject, then edit the file and compile it again I guess
Are they not open source?
They are
Lmfao
ye
Just change the source then compile the whole project
870 lines smh
You can't compile 1 class file
ohh
look at what's inside 😳
With all those depends
it scares me
Don't look at my GitHub bro
is it worser?
You download the source change it then build the project
Download intellij, download the github desktop app. Then clone https://github.com/Slimefun/Slimefun4.git using the github desktop app. Then open it in intellij, change the file and build it
OMG I HAVE NEVER SEEN SO MANY IMPORTS IN MY LIFE
is this what it feels like to mod?
Yes
what is this BUS thing?
Event bus
ai ai ai
wow
are you BR?
the only part I understand from this line of code FMLCommonSetupEvent is F my life
daannnnnnnngggggg
and what does this 500 lines of code do?
br?
It gets worse when you get down to my new branch where I'm cleaning up all the code https://github.com/MikeTheShadow/VoluminousEnergy/blob/1.18-exp-tile-rework/src/main/java/com/veteam/voluminousenergy/blocks/tiles/VoluminousTileEntity.java
I added a tonne of comments to help tho
The people who made forge are way better for example
ok... @vocal cloud how did you learn modding? I want to
portuguese brazilian
no i'm not
português brasileiro
point
because "ai ai ai" its normally a Brazilian slang
idk
I just did it. Me and a friend started the project then he worked on it for a year without me and I've come back to clean it up and optimize where I can
dang
to use intelliJ i need a licence?
any good resources that could help me learn modding?
if you use the premier edition
the community edition is free
?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.
Mcjitty has some great tutorials but you really need to get good at design patterns as well or you'll end up like my friend did with me coming in and removing 6000+ lines of code with 0 functionality changed
pls give me the link :)
well... some countrys?(maybe all) like germany have something thats called "Github student" .... with that you get a lot shit that is to expensive for students for free (as long as you go to school/university)
thx u
I mean use community you're just changing a few lines of text to Portuguese then compiling
Not like you need flight recorder or any of the more powerful tools
wait what ? O.o
? That's what the guys doing
<maven.compiler.source>8</maven.compiler.source>
<maven.compiler.target>8</maven.compiler.target>
<encoding>UTF-8</encoding>
</properties>```
fixed 🔨
what do vanish plugins do when the allow you to access chests? like your velocity is like in spectator and your hands dont show but you cant go thru walls
they actually put you in spectator
or invisibility effect ^^
thats why most of them dont allow you to edit the chest
then you would have the chest open effect but yea
example ?
i should take a look at the sourcecode
if you "bug" when trying to go in walls its mostly spectator mode but in a special way
you dont like lag back
its like youre in creative or survuval
the wall's just solid
do you can see your hearts ?
no
the ui is like in gmsp
but you cant go through walls
its super weird
try it
supervanish does it
I know this is a really stupid question, but what method works like #giveExp but also takes mending in account
spawn exp-entity on player location 🤡
I know that there is a dedicated method for this, but I cannot seem to find it
But perhaps I was looking at the paper javadocs, that would explain it...
I created a Multi-module Maven project, and I'm using remapped-mojang. When I try to invoke a method which includes remapped-mojang things from different module, I am getting error like:
cannot access net.minecraft.advancements.AdvancementFrameType
incompatible types: net.minecraft.advancements.FrameType cannot be converted to net.minecraft.advancements.AdvancementFrameType
yep, I was
it returns if youre in spectator so i guess you're not in spectator
same with some other things
however for some things it seems that you enter spectator
maybe just packet to send player in spectator
i dont get any wiser of it lets just take a nap
Is there a dev build of Protocollib for 1.18 available on maven?
Just use 4.7.0
Will that work with 1.18?
yes
Aight thanks
Hello i Play in a spigot server and Many farms doesnt work how i can fix it
is there any way in spigot to load world folder without using external plugins
i can tp to other world via execute command but im searching for a way to load it
i just don't want to use multiverse
The bukkit API should have a way to do that
yeah but i don't want to create hardcoded plugin just for this
Inside an Inventory holder class how do I access the player, for example if I wanted to get their playtime in a lore?
well then no, not possible afaik
Though datapacks might be able to do it, but that'd be the same as vanilla
the inventoryholder itself is just a interface, you should have an eventHandler somewhere to run when someone opens an inventory, and then get the player from the event. https://hub.spigotmc.org/javadocs/bukkit/org/bukkit/event/inventory/InventoryOpenEvent.html
https://www.youtube.com/watch?v=dEwv7ay1RCI
Yea I do already but from that I wouldnt be able to set the lore or not?
what do you mean by "set the lore"?
Do you mean a player inventory
I don't get what you are trying to do exactly
Maybe im just dumb :D
Okay okay,
So
In an event you can do
e.getPlayer
and from that get all of the players things for example their playtime
but in an InventoryHolder class you cant do that
hope that clears it up
I want to access the player
when do you want to access the player
If you look at the inventory holder interface, is just has 1 method: "Inventory getInventory();"
there is no way of getting the player no
Construct a gui based on player stats, and then open it
https://paste.md-5.net/oburomobaq.cs
where it says lore add under shards is where I want to be able to input some player data
you need to pass the information of the player who opened the inventory somewhere.
how does one open that inventory
through a command?
yes
cool
You will have to create the items from the inventory when the player runs the command, not before. when the command happens, you pass the player who ran the command to the init function.
then you can do whatever you want with it
hm okay I have no idea how to go about it but I'll figure smthn out
oki
what I have:
@Override public boolean onCommand(CommandSender sender, Command command, String label, String[] args) {
openYourInventory((Player)sender);
}```
of course you need to check if its a player and that stuff
Hello, quick question, a HashMap like this: Map<String, ItemStack[]> map = new HashMap<>(); can possibly cause a memory leak?
Thanks for the quick answer
Though, with that being said, I still recommend encapsulating ItemStack[] into its own class as it gives you more control over the code 😛
Nono, That String and ItemStack[] were an example. I was wondering if HashMaps that hold other stuff than Player such as ItemStacks or Strings and so on can also cause memory leaks, that's why I asked
well
generally
if an object allows mutability
which means the state of the object can be changed
for instance:
class Obj {
int i = 1;
}
can be considered mutable
since we can change the value of i
in this case, it is generally not safe to use Obj as a key for a map such as Map<Obj,ItemStack[]>
now in this case it is, as you get yourself an identity hashmap implementation
this is why we always use Vector::clone, or Location::clone when putting it as a key into a map (namely, Map<Vector,V> or Map<Location,V>)
Damn thanks for the great explaination
anyways the general idea is that, once an object has been put into a map as a key, the hashCode() of that object must NOT change
and since String is immutable, they are fine as keys
Now I know why Player in a HashMap causes memory leaks sometimes
So saving UUIDs instead of Player in a HashMap cannot cause memory leaks?
I mean generally speaking
I totally never actually thought about that tbh
memory leaks mean that you have some object which:
- Cannot be enqueued to garbage collection since it has some strong reference to it
- However you cannot manage this strong reference on demand (for instance if some array contains this object in the HashMap but there is no way of fetching it from your side)
Edit: the object is simply unreachable for garbage collection, and is unreachable for you, thus it just floats around in memory purposelessly.
Oh hi poreyy :)
Hi :)
Ngl, I don't like using ArrayLists and HashMaps a lot because I might do something wrong and that will lead into a memory leak
Well conversely, Java is incredibly slick when it comes to figuring out what objects can be enqueued for garbage collection. Anyhow, use a profiler maybe (to detect memory leaks)?
Yeah it's been a while
I've heard about profilers a lot so yeah xd
Okay now I'm better at java
That's good
Last time I said that and I was still so bad but now believe me
I've been learning Minecrafts codec system today
dataupperfixer?
Yeah
I tried understanding it before, quite advanced ngl
or well lets say, overly functional
I've only just started so far it's looking quite neat
What's that exactly
But yes very over engineered
Yeah Olivo, if you know some basic ideas of category theory it will make it a lot more understandable btw
🥲
?spoon
Spoonfeed a newbie for a day and they'll come back with more questions. Teach them to find their own answers and you'll both be better off: you won't get stuck answering the easy questions and they'll be much more productive than before.
What’s a good default size for a connection pool
In MySQL?
Yes
1 million
What's the default one
more threads are better, dont you know
Fair enough
Found this if anyone fancies a reading https://github.com/brettwooldridge/HikariCP/wiki/About-Pool-Sizing
question: how are CommandExecutors handled internally?
e.g. if I've got
command and
command subcommand, and I enter command subcommand, will it be processed as command with "subcommand" as an argument, or?
yep
what's the difference between FileConfiguation.set and FileConfiguration.createSection
like can't I just use .set(path, myMap) and that would be the same as createSection
interesting, thanks
is there some tool to see all packets sent from the server to the client
Hello I am having a problem with skript. I am making a rank paper which when right clicked on gives you a rank but the rank papers name is &7&lIron Rank Paper so when I put:
on rightclick holding a "&7&lIron Rank Paper" as a event it says error even without the " so I don't know how to make it work. Here is all the code :
on rightclick holding a "&7&lIron Rank Paper":
if player doesn't have the permission "iron.rank":
execute console command "/lp user %player% parent add iron"
remove 1 "&7&lIron Rank Paper" from the inventory of the player
if player has the permission "iron.rank":
send "&4You already claimed this rank" to player
Ask in the skript discord
Hi, I want to edit the major positive gossip when opening a villager trade menu using Protocollib but I can't seem to work out how to do it/which packet to listen for. I made this work a few version ago with nms but wanted to use protocollib as it seemed to promise cleaner/more understandable code.
Does somebody know how I can do this?
lmao command's "set permission" method returns void for some reason
everything else returns the command for chaining
Whats the best way to check if a sign is on a block?
And get the block that the sign is on
I saw this but it doesn't work from what ive seen
Sign s = (Sign) block.getState().getData();
Block attachedBlock = b.getRelative(s.getAttachedFace());
Bumping, would like to know if it's possible to have a full automatic release from GitHub
bunp
Yes
It's called github actions
yep but I havent seen any spigotmc github acitons
yep
If it doesn't exist, that'd be a nice project to do
then set your spigot download to the link to that workflow (https://nightly.link is a good tool for this as users won't have to login to github)
bc you can refer to an external site I'm pretty sure
does that work?
Wow, thanks! I'll configure my GitHub Actions to upload there, didn't know people had to be logged in to download release/build artifacts!
True
I bet you the Spigot API doesn't allow you to make a release
there's a web api im pretty sure
and I've scanned this discord and most of it is basic GETs
not anything that'd let you change the data
rip
you COULD just link to the github
as the download link
link to the github releases page?
Put full releases on spigot manually
And then link to dev builds in the description
On Jenkins or whatever
anyone?
Villager Gossip Protocollib
Can't you just check if the Material of the block is OAK_WALL_SIGN (or any other wood type) or a normal sign
Then use the blockface to get the block as you already did?
if sign is sign, get block below sign
Yeah
this doesnt work, It couldnt find the block face
I need to get the block that the sign is on not the one below it
The way that I said didnt work
oh then yeah block face
Define "doesn't work", do you get an error? do you get the wrong block?
use org.bukkit.material.Sign instead of the org.bukkit.block.Sign interface (the Sign class is deprecated tho), or change it to Directional and use getFacing().getOppositeFace()
So it would be
org.bukkit.material.Sign s = (org.bukkit.material.Sign) block.getState().getData();
Block attachedBlock = block.getRelative(s.getAttachedFace());
// or
Directional s = (Directional) block.getState().getData();
Block attachedBlock = block.getRelative(s.getFacing().getOppositeFace());
org.bukkit.material.Sign is deperciated
You need to use sign along with the type so OAK_SIGN
alright, im a still a bit confused so ima do more research and stuff
but this all kinda helps
What are you trying to do figure out if a block is a sign?
no, I wanna check if there is a specific block that the sign is on
I already have a check for if its a wall sign
I just need to find the block its on
ah
so i have a command class, smthn like this
public boolean onCommand(CommandSender sender, Command command, String label, String[] args) {
Player player = (Player) sender;
String testVar = args[1];
}
how would i access “testvar” in a different class?
Hi! How would I check if a player pressed shift while gliding?
I know how to do gliding, but idk if I can check if shift was pressed
pass it as an argument
howww 🤕 im dum
make a getter?
?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.
class A {
private final B b;
public A(B b) {
this.b = b;
}
public void doSomething(String something) {
b.doOtherThing(something);
}
}
class B {
public void doOtherThing(String something) {
System.out.println(something);
}
}
oh sorry, i thought that was a constructor
you dont know that
then learn java
pass it as an argument is what you should understand when you're trying to make plugins, unless you jump into plugin development without any basic knowledge
you should stop doing that, at least must know some basic java first
?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.
Here is a pretty good example
AMP, gross
I think that learning how to use an api before the laguage concepts/basics is the worst thing a human can do
if you know the basics, you can just grow from there (though it will still gonna be very slow), instead of starting with nothing in your head
Bump
couldn't agree more I through myself directly into the spigot API at full speed without any programming experience 😭
Im not lying
Cuz first when I changed from programming minecraft script (The one for Skript plugin) I started directly using the apis of spigot and bungee. Without knlwing the basics of java etc
It was the worst thing I ever did
looking back at my old spigot posts be like 🤦♂️
I started making basic scripts and stuff at 12 because why not 🤷♂️
So imagine. When I was just 5 years I used scratch. Then when I was 7-8 started with Html, css and js
Dont ofuscate it
Why bother 🤷♂️ unless your trying to hide something 😏
evil
Someone who want to deobfuscate will do it
?obfuscator
?obfuscate
just obfuscating my static abuse 😈
?obfuscation
no cmd?
thats bad
I explain all with this frase:
Every thing that can be read by computer can be read by human
frase
xD
Dont use Spanish I have been muted before for that reason
In resume good obfuscation or decent one = pay/buy a good obfuscator like Allatori premium. Someone told me that he uses it to ofuscate premium resources and they never get deobfuscate up to know
Premium resources from mcm cuz spigot doesnt allow obfuscation 🤡
Idk why they dont allow obfuscation but i wont fight about their rules
Hi! How would I check if a player pressed shift while gliding?
I think you can check if player is shifting vía player object
Give me an obfuscated jar and I'll send it back cracked for free
. (With permission of course)
Don't need mappings
That why I develop 1.8x plugkns
They never cause me problems
1.9 up =yeat
Cuz click time
Me too
Nice
Yeah dm me
I do r have problems
Like said my father: for dyes (idk the word In English) you have colores
1.18 never causes me issues and has better support
Can someone help me check this out and see if there’s a way I can fix this issue.
So the player entity spawn in as a non-spectator but when you swap the player to spectator it also switches the entity?
So I'm attempting to build spigot via Jenkins, but I get an ssl error when attempting to build.
```ERROR: cannot verify hub.spigotmc.org's certificate, issued by /C=US/O=Cloudflare, Inc./CN=Cloudflare Inc RSA CA-2': Unable to locally verify the issuer's authority. ERROR: certificate common name spigotmc.org' doesn't match requested host name hub.spigotmc.org'. To connect to hub.spigotmc.org insecurely, use --no-check-certificate'.
Unable to establish SSL connection.
Will I be fine to just insecurely connect?
works on my machine a tale as old as time
When u need to add some comments to code to entertain yourself
🌮
⛹️
🏓
Is HikariCP supposed to take up about 250KB worth of space when compiled into a jar?
I’m using maven to import it and it just seems like a bit much. My jar goes from 432KB to 658KB.
Oh shit sorry I meant KB not MB
If IT workes IT works
Yea… but I want to keep it as low as possible. The limit for plugins is 4MB and even though I’m not even close to it right now (about 11%) I’d rather keep it low in the first place.
Cant you post an external link to the plugin download?
Maybe, I’d have to find somewhere to host versions. It might also break how my plugin updater works. It also adds that extra step of having to leave the site in the first place, which some users don’t like.
I’m not close the the 4MB limit, its just that I could easily reach 1.5MB quickly with what I want to add.
Also, all I’m using with Hikari is the DataSource class which I would hope isn’t 250KB.
Imo github releases is the best place to keep jars
Alright I got it
Block b = e.getClickedBlock();
Sign sign = (Sign) b.getState();
WallSign wallSign = (WallSign) b.getBlockData();
BlockFace attached = wallSign.getFacing().getOppositeFace();
Block attachedBlock = b.getRelative(attached);
For anyone who has the same issue
Can I use
Bukkit.getServer().getConsoleSender().sendMessage
in async task?
?tas
Or you know just use the Logger
Which you should be doing if you want console messages
If i only use Bukkit imports, does the resulting plugin work on every server? With plugin support i mean
and how is it with NMS imports?
It will break on every minecraft update
not
after 1.18
because they used moj mappings now
craftbukkit package is still versioned
And Minecraft still changes
well, that is only if you dont change the shade plugin
i mean craftbukkit things still only on your computer only why dont you change the shade plugin 🙂
but like if that plugin is public then uhh okay then
and mojang mappings are compile-time only. Obfuscation at runtime may change as well
^ was about to say
weird thing to complain about
i meant
if i compile a plugin with only bukkit/nms imports
will it run on everything
not different versions
different plugin supporting servers
like paper etc
what can i do if a runnable jar opens a extra cmd and instant closes (with an error i cant see because its closed to fast ?)
unless you are making use of OS specific API in Java, yes it will work on every platform
should work
k thanks
Which event?
via player object ... ^^ player.isSneaking
as event it would be PlayerToggleSneakEvent
hello
https://github.com/Conclure/Clonomy/blob/master/src/test/java/DataTransferBaseTest.java
So, if anyone has a better idea of how to test that a race condition is happening please let me know (the last test is quite unreliable as of now)
someone ban that guy
@ivory sleet
oh ... ty anyway
it's not possible to detect a right click on air without jumping through some weird hoops right?
How can i ride the ender dragon in overworld?
the client literally does not tell the server about right click air unless youre holding an item
if youre holding an item the normal event is fired
spawn an ender dragon, add upirself as passenger
It didn't move
can you somehow get extra key presses? Or do all triggers have to be vanilla (for example right clicking with a stick as trigger?)
you cannot get right click air without an item
hm
hello
is there a list of what client actions get sent to the server? If i can use something like Hightlight Players (Spectrator Mode) as trigger, that would probably solve that problem too, but I'm not sure what the client actually does when that key's pressed
Idk what that is but it sounds client side
thats why i asked if there's a list
also do you per chance know if the 'swap items with offhand' gets sent to the server if both main and off hand are empty?
is there an BlockDamageAbortEvent md5 ?
What does it mean when the option is crossed out like this? Does it mean that it is deprecated? https://imgur.com/a/7r1fyHK
💀 can't embed links
yep
its because names can change
that method isnt necessarily returning the right player
Oh that's smart
aliases:
- /```
does this throw an error, or does it allow the usage of '`//`' as a command?
hey, was there a rule about non-english reviews on the forums?
i think not a rule but it is not cool to translate a review first ^^
so i just got an error because i didnt put * in quotes as permission
is there any possible error if i just put every value in the plugin.yml in single quotes?
also
it DOES still send the press of the swap key even if there's nothign in either hand
to check your yaml syntax if it is correct or not
A yaml validator complete with syntax highlighting and easy to understand error messages.
What am I doing wrong?
did you run buildtools with mojang remapped ?
what is the value of your ${mc.version}
1.18.1
you can't use that for remapped-mojang the last i tried
1.18 was the latest available
no 1.18.1 should work
you can try java -jar BuildTools.jar --rev 1.18.1 --remapped if you haven't
did you check if your .m2 contains the jar ?
Yeah I see what the problem is, it's saving it to the wsl .m2 and my intelliJ probably isn't recognising it
Hi! How would I make a plugin that allows a player summon zombies that attack other players but not the summoner?
EntityTargetEvent or smth like that ... spawn them and add a PDC tag to specifiy the owner ... listen in that event for the entity and check pdc for owner ... if owner == new target -> dont do that
I want to make a head with a certain skin but I don't want to rely on some player not changing their skin & I don't have any alts that I can use to have the skin. Is it possible for me to do that?
yes
https://mineskin.org
you can draw your skin and upload it ... then take value and signature (but this requires nms)
MineSkin.org allows you to generate skin texture data for Minecraft which is signed by Mojang.
Ok thanks
If I run build tools with --remapped, in which folder do I find the mojang mappings?
.m2 i think
if i want to store a itemStack in a PDC, the only feasible option is to use serialization, right?
Arrays.stream(e).filter()```
HOw do i put boat entity inside the filter
?
is it org.bukkit.entity.boat?
Bukkit.getWorld( ???????)
Get world instance by name
I dont believe that is the default name of your over world's world
It should be just world
ok
It is the name of your world folder
incase if i dont know the world name
what should i use to get world name (overworld)
From the world object lol
There is no way of something if there is no way of knowing something
If you get what i mean
What do you plan to identify your world by
You can getWorlds
And iterate through worlds and check if they are of certain type
?jd
I used this, since i am new to java (i know python and javascript) i really didnt understand
Mr. 0
declaration: package: org.bukkit.generator, interface: WorldInfo
World inherits WorldInfo
Have you learn the basics of Java?
Yea
Because i wont never recommend using an API without knowing the Basic of the laguage
Why tf does discord always ignore closing brackets
Grrr
I just didnt understand some concepts like abstract and something which i dont remember
Guess you shouldn't use the Java standard library then :)
No String for you
Agree
How do i do this any docs
is this it?
I don't think implementing collection types yourself is gonna help you learn the language.
If anything, it'll just make you more frustrated and give up trying to learn the language.
And even then, Java is tethered to the stdlib in a lot of ways.
You cannot use primitives in generics without the standard library (Integer, Float)
You can't even pass a value of any type without the standard library (Object)
Oo Maow I like your new pfp :3 
Mr.O do read up on javadocs on collections and how to iterate through its members
I agree because when I started with plugins I was 13 years and i didnt learn java from the begin. So them I was always asking for code spoofing. And them I stopped. And start to learn Java
It is a character from the game Changed :)
Yes, Like arrays?
Ahh, nice, very pog
arrays are not Collection
He means List, Set, Map, etc.
Arrays are technically collections but they're lower-level.
Same dude
Yeah typically it's the other way around.
I mean hashtables is more commonly applicable
Yeah but repeat elements and accessing by index?
For most use cases
O
I first learned List, ArrayList and Arrays. Them Maps, Hashmaps, sets and hashset
I under stand
I think I learned like
WHich java docs did you use
Arrays, ArrayList, List, Maps/HashMaps, then Sets/HashSets
Technically, you should learn list -> tree -> hashtable, and its corresponding implementations
Yeah me too
The day I was introduced to Maps 😍
HashMaps were so confusing for me then someone said to me "bruh it's just a dictionary" and then I just understood it

🤩
(You are furry)
Yes
now start cyberbullying
I was taught that it ISNT a dictionary
😂
Lmao
Is your friend telling you what to say or something?
Like
lol
Dictionary++
The day I was introduced to Mongo my eyes started to cry. Cuz I come from yets like Mysql
"Hey dude that guy's a furry, go tell him he's a furry"
"Now start cyberbullying"
i dont what a mongo is but i use json
for simplicity
MongoDB
Hello I'm wondering if it is possible to upgrade Java without shutting down the server from ssh
No
No
You cannot hot-swap Java instances at runtime.
Dictionary is the worst analogy for hashtables as dictionary implies logn find and provides accessor and predecessor operators
okay thanks
In another words, ordered
Seems like coding ninjas
Literally
The official oracle tutorials
No joke
I dont understand to much
They use a lot of terminology without explaining beforehand
What do you not understand, can just ask here i guess
Mongo is for noobs!
Real chads takes an advantage over RELATIONAL databases
I read the docs on generics when I was beginning and they did not help :p
Fuck you manya.
The entire decalium hates you
Not the docs, the tuts
It looks okay to me https://docs.oracle.com/javase/tutorial/java/generics/index.html
This beginner Java tutorial describes fundamentals of programming in the Java programming language
Relstional tables 💩
^
Maow btw
You are 💩
Do you know much about VarHandle?
They updated them???
Fuck
Yeah actually really well done
I cant upload screenshots?
gotta be verified
Allrgiht really thanks
Not everything about it but I know how to use it.
I just use anything I like
T, then S then U
K and V makes sense
Yeah just whatever key on my keyboard seduces me the most
I follow typical convention
Generic parameters (as in, literally generic, like they don't really mean anything):
T, T, V, T, U, V, T, U, V, K
Collections:
E
K, V (mapping)
etc.
There's some more shit but that's the basic gist
Okay so if you don’t mind, I’d gladly appreciate one of the Maow’s comprehensive explanations surrounding getVolatile, getAcquire and getOpaque (more than just the jd documentation)
So mainly their differences
Oh yeah I don't fuckin' know actually
Entity[] e = i.getEntities();
Arrays.stream(e).filter(org.bukkit.entity.Boat);
});```
It get red line under org.bukkit.entity.Boat
It says: Expression expected
Frick
pff
Group study session lol
Filter accepts a function
egh
how do i create it
- Why create an entire Stream just to iterate
- Why nest a Stream within a Stream
To learn function/consumer or those in that league you need to know about functional interfaces
I am trash
And potentially learn about pecs
I wonder what happens when you run out of alphabet?
So it isnt wrong to have this method on Interface:
T query(K... query);
I did like that because this will be Implemented by MongoDB and Mysql classes.
T - Cuz for mongo I need to return Document and Mysql a ResultSet
K... - Cuz Mongo and Mysql requires different Arguments
Let me refactor some of your code, here:
Arrays.stream(chunk)
.flatMap(i -> i.getEntities())
.filter(/* your filter here */)
.forEach(/* your loop here */);
Just make sure that generic vararg isn’t polluting
It isnt wrong but i guess no one does this
Why?
What usefulness does K provide
I need Arguments so i them do a conclusiok
Yeah you'd be better off with Object
Verano usually you probably want to provide an even higher abstraction
There's no need to use generics if you only use them in one place
I don't even expose queries atm
Assuming you’re trying to create a polymorphic design of some sort
I wilm translator this to Spanish cuz I didnt understand
e.g. This is pointless:
public <T> void uwu(T o) {
if (o instanceof String s) {
// ...
}
}
Sorry wait no
uwu
Polymorphism 
So that's pointless
Because you never re-use T
And it could just be replaced with Object
As far as polymorphism is concern, if you have a common interface such that you can declare K to be <K extends SomeSuperType> then K will be useful
But i assume you dont
Pog abstraction
I don’t believe we have super in generics
So Object it is
except if it’s a wildcard
Yes we do :)
I'm pretty sure that's a thing
yes
you've got extends and super
And it’s also kind of sad we don’t have union types, only intersection types
Anyway the thing about that tho
and for interfaces u use extends as well
No lvj
We do have union types, technically
You know where?
There’s no T super A
Exception handlers.
I actually once used exceptions to implement union types as an experiment.
It worked.
O
Lmao
Sorry my brain damaged, it should be extends here anyways
I guess every type can be seen as an option type since null
fix-climbing-bypassing-cramming-rule:
In which file do we find this configuration?
How can I retrieve the Villager (mojang mappings) from a InventoryOpenEvent? I tried some things but I mustly ran into errors when trying to cast certain objects to some nms Classes
This is how its Implement:
public T ResultSet query(K... query) {
return this.con.preparedStatement(query[0]).executeQuery();
} // Mysql Implement
public T Document query(K... query) {
return db.getCollectiom(query[0]).findFirst();
} // Mongo
If something its wrong its because im not on computer im from cellphone
// exception StringE (takes a String)
// exception IntE (takes an int)
public void retrieve(Exception e) {
try {
throw e;
} catch (StringE | IntE value) {
// Use the type here
} catch (Throwable t) {
// If it's neither of the two types, do nothing
}
}
retrieve(new StringE("Hello, World!"));
This is awful, do not do this ^
In oblise to use K... because mysql and mongo have different method parameters
Again i think there is no instance of db where that can work
Hum
Hahaha
You can always use Object array
This is beautiful and horrible at the same time maow
Since arrays are covariant
Also remember when people used try catch to “smart cast”
Huh I can't seem to find a generic limit
Oh no
I do not remember that
That is awful
Yea
Or something like that
gonna get python to test it
Theoretically there shouldn't be a limit as it would only matter to the compiler, not the JVM
But then again generic type data is stored, just as a "signature" as to not break libraries I assume
Im even more wrong. I created an implementation of runnable for using throws like this:
public void run() throws Exception {
}
Hahaha
Callable exists
addi t0 t1 5
I created an Interface that extends Runnable, has FunctionalAnnotstion and has sneaky reflections for trowings exception while my run methods its running
Omg If you see the Interface you will kill me
Wait I will translste it
Remember in spanidh hahaha
My spidey senses are tingling
SneakyThrow.sneaky
I once made an assembly-styled interpreted lang
Alright so I think intellij is having a harder time processing a 5000 type generic
I've sent it many times before
Hell no
Solar in resume I should change the k... To Object[] on my database Interface right?
You don't need it to be an [], I think ... works fine.
Maow going to go insane in a few years and make the FurryOS a replacement for TempleOS in the meme world
Object... Is also fine, same same
Schizofurria
So i only need to take out the K
I can't even send a gif of the guy cause it makes me sad to see him like that 
Ye, and i think you no longer need your suppress safevarargs
I am planning on rewriting FurASM though
If you even used it
It'll have an actual assembler
xo
And likely better syntax
See, FurASM is actually quite raw. You manage function offsets yourself :)
So 5000 generic types works or at least no errors. Just Intellij can't handle it
Yeah I have that su press
Can you spot the JVM?
@lavish hemlock and @hardy swan here you have my sneaky Interface
@FunctionalInterface
public interface Runner extends Runnable {
@Override
default void run() {
try {
execute();
} catch (Throwable ex) {
throwException(ex);
}
}
void execute() throws Throwable;
static <E extends RuntimeException> void throwException(Throwable ex) { throw (E) ex; }
}
You will kill me
Why would you need a method to throw the exception...?
And uhh
Why would you declare a generic and then cast to it
JOOQ be like
https://paste.md-5.net/miqowisezo.cpp It's been parsing for about 3m now
Thats a hack
Oh I see
Ohhh
Yeah okay that makes sense
It's just to get around compiler enforcement?
Maow I did that cuz. I need to run code some time and trows exception. Without doing try catch in the method
🤣
Easier solution:
Make your own exception that extends RunTimeException 
Ok nvm i see wrongly
@FunctionalInterface
public interface ThrowingRunnable extends Runnable {
@Override
default void run() {
try {
runThrowing();
} catch (Throwable t) {
t.printStackTrace();
}
}
void runThrowing() throws Throwable;
}
That's a lot of work to just try catch an exception
Oh thanks
Well sure but it's less code than this.
thats just whining in Logger
Then change the implementation :)
.
The point is that it allows you to do shit like IO within a lambda.
But would I be able to do this:
public void run() throws Exception, Custom Exception {
Code blabla
}
for example Map interface with HashMap, TreeMap,..., if i used Map<String, String> monke = new HashMap<>(); it will use the hashmap implementations right
the idea was sneaky rethrowing checked exception
Okay yeah but that crashes.
Yes
at least not silently
There is a word for it
?
So sadly it looks like there is a limit to generics 
Either way it's not silent :p Printing stacktrace still makes an error.
Yeah, told ya. You reached the constant pool limit.
like dam just rethrowing an excpetion is much easier
what about
public Map<String, String> something() { return new HashMap<>();```
will it still use hashmap?
I'd argue otherwise
It's literally less code
But does basically the same thing, except it won't uproot your process if a file is missing (IOException) :p
Arrays.stream(chunk).forEach((i) -> {
Entity[] e = i.getEntities();
System.out.println(i);
Arrays.stream(e).filter((f) -> {
System.out.println("OOOOOOOOOO");
if (f.getName().equalsIgnoreCase("Boat")) {
System.out.println("OPL");
}
return true;
}).onClose(() -> {
System.out.println("Closed");
});
});
}
return true;
}```
Why this no work
The line sout("OOOOOOOOOO") is not firing
Yes
you're not contributing to paper
(you can use imports)
Likelihood is that it's in a class called Main
I think it is called dynamic binding
?main
It is named JavaPlugin
I have just realized you can do:
public ArrayList get Array(List<String> list) {
return new ArrayList<>(list);
}
You think or you know?
It is JavaPlugin
This is an interesting question
Yeah it's
Like it's a sassy response
Since it seems like something he should know
IF IT'S IN HIS CODEBASE
Lil help pls
You can also do:
new ArrayList<>(list);
Like I think if someone want help at least need to know their main class ame etc
lul
Sowwy, It is written once and never used lol
I didnt know that you can do that. Its really extrange
Sowwy
That's cute.
Me extra stupid my plugin class name is Main and it extends JavaPlugin
The only time I personally think redundant-ish methods are okay is when they make code look nicer.
Like
Something like Lists.of(...)
Man why do people belittle themselves for learning is beyond me
Which is preferable to something like new ArrayList<>() -> adding all the elements
Would do the same List#clone()?
Sorry but what is your gender before I further assume it
I don't include pronouns bc I don't fuckin' care
It
But, if you must know, he/him/they
Maow do you remember mi idea of doing some data broker with netty!
I think I have fucked with that many time
Never used Netty
Oh wait
No I don't remember that
I don't think you told me about that
Yeah
Tbh I also don't know what a "data broker" is
Like I want something all integrantes in custom bungee and spigot. Using their netty. So for sending/receiving data you wont need Redis, Sockets an extra port
I think its called correcto y message bróker
Aren't those like the companies that collect and sell peoples data usually to advertisers?
Or


