#help-development

1 messages · Page 1915 of 1

lavish hemlock
#

Actually nah IPC works fine

sterile token
#

ipc what thats?

lavish hemlock
#

Typically the acronym stands for "inter-process communication"

#

But it sounds more like you're going for "inter-plugin communication"

sterile token
#

Cuz I finally understand how to use netty

#

I read that its a networking framework

smoky oak
#

now that i think about it how do you provide hooks for other plugins to call?

sterile token
#

And spigot and Bungee are built on top of it. So spigot and bungee ue netty

sterile token
#

Like plugins using that?

smoky oak
#

theres a ton of plugins using other plugins

#

but i am unsure how

hardy swan
#

api

smoky oak
#

well yes

#

but how

sterile token
#

An api its an abstract of an application

#

Where you can grab data from it

lavish hemlock
#

e.g. onLoad(MyAPI api), you then call that on the plugin with an instance of MyAPI from your framework.

sterile token
#

Yeah you can use Api system or Service system (From Spigot)

smoky oak
#

makes sense

lavish hemlock
#

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

hardy swan
#

Normally people just deploy their APIs on remote repositories to allow others to depend on it

lavish hemlock
#

Nah in that case you just put methods in your plugin class

#

So that other plugins can getPlugin

sterile token
#

For calling an api something like this:

PlugjnApiClass api = Bukkit.getPluginManager().getPlugin("PluginAPI");

smoky oak
#

can you elaborate on frameworks?

sterile token
hardy swan
#

Yes but to compile that you need a dependency right

lavish hemlock
sterile token
hardy swan
#

Or if you use build tools you might not even need that jar in your project dir

sterile token
#

That why I use maven and other people use Gradle

hardy swan
#

Yea

smoky oak
#

uh wait, wouldnt that include the dependency jar in the target?

sterile token
#

No

#

I explain why

quaint mantle
sterile token
#

Before your plugin calling an api. That api should be loaded on JVM if not you will get NPE

#

NullPointerExeceñtion

quaint mantle
#

ClassDefNotFound exception

lavish hemlock
sterile token
smoky oak
#

ah so the dependency is just there to tell the compiler 'I exist'?

quaint mantle
smoky oak
#

during compile time i mean

lavish hemlock
#

Yes

#

compile-time classpath

#

The compiler cannot verify something if it doesn't exist to it

quaint mantle
ivory sleet
#

People seem to forget there are two types of dependencies, those at runtime, and those at compile time x)

quaint mantle
#

you can separate a plugin from api

smoky oak
#

k and with the hard-depend and loadbefore options the npe wont appear either

sterile token
#

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

ivory sleet
#

Yeah but that’s just… 1+1

lavish hemlock
smoky oak
#

well yes

smoky oak
#

but the plugin.yml docs say that you can define harddepend and softdepend

sterile token
#

Hsrded?

#

Isnt Dependency and Softdepend!

lavish hemlock
vocal cloud
#

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

hardy swan
smoky oak
#

eh i was more curious about plugin hooks than that

sterile token
#

I check if plugin its not enable with Plugin Manager#isPluginEnabled() and then I ude the other example code I sent

smoky oak
#

So i make an api class and a method in the main plugin that returns that api. Does that sound about right?

sterile token
#

And of course add it on plugin.yml so it tell the server to first load the plugin dependency and them my plugin

vocal cloud
#

API doesn't have to be returned by the main class

ivory sleet
hardy swan
#

Ok api might not be a class, it can simply be the entire software that you are depending on

smoky oak
#

@vocal cloud doesn't bukkit.getPluginManager.getPlugin() return the class that extends JavaPlugin?

hardy swan
#

Although whether i would call that an API is another thing

ivory sleet
vocal cloud
ivory sleet
#

Simply Plugin

sterile token
#

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

ivory sleet
#

Pass the version directly?

sterile token
smoky oak
#

wait, how do i get that instance then?

ivory sleet
#

Alr

spiral light
#

i hope your JavaPlugin class is not called "MainClass" xD

ivory sleet
#

🥲

smoky oak
#

i call my java plugin class the same name every time

sterile token
vocal cloud
quaint mantle
#

Hello, I have a little problem when I start my server, you think someone can help me ?

smoky oak
quaint mantle
#

thanks

sterile token
smoky oak
#

anyways how do i get the class instance i need without casting?

ivory sleet
#

^ use a singleton

sterile token
#

I flrget thst

#

Im on celphone dont crítice

hardy swan
#

Okk

ivory sleet
#

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

smoky oak
#

but i still probably need access to the non-static methods

#

