#help-development

1 messages ยท Page 1070 of 1

echo basalt
#

Then get-modify-remove

drowsy helm
#

sweet

#

time to do player data handling

#

hopefully gson is fast enough between transfer connection times

lime wave
#

ok, I've been trying very hard and I don't really know how to do that

drowsy helm
#

show us what you've done so far

lime wave
#
private GUIHandler guiHandler;

@Override
    public void onEnable() {
        guiHandler = new GUIHandler();
        Bukkit.getPluginManager().registerEvents(guiHandler, this);



public class GUIHandler implements Listener {
    private final Inventory inv;

    public GUIHandler() {
        inv = Bukkit.createInventory(null, 54, "");
        initializeItems();
    }


Other class:
plugin.getGuiHandler().openInventory(player);
```the other things I tried gave me errors
#

I guess that's the relevant code

lime wave
drowsy helm
#

so you are going to create a new GUIHandler per player right?

lime wave
#

but it needs to be on Bukkit.getPluginManager().registerEvents

drowsy helm
#

so have a inventory manager class which keeps track of all the GUIHandlers and the manager will bne the only one with the Listener

#

then in the listener, loop through all the guihandlers and send the event data

lime wave
#

ok, but when closing the inventory, it should be deleted, right?

#

and how could I handle that?

river oracle
#

When dealing with an API do you guys generally prefer Optional or Nullable as return types

#

I'm kinda conflicted what to use as my standard for non collection types

eternal oxide
#

nullable

young knoll
#

Neither

#

Just always have something to return, duh

river oracle
#

๐Ÿ‘€ coll just throws exceptions

young knoll
#

Jokes aside Iโ€™m fairly used to nullable because spigot

river oracle
#

I'm making my plugin manager rn

#
    @ApiStatus.AvailableSince("1.21")
    @Nullable
    PluginData getPluginData(@NotNull final String name);

    @ApiStatus.AvailableSince("1.21")
    @Nullable
    PluginData getPluginData(@NotNull final Class<? extends Plugin> pluginClass);
kind hatch
#

YESSSSS

#

Since Tags!!!!

river oracle
# kind hatch YESSSSS
    /**
     * Obtains {@link PluginData} of the plugin with the given name.
     *
     * @param name the name of the plugin to get data for
     * @return the plugin data given a plugin with the provided name exists, otherwise null
     * @since 1.21
     */
    @ApiStatus.AvailableSince("1.21")
    @Nullable
    PluginData getPluginData(@NotNull final String name);
eternal oxide
#

could get messy really fast

young knoll
#

Whatโ€™s plugin data

river oracle
#

it definitely will, but its nice

river oracle
young knoll
#

Ah so itโ€™s like PluginDescriptionFile

river oracle
#

yep rn its fairly small I don't wanna expand too fast

#

I just want basic plugin loading I'll figure out a proper bootstrap API later

#

finding out at what stage to load plugins will be the difficult part

young knoll
#

Early as possible

#

Load them before I even launch the jar

river oracle
#

the actual loading will occur before
net.minecraft.server.Main.main(args);

#

but enabling will be difficult for me. I have to actually create a Server interface before I worry about that though

young knoll
#

Iโ€™d just do it after the server is created and before worlds load

#

Or provide an option for before/after world load

river oracle
#

considering I'm using interfaces and not AbstractClass I'm not too worried about improper access to the server or anything. I plan to provide it as a parameter to onEnable and onDisable

young knoll
#

onRegistry
onServerStart
onWorldLoad

#

๐Ÿ’€

river oracle
young knoll
#

Then of course you need onUnregistry, onServerStop and onWorldUnloaf

river oracle
#

I don't need one for the registry or world unload

#

server stop is enough

young knoll
#

Shh

#

Donโ€™t ruin the fun

river oracle
#

kekw

#

now I wonder if I should have the startup methods return booleans to see if the setup is successful instead of delegation to some random static method to shutoff the plugin

#
    @ApiStatus.AvailableSince("1.21")
    default void onInitialize() {
    }

    @ApiStatus.AvailableSince("1.21")
    default void onServerLoad() {
    }

    @ApiStatus.AvailableSince("1.21")
    default void onWorldLoad() {
    }
#

deleting all the javadocs is so much work lol

lime wave
#
import java.util.HashMap;
import java.util.Map;

public class GuiManager implements Listener {
    private Map<Player, GUI> guis = new HashMap<Player, GUI>();

    public void openInventory(Player P) {
        GUI i = guis.get(P);
        if (i == null) {
            guis.put(P, new GUI());
            i = guis.get(P);
        }
        P.openInventory( i.getInv() );
    }

    public void loopGuis() {
        for (int i = 0; i < guis.size(); i++) {
            guis.get(i).???;
        }
    }
```got to this @drowsy helm, but feels wrong
river oracle
# lime wave ```java import java.util.HashMap; import java.util.Map; public class GuiManager...
private final Map<UUID, GUI> guis = new HashMap<Player, GUI>(); // there is no reason for this to not be final field. Use UUID in hashmaps Player instances expire when players leave

public void openInventory(Player player) { // use descriptive variable names and ensure you follow javas naming conventions
  final GUI inventory = guis.computeIfAbsent(player.getUniqueId(), (uuid) -> new GUI()); // collapse into one map operation it looks better
  player.openInventory(inventory,getInv());
 }  
worldly ingot
#

I do wish there were a computeIfAbsent overload that took a Supplier<R> instead of a Function<T, R>

river oracle
#

ik

worldly ingot
#

I like being able to do Type::new instead of ignore -> new Type() ๐Ÿ˜ฆ

river oracle
#

It'd be so nice in that case to just do GUI::new

#

back to mangling together a plugin loader

slender elbow
#

I mean it's not uncommon for the value to also reference its key, e.g. you're using it as some cache loading function

worldly ingot
#

overload Emily. OVERLOAD

#

๐Ÿ‘€

drowsy helm
#

basically like that

#

and watch your naming of variables

#

and don't use Player in a map

#

anyone every tried running hibernate on a plugin?

#

i keep getting this shit despite having jaxb bindings, api and impl

echo basalt
#

But for params it's always nullable

echo basalt
#

pretty sure there was also a putIfNull

river oracle
#

like part of me wants to but also part of me thinks that'll make the API annoying to use

echo basalt
#

I personally have a preference for nullable

#

less lambdas / orElse spam

river oracle
#

plugin loader is gonna make me cry ๐Ÿ˜ญ

lime wave
#
public class GuiManager implements Listener {
    private final Map<UUID, GUI> map = new HashMap<UUID, GUI>();

    public void openInventory(Player player) {...}

    @EventHandler
    public void onInteract(InventoryInteractEvent event){
        for(GUI gui : map.values()){
            gui.onInteract((InventoryClickEvent) event);
            gui.onInteract((InventoryDragEvent) event);
        }
    }
}

public class GUI {
    private final Inventory inv;
    public void onInteract(final InventoryDragEvent event) {
        // logic
    }
    public void onInteract(final InventoryClickEvent event){
        // logic
    }
    // Rest of code
```would something like this work?
#
public final class Main extends JavaPlugin {
    private GuiManager guiManager;
    public GuiManager getGuiManager() {return guiManager;}
    private static Main instance;
    public static Main getInstance() {
        return instance;
    }
    @Override
    public void onEnable() {
        instance = this;
        
        guiManager = new GuiManager();
        Bukkit.getPluginManager().registerEvents(guiManager, this);
```and should it be done like this on main?
drowsy helm
#

you need a new method for each event

lime wave
#

guess I got it then

#

so:

    @EventHandler
    public void onInventoryDrag(InventoryDragEvent event){
        for(GUI gui : map.values()){
            gui.onInventoryDrag(event);
        }
    }
    @EventHandler
    public void onInventoryClick(InventoryClickEvent event){
        for(GUI gui : map.values()){
            gui.onInventoryClick(event);
        }
    }
drowsy helm
#

yep

#

        ClassLoader classLoader = SRPlayerDataManager.class.getClassLoader();
        Thread.currentThread().setContextClassLoader(classLoader);


        this.sessionFactory = new Configuration()
                .configure(new File(this.getDataFolder().getAbsolutePath() + "/" + HIBERNATE_CONFIG_FILE_NAME))
                .addAnnotatedClass(PlayerData.class)
                .addProperties(getHibernateProperties())
                .buildSessionFactory();

this is fucking stupid

stark sierra
#

if I wanted to make a plugin where a player clicks a consumable item and they receive access to a command, what would be the most efficient & organized way to go about it?

I'm just thinking of a system where clicking the item straightup gives them the permission, but i'm not sure if there's another method that would be easier to manage/that people would normally use for this type of thing

echo basalt
#

People usually do this with ExecutableItems / DeluxeVouchers already

#

In short your item has a "voucher id" embedded in it. A voucher consists of an id, item and a list of commands

#

Maybe a cooldown, who knows

#

If you want to be really fancy you can have a list of "actions" that may or may not be a command

#

Maybe it just runs a block of code, who knows

mortal vortex
#

If he wanted plugin suggestions, or wanted for a way to do this without code, he would've asked in #help-server.

echo basalt
#

I.. still provided the steps to do it through code?

#

Berating me for saying the common method that everyone uses brings the same vibe as berating me for saying "competing against luckperms is gonna be tough" to some kid that wants to make his mainstream permissions plugin

mortal vortex
echo basalt
echo basalt
#

You also have the context of "voucher id embedded in the item", which lets you get the voucher data for said item

mortal vortex
#

You literally provided him no help what so ever. The first THREE sentences were about other plugins, NOT developing. You also said:

If you want to be really fancy you can have a list of "actions" that may or may not be a command
Maybe it just runs a block of code, who knows

Which actually has no relevancy to what he said at all.

He's asking, whats the best way to assign a qualifier to a player.

echo basalt
#

By using something like a Map<String, VoucherData>, this is common sense

#

?xy

undone axleBOT
echo basalt
#

You're looking for Y, he's looking for Y but the solution to his problem is pretty much X (a voucher system)

mortal vortex
#

Actually, you're doing that.

#

You're assuming more than there is to it.

echo basalt
#

The vague "action" solution allows him the flexibility to test both an API method for assigning his reward, as well as running a command that does the same

mortal vortex
#

player.addAttachment(CommandAccessPlugin.getPlugin(class), "PERMISSION", true); is sufficient enough

echo basalt
#

It's also a poor solution

mortal vortex
#

He's not asking for info on creating the item. He's asking for info on managing permissions rewarded as a result of some condition.

echo basalt
#

He isn't even sure if he wants to add a permission node or follow some other approach

#

And I'm not even sure if I want to keep going on this stupid unhinged discussion over nothing

mortal vortex
#

k.

wicked sinew
#

has the behavior of a Double changed?
If I go from 0.0, then add with intervals of 0.1, why does it go 0.1, 0.2, then 0.3000000000000000004

#

Ah I see--

buoyant viper
#

floating point inaccuracies go BRRRRRR

wicked sinew
#

Yeah forgot about that one ๐Ÿ˜‚ one of Minecraft's own issues

buoyant viper
#

its really computer fault

#

they should just do math better

echo basalt
#

Not really specific to minecraft

#

It did cause some goofy ass issues

bold rose
#

can anyone explain the diff ?

p.getMetadata("x").clear();
p.removeMetadata("x", myPlugin());
mortal vortex
#

The latter, removes the metadata entry associated with the key "x" for the player object p, but only if the metadata was set by the plugin instance provided (myPlugin() in this case).

worthy yarrow
echo basalt
#

No need to clone when adding items

#

aren't you basically duping items ๐Ÿค”

worthy yarrow
#

Ig the context does say that

echo basalt
#

Also using gui titles for inventory checks?

worthy yarrow
#

Not the point of the function though

#

Just testing a theory and it's working so

#

wanted to know if it could be improved

echo basalt
#

Here's some cursed item comparison checks I've recently done

#

Might be too basic / easy to dupe but that's not the point

blazing ocean
#

pretty sure you can just == on inventories

worthy yarrow
#

I aint got it cached (yet)

echo basalt
#

before you say paper, yes I know eat my ass

blazing ocean
#

i don't get why java doesn't have a builtin operator for .equals

echo basalt
#

== vs ===

#

๐Ÿค”

blazing ocean
#

is === .equals?

echo basalt
#

meanwhile I nuked code width by like 60% by using infix at work

echo basalt
#

in kotlin :)

blazing ocean
#

yea in kt

echo basalt
#

gotta love the uh

blazing ocean
#

but talkign about java here

blazing ocean
echo basalt
#

assignItem(1000) to "crown" item registry at work

blazing ocean
#

haven't found a proper use for it yet

echo basalt
#

automatically registers items in bedrock

blazing ocean
echo basalt
#

nah

#

I made one with the same name

blazing ocean
#

name it diff

echo basalt
#

val MY_CUSTOM_ITEM = assignItem(1000) to "crown"

#

I should but this name fits

blazing ocean
#

don't wanna register stuff when you're just tryna make a map

worthy yarrow
echo basalt
#

THen I have an extension method on uh

#

the backend module

#

so I can do like

#

MY_CUSTOM_ITEM.asBukkitItem()

blazing ocean
#

why not delegate on ItemStack

echo basalt
#

because these items are registered on the uh

#

common module

#

because geyser runs on the proxy

#

and

MY_CUSTOM_ITEM.registerUsage { context ->
  ...
}
blazing ocean
#

class CustomItem(stack: ItemStack) : ItemStack() by stack my beloved

echo basalt
#

:)

blazing ocean
#

geyser moment

echo basalt
#

yeah geyser's ass :(

#

gotta register every item on proxy startup

#

otherwise it shits the bed

burnt current
#

does EntityType still exist?

I tried to create a Npc at the players location with a command

    public boolean onCommand(CommandSender sender, Command command, String label, String[] args) {
        if (sender instanceof Player) {
            Player player = (Player) sender;
            if (player.hasPermission("createNPC")) {
                Location loc = player.getLocation();
                Villager npc = (Villager) loc.getWorld().spawnEntity(loc, EntityType.Villager);
                npc.setCustomName("Click me for a menu!");
                npc.setCustomNameVisible(true);
                npc.setAI(false); 
                npc.setInvulnerable(true);

but Somehow Intellij says "EntityType" does not exist, while "spawnentity" needs a location and an EntityType.
Does somebody know what the problem is?

drowsy helm
rough drift
spiral mist
#

Guys I have no idea why Im getting errors that say "Cannot resolve symbol 'NetheriteScrapHandler'". Its preventing me from continuing my event listener code and im pretty sure everything is fine. This is my main activity file:


import org.bukkit.Bukkit;
import org.bukkit.plugin.java.JavaPlugin;
import test.gpstracker.Handlers.NetheriteScrapHandler;

public final class GPSTracker extends JavaPlugin {

    @Override
    public void onEnable() {
        // Plugin startup logic
        new NetheriteScrapHandler(this);
    }

    @Override
    public void onDisable() {
        // Plugin shutdown logic
    }
}
drowsy helm
#

just restart IDE

#

should be fine

#

and Handler isnt a valid package name

spiral mist
spiral mist
spiral mist
drowsy helm
#

try invalidating caches maybe

spiral mist
#

i also tried that haha

drowsy helm
#

yes it should be loweracse

#

but that sohuldn't matter to the issue

spiral mist
#

i see, so maybe the folder should be renamed

#

oh

#

perhaps its something in the handler file?

drowsy helm
#

yeah your ide shouldnt let you make a package with that name

#

it might think Handlers is a class

spiral mist
#

i renamed it but not much of a change

drowsy helm
#

can you show your project structure

spiral mist
#

Perhaps something in here? Ignore the last few lines with th eventhandler tag. Thats fine


import org.bukkit.Bukkit;
import org.bukkit.event.EventHandler;
import org.bukkit.event.Listener;
import test.gpstracker.GPSTracker;

public class NetheriteScrapHandler implements Listener {
    public NetheriteScrapHandler(GPSTracker plugin){
        Bukkit.getPluginManager().registerEvents(this, plugin);
    }
}

@EventHandler
public void onNetheriteScrapRightClick() {
    
}```
drowsy helm
#

like the overview

spiral mist
#

how would I do that? Sorry im new to IJ

drowsy helm
#

the method is outside of the class

#

are you not getting an error?

#

this view

spiral mist
#

i got it now

#

Thank you so much! I appreciate the help

summer scroll
#

How can I set the glow color of GLOWING potion effect, is that even possible at all?

gray comet
#

iirc it corresponds to the target entity scoreboard team color, but maybe there is another way to set it

distant wave
#

how can i reset item lore to not be italic by default

shadow night
smoky anchor
#

turn off italic
no idea how to do that with legacy, not sure if ยงr works

distant wave
#

doesnt seem to

#

does it

#

?

#

hm

shadow night
#

It did last time I used it

smoky anchor
#

when was your last time tho

#

I recall some changes some time ago :D

shadow night
#

1.19.4, but I believe legacy color codes are still supported by the client

smoky anchor
#

Yes (for now), but there were changes to how reset works I think

summer scroll
smoky anchor
#

yes

summer scroll
#

Alright then, thank you!

dawn flower
#

can you make semi-persistent entities? that is persistent across chunk unloads and loads but not persistent across server restarts

summer scroll
pseudo hazel
#

why would you even need that xD

drowsy helm
#

wtf happened to the int note in NoteBlock interface i dont get how the Note system works now lmao

#

need to study music theory for cusotm blocks

#

like what octave and tone is instrument=chime,note=0

#

and is it flat or natural or sharp

#

wtf

shadow night
#

do you not know music

torn shuttle
#

I know music, it goes dun-dun-dun-tss-tss-dun-tss

drowsy helm
#

no, i do not

torn shuttle
#

sometimes it also goes uhn tiss uhn tiss uhn tiss

#

a reference that will date chat

drowsy helm
#

wait im fucking dumb

#

its constructor takes an int

torn shuttle
#

oh my god I hate hosting repos though sonatype

#

is there something less annoying to deal with

blazing ocean
torn shuttle
#

that sounds even more high maintenance

blazing ocean
#

it's not

#

you create the docker container set it up through the web panel and boom

drowsy helm
#

Anyone know how i can get block material from the int id in Block update packet?

#

wiki mentions some registry that i cant find

smoky anchor
#

NMS should have some protocol id <-> block id map thing

keen charm
#

๐Ÿ‘‹

#

If we modify a player's GameProfile instead of modifying their PlayerTextures and do Player#hidePlayer(); and Player#showPlayer();, does the new skin applies?

#

Or do we have to do it through PlayerTextures?

ivory sleet
#

Afaik PlayerTextures is the only official api

cinder abyss
#

Well, I made version 1.20.5-1.21 of nms requires java 21, but then on the global compilation (that I want to target java 17) I get this error :java C:\Users\paule\Desktop\Spigot\BiomesAPI\src\main\java\me\outspending\biomesapi\nms\NMSHandler.java:68: error: cannot access NMS_v1_20_R4 case "1.20.5", "1.20.6" -> NMS_VERSION = new NMS_v1_20_R4(); ^ bad class file: C:\Users\paule\Desktop\Spigot\BiomesAPI\NMS\1.20_R4\build\libs\1.20_R4-0.0.2-all.jar(/me/outspending/biomesapi/nms/NMS_v1_20_R4.class) class file has wrong version 65.0, should be 61.0 Please remove or make sure it appears in the correct subdirectory of the classpath.

torn shuttle
blazing ocean
#

yea

torn shuttle
#

I have it all set up but I'm having trouble with my first deploy

#

it gives me a could not find artifact

#

do I need to initialize it in the remote before deploying to it or something

blazing ocean
#

how did you publish the artifact

torn shuttle
#

trying to use maven deploy and got the pom setup

blazing ocean
#

show your pom setup

torn shuttle
#

?paste

undone axleBOT
blazing ocean
#

did you use the right credentials etc

torn shuttle
#

yeah

#

it connects

blazing ocean
#

<url>http://magmaguy.com:50001/#/releases</url>

#

wrong url

torn shuttle
#

is it?

blazing ocean
#

it's /releases/

#

not the /#/releases, that's the web ui

torn shuttle
#

u

blazing ocean
#

what

torn shuttle
#

oh shit that was it

#

thanks

#

how do I tell it to do snapshot instead of releases on maven

blazing ocean
#

i don't use maven ยฏ_(ใƒ„)_/ยฏ

torn shuttle
#

yeah

#

I'd rather not as well but it's easier for open source

quiet ice
#
    <distributionManagement>
        <snapshotRepository>
            <id>repoid</id>
            <name>repoName</name>
            <url>repourl</url>
        </snapshotRepository>
    </distributionManagement>

In conjunction with using the -SNAPSHOT prefix

#

But I personally don't use snapshot releases, instead preferring rolling nightly releases

onyx fjord
torn shuttle
#

noice

#

that was actually easier than I thought tbh

#

I haven't really used much of docker before, to keep the docker instance alive do I need to stuff it into a screen?

blazing ocean
#

nah

#

it just runs in the background

onyx fjord
#

create a compose for it ideally so you can destroy and revive at any time

drowsy helm
#

Nope docker just stays alive

blazing ocean
#

even if you restart

torn shuttle
#

how do I re-access it later?

blazing ocean
#

wdym access

#

what do you need access to

torn shuttle
#

console

blazing ocean
#

that's on the website

torn shuttle
#

hm true

drowsy helm
#

Docker attach

blazing ocean
#

but docker container attach (name) iirc

torn shuttle
#

aight thanks

onyx fjord
#

its docker exec

torn shuttle
#

cool, time for lunch

blazing ocean
#

because you need to attach to the running process

onyx fjord
#

you have to specify the container name and the shell

blazing ocean
#

magma just wants access to the reposilite console

torn shuttle
#

ye

blazing ocean
torn shuttle
#

also how come this was easier than setting up sonatype

hard radish
#

anyone know how to take out liberies from artifacts? my plugin is 50mb and it shouldnt be like that

torn shuttle
#

that's wild

torn shuttle
eternal night
#

I mean, if you just want logs, docker logs -f <containerId>

drowsy helm
#

If you remove libraries it wont work

hard radish
#

how do i make it stop shading random shit

eternal night
#

attach does a lot more, if you don#t need to actually attach, don#t attach

drowsy helm
#

Scope provided

blazing ocean
#

show your pom.xml/build.gradle

torn shuttle
eternal night
#

ah

blazing ocean
drowsy helm
#

Magma I really recommend portainer

torn shuttle
#

too late

drowsy helm
#

If you wanna work more with do ker

#

You can run it ontop of docker

hard radish
torn shuttle
#

I'm already happy with how it is now

blazing ocean
#

?paste

undone axleBOT
blazing ocean
#

?whereami too

drowsy helm
#

Why no rad

eternal night
hard radish
#

thats my pom.xml

blazing ocean
torn shuttle
#

it works and that's all I need

drowsy helm
#

No it dont ๐Ÿ˜ฆ

blazing ocean
undone axleBOT
hard radish
torn shuttle
#

and unlike sonatype it will hopefully not break every other month or ask me to either move or create new tokens

onyx fjord
#

and does nothing

blazing ocean
#

๐Ÿคจ

hard radish
drowsy helm
#

No

#

Use library loaders if youโ€™re on new versions of spigot

inner vigil
#
[12:49:16 ERROR]: null
org.bukkit.command.CommandException: Unhandled exception executing command 'bounty' in plugin SpaceCore v1.0
        at org.bukkit.command.PluginCommand.execute(PluginCommand.java:47) ~[purpur-api-1.20.1-R0.1-SNAPSHOT.jar:?]
        at org.bukkit.command.SimpleCommandMap.dispatch(SimpleCommandMap.java:168) ~[purpur-api-1.20.1-R0.1-SNAPSHOT.jar:?]
        at org.bukkit.craftbukkit.v1_20_R1.CraftServer.dispatchCommand(CraftServer.java:1001) ~[purpur-1.20.1.jar:git-Purpur-2062]
        at org.bukkit.craftbukkit.v1_20_R1.command.BukkitCommandWrapper.run(BukkitCommandWrapper.java:64) ~[purpur-1.20.1.jar:git-Purpur-2062]
        at com.mojang.brigadier.CommandDispatcher.execute(CommandDispatcher.java:265) ~[purpur-1.20.1.jar:?]
        at net.minecraft.commands.Commands.performCommand(Commands.java:332) ~[?:?]
        at net.minecraft.commands.Commands.performCommand(Commands.java:316) ~[?:?]
        at net.minecraft.server.network.ServerGamePacketListenerImpl.performChatCommand(ServerGamePacketListenerImpl.java:2447) ~[?:?]
        at net.minecraft.server.network.ServerGamePacketListenerImpl.lambda$handleChatCommand$22(ServerGamePacketListenerImpl.java:2407) ~[?:?]
        at net.minecraft.util.thread.BlockableEventLoop.lambda$submitAsync$0(BlockableEventLoop.java:59) ~[?:?]
        at java.util.concurrent.CompletableFuture$AsyncSupply.run(CompletableFuture.java:1768) ~[?:?]
        at net.minecraft.server.TickTask.run(TickTask.java:18) ~[purpur-1.20.1.jar:git-Purpur-2062]
        at net.minecraft.util.thread.BlockableEventLoop.doRunTask(BlockableEventLoop.java:153) ~[?:?]
        at net.minecraft.util.thread.ReentrantBlockableEventLoop.doRunTask(ReentrantBlockableEventLoop.java:24) ~[?:?]
        at net.minecraft.server.MinecraftServer.doRunTask(MinecraftServer.java:1365) ~[purpur-1.20.1.jar:git-Purpur-2062]
        at net.minecraft.server.MinecraftServer.d(MinecraftServer.java:197) ~[purpur-1.20.1.jar:git-Purpur-2062]
        at net.minecraft.util.thread.BlockableEventLoop.pollTask(BlockableEventLoop.java:126) ~[?:?]
        at net.minecraft.server.MinecraftServer.pollTaskInternal(MinecraftServer.java:1342) ~[purpur-1.20.1.jar:git-Purpur-2062]
        at net.minecraft.server.MinecraftServer.pollTask(MinecraftServer.java:1335) ~[purpur-1.20.1.jar:git-Purpur-2062]
        at net.minecraft.util.thread.BlockableEventLoop.managedBlock(BlockableEventLoop.java:136) ~[?:?]
        at net.minecraft.server.MinecraftServer.waitUntilNextTick(MinecraftServer.java:1313) ~[purpur-1.20.1.jar:git-Purpur-2062]
        at net.minecraft.server.MinecraftServer.runServer(MinecraftServer.java:1201) ~[purpur-1.20.1.jar:git-Purpur-2062]
        at net.minecraft.server.MinecraftServer.lambda$spin$0(MinecraftServer.java:322) ~[purpur-1.20.1.jar:git-Purpur-2062]
        at java.lang.Thread.run(Thread.java:1583) ~[?:?]
Caused by: java.lang.NullPointerException: Cannot invoke "net.milkbowl.vault.economy.Economy.getBalance(org.bukkit.OfflinePlayer)" because "this.economy" is null
        at org.spacecore.bounty.BountyCommand.getPlayerBalance(BountyCommand.java:123) ~[SpaceCore-1.0-SNAPSHOT.jar:?]
        at org.spacecore.bounty.BountyCommand.onCommand(BountyCommand.java:66) ~[SpaceCore-1.0-SNAPSHOT.jar:?]
        at org.bukkit.command.PluginCommand.execute(PluginCommand.java:45) ~[purpur-api-1.20.1-R0.1-SNAPSHOT.jar:?]
        ... 23 more

Does any1 know why i get this Error

hard radish
drowsy helm
hard radish
#

1.20.6

drowsy helm
#

Ready the libraries bit

mint nova
#
Caused by: java.lang.NullPointerException: Cannot invoke "org.bukkit.inventory.ItemStack.getType()" because the return value of "org.bukkit.event.inventory.InventoryClickEvent.getCurrentItem()" is null
if (event.getCurrentItem().getType() == null) return;

Full code

    @EventHandler
    public void onInventoryClick(InventoryClickEvent event) {
        if (!event.getInventory().equals(inventory)) return;
        Player player = (Player) event.getWhoClicked();

        if (event.getCurrentItem().getType() == null) return;

        if (event.getCurrentItem().getType() == Material.GRASS_BLOCK) {
            Location location = new Location(player.getWorld(), -59, 115, 55);
            player.teleport(location);
        }
    }
small current
#

Are armors client-sided?
For example, can a player's inventory show a diamond chestplate but the player itself, show gold chestplate? Even for the player itself

sullen marlin
small current
drowsy helm
#

You can show it to other players but not to the user itself

mint nova
#
if (event.getCurrentItem().getType() == Material.AIR) return;

This will work?

sullen marlin
#

if (event.getCurrentItem().getType() == null) return; ---> if (event.getCurrentItem() == null) return;

pseudo hazel
#

type wont be null

small current
pseudo hazel
#

its either air or the item itself is null

drowsy helm
small current
#

Ok thanks

cinder abyss
#

Hello, in my multi-module gradle.kts project, I made version 1.20.5-1.21 of nms requires java 21, but then on the global compilation (that I want to target java 17 because I've got 1.19-1.20.4 too) I get this error :java C:\Users\paule\Desktop\Spigot\BiomesAPI\src\main\java\me\outspending\biomesapi\nms\NMSHandler.java:68: error: cannot access NMS_v1_20_R4 case "1.20.5", "1.20.6" -> NMS_VERSION = new NMS_v1_20_R4(); ^ bad class file: C:\Users\paule\Desktop\Spigot\BiomesAPI\NMS\1.20_R4\build\libs\1.20_R4-0.0.2-all.jar(/me/outspending/biomesapi/nms/NMS_v1_20_R4.class) class file has wrong version 65.0, should be 61.0 Please remove or make sure it appears in the correct subdirectory of the classpath.

How can I fix that ?

Here's my source code :
https://github.com/Paulem79/BiomesAPI

GitHub

Create Custom Biomes in Spigot / PaperMC! Contribute to Paulem79/BiomesAPI development by creating an account on GitHub.

shadow night
#

Compile everything against java 8

#

Or if you are only above 1.17 java 17

sullen marlin
#

you just need to use java 21, you don't need to target it

cinder abyss
small current
cinder abyss
shadow night
cinder abyss
#

okay, let's try that

pseudo hazel
#

yeah my 1.19 version is still made with java 21

slender elbow
shadow night
#

I usually have 3 jdks (one for 8, one for 17 and one for 21) I wonder if they are useless (besides 21) when I can always just set the source and target version

sullen marlin
#

java 21 doesnt support java 8 as a target

slender elbow
#

yes it does

cinder abyss
#

looks like it's working..

slender elbow
#

via the preferred release flag

shadow night
hard radish
#

quick question... do you guys do regular build or do build artifact?

sullen marlin
#

sorry misread, it doesn't support java 7. Looks like java 8 still survives

shadow night
#

Isn't java 8 still supported because of lts

hard radish
#

maven

pseudo hazel
#

dont you just build in both cases?

drowsy helm
#

Package

cinder abyss
#

it's working thanks ๐Ÿ˜„

hard radish
#

cus build artifact is giving me the 50mb version

#

ohhh i see

#

yeah i tried regular build and now my plugin is reduced to 50 kb

shadow night
pseudo hazel
#

my ass is using gradle for 2 months and already forgot its called package on maven ๐Ÿ’€

hard radish
#

yessir lol

drowsy helm
#

Your plugin wont work

#

Unless youโ€™re using library loading

shadow night
#

Shade using the maven shade plugin

hard radish
#

i have it in plugin.yml library

drowsy helm
#

Ah nice

shadow night
#

neat

#

I should get my own maven repo sometimes later lol

drowsy helm
#

And omg itโ€™s so much better than maven lol

shadow night
#

@shadow night is an idiot

pseudo hazel
#

the fact its not xml makes already 3x better

gilded granite
#

how can I make local database like standalone

drowsy helm
#

Use sqlite

gilded granite
#

Like without any program

#

only the plugin

drowsy helm
#

You want to host a db server on the plugin?

gilded granite
#

yeah

hybrid turret
#

I assume a Player during the AsyncPlayerPreLoginEvent would be null?

drowsy helm
#

Either use sqlite or host one

hybrid turret
#

sqlite probably?

#

yea

#

sqlite is not much different compared to just files tho

gilded granite
#

how does plugin like essentials have local db

#

?

hybrid turret
#

mc version?

drowsy helm
hybrid turret
#

oh-

eternal oxide
hard radish
#

is this how i would unshade some dependencies in gradle? via ShadowJar

    dependencies {
        exclude(dependency('org.mongodb:mongodb-driver-sync:5.1.2'))
        exclude(dependency('org.mongodb:mongodb-driver-core:5.1.2'))
        exclude(dependency('org.mongodb:mongodb-driver-legacy:5.1.2'))
        exclude(dependency('com.sk89q.worldedit:worldedit-core:7.2.0'))
        exclude(dependency('com.sk89q.worldedit:worldedit-bukkit:7.2.0'))
    }
}```
hybrid turret
#

i don't get what you mean reeachy, sorry

hybrid turret
#

isn't CraftBukkit NMS which was just accessible in 1.8?

drowsy helm
#

In dependencies

hard radish
#

oh i was thinking way too complicated lol

shadow night
#

compileOnly - won't be shaded
implementation - will be shaded

shadow night
hybrid turret
#

oh wait right

#

i'm a dumdum

#

i was thinking of CraftPlayer which is part of NMS, no?

shadow night
#

CraftPlayer is craftbukkit

hybrid turret
#

ummm okay maybe i'm stupid

shadow night
#

NMS would be PlayerEntity or ServerPlayerEntity

#

?stash

undone axleBOT
hybrid turret
shadow night
# hybrid turret ummm okay maybe i'm stupid

NMS - Minecraft Code (net.minecraft.server package)
Bukkit - An API which is mostly made up of interfaces, which is made available to the user
CraftBukkit - An implementation of Bukkit that uses NMS

hybrid turret
#

yea i was a lil confused lmao

#

how do i send a respawnpacket to apply a changed skin?

#

or better asked: how to i apply a changed skin that's shown to everyone on the server?

clear elm
#

how can i perform a console command

shadow night
#

My favourite thing is the hierarchy

Bukkit 
   |
CraftBukkit
   |
Spigot
   |
Paper
   |
Tunity
   |
Purpur

Iirc

hybrid turret
shadow night
#

Or wasn't tunity seperate?

slender elbow
#

tuinity doesn't exist anymore lol

#

it was merged into paper, like, 3 or 4 years ago

clear elm
hybrid turret
#

tf is tunity and purpur. did i miss some chapters?

drowsy helm
#

Where does pandaspigot play into this

shadow night
#

Am I so old

hybrid turret
drowsy helm
shadow night
hybrid turret
#

Bukkit#dispatchCommand i believe

So: Bukkit.dispatchCommand(executor, "command with arguments");

drowsy helm
shadow night
#

You should likely never need to dispatch a command

shadow night
hybrid turret
#

np :))

drowsy helm
#

Pretty sure Purpur has a lot of nice api stuff for custom functionality like blocks and entities n shit

#

But never looked into it

hybrid turret
shadow night
hybrid turret
#

use maven instead of gradle kekw

shadow night
#

Tf are you doing

drowsy helm
#

You need to run bt with craftbukkit flag

hybrid turret
# shadow night what

i mean it would be a very specific scenario tbh, but with some time i could think of one lmao

shadow night
#

Just use the spigot artifact?

#

It has bukkit, spigot, craftbukkit and nms

hybrid turret
#

Like an inventory for just dispatching commands

#

i use that actually lol

shadow night
#

The api has the methods for executing things

river oracle
#

That's not true

shadow night
#

It does

river oracle
#

Wtf wrong reply

river oracle
hybrid turret
#

Italian??

#

oh

#

lmao

river oracle
hybrid turret
#

from its to italian is crazy

river oracle
#

But I'm so bad at typing on my phone I can't turn it off

shadow night
#

Then the source is weird but cb has always been reloxated

hybrid turret
#

damn. i turned it off from the beginning and just learned to type
(and since the keyboard still does "suggestions", that's fine)

river oracle
#

That isn't your account right?

#

Nms on girhub is very illegal

#

12 years wtf

hybrid turret
#

what kinda...

#

please get spigot from official sources lol

kind hatch
#

Does order matter in gradle?
Cause it should be searching mavenLocal() first right?

eternal oxide
#

order does matter

drowsy helm
#

Yeah searches same as maven

hard radish
#

?paste

undone axleBOT
dawn flower
#

how do i check if a chunk is inside location x and y

#

you fork it

#

so it becomes a fork of pandaspigot of a fork of paper of a fork of spigot of a fork of bukkit

hybrid turret
#

git moment

dawn flower
#

you can just import it from git into intellij

#

directly

#

i never tried modifying a server software but i think u need to do something called patches first

shadow night
dawn flower
#

yes

#

it's on 1.8.8

#

ffs

#

i think git handles that

#

oh

dawn flower
#

u can just take the modified code

dawn flower
#

git does that

#

i think

#

so uh

#

u basically go on intellij idea

#

then click get from VSC

#

alr

#

when u open lmk

#

no

dawn flower
#

click on github then login

#

it cant be on an already existing project

#

click Close Project

#

now go on github

#

oh

#

it's doing the same for me

#

jsut click on repo url

#

now paste it

#

1 sec lemme get u the link

#

add that then clone

#

clone

#

yeah

#

you will find a folder called Patches, that's the code right there to avoid the stupid rule by mojang

#

i have no fucking idea how to do the patches

#

intellij tells u i think

#

and y'll have a button or something

#

but y'll need to repatch, which i think takes like 50 minutes

#

blame mojang

#

good stuff

#

wait how did u bypass patching

chrome beacon
#

More like 5 min

dawn flower
#

someone said it took 50 mins to patch paper

blazing ocean
#

just not true

chrome beacon
#

They gotta be running a 20 year old cpu or smth

dawn flower
#

17 should be enough

eternal night
#

21 is where 1.20.5+ lives

dawn flower
#

then 22

blazing gyro
#

What packet is used to create the per player placeholder?

dawn flower
#

placeholder?

eternal night
sullen belfry
#

how can i get a Offline player?

dawn flower
#

POV: using an rtx 4090 on a 50$ monitor

sullen belfry
#

                OfflinePlayer mob = 
                skullMeta.setOwningPlayer(mob);
dawn flower
sullen belfry
#

so i can get their skull

dawn flower
#

Bukkit.getOfflinePlayer("Bob")

sullen belfry
#

is that not deprecated?

dawn flower
#

everything in bukkit is deprecated, just ignore it

chrome beacon
#

it's deprecated for a reason

#

and removal is not it

dawn flower
young knoll
#

No it isnโ€™t

#

Thatโ€™s paper

blazing ocean
#

stop lying

drowsy helm
#

In paper

dawn flower
#

ah

#

anyways my point is there r alot of deprecated stuff

chrome beacon
chrome beacon
young knoll
#

Paper is allergic to strings

chrome beacon
#

not that much deprecated in spigot tbh

blazing ocean
slender elbow
blazing ocean
#

that's because minecraft uses components since 2013

eternal oxide
#

Stringphobic

dawn flower
blazing ocean
#

nope

dawn flower
#

yep

#

strings are doing pretty well imo

drowsy helm
#

There are many

dawn flower
#

hover, click events and hex and some other wacky stuff

drowsy helm
#

Key components

#

Translatable

#

Fonts

blazing ocean
#

fonts

dawn flower
#

too bad i dont use these

smoky anchor
#

Wonder what you will do when your legacy strings get actually removed

dawn flower
#

u can use fonts?

chrome beacon
#

yes

blazing ocean
#

bro ๐Ÿ’€

dawn flower
#

since when

smoky anchor
#

since like 1.13

blazing ocean
#

when they added fonts

dawn flower
#

fonts as in unicodes

drowsy helm
#

โ€œI dont use the features, so that must mean itโ€™s uselessโ€

#

Yes unicode fonts

chrome beacon
dawn flower
#

just get it from the internet or somethhing

blazing ocean
#

yes resource pack fonts

dawn flower
#

lazy people

blazing ocean
#

huge skull emoji

chrome beacon
#

have you never seen a custom texture gui

#

That's done using a custom font

dawn flower
#

i saw alot

blazing ocean
dawn flower
#

UNICODES

#

u just said its unicodes

blazing ocean
#

???

drowsy helm
#

Wot

#

??

blazing ocean
#

unicodes are just characters

slender elbow
#

lmao

wet breach
#

unicode itself isn't a font

dawn flower
#

แดœ แดแด‡แด€ษด ๊œฐแดษดแด› สŸษชแด‹แด‡ แด›สœษช๊œฑ?

slender elbow
#

yeah let me download \u1234 real quick

drowsy helm
#

Download the rams from the computer

dawn flower
#

bro u jsut said its unicodes ๐Ÿ˜ญ

dawn flower
blazing ocean
#

fonts can do a lot more than just unicodes

dawn flower
#

ic

#

can it generate server performance

#

if not then its useless

wet breach
#

in order for a character to be displayed on a system using a particular font type, it must exist as a character in that style. Otherwise if it doesn't you get them nice fancy squares

blazing ocean
#

you are useleses

chrome beacon
wet breach
#

all a character is in terms of displaying is a picture of said character

dawn flower
#

ic

#

ima try fonts

#

how do u do this

drowsy helm
#

So you dont use any of the benefits of components

#

Then say they are useless

smoky anchor
blazing ocean
#

and now want to use them

#

kekw

dawn flower
#

no one told me fonts exist

wet breach
#

knowing this, you can technically replace characters with whatever your wanted. IE Wingdings is an example

blazing ocean
#

technically you can just do that

drowsy helm
smoky anchor
#

MC has inbuilt enchanting font, that's fun too

dawn flower
#

its asking for a key

#

do i give it my house keys

blazing ocean
#

well yeah

#

that's your font key

blazing ocean
dawn flower
#

i dont have one

wet breach
drowsy helm
#

Lmao

wet breach
#

we need to spread it more, we are almost at that point where its normal to use pictures

dawn flower
#

someone give me a font key

eternal oxide
#

I only saw him say "strings are doing pretty well" not that components are useless

dawn flower
#

n o w

smoky anchor
young knoll
#

Wait there isnโ€™t a font that make server go faster?

#

Why not

dawn flower
#

fr

smoky anchor
#

noone PRd one

drowsy helm
#

โ€œI hate components and they are dumbโ€ - MissingReports

drowsy helm
#

He just deleted the message so I cant @ it

dawn flower
#

fake

#

no proof

eternal oxide
#

I never saw it so I'll have to agree with MissingReport ๐Ÿ˜‰

dawn flower
#

my boy

#

cough

young knoll
#

I mean, most of the time colors and basic strings are enough

dawn flower
#

so what were we talking abt

young knoll
#

But yes fonts and clickable/translatable components can be quite useful

dawn flower
#

i was doing great without knowing fonts

drowsy helm
#

Im gonna submit a pr to java to delete the string class

dawn flower
#

they both seem useless

smoky anchor
dawn flower
#

how do u make a component

#

its asking me for a component to make a component

pseudo hazel
#

adventure component?

dawn flower
#

yes

pseudo hazel
#

Component.text("whatever")

blazing ocean
dawn flower
#

im lazy to read

dawn flower
eternal oxide
#

WHAT? .text takes a String. Depreciate that shite

young knoll
blazing ocean
#

adventure cancelled

blazing ocean
drowsy helm
young knoll
smoky anchor
dawn flower
#

hate to break it to u string haters, but at the end components become strings

drowsy helm
#

Oh choco got a place?

blazing ocean
#

the packets use components

dawn flower
#

components are just json text

#

they do the same thing

smoky anchor
blazing ocean
#

no shit

dawn flower
#

and json text is string

drowsy helm
dawn flower
#

my friend

blazing ocean
dawn flower
blazing ocean
dawn flower
#

where is the font key that someone sent

smoky anchor
#

illageralt I think

blazing ocean
#
Minecraft Wiki

The font is the typeface that Minecraft uses. It was first added in Java Edition Classic 0.0.2a and has seen many revisions and additions since.
Its design has been present in all ports of the game.
In Java Edition, the fontโ€™s name is Minecraft Seven. It contains 2,426 characters. Multiple fonts can be defined and referenced with resource packs.

dawn flower
#

how do u send a component

blazing ocean
#
sullen belfry
#

does anyone know how i can get the a offline players skull?

        ```case CHICKEN:
            OfflinePlayer mob = Bukkit.getOfflinePlayer("MHF_Chicken");
            skullMeta.setOwningPlayer(mob);
            skullMeta.setDisplayName("Skull of " + entityType.name());
            break;```
drowsy helm
#

Need to get audienxe

#

Then send

dawn flower
#

where do u get audience

blazing ocean
# sullen belfry does anyone know how i can get the a offline players skull? ```cas...

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

drowsy helm
#

Fuck

sullen belfry
#

thanks

drowsy helm
#

Beat me ๐Ÿ˜ฆ

dawn flower
#

its asking for audiences to make an audience

blazing ocean
#

haha

eternal oxide
dawn flower
#

bro adventure api is so confusing

blazing ocean
#

Bukkit.spigot() is a thing?

dawn flower
blazing ocean
#

kek

young knoll
#

Not really

blazing ocean
dawn flower
#

yes really

#

u need to create an array and stuff

young knoll
#

The building isn't super different from adventure

dawn flower
#

and do sorcery

#

on it

smoky anchor
young knoll
#

there's no array anymore

smoky anchor
#

Noone else look there tho, it is not the prettiest thing

dawn flower
smoky anchor
#

Eeey, what did I tell you

dawn flower
#

how do u make a md5 component

chrome beacon
dawn flower
#

it says it needs an array

sullen belfry
dawn flower
#

u lied!!!

#

i just tried fonts

#

they did 0 difference

#

kekw

blazing ocean
#

then you didn't use them properly

dawn flower
#

excuses

blazing ocean
#

no way bro reacted with โฌ‡๏ธ ๐Ÿ’€

dawn flower
#

fonts are just bad, u dont want to admit

#

to all font lovers, i'm jk

#

ima dip now

#

wait

#

i didnt even do what i came here to do

#

how do i check if a chunk is inside location x and y

eternal oxide
#

don;t you mean the other way around?

#

oh two locations

#

min/max of location chunk coords

cinder abyss
#

Hello, I use io.github.patrick.remapper (latest 1.+ version), it remaps classes, etc., but looks like it doesn't remap fields :log [14:58:15 ERROR]: Error occurred while enabling MoreBiomes v1.0 (Is it up to date?) java.lang.NoSuchFieldError: BIOME at me.outspending.biomesapi.nms.NMS_v1_19_R3.unlockRegistry(NMS_v1_19_R3.java:100) ~[MoreBiomes-gradle-1.0.jar:?]

When using (mojmaps) Registries.BIOME but on spigot runtime, it's Registries.an

How can I fix that ?

#

Here's my 1.19.4 module gradle.kts :```kts
plugins {
id("io.github.patrick.remapper") version "1.+"
}

dependencies {
compileOnly("org.spigotmc:spigot:1.19.4-R0.1-SNAPSHOT:remapped-mojang")

compileOnly(project(":NMS:Wrapper"))

}

tasks.remap {
version.set("1.19.4")
}

tasks.build {
dependsOn(tasks.remap)
}

java {
toolchain {
sourceCompatibility = JavaVersion.VERSION_17
targetCompatibility = JavaVersion.VERSION_17
}
}```

shadow night
#

use gooler's remapper or whatever it was called

#

or wait wasn't that shadow

#

nvm

#

too many gradle plugins on my mind

blazing ocean
#

silly raydan

cinder abyss
shadow night
#

but well, sounds like a skill issue to me

cinder abyss
#

bruh

#

Here's my main build.gradle.kts :

#

@shadow night

#

okay wtf

#

this api is made with the ass, clearly

#

the core is using nms, so my project depending of this api need to use nms too

#

(to access classes like ResourceLocation)

#

but then it remaps the api to the version specified by the project using it, so I can only run at version 1.19.4 because of this fucking core

#

wtf this creator has done

#

nah that's wild

#

I just, can't work with that

mortal hare
#

i swear to god, i will forget how this works in couple days:

for input_file_path in $input_file_paths; do
    output_file_path="$(echo "$input_file_path" | sed "s/$(escape_forward_slash $input_path)/$(escape_forward_slash $output_path)/")"
    verbose_execute echo "Attempting to interpolate given variables in input file path: $input_file_path"

    verbose_execute echo "Copying input file path ($input_file_path) contents into temporary file path: $temp_file_path"
    cp "$input_file_path" "$temp_file_path"

    input_file_interpolation_variables=$(echo $interpolation_variables $(sed -n "s/.*\${\(.*\)\:=\(.*\)\?}.*/\1=\2/gp" "$temp_file_path"))

    input_file_interpolated=false
     for interpolation_variable in $input_file_interpolation_variables; do
        key=$(escape_forward_slash "${interpolation_variable%%=*}")
        value=$(escape_forward_slash "$(echo "$interpolation_variable" | sed -n 's/[^=]\+=\?//p')")

        echo "$key=$value"
        latter_interpolation="$(verbose_execute sed -n "s/.*\(\${$key\(:=.*\)\?}\).*/\1/p" "$temp_file_path")"
        if [ -n "$latter_interpolation" ]; then
            echo "Interpolating $latter_interpolation variable in input file path: $input_file_path"
            input_file_interpolated=true
        fi
        
        sed -i "s/\${$key\(:=.*\)\?}/$value/g" "$temp_file_path"
    done

    if $output_interpolated_only && ! $input_file_interpolated; then continue; fi

    verbose_execute echo "Copying processed input file contents into output file path: $output_file_path"
    mkdir -p "$(dirname "$output_file_path")"
    if $force_override_output; then
        cp "$temp_file_path" "$output_file_path"
    else
        cp -i "$temp_file_path" "$output_file_path" < /dev/tty
    fi
done
blazing ocean
#

what the fuck

quiet ice
#

Ask ChatGPT to create documentation for you, someone would tell

mortal hare
blazing ocean
#

i have seen

runic pine
#

how i get color map by Block instance? I need to change the colors according to the height too to identify mountains

river oracle
#
    @Deprecated(forRemoval = true)
    private PluginData readPluginData(@NotNull final InputStream stream) throws IOException {
        try (final BufferedReader reader = new BufferedReader(new InputStreamReader(stream))) {
            final List<String> data = reader.lines().toList();
            final Class<? extends Plugin> pluginClass = (Class<? extends Plugin>) Class.forName(data.getFirst());
            final String name = data.get(1);
            final String version = data.get(2);
            final PluginApiVersion apiVersion = PluginApiVersion.fromString(data.get(3));
            return new PluginData(pluginClass, name, version, apiVersion);
        } catch (ClassNotFoundException e) {
            throw new RuntimeException(e);
        }
    }``` 
Wow the best plugin data file implementation???
river oracle
# blazing ocean wtf.

I don't want to add a config library yet, but I need some mock data to load plugins from

#

this will do until I add a config library

tardy delta
river oracle
#

there is no reason for it not to be final

tardy delta
#

ahgahioskajiusja

river oracle
#

bro is mad my compile time is 20 nanoseconds faster than his

tardy delta
#

would even make it worse

#

more work for the lexer

#

anyways

slender elbow
#

final should be the default but java is full of terrible defaults

subtle folio
#

ok rust

worldly ingot
#

No because that's how we end up with keywords like non-sealed :(

slender elbow
#

rust ๐Ÿ’€

runic pine
slender elbow
worldly ingot
#

Hell, unsealed would have been better. Who tf puts hyphens in a keyword

#

Even C++ doesn't do that

quiet ice
worldly ingot
#

Yes

slender elbow
#

haven't you heard of sealed types?

#

i love sealed types

worldly ingot
#
public sealed interface A permits B {}
public non-sealed interface B extends A {}
slender elbow
#

a type extending a sealed type must be either sealed, final, or non-sealed

quiet ice
#

I only use Java 8 language features, for good reasons as it seems like

slender elbow
#

sealed types are actually goated af

worldly ingot
#

They're very useful

#

But also very easy to make terrible API decisions lol

slender elbow
#

You're very useful

worldly ingot
slender elbow
#

But also very easy to make terrible API decisions lol

#

runs

worldly ingot
slender elbow
#

i'm sorry

#

i love you

quiet ice
#

Sealed types generally aren't the way I'd design my API around

slender elbow
#

i mean

#

it depends on the api

#

it's just discriminated unions

quiet ice
#

They can be useful in cases like spigot, but in the case of spigot you can't do that because the implementation is in another artifact

worldly ingot
#

It would be useful for recipes

slender elbow
#

instead of union JsonElement = JsonObject | JsonArray | JsonPrimitive | JsonNull you have sealed JsonElement permits JsonObject, JsonArray, ...

worldly ingot
#

Though fwiw, yes, Bukkit would have a difficult time making use of sealed types

#

Read-only types are a great use case though

slender elbow
#

i don't really see it about disallowing people from extending a type, but rather, you have a hierarchy of data types that just go together

worldly ingot
#

Yeah. Like an enum where there can only be so many exhaustive options

blazing ocean
chrome beacon
#

lombok val

slender elbow
#

more like lombok bad

#

haha

blazing ocean
#

real

slender elbow
#

get it?

blazing ocean
#

lombok is bad yes i get it

torn shuttle
#

uh how do I update the gradle version that IJ is running

#

ah found it

#

might be time for me to remove the cobwebs from my build.gradle as well

runic pine
#

@Override
public void render(MapView mapView, MapCanvas mapCanvas, Player player) {

    WorldMap worldMap = new WorldMap("map_" + mapView.getId());

    if (!a) {
        for (int x = 0; x < 128; ++x) {
            for (int y = 0; y < 128; ++y) {
                mapCanvas.setPixel(x, y, worldMap.colors[y * 128 + x]);
                System.out.println("x: " + x + "; z: " + y + "; " + mapCanvas.getPixel(x, y));
            }
        }

        a = true;
    }

}
#

why the color returned is 0?

slender elbow
torn shuttle
slender elbow
#

skill issue

lyric hearth
#

hi! how to access to nms? I mean, adding Spigot Server (not only API) to dependencies in order to use nms

chrome beacon
#

?nms

chrome beacon
#

^ if you're using maven

lyric hearth
#

thanks

sterile breach
#

Someone know why I can't compile in inteleji? (I can't click I see "the file in the editor is not runable")

tardy delta
#

youre about to run a file then

sterile breach
#

what file meaned?

opal carbon
#

just the same as default but silly

#

?

sterile breach
quiet ice
opal carbon
#

yeah but whyyy

opal carbon
#

why did they make non-sealed a thing tho

#

why cant it just be normal

slender elbow
#

making non-sealed the default when extending a sealed type sounds like a terrible disastrous default

quiet ice
#

Security/Integrity by default

slender elbow
#

what if you just forgot to make it sealed or final lmao

tardy delta
#

just dont make anything sealed and call it their fault when someone breaks it

opal carbon
#

ong

#

kotlin classes being final by default is nasty imo

river oracle
#

Not really

#

You don't extend most classes

patent adder
#

It doesn't have much to do with it, but I have a question, remember how to load the dependencies to be able to use different versions if necessary, the logic is created, but I can't recover them, I'm using gradle
These are, from 1.7 to 1.13, everything works 100% but it doesn't solve this, I don't remember if I had to configure a gradle for each one, but I remembered it differently, but it doesn't work, if anyone here is good with that, please give me a hand

chrome beacon
#

It's recommended to use multiple modules for different versions

#

That way you can keep the dependencies separated

patent adder
cold pawn
patent adder
#

But it's not even the important thing, I don't know why I can't recover them by importing the jars, that's why my doubt โ˜๏ธ

river oracle
#

also just a little fun fact only the largest patches were fixed for log4j back to 1.8

chrome beacon
#

I don't think 1.7 and older uses log4j

#

could be wrong though

slender elbow
#

it does

chrome beacon
#

nvm it does*

#

yeah I just checked

slender elbow
#

and mojang didn't update to put the {nolookup} in its xml

#

big troll

chrome beacon
#

1.6.4 seems to be missing log4j though

slender elbow
#

idk up to what version mojang backported the nolookup addition

chrome beacon
#

so did they just skip 1.7?

slender elbow
#

i know they did for 1.12

hexed bluff
#

Any hcf devs dm me

iron glade
#

Hello, I was wondering if it is allowed to trim one of my premium plugins or disable some features and offer it as its free version?

blazing ocean
undone axleBOT
hexed bluff
#

It says I gotta make 20 post I need a dev urgently

blazing ocean
#

what even is hcf

hexed bluff
#

Hard core factions

chrome beacon
torn shuttle
#

FAILURE: Build failed with an exception.

  • What went wrong:
    Execution failed for task ':compileJava'.

error: invalid source release: 21
thoughts

#

I'm thinking this caused it

java {
sourceCompatibility = JavaVersion.VERSION_21
targetCompatibility = JavaVersion.VERSION_21
}

shadow night
#

are you sure you are using jdk 21

torn shuttle
#

yeah

chrome beacon
#

Make sure gradle is up to date

#

and that jdk 21 is set in intellij project settings

torn shuttle
#

I just did, hang on I think one of my shaded systems is on a later version and that's why

#

seems like it right

#

wait tf

#

oh no intellij is really losing it

wooden zodiac
#

hey. I uploaded my very own plugin in spigot website but i made little mistake while uploading and now i cant find edit option anywhere to fix those mistakes

chrome beacon
#

enable 2fa

torn shuttle
#

oh my god

wooden zodiac
torn shuttle
#

why does intellij need 15 different places to define the version I am compiling with

wooden zodiac
chrome beacon
torn shuttle
#

I did

slender elbow
#

java toolchains :3

chrome beacon
#

where did you change it then?

torn shuttle
#

gradle's wrapper was set to 17 in a place I didn't even know existed

chrome beacon
#

so not an intellij issue

#

just a gradle moment

torn shuttle
#

it is insofar that imo there should be a centralized place to set the version you want to compile with

slender elbow
#

there is

chrome beacon
#

toolchains

slender elbow
#

it's called java toolchain and release flag

#

idk why people keep using source/target

wooden zodiac
#

i did enable 2fa but it still did not open to edit post

eternal oxide
keen charm
#

Hey folks

#

When I send a REMOVE_PLAYER packet, go away from the removed player and come back to that player again, the player becomes invisible

#

But when I did a sysout to all packets sent and received from a client's side, I never saw ClientboundAddEntityPacket in logs

#

So what packet should I use?

river oracle
#

On the forums

remote swallow
#

I love when people delete their messages

torn shuttle
#

java.lang.IllegalArgumentException: Unsupported class file major version 65
give me a break

slender elbow
#

xd

torn shuttle
#

this time it's internal to the same project

slender elbow
#

imagine using outdated shadow

torn shuttle
#

I'm on 8.1.1

#

am I tripping?

chrome beacon
#

you need to use goolers shadow fork

torn shuttle
#

brah

chrome beacon
#

The old shadow isn't maintained anymore

slender elbow
#

:3

torn shuttle
#

ah yeah cool I always did think we needed more sonic