#help-development

1 messages Β· Page 13 of 1

glossy venture
#

so that should get them in order

crystal palm
#

hmmm.. oky

chrome beacon
#

Does the entry set preserve order?

#

I guess that depends on the map implementation

glossy venture
#

i think so

#

if the map preserves order

crystal palm
#

new ArrayList(entrySet)
dont understand this part. im new to programming so bear with me here lol

#

i dont like the look of those yellow thingies..

#

oky

#

what do i do here then πŸ€”

#

should it be <Enchantment> instead?

#

christ this is getting confusing πŸ˜…

tender shard
#

you can use placeholders

#

in maven it's called "filtering resources", but no idea how it works in gradle

#

in maven it's basically just one line in the pom, and then you can use placeholders in all resources like this

name: MyPlugin
version: ${project.version}
crystal palm
#

wait a second.. it should already check for incompatibilities..

tender shard
#

but it says it does NOT check incompatibilities

crystal palm
#

oh fuck

#

im blind

#

:(

tender shard
#

you might have to manually go through the existing enchantments, then check if they are compatible with the new one

sharp verge
#

Does anyone know how to remove the Banner "Attributes/names" that occurs when you add a Pattern array to your BannerMeta

#

The five lines right under the blue "HOLD NAVN"

crystal palm
tender shard
sharp verge
#

Yea i read abotu that, but it didn't seem to fix it

tender shard
#

did you try to add all flags?

sharp verge
#

Hmm... nope, lemme try

tender shard
#

try this

ItemStack item = ...;
ItemMeta meta = item.getItemMeta();
meta.addItemFlags(ItemFlag.values());
item.setItemMeta(meta);
#

if this doesn't work, you can only use packets to make it disappear

sharp verge
#

Alright i found the problem

#

As i am new to the Spigot Api, please don't hate. I used the removeItemFlags, instead of addItemFlags.........

#

Welp, it works now, soo thank you :)

tender shard
#

πŸ˜„

#

do you know which flag exactly was required to hide the patterns?

#

I just wonder

sharp verge
#

Imma figure that out in 2 seconds

#

The potion effects

tender shard
#

thx

#

I'll add it to the javadocs

sharp verge
#

I read a post somewhere but i couldn't get it to work (because my dumbass used the wrong shit)

sharp verge
tender shard
severe turret
#

Anyone knows why this might be happening

#

I'm adding the Residence.jar as library to my project

tender shard
severe turret
#

It's not on maven

#

Have to do it manually

tender shard
#

did you add it to your pom?

severe turret
#

yeah i tried this

#

wait

torn shuttle
tender shard
severe turret
#

mvn install:install-file -Dfile=Residence.jar -DgroupId=com.bekvon -DartifactId=residence -Dversion=5.0.1.7 -Dpackaging=jar

#

I did this

#

and then had

tardy delta
tender shard
#

when compiling, maven copies all the resources into the "target" folder, while replacing all the placeholders. The ${project.version} is whatever you defined as <version> in pom.xml. I am sure that gradle has a similar thing but I am not familiar with gradle

cunning canopy
#

Are datapacks faster than plugins?

tender shard
tender shard
#

if the plugin is shitty, yes

cunning canopy
#

Let's say you use the most optimal solution for both

tender shard
#

it still depends. datapacks require to manually run many commands for certain things. in that case I think the plugin would be better

severe turret
#

ah

#

it seems to work now

#

guess I had to reset intellij

#

ty

tender shard
#

np

tender shard
#

this one

severe turret
#

yep

dry forum
#

anyone know if jitpack is free for private repositories

tender shard
#

it cannot access private repositories

dry forum
#

it can

tender shard
#

how?

dry forum
#

acess token

tender shard
#

does that file only contain information about this one player?

#

so only for this player? then I don't see any problem

#

it would be shitty to save a file that contains information about all players

#

no problem, go for it

#

but expect for admins to hate you

#

"uugh I have 7972 files now, this slows down my backup"

#

that's why I switched to using PDC for playerdata

#

because people used FTP for backups and that sucks when having many small files

chrome beacon
#

Zip first then ftp uwu

tender shard
#

I always just backup the entire VM's "hard disk file"

severe turret
#

@tender shardok

#

can you tell me for what reason is maven trying to pull a dependency from repo thats not even supposed to have it?

#

im about to break something

worldly ingot
#

It searches all repositories for dependencies

severe turret
#

but for what reason

#

It tells me it cannot find the dependency in that repo

#

no shit

#

it's not there

worldly ingot
#

;p It wants to be thorough

severe turret
#

I want to break my table

#

fucking maven

waxen plinth
#

You can specify which repos serve which artifacts

severe turret
#

It's local

waxen plinth
#

But how is it supposed to know without checking

severe turret
#

...

#

yes

#

it can check

#

but why does it not check local?

chrome beacon
#

It does

waxen plinth
#

Maybe you're skipping a step

severe turret
#

apparently it doesnt

#

because my build fails

waxen plinth
#

Stop jumping to conclusions

#

Your artifact might be in the wrong place

#

Or have the wrong version

chrome beacon
#

Are you sure it's in maven local

waxen plinth
#

^

chrome beacon
#

And that you haven't specified another maven local in your IDE

severe turret
#

yes

#

i used mvn install:install-file

#

to install it

#

same way I installed another one

chrome beacon
#

Sounds like you made a typo

severe turret
#

:D

#

ok

waxen plinth
#