if i just call it it doesnt have the plugin instance iirc

hardy swan
quaint mantle
#

You know bukkit has service manager

sterile token
#

Not to much plugins uses that

smoky oak
#

so

#

wait

quaint mantle
#

"ok"

hardy swan
smoky oak
#

people store the plugin instance in a static variable in the class

#

why

hardy swan
#

Like vault

quaint mantle
#

But there's a good alternative to static singletone still

ivory sleet
#

A lot of plugins use services manager?

#

Afaik

hardy swan
#

If you are hard depending on it yea i guess

sterile token
quaint mantle
#

To expose my plugin's api, i use service manager

ivory sleet
#

I’ve seen countless ones

sterile token
#

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

ivory sleet
#

Yeah services manager is very nice and sophisticated however it doesn’t scale very well once you’re creating a multi platform plugin

smoky oak
#

so static instance it is

ivory sleet
quaint mantle
#

Crossplatform plugins is a different story

ivory sleet
#

Yep

vocal cloud
#

Or just make a static API class just don't name it API 🤮

smoky oak
#

the purpose of an api is to be an api

#

isnt it?

hardy swan
#

Or just dont create API class

quiet ice
#

it really depends on what the API should do

sterile token
hardy swan
#

If your api class works as a fascade, then yea it is useful. Or else dont see no point

smoky oak
#

pretty much

quiet ice
#

Should you be able to implement it (like vault) or is it an interface towards a known implementation (e.g. winapi)

ivory sleet
#

Not totally

hardy swan
#

Wait no im right

vocal cloud
#

HologramsAPI.getHolograms(this).clear(); uwu

quaint mantle
#

ugl

y

#

Is it possible to create new particle effects?

#

Like new textures and patterns etc

hardy swan
hardy swan
#

New textures, sure. But textures are client sided

quaint mantle
#

Not textures right?

#

So no adding new textures?

hardy swan
#

You can

quaint mantle
#

Ohhh, how do I do that?

hardy swan
#

You can allow server to enforce players to load the custom resource pack

quaint mantle
#

How do I call on these particles in Java tho?

hardy swan
#

But if you meant to ask if it is possible to add on to the already existing particle textures, afaik no

hardy swan
#

Check out World class

quaint mantle
hardy swan
quaint mantle
#

Ah alright then, thanks

cold pawn
#

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.

vapid thorn
#

random question, is TIME_SINCE_REST stored in ticks, milliseconds, nanos second or what?

sterile token
#

Default java time is MiliSeconds

analog prairie
#

No enum constant org.bukkit.Material.LEGACY_TALL_GRASS

#

What's wrong?

sterile token
#

Have you imported Spigot api?

vapid thorn
#

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...

analog prairie
#

player.getStatistic(Statistic.valueOf(DROP), Material.valueOf(TALL_GRASS))

sterile token
analog prairie
#

compileOnly 'org.spigotmc:spigot-api:1.18-R0.1-SNAPSHOT'

sterile token
#

For default Java its MiliSeconrds and for Spigot api its Ticks

vapid thorn
#

44501

#

thats the stored number

#

thats 0.67 hr

sterile token
#

You should take in care

vapid thorn
#

acording to stats thing

sterile token
#

That 20 ticks = equals 1 second

hardy swan
#

Optimally

sterile token
#

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?

hardy swan
#

It sounds possible

#

I mean paper has done it

vocal cloud
#

You can manually compile the project if you wanted to. Depends what you're trying to do

sterile token
#

Cuz I want to edit the Spigot jar so i can work eaaier

vocal cloud
#

Yeah that's a danger game

hardy swan
#

Then everyone who uses your plugin must use that spigot jar too

#

It is like

#

Paper

sterile token
#

I know but i will Implement something really useful

vocal cloud
#

Being

hardy swan
#

Then you are potentially on a forking business

lucid root
#

hello i have a problem in my server, some mobs are like freezed

hardy swan
sterile token
#

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.

vocal cloud
#

So in other words a highly volatile dangerous system

sterile token
#

No why

#

Lmao

vocal cloud
#

You can't exactly send data without a port, socket, message broker etc

#

Without using something like UDP

sterile token
#

I will do it on base the current port of every server

#

Cuz I will work on its netty

#

🤣 🤣

vocal cloud
#

Yeah that's really bad idea

sterile token
#

Like I will use the netty instance of Spigot and Bungee

sterile token
#

If that bad idea why exists plugin message?

#

Humm

#

Many dudes

vocal cloud
#

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

agile sinew
#

how can I spawn particle at raytrace

waxen plinth
#

You ray trace

#

