#help-development

1 messages · Page 1217 of 1

bronze laurel
#

Is that right?

fervent rampart
#

You are right. I probably switched up downloaded jars somehow.

rotund ravine
#

Are you using some old version?

bronze laurel
#

No.

#

I am using 1.21.3 SpigotMC.

rough ibex
#

Is there a reason youre doing this

young knoll
#

Technically that is an old version

rotund ravine
bronze laurel
rotund ravine
#

But woop mixed up paper and spigot

rough ibex
#

1.8 👍 /s

bronze laurel
#

I know Paper has the function.

rotund ravine
#

Looks right

#

Been ages since i have done it though

worthy yarrow
#

Should be fine^

rotund ravine
#

If it works it’s right

#

As with all reflection

worthy yarrow
#

truth

bronze laurel
#

Thanks.

worthy yarrow
#

Worst case just use a proper command framework

mortal hare
#

doesnt bukkit api expose command map though ?

bronze laurel
#

Bukkit.getCommandMap exists in paper.

rotund ravine
#

Yeah spigot doesn’t expose it

mortal hare
#

kinda strange that it isnt in spigot

#

its not as if its unsafe to access or smth

rotund ravine
#

Go pester md5

eternal night
#

I mean, generally defining things in plugin.yml is kinda more the vibe

worthy yarrow
#

If you enjoy doing extra work psh

mortal hare
rotund ravine
#

Just make a gradle plugin 💪🏻

mortal hare
#

i mean it gives flexibility

#

to register commands at runtime

eternal night
#

Sure but, just wasn't done

worthy yarrow
#

Could always make the pr yourself

eternal night
#

or maybe CommandMap is more impl detail

#

like a "simple" type

#

there is a good amount of those in the API

worthy yarrow
#

I could check stash for that but uh am too lazy

bronze laurel
#

Inputing command isn't working because I'm trying to input the class.

#

What should I change the type too?

eternal night
#

what

#

what "class"

bronze laurel
#

This is my goal.

eternal night
#

so just new VanishCommand ?

bronze laurel
#

And I can do that with each command.

eternal night
#

VanishCommand has to extend Command

bronze laurel
eternal night
#

Sounds ass, how are you gonna do tab completion

bronze laurel
worthy yarrow
#

Or abstractCommand like I had in my impl, then you just do new VanishCommand(); -> Command created, registered, etc

#
public abstract class AbstractCommand extends BukkitCommand {

    public AbstractCommand(String command, String[] aliases, String description, String permission) {
        super(command);
        this.setAliases(Arrays.asList(aliases));
        this.setDescription(description);
        this.setPermission(permission);

        try {
            Field field = Bukkit.getServer().getClass().getDeclaredField("commandMap");
            field.setAccessible(true);
            CommandMap map = (CommandMap) field.get(Bukkit.getServer());
            map.register(command, this);

        } catch (NoSuchFieldException | IllegalAccessException e){
            e.printStackTrace();
        }
    }

    @Override
    public boolean execute(CommandSender commandSender, String s, String[] strings) {
        execute(commandSender, strings);
        return false;
    }

    public abstract void execute(CommandSender sender, String[] args);

    @Override
    public List<String> tabComplete(CommandSender sender, String alias, String[] args) throws IllegalArgumentException {
        return onTabComplete(sender, args);
    }

    public abstract List<String> onTabComplete(CommandSender sender, String[] args);

}```

Couldn't tell you how old this is but I think it should still work
remote swallow
#

that is very fucked

bronze laurel
#

Ok.

remote swallow
#

thats a custom class

bronze laurel
remote swallow
worthy yarrow
#

I'm normal... I use command frameworks now lol

rotund ravine
#

It’s old they prolly doesn’t care

remote swallow
bronze laurel
young knoll
#

Code in constructor!!!!1111

rotund ravine
worthy yarrow
bronze laurel
chrome beacon
#

Cloud or ACF uwu

worthy yarrow
#

Yeah don't do reflection this way then kek

bronze laurel
#

So I decided to ask here.

worthy yarrow
eternal night
#

Yea ^ just go with one of the many fleshed out command frameworks ^

bronze laurel
eternal night
#

reinventing the wheel is pretty much always stupid

worthy yarrow
#

It's better than 50 goofy command classes

#

Command framework basically takes all that work and puts it into a one liner

bronze laurel
young knoll
#

Yep that’s pineapple

#

Totally the right repo

worthy yarrow
#

Cough

bronze laurel
#

In some-cases I don't want tab completion.

worthy yarrow
#

Pretty sure it's nullable

bronze laurel
#

👍

#

Yeah it is.

young knoll
#

You can return null which usually gets auto filled to player names

#

Or you can return an empty collection

worthy yarrow
#

I'm probably dumb

remote swallow
#

ignore the 1 open pr

worthy yarrow
#

Kek

#

I tried so hard ebic

#

I tried 4 different keywords and google wouldn't show

young knoll
#

Mfw no merge to main in almost a year

remote swallow
#

its not stable yet

bronze laurel
#

import codes.settlement.core.constant.Permission;
import codes.settlement.core.model.AbstractCommand;
import org.bukkit.command.CommandSender;

import java.util.List;

public class GoofyCommand extends AbstractCommand {
    public GoofyCommand(String command, String[] aliases, String description, String permission) {
        super("goofy", "angry", "A very goofy command.", Permission.DEVELOPER);
    }

    @Override
    public void execute(CommandSender sender, String[] args) {

    }

    @Override
    public List<String> onTabComplete(CommandSender sender, String[] args) {
        return null;
    }
}```
remote swallow
#

and we (miles) has been too busy making prs and shit

bronze laurel
#

It doesn't look so bad.

worthy yarrow
#

Yeah but for 50 commands

young knoll
bronze laurel
#

And registering it in the config.

worthy yarrow
#

But it's not better than just using a framework

bronze laurel
worthy yarrow
#

It does all that work for you and you only have to do something like Framework.createCommand(params)

dawn flower
#

how do i get the contents of a yamlconfiguration?

t:
    - "test"
    - "test2"
    - whatever:
        - "idk"
        - tt:
            - "idk what else to put"
    - "blah"

would return