Make sure you typed the dependency correctly

#

It's case sensitive

severe turret
#

next you'll tell me to restart my pc

#

sorry but I'm not stupid

waxen plinth
#

We're trying to help you by running through everything that could be wrong that you haven't said

#

You still haven't shown us your pom or your file structure in your maven local

#

So the ways we can help are pretty limited

#

We're not psychic

tender shard
#

do mvn clean compile -U -X then send the full log

tender shard
pseudo cradle
severe turret
#

k

#

mvn install:install-file n20301230130123213 fixed it

tender shard
#

then you did not have it in your local repo

severe turret
#

I did

tender shard
#

can't be

severe turret
#

It said build succesfull every time

pseudo cradle
#

apparently not

tender shard
#

if it didnt work, but works after installing it, it wasnt in your repo before. otherwise this wouldnt have fixed it

severe turret
#

I installed it

#

before

waxen plinth
severe turret
#

million times

#

this time it worked

#

dude

#

I used

#

the same command

#

20000 times

#

and somehow it works now

chrome beacon
#

So the awnser is no

#

You never checked

waxen plinth
#

And you expected it to do something but never checked that it actually did

severe turret
#

my bad i expected it to work when it said build successfull

waxen plinth
#

Then acted like we were insulting your intelligence by asking you these basics

severe turret
#

no

#

im just mad

tender shard
#

just stop being mad and be fabulous instead

waxen plinth
#

When you're getting mad at code you need to take a step back and cool off

#

When you're angry you become much worse at debugging

#

You get tunnel vision

severe turret
#

yes

#

maven gives me headache

#

its annoying to deal with

tender shard
tender shard
waxen plinth
tender shard
#

oh shit

#

I don't do enough cocaine to hit the ballmer peak

#

and with "not enough" i mean "none"

#

:sad noises:

waxen plinth
#

I took a lot of THC yesterday and played clash of code

#

I was actually a god somehow

#

I think I hit my ballmer peak at some point in there

tender shard
#

I can't code after weed. but I don't do it since 3 years anymore anyway

waxen plinth
#

I got a 41 second submission on one problem

#

And it wasn't a one-liner, it was like 4 or 5 lines

solid cargo
#

Found out event priorities are on the byte scale. Priority.HIGHEST = 64. Will priority be EVEN higher if i change it to 127?

tender shard
#

this is pretty relatable to me though

waxen plinth
#

Time feels a lot slower when I'm high

tender shard
waxen plinth
#

So maybe the answer is that I'm actually in perpetual bullet time

#

Which lets me think and type inhumanly fast

#

Can't think of any other explanation because a 41 second solution is insane

solid cargo
pseudo cradle
#

makes me tired

willow widget
#

has anyone ever done the thingy that makes a compass point to the closest player?

tender shard
#

it's basically ```java
while(noQuestionPosted()) goOffTopic();

waxen plinth
willow widget
tender shard
willow widget
#

literally right above your message xD

waxen plinth
#

It's easy

willow widget
#

any help pls? c:

tender shard
#

what's your question?

waxen plinth
#

Well what part are you confused about

willow widget
waxen plinth
#

We're not just gonna write all the code for you

willow widget
#

how do I access the compass pointing?

tender shard
#

Player#setCompassTarget()

willow widget
#

and is there an specific way of getting the closest player or that's just algorithm?

willow widget
waxen plinth
#

Hmm

tender shard
crystal palm
#

thanks a ton but i didnt understand what you were saying. instead, i just ended up checking conflicts b/w the tool and the enchanted book's currently selected enchantment in the loop lol

willow widget
willow widget
solid cargo
#

Anyway…

crystal palm
#

does this work for anyone else in 1.19 btw? or did the event break

solid cargo
#

Found out event priorities are on the byte scale. Priority.HIGHEST = 64. Will priority be EVEN higher if i change it to 127?

chrome beacon
#

Maybe but don't

crude estuary
#

or Just

#

?tryitandsee

#

not Working?

chrome beacon
#

Typing link by hand on mobile 😞

crude estuary
#

Wow

solid cargo
#

What if my trying ass aint at home?

#

Host server on the cool A13 chip??

tardy delta
#

?

tender shard
# willow widget nice, does that have a distance limit? bc my players might be like ~1000 blocks ...

some tiny idea


    static {
        new Runnable() {

            @Override
            public void run() {
                for(Player player : Bukkit.getOnlinePlayers()) {
                    setCompassTarget(player);
                }
            }
        };
    }

    private static void setCompassTarget(Player player) {
        Player other = getNearestPlayer(player);
        if(other != null) {
            player.setCompassTarget(other.getLocation());
        }
    }

    private static Player getNearestPlayer(Player player) {
        return player.getWorld().getPlayers().stream().filter(other -> player != other).sorted((o1, o2) -> (int) o1.getLocation().distanceSquared(o2.getLocation())).findFirst().orElse(null);
    }
#

ofc the runnable has to be scheduled

#

I just quickly typed this down, might have a quirk or two, but this is the general idea on how to make everyone's compass point to the closest other player

tender shard
#

also didnt you post that like 3 times already today lol

solid cargo
solid cargo
tender shard
#

there is no variable called "byte" in EventPriority

solid cargo
#

Change EventPriority to a number

#

(priority = randomNumber)

tardy delta
#

you cant?

solid cargo
#

I litteraly did at home

tender shard
#

I still dont get it

hybrid spoke
#