Get the location

sterile token
waxen plinth
#

And then use World#spawnParticle there

#

Wait wouldn't it be raycast

vocal cloud
sterile token
#

For doing that custom implementation on Bungee and Spigot side

agile sinew
#

just forEach?

waxen plinth
#

So he would write it once and you would pay $40/month indefinitely?

sterile token
#

Yeah. Every moth he took doing that I will pay him 40$

waxen plinth
#

So it's not indefinitely

#

It's until it's finished

#

How would that take more than a month though

sterile token
#

Yeja

waxen plinth
#

That doesn't make sense

sterile token
#

Idk I think it wont take more than 1 moth

waxen plinth
#

$40 for a month worth of work is also ridiculously low

#

I charge $40 for 2 hours of work

sterile token
#

Like when you understand and have the concept its really easy

waxen plinth
#

I don't understand why you need something like that

vocal cloud
#

No you really shouldn't "only work over netty". There's a reason people don't do this

sterile token
#

Why?

#

Give Arguments

#

I dont like that

vocal cloud
#

Give arguments for what it's used for

#

and I'll respond to why you don't

sterile token
#

In my case I will use it for a network

waxen plinth
#

Why would you not just use plugin message channels

vocal cloud
#

^

sterile token
#

They want a private cross server core. Without requering online players/sockets/message brokers

#

They have already told me many times that

hexed hatch
#

why do you not want those

sterile token
#

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

vocal cloud
#

So in other words they want a really badly designed system but money is money. shrug1

sterile token
#

Yeah

#

They dont care about m oney

waxen plinth
#

"We don't understand how any of this works but we're going to insist on this pointless implementation detail"

vocal cloud
#

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

sterile token
#

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

vocal cloud
#

All I can say is good luck

sterile token
#

I will use it to pay my treatenent for getting out of drugs

sterile token
vocal cloud
#

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

sterile token
#

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

vocal cloud
#

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

sterile token
#

No it wont need it

#

Cuz on netty you can have múltiple channels

#

And each channel its independient

vocal cloud
#

Yes but in order to use the same port they have to use the same instance

sterile token
#

Yeah. And in the same instance you can have different channels

#

That its the truck

#

Trick*

vocal cloud
#

Yeah good luck. Way above my pay grade to do that kind of work

sterile token
#

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

vocal cloud
#

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.

sterile token
#

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

vocal cloud
#

Is it 1.8 cause 1.8 has no mappings either and no longer has the code base supported

quaint mantle
#

cringe

sterile token
#

It will base base 1.9x because he told me that on 1.8 wont be possible cuz mappings

vocal cloud
#

sigh.

sterile token
#

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

pseudo shore
#

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>
vocal cloud
#

Yeah but if you can't do it you'll have wasted potentially 10s of hours that would have paid 100s of dollars more

vocal cloud
pseudo shore
#
<repository>
            <id>jda</id>
            <url>https://mvnrepository.com/artifact/net.dv8tion/JDA</url>
        </repository>
#

this?

severe oracle
#

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?

quaint mantle
#

maybe chunk loading?

severe oracle
#

doubth it i am in the same chunk

vocal cloud
#

3.x is ancient and might not even work anymore

#

Personally I'd use 5.0.x but it's in alpha so shrug1

severe oracle
#

i dont know i wrote a message on the server and i was able to read it in the console

vocal cloud
#

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

young knoll
#

Maybe the server or client is throwing out a bunch of update packets

vocal cloud
#

allocate that 1mb of ram.

severe oracle
#

1mB?

vocal cloud
#

I'm making a joke ignore me

severe oracle
#

ok

#

i allocated 8GB

vocal cloud
#

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

severe oracle
#

is a proble in this? ``java

undone axleBOT
vocal cloud
#

?paste it

severe oracle
#

?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));
undone axleBOT
vocal cloud
#

I mean put it in the paste bin ctrl + s then send the link

