#development
1 messages · Page 79 of 1
everyone hates lambda
you can also have non-component properties 
data class Hello(val world: String) {
val length: Int = world.length
}
has someone ever used laracord? is it possible to install it on docker like laravel sail?
Which is very useful
I love it. I honestly haven't used it with Sail, it builds a .phar, so you can just have a Docker container that runs it. That's what the Pterodactyl Panel integration that I use does iirc
This looks pretty informative, Laracord is built on Laravel Zero, so this is pretty much just what I said lol
okay so, it also uses Box to build the .phar, and Box can directly output a Dockerfile, here's the docs for that: https://github.com/box-project/box/blob/main/doc/docker.md#docker-support
oh yeah, turns out that's what the first link says lol
What would that do? non-component property?
Yeah
It means it's not part of the "data portion of the class"
For example:
data class Hello(val world: String) {
val length: Int = world.length
}
val hello = Hello("world name")
val (world) = hello // Destructure the data class
// But if you try the non-component, it doesn't work
val (world, length) = hello // errors, length is not a component
// But
data class Hello(val world: String, val length: Int)
val hello = Hello("world name", 10)
val (world, length) = hello // this works because both are components of the data class
Also means it won’t be used in things like equals and hashCode
And toString :))
Data classes might be op?
What can the length be used for if it's not in the data portion of the class?
How is it then accessed?
It's accessed like any other property, hello.length it's just not present in the destructuring, hashcode, equals, toString, etc
Here is a great visualization
The two instances are "identical" because their data components are the same, but the non-component property isn't
public void setLore(ItemStack item, Integer line, String s) {
ItemMeta meta = item.getItemMeta();
if (meta == null) return;
List<String> lore = meta.getLore();
if (lore==null){
lore = new ArrayList<>();
}
System.out.println("LINE: "+line+" -VS- SIZE: "+lore.size());
System.out.println("commencing for loop");
System.out.println(lore);
while (line>lore.size()) {
System.out.println("executing");
lore.add("temp");
}
lore.set(line-1,colored(s));
meta.setLore(lore);
item.setItemMeta(meta);
}```
I DONT UNDERSTAND!! why does the while loop not execute at all even though line>lore.size???
Show the output.
lore is size 0
lore.set(line-1,colored(s)); can't set a line with no index.
hello, can anyone tell me how i can create weighted chances? example:
giveItems:
# give an item to the player
# material:chance (double)
DIRT:20
DIAMOND:10
IRON_SWORD:50
# etc etc...
while (line>lore.size()) {
System.out.println("executing");
lore.add("temp");
}```
so there's this here
and it is not printing "executing"
cause 1 is already greater than 0
1 is greater than 0, so it runs the code
adding lore increases to lore.size until it is equal to line
i disabled these 3 lines:
//lore.set(line-1,colored(s));
//meta.setLore(lore);
//item.setItemMeta(meta);```
and it prints "executing" now
wtf is going on
isnt it supposed to go through the while loop before executing these 3 lines?
Should but java is wierd sometimes.
How i feel constantly.
Cache money
bump
Do you have code already? What have you tried?
Easiest way use random get a number loop through all the objects with that number (or below) then choose a random from that list.
Not the best way though just something simple.
ill see
Won't a map be good?
Nvm it won't work
a map would work
package org.firstproject.nbttest;
import org.bukkit.plugin.java.JavaPlugin;
public final class NBTTest extends JavaPlugin {
@Override
public void onEnable() {
getLogger().info("NBTTest has started");
NBTCommands instance = new NBTCommands();
getCommand("nbt").setExecutor(instance);
getCommand("nbtDelete").setExecutor(instance);
getCommand("nbtString").setExecutor(instance);
getCommand("nbtBoolean").setExecutor(instance);
getCommand("nbtDouble").setExecutor(instance);
}
}```https://paste.helpch.at/fivagazalu.php
what did i do wrong guys
everything is imported
public class NBTCommands implements CommandExecutor {
@Override
public boolean onCommand(@NotNull CommandSender sender, @NotNull Command cmd, @NotNull String s, @NotNull String[] args) {
if (sender instanceof Player){
Player p = (Player) sender;
ReadWriteNBT nbt = NBT.itemStackToNBT(p.getInventory().getItemInMainHand());
if (p.isOp()){
if(cmd.getName().equalsIgnoreCase("nbt")){
p.sendMessage("NBT: "+nbt);
return true;
}else if (cmd.getName().equalsIgnoreCase("nbtDelete")){
nbt.removeKey(args[0]);
}else if (cmd.getName().equalsIgnoreCase("nbtString")){
String joined = String.join(" ", Arrays.copyOfRange(args, 1, args.length));
nbt.setString(args[0], joined);
}else if (cmd.getName().equalsIgnoreCase("nbtInt")){
try{
nbt.setDouble(args[0], Double.valueOf(args[1]));
}catch (NumberFormatException e){
p.sendMessage("Error: "+args[1] + " is not a number!");
return true;
}
}else if (cmd.getName().equalsIgnoreCase("nbtBoolean")){
try{
nbt.setBoolean(args[0], Boolean.valueOf(args[1]));
}catch (NumberFormatException e){
p.sendMessage("Error: "+args[1] + " is not a number!");
return true;
}
}else{
return false;
}
ItemStack returnItem = NBT.itemStackFromNBT(nbt);
p.getInventory().setItemInMainHand(returnItem);
}
}
return true;
}
}
You didn't register the commands on your plugin.yml
name: NBTTest
version: '${project.version}'
main: org.firstproject.nbttest.NBTTest
api-version: '1.20'
depend: [NBTAPI]
commands:
nbt:
description: wassup
usage: /nbt
nbtDelete:
description: wassup
usage: /nbtDelete <key>
nbtString:
description: wassup
usage: /nbtString <key> <string>
nbtBoolean:
description: wassup
usage: /nbtBoolean <key> <boolean>
nbtInt:
description: wassup
usage: /nbtInt <key> <integer>```
did i do smth wrong here
nvm i typo'ed on one thanks
Ayo I actually learned something lmao
I'm using deluxemenus and wanted to open a menu for someone that is offline but I can't. Is there a way that it's possible to open menus from players that are offline?
No. There is no way in DeluxeMenus to open menus for offline players.
P.S.: For questions regarding plugins, #general-plugins is a better channel.
Ok thanks
How and why would you want to open a menu for something that isn't present to see said menu? 
I would like to see the answer of why before even THINKING to answer how
Please help me understand why the block type is different depending on the method I use to get it.
Method 1: always correct
val block = world.getBlockAt(location)
val blockType = block.type
// This 'blockType' is always correct
Method 2: sometimes correct
val chunk = world.getChunkAt(location)
val chunkSnapshot = chunk.getChunkSnapshot(false, false, false)
val blockType = chunkSnapshot.getBlockType(location.x % 16, location.y, location.z % 16)
// This 'blockType' is incorrect sometimes
I'm running this code in a loop, when I attempt to the the type of a specific block at (169,133,448), method 1 says it's a LIGHT_GRAY_WOOL and method 2 says it's a GOLD_BLOCK (method 1 is correct here), but I have no clue why is that. It's in the 70th iteration or something, so method 2 it works for the most part, but for this specific case I have no idea why they report different types.
Shouldn't it be >> 4?
i think it's actually xz & 15 because chunk mth
That was it, it works perfectly now, thank you.
(or alternatively, Math.floorMod(xz, 16))
Random issue, any recommendations for this?
I have a classes XHandler (X being anything), which extend GameHandler. I then have a class for each main command (jda/triumph-cmds) which receive one of those handlers via the constructor. Each command class has an executeSearch() method which does some logic and replies to the slash command. The issue is that, the exact same behaviour is required when clicking on a button of said message. For this I have a listener, that listens to that click. The thing is, that listener basically executes that method when clicking the button and passing the command class to it just sounds wrong? Any ideas?
well imo executeSearch should be on a different class, not Command class, if you execute that same logic via a button press
similar to GameHandler, you'd need a class that would handle the search, and you would pass it either to the Command or the Listener class
tldr, extract the logic into a common class
from my experience handler manager etc usually are code smells
the command classes already extend GameCommand, which has that method as abstract since the method is different depending on the class. Hence if I created a new class, I would need a class for each one...
yeah, that wouldn't work as stated above
forgot to reply lol, yeah most of the times I suppose, but I also use "handler" in the name when I have 0 idea what to call it xD
so..
but yeah, that doesnt help much with the problem
ye exactly, usually means that it does too much
it actually doesn't do much at all
^ what modi said probably is your fix
or something along the strategy pattern or w.e.
has a total of like, 100 lines
its called
yeah but that would require making another class for each one
so each game would require a handler, command and that other class
which seems a bit excessive? idk
yes, not really excessive though no
its better than having it provide a method thats not used sometimes thats inherited
the handler class basically loads everything, stores their objects and has a list with all the names too, and 1 utility method for said game
wdym
unless i am understanding wrong the executeSearch() is not needed on some and is needed on something other than the command class?
oh wait no just the latter part
it basically gets the object from the handler class, formats everything in an embed, creates buttons and sends the message in discord.
yeah and the embed button has the exact same function right?
Now, the message may contain a button which is supposed to "redirect" the user to another object, which basically does the same thing as just using another command but via button this time.
yeah your issue is quite common in app / web dev
you solve it by seperating ui (in your case commands and button clicks etc)
from the controller completely
controller being your logic
How is that different from the handler? I suppose that one handles more storage I suppose
so you suggesting an MVC type thing?
So, the new class would be the controller, the handler would be the model and the command the view?
it should be fine in your case though
saves you 1 more class
model is just data / data logic
in your case i think you are correct
not sure what exactly the handler does
so commands and buttons
all they will do is notify the controller
that they happen
and load the "view" itself
so embed etc
So if I recall correctly about MV(V)C, View -> Controller -> Model -> View?
mvvm, itypoed there
model view vievmodel
model is your handler
view just displays and notifies
vm holds all view logic + view data
so whatever you display on the embed etc is also there
like so
vm is the "controller" there
So just to confirm:
- Model is my handler, aka it stores data and that's about it.
- View is all UI aka commands and buttons
- VM is the bridge between them, in this case it manipulates the model and at the same time can update the view (in this case send messages, etc)
but data flows in a circle
yes, view gets its "view" from vm
and sends events to vm
vm is the one interacting and listening to model
But the logic to send a message for instance, would that be in the VM too? or would View get what's meant to be sent from VM and then send it itself?
you would have a message view
that would take its message from vm
in that pattern
in controller that part is a bit more interconnected, you can have it on either
hence the can get messy comment
this is a better one i think
since it shows the method names as an example
Hmm, one thing I forgot to mention is that I technically also already create the embeds in the handler, so it loads data, creates/formats an embed and stores an object with info + that already created embed. (Did this so that it doesn't need to create a new embed every single time the command is used)
like so
i would probably turn those embeds into their own class
so you can just send and pass vm class to it
so it registers
so the model would load data, ask another class to make the embeds, model gets them back and saves it?
I am a bit confused now
in here model usually is a facade class that handles sql or rest stuff
I load jsons, then I create an embed with all the data formatted, then I have a record class with general info like name, category, reference list and the embedbuilder itself and I also store the JsonObject itself in case I require it for anything else later on. Then it's saved.
okay you got data then
your json stuff would be the model
and vm would not interact with the loading or reading that data
thats models job
Even the then I create an embed with all the data formatted?
model
does not interact
with the view at all
all it does is notifying vm in the case of a change
but then I wouldn't be able to save the embed?
vm is the one holding the reference
public record EntryData(String id, String displayName, String category, String wikiUrl, EmbedBuilder embed, List<String> references, JsonObject object) {
}```
and it can also update the model
this is basically the record
I wouldn't be able to store the embed without generating it first.
why not? model holds your data
why is your embed in the record
so that I don't require to generate it the whole time
it only rlly needs to be created once.
that logic should be in the vm
if you wanna follow that pattern
you can cache it or w.e. you wanna do in there
and model should just handle the data itself
so json(io) stuff
and providing its data
So cached data will be in model and VM would contain the cached embeds?
and not sure if it is a requirement but the pattern is made for multiple threads
yes
your logic is in vm (all of it, creating embeds etc included)
your interaction listeners are in view
so event listeners etc are there and view holds a reference to vm
so it can notify it observer pattern style
if you feel like its too much of a refactor, i would just move your "search" logic into another class
and keep a reference to it
I mean, nothing is too much of a refactor if at the end means your project is well structured.
What's the naming conventions for these btw? Just GameModel, GameController and GameView or what? xD
somethingview
Also, random thing but wouldn't the VM class be like, big af? xD
data is usually named repository
Hmm okay
or DAO
I saw something that stated DAOs have factories?
Would this be something useful for this case too or nha?
yes and no
depending on if you do unit tests
factories are there so you can just mock the class easier
if you dont care, then eh
i would probably include a di framework though, just cause it stops you from worrying about load orders
id recommend dagger
dagger +1
its lightweight and doesnt use too much magic
How can i properly set an itemframes rotation (it has a map)?
like triumph-cmds? quite some fancy magic xD
(thanks to both of your recommendations)
i wouldnt say triumph is that magical
its just that most di frameworks can automagically resolve interfaces to their implementation without you specifying anywhere which implementation to use
(thatll make more sense when after u use one btw)
yeah, just checked documentation, on a quick glance, if I understood correctly, anything annotated with Inject, is just to tell the framework "hey, I need one of these instances" and methods annotated with Provides, return an instance. The framework then automagically seaches for a provider when something needs to be injected
Might be wrong, this is a presumption from a quick glance at the docs
sounds right
its not magic though because you need to tell dagger where the @Provides methods come from with @Component(modules = <providing classes>)
part where I am confused is, where does it all start? xD
Taking my case as an example
I have the "handler" class for game A and another from game B, I want only a single instance to be used for everything, how would I do it? Just create a method inside that class that returns this and I set it as provides and singleton and voila or...?
I am a bit confused with the docs
Actually found this https://www.youtube.com/playlist?list=PLL-4P1BOZnWwUh4cgyO09VKsNNJocVj6G
might be useful
itll kinda explain in https://dagger.dev/dev-guide/#building-the-graph
if u wanan watch a yt tut id recommend this guy
dang its private
https://www.youtube.com/watch?v=ZZ_qek0hGkM&list=PLrnPJCHvNZuA2ioi4soDZKz8euUQnJW65&index=5
https://www.youtube.com/watch?v=wJkHYBf8VkA&list=PLrnPJCHvNZuA2ioi4soDZKz8euUQnJW65&index=3
https://www.youtube.com/watch?v=tgY4Jw8OFZI&list=PLrnPJCHvNZuA2ioi4soDZKz8euUQnJW65&index=3
https://www.youtube.com/watch?v=P9vZ5UAiY_k&list=PLrnPJCHvNZuA2ioi4soDZKz8euUQnJW65&index=4
https://www.youtube.com/watch?v=m5K6FO_DH1k&list=PLrnPJCHvNZuA2ioi4soDZKz8euUQnJW65&index=5
oh thanks
@royal hedge do you have the playlist link? the links you sent still didn't cover enough for what I need
it wont archive the videos so just take out the url and view it normally
ok ty
dagger is neat
how can i set the rotation of an itemframe with a map?
if (itemFrame.attachedFace == BlockFace.UP || itemFrame.attachedFace == BlockFace.DOWN || true) {
var normalizedYaw = event.player.location.yaw % 360
if (normalizedYaw < 0) {
normalizedYaw += 360
}
itemFrame.rotation = when {
315 < normalizedYaw || normalizedYaw <= 45 -> Rotation.NONE // South
45 < normalizedYaw && normalizedYaw <= 135 -> Rotation.COUNTER_CLOCKWISE // West
135 < normalizedYaw && normalizedYaw <= 225 -> Rotation.FLIPPED // North
else /*225 < normalizedYaw && normalizedYaw <= 315*/ -> Rotation.CLOCKWISE //East
}
}
this shit aint working
I need an algorithm that, given a certain start point, it starts visiting the neighbor points in a 2D grid in a way that never visit the same point twice, and without using any memo of the points already visited (do not use any "visited" data structure to remember what points where already visited).
Is there an algorithm that does exactly that? The idea is to visit the neighbors and their neighbors recursively (or iteratively) until some condition is met, then stop branching there and resume in some other place. I have acces to multithreading, but doing this recursion/iteration single threaded is just fine too.
Not what you asked, but you can combine these two:
var normalizedYaw = event.player.location.yaw % 360
if (normalizedYaw < 0) {
normalizedYaw += 360
}
Into a single line
val normalizedYaw = (event.player.location.yaw + 360) % 360
You can also improve these comparisons:
315 < normalizedYaw || normalizedYaw <= 45 -> Rotation.NONE // South
45 < normalizedYaw && normalizedYaw <= 135 -> Rotation.COUNTER_CLOCKWISE // West
135 < normalizedYaw && normalizedYaw <= 225 -> Rotation.FLIPPED // North
else /*225 < normalizedYaw && normalizedYaw <= 315*/ -> Rotation.CLOCKWISE // East
Can become:
normalizedYaw in 45..135 -> Rotation.COUNTER_CLOCKWISE // West
normalizedYaw in 136..225 -> Rotation.FLIPPED // North
normalizedYaw in 226..315 -> Rotation.CLOCKWISE // East
else -> Rotation.NONE // South (< 45 || > 315)
Is this by chance for a skyblock plugin?
No, it's not. I need these coordinates to iterate over locations (given a start point) to discover the boundaries of a structure.
Hmmm. Well I have a method that gets a new location in a "spiraling" grid pattern that does essentially what you are requesting. Which I use for skyblock but maybe it would help? Or maybe I'm just completely misreading your question lol.
Could also look at other open source skyblocks I guess lol
i cant remember the name but its called a cycle if i remember right
google discrete maths cycle or something similar
I have a plugin that only shows entities when a player is close or looking in its vicinity. I am struggling however to make it efficient. Here is my code, its a bit of a mess, what should I do to make it more efficient? https://paste.helpch.at/eyanuqohes.kotlin
wdym struggling to make it efficient? do you have like a spark report?
tbh I probably cannot help because I have to leave soon, but a spark report should make it easier for others
Aikar's Timings Viewer - View Timings v2 reports from Paper and Sponge
oh wow
try adding spark
I mean, not that bad
But he had 100 people online loading a large world
with a lot of entities
I just dont know where I could make the code more efficient, since I cant run async due to the entity calls.
spark would be far more insightful in that case
@merry knoll looks a bit better? xD
Can you get one from the server where it actually causes problems?
Yeah but it will be a bit
Could use like lambda attack or a modern equivalent (look up like mc bots) and the /spreadplayers or some command (there's a vanilla cmd)
Thats the thing, all of my entities are client side
they dont exist on the server
and I use packets to fake them
they are passengers to normal entities, and they should only show when looking at the vanilla entity
why not use real text displays?
U can still test it
With lambda attack or a modern version
My guess is in case the server crashes then it won't stay
setPersistent(false) in shambles
Wait what that's a thing
for a very long time
Oh wait also its per player isn't it
On regular entities too?
yes?
cause I thought client only would be better for lag, since there would be like 4 text entities per entity, and I thought it would be better as client side.
text displays are absurdly cheap
at one point if you have too many the server will spend more time checking whether they are visible to players than anything else, but you need way too many
and you are struggling with that already and I doubt you have that many :^)
It wasnt just for lag, I had other issues.
For example, since one person may be looking at an entity, and another might not, I would run into issues when there were multiple of them showing on an entity. Like if I had a nametag. If one person is looking at it and seeing its textdisplay, then that means that its fake nametag (since the passenger gets rid of the nametag) then has to be offset above the entity which looks weird for the other person. (the text displays dont always show if you look at it, is has more prereqs than that)
And then for horses, you cant mount if thye have an entity, so I had to do some event and packet crap to get that to work
And then the big issue was the game doesnt allow people to teleport with passengers. It is a bug, but Mojang hasnt fixed it yet, and it wont be fixed in previous versions. This is a huge issue, and fake entities fixes it. This is the primary issue.
The event never goes through, neither the packets, so there is no way for me to listen for it.
the game does allow it tho
Well for some reason on 1.20.4 it doesnt work, a bunch of people who bought my plugin complained about it
there are teleport flags in the api as well, and there is a paper pr to add a prepare teleport event where you can add the teleport with passengers flag
but, yeah
™️
Is that something the developers do or a server owner can do?
which part
allowing the teleport event to go through with passengers
Well yeah, so then I cant do anything about it
Cause /tp is something handled in vanilla
and it wasnt working with passengers, neither was nether/end portals
so your plugin would be able to intercept the event and add the tp with passengers flag
but, it's wip
yeah, and its only on paper, right?
sure?
so then it wouldnt be available on Spigot, which some of my customers use spigot or forks of spigot, and not paper
cringe
yeah ik but its not my choice
it sure is
I have to appease the customer, if my plugin works with a broader selection of server implementations, I can get more customers
you should add bstats to make decisions 😄
i regret not doing that earlier
like, if targeting spigot is hindering and limiting your product development and progress, is it really worth it?
that will depend on the % of customers that use X or Y which bstats is great for
but it is technically still an issue on Paper
since it is still "in progress" and just a PR
no matter what I have to account for it until it gets pushed into Paper, and anyways, a lot of people use outdated versions < 1.20 so I still have to support that as well
and I like a challenge
[3043.244s][warning][os,thread] Failed to start the native thread for java.lang.Thread "HandshakeCompletedNotify-Thread"
[3044.245s][warning][os,thread] Failed to start thread "Unknown thread" - pthread_create failed (EAGAIN) for attributes: stacksize: 1024k, guardsize: 0k, detached.
[3044.245s][warning][os,thread] Failed to start the native thread for java.lang.Thread "HandshakeCompletedNotify-Thread"
[3045.462s][warning][os,thread] Failed to start thread "Unknown thread" - pthread_create failed (EAGAIN) for attributes: stacksize: 1024k, guardsize: 0k, detached.
[3045.462s][warning][os,thread] Failed to start the native thread for java.lang.Thread "Craft Scheduler Thread - 300"
[3045.463s][warning][os,thread] Failed to start thread "Unknown thread" - pthread_create failed (EAGAIN) for attributes: stacksize: 1024k, guardsize: 0k, detached.
[3045.463s][warning][os,thread] Failed to start the native thread for java.lang.Thread "Craft Async Scheduler Management Thread"
[14:03:30 ERROR]: Caught previously unhandled exception :
[14:03:30 ERROR]: Craft Async Scheduler Management Thread
java.lang.OutOfMemoryError: unable to create native thread: possibly out of memory or process/resource limits reached
at java.lang.Thread.start0(Native Method) ~[?:?]
at java.lang.Thread.start(Thread.java:809) ~[?:?]
at java.util.concurrent.ThreadPoolExecutor.addWorker(ThreadPoolExecutor.java:945) ~[?:?]
at java.util.concurrent.ThreadPoolExecutor.processWorkerExit(ThreadPoolExecutor.java:1013) ~[?:?]
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1150) ~[?:?]
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:635) ~[?:?]
at java.lang.Thread.run(Thread.java:840) ~[?:?]
anyone help please
You‘re reaching a thread/process limit of your container/os
how do i fix this ?
Increase the limit
how to do that
Depends on where the limit comes from
i feel like its more likely he ran out of memory than that he has too many processes
consider not setting your Xmx equal to the exact same amount as your available system memory
instead, set it to like 500mb-1gb below, you can play around to find a stable configuration
For those wondering the new way to get NBTTagCompound is from the DataComponentMap.
public NBTTagCompound getCompoundTag(ItemStack item) {
net.minecraft.world.item.ItemStack minecraftItem = CraftItemStack.asNMSCopy(item);
DataComponentMap componentMap = minecraftItem.a(); // getComponents()
CustomData typeData = componentMap.a(DataComponents.b); // get(DataComponents.CUSTOM_DATA)
return typeData != null ? typeData.c() : null; // copyTag() || getUnsafe()
}
public void setCompound(net.minecraft.world.item.ItemStack minecraftItem, NBTTagCompound tag) {
CustomData data = CustomData.a(tag); // of(tag)
minecraftItem.b(DataComponents.b, data); // set(DataComponents.CUSTOM_DATA, data)
}
```Took me way longer then I should admit to figure this out.
Every time I see java code I get sad
ah yes a and b
🤷 I can post the mapped version lol
nah im just shitting on nms
Added anyways
Does TriumphGui slots go from 0 or 1?
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
0, all guis start at 0
Alright yeah makes sense
@pulsar ferry Sorry for @ but is it possible to limit a paginated gui to specific slots? So when I use gui.addItem(item) it will only fill a specific area, or do I need to fill all other slots with something else?
offsets got broken in 1.20, this was working in 1.19
does someone know what changed with the offsets
You can fill them with AIR
That's just the size, I want it to fill from the middle of the gui
Does that work? I thought it had to be an item, otherwise it would just be overridden
does anyone know why my discord will not let me create a bot
?not-discord
Looking for discord support?
HelpChat is a Minecraft plugin and development support server and is not affiliated with discord in any way.
If you require support from discord, we recommend you to visit their official support website at https://support.discord.com
On this website, you can read their FAQs, or open a support ticket if necessary.
(already answered in #off-topic xD)
fuck you barry im not rewriting that, guess i give up
ctrl z
that doesnt work
if u switch channels or smth it doesn't work 🥲
but it works if u just sent it
ill just rewrite it with less detail!
💀
im using https://github.com/Vankka/DependencyDownload for discord bot dependencies
need URLClassLoader for loadAll
cant cast the class loader i get from getClassLoader
using luckperm's URLClassLoaderAccess to make addURL accessible
code: https://paste.srnyx.com/lepifuluzi.java
ping if reply ^
hello im trying to recompile an open source plugin that uses the log 4j LifeCycle.State enums, everything looks good in the code until I try to package it with maven, throwing me this error cannot find symbol, anyone know how i can fix this error?
take a look at the errors
https://i.gyazo.com/daa25c715eef9cbcda0dafd8be425764.png i have no idea how to not use log4j's from velocity dependency, but i also dont want to remove it either
Nag author(s): '[srnyx]' of 'EventAlerts' about their usage of System.out/err.print. Please use logger instead (Logger#getLogger).
get nagged
Lmao I always use system.out.println for debug messages because some shit ain't working so I know to remove them
getlogger info works too
also bump
It's easier to just search for Sysout in all files and delete everything
It’s easier to just use a proper debugger
💀
we all know deep down we cba to make debugging stuff
speak for yourself
speak for yourself
😭
bump
use gradle
It’s not a Minecraft plugin, would never have that sort of warning :))))
unprofeshnl
if only loggers existed outside of minecraft plugins
Real, why is it I have to launch minecraft to get a logger instance for my web server.
And if the mc server goes down my logger tanks too!
Arrays.stream(EConfigFile.values()).forEach(cfg -> cfg.getConfig().load());
java.lang.NullPointerException: Cannot invoke "me.m0dii.pagrindai.utils.other.EConfigFile.getConfigFile()" because "me.m0dii.pagrindai.utils.other.EConfigFile.DUEL" is null
what
Looks like something is null 😳
tried adding evalx math to my papi expansion and now it won't load
doesnt show up in papi list
and this is what I have:
Expression math = new Expression(arguments);
try {
return math.evaluate().getStringValue();
} catch (
EvaluationException |
ParseException e) {
throw new RuntimeException(e);
}```
Any reason ItemMeta.addItemFlags(ItemFlag.HIDE_ATTRIBUTES); wouldn't be applied in 1.20.5?
Seems like the item is modified when given to the player.
private ItemStack item;
public ItemStack getItem() {
if(item != null)
return item;
ItemStack i = new ItemStack(Material.ENDER_PEARL);
ItemMeta m = i.getItemMeta();
m.addEnchant(Enchantment.ARROW_DAMAGE, 1, true);
m.addItemFlags(ItemFlag.HIDE_ATTRIBUTES);
m.addItemFlags(ItemFlag.HIDE_ENCHANTS);
i.setItemMeta(m);
item = i;
return item;
}
public void join(PlayerJoinEvent event) {
event.getPlayer().getInventory().addItem(getItem());
}
public void interact(PlayerInteractEvent event) {
Player p = event.getPlayer();
ItemStack item = event.getItem();
if(item != null) {
p.sendMessage("IsItem: "+(item.isSimilar(getItem()));
p.sendMessage("CustomItem: "+getItem().toString());
p.sendMessage("Item: "+item.toString());
}
}
````CustomItem` will contain "HIDE_ATTRIBUTES" but `Item` won't.
> IsItem: false
> CustomItem: ItemStack{ENDER_PEARL x 1, UNSPECIFIC_META:{meta-type=UNSPECIFIC, {*Removed unnecessary*}, ItemFlags=[HIDE_ENCHANTS, HIDE_ATTRIBUTES]}}
> Item: ItemStack{ENDER_PEARL x 1, UNSPECIFIC_META:{meta-type=UNSPECIFIC, {*Removed unnecessary*}, ItemFlags=[HIDE_ENCHANTS]}}
send #getItem
Added it to the message.
try adding itemflags as an array
like m.addItemFlags(List.of(/* both flags here */));
@hoary scarab
cuz it seems like it is ignoring your first additemflags
Thats not the issue though. The CustomItem contains the flags as seen from the debug text.
The clicked item does not.
It seems like PlayerInventory.addItem(getItem()) is removing certain flags.
Will still test though. Give me a sec.
m.addItemFlag(new ItemFlag[]{ItemFlag.HIDE_ATTRIBUTES, ItemFlag.HIDE_ENCHANTS}); didn't work either.
Might just have to make my own ItemStack.isSimilar(ItemStack) method.
How can i make a placeholder extension for using in itemlore?
ProtocolLib or custom implementation using NMS
?
Have heard of a couple situations where protocollib is actually quite slow
would love to hear some opinions
Depends
Hi, it's the first time using Guice and i get this error here:
https://paste.helpch.at/dekomexele.php
AnaCraftCorePluginModule: https://paste.helpch.at/hibixiromi.kotlin
AnaCraftCorePlugin: https://paste.helpch.at/zazibohake.java
Really?
If you mean in spark/timing reports, that's likely due to a plugin using plib being slow in it's listener which results in plib appearing slow
bump please
Hello, is there a way to decrease plugin priority for deluxemenus? I'm currently using skript to add events to slots and realized that my code works with anything but deluxemenus gui. I had asked on their support server and they told me that plugin priority would need to be decreased. Is it possible?
incase you didnt see my message on skunity go to the skript config and decrease the plugin priority there
if it doesnt work you may have to code your menu in skript or use deluxemenu's entirely
simple solution: don't use skript
Bump for this, I also tried a /papi register, and it says no expansion class found in file
Your plugin / expansion shade PlaceholderAPI. Here's how to fix that:
- For Maven, set
<scope>toprovided - For Gradle, use
compileOnlyinstead ofimplementation
bump for this !!!!
much better than the bump above
perhaps in some cases it removes data that would otherwise be unusedd, have you tried testing with itemstacks that support hide_attributes normally, like perhaps swords?
Nah just made my own isSimilar method.
my placeholder api expansions placeholders get unregistered whenever i do /papi reload, do i have to listen to an event or something
Pretty sure there is a boolean to make them persistent.
ty
it seems like it's a spigot thing, because the itemmeta doesn't have any attribute modifiers, it also doesn't save the flag
this is so silly
Yeah while looking it up found a thread where even MD_5 said make your own method lol
hi, i have a inventory code, where on click it toggles a setting but i want the lore of the item to be updated i tried using inventory.setItem(11, tiltSetting); but this doesnt seems to be working. is there any to update the item or the inventory without reopening it?
my code:
public static GuiBuilder createSettingsMenu(Player player, Plugin plugin) {
GuiBuilder inventory = new GuiBuilder(3 * 9, formatColors("Settings"));
// NewDamageTilt Setting
ItemStack tiltSetting = new ItemBuilderGUI(Material.NETHERITE_SWORD)
.name(formatColors("&eDirectional Damage Tilt"))
.lore(formatColors(" "))
.lore(formatColors("&fStatus:&r " + SettingsManager.getSettingStatus(player, "NewDamageTilt")))
.flags(ItemFlag.HIDE_ATTRIBUTES, ItemFlag.HIDE_ENCHANTS)
.build();
inventory.setItem(11, tiltSetting, p -> {
SettingsManager.toggleSetting(player, "NewDamageTilt");
inventory.setItem(11, tiltSetting);
});
return inventory;
}
}
if you dont mind, is it possible if i could any example?
guiItem.setAction(e -> {
// do something
gui.update();
});
👍
is it possible to add text format to doc comment
oh do you have any site i can study that
A month and a half ago I changed my .m2, but I forgot how I did that
(I'm trying to sort it out how google says rn)
I don't think you can change the whole of .m2, but the local maven repo location, in $HOME/.m2/settings.xml <settings><localRepository> to change the local repo location (by default it's in $HOME/.m2/repository)
I changed the location back to that (the default), however when running the install task on my project it's not popping up in there
when running the install maven task, is there a way to check where the project is being 'published'? (not sure if that is the correct term)
Thing is: in my other project's pom.xml I can find the dependency
However, when I try using said dependency in any of my classes it won't work
pretty sure it gets logged when you run the install goal
I haven't used maven in ages however
You recon it could be a good occasion to switch to gradle?
doesn't it use the same cache as maven?
I have no idea
When converting from Maven to Gradle, what's the standard? Kotlin or Groovy?
Kotlin. I will not give any arguments for it :))
What's the equivalent of install in gradle?
To both publis to the local repository and compile the plugin?
publishToMavenLocal?
Isn't there a gradle install command as well?
Ah so I have to do build and publishToMavenLocal separately?
hmm. maybe I'm wrong. I had not published anything to my local repository using gradle. Only maven
gradle build publishToMavenLocal
or you can prob just make a different script that runs build and publish after
what's the reason of publishing to local repo if I may?
well I was just about to say if it's a simple use-case a flat-dir would do the trick
I'm not sure what you mean
I'm making a bunch of plugins for my network, some plugins depend on others
well you can ignore my comment then
Uhh switch expressions are not supported in -source 8
It says to use -source 14 instead..? Idk where I change that
In my settings.xml found in my .m2 directory, I set the localRepository to being C:\Users\<user>\.m2\repository, however when I run publishToLocalMaven it still goes to the old location..?
Gradle uses the same logic as Maven to identify the location of your local Maven cache. If a local repository location is defined in a settings.xml, this location will be used. The settings.xml in <home directory of the current user>/.m2 takes precedence over the settings.xml in M2_HOME/conf. If no settings.xml is available, Gradle uses the default location <home directory of the current user>/.m2/repository.
Yeah but for some reason it's not publishing there?
It's still publishing in my old location
Can I just delete my .m2 folder refresh gradle?
I deleted my .m2 folder, yet everything's still working? Is it possible I have a duplicate .m2 my projects look into
Did you like configure your local gradle to point somewhere else (.gradle/ I think?)
How would I have done that?
Ah also, I used to use maven im switching to gradle just now
It's been a long time and I'm not at my pc, but I think you can set user wide settings
It'd be in appdata I think?
Oh
Probably not then
Has anyone had luck with making multiblock structures with their plugins i’m trying to make one and the method i have so far works for the end function but i can only get a successful detection if i build the structure in z+ x+ order and only one configuration works instead of it detecting the 3x3x1 when any blocks in its order are placed
what makes the "Pretty-print" toggle show up here? https://lasertag.venox.network/api/v1/leaderboard
trying to get it on one of my other sites but not sure what triggers it
hi, i'm new to developement stuff i have a bukkit plugin made, how do i add an api to it? pretty weird question i know but this is the first time i'm trying to do something like this
https://gist.github.com/BitCashMC/cfb087a7b541a9d49f3f6c39ffd8d39f
If anyone can critique a dummy project of mine that handles login, registration of accounts using serialization please do, it would be a major help:
Gist of it: I'd like to know if the logic seems succinct and whether its too verbose or not
- Customer represents the Customer with all of its behaviors and serves as a central aggregator for the app in the sense that most data displayed will depend on the Customer thats logged in
- Session controls the current Session environment and possesses a Customer as a field which heavily influences the data displayed across the full app. Session also is where methods are stored for the registation and authentication attempts of accounts
I do have concerns that I did not organize the application the best way, and that the functionalities of a Customer and a Session may be too mixed up and therefore confusing to the client
not gonna comment about the logic itself, but the code style is a mess
empty line there, no empty like there, extra space there, no space there
a lot of the exception handling is very eyebrow-raising
surpressing the IOException on line 76 for example is questionable
im curious as to why you decided to put the methods associated with loading and saving a user into the Session class
i'm also curious why you decided to have an 'isLoggedIn' attribute for your Session class, maybe i don't follow exactly what you want this class to be responsible for?
Is it possible that my IntelliJ projects are looking into anothe folder that is not .m2 for the settings.xml file?
using ec2 seems suboptimal
it's pricey, and also doesn't offer the best performance compared to what you can get with providers that are meant for game servers
yeah a dedicated server would be cheaper and would perform better
I need to create an account on the ecloud
rip
Is there a way to enable placeholders to be used in bungeecode like a tab plugin?
I am not sure, but maybe trying on install that plugin in all servers and link it across MySQL
Because replacing a placeholder in a server from a bungeecord/velocity isn't do able
Hello, How I make it to use PAPI as a depend for my custom plugin, but I want so if the server doesn't have PAPI it will work okay.
Because its custom messages, so the user can configure the messages he want and use whatever placeholder he wants from PAPI if it's installed.
( My first plugin sorry if it's stupid question )
How do they know the attack speed modifier of a sword, in this case -2.4000000953674316??
I need to know the value for attack damage modifier of a sword
in a spigot plugin? Material.DIAMOND_SWORD.getDefaultAttributeModifiers()
Is this code wrong in any way?
fun MovecraftLocation.chunkKey(): Long = (chunkX.toLong() shl 32) or chunkZ.toLong()
Where chunkX and chunkZ are defined as:
public int getChunkX() {
return getX() >> 4;
}
public int getChunkZ() {
return getZ() >> 4;
}
The session class gets instantiated when a new session is created and will then use the given load functions to pair an account with the current session instance. I actually moved it to a "SessionService" utility class and made all the methods static. Will send it soon. I'm not sure if this is normal architecture or if its strange. If so, what would you recommend in this aspect that I do instead?
to have a way to check if the session instance has an account connected, but i suppose i dont need it tbh. I could just keep its customer field at null and use conditional logic around that
how can I get a placeholder's value for a specific player in my plugin, i can't find any methods for it
is this how i am supposed to do it?
String CoinsCalculation = "%player_name%"; String Coins = PlaceholderAPI.setPlaceholders(player, CoinsCalculation);
note: im using %player_name% just for a example, not because i think i have to put the playername there
thats one way to do it
isn't there a straight method for it?
you want to get a placeholder value from your own plugins placeholder?
nope from a extension
Then use PlaceholderAPI#setPlaceholders
thats what im using rn
you're meant to do something like this
String myMessage = "you have %your_placeholder% coins";
String coins = PlaceholderAPI.setPlaceholders(player, myMessage);
// Maybe send it to the player?
player.sendMessage(coins);
im trying to store the value somewhere else, thats why i want it in a variable
Hello, How I make it to use PAPI as a depend for my custom plugin, but I want so if the server doesn't have PAPI it will work okay.
Because its custom messages, so the user can configure the messages he want and use whatever placeholder he wants from PAPI if it's installed.
( My first plugin sorry if it's stupid question )
you can add it as a soft dependency
Hi!
I'm struggling with these NoClassDefFound and ClassNotFoundException errors/exceptions and I have no idea what's going on with them, I've googled countless times for a solution and nothing works, so my last chance is to ask people with more experience than me 🥺
Basically this error or exception sometimes breaks part of my plugin, causing some of my GUI's (from an external, personal and shaded library), commands or event classes to not work, they're not always the same ones but just random classes that stop working
This is most of the times fixed by restarting the server but I can't just restart the server randomly and tell my players to join back again because of the way my server's minigame (or game mode) works
Error (one of the many cases, could be any class): https://hastebin.com/share/fahecerivi.ruby
Class location: https://imgur.com/a/reWmPQV
My class: https://hastebin.com/share/abozuxihar.java
My GUI lib location: https://imgur.com/a/IWOPNEI
build.gradle: https://hastebin.com/share/sugozozeru.java
I doubt my GUI lib is the problem here since it has happened before with simple event or command classes
My GUI lib has a GUIManager that is registered in the main class for classes extending 'GUI' to work
First time posting here so I apologize if I'm missing something or if my request is inappropiate, lmk if I have to provide something else
How can I update placeholders in an inventory? For example, if I use %myplugin_player_coins%, the placeholder won't update instantly unless I reopen the gui
Hi. I wonder how to use deluxe menu with an item, that if i am in inventory and right click it, it will open a menu. Do you know any plugin or how to do that ?
https://imgur.com/a/Zi0M9oC can someone tell me how to get actionbars?
Has anyone here already handled setting many blocks in a world at once while also moving the player? I am having issues where after setting tons of blocks and teleporting the player to this place, the player's client freezes for some seconds. Why would that be?
I also see these warn messages in the console, should I worry?
[09:33:50 WARN]: Block entity minecraft:furnace @ BlockPosition{x=534, y=167, z=71} state Block{minecraft:air} invalid for ticking:
[09:33:50 WARN]: Block entity minecraft:furnace @ BlockPosition{x=534, y=166, z=71} state Block{minecraft:air} invalid for ticking:
Show your code.
bump
For some reason my custom PlaceholderAPI expansions won't work, even though I'm registering it correctly.
[16:34:56 INFO]: [PlaceholderAPI] Successfully registered expansion: modern_player [0.0.1]
[16:34:56 INFO]: [PlaceholderAPI] Successfully registered expansion: modern_arena [0.0.1]
I also tried to debug the register and it says it's done successfully.
But the placeholders still do not work, neither on onRequest or onPlaceholderRequest.
I have the latest version of PlaceholderAPI I though it could be a bug on that specific version, turns out it does not work on previous versions either.
Show your code and what the parse command outputs.
Command: /papi parse me %modern_players_kills%
Result: %modern_players_kills%
onEnable() {
new ModernPlayerPlaceholderExtension(this).register();
}
I should mention that I also that PlaceholderAPI is added as a "softdepend" in plugin.yml
and my expansion class: https://pastebin.com/BwqS38hy
I've done this over 10 times without having issues like that before, I'm just confused.
I've switched to the WE API and the experience is SOOOO much niceeer, the difference not even funny, so that error is not happening anymore (thanks God), but now I have some questions regarging the WE API.
I'm currently using EditSession#moveRegion to (obviously) move a region, and it has been a very pleasant experience. I've disabled most of the SideEffect and currently I've not noticed anything weird, except for the SideEffect.LIGHTING. It does what I assume it'll do when I turn it ON or OFF, but it behaves oddly when set to DELAYED - it only update light sometimes, in some of the moving operations, while others it doesn't update anything related to light at all, why is that?
Also, is there a way to "force" light updates in a region after all blocks have been set (using WE API only)? This is because disabling light updates reduces the total operation time from ~1.1s to ~0.35s, which is a massive gain IMO. I can afford calculating the light later on, in another tick or after some seconds, but I don't know how to do that.
I would also like to know if there's a comprehensive list of what each SideEffect is. Some are obvious, like LIGHTING or ENTITY_AI, but others like EVENTS, UPDATE and VALIDATION are unclear to me what they do, so if there's a small list anywhere describing what each side effect is, that would be awesome.
It got fixed after replacing the identifier from "modern_player" to "modernplayer", I assume it does not support underscore?
is something extnerlally perhaps modifying the actual file jar? or missing with class loaders and they don’t know what they’re doing
so it looks like shiny utils is i assume a dependency? and then its a callback going to your plugin?
is it shaded properly
is something extnerlally perhaps modifying the actual file jar?
I don't think so, or not that I'm aware of
yes it's a dependency, it contains some utils classes I use in most of my projects
there's a hastebin with my build.gradle file in my 1st message, I believe it's correctly shaded
anyways it has happened before with an events class :/
and ur not uploading a new jar via while the current one is running no?
the host's panel I'm using overwrites the current jar when uploading a new one
I restart the server after uploading the new jar ofc, if that's what you mean
Identifiers can not contain _ and override canRegister() and return true
@leaden plume i need ur help
Been looking into migrating from 1.16 nms to 1.20, didn’t know if there’s any tools or documentation out there for it as it’s been a while for me.
Yeah fair
I know a lots changed so that why I’m like ehhhh I could realistically leave it as is, but it’s nice to be on newer jars
like, it depends on what the plugin currently does with nms to know what the alternatives today are, for some things there might even be supported API, the largest change is probably gonna be the use of mojang mappings rather than Spigot's stupid class and method names
It’s the core to our prison server, but yeah
Was gonna compare from spigots site but the compare on their repos is not working
does anyone know how to create custom guis in forge?
And custom items...
I didn't find much information on the internet
i dont think you can make custom guis in a forge server
well you can, but its lots and lots of extra work
Oh
Mods
bump
Store the inventory in a map, then change it's title later on and use the update method?
send your code
because you don't have to reopen it
it's probably due to bukkit's funky item clones
you'll most likely have to do
ItemStack myItemStack = new ItemStack(Material.GOLD);
Inventory inventory = ...;
inventory.setItem(slot, myItemStack);
ItemStack mirroredItemStack = inventory.getItem(slot); // this one has its changes mirrored to the inventory
mirroredItemStack.editMeta(meta -> ...); // use setItemMeta on spigot
thank you, this seems to be working! ❤️
Essentials question:
Is it possible to use Essentials chat format without having the EssentialsXChat plugin on the server? I just want the format using the api
Does anyone know how to add an itemsadder menu layout to deluxemenu?
https://i.ibb.co/xh4d6MC/aaaaamenu.png
This would be the menu itself
the menu image is in itemsadder and I want to add it to the deluxemenu menu
depends what you're looking for. custom gui's you can do with either resourcepacks for chest container or the method patbox or I use (check out my post in #showcase or his Polymer Computer Craft project) , and custom items & entities can be made via different ways
if your client is modded then ignore everything I just said and just Google it because it's a well-known topic
but no one helps there
no-one is going to help if you ask in the wrong channel
Do you guys know where I can find documentation on packet bundles? I want to send multiple packets at once (that rely on one another) but I cant seem to figure out how to use a packet bundle (using NMS)
documentation? bahahaha
but basically, see how the game uses it
i know it's used to bundle all the packets related to spawning an entity in the world
what is a packet bundle
A packet of packets
anyone have experience in trig here im working on a helical particle string but for the love of all that sholy i cant figure out this issue it keeps making an ablong oval with sharp corner turns or wierd shapes in the helix with this math and im absolute dog sheit with trig
double x = helixRadius * Math.cos(angle);
double y = helixRadius * Math.sin(angle);
double z = helixRadius * Math.sin(angle);
Location helixLocation = currentLocation.clone().add(x, y, z);
im no expert but i think you want to pick either y or z (depending on the orientation you want) and just make it angle*constant
if you think about a helix as being drawn in 3d space, you are basically tracing a circle with 2 coordinates (which takes trig) while the third is simply linearly increasing
i attempted using 0 as the y but then the helix is just flattened to a 2d wave on the x and z axis and if i 0 the z or x respectively instead i get a 2d oriented in the other orientation on the y axis or x axis etc idk where im going wrong math is hard XD
this is the full void if it helps at all
public void summonParticleString(Location startLocation, Location endLocation, Particle particle, int count, double offsetX, double offsetY, double offsetZ, double speed, double helixRadius, double helixPitch) {
World world = dim();
if (world == null) return; // Ensure the world is not null
new BukkitRunnable() {
private double distance = startLocation.distance(endLocation);
private double traveled = 0;
private Location currentLocation = startLocation.clone();
private double deltaX = (endLocation.getX() - startLocation.getX()) / distance;
private double deltaY = (endLocation.getY() - startLocation.getY()) / distance;
private double deltaZ = (endLocation.getZ() - startLocation.getZ()) / distance;
private double angle = 0;
@Override
public void run() {
if (traveled >= distance) {
cancel();
return;
}
world.spawnParticle(particle, currentLocation, count, offsetX, offsetY, offsetZ, speed);
// Calculate helix position
double x = helixRadius * Math.cos(angle);
double y = helixRadius * Math.sin(angle);
double z = helixRadius * Math.sin(angle);
Location helixLocation = currentLocation.clone().add(x, y, z);
// Spawn Flame particle at helix position
world.spawnParticle(Particle.DRAGON_BREATH, helixLocation, 10, 0, 0, 0, -0);
// Move the current location along the direction towards the end location
currentLocation.add(deltaX, deltaY, deltaZ);
traveled += Math.sqrt(deltaX * deltaX + deltaY * deltaY + deltaZ * deltaZ);
// Increment angle for next helix position
angle += Math.PI / 5; // Adjust the divisor to change the helix frequency
}
}.runTaskTimer(plugin, 0, 1); // Change 'plugin' to your plugin instance
}
so you want a helix of particles from a certain start to end location?
anyway if you don't figure it out before 4 hours from now I'll send u a solution
because school
I currently have a system that adds a client side entity to all nearby entities. This is ran through a getNearbyEntities call every 5 ticks (using a BukkitRunnable). This works great, however when an entity is spawned in, like a player, sometimes the plugin gets the player through getNearbyEntities before it is spawned in client side, meaning it tries to set the passenger and stuff with an unspawned entity. How can I know when it is spawned client side?
not sure if I understand correctly, but if it's client-side, it should not be returned in getNearbyEntities, no?
it adds a client side entity as a passenger to all nearby entities
I guess what I could do, is just have it remove it and add it back (like, when the player joins, wait 5 ticks, then add the entity, if it was already sent to player, remove it and re-add it)
correct the start and end locationa re defined from anotehr void this is called in and the helix will rotate around a central line of particles that is also spawned in this same void im still stumped tho i cant figure it out
Is there any way for TriumphGui to have actions on GuiItems that are set as AIR? It doesn't seem to work
Ahhh the currentItem will be null if clicked on air I believe, and therefore it won't work, any way to change this functionality? @pulsar ferry
Called from here in GuiListener
I mean, how do you want to call an action on a null item?
Use slot actions instead
Oh didn't know that was a thing
hey i started trying to learn plugin development like an hour ago and im wondering why build artifacts is grayed out?
and my plugin keeps disabling itself when i load it and its really frustrating, can anyone help me?
Hey, provide server log. Without it we can't know what's the cause
i cant send files here
and if i sent pictures it would have to be seperated into 3
You shouldn't send files nor screenshots when sharing logs/code/configuration files. Use service like PasteBin or https://paste.helpch.at
can you send Main file of the plugin?
the .jar?
Nope, content of the Main class, that's the class that extends JavaPlugin
this one? https://paste.helpch.at/xiyoyijena.java or https://paste.helpch.at/idoliruken.kotlin this one?
The first one
Well you use new MyFirstPlugin() when registering event listener which creates new instance of the main class. You can't do that and that's why you can see java.lang.IllegalArgumentException: Plugin already initialized! in the log.
Instead of creating new instance of the main class just use this to refer to the class itself (main in this case; or move the listener to separate class)
ooh thank you, and what about for my build artifacts being grayed out? i was told in a tutorial i needed to click on it yet i couldnt.
Idk what you mean
i would send a screenshot but yeah
For sharing screens u can use prnt.sc/imgur
and also now that i have done this my event still will not work. it does not broadcast the message or send it to player
okay nevermind mabye its doing it so fast i dont see it when i join because when somone else joins it doeses it
why is player.sendMessage(getPlayerPrefix(player) + ChatColor.YELLOW + player.getName()); showing an error? im using vault api and its saying this method doesent exist
you might wanna do a basic java course before you get started with plugins
spigot is not the best place to learn honestly
When you mean basic Java course how much understanding do you mean exactly? And I can’t really find any good ones.
once you get the basics, this is debatable imo
although you'd need the right resources, which is hard to find
and tbh I can't answer this because I learned via spigot
So can someone answer this then? The vault api says that’s the right syntax so unless I’ve installed it wrong I don’t know what I’ve done wrong
oh shoot oops
read https://github.com/MilkBowl/VaultAPI?tab=readme-ov-file#implementing-vault, specifically the setupChat()
then do chat.getPlayerPrefix(player)
for example, notice in the red box it does econ.depositPlayer instead of just depositPlayer(...)
Thanks 🙏 I have no idea why I couldn’t find this when looking online
anyone got any idea why my itemstack's item meta fully disappear after applying NBT to it?
String side = game.isSide() ? "Heads" : "Tails";
String betOwnerName = game.getPlayer().getName();
int gameID = game.getGameID();
ItemStack rawBetItem = game.getItem();
// Returns an item with its item meta, etc
player.getInventory().addItem(rawBetItem);
// Create a NBT and assign the game ID to it
net.minecraft.server.v1_12_R1.ItemStack nmsItem = CraftItemStack.asNMSCopy(rawBetItem);
NBTTagCompound compound = new NBTTagCompound();
compound.set("gameID", new NBTTagString(String.valueOf(gameID)));
compound.set("playerName", new NBTTagString(betOwnerName));
nmsItem.setTag(compound);
ItemStack itemBetWithNBT = CraftItemStack.asBukkitCopy(nmsItem);
// Returns just the rawBetItem's item type with the applied NBT, no item meta
player.getInventory().addItem(itemBetWithNBT);
fyi if you're wondering about the gameID line, I know about new NBTTagInt(), but I was so confused on why this is happening I changed it to new NBTTagString(String.valueOf(gameID))
extra info: this is ran async, and is also ran in a nested for loop, not sure if thats gonna affect anything
edit: just tried this without running it async, came across the same issues
maybe the issue is occurring because when you convert the item stack to an NMS item stack and then back to a Bukkit item stack some data might be lost in the conversion process? (sorryif I'm mistaken)
show code
I assume in your plugin.yml under the main attribute it's probably something like ?
wafflesky.tebex.io.myfirstplugin.Messages
Your package is written as
package wafflesky.tebex.io.WaffleCore;
So it should probably be something like
wafflesky.tebex.io.WaffleCore.Messages
Although, the naming scheme is a little inconsistent, it idealistically should be
wafflesky.tebex.io.wafflecore.Messages
With your file structure looking something like
/src/main/java/wafflesky/tebex/io/wafflecore/Messages.class
i have removed all variations of "MyFirstPlugin" that i can find yet its still saying i need to change cetain things to it. and the main: in plugin.yml is "main: wafflesky.tebex.io.WaffleCore.Messages"
and by the way you have worded it i dont understand if your telling me to rename the main attribute or the package
okay i just reset everything and put my classes in a new project but now all that code from before doesent work yet the plugin loads fine.
What exactly is not working...the join event or the death event, or the quit event...
https://paste.helpch.at/ugihijohoy.css got this error. i dont know what it wants from me
not important but you should not be naming packages uppercase
share all of the files or the errors
you just wiped the item's nbt data, use the method to get the item's compound tag instead of making a new one
nms's ItemStack#getOrCreateTag()
idk what version you are using so i cant tell you exactly the obfuscated name
i usually use screamingsandles to figure that out
How does HashSet#clone work in kt?
Is it just HashSet(items)?
To make a copy / clone of the set?
As I want to modify it while iterating
fun claim() {
for (item in HashSet(items)) {
if(player.inventory.contains(Material.AIR)) {
player.inventory.addItem(item)
items.remove(item)
}
}
}
just do .toSet()
or i think kotlin might automatically do the clone? or whatever it takes to avoid the CME
might be making that up tho
That'd actually be a very nice feature to have
Does kotlin have anything to simplify this?
fun create(player: Player): Storage? {
if(BY_PLAYER.containsKey(player.uniqueId)) {
return BY_PLAYER[player.uniqueId]
}
val storage = Storage(player)
BY_PLAYER[player.uniqueId] = storage
return storage
}
I feel like I'm just using it like java
me love computeIfAbsent
when you do getOrPut you might aswell make the Storage not null (remove the ?)
Ah yeah true lol
Confused how it works tho BY_PLAYER.getOrPut(id, () -> Storage(Bukkit.getPlayer(id)))
thats not how you write lambdas in kotlin
{ id -> Storage(Bukkit.getPlayer(id)) }
or alternatively { Storage(Bukkit.getPlayer(it)) }
Ahhhh gotcha, thanks!
has anyone used this and if so how the heck did you use it i cant find any examples of it and gpt is dumba s rocks and keeps trying to give me examples using armorstands but i need a large scaled text display not a little name tag on an armorstand [Text Display extends Display] https://hub.spigotmc.org/javadocs/spigot/org/bukkit/entity/TextDisplay.html
This should check for empty slots in inventory right? I just wanna check if there's any empty slots if(player.inventory.contents.any { it == null })
i believe an empty slot is defined as Material.AIR not as null but i may be wrong
i dont understand why this is so obscure and hard to find any useful documentation on
Doesn't look like TextDisplay supports making the text larger
😭 this is wack the game supports scaling of text displays cmon spigot fix ittt
A side comment on this, depending on the map you're using keep in mind getOrPut is not thread safe, computIfAbsent is
This also seems very weird, from kotlin docs
This method guarantees not to put the value into the map if the key is already there, but the defaultValue function may be invoked even if the key is already in the map.
because of race conditions
the value being in the map might change in the time it takes to check initially, and then call the function
https://paste.helpch.at/ugihijohoy.css i have this error despite the api being in 1.19.4 and the server also in 1.19.4
api-version is major versions only, so 1.13, 1.14, 1.19, 1.20, ...
ohhhhh
can someone tell me how to effectively impliment mojangauthlib every method ive ettempted to use for impliment or compile etc with my build.gradle has failed it almsot worked at one point but went from working to red again and idk what im doing wrong here
should i just change the version to 1.19 then?
yes
found a solution ```java
Transformation transformation = textDisplay.getTransformation();
transformation = new Transformation(
transformation.getTranslation(),
transformation.getLeftRotation(),
transformation.getScale().add(5, 5, 5),
transformation.getRightRotation());
textDisplay.setTransformation(transformation);
}
made a void incase anyone else wants to use it ```java
public void createTextDisplay(Location loc, String text,int seconds /if you remove the disappear function remove this too/,int scale,Color bg) {
World world = getServer().getWorld("world name");
TextDisplay y = (TextDisplay) world.spawn(loc,TextDisplay.class);
String tt = ColorKey(text); //this is my own void for formatting the color codes with & symbol remove this and replace tt with text for your application
y.setText(tt);
y.setBillboard(Display.Billboard.CENTER);
y.isGlowing();
y.setGlowing(true);
y.setBackgroundColor(bg);
Transformation transformation = y.getTransformation();
transformation = new Transformation(
transformation.getTranslation(),
transformation.getLeftRotation(),
transformation.getScale().add(scale, scale, scale),
transformation.getRightRotation());
y.setTransformation(transformation);
//keep this if you want it to disappear after a defined amount of time
new BukkitRunnable() {
@Override
public void run() {
for(Player p : Bukkit.getOnlinePlayers()) {
p.playEffect(loc,Effect.EXTINGUISH,1);
}
y.remove();
}
}.runTaskLater(plugin, seconds*20);
//--------------------------------------------------------------------
}
i am trying to make it so it does not play any noise for the weak hit noise when no damage is taken, but i dont think entitydamagebyentity accounts for nondamage hits. what do i do instead?
@EventHandler
public void onEntityDamage(EntityDamageByEntityEvent event) {
if (event.getDamager() instanceof Player) {
Player player = (Player) event.getDamager();
boolean isCrit = player.getFallDistance() > 0.0F && !player.isOnGround();
// getLogger().info("CONDITIONAL FOR damage being taken by a player");
double damage = event.getDamage();
if (damage > 0) {
// getLogger().info("CONDITIONAL FOR damage being above zero");
if (isCrit) {
// getLogger().info("CONDITIONAL FOR crit sound");
event.getEntity().getWorld().playSound(event.getEntity().getLocation(), Sound.ENTITY_PLAYER_ATTACK_CRIT, 100, 1);
} else {
// getLogger().info("CONDITIONAL FOR strong attack");
event.getEntity().getWorld().playSound(event.getEntity().getLocation(), Sound.ENTITY_PLAYER_ATTACK_STRONG, 100, 1);
}
} else {
// getLogger().info("CONDITIONAL FOR weak sound not playing");
}
}
}
set damage check to if(damage > 1) since the lowest damage possible per hit is still a long double of like 0.000093454 you get the point but setting it to one ensures that the only time the sound plays is if actual health was taken away from the attacked entity
ok so my previous method didnt work because apparently you can't just do it in bukkit so does anyone know how to do it using protocol lib and block packets of sounds?
or like even use/have the protocol lib api
So I’m new to spigot and in the last code I used it was extremely simple and to store a variable for a specific player you would just do {variable::%player’s uuid%} but now with spigot I have seen people say many different ways to store something to a player and I wanted to know how I do this and what’s the best way? I’ve looked online and I might just be bad at searching but I can’t find much info.
- God thank you for stopping using skript, welcome to the sane club.
- Different ways yes, you could always have a class that contains all the info about your player that you want to store, then on join, you load that info from a file and store it in a hashmap, on quit, you remove it.
If you did not understand what I said, then you probably lack java basics Knowledge which in that case I would recommend learning java before trying anything with the bukkit api.
On a side note, use paper api instead of spigot.
Is there some sort of tutorial on all the ways of data storing I could use? I like to know all my options before making a decision.
I'm a little confused as to what you're trying to store and why
Just information for certain players. Like if I have a levelsystem how am I going to store the levels? If I have a kills tracker where am I going to store the kills? This is what I want to learn how to do.
Depending on the size and complexity of your data, you can use flatfiles like json/yaml, and those are fairly simple solutions.
You can also use storage solutions like MySQL, MariaDB, PostgreSQL, etc.. or NoSQL solutions like MongoDB
Or also depending you might be able to use PDC
Surprised afonso didn't mention PDC but if you want like leaderboard then PDC isn't optimal
But for yaml at least, I think spigot has an official wiki page on that @plush pond
But there's gotta be tons of yt tutorials and stuff on this
exactly why I didn't mention it, it can be properly used only in some instances...
My answer was also not that technical since my gut tells me he is one of those people that has 0 knowledge with java, come from skript and want to go from 0 to 100 in 2 seconds lol
which is only going to cause him to ask even more questions here, taking up our time while he himself not learning much since he can't figure things out alone since he skipped several things.
I might be a pain in the ass but I am only thinking in the person's best interests
My best interests?
All I wanted was a pepsi
Just one pepsi
and she wouldn't give it to me
bruh
Ohhhh yeah didn’t know transform was a thing, good to know :))
Is using sqlite technically slower than just writing to a json file? Or does it depend?
as always it depends, but sqlite performs pretty well generally
I have this weird bug with unicode where when I sent the packet for update display name before the resource pack loads, it does this:
However when I send it after the pack has loaded, it does this:
Why does it do that? Is there anything I can do to avoid it?
send it after the pack has loaded?
or send it before pack and then when it loads send display name another time
but load time isnt static
on my pc its like 2 seconds, on my friends its like 10 (its a dinosaur)
the resource pack status event runs before it loads, so I cant use that
declaration: package: org.bukkit.event.player, class: PlayerResourcePackStatusEvent
oh
nvm then
you don't cancel the task you start at line 21
ty
what am I doing wrong now? the time is now 0 but it shouldn't be like this as soon as the square is blocked
https://paste.md-5.net/omoyedoheq.java
https://paste.md-5.net/wacalefige.java
now the timer scales by one second and then stops, and the blocks remain
https://paste.md-5.net/afinewibis.java
I would also like to put that when I place a spider web 5 are placed at once, but when I do it is placed one and like 9 timers, but I want 5 webs and 1 timer
That's a lot of timer
the timer get configured in the config.yml
Hi I am facing some issues on geysermc
The players connecting from geysermc are crashing after joining
Have been trying to fix it from a week
have you tried asking in the geyser discord?
Any suggestions/ideas on how I can reduce this duplicate code?
I had the idea of using a method with a function (or bifunction?) argument, but I'm not sure if that would be the right aproach here or if it would even work....
profiles is a list of ProfileEntry.Builder instances and builder is just a single ProfileEntry.Builder instance.
https://paste.helpch.at/eyexiwoqep.java
And to clarify a bit more... What I do give to the different builder methods (motd(...), favicon(...), etc) are lists with various types of content. Some contain Strings, others Integers and others Lists
Sure why not
https://gist.github.com/DrZoddiak/0474d7e40ef20e442781d701cfc4178b
It's kotlin but you get the gist
final Object contents = Array.newInstance(TEXT_ARRAY_CLASS, 1);
AnnoyingPlugin.log("contents type: " + contents.getClass().getName());
final Object text = TEXT_CONSTRUCTOR.newInstance(content);
AnnoyingPlugin.log("text type: " + text.getClass().getName());
Array.set(contents, 0, text); // ERROR: java.lang.IllegalArgumentException: array element type mismatch
contents type: [[Lnet.md_5.bungee.api.chat.hover.content.Text;
text type: net.md_5.bungee.api.chat.hover.content.Text
Doesn't help me tbh...
Too much kotlin...
Shame
Why are you separating the builder and the profiles though? If they're all ProfileEntry.Builder, you could combine them and use the list (profiles in this case), no? That'll help cut down on duplication a lot
I don't get your point
I might be misunderstanding your case but you could omit the uses of the builder variable, and just go with the profiles instead. Like this:
for(int i = 0; i < motds.size(); i++){
profiles.get(i).motd(motds.get(i));
}
builder is the main builder and profiles a list of them.
The reason is, that they - after being build - are converted to a file where the list will be a profiles option and the builder the file itself.
Like, as an example:
profiles:
- motd: ['Line A', 'Line B']
favicon: imagea.png
- favicon: imageb.png
motd:
- Line 1
- Line 2
Ahh. You could delay those checks later when you're doing the converting
So if there's only a single motd, then they'd go straight to the motd section, otherwise they go to the profiles.motd section
Alright
Since text_array_class is Text[].class, Array.newInstance returns a 2d array Text[][]
ohhhh 
ty
Okay, I'm back and I'll give more context to now try and explain everything...
So.
builderis a single instance ofProfileEntry.Builder, a nested builder class I offer through my plugins API:profilesis a list of theseProfileEntry.Builderinstances.- I use Configurate to create and load YAML files and configured the loader to use my custom Serializer to convert
ProfileEntryinstances into YAML entries:- https://codeberg.org/Andre601/AdvancedServerList/src/branch/feature/slp-migrator/core/src/main/java/ch/andre601/advancedserverlist/core/migration/serverlistplus/SLPConfigMigrator.java#L199
- https://codeberg.org/Andre601/AdvancedServerList/src/branch/feature/slp-migrator/core/src/main/java/ch/andre601/advancedserverlist/core/profiles/profile/ProfileSerializer.java
profilesis being converted to a list of entries in theprofilesYAML option of my file.builderis being converted into the options themself in the YAML file.
- What I effectively do is this:
- Load the different configuration parts of ServerListPlus, using its own internal API.
- Convert parts of each section into their own collection of things (Usually just lists).
- Find the largest possible list to determine how many
profilesentries there need to be - Go through each list and check if size is 1 or more than one. If one, add it to the builder (global), if more, iterate through all entries and add to the profiles list
- Finally, convert the builder and profiles as mentioned above into a ConfigurationNode and save everything to the YAML file.
Also, I think I have a solution to simplify stuff?
private static int parseConfig(AdvancedServerList<?> core, PersonalizedStatusConf.StatusConf conf, String filename, Type type){
// do stuff and get lists
apply(motds, builder, profiles, ProfileEntry.Builder::motd);
// do more stuff and return int
}
private static <T> void apply(List<T> list, ProfileEntry.Builder builder, List<ProfileEntry.Builder> profiles,
BiConsumer<ProfileEntry.Builder, T> builderConsumer){
if(list.size() == 1){
builderConsumer.accept(builder, list.get(0));
}else
if(list.size() > 1){
for(int i = 0; i < list.size(); i++){
builderConsumer.accept(profiles.get(i), list.get(i));
}
}
}
tested it and it does indeed work.
You can set somewhere that this is a funnel menu. At deluxmenus
Yeah that's what I would do I think. Nice!
Hey guys I’m having this error in my pterodactyl I cannot connect the node:
HTTP Error 403, Invalid credentials (Upon Wings —debug)
Any thought on that
A member of staff has requested I move your message to a paste,
Most likely because it contains a config/error/code snippet.
How does one make a Pet (make any mob follow specific player) using NMS? I'm still kinda new to NMS, so I'm not really sure what I'm doing lol (1.20.2)
I currently have
compileOnly name: 'spigot-1.20.2-R0.1-SNAPSHOT-remapped-mojang'
Wrote some mediocre code and now I'm getting error:
java.lang.NoClassDefFoundError: net/minecraft/world/entity/PathfinderMob
am I missing something?
I have added a plugin:
id "io.github.patrick.remapper" version "1.4.1"
tasks {
remap {
version.set("1.20.2")
}
}
tasks.named('shadowJar') {
dependsOn remap
}
that doesn't seem to do anything tho lol
Anyone know how I can prevent a dropped item from going through a hopper? - SpigotAPI
well nvm, I figured it out
InventoryPickupItemEvent, check if inventory holder is a hopper
Is there an event for when a player left clicks on an entity?
I'm having a hard time finding one
That was my concern with that one
Why not use paperweight?
please help me
Do you need help baking a cake? Writting an essay? Finding nemo?
whenever i do /papi ecloud download [any extension] it says if cant be found and it doesnt exist
wrong channel
and dont randomly ping people
can u help me in the other channel then? please
i already said something there
no.
you ask
and you wait.
r u ok
Not the impatient one here
ugh, reasons
I have a current project I'm incorporating nms to
Incorporating nms into a project sounds like a perfect use for paperweight :')
true
You can set somewhere that this is a hopper menu. At deluxmenus
I more or less need someone to help me decide what to use, so I'd appreciate it if you could help ✌️ and thank you in advance.
I'm trying to create a "creative" server (not really the concept of creative but more like the concept of creating worlds) that is a bit more or less not using plots but rather slimeworldmanager or advancedslimeworldmanager on 1.20.4;
Since I'm creating the slimeworlds, I've been thinking over on how can I make it so that each slimeworld has it's own:
- tab
- scoreboard
- chat
- commands
- inventory
- ender chest
and I came to a conclusion that I would get stopped at "commands" and "ender chest" so I've been thinking of switching from SWM to something else, but I can't just create infinite amount of worlds just for a 1k x 1k world for my players or 5kx5k for my donators (might actually do higher 10k x 10k or 25k x 25k max).
does anyone know if my approach is correct or should I just drop making so that my players are able to make custom commands (I took half my ideas from a server, fairly sure they make it per world, I don't want to create worlds).
TLDR using SWM/ASWM; need help if I should switch to something else (suggest please) cause I'm unable to make per slime world enderchest/command/inventory(?); won't use bukkit/nms createWorld cause it will be heavy on the server.
guys, you'll see that with $1000 check I redeem $71,000. It's not normal, of course. I'm also sending you the code class and the config.yml! Java class --> https://paste.md-5.net/atikotoyiv.java || Config.yml --> https://paste.md-5.net/joliyahiha.makefile
1.20.1 spigot
I think it's got to do with the colors but I don't really know
How can I make monsters be passive (not attack players)? 😄 every possible way, NMS included
Every tick, set it's target to null
Unless u still want pathfinding
I think there is a target event
well, I currently do PathfinderMob#moveTo And PathfinderMob#getNavigation().moveTo
if I set target to null, it won't work?
uhh idk
but i kinda misread your question at first
so setting target to null and/or what yapperyapps said should work
could remove the respective mob goals
to build onto that question, how could i make a mob ignore a specific player, as if the mob was on the same team as the player (without putting the player and mob on a team)? is that possible using paper api?
anybody know any good particle libraries that support spigot 1.20.6 and paper 1.20.6?
Hello, I want to use the happy hud plugin, but when I run this plugin on the server version 1.18.2, the plugin does not work):
just cancel the targeting on target if target is same team
hi! I don't know how to help you, but for future reference, this statement is pointless. if you have a problem then please provide more information about it than "it does not work", because otherwise it is impossible to help you
here is a guide if you're confused
anyone know of a library to create both http and websocket server on the same port? ping if reply
My error when running the plugin is this
[00:19:53 WARN]: org.bukkit.plugin.InvalidPluginException: Unsupported API version 1.19
[00:19:53 WARN]: at org.bukkit.craftbukkit.v1_18_R2.util.CraftMagicNumbers.checkSupported(CraftMagicNumbers.java:375)
[00:19:53 WARN]: at org.bukkit.plugin.java.JavaPluginLoader.loadPlugin(JavaPluginLoader.java:149)
[00:19:53 WARN]: at org.bukkit.plugin.SimplePluginManager.loadPlugin(SimplePluginManager.java:415)
[00:19:53 WARN]: at PlugManX.jar//com.rylinaux.plugman.util.BukkitPluginUtil.load(BukkitPluginUtil.java:418)
[00:19:53 WARN]: at PlugManX.jar//com.rylinaux.plugman.command.LoadCommand.execute(LoadCommand.java:116)
[00:19:53 WARN]: at PlugManX.jar//com.rylinaux.plugman.PlugManCommandHandler.onCommand(PlugManCommandHandler.java:97)
[00:19:53 WARN]: at org.bukkit.command.PluginCommand.execute(PluginCommand.java:45)
[00:19:53 WARN]: at org.bukkit.command.SimpleCommandMap.dispatch(SimpleCommandMap.java:159)
[00:19:53 WARN]: at org.bukkit.craftbukkit.v1_18_R2.CraftServer.dispatchCommand(CraftServer.java:906)
[00:19:53 WARN]: at net.minecraft.server.network.PlayerConnection.a(PlayerConnection.java:2307)
[00:19:53 WARN]: at net.minecraft.server.network.PlayerConnection.a(PlayerConnection.java:2118)
[00:19:53 WARN]: at net.minecraft.server.network.PlayerConnection.a(PlayerConnection.java:2099)
[00:19:53 WARN]: at net.minecraft.network.protocol.game.PacketPlayInChat.a(PacketPlayInChat.java:46)
[00:19:53 WARN]: at net.minecraft.network.protocol.game.PacketPlayInChat.a(PacketPlayInChat.java:6)
[00:19:53 WARN]: at net.minecraft.network.protocol.PlayerConnectionUtils.lambda$ensureRunningOnSameThread$1(PlayerConnectionUtils.java:51)
[00:19:53 WARN]: at net.minecraft.server.TickTask.run(TickTask.java:18)
[00:19:53 WARN]: at net.minecraft.util.thread.IAsyncTaskHandler.d(IAsyncTaskHandler.java:153)
[00:19:53 WARN]: at net.minecraft.util.thread.IAsyncTaskHandlerReentrant.d(IAsyncTaskHandlerReentrant.java:24)
[00:19:53 WARN]: at net.minecraft.server.MinecraftServer.b(MinecraftServer.java:1400)
[00:19:53 WARN]: at net.minecraft.server.MinecraftServer.d(MinecraftServer.java:188)
[00:19:53 WARN]: at net.minecraft.util.thread.IAsyncTaskHandler.y(IAsyncTaskHandler.java:126)
[00:19:53 WARN]: at net.minecraft.server.MinecraftServer.be(MinecraftServer.java:1377)
[00:19:53 WARN]: at net.minecraft.server.MinecraftServer.y(MinecraftServer.java:1370)
[00:19:53 WARN]: at net.minecraft.util.thread.IAsyncTaskHandler.bo(IAsyncTaskHandler.java:114)
[00:19:53 WARN]: at net.minecraft.server.MinecraftServer.a(MinecraftServer.java:1504)
[00:19:53 WARN]: at net.minecraft.server.MinecraftServer.w(MinecraftServer.java:1226)
[00:19:53 WARN]: at net.minecraft.server.MinecraftServer.lambda$spin$0(MinecraftServer.java:316)
[00:19:53 WARN]: at java.base/java.lang.Thread.run(Thread.java:1583)
that is not a development question
^^^
and dont even try asking if u pirated the plugin please
What explanation do you want to help me?
@strong plume
^^^
bumping this cause it was flooded away
please go to the proper support channels for this
as has been pointed out to you twice
we live in a society
is this for personal use?
no
oh
wait wdym
like is anyone else gonna use it besides you
oh yeah yeah
oh ok
never used websockets and http on the same port
yeah i got them working separately
but i researched a bit and found it was possible
news to me
wouldn't cause issues I don't think, but might be difficult to find out how to support it
since you can't use 2 different libraries or anything
i mean discord uses the same port for theirs no?
any specific reason why you only want one port?
nginx for ex I think supports it
but if it's for public use then that's not viable
@worn jasper id rather have eventalerts.venox.network/api/v1 and eventalerts.venox.network/api/v1/socket/ than eventalerts.venox.network/api/v1 and eventalertssocket.venox.network/v1/ or something
uh
yeah i dont know the capabilities of nginx fully
ill ask my host
ty
@dark garnet do this ok?
:(
but yeah I don't see why/how just doing this and redirecting it wouldn't work
lol
he's asking how to do so
seems like an easier solution to the whole thing ngl
he wants to use the same port though
my suggestion is not doing so, but to achieve his goal with the api paths, he can just redirect
it'd still be the same port
i think
wait what is ws port
websocket is still port 80 by default
same as http
that's the issue
aka eventalerts.venox.network/api/v1 goes to the normal one and eventalerts.venox.network/api/v1/socket/ to eventalertssocket.venox.network/v1/
yeah but he can change the port no?
that's http stuff though
http redirects?
I am quite confused on why using a second port is a limitation
just QOL
so he can use nginx to split traffic either based on path or protocol
seems like he wants to split on traffic here
eh I suppose
or some java library but I don't know of one
spring doesn't do any of this?
(idk, spring has a ton of tools)
it's such a big java library and I'm a java dev 😭
🤨
I luckly found my beloved svelte on time
💀
otherwise I would be dead now
tried svelte
but web dev isn't for me atm
spring is one of those things...
you either understand it, pog
or you don't, and you cry
noooo no no no
you don't try to understand spring
you just use it without asking questions
and it just works
tell that to my hello world
All of the stackoverflow questions r about spring and I still got no idea what it exactly is 😭
spring is just convenient to use
dw me too
I think it's like a web backend library
that's all I know
java backend framework in a nutshell
framework* oops
It looks scary just looking at the gradle file
(although if you do use php, use laravel atleast)
the trick is learning how to use it without trying to understand how it works
or join the cool family, and use svelte
I’ll just remake spring
some ex-spring devs did that
💀
it's called micronaut
I’ll call mine boing
yes?
frontend with java?
i pasted it on accident
have you heard of templating?
sveltekit*?
Thank you

