#help-development
1 messages · Page 1915 of 1
ipc what thats?
Typically the acronym stands for "inter-process communication"
But it sounds more like you're going for "inter-plugin communication"
now that i think about it how do you provide hooks for other plugins to call?
And spigot and Bungee are built on top of it. So spigot and bungee ue netty
Wait?
Like plugins using that?
api
Give them access to an API, pass the entrypoint of that API to the plugin when it is loaded.
e.g. onLoad(MyAPI api), you then call that on the plugin with an instance of MyAPI from your framework.
Yeah you can use Api system or Service system (From Spigot)
makes sense
Alternatively do what Bukkit does and use a singleton, but I'd advise against it since it's a bit messy.
Oh sorry wait
You
You were saying how to do plugin compat
I thought you were asking how plugins interact with plugin frameworks lol
Normally people just deploy their APIs on remote repositories to allow others to depend on it
Nah in that case you just put methods in your plugin class
So that other plugins can getPlugin
For calling an api something like this:
PlugjnApiClass api = Bukkit.getPluginManager().getPlugin("PluginAPI");
You need a cast
can you elaborate on frameworks?
I now im from cellphone
Yes but to compile that you need a dependency right
Yeah scratch everything I said about that first idea
Since
Yes for comñiling you need the dependency jar
Or if you use build tools you might not even need that jar in your project dir
That why I use maven and other people use Gradle
Yea
uh wait, wouldnt that include the dependency jar in the target?
smh use Bukkit's service manager
Before your plugin calling an api. That api should be loaded on JVM if not you will get NPE
NullPointerExeceñtion
ClassDefNotFound exception
Service manager is cool and all but it seems like nobody uses it?
Yeah that too
ah so the dependency is just there to tell the compiler 'I exist'?
Objectively thats better than getPlugin
during compile time i mean
Yes
compile-time classpath
The compiler cannot verify something if it doesn't exist to it
You cant make a typo in a plugin name, you dont have to do a cast
People seem to forget there are two types of dependencies, those at runtime, and those at compile time x)
Makes sense.
you can separate a plugin from api
And those at both.
k and with the hard-depend and loadbefore options the npe wont appear either
Monterious for using an api of a plugin. First it should loaded the api pluging and then your plugin. If not you will get exception
Yeah but that’s just… 1+1
Well, hard-depend means a plugin must require another plugin.
well yes
This
but the plugin.yml docs say that you can define harddepend and softdepend
Hard 😫 kill me
You can avoid the issue by soft depending and checking if the plugin is loaded and if it's not just don't run the code that depends on it
This two are not related
Yeah
eh i was more curious about plugin hooks than that
I check if plugin its not enable with Plugin Manager#isPluginEnabled() and then I ude the other example code I sent
So i make an api class and a method in the main plugin that returns that api. Does that sound about right?
And of course add it on plugin.yml so it tell the server to first load the plugin dependency and them my plugin
Yeah
I do like that
API doesn't have to be returned by the main class
Or just, like, provide it with servicesmanager like manya pointed out
Ok api might not be a class, it can simply be the entire software that you are depending on
@vocal cloud doesn't bukkit.getPluginManager.getPlugin() return the class that extends JavaPlugin?
Although whether i would call that an API is another thing
Hmm, yeah, the term api isn’t really absolute
Nope
That's the base plugin class it returns. You'd have to cast it which is less than desirable
Simply Plugin
public class Api {
private MainClass plugin;
public Api(MainClass plugin) {
This.plugin = plugin;
}
Public String getVersion() {
Return this.ñlugin. GetDescription().getVersion() ;
}
}
Sorry for bad writing but im on cellphone
Pass the version directly?
It was an example to him see how call method from his main class
wait, how do i get that instance then?
Alr
i hope your JavaPlugin class is not called "MainClass" xD
🥲
i call my java plugin class the same name every time
Yeah its an Example
MainPluginClass™️
Wait a min
Hello, I have a little problem when I start my server, you think someone can help me ?
thanks
I assume your api is singleton
anyways how do i get the class instance i need without casting?
^ use a singleton
Of course
I flrget thst
Im on celphone dont crítice
Okk
this is one case where static singleton can be fine
Since spigot iirc doesn’t really operate well with the module system so service loaders aren’t an option
but i still probably need access to the non-static methods
if i just call it it doesnt have the plugin instance iirc
You have getInstance right
You know bukkit has service manager
I can count the plugins with my finger
Not to much plugins uses that
"ok"
It is only reasonable for API plugin to use this tbf
Like vault
But there's a good alternative to static singletone still
If you are hard depending on it yea i guess
That fake. The are a few
To expose my plugin's api, i use service manager
I’ve seen countless ones
Wait can you just check if api plugin is enable and them do: ApiClass#getInstanxe() #Method()?
Instead of doing a getter of the api from main class
Yeah services manager is very nice and sophisticated however it doesn’t scale very well once you’re creating a multi platform plugin
so static instance it is