severe oracle
#

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));```
vocal cloud
#

Preferably send the whole function rather than a small snippet. But it's fine

severe oracle
#

this is the function

vocal cloud
#

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

severe oracle
#

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

vocal cloud
#

Ah that's what I wanted to know

severe oracle
#

and for some reason i cant dojava armorstand.getLocation.setX(x)

#

it wont move the stand

vocal cloud
#

Changing the location isn't going to change the location of an entity

severe oracle
#

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));

tardy delta
#

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? 👀

vocal cloud
#

Doesn't ChatColor have a .toString() that does that for you?

tardy delta
#

like this

young knoll
#

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

tardy delta
#

ah wha you cant use static stuff in an enum declaration

tardy delta
#

its an enum

tender shard
#

that just means that MESSAGE_COLOR hasn't been defined at the time you are trying to access it

tardy delta
#

aaah

#

because the enum values are loaded first you mean?

#

it works with a static method instead of field smh 😂

ivory sleet
#

Probably means that MESSAGE_COLOR is declared under CHANNEL_JOINED?

#

no?

tardy delta
ivory sleet
#

Oh

vocal cloud
ivory sleet
#

Fourteen yeah well if it’s the Enum I believe the constants are instantiated before anything else

severe oracle
ivory sleet
#

Applies to static

tardy delta
#

ah thats what i thought

vocal cloud
tardy delta
#

creepy

#

something for halloween

vocal cloud
ivory sleet
severe oracle
#

is it not happy becouse i have a custom model on the armor stand

tender shard
# tardy delta ah thats what i thought
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

severe oracle
tardy delta
#

ah yes

ivory sleet
#

Exactly

#

The game updates just so often

#

20 times a second

severe oracle
#

then why is there a 4-5sec delay ?

tender shard
#

where on earth do you see a 4 second delay?

vocal cloud
ivory sleet
tardy delta
#

maybe 1/3 sec

sterile token
#

Isnt cause he teleporting the srmor stand vía to command?

#

Hum

tender shard
#

also when teleporting the entity to the player location, also add the players current velocity to the destination location

tender shard
#

but it would lag behind anyway

vocal cloud
severe oracle
#

I do:armorStand.teleport(new Location(world, posX + xDist, posY + yDroneRenderDisplacement, posZ + zDist)); and then it 4sec after it spawns

vocal cloud
#

So when it spawns what exactly does it do? Just sit there or is it following something?

severe oracle
#

the plan is to spawn it then make it face the block and then move it forward

vocal cloud
#

that process shouldn't take 5s

tender shard
#

what are you actually trying to do?

#

have the armor stand always at the player location?

severe oracle
#

no

#

have it move to a set location

vocal cloud
tender shard
severe oracle
#

no it spawns at the player location

#

but then it needs to face a specificlocation

#

and then move the amount of blocks towards it

tender shard
#

I have a method to make entities look at a destination location, 1 sec

severe oracle
#

that part works fine

#

it just lags when i try to move it

tender shard
#

I don't get it, I don't see any lag in your video

sterile token
#

Have you tríed to mové it aynx?

#

I always move entities on async

severe oracle
#

?

sterile token
#

I create and teleport npc async

#

That what its im refering

vocal cloud
#

There would be no performance difference between teleporting it async or normally

sterile token
#

I think yes

tender shard
#

teleporting them async would actually be slower

vocal cloud
#

1 entity really shouldn't have a 5s delay

#

async or not

sterile token
tender shard
tender shard
# sterile token Lol really

sure, teleporting it synced does teleport it NOW. teleporting it async teleports it when the scheduler has time

sterile token
#

On the video I can notice the delay

tender shard
#

sorry I thought it was the video of the person who asked

vocal cloud
#

this is my gif

tardy delta
#

this is my gf 😳

vocal cloud
tender shard
#

her arms look weird

vocal cloud
#

She also teleports to anyone who moves so idk if she's loyal

tardy delta
#

so whenever you move you have a girlfriend

#

🙉

sterile token
proud basin
#

Do Text in javafx library support multiple lines?

vocal cloud
sterile token
#

Ah that why you can do that

proud basin
#

Right now im looping through the arraylist and trying to print it in a text but it seems to only display only 1

sterile token
#

Jtx send code

severe oracle
#

i will record a video of the delay

sterile token
#

I think your loops it being stopped or stmh like that

proud basin
#
for (int i = 0; i < playerHand.getArrayList().size(); i++) {
                    lblPlayerCards.setText("Cards: " + playerHand.getCard(i));
}                
sterile token
young knoll
#

Why not use an enhanced for loop

vocal cloud
#

I can't send 3s of video cause it's too HQ sad

sterile token
tender shard
young knoll
#

Wait

vocal cloud
young knoll
#

Why does getArray() return something with a size() method

#

Arrays don’t have a size method

proud basin
#

An arraylist it does

sterile token
#

My monitor is 2480 p I think

young knoll
#

So it’s not an array

tender shard
hasty prawn
#

wtf lol

proud basin
#

I never said an array

#

I said arraylist

young knoll
#

“getArray” implies an array

vocal cloud
proud basin
#

Don't worry about that

sterile token
#

So please name properly your setters ir getter

tardy delta
#

im looking for a good command framework like brigadier

tender shard
young knoll
#

RedCommand, ACF, Cloud

#

Probably like 50 more

sterile token
severe oracle
#

why cant i send the video file over ds ?

young knoll
#

Verify

vocal cloud
#

You're not verified

severe oracle
#

how ?

tender shard
vocal cloud
proud basin
#

verifying is useless

tardy delta
tender shard
young knoll
#

#verification

vocal cloud
young knoll
#

I think that’s the channel

sterile token
tardy delta
#

alr

young knoll
sterile token
severe oracle
#

i dont have spigotmc

sterile token
#

Lol

proud basin
#

done

vocal cloud
#

took 2s to do that

hasty prawn
#

Imagine no embeds

sterile token
#

Asking for help without having account on spigot

tender shard
young knoll
#

Imgur moment

vocal cloud
#

image hosting moment

tender shard
vocal cloud
undone axleBOT
severe oracle
#

as i created an account but they never sent me the activaation code

sterile token
vocal cloud
#

No clue

young knoll
#

Event equals?

tender shard
young knoll
#

Inb4 typo in email

sterile token
#

Yeah like if there is an equals event to the one he using but for 1.8

tender shard
#

the same

young knoll
#

PlayerMoveEvent exists in 1.8

sterile token
#

Ah allright

#

Omg im really stressed

#

Can I ask about scoreboard

severe oracle
#

it says.

Some fields contained unexpected data. Please try again or contact the administrator.
#

but not what fields

vocal cloud
#

Woof I'm actually building 1.8.8 scareDog

sterile token
#

Im confused between scoreboard Objective and team

tender shard
#

ez

young knoll
#

But everyone loves pointless special characters

severe oracle
#

are letters and numbers not ok ?

tender shard
#

of course they are

sterile token
severe oracle
#

why doesent it let me register then?

sterile token
#

Have you check the email is correct

severe oracle
#

it is correct

sterile token
#

Slemtimes the website get big

#

Bug*

smoky oak
#

why is haste 'FAST_DIGGING'?

#

is there any reason for that?

tender shard
#

the registration works fine

vocal cloud
#

That looks laggy asf lmfao

severe oracle
#

indeed

#

but tps is 20

young knoll
spiral light
young knoll
#

You can always use the getByName or getByKey methods instead

smoky oak
#

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?

young knoll
#

I’d call the event if you want compatibility

tender shard
young knoll
#

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

vocal cloud
#

Gotta either recall the event or

young knoll
#

Or just don’t

vocal cloud
#

Just don't™️

visual tide
vocal cloud
smoky oak
#

how do i actually call a event?

visual tide
#

pluginmanager.callEvent

smoky oak
#

like i can initialize it but it hasnt happened

vocal cloud
#

Bukkit.getPluginManager().callEvent();

tender shard
#

calling an event does nothing by itself

vocal cloud
smoky oak
#

well what i expected happened

tender shard
#

it only notifies other plugins that this event was called, that's everything it does

severe oracle
#

do you know why does the delay occur ?

tender shard
smoky oak
#

but im a bit concerned since the blockbreakevent and the ItemDropEvent aren't linked

vocal cloud
#

1s there is documentation on this

#

?jd

vocal cloud
severe oracle
smoky oak
#

so set to air then call the BlockDropItemEvent?

young knoll
#

Why set to air

smoky oak
#

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.

young knoll
#

You can just set stop items to false in the event

#

To get rid of the base drops

smoky oak
#

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

severe oracle
#

so any ideas why is the move delay so big?

tardy delta
#

because its not c++

severe oracle
#

unfortnatly

young knoll
tardy delta
smoky oak
#

i fear i need more context than that

severe oracle
#

but it would be compiled and not ran as interpreter

young knoll
#

What more do you need

#

Use that method to get your item

#

Java isn’t quite compiled

smoky oak
#

i have no idea what you mean by that and my World. doesnt have that method

young knoll
#

Big it’s definitely not interpreted

smoky oak
#

also i dont want to drop an item at those coordinates

quaint mantle
smoky oak
#

i want to call the BlockItemDropEvent

smoky oak
#

yea

#

no

#

i need the event

young knoll
#

You need to drop an item to call the event

#

The event requires an item spawned in the world

quaint mantle
#

Teleport were meant to be used in movements longer than 8 blocks

tardy delta
smoky oak
#

ah that would explain it

pseudo shore
#

How will be to add a command with argument?

tardy delta
#

how will wha-

#

you want to register a command?

pseudo shore
#

yes, but it requires an argument

tender shard
#

lets stop sending code snippets and use QR codes instead

pseudo shore
#

like /command myArgument

tardy delta
#

just register the command name and set an executor for it which handles any possible subcommands

tender shard
tardy delta
pseudo shore
vocal cloud
sly trout
#

why does InventoryClickEvent get called 2 times? i click one time and it calls the Action PlaceAll 2 times

#

why does it do dat

smoky oak
#

on mouse click and on mouse release

sly trout
#

oh

tardy delta
#

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")

sly trout
#

it does both when i release the mouse

smoky oak
#

one sec

vocal cloud
#

?jd

smoky oak
#

for some reason it only triggers once for me

tardy delta
sly trout
#

InventoryClickEvent e

#

is the event i use

smoky oak
#

can u post the code in ` brackets?

