#help-development

1 messages Β· Page 1119 of 1

left heron
#

could someone help my with gradle ? I need to switch a dependency from web to local directly

#

but idk how to do it

lost matrix
onyx fjord
#

peak mockbukkit experience

left heron
#

idk where I should put it and what do I need to change in build.gradle

lost matrix
lost matrix
#

But for some reason you dont want to use that repo?

lost matrix
left heron
#

lets say its a bit broken with the repo

lost matrix
#

Just install it into your local maven repository then

lost matrix
left heron
#

where do I put ur thingy lol ?

lost matrix
#

What you got is pretty much the same

left heron
lost matrix
#

It cant pull fileTree dependencies from anywhere. It wont even try to.

left heron
#

wdym ?

glossy laurel
#

Is it possible to make double jump without nms?

lost matrix
#

Yes, i dont even know why you would use nms in the first place for that

glossy laurel
#

I dont know any event for space clicked mid air

#

Is there one?

lost matrix
#

PlayerToggleFlightEvent

glossy laurel
#

But that requires double click

eternal oxide
#

Ther eis no event

worldly ingot
#

Or whatever that elytra event is called

eternal oxide
#

You can detect it (to some degree) but its fudgery

worldly ingot
#

EntityToggleGlideEvent, sorry. I was close lol

glossy laurel
#

Ic

#

Thank you

lost matrix
#

Ah makes more sense yeah. And i believe you can allow a player to toggle gliding, even without him having an elytra equipped.

glossy laurel
#

Wait what??

#

How

#

Is it nms?...

#

😭

slender elbow
#

nobody is mentioning nms lol

glossy laurel
#

Right ik

lost matrix
glossy laurel
#

XD

glossy laurel
#

Damn

hybrid turret
#

I got this to register a health obj to a scoreboard:

  private void registerHealthScoreboard() {
    Objective obj = this.scoreboard.registerNewObjective("health", Criteria.HEALTH, ChatColor.RED + "❀");

    obj.setDisplaySlot(DisplaySlot.BELOW_NAME);
    Bukkit.getOnlinePlayers()
      .forEach(player -> {
          Score score = obj.getScore(player.getName());
          score.setScore(Math.round((float) player.getHealth()));
      });
  }

The console throws an IllegalStateException because i'm trying to write to a read-only score.
If I DON'T do that or try-catch it, I (obviously) don't get the error BUT the health is not initially set, wtf?

hybrid turret
#

since you can modify packets you can functionally do anything if it can be done on server end

blazing ocean
#

use a dummy objective for when you wanna manually do that

hybrid turret
#

apparently not? lol

blazing ocean
#

it's weird

hybrid turret
#

it tells me i cant set it but then sets it xD

#

well

#

ig there's an error in the console now 😎

blazing ocean
#

nms handles that

hybrid turret
#

so it tells me i cant but then it still does?

blazing ocean
#

nms can

hybrid turret
#

yeah i mean

#

bukkt tells me i cant

#

but nms still sets it

blazing ocean
#

yeah you CAN but you're not allowed to

hybrid turret
#

well guess i gotta live with that ugly stack trace in my console now

blazing ocean
hybrid turret
#

why?

#

if it does werid garbage that get's fixed with a stack trace i'll leave it

blazing ocean
#

if it throws an error it should most certainly not continue the method execution

hybrid turret
#

not my fault nms is garbage

blazing ocean
#

...but you're not using nms

hybrid turret
#

how else should I do it then?

hybrid turret
blazing ocean
blazing ocean
hybrid turret
#

why does it update then even tho there's an error

blazing ocean
#

it shouldn't

#

?stash

undone axleBOT
hybrid turret
#

it does

slate siren
#

@lost matrix I set the world min y limit and when it reached the limit specified with OnplayerMove I killed it with player.sethealt 0 but there is a problem

blazing ocean
#

hm ah yes

hybrid turret
#

hmmmmmmmmmmm

shadow night
slate siren
#

I think I need to integrate it but I have no idea to be honest

#

andd

blazing ocean
slate siren
#

min limit

blazing ocean
hybrid turret
#

i did that

#

then it didnt update anymore

blazing ocean
#

i wanna check nms code rq

hybrid turret
#

?paste

undone axleBOT
hybrid turret
blazing ocean
#

where is it

hybrid turret
#

huh

shadow night
blazing ocean
hybrid turret
#

πŸ€·β€β™‚οΈ

brittle geyser
#

Hello my kotlin friends.
I need to use kotlin from another plugin in my plugins, how to correctly configure gradle?

#

what should i do

blazing ocean
#

relocate the stdlib

brittle geyser
#

what, how

blazing ocean
#

relocate the kotlin package

brittle geyser
#

Why

#

i dont think it`ll help

blazing ocean
#

ok then

brittle geyser
#

i dont need another kotlin library in my plugin

#

i need to take stdlib from another plugin and use it without implementation

blazing ocean
#

or you can kotlin("jvm") version "2.0.20" apply false in all other plugins i believe

brittle geyser
#

idk but i use compileOnly it not works

#

compileOnly(fileTree("../libs/compileOnly/"))

blazing ocean
#

...what

brittle geyser
#

i have my api here, but gradle can`t find them

blazing ocean
#

wdym 😭

brittle geyser
#

i have my api plugin with kotlin in compileOnly directory

brittle geyser
blazing ocean
#

why are you compileOnly'ing a plugin again

brittle geyser
#

but it not works

brittle geyser
#

with kotlin

#

then i have another plugin

#

for example skyblock

blazing ocean
#

...why are you shading plugins me dumb

brittle geyser
#

what i should do

blazing ocean
#

have them on your server?

#

wait me dumb

blazing ocean
brittle geyser
#

and i need to use my api kotlin plugin too

brittle geyser
#

i have 2 kotlin plugin, api and skyblock.
In skyblock kotlin plugin i need to use api kotlin plugin, but it not works

remote swallow
#

because you shade it so its different in both

brittle geyser
#

what

#

why i cant use my kotlin api plugin with compileOnly

slate siren
#

Guysguys

#

Now I set a Y min limit and when it falls there the player dies and is instantly teleported to spawn but when teleporting the player looks like he is falling from a height

#

Player loses 1 heart

#

Why might it have happened? I couldn't find it. πŸ€”

slate siren
eternal oxide
#

you are takign fall damage, so either you hit the groiund before teleport or you are teleporting before zeroign velocity so you take damage when landing at spawn

wintry dagger
#

if i wanted to do a simple anticheat in 1.21

#

would some packet lib like protocollib be best? or make my own packet reader

vague dawn
#

Hey yo, some tips/tricks when creating arenas using 2 corners? Like coding it, what do u recommend?

