#help-development

1 messages · Page 1107 of 1

coarse linden
#

fucking right

slender elbow
#

yes, that's a platform hook

coarse linden
#

yeah

#

but i use it like a util aswell

river oracle
#

And this is why we wrap Bukkit scheduler

coarse linden
slender elbow
river oracle
#

I smell some dissallowed client modifications 👀

coarse linden
#

i mean i might aswell use it

#

if its there

#

wait

river oracle
#

tf you putting utilities in your plugin class for blud

coarse linden
#

nvm

#

i dont even

#

use them

#

they are static LOL

coarse linden
kind hatch
#

What???

coarse linden
#

"util"

#

sorry

river oracle
kind hatch
#

lmao

#

You gotta be verified to embed stuff.

river oracle
#

alr

rose lichen
#

hey but do any of you hooligans know how to do this

coarse linden
#

im sorry where were we about DI and singletons?

paper viper
#

its fine, we aren't gonna change each other's mind anyways if we argue

civic solstice
#

Hello! I am looking to hire a full time Minecraft Developer who is willing to build a server from scratch using the host Rocketnode. We are willing to purchase anything that is needed for the server to go up and achieve what we are hoping for. Please message me with your experience/portfolio and I will give more details.

coarse linden
#

congrats

#

why did bro delete all his messages

coarse linden
#

i can't find one

undone axleBOT
rose lichen
river oracle
#

if you can't post hire someone offering

rose lichen
#

🥳

#

my friend is wondering about this

torn shuttle
coarse linden
#

im not sure still

#

what you are asking about

#

is it possible?

river oracle
#

I'm not even getting exposure

#

what the fuck

torn shuttle
rose lichen
#

not as deep into coding as he is

coarse linden
#

i can't focus

river oracle
coarse linden
#

with contacts in

#

so idk

#

can't read

torn shuttle
#

then take the contacts off and read, genius

#

why even be on a chatroom if you can't read

river oracle
#

be a real tramp

coarse linden
#

i put them on later

torn shuttle
#

get lasik losers

#

that's what I did

#

never looked back

#

because I am now blind

river oracle
#

I don't think my eyesight is bad enough for them to even allow me to do lasik

#

I barely have a perscription

torn shuttle
#

you think they wouldn't take your money?

river oracle
#

true I do live in the United States

torn shuttle
#

it's not even that expensive

river oracle
#

it is like $400 an eye

torn shuttle
#

if that's the actual price then it's half of what I paid for it

#

it doesn't matter it could've been 10k and it still would've been worth it

#

I had pretty bad eyesight

river oracle
#

hahaha

#

It's around $2,246 per eye

torn shuttle
#

the average price is definitely not that

#

1k/eye was the average

river oracle
#

perhaps you aren't familiar with the United States

torn shuttle
#

I checked in the USA

#

shop around I'm sure you'll find cheaper than that

eternal oxide
#

I've heard there's a guy who does it in the back of a rusty old van

torn shuttle
#

if he moonlights as a free candy van for children then you know he's a real G

stuck oar
#

what is the right way to getExp()?

wraith delta
#

the problem is there is math required afterwards

muted otter
#

?services

undone axleBOT
sleek island
#

idrk if this is the place, but how can i use sonatype nexus to make a maven repo

tulip slate
#

Are there any good fourm posts or otherwise on like some of the math concepts you should know
Like how to apply trig and other key things to kinda know

sleek island
#

how

drowsy helm
#

if so, just use jitpack

tulip slate
#

Like in the context of working with vectors to do something like make a particle animation
Idk how to do that… cuz like I know trig but idk what it’s doing when people use it in their tutorials sometimes

drowsy helm
#

not any tutorials that i know of, but in most cases it's just simple cartesian plotting

#

khan academy is great for maths, yeah

tulip slate
#

I got vectors from 3blue 1brown from essence of Linear algebra

#

Cartesian plotting!
New term for me

#

Ty

drowsy helm
#

just a fancy name for putting stuff on a graph

tulip slate
#

Relearning trig would be good yea
Cuz I formally learned SohCahToa but not Cotan, Sec, CosSec, or how they can be used apart from figuring out ratios on a triangle

drowsy helm
#

tangent and secant are a bit more advanced level trig but pretty straight forward

#

so usually won't learn it at the same time as regular trig

tulip slate
echo basalt
#

