#help-development

1 messages · Page 1869 of 1

analog prairie
#

So I need to be able to distinguish the unique id of the server

young knoll
#

You’ll need to make one

#

And save it somewhere

dusk flicker
analog prairie
#

Does Minecraft itself have a server uuid?

dusk flicker
#

Not that im aware of

young knoll
#

No

dusk flicker
#

You can just generate a standard UUID and save that as Coll suggested

analog prairie
#

Got it

dusk flicker
#

honestly cant remember if this is on github or not

ivory sleet
#

@analog prairie sounds like you got a none problem for yourself, servers do not have a unique identifier

ivory sleet
dusk flicker
#

It's on GitHub just private, initial commit on Dec 28th 2020, now over a year later this core is in a production phase

ivory sleet
#

🥲

#

Code base gotta be massive

dusk flicker
#

you dont even know

#

lmao

#

i need to find out if there is a way to see the total lines of a project

ivory sleet
#

Yeah believe it is

#

iirc there’s an IntelliJ plugin for it also

lethal oxide
#

I mean ig

#

But grade or@maven I still built artifacts and it failed

#

So wouldn’t it not work regardless

ivory sleet
#

Put simply, that’s not how you use maven or gradle

analog prairie
#

[Server thread/INFO]: Tick portal move to world debug

#

Does any know what's wrong with this problem?

#

This make my server crash many times

#

🥲

lethal oxide
#

I’ll try latr and let u know

swift adder
#

?paste

undone axleBOT
swift adder
young knoll
#

Read the error

swift adder
#

Im guessing I messed up here stats.replace(e.getPlayer(), value + 1);

#

it

#

it's tryna change a non integer right?

worldly ingot
#

pStats.java:22

#

You're calling get() on your Map but it has no mapping

#

You can either use getOrDefault() or return if the Integer is null (not an int. Assigning it to a primitive will auto unbox)

proud basin
#

Is there a reason why this textComponent.setClickEvent(new ClickEvent(ClickEvent.Action.RUN_COMMAND, "/tp " + user.getPlayer())); is kicking players when they join?

young knoll
#

What does getPlayer return

worldly ingot
#

That alone probably doesn't, jtx

#

That just sets a click event lol

charred echo
#

Anyone know how Minecraft applies the enchantment texture to an item texture
to make it all glowy in-game

proud basin
#

Since I added that it just kicks everyone when they join

young knoll
#

Is getPlayer a string

worldly ingot
#

On which version? Could have some fucked up impl. of BungeeChat or something

charred echo
#

do it progrimatically

young knoll
#

Because if it returns a player the implicit toString is going to have a messy output including {}

#

Which json may not approve of

worldly ingot
#

Components can't run anything directly. It has to be a command

proud basin
#

1.16

worldly ingot
#

Just make sure you're on the latest 1.16.5 then

#

Not sure why that alone would cause a kick

proud basin
#

yea

arctic moth
#

is there like an isThrowable() thing under material

worldly ingot
#

What would it entail?

arctic moth
#

like if an item can be thrown

worldly ingot
#

Can't all items be thrown?

arctic moth
#

like eye of ender, ender pearl, egg. etc.

worldly ingot
#

Oh

paper viper
#

you can manually make a list

#

ig

#

its not that many

young knoll
#

Set*

worldly ingot
#

Yeah, I'd make your own Set for that. There are few

#

Nothing under Material for it

young knoll
#

I mean that could also be PRd

proud basin
paper viper
#

wasnt referring to the actual computer term, was just speaking in general XD

young knoll
#

But material enum PRs are ugly

charred echo
#

Anyone know how Minecraft applies the enchantment texture to an item texture
to make it all glowy in-game

young knoll
#

It’s just an overlay

worldly ingot
#

It's client-sided. Will glow so long as there's at least one enchantment on the item's NBT tag

#

but yeah, just an overlayed texture

#

It's like enchantment_glint.png or something

charred echo
proud basin
charred echo
#

but if item is enchanted I need to apply the encahntment texture to the material texture

swift adder
#

p.sendMessage(Integer.toString(stats.get(p))); this what i got for the message

proud basin
#

Yeah no I don't how to fix this

charred echo
#

this is what ive found in the default texture pack

young knoll
proud basin
#

their name

#

string

young knoll
#

Okay so it’s a string

charred echo
#

but how does that actually apply to the item

proud basin
#

yea

young knoll
#

Huh

#

Does run command need the /? I never remember

proud basin
#

yea

#

I thinkso

swift adder
proud basin
#

although that shouldn't cause the issue

fleet imp
#

how do i give an item to a player

young knoll
#

Player#getInventory#addItem

fleet imp
#

thx

swift adder
proud basin
#

What's the other reason that it could cause it

young knoll
#

Does the client log say anything

fleet imp
proud basin
#

wym?

#

I send the screenshot

young knoll
#

When the client gets kicked, is there anything in the log

young knoll
#

?jd

swift adder
#

But yeah read the docs

proud basin
#

nothing in logs

young knoll
#

The client ones or the server ones

fleet imp
proud basin
#

client

young knoll
#

Weird

young knoll
#

No it isn’t

proud basin
#

could it be an issue thats the server is in 1.8.8

fleet imp
young knoll
#

What version

young knoll
proud basin
#

well

#

the plugin is written to be used in all version

#

so

#

the main versio nis 1.8

#

x

#

1.8.x

honest sentinel
#

With PlayerPickupItemEvent, how do I cancel a specific item from being picked up?

young knoll
#

Check the type of the items itemstack

proud basin
#

so

#

do i need to use jsonbuilder

#

then

honest sentinel
# young knoll Check the type of the items itemstack

I tried this but that didnt work