but wont that just jump back to the default since it doesnt recognize the priority ^or doesnt even compile

solid cargo
#

Maybe its on paper. Sorry bout the confusion bois

hybrid spoke
#

have to be

solid cargo
#

It didnt show me errors at home

tender shard
#

paper also doesn't allow a byte value

tardy delta
#

are we talking bout thread priority?

solid cargo
#

Was i in an alternate universe

tardy delta
#

probs

solid cargo
#

Maybe bungee????

#

Got to be bungee

#

I REMEMBER IT VIVIDLY ISTG

hybrid spoke
tender shard
#

Thread allows to use an int for priority but it must be between 1 and 10

#

at least it must be between 1 and 10 in the JDK I'm using lol

#

I wonder why they didnt allow to go from -20 to 19 like UNIX does

rough drift
#

Is there a way to check whenever a bell is actually used, rather than just clicked on? (if you click on the sides it does not activate)

tender shard
#

probably not

#

why not just check the clicked blockface?

rough drift
#

fair point

tender shard
#

I FUCKING HATE PEOPLE LIKE THIS

#
  1. Ask a question
  2. Reply to yourself "nvm I figured it out" without providing their solution
  3. Also close the thread
tardy delta
#

lmfao

rough drift
#

It's fine I'll just use sides

solid cargo
#

They should be banned ngl

tender shard
#

I also dont understand why people close threads in the first place. Someone else might have a question related to it, found it on google, and then they cannot replx

tender shard
rough drift
crude estuary
#

JavaDocs is a Thing, they know that?

tender shard
crude estuary
#

the Dude in the Image

tender shard
#

but erm

willow widget
tender shard
willow widget
#

nope but I think I'll have to learn it now! lol

#

Wanted to learn about that already anyways so better now than ever xd

tender shard
#

you could of course just replace the stream with a for loop, or take this as a go to look into how streams work :3

willow widget
#

yup, I'll do that xd

tender shard
#

basically the filter(...) part just removes the "own" player from the list, then the sorted(...) stuff sorts the remaining players by distance

#

we're using distanceSquared instead of distance because it's faster, it doesn't need to get the square root like the normal distance method would have to do

#

and yeah then it just gets the first player in that list (so the nearest one), or null if there is no other player

#

i fucking love GH copilot

#

wake me up when september ends (because then I gotta renew my github thing). until then I don't have to code anything, just press tab

rough drift
#

how can I check the direction of a block btw

#

you can't cast block to directional (well you can but it errors)

tender shard
#

cast the blockstate to Directional

rough drift
#

tbf I don't need instanceof Directional since I only need it for a particular block type

tender shard
#

you can never cast Blocks to anything

#

you can always only cast the BlockState

willow widget
#

Yeah, that actually makes a lot of sense in the code lol

#

sorry if I take a while to answer, I'm working on 1 pc and here on discord on another lol

tender shard
#

no problem πŸ˜„

#

you will learn to love streams some day, they are awesome ❀️

willow widget
#

yeah I already love them bc they always seem so useful, I just get scared of the ->(){} thingies lmao

tender shard
#

those are lambdas

willow widget
#

but explained it makes sense and makes it easier to understand so tysm

tender shard
#

I wrote a tiny tutorial about it onnce

#

lemme show you

willow widget
rough drift
#

class org.bukkit.craftbukkit.v1_19_R1.block.impl.CraftBell cannot be cast to class org.bukkit.material.Directional (org.bukkit.craftbukkit.v1_19_R1.block.impl.CraftBell and org.bukkit.material.Directional are in unnamed module of loader java.net.URLClassLoader @484b61fc) casting block.getBlockData()

rough drift
#

they are like functions

#

but without a name

#

actually

tardy delta
#

they are fun

rough drift
#

they are literally functions without a name

tardy delta
#

and hot

rough drift
#
Consumer<String> string = str -> {
  return "String: " + str;
}

string.accept("hey"); // String: hey

and

public String string(String str) {
  return "String: " + str;
}

string("hey"); // String: hey
#

are both the same

#

only that lambdas can be passed as variables in functions

#

@willow widget

tardy delta
#

dont call it string two times πŸ™„

rough drift
#

wdym

tender shard
#

yeah that won't work

rough drift
#

oh ye

#

fixed

#

ofc you can just type "String: " + str after the -> but with return you can understand the example better so ye

clever musk
#

I'm trying to get an entity location off thread, is there a good way of doing that?

tardy delta
chrome beacon
tardy delta
#

^^

rough drift
#

(tried getBlockState as it made sense)

tender shard
#

oh wow I just had an extremely nice chat with someone who uses one of my plugins on 1.8 even though it only supports 1.9+

#

and that dude was really extremely nice

#

didnt expect that

#

lol

rough drift
#

some 1.8 players are chill

chrome beacon
#

That's a rare find

tender shard
#

yeah I was kinda surprised lol

rough drift
#

Directional directional = (Directional) block.getState(); why does this error

#

I am confus

tender shard
#

show the error

willow widget
willow widget
tardy delta
#

if you take a look at the consumer interface you ll see java interface Consumer<T> { void accept(T t); }

rare flicker
#

I want to detect whenever a player open a book in a lectern, do i just use PlayerInteractEvent?

tender shard
#

tbh I think what Ike send is a very confusing example

#

stuff like what he sent made me hate lambdas etc lol

#

that's why I wrote the blog post, it explains it in a way how I would have understood it lol

