#help-development

1 messages ยท Page 930 of 1

undone axleBOT
lime halo
#

you mean my main plugin file right? or the server console?

icy beacon
#

The code you use to initialize vault economy. It's common to have it in your main fine, so ig that

lime halo
faint lynx
#

what do you mean by that?

lilac dagger
#

you can make your own event and call your own damage causes

icy beacon
lilac dagger
#

the plugins will have to listen to your event @faint lynx

#

Bukkit.callEvent(yourevent)

lime halo
#

i can send you my console rq if you want? but im quite sure yea

icy beacon
#

Sure ig

faint lynx
lost matrix
lilac dagger
icy beacon
#

He did say that he depends on vault, though I never saw the plugin.yml, but I trust him lol

lilac dagger
#

go to 3rd part

lime halo
#

sorry took a bit, had to start it up

faint lynx
torn shuttle
#

anyone familiar with this world error? I don't think I've seen it before

torn shuttle
#

how can a chunk file be at the wrong location

lilac dagger
#

and call the event with your custom cause

icy beacon
#

Can you add a println call to every return false to see which one exactly gets called, and work from there?

#

Also send your plugin.yml just in case

lime halo
icy beacon
#

Looks fine

lime halo
#

and yes it is due to vault still:

[16:56:51 INFO]: [Nexussmp] NexusSMP has been enabled!
[16:56:51 INFO]: [Nexussmp] Disabling plugin due to no Vault dependency found.
[16:56:51 ERROR]: [Nexussmp] [Nexussmp] - Disabled due to no Vault dependency found!
[16:56:51 INFO]: [Nexussmp] Disabling Nexussmp v1.0
[16:56:51 INFO]: [Nexussmp] NexusSMP has been disabled!

https://paste.md-5.net/uwekevugid.md

echo basalt
lost matrix
cursive loom
#

sry for the delay, thx I have find

#

I gonna check ! thx

lime halo
lime halo
#

since im quite new to it coding and plugin development im using chatGPT-4 a lot to help me out

lime halo
lost matrix
#

Ah there it is

echo basalt
#

Yeah you're shading vault

#

add a <scope>provided</scope> on your vault dependency block

lime halo
#

oooooh ok i guess im stupid then

#

hahahaha thank you

icy beacon
#

Inexperienced*

lost matrix
#

Add scope provided here

icy beacon
#

Not knowing how to do something you don't have much experience with doesn't qualify as stupidity

#

Please don't discourage yourself

lime halo
#

hahahaha im just joking but it's so stupid if it's something small like that x)

lost matrix
#

Someone try uploading an image real quick. My discord is unaliving itself currently because it cant upload images.

lime halo
#

im gonna check if it works now but thank you all for the help!!!

lime halo
icy beacon
#

Nice

#

My internet died

#

Nvm

shadow night
#

oh damn

#

images ain't going up

icy beacon
#

Upload failed

#

Wow

shadow night
#

same

lime halo
#

same here

icy beacon
#

I was about to send an old ass meme with md5

inner mulch
#

what md5 meme?

icy beacon
#

ocp

#

Yeah you can't see it rn because I can't upload it rn

lime halo
#

omg it finally works again thank you all so much i have been stuck all day on that x)

inner mulch
icy beacon
#

No, "ocp" is just a reply to you sending any message

#

Not related to the meme

zealous osprey
#
public class SomeClazz<T extends OtherClazz> extends T { ... }

Damn, you can do this?!
I mean, it's cursed. But...

inner mulch
icy beacon
#

Tell me you're kidding

#

This is weird

shadow night
#

what's wrong

#

looks pretty okay to me

zealous osprey
#

idk what would be a sensible use case for that

icy beacon
#

Just that it looks like it should be a federal violation

lost matrix
#

Practically its useless

zealous osprey
#

yeah

lost matrix
#

This on the other hand:

public class SomeClazz<SELF extends SomeClazz<SELF>> {

}

Is sometimes used

zealous osprey
#

When? Why?

torn shuttle
#

weird

icy beacon
#

I don't

#

Plz explain

dawn flower
#

how do i register a custom enchant and make it add the lore

#

for example

sharpness I, customench II

lost matrix
dawn flower
#

dang

#

is there a way to always make it show up properly if i'll add the lore manually?

#

so if it already has lore it doesnt get mest up

lost matrix
# dawn flower is there a way to always make it show up properly if i'll add the lore manually?

Yes, ive done this by intercepting outgoing packets of itemstacks and adding the HideEnchants tag to them.
After that i get the Lore of the current ItemStack and replace it with:

  • Vanilla enchants (own translation)
  • Custom enchants
  • Space
  • Original lore

This can cause problems with the creative mode.
So modifying the actual lore on the ItemStack instead of intercepting packets is equally viable.

#

Replacing the original enchants is optional

#

But it lets the user come up with some custom names for enchantments and allows you to add roman symbols greater than X to even vanilla enchantments.

dawn flower
#

alr

lost matrix
#

I could come up with some examples. But its quite an abstract concept.

icy beacon
#

If possible please come up with one example ๐Ÿ™

#

I find it rly confusing rn

lost matrix
# icy beacon If possible please come up with one example ๐Ÿ™
public class SomeBuilder<SELF extends SomeBuilder<SELF>> {

  private final List<String> components;

  public SomeBuilder() {
    this.components = new ArrayList<>();
  }

  public SELF addComponent(String component) {
    this.components.add(component);
    return self();
  }

  protected SELF self() {
    return (SELF) this;
  }

  public String build() {
    return "[" + String.join(", ", this.components) + "]";
  }
}
public class DecoratedBuilder extends SomeBuilder<DecoratedBuilder> {

  public DecoratedBuilder withDecoration(String original) {
    String decorated = "%" + original + "%";
    return super.addComponent(decorated);
  }

}
    String result = new DecoratedBuilder()
        .addComponent("Normal") // If you dont use SELF then the Builder would be of type SomeBuilder<?> missing withDecoration(String)
        .withDecoration("Decorated")
        .build();
#

Was already on it

icy beacon
#

Ok I think I see what you mean

lost matrix
#

Its probably best if your copy this into a normal Java project and play around with it.

icy beacon
#

This is enforcing constraints and to prevent stuff like DecoratedBuilder extends SomeBuilder<OtherClass>

#

I gotcha

#

I think I've seen something like that in ACF code actually. Might be wrong

#

Thanks ๐Ÿ™‚

lost matrix
#

My actual usage in a project is a bit less straight forward

echo basalt
#

that can be an interface

lost matrix
#

You can be an interface

echo basalt
lost matrix
#

RPGClass is stateful

echo basalt
#

rpgclass can be an interface

icy beacon
#

Illusion coming with an "um actually" any time someone does not write code as if it's a PhD at a multi-billion valuation company:

#

๐Ÿ˜›

echo basalt
#

knowing damn well I'm writing some atrocious stuff rn

icy beacon
#

Lmao

#

Predictable

lost matrix
echo basalt
#

you just need to try harder

