#help-development

1 messages · Page 742 of 1

inner mulch
#

;(

halcyon hemlock
# inner mulch ;(

Also you can do #getDataFolder to get the /plugins/myPlugin folder

crude tulip
#

Thank you!

tribal solstice
#

How can i make a command which shows the player when he joined? In the PlayerQuitEvent i can get it with e.getPlayer().getLastLogin() but how do i do it with the sender?

#

I am using Spigot 1.16.5 with Java 16 if that helps

hybrid spoke
#

you have to cast the sender to a Player

#

but check before if the command was sent by a player

sick edge
#

I am using showTitle once and then always sending parts but somehow if I do Duration.ofMillis(10000) its longer then my 10s timer does someone know what to enter?

tribal solstice
tribal solstice
#

thanks

chrome beacon
chrome beacon
#

I assume it's just a timestamp

crude tulip
#

block.getBlockData().getLevel() does not exist as a method... am I calling it correctly?

chrome beacon
crude tulip
#

ah, I did not, will try that now thank you!

#

Worked, thank you so much!

scenic onyx
#

how i can get ItemStack fished?

#

How do I take the Fished ItemStack?

lilac dagger
#

what is a fished in this context?

scenic onyx
#

I am about to explode

#

is entity

#

aaa

#

i try

#

the plugin is 1.8.8 so java 8 so i cant do "item.getItemStack"

#

hahahahaa

#

yes

lilac dagger
#

if you're using a modern java version you can just do instanceof Item item

#

oh boy

scenic onyx
#

aaa but the plugin si 1.20

#

I was wrong

#

i am stupid

#

yes

glad prawn
#

i think you need to go to sleep

scenic onyx
#

?paste

undone axleBOT
scenic onyx
#

hahaha

#

Advice?

lilac dagger
#

petition to ban zacken from all minecraft related and java related communities

ocean hollow
#

What's the best way to hide an entity for all but one?

lilac dagger
#

nms and packets

#

unless you want it to do stuff

ocean hollow
#

that is, I need to constantly send a package that there is no entity for all players?

#

wouldn't it be laggy?

chrome beacon
#

hide entity does exist in the api so you're not wrong

lilac dagger
#

you can hide entities now?

#

that's amazing

ocean hollow
chrome beacon
#

That method lets you avoid checking every tick

kind hatch
#

You don't have to set it every tick. Once it's hidden, it's hidden.

chrome beacon
#

^^

ocean hollow
#

constantly check if there is a new player in this radius and hide.

#

so suddenly there is some way to immediately hide it for everyone, and so that only one can see

grim hound
#

Async

#

And it's perfectly fine then

#

It does

#

Do you know

#

How many packets are handled each millisecond

#

Or how many events are scheduled

#

Or that every entity is ticked through

eternal oxide
#

looping all online players every tick is not heavy. checking distance can be, btu there won;t be enough players to cause issues

grim hound
#

A great response without an actual reason. I'm sure you're a lovely and likeable person.

eternal oxide
#

um, this is pointless

grim hound
#

Not by much. Like .01 %

eternal oxide
#

you ONLY have players so there is no point to filter

grim hound
#

Tell me: why did you call me braindead. There must be a valid reason. You surely wouldn't spill insults for no reason?

#

Tell me

#

What is it?

#

What do I not understand?

#

Yet I say it with confidence?

#

So you're admitting

#

That you're the fool

#

Now I know the level you stand at.

#

Mfo

#

Damn, discord blocks insults

#

Because many people misuse it

#

Also

#

.

#

Support your argument

#

Speaking from experience

#

Many ppl called creating static methods

#

"abuse"

#

Instead of dynamic classes

sullen iris
#

Your guys giving me a headache lol.

grim hound
#

Braindead.

jagged bobcat
#

This is super fun to watch

grim hound
sullen iris
grim hound
#

Damn, another claim without any evidence or arguments supporting it

#

Great job

#

You do know how to argue.

#

Ah

#

Fuck

#

Uh

#

Well

#

Okay, so we good now?

#

And so do many people

#

Myself included

#

I've read

#

That using many threads is beneficial

#

There still is ScheduledThreadPoolExecutor

#

I mean, it'd still be better than doing it sync with the main thread

ivory sleet
# grim hound That using many threads is beneficial

the issue isnt async itself, its how java works sorta, since you'd have to make those checks thread safe which presumably would end up having to callback the main server thread, and im quite unsure how for instance folia could handle it, I mean sure thatd technically be async but you might run into som other issues

grim hound
#

Are a true blessing

#

That is if you don't require purely sync checks

lofty badge
#

who can make better css for my site?

grim hound
ivory sleet
#

they are slow as hell sadly

grim hound
ivory sleet
#

reentrantlock is cursed by an incrementer

#

which is by all means not fast

grim hound
#

What do you mean?

ivory sleet
#

its a "reentrant" implementation

grim hound
ivory sleet
#

yea

#

i think

grim hound
#

Weren't they before that?

#

I mean

#

Using my primitive benchmarking

#

ReentrantLock took 0.01 ms to both lock() and unlock() each

ivory sleet
grim hound
#

That this was a fast singlethreaded lock unlock

tiny mountain
#

Hey guys, I was wondering if there is still a particle lib available that support 1.8 to 1.20.2
I used ByteZ1337 library as of now, but since it support from 1.8.x to 1.19.x my plugin won't display particles on a 1.20.x server
I saw that paper ParticleBuilder should be used now but I don't get it on how should I implement it to my gradle dependencies,
I tried with

implementation 'io.papermc.paper:paper-api:1.20.2-R0.1-SNAPSHOT'

But ofc it don't work like that

grim hound
#

Yet still

ivory sleet
#

ideally you wanna avoid locking at all and do it atomically

#

this can be done with varhandle, and memory fences

grim hound
#

System.nanoTime() checks and
A rookie at using the Jdk benchmarking

#

The 2nd one usually results in much smaller results

#

That is, on the micro scale

ivory sleet
#

did u test it properly as well?

grim hound
ivory sleet
#

if you wanna test the speed of those locks in a general manner u need to line the threads up and set up a semaphore and release them at fair conditions

grim hound
#

But the synchronized keyword made a method execute less than 0.01 ms longer

worldly ingot
grim hound
#

I don't remember the exact value

ivory sleet
#

well shadow its pretty well known that ReentrantLock and ReentrantReadWriteLock wins in performance the more threads you add, but the less threads you have, the better will synchronzied perform

#

with reentrant u also have fifo

#

and then u have stampedlocks which is just quite handy and fast if used correctly

grim hound
#

With the ReadWrite one?

ivory sleet
#

read write is a promotion lock sorta

#

when the write lock locks, all read locks are locked, when a read lock is locked, only the write lock is locked

zenith gate
#

can the defense value ( attribute ) not go above 30?

ivory sleet
#

yeah

#

I mean it has its usecases

grim hound
ivory sleet
#

like all the other java concurrency classes

zenith gate
grim hound
#

Btw, since y'all seem pretty knowledgable

grim hound
zenith gate
#

nope

grim hound
ivory sleet
#

what info exactly tho?

grim hound
grim hound
#

Only thing I can think of right now is using ByteBuddy to directly modify the method

slender elbow
#

you could move the file somewhere else in the login event I guess

grim hound
#

But I dunno if that's a good and possible idea

tiny mountain
grim hound
#

That's pretty interesting

#

Is the nbt loaded after the Login phase?

#

And has the storing ever changed?

grim hound
#

Or their location

#

Or if it's always look uped at runtime rather than stored and updated or smthg

#

well anyway, I'll figure that out myself

#

I've created my own way of synchronizing tasks

#

but I'm not completly sure about it

#

it has worked for decently long without a problem

#

but I just wanna make sure an error that's untraceble never occurs

zenith gate
#

is there an event that gets called when an item is brought into the game? either from a drop, a villigar trade, or even crafting it?

grim hound
#

3 events

#

maybe 4

#

ItemSpawnEvent, PlayerDropItemEvent, CraftItemEvent & PlayerTradeEvent (Paper)

glad prawn
#

when someone sees paper

short pilot
#

heyo, how do you update a player's permissions upon them gaining a certain rank in a faction?

river oracle
#

Sounds like a #help-server question also provide the plugin name so it's more easy to help you.

If you are a dev use Vault or Luck Perms API spigot permission system is a mess. (Though that's because of how minecraft handles it)

#

@short pilot ^ forgot to reply

slate tinsel
#

Can you get several rockets to go exactly the same upwards into each other?

short pilot
viral temple
#
java.lang.ClassCastException: class org.bukkit.craftbukkit.v1_20_R2.block.CraftBlock cannot be cast to class org.bukkit.block.Furnace (org.bukkit.craftbukkit.v1_20_R2.block.CraftBlock and org.bukkit.block.Furnace are in unnamed module of loader java.net.URLClassLoader @28c97a5)

So it's an event related to an furnace... but you can't cast the block to furnace..

eternal night
#

you never cast the block

#

either block data or block state

viral temple
#

oooooh

eternal night
#

🥷

viral temple
#

thank you.

eternal night
#

I mean yea, static helper methods exist lmao

viral temple
eternal night
#

yes

undone axleBOT
eternal night
#

If you are trying to get a org.bukkit.block.Furnace you'd need to grab the BlockState

remote swallow
#

atleast you dont extend ItemStack

viral temple
eternal night
#

Just lombok @delegate the entire item stack

viral temple
#

it's says You may then cast that state into any accepted type, such as Furnace or Sign.

eternal night
short pilot
#

how does it work/adding to peopel?

eternal night
viral temple
#

is Furnace related to Smoker and BlastFurnace ?

undone axleBOT
viral temple
#

public interface BlastFurnace extends Furnace

#

right..

#

i should open my eyes more on the docs.. thank u for help

manic crown
#

Is there a way to achieve the same thing with schedulers as with Thread.wait() and Interrupt, because when I do that in the AsyncScheduler and the plugin turns off, then it tells me something like (I don't know the exact wording) -> [ . ..] uses synchronous tasks that do not close as expected

hazy parrot
#

what do you want to achieve

#

you probably never want to do thread.wait()

eternal night
manic crown
eternal night
remote swallow
#

lynx

#

hows paper item properties api going

eternal night
#

chilling in a PR as per usual

hazy parrot
remote swallow
#

no dev on master?!/

eternal night
#

We just got 1.20.2 out for all our shit 😭

#

gotta cut us some slack

remote swallow
#

bit slow

eternal night
#

velocity took a bit longer ¯_(ツ)_/¯

remote swallow
#

just adapt ur own spigot

eternal night
#

true

remote swallow
#

take a guess at changes that md will do

#

and poofyou have a spigot with probably minimal changes

eternal night
#

soft spoon and only backport API

remote swallow
#

ill backport you

eternal night
#

is that a threat or a promise

remote swallow
#

promise

#

ur off to 1.12

eternal night
#

fml, at least choose the cool versions like 1.5.2

remote swallow
#

imagine if we backported some good api features

eternal night
#

I'd die

#

people stuck on legacy slow everyone down so much 😭

#

the hoops the fucking enum -> interface PR has to go through

remote swallow
#

new 1.20.2 feature, new api feature, 20 versions realease with updates

manic crown
remote swallow
eternal night
#

The problem with backporting anything is that no one cares to download them

#

and also the precedent of backporting is a dangerous one

#

no project has the man power to actually support these older versions

remote swallow
#

okay so if we add something in spigort that forces people to update when we backport

eternal night
#

so when you start porting back stuff, people ask for more stuff being ported back and more and more and more

#

all of the sudden you end up maintaining 10 different versions and you die

ivory sleet
#

but that thread related code there doesn’t look quite good

manic crown
#

yea, its just an example

remote swallow
#

cowoconcluwube do you know who ghost is

ivory sleet
#

hmm, noo what ghost? :o

remote swallow
#

smh

#

their swedish

ivory sleet
#

There are many swedes

remote swallow
#

Ghost is a Swedish rock band that was formed in Linköping in 2006. They released a three-track demo in 2010, followed by the 7-inch vinyl "Elizabeth", and their full-length album Opus Eponymous. The Grammis-nominated album was widely praised and significantly increased their popularity. Kerrang! included the album's song "Ritual" as one of "The ...

ivory sleet
#

Oh na, no clue definitely

#

Never heard of em tbh

remote swallow
#

smh

#

you should know every swede

ivory sleet
#

lol

remote swallow
#

jk choco we love you

#

smh

chrome beacon
#

Same

#

Ye

sullen iris
#

🇳🇱 here😃

inner mulch
#

Does somebody know what a regex pattern could look like, that only filters different fonts?

quiet ice
#

With fonts you mean funny unicode chars that resemble ASCII chars?

inner mulch
#

stuff like this

#

𝔗𝔈𝔖𝔗

𝕿𝕰𝕾𝕿 ( test )

#

I want there to be emojis allowed, as well as all other special chars, only different fonts

quiet ice
inner mulch
#

there are not patterns like this ??

quiet ice
#

At best you have something like
[a-zA-Z\uABCDE-\uABCDF\uABCDE-\uABCDF\uABCDE-\uABCDF\uABCDE-\uABCDF] ad inifintuum (obviously a made-up example)

quaint mantle
#

🔥regex

inner mulch
quiet ice
#

A Set<Integer> makes more sense here

inner mulch
#

cant i just say that my pattern only accepts ASCII letters?

#

would there still be these fonts in this case?

quiet ice
#

You could do [^a-zA-Z] or something like that but that isn't great either

inner mulch
quiet ice
#

There is Character.isAlphabetic(codepoint), but that isn't regex

inner mulch
#

if it does the job i dont really care

#

it doesnt have to be regex

quiet ice
#

However apparently there is an easy way to get these funny chars non-descriminatively (https://codepoints.net/search?dt=font), but Java does not expose this. Perhaps that funny library (forgot it's name though) does though.

#

Ah, ICU4J.

inner mulch
#

?

quiet ice
#

But uh, at 14 MB that library is gigantic

sick edge
#

ScheduleSyncRepeatingTask is the way to go for a countdown right?

quiet ice
#

Could also be async depending on your needs

sick edge
#

I would achieve less lag with async right because shortly before the timer there is a lot of world gen and Im getting a bit of lag in the timer

worldly ingot
quiet ice
#

Right yeah...

sick edge
#

But my countdown is lagging

wet breach
#

get a pretty slow counter there maybe

sick edge
wet breach
ruby sky
#

what event is triggered before warden spawn naturally? with the shrieker thingies

quiet ice
#

async is a bit different. If you have no clue what it does it is best to stay sync and optimize your code. However if you feel adventurous feel free to learn the nuances of it

slender elbow
#

async tasks in the bukkit scheduler run on a separate thread, yes, but they are still ticked/fired from the server thread

#

the actual running happens on a separate thread, but the scheduling depends on the server tick rate

sick edge
#

So it probably wont solve the lag but just be more overhead?

quiet ice
#

yeah

#

I recommend to use spark if you want to figure out what lags the server

#

(Pls no use timings, thx)

#

thank god timings is on it's way out - I absolutely hated getting timings reports when users reported lag caused by my plugins.

sick edge
quiet ice
#

Yes, until people use the wrong datatypes

weak meteor
#

well thats another thing

quiet ice
#

Generally you should always use CME-safe datatypes even in sync envs but that is a rather novel idea

young knoll
#

Hey

#

Spigot timings isn’t on its way out :p

quiet ice
#

Oh no.

#

Good thing I have quit plugin development

remote swallow
#

why

weak meteor
#

its difficult to do a permission plugin?=

quiet ice
#

Life happened.

remote swallow
#

poor geol

#

eclipse killed his family

quiet ice
#

I mean I still have like 8 hours a day of free time and I'm basically at the point where I'm overwhelmed with it again

#

But my mind really isn't made for programming stuff. Like I know how to do it but I cannot really do it. It's strange. And depressing.

ruby sky
#

is there an event like shriekertriggerevent?

quiet ice
grim ice
#

i have like 30 mins total of rest time scattered thru the day

#

i study from waking up to sleeping

wet breach
quaint mantle
#
package me.skinnynoonie.characterwar.character;

import org.bukkit.event.Listener;

public interface Character extends Listener {



}
#

should I do this

#

or make an abstract class

#

for this

#

that impls Character and listener

echo basalt
#

ow

hazy parrot
#

that is pretty vague, if you would have multiple "Character" listeners that share common methods you will go for latter, but I really can't think of scenario where that should be done, as listener should only... listen for events

frank kettle
#

Hello, I'm making a marketplace and storing everything about the item, but enchanted book 'enchantments' aren't marked as lore or enchantments, what should I use to know which enchantment the book has?

remote swallow
#

cast to enchanted book meta

#

set to first enchantment entry

frank kettle
#

oh i see, thanks, will do!

sick edge
#

Does someone know why my titles are staying longer then the fadein, stay and fadeout
I am sending Titleparts after the first title but that shouldn't affect the stay right?

kind hatch
#

You doing it via packets?

#

Title timings are a little weird. What you set them to is permanent for the player. Meaning that you need to send the reset packet before you set your new timings.

delicate obsidian
#

What?

Exception in thread "main" java.lang.RuntimeException: Error patching net/minecraft/world/level/gameevent/vibrations/VibrationSystem 2.java

Trying to download BuildTools 1.20.2

kind hatch
#

?paste the full log.

undone axleBOT
kind hatch
sick edge
delicate obsidian
kind hatch
#

Hmm, I can't speak for any paper api methods, but I know that Player#sendTitle() allows for manual timings. Pretty sure they get reset afterwards too.

sick edge
#

Ah its Paper right

ruby sky
#

How do I get a shrieker that spawns warden?

kind hatch
#

SculkShrieker#setWarningLevel(4)

ruby sky
#

I mean get the block's location

sick edge
remote swallow
#

anyone know how to fill a region with worldedit api, eg 20% dirt 80% grass blocks

young knoll
#

Uhh

#

Sorta

eternal oxide
#

why WE? why not just for loops

young knoll
#

try (EditSession session = WorldEdit.getInstance().newEditSession(worldeditWorld)) {
            session.setBlocks((Region) getRegion(), BlockTypes.STONE);
        }
#

That’s a single block, but you get the idea

remote swallow
#

whats an idea

slender elbow
#

RandomPattern

remote swallow
#

would i put all percents in one or multiple

slender elbow
#

huh

remote swallow
#

it has no constuctor, only an add method

slender elbow
#

yes

#
RandomPattern pattern = new RandomPattern();
pattern.add(BlockTypes.DIRT, 1);
pattern.add(BlockTypes.STONE, 2);

it's weighted random, so dirt will be picked about 1/3rd of the time, stone 2/3rds

remote swallow
#

what would i use to make it function as percents in //set do

slender elbow
#

//set doesn't work with percents, it's also weighted random

remote swallow
#

is it?

slender elbow
#

you could also do //set 1%dirt,2%stone

remote swallow
#

makes sense through

slender elbow
#

and it'll be 1/3rd / 2/3rds

remote swallow
#

that makes it somewhat easier

#

i dont need to convert the percents passed

worldly ingot
#

Well yeah because if the weights add up to 100, then you have a weighted list of blocks that can be represented as a percentage

slender elbow
#

canadian maths in action

remote swallow
#

i wonder if i should check that

worldly ingot
remote swallow
#

to see if it actuall equals 100

sick edge
#

Can I break a block somehow or only set type to air and then add sound and particles?

worldly ingot
#

No, it doesn't matter if it equates to 100 in a weighted system

remote swallow
worldly ingot
#

If you want a percentage you can do weight/maxWeight

remote swallow
#

if i have no reason to touch them

#

i wont

worldly ingot
remote swallow
#

choco

#

how are the huskies

slender elbow
#

literal wolves

#

actual killing machines

remote swallow
#

have you seen the size difference

#

husky is shoulder sized

#

could only probably kill small things

#

like rabbi rabbits

slender elbow
#

uhhh

#

not the rabbi 💀

glossy venture
#

rifle >>>

remote swallow
glossy venture
remote swallow
#

yeah i just googled that

glossy venture
#

rabbit is not a latin word lol

#

at least not plural ig

slender elbow
#

probably germanic

quaint mantle
#

Anyone know how to serislize a component into mini message I tried but it becomes bweird dtuff

wet breach
worldly ingot
#

I know. I just mean user input wise

#

33%stone67%dirt is a total weight of 100, so it's conveniently expressable in traditional percentage values

wet breach
#

even more so if you know the size of the area too

rough bear
#

20:58:17 [WARNING] [/189.131.204.141:0] <-> InitialHandler - could not decode packet! java.lang.IndexOutOfBoundsException: readerIndex(20) + length(😎 exceeds writerIndex(27): PooledSlicedByteBuf(ridx: 20, widx: 27, cap: 27/27, unwrapped: PooledUnsafeDirectByteBuf(ridx: 28, widx: 28, cap: 256))
20:58:17 [INFO] [Geyser-BungeeCord] santvemox has disconnected from the Java server because of Connection closed.
20:58:17 [INFO] [floodgate] Floodgate player logged in as santvemox disconnected

slender elbow
#

I like the sunglasses part

worldly ingot
#

B) B)

glad prawn
#

B)

echo basalt
#

B)

kind hatch
#

B)

