#help-development

1 messages · Page 1133 of 1

viscid carbon
#

I was just trying to make it bold but i guess it doesn't work in code blocks xD

quaint mantle
#

😂 lol same

young knoll
#

Is it python that uses ** for exponents

worldly ingot
#

Either that or Lua

quaint mantle
#

WAIT

worldly ingot
#

One of the two

quaint mantle
#

IS THE CHOCO OF THE FORUM?

worldly ingot
#

Yes

viscid carbon
#

yeah

#

the person i see on every post in help xD

young knoll
#

It’s what he does to avoid doing his job

#

:)

worldly ingot
#

Ah, Lua has ^ for exponentials in its math library

quaint mantle
worldly ingot
#

Without the math lib, it doesn't have an exponential operator, ^ is bitwise

#

Yeah that's me

quaint mantle
#

YOO

young knoll
#

Java also doesn’t have an exponent operator

#

Sadge

quaint mantle
#

U DEV AT HYPIXEL? DAMN

viscid carbon
#

Yo people are so ungrateful on the forum its crazy

#

Show us the problem? NO

worldly ingot
#

Java has Math#pow(), it doesn't need an exponent operator lol

#

Really should be an int overload for that though

quaint mantle
#

what does ungrateful mean? sorry i don't speak very good english

worldly ingot
#

Really, a lot of Math functions need int overloads

viscid carbon
#

Not feeling or exhibiting gratitude, thanks, or appreciation.

young knoll
#

Overloads?

#

In my java?

#

Preposterous

worldly ingot
#

mfw I find myself using Mojang's Mth more often cryign

#

It is kinda crazy we're on Java 23 and we still don't have a Math#floor() that yields A FUCKING INTEGER

#

THAT'S THE WHOLE PURPOSE OF THE METHOD (╯°□°)╯︵ ┻━┻

young knoll
#

Is the cast not good enough for you

worldly ingot
#

NO angrykirby

viscid carbon
young knoll
#

Just use floating point numbers for everything

worldly ingot
#

YES angrykirby

young knoll
#

Problem solved

worldly ingot
#

I'm submitting a JEP right now to propose Math overloads for all primitives

viscid carbon
#

Denied.

worldly ingot
#

Waiting for template methods

young knoll
#

Template who what’s

worldly ingot
#

C++ templates in Java, but I'm kidding

#

Basically, "primitive generics" (extremely oversimplifying that)

young knoll
#

I see

quaint mantle
#

Yo choco

worldly ingot
#

Waiting for the Vector API to get its 9th incubator in Java 24!

quaint mantle
#

Is it possible maybe with packets, make cooldowns in items?

worldly ingot
#

We have Player#setCooldown(Material, int)

quaint mantle
#

but not per material

worldly ingot
#

Yeah you can't do it per-item, but you can in 1.21.2

quaint mantle
#

shit i'm in 1.21.1

#

lol

worldly ingot
#

Well .2 is in snapshots so

quaint mantle
#

I'm gonna update to 1.21.2 anyways

#

When it's a stable

worldly ingot
#

They're adding something called "cooldown groups" which is what you'll want to use

quaint mantle
#

oh damn cool

young knoll
#

Moar components

viscid carbon
#

I'm going to admit something, In the 10 years ive been on minecraft, ive never logged into hypixel

quaint mantle
#

u no premium?

#

or u lying

viscid carbon
#

Premium for 10 years.

quaint mantle
#

hm

viscid carbon
#

just never logged into it 🤷‍♂️

quaint mantle
#

wait a sec

#

ur acc name is MrArcane?

viscid carbon
#

arkallic now

quaint mantle
#

damn

viscid carbon
#

Yeah i dont remember that

quaint mantle
#

but ya loggd in ¯_(ツ)_/¯

ancient forge
#
    public Location location(Player player, String warpName) {

        File warpFile = new File(warpDirectory, warpName + ".yml");
        YamlConfiguration config = YamlConfiguration.loadConfiguration(warpFile);
        String worldName = config.getString( "warps." + warpName + ".world");
        Double x = config.getDouble( "warps." + warpName + ".x");
        Double y = config.getDouble("warps." + warpName + ".y");
        Double z = config.getDouble("warps." + warpName + ".z");
        float yaw = (float) config.getDouble( "warps." + warpName + ".yaw");
        float pitch = (float) config.getDouble( "warps." + warpName + ".pitch");
        World world = Bukkit.getWorld(worldName);
        return new Location(world,x,y,z,yaw,pitch);


    }``` If im retrieving world name like this why would I be getting a null error?
quaint mantle
#

Try.

ancient forge
#
    public void onClick(InventoryClickEvent event) {
        Player player = (Player) event.getWhoClicked();

        if (player.hasMetadata("WarpGuiOpened")) {
            event.setCancelled(true);
        }
        ItemStack clickedItem = event.getCurrentItem();
        String warpName = clickedItem.getItemMeta().getItemName();
        if (event.getCurrentItem().hasItemMeta()) {
            if (!event.getCurrentItem().getItemMeta().getItemName().equalsIgnoreCase("")) {
                player.teleport(location(player, warpName));
                player.sendMessage("Attempted tp");
                player.closeInventory();
            } else {
                player.sendMessage("Not detecting name");
            }
        }else {
            player.sendMessage("No meta data found in clicked item");
        }
    }``` This is how im getting the warpname
quaint mantle
#

Try it

ancient forge
#

I havnt really used the try function. I know i can print the ex but what would i try?? Would i try the whole location method? this is what i have for listener it may be the 2nd set of code

#

or would i try both the lines that are giving me the error

viscid carbon
#