sly trout
#

is what it prints when i click once

tender shard
#

is there a way to detect it when villagers throw crops at each other etc?

#

like some VillagerDropItemEvent

smoky oak
#

i kinda need the code to know whats happening here @sly trout

tender shard
#

?paste

undone axleBOT
smoky oak
#

just copy paste the entire @EventHandler method

tender shard
vocal cloud
#

Cause like it looks like it's for death only but it's says creates a drop very confusing

tender shard
#

hm 😦

sly trout
#

sef

#

ok finaly

#

there is my code for inventoryClickEvent

#

everytime i click once it triggers two times the event

tardy delta
#

i forgot but will assert throw an AssertionError if it fails?

vocal cloud
#

Yes.

#

inventory click event I believes can fire multiple times because holding it down sends it more than once. I might be wrong tho

eternal oxide
sly trout
vocal cloud
#

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.

smoky oak
#

i dont know what you're doing but it only fires once for me if i use your code

sly trout
#

nope only registered once

tender shard
#

it also fires once for me

#

what server software are you using?

sly trout
#

oh my fuckjing god

#

so it triggers twice when ur in creative?????

sonic goblet
sly trout
#

when im in survival it triggers once

sonic goblet
#

lol ya

sly trout
young knoll
#

Creative is jank

vocal cloud
#

