#development
1 messages · Page 41 of 1

no it won't if you do it properly
if (has permission) return;
setItemInHand(item without skin);
cancelEvent();```
if the api made logical sense
The item is used on the jukebox and you also add it back to the inventory
https://paste.helpch.at/opajeyijaw.bash well, that ain't working too
ok then cancel it only if the item is a disk and the block is a jukebox ?
and there's event.getUsedItem() or something
yup noticed that
The paper_latest_build_url seems to be wrong
Yeah looks like it
easy fix seems like
I can't find the link
Ah I forgot what the paper naming convention is mb
tho it might still not completely work tho. don't know enough bash but it seems like instead of it going to put the jars in servers/server1/paper.jar it will just put it in server1/paper.jar
Nah it works it works
ok then
It loops through all the directories in servers
curl -s -L -o "${server_dir}/paper.jar" "${paper_latest_build_url}" this is the download part
I assume it goes inside each directory when it loops?
I don't know bash much either, hence I am using ChatGPT for it
oh wait. there's more to the for loop then I saw
yeah but the link it built was just wrong
Honestly, ChatGPT can be really good if used correctly
It can be used a bit too much for spoonfeeding though
I mean I am being spoonfed bash code rn, but I genuinely cba to learn bash just to play around with Bungeecord
Specially since i'll move on to ptero soon
In ArrowKt, how to I map Nel<Ior<A, B>> into Ior<Nel<A>, Nel<B>>
Bit of a weird request
Does anyone have an example BungeeCord plugin that I can clone?
My IntelliJ is completely broken and wont let me create new projects
Is it normal for Bungeecord plugin data folders to be named com.example.artifact.MainClass?
The home of Spigot a high performance, no lag customized CraftBukkit Minecraft server API, and BungeeCord, the cloud server proxy.
oh, it cant create any projects at all, thought it was just hte minecraft dev plugin that was acting up
tbh might be worth reinstalling intellij if its not functioning correctly
Planning to make an economy plugin based around BigDecimal, how should I go about storing that in an SQLite/MySQL database? As a DECIMAL or TEXT value? It seems like SQLite doesn't actually support a DECIMAL data type so might have to go with TEXT?
I'd say TEXT
i mean, it is valid
just, eh, jvm serialization isn't particularly encouraged for long term storage
I don't think any database will directly support BigDecimal as a number
or well not sqlite/mysql
decimal should work I guess
Jdbc directly supports BigDecimal and MySQL works with it, SQLite just doesn't have a data type for it so I think TEXT is going to have to be the answer
Also interested in that answer 
Where can I get a API jar for autosell? https://www.spigotmc.org/resources/autosell.2157/
autosell has an api?
Hey, how does ArmorStandManipulateEvent works? Its not getting triggered when i click the armor stand
Is there something else to be done?
Did you read the docs
'Called when a player interacts with an armor stand and will either swap, retrieve or place an item.'
Oo…so which event should be used? EntityInteractAtEntityEvent ? Or is there anyother event to check clicks?
EntityInteractEvent when getEntity() is not null and armor stand
Yeah..will check it out
Anyone here having knowledge with GitHub Actions in terms of releases?
Like I want to update my current action to trigger on release (no matter if normal or pre-release), but only trigger specific steps/jobs based on whether it is a pre-release or a normal one.
Hey, i have a Plugin that uses this Methode, my plugin has 1.17.1 and 1.18.1 support.
public void sendLabyModMessage( Player player, String key, JsonElement messageContent ) {
byte[] bytes = getBytesToSend( key, messageContent.toString() );
PacketDataSerializer pds = new PacketDataSerializer( Unpooled.wrappedBuffer( bytes ) );
PacketPlayOutCustomPayload payloadPacket = new PacketPlayOutCustomPayload(new MinecraftKey("labymod3:main"), pds );
((CraftPlayer) player).getHandle().b.sendPacket( payloadPacket );
}
Now i have the problems that this imports...
import net.minecraft.network.PacketDataSerializer;
import net.minecraft.network.protocol.game.PacketPlayOutCustomPayload;
import net.minecraft.resources.MinecraftKey;
are the same name on the two Versions but they have not the exact same methods.
Here an Example 1.17.1:
((CraftPlayer) player).getHandle().b.sendPacket( payloadPacket );
Here an Example 1.18.1:
((CraftPlayer) player).getHandle().b.a( payloadPacket );
***the two methods uses the same imports. Can anyone help me fix this Problem?
Use multiple modules and then load the correct one depending on the version that you are on
I do that with example this import because it has every verion another name:
import org.bukkit.craftbukkit.v1_17_R1.entity.CraftPlayer;
and:
import org.bukkit.craftbukkit.v1_18_R1.entity.CraftPlayer;
But the imports i showed in the last message have the same package name
Not what I meant
Can you explain it to me? Do you mean in the pom.xml
Create separated maven/gradle modules for each version, or use reflection
Oh, that works?
What is 'that'?
Thanks for your help i will try to do that with sperated maven modules
Np
I've never done this before, can you explain how it works? Unless it's too complicated then I'll have to figure it out myself
Having some trouble understanding something regarding custom Events.. So when you want to have a class call that event, do you have to instantiate a new Event every time or can the same Event object be re-used?
CustomEvent customEvent = new CustomEvent(); //can be re-used?
Bukkit.getPluginManager().callEvent(customEvent); //event call
Bukkit.getPlayer("bitcash").sendMessage(customEvent.getData()); //what is the legality of this?
Additionally, for line 3 in the code above, how exactly is that code legal? a Listener was never initialized to listen for this event, so how am I able to use this event to gather data?
Alternatively, is there even a need to initialize this event? What stops me from just doing this
Bukkit.getPluginManager().callEvent(new CustomEvent());
when you call the event bukkit uses the object you provided and other plugins edit that object with their listeners
so yes you need to use the same instance
it is totally okay and you can use it but you must be aware, any changes made to that object will not change anything
for example if your event implements cancellable you need to use first example you sent
but of course, do not use the same event instance everytime you use callEvent, you need to use a new one
Hi
That make sense, though what changes do Listeners actually make to an Event object?
I am currently having a problem adding a command in one of my menus using DeluxeMenus, I know it is probably something silly, but could someone help me, I think it is because it is a very long command because it is a written book that the user receives when clicking on a button in the menu.
nothing stops you from doing this
you seem a bit confused on how OOP works
class MyEvent ... {
private int myInt = 0;
public MyEvent(int otherInt) {
myInt = otherInt;
}
public int squaredInt() {
return myInt * myInt;
}
}
If you call the event, ex.:
Bukkit.getPluginManager().callEvent(new MyEvent(1));
then all the listeners will get this object instance, with myInt equal to 1.
so if I have a listener
@EventHandler
public void iNeedAnInt(MyEvent event) {
System.out.println(event.squaredInt()); // 1
}
of course, the listeners can also modify the object instance, its fields, whatever.
But generally you create a new instance of the event each time you call the event
If anyone could help with this: https://www.spigotmc.org/threads/making-client-register-fake-commands.597794/
If you have any ideas please @ me
modify the packet lol
i would assume https://wiki.vg/Protocol#Commands
so ClientboundCommandsPacket or PacketPlayOutCommands
danke!
depending on if your using remapped or not
Hey...So I have a problem now, I am adding a player as passenger to an armor stand. So the problem is as soon as I add the passenger, I am being removed from the armorstand as a passenger (atleast visually, because when I restart the server, I am sitting above the armorstand). Have anyone faced this issue prior? or have the solution for it...
The server is 1.12.2 btw
The return of addPassenger also returns true
https://i.gyazo.com/b88ab7a30b6808fa12cf36c2522543e5.mp4
This is how it seems...
That's weird, looked like something kicks you from the armorstand. Maybe another plugin that is removing you from it? Or maybe you do accidently doing something weird in your code? This works for me:
event.getEntity().addPassenger(event.getDamager());
}```
You also can do this for a EntityInteractEvent afcourse, code is writen in 1.19. But in 1.12 you are using getEntity().setPassenger() I think instead of addPassenger(). Maybe there is a 'Entity remove passenger' package or something you can intercept and then check who or what causes that package. Or disable all the other plugins you are using one by one and check again and again. To check if one of the other plugins causes this.
Yeah, let me try with setPassenger (tho its deprecated). But the fact it still sets you as a passenger even after the server restarts still puts me that its somekind of visual glitch or so...
Ohh if it's deprecated you need to indeed use addPassenger. And else try to remove all the plugins, make a new plugin with only the entityInteract or Damage event inside it and the code to sit on the armorstand. Then you can get maybe a idea where it's coming from.
yeah...will do..
How long does it take for my IntellIJ project to view updates in my .m2 directory?
I deleted a repository there 5 minutes ago and it still sees it, though I tried reloading the project from the disk and invalidating caches/restarting
Ofc reimported maven dependencies too
What would be a lightweight framework for a simple http server? I need it for a plugin and it will be a callback for Discord's OAuth2
Edit: I will try the build-in HttpServer
int port = 8080;
public int getPort() {
return port;
}
public void setPort(int port) {
this.port = port;
}
private ServerSocket server;
public ServerSocket getServer() {
if(server != null)
return server;
try {
server = new ServerSocket(port);
} catch (IOException e) {
e.printStackTrace();
}
return server;
}
@Override
public void run() {
for(;;) {
try {
Socket incoming = getServer().accept();
//TODO RateLimit
Thread connection = new Thread(new Handler(incoming));
connection.run();
if(isStopped.get() || inputThread.isInterrupted())
getServer().close();
} catch(IOException e) {
e.printStackTrace();
}
}
}
No thank you 
"simple http server"
💀
Curious what you think is the problem with it though?
for(;;) ðŸ˜
Constant loop in its own thread... Whats the issue?
not a real issue but i dont like seeing for(;;) instead over while(true)
If i did while I would have to add a sleep
huh why?
IDK Just would feel like it wouldn't receive connections. IDK if its since been fixed.
afaik there shouldnt be any difference between using for(;;) and while(true)
they both just loop foreva
Ill switch it if I ever use that server again lol
😌
Actually I think I have the same code in my server software so Ill test it there
that is, specifically, the lack of framework, lol
also connection.run will not spin a new thread, Thread#start does
Its the method in my handler class
no.. you're calling it on the Thread class
that will not create a new thread, Thread#start does
stinky
you smell (good?)
Thread runs the run method of the runnable handler is a runnble
yes, but no new thread is ever created to run the handler
it will run synchronously
Yeah I see what you meant (hence why I said "ah yeap")
Question
I made a common library which my Bungeecord plugin(s) and Paper plugin(s) will depend on.
I want to make sure this library is compiled alongside the rest of the plugin. How do I do that?
I was looking at how triumphcmd does it, but to me it looks like they just omit <scope>provided</scope>. Is it that simple?
<scope>provided</scope> is basically the compileOnly function from gradle
which means the dependency isnt included in the plugin file and it obtained elsewhere
What you want is scope compile and to use the maven shading plugin or whatever it is called
So I just add this: https://paste.helpch.at/ciyuvuhoti.xml to the pom.xml of my bungeecord plugin?
And then write <scope>compile</scope> in the dependency section?
Looks like it worked so I suppose that's the case
I believe so. If you look under <execution>, you've set the phase as package so the plugin will execute whenever the package task is executed
Is it bad practice to have a method in my plugin's main class like this one?
public static KlyNetCore getInstance() {
return getPlugin(KlyNetCore.class);
}```
So that my other plugins which depend on it, can get access to instances of classes present in KlyNetCore?
I use dependency injection everywhere within the project, but outside of it I was thinking of getting the instance with that method
No, but you should probs generate an instance. IDK how your getPlugin(<>) method works.
ex;
public class <Main> extends JavaPlugin {
private static <Main> instance;
public void onEnable() {
instance = this;
}
public static <Main> getInstance() {
return instance;
}
}
It's a built-in method within JavaPlugin
If it's meant for other plugins, then I can recommend the ServiceManager.
wha
Here's an old but still great post about it https://bukkit.org/threads/services-api-intro.26998/
What is bad about doing this though?
Or what's better about the service manager?
I didn't say the other way is bad but ServiceManager is nice because it lets you split the api from the rest of the plugin
Fair enough
it’s bad but it’s also unlikely to cause any real problems
But yeah like blitz said, for internal use you should really use DI and for external use the services manager
anyone know how to fix 84 out of bounds for length 5
lmao what
you dont try to get the object thats at index 84 while the array or list or whatever has only 5 objects inside of it
what do u mean object
well id assume its either an array or list
Full error + code
thers no errors in console
it usually only happens when there are 1+ members in the server
screen shot
then where did you pull the error from?
I have a few questions regarding this. Why is your class name in brackets, why do you create a new one in the enable and why do you do static abuse
then open your client logs and post the error from there
i sent it to u in dms
just post the error to mclo.gs and the code to paste.helpch.at
Brackets because I didn't name it.
And its not static abuse.
you did write some code that your trying to diagnose right?
Why can't you use this?
or any form of development
Do what luna said. Go to your mc logs and send the full error
And what's the point of having 2 instances of your main class
Thinking of something else sorry. Updated.
I know what you were thinking of
by that response im going to redirect you to either #general-plugins if its a plugin error with a plugin you dont have control over or #minecraft if its anything else cus it seems you arent diagnosing anything you are developing
And my question persists lol
How is this dude working on "folia support" when the src code for folia isn't even available yet?
Magic
your main class should be a singleton class, never being reinstanced ever
Yup
And if you use this, it will change a static constant from a non static context which imo is static abuse
atleast the plugin errors every time you try to create a second instance of the main class
Since static should be available at any time
Maybe I worded it wrong. I variablize the instance, privatized it so it won't be altered (Shouldn't be aleast) and use a public getter.
It allows you to use <Main>.getInstance() when ever you need access to said instance.
the only static abusey thing that i do is main class get instance using the method that yappery changed it to, using a getter so you cant modify the variable
I can understand if people have like a shit ton of methods/fields and they used static on all would be considered abuse but I generally limited my static usage to a few methods per class, sometimes none.
tbh im on the edge for main class instance getter being static abuse or not
the only methods i usually make static are ones that only depend on the content inside of them
such as util classes
or a bunch of the item nbt related classes i use to modify itemstacks
same basically
The API is already testable
Link?
🤣 I was asking myself the same question
Not sure if it's publicly announced yet, but if you click the commit you can see it

Well yeah you can see the commit, but I didn't publish what you need to compile it 😛
Glare. Are you/we going to maintain a folia fork for PAPI?
I'm trying to make it so we don't need a fork at all.
I have expansion disk loading + downloading from eCloud working + parsing.
I had to disable calling the expansion register event for the time being.
IDK I just saw the post in #papi-updates
I assume you're getting the api from Maven Local. I know you have relations at Paper
Correct
Has anyone used HttpServer and HttpExchange before 
We also have a problem with expansions that register their own tasks. Haven't figured out how we'll handle that yet.
No Gaby. No one has ever used those. Ever!
But we have progress.
bytecode manipulation
I want to get the query params and the moment I use exchange.getRequestURI().getRawQuery() and the request doesn't have any params it literally doesn't go past that method
emily. I do not recognise you. please bring back the eye
I mean a really easy solution is to make an interface and a bukkit / folia module for a couple of things and then we could add a new variable for expansions like "supportsFolia" true/false and register them in those ways.
But I'm trying to see if we can get around doing that for the time being.
yeah but you can't really prevent all expansions from using this or that feature that won't work on folia
Well then they won't have their expansion working on Folia.
That's their problem 😛
true
I can't seem to find where the API is posted. I see dev.folia:folia-api:1.19.4-R0.1-SNAPSHOT from your commit but can't find it on any of the repos listed.
installed locally
That would do it lol
.
of course emily is faster
Luck also used folia api IIRC recently
I was wondering cause I asked either today or yesterday in papers discord if it was opened or if it was just the server for testing and was told the server.
yeah. glare got connections. he's the cool kid
I'm trying to get my Bungeecord plugin and my Paper plugin to communicate.
My Bungeecord plugin succesfully gets data across to my paper plugin, however for some reason it struggles to retrieve data sent by my paper plugin.
I register the channel in the onEnable() of my Bungeecord plugin like such getProxy().registerChannel(KlyCommon.PLAYER_DATA_CHANNEL);
And wait for incoming messages like such:
@EventHandler
public void onPluginMessage(PluginMessageEvent event) {
if (event.getTag().equals(KlyCommon.PLAYER_DATA_CHANNEL)) {
String playerDataJson = new String(event.getData());
System.out.println("Received player data from KlyNetCore: " + playerDataJson);
Gson gson = new Gson();
PlayerData playerData = gson.fromJson(playerDataJson, PlayerData.class);
System.out.println(plugin.getDbManager().getPlayerManager().updateData(playerData));
}
}```
And lastly, this is how I send the data from my paper plugin to the bungeecord plugin:
```java
public static void sendPlayerData(KlyNetCore plugin, Player player, PlayerData playerData) {
Bukkit.getScheduler().runTaskAsynchronously(plugin, () -> {
Gson gson = new Gson();
String playerDataJson = gson.toJson(playerData);
System.out.println("Sending player data to KlyVault: " + playerDataJson);
player.sendPluginMessage(plugin, KlyCommon.PLAYER_DATA_CHANNEL, playerDataJson.getBytes());
});
}```
In my paper plugin's `onEnable()`, i register both the incoming and outgoing channels:
` getServer().getMessenger().registerOutgoingPluginChannel(this, KlyCommon.PLAYER_DATA_CHANNEL);`
` getServer().getMessenger().registerIncomingPluginChannel(this, KlyCommon.PLAYER_DATA_CHANNEL, new KlyVaultBridger(this));`
For some reason though, my Bungeecord plugin doesn't receive the plugin messages sent by the Paper plugin.
have you tried printing something if the tag is not KlyCommon.PLAYER_DATA_CHANNEL
Have you debugged it? Is the channel actually registered?
yeah, I know I can do this in the OOP paradigm. I just mean whats the purpose of storing the object at all if every event call should be using a new one
To my understanding, listeners receive the Event Object that you pass in while calling callEvent(Event object)
yeah i have
ill try rn
Although, bear in mind my understanding of cancelling events is near zero. I'm primarily just trying to understand the base architecture of Events rn
[21:02:08 INFO]: [/82.9.38.18:61252] <-> InitialHandler has connected
[21:02:08 INFO]: [Klyser8|/82.9.38.18:61252] <-> ServerConnector [lobby] has connected
[21:02:09 INFO]: Received unknown plugin message from net.md_5.bungee.ServerConnection@6ad4df44: minecraft:register
[21:02:09 INFO]: Received unknown plugin message from net.md_5.bungee.ServerConnection@6ad4df44: minecraft:brand
[21:02:09 INFO] [KlyVault]: Loaded player data for 4f72a333-cff6-39ff-a08a-d3b8f10b017e (Klyser8)
[21:02:10 INFO]: Received unknown plugin message from Klyser8: minecraft:brand
[21:02:15 INFO]: [/82.9.38.18:61252|Klyser8] -> UpstreamBridge has disconnected
[21:02:16 INFO]: [/82.9.38.18:61252|Klyser8] <-> DownstreamBridge <-> [lobby] has disconnected
[21:02:16 INFO] [KlyVault]: Saved player data for 4f72a333-cff6-39ff-a08a-d3b8f10b017e (Klyser8)
[21:02:17 INFO]: [/82.9.38.18:61275] <-> InitialHandler has pinged
Not much pops up
It's supposed to send the message when the player disconnects
I suppose that means the issue is with me sending the message to my bungee plugin?
PluginMessaging requires a player so if you use it on PlayerQuitEvent or similar I don't think it will work.
Player isn't null though
try debugging in another event
I'll try PlayerDropEvent
Alright now I am getting a strange error?
Though you are right, I can't use the PlayerQuitEvent
I need the data to be sent when the player quits the server though
I'm pretty sure the PlayerQuitEvent is called 1 tick after the player actually leaves but the Player object is still valid for that tick or something like that.
I suppose that I can't use the PlayerQuitEvent for this though since it's the only event that has issues with this
Do you need to send some data from spigot that needs saving or something? Or are you just triggering an event on bungeecord that doesn't require anything from spigot?
I am sending the player data from my paper plugin to the Bungee plugin, so that it can be saved to my database
Basically, my Bungeecord plugin holds player data and passes it around to all the other backend servers based on which server the player is connected to
yeah that makes sense. I assume you also send it on a timer?
And any time they change servers, the data is removed from the player's old server, moved to the bungee plugin, saved to the database, and then sent to the new server
oh nvm then. my idea won't work for this
I haven't implemented that yet, but yeah every 5 minutes it will do that
As an auto-save mechanism
I guess I need to find an alternative to saving the player's data when they quit the server?
I realised as you were typing the other message that you probably need the data on another spigot server if they change servers. I think the best you'll be able to do is maybe save and read directly in spigot
So pass the player data between different instances of my plugin..?
That doesn't sound right
you could also send message using sockets. that's another option. I can't tell you which one is best tho
No way this could be a bug with paper/spigot/bukkit right
don't think it is considered a bug
I believe messages are sent using the player connection and bcz the player has already disconected when PlayerQuitEvent is called, the connection is closed
Isn't there a way to send the message without a player connection
sockets
Well it depends on your implementation and how you want it to work.
It's just the way the listener system works (to my understanding). You call the event when X happens, and other listeners can modify the outcome of it and then the object is discarded.
If im not mistaken, you can keep the object and keep the way it was modified as long as you keep a reference to it, ex. as a field in your plugin class? Correct me if I'm wrong.
So I need to host a small web server, with a GET endpoint and return some html (ideally using a template engine or smth, because I need to change a line of text). I've tried com.sun HttpServer but I don't like it very much 😬
Because it is for a plugin
Yeah I know about spark but I need to return some html code 😬
Thinking about it, I just need to return the html code, I can use a placeholder at text and replace it before sending
I agree
Undertow maybe
public class Application {
public static void main(String[] args) {
Undertow server = Undertow.builder()
// Set up the listener - you can change the port/host here
// 0.0.0.0 means "listen on ALL available addresses"
.addHttpListener(8080, "0.0.0.0")
.setHandler(exchange -> {
// Sets the return Content-Type to text/html
exchange.getResponseHeaders()
.put(Headers.CONTENT_TYPE, "text/html");
// Returns a hard-coded HTML document
exchange.getResponseSender()
.send("<html>" +
"<body>" +
"<h1>Hello, world!</h1>" +
"</body>" +
"</html>");
}).build();
// Boot the web server
server.start();
}
} ```
Seems to be pretty simple to use and probably would be enough for what you need
Yeah so is spark
Didn't even know spark can send html file as a response lol
I just use it for json data
On google it says you can do that xd lets see
when running a BukkitRunnable, what is the Plugin instance I should be passing
Should I just be making a new instance of my plugins main class (extending JavaPlugin)?
No
you should be passing the one (1) instance of your main class extending JavaPlugin
Yeah, I figured this eventually. I had it fixed to do that, thanks
any reason why this is considered dead code?
@Override
public boolean onCommand(CommandSender sender, Command command, String label, String[] args) {
BukkitTask task = null;
if (args.length == 2) {
long initialDelay = Long.parseLong(args[0]);
long spawnDelay = Long.parseLong(args[1]);
task = new WitherSpawnTimed(this.plugin).runTaskTimer(this.plugin, initialDelay, spawnDelay);
return true;
}
// begin dead code
if (args.length == 1 && args[0].equals("stop") && task != null) {
task.cancel();
return true;
}
// end
return false;
}
I nested the second conditional block into the first one and that fixed it.. starting to suspect the reason
The {} means that there is a new scope
this means that variables inside of {} can only be accessed inside of those {}
This also means that every time the } is reached, all variables in the {} are reset (since they can no longer be accessed)
So, your task is being reset every time the command is being ran, and so it'd always be null, so the check task != null always fails
for example, you can't access spawnDelay outside of the if statement
Wait really? So even though BukkitTask task exists outside the scope of the conditional block, its re-assigned value gets reset once the scope in which the re-assignment took place is left?
yes; for example: ```java
@Override
public boolean onCommand(CommandSender sender, Command command, String label, String[] args) {
int amount = 0;
System.out.println("Amount: " + amount);
amount++;
}
it's the same scope, but once onCommand is finished running, all the data inside of the scope resets
I suppose my problem is the unguaranteed flow of execution then, where since it isn't guaranteed that the first if block will ever have its conditions passed
the second block could actually be rendered dead code
well no matter what, task.cancel() will never be called
and you shouldn't be returning false (?)
as it uses some bukkit error command thing
prob better to just make your own error handling
at least that's just what i heard
Oh wait its because of the return statement.. now I see what you're saying
if the first block is met, the method is being returned thus it really is dead code
alr noted, thanks ^
task never gets assigned to not null
since the only time when you assign it, you return true
i might've been a little late lol
I guess it still is dead code in hindsight because every command execution is a new method call regardless
what would you recommend be the best way to create a command to cancel task?
Guess I could just make a nested class implementing CommandExecutor for it..
though that still entails an entirely new Command, not an arg of the existing one
Well you just need to store or the task outside of the method somewhere
wait till you find out about fields 
I'm an American, I know all about fields
does anyone knows how i can create a placeholder like this example_one_<player> (example_one_creperozelot) <- and get the player (creperozelot)
Do sockets kinda work as a replacement to plugin messaging channels?
Yeah honestly the issue is that I am really struggling to understand how to even set sockets up
I need multiple instances of this plugin of mine to communicate with this one Bungeecord plugin
Which makes me think that each instance needs its own port?
I might honestly just find another way to save player data when they change servers instead of trying to figure sockets out
Will I need a different port for each instance of my plugin?
There must be a way to send player data through plugin messaging once the player quits
You might consider something like Redis or RabbitMQ, share a Single instance between all the servers = 1 port
I am already biting off more than I can chew with this project i've been working on, if I add another layer of complication I will get burnt out
it’s that or plugin messages really ¯_(ツ)_/¯
Yeah
but it is quite literally impossible to use PMs if there aren’t any players connected
So, I'm trying to replicate this header with the blurry background and the logo in middle but I can't figure out how to stack the elements properly 😠https://imgur.com/a/Zfe12Ws
<header class="header">
<div class="headerBackground"></div>
<img src="https://dunb17ur4ymx4.cloudfront.net/webstore/logos/69fe5d557019d0760290f117521adc73dae0ec0e.png" width="225rem" height="225rem" alt="aaa"/>
</header>```
```css
* {
padding: 0;
margin: 0;
}
.header {
overflow: hidden;
height: 16.5rem;
border: 3px dotted red;
}
.headerBackground {
background: url("https://i.ibb.co/YhkDvG5/2023-01-29-18-38-13.png") center;
}```
So no matter the workaround, the last player connected to the server would never have their data saved to my database
Ffs
Could always make your own bungee fork and remove the need of the player 🤷 lol
yeah lol
Plugin messages inherently rely on using the player’s connection
No players = no connection
Redis is very nice and easy to use
Jesus it actually looks like the most realistic way of doing this is using sockets
If it’s a database why not just connect to it directly? Why the extra layer of indirection?
I have all my paper servers send data to my Bungeecord plugin, which then stores it to the database
that doesn’t actually answer my question
What indirection then
why not just communicate with the database directly
what benefit does the bungee plugin bring
I need the player data to be synced between paper servers, so the bungee plugin works as some form of bridge to pass the player data between the paper servers
uhh
Time to mention Kafka
.center {
position: absolute;
top: 50%;
left: 50%;
transform: translate(-50%, -50%);
}
```?
or use flex and justify-content
- Player connects to the network
- Bungee plugin retrieves their data from the DB
- Bungee plugin sends the data to a Paper plugin found in the server the player is connected to
then
- Player changes servers
- Player data is sent over to the bungeecord plugin, and removed from the paper plugin
- Bungee plugin sends the data to that same plugin found in the new server the player is connected to
That's kinda what I got^
Because I can see a few flaws in this approach:
- having every individual server/plugin communicate with the db directly should probably be fine, just keep the cache on a short expiry time. You could always automatically purge the cache in some cases like when a player joins / leaves
- sure you need the data synced, but if there are no players online, who’s gonna notice if it’s not immediately updated?
Just rent a pc to have an alt connected 24/7 ez
centering the image is the last problem, the background is not showing at all
Yeah I don’t really like that, just have each plugin query the database directly
Yeah I know I could connect to the DB with each plugin, but I wanted to keep all the DB stuff to just the Bungeecord plugin as it's quite neat
you would need 1 for each server xD
It technically is more efficient
I also don’t think that’s gonna scale well, you’re passing potentially a lot of database traffic through the proxy
Hell yeah!
I’m not sure it is
are you sure those two elements are separate?
I mean I am only accessing the DB when a player disconnects/connects
databases are designed for high throughput and lots of queries, bungeecord is not
And every 5 minutes
on the first image? Yeah, they are
you could make thousands of queries / minute to a SQL database and it wouldn’t break a sweat
You think Bungeecord wouldn't be able to handle multiple plugins sending back and forth serialized PlayerData objects on the long run?
The server would struggle though won't it?
Just use Redis if you don't want to query the db directly
I wouldn’t like to say anything concrete but it seems like unnecessary stress, is all
Not sure how magical doing the queries async is
it is the "same" (pub-sub) as using PMs but 10 times better and you don't need to send the message to bungee and then to the other servers
Not at all? Plugin messages take a non-negligible amount of time too, If you’re doing the queries async there’s no difference
@dense drift you need to have the background on the header element
that div headerBackground does absolutely nothing
ðŸ˜
Plus you can keep caches individually on each server to reduce the amount of queries
Idk I just liked the idea of having the database management be on the bungeecord side of things, while the temporary data stored within the backend servers
So not removing the player data upon one quitting?
yeah well @wheat carbon the problem is, the logo will be blurry if I make the background blurry
that would be a good idea if it wasn’t bungeecord, you could always make a separate app to encapsulate all the database calls but as you’re seeing, bungee is quite limited for stuff like this
web dev continues to be the worst things conceived
i will take every opportunity to shit on web dev
Sad
You probably would purge the cache when a player leaves, so then when they rejoin it updates with the possibly changed data
Yeahh
So any time a player changes the server, store the data to the database and then have the other server retrieves it?
Sure, or just whenever the data changes in general
I hate anything related to UIs but I can't ignore them any longer 😠a website is needed 100% of times if you want to make any type of 'business' for example
You don’t really need to be stingy about it
Like I said, databases are designed for lots of queries
They can handle it
@dense drift ok so you have your header element with the background
fully convinced creating a website on word and pasting a photo of it onto a website is more enjoyable
I remember being taught that I should limit how many times I access the DB to avoid slowdowns
then you have another div that contains all the content (the image), which also takes up 100% of the header space
on that second div, use backdrop-filter: blur(whatever)
mhm
having said that, i'm surprised Waterfall doesn't have some built-in system to make Paper backend servers and Bungeecord communicate through sockets
div<header> <!--background here-->
div<headercontent> <!--backdrop filter here-->
image
/div
/div```
like that
ahhh so obvious
It’s true that the queries will actually take a non-negligible amount of time, but most of that is networking overhead. The actual database part will take a couple milliseconds at most usually. The limiting / caching is more for the client’s benefit than anything else
Could be cool but sockets are kinda the worst way of doing it because of the O(n) ports problem
Haven't tested but something like this could? work?
<head>
<style>
.my-header {
position: relative;
background-image: url("your-bg-img.jpg");
background-size: cover;
background-position: center;
}
.my-header img {
position: absolute;
top: 50%;
left: 50%;
transform: translate(-50%, -50%);
}
</style>
</head>
<body>
<header class="my-header">
<img width="50px" height="50px" src="your-img.jpg" alt="Site Logo"/>
</header>
</body>
@tight junco i kinda like web dev in a sadistic way tho
looking good :3
that with backdrop or m0dii's?
backdrop
that is actually the most masochistic thing i've read all day
I just need to center the image on both axes now
but to be fair if you actually know how to do it and can do it well it probably isnt that bad
but i physically do not have the mental stamina and will power to put effort into learning it
.header {
overflow: hidden;
height: 16.5rem;
background: url("https://i.ibb.co/YhkDvG5/2023-01-29-18-38-13.png") center;
}
.logo {
display: flex;
justify-content: center;
backdrop-filter: blur(5px);
height: inherit;
}```
i can usually make anything with html and css
Not sure what you mean with network overhead tbh, but now i'm wondering:
if I have my servers auto-save every 5 minutes, and there is say (won't ever happen, just out of curiosity) 200 people, won't the server suffer a major slowdown when 200 queries saving the data of each player is sent to the DB?
it's not always pretty on the back end
but i can usually make anything so that's nice
honestly web dev for pc is fine, not really mentally straining, making things responsive is where the issues in web dev come in
I always view the page in full width/height and I love when I use absolute positioning and resize the window and everything crumbles like a word document
Probably something like 80-90% of the time it takes to query a database and get a response is the IO and internet communication, once the database actually gets the query it’s pretty fast
If you’re doing it asynchronously I doubt it will ever make a noticeable difference, plus you can update all the data in a single query
Just by repeating the query separated by a ; 200 times?
the problem comes in when you open multiple database connections every few seconds until you literally reach the max
ive done that before
And then sending the query?
Ah shit
That doesn't sound good
i think the default is kinda low
connections 💀
this is quite a popular topic at my job
JOOQ is weird
hold please let me find what i did
isnt' the default only like 10
nonono
No I mean literally a single query, you can do batch updates/inserts
wait no I'm mixing up the timeout defaults
i mean i opened several thousands
the timeout defaults were always too low for me
Connection pools fix that
Okay jesus chrsit lol
it was deranged
What are you ever doing to need that many concurrent connections
Yeah i was opening connections at a rate of 3600/hour
Rip this sucks, I spent the past few days making this whole Bungeecord<-->Paper system to avoid having any DB stuff in my paper plugins
logging database actions to the database
And never closing them??
yeah sorry to be the bearer of bad news but that was probably a waste of time lol
well you see i wanted to obtain the amount of money someone had from sql
At least it was supposedly a good idea if Bungeecord was designed for that
In theory
so the error that crashed the server every day was HikariPool-1 - Connection is not available, request timed out after 30001ms. which is great
but for every person on the server, which at the time was about 60 i would basically just do
try (Connection connection HikariDataSource#getConnection()) {
select user and check for a bank interest rate
}
and that ran every 3 minutes, ontop of scoreboard updates, actual bank balance checking etc
like none of it was cached just pure sql statements
it was 2 years ago, i have grown and changed as a person
so yes at least 3600 connections that never closed, opened every hour 
hire me
not that
my initial thought is to just cache stuff in a map 
only run queries when anything actually needs updating
pretty much
only time you really need to get data from the database is on server start, or depending on the amount of data, perhaps when a player joins
the problem was I took a job at a server where I was completely out of my depth on
like had only just started learning how to use MySQL like maybe a month or two prior
that's ok
they hired an unqualified dev
seems like a them problem if ur code aint up to scratch
to be honest if i didnt do that job for as long as i did, i would probably suck a lot more at my current stage
is there any reason why display: flex; justify-content: center; centers the content of the white rectangle, and not itself? (the options are current commented out) https://paste.helpch.at/apemuvutas.xml
yes, you have to justify content of the parent iirc
ffs, justify-content 
thanks for pointing out the obvious, M0dii 
the positioning, widths, heights of html/css is very weird
I hate it because it was so obvious
you'd think i'd take up the entire page
what editor is that
notepad++
h0h
well since the parent of the .mydiv is body
by default body takes up the height of the child elements
and .mydiv 100% means to take up 100% of the height of the body
hence you should use 100dvh or 100vh
ah yeah, I forgot about the body part
I learnt this the hard way
debugging for hours lol
and then boom
bootstrap
fuck styling on my own
you don't need to use vh for this
html is also a tag, you just need to set html height to 100%
html, body {
height: 100%
}```
I guess that's true indeed
Hey
but you should'nt really apply styling to your html tag
One question, does anyone know how to delete the stats from the statistics extension?
why?
it's pretty standard practice for this
nearly any website you go to will have a variation of height styling on the html tag
Well this way the browser forces the body to be the height of the window, not the height of the content.
Body should be min-height: 100vh
Tldr it fuckswith responsive designs
thanks ij
Som1 know why its not working ? Its supposed to drop spawner with the pdc of the spawner gave with the /bspawner
Bspawner :
https://paste.md-5.net/ukajofeyim.java
Spawner :
https://paste.md-5.net/koxubuzici.java
it should work i havent error
How do I get the text from a Component? Component name = item.customName();
TextComponent has content() or something like that
Ahh yeah my bad
I'm trying to give my Item entity a custom name, by appending differently colored digits.
Each digit is a separate color, based on the array written at the start of the method: https://paste.helpch.at/awisidogas.csharp
For some reason though, when printing the item.customName()'s contents It just shows -[ and nothing else
However, when printing the object itself, it shows that the right data is present:
[23:18:01 INFO]: [Klynes] [STDOUT] FINAL NAME: TextComponentImpl{content="-[", style=StyleImpl{obfuscated=not_set, bold=not_set, strikethrough=not_set, underlined=not_set, italic=not_set, color=null, clickEvent=null, hoverEvent=null, insertion=null, font=null}, children=[TextComponentImpl{content="8", style=StyleImpl{obfuscated=not_set, bold=not_set, strikethrough=not_set, underlined=not_set, italic=not_set, color=TextColorImpl{value="#ffccf3"}, clickEvent=null, hoverEvent=null, insertion=null, font=null}, children=[]}, TextComponentImpl{content="5", style=StyleImpl{obfuscated=not_set, bold=not_set, strikethrough=not_set, underlined=not_set, italic=not_set, color=TextColorImpl{value="#f1a1ff"}, clickEvent=null, hoverEvent=null, insertion=null, font=null}, children=[]}, TextComponentImpl{content="3", style=StyleImpl{obfuscated=not_set, bold=not_set, strikethrough=not_set, underlined=not_set, italic=not_set, color=TextColorImpl{value="#d07fff"}, clickEvent=null, hoverEvent=null, insertion=null, font=null}, children=[]}, TextComponentImpl{content="4", style=StyleImpl{obfuscated=not_set, bold=not_set, strikethrough=not_set, underlined=not_set, italic=not_set, color=TextColorImpl{value="#bd5cff"}, clickEvent=null, hoverEvent=null, insertion=null, font=null}, children=[]}, TextComponentImpl{content="]-", style=StyleImpl{obfuscated=not_set, bold=not_set, strikethrough=not_set, underlined=not_set, italic=not_set, color=null, clickEvent=null, hoverEvent=null, insertion=null, font=null}, children=[]}]}```
everything after -[ is a child of the component
TextComponent name = (TextComponent) item.customName();
TextComponent completeName = name;
for (Component component : name.children()) {
completeName = completeName.append(component);
}``` I did this instead ops
Use plain text serializer or smt like that
How do I use that though
Component#join accepts a JoinConfiguration and an Iterable<Component>
so you add the components in a list, and then use Component#join
that's just an idea, idk if it is the proper way of achieving what you want
TextComponent completeName = (TextComponent) Component.join(JoinConfiguration.separator(Component.empty()), name); like that?
no
https://javadoc.io/doc/net.kyori/adventure-api/latest/net/kyori/adventure/text/JoinConfiguration.Builder.html you can actually use this class and give it the -[ prefix and ]- suffix.
After that, turn each character into a component and add them to a list, then join all components
I am so confused
Why is it so inconvenient to create a text component one character at a time
for (char c : klynesString.toCharArray()) {
TextComponent charComponent = Component.text(String.valueOf(c));
charComponent = charComponent.color(colors[colorIndex % colors.length]);
System.out.println("Current char: " + charComponent);
name = name.append(charComponent);
System.out.println("Current name: " + name.content());
colorIndex++;
}```
Here, instead of using name.append(), you add the `charComponent` into a list
and btw, you can do `text("text", color)` or `text().color()`
actually why is it 1 component and a list of children components and not just a list of components?
And then append the list..?
and then join all components in that list with Component.join(configuration, list)
And that will do so that .content() prints the whole thing instead..?
That's really weird
I don't remember having issues like this tbh
why
"-[" {
"8","5","3","4","]-"
}
and not
{ "-{","8","5","3","4","]-" }
thats what i want to know
but it might be something to do with how names are rendered
honestly this is so weird I'll just do what I wanted to do differently ðŸ«
Hello, i need to do a shop of tags, but i cant do it, Can you help me?
Sorry if i doesnt have a good english, i am from argentina
Heloooooo
hi
Hmm I noticed something weird in my Bungeecord backend servers
For some reason, when a player quits the server, at times it takes several seconds for them to actually disconnect from it even though they actually aren't online
What is this error even
[01:51:19 ERROR]: [KlyNetCore] An error occurred while updating player data/settings: Data truncation: Incorrect datetime value: '2023-03-26 01:51:19' for column 'last_seen' at row 1
Timestamp currentTime = DBUtils.getCurrentTimestampWithoutMilliseconds();
public static Timestamp getCurrentTimestampWithoutMilliseconds() {
long time = System.currentTimeMillis();
long timeWithoutMillis = (time / 1000) * 1000;
return new Timestamp(timeWithoutMillis);
}```
Why doesn't my database like the datetime values i give it all of a sudden
I never had issues with it until now?
No way daylight savings could have an impact right?
It probably does
For real?
yes
Sheesh
fucked by the farmers all over again 
So most databases have issues with daylight savings?
mayhaps
That's crazy
most people use Date for it
im about to have my A key on copy and paste or else ima go fucking feral
Yeah, I want to keep track of the time too though :x
Ahh shit
My database is in another country which is one hour ahead
So it's daylight savings already there while it isn't where I am
That's probably what's up
then save the time as a long
instead of as a date string
or as your database's native datetime type
😔
everything
So, you know how the issue with "physical" currencies is that they can be duplicated in Minecraft server
My currency is supposed to be found physically but can then be right clicked to be "claimed"
In order to prevent any possible duplication glitches though, I was thinking of having each instance of this custom item have a UUID metadata
And when the player uses said item, the UUID of that item gets saved on a database
That way, even if they manage to duplicate it they won't be able to use the item
Could it become problematic when there is maybe 1000 UUIDs on the database?
nah, as long as you have an index on the UUID column
could even have a cache that keeps the UUIDs as a set, O(1) lookup easy
and you obviously won't run out of UUIDs lol
There is an absurdly small chance of a duplicate being a thing
But the consequences would be minor + it's pretty much impossible
So this command effectively executes a BukkitRunnable (WitherSpawnTimed) and has the option for accepting extended arguments specifying the specific coords of where the mobs should spawn, however its not working, instead it spawns at w.getSpawnLocation() regardless of args. If anyone has the chance to browse through the code and potentially see whats causing it not to work that'd be great and would be appreciated.
Does ```
[BitCore] Activated the witherus siberius in xms at an interval of xms
[!] Spawning at location: x, x, x.
Yeah it does send
???
@Command(value = "artifacts", alias = "art")
public class ArtifactCommands extends BaseCommand {```
What even
I've made commands like this for 4 other plugins in the past week, why is this one just randomly not working
public abstract void registerCommand(@NotNull BaseCommand var1); this is literally what the method takes
And that is what I am giving it
Ah nvm, I found the issue. was just careless error, had the expressions reversed
if providesLocation was true then it *wouldn't * use the provided coords lol
🥲
btw didn't want to mention before since it wasn't the issue directly but this has some other issues too - no permission (allows for unlimited spawning of withers that cannot be stopped), providesLocation will never become false again after becoming true, if the user doesn't input valid argument amount then the code will still try to run (no return), if the user inputs invalid arguments then the command will throw an error or do completely nothing, and why isn't providesLocation and coords parameters in the WitherSpawnedTimed constructor?
I assume you'll fix some/most/all of these in the future but just wanted to point them out
Ah yeah those are all good points Ill keep noted to fix
thanks ^
why isnt
providesLocationandcoordsparameters in theWitherSpawnedTimedconstructor?
What would be the reason to do this? Or do you mean making those variables themselves fields of WitherSpawnTimed instead of being static fields belonging to the Command class

DM me if your cool
yes, on right click, give them a shield in offhand
on release, remove
.5 could be too short though
well I'm not sure, you can probably google that yourself
my onRequest method is not working
@junior zenith as a continuation from #general-plugins, set the identifier to lowercase.
This Listener is supposed to get the player's location's block and replace it with a Sign that says "hello, 123", but it doesn't work. Unsure why..
@EventHandler
public void onBlockPlace(BlockPlaceEvent event) {
org.bukkit.block.Sign c = (Sign) event.getPlayer().getLocation().getBlock().getRelative(BlockFace.DOWN).getState();
c.setType(Material.OAK_SIGN);
c.setLine(0,"Hello, 123!");
c.update(true);
}
It did not help
Is the relative block actually a sign
cause you're getting the block right below the players feet
is the wiki right about the pack format being 12 for 1.19.4?
It gives me a warning in-game if I have it at 12 instead of 13
it may not be
probably
Hmm okay cause I can't get them to work
Google >
Does someone know an alternative to this solution here that works with decimal points?
https://paste.helpch.at/ohaqafufov.java
Like I want to shorten numbers (i.e. 10,000 to 10k) but this code only uses longs, so no decimal points allowed...
Would a BigDecimal work here?
Or is a simple replacement of long to float enough here?
Replaced with double and seems to work. Tho, now I need to find a way to get rid of the decimals, or at least reduce them...
The block you get is still air, because the sign hasn’t been placed yet. Cancel the event and it might work
And don’t cast it to a sign
You’ll have to set the block as a sign yourself
Also - you don’t check if the block placed is a sign… so all blocks being placed will turn into a sign
(also you're getting the block below the player, not the block at the player's location)
Uh
There is this sound in Minecraft
minecraft:block.amethyst_block.resonate
For some reason it is not present in the PaperAPI?
I tried playing every single amethyst sound there is and none of them sound like resonate
@somber gale Have a look at this
dog poopoo
> Bard isn’t currently supported in your country. Stay tuned!
Sigh. Google never learns.
By the time they add support for using this in my country, there's no reason for me to use it anymore as competitors have already swept in.
It's the same playbook with every US-only launch:
1. get everybody hyped up
2. make it accessible to only a minor subset of people but advertise it as a "launch" or "open beta" or whatever
3. tell the rest of the world that "lol, by "available" we mean US-only" or "Open means "open for people with US IP addresses only" etc.
4. Wait till competitors have launched global-from-the-start alternatives
5. Open up the service globally
6. ...
7. Shut down the service because there's no uptake (surprised_pikachu.jpg)
Rinse and repeat.
Pattern matching involves testing whether an object has a particular structure, then extracting data from that object if there's a match. You can already do this with Java; however, pattern matching introduces new language enhancements that enable you to conditionally extract data from objects with code that's more concise and robust.
Old code same idea
I used that in a plugin I made 6+ years ago lol
I dont know if this is the right place, but can i host a website and a minecraft server with the same ip?
Yes
ty 
same IP yes
same port no, though that should be obvious, since minecraft usually runs on 25565 and webservers on 80
Actually it's a little harder than that- @river solstice
You cannot have an mc server linked with just an A record and also have a webserver, although, if you only plan on using java, you can use a TCP record to bypass that.
If you want bedrock support, with just your link (example: www.example.com) and a webserver that isn't possible unless your mc server and webserver run on the same server
just use a subdomain

mc.mydomain.com - minecraft server
mydomain.com - webserver
esta bien
I don't think they understand what you're asking
lol
whats the event fired for placing an armor stand?
yeah but I need to get the player who placed it, I will check BlockPlaceEvent
that doesn't always result in an entity spawn tho
is this code going to make potions better ?
@EventHandler
public void onProjectileLaunch(ProjectileLaunchEvent event) {
if (event.getEntityType() == EntityType.SPLASH_POTION && event.getEntity().getShooter() instanceof Player) {
final ThrownPotion potion = (ThrownPotion) event.getEntity();
// Make the splash potion entity async
Bukkit.getScheduler().runTaskAsynchronously(this, () -> {
potion.setTicksLived(1);
});
}
}
}```

idc, I only need to know if you right click with an armor stand 
Well then you should've started with that
@river solstice do you know if spark can run async?
no not that spark
https://sparkjava.com/ this one
Spark Framework - Create web applications in Java rapidly. Spark is a micro web framework that lets you focus on writing your code, not boilerplate code.
ah yea yea
consider another framework? 
yeah 😬
suggestions?
I only need a small web server, and ideally with template engine support, like thymeleaf
I use spark for a Discord OAuth2 callback and I need to return a page with different content depending on the result of the auth
uh i know about javalin, it's pretty nice and simple but idk about the template engine stuff, i barely know what that is lol
https://javalin.io/documentation#views-and-templates
JavalinThymeleaf.init(templateEngine: TemplateEngine?) great

damn what were the chances
https://javalin.io/tutorials/javalin-and-minecraft-servers
lol yeah
do you know if I need com.fasterxml.jackson.core:jackson-databind:2.13.2?
i don't think so, just that jackson is bae
ah great, it is written in kotlin, +2.5mb 
@minor summit have you use Context#async?
1.8mb btw
idk I never used javalin lol
smh
https://javalin.io/documentation#asynchronous-requests here it says it has a ThreadPool, and for each request I make 3 REST calls to the Discord API, I wonder if I could avoid using Context#async() because I have some error 
I assume the question is no longer valid
currently attempting to use https://www.spigotmc.org/threads/how-to-set-blocks-incredibly-fast.476097/
with some small modifications to update it to 1.19.2 from 1.14.x. it does say it would update lighting but it doesnt seem to actually update the lighting and this packet shit is completely out of my depth, so im wondering whats the best places to look to try and get some answers on how to fix this,
my current idea is to get the ClientboundLightUpdatePacketData's List<byte[]> and manually modify them so that they are all 255, basically making every block have a sky light level of 15, but i dont think thats the best option
i know its definitly an issue with the packets im sending cause on relog lighting does fix itself
current code
when i say fixed, i mean the light levels being shown properly to the client
this wasnt an issue when resetting mines, just became an issue when using the same method for breaking blocks
perhaps lighting never actually gets updated
just feels like it does cus the chunks are reloaded due to me relogging
right, ive been trying to figure out why the index into the NibbleArray/DataLayer has been giving me out of bounds errors, turns out i was giving the SectionPos instead of the Section Coordinate relative to the block position
fun
Not sure if that stuff actually works with e.g. starlight
so because of starlight, ive been pissing up a wall this entire time? basically making no progress into fixing lighting problem?
idk, but it might be the reason
welp guess ill die
Classic
Anyone knows how to link website to purchase items and automatically process it inside the server?
youre talking about buycraft?
Buycraft has its own site which is tebex right ? But is there a way to use a custom website to use the features ?
you can buy the tebex premium subscription
it allows you to use your own template and subdomain
other alternative is craftingstore
this one allows you to have your own subdomain for free but without https
You can code your own website that functions like Tebex or Buycraft. You just have a plugin that listens for a signal from the store. Also make sure to use some sort of auth as well so people can't glitch ranks and stuff.
Oh wait, are you saying custom website, that interacts with Tebex/Buycraft?
Hey guys, does anyone have experience working internally with HolographicDisplays? I tried the HD API, but that creates holograms entirely separate from the list available in the /hd list. I am trying to make the hologram I create appear in the list so my plugin users can modify the hologram's content, location, etc. using the HD commands after the fact if they'd like to. Any help would be appreciated, thanks!
Yes, I have worked with holographic displays
I've switched to Decent Holograms immediately
Decent holograms is amazing
so true

e.printStackTrace()
uhm is normal that #setFireTicks(0); is not stopping players from burning...?
for context, they got on fire via fire aspect
Is the player still taking damage?
yeah
skill issue
xd
Are you doing it in a task or just once?
Because it looks like essentials might loop it a few times
What's a good way to save data about players?
Basically, someone runs a command, it needs to log their current location and a way to identify whose location it is (Probably by using their UUID)
I've tried looking into stuff like hashmaps or .yml files but I can't seem to find something that'd work, and there doesn't seem to be many resources on this specific topic either
Well it depends on what you'd be using that data for and exactly what data you intend to save I guess.
It also matters how long you need that data saved. (Over restarts, or only during an active session?)
A Map would work if you don't need persistence in this scenario a simple UUID=Location would probably suffice, but if you do need persistence then storing it in a yml, json, etc... files would be fine, or you could look into sql solutions, but given the information above, that might be a bit much.
yeah like zod says the biggest factor in deciding which to use is what the lifetime for the data is going to be
do you care about the location even after the server restarts?
Saving it after server restarts would be preferable
but would .yml files work for multiple people?
why wouldn't they
data:
uuid-1:
location-x: 1
location-y: 100
location-z: 5.5
uuid-2:
location-x: 100
location-y: 105
location-z: -66
...
Well I don't know whose data needs to be saved until the run the command, so would doing it allow me to add new lines?
Or would there be a better way to go about it?
I'd say this method is probably fine, if you're looking to store more than just that/more complex data types it might be worth considering other options
you can totally add new lines any time you want
so no worries there
Alright. Also how do people make a command toggleable? Would I be able to just add a boolean as well as the location data?
Thanks for the help btw (And I promise I've tried searching this up first)
Toggleable in what way?
Like disable/enable the command, or just allowing a boolean argument?
enabling/disabling the command
Like adding a permission check?
I think there might be a way to actually disable it from the server, someone might be able to speak better on that, if that's what you're going for
I mean like if you run it once, it does stuff, but if you run it again it does other stuff.
Here's an example: You run if the first time, it'll set you to creative. You run it the second time and you'll be set to survival instead. Rinse and repeat
Oh, yeah you can deffo add a boolean for that.
Alright, thanks a bunch
Hello friends, I was recently watching a video on the MCC Island stuff, and I noticed the use of what I can only assume is boss bars. I was wondering if anybody had an idea on how this is done? I'm assuming it's just a textured boss bar with the percentage style and custom font for the icons, but I don't understand how they're adding distinct sections with their own backgrounds and aligning them in this way
Thought I could post a picture to show what I'm talking about, guess I can't 😅
There we go. I'm not really looking to replicate it entirely, I'm just interested in the different ways to do vanilla UI mods. I was looking through the wiki and docs on text rendering and couldn't find anything about putting a background on it. Was looking through the decompiled source but the rendering code has gotten a lot more complex since 2014 😅
@pulsar ferry, reveal your secrets!
oh, that's cool haha
I don't need the secrets, just curious about the background really 😂
I was about to pay for the server just to try and figure it out lmao
pay for what server?
Pretty sure the whitelist is not that big. Or is there no way to apply for that anymore? I'm not sure. I haven't played minecraft in months.
I'm impatient
And I'll probably lose interest in the time it takes to get on the whitelist haha
Emily already answered it tbh
Is the suffering a requirement, or can I do without it?
Oof, I'll stick to the suffering on this side of the fence
Is it possible to set the gameTime value with packets to only a player?
By gameTime I mean worldAge, if so, could someone clue me in, please?
Look at essentials' PlayerTime (ptime) command
Okay, thanks!
Would anyone what this error could be?
[22:01:32 ERROR]: Ambiguous plugin name `Bank' for files `plugins\ShopBC.jar' and `plugins\BankBC.jar' in `plugins'

are those custom made plugins? they probably have equal names in their plugin.yml
Yeah, so its the first time I tried creating a API for one of my plugins and used it in another of my plugins. Is it possible that the issue could be that I am just importing the whole jar from the BankBC plugin into my ShopBC plugin?
But the name in both of my plugin.yml are different
They don't, I just checked.
But couldn't it be because of this?
by importing you mean importing it to the ide or importing it and shading
Well just importing, not shading. Should I also be shading?
implementation files('E:\\LocalCompileJars\\BankBC.jar')
well if you arent shading it, it should work fine
cause if you would shade you would override the ShopBC plugin.yml
with BankBC plugin.yml
also spigot's classloader will load the classes automatically if you depend on the plugin in plugin.yml
so no need to shade
open your ShopBC .jar file and check if youre accidentally shading BankBC
Alright I'll do that, one sec
Wait wth, it's using the plugin.yml from the BankBC jar that is imported.
id 'java'
id "com.github.johnrengelman.shadow" version "7.0.0"
}
group = 'me.julespruvost'
version = '1.0-SNAPSHOT'
repositories {
mavenCentral()
maven {
name = 'papermc-repo'
url = 'https://repo.papermc.io/repository/maven-public/'
}
maven {
name = 'sonatype'
url = 'https://oss.sonatype.org/content/groups/public/'
}
maven {
url = "https://repo.mattstudios.me/artifactory/public/"
}
}
shadowJar {
relocate("dev.triumphteam.gui", "me.julespruvost.gui")
}
dependencies {
compileOnly 'io.papermc.paper:paper-api:1.19.3-R0.1-SNAPSHOT'
compileOnly 'org.projectlombok:lombok:1.18.26'
annotationProcessor 'org.projectlombok:lombok:1.18.26'
implementation "dev.triumphteam:triumph-gui:3.1.2" // Replace version here
implementation files('E:\\LocalCompileJars\\BankBC.jar')
}
def targetJavaVersion = 17
java {
def javaVersion = JavaVersion.toVersion(targetJavaVersion)
sourceCompatibility = javaVersion
targetCompatibility = javaVersion
if (JavaVersion.current() < javaVersion) {
toolchain.languageVersion = JavaLanguageVersion.of(targetJavaVersion)
}
}
tasks.withType(JavaCompile).configureEach {
if (targetJavaVersion >= 10 || JavaVersion.current().isJava10Compatible()) {
options.release = targetJavaVersion
}
}
processResources {
def props = [version: version]
inputs.properties props
filteringCharset 'UTF-8'
filesMatching('plugin.yml') {
expand props
}
}```
try adding exclude "plugin.yml" to the shadowJar category
well do you see classes from BankBC
at your ShopBC jar
Wait, could it be because I am building it wrong, because I am not seeing my actual code from my ShopBC plugin but I am seeing it from BankBC
what do you mean by that
None of these files include the code from the ShopBC plugin.
And that's ShopBC decompiled.
Bruh I am stupid, I was compiling it wrong. I started using gradle a few weeks ago and forgot to compile it using shadowJar. It works now, thanks anyway for the help!
oh
its alright lol
im not a gradle expert either
i mostly use maven
(i know gradle is better)
Yeah, I started using it because people told it is much better and has much more features.
Tho, I'm running into a few issues now. Receiving this error:
java.lang.ClassCastException: class me.julespruvost.bank.Bank cannot be cast to class me.julespruvost.bank.Bank (me.julespruvost.bank.Bank is in unnamed module of loader 'BankBC.jar' @3a394b43; me.julespruvost.bank.Bank is in unnamed module of loader 'ShopBC-1.0-SNAPSHOT-all.jar' @27b9b017)
So I understand the error, that I can cast my dependency Bank class to the actual plugin class. But that's the way of doing it no?
implementation is used for shading, if you don't want it to be then use compileOnly
Oh okay, that was it, thanks Matt!
Why does this ▌ show up as this in the image:
Looks like its something to do with encoding, adding -Dfile.encoding=UTF-8 to my run.bat file doesn't work.
the plugin hasnt been built to use utf-8
Yeah that was it, thanks.
To increase the length of the day/night cycle, is the simplest solution disabling the day/night cycle through gamerules and having a runnable increasing the time of day by a custom amount each tick?
I can only imagine that looking like it's skipping across the sky
I mean
I think that the way Minecraft does it is to set its position every tick, 24000 times a day
If I make the day last 72000 ticks, if anything it should look even smoother yknow? i think
I dunno. Might have unintended consequences of time not passing correctly.
To that note, probably should just stay out of the discussion, if I don't know much. So good luck.
Yeah, I actually figured it out shortly after posting that 🙂 ty friends
as someone who also does not know much about this, I looked through the network code and the server only ever sends WorldTimeUpdateS2CPacket when changing dimensions or joining the server. so @stuck hearth is probably correct in that it'll be jumpy since the client does the lerping itself
regardless of the jumpiness though, it seems like it'll add a lot of packets if you do it that way
Anyone here ever mess with Valence? https://github.com/valence-rs/valence
Someone here understands how to use ProtocolLib api?
I'm trying to make a armorstand packets but can't make them spawn, also I want to make sure new players joining the server could see the armorstand I sent before they joined the server
I would appreciate someone to help me figure it out (:
public static ProtocolManager manager = ProtocolLibrary.getProtocolManager();
public static void despawnEntity(Entity entity) {
PacketContainer packet = new PacketContainer(PacketType.Play.Server.ENTITY_DESTROY);
packet.getIntegers().write(0, entity.getEntityId());
try {
for(Player player : Bukkit.getOnlinePlayers()) {
ProtocolLibrary.getProtocolManager().sendServerPacket(player, packet);
}
} catch (InvocationTargetException e) {
e.printStackTrace();
}
}
public static void spawnEntity(Location location, Vector vector, Entity entity) {
PacketContainer packet = manager.createPacket(PacketType.Play.Server.SPAWN_ENTITY);
packet.getEntityTypeModifier().write(0, EntityType.ARMOR_STAND);
try {
for(Player player : Bukkit.getOnlinePlayers()) {
manager.sendServerPacket(player, packet);
}
} catch (InvocationTargetException e) {
e.printStackTrace();
}
}
It's doesn't spawn the entity, also I would love to know if the player dies and respawn the packet still exists? (so I just need to handle players joining the server and send them the packets if needed?)
https://wiki.vg/Protocol#Spawn_Entity I'm pretty sure you need at least the coordinates too for the packet
how else would the game know where the entity is?
and I think there's manager.broadcastPacket() or smth like this that sends the packet to all players
Would be possible to have fork a gitlab repo on github? I know there's this "mirror" system but idk how it works or if I could use it to fork the repo.
You can use the import system
For keeping up to date with upstream add both remotes and rebase your github remote onto the gitlab remote
The "fork" thing on github is more artificial than anything else, it's no different than cloning the project locally and pushing to your own repo
So the repo is on gitlab and I'm not gonna make an account on there just for one repo, and I want to keep everything on github
yeah that's the main concern, if I could fetch the changes from gitlab
You can
you can have both projects as remote yes
git clone blah.blah.gitlab
git remote rename origin upstream
git remote add origin blah.blah.github
git push origin
ah is it that easy?
remote-lab/main
remote-hub/main
rebase remote-hub/main onto remote-lab/main to keep up to day
I really need to learn more git smh
Yeah ðŸ˜
i was forced to learn how to github when i wanted to contribute to paper 
erm, how to git
not gh
leave me alone it's 8 in the morning
it's fiiiiine
yeah you can delete the branch and start over again 
It's pretty scary tbh, specially when there are tons of branches going on at the same time and you have to rebase and fix conflicts and worry that you could be breaking other people's works and you wouldn't know how to fix
exactly
I always fuck up when I want to edit a commit message because I somehow forget it will open a vim cli and I CAN NOT CLOSE IT
and then you find out 95% of the branches are kept there for archiving purposes 
Or were forgotten 
Like I use ctrl + : and q or whatever the syntax is but it types the q in the editor instead of exiting vim 
When ever I need to edit things on terminal I just use nano, it's easier to use
But thankfully Gitkraken saves me a lot of trouble when it comes to conflicts
I would use anything but vim
Bump
yes probably something similar
Do you recon the day/night cycle will be choppy? I recon it might not even be noticeable
If it's 72000 steps a day
it will be noticeable if people actually stop and stare at the sun/moon to look for it
probably not, you can make it as smooth as you want
but it's not something naturally disrupting
Yeah I mean if it were 1000 steps in a day it would be noticeable a lot
But with 72000 i think it will be so barely noticeable?
wait to see how essential's ptime does, or some other command, the sun goes up and then back again 
I can't remember the command but it took me a while to figure out what is going on
uh ptime doesn't affect the cycle's speed, it just changes the time point (for the player at least)
yeah I can't remember if it was ptime, but it was smth to do with the time
Do you recon doing such a thing would be resource expensive for the server
¯_(ツ)_/¯
you can only test by trying ig, but there are probably heavier things that this already running on the server
it does do that