#help-development

1 messages · Page 924 of 1

sand spire
#

Can you show the setPackageClaimed method, if it saves the time

quiet ice
#

Where do you set the lore?

twin venture
sand spire
twin venture
#

that's the problem 😦

#

it should say 24 hours .. etc and count down

sand spire
#

yeah

#

so remove days

quiet ice
#

Does it count up now?

#

Or is it constant?

sand spire
#

its never more than 24hours so the first tick could just be 24 hours right

twin venture
#

i want it to count down .. and its constant

sand spire
#

But its 1 day so you don't need to display the days

twin venture
#

there will be diffrent

#

pakages

#

some are monthly , some are daily

quiet ice
#

Dump the unix time and check which time it represents (plenty of online tools exist for that)

twin venture
#

some are random

sand spire
#

if thats the case, your hours will probably break too once it reaches 0

twin venture
#

the package i claimed is daily , so it should be 24h .. 23h , 59m , 59sec ..

#

etc

#

and go down from there

quiet ice
#

I'd unit test getNextClaimTime

#

Although it probably works from very rough manual testing

floral drum
#

The reason why it's doing that is you need to subtract System.currentTimeMillis() from it if I'm coprrect @twin venture

quiet ice
#

However, I'd say the Duration#between has the arguments flipped, as @floral drum mentioned

#

As System.out.println(getNextClaimTime(LocalDateTime.now().minusDays(2).toEpochSecond(ZoneId.of("UTC").getRules().getOffset(Instant.now())) * 1000, "DAILY")); returns PT-42H-25M-49.782S or -152749782

#

Leading to negative numbers, which may break your math

#

Actually, in that case it would say it is expired?

sand spire
quiet ice
#

Meh, I still recommend to unit test everything left and right, especially those neat standalone methods that could very well be static

sand spire
#

because 1 / 10 is 0.1 which is greater than 0 so you're never getting negative numbers calculating the days

#

just numbers between 0-1

quiet ice
#

That is not how longs work in java

floral drum
#

I feel that

sand spire
quiet ice
#

longs, by definition are integers

#

(though longs are 64-bit integers where as ints are 32 bit)

sand spire
#

Isn't it obvious that a number will never become negative unless you subtract or multiply by a negative number (i mightv missed some i'm not a math pro)

slender elbow
#

long integers

sand spire
#

hmm

quiet ice
#

The only floating-point primitive units we have are double and float.
And there are no fixed-point primitives in java land.

Now there are a few other numbers such as BigDecimal, but they are not primitives

sand spire
#

I'm still convinced the problem in this screenshot is that they're checking if amount > 0

#

it should be if (amount >= 1)

quiet ice
#

amount > 0 is better compared to amount >= 1 due to performance reasons

sand spire
slender elbow
#

strings are not primitives

quiet ice
#

Well I am purely talking about bytecode primitives. How the compiler treats them is another story I am not qualified to argue about

slender elbow
#

despite string literals being a thing

quiet ice
slender elbow
#

and string template literals in the future 🤔

quiet ice
#

I am genuinely curious

sand spire
quiet ice
#

(excluding 0 and 1 if you are willing to treat between as that)

quiet ice
#

And integers are whole numbers such as -1, -2, -3, 0, 1, 2, 3, etc.

#

But most notably they cannot represent all rational numbers - so 1.5 or 3/5 or 3.14 or 2.72

sand spire
#

Ah I see i'm confusing the datatypes long can't have stuff after the comma

slender elbow
#

all ints are signed ints, java does not have unsigned types

quiet ice
#

I have no clue what the actual definition of whole numbers are, I am not english

slender elbow
#

it's just "integers"

#

?

sand spire
#

because for the code to work it should always round down to 0 if its less than 1

quiet ice
#

It always rounds down to the nearest number to 0 iirc

#

(grammar 100)

sand spire
#

yeah then I have no idea what is wrong with killer's code i give up gg

slender elbow
#

yeah but the returned long will still ever be treated as signed, that's just going to set up the bits correctly, the arithmetic in the language will be signed

quiet ice
#

In the reference implementation, BigInteger constructors and operations throw ArithmeticException when the result is out of the supported range of -2^Integer.MAX_VALUE (exclusive) to +2^Integer.MAX_VALUE (exclusive).

#

However, that is an implementation detail

#

not too bad?

#

Though idk what the first four fields are used for

echo basalt
#

what if they used longs instead of ints

#

BigBigInteger

#

It's prob some 32 bit jvm limitation

quiet ice
#

most likely not

slender elbow
#

in two 32 bit batches

#

but like

#

we're in 2024

#

not 2004

quiet ice
#

Some 32 bit CPUs support some 64 bit operations, just like some 64 bit CPUs support some 128 bit operations

slender elbow
#

i mean

quiet ice
#

What? if it works it werks

slender elbow
#

clearly it works

#

:Clueless:

deep herald
#

anyone know how to set a translation in bungeecord

quiet ice
#

because noone wrote it

#

Or noone deemed it to be a usecase that requires it to be present in the java language

slender elbow
#

the only thing you'll be able to run on it is stupid web apps on windows given that electron is basically the only thing that has 32 bit builds

slender elbow
#

idk

sand spire
#

Does anyone know how MongoDB works in the background? If so, will the eq in collection.find(eq("fieldName", "value")); search through the entire database and cause lag or will it magically get that document without reading everything

quiet ice
#

Didn't electron ditch 32 bit recently (which is why steam stopped providing them at the start of this year)?

quiet ice
young knoll
#

Yeah I do my queries in CompletableFutures

echo basalt
#

Yeah it's a blocking method

quiet ice
#

Never used bungee so I cannot tell. Especially given that your question is rather ambiguous

echo basalt
#

pretty sure the returned cursor is blocking actually

slender elbow
zealous osprey
#

and I'm running a 8-bit machine

deep herald
quiet ice
#

set for what?

deep herald
#

wdym

quiet ice
#

Your plugin or bungee?

deep herald
#

a value in the messages.properties in bungee

sand spire
#

what is a blocking method

#

magic?

quiet ice
#

In the former case - what exactly do you struggle on? In the latter case: #help-server

quiet ice
deep herald
#

kinda