Crossplatform plugins is a different story
Yep
Or just make a static API class just don't name it API 🤮
Or just dont create API class
it really depends on what the API should do
Your api like this:
public class Api {
Private static Api instance = new Api();
Public static final Api geInstanxe() return instance;
}
If your api class works as a fascade, then yea it is useful. Or else dont see no point
pretty much
Should you be able to implement it (like vault) or is it an interface towards a known implementation (e.g. winapi)
Ok im wrong
Not totally
Wait no im right
HologramsAPI.getHolograms(this).clear(); 
ugl
y
Is it possible to create new particle effects?
Like new textures and patterns etc
I was thinking of LoD, but i realise that doesnt invalidate my statement
New patterns sure
New textures, sure. But textures are client sided
You can
Ohhh, how do I do that?
You can allow server to enforce players to load the custom resource pack
How do I call on these particles in Java tho?
But if you meant to ask if it is possible to add on to the already existing particle textures, afaik no
Spawn them
Check out World class
Yeah I was hoping to like add new particles that don’t replace the vanilla ones
I guess you are at the end of the line then
Ah alright then, thanks
It spawns in as a Spectator because the player gets put into spectator when they die, If I change the players game mode after that the entity's game mode changes as well.
random question, is TIME_SINCE_REST stored in ticks, milliseconds, nanos second or what?
Default java time is MiliSeconds
Have you imported Spigot api?
only asked because when I tried that it was no where near what the statistics menu showed resulting time, i tried puting it against the 20 ticks /sec deal and it was alot closer...
player.getStatistic(Statistic.valueOf(DROP), Material.valueOf(TALL_GRASS))
Pretty sure it’s ticks
Have you imported the Spigot api?
Yes
compileOnly 'org.spigotmc:spigot-api:1.18-R0.1-SNAPSHOT'
For default Java its MiliSeconrds and for Spigot api its Ticks
You should take in care
acording to stats thing
That 20 ticks = equals 1 second
Optimally
Solar*
Its possible to edit Spigot source and then recopile it. And then install it on local repo. So them I can acess vía dependency in pom?
You can manually compile the project if you wanted to. Depends what you're trying to do
Cuz I want to edit the Spigot jar so i can work eaaier
Yeah that's a danger game
I know but i will Implement something really useful
Being
Then you are potentially on a forking business
hello i have a problem in my server, some mobs are like freezed
I will put inside that custom Implement of spigot and bungee. A system for sending data cross server without sockets, message brokers or specific port.
So in other words a highly volatile dangerous system
You can't exactly send data without a port, socket, message broker etc
Without using something like UDP
I will do it on base the current port of every server
Cuz I will work on its netty
🤣 🤣
Yeah that's really bad idea
Like I will use the netty instance of Spigot and Bungee
No shy
If that bad idea why exists plugin message?
Humm
Many dudes
Because it's safe?
Unlike whatever you have in mind?
There is probably an easier solution to the issue you're trying to solve here
how can I spawn particle at raytrace
I have already talked to Dev an he ask me 40 dollars per month
40 per month for what now
For doing that custom implementation on Bungee and Spigot side
just forEach?
So he would write it once and you would pay $40/month indefinitely?
Yeah. Every moth he took doing that I will pay him 40$
So it's not indefinitely
It's until it's finished
How would that take more than a month though
Yeja
That doesn't make sense
Idk I think it wont take more than 1 moth
$40 for a month worth of work is also ridiculously low
I charge $40 for 2 hours of work
Cuz its easy if you understand how netty works. You only should work over netty
Like when you understand and have the concept its really easy
I don't understand why you need something like that
No you really shouldn't "only work over netty". There's a reason people don't do this
In my case I will use it for a network
Why would you not just use plugin message channels
^
They want a private cross server core. Without requering online players/sockets/message brokers
They have already told me many times that
why do you not want those
I have tríed to convince them to use Redis
And they told me really rude:
If you dont like the work we can pay another dev
And i was like a clown
So in other words they want a really badly designed system but money is money. 
They're the clowns here
"We don't understand how any of this works but we're going to insist on this pointless implementation detail"
Typical upper management if you ask me
The reason you don't do this normally btw is because it opens the server to vulnerabilities. Plugin messages are internal and protected but when anyone can beam a message to Scotty from the open port
Like for me I will use Redis + Cache per server + MongoDB but they insist that netty its not good, etc
And they give clown reason
And i really need the money
All I can say is good luck
I will use it to pay my treatenent for getting out of drugs
Allright thanks
There is definitely a bunch of ways to do it but you're threatening the stability of the server with each change to the core
Like when I patched the reload command so it doesn't do anything that probably won't blow anything up. But when you add extra IO stuff with packets? That could do something you don't want
The dev told me
That the secure way should be using a an RSA encrypt + custom protocol + Custom channel and wrapper. So it doesnt interface with minecraft protocol
Then you'll have to use a different port as well. Since if it's not running through MC's system you won't be able to use the same port
No it wont need it
Cuz on netty you can have múltiple channels
And each channel its independient
Yes but in order to use the same port they have to use the same instance
Yeah. And in the same instance you can have different channels
That its the truck
Trick*
Yeah good luck. Way above my pay grade to do that kind of work
Since I get out from home I wherw reading about netty
Cuz i think 40 for only that its to much. And imagine that the owner will payme over 60-80 dollars and then I will hage to pay the dev
So humm
I think I will try to do it myselft
40 is way too little imo. Modifying source code of Minecraft's level is no small feat and requires a dev with knowledge on best practice to avoid vulnerabilities all the while adding a service that doesn't affect anything else.
Yeah
He have worked with minecraft protocol many times
I think he started when he was 15 years old on mc development (spigot and bungee) and now he is 20 something
Is it 1.8 cause 1.8 has no mappings either and no longer has the code base supported
cringe
It will base base 1.9x because he told me that on 1.8 wont be possible cuz mappings
sigh.
I think the owner of network will pay a devops tem for verying that everything works
So lmao im really excited
Its my first biggest work I will be on
Anyone know why it doesnt find jda?
<dependencies>
<dependency>
<groupId>org.spigotmc</groupId>
<artifactId>spigot-api</artifactId>
<version>1.18.1-R0.1-SNAPSHOT</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>net.dv8tion</groupId>
<artifactId>JDA</artifactId>
<version>3.3.0_261</version>
</dependency>
</dependencies>
Yeah but if you can't do it you'll have wasted potentially 10s of hours that would have paid 100s of dollars more
You're missing their repo aren't you
<repository>
<id>jda</id>
<url>https://mvnrepository.com/artifact/net.dv8tion/JDA</url>
</repository>
this?
hi, do you know why does java armorStand.teleport(new Location(world, posX + xDist, posY + yDroneRenderDisplacement, posZ + zDist)); take about 5 sec to teleport the armor stand?
maybe chunk loading?
doubth it i am in the same chunk
Why such an old version?
<dependency>
<groupId>net.dv8tion</groupId>
<artifactId>JDA</artifactId>
<version>4.4.0_350</version>
</dependency>
<repository>
<id>dv8tion</id>
<name>m2-dv8tion</name>
<url>https://m2.dv8tion.net/releases</url>
</repository>
3.x is ancient and might not even work anymore
Personally I'd use 5.0.x but it's in alpha so 
Server lag?
ty
i dont know i wrote a message on the server and i was able to read it in the console
What you could do is get the currentTimeMillis before it does the action then print the new - old time and see how long it's taking. To me it sounds like a server issue of sorts
Maybe the server or client is throwing out a bunch of update packets
allocate that 1mb of ram.
1mB?
I'm making a joke ignore me
But it shouldn't be that delayed. A delay of a second or two is normal for teleport as you can usually see the object move
is a proble in this? ``java
?paste it
?paste double xDist = Math.sin(direction.getY()) * blocks;
double zDist = Math.cos(direction.getY()) * blocks;
System.out.println(xDist);
System.out.println(zDist);
armorStand.teleport(new Location(world, posX + xDist, posY + yDroneRenderDisplacement, posZ + zDist));
I mean put it in the paste bin ctrl + s then send the link
is a problem in this ? ```java
double xDist = Math.sin(direction.getY()) * blocks;
double zDist = Math.cos(direction.getY()) * blocks;
System.out.println(xDist);
System.out.println(zDist);
armorStand.teleport(new Location(world, posX + xDist, posY + yDroneRenderDisplacement, posZ + zDist));```
Preferably send the whole function rather than a small snippet. But it's fine
Now is the delay within the function itself? Does it always have such a long delay? I'd still recommend logging the amount of time it takes to execute to see if it's actually an issue with the code
wont work as i added the line System.out.println("test") at the end of the function and it deisplayed the message and then move the armorstand after 4sec
Ah that's what I wanted to know
and for some reason i cant dojava armorstand.getLocation.setX(x)
it wont move the stand
Changing the location isn't going to change the location of an entity
this improved the things``` Bukkit.getServer().dispatchCommand(Bukkit.getConsoleSender(), "tp" + " " + armorStand.getUniqueId().toString() + " " + String.valueOf(posX + xDist) + " " + String.valueOf(posY + yDroneRenderDisplacement) + " " + String.valueOf(posZ + zDist));
damn intellij fancy
is it a good way to store a chatcolor (hex) in string format, to concat with a message every time i need it? 👀
Doesn't ChatColor have a .toString() that does that for you?
like this
I mean that’d be fine for hex if you didn’t want to write the hex string each time
But those look like legacy colours
ah wha you cant use static stuff in an enum declaration
wdym?
its an enum
that just means that MESSAGE_COLOR hasn't been defined at the time you are trying to access it
aaah
because the enum values are loaded first you mean?
it works with a static method instead of field smh 😂
no
Oh
Yeah but that isn't exactly a great solution as I imagine the issue is something else. The delay shouldn't be that great.
Fourteen yeah well if it’s the Enum I believe the constants are instantiated before anything else
but why is the delay present?
Applies to static
ah thats what i thought
That's a good question for which I don't have a good answer. But the armorstand follows me with little delay.
spoopy
Probably due to the game engine’s tps
is it not happy becouse i have a custom model on the armor stand
public enum TestEnum {
VALUE_ONE(ONE), VALUE_TWO(2);
private static int ONE = 1;
private final int myValue;
TestEnum(int myValue) {
this.myValue = myValue;
}
}
of course this can't work
and the enum must always be at the top
so it can never work
TPS is 20
ah yes
then why is there a 4-5sec delay ?
where on earth do you see a 4 second delay?
See this is what I'm confused about lol

maybe 1/3 sec
also when teleporting the entity to the player location, also add the players current velocity to the destination location
yeah that's totally stupid
but it would lag behind anyway
og code is here
I do:armorStand.teleport(new Location(world, posX + xDist, posY + yDroneRenderDisplacement, posZ + zDist)); and then it 4sec after it spawns
So when it spawns what exactly does it do? Just sit there or is it following something?
the plan is to spawn it then make it face the block and then move it forward
that process shouldn't take 5s
what are you actually trying to do?
have the armor stand always at the player location?
I was using that to prove a point
isn't that exactly what it currently does?
no it spawns at the player location
but then it needs to face a specificlocation
and then move the amount of blocks towards it
I have a method to make entities look at a destination location, 1 sec
I don't get it, I don't see any lag in your video
?
There would be no performance difference between teleporting it async or normally
I think yes
teleporting them async would actually be slower
Lol really
yeah but - it doesn't have a 5 second delay, or they sent the wrong video 😄
My video you mean?
sure, teleporting it synced does teleport it NOW. teleporting it async teleports it when the scheduler has time
On the video I can notice the delay
ooooh
sorry I thought it was the video of the person who asked
this is my gif
this is my gf 😳
She's a bit too clingy you can have her back
her arms look weird
What version is that
Do Text in javafx library support multiple lines?
latest
Ah that why you can do that
Right now im looping through the arraylist and trying to print it in a text but it seems to only display only 1
Jtx send code
i will record a video of the delay
I think your loops it being stopped or stmh like that
for (int i = 0; i < playerHand.getArrayList().size(); i++) {
lblPlayerCards.setText("Cards: " + playerHand.getCard(i));
}
Yeah. Remember no more than 10 seconds cuz discord has limits
Why not use an enhanced for loop
I can't send 3s of video cause it's too HQ 
Why using that loops
for(var x : y)
whuuut I can send like minutes of videos 😄
Wait
What resolution is your monitor 
Why does getArray() return something with a size() method
Arrays don’t have a size method
An arraylist it does
My monitor is 2480 p I think
So it’s not an array
2715x1527 lol
wtf lol
“getArray” implies an array
Maybe OBS just likes making my videos thicc
Don't worry about that
So please name properly your setters ir getter
im looking for a good command framework like brigadier
yeah depends on what output format you use
I have done my own. Without using annotation
why cant i send the video file over ds ?
Verify
You're not verified
how ?
GET VERIFIIIEEED

verifying is useless
can i see?
bruh read the #rules
#verification
Send a picture to prove it is
I think that’s the channel
I would send it but im not at home
alr
Quick let’s all talk about him in #verified
I will be at home this Monday. Sorry!
i dont have spigotmc
Lol
done
Imagine no embeds
Asking for help without having account on spigot
then you can't get verified lol
Imgur moment
image hosting moment
sending links is also not allowed iirc
?paste
as i created an account but they never sent me the activaation code
Is there an event equals on 1.8x?
No clue
Event equals?
then create another one
Inb4 typo in email
Yeah like if there is an equals event to the one he using but for 1.8
PlayerMoveEvent exists in 1.8
it says.
Some fields contained unexpected data. Please try again or contact the administrator.
but not what fields
Woof I'm actually building 1.8.8 
Im confused between scoreboard Objective and team
don't use special chars in your name
ez
But everyone loves pointless special characters
are letters and numbers not ok ?
of course they are
Cuz the 2 of them have setPrefix and setSuffix
why doesent it let me register then?
Have you check the email is correct
it is correct
the registration works fine
That looks laggy asf lmfao
Because it was named in 2011
they want to support old versions too and the name was ( or is ) still the same like minecraft uses
You can always use the getByName or getByKey methods instead
ah. on a different note i want to make a block drop something it normally doesnt, should i manually spawn in an item or create & call a BlockDropItemEvent?
I’d call the event if you want compatibility
the internal name is "minecraft:haste"
It is now
Even if you call the event you still have to manually drop the item
But calling the event lets other plugins know about the drop
dont really have a choice.
Gotta either recall the event or

Or just don’t
Just don't™️
y is that not allowed 😐
Cause you're a bad boy and lost drop editing permissions
how do i actually call a event?
pluginmanager.callEvent
like i can initialize it but it hasnt happened
Bukkit.getPluginManager().callEvent();
what do you expect to happen? o0
calling an event does nothing by itself
I except you to bow before me mortal 
well what i expected happened
it only notifies other plugins that this event was called, that's everything it does
do you know why does the delay occur ?
what's your code
but im a bit concerned since the blockbreakevent and the ItemDropEvent aren't linked
the code i sent earlyer
so set to air then call the BlockDropItemEvent?
Why set to air
docs say so
Note: Plugins wanting to simulate a traditional block drop should set the block to air and utilize their own methods for determining what the default drop for the block being broken is and what to do about it, if anything.
so um
it requires @NotNull java.util.List<org.bukkit.entity.Item> items
but when i try to create an item it drops a massive list of methods inbetween those weird parenthesis
so any ideas why is the move delay so big?
because its not c++
unfortnatly
World#dropItem returns an item
if it was coded in c++ beginners wouldn't be able to make plugins
i fear i need more context than that
but it would be compiled and not ran as interpreter
i have no idea what you mean by that and my World. doesnt have that method
Big it’s definitely not interpreted
also i dont want to drop an item at those coordinates
Even if you'd teleport on c++ is going to be big..
i want to call the BlockItemDropEvent
You need to drop an item to call the event
The event requires an item spawned in the world
Teleport were meant to be used in movements longer than 8 blocks
mf..
ah that would explain it
How will be to add a command with argument?
yes, but it requires an argument
lets stop sending code snippets and use QR codes instead
like /command myArgument
just register the command name and set an executor for it which handles any possible subcommands
what?
i dont have a qr scanner on my pc :(
like this? String[] split = command.getName().split(" ");
Bruh the issue here is so obvious. Pixel 15-23 needs to be 0 instead of 1
why does InventoryClickEvent get called 2 times? i click one time and it calls the Action PlaceAll 2 times
why does it do dat
on mouse click and on mouse release
oh
just register a command with the plugin.getCommand(name).setExecutor(
f.e. is your command is called heal and the subcommands can be "self" or "other" just call getCommand("heal")
it does both when i release the mouse
one sec
?jd
for some reason it only triggers once for me
can u post the code in ` brackets?
is what it prints when i click once
uuugh my bad D:
is there a way to detect it when villagers throw crops at each other etc?
like some VillagerDropItemEvent
i kinda need the code to know whats happening here @sly trout
just copy paste the entire @EventHandler method
Would it trigger from this? https://hub.spigotmc.org/javadocs/spigot/org/bukkit/event/entity/EntityDropItemEvent.html. or is that only on death 
hm no idea, i'll check, thanks 🙂
Cause like it looks like it's for death only but it's says creates a drop very confusing
hm 😦
sef
ok finaly
there is my code for inventoryClickEvent
everytime i click once it triggers two times the event
i forgot but will assert throw an AssertionError if it fails?
Yes.
inventory click event I believes can fire multiple times because holding it down sends it more than once. I might be wrong tho
Assert is not ran by default by java
Even if I hold it down it only triggers twice when releasing
You haven't registered the event twice by accident? I remember having this issue before but it never really affected me as I was only canceling the event.
i dont know what you're doing but it only fires once for me if i use your code
nope only registered once
I think it fires twice in creative
when im in survival it triggers once
lol ya
YES LMNAOOO<
Creative is jank
Creative has an inventory event for itself I believe
alright so i just have to disable it
the sad part is that i tested it in creative and it fired only once for me
i think the reason for that is because i havent tried causing the cursor swap action while in creative
ZonedDateTime
It's nice because you don't have to worry about the app having a different date on a different machine
Idk what you're trying to say
I don't get what you're trying to say. Run some tests you'll figure out how it works
Because i need a way to show dates/times that player can understand
You can format it using a DateTimeFormatter
PLACE_ALL is not an event
You want to format it per user you're going to need per user timezones stored somewhere matched to the Zone enum
Yeah that what
Its possible to get their time zone!
That is what I cannot find info
it is tho
I tríed with Player but i didnt find anything
You're not going to be able to get their timezone unless you ask them for it. Unless you trace their IP but don't do that
See the java docs there you can find all the events
?jd
bruh
Every plugin trace their ip adress
I have seen a plugin on spigot that trace ir ip and post it on website
The server does not the plugin. You also don't trace it just store it
My guy it's a clicktype or inventoryclicktype or wtv
no, it's an enum field
Mike so getting player ip I them I can get their time zone?
Do I need to use an api or what?
I havent info im really stressed
not really
Omg
I mean you could use some API to do it but that's kinda creepy imo
you can use geo ip to get a rough estimate about where the IP might be
Lovely yeat. I wish you could get their time zone vía Player Object
It would be really useful
it's fucked up often and gives wrong information and it also won't work for people using any foreign VPN / proxy
Yeah
there is no way to properly get the location of an IP
just let players choose their timezone
Allright vía command so
I'd just use a GUI with some heads representing country flags
Isnt it the same UTC 00:00 and PM EST
what do you even mean with "PM EST" or "UTC 00:00"?
The default time which is?
For what?
"PM"? "00:00"?
For every country it should be a base
UTC is a timezone, no idea what "UTC 00:00" should mean
EST is a timezone too, but "PM EST"? what's that?
No country has a default per se
well germany is always CET or CEST
North Americans fall across 3+ time zones
I thought the default time was UTC 00:00 and every country add more or take more hours
Do undrstnad me?
if the default time was always 0:00 then it would always be 0 o clock in england, 1 am in germany, and 5pm in new york
this makes no sense lol
Hum in confused
UTC is the base in which every other timezone is detracted from
I thought there was a time standard Where depending the country it add or take hours
Thst what im making reference
yes that's UTC
Delete
because you keep coming up with this weird "00:00"
my eyes hurt from just the preview
right now it's 18:38 CET or 17:38 UTC
UTC 00:00 its the base for every country
UTC + 0 is UTC
UTC - 5 is EST
00:00 UTC is a specific point in time
UTC +5 would mean that if UTC was 00:00 that the other would be 05:00
is there a method to get the drops from BlockBreakEvent
"wanna look like a hacker "
no
no
what
You need to use blockdropevent
there is a method to get what it "normally" drops
Or whatever it's called
BlockDropItemEvent will still not have information about drops added by 3rd party plugins
TL;DR there is NO way to reliably detect what items will be spawned when a block is broken
ye that's not the problem
That's only an issue when it becomes an issue though
The default format should be:
UTC hh:MM:ss right?
if you don't care about other plugins, just BlockDropItemEvent
Why the UTC. Unless you're not using ZonedDateTime you shouldn't need it
tryandsee moment
Lol
Who did thst ckdle
I really like it
I will keept it
ZonedTimeZone there is no infl
Its like ir doesnt exists on the docs
Fuck me how many date and time libraries does java have
Instant, Calendar, DateTime, ZonedDateTime, LocalDateTime, what am I missing
Why my command is suggested in game but while writing it it gives me an error and when i execute it says me uknown command ```java
this.getCommand("test").setExecutor(new TestCommand());
```yml
commands:
test:
description: Test
usage: /<command>
You didn't indent it
It should be
commands:
test:
description: Test
usage: /<command>```
Then show the entire plugin.yml
name: Test
version: '${project.version}'
main: test.mod.Main
api-version: 1.18
authors: []
commands:
test:
description: Test
usage: /<command>
Ok and let's see the main class and command executor
@Override
public void onEnable() {
this.getServer().getPluginManager().registerEvents(new Controller(this), this);
this.getCommand("discordwl reload").setExecutor(new ReloadCommand());
this.config = new DataManager(this);
main = this;
}
Also, you can't do getCommand("discordwl reload") to begin with
Subcommands do not exist in the standard spigot command library
Also to set permissions how will it be? the docs only says yourplugin.yourcommandpermission and nothing more about it
Im you are using command executor interface
Just check Player#hasPermission(permission)
That why I use my own command framework with command name, permission, description aliases all vía constructor
And i dont need to register them thought plugin.yml and it automatic register them to the CommandMap
setting permissions?
or requiring permissions?
i guess both, i want only the OP players be able to execute that command
commands:
test:
description: does stuff
permission: any.permission.you.like
that's it
huh now that i think about it
can you set a permission to be 'by default' the same as another permission?
permissions are by default given to ops
you can make them default for every player like this
permissions:
any.permission.you.like:
default: true
Question, is it still a good thing to support Votifier as a vote receiver, or is it time to move on?
i know that
I see nothing wrong with Votifier
but theres some edge cases where it would normally be that one permission goes true/false for group:default so does the other, but just not always
Votifier seems kind of broken in newer Minecraft versions. My plugin requires to include the library javax.xml.bind/jaxb-api to get it to work with Votifier + it hasn't been updated since 2015. When I ask around, nobody is using it anymore.
So support should be dropped I guess then 🙂
how is it inconsistent?
you could cancel the EntityDamageByEntityEvent, then call the same event again and apply the damage and knockback manually
oh noo, you manually have to calculate the new velocity
this will basically just make the damaged player get the same velocity as the attacker
so if attacker stands still, the victim will stand still too
or is that what you want?
you can substract the attacker location from the victim location, turn it into a vector, normalize it and use that as velocity
Vector knockback = attacker.getLocation().substract(victim.getLocation()).toVector().normalize()
sth like that
if the victim gets pushed into the wrong direction, do the substraction the other way around instead
I have no idea how vanilla knockback works 😄
this would however ALWAYS move the victim by the same amount
just the direction depends on from where the victim was hit
the distance will always be the same because the vector is normalized
RIP 😦
I don't have time to test it with you
😄
Can a minecraft UUID be longer or shorter than 32 characters?
No
Minecraft uses the UUID class provided by Java itself. It isn’t going to change anytime soon.
this will conflict with actual damage knockback IIRC
whats the XY
hack client
yeah as said, then switch the locations 😄
replace victim.getLocation() with attacker.getLocation() and vice versa
5,316,912,000,000,000,000,000,000,000,000,000,000,000,000 UUIDs can be generated
then they will start duplicating
right?
they are always 32 chars (or 36 iirc with dashes)
well it becomes 100% when it reaches that amount
yeah well if you generated and saved all those ids yes
I have a question. Imagine I have a number between 0 and 1000. I need a function to convert it to a sinus-like pattern, so that
function(0) = 0
function(250) = 0.5
function(500) = 1
function(750) = 0.5
function(1000) = 0
and so on. anyone have any idea?
which will take 8.50705919999999955e+31 TB of memory
At most 2^128 UUIDs can be generated
that this the amount i just said
So this number is def. wrong
oh
hmm maybe if 500 is max use %500
and then you have to use that (max=500) /500 and from that the sin ?
if what u said is true and it isnt 2^122 which i doubt, its 3402823700000000000000000000000000000000000000
I want floating mobs, their AI should just work fine in air is that posibble
It is two longs, so 2 * 64 bits
sooo some kTB ?
you are wrong i think
/*
* The most significant 64 bits of this UUID.
*
* @serial
*/
private final long mostSigBits;
/*
* The least significant 64 bits of this UUID.
*
* @serial
*/
private final long leastSigBits;
java's impl is this
oh ok
Java happily allows this in this UUID(long, long) ctor
but it must be smoothed out basically
Of course, not a valid UUID, but technically allowed
like a sin wave
oh yes hm
thanks I'll try something
then its 3402823700000000000000000000000000000000000000
And then also keep in mind that 1 UUID at least is 16 bytes to store. But then context has some overhead
Java for example has a 12-ish byte overhead for each object
aka 3.4 Quattuordecillion
4253529624999999400000000000000000000000000000000 terabytes worth of uuids
aka 425352962500000016000000000000000000000000
yottabytes
google has that amount for sure
4253529600000000000000000000000000000000000
geopbytes
thats the smallest we can get to
prob a fork of spigot
no
lmao
huge servers usually have their own forks
not sure though
Probably patch nms to some degree
Like 2Hex said, their own fork
Possibly not their own fork, just bytecode manipulation
I don't get it to work lmao
isnt this possible just with packets too ?
Well, you probably want to synchronize it with the server don’t you?
I don’t know. You must define better first…
reflection ^^
Yeah well then there aren’t just packets
You probably need to create an account on their stash and get accepted
Then clone to ur desk
its prob hard too
You have to clone it and use the tools included to apply the patches
16 bytes
each object has a 12byte header which is then padded to a multiple of 8bytes
how do you send a message in the same format as the block height limit messsage?
therefore a minimum size an object can take up is 16 bytes @quiet ice 🙂
like above the hotbar
actionbar message
so i was right
not sure, didn't see where you said this?
prob not
Anyone have a solution to this?
Doesn’t that depend on version?
not sure how that refers to minimum object size
for minimum object size yes, 64bit is 16bytes and on 32bit its 8bytes
um what?
What are you trying to do
?xy
Asking about your attempted solution rather than your actual problem
Hello, is it possible to display a text on a block?
holograms
thing is i don’t think it returns the uuid without the hyphens
so i’ll just do 36 to be safe ig
Cool people use BINARY(16)
varchar(36) kekw
yes but non-cool people in your class have no idea what the fetch those are lol
Think of uuid as 128 bit number

you can store it in 16 bytes
i just didn’t know if there were any special cases of players having uuid longer and then breaking my db
uuid cant be longer than 36 p sure
Strings are fat af
kew
just like my ti
16 bytes vs 72!
which java library do mc servers use for cli tab completion?
i think they coded that self ?
maybe they did
how could I create a tab completion system like that from scratch?
use JNI binding for gnu readline?
actually its not a java library iirc
implements TabAutoComplete
and then there's a secondary @Override onTabAutoComplete returning the possible args for the command
that must be in the same class the command's in i think
could possibly be separate but that's just inviting trouble
declaration: package: org.bukkit.event.server, class: TabCompleteEvent
I think you guys misunderstand what I mean
But MC uses Brigadier for its improved chat completion/suggestion
I'm not looking for a bukkit api for tab completion for my command. Looking for the low level mechanisms that allows tab completion in cli programs independent from the bukkit/mc project
code it yourself O.o
press f4
thats not even hard to do
how do you begin? xd