#

to make it an interface

icy beacon
#

Whatever we do, we can't follow OCP. What's the point

lost matrix
#

I can probably make it an interface to be fair. But that sounds like over engineering.

echo basalt
#

sounds like dependency inversion

lost matrix
#

What?

zealous osprey
#

what's OCP?

umbral ridge
#

OCD

icy beacon
#

It's just something that we cannot ever follow due to the rules of our universe e.g. entropy of everything

inner mulch
dawn flower
#

how do i check if a PlayerEvent can be cancelled

icy beacon
#

Open for extension, closed for modification

icy beacon
dawn flower
#

alr

#

ty

lilac dagger
inner mulch
#

Does somebody know if it flackers when i close a inv and open another pne right after?

echo basalt
#

a bit

icy beacon
lilac dagger
#

just open a new inventory over @inner mulch

dawn flower
#

will player.getLocation().setWorld(Bukkit.getWorld(args[0])) teleport the player?

lilac dagger
#

no flicker

icy beacon
#

To use cancellable instead of event afterwards

undone axleBOT
dawn flower
#

im lazy to compile it rn

#

too many errors

icy beacon
#

I'm lazy to remember everything at once

echo basalt
#

the answer is no

#

getLocation returns a copy

icy beacon
#

Does it?

dawn flower
#

ok ๐Ÿ‘

lost matrix
#

In non-ancient versions it does

icy beacon
#

I swear I used to have a thing where I would not clone it and increase its Y position and then the player would be going up

echo basalt
#

even on 1.8 it does

icy beacon
#

Maybe just bad code back in the dayl ol

dawn flower
#

how do i register an enchant in 1.20.4

icy beacon
#

Ideally you don't. Use pdc to detect your enchantments

lost matrix
lost matrix
icy beacon
#

Just in time

#

Here's this ol' meme then

compact bear
#

What versions of Log4J or SLF4J are available on runtime nowadays?

devout token
#

Hello
Who can help me?
I have a problem with my bungeecord I opened my bungeeCord and it open but when I look into the server list it doesnt appear

#

and the same happen when I put the ipadress + the port of the lobby

#

I'm using ubuntu

dawn flower
#

how do i turn a ConfigurationSection into a Map

icy beacon
#

Iterate through its keys and add every value mapped to its key to your map

#

There might be a built in function for it though

#

I mean getValues() is basically what you need

covert dawn
#

Hello, if you have a plugins for stack healsoup. I take

icy beacon
#

?services

undone axleBOT
icy beacon
#

Or potentially,

#

?google

undone axleBOT
dawn flower
#

uh

#

i just made an enchants system first try

#

wtf

icy beacon
#

Nice

dawn flower
#

not a single error

#

sick

#

i got like 14 triggers rn, is there a list of possible triggers? i cant squeeze my brain harder

icy beacon
#

Just add them as you go and come up with them

dawn flower
#

should i just read player.class for possible triggers

icy beacon
#

It's not legally forbidden so why the hell not

dawn flower
#

ok

charred blaze
#

hey, so when i create a variable like
int i = getConfig().getInt("somepathhere")
then change the value of somepathhere in config and reload it
and Then i call i use int i will it be updated?

umbral ridge
#

no

rapid ore
#

hi, there's a way to get the player ping n the 1.8?

#

or maybe get CraftPlayer today?

icy beacon
#

I need opinions: nosql or mysql for storing files, and why? The file size should be under 1MB

lost matrix
#

Im a fan of nosql because i wrote a really nice ODM and the MongoDB java wrapper is cleaner than writing SQL.
But it depends on your data. If its naturally relational, then sql is also a good option. Also SQL gives you more granular controls
because its an actual turin completel language.
I really think that it comes down to preference.

icy beacon
#

Well in my case I need to store a file along with some metadata (download count, upload time, etc). This feels like it would be good fit for a table and also very fine for a mongodb document for example

#

That's why I'm in 2 minds

raw epoch
#

What's the version of the Plib package do you use ? I'm on 4.8.0 and i don't have the WrappedDataValue Class, do i need to implements PacketWrapper?

echo basalt
#

5.1.0

raw epoch
#

thx!

icy beacon
#

For some reason it's 4.8.0 on the spigot page. I started with protocollib today and was also confused when some things weren't working, turns out it wasn't latest lol

lost matrix
# icy beacon Well in my case I need to store a file along with some metadata (download count,...

I would simply write a wrapper for tracking objects:

@Getter
public class TrackedObject<T> {

  private final T object;
  private final long timestamp;
  private int uses;

  public TrackedObject(T object, long timestamp) {
    this.object = object;
    this.timestamp = timestamp;
  }

  public TrackedObject(T object) {
    this(object, System.currentTimeMillis());
  }
  
  public void incrementUses() {
    this.uses++;
  }
  
}

And then use a

MongoCollection<TrackedObject<SomeThing>>

And throw my stuff in there. My codec will handle the rest

icy beacon
#

You have a library you have written and use for mongo, right?

#

If I understood you correctly

#

Is it open source?

lost matrix
#

Hm, its not. But ive been asked for that a few times. I might create a resource for this.

icy beacon
#

Do you know a good one then? I've heard Morphia is analogous to Hibernate but for Mongo?

lost matrix
#

Yeah Morphia is the only decent one i know. You could also use Gson as a backbone.

icy beacon
#

Most certainly will, I already use it for other things in the project

#

It supports caching, right? If it does I'll start looking into it tmr

young knoll
#

Morphia kinda thicc tho

inner mulch
#

I split it up so i can load only small chunks of data into memory and dont load everything at once, especially if i wsnt to load some1 data when He is offline

icy beacon
worldly ingot
#

Aren't these the same thing just written differently? I'm confused

inner mulch
worldly ingot
#

idk. Question seems ambiguous

shadow night
#

why is Bukkit even a class

#

It's weird to me

worldly ingot
#

It will get you the output of /version, basically

inner mulch
#

?

worldly ingot
#

Bukkit is the API bridge class. Without it, you can't separate API from implemenation

worldly ingot
#

There's a Bukkit#setServer()

#

It's really the only place in the API where you can set an implementation of a Bukkit type

#

That's where CraftBukkit says "Okay, everything from here on out is implemented by CraftBukkit"

shadow night
#

Hmm

worldly ingot
#

Why? They're just convenience mirror methods

#

Calling Bukkit#getServer() is totally redundant 100% of the time

#

Every method in Server exists in Bukkit as a static method that just delegates to that same server instance

echo basalt
#

Sout > logger

worldly ingot
#

Yeah... that's fine... do that. But plugin.getServer().blah() makes no sense

worldly ingot
#

Server#getPlayer(UUID) == Bukkit#getPlayer(UUID)

#

For every method in Server, one exists in Bukkit and vice versa

shadow night
#

In forge we rely on the event bus and a few static methods lol

worldly ingot
#
public interface Server {
    public Player getPlayer(UUID uuid);
}

public final class Bukkit {

    private static Server server;

