#help-development

1 messages Β· Page 37 of 1

tardy delta
#

or double ctrl > mvn package πŸ˜‰

dense pine
#

and do i need to add the shade code from website to pom.xml?

dim bronze
#

not if you are using libraries in plugin.yml

wet breach
#

if you want to shade libs into the project yes

dim bronze
#

otherwise, yes

#

the libraries section only works for dependencies in maven central

dense pine
#

and i use it only on top in the maven-plugins or sth like it shown on website

tardy delta
#

oeh uh how can i let gson know what it should deserialize when trying to deserialize my custom class? TypeToken?

dense pine
#

or for every dependecy

eternal oxide
#

If using libraries in plugin.yml just set all of them in yrou pom to provided or compile scope

dim bronze
#

^^

tardy delta
#

serialize i mean

#

ig

dim bronze
#

Also, not sure if you just copied straight from the website, but the configuration should be changed according to what you are doing. i.e changing the relocation pattern to include the package from jackson dependencies and you probably don't need the excludes section either

wet breach
#

oh serialize

tardy delta
#

yep

#

it tries to serialize a weakref field but it needs the inner value

wet breach
#
   private void writeJSON(ItemStack itemStack) throws IOException { 
      GsonBuilder builder = new GsonBuilder(); 
      Gson gson = builder.create(); 
      FileWriter writer = new FileWriter("itemstack.json");   
      writer.write(gson.toJson(itemstack));   
      writer.close(); 
azure island
#

how can i fix this error it is going through try/catch

tardy delta
#

well uhh this is the error

#

and those are the fields

vocal cloud
wet breach
#

or it is ending up being null when it shouldn't

#

in this case, ItemStack

azure island
#

i want to remove 1 item that player right clicks

tardy delta
#

hmm i think i need a TypeAdapter

wet breach
#

you should be using the inventory click event

azure island
tardy delta
#

early returns please πŸ₯Ί

wet breach
#

linked the relevant api above for you

azure island
#

but i don't want to remove clicked item in inventory but right clicked in hand

wet breach
# tardy delta early returns please πŸ₯Ί
public void givenArrayOfObjects_whenSerializing_thenCorrect() {
    SourceClass[] sourceArray = {new SourceClass(1, "one"), new SourceClass(2, "two")};
    String jsonString = new Gson().toJson(sourceArray);
#
public void givenCollection_whenSerializing_thenCorrect() {
    Collection<SourceClass> sourceCollection = 
      Lists.newArrayList(new SourceClass(1, "one"), new SourceClass(2, "two"));
    String jsonCollection = new Gson().toJson(sourceCollection);
glossy venture
#

i hate that theres no goto statement

#

would be so useful in loops and shit

#

for control flow

#

we have labels

#

why no goto

#

its also reserved

vocal cloud
#

Cause good code doesn't need it KEKLEO

glossy venture
#

its useful in some cases

#

and its already a reserved word

#

d

wet breach
real blaze
#

is a CraftingInventory the grid, result, player inventory and hotbar?

tardy delta
#

posted the fields above

wet breach
tardy delta
#

well ye typeadapter as i said

#

lol

#

found some online guide

wet breach
#

you can use an annotation instead

#
public void givenUsingCustomDeserializer_whenFieldNotMatchesCriteria_thenIgnored() {
    SourceClass sourceObject = new SourceClass(-1, "minus 1");
    GsonBuilder gsonBuildr = new GsonBuilder();
    gsonBuildr.registerTypeAdapter(SourceClass.class, 
      new IgnoringFieldsNotMatchingCriteriaSerializer());
    Gson gson = gsonBuildr.create();
    Type sourceObjectType = new TypeToken<SourceClass>() {}.getType();
    String jsonString = gson.toJson(sourceObject, sourceObjectType);
tardy delta
#

whats the dif between typetoken and typeadapter?

#

my class isnt generic or smth

wet breach
#

annotation

#

if the source class has an annotation, it will use that to filter it out

#

instead of looking for the field specifically

real blaze
#

also i now recall how i once solved the same issue in a datapack.
One scoreboard objective is crafting a specific item, and you can use that value to determine how much score to deduct, granted you needed 1 scoreboard per craftable item

wet breach
#

it could be more optimal in cases where you might have multiple fields of the same object with differing values

tardy delta
#

what annotation?

azure island
#

solution was removing , 1 after Material.PAPER

tardy delta
real blaze
#

so there's a scoreboard criteria for crafting an item that keeps track of how many of said item was crafted, yet there's no event that can detect this?

wet breach
#

as I don't use annotations at all

tardy delta
#

hmm looks like i can add a typeadapter for the field with an annotation

real blaze
#

in a ShapelessCrafting ingredientList, does it contain multiple of the same entries?

eternal oxide
#

it can

tardy delta
#

user looks like this in json mmmh

vocal cloud
#

Unreadable

tardy delta
#

wanted an easy way for testing

#

πŸ₯Ί

vocal cloud
#

Even cat is disappointed

tardy delta
#

omg can i pat it?

#

so fluffy

vocal cloud
#

He's antisocial but he also has to be in the same room as you or he cries so loudly

tardy delta
#

πŸ€”

vocal cloud
#

Kinda like when I see JSON

tardy delta
#

bruh do i really need to write a typadapter now for one field :/

#

literally to get the value out of a AtomicReference

echo basalt
#

You're giving me ptsd

#

From when I was writing my skyblock core

tardy delta
#

believe it or not but i wrote that by hand

real blaze
#

interestingly, crafting a FireworkStar is neither a Shaped or Shapeless Recipe

#

what gives?

#

also my java is rusty

if(r instanceof ShapedRecipe s){
            e.getView().getPlayer().sendMessage("Shaped");
            quant = (int)(new ArrayList<ItemStack>(s.getIngredientMap().values())).stream().filter(i -> i.getType().equals(Material.DIAMOND)).count();
        }

Not sure why this doesn't work to find if a recipe used diamonds

hybrid spoke
#

doesnt look like rust

glossy venture
#

πŸ—Ώ

real blaze
glossy venture
#

does it send the message

real blaze
#

so its just me not remembering how to use streams to count map values

glossy venture
#

what is not working, does it always count 0?

tardy delta
#

bruh this sucks

#

cant i add just a typeadapter to gson for a specific kind of field?

real blaze
glossy venture
#

what error

real blaze
#

wait wtf why cant i snipping tool the error

glossy venture
#

ctrl + shift + S

#

to make screenshot

#

then paste it

real blaze
#

oh i never verified my account

glossy venture
#

bruh

#

?paste it

undone axleBOT
glossy venture
#

or smth

real blaze
#
        at diamondtracker.diamondtracker.handlers.DiamondListener.lambda$diamondCraftListener$0(DiamondListener.java:70) ~[?:?]```

lol just copy paste raw text then
#

this was in console lol

glossy venture
#

how tf is an ingredient null

#

ooh

real blaze
#

oh wait

#

is it

#

iterating over an emtpy slot

glossy venture
#

think so

real blaze
#

huh

glossy venture
#

just do a null check

#

filter out all null values

#

and then filter diamonds

tardy delta
glossy venture
#

or do like i != null && i.getType() == Material.DIAMOND as a condition

real blaze
#

god i wish there was a better method of reloading plugins

tardy delta
#

/restart is a good one

real blaze
#

i already do that

#

alright i cant paste the result but know that it worked lol

#

now next problem

#

what kind of recipe does a firework star use?

#

because its neither shaped nor shapeless

#

so i cant filter it using

#
int quant = 0;
        Recipe r = e.getRecipe();
        if(r instanceof ShapedRecipe s){
            e.getView().getPlayer().sendMessage("Shaped");
            quant = (int)(new ArrayList<ItemStack>(s.getIngredientMap().values())).stream().filter(i -> i!=null).filter(i -> i.getType().equals(Material.DIAMOND)).count();
        }
        if(r instanceof ShapelessRecipe s){
            e.getView().getPlayer().sendMessage("Shapeless");
            quant = (int)s.getIngredientList().stream().filter(i -> i.getType().equals(Material.DIAMOND)).count();
        }
#

you know what screw it nobody is gonna be crafting fireworks

#

anyways

#

now the next problem is figuring out how many items a person actually crafted

tardy delta
#

me abusing the system again

#

hmm nice errors

carmine nacelle
#
    public void saveHives() throws IOException {
        File file = new File(cadiaBees.getDataFolder().getAbsolutePath() + "/hives.json");
        file.getParentFile().mkdir();
        file.createNewFile();

        Writer writer = new OutputStreamWriter(new FileOutputStream(file, false),"UTF-8");

        Gson gson = new GsonBuilder()
                .registerTypeHierarchyAdapter(ItemStack.class, new ItemStackSerializer())
                .registerTypeHierarchyAdapter(Location.class, new LocationSerializer())
                .disableHtmlEscaping()
                .setPrettyPrinting()
                .create();

        gson.toJson(cadiaBees.hiveManager.getCustomHives(), writer);
        writer.close();
    }
#

this is my gson save

real blaze
#

quick question, how do i get the string of a minecraft_id from a material?

carmine nacelle
#

and lowercase the material

#

if you want "clean"

real blaze
#

oh, it all matches?

carmine nacelle
#

if im not mistaken.

#

cause material ids are strings now instead of numbers

#

minecraft:diamond_sword would be DIAMOND_SWORD as a material

latent dew
#

Hello, I have a problem with the plugin.yml I can solve it, there is nothing I can do, the error continues. someone help me please.

tardy delta
carmine nacelle
latent dew
vocal cloud
#

No

#

Send it here

carmine nacelle
#

send it here

vocal cloud
#

?paste

undone axleBOT
tardy delta
#

uhh gson weird

#

lol

carmine nacelle
tardy delta
#

i thought it would use my custom typeadapter to serialize a field but it doesnt ;/

tardy delta
#

only seems to work for whole objects or smth

latent dew
#

@carmine nacelle I'm not able to upload the images here

tardy delta
#

i can solve it but theres nothing to do

#

!verify

undone axleBOT
#

Usage: !verify <forums username>

tardy delta
#

or ?paste for the error

glad prawn
golden kelp
#

brah so i add <scope>compile</scope> in maven (for a dependency) and then do mvn package but it doesnt add that into th efinal jar

vocal cloud
#

Wat how is mvn install gonna fix it

tardy delta
vocal cloud
#

do you know the difference between install and package THONK

carmine nacelle
vocal cloud
golden kelp
#

i did include the shade plugin

tardy delta
#

wondering why i needed volatile playerdata πŸ€”

#

im only loading it on one thread πŸ€”

#

sk

vocal cloud
#

?paste the code next time makes it easier to read and figure out

undone axleBOT
young shell
#

Some time ago there was an Issue or PR (I don't remember which one) to replace the Material Enum to better distinguish Items and Blocks. Is that still something that is planned for the Future or is that scrapped

vocal cloud
golden kelp
carmine nacelle
# glad prawn Help:(

The only reason it wouldnt fire is if the inventory isnt equal to the gui inventory

vocal cloud
#

Ahhhh why is your package names capitalized

latent dew
vocal cloud
#

😭

#

Also you don't need this

carmine nacelle
#

you dont need public static void main in plugins

#

kekw

vocal cloud
#

Also this seems to be the issue

carmine nacelle
#

missing the description line

#

just use idea's built in Spigot template lmao

#

its nice

vocal cloud
#

Oh I bet you they're compiling it without the plugin.yml

charred blaze
#

Could not pass event AsyncPlayerChatEvent to Chat v1.0
org.bukkit.event.EventException: null

carmine nacelle
#

maybe that too

glad prawn
carmine nacelle
#

pretty sure description is required tho

vocal cloud
latent dew
#

I understand, I'll try to change here, I'm taking a course to learn for 2 days only

echo basalt
vocal cloud
charred blaze
vocal cloud
#

java.util.regex.PatternSyntaxException: Dangling meta character '+' near index 0

glad prawn
vocal cloud
#

Fix your regex lmfao

tardy delta
#

^^

vocal cloud
#

Write unit tests

charred blaze
latent dew
charred blaze
#

"regex"

young shell
#

Some time ago there was an Issue or PR (I don't remember which one) to replace the Material Enum to better distinguish Items and Blocks. Is that still something that is planned for the Future or is that scrapped

charred blaze
#

hmm

echo basalt
#

I don't remember if I did regex
exception complains about invalid regex

πŸ€”

echo basalt
#

that breaks compatibility

lost matrix
young shell
vocal cloud
young shell
lost matrix
#

If its somewhere then

#

?stash

undone axleBOT
latent dew
lost matrix
vocal cloud
#

?learnjava

undone axleBOT
vocal cloud
#

I'm sure there are plenty of Portuguese tutorials as well

tardy delta
#

?paste

undone axleBOT
tardy delta
#

also wtf

real blaze
#
if(quant > 0){
            Scoreboard data = plugin.getServer().getScoreboardManager().getNewScoreboard();
            data.registerNewObjective("data", ("minecraft.crafted:" + r.getResult().getType()).toLowerCase(), "");

            plugin.getServer().getScheduler().runTaskLater(plugin, ()-> {
                int size = data.getObjective("data").getScore(p.getName()).getScore();
                removeScore(p, size);
                data.getObjective("data").unregister();
            }, 50L);
        }

My objective here is to:

  • set up a scoreboard
  • get the score of the player on a crafting x item
charred blaze
vocal cloud
#

capital letters in configs gag

tardy delta
#

that code looks cursed

charred blaze
tardy delta
#

no problem

charred blaze
#

anyways

#

why does it throws exception?

tardy delta
#

cuz your regex is fucked up

vocal cloud
#

Lmfao

#

You don't understand how String.replaceAll works

young shell
tardy delta
#

that code is too cursed for my eyes πŸ₯Ί

vocal cloud
#

You're using it raw which could be exploitable asf

glad prawn
#

In the end still no one gave me how to solve it. Even if it's just a suggestion 😒

vocal cloud
#

You're missing an inventory event to cancel or you need to check better

lost matrix
vocal cloud
#

Log stuff

echo basalt
charred blaze
echo basalt
#

source: I watched half of the first video

vocal cloud
echo basalt
#

verano is spanish

real blaze
#
org.bukkit.event.EventException: null```
What the heck is this error
latent dew
charred blaze
vocal cloud
echo basalt
#

not using maven

#

pain

#

grr

subtle folio
#

Lbozo

echo basalt
#

or gradle

subtle folio
#

wait what

echo basalt
#

not using package management in general

subtle folio
#

??

charred blaze
lost matrix
vocal cloud
#

I should write a logging tutorial jeez the amount of people who's problems are solved by logging.

subtle folio
latent dew
carmine nacelle
echo basalt
#

And even if they can, some concepts can be better understood in their native language

vocal cloud
charred blaze
carmine nacelle
#

@latent dew you arent exporting the plugin.yml in the artifact

#

just because its in the project doesnt mean it will auto export

echo basalt
#

It's sad that countries like Brazil have tons of young talent but they're limited by the language barrier

lost matrix
echo basalt
#

Even though they're shooting themselves in the foot by not learning english

latent dew
echo basalt
#

and maybe summon a demon to fix our code for us

vocal cloud
#

The language of the internet is English.

subtle folio
echo basalt
#

if you can speak english, it is

carmine nacelle
charred blaze
#

whats wrong with this code?

carmine nacelle
#

add the plugin.yml file to output artifact.

subtle folio
echo basalt
#

I can assure you that most minecraft gamers that don't speak english end up playing on spanish servers

#

Mostly because spanish servers are better made

latent dew
echo basalt
#

comparing to portuguese / brazilian servers

subtle folio
#

oh

charred blaze
subtle folio
#

?paste

undone axleBOT
echo basalt
#

Chat.Main.onChat

#

my man

#

wtf

subtle folio
#

main??

#

ew

#

?main

charred blaze
#

bruh

echo basalt
#

naming package as Chat 🀑

subtle folio
#

Yeah..

#

might wanna work on that

vocal cloud
charred blaze
carmine nacelle
#

sheesh yall are too harsh on newbies.

subtle folio
vocal cloud
#

and what does replaceAll do

subtle folio
#

replaceAll?

#

why not just replace

echo basalt
#

if the first character is 0

#

it does replaceAll("+", "")

#

but + is a regex character

vocal cloud
#

I think, more importantly, replaceAll isn't what they want.

subtle folio
#

then just add a \

vocal cloud
#

Or if it is they need to escape it

carmine nacelle
#

#replace works fine.

#

replace still replaces all instances of the found string

lost matrix
#

Either use replace or escape the char

carmine nacelle
#

i think thats what they want

real blaze
#
Caused by: java.lang.NullPointerException: Cannot invoke "net.minecraft.network.chat.IChatBaseComponent.e()" because "this.d" is null

code caused:

Scoreboard data = plugin.getServer().getScoreboardManager().getNewScoreboard();
            data.registerNewObjective("data", ("minecraft.crafted:" + r.getResult().getType()).toLowerCase(), "");
subtle folio
#

java 7

echo basalt
#

replaceAll should really just be renamed to replaceRegex

carmine nacelle
#

replaceall is for like..wildcards i think? never used it.

vocal cloud
#

Replaces each substring of this string that matches the given regular expression with the given replacement.

real blaze
#

is there an issue with my scoreboard creation?

delicate fossil
#

is there an event for block move?
or any way to output when, from where and to where was a block moved by piston?

carmine nacelle
#

PistonPushEvent

echo basalt
#

you're telling me

#

that an nms method

carmine nacelle
#

or is it PistonExtendEvent πŸ€”

echo basalt
#

is throwing an error

#

because an internal nms variable is null

#

that will totally fix bukkit's api

subtle folio
subtle folio
subtle folio
undone axleBOT
vocal cloud
#

Use the search bar

delicate fossil
#

yes but there is written Called when a piston extends and i expected something like when block is moved. i will look into it

#

i see there is a list of blocks moved

#

i missed that. thanks

latent dew
carmine nacelle
#
  • button
#

the one right above the artifact in the center

#

not the top left one

vocal cloud
#

Please use a package manager sad

echo basalt
#

BlockPistonRetractEvent

#

or

carmine nacelle
#

i assume so

echo basalt
#

BlockPistonEvent

#

handles both

vocal cloud
#

Let them find it in the docs 😭

echo basalt
#

I remember not knowing how to read docs

#

shit was confusing

subtle folio
#

enemy doc users

vocal cloud
#

Then teach

charred blaze
echo basalt
#

but then I grew brain cells

vocal cloud
#

How to read javadocs the musical

charred blaze
#

does it something different?

carmine nacelle
#

i still have issues reading docs sometimes..

echo basalt
#

I should make a whole spigot tutorial series in portuguese

#

where it's just a clear voiceover

echo basalt
#

with white noise at the back

vocal cloud
subtle folio
#

based

echo basalt
#

idk why people keep saying they'd watch my content like

latent dew
echo basalt
#

masochist mfs

vocal cloud
#

People like my voice apparently

echo basalt
#

people say I sound hot

real blaze
carmine nacelle
gray merlin
#

Thank you to everyone who helped me over these last days with my issues. I've now finished the plugin I was making, and I actually quite like plugin making. Felt like I owed a thanks :)

carmine nacelle
#

middle of the screen

real blaze
#

i just picked up spigot to day dont @ me

subtle folio
echo basalt
#

but I just listen to my recordings and crumble into a ball

#

and start spinning on the floor

#

like a beyblade

carmine nacelle
subtle folio
echo basalt
#

nms is pog wdym

vocal cloud
subtle folio
echo basalt
#

no its pog wdym

#

specially without mojmaps

carmine nacelle
#

fuck nms

subtle folio
#

oh

echo basalt
#

nms is gangsta

subtle folio
#

yeah yeah totally

#

110%

echo basalt
#

ngl I only setup mojmaps like 3 weeks ago

subtle folio
#

bruh

echo basalt
#

been doing nms until then purely based on obfuscation and common sense

subtle folio
#

moj maps are the way to go

echo basalt
#

vivian

#

you know

#

that if you make a pom.xml or build.gradle

#

your ide prompts you to convert the entire project to a maven/gradle project right

carmine nacelle
#

what about it

echo basalt
#

intellij might be a little dumb sometimes but it's still smarter than us

carmine nacelle
#

to the right of that one

#

i use maven

echo basalt
#

there are like 4 of those

vocal cloud
#

You can select maven and it'll just do it all for you

real blaze
#

uh, this may be a dumb question but how do i register a new scoreboard

echo basalt
#

that screenshot is so cropped idek the steps to get to it

subtle folio
#

intellij artifact manager 😈

carmine nacelle
#

i love maven

vocal cloud
#

Right click on the project folder

carmine nacelle
#

maven so sexy

vocal cloud
#

It's at the bottom

subtle folio
vocal cloud
#

I'm currently in a rust project so it doesn't have maven as an option

carmine nacelle
vocal cloud
#

Stop trying to get them to use a package-manager-less system please

#

😭

carmine nacelle
#

i mean

subtle folio
carmine nacelle
#

its easier to start with this than guiding to use a completely different thing aint it

vocal cloud
#

Well, get over the big hurdle now then later

subtle folio
#

bro you gonna compile with ant??

echo basalt
#

It's easier to just do shit properly than to teach them how to workaround a crappy solution

carmine nacelle
#

the poor man cant find the plus button u think he can figure out maven?

echo basalt
#

this is why you use gradle

#

it's maven but without half of the distracting lines

vocal cloud
#

Make me a portuguese tutorial already

echo basalt
#

fucking hell mike

vocal cloud
#

serenade me

echo basalt
#

imma buy full nitro just to spam crazy frog emotes to scare your horny ahh

subtle folio
#

maven ftw

tardy delta
latent dew
real blaze
#
Scoreboard data = Bukkit.getScoreboardManager().getNewScoreboard();
            data.registerNewObjective("data", ("minecraft.crafted:" + r.getResult().getType()).toLowerCase(), "");
#

the second line still causes an error

#

and im still clueless as to why

vocal cloud
#

Vivian I swear to God

carmine nacelle
#

what did i do now

quiet ice
#

I think someone else did something

vocal cloud
real blaze
carmine nacelle
#

well maven is obviously better

hybrid spoke
#

except for big ass projects

latent dew
quiet ice
#

How Big is Big ass though?

carmine nacelle
#

try it

carmine nacelle
vocal cloud
#

😭 make it stop

#

Vivian you created a monsterrrr

carmine nacelle
#

kekw

quiet ice
#

Just use eclipse at that point. JDT is super nice

carmine nacelle
#

notepad++

hybrid spoke
quiet ice
#

Not really powerfull but at least useable

quiet ice
#

Yeah, in that Case you should use make

latent dew
hybrid spoke
#

lines of source code

quiet ice
#

Lines of source code

hybrid spoke
#

who tf says losc

quiet ice
#

Im on mobile okay

hybrid spoke
#

me too

vocal cloud
quiet ice
#

It is pain to write anything because of stoopid autocorrect that is half German half english

vocal cloud
#

Ja ja ja

quiet ice
vocal cloud
#

Jaaaaaaaaaaaaaaaaaaa

quiet ice
#

Their Main Class does Not exist

carmine nacelle
vocal cloud
#

Cancel me I'm part German

#

I swear officer

quiet ice
#

Or at least it is Not what is defined in the plugin.yml

carmine nacelle
#

i swear to drunk im not god

vocal cloud
#

morgen, morgen, nur nicht heute, sagen alle, faule Leute.

#

amirite

hybrid spoke
#

πŸ‡©πŸ‡ͺ

latent dew
quiet ice
#

Oh god Just use JDT

carmine nacelle
#

there u go hes interested @vocal cloud

carmine nacelle
quiet ice
#

If you do Not know how JDT works you are truely lost

carmine nacelle
#

eclipse right?

#

id rather be lost

quiet ice
#

Well If you know maven it is better

ornate heart
#

Im making a plugin that supports multiple versions, but also depends on WorldGuard. How would I use a certain version of WorldGuard for diff versions of Minecraft? Would I have to depend on multiple versions of WG and then just make different implementations for what I need to do for each Minecraft version?

vocal cloud
#

This is making me want to make a switching to a package manager video

lament sorrel
#

hi guys i need help? pls dm

carmine nacelle
#

do it

quiet ice
#

At worst Just use Method handles

quiet ice
vocal cloud
#

Angry German Noises

carmine nacelle
#

NEIN

lament sorrel
#

guys i have a question

how can i post a plugin in spigot

quiet ice
#

There is a command for that iirc

vocal cloud
#

?sendhelp

carmine nacelle
#

?call911now

lament sorrel
carmine nacelle
#

wat

quaint mantle
ornate heart
#

Huh

quiet ice
#

?howtopostathread is the only Thing a bit Like it

undone axleBOT
vocal cloud
quiet ice
#

We would need one for resources though

vocal cloud
#

I gotchu

quiet ice
#

Only with workarounds

vocal cloud
#

Dafuq I've got so many downloads

#

My plugins are shit stop using them

glad prawn
#

All events are called but none are cancelled.

quiet ice
#

That is the baseline of Downloads by Bots I assume

near night
#

help my plugin wont build im using specialsource-maven-plugin but it says this [INFO] Scanning for projects... [INFO] ------------------------------------------------------------------------ [INFO] BUILD FAILURE [INFO] ------------------------------------------------------------------------ [INFO] Total time: 0.062 s [INFO] Finished at: 2022-08-05T01:19:27+10:00 [INFO] ------------------------------------------------------------------------ [ERROR] No goals have been specified for this build. You must specify a valid lifecycle phase or a goal in the format <plugin-prefix>:<goal> or <plugin-group-id>:<plugin-artifact-id>[:<plugin-version>]:<goal>. Available lifecycle phases are: validate, initialize, generate-sources, process-sources, generate-resources, process-resources, compile, process-classes, generate-test-sources, process-test-sources, generate-test-resources, process-test-resources, test-compile, process-test-classes, test, prepare-package, package, pre-integration-test, integration-test, post-integration-test, verify, install, deploy, pre-clean, clean, post-clean, pre-site, site, post-site, site-deploy. -> [Help 1] [ERROR] [ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch. [ERROR] Re-run Maven using the -X switch to enable full debug logging. [ERROR] [ERROR] For more information about the errors and possible solutions, please read the following articles: [ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/NoGoalSpecifiedException

glad prawn
#

Oh.

quiet ice
#

Add the Attributes to the PDC and apply them on the Block place event

vocal cloud
azure island
#

is there easier way to check if player is clicking sword?

vocal cloud
carmine nacelle
#

That wont work if the sword has enchants, lore, displayname..

quiet ice
quiet ice
vocal cloud
#

Read the warning with those .equals please

glad prawn
azure island
#

i cant find any way to do it

vocal cloud
carmine nacelle
#

you're comparing an itemstack to a material.

quiet ice
#

Ah right

vocal cloud
#

let them figure it outtt

carmine nacelle
vocal cloud
#

God I love the sad cat emote

quiet ice
#

Switch on enum - Switch on enum

#

disappears

echo basalt
#

item.getType().name().endsWith("SWORD")

#

y'all really like repeating code

vocal cloud
quiet ice
#

No!

quiet ice
#

Use enchantment Targets my dear

lament sorrel
#

but thx

vocal cloud
#

Longer though. item.getType().name().toLowerCase().endsWith("sword")

#

And more useless kek

echo basalt
#

how to hinder performance 101: toLowerCase

azure island
echo basalt
#

all it does is kill performance in this case

vocal cloud
#

Exactly

echo basalt
#

endsWith is relatively fast

quiet ice
#

Beware of the tΓΌrkisch locale bug

tardy delta
#

substring

vocal cloud
#

Performance is for weak PCs

tardy delta
#

ig3

quiet ice
#

You need to Pass a non-system locale

real blaze
#
Objective obj = data.registerNewObjective("data", ("minecraft.crafted:" + r.getResult().getType()).toLowerCase(), "");

Why the flip does this line not work i dont get it

hidden walrus
#

i'm very new to java, wondering how i would create a file to store coordinates set by a command

echo basalt
#

just checks if the array range [length - target.length] -> [length] is equal to targetArray

#

with some length checks as well

quiet ice
echo basalt
#

"A short story".endsWith("story") -> "~~A short ~~story" equals "story" -> true

quiet ice
#

Ah createNewFile

lament sorrel
#

i just posted my plugin how do i have 2 downloads

tender shard
#

oh, what was it again? πŸ˜„

echo basalt
#

people be decompiling it

#

to see if you're putting malware

quiet ice
#

And bots

lament sorrel
quiet ice
#

Nah staff do Not respond that quickly

echo basalt
#

so?

lament sorrel
#

i understand

eternal night
echo basalt
#

we've found cracked versions of paid plugins just labelled "test"

tender shard
echo basalt
lament sorrel
#

4

vocal cloud
#

bots

eternal night
#

those tend to happen when we add api and spigot catches up

vocal cloud
eternal night
#

and uses our naming

#

kinda ugly and not much to do

lament sorrel
tardy delta
#

MYES atleast the error messages changed now

#

what a progress

echo basalt
#

no one cares about a chat plugin

carmine nacelle
#

this dudes flippin out thinking ppl love the plugin let him be happy

cold roost
#

Hello, I am looking to modify Paper 1.12.2. Can someone help me?

Thank you for your kindness.

echo basalt
#

?ask

undone axleBOT
#

If you have a question, please just ask it. Don't look for staff or topic experts. Don't ask to ask or ask if people are awake or available. Just ask the question to the channel straight out, and wait patiently for a reply. Make sure you use the right channel regarding the topic of your question. Create a thread in case the channel is already in use!

quiet ice
#

?fork

undone axleBOT
#

SpigotMC maintains the Spigot server. If you are using a fork of Spigot (such as Paper, Airplane, Purpur, or other derivative works), you should seek support in the appropriate Discord servers.

tardy delta
#

thank you for your kidneys?

#

huh

vocal cloud
#

I want a free Kid-knee

carmine nacelle
echo basalt
#

my pizza is 40 minutes late

#

they said they'd deliver in 30 minutes

tardy delta
#

my pizza never arrived

quiet ice
#

?eol probably doesn't exist, but applies too

real blaze
#

how ridiculous

quiet ice
#

Internal mc issue ig

carmine nacelle
quiet ice
#

But might make more Sense If we knew the Error message

eternal needle
#

hi i cant get this to work pls help pl.sendTitle(ChatColor.RED + e.getPlayer().getName(), ChatColor.RED+ "tagget deg!", 20, 40, 20); i code 1.19 tag me

lament sorrel
#

5 downloads

real blaze
#

so i have delayed a task by 50L and i thought that meant 50 milliseconds / 1 tick

carmine nacelle
#

20 tick = 1 second

azure island
#

idk what to do now everything is working but im receiving null

carmine nacelle
#

if u click an empty space the item is null.

azure island
#

but im getting that error when im clicking sword

real blaze
carmine nacelle
#

50 is 2.5 seconds

real blaze
#

oh

eternal night
#

yea it isn't in millis

carmine nacelle
#

unless im stupid

real blaze
#

i thought

tardy delta
#

20ticks is 1 sec

eternal night
#

when running a scheduler you give it the ticks

#

not the millis

real blaze
#

yeah i thought that number was millis

#

mb

lament sorrel
#

?reload

real blaze
#

also i think ive found the dumbest way of identifying how many crafts a player did

#

since CraftItemEvent is no help

dim bronze
near night
#

the run button in intellij

ocean ice
#

why is this code not running

@EventHandler
public void onDamage(EntityDamageEvent e) {
        System.out.println("player attacked!");
}```
tender shard
#

because you didnt register the event listener

ocean ice
#

i did

tender shard
undone axleBOT
dim bronze
#

if you are running a maven goal, it needs an actual goal to run i.e package

tardy delta
#

also use a logger instead of sysout

tender shard
real blaze
#
if(quant > 0){
            final int q = quant;
            Scoreboard data = Bukkit.getScoreboardManager().getMainScoreboard();
            data.registerNewObjective("data", ("minecraft.crafted:minecraft." + r.getResult().getType()).toLowerCase(), "t");
            p.setScoreboard(data);
            plugin.getServer().getScheduler().runTaskLater(plugin, ()-> {
                int size = data.getObjective("data").getScore(p.getName()).getScore();
                removeScore(p, size * q);
                data.getObjective("data").unregister();
            }, 1L);
        }

Essentially it creates a new scoreboard with objective of 'craft x', then reads it 1 tick later to figure out how many of x item did player craft

tender shard
dim bronze
#

I think your run configuratoin is just running mvn and not mvn package or something similar @near night

near night
#

ok will check

glad prawn
tardy delta
#

hmm looks almost right

#

ah we got a new exception

#

lmfao

#

i registered a typeadapter and it doesnt seem to use it :/

tender shard
#

I am confused by the block in your method body

#

why is it there? πŸ˜„

zealous osprey
#

general question Fourteen, what is that random "{...}" for that has "writer.name(...)" and so?

tender shard
#

in this case, it does absolutely nothing

tardy delta
#

uhh cuz i always forgot the structure

#

im writing two things

#

uuid and playerdata

tender shard
#

it's basically only there to limit variable visibility / scope

tardy delta
#

lets remove it lol

tender shard
#

e.g. now you can use "name" as variable twice

tardy delta
#

mye

tender shard
#

I don't see any other reason why it would ever be useful inside a normal method

zealous osprey
tardy delta
#

my internal representation looked like this so it helped me a little to write the code

tender shard
#

you can also do stuff like this

public class MyClass {

  final String name;

  {{{{{{{{{{
    name = "mfnalex"; 
  }}}}}}}}}}

}
#

if you're bored

echo basalt
#

that sounds like a great idea

tardy delta
#

im confused by the exceptions

tardy delta
#

gson weird

#

ignoring transient should be enabled by default no?

dense laurel
#

guys can i get help? I'm trying to make a 1.17.1 server, i've updated the jdk-17.0.4 and when i start the BuildTools bash script nothing happens
it asks me the version. I put 1.17.1 and then it shows Press any key to continue and bye

tardy delta
#

HUUH

tender shard
#

it either builds what it considers latest, or you specify it using --rev

#

you use some weird interactive script that someone wrote, but not the official one

dense laurel
#

@echo off IF NOT EXIST BuildTools ( mkdir BuildTools ) cd BuildTools curl -z BuildTools.jar -o BuildTools.jar https://hub.spigotmc.org/jenkins/job/BuildTools/lastSuccessfulBuild/artifact/target/BuildTools.jar set /p Input=Enter the version: || set Input=latest java -jar BuildTools.jar --rev %Input% pause

tender shard
#

just run this manually

java /path/to/BuildTools.jar --rev 1.17.1
tardy delta
#

java.lang.reflect.InaccessibleObjectException: Unable to make field private java.lang.Object java.lang.ref.Reference.referent accessible: module java.base does not "opens java.lang.ref" to unnamed module @33af8c0a myes

dense laurel
#

the folder is the same even when i wrote this command

tender shard
#

it should show sth like this

dense laurel
tender shard
#

does it show anything if you enter java -version ?

dense laurel
#

nope

tender shard
#

your java is somehow fucked up

dense laurel
#

should i reinstall it?

tender shard
#

can't hurt

dense laurel
#

lemme give it a key then

tender shard
#

idk what the problem is, but if java -version does not show ANYTHING, then something is extremely fucked up with your java installation :/

#

what version of lombok are you using?

delicate lynx
#

bro it's been 4 minutes calm down

tender shard
#

and what version of java?

#

java 17 wasn't even released when lombok 1.18.8 was the latest

#

try upgrading lombok to 1.18.24

#

java 17 was released in september 2021, your lombok version is from may 2019. soooo I guess this is the problem

gleaming grove
#

Hi what do you think which approach is better? To have one global event listener for list of objects, or event listener per object?

tender shard
#

i'd use one listener that then passes the event to your objects

#

well it depends on the amount of objects you have

#

are you using maven?

#

?paste the complete maven log pls

undone axleBOT
tender shard
#

are you using intelliJ?

gleaming grove
tender shard
#

just run mvn clean package or whatever you use to compile. then, when it's finished, check on the right side of the console. click the uppermost thing, then copy/paste everything from the console output

sharp verge
#

?paste

undone axleBOT
grim ice
#

it'll either tell you that there is no such command or the version

dense laurel
#

i had to reinstall java

#

now it works

#

hopefully the buildtool thing will work too

grim ice
#

that's wrong

#

it cant "not show anything"

cunning canopy
#

meta.addEnchant(Enchantment.ARROW_DAMAGE, 255, false);
meta.addEnchant(Enchantment.ARROW_KNOCKBACK, 1, false);

#

this will one shot entities right

#

like vanilla ones

sharp verge
#

Does anyone know why this isn't working ?

https://paste.md-5.net/asewiyexep.java

whenever i type the word "testing" the idea is to add this to the custom config file:

  test:
    test:
      test:
        - "testing"```
#

or at least something similar with this sorta stair-case approach

tender shard
#

try upgrading maven-compiler-plugin to 3.10.1

#

then do mvn clean package

tardy delta
quaint mantle
#

Hello just getting started iwth ProtocolLib in 1.8, I want to create a basic action bar sending system but it doesn't work corerctly, I have a Null Pointer Exception

@Override
    public void send(@NonNull Player player, @NonNull String message) {
        // send action bar with protocollib
        ProtocolManager manager = ProtocolLibrary.getProtocolManager();

        PacketContainer packet = new PacketContainer(PacketType.Play.Server.CHAT);

        packet.getBytes().write(0, (byte) 2);
        packet.getChatComponents().write(0, WrappedChatComponent.fromJson(message));

        try {
            manager.sendServerPacket(player, packet);
        } catch (InvocationTargetException e) {
            throw new RuntimeException(e);
        }

    }

The fact is, I'm using the latest version of ProtocolLib in my gradle, and latest plugin in my server even if I'm using 1.8
What do you advise me please ?

tender shard
cunning canopy
tardy delta
#

1.8 doesnt have an actionbar api?

tender shard
#

no

tardy delta
#

dont have copilot

tender shard
#

1.8 sucks so hard, it doesn't even have api for action bars

delicate lynx
tardy delta
#

ye and not in the good way huh

near night
sharp verge
sharp verge
placid fog
#

if i want to control the speed at which wheat grows using api how would i do it

ornate patio
#

bump

grim ice
#

why r u doing this

#

for action bars

#

i wanna cry

grim ice
#

no

#

it does

#

lmfao

grim ice
#

literally

#

player.spigot().sendMessage

lost matrix
rustic grail
#

Hi,
I am currently working on a spigot/bukkit plugin and have problems findig a up-to-date worldeddit api example code/tutorial/doc for loading in schematics.
Can somebody help me?

grim ice
#

player.spigot().sendMessage(ChatMessageType.ACTION_BAR, new TextComponent("This message will be in the Action Bar"));

grim ice
#

1.8 is extremely famous lol

quaint mantle
grim ice
#

you dont have to

lost matrix
grim ice
#

i told yo uwhat to do

#

player.spigot().sendMessage(ChatMessageType.ACTION_BAR, new TextComponent("This message will be in the Action Bar"));

quaint mantle
grim ice
#

no

#

well 1.12.2 was less complicated and more fun

#

but its not the best

#

frankly all the versions suck

dire marsh
#

oh god another 1.8 argument

#

we should get a bot to just shut down the channel if it gets mentioned

near night
rustic grail
#

Hi,
I am currently working on a spigot/bukkit plugin and have problems findig a up-to-date worldeddit api example code/tutorial/doc for loading in schematics.(1.18.2)
Can somebody help me?

lost matrix
#

Versions that are more used than 1.8:
1.19.1
1.19
1.18.2
1.18.1
1.16.5
1.12.2
Each of them.

cunning canopy
#

Index for middle inventory item?

grim ice
cunning canopy
#

hotbar*

quaint mantle
# grim ice what

TextComponent(java.lang.String)' is not public in 'java.awt.TextComponent'. Cannot be accessed from outside package

cunning canopy
#

is it 4?

rain mason
#

is there a way to protect specific blocks instead of preventing all explosions near them? (like the image yk)

lost matrix
grim ice
#

net.md_5.bungee.api.chat.TextComponent

rain mason
lost matrix
quaint mantle
rain mason
grim ice
#

well whatever

#
public static void sendActionText(Player player, String message){
            PacketPlayOutChat packet = new PacketPlayOutChat(new ChatComponentText(message), (byte)2);
            ((CraftPlayer) player).getHandle().playerConnection.sendPacket(packet);
        }```
rustic grail
placid fog
#

how would i check if wheat is fully grown or not?

slate delta
#

Why my condition does not work, when I held an arrow in my hand

quaint mantle
tardy delta
#

cast it to Ageable and check age

slate delta
#

That ?

#

that work! thanks

tardy delta
#

check the age lol

ornate patio
#

I’m trying to create custom names by placing invisible armor stands on top of players, but I don’t want a player to see their own name. Would it be more efficient to send fake armor strands to everyone in the server except one, or spawn a real armor stand but cancel the spawn packet for the one player?

near night
tardy delta
#

you cant check if an item in hand is fully grown, check the blockbreak event

quaint mantle
lost matrix
quaint mantle
real blaze
#
@EventHandler
    public void diamondClickListener(InventoryClickEvent e){
        Inventory inv = e.getClickedInventory();

        if(e.getCursor().getType().equals(Material.DIAMOND) && e.getView().getPlayer() instanceof Player p){
            if(markDiamond((Player)e.getView().getPlayer(), e.getCursor())){
                p.sendMessage("found on cursor");
                e.getCursor().getItemMeta().setLore(List.of(ChatColor.GRAY + "Owned By:" , ChatColor.GREEN + p.getName()));
            }

        }
    }

So Im trying to set this so that upon clicking an item to set its lore, but this doesnt seem to work

#

ignore the inv i was testing something

dim bronze
#

the meta you get from getItemMeta is a copy

real blaze
#

ah

dim bronze
#

you have to run setItemMeta afterwards

real blaze
#

ONCE AGAIN

#

this is the second time this has happened today

atomic violet
#

how would i get the location of the nearest armor stand with a tag so i can make a compass target it, i get the targetting part, im just not sure how to get the location of the nearest armor stand to the player

#

and it needs to be constant, so if the player moves close enough to a different one, the location changes

slate delta
#

@tardy delta that not work 😒

cunning canopy
#

can I check if a player died to the void in PlayerDeathEvent?

dim bronze
tardy delta
dim bronze
#

you would just have to check every tick or so (or when the player moves)

tardy delta
#

?jd-s

undone axleBOT
lost matrix
atomic violet
cunning canopy
#

what method?

slate delta
#

not a event

tardy delta
#

?

#

explain what youre trying pls

slate delta
#

repair the item 😐

dim bronze
placid fog
#

im the one that asked about ageable

lost matrix
placid fog
#

lol

tardy delta
#

ah check instanof Damageable then (take the right one)

slate delta
#

import org.bukkit.inventory.meta.Damageable;
?

dim bronze
#

Ah yeah, 7smile7 is correct, if you want the closest and you don't know how close it is, then yes you'd need to loop through all

tardy delta
#

ye i believe

slate delta
#

not work

#

the item not repaired

lost matrix
slate delta
#

oh okay thanks

tardy delta
#

if you took a look at the docs you wouldve seen it extends itemmeta

slate delta
#

I did not know

#

that work! thanks

#

Why my command goes beyond that? when I have a block in my hand, the blocks have no durability 😐
It says that it is full, in durability but normally it should have stopped before and say that this item can not be repaired because it does not extend from Damageable

tardy delta
#

damaging items is weird

lost matrix
#

Cast the ItemMeta to Damageable

main dew
#
World#notifyAndUpdatePhysics``` anyone know how work flag in this method? πŸ˜…
cunning canopy
#

what is PotionEffect max amplifier?

lost matrix
slate delta
cunning canopy
#

If I cancel EntityDamageByEntity will they still take knocback?

real blaze
#

it seems to be impossible to detect whether a diamond was used in a crafting recipe for a firework star

main dew
lost matrix
quaint mantle
#

How to install NMs in 1.8 ?

tardy delta
main dew
quaint mantle
#

I want to install it in gradle

#

I'm making an open source plugin

lost matrix
tardy delta
#

?1.8

undone axleBOT
main dew
#

?1.12

#

scam

real blaze
tardy delta
#

is no what?

ornate patio
#

Ok different question, bump

lost matrix
real blaze
lost matrix
#

Events are fired before something happens. This way you can cancel the action.
If it was afterwards then you would have to roll back which would be stupid.

real blaze
#

you know what thats pretty true

quaint mantle
#

When I'm trying to install with Gradle, I have this issue :

[18:55:25 INFO]: [WorldEdit] Disabling WorldEdit v6.1;no_git_id
[18:55:25 ERROR]: Could not load 'plugins\PluginTemplate-1.0-SNAPSHOT.min.jar' in folder 'plugins'
org.bukkit.plugin.InvalidPluginException: main class `org.arobase.plugintemplate.Main' does not extend JavaPlugin
        at org.bukkit.plugin.java.PluginClassLoader.<init>(PluginClassLoader.java:74) ~[patched_1.8.8.jar:git-PaperSpigot-445]
        at org.bukkit.plugin.java.JavaPluginLoader.loadPlugin(JavaPluginLoader.java:129) ~[patched_1.8.8.jar:git-PaperSpigot-445]
        at org.bukkit.plugin.SimplePluginManager.loadPlugin(SimplePluginManager.java:331) ~[patched_1.8.8.jar:git-PaperSpigot-445]
        at org.bukkit.plugin.SimplePluginManager.loadPlugins(SimplePluginManager.java:254) [patched_1.8.8.jar:git-PaperSpigot-445]
        at org.bukkit.craftbukkit.v1_8_R3.CraftServer.loadPlugins(CraftServer.java:293) [patched_1.8.8.jar:git-PaperSpigot-445]
        at org.bukkit.craftbukkit.v1_8_R3.CraftServer.reload(CraftServer.java:767) [patched_1.8.8.jar:git-PaperSpigot-445]
        at org.bukkit.Bukkit.reload(Bukkit.java:556) [patched_1.8.8.jar:git-PaperSpigot-445]
Caused by: java.lang.ClassCastException: class org.arobase.plugintemplate.Main
        at java.lang.Class.asSubclass(Class.java:3640) ~[?:?]
        at org.bukkit.plugin.java.PluginClassLoader.<init>(PluginClassLoader.java:72) ~[patched_1.8.8.jar:git-PaperSpigot-445]
        ... 15 more
[18:55:25 INFO]: SubClassFactory parent ClassLoader [org.bukkit.plugin.java.PluginClassLoader]
real blaze
#

kinda dumb of me tbh

rain mason
#

oh cool thanks @lost matrix @tender shard

tender shard
#

it must extend JavaPlugin

main dew
lost matrix
quaint mantle
#

I said you recently

quaint mantle
tender shard
#

?paste org.arobase.plugintemplate.Main then

undone axleBOT
lost matrix
quaint mantle
#

It's doing that after I'm putting this :
implementation "org.spigotmc:spigot:1.8.8-R0.1-SNAPSHOT"

quaint mantle
lost matrix
tender shard
#

?paste the full org.arobase.plugintemplate.Main then

undone axleBOT
quaint mantle
quaint mantle
fierce dock
#

What would be the bst way to get a list of every material obtainable in survival?

tender shard
tardy delta
#

bruh in this setup, gson::toJson would use the typeadapter no?

private final Gson gson = new GsonBuilder().setPrettyPrinting()
            .registerTypeAdapter(KingdomPlayer.class, new KingdomPlayerAdapter()).create();

public void savePlayer(KingdomPlayer player) {
        File playerFile = getPlayerDataFile(player.getUniqueId());
        String json = gson.toJson(player, KingdomPlayer.class);```
quaint mantle
tardy delta
#

ye 7smile7 used your forum post kek

quaint mantle
real blaze
lost matrix
tender shard
tardy delta
#

for loop lol

tender shard
#

no

#

that is not the full class

quaint mantle
#

it is

tender shard
#

there are no imports, there isn't even a package declaration

quaint mantle
#

ghkjgh

tender shard
#

alright, you do you, I won't spend time to help you if you refuse to accept any help

quaint mantle
#

It's not that, it's just that the error is not located in my main file

#

I really appreciate your help, but as I said, it's not that

lost matrix
real blaze
lost matrix
tender shard
quaint mantle
tender shard
#

open it with winrar or similar. did you accidentally shade the Bukkit API?

#

if so, your main class extends your shaded JavaPlugin class, not the one the server is running

lost matrix
tender shard
#

so they both have the same name (its possible because every plugin has its own classloader) and then it says weird errors like "it doesn't extend MY javaplugin class"

#

I am pretty sure that you somehow shaded the bukkit api

atomic violet
#

when i type "@Override" it says it cannot resolve symbol, any ideas on why this might be happening

lost matrix
lost matrix
quaint mantle
atomic violet
#

hmm alr ill see if i can fix that at all, it seemed to be working because all my block break events work and everything else but @override doesnt

quaint mantle
#

Like that ?

lost matrix