#help-development

1 messages ยท Page 1538 of 1

wraith rapids
#

which i think is a huge oversight

#

and shouldn't be the case

vital ridge
#

how can I export the maven project? I'm following a tutorial but I dont have the options he does

boreal sluice
#

can someone help me ?

wraith rapids
#

helping is forbidden

eternal oxide
#

Right hand side window marked Maven, lifecycles

quiet ice
#

The jars will be produced in the target folder

quaint mantle
#

Bump! (Of course, I don't want to use any api that includes worldedit, fawe)

earnest sonnet
#

then you will have to create your version of it

#

at least certain features

hardy swan
#

Will need to have maven jar plugin

dusty herald
quiet ice
dusty herald
#

should i make my new plugen premium

earnest sonnet
hardy swan
dusty herald
earnest sonnet
#

neither premium I think ? aren't they all under the license: "feel free to use it and do what ever you want, but it's not my problem if something goes wrong?"

hardy swan
earnest sonnet
#

Outside of that scope, nope

hardy swan
#

Wait

#

That wtf actually stands for what the fuck

#

Wow

quiet ice
#

yes

#

well, actually "whatever the fuck"

hardy swan
#

Right

crude hound
#

hi, I need to know how to get all item id (not in upper case) because Material.getId() is deprecated

quiet ice
#

What should the return type be?

#

int or String?

#

If String it is toString or name, if int it is reflection ahoy

hardy swan
#

I think string hence the bracket

dusty herald
hardy swan
quiet ice
#

or name

crude hound
#

II just need the minecraft:stone in str

tardy delta
#

is someone using updater to update their plugin? i cant find the artifact

quiet ice
#

Yeah, then you do not search for the int id

hardy swan
#

But he is asking how then haha

quiet ice
#

Remind me to never try to auto-complete the material class

earnest sonnet
#

there is a reason that it's deprecated

quiet ice
#

.getId WILL always throw an exception on 1.13+

jagged monolith
#

Id's aren't used anymore, They use the enum values now

quiet ice
#
    public int getId() {
        org.apache.commons.lang.Validate.isTrue(this.legacy, "Cannot get ID of Modern Material");
        return this.id;
    }
quiet ice
#

I do not even know what these IDs are

boreal sluice
#

how can i know if the player press a key in spigot

quiet ice
#

But to get back on track, use Keyed#getKey() for your stuff

quiet ice
dusty herald
#

I mean you could tell if they press certain keys though

#

not the entire layout tho

earnest sonnet
quiet ice
#

nah

earnest sonnet
quiet ice
#

Materials like Tuff have their IDs defined

earnest sonnet
dusty herald
#

yeah

quiet ice
#

Cobbled deepslate for example has an id of 8021, Tuff an id of 24364 and dripstone block an id of 26227. It makes no real sense to define the IDs if there are not used anywhere

tardy delta
#

for some reason it cant find updater

quiet ice
crude hound
#

oh thx

vital ridge
#

Im using maven, after building my maven project, the target folder doesnt appear in my project files

#

How can I make it appear?

tardy delta
#

package it

vital ridge
#

I just drag and dropped the jar from some other target folder to my plugins folder

tardy delta
vital ridge
#

and then when i started the server i got an error

quaint mantle
quiet ice
earnest sonnet
#

Try to clean, some times it works no clue why

vital ridge
wraith rapids
#

inb4 not imported as a maven project

tardy delta
#

are you using intellij?

quiet ice
#

yes

vital ridge
#

y

boreal sluice
#

how can i know if the projictile hit a player or a block ?

tardy delta
#

on the right side

#

click on maven

vital ridge
#

Okay i did

#

i double clicked on the package

#

aswell

#

Ill try building again

wraith rapids
#

you don't build

#

you run maven goals

#

by doubleclicking the goals in the lifecycle menu

#

namely package

#

which shits out the jar to /target

tardy delta
#

wait for build success

vital ridge
#

yeah i did as yall said

#

im getting build success

#

but no target folder

dusty herald
#

top-right -> click this little shit

#

type mvn clean package

quiet ice
#

them mv target C:/

#

and you have your jars on your C drive

dusty herald
#

goel no

#

๐Ÿ˜ 

tardy delta
#

omg light mode

dusty herald
#

not light mode

tardy delta
#

kinda

dusty herald
#

eclipse

eternal night
#

god is dead

#

after seeing that

vital ridge
#

no target folder still, it gives me a few warnings when building, idk if that is important but here:

[INFO] --- maven-compiler-plugin:3.1:testCompile (default-testCompile) @ maven ---
[INFO] Nothing to compile - all classes are up to date
[INFO] 
[INFO] --- maven-surefire-plugin:2.12.4:test (default-test) @ maven ---
[INFO] No tests to run.
dusty herald
#

eclipse_theme is the perfect light theme

#

you cannot change my mind

eternal night
#

Nietzsche was right

dusty herald
#

dark theme just makes me depressed

eternal night
#

he saw this coming

earnest sonnet
#

I like dark, but not all the time

dusty herald
#

I do too but

#

eclipse_theme ๐Ÿ™‚

vital ridge
#

oh nevermind

#

my maven worked

#

liked 30 minutes ago

dusty herald
#

๐Ÿ™‚

vital ridge
#

the error was from other plugin

earnest sonnet
vital ridge
#

thanks

earnest sonnet
#

๐Ÿคฃ

dusty herald
hazy rock
hardy swan
#

Dark theme is mood

#

No hacker in films uses light

dusty herald
#

i know one

rotund pond
dusty herald
#

yeah but the light eclipse theme is the best theme

crisp citrus
rotund pond
#

So you can choose a better one

dusty herald
#

im using intellij

rotund pond
#

Same

dusty herald
#

yes

#

i know

#

im using one now

rotund pond
#

๐Ÿ‘

hardy swan
#

Guys, hear me out

#

Vim

earnest sonnet
# hardy swan Vim

Vim is my text editor of choice, but not when it comes to programming

dusty herald
#

nano is mine

hardy swan
#

Programming with vim makes you look pro

#

Or nano

toxic mesa
#

So i'm using 1.12 and used this code;

            BlockState blockState = block.getState();
            Door door = (Door) blockState.getData();
            if (!door.isOpen()) {
                door.setOpen(true);
                blockState.update();

Which works fine, but after this i wanted to close it again after 3 seconds so i used a schedular.

        new BukkitRunnable() {
            @Override
            public void run() {
                    BlockState blockState = block.getState();
                    Door door = (Door) blockState.getData();
                    door.setOpen(false);
                    blockState.update();
            }
        }.runTaskLater(this.plugin, 60);

Can anyone explain why this doesn't work? Oh and yes this is in a different method so that's why I declared the bockstate ect again

dusty herald
#

programming with nano makes you look like a fucking madman

hardy swan
#

It is all about looks

#

stop relying on ides

earnest sonnet
#

@toxic mesa next time please use ?paste

toxic mesa
#

good point

summer scroll
#

I'm trying to hook SlimeWorldManager with SuperiorSkyblock, but I got an issue, basically on island creation, SuperiorSkyblock will call a method to get a location from the world, but the world hasn't loaded yet so the location will always be null, how can I fix it?

Method that will be called on the island creation: https://paste.md-5.net/vipaxevoko.cs

earnest sonnet
#

I'll ask the obvious, but is the block the same ?

toxic mesa
#

yup

#

That's why im confused, the method is triggerd and all, but it just doesnt close the door

earnest sonnet
#

can you try to interact with in another way to see if it's going to be updated? e.g put a block above it or something

#

After the 3 seconds

toxic mesa
#

Already tested that, doesn't close the door

dusty herald
#

have you tried debugging it to make sire it's actually being ran

toxic mesa
#

yup

earnest sonnet
#

why are you using this.plugin ?

dusty herald
#

setBlockData()?

toxic mesa
earnest sonnet
#

use a scheduler I guess to check later

summer scroll
#

What do you mean?

dusty herald
#

what

#

oh

#

yeah aglerr, try loading it later on? like delay the code execution a bit

toxic mesa
#

?paste

undone axleBOT
earnest sonnet
dusty herald
#

Bukkit.getScheduler().runTaskLater

toxic mesa
dusty herald
#

try setting the data then updating the door

toxic mesa
#

aight

summer scroll
dusty herald
#

wait a bit

#

run the code

#

that's it

#

ohh

summer scroll
#

Are you trying to say I have to modified the SuperiorSkyblock source code?

dusty herald
#

when are you loading your plugin in

earnest sonnet
toxic mesa
dusty herald
summer scroll
toxic mesa
#

using 1.12.2

summer scroll
#

Oh well, I don't know if Openable is exist on 1.12.2

summer scroll
dusty herald
#

try loading at STARTUP

#

i mean

#

POSTWORLD

#

idk ive never used them before

summer scroll
#

It's not the problem on that, the plugin register successfully, without errors.

dusty herald
#

i didn't say it did

summer scroll
#

So basically a world will be created everytime player create a new island.

quaint mantle
dusty herald
#

show me your codes

summer scroll
#

And SuperiorSkyblock trying to get a Location from that world, but the problem is the world hasn't loaded/created yet.

quiet ice
#

You could split the lines and write the individual lines as individual messages

dusty herald
#

๐Ÿคท I guess look into CompletableFutures

#

I like to use StringBuilder and append new lines for new mesasges

summer scroll
#

Will it delay the method?

quiet ice
#

futures are most often delayed

summer scroll
#

I want something like this

public Location getLocation(){
  SlimeWorld slimeWorld = createSlimeWorld(...);
  // wait after world created
  World world = Bukkit.getWorld(slimeWorld.getName());
  Location location = ...
  return location;
}
tardy delta
hardy swan
#

I dun think should use completablefuture in hope that operation is delayed, not what cf is

dusty herald
tardy delta
#

smh

#

๐Ÿ˜‚

summer scroll
hardy swan
#

Not really, unless there is an event that triggers when the world loads

#

Then you can use that

dusty herald
summer scroll
#

Well, I found another alternatives. Thread#sleep

dusty herald
#

that's a great alternative :D

#

for broken shit

hardy swan
#

dont sleep server thread pls

dusty herald
#

do it

#

it'll stop worlds from loading so you'd still be in the shitstorm you're in now though

tardy delta
#

whats even the best way to use an updater in your plugin?

earnest sonnet
#

๐Ÿคฃ don't tell him to do it when you know it's not a good idea

quaint mantle
#

Hello! How to get Blocks Enum as a List<String>? (Blocks Enum doesn't have values())

tardy delta
summer scroll
summer scroll
#

i was just joking

quaint mantle
tardy delta
#

.values()

quaint mantle
#

nop, they haven't

#

Blocks.values();

tardy delta
#

uh

quaint mantle
#

It doesn't exists

hardy swan
#

Why List<String>

#

What are you trying to achieve

earnest sonnet
#

Use Set for that and someone had the same problem as you a while ago, just scroll up

#

he gave the solution too

earnest sonnet
tardy delta
#

make an EnumSet?

summer scroll
#

Material#isBlock and Material#values should be enough.

eternal oxide
#

I'm guessing he's actually wanting the name of all Materials that are blocks

dusty herald
#

Materials#values returns all materials, not just blocks

hardy swan
#

But you know, filter

dusty herald
#

then you might as well make your own enum ๐Ÿค”

#

๐Ÿ˜‚

hardy swan
#

As in filter with isblock

earnest sonnet
#

someone uploaded a solution using streams

hardy swan
#

Streams way to go

earnest sonnet
crisp citrus
#

when a player is banned, does it trigger a PlayerQuitEvent or a PlayerKickEvent?

quaint mantle
hardy swan
#

Kick iirc

crisp citrus
#

thank

eternal night
#

should trigger both no ?

eternal oxide
crisp citrus
#

how would you differentiate them tho

quaint mantle
crisp citrus
#

oh shd i just not differentiate during the event, andd instead on the command

eternal oxide
quaint mantle
#

here you go

earnest sonnet
#

Why NMS?

#

and when you use NMS please specify it

quaint mantle
eternal oxide
#

I see Block I dont see Blocks

earnest sonnet
earnest sonnet
#

I can't help you when it comes to NMS, sorry

eternal oxide
#

Yes, in nms I see Block import. I don;t see Blocks

earnest sonnet
quaint mantle
#

hmm thanks you guys

#

but don't I have soultion?

eternal oxide
#

Blocks does not seem to be a valid nms import, but why are you using nms?

quaint mantle
#

private static void setBlock(org.bukkit.World world, Location location, net.minecraft.server.v1_15_R1.Block block, boolean applyPhysics)

hardy swan
#

Block

hybrid spoke
#

1.15.1

#

why

quaint mantle
#

but idk why it's 1_15_R1

quaint mantle
eternal oxide
#

((CraftBlock) block).getNMSBlock; No idea for 1.15

#

However I find it unlikely that method actually wants a NMS block as it accepts a Bukkit world

hardy swan
#

^ but if this method comes from worldedit's api or sth, they prob have another method to handle the conversion

quaint mantle
eternal oxide
#

None of that is worldedit

#

You are also going to find none of those examples update lighting

summer scroll
edgy goblet
#

anyone know if i can disable collision between a few select mobs and none others

#

preferably without teams so i dont touch teams set up by players or other plugins

hoary knoll
#

how do you do the equivalent of a 'move' command using the worldedit api?

eternal oxide
#

ask in their discord?

quaint mantle
#

MainMenuGUI.getType().getDefaultTitle();

wet breach
quaint mantle
#

what is the way to get title of an Inventory

hoary knoll
#

nvm i worked it out

#

move as in //move

wet breach
#

its just cut and paste ๐Ÿ™‚

#

instead cutting you just shift everything instead

hoary knoll
#

ok?

minor garnet
#

16.67 ms is how many ticks?

quaint mantle
#

sorry I was small brain

quiet ice
minor garnet
#

what

#

there is no 16.67 milliseconds in ticks?

#

Run the loop on another thread and have the loop run once every 16.67 ms

quaint mantle
#

is there some way how would i make this?

&cEmail: &f%emailStatus% <-- replace the %emailStatus with TextComponent clickable?"
frosty tinsel
tardy delta
#

does Bukkit.getLogger().info() supports colors on cmd?

tardy delta
#

with ChatColor.COLOR or what?

quaint mantle
#

you could do ยง

frosty tinsel
frosty tinsel
tardy delta
edgy goblet
#

is there a way to disable for players too? sorry i worded my question poorly

noble spire
#

What's the best way to make multiple config files with custom names, do spigot have a method which allows multiple config files? Or should I use just plain java and write a algorithm that makes a yml file, writes to it, reads from it or use a library?

noble spire
#

cheers

#

Are you sure it's not just a coincidence?
Nothing there looks like it'd make that happen

#

nice

minor garnet
#

runTaskAsynchronously runs in how many milliseconds?

earnest sonnet
#

yeeeep, but 1 tick = some milliseconds or something

noble spire
minor garnet
#

i think not

earnest sonnet
#

yes ๐Ÿ˜„

noble spire
#

1 tick = 1/20th of a second

earnest sonnet
#

full code

#

?paste

undone axleBOT
minor garnet
minor garnet
noble spire
#

?jd

minor garnet
#

tf

noble spire
#

I'm looking at the docs ๐Ÿ˜”

#

idk

quiet ice
#

So you want to run something every 16.67 ms?

eternal oxide
#

why is 16.67 so important?

quiet ice
#

In that case, you would need to write your own scheduling logic (java.base should provide it already though!) - just beware that it is pretty much impossible to sync with bukkit, so do not run anything that requires bukkit in it

minor garnet
#

no important

eternal oxide
#

ExecutorService

#

its not important?

minor garnet
#

just curiosity

#

no

quaint mantle
#

1 tick is 50ms

maiden briar
#
try
{
  try
  {
    //TRY
    //Exception
  }
  catch(Exception e)
  {
    //Catch
  }
}
catch(Exception e)
{
  //Catch
}
finally
{
  //Finally
}

IF there is an exception in the innner try/catch, will it then always run the last finally ?

quaint mantle
quiet ice
#

read up

noble spire
#

because no execption is called in the outer try/catch

maiden briar
#

Ah I understand

#

So I have to add to both finally

noble spire
#

yeah, or just get rid of the inner try/catch

#

because it'll be caught by the outer one

maiden briar
#

No I need that

#

But thanks for the help

noble spire
#

okay...

earnest sonnet
quaint mantle
#

Lol 16.67 ticks what on earth

noble spire
earnest sonnet
noble spire
#

yeah, for some reason I thought it would be ran only if some exception was called, I'm tired lol

noble spire
earnest sonnet
maiden briar
#

Oh ok, so it will always run the last finally?

noble spire
#

yes

earnest sonnet
maiden briar
#

Ok thx

earnest sonnet
#

I didn't see that msg ๐Ÿคฃ sorry

#

would've answered otherwise

quaint mantle
minor garnet
#

just optimizing a code

earnest sonnet
#

20 ticks = 1 sec, uhmm good luck ๐Ÿคฃ

quaint mantle
#

Wdym?

#

What does that optimize

#

And what are you trying to loop on another thread again?

minor garnet
minor garnet
#

by a guy who offered me a guide on how he has made a system

earnest sonnet
#

do you want to describe your problem so we can contribute our thoughs ?

minor garnet
#

let me show

earnest sonnet
#

brb 5m

quaint mantle
#

Ah well you can run it for 17 ms in the task

#

Same thing

minor garnet
#

obviously there were some changes, but the basics are the camera movement

#

i don't know if the camera would get stuck?

earnest sonnet
#

that's interesting in it's own way

earnest sonnet
minor garnet
#

17 ms is how many ticks xddd

#

because

#

1 tick = 50 ms

#

i cant do a 17 ms

eternal night
#

Thread.sleep can do approx 17ms

minor garnet
#

joke

earnest sonnet
#

NMS

#

and pathfinding

#

Yes, but you can use inheritance to make it way easier

#

hmmm, maybe there is a way around it, but if you go creating thousands of entities just go and make a standalone game

summer scroll
#

How about using MythicMobs?

eternal night
#

the hypixel server is so far from spigot/paper/vanilla basically it is its own game

earnest sonnet
eternal night
#

So yeah gl with thousand of custom entities ๐Ÿ˜‚

summer scroll
#

it's gonna be interesting to see thousands of classes

earnest sonnet
#

re-write part of the NMS then

#

you can do it for certain things, like damage, speed and what not as far as I know, but there are limitations

#

not only that, you will have to do it again in each minecraft version

#

and if you want each entity to have different AI, yea, forget it

maiden briar
#

new ProcessBuilder("sh", "", scriptFile.getAbsolutePath()).start(); I can't run a sh file, I am 100% sure the file exists

eternal night
#

what is the magical empty string at index 1 ?

maiden briar
#

I can't put null

earnest sonnet
maiden briar
#

I don't know

eternal night
#

sh on a windows machine

#

lmao

maiden briar
#

System can't find the pad

maiden briar
eternal night
#

windows does not have sh by default

maiden briar
#

What can we do else?

eternal night
#

not call a sh script in the first place

#

why not just create the logic in java

maiden briar
#

I use it to remove a old plugin file

eternal night
#

you can do the same with java ?

maiden briar
#
rm "CustomMOTD.jar"
rm "TvheeAPIUpdateScript.sh"
maiden briar
#

After an update I try to delete the old file

eternal night
#

aren't there like 5 million "auto update" java snippets on spigot

maiden briar
#

Ok show one then

eternal night
#

I don't know why you are trying to reinvent the wheel using sh files

#

there is even one on the fucking wiki

#

damn, did you not look into this at all ?

#

gradle has great documentation

#

probably a lot more effective to read than to have the high quality spigot dev community try to help you

#

what ?

maiden briar
ivory sleet
#

Thereโ€™s an option for it

#

CopyOption... or smtng

eternal night
#

tho, overwriting your own jar while it is loaded. You gotta be very very careful

maiden briar
#

Yes I disable it first

ivory sleet
#

Uh

#

I have a starter guide

maiden briar
#

But I can download the update, rename, disable current plugin, enable new plugin, but I can't remove the old jar file

wintry haven
#

How do I uninstall a plugin?

maiden briar
#

Remove from /plugins ?

ivory sleet
#

@quaint mantle

wintry haven
maiden briar
#

Report yourself

#

At the pluginpage

wintry haven
summer scroll
vital ridge
#

How are big plugin MySQL databases working?

#

Like is it only the plugins owner localhost based database

#

So they have to enter their information in the config?

#

And then start their XAMPP everytime they start the server?

eternal night
#

authentication information is usually supplied through a configuration file yes

earnest sonnet
#

yea, that's what I'm doing in my plugins

eternal night
#

where the SQL database is hosted is up to the administrator

vital ridge
#

So they have to start their xampp everytime?

eternal night
#

no one uses xampp for SQL

earnest sonnet
eternal night
#

even on there, docker container exist

vital ridge
#

Docker container?

earnest sonnet
vital ridge
#

No idea whats this xd

ivory sleet
#

Our life savior

eternal night
#

very lightweight virtualisation technology

#

but if you are running a production server on your local windows computer you have bigger issues anyway

vital ridge
#

Na im just trying to create a plugin with mysql database

#

but i was just wondering how it works then cuz all tutorials use xampp

earnest sonnet
#

then yea, xampp will do for now

vital ridge
#

But when i want to release the plugin?

#

Then how people will be able to access the database?

#

I mean they all aint gonna download xampps i assume?

vital ridge
#

Im just wondering, all the tutorials showed xampp only

opal sluice
#

That's a way to create a db

vital ridge
#

So im kinda stuck rn

opal sluice
#

You don't need XAMPP

#

The plugin just needs to connect to a db

#

with the credentials you'll give in the config or hardcoded in the plugin

maiden briar
unreal quartz
#

linux does not lock the jar file so it's a non issue in the first place

vital ridge
eternal night
#

with whatever credentials they supply

opal sluice
eternal night
#

to whatever database they run

maiden briar
vital ridge
#

So they dont need xampp?

opal sluice
vital ridge
#

If they want to access the database then they need xampp?

opal sluice
unreal quartz
vital ridge
#

But like why is the xampp even here there?

#

then*

opal sluice
#

Cause making a database without it it's pretty much a pain in the ass

#

And so, you use it to set it up easily

vital ridge
#

So I dont need a xampp at all I can just do everything but without the xampp?

earnest sonnet
#

yes

unreal quartz
#

what are you trying to do?

vital ridge
#

to create a database which holds player uuids and some more stuff

unreal quartz
#

you don't need xampp at all

#

if you want a database then use something like mysql/mariadb

vital ridge
#

iam using mysql

#

but the tutorials i followed

#

downloaded xampp

unreal quartz
#

and if you are trying to write a plugin to connect to it then use a connection pool like hikari

eternal night
#

XMAPP is just the "I use windows and never saw a shell" way of setting up MySQL

earnest sonnet
#

accurate xD

vital ridge
#

Well I dont currently know other ways

#

I just used what I saw

eternal night
#

Yeah but people using your plugin do

#

hopefully

unreal quartz
#

if you have a mysql database running then as long as it works then you don't need to worry how the user installed it

maiden briar
#

Runtime.getRuntime().exec("cmd /c ping localhost -n 6 > nul && del " + oldFile.getAbsolutePath()); does not delete the current running jar, even running manually through cmd, the plugin is disabled and I can remove it from Explorer

quaint mantle
#

Hi fellas !

I'm trying to do something when a player enters an area. So I use PlayerMoveEvent and have created a method that returns true if the player is in the area.

The problem is that when I do my loop on PlayerMoveEvent if (player is in area), I want for example to send him a message, but the thing is he will always be in the area after he enters it, right ? so the function will apply each time he moves and is in the area !

Do you have any idea on how could I make it so that it execute the code only ONE time when it checks that he is in the area for the 1st time and then dont do it anymore ?

#

please help

opal sluice
unreal quartz
quiet ice
maiden briar
#

I want multi platform support

maiden briar
quiet ice
#

You can't get multi-platform support by doing system calls

quaint mantle
#

Thanks a lot !

maiden briar
#

After enabling an updated jar

#

Everything works, except deleting the jar

opal sluice
maiden briar
#

How does that work?

#

And does that also work in Bungee?

wraith rapids
#

is this for your framework that fucks with classloaders and does everything wrong

unreal quartz
#

have the updated jar delete the old one, windows will lock it if it is still running

maiden briar
#

Yes, but how will I pass the updated jar which file it needs to delete

quiet ice
#

create an sh process, pipe your command into it and if it isn't supported you go to the next shell interpreter

opal sluice
quiet ice
#

Or perhaps just dont fuck with that

maiden briar
eternal night
#

or just do it the real way and just distribute a wrapper for your actual plugin jar

wraith rapids
#

assuming it still works the way you made it work when we last talked it's horrible in every possible way

maiden briar
#

What is a wrapper?

wraith rapids
#

not to mention needlessly so

maiden briar
#

It was horrible

eternal night
#

actually I don't think spigot would allow that would it ?

wraith rapids
#

are you still fucking with pluginclassloaders and extending javaplugin twice and that horrid shit

maiden briar
#

Why would I extend JavaPlugin twice?

#

I don't see the purpose of it

wraith rapids
#

you were

maiden briar
#

I didn't do that, but why would we discuss it's a waste of time

wraith rapids
#

i don't remember the exact specifics of your setup but it definitely was ass backwards

#

hopefully it's better now

maiden briar
#

I will publish the source in couple of days

#

I just need to finish the updater and test everything

maiden briar
opal sluice
#

It doesn't need

#

since the server will overwrite it with the updated jar

maiden briar
#

So placing the jar in the "update" folder will auto overwrite?

opal sluice
#

At restart yes

maiden briar
#

And has Bungee also this kind of feature?

maiden briar
opal sluice
#

idk, since it's a bukkit feature

#

But you can try

#

anyway, I wouldn't implement an auto updater

#

That's bad.

earnest sonnet
#

not sure, but how come you don't keep backups using git ? xD

#

maybe if you decompile it, you can copy and paste your project

wraith rapids
#

building it doesn't delete the original .java files

tardy delta
#

how can i stop the execution of the onCommand() method again?

#

when a player does not meet a condition

#

return false?

summer scroll
#

return true

#

Honestly I don't know what's the difference but I always use return true idk why.

tardy delta
#

which one does return the usage message again?

#

oh

summer scroll
#

oh that one I think return false iirc.

tardy delta
#

i always forget it ๐Ÿ˜‚

summer scroll
#

How do you set the usage anyways?

tardy delta
#

in the plugin.yml

crude hound
#

hi, when I try to restart a schedule when he is activated, he throws me this error : bat [16:19:50] [Server thread/WARN]: [custom_scroll] Task #11 for custom_scroll v0.0.1 generated an exception java.lang.IllegalStateException: Already scheduled as 11 at org.bukkit.scheduler.BukkitRunnable.checkNotYetScheduled(BukkitRunnable.java:162) ~[server.jar:3096-Spigot-9fb885e-296df56] at org.bukkit.scheduler.BukkitRunnable.runTaskLater(BukkitRunnable.java:78) ~[server.jar:3096-Spigot-9fb885e-296df56] at fr.cookiesc.customscrolls.CooldownStorageData$1.run(CooldownStorageData.java:20) ~[?:?] at org.bukkit.craftbukkit.v1_16_R3.scheduler.CraftTask.run(CraftTask.java:81) ~[server.jar:3096-Spigot-9fb885e-296df56] at org.bukkit.craftbukkit.v1_16_R3.scheduler.CraftScheduler.mainThreadHeartbeat(CraftScheduler.java:400) ~[server.jar:3096-Spigot-9fb885e-296df56] at net.minecraft.server.v1_16_R3.MinecraftServer.b(MinecraftServer.java:1179) ~[server.jar:3096-Spigot-9fb885e-296df56] at net.minecraft.server.v1_16_R3.DedicatedServer.b(DedicatedServer.java:394) ~[server.jar:3096-Spigot-9fb885e-296df56] at net.minecraft.server.v1_16_R3.MinecraftServer.a(MinecraftServer.java:1127) ~[server.jar:3096-Spigot-9fb885e-296df56] at net.minecraft.server.v1_16_R3.MinecraftServer.w(MinecraftServer.java:966) ~[server.jar:3096-Spigot-9fb885e-296df56] at net.minecraft.server.v1_16_R3.MinecraftServer.lambda$0(MinecraftServer.java:273) ~[server.jar:3096-Spigot-9fb885e-296df56] at java.lang.Thread.run(Thread.java:834) [?:?] so someone can help me?

opal sluice
#

java.lang.IllegalStateException: Already scheduled as 11

tardy delta
#

is there a "caused by" piece?

crude hound
#

yes but how can I solve this problem

crude hound
opal sluice
#

It does says it all ^^'

tardy delta
#

ah

#

i hate those errors

opal sluice
#

at fr.cookiesc.customscrolls.CooldownStorageData$1.run(CooldownStorageData.java:20) ~[?:?]

#

Looks like you're registering the same scheduler twice

crude hound
#

normal, when I activate it he regester it another time

wraith rapids
#

well don't make "him" register another time

crude hound
#
package fr.cookiesc.customscrolls;

import org.bukkit.entity.Player;
import org.bukkit.scheduler.BukkitRunnable;

public class CooldownStorageData {
    private BukkitRunnable dataTask;
    public Player player;
    public Integer id;
    
    public CooldownStorageData(Scroll scroll, Player player) {
        this.player = player;
        dataTask = new BukkitRunnable() {
            @Override
            public void run() {
                Integer cooldown = scroll.getCooldown();
                if(!(cooldown == 0)) {
                    scroll.setCooldown(cooldown - 1);
                    
                    dataTask.runTaskLater(Main.getInstance(), 20L); // here
                } else {
                    CooldownStorage storage = CooldownStorage.getInstance();
                    dataTask.cancel();
                    storage.removeTask(id);
                    player.sendMessage("cooldown finished");
                }
            }
        };
        dataTask.runTaskLater(Main.getInstance(), 20L); // and here for the first time
        id = dataTask.getTaskId();
        
    }
}
#

like that

opal sluice
#

That's not how you use schedulers...

crude hound
#

oh

#

so how can I do?

opal sluice
#

I mean, yes, you can, but that's not a good practice

#

You should extend the actual class and create the scheduler and then you use it as the scheduler

crude hound
#

I have a second file with a list of this class

opal sluice
#

That's what I was thinking yeah

wraith rapids
#

learn java

opal sluice
#

Don't do that

summer scroll
#

Just a little side note, please do cooldown != 0 or cooldown > 0 instead.

opal sluice
#

You don't have enough knowledge to mess with schedulers. That's an obvious point.

crude hound
#

I just need to do a little cooldown

earnest sonnet
maiden briar
#

I have created a jar file, tested it and ran it and it works. If I add this jar to the resources folder and then place it in the plugins folder I get "Error: Invalid or corrupt jarfile"

opal sluice
#

But here, he wants to manipulate the scheduler more than once

#

So making an extension is the way to go

crude hound
#

I think I will do more simple

opal sluice
#

Like doing "Integer cooldown" it's a lack of knowledge
Don't use the object if you don't need methods from it. It's only a waste of memory. Use the primitive type.

earnest sonnet
#

@opal sluice thanks for elaborating ๐Ÿ˜„

crude hound
#

now I did the schedule execute it 1 time

opal sluice
#

You can't, since it's not a project but a compilated jar file

indigo iron
opal sluice
#

Google, "Java decompiler"

earnest sonnet
opal sluice
#

Import archive. Please, use google.

main dew
#

possible create inventory with items?

quiet ice
#

I recommend using tools that are actually meant for this, such as recaf

opal sluice
earnest sonnet
main dew
#

how?

earnest sonnet
#

there are many example in the spigot site

opal sluice
indigo iron
opal sluice
#

Yeah...

#

That's what I just said...

#

Since the gray area is not an item

#

the citem is null

main dew
opal sluice
earnest sonnet
#

?google

undone axleBOT
earnest sonnet
#

and if you fail then come back here with the stack trace and have you tried

opal sluice
main dew
opal sluice
#

Didn't he just said that he didn't ?

earnest sonnet
main dew
#

I asked how to create inventory with items right away

opal sluice
#

The actual spigot tutorial

#

Says how to...

main dew
#

new ArrayList<>(Arrays.asList(1,2,3,4,5));

opal sluice
#

If you've used google, you would know how to

earnest sonnet
#

@minor garnet next time use ?paste please

main dew
#

how I can create ArrayList with define value how I want create inventory with items

ivory sleet
#

Can you set velocity async?

minor garnet
#

well, I am doing a continuous update of when players within a list, but I need to get their speed at a certain time, but these players on the list when they move, don't update their speed,

earnest sonnet
#

Well, you need to use itemstack in your array and you need to populate your inventory, after that you can open it

opal sluice
minor garnet
earnest sonnet
#

gj

maiden briar
#

Files.copy(TvheeAPI.getInstance().getResource("FileRemover.jar"), fileRemover.toPath(), StandardCopyOption.REPLACE_EXISTING);
If copying the jar from the resources folder to the plugins folder it gets corrupt?

opal sluice
maiden briar
#

No it's just an external jar

main dew
#

in one line

earnest sonnet
#

I don't think you can do it in 1 online, check the javadocs though

#

well at least not the way you mean it

opal sluice
maiden briar
#

No it's just like copying a config to a file

opal sluice
#

Ok, but what's doing the task ?

#

FileRemover.jar ?

maiden briar
#

Not that jar

#

I am in my plugin, and in my plugin I copy FileRemover.jar

#

As you can see, the jar gets 1 kB more

opal sluice
#

Hard to know what's wrong here

maiden briar
#

Yep

opal sluice
#

What's the executor

tardy delta
#

is there an alternative way to MapMeta::setMapId()

maiden briar
#
File fileRemover = new File(TvheeAPIPlugin.getInstance().getDataFolder().getParentFile(), "FileRemover.jar");

InputStream in = TvheeAPI.getInstance().getResource("FileRemover.jar");
OutputStream out = new FileOutputStream(fileRemover);
byte[] buf = new byte[1024];
int len;
{
  out.write(buf, 0, len);
}

in.close();
out.close();

Runtime.getRuntime().exec("java -jar FileRemover.jar \"" + thisJarFile.getAbsolutePath() + "\" 10");
tardy delta
opal sluice
tardy delta
#

ah found it meta.setMapView(view);

jolly badger
#

how to reduce the amount of diamonds or other ores ?

tardy delta
opal sluice
tardy delta
#

if i didnt know that the xxx is set then i didnt find it ๐Ÿ˜‚

opal sluice
wraith rapids
#

that doesn't remove a file

#

that just writes the file full of zeroes

opal sluice
mortal hare
#

ok this is strange

maiden briar
#

I was thinking about creating an extra maven module

mortal hare
#

apparently window open can open window with 32 bit integer

#

packet window id

#

but window data packet only accept unsigned byte sized number

#

wtf

#

and Window data packet accepts byte

wraith rapids
#

the api, the nms packet classes, and the protocol don't always match up exactly

mortal hare
#

but its true

wraith rapids
#

for example the relative move packet classes take doubles, but the protocol uses ints

mortal hare
#

i tried to send bigger number than 255

#

and it fails to do so

minor garnet
#

how get the player velocity by your location ?

wraith rapids
#

well yes, if the underlying protocol doesn't support it, it'll fail

mortal hare
#

then why tf send window id in the first place

#

if one is bigger and the other is smaller

wraith rapids
#

just as the relative move packets can't actually send full double coordinates

#

but only 1/8000ths of a block

mortal hare
#

well that makes sense, but why would we need to send window id in the first place from the server if we won't use it.

#

because you can only open one gui at a time

wraith rapids
#

dunno

mortal hare
#

if notchian server increments id as the chest or other container is created

weary geyser
#

Is there any pet library for Spigot?

mortal hare
#

that would overflow the byte value

#

i need to make a test

#

by placing 255 chests in one place

#

to see what happens lol

#

wait

#

this is even more bizarre

#

when i open the inventory it increments the id

#

every time i open it

#

not place it

#

you can do via preferences

#

and compiler tab

#

Window -> Preferences -> Compiler

#

compliant java version

quiet kindle
#

I want to sum up two commands in one command like:
/spawn ---> teleport to spawn + fix all
Is there a plugin??

mortal hare
#

if i were you

#

i would use skript for this dirty job

#

to execute both commands

#

but plugin is better

#

ok

earnest sonnet
#

I think there is a plugin already capable of doing that

mortal hare
#

ID seems like a useless thing

#

it increments

#

until it reaches 100

minor garnet
#

does anyone know how to get the velocity of player from your previous and current coordinates ? ...

mortal hare
#

and then goes back to 0

#

wtf is that bizarre

#

thing

#

is this legacy shit or what

mortal hare
#

if you're asking for that

minor garnet
earnest sonnet
#

yep

minor garnet
#

i'm using a thread to take a last coordinate

mortal hare
#

im not sure, im using Sublime text 4 with Eclipse java language server

#

it feels like Intellij but way less resource consuming

earnest sonnet
#

@minor garnet depending on how you do it, many things will go wrong

minor garnet
#

yay..

#
                Bukkit.getOnlinePlayers().forEach(player -> {
                    
                    if (gunManagement.getMove(player) == null) return;
                    Vector vel = player.getLocation().toVector().divide(gunManagement.getMove(player));
                //    vel.setY(0.0);
                    double x = vel.getX(), 
                           y = vel.getY(),
                           z = vel.getZ();
                    gunManagement.addMove(player);
                    player.setVelocity(vel);
                    Bukkit.broadcastMessage("ยงaX: " + x + " Y: " + y + " Z:" + z);```
mortal hare
earnest sonnet
minor garnet
#

proportion ?

minor garnet
#

is because added an effect that makes the player have a much lower speed, but can move very slowly, I'm trying to take this lower speed that he walks and multiply it and add it to the player's speed

mortal hare
#

x1 - x2, y1 - y2, z1 - z2 = x,y,z distance
distance / time = velocity

#

you need to manage the negative and positive axis tho

earnest sonnet
#

Yes, but take note, that the x2, y2 and z2 can be bigger than x1, y1, z1

mortal hare
#

yea

#

that's where Math.min() ,Math.max() come in

#

or if statements

earnest sonnet
#

Nah, Math way more elegant

#

Nope, not as far as I know at least

#

I know the feels, rewriting my json logic here, though they're still not perfect they're better than before ๐Ÿ˜„

mortal hare
#

well you can make the mob target someone

#

but that's vanilla kinda

#

you can make an AI without NMS but that's not practical

#

since AI requires high computation power

#

and Bukkit API isn't built for power

#

but for simpicity and backwards compatbility

earnest sonnet
#

that's not practical at all, with a few entities it's going to crash the server, no ?

mortal hare
#

well no

#

you can do it without any lag

#

but directly accessing the server

#

would increase the performance

wraith rapids
#

use paper's ai goals api

young shell
#

I thought, md_5 said that it's better to don't use NMS. ๐Ÿค”

wraith rapids
#

md says all sorts of things

#

he also says that skipping ticks is good

earnest sonnet
wraith rapids
#

and that 1.8 plugins must never break

earnest sonnet
#

@mortal hare didn't know that, thank you ๐Ÿ™‚

#

@quaint mantle check what he said

glossy bough
#

anyone know how to setup armor tools for teleporting

wraith rapids
#

for thousands, you probably want some sort of a boid based ai system

#

i remember someone on paper tried it for fish schools, but i don't know how it turned out

mortal hare
#

What's the fucking point of window id if it resets every 100th opening of container

earnest sonnet
glossy bough
#

I want to set up lobby like hypixel or any other server

#

When we click the server we just teleport to other worlds like bed wars

cold field
#

Which lib does spigot use to parse yaml files?

earnest sonnet
#

I'm pretty sure hypixels teleports you to other servers, not worlds

quiet ice
earnest sonnet
glossy bough
wraith rapids
#

you shouldn't expect help with nms

boreal sluice
#

how can i get the display name of the people who shot the projictile ?

ProjectileHitEvent

minor vapor
#

Get the shooter from the projectile

#

it's either #getEntity or #getProjectile

#

Then Projectile has #getShooter

tepid thicket
#

Hi, is BukkitScheduler#runTaskAsynchronously guranteed to complete when the server shuts down?
Assumed it's triggered by a command, running some file IO which I would like to complete.

weary geyser
wraith rapids
#

no, it is not guaranteed to be completed or even run

#

if you want to ensure it is completed before the server shuts down, you need to wait for it to finish in your plugin's onDisable

tepid thicket
#

Like running Thread#join for the IO thread on the main thread in onDisable()? Okay, thx.

cedar rampart
#

can anyone suggest me a beginner plugin to work on?

wraith rapids
#

assuming it's a dedicated thread, yes

#

but the bukkit scheduler threads are cached, so joining them doesn't make sense

boreal sluice
wraith rapids
#

once your task finishes, the thread will wait for another task to be executed on it

#

something like a CompletableFuture or a dedicated thread may be better

tepid thicket
#

Yeah. Seems like I would need my own thread then. Though not sure if threads from Executors#newSingleExeutorService
might be acquirable, so I could spare the caching part on my end. But thx so far!

soft dragon
#

I need some help, because im new to SPIGOT Coding... I want to make if an MOB (mushroom cow this wouldnt help to answer) is strike by lighting to get name

mortal hare
wraith rapids
#

consider learning english before learning java

soft dragon
#

And i used the same LIBRARY, it doesnt work!

#

Dont spend your time!

chrome beacon
mortal hare
soft dragon
minor vapor
wraith rapids
#

where did I put my holocaust button

soft dragon
wraith rapids
#

pull that information from the event

wraith rapids
#

unfortunately the javadocs are written in english

#

so you won't be able to understand them

mortal hare
#

via event.getEntity().getType()

#

or do instanceof

#

with interface

soft dragon
mortal hare
#

you should prefer gettype

#

since interfaces could change in the future, we don't know what mojang will do with mobs in the future

#

and the getType() method couldn't (99%)

soft dragon
#

thanks ๐Ÿ˜„

mortal hare
#

man i love XFCE on linux

#

having everything on top feels like breeze

daring sierra
earnest sonnet
daring sierra
#

i3-gaps ๐Ÿ˜

mortal hare
daring sierra
mortal hare
#

yeah, its arch linux based, its like MXLinux

#

but on arch

daring sierra
#

arch is pretty good

#

im using it rn with i3-gaps

earnest sonnet
#

arch is the best ~

sage dock
#

how to make a discord bot that will send commands to the spigot server. For example /ban teest1

noble spire
#

what's the --rev for 1.17 buildtools?

earnest sonnet
#

java -jar BuildTools.jar --rev 1.17 I don't think anything changed

noble spire
#

If you don't know how to make a discord bot I'd suggest learning about discord.py in python first

sage dock
#

thanks

noble spire
#

cool

minor vapor
noble spire
#

I'd say that's more helpful for more complex projects tho

#

(discord4j imo is easier to setup, but not nice for big projects)

minor vapor
#

Never used it, I've only used what I sent. But yeah just make it into a plugin

noble spire
earnest sonnet
#

Ah, yep that explains it ๐Ÿ˜„

noble spire
#

(oh and it's Java 16 I'm dumb)

earnest sonnet
#

yeep

hasty lynx
#

hello does anyone know any maven repository that has spigot 1.7.10?

hasty lynx
wraith rapids
#

consider not depending on software that is almost 10 years out of date

quaint mantle
#

is there some way how to replace text in string with textcomponent thats clickable and stuff?

main dew
#

How I can create skull with Texture (no skullOwner)

noble spire
#

Could someone send a screenshot of any spigot maven project? I've forgotten the directory layout ๐Ÿ˜†

#

does the package name for the main class matter?

#

(If I have this dir layout, and MCMain is the main class, what is the path for plugin.yml's Main)?

quaint mantle
mortal hare
#

any explanation to this

#

why it increments

quaint mantle
mortal hare
#

for no apparent reason

#

its not used anywhere

#

it just increments

#

for no reason whatsoever

noble spire
quaint mantle
#

yes

noble spire
#

cheers

noble spire
wraith rapids
#

the main: field in your plugin.yml isn't related to where your code is in your project

#

it is the package + class name of the class

#

you can find the package at the top of the source file

#

and the class name should be obvious

noble spire
#

yeah

humble heath
#

hey can anyone help me

tame coral
#

?bt

undone axleBOT
humble heath
#

?

tame coral
#

Nah it's just for me

soft dragon
# humble heath ?

no idea... maybe try to find which LINE OF CODE is causing the error by DEBUG MODE

wraith rapids
#

why are you CAPITALIZING some random THINGS for no REASON

eternal oxide
mortal hare
soft dragon
mortal hare
#

i just doesn't seem to know why is it counting in NMS

soft dragon
#

to focus ON THESE WORDS

#

its useful

mortal hare
#

it seems it has no purpose whatsoever

soft dragon
#

when talking online XD

wraith rapids
#

that's not how language works

hardy swan
#

guys quick question

wraith rapids
#

generally, things like italic or bold are preferred

soft dragon
#

thats how online language works

wraith rapids
#

as all-capsing looks dumb as shit

soft dragon
#

and bold

wraith rapids
#

i can't actually see discord formatting

#

ripcord master race

mortal hare
#

caps is easier to type than bolding out in discord

hardy swan
#

guys, how can you tell if a player abort breaking a block from nms, apart from ABORT_DESTROY_BLOCK

soft dragon
opal juniper
wraith rapids
#

iirc underscores also work

soft dragon
noble spire
wraith rapids
#

at least they did when I last used discord ages ago

#

regardless, all caps is retarded and makes you look dumb and nobody other than borderline illiterate people do it

hardy swan
#

I typed caps cuz

#

enum

noble spire
hardy swan
#

USES BOLD ITALICS CAPS AND UNDERLINE BECAUSE WHY NOT

noble spire
#

lol

wraith rapids
#

is double underscore underline

soft dragon
noble spire
#

*||lol||

soft dragon
#

im using it

hardy swan
#

guys, ||fuck you||

noble spire
#

oh, do you have your ide set to run the spigot jar?

#

I just compile it, copy it over, and run it

#

using the console

soft dragon
#

check out these

#

these are plugins

hardy swan
#

ok guys need some development help here

mortal hare
#

uwu

#

discord client

wraith rapids
#

what are we even talking about

mortal hare
#

that looks like

#

discord client

#

but written in c++ and in QT

wraith rapids
#

does it use auth tokens

mortal hare
#

wait nvm

#

its js

#

ffs

wraith rapids
#

gay

noble spire
#

Imagine spigot, but instead of getting stack traces, you just get the error with no context

hardy swan
#

So I was trying to mock a normal block break process on bedrock, dun ask why.

I have a method for BlockDamageEvent cuz that's obv what's called while attempting to 'break' the block. And I listen in to ABORT_DESTROY_BLOCK packets to cancel the event if player stop breaking the block.

But....

Players can punch the bedrock repeatedly and still qualify as normal BlockDamageEvent without any ABORT_DESTROY_BLOCK packets generated. Any way to overcome this?

wraith rapids
#

that's strange

mortal hare
wraith rapids
#

i think just punching the block by clicking it should initiate the breaking animation

#

it's just cancelled immediately after

hardy swan
#

hmm, but it seems like it might not be cancelled since I set up a scheduled task for the block to actually break after a certain amount of time

#

and the event isn't cancelled by then

soft dragon
#

Can you help me compile SPIGOT PLUGIN? I compiled it to JAR, but my server doesnt DETECT it

hardy swan
#

missing/invalid yml?

#

not in plugins folder?

soft dragon
#

oh nvm

#

i found the prolbem

#

when reloaded

hardy swan
#

restart

soft dragon
#

Unsupported API version 1.16.1

#

can someone giv me API link for 1.16.5

hardy swan
#

to do that

#

change the number

#

1.16.1