#
alert=\u00a78[\u00a74Alert\u00a78]\u00a7r 
already_connected=\u00a7cYou are already connected to this server!
already_connected_proxy=\u00a7cYou are already connected to this proxy!
already_connecting=\u00a7cAlready connecting to this server!
command_list=\u00a7a[{0}] \u00a7e({1}): \u00a7r{2}
connect_kick=\u00a7cKicked whilst connecting to {0}: {1}
current_server=\u00a76You are currently connected to {0}.
fallback_kick=\u00a7cCould not connect to a default or fallback server. Incorrectly configured address/port/firewall? {0}
fallback_lobby=\u00a7cCould not connect to target server, you have been moved to a fallback server.
lost_connection=\u00a7cProxy lost connection to server.
mojang_fail=\u00a7cError occurred while contacting login servers, are they down?
no_permission=\u00a7cYou do not have permission to execute this command!
no_server=\u00a7cThe specified server does not exist.
no_server_permission=\u00a7cYou don''t have permission to access this server.
outdated_client=\u00a7cOutdated client! Please use {0}
outdated_server=\u00a7cOutdated server! I''m still on {0}
proxy_full=\u00a7cServer is full!
restart=\u00a7cThe proxy server is restarting
server_list=\u00a76You may connect to the following servers at this time: 
server_went_down=\u00a7cThe server you were previously on went down, you have been connected to a fallback server
total_players=Total players online: {0}
name_invalid=\u00a7cUsername contains invalid characters.
ping_cannot_connect=\u00a7cCould not request status from target server.
offline_mode_player=\u00a7cNot authenticated with Minecraft.net
secure_profile_required=\u00a7cA secure profile is required to join this server.
secure_profile_expired=\u00a7cSecure profile expired.
secure_profile_invalid=\u00a7cSecure profile invalid.
message_needed=\u00a7cYou must supply a message.
error_occurred_player=\u00a7cAn error occurred while parsing your message. (Hover for details)
error_occurred_console=\u00a7cAn error occurred while parsing your message: {0}
click_to_connect=Click to connect to the server
username_needed=\u00a7cPlease follow this command by a username.
user_not_online=\u00a7cThat user is not online.
user_online_at=\u00a7a{0} \u00a7ris online at {1}
send_cmd_usage=\u00a7cNot enough arguments, usage: /send <server|player|all|current> <target>
player_only=\u00a7cOnly in game players can use this command
you_got_summoned=\u00a76Summoned to {0} by {1}
command_perms_groups=\u00a76You have the following groups: {0}
command_perms_permission=\u00a79- {0}
command_ip=\u00a79IP of {0} is {1}
illegal_chat_characters=\u00a7cIllegal characters in chat ({0})
kick_message=\u00a7cYou have been kicked off the proxy.
reject_transfer=\u00a7cYour transfer was rejected.```
#

thats what i mean

quiet ice
#

What is the dev aspect of it all?

deep herald
#

?

#

i wanna set it on load of my plugin

quiet ice
#

Okay. That narrows it down a little bit more

shadow zealot
#

does anybody know if there is a way to get the player's gameprofile during the AsyncPlayerPreLoginEvent event?

young knoll
#

Use the uuid and getOfflinePlayer

quiet ice
# sand spire magic?

The contrary: It means that when you call a method you can expect the Thread to say in that method for a while

uneven iris
#

So I have made an error making a plugin and have no backups of the code, and the server opens in 3 hours - can anyone write it again for me that actually understands plugins??
I need it to let people on three teams (firstlife secondlife extralife) have keep inventory, but then make peole on the thirdlife team drop all their items on death.
The problem I have right now is that while keep inventory works for the main group and the thirdlife drops right, on the keep inventory side they both keep items and drop them, meaning its a dupe

young knoll
#

I would guess

shadow zealot
young knoll
#

why not

shadow zealot
#

because I have to modify the field id

young knoll
#

?

quiet ice
#

Where as non-blocking methods instantly return (though they may have side effects after returning, for example through scheduled futures, network I/O, etc.)

uneven iris
#

:c i thought it workeddd and I barely know how plugins work anyways i had to get someone else to compile it and now I have no time again

mortal hare
#

how to optimize websites for large resolutions

#

should i add more content visible if lets say i have a carousel menu, it should expand more "cards" or leave it as it with maximum width

shadow zealot
# young knoll ?

I need to get the gameprofile because, by using a reflection, I need to modify the field id of player's gameprofile

quiet ice
sand spire
#

this good?

        return CompletableFuture.runAsync((Runnable) collection.find(eq(fieldName, value)));
    }```
deep herald
slender elbow
#

uh that casting looks like it's gonna blow up

quiet ice
#

That cast seems very strange

shadow zealot
sand spire
remote swallow
#

read this

echo basalt
#

ty for pinging me

quiet ice
deep herald
remote swallow
#

if it doesnt work you cant do it on pre login

remote swallow
#

did you try what he said

quiet ice
deep herald
#

oh

shadow zealot
#

and it doesn't work

remote swallow
#

you cant do it on pre login then

#

do it on normal join event

deep herald
#

or smthg

quiet ice
#

Paths.of() (J8+) or Path.of (J9+)

deep herald
shadow zealot
remote swallow
#

what are you actually modifying in game profile

quiet ice
#

What is there to explain? They are the equivalent of a path constructor (java.nio.file.Path is an interface)

deep herald
#

what do i put in the builder tho

quiet ice
#

Jesus, what is with my english today?

deep herald
#

not builder

remote swallow
quiet ice
#

What constructor?

deep herald
#

so like

deep herald
#

messages.properties

quiet ice
#

Depends on where that file is located in

shadow zealot
#

hold on maybe I just found a solution

deep herald
quiet ice
#

Path.of(".") is the current working directory

quiet ice
#

You can't cast anything willy-nilly

#

I don't know who told you that that is acceptable behaviour

#

But that guy (or gal) belongs handled

sand spire
# quiet ice Yeah, then it doesn't work that way. You'll likely want to use a lambda here. So...

Wouldn't this work? or what do you mean

public CompletableFuture<Void> mongoAddInt(MongoCollection<Document> collection, String fieldName, String value, String fieldToUpdate, int numberToAdd) {
        return CompletableFuture.runAsync((Runnable) collection.updateOne(eq(fieldName, value), (inc(fieldToUpdate, numberToAdd))));
    }```

```java
mongoAddInt(collection, "testField", "testValue", "something", 4).thenRun(() -> {
      //something to run      
        });```
sand spire
#

sorry i casted cause it gave an error

quiet ice
#

Your IDE is fucking stupid, okay

sand spire
#

including the old value

quiet ice
#

IJ isn't much smarter than eclipse when it comes to some of its suggestions

sand spire
#

what

quiet ice
#

It is programmed to resolve compilation failures at all cost. But while the syntax is correct, the semantics are not

sand spire
#

is it acceptable now 😔
return CompletableFuture.runAsync(() -> collection.updateOne(eq(fieldName, value), (inc(fieldToUpdate, numberToAdd))));

deep herald
#

will that access that file

sand spire
#

idk i just copied what i used with configfiles

quiet ice
#

Anyways, you'll probably want

return CompletableFuture.runAsync(() -> {
   collection.updateOne(eq(fieldName, value), inc(fieldToUpdate, numberToAdd));
});
sand spire
#

ngl I never really did something with when its finished other than sending how long it took and adding a command cooldown while its saving async to prevent unexpected things

quiet ice
sand spire
shadow zealot
sand spire
#

cause it's 1 line

deep herald
cold kiln
#

hi!

I need help for creating Custom enchantment does anyone could help me ?

thanks

quiet ice
deep herald
quiet ice
#

Perhaps even try-with-resources. The approach I gave isn't the best one, it just happens to be a solution

quiet ice
deep herald
cold kiln
#

I would create a HARVESTING enchantment but I dont know how to register it. I use 1.20.4

#

the Enchantment.register... doesn't exist.

quiet ice
cold kiln
#

so i create a config page and use Lore...

#

?

icy beacon
#

Use PDC and lore now yes

cold kiln
#

ok I'll try thanks

deep herald
quiet ice
#

I mean if you want to you can also append to the file via Files.write(Path, Iterable<? extends CharSequence>, Charset, OpenOption...)

cold kiln
#

the PDC is clear after reloading ?

icy beacon
#

No, it's persistent

cold kiln
#

ok yeah🙄 haha

quiet ice
#

But that way can blow stuff up if you are not careful (e.g. duplicate entries in the properties file)

#

Hence, you generally want to read the file in order to write it back after modifying the java.util.Properties object

#

Also, if you want to go with the append route, use StandardOpenOption.APPEND in your open options

#

Otherwise you'll delete that file

tardy delta
#

💀

deep herald
#
        properties.setProperty("no_permission", "§cYou do not have permission to use this command.");```
