#help-development

1 messages · Page 1198 of 1

scarlet bay
#

AH SORRY

lean river
#

Heey where could i start when i want to work on NPC i read somewhere that using citizensAPI is good option but i see that isnt free is it true?

lilac dagger
#

There's the ci where they provide free downloads

#

You can also buy it if you like it

grim hound
#

why isn't the io.netty.util.concurrent.DefaultThreadFactory used here?

#

like the whole netty depends on the speed of FastThreadLocalThread

grim hound
#

how did no server engine maker ever notice this?

#

for 13 years?

chrome beacon
#

Probably just doesn't need to change

#

It works fine as is

sly topaz
#

I was under the impression that was just some legacy part of netty when the thread implementation kinda sucked

grim hound
#

but a network one, so might make a bit of a difference

chrome beacon
#

How so?

sly topaz
chrome beacon
#

In what way is DefaultThreadFactory faster

grim hound
sly topaz
#

yes, but is it actually faster

#

it has Fast on the name but that doesn't assure me of anything lol

grim hound
#

yes, because netty uses FastThreadLocal

grim hound
#

dassit

#

;]

sly topaz
#

so there's really no difference

grim hound
#

that requires 2 lines of code to change

#

very slightly

#

and it gives ~35% speed boost

#

(it's not like Map#get isn't blazingly fast, I know xd)

sly topaz
#

because that sounds ridiculous

#

is it really an optimization, I am highly doubtful of it

grim hound
grim hound
#

why would you believe a benchmark from someone else if you don't believe their words?

sly topaz
# grim hound

again, just because it says it is fast, it doesn't necessarily mean it is

sly topaz
grim hound
#

I tested it

#

it's faster

#

I read the src

#

it's a really concept

river oracle
#

How did you benchmark though

#

I guarentee it's marginal at best

grim hound
#

why tf are you all on me?

#

go benchmark it yourselves

#

that's the best way to make it believable

sly topaz
#

I mean, you are the one who is claiming it is faster lol so of course anyone would ask for details

river oracle
#

^ 35% speedup is nothing to ignore either. I mean extraordinary claims require extraordinary evidence

grim hound
#

I mean it is in the 0.001ms range

#

so 35% in there is a very slight deviation

river oracle
#

lol so in otherwords pointless alright that's crazy optimization I wonder if that's even accurate then

grim hound
#

anyway, just test out array[index] compared to a small Map#get

river oracle
#

on what object

echo basalt
#

that isn't proof

river oracle
#

because some objects have faster hash functions

echo basalt
#

and what map impl

river oracle
#

that too ^

grim hound
#

this conversation bores me

river oracle
#

like for an Int its hash function is literally just the value

echo basalt
sly topaz
#

well, you asked a question that will bring out all the nerds, so what did you expect

echo basalt
#

we're performance addicts you can't just come here, say "you smell array > map" and expect to leave without a proper explanation

grim hound
#

instead of using the java HashMap<Thread, Value>

echo basalt
#

jmh both connections

grim hound
sly topaz
#

you'd have a hard time even with JMH tbh if it is indeed at the scale they mentioned lol

grim hound
#

I've been testing with System.nanoTime ever since

river oracle
#

with something that small

sly topaz
#

there are definitely some things that are measured at the nanosecond scale, just not something I'd expect here

#

tho java uses a specialized map implementation for Thread/ThreadLocal nowadays, not a hashmap

echo basalt
#

mfw 2 clock cycles can be optimized when a player opens a socket and there are no threads type shit

grim hound
#

also, why aren't compression handlers cached?

#

that seems like a big memory waste

#

talking about these mfos

#

isn't using a ThreadLocal like this: a much better solution?

sly topaz
#

how does MC use them

grim hound
#

wdym?

sly topaz
#

what is the equivalent of that getHandler0 method in minecraft's code

grim hound
#

for each player

sly topaz
#

I see, so is your cache more of a pool of compression handlers waiting to be used or do you have a single instance of CompressionHandlerImpl?

grim hound
#

with 4 netty threads, there are 4 compression handlers

#

and since usually there tend to be more than 4 players online, this would save memory

grim hound
sly topaz
#

given a packet compressor would be created upon initialization of the connection, pooling the creation of compression handlers doesn't seem all that important given they're only created once and used over a relatively long period and compression handlers are cheap to instantiate

#

if they were not cheap to instantiate I'd understand more

grim hound
#

but every time I look into any server engine's code I see multiple, even very slight optimizations

grim hound
sly topaz
#

is it an optimization though, how much memory are you saving and what's the sacrifice here

echo basalt
#

cool so you're saving 8kb of ram for each player

sly topaz
#

say, isolating only compression handlers, I assume one would be created per player so for 60 players it'd be 60 compression handlers in a standard minecraft server, that means 8kb * 60, is that accurate?

echo basalt
#

if you have 100 players that's 800kb

grim hound
grim hound
sly topaz
# grim hound ye

then your code would re-use those 4 handlers for the 60 players

grim hound
#

aight, nvm then

sly topaz
#

right?

grim hound
echo basalt
#

you just spent 15 minutes ranting about it

#

Assuming 20$/hr that's 5 bucks

#

you can get 16gb of good ddr4 for about 30 bucks

#

that's 53 cents per gb

sly topaz
#

does this not create some churn when it comes to high volume of packets to be compress across multiple connections

echo basalt
#

congratulations you just saved 0.00053$ in memory for 15 minutes of your time + some compute

sly topaz
grim hound
#

finally my maniacal nanooptimizations are understood by someone

sly topaz
#

I would be worried it did cause some performance issue with high volume of packets though

echo basalt
#

Saving wasteful memory is aite, micro-optimizing tiny things is a waste of time

grim hound
#

thank you

echo basalt
#

don't forget you're using java. rewrite the game in rust or whatever and you'll reap the real benefits

grim hound
#

xd

sly topaz
#

memory-wise, yeah

#

performance-wise, uhh, I wouldn't be so sure

blazing ocean
grim hound
#

well I am sure

echo basalt
#

i'd rather use 32mb of ram than spent 2ms looking something up type deal

blazing ocean
#

ok but we have enough memory-

sly topaz
# grim hound ...it wouldn't

compressors would have to be shared, so I can't see that not being the case with high volume of packets across different connections

blazing ocean
#

we pay for memory, we're gonna use the memory!

echo basalt
#

I've seen prod servers run with 100gb of ram lmfao

grim hound
#

those 4 threads handle absolutely everything netty does

blazing ocean
sly topaz
echo basalt
#

yeah

#

per instance

sly topaz
#

that's crazy, whoever is doing infra should get fired

blazing ocean
grim hound
echo basalt
#

if it's compute heavy it's aite

sly topaz
#

if it were a single instance holding a redis cache or something, sure I understand

echo basalt
#

or if it handles like a trillion players type shit

blazing ocean
#

folia

sly topaz
#

but minecraft servers won't use 100gb of ram per instance

blazing ocean
#
  • 2^31-1 players
sly topaz
#

even if you were to hold 100 survival worlds in memory, you wouldn't use 100gb of memory lol

#

that is theorically since no server would be able to handle 100 worlds with a single cpu unless they did some black magic to the server code

blazing ocean
#

now I wanna try

echo basalt
#

in memory worlds type shit

#

the cool thing ab it is that you can have nasty memo leaks and the server wont care for a good while

sly topaz
#

just let it leak and restart the instance™️

echo basalt
#

Map<Player, Whatever> go brr

blazing ocean
#

ok but serialising MinecraftServer is even better