    public static Player getPlayer(UUID uuid) {
        return server.getPlayer(uuid);
    }

}
#

Every single method in Bukkit just delegates to the Server interface

#

Calls to Bukkit.getServer() are redundant

shadow night
#

Lol

tardy delta
#

looks like a standard ubuntu terminal

#

doesnt the console sender support hex colors

#

smh

young knoll
#

Blah, I forgot moving packet entities was a pain

#

Anyone happen to have a wrapper for that sitting around? :p

echo basalt
#

What kind of functionality do you need

young knoll
#

Just to properly send the relative move vs teleport packet

lilac dagger
#

did you try looking into how mojang does it?

#

pretty sure mojang treats both moving and teleport packets the same

young knoll
#

Yes and it's painful to look at :p

lilac dagger
#

ouch

echo basalt
#

I have it somewhere

young knoll
echo basalt
#

It's something like

#

If delta on any axis is above 4 use tp

young knoll
#

It's 8 but yeah

echo basalt
#

Whatever

young knoll
#

Easy enough

#

Interestingly mojang converts the values to the relative movement first

dawn flower
#

last thing, is there a way to make something like this work

%1 + 1%

or

%player-max-health + 1%

as custom placeholders

mortal hare
#

anyone willing to explain wtf is wrong with illustrator

worldly ingot
#

I don't think so because placeholders resolve to strings

young knoll
#

There is a papi addon that can do math

worldly ingot
#

Yeah but those are in-line. Does that resolve expressions from other placeholders?

young knoll
#

Not sure

dawn flower
young knoll
worldly ingot
#

Oh turns out you can

young knoll
#

If you want to make it custom use an expression parser

#

Like Crunch

dawn flower
#

alr

#

can you sort only methods that return a boolean in javadocs

worldly ingot
#

I don't think so

rotund ravine
#

?jd-s

undone axleBOT
rotund ravine
#

Sort in what way?

worldly ingot
#

Filter, probably

dawn flower
#

idk if im missing something but i can only think of 12 conditions

#

some players conditions and string conditions like contains, equals, etc and integer as well, chance of like 30% and thats all

#

is that enough?

outer tendon
#

Hey, Im looking for advice on a plugin project of mine. I worked on an idea with Google Gemini. I'm wondering what your guys' thoughts are on it and if it would be a good idea, so here it goes:

I have a Game class and I need to use the Bukkit scheduler to handle multiple countdown timers for the game, like respawn timers and what not. I asked Google Gemini for advice on this and it made a suggestion, which with a bit of improvement from me came out to be a separate CountdownTimer class that keeps a list of timers represented by another Timer class (the redundancy in the names is an accidental byproduct of how my conversation with Gemini went) that contain their remaining times. One CountdownTimer would be instantiated per Game object and would schedule a task that would run every second and decrement each of its Timer object's remaining times and upon their times hitting zero, a callback created by the corresponding Game object would be called.

young knoll
#

Time stamps all the way

#

When possible

torn shuttle
#

ah yeah nothing quite like opening an old prototype project to be reminded of how great one is at naming variables

#

can't wait to get a BuildSubSubSubMenuContainerContainer

lilac dagger
#

is this c#?

torn shuttle
#

yeah

lilac dagger
#

i see

torn shuttle
#

godot

lilac dagger
#

the naming's not that bad

torn shuttle
#

honestly I kinda like the ui I was prototyping, will probably actually use it, but the code backend is... interesting

lilac dagger
#

did you see the card game slay the spire

torn shuttle
#

I am familiar with it

lilac dagger
#

the naming is not good at all

#

it's done in java and you can see its source code

torn shuttle
#

you mean slay the spire right

lilac dagger
#

yeah

torn shuttle
#

it's a card game

#

you could make that thing in renpy

#

you could make that thing as a browser game using nothing but vanilla js

lilac dagger
#

not sure why they chose java

torn shuttle
#

probably because that's what the dev knew

lilac dagger
#

they shaded the jdk in there

torn shuttle
#

I mean it worked out, they sold over 1mil copies

lilac dagger
#

yeah, it's cool

#

but i don't think the devs wouldn't had adapted to c#

torn shuttle
#

I find that programmers obsess with completely irrelevant things at times

lilac dagger
#

instead they probably made their own engine

torn shuttle
#

it doesn't matter if you make the game in java or c# or assembly, it matters if the game is good or not

#

the programming language has nothing to do with it

lilac dagger
#

true

torn shuttle
#

if you're making something like slay the spire I'd def either make my own engine or use godot, there is not point in paying a license fee to unity or god forbid unreal engine to make something that simple

lilac dagger
#

unity made sure to make devs reconsider

torn shuttle
#

it's easy to forget that neither unity nor unreal were made for 2d games and that 2d games are often times simple enough that no engine is really required

lilac dagger
#

i agree

#

but 3d engines are awesome at one thing

#

layering

torn shuttle
#

if you want to make something in 2d honestly if you want to use an engine just use godot, it's actually the only engine that was built for 2d primarily anyway

lilac dagger
#

ori had layering to make the background go at a different speed

torn shuttle
#

you can get a paralax effect going in minutes if you're making your own engine

#

it is not hard at all

lilac dagger
#

it's a bit harder to pull the effect on a 2d engine

torn shuttle
#

hell I did it for my website and that took something like 3 minutes of copy pasting

lilac dagger
#

i guess you just have to render the background at a different speed

torn shuttle
#

it's dead easy

#

you need to define layers anyway because some sprites need to be in front of other sprites

#

and then you can just create groups and define them as ui, background, foreground or whatever, I am pretty sure that an experienced dev could get that working in under 15 minutes from scratch

lilac dagger
#

i see

torn shuttle
#

I know I've seen absolute cavemen devs getting it done in just a few hours while working on their first engine

lilac dagger
#

yeah, if i think about it there's no need for a 3d engine

#

it's interesting devs still use one for games

#

oh

#

i remember

#

i think it helped them debug easily

#

having the layers all in a single space might get tedious to debug

torn shuttle
#

historically people have used unity for 2d projects because unity is the most well-documented engine by the community due to the fact it was the first to get pro-indie dev licensing deals, is easier to learn than unreal and has an asset store built into the interface

#

before godot 4 godot wasn't really on the map

#

but nowadays the landscape has changed

#

not like godot is perfect either, I actually find it to have some serious issues if you're doing something that is actually resource-intensive like running a simulation-heavy game but it seems like the average beginner is either working on a visual novel, a platformer game or something about equally complex in 2d

lilac dagger
#

i'd love to make a 2d game myself

#

but it's such a long journey to get something good out

short meteor
#

Anyone tryna dev an smp for free ;D

torn shuttle
#

I had a cool idea for a 2d game that I think is small scope enough that I might try to actually see through

jagged bobcat
#

no

torn shuttle
#

an automation game that mixes dome keeper and motherload elements

#

I think it would be really sick

#

basically a mix of manually digging down with setting up and automated infrastructure for mining as the resources you dig up go directly towards defending an above ground base that keeps getting assailed by waves of enemies