In short because players dictate their own movement (they don't apply a vector upon themselves, they just tell the server where they went) you need to calculate it yourself

#

By employing tactics like comparing from/to on PlayerMoveEvent

keen obsidian
#

hi im modifying a players gameprofile at runtime and I need to respawn the player in order for it to visually update to online players
im using Player#Spigot#respawn to attempt this but it doesn't seem to work - any ideas?

drowsy helm
keen obsidian
#

what would that packet be? ClientboundPlayerInfoUpdatePacket?

drowsy helm
#

ClientboundSetEntityDataPacket

fluid cypress
#

how can i "intercept" a vanilla command? for example, i want to allow players to use the minecraft:tp command, and i dont want to give them permission for the command, since they could tp any player anywhere, even in other worlds (i think), but i want them to be able to tp using some minimap mod. those mods usually do /minecraft:tp <playername> x y z, so id like to add some logic to the command to check if the player thats being targeted is the same player that executed the command (and also check if the tp is on the same world, idk if you can use minecraft:tp to tp to other worlds, but if its possible, i dont want that)

pale plover
#

could someone help me with nms 1.20.1?
i have error java.lang.NoClassDefFoundError: net/minecraft/world/level/Level
whenever i use NMS (not even using this class)

eternal night
#

you seem to not be reobfuscating your plugin

pale plover
#

<dependency>
<groupId>org.spigotmc</groupId>
<artifactId>spigot</artifactId>
<version>1.20.1-R0.1-SNAPSHOT</version>
<scope>provided</scope>
<classifier>remapped-mojang</classifier>
</dependency>

#

<build>
<plugins>
<plugin>
<groupId>net.md-5</groupId>
<artifactId>specialsource-maven-plugin</artifactId>
<version>2.0.2</version>
<executions>
<execution>
<phase>package</phase>
<goals>
<goal>remap</goal>
</goals>
<id>remap-obf</id>
<configuration>
<srgIn>org.spigotmc:minecraft-server:1.20.1-R0.1-SNAPSHOT:txt:maps-mojang</srgIn>
<reverse>true</reverse>
<remappedDependencies>org.spigotmcspigot1.20.1-R0.1-SNAPSHOT🫙remapped-mojang</remappedDependencies>
<remappedArtifactAttached>true</remappedArtifactAttached>
<remappedClassifierName>remapped-obf</remappedClassifierName>
</configuration>
</execution>
<execution>
<phase>package</phase>
<goals>
<goal>remap</goal>
</goals>
<id>remap-spigot</id>
<configuration>
<inputFile>${project.build.directory}/${project.artifactId}-${project.version}-remapped-obf.jar</inputFile>
<srgIn>org.spigotmc:minecraft-server:1.20.1-R0.1-SNAPSHOT:csrg:maps-spigot</srgIn>
<remappedDependencies>org.spigotmcspigot1.20.1-R0.1-SNAPSHOT🫙remapped-obf</remappedDependencies>
</configuration>
</execution>
</executions>
</plugin>
</plugins>
</build>

sly topaz
#

?codeblock

undone axleBOT
#

You can use the discord code block format to display code or just text in a more pleasing way:
```java
public class MyPlugin extends JavaPlugin {
@Override
public void onEnable() {

}

}```
Becomes:

public class MyPlugin extends JavaPlugin {
    @Override
    public void onEnable() {

    }
}```
sly topaz
#

or since that's kinda long

#

?paste

undone axleBOT
chrome beacon
#

Do not use artifacts

chrome beacon
#

I assume you're using Intellij

pale plover
#

yes

chrome beacon
#

Open the maven tab on the right

#

and find package

pale plover
#

and run?

chrome beacon
#

yes

#

run it

#

your plugin jar should be in the target out folder

pale plover
#

still: java.lang.NoClassDefFoundError: net/minecraft/world/level/Level

#

im not even using this class

eternal night
#

you are presumably using a method that has that as a param or something

pale plover
#

im using ServerLevel class

chrome beacon
#

What version is the server running

pale plover
#

1.20.1

chrome beacon
#

Could you run /version

#

and send what it says

pale plover
chrome beacon
#

yes

#

You can do so in the console

pale plover
#

/version
[11:43:21] [Server thread/INFO]: Unknown command. Type "/help" for help.

chrome beacon
#

skip the /

#

if in console

#

as alaways

pale plover
#

[11:44:05] [Server thread/INFO]: This server is running CraftBukkit version 3871-Spigot-d2eba2c-3f9263b (MC: 1.20.1) (Implementing API version 1.20.1-R0.1-SNAPSHOT)

chrome beacon
#

🤔

#

And that's the server you're getting an error on?

pale plover
#

yes

stuck oar
chrome beacon
#

in a paste

#

?paste

undone axleBOT
pale plover
#

send

#

oh i put wrong folder

#

in output

#

but still

#

the same error

chrome beacon
#

Try not to put it directly in to plugins

pale plover
#

new error

#

java.lang.NoClassDefFoundError: org/reflections/Reflections

chrome beacon
#

There we go

#

Code that doesn't exist cannot run so you need to include reflections. There are two ways of doing this; If you only plan on supporting 1.17 or newer you can use the libraries section of the plugin.yml. Alternatively you can include reflections in your jar with the maven shade plugin

#

I recommend using the libraries section if possible

pale plover
#

libraries:
-reflections

chrome beacon
#

also your reflections is outdated. 0.10.2 is the newest version

pale plover
#

put everything or only reflections?

chrome beacon
#
libraries:
  - "org.reflections:reflections:0.10.2"
pale plover
#

and again java.lang.NoClassDefFoundError: net/minecraft/world/level/Level

#

Sisyphean work

chrome beacon
#

?

pale plover
#

should i show the code?

chrome beacon
#

Could you try a clean package for me

#

and again don't use the jar plugin to put the plugin directly in to plugins

pale plover
#

private void registerListener() {
String packageName = getClass().getPackage().getName();

    for(Class<?> clazz : new Reflections(packageName + ".listeners")
            .getSubTypesOf(Listener.class)
    ) {
        try {
            Listener listener = (Listener) clazz
                    .getDeclaredConstructor()
                    .newInstance();
            getServer().getPluginManager().registerEvents(listener, this);
        } catch (InvocationTargetException | NoSuchMethodException | IllegalAccessException |
                 InstantiationException e) {
            e.printStackTrace();
        }
    }
}
#

this stopped working

chrome beacon
#

Could you try and put the entire project on github or smth

#

so I can try it locally

eternal night
#

does that emit two different jars?

#

maybe they are using the wrong one or something

chrome beacon
#

It is remapped

#

but not to the version specified

eternal night
#

ah

chrome beacon
#

but ig that could also be the case

chrome beacon
#

after building your plugin

pale plover
chrome beacon
#

alr that's fine

chrome beacon
pale plover
#

this gennerated in output directory

chrome beacon
#

There should be more than one jar

#

which one are you using

pale plover
#

its just giving me one

chrome beacon
#

hm

pale plover
#

TWD-1.1.jar

chrome beacon
#

hm

pale plover
#

i delted the libraries from pom.xml, added artifact and listeners started working again but the NMS still dont

zinc moat
#

Can someone help me

    @Override
    public boolean onCommand(CommandSender sender, Command command, String s, String[] args) {
        if (sender instanceof Player){
            Player player = (Player) sender;
            Location location = player.getLocation();
            plugin.getConfig().set("location", location);
        }
        return false;
    }

explination for whats wrong. it litterly doesnt change anything in the config file

eternal oxide
#

no saveConfig()

chrome beacon
#

and double check that you're actually using maven

#

to compile your jar

eternal oxide
#

Sounds like he's exporting

chrome beacon
#

yeah

pale plover
thorny salmon
#

how to encrypt my source code? i used mvn clean install but my plugin still got reverse engineered and exposed by some support sites. how to prevent this?

chrome beacon
zinc moat
chrome beacon
#

People will always reverse engineer your plugin

#

Obfuscators exist but they're not hard to get around

zinc moat
#

sad reality of paid plugins

chrome beacon
#

If you really want them to stop you should contact them

#

to have it removed

zinc moat
#

wouldnt a tos do the work

thorny salmon
#

thanks, because the plugin i made is free but some people reverse engineer and modify it and sell it for more but same function which makes me feel uncomfortable about that

zinc moat
#

like on your plugin page say
tos:
no deobfusecating / reverse engineer

chrome beacon
chrome beacon
zinc moat
#

nvm that only works for paid

chrome beacon
#

plugin needs to work while offline

#

and with no additional steps

zinc moat
#

damn

pale plover
#
    public void onPlayerDeath(PlayerDeathEvent event) {
            Location location = event.getEntity().getLocation();
            CraftWorld craftWorld = (CraftWorld) location.getWorld();
            ServerLevel nmsWorld = craftWorld.getHandle();

            Zombie nmsZombie = new Zombie(EntityType.ZOMBIE, nmsWorld);
            nmsZombie.setPos(location.getX(), location.getY(), location.getZ());
            nmsWorld.addFreshEntity(nmsZombie);

            CraftZombie craftZombie = (CraftZombie) nmsZombie.getBukkitEntity();

            GameProfile playerProfile = ((CraftPlayer) event.getEntity()).getProfile();

            GameProfile zombieProfile = new GameProfile(playerProfile.getId(), playerProfile.getName());
            if (playerProfile.getProperties().containsKey("textures")) {
                Property textures = playerProfile.getProperties().get("textures").iterator().next();
                zombieProfile.getProperties().put("textures", new Property("textures", textures.getValue(), textures.getSignature()));
            }

            try {
                Field profileField = craftZombie.getHandle().getClass().getSuperclass().getDeclaredField("bQ");
                profileField.setAccessible(true);
                profileField.set(craftZombie.getHandle(), zombieProfile);
            } catch (Exception e) {
                e.printStackTrace();
            }
        }
    }```
#

this dont work

chrome beacon
#

That code is not the issue here

#

You're not compiling with maven like I told you to

pale plover
#

i dont know how to

chrome beacon
#

It will generate 3 different jars when you do so

#

Start by removing the maven jar plugin from your pom

pale plover
#

done

chrome beacon
#

Then open the maven tab on the right

#

Find package

#

And double click it to run

pale plover
#

done

zinc moat
chrome beacon
thorny salmon
zinc moat
#

olivo is that what you mean just putting an image so he knows what to do

chrome beacon
#

yeah it's that

zinc moat
#

should i provide images real quick?

pale plover
chrome beacon
#

There we go

zinc moat
#

dont mind my artistic skills

pale plover
#

no errors but nothing works

#

no listeners, commands

chrome beacon
#

Sounds like the problem is fixed

#

Now your code is broken

zinc moat
#
    private void SpawnCustomBoss() {
        int delay = getConfig().getInt("delay");
        Location location = getConfig().getLocation("location");

        new BukkitRunnable() {
            @Override
            public void run() {
                if (bossUUID == null) {
                    if (location != null) {
                        LivingEntity boss = (LivingEntity) location.getWorld().spawnEntity(location, EntityType.WITHER_SKELETON);
                        boss.setCustomName("Ghost Prime Jr.");
                        boss.setCustomNameVisible(true);
                        boss.setGlowing(true);
                        boss.addPotionEffect(new PotionEffect(PotionEffectType.STRENGTH, 600, 1));

                        bossUUID = boss.getUniqueId();
                    }
                } else {
                    System.out.println("Boss is already spawned.");
                }
            }
        }.runTaskTimer(this, 0, delay);
    }

This code is not properly working i looked in the console the boss isnt already spawned and i see no boss at my current location where i did the ./setbossspawn command

chrome beacon
zinc moat
#

I aint the best at java

chrome beacon
#

world.spawn(location, WitherSkeleton.class, boss -> {})

#

and modify your boss in that lambda

#

might want to add false before the boss lambda

#

to prevent it from randomizing data

zinc moat
#

I am so confused right now

#

Theres no world.spawn

pale plover
zinc moat
#

location.getworld()?

chrome beacon
#

yes

zinc moat
#

alright

#

great

chrome beacon
#

I assume you understand basic java

chrome beacon
#

something in your code is broken

#

Attach a debugger or use some print statements to see what gets run

zinc moat
#

olivio

#

the lambda kinda breaks the rest of my code that prevents dubble spawning

chrome beacon
#

how so

zinc moat
#
                    if (location != null) {
                        location.getWorld().spawn(location, WitherSkeleton.class, boss ->{
                            boss.setCustomName("Ghost Prime Jr.");
                            boss.setCustomNameVisible(true);
                            boss.setGlowing(true);
                            boss.addPotionEffect(new PotionEffect(PotionEffectType.STRENGTH, 600, 1));
                        });

                        bossUUID = boss.getUniqueId();
chrome beacon
#

The boss variable is out of scope

#

The spawn method still returns the spawned entity

#

you can use that

zinc moat
#

can you help me a bit?

chrome beacon
#

or just set bossUUID inside the lambda

zinc moat
#

alright

#

LETS GOO

#

i got it to work

pale plover
#

i just removed the reflections

#

and works

karmic falcon
#

hey,anybody knows a mod/client that can download worlds from multiplayer servers

#

i need them for testing some stuff

smoky anchor
#

And this question does not belong here

karmic falcon
smoky anchor
karmic falcon
smoky anchor
# karmic falcon i have it

If you had it then you wouldn't be getting the error for incorrect java version
Maybe you have it installed but are using a different one to start the program

karmic falcon
#

i check my environment variables, and did on cmd java --version

#

i have jdk 21

#

im gonna install the latest version anywys and try

#

but it said it needed jdk 21

brittle geyser
#

Then you using another java

#

Or broken

#

Try to redownloading java

shell matrix
#

Hey spigot people,
so since recently, enchantments are now registered via the registry. My question is, what other things
can be done via the registry now? I did see stuff like biome, etc so I assume biomes and other stuff gets done like this
too now. More interesting would be item tags and potioneffects though

chrome beacon
#

items and potion effects cannot be registered

#

Wouldn't suprise me if that's going to change in the next couple of updates

#

as the game continues to become more data driven

shadow night
#

Going from Minecraft to Datacraft

smoky anchor
shell matrix
shell matrix
azure zealot
#

is there a way to retrive a cookie in spigot during the login phase like in bungeecord?

azure zealot
#

i know how its working in bungee

#

i asked for spigot

azure zealot
#

ah i think based on the ServerLoginPacketListenerImpl you can use the login event and request the cookies there

#

as it waits until they are received

stuck oar
#

can anyone help me with a problem im having

azure zealot
#

just ask the problem

river oracle
stuck oar
#

so im trying to make a plguin where you can like withdraw vanilla exp into a bottle and if you right click it gives u the exp and whatnot

but minecrafts exp is really awful to work with, does anyone know any way around it because if you take away the levels its just gonna replace them with the exp

chrome beacon
#

It's not that bad to work with

river oracle
#

doesn't player have getLevel set Level methods

chrome beacon
#

get the raw xp value and store that

#

Don't use get level and set level as xp per level varies

stuck oar
stuck oar
river oracle
stuck oar
#

getExp() returns a percentage

river oracle
#

And get the raw value

stuck oar
#

alr thanks

river oracle
#

If this were my own plugin I'd probably favor the math

#

There are forums posts on calculating this

#

You'll find it with a bit of google

stuck oar
#

ive seen some posts with the math but how does that correlate?

brave gyro
#

Hi guys, I'm learning how to program plugins with spigot in 1.20.6 in IntelliJ. The problem is that I can't import org.bukkit.Material whereas I see the file Material.class in spigot-api-1.20.6-R0.1-SNAPSHOT.jar in my External Libraries. Can someone help me please ?

smoky anchor
brave gyro
#

I already use Gradle

eternal oxide
#

update InteliJ

pliant topaz
#

it just gets the total xp amount so no maths required really

stuck oar
#

dont worry just got a util to do it

#

thanks tho

stuck oar
#

how do i get a certain bit from a string

#

like i have

#

"Test Bottle: [1000]"

#

how do i get just the number

#

because it will be different every time

tardy delta
#

find the brackets?

slender elbow
#

sscanf run

eternal night
slender elbow
#

MessageFormat is slightly less cursed but also lol

stuck oar
slender elbow
stuck oar
#

alright thanks

stuck oar
tardy delta
#

learnjava moment

stuck oar
#

if i were to do substring(1, 5) for example

tardy delta
#

just find the indices

#

do a substring of the value based on those

slender elbow
#

find the index of the first '[', find the index of the last ']', substring

stuck oar
#

alright thank you

brave gyro
stuck oar
#

i cant see anywhere how to index the ]

#

only ints

slender elbow
#

chars can be converted to ints, so you can pass char literals to indexOf

stuck oar
#

ah ok thankss

grim hound
#

how can I make clickable images on my spigot page?

#

I just always ignore it

stuck oar
#

its just a warn

#

nothing should happen if ytou ignore it

digital nova
#

If I wanted a plugin to support 1.12-1.21, would my best solution to be to depend on the 1.12 spigot api or?

river oracle
#

you have to use the 1.12 API

#

otherwise you'll get some fun errrors from Commodore that you can't fix

#

when does BlockExplodeEvent trigger I've got an event that isn't printing my debug statement at the top when I Explode TNT?
https://paste.md-5.net/aqipidujak.cs
I can confirm its registered all other events in this class work as intended.

#

but yet no here prints in console when I explode some tnt or summon a primed tnt

remote swallow
#

tnt is an entity

#

PRIMED_TNT

river oracle
#

forgot I need to do both EntityExplodeEvent and BlockExplodeEvent

#

silly me

remote swallow
#

hyper link them

grim hound
remote swallow
#

[url=https://google.com/ ]image[/url]

#

you wrap the image tag in a hyper link

grim hound
#

oh

astral pilot
#

how do you prevent players from getting the buttons from chestgui to their items

remote swallow
#

cancel click/drag events

grim hound
remote swallow
#

show what you have

grim hound
remote swallow
#

remove any spaces

grim hound
remote swallow
#

it probably doesnt like the fact its not a link image

grim hound
#

thanks <3

grim hound
stuck oar
#

public void onBottleThrow(PlayerInteractEvent event)

why is this method never used? its registered in my main class but it doesnt work

sand spire
#

Is it possible to stop the attack indicator from resetting to 0.0 when holding a new material so it only resets after hitting?

stuck oar
#

in which

sand spire
#

?paste

undone axleBOT
river oracle
#

its genuinelly not smart enough to know

#

I'd just supress that warning for every method that is annotated with @EventHandler

#

it should give you an option to do so under ctrl+1

#

or whatever the IJ equivalent of that is

astral pilot
slender elbow
#

canceling click and drag events will do just fine

umbral ridge
#

cancelling emily clicks and drags will fo just fine

#

do

stuck oar
#

t

#

what is the getItemInHand() thingy in 1.20?

slender elbow
#

getInventory getItemInMainHand

#

or OffHand

stuck oar
#

thanks

slender elbow
#

or, neither

#

depending on what you are trying to get exactly, depends on context

stuck oar
#

just the item in their hand

slender elbow
#

players have two hands

#

and can use both to interact with things

stuck oar
#

alr htanks

slender elbow
#

the interact event tells you which hand is being used for the current interaction

#

you can get the item for the hand in that interaction

onyx fjord
#

i have a json object that im (de)serializing, but it needs my plugin instance for some things (DI), how would i handle that?

#

ideally without a custom adapter for that specific object (the interface it implements already has its own adapter)

slender elbow
#

or alternatively do the DI'ing in the adapter

astral pilot
#

why am i getting this error

#

even tho the item that i am trying to serialize is Map<String, Object> which is a serialized itemstack

slender elbow
#

the map contains an ItemMeta which is not serialized

#

sounds like you're using a regular ObjectOutputStream rather than a BukkitObjectOutputStream

astral pilot
#

since its an extension of it (based on dcos)

slender elbow
#

yes, and is able to serialize ConfigSerializable objects like ItemStack and such

astral pilot
slender elbow
#

not for that output stream, yes

lost matrix
#

Since when is emily cute... squint

eternal night
#

surgery couple days ago I think

slender elbow
#

i am cute

lost matrix
#

Noted

echo basalt
#

cap

astral pilot
#

i see

#

thanks a lot

finite garden
#

Is there a way to access the custom_data item component of items?

slender elbow
#

not with the api

#

just use pdc?

worthy yarrow
#

Use minimessage

#

Yep it’s apart of adventure

#

Component serialize / dezerializer, you could also use the legacy serializer

#

I’m not gpt, but minimessage again, is apart of adventure api

#

And again

#

Is a component serializer / deserializer

#

🤷 it’s a ?tas question

#

This is spigot so we don’t exactly have a lot of people knowledgeable of the adventure api, though there are some

blazing ocean
#

how has it

#

never had any issues

worthy yarrow
#

Either way minimessage is an adventure api thing so

umbral flint
#

Component greenText = MiniMessage.miniMessage().deserialize("<green>Green text");

blazing ocean
umbral flint
#

I'll be honest I didn't read any context

blazing ocean
#

yea

worthy yarrow
#

Minimessage I thought still always returns a component

umbral flint
#

Ik that's my bad

echo basalt
#

I believe the world contains that

#

player.level.lookup something like that

#

(just look at how craftbukkit does that)

slender elbow
#

entity, level, server contain one

blazing ocean
#

i thought you needed a reg access?

echo basalt
#

no you just need to become a nerd and have all of this engraved in your memory

slender elbow
#

yarn vs mojmap woes

blazing ocean
#

yarn my beloved

#

need to implement yarn reobf at some point for my plugin

slender elbow
#

lolyarn

robust helm
#

Is it safe to assume that PlayerInteractEvent#getItem == PlayerInteractEvent#getPlayer#getItemInUse?

#

same with EntityDamageByEntityEvent with the damager/attacker

worthy yarrow
#

Get item in playerInteractEvent returns the item that was interacted with iirc

#

So no it’s not the same item

#

EntityDamageByEntity however would return the item in use by that second method call you mentioned but I don’t even remember if that’s a method in said event

robust helm
#

yea its rather getDamager and then getItemInUse or something like that

worthy yarrow
#

Wtv it is it’s not the same

robust helm
brittle geyser
#

?tas

undone axleBOT
worthy yarrow
#

Interact like I said returns the item interacted with which may or may not be an item in their inventory so

#

It could be an armorstand for example, or perhaps a cactus

#

The point is it fires on any player interaction meaning it’s not always an item they currently have in their inventory

robust helm
#

wait but getItem always returns the item in one of the players hand no?

brittle geyser
#

what exactly

robust helm
worthy yarrow
#

Get item usually returns the item most relevant to the case

worthy yarrow
undone axleBOT
robust helm
worthy yarrow
#

I’m literally here helping, you don’t have to spam tas

#

Wdym? The item returned by get item in playerInteractEvent is the item that was interacted with

#

Not necessarily always an item in the players inventory

#

For example, get item in playerInteractEvent vs get item in use could mean the player interacted with cactus, but was using an axe to do so

robust helm
#

For context: im trying to make abilities bindable to items. for that i got a class somewhat like that ```java
class Ability<T: PlayerEvent> {
//some shit here
}

and im listening to all events that are bound to an abiltiy. So my event listener is public void onAbilityItemUse(PlayerEvent event). I registered it using getPluginManager.registerEvents to listen to multiple events. But now the question is whether i should use a switch statement to cast and get the item using getItem on playerniteractevent or just universally use getItemInUse
robust helm
worthy yarrow
#

It can

#

PlayerInteractEvent is pretty vague tbf

#

Still iirc get item returns the item interacted with, so it could be in the players inventory or another item

robust helm
#

weird

#

ig ill js use it without switch and put it in the readme under possible issues :)

#

thanks for the help tho

worthy yarrow
#

Well you just guard clause to verify it’s an item in the players inventory, you can get the action types as well to make it a more specific ability, ie: shift right click for the trigger, also I’d be storing these abilities in the items pdc

#

From pdc you can easily derive if this is actually one of your custom items, not sure if you’re familiar with pdc but yeah

#

?pdc

robust helm
# worthy yarrow ?pdc

actually what i was looking for for my cooldowns. was thinking for so long on how to save them but ig thatll do

worthy yarrow
#

Yeah pdc the modern nbt wrapper

worthy yarrow
#

Cast what

robust helm
#

the PlayerEvent to playerinteractevent

#

i mean for #getItem

worthy yarrow
#

Uh

#

That’s probably a jdocs lookup tbf

robust helm
#

getItem says Returns the item in hand represented by this event

worthy yarrow
#

Hmm I guess I was wrong, still I wonder how it differentiates main/off hand

robust helm
#

no idea. Im also worried with how it handles stuff with shields or bows

#

like aiming with bow while left clicking

worthy yarrow
#

I assume it’s the same process? Just the item being currently used when that event was fired

robust helm
#

maybe itemInUse is then the bow but getItem is not

robust helm
worthy yarrow
#

No I don’t think so

robust helm
#

maybe really ?tas

worthy yarrow
#

Whatever item was or is in the hand at the time of the event being triggered is what should be used

robust helm
#

but there r multiple hands and a bow in the offhand aiming is also kinda using

#

left clicking with the main hand is also kinda using tho

worthy yarrow
#

Yeah this one is probably a tas, see if you can break the event and if you can make a jira report

#

Seems quite niche but still problematic for sure

worthy yarrow
#

?jira

undone axleBOT
worthy yarrow
#

Where you report spigot bugs

robust helm
#

oh

#

why tf is my newly created plugin in intellij broken

#

bukkit not recognized

worthy yarrow
#

Update inj

#

Goofy ide thing

robust helm
#

im on 2024.1.4

#

nvm ill js try

worthy yarrow
robust helm
#

ill try tomorrow

finite garden
robust helm
#

all these different versions are annoying. cant even run 1.21.1 server with jdk17

worthy yarrow
slender elbow
finite garden
#

so I can give players an item with custom data using a command and then check if the custom data is present with a plugin?

robust helm
#

now js gotta fire up minecraft on this laptop

#

events not eventing...

worthy yarrow
#

Debugs

robust helm
worthy yarrow
#

Verify the event is actually being fired, debug statements of some sort

robust helm
#

yea i got a bukkit#broadcastmessage in there

worthy yarrow
#

First thing?

robust helm
#

maybe i should verify onEnable is running cuz i have no idea why it wont work

robust helm
worthy yarrow
#

Well your plugin wouldn’t show up green in /pl if onEnable didn’t fire

robust helm
#

then i have no idea

#

so difficult to create a simple eventlistener

worthy yarrow
#

Did you register the listener?

robust helm
#

yea

worthy yarrow
#

Uh

robust helm
#

i got 2 classes in the main file tho

#

maybe thats bad

worthy yarrow
#

Show

#

?paste

undone axleBOT
robust helm
#

wait i js need to login to discord on laptop again

worthy yarrow
#

No worries

robust helm
#

kotlin tho

worthy yarrow
#

Eek kotlin yeah

#

I’ve not seen it done like this

#

@blazing ocean help

blazing ocean
#

sec

#

what's the issue

worthy yarrow
#

Event not firing

#

Rather listener not listening

blazing ocean
#

huh

#

that looks good

worthy yarrow
#

I think he said that listener class is in the main file as well so perhaps this is an issue

#

Idk

blazing ocean
#

don't see why it wouldn't

worthy yarrow
#

Kotlin is weird

blazing ocean
#

well this works for me

#

not sure why that doesn't work for you

robust helm
#

got an error now!!

#

yay

blazing ocean
#

what error?

robust helm
#

kotlin not configured

#

classdefnotfound

blazing ocean
#

ah

robust helm
#

noclassdeffound

remote swallow
#

you arent shading kotlin

blazing ocean
#

are you using maven or gradle

robust helm
#

gradle

blazing ocean
#

show your build.gradle(.kts)

robust helm
#

havent used kotlin in a while sry. stupid issue

#

?paste

undone axleBOT
robust helm
blazing ocean
#

use this shadow instead

#

the old one doesn't work for java 21

robust helm
#

on it

remote swallow
blazing ocean
#

oh god why

remote swallow
#

com.gradleup.shadow

#

its moved to a gradle managed group still maintained by goooler

blazing ocean
#

gonna keep using goolers

#

just because why not

remote swallow
#

its not updated anymore

blazing ocean
#

oh my fucking god

remote swallow
#

goooler maintains gradleup shadow

blazing ocean
#

holy fuck can these gradle people get their shit together

remote swallow
#

it was planed to move to a gradle managed org for a while

#

its so if gooler (for example) stops wanting to maintain someone else just gets contrib access to the gradle managed repo

#

only been known since march

remote swallow
blazing ocean
#

bru

#

h

remote swallow
#

maybe you should just keep up smh

robust helm
#

still same error

remote swallow
#

what jar are you using

#

there should be on with nothing after and one with -all

blazing ocean
#

and also, why are you shading the kotlin stdlib one more time

robust helm
#

ok prob was cuz reload instead of restart

blazing ocean
#

implementation("org.jetbrains.kotlin:kotlin-stdlib-jdk8")

#

yeah, don't reload, try with restarting

remote swallow
#

was talking about plugin jar not spigot but been as you said it, get bukkit is not an offical source and you shouldnt use it, run buildtools to get the spigot jar

blazing ocean
#

that doesn't have the spigot api no

robust helm
robust helm
blazing ocean
#

use the -all or -dev-all

remote swallow
#

oh i didnt read it all

#

do what rad said

robust helm
#

alr

#

what r the differences between them?

remote swallow
#

with no suffix is just the normal gradle build jar, -all is the jar gradle shadow produces with any libraries you specify shaded

blazing ocean
#

the -all includes all libraries

robust helm
remote swallow
#

it depends on what it is

robust helm
#

what about the -dev?

#

WORKS

blazing ocean
robust helm
#

now why tf is player#getItemInUse on playerinteractevenmt null

robust helm
blazing ocean
blazing ocean
remote swallow
#

spigot fires it for everything

robust helm
#

yea im hitting grass with a trident

#

well thanks for the help tho

#

would have went to sleep and never touched my pc again without u

kindred valley
#

?learnjava

undone axleBOT
#

For Beginners:

Codecademy - Learn Java: Interactive Java programming course from basics to more advanced concepts. Perfect for absolute beginners.
https://www.codecademy.com/learn/learn-java
JetBrains Academy - Java Developer Track: Learn by doing with projects and challenges. It covers Java fundamentals to advanced topics.
https://www.jetbrains.com/academy/
Udemy - Java Programming Masterclass for Software Developers: Updated courses that cover Java 8 to Java 17 features. Suitable for those who prefer structured learning.
https://www.udemy.com/course/java-the-complete-java-developer-course/

For Intermediate to Advanced Learners:

Oracle Java Tutorials: The official guides by Oracle for Java programming—great for understanding the depth of Java.
https://docs.oracle.com/javase/tutorial/
Baeldung - Learn Java and Spring: Focus on Spring Framework and modern Java technologies. Best for intermediate learners aiming to expand their knowledge.
https://www.baeldung.com/

Practice and Hands-on Learning:

Exercism - Java Track: Solve exercises and get feedback from mentors. Great for practicing coding skills.
https://exercism.io/tracks/java
LeetCode: Practice your coding skills and prepare for technical interviews with Java.
https://leetcode.com/

Free Resources and Documentation:

Java Programming and Documentation: A comprehensive collection of Java programming guides, tutorials, and API documentation.
https://docs.oracle.com/en/java/

Community and Support:

Stack Overflow: A vast community of developers. Great for getting help with specific problems or understanding concepts.
https://stackoverflow.com/questions/tagged/java
r/learnjava on Reddit: Join the community of Java learners and get advice, share resources, and discuss projects.
https://www.reddit.com/r/learnjava/

Remember: Learning to program takes practice and patience. Don't hesitate to experiment with code and participate in community discussions. Happy coding! 🎉

karmic falcon
#

hey guys, is there a way to stop a world from generating new chunks if the chunks are unloaded, the world i imported is a normal world(not flat and all layers set to null), it has some builds, whenever i walk far new chunks generate normally like vanilla
is there a way to do this without listeners?

hard socket
#

do I have to use PDC to make an item unstackable?

karmic falcon
#

just give it a random value in its nbt tag

#

uniqueId = ranomd number

pliant topaz
#

for that i usually generate a random uuid, its rarer to exist 2 times randomly then a 64bit number

eternal oxide
#

you can now set a MaxStackSize to make them unstackable

pliant topaz
#

true, gotta update my plugin, but ill keep the uuid to check for potential duped items ig

zinc moat
#

how do i give my entity a color coded name

exotic matrix
#

Hello, i was wondering how ItemsAdder, Oraxen , Model Engine can create custom model textures for specific mobs only ? When i ask this, everyone say "just use ItemsAdder" but i want to know how they succeed doing this when everyone says it is not possible

echo basalt
#

modelengine's textures are made of display entities / items with custom item models

#

and the items are defined in the resourcepack

#

they wrap around the real entity, they don't retexture an existing one

pale plover
#

Is it possible to create tottaly custom gui with NMS?

remote swallow
#

only serverside no

slender elbow
#

why are plugin devs so scared of resource packs

eternal oxide
#

they are annoying

echo basalt
#

pain in the ass to impl

slender elbow
#

sure but that isn't really a limitation as to not do it

eternal oxide
#

its a choice not to be burdened by annoying things

eternal night
tardy delta
#

💀

young knoll
#

Before multiple resource packs were a thing they sucked for public plugins

#

A lot better now

eternal night
#

they are

#

well

#

not in server.properties

#

but the network protocol supports it

#

well the client just layers them

#

by using a plugin

#

¯_(ツ)_/¯

zinc moat
#

Does anyone know how i can change the health of my boss i've tried bos.sethealt(250) but it errors saying i cant go over 20

eternal night
#

you first need to set the max health attribute to that val

zinc moat
#

Thanks

#

i know

#

but thanks tho

young knoll
#

You still have to be careful to not have conflicting model data values

#

And you gotta host the pack somehow

eternal night
#

zinc moat
halcyon hemlock
#

why the fuck are requests randomly taking exactly 2.0x seconds?

#

both the api(axum) and next.js are running on release mode

#

its on localhost btw

young knoll
#

I think it should be possible to host the pack on the server itself through the same port

#

Just gotta intercept the request early in the netty pipeline

#

I’ve yet to try it tho

halcyon hemlock
#

web dev is so gay

exotic matrix
echo basalt
#

Pretty much yeah

zinc moat
#

boss.getAttribute(Attribute.GENERIC_ATTACK_DAMAGE).setBaseValue(10); would the base value be in hearts or what is it in?

young knoll
#

Half-hearts

zinc moat
#

Alright thanks

rotund ravine
worthy yarrow
rotund ravine
#

Big balls no, but 3 big balls i do know.

remote swallow
#

holy shit its jan tuck

worthy yarrow
#

Ah based off your description, you should go listen to big balls by AC/DC

#

I feel like you’d enjoy it

rotund ravine
onyx fjord
#

why would gson skip my enum field in an object even tho i registered an adapter for it?

#

its just a simple enum in constructor

rough ibex
#

gson should have default serde for enums

#

do you need an adapter

onyx fjord
#

i tried without, same result

#
    private transient final FishyBusiness plugin;
    private final String message;
    private final Type type;
    private final double weight;

    public MessageReward(FishyBusiness plugin, String message, Type type, double weight) {
        this.plugin = plugin;
        this.message = message;
        this.type = type;
        this.weight = weight;
    }

my obj

echo basalt
#

why do you need a reference to your plugin in a data object

#

real cursed

#

also why isn' your plugin suffixed by Plugin

onyx fjord
#

thats just how i name stuff

#

i watched some vid back in a day and i just follow how it recommended to name things

onyx fjord
#

what ive sent is just a constructor

echo basalt
#

it's serialized otherwise you wouldn't have the transient keyword tossed in

onyx fjord
#

yea it is serialized, i handled injecting the dependency already tho

echo basalt
#

poor design leading to weird engineering

onyx fjord
#

i aint rewriting the whole thing until it works

echo basalt
#

you could also avoid that (although regrettably) by just having a singleton

onyx fjord
#

yea i dislike that tho

echo basalt
#

I dislike half the shit you did to avoid a singleton

#

-10 aura vs -2 aura

rough ibex
#

maybe try SerializedName?

onyx fjord
#

i kinda wish gson just throwed exception without being goofy and just ignoring everything

onyx fjord
rough ibex
#

try it and anyway

young knoll
#

Try it and anyway

#

:)

rough ibex
#

yuore right

onyx fjord
#

still the same

#

btw the enum is an inner class

#

in case thats important

gilded forge
#

Is there any way to add "can_place_on" data to an ItemStack on 1.21?

#

itemMeta.setPlaceableKeys() is removed

#

only i found is to modify the nbt of ItemStack

#

but they changed nbt to component

#

brain dead xP

remote swallow
#

it might not have been added to spigot yhet

gilded forge
#

too bad 💀

hard socket
#

does EntityRegainHealthEvent get fired when the player heal from regen potion?

remote swallow
gilded forge
gilded forge
carmine mica
#

I pinged you in another discord server LoliColleen. those methods were added back

eternal night
#

^ typing

humble tulip
#

nullable*

inner mulch
#

because the player can move their head

#

which also calls the event

#

therefore there is no getTo

chrome beacon
#

I do believe there is

#

the yaw and pitch changes

gilded forge
#

i found both the two places calling PlayerMoveEvent

#

toLocation are not null

eternal night
#

Well 😅 PlayerTpEvent has a nullable to

gilded forge
#

oh

#

btw i found that if an entity is riden, it cant be teleported

#

it even doesnt call an event

onyx fjord
gilded forge
#

so, if you add anything mounting on a player, they cant be teleported any more

onyx fjord
#

ill get back to it later

gilded forge
#

maybe we should add a PlayerPreTeleportEvent?

ancient forge
#

what is the best java version to use on 1.21?? should i got java 21 or 22?

gilded forge
#

sure

#

u need java 21

#

i think the newer one is better 💀

eternal night
#

I'd go with 21

#

22 is known to have some issues (at least on windows)

gilded forge
#

I didn't update java21 until I couldn't play the latest version of minecraft

#

Then I found all plugins on my PC are broken

#

That was a disaster

onyx fjord
#

omg i figured out the issue

#

🤦‍♂️

#

parent object already has a field named "type"

#

so gson overrided the one related to messagetype

#

because the other one was last in serialization

#

can i make it complain by throwing exception if that happens?

#

i much rather prefer an exception

#

instead of just plainly ignoring every rule

restive mango
#

How do you fake teleporting a player or otherwise make it seem as though they are somewhere else than where they are (camera-wise)?

onyx fjord
#

spawn a clone npc at original location, set gamemode to spectator, teleport

restive mango
#

eh

#

but then wouldn't i have to like

#

listen to see if the clone gets punched by someone else, stuff like that?

ancient forge
#

is there a way i can set an itemname into like a gradient with like rgb birdflop or do i just have to do CHATCOLOR.BLUE and that

rough ibex
#

using chatcolors will restrict it to 0-f

ancient forge
#

so is there a way i can just make it so i can copy and paste the rgb birdflop or no?

rough ibex
#

birdflop?

ancient forge
#

never heard of it?? basically it gives you like the &3 and all that colors to make gradient names

onyx fjord
#

Use the proper output format on birdflop

#

And copy and paste it

#

Or use a library like mini message or mine down

#

Birdflop supports exporting to mini message

chrome beacon
#

Spigot 1.18.1 added the new PlayerProfiles class, which finally allows us to use custom heads without needing any reflection! You can obtain them as normal items, or actually place them down into the world. I’ll show you how both works: Creating a new PlayerProfile First, we gotta create a new PlayerProfile object. To do so,...

rain moss
#

Is there an efficient way for a workaround to that sign editing bug in 1.20+ with waxed and unwaxed signs?

river oracle
#

What bug

river oracle
wet breach
#

Lol

lost matrix
#

What do you use for dependency management? Maven or Gradle?

raw epoch
#

hello ! (I'm on 1.21)

do you know why sometimes my boat takes the right vector and then stop immediately ? 9/10 times it just slide (as wanted)

public void boostBoat(Boat boat) {
    if (this.boatBoost <= 0) {
        return;
    }
    Bukkit.broadcastMessage("boost" + boatBoost);
    Vector direction = boat.getLocation().getDirection().setY(0).normalize();
    Vector currentVelocity = boat.getVelocity();
    Vector boostVector = direction.multiply(2 * this.boatBoost);
    Vector newVelocity = currentVelocity.add(boostVector);
    boat.setVelocity(newVelocity);
    this.boatBoost = 0;
}

Thx for help 🙏

agile anvil
dawn flower
#

how would i allow snakeyaml to combine configurationsections and strings?

root:
  - "test"
  section:
    - "idk"
  - "blah"```
with 2 methods to get string list (like the one in spigot) which filters the sections and returns "test" and "idk" or get the configuration sections which returns "section"
#

or maybe extend the yamlconfiguration by spigot

torn shuttle
#

there's this guy

#

who is using freeminecraftmodels to make transformers in minecraft

#

he's been doing it for months

shadow night
#

damn

dawn flower
#

the animation looks cool but that looks like anything but transformers

shadow night
#

Looks like my dїck on fridays

torn shuttle
#

but yeah I swear he's been doing this since like january or something

shadow night
#

Damn

torn shuttle
#

it's gimbal lock

#

damn it

#

I hate that

#

I thought I fixed that bug

pseudo hazel
#

gimbal lock 💀

smoky anchor
#

💀

#

You ever heard of quaternions ? :D

brittle geyser
blazing ocean
#

he CAN just do that

brittle geyser
#

Why?

blazing ocean
#

cus he's the overlord of help-dev

brittle geyser
#

Why do you think like that

blazing ocean
#

those are facts

#

amirite @torn shuttle

torn shuttle
#

do I even need to dignify this with an answer

torn shuttle
tardy delta
#

transformers, robots in disguise ™️

torn shuttle
#

not sure what is up with that

#

at least I thought so

smoky anchor
torn shuttle
#

I don't even want to look at that code right now

#

that's going to be another month of my life right there

smoky anchor
#

I believe you gotta do all animation rotation calculations with quaternions

torn shuttle
#

I wish the joml library had just worked for this

#

for some reason it was not doing the math right

#

I think I might've since sort of figured it out but I don't know that my heart can go through that again

smoky anchor
#

I have managed to load and correctly display Blockbench animations with my own render engine.
And I have no idea how matricies or quaternions work, used joml for all that shit

torn shuttle
#

I know it has to be possible

#

I think part of the problem when I was first doing it had to do with the root bone

#

and how some specific models are grouped

#

like there was a problem with rotations if you didn't make a rotationless root bone for the model

smoky anchor
#

Ooohh
That sounds like a big flaw

torn shuttle
#

yeah I only figured that one out after like over a month of slamming my head against it

#

the problem isn't getting animations working it's getting every possible configuration of animation working

#

like making root bones with a default non-0 rotation would seriously mess it up

#

or having several root bones

#

now I just add my own core bone via code to make sure there is a proper world-oriented bone in there for the matrices to actually work

#

but uh it didn't occur to me while I was trying to use joml

smoky anchor
#

Since you're doing everything on the CPU, you should be able to just multiply the transform matrices with the proper offsets and rotations recursively for every frame of the animation.
I believe that was how I did it (when I had no idea how to properly make animations work)

torn shuttle
#

that is basically how I am currently doing it, mostly because I had half a mind to implement animation blending which I have since reconsidered

#

I'm probably just going to end up caching positions into an array and play it back though

potent atlas
#

Hi guys! Quick question, has anyone got an example of detecting a sheep's color? I have a EntityBreed event giving me a sheep entity like so
if (event.getEntity() instanceof Sheep)
Sheep sheep = (Sheep) event.getEntity()
but sheep.getColor() is not available

river path
#

Has anyone tried to use moshi (https://github.com/square/moshi) in a bungee plugin before?
I am getting some cryptic errors, and moshi doesn't seem to be able to deserialise java records

Maybe does bungee do anything with records and classloading?

#

I've been able to determine that my moshi instance does have the record adaptor factory, it is just not using it for some reason.

lost matrix
potent atlas
#

Would it be ok if I paste my whole event code somewhere?

potent atlas
#

ok thanks

lost matrix
wheat cedar
#

just not as a plugin

river path
#

It does support classes, it reliably serialises it in a standalone project

lost matrix
#

Ah i see, they do classpath scanning to infer the constructors

potent atlas
wheat cedar
#

and does it compile anyway?

#

because that definitely exists

wheat cedar
# lost matrix What exception do you get?
java.lang.AssertionError
    at net.mangolise.deps.moshi.ClassJsonAdapter.fromJson(ClassJsonAdapter.java:210)
    at net.mangolise.deps.moshi.internal.NullSafeJsonAdapter.fromJson(NullSafeJsonAdapter.java:41)
    at net.mangolise.deps.moshi.JsonAdapter.fromJson(JsonAdapter.java:70)
    at net.mangolise.commons.messaging.datagrams.DatagramParser.deserialize(DatagramParser.java:52)
    at net.mangolise.commons.messaging.datagrams.StagedDatagram.deserialize(StagedDatagram.java:12)
    at net.mangolise.mangee.Main.onEnable(Main.java:31)
    at net.md_5.bungee.api.plugin.PluginManager.enablePlugins(PluginManager.java:266)
    at net.md_5.bungee.BungeeCord.start(BungeeCord.java:298)
    at net.md_5.bungee.BungeeCordLauncher.main(BungeeCordLauncher.java:67)
    at net.md_5.bungee.Bootstrap.main(Bootstrap.java:15)
potent atlas
#

spigot api 1.21 and yes there are no other errors

lost matrix
#

AssertionError??

river path
#

And it is trying to make the record field modifiable, which it can't

lost matrix
#

Does your record implement any interfaces?

wheat cedar
#

where you have customItem = new HealthScroll(3); you are creating a new instance of the item and then decrementing the counter for that only, which means it resets every time you use it

river path
#

record QueuePlayer(UUID player, String game) implements Datagram { }

lost matrix
#

Hm, show how you create an instance of Moshi

wheat cedar
tardy delta
#

isnt moshi kotlin?

wheat cedar
#

kotlin and java interop

tardy delta
#

i can only find a ClassJsonAdapter.kt

wheat cedar
#

it's half java apparently

potent atlas
lost matrix
#

Honestly moshi is the last serialization API i would think about using in a spigot project

potent atlas
#

it does?! hmm :/

tardy delta
#

nice impl

#

ig they gave up

wheat cedar
river path
#

No that's the pre-java16 one

tardy delta
#

ye

tardy delta
#

doesnt seem to be swapped then

lost matrix
wheat cedar
#

yes

lost matrix
#

Show pom plox

river path
#
 * This is just a simple shim for linking in [StandardJsonAdapters] and swapped with a real
 * implementation in Java 16 via MR Jar.
lost matrix
#

What

wheat cedar
#

it's inherited from another dep

#

(being controlled by us)

lost matrix
#

I would try to instantiate the RecordJsonAdapter and call it with a dummy value to check if the right implementation is loaded.

#

I hate this project. Would have never picked moshi. But then again, i think Kotlin is a borderline scripting language that shouldnt be used for bigger projects.

lost matrix
#

Yeap, idk who that is, but he speaks truth

shadow night
#

lmao

wheat cedar
raw epoch
agile anvil
pseudo hazel
#

thats not a yes or no question btw

dawn flower
#

[12:27:38 WARN]: java.lang.NoSuchMethodException: missing.plugins.turboenchants.syntax.sections.TestSection.<init>()
(i used Class#getConstructor)

TestSection extends TurboSection which has a default constructor

smoky anchor
#

getDeclaredConstructor ?
I never remember these things

dawn flower
#

nop

agile anvil
#

Did you declare another constructor?

dawn flower
#

yeah

#
    public TurboSection(TurboSection parent, TurboSection[] children, ParsedElement... elements) {
        this.parent = parent;
        this.children = children;
        this.elements = elements;
    }

    public TurboSection(TurboSection parent, ParsedElement... elements) {
       this(parent, new TurboSection[0], elements);
    }

    protected TurboSection() {}```
agile anvil
#

default constructor is not generated

#

ah

#

you need to make it public

dawn flower
#

ok

#

oh wait the subclasses need to have the default constructor as well

#

i thought it just inherited it

agile anvil
quaint mantle
#

getDeclaredConstructor?

dawn flower
#

it still doesn't work if it's public, i just had to add the default constructor to TestSection

agile anvil
#

Oh, if you declared it in the super class then you have to declare it also in the sub one

#

That's why indeed

dawn flower
#

is there a way to force subclasses to add a default constructor

drowsy helm
#

only through super constructor

maiden thicket
#

does anyone know how to increase the radius a player sees when they are given blindess

#

nms workarounds would also work if possible

smoky anchor
#

I believe only shaders are able to do this

#

So a resourecepack would be needed

maiden thicket