#help-development

1 messages ยท Page 1831 of 1

waxen plinth
#

Mine is just for developers

#

Because trying to make all actions configurable is never fun

tender shard
#

lmao

#

wither

#

what a funny word

#

say it 10 times in a row

#

wither wither wither ...

young knoll
#

I figured a free plugin that actually lets you make your own enchantments would be appreciated

sterile token
#

Is there an official java CapesAPI ???

tender shard
#

the problem is that own enchantments are basically not really flexible when only defined through yaml

#

like... how would you express telekinesis in a yaml?

#

or soulbound

#

or... get health for petting dogs

young knoll
#

Haven't added those yet, but they will be supported

tender shard
young knoll
sterile token
tender shard
#

you can't

waxen plinth
sterile token
#

Lol really?

tender shard
#

the capes are rendered client side

young knoll
#

Lol

tender shard
#

either players need a client mod to see the capes you assign to other players, or forget about this idea

young knoll
#

The benefit over skript is that it's not interpreted

sterile token
#

its the same thing

tender shard
#

wtf is lunar emojis

lavish hemlock
#

what's even the point of UtilityClass?

#

iirc all it does is add a private ctor

#

which throws an exception

tender shard
#

it doesn't make sense for that class

#

I just add it to all utilityclasses

sterile token
tender shard
#

what does it do?

young knoll
#

Only other players with Lunar can see those

sterile token
lavish hemlock
young knoll
#

Except maybe some emojis, since vanilla does support a few emojis

tender shard
young knoll
tender shard
#

it makes the class static, it creates a private constructor throwing an exception, it makes all members static

#

erm I mean

#

it makes the class final

sterile token
lavish hemlock
#

it makes it static when it's an inner class

young knoll
#

Sure, if you have a client

tender shard
lavish hemlock
young knoll
#

I don't know why people keep doing capes

#

It's against the EULA

lavish hemlock
#

cuz capes are COOL and QUIRKY

sterile token
#

๐Ÿ˜…

tender shard
young knoll
#

It's a transformer

tender shard
young knoll
#

Well yes and no

#

Big servers wouldn't get away with it

tender shard
#

of course they might however make other players not being able to join your server anymore

buoyant viper
tender shard
#

I once worked for a fairly large server that violated the EULA and they basically got "banned" by mojang, no players could connect anymore lol

young knoll
#

Yeah but even that can be bypassed

tender shard
#

they changed some stuff, messaged mojang and were free to go afterwards

buoyant viper
lavish hemlock
# lavish hemlock I deem this kinda shit as a transforming utility

For Lombok to do the shit it does and be worth it, it needs to actually do useful shit.
So far:

  • I can just add final myself, it's a single keyword, and it doesn't take enough time out of my day.
  • I have a live template called util set up for that constructor and it would take less time to use it.
  • How often do you add new methods to your util class for an annotation that turns everything static to be worth using? Most of the time you'll add maybe 2-4 an hour?
tender shard
buoyant viper
#

it was getting bypassed using SRV records apparently but mojang patched? that too

lavish hemlock
#

What Lombok should be doing is making their extension methods system actually worth using :p

thick gust
#

goddamn ClassNotFoundException i hate it

buoyant viper
#

what lombok should be doing is making lombok worth using at all

young knoll
#

What java should be doing is adding useful shortcuts to reduce boiler plate

lavish hemlock
#

But then again I only use it like 3 times in one project

tender shard
lavish hemlock
#

Anddd I also use Kotlin over Lombok