[
  "test",
  "test2",
  {
    "whatever": [
      "idk",
      {
        "tt": [
          "idk what else to put"
        ]
      }
    ]
  },
  "blah"
]```
but as a List<Object> if thta makes sense
#

just to be clear, i dont want a json, i want a List<Object> which could be storing a String or a Map

chrome beacon
#

huh why

dawn flower
#

i want to get everything in a yamlconfiguration

#

strings and nested configurations but then i also want configurations in the nested cofngiurations and so on

chrome beacon
#

I still don't understand why you'd want to do that

dawn flower
#

yaml based programming language

chrome beacon
#

💀

dawn flower
#

oh yeah configurationsection not yamlconfiguration

dawn flower
#

it's already made multiple times in stuff like advancedenchants

chrome beacon
#

I wouldn't call that a programming language

dawn flower
#

idk what to call it

#

but yeah ik a programming language is more complex

chrome beacon
#

You could just add some js support or Skript

dawn flower
#

i'm just doing it for fun

#

not really gonna release it or use it

chrome beacon
#

You can challenge yourself by doing a node based web editor for it

#

Something more useful than a yaml language

dawn flower
#

like skript?

worthy yarrow
#

web dev suggested in spigot? Wild

twilit coral
dawn flower
#

k

quaint mantle
#

?paste

undone axleBOT
quaint mantle
unborn hollow
#

Is double rightclicking in spectator mode a bug or a feature? Every time I right click an entity in spectator mode, PlayerInteractEntityEvent fires twice.

rotund ravine
#

I meann prolly does in survival too

sullen marlin
#

Events tend to just do what the client does

#

If you print a stack trace and the hand and click type you might get a better idea of if its a bug or feature (idk off the top of my head)

unborn hollow
#

I'll try that out, it's just weird because right clicking the entity once in survival/creative/adventure mode only fires the event once, but when right clicking once in spectator it fires twice.

#

Yeah, it appears to be a bug

sullen marlin
#

Are you up to date?

#

I actually seem to remember dealing with this recently

unborn hollow
#

my server's the latest version of spigot and the plugin's "1.21.4-R0.1-SNAPSHOT"

unborn hollow
sullen marlin
#

Anyway if you think its a bug, open a report

#

?jira

undone axleBOT
coarse pelican
#

For suspicious blocks, PlayerInteractEvent fires when the player actually clicks on a block whereas BlockDropItemEvent fires when the brushing is complete, assuming there is an item held within the BrushableBlock.

There is a scenario where no event fires and I'm wondering if this is a bug or if this is something that should be addressed via a suggestion.

If you right-click on a BrushableBlock and hold the click down as the mouse moves from one BrushableBlock to another, if the second block instance has no held items...neither the PlayerInteractEvent nor the BlockDropItemEvent fires. None of the related BlockFromTo or likewise "block changing" events fires for suspicious blocks changing into normal blocks, and thus there is no event or way to detect this behaviour. Intentional? Bug? Overlooked and requires a suggestion?

unborn hollow
sullen marlin
coarse pelican
sullen marlin
#

Yeah that still surprises me

#

Anyway bug tracker above

wintry dagger
#

hey guys, i've recently upgraded from a 1.16 server to a 1.21 server, and my itemflags no longer work. As in, hide_attributes doesn't hide the damage attributes on swords for instance. I've noticed that attributes are deprecated and to be removed, but haven't found any alternatives. Any tips? ❤️

#

I saw a (potential) solution on the forums to add a dummy attribute to the item, but like I said, attributemodifier constructor is deprecated so idk

summer scroll
#

Usually I do Material.DIAMOND_SWORD.getDefaultAttributes()

wintry dagger
#

this.meta.addAttributeModifier(Attribute.GENERIC_ATTACK_DAMAGE, new AttributeModifier("dummy", 0, AttributeModifier.Operation.MULTIPLY_SCALAR_1));

#

This work ye?

#

just an attribute that doesnt do anything

quaint mantle
#

There is a way to get when a day in minecraft is finished?

chrome beacon
chrome beacon
wintry dagger
chrome beacon
#

That issue should be Paper specific

#

Paper and Spigot handle hide attributes differently

wintry dagger
#

In what way?

chrome beacon
#

On Paper you need to add your own attributes for it to do anything

#

On Spigot it will clear all attributes which causes it to hide

wintry dagger
#

Oh hm, maybe this would be paper related then 😂

chrome beacon
#

and this is why I don't trust users when they tell me what they're running

marsh sluice
#

how can i line up characters cause unicodes dont work it just does a box

#

im using emojis on a score board

umbral ridge
marsh sluice
#

but some are smaller then others

#

i am lowkey dumb

marsh sluice
#

how do i get a small space

umbral ridge
#

unicode

marsh sluice
#

instead of a space

misty ingot
#

is there a way to apply a velocity vector to particles

#

i am trying to make particles that appear behind an arrow appear almost like an engine plume

#

and also is there a way to set a lifetime for a spawned particle

chrome beacon
#

You can't set the lifetime

#

However setting the particle offset will make the particles move to where you want

misty ingot
#

for an arrow, which way do the X,Y and Z offset axes face?

chrome beacon
#

Depends on the facing of the arrow

#

Time for some trig

misty ingot
#

not a huge fan of trig

quaint mantle
blazing ocean
#

yes

orchid furnace
#

I've only recently came back to java server developing so I am a bit rusty - Does anyone know why the permissions message isn't working? I'm not sure if I am doing it wrong or something however it works but it just says unknown command instead of sending the actual permission message that was set

eternal oxide
#

permission messages are no longer sent

orchid furnace
#

oh rly

#

damn alright then xd

quaint mantle
#

You have to code it

eternal oxide
#

if the client does not have the command in its command map it just says unknown command

orchid furnace
#

Ahhhh I see

quaint mantle
blazing ocean
#

yeah

orchid furnace
blazing ocean
#

yes

orchid furnace
#

Alrighty :D Thank you!

quaint mantle
eternal oxide
#

note that if you have a permission assigned to teh command your code will never be called

blazing ocean
dawn flower
#

what happens if i do this

public class MyClass<T extends Event> {
  public void method(T t) {
    ...
  }
}

public class YourClass extends MyClass<PlayerDeathEvent> {}

somewhereInTheCode() {
  new YourClass().method(instance of PlayerInteractEvent)
}```
blazing ocean
#

whatever's in the method?

dawn flower
#

yes

misty ingot
#

yes indeed

dawn flower
#

basically supply it with something other than what its generic is

misty ingot
#

probably wont work

dawn flower
#

i know that, but what exception happens

#

i want to catch it

misty ingot
#

?tas

undone axleBOT
dawn flower
#

too much work

misty ingot
#

too bad, so sad

blazing ocean
misty ingot
#

have you tried reading java docs

dawn flower
#

idk what to look for

misty ingot
#

a simple google search would help

#

nvm that gif is not applicable here

dawn flower
#

?

misty ingot
#

just search it up

blazing ocean
#

no idea what youre even talking about

dawn flower
#

same here

blazing ocean
#

any runtime exception?

#

no idea atp

misty ingot
#

he wants to know if it throws an error what error will it throw

#

like brotha

blazing ocean
#

it'll throw whatever's thrown?

misty ingot
#

exactly

#

just catch (Exception e) and move on