tardy delta
#

cHeCk ThE rEtUrN tYpE

quiet ice
#

Beware that it will not magically write the file back afterwards. Use store for that

dry hazel
#

no?

glad prawn
#

wth

quiet ice
#

WHO THE FUCC TOLD YOU YOU CAN CAST STUFF TO WHATEVER YOU WANT

deep herald
#

?

quiet ice
#

I want to strangle them

Figuratively, of course

dry hazel
tardy delta
#

we both know that isnt true

deep herald
remote swallow
#

wow thats almost exactly what you were told to do here

deep herald
#

damn

quiet ice
#

yeah

rough ibex
#

But spoonfed via gpt

glad prawn
remote swallow
#

on that page you sent

quiet ice
#

I think that was a rhetorical question

sand spire
#

I made this real quick in 1 class as an example, does this look like it won't cause lag even if the player was getting kills every second?
https://pastes.dev/DpMTnRsI40

eternal oxide
#

Reuse your Document in login

sand spire
#

uh, how do I return something in a completable future 💀

public Document findDocument(Document filter) {
        CompletableFuture.runAsync(() -> {
            Document doc = collection.find(eq(filter)).first();
            return doc;
        });
        return null;
    }```
echo basalt
#

return the future

#

the whole point of futures is that they're going to complete later

sand spire
# echo basalt return the future

but now I still can't get the document from it or I atleast don't know how

public CompletableFuture<Void> findDocument(Document filter) {
        return CompletableFuture.runAsync(() -> {
            collection.find(eq(filter)).first();
        });
    }```
```java
findDocument(document).thenRun(() -> {
            
        });```
slender elbow
#

thenAccept

hazy parrot
#

Also supplyAsync, not run

sand spire
#

Thanks I think I got it

remote swallow
#

anyone know other encryption methods that arent b64 with a cipher

#

or keypair stuff

chrome beacon
rough ibex
#

Know symmetric and asymmetric

remote swallow
rough ibex
#

Look at asymmetric

young knoll
#

Just add 1 to each character value

#

100% unbreakable

rough harness
#

so i need help i want to add this image to the gui but i dont know how to make the picture lineup

echo basalt
#

you need negative spacing

#

make sure the height is good

rough harness
#

when i tried the 33 112 it give me []

echo basalt
#

and ascent just make it go up and down

rough harness
echo basalt
#

eh that looks like the legacy neg space font

young knoll
#

Ascent must be less than the height

echo basalt
#

icky

rough harness
echo basalt
#

8 pixels to the left

#

is usually the ideal

rough harness
#

kk

echo basalt
#

I'd also make your image semi-transparent so you can actually do alignment well

icy beacon
#

ah yes, docs

shadow night
#

Why the fuck does bedrock run so poorly on consoles

rough ibex
#

I can't be the only one who thinks javadocs looks ugly

quaint mantle
#
[21:00:01 ERROR]: #!#! java.lang.ClassCastException: class org.bukkit.craftbukkit.v1_20_R3.block.CraftBlock cannot be cast to class org.bukkit.block.Sign (org.bukkit.craftbukkit.v1_20_R3.block.CraftBlock and org.bukkit.block.Sign are in unnamed module of loader java.net.URLClassLoader @5ce65a89)``` why is this happening

```java
Block tempnewblock = p.getLocation().getBlock();
tempnewblock.setBlockData(Material.OAK_SIGN.createBlockData().createBlockState().getBlockData());
Sign newblock = (Sign) tempnewblock;```
shadow night
chrome beacon
quaint mantle
#

set a block to a sign

chrome beacon
#

That's not how you set a block though

#

Use setType

quaint mantle
#

settype only?

chrome beacon
#

yeah just set type

#

and when you cast to Sign to cast the block data

next plume
#

Is there an easy way to get the Mojang mappings for the snapshot release? I just want to look at the deobfuscated names, not actually compile anything.

sullen marlin
chrome beacon
#

Fabric might work

#

VanillaGradle is also an option

slender elbow
#

if you like $$0 $$1 $$x1 yeah xD

next plume
#

But that has links to other jar files?

slender elbow
#

you can find the mappings file in the MC wiki page for the version

#

on the panel on the right

sullen marlin
slender elbow
#

it's just easy

sullen marlin
#

There's a client.txt and a server.txt

next plume
#

I don't see .txt files

#

Oh, inside the json file

sullen marlin
#

Yeah

next plume
#

OK, found it. Thank you.

spare prism
#

is there a way to place full set of armor in the smithing table?

next plume
rough harness
umbral ridge
#

hey

echo basalt
#

did you reload your resourcepack

#

and if so, check your logs file

umbral ridge
#

can PDC be set on a Lever

echo basalt
#

it can be set on any itemstack

#

not on any block

eternal oxide
#

any block with a TileEntity has a PDC

echo basalt
#

nvm was thinking of modeldata

flint coyote
#

How would I approach loading data from a file/database when a certain chunk gets loaded?

  1. If done async players might interact or enter that chunk before the required data is available that might prevent them from doing so
  2. If done sync and the database or connection performs poorly it will cause lag.
    How is worldguard doing it? Or do they keep all regions in memory?
sullen marlin
#

In memory

#

You can fit tens of thousands of regions in a few megabytes of ram

flint coyote
#

Alright, in memory it is then. Thank you

rough harness
rough harness
mellow edge
#

if I want EntityDamageByEntityEvent to only be triggered when a player is still alive after it, should I check for:
if(potentialDeathPlayer.getHealth()-e.getDamage() <= 0) return; ?

#

is this event triggered on "the final damage" of the player?

chrome beacon
#

use getFinalDamage

umbral ridge
#

hey

#