steady yoke
#

hi, does anyone know of a plugin to create in-game menus?

quaint mantle
steady yoke
#

is configurable in game?

eternal valve
#

I put Authme plugin but I want to add music, I want to make a plugin that will play music after the player enters the game, that is, when the player "join", if the player "login", I want the music to turn off slowly after a few seconds, is it possible?

#

Can you help me which api syntaxes should I use example :"playerfishevent" ....

torn oyster
#
    private void uuidLock() {
        ItemMeta meta = itemStack.getItemMeta();
        NamespacedKey key = new NamespacedKey(ItemGuiLib.getPluginInstance(), "custom-item-" + owner.getUniqueId());
        meta.getPersistentDataContainer().set(key, PersistentDataType.STRING, UUID.randomUUID().toString());
        itemStack.setItemMeta(meta);
    }```

should that make it so items of same material and lore are not equal
#

persistent data container should also be a factor in itemstack#equals right?

peak depot
#
    private void openAnvilGUI(Player player) {
        Inventory inv = Bukkit.createInventory(null, InventoryType.ANVIL, "§8§l» §a§lWelt erstellen §8- §7Namen Wählen");
        inv.setItem(0, new ItemBuilder(Material.NAME_TAG).setName("Map Name").getItem());
        Main.getInstance().getMapCreating().add(player);
        player.openInventory(inv);
    }
    @EventHandler(priority = EventPriority.MONITOR)
    public void onInventoryClick(InventoryClickEvent e){
        Bukkit.broadcastMessage("click");
        if (!e.isCancelled()) {
            HumanEntity ent = e.getWhoClicked();
            if (ent instanceof Player) {
                Player player = (Player) ent;
                Inventory inv = e.getInventory();
                if (inv instanceof AnvilInventory) {
                    Bukkit.broadcastMessage("1");
                    if(e.getView().getTitle().equalsIgnoreCase("§8§l» §a§lWelt erstellen §8- §7Namen Wählen")) return;
                    if(!Main.getInstance().getMapCreating().contains(player)) return;
                    Bukkit.broadcastMessage("2");
                    InventoryView view = e.getView();
                    int rawSlot = e.getRawSlot();
                    if (rawSlot == view.convertSlot(rawSlot)) {
                        if (rawSlot == 2) {
                            ItemStack item = e.getCurrentItem();
                            if (item != null) {
                                ItemMeta meta = item.getItemMeta();
                                if (meta != null) {
                                    if (meta.hasDisplayName()) {
                                        String displayName = meta.getDisplayName();
                                        Bukkit.broadcastMessage(displayName);
                                    }
                                }
                            }
                        }
                    }
                }
            }}
``` why cant I rename items in it?
#