Creative has an inventory event for itself I believe

sly trout
#

alright so i just have to disable it

vocal cloud
smoky oak
#

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

sly trout
#

?

#

its the same event twice for me

#

PLACE_ALL

sterile token
#

Hi I have a question. Its possible to use an standar time!

#

Like UTC 00:00

vocal cloud
sterile token
#

Ah they are called ZoneDateTkme

#

Explain cuz im interésted

vocal cloud
#

It allows you to select what zone you want the time to be in.

#

So you can use UTC

sterile token
#

Allright

#

UTC 00:00 it the PM ESt formar right?

vocal cloud
#

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

sterile token
#

PM EST format it UTC 00:00?

#

Or they are different

vocal cloud
#

I don't get what you're trying to say. Run some tests you'll figure out how it works

sterile token
#

Because i need a way to show dates/times that player can understand

vocal cloud
#

You can format it using a DateTimeFormatter

sterile token
#

Ah allright

#

But it will formated to their time zone or UTC 00:00?

tender shard
vocal cloud
sterile token
#

Yeah that what

#

Its possible to get their time zone!

#

That is what I cannot find info

sly trout
sterile token
#

I tríed with Player but i didnt find anything

vocal cloud
sterile token
sly trout
#

bruh

sterile token
#

I have seen a plugin on spigot that trace ir ip and post it on website

vocal cloud
sly trout
tender shard
sly trout
#

yes

#

i know

sterile token
#

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

sterile token
#

Omg

vocal cloud
#

I mean you could use some API to do it but that's kinda creepy imo

tender shard
#

you can use geo ip to get a rough estimate about where the IP might be

sterile token
#

Lovely yeat. I wish you could get their time zone vía Player Object

#

It would be really useful

tender shard
#

it's fucked up often and gives wrong information and it also won't work for people using any foreign VPN / proxy

sterile token
#

Yeah

tender shard
#

there is no way to properly get the location of an IP

sterile token
#

So i should use one format

#

Like UTC 00:00

tender shard
#

just let players choose their timezone

vocal cloud
#

But yeah just let players set it

sterile token
vocal cloud
#

Less creepy

#

And way more stable

sterile token
#

Default UTC 00:00

#

Wait

tender shard
#

I'd just use a GUI with some heads representing country flags

sterile token
#

Isnt it the same UTC 00:00 and PM EST

vocal cloud
#

UTC can't be the same as EST that's not how it works

#

UTC is 5 hours ahead of EST

tender shard
sterile token
#

The default time which is?

vocal cloud
#

For what?

tender shard
#

"PM"? "00:00"?