how do you check if player has an empty storage slot in their inventory

slender elbow
#

Inventory firstEmpty

umbral ridge
#

thanks emily

#

Inventory firstEmily

slender elbow
#

null

umbral ridge
#

EmilyInventory.setItem(0, DIAMOND) uwu

chrome beacon
#

Nice until you realize you deleted her shulkerbox of stuff

umbral ridge
#

it doesn't matter!

#

minecraft isn't permanent

#

what matters are diamonds

acoustic pendant
#

Hey, I have this code and cs is returning null, could someone help me?
ConfigurationSection cs = plugin.items.getConfig().getConfigurationSection("Items");
cs.set(args[1] + ".material", item.serialize());

#

Caused by: java.lang.NullPointerException: Cannot invoke "org.bukkit.configuration.ConfigurationSection.set(String, Object)" because "cs" is null

chrome beacon
#

Does that section exist

acoustic pendant
chrome beacon
#

Show us

acoustic pendant
#

I've tried creating it with #createSection too

tender shard
#

it doesnt contain anything so it's not a section

#

just do getConfig().set("Items.something", something)

acoustic pendant
#

I mean

#

I've tried making it a section by setting numbers below it

#

like

#

Items:
1:

#

and still it returns null

eternal oxide
#

can't do 1:

acoustic pendant
#

well

#

'1'

eternal oxide
#

have to do '1':

tender shard
#

have you ever saved the config?

acoustic pendant
#

saveDefaultConfig

acoustic pendant
eternal oxide
#

add a value

#

can;t have an empty section

tender shard
slender elbow
#

it'd have to explicitly be whatever: {} if you wanted an empty section

acoustic pendant
#

(simplified)

tender shard
#

yes, as shown above

println(config.getConfigurationSection("Items"))
slender elbow
#

putting it in a variable won't change its null-ness

acoustic pendant
#

oh mb

#

didn't see that

#

weird

tender shard
#

have you maybe only changed your included config.yml but not the actual saved one?

acoustic pendant
#

but I have another custom file with the exact same code

#

and that file works

formal linden
#

how help me fore creat royaume in my srveur?

tender shard
#

what

acoustic pendant
#

what

eternal oxide
#

He's asking something about a Kingdom on his server?

native ruin
#

Probably factions type gamemode

valid burrow
#

is it possible to make different regions have a different weather and time

lost matrix
#

Well the weather can be set via the spigot api at least

#

The time as well

#

In that case its easier

pseudo elm
#

hello i started programming today and got an problem when starting the plugin

 Error occurred while enabling TestPL v1.0.0 (Is it up to date?)
java.lang.NullPointerException: Cannot invoke "org.bukkit.command.PluginCommand.setExecutor(org.bukkit.command.CommandExecutor)" because the return value of "de.itsemse.minecraft.TestPL.getCommand(String)" is null
``` i googled it and it say that it was an problem with my plugin yml but i think i did everything right can someone help?

yml:
```name: TestPL
version: 1.0.0
main: de.itsemse.minecraft.TestPL
description: Test
author: ItsEmse
api-version: '1.20'

commands:
  testcommand:
    description: "This is a command"
    usage: "/<command>"
    aliases: [test, testcmd]
    permission: testpl.testcommand
    permission-message: "You do not have permission to use this command"```
delicate lynx
#

how is the command registered

pseudo elm
#
    @Override
    public void onEnable() {
        // Plugin startup logic
        this.getCommand("testcommand").setExecutor(new commands());
    }
valid burrow
#

i wanted to to have eg different chunks have different weathers

#

but if thats impossible

#

too bad ig but

#

have to live with it

lost matrix
valid burrow
#

na but

#

i need it to actually be server sided

#

so mobs spawn/burn lightning strikes what ever

#

doing that manually would be so much pain

quaint mantle
#

why is it saying Player aabss just tried to change non-editable sign

int r = new Random().nextInt(1, 10);
Location l = new Location(p.getWorld(), p.getX(), p.getWorld().getMaxHeight()-r, p.getZ());
Block tempnewblock = l.getBlock();
tempnewblock.setBlockData(Material.OAK_SIGN.createBlockData(), false);
tempnewblock.getState().update(true, false);
Sign newblock = (Sign) tempnewblock.getState();
p.openSign(newblock, Side.FRONT);```
sullen marlin
#

?jd-s

undone axleBOT
sullen marlin
quaint mantle
#

ok

young knoll
#

Inb4 old version

sullen marlin
#

?whereami

quaint mantle
#

my bad

sullen marlin
#

thanks for wasting my time

pseudo elm
#

hello i started programming today and got an problem when starting the plugin

 Error occurred while enabling TestPL v1.0.0 (Is it up to date?)
java.lang.NullPointerException: Cannot invoke "org.bukkit.command.PluginCommand.setExecutor(org.bukkit.command.CommandExecutor)" because the return value of "de.itsemse.minecraft.TestPL.getCommand(String)" is null
``` i googled it and it say that it was an problem with my plugin yml but i think i did everything right can someone help?

yml:
```name: TestPL
version: 1.0.0
main: de.itsemse.minecraft.TestPL
description: Test
author: ItsEmse
api-version: '1.20'