buoyant viper
young knoll
#
public class Genre
{
    public string Name { get; set; }
}
``` Java plz
tender shard
buoyant viper
#

im fine with not using it 2

lavish hemlock
#

Okay, nobody forces me to use Lombok, but that doesn't mean Lombok is actually useful for the people who do use it. How much out of Lombok do you use besides like, 3-4 annotations? It has like 8+.

#

And when the alternative is not hard to setup, what is the point?

buoyant viper
#

worked on a project that used lombok only actual part i disliked was installing an extension to enable lombok processing

lavish hemlock
tender shard
#

I'm using NonNull, Getter, Setter, ToString, EqualsAndHashCode, NoArgsConstructor, RequiredArgsConsturctor, AllArgsConstructor, Data, Builder, SneakyThrows, Value and UtilityClass

lavish hemlock
#

SneakyThrows is terrible

tender shard
#

it's the same as throwing RuntimeExceptions

buoyant viper
#

it also would be one&done if i didnt uninstall it once i was done working on that project xd

young knoll
#

Bomlok

buoyant viper
#

mookbl

tender shard
lavish hemlock
thick gust
#

Still couldn't find out the new Sound Enum Value for SUCCESSFUL_HIT. It's not something with villager somehow

tender shard
#

what else would you do when you run out of memory? add OutOfMemoryError to EVERY single method you write?

#

sometimes it's just not very smart to add every single exception/error/throwable that could occur to the method sig

young knoll
#

I thought this was for checked exceptions

tender shard
#

yes it is

lavish hemlock
#
  1. OutOfMemoryError is not a RuntimeException
  2. It's not smart to throw or catch it
  3. It's almost never thrown by a method explicitly but instead the JVM itself
young knoll
#

OOM is not a checked exception

lavish hemlock
#

and sometimes you shouldn't avoid IOExceptions bc you're too lazy to catch them

tender shard
#

but sometimes you can be sure that a checked exception is never thrown if you do everything properly

tender shard
lavish hemlock
young knoll
#

I did not know there was a third category

lavish hemlock
#

yeah it's for unchecked exceptions typically thrown by the JVM that shouldn't be caught

#

AKA unrecoverable exceptions

tender shard
#

e.g. check this

#
/**
     * Reads a file from the resources directory and returns it as List of Strings
     *
     * @param plugin   Plugin
     * @param fileName File name
     * @return A list of Strings of the file's contents
     */
    @SneakyThrows
    public static List<String> readFileFromResources(final Plugin plugin, final String fileName) {
        final InputStream input = plugin.getResource(fileName);
        if (input == null) {
            throw new FileNotFoundException();
        }
        final BufferedReader bufferedReader = new BufferedReader(new InputStreamReader(input));
        final List<String> lines = new ArrayList<>();
        String line;
        try {
            while ((line = bufferedReader.readLine()) != null) {
                lines.add(line);
            }
            bufferedReader.close();
        } catch (final IOException exception) {
            exception.printStackTrace();
        }
        return lines;
    }
#

from my lib

#

would any developer ever try to read a file from their jar that does not exist?

#

yeah maybe sometimes by accident

#

but it doesn't make any sense to surround all the usages of that with try catch

young knoll
#

Then just use try catch inside the lib

tender shard
young knoll
#

Optional

lavish hemlock
#

that's a fucking List

lavish hemlock
#

return Collections.emptyList()

young knoll
torn badge
#

OOM is not an exception, it's an error. Catching it is nonsense.

lavish hemlock
#

or: use Optional

tender shard
#

people WANT an exception if they do bad stuff

paper viper
#

user needs to catch error and handle properly

#

not library

#

unless its a library issue, of course

#

but if the file name doesnt exist

lavish hemlock
#

because collection types should almost never be null as it causes problems

tender shard
#

I do not see any reason to NOT pass on the FileNotFoundException in that case and I also see no reason to have to surround it with try/catch

lavish hemlock
#

iterating over a null collection causes an NPE

mighty sparrow
#

is it possible to do bukkit plugins in c#? ๐Ÿ†’

#

joke

lavish hemlock
#

iterating over an empty collection does nothing

tender shard
tender shard
#

but it should cause problems in this case

lavish hemlock
#

yeah but if you expect something to happen, then it's still a glitch

torn badge
tender shard
lavish hemlock
#

it's a difference between everything breaking, and just the iteration returning no results

tender shard
#

if it would be nonsense to catch errors, it would not be possible to do so

lavish hemlock
#

it's possible bc it's not semantically validated by the compiler for whatever reason

#

An Error is a subclass of Throwable that indicates serious problems that a reasonable application should not try to catch.

#

literally first line of docs

torn badge
tender shard
lavish hemlock
young knoll
#

Just call system.GC in the catch block

#

Kappa

lavish hemlock
#

ez

tender shard
#

anyway we are not talking about catching Errors here, but about whether or not FileNotFoundExc should be try/catched or simply passed on as SneakyThrows

torn badge
paper viper
#

if i were u, id just do throws IOException

#

ยฏ_(ใƒ„)_/ยฏ

lavish hemlock
#

yeah

#

IO operations in libraries should declare a throws anyway

tender shard
torn badge
lavish hemlock
#

since lib consumers may want to handle it differently

paper viper
#

you have to use throws

#

its not your own plugin

#

you want the user to handle the error

#

not the lib

#

bruhh

lavish hemlock
#

and btw

tender shard
lavish hemlock
#

runtime exceptions are kind of terrible anyway

#

for stuff like invalid numbers during number parsing

#

you'd have to check the docs to see what is thrown

paper viper
#

very nice

#

no difference from just try and catching IOException

lavish hemlock
#

langs like Rust get around this via explicit error handling through Result and Option

tender shard
#

well here's my opinion:

I think the java developers are not that stupid. If you all think that RuntimeExceptions are such a terrible idea, maybe ask the java devs why it was added. In my opinion, they are not terrible. But of course that's just my opinion

lavish hemlock
#

the Java devs aren't the smartest people, dude

paper viper
#

Java devs violate a ton of shit

#

XD

tender shard
#

I didn't say that, but I also don't think that they just made it up for fun

lavish hemlock
#

they're just a corporation who thinks they know what's best for their language

#

well no they probably made it up just for ease-of-use

#

but it's still a bad practice to leave errors unhandled within libraries

tender shard
#

yeah in general, sure

lavish hemlock
#

as it makes the end error much more confusing for the user

tender shard
#

but not in some conditions, thats my opinion

#

noone would ever use "readResource("blabla.yml")" if there's no blabla.yml

lavish hemlock
#

(another reason why @SneakyThrows can be bad is that you're unable to pass additional error information)

paper viper
#

what if someone modified it then? i mean, thats the same mindset with any other io thing

#

Lol

tender shard
#

there isn't really much more to tell in a FileNotFoundExc besides "the file wasnt found"

lavish hemlock
#

(e.g. logging exceptions/printing their stacktraces as opposed to letting them be unchecked for the duration of the program, making it crash)

paper viper
#

and also what if

#

you are dealing with a configuration

#

user specifies file names

#

then a file name is invalid

#

while looping through

lavish hemlock
#

ah yeah

tender shard
paper viper
#

mhm

torn badge
lavish hemlock
#

lmao

tender shard
#

I think you are all missing the point that this method simply gets a file from inside the .jar

#

what could possibly the reason for it to be thrown except that the plugin dev did a typo? or forgot to "shade" the resource?

lavish hemlock
#

I think the best part of your example is how you already have a try/catch in that method yet you still use SneakyThrows

pearl spear
#

anybody else getting this? Cannot resolve org.spigotmc:spigot:1.18-R0.1-SNAPSHOT

undone axleBOT
paper viper
#

buildtools

#

Yeah

tender shard
tender shard
pearl spear
tender shard
#

to anyone hating SneakyThrows, please just read this:

#

I can understand your opinions on MY usage of SneakyThrows, but I don't think that SneakyThrows is useless in general

lavish hemlock
#

if you think about it

lavish hemlock
#

most of Lombok's problems are just the fault of Java

tender shard
#

Well I for myself really like Lombok and I won't stop using it, I see nothing wrong with using it, so please don't mock people for using it ๐Ÿ™‚

#

I also don't mock Kotlin users lol

lavish hemlock
#

Well the difference is that Kotlin is a full language with more than just a few utility features.

tender shard
#

Brainfuck is a full language too with more than just a few utility features

lavish hemlock
#

(Which could've existed in Java had Java actually been decided nicely)

buoyant viper
#

scala n kotlin takes lombok Getter and Setter and said hehe mine now

lavish hemlock
#

So improper comparison

#

Because I know you're comparing how Kotlin and Lombok have the same set of features.

#

Because, they do.

#

But Brainfuck doesn't.

tender shard
#

No I don't

paper viper
#

i dont get why you are comparing an actual language to a joke language

tender shard
#

I just wanted to mention that different might prefer different things. I like Kotlin because it adds some nice things that make my life easier

young knoll
#

Hey

paper viper
#

"stack engineer, knows 1000 hours of brainfuck!"

young knoll
#

Brainfuck is the highest grade enterprise language

tender shard
#

Kotlin could do that too, but I just don't like Kotlin. That doesn't mean that I say it's bad

lavish hemlock
#

I like Kotlin because it actually fixes a lot of Java's problems.

buoyant viper
tender shard
#

I know that's a bad reason not to use it

young knoll
#

The US nuclear missile launch system uses Brainfuck

buoyant viper
#

so does my nuclear missile launcher system

#

the US skidded my code

tender shard
buoyant viper
tender shard
#

the orange dude

lavish hemlock
#

my original point is how Lombok has bad implementations and a lot of seemingly useless or concerning features

buoyant viper
#

ah, eisenhower

tender shard
lavish hemlock
#

are you a moderator?

buoyant viper
#

u brought up the president first??

tender shard
#

I know

#

I shouldn't have

lavish hemlock
#

and you're the one who brought up politics first

#

anyway the word you're looking for is Trump

tender shard
#

just wanted to make a joke

buoyant viper
#

i was just naming off some prez's

tender shard
#

Okay anyway - Lombok's @Data is awesome

buoyant viper
#

but scala is cooler ๐Ÿ˜Ž

lavish hemlock
#

okay there is actually one big problem with @Data

tender shard
#

which one?

lavish hemlock
#

using it makes it harder to individually customize the annotations it applies

#

since @Data is literally just like 6 annotations in a trenchcoat

tender shard
#

yeah but you can overwrite that of course

#

for each field etc

lavish hemlock
#

last time I used it, you needed to either:

  • use @Data
  • apply every annotation anyways just to edit one of them
tender shard
#

well if you want to NOT include a setter for everything, just make the fields final etc

#

Everyone can always decide on whether or not to use Data

#

I use it for simple stuff, like for example... let me look for it

#
package de.jeff_media.jefflib;

import com.google.common.base.Enums;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.RequiredArgsConstructor;
import org.bukkit.Location;
import org.bukkit.Particle;
import org.bukkit.configuration.ConfigurationSection;
import org.bukkit.entity.Player;
import org.jetbrains.annotations.NotNull;
import org.jetbrains.annotations.Nullable;

import java.util.Locale;

/**
 * Data class to wrap all information needed to play a particle
 */
@Data
@Builder
@RequiredArgsConstructor
@AllArgsConstructor
public final class ParticleData {
    private Particle particle;
    private int amount = 1;
    private double offsetX;
    private double offsetY;
    private double offsetZ;
    private double speed;

    public static ParticleData fromConfigurationSection(@NotNull final ConfigurationSection config, @Nullable String prefix) {

        if(prefix == null) prefix = "";
        final String particleName = config.getString(prefix + "type");
        if(particleName == null || particleName.isEmpty()) {
            throw new IllegalArgumentException("No particle type defined");
        }

        final Particle particle = Enums.getIfPresent(Particle.class, particleName.toUpperCase(Locale.ROOT)).orNull();
        if(particle == null) {
            throw new IllegalArgumentException("Unknown particle type: " + particleName);
        }

        int amount = 1;
        if(config.isInt(prefix + "amount")) {
            amount = config.getInt(prefix+"amount");
        }
        double offsetX = 0;
        if(config.isDouble(prefix + "offset-x")) {
            offsetX = config.getDouble(prefix+"offset-x");
        }
        double offsetY = 0;
        if(config.isDouble(prefix + "offset-y")) {
            offsetY = config.getDouble(prefix+"offset-y");
        }
        double offsetZ = 0;
        if(config.isDouble(prefix + "offset-z")) {
            offsetZ = config.getDouble(prefix+"offset-z");
        }
        double speed = 0;
        if(config.isDouble(prefix +  "speed")) {
            speed = config.getDouble(prefix + speed);
        }

        return new ParticleData(particle,amount,offsetX,offsetY,offsetZ,speed);
    }

    public void playToPlayer(@NotNull final Player player, @NotNull final Location location) {
        player.spawnParticle(particle, location, amount, offsetX, offsetY, offsetZ, speed);
    }

    public void playToWorld(@NotNull final Location location) {
        location.getWorld().spawnParticle(particle,location,amount, offsetX, offsetY, offsetZ, speed);
    }

}
#

no need to overwrite anything there. Just add @Data, done

paper viper
#

that class looks fucking gross im sry

#

the fromConfigurationSection ugh

tender shard
#

You don't have to be sorry. it saves me a ton of work everytime I need user-configured particles

tender shard
lavish hemlock
#

this is one of those times I advocate for reflection

tender shard
tender shard
lavish hemlock
#

the name

tender shard
#

how would you call it?

lavish hemlock
#

me?

#

from

#

the parameters give me enough information

tender shard
#

It's the same as TextComponent.fromLegacyText

#

I like to stick to the names how Bukkit/Spigot does it

lavish hemlock
#

yeah but the parameter isn't LegacyText text

mellow gulch
lavish hemlock
#

lmao

lavish hemlock
tender shard
#

I prefer descriptive names even if they are overly verbose

young knoll
#

Oooh enums.getIfPresent

#

Gotta remember that one

tender shard
young knoll
#

I didnโ€™t know it existed

tender shard
#

Enums.getIfPresent is heaven sent

young knoll
#

I always use valueOf

tender shard
#

it's from Google, or Apache Commons? i dont remember

lavish hemlock
#

Guava

tender shard
#

com.google.common.base

lavish hemlock
#

anyway, what we really need is some way to do quick enum reverse lookup

lavish hemlock
tender shard
#

might be, no idea^^

lavish hemlock
#

...it is

#

that is Guava's package

tender shard
#

it's an awesome method

#

I wrote something similar myself until I found out this is already included in spigot

lavish hemlock
#

MyEnum.MY_VAL(0) and then

#

MyEnum.from(0) -> MY_VAL

#

I always have to do some boilerplate for that

tender shard
#
    /**
     * Removes an item from the array at a given location, returning the remaining array
     * @param arr Array to remove from
     * @param index Index at which to remove from
     * @param <T> Array type
     * @return Array with the desired item removed
     */
    public static <T> T[] removeAtIndex(final T[] arr, final int index) {
        if(arr == null || index < 0 || index >= arr.length) {
            return arr;
        }
        final List<T> list = new ArrayList<>(Arrays.asList(arr));
        list.remove(index);
        //noinspection unchecked
        return list.toArray((T[]) Array.newInstance(arr.getClass().getComponentType(),0));
    }

Generics + arrays are disgusting. Someone got any better idea for this one?

lavish hemlock
#

hold on

sullen marlin
#

Two array copies

lavish hemlock
#

yeah

tender shard
#

got any examples?

lavish hemlock
#

just do some shit with Arrays

tender shard
#

I always find copying arrays kinda confusing

#

so I came up with that workaround

lavish hemlock
#

well it's faster

tender shard
#

I know it's not very good

#

but it gets the job done for now lol

sullen marlin
#

Make new array with size - 1 length

#

Then system.arraycopy all ements before index

#

And another system.arraycopy with elements after

lavish hemlock
#

(oh ye plus you haven't seen the shit that list.toArray goes through lmao)

tender shard
sullen marlin
#

public void removeElement(Object[] arr, int removedIdx) {
System.arraycopy(arr, removedIdx + 1, arr, removedIdx, arr.length - 1 - removedIdx);
}

#

Can be done in one line apparently

lavish hemlock
#

lmao

sullen marlin
#

Stolen off stackoverflow

lavish hemlock
#

ah yes

#

this is why you always google shit

tender shard
#

oh wait

lavish hemlock
#

bc people smarter than you have figured it out already

tender shard
#

but that changes the original array

sullen marlin
#

Yeah
Also leaves element at end

#

So maybe not a good idea

tender shard
#

yeah

#

that's not what I need

sullen marlin
#

My first one was prolly better

#

ArrayUtils.removeElement(array

#

Go see what that does

tender shard
#

but that still requires Arrays.newIntance I assume ?

sullen marlin
#

Apache so probably overengineered lol

young knoll
#

It exposes a RCE

tender shard
young knoll
#

Wait no wrong Apache

lavish hemlock
#

in all fairness, Apache Commons is good

lavish hemlock
buoyant viper
young knoll
#

Well, yeah

lavish hemlock
#

nope

young knoll
#

It has to be a collection

lavish hemlock
#

collections only take in other collections

#

because the stdlib is fucking atrocious sometimes

buoyant viper
#

wtf why is java so bad

tender shard
lavish hemlock
#

that's a different ArrayList

#

that's Arrays.ArrayList

young knoll
#

excuse me

#

Why is there another one

lavish hemlock
#

it is a private static inner class that presents a List view over an array

buoyant viper
#

C# is what java shouldve been...

tender shard
lavish hemlock
#

that ArrayList is fixed-size

#

(not immutable)

golden turret
#

new ArrayList<>(Arrays.asList(data))

pearl spear
#

Im using the remapped dependency, how come my NBT imports don't work?

lavish hemlock
#

but has the benefit of not having any performance downsides from adding a buncha shit

#

anyway this is why Kotlin is better

tender shard
lavish hemlock
#

listOf<T>(data)

tender shard
#

you still use obfuscated names and/or spigot old mappings

golden turret
#

ok javascript user

pearl spear
#

NBTBASE and NBTCOMPOUND are both invalid imports?

lavish hemlock
#

...who are you talking to??

pearl spear
#

did they change it all?

tender shard
lavish hemlock
#

also JS's collections are great

#

[]

buoyant viper
tender shard
lavish hemlock
#

not you

pearl spear
#

yikes imma die

tender shard
#

you won't lol

lavish hemlock
tender shard
#

you just need to update your code to use Mojang names @pearl spear

#

maybe create a thread, I might be able to help a bit

buoyant viper
#

mutableListOf ๐Ÿ˜Ž

golden turret
#

use both dependencies :stonks:

pearl spear
#

dev

lavish hemlock
#

you can do shit like
val string = listOf("Hello", "World!").joinToString(", ") (Hello, World!)

sullen marlin
#

why do you need nbt

#

what can you not do with the api

buoyant viper
#

how does this man manage to come in whenever someone is talking about non api stuff

young knoll
#

Uhh, I canโ€™t register a new biome with the API

tender shard
tender shard
#

but yeah NBT sucks, PDC is heaven sent

sullen marlin
#

import net.minecraft.world.item.ItemEnchantedBook;

#

there is API for this

lavish hemlock
tender shard
#

but for example, when I have to check whether some item made by some stupid enchantment plugins is soulbound, I need NBT

#

e.g. MMOItems uses NBT

lavish hemlock
#

NBT is nice if you're using an actually good API

#

Mojang is not an actually good API

tender shard
#

and to check that, you need NBT

lavish hemlock
#

I once tried to implement an NBT reader but it was quite shit

pearl spear
#

I am uusing NBT to get enchantments on an item, rather than using ItemMeta which is bad on performance

lavish hemlock
#

I'll try so again in the future

tender shard
#

how many times per tick are you checking lol

golden turret
#

i remember that when i was debuging some shit

#

i saw something cool in the itemmeta

#

something like unhandledTags

pearl spear
#

ItemMeta when being called lots is like hella bad on performance

tender shard
#

how TF is using ItemMeta causing performance problems?

#

sorry but that's total bullshit IMHO

pearl spear
#

What makes you refuse to believe it

tender shard
#

the fact that everyone uses it and noone ever had any problems with it

lavish hemlock
#

well afaik ItemMeta's probably just a wrapper

sullen marlin
#

dont call the same methods over and over again, you can store the result in a variable

lavish hemlock
#

MEMOIZATION!!! โœจ

tender shard
#

yeah of course you should not use item.getItemMeta() 80 times in a row, I doubt anyone ever did that

pearl spear
#

Any enchantment plugin anywhere does not use ItemMeta

golden turret
#

see that

sullen marlin
#

yes, none of the API is going to be as fast as bypassing it; but you are almost never going to be in a situation where it is actually the cause of lag

lavish hemlock
#

maybe

#

maybe we should just

#

remove the API

#

:3

tender shard
sullen marlin
#

and if for some reason some aspect is particularly bad, then bug reports exist

young knoll
#

Just read memory directly

pearl spear
#

I remember using Spark Profiler like a year ago or some shit

lavish hemlock
#

I'm gonna make some patches for NMS that allow me to load plugins but nothing else

:3

well, probably not since I'm lazy
but it sounds fun

pearl spear
#

when I had like 30 people online, the ItemMeta method was wrecking the cpu

lavish hemlock
#

probably your fault tbh

pearl spear
#

then I switched to nbt

lavish hemlock
#

optimize your shit

pearl spear
#

no problems

tender shard
#

probably you misinterpreted your spark report then

buoyant viper
pearl spear
#

is that the argument here though

lavish hemlock
tender shard
#

or you did some very stupid stuff with your itemmetas

pearl spear
#

i thought we were talking about how ItemMeta is much more costly on performance than using NBT to get enchants

#

not my use of Itemmeta

lavish hemlock
tender shard
#

Just to get this straight: I once sold a plugin to a server with about 100-200 concurrent players 24/7. that plugin checked the ItemMeta of EVERY online player's getItemInMainHand, EVERY tick. No problem at all. Solid 20 TPS

young knoll
#

Itโ€™s not โ€œmuch more costlyโ€

#

If it was no one would be using it

golden turret
pearl spear
#

Yikes

tender shard
golden turret
#

im going to save them!

lavish hemlock
#

SAVE THEM FROM THE PAINS OF ITEMMETA!

#

I BELIEVE IN YOU!

#

YOU CAN DO IT!

pearl spear
#

Ignorance is bliss I guess

lavish hemlock
#

lmao the only time when I'm an encouraging person is when I'm being an asshole

tender shard
#

ItemMeta is no performance problem

lavish hemlock
#

just code better dumbass

#

read Effective Java

tender shard
#

loading chunks is, or serializing large itemstacks

lavish hemlock
#

and ?learnjava

undone axleBOT
tender shard
#

but getting itemmeta? who cares about that

#

it's no problem at all

young knoll
#

I mean it may be slower the first time

tender shard
lavish hemlock
#

y'know if Mojang didn't store everything as NBT, stuff could be way faster

young knoll
#

When the meta doesnโ€™t exist and has to be created

tender shard
#

but when it doesn't exist, it's basically empty

lavish hemlock
tender shard
#

or does it get created from NBT then?

tender shard
lavish hemlock
#

well fuck 'em then

tender shard
#

I thought you were talking about the dude who asked the NBT question

lavish hemlock
#

let 'em be offended

tender shard
#

if you were talking about me: I'm fine with getting insulted lol

#

that's my job, I have an LGBT pic, I get insulted all the time on some discords lmao

lavish hemlock
#

I just do what makes me happy :)

tender shard
#

Maow

#

what OS are you using

lavish hemlock
#

Windows

tender shard
#

ugh

#

so you also like to make yourself unhappy

#

I see

lavish hemlock
#

but I'm considering moving my laptop over to Ubuntu when I'm able to

tender shard
#

ubuntu is a good choice for desktops / laptops imho because it has many third party drivers included

mellow gulch
#

mint is cozy imo

tender shard
#

yeah I'm running mint too

#

debian for servers, but debian is shitty to use as desktop OS

#

it just misses all the drivers

lavish hemlock
#

eh I don't like Mint

#

I like the challenge of Ubuntu

tender shard
lavish hemlock
#

and other non-Mint distros

tender shard
#

well mint is just an ubuntu fork, isn't it?

mellow gulch
#

it's ubuntu with a bunch of creature comforts

tender shard
#

so not much different

#

except that mint doesn't look so ugly as ubuntu's default desktop env

lavish hemlock
#

I mean if look and feel really mattered

#

I'd just use Mac or Windows

tender shard
#

if look and feel mattered, everyone would use Hannah Montana Linux

mellow gulch
#

why not all 3?

tender shard
#

best distro EVER

#

yeah I got mac on my macbooks (obviously), linux on all servers, and windows 11 (which sucks way more than windows 10) + mint on the desktop

#

and my router probably runs some BSD but I can't check that lol

mellow gulch
#

got my mac for free basically, traded an old 3d printer for it

tender shard
#

not bad

#

which one do you got?

mellow gulch
#

it's just an imac from 2015ish, nothing that great, just have it for testing c++ code

tender shard
#

my newest mac is the first macbook pro that introcuded the touchbar. the touchbar is so useless lmao

#

I also had an iMac years ago but... then I wanted to play games again and yeah

mellow gulch
#

it's one of the ones that's just a thicc monitor

tender shard
#

MSFS2020 doesn't run that well with anything lower than an RTX2080

unreal quartz
#

depends where you are and what you're flying

lavish hemlock
young knoll
#

A plane, duh

mental jacinth
#

Mk so this is probably a really dumb question but Iโ€™m new to this sorta thing:
I want to lower the time delay between each end crystal placement, for faster crystal pvp
Is the best way to detect the placement and respawn faster with the plugin?

proud basin
#

What do I need to calculate to place panels only from row 27 - 35 in an inventory

unreal quartz
#

what

foggy estuary
#

Does anyone know how to make default explosions deal more damage?

buoyant viper
proud basin
#

yeah that's what I just did

#

forgot to delete my message

buoyant viper
#

rip

tired dagger
#

How do I access the values of a map using reflections? I've never worked with them but I'm trying to get the bukkit commands

sullen marlin
#

?xy

undone axleBOT
golden turret
#

declare a shape in a string

#

get its chars

#

check if the current char is equal what you want

#

set the item in the inventory based on the char index

waxen plinth
#

You have to actually get the map

#

But what are you trying to do here?

#

What's your end goal?

golden turret
tired dagger
#

It was in my last sentence but I'm trying to get the bukkit commands.

waxen plinth
#

Hm

sullen marlin
#

because why

tired dagger
#

so

lavish hemlock
sullen marlin
#

yes

golden turret
#

some server owners dont like to display their cracked plugins in /plugins

waxen plinth
#

Well a Field isn't the value it holds

#

You need to get the value of it

lavish hemlock
#

'cause we'd spend a lot less time doing support if we just didn't care about the plugins people made

sullen marlin
waxen plinth
#
Map<String, Command> commandMap = (Map<String, Command>) bukkitKnownCommands.get(Bukkit.getPluginManager());```
golden turret
waxen plinth
#