echo basalt
#

why don't we just weakreference bukkit entity nms handle

blazing ocean
#

@shadow night

echo basalt
#

bukkitobjectoutputstream go brr

river oracle
echo basalt
#

boo! spooky

#

👻

quaint mantle
#

System.gc() every tick for memory optimization

blazing ocean
#

🧠

quaint mantle
#

Thread.sleep(Long.MAX_VALUE) for multi threaded spigot

blazing ocean
#

FastAsyncMemoryEfficientMultiThreadedSpigot

river oracle
#

FAMEMTS that flows sooo well

ivory sleet
quaint mantle
#

Quantum spigot when

umbral ridge
#

in 500 years

#

there will probably be no discord anymore

#

economy will be dead

#

and spigot, no minecraft

#

😿

sly topaz
#

doubt minecraft gonna die anytime soon

#

I am going to keep playing bedwars for as long as hypixel is alive

quaint mantle
sly topaz
#

or at least until I get 10k stars

#

whichever one happens first

ivory sleet
#

ill give you a gold star for effort

ivory sleet
#

"qubit logical gates"

acoustic pendant
#

Why is the ñ showing like that when using ChatColor.translateAlternateColorCodes??

#

Also this:

#

Does this make sense?

sly topaz
#

or read with UTF-8 charset if that's within a configuration file

acoustic pendant
sly topaz
acoustic pendant
acoustic pendant
sly topaz
#

is that a string in source code or in a file?

acoustic pendant
#

In config.yml

sly topaz
acoustic pendant
#

getConfig().getString

#

and then translating it with chatcolor

sly topaz
#

oh apparently you also have to configure the encoding in the maven compiler plugin

acoustic pendant
#

I have intelij setup to use UTF-8 but didn't work

sly topaz
#

hm, it seems that it defaults to project.build.sourceEncoding so it should be fine

sly topaz
#

this is a thing apparently

#

make sure you are running your server with -Dfile.encoding=UTF-8

blazing ocean
#

"possibly using UTF8"

#

possibly

mortal hare
#

i wonder how far can you push java's type system to evade runtime checks

sly topaz
#

I can possibly win the lottery today

mortal hare
#

i really like parse dont validate approach

blazing ocean
#

I am possibly the president of the united states

mortal hare
#

but im not keen on creating validation class for each logic

#

rn im writing basic open renderer using lwjgl and im thinking of abstracting opengl shader nonsense into OpenGLShader class

#

the problem relies on the fact that opengl api is very unsafe tbh due to how its bindings are from C

#

so there's really no encapsulation since its a state machine

sly topaz
mortal hare
#

what im thinking is that i would have something like

public class OpenGLShader implements AutoCloseable {


  public void CompiledOpenGLShader compile(CharSequence sequence) {}
}
#

that way i can exploit type system to provide compile time errors if i provide a parameter for another method as CompiledOpenGLShader

#

but this sounds ok, but we all know that when we have multiple parameters, inheritance doesnt really work anymore

#

what if shader is also attached, should i create CompilerAttachedOpenGLShader, this just sounds dumb

slender elbow
#

good api

blazing ocean
#

every second tuesday

#

the other days its us ascii

slender elbow
#

will save using the system default encoding

or possibly utf8

#

meanwhile: Writer writer = new OutputStreamWriter(new FileOutputStream(file), Charsets.UTF_8);

#

system default encoding my ass lol

mortal hare
#

encoding is literally the biggest pain in the ass in terms of IO file handling

#

file locking is also kinda pain

sly topaz
slender elbow
#

i mean, there's only YamlConfiguration in the api, and the method isn't overridden from FileConfiguration so yeah i guess so

acoustic pendant
sly topaz
acoustic pendant
#

But this have never happened to me before

#

Weird

mortal hare
#

i have...

#

flashing rectangle

#

on gpu

#

yay

sly topaz
#

now make raytraced spheres

slender elbow
#

you mean shiny balls?

sly topaz
#

yeah, but with ray-tracing because baked lighting is for kids

mortal hare
#

is it even possible to design typesafe wrapper for opengl api on java

sly topaz
#

it is possible, just not very efficient

mortal hare
#

if i construct CompiledOpenGLShader from OpenGLShader's class compile(CharSequence source), the new object would still point to the same opengl state id, so i can fuck CompiledOpenGLShader state just by recompiling wrong code from OpenGLShader class, unless i deliberately create new shader on the state, by isolating previous shader, but that's just dumb

#

by typesafe i meant compile time typesafe

#

that's even harder if not impossible due to how opengl is a state machine

#

i really like the idea of type system exploitation for validation

#

but for some things i cant seem to make it work

granite pilot
#

I think you're trying to recreate a language server

sly topaz
#

you could probably make do with annotation processors too, lots of people use them for diagnostic purposes

#

annotating classes/methods just to check them does sound ugly though

mortal hare
#

i guess i can do something like this:

import org.lwjgl.opengl.GL33;

public class OpenGLShader implements AutoCloseable {
    private final int id;

    public OpenGLShader(final int id) {
        this.id = id;
    }

    public static OpenGLShader create(final OpenGLShaderType type, final CharSequence source) {
        int id = GL33.glCreateShader(type.getCode());
        
        GL33.glShaderSource(id, source);
        GL33.glCompileShader(id);
        if (GL33.glGetShaderi(id, GL33.GL_COMPILE_STATUS) == GL33.GL_FALSE) {
            throw new IllegalStateException("Failed to compile shader: " + GL33.glGetShaderInfoLog(id));
        }
        
        return new OpenGLShader(id);
    }

    int getId() {
      return this.id;
    }

    @Override
    public void close() {
        GL33.glDeleteShader(this.id);
    }
}

#

it only allows you to construct the OpenGL shader if you have the source for it and its been sucessfully compiled

#

else it throws exception

#

from that point i can pass this OpenGLShader object, ensured that the instance of OpenGLShader is compile-time type-checked and runtime parsed and it is ready to use for the program object

#

this minimizes the need to check for validity for each time it encounters that shader

#

and you only expose getId() as a package-default so that only OpenGLShaderProgram can access the shader id unsafely by its id to attach it to its internal opengl program object state

#

I really like this, but there one cons of this technique: Its not scalable!!!!!!
If you want to have combinations of multiple things, you cannot do that, so usually you make domain level types instead

#

also the problem is that you can call close() externally and i will fuck the OpenGLShader object. But this factory method's function was to compile code and validate that its compiled and not check its lifecycle so

mortal hare
#

or... i can skip OpenGLShader class and opt in for Program class instead for compilation of shaders (its not as if shaders can be used outside of program object anyways):

import org.lwjgl.opengl.GL33;

public class OpenGLShaderProgram implements AutoCloseable {
    private final int id;

    private OpenGLShaderProgram(final int id) {
        this.id = id;
    }

    public static OpenGLShaderProgram create(OpenGLShaderData... shaderData) {
        int programId = GL33.glCreateProgram();
        for (OpenGLShaderData data  : shaderData) {
            int shaderId = GL33.glCreateShader(data.getType().getCode());

            GL33.glShaderSource(shaderId, data.getSource());
            GL33.glCompileShader(shaderId);
            if (GL33.glGetShaderi(programId, GL33.GL_COMPILE_STATUS) == GL33.GL_FALSE) {
                throw new IllegalStateException("Failed to create program shader: " + GL33.glGetShaderInfoLog(programId));
            }

            GL33.glAttachShader(programId, shaderId);
        }

        GL33.glLinkProgram(programId);
        if (GL33.glGetProgrami(programId, GL33.GL_LINK_STATUS) == GL33.GL_FALSE) {
            throw new IllegalStateException("Failed to link program shaders: " + GL33.glGetProgramInfoLog(programId));
        }

        return new OpenGLShaderProgram(programId);
    }