dire flume
#
Applying CraftBukkit Patches
Backing up NMS dir
Patching net/minecraft/server/DispenserRegistry.java
Exception in thread "main" java.lang.RuntimeException: Error patching net/minecraft/server/DispenserRegistry.java
    at org.spigotmc.builder.Builder.lambda$startBuilder$2(Builder.java:617)
    at java.base/java.util.stream.ForEachOps$ForEachOp$OfRef.accept(ForEachOps.java:184)
    at java.base/java.util.stream.ReferencePipeline$2$1.accept(ReferencePipeline.java:179)
    at java.base/java.util.stream.ReferencePipeline$3$1.accept(ReferencePipeline.java:197)
    at java.base/java.util.Iterator.forEachRemaining(Iterator.java:133)
    at java.base/java.util.Spliterators$IteratorSpliterator.forEachRemaining(Spliterators.java:1939)
    at java.base/java.util.stream.AbstractPipeline.copyInto(AbstractPipeline.java:509)
    at java.base/java.util.stream.AbstractPipeline.wrapAndCopyInto(AbstractPipeline.java:499)
    at java.base/java.util.stream.ForEachOps$ForEachOp.evaluateSequential(ForEachOps.java:151)
    at java.base/java.util.stream.ForEachOps$ForEachOp$OfRef.evaluateSequential(ForEachOps.java:174)
    at java.base/java.util.stream.AbstractPipeline.evaluate(AbstractPipeline.java:234)
    at java.base/java.util.stream.ReferencePipeline.forEach(ReferencePipeline.java:596)
    at org.spigotmc.builder.Builder.startBuilder(Builder.java:568)
    at org.spigotmc.builder.Bootstrap.main(Bootstrap.java:60)
Caused by: java.io.FileNotFoundException: work/decompile-3600f5e0/net/minecraft/server/DispenserRegistry.java (No such file or directory)
    at java.base/java.io.FileInputStream.open0(Native Method)
    at java.base/java.io.FileInputStream.open(FileInputStream.java:213)
    at java.base/java.io.FileInputStream.<init>(FileInputStream.java:152)
    at com.google.common.io.Files$FileByteSource.openStream(Files.java:134)
    at com.google.common.io.Files$FileByteSource.openStream(Files.java:122)
    at com.google.common.io.ByteSource$AsCharSource.openStream(ByteSource.java:474)
    at com.google.common.io.CharSource.readLines(CharSource.java:371)
    at com.google.common.io.Files.readLines(Files.java:552)
    at org.spigotmc.builder.Builder.lambda$startBuilder$2(Builder.java:605)
    ... 13 more

i get this error when i do: java -jar BuildTools.jar --rev 1.20.6 --remapped
anyone knows why?

i am using linux btw

undone axleBOT
dawn flower
misty ingot
blazing ocean
#

i mean, it'll throw a Throwable

dire flume
#

it says file not found

#

but i have just BuiltTools.jar

dawn flower
#

i added a try except block but it still gives me the warning, do i tell it to shutup or should i be concered

dire flume
#

other versions compiled perfectly just 2 version has errors

#

from 1.19 to 1.21.4 everything was perfect other than 2 versions

blazing ocean
#

well what warning?

dawn flower
#

Unchecked call to 'x' as a member of raw type 'y'

dire flume
#

so there is only one packed up jar file thats why error message doesnt understandable for me

misty ingot
#

have you tried just... not supplying it with something other than what its generic is

dawn flower
#

idk what the generic is

misty ingot
#

are you building a library

dawn flower
#

yeah

#

yeah i am

dire flume
#

java -jar BuildTools.jar --rev 1.20.6 --remapped

misty ingot
#

well then just tell the user what generic they are supposed to give it and then let it scream at them when they dont

misty ingot
dawn flower
#

ok

misty ingot
#

or you could do smth like

#

im not sure if this will work but
check the type of the entered generic and if it doesnt match then throw an error yourself

dire flume
#

exact same errors

misty ingot
#

no clue

chrome beacon
#

Did you run it in an empty folder?

eternal oxide
#

old files in work can cause issues

dire flume
#

what is bt folder?

chrome beacon
#

The folder that BuildTools is in

dire flume
#

oh

#

ok

#

thanks that is gonna work prob

fickle spindle
#

does someone know why when i right click on a block my PlayerInteractEvent event counts 2 clicks? how do i fix this

blazing ocean
#

?interactevent

undone axleBOT
#

The PlayerInteractEvent may be called once per hand. If you only want code to be executed once, you can check the result of https://hub.spigotmc.org/javadocs/spigot/org/bukkit/event/player/PlayerInteractEvent.html#getHand(), then decide functionality.

For example, only executing code if the main hand was used:

@EventHandler
public void onPlayerInteract(PlayerInteractEvent event) {
    if (event.getHand() != EquipmentSlot.HAND) { // * if the hand used is NOT the main hand:
        return; // do not progress past this point  |
    }
    // provide functionality
}
fickle spindle
#

ty

grim hound
#

if I have a base64 encoded skull texture url

#

can I somehow make the skull show a different part of the skin, so besides the head?

orchid furnace
#

How can I make a config that lets the player make a configureable prefix?

quaint mantle
#

When the world time ticks reach 24000, resets to 0?

chrome beacon
undone axleBOT
orchid furnace
#

Thank you! :D

chrome beacon
quaint mantle
#

I just checked it

#

thanks !

misty ingot
#

player.showParticle() only renders the particle on client side right

blazing ocean
#

yes

misty ingot
#

so lets say hypothetically i have 10 million particles spawned at one player, it wont lag the server, only the player will have to handle the load

#

will the process of spawning 10 million particles for the player lag the server? or is it all just in one command to tell the client to spawn x particles

chrome beacon
#

That would be one packet per spawnParticle

misty ingot
#

this is completely hypothetical, i am not spawning 10 million particles for anyone

misty ingot
#

so if im sending one spawnParticle packet on average every 1 tick that wont affect the server in the slightest

chrome beacon
#

Yeah that's fine

misty ingot
#

and times that by a couple hundred players?

chrome beacon
#

Fine

misty ingot
#

n o i c e

#

disclaimer: I am not spawning 10 million particles for hundreds of players once every tick, i am not stupid, i was just testing the limits

#

i really really want to make a cape effect out of those cherry blossom particles but since i cant set particle lifetime the cape would be more of a block of cherry blossom extending down to the ground

orchid furnace
#

Is reloadConfig() correct for a plugin reload command or?

chrome beacon
#

yes

orchid furnace
#

Amazing tysm

misty ingot
orchid furnace
#

Yeah no it's just a basic config.yml

misty ingot
#

mhm

woeful vale
#

Guys, this error keeps appearing when I try to execute a command, what could it be?
"An internal error occurred while attempting to perform this command"

chrome beacon
#

That means an error happened

#

Check the console for the actual error

misty ingot
#

is there an easy way to check if the player is currently standing completely still (or in fly mode, completely still)

proven kite
#

can someone help me with item stakcs?

#

I dont know how to make a potion that is a healing potion

fickle spindle
#

hello, how can i make the nametag non visible for the other players?

orchid furnace
#

Does anyone know how I can make a plugin reload its config? I'm using a default config and I've tried using reloadConfig(), so many more things it just doesnt reload or it just undos changes in the config

chrome beacon
proven kite
#

wait

#

I dont understand

#

how do I even use it wtf?

chrome beacon
#

Show your code

#

?paste

undone axleBOT
orchid furnace
#

uhh entire code or just the code for reloading?

chrome beacon
chrome beacon
proven kite
proven kite
#