sterile token
#

For every country it should be a base

tender shard
#

UTC is a timezone, no idea what "UTC 00:00" should mean

#

EST is a timezone too, but "PM EST"? what's that?

vocal cloud
#

No country has a default per se

tender shard
vocal cloud
#

North Americans fall across 3+ time zones

sterile token
#

I thought the default time was UTC 00:00 and every country add more or take more hours

#

Do undrstnad me?

tender shard
#

this makes no sense lol

sterile token
#

Hum in confused

vocal cloud
#

UTC is the base in which every other timezone is detracted from

sterile token
#

I thought there was a time standard Where depending the country it add or take hours

#

Thst what im making reference

tender shard
#

yes that's UTC

sterile token
#

So why you said no before

#

😂

tardy delta
#

i coded a while with this theme 😳

vocal cloud
tender shard
spiral light
tender shard
#

right now it's 18:38 CET or 17:38 UTC

sterile token
#

UTC 00:00 its the base for every country

tender shard
#

NO

#

that makes no sense

#

UTC 00:00 means midnight in england

vocal cloud
#

UTC + 0 is UTC

tender shard
#

yes

#

but not 00:00

#

that makes no sense

vocal cloud
#

UTC - 5 is EST

tender shard
#

00:00 UTC is a specific point in time

sterile token
#

For example some country it is UTC +5

#

Ahh allrgiht

#

I was really flncused

vocal cloud
#

UTC +5 would mean that if UTC was 00:00 that the other would be 05:00

sly trout
#

is there a method to get the drops from BlockBreakEvent

sterile token
#

Lmao imagine having me in a class you will take out from the class

#

Jajaj

tardy delta
sly trout
#

or any way of getting drop from a block break

#

bruh

tender shard
#

no

sly trout
#

what

vocal cloud
#

You need to use blockdropevent

tender shard
#

there is a method to get what it "normally" drops

vocal cloud
#

Or whatever it's called

tender shard
#

TL;DR there is NO way to reliably detect what items will be spawned when a block is broken

sly trout
#

ye that's not the problem

vocal cloud
sterile token
#

The default format should be:

UTC hh:MM:ss right?

tender shard
#

if you don't care about other plugins, just BlockDropItemEvent

vocal cloud
sterile token
#

I want the default time format be in UTC and displaying time in pm/am

#

Understand?

vocal cloud
#

Yes but again we've been over this used ZonedDateTime

#

Read the docs on it

sterile token
#

Its ZoneTimeZone or ZonedTimeZone?

#

Humm

spiral light
#

tryandsee moment

vocal cloud
#

Not reading what I'm saying moment

hybrid spoke
sterile token
#

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

waxen plinth
#

Fuck me how many date and time libraries does java have

#

Instant, Calendar, DateTime, ZonedDateTime, LocalDateTime, what am I missing

pseudo shore
#

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>
waxen plinth
#

You didn't indent it

#

It should be

