#help-development

1 messages · Page 667 of 1

icy beacon
#

i'm procrastinating working

#

cya yall ❤️

echo basalt
#

So if you have this

#

Converting to decimal is basically

#

binary number * (2^index)

dusky crane
#

if there's a one

echo basalt
#

and summing it all

#

ofc discord fucking crashed

dusky crane
#

ofc my code doesn't work

echo basalt
#

So 0101 in decimal is as simple as

1 * 2^0 +
0 * 2^1 +
1 * 2^2 +
0 * 2^3 ...

dusky crane
#

I'd send a photo but I can't

#

The code only works in 1 chunk

echo basalt
#

You run it in reverse order n magic

dusky crane
#

Part of it in one chunk

#

from 0 0 to 15 15

icy beacon
echo basalt
#

x << 4 == x * 2^4

#

in most cases

#

welp gtg

orchid trout
#

i need to check if the user is banned in userloginevent

#

i meant

#

playerloginevent

dusky crane
orchid trout
#

user is loaded async

dusky crane
#

Can it be hard?

hazy parrot
#

so as imillusion said, load async, when you know user is loaded fire event

orchid trout
#

how is firing an event gonna help

hazy parrot
#

so you know your user is loaded in your fired event

slender elbow
#

they want to disallow the login event

orchid trout
#

i still dont understand how that will do anything

#

yes

slender elbow
#

you can't do that after it's happened lol

#

the way i'd do it is, trigger the load in the AsyncPlayerPreLogin, then block that event until the user is loaded (it won't block the netty ELs, it runs in its own thread), then get the user in the login event and disallow accordingly

orchid trout
#

how do i block an event

hazy parrot
#

dont make request to database async

icy beacon
#

in bungeecord you can register an intent, run your stuff, and then complete intent, during that time the user will just be left hanging on the login screen. if you plan on making your server in bungee, consider doing it this way

slender elbow
#

you join on your loading future in the APPLE

orchid trout
#

should i not?

slender elbow
#

don't make it async*

*with respect to that thread (the APPLE thread)

orchid trout
#

ok

hazy parrot
#

why is it called apple thread

orchid trout
#

rule 11

slender elbow
icy beacon
#

rule 11

slender elbow
#

much thonk

orchid trout
#

rule 11 is no hating on cats

icy beacon
#

that's rule 1

icy beacon
#

the primary rule

orchid trout
#

lets agree to disagree

#

its rule 1 and 11

icy beacon
#

so rule 6

hazy parrot
orchid trout
#

i knew it refrenced the async thread, but i didnt know why

#

mmmm

#

flat code

#

no cheats

north nova
#

why r u querying the user twice:D

#

unless ur caching it

orchid trout
#

remnants of old code

#

thank you f or catching that

north nova
#

np i guess

#

also i suggest u have a getOrCreate method for that

#

and have a cache layer

#

no reason to kick unless something goes horribly wrong

orchid trout
#

insertandget is getorcreate

torpid magnet
#

anyone know why the colours don’t work?
``` player.sendMessage(prefix + message);````

and my prefix is: &#fb0000[&#dd0020C&#c0003fR&#a2005fE&#84007fA&#66009eT&#4900beE&#2b00ddS&#0d00fd]

alpine urchin
#

wtf

tender shard
#

because

  1. you didnt use ChatColor.translateAlternateColorCodes
    and
  2. that's not even a valid color code
dusky crane
#

Any expert in generating custom worlds here?

torpid magnet
#

also the code is valid bec works ingame?

tender shard
#

no

quaint mantle
#

bro xd

tender shard
#

the legacy hex format is &x&a&b&c&d&e&f for e.g. abcdef

#

for any other formats, you have to parse the message yourself

lunar wigeon
zealous osprey
#

Heya, I wanted to know if there's a way to let me be able to return an Integer when I specify "clazzCast" to be Integer.class?

ivory sleet
north nova
#

what are you trying to do @zealous osprey

lunar wigeon
ivory sleet
#

Yes it is what are you on about

north nova
#

@zealous osprey u dont need the T clazzCast param

lunar wigeon
#

its like you would say hex and rgb is the same

river oracle
#

its the same thing

#

under the hood it is legitametly hex it just looks slightly different due to how legacy processes colors

ivory sleet
zealous osprey
#

I don't want to return Object if I know exactly that it should be an Integer for a certain NBT path

north nova
#

it returns whatever u want

lunar wigeon
north nova
#

<Integer>getSimpleDataFromCompound(...)

#

or just

zealous osprey
north nova
#

int something = getSimpleDataFromCompound()

ivory sleet
north nova
#

cause

#

ur returning

#

Class

#

u can do

lunar wigeon
#

stop pinging me

zealous osprey
#

AHHH, thanks @north nova <3

tender shard
north nova
#

public <T, K extends Class<T>> T getSimpleDataFromCompound(K clazz, NBTResult nbtResult)

tender shard
#
public static <T> T getSomething(Class<T> tClazz) {
  return (T) something;
}
north nova
#

his T extends Class

tender shard
#

yes, that's wrong

north nova
#

not necessarily

#

depends on his usecase

#

but yea

river oracle
#

with his usecase its wrong

vast ledge
#

Is there a web api, that can get the donwloads and those kind of stats from ur plugin on spigot?

tender shard
vast ledge
#

thanks 😄

river oracle
#

can't do premiums, but works for all free

tender shard
#

works for paid plugins too

#

however the builtin API also can show the downloads and other stats

river oracle
tender shard
river oracle
#

not sure how you'd download paid with spiget

#

idk just doesn't make sense

tender shard
#

nobody mentioned anything about downloading the plugin

river oracle
#

oh he just wants metrics

#

ahhh okay I read that wrong

vast ledge
#

@tender shard I could just parse the downolads sting from the return right?

tender shard
#

yes, it's just json

vast ledge
#

Im new to web development so im just asking

#

not used to js

tender shard
#

basically you parse the whole thing to a jsonobject, then you get the element "stats" as json object, then you get "downloads" as int

vast ledge
#

Where can i find the resource id, is it

#

or

tender shard
#

it's the stuff after the dot

icy beacon
#

weird question, how do i move a 6gb file from android to windows? usb connection is ruled out because my phone is half dead and does not handle usb correctly (namely, no more fast charging and no more usb transfer)

#

and google drive flips me off when i try to upload the file for some reason

echo basalt
#

TeamViewer

icy beacon
#

teamviewer does not work in russia unfortunately

icy beacon
#

never thought of sshing to my pc actually lol

#

wait how exactly would i do that

#

maybe you mean ftp?

tender shard
#

just install openssh-server on either the pc or the phone

flint coyote
#

there's also bluetooth

tender shard
#

then from the other device you sftp into it

flint coyote
#

although 6gb will take ages via bluetooth

dusky crane
#

How can I make this generate trees in more than 1 chunk?

    public void populate(World world, Random random, Chunk source) {
        for (int x = 0; x < 16; x++) {
            for (int z = 0; z < 16; z++) {
                if (random.nextGaussian() < 0.15){
                world.generateTree(new Location(world, source.getX()>>4+x,64, source.getX()>>4+z), TreeType.BIRCH );
                }
            }

        }
    }```