commands:
  testcommand:
    description: "This is a command"
    usage: "/<command>"
    aliases: [test, testcmd]
    permission: testpl.testcommand
    permission-message: "You do not have permission to use this command"```
pseudo elm
# kind hatch What's your code look like?
package de.itsemse.minecraft;

import org.bukkit.plugin.java.JavaPlugin;

public final class TestPL extends JavaPlugin {

    @Override
    public void onEnable() {
        // Plugin startup logic
        this.getCommand("testcommand").setExecutor(new commands());
    }

    @Override
    public void onDisable() {
        // Plugin shutdown logic
    }
}
#
package de.itsemse.minecraft;

import org.bukkit.command.Command;
import org.bukkit.command.CommandExecutor;
import org.bukkit.command.CommandSender;
import org.bukkit.entity.Player;

public class commands implements CommandExecutor {
    @Override
    public boolean onCommand(CommandSender sender, Command cmd, String label, String[] args) {
        if (sender instanceof Player) {
            Player player = (Player) sender;
            player.sendMessage("123");
        }
        // If the player (or console) uses our command correct, we can return true
        return true;
    }
}
drowsy helm
#

this.getCommand("testcommand") is returning null for some reason

pseudo elm
#

i know

#

but why

#

forums siad bc of the yml

drowsy helm
#

its valid

kind hatch
#

Weird, everything you've written looks correct.

#

How are you compiling your project?

pseudo elm
#

maven

#

you mean this

drowsy helm
#

decompile your jar and see if the yml is updated

pseudo elm
#

how i do that

drowsy helm
#

clean before packaging aswell just incase

kind hatch
#

^

#

Decompiling a jar isn't hard. There's tools for it, but jar files are also just glorified zip files. You can open them with any archive tool.

pseudo elm
#

should be updated

#

its the same as in the code

kind hatch
#

I mean... what version of spigot are you running?

river oracle
#

Is there a way to filter which packages FernFlower decompiles

#

There are some shaded dependencies I don't really care about the decompilation of as I'll add them back later with gradle

pseudo elm
#

newest

river oracle
#

?whereami

kind hatch
#

Paper has its own plugin loading system.

pseudo elm
#

but its sme syntax

#

or not

drowsy helm
#

have you tried a clean package yet?

kind hatch
#

It's supposed to have a legacy compatibility layer for regular spigot plugins, but I guess it's not working.

pseudo elm
drowsy helm
#

maven clean package

kind hatch
#

How have you been compiling your plugin before?

drowsy helm
#

instead of maven package

rough ibex
#

Paper is trying to do some new thing?

kind hatch
#

They've been doing it.

#

They didn't like the spigot classloader so they went and made their own version.

#

There's a separation of plugin types when you do /plugins on paper.

pseudo elm
rough ibex
#

Oh, great...

drowsy helm
#

that works, yeah

kind hatch
pseudo elm
#

still same error

drowsy helm
#

probably a paper thing then

kind hatch
#

Can you test it on spigot?

slender elbow
#

inb4 it's called "paper-plugin.yml" instead of "plugin.yml"

pseudo elm
#

i know

umbral ridge
#

whats a default behaivor if I want to add an item to players inventory but all of the slots are full

#

does the added item "fall out"? on the ground

slender elbow
#

the returned Map will contain the items that couldn't be added

#

you can throw those to the ground or do whatever

young knoll
#

Pretty easy to make a give or drop utility method with that ^

umbral ridge
#

Yep

high robin
#

how could I make a plugins name customizable via config file?

rough ibex
#

for what reason

high robin
#

well i'm making an anticheat, and some people like to rename it or just make it "AntiCheat" so players can't figure out the original plugin

rough ibex
#

that's security through obscurity

#

and never works

high robin
#

doesn't matter lol

young knoll
#

You mean the message in chat

#

Or the name in /plugins

#

Easiest way to solve the later is just not give people access to /plugins

high robin
#

        try {
            PluginDescriptionFile object = getDescription();

            Field field = PluginDescriptionFile.class.getDeclaredField("name");
            field.setAccessible(true);
            field.set(object, this.config.get("PLUGIN_NAME"));
        } catch (Exception e) {
            e.printStackTrace();
        }```
#

this is what i'm currently using but it returns to null

#

pl
[21:15:52 INFO]: Plugins (1): null

#

the config

    @ConfigAnnotation(path = "plugin_name")
    public static String PLUGIN_NAME = "Royal";```
young knoll
#

Set it to a hard coded string first

#

That will narrow down if the problem is your config

kind hatch
#

You might also want to put that code in the onLoad() method instead of the onEnable()

high robin
#

i'll try that after hard coding

young knoll
#

But yeah I don’t see the point of this if you can just not let players use /plugins

high robin
#

okay so hard coding it works properly, it shows the custom name

young knoll
#

Well then your config get is retuning null

kind hatch
#

^

high robin
#

config shouldn't be returning null, i'm registering it first

kind hatch
#

What's your config look like though?

high robin
#

/*
 *
 * @author: az76
 * @project: AntiCheat
 * @website: insidious.cc
 * © This project belongs to Insidious Development. Redistribution of this project is not allowed.
 *
 */

import cc.insidious.config.Config;
import cc.insidious.config.annotation.ConfigAnnotation;
import org.bukkit.plugin.java.JavaPlugin;

public class MainConfig extends Config {

    @ConfigAnnotation(path = "license_key")
    public static String LICENSE_KEY = "XXXX-XXXX-XXXX-XXXX-XXXX";

    @ConfigAnnotation(path = "plugin_name")
    public static String PLUGIN_NAME = "Royal";
    public MainConfig(JavaPlugin plugin) {
        super(plugin, "config");
    }
}
wet breach
#

why we using reflection?

kind hatch
high robin
#

it generates it, yes

kind hatch
#

Show the contents plz

high robin
#

ofc

#
license_key: XXXX-XXXX-XXXX-XXXX-XXXX
plugin_name: "Royal"
wet breach
#

you know implementing licensing system in java never works

young knoll
#

Maybe your @ConfigAnnotation is flawed

kind hatch
#

There's the problem.

young knoll
#

No idea since we can’t see it

kind hatch
#

Config paths are case sensitive.

high robin
#

shit

kind hatch
#

You were trying to get PLUGIN_NAME instead of plugin_name

high robin
#

🤦‍♂️

#

works perfectly now, simple mistake

#

thanks guys

rough harness
#

i cant get this to show up i did everything

quaint mantle
#

Easter bunny

rough harness
young knoll
#

Is your resource pack loading

#

Without errors

rough harness
# young knoll Without errors

no errors if i copy the texrure to another custom gui image and save it as a copy it works as that image size that the other texture is could it be the saved size not working

young knoll
#

Maybe

#

There is a width limit, tho I don’t remember what it is

rough harness
#

so say i copyed this image here

rough harness
#

it works but not the whole texture

drowsy helm
#

and have you verified that your unicode is mapping properly

rare rover
#

How would one "lock" a message to the bottom of chat. I've seen it done before but not sure how

#

Without it being sent over and over again

rough ibex
#

maybe with some actionbar stuff?

#

pad the right side with spaces

plain plaza
#

Any alternatives to creating a custom anvil gui with Bukkit#createInventory to where it can trigger PrepareAnvilEvent or is there another alternative to fetching and altering the anvil inventory?

river oracle
#

Bukkit#createInventory won't work for working anvil inventories

plain plaza
#

okay ty

river oracle
#

its like 5 lines of code dw

#

well NMS atleast

#

or you could just use the AnvilGUI Api

#

I prefer NMS myself, but to each their own

plain plaza
#

uh ill take a look at the anvilgui api

#

if it looks heavy then i might use nms

rough harness
rough ibex
#

256 I think

rough harness
drowsy helm
#

what?

#

no just set the colour to white

#

its gray by default

rough harness
#

oh ok

rough harness
drowsy helm
#

read my resource

rough harness
drowsy helm
#

nah that would require an extra actual game slot

#

i mean you could do it and make it look like it but it wouldn't be interactable

rough harness
#

ah how would i add a extra slot

drowsy helm
#

would require a lot of trickery

#

and you would have to make every single item in the game's slot icon a unicode texture

#

more effort than it's worth, if it works at all

#

you could definitely make an inventory with extra slots like origin does

rough harness
#

ah ok

mellow edge
#

when a player re-joins, the new player object is created?

shadow night
#

yeah

#

UUID stays the same, the player object is new

orchid hinge
#

what does AsyncPlayerChatEvent#setFormat() actually do?

drowsy helm
#

sets the format of the chat?

#

like prefix playername, message

acoustic pendant
#

player.getInventory().addItem(plugin.items.getConfig().getItemStack(String.valueOf(rank)));
Why is this returning null even if I have the items set in the config?

#

'0':
type: LOG_2
amount: 64
'1':
type: LOG_2
amount: 64
'2':
type: LOG_2
amount: 64

eternal oxide
#

those entries are not ItemStacks

#

LOG_2 ?

acoustic pendant
#

but seriazable

#

or how u write that thing

drowsy helm
#

what serializer

eternal oxide
#

LOG_2 is not a valid material

acoustic pendant
#

ItemStack item = player.getItemInHand();

plugin.items.getConfig().set(args[1], item.serialize());
plugin.items.saveConfig();

acoustic pendant
stark moss
#

Hello. Im having an issue where the bossbar doesnt update and the clock doesn't count down at all. /pauseclock, /resumeclock and /final do not work at all

Here is the code:
https://pastebin.com/pvNbQhD7

There were no errors

/startclock - will start the countdown on the bossbar. it goes for 361 seconds. That is the countdown variable
/pauseclock - should save the bossbars progress, save the seconds remaining (pausedCountdown) and is supposed to pause it (Doesnt work)
/resumeclock - uses the saved variables from /pauseclock and resumes the countdown
/final - makes the bossbar title Final and displays each teams name and score. those are in other classes. it also sets the bossbar progress value to 0

eternal oxide
acoustic pendant
eternal oxide
#

getItemStack(String) needs teh full path

acoustic pendant
#

but it is like

#

'1':
type: log

drowsy helm
#

show the full config

acoustic pendant
#

and that's already the itemstack

eternal oxide
#

I just asked if it was at teh root of the config

acoustic pendant
#

oh

#

like yea

#

firstime: false
enabled: true
'0':
type: LOG_2
amount: 64
'1':
type: LOG_2
amount: 64
'2':
type: LOG_2

eternal oxide
#

?paste the config

undone axleBOT
eternal oxide
#

so we can see indents and all

acoustic pendant
eternal oxide
#

looks fine to me

drowsy helm
#

that should be fine

#

does this have to be user readable?

eternal oxide
#

sysout the rank you are trying to read

acoustic pendant
drowsy helm
#

just use a byte array or b64 array then

#

much less pain

eternal oxide
#

he currently can;t even read a config entry so changing to an array or some other format is unlikely to help at the moment

#

sysout your rank

icy beacon
#

My IntelliJ went rabid and turned every class with generics into a normal class in every library
e.g. Collection<File> listFiles from Apache IO into Collection listFiles

#

Program-time type erasure lol

shadow night
#

damn

icy beacon
#

Well I get more time to procrastinate while it re-indexes everything

quaint mantle
#

yo i have a problem while building a gradle plugin im a beginner so yeah

#

Could not determine the dependencies of task ':services:application:shadowJar'.

Could not resolve all dependencies for configuration ':services:application:runtimeClasspath'.
Could not find gg.scala.commons:store:3.5.1.
Searched in the following locations:
- https://repo.dmulloy2.net/repository/public/gradle-release/gg/scala/commons/store/3.5.1/store-3.5.1.pom
- https://repo.maven.apache.org/maven2/gg/scala/commons/store/3.5.1/store-3.5.1.pom
- https://repo.dmulloy2.net/repository/public/gg/scala/commons/store/3.5.1/store-3.5.1.pom
Required by:
project :services:application
Could not find gg.scala.commons:serversync:3.5.1.
Searched in the following locations:
- https://repo.dmulloy2.net/repository/public/gradle-release/gg/scala/commons/serversync/3.5.1/serversync-3.5.1.pom
- https://repo.maven.apache.org/maven2/gg/scala/commons/serversync/3.5.1/serversync-3.5.1.pom
- https://repo.dmulloy2.net/repository/public/gg/scala/commons/serversync/3.5.1/serversync-3.5.1.pom
Required by:
project :services:application

#
eternal night
#

I doubt you get to build this

trail pilot
#

Hello

eternal night
#

you need the "scale repo"

#

whatever and wherever that is

#

presumably some of their internal stuff

trail pilot
#
FurnaceRecipe recipe = Bukkit.getRecipesFor(input).stream().filter(r -> r instanceof FurnaceRecipe).map(r -> (FurnaceRecipe) r).findFirst().orElse(null);```
#