if I click on the finished items it doesnt say click and it gets canceld

#

In an normal anvil every thing works

glad prawn
#

}}}}}}}

smoky oak
#

I'm doing command tab completions, how do i filter by players already typed? This doesnt let me use Collectors.ToList at the end
Arrays.stream(Bukkit.getOfflinePlayers()).map(e -> e.getName()).collect(Collectors.toList()).removeIf(e -> Arrays.stream(strings).toList().contains(e))

#

i mean that works but i still cant squash that in a list again

#

how do filters work again

#

ah

#

so it needs buffer var

#

wouldnt that only return the players already in the arguments

#

which i dont want cuz i only want the players not in there

#

lright

#

whats the filter for partial names again?

#

ah its the last element in args

glad prawn
#

ay its longer xd

smoky oak
#

whats the difference between e->e.method to Class::method anyways

smoky oak
#

fair

spare hazel
#
commands:
  spawnentity:
    usage: /<command> entity_id
    permission: iransky.admin
    description: spawn a custom entity

yeah i think im missing something after not using the spigot api for 2 months

#

is there anything wrong?

ivory sleet
#

They are a bit different as well, one thing being null evaluation iirc

#

for instance
myCallback(foo.bar()::yes)
here foo.bar() is evaluated eagerly
myCallback(() -> foo.bar().yes())
here its lazy instead