@EventHandler
    public void onPlayerPickupItem(PlayerPickupItemEvent event) {
        ItemStack bow = new ItemStack(Material.BOW);
        if (event.getItem().getType().equals(bow)) {
            event.setCancelled(true);
        }
    }```
young knoll
#

A type will never equal an itemstack

#

getType() == Material.BOW

honest sentinel
#

Operator '==' cannot be applied to 'org.bukkit.entity.EntityType', 'org.bukkit.Material'

lavish hemlock
#

you failed him

young knoll
#

Oh they didn’t get the itemstack

proud basin
#

CHOCO where u at

young knoll
#

event#getItem#getItemStack

swift adder
fleet imp
#

@young knoll

swift adder
#

if you're available

young knoll
#

Are you adding the parameters

#

You need to pass a material at minimum

proud basin
#

bah

honest sentinel
fleet imp
young knoll
#

get the item meta and modify it

#

The javadocs has all it this

proud basin
#

am I doing somethign wrong

#
 TextComponent textComponent = new TextComponent();
        textComponent.setHoverEvent(new HoverEvent(HoverEvent.Action.SHOW_TEXT, new ComponentBuilder(
                Core.getInstance().getConfigValues().getAlertsHoverMessage()
                        .replace("%info%", stringBuilder.toString())
                        .replace("%ping%", user.getConnectionProcessor().getPing() + "")
                        .replace("%tps%", TPSUtil.getTPS() + "")).create()));
        textComponent.setClickEvent(new ClickEvent(ClickEvent.Action.RUN_COMMAND, "/tp " + user.getPlayer().getName()));
        user.getPlayer().spigot().sendMessage(textComponent);
low temple
#

then you dont need to create the Bow itemstack

young knoll
#

You don’t with mine either?

#

You literally just changed == to .equals

low temple
#

urs was with getItemStack()

sullen marlin
#

You never set any text lol

#

You just have a bare hover event

young knoll
#

Entity.getType will never be a bow

proud basin
#

wym?

fleet imp
#

How do i add data to an item

young knoll
#

?jd

low temple
low temple
young knoll
#

What

low temple
#

???

young knoll
#

event.getItem is an entity, not an itemstack

low temple
#

then it would be event.getItem().getItemStack().getType().equals(Material.BOW)

young knoll
#

Yes

low temple
#

you should compare the type rather than compare the itemstack

young knoll
proud basin
low temple
young knoll
#

The other message was to clarify they need to use getType on getItem#getItemStack, not just getItem

low temple
#

i see, i thought u were telling him to compare the itemstack

sullen marlin
proud basin
#

Core.getInstance().getConfigValues().getAlertsHoverMessage()

sullen marlin
#

Hover message

#

You never set the actual text

#

You need something to hover on

proud basin
#

wait

#

give me a moment while I process this

#

you are right

swift adder
drifting vault
#

continuing this question, what i meant was client side. i would like to cancel or change the sound of the block breaking

#

for example: instead of a wood sound when breaking wood, i would like to play a glass sound to the client

young knoll
#

If the sound is handled client side you are out of luck

#

I’m not sure which side handles it

drifting vault
#

i know it is possible with a resource pack. since a noteblock uses the wood sounds, can i change just for the noteblock or must it be the wood too?

#

i am referring to how origin realms adds their sounds to noteblocks

young knoll
#

It’s probably server side then

#

If you can capture and modify the outgoing packet

lethal oxide
#

Crazy thought

#

Props to u mate

analog prairie
#

Does any know what's wrong with this problem?

#

[Server thread/INFO]: Tick portal move to world debug

ivory sleet
#

That looks like just some debug stuff

#

Should be harmless

#

No warn/error indication

gleaming grove
#

what i need to do to hightlight class after using my custom annotation?

#

for example methods with annotation @EventHandler are highlighted

waxen plinth
#

I think intellij just checks source to see if reflection is done based on the annotation, but I'm not sure

young knoll
#

I figured it was a plugin

#

Isn’t there a mc dev plugin

waxen plinth
#

So I think it has to be that

young knoll
#

Interesting

sullen marlin
#

Pretty sure the difference is its public

heavy heart
#

Hey, I was planning on making a plugin for my server, but it seems that I do not have the competence to make the spigot jar work with the plugin or IntelliJ. Any tips?

#

To my knowledge package org.bukkit.plugin.java does not exist is not a good sign

young knoll
#

?bootstrap

undone axleBOT
#

Bootstrap Jar
The main spigot-1.18.jar is now a bootstrap jar which contains all libraries. You cannot directly depend on this jar. You should depend on Spigot/Spigot-API/target/spigot-api-1.18-R0.1-SNAPSHOT-shaded.jar, or the entire contents of the bundler directory from your server, or use a dependency manager such as Maven or Gradle to handle this automatically.

Please read the release notes for further information: https://www.spigotmc.org/threads/9-years-of-spigotmc-spigot-bungeecord-1-18-1-18-1-release.534760/#post-4305163

gleaming grove
#

have you generated Plugin project in Intelji or made it form scratch?

heavy heart
#

I suppose I started from scratch? I just downloaded IntelliJ and made a new project. I also did the project structure > Modules thing

gleaming grove
#

try this plugin for inteliji it makes life much easier

heavy heart
#

Aight Ima check it out thanks 👍

heavy heart
gleaming grove
#

then after creating new project the only thing you need to configure is output path for .jar file

somber hull
#

Could i get someone to quickly proofread this?

somber hull
somber hull
gleaming grove
#

I see two thinks that could be improved 1. make field private because they are now package private, 2. instead of making Getters and Setters by hand use Loombok library it generate fields automatically

young knoll
#

You really don’t need to use Lombok

#

IDEs can generate getters and setters for you

gleaming grove
#

anyway better to autogenerate them

young knoll
#

I notice in your place event you check it getItemMeta == null, you should check hasItemMeta instead

#

getItemMeta will create a meta instance if one doesn’t already exist, hasItemMeta will not

gleaming grove
#

And consider to divide SpawnerGUI class to more subclasses because this class is now so big and will getting bigger in future

somber hull
#

Alright, thank you

somber hull
#

I honestly thought there would be WAY more wrong with it

young knoll
#

Looks pretty good to me, compared to some of the stuff we see in this channel :p

somber hull
#

Lol

#

It feels super spagetthi when writing thats why i asked

somber hull
#

Like it feels like if i didnt know where stuff was i wouldnt be able to write on it

hardy swan
#

Is it true that Bukkit#getPlayer(UUID) returns a player iff player is online?

young knoll
#

Yes

hardy swan
#

sick, thanks

waxen plinth
#

To me the GUI part just looks really dense

#

Probably good to split it up more

hardy swan
somber hull
somber hull
#

And I hate that I started to make a api part but then decided that I wasn’t going to and never refactored it lol

#

So there’s an “api” part that’s not really an api

gleaming grove
hardy swan
#

Ok I think this might just be nitpicking, but if #setXp(int) is used to, well, set xp, I think it should have a return type of void (similarly for other setters) unless we are dealing with immutable objects here.
I always have the rule to myself that variables that ends with type should be allocated an enum constant.

somber hull
tender shard
#

?showerror

#

just testing

#

what's it called again

#

conclure added it today

gleaming grove
somber hull
#

If it ain’t broke, don’t fix it

hardy swan
#

I don't think it is healthy to live with that mentality

young knoll
#

You’ll see a lot of conflict about Lombok here

somber hull
#

Lol

young knoll
#

Some people love it, others hate it

gleaming grove
young knoll
#

It’s the same amount of time with 2 variables or 20

somber hull
#

But how easy is it to use

#

Like

#

Install

tender shard
young knoll
#

Lombad amirite

somber hull
#

Oh yea IntelliJ was saying one of my classes should be a record

#

What’s that about

tender shard
drowsy helm
tender shard
#

one sec

young knoll
#

Records are a new type meant to handle pure data classes

somber hull
tender shard
#

or 15? idk

#

anyway, they are kinda new

young knoll
#

15

tender shard
#

check out the blog post I sent

young knoll
#

According to your post at least

tender shard
#

well then it must be true lol

#

I NEVER DO MISTAKES

#

I AM JESUS

hardy swan
#

lombok are basically sth that removes boilerplate, necessarily or unnescessarily

somber hull
#

Oh cool, anyway what do they do?

tender shard
hardy swan
#

so you see yourself writing getters and setters

somber hull
#

Oh my b

hardy swan
#

lombok removes that requirement

young knoll
#

Who writes them

hardy swan
#

😮

tender shard
tender shard
young knoll
#

No

#

I can gen them just fine in eclipse

tender shard
#

wait

#

are you an eclipse guy @young knoll ?

young knoll
#

Yes

tender shard
#

oh

#

you'll be enlightened someday, too

somber hull
#

Got it

tender shard
#

after I installed IntelliJ, I hated it for the first day. On the second day, I uninstalled eclipse

somber hull
#

So what are the downsides to Lombok

hardy swan
young knoll
#

Choco uses eclipse

tender shard
#

lombok is awesome

young knoll
#

MD uses netbeans

somber hull
hardy swan
#

I use vim

#

jk

tender shard
hardy swan
#

vscode for the win

somber hull
#

Coll what are the downsides to lombok

tender shard
tender shard
gleaming grove
#

@somber hull look there is one big class, all methods has been generated by lombok

young knoll
#

Idk I’ve never used it

#

I’ve heard people here argue over it being a compiler hack

tender shard
#

lombok IS AWESOME, fr

somber hull
#

Imma look up the downsides

#

There have to be downsides

#

I don’t believe it’s perfect

gleaming grove
#

you only need to use attribute @Getter and @Setter, and thats it

tender shard
young knoll
#

Yes

hardy swan
#

but shouldn't you put in better thought on whether variables deserve a getter or setter?

young knoll
#

You still can

hardy swan
#

oh you need the annotations

young knoll
#

Mhm

drifting vault
#

what event is called when a shulker box is opened and closed? or is there one? a shulker box updates nearby blocks when interacted with

hardy swan
#

are you still on the noteblocks thing haha

drifting vault
#

yea lol

young knoll
#

It’ll call the physics event

drifting vault
#

i tested it

young knoll
#

It should, if it’s updating blocks

drifting vault
#

i logged it and opened and let it close, there isnt anything to output

hardy swan
#

when api cant solve it

#

you turn to PlayerStatisticIncrementEvent

hardy swan
#

HAHAHA

young knoll
#

I mean

#

That event is still API

somber hull
tender shard
#

TL;DR: Lombok is AWESOME and there's no downside whatsoever in using it

drifting vault
#
@EventHandler
    public void onBlockPhysics(BlockPhysicsEvent event) {
        System.out.println("update");
       
    }
#

lol

hardy swan
#

true, but that event has a special place in my heart

tender shard
#

and if they still claim lombok sucks, please let me know WHY you think it sucks

somber hull
#

Nothing is perfect*

hardy swan
somber hull
hardy swan
#

if the system deem that it doesn't affect anything, it is automatically set to cancelled i think

somber hull
#

What even is Kirk in

#

Kotlin

quaint mantle
#

Oops

young knoll
#

Kotlin is java for people that are scared of java

drifting vault
#

i removed the ignored cancel. same effect

quaint mantle
#

Lombok is a compiler hack.

#

Kotler > Lombok

hardy swan
young knoll
#

Kotlerrrr

hardy swan
#

java is not scary, it is.... just outdated

somber hull
#

Does it have restrictions from Java?

young knoll
#

You need to shade the 2mb standard lib

#

Does that count

somber hull
#

That’s not THAT bad

quaint mantle
#

like, nothing too scary

#

Just cool java with syntax sugar

#

and better than lombok

young knoll
#

It has a bunch of new stuff that I’m too dumb lazy to learn

somber hull
#

Wait so is it just like a redo of the Java api? Or a new language based off Java?

quaint mantle
#

New JVM language that supports java i'd say

somber hull
tender shard
somber hull
#

It can’t be

tender shard
#

and kotlin sucks

#

okay kotlin does NOT suck

somber hull
#

I’m just trying to understand what kotlin is

tender shard
#

kotlin = ugly java with benefits

gleaming grove
#

kotlin is ugly java

#

yes

young knoll
#

No one here has the same opinion

tender shard
#

like your babysitter

#

she was probably ugly but you were into her anyway

#

and I am saying that as a gay dude

quaint mantle
#

Well, for one, I don't think you should use setters at all. Immutable objects are a much better way of transferring data than mutable ones.

For two, you should avoid getters if you can, and instead move behavior into the object rather than operating on it externally. This enables better design choices; it lets you do things like use multiple implementations of the same interface. You end up with less casts, less switch statements, and more polymorphism. It's a more object-oriented style of code and is much cleaner overall.

Another quite large issue with lombok is that it introduces its own language of sorts. Learning lombok isn't like learning an API or a library. Lombok generates code. Sometimes that code may not be what you'd expect. Things like @Getter are straight-forward, but the more advanced annotations like @Data I find entirely repugnant because they hide so much logic in a single annotation.
When you debug and review lombok code, you have to think in terms of the code which would be generated. This is non-negligible mental overhead, and for what gain? It would be better to write the code yourself or have the IDE generate it, depending on the demands of the situation.

young knoll
#

I for one think anyone who doesn’t work with pure java is a sinner

#

Or something

young knoll
#

Kobmol

tender shard
#

lombok is pure java. it just avoids you having to write

public XYZ getXyz() { return this.xyz; }```
young knoll
#