#
commands:
  test:
    description: Test
    usage: /<command>```
pseudo shore
#

i did that

#

was discord that moved it

waxen plinth
#

Then show the entire plugin.yml

pseudo shore
#
name: Test
version: '${project.version}'
main: test.mod.Main
api-version: 1.18
authors: []
commands:
  test:
    description: Test
    usage: /<command>
waxen plinth
#

Ok and let's see the main class and command executor

pseudo shore
#
@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;
    }
waxen plinth
#

You're doing getCommand("discordwl reload")

#

Not getCommand("test")

pseudo shore
#

oh

#

no

waxen plinth
#

Also, you can't do getCommand("discordwl reload") to begin with

#

Subcommands do not exist in the standard spigot command library

pseudo shore
#

Also to set permissions how will it be? the docs only says yourplugin.yourcommandpermission and nothing more about it

sterile token
#

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

tender shard
#

or requiring permissions?

pseudo shore
#

i guess both, i want only the OP players be able to execute that command

tender shard
#
commands:
  test:
    description: does stuff
    permission: any.permission.you.like
#

that's it

smoky oak
#

huh now that i think about it

#

can you set a permission to be 'by default' the same as another permission?

tender shard
#

permissions are by default given to ops

#

you can make them default for every player like this

#
permissions:
  any.permission.you.like:
    default: true
bronze notch
#

Question, is it still a good thing to support Votifier as a vote receiver, or is it time to move on?

smoky oak
#

i know that

tender shard
#

I see nothing wrong with Votifier

smoky oak
#

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

bronze notch
#

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.

tender shard
#

oh

#

I was actually thinking of NuVotifier

#

yes, regular votifier is dead

bronze notch
#

So support should be dropped I guess then 🙂

tender shard
#

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

#

😄

fleet epoch
#

Can a minecraft UUID be longer or shorter than 32 characters?

kind hatch
#

No

#

Minecraft uses the UUID class provided by Java itself. It isn’t going to change anytime soon.

quaint mantle
#

this will conflict with actual damage knockback IIRC

spiral light
#

hack client

tender shard
#

yeah as said, then switch the locations 😄

#

replace victim.getLocation() with attacker.getLocation() and vice versa

grim ice
#

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?

spiral light
#

no

#

there is always a chance that you get a duplicate

tender shard
grim ice
spiral light
#

yeah well if you generated and saved all those ids yes

tender shard
#

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?

grim ice
quiet ice
grim ice
#

that this the amount i just said

quiet ice
#

So this number is def. wrong

grim ice
#

oh

spiral light
grim ice
#

right

#

wait its not

#

lmao

spiral light
#

and then you have to use that (max=500) /500 and from that the sin ?

grim ice
#

wait it is

#

shit

grim ice
dull whale
#

I want floating mobs, their AI should just work fine in air is that posibble

quiet ice
#

It is two longs, so 2 * 64 bits

spiral light
#

sooo some kTB ?

grim ice
#

you are wrong i think

quiet ice
#

    /*
     * 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

grim ice
#

oh ok

quiet ice
#

Java happily allows this in this UUID(long, long) ctor

tender shard
quiet ice
#

Of course, not a valid UUID, but technically allowed

tender shard
#

like a sin wave

tender shard
#

thanks I'll try something

grim ice
#

then its 3402823700000000000000000000000000000000000000

quiet ice
#

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

grim ice
#

aka 3.4 Quattuordecillion

#

4253529624999999400000000000000000000000000000000 terabytes worth of uuids

#

aka 425352962500000016000000000000000000000000

#

yottabytes

spiral light
#

google has that amount for sure

grim ice
#

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

ivory sleet
#

Probably patch nms to some degree

#

Like 2Hex said, their own fork

#

Possibly not their own fork, just bytecode manipulation

tender shard
ivory sleet
#

That’s an understatement

#

Maybe this is the day you’ll gain that experience

spiral light
ivory sleet
#

I don’t know. You must define better first…

ivory sleet
#

You probably need to create an account on their stash and get accepted

#

Then clone to ur desk

grim ice
#

its prob hard too

brave sparrow
#

You have to clone it and use the tools included to apply the patches

wet breach
#

each object has a 12byte header which is then padded to a multiple of 8bytes

sly trout
#

how do you send a message in the same format as the block height limit messsage?

wet breach
#

therefore a minimum size an object can take up is 16 bytes @quiet ice 🙂

sly trout
#

like above the hotbar

dense geyser
wet breach
grim ice
#

prob not

cold pawn
#

Anyone have a solution to this?

grim ice
#

max uuids being generated is

#

2^122

#

he told me its 2^128

ivory sleet
#

Doesn’t that depend on version?

wet breach
wet breach
fleet epoch
quaint mantle
eternal oxide
#

?xy

undone axleBOT
lyric oar
#

Hello, is it possible to display a text on a block?

dusk flicker
#

holograms

fleet epoch
#

mysql

buoyant viper
#

varchar(36) Chad

#

or 32, if u strip the hyphens

fleet epoch
#

thing is i don’t think it returns the uuid without the hyphens

#

so i’ll just do 36 to be safe ig

quaint mantle
#

Cool people use BINARY(16)

tardy delta
#

varchar(36) kekw

fleet epoch
#

yes but non-cool people in your class have no idea what the fetch those are lol

quaint mantle
buoyant viper
quaint mantle
#

you can store it in 16 bytes

fleet epoch
buoyant viper
#

uuid cant be longer than 36 p sure

quaint mantle
#

Strings are fat af

fleet epoch
#

kew

buoyant viper
quaint mantle
#

16 bytes vs 72!

idle grotto
turbid grove
#

which java library do mc servers use for cli tab completion?

spiral light
turbid grove
#

maybe they did

#

how could I create a tab completion system like that from scratch?

#

use JNI binding for gnu readline?

smoky oak
#

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

wet breach
turbid grove
#

I think you guys misunderstand what I mean

wet breach
#

But MC uses Brigadier for its improved chat completion/suggestion

turbid grove
#

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

spiral light
#

code it yourself O.o

smoky oak
#

press f4

spiral light
#

thats not even hard to do

turbid grove
spiral light
#

check what cmd is typed

#

get the cmd's args and get the cmd + args next possible args