What

#

It's how you'd do it

sullen marlin
golden turret
#

!

#

bypasses the system

tired dagger
#

Short answer: hiding all the commands from new users

sullen marlin
waxen plinth
#

Yeah you don't need to remove commands in order for them to not be shown

tired dagger
#

I'm not removing them

waxen plinth
#

That's literally what you said you're trying to do

sullen marlin
#

bukkit.command.version

#

bukkit.command.plugins

tired dagger
#

already did that

sullen marlin
#

the other commands you listed are all hidden by default anyway

tired dagger
#

it doesn't override bukkit:ver, etc

#

one sec, i'll show

sullen marlin
#

they cannot use or see commands they dont have permission for

tired dagger
#

They can see them in tab completion

sullen marlin
#

taking away those two permissions will remove them completely for those users, including via /bukkit:version

#

not if you remove the permission

eternal oxide
#

unless they are op

young knoll
#

Why does it matter if they can see you have Bukkit anyway

golden turret
#

we need to say that we use custom server software!

tired dagger
#

I've created this but the "bukkit:" ones are not included in the List

sullen marlin
#

Clearly you didn't remove the permission

golden turret
#

just use a permission plugin like luck perms

tired dagger
#

Have one

sullen marlin
#

Because it 100% would not work without the permission

ancient plank
#