But I don’t write that

#

My ide does it for me

quaint mantle
#

yes!

tender shard
#

but now just imagine you have a toString() method for your data class

young knoll
#

I’m going to lom your bok

quaint mantle
#

it is just unecessary, since getters should be avoided anyways

tender shard
#

when you add a new field, your toString() becomes useless

#

in lombok you just do @grand coralta once and it will always work fine

waxen plinth
#

😎

gleaming grove
#

avoided? @quaint mantle

somber hull
tender shard
somber hull
tender shard
waxen plinth
#

No cause I have covid and no computer access right now

#

But my top speed is 146

somber hull
tender shard
#

tbh my keyboard is fucked anyway

somber hull
tender shard
#

I smoke too much in front of my PC so there's always some ashes in my keyboard >.<

quaint mantle
young knoll
#

Sometimes y’all make me want to spiget a new hobby

waxen plinth
#

Average is closer to 115-120

somber hull
waxen plinth
#

She does

tender shard
somber hull
tender shard
#

or themfriend

young knoll
#

Programmers don’t have partners

quaint mantle
#

😱

somber hull
waxen plinth
#

Guess I'm not a programmer

tender shard
somber hull
young knoll
#

Programmers just become the girlfriend instead

tender shard
#

I am an Apache Attack Helicopter