item stacks

chrome beacon
proven kite
#

and used p.setItem(slot, itemstack);

#

oh :(

#

Im blind

orchid furnace
#

please ignore my most likely awful coding

chrome beacon
#

You're keeping a reference to the old config

#

update your config variable with the new config

quaint mantle
#

How I can like lock a event?. I explain, I made a DayCycleFinishEvent checking the world time with a runTaskTimer but if I check it each 2 sec or whatever it gets fired sometimes. How could I "lock" the event and unlock it when needed

fickle spindle
#

how can i put a custom display name>

orchid furnace
robust helm
#

config = getConfig()

chrome beacon
#

^^

orchid furnace
#

would that be onEnable or the reload command?

chrome beacon
#

after you've reloaded the config

#

You probably want to do it in the onEnable as well instead of having it run on init

fickle spindle
#

how can i set a custom nametag?

robust helm
#

and maybe u want Entity#setCustomNameVisible

fickle spindle
robust helm
#

a player is an entity

chrome beacon
#

I don't understand what you mean by locking your event though

fickle spindle
orchid furnace
robust helm
#

or im not sure

chrome beacon
#

^^ Players work a bit differently

#

As I've already mentioned you need teams

fickle spindle
#

ty

chrome beacon
orchid furnace
#

Yep, one moment

chrome beacon
#

Are you refering to the reload prefix not updating?

orchid furnace
#

Yeah

chrome beacon
#

That's because you're getting it before the reload

orchid furnace
#

oh my god

#

i am so dumb

#

Thank you so much I honestly am so dumb 😭

chrome beacon
#

No worries

#

It happens

proven kite
#

is there any way to turn this
ItemStack healpot = new ItemStack(Material.POTION);
into health potion?

chrome beacon
#

Yes

#

get the item meta and cast it in to potion meta then use the method I linked you

#

Don't forget to set the item meta back otherwise it won't apply

proven kite
#

I dont know where is the thing Im looking for

chrome beacon
#

I sent two links

#

one for the enum entry and one for the method you want to use it in

proven kite
#

I know

#

I dont know how to use it tho...

#

can you not just give me an example...

chrome beacon
#

?spoon

undone axleBOT
#

Spoonfeed a newbie for a day and they'll come back with more questions. Teach them to find their own answers and you'll both be better off: you won't get stuck answering the easy questions and they'll be much more productive than before.

proven kite
#

what is spoon

#

omfg

#

this is so dumb

chrome beacon
#

Basically if I give you the answer you'll just copy paste it and not learn

proven kite
#

"Spoonfeed a newbie for a day and they'll come back with more questions. Teach them to find their own answers and you'll both be better off: you won't get stuck answering the easy questions and they'll be much more productive than before." 🤓

proven kite
#

I learnt everything I know about java so far from watching my friends screenshare

#

and he was explaining random lines to me

#

but ok

worldly ingot
#

You need to get the ItemMeta of the ItemStack you just created, cast it to a PotionMeta, use setBasePotionType(), then set the item meta back onto the item stack

#

This is something you should be able to do without a copy/pastable snippet

proven kite
#

fine

proven kite
#

ok

worldly ingot
#

Yes

proven kite
#

thank you

merry cove
#

is setting player time and weather reset on disconnect? or do I need to track it on disconnect?

chrome beacon
#

I don't think it's saved

#

but you can give it a try

orchid furnace
#

Question about making public plugins - If I wanted to have it for multiple versions, say 1.20, 1.21, ect would I have to make it for each version or would the jar usually sort of cover them and I would just have to test the versions it works on

chrome beacon
#

If you're just using the API you'd write for the oldest version you want to support

#

Testing on a couple different versions is of course still recommended

orchid furnace
#

Ahhh okay thank you! :D

merry cove
#

an issue doing it that way can be the you won't directly support newer verions and materials for example if the api is older if I recall correct.

robust helm
#

yea, you can use <Enum>.valueOf after a version check

#

or like try catch idk if one can easily check version

echo basalt
#

there's commodore for porting your stuff

uncut relic
#

i am sure this is a stupid question but is this the correct way to set the model of a item in 1.21.4+? ``` @EventHandler
public void onPrepareAnvilEvent(PlayerInputEvent event){
if (event.getPlayer().getCurrentInput().isSneak()){

        ItemStack itemStack = new ItemStack(Material.STICK);
        NamespacedKey modelKey = new NamespacedKey("test", "katana");
        itemStack.getItemMeta().setItemModel(modelKey);
        
        event.getPlayer().getInventory().setItem(0, itemStack);

    }

}```
robust helm
#

nvm

chrome beacon
#

No you were right

#

getItemMeta returns a clone

uncut relic
#

ah

#

ok

robust helm
#

oh lol

uncut relic
#

i didn't realise that

#

thank you kento and Olivo

mellow sand
orchid furnace
#

If i were to try and make a mutechat plugin, would I be correct to assume that a variable would need to be set and when people chat if that variable is set I would need to cancel it if they are not op/have a permission

vocal cloud
#

Yes, alongside an error message to the user so they know why they can't speak

rough ibex
#

Or be a troll and shadowmute them

orchid furnace
#

sorry for the ping-

#

aaa

rough ibex
#

i dont care

robust helm
#

to save selected cosmetics/perks in my lobby plugin, should i make a PersistentData class with a field in my LobbyPlayer class, or do it seperately from LobbyPlayer?

#

like

public class LobbyPlayer {
    PersistentData persistentData;
    ...
}
#

or make some PerkRegistry

#

also no pdc wont do the job as the world is discarded on each shutdown

#

hm or maybe registry with a getter that retrieves the value from the registry

#

yea that sounds smart ig :)

fickle spindle
#

how can i set in a gui a Player_Head with an owner for give it the skin of the owner

chrome beacon
#

That will be done automatically

robust helm
#

so that when u click it you will get the skin of the heads owner?

fickle spindle
robust helm
#

ah

chrome beacon
#

You set the owner of the head

#

in the skull meta

robust helm
#

skullmeta afaik

#

yea

fickle spindle
#

ty

orchid furnace
#