this is not getting any recipies, I'm doing a fake furnace to make it smelt faster/slower ect, like a normal furnace but custom

#

any fixes for it?

quaint mantle
icy beacon
#

Ok I manually deleted every single folder on my pc that had to do something with commons-io and let it be reimported and now it works lol

drowsy helm
#

ill never understand how people code with a background

#

isnt it distracting

tardy delta
#

i code with nvim

shadow night
icy beacon
#

For me it's not noticeable at all because I got used to it

umbral ridge
#

i need the background music too

#

and either a cocacola

#

or an energy drink

#

which is like a booster

#

coffee and a cigarette before coding is even better

jagged bobcat
#

I need the background music to code and not get distracted with other stuff.

umbral ridge
#

i only allow my cat to distract me during coding

icy beacon
#

I need a piece of gum to code properly

#

I'm using a lib that depends on Commons Compress 1.21, which is vulnerable to CVE-2024-26308. If updated to 1.26, it's no longer vulnerable. Is it possible in Gradle to change a version of that library somehow?

#

Other than forking the lib, changing it and building it for myself lol

drowsy helm
#

I get too distracted by coding will start at 9am and next minute I look it’s 8pm and I forgot to eat anything all day

icy beacon
#

Samee

remote swallow
icy beacon
#

Thanks

remote swallow
#

text components

next iron
#

how can i make sure my plugins onenable runs after my softdependencies?

remote swallow
#

as long as it has the soft depend it will run after them

chrome beacon
#

and how do you know that

next iron
# chrome beacon and how do you know that
            new placeholderexpansion().register();
            papi = true;
        }```
i have this in my onenable
papi is a public bool
i got it by using ```commandSender.sendMessage("" + FantasyLevels.papi);``` in my command
#

and it said false

chrome beacon
#

Show your plugin.yml

next iron
# chrome beacon Show your plugin.yml
version: '${project.version}'
main: me.lars.fantasylevels.FantasyLevels
api-version: '1.19'
load: STARTUP
authors: [Blockbuster_287]
softdepend: [MythicMobs, PlaceholderAPI]

commands:
  Stats:
    Description: Shows the stat screen
    Aliases:
      - statistics
      - level```
remote swallow
#

its most likely because of load: STARTUP

#

most things load post world

next iron
remote swallow
#

remove that line

inner mulch
#

do the getters and setters in an hibernate entity get replaced by getters and setters that directly modify to sql? or is this in memory?

next iron
#

it worked :D

minor junco
#

Afaik

inner mulch
stark moss
#

Hello. Im having an issue where the bossbar doesnt update and the clock doesn't count down at all. /pauseclock, /resumeclock and /final do not work at all