#

running java 8

#

what are you?

quaint mantle
#

ac-130

tender shard
#

oh shit that's an old thing

#

the oldest plane I ever controlled was a boeing 737-200 and I was only in charge of it for about 5 minutes

waxen plinth
somber hull
#

“I am T-72 armored military vehicle” - in Russian accent

blazing scarab
young knoll
#

3/4 of this server is part of MDs hivemind

somber hull
young knoll
#

Quick someone ban him

somber hull
#

Lol

#

I didn’t know who he was for the first month of being here

tender shard
young knoll
#

I wouldn’t give him my code if I hated him

tender shard
#

fun fact: the german word for "shit" sounds exactly like the enligsh word "code"

gleaming grove
tender shard
somber hull
#

Wait, is there any negative to making a premium plug-in open sourced, except that you would be losing around 30% of your money to those that know how to compile Java?

sullen marlin
#

Turn the volume down

somber hull
tender shard
gleaming grove
#

;/

sullen marlin
#

I was talking to the piano dude

#

Can’t hear block break sounds with no sound

young knoll
#

But they’ll do that anyway

somber hull
#

What is there to leak

tender shard
young knoll
#

The compiled jar

#

But no

#

I encourage open source premium

somber hull
young knoll
#

There are

#

Uhh

#

Websites

somber hull
somber hull
hardy swan
tender shard
young knoll
#

What social class is below programmer

hardy swan
#

coder

somber hull
tender shard
vocal cloud
#

Interns

young knoll
#

What if I’m a goth programming student intern

tender shard
somber hull
tender shard
vocal cloud
#

Unpaid intern student

somber hull
#

Gn everyone I got an interview for my first job tmrw

young knoll
#

Hopefully it’s not unpaid

tender shard
hardy swan
#

technical interview?

somber hull
hardy swan
#

oh

young knoll
#

Very technical

tender shard
#

you'll fry rock your interview, I'm sure

hardy swan
#

solve some burger flipping problem

vocal cloud
#

Coding the ice cream machines at McDonald's to finally work

somber hull
tender shard
young knoll
#

Don’t throw rocks at the interviewer

somber hull
#

Thank you, bye

young knoll
#

Usually doesn’t help

somber hull
tender shard
#

go to sleep now

hardy swan
#

tell the interviewers you have experience in spigot api

#

gn

vocal cloud
#