vague dawn
#

I mean some useful things? I hope u get what i mean, English is not my Native

eternal oxide
pure dagger
#

does location.toVector() just makes like a vector from 0 0 0 to location coordinates? i dont understand vectors perfectly yet

blazing ocean
#

it just makes a vector of the xyz

#

so Location{x=5.0, y=2.0, z=-3.0, ...} becomes [5.0, 2.0, -3.0]

pure dagger
#

yeah so like it would be a vector form 000 to 5 2 3

#

-3*

#

oh you also missed the -

#

ok i get it i was confused with location.getDirection() wchich also returns a vector

slender elbow
#

yeah cuz locations also store yaw and pitch, that direction is the one returned by getDirection as a vector

#

that's just gonna be a point on a sphere

pure dagger
#

direction() is a vector with direction the same as player direction with length 1
toVector() is vector from 0 0 0 to players location, length varys

#

i kinda dont know if i get that

slender elbow
#

well, the length is gonna be the distance between those two points (0 to player pos)

#

it'll vary as the player moves around

pure dagger
#

ye

slender elbow
#

yeah

pure dagger
#

soo... vector made of location and vector made of direction

#

anyone knows why this SOMETIMES gets me some exception? it tells me that x is 0 or infinite or something like that, and because i dont understand vectors so well i dont know how to fix that and whats wrong

player2.getLocation().toVector().subtract(player.getLocation().toVector())
                    .normalize()
                    .multiply(1.5)
                    .setY(0.5);
player2.setVelocity(vector); //exception here

and what i was trying to do is push player 2 from player 1

torn shuttle
#

okI give up I actually need help

eternal oxide
#

give teh exact exception. We can;t work on something like that

torn shuttle
#

for some reason my main class of my shaded library isn't updating

#

when I modify it

#

but other classes are

eternal oxide
#

IJ moment

kindred valley
#

Help him?

slender elbow
torn shuttle
#

it's infuriating

eternal oxide
#

clear caches and restart. and clean build

torn shuttle
#

I have cleaned, invalidated caches, restarted

#

none of it worked

#

I'm cleaning both the libarry and the local

kindred valley
#

ide

torn shuttle
#

I am also versioning the library to try to get a clean version

#

I swear it's like it's pulling it from a different place

eternal oxide
#

Ij is a bitch when it messes up. I've seen some had to delete some folder, but mostly just caches and clean package

torn shuttle
#

I swear I must've cleaned but at least 100 times a piece

eternal oxide
#