Does anyone know why this isn't working?

        if (chatMute == true) {
            Player p = event.getPlayer();
            if (p.hasPermission("staffessentials.bypassmutechat")) {
                event.setCancelled(false);
            } else {
            String plprefix = (config.getString("prefix"));
            event.setCancelled(true);
            p.sendMessage(plprefix + " §cThe chat is currently muted.");}
        }```
#

The toggle for it works so the variable in the command is being set and unset

chrome beacon
#

You don't want a boolean variable for the mute

orchid furnace
#

oh?

chrome beacon
#

Well a single one at least*

#

Wait nvm you want to mute the entire chat not a single player 💀

orchid furnace
#

Yeah

#

xD

chrome beacon
#

== true is reduntant btw

orchid furnace
#

so remove true and just if (chatMute)?

chrome beacon
#

yeah

wet breach
#

you will want to add for the method to ignore cancelled as well

#

otherwise it may get bypassed if it is indeed cancelled and never run again lol

misty ingot
#

also cmon use guard clauses

#

start early

chrome beacon
#

and don't undo the cancelled state

#

Some other plugin might want to block a message

misty ingot
#

whats the point of event.setcancelled(false) lmao

#

i just noticed it

orchid furnace
#

honestly i dont know.. i just sort of put it there because its the opposite of true 😭

chrome beacon
#

Yeah just early return with a guard clause

misty ingot
#

well first check if chat ISNT muted, then return
now you know that chat IS muted

check if player has permission, if yes, return

now you know player doesnt have bypass perm either
now send message, and set event cancelled

#

using guard clauses like this avoids unnecessary indentation and if-else towers

#

its good practice

#

also since you are adding a plugin prefix before every message you send to the player you probably wanna make a method for it somewhere which takes the message, adds prefix before it and sends that to the player and just call that method everywhere

wet breach
#

and make sure you are ignoring if event is cancelled for the method as well

#

so that it isn't accidentally bypassed/skipped

chrome beacon
#

You mean so the message isn't sent and then the result is bypassed?

inland agate
#

Have anyone tried worked with custom font json in order to change a GUI's looking, based on the title of the container and a resourcepack?

chrome beacon
#

Some people have done that

#

?ask

undone axleBOT
#

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

misty ingot
#

do they also have a nohello command

#

?nohello

undone axleBOT
misty ingot
#

oh they do, nice

#

too bad NOBODY FOLLOWS IT EVER (in dms)

wet breach
#

?vampire

chrome beacon
#

Just reacting with a wave emoji seems to stop people from DMing you

#

so that's what I do when someone writes hello

misty ingot
#

i always react with a wave emoji and then say "how may i help you"

#

but im getting tired of the person not telling me how i may help them

wet breach
#

in fact, I routinely forget they are there

#

currently have 25 message requests

misty ingot
#

ive had several cases where ive been reminded by my conscience about that one dm i had with that one potential client that i havent replied to for a week

#

i always check dms if i have a notification but replying to them on time or ever is not guaranteed

wet breach
#

oldest request is from September 1, 2022

#

shame, they been waiting 2.25 years for a response

misty ingot
#

well i freelance so i gotta check mine

eternal oxide
#

I have all dms blocked. Unless you are a friend. I don't have friends 🙂

misty ingot
wet breach
inland agate
#

I know, I've been member before. I've seen it be used within a spigot plugin and I'm trying to make my own, so I don't have to rely on other plugin.
I've made the custom front

  "providers": [
    {
      "type": "bitmap",
      "file": "minecraft:textures/gui/dead_mans_trail.png",
      "ascent": 8,
      "height": 256,
      "chars": ["\uF801"]
    }
  ]
}

Something like that. Using Unicode and matching the gui to the override with custom font

misty ingot
#

i need a discord mod that shows me the channel name in huge white bold text in the top middle of my screen

#

prolly still wont look at it but it'll be there in spirit

fickle spindle
#

how can i convert like the player name to small text font in a message

blazing ocean
#

map the characters

#

or use an actual resource pack font

fickle spindle
#

wdym by map the characters?

blazing ocean
#

have a map of the regular upper/lowercase to the smallcaps char

fickle spindle
chrome beacon
#

map:
A - ᴀ

#

or if by example you mean write it for you then no

blazing ocean
#

chrome beacon
#

ty ty

blazing ocean
#

tbh I find using an actual font much better

orchid furnace
chrome beacon
#

Don't use setCancelled false

orchid furnace
#
        if (!chatMute)
            return;
        else {
            event.setCancelled(true);
            Player p = event.getPlayer();
            String plprefix = (config.getString("prefix"));
            p.sendMessage(plprefix + " §cThe chat is currently muted.");}
        }```
Ive done thism not sure if this is any better but it still doesnt work so im not sure
chrome beacon
#

You can skip the else

#

Since there is a return statement the method will exit before any lines below are run

orchid furnace
#

soo like ``` public void onChat(AsyncPlayerChatEvent event) {
if (chatMute)
event.setCancelled(true);
Player p = event.getPlayer();
String plprefix = (config.getString("prefix"));
p.sendMessage(plprefix + " §cThe chat is currently muted.");}
}````?

chrome beacon
#

Keep the return statement

#

Just skip the else

#

As for it not working are you missing the EventHandler annotation or did you just forget to copy it?

orchid furnace
#

oh i am very dumb

orchid furnace
chrome beacon
orchid furnace
#

Ooh okay

#
    public void onChat(AsyncPlayerChatEvent event) {
        if (!chatMute)
            return;
        {
            event.setCancelled(true);
            Player p = event.getPlayer();
            String plprefix = (config.getString("prefix"));
            p.sendMessage(plprefix + " §cThe chat is currently muted.");}
    }```so like this?
robust helm
#

using guard clauses means guardening the actual logic using ifs and returns

#

so youd want to check if its muted, and if not return. Then just write the logic below as the code will stop executing at return, so an else is redundant

chrome beacon
fickle spindle
#

i'm using AsyncPlayerChatEvent to edit some stuff like the proximity message etc but if i want to use like the placeholder for luckperms pex in the chat, do i need to import something or can i put %x% and the placeholer api will do his job?

chrome beacon
#

No you need to use the PlaceholderAPI API

#

hence it's name

pseudo hazel
#

yeah, there needs to be some way for PAPI to know what words to replace and what to put in its place

fickle spindle
#

and how can i do it?

chrome beacon
#

Read the PlaceholderAPI docs

pseudo hazel
#

if you don't need to add any placeholders yourself you can just pass your strings into the function to just convert existing ones

#

but yeah

#

its all on the docs

wooden frost
#

Gonna have to ask an ugly question here, but does paper even have NMS? And if so, how does one even use it / set it up

robust helm
chrome beacon
#

Paper is not a rewrite of the entire server