hmmf, can anybody spot the problem?

    public ItemStack getIcon(Task task) {
        ItemStack itemStack = new ItemStack(Objects.requireNonNull(Material.matchMaterial(task.getIcon())));
        ItemMeta itemMeta = itemStack.getItemMeta();
        for (TaskRewards taskRewards : task.getRewards()) {
            itemMeta.setDisplayName(color("&e" + task.getName().replace("_", " ")));
            lore.add(color("&7" + task.getDescription()));
            lore.add(color("&aRewards:"));
            lore.add(color("&7" + taskRewards.itemStack().getType().name()));
            if (task.isRepeatable()) {
                lore.add(color("&4NOT REPEATABLE"));
            } else {
                lore.add(color("&2REPEATABLE"));
            }
            lore.add(" ");
            lore.add(color("&cLeft-click to start task!"));
            itemMeta.setLore(lore);
            itemStack.setItemMeta(itemMeta);

        }
        return itemStack;
    }```
worldly ingot
#

What's the issue?

viscid carbon
#

its not applying the meta

worldly ingot
#

aPES_Think I think you're doing this wrong. Your item name and lore are being set on the item multiple times

#
    public ItemStack getIcon(Task task) {
        ItemStack itemStack = new ItemStack(Objects.requireNonNull(Material.matchMaterial(task.getIcon())));
        ItemMeta itemMeta = itemStack.getItemMeta();
        itemMeta.setDisplayName(color("&e" + task.getName().replace("_", " ")));
        List<String> lore = new ArrayList<>();
        lore.add(color("&7" + task.getDescription());
        lore.add(color("&aRewards:"));
        for (TaskRewards taskRewards : task.getRewards()) {
            lore.add(color("&7" + taskRewards.itemStack().getType().name()));
            if (task.isRepeatable()) {
                lore.add(color("&4NOT REPEATABLE"));
            } else {
                lore.add(color("&2REPEATABLE"));
            }
        }
        lore.add("");
        lore.add(color("&cLeft-click to start task!"));
        itemMeta.setLore(lore);
        itemStack.setItemMeta(itemMeta);
        return itemStack;
    }
#

Isn't this more what you want?

ancient forge
#
    @EventHandler
    public void onClick(InventoryClickEvent event) {
        Player player = (Player) event.getWhoClicked();

        if (player.hasMetadata("WarpGuiOpened")) {
            event.setCancelled(true);
        }
        ItemStack clickedItem = event.getCurrentItem();
        String warpName = clickedItem.getItemMeta().getItemName();
        if (event.getCurrentItem().hasItemMeta()) {
            if (!event.getCurrentItem().getItemMeta().getItemName().equalsIgnoreCase("")) {
                try {
                    player.teleport(location(player, warpName));
                } catch (Exception e) {
                    e.printStackTrace();
                }
                player.sendMessage("Attempted tp");
                player.closeInventory();
            } else {
                player.sendMessage("Not detecting name");
            }
        }else {
            player.sendMessage("No meta data found in clicked item");
        }
    }
    public Location location(Player player, String warpName) {

        File warpFile = new File(warpDirectory, warpName + ".yml");
        YamlConfiguration config = YamlConfiguration.loadConfiguration(warpFile);
        String worldName = config.getString( "warps." + warpName + ".world");
        Double x = config.getDouble( "warps." + warpName + ".x");
        Double y = config.getDouble("warps." + warpName + ".y");
        Double z = config.getDouble("warps." + warpName + ".z");
        float yaw = (float) config.getDouble( "warps." + warpName + ".yaw");
        float pitch = (float) config.getDouble( "warps." + warpName + ".pitch");
        try {
            World world = Bukkit.getWorld(worldName);
            return new Location(world,x,y,z,yaw,pitch);
        } catch (Exception e) {
            e.printStackTrace();
            player.sendMessage("error");
        }
        return null;
    }

Does anyone know why I would be getting null for world. I get the error message sent when trying to warp

worldly ingot
#

The world you have specified at warps.<warp>.world mustn't exist

viscid carbon
worldly ingot
#

I think you're probably looking for getDisplayName() though, not getItemName()

#

That's probably your mistake

ancient forge
# worldly ingot The world you have specified at `warps.<warp>.world` mustn't exist
        File warpFile = new File(warpDirectoy, warpName + ".yml");
        FileConfiguration config = YamlConfiguration.loadConfiguration(warpFile);
        String path = "warps." + warpName;
        config.set(path + ".world", location.getWorld().getName());
        config.set(path + ".x", location.getX());
        config.set(path + ".y", location.getY());
        config.set(path + ".z", location.getZ());
        config.set(path + ".yaw", location.getYaw());
        config.set(path + ".pitch", location.getPitch());
        config.set(path + ".admin", admin);

I just made the warp and this is how I got the world initially

worldly ingot
ancient forge
#

alright im fixing everything from item to display

#

I tried switching everything to set/getdisplayname and it still doesnt work

restive mango
#

Basic java question: how is it possible for SQLite to throw a org.sqlite.SQLiteException: [SQLITE_BUSY] The database file is locked (database is locked) error? Isn't QueryTimeout normally set to infinite? Should it actually cause your thread to hang if it got locked?

#

I must sound stupid

#

but if anyone knows

#

i would greatly appreciate

#

😄

worldly ingot
#

Well the best thing you can do is to start printing out some strings to your console (or to your player) and see if you can figure out exactly what you're pulling data from

worldly ingot
#

Especially with SQLite because it only allows one read/write operation at a time

#

So if the read or write never terminates, you can't do any more

restive mango
#

okay

#

but

#

sigh

#

sure

#

if anyone can answer my question, though, i would greatly appreciate it

ancient forge
worldly ingot
restive mango
#

no

#

"Isn't QueryTimeout normally set to infinite? Should it actually cause your thread to hang if it got locked?"

worldly ingot
#

Oh, sorry, I thought that was part of your exception

ancient forge
worldly ingot
#

Unsure of SQLite's default configuration but if the query timeout is set to infinite, then yes, it's going to inevitably hang your server if you run it on the main thread

restive mango
#

hrm

#

i wonder why doesnt it

worldly ingot
#

Well if the query is done asynchronously (as it should be), then it won't hang the server

#

It'll just complain that it's busy

restive mango
#

it doesn't do that either

#

ugh i cant post pictures here

#

it throws a org.sqlite.SQLiteException: [SQLITE_BUSY] The database file is locked (database is locked)

#

(as it should)

#

but in my environment, the 'help' says be default it is unlimited

#

which means it should be hung

#

but it doesnt hang

#

and a quick ctrl shift f doesnt say it is set anywhere 😛

worldly ingot
#

The query timeout just means it won't stop the query if it takes too long. Queries can take as long as they'd like and if they're run aside from the server thread, it can stay open as long as it would like and run for as long as it would like

#

If you set your timeout to 10 seconds, if the query takes longer than 10 seconds, it's going to nuke that query. If it's set to infinite, it won't ever kill the query, but the thread on which the query is running will be blocked until it finishes

ancient forge
restive mango
#

hm

worldly ingot
#

If you just did toString() (ala System.out.println(toString())), then yes, you're just printing the toString() of the class you're in, which was your WarpGuiListener

ancient forge
#

its just not wanting to get my world

#

but i did the same exact thing to save and get it

worldly ingot
#

Did you ever save your config?

ancient forge
#

yes

#

I copied and pasted the code i used for my /warp and that works fine but as soon as I try to put it into the gui button it fails

worldly ingot
#

I mean there's some string somewhere that just isn't lining up with what's expected. It's just a matter of debugging, printing things until you identify your mistake

ancient forge
#
        YamlConfiguration config = YamlConfiguration.loadConfiguration(warpFile);
        String worldName = config.getString( "warps." + warpName + ".world");

This is me grabbing it

  test:
    world: world
    x: -115.90222328577815
    y: 80.0
    z: -37.38933247662426
    yaw: -72.09912
    pitch: 22.072598
    admin: false
``` And this is how it saves to the file
worldly ingot
#

Worth noting that you've overcomplicated things just a little bit by saving also warps.test despite saving it in its own file

ancient forge
#

This is kinda my first project still learning so I kinda got to a point where i got stuck, put it into chat gpt and kinda followed along with that. I feel that just doing that i will eventually learn

#

figured it out....

#

I accidently messed up defining the directory

glossy laurel
#

How does citizens make people execute command without it saying in console?

sly topaz
#

they probably execute it directly from the dispatcher

#

though I don't remember where exactly the command logging is intercepted

glossy laurel
#

Because theres an issue, it doesnt work when you execute the command but works when u click an npc

agile anvil
#

What is it suppose to do?
Why isn't it working? Errors, .. ?

sly topaz
#

if you ever update to 1.21.2 when it comes out, that code won't quite be valid anymore as the resurrection feature of totems can be applied to any items now, so be aware of that in the future

pseudo hazel
#

oh does that also go for the animation?

smoky oak
#

animation's grabbed from the item model i think

buoyant viper
smoky oak
#

not yet lol

sly topaz
daring lark
#
package pl.creazy.goshopping.hologram;

import lombok.AllArgsConstructor;
import org.bukkit.Location;
import org.bukkit.entity.ItemDisplay;
import org.bukkit.inventory.ItemStack;
import org.bukkit.util.Transformation;
import org.checkerframework.common.value.qual.ArrayLen;
import org.jetbrains.annotations.NotNull;
import org.joml.Quaternionf;
import org.joml.Vector3f;

@AllArgsConstructor
public class ChestShopProductHologram {
  private final ItemStack product;

  public void spawn(@NotNull Location location) {
    var world = location.getWorld();
    assert world != null;
    var hologram = world.spawn(location, ItemDisplay.class);
    var transform = hologram.getTransformation();
    transform.getScale().set(100D);
    hologram.setTransformation(transform);
  }
}
@Args("test")
  void test(@NotNull Player sender) {
    var hologram = new ChestShopProductHologram(new ItemStack(Material.DIAMOND));
    hologram.spawn(sender.getLocation());
    Message.sendChat(sender, "Created hologgram");
  }

why my hologram isn't displayed?

#

