#help-development

1 messages · Page 150 of 1

torn shuttle
#

that's a lot of enums

worldly ingot
#

That's where you're mistaken. ProtocolLib operates on the fields in the packets, not the contents of the packet over the network

#

There are no short fields in the packet you're trying to write to

#

You'll have to open it up with a decompiler, or just browse through BuildTools, to look at the source of the packet you're trying to send

#

cc @tranquil stump because I should have pinged you in the reply but I didn't out of habit

tranquil stump
#

so i think i saw somewhere instead of this i could use PacketWrapper right?

worldly ingot
#

Not sure how up to date that is, but in theory yeah. Those are more object-friendly

tranquil stump
#

how come there aren't any short fields in the packet? is the wiki wrong ?

echo basalt
#

the wiki definition talks about how the packet is serialized

#

not its internal fields in the nms class

#

I keep saying this time and time again

tranquil stump
#

ok so packets seem a lot more complicated than i used to think, should i learn what nms is before using protocol lib?

eternal oxide
#

NMS is much easier once you get over the initial setup to use

#

at least with 1.18+

quaint mantle
#

Hey! Does anyone know of a good Plot Shop plugin for a prison server? Been trying to find one for ages.

haughty idol
#

so i'm working on damage indicators and they don't work on players- what's going on? the important code starts on ln 49, but i included the rest just in case. https://paste.md-5.net/oqosaxopav.java

echo basalt
#

Uhh

#

Juat debug at this stage

haughty idol
#

oki ty

echo basalt
#

I know EntityInteractEvent and PlayerInteractEvent are called separate, it could be the case here but I'm almost certain it's not

haughty idol
worldly ingot
#

Well, it's spawning, but you're removing it 1 second after the fact

haughty idol
#

with the same exact code

honest echo
#

hello

#

im trying to compare 2 itemstacks but because of a random plugin the enchants taken from creative menu has a lore=[] in their itemstacks that breaks this this, any possible solution to remove lore=[] from itemstack

torn oyster
#