#

iirc because of this eager vs lazy loading, classloading is somewhat different as well. Lambdas (since they are lazy) can reference classes that may not be loaded, where as if a method reference does that it may end up failing

#

(@smoky oak as well)

slender elbow
#

eh, that does not really matter tbh

#

and there are cases where the jvm can make singletons out of lambdas but not a method reference

#

but it's one of those cases where it does not really matter

#

no lol

lost matrix
#

My argument would be clarity. The jvm doesnt care if it invokes an anonymous method or a named one.
But every functionality deserves a name. Personal rule is: If the lambda has more than 3 lines, then i create a named method for it.

ivory sleet
#

Sounds like a good standard, I know of some organizations that rule it out similarly

quaint mantle
#

When enabling the plugin can't find Main class, but I think all its good

glad prawn
#

show your root package sir

quaint mantle
#

you mean this?

chrome beacon
glad prawn
#

yes

quaint mantle
#

so its just org.qascadia.Main

peak depot
#

why if I open this inventory the title is just: Reparing and if I open an placed anvil it is: Repair & Name

#

and If im in my opend Inventory renaming just doesnt want to work

smoky anchor
glad prawn
#

Main

quaint mantle
scenic onyx
#

?paste

undone axleBOT
scenic onyx
peak depot
young knoll
#

Location isn't directly serializable

#

Because of the world

tacit veldt
chrome beacon
tacit veldt
#

Yes I did that! but it didn't work

#

I tried calling this event in my plugin and it works fine

chrome beacon
tacit veldt
#

But I can’t listen to what Quests sends.

chrome beacon
#

or you're using the wrong event

gritty juniper
#

Hi, I'm trying to change the death message to make it look nicer, the emoji I'm trying to add supports the minecraft chat, but whenever someone dies ingame it just sends weird letters instead of the skull itselfe.setDeathMessage(ChatColor.RED + "☠ " + e.getDeathMessage());

tacit veldt
# chrome beacon or you're using the wrong event

the Quests

final QuesterPreStartQuestEvent preEvent = new QuesterPreStartQuestEvent(this, quest);
plugin.getServer().getPluginManager().callEvent(preEvent);
if (preEvent.isCancelled()) {
return;
}

my plugin

@EventHandler
public void questTake(QuesterPreStartQuestEvent event) {
    log.info("-----questTake-----");
}
#