i think that it is becouse of scale but how to set sacle then?

young knoll
#

You never set the item

#

Also a scale of 100 is huge

fair rock
#

What api do you use for command (because of your @Args Annotation)? Its just a question for my own interest🫡

robust jolt
#

Hi guys, do you know how to make to open an inventory with x item and when click an item do an action?

eternal oxide
#

?gui

robust jolt
#

And specially using an anvil

sly topaz
#

just listen to the inventory click event

robust jolt
#

Ok, thanks to you all

sly topaz
#

while I like the idea of teaching patterns instead of methodology, this is kind of a lot

#

though there aren't many formatting options in a forum thread so there isn't much that could be done about that

pseudo hazel
#

a lot of what

#

what would you do if there were more formatting options?

pseudo hazel
#

i wanted this feature for some time now haha

sly topaz
sly topaz
pseudo hazel
#

haha nice

#

snapshots keep getting better and better for devs

#

but this change also means its probably possible to send a packet to the player for that animation with just any item (or like their hold item)

eternal oxide
#

A video title about ender pearls and the relevant part is literally 3 seconds at the end.

#

ah you had an index

#

video playes at 6+ minutes for me

pseudo hazel
#

yeah

sly topaz
#

the animation is an entity effect

pseudo hazel
#

right that was the issue I had

pseudo hazel
#

I wanted it to work for any item

#

and with the new update I will be able to

sly topaz
#

wonder how they will handle that API-wise

pseudo hazel
#

who, spigot?

#

its probably just going to stay the same

#

i.e. it will use the model of the item you are holding if it has death protection, otherwise default totem model is used

sly topaz
#

I didn't check the source code for the snapshot yet, but if they changed how the animation is handled, it may not be an entity effect anymore but who knows

eternal night
#

It'll still be an entity effect

pseudo hazel
#

ideally you would be able to send it like ,play the totem effect with this item, disregarding anything the player is holding

#

but I doubt that

sly topaz
#

there are entity effects that work on a context-basis so you're probably right

eternal night
#

Yea I mean, them moving this to a data component has 0 effect on the network transmission and visuals.

#

Just insttead of the client only looking for a totem of undying, it'll instead look for an item with the death_protection data component

pseudo hazel
#

yeah exactly

#

I doubt it will change the way you play the effect

#

just the conditions needed to show an item by the client

grim hound
#

why does this happen?

wet breach
grim hound
wet breach
#

is there a closing tag for it?

#

might have to switch to the other view to check

grim hound
wet breach
#

[img][/img]

#

the second one is a closing tag

grim hound
#

nono

#

I mean

#

this image was uploaded directly into spigot (does not count into the image limit of 10)

#

and it was shown

#

but after like a week

#

it no longer works

wet breach
#

re-upload it

grim hound
#

it'll just happen again

wet breach
#

probably. There is probably some kind of internal process to clear out old uploads

#

so that its not infinitely using up space from all the various threads you know

#

it probably prunes old threads that haven't been touched in some time

grim hound
grim hound
#

nothing

#

ah

#

wait

#

nvm

young knoll
#

Image might be too big

grim hound
#

it stopped showing after a week

wet breach
#

does discord allow image linking via other hosts?

grim hound
#

probably for a period of time

#

which would explain the expiration

young knoll
#

Host it on like

#

imgur

grim hound
wet breach
#

this is why I usually run my own servers for hosting files

#

this way I know there shouldn't be an issue lol

#

but it makes sense that discord wouldn't allow infinite linking to resources

#

or at the very least rate cap it

junior cradle
#

How to create a virtual world in Velocity?

#

Netty?

chrome beacon
#

Velocity the proxy?

junior cradle
sly topaz
#

and such a thing isn't possible anyway

slender elbow
#

you mean a limbo?

junior cradle
#

I need the player not to be redirected immediately to another server, but to stay on the proxy until he does something there and then redirect

slender elbow
#

so you mean a lobby, not a limbo

vivid skiff
#

How can i use a different sqlite driver version?

eternal oxide
#

you can't

#

you have to use the version bundled with Spigot

vivid skiff
#

😦

sly topaz
#

hm? Wouldn't shading and relocating different one do?

eternal oxide
#

you can't relocate SQLite natives

sly topaz
#

why not

eternal oxide
#

its hard coded

sly topaz
#

well, I'll try it for myself to check

eternal oxide
#

it will always look for the original location

slender elbow
#

it uses jni, so it'll look for the non-relocated class_method names

#

technically you can still use jni and allow for relocation, but that's on the library to support such setup

sly topaz
#

lol found md_5 while looking for the answer

#

if someone were to make a jdbc driver that uses the foreign function API instead of JNI

#

wonder if I could just fork the current driver, make the NativeDB class an interface and plop my impl that uses foreign function API to make it work

slender elbow
#

sqlite is the only jdbc driver i've used that uses native methods whatsoever simply because the whole of sqlite is a native library in general; but it could be ported directly to java without the need for any native bindings, it's just gonna be an absurd amount of work

sly topaz
#

yeah, hence why I don't want to do that lol

#

maintaining the driver without porting it already seems like a lot of effort seeing they're not even trying to add new features anymore but just keep up with new sqlite versions

vivid skiff
sly topaz
vivid skiff
sly topaz
#

just do a method check with reflection to see if it exists, if it doesn't then use something else or smth

vivid skiff
#

it would be just a mess

#

im just dropping 1.8 support

slender elbow
#

based

eternal oxide
#

Sounds like you are trying to use HikariCP

#

There is an older version that does not use isValid

#

I chose the other route. No sqlite support on 1.8

vivid skiff
#

yeah probably the best choice

quaint mantle
nova notch
#

why are people still trying to support a decade old version

blazing ocean
#

bEtTeR pVp

harsh ruin
#

Hello i want to recreate mario kart for a server, i think I can start with boat movement but it can't jumping slab, how to make it ?

shadow night
#

Using code

quaint mantle
copper spade
#

Hey 🙂

Is there a way to have custom mobs, or at least reskin existing mobs without ruining the original

I basically just want a custom texture for a mob, say a cow, and be able to spawn that in through commands / code but still have the normal cows wandering about as well

umbral ridge
harsh ruin
# quaint mantle Set velocity of boat when boat is on "jumping slab"

this my code, it dosn't work
package fr.agentomg.guilevel.tygens;

import org.bukkit.Material;
import org.bukkit.block.Block;
import org.bukkit.entity.Boat;
import org.bukkit.event.EventHandler;
import org.bukkit.event.Listener;
import org.bukkit.event.player.PlayerMoveEvent;
import org.bukkit.plugin.java.JavaPlugin;
import org.bukkit.util.Vector;

public class TyGens extends JavaPlugin implements Listener {

@Override
public void onEnable() {
    getLogger().info("TyGens activé !");
    getServer().getPluginManager().registerEvents(this, this);
    this.getCommand("spawnboat").setExecutor(this);
}

@Override
public void onDisable() {
    getLogger().info("TyGens désactivé !");
}

@EventHandler
public void onPlayerMove(PlayerMoveEvent event) {
    if (event.getPlayer().getVehicle() instanceof Boat) {
        Boat boat = (Boat) event.getPlayer().getVehicle();
        Block blockAhead = boat.getLocation().add(boat.getVelocity().normalize()).getBlock();
        Block blockBelow = blockAhead.getRelative(0, -1, 0);
        if (blockBelow.getType() == Material.STONE_SLAB) {
            Vector velocity = boat.getVelocity();
            velocity.setY(0.5);
            boat.setVelocity(velocity);
        }
    }
}

}

paper viper
#

Well I mean, you have to actually move the boat up too

#

That’s just setting the velocity, but it’s still just going to run into the slab. You need to teleport them up

harsh ruin
#

Can you please send the line you suggested I add?

blazing ocean
#

For items, there's CustomModelData but that doesn't exist for blocks or entities

#