there is an IJ cache folder in teh project I believe (I don't use IJ).

torn shuttle
#

ok just for a sanity check I'm even decompiling the output

#

and I can see the shaded library does in fact have the stuff I put in it

#

wtf intellij

slender elbow
#

that sounds like a build tool or publishing issue than an ide issue

torn shuttle
slender elbow
#

intellij doesn't compile

torn shuttle
#

the library has the modifications

slender elbow
#

maven/gradle does

torn shuttle
#

sure

#

you know what I mean

slender elbow
#

well no because no amount of trying to fix the ide is gonna fix your broken build setup

torn shuttle
#

except it builds correctly

slender elbow
#

clearly it doesn't if the published library isn't correct

torn shuttle
#

it is correct in what it is actually outputs

slender elbow
#

but the jar that the library consumer consumes isn't correct, so the published jar that it's consuming isn't correct

#

or the build setup of the library consumer is bad

torn shuttle
#

how can the jar I installed not be correct when I can see that it is correct both on the jar that got installed and on the shaded output

rough drift
#

Did you try invalidating caches?

torn shuttle
#

yes, many times

rough drift
#

all of them?

torn shuttle
#

yes

#

you know what I even just went a step further and installed a completely differnt version of intellij just now

#

and did not import the values from the previous version

#

and it's still not doing it right

slender elbow
torn shuttle
#

ok how can that even happen

slender elbow
#

people writing shit build scripts happen

#

there isn't a single maven property or gradle method that fucks up the setup xD

torn shuttle
#

the only thing I have is the most basic shadowjar thing possible in gradle which, to be clear, worked for all changes up until yesterday

#

and I didn't modify it

#

and still works for all changes done not to the main class

#

but it ignores the main class

slender elbow
#

if the published jar is correct then the consumer is somehow bad

#

care to share the actual build script?

torn shuttle
#

?paste

undone axleBOT
torn shuttle
slender elbow
#

is this the library or the consumer?

torn shuttle
#

consumer

#

library is implementation group: 'com.magmaguy', name: 'MagmaCore', version: '4.0-SNAPSHOT'

#

this fking thing, I know what it did

#

I knew this was going to be a problem

#

because magmacore is shaded across multiple of my plugins and because I have an implements on one of those plugins intellij is incorrectly pulling the magmacore version associated to my implementation and not the one associated to the plugin

#

I'm not even sure this is fixable other than keeping them synced

worthy yarrow
#
public void createIslandWorld(){
        WorldCreator creator = new WorldCreator("IslandWorld");
        creator.generateStructures(false);
        creator.type(WorldType.FLAT);
        creator.environment(World.Environment.NORMAL);
        creator.createWorld();
    }```

So I see in the docs that there is a generatorSettings method taking a string and the example usage is: ```{"layers": [{"block": "stone", "height": 1}, {"block": "grass_block", "height": 1}], "biome":"plains"}```
When trying to create an empty world would I just define an empty layers array here?
#

I assume generateStructures just decides whether or not villages/etc are generated

young knoll
#

Make a custom world generator

#

And just leave the class empty

#

Boom void world

worthy yarrow
#

kek that easy eh?

young knoll
#

Yes

torn shuttle
#
package com.magmaguy.magmacore.util;

import org.bukkit.Bukkit;
import org.bukkit.Difficulty;
import org.bukkit.World;
import org.bukkit.WorldCreator;
import org.bukkit.generator.ChunkGenerator;
import org.bukkit.generator.WorldInfo;

import java.io.File;
import java.nio.file.Files;
import java.nio.file.Paths;
import java.util.Random;
import java.util.logging.Filter;

public class WorldLoader {
    /**
     * Generates a world which does not save, does not keep spawn loaded and is a void world
     *
     * @param worldName
     * @param environment
     * @return
     */
    public static World loadVoidTemporaryWorld(String worldName, World.Environment environment) {
        //Case where the world is already loaded
        if (Bukkit.getWorld(worldName) != null) return Bukkit.getWorld(worldName);
        File folder = new File(Bukkit.getWorldContainer().getAbsolutePath());
        if (!Files.exists(Paths.get(folder.getAbsolutePath() + File.separatorChar + worldName))) {
            Logger.warn("File  " + folder.getAbsolutePath() + File.separatorChar + worldName + " does not exist!");
            return null;
        }
        Logger.info("Loading world " + worldName + " !");

        Filter filter = newFilter -> false;
        Filter previousFilter = Bukkit.getLogger().getFilter();
        Bukkit.getLogger().setFilter(filter);

        try {
            WorldCreator worldCreator = new WorldCreator(worldName);
            worldCreator.environment(environment);
            worldCreator.keepSpawnInMemory(false);
            worldCreator.generator(new VoidGenerator());
            World world = Bukkit.createWorld(worldCreator);
            if (world != null) world.setKeepSpawnInMemory(false);
            world.setDifficulty(Difficulty.HARD);
            world.setAutoSave(false);
            Bukkit.getLogger().setFilter(previousFilter);
            return world;
        } catch (Exception exception) {
            Bukkit.getLogger().setFilter(previousFilter);
            Logger.warn("Failed to load world " + worldName + " !");
            exception.printStackTrace();
        }
        return null;
    }

    private static class VoidGenerator extends ChunkGenerator {

        @Override
        public void generateSurface(WorldInfo info, Random random, int x, int z, ChunkData data) {}

        @Override
        public boolean shouldGenerateNoise() {
            return false;
        }

        @Override
        public boolean shouldGenerateBedrock() {
            return false;
        }

        @Override
        public boolean shouldGenerateCaves() {
            return false;
        }
    }
}
worthy yarrow
#

Also what's the modern way to gather world references? I want to avoid Bukkit.getWorld(""), I thought this was uh bad

rotund ravine
#

I mean

#

getWorlds is a thing etc.

worthy yarrow
#

kek

#

Thank you

#

Shoulda worked with worlds prior to this project but eh whatcha gonna do

#

read? nah

glossy laurel
#

uhm, guys, you can run a server with a debugger?

blazing ocean
glossy laurel
#

is this the hammer button?

young knoll
#

All those shouldGenerate methods return false by default anyway

glossy laurel
#

wowzers, it works!

#

that's so cool :D

worthy yarrow
young knoll
#

Not WorldCreator

#

ChunkGenerator

worthy yarrow
#

ah

#

Oh so you mean it's evennnn easier

#

kek

sly topaz
#

has anyone forked MobChip or is there an alternative for it? Considering it was discontinued

ebon hawk
#

Hello, how do I automatically update my plugin files after updating or uploading a new version of the plugin to the Minecraft server?

misty garden
#

Hello, who do you suggest me for the database ?

humble tulip
#

intellij is fucking with me

azure zealot
#

Use Eclipse

sonic goblet
#

Believe there’s a resource post on the forums

worthy yarrow
#

So when creating a world, that world is automatically loaded to memory right? but how is this state treated given no one ever goes to this world and there's nothing technically loading anything... do I have to keep some chunk loaded within the world to maintain this?

proud geode
#

Why i can’t edit my ressource Description there is no Button next to the Report button

wet breach
worthy yarrow
#

Is there a default spawn location for any and every world created?

wet breach
#

yes

#

0,0

worthy yarrow
#

Ah cool ok

slender elbow
#

no, the game will attempt to find a suitable safe spawn location

#

which is quite the expensive operation

worthy yarrow
#

if the world created is void?

pure dagger
worthy yarrow
#
private void initIslandWorld() {
        IslandChunkGenerator chunkGenerator = new IslandChunkGenerator();
        WorldCreator creator = new WorldCreator("IslandWorld");
        creator.generator(chunkGenerator);
        creator.generateStructures(false);
        creator.createWorld();
    }

public class IslandChunkGenerator extends ChunkGenerator {

    @Override
    public void generateSurface(WorldInfo worldInfo, Random random, int chunkX, int chunkZ, ChunkData chunkData) {
    }
}

such as this?

blazing ocean
#

yes

slender elbow
#

provide a fixed spawn location

blazing ocean
#

you don't even need an impl for that tho i believe

slender elbow
#

in the generator

pure dagger
worthy yarrow
blazing ocean
#

yea i just do this

worthy yarrow
#

but alr cool

#

I just assumed that the super had some default impl for chunk gen 🀷

wet breach
wet breach
# worthy yarrow if the world created is void?

it is recommended that at the default spawn location you put a platform otherwise you might cause issues with people forever dying in the void and making it really difficult to escape that XD

worthy yarrow
#

This world is not supposed to have an actual spawn

#

Just a container world for islands

wet breach
#

maybe put one just in case?

blazing ocean
#

it drastically speeds up worldgen

#

if you set one

wet breach
#

anyways you should always plan for something unexpected, while players are not supposed to end up there I can forsee someone having perms or ability to change worlds just seeing thatt world and going to it

worthy yarrow
#

fair enough

slender elbow
blazing ocean
worthy yarrow
#

was planning to enforce world borders around peoples island regions

#

Not that world borders ever stopped anyone

#

.setWorldBorder in player is uhhh what would you say packet based? ie: fake world border essntially?

young knoll
#

Yes

worthy yarrow
#

awesome

wet breach
#

which is how I have always known it as well

blazing ocean
#

try comparing worldgen time without the getFixedSpawnPosition method implemented (blankly) and without it

young knoll
#

The game searchs for a valid block to place the world spawn on

worthy yarrow
young knoll
#

Which is mostly natural blocks like grass, sand, etc

young knoll
#

Smh read the docs!!!1

worthy yarrow
#

I know I know

#

but smart people are here

wet breach
worthy yarrow
#

Might as well get some help while I'm here πŸ˜„

slender elbow
wet breach
#

since you know spawn point is saved in NBT of the world

slender elbow
#

if you consider creating a world loading it for the first time

#

this only runs when the level is init'd for the first time

grim hound
#

uh

slender elbow
#

hu

grim hound
#

does anyone know how I can use a .jar file from my pc as a library using Kotlin Gradle?

wet breach
#

Ah alright, still quite dumb to have though maybe there should be some kind of setting for it

remote swallow
slender elbow
#

i mean you can skip the search by overriding getFixedSpawnLocation in your ChunkGenerator

#

isn't this noted in the javadoc for WorldCreator? πŸ€”

wet breach
#

have no idea but good to know I suppose

grim hound
slender elbow
#

in keepSpawnInMemory

remote swallow
#

how do you not know what maven local is

grim hound
#

I am uneducated

#

xD

#

learning stuff as I go

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! πŸŽ‰

grim hound
grim hound
#

"no idea what you mean I just wanted the links"

young knoll
grim hound
worthy yarrow
#

He'll probably always blame it on "Inconvenient timing"

grim hound
#

well I guess some people are just

#

very self-unaware

#

you only realise it in the future

wet breach
kindred valley
#

?paste

undone axleBOT
kindred valley
worthy yarrow
#

Shadow don't be mad frost sent it from a friendly context I'm sure

grim hound
#

aaaand he doesn't care whether he's offending someone most of the time

#

anyway, I started my intelliJ, and it just stopped performing highlighting checks

#

and this blue bar popped up

worthy yarrow
#

why would that have to be your problem tho

remote swallow
#

reload gradle

grim hound
remote swallow
#

wait for it to finish

grim hound
#
e: file:///C:/Users/Kubia/Desktop/client/eclipse/SuperCrates/build.gradle.kts:51:5: Unresolved reference. None of the following candidates is applicable because of receiver type mismatch: 
public val NamedDomainObjectContainer<Configuration>.compileOnly: NamedDomainObjectProvider<Configuration> defined in org.gradle.kotlin.dsl
grim hound
#

;]

grim hound
#

but still no highlights

#

and no debug even during build

#

it usually says a lot of stuff

tardy delta
#

ay another kotlineer

grim hound
#

bruh intellij

#

tf u mean boi

slender elbow
#

paper sex

blazing ocean
#

"PAPER SEX" mhmm ah yes

grim hound
#

just 'disabled

grim hound
blazing ocean
#

rm -rf .idea my beloved

grim hound
#

do I also invalidate caches?

blazing ocean
#

close ide and rm -rf

grim hound
#

what does that do?

blazing ocean
#

deletes .idea

#

resets your projects ij configs

grim hound
blazing ocean
#

--recursive --force

grim hound
blazing ocean
#

if you have permissions yes

#

doesn't ask for confirmation or anything

grim hound
#

nice xd

#

yeah I just deleted .idea and restarted the IDE

#

but still no highlight

blazing ocean
#

ij regenerates that while it's running

#

so close it, delete .idea, reopen

grim hound
#

ah okay

#

yeee it works

#

I wonder whether it's because

#

I 'terminate' the process when I open intellij and want to switch to another project

blazing ocean
#

probably some fucked up config or something

pure dagger
#

@slender elbow

torn shuttle
#

di the skull meta trickery change with 1.21?

#

seems like my player heads stopped working at some point

#

mah boy look what they did to mah boy

blazing ocean
#

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,...

torn shuttle
#

wow that's kinda gay

blazing ocean
#

yes very

torn shuttle
#

i c url trickery

#

going to take a wild guess and say I should probably cache it

#

fun question, is stuff like MHF_ArrowLeft still viable?

tender shard
#

sure, aren't those actual player accounts?

slender elbow
pure dagger
#

umm

#

it was illegalargumentexception: x not finite

#

i mean

#

i cannot find it, i have to try to get that again

#

because this wordked, but sometimes didnt for some reason

eternal oxide
#

Your issue is you are tryign to divide by 0

pure dagger
#

umm but how to fix that, when im dividing by 0

eternal oxide
#

show some code and we can probably tell you

pure dagger
#

i showed

eternal oxide
#

where?

eternal oxide
#

show your actual code

pure dagger
#

thats a problem πŸ‘

#

oh

#

wait

#

no i have it

#
public class TestCommand1 implements CommandExecutor { //TODO TEST COMMAND
    @Override
    public boolean onCommand(CommandSender sender, Command command, String s, String[] args) {
        Player player = (Player) sender;
        Player player2 = Bukkit.getOnlinePlayers().iterator().next();
        
        Vector vector = player2.getLocation().toVector().subtract(player.getLocation().toVector())
                .normalize()
                .multiply(1.5)
                .setY(0.5);
        player2.setVelocity(vector);
        return true;
    }
}
#

and its a test soo

#

ignore the way i got player 2 lol

eternal oxide
#

That can;t be the code you are getting the error with

#

You have cut something out or modified it before posting

pure dagger
#

i dont think so

eternal oxide
#

The only way setVelocity will throw an exception for not finite is if you pass in a value divided by zero

pure dagger
#

weird..

#

imma test it again

slate siren
#
@EventHandler
    public void onPlayerDropItem(PlayerDropItemEvent event) {
        Player player = event.getPlayer();
        List<String> flags = getKitItemFlags(player);

        if (flags != null && flags.contains("self-drops")) {
            ItemStack item = event.getItemDrop().getItemStack();
            if (isKitItem(item, flags)) {
                event.setCancelled(true); // Prevent kit item from being dropped

                // Send warning message to the player
                String warningMessage = formatMessage( ChatColor.RED + "You cannot drop this item. Use /trash to remove it.");
                player.sendMessage(warningMessage);
            }
        }
    }```
#

With a single click it gives the same warning 3 times.

eternal oxide
#

single click? Thats a drop item event

slate siren
#

And a little code that prevents this item from being thrown to the ground

#

When I try to throw the item on the ground, it writes the warning message 3 times at the same time

#

And I'm only trying to throw it once

#

It should give only one warning but it gives 3

eternal oxide
#

I'd guess you have created 3 instances and registered them

slate siren
#

@eternal oxidehttps://pastes.dev/9RormztXsU

#

here a

#

code

eternal oxide
#

where do you create your KitHandler instance?

slate siren
eternal oxide
#

No, this is a Listener called KitHandler. you create an instance of this in your main class

slate siren
eternal oxide
#

yes

#

you are double registering

#

that code registers events in a new KitHandler, The KitHandler instance also registers the listener

#

in your main just call new KitHandler(this);

slate siren
eternal oxide
#

just

slate siren
#

i did

#

Normally it would send the warning 3 times, now it sends it 2 times.

eternal oxide
#

then you are also creating another instance in your code elsewhere

slate siren
#

// Initialize KitHandler
new KitHandler(this);
getServer().getPluginManager().registerEvents(new KitRespawnHandler(this), this);

eternal oxide
#

go over your code and find wher you use new KitHandler(this)

worthy yarrow
#

Hey look at that gridding algo works, same with the island structure generation

#

I feel amazing

young knoll
#

Wow maths

worthy yarrow
#

issue: schematic pasting is off, thats fun

#

same calc as the spawn location

young knoll
#

Schematics place from where they were copied from

#

Iirc

worthy yarrow
#

what the fuck is that

#

that is gross

paper viper
#

You have to paste from the origin

#

it doesnt paste automatically in its original place

unique shuttle
#

Hello! I have these methods to get the items needed for a recipe to be crafted, but I don't know how to get the items from a ComplexRecipe. Does anyone know how it works or how I can do it?

young knoll
#

Complex recipes are… complex

#

They can take different amounts and types of ingredients

worthy yarrow
#

That's better

#

Coll's solution won

unique shuttle
subtle folio
#

those last two lines look funny πŸ€”

#

new lombok ??

young knoll
#

wtf

torn shuttle
#

ok so with the new skull meta as of 1.18 is there a way to use a specific player head easily? Seems like it use base 64 skins? I'm so tired that reading the documentation is putting me to sleep

#

or maybe get it from a url or something

eternal oxide
#

client side, or server?

torn shuttle
#

server

#

like I want to use a skin from a specific player

#

I don't know if that's even possible

eternal oxide
#

yes

torn shuttle
#

seems like it should be

eternal oxide
#

all skins coime from Mojang

#

server never has the skins, just a link

torn shuttle
#

how do you get the url that matches the player?

#

also is the server clever enough to cache that

#

I assume no

eternal oxide
#

the skin comes from mojang, you can lookup any player by uuid

torn shuttle
#

but what's the format for that then

#

it's not just dumping the uuid to the url is it

eternal oxide
#

let me open my ide

torn shuttle
#

man I really need to change my diet, I can't live with this energy level

eternal oxide
#

ok, you can get everything from the sessionserver

#

from that you can get teh name and texture id

robust parrot
#

p.getInventory(); IS necessary for plugins that set custom itens on players inventory ?

torn shuttle
#

so just plug a url there right

eternal oxide
#

call that URL with the uuid, then fetch the properties

worthy yarrow
#

Hey elgarl

eternal oxide
#

value and signature are the textures

worthy yarrow
#

How are you doing?

torn shuttle
#

uh which is which?

eternal oxide
#

Properties.value is the Texture. Properties.signature is teh signature

primal mica
#

hi, I want to adjust the weapon durability lost when it hits a mob, how can I manage that?

torn shuttle
#

clearly I don't even know what the signature is for

eternal oxide
#

player skins

#

I don't think you need the signature for skulls

torn shuttle
#

hm

eternal oxide
#

what exactly are you trying to do?

torn shuttle
#

and the texture is the one I would plug into the base64 part of the jett-media method?

#

I just want the menu to have my player head, then the player heads that were supposedly kind default provided by mojang for arrows

#

mhf left arrow or whatever that was

eternal oxide
#

yes, the Texture is a base64 encoded piece of json

torn shuttle
#

what a weird choice

eternal oxide
#

you pull the url from that

torn shuttle
#

hm ok I think I got it

#

any idea about the old mojang default heads

#

I guess they could just be obtained the same way maybe

#

but they used to not require any queries

#

(I believe)

eternal oxide
#

I've not used them

torn shuttle
#

well

#

guess I'll use this method then

#

oh last thing is there a convenient way to look up uuid from name

#

that would be neat

#

(for offline players)

eternal oxide
#

?paste

undone axleBOT
eternal oxide
torn shuttle
#

thanks

lone oracle
#

I have a bunch of runTaskLaters nested (for a countdown + deathmatch timer) but I need a way to clear them all to reset the game.
I have a separate class for /stop which clears all tasks (hopefully) but I need to get all of the tasks' IDs. Does anyone know how to do this? Everywhere online ive looked involves a Task variable but the way I've done this I'm not sure how to do that :/
Thanks :P

Bukkit.getScheduler().runTaskLater(Main.getPlugin(), new Runnable() { @Override public void run() {
for (Player p : activeplayers) {
    p.sendTitle(ChatColor.GREEN + "4", ""); 
}
Bukkit.getScheduler().runTaskLater(Main.getPlugin(), new Runnable() { @Override public void run() {
    for (Player p : activeplayers) {
        p.sendTitle(ChatColor.YELLOW + "3", ""); 
    }
        Bukkit.getScheduler().runTaskLater(Main.getPlugin(), new Runnable() { @Override public void run() {
        for (Player p : activeplayers) {
            p.sendTitle(ChatColor.YELLOW + "2", "");
        }
    }
}```
paper viper
#

Probably a better way to do this is to create your own task manager class and have a schedule method that adds your task to some sort of collection

#

that way you store all your tasks of the current game somewhere

#

and then you can cancel them all at game end

#

Also, you can use lambdas ()-> instead of new Runnable()

torn shuttle
#

where have you been all my life

paper viper
#

Create like a TaskManager class with its own schedule methods and stuff

#

also create like a Set<BukkitTask> in there and everytime you run the schedule method add it to the set

#

then create like a shutdown method that iterates through the set and cancels them all

lone oracle
#

alr tysm

blazing ocean
torn shuttle
#

should be an ide default

#

this shit hides much worse things from you than that

lone oracle
#

ooh cool

#

ty πŸ‘πŸΏ

torn shuttle
#

any idea what the resolution of a mc item in the ui is?

paper viper
#

like an item texture?

torn shuttle
#

yeah in the hotbar and such

paper viper
#

16x16, 32x32, 64x64, etc

torn shuttle
#

yeah I am aware it's a resolution

#

I'm asking which one

paper viper
#

it could be any

#

wdym

#

or do u want the default?

torn shuttle
#

yes, the default

paper viper
#

16x16

torn shuttle
#

you just asked chatgpt didn't you

paper viper
#

no i googled

#

but i may be wrong

#

i can check on mc assets

#

but it is 16x16 after checking on mc assets i believe

torn shuttle
#

I really zoomed in on an item, yeah it's probably 16x16

muted otter
#

16 x 16

paper viper
#

Yep

#

i never use chatgpt

torn shuttle
#

well this is going to hard to make icons for

paper viper
#

chatgpt is ass lmao

paper viper
#

^

blazing ocean
#

you can do anything up to 256x256

paper viper
#

like why would anyone use 16x16 tbh lol

torn shuttle
#

I want to make custom icons for every piece of content in this menu

paper viper
#

it doesnt have to be 16x16

torn shuttle
#

yeah I know

blazing ocean
#

you can just do anything

torn shuttle
#

ok but realistically if I try to fit in a 4k image in there it won't look good

#

I'm just getting an idea of how it would scale based on the current res

paper viper
#

thats not the point lmao

blazing ocean
paper viper
#

16x16 is too small for any sort of detail

torn shuttle
#

lol yeah this is going to go great

#

now at 256x

#

you can really see the pixels

worthy yarrow
#

is that the crab from the crab song

#

crab rave*

torn shuttle
#

I'm sure you can tell it was this all along

worthy yarrow
#

Oh yeah that's what I said innit?

torn shuttle
#

yeah

#

well I definitely will have to go with an abstract representation

worthy yarrow
#

sounds not so fun

torn shuttle
#

I might just outsource it to an artist

worthy yarrow
torn shuttle
#

but it's in the same spirit that they should be showing what they have

worthy yarrow
#

And max you're allowed per slot is 256x256 pixels to play with?

torn shuttle
#

the problem is not the native resolution you can do, it's how small minecraft crushes it to be in the ui

#

you actually need a magnifying glass to see even a fraction of the detail of it at 256x

worthy yarrow
#

hmm

#

Sounds like an issue for sure

torn shuttle
#

it had to be abstract

#

and it's better off done by an artist

worthy yarrow
#

Does that mean delegating pages per design?

torn shuttle
#

what?

worthy yarrow
#

Like one page for each design

#

I've seen a lot of modern servers with those not so vanilla ui designs

torn shuttle
#

it's one icon per piece of content

#

oh you mean like making a full ui size display?

worthy yarrow
#

Yeah

torn shuttle
#

nah I'd rather retain the slot count

worthy yarrow
#

fair enough

torn shuttle
#

like

#

it's already 2 pages long

#

it'd end up 8 pages if I start oversizing these

worthy yarrow
#

tbf I'd think more based on that one pic

torn shuttle
#

plus it would look like nothing if you don't use the pack

worthy yarrow
#

right

#

Not enforcing the pack?

torn shuttle
#

not for my plugins when avoidable

worthy yarrow
#

Optional at least I assume?

torn shuttle
#

it's always encouraged, hell I made Resourcepack Manager didn't I

worthy yarrow
#

Yeah that's right I forget about that

#

Idk why I get you and simple mixed up

#

I think it's because of the dark purple name kek

torn shuttle
#

the metrics lead me to think less than 50% of people currently use the rsp, this will change after this big update push but it's still so low that I definitely don't want to have to rely on it

young knoll
#

Clearly you gotta auto host the pack on the server

paper viper
#

ive been using this to generate my resourcepacks on runtime and its been great

#

it can host em too

#

but i also made my own utility class to auto upload to mcpacks

torn shuttle
#

that's not the primary function of the manager, though it getting a version of that on steroids soon

#

I still have to figure out the details but I really want it to be able to provide unused ids to any plugin that wishes to use it as an api

#

so you can safely build a rsp on top of it without running into overlaps

young knoll
#

Should be fairly simple

#

Just have an atomic int like entities do for their ids

torn shuttle
#

it needs to also account for scenarios where maybe 5 different plugins are queued the build

young knoll
#

Hence the atomic part

torn shuttle
#

i'm not saying it's hard, I'm mostly just trying to think of how I can make it convenient

young knoll
#

I might work on a pack creation api after I finish my hosting api

#

It can host any number of packs on the server without requiring another port

torn shuttle
#

that'd be cool

young knoll
#

(The secret is jank)

torn shuttle
#

I could've guessed that one

young knoll
#

Yeah

paper viper
#

how

torn shuttle
#

he just said how

#

jank

paper viper
#

so its a secret

#

lmao

young knoll
#

Hehe

paper viper
#

well my secret is using other people's public services 😈

young knoll
#

I inject a handler at the front of the netty pipeline that handles the http request from the client

paper viper
#

Oh lmao

young knoll
#

Idk why Mojang doesn’t have this built in

#

It’s actually really easy

paper viper
#

Yeah

torn shuttle
#

it's fine guys I'm sure it will be in the modding tools update we were promised

young knoll
#

Hey at least we have automatic pack merging now

torn shuttle
#

just in time for me to already have done that myself

#

meh it's easy to do anyway

paper viper
#

at least we can send multiple resourcepacks to the client now instead of one

young knoll
#

That’s exactly what I meant

paper viper
#

Ya

young knoll
#

The client handles the β€œmerging”

torn shuttle
#

we love sending data don't we

#

we just send all the data we can

#

even if 80% overlaps

young knoll
#

Meh

#

What’s another 10mb

torn shuttle
#

if I can't fill my 10tb hdd with resource packs then what did I even buy it for

young knoll
#

The client will only cache 10

#

So sadly I doubt that’ll happen

paper viper
#

prolly majority of resourcepack size comes from sound

torn shuttle
#

and yeah it's definitely the sound

#

90% of my rsp is just sound

#

maybe more actually

young knoll
#

That’s why origin realms still has like a < 20mb pack

#

They don’t have many (any?) sounds

torn shuttle
#

if you stick to vanilla resolutions it's hard to actually reach big numbers just with textures and json

#

even if you get wild with it

young knoll
#

Yeah

#

You can always compress the shit out of your sounds like the Pikachu cry in PokΓ©mon yellow

torn shuttle
#

like I used to casually have a png in the resource pack that was several orders of magnitude larger than every actual proper texture in there

#

I still technically do too, I have to optimize my maps

young knoll
#

Imagine you join a server and just hear

torn shuttle
#

how to make your sound 10 bytes

paper viper
#

i know ogg is great but many conversion is so annoying sometimes

#

very good for compression

torn shuttle
#

ogg is trash

paper viper
torn shuttle
#

I don't like compressed audio and I have a very good internet connection

young knoll
#

Stonks

torn shuttle
#

if I had it my way I'd be distributing my audio in a flac format

young knoll
#

Alternatively just split the sounds into a bunch of separate resource packs and dos the client on join

torn shuttle
#

man it's crazy just how much I am procrastinating right now

young knoll
#

I wonder how the client would feel about 10 250mb packs being sent

young knoll
#

Send the entire NES library in a resource pack

#

(For legal reasons that’s a joke, don’t sue me Nintendo)

paper viper
#

ban this kid!

torn shuttle
#

what a great list

paper viper
#

who made that

torn shuttle
#

a genius

paper viper
#

Man it's not even a hashset at least

#

lmao

#

like bro failed

young knoll
#

Those don’t maintain order

#

Well the base HashSet doesn’t

#

What if I need my order!!!!111

torn shuttle
#

one page andy

#

shit

#

I'm off by one

#

two page andy

young knoll
#

I just realized they wrapped the list twice

torn shuttle
#

:)

torn shuttle
young knoll
#

Why does it even need to be mutable anyway

#

Smh my head

torn shuttle
#

imagine the following

#

you have >400 instances of list.of that needs to be mutable

#

but about 550 instances of list.of in total in the code base

#

do you

#

A) spend a week going through each one

#

B) replace all

young knoll
#

C) code better in the first place smh

torn shuttle
#

well buddy if spigot and mojang didn't change the enums for 1.20.6 I would've been fine with them being immutable

#

but suddenly I need a layer that modifies them to a more recent version of the api

young knoll
#

Spigot will do that for you

#

Smh

torn shuttle
#

no?

young knoll
#

Yeah?

#

Spigot updates old enum values

torn shuttle
#

and even if it did it would still cause the same underlying problem with the list being immutable

#

1.20.6 had breaking enum changes for half the shit I use

#

like most potion effects were affected

#

enchants

#

so on

young knoll
#

Yeah those get updated afaik

#

That’s what commodore is for

#

Granted you have to build against the older api for that to work

torn shuttle
#

what a fantastic solution

#

not to mention one that might've not been out when I first started writing this code

young knoll
#

It’s more to support old plugins

torn shuttle
#

who are you calling old

young knoll
#

You

#

Gottem

torn shuttle
#

i'll shank u

#

πŸ”ͺ

young knoll
torn shuttle
#

it's a moot point anyway the whole point of my 9.0 update was to become free of the shackles of other people's libs

#

no more cloudcommandframework no more worldguard/worldedit no more modelengine

#

I'll make my own

paper viper
#

why

torn shuttle
#

because they break shit, they don't update when I update, they deprecate out of nowhere and I have walk thousands of people through problems like reading which download link downloads the correct version of worldguard

#

whereas if I just do it myself I can make sure everything works together and is not confusing to use or install

paper viper
#

so you think you are better than them

torn shuttle
#

yeah that's definitely what I said good job with your reading comprehension

#

it's right below the part where I said I think I might be the next mr beast

#

except more popular

paper viper
#

they break shit, they don't update when I update, they deprecate out of nowhere

#

whereas if I just do it myself I can make sure everything works together and is not confusing to use or install

torn shuttle
#

that doesn't mean I think I'm better than them, that means I think I can make an integrated system that works better than having to rely on several third parties

#

which is not a challenge

#

cloudcommandframework can not reload to any extent, and can not load new suggestions to autofill. This is a trivial thing to implement myself

#

modelengine decided to jump off of spigot and start a new version elsewhere where you have to buy it again

#

I have over 250 tickets of people who failed to install the right version of either worldedit or worldguard or both, in the last 3 months

paper viper
#

well thats just a "not reading enough" issue on their part

#

not your fault

torn shuttle
#

this is such a stupid attitude to have

#

really not only not constructive but actively destructive

paper viper
#

no, because if people cant even install the right version of software is it really the developer's fault?

torn shuttle
#

did you read the part where I said I have 250 tickets with this problem

#

who do you think has to answer those tickets

paper viper
#

then don't answer them and leave them with some automated msg

#

why do you feel you need to solve it

torn shuttle
#

their problem is my problem when they're trying to get my software to run and some dependency doesn't work

torn shuttle
paper viper
#

redirect them to a mini guide on how to install all your dependencies properly, and if that's not enough, then why are they even hosting a server in the first place

torn shuttle
#

you're not going to convince me that I need to start to be shittier towards the people who use and sometimes buy my software so don't even bother trying to make an argument for it

paper viper
#

you don't have to act "shittier", you just send them a mini guide and lead them in the right direction

torn shuttle
#

if something is actively a problem and you can solve it for not only the hundreds of people having the problem but the thousands in the future who will have the problem with just a few hours of work and you decide not to do it I would argue you're being a shitty dev and just overall making a worse experience

paper viper
#

yes but is installing dependencies really that difficult?

torn shuttle
#

yes

#

it is, as it turns out

#

I have literally thousands of support tickets about it

paper viper
#

and i'm guessing you had a guide and everything for it?

torn shuttle
#

I do

#

videos too

#

and a bot

#

and ai

paper viper
#

ok then like

#

its not worth your time to do that tho cause you already put forth the effort to give server owners a chance to learn how to install these dependencies

#

most likely they arent reading those guides

#

or watching those videos

torn shuttle
#

who are you to tell me what is and isn't worth my time

paper viper
#

well that's just my opinion, as you said you can spend your time however you'd like

torn shuttle
#

you seem to be so self-assured this is the correct way of doing things that I'm sure your plugins have millions of downloads

#

must really have a lot of experience

paper viper
#

ok but like users installing dependencies incorrectly is like bruh

#

do you have anything complicated like anything to compile?

torn shuttle
#

md5 should shut this down and make a bot that tells you you're cringe when you need help

young knoll
#

I can fill the role of said bot

torn shuttle
#

hey col can you give me an example using pulse as your target

young knoll
#

I regret to inform you pulsebeat_02, but asking for help is a cringe activity done by cringe people

paper viper
#

lol

torn shuttle
#

you know what @paper viper I think you're on to something now that I'm looking at col's message

#

there's definitely something to it

#

I like it

paper viper
#

In all honestly I do agree with many of your points

#

But i'd take a different approach personally

torn shuttle
#

I'm sure it will be met with lots of success and people loving what you made

ivory sleet
#

on skibidi

restive mango
#

Anyone know the calculations used to determine the position of the sun in the sky in degrees, based on the Minecraft time of day?

echo basalt
#

the sun is actually larger around sun rise / sun set

#

But you want a sin wave iirc

#

so something like an asin(time / 24000 * 2PI) or whatever

slender elbow
#

isn't it linear?

restive mango
#

But it’s not right

#

The sun speeds up and slows down around sunset/sunrise

#

And that’s the problem

torn shuttle
#

I think I've created the least efficient chain of list operations imaginable

#

an accomplishment in pasta

wraith aurora
#

huh

torn shuttle
#

max laziness, all copy pasted and post-patched

wraith aurora
#

real

glossy laurel
#

So as I understand, the difference between Inventory and it's contents is that the inventory has a holder and when you modify the contents it doesnt reflect on the actual inventory?

spare hazel
#

commands:
  sharelocation:
    enabled: true
    permission: ""
  ping:
    enabled: true
    permission: ""

how would i go about getting all of these in a hashmap? i have CommandData but idk how to get these with a FileConfiguration

#

my work is halted till i can fix this

echo basalt
#

getKeys -> loop -> getConfigurationSection

#

is the safest approach

summer scroll
echo basalt
#

you could also just getValues

echo basalt
#

InventoryHolder is mostly used for internals. You shouldn't use it

lofty violet
#

Hello everyone,
I've encountered an issue while developing with Spigot 1.21.1, and I hope someone can help me. Here's the situation:
Problem:
My IntelliJ IDEA can't find the org.bukkit.attribute.Attribute class. It seems all enum classes have become unreferenceable.
Details:

I'm using Spigot 1.21.1
Java version: 21
IDE: IntelliJ IDEA

What I've tried:

Checked and updated all dependencies in pom.xml
Invalidated caches and restarted IntelliJ
Confirmed that the API is in the classpath

Questions:

Could this be related to the enum conversion mentioned in recent Spigot updates?
Are there any specific settings I need to adjust in my project or IDE?
Does Spigot have any special configurations or features that might be causing this issue?

Any help or guidance would be greatly appreciated. If you need any more information, please let me know.
Thank you in advance!

spare hazel
#

hey, im trying to load command data from the config, am i doing this right?

ConfigurationSection commandsSection = config.getConfigurationSection("commands");
assert commandsSection != null;
for(String key : commandsSection.getKeys(false)){
    ConfigurationSection command = commandsSection.getConfigurationSection(key);
    CommandData commandData = new CommandData();

    if(command.getString("permission") != null) commandData.setPermission(command.getString("permission"));
    commandData.setEnabled(command.getBoolean("enabled"));

    COMMANDS.put(key, commandData);
}

how my config looks:

commands:
  sharelocation:
    enabled: true
    permission: ""
  ping:
    enabled: true
    permission: ""
tardy delta
hybrid turret
#

?jd-s

undone axleBOT
hybrid turret
#

hmmm i'm not sure if i'm missing somehting in the docs but since the server tracks advancements via json, can i access that and show the player what e.g. cats they're missing for "a complete CATalogue" or what food they're missing for "a healthy diet"?

pseudo hazel
#

yes

#

but there is also api for it

#

its the criteria of the advancement

frail pilot
spare hazel
#

this does not look right to me:

public class ShareLocationCommand extends BaseCommand {

    public boolean handle(CommandSender commandSender, Command command, String s, String[] args) {
public abstract class BaseCommand implements CommandExecutor {

    private final String commandDisabledMessage = ChatColor.RED + "This command is disabled";
    private final String lackingPermissionMessage = ChatColor.RED + "You are lacking the required permission!";

    @Override
    public boolean onCommand(CommandSender commandSender, Command command, String label, String[] args) {
        CommandData commandData = Survival.getInstance().config.COMMANDS.get(command.getName());

        if(!commandData.isEnabled()){
            if(commandSender instanceof Player p){
                p.sendMessage(commandDisabledMessage);
                return true;
            }

            Survival.getInstance().getLogger().info(lackingPermissionMessage);
            return true;
        }

        if(commandData.getPermission() != null && commandSender instanceof Player p){
            if(!p.hasPermission(commandData.getPermission())){
                p.sendMessage();
            }
        }

        return handle(commandSender, command, label, args);
    }

    public abstract boolean handle(CommandSender commandSender, Command command, String label, String[] args);
}
glossy laurel
#

is there an easy way to run a java snippet inside a running minecraft server?

rotund ravine
#

Easy? Probably not in the way u want

glossy laurel
#

rip

#

XD

#

what's the way though

rotund ravine
#

Well

#

Compile it and run it programaticslly

#

Some JVMs have a javascript engine u can use for easy scripting addition

glossy laurel
#

πŸ‘οΈ πŸ‘„ πŸ‘οΈ

#

so no effect commands like skript?

#

skript was better, smh

rotund ravine
#

No clue about skript or what effect commands are

glossy laurel
#

damn

#

yk skript right?

spare hazel
#

wait a minute

#

you can make minecraft plugins with javascript

rotund ravine
#

I know of skript. We shit on skript

rotund ravine
frail pilot
glossy laurel
glossy laurel
#

effect commands are a thing where you can send a prefix followed by skript code in chat and it runs

frail pilot
#

Otherwise, the only problem is that you never check for null values when you retrieve your command data. If the entry is deleted from the config then you will end up with a npe

glossy laurel
#

shouldn't have touched the config

frail pilot
#

🀷

frail pilot
#

Years told me to never trust server owners

frail pilot
spare hazel
#

btw are these really complicated stacks actually used in big mc servers like? Microservices, Messaging Brokers, Orchestration Tools (Kubernetes)

glossy laurel
#

no responsibility

frail pilot
glossy laurel
frail pilot
glossy laurel
frail pilot
#

I show them warnings

glossy laurel
#

true true

glossy laurel
frail pilot
#

Then I don't respond until they fixed the warnings

glossy laurel
#

getLogger().severe

glossy laurel
glossy laurel
#

I mean they can surely read that right?

frail pilot
#

Apparently when it's red, they read it, but when it's big they don't

frail pilot
#

And they don't read warnings

#

So

glossy laurel
#

he didnt read warning either

#

but

#

he just got like errors

#

and he either ignored them

quaint mantle
#

with serialization with objectoutputstream to a blob, are itemstacks and inventories serializable in that format? also what do you have to do to make your custom class serializable? also are location variables invalid if loaded from a blob?

sorry for the spam of questions. been really intrigued by serialization in this method because in some cases it seems really unnecessary and time-consuming to model everything in tables (like itemstacks, inventories, lore, etc)

glossy laurel
#

or just nuked the code that caused them

#

(dont bully but it was skript)

frail pilot
#

I mean, a server can run even if it spams errors in the console

glossy laurel
#

well

#

depends on the error

frail pilot
#

x)

quaint mantle
#

🀣

frail pilot
#

Actually most of them are fine

vast ledge
frail pilot
#

90% of errors are config errors or npe which occurs on command execs

glossy laurel
#

yeah ik

frail pilot
hybrid turret
#

Load data from the config into a serverdatamanager. do your null checks there and all done

#

only have to do them once

spare hazel
#

i hate when i have to self host a testing mc server on a windows machine.

frail pilot
hybrid turret
#

(i read the messages from before about the NPEs when deleting entries from the config.yml)

frail pilot
hybrid turret
#

never really had any issues, even tho linux is better, yes

glossy laurel
vast ledge
spare hazel
hybrid turret
#

be a bit more objective

frail pilot
#

I mean

spare hazel
frail pilot
#

I like windows for gaming

#

It just works

vast ledge
#

It's pain in the ass, you can't replace server jars in a running server

frail pilot
#

But when you code

#

Nah

frail pilot
#

Linux everyday

hybrid turret
#

Just put the path in the batch file

hybrid turret
#
@echo off
title 1.21.1 Spigot Server
cls
"C:\Program Files\Java\jdk-21\bin\java.exe" -Xmx8192M -Xms8192M -agentlib:jdwp=transport=dt_socket,server=y,suspend=n,address=*:5005 -jar spigot-1.21.1.jar nogui
PAUSE
#

and boom

#

no more path changing

hybrid turret
#

heck yeah

#

title is important 😎

spare hazel
vast ledge
#

Or you could just define the path in your system environment...

hybrid turret
#

windows came a long way since 7 or sum

#

or 8

#

(tbf we don't talk about 8)

spare hazel
#

and bcz i live in a shit country i cant use WSL

glossy laurel
#

but ik wym