    public int getId() {
        return this.id;
    }

    @Override
    public void close() {
        GL33.glDeleteProgram(this.id);
    }
}

with this i can be completely sure that that program is ready to be used within renderer if it was created within the renderer

tight compass
#

Would it be a bad idea to use the BungeeCord APIs ChatEvent for stuff like staff chat and maybe chat filtering? I ask because these involve cancelling the event, and I'm not sure how well this works by executing these events on the BungeeCord. I understand that Spigot runs an asyncronous chat thread, does this wait for bungeecord to respond or no.

sly topaz
tight compass
#

How so

sly topaz
tight compass
#

Really? I feel like-

#

Ohh

#

I was going to say, I thought I saw the method in there but I guess it doesn't matter if it doesn't work

sly topaz
#

you can give it a go though

tight compass
#

Alright

#

Here's another question, if you have several spigot servers running on the same computer to pool resources, is it possible to have one, almost like a shared API that runs the same core for each spigot server? Just so that you don't have to be loading an identical core for each server?

sly topaz
#

people also put a redis cache on the line or use pub/sub systems, it all depends on what's more familiar to you and how well-versed you are about infra design

tight compass
#

I know, but lets say you had 3 Lobby servers each with identical plugins. You have all three servers running on the same computer to pool resources. But I'm pretty sure, wouldn't the JVM have to load the same plugin jars three times and keep them loaded during execution? Is there a way to only load it once?

#

Or have I got something wrong here

#

Also, you didn't answer my question earlier about whether or not the spigot Async chat event waits for the BungeeCord API's ChatEvent

sly topaz
tight compass
#

Alright

sly topaz
#

then again, you could have your lobby instances all share logic by having all the logic on the proxy instead of the backend

#

then just communicate the necessary information to the backend servers

#

you'd have to switch all your plugins to proxy ones though which depending on what they do, it might not be as easily possible but for lobbies, I don't see that being the case

#

I also recommend using lobby-specific software like a stripped down minestom impl or something like limbo servers out there for maximum performance, that way you don't waste much on the lobby instances since they don't need much processing done anyway

tight compass
#

And it also goes beyond the plugins, but the server architecture itself

#

I just realized

#

I could modify spigot to run multiple server instances, but that'd take forever

sly topaz
#

it is technically possible, by using some black magic and modifying the server classloader kek, probably a fun pet project

tight compass
#

yeah, LOL

#

I ain't doin allat

earnest girder
#

IntelliJ is saying "vulnerability found" in my craftbukkit dependency... is that an issue?

eternal night
#

no

river oracle
# eternal night no

You sure I think it's probably not good I wasn't planning on them finding that backdoor I put in

eternal night
remote swallow
river oracle
#

They still have their TotallyNotAVirus.patch

#

It's a binary patch too btw

eternal night
#

hidden in the server icon patch btw /s

river oracle
mortal hare
#

i hate java streams api

#

why does it have mapToDouble

#

when it doesnt have mapToFloat

#

whoever thought to not include mapToFloat inside Streams api is 🐒

slender elbow
#

floats

scarlet jolt
#

is anyone able to vc and i ss my project

desert aspen
#

How could i make a mob has a bossbar that lowers with his health?

merry cove
young knoll
#

You can update it in the damage event

prime kernel
#

Why won't it let me install Spigot 1.8.8?

merry cove
sly topaz
#

they're gonna be final for jdk 24 without API changes so you could use them just fine

#

if you want something exactly like the other map methods, you'd have to make a FloatStream, shouldn't be hard but kinda annoying honestly lol

ivory sleet
#

why not just use map?

glad prawn
#

FloatStream when

sly topaz
#

that method would've been more useful if it actually provided a FloatStream

ivory sleet
#

Yea true

pure dagger
#

is there a way to make bigger resolution maos?

#

maps?

#

i know you can place more maps on a wall but thats not what i want

rough drift
#

kekw

sly topaz
tiny tangle
#

hi, i dont know after using ```plugins {
id 'java'
id 'java-library'
id "io.github.patrick.remapper" version "1.4.2"}

#

does it has to add repositories and dependencies?

pure dagger
#

even if you make it bigger in cartography table, its also 128x128 but 1 pixel is 4 blocks

#

bruh what

#

wron channel i guess

clear elm
#

I have a example.txt file in my ressorces foulder and would like to create a file into the plugin foulder with the name and the content of the example.txt in my ressorces foulder how can i do this

chrome beacon
#

you need to configure it. See the README file

clear elm
chrome beacon
#

plugin.saveResource("example.txt", false);

sly topaz
#

you can use that or just the standard java file api, either way works

clear elm
chrome beacon
#

yes

clear elm
#

and its automatically that the file only createws if it dont exists yet?

chrome beacon
#

yes

#

The false stands for replace

clear elm
#

ah okay thanks

tiny tangle
#

what I understood is it like, download buildtools, then generate a jar ?

clear elm
#

okay thank you, do you also know how i can create the file in another foulder

#

not in the main foulder

sly topaz
#

you'd use java's API for it

clear elm
#

thanks

chrome beacon
#

nio uwu

sly topaz
#

put it in a paste

#

?paste

undone axleBOT
clear elm
# chrome beacon plugin.saveResource("example.txt", false);

im getting this error

java.lang.IllegalArgumentException: The embedded resource 'example.txt' cannot be found in plugins/ItemSpawner-1.0-SNAPSHOT.jar
        at org.bukkit.plugin.java.JavaPlugin.saveResource(JavaPlugin.java:209) ~[paper-api-1.20.1-R0.1-SNAPSHOT.jar:?]
        at eu.tomlegend.itemSpawner.ItemSpawner.onEnable(ItemSpawner.java:485) ~[ItemSpawner-1.0-SNAPSHOT.jar:?]
        at org.bukkit.plugin.java.JavaPlugin.setEnabled(JavaPlugin.java:281) ~[paper-api-1.20.1-R0.1-SNAPSHOT.jar:?]
        at io.papermc.paper.plugin.manager.PaperPluginInstanceManager.enablePlugin(PaperPluginInstanceManager.java:189) ~[paper-1.20.1.jar:git-Paper-196]
        at io.papermc.paper.plugin.manager.PaperPluginManagerImpl.enablePlugin(PaperPluginManagerImpl.java:104) ~[paper-1.20.1.jar:git-Paper-196]
        at org.bukkit.plugin.SimplePluginManager.enablePlugin(SimplePluginManager.java:507) ~[paper-api-1.20.1-R0.1-SNAPSHOT.jar:?]
        at org.bukkit.craftbukkit.v1_20_R1.CraftServer.enablePlugin(CraftServer.java:642) ~[paper-1.20.1.jar:git-Paper-196]
        at org.bukkit.craftbukkit.v1_20_R1.CraftServer.enablePlugins(CraftServer.java:553) ~[paper-1.20.1.jar:git-Paper-196]
        at net.minecraft.server.MinecraftServer.loadWorld0(MinecraftServer.java:635) ~[paper-1.20.1.jar:git-Paper-196]
        at net.minecraft.server.MinecraftServer.loadLevel(MinecraftServer.java:434) ~[paper-1.20.1.jar:git-Paper-196]
        at net.minecraft.server.dedicated.DedicatedServer.initServer(DedicatedServer.java:308) ~[paper-1.20.1.jar:git-Paper-196]
        at net.minecraft.server.MinecraftServer.runServer(MinecraftServer.java:1100) ~[paper-1.20.1.jar:git-Paper-196]
        at net.minecraft.server.MinecraftServer.lambda$spin$0(MinecraftServer.java:317) ~[paper-1.20.1.jar:git-Paper-196]
        at java.lang.Thread.run(Thread.java:840) ~[?:?]```