You could make use of Item displays with CustomModelData and make your own body model using that but it's obviously gonna be a lot harder

harsh ruin
proper cobalt
#

After I hide an entity using Player#hideEntity, trying to show the entity again doesnt work
It just stays invisible

chrome beacon
#

How are you showing it again

proper cobalt
chrome beacon
#

Show your code

#

Does the code get called

#

and do you have the right and valid entity instance

#

Storing a direct entity instance like that is just asking for bugs (and a memory leak)

proper cobalt
#

well the first part works the hideEntity so the instance is correct

chrome beacon
#

It might have been correct when hide was called

#

Is it still correct and valid when show is called

proper cobalt
#

why wouldnt it be im not setting it again, just gets set once in the constrcutor

#

im checking if the code there even gets ran rq

chrome beacon
#

If the chunk for example gets unloaded

#

That entity instance will become invalid

proper cobalt
#

doesnt matter, if u walk more than 5 blocks from it, it despawns

#

yes that code does get called

#

the reappear code

#

oh i think i know the problem

#

its just a logic problem i think

#

oh im so dumb yea

grim ice
copper spade
blazing ocean
#

nope

chrome beacon
#

You probably could

#

if you use a resourcepack as well

copper spade
#

I am

blazing ocean
#

Datapacks don't allow for custom entity stuff

chrome beacon
#

Same way you'd do it in a plugin

copper spade
#

If I have say

Ghast (normal skin)
Custom Ghast

With a resource pack for that, as there is no CustomModelData is there no way to then use a datapack to get it to load that resource pack

#

Entities can have different names etc.

blazing ocean
#

CustomModelData only exists for items

chrome beacon
#

You'd make the original ghast invisible and then have a display entity as a passenger

blazing ocean
blazing ocean
copper spade
#

Can't optifine change resouces depending on entity name?

chrome beacon
#

It can

copper spade
#

i can just do that then i guess

chrome beacon
#

but that requires users to install optifine

blazing ocean
#

Please don't use Optifine in this day and age

copper spade
#

i dont want to 😂

chrome beacon
#

There are fabric alternatives that can understand the optifine format

copper spade
#

just trying to think of any hacky ways to achieve what i want but sounds like itll be far too compelx for a basic reskin. I will just destroy the orginal mob

split tinsel
#

How can i run something once every tick but for only 5 seconds

tall dragon
chrome beacon
#

?scheduling

undone axleBOT
echo basalt
#

I wonder if there's a way to filter and sort as a single operation

#

🤔

#

like filterSort(maxDistance, (candidate) -> candidate.distance(target))

slender elbow
#

.filter.sort?

chrome beacon
#

^^

slender elbow
#

you're gonna filter each element before it gets sorted, semantically it's the same

river oracle
river oracle
#

muh CPU cycles

#

though I'm pretty sure streams just apply all the operations at the end once

#

so like whats it matter

echo basalt
#

filters might run first before sort because you'd end up sorting less elements which helps with perf

slender elbow
#

yes, streams push each element through the pipeline one at a time

#

lazy evaluation

silent slate
river oracle
river oracle
#

make sure you add their repository

#

then refresh your maven in intellij

#

or whatever IDE you use

slender elbow
#

Dr. Java

silent slate
#

added their repository

river oracle
river oracle
silent slate
#

wdum? like clean using lifecyle maven

river oracle
#

I see it in the repo

#

you just need to refresh maven

silent slate
#

its not giving me the button there usually is on the top right

river oracle
#

just pop open the maven tab and click the refresh circle

#

otherwise invalidate caches

silent slate
#

net.wesjd:anvilgui🫙anvilgui-1_20_R4 was not found in https://maven.enginehub.org/repo/ during a previous attempt. This failure was cached in the local repository and resolution is not reattempted until the update interval of sk89q-repo has elapsed or updates are forced

Try to run Maven import with -U flag (force update snapshots)

river oracle
#

yeah maven is tripping

#

you either A. Don't have the Repository added or Maven has yet to recognize its there

#
  1. Refresh Maven
    or
  2. Invalidate Caches
silent slate
#

what is invalidate caches

silent slate
#

did that

#

same error

slender elbow
#

share your pom

silent slate
#

any other anvil gui api u might recommend?

slender elbow
#

?paste

undone axleBOT
river oracle
#

If you update to latest you can just use the Spigot API

silent slate
river oracle
#

that's my favorite API personally

silent slate
#

the latest?
meaning 1.20.1

river oracle
#

your version is wrong

silent slate
#

or whatever 1.21

river oracle
#

did you not read their readme?

slender elbow
#

yeah was about to say

silent slate
#

i did

river oracle
#

clearly not

#

1.10.2-SNAPSHOT

#

this isn't the version you have

silent slate
#

just that this giant piece of LUMP in the bottom is giving me an headache

river oracle
#

anvilgui-1_20_R4 this verison doesn't exist

silent slate
#

i thought that was the "base" version that all other versions hook into

slender elbow
#

As a dependency

AnvilGUI requires the usage of Maven or a Maven compatible build system.

<dependency>
<groupId>net.wesjd</groupId>
<artifactId>anvilgui</artifactId>
<version>1.10.2-SNAPSHOT</version>
</dependency>

silent slate
#

why 1.10

#

i use 1.20

river oracle
#

most projects don't use minecraft version scheme outside of spigot

#

that's their own project version

silent slate
#

nice

river oracle
#

Very few projects actually sync to minecraft unless it makes sense

#

it makes sense for spigot and paper but pretty much no where else

olive vault
#

spigot users, should I downgrade to spigot? What are the consequences and can it arise with duplication and bugs?
||I use purpur||

atomic niche
#

Most projects?

#

Does that mean that some follow Mc versioning?

olive vault
#

im using purpur

river oracle
#

I think you should be asking purpur that

#

idk what the hell they change

atomic niche
slender elbow
olive vault
#

what about from paper do yk?

#

or should I go ask them too

river oracle
#

nope cu I don't keep track of whatever they all do

river oracle
#

this is one of those make a backup and hope nothing implodes

olive vault
#

the reason i want to is because spigot minecraft nms is so easy, paper increases the difficulty

#

im trying to make a world async

#

(load)

#

im about to make the fork and I need advise

river oracle
#

👀 uhm how does paper make NMS harder

olive vault
#

adds more functions that impede on my work

slender elbow
#

lol

olive vault
#

like changes

river oracle
#

paper already did a lot of work for you with the Aync world stuff

slender elbow
#

you just gotta add, like, two lines to a gradle file and that's it

olive vault
#

i mean loading a world async

#

cause minecraft doesnt support it

slender elbow
#

disable keep spawn loaded
set fixed spawn location

#

you're done

olive vault
#

already did

atomic niche
silent halo
#

Hello guys, I am new to this discord channel, and I need some guidance on my code for Minecraft plugin development

slender elbow
#

paper chunk loading is multithreaded already

olive vault
#

WorldCreator.loadWorld()

#

lags the server for 5-10 seconds

slender elbow
#

no it doesn't if you do what i said

olive vault
#

Thread Death

#

return new WorldCreator(worldName)
.environment(environment)
.seed(seed)
.keepSpawnLoaded(TriState.FALSE)
.generateStructures(true)
.createWorld(); // not async

slender elbow
#

it's literally instant, it just creates a .dat file

#

i don't see you setting a fixed spawn location

olive vault
#

oh should I do that in WorldInitEvent?

slender elbow
#

no

#

you have to provide a ChunkGenerator

#

this is even mentioned in the javadoc

olive vault
#

oh just extends

silent halo
#

Where can I post my code to get help?

olive vault
#

not implements

slender elbow
#

?paste

undone axleBOT
olive vault
#

does a generator effect the enviorment?

slender elbow
slender elbow
olive vault
#

ill try that 😉

river oracle
#

you do that 😉

#

nice

#

I'm so proud of you