bukkit.commands.version

tired dagger
#

broo

#

one sec

sullen marlin
ancient plank
#

uh

#

lemme check again

#

yes sorry

#

its bukkit.command.version

golden turret
#

"Discord Helper" ๐Ÿ˜’

lavish hemlock
#

๐Ÿ˜’

buoyant viper
tired dagger
#

you know what. My apologies. I had revoked the "minecraft.command." and "bukkit.command." but forgot I cleared the permissions and forgot to revoke the "bukkit.command.*" again

foggy estuary
#

Does anyone know how to make default explosions deal more damage?

sullen marlin
#

Well there's an explode event isn't there

#

So just call the setter on that

#

Search docs for exolod

#

?jd

austere thicket
#

how can i set a permission to a command in my bungeecoord plugin?

fathom cobalt
#
        val giveMessage = TranslatableComponent("commands.give.success")
        val item = TranslatableComponent("item.swordDiamond.name")
        item.color = ChatColor.GOLD
        giveMessage.addWith(item)
        giveMessage.addWith("32")
        val username = TextComponent("Thinkofdeath")
        username.color = ChatColor.AQUA
        giveMessage.addWith(username)

        sender.spigot().sendMessage(giveMessage)```
why does this work when sender is console, but not when sender is a player?
#

does the Chat Component API depend on BungeeCord?

young knoll
#

No

fathom cobalt
#

in game I just get this

#
import net.md_5.bungee.api.ChatColor
import net.md_5.bungee.api.chat.TextComponent
import net.md_5.bungee.api.chat.TranslatableComponent```
#