tender shard
#

populate with a World object? where is that from? 1.8?

river oracle
#

you can actually go into developer settings in android and change the connection type to specific things

icy beacon
#

why did my cmd just stop recognizing commands??????

#

this entire day everything is going weird

orchid trout
nocturne gale
#

Hello, I'm sorry if this doesn't belong here, I have a problem with spawning after /kill, setworldspawn is set but it still doesn't spawn where it should, could someone please give me some advice? Thank you!

tender shard
# dusky crane 1.16.5

idk how it is in 1.16 but in recent versions, the populate method gets passed a LimitedRegion that you can use

orchid trout
#

how do i get list of all chat color

dusky crane
north nova
smoky anchor
north nova
#

u use ampersand

orchid trout
north nova
#

thats illegal

#

LMAO

smoky anchor
#

lol nice

icy beacon
tender shard
icy beacon
#

i'm fine with using wsl

dusky crane
smoky anchor
icy beacon
tender shard
dusky crane
tender shard
orchid trout
north nova
dusky crane
north nova
#

??????

dusky crane
#

Linux makes it nicer for old devices

#

Installing modern Java on Linux is also easier

north nova
#

lol

#

if u say so boss

#

lmao

icy beacon
# tender shard yeah but what does it contain?

i'm not sure why it's relevant but C:\Program Files (x86)\OpenSSH\bin;C:\Users\user\.cargo\bin;C:\Program Files\MySQL\MySQL Shell 8.0\bin\;C:\Users\user\AppData\Local\Programs\Python\Python36\Scripts\;C:\Users\user\AppData\Local\Programs\Python\Python36\;C:\Users\user\AppData\Local\atom\bin;C:\Users\user\go\bin;C:\Users\user\.dotnet\tools;C:\Users\user\AppData\Local\Microsoft\WindowsApps;;C:\Program Files\JetBrains\CLion 2021.1.3\bin;;C:\Program Files\JetBrains\DataGrip 2021.1.3\bin;;C:\Program Files\JetBrains\IntelliJ IDEA 2021.1.3\bin;;C:\Program Files\JetBrains\GoLand 2021.1.3\bin;;C:\Program Files\JetBrains\JetBrains Rider 2021.1.5\bin;;C:\Program Files\JetBrains\PhpStorm 2021.1.4\bin;;C:\Program Files\JetBrains\PyCharm 2021.1.3\bin;;C:\Program Files\JetBrains\RubyMine 2021.1.3\bin;;C:\Program Files\JetBrains\WebStorm 2021.1.3\bin;;C:\Users\user\AppData\Roaming\npm;C:\Users\user\AppData\Local\Programs\Microsoft VS Code\bin

slender elbow
tender shard
icy beacon
#

how the fuck did that happen

tender shard
#

no clue

icy beacon
#

lmao

smoky anchor
tender shard
#

you also have a ton of empty paths in your PATH

#

that's all empty paths

orchid trout
icy beacon
#

ok funny thing happened

#

openssh overwrote my entire path

tender shard
tender shard
orchid trout
#

ohhh

#

than k you steve and thank you alex

icy beacon
#

this is per-user path

#

and uh

tender shard
#

you should cache ChatColor.values() somewhere though, it constructs a new array everytime

icy beacon
#

this is system

#

what the actual fuck why did it do tjhis

tender shard
#

idk ¯_(ツ)_/¯

#

never installed openssh on windows

icy beacon
#

i mean it's 2003 software

#

but still

#

ok i readded system32 but this is so stupid

#

i wonder how much stuff was in my path

tender shard
#

my OpenSSH is from may 2023 😛

orchid trout
smoky anchor
#

yes

orchid trout
#

how

smoky anchor
#

name() is the actual name of the enum as declared in code (unless overriten)

orchid trout
#

tostrfing

tender shard
#

name() cannot be overriden

#

toString() may return a friendly name

smoky anchor
#

seems that I have not worked with enums in some time :D

icy beacon
#

i'll try it though

orchid trout
#

space

orchid trout
tender shard
#

whatever you want it to be

#

name() is final

#

toString() is not

orchid trout
#

ok

icy beacon
#

in my notification tray i also used to have a prompt for what usb connection mode i was going for but it's not there anymore

#

fucks sake

river oracle
#

what's wrong with your phone?

#

you might have to pop the storage out and see if you can get it directly off the drive

#

depending how old your phone is it probably has a SSD granted it might be sautered

zealous osprey
#

You love to see it XD

north nova
#

use primitives!!!!!

zealous osprey
#

I could, but that isn't the issue

chrome beacon
#

primitives can't be null

north nova
#

u should*

chrome beacon
#

so that would be a valid use case

#

assuming the method returns null if the tag is missing

zealous osprey
#

Well, it doesn't matter here, cause lateron it'll be set into a new Location, so it'll be converted anyways

north nova
#

oh god

cunning osprey
#

why does it say class member declared outside of a class


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

import java.util.UUID;

    private final HashMap<UUID, LONG> cooldown;