olive vault
#

👶

#

that is a weird ass emoji

#

HOLY MOTHER OF

#

ily

#

sm

#

(not in a weird way)

slender elbow
#

i have a gf

olive vault
#

ive been looking for so long

river oracle
olive vault
#

🤓 - 🤓

slender elbow
#

😳

olive vault
#

my eyes

olive vault
#

one problem

atomic niche
olive vault
#

the chunk generator overrides the world

#

how do I get the normal generation

river oracle
#

okay

olive vault
#

since im trying to make a vanilla world

#

nether end & normal

atomic niche
#

Also, been meaning to ask, who is the CFO of nothing? Do you have an entire c suite?

silent halo
#

My CFO is a guy called as "VOID"

olive vault
#
    @Override
    public @Nullable Location getFixedSpawnLocation(@NotNull World world, @NotNull Random random) {
        return new Location(world, 0, 300, 0);
    }
}

how do I make this generate a normal world (from a enviorment.world)

slender elbow
#

oh uh i think you need to override the shouldGenerate* methods to return true for vanilla generation

olive vault
#

got it

#

holy molly that was fast

#

what do I do about teleporting players into unloaded chunks

#

player.teleport(speedrun.getWorld(World.Environment.NORMAL).getSpawnLocation());

#

like is there a way to load chunks asynchronically

silent halo
#

Is there a private one to one support ticket?

glossy laurel
#

if im using an item with PDC data, would it be more efficient to build it from scratch every time or have one instance and clone it every time

smoky oak
#

it probably would be similar enough that it doesn't really matter if you dont do it en masse

smoky oak
#

time it

glossy laurel
#

?

#

also, how do leaderboards work without eating up 2 gb ram? I assume they don't save everyone in a list on ram right?

drowsy helm
#

Or a REALLY badly optimised plugin

glossy laurel
#

but as I imagine

#

storing 3k players in a list

#

and then sorting it on each update or every like minute

#

sounds like a pretty bad idea

drowsy helm
#

3k players on one server?

smoky oak
#

sorted insertion + use UUIDs should deal with that

glossy laurel
glossy laurel
smoky oak
#

theres some cursed structures in java

#

i dont remember how to do it

#

i just remember its possible

glossy laurel
#

oh wait there was like some treemap or something

#

that input already sorted values

smoky oak
#

ye probs that

glossy laurel
#

or something like that

#

but time complexity was like O(n)

#

and if u have 100 players only updating it every sec and 5k offline players

#

thats like O(500k)

smoky oak
#

no it aint#

glossy laurel
#

no?

smoky oak
#

if its alredy sorted your insertion should be log n

#

so should your search

glossy laurel
#

oh yeah ur right actually

#

hmm

#

alright nice

quaint mantle
#

could registering scoreboard teams mess with the TAB plugin?

void goblet
#

Someone know how Plan api works? I need to implement the api for get the top 10 playtime / with their time afk and time played, on a bungeecord server. But the Plan's wiki its kinda weird... they say to get the play time from my MyPlugindatabse (in this case mysql) but mysql does not have a function named "getCompletedChallengeCount" for get it

quaint mantle
#

Can someone help me? I want what when players swap the item that is on the config to their offhand, the event get cancelled but nothing happens, i already tried with get item in main hand but the same

    @EventHandler
    public void onPlayerSwapHandItems(PlayerSwapHandItemsEvent event) {
        Player player = event.getPlayer();
        FileConfiguration config = Main.getInstancia().getConfig();
        String itemName = config.getString("menu.itemname");
        Material itemMaterial = Material.valueOf(config.getString("menu.material"));
        List<String> itemLore = config.getStringList("menu.itemlore");

        if (event.getOffHandItem() != null && !event.getOffHandItem().getType().isAir()) {
            ItemStack eventItem = event.getOffHandItem();

            if (eventItem.getType().equals(itemMaterial)) {
                ItemMeta meta = eventItem.getItemMeta();
                if (meta != null && meta.hasLore() && meta.hasDisplayName()) {
                    if (meta.getLore().equals(itemLore) && meta.getDisplayName().equals(itemName)) {
                        event.setCancelled(true);
                    }
                }
            }
        }
    }
chrome beacon
#

Are you sure the event is called and cancelled

slender elbow
#

yes*

-# * citation needed

chrome beacon
#

-# * I made it up

worldly ingot
#

can confirm*

  • *cannot actually confirm

#

FUCK

#

I hate markdown

eternal oxide
#

yeah, parsign ALL text is a pain

slender elbow
#

let's go back to ascii only and sending patch files over mailing lists

eternal oxide
#

yes please

chrome beacon
#

Spigot mailing list when

eternal oxide
#

all back to IRC

quiet ice
#

where were you when spigot irc died

eternal oxide
#

had quit after the dmca

river oracle
quiet ice
#

I still have the port reserved for the irssiproxy for the spigot irc server

chrome beacon
#

I remember joining irc once having no idea what I was doing

quiet ice
#

Not sure if I have the irssiproxy config for the spigot irc server still commented - I probably did delete it though

#

Ah nope, it's still there - I just disabled autojoin

quaint mantle
#

-# lol

quaint mantle
quaint mantle
#

yo does someone know how to get internal bungee server name?

#

i need it lol

quaint mantle
#

yeah

#

yk how?

#

please

sly moth
#

Hi there !

I've been struggling lately with one of my paper plugins, at first it seemed that I was unable to get voicechat-api to load but the logs said it was loaded, I digged a lot and long story short it's linked to that fact that my plugin uses load: STARTUP