these are my imports anyway

#

looks correct to me, according to the documentation on the website

sullen marlin
#

Does that translation still exist

#

Mojang changes them fairly regularly

fathom cobalt
#

ahh!

#

it exists on my server apparently

#

but not in my client

foggy estuary
#

?paste

undone axleBOT
foggy estuary
buoyant viper
#

u didnt register the command in code

#

@foggy estuary

sullen marlin
#

Only one class can extend javaplugib

fleet imp
#

omg i thought i recognized md_5. ur the dude on spigotmc

#

anyway, I'm trying to get the config.yml, but I have a config embedded in my plugin. How do I get the config in the data folder, not the one embedded

fathom cobalt
#

the default config file can be gotten by calling getConfig() on your plugin

#

from your plugin's data directory

fleet imp
fathom cobalt
#

yes?

fleet imp
#

and i dont want the config embeded in the plugin, i want the one in the data folder

fathom cobalt
#

that's just default values for your plugin, that your plugin saves in it's data directory

#

but when you read from the config, it gets the one from the data directory

#

like this plugin for example

#

in onEnable() I call saveDefaultConifg(), which puts that config.yml file into the plugins data directory

fathom cobalt
#

it only saves if the file isn't already present afaik

fleet imp
#

ohhhh ok

fathom cobalt
#
    @Override
    public void saveDefaultConfig() {
        if (!configFile.exists()) {
            saveResource("config.yml", false);
        }
    }```
#

yeah, it saves if the file doesn't already exist

fleet imp
#

oh, you need to include the false

fathom cobalt
#

no

fleet imp
#

can i just ctrl+c v

fathom cobalt
#

this is the function definition for the function you're calling

#

no

#

saveDefaultConfig() is a function defined in JavaPlugin

#

which you're already extending

fleet imp
#

oh

#

ok

fathom cobalt
#

simply call the saveDefaultPlugin() in the onEnable()

buoyant viper
#

?jd

lethal coral
#
    public static ChatColor chatColorFromSkriptColor(Color color){
        org.bukkit.Color col = color.asBukkitColor();
        Bukkit.getServer().broadcastMessage(col + "hello");
        if(col == org.bukkit.Color.AQUA) {
            return ChatColor.AQUA;
        }
    }

I have a ton of else ifs below but I didn't want to spam. my last else is return null;. How am I supposed to compare that color?

proud basin
#

what the hell are you doing

lethal coral
#

making a skript addon

#

and I'm trying to convert a skript color to a bukkit color and then to a chatcolor

#

this is all required because citizens requires it for glowcolor

#

I was debugging

buoyant viper
#

is there a way to get the source of an explosion in an entity damage event

#

like which entity caused the explosion that damaged another entity

fleet imp
#

saveResource doesn't work even though it's in class Main extends JavaPlugin

candid galleon
candid galleon
buoyant viper
#

weird circumstance i have since the player is actually the source of the explosion here, but i would be trying to get the player that caused the tnt to explode i guess @candid galleon

#

world.createExplosion(player.getLocation().add(0, 0.5, 0), 4f, false, false, player)

fleet imp
buoyant viper
#

im trying to then later see how i could retrieve that player in another event

candid galleon
#

if it is, you can find which explosion was closest and go off that

buoyant viper
#

what is the effective range of an explosion

candid galleon
#

depends on its power

buoyant viper
#

pow blocks away in all directions?

candid galleon
#

watch this

young knoll
#

I donโ€™t think thereโ€™s an easy formula

candid galleon
#

The entity's bounding box is divided into a [2ร—width+1] by [2ร—height+1] by [2ร—depth+1] grid of unequally spaced points.

#
Minecraft Wiki

A TNT explosion.
An explosion is a physical event, generally destructive, that can be caused by several different circumstances. It can destroy nearby blocks, propel and damage nearby players, entities, and their armor, and cause one or more fires under correct circumstances. Explosions produce a "shockwave" particle effect.
Multiple close...

#

1.3 * power/0.225 * 0.3

#

apparently

young knoll
#

Huh, I stand corrected

buoyant viper
candid galleon
#

wack

#

use that then lol

oblique wigeon
#

How should I put color in my console prefix- the plugin.yml does not recognize ยงd as a color code

lethal coral
#

"ยงd[yourplugin]" will print [yourplugin] in pink

tender shard
lethal coral
oblique wigeon
tender shard
#

you really really really should not do that

young knoll
#

Wonโ€™t that like

tender shard
young knoll
#

Destroy the color of the logging level

tender shard
#

just do vim latest.log

#

there won't be any colors

young knoll
#

And just clutter my console with annoying colors

tender shard
#

you can use getLogger

#

info for normal output

lethal coral
tender shard
#

warning for "yellow" output

#

and severe for "red" output

#

but you want your actual log files to be clean

#

and not be cluttered with ยงaThis is some green text

lethal coral
#

you're making it out to be more important than it is

tender shard
#

the logger doesn'T care about MC color codes

tender shard
#

do ONE thing, and do that right

#

and in this case, the convetion is:

#

log files should contain INFORMATION

#

and nothing else

#

no uncessary colors etc

buoyant viper
#

pog it worked @candid galleon

tender shard
#

unneccessarry*

#

wtf

candid galleon
#

nice

tender shard
#

how is that word spelled

lethal coral
#

unnecessary

candid galleon
#

unnecessary

tender shard
#

thanks

#

log files should not contain any color codes

#

they really really really should not

oblique wigeon
#

Ok... But it's just that usually I find it a lot easier to look at console when it's color coded

lethal coral
#

it won't break your server

buoyant viper
#

wait fuck i still spelled it wrong

oblique wigeon
tender shard
#

you don't want any stupid things like colors in your logs

#

logs are meant to just tell you whatever is being logged

#

ah shit

lethal coral
#

I'm sure any reasonable person could see through two characters

tender shard
#

had to delete the image, it had some stuff inside not meant be public

buoyant viper
lethal coral
tender shard
lethal coral
#

thank you sir

tender shard
#

MY OPINION: logs are meant to be clean and only contain information that's relevant

#

whether you want to have something in green or purple or unicorn is not relevant

young knoll
#

Most hosts just yeet color anyway

buoyant viper
young knoll
#

I donโ€™t think color shows on my petro panel with bloom

trail lintel
#

Aye guys, I want to update the lore of an item with a cooldown timer. Is that something that is feasible / can handle client side somehow? Obv I can't be iterating through all inventories to find items and update em.

lethal coral
young knoll
trail lintel
#

and then update the lore each second? That seems inefficient. I was wondering if there was a way to get the clients to keep track of it on their end somehow

#

and just display it

tender shard
#

this is how logfiles are supposed to look. no formatting, no fancy stuff, just information that'S needed. and noone needs colors there

young knoll
oblique wigeon
#

Also- a quick question about item attributes... I'm 90% sure they are only supported in papermc... Which I do want to take advantage of, without ruining the plugin for spigot users... Does anyone know any workarounds/ways to disable the feature if it's spigot

young knoll
#

They are supported in spigot

#

Lul

candid galleon
#

Item Attributes are spigot

#

they're actually vanilla, with spigot having an API for them

oblique wigeon
buoyant viper
tender shard
young knoll
#

Idk ask mythic mobs

tender shard
young knoll
#

ItemMeta has a whole bunch of methods for attributes

oblique wigeon
tender shard
#

and why do you think I'm a "color expert"? and what does that even mean lol

silk canyon
#

Hello there.
Does anyone know how to programming in Skript?

tender shard
trail lintel
#

I think what im gonna do is not have the lore set each second but rather whenever they try to use the item before its cooldown is ready it will post a message to them in chat.

silk canyon
#

wut

oblique wigeon
young knoll
tender shard
young knoll
#

(Do they have a discord?)

tender shard
#

but now that you're already here: think about just "FUCK SKRIPT" and do actual coding ๐Ÿ˜›

#

it's not even more complicated

silk canyon
#

i can't join to their discord lol

tender shard
#

using actual java + spigot gives you 1000 times more possibilities

#

skript sucks and skript should have never be invented

#

(just my opinion)

young knoll
#

Python scripting

#

That I would accept

tender shard
#

python is totally fine for MANY things

buoyant viper
#

ill take whatever ur using @tender shard that log looks so much more graceful than nginx lmao

buoyant viper
#

what webserver r u using that it looks so much more graceful than nginx

tender shard
#

I simply ran apache's log files through a tiny script I wrote to make it more readable

buoyant viper
#

o

trail lintel
#

So just so I can get a little better understanding here. Where would the speed bottleneck be if I did decide to update the lore every second for a List of tracked items. I think the setting of ItemMetas as far as my server is concerned is just a bunch of setters, basically nothing. But then I imagine they have to recognize that them meta has changed and send a packet to the respective player to update that item on their end. Is there somewhere / someone I can read about performance deets?

tender shard
#
#!/bin/bash

EXT=""
if [[ "$1" == "yesterday" ]]; then
        EXT=".1"
fi
cat /var/log/apache2/api.jeff-media.de-access.log$EXT | awk '{print $4 "\t" $1 "\t" $12 " " $13 " " $14 " " $15 " " $16 " " $17 " " $18 " " $19 " " $20}'
#

obviously you want to adjust the path and maybe the fields ($1, $2, etc...) ๐Ÿ™‚

#

I just wrote that SOME years ago to simply get all requests to my API

#

it's dirty and ugly but it gets the job done

ancient plank
#

cute api adelemBlushy

tender shard
#

it's only used for update checks ๐Ÿ™‚

#

the update checker api at the .de domain is just a leftover from 2018

#

BTW

#

anyone here using nginx Proxy Manager?

#

I could need some help in setting it up

#

(I'd be willing to pay about ~20โ‚ฌ or sth)

vestal dome
#

so uhh, can someone help me with remapped spigot nms things?

tender shard
#

are you using maven?

vestal dome
#

yes.

#

I have it installed

#

and everything

vestal dome
#

I know..

#

I just want to see if someone knows why this is like this, bc a tile Entity sign (SignBlockEntity.class) has 2 Component[] fields, which identify the "lines", and there's 2 components one with "messages" and the other one with "filteredMessages" and I want to know if someone knows what the "filteredMessages" mean.

vestal dome
#

how can I make it more clear?

tender shard
#

oh sorry

#

with "bc" you meant "because"

vestal dome
#

yeah

#

just, trying to be fast.

tender shard
#

i thought you were talking about some field beig called "bc" lmao

vestal dome
#

bc it's 4:30 am and I have to go to bed..

#

so I just thought about asking this rather quick

tender shard
#

yeah so

#

please show your code

vestal dome
#

I have no code.

#

forgot what I said ? or uhh...

tender shard
#

bruh I'm quite drunk, please don't ask people whether they forgot your questions 1 minute after you posted it, otherwise noone will help you

vestal dome
#

ok I apologize.

tender shard
#

no problem

#

but please, anyway

#

I would need some code

#

because you say "a tile Entity sign (SignBlockEntity.class) has 2 Component[] fields"

vestal dome
#

dude like, what code? mojang mappings code?

#

can I even paste that.

young knoll
#

What are you doing with the NMS sign anyway

vestal dome
#

making it editable, and then the player can change the text of the sign again

tender shard
#

you probably have some code that's not compiling, right?

vestal dome
young knoll
#

Ah, lame

vestal dome
young knoll
#

1.18 got an API method for that

vestal dome
#

create a sign editing plugin, and I didn't do code, because I'm trying to understand what it means the filteredMessages and messages field.

tender shard
#

I ask again: do you get ANY compiling errors? If not, please post the stack trace of your current code

young knoll
#

They are asking about what a field does

#

No errors, no compiling involved at all

#

But Iโ€™m not sure anyone here knows

vestal dome
#

well I tried looking at the minecraft wiki since sometimes they map these types of values and stuff....

#

I tried looking at the sign entity's code.....

#

result: got even more confused on why there's a second field for messages.

tender shard
vestal dome
#

Dude I'm not talking about coding, I'm talking about what a field in NMS's tile entity sign DOES, I'm not coding anything yet, I want to have this sorted out first.. and I am confused already about it.

quaint mantle
tender shard
proud basin
#

Why is it returning like this? https://imgur.com/MsHKJcF ```java
StringBuilder stringBuilder = new StringBuilder();
for (String rule : rules) {
stringBuilder.append(rule).append("\n");
sender.sendMessage(ChatUtil.color("&8&m-------------------------------"));
sender.sendMessage(ChatUtil.color(stringBuilder.toString()));
sender.sendMessage(ChatUtil.color("&8&m-------------------------------"));
}