neither of these are working

    @EventHandler
    public void onPotion(PotionSplashEvent e) {
        MinigameManager mm = MinigameManager.get();
        if (e.getEntity().getShooter() != null && e.getEntity().getShooter() instanceof Player p) {
            if (!mm.isInMinigame(p)) return;
            Minigame throwerMinigame = mm.getMinigame(p);
            for (Entity entity : e.getAffectedEntities()) {
                if (entity instanceof Player attacked) {
                    if (!mm.isInMinigame(attacked)) continue;
                    if (throwerMinigame.equals(mm.getMinigame(attacked))) {
                        if (throwerMinigame.getMinigamePlayer(p).getTeam() ==
                                throwerMinigame.getMinigamePlayer(attacked).getTeam()) { // getTeam() is enum
                            e.setCancelled(true);
                        }
                    }
                }
            }
        }
    }

    @EventHandler
    public void onPotion(PlayerItemConsumeEvent e) {
        MinigameManager mm = MinigameManager.get();
        if (mm.isInMinigame(e.getPlayer())) {
            if (e.getItem().getItemMeta() instanceof PotionMeta) {
                e.getItem().setAmount(e.getItem().getAmount() - 1);
            }
        }
    }```
#

1st is meant to disable splashign teammates with poison
the 2nd is meant to remove the empty bottle when drinking a potion

wheat hazel
#

Hello I need help with an erro. I'm trying to make threads that teleport the player
Code:

@Override
        public void run() {

            Player tfreezzmy = Bukkit.getPlayerExact(player2);
            tfreezzmy.sendMessage("test");  -work

            Location loc = tfreezzmy.getLocation();
            int y = (int) (loc.getY() + 50);
            tfreezzmy.teleport(new Location(tfreezzmy.getWorld(), loc.getX(), y, loc.getZ())); -dont work 
        }


Erro:

Exception in thread "Thread-236" java.lang.IllegalStateException: PlayerTeleportEvent cannot be triggered asynchronously from another thread.
fringe hemlock
#

?scheduling

undone axleBOT
earnest forum
#

I am getting "unsupported class file major version 62" when trying to remap my maven project with nms, any help? The project is running java 17

kindred valley
#

Just to check

Maven properties compile version
Check the location of jdk

earnest forum
#
<properties>
     <maven.compiler.source>17</maven.compiler.source>
     <maven.compiler.target>17</maven.compiler.target>
</properties>
#

these are my project settings

grizzled oasis
#
    @EventHandler
    public void equip(ArmorEquipEvent event){

        final String CustomName = "&c&lAde";

        Player p = event.getPlayer();

        int amountOfArmor = 0;

        for (ItemStack i : p.getInventory().getArmorContents()) {
            if (i == null)
                continue;

            if (i.getType().toString().contains("GOLD") && i.hasItemMeta() && i.getItemMeta().hasDisplayName() && i.getItemMeta().getDisplayName().equals(ChatColor.translateAlternateColorCodes('&',CustomName))) {
                amountOfArmor++;
            }
        }
        if (amountOfArmor == 4) { // player has 4 pieces of diamond armor on
            event.getPlayer().sendMessage("full armor");
        } else if(amountOfArmor < 4) {
            event.getPlayer().sendMessage("Not all armor");
        }
    }

hi something strange im using an armor event and works but only when i remove the last piece the message for full armor is flag but when i have all the armor the event is not flagged full armor but the not all armor one

torn shuttle
#

why

#

I'm too tired and this is cursed

kindred valley
torn shuttle
#

never mind got everything to work

kindred valley
#

i have figured out generics have something like that late

kindred valley
grizzled oasis
#

but i removed the piece

#

and its not full

kindred valley
#

Try to start amount of armor 1

grizzled oasis
kindred valley
#

Why do you use continue

#

I guess you can return if amountOfArmor =4

grizzled oasis
# kindred valley I guess you can return if amountOfArmor =4

the code works but I think the event is delayed because if I take it off the last piece is full for him but it's not if I have a gold armor and I remove the helmet it says I have all the piece but i don't have all of them because the gold helmet is not there

green prism
#

How can I make a bungee command able to be used in spigot servers from other plug-ins like chestcommands, deluxemenu... etc?

civic wind
#

I have permission based perks with a gui, if the user doesn't have the permission i want it to display red stained glass, how can i do this?

#

This is my inventory class

drowsy helm
#

If statement

green prism
#

ItemStack stack = Player.hasPerm ? yourDefMaterial : Material.RED_STAINED_GLASS_PANE

#

Yeah, some if statements

#

buoobuoo is right

green prism
civic wind
#

Ahh kk

green prism
civic wind
#

how would i do it for each permission though, as they are seperate thats what i don't understand

#

I've got like 6 permissions to check for

#

if (player.hasPermission("ranks.admin") || player.hasPermission("ranks.mod")) {

#

could do it like this?

#

for all 6?

#

or is that dumb

green prism
#

Personally, I would make an InventoryBuilder class that contains an ArrayList<Element> and an ItemStack<Element> default if the player does not have permissions.

At that point, a very easy for-cycle on the InventoryBuilder items and, before putting them in the inventory, check if he has permissions. If it does not have permissions, set the stack default (element.getDefault()) at position element.getSlot()

civic wind
#

damn

#

not used that before

green prism
#

Try also using XMaterial if you want multi-version compatibility and MiniMessage's Components for gradients etc directly from the config\

civic wind
#

I'll take a look at all this, thanks man

green prism
#

np

#

Right now, I'm doing something very similar, by Element I mean something like this 🙂

civic wind
#

Yeah i'm fairly new to java not seen this before, i got some learning to do lol

green prism
civic wind
reef lagoon
#

is it theoretically possible to create commands in game

young knoll
#

Explain “commands in game”

reef lagoon
#

/createcommand hello
and add a commnad /hello that does nothing

young knoll
#

Sure

smoky oak
#

is it possible to generate overload method signatures without having to write out all possible method signatures?
ie
method(a,b,c) can be called via method(a) or method(b) etc, and sets a,b,c to default values if not in the method call?

civic wind
#

Trying to add the head to change to whoever opens the gui

torn oyster
#

how would I see what command was used in bungee?

rough drift
#

if a b and c are different types then lombok might, otherwise manually

#

if there is one type that's the same then no

quaint mantle
rough drift
#

since it would be ambiguous

torn oyster
#

no, in the code

smoky oak
#

urgh
i just tried @ RequiresNonNull but it said 'not applicable'

opal juniper
#

that is the worst thing intellij could ever reccomend

severe oak
#

You can try using @urban grotto annotation from JetBrains if you have

opal juniper
#

^

torn oyster
wet breach
# torn oyster no, in the code

since the commands have to be ran from an mc server, you can listen for bungee commands there, otherwise you are going to be listining for chat event on the bungee server itself

torn oyster
#

bro who calls themselves that

torn oyster
smoky oak
#

why cant i null check int

#

so if i call method(..., null, ...) how do i check if the argument is null or not

torn oyster
#

check if == 0

#

i think

smoky oak
#

so if i do method(null) it turns into method(0) ?

torn oyster
#

why are you putting null into a method?

#

are you referring to an if statement, checking if it is null?

smoky oak
#

im having a method signature with like 8 values 7 of which have default values and i dont want to do every possible overload signature manually

opal juniper
# smoky oak uuum

int cannot be null as it is a primative. Integer can be null tho as it is an object

young knoll
#

Pretty sure you just can’t pass null as an int argument

#

I’ve never actually tried

young knoll
wet breach
young knoll
#

Idk, you could always just make a custom class with said defaults and then pass that to the method

wet breach
#

all primitives can not have null values

wet breach
#

the Object forms however can

#

but primitives are never null

smoky oak
#

oh ffs yall right

#

now what

cobalt thorn
#

Hi a question im trying to make sort of GKit for my server but i want apply in case someone have a full armor of a gkit an effect i tried doing a task and works fine but can lead to lag on checking more than 100 player another method is the ArmorChangeEvent but with this one i can't for some reason check if the player has a full armor or change it any other way to do it clean?

Code i made currently that doesn't work https://sourceb.in/Pz7OwfLyzK

young knoll
#

You should be able to check each armor slot in said event

#

Granted idk where that event comes from

cobalt thorn
#

for example if i have full armor it says the armor is not full but if i remove a piece it says the armor is full

mellow edge
#

what event is called when an item is put in the chest from hopper

young knoll
#

InventoryMoveItemEvent

opal juniper
#

in the chat or action bar @quaint mantle

remote swallow
#

spaces would be the non 3rd party method, there might be a formatting api somewhere on github

mellow edge
mellow pebble
#

hi guys does anyone have an idea how should i find player head in inventory of player and then remove each head

#

im stuck at looping through inventory as i dont know how to get material of head in api version 1.19.2

remote swallow
#

i dont remember if theres a contains on a players inv

mellow pebble
#

there is

#

and i can see if it contains ItemStack

#

or Material

remote swallow
#

Material.PLAYER_HEAD

#

if it does remove said player head

mellow pebble
#

nope not really

#

i cant find player_head as something in Material

remote swallow
#

is it PLAYER_SKULL

#

also it has to be all caps

mellow pebble
#

nope it is not

remote swallow
#

according to the jds it is

mellow pebble
#

i managed to make it for 1.19.2

#

do you know for 1.8.8

#

myb

remote swallow
#

spigot doesnt support 1..8 anymore

mellow pebble
#

sad

#

i mean pvp in 1.19.2 is not really liked by much people

remote swallow
#

old combat mechanics

remote swallow
#

show your code

mellow pebble
#

also

civic wind
remote swallow
#

do you already have the item in the gui?

mellow pebble
#

@remote swallow how would i loop through inventory to find those heads to remove them

remote swallow
#

ill pull up ij one sec

civic wind
#

Not just PLAYER_HEAD but the actual players head who is opening gui

mellow pebble
remote swallow
#

SkullMeta#setOwningPlayer(Player instance)

mellow pebble
#

yeah

#

tat

#

that

civic wind
#

Did i not already set owner ?

civic wind
mellow pebble
#

:/

remote swallow
#

just get the playername from the event or sender

civic wind
#

I'm getting the error though

fickle mist
#

Hi all! How to fix error in console pic?

remote swallow
# civic wind

change it to setOwningPlayer() with just the player instance

civic wind
#

thats for offline player though right?

remote swallow
#

Works on both

civic wind
#

Still the same error

mellow pebble
#

why is there no golden pressure plate in 1.19.2

#

ahaha

civic wind
remote swallow
#

remove the offline player annotation

young knoll
#

(That’s a cast)

civic wind
#

I can't, thats why i casted it

young knoll
#

Cast should be fine

civic wind
remote swallow
#

How come your passing player as HumanEntity not Player

young knoll
#

Remove the short from new ItemStack

civic wind
#

Amended both, removed short and made it Player not HumanEntity, still same error :/

young knoll
#

Which line is the error

civic wind
remote swallow
#

that formatting ij has done is something

crimson terrace
#

?paste

undone axleBOT
young knoll
#

Line 52

#

You are casting SkullMeta to ItemStack

remote swallow
#
            ItemStack skull = new ItemStack(Material.PLAYER_HEAD);
            SkullMeta meta = (SkullMeta) skull.getItemMeta();
            meta.setDisplayName(ChatColor.WHITE + playerName + "'s Head");
            meta.setLore(Arrays.asList(ChatColor.GOLD + "Decapitated by: " + killerName));
            meta.setOwningPlayer(p);
            skull.setItemMeta(meta);

Is the basic premise you want

crimson terrace
remote swallow
#

ignore it, doesnt mean anything anyway

crimson terrace
#

its just ugly tho

undone axleBOT
remote swallow
#

god discord

#

it just sent me back like 20 messags

civic wind
#

Does anyone know how I can, if player doesn't have specified permissions for each perk, change the item in the gui to red stained glass? I could do it if i was based off levels (int) but not sure how when it's permission based

remote swallow
#

theres probably a better way but

if (player has permission X) {
set item
} else {
set red glass
}

civic wind
#

Yeah, I got 5 seperate ones though, do i just do if statements for each?

remote swallow
#

yeah

civic wind
#

Okay sounds good

crimson terrace
#

if you have 5 permissions yeah, if its one permission for 5 items, for loop through them

civic wind
#

Yeah 5 permisions for the 5 perks in the gui

#

doesn't need to be clickable its just display

crimson terrace
#

then you do have to do an if for each of them

civic wind
#

No problem 🙂

mellow pebble
#

@remote swallow Do you know how would i make for each other slot that has itemstack == null i set it to stained glass

remote swallow
mellow pebble
young knoll
#

No need for == true

civic wind
vocal cloud
#

Set every slot to glass and then set the slots you want to not be glass.

#

Or better yet iterate through each slot and do an if else based on if it's an item or glass

civic wind
earnest forum
#

Anyone know why this is happening?
Im setting my skin to a full white skin and then using mineskin.org to fetch the texture and signature, and setting it to my npc using GameProfile. However, in game the character just appears as black? This does not happen with skins downloaded from sites like minecraftskins.com

civic wind
#

I added if statements and command no longer working

reef lagoon
#

ugly ahh code

civic wind
#

I got advised to do if statements

#

Idk any other way of doing it per permission

reef lagoon
#

ever heard of ||

civic wind
#

Already tried

reef lagoon
#

and why are all of the ifs inside the other ifs

remote swallow
#

not all inside each of the higher

reef lagoon
#

basic java bro

civic wind
#

I did ctrl alt l and it did that

reef lagoon
civic wind
#

Imagine talking shit to someone whos trying to learn

#

Wihy

opal juniper
#

because you dont learn java thru spigot

#

thats a bad idea

reef lagoon
#

like how you don't learn c++ through opengl 🥲

civic wind
#

Like how you don't learn how to not be a virgin through watching hentai right wihy?

#

dunno but works for me

remote swallow
#

its better than what ever that fuckery was

vocal cloud
#

If we taught every person who came here asking for help with basic java instead of helping with spigot questions we could rebrand this channel as #help-java

civic wind
#

That took you about 5 hours to type that

reef lagoon
#

I just don't get these people

vocal cloud
#

I thought about what I was writing

earnest forum
#

How do I make an npc walk (with animation) to a spot?

civic wind
drowsy helm
earnest forum
#

Yeah I'm aware

drowsy helm
#

the easiest way, which I do is just make an invisible zombie and teleport the player to the zombie every tick

earnest forum
#

does this also include animation?

drowsy helm
#

yep

earnest forum
#

moving the player's hand and stuff

vocal cloud
drowsy helm
#

movement animation is clientside

earnest forum
#

Ok, thanks

civic wind
earnest forum
#

Should i make a class which extends zombie or just create one?

vocal cloud
civic wind
#

How would i be responding? lOL

#

Weird head ass virgin smh

drowsy helm
#

probs one extending zombie

#

so you can do custom pathfinder

vocal cloud
earnest forum
#

is there a goal to just walk to a spot?

civic wind
earnest forum
#

ive seen code for it before but i forgot the link

young knoll
#

Head ass virgin

vocal cloud
young knoll
#

That’s a new one

drowsy helm
#

nah you have to make your own goal iirc

#

pretty straight forward anyway

#

use a try catch then

young knoll
#

Nah use the method that was made for that

#

Or just never input a material that doesn’t exist 🧠

earnest forum
#

are pathfindergoals part of nms?

#

or api

young knoll
#

Yes

drowsy helm
#

yep

civic wind
vocal cloud
civic wind
young knoll
#

No, this is Patrick

civic wind
#

you have anime as your pfp quiet down little boy

earnest forum
#

is this what im looking for?

#

looks like it is

vocal cloud
# civic wind Mum jokes?

Talking shit when someone talks about how this channel is not for their inability to code in java

civic wind
#

I'm trying really hard to imagine that

vocal cloud
#

You're probably like 15 lol

civic wind
#

21

#

but yh 15

#

Yh im a virgin

vocal cloud
#

Bullshit how can a 21 year old be so immature

civic wind
#

Ok im lying

#

if you say im not 21, i cant be 21

#

I'm immature? you said mum jokes lmfao

vocal cloud
#

Cause I can? You're the dude getting upset people telling you to learn to code

civic wind
#

Why would i be upset LOL

green prism
#

cap

civic wind
#

I'll learn how i like

hazy parrot
civic wind
#

I have interest in this, it helps me learn

echo basalt
#

lombok is hacky but it works and I don't have any problems with it

drowsy helm
#

I'd hardly call it hacky

civic wind
#

No one asked about java

echo basalt
#

my code is much hackier than lombok

#

so I have no problems

young knoll
#

Lol

drowsy helm
#

more advanced lombok annotations are hacking

echo basalt
#

playing with sun.misc.Unsafe on production code

drowsy helm
#

but simple getter setters are fine

vocal cloud
#

Well when your issues are related to a lack of java knowledge or your code is super unreadable it becomes difficult to help someone

echo basalt
#

I still use guava's Optional sometimes

vocal cloud
#

Guava's Joiner is pretty sexy

civic wind
#

Are you okay? I'm trying to learn... Lmfao

#

I'll learn however I choose to learn, i've been doing it about 3 weeks and i'm doing pretty decent so thanks for your input but im going to carry on switching between the api and normal java.

echo basalt
#

y'all are bashing too hard on kilocodes compared to all the other noobs that ask for basic help on this chat

#

just let the mf breathe, we all wrote shit code in the past

echo basalt
#

and some of us still do

civic wind
#

I did what i got told to do, yeah i fucked up the } indentation but i was literally doing what i got told to do, if statements for it all...

vocal cloud
civic wind
echo basalt
#

attitude as good as their code ¯_(ツ)_/¯

cobalt thorn
shrewd sphinx
#

🍿

vocal cloud
civic wind
echo basalt
#

I have a YMLBase class that holds both the file and the configuration

civic wind
#

I'm not the one trying to fill empty slots bro

vocal cloud
civic wind
#

I have a gui with perks, per permission, I wanted to make it so if they don't have the perm then they only see red stained glass pane instead of the itemstack for the perk, but i think i've done it now

echo basalt
cobalt thorn
echo basalt
#

Gkit.plugin.reloadConfig()

#

Gkit.plugin.getConfig()

cobalt thorn
echo basalt
#

I absolutely despise your static variable

cobalt thorn
echo basalt
#

you gotta mix both

#
plugin.reloadConfig();
config = plugin.getConfig();
#

ternary operator so fancy!

vocal cloud
#

My teacher recommended nesting them for my C# class as a solution instead of an Enum

smoky oak
#

incorrect, the bytecode for tenary and if else is different. We had this discussion like a day ago already

smoky oak
#

thats true

echo basalt
#

I mean

#

half of them don't

#

the other half made the fucking internet

smoky oak
#

thats not true

vocal cloud
#

He's worked in the industry but C# isn't his forte

#

Nor is gag LinQ

echo basalt
#

my programming teacher's entire career is just

#

study programming, study teaching, become programming teacher

#

never worked as a developer

#

Then I have my networking teachers

vocal cloud
#

I think my teach had 20 years? He started teaching a year ago so his most common phrase is
"we don't use this in the industry but"

echo basalt
#

mans setup the entire school's network, preached about cisco and taught about the TCP stack

young knoll
#

/shrug I had one that went off on a tangent about the Covid vaccine…

echo basalt
#

new teacher manages tons of hospitals remotely

#

one of my teachers wrote the hotel software that half the country uses

vocal cloud
#

I think my current one worked on collecting telemetry data on fighter jets. Only reason he got the job was he knew one of those awful COBOL like languages

smoky oak
#

that once again is true

echo basalt
#

man wrote pascal code or some shit

vocal cloud
#

Yeah can't remember the name for the life of me

echo basalt
#

sometimes I wonder if I should learn cobol

#

just for the wages

vocal cloud
#

He gets paid bigly cause he's one of the few who knows it

echo basalt
#

and because I already hate myself, so nothing much will change

#

my comp architecture teacher wanted to teach assembly in class

#

to a bunch of kids that didn't know what an int was

vocal cloud
#

My friend learned both assembly and C and C++ and he still doesn't know good design patterns

echo basalt
#

like

#

class has been learning how to code for the past 2 years

#

mf went to the teacher

#

"wtf is an int, I'm hella confused"

vocal cloud
#

I feel that on a spiritual level ngl

echo basalt
#

I'm glad I skipped that class because I'd punch the shit outta him

young knoll
#

Java? Isn’t that just a posh word for coffee?

vocal cloud
#

I had a kid in Highschool bio class high asf the whole time ask me at the end of class what page we're on. Like bro class is over

echo basalt
#

we did python and c#

#

I don't think we have any smokers in our class

#

we had a guy that pulled a cig out during class but that's a different breed

vocal cloud
#

Usually get weeded out Y1

#

C--

echo basalt
#

Uh, sure.

vocal cloud
#

Soon to have Rust tho 👀

echo basalt
#

pretty sure that torvalds approved the usage of Rust

vocal cloud
#

Ye

#

Next big update will see the first native Rust apparently

#

Imagine not having memory issues. Couldn't be me

echo basalt
fluid river
#

where are noobs

#

show me

echo basalt
#

I only just noticed that you are the guy that's on your bio

#

lmfao

vocal cloud
#

who

echo basalt
#

nuker

#

mans like

#

free java lessons
<tag I thought was someone else>

young knoll
#

Free java lessons, just DM md_5

vocal cloud
#

Where is that noob? They'd love to be taught I'm sure

vocal cloud
fluid river
fluid river
#

how to increase tickrate to 21

vocal cloud
#

tick_rate = tick_rate + 1

fluid river
#

help me i'm getting Unsupported class version (52.0) when i play need for speed mine crafted

young knoll
#

Amateur!

fluid river
young knoll
#

tick_rate++

fluid river
#

in onEnable()

vocal cloud
fluid river
#

or in runnable in onDisable

#

what is runnable

#

still don't get it

young knoll
#

Don’t put ticks in your hair

fluid river
#

is it connected to YamlConfiguration somehow

echo basalt
echo basalt
fluid river
fluid river
echo basalt
#

what the fuck paper actually has an item rarity api 💀

fluid river
#
public class BiggestProjectEver extends JavaPlugin {
    public void onDisable() {
        }
    }
}


while (true) {
    tick_rate = tick_rate + 1 { System.out.println("Hello, world") }};
}```
#