public class ReroolCommand implements CommandExecutor {
    @Override
    public boolean onCommand(CommandSender sender, Command command, String s, String[] strings) {

        if (sender instanceof Player){```
tall dragon
#

because ur tryna declare a hashmap outside the class

north nova
#

cause you're declaring something

#

outside of the class

tender shard
north nova
#

someone say it again

smoky anchor
#

everything has to be inside

class
{
 your stuff
}```
north nova
#

make sure he knows

cunning osprey
north nova
#

ok guys he knows

tall dragon
tender shard
cunning osprey
#

JESUS I FIGURED IT OUT YOU DONT HAVE TO SAY IT MILION TIMES

tall dragon
#

great!

#

glad we could help!

north nova
#

Yipee!!

#

We're all very happy for you!

#

Truly!

cunning osprey
#

lol

north nova
#

(what the fuck man)

tender shard
tall dragon
icy bone
#

I got one question about the vanilla /Reload command. Right now you can only reload by doing /Reload confirm, and you get a warning message. But i got a few questions about this:

  1. Is reloading like this safe? and if no, what is a better solution?
  2. Is there a way to just type /reload? because the confirm after is for me just extra typing.
  3. Is there a way to remove the whole warning message?
north nova
#

unless the plugin is designed to support reloading

dusky crane
north nova
#

reloading fucks up a olt of things

icy bone
#

Well i got a server with only my own plugin and worldedit, and i keep using /reload, but i just read online its not safe because of memory leaks

north nova
#

well if you know what you're doing

tall dragon
icy bone
#

Till now i had no issue thats why i am supriced

north nova
#

you can use /reload

icy bone
#

I just use it for testing

north nova
#

stil probably unsafe

#

depending on what ur plugin does

#

what are you reloading for?

icy bone
#

Till now its just a simple minigame (prophunt) and make some prefix like ranks and stuff

#

Just to update the code, so my new code can be tested

north nova
#

are you replacing the jar or updating config values

icy bone
#

replace Jar

icy beacon
north nova
#

¯_(ツ)_/¯

#

i suggest you reboot the server completely

#

dont use reload

worldly ingot
#

You're totally fine to reload in a testing environment. We only really discourage it in production environments

Is there a way to just type /reload? because the confirm after is for me just extra typing.
Is there a way to remove the whole warning message?
Paper feature. Probably not

icy bone
#

So everytime i change some code, its better to fully reboot?

icy beacon
north nova
#

it really depends, but yeah

tender shard
icy bone
#

I see, so maybe lookin for a script that fully restarts the server is better i assume

north nova
icy bone
tall dragon
#

now i get it too!

#

thanks

north nova
icy bone
#

I am on windows

north nova
#

so how are u overriding the jar then what

remote swallow
#

building directly

north nova
#

i dind't know u can do that on windows?

#

ah

dusky crane
icy bone
#

I just run the file, creates an jar file and replace the old one

tender shard
#

windows is weird

worldly ingot
#

Yeah it locks the file because it's in use

north nova
#

idk ive been on linux for a while now

worldly ingot
#

But you can definitely replace it

icy bone
#

I am working in IntelliJ IDEA Community Edition 2022.2.2

dusky crane
north nova
#

its cool

icy bone
#

There i just build the file, run it and reload the server

worldly ingot
#

I drag and drop replace my plugins while my server's running all the time 😛

remote swallow
#
:start
title MC-%version%
java %args% -Dio.papermc.paper.suppress.sout.nags=true -DIReallyKnowWhatIAmDoingISwear -Xmx4g -jar %first_jar% nogui

echo Server restarting...
echo Press CTRL + C to stop.
timeout /t 5 > NUL
goto :start
icy beacon
icy bone
#

I just edited the path so it already places the jar in my minecraft folder server

tall dragon
tender shard
icy beacon
remote swallow
#

totally

icy bone
icy beacon
near mason
#

is there an entity/player land event?

tender shard
# icy beacon also send the code 👺
package com.jeff_media.javaquine;

public class Quine {
    private static final char quote = 34;
    private static final String[] code = {
"package com.jeff_media.javaquine;",
"",
"public class Quine {",
"    private static final char quote = 34;",
"    private static final String[] code = {",
"};",
"    public static void main(String[] args) {",
"        for(int i=0; i<5; i++){",
"            System.out.println(code[i]);",
"        }",
"        for(int i=0; i<code.length; i++){",
"            System.out.println(quote + code[i] + quote + ',');",
"        }",
"        for(int i=5; i<code.length; i++){",
"            System.out.println(code[i]);",
"        }",
"    }",
"}",
};
    public static void main(String[] args) {
        for(int i=0; i<5; i++){
            System.out.println(code[i]);
        }
        for(int i=0; i<code.length; i++){
            System.out.println(quote + code[i] + quote + ',');
        }
        for(int i=5; i<code.length; i++){
            System.out.println(code[i]);
        }
    }
}
north nova
#

wtf

#

what is this

tender shard
#

a quine

icy beacon
north nova
#

oh

tender shard
#

that's a program that outputs itself

north nova
#

why would anyone wan this tho

tender shard
north nova
#

no im not being rude or anything

icy beacon
north nova
#

its a genuine question

#

what is the usage of* this

tender shard
#

there is none

radiant aspen
#

Yo, Is Player nullable on PlayerTeleportEvent? The docs say its nonnull, but im getting alot of people sending me stack traces saying its null.

Is there any valid reason this could be null? or is it a bug?

java.lang.NullPointerException: Cannot invoke "org.bukkit.entity.Player.getLocation()" because "player" is null
    at com.iridium.iridiumskyblock.database.User.getCurrentIsland(User.java:35) ~[IridiumSkyblock-4.0.4.jar:?]
    at com.iridium.iridiumskyblock.managers.IslandManager.getTeamViaPlayerLocation(IslandManager.java:88) ~[IridiumSkyblock-4.0.4.jar:?]
    at com.iridium.iridiumteams.listeners.PlayerTeleportListener.onPlayerTeleport(PlayerTeleportListener.java:28) ~[IridiumSkyblock-4.0.4.jar:?]
north nova
#

oh

#

so its just for fun

tender shard
#

it's just a "well I'm bored, why not write a quine in <language> today" thing

north nova
#

Lmao

#

fair enough

#

that's cool

radiant aspen
# icy beacon can we have some code?

https://github.com/Iridium-Development/IridiumSkyblock/blob/master/src/main/java/com/iridium/iridiumskyblock/listeners/PlayerTeleportListener.java

Actually, I forgot I added this in an task, I guess if the player logs of in the same tick it could be null?

GitHub

IridiumSkyblock: Skyblock Redefined . Contribute to Iridium-Development/IridiumSkyblock development by creating an account on GitHub.

north nova
#

pls use dependency injection in these things 😭

radiant aspen
#

singletons >>>

tender shard
north nova
#

TRUE

#

honestly

#

i was thinking

#

to re-invent java

#

and create a new class for each entity

#

(player)

#

with static methods

#

and fields

#

make everything static

radiant aspen
#

fr

#

who needs classes anyways?

#

oop is overated

north nova
#

what exactly are u talking about

#

what is "classes"

#

im not very familiar with that term idk

#

i write Skripts for a living

#

i only know .sk file

#

75 cents an hour 16 hours a day

radiant aspen
#

Potentially its another plugin manually calling an event then? or a spigot bug?

north nova
tender shard
north nova
#

dont check if player object is null to check for that

radiant aspen
tender shard
tender shard
#

it's right here in your stacktrace

radiant aspen
#

ah

#

nevermind, yeah

tender shard
#

in the teleport event you call IslandManager.getTeamViaPlayerLocation() and that in turn calls User.getCurrentIsland

radiant aspen
#

looks like you know my code base better than I do lol

tender shard
#

i just looked at the stacktrace and the User class lol

spare hazel
#

How can i create custom entities?

tender shard
#

what exactly do you mean with custom entities?

spare hazel
#

Its the iridium skyblock guy

radiant aspen
#

Yo

tall dragon
#

is there a way to get spigot src without making a stupid jira account?

north nova
#

jk

remote swallow
#

yeah

spare hazel
remote swallow
#

you can look at source without

#

you need jira and stash access for pull requests

tall dragon
#

i dont want a pull request

remote swallow
#

so look at source

tall dragon
#

i just wanna be able to look at the src in my ide

tender shard
tender shard
remote swallow
#

git clone https://hub.spigotmc.org/stash/scm/spigot/spigot.git

tall dragon
spare hazel
tender shard
#

EntityStack?

remote swallow
#

git clone https://hub.spigotmc.org/stash/scm/spigot/craftbukkit.git & git clone https://hub.spigotmc.org/stash/scm/spigot/bukkit.git

#

and now you have all 3 current sources

spare hazel
tender shard
tall dragon
tender shard
remote swallow
remote swallow
#

why would an Entity have Stack

tall dragon
#

might better to takes epicebic's route then

remote swallow
#

its a singular mob

tender shard
tall dragon
#

yea that should be doable tho

#

:d

spare hazel
#

Whatever
I want to have an abstract class containing an entity's custom attributes and stuff and its listeners and a build function which glues all the things and creates a mob which i can spawn.

remote swallow
#

you have 2 options for custom mobs, a) fully custom, custom path finding, custom modeling and more, b) re skinning an already existing mob

spare hazel
#

Reskinning

tender shard
#

and whenever they get unloaded and loaded again they'll be the normal vanilla version again

spare hazel
tender shard
#

extends Zombie*

#

there is no EntityZombie in mojang maps

remote swallow
#

its 1.8

#

it would be EntityZombie

spare hazel
#

No i want to do it without nms

tender shard
#

then you cannot extend existing entity classes

spare hazel
#

In 1.17.1

tender shard
#

you need NMS to extend the existing classes

rare rover
#

hmm, why is jitpack showing me No build artifacts found what could be the cause?

spare hazel
rare rover
#

i configured everything correctly i think

tender shard
rare rover
#

so what should i do?

spare hazel
tender shard
#

I'd just create a MyCustomEntityFactory class that has a spawn method and applies all the given attributes using the consumer method

spare hazel
#

In the entity class

remote swallow
tender shard
north nova
#

i hate the factory design pattern bro

#

guava flashbacks

tender shard
#

well then just call it EntitySpawner or whatever lol

rare rover
tender shard
#

i uploaded shit to maven central today, it was so annoying

remote swallow
#

maven central can fook off

tender shard
#

md wanted me to upload it there

#

so I just did and didnt question it

#

lol

spare hazel
#

It takes 10 minutes for me to create a new minecraft project bcz its unable to download versions list and i have to close and reopen 50 times for it to work

tender shard
#

wdym with version list?

spare hazel
#

The place where you chose the version in the new project tab of intellij idea

tender shard
tall dragon
#

when i clone the repo shoulnt these be present?

#

not rlly getting that

remote swallow
#

run the patches

#

they exist afterwards

tender shard
tall dragon
#

oh i tried but absolutely nothing happened xd

clear panther
#

?tryandsee

undone axleBOT
tender shard
tall dragon
#

well it opens an external console and instantly peaces out

tender shard
#

btw why are there 2 epics

tender shard
#

open it from CLI

remote swallow
#

which project

tender shard
#

hover over the javadoc artifact and lcick the book

orchid trout
#

does fleet have both packages and folders?

tall dragon
#

@tender shard this was its output. i guess my fork cannot be named spigot or somethn? xd

tender shard
#

And you also have to provide the path to your buildtools thingy

tender shard
remote swallow
#

alex how did you claim ur namespace on central

#

like what do i do with the verification key

river oracle
rare rover
#

what do y'all recommend then?

#

jitpack trash so

river oracle
#

I host my own

rare rover
#

yeah i could do that ig

river oracle
remote swallow
#

selfhosting or repsy

river oracle
#

I use it for a ton of stuff other than my repo though

remote swallow
#

repsy is pretty decent

#

you might be able to rest api to query it

#

get latest version and then update ur url

#

oh

tender shard
#

this e.g. always uses the latest SNAPSHOT for 1.1

remote swallow
#

this type thing

#

except it dont work

#

would be up to reposilite to add probably

tender shard
#

i don't think so buuut that's pretty pointless, as maven by default automatically updates once per day to the latest snapshot

#

or do you explicitly declare a certain snapshot in your pom?

#

because that's pretty unusual

orchid trout
#

e

remote swallow
orchid trout
#

why 2 different answers

tender shard
#

oh that's what you mean

#

for that I manually upload my javadocs

#

and update them as needed

tall dragon
river oracle
#

Theirs a maven plugin for that btw too

tender shard
tall dragon
#

well i did the buildtools thingy but same result

river oracle
tender shard
#

yeah having bukkit and craftbukkit and spigot separated makes little sense nowadays

#

there should only be spigot-api and spigot

#

np. you could ofc also create an issue on reposilite and ask them to add a "javadocs viewer" or sth

tall dragon
#

yea i got no clue how this whole patch system works

tender shard
#

send the link to the issue when you created it, I wanna +1 it

#

maybe just rephrase it and ask about a "link that always points to the latest javadoc view"

#

usually they'll add the labels

lilac dagger
#

is there a way to set a time out to intelli sense?

#

i don't want it to crash if i click on Material anymore

tender shard
#

just download the javadocs/sources, then it won't have to decompile

#

but no clue how that works in vscode

lilac dagger
#

wait, i did this already somehow

#

oh i used the maven javadoc plugin, that must've done it for me

tender shard
#

the maven javadoc plugin is to generate a javadoc jar for your own project

lilac dagger
#

yeah but i messed with the configurations

#

something to do with offline mode

#

i tried to do something wild

north nova
#

have u tried clearing cache

brisk jetty
#

Okay so i have a gui system that denies players from taking item out of them or putting them in
but how do i stop players from shift clicking items into the gui?

Since the InventoryClickEvent the inventory clicked is not a gui inventory it doesnt cancel it
Is the only way just to keep a list of all players who have a gui open and deny all inventory interactions when a gui is open or is there a way to tell that a item has been shift clicked and where that item is going to end up

north nova
#

InventoryClickEvent#getClickType

tender shard
#

MOVE_TO_OTHER_INVENTORY

north nova
#

and use InventoryClickEvent#getClickedInventory

tender shard
#

^

brisk jetty
north nova
#

why am i forbidden from using external emojis

north nova
remote swallow
#

no boost

tender shard
quiet ember
#

Issue with creating custom player heads

north nova
tender shard
#

if they clicked their own inv, the type is MOVE_TO_OTHER, and the top inv is your GUI, then deny it

north nova
#

or use packets

#

: D

brisk jetty
tender shard
#

getView().getTopInventory()

north nova
#

getOpenInventory I think?

#

nvm what alex said

brisk jetty
#

RIGHtt Get inventory Vieww existtss
omg im dumb

#

Tysm

spare hazel
#
public void spawn(UUID spawner, Location location){
        this.spawner = spawner;

        LivingEntity mob = (LivingEntity) location.getWorld().spawnEntity(location, type, false);
        mob.setCustomName(name);
        mob.setCustomNameVisible(true);
        mob.setMaxHealth(health);
        mob.setHealth(health);

        if(hasArmor) {
            mob.getEquipment().setBoots(boots);
            mob.getEquipment().setLeggings(leggings);
            mob.getEquipment().setChestplate(chestplate);
            mob.getEquipment().setHelmet(helmet);
            mob.getEquipment().setItemInMainHand(hand);
        }

        mob.getAttribute(Attribute.GENERIC_MOVEMENT_SPEED).setBaseValue(speed);
        
        if(hasBossBar) {
            bossBar = Bukkit.createBossBar(name, BarColor.RED, BarStyle.SOLID);
            bossBar.setVisible(true);
            bossBar.setProgress(1.0);
            bossBar.addPlayer(Bukkit.getPlayer(spawner));
        }

        uuid = UUID.randomUUID();

        mob.getPersistentDataContainer().set(HypixelCustomMobs.getPlugin().getIsCustomKey(), PersistentDataType.INTEGER, 1);
        mob.getPersistentDataContainer().set(HypixelCustomMobs.getPlugin().getUuid(), PersistentDataType.STRING, uuid.toString());

        HypixelCustomMobs.getPlugin().getMobManager().addMob(uuid, this);
    }

can anyone take a look at this code for spawning a custom mob and telling me what is missing and what i can improve?

tender shard
# spare hazel ```java public void spawn(UUID spawner, Location location){ this.spawner...

When you want to spawn a custom entity, e.g. with a custom name or certain items equipped, you must use the method World#spawn(Location, Class, Consumer) unless you give a shit about compatibility with other plugins. I’ll explain why. The shitty way Usually, you can easily spawn entities like this: That is fine, as...

tender shard
#

a consumer is a function that takes in one argument

shadow night
#

I forgot what a consumer is too

tender shard
#

it's like a runnable but it has a parameter

shadow night
#

Callback function?

worldly ingot
#

Basically, yeah

tender shard
#

Runnable: No args, no return value
Consumer: One arg, no return value
Function: One arg, one return value
BiConsumer: 2 args, no return value
BiFunction: 2 args, one return value
... etc

spare hazel
#

what shoud i do to not give shit about other plugin compatibility?

tender shard
#

scroll down to "the proper way"

#

and use the consumer

spare hazel
#

ok

lunar wigeon
#

yoo hello @worldly ingot

tender shard
#

Bad:

Pig myPig = location.getWorld().spawn(location, Pig.class);
myPig.setCustomName("oliver193");
myPig.setCustomNameVisible(true);

Good:

Pig myPig = location.getWorld().spawn(location, Pig.class, (pig) -> {
    pig.setCustomName("oliver193");
    pig.setCustomNameVisible(true);
});
worldly ingot
shadow night
#

I've done that kinda stuff before, just that instead of using given classes (Runnable, Consumer) and I just made an interface with a run method. And due to how interfaces work with doing new, it worked. (Or was it an abstract class? Idk)

worldly ingot
#

Lambdas are doing that too, it just looks nicer

tender shard
#

both won't work

worldly ingot
#

Sure it will

tender shard
#

well I mean you cannot instantiate an interface or an abstract class

worldly ingot
#

Sure you can

tender shard
#

you can instantiate an anonymous class that extends/implements them

worldly ingot
#
Pig pig = ...spawn(location, Pig.class, new Consumer<>() {
    @Override
    public void run(Pig pig) [
        // hi
    }
});```
tender shard
#

yeah but that's an anonymous class and not instantiating a consumer itself

worldly ingot
#

Yeah of course. But that's what a lambda is too

#

It's just making it look nicer

tender shard
#

yeah sure

#

I was just worried about the "due to how interfaces work with doing new"

#

I wish interfaces would allow to declare constructors

worldly ingot
#

Due to multiple inheritance there's no way for that to be possible

spare hazel
#

can not resolve method getPDC

tender shard
#

yeah I know D:

worldly ingot
#

getPersistentDataContainer()

spare hazel
#

getPersistantDataContainer()

tender shard
spare hazel
#

i know

tender shard
#

well what are you trying to call it on?

worldly ingot
#

Only other reasons you'd not see it is if the object isn't a data holder or you're on < 1.14

tender shard
#

or using chunk's pdc on < 1.16.3

#

or world pdc on < 1.18 (i think?)

spare hazel
#

entity pdc

tender shard
#

so which version are you on?

spare hazel
#

1.17.1

tender shard
#

show your code

quaint mantle
#

Sorry for writing here, I just don't know where to write on the site. I really need help please!!! I need to add everyone who has a tag to the group, but you can’t use @a in the plugin, I don’t know what to do, it’s very necessary (((
/Извините что пишу сюда, просто не знаю где писать на сайте. Очень нужна помощь пожалуйста!!! Мне нужно добавить в группу всех у кого есть тег, но в плагине нельзя использовать @a, не знаю, что делать, очень нужно(((

worldly ingot
#

And is it the correct Entity import? Because there's one in AWT iirc

spare hazel
#

LivingEntity mob = (LivingEntity) location.getWorld().spawnEntity(location, type, false, (m) -> {
m.getPersistentDataContainer().set(HypixelCustomMobs.getPlugin().getIsCustomKey(), PersistentDataType.INTEGER, 1);
m.getPersistentDataContainer().set(HypixelCustomMobs.getPlugin().getUuid(), PersistentDataType.STRING, uuid.toString());
});

tender shard
#

what's type?

spare hazel
tender shard
#

what is the type of "type"?

spare hazel
#

String... maybe

tender shard
#

wait, spawnEntity doesn't even allow to use a consumer

lilac dagger
#

yeah because it returns entity

spare hazel
#

wtf should i do then

tender shard
#

you must use spawn(...)

#

not spawnEntity

spare hazel
#

oh my godddddd

#

wil it break anything?

lilac dagger
#

no

#

same thing

spare hazel
#

alr fixed

#

type is EntityType

#

but it getting a new error

lilac dagger
#

you need to use the class

tender shard
#

for the consumer to work, type has to be a class

lilac dagger
#

Creeper.class

#

for example

tender shard
#

you can do type.getEntityClass()

spare hazel
tender shard
#

yes

lilac dagger
#

yes but i'm pretty sure that gives you

#

Entity as return type

#

not sure it's the best

tender shard
#

it returns a Class<? extends Entity>, yeah

spare hazel
#

it didnt break anything

quaint mantle
#

Excuse me please, how to write on the forum?

tender shard
#

are you logged in?

quaint mantle
#

Yes

tender shard
#

do you want to reply to a thread or open a new one

quaint mantle
#

Open new

tender shard
#

first open the category you wanna post in, then click that button

quaint mantle
#

Thanks

tender shard
flint coyote
#

where can I vote?

tender shard
flint coyote
#

did my part

tame solar
#

Yo guys i have a question abt somethint

#

Something*

tender shard
#

?ask

undone axleBOT
#

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

rough ibex
#

ask

quaint mantle
#

Excuse me again please, but can I write something from the phone?

spare hazel
#
public void spawn(UUID spawner, Location location){
        this.spawner = spawner;

        LivingEntity mob = (LivingEntity) location.getWorld().spawn(location, type.getEntityClass(), false, (m) -> {
            m.getPersistentDataContainer().set(HypixelCustomMobs.getPlugin().getIsCustomKey(), PersistentDataType.INTEGER, 1);
            m.getPersistentDataContainer().set(HypixelCustomMobs.getPlugin().getUuid(), PersistentDataType.STRING, uuid.toString());

            m.setCustomName(name);
            m.setCustomNameVisible(true);
            ((LivingEntity) m).setMaxHealth(health);
            ((LivingEntity) m).setHealth(health);

            if(hasArmor) {
                ((LivingEntity) m).getEquipment().setBoots(boots);
                ((LivingEntity) m).getEquipment().setLeggings(leggings);
                ((LivingEntity) m).getEquipment().setChestplate(chestplate);
                ((LivingEntity) m).getEquipment().setHelmet(helmet);
                ((LivingEntity) m).getEquipment().setItemInMainHand(hand);
            }

            ((LivingEntity) m).getAttribute(Attribute.GENERIC_MOVEMENT_SPEED).setBaseValue(speed);
        });
        
        if(hasBossBar) {
            bossBar = Bukkit.createBossBar(name, BarColor.RED, BarStyle.SOLID);
            bossBar.setVisible(true);
            bossBar.setProgress(1.0);
            bossBar.addPlayer(Bukkit.getPlayer(spawner));
        }

        uuid = UUID.randomUUID();

        HypixelCustomMobs.getPlugin().getMobManager().addMob(uuid, this);
    }

heres the new version.

flint coyote
#

why shouldn't you be allowed to write from your phone?

quaint mantle
#

I can't find the button

flint coyote
#

Oh you mean on the forum

tame solar
#

Okay...
Can eco armour custom sets have custom models? So it doesnt look like leather? There is this one server and i was wondering if its possible to get the custom models

remote swallow
tender shard
remote swallow
#

are you actually on a forum pag

#

not just the secletion menu

tender shard
tame solar
quaint mantle
remote swallow
tender shard
tender shard
#
location.getWorld().spawn(location, (Class<? extends LivingEntity>) type.getEntityClass(), false, mob -> {
  // do stuff with mob
tender shard
tame solar
#

About specific plugin

#

Eco armours

tender shard
#

then you're on the wrong discord

tame solar
#

Oh

#

Where could i get the help then?

remote swallow
#

isnt that axillors plugin

tame solar
#

I think so

tender shard
spare hazel
tender shard
tender shard
mortal hare
remote swallow
tender shard
#

it always annoyed me that I had to write all my logic into a method to be able to do stuff before super

spare hazel
mortal hare
#

yea same, i always constructed private method that returns the same value

lilac dagger
#

that's amazing

tender shard
#

it does not "change accordingly", it's the exact same thing

orchid trout
#

can i set a javadoc location in fleet?

tender shard
spare hazel
tender shard
tender shard
spare hazel
#

ok

orchid trout
#

this?

mortal hare
#

Objects are passed by references not by value so it will stay in field you will add synced more to say

tender shard
#

that's how it works in IntelliJ

orchid trout
#

ok

tender shard
#

btw fleet sucks, why don't you just use IJ

mortal hare
#

objects in java are like pointers in c/cpp

#

they point to some data, not copy it the pointed data everytime you pass it

orchid trout
upper hazel
#

i made a server and i would like to make a simple chat, can i do it with intelji?:

orchid trout
#

i use eclipse normally

tender shard
#

fleet was pretty useless last time I tried it, but that was months ago

orchid trout
#

i like the ui

remote swallow
tender shard
#

intelliJ should be pretty resource-friendly if you disable the mcdev plugin

mortal hare
#

then send it via the server back

tender shard
#

what exactly are you trying to do?

upper hazel
#

client - server - client

mortal hare
upper hazel
#

just simple chat in intejli

#

undestad

tender shard
#

yes. Tools -> Code with me -> send someone invite link -> type random stuff in a random file, others can write back

#

very useful

#

??

remote swallow
#

you want to talk to people in intellji?

tender shard
#
  1. profit
orchid trout
flint coyote
tender shard
upper hazel
remote swallow
#

why

mortal hare
#

and inside that private method you use preconditions

#

and if it throws the constructor fails

flint coyote
#

oh yeah that's possible

mortal hare
#

but you need to create it for every single variable

#

and that really sucks

spare hazel
#

bossBar.setProgress(mob.getMaxHealth() / mob.getHealth());
will this show the mob's health on the bossbar?

upper hazel
#

I train to make all sorts of chat programs, etc., not in minecraft

upper hazel
#

I just liked the interaction between client and server

tender shard
# flint coyote wait you can do stuff before the super constructor? How? Init block?

naaah more like...

won't work:

    public static class MyClass {
        public MyClass(String name) {
            if(name == null) {
                throw new IllegalArgumentException();
            }
            super(name); // won't work
        }
    }

works:

    public static class MyClass {
        public MyClass(String name) {
            super(checkForNull(name)); // works
        }

        private static String checkForNull(String string) {
            if(string == null) {
                throw new IllegalArgumentException();
            }
            return string;
        }
    }

and yes, I know Objects.requireNonNull exists, it's just an example

mortal hare
#

yea that's what i do exactly

tender shard
#

yeah it's just so much more readable, e.g. imagine you got a List<String> and wanna map it to a List<EntityType> and are forced to do it directly in the super() call

#

it's so stupid that it's not possible to just do this normally

flint coyote
#

that's actually dumb, yes. Should just lead to a compile time error if you try to set/read variables inside the class (since those don't exist before super)

#

Everything else would work just fine as your workaround shows

upper hazel
#

why is it easier to write client-server interaction (not in minecraft) than writing plugins!?

tender shard
#

unfortunately I doubt it'll already be a normal feature in java 21

tender shard
upper hazel
#

I made this "chat" in 20 minutes wth

#

now it remains to make it multi-user

swift dew
#

is there any way to spawn baby skeletons?

#

this is a minecraft question idk if yhis is the right chat

tender shard
#

Baby skeletons dont exist

swift dew
#

ok ty

tender shard
#

I think zombies are the only monsters that can be babies

mortal hare
#

i can only imagine how annoying those would be

tender shard
#

Ikr

swift dew
#

ik

#

i was wondering about any nbt or packet stuff

remote swallow
mortal hare
#

baby zombies are annoying already imagine baby skeletons 😂

swift dew
#

that u can change the size

#

ik

mortal hare
tender shard
#

Only slimes have variable size

mortal hare
#

unless you wish to use resource packs

#

then you can apply custom model data as a nbt tag

#

to apply it to baby zombie and then code it to act like a skeleton

tender shard
#

Only for items

swift dew
#

nah ill find another way to do the thing i want

#

ty for da help btw

tender shard
#

Custom model data doesn’t exist for entities:')

mortal hare
#

that's an optifine feature

#

my bad

flint coyote
upper hazel
#

texture not exists for entity?

flint coyote
#

If you change the model of a mob it will be applied to all mobs of that type

#

So you can't have a blue and a red creeper

upper hazel
#

ah

#

i see

mortal hare
#

for items you can specify the id of entitymodeldata and it will apply the model that's mapped to the id inside the json file

upper hazel
mortal hare
#

previously before that people tend to use custom durability values that aren't accessible in vanilla to map to custom models (legacy versions from 1.9 iirc to up to 1.12)

upper hazel
#

for 1 for 2

flint coyote
#

No, not for entities

upper hazel
#

bad

#

this bad

flint coyote
#

You can change the appearance of a creeper but all creepers will look like that after it

#

That's probably one of the worst limitations mojang gave us

mortal hare
#

iron golems recently got an update

#

where he cracks

#

maybe there's some kind of mechanism that handles model and texture data

tender shard
#

how would that be possible without client mods?

mortal hare
#

according to the damage

tender shard
#

but there client doesn't care about that

flint coyote
#

Well the client reacts to the damage

#

But you can't use that for other mobs obviously

upper hazel
#

to be honest, the bukkit api is somehow not a fully functioning api. Many restrictions

mortal hare
#

honestly i'm surprised why they havent added entity model mapping alongside item mapping

flint coyote
#

You might be able to have custom iron golems based on the damage. That does entirely depend on how the cracks are loaded clientside. Whether the original texture changes or it's an entirely new texture

mortal hare
#

what do you expect from 12 year old community api

tender shard
#

wdym, it gets awesome new additions every other day

upper hazel
#

this math

remote swallow
#

what math

flint coyote
tender shard
#

yeah well that's their problem lol

#

complaining about missing features but refusing to update for 8 years

mortal hare
#

its amazing to think that people collaboratively developed an api for over a decade and continue to do so free of charge

flint coyote
#

exactly

upper hazel
#

many years have passed and until now it is impossible to get the biomes of the world directly

flint coyote
mortal hare
#

still

tender shard
#

oh that's deprecated

#

get the BiomeProvider, then get the biome from there

upper hazel
#

bukkit api in the field of generation locations and so on is so-so

flint coyote
#

Api support for custom pathfinders would be neat

tender shard
upper hazel
tender shard
upper hazel
#

yea

mortal hare
flint coyote
#

Just the basics like addGoal(Type.TARGET_ENTITY, EntityType.PLAYER) or something like that would be cool already

flint coyote
#

I'm aware there's libs. And I've also done it with nms. Having that in spigot would be cool though

upper hazel
tender shard
mortal hare
upper hazel
#

yea

mortal hare
#

why this class doesnt have any methods?

tender shard
#

no clue what you mean with "all locations in biome"

mortal hare
#

lombok?

tender shard
#

yeah lombok, shitty javadocs

mortal hare
#

nah

#

shitty lombok

tender shard
#

lombok is fine for many things

mortal hare
#

Generate getters and setters in IDEs exist

upper hazel
flint coyote
#

I did not know that lombok is not considered in javadocs

tender shard
mortal hare
#

also equals and compare

tender shard
mortal hare
#

i got rid of it because how pain in the ass is to setup it with libraries properly

tender shard
#

TL;DR you cannot get a list of all locations inside a biome because there are infinite locations between every 2 locations X and Y where X != Y

upper hazel
tender shard
flint coyote
tender shard
#

there is also no concept of "this is biome 1 and this is biome 2" if both are desert

#

the biome is also just like a noise map

tender shard
#

it's pretty fast though

upper hazel
#

Do you see any restrictions? Because of this, you have to suffer with the search for biomes for spawning structure

tender shard
upper hazel
#

in the field of generation, interaction with locations there are big restrictions

flint coyote
upper hazel
#

you can't even get vanilla structures

upper hazel
tender shard
upper hazel
#

not this

tender shard
upper hazel
#

Do you see any restrictions? Because of this, you have to suffer with the search for biomes for spawning structure - this

tender shard
#

oh btw you can get vanilla structures using AsyncStructureSpawnEvent

tender shard
flint coyote
#

How is that an async event? Isn't world generation sync?

flint coyote
#

Well on a new map you could keep track of the structures by listening to that event

tender shard
#

the structures are spawned in a future

upper hazel
#

I don't think it's vanilla
structure

#

this worldEdit

tender shard
#

no clue what you're talking about, that's the source code of craftbukkit

flint coyote
#

Also that is part of the api

tender shard
flint coyote
#

why is there a bracket in the middle of the parameters? lol

tender shard
flint coyote
#

oh lambda

tender shard
#

half life

#

gordon freeman

#

yk

flint coyote
#

true true

tender shard
#

have you played HL 1 and 2?

flint coyote
#

No I did not. I only know the memes

tender shard
#

sadge

#

great games

flint coyote
#

Especially HL3 confirmed?!

tender shard
#

i thought gaben cannot count to 3

#

they only do games until 2

flint coyote
#

Which is sad because I would love Portal 3

upper hazel
#

i not can search this asyncEvent

#

in internet

tender shard
upper hazel
#

I only see the worldedit website

lone jacinth
tender shard
#

you can enter things here ^

#

and then it shows results

upper hazel
#

oh now i see

flint coyote
#

I will keep that "can only count to two" meme in mind lmao

upper hazel
#

but I still think the bukkit api has more restrictions on working with locations

tender shard
#

and as fabsi mentioned, you can also locate structures easily from the World class

flint coyote
#

You are free to add features to the api

tender shard
#

If you have any suggestion, suggest it and someone might add it - or you do it yourself

upper hazel
#

as I said above, working with biomes

tender shard
#

I have already explained to you that it's not possible

#

let me explain. biomes work like this:

public static Biome getBiomeAt(int x, int z) {
  if(x % 3 == 0 && z % 4 == 0) return Biome.DESERT;
  // etc.
}

There is no list of biomes, and a biome doesn't have any boundaries - they are just the result of some random math

#

even if 2 adjacent blocks have the same biome, are they actually THE SAME biome? no, a biome doesn't have a start or end

upper hazel
#

oh

tender shard
#

that's just how world generation works in vanilla

flint coyote
#

Oh I didn't know that either. If it's just decided by modulo, how comes a biome is a large area and isn't totally mixed up?

austere cove
#

incorrect

tender shard
#

nah that was an example ofc

flint coyote
#

or was that an example?

#

Ah I see

tender shard
#

and the biome gets stored after it was generated

austere cove
#

the way mc is designed a chunk generator is supposed to announce what biomes it will generate

tender shard
#

yeah it gives a list of all "biomes I might create for this world"

#

but it's not possible to say "ok, there's a desert biome at 1,2,3 - now I want ALL blocks that belong to THIS desert"

#

there is no THIS desert, it's not like the world generator says "lets put a desert here, and a large one over there"

tender shard
austere cove
#

technically u can pull some veinminer shit and find all attached blocks with the same biome, but that would be a terrible idea performance wise

tender shard
austere cove
#

it's just one desert though, there's no such thing as two connected deserts

lone jacinth
#

Minecraft uses noise for Biomes (and for the rest of the world generation such as terrain)
A good video how Minecraft world generation works is this one:
https://youtu.be/CSa5O6knuwI

In the Caves & Cliffs update we radically changed Minecraft terrain generation, rewriting large parts of it from the ground up. This video summarizes how this actually works, how simple math and code can be used to generate interesting, beautiful, and dramatic terrain.

00:00 Intro
1:14 Size
3:11 Procedural terrain generation
8:47 Perlin noise
1...

▶ Play video
tender shard
#

the vanilla thing just generates a noise thingy, just like it does for mountains etc, and then says sth like "if val <= 0.1, it's desert, if <= 0.2, it's snow etc" Now it'll return 0.1 928571571 blocks away, is this now the same biome? People always think of a biome as "THIS biome" as in "THIS desert" but the vanilla way is just rolling a dice for every single block, more or less

lone jacinth
austere cove
#

iirc it's some combination of temperature/humidity/continentalness/erosion/weirdness

#

it actually makes sense and is kinda cool mathematically

tender shard
#

yeah something like that - what I just wanted to say is that, while biomes are generated, there's no way to differentiate between one desert and another

flint coyote
#

They did try to implement logic that certain biomes aren't next to each other though. So it's not completely random. For example you'll rarely find ice spikes next to a desert

#

(or maybe never, dunno how good their system works, it had issues in the past)

tender shard
#

yeah sure, but still there is no way to differentiate between "this biome X" and "another biome X" and also no way of knowing "how large a certain biome actually is" without manually checking all adjacent blocks

#

so it's not something that bukkit's API misses, but just how vanilla works

flint coyote
#

Maybe having an uninterrupted desert counting as a single desert is fine

tender shard
#

now what really truly sucks is the weird differentiation between bukkit and spigot-api

#

we add new things to bukkit all the time but sending action bar messages was moved to Player.spigot(), why lol

flint coyote
#

no clue lol

tender shard
#

idk why but I read that as "target_cactus cannot be empty"

upper hazel
#

SyncStructureEvent can work if i delete world end ganarate again?

tender shard
#

it gets called whenever a structure is generated

upper hazel
#

I initially thought that everything that was created by the player and not the world belongs to the structures

tender shard
#

structures are naturally generated things - villages, desert temples, ocean monuments, etc

upper hazel
#

Damn, what a cool thing turns out to be documentation. I have never heard of this on the internet.

#

gotta read it all

#

I had to create custom structures because of this

#

and the plugin started to cost a lot

tender shard
#

Greedy plugin

upper hazel
#

well, if you can’t get the location of the desired biome, how can you select it so that all the generation logic takes place there

tender shard
#

Math

upper hazel
#

eh?

tender shard
#

And a map that maps values to a biome

#

More or less

upper hazel
#

how undestand this?

remote swallow
#

understand what

upper hazel
#

And a map that maps values to a biome
More or less -

#

Are you talking about world generation?

#

psevdo

tender shard
#

there's a function that takes in something (for biomes that is a lot of different values created by noise like humidity, etc) and outputs something (the biome for exactly this input)

upper hazel
#

Roughly speaking, take the formula from the game responsible for the generation of biomes?

tender shard
#

that formula will help you not at all as you can already get the biome at a given location

upper hazel
#

I need to get a biome without a location, but I won't go through the for loop around the world lol)

lone jacinth
#

Codec is Mojang's library to serialize and deserialize objects, e.g. read custom biomes from datapacks. It does not have anything directly to do with world generation.

tender shard
#

simplified: there's a function that takes in x,y,z and outputs a biome for that

#

the world generator itself doesn't even know how large or small this biome is or going to be

#

it only calculates which biome a given location is that it was asked for

upper hazel
#

ok