orchid furnace
# chrome beacon Now you have an extra pair of {}
    public void onChat(AsyncPlayerChatEvent event) {
        if (!chatMute)
            return;
        event.setCancelled(true);
        String plprefix = (config.getString("prefix"));
        event.getPlayer().sendMessage(plprefix + " §cThe chat is currently muted.");}```?
chrome beacon
#

yes like that

wooden frost
#

😭

orchid furnace
#

😭

wooden frost
#

i did this to myself once

pseudo hazel
#

paper has its own discord server that wants to explain all about its paperweight and userdev for nms

wooden frost
wooden frost
#

HAHA YOU FOOL

pseudo hazel
#

skill issue?

orchid furnace
#

sob?

wooden frost
pseudo hazel
#

looks like youll have to do some googling instead

wooden frost
red sedge
#

How would I have a directory that contains other directories and/or yaml files in the same directory that has stuff like the config

orchid furnace
chrome beacon
#

Did you register the listener?

orchid furnace
#

yeah

chrome beacon
#

Could you send the entire code in a paste

#

?paste

pseudo hazel
undone axleBOT
pseudo hazel
#

you can set it up however you want

#

or do you mean the server config

#

in which case you cant

pseudo hazel
#

or shouldnt rather

red sedge
red sedge
wooden frost
# wooden frost aww fucking damn it

hate the mod team there, it's mentaly degraded. Im chill with yall, the paper people are, well and ugly word here but the only fitting one there, mentally brainded.

pseudo hazel
#

oh

#

what ide are you using?

chrome beacon
red sedge
#

intellij

pseudo hazel
#

well in there there should be 2 folders, java and resources

orchid furnace
red sedge
#

do I just put a directory in the resources/
I need that to be availabe & modifiable to the user

pseudo hazel
#

you can put into resources folder whatever structure you want

chrome beacon
#

No that just makes the class a listener

#

It does not register it

orchid furnace
#

ah

pseudo hazel
#

you can make it available by using saveResource()

chrome beacon
#

?events

#

?event

pseudo hazel
#

which copies the file from the jar to the plugin folder on disk

chrome beacon
#

?eventapi

undone axleBOT
chrome beacon
#

There we go I always forget the api part of the command

quaint mantle
orchid furnace
#

so I would just add the getServer().getPluginManager().registerEvents(new name(), this); to the onEnable?

chrome beacon
#

You don't want to make a new instance of your main class

#

So just pass the one you already have/are in

pseudo hazel
#

or just use your main class for everything and pass in this, this

#

/s

chrome beacon
sonic goblet
#

I suspect this is a bug, but should PlayerFishEvent's .getHand() method be returning null during the CAUGHT_FISH state?

pseudo hazel
#

its probably just not set because I guess the data isnt important at that point?

#

im guessing

sonic goblet
#

I just looked at the docs and missed it, this is why I double checked here :p thanks

chrome beacon
#

Wait you're storing the perks by their class rather than their instance

#

That's an odd choice

orchid furnace
robust helm
#

now that i think about it, true

#

but all instances would completely act the same way then

#

yea i might change that

chrome beacon
#

as for using Redis you can do so if you want to

#

It's not required really, does it matter if the perks aren't loaded for a second or two

robust helm
#

oh true

chrome beacon
robust helm
#

ill write it in the todo list for later optimization. ty!

chrome beacon
#

Just don't run your SQL query on the main thread

#

and handle the case that the perks aren't loaded, then you'll be good to go

orchid furnace
#

getServer().getPluginManager().registerEvents(this, this);?

chrome beacon
#

yes

orchid furnace
#

It works - tysm omg

I would honestly be so confused without you 😭

robust helm
#

i recommend splitting your project into multiple classes

#

so for each command an own class using CommandExecutor, and for each listener the same

pseudo hazel
robust helm
#

lmao

#

does command tabcompletion even work using Listeners?

#

hm ig the label works, but js setting tabcompleter wont

chrome beacon
#

TabCompleters are different from Listeners

pseudo hazel
#

yeah

#

I usually just have a tabexecutor for my commands

red sedge
#

is there any way to set the server texturepack to a folder

chrome beacon
#

You need a web server to host it with

#

@blazing ocean has a neat lib that can help with that inside your plugin

pseudo hazel
#

my host is the github repo xD

blazing ocean
fickle spindle
blazing ocean
chrome beacon
#

Why do you want those specifically

fickle spindle
chrome beacon
#

Are you trying to rip someones resourcepack 💀

blazing ocean
#

sounds like it

chrome beacon
#

You shouldn't do that

rough ibex
#

This is such a small image

fickle spindle
rough ibex
#

What am I looking at

paper viper
#

Nobody will know who’s going to know /s

chrome beacon
rough ibex
#

Okay

chrome beacon
#

probably so they can steal another servers resourcepack since it's been protected a bit from just opening

rough ibex
#

It's unifont

blazing ocean
#

i love sqrt7

fickle spindle
#

i'm just curious i don't want to remake this texture

rough ibex
#

this is unifont

fickle spindle
#

oh ok thx

rough ibex
#

why do you want these characters specifically

fickle spindle
#

because they use it in a scoreboard and i want to see if it's something that work specifically on the scoreboard or i can use it in the chat too

pseudo hazel
#

all characters work in chat

fickle spindle
#

and can i get this specific one in some ways or no?

chrome beacon
#

You can but there's no point in doing so

fickle spindle
#

oh okay sad

red sedge
#

nice save dude

grim hound
#

yo

#

anyone knows why this results

#

in this?

blazing ocean
#

because they need to be chained

grim hound
blazing ocean
#

this adds a lot of different commands to /skullcmd <..>

grim hound
blazing ocean
#

i.e. ```java
.then(floatArg().then(floatArg().then()))

or sth like that
grim hound
#

masterpiece

#

are any special characters disallowed in the name?

#

or are pretty much all characters allowed?

blazing ocean
#

that's just brig for you

#

no matter how bad your command is, remember that /execute is worse

grim hound
#

this has to be like generated

blazing ocean
#

no

#

it is not

nova notch
grim hound
#

like this thingy

nova notch
#

side note wouldnt it make more sense if you put the scale before left rot

fickle spindle
#

whow can i change the skin of a player?

grim hound
#

cuz someone didn't know how to fucking name things

#

it first applies the leftRotation and then rightRotation after scaling

#

someone at mojang decided "hmmm, rotation... rotBeforeScale, rotAfterScale? Nahhh. Left & Right"

nova notch
#

bruh

#

classic mojank

grim hound
#

@blazing ocean you know anything about this?

blazing ocean
#

dunno, never used commodore

#

but in general, if you have a suggestion provider applied, the client will not render the name but rather the dispatched suggestions

quaint mantle
#

hi rad

quaint mantle
kind coral
#

translation
leftrot
scale
rightrot

can all be unique elements then you can just append xyz where necessary and the angle too

grim hound
amber fjord
#

?javadoc

amber fjord
#

i dont see any documentation on how to get that

echo basalt
#

oh yeah you're the guy in helpchat offering 5 bucks

#

I have a rough idea of what's going on

#

Down to hop on a call?

amber fjord
remote swallow
#

using brig or a commandlib that supports brig

amber fjord
#

🙃

#

whats brig

chrome beacon
amber fjord
#

o

lilac tide
sullen marlin
#

?notworking

undone axleBOT
#

"Does not working" is a useless statement. Please describe what exactly is not working, what you expect it to do, and what actually happens. If you get any console errors, also ?paste the entire stacktrace.

grim hound
#

does anyone have a color -> block map I could use?

#

basically just mapping the given color to the closest block of that color

sullen marlin
#

Is there not an API for one

lilac tide
grim hound
sullen marlin
#

If so, sad - pull request one

grim hound
#

uh

#

what do you-

#

uh

sullen marlin
#

There is

#

BlockData#getMapColor

tawdry finch
#

yo, any recommendations on rollback plugins, coreprotect wont work

grim hound
sullen marlin
#

idk

#

Somewhere between 1.13 and 1.20

grim hound
#

what I mean is

#

I'm using the 1.20.2 api

#

but uh

#

it ain't not