Get md_5 to personally recommend you

tender shard
#

"This is a delicious burger!"

tender shard
young knoll
#

“I’ll have you know I have nearly 10 lines of code in the spigot API, you’d have to be an idiot not to hire me”

#

“Sir, this is a Wendy’s”

tender shard
#

remapped

#

oh shit

#

we made hepl-dev become a totally off topic channel lol

#

I think we did a good job

young knoll
#

That’s not a rare occurrence

hardy swan
#

No one really needs help

vocal cloud
#

Just use Google

tender shard
#

tbh I need help

hardy swan
#

?learnjava

young knoll
#

We don’t offer that kind of help

tender shard
#

haha

#

no fr

#

one sec

#

?paste

undone axleBOT
tender shard
#

is there a smarter way?

hardy swan
#

Thats a long document

young knoll
#

Hmm

tender shard
#

also @sullen marlin your pastebin sucks, it always thinks something is shell when it's yaml D:

young knoll
#

You could make use of Block#canPlace

tender shard
young knoll
#

A set of materials is probably your best bet

tender shard
#

and BlockäcanPlace will return true for almost everything

#

ofc I can place dirt on a carpet but that doesn't mean that the dirt will break when breaking the carpet

#

I need like the "opposite" version of canPlace

#

like

#

willBreak() or sth lol

young knoll
#

That’s actually somewhat what it is

#

Maybe I should have named it better

tender shard
#

hm

young knoll
#

I think Mojang calls it canSurvive

vocal cloud
#

I imagine you could use NMS if spigot doesn't have it

tender shard
#

so there is an NMS method for this?

#

I mean, current thing is working fine, it's just ugly and I'd rather replace it

young knoll
#

Not that I know of

#

Don’t feel bad about big material lists, you should see some of the Material methods

vocal cloud
#

I'm going to have to make a project for this aren't I? Sigh.

tender shard
vocal cloud
#

Okay what version

tender shard
#

that's not a valid question

#

of course always latest 😛

hardy swan
#

Every

vocal cloud
#

Idk some people I've worked for do 1.8 like it's the only build around

tender shard
#

1.8 people have more cancer than I do and I roll cigarettes while I am still smoking

young knoll
#

I very much look forward to the day the material enum is replaced

tender shard
#

I hope it will never happen

hardy swan
#

What can it be replaced with

young knoll
#

It’s already planned

#

A registry system

tender shard
#

NamespacedKey mat = Material.DIRT.getKey()

#

will probably be a thing

#

sometime

young knoll
#

From the 1.18 post

#

Future API
There are plans underway to change the way many enums in the API are handled so that custom content can be better supported. These changes are not expected to break most plugin jars (backwards compatibility will be provided), however they may unavoidably break plugin source code (though the Maven version will be bumped if this occurs). To reduce the risk of breakage, please consider avoiding the use of switch statements and EnumSet over enums which implement 'Keyed'.

tender shard
#

vanilla client

#

it probably won't happen for Material that soon

young knoll
tender shard
#

I doubt that the Material enum will vanish in the next 3+ years

young knoll
#

Choco has already tried to kill it :p

tender shard
#

yeah but Choco is loco

young knoll
#

I mean the message states any enum that implements keyed

#

Which material falls under

tender shard
#

everyone please mock md_5 to install checkmk in #general

young knoll
#

I’d love to look into it myself, but material is very deeply interconnected into spigot and it’s hard to tackle

gleaming grove
#

Guys what API for web socket would you recommend?

vocal cloud
#

A good one preferably

gleaming grove
#

i guess so,, the org.java_websocket.server.WebSocketServer not really works well with spigot

frosty tinsel
#

I think Apache has something

#

Is might have

wet breach
#

Java supports web sockets o.O

gleaming grove
#

web socket it is just TCP + UDP

wet breach
rough basin
#

The direction the arrow flies is correct, but the direction the arrow is facing is not normal. What should I do?

gleaming grove
#

File.separator try this maybe

wet breach
rough basin
#

um no

tender shard
#

frostalf go eat the bone I sent you

vocal cloud
#

@tender shard I can't use custom emotes but I assume you want something like this?

spiral light
#

At least change the way biomes are used to let users use custom biomes too

gentle oriole
#

help. config.addDefault doesnt make a new key even if config doesnt have that key

#

it only makes new key when config is empty

#

does addDefault only work if para1 is null

gleaming grove
#

try config.set("KEY","VALUE");

gentle oriole
#

configFile.addDefault("DEATH_MESSAGES", defaultDeathMessages); defaultDeathMessages is a Map.

gentle oriole
#

I think I just need to make a loop then config.addDefault it with every key instead of a Map

wet breach
#

o.O

gentle oriole
wet breach
#

well if its giving you trouble using that method you could just create your own check that will add it

wet breach
#

maybe people won't notice? lol

frosty tinsel
rough basin
#

no i didn't

gentle oriole
#

so by iterating through the map, I could force it to check every key in the config

wet breach
#

what does the code look like for how you are using addDefault?

gentle oriole
#

i was doing it like config.addDefaults("parent", map);

#
for (String key : defaultDeathMessages.keySet()) {
            configFile.addDefault("DEATH_MESSAGES."+key, defaultDeathMessages.get(key));
        }
wet breach
#

getKeys() can grab all the keys if you want it to

wet breach
#

boolean is if you want it to grab the children keys too or if you just want the upper most keys

gentle oriole
#

aandd it works just as expected

#

programming 101

frosty tinsel
#

Take a look

wet breach
#

usually got to iterate over your map depending how you want it saved or convert the map to a List since yaml has no problems with Lists 🙂

gentle oriole
frosty tinsel
wet breach
wet breach
quaint mantle
#

what's the best way to figure out if it's my plugin causing lag or the world

#