why doesn't it work

echo basalt
#

pretty sure it's like

fluid river
#

underlined red

echo basalt
#

beacons, gapples

#

etc

vocal cloud
#

paper? I hardly knew her

fluid river
#

i got chinese intellij from my dad

#

and i forgot how to read on it

young knoll
#

Yeah it just determines the color of an item name

echo basalt
#

sadge

young knoll
#

And uhh… I think that’s it

fluid river
#

what is the error

#

pliz

vocal cloud
#

The error is 403 forbidden

fluid river
#

oh no how come you are so good at chinese

#

increase tick rate

#

easily

#

i know

fluid river
#

help me solve this puzzle

vocal cloud
#

I imagine not enough {}

fluid river
#

maybe

vocal cloud
#

add a few hundred

fluid river
#

changed

vocal cloud
#

nest some if's while you're at it

fluid river
#

check

#

still doesn't work

vocal cloud
#

Unnecessary primitive wrapper usages

fluid river
#

shit

echo basalt
#

just change the bytecode to say you have class version 99

vocal cloud
#

Add a PR to spigot telling them that it's not your code that's wrong it's them.

#

Okay maybe don't do that but it's funny to see it happen irl

echo basalt
#

we should make a plugin bundled within spigot

#

so that when you put spigot on your plugins folder