tall dragon
#

would love to play it if you make it :d

#

love automation games

torn shuttle
#

you'd have to balance setting up defenses, setting up automation and risking going down

#

since the farther down you'd go the greater the rewards but also the greater the risks

tall dragon
#

thats actually a really cool idea.

torn shuttle
#

yeah

#

dome keeper is kinda like that but no automation and it doesn't really go as far as I'd like it to go

#

still a really fun game

spare mason
#

How can I set the yaw of a slime?

worldly ingot
#

You have to teleport() it to a Location that has a specified yaw

spare mason
#

SetBodyYaw doesnt affect slimes and SetRotation only affects the slime every 3 seconds idk why

worldly ingot
#

Unless you want it to look up or down, which would be pitch and is not supported for slimes. They can only look left/right

spare mason
#

I am using a class to set its rotation but I use other to move the slime vรญa teleports and that would conflict it

young knoll
#

Not via the api

#

Via NMS you can control each value separately

outer tendon
young knoll
#

yes

green fox
#

Hello everyone, could someone please help me with Spigot's BuildTools? pretty please? c:

eternal night
#

Well, what are you struggling with in regards to build tools?

torn shuttle
#

today I realized that I have never written down the word "debris" before

lost matrix
# outer tendon Hey, Im looking for advice on a plugin project of mine. I worked on an idea with...

Cooldowns and warmups should always be done by setting a target timestamp and periodically checking the delta between the current time and your target time.
Polling for displaying should be separate from polling for action.
Your actions should be executed by using the following setup:

  • Your action should contain the timestamp
  • The action needs to implement Comparable for itself
  • All actions are inserted into a binary searchable, ordered collection (I usually use PriorityQueue)

This results in all elements in the queue to be ordered based on how far they lay in the future.
Each tick, you simply poll as many actions from the top of your queue as you can, until the first one does not
qualify as being in the past anymore. This transitively invalidates every queued action afterwards, which means
you can save a LOT of CPU time.

green fox
#

I was just trying to edit 1 .java file in Spigot-Server (just to test something), and when I try to run mvn clean install it goes thru, but errors out at:
Spigot 1.8.8-R0.1-SNAPSHOT ......................... FAILURE

lost matrix
#

?1.8

undone axleBOT
green fox
#

the error was with pom.xml being HTTP instead of HTTPS, fixed that

#

but still tries to download something from md_5-releases which doesn't exists?

#

Hmmm. It fixed itself? whaaaat?!!?

tardy delta
#

hmm in java can we assume that bitwise operations always happen on the big endian respresentation of a primitive?

#

like in the jvm the types are stored in the hosts endianness, but that says nothing about the bitwise operations in the lang

#

like can we assume that char >> 8 will always read the high byte?

#

left to right means nothing in memory terms

#

ah i thought that was only for the .class files

eternal night
#

would be pretty dumb if the language that "runs everywhere" does not run everywhere at such a common operation

tardy delta
#

wdym modify

echo basalt
#

unsafe thumbsup

tardy delta
#

have fun with a segfault

#

bedrock is c/c++ right?

#

#define true rand() hehe

#

dunno i started thinking shifts were endianness dependant for some reason

#

well in c they are, or arent they?

echo basalt
#

#define if while

tardy delta
#

i always used endianness abstractions so ig so

#

bot for what

#

on?

#

minecraft has bots?

#

or you implemented the client join

#

not too difficult, just implement the protocol

young knoll
#

Minecraft hardcodes PI?

#

wat

tardy delta
#

wouldnt surprise me, with their own math classes

young knoll
#

I doubt they hardcore PI tho

#

It's likley just the compiler inlining

proud badge
#

When should I use compileOnly, and when implementation in build.gradle?

#

Im doing it from files btw

rotund ravine
#

Depends on the limit of said mechanics as well as "compensation" provided by bukkit to ensure backwards compatability.

#

In this case duration iirc had a max limit of int max back in the day

#

and amplier is 255 kek

young knoll
#

The NBT format still stores duration as an int

#

So

ivory sleet
#

yeah I mean i suppose if u wna have it as long just auto promote it to one

quiet ice
ivory sleet
#

yea basically there are 3 things u consider, compiletime classpath, runtime classpath and transitivity on the 2 first

tardy delta
#

it kinda scares me how much access modifiers i needed to weaken to make it possible to test internal code :|

#

so been a good dev and added @VisibleForTesting everywhere

lilac dagger
#

how does the annotation work?

#

how do you call such a method?

young knoll
#

You make it public

tardy delta
#

it doesnt

young knoll
#

The annotation is just for informing people

tardy delta
#

its for static analysis tools

#

and no i didnt make anything public, end users break everything

young knoll
#

Mojang has some @VisibleForTesting in the server

ivory sleet
#

yea

#

a ton

spare prism
#

is there a way to make a normal stacked potions movement in inventories? like if i have 64 potions and click on an inventory slot, it puts only 1 potion instead of 64 ones, also InventoryClickEvent#getCursor() returns ItemStack with amount 1

analog mantle
#

A bit late, but how can I translate the color codes?

tall dragon
#

ChatColor#translateAlternativeColorCodes

analog mantle
#

It don't work lol

tall dragon
#

show code and input string

analog mantle
#

I use hex

tall dragon
#

&#?

#

pretty sure thats not how hex format works in spigot

analog mantle
#

Works when I broadcast the string

tall dragon
#

huh

#

well i dont rlly know about hex in spigot

young knoll
#

Spigot hex is

#

&x&r&r&g&g&b&b

tardy delta
#

you speaking like yoda

analog mantle
#

that is going to be way too much work to refactor all my code to do that

young knoll
#

Tis why you should make a custom parser for that format

#

Or use ChatColor

tardy delta
#

there are probably more efficient solutions, i dont know much about patterns

echo basalt
#

yeah that's how it is usually done

analog mantle
#

that is not encrypted buster

fallen patrol
#

Hey I am looking into creating custom nametags for players on my server. However even after some googling i'm completely lost. Anyone maybe got some information where to look? ๐Ÿ˜„

#

Also not looking for any third party API to use, just wanna use my own plugin, maybe some reference is also good

young knoll
#

What version

lost matrix
slender elbow
#

singletons

#

you can have free functions

#

besides, kotlin's philosophy is that a class should have the BARE MINIMUM to support using it wholly, everything else should be extension methods

#

very pepega and horrible for discoverability

young knoll
#

I only use the most expensive functions

slender elbow
slender elbow
#

and then you ask yourself "why didn't they just add the function as an instance method?"

#

that's why

full marten
#

Hello, I took the code from the link below from my project wich was in version 1.12.2 and updated it to 1.16.5. Now that the getID() method is now deprecated, I wanted to ask what the alternative would be, thanks

https://hastebin.com/share/apohafufer.java

lost matrix
#
  public static int sum(int x, int y) {
    int result;
    do {
      result = ThreadLocalRandom.current().nextInt();
    } while (result != x + y);
    return result;
  }