im having a problem where in a void world my plguin was fine but when i get an actual world it lags

#

im trying to load all chunks etc but the world just sucks

gentle oriole
#

wtf, im so stupid i didnt realize taht return cancels a loop instead of cancelling an if statement

quaint mantle
#

but thats about it

wet breach
gentle oriole
#

YES I JUST REALIZED IT AFTER 2DAYS LMAOOO

wet breach
#

all part of the learning experience

#

now maybe you can get things working 🙂

analog prairie
#

Is there a better way to read yml files?

#

I'm using getConfig() now

#

The server had reload to make the plugin reload config.yml

#

And config.yml just only one file

gentle oriole
#

@analog prairie wait a minute i found myself in the same problem and i got a solution just wait while i finish typing this and start finding the code to copy paste from my project to here thank you for your understanding and im sorry to make you read it all up to here. ok ill stop here no really.

#
configFile.options().copyDefaults(true);
        plugin.saveConfig();
        plugin.reloadConfig();

        configFile = plugin.getConfig();
``` @analog prairie try this
analog prairie
#

I don't understand these words

#

What do you mean

gentle oriole
analog prairie
#

OK

gentle oriole
#

see if it works

analog prairie
#

FilePath?

#

Isn't this only for config.yml?

gentle oriole
#

wdym?

analog prairie
#

I need more yml to sort function settings

gentle oriole
#

do you have multiple config files?

analog prairie
#

Y

wet breach
analog prairie
#

I had a lof problem for config file🥲

#

What about update problem

analog prairie
#

Update config file

#

Or just generate new one

quaint mantle
frosty tinsel
quaint mantle
#

yes

#

the boolean is not working

frosty tinsel
gleaming grove
#

When it comes to yml file. there is an important question that needs to be answered. Does server admin need to see/change stored properties? If yes use YML if not use JSON.

quaint mantle
frosty tinsel
quaint mantle
#

i have set another propertie which probably prevented the custom name visible 🤷‍♂️

gentle oriole
#

btw is there somthing that can organize config.yml alphabetically? smh if I make changes to it ingame, the order of it changes so that the modified value is in the bottom.

quaint mantle
#

like

#

remove it

#

then add it

#

again?

wet breach
gentle oriole
wet breach
#

I have a function that is similar to what you are wanting

#

ok maybe I don't have it anymore

#

anyways you are going to have to create your own function that loads the data and then sorts it how you want, and then save it

quaint mantle
wet breach
analog prairie
#
dependencies {
    compile group: 'org.apache.logging.log4j', name: 'log4j-api', version: '2.17.1'
    compile group: 'org.apache.logging.log4j', name: 'log4j-core', version: '2.17.1'
    implementation 'com.google.code.gson:gson:2.8.9'
    compileOnly 'org.spigotmc:spigot-api:1.18-R0.1-SNAPSHOT'
}
#

Is this correct?

tardy delta
#

can i use a normal hashmap when working with concurrency?

mellow gulch
#

depends on how the hashmap is going to be used

#

you can use a normal hashmap regardless of use, but for certain things you'd need to do a bit of extra work manually.
under certain circumstances though you should be able to use a regular hashmap without extra work

gentle oriole
#

boolean isFlying() does this return true when player fly with an elytra or fly with creative mode?

mellow gulch
#

flying is creative flight, gliding is elytra

gentle oriole
#

oh.

wet breach
#

if you need to write to it, then best to use ConcurrentHashMap

tardy delta
#

will this a concurrentmodification ex?
someHashmap.values.forEach(value -> if (value.something() == null) { remove the entry }?

wet breach
#

removing entries is considered writing so yeah it will most likely CME

#

if you are running that method from multiple threads

tardy delta
#

from a repeating task

#

to keep the data valid

wet breach
#

well I gave you the other hashmap if you want concurrency

#

ConcurrentHashMap it is thread safe

tardy delta
#

alright

analog prairie
#

log4j2.yml must put at main class path right?

#
Spigot_ExpTech_whes1015/log4j2.yml
Spigot_ExpTech_whes1015/main.java
somber scarab
#

Hello! im trying to generate random loot from a set of minecraft loottables, not custom ones
i need to get the list of items a loot table has in order to then randomly select one of them
and give itto the player
but the class LootTables doesnt let me get a list of a certain loot table enum's ItemStack?

quaint mantle
#

Can not set final int field net.minecraft.network.protocol.game.PacketPlayOutMount.a to java.lang.Class
Is there any way to work around this with Field?

visual tide
#

does PlayerExpChangeEvent when xp is modified via vanilla command or plugin?

alpine urchin
#

Sometimes few things remain outdated, which is unfortunate(and rare)

#

its maintained by the community

#

if you find an error, you can fix it

gentle oriole
#

how do I make regex work?

            String response = "testx";
            
            Pattern p = Pattern.compile("(.)");
            Matcher m = p.matcher(response);
            System.out.println(m.group(1));
```gives error No match found
north trench
#

nothing works i am using PlayerInteractAtEntityEvent event

vocal cloud
north trench
vocal cloud
#

Custom item? So when a player say holds the "stick of smiting" they can right click and cast lightning? What exactly isn't working

vocal cloud
long dove
#

Hello, any developer?

quaint mantle
#

no

#

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

long dove
#

I know it sounds absurd, but the yml in my configuration if I delete something in the folder that my plugin created and not in the jar it still detects it, does anyone know how to solve it?

quaint mantle
#

do you have the copyDefaults or something similiar to that

#

havent check bukkit methods in a while

long dove
#

for example I delete data: 1 in the yml of the folder that I create, my plugin keeps detecting it if I don't delete it in the jar it keeps detecting it

quaint mantle
#

answer me first

#

i think i understand what you are talking, but just to make sure