#

it actually just crashes your server

vocal cloud
#

it just starts another server and creates another setup so you can nest servers in the worst way possible

echo basalt
#

and also fix my annoying habit of putting the plugin jars outside the plugins folder

echo basalt
#

not my fault that I patch plugins and spigot itself too

young knoll
#

Spigot can now load spigot as a plugin

echo basalt
#

and also check deep into world nbt data

young knoll
#

Spigot can now load forge as a plugin

vocal cloud
#

Magma?

#

Is that you?

young knoll
#

Yes

echo basalt
vocal cloud
#

lol

echo basalt
#

we bash at each other a lot

grizzled oasis
#

Question why this code doesn't work im trying to achieve to remove the player some durability to the armor he is wearing

Player player = ((Player) event.getDamager()).getPlayer();

                        short durablity = (short) (player.getInventory().getHelmet().getDurability() - 5);
                        
                        player.getInventory().getHelmet().setDurability(durablity);
earnest forum
#

if i instantiate a class extending the nms Zombie, do i need to do anything to spawn it in? or does it do it by itself

echo basalt
#

because I like tricky problems with neat solutions while he prefers making huge blocks of statements that just call different methods

vocal cloud
#

Custom mobs aren't persistent so make sure to recycle

fluid river
grizzled oasis
young knoll
#