#

not not

#

there

sullen marlin
#

It's certainly in 1.20.2

grim hound
#

are there 2 block data classes?

worldly ingot
#

You're talking about 2 opposite things lol

#

Shadow wants a way to map a colour to a block whose texture closest matches that colour, md is suggesting a method to get the map colour of a block

sullen marlin
#

Nah I lied

#

It's 1.20.4

grim hound
sullen marlin
#

More recent than I thought

worthy yarrow
#

we need more physics api

grim hound
sullen marlin
#

f=ma

#

What more physics do you need bro

worthy yarrow
#

kek

worldly ingot
worthy yarrow
#

Cmon now who wants to go through the trouble of mimicking disc golf flight physics in minecraft

grim hound
worldly ingot
#

We're not adding disc physics into Bukkit KEKW

#

But I appreciate the optimism

worthy yarrow
#

It'd make my project a lot easier :p

sullen marlin
#

Think of the disk golf tho

worthy yarrow
#

I can contribute 1/16th of the pr

grim hound
worthy yarrow
#

That and some shit interpolation

#

I don't do .lang files kek

lilac tide
#

Can anyone compile a gradle plugin for me?

sullen marlin
#

Just use jbullet or something

grim hound
#

no

sullen marlin
#

No, post the error

#

We will help you resolve and understand it

lilac tide
#

me?

sullen marlin
#

We will not do your work for you

#

Yes

lilac tide
#
  • What went wrong:
    An exception occurred applying plugin request [id: 'io.freefair.lombok', version: '8.6']

Failed to apply plugin [class 'io.freefair.gradle.plugins.lombok.LombokBasePlugin']
Could not create an instance of type io.freefair.gradle.plugins.lombok.LombokExtension.
Receiver class io.freefair.gradle.plugins.lombok.LombokExtension_Decorated does not define or inherit an implementation of the resolved method 'abstract org.gradle.api.provider.Property getVersion()' of abstract class io.freefair.gradle.plugins.lombok.LombokExtension.

sullen marlin
#

Probably your version of gradle is too new for that plugin

#

Gradle breaks all the time, try using a gradle released around the same time as the plugin

lilac tide
#

so like a year ago then

#

It is around the same time

sullen marlin
#

now add wind

lilac tide
#

Should I try older?

sullen marlin
#

maybe

worthy yarrow
sullen marlin
#

or you can try updated io.freefair.lombok

#

I dont use gradle so idk

soft hound
#

Alrighty, I need some help with the following things.

I want to split up my plugins into different .jar files in order to prevent the whole server going down if something goes wrong and the code is just slammed into 1 file.

With that being said, I want to make a project or socalled library which I can later use it in many other projects but I don't know the exact approach, so can someone please guide me through and help me out on how to set it up, and how do I add my library later on in the plugins I want to use down the line ?

chrome beacon
sullen marlin
#

splitting a plugin into multiple jars wont stop the server going down. also a plugin should never make the server go down

soft hound
#

Not the server sorry, I said it in a wrong way.

soft hound
#

I meant to say stop the plugin's functionality.

worthy yarrow
sullen marlin
#

you just add the library as a dependency same way as spigot-api

worldly ingot
#

The spawn method lets you pass in a Consumer in which you can mutate the entity before it spawns

#
world.spawn(location, ItemDisplay.class, display -> {
    // edit the display in here
});
#

Really glad Discord's syntax highlighting is so in-depth and detailed

worthy yarrow
#

truly

worldly ingot
#

But yeah, that consumer is nice so you don't get a one tick flicker of the default entity. It changes it first, then adds it to the world

worthy yarrow
#

cool thing it lets me do that

#

never knew

worldly ingot
#

(oh and that spawn method still does return the entity if you need it elsewhere)

worthy yarrow
#

yeah taken care of ❤️

#

So uh wind...

#

Where to even start smh

worldly ingot
#

The fun part is that it's not just wind, it's wind against a disc

worthy yarrow
#

yes

#

I have to do wind factors based on throw techniques too

worldly ingot
#

Looks like you're going to learn some more about aerodynamics

#

Enjoy that hell hole of math equations

worthy yarrow
#

Idek why I am doing this with spigot

#

I've been considering using an actual engine and just making a game

worldly ingot
#

md's JBullet suggestion wasn't a bad idea tbf

worthy yarrow
#

fyi doing course gen completely custom; wfc + pathing systems

#

Not using chunk generators cuz yk

#

why would I make it easier on myself?

#

Almost have the a* impl where I want tho so that's cool

worldly ingot
#

Oh, JBullet hasn't been updated in 11 years lol. Maybe not great

tawdry finch
#

anyone recommend a good rollback system

worthy yarrow
#

hmm

buoyant viper
sullen marlin
worthy yarrow
#

Idk if bullet physics are what I even want

sullen marlin
#

name is misleading

worthy yarrow
#

fair

worldly ingot
#

Bullet is just the name, yeah

#

It's a really common physics engine, especially for modeling software

worthy yarrow
#

It's funny because I am already doing this but with spigot for the most part

sullen marlin
#

you can steal thinky's plugin

worldly ingot
#

An oldie

sullen marlin
#

aw he removed the videos

worldly ingot
#

He also used Kotlin before it was cool I guess lol

sullen marlin
#

is he still working on hytale @worldly ingot

worldly ingot
#

No clue. Lemme see if he's in the channels

sullen marlin
#

he's on the website

worldly ingot
#

Still says Hypixel Studios, so I take that as a yes

sullen marlin
#

hytale release when

worldly ingot
#

I don't know 😭

#

Go bug thinky! Maybe he knows!

sullen marlin
#

paintently waiting for hytale

worldly ingot
#

The Minecraft killer is almost here

#

Surely soon

sullen marlin
#

"Production began in 2015 "

#

lmao, it's longer than no mans sky at this point