but i think i created the file right
sly topaz
#

did you recompile the plugin

clear elm
#

yes

tiny tangle
# sly topaz what does your build.gradle.kts look like

im not using kts, just normal gradle, what i dont know its like i inserted the ```plugins {
id 'java'
id 'java-library'
id "io.github.patrick.remapper" version "1.4.2"
}
...
tasks {
remap {
version.set("1.20.1")
}
}
tasks.withType(JavaCompile) {
options.encoding = 'UTF-8'
}

sly topaz
#

open the jar with 7z or something, check if the file is there

chrome beacon
clear elm
#

maven

chrome beacon
#

How did you compile your jar

clear elm
sly topaz
chrome beacon
tiny tangle
#

i just only have ```dependencies {

compileOnly 'org.spigotmc:spigot-api:1.20.1-R0.1-SNAPSHOT'```
chrome beacon
#

You don't really need that

clear elm
sly topaz
#

you are using spigot-api, not the remapped spigot jar

#
dependencies {
    compileOnly("org.spigotmc:spigot:1.20.1-R0.1-SNAPSHOT:remapped-mojang")
}
chrome beacon
#

Remapper will take care of that

sly topaz
chrome beacon
#

I don't remember having to do that when using it

#

Nor does the github instructions tell you do add it

tiny tangle
chrome beacon
#

BuildTools with the remapped flag

sly topaz
chrome beacon
#

and make sure to build 1.20.1

tiny tangle
#

oh, then where do I put the jar of that

sly topaz
#

well, you may want to do it regularly if you are using latest but you aren't

clear elm
sly topaz
clear elm
chrome beacon
#

You might be right

sly topaz
chrome beacon
#

Are you sure you're not using an old jar

clear elm
#

but the contect of the example.txt is in the Example.txt

#

yes

sly topaz
#

what does your pom look like, just to be sure

chrome beacon
#

Could you send your pom

#

?paste

undone axleBOT
clear elm
#

when decompiling it there is instead of example.txt Example.txt with the contect of the example.txt from ressorces

smoky berry
#

Hey, I'm currently working on an UHC Marvel plugin in 1.8 but there are some things I'm not good enough to work on it so I'm searching if some people are willing to help ^^'

wet breach
#

eeew 1.8

#

?outdated

#

hmmm

#

?1.8

undone axleBOT
clear elm
#

no way the bought the domain for this

sly topaz
#

other than that, I don't know honestly, could be maven shade doing dumb stuff?

#

can you disable shade plugin just to check

#

comment it out

blazing ocean
undone axleBOT
clear elm
sly topaz
clear elm
#

which line?

tiny tangle
#

okay, i got this spigot-1.20.1.jar

sly topaz
#

<!--<plugin>...</plugin> -->

#

for the shade plugin of course

wet breach
sly topaz
sly topaz
clear elm
#

what do you mean by comment

#

ig i will just keep it under the name Example it doesnt really matter

wet breach
#

they should set it to false

sly topaz
#

yeah I was just checking that too

#

didn't think filtering would affect the file name but I guess it is a thing lol

wet breach
#

well filtering doesn't mean to remove persay

#

it does some manipulations based on rules

sly topaz
#

I've only ever used it for placeholder replacement

wet breach
#

I have a plugin for that

blazing ocean
#

gonna have fun with this one

hybrid spoke
#

ew no codeglance

sly topaz
wet breach
#

because this is simple

#

didn't need something that can do complex stuff when I don't need such functionalities

#

and at the time, I don't think that existed and I just never bothered changing what works

hybrid spoke
#

KISS

sly topaz
#

I don't think the filtering is complex, just the naming is confusing

#

you wouldn't expect a "filter" to do token replacement

wet breach
#

well it is a form of filtering

sly topaz
#

it is, just that one doesn't usually perceive filtering as a mutative operation per se

wet breach
#

so that is good right?

sly topaz
#

did you do a merge

wet breach
#

probably updated a dependency

#

or decompiled something

sly topaz
#

that's always fun

wet breach
#

yeah, never a fan when a dependency update causes literally everything to break

young knoll
#

Nah he’s just really bad at writing code

hybrid spoke
#

maybe he's a sadist and likes to suffer

sly topaz
#

lmao, imagine

wet breach
#

lol

blazing ocean
#

After doing my regex magic, I've reduced that down to 17 errors

tiny tangle
#

im having error

hybrid spoke
#

we all do marks, we all do

tiny tangle
#

after I putted the jar into my main plugin carpet file then using that compileOnly("org.spigotmc:spigot:1.20.1-R0.1-SNAPSHOT:remapped-mojang") says unresolved dependency

blazing ocean
#

thanks IJ

young knoll
#

With the remapped flag

tiny tangle
#

yes

#

and the jar file into my main plugin carpet folder.

#

throwing like Could not find org.spigotmc:spigot:1.20.1-R0.1-SNAPSHOT.

#

the jar calls spigot-1.20.1.jar

sly topaz
#

try adding mavenLocal() to your repositories

blazing ocean
#

yeah you need that

tiny tangle
#

oh

#

omg

#

👽

#

🫶 no homo

#

oh, quick question

#

implementation "com.mojang:authlib:X" where do I see like these stuff what version could i use to 1.20.1

#

and what does jetbrains douwu

sly topaz
tiny tangle
sly topaz
#

and I am unsure of what you're referring to with jetbrains

#

jetbrains is a company that makes ides like IntelliJ

tiny tangle
#

oh, i saw like other plugins using jetbrains library, but im not aware that what does .

chrome beacon
#

You mean annotations?

pseudo hazel
#

probably for the annotations

tiny tangle
#

oh

sly topaz
#

they have quite a couple of libraries, but it is probably the nullability annotations yeah

#

nowadays you'd prefer jspecify ones though

pseudo hazel
#

why

sly topaz
hybrid spoke
#

damn what a nice game

tiny tangle
#

okay, next probably to figure how to use the Rad`s inject repository

sly topaz
#

for what are you using it for

pseudo hazel
chrome beacon
tiny tangle
#

since im newbie , just start learning local resource custom pack of a green apple item.

young knoll
#

Another annotations standard?

#

Where’s xkcd

blazing ocean
#

fuck

sly topaz
blazing ocean
young knoll
#

Thank you

sly topaz
tiny tangle
#

Thanks you

blazing ocean
#

I made a lil vencord plugin for XKCDs

young knoll
#

Jetbrains supports it?

blazing ocean
#

Yea

young knoll
#

But don’t they have their own

blazing ocean
#

Yup

young knoll
#

Wack

chrome beacon
#

The IDE understands more than just Jetbrains annotations

#

It supports most of the ones in use

#

(all of the ones I'm aware of at least)

sly topaz
pseudo hazel
#

do I see another eclipse L?

blazing ocean
#

I love public final inline fun reified

chrome beacon
#

fun

sly topaz
#

OpenRewrite has recipes for migrating from all known annotations to jspecify luckily, so it isn't so much of a burden to do it

young knoll
#

Recipes?

#

Are we crafting now

dry hazel
#

a spec for automated refactoring

blazing ocean
#

but if I use that, I can't spend my time procrastinating :(

pseudo hazel
#

i gotta cook some of those recipes then

tiny tangle
#

🤣

tiny tangle
#

rad

#

implementation("net.mcbrawls.inject:spigot:3.1.2") cannot use it, im on java 17

#

i dont know what version I could use

#

:C

blazing ocean
#

No idea how to deal with older java versions tbh lmao

#

@chrome beacon perhaps you have any ideas

oblique igloo
#

This a decant place to ask for help with nms and packets?

blazing ocean
#

yup

oblique igloo
#

Trying to make it so that an npc is sleeping using nms and packets. I have the npc spawning I just can't seem to find the right packet to set the position of the npc. I am trying to use the ClientboundSetEntityDataPacket but I can't seem to get it to work, I even tried creating a list of synced data values for it

        serverPlayer.setPose(Pose.SLEEPING);
        gamePacketListener.send(new ClientboundPlayerInfoUpdatePacket(ClientboundPlayerInfoUpdatePacket.Action.ADD_PLAYER, serverPlayer));
        
        // Npc laydown
        List<SynchedEntityData.DataValue<?>> entityDataList = serverPlayer.getEntityData().getNonDefaultValues();
        gamePacketListener.send(new ClientboundSetEntityDataPacket(serverPlayer.getId(), entityDataList));
        
        
        gamePacketListener.send(serverPlayer.getAddEntityPacket(serverEntity));
        spawnedNPCs.put(name, serverPlayer);
    }```
#

Can send the full code for spawning the player if required. Also should mention this is for 1.21.3

chrome beacon
#

if not see if you can update to a more modern version

dense birch
#

How is Bridge training server lobby made???
Does anyone have any ideas?
I want to write a plugin that creates a lobby with the maps I have in .slime format
I have no idea how Bridge training maps work

chrome beacon
#

Probably easier to just skip the slime format

#

No real need for it

dense birch
chrome beacon
#

You can use custom maps without the slime format?

dense birch
chrome beacon
#

Not much

dense birch
#

For example, I want it to be like this, every player who comes will have a map added, then if the player wants, he can customize it, if he doesn't want, he will go with the normal map. After playing, the map disappeared .... I don't want the server to be pressured

chrome beacon
#

Custom how?

#

From different preselected maps or can they build their own maps

#

also how large are these maps

dense birch
chrome beacon
#

Then one way is to just have one world with all the maps in different locations. Then teleport people to the map they want and then handle the blocks per player

#

If you want to be extra optimal you can use Minestom instead of Spigot so you don't have any unnecessary features loaded

dense birch
lethal kindle
#

https://www.youtube.com/watch?v=PSnPOYeTW-0

in this insane video of this guy he said that servers are able to get inputs directly at 5:55
WASD, in 1.21.4
does anyone knows how?

eternal night
#

PlayerInputEvent

lethal kindle
#

ty

quaint mantle
#

can i get suggestion and idea? with question

#

off topic but i need write here

pseudo hazel
#

?ask

undone axleBOT
#

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

mortal hare
#

i love opengl. Sometimes it freaks out that sequence is operation is not right and provides NO ERRORS AT ALL.... but sometimes it forgives you and allows to do operations out if its sequence

#

turns out i've wasted 4 hours of time just because opengl glVertexAttribPointer was called before vertex buffer was binded

#

no one helped, neither google, neither people, neither ai

#

and there's literally zero info on operation sequences

#

I LOVE IT WHEN I CAN ENABLE VERTEX ATTRIBUTE:
GL33.glEnableVertexAttribArray(index);

BEFORE SETTING IT UP VIA:
GL33.glVertexAttribPointer(index, count, type.getCode(), attribute.isNormalized(), type.getByteSize() * count, offset);
WHICH MAKES NO SENSE SO IT SHOULD CRASH BECAUSE THERE'S NO DEFINITION OF OPENGL ATTRIBUTE POINTER... BUT IT DOESNT! WOW!

BUT SETTING UP POINTER BEFORE INTIALIZING BUFFER:
GL33.glBindBuffer(code, buffer)

CRASHES THE WINDOW! AND GUESS WHAT IT PROVIDES NO ERRORS VIA:
GL33.glGetError()

I LOVE IT WHEN I NEED TO DEBUG THIS WITHOUT NO KNOWLEDGE OF WHAT ITS DOING. GOOD JOB OPENGL 🤬

shadow night
#

Welcome to graphics programming

mortal hare
#

i guess to prevent such dumb issues, i will implement a method which takes both attribute data and vertex buffer data arrays instead of decoupling them. this is just dumb api

slender elbow
#

the alternative is vulkan

#

good luck :^)

serene egret
eternal oxide
#

You might be able to fake it, but you can't make it bigger

#

like spawn the dragon invisible, then kill it and turn it visible. But that will likely be janky

gilded granite
#

where is the guide for exporting in the server directly

eternal oxide
#

exporting?

blazing ocean
#

probably building

blazing ocean
# gilded granite where is the guide for exporting in the server directly

If you’re using maven for your Spigot plugins (which you should do), it’s easy to make maven automatically save your plugin’s .jar in your plugins folder. There’s two ways of doing this: 1. The lazy way (not recommended) If you only work alone on one computer, you can just directly declare the output location in...

gilded granite
#

thx

wintry anvil
#

How would I send a player to another server (using velocity) If thats possible idk

eternal oxide
#

?pmc

jovial mason
#

but with the code he starts flying in an instant as soon as i press jum

mortal hare
#

This value must be zero

#

WHY DO YOU INCLUDE IT THAT THEN

#

i would get that if it was deprecated or smth

#

there's literally no mention of deprecation

#

its just there

cedar saffron
#

how to have multiple textures on one item using custom block data?

#

(phillip told me to ask this)

#

hes too scared

blazing ocean
#

It's custom model data

cedar saffron
blazing ocean
#

Actually don't use that tutorial if you're on <1.21.4

jovial mason
#

https://pastebin.com/pE5Tzz1d so basically I want the player to start gliding if he jumps down from the spawn which should look like this: https://streamable.com/bufabi

but with the code he starts flying in an instant as soon as i press jum
some1 can help me? i am trying to fix it for 6 hours already i really aint good at java

cedar saffron
blazing ocean
#

Yea that'll only work on 1.21.4 and higher

#

A huge thank you to Violet for teaching me all of this: https://twitter.com/violxiv

A stream where I make hats: https://www.youtube.com/watch?v=PfHN7cO87sc

Minecraft commands, particularly around NBT values have changed from 1.20.5 so I've updated them below for those who need it :)

00:00 - Intro
00:50 - Creating your model
06:49 - Texturing ...

▶ Play video
cedar saffron
blazing ocean
#

Are you trying to have different textures for an entity or what

#

That video is for items

remote swallow
#

Is is martyn

blazing ocean
#

It is

cedar saffron
remote swallow
#

Is he animating it

blazing ocean
#

Yeah that works the same way

#

It's just custom model data

#

No he isn't

cedar saffron
#

ok

clever lantern
#

any idea how to fix when two players view the same inventory and one of them exists it the other player inventory contents are deleted somehow?

chrome beacon
#

Sounds like you have some code clearing inventories

fair rock
eternal night
#

.3 iirc (well .2, but .2 doesn't exist)

desert aspen
#

does EntityDamageByEntityEvent can detect when a arrow hit a enderman?

mortal hare
#

opengl debugging be like ☝️

pure dagger
#

is it possible to make more resolution maps?

#

more than 128x128

mortal hare
#

i swear people are keen on supporting 1.8 no matter what

#

someone's trying to port Sodium to Minecraft 1.8

pure dagger
#

why people playing 10 y/o version of 15 y/o game

modern dragon
#

Servers for 1.5.2 are still active

pure dagger
#

xD

paper viper
pure dagger
#

thats bad

shadow night
modern dragon
#

People! I want help with something I could not figure out when I initially made my server. It is a a latin-only server (as in the ancient latin, not american spanish) - we have a custom translation to replace the shitty GT one provided by Mojang and it is in an automatically downloaded resourcepack - the problem is that the language then still has to be manually set by the player to the custom language. Can I make it, so that the server would force a particular language upon entrance?

sullen marlin
#

Don't think so

blazing ocean
#

Well yes

sullen marlin
#

Presumably you've forced the resource pack

pure dagger
#

omg spigot admin

blazing ocean
#

You can just copy the latin lang file and rename it to en_us

#

or just copy it for literally each MC lang

sullen marlin
#

Big brain

modern dragon
shadow night
blazing ocean
#

Well you can't really force em

#

The client can just spoof the packet but yea

sullen marlin
#

You can also propose changes to the Mojang pack via like crowdin

blazing ocean
modern dragon
#

Our translation is complete and I am still adding vowel lengths for the final version.

blazing ocean
#

a little chatgpt

shadow night
modern dragon
#

There is also mediaeval vocabulary for later concepts

shadow night
modern dragon
#

But everything with vowel length

shadow night
#

Early, middle, late latin, vulgar latin, classical latin, whatever, no idea

sullen marlin
#

Oh that's fun, I know Latin

#

Mostly reading only though, so translating to Latin is pretty good

lilac dagger
#

Lore ipsum is Latin no?

#

In that case I know latin

modern dragon
#

classical Latin still had the vowel lengths and is the grammatical standard that was followed for millennia to come - although there are some quirks from Late Latin that are also accepted

shadow night
modern dragon
#

😄

shadow night
#

Lorem ipsum dolor amet

lilac dagger
#

Speaking Latin sounds like such a cool thing to know

modern dragon
#

My server is already up for like half a year and people play there from time to time

lilac dagger
#

Or even enjoy reading principia in the original form

modern dragon
#

It is under my latin only discord server

modern dragon
#

A lot more boring than I hoped

lilac dagger
#

I didn't

mortal hare
#

is it really

blazing ocean
lilac dagger
#

Still bad at math to understand that

mortal hare
#

i thought lorem ipsum is Sims language

shadow night
sullen marlin
#

Joining Latin only discord server be like

modern dragon
sullen marlin
#

salve

shadow night
modern dragon
#

You don't need school to do that. I never had Latin at school and I teach it as someone actually from STEM

mortal hare
sullen marlin
#

exit

shadow night
#

I don't like spanish, I like latin and they force me to do spanish :(

modern dragon
#

You can get pretty much all resources for free

shadow night
mortal hare
#

if i had free time i would probably learn basic spanish

#

its sounds so cool

modern dragon
#

Spanish is great

mortal hare
#

and very easy for my mother tongue

modern dragon
#

Plenty of content too

shadow night
#

I don't like spanish

modern dragon
#

With Latin having milllions of scans out of copyright I am already never going to run out of material to read

#

Lifetime worth for free

mortal hare
#

Guys we forgot esperanto

lilac dagger
modern dragon
lilac dagger
#

Don't just exit 😭

lilac dagger
lilac dagger
sullen marlin
#

I mean they're books

#

You can read them

modern dragon
#

Well, depends on what you read. I am paying my school expenses by tutoring a miss from the archive, who is translating court readings

sullen marlin
#

Based Caesar with the Bello Gallico

modern dragon
#

Virtually everything pre 19th century from this country is in Latin

#

so

lilac dagger
#

Ah

#

I didn't know this

#

19th century is not that old

modern dragon
#

Even plenty of stuff is in 19th and 20th century

lilac dagger
#

Yeah nvm my comment

modern dragon
#

Just not as much

lilac dagger
#

Latin is awesome

modern dragon
#

Yeah, now you know why all science stuff is Latin vocabulary

lilac dagger
#

Ye

blazing ocean
#

Yea

modern dragon
#

Ah, so I would replace every language file

#

I hope that would not be too long to load though. Each lang file is like 6k lines

#

But alright, I will try it.

sullen marlin
#

Shouldn't be, should all compress to the same

modern dragon
#

Grátiás tibi agó

viscid carbon
#

@echo basalt Were you talking about something like this?

public interface DailyTypes {

    DailyType dailyType = null;
    Block block = null;
    EntityType entity = null;
    ItemStack itemStack = null;

    void setDailyType();
    void setBlock();
    void setEntity();
    void setItemStack();

}```
glad prawn
warm mesa
#

Im creating a plugin and in one of the modules I have to modify the Tablist, the thing is that i need to order all the users by rank, but it doesn't work properly, can someone help me?

#

That's the code

viscid carbon
blazing ocean
#

Yeah you gotta make getters and setters

viscid carbon
#

inside the interface?

#

never used interfaces properly.

#

okay, nvm my last question. looked into interfaces

desert aspen
#

Is it posible to detect when a player shoots an enderman?

viscid carbon
#

Have you tried entityDamageEvent?

#

EntityDamageByEntityEvent

#

something has to detect it right?

prime reef
#

Can anyone link resources for how custom animated VFX work? I know you need a resource pack, but is it just like...an item display that uses the animated texture you want?

prime reef
#

Not sure if it fires EntityDamageByEntityEvent when they're hit by a projectile

blazing ocean
drowsy helm
prime reef
# drowsy helm can you show an example of what exactly you are trying to do. theres different w...

This is not a mod! (More description below in "NOTE:")

MMORPG classes in Minecraft - Dragon Warrior Class

Get The Dragon Warrior Pack now:
https://samusdev.com/product/rpg-class-series-dragon-warrior/

Also on MCModels:
https://mcmodels.net/model/rpg-class-series-dragon-warrior/

Requires MythicMobs
ItemsAdder support
[MMOItems, MMOCore]

Chec...

▶ Play video
blazing ocean
#

What part exactly

prime reef
#

The actual VFX

blazing ocean
#

That mostly just looks like item displays

drowsy helm
#

yeah those are just item displays

prime reef
#

Item displays, gotcha. Thanks

#

Just needed that lead, cheers

blazing ocean
#

does look really cool though

prime reef
#

oh yeah, much nicer than using particle effects - I worked on an RPG server like 10 years ago before this was a thing, so we just used particle effects, and it made it hard to discern what abilities were being used in PvP lmao

#

You can do custom sounds from a resource pack by just using the playSound method with a string instead now, right? Last time I did serious spigot dev was several years back

blazing ocean
#

Yeah

prime reef
#

awesome

blazing ocean
#

You can add custom sounds with a resource pack and then you just put in the key

prime reef
#

it's nice that Mojang (and by extension Spigot) has added so much support for this stuff lmao

blazing ocean
#

They're working on making items datadriven now

modern dragon
#

yeah

prime reef
#

oh shit

modern dragon
#

resource packs can now basically work like full mods

prime reef
#

got a link to that? or a summary idk

prime reef
#

I know you can do custom shaders now too? but it seems a bit difficult to wrangle in vanilla still

blazing ocean
#

Yeah you can do pre-, post-, and core shaders

blazing ocean
#

Data-driven items are gonna be stored in those jsons

prime reef
#

Were minecraft items still hardcoded into the game??

#

holy shit

blazing ocean
#

once they're done™

#

Yeah

prime reef
#

good god. that was the case in like 2010 when I did Modloader mods

blazing ocean
#

They're still just hardcoded into some registries, but less hardcoded than before

prime reef
#

i was 11 lol

#

Yeah data-driven is like...how you make a game properly modular, gmod style

kindred sentinel
#

Is it ok to use system out println to debug? (Not for information to the server)

blazing ocean
#

Yes

modern dragon
#

yeah

prime reef
#

tbf Mojang does know that modders/plugin developers/Bedrock content pack creators are why the game is alive still, the CTO said as much at a talk I went to last year

kindred sentinel
#

So no one will blame me for bad code if I send code with debugging with system out println?

modern dragon
#

I never like proper debuggers anyway, just put prints all over my code for each step

prime reef
#

Use whatever works for you to debug, just don't package it into the .jar when you're done lol

#

I never figured out how to use a proper debugger for spigot anyway

blazing ocean
#

This is the kind of stuff that's possible nowadays

#

(This is a fucking datapack)

#

(like holy shit)

modern dragon
#

not minecraft anymore

blazing ocean
#

Yeah it doesn't feel like it

#

but it is

mortal hare
#

i thought this was portal

#

legit

#

it even captured that fog

blazing ocean
modern dragon
#

honestly though it is indeed just using minecraft as an engine and the modder codes a whole game on their own

blazing ocean
#

it's definitely vanilla

mortal vortex
blazing ocean
#

Yeah that's the shader fuckery

mortal vortex
#

For some reason in Fortnite, HUD elements appear in game as reflections.

chrome beacon
#

??

mortal vortex
#

Like only world components should have reflections, but i've seen times where in Fortnite and other unreal engine games, things that are only visible on your screen are reflected in water, like hit indicators or whatever.

Its crazy to see a datapack handling reflections better than a game engine

chrome beacon
#

That's not an engine problem

mortal vortex
#

Just the game?

chrome beacon
#

yes

modern dragon
#

that is a fail on the game dev side

chrome beacon
#

also I'd love to see an image of that

modern dragon
#

like real fail

#

😄

chrome beacon
#

because I find it real odd if epic messed up that bad in their own engine

mortal vortex
modern dragon
#

Epic is totally good if the dev knows how to use it

#

it is actually the best available engine imo

mortal hare
# blazing ocean

that some sick shit that i've always dreamt on doing but that required the knowledge of proper shader language and exploitation of certain datapack features that will take ages to search

chrome beacon
#

Unreal default settings and such aren't the best performance wise

prime reef
#

Unreal is 100% the strongest but Unity's the easiest, especially for a solo dev

modern dragon
#

I am developing a game in Unity rn

chrome beacon
#

Unreal isn't that hard

#

You can just use Blueprints if you want

mortal vortex
#

FOUND

mortal hare
#

its just shit for performance

echo basalt
#

make it in source

#

who tf is unity

blazing ocean
#

what the fuck is a game engine

mortal hare
#

nanite and lumen arent a solution

chrome beacon
quaint mantle
modern dragon
#

Epic store gives you cooler treatment if you use their engine, so if you actually intend to publish there, it is good to switch

#

iirc

mortal vortex
mortal hare
#

All games made in UE look.. How do i say. . fortnite'y

#

they all have their cartoony feeling

#

i cant describe

modern dragon
#

That is design of the games

#

Nothing to do with the studio

#

you can play with textures and shaders as you wish

mortal hare
#

i wish games focused more on 2012 gritty looks

prime reef
mortal vortex
#

@chrome beacon

That is highest settings possible in Fortnite, everything is maxxed out, and i'm using DLSS to 4K (not that AA is doing much here). But if you observe, it's reflecting an onscreen element, those little hit indicators, into the water.

mortal hare
#

there's plenty of shading options in UE

chrome beacon
#

It's part of the trail

mortal vortex
# chrome beacon That's probably just intended

Really? thats an onscreen element only visible to you, its basically the same as ur compass in the top. Theres no reason for it to be reflected.

Its an accessiblity setting for the hard of hearing, to visualize sound location.

mortal hare
#

i dont want this

#

i want this:

mortal vortex
#

The first is more realiiitc though

mortal hare
#

its more blurry

#

that's why its more realistic

chrome beacon
#

Yeah modern games love TAA which causes that blur

mortal hare
#

im probably the weird one who always disable anti aliasing

#

i just like the crispness

#

of having that off

#

im trashing UE games

#

meanwhile i cant import a single 2d texture via open gl

#

kekw

prime reef
#

atlasing issues?

blazing ocean
#

looks fun

#

this is why I don't wanna get into game dev

#

(outside of MC)

prime reef
#

i work in AAA game dev

#

don't get into it

#

i hate it

blazing ocean
#

lol

prime reef
#

not only is the work difficult (I work in rendering and graphics, so lots of high tech shit), it's stressful and you have to deal with the fact that the people in charge are just trying to milk a cash cow

#

I get paid pretty well but like

bruh I'd rather be an indie dev

mortal hare
#

i do not blend colors

#

might be something up with texture blending

prime reef
#

would probably help if i could see your code and what format the image is in

left jay
#

how can you set the attack damage of custom items in its meta data?

rough drift
smoky anchor
rough drift
#

I can't see for shit because everything is blurry but smooth

mortal hare
#

fixed it

#

turns out my sketchy .png texture loading loaded byte data in ABGR instead of RGBA byte order

#
        // TODO: Refactor this sketchy texture loading
        OpenGLTextureImageData textureImageData;
        try {
            BufferedImage image = ImageIO.read(this.getClass().getResourceAsStream("/assets/spritemap.png"));
            byte[] data = ((DataBufferByte)image.getData().getDataBuffer()).getData();
            for (int i = 0; i < data.length; i += 4) {
                // ABGR -> RGBA
                byte temp = data[i];
                data[i] = data[i + 3];
                data[i + 3] = temp;

                temp = data[i + 1];
                data[i + 1] = data[i + 2];
                data[i + 2] = temp;
            }
            textureImageData = new OpenGLTextureImageData(image.getWidth(), image.getHeight(), data);
        } catch (Exception exception) {
            throw new IllegalStateException("Unable to load image.", exception);
        }
#

such a sketchy code

tall dragon
#

thats how i usually do it

unborn hollow
#

how do you send a player an action bar? whenever i try this it just sends "ACTION_BARDon't move" to chat:

    public void onPlayerMove(PlayerMoveEvent e){

        e.setCancelled(true);
        e.getPlayer().sendMessage(ChatMessageType.ACTION_BAR + "Can't move");```
sullen marlin
#

get player().spigot().send message, comma rather than plus

unique skiff
#

Could someone help me with a problem with the mines plugin?

unborn hollow
karmic phoenix
#

Hey everyone, how do I detect if the damager is an NPC:
net.citizensnpcs.api.npc.NPC doesn't seem to be working.

    @EventHandler
    public void onEntityDamageByEntity(EntityDamageByEntityEvent event) {

        if (event.getEntity() instanceof Player && event.getDamager() instanceof NPC) {
            Player player = (Player) event.getEntity();
            if (!BoxingMatchManager.isInMatch(player)) {
                return;
            }
            NPC npc = BoxingMatchManager.getMatch(player).getNpc();
            if (event.getDamager().equals(npc.getEntity())) {
                BoxingMatchManager.incrementNpcHits(player);
            }
        } else if (event.getDamager() instanceof Player && event.getEntity() instanceof NPC) {
            Player player = (Player) event.getDamager();
            if (!BoxingMatchManager.isInMatch(player)) {
                return;
            }
            NPC npc = BoxingMatchManager.getMatch(player).getNpc();
            if (event.getEntity().equals(npc.getEntity())) {
                BoxingMatchManager.incrementPlayerHits(player);
            }
        }
    }
zinc iris
#

For getting a ban entry is wants to be provided a target, how do you obtain the target class via a player class?

#

I assumed it might have been player profile or smth but wasn’t

chrome beacon
chrome beacon
unborn hollow
#

i solved it

young knoll
#

So you need new TextComponent(“Hello”)

unborn hollow
#

        event.setCancelled(true);
        event.getPlayer().sendMessage(ChatColor.of("#E6E6FA") + "Can't move!");
        event.getPlayer().spigot().sendMessage(ChatMessageType.ACTION_BAR, new TextComponent(ChatColor.of("#E6E6FA") + "Can't move!"));```
#

for some reason when i run this, the chat color displays differently (lavender) than the action bar (light green) despite using the same hexcode, does anyone know why that happens/a fix?

#

i'm aiming for both to look lavender (what is currently only the chat color)

sullen marlin
#

Use ComponentBuilder not TextComponent

unborn hollow
sullen marlin
#

Missing a .build() or something on the end

unborn hollow
tiny tangle
#

hi

#

this setDisplayName() and player.setResourcePack(url); the setResourcePack its deprecated

#

uhm what was the new one functions for those :C

drowsy helm
#

Am i tripping or is


    private boolean overlaps(double minX, double minY, double minZ, double maxX, double maxY, double maxZ) {
        return this.minX < maxX && this.maxX > minX && this.minY < maxY && this.maxY > minY && this.minZ < maxZ && this.maxZ > minZ;
    }
``` checking for contains rather than overlapping
#

I have two bounding boxes and this method only returns true if one is COMPLETELY in the other

pseudo hazel
#

i think you need a few or cases too I think

drowsy helm
#

yeah thats what i wa sthinking

#

thats from spigot source

pseudo hazel
#

one box could be either side of the other one

#

but still overlapping

#

but in each case a diferent set of rules is true

#

its usually easier to visualize for me if it was just one dimension

#

because it scales to any dimension

#

for one dimension to just overlap, you need the this.max to be higher then the other.min, or have the this.min be lower then the other.max

#

and if both cases are true, then yeah, one fully contains the other

drowsy helm
#

return this.minX < maxX && this.maxX > minX && this.minY < maxY && this.maxY > minY

-2 < 2 && 0 > 0 && -2 < 2 && 0 > 0
true && false && true && false

#

yeah the logic is flawed

#

it would make sense if it were a contains method, but there is another contains method which does this already

pseudo hazel
#

so whats that body like

drowsy helm
#

I just want to figure out if two bounding boxes intersect

echo basalt
#

.

drowsy helm
#

ill sus ty

timber crescent
#

does

player.getInventory().clear();``` clear armor too?
echo basalt
# drowsy helm ill sus ty

for legal purposes that class is like 4 years old so if there's any ugly about it, I'm not responsible

pseudo hazel
#

thats a lot of code to check if some cube is inside another xD

echo basalt
#

all you care about is the contains method

#

and any methods it depends on

drowsy helm
buoyant viper
#

trying to use textdisplays for the first time and failing

#

anyone know what could be going wrong when this is all im doing?

#
TextDisplay display = player.getWorld().spawn(player.getLocation(), TextDisplay.class, entity -> {
            entity.setText("Test");
            entity.setBillboard(Display.Billboard.CENTER);
            entity.setBackgroundColor(Color.BLACK);
        });```
#

ik that would summon at the feet, dont worry about that

blazing ocean
#

What's not working

buoyant viper
#

it just doesnt show up at all

#

oh my plugin isnt loaded at all either

#

that would help

blazing ocean
#

lol

buoyant viper
#

i forgot to shade my own api

#

💀

blazing ocean
#

nice one

buoyant viper
#

yeah it works now

#

poggers

buoyant viper
blazing ocean
buoyant viper
#

LOL

blazing ocean
#

shitpile*

hushed spindle
#

im entirely new to making public maven repositories available so that working with my projects is easier. i deployed my project as a github package and it should be available now, but whenever i try to access it from another project it complains that it couldn't resolve it because it's absent. how would i go about dealing with this
https://github.com/Athlaeos/LoreAPI/packages/2354212?version=1.0

GitHub

A highly flexible and dynamic plugin allowing you to automatically format any item's lore and appearance without actually changing the NBT of the item! - Package me.athlaeos.lapi-core · Ath...

#

with as repository

<repository>
    <id>github</id>
    <url>https://maven.pkg.github.com/Athlaeos/LoreAPI</url>
</repository>
#
Caused by: The following artifacts could not be resolved: me.athlaeos:lapi-parent:pom:${revision} (absent): Could not transfer artifact me.athlaeos:lapi-parent:pom:${revision} from/to enginehub (https://maven.enginehub.org/repo/): status code: 400, reason phrase:  (400)

seems that it's trying to get it from enginehub, but i dont want it to grab from enginehub

blazing ocean
hushed spindle
#

that matters?

#

damn

#

i guess the higher the up the higher the prio?

blazing ocean
#

Yea, first declared, first attempted to resolve

hushed spindle
#

unfortunately did not make a difference

blazing ocean
#

show your pom

hushed spindle
#

?paste

undone axleBOT
hushed spindle
blazing ocean
#

uh why not remove the EH repo

hushed spindle
#

removing doesnt make a difference regardless

#

was left from an old dependency

#

settings.xml was improperly configured, so at least its no longer grabbing from the wrong repository, instead it just doesn't find the package

#

Could not find artifact me.athlaeos:lapi-parent:jar:1.0 in github (https://maven.pkg.github.com/athlaeos/loreapi)

pastel axle
#

I feel like I've hit a wall. If I use the mapTxt builder on its own, the format correctly gets cleared. But when I append it to another builder body, the format continues. I feel like I'm making a really simple mistake somewhere.

ComponentBuilder mapTxt = new ComponentBuilder("");
if (showMapLink) {
    mapTxt.append("\n                       ");
    TextComponent mapLink = new TextComponent("Show on Map");
    mapLink.setColor(ChatColor.BLUE);
    mapLink.setUnderlined(true);
    mapTxt.append(mapLink, FormatRetention.NONE);
    mapTxt.append(new TextComponent("This is still underlined"), FormatRetention.NONE);
}

BaseComponent[] body = new ComponentBuilder("")
    .append(mapTxt.create(), FormatRetention.NONE)
    .append("I am also underlined", FormatRetention.NONE)
    .create();
crude charm
#

idk what section this should go in but for a dev server what are some must have plugins? obv spark and plugman but what others?

blazing ocean
#

never use plugman

#

never reload

crude charm
#

alr

#

is there a go-to for backwards compatibility? idk if via version is still used I've been out the scene for a very long time. Is protical support still a thing

quaint mantle
crude charm
#

alright thx

crude charm
#

also for a very long time I've stuck to only 1.8 spigot but its time for me to move on. Where can I find a list of all the new spigot features since 1.8 spigot. Or the useful ones atleast

#

I mean tyhere are probaly so many but yk yk

summer scroll
#

You can try to create plugins on newer version, you can learn from there i guess.

crude charm
#

I mean if there is just something useful

#

or cool

#

to experiment with