Here is the code:
https://pastebin.com/pvNbQhD7

There were no errors

/startclock - will start the countdown on the bossbar. it goes for 361 seconds. That is the countdown variable
/pauseclock - should save the bossbars progress, save the seconds remaining (pausedCountdown) and is supposed to pause it (Doesnt work)
/resumeclock - uses the saved variables from /pauseclock and resumes the countdown
/final - makes the bossbar title Final and displays each teams name and score. those are in other classes. it also sets the bossbar progress value to 0

inner mulch
#

pls learn oop

#

it would probably make it more readable

grim hound
#

fuckin' hate java

#

can't use SharedSecrets

#

can't use reflection

#

the fuq do I do?

grim hound
chrome beacon
#

what are you trying to do

quiet ice
#

what exactly is the purpose of this?

grim hound
#

to prevent PacketEvents from printing an error

grim hound
#

or reflection

quiet ice
#

Uh wha

chrome beacon
#

So why not filter the logger instead

grim hound
grim hound
chrome beacon
#

And why hide PacketEvents errors

grim hound
#

it doesn't actuall throw it

grim hound
chrome beacon
#

??

quiet ice
#

Have you tried using the sun Unsafe?

#

But I am not entirely sure why you wanted to use the SharedSecrets class

grim hound
#

Throwable#setCause access

grim hound
#

can I use that?

#

like can I fully override an object?

#

like I mean

quiet ice
#

Yeah, the sun Unsafe can set fields arbitrarily. It is much more complicated (and dangerous!) to use, but it does work

#

That being said, the sun Unsafe won't work for all too long, but it is the final vestige before you start thinking with portals

grim hound
#
void yes() {
Exception e = new IndexOutOfBoundsException();
ex(e);
//now the e is RuntimeException
}
void ex(Exception e) {
Unsafe.getUnsafe().someFunnymethod(e, new RuntimeException())
}
#

can I do something like this?

quiet ice
#

uh, that might be too psuedo-source for me

grim hound
#

it's exactly what I wanna do

#

change what the variable points to

#

in a void

quiet ice
#

Well, what I understood is this

void main() {
  Exception e = new IndexOutOfBoundsException();
  {
    /* "ex(Exception)" inlined for brevity */
    e = new RuntimeException();
  } 
}

Which doesn't make any sense

grim hound
#

or just changing it's cause

#

both are fine for me right now

grim hound
#

the e = new new RuntimeException();

#

should also affect the caller argument itself

quiet ice
#

You can't manipulate the stack of the caller methods without some incredible amount of mind games (unless you go with ASM transformation)

grim hound
#

here's what I'm doing right now

#

and here's what PE does

#

thus, I'd need to override either the cause or the object itself

grim hound
quiet ice
#

However, the cause can be changed rather easily. So you'd have something like this

Throwable t = getThrowable();
t.cause = myCause;

(of course, I inlined everything for brevity here too)

grim hound
#

know

#

but

#

no fucking method

#

allows me that

grim hound
quiet ice
#

Well, cause is a field

grim hound
#

if you try to use reflection

thin wind
#

Hello, how can we use sonic boom from warden in the versions below 1.19 ? In 1.19 + We can use Particle.SONIC_BOOM but not in 1.18 for example

quiet ice
#

The only complicated part is obtaining the correct offset

#

Because here, java doesn't babysit you at all

grim hound
#

yes it does

#

you need to get this mfo with reflections

quiet ice
#

Yes, but once you have the unsafe instance you can do whatever low-level shit you want. With not babysitting I mean not providing any high-level ways of accomplishing what you want

grim hound
#

what's the offset tho?

#

ooh

#

it's simple

#

got it

grim hound
quiet ice
#

The field you want to set, basically

#

I think it does a store fence already? Otherwise you can unsafely do a store fence yourself

grim hound
#

I never understood what a lazy set was

quiet ice
#

It's multi-thread semantics for all I know

#

Or more specifically, how the state of a variable is updated to other Threads. Could also influence the same thread, but I am not too knowledgeable in that. Conclure might know though

#

Well the store fence probably can be rather invoked via VarHandle instead of the sun Unsafe

spare prism
#

is there a way to get a TrimMaterial from Material without many if, else blocks?

spare prism
grim hound
#

YOU GREAT MAN

#

Forever indebted to you

quiet ice
#

Well that code won't work for all too long anyways

quiet ice
#

I think it'll break with Java 21 or something

grim hound
grim hound
quiet ice
#

The sun Unsafe class won't exist for all too long unfortunately

quiet ice
#

I believe they want to get rid of it with the full release of FFI/Project Panama

grim hound
#

I can't access the jdk internal one

#

won't this

slender elbow
#

--add-exports moment

grim hound
slender elbow
#

your issue

grim hound
#

I mean that java disallows the usage

#

I can access it in the code editor

quiet ice
#

Yeah, the JDK maintainers believe that everyone is willing to use --add-opens and --add-exports so it isn't a great deal

grim hound
quiet ice
#

Which honestly is a braindead stance but what can I do

quiet ice
#

Runtime flags that patch how JPMS works

slender elbow
#

add exports and add opens is how you "access" internals

grim hound
grim hound
quiet ice
#

SharedSecrets is a hack used by the JRE, it isn't anything that special and follows the laws of java

slender elbow
#

you won't get any errors by using the appropriate flags

grim hound
#

I understand perfectly how it works

quiet ice
#

You just need to add the flags at runtime, not at compile-time

slender elbow
#

those flags are specifically to expose that stuff

grim hound
#

what is life

grim hound
quaint mantle
#

is there a way to convert image to a map?

grim hound
#

many ways even

quaint mantle
#

how?

quiet ice
#

You need to execute the server like follows: java -jar myJar.jar --add-exports java.base/sun.security.util=ALL-UNNAMED (of course I just copied something from the internet, not sure if that works if used 1:1, but the idea is the same)

grim hound
quaint mantle
#

uhh wym spoof?

grim hound
grim hound
quiet ice
#

Yes, because server admins are expected to have those flags anyways

quaint mantle
#

i just need it to be same

quiet ice
#

Blame Ron Pressler for everything getting worse in this regard

grim hound
#

using MapRenderer

quaint mantle
#

what about a fast option?

#

its not that big image

grim hound
#

and flush it down

quaint mantle
#

32x32 pixels

grim hound
#

it would be faster cuz you could also do it async

grim hound
quaint mantle
#

yup

grim hound
#

can you send packets?

#

do you have any packet manipulation libraries?

quaint mantle
#

Uh no

#

i can shade ProtocolLib

grim hound
#

no need

grim hound
#

always use PacketEvents

#

much better

quaint mantle
#

I guess i have never used them tho

grim hound
#

well for starters

#

you could do it the intended way

#

where no bugs will occur

#

you create a filled map

quaint mantle
#

is it fast?