Isn’t that the legacy way to set durability

echo basalt
#

you can do something hacky

earnest forum
young knoll
#

Proper one is in Damagable which is a subclass of ItemMeta

vocal cloud
echo basalt
#

durability is inverse

fluid river
echo basalt
#

subtracting 5 just heals the item

#

add 5 damage

grizzled oasis
grizzled oasis
remote swallow
#

@young knoll isnt ur spigot name jishuna now

echo basalt
fluid river
#

cast to Damageable

#

and do damage

grizzled oasis
echo basalt
#

nvm UUID is not final lol

vocal cloud
fluid river
echo basalt
fluid river
#

not us

earnest forum
#

can i make it so entities don't push other entities?

echo basalt
#

setDamage etc

#

it's a mojang thing afaik

#

I guess numbers set as 0 are slightly easier to compress

fluid river
#

disables gravity too

earnest forum
#

im using a serverplayer with a zombie

#

zombie has no ai

echo basalt
#

pretty sure entity pushing is defined in the move tick

earnest forum
#

and im assuming serverplayer doesnt either?

echo basalt
#

yada you're pretty much just asking us how to do every single step on your way there

smoky oak
#
Vector[] vectors = new Vector[value2];
for(int i=0;i<value2;i++){
  vectors[i] = //marked
    corners[i]...

can someone explain to me why it says IndexOutOfBounds in the marked line of code?
java.lang.ArrayIndexOutOfBoundsException: Index 3 out of bounds for length 3

fluid river
#

maybe it can be modified in spigot configs or smth

young knoll
#

Entities have a setCollidable

fluid river
earnest forum
#

bukkit entity?

young knoll
#

And also a addCollidableExemption or something

echo basalt
#

you're having a very basic issue given you know anything about bytecode

smoky oak
#
 Location loc0 = player.getLocation().add(0,-10,0);
        World world = loc0.getWorld();
        Vector addVector = new Vector(value1,0,0);
        double angle = 360.0 / value2;

        Location[] corners = new Location[value2];
        for(int i=0;i<value2;i++){
            corners[i] = loc0.clone().add(addVector);
            addVector.rotateAroundY(angle);
        }
        Vector[] vectors = new Vector[value2];
        for(int i=0;i<value2;i++){
            vectors[i] = //error here
                    corners[i+value3%value2].toVector().subtract(
                            corners[i].toVector()).
                            multiply(.05);
        }
earnest forum
#

the method isn't showing up

#

in my class extending zombie

smoky oak
#

well a for loop should go through 0 to value2 - 1

#

not inclusive value2

fluid river
#

corners[i+value3%value2]

#

im pretty sure it's here

#

so you get 3

smoky oak
knotty meteor
#

How can i schedule a task for running every few days changable in config?

smoky oak
#

thats why i put the linebreak there

#

to check exactly that

echo basalt
#

do corners[(i + value3) % value2] instead

fluid river
#

u sure it's here and you didn't remove/add a random whitespace

echo basalt
#

rest of the code looks fine, this should fix it

fluid river
smoky oak
#

well it says error in line 45 and that is in line 46

earnest forum
smoky oak
#

ill do once it works

vocal cloud
#

name the variables better and you won't need to hes_UwU

echo basalt
#

I tend to go insane with commenting code whenever it's something complex

smoky oak
#

also while nuker and imillusion were right i dont understand why it would give the wrong line

knotty meteor
fluid river
#

well server might restart at least once in 3 days

smoky oak
#

also i fucked up the math but idk where

echo basalt
#

self-explanatory code is good enough

fluid river
#

so you better store the millisecond timepoint irl in config when your task should be executed

echo basalt
#

but sometimes you gotta go the extra mile when doing trig

fluid river
#

and run a task timer which stops at given milliseconds time

smoky oak
#

vector math is really annoying to debug

fluid river
#

vector math is really annoying to do on paper last day before exam

knotty meteor
#

Thanks i will try that!

echo basalt
#

fun thing I do

#

I actually visualize and debug vector math on math class

#

with pen & paper

smoky oak
#

no no im trying to get a triangle

echo basalt
#

hella useful

fluid river
echo basalt
#

you're trying to make a triangle?

fluid river
#

lines between

echo basalt
#

just make 3 points and make a line between each point

smoky oak
#

it gives me a triangle but not in the shape i want

fluid river
#

what

echo basalt
#

just do like

remote swallow
#

triangle

smoky oak
#

the vector math should give a even triangle

fluid river
#

so your shape is inaccurate

#

🙂

echo basalt
#

actually I know what you're doing

#

rotateAroundY takes the angle in radians

#

you're passing degrees

#

stupid shit but it happens

smoky oak
#

🤦‍♂️

#

...why?

echo basalt
#

idk

#

I always decompile these vector methods to double-check

smoky oak
#

at the very least its an easy fix

#

angle = angle * pi / 180

echo basalt
#

angle = Math.toRadians(angle)

smoky oak
#

apparantly yes

floral drum
#

guys I can't figure out what this does:

    public static void main(String[] args) {
        System.out.println(1 + 1 * 2)
    }```
help
smoky oak
#

it prints 3

remote swallow
#

if you run that it kills your parents

floral drum
floral drum
young knoll
#

Main methods are static abuse

echo basalt
#

why you passing an array, lists are more useful

floral drum
#

ahahah

ivory sleet
#

?

smoky oak
#

im using static whenever i want

#

idfc about yall

young knoll
#

My tv likes static abuse

remote swallow
floral drum
#

fork java and remove all the static

#

make it so you have to instance the class

#

like "System"

#

ty zacken ❤️

#

ily too

smoky oak
#

hooh

#

they're getting more intelligent

fluid river
#

boon

floral drum
#

no

#

that requires static

smoky oak
#

they can find zero width spaces now

remote swallow
#

yep

#

no clases for us

fluid river
#

fork java remove semicolon

remote swallow
#

make java, except you can only type in brainfuck

fluid river
#

make java run on chinese

smoky oak
#

K᠎ys

#

not all of them

#

but some

fluid river
#

so instead of Hello world you do

#

Ni men hao

smoky oak
#

im just testing shit

smoky oak
#

apparantly someone forgot theres more than one ZWS

floral drum
#

❤️

fluid river
#

remove arrays from java

smoky oak
#

welp ig normal spaces work too

fluid river
#

and leave stacks only

#

and vectors

remote swallow
#

make java only ever need 1 class

fluid river
#

Remove collection interface

smoky oak
#

isnt the overhead of a list bigger than that of an array

fluid river
#

++++

remote swallow
#

that would end up like 200k lines long in the end

fluid river
#

++++

fluid river
#

or at least change records' methods

#

from value()

#

to getValue()

ivory sleet
#

but like Collections.ArrayList is basically a wrapper for a normal array

fluid river
#

yes

smoky oak
#

wait so

ivory sleet
#

yeah fluent naming

fluid river
#

they look cringe

ivory sleet
#

^

smoky oak
#

adding an element to an arraylist just creates a new array and copies the old one then inserts the new element

fluid river
#

like basically in java you ask for something

#

so you use get

#

kinda like irl

remote swallow
#

fork java except you type like its skript

fluid river
#

and records mess it up

ivory sleet
#

myes there is the debate whether functions should be verbs or nouns

fluid river
#

verbs kinda more connected to irl

ivory sleet
#

well personally I believe get doesnt really add anything

midnight shore
#

Hi how can i prevent falling blocks to place themselves?

ivory sleet
#

sure writing get on some object provides u with getters only as suggestions

fluid river
ivory sleet
#

but its shorter and still as expressive if not even more

smoky oak
#

and piston weirdness

midnight shore
fluid river
#

basically quit the game while block is still falling

#

and delete the world folder

#

so you prevent blocks from placing

#

would i be able to do like

#

Class::x

#

so i call x() method

#

if i use records

#

well then probably not so bad

ivory sleet
#

yeah and not to mention record like getters have became the standard in java std

#

like ReadWriteLock::readLock and ::writeLock

fluid river
#

read/write are verbs

#

ya know

ivory sleet
#

no but it returns a read write lock's read lock respectively write lock

midnight shore
ivory sleet
#

usually implemented in a reentrant fashion

midnight shore
#

😐

fluid river
#

make a c++ program connect to mc process

#

get memory adress of the event

midnight shore
fluid river
#

quit the game when found

#

and delete world folder

ivory sleet
#

anyway nukerfall Id say not having the getter prefix makes the abstraction more powerful as it tells u less about how the function behaves whilst usually keeping what the function does

fluid river
#

loops?

#

except forEach

#

no need

#

well sometimes

midnight shore
fluid river
#

it's better to have an external variable

#

instead of calling stream.sort(yourComparator).get(0);

fluid river
#

and cancel it

#

idk

midnight shore
#

but wouldn't it prevent other stuff?

fluid river
#

or find some event of block place from entity

fluid river
#

of what actually happened

#

so you get if it's caused by falling block

#

and if it is cancel the event

midnight shore
#

yeah i made that but the event doesn't have a getEntity() method or anything

fluid river
#

this sucks

midnight shore
fluid river
#

small pp event

midnight shore
#

so i cast it to FallingBlock?

#

yeah obv

fluid river
#

i think entities

midnight shore
#

it works!

knotty meteor
#

How do i get all the regions a player is owner of with worldguard?

#

yes found it! thanks!

smoky oak
#
for(int i=0;i<value2;i++){
            vectors[i] = corners[(i+value3)%value2].toVector().subtract(corners[i].toVector()).multiply(1.0/20.0);
        }

        Particle.DustTransition particle = new Particle.DustTransition(Color.WHITE,Color.BLACK,1f);

        for(int i=0;i<value2;i++){
            for(int j=0;j<20;j++){
                world.spawnParticle(Particle.DUST_COLOR_TRANSITION,corners[i].clone().add(vectors[i].multiply(j)),4,particle);
            }
        }

value2 = 9; value3 = 1. Why does it produce 9 points instead of a nine-sided polygon

#

ah

#

forgot a clone again

bitter crystal
#

Is there a way to spawn an interactive dead body?

fluid river
#

you can spawn armor stand with skull on helmet

fluid river
earnest forum
#

you can spawn a serverplayer lying down can't you?

#

put it in the position as if its sleeping

fluid river
#

only with packets

#

i tried it once for 1.16

#

you can make player walking while lying

#

and when player flies up from the hole in dirt it looks like resurrection

quaint mantle
#

Lmao

fluid river
#

yeah

#

was laughing too

#

used ProtocolLib for that

#
package me.carefall.etalon;

import org.bukkit.plugin.java.JavaPlugin;
import static me.carefall.etalon.util.Colorizer.colorize;

public class Etalon extends JavaPlugin {
    
    public void onEnable() {
        saveDefaultConfig();
        send("&aPlugin enabled!");
    }
    
    public void onDisable() {
        send("&cPlugin enabled!");
    }
    
    public void send (String s) {
        getServer().getConsoleSender().sendMessage("["+ getDescription().getName() + "] " + colorize(s));
    }

}```
#

what do you think about this code

remote swallow
#

i hate it

fluid river
#

why tho

remote swallow
#

is logger not good enough for you

fluid river
#

no

#

i have colored messages i send to console directly

quiet ice
#

As long as it isn't production code, I'll let it slide

fluid river
#

what about production code

#

you would suggest removing static import and use logger?

hazy parrot
fluid river
hazy parrot
#

ANSI color codes for logger

fluid river
#

what should be in send {}

hazy parrot
#

Java.util logger supports if afaik

fluid river
#

isn't sedning message to console faster or smth

hazy parrot
#

Idk tbh

fluid river
#

and like no shit with translating &code to ansi

#
public static String colorize(String input) {
    return ChatColor.translateAlternateColorCodes('&', input);
}```
#

my paint method

#

basically just replacing & with §

#

so console eats it easily

#

also should i have a method where i register listeners

#

or it's better if i leave them in onEnable

#

or it depends on amount of listeners i want to register

quiet ice
fluid river
#

why tho

#

most of my dev.bukkit plugins have colored logging

#

same as like LuckPerms

quiet ice
#

Luckperms also has no rights for that

fluid river
#

still

#

they do

#

and it looks neat

remote swallow
#

its luckperms

quiet ice
#

They even use ASCII art, another big no-no

fluid river
#

a lot of plugins do colored logging

remote swallow
#

wonder what there bstats islike

fluid river
#

see no problem with it

#

also isn't creating a painter class and using it's static paint method in all of the classes a static abuse

#

should i switch to colorizer instance instead

quiet ice
#

This is the reason I am against colored logging - warnings and errors are much more intrusive if they aren't in a see of colors

hazy parrot
#

It's literally utility, no need to be instance method

fluid river
#

and onDisable

#

And for my plugin's errors which i handle

#

i make red color

#

and sometimes disable plugin/server

quiet ice
#

So what, errors tend to happen there more than anywhere else

fluid river
#

if plugin is critical for it's performance

smoky oak
fluid river
smoky oak
#

and nothing else

fluid river
#

color errors

quiet ice
#

Or well, log4j

smoky oak
#

idk what ur on but my errors are black on white

fluid river
#

i still have a question about listener's registry

quiet ice
smoky oak
#

maybe

fluid river
#

i run spigot mostly

smoky oak
#

im running spigot so that my plugins run on spigot

fluid river
#

so i don't remember

quiet ice
#

then that is defo is issue, paper does a lot of logging changes

#

Which is why on paper you'll often see epic fails like this one

smoky oak
#

well lp apparantly works under spigot so idk why that wouldnt wokr

quiet ice
#

what do you mean?

#

Don't get me wrong: All your proposed stuff (partially) work on both spigot and paper

smoky oak
#

colors under spigot in console are possible

hazy parrot
#

Is pdc safe for storing secrets? (ie no other plugin can access it)

quiet ice
hazy parrot
#

And can you see value when thread/memory dump?

crimson terrace
hazy parrot
#

Thanks 👍

quiet ice
#

For itemstacks it is NOT AT ALL

#

PDC of itemstacks is sent to the client

hazy parrot
#

I was thinking about hex string represented as byte array

#

But ig I won't do it

quiet ice
#

what do you want to store even?

crimson terrace
#

it depends on the severity of the secret

#

if you wanna store passwords, dont

hazy parrot
#

Will just stick to sql

quiet ice
#

if it is easier to just store them in the pdc, just encrypt them

crimson terrace
#

hashing would do, probably

hazy parrot
#

Yap, encrypting them anyway

quiet ice
#

and store the salt in some random chunk

fluid river
#
package me.carefall.etalon.listeners;

import org.bukkit.event.EventHandler;
import org.bukkit.event.Listener;
import org.bukkit.event.player.AsyncPlayerChatEvent;
import me.carefall.etalon.Etalon;
import static me.carefall.etalon.util.Colorizer.colorize;

public class ChatListener implements Listener {

    private Etalon plugin;

    public ChatListener(Etalon plugin) {
        this.plugin = plugin;
    }

    @EventHandler
    public void onChat(AsyncPlayerChatEvent event) {
        event.setCancelled(true);
        String format = colorize("&b" + event.getPlayer().getName() + "&f -> " + event.getMessage());
        if (!plugin.getConfig().getBoolean("log-chat")) {
            plugin.getServer().getOnlinePlayers().forEach(p -> {
                p.sendMessage(format);
            });
        } else plugin.getServer().broadcastMessage(format);
    }

}```
#

what about this

remote swallow
#

not config-able

#

bad

quiet ice
fluid river
#

setFormat is shit

quiet ice
#

How come?

fluid river
#

since it's using String.format from like 1.14

#

or higher

#

it became trash

quiet ice
#

Due to performance or what?

ivory sleet
fluid river
#

due to it's eating regex

quiet ice
fluid river
#

for no reason

ivory sleet
#

format doesnt use regex?

fluid river
#

it does now

quiet ice
#

Yeah, format shouldnt use regexr

ivory sleet
#

ugh what

fluid river
#

so if you have % or $ or some other symbols

#

it crashes completely

#

you have to \\ them now i guess

quiet ice
#

I think you just didn't read the String.format documentation

fluid river
#

there were topics about setFormat already

#

i used it back when i coded for 1.8-1.12

#

and it was working perfectly

#

now it's trash

quiet ice
#

I.e. String.format("%s's percentage points is %d%%", "John", 100) would print "John's percentage points is 100%"

fluid river
#
event.setFormat(colorize("&b" + event.getPlayer().getName() + "&f -> " + event.getMessage()));
ivory sleet
#

anyway I do agree that the choice of using Formatter format specifications for the async chat event is somewhat undesirable but not for your reasons, yes String.format() delegates to Formatter() which uses regex iirc under hood however its pre-compiled

fluid river
#

mostly fucked me up when i tried placeholders

#

i think

#

cuz of the %

quiet ice
#

You'd need to use event.setFormat(colorize("&b%s&f -> %s")))

ivory sleet
#

you can also use setMessage

fluid river
#

i need to change full format

#

player prefix

ivory sleet
#

but there are a lot of plugins that just cancel the event and broadcast their own message

fluid river
#

player name

#

some placeholders for messages sometimes

ivory sleet
#

well prepend a placeholder parser before the formatting maybe?

fluid river
#

have to write entire method instead of just sending own customized message

ivory sleet
#

so?

#

if you are that lazy, just use skript or something, then you dont even have to compile

fluid river
#

alr let's change it

#
event.setFormat(applyPH(colorize("%vault_prefix% " + event.getPlayer().getName() + "&f -> " + event.getMessage())));
#

now if for some random reason vault is not loaded or i have no PAPI extension it's gonna crash

remote swallow
#

check for it onEnable

fluid river
#

and if i send custom message it will tell server owner that extension is not installed

#

by literally leaving %player_prefix%

#

in message

ivory sleet
#

As said, you can just cancel and send your own message

#

That is what every other chat plugin does

fluid river
ivory sleet
#

Which is not the greatest solution

warm light
#

How to check if player is shift-clicking on a block?

ivory sleet
#

But due to the design choice of async pce

fluid river
#

and every plugin which supports it

#

so if at least one is not loaded, i should not even create a chat listener

#

that's the problem

river oracle
#

Then just check if they right clicked q block

fluid river
#

when right click if player.isSneaking() == true then they definitely shift-click

river oracle
fluid river
#

yes

#

just for example

river oracle
#

It's just extra typing for nothing

fluid river
#

bro just to clarify

#

if (!plugin.getConfig().getBoolean("log-chat")) {

#

here

#

i don't use == true

warm light
fluid river
#

Isn't this button hardcoded

#

so if you use button for sneaking

river oracle
fluid river
#

it would be shift-click

river oracle
#

But it will literally detect of they are sneaking

fluid river
#

isn't there a isShiftClick() method

#

in InventoryClickEvent

#

then

river oracle
#

There's nothing wrong with the isSneaking method it does what it says in the name no exceptions

warm light
#

Shift click on a block

quiet ice
#

I am not too sure if shift click on a block is diff to sneak click on a block

#

Either way, use the respective PlayerInteractEvents

fluid river
#

bro

fluid river
#

oh i see

#

what does shift click on block even do

#

like placing torches on crafting tables?

#

?

river oracle
#

Ye but that's not specific yo shift

#

It's a sneaking functionality

warm light
fluid river
#

isn't it gonna work

river oracle
quiet ice
#

/shrug And if the player spoofed the sneaking state, it's bad for them

#

lmao what

fluid river
#

¯_(ツ)_/¯

#

cringe ¯_(ツ)_/¯

smoky oak
#
Location[] locations = new Location[1];
for(Location l : locations){l = exampleLocation.clone().add(0,1,0);}

after this does locations[0] contain null or exampleLocation + 0,1,0 ?

quiet ice
#

Probably typed it too fast for discord to handle

echo basalt
fluid river
#

why don't you do

fluid river
#

Location[] locations = new Location[] {exampleLocation.clone().add(0,1,0)}

smoky oak
#

wanted to know if i can do it without the int stuff

quiet ice
#

for (var x : arr) is basically a for (int i = 0; i < arr.length; i++) {var x = arr[i]; wrapper

fluid river
#

lol

quiet ice
#

Any reassignmets to X do not result in any ASTORE instructions

smoky oak
# fluid river do this instead of int stuff
Location[] corners = new Location[polyNumber];
        Vector[] connectors = new Vector[polyNumber];
        double angle = Math.toRadians(360.0 / jumpNumber);
        for(int i=0;i<polyNumber;i++){
            corners[i] = center.clone().add(examplePoint);
            examplePoint.rotateAroundY(angle);
        }

still doing vector stuff, i dont know the value of polyNumber

quiet ice
#

Basically foreach will always only produce a single XLOAD insn, but not a XSTORE insn (unless told otherwise)

smoky oak
#

yea that makes sense

#

im a bit suspicious of java after all this stuff where calling vector methods edits the vector and returns the reference

fluid river
#

bukkit vectors and locations are sus

fluid river
#

))

smoky oak
#

wdym

fluid river
#

and add directly

#

or list

quiet ice
#

Don't use Stack

fluid river
#

or something which supports adding

quiet ice
#

As in a FIFO queue or just a normal list

fluid river
#

yeah

quiet ice
#

yeah to what?

echo basalt
#
public List<Location> getPolygonPoints(int pointCount, Location center, double distanceFromCenter) {
  double angle = 360 / pointCount;
  List<Location> list = new ArrayList<>();

  for(int index = 0; index < pointCount; index++) {
    double angleOffset = index * angle;
    double radians = Math.toRadians(angleOffset);

    double x = Math.sin(radians) * distanceFromCenter;
    double z = Math.cos(radians) * distanceFromCenter;

    list.add(center.clone().add(x, 0, z));
  }

  return list;
}
fluid river
#

to list

echo basalt
#

then just draw a line betwene each point

quiet ice
#

Then at worst use java.util.Vector, at best use ArrayList or CopyOnWriteList (if concurrency is needed)

fluid river
#

i don't think he really needs concurrency here

#

just filling array

quiet ice
#

I mean you started by suggesting Stack, which is a thread-safe implementation of a LIFO Queue

fluid river
#

i just said first collection on my mind

#

for example

#

hey guys

#

i can wrap setFormat

#

into FormatException try catch

#

and if caught one just send unmodified message

echo basalt
#
public List<Location> drawParticleLine(Location start, Location end, double offset) {
  // offset = 1 / particlesPerBlock, so 0.2 means 1 particle every 0.2 blocks
  Vector one = start.toVector();
  Vector two = end.toVector();

  double distance = one.distance(two);
  Vector offset = two.clone().subtract(one).normalize().multiply(offset);

  Vector current = one.clone();
  List<Location> points = new ArrayList<>();
  World world = start.getWorld();

  for(double index = 0; index < distance; index += offset) {
    current.add(offset);
    points.add(current.toLocation(world));
  }

  return points;
}
fluid river
#

and log error

echo basalt
#

@smoky oak should solve all your particle shenanigans

smoky oak
#

about 90% of it yes

#

im doing a second version of the first method

echo basalt
#

so now you just make the list, cache it and render the points as you go

smoky oak
#

since i dont want to have to do weird math if i have a non-north aligned polygon

fluid river
# echo basalt ```java public List<Location> drawParticleLine(Location start, Location end, dou...
public List<Location> drawParticleLine(Location start, Location end, double offset) {
  // offset = 1 / particlesPerBlock, so 0.2 means 1 particle every 0.2 blocks
  Vector one = start.toVector();
  Vector two = end.toVector();

  double distance = one.distanceSquared(two);
  Vector offset = two.clone().subtract(one).normalize().multiply(offset);

  Vector current = one.clone();
  List<Location> points = new ArrayList<>();
  World world = start.getWorld();

  for(double index = 0; index * index < distance * distance; index += offset) {
    current.add(offset);
    points.add(current.toLocation(world));
  }

  return points;
}```
echo basalt
#

or just feed it through 7smile7's code to distribute it

#

sure you can do squared stuff

fluid river
#

just faster

echo basalt
#

looks rather hacky

#

you can also just mess with locations directly instead of doing location -> vector -> location