I created a minimal plugin here

  • As is, the plugin will compile and run well (it's mostly based on the example project given on the voicechat api repo and "Successfully registered example plugin" will display a few seconds after starting)
  • If you uncomment load: STARTUP in the plugin.yml however, getServer().getServicesManager().load(BukkitVoicechatService.class); returns null and the console displays a "Failed to register example plugin"

It seems that in that case, the voicechat-api classes and my plugin classes are in different classloaders and cannot reference each others. I don't know why and I don't know how I could work this out

I need my plugin to be loaded on startup because I need to do some things before and during map creation

I currently use minecraft 1.19.4 with paper api 1.19.4-R0.1 and voicechat 2.5.0

Thanks for your help, tell me if you need any other info to help me. I hope I posted it in the right channel, my apologies if it's not the case

quaint mantle
#

paper discord server

viscid carbon
#

yml is silly.

quaint mantle
#

wut

viscid carbon
#

well bukkit.

quaint mantle
#

hahaha

viscid carbon
#

Saying "diamond" is a null material

quaint mantle
#

mhm

#

DIAMOND

#

is not

viscid carbon
#

yeah that wasnt the problem anyway lol. i have my material under a configuration section. i was using getString xD

quaint mantle
#

XD

viscid carbon
#

So yeah, it was indeed a null string

quaint mantle
#

BRO WTF

#

ZOMBIE VILLAGER DROPPED A IRON SHOVEL

viscid carbon
#

thats on the drop table?

quaint mantle
#

idk but he js dropped it

viscid carbon
#

it indeed is

#

never knew that

#

i didnt know zombie villagers spawned with tools?

quaint mantle
#

damn

#

he had nothing

viscid carbon
#

strange

quaint mantle
#

he js said "Oh, imma drop this"

#

yh xd

viscid carbon
#

Question for yall.

I have an record TaskRewards

package me.arkallic.core.model.tasks;

import org.bukkit.inventory.ItemStack;

import javax.annotation.Nullable; 

public record TaskRewards(@Nullable ItemStack itemStack, @Nullable String command) {
}```

In my yml file i have multiple things to add to one record.

```yml
Tasks:
  Mine_diamonds:
    Description: Mine 5 Diamond ore
    Type: BLOCK_BREAK
    Icon: diamond_ore
    Repeatable: true 
    Requirements:
      Mine: 
        Block: diamond_ore
        Amount: 5
    Rewards:
      Items:
        DIAMOND:
          Count: 5
        iron_ingot:
          Count: 10
      Commands:
        home: "maxhomes add 1 [player]"
        op: "op [player]"```
#

So the question is how would i go about this? I currently have

 public void setRewards(Task task) {
        ConfigurationSection rewardsSection = this.getConfig().getConfigurationSection(PlayerData.defaultData.TASKS + task.getName() + ".Rewards");
        Set<TaskRewards> tempRewards = new HashSet<>();
        ItemStack itemStack = null;
        TaskRewards taskRewards = null;

        if (rewardsSection == null) {
            throw new NullPointerException("The Rewards Section is missing from: " + task.getName());
        }

        //Items
        for (String i : rewardsSection.getConfigurationSection("Items").getKeys(false)) {
            ConfigurationSection itemSection = rewardsSection.getConfigurationSection("Items");
            Material material = Material.matchMaterial(itemSection.getConfigurationSection(i).getName());

            if (material == null) {
                throw new NullPointerException("The material in your task is invalid: " + i);
            }

            itemStack = new ItemStack(material, itemSection.getInt(i + ".Count"));
        }

        if (rewardsSection.contains("Commands")) {
            for (String c : rewardsSection.getConfigurationSection("Commands").getKeys(false)) {
                rewardsSection.getConfigurationSection("Commands").getString(c);
            }
            task.getRewards().add(taskRewards);
        }
    }
#

But obv that doesnt work

#

ive tried putting it all into 1 loop, making differen't sets for commands and items, etc

#

the issue is its duplicating when it saves

river oracle
#

wdym by its duplicating when saving

#

can you show an example

viscid carbon
#

[18:17:25] [Server thread/INFO]: Mine_diamonds: Command{maxhomes add 1 [player]}
[18:17:25] [Server thread/INFO]: Mine_diamonds: ItemStack{IRON_INGOT x 10}
[18:17:25] [Server thread/INFO]: Mine_diamonds: Command{maxhomes add 1 [player]}
[18:17:25] [Server thread/INFO]: Mine_diamonds: ItemStack{DIAMOND x 5}

#

and that was with

    public void setRewards(Task task) {
        ConfigurationSection rewardsSection = this.getConfig().getConfigurationSection(PlayerData.defaultData.TASKS + task.getName() + ".Rewards");
        Set<String> commands = new HashSet<>();
        Set<ItemStack> items = new HashSet<>();
        ItemStack itemStack = null;
        TaskRewards taskRewards = null;

        if (rewardsSection == null) {
            throw new NullPointerException("The Rewards Section is missing from: " + task.getName());
        }

        //Items
        for (String i : rewardsSection.getConfigurationSection("Items").getKeys(false)) {
            ConfigurationSection itemSection = rewardsSection.getConfigurationSection("Items");
            Material material = Material.matchMaterial(itemSection.getConfigurationSection(i).getName());

            if (material == null) {
                throw new NullPointerException("The material in your task is invalid: " + i);
            }

            itemStack = new ItemStack(material, itemSection.getInt(i + ".Count"));
            items.add(itemStack);
        }


        if (rewardsSection.contains("Commands")) {
            for (String c : rewardsSection.getConfigurationSection("Commands").getKeys(false)) {
                commands.add(rewardsSection.getConfigurationSection("Commands").getString(c));
            }

            for (ItemStack i : items) {
                for (String c : commands) {
                    taskRewards = new TaskRewards(i, c);
                }
                task.getRewards().add(taskRewards);
            }
        }
    }```
river oracle
#

it seems like you're not really checking if the rewards already exist

#

that's the only way you'd end up with duplication

#

based on what I'm seeing you just yolo it into the section and just hope and pray it doesn't already exist

viscid carbon
#

I thought sets were immutable?

river oracle
#

not at all

#

HashSets are very mutable

#

the only way you can make an immutable set is using Guava's ImmutableSet or Set.of

worldly ingot
#

Maybe immutable isn't the word you're looking for

#

Unique?

#

Mutability = the ability to mutate data

viscid carbon
#

Hmm.. How would you go about doing this? using guava?

worldly ingot
#

If what you're wanting is uniqueness, a HashSet will ensure that

viscid carbon
#

hashset doesnt allow multiple of the same sets correct?

worldly ingot
#

Correct. All entries must be unique

viscid carbon
#

so when im adding it to my TaskRewards HashSet why is it adding multiple?

#
    public Set<TaskRewards> getRewards() {
        return this.rewards;
    }```
worldly ingot
#
        if (rewardsSection.contains("Commands")) {
            for (String c : rewardsSection.getConfigurationSection("Commands").getKeys(false)) {
                commands.add(rewardsSection.getConfigurationSection("Commands").getString(c));
            }

            for (ItemStack i : items) {
                for (String c : commands) {
                    taskRewards = new TaskRewards(i, c);
                }
                task.getRewards().add(taskRewards);
            }
        }
#

This looks sketchy

viscid carbon
#

Yeah looking at that currently.

#

at first i had it all in one loop

#

than i added Items and commands

#

sections

worldly ingot
#

Any reason your TaskRewards doesn't take in a Collection<ItemStack> and a Collection<String>?

#

Why does it have just one of either?

viscid carbon
#

I didn't know you can do this

worldly ingot
#

Sure, I don't see why not

#

You kind of lose the immutable nature of records by using collections but you could make them immutable copies if you'd like

#

One sec

#
public record Example(Collection<String> commands) {

    public Example {
        commands = ImmutableList.copyOf(commands);
    }

}
#

Weird syntax, I know, but this converts your commands arg into an immutable list

viscid carbon
#

oh so it will get the item from the set?

worldly ingot
#

Well I just mean to say that records are immutable in nature. They're meant to be data holders. But passing in a mutable collection tends to break that contract

#

So if you're passing in a collection, you can make it immutable by using the implicit constructor

viscid carbon
#
public record TaskRewards(Collection<ItemStack> itemStacks, Collection<String> commands) {

    public TaskRewards {
        itemStacks = ImmutableList.copyOf(itemStacks);
        commands = ImmutableList.copyOf(commands);
    }```
worldly ingot
#

Yes, then you would just have one TaskRewards object

#

Your list of items and commands are there in that record

viscid carbon
#

so with that, i would make a for loop to get the items from that record?

#

aka

   for (String command : taskRewards.commands()) {
                    Bukkit.dispatchCommand(Bukkit.getConsoleSender(), command.replace("[player]", p.getName()));
                }```
#
 public ItemStack getItemReward(Task task) {
        for (TaskRewards taskRewards : task.getRewards()) {
            for (ItemStack i : taskRewards.itemStacks()) {
                return i;
            }
        }
        return null;
    }```
#

or inside my record?

    public ItemStack itemStack() {
        for (ItemStack itemStack : itemStacks) {
            return itemStack;
        }
        return null;
    }
    
    public String command() {
        for (String command : commands) {
            return command;
        }
        return null;
    }```
worldly ingot
#

The first snippet, but your Task should probably just have a single TaskRewards object, not a list of them

humble tulip
#

ugh i hate java sometimes

worldly ingot
#

Be nice to Java

humble tulip
#
    private Multimap<Class<? extends Event>, ScoreEvaluator<?>> scoreEvaluators = Multimaps.newListMultimap(new HashMap<>(), ArrayList::new);

    public <E extends Event> Collection<ScoreEvaluator<E>> getScoreEvaluators(Class<E> clazz) {
        Collection<ScoreEvaluator<E>> evaluators = this.scoreEvaluators.get(clazz);
    }
#

like i know why i can't return evaluators

#

it'd be nice if i could tho

#

I need to return Collection<ScoreEvaluator<?>>

#

which is ugly

glad prawn
#

unchecked anyway

humble tulip
#
        return (Collection)Collections.unmodifiableCollection(this.scoreEvaluators.get(event.getClass()));
#

💀

slender elbow
worldly ingot
#

Oh dear

slender elbow
#

(ignore the fact that multisets exist as a data structure)

young knoll
#

Choco

#

Can you confirm it was you that broke the hypixel network earlier

humble tulip
#

is a multiset just a Map<E, int>?

slender elbow
#

it's more so like a List but not ordered

young knoll
#

But that’s just a set!

slender elbow
#

no

humble tulip
#

list.add(1), list.add(1)

#

has [1,1]

slender elbow
#

11

humble tulip
#

set.add(1), set.add(1)

#

gives [1]

slender elbow
#

2

humble tulip
#

3

cedar saffron
#

4

worldly ingot
#

tbh, I learned that it went out from your message this morning before I checked work lol

young knoll
#

See I’m a great downtime notifier

young knoll
#

Wait

worldly ingot
#

No, it's a ListBackedSet

young knoll
#

Maybe it’s a Let

worldly ingot
#

I hate that

young knoll
#

Or Sist

worldly ingot
#

That's...

#

Problematic

river oracle
#

Guys what's wrong with my code, I disable when paper loaders, but it not work

public void onEnable() {
  throw new UnsupportedOperationException("Paper is not supported")
}
worldly ingot
young knoll
#

You forgot the if (paper)

#

Duh

river oracle
river oracle
humble tulip
#

gotta put it in a loop jus tto be sure

#

while (true)

viscid carbon
worldly ingot
#

Yes 🙂

buoyant viper
viscid carbon
brave harbor
#

is a player's last location when leaving a World is stored anywhere in the API, and if so, how does one access this value?

sly topaz
#

you can store it yourself in the teleport event

blazing ocean
buoyant viper
#

wtf

#

thats not a method

#

is it

blazing ocean
#

eh kotlin stdlib has it

buoyant viper
#

wtff

#

so just File(".").deleteRecursively

blazing ocean
#

yea

pliant topaz
blazing ocean
buoyant viper
#

Whgat

blazing ocean
#

windows will cry because a proccess is using the files

#

so you'll just get an os error

buoyant viper
#

True

pliant topaz
#

Windows: "No you cant do that its used by nothing!"
Linux: starts ripping itself apart until death because you told it to

blazing ocean
#

I could literally rm -rf /boot/* and it won't cry

#

(it will fail to boot)

rough ibex
#

but not cry

pliant topaz
#

only thing itll do is prompt you if it was accidental and if you really want to continue

#

also, itll warn you

sly topaz
#

well no you can't do that nowadays

pliant topaz
#

what????

sly topaz
#

you'd have to do rm -rf --no-preserve-root /

pliant topaz
#

oh, well

#

now i actually wanna try that when i get home

#

throw a new ubuntu installation ontoy sd card and put it into my pi and just watch as it slowly rips itself apart

sly topaz
#

in windows there's just no way to go about deleting the root besides unmounting the disk and accessing it externally I believe

#

maybe from winRT screen but don't know

pliant topaz
#

even externally its kinda hard

sly topaz
#

I mean, externally you can just delete the partition kek

pliant topaz
#

ooh, yea

blazing ocean
#

but there are ways to become TrustedInstaller

lyric hearth
#

hi! can I set colored messages in a sign?

wraith delta
lyric hearth
#

thanks

#

and hex colores are not supported or same with that format?

wraith delta
#
   public static String hex(String message) {
        Pattern pattern = Pattern.compile("(#[a-fA-F0-9]{6})");
        Matcher matcher = pattern.matcher(message);
        while (matcher.find()) {
            String hexCode = message.substring(matcher.start(), matcher.end());
            String replaceSharp = hexCode.replace('#', 'x');

            char[] ch = replaceSharp.toCharArray();
            StringBuilder builder = new StringBuilder("");
            for (char c : ch) {
                builder.append("&" + c);
            }

            message = message.replace(hexCode, builder.toString());
            matcher = pattern.matcher(message);
        }
        return ChatColor.translateAlternateColorCodes('&', message).replace('&', '§');
    }
``` `e.setLine(0, hex("&#00000 Stuff");` This is likely how it would go instead
buoyant viper
#

fuck that is like infinitely nicer looking than the method i wrote for my spigot utils 💀

shadow night
#

what's the point of calling replace '&' '§' on the result of translateAlternateColorCodes?

lyric hearth
#

MiniMessage and &

#

I mean, my parse method contains that already

lyric hearth
#

thank u so much for explaining, @wraith delta

shadow night
buoyant viper
#

oh i think i was mimicking minimessage format

#

ah that might be why i wrote that fuck ass method then

#

wait no i could still have one shared regex

#

god i hate looking at old code

wraith delta
shadow night
blazing ocean
#

man just use components

wraith delta
quaint mantle
#

que pregunta es esa

#

porque no intentas con § y listo en vez de preguntar

#

adskjjdsajdsajdsa

lyric hearth
quaint mantle
#

hm

#

sos español vos, no?

lyric hearth
#

Y qué cojones andas ahí diciendo si tenias un método estático que le pasas un evento y manejas mal un switch dentro JAJSJAJAJAJA

lyric hearth
quaint mantle
lyric hearth
quaint mantle
#

Qué

lyric hearth
#

De ajneb en un paste bin

#

💀💀

quaint mantle
#

Qué

lyric hearth
#

Ya ya ahora disimula xd

quaint mantle
#

XD

blazing ocean
#

english only

quaint mantle
#

sorry

wooden zodiac
#

how to import worldedit 7.3.0 in my plugin?

wooden zodiac
# quaint mantle add it as dependencie?
<dependency>
          <groupId>com.sk89q.worldedit</groupId>
          <artifactId>worldedit-core</artifactId>
          <version>7.2.0-SNAPSHOT</version>
          <scope>provided</scope>
      </dependency> 
quaint mantle
#

ok

#

u have it

#

lol

#

u need 7.3.0?

wooden zodiac
#

changing it to 7.3.0 makes it red

quaint mantle
#

Ctrl+Shift+O

#

and wait

#

btw i'm not very sure that 7.3.0-SNAPSHOT is a thing so ig ull have to search 4 dat

quaint mantle
#

ok

wooden zodiac
#

yeah it worked

quaint mantle
#

cool

wooden zodiac
#

i didnt refresh it after changing it to 7.3.0

quaint mantle
#

Ctrl+Shift+O it's to reload maven, if u have any problem like that, u can try Ctrl+Shift+O and sometimes it'll fix da problem

harsh ruin
#

How to make a boat move with speed*3 out the water ?

quaint mantle
#

I don't remember if you have to normalize then multiply, or multiply and then normalize, so try both

smoky anchor
#

normalize and then multiply

glossy laurel
#

In a FoodLevelChangeEvent how do I detect if it's caused by sprinting / jumping (NOT REGENERATING) and cancel it

pseudo hazel
#

for what purpose

#

do you just want to see if it went down or up?

harsh ruin
ivory gale
acoustic pendant
#

Does damageable.damage() ignore armor?

#

Or should I use .setHealth to ignore armor?

young knoll
#

setHealth will ignore armor

#

I think you can also damage with a damage type that ignores armor

#

Like void

upper hazel
#

what is the name of the function in inteliji that allows you to save pieces of code or classes inside and use them in other projects

#

this is like container inside inteliji

upper hazel
#

i can save classes?

#

or just code

karmic mural
#

a class is just a longer piece of code?

upper hazel
#

i need always create name for class

#

this unconfortable

#

but ok

young knoll
#

If you’re using a class that much maybe make a library

karmic mural
#

Maybe you want a library?

#

oh lol what Coll said

upper hazel
karmic mural
#

If you are creating the library you don't have to download anything

upper hazel
#

it would be convenient if the classes were placed in folders after the hotkey combinations

upper hazel
#

adapting

#

for diff projects

karmic mural
upper hazel
#

too cumbersome if I only need a few classes

young knoll
#

Should support both

upper hazel
#

nice

ancient forge
#

how would i set an itemstack for a playerhead using the head value for a gui

#

so like i want the buttons to be a playerhead but i do have the url and value

#

(ping me please or send in dms)

chrome beacon
# ancient forge so like i want the buttons to be a playerhead but i do have the url and value

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

ancient forge
#

thanks

torn shuttle
#

lol someone just tried to purchase rights for one of my plugins from me

slender elbow
#

five mill

torn shuttle
#

nah I'm way more reasonable I said 40k

slender elbow
#

40k mill

#

big twitter purchase

torn shuttle
#

dm me elon

glossy laurel
#

if a player has a permission "party.size.24", how can I get if he has one starting with "party.size." and how do I get the 24?

eternal oxide
#

String.split

#

or regex

glossy laurel
#

player.getEffectivePermissions()?

woven glade
#

how to detect if a player jump

eternal oxide
#

yes

eternal oxide
young knoll
glossy laurel
#

are you kidding me

#

there's actually no event for jumping 💀

young knoll
#

The client doesn't tell the server when it jumps

#

yet™️

glossy laurel
#

what

#

what does it tell then

#

"im yeeting myself up by 1 block, trust the process"

woven glade
young knoll
#

It says I am moving to this spot

#

Paper uses the statistic

#

And some other checks

woven glade
glossy laurel
eternal oxide
#

you can reset y velocity in the statistic increase event to prevent jumping

young knoll
glossy laurel
woven glade
#

weird

chrome beacon
#

Making movement cheats for Minecraft is quite easy

glossy laurel
#

hold up could you just tell the server you're moving 1 million blocks away

chrome beacon
#

No

#

It does check the max distance

woven glade
glossy laurel
chrome beacon
#

You'll see the moved too quickly warning in the console

woven glade
#

it dosen't rollback you

woven glade
#

just saying that u moved too quickly 😂

glossy laurel
chrome beacon
#

It does rollback you

woven glade
#

fr ?

#

didn't know lol

glossy laurel
#

cuz thats sent by client

#

and cant be spoofed

#

ez

woven glade
#

i want to store a value when a player jump

slender elbow
glossy laurel
glossy laurel
young knoll
#

I believe the movement packet can't encode movement past like

#

8 blocks or something

woven glade
glossy laurel
chrome beacon
#

Yeah after that it becomes the teleport packet

glossy laurel
slender elbow
glossy laurel
glossy laurel
chrome beacon
#

Doubt the server will accept that

young knoll
#

Huh no the player movement packet is absolute

slender elbow
glossy laurel
woven glade
#

i don't get how can i check if a player jumped

eternal oxide
glossy laurel
#

fr

eternal oxide
#

we already told you

chrome beacon
#

^^

young knoll
#

As of 1.20.6, checking for moving too fast is achieved like this (sic):

Each server tick, the player's current position is stored.
When the player moves, the offset from the stored position to the requested position is computed (Δx, Δy, Δz).
The requested movement distance squared is computed as Δx² + Δy² + Δz².
The baseline expected movement distance squared is computed based on the player's server-side velocity as Vx² + Vy² + Vz². The player's server-side velocity is a somewhat ill-defined quantity that includes among other things gravity, jump velocity and knockback, but not regular horizontal movement. A proper description would bring much of Minecraft's physics engine with it. It is accessible as the Motion NBT tag on the player entity.
The maximum permitted movement distance squared is computed as 100 (300 if the player is using an elytra), multiplied by the number of movement packets received since the last tick, including this one, unless that value is greater than 5, in which case no multiplier is applied.
If the requested movement distance squared minus the baseline distance squared is more than the maximum squared, the player is moving too fast.

If the player is moving too fast, it is logged that "<player> moved too quickly! " followed by the change in x, y, and z, and the player is teleported back to their current (before this packet) server-side position.

woven glade
#

why can't i send pics ?

chrome beacon
#

?img

undone axleBOT
#

Can't send images? That's because you're not verified! Use !verify to complete verification.
Alternatively, you can upload screenshots to any image hosting site and share the link.

Here's some screenshot utilities that you can use to upload images.
Lightshot: https://prnt.sc
Imgur: https://imgur.com/upload
Flameshot: https://flameshot.org

young knoll
#

?img

undone axleBOT
#

Can't send images? That's because you're not verified! Use !verify to complete verification.
Alternatively, you can upload screenshots to any image hosting site and share the link.

Here's some screenshot utilities that you can use to upload images.
Lightshot: https://prnt.sc
Imgur: https://imgur.com/upload
Flameshot: https://flameshot.org

glossy laurel
#

not verified

woven glade
#

!verify

undone axleBOT
#

Usage: !verify <forums username>

slender elbow
# young knoll yet™️

technically there won't be either, it's more like "the player is currently jumping", but no actual "jumped" packet

woven glade
#

!verify Zaidorox

undone axleBOT
#

This account is already verified!

young knoll
#

Well you could check

woven glade
#

damn my old acc

#

any mod ?

young knoll
#

Previous tick no jump held + this tick jump held = jump

slender elbow
#

yes but if you just hold you are gonna jump multiple times

#

but the action input packet is gonna be sent with the jump action once

#

since it was "toggled" once

eternal oxide
#

holding jump is just a repeat action

young knoll
#

ah right

#

Rip

slender elbow
#

rip in peace

woven glade
#

so no way ?

eternal oxide
#

seriously?

woven glade
#

i just want to check it 1 time, if the player did it one time

#

no

#

i mean

#

u told me about

#

the static event

#

but i don't understand it

eternal oxide
#

it fires every time the player jump statisic increases

slender elbow
#

when the player jumps, the jump statistic increases

#

so you listen to the statistic increase event

#

and check if it's the jump statistic

young knoll
#

You may want a few extra checks

#

Idk how reliable the stat is

eternal oxide
#

its pretty reliable

#

you could check the y velocity in conjunction to be certain

#

I believe 7smile wrote a littel code to check

slender elbow
#

hm, does the stat increase if you jump due to damage knockback?

eternal oxide
#

it was smile or alex, I always forget which

slender elbow
#

they're basically the same person

woven glade
slender elbow
#

never seen both of them in the same room at the same time

eternal oxide
#

ooh conspiracy theories

#

could alex just be the drunk version of smile?

shadow night
#

Hmmm

#

Sounds interesting

worldly ingot
#

You're fine

woven glade
#

oh okey

#

like this ?

@EventHandler
public void onStatisticIncrement(PlayerStatisticIncrementEvent event) {
    if (manager.isChallengeDetectionActive() && event.getStatistic() == Statistic.JUMP) {
        Player player = event.getPlayer();
        if (player.getVelocity().getY() > 0) {
            manager.setPlayerFailed(getName(), player.getUniqueId());
        }
    }
}```
worldly ingot
#

The velocity check isn't necessary, but yeah

woven glade
#

Okey, thanks ^^

slender elbow
woven glade
#

Someone can help me about unlinking my spigot acc with my old discord account ?

#

i don't think that is the good channel

slender elbow
#

choco can he is DYING to help you

worldly ingot
#

I can't unlink accounts lol

woven glade
#

😂

young knoll
#

Not as hard as hypixel was dying yesterday

#

Lmao gottem

worldly ingot
#

okay bud

#

listen here

slender elbow
#

🦻

worldly ingot
#

I'll fight you

young knoll
#

Nah you have enough people ready to fight you

#

Specifically all the ones that are upset you removed DNS connections

woven glade
#

he removed dns connections ?!! 😠

worldly ingot
#

Oh dear. One sec

#

His VPN makes the server TPS better! >:((

woven glade
#

smartest skyblock player

young knoll
woven glade
#

what are these

young knoll
remote swallow
#

happy snapshot day

#

we get coloured bundles

#

pretty shit snapshot

worldly ingot
#

You're a shit snapshot wtf