I also hope I wrote it wrong

chrome beacon
#

Are both your plugins?

#

also don't use the quest plugins plugin manager for registering your listener

#

Just use your plugins

tacit veldt
#

I register my listener like this
getServer().getPluginManager().registerEvents(new QuestListener(this), this)

chrome beacon
tacit veldt
#

I thought this plug-in was quite popular.

chrome beacon
#

You want the BukkitQuesterPreStartQuestEvent

#

QuesterPreStartQuestEvent doesn't seem to exist

tacit veldt
#

This is the latest event

#

My server is using version 4.8.3

#

🥹

chrome beacon
#

Seems like the latest commit is quests 5

tacit veldt
#

yep

chrome beacon
#

Try joining their discord

#

and asking there

tacit veldt
#

yep! I spent a whole morning on this

#

🥹

#

Their discord was not found

chrome beacon
#

and github page

tacit veldt
#

reall? I gonna go see?

tacit veldt
#

o!!!!You are geniuses

#

thank you! ! ! ! !

#

I am very confused as to why the break points of the two plug-ins are different when looking at the static final variables in the same class.

lost matrix
gritty juniper
lost matrix
worldly ingot
#

Minecraft supports a shit load of emojis now. Pretty much the standard set of emojis are all supported

gritty juniper
sick edge
#

Hi, I'm trying to use the EntityToggleGlide event and its triggering when I start gliding and stop as expected but both times isGliding() is false but I need to differenciate between starting and landing....does someone know how to do it or when isGliding() changes

lost matrix
gritty juniper
#

Yup, already did, it is definitely weird

slender elbow
#

make sure you are compiling with utf8

sick edge
clear elm
#

can some1 send me a script how can i make that a pvp area resets every 15 min?

hasty prawn
#

Sure,

PvPArea area = new PvPArea(); //<- you should define this
area.reset(); //<- Make sure you implement reset
river oracle
#

its always false

#

my guess is that its a bug, I'll check it out later today. Well I was wrong its called true here