quaint mantle
# long dove Yes

well, the copyDefaults, i think it copy the config into memory

#

maybe after you delete the config

#

you should reload them, by using the reload method i think

long dove
#

but for example it is not only in config.yml say no in other yml that I create for example messages.yml, if you understand right?

quaint mantle
#

first gonna check jd again

#

?dj

#

?jd

quaint mantle
long dove
quaint mantle
#

no no nono you dont understand what im saying...

#

so for example you have the custom config

#

message.yml

#

do you do something like this onEnabled?
messageYml.getConfig().options().copyDefaults();

long dove
#

I mean, I already put the copy Defaults but even when deleting something it continues to detect it if it comes by default and I must delete it in the jar for it to take effect and I don't want that.

quaint mantle
#

try remove that line

#

because if you remove yml without reloading the config system i guess the memory config dont reload and it will continue to use the yml in memory

#

but that is my guess, i might be wrong, dont blame me for that, i havent use bukkit in a while now 😛

novel frost
#
    @EventHandler(priority = EventPriority.HIGH)
    public void onContainerBreak(BlockBreakEvent e) {
        final BlockState block = e.getBlock().getState();
        final boolean isNameable = block instanceof Nameable;
        if(isNameable) {
            if(isNamed(block)) {
                ((Nameable) block).setCustomName(null);
                block.update();
            }
        }
    }

I have a plugin that is naming chests when they get placed, and I want to undo this when the block gets broken. But the above code doesn't seem to be taking effect.

How can I change either the block that a drop is generated from, or the drop a block causes?

north trench
quaint mantle
#

item with custom model

#

like the idea is pretty obvious

vocal cloud
quaint mantle
#

nbt, pdc, custom model data, names, lore...

vocal cloud
#

Slap some hidden attributes on it and you're golden. Unless it's an older version then it's hiding it in the lore or whatever

vocal cloud
north trench
#

idk how to do it

