#help-development

1 messages · Page 1529 of 1

hexed hatch
#

Pass an ItemStack to add

light terrace
#

but is Inventory is for GUI?

hexed hatch
#

No

#

Inventory is the contents of a user's inventory

#

their items

#

I would recommend reading the docs

light terrace
#

wait, i cant use the add()

hexed hatch
#

Why not?

light terrace
#

in intelij its red

hexed hatch
#

Show me your code

light terrace
#
 @Override
    public boolean onCommand(CommandSender sender, Command command, String label, String[] args) {
        if (sender instanceof Player){
            if (command.getName().equals("cmdb")){
                Player p = (Player) sender;
                p.getInventory().add();
            }
        }
calm whale
#

it's empty

hexed hatch
#

Well you need to specify the item

calm whale
#

you have to set an itemStack

hexed hatch
#

in this case, .add(new ItemStack(Material.COMMAND_BLOCK);

#

Don't have my IDE so I may not have the ID correct

sullen dome
#

guys. how much ram would be good for intellij for a project with like... 600mb?

#

xd

light terrace
hexed hatch
#

What's red

calm whale
sullen dome
#

red?

sullen dome
sullen dome
#

only? i thought it would need more. my intellij laggs like shit

hexed hatch
sullen dome
#

where can i actually see how much it uses

granite stirrup
granite stirrup
alpine vale
#

what do you mean when in your premium plug say Moderated?

sullen dome
granite stirrup
sullen dome
#

f

alpine vale
#

:,v

hexed hatch
#

@sullen dome IntelliJ, right?

sullen dome
#

yea

hexed hatch
#

Click help > find action > type memory and press enter

sullen dome
#

i mean, i'm sure there was an option inside ij

hexed hatch
#

That brings it right up

sullen dome
#

oh

#

ty

hexed hatch
#

IntelliJ's find action feature makes it usable lol

sullen dome
#

like, i have 2048mb, ryzen5 3600, and my intellij laggs like hell

hexed hatch
#

I can't be bothered to learn the settings ui

sullen dome
#

intellij ui is godlike

hexed hatch
#

oh it is, but it's a bit of a maze sometimes

sullen dome
#

yea

#

but i couldnt use eclipse because of the ui... it looks so.... uuhhh

#

idk how to even call it

hexed hatch
#

eclipse stinky

sullen dome
#

stinky

#

thats good

#

eclipse just feels weird. it looks like we're still in 2012

hexed hatch
#

It really does feel dated using it

sullen dome
#

maybe thats why ij laggs? huhmmmm

next crown
#

sry to bother i am a noob and i want to learn more lore about the plugindev and i want to know how to use the plugin source and export to

#

a plugin jar

hexed hatch
#

First things first

#

Learn Java

sullen dome
#

wait

#

?java

#

idk the command ahhhh

hexed hatch
#

?learnjava

undone axleBOT
sullen dome
#

?learnjava

undone axleBOT
sullen dome
#

hah

#

fuck

#

yeah, that was it

hexed hatch
#

I made the mistake of learning Java through spigot

sullen dome
#

same

hexed hatch
#

I had to unlearn a lot of shitty practices

next crown
#

i have been learn a bit and grasp rather

sullen dome
#

xd

#

to be honest

#

you know how long it took to unlearn using static for everything? xd

#

gooood

granite stirrup
#

lol

hexed hatch
#

Oh god

sullen dome
#

yea

granite stirrup
#

i learned basic java

sullen dome
#

thats from the tutorials, i learned from

hexed hatch
#

Oh god

granite stirrup
#

before i tried spigot plugin making

sullen dome
#

i learned from spigot coding tutorials lol

hexed hatch
#

This one horrible tutorial I watched

sullen dome
#

because reading is boring

hexed hatch
#

Set me in my ways for a while

sullen dome
#

and i cannot really learn from reading, ngl

hexed hatch
#

Understandable

granite stirrup
#

for learning

next crown
#

if i have a src then how to export it

sullen dome
#

wdym

#

the plugin?

next crown
#

yes

sullen dome
#

do you use eclipse or intellij

hexed hatch
#

What do you have, a jar file?

next crown
#

idea

#

inte

sullen dome
#

you use maven?

granite stirrup
sullen dome
#

to see if you do, check if you have a ui called Maven at the arrow

next crown
#

yeah

sullen dome
#

i still wonder how to reload that fucking project while running. starting the client takes like 5 minutes lol

sullen dome
#

what

#

is what

hexed hatch
#

Oh, you're making a client?

sullen dome
#

yea

sullen dome
#

well, re-starting

#

i actually do

#

but it does never finish building

#

when re-building

#

or it crashes my game. random actually

granite stirrup
#

f

sullen dome
#

yea

#

and i still wonder how this can be a thing

#

intellij is weird

granite stirrup
sullen dome
#

startGame says never used

#

if i call it start, it doesnt

#

thats some weird stuff

granite stirrup
#

bug?

sullen dome
#

idk

#

same here

#

its like when it's not just one word or smt i think

granite stirrup
#

is testMethod used?

sullen dome
#

no

#

but test isnt as well

granite stirrup
#

why are they both empty tho

sullen dome
#

i made them to show you the problem

calm oriole
sullen dome
#

i dont think you get what i mean

#

one sec

#

why does startGame says not used, but start doesnt?`both methods are never used anywhere

calm oriole
#

X is never used just means you never call that method from anywhere in the program. They won't even compile because it's impossible to reach them.

sullen dome
#

it's just an optical weird thing

#

yeah, but start is never used as well

#

but it doesnt show never used

calm oriole
#

are you sure you don't run it somewhere

sullen dome
#

nah

#

i just created it lol

calm oriole
#

ok

granite stirrup
#

i think its a bug

sullen dome
#

same here. created 10 seconds ago

granite stirrup
#

what if u make it asd and asf

calm oriole
#

it's just a bug

#

don't worry about it

sullen dome
#

i do worry

#

idk why, but i do

calm oriole
#

why

granite stirrup
sullen dome
#

idk

granite stirrup
#

thats weird

sullen dome
#

ofc its weird

granite stirrup
#

never happend to me XD

sullen dome
#

i mean

calm oriole
#

just finish writing your plugin. I don't see why we're talking about this.

sullen dome
#

it gives me this warnings on the right

#

and they look bad

#

ngl

#

one question tho

#

is that picture more blue, or more grey

#

i think my monitor is broken

next crown
#

why i cant upload any screenshot in this channel

sullen dome
#

youre not verifiedf

#

?verify i think

granite stirrup
#

no !verify

sullen dome
#

^

granite stirrup
#

then cafebabe dms you

next crown
#

!verify

undone axleBOT
#

Usage: !verify <forums username>

sullen dome
#

just for seeing comparison

#

yea, my main monitor is probably broken

#

or the color format is weird

granite stirrup
#

?

sullen dome
#

i have 2 monitors. and the second one has a way different color

granite stirrup
#

i hate that warnings show up like right in ur face

sullen dome
#

i mean, i can't show it ofc. but on my main monitor, everything has much less contrast

sullen dome
granite stirrup
#

its annoying

calm oriole
next crown
#

when open maven it show this

granite stirrup
#

the >

quaint mantle
#

lol

next crown
#

you mean this?

quaint mantle
#

no

granite stirrup
quaint mantle
hoary tiger
#

Hello, so I have the constuctor variable EntityTypes<? extends EntitySilverfish> entitytypes so It's a silver fish so what should I put in? in the super

next crown
#

oh i see

quaint mantle
#

idot

granite stirrup
next crown
#

then w shoud i do

granite stirrup
#

alr i gtg

#

but puyo you help him

quaint mantle
#

what are you trying to do?

sullen dome
#

wtf

next crown
#

export to a jar

#

plugin

tall ridge
#

xd

sullen dome
#

you have to click the arrow that puyo sent you a picture of

#

thats not hard ngl

quaint mantle
sage swift
#

when all the crate plugins are either bad, not updated, or paid so you make your own

quaint mantle
#

embed you fuck

sullen dome
#

xd

granite stirrup
#

XD

quaint mantle
#

then just press enter

tall ridge
#

why do people use maven?

quaint mantle
#

cause maven is nice?

#

why do people use gradle?

sullen dome
#

bc its better than not using it

granite stirrup
#

cuz maven is better

tall ridge
#

What is gradle?

#

xd

quaint mantle
#

yeah, so stfu

sullen dome
granite stirrup
#

same thing as maven but faster

tall ridge
#

is it like maven?

quaint mantle
#

ye

#

maven and gradle are both dependency/build managers

granite stirrup
#

but yeah gradle is faster

tall ridge
#

I just download jars

sullen dome
#

it is?

tall ridge
#

am I a loser?

sullen dome
#

dont really feels like

next crown
#

what wrong with this

quaint mantle
#

yes, big looser

sullen dome
#

my game needs 5 minutes to start with gradle

granite stirrup
#

yes chew your a big looser

quaint mantle
#

nothing went wrong @next crown

tall ridge
#

okay thanks guys

quaint mantle
#

check the target folder for the jar

calm oriole
sullen dome
#

why not using maver or gradle? i dont see any bad site on using them

calm oriole
#

I don't use dependency managers because I have only had pain trying to get them set up

quaint mantle
#

Gradle > maven > manually downloading and importing jars

sullen dome
#

its not hard

granite stirrup
sullen dome
#

if you code spigot, there's even an intellij plugin called Minecraft Development lmao

next crown
#

oh

quaint mantle
sullen dome
#

that sets everything automatically up for you

granite stirrup
sullen dome
#

i think i'll use the fuck for telling people you're right

#

duck is cool

#

i said fuck

next crown
#

what s the distinction from these

sullen dome
#

why did i say fuck. i wanted to say duck

quaint mantle
#

so like, its a pain to download the gradle wrapper

granite stirrup
#

f

#

why?

quaint mantle
#

well, they block it, so it cant download the wrapper, as to why its blocked, they're fucking idiots

calm oriole
quaint mantle
#

i mean, i have a vpn, but doesnt work for that long at a time

granite stirrup
#

your not gonna get the latest version everytime

quaint mantle
granite stirrup
#

its gonna increase source code size

#

also

quaint mantle
granite stirrup
#

also its kinda harder well not really but i just like using maven

#

and you can import things from disk using maven

#

so why not use it

calm oriole
#

I have only ever just imported the spigot jar manually since I started plugin development. Would I need to create a new maven project in intellij and move the code over?

granite stirrup
#

and ant is just shit

quaint mantle
#

I just prefer maven, I can use gradle, I just choose not to /shrug

quaint mantle
#

you can convert an existing project to maven pretty easy

maiden shore
#

Once you learn Maven or Gradle importing jars is just a pain honestly

granite stirrup
#

ima go now

calm oriole
#

I went through hell and back trying to learn gradle, like a year ago

next crown
#

does it export jar like this frequently

granite stirrup
#

since it uses the xml format

#

which is like english

#

XD

calm oriole
#

I just gave up with ever trying to use a package manager after spending like 3 hours on it

quaint mantle
maiden shore
#

You can also use something called Renovate which automatically updates maven dependencies for you

quaint mantle
#

maven is easier than gradle imo

granite stirrup
#

well gradle config stuff is smaller for getting like things from repos

#

cuz pom.xml's are massive

#

af

maiden shore
#

Gradle's configs are so much worse

#

IMO

granite stirrup
#

well yeah but there smaller

next crown
quaint mantle
granite stirrup
calm oriole
quaint mantle
calm oriole
#

extremely rapid development

quaint mantle
#

I use ant plugin to copy the jar instead

#

I dont like moving it out

#

personally at least

maiden shore
#

With IntelliJ you can literally do a remote debug and set breakpoints as the plugin is running on the server

granite stirrup
#

Ant is okay but it isnt that good

granite stirrup
#

we need maven to do caching lol

quaint mantle
#

I only use ant to copy a jar ¯_(ツ)_/¯

maiden shore
#

What's ant?

granite stirrup
#

cuz it does none of that shit

granite stirrup
#

idk

maiden shore
#

Ah

granite stirrup
#

it might be a build tool

#

but im not to sure

quaint mantle
#

its a build tool

#

allows for compiling, testing, assembling ,etc

granite stirrup
#

it says software tool XD

#

"Apache Ant is a software tool for automating software build processes which originated from the Apache Tomcat project in early 2000 as a replacement for the Make build tool of Unix. It is similar to Make, but is implemented using the Java language and requires the Java platform."

maiden shore
#

Isn't that what maven does?

granite stirrup
next crown
quaint mantle
#

The main known usage of Ant is the build of Java applications. Ant supplies a number of built-in tasks allowing to compile, assemble, test and run Java applications. Ant can also be used effectively to build non Java applications, for instance C or C++ applications. More generally, Ant can be used to pilot any type of process which can be described in terms of targets and tasks.

quaint mantle
#

hold on, let me find the thing

#
<build>
  <outputDirectory>/my/path</outputDirectory>
</build>
next crown
#

thank for your elaborate

granite stirrup
#
<build>
  <directory>my/path</directory>
</build>``` i thought it was this lol
quaint mantle
#

theres a few ways, but its outputDirectory

granite stirrup
#

oh

#

im bored

quaint mantle
#

outputdirectory: The directory where compiled application classes are placed.
directory: The directory where all files generated by the build are placed.

granite stirrup
quaint mantle
#

no...

granite stirrup
#

but dont you want every file from the build in another directory?

#

so you use directory right?

quaint mantle
#

uhhh

#

idfk, i dont change my dir 😂

compact haven
#

can someone explain to me how vectors, direction vectors, and velocity works n all

quaint mantle
#

@next crown use directory instead of outputDirectory

compact haven
#

in like baby boy terms

calm oriole
granite stirrup
#

ima go

quaint mantle
granite stirrup
#

bye

compact haven
#

ok well I know a vector is x,z values and a 3d vector is x, y, z

#

I dont think spigot itself differientiates

granite stirrup
compact haven
#

but mostly confused on things like velocity and getDirection() and all

granite stirrup
#

velocity is like the speed

#

i think

quaint mantle
#

ye

calm oriole
quaint mantle
#

The velocity of an object is the rate of change of its position with respect to a frame of reference, and is a function of time. Velocity is equivalent to a specification of an object's speed and direction of motion

maiden shore
#

Hey, does anyone know how to prevent the sign input dialog popping up when a player places a sign? The only solutions I've come up with involve NMS and I'd like to avoid that if possible.

compact haven
#

right but when I use setVelocity im not setting it to a function of time, just a vector

#

how does this vector eventually go back to still

granite stirrup
compact haven
#

ok thank you

#

I need more than if's and gravity

next crown
compact haven
#

if anyone knows more definitely please do tag me

granite stirrup
#

minecraft does it for you idk

compact haven
#

dont make guesses because it doesnt help me understand

next crown
#

or video link

#

about the fully plugin complie

compact haven
#

hm I should make a small plugin that allows me to set my velocity and sends me an actionbar with my current velocity to see how its affected

calm oriole
#

setVelocity just sets your instantaneous velocity

quaint mantle
granite stirrup
calm oriole
#

it can be changed by anything that affects velocity, i.e. gravity, friction, however the game calculates movement

next crown
calm oriole
#

you need to set it every tick for it to be constant

compact haven
#

so say I set my gravity to (1, 1, 1)
this means upwards, southeast

or say I set it to (-1, 0, 1)
this means southwest, no change to y position?

next stratus
#

does anyone here have experience with fawe api on 1.16?

compact haven
#

and say I set a runnable 1 tick later, with getVelocity, would that be it returning to 0 on all accounts?

granite stirrup
quaint mantle
calm oriole
compact haven
#

ok so If I'm understanding this correctly

calm oriole
#

setVelocity sets the velocity, meaning it overwrites the previous velocity values

compact haven
#

a player's velocity when standing still is 0, 0, 0

#

right?

calm oriole
#

yes

compact haven
#

ok now if I set it to (1, 1, 1) it will rise on all accounts to 1, 1, 1, then it will fall to 0, 0, 0 again?

#

nah that doesnt make sense

#

since its not like a coordinate its just a push

calm oriole
#

yeah

#

velocity does not correspond directly to the actual distance traveled

#

because it decays and changes from other variables

#

like, contact with the ground

#

or air resistance

compact haven
#

im going to go create a plugin that allows me to set my velocity and every tick sends me an actionbar with my current velocity

#

I think I need a more hands on approach to see how this actually works

#

thank you snax

calm oriole
#

np

#

you could probably create a fairly accurate position predictor based on the delta of velocity between ticks.

#

that would be a really fun project

maiden shore
#

BlockExplodeEvent should be called when TNT explodes....right?

#

Because it's not

calm oriole
maiden shore
#

You mean like

#

By TNT? 😛

calm oriole
maiden shore
#

Great

#

Because it's not

#

I have a breakpoint on it and it's definitely not running

calm oriole
#

try just sending something to console

maiden shore
#

Well

#

Breakpoint

#

Same idea

#

Works fine on BlockBurnEvent

calm oriole
#

hm

maiden shore
#

Bug? 🤔

calm oriole
#

are you getting any errors?

maiden shore
#

Let me try a creeper

#

No

#

Doesn't work for a creeper either o-o

calm oriole
#

Mind if i see your EventHandler?

maiden shore
#
    @EventHandler
    public void onSignExplodeEvent(BlockExplodeEvent event) {
        List<Block> adjacentBlocks = this.getAdjacentBlocks(event.getBlock());
        if (adjacentBlocks.stream().anyMatch(b -> b.getState() instanceof Sign)) {
            event.setCancelled(adjacentBlocks.stream().anyMatch(b -> psManager.doesPlotSignExistAtLocation(b.getLocation())));
        }
    }```
#

I just have a breakpoint on the first line

#

So it should break no matter what

#

I'll add a println for giggles

calm oriole
maiden shore
#

Yeah, doesn't print anything

granite stirrup
#

it's EntityExplodeEvent I think

maiden shore
#

For blocks?

granite stirrup
#

For tnt and stuff it is

calm oriole
maiden shore
#

Yeah

calm oriole
#

hm

maiden shore
#

I'll see if the EntityExplodeEvent runs

granite stirrup
#

It's EntityExplodeEvent

maiden shore
#

Even so

#

What's BlockExplodeEvent for then?...

granite stirrup
granite stirrup
calm oriole
#

that's definitely a better event

maiden shore
#

Yeah

#

EntityExplodeEvent works

calm oriole
#

is there an easy way to get all blocks pushed by a piston event?

granite stirrup
#

BlockPistonExtendEvent?

calm oriole
#

ah, perfect, thanks

granite stirrup
#

There's also a retract one to

#

I need to hurry cuz my phone about to die soon I charged it for like 5 mins

#

And it was 16%

#

And now it's 13% 🤣

maiden shore
#

Once phones get to like 12% they go to 0 in like three seconds

granite stirrup
#

Lol

#

Ffff it's 12% :(

hoary tiger
#

Ok, I want to make an ability where a bunch of silver fish goes in in all directions. So, I would like to make silver fish go in a strait line from a location. So, how would I do this>

granite stirrup
#

Valknet which is my fav host has amongus server hosting and more now before it was just discord bot hosting VPS hosting and MC hosting before

#

These are all the hosting it offers hmm yum

#

The vpses are pricy tho :(

compact haven
#

I use hetzner

#

28usd for 16gb ram, 240gb storage, 8vcpu

granite stirrup
#

F

granite stirrup
granite stirrup
limber mica
granite stirrup
#

¯\_(ツ)_/¯

limber mica
#

I mean look at this ```java
public void loadRank(Player player) {
String rankString = getConfig().get(player.getUniqueId() + ".rank");
Rank rank = (rankString == null) ? Rank.NONE : Rank.valueOf(rankString);
player.setDisplayName(prefix.get(rank) + player.getName());
player.setPlayerListName(prefix.get(rank) + player.getName());
ranks.put(player, rank);
}

public void saveRank(Player player) {
getConfig().set(player.getUniqueId() + ".rank", ranks.get(rank));
ranks.remove(player);
}

quaint mantle
#

no

#

altho I personally wouldn't load it and apply on player in same method

#

that's 2 separate pieces of logic

summer scroll
#

they do not save the config on the saveRank method 😮

next crown
#

how to use this if i want to compile other plugin src

dusty sandal
#

What does ConfigurationSection.getObject(String path, Class <T> clazz) do if there is something at that path but it can't be cast to the given class?

dusty sandal
#

does it just return null?

sage swift
#

imported the bukkit Location, but my usage of Location yellow with this... anyone know why? Access restriction: The type 'Location' is not API (restriction on required library 'C:\Program Files\AdoptOpenJDK\jdk-16.0.1.9-hotspot\lib\jrt-fs.jar')

#

never mind it went away when i saved

compact haven
#
                    event.player.velocity = Vector(0, 4, 0)
                    val task = Bukkit.getScheduler().runTaskTimer(this@STDuels, {
                        if (event.player.velocity.y >= 0) return@runTaskTimer
                        event.player.velocity = Vector(event.player.location.direction.x * .2, -0.05, event.player.location.direction.z * .2)
                    }, 0L, 1L)

(kotlin, but should be understandable)

#

Sometimes I randomly fall, without the slowness my velocity should give

#

It's also jittery, I need to fix this somehow

#

any ideas?

sullen dome
#

same again, save method says nothing, load method says never used. i dont even know why i bother about this, but Intellij should really fix this

#

(both methods are never used)

silver wadi
#

should i create a class for every command

summer scroll
granite stirrup
silver wadi
#

thanks

#

so do plugins like worldedit have hundreds of files?

silver wadi
#

i see

#

thanks

sullen dome
#

iirc they only have one command

#

called /

#

thats why they use // as command

silver wadi
#

oh

#

so everything else is a subcommand?

calm oriole
#

they also have helper classes they use inside of those commands

calm oriole
#

It's easier to organize

#

I have one "command" with a bunch of branches

silver wadi
#

how does that go syntax wise?

calm oriole
#

I use a switch statement

silver wadi
#

smart

#

thanks

summer scroll
#

For subcommand if you have a lot of subcommand I suggest you to have like a subcommand handler or something like that.

sullen dome
#

i usually create a class for every command too, but i almost always use a TabCompleter as well, and handling so much commands in one class. hmmm idk

calm oriole
#

never heard of that

#

I will implement it

sullen dome
#

well yeah, let's you show specific args while typing the command

#

pretty nice

#

and i actually would like it if ALL of the public plugins would use them

#

so you can see how to use a command

summer scroll
#

Talking about TabCompleter, do you know why the suggestion doesn't show as I desired?

#

It doesn't show <amount> on the suggestion.

wet breach
#

to make it easier

sullen dome
#

idk

summer scroll
#

The command is /mobcoins give virtual <player> <amount>

sullen dome
#

yeah, then it's arg[3]

#

iirc

summer scroll
#

The <amount> is 4th argument.

#

Same as args.length == 4

sullen dome
#

i mean, args start with the second one

#

/mobcoins isnt an arg

#

it's the command

summer scroll
#

Yes, but args.length == 0 will return the command.

sullen dome
#

yea

#

confusing ik

#

lemme explain

#
/mobcoins give virtual <player> <amount>```

`/mobcoins = command, give = args[0], virtual = args[1], <player> = args[2], <amount> = args[3]`

and the args.length is 4 yes, because the args.length weirdly either starts with 1, or counts the command as 0.
summer scroll
#

I understand that part.

sullen dome
#

and on tabcompleter, you don't have that command. because tabcompleter obviously only starts on the first arg. commands have no tabcompleter, because it's a specific command

#

you cannot mistype a command

summer scroll
#

But it's showing the correct suggestion before args 4 tho.

sullen dome
#

i'm pretty sure tabcompleter's override looks different

#

at all

summer scroll
#

It's not that confusing, you can get the command from both command and tab completer.

#

I just don't know why it doesn't show the correct suggestion in the args.length = 4

sullen dome
#

lemme check

#

what does it return?

summer scroll
#

list of player name

sullen dome
#

actually you could try System.out.printLn(args.length()) to see what it says

#

and i see that i was completely dumb. you use args.length in tabcompleter, not args[whatever]. forgive me my lord

summer scroll
#

I'm gonna try that.

calm oriole
#

hey, for TabCompleter, is there a simple way to only suggest completions that match what they have already typed, or do I need to check it against every option?

sullen dome
#

i need in fact a larger mousepad. mine is 85x33cm, and still too small

sullen dome
calm oriole
#

alright, I'll just do an ol'

for(String choice : choices){
    if(args[0].indexof(choice) == 0)
        options.add(choice);
}
dusty herald
#

I like to do something like this:

StringUtil.copyPartialMatches(argument, array of completions)
                            .map(Enum::name)
                            .collect(Collectors.toList()), completions to return to user ya know);```
calm oriole
#

choice.indexof(args[0])

summer scroll
#

@sullen dome I fixed it, the problem is i don't register the tab completer properly.

sullen dome
#

wtf

#

why would it then only not work for the last arg

#

but for the others

summer scroll
#

I stopped at args.length == 2

#

By changing to args.length >= 2 it works now.

calm oriole
#

are break statements really that bad

sullen dome
#

wdym with break statements

calm oriole
#

just in general

sullen dome
#

you mean switch statements right?

calm oriole
#

no

#

break

quaint mantle
#

??

sullen dome
#

what are break statements lol

quaint mantle
#

why would they?

calm oriole
sullen dome
#

ah these

strong forge
#

why is that even a question

sullen dome
#

why would they be bad lol

quaint mantle
#

they are crucial for breaking out of loops and continuing the method lmao

strong forge
#

it's just used for controlling code execution

granite stirrup
#

continue; is sometimes better

calm oriole
#

they are basically goto

quaint mantle
#

not at all?

granite stirrup
summer scroll
#

it's really depend on your code lmao

strong forge
#

👀

granite stirrup
strong forge
#

ok

granite stirrup
#

Ur from minehut discord XD

strong forge
#

im on a couple dozen minecraft related discords XD

silver wadi
#

how do i get a player object from a CommandSender object?

calm oriole
#

if you know it's a player

granite stirrup
#

Trent has probs almost friended everyone on the mh discord XD

#

MH*

calm oriole
silver wadi
#

used instanceof already

#

thanks

#

its narrowing, right?

calm oriole
#

hm?

silver wadi
#

CommandSender -> Player is narrowing

#

not widening?

calm oriole
silver wadi
#

thanks

calm oriole
#

Player implements CommandSender

granite stirrup
#

I need to find a use for continue lol

calm oriole
#

I have never used or even heard of it in my ~5 years of java

strong forge
#

lol

granite stirrup
#

Lol

strong forge
#

you can obviously write code without it but it does come in useful

#

if you've never used it you probably just haven't thought of using it

calm oriole
#

just use an if statement

quaint mantle
#

i mean... yes

calm oriole
quaint mantle
#

evil?

#

lmao

calm oriole
#

evil.

#

witchcraft

#

voodoo

strong forge
#

nested if triangles are more evil than continue

#

change my mind

calm oriole
#

you will forever be spiritually damaged if you use continue even once

#

just say no

strong forge
#

i've used it in many projects 🙂

calm oriole
#

you are beyond saving

quaint mantle
#

what if i am already spiritually damaged

#

:thonka:

strong forge
#

im already brain damaged before having learned java so it's fine md_5

#

xD

quaint mantle
#

lol

summer scroll
#

How can I use maven placeholder in the plugin.yml?

granite stirrup
#
for (Player player:Bukkit.getPlayers()) {
    if (!(blockedNames.contains(player.getDisplayName()))) {
         continue;
    }
    player.kickPlayer("your name has been blocked");
}
#

I made use of continue XD

strong forge
#

ez

#

in that case though probably easier without

summer scroll
#
for (Player player:Bukkit.getPlayers()) {
    if(blockedNames.contains(player.getDisplayName()){
      player.kickPlayer("your name has been blocked");
    }
}
``` nope
strong forge
#

for longer for loops it can be handy

#

but hey you dont even need a for loop for that anyway

#

or an if either

granite stirrup
strong forge
#

all you need is steams

summer scroll
calm oriole
#

How do I add a suggestion like this to my TabCompleter (the stuff on top)

granite stirrup
#

Sorry if the formatting is wrong XD

#

I'm on phone

#

It's hard to write java code on phone

hybrid spoke
summer scroll
#

well, for me at least

sullen dome
#

am i just totally dumb, or is this the most useless boolean that minecraft uses? wtf

quaint mantle
calm oriole
#

damn

hybrid spoke
#

makes sense to me

quaint mantle
summer scroll
#

Can you put colors in the suggestion?

quaint mantle
#

yesn't

granite stirrup
#
public enum Everyone extends Role {
      Role_ID(Guild.getID());

      public Everyone(String id) { this.id = id }
}
calm oriole
sullen dome
#

that was literally what i wanted to wite. it types the § when tabbing it

#

idk tho how it handles ChatColor

#

from either Bukkit or Bungee api

quaint mantle
#

?

sullen dome
#

or is this using ChatColor

quaint mantle
#

when converted to strings it's just § + the code itself

sullen dome
#

okay nvm

#

said nothing

summer scroll
#

commodore?

quaint mantle
#

no

calm oriole
#

The whole Bedrock/Java edition thing feels like Microsoft is competing with the ghost of Notch, tbh.

quaint mantle
#

just color codes

summer scroll
#

ah alright, thanks

#

but it's really bad lol

calm oriole
#

is there a standard for how to present command arguments in help?

#

"/lbb geturl [-h] [-cpp <chars per page>] <plaintext file URL> <book title>"

is this able to be understood?

#

I mean to imply that the [-h] and [-cpp] flags are optional, and that anything in <> is required

quaint mantle
#

yeah that's usually how one does it

hybrid spoke
quaint mantle
#

there isn't really a standard per se

sullen dome
#

xd

calm oriole
quaint mantle
#

but <> implies required argument, [] optional and without any brackets a literal

calm oriole
#

ok cool

granite stirrup
#

Ooh I found out u can open books for players with a itemstack

#

I don't remember it there before

#

Idk if it's 1.17 addition or not

#

@sullen marlin really needs to have docs for older versions

#

@quaint mantle is this a fake XD

quaint mantle
#

supporting older versions lmao

#

what a joker

calm oriole
granite stirrup
#

No not support them

#

Just have docs for old versions like paper

#

Like archives for older versions

quaint mantle
#

1.5

#

phew

granite stirrup
#

Are they official?

quaint mantle
#

the docs or the sites?

granite stirrup
#

Nvm

next crown
#

how to query a minecraft server ip address

#

not domain ip

granite stirrup
next crown
#

that ip Made up of numbers

granite stirrup
#

What query?

next crown
#

server ip

calm oriole
#

do you just want to ping it to see if it's up?

granite stirrup
#

Socket?

next crown
#

no

#

i mean

#

everry server original ip address

#

just like 192.168.1.1

#

these

granite stirrup
#

What's query tho

calm oriole
#

you want to get the actual ip address of a domain?

#

what it corresponds to?

next crown
#

yeah

calm oriole
#

I am not sure how to do that

#

let me google it

granite stirrup
#

INetAddress?

next crown
#

yeah like that

calm oriole
#

how do you want to get it? Are you writing a plugin that needs it

#

?

next crown
#

yes

calm oriole
granite stirrup
#
InetAddress address = java.net.InetAddress.getByName("some.thing.domain");
String addressStr = address.getHostAddress()```
hot hatch
#

is there a way to get the advancement name? if i do getAdvancement() it will be something like org.bukkit.craftbukkit.v1_16_R3.advancement.CraftAdvancement@6938472
but i want it to be like "Bed time!" or whatever the advancement name it is

sullen dome
#

Advancement names are pretty much handled client-side. so probably not possible

hot hatch
#

o ty

calm oriole
#

Idk if that will work

hot hatch
#

hm i'll try it

sullen dome
#

i don't think that gives out the advancement name

#

probably just the registered key

hot hatch
#

oops

#

the event is PlayerAdvancementDoneEvent

#

i didn't mention that sorry

calm oriole
sullen dome
#

yeah thats true tho

calm oriole
#

so you could do a switch statement

sullen dome
#

god

calm oriole
#

and get the string

#

super lame

#

but it will work

sullen dome
#

switch statement with more than 100 advancements

calm oriole
#

yeah

sullen dome
#

best way is probably getting the key, replacing _ with , and convert to lower/uppercase.

hot hatch
#

i can't get the key in an PlayerAdvancementDoneEvent..

sullen dome
#

i hate key codes

#

any ideas what the java keycode for rightshift is?

calm oriole
hot hatch
#

oh

sullen dome
#

it uses integers.. and theyre not shown on the website

calm oriole
#

so uh

#

have fun!

sullen dome
#

yea

quaint mantle
#

keybind components don't use "java keycodes" lol

sullen dome
#

they pretty much hardcore that shit

#

idk what these keycodes are

quaint mantle
#

can't you register the keybind identifier to the configured key name?

sullen dome
#

i mean, there's KeyEvent#VK_SHIFT, but thats not really what i need

quaint mantle
#

i mean after all you are showing a keybind component

sullen dome
#

nope

#

it takes in an integer

quaint mantle
#

wat

#

keybind components don't use that

sullen dome
#

for minecraft they do

quaint mantle
#

"for minecraft"

#

yes we are talking about minecraft

sullen dome
#

they all take in the manual keycode. so i need those integers. but i couldn't find any info on which keyboard-key is which integer-key

#

if you know what i mean

hot hatch
#

its giving minecraft:adventure/arbalistic

sullen dome
#

there's InputMappings.getInputByName(string).getKeyCode() that returns an integer, but i dont really know what to put in as the string...

#

as i don't have any key list

quaint mantle
#

idk what kind of decompiler you're using though but fabric's ff fork shows this :thonk: so they are gotten from those constants ig

sullen dome
#

mine is from mcp

#

so i guess fabric has another system

#

but this works. thanks my dud

silver wadi
#

is there any way to make commands player specific without using a database?

sullen dome
#

a config maybe

silver wadi
#

I have a "flash" command which essentially ticks a isSprinting variable to true when the command is ran

quaint mantle
#

coolio

silver wadi
#

and when a player sprints (using PlayerToggleSprintEvent), it checks if isSprnting is true or not, and if it is then it applies speed to the player

#

but it applies speed to all players, but I want it only to apply to the player who ran the command

sullen dome
#

someone has an idea how i can configure that my minecraft (gradle) re-opens automatically when its already started? so basically i don't need to close the old instance by myself

hybrid spoke
cedar rampart
#
public class InventoryGui {
    public Inventory inventory;

    public Inventory setInventory(Inventory inv){

        inventory = Bukkit.createInventory(null,9, ChatColor.AQUA +"GUI");
        ItemStack item = new ItemStack(Material.CRIMSON_DOOR);
        ItemMeta meta = item.getItemMeta();


        ItemStack bow1 = ItemManager.ScanArrow;
        ItemStack bow2 = ItemManager.ShockArrow;

        meta.setDisplayName(ChatColor.DARK_RED+"exit");
        item.setItemMeta(meta);




        inventory.setItem(0, bow1);
        inventory.setItem(1,bow2);
        inventory.setItem(8,item);



        return inv;
    }
}
#

can someone tell me whats wrong here?

#

im new to this and i cant find out whats wrong

quaint mantle
#

repo for pluginbase?

hybrid spoke
sage swift
#

probably doesnt actually set the inventory

quasi flint
#

u return the inventory and done it is

quasi flint
hybrid spoke
#

oh yeah, he returns the parameter inv, not the actual inventory

spring river
#

Hello, I've a question. Can I run a spigot plugin on a spigot-paper server without any changement on the plugin please ?

eternal oxide
#

yes

spring river
#

@hybrid spoke Thanks for your authorization ! 🙂

#

@eternal oxidethx

calm oriole
#

Despite me explicitly including plugin.yml in my maven build path, it isn't being included in the jar

#
    <build>
        <resources>
            <resource>
                <directory>src/main/resources</directory>
                <includes>
                    <include>plugin.yml</include>
                </includes>
            </resource>
        </resources>
        <finalName>Libabel</finalName>
        <plugins>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-compiler-plugin</artifactId>
                <version>3.8.1</version>
                <configuration>
                    <source>${java.version}</source>
                    <target>${java.version}</target>
                </configuration>
            </plugin>
        </plugins>
    </build>
#
[01:18:13] [Server thread/ERROR]: Could not load 'plugins/Libabel.jar' in folder 'plugins'
org.bukkit.plugin.InvalidDescriptionException: Invalid plugin.yml
        at org.bukkit.plugin.java.JavaPluginLoader.getPluginDescription(JavaPluginLoader.java:170) ~[spigot.jar:3111-Spigot-66f9d3c-cbf2f67]
        at org.bukkit.plugin.SimplePluginManager.loadPlugins(SimplePluginManager.java:144) ~[spigot.jar:3111-Spigot-66f9d3c-cbf2f67]
        at org.bukkit.craftbukkit.v1_17_R1.CraftServer.loadPlugins(CraftServer.java:384) ~[spigot.jar:3111-Spigot-66f9d3c-cbf2f67]
        at net.minecraft.server.dedicated.DedicatedServer.init(DedicatedServer.java:232) ~[spigot.jar:3111-Spigot-66f9d3c-cbf2f67]
        at net.minecraft.server.MinecraftServer.x(MinecraftServer.java:986) ~[spigot.jar:3111-Spigot-66f9d3c-cbf2f67]
        at net.minecraft.server.MinecraftServer.lambda$0(MinecraftServer.java:307) ~[spigot.jar:3111-Spigot-66f9d3c-cbf2f67]
        at java.lang.Thread.run(Thread.java:831) [?:?]
Caused by: java.io.FileNotFoundException: Jar does not contain plugin.yml
        ... 7 more
eternal oxide
#

using InteliJ?

calm oriole
#

yes

#

I am building w/ maven tho

eternal oxide
#

building with Artifacts?

calm oriole
calm oriole
eternal oxide
#

Those are Artifacts

calm oriole
#

so yes

eternal oxide
#

Wrong place

#

Menu very right of screen

#

labeled as maven

#

in there under lifecycles, use Package

#

your jar will then be placed in a folder called Target

chrome beacon
#

^ and make sure your plugin.yml is in the resource folder

calm oriole
calm oriole
eternal oxide
#

read the log and see where it failed

calm oriole
#

[INFO] --- maven-compiler-plugin:3.8.1:testCompile (default-testCompile) @ Libabel ---
it failed here

eternal oxide
#

?paste your log and your pom

undone axleBOT
calm oriole
chrome beacon
#

Send full log

quasi flint
#

there is a paste link

chrome beacon
#

?paste

undone axleBOT
chrome beacon
#

Please..

quasi flint
#

there is a paste log

#

link

sage swift
#

where

#

i don't see one

eternal oxide
# calm oriole

Try adding in your <build> <defaultGoal>clean package</defaultGoal>

quaint mantle
#

you use ${java.version} but don't define it as a property

calm oriole
quaint mantle
#

it def what I said

calm oriole
calm oriole
quaint mantle
#

<java.version>16</java.version>

#

to properties

eternal oxide
#

^

quaint mantle
#

Should definitely be learning what you pasting

calm oriole
#

that worked, thanks

quaint mantle
#

Also the first result on google btw

#

testCompile failed: multiple points is what I searched

calm oriole
#

this is my first time ever using maven. I tried using gradle but got trapped in hell for 3 straight hours trying to debug it, so I vowed to never use package managers again. Until now.

eternal oxide
#

Yeah, beginning Maven is easiest

#

Gradle is more for Business and large group projects.

quaint mantle
weary geyser
#

Is there any ArmorEquipEvent lib that works on 1.16.x?

chrome beacon
#

The usual should work

weary geyser
chrome beacon
#

It's not?

weary geyser
#

Nope

chrome beacon
#

Ah it got abandoned

weary geyser
#

Yup

chrome beacon
#

You can always fork it I guess...

calm oriole
#

now, say I wanted to always copy the jar to my test server's plugin folder. Is there a way to do that after building through maven?

weary geyser
#

I guess

calm oriole
#

in intellij

chrome beacon
#

Or try getting the one from Paper (I think..)

calm oriole
weary geyser
chrome beacon
#

Don't they have that added to their API

#

You can try using theirs and moving it in to your plugin

chrome beacon
weary geyser
#

Oh

#

They have it

#

Nvm

#

PlayerArmorChangeEvent

calm oriole
#

just, adding the directory I want the jar to be?

chrome beacon
#

Show what you did

calm oriole
#

    <properties>
        <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
        <maven.compiler.source>16</maven.compiler.source>
        <maven.compiler.target>16</maven.compiler.target>
        <java.version>16</java.version>
        <outputDirectory>../SpigotTestServer/plugins/</outputDirectory>
    </properties>

#

I added it to outputDirectory

chrome beacon
#

It should be in build not properties

calm oriole
#

ok

#

that does not put the jar there, that puts a compiled copy of all files included in the jar there

chrome beacon
#

Hm might have to be in the jar or compile plugin configuration then..

#

Try Google

#

I'm not home atm

calm oriole
#

ok

#

thanks for your help

calm oriole
#

#general message @rocky glacier

what kinds of errors are you having?

rocky glacier
#

"cannot be resolved to a type"

chrome beacon
#

Send code

#

;/

calm oriole
chrome beacon
#

You're giving us nothing to work with

eternal oxide
#

decompiled code

rocky glacier
#

Whats the problem when it says "cannot be resolved to a type -> net.milkbowl.vault.economy"

chrome beacon
#

did you decompile your own stuff

chrome beacon
rocky glacier
#

wait im sending decompile

calm oriole
#

also, fyi, I am like 90% sure that using an external currency to directly buy in-game currency violates mojang TOS.

rocky glacier
#

it buys BTC but w/in-game money

eternal oxide
#

This seems to just be using the Bitcoin name

calm oriole
#

wait, are you actually using real bitcoin?

#

no

#

ok

eternal oxide
#

It looks like its a random chance of mining Bitcoins (in game) when mining with the correct tool

rocky glacier
#

yh exactly

calm oriole
#

it looks like a market simulator

#

and you can mine it too

rocky glacier
#

thats true

calm oriole
#

pretty cool

rocky glacier
#

thx

calm oriole
#

are you using an IDE, like intellij?

rocky glacier
#

IDE

calm oriole
#

Integrated development environment

rocky glacier
#

ah lol i use eclipse

chrome beacon
#

Add Vault as a dependency

calm oriole
#

download and import the jar, or use a package manager like gradle or maven

eternal oxide
#

Eclipse has maven built in

chrome beacon
#

So does Intellij

eternal oxide
chrome beacon
#

True 😉

rocky glacier
#

ough how do i do that agian with maven

chrome beacon
#

If you're just quickly modifying a plugin it's probably easier to just add dependencies manually by importing the jar

rocky glacier
#

help me wrap my head around this

eternal oxide
#

you don;t need a manifest

rocky glacier
#

so just maven/me.bitnet/BtcMining/ -> pom.properties + pom.xml

main tangle
#
    @EventHandler
    public void tntHitEvent(ProjectileHitEvent e){
        if (e.getEntity() instanceof TNTPrimed){
            TNTPrimed t = (TNTPrimed) e.getEntity();
            t.setFuseTicks(0);
        }
    }
``` gosh
#

i am trying to make tnt explode when touched the ground

#

no errors

#

it doesnt work

chrome beacon
chrome beacon
#

;/

#

I don't use Eclipse

rocky glacier
#

Ah so ig i have to add just at libraries

#

Like i did with API jar file

chrome beacon
#

Yes

quaint mantle
quasi flint
#

i would guess

#

never messed with packets

main tangle
quaint mantle
#

👩‍🚒

#

Entity

chrome beacon
quaint mantle
chrome beacon
#

Explode when tnt hits block

quaint mantle
#

Just do a while entity isvalid loop and check if the block directly below it is set or not

wraith rapids
#

a while loop will crash the server

#

use the scheduler

main tangle
chrome beacon
#

Use a scheduler and loop all tnt

main tangle
hybrid spoke
#

seems like you are not only new to spigot

main tangle
#

wait i got it

#
            BukkitScheduler scheduler = main.getServer().getScheduler();
            scheduler.scheduleSyncRepeatingTask(main, new Runnable() {
                @Override
                public void run() {
                    if (tnt.isOnGround()){
                        tnt.setFuseTicks(0);
                    }
                }
            }, 0L, 20L);
#

something like this?

chrome beacon
main tangle
#

i'll use the scheduler more often

ivory sleet
wraith rapids
#

that's not DI purism enough

ivory sleet
#

🥲

wraith rapids
#

they should inject main and the scheduler separately as they're separate dependencies

#

every constructor MUST have at least 25 parameters or it isn't proper DI

ivory sleet
#

Good point lmao

main tangle
#

i actually made throwable dynamites 😳

hybrid spoke
#

i'm so proud of you

#

now do throwable nuclear bombs

wraith rapids
#

do throwable intercontinential ballistic missiles

ivory sleet
#

Do throwable confetti PES4_Gimme

acoustic pendant
#

?paste

undone axleBOT
hybrid spoke
#

tbh is over Bukkit
to be honest is the other way around

quaint mantle
#

So bukkit is just the lazy version