private HashMap<UUID, Long> cooldown = new HashMap<>();
@EventHandler
public void onAsyncPlayerChatEvent(AsyncPlayerChatEvent e){
Player p = e.getPlayer();
if (!cooldown.containsKey(p.getUniqueId())) {
cooldown.put(p.getUniqueId(), System.currentTimeMillis());
return;
}
long timeElapsed = System.currentTimeMillis() - cooldown.get(p.getUniqueId());
if (timeElapsed >= getConfig().getInt("chat-cooldown")) {
cooldown.put(p.getUniqueId(), System.currentTimeMillis());
return;
}
int remaining = getConfig().getInt("chat-cooldown");
e.setCancelled(true);
timeElapsed = remaining - timeElapsed;
p.sendMessage(Utils.color(getConfig().getString("chat-cooldown-reached").replace("%seconds%", String.valueOf(Math.round(remaining/1000)))));
}```
it doesnt work correctly and when i am on cooldown and i send a message it actually cancells the event but doesnt say anything except for this error in the console https://pastebin.com/wARyV11H
#development
1 messages · Page 1 of 1 (latest)
it exactly tells you what's null
whats at row 229?
p.sendMessage(Utils.color(getConfig().getString("chat-cooldown-reached").replace("%seconds%", Integer.toString(Math.round(remaining/1000)))));```
^ thats where the null is
maybe your config in your server is not updates?
updated**
it is, also i had it in the config for a long time but im just recoding the cooldown system
the path is messages.chat-cooldown-reached
ah yes
Ohh, thanks!
hey i have 2 projects that each depends the other one
both projects have errors because project A use some code from the B but
also project B uses A i need to use publishToMavenLocal but i can't because projects have error again
i don't know what to do rn
maybe i can remove all imports from a project but it's the last option
also using gradle for both
i guess the problem can be easily solved by ignoring errors when i run publishToMavenLocal but how can i do that
Why do the projects depend on eachother?
actually 2 plugins
well it depends because
idk if the structure is wrong
but it seems that it makes sense
If they depend on each other, then it doesn't really make sense
one of them is a plugin for a minigame all stuff inside it
and the other is a weapon plugin
for example
i need to give weapon in minigame plugin and check teams for weapon plugin
the weapons plugin shouldn't rely on the minigame plugin at all
well i need to check shooters and the victims teams
maybe i can create a custom shooting event for that but yeah
Your weapons plugin should provide everything necessary, but not handle it
i can divide it into like 3 plugin and create a new one to handle common things
but thats not really practical rn
yeah i guess i need to make a common plugin and events for the weapon plugin
weapons plugin should provide weapons functionality only
minigames plugin should take advantage of the fact the weapons plugin is present and make use of it, adding all the minigame-related features to it
rather, bringing weapons into the minigame uh ecosystem (?)
so i just need to add an event for the weapon plugin and check the teams in minigame plugin
it's probably gonna be more than just "an event"
anything that makes one plugin interact with it to make things works smoothly
what that is and how you do that depends on how you've structured the weapons plugin, nothing I can really tell you
yeah i was just trying to ignore the errors for a while to add dependencies
but i need to change the structure first
How do I support multiple different versions for a plugin? I for example have a way of filling an area with a material entered in the chat, the material is selected via Material.valueOf(). How would I do this with say 1.18 and 1.19 since they include different materials? I assume I list them both as dependencies in the pom and then use different classes for it. Would I then have a "place block" function that takes in a string, gets the spigot version and redirects to the correct class from there? And does that mean I have to rewrite the same chunk of code for each version?
Pls ping if you respond :>
Material.valueOf(String) doesn't work any different between versions
If the player types "STONE" then stone will be on every version, if the player types "COPPER_ORE" then it'll work if the server version contains copper ore, it won't work if the server version doesn't contain copper ore
At most put the valueOf inside a try-catch block, catching IllegalArgument in case the entered text is not an enum constant
I'm getting errors I can't figure out, I may of found the issue, this should not return null right? getLogger().warning(String.valueOf("mainclass = " + this.getServer().getPluginManager().getPlugin(Library.AURELIUM_SKILLS.getInternalPluginName()))); [21:11:54] [Server thread/WARN]: [Autorank] mainclass = null
depends on what Library.AURELIUM_SKILLS.getInternalPluginName() returns
also, what are you trying to achieve?
internal name of plugin called Aurelium Skills
maybe I'm not getting that info right
Why not just put a string literal?
Something like Aurelium Skills or, if this is getting your own plugins instance, I would suggest creating a static instance, and set it in your on enable, along with a static getter.
I need to see if the plugin is installed or not
this is how I do that when registering my papi expansion: ```java
if (Bukkit.getPluginManager().getPlugin("PlaceholderAPI") != null) {
new PAPIExpansion().register();
}
thats what I have but don't work
then the plugin name is wrong
are you sure that Library.AURELIUM_SKILLS.getInternalPluginName() returns the plugin's actual name, that is defined in the plugin.yml?
I know why it is null I need to install the plugin
yeah, if it isnt there, it will return null, if it is there, it will give you a JavaPlugin instance
making to many mistakes, will be done soon
all good, I still make mistakes like that lol
he has AureliumSkills vBeta 1.3.6 for internal name
So I'm having issues with generics (again).
Shouldn't this work? Or is it not known at compile time?
final DatabaseColumn<String> column = DatabaseColumn.builder("first_column").
// Required type: DatabaseType<java.lang.Object>
// Provided: DatabaseVarChar
type(DatabaseTypes.ofVarChar(32)).
key(DatabaseKey.PRIMARY).
public static class Builder<T> {
private Builder(String name) {
this.name = name;
}
public Builder<T> type(DatabaseType<T> type) {
this.type = type;
return this;
}
// class is
// public class DatabaseVarChar extends DatabaseType<String>
// DatabaseType class is:
// class DatabaseType<T>
public static DatabaseVarChar ofVarChar(int length) {
return new DatabaseVarChar(length);
}
Please ping me if you know the issue, thanks!
Nvm I'm dumb
Had to do DatabaseColumn.<String>builder("first_column") and I was going DatabaseColumn<String>.builder("first_column")
\✨Java\✨
hey it makes sense this way besides the missing type inference
I want to prevent players from dropping items in creative. It works fine if the player has their inventory closed and clicks q (ctrl + q works too), however if the player has their inventory open and clicks q or ctrl + q on the item it just disappears. Any idea how to fix it? I currently just listen for a PlayerDropItemEvent and cancel it. However when I drop it from the inventory the event is not called for some reason, and I can't use a InventoryClickEvent as the click type will be CREATIVE and I don't want to block slot change.
There's ClickType.DROP for InventoryClickEvent
Yeah ik, but that is replaced with ClickType.CREATIVE if the player is in creative and has their own inv open
For some reason
I see
creative inventories are irritating af
i wish they were serverside
or atleast sends more packets
Why my custom model data removes itself when I got creative mode ?
(it's an armor item)
nvm it was because of exploitfixer
I have tried many combos and can't get this error to go away https://paste.helpch.at/disogicaqa.md it only happens after a minute a player joins, then spams every minute after that.
code?
Hello, I am having an issue, with my serialization process, this is my first time working with it, so bear with me. Thank you in advance.
https://pastebin.com/tVfi0gji
https://pastebin.com/5iRQT9DU
https://pastebin.com/F5pQLZP4
https://pastebin.com/UZWMyssW
When I click a new phantom membrane and close the inventory with a singular piece of stone placed in it
[20:29:43 INFO]: [Backpack] [STDOUT] [-84, -19, 0, 5]
[20:29:43 INFO]: [Backpack] [STDOUT] End of close inventory
[20:29:43 INFO]: [Backpack] [STDOUT] []
When I try to click that same phantom membrane to reopen the inv, inv doesn't open either.
[20:30:34 INFO]: [Backpack] [STDOUT] else
[20:30:34 INFO]: [Backpack] [STDOUT] []
[20:30:34 INFO]: java.io.EOFException
[20:30:34 INFO]: [Backpack] [STDOUT] Deserialized
I am sorry for such long message
But i have gotten it down to that what i am saving to PDC is nothing- so most likely that is causing the Exception when it tried to deserialize it.
I'm your close inventory listener stop using getItemMeta all the time, gIM returns a copy of the ItemMeta, so this line heldItem.setItemMeta(heldItem.getItemMeta()) is effectively doing nothing; put the meta in a variable, modify it all you want and then use it in setItemMeta
Also for deserialising you are using a BukkitObjectInputStream, don't, use a regular ObjectInputStream
@obsidian sonnet
Although in reality ObjectStreams should not be used either, and use a DataInput/OutputStream instead but it's not the end of the world because of that
Alrighty, I will try what you have suggested. Thank you.
@dense drift that's the weird part the cause don't point to my plugin, unless I'm reading it wrong, when I updated to the latest Aurelium Skills to Autorank and everything works fine as long as server has Aurelium install
return isPluginAvailable(Library.AURELIUM_SKILLS);
}
public boolean hook() {
return isPluginAvailable(Library.AURELIUM_SKILLS);
}``` for checking if plugin is installed
what does that method do?
checks skill levels, stats and mana
I'm talking about isPluginAvailable
You might access a class from AureliumSkills before checking if it is enabled
I thought it was a bukkit think guess I will find that method
Plugin plugin = Bukkit.getServer().getPluginManager().getPlugin(library.getInternalPluginName());
if (plugin == null) {
return false;
} else {
return !library.hasMainClass() || plugin.getDescription().getMain().equalsIgnoreCase(library.getMainClass());
}
}```
Hmm it seems that something with my ByteArrayInputStream bis = new ByteArrayInputStream(bytes); ObjectInputStream ois = new ObjectInputStream(bis) is causing the [20:30:34 INFO]: java.io.EOFException as it still happens when I apply the changes you have suggested, but now the byte array actually has information in it.
How do I get the direction a living entity is looking as a Vector?
entity.location.direction
Alright I'll check in a few minutes, it seemed like it should work
I thought that was a Vector pointing from 0, 0, 0 to the location :V
🧠
Thnx
Well, Location as a Vector itself is that, but Location also has yaw and pitch, that's what its direction is :d
I just realised that that makes so much more sense. I thought that was stored in the entity for some reason
lol
Alrighty, jus ping me once you have a suggestion or solution.
Uhm, If I use the holograhpic display's api, when you create a hologram, you name it, does that also show in /hd list? Cause like, I want to create A LOT of holograms, and I don't wanna spam the list and hide actual holograms that may need to be changed
most likely not
just test?
but honestly, if its not per person (aka placeholders etc) just use armor stands with ticking disabled
setCanTick(false)?
k thx
Uhm, any ideas why this might be not working?
Consumer<Chunk> consumer = chunk -> {
ArmorStand as = (ArmorStand) chunk.getWorld().getEntity(uuid);
if (as != null) as.remove();
};
loc.getWorld().getChunkAtAsync(loc, consumer);
Like, I am 100% sure the armorstand with that uuid exists.
And well, it only gets executed when the chunk is loaded right?
so, what could be causing issues
quite confused
println(armorStand)
What part isn’t working as expected?
yes
deletion
eh I can't rlly replicate it since it happens sometimes with players on the server
not always
tried replicating it and didn't work soo
unsure if adding that will help much
So the entity is null or does it call the method?
Also, does it only happen if the chunk isn’t loaded?
println(armorStand)
it's called debugging
Also, entities are loaded separately from the chunk
There's a EntitiesLoadEvent now
Maybe that's why? No idea
But please print stuff, it's called debugging, it helps everyone help you
I am aware of what it is lol. Also, if entities are loaded separately then how can I load them? Cause if they aren’t loaded, I can’t get them
IntelliJ Debugger 😌
pretty sure it should work if you delay it by one tick
Delay what exactly, the deletion? I mean, it only doesn’t work sometimes so how would that change anything?
Yes
But everything is sync, shouldn’t it wait for getEntity to return? Lol
Quite confused on how a delay could do it
meh the methods to get the chunk directly only if it's loaded aren't exposed as it seems :/
that's not the problem, but the entities aren't added to the chunk in the tick the chunk is loaded
Oh, so why does it works sometimes and sometimes it doesn’t?
.
I'm not the one sitting in front of it, so you'll know better what's going on
I can only tell you what I remember from 2 1/2 years ago
how do you know the chunk wasn't loaded?
Well I left it, no one was loading them for like 30 minutes, just a plain chunk with nothing in it
so you assume the chunk wasn't loaded?
I suppose yes.. good point….
updated
https://pastebin.com/mjdzLF3X
https://pastebin.com/brrwnq8z
https://pastebin.com/xRjbxrfT
https://pastebin.com/22AvEwTy
When I attempt to click on an item that has had the byte array set it shows this in console.
[15:57:23 INFO]: [Backpack] [STDOUT] else
[15:57:23 INFO]: [Backpack] [STDOUT] [-84, -19, 0, 5]
[15:57:23 INFO]: [Backpack] [STDOUT] [-84, -19, 0, 5]
[15:57:23 INFO]: java.io.EOFException
[15:57:23 INFO]: [Backpack] [STDOUT] Deserialized
How do i fix said java.io.EOFException
hmm
can you change this
try (ByteArrayOutputStream bos = new ByteArrayOutputStream(); ObjectOutputStream oos = new ObjectOutputStream(bos)) {
writeInventory(inventory, oos);
return bos.toByteArray();
} catch (IOException e) {
System.out.println(e);
return null;
}
to this
try (ByteArrayOutputStream bos = new ByteArrayOutputStream()) {
try (ObjectOutputStream oos = new ObjectOutputStream(bos)) {
writeInventory(inventory, oos);
}
return bos.toByteArray();
} catch (IOException e) {
System.out.println(e);
return null;
}
@obsidian sonnet
Yeah sure one sec.
It works, can you explain what exactly you changed that caused it to work? So I know for future reference.
Some output streams buffer/store data you put into them before "sending" it to the other stream (in this case, the object stream buffers/stores some of the data before sending it to the byte array stream)
Output streams can be flushed, meaning it will send immediately any data they might have buffered; what using a try-with-resources does is, when your code exits the scope of the twr it will be flushed (and also closed)
try (ObjectOutputStream oos = new ObjectOutputStream(bos)) {
writeInventory(inventory, oos);
// inside the scope of this try-with-resources
}
// outside of this scope of that twr, oos is flushed and all its buffered data is written to the bos
So moving it that way you basically ensure the data you need from the "outer stream" is actually written into it once you're done with the "inner stream"
Ahh alright, thank you for the help!
I didn't know OOS buffered stuff lol
I am trying to Iterate through a hashmap, but all things that i found online don't work for me (when i hover over it it says its abstracted and cant be used)
example of what i tried:
if (x < 0 || map.size() < x) {
throw new IndexOutOfBoundsException();
}
Iterator<Map.Entry<String, Location>> it = new ListIterator();
for (; x > 0; --x) {
it.next(); // ignore the first x values
}
return it;
}```
(btw i am trying to get the next item in the hashamp from a specific index)
HashMap doesnt preserve order btw
so if i do this
map.put(k1, v1);
map.put(k2, v2);
map.put(k3, v3);
it will not stay like that?
it will, if its a hash map
if order is important, you might need to reconsider your usage of a map
Can someone tell me why this takes three seconds for my PC to do? I'm not doing anything else on my pc when I run it. https://paste.helpch.at/zupahiruru.cs. The time is printed using System.currentTimeMillis()
double check you're not using old code
this
there is absolutely no way that a single constructor call takes 3 seconds
even if you're using a potato
Conditions.assertNotNull could also be doing something funky but i doubt it
that function seems to be as fast as it gets, look at the times lol
yeah so something else is severely wrong
inb4 allocated 64GB to the JVM and it's time for a GC cycle
public static void assertNotNull(Object o) {
if (o == null)
throw new ConditionException();
}
That is it lol
Idk what it all is abt
This 3s time
thats the only thing i can think of
nothing else makes sense
???
What Emily said
What does it mean :V
you dont have any free memory and so the jvm needs to free some up
this is extremely unlikely
Very
I allow it to use 32 GB, and all 8 files I load that way all take 3.5s exactly there
I am
But I did not include the code in the paste
I read it further down
After the 3s delay
are you sure
Yeah
is jstat Kotlin?
no...?
it's literally made by oracle and part of the jdk lmao
and has "J" at the start not "K"
for some reason it is not in my JDK then
old version?
jdk 16
it just started to work, go figure
watching a video on nested classes and wanted their code to play with till I understood it
ok now that I have hit a brick wall I need a little help I'm working on Nested Class a local inner class I can't call the method on main class https://paste.helpch.at/ixewecijod.java nested class https://paste.helpch.at/ewudivipoq.java
either way I want to try to see if this will fix my issue
those aren't nested/inner classes
they are local to the method
they only exist within the method they are declared in
if you want to access them from the outside, either make them inner classes
class Outer {
class Inner {
}
}
or just a whole separate class altogether
(did you know you can have local interfaces, local enums and local records too since Java 16?)
I want to allow for the use of alias commands. As default I have a command that is /cage, say the owner wants it to be /walls, how do I make it register? I can't include it in the plugin.yml as I don't know the commands when I compile the plugin.
you can register it through reflection most likely
not sure if the internal bukkit command map is public
the commandmap is public on paper but not on bukkit or spigot
have a feeling the command needs to be entirely dynamically registered if going that route
iirc you can't modify entries already in the command map?
idk matt knows more about it
could just register a new command with the alias
and hook them up inside the plugin
@lyric gyroI re-watched the video and realize I was to tired the first time I watched it
So my if statement will activate for things such as if you name a dispenser in an anvil called backpack and open and close it. which then throws an error bc of null item meta etc. Is there a way to get around this from happening?
https://paste.helpch.at/cuwecadoti.java this works as long as I have Aurelium Skills install, I get this error when I don't have Aurelium installed https://paste.helpch.at/usunawilul.md
whats at library 88
you cant use a class from a package you dont have
AureliumSkillsHook.class this wont work if you are lacking the dependency
wait, is that from the dependency even
I have 21 other hooks setup this way and they work fine
just realized its your class name
this one worked before they changed their API
if I remove all code that checks the data required in the plugin it works fine, with or without the plugin. it hooks or dont hook
nowhere in my code I have that, it's com/archyx/aureliumskills/skills/Skills
me.armar.plugins.utils.pluginlibrary.Library.getHook(Library.java:88) its here
that is only ``` public Optional<LibraryHook> getHook() {
if (this.hook == null) {
try {
this.hook = this.libraryClass.getDeclaredConstructor().newInstance();
} catch (NoClassDefFoundError | Exception var2) {
Bukkit.getLogger().info("Could not grab hook of " + this.getHumanPluginName());
var2.printStackTrace();
return Optional.empty();
}
}
return Optional.of(this.hook);
}```
no imports in that class for Aurelium
well there wont be since you are using this.libraryClass
this.hook = this.libraryClass.getDeclaredConstructor().newInstance(); cant do this on an dependency you dont have
that code above is in Library.class
this is fine though no?
your code returns an empty version i assume if it doesnt exist
and the "error" is just the stacktrace
var2.printStackTrace(); from here
I didn't write this part of the code, I am trying my best to understand it
if you dont want it printed (and you handle that dependency not existing) then stack trace is not needed
try {
// get a new instance of the class provided
catch // class doesnt exist {
// do stuff if class doesnt exist
}
thats what it is doing
and it returns return Optional.empty();
whatever this is
if you dont want the stack trace on the console
remove this line
var2.printStackTrace();
but make sure you that you dont use the hook (aka the dependency) anywhere else if it returned an Optional.empty()
otherwise, you will get the exact same error again
I went on the assumption I didn't something stupid with imports and I delete the class and remade it
nope still give error
imports wont cause that
you need to use the class to get that issue
as in the code needs to run
when I remove the imports and any errors that come from doing so the error goes away, my guess the issues is with Aurelium Skills not my code
yes, since then you dont actually "hook" to their code
I put a check in the stacktrace to ignore aurelium skills
no it still hooks, just don't get the data required for the checks
yes like xp for a skill
I'm done, testing for timing issues now, so far none
alrighty
I was thinking of adding a new feature in AR if a server owner was to change Lang file to be blank how do I get it not to send to chat? I assume it has to do with a if then or maybe something even eaiser
just an if I guess? have a custom send message method, and just check if message is not empty, and if it isn't send
guess I should make a custom send message so there would be less trouble shooting in future
it will save you from bad memory, and also from a lot of duplicated code
any ideas why? or am I just stupid?
lol
took me a bit to see that too lol
Idk the goal, but maybe a Table would work better here
I'm trying to send email from java and for some reason I get this execption
javax.net.ssl.SSLHandshakeException: PKIX path building failed: sun.security.provider.certpath.SunCertPathBuilderException: unable to find valid certification path to requested target
Please ping if you fine think you know what caused this exception and how to fix it.
☹️ I'm having that issue too
|| I just overrided the implementation so that it doesn't check that 🥲 ||
but this is not secured and puts your machine at risk
ik but its for a private project and I spent way too many hours on getting this to work with cloudflare
probably, but I couldn't find any
I think it means that the certification is invalid
or something
¯_(ツ)_/¯
ik but how can I get one..? anyone?
Hello, I'm looking for some advice.
I've developed a plugin which collects stats about the player as they play (what blocks are broken / placed, etc.). I'm storing all of this information of my mySQL database. Now, if I wrote to the database every single time a player interacted with the world, the server wouldn't like it too much. So instead, I've decided to store all of the SQL statements to a temporary list (stored as a string), and every so often, a task would iterate through the list and execute each of these SQL statements. This seems to work fine; however, as a result of this the data can sometimes take a little bit to update. Also, if the server were to shutdown or crash for any reason, some of these statements wouldn't get executed,
Is this solution good? Or is there a better way to manage many inserts and updates to the database at any given time.
I'm using HikariCP if that helps any.
instead of doing an interval
you could count the changes and update every x changes made
but the interval solution is what people use usually
(or if the data is not that important, load on player join and save on player leave and plugin disable)
one thing thats actually an issue though is storing the sql statements as string, keep the player data in a wrapper class of sorts and update using that
its usually not an issue, but using prepared statements is highly recommended
which you cant do with just sql statement as string
Couldn't you just store that data on the PDC of the player and then on an async interval task update the DB with those numbers?
Assuming you're using a more recent version of the game.
i never understood the reason for PDC personally, wouldnt a hashmap/set serve the exact same purpose?
I don't have many players, so updating every x amount of changes or on a join / leave event would be noticeable, since in addition to storing these stats, I have a tasks system that shows the users which blocks to interact with to complete it (for example).
I am making use of PreparedStatements, and I just build it with the string I store in the list.
Here's how my table is setup.
+--------------------------------------+----------+-----------------------+--------+
| user_uuid | type | material | amount |
+--------------------------------------+----------+-----------------------+--------+
Could I even store all of these things in a persistent data collection?
I mean yeah, it's just it'll come back if the player logs out or whatever. It just sticks to them.
guess you dont really need to handle it yourself with pdc, kinda trivial but eh
async timer is what you want to go with most likely
but, i would hold the data instead of the sql statements
I have a server that removed the need for chests because we implemented our own chests that don't tick so it helps server strain and fps to the players.
Utilizes PDC
Does this work?
Bukkit.getScheduler().scheduleSyncRepeatingTask(this, () ->
Bukkit.getScheduler().runTaskAsynchronously(this, SQLDatabase::executeQueries), 20, 200
);
10 seconds is a bit too fast honestly
most wont cry over 5 - 10 minutes of data lost
but if you absolutely want to use fast updates
then keep using hikari or any other pooling solution
since opening connections can be quite heavy
you want async not sync
Inside of the executeQueries() I just open 1 connection and use connection.prepareStatement(string) inside of the loop.
Closing each statement
if you are using hikari then you dont open or close anything
close returns the connection to the pool and open just gets one from the pool
they stay open
Even closing the PreparedStatement?
thats closing the statement
not the connection
once you close the statement and call .close() on your connection
that connection is returned to the pool
Okay yeah
you also want this
.scheduleAsyncRepeatingTask
no need to create another scheduler
It says its deprecated
runTaskTimerAsynchronously is the new one i think?
Yeah that one works
Could you elaborate a little further?
you can either store the data in a PDC
on each player
or just create a class to hold it
and store it against uuid in a hashmap
So my if statement will activate for things such as if you name a dispenser in an anvil called backpack and open and close it. which then throws an error bc of null item meta etc. Is there a way to get around this from happening?
Hey guys question, so im saving an array of itemstacks to mongo, but when i load the object i get this error: java.lang.RuntimeException: Unable to invoke no-args constructor for interface org.bukkit.inventory.meta.ItemMeta. Register an InstanceCreator with Gson for this type may fix this problem. anyone know how to fix?
don't serialize itemstacks directly
probably
Hmmm, so i shouldnt just save the array?
well I think there's like ItemStack#serializeToBytes or something
then serialize that
might be a paper method though
how can I send an html email with css?
not embedded css
a file or either a link
The css has to be in the same document, or hosted somewhere I believe
ok
it is working with a static html page or a website but when sending a mail as that html the styling disappear
Maybe is just the client that doesnt render it
Also, make sure you set the content type to text/html or whatever is for html
Hey, got some gradle questions
I have two modules:
clans-plugin and clans-plugin-legacy
clans-plugin-legacy depends on clans-plugin.
clans-plugin has a lots of dependencies, which has to be relocated. The problem is, when i build clans-plugin-legacy dependencies from clans-plugin are not being relocated. how can i have common relocations between two modules?
I think implementation(project(":clans-plugin", "shadow")) should do it
it's uh mentioned somewhere in the gradle docs
err, shadow* docs
you are my life saver
Is there a way to do switch of instanceof? Cause I don't want to have like 8+ if(object instanceof Class)
No
Thought so. Worth a shot though.
--enable-preview :p
Java 18:
public static double getPerimeter(Shape shape) throws IllegalArgumentException {
return switch (shape) {
case Rectangle r -> 2 * r.length() + 2 * r.width();
case Circle c -> 2 * c.radius() * Math.PI;
default -> throw new IllegalArgumentException("Unrecognized shape");
};
}
works in Java 17 too, but it's preview in both
record patterns in 19record patterns in 19
YES
relieved
kotlin 😌
fun Shape.perimeter() = when (this) {
is Rectangle -> 2 * length + 2 * width
is Circle -> 2 * radius * PI
else -> throw IllegalArgumentException("Unrecognized shape")
}
nice rectangle perimeter calculation
def perimeter(shape: Shape) = shape match {
case Rectangle(length, width) => 2 * length + 2 * width
case Circle(radius) => 2 * PI * radius
}
nice edits
nerd
but what if it's none of them :))
what language is that
:)
perimeter :: Shape -> Double
perimeter (Rectangle length width) = 2 * length + 2 * width
perimeter (Circle radius) = 2 * pi * radius
relieved
relieved
relieved
or ```hs
perimeter :: Shape -> Double
perimiter = \case
Rectangle length width -> 2 * length + 2 * width
Circle radius -> 2 * pi * radius
relieved
Yeah was thinking of throwing an illegal argument
Also for context... CompoundTag instances. (String, int, intArray) etc...
What even is this place? Never touch it and will never ever be again.
Channel for basic development topics. Mostly for questions where as #dev-general is more layed back and for like talking about development.
NOT configuration help
I did say "development" xD
Is it chilling?
yoski broski, i wanna have a radius of hidden players, rn i think i will do location.getnearbyentities and throw it in a 1 tick runnable and save current players and do what i need, is there any other obvious way of doing this better
i was thinking move event too but that might be a bit more buggier and heavier on the server
"yoski broski"
Hi, if I have this switch:
var material = string.split("-");
switch (material[0]) {
// Code here
}
If material doesn't contain any "-", it won't split, will it cause any errors or will the switch statement run default (If I add it).
Asking this here cause I can't really test it rn. I don't have minecraft installed rn.
Hmm, so it just returns 1 string okay... so I would have to check if material[1] exists for example, to know if it was split or not.
Thanks.
if this is user input check the length of the split too, a string containing only - will return an empty array
Anyone know what this error means? https://paste.helpch.at/rufoginuta.cs using Mongo
Caused by: java.lang.ClassNotFoundException: vaultclaims.Objects.Claim
Does that class exist with that package?
class Claim in package vaultclaims.Objects (also note that packages should be lowercase)
https://i.imgur.com/gS3G8lB.png the class exists
is it possible to detect exactly what ip address was used to connect to server
like if it's used blabla.example.com
or 124.73.55.56?
like address of the server
there is also for PlayerLoginEvent (probably for older mc versions)
Hi, I'm trying to send an EntityMetadata packet indicating a player sneaking (npc) but it doesn't work, instead of sneaking, the NPC's name just turns white.
This is my code
WrapperPlayServerEntityMetadata playOutEntityMetadata = new WrapperPlayServerEntityMetadata();
WrappedDataWatcher watcher = new WrappedDataWatcher();
WrappedDataWatcher.Serializer serializer = WrappedDataWatcher.Registry.get(Byte.class);
byte bitMask = 0x00;
if (this.sneaking) bitMask = 0x02;
System.out.println(bitMask); // works
watcher.setObject(0, serializer, bitMask);
playOutEntityMetadata.setEntityID(this.entityID);
playOutEntityMetadata.setMetadata(watcher.getWatchableObjects());
playOutEntityMetadata.sendPacket(player);
Also I'm using ProtocolLib and dmulloy2's packet wrapper
You using the right data for your server version?
Yup, it's 1.18.2 and the protocol wiki states 0x02 for crouching
I'm developing a java web server and for some reason every time the page refreshed or redirect is sent or the browser is closed the cookies get deleted
and I did set the max age of the cookies
ok nevermind
I fixed it
Got it working.
Turns out since 1.13+ a pose field is required.
This is my code now if it helps anyone
private void sendMetadataUpdatePacket(Player player) {
WrapperPlayServerEntityMetadata playOutEntityMetadata = new WrapperPlayServerEntityMetadata();
WrappedDataWatcher watcher = new WrappedDataWatcher();
WrappedDataWatcher.Serializer byteSerializer = WrappedDataWatcher.Registry.get(Byte.class);
WrappedDataWatcher.Serializer enumSerializer = WrappedDataWatcher.Registry.get(EnumWrappers.getEntityPoseClass());
byte bitMask = 0;
if (this.onFire) bitMask |= 0x01;
if (this.sneaking) bitMask |= 0x02;
if (this.sprinting) bitMask |= 0x08;
if (this.swimming) bitMask |= 0x10;
if (this.invisible) bitMask |= 0x20;
if (this.glowing) bitMask |= 0x40;
if (this.elytraFlying) bitMask |= 0x80;
System.out.println(bitMask);
WrappedDataWatcher.WrappedDataWatcherObject byteStatus = new WrappedDataWatcher.WrappedDataWatcherObject(0, WrappedDataWatcher.Registry.get(Byte.class));
watcher.setObject(byteStatus, bitMask);
WrappedDataWatcher.WrappedDataWatcherObject pose = new WrappedDataWatcher.WrappedDataWatcherObject(6, WrappedDataWatcher.Registry.get(EnumWrappers.getEntityPoseClass()));
if (this.sneaking) watcher.setObject(pose, EnumWrappers.EntityPose.CROUCHING.toNms());
else watcher.setObject(pose, EnumWrappers.EntityPose.STANDING.toNms());
playOutEntityMetadata.setEntityID(this.entityID);
playOutEntityMetadata.setMetadata(watcher.getWatchableObjects());
playOutEntityMetadata.sendPacket(player);
}
give yourself permission?
https://luckperms.net/
quality permissions manager
are you sure?
almost. it might just be a bug in the code. xD
(assuming code)
not sure if this is code
yeah lol
I was just trying to be funny 😦
i tried but nothing happened
i solved it by mistake xd
can't tell if this is a troll or not
Paste Services
When asking for help with a config/menu/code issue please use our paste bin:
(we prefer it over pastebin.com)
• HelpChat Paste - How To Use
Requested by: BlitzOffline • paste
what are those tabs
Can you retrieve a selection of pasted blocks using WE?
https://worldguard.enginehub.org/en/latest/developer/regions/flag-calculation/ documentation is here
I know it
Yes, this is what WE does with the -s flag in //paste https://github.com/EngineHub/WorldEdit/blob/b4ae41a4b65876650d2538aa91847e0d49ca79cf/worldedit-core/src/main/java/com/sk89q/worldedit/command/ClipboardCommands.java#L188-L194
idk if the whole selector and actor stuff is in your interest, like get the min and max and you're gucci
Well that's another thing
I guess you could do it manually but there are provided ways of undoing some operation (so long as you keep the EditSession that performed that operation)
Oh, yea I can store that no problem
bruh, read that like 5 times, never noticed it :kek:
Is there a way to check if a block was placed with worldedit? Any WE command, like set, replace, sphere, cyl and so on
hook up to their edit session event
Then use your own extent like it mentions there, override whichever methods you want and you can track block placements and all that jazz
When I put "/papi ecloud download server" everything bugs and the other expansions stop working
literally the same channel
stupid question: getClassLoader() can only be used in the main class right? So how would I do this in an external class? confusion at all time peak
getClass().getClassLoader()
thanks for saving me from my stupidity
Uhm is there any Map that sorts the data by well, when it was added? unsure how to explain, just like a list where .get(0) would get the first item that was ever added to it.
I was using HashMaps but then remembered they aren't sorted in the order I added them
which welp, isn't what I wished for
LinkedHashMap
ok ty
the reason for UUIDs was to be able to change names while keeping a unique identifier
so what else can I use to re-create Hypixel's Skyblock Profiles system
I mean you can tell the server whatever you want, but you'll most likely want to do that on a proxy so the servers only get the data provided by you
You have to use a bunch of nasty reflection stuff if you want to change the uuid
but yeah it is possible, just really really hacky haha
You'd have to access the uuid field in the player object using reflection, then modify it to whatever, save the original uuid somewhere and restore it on player quit
Then restore whatever their last fake uuid was on join.
ohh thanks for the info
why would u need to change a player's uuid for profiles?
coz I want to separate player's stats for each of the profiles
how does uuid interfere with that anyway?
keep the uuid as primary key
and add as many profiles as you want under it
I want to make it work with other plugins and I want other plugins to think that its a new player when they create a new profile
ah, those other plugins arent yours i assume?
you have to do this #development message (not as hacky as claimed honestly)
but you would need to do it on prelogin most likely
most plugins load on player join
ItemStack item = new ItemStack(Material.INK_SACK, DyeColor.LIME);
How do i fix that?
brother, if changing the uuid of a player is not hacky I don't know what is xD
maybe I'll make a dummy plugin to see
This isn't a valid constructor
Also its INK_SAC without the k
Ink sacs don't have any 'DyeColor' data on them, they're just regular items
and how do i get any dye then
im making a gui and wanna have lime dye innit
but lime dye isnt in 1.8.8
oh, 1.8.8
Yeah, can't help with that sorry lol
but if an item doesn't exist in the version then you can't add it?
yeah well you figure that out. Hard to get any support for a 7 year old version
changing uuid itself isnt that hacky, but they probably need to register new players to the internal map to make it work
thats gonna be a bit more messy
thats 1.8 for ya
you wouldnt change the player's uuid for it
and you shouldnt try
because overall changing the player's uuid is a bad idea
no, for what they want to do its necessary
they want to create fake users for players to use
and that can be used by any external plugin
this is 100% true, but eh
they just said that they want to recreate hypixel skyblock plugin
but if it's not their plugin, and it's not open source
hypixel can do it since they just use their own plugins
I don't think anybody bothers to change player's UUID
yeah, its just not needed in your own ecosystem
dont see how they would create fake profiles in other plugins without changing name + uuid though
arent they better off just patching the other plugins, if its not public then just using something else that is or something like that?
or just scrap multiple profiles
well really its the only way
new ItemStack(Material.INK_SACK, <AMOUNT>, <DURABILITY>)
Change durability to the data for lime.
If you have essentials hold lime dye and type /itemdb
its probably easier to just scrap the profiles idea since its probably unlikely people will actually try to use them or use them enough to be worth dealing with
hi, i need a help for my first plugin... i want to integree Vault plugin but it alwase gave me the same problem (the econ variable is null), this is my main class and event class https://paste.md-5.net/onuvaqulaj.java
Line 52
? @dense drift
line 52, put it as econ = rsp.getProvider()
without Economy?
well you already defined its type so yes
i try
It work! thank u 👍
what you did was you made a new variable instead of redefining the old one
ah ok thanks
sorry but u know what i can use to remove an amount of the same item pickupped?
declaration: package: org.bukkit.event.player, class: PlayerPickupItemEvent
to be honest I joined this server just to ask 1 question sooo....
does anyone know how to fix colors aren't displaying in console?
if you don't understand what I'm talking about but wanna help me, I can send a screenshot to you in DM
what do u use to print?
Logger.getLogger(plugin name).info(msg)
Because they are not supposed to be parsed
You can send the message to ConsoleCommandSender
:((
my string il longer but it work if u want: getServer().getConsoleSender().sendRawMessage("string")
when my test server was on version 1.16.5 everything worked, but when I switched to version 1.19 it doesn't work anymore
anyways thx
my friend said me that it stop working because of log4j exploit fix in 1.18.1+
No it stopped working because it was never supposed to work
Any ProtocolLib expert here?
How could I get the IP/Domain of the server the player pinged? Like when they pinged example.com or an IP, I would like to get that.
that is a bungee class
And? Still not Spigot... Otherwise would I not mention ProtocolLib here
Hostname or IP, e.g. localhost or 127.0.0.1, that was used to connect. The Notchian server does not use this information. Note that SRV records are a simple redirect, e.g. if _minecraft._tcp.example.com points to mc.example.org, users connecting to example.com will provide example.org as server address in addition to connecting to it.
do you think this would fit?
if so, it's handshaking serverbound (PacketType.Handshaking.Client.SetProtocol) and ```java
packetContainer.getStrings().read(0)
you can also experiment with that, I doubt it's only accessible via packet
Downside of these are the fact that they are only on join, while I need during ping.
The structure you mentioned doesn't seem to fit... It's probably getServerPings, but I'm not to sure about that.
Only has getAddress which is the player's address
why doesn't it seem to fit?
users connecting to example.com will provide example.org as server address in addition to connecting to it.
so when the player pings the server, you want to get the ms of the ping?
I found a solution.
solution being?
This one during a onPacketReceiving.
Was a bit confused as IntelliJ for some reason didn't suggest getStrings() and thought it was a bad example
oh
but does it compile?
Yes. It suggested it afterwards
So maybe bad caching/indexing or smth
ah alr, intellij being weird 🥲
So I asked before but here is the code that I wanted to put in a switch instead of multiple if's
illegal argument wouldn't help because I'm checking multiple different object instances not instances implementing the same object. I could be wrong though.
public Tag getTagFromObject(Object obj) {
if(obj instanceof String)
return StringTag.valueOf((String) obj);
if(obj instanceof Integer)
return IntTag.valueOf((int) obj);
if(obj instanceof int[])
return new IntArrayTag((int[]) obj);
if(obj instanceof Double)
return DoubleTag.valueOf((double) obj);
if(obj instanceof Float)
return FloatTag.valueOf((float) obj);
if(obj instanceof Short)
return ShortTag.valueOf((short) obj);
if(obj instanceof Long)
return LongTag.valueOf((long) obj);
if(obj instanceof long[])
return new LongArrayTag((long[]) obj);
if(obj instanceof Byte)
return ByteTag.valueOf((byte) obj);
if(obj instanceof byte[])
return new ByteArrayTag((byte[]) obj);
return null;
}
and the question is? 🥁
How can I make use of switch or clean it up because I don't like the amount of if statements
maybe could use Class and switch that
🙏
although not sure if that'll work because of unboxing and stuff
since idk if a byte is a java.lang.Byte
you can't use Class in switches
you can't?
you got spoiled by when
So close... Cannot switch on a value of type Class<capture#1-of ? extends Object>. Only convertible int values, strings or enum variables are permitted
is the java version of it in production yet*
WHAT?!
yep
You can't compare using #equals on any object?????????
what switch is this?!?!!?!
switch(obj.getClass()) {
case String:
return StringTag.valueOf((String) obj);
}
dear lord please save all the ignorant souls here they all have been forced to use java
please save all the cute people here, for your eternal kingdom will be glorified
i think its a thing
try case String.class:
just not in production yet
Oh
Java switches are mostly what came from C/C++
then nevermind
Dont you have switch with pattern matching or whatever its called
Thats not where the error is the error is on switch(obj.getClass()) {
they are way more efficient than weird equals checks, but limited
yeah its been drafted in java 17
The expression used in a switch statement must have an integral or enumerated type, or be of a class type in which the class has a single conversion function to an integral or enumerated type.
but its not in yet
Well I could switch on class names but IDK felt like that wouldn't be as efficient.
just use a map with functions as values
?
apparently current solution is to create an enum
with classes in it
and switch over the enum
use some custom enum class with their appropriate functions
enum.valueOf(obj.getClass().getName()).returnTag();
fun Any.getTag(): Tag? = when (this) {
is String -> StringTag.valueOf(this)
is Int -> IntTag.valueOf(this)
is IntArray -> IntArrayTag(this)
is Double -> DoubleTag.valueOf(this)
is Float -> FloatTag.valueOf(this)
is Long -> LongTag.valueOf(this)
is LongArray -> LongArrayTag(this)
is Byte -> ByteTag.valueOf(this)
is ByteArray -> ByteArrayTag(this)
else -> null
}
```cmon, java 😭
Map<Class<?>,SomeFunctionThingy> (might wanna have an Identity hm)
That might work. I'll test that out when I get back
yeah, this is what i used to do
this is even better than enum
Map<Class,Handler>
Map<Class<?>, Function<Object, Tag>> map = ...;
return map.get(obj.getClass()).apply(obj);
eclipse: Generic types need to be wrapped with type arguments
imagine java
https://stackoverflow.com/questions/29570767/switch-over-type-in-java couple of solutions on here
implementing something like that into the existing switch functionality is just a bit harder than implementing it from scratch :p
true
false
but i mean the any object part
they should add
and the is
although in java's case it'd be instanceof
again, its already being drafted apparently
soon tm that is
lol
not good
™️
i mean i prefer java honestly
they do with pattern matching, but it's not ready yet
but coroutines kinda spoiled me on kotlin
dude im beginning to hate on java with all those tedious typings
i have like 130 wpm but its still too slow for completing work
java is known for its verbosity
🤢
but that doesn't mean is bad 
man i would rather do assembly this way
Kotlin can also be verbose if you want
i mean github copilot handles most
but java forces it
var is perfect
val 😌
auto
Java isn't bad, it just can be better
lol what about using an IDE?
im on eclipse man
im about to use notepad++ for java later
Eclipse sucks
why would you use eclipse over intellij even
sounds like a you problem
its a me problem indeed
its only heavy on first run i feel like
Man seriously hating a language cause he decided to use a shitty ide kek
once its done indexing, it barely uses much
Mate I was running IJ perfectly fine on my old 32bit pc with 4gb of ram
oh is that, i will give it a try lol
You have no excuse
i have intel graphics and i3
if you do
download jetbrains toolbox first
on my laptop
its using 700 mbs of ram on a big project being open currently
I had an i3 2nd gen I believe
wtf
easier to manage JB apps
and also get ultimate if you're a student :))
and github copilot if you're a student :))
So you probably already have something better
oh alr thx for the tip noted
isnt ultimate like paid?
If you're a student no
lucky
my pc is 💩 with memory and it usually uses 5gb (always about 5g even if i have 1 or 3 projects for some reason)
If you're not, just use community, it's got most of what you need
CLion etc included
oh nice
#dev-general tho yes
my ij uses 2.1gb with docdex opened
what is this 700mb magic
wait no ij says 395MB
bro has worked since last life in parallel universe
Mine normally uses like 1gb
Smh pig
Mine normally uses like 4
ah great, just opened it and the first thing I see in task manager is IJ using 2.6gb of memory
well I'll let it index first
when is deluxetags getting 1.19 updated
does it need an update
3120 a.d.
it works just fine on 1.19
well im using it on 1.19 with the new hex color shits, but when I type in chat the color all messed up
https://i.imgur.com/d5hloF9.png
Finally indexed, only one window of intellij 🤔
https://i.imgur.com/BoUxL0y.png
Although this could be a factor as to why (38 plugins)
indexing is quite heavy usually
but after that now it's sitting at an exact 3,843.1mb
not even moving by 0.1
¯_(ツ)_/¯
prob
its peaking at 2.5 gigs for me rn after i cloned a repo
ugh. deluxetags. not deluxechat
Hehe
If I only had 16 i'd die
omg its blitz
So cursed
hi conclure
Normally I need to be running 1 to 2 servers on IJ and have 3 mc opened at the same time
hi blitz 
thought it was a lot until I realized that my pc uses 60% memory on idle 💀
windows user
I am dying. Fortunately is better than the 8 gb ddr3 I used to have. xD
ah, i just use a seperate mini server for testing
I love running it on IJ, makes debugging so much easier
yeah agreed, it would be pain for me if stuff started to freeze
and i got the server laying around so 
my problem with running it in IJ, is that I have to set up the build configuration thingy for every project
holy shit. 22% with discord open here! and a few other small hings like flameshot that don't really matter
I'm not that smart. Well maybe I'm just lazy
Unfortunately hotswap wouldn't work, too many things in the server like microservices running on docker containers though the minigames don't last that long to be needed
19% with discord and chrome opened, and I have 32gbs 💀
When is the BlockExplodeEvent called? I get no output despite exploding blocks with both creepers and TNT. The event is registered properly so that is not the problem
The docs just says Called when a block explodes but it isn't called?
when a block, such as a bed explodes
EntityExplodeEvent are for entities such as creepers and tnt
oh, 30 minutes late
¯_(ツ)_/¯
It is fine lol. But I explode blocks WITH the TNT/Creeper, which is why I am confused
it's only from the explosion source
I know the TNT/Creeper won't trigger it, I just assumed that the dirt blocks or whatever would trigger it
so if the source is a block, then it will call that event
the dirt block doesn't explode itself, it's just affected by the explosion
I'll explode you yourself
Can anyone explain this?
System.out.println("Changed mat to " + material);
c.setType(material);
System.out.println(c.getType());
[21:00:58] [Server thread/INFO]: Changed mat to GRASS_BLOCK
[21:00:58] [Server thread/INFO]: VOID_AIR
There is no one in the world atm is that why? Am I maybe cancelling some event?
what is c? was it VOID_AIR before?
is the block outside of the world height?
because VOID_AIR shouldn't appear otherwise normally
happy to help :p
Uhm If I have a class and I make it serializable, and lets say I create an object, serialize it into base64 and store it in a file
and lets assume that class, has a constructor with 3 params.
But now I want to add a 4th, how could I do that without causing issues?
how can I migrate it.
Cause data was serialized and stored when the class had 3 params and now it has 4
any ideas?
or well, to spice things up, it has a new param and one of the other params changed type.
it entirely depends on what you're using for the (de)serialisation process
Is it cursed to use java 18 to code a 1.8.9 spigot plugin?
does 1.8 even work with java 18?
I found forum threads saying that it did, and apparently hypixel just updated their server to use Java 17 whilst using 1.8
hypixel is no point of comparison
they have an extremely modified and custom environment
I mean i understand that, but I was wondering because I already have java 18 and its a pain to mess with two different java versions at once
public static Object fromString(String s) {
Object o = null;
try {
byte[] data = Base64.getDecoder().decode(s);
ObjectInputStream ois = new ObjectInputStream(
new ByteArrayInputStream(data));
o = ois.readObject();
ois.close();
}
catch(Exception e)
{
System.out.println(e);
}
return o;
}```
if ya wanna go specific
oh yikes, regular java serialisation
ye
is this running in a controlled environment / somewhere you have control of? Or is this in some public plugin many servers use?
private plugin
so yes, controlled env.
Okay yeah uh because java serialisation isn't exactly meant for storage lol, I strongly, really strongly suggest you migrate this to a proper storage system, either SQL or flat-file (json etc)
But to answer your question, changes in the constructor won't affect that because ObjectOutputStream does not call the constructor; the concern here is added/removed/renamed fields
well lets say that also got changed...
what could I do?
cry
you could migrate to a proper storage system that allows you to perform versioned migration or smth before changing the stuff you want to change
but that is a lot of effort with much caution
I have an isOnCooldown() method and it returns a double, which is the current cooldown. I was wondering if it would be better to split it up into two methods, boolean isOnCooldown() and int getCooldown()
i would say yes
isOnCooldown doesn't sound like something that would return a number, lol
unless you're using C
It’s something I didn’t think about at the time I did the plugin, whenever I recode it, I surely will do this
wish you luck, lol
hello how could i get custom hex color in 1.18.2
i tried Chatcolor.of() but is it working for 1.18.2 too ?
should be
net.md_5.bungee.api.ChatColor.of()
hey guys what is usually an invalid bukkit task id
i assume it is something like -1
nvm ignore figured it out
Anyone else having issues with spigot 1.19.1 and maven?
<dependency> <!-- Error here -->
<groupId>org.spigotmc</groupId>
<artifactId>spigot</artifactId>
<version>1.19.1-R0.1-SNAPSHOT</version>
<classifier>remapped-mojang</classifier>
<scope>provided</scope>
</dependency>
``` `Missing Artifact org.spigotmc:spigot:jar:remapped-mojang:1.19.1-R0.1-SNAPSHOT`
Where do you get the remapped jar from?
I forgot to build it 🤦
Well
I thought setting an armorstand as a marker was suppose to stop it from turning the name dark when inside blocks?
Set it on fire to fix it
If I set to max will it go out eventually?
2.7b seconds are 85 years
So yes. xD
yea.. yes
Was hoping if it was at max it wouldn't tick.
It's in ticks so wouldn't it be 3.4 years?
ah, ticks
Didn't fix it.
You sure? How are you doing it?
nmsStand.setRemainingFireTicks(Integer.MAX_VALUE);
Try setFireTick
doesn't exist for ArmorStand
Its an NMS entity not bukkit.
Ah, no clue then
nmsStand.displayFireAnimation(); didn't work either.
https://nms.screamingsandals.org/1.19/net/minecraft/world/entity/Entity.html setSecondsOnFire(int arg0) maybe
Thats how long its been on fire.
Also if I move the armorstand into water it causes the splash particles... Whats the point of setMarker(boolean) again?
smaller hitbox and probably other stuff
It removes the hitbox, that one I know lol
https://hub.spigotmc.org/stash/projects/SPIGOT/repos/craftbukkit/browse/src/main/java/org/bukkit/craftbukkit/entity/CraftEntity.java#576-579 so it should be setRemainingFireTicks
I did that. Doesn't work
nmsStand.setRemainingFireTicks(Integer.MAX_VALUE);
nmsStand.displayFireAnimation();
nmsStand.hasVisualFire = true;
nmsStand.wasOnFire = true;
try with only that specific method 
The protocollib PacketType.Play.Server.CHAT seems to not be called on 1.19, has something be changed?
lots of things have
what packet should I listen now for outgoing chat packets?
It depends
idk the plib names, idek if it's updated yes but now there's ClientboundSystemChatPacket and ClientboundPlayerChatPacket, the first one are system messages, like command feedback and those from plugins, the latter are messages sent by players
don't u dare checking logs.
haha already did
What is the pattern for <RandomStringUsingAnyChars>? It has to start and end with <>
I tried smth like <(.)> but it doesn't match what I want it to
<[^>]+> this should work, [^>] means "anything except this"
This Matcher m = Pattern.compile("<[^>]+>").matcher("<Hello> Hi"); gives me No match available
yeah, if it is only alphanumeric characters, you can just use \w+
do you use m#find() ?
It isn't I use @ n stuff in the strings
Ohh
No I did not
I just thought that was a method to check if there was a match or not
Didn't read the docs properly
Sry lol. Thanks 🙂
nah, Pattern#matcher create a Matcher, you have to use #find() to see if it matches and to go trough the entire string while (m.find())
Yeah, got it! Thank you!
I realised another thing lol. Is it possible to get a pattern once the <> is fully closes. Idk how to explain it, but I need to get B:<C> from a string like A:<B:<C>>. Is this possible using patterns or no?
Pattern.compile("\\<inbetween\\>");
try sth like this
I think if you have nested <> then that's pushing the limits of context-free grammars
Or the limits of regexes at least, they can't be recursively defined
K lol, I guess I'll make a function for it
Sorry not context-free
I think the only way to use regex with this is to just have a long regex
for each one inside
(each one inside possible)
For arbitrarily deep nesting it's impossible dkim
This isn't really an option as the inside can be literally whatever. Guess no regexes :V
wdym
I mean anyways you can't have an infinite amount or as you said recursively defined so I'd just make my own method
Yup, guess I'll have to. Thanks tho :>
Let's say you have a list syntax [1, 2, 3] and you want to parse lists of lists [[1], 2, [[3], [4]]]
This is impossible to parse reliably with a regex because it would involve a recursive definition
yes but it probably is possible to make a group in a group etc to sort of replicate it
Sort of
although not infinitely
not infinitely yeah
And it would be very difficult to do even with 2 levels of nesting
well for example
\w(:<\w(:<\w(:<\w(:<\w(:<\w(:<\w(:<\w(:<\w>|)>|)>|)>|)>|)>|)>|)>|)
```this works (just using letters)
for 9 letters
(I'd still make my own method but I'm just showing an example)
It literally could not have been easier :>```java
private static String getBonus(String string) {
int index = string.indexOf('<');
if (index == -1)
return null;
int open = 1;
string = string.substring(index + 1);
for (int i = 0; i < string.length(); i++) {
if (string.charAt(i) == '<')
open++;
else if (string.charAt(i) == '>')
open--;
if (open == 0)
return string.substring(index, i);
}
return null;
}
this will force parity tho<<>> . Stuff like this <<> won't work. not sure if that's something you want.
That is what I want 🙂
Otherwise the string is faulty and it should throw an error (return null)
I didn't mention it before. But thanks for mentioning it :>
Is there any way to retrieve the texture of a head with a texture? (aka, get the head in my hand and return it's texture)
val owner = NBTItem(this).getCompound("SkullOwner") ?: return ""
return owner.getCompound("Properties").getCompoundList("textures")[0].getString("Value")```
basically the texture base64 string is located at SkullOwner.Properties.textures[0].Value
or use the profile API :D
Ppls with premium spigot resource development, when uploading the plugin. It says to use the Email for payments, that is the mail you used to sign up for paypal, right? I know this is a stupid question, but I really don't wanna get it wrong :V
intriguing 
if you are talking about something from paper, I can't
a) maybe afonso is
b) spigot added (a bare-bones) profile api recently
a) fair
Gaby 
paper api » ALL
true
but he is sus

also
what exactly just I take from this error when building my project: https://paste.helpch.at/vufowasina.rb
I added Skulls as a soft-dependency, but apparently it requires something else?

is a public plugin smh