north trench
naive jolt
#
public Damage(){
        flagCount.put( flagCount.put(*damager*.getName(), Flags);
    }
    @EventHandler
    public void DamageEntity(EntityDamageByEntityEvent event) throws IOException {
        if(event.getDamager() instanceof Player) {
            Player *damager* = (Player) event.getDamager();```
#

Hey

#

Is there no solution to this?

#

I want to access damager but its local

#

cause its in the Event

#

I am creating a constructor

vocal cloud
# north trench can you help me to do it?

I mean you have the interact event right? You can get the player from it and then get the inventory and then the main hand. That will allow you to check if the item is what you want it to be.

visual tide
#

any1 know what happens when i get a non-existing tag with nbtApi

north trench
#

can you help me?

vocal cloud
#

Wait you want it to do lightning? Is the explosion working? Im confused.

north trench
quaint mantle
#

?spoonfeed

#

?spoon

undone axleBOT
#

Spoonfeed a newbie for a day and they'll come back with more questions. Teach them to find their own answers and you'll both be better off: you won't get stuck answering the easy questions and they'll be much more productive than before.

paper falcon
#

Hello people, I'm making it so you have a 20% chance drop diamond from killing a creeper, so I made a random https://prnt.sc/26948pr

Lightshot

Captured with Lightshot

#

but I NEVER get the diamond

#

I am printing the result

#

it's ALWAYS 96

minor garnet
#

tf

chrome beacon
#

Show entire code

paper falcon
chrome beacon
#

You're randomizing once

#

So ofc the value is the same

paper falcon
#

ohh right

spiral light
paper falcon
#

yup I'm a dummy for not realizing that

#

thanks lol

minor garnet
#

well, I made a code where when the player looks at an entity a hologram will appear, but I'm trying to make that every time the player moves while looking at this entity it rotates towards you, but sometimes it teleports to my angle in milliseconds, then it stays static looking only in one direction

https://paste.md-5.net/ayozamosef.java
does anyone know why, or how can i fix it?

night copper
#

what program should i use to make a poster, like instead of writing my description i would make an image

vocal cloud
kindred valley
#

?paste

undone axleBOT
chrome beacon
kindred valley
#

someone help me on dm?

spiral light
minor garnet
#

i just want to make when the player move, the ''armor stand'' rotate to my angle

minor garnet
#

i already have made that code, but when i move the entity dont rotate for me, sometimes in miliseconds rotate, later stays static looking only in one direction

spiral light
minor garnet
#

yes

vocal cloud
minor garnet
#

like the holograms do you know?

spiral light
#

then your code looks a bit more complicated to me then it should be

kindred valley
spiral light
minor garnet
#

tf

#

what made the code a little complicated was that I had to use ray trace to detect an entity the player is looking at, and check if the previous entity he was looking at wasn't the one he was looking at.

spiral light
#

do you update the armorstand after its spawned or do you only update it while the player looks directly on it ?

swift adder
minor garnet
#

then I see the entity that the player is looking at

#

but my real problem, is that the armor stand isn't rotating to the player's location, one time or another it does, but then it stops

chrome beacon
swift adder
chrome beacon
#

Use contains or see if value is null

paper falcon
minor garnet
#

👏

chrome beacon
#

No need to create a new random

#

But yeah

swift adder
chrome beacon
#

?learnjava This is java basics ;/

undone axleBOT
kindred valley
spiral light
minor garnet
#

yes

spiral light
#

when

quaint mantle
#

when

minor garnet
#
    private void makeLook(ArmorStand armor,Player player) {
        Location loc = player.getLocation();
        Location eloc = armor.getLocation();
        
        final double xd = loc.getX() - eloc.getX(),
               yd = loc.getY() - eloc.getY(),
               zd = loc.getZ() - eloc.getZ(),
               yaw = Math.atan2(xd, zd) - 90,
               ajd2 = (xd * xd) + (zd * zd),
               paral = Math.sqrt(ajd2),
               pitch = Math.atan2(yd, paral) - 90;
        Location newl = eloc.setDirection(new Vector(pitch, yaw, 0));
        armor.teleport(newl);
    //    armor.setHeadPose(new EulerAngle(Math.toRadians(pitch), Math.toRadians(yaw), 0));
    }```
minor garnet
spiral light
#

do you update it only 1 time ?

minor garnet
#

yes

quaint mantle
spiral light
#

then how would you suppose it to rotate O.o

minor garnet
swift adder
spiral light
#

well it wont update if you dont run the method to update the rotation ... give me some time i will try a code

chrome beacon
minor garnet
swift adder
#

Yes I've done that, but the integer value isn't connected to a integer how could I connect that?

chrome beacon
#

???

#

Show your code

swift adder
#

It's in the link

chrome beacon
#

You're not putting anything

swift adder
#

I change Integer to 0 as example?

#

I have the map somewhere else within my code lemme get it

kindred valley
chrome beacon
swift adder
swift adder
chrome beacon
#

That's not going to work

swift adder
#

Why wouldn't it?

chrome beacon
#

It's still null there

#

You cannot add null + 1

swift adder
#

But how do I set it as a integer?

#

I'm trying to set it as 0 + 1 basically

#

and so on

spiral light
#

@minor garnet

final ArmorStand armorStand = (ArmorStand) p.getWorld().spawn(p.getLocation(),ArmorStand.class);
            armorStand.setGravity(false);
            armorStand.getEquipment().setItemInMainHand(new org.bukkit.inventory.ItemStack(Material.DIAMOND_SWORD));

            Bukkit.getScheduler().runTaskTimer(this, new Runnable() {
    @Override
    public void run() {
          Location pLoc = p.getLocation().clone();
      Location targetLoc = armorStand.getLocation().clone();
      pLoc.setY(0);
      targetLoc.setY(0);

      Vector dif = pLoc.subtract(targetLoc).toVector();                             armorStand.teleport(armorStand.getLocation().setDirection(dif));
}
},1,1);

this thing will work 100% perfect

chrome beacon
late sonnet
swift adder
minor garnet
chrome beacon
spiral light
chrome beacon
swift adder
minor garnet
#
        Bukkit.getScheduler().scheduleSyncRepeatingTask(this, new Runnable() {
            @Override
            public void run() { 
                Bukkit.getOnlinePlayers().forEach(player -> management.showInfo(player));
            }
        }, 0, 1L);```
chrome beacon
swift adder
#

Thank you

kindred valley
swift adder
#

public static String stats = stats.getString("stats.Integer", "0"); like this?

upbeat fern
#

hey everyone i need help making a plugin is anyone willing to teach me how to make one ?

kindred valley
undone axleBOT
late sonnet
spiral light
late sonnet
spiral light
# minor garnet no?

what happens if looking.get(player) is null ?
if the player is not in looking this should then be "null == entity" and thats already wrong

#

you can also set the PersistentDataContainer instead of a different name O.o

swift adder
#

public static String stats = stats.getOrDefault(Player, 0);

#

like this?

naive jolt
#

How do I store player data without using HashMaps, I had about YAML files but I have never used them before

chrome beacon
#

Why not use HashMaps

naive jolt
minor garnet
spiral light
minor garnet
chrome beacon
minor garnet
#

is my old code made using skript

swift adder
#

public static String stats = stats.getOrDefault(Player, 0);
stats.replace(stats.getOrDefault(Player, value + 1)

#

would this work?

chrome beacon
#

An int is not a string

#

So no

swift adder
#

int value = stats.get("Integer");

chrome beacon
#

Also why static this is going to cause issues

swift adder
#

I set it as that

chrome beacon
#

No you're getting it with that

#

Not setting

swift adder
#

oh

#

So I just put Integer?

#

Or 0

minor garnet
minor garnet
digital rain
#

does anyone know i could decrease player's jump length

swift adder
spiral light
minor garnet
#

ofc

chrome beacon
swift adder
#

I'm just onto HashMaps

chrome beacon
swift adder
#

I'm learning the java basics and just got onto HashMaps

chrome beacon
#

Keep reading that then. Don't try to use Spigot right now

naive jolt
chrome beacon
naive jolt
#

Yes

digital rain
mental moon
# digital rain does anyone know i could decrease player's jump length

Put a couple System Outs on the PlayerMoveEvent and watch their xyz values and their velocity.
Jumping is really obnoxious to control so you'll have to watch those values and do some guesswork.
Like if their y location goes up and their upwards y velocity is between val1 & val2, then set their velocity to zero or something

chrome beacon
# naive jolt Yes

If hashmaps are giving you problems you should not be making anticheats

#

You are not ready for that mess

#

Anyways send your code and we can help better

spiral light
mental moon
naive jolt
#

Oh wait let me just create a constructor

chrome beacon
#

Movenent is still client side and it will cause strange and annoying behaviour on slow connections

#

I do not recommend handling it this way

digital rain
#

hmmm

naive jolt
naive jolt
chrome beacon
#

Anticheats are a bad way to do so. Make something creative maybe multiblock structures and machines. or another npc plugin

hybrid spoke
#

reinvent essentials

buoyant viper
#

yes

digital rain
#

the main reason behind trying to make their jumps smaller, is that if i simply decrease their movement speed attribute, it barely does anything when sprint jumping

naive jolt
#

I have created a lot of projects already

chrome beacon
#

Anticheats require a good understanding of how Minecraft works internally

naive jolt
#

True

hybrid spoke
#

not just minecraft

chrome beacon
#

^

frosty tinsel
#

But also the cheats

buoyant viper
#

so minecraft

hybrid spoke
#

apart from minecraft