worthy yarrow
#
public void applyPhysics(DiscImpl discImpl, Vector discVelocity, int tick, int maxTicks, BlockFace direction) {
        final double flightPhase = (double) tick / (double) maxTicks;

        // Diminishing factor of the turn phase
        final double turnFactor = (Constants.TURN_PHASE_END - flightPhase) / Constants.TURN_PHASE_END;
        // Exponential increase of the fade phase - scale the last number for increase / decrease of the exponential effect
        final double fadeFactor = Math.pow((flightPhase - Constants.FADE_PHASE_START) / (1 - Constants.FADE_PHASE_START), 3);
        // Drag factor
        discVelocity.multiply(Constants.DRAG_FACTOR);

        this.applyTechniquePhysics(discImpl, discVelocity, tick, new TechniquePhysicsData(flightPhase, turnFactor, fadeFactor), direction);
    }```
This is the only bit where I comment what the math does lol
sullen marlin
#

"The game, originally intended to be playable in 2021, was delayed due to an increase of the game's scope."

worthy yarrow
#

I think I have like 3 layers of physics when it comes to throwing a disc

#

Can't wait to rewrite this

sullen marlin
#

"In July 2024, Hytale's developers reported that the game was being migrated to a new engine, a process that was expected to be complete by the end of the year."

worthy yarrow
#

mmmm

sullen marlin
#

the night lighting on the legacy engine is shocking lol

worthy yarrow
#

I think I like legacy better other than the stairs

sullen marlin
#

but both look like minecraft circa a decade ago

worthy yarrow
#

eek

#

I think hytale needs more funding

sullen marlin
#

that's from december lol

worthy yarrow
#

kinda looks like mc dungeons but they tried to make it look "realer" I guess?

chrome beacon
#

So they do have the funding if they wanted to

worthy yarrow
#

Hmm

#

I guess they're not too big on trying to make a minecraft clone 🤷

young knoll
#

Doesn’t the new engine kind of limit the modding abilities they promised long ago

chrome beacon
#

Yeah

young knoll
#

Reminds me of another game that tried to be a minecraft clone

#

Yogventures

chrome beacon
#

Oh no

young knoll
#

Oh and let’s not forget Hytopia

#

Not to be confused with hytale, they are 2 different things

chrome beacon
#

💀

worthy yarrow
#

For the record, I was not confused

lilac tide
#

I have a problem with another plugin where the items that are suppost to do somthing when you right click them not nothing and nothing shows in logs

grim hound
#

it's a bit

#

inaccurate

#

by a very large margin

#

I'm decently sure a random guess would be closer

#

(for comparison)

#

(pretend there's no mask)

sullen marlin
#

How are you matching colours?

grim hound
sullen marlin
#

Is that what bukkit does or does it do something more complicated

#

Iirc euclidean distance isn't great

sullen marlin
#

MapPalette.matchColor

#
        double rmean = (c1.getRed() + c2.getRed()) / 2.0;
        double r = c1.getRed() - c2.getRed();
        double g = c1.getGreen() - c2.getGreen();
        int b = c1.getBlue() - c2.getBlue();
        double weightR = 2 + rmean / 256.0;
        double weightG = 4.0;
        double weightB = 2 + (255 - rmean) / 256.0;
        return weightR * r * r + weightG * g * g + weightB * b * b;
    }```
grim hound
#

I guess I could try this one

sullen marlin
#

try that

grim hound
#

ah yes

#

the difference

#

it's definitely because map pallete averages the colors

sullen marlin
#

I think if you rendered it flat and on a map it would look right

#

but map palette not as good up close

worldly ingot
#

Yeah, map colours are not perfect. You should probably average the colour of the textures and go based on that instead. Though that involves going through the vanilla resource pack and actually calculating the average colour

young knoll
#

Idk if an average is best

worldly ingot
#

You could (and should) precompute and cache that so it's easy to access without having to do it all the time on startup

#

Oh almost certainly not, but it's better than nothing

#

Better than map colours lol

young knoll
#

Because some blocks have two drastically different primary colors

#

Yeah I want bedrock map colors :(

worldly ingot
#

<insert gneiss video on colour theory here>

#

He actually also takes into account the "noisiness" of block textures

young knoll
#

Resize the texture to 1x1 pixel with nearest neighbour and use the resulting colour

buoyant viper
#

yeah, fuck it, ill watch a 21 minute video on minecraft block colors

young knoll
worldly ingot
sullen marlin
#

nice name

worldly ingot
#

Very gneiss indeed

#

I believe he has a spreadsheet of the colour values he uses. I'm not sure if it's public though

worldly ingot
#

2slow

grim hound
#

guys guys

#

does any of you know how to get the corners of a display block?

sullen marlin
#

isnt there a bounding box method

#

getBoundingBox

worldly ingot
#

Unsure if those are accurate to its transformation

grim hound
#

^

#

are not

#

also its boundingbox is 0

sullen marlin
#

sad

worldly ingot
#

I would say get its location, add 0.5 on all axis (you know how to get a corner), then apply the transformation matrix to that point?

#

You would have to do it to all 6 corners, obviously, but it would work I think

grim hound
#

okay okay okay

#

O

#

I'll try

#

thank you adventurer

young knoll
#

Yep that’s basically what you need

#

Although block displays aren’t cantered

worldly ingot
#

I thought their position was relative to the center?

young knoll
#

So the default corners are at 0,0 1,0 1,1, etc

worldly ingot
#

Oh, is its position bottom left?

young knoll
#

Nope only item displays are cantered

worldly ingot
#

Ah

young knoll
#

Makes it very annoying to rotate them

sullen marlin
#

just transform to centre and right rotate 😄

worldly ingot
#

Well rotating it about its center would just require a transfor

#

Yeah lol

grim hound
worldly ingot
#

Just getting your points is all that changes. Instead of 0.5, add 1 to the axis you need

grim hound
#

so one corner would be in its location and the other will be in the rest of its "normal, unchanged" block corners?

worldly ingot
#

Yeah basically

#

Treat its location like a block location

remote swallow
#

Are you lot being nerds again

worldly ingot
#

You'll have to apply the transformation manually as vanilla does it though. I wonder if we should add a Transformation#apply(Location/Vector/xyz)

#

And Vector#apply(Transformation) for funsies

young knoll
#

Yknow I never thought about using the right rotation…

worldly ingot
#

lol

grim hound
#

great info from src

worldly ingot
#

You need to get the position as a Vector3f first (it's just a simple data class, you can construct it from x/y/z coordinates), then apply in order:

  1. Multiply the vector by the right rotation quaternion
  2. Multiply the vector by the scale vector
  3. Multiply the vector by the left rotation quaternion
  4. Add the translation vector to the resulting vector
young knoll
#

You could also just use the matrix

worldly ingot
#

Can you get it as a Matrix4f?

young knoll
#

Joml should have methods to apply it to a vector

worldly ingot
#

I don't see anything to get it as a M4F. I guess you could make one but that would be the same as doing what I did above

young knoll
#

Aww lame there’s only a setter for the matrix

worldly ingot
#

Something else that could be PR'd I guess

#
Vector3f position = new Vector3f(1, 2, 3); // Your x/y/z coordinate
Transformation transformation = displayEntity.getTransformation();
position.rotate(transformation.getRightRotation())
    .mul(transformation.getScale())
    .rotate(transformation.getLeftRotation())
    .add(transformation.getTranslation());

I think this would work?

young knoll
#

Maybe

worldly ingot
#

Ignore the fact it won't compile because I forgot a ;

young knoll
#

Idk vector math is wack and sometimes things go crazy

worldly ingot
#

I guess the reassignment also isn't necessary because that vector3f is mutable

young knoll
#

If left and right rotation are both applied before translation would using right rotation to rotate a block around the center even work

worldly ingot
#

I dunno. I'm just doing what Mojang does

remote swallow
worldly ingot
#

If you're doing the transformation on 6 points, joining that into a matrix would be smarter so you're doing less operations

worldly ingot
#

Yes there are

#

I'm just stupid

young knoll
#

Choco lives in a 2.5 dimensional reality

#

Don’t question it

grim hound
#

would this be the method?

#

...I forgot to add

#

ekhem