charred blaze
#

how do i avoid naming my command? i just want to use its executor in main command

lost matrix
charred blaze
#

this is bungee api

lost matrix
charred blaze
#

i want to use it's executor for subcommand

#

like use it for /antivpn reload

lost matrix
#

Bungee commands dont have an executor...

charred blaze
#

what

lost matrix
#

How about you just implement your own interface for this:

public interface SubCommand {
  void execute(CommandSender sender, String[] args);
}
lost matrix
# charred blaze what

Bungeecord commands dont have an executor. They simply implement an abstract execute method.

lost matrix
charred blaze
#

and to run it just reloadCommand.execute(somethingshere)?

lost matrix
charred blaze
#

yea yea i know i know

#

im just gonna store every subcommand in map in onenable

#

and use it from there

lost matrix
#

I would probably use a Map<String, SubCommand>.
and add a getName() method to SubCommand.class.

#

Which looks like a normal Command to be honest

charred blaze
lost matrix
# charred blaze the purpose was to remove command name

Ok but if your subcommands have names, then you might as well use them.
/antipvp reload
Name of main command: "antipvp"
Name of subcommand: "reload"

In your AntiPvPCommand class you can have a Map<String, Command>
simply add your commands in there by using their name as a key.

charred blaze
#

yea i already know how to do it

#

i already had this thing set up on spigot

#

just wanted to rewrite it on bungee api

lost matrix
#

Ok, so there is no point in creating your own interface and your subcommands will simply extend Command.
Are we on the same page here?

charred blaze
#

lets make sure i understand everything correctly

#

when i do super("name")

#

i create command /name right?

lost matrix
#

No, you just create an instance of your class which extends Command.
It does nothing unless you explicitly register it. Without registering the instance, nothing will happen.

charred blaze
#

aaaa

lost matrix
#

There we go ๐Ÿ™‚

charred blaze
#

oh so it actually has no point creating own subcommand

lost matrix
#

Yeah, you can just use bungees Command class and put your subcommands in a map if you want.

charred blaze
#

ok thanks

#

<3

buoyant jasper
#

Hello i am having trouble connecting plugin to mysql database it shows an error in my server console

chrome beacon
#

What's the error?

#

?paste

undone axleBOT
buoyant jasper
#

i dont know its just prints what on cache

#

and says unable to connect to database

inner mulch
rapid ore
#

hi, there's a way to get the player ping n the 1.8?
or maybe get CraftPlayer today?

outer tendon
# young knoll yes

Ah okay, thank you. Your and 7smile7's responses are the first times Ive been told to use such a method. Granted, I haven't encountered this type of problem before. Thank you for helping me learn more. :D.

buoyant jasper
#

i pasted the error

inner mulch
young knoll
#

You gotta save it and send the link

#

It doesnโ€™t magically get sent to us

buoyant jasper
#

do i have to save it

young knoll
#

Yes

#

That generates the unique link

buoyant jasper
#

what do i have to paste

young knoll
#

The error

buoyant jasper
#

from the console?

young knoll
#

Preferably the entire stacktrace

buoyant jasper
#

what is stacktracce

young knoll
#

?stacktrace

undone axleBOT
young knoll
#

Well that doesnโ€™t help

buoyant jasper
#

what is it

young knoll
#

A stack trace shows a list of method calls that lead to the exception being thrown, together with the filenames and line numbers where the calls happened.

remote swallow
valid burrow
vernal basalt
#

can you add custom NBT to a player?

buoyant jasper
#

can i send the plugin code

#

and what the server console is

valid burrow
#

?pdc

valid burrow
#

?paste

undone axleBOT
buoyant jasper
#

ok i did

#

how can i send the console error massage

vernal basalt
#

im using NBTeditor but it sets my player positon to the void????

#

NBTEditor.set(player, getPlayerThirstLevel(player), "thirstLevel");

#

the number im attempting to save ins't even 0

#

or int as bytes could be a negitive float

young knoll
#

Would be nice to see the NBT data

#

Sadly I donโ€™t think 1.12 had good /data commands soโ€ฆ

#

I guess youโ€™d have to extract it from the files

rough ibex
#

1.12.2 has uh /entitydata

#

for entities obviously

#

and /blockdata

#

but it's really poor (no path querying)

young knoll
#

Sometimes I take the tools we have for granted now

#

You can even debug packet entities with the power of shift F3 i

raw crow
#

does someone know how can i get the block where a sign is placed?

young knoll
#

Where

#

Are you in an event? Working with the Sign block state?

raw crow
#

yeah

#

I have the Sign object

young knoll
#

Block states have a getBlock() / getLocation()

raw crow
#

ok, but that will return the location of the sign itself

#

i want the location of the block where the sign is placed

young knoll
#

?

#

The sign is placed in the block itโ€™s in

#

Do you mean what itโ€™s attached to?

raw crow
#

yes

#

I think I found out

#
private Block blockAttached(Sign sign) {
        var block = sign.getBlock();
        if(sign.getBlockData() instanceof WallSign wallSign) {
            return block.getRelative(wallSign.getFacing().getOppositeFace());
        }
        return block.getRelative(BlockFace.DOWN);
}
young knoll
#

Yeah

analog mantle
vernal basalt
#

not with commands

rough ibex
#

can you answer the original question

#

and not just re-ask the same thing twice

dawn valley
#

anyone can help me with this

#

no idea why its not working

#

its latest version thoe

sullen marlin
#

?whereami

rough ibex
ornate patio
#

I am developing something that can be kinda compared to kits, is it possible to have a premade player inventory filled with items in certain slots, and then with one function call update a player's inventory with the premade one?

#

or do i just manually go about setting the items

rough ibex
#

A simple way you could do this would have a map of slot number to ItemStack, and then a function that iterates over the map and sets each slot for a player.

ornate patio
#

yeah thats what i was thinking too

#

was just wondering if spigot has some method to do this already before i started working on implementing that

rough ibex
#

the implementation details are up to you

#

You can use this

#

this explicitly removes all items first

#

instead of replacing only the items you defined

ornate patio
#

hmm but i dont get control over inventory slot numbers and such with this

rough ibex
#

It's a bit more verbose.

ornate patio
#

i can just implement some helper class from scratch then

rough ibex
#

Sure.

sullen marlin
rough ibex
#

You would have to specify Air for all of the others, right?

ornate patio
#

i mean like

#

i need to specify what items should go in off hand

#

what items should be armor

#

and like some items should be at the right side of the hotbar and some on the left, with a gap in the middle

#

also

#

how do i check if a material is a piece of armor

#

without me typing a giant list of all possible armor types

rough ibex
ornate patio
#
// If the item is a piece of armor, put it in the appropriate slot
else if (item.getType().name().endsWith("_HELMET")) {
    inventory.setHelmet(item);
}
else if (item.getType().name().endsWith("_CHESTPLATE")) {
    inventory.setChestplate(item);
}
else if (item.getType().name().endsWith("_LEGGINGS")) {
    inventory.setLeggings(item);
}
else if (item.getType().name().endsWith("_BOOTS")) {
    inventory.setBoots(item);
}