grim hound
#

list and remove all renderers

grim hound
quaint mantle
#

how much for 32x32? like estimate

grim hound
#

1.5-3ms?

quaint mantle
#

thats not that much

grim hound
#

well for packets it's much less

#

but whatever

quaint mantle
#

1 questionn does it take 3ms to render map ?

quaint mantle
#

If i give every player the same map will it take 3ms per player?

grim hound
#

I mean it takes less

grim hound
#

but not 3 ms

#

less

#

like 0.8ms

quaint mantle
#

Ah lets try intended way

grim hound
quiet ice
#

3ms is quite a lot for 32^2 values

grim hound
quiet ice
#

Was too lazy to use a calculator and figure out that it is 1024

quaint mantle
#

Hmm i guess we can try packets then?

grim hound
#

well then allow me

quaint mantle
#

can it put all 32x32 pixels on 1 map?

quiet ice
#

1024 is like nothing

grim hound
#

yes

#

maps are 128x128

quaint mantle
#

okay thats good

grim hound
#

then final question

#

would you like to send packets raw or with a library?

echo basalt
#

Maps are 128x128

quaint mantle
#

raw if possible

echo basalt
#

each pixel is 0-255

#

the palette is very limited

grim hound
quaint mantle
#

sure

echo basalt
#

You can pack the same map id for everyone and send it

grim hound
#

it's quiet a bit of classes

quaint mantle
#

oh shoot

echo basalt
#

:)

grim hound
#

oh wait no

#

tis

timid hedge
#

Can someone please help me with why when the sword-type in the config is set to example "abc" and the sharpness in the config is set to 0 it skips the sword and gives the next item (exactly as it should) but if the sword-type is set to "abc" and the sharpness is set to ex. 1 it cancelles the sword and everything else. I need help to fix so that it skips the sword if the sword-type dosent exist
code: https://pastebin.com/UWAwcDMf
(its with 1.8.8)

quaint mantle
#

should i just resort to a library?

grim hound
#

like you copy the newer and older impl

#

and part of ReflectionUtils for that

quaint mantle
#

whats? netty

grim hound
grim hound
#

is like

#

what the server uses for client-server connection

quaint mantle
#

do i need to get it?

grim hound
#

it's built-in into spigot

#

as one of it's libraries

quaint mantle
#

you just want me to copy all these

grim hound
quaint mantle
#

1 small problem

grim hound
#

do you use maven?

quaint mantle
#

yes

#

btw the plugin is strictly 1.16.5 so i dont think newer or older is needed

quaint mantle
#

i think i mentioned it a bit too late x(

grim hound
#

in that case you can just reference the classes themselves

#
<dependency>
    <groupId>io.netty</groupId>
    <artifactId>netty-all</artifactId>
    <version>4.1.34.Final</version>
</dependency>
grim hound
quaint mantle
#

will it shade it?

grim hound
#

I don't use maven so dunno

quaint mantle
#

lemme quickly import it

umbral ridge
#

hey can you vertically rotate a block? eg. player's head

quaint mantle
#

ok imported it

grim hound
grim hound
quaint mantle
#

so the stuff we copied is useless?

echo basalt
#

that's so much work to send an image

#

you can already send map images with bukkit

quaint mantle
#

we wanna be efficient^

echo basalt
#

createMapView -> MapMeta -> set to an itemstack

quaint mantle
#

unless thats efficient

echo basalt
#

As for efficiency you want to do things your way

grim hound
echo basalt
echo basalt
grim hound
#

but yes

#

also it invokes the bukkit event

echo basalt
#

Parsing colors does take longer on the bukkit side

grim hound
echo basalt
#

But so does it take long on the nms side

#

It all depends if you're using a color lookup table or not

grim hound
#

@quaint mantle is the image constant?

echo basalt
#

If the image is a constant then you can just do the bukkit route

echo basalt
#

if you're sending like 20 images per second or want to generate images on the fly, or generate multiple images and batch send them then it's whatever make your own parser

grim hound
#

then packets are the way to go

quaint mantle
#

yes

grim hound
#

or in performance-sensitive environments

quaint mantle
#

image is constant

echo basalt
#

PRetty sure you can create a map view async

grim hound
quaint mantle
#

image is saved in /resources

grim hound
#

you cannot

echo basalt
#

So yeah let's not over-engineer and stick to bukkit for now

#

This isn't performance critical

quaint mantle
#

mm maybe packets are a bit out of my head

echo basalt
#

you aren't sending a board of 16x16 item frames and need the extra 1ms per player

grim hound
#

well I did so I used packets

#

but I guess you can just stick with bukkit

#

so create a filled map item stack

#

remove all renderers

echo basalt
#

I made an interactive board that displayed fun quizzes and games

grim hound
#

add your renderer

echo basalt
#

and then rewrote it all on minestom

#

it was pretty optimized

#

I also had raycasting and some other magic

grim hound
#

or just the general minestom api?

echo basalt
#

general api

grim hound
#

I'm thinking of making my own server impl

echo basalt
#

I don't have time for that

quaint mantle
grim hound
grim hound
quaint mantle
#

alr

#
    public void mapCreate(){
        ItemStack map = new ItemStack(Material.FILLED_MAP);
        MapMeta meta = (MapMeta) map.getItemMeta();
        for(MapRenderer r : meta.getMapView().getRenderers()){
            meta.getMapView().removeRenderer(r);
        }
    }```
#

like that?

#

now how do i add tha render

echo basalt
#

make a map renderer that just writes a buffered image

#

or whatever

umbral ridge
#

yes

#

yes

shadow night
echo basalt
#

I would but this code is ugly, doesn't follow any sort of conventions and is on 1.8

#

hard pass for me

shadow night
echo basalt
#

but it hurts

#

and won't forget to mention this

umbral ridge
#

Your code looked about the same when you started come on

echo basalt
umbral ridge
#

Well like minecraft, people still use old phones... and they work

echo basalt
#

?1.8

undone axleBOT
umbral ridge
#

it might be "ew" or whatever, but if it works it works.. all falls under the personal preference thing

slender elbow
#

i mean yeah 1.8 works.. works with all the dupes and crashes and exploits it has xD

umbral ridge
#

every version has bugs

#

there is no perfection

tender shard
#

what even is the point of playing MC in a version without goat horns?!

quaint mantle
rough ibex
#

1.8 oh no

echo basalt
eternal night
tender shard
#

isn't the goal of minecraft to collect all goat horns and then stop playing?

quaint mantle
#

oh u fr

echo basalt
#

goat horns are goated

umbral ridge
slender elbow
rough ibex
#

Its to place 1 of every painting in your home

umbral ridge
#

i just pointed out a few things

eternal night
#

xD

quaint mantle
#

wait why does MapRendered want player as argument

young knoll
#

Shoutout to that one goat horn with a missing subtitle

umbral ridge
#

people still use 1.8 due to pvp ... no hit delays and such