#

I'll just give a more "real life" example

#

can be replaced with this:

#

notice how the "Comparator<Location>" only has one method, with the parameters being called "o1" and "o2"

#

and the lambda way just starts with (o1, o2) ->

#

and then just declares the same thing

willow widget
#

not my best idea to learn this stuff while working 😩

tender shard
#

oh alright lol. Just check out the blog post, it's explained as easy as possible there

chrome beacon
#

mfnalex you should make a post on custom heads with spigot api

willow widget
#

yeah, will do lol

chrome beacon
#

I'm tired of explaining it

tender shard
#

you mean base64 texture?

chrome beacon
#

Yes

tender shard
#

I always just send people to my SkullUtils class

chrome beacon
#

Ew NMS

tender shard
#

(I'm NOT using PlayerProfile because this is supposed to work with 1.16+)

chrome beacon
#

Make a post on the new api

tender shard
#

yeah could probably do that

#

or you write it πŸ˜„

#

I hate writing on my macbook because it has this broken keyboard that sometimes adds double letters

chrome beacon
#

Not home for 2 weeks and I'd rather not write that on my phone

tender shard
#

ooh

#

that makes sense

#

?todo

#

-todo

#

oh shit we're on spigot's discord

#

lmao

formal bear
#
<plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-shade-plugin</artifactId>
                <version>3.2.4</version>
                <executions>
                    <execution>
                        <phase>package</phase>
                        <goals>
                            <goal>shade</goal>
                        </goals>
                        <configuration>
                            <filters>
                                <filter>
                                    <artifact>*:*</artifact>
                                    <excludes>
                                        <exclude>META-INF/*.MF</exclude>
                                    </excludes>
                                </filter>
                            </filters>
                            <createDependencyReducedPom>false</createDependencyReducedPom>
                            <outputFile>H:\server\server\plugins\${project.name}-${project.version}.jar</outputFile>
                        </configuration>
                    </execution>
                </executions>
            </plugin>

Why it does not shade?

torn shuttle
#

what's up gamers say is making a sex plugin allowed on spigot

tender shard
tender shard
#

maybe ping optic to be sure

formal bear
tender shard
ocean lion
#

Anybody know a Coinsapi which works for 1.19

tender shard
tender shard
# formal bear

should work. But why did you define a different location for the shaded .jar?

ocean lion
#

playerpoints

rough drift
#

it ain't

tender shard
#

why? it doesnt say so in the rules

formal bear
torn shuttle
tender shard
tender shard
#

I thought you wanted to do a sex plugin yourself

torn shuttle
tender shard
#

but how does it work? spawn NPCs when two players right click each other?

torn shuttle
#

why would I make a sex plugin for a game whose main audience seems to be 9

tender shard
rough drift
#

I believe it is grabify

torn shuttle
#

that goes into the list of top 10 things that will not get you out of the lawsuit going your way

vagrant stratus
tender shard
#

are the javadocs valid english? copilot wrote it, but i never heard "farthest" before

rough drift
tender shard
#

kkk thx

rough drift
#

hol' up

torn shuttle
#

afraid that gets your account banned

tender shard
#

it's "kkk"

#

I always do it like that

torn shuttle
#

enjoy jail bigot

tender shard
#

when I am extremely satisfied with the answer, I might even go "kkkkk"

tender shard
torn shuttle
#

oh shit

#

he hit me with that uno reverse card

torn shuttle
#

now that does hold up in court, if you say that to the judge after sentencing the judge has to go to jail

tender shard
torn shuttle
#

lawyers hate this one weird trick

tender shard
torn shuttle
#

disgraced lawyer is a term with such a negative connotation, we prefer using differently graced lawyer around here

rain mason
#

i tried to convert an ItemStack to json - but it throws this error: Caused by: java.lang.reflect.InaccessibleObjectException: Unable to make field private final java.lang.Object java.util.Optional.value accessible: module java.base does not "opens java.util" to unnamed module @60fad1ab
my code: ```java
import com.google.gson.Gson;

// it = instanceof ItemStack
// gson = new Gson();

invv.add(gson.toJson(it, ItemStack.class));```

tender shard
#

ItemStack already has a serialize() method that returns a Map<String,Object> and also implements ConfigurationSerializable - is there a reason why you want to use json instead?

chrome beacon
#

You can just use a yml file

tender shard
#

I'd just use a YamlConfiguration

chrome beacon
#

?config

#

;/

tender shard
#

myYmlConfig.set("item",myItemStack);

chrome beacon
#

?config-files

tender shard
#

?customconfig

chrome beacon
#

What was the command again

tender shard
#

?customconfigs

#

?configs

undone axleBOT
chrome beacon
#

Ah

rain mason
#

except inventory saving

torn shuttle
#

first draft trying to actually link my projects together on spigot, how's this looking?

rain mason
#

ignore the path at the top i forgot to properly crop it

tender shard
#

that doesnt really look like json to me o0

#

what if an item's name contains ||| because someone renamed it on an anvil?

rain mason
#

or just swich to even more complex split patterns

reef lagoon
tender shard
#

why dont you just go full json for your data

chrome beacon
#

Or yml

tender shard
#

or make your life easy and use a Yaml

#

yeah

#

sorry but your current solution looks like a horrible workaround

halcyon mica
#

@tender shard They are not attachable either

tender shard
#

hm

#

one sec

#

okay I also couldnt find anything

#

oh wait

#

I remember

#

they indeed dont have any "facing"

halcyon mica
tender shard
#

yeah they dont have any facing by design

#

they always "attach" to all blocks that are "nearby"

halcyon mica
#

That is not true

#

it still has all 6 facing properties in its block data

tender shard
#

last time I checked, they always attached to all "nearby" solid blocks

halcyon mica
#

The MultipleFacing interface implements those 6 facing blockstate fields

#

And is used by regular vines and glow lichen

torn shuttle
#

fyi for that sex plugin I warned about earlier, there's a decent chance the author's spigot account is compromised or something, somehow it went from a restart with a custom message plugin to a sex plugin and the version also went out the window

#

I don't think that's quite right

tender shard
tender shard
chrome beacon
halcyon mica
#

I'll just wait, it's fine

tender shard
#

you should at least open a feature request on jira

#

?jira

undone axleBOT
torn shuttle
#

I reported it, I don't really care beyond that just noticed I still had to tab open

tender shard
#

oh ok

#

do you know what the sex plugin actually does though?

#

I am curious lol

torn shuttle
#

dl it and run it at your own risk

chrome beacon
#

Sounds like malware if account is compromised

torn shuttle
#

preferably in a vm

chrome beacon
#

Decompile it and take a look

torn shuttle
#

dl page leads to... google

#

huh

tender shard
#

are there any other comparators that one could commonly need in spigot plugins?

sharp verge
#

What is the best way to save information and store it in files? So that each player has their "own" file

tender shard
#

<uuid>.yml

torn shuttle
#

yep dl page just leads to google the fuck is going on with this lol

tender shard
#

store the "end date" in some file, then check every second / minute if that date has been reached

torn shuttle
torn shuttle
#

skip checking all entities check only online players

tender shard
sharp verge
# sharp verge Yea

Im trying to make a "teams" plugin, and i need somewhere to store information for each player, like what team they are on, their roles etc.

tender shard
cunning canopy
#

Most efficient way to place multiple blocks?

tender shard
#

how many blocks?

torn shuttle
#

I'd say at least 80% of distance checks are for players specifically so I would do it

tender shard
#

I mean it's just a comparator, it doesn't get the list of entities itself

cunning canopy
torn shuttle
#

oh

tender shard
torn shuttle
#

I thought you were also getting the list

tender shard
#

oh no

#

it's really just a Comparator<Entity>

cunning canopy
tender shard
#

Block#setType

#

and you can pass "false" to disable physics checks

cunning canopy
#

Oh

#

Passthrough blocks?

torn shuttle
#

no, physics updates like water

tender shard
#

someBlock.setType(Material.AIR, false)

lavish folio
#

can i make low horizontal knockback multyplayer on 1.8?

cunning canopy
#

Oh

tender shard
#

this will stop physics checks like... whether signs are attached to that bblock, etc

tender shard
cunning canopy
#

What if its over 1000 blocks?

sharp verge
tender shard
lavish folio
sharp verge
#

So like

plugins folder >
  Teams folder >
    TeamPlayerData folder >
      *lots of files with seperat player files*```
tender shard
tender shard
sharp verge
#

Mfnalex, but if i wanna create files in a folder inside the plugin resource folder, how would i do that

delicate lynx
#

just no

rain mason
#

slayy

tender shard
tender shard
#

what you sent is just... bad

ocean lion
#

if im going to make a gui leaderboard, would I just loop for every player and check who has the highest score?

sharp verge
tender shard
sharp verge
#

Yea if thats what it is called :)

delicate lynx
#

/plugins/MyPlugin/filename.txt is what that does

rain mason
sharp verge
tender shard
tender shard
#

are you on 1.8, or why do you use NBT?

rain mason
#

i'm just used to command blocks, the {display:{Name:'{"text":"yippee","italic":false}'}} stuff
@tender shard

tender shard
tender shard
#

I thought you wanted to store information inside entities / items / blocks or so

#

because since 1.14.1+, we got the PersistentDataContainer for that stuff

#

it's like "NBT on steroids" lol

#

(in a good way)

quaint mantle
#

yo does anybody here know how to set the "You can sleep only at night" text

#

i know its possible

tender shard
quaint mantle
#

thx

tender shard
quaint mantle
#

lmao

tender shard
#

I still wonder why Player.Spigot exists

quaint mantle
#

ye

#

thank u

tender shard
#

why didnt they add the methods directly to Player

#

Oh yes, my bad

quaint mantle
#

TextComponent.fromLegacyText("text")

tender shard
#
somePlayer.spigot().sendMessage(ChatMessageType.ACTION_BAR, new TextComponent("You can only sleep on... DAYS?!"));
tender shard
quaint mantle
#

:D

worldly ingot
#

Some methods from there were added, others weren't. They're mostly legacy, but the reason we still do it now-a-days is if we have to in order to avoid name clashes

#

For instance, Inventory#getTitle():String and Inventory#getTitle():BaseComponent[] can't both exist because they have the same signatures

#

(those don't exist, but it's an example)

quaint mantle
#

oh if only they existed

tender shard
#

so it's basically just for legacy reasons

worldly ingot
#

Mostly, yeah

tender shard
#

makes sense, thx :3

#

yeah

#

everything below 1.14 is complete shit

#

well it was good back then, but now, not so much πŸ˜„

#

that's how it works lol

rain mason
#

what if I made it automatically choose between .yml and .yaml

tender shard
#

wdym?

#

normally it's just .yml

#

and since you generate the files yourself, you dont have to worry about whether its yml or yaml

quaint mantle
#

man how am i supposed to verify if my account is already verified to a different deleted one πŸ™„

tender shard
#

you ask support

tender shard
quaint mantle
#

hmm ill think about it

#

i have thought about it

tender shard
#

I think only the green staff members can do this

quaint mantle
#

@worldly ingot

#

no can verify (my account is already verified to a different (deleted) discord account))

cunning canopy
cunning canopy
#

So block#?

tender shard
#

Block#setType(Material, false);

charred pollen
#

i have a project to make which is FarmEXP, Grown Crops drops Experience Orb
i have a problem to add Pumpkin which will cause players to keep getting Experience Orb, is there a way to prevent this?
my use is BlockBreakEvent on Wheat,Potato etc.

tender shard
tender shard
#

I have made a library that lets you store information "inside" blocks

#

shit, wrong link

#

it automatically resets when a block gets broken / naturally grows etc

#

so you just do it like this:

#

in onEnable, use CustomBlockData.registerListeners() once

cunning canopy
tender shard
#

then in BlockPlaceEvent, if its a pumpkin, set some custom data to that block

quaint mantle
tender shard
#

and in blockbreakEvent, check if the broken block has that custom data - if yes, dont do anything

tender shard
quaint mantle
#

fair nuff fair nuff

tender shard
cunning canopy
#

Thanks

cunning canopy
charred pollen
tender shard
cunning canopy
#

Oh I thought I would do it when placing the blocks

tender shard
#

I guess the difference between wheat / pumpkins is that wheat needs time to fully grow, while pumpkins don't have any "age"

tender shard
#

wtf Jonathan Nathan - your parents just added an extra syllable to your last name and used that as surname lol

charred pollen
atomic swift
#

so i am trying to get a list of materials from my config and check if the block under matches one of the materials in the list but for some reason its not getting that list, i am using the ItemsAdder api

String ns = event.getNamespacedID().replace(":", "") + ".can-place";
if (Iaddon.getInstance().getConfig().getStringList(ns).contains(bunder)) return;
tender shard
tender shard
#

is the list empty?

#

or is it null?

atomic swift
#

no the list contains GRASS_BLOCK

charred pollen
tender shard
tender shard
atomic swift
tender shard
undone axleBOT
atomic swift
delicate lynx
#

please use proper logging and not that :)

atomic swift
#

ok but any reason this isnt working

quiet ice
#

How does it Not work?

tender shard
#

pls define "isn't working"

#

?notworking πŸ˜›

undone axleBOT
#

"Does not working" is a useless statement. Please describe what exactly is not working, what you expect it to do, and what actually happens. If you get any console errors, also ?paste the entire stacktrace.

rain mason
#

does anything like YamlConfiguration.getFloat exist? it's weird that getDouble, getInt etc exists, but when it comes to Float, only getFloatList works

tender shard
rain mason
tender shard
#
float number = (float) myConfig.getDouble("...");```
quiet ice
#

0x22 OR 0x5

#

So 0b10_01_00 OR 0b01_01 = 0b10_01_01 If I did it right

atomic swift
#

why isnt my if statement returning true though

quiet ice
#

What ist bundler?

atomic swift
tender shard
atomic swift
tender shard
#

print out the whole list, and print out "bundler"

#

before the if

atomic swift
#

Bukkit.getLogger().info(Iaddon.getInstance().getConfig().getStringList(ns + " " + bunder).toString());

tender shard
#

so the list contains GRASS_BLOCK? but what is "bundler"?

#

is "bundler" a string?

quiet ice
#

*bunder

#

Whatever that means

tender shard
#

oh ok

#

yeah whatever

atomic swift
#

block under

tender shard
#

aah

#

so "bunder" is a block?

quiet ice
#

Is it a String?

tender shard
#

if bunder is a block, ofc it will not be "contains" in List<String>

#

you should use bunder.getType().name() instead

quiet ice
#

(also, don't call List#contains too frequently)

atomic swift
#

well [17:39:31 INFO]: []

quiet ice
#

So it's a collection?

atomic swift
tender shard
#

just send your full code

atomic swift
quiet ice
# atomic swift its a list

Do you want to Check whether all Elements prΓ€sent in that list at prΓ€sent in your config list or what?

tender shard
#

prΓ€sent

quiet ice
#

Autokorrektur ist halt blΓΆd

atomic swift
#

what? lol

tender shard
#

@ OPTIC BAN BBAN BAN HE SPOKE GERMAN

sterile token
tender shard
#

?BAN

atomic swift
#

he speck german

quiet ice
#

Anyways, do bunder.toDtrimg()

tender shard
#

to speak, spoke, speck

#

noooo

sterile token
#

@ COn CLU Re @ Ge OL sopek on german

tender shard
quiet ice
#

Binder is Material

tender shard
#

oh

#

ok

atomic swift
#

why getName() tho

quiet ice
#

Under is location

atomic swift
#

then its a string

quiet ice
#

Exactly

tender shard
#

getName() is just a fancy method that does the same as toString() and name()

quiet ice
#

You have a list<String>

#

Not a List<Material>

tender shard
#

your IDE should cream at you for using contains(Material) anyway

atomic swift
#

what if i just do
Iaddon.getInstance().getConfig().getStringList(ns).contains(bunder.toString())

quiet ice
#

You would want to have a Set<Material> either way If Performance is a concern

sterile token
#

What is better for getting specific block?

Location location = new Location(bla);
Block block = location.getBlock();

tender shard
tender shard
# tender shard

IntelliJ would tell you that a List<String> cannot contain a Material

sterile token
quiet ice
#

?

tender shard
#

DI is not better

sterile token
tender shard
#

some people claim it's better and then give obscure reasons

#

imho both are equally good

atomic swift
#

yoooooooo thx gy\uys

sterile token
#

Oh ok i stoped to use it because all here doesnt like when someone uses DI

tender shard
quiet ice
#

Depends on what DI

tender shard
atomic swift
quiet ice
#

Guice DI and Friends belongs in the locker

tender shard
#

Guice is a big pile of shit

#

havent tried guava

daring lark
#

did anyone knows how to change biome of custom world?

biomeProvider(String biomeProvider) i've seen this method but i don't really know how to use that.

quiet ice
#

Guava isn't a DI lib, my Bad heh

tender shard
#

I also always have to laugh really loud when people claim "lombok is shit" but use guice at the same time lol

sage oxide
tender shard
#

not really

sage oxide
#

I mean, for example, on 1.7.10 were the same attributes or were some of them missing?

tender shard
#

1.16.5 added the optional "libraries" tag

#

1.13 added the "kinda-optional" "api-version" tag

#

that's it

sterile token
#

What does do that extra tag?

tender shard
#

which one

sterile token
#

api-version

fleet comet
#

How would I give a player the warden's darkness?

tender shard
#

I always set the api-version to "1.13"

sage oxide
quiet ice
#

And the Server Starts a good 10 Seconds later than usual

tender shard
#

thats not a plugin

sterile token
#

okay, and what about when need to block all mobs entities damages on 1.16 and 1.19

tender shard
#

it takes ages on my macbook to init the legacy stuff

#

like 30+ seconds

sage oxide
#

dependency

tender shard
#

"resource" πŸ™‚

sterile token
#

mfalex?

tender shard
#

mfnalex

sterile token
#

i have that dude tho

tender shard
#

i've had a few dudes myself

sterile token
#

Im needing to block mob killing but entities are diff on 1.16 and 1.19

#

πŸ€”

tardy delta
#

player.addPotionEffect

tender shard
quiet ice
undone axleBOT
tender shard
#

@fleet comet πŸ˜›

fleet comet
#

oh okay

#

sry im in a rush, cause i gotta turn in a plugin by tmr

quiet ice
#

Optionstype.DARKNESS?

tender shard
#

wtf even is a warden lol

#

is it a new entity?

quiet ice
#

1.19

#

Yeah

fleet comet
quiet ice
#

Was the shit Back when 1.18 was announced

#

Potionstype

fleet comet
#

oh

tender shard
#

just apply this potion effect to the player

fleet comet
#

oh its a potion type

#

lol

quiet ice
#

Yeah, ofc

rain mason
quiet ice
#

All effects that are visible on the top right bar are potions

tender shard
#

or you mean your ||| thing

#

yes, it's WAY better

rain mason
fleet comet
quiet ice
#

Nah the (float( getDouble()

tender shard
tardy delta
#

why are people doing config.load and catching the exception instead of YamlConfiguration.load(file)?

rain mason
quiet ice
#

Ah that

tender shard
#

yes

tardy delta
#

ye

tender shard
#

(it's basically the same thing)

tender shard
#

yeah sometimes you wanna throw your own error msg instead

quiet ice
#

Or handle stuff gracefully

tardy delta
#

ye but most of the time i see people doing it and just printing the stacktrace

#

not very gracefully then

quaint mantle
#

yo ive got a question is it possible to fire a custom made player death event

quiet ice
#

Whatever - it does the same thing

quaint mantle
#

like instead of setHealth(0) fire the event

#

or does it get fired with it

tender shard
rain mason
quaint mantle
#

will try and confirm

quiet ice
tender shard
tender shard
quiet ice
#

False

tender shard
#

which one did?

#

PlayerInteractEvent?

quiet ice
#

EntityShootBowEvent

tender shard
#

Oh okay

quiet ice
#

Or something like that

tender shard
#

what has changed there?

quiet ice
#

Don't really remember, lemme Look Up ancient EnchantmentsPlus Code brb

tender shard
#

oh no

#

no problem, its not that important lol

#

I just wondered

quiet ice
rain mason
#

@tender shard im guessing for writing something like this? sorry if im being annoying lmao

tardy delta
tender shard
quiet ice
#

Reflections

tender shard
#

oh yeah

#

mb

#

lol

tender shard
tender shard
sage oxide
tender shard
#

ACF is way more powerful and has better documentation

tender shard
tardy delta
#

acf 😍

sage oxide
tardy delta
#

dog marriages?

tender shard
#

?paste the stacktrace

undone axleBOT
tardy delta
#

not sure why saving a file per mariage

#

well you can but you'd end up with alot of small files meh

ornate patio
#

why is there no setDrops method for EntityDeathEvent

tender shard
#

yes

tender shard
tardy delta
#

HashSet#forEach isnt going to follow its insertion order right?

ornate patio
tender shard
#

no

#

you can only remove things from it

atomic swift
#

how do i make a reload command

tender shard
#

wdym?

tardy delta
#

depends on what you need to reload lmao

atomic swift
#

like reloads the plugin

#

and the config

rain mason
#

@tender shard oh my god it actually works (except for effects for some reason)
tysm

tender shard
atomic swift
#
Iaddon.getInstance().saveConfig();
Iaddon.getInstance().reloadConfig();
sender.sendMessage(ChatColor.translateAlternateColorCodes('&', "&3Reload complete!"));
ornate patio
tender shard
ornate patio
#

well

atomic swift
ornate patio
#

it did let me add items

sage oxide
tender shard
tardy delta
tender shard
quaint mantle
#

how would i spawn something 1 to the left and 1 up of the player?

tender shard
#

There is definitely at least one event that has a getDrops() method where you can only remove things, but not add any new things

tender shard
#

getting the "left" side of the player depends on where they are looking at

tender shard
ornate patio
tender shard
#

I am 100% sure that at least for block drops, the drop is immutable (except for removing things)

#

but if it works, it works, so eversthing fine I guess

#

or maybe it was only immutable in older versions. I really cannot remember

ornate patio
#

BlockBreakEvent doesn't even have a getDrops method

#

it just has setDropItems(bool)

tender shard
#

it's BlockDropItemEvent

ornate patio
#

although it'll still be possible to mimic adding a new drop though

#

by just spawning a new item on the break location

#

i wonder why spigot doesnt do that

tender shard
#

it says "not legal" to add new items

#

in BlockDropItemEvent

tender shard
#

I also have no idea

#

that's basically why my Drop2InventoryPlus plugin has to use very weird complicated things to properly detect block drops D:

ornate patio
#

idk what that plugin even is

tender shard
#

it makes drops go directly to your inventory

#

instead of actually dropping them, only to wait for players to pick them up 1 second later

ornate patio
#

oh

#

i see

#

also question

#
elixir-max-age-increase:
  overworld: 10
  nether: 15
  end: 25
#

how do I read the values of overwolrd, nether, and end

#

is it just config.getInt("elixir-max-age-increase.overworld")?

tender shard
#

yes

ornate patio
#

alright

quaint mantle
#

hey, quick question - to customize the behaviour of an existing mob (say, to make horses walk faster across the board) would i still create a custom entity?

tender shard
#

there is still no custom entity API, so yes - you'll need your own NMS version of horses

atomic swift
#

so i have this and it executes twice for some reason player.sendMessage(ChatColor.translateAlternateColorCodes('&',Iaddon.getInstance().getConfig().getString("messages.wrong-block").replace("%player-name%", player.getName())));

dry forum
#

are jitpack private repositories free

azure hawk
#

why is this not working

#

its because of this

eternal night
#

You are creating an instance of your main clas somewhere

azure hawk
#

but when i dont registre it it doesnt work (obviusly)

eternal night
#

in your interactListener constructor

azure hawk
eternal night
#

you are creating a new instance

#

oh

#

LOL

azure hawk
#

what

eternal night
#

you can only have a single class extend java plugin

#

and a single instance of that class

azure hawk
#

bruh

#

so only in the main class

eternal night
#

Yes

#

if you need access to it, pass it using dependency injection

azure hawk
#

but when i remove it i cant acces the config

azure hawk
#

yes

#

but whats an dependency injection

eternal night
#

?di

undone axleBOT
eternal night
#

read up on that ^

#

has an example that is pretty much like yours

azure hawk
#

so private final blablah plugin;

#

?

eternal night
#

and then set that in the constructor

#

after that you can call plugin.getConfig()

#

and go from there

#

note```java
private final MaginClass plugin;
private final String configValue = plugin.getConfig().getString("path");

#

does not work

#

you have to do that work in the constructor

azure hawk
#

i know im dumb but whats an constructor again xd?

#

or where is it located

#

lol

eternal night
#

give it a quick google search xD

azure hawk
#

ok

#

XD

#

do i have to put smth in that public main()<- ?

eternal night
#

no

#

the main method is just an example

#

on what it means to have a parameterised constructor

azure hawk
#

like that?

quaint mantle
#

public Main() != public static void main(String[] args)

eternal night
#

a plugin does not want/need a main method

#

if Info is your main class nam,e

#

then yea

#

sure

azure hawk
#

no

#

but yes

eternal night
#

lmao xD

#

that tutorial has to be old enough to go to kindergarden

tender shard
#

you should use Strings instead of the actual UUID object

tender shard
tender shard
#

basically like this

// when saving
myConfig.set("uuid",uuid.toString());

// when loading
UUID uuid = UUID.fromString(myConfig.getString("uuid"));
azure hawk
#

works perfektly

#

xd

worldly ingot
#

I mean,

  1. Please don't register events in the constructor. This should never have been a trend because doing new InteractListener(); in your onEnable() is so non-descript
  2. Bukkit.getServer() > plugin.getServer() every time
  3. Main is not a great name for your plugin's class because it entails that it's the main entry point of a program (e.g. has the main() method)
  4. info doesn't exist. That's why you're getting errors ;p
river oracle
#

Is there a way to replicate the cooldown animation displayed by minecraft for attacking and shield disabling with the bukkit api?

worldly ingot
#

Yes. I PR'd it a while ago. It's Player#setCooldown(Material, int) iirc

fleet comet
#

?paste

worldly ingot
#

Time in ticks

undone axleBOT
river oracle
chrome beacon
#

Yeah

river oracle
#

do you think i could get away with sending packets to achieve the look atleast

fleet comet
worldly ingot
#

Those cooldowns are set to types, not stacks

tender shard