this is what i have right now but it feels wrong

rough ibex
#

Im not clear on specifics

ornate patio
#

oh i check if the itemstack meta is an instance of this?

rough ibex
#

maybe?

#

I'm not that smart at this

ornate patio
#

but that still wont let me differentiate the different types of armor

rough ibex
#

technically any item can be a helmet

#

but I think your approach is OK

#

all the helmets do end with _HELMET

#

or you could refer to the enum members themself

ornate patio
#

yeah but i feel like theres just a lot of overhead with getting the enum name as a string and then comparing the end of the string name

#

could create a giant enum list but thatd just be annoying

#

it's prob barely a performance difference anyways im just a bit of a perfectionist lmao

rough ibex
#

up to you.

tender shard
#

the usual way is to create a Set on load like this (or similar), unless you could use tags or sth (idk if there exists tags for helmets etc)

Set<Material> helmets = Arrays.stream(Material.values()).filter(mat -> mat.name().endsWith("_HELMET")).collect(Collectors.toSet());
blazing ocean
#

is there a way to (de)serialize a PlayerInventory to JSON without manually implementing each field?

#

idk if kotlinx.serialization provides a way to do that with already implemented objects

#

or I fork it

fallen lily
#

Youโ€™ll be better off just writing a small serde module for it

#

2 methods

#

read and write

blazing ocean
#

yeah probably

#

cue the 600 lines of serialization

fallen lily
#

Realistically all youre doing is encoding item stacks no?

blazing ocean
#

yeah

fallen lily
#

then just encode as a stream of b64

blazing ocean
#

well i need to save it to a string for my db

fallen lily
#

Yes so use b64 strings

#

This uses serialization capabilities

#

Instead of manual

blazing ocean
#

alr ty

#

can i construct an instance of PlayerInventory?

#

its an interface

tardy delta
fallen lily
#

Youโ€™ll have to inherit its methods in a subclass

blazing ocean
#

oh dear

tardy delta
#
class Something {
  
  companion object {
    fun something() = Unit
  }
}

Something.something()
fallen lily
#

very poor example

blazing ocean
#

i think id be better off creating a data class which can be serialised which just contains the armour, items and offhand stuff

#

like this

@Serializable
data class SerializedInventory(val hat: String, ...) {
fun deserialize(): DeserializedInventory {...}
}

data class DeserializedInventory(val hat: ItemStack, ...) {
fun serialize(): SerializedInventory {
...
}
}
#

sry im on my phone lmao

fallen lily
#

oh boy

#

you are

#

Thinking in OOP

#

And that isnโ€™t necessarily good

blazing ocean
#

lmao

#

i would probably manually set the players inv contents

#

because i cant be bothered to impl PlayerInventory

charred blaze
#

ConfigurationProvider.getProvider(YamlConfiguration.class).save(whitelistConfig, data);
this two do exact same thing right?
whitelistConfig = ConfigurationProvider.getProvider(YamlConfiguration.class).load(data);

tender shard
#

no? save and load usually do NOT do the same thing lol

charred blaze
#

why are there no docs

tender shard
#

lets see

#

?jd

undone axleBOT
tender shard
#

hm where's bungeecord-config

charred blaze
#

yea but why isnt it in intellij

tender shard
#

anyway, save saves the given config to the given file, and load obv loads a file

charred blaze
#

oh im using 1.19

#

ill update it sec

#

i named them wrong then

#

i guess

charred blaze
tender shard
#

as I said, there are no javadocs for bungeecord-config

charred blaze
#

a

#

why

tender shard
#

because nobody has written any

#

the method names are pretty self explanatory though

dawn flower
#

best way to make placeholder system with mathmatical operations?

tender shard
dawn flower
#

alr, also is it possible to cast PlayerEvent to BlockBreakEvent

dawn flower
#

oof

charred blaze
dawn flower
#

you can save the proxy ip into a set so if the player tries to reconnect it doesnt send another request, it just checks if that ip is in the set

runic oak
#

Hello guys! I'm trying make a "custom item" in spigot-plugin using resource-pack, so I add localize file (en_us.json) in my resource-pack, but can't set localized name in my item. Anybody know how to do that?
under localized name I imitate '{"translate": "item.minecraft.stick"}' (minecraft-json-string format for display.Name)

#

Iโ€™ve been trying to find a solution for half an hour... ๐Ÿซ 

#

Maybe already hour

fervent badger
lilac dagger
#

move fields into classes that encapsulates them and provide methods needed for that

lilac dagger
#

boolean whitelisted = false; for (String whitelistedIp : AntiVPN.whitelistedIPs) { if (!ip.contains(whitelistedIp)) { continue; } whitelisted = true; break; }

#

can become

#

public boolean isWhiteListed(String ip) { for (String whitelistedIp : AntiVPN.whitelistedIPs) { if (id.contains(whitelistedIp)) { return true; } } return false; }

charred blaze
#

a

hollow vessel
#
:main: Could not find net.md-5:bungeecord-chat:1.8-SNAPSHOT.
Searched in the following locations:
  - https://repo.maven.apache.org/maven2/net/md-5/bungeecord-chat/1.8-SNAPSHOT/maven-metadata.xml
  - https://repo.maven.apache.org/maven2/net/md-5/bungeecord-chat/1.8-SNAPSHOT/bungeecord-chat-1.8-SNAPSHOT.pom
  - https://plugins.gradle.org/m2/net/md-5/bungeecord-chat/1.8-SNAPSHOT/maven-metadata.xml
  - https://plugins.gradle.org/m2/net/md-5/bungeecord-chat/1.8-SNAPSHOT/bungeecord-chat-1.8-SNAPSHOT.pom
  - https://repo.panda-lang.org/releases/net/md-5/bungeecord-chat/1.8-SNAPSHOT/maven-metadata.xml
  - https://repo.panda-lang.org/releases/net/md-5/bungeecord-chat/1.8-SNAPSHOT/bungeecord-chat-1.8-SNAPSHOT.pom
  - https://repo.extendedclip.com/content/repositories/placeholderapi/net/md-5/bungeecord-chat/1.8-SNAPSHOT/maven-metadata.xml
  - https://repo.extendedclip.com/content/repositories/placeholderapi/net/md-5/bungeecord-chat/1.8-SNAPSHOT/bungeecord-chat-1.8-SNAPSHOT.pom
  - https://hub.spigotmc.org/nexus/content/repositories/snapshots/net/md-5/bungeecord-chat/1.8-SNAPSHOT/maven-metadata.xml
  - https://hub.spigotmc.org/nexus/content/repositories/snapshots/net/md-5/bungeecord-chat/1.8-SNAPSHOT/bungeecord-chat-1.8-SNAPSHOT.pom
Required by:
    project : > org.spigotmc:spigot-api:1.8.8-R0.1-SNAPSHOT:20160221.082514-43