+        if (!org.bukkit.craftbukkit.event.CraftEventFactory.callToggleGlideEvent(this, true).isCancelled()) {
``` but rather confusing why this wouldn't show to you
clear elm
hasty prawn
clear elm
#

what box?

hasty prawn
#

The area

clear elm
#

and where can i say what world

hasty prawn
#

Are you using a plugin or making one

clear elm
#

mv

#

multiverscore

#

the world is naymed sand

#

can you make me an exampel with cords an worldname sand

#

@hasty prawn

lost matrix
clear elm
#

it dont work with world from mv?

#

@lost matrix

river oracle
#

Coordinate are tied to worlds juts provide a BoundingBox

clear elm
#

wdym?

river oracle
#

then every 15 minutes you'd need to run code that clears out the bounding box

clear elm
#

can we prob vc?

river oracle
#

no

#

do you not know java?

clear elm
#

no

river oracle
#

then no one here can help you if you're looking for a plugin go to #help-server

#

be patient and wait for an answer once you ask there too

peak depot
#

why cant I rename in an custom anvil inventory?

modern ridge
#

hi, can i ask ?

#

how can i using BukkitRunnable with dragon and delay task of fireball for 0.5 second ? Make dragon would be shoot fireball loop on it

#
            public void run() {
                Location original = winner.getEyeLocation();
                Vector direction = winner.getEyeLocation().clone().getDirection().normalize().multiply(20);
                Location newLocation = original.add(direction);
                stand.teleport(newLocation);
                for (Block block : UsefulUtilsVD.getBlocksInRadius(dragon.getLocation(), 10, false)) {
                    block.setType(Material.AIR);
                }
                if (!ShopKeeperHandler.arenas.containsKey(winner.getWorld().getName())) {
                    this.cancel();
                    stand.remove();
                    dragon.remove();
                }
                if(dragon.getPassenger() != winner){
                    dragon.setPassenger(winner);
                }
                Fireball fireball = winner.getWorld().spawn(original, Fireball.class);
                fireball.setDirection(direction);
            }
        }.runTaskTimer(Utility.plugin(), 0L, 1L);```
river oracle
# peak depot why cant I rename in an custom anvil inventory?

If you're making your Inventory with Bukkit.createInventory the answer is well not simple.
When you create an inventory with Bukkit.createInventory it really isn't doing what you expect.

Basically it shows you the type of menu you want, but under the hood its just a bunch of slots. There is no underlying proper container to actually provide functionality to the Anvil.

modern ridge
#

the code would like this

#

like when Fireball

#

how can i do that when running dragon ride task but making fireball task delay ?

peak depot
river oracle
modern ridge
#

can anyone have a answer ?

river oracle
#

be patient

river oracle
river oracle
#

one second need to push changes of my lib its in

peak depot
#

ok

river oracle
#
    @NotNull
    @SuppressWarnings("deprecation")
    public InventoryView openWorkstation(@NotNull Player player, @NotNull Material workstation, @NotNull Location location) throws IllegalArgumentException {
        if (!(player instanceof CraftPlayer cplayer)) {
            throw new IllegalArgumentException("Unable to cast player to CraftPlayer, only pass in CraftPlayers");
        }

        final Block block = ServerAdapter.toMinecraftBlock(workstation);
        final BlockPos position = CraftLocation.toBlockPosition(player.getLocation());
        MenuProvider provider = block.getMenuProvider(null, cplayer.getHandle().level(), position);
        // if (provider == null) {
        //     provider = getException(workstation).apply(position);
        // }

        if (provider == null) {
            throw new IllegalArgumentException("The material %s can not be opened as a workstation".formatted(workstation.name()));
        }

        cplayer.getHandle().openMenu(provider);
        cplayer.getHandle().containerMenu.checkReachable = false;
        return cplayer.getHandle().containerMenu.getBukkitView();
    }
``` this is abouts how you do it. for anvils you can ignore the stuff I I commented out completely. Yours would probably look more like
```java
public InventoryView openAnvil(@NotNull final Player player) {
        if (!(player instanceof CraftPlayer cplayer)) {
            throw new IllegalArgumentException("Unable to cast player to CraftPlayer, only pass in CraftPlayers");
        }
    MenuProvider provider = Blocks.ANVIL.getDefaultState().getMenuProvider(cplayer.getHandle().level(), CraftLocation.toBlockPosition(player.getLocation());
    cplayer.getHandle().openMenu(provider);
    cplayer.getHandle().containerMenu.checkReachable = false;
    return cplayer.getHandle().containerMenu.getBukkitView();
}

if you want to do things with the container before its opened you need to do that all prior to calling openMenu.

#

Otherwise you can just use the BukkitView and add items with Bukkit API which imho is easier and will be fast enough that it won't be noticeable at high TPS

#

@peak depot ^ sorry its a bit long

peak depot
#

all good thanks

river oracle
# peak depot all good thanks

Bukkits inventory API is an absolute mess under the hood, unfortunately with how it is currently setup idk if there's much you could do to improve it 🤔 I have a PR open to add this functionality to bukkit API right now, but I'm debating whether I should just try and come up with a better system. rather than just fix the holes with band-aids

tacit veldt
#

Quests quests = (Quests) pluginManager.getPlugin("Quests");
When I encountered an error while using this piece of code, do I need to adjust my Maven?
error :
java.lang.ClassCastException: class me.blackvein.quests.Quests cannot be cast to class me.blackvein.quests.Quests (me.blackvein.quests.Quests is in unnamed module of loader 'Quests-4.8.3.jar' @6f2f8481; me.blackvein.quests.Quests is in unnamed module of loader 'mclll-custom-1.0.jar' @2c7a9fb0)

river oracle
#

do you have to plugins with the same plugin.yml in your server

#

seems you might be shading is another idea

eternal oxide
#

You are shading the Quests plugin. Set to provided in your pom

river oracle
#

ahhh my second intuition was correct ^

peak depot
river oracle
#

mappings.cephx.dev/1.20.2/ this website is really helpful when looking through NMS

#

AnvilMenu has a constructor of int syncId, Inventory inventory. to get the syncId just use ServerPlayer#nextContainerCounter. the inventory is simply the Players Inventory

#

then you have access to all the methods from. AnvilMenu, ItemCombinerMenu. and AbstractContainerMenu

peak depot
river oracle
#

you need to use mojmaps for that

#

?nms

terse pumice
#

How do I remove an item from an item stack? Currently I am doing item.setAmount(item.getAmount() - 1); but this doesn't always work when it tries to remove the last item

river oracle
#

also my code is for 1.19.4-1.20.2 it may break in older versions

tacit veldt
#

Jesus! ! !

#

you are right! ! !

terse pumice
#

no clue why

#

the item just chills

tacit veldt
#

Thank you my friend!!!!

peak depot
#

no youre setting the amount to the ammount -1

terse pumice
#

This is the exact code I am running as of right now

peak depot
terse pumice
#

I tried a couple different things

young knoll
#

Reducing the count by one is enough in modern versions

#

In older ones you’d have to set the item to null when trying to reduce from 1

terse pumice
#

oh really? I seem to remember getting hit with an error on Spigot 1.19 when doing that

#

might be a misremember moment though

short brook
#

i recently uploaded a plugin in spigot I need to update it what do I need to do then

young knoll
#

Press the post update button

#

You need 2fa set up to post updates

short brook
#

how

short brook
quaint mantle
#

?paste

undone axleBOT
glacial narwhal
#

Hi, i am making a timer for a score board but i doen't work any one help (1.8.8) ?

orchid trout
#

provide code and tell us what doesnt work

glacial narwhal
# glacial narwhal Hi, i am making a timer for a score board but i doen't work any one help (1.8.8)...
private static int timeSeconds = 0;
private static int timeMinute = 0;
  static void timer() {

        
        Bukkit.getScheduler().runTaskLater(ElementUHC.PLUGIN, () -> {

            timeSeconds++;

            if (timeSeconds > 59) {
                timeSeconds = 0;
                timeMinute++;
                return;
            }
            if (timeSeconds < 59){
                return;
            }

            timer();
        }, 20);
    }

    @Override
    public boolean onCommand(CommandSender sender, Command command, String label, String[] args) {

        Player p = (Player) sender;

        if (p.isOp()) {

            ScoreboardManager manager = Bukkit.getScoreboardManager();
            Scoreboard scoreboard = manager.getNewScoreboard();
            Objective objective = scoreboard.registerNewObjective("element", "dummy");

            objective.setDisplayName(ChatColor.AQUA + "" + ChatColor.BOLD + "Element UHC");
            objective.setDisplaySlot(DisplaySlot.SIDEBAR);

            Score s12 = objective.getScore("");
            timer();
            Score s11 = objective.getScore("Duree: " + timeSeconds);
            s12.setScore(12);
            s11.setScore(11);

            p.getWorld().setPVP(false);

            Collection<? extends Player> players = Bukkit.getOnlinePlayers()
            for (Player player : players) {
                player.setScoreboard(scoreboard);
            }
        return true;
    }
eternal oxide
#

also, use a repeating task so you don;t have to call it over and over

echo basalt
#

goofy ass thing

#

you never update your scoreboard either

#

you should be using classes for this

#

screams static abuse to me

true perch
#

I keep getting this error when compiling the plugin. It was working perfectly about 5 minutes ago

eternal oxide
#

mvn clean

true perch
#

thank you

carmine mica
#

@young knoll in the future, you shouldn't use varargs the way you did with Biome in the locateNearestBiome methods

true perch
carmine mica
true perch
carmine mica
#

If you have the method be locateNearestBiome(Location loc, int radius, Biome biome1, Biome...biomes); then you have to supply at least 1 biome, and can supply optionally more

#

a zillion spigot basecomponent methods have this same issue

#

lol I even said this to you before...

buoyant viper
#

i think ive talked about this exact thing before myself

#

#general message

#

back in Q1 of the year lool

worldly ingot
carmine mica
#

oh they don't? I haven't looked at that PR in a minute. that's good

worldly ingot
#

Yeah. No more arrays

carmine mica
#

I was including that PR in the "zillion"

worldly ingot
carmine mica
#

I still see them in the PR?

worldly ingot
#

Yeah I haven't pushed yet because I need to make another small change before I can consider it functional

#

It's done locally though

carmine mica
#

👍

worldly ingot
#

I actually probably just need to make changes to CraftBukkit so that its fields and whatnot are represented as base components so there's less duplicate code in Spigot

#

but atm there's a legacy text requirement that I have a PR for in BungeeChat that I'm waiting on

slender elbow
#

choco so good

worldly ingot
#

Choco just trying FeelsAwfulMan

remote swallow
#

choco is not real

#

choco have no feeling

worldly ingot
#

If it were my decision I'd promote everything out of the nested Spigot interfaces too. Death to legacy strings. But it's fineeeee...

remote swallow
#

snipe the slime

young knoll
remote swallow
#

you would probably takeover

young knoll
#

Especially if we do it quickly

remote swallow
#

i cant say what i was going to

worldly ingot
#

Someone pester me to look at CraftMetaItem and reimplement it all some time

#

Not right now. Can't be bothered. But eventually

remote swallow
#

isnt coll doing that

worldly ingot
#

Don't think so

#

Unless he is, in which case hmu and I'll help you out lol

young knoll
#

I mgiht

#

Currently fixing up the virtual entity pr

remote swallow
#

i hit you up

young knoll
#

I wish spig00t had better methods to turn objects to byte[]

remote swallow
#

spig00t

#

spig zero zero t

quaint mantle
#

And make their own system

young knoll
#

Well yes that would be possible

#

It mainly allows for expanded API for spawners/spawn eggs, and just more general control over entities

harsh totem
#

I am trying to go past the bad omen V limit of vanilla minecraft and for some reason, it is still capped at VI. I don't understand why this doesn't work.

    public void kill(EntityDeathEvent event){
        if (event.getEntity() instanceof Raider && event.getEntity().getKiller() instanceof Player){
            Raider raider = (Raider) event.getEntity();
            if (!raider.isPatrolLeader()){return;}

            Player player = event.getEntity().getKiller();
            int banOmen = player.getPotionEffect(PotionEffectType.BAD_OMEN).getAmplifier();

            player.removePotionEffect(PotionEffectType.BAD_OMEN);

            player.addPotionEffect(new PotionEffect(PotionEffectType.BAD_OMEN, 1000*60*100, banOmen+1));
        }
    }```
sick edge
#

Is setBedSpawnLocation the same as /spawnpoint in game?

river oracle
sick edge
#

Ok thx I couldn't find anything else

#

But then I get errors since there is no actual bed hmm

river oracle
#

I don't think there is an easy way

sick edge
#

Ok I will have a death handler anyway

river oracle
#

seems like something that would be in NBT if you're not affraid to edit it

grand flint
#

What would be the best way to protect generated structures, as in the best way I mean the optimized way of doing it

sick edge
#

Wait my bad there is a respawn event

harsh totem
inner mulch
#

?paste

undone axleBOT
inner mulch
young knoll
#

?stacktrace

undone axleBOT
inner mulch
eternal oxide
#

you are trying to instance the parent too

inner mulch
#

idk

#

am i?

eternal oxide
#

thats my guess

#

tryign to instance an uninstable class (abstract)

inner mulch
#

hmm i just want to instance the subclasses

young knoll
#

Looks like you are only trying to instance the main class

inner mulch
#

:(

young knoll
#

I only see you adding it to the set, and nothing else

inner mulch
#

Class<? extends RankBuilder, doesnt this mean it looks for classes extending the abstract one

young knoll
#

No that is just the type you are declaring it as

#

Doesn't magically make the set find the classes you want

inner mulch
#

i want to have it automatically add the classes extending the abstract one

#

do you know how I can manage to do this?

young knoll
#

Something like

#
ClassPath.from(RankBuilder.class.getClassLoader()).getAllClasses().stream().filter(clazz -> RankBuilder.class.isAssignableFrom(clazz)).toList();
#

I wrote that on the fly so take it with a grain of salt

inner mulch
#

ok, thank you

sick edge
#

There is no way to remove tooltips for example the tips from templates because they are client side right?

inner mulch
#

wdym by tooltips? attack damage of an axe etc.?

river oracle
#

its called something along those lines

#

if that doesn't hide it then you can't

sick edge
sick edge
young knoll
#

I think there is a new flag for trims

river oracle
#

also wtf is this doc Setting to show/hide armor trim from leather armor.

#

specifically leather armor wtf

alpine swan
#

what is the difference between these?

(vehicleentitycollisionevent)

river oracle
#

?jd-s

undone axleBOT
river oracle
#

why why is there an extra setCancelled in this even and why does it have 0 docs

alpine swan
river oracle
#

hell they might do the same thing lol

young knoll
#

I guess we can check

river oracle
#

have fun'

sick edge
river oracle
#

there's no HIDE_ITEM_SPECIFICS

sick edge
#

There is and its working xD

young knoll
#

Not in our api

#

:paper:

river oracle
#

🧻

sick edge
#

ok then paper changed it from the potions one

#

why u diss paper xD

remote swallow
#

theyre downstream

river oracle
#

lynx looked at me funny

sick edge
#

its so fast

river oracle
#

don't remind me 😭

remote swallow
#

its still downstream

young knoll
remote swallow
river oracle
young knoll
#

I need a version of that with dinkleberg replace with dinnerbone

remote swallow
#

@worldly ingot made a pepe emote, he could probablyt make that

worldly ingot
#

Bonus points for Minecraft font?

remote swallow
#

thats not a video

worldly ingot
#

I'm not a wizard

remote swallow
#

ur not?

young knoll
#

Hey, it's better than nothing

#

I assume that method was used at one point? Idk I don’t feeling like looking into the past

worldly ingot
#

Almost certainly. Entity collision existed in early Minecraft, then it was removed, then it got re-added in 1.9

#

Although not used currently, I suppose. Best to deprecate. I did exactly that with Projectile#setDoesBounce() or whatever it was

#

Those methods did nothing either

young knoll
#

Sadge

#

I wanted bouncing tridents

young knoll
#

The game does actually keep track of generated structures and their bounding box

#

I’ve been meaning to expose it in the api but haven’t got around to finishing it

solemn frigate
#

How would I find the current ram, as in what Pterodactyl shows it as?

valid burrow
#

am i stupid or is intelli stuipid cause this shouldnt be true if they are the same should it?

worldly ingot
valid burrow
#

but it says <= not < in the condition

#

so it should also be triggered if they are the same

worldly ingot
#

Sure, you're going to iterate one more than <

carmine socket
#

Does anyone know how to program the HG minigame?

valid burrow
worldly ingot
#

Look at it like this

for (int i = 0; i < 10 + 1; i++) {
    if (i < 10);
}```
carmine socket
#

Who uses soups to heal life

valid burrow
#

yeah but in this example you are giving the foor loop only < and i would understand it in this case

worldly ingot
#

idk how to explain this

valid burrow
#

xd

worldly ingot
#

What do you want to do?

valid burrow
#

i just want to build a String out of a String list and after each string add another string except the last one

carmine socket
#

Have you seen the MCPVP server?

kind hatch
#

Remember #size() returns a non zero-indexed number.

valid burrow
worldly ingot
#
StringBuilder builder = new StringBuilder();
int size = BanShowCase.size();

for (int i = 0; i < size; i++) {
    sb.append(BanShowCase.get(i).replace("%time%", formattedDate));
    if (i < (size - 1)) {
        sb.append(", ");
    }
}```
#

However, you could alternatively use a StringJoiner

#
StringJoiner joiner = new StringJoiner(", ");
BanShowCase.forEach(joiner::add);```
#

That's all you need :p

valid burrow
#

oh thx i didnt know that was a thing

#

thank you choco

#

but

#

wait acutally

#

yh i can use that

worldly ingot
#

Useful but not well known utility class

kind hatch
worldly ingot
#

Java 8

valid burrow
#

damn

kind hatch
#

Wait, then what am I thinking of then?

#

String#join()?

worldly ingot
#

Maybe String#join()? But that was also 8

kind hatch
#

I'm probably thinking of that one.

#

I swear some newer functionality got added to Strings in some version after 8

young knoll
#

And yet they still have done String#isNumeric

#

Smh

worldly ingot
#

repeat() was added in 11

slender elbow
#

text blocks my beloved

valid burrow
#

is there any ways to do this "better" or more eficcent? cause i hate doing it like this

river oracle
#

if you're worried about threading use StringBuffer instead

#

and you can reimplement replace with StringBuffer, Granted your gains are very small unless you do lots of string manipulation

worldly ingot
#

TL;DR: You're probably fine

remote swallow
#

oi math nerds

worldly ingot
#

Although you are doing two of the same replacements

valid burrow
#

not really worried about the usage at all tbh i just hate repetetive code

#

it hurts to look at

worldly ingot
#

Yeah not much to do there, really

young knoll
#

There are many ways to tackle this

valid burrow
#

yh but like if i have 20 parameters in my config thats a different storry

worldly ingot
#

Okay just tell me I'm wrong then >:((

valid burrow
#

20 times the same line

#

seems ugly

river oracle
young knoll
#

But generally replace is the easiest unless you need to do 1000 of them

river oracle
#

My suggestion is to make simple Class to do this for you

remote swallow
#

if i have volume as x, and i have a amount of volume mined as y, then i have a percent needed to trigger something as z

would

if (x * ( y /100f) >= z) go through if z percent has been mined

river oracle
#

(Using String#replace under the hood)

#

that way its easier for you

valid burrow
remote swallow
#

ive scared the math nerds off

young knoll
#

Use regex to extract each placeholder and look them up in a map<String, Supplier>

#

Kek

river oracle
remote swallow
worldly ingot
#

Well, y/x would be your progress from 0 - 1, no?

remote swallow
worldly ingot
#

So you have the choice of either (y / x) * 100 >= z, or (y / x) > (z / 100.0)

#

I'm assuming x is your total volume in blocks and y is the amount of volume that has been consumed

remote swallow
#

one sec

#
if (this.regionVolume * (blocksMined / 100f) >= resetPercent) {
            resetMine();
            lastReset = Instant.now();
            blocksMined = 0;
        }
young knoll
#

You could also do

remote swallow
#

have some var names

worldly ingot
#

Both are equivalent, it's just preference

remote swallow
young knoll
#

Or like 1000 other things

worldly ingot
#

2 z?

#

I don't understand

remote swallow
#

y /z > z

worldly ingot
#

Oh, sorry

#

Typo lol

remote swallow
#

it ignores x

worldly ingot
#

z -> x

young knoll
#

y / x >= z / 100

slender elbow
worldly ingot
#

DON'T LAUGH AT ME, I'M CHRONICALLY STUPID

slender elbow
#

I AM SORRY 😭

young knoll
#

You can cache z / 100 for that sweet sweet micro optimization

worldly ingot
#

If it's constant, yeah

remote swallow
#

reset percent could be anywhere from 0 to 100

#

and z could be massive or tiny

worldly ingot
#

I dunno if multiplication or division is faster but tbh we're talking clock cycles here so it probably doesn't matter lol

#

Preference

river oracle
#

division is slower than multiplication

worldly ingot
#

Probably not on modern CPUs

remote swallow
#

has my brain got this right

worldly ingot
#

But again, clock cycles

#

Yes, looks good to me

river oracle
#

MUH clock cycles

remote swallow
#

hmm

#

do i let people specify decimal percents

young knoll
#

Muh
Fuckin
Clock
Cycles

worldly ingot
#

I mean implicitly you already do with that statement

#

Nothing needs to change in that snippet

remote swallow
#

cool im adding a double

worldly ingot
#

Make sure either blocksMined or regionVolume is a double by the way, otherwise you're going to get integer division and it will always be 0

remote swallow
young knoll
#

-1

remote swallow
#

blocks mined is an int bc im like 90% sure you cant break 0.8 of a block and call an event

#

region volume is long atm

young knoll
#

Not with that attitude

remote swallow
#

no

#

he long

worldly ingot
#

Yeah you'll need some sort of floating point value, so cast either of those two to a double

remote swallow
#

ill make volume a doubl

worldly ingot
#

don't have to change the type, just a cast will suffice

#

Well I think the type makes sense as an int

remote swallow
#

long can auto convert to double right

worldly ingot
#

Yes

#

Well, kinda lol

remote swallow
#

if it doesnt work i want a husky

worldly ingot
#

Just do if ((blocksMined / (double) regionVolume) * 100 >= resetPercent) damn it!

remote swallow
#

no

worldly ingot
#

YES

remote swallow
#

i can just convert the entire variable

worldly ingot
#

BUT

#

WHY

valid burrow
#

anyone else been having intj crashing when pasting something latly? always happens when my pc is on for longer then a few hours i feel

worldly ingot
#

The type is correct as an integer KEKW

remote swallow
#

bc this is its only usecase

worldly ingot
#

Yeah but you don't need that level of storage

#

An int is less memory

remote swallow
young knoll
#

Wait how do float point numbers work

remote swallow
#

it is most deffo a long

worldly ingot
#

oic it's a WE value

remote swallow
#

oic

#

we is very strange

#

weird api

young knoll
#

If you convert MAX_LONG to a double will it just not have space for any decimals

remote swallow
#

thats a you issue

remote swallow
#

so ill take it

#

wait a fuckin minute

young knoll
#

I’ve been working with it lately too

remote swallow
#

what in the fuck am i doing

#

fuckin codium

young knoll
#

Even though I had 2 vectors to choose from

#

I decided to make a 3rd for my use

#

Why? I have no idea

remote swallow
#

the fuck ya mean it might be null

opal juniper
#

thank you for the smallest screenshots ever

remote swallow
#

they look perfcectly fine

#

get off your 60 inch tv screen and be a normal person

young knoll
#

Thank you for 0 context

remote swallow
young knoll
#

Because they operate on 3 apis

#

And command line

remote swallow
#

yeah well

#

do better

#

and also have an adapt method for vectors

#

so i dont have to write my own

young knoll
#

Their abstraction for NBT is pretty nice

#

Why doesn’t spigot have that HmmmMmmm

remote swallow
#

add it nerd boi

#

could put that in shitib

#

fromOrgBukkitUtilToComSk89qWorldeditMathBlockVector3

young knoll
#

Lol MD wouldn’t accept an NBT api

opal juniper
#

NBT and API do not belong in the same sentence

remote swallow
#

choco would

#

just wait 60 years

opal juniper
#

he’d be dead

#

senior citizen

remote swallow
#

choco would be arount to merge it

#

to the long dead project

worldly ingot
#

Direct NBT manipulation won't ever happen

young knoll
#

What if I wrap it in persistent data container

#

Kek

#

Imagine Entity#toPersistentDataContainer

#

Then you could save the entity inside itself

remote swallow
#

what about saving an entity in a pdc in an entity in a pdc in a pdc in an entity

river oracle
#

😭

#

one of my assembly and comp organizations quizes made us hand convert binary to floating point numbers

young knoll
#

Put a chunk in a chunk in a chunk

#

Tbf being able to convert some of these things would be useful

#

Imagine how easy it would be to make a mob catcher

quaint mantle
#

Is there a way to fix G looking like this?

young knoll
#

Pretty sure there is an attribute modifier constructor that takes an equipment slot

#

Limiting the effect to just that slot

#

Or you can use the ItemFlag to hide attributes

valid burrow
#

im gonna go insane why does this if not work

#

the year is 9999 when printed out but when compared to 9999 its not???

young knoll
#

Does that return a standard number

#

Or is it something else

valid burrow