#help-development
1 messages Β· Page 669 of 1
yeah but then i'd have another instanceof check
?
ah
that was my main problem with noobdog's code
private void handleDeathChange(final CommandSender sender) {
GlobalBooleanUtils.setDeathEnabled(!isDeathEnabled);
final String toggledState = !isDeathEnabled ? "&aactivated" : "&cdisabled";
sender.sendMessage(formatColors(ServerSystem.getPluginPrefix() + "You successfully " + toggledState + " &3noDeath&7."));
for (final Player onlinePlayer : Bukkit.getOnlinePlayers()) {
if (onlinePlayer == sender) continue;
final String executorName = (sender instanceof Player) ? ("&b" + sender.getName()) : "An &4administrator");
onlinePlayer.sendMessage(formatColors(ServerSystem.getPluginPrefix() + (executorName + " &7has " + toggledState + " &3noDeath&7."));
}
}
// somewhere else
public static String formatColors(final String argument) {
return ChatColor.translateAlternateColorCodes('&', argument);
}
this is how i'd do it, not much difference but i think this code is a bit easier to read
yeah ppl said that 100 times now
but yet again that would again be a whole refactor of my code
that's true, i was going to tell them to use a format convenience method but i was too lazy
i know
not really lol
well depends on how much i still add tbh
which nested if
smth like this maybe
or in kotlin you could do
fun String.formatColors() = ChatColor.translateAlternateColorCodes('&', this)
but i'm not going to make you change a language just for that lol
use what you're comfortable with
uhm
since i don't understand yet what translateAlternateColorCodes does, i'll wait with that
and i sadly don't have the time for that rn
that's a method that translates chatcolors in a string
i switched to kotlin from java without much trouble
typo
it's just a method for chatcolor translation
basically what you should use for chat colors
Could anyone please help me with an error?
Code
public void onSignClick(PlayerInteractEvent event) {
Player player = event.getPlayer();
Block clickedBlock = event.getClickedBlock();
Material blockMaterial = clickedBlock.getType();
String blockName = blockMaterial.name();
System.out.println(blockMaterial.name());
if(blockName.contains("SIGN")) {
Sign sign = (Sign) clickedBlock;
}
}
Error
Caused by: java.lang.ClassCastException: class org.bukkit.craftbukkit.v1_19_R3.block.CraftBlock cannot be cast to class org.bukkit.block.Sign (org.bukkit.craftbukkit.v1_19_R3.block.CraftBlock and org.bukkit.block.Sign are in unnamed module
i started by making some utils in kotlin for my project, and now i'm recoding the entire thing in kotlin xD
π
you can, but that makes your code even longer
Thanks!
just take a look at this
It's gonna make your code look a lot messier by having random ChatColor.COLOR's everywhere
a lot of stuff is similar or identical. if you have intellij, you can make a java class and then convert it to kotlin with intellij (it'll probably break if the class is more or less complex lmao) and then you analyze what you see before yourself
it's literally in the code
uhm
ChatColor.translateAlternateColorCodes
then i was blind
oh
sorry lol
is it cleaner to import the class the formatting-method is in or the method from that class?
probably the latter no?
i say, make a utils class
ProtolLib PacketType.Play.Server.PLAYER_INFO issues
private fun handleDeathChange(sender: CommandSender) {
GlobalBooleanUtils.setDeathEnabled(!isDeathEnabled)
val toggledState = !isDeathEnabled ? "&aactivated" : "&cdisabled"
sender.sendMessage("${ServerSystem.pluginPrefix}You successfully $toggledState &3noDeath&7.".formatColors())
for (onlinePlayer in Bukkit.getOnlinePlayers()) {
if (onlinePlayer == sender) continue
val executorName = if (sender instanceof Player) "&b${sender.getName()}" else "An &4administrator";
onlinePlayer.sendMessage("${ServerSystem.pluginPrefix}$executorName &7has $toggledState &3noDeath&7.".formatColors())
}
}
// somewhere else
fun String.formatColors() = ChatColor.translateAlternateColorCodes('&', this)
try to analyze this code and see what you can and cannot understand
(this was written without an IDE so it might be a bit clunky)
yeah obviously. just if I should use
import package.UtilityClass;
UtilityClass.formatString();
or
import static package.UtilityClass.formatString;
formatString();
both are fine i think, i normally go with the latter
you can explicitly specify the type but it's often more convenient not to
val number: Int = 39
oh and there are no primitives
alright final paste
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.
this would be correct then?
Int, Double, Boolean, etc, they are all classes
this is getting close to TS lol
is this supposed to be a final uneditable boolean?
well it's being set everytime the command is executed, so it doesnt matter, no?
this is a static variable
it's created as soon as the class is created
and it's final
it is never changed
this still should not work because you never change it
if you want to map it to a command call, make a map<uuid, boolean>
well that is true indeed
why did i include that lmao
that's dumb
nah i just changed every use if isDeathEnabled to GlobalBooleanUtils.isDeathEnabled()
and removed it
huh?
didn't read the whole thing so idk
wait i feel like i should know this but is continue just the opposite of return?
OHHHHHHHHHHH
that makes a lot more sense
lmao
whoops
for (int i = 0; i < 10; i++) {
if (i == 5) continue;
if (i == 7) return;
System.out.println(i);
}
will print 0, 1, 2, 3, 4, 6
Another error
Caused by: java.lang.NoSuchMethodError: 'boolean org.bukkit.event.block.Action.isRightClick()'
Code
public void onSignClick(PlayerInteractEvent event) {
if(event.getAction().isRightClick()){
System.out.println("ASD")
}
}
the scope
that is paper-api
idk
seven ate nine, so
xd
why is that?
I made a webhook system but no messages arent sent why is that? no errors are generated in console either
?paste
Itβs hard to answer a programming question without code
Oh no! You ran into a problem. But no worries, people are willing to help, but first they need to see your code. This is because otherwise, they would be providing help based on guesses instead of concrete knowledge. Whether it be a compile error, runtime error, or an unexpected output, I'm sure that if you were to provide code, you'd receive a quick solution.
yeah figured the nocode out sending it
if you never update the variable, but the method decides to return a different value, you'll never know that it does
because you're using the old value
bc i change the accessed value with a getter and setter
you assume that the value is updated every time you call the command
no
the command calls the method onCommand
not the class instantiation
the class is instantiated once
oh
if you instantiate the value in the class instantiation you're gonna have that value all the time
if you instantiate the value in onCommand it's gonna update every time you call a command
but it makes sense. bc the commands are only instantiated onEnable()
https://pastebin.com/UFhbpV8z
https://pastebin.com/7F7xs6gf
https://pastebin.com/Nk3nE2N3
https://pastebin.com/UXPwhx3k
that should be all the classes
but if i use getters and setters, why does it still break stuff?
any1 ping pong
yeah that's what i said lol
class MyClass implements CommandExecutor {
private boolean something = Utils.someMethod(); // this is called when you create an instance of the class
@Override
public void onCommand(....) {
// this is when you call a command
}
}
new MyClass() // here you create an instance of the class
thus if you have a variable in the very class scope, you only create it once, and even if the method updates, your value will stay at what it was at the very beginning, when you initialized your class. if you want it to update every time you call a command, move it into onCommand:
@Override
public void onCommand(....) {
private boolean something = Utils.someMethod();
}
the second way is perfectly fine and should not break
the first one is bound to break if Utils.someMethod() does not constantly return the same value
// just for the sake of explanation:
// this returns the same value constantly
public static boolean someMethod() {
return true;
}
// this does not return the same value constantly
public static boolean someMethod() {
if (System.currentTimeMillis() % 5 == 2) return true;
return false;
}
havent done webhook stuff so i wont be much use
oh where am I better of asking?
here but later
can anyone help me with this issue ? https://discord.com/channels/690411863766466590/1139906136569565246
Is it reasonable to use a "one-time-setter" (exception when called again) to set a variable inside an API-class that gets extended? In order to save every extending class to define a constructor and call the super constructor?
Or are there better ways?
This would be the usual way.
@AllArgsConstructor
public abstract class EventDefinition implements EngineDefinition {
public final RegionEvent regionEvent;
That however does force every implementation to define a constructor.
public class InstantMine extends EventDefinition {
public InstantMine(RegionEvent regionEvent) {
super(regionEvent);
}
I'm trying to avoid that the extending classes require the constructor.
I could set the value via reflection. Since it's called during runtime from time to time, that is probably not the best solution though.
bukkit also does it like that - https://hub.spigotmc.org/javadocs/bukkit/org/bukkit/Bukkit.html#setServer(org.bukkit.Server)
declaration: package: org.bukkit, class: Bukkit
that or you can make an addon system
As in?
as in you force them to extend a class and inside that class have a package private init
well I'm trying to reduce the code for extending classes
That sounds like the constructor but different
it's up to you how you approach it
I'll figure something out. Just had to know whether that pattern is reasonable or not
The package-private thing won't work since all relevant classes for the API are inside a seperate package.
I wish java had the "internal" modifier that kotlin got
yup I'm doing that right now
just throw an exception if the method is used again
and make sure you're the first to set it
How to get the click in PlayerInteractEvent? like was it right or left click?
I can't make sure I'm first since I'm using an abstract builder. However if they set it beforehand it will result in an error, that's fine.
getAction()
get what from the action?
intellij is not giving me a error
execute as
the what click it was, right or left
public void internal_setRegionEvent(RegionEvent regionEvent) {
if(this.regionEvent != null) {
throw new RuntimeException("This field can only be set once");
}
this.regionEvent = regionEvent;
}
``` :)
by using == and comparing it with the only 2 actions that exist for left click, or right click respectively
oh so could i do something like event.getAction.name().equals("RIGHT_CLICK")?
what
no
event.getAction() == Action.RIGHT_CLICK_AIR
its an enum
no?!
oh i got it thanks
why would you check the name
idk
because
public static boolean isRightClick(Action action) {
return action == Action.RIGHT_CLICK_AIR || action == Action.RIGHT_CLICK_BLOCK;
}
public static boolean isLeftClick(Action action) {
return action == Action.LEFT_CLICK_AIR || action == Action.LEFT_CLICK_BLOCK;
}
Oh thanks!
event.getAction().name().toLowerCase().toUpperCase().equalsIgnoreCase("RiGhT_CliCk")
π
The best solution
this is
Why does it say Cannot resolve constuctor ComponentBuilder()?
ComponentBuilder builder = new ComponentBuilder();
?nocode
Itβs hard to answer a programming question without code
Oh no! You ran into a problem. But no worries, people are willing to help, but first they need to see your code. This is because otherwise, they would be providing help based on guesses instead of concrete knowledge. Whether it be a compile error, runtime error, or an unexpected output, I'm sure that if you were to provide code, you'd receive a quick solution.
?paste
private static final IntSet RIGHT_CLICK_ORDINALS = IntSet.of(Arrays.stream(Action.values()).filter(action -> action.name().contains("RIGHT_CLICK")).mapToInt(Enum::ordinal).toArray());
private static final IntSet LEFT_CLICK_ORDINALS = IntSet.of(Arrays.stream(Action.values()).filter(action -> action.name().contains("LEFT_CLICK")).mapToInt(Enum::ordinal).toArray());
public static boolean isRightClick(Action action) {
return RIGHT_CLICK_ORDINALS.contains(action.ordinal());
}
public static boolean isLeftClick(Action action) {
return LEFT_CLICK_ORDINALS.contains(action.ordinal());
}
this looks like it's straight out of terrible-plugin
then it would return !Logic.UNTRUE or sth though
Here is the code
https://paste.md-5.net/dayohofutu.cs
untruelogicfactoryfactorybuilder
Yes.
that's incredible but i'm more interested in your imports and pom (specifically, deps and reps)
why the heck are you appending hardcoded Β§ colors to a componentbuilder?
?paste
tempted to make a plugin with really bad code sometime
then ask people to code review it
i did it without much temptation when i just started
use javac directly too
I'm especially proud of my motd classes https://github.com/Jaimss/terrible-plugin/tree/master/src/main/java/dev/jaims/terribleplugin/motd
no but like intentionally terrible
and overindustrialized
like that logic class that dpesnt need to exist
oh god
code it in some jvm language that is not java or kotlin
scala
yeah
html
jphp
code it in delphi and write a converter to java
how do I use completeablefutures whencomplete?
Imports
import net.md_5.bungee.api.ChatColor;
import net.md_5.bungee.api.chat.*;
import org.bukkit.entity.Entity;
import org.bukkit.entity.Player;
import org.bukkit.event.EventHandler;
import org.bukkit.event.Listener;
import org.bukkit.event.entity.EntityDeathEvent;
import java.util.Arrays;
Message.getMessage(player.getUniqueId()).whenComplete(language::player.sendMessage(language););
just gives me an error
.whenComplete((result, ex) -> {
somethin
}
Lambdas and Method references can be used to make your code way shorter, and (sometimes) more readable by getting rid of anonymous classes. What are Anonymous Classes? Anonymous classes are like local classes without a name. Imagine you have the following code: We hereby declare and instantiate a class implementing java.lang.Runnable that just p...
you dont cc lose the statement or connection
isn't net.md_5 stuff in the bungee dependency
oh well
that's just md's package
Message.getMessage(player.getUniqueId()).whenComplete((result, ex) -> player.sendMessage(result));
tysm
i suggest to read the above blog post to understand what lambdas and method references actually are and how they work ^
you dont do anyhting
you should also have an ex.printStackTrace()
in the sendMesasge block
there is no exception
Message.getMessage(player.getUniqueId()).whenComplete((result, ex) -> {
ex.printStackTrace();
player.sendMessage(result);
});
Code:
https://paste.md-5.net/dayohofutu.cs
Imports:
import net.md_5.bungee.api.ChatColor;
import net.md_5.bungee.api.chat.*;
import org.bukkit.entity.Entity;
import org.bukkit.entity.Player;
import org.bukkit.event.EventHandler;
import org.bukkit.event.Listener;
import org.bukkit.event.entity.EntityDeathEvent;
import java.util.Arrays;
pom:
https://paste.md-5.net/sakihikuwe.xml
The error is that is dosent understand ComponentBuilder builder = new ComponentBuilder(); and .retain(ComponentBuilder.FormatRetention.NONE).append(Slag)
ohhh
there should be
tbh it just could be that 1.8.8 does not have these particular classes, because who the fuck knows what is up with 1.8.8. try switching the version to something not so badly legacy, at least 1.17.1, and see if the error persists. if it doesn't, then the version 1.8.8 just does not have these classes. if it does, something else is the problem, try invalidating the caches and see if that helps
the sqlConnection in ur Message class is null
Today is a great day to not have eyes
but its not
wait isn't that supposed to be
Message.getMessage(player.getUniqueId()).exceptionally(ex -> ex.printStackTrace()).whenComplete((result, ex) -> {
player.sendMessage(result);
});
but it is
no point if you have whenComplete
got it
if you didnt have a whenComplete that would be better
That throws an NPE if no error was thrown, Epic
The exception and result are exclusively nullable
oh true
actually why is it whenComplete and not thenAccept
I mentioned a solution last night, didn't I?
i do not remember using whenComplete a single time
I did
wouldnt surprise me
and that is why I am using whenComplete
use the rest of chocos code too
hm, is whenComplete just a shortcut for exceptionally.thenAccept?
thenAccept would run async too iirc
yeah i think so
if (cmd.getName().equals("set")) {
Message.setMessage(player.getUniqueId(), args[0]);
sender.sendMessage("confirm");
}
is not giving me an error so it must not be null
Sort of but not really
exceptionally() returns a value when an exception is thrown whereas whenComplete() does not
handle() however is closer to what you mentioned
You have 4 main methods
thenAccept(T) - Runs only if completed normally, returns no value
whenComplete(T, E) - Runs if completed normally or exceptionally, returns no value
exceptionally(E) - Runs if completed exceptionally, returns a new value
handle(T, E) - Runs if completed normally or exceptionally, returns a new value
You also have map(T) which is handy and will map the value if completed normally (much like thenAccept(), but it returns something)
CFs are great and very powerful π
why are you checking the command's name?
its for debug purposes to test the mysql
yeah, i use them quite frequently, though with kotlin i switched to coroutines haha
please remove them right away
how would I test sql
I have one
with the actual commands
like you would test any other code
both cmds will just go to the same executor
but why then
Β―_(γ)_/Β―
i have no fucking clue this is stupid
thats wh y ihave cmd.getName
to switch the two commands
canb someone just help me wit hthe thing
@Override
public boolean onCommand(CommandSender sender, Command cmd, String label, String[] args) {
Player player = (Player) sender;
if (cmd.getName().equals("set")) {
Message.setMessage(player.getUniqueId(), args[0]);
sender.sendMessage("confirm");
}
if (cmd.getName().equals("get")) {
Message.getMessage(player.getUniqueId()).whenComplete((language, e) -> {
if (e != null) {
e.printStackTrace();
return;
}
player.sendMessage(language);
});
}
return true;
}```
why is get null and set is not
show ur Message class
it is most literally null
where di i set that?
you currently dont
How do i set a click event and a hover event on text in 1.8?
I have this right now: https://paste.md-5.net/dayohofutu.cs
But i dont think it works on 1.8
omg I set the real sqlCon in ,my main class
tysm lol
I messed up lol
PreparedStatement preparedStatement = LobbyManager.sqlCon.prepareStatement("SELECT language FROM PlayerData WHERE uuid = ?");
and that has to be static
why
main class
so?
im not giving that class access to it
its just easier
β¨ singleton pattern β¨
what is it gonna do, eat the class alive and kill the console executor?
its just a pain in the butt\
dependency injection is, not in the slightest, a pain in the butt
i did this a while ago
I am not ?di'ing
Guide to dependency injection: https://www.spigotmc.org/wiki/using-dependency-injection/
there you go
ughh fine
good practices are worth your time
But can i do it on more text on that way? so if i send a message example: 1, 2, 3, 4 can i then have a hoverevent on each?
how i can get title of an inventory? iirc there was a getTitle() method but isn't now
getView
thanks
https://paste.md-5.net/aquzahayew.java
hows that? mr static abuse hater
which is valid
what the fuck is this
abusing static just is not smart
why is this variable static
cause the getMessage is static
and why is it static?
because I dont want to renew the class every time I want to use it
that would require me to put the plugin variable every time
im just using java's static reference
don't, instantiate one copy of Message in, for example, your main class, then pass your main class around
but than I would need to have the main class in every class
does that hurt?
kind of
no
in most of my projects, like 80% of the classes have an instance of the main class
it's called convenience
yea xD
Can you send a photo of the rest? after new ComponentBuilder..?
so I can NEVER use static? ever?
you can
you can
yeah you can
just use it correctly
keep it to a minimum
"correctly"
this is a global util
read
Statics can basically be anything that doesn't have any state
getMessage is for guis, messages, configs
if you open your eyes you can see that i do not use a component builder
i have a getLocale in my private kitpvp project and it requires a plugin instance
because i need a database instance and a datamanager instance
both are powered by an adapter which runs together with bungeecord
which needs a plugin instance to receive the message
?img
Can't send images? That's because you're not verified! Use !verify to complete verification.
Alternatively, you can upload screenshots to any image hosting site and share the link.
Here's some screenshot utilities that can use to upload images.
Lightshot: https://prnt.sc
Imgur: https://imgur.com/upload
Flameshot: https://flameshot.org
just use di
finee
if u want to make those methods static
then think again
yeah and that's inconvenient
what's better, passing the plugin once for di or passing it every time you call a method
You dont? https://prnt.sc/VHs-GFWooxC0
painful
that's my personal util class, not the ComponentBuilder
mb
you should save the mysql connection pool variable and then give sql stuff access to call getConnection
i can now connect to his database 
public Connection sqlCon;
no
its a private database xd
public MySQLConnectionPool connectionPool
alr
you then call connectionPool.getConnection() any time you need to connect
and you should use try-with-resources
try-with-resources?
try(Connection connection = myPool.getConnection();
PreparedStatement statement = connection.prepareStatement("...")
) {
// do stuff
}
?
U can do multiple instantiations in the same try
really
yeah
Just separate with ;
yeah
tf
Kek
the more you learn
have yo been doing multiple this entire time
Nesting lord
well thanks then, the more i know
https://paste.md-5.net/matinujiho.java
all done how is this?
as it should be
in terms of di this looks fine, in other terms it also looks fine but i'm not too much of an expert on cfs unfortunately
reminds me i have to rewrite most of my storage system in my plugin
btw does anyone have a gui creation class that uses yaml?
no but there's one for xml that recently appeared https://www.spigotmc.org/threads/guiengine-β¨-craft-guis-effortlessly-β¨-1-16-1-20-1-api.612803/#post-4618433
not by me but it looks really cool
deluxe menus
tysm
Hey im getting errors when loading the class in which i use the luckperms api. Luckperms is not installed because its just a soft depend. How can i get rid of this error?
i just saw this
wtf
is
this
don't access luckperms classes if it's not installed
don't call your code if luckperms is not on the server
use Bukkit.getPluginManager().isPluginEnabled("Luckperms")
goddamit alex keeps sniping me
Im not triggering the code with the function im calling
Hi im making a system to load automaticaly the config in a gui easy to modify but i need to check under the subsection for example
section:
not: false
or: true
subsection:
cat: true
and i know section exist and the other but i don't know if under subsection there's something to determine if is a subsection
then show your code
he has gigabit internet
its another method in that class
show full stacktrace
i dont have any luckperms imports
ConfigurationSection#isConfigurationSection
if(myConfig.isCOnfigurationSection("section.subsection")) {
?paste
what's websocket adapater line 32
mine is also not too shabby, though i did think that my internet was better
Why dosent it send you killed .... ?
https://paste.md-5.net/elomuzorud.java
a couple years ago i'd celebrate if i somehow got 2 mbps
i see this as an absolute win
probably you return before the message
So I got blocks turning into bedrock once mined and then 15 minutes later changing back to their original block. Issue is when server restarts it doesn't turn it back to the original block, is there a way to force all bukkit delays to happen when the server stops
have a map of location to material where you store the blocks and edit them in onDisable
@pine forge
Set<Map.Entry<String, JsonElement>> queries = Router.getConnectResponse().entrySet();
Literally just this
nothing with luckperms
its loading the Router class
in which i have a method which uses luckperms (only after a check)
show your router class
public static JsonObject getConnectResponse() {
try {
JsonObject response = new JsonObject();
response.addProperty("version", getServer().getBukkitVersion().split("-")[0]);
response.addProperty("online", getServer().getOnlineMode());
response.addProperty("worldPath", URLEncoder.encode(getWorldPath(), "utf-8"));
response.addProperty("path", URLEncoder.encode(getServer().getWorldContainer().getCanonicalPath(), "utf-8"));
response.addProperty("floodgatePrefix", getFloodgatePrefix());
return response;
}
catch(IOException err) {
return null;
}
}
that's not the whole class
it's not unrelated
this is the function im calling
?paste the full class
ok thanks, last question any method to check if is a stringlist a boolean or something else?
ok flex on me
isBoolean and isStringList
isStringList, isBoolean
?jd
^
I deleted it cause it showed my nearest speed test thing
ill give you the github repo
i need to check for each of them? just trying
there's not an auto method?
wait i didnt commit
an auto method?
Isnt my onEntityDeathEvent correct?
Shopv1.0 attempted to register an invalid EventHandler method signature "public void my.Shop.events.PlayerDamagerEvent.onPlayerDeath(org.bukkit.event.entity.EntityDeathEvent,org.bukkit.entity.Player)" in class my.Shop.events.PlayerDamagerEvent
@EventHandler
public void onPlayerDeath(EntityDeathEvent e, Player player) {
theres so much unrelated stuff i dont have to show right now
its not even getting called
why do you want to see the whole class
the player parameter is wrong
a listener must have only one parameter, which is the event
*real
to tell you what the problem is
please tell me this is not real
I mean, I don#t want to see it, you can also try to find out yourself and I can continue playing rdr2
nah i t aint xD
poof
π₯Ή
Yeah but what do you want to check in the class?
idk whats so hard about sending class
okay wait a sec
I don't want to waste my time to explain to you why I need to see your code to be able to help, either send it or don#t send it
?img
Can't send images? That's because you're not verified! Use !verify to complete verification.
Alternatively, you can upload screenshots to any image hosting site and share the link.
Here's some screenshot utilities that can use to upload images.
Lightshot: https://prnt.sc
Imgur: https://imgur.com/upload
Flameshot: https://flameshot.org
at this point why dont you just verify
how i can set a damage on an itemstack for showing different textures? (using a resourcepack)
you don't, you just use the CustomModelData
cast meta to damageable
ItemMeta#setCustomModelData
thanks
Why does it send this? https://prnt.sc/hWSEuHv6Xe1g
@EventHandler
public void onPlayerDeath(EntityDeathEvent e) {
Entity victim = e.getEntity();
Entity attacker = e.getEntity().getKiller();
if (e.getEntity().getLastDamageCause() == null) return;
if (attacker.hasPermission("vagt")) {
if (victim.hasPermission("vagt")) return;
TextComponent grunde = new TextComponent("Β§8[ ");
TextComponent S = new TextComponent("Β§aS");
S.setHoverEvent(new HoverEvent(HoverEvent.Action.SHOW_TEXT, new ComponentBuilder("1").create()));
S.setClickEvent(new ClickEvent(ClickEvent.Action.RUN_COMMAND, "broadcast 1"));
TextComponent SV = new TextComponent("Β§aSV");
SV.setHoverEvent(new HoverEvent(HoverEvent.Action.SHOW_TEXT, new ComponentBuilder("2").create()));
SV.setClickEvent(new ClickEvent(ClickEvent.Action.RUN_COMMAND, "broadcast 2"));
grunde.addExtra(S);
grunde.addExtra(SV);
grunde.addExtra(" Β§8]");
attacker.sendMessage(You killed " + attacker + " " + grunde);
}
}
because that's what you're sending
attacker.spigot().sendMesasage
i feel bad for you
you are concatting random strings with a textcomponent
so it calls Arrays.toString(...)
please stop the thumbs up

alright haha
Imagine trying to code in java without understanding
I dont got an option called attacker.spigot.sendMessage
update
spigot()
spigot() is a method on Player
it does exist in 1.8
That wont send a message
yes it will
cast attacker to Player if it is one
spigot().sendMessage()
it sends a component
which you are trying to send
((Player)attacker).spigot().sendMessage()
Duck

no duck!
Thanks, but if i want to send the components and the text in the same message cant i that?
that's what the componentbuilder is for
Yeah and when i used that before it didnt work
"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.
π what's going on
@tender shard Sorry for mention but its here
the russian is bored lol
i reactioned to only 2 messages with π and this happened
fuck yes that's a way to describe me
Random emoji spam
Ursus vodka!
i'm expressing feelings i never felt before
this is not spam mind you, this is emotions
Lol
such a good decision by discord instead of working against scam servers & such to work on super reactions
we were all waiting for super reactions!
How is white an emotion ?
i'm feeling like i'm white
yeah you're using toString there too
why do you always want to turn the components into a string
that's not how to do it
The point of components is to not use strings
Where is the problem where i am using toString?
Not random they're planned
my mysql is working π π³
yes
Nice
ggs
Where is the problem where i am using toString?
can somebody take over with emoji spam expressing feelings via reactions, i have to continue working now
thx
frick
no primary key
insert ignore?
INSERT INTO PlayerData (uuid, language) VALUES (?, ?) ON DUPLICATE KEY UPDATE language = ?
at the part where you are calling Arrays.toString(...)
ComponentBuilder builder = new ComponentBuilder("You killed ");
ComponentBuilder killer = new ComponentBuilder("victim");
builder.append(killer.create());
player.spigot().sendMessage(builder.create());
do it like this
UPDATE `PlayerData` SET `language` = 'a' WHERE `PlayerData`.`uuid` = ?```
only updates it but if it doesnt exist it ode nothing, I want it to do something even if it doesnt exist
in my project i add a player to the database on every login (which is suboptimal but for my purposes is fine) and then i can always call update, maybe you'll get new ideas from this approach
is uuid primary key?
no
theres why
why not?
during the table creation
usually it auto increments
this explains absolutely nothing
you dont really need anything auto incrementing on thiis
if you have uuid in the database why do you need an incrementable id
can I have 2 primary?
yes
example to insert or update if primary key already exists
INSERT INTO table (id, name, age) VALUES(1, "A", 19) ON DUPLICATE KEY UPDATE name="A", age=19
PreparedStatement createPlayerDataTable = this.connectionPool.getConnection().prepareStatement("""
CREATE TABLE IF NOT EXISTS 'player_data' (
'uuid' CHAR(36),
'id' INTEGER,
'choice' CHAR(8),
PRIMARY KEY (uuid, id)
);""");
example
but you only need something like ```java
PreparedStatement createPlayerDataInfoTable = this.connectionPool.getConnection().prepareStatement("""
CREATE TABLE IF NOT EXISTS 'player_info' (
'uuid' CHAR(36) PRIMARY KEY,
'banned' BOOLEAN
);""");
Okay thanks but do you know why .retain(ComponentBuilder.FormatRetention.NONE).append(Slag) is not working?
what's Slag?
probably not a thing in 1.8.8
"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.
hoping not the uk meaning
what's the uk meaning lol
elaborate on that
BaseComponent[] Slag = new ComponentBuilder("S")
.bold(false)
.color(ChatColor.GREEN)
.event(new ClickEvent(ClickEvent.Action.RUN_COMMAND, "broadcast 1"))
.event(new HoverEvent(HoverEvent.Action.SHOW_TEXT, new ComponentBuilder("1").create()))
.create();
def not that
it should be called "slag" not "Slag"
It means hit on english
otherwise it looks like a class name or type parameter
skull
ah lol
I have now but it still says net.md_5.bungge.api.chat.ComponentBuilder cannot be applied to baseComponent
have you even tried to understand why it says that?
it says that because a ComponentBUilder, as every builder, is just a builder to create the final thing you wanna have. a ComponentBuilder builds BaseComponents. So you gotta call create() on the builder to turn it into a component array
I am calling .create()
BaseComponent[] slag = new ComponentBuilder("S")
.bold(false)
.color(ChatColor.GREEN)
.event(new ClickEvent(ClickEvent.Action.RUN_COMMAND, "broadcast 1"))
.event(new HoverEvent(HoverEvent.Action.SHOW_TEXT, new ComponentBuilder("1").create()))
.create();
BaseComponent[] sv = new ComponentBuilder("SV")
.bold(false)
.color(ChatColor.GREEN)
.event(new ClickEvent(ClickEvent.Action.RUN_COMMAND, "broadcast 2"))
.event(new HoverEvent(HoverEvent.Action.SHOW_TEXT, new ComponentBuilder("2").create()))
.create();
works fine
No its the builder..retain(ComponentBuilder.FormatRetention.NONE).append(slag) that dosent work
but that method exists
what does retain return
the builder
psa - none uses 1.8 so any help given here might be in vain if the 1.8 api does not have the aforementioned metohd
I mean the place where i combine the componentbuilder
start
.retain(ComponentBuilder.FormatRetention.NONE).append(slag)
.append("Β§7, ")
.retain(ComponentBuilder.FormatRetention.NONE).append(sv)
The error is that i dont know how to combinde the components how i make so theyre in a line is if i send 1 2 3 4 to a player i can click on all the numbers 1-4 and it will run a command and have a hover
did anyone notice that the mojang api got nerfed
it went from 600 req a minute to 10 requests every 5 seconds ratelimit
each number get 1 component
you then send it with componentOne.append(componentTwo).appened(componentThree).appened(componentFour)
it's also possible to append an array of basecomponents
I have tried that because when i use componentOne i dont got a option called .append after componentOne
im coding a custom mob plugin and i think my code wont be able to handle multiple custom mobs at once. am i right? how can i fix it?
//spawn mob code
HypixelCustomMobs plugin = HypixelCustomMobs.getPlugin();
plugin.getMobManager().getMobData(args[0]).spawn(p.getUniqueId(), p.getLocation().add(0, 1, 0));
//spawn method
public void spawn(UUID spawner, Location location){
this.spawner = spawner;
this.mob = (LivingEntity) location.getWorld().spawn(location, type.getEntityClass(), false, (m) -> {
m.getPersistentDataContainer().set(HypixelCustomMobs.getPlugin().getIsCustomKey(), PersistentDataType.INTEGER, 1);
m.getPersistentDataContainer().set(HypixelCustomMobs.getPlugin().getUuid(), PersistentDataType.STRING, uuid.toString());
m.setCustomName(name);
m.setCustomNameVisible(true);
((LivingEntity) m).setMaxHealth(health);
((LivingEntity) m).setHealth(health);
if(hasArmor) {
((LivingEntity) m).getEquipment().setBoots(boots);
((LivingEntity) m).getEquipment().setLeggings(leggings);
((LivingEntity) m).getEquipment().setChestplate(chestplate);
((LivingEntity) m).getEquipment().setHelmet(helmet);
((LivingEntity) m).getEquipment().setItemInMainHand(hand);
}
((LivingEntity) m).getAttribute(Attribute.GENERIC_MOVEMENT_SPEED).setBaseValue(speed);
});
if(hasBossBar) {
bossBar = Bukkit.createBossBar(name, BarColor.RED, BarStyle.SOLID);
bossBar.setVisible(true);
bossBar.setProgress(1.0);
bossBar.addPlayer(Bukkit.getPlayer(spawner));
}
uuid = UUID.randomUUID();
HypixelCustomMobs.getPlugin().getMobManager().addMob(uuid, this);
}
use ?paste for text walls in the future PLEASE
use a component builder then
new ComponentBuilder().appeneds().create
Since when?
if i have to tell another person to use ?paste for very long code i'm going to fucking commit blanket
Yeah but the problem is that i want to send components and text and that my problem
?paste
you must use components instead of strings for the normal text
all text will be a component
requested delay 750
requested delay 750
requested delay 750
rate limited delay 750
requested delay 2500
rate limited delay 750
requested delay 2500
rate limited delay 750
requested delay 2500
rate limited delay 750
requested delay 2500
rate limited delay 750
requested delay 2500
rate limited delay 750
rate limited delay 2500
rate limited delay 2500
rate limited delay 2500
requested delay 2500
requested delay 750
Thatβs interesting
tbh I wouldn't know any use case where you'd have to do more than 10 requests in 5 seconds
Well it used to be 600rq/10min
im coding a custom mob plugin and i think my code wont be able to handle multiple custom mobs at once. am i right? how can i fix it?
so that is 60rq/min or 1rq/s, if you now have 10rq/5s that is 2rq/s, no? So its been buffed then
why wouldnt it be able to handle more than one mob at once?
Okay here is the code, and i dont know how the send the components and the text
https://paste.md-5.net/necadukaca.cs
600, no?
600 but per 10min
oh right
Yeah, and if they now say its 10 per 5 sec then thatβd be double the rate
@wicked vector no?
because im not creating a new class for every custom mob and when i try to do new plugin.getMobManager().getMobData(args[0]) it doesnt work
yes, but burst requests are completely broken
Thatβs true
getting an error for the packet which is strange since im pretty sure it matches the constructor?
plyr.connection.send(new ClientboundRespawnPacket(
plyr.getCommandSenderWorld().dimensionTypeId(),
plyr.getCommandSenderWorld().dimension(),
plyr.getCommandSenderWorld().getWorld().getSeed(),
plyr.gameMode.getGameModeForPlayer(),
plyr.gameMode.getPreviousGameModeForPlayer(),
plyr.isReducedDebugInfo(),
isFlat,
(byte) 1,
plyr.getLastDeathLocation()
));```
wdym with "creating a new class"? why would you create a new class for every mob?
hypixel stats checker
just look at the code
you will understand
and what is the error exactly
Can someone please help+
I thought hypixel was given bypass to the rate limit
i did
cannot resolve constructor
I didn't
what does your ide say? what constructors are available?
going past those numbers results in a 30 second timeout which is extreme
Yeah thatβs def extreme
you are still trying to append a string
you have to appened a component
go and learn java then come back
you continue to have very basic java issues that you can solve yourself if you know java
Where?
and still using hardcdoed Β§ colors while using a component builder
Anyone have an idea how to block a TntPrimed entity from moving with another tntprimed's blast?
Yeah but thats not what i am focussing on its the start.retain(ComponentBuilder.FormatRetention.NONE).append(slag) that is not working
there is a var10 that fixes the issue but im unsure what goes in there
plugin.getMobManager().getMobData(args[0]).spawn(p.getUniqueId(), p.getLocation().add(0, 1, 0));
in here im using one of the registered custom mobs which is a CustomMob class and then spawning it. but then, im modifying the data of the registered entity that is used for spawning custom entities and not a new class for the new spawned entity
then, the bossbar will show the second spawned entity and not the first spawned
see if the nms mapping browser can tell you that
?mappings
Compare different mappings with this website: https://mappings.cephx.dev
it probably wont work because of the string appending
fix that first
it was portal cooldown tysm
np
the new mappings browser still hasn't fixed the modifiers for interface methods
where
open any interface class - i currently can't think of one
interface method modifiers ? 
interface MyInterface {
void doSth();
}
doSth is public and abstract, the mappings browser shows it as non-abstract and package-private
https://paste.md-5.net/epofodemon.java this is almost all of the code that is releated to my problem
you will probably understand it
Same problem
start .retain(ComponentBuilder.FormatRetention.NONE).append(slag) .retain(ComponentBuilder.FormatRetention.NONE).append(sv)

interfaces don't have the concept of package private methods.
nor of abstract methods
Method method = Class.forName("MyInterface").getDeclaredMethod("doSth");
Modifier.isAbstract(method.getModifiers());
Modifier.isPublic(method.getModifiers());
both should show true
the method itself is public and abstract
because any method is public by default in an interface
and that's what the browser is supposed to show
whats the point in displaying it as public lol
how else would you differentiate between a default method and a non-default method if the browser doesn't show the "abstract" modifier
Why cant it apply slag the the component?
start
.retain(ComponentBuilder.FormatRetention.NONE).append(slag)
.retain(ComponentBuilder.FormatRetention.NONE).append(slagvagt)
I mean, I'd expect a default infront of default methods xD
lets see if it does that
to show that it's not a private method
oh ppl are ignoring me
im just gonna go see how MythicMobs did it
I mean, given that public is default, wouldn't it make more sense to mark private as private
tho I guess yea
that would break stuff, well not really break just not be consistent
interfaces can have abstract methods, or default methods. they can have public methods and private methods.
The mappings browser should correctly show what it actually is
instead of just showing nothing and making people guess
Yea but the default is public and "abstract"
that means that the absence of the abstract modifier would mean different things when viewing an interface or a class, that makes little sense
also as said, if it does not show the abstrac tmodifier, you cannot differentiate abstract from default methods
because it also wouldn't show "default" for non-abstract methods
I'd appreciate a default modifier a lot more lol
rather than a random "abstract" all over the place
well if a method is abstract, it should show as abstract. the old mappings viewer does it correctly
doesn't matter that the keyword is not required in the java code itself - the method is abstract and Modifiers.isAbstract returns true and hence that method is abstract
there's actually little to discuss here lol
there is ?
Default interface methods are like kotlin extension functions *runs*
where?
what java reflection returns does not equal what a mappings viewer that wants to effectively communicate information should show
well that's your opinion, mine is different. it should show the correct signature of that class including its modifiers
Yea
if (language.isEmpty()) {
plugin.message.setLang(player.getUniqueId(), "en");
}
can mysql strings be empty?
I mean yeah
or I guess not really, not much point in smacking two opinions against each other
cause its not printing my debug message
if its empty
how do I detect if it doesnt exist?
it shows "createTick" correctly as implemented method, but nextSubTickCount() (which is abstract) is also shown as implemented method
I also want all interfaces to include the abstract modifier, and al records to include the final modifier
how is one supposed to know that one of those methods has an implementation while the other is abstract, if both show up without ANY information
I agreed long ago, a default is missing
yeah but that's kinda the wrong way around
no it's not
there is no other place where implicit modifiers are present
also classfile modifiers != java modifiers
ok imagine you see this: Is this method abstract or not?
depends on its context
a DeFaUlT mOdFiEr iS miSsIng
if you'd see the same thing, literally exactly the same screenshot, but it was taken in another class, then it'd mean that this method is package-private and has an implemtation.
if looking at an interafce, it means it's public and may or may not have an implementaiton
i could say the exact same thing for any regular method on javadoc
it's not specific to the mappings viewer
if anything, the viewer should align with the javadoc layout
I mean, better create a method for package private stuff too then
because, I always only look at a single thing, context is something I agressively avoid
that's a fair point
the javadocs are weird, it does show up in "abstract methods" but without the modifier
imho the javadocs should also show the abstract modifier
but yeah either way, the new mappings browser is definitely doing it wrong right now
i wonder why they changed the site in the first place, the old browser was working totally fine D:
It's a successor to NMSMapper with many new features, such as support to view generics or parameter names, but mainly, it has much better performance than NMSMapper will ever have, so we have decided to deprecate this project in favor of takenaka.
I doubt that the frontend has anything to do with the performance of generating the mappings
I'm just talking about the HTML stuff
Have not looked into the old NMSMapper code, the new one is a single gradle project
the html pages are generated in kotlin
wooooo finally
Hmm I think showing all modifiers for all methods under method details could get quite confusing for the reader, especially when you start to involve many subtypes that may not be interfaces, just speculating tho
it would be better if you make it work with lowercase π
its a test plugin for some utilities
so player friendliness is kinda ignored
I finally get to not use AnviLGUI which is such a weird thing to use xD
Also if you think abstract shouldnt be shown, then enums also shouldnt show the final keywoard but show up in a separate enum constants list
One thing that came directly to mind is that a default method becomes a concrete method for a concrete type, so already there would you use an βinstanceβ modifier then or just remove it for its subtype?
And public and static*
Might be nice to fix then
its not like the project is perfect lol, it is open source and work on it is still ongoing
how can i make a custom skeleton do bow shooting animation?
I am sure feedback is always appreciated
Yeah i just dont get it how the new version is so incomplete while the old one did everything correct imho lol
And then one gets mocked for using the old one even though its just objectively better or at least consistent lol
open an issue?
"so incomplete" is a wild statement
complaining in the wild isn't going to get the project anywhere
I will just continue to use the old one as long as it works perfectly
I doubt anyone is stopping you
you could, hear me out for a second
open an issue and use the old one for the time being
then shut up
Its inconvenient
I just cannot comprehend why they abandoned a totally fine working project and make it worse than the original one lol
yeah but then they shouldnt claim the old website is "deprecated" until the new one is actually done
Im sure there are plenty of reasons why a rewrite happened
yeah anyway that's just my opinion, everyone is ofc free to disagree
Yeah I mean the definition of βactually doneβ can sometimes be preferential per say, in some eyes the new one may be seen as finished, whilst in other eyes maybe just not yet 
trying to change the player's skin. was working before but now it doesn't change the skin to the desired texture
https://paste.md-5.net/ayatawahej.coffeescript
why does it show this error in console when everything is right???:
java.lang.NullPointerException: Cannot invoke "org.bukkit.command.PluginCommand.setExecutor(org.bukkit.command.CommandExecutor)" because the return value of "org.sveaty.items.Items.getCommand(String)" is null
at org.sveaty.items.Items.onEnable(Items.java:24) ~[Items-1.0-SNAPSHOT.jar:?]```
here my code of main class:
```package org.sveaty.items;
import org.bukkit.plugin.java.JavaPlugin;
import org.sveaty.items.commands.explosivewand;
import org.sveaty.items.coustumitems.ExplosiveStick;
import org.sveaty.items.coustumitems.ItemManager;
import org.sveaty.items.commands.wandcommand;
import org.sveaty.items.events.OnEightClick;
import org.sveaty.items.events.onRightClick;
public final class Items extends JavaPlugin {
ItemManager im= new ItemManager();
ExplosiveStick ie= new ExplosiveStick();
@Override
public void onEnable() {
// Plugin startup logic
im.createWand();
ie.createExplosion();
getServer().getConsoleSender().sendMessage("Server has Started!");
getCommand("givewand").setExecutor(new wandcommand());
getServer().getPluginManager().registerEvents(new onRightClick(), this);
getServer().getPluginManager().registerEvents(new OnEightClick(), this);
getCommand("explosive").setExecutor(new explosivewand());
}
@Override
public void onDisable() {
// Plugin shutdown logic
}
}
org.sveaty.items.Items.getCommand(String)" is null
Hows ur plugin.yml looking
wdym by do bow shooting animation
https://github.com/zlataovce/takenaka/issues/25 couldnt help it
Ah seems like against all odds the bathtub issue was created (:
like, make it load a bow in an animation
the animation before you shhot a bow
here:
version: '${project.version}'
main: org.sveaty.items.Items
api-version: '1.20'
commands:
givewand:
description: Give wand!
explosion:
description: Give explosive stick!
the only way is using NMS and sending packets to players far as i know
you know the packets i should send?
change explosion: to explosive:
since in ur code u call getCommand("explosive")
unfortunately i have no idea
okay
buy i know that bow has some stages
you should send packets rapidly
look at mojang codes
ah sh ty for help!
i'll take a look at that.
how can i add fake players to tab list with protocollib
you know where can i see the list of all the packets?
^
lesgooo
ty
found only this but i cannot make it work, all the time i got error that nothing in the packet was found ```java
packet.getPlayerInfoAction().read(0)
PacketType.Play.Server.PLAYER_INFO
nice 
I also included an argument for showing abstract instead of default - defaultis not a modifier and hence doesn't belong into the modifiers column :p
why does mojang even obfuscate their stupid .jars
sadge
I mean, spigot has always been on the safe side of things
(c) 2020 Microsoft Corporation. These mappings are provided "as-is" and you bear the risk of using them. You may copy and use the mappings for development purposes, but you may not redistribute the mappings complete and unmodified. Microsoft makes no warranties, express or implied, with respect to the mappings provided here. Use and modification of this document or the source code (in any form) of Minecraft: Java Edition is governed by the Minecraft End User License Agreement available at https://account.mojang.com/documents/minecraft_eula.
The "redistribution" part is kinda out there
it's funny how they prohibit you from distributing them complete und unmodified but don't say anything about removing only one line and distributing them then
Welp
but yea, spigot at least is consistent with their legal vibes
I mean, they could have switched to paperclip like distribution
but iirc the binary patch thing is also a grey area
so
Β―_(γ)_/Β―
isnt paperclip a big gray areaq
Kinda
yeah well I mean there isn't really any difference between decompiling something with preset parameters, applying changes using patch files that partly even already contained the decompiled code, then compiling it again, to just distributing only a binary patch that does not include any decompiled code at all - but try to explain that to a judge who can't even calculate what's 20% of 100
question at this point is, given how long mojang has not done anythinga gainst it, if they could still sue 
but yea
judges and their digital knowledge of shit
make this rather useless
mojang should be grateful, as if anyone'd still play the game if plugins or mods wouldn't exist
I mean, pretty sure they are happy
They are cooking some really good stuff in 1.20.2 for servers
Minecraft realms 
is that so? what?
are they finally adding chicken wings :mmm:

they added configuration phase to the network phases
so you can resync stuff with the client post login
is that inbetween login and play?
yea
ah
but can be re-entered
ok well that's not something I would remotely need lol

What kind of stuff
Oo
hmm
proxies will also obviously cry tears of joy
that does sound promising
why is the outer layer of the skin not showing? https://paste.md-5.net/upoqarurif.java
I wonder why they're adding that though
Their visibility is part of the metadata packet
Quick question:
I have the following Stream
final List<String[]> splitKeys = Arrays.stream(nbtPathString.split(this.utils.separator))
.map((s) -> s.split("(?<=\\w)(?=\\[\\d+]$)"))
.collect(Collectors.toList());```
How could I make it return `List<String>` instead?
So I wanna "unpack" the String arrays and add it to the stream.
Or do I really need to make a seperate stream for that?
yea isn't that what the setentitydata packet is for
Can someone please help, when i kill a player it sends CraftPlayer{name=(my name)} net.md_5.bungee.api.chat.COmponentBuilder@(some letters)
This is my code: https://paste.md-5.net/baqalogafe.cs
why do you get help, then remove everything you got told
you HAVE to use Player#spigot().sendMessage
how does the original list look like, and how do you want it to look like in the end?
Sorry i just tried to fix it and forgot it
because obviously you cannot just turn a String[] into a string without losing information
Original List? I assume you mean String, or?
Ah, I think I know what you mean; Gimme a sec and I'll write an example
better question: How does your List<String[]> look like, and how do you want the List<String> to look like?
He wants to flatten it
String: Inventory[0]##tag##meta##size
Split String (String[]): [Inventory[0], tag, meta, size]
Second split in the stream: [Inventory, [0], tag, meta, size] (Just removed the array index from the text)
ye
uugh I don't really understand that
I think I have a solution, but it would still require atleast one more stream, was just interested if I could do it in one
why not just map() the stream another time to turn your string[] into a string
what prevents you from flatMap
Cause I want the individual Strings, I can't just concat them
Yeah but when i do that it still dosent send the text it sends TextComponent.... to me
so send it to the other player
List<String> list = new ArrayList<>();
for(String line : nbtPathString.split(this.utils.separator)) {
for(String split : line.split("(?<=\\w)(?=\\[\\d+]$)")) {
list.add(split);
}
}
Nothing, does that have a different approach to map?
just, .flatMap(s -> Arrays.stream(s.split("regexHere")))
once again, something very very basic you can do yourself if you just go and learn java
wait... so what's the difference between map and flatMap?
i still don't understand what "Inventory[0]" is supposed to be if it's a string[]
u can middle click it
flatMap expects you to map to a Stream<T>
and u have javadocs
and then concats the streams into a single stream