proud basin
#

It's printing twice when its suppose to only print the bottom one

vestal dome
tender shard
#

what do you mean with "the bottom one"?

#

@proud basin

proud basin
#

The one with 2 rules

#

its suppose to print that only

#

not sure why its printing the single one

tender shard
proud basin
#

It's only getting called once

#

it does contain 2 strings

#

This is how i'm storing them Lists.newArrayList(new String[] {"rule 1", "rule 2"}

tender shard
#

then your "rules" var contains two Strings, so obviously your for { stuff } thing runs twice

#

What are you actually trying to do?

proud basin
#

print out the rules that are stored in a config

tender shard
#

okay so

#

one minute pls

#

what is "rule"? a List<String>?

proud basin
#

rule is a string

#

rules is a List<String>

tender shard
#

okay

#

you want to do sth like this:

#
sender.sendMessage("========================");
for(String rule : rules) {
  sender.sendMessage(rule);
}
sender.sendMessage("========================");
#

right?

tender shard
proud basin
#

no

#

wouldn't that just print the separately

tender shard
drowsy bramble
#

How would I fix the getRank() method? cause i get this currently [18.12 22:10:36] [Server] [Async Chat Thread - #1/ERROR]: Could not pass event AsyncPlayerChatEvent to Kingdoms v1.0 [18.12 22:10:36] [Server] org.bukkit.event.EventExceptionnull [18.12 22:10:36] [Server] at org.bukkit.plugin.java.JavaPluginLoader$1.execute(JavaPluginLoader.java:310) ~[spigot-1.17.1.jar:3284a-Spigot-3892929-0ab8487] [18.12 22:10:36] [Server] at org.bukkit.plugin.RegisteredListener.callEvent(RegisteredListener.java:70) ~[spigot-1.17.1.jar:3284a-Spigot-3892929-0ab8487] [18.12 22:10:36] [Server] at org.bukkit.plugin.SimplePluginManager.fireEvent(SimplePluginManager.java:589) [spigot-1.17.1.jar:3284a-Spigot-3892929-0ab8487] [18.12 22:10:36] [Server] at org.bukkit.plugin.SimplePluginManager.callEvent(SimplePluginManager.java:576) [spigot-1.17.1.jar:3284a-Spigot-3892929-0ab8487] [18.12 22:10:36] [Server] at net.minecraft.server.network.PlayerConnection.chat(PlayerConnection.java:1853) [spigot-1.17.1.jar:3284a-Spigot-3892929-0ab8487] [18.12 22:10:36] [Server] at net.minecraft.server.network.PlayerConnection.a(PlayerConnection.java:1787) [spigot-1.17.1.jar:3284a-Spigot-3892929-0ab8487] [18.12 22:10:36] [Server] at net.minecraft.server.network.PlayerConnection.a(PlayerConnection.java:1753) [spigot-1.17.1.jar:3284a-Spigot-3892929-0ab8487] [18.12 22:10:36] [Server] at net.minecraft.network.protocol.game.PacketPlayInChat$1.run(PacketPlayInChat.java:40) [spigot-1.17.1.jar:3284a-Spigot-3892929-0ab8487] [18.12 22:10:36] [Server] at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:515) [?:?] [18.12 22:10:36] [Server] at java.util.concurrent.FutureTask.run(FutureTask.java:264) [?:?] [18.12 22:10:36] [Server] at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1130) [?:?] [18.12 22:10:36] [Server] at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:630) [?:?] [18.12 22:10:36] [Server] at java.lang.Thread.run(Thread.java:831) [?:?] [18.12 22:10:36] [Server] Caused byjava.lang.NullPointerException: Cannot invoke "games.kingdoms.kingdoms.Admin.ranks.PlayerHandler$Rank.getPrefix()" because "rank" is null [18.12 22:10:36] [Server] at games.kingdoms.kingdoms.Admin.ranks.Events.onPlayerChat(Events.java:36) ~[?:?] [18.12 22:10:36] [Server] at jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[?:?] [18.12 22:10:36] [Server] at jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:78) ~[?:?] [18.12 22:10:36] [Server] at jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[?:?] [18.12 22:10:36] [Server] at java.lang.reflect.Method.invoke(Method.java:567) ~[?:?] [18.12 22:10:36] [Server] at org.bukkit.plugin.java.JavaPluginLoader$1.execute(JavaPluginLoader.java:306) ~[spigot-1.17.1.jar:3284a-Spigot-3892929-0ab8487] [18.12 22:10:36] [Server] ... more

proud basin
#

doing that would do something like ```


rule 1


rule 2
------```

drowsy bramble
#

cause i cant send any message whatsoever

tender shard
drowsy bramble
#

or command

tender shard
#

@proud basin pls open a thread

#

ping me when you did so

proud basin
#

lol

tender shard
#

lol?

proud basin
#

print them in the same thing

#

idk how to call it

tender shard
#

and this is what Im trying to help you with

#

so

#

pls open a thread

proud basin
#

fine

tender shard
#

and ping when me from inside the thread ok

proud basin
#

Lists

drowsy bramble
#

getRank()

proud basin
#

Anyone got the tripple arrow symbol its like >>> but small

tired dagger
#

This?
โ‹™

#

It's small in MC chat

proud basin
#

yea

young knoll
#

Aww itโ€™s so cute

tired dagger
#
Decimal: &#8921;
Hex: &#x22D9;```
proud basin
candid galleon
#

โ‰ซ

dense geyser
#

hypothetically, what would be the best way of restoring a snapshot on a player? for example, in my plugin, I need to teleport a player back to a certain position when a snapshot was taken, but this wont happen on the event of a server crash (other things + teleporting). I'm thinking of making my own serializable file and just loading them when the server starts, restoring them and deleting them, but somehow that seems silly

buoyant viper
#

does a PDC on a player get wiped when they die

dense geyser
#

no

buoyant viper
#

then maybe u can use a pdc

dense geyser
#

oh, I'm using 1.8.8/1.8.9, I shouldve probably mentioned that

buoyant viper
#

rip

dense geyser
#

big rip

#

ive been thinking of manually implementing a pdc thing for my plugins for 1.8 but for that I think I'd need to modify the server jar

candid galleon
#

you could also update to 1.14+

dense geyser
#

I need to stay on 1.8, that isn't really an option

#

ill just go with creating dat files to save it ig

mystic sky
#

bruh

lethal coral
#

How can I convert org.bukkit.Color to ChatColor?

mystic sky
#

what

lethal coral
mystic sky
#

U just want to do ChatColor

lethal coral
#

I can't just do that

#

I have to convert it

#

because I'm getting it from somewhere and I can't control what's given (other than the org.bukkit.Color)

limber mica
#

How would one clear the servers chat?

mystic sky
#

mamadisimo god

lethal coral
#

that's not what I'm doing ๐Ÿ˜ฉ

mystic sky
#

Yeah ik, but i guess this will help u

lethal coral
#

I'm getting an object from Skript which can be converted to org.bukkit.Color which I then need to convert to ChatColor so that I can use it for citizens glow color

lethal coral
#

how does that solve my problem

mystic sky
#

Nvm

lethal coral
#

oh I see it now

mystic sky
lethal coral
#

wait no?

#

let me look deeper lmao

mystic sky
#

I've just saw the guy having a similar question, i guess.

candid galleon
limber mica
candid galleon
#

spam the player's chat with blank messages

limber mica
#

Any other more efficient way?

candid galleon
#

not really

#

you could kick em

#

that'd clear their chat too

lethal coral
candid galleon
#

basically

#

you can't directly convert a color to a chat color

#

so you could either check if the color has the same values as the chat color and return the corresponding color

lethal coral
#

okay okay hold on I can make this 40x easier on you guys

candid galleon
#

or find the color that is closest to the chat color

lethal coral
#

I have the following code...

public static ChatColor chatColorFromSkriptColor(Color color){
        org.bukkit.Color col = color.asBukkitColor();
        Bukkit.getServer().broadcastMessage(col + "hello" + "\n" + org.bukkit.Color.AQUA + "hello");
        if(col == org.bukkit.Color.AQUA) {
            return ChatColor.AQUA;
        }

All I'm trying to do is match what's set in col to a color and then return a chatcolor based on that

#

but what's being broadcasted isn't even close to the colors

#

||and no I wasn't expecting it to color chat this was just for testing purposes||

candid galleon
#

this post specifically is what you probably want

lethal coral
#

it's the same one

candid galleon
#

again: there are only 16ish chat colors, so it's very unlikely for you to find an exact match

#

yeah, try reading it

lethal coral
#

okay but here's what I don't understand

#

Skript is able to convert their color and assign the correct color

#

but that method isn't doing the trick

candid galleon
#

how is skript displaying the color?

lethal coral
#

it can be anywhere

candid galleon
#

where do you need this color displayed?