Possible solution:
 - Declare repository providing the artifact, see the documentation at https://docs.gradle.org/current/userguide/declaring_repositories.html

HI, does anybody know whats is going here?

my imports:

maven { url = uri("https://hub.spigotmc.org/nexus/content/repositories/snapshots/") }
compileOnly("org.spigotmc:spigot-api:1.8.8-R0.1-SNAPSHOT")
lilac dagger
#

just plastering him with chatgpr won't help him actually learning what he needs to do

#

plus it still has the problem of plastering everything in the listener

charred blaze
fervent badger
#

xD

lilac dagger
#

sorry, is that not a english word?

#

i mean making listener have too many functions than its intended purpose

charred blaze
charred blaze
#

english is my second lang

#

wait a sec ill google what that means xd

lilac dagger
#

mine too

fervent badger
tall dragon
#

is it an egnlish word

#

probably just not the right one

young knoll
#

It fits

fervent badger
#

nah

summer talon
charred blaze
#

ok ill get back with added methods

summer talon
#

i need help ee

hollow vessel
#

but thanks ๐Ÿ˜„

charred blaze
fervent badger
#

.Blacklisted

charred blaze
fervent badger
#

lowercase

charred blaze
#

a

#

my bad

fervent badger
#

here too

#

And use an api for proxycheck

#

And exclude all that stuff from your listener as those guys told you

charred blaze
fervent badger
#

and please

#

cache it

charred blaze
fervent badger
#

my bad didnt saw it

charred blaze
#

dw

charred blaze
young knoll
#

You need to set the items custom name to a translation component

fervent badger
young knoll
#

Problem is we donโ€™t have an api for that yet

charred blaze
#

is it more optimized or something?

fervent badger
#

i thought you would like to improve your code

#

this is spaghetti code

charred blaze
runic oak
charred blaze
#

is gson more optimized?

fervent badger
lilac dagger
charred blaze
#

yea

lilac dagger
#

parsing of json does require more resources

charred blaze
#

well this plugin may get high load on bot attacks

lilac dagger
#

you'd also want to cache the https calls

charred blaze
#

yea but then it would be on same url?

lilac dagger
#

ah wait, you do' cachedVPNIps.put(ip, true);'

charred blaze
#

yea

#

oh actually

#

why do i use map for that

lilac dagger
#

you can even save them to a file

#

and load them on plugin load

charred blaze
#

hm?

#

maybe

lilac dagger
#

this way if an attack takes place from the same vpn after restart your server won't be impacted

charred blaze
#

hmm thats actually a good idea

young knoll
#

Youโ€™d probably want to have it expire eventually though

charred blaze
#

and probably wont cause any issues

fervent badger
#

Bro wtf XD

charred blaze
#

proxycheck io ever updates their data?

fervent badger
#

yea

young knoll
#

Idk

#

I assume so

fervent badger
#

Every 24 hours

charred blaze
#

yea but if ip is detected as vpn

fervent badger
#

many of those ips got rechecked

charred blaze
#

do they remove it as vpn anytime?

charred blaze
lilac dagger
#

if (cachedVPNIps.containsKey(ip)) {
player.disconnect(ChatUtils.color(plugin.blockMessage));
return;
}could happen above the async and you can use the deny function from the event

charred blaze
#

who restarts proxy server in less than 24 hours

fervent badger
#

XD

charred blaze
young knoll
lilac dagger
#

you run this here

charred blaze
#

yea?

fallen lily
lilac dagger
#

you can write that method above the runasync

fallen lily
#

you can run it outside

lilac dagger
#

i don't think the disconnect function is async safe

fallen lily
#

Should be

charred blaze
#

runasync

fallen lily
#

It doesnt disconnect immediately i dont think

lilac dagger
#

plugin.getProxy().getScheduler().runAsync(plugin, () -> {

fallen lily
#

It polls at the network manager rate

#

In its own thread

#

At least on clientside

#

Should be same server side

charred blaze
charred blaze
#

but what can it damage?

fallen lily
charred blaze
lilac dagger
#

rather use the event way of disconnection

#

or rather denying

icy beacon
#

?workdistro for me

dawn flower
#

what's the difference between getEffectPermissions and getPermissions

#

oh getPermissions doesnt exist

#

whoops

#

i mistakened it for hasPermission, anyways how do i pull the permissions from getEffectPermissions

#

PermissionAttachmentInfo has alot of values
'permissible, permission, attachment, value'

lilac dagger
#

read spigot api about this

#

i'm sure it guides you a little on what each is for

#

if not you can look into how hasPermission works

dawn flower
#

player is an interface and im not sure what implements player

#

so i cant see how it works

lilac dagger
#

CraftPlayer

#

assuming you have buildtools you can find it there

dawn flower
#

oh

#

thats pretty helpful..

#

why didnt i know that

lilac dagger
#

btw it's not in craftplayer

young knoll
#

Itโ€™s also on stash

lilac dagger
#

must be somewhere else implemented

young knoll
#

Probably CraftEntity

dawn flower
#

hasPermission is in Permissible.class and player extends Permissible

#

what implements Permissible

clever lantern
#

how can i place barrier blocks to prevent someone from entering some area?

lilac dagger
#

look in craft entity, it must extend it

dawn flower
#

it doesnt extend permissible, i checked

#

it's in craft entity

tender shard
lilac dagger
#

@dawn flower

#

it's here

dawn flower
dawn flower
lilac dagger
#

just find PermissibleBase

umbral ridge
#

well well well

#

I didn't know void was considered a Block

#

if you fall in the void and it damages you, EntityDamageByBlockEvent is fired XDD

#

apparently void is a Block

lilac dagger
#

oh yeah, newer versions have void blocks and air blocks

dawn flower
#

can u get the item's disable name even if it's not named? so Oak Log wouldn't return empty string, it would return Oak Log and if it's named lets say test it'd return test

lilac dagger
#

not without a library

dawn flower
#

oof

icy beacon
agile hollow
#

how can i get on place of a spawner the mob within it?

umbral ridge
#

i know if it's void damage event.getDamager() is null but

#

i guess entity isnt a type

lilac dagger
#

i never played with it, i assume they have something in place

umbral ridge
#

but like what??

lilac dagger
#

look in the blockevent, i'm sure it returns something

umbral ridge
#

it's DamageCause, got it!

lilac dagger
#

or damagecause

wet breach
#

believe that is for void space

#

like if you fall into the void

umbral ridge
#

yes

wet breach
#

well that isn't void block damage o.O

umbral ridge
#

I placed a few void blocks on the ground too but they don't damage you

umbral ridge
wet breach
umbral ridge
#

but if i place void blocks on the ground, nothing happens

lilac dagger
#

it's a combination of y and block @umbral ridge

umbral ridge
#

So void blocks are useless?

#

you can't place them anywhere

#

with effect

lilac dagger
#

i don't know what they're a thing, sounds like extra resources

cursive loom
#

Hello do you know how I can remove a drop from a BreakBlockEvent ?

I have try this but didn't work


                for(ItemStack itemStack : event.getBlock().getDrops()){
                    if(itemStack.getType() == Material.BARREL){
                        event.getBlock().getDrops().remove(itemStack);
                    }
                }
                //event.getBlock().getDrops().remove(new ItemStack(Material.BARREL));
lilac dagger
#

i'm sure there's a reason in the code

cursive loom
#

I can't do this in a breakblocksevent ?

lilac dagger
#

no, i tried too

cursive loom
#

fck, thx !

lilac dagger
#

no problem

umbral ridge
#

โ˜• ๐Ÿšฌ

#

best breakfast

umbral ridge
#

๐Ÿ˜‚

#

thats a very romantic breakfast

umbral ridge
#

there is only 1 ๐Ÿšฌ

wet breach
umbral ridge
#

I prefer my own ๐Ÿšฌ thanks

#

XD

quaint mantle
umbral ridge
#

HI

wet breach
#

a random seems to have responded favorably to that

quaint mantle
wet breach
#

maybe you can get them to make you that romantic breakfast

umbral ridge
#

xDD

#

no nooo

#

frostalf maybe someone could make that romantic breakfast for you

#

maybe kalex is too shy to ask you

#

but instead they just said hi to me

wet breach
#

They indeed could and sometimes do, but we are not discussing me at the moment, we need to find someone to make that for you

#

but I didn't think it mattered too greatly from who

#

I mean, a romantic breakfast is romantic regardless

umbral ridge
#

I could make a plugin that in the morning when i join the server it says good morning here's your romantic breakfast and it gives 1 egg 1 bread and some milk ๐Ÿ‘Œ

wet breach
#

be a bit rude if you didn't know who they were before starting some kind of relationship

#

it would be almost like one sided but with a physical being still there

umbral ridge
#

intellij ide is my only wife now

#

im very happy with her

#

she has tab completions.. updates from time to time

wet breach
#

All this speaks volumes of your loneliness, we have to get the other spigoteers to help in this matter

#

we can't allow you to be like this

umbral ridge
#

XD

#

no I actually dont have time for this.. too busy always

wet breach
#

its terrible, so we shall first start with secretly signing you up to dating services

umbral ridge
#

GOD NO

wet breach
#

but this is the only way to realize that person in your neighborhood is for you though

#

this is what movies and shows dictate that must be true

#

at the end, its always a romantic ending

#

so the steps are clear

umbral ridge
#

it's always a very happy end

unborn hull
umbral ridge
#

ride of to the sunrise

umbral ridge
wet breach
#

because a sunrise is quite blinding in comparison to a sunset

pastel spade
#

I was wondering if there is a better way I could check if a message is not "empty"?
My current way is if (!e.getMessage().getFormattedMessage().trim().equals(" "))

#
package me.blueyescat.skriptlogs.util;

import org.apache.logging.log4j.LogManager;
import org.apache.logging.log4j.core.LogEvent;
import org.apache.logging.log4j.core.Logger;
import org.apache.logging.log4j.core.appender.AbstractAppender;
import org.bukkit.Bukkit;
import org.bukkit.scheduler.BukkitRunnable;

import me.blueyescat.skriptlogs.SkriptLogs;

/**
 * @author Blueyescat, Equipable
 */
public class LogAppender extends AbstractAppender {

    public LogAppender() {
        super("skript-logs", null, null, false);
        Logger rootLogger = (Logger) LogManager.getRootLogger();
        rootLogger.addAppender(this);
    }

    @Override
    public void append(LogEvent e) {
        if (!SkriptLogs.getInstance().isEnabled())
            return;
        LogEvt logEvent = new LogEvt(e.toImmutable(), e.getMessage());
        var immutableEvent = e.toImmutable();
        new BukkitRunnable() {
            public void run() {
                if (!e.getMessage().getFormattedMessage().trim().equals(" ")) {
                    SkriptLogs.getInstance().lastMessage = immutableEvent.getMessage().getFormattedMessage().replaceAll("\\u001B\\[[;\\d]*m", "");
                    Bukkit.getServer().getPluginManager().callEvent(logEvent);
                }    
            }
        }.runTask(SkriptLogs.getInstance());
    }

}
umbral ridge
#

Chat has been cleared

dawn flower
#

how does a message be "empty"

pastel spade
#

whitespace

trim lintel
#

Any advice how can i easly remove ocean biomes?

wet breach
pastel spade
#

^ thatโ€™s why Iโ€™m trying to figure out how to check if it isnโ€™t โ€œemptyโ€

umbral ridge
#

negate the isEmpty

#

if (!.....isEmpty())

wet breach
#

note I said no printable characters, which is key here because you can have spaces, tabs, new lines, carriage return characters in the string, however these are classed as non-printable characters, and thus if this is all the string has, it is still empty

pastel spade
wet breach
#

it should

pastel spade
#

Still makes another plugin throw an error (which Iโ€™m trying to fix)

wet breach
#

Well you did not specify that as part of the conditions

#

if there is additional conditions you need to be upfront with that otherwise we can not provide the help you need

pastel spade
#

Ahh sorry

pastel spade
wet breach
#

do you have the source for this other plugin?

pastel spade
wet breach
#

as a developer, you can code your plugin to throw errors, even if the conditions for the error were not met in the typical fashion. In other words you can impose additional rules in when an error is thrown

pastel spade
wet breach
#

so, according to your code the log event comes fromlog4j

#

not sure how this relates to the other plugin

pastel spade
#

It spams console with this error:

#

Oh I canโ€™t upload files

wet breach
#

I think what you want is to instead register a log handler? Because if you append a logger, it would come after not before hence the whole append and all. If I am not mistaken in how it works

#

but, I am not about to look through that other plugins source with all them files to find what exactly its doing, I asked about the source because then that means you can check to see what it is doing

#

because of what I said above to verify that there isn't like some check its doing to determine that it is really empty or if its just considering it empty

tender shard
acoustic pendant
#

How can i delete the enchantments section if there is no enchantment? setting them to null how i am doing doesn't seems to work (saving file after)

lilac dagger
#

the first line should work

acoustic pendant
lilac dagger
#

then maybe the path is wrong?

acoustic pendant
#

It sends this error

lilac dagger
#

i remember it working?

#

there's no way it doesn't

acoustic pendant
#

I mean, there's the error

lilac dagger
#

maybe create a new path

#

and leave it empty

#

configuration section

acoustic pendant
#

the config is like this

lilac dagger
#

i think i get it

#

just create a new configuration section

acoustic pendant
#

oh wait

lilac dagger
#

and set it to the configuration section

#

it should work this way

acoustic pendant
#

should this work?

lilac dagger
#

getConfig createConfigurationSection

acoustic pendant
#

but why would i do that?

ocean hollow
#

is that good idea to use get namespaces as enum?

lilac dagger
#

and use that to set instead of null

#

because null isn't allowed

acoustic pendant
#

oh

#

wait

#

you mean