#help-development

1 messages · Page 1221 of 1

chrome beacon
#

UUID is though

manic delta
# chrome beacon UUID is though

But what happens is that if by some mistake the villager disappears or is not saved, it can happen, that's why I was thinking of respawning the villager, at least I think Shoopkeepers does that.

chrome beacon
#

Are you trying to make the trades configurable in the config or smth

#

I still have no idea what exactly you're trying to do

valid burrow
valid burrow
#

and instead save locations and data in files

manic delta
#

just that

chrome beacon
#

Define a type of villager in the config and attach that type to the villager with PDC

#

on open you make sure it has the right trades

valid burrow
#

if you wanna respawn the villagers aftwr each restart what use is it to still acsess the old ones

#

kill the old ones onDisable

#

respawn them from data u have in files onEnable

chrome beacon
#

if you plan to do it that way

valid burrow
#

mhm

manic delta
valid burrow
#

but why would you

#

when theres so many better options

manic delta
#

like what

valid burrow
#

like what me and olivo just said

#

make the villigers not save/kill them on disable

manic delta
#

mmm

valid burrow
#

and on enable spawn them

chrome beacon
#

on chunk load* but ok

valid burrow
#

or well yh probably that but same thing either way

manic delta
#

ill try

#

tysm

#

oh yeah i dont need to save data

#

i can save it on the entity itself

#

i can modify the entity with a menu

torn shuttle
#

I love when restarting something just randomly fixes a bug

floral drum
#

real

torn shuttle
#

no clue why my command suggestions weren't working and now they are

misty ingot
#

inside my StringPrompt, i have a condition so that if the player enters the thing i dont want em to enter i player#sendMessage them a message telling them whats wrong so that next time they enter it correctly
but the message never shows in my chat

torn shuttle
#

classic pom

#

have 7 different projects using the same library

#

update the pom of them all

#

one of them randomly can't do it right

#

even though they're all using the same library, same version, same everything

wet breach
#

because you put them in a chat between the server and the player

#

its like moving them into another room

#

they are technically getting it btw

#

you just don't have the conversation factory set to allow showing chat

#

general chat that is

#

by default when you initiate a conversation it is hidden, but still receiving it and when they exit conversation you should go back to see the chat including what was missed

wet breach
#

as you can see from this method, the default is true for it

#

so you need call this from the factory method and set it to false

misty ingot
#

i see, thank

#

i didnt even think to look at conversationfactory

#

i was trying to find it for conversation

wet breach
#

the infamous repo I use for demonstrations uses it btw

misty ingot
#

first time using it, i like it

#

very useful

wet breach
#

think its been there since like 1.2 or 1.3

#

and still many people don't know about it =/

#

so not only is it one of the oldest, but also the most under utilized or used in general lol

#

as you can see from the link above

#

I provide a way for the person to escape the conversation

#

in case they don't want to continue or something happens etc

#

well the api provides it, just I usually set it

#

let me know if you need more help or need something explained 🙂

misty ingot
#

currently writing code to save and load schematic files, so i can save the selected arena and load it into as many instances as needed

#

if i run into a roadblock ill ask

wet breach
#

in case you need it

#

lets you manipulate NBT without having to use NMS for it

#

I am not the original author fyi, however I maintain a fork of it

misty ingot
#

i dont think ill need that
im just saving and loading schematics with worldedit

wet breach
#

well never know, I even have a color compressor too doubt you will find that useful at all

misty ingot
#

ill keep it in mind

#

but id be surprised if i end up needing it

wet breach
#

the color compressor, good example in how to use bitshifting

thorn crypt
#

Hey, is it possible using protocolLib to catch when a specific plugin send a message to a player or no ?

warm mica
wet breach
thorn crypt
#

For exemple to translate plugin’s messages

wet breach
#

when a plugin sends a player a chat message, it comes from the server so packet wise there isn't like information embedded in such a packet. You would have to intercept before it reached the network layer. If instead you are referring to plugin messaging then yes

#

there is even api for it

#
smoky oak
#

is it possible to change the armor visible on a player without using protocol nonsense?

upper hazel
#

guys i think obaut smth

#

how you think use proxy in bukkit pointless?

#

minecraft itself is resource intensive with its single-threaded nature.

#

if i will add proxy this will do more harm than good.

#

how you think?

echo basalt
#

???

blazing ocean
#

^

echo basalt
#

A proxy server runs independently of bukkit

#

It can be written from the ground up to leverage more threads

upper hazel
#

i say obaut proxy class generation

echo basalt
#

And acts as a protocol relay

#

why would you use proxy classes?

upper hazel
#

and JPA

echo basalt
#

Sounds like your ambition is bigger than your knowledge & skill

upper hazel
#

maybe

#

i know how create proxy but

#

how i was say this be more harm then good

#

but idk

#

how you think?

echo basalt
#

KISS

#

keep it stupid simple

upper hazel
#

uh?

#

ok

#

i bad undestand english slangs

blazing ocean
#

it's not slang-

upper hazel
#

thenks to chat gpt

#

i was think he just say "kiss"

eternal oxide
upper hazel
#

alr

#

i think create DI not be very hard

#

but how do this without proxy...

misty ingot
#
        Region arenaRegion = data.getArenaRegion();
        BlockArrayClipboard arenaClipboard = new BlockArrayClipboard(arenaRegion);
        arenaClipboard.setOrigin(arenaRegion.getCenter().toBlockPoint());

        File arenaRegionFile = new File(plugin.getDataFolder(), "schematics/arena_"+data.getArenaID()+"_region.schem");
        try {
            arenaRegionFile.createNewFile();
        } catch (IOException e) {
            throw new RuntimeException(e);
        }
        try (ClipboardWriter writer = BuiltInClipboardFormat.SPONGE_V3_SCHEMATIC.getWriter(new FileOutputStream(arenaRegionFile))) {
            writer.write(arenaClipboard);
        }

i am using FAWE
arenaRegion is not null, it is a selection of basically a square of blocks

when i load the schematic it is saving, no blocks show up
nothing in console

#
                    com.sk89q.worldedit.entity.Player actor = BukkitAdapter.adapt(player);
                    LocalSession localSession = plugin.sessionManager.get(actor);
                    Region arenaRegion;
                    World selectionWorld = localSession.getSelectionWorld();
                    try {
                        if (selectionWorld == null) throw new IncompleteRegionException();
                        arenaRegion = localSession.getSelection(selectionWorld);
                    } catch (IncompleteRegionException e) {

this is how im getting region

blazing ocean
cold hinge
#

Hey i have some errors i cant use bungeecord chatcolro or TextComponent/ComponentBuilder do anyone have a fix for that?
Coding on Spigot 1.21.3 it says "The type net.md_5.bungee.api.ChatColor is not accessible"

smoky oak
#

sounds like youre missing a depend

blazing ocean
#

bungee chat is in the api

smoky oak
#

? how the fuck

#

whats your pom

#

wait no then the rest wouldnt work either

cold hinge
#

the code is running perfectly and i can use everything from spigot only BungeeCord Doesnt Work! for weird reason even i have this spigot version too! Spigot/Spigot-API/target/spigot-api-1.21.3-R0.1-SNAPSHOT-shaded.jar

misty ingot
blazing ocean
#

show how

misty ingot
#

well i tried by copying saved schem file and using //schem command, that didnt work either btw

heres the code for pasting

 File arenaRegionFile = new File(plugin.getDataFolder(), "schematics/arena_"+arenaId+"_region.schem");
        if (!arenaRegionFile.exists()) {
            return -1;
        };

        int gameId = registerNewGameId();

        Clipboard clipboard;
        ClipboardFormat format = ClipboardFormats.findByFile(arenaRegionFile);
        try (ClipboardReader reader = format.getReader(new FileInputStream(arenaRegionFile))) {
            clipboard = reader.read();
        } catch (IOException e) {
            throw new RuntimeException(e);
        }

        // create a new world, with void
        World createdWorld = new WorldCreator("arena_"+arenaId+"_game_"+gameId).generator(new VoidChunkGenerator()).createWorld();
        com.sk89q.worldedit.world.World arenaWorld = BukkitAdapter.adapt(createdWorld);

        // paste the schematic into the world
        try(EditSession editSession = WorldEdit.getInstance().newEditSession(arenaWorld)) {
            Operation operation = new ClipboardHolder(clipboard)
                    .createPaste(editSession)
                    .to(BlockVector3.at(0,64,0))
                    .ignoreAirBlocks(true)
                    .copyBiomes(false)
                    .copyEntities(false)
                    .build();
            Operations.complete(operation);
            log("pasted schematic");
        }
blazing ocean
#

You may also have to make an FEC

misty ingot
#

whats FEC

#

i really cant figure out whats wrong here, i copied the docs almost letter for letter

blazing ocean
#

forwardextentcopy

misty ingot
#

so you're telling me i cant just give Region to a diff class so it can do what it wants with it

blazing ocean
#

the WE API is a fucking shitshow ¯_(ツ)_/¯

#

just ask the WE people

misty ingot
#

well every time i ask in their discord i get a reply exactly never

#

so i just dont bother anymore

blazing ocean
#

If the people maintaining it don't know, what do you expect from us lol

misty ingot
#

i am sad

blazing ocean
#

just bump your question and hope for a reply

misty ingot
#

ill just read FEC docs and go FUC myself

#

it works!

#

and my relative spawn position system also sent me to the correct team spawn definitely on the first try

golden turret
#

what is the most efficient way to set the biome of the whole world? it is for a skyblock system

blazing ocean
#

For a whole world whilst it is loaded? probably no good way, but you can do it for a large area with something like worldedit

remote swallow
#

i mean

#

id just generate it with it

blazing ocean
#

if it's not loaded, you could just edit the region files

remote swallow
#
public class SingleBiomeProvider extends BiomeProvider {
    private final Biome biome;

    public SingleBiomeProvider(Biome biome) {
        this.biome = biome;
    }

    @Override
    public Biome getBiome(WorldInfo worldInfo, int x, int y, int z) {
        return biome;
    }

    @Override
    public List<Biome> getBiomes(WorldInfo worldInfo) {
        return Collections.singletonList(biome);
    }

}
blazing ocean
#

Generate it with a biome provider yea ^

golden turret
#

i already have it

#

but

#

the player can change the biome while on the island

remote swallow
#

set the biome of the chunks they can access

misty ingot
#

im assuming your skyblock world isnt infinite and has a world border, so yeah just set the biome for all the possible chunks

#

of if you are open to a slightly less efficient solution, just change the biome of all the chunks around a player while they are on their island to the biome they have selected

deep herald
#

how do i convert ticks to milliseconds then to seconds again? meaning 9 ticks is 0.45

#

and stuff like that

eternal night
#

9*1/20

deep herald
#

i wanna do it for an item cooldown

eternal night
#

N*1/20

deep herald
#

i was gonna do 1000 / N / 20

eternal night
#

Well no idea what N is for you. Convert to MS then to S?

#

That's not one equation

deep herald
#

10 ticks to seconds with the milliseconds

#

(0.5s)

eternal night
#

Yes. N=10. N/20

#

10/20=0.5

deep herald
#

oh wait

#

its rounding

eternal night
#

In java, make sure to mark 20 as a double literal

#

So, 20d

#

To do floating point division instead of integer division

deep herald
eternal night
#

Yea

deep herald
#

W thanks

orchid furnace
#

What would be the best way to wait?

worldly ice
#

?scheduling

undone axleBOT
blazing ocean
torn bough
#

What values can I set on a dolphin to make it so it doesn't need to come up for air (never need to breathe)

remote swallow
smoky oak
manic delta
#

Why

System.out.println("Trading with "+recipe.getIngredients().get(0).getType() +(recipe.getIngredients().size()>1 ? " and a "+ recipe.getIngredients().get(1).getType(): "") + " ingredients will result in a "+recipe.getResult().getType());

shows the villager trade result as AIR?

remote swallow
smoky oak
#

ha fair lol

torn shuttle
#

I hate maven

smoky oak
#

y

torn shuttle
#

it's a bad system made by bad people

#

it's bad on purpose, specifically to spite me

#

one day I will lose it and make my own maven

#

with blackjack, and hookers

smoky oak
#

with enough plugins in <build> you can

torn shuttle
#

and a shading strategy that can actually handle multiple shaded projects containing different versions of the same library

smoky oak
manic delta
#

the problem is with the entity

#

im making a villager editor and it shows the result as AIR

#

for some reason

bronze laurel
#

How would I make a players name bold with scoreboard teams?

smoky oak
#

if you dont need the villager data, then have it one-way; serialize and store the GUI somehow

echo basalt
#

what if you made the editor in the villager's own ui but use the player's inv for controls

smoky anchor
#

implements InventoryHolder
Hell no

#

?gui

manic delta
#

ill use that later but

#

how can i fix my problem

smoky anchor
#

I'll do one more annoying nitpick
color("#FFA500")
You could just use Color.fromRGB(0xFFA500)
And I believe you can return the switch itself.

manic delta
#

yea

#

thank you

echo basalt
#

I wonder if holding the player is going to cause a nasty leak đŸ€”

#

also

#

?paste

undone axleBOT
manic delta
manic delta
manic delta
smoky anchor
#

Hmmm
I can't see you doing anything wrong from this
You could try to create a minimal plugin to test this and if it does not work then report it as a bug
Not sure how Spigot deals with bugs that are not on latest version tho

regal oracle
#

Hey there i purchased 2 plugins and didnt received them, it still gives me the Buy option, and ppl on their discord that i asked, said they had to wait months till they received anything

calm lark
#

Hi, i need help me finish my projet plugin Minecraft conect game in the chat tiktok live

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!

pliant topaz
regal oracle
#

@pliant topaz i did

torn bough
remote swallow
#

could try -1 or int limit

#

they would need to live for 1,243 real life days before they have to get air

torn bough
#

What if that's not enough :(((

#

Okay thank you though I'm going to try -1 right now

#

What's the method for when a name tag gets added to a mob?

nova notch
sullen marlin
#

Even if the dolphin was at spawn and someone was always online at spawn that would still take 3 years

rough ibex
rotund ravine
#

Totally just check every 1 second and reapply it for 3 seconds đŸ‘ŒđŸ»đŸ€ź

proud badge
#

dk the exact name

#

maybe entityinteractevent or playerinteractevent

torn bough
#

I thought there would be a OnEntityNameChange or something as there are similar commands to other interactions

#

I ended up having to use PlayerInteractEntity and just check if player was holding a name tag, then if name tag had a display name which felt weird

quaint mantle
#

It isn't doing it for whatever reason

chrome beacon
#

Also you shouldn't be spawning the armor stand in the constructor like that

quaint mantle
#

Oh?

#

Will give this a try

chrome beacon
#

Still not using the spawn method consumer

quaint mantle
#

How am I supposed to do it?

chrome beacon
#

Pass a consumer to the spawn method

#

and modify the entity there

misty ingot
#

is there a way to save worlds in a custom folder instead of the server's root directory?

#

my plugin creates instances of game arenas and if someone has a lot of games going on all the world folders might spam the root directory and maybe even cause confusion

eternal oxide
#

name teh world including a path

misty ingot
#

i zee

vital void
#

java.lang.NoClassDefFoundError: net/minecraft/network/FriendlyByteBuf

#

any ideas?

mortal hare
#

you've probably used mojang mappings based build on a build which uses old spigot mappings

vital void
#

its 1.19.4 paper

#

and the server is 1.19.4 paper

#

double checked

mortal hare
#

since 1.16 iirc, both spigot and paper switched to use mojang mappings and then at runtime servers will recompile those plugins to obfuscated mappings iirc

mortal hare
vital void
#

yes

#

using friendlybytebuf

mortal hare
#

do you use paperweight gradle plugin

vital void
#

i use maven

#

its done on intellij thru paper if you know what i mean

#

this has worked before, indentical version, indentical code

mortal hare
#

i use gradle all the time so i cant really help, but im like 99% sure it due to faulty mappings

#

do you run reobfJar task or smth like that on maven

vital void
#

nah

mortal hare
#

how do you compile your plugin

vital void
#

with maven

mortal hare
#

yeah, but with what task/runner

vital void
#

clean package

mortal hare
#

in gradlew you would use ./gradlew reobfJar to build the plugin with reobfuscated mappings

mortal hare
vital void
#

yes

mortal hare
#

which one do you use

vital void
#

ares
ares-orignal

#

i use ares

mortal hare
#

have you tried running the second one?

vital void
#

no but i will rn

#

same thing

#

@mortal hare

mortal hare
#

in either case server should reobfuscate the plugin at runtime, but im not too sure

#

i haven't touched plugin development in like 1,5 year now

#

can't really help more soz

#

try asking in paper's discord

#

because im 99% you will get

#

?whereami

merry cove
#

Is there an easier way to add newer materials with an older API version without having to do multi modular projects?

young knoll
#

XMaterial

remote swallow
#

Or update

tight compass
#

How fast is pdc?

eternal oxide
#

2

young knoll
#

Yeah I’d say at least 2

tight compass
#

ah peak

#

I'd imagine it's not super fast, with all the hashing

young knoll
#

Hashing?

mortal hare
blazing ocean
#

PDC is just an NBT wrapper

tight compass
#

Dont you have to hash the namespacedkey's string each time you access values in it

mortal hare
#

i've never realised that this such debated topic

tight compass
mortal hare
#

its like tabs vs spaces

young knoll
#

I mean hashing is pretty quick

#

It’s just maffs

#

I believe the bigger overhead would be deserializing/serializing the values

tight compass
#

I mean, alright

upper hazel
#

and i getting java.lang.ArrayIndexOutOfBoundsException

#

in here

#

java.lang.IndexOutOfBoundsException : Invalid array range: 0 to 0...

mortal hare
#

probs because new string[0] {} is legal if i had to guess? (highly unlikely)

tight compass
# tight compass I mean, alright

I'm just trying to do custom enchants, this just seems weird to do:

(How they're stored in pdc)

enchantments: {
  entity_damage_by_entity: {
    ench_0: 1,
    ench_1: 2
  }
}
var events = pdc.get(EnchantmentManager.FRACTURED_ENCHANTMENTS, PersistentDataType.TAG_CONTAINER);
var enchantHandler = events.get(ENTITY_DAMAGE_BY_ENTITY_EVENT, PersistentDataType.TAG_CONTAINER);

if (enchantHandler != null)
{

  for (NamespacedKey key : enchantHandler.getKeys())
  {
    CustomEnchantment.getByKey(key).invoke(event, pdc.get(key, PersistentDataType.INTEGER));
  }
}
young knoll
#

I wouldn’t store them by events

upper hazel
#

compiler say ars[] not can be null

tight compass
young knoll
#

I would probably just pass all events to the enchantment and only act on the ones that are relevant

upper hazel
# tight compass What's the showHelp method do

private void showHelp(CommandSender sender) {
sender.sendMessage(ChatColor.GOLD + this.plugin.getDescription().getName() + ChatColor.RED + " v" +
this.plugin.getDescription().getVersion() + ChatColor.GOLD + " by " + ChatColor.DARK_PURPLE +
this.plugin.getDescription().getAuthors().get(0));
sender.sendMessage("");
sender.sendMessage("§6/joinmanager reload - ĐżĐ”Ń€Đ”Đ·Đ°ĐłŃ€ŃƒĐ·ĐžŃ‚ŃŒ ĐșĐŸĐœŃ„ĐžĐłĐž.");
sender.sendMessage("§6/joinmanager clear <ĐœĐžĐș> - ĐŸŃ‡ĐžŃŃ‚ĐžŃ‚ŃŒ ĐžĐłŃ€ĐŸĐșу ĐČсД ŃĐŸĐŸĐ±Ń‰Đ”ĐœĐžŃ.");
}

tight compass
tight compass
young knoll
#

You can do the same if you just pass the event to all enchantments

#

And let them decide if they want to handle it

tight compass
#

Lol, and do what check if the event is instanceof whatever it needs?

#

That's shit

young knoll
#

That’s one option

#

Or use a map of event -> consumer

tight compass
#

I mean I guess it would work

#

What do you mean?

quaint mantle
tight compass
#

Is it on the line you have highlighted?

#

Are you sure

#

Also, people really should look into making their onCommand methods static. Why use an object, I don't get it

upper hazel
#

in getAuthor line

tight compass
#

womp womp

upper hazel
#

I've been sitting at my computer for six hours and I'm starting to get confused.

tight compass
#

I thought you fixed it

upper hazel
#

yea

tight compass
#

oh, okay

upper hazel
#

but anyway i getting many money:)

tired juniper
#

how i can make a groups in essentialX and connect them to luckPerms

#

?

misty ingot
#

is there a way to make it so the player can see only the chunk that they are currently in?

mortal hare
remote swallow
#

why do you want groups in essentials

misty ingot
#

anyway um what i actually wanna do is

how can i only render the chunks that I want to on the client's side?

like if i want the player to only see chunk 0,0 and 1,1 then thats the only ones that will load for the player

tired juniper
#

i want to make a spawn for each group like for red group spawn and for blue group spawn using essentialsX spawn but i cant really make a groups idk why

remote swallow
#

use luckperms for groups and ess probably provides a way to set a permission for spawns

#

bc afaik essx doesnt have a way to create groups inside of it

tired juniper
#

oh i installed vault and it works

#

omg

wet breach
#

as for groups, the most it has is to handle the default permission levels the server can use

misty ingot
#

hey i am attempting to use NMS with ProtocolLib to manipulate chunk packets

        <dependency>
            <groupId>org.spigotmc</groupId>
            <artifactId>spigot-api</artifactId>
            <version>1.21.4-R0.1-SNAPSHOT</version>
            <scope>provided</scope>
        </dependency>
        <dependency>
            <groupId>com.comphenix.protocol</groupId>
            <artifactId>ProtocolLib</artifactId>
            <version>4.8.0</version>
            <scope>provided</scope>
        </dependency>
        <dependency>
            <groupId>org.spigotmc</groupId>
            <artifactId>spigot</artifactId>
            <version>1.21.4-R0.1-SNAPSHOT</version>
            <scope>provided</scope>
        </dependency>

this is my dependencies but I cant use stuff like LevelChunk and i cant figure out what i did wrong exactly

wet breach
#

so permissions are setup according to these groups if I am not mistaken

#

but otherwise you need a permissions plugin

remote swallow
#

and you dont need the api dep if you have the non api one

blazing ocean
#

also, don't depend on the api and server

#

smh ebic

misty ingot
#

?contribute

tight compass
#

What's the problem with inheriting ItemStack?

echo basalt
#

icky

#

and something that should never be done

#

because bukkit isn't made for that

grim hound
#

how can I rotate a block display of any known transformation, by let's say 90 degrees yaw?

eternal oxide
#

a block display is still an entity so rotate it

grim hound
eternal oxide
#

the entities direction

grim hound
#

will test that out

eternal oxide
#

you can get its pitch/yaw from its Location Object. then setRotation for your new values using rotateAroundY

grim hound
#

ah the angle is in radians

#

okay, besides that

eternal oxide
#

no need to set it to the location as that is a clone. just use the dir you alreay modified

#

other than that, yes

grim hound
eternal oxide
#

just Math.toRadians

#

actuallyu no

#

not even that

#

the vector is all you need

#

loc.getDirection().rotateAroundY(Math.otRadians(90))

#

I think it uses radians

eternal night
#

Yea pretty certain that should use a sane unit

eternal oxide
#

yep its just angle

grim hound
eternal oxide
#

its radians

grim hound
#

ye

#

I'll let you know how it goes

#

also, lynx

#

you can use here setThreadFactory(new io.netty.util.concurrent.DefaultThreadFactory("the whatever netty name"))

eternal night
#

hm?

#

our diff doesn't touch that so we didn't change that xD

grim hound
#

tell what/who diff is?

#

I seem to be lost

river oracle
#

John Diff

eternal night
#

the setNameFormat thing is mojang code

#

we only add the warning handler

#

so we don't touch mojang code for no reason

grim hound
#

doesn't change much besides that

grim hound
#

is there something I'm not noticing?

#

the entity doesn't rotate

eternal oxide
#

you are rotating around yaw of 0

grim hound
grim hound
#

the entity will rotate around its actual location

#

and not middle of its rendered location

eternal oxide
#

yes, do the rotation before you do a transformation

grim hound
#

okay, will try that

eternal oxide
#

The transformation shifts it from its origin, but its still AT its origin

grim hound
#

nothing changed

grim hound
grim hound
#

15 & 135

grim hound
eternal oxide
#

why can;t you use teh rotation of the transformation then?

grim hound
eternal oxide
#

transformation.getRightRotation().rotateY(rotation)

grim hound
eternal oxide
#

Transformations are in object space

grim hound
#

oh that works

#

thanks!

#

would the leftRotation be inaccurate cuz it's before scaling?

eternal oxide
#

no it shoudl also work

#

but safest to do after as all other translations are done

grim hound
#

is rotateX(pitch) correct?

#

(in radians ofc)

eternal oxide
#

no

#

depends on the Y rotation

#

it's x/z for pitch

grim hound
#

isn't Z for roll?

eternal oxide
#

no, it all depends on the other rotations

smoky oak
#

is there a way to suppress the x joined server message that aint protocolib block packet?

eternal oxide
#

In object space if you rotate x then z, then y, it will give a different orientation if you do y, x,z

#

Which is why it uses Quats

grim hound
smoky oak
#

huh

#

guess that works lol

worthy yarrow
#

Sometimes params are nullable :p

grim hound
#

since well

#

it messes up their actual locations

#

ah nvm

#

I had the scale set too big

smoky oak
#

how do i verify if i found a bug in the world gen?

mellow edge
#

does Player#hidePlayer only apply for a single world or does it apply for all the worlds on the server (meaning if I go to nether and back will another player see me)?

blazing ocean
#

all worlds

mellow edge
#

good

river oracle
smoky oak
# river oracle Try and reproduce it

i have a seed, a set of coordinates, and this screenshot. what i want to know is if a stronghold generating without libraries is a bug in the first place lol

slender elbow
#

probably not? stronghold generation is really scuffed

#

(on purpose)

#

according to the wiki there can be anywhere between 0 to 2 libraries per stronghold

eternal night
#

how many chest corridors can their be emily

smoky oak
slender elbow
#

how lucky

unique sparrow
#

Guys how can i fix it

#

I think im cooked

eternal night
#

Make sure you are using java 21

#

and like, your build.gradle.kts or pom.xml is fine

unique sparrow
#

im using maven

blazing ocean
#

?paste your whole pom.xml

undone axleBOT
unique sparrow
#

i dont have a org

unique sparrow
blazing ocean
#

now press the save button and send the url here

unique sparrow
blazing ocean
#

did you hit the refresh maven button

unique sparrow
blazing ocean
#

Yeah there's a refresh button in there

unique sparrow
#

what now

#

btw, i think im cooked

blazing ocean
#

reload all

blazing ocean
unique sparrow
#

My antivirus deleted extra libraries

#

BitDefender

nova notch
mortal hare
#

best shortcuts in intellij
ALT+INSERT
ALT+ENTER
CTRL+ALT+L

#

i've actually ditched lombok from my project due to how good code generation in intellij is

eternal night
mortal hare
#

i've edited on code gen template so that it makes record style getters for me

#

blends with records well

remote swallow
#

fluent getters?

mortal hare
#

kinda, but without return this

#

i call fluent getters, getters which return itself

#

so idk

#

i mean setters not getters

remote swallow
#

ah setters

rough drift
#

builder pattern in a nutshell

mortal hare
#
public void foo(Foo foo) {
  this.foo = foo;
}

public Foo foo() {
  return this.foo;
}

i made a template which generates getters/setters like this

#

kinda kotlin style if we dont take into account operator overloads there

little copper
#

Hello everyone, I have a question regarding a problem I had while trying to code my Minecraft plugin. I wanted to create a craft that allowed me to have the head of a player named "luck" but when I imported my plugin, the craft gave me the head of Alex. Can you help me resolve this problem please?

mortal hare
#

the problem you were probably having is that you havent applied the skull metadata properly

quaint mantle
#

When creating a kotlin project intellij directly creates a file at src/main/kotlin. My question if is a good pratice to go directly there or like create your artifacts folders

blazing ocean
#

What

mortal hare
#

stupid generics with its type erasure, i've setup my class structure that works perfectly fine and compiles, but then due to type erasure Jackson cannot get all the fields through reflections

#

now i need to rollback all the changes

#

nice

remote swallow
#

you can technically handle the type erasure

mortal hare
#

technically i can just make a concrete type

#

but i have nested inheritance of generic types

#

so it would be quite pain to set up

quaint mantle
blazing ocean
#

You could roll your own type tokens I guess

little copper
mortal hare
#

fuck it, im just going to use @JsonIgnore to hide user password from serialization. its just that i wanted to return User<UserCredentials> object when i login which doenst provide a method to get the password via user.details().credentials().password()

blazing ocean
#

Why not just use GSON with their type tokens

mortal hare
#

because this is a shitty spring boot project

blazing ocean
#

Do they have their own serialisation or what

mortal hare
#

they use Jackson library to do that

#

but add like container beans and stuff like that on top of that

#

so you dont have to pass instances manually

#

it uses the power of R E F L E C T I O N S

mortal hare
#

you need to apply UserProfile

#

to the skull itemmeta

#

SkullMeta meta = (SkullMeta) itemStack.getItemMeta()

echo basalt
#

reflection đŸ€ź

#

half the times I use it are for injecting fucky shit into jar files that aren't mine

mortal hare
#

meta.setOwningPlayer(Bukkit.getOfflinePlayer("user"))

#

itemStack.setItemMeta(meta);

#

something like this should work

#

could not work tho as i havent used bukkit api in ages

#

so i dont remember exactly

echo basalt
#

getOfflinePlayer can cause mojang requests and block the main thread

#

L noob

mellow snow
#

I need to block all the villagers trades that give players emeralds

sullen marlin
#

Go to javadocs and search for trade

#

?jd-s

undone axleBOT
mellow snow
# sullen marlin Go to javadocs and search for trade

I try something like this

@EventHandler(priority = EventPriority.HIGH)
public void onVillagerAcquireTrade(VillagerAcquireTradeEvent event) {
// Controlliamo la ricetta del commercio
ItemStack[] sellItems = event.getRecipe().getSell();
for (ItemStack item : sellItems) {
if (item != null && item.getType() == Material.EMERALD) {

            event.setCancelled(true);
            Player player = event.getEntity().getWorld().getPlayers().get(0); 
            player.sendMessage("I villager non possono darti smeraldi!");
            return;
        }
    }
}
worldly ingot
#

e.g. they've leveled up and got a new trade

#

So that event won't encompass the villager's base trades

mellow snow
#

I have problem with reading java docs

worldly ingot
#

The Villager object has a way to get/set its recipes, so you'd have to get a Villager somehow (probably in a player interact event) then update trades there

echo basalt
#

when I can just extend their classes and inject them in

blazing ocean
#

Mixins :)

echo basalt
#

sometimes these need to be public n shit

#

y'know

blazing ocean
#

Imagine having public projects

echo basalt
#

custom CraftCommandMap / CraftScheduler

blazing ocean
#

Literally could not be me

echo basalt
#

sometimes you use bytebuddy and make your own "mixins"

mellow snow
# worldly ingot The Villager object has a way to get/set its recipes, so you'd have to get a Vil...

Ok, I do this, but now I can't even open the trades gui

`java

@EventHandler(priority = EventPriority.HIGH)
public void onPlayerInteractWithVillager(PlayerInteractEntityEvent event) {
    if (event.getRightClicked() instanceof Villager) {
        Player player = event.getPlayer();
        Villager villager = (Villager) event.getRightClicked();

        // Otteniamo le ricette del villager
        for (MerchantRecipe recipe : villager.getRecipes()) {
            // Controlliamo se uno degli oggetti venduti Ăš uno smeraldo
            ItemStack sellItem = recipe.getResult();
            if (sellItem != null && sellItem.getType() == Material.EMERALD) {
                // Se il villager sta cercando di vendere uno smeraldo, annulliamo l'interazione
                event.setCancelled(true);
                player.closeInventory(); // Chiudi la GUI
                player.sendMessage("Errore: i villager non possono darti smeraldi!");
                return;
            }
        }
    }
}`
worldly ingot
#

Yeah cause you don't want to cancel and close it, you want to remove the recipes

mellow snow
worldly ingot
#

Cancelled how? You want the trades to still exist in the villager UI, but you don't want the player to be able to use the trade?

mellow snow
#

ok

#

I'm stupid, I fix this

#

sorry

worldly ingot
#

Well, no, I'm asking a question 😅 It's okay

#

I just don't know what your end goal is

mellow snow
#

thanks for the help

worldly ingot
#

That you can cancel and it won't let the player select the trade

#

MerchantRecipe recipe = event.getMerchant().getRecipe(event.getIndex());
That will get you the recipe that was selected, you can check for emeralds there

mellow snow
#

thanks, do you have a tutorial for read in a easyest way the javadocs

#

I really have difficult understading it

worldly ingot
#

The search bar in the top right goes a long way. You could search for whatever you need (in this case I just searched for "trade event" and it listed 3 different events). Then it's just a matter of reading what the documentation says about that type

#

If English isn't your first language, that might be more difficult, but that's why you can always ask questions here 🙂

mellow snow
#

But my problem it's not reading english

#

I'm not good at writing but I know how to read it, I have understand problem with something like this

worldly ingot
#

What about it is confusing?

mellow snow
#

I understand that "getMerchant()" returns me the merchant, but sometimes I don't know how to create a entire string with this

worldly ingot
#

So you wouldn't know how to go from getMerchant() to something like event.getMerchant().getRecipe(event.getIndex())?

#

The return type in the Javadoc is clickable, so if you're unsure what all is part of Merchant, you can click it to open its page which will show you all of its methods. Or you can open your IDE, write event.getMerchant(). and see what your IDE suggests. It will show you all the methods available, and getRecipe() would have showed up (though maybe overwhelming because it also includes all the methods from its parent types, like Entity, LivingEntity, etc.)

#

But if I click on the Merchant Javadoc page, this top area gives me a good idea of what all is available to me

mellow snow
worldly ingot
#

It will take some getting used to, but you'll get there :) Super handy once you know how to navigate them

mellow snow
#

This is my code now, but I have some problems that Idk how to fix

  • When I click in the first slot of the trades with emeralds, even if the item that villager gives me isn't a emerald the plugin close the gui.
  • When I select the trade from the left side list the plugin don't "see" this action

@EventHandler
public void onInventoryClick(InventoryClickEvent event) {
// Verifica che chi ha cliccato sia un giocatore e che l'inventario sia quello di un villager
if (event.getWhoClicked() instanceof Player && event.getInventory().getHolder() instanceof Villager) {
Player player = (Player) event.getWhoClicked();
Villager villager = (Villager) event.getInventory().getHolder();

        // Verifica che non si tratti di uno spazio vuoto
        if (event.getCurrentItem() != null && event.getCurrentItem().getType() != Material.AIR) {
            int slot = event.getSlot();

            // Verifica che l'indice del commercio sia valido
            if (slot < 0 || slot >= villager.getRecipes().size()) {
                return; // Se l'indice non Ăš valido, non fare nulla
            }

            // Ottieni la ricetta del commercio selezionato
            MerchantRecipe selectedRecipe = villager.getRecipes().get(slot);

            // Verifica se il commercio implica uno smeraldo come risultato
            if (selectedRecipe != null && selectedRecipe.getResult().getType() == Material.EMERALD) {
                // Se il commercio contiene smeraldi, blocca l'evento
                event.setCancelled(true);

                // Chiudi l'inventario e mostra un messaggio di errore
                player.closeInventory();
                player.sendMessage("Errore: Non puoi commerciare smeraldi con i villager!");
            }
        }
    }
}
worldly ingot
#

For your second point, that's where the TradeSelectEvent would come in handy

@EventHandler
private void onSelectTrade(TradeSelectEvent event) {
    MerchantRecipe recipe = event.getMerchant().getRecipe(event.getIndex());
    if (recipe != null && recipe.getResult().getType() == Material.EMERALD()) {
        event.setCancelled(true);
    }
}
#

To be fair, that's probably all you need. I'm not sure if the InventoryClickEvent you sent is necessary

mellow snow
#

only this

worldly ingot
#

I suppose you could do this as well. This might work?

@Override
private void onReceiveEmeralds(InventoryClickEvent event) {
    Inventory inventory = event.getClickedInventory();
    if (inventory == null || inventory.getType() != InventoryType.MERCHANT) {
        return;
    }

    ItemStack itemStack = event.getCurrentItem();
    if (itemStack == null || itemStack.getType() != Material.EMERALD) {
        return;
    }

    if (event.getSlotType() == InventoryType.SlotType.RESULT) {
        event.setCancelled(true);
    }
}
#

A combination of both is probably a good idea

#

You shouldn't need to close the inventory either. That will just prevent players from picking up emeralds from the result slot of a villager trade

mellow snow
worldly ingot
#

Glad it's working!

winter jungle
#

I am currently working on a MiniGame, to be more precise on the part where you define the region, currently I show the region with HAPPY_VILLAGER particles, but they are a bit mixed up and not so clear. Do you guys have any ideas for better particles?

rough ibex
#

marching ants sparkles?

winter jungle
#

what

nova notch
#

or instead of a grid just do an outline

winter jungle
winter jungle
#

Alright yeah thats much better haha

#

ty!

echo basalt
#

make it out of sticks and set it to glow

#

basically rendering a wire

young knoll
#

Using solid colour player heads works well for that

rough ibex
#

Oh that is nice

smoky oak
#

tying to understand something - wouldnt using services require the presence of a plugin providing the interfaces to be implemented?

sullen marlin
#

Yes

smoky oak
#

seems to me like import with extra steps tbh
like, you need to provide an interface in the first place to have it be implemented, and why would you implement another libraries interface?

#

like, is the usecase here to allow other plugins to overwrite it in case it stops working or something?

ivory sleet
#

what do you mean by stop working?

#

if it fails to load? or?

smoky oak
#

gets not updated and breaks coz of that
basically, im asking what the advantages of this are because 99% of the time its just register(this, this), no?

ivory sleet
#

I mean bukkits service api is good when u dont know who the implementer is, for example there are a bizillion economy plugins

#

but having a common abstraction is just self explanatory why its nice

#

then again the service api considers priority iirc

#

so that might be what u're after perhaps?

smoky oak
#

well im not, ive been told to use services instead of imports directly :V

#

atm im trying to figure out how to do libraries/APIs 'properly'

ivory sleet
#

services?

#

u just mean writing a public api layer in general?

smoky oak
#

i guess? I'm currently abstracting the things i expect to need in more than just one plugin into a library

ivory sleet
#

ah mb thought u meant the servicesmanager api

ivory sleet
smoky oak
#

great another thing to worry about lol

#

-# define 'cost'

ivory sleet
#

tbh I don't think you need to over abstract your library api, but having interfaces may provide flexibility if u wna swap implementation, or change underlying class type etc, ofc in the real world when the api is written poorly (such that there is little flexibility) people turn to design patterns

cost mean anything, space, time, compilation-cost, runtime-cost

#

for example using interfaces means ur program is bound to use more invokeinterface jvm bytecode instructions which is negligibly slower, though it can sometimes be considered a cost (u obviously dont need to worry at all)

smoky oak
#

or just on the load(Interface.class)

ivory sleet
smoky oak
#

fair enough

ivory sleet
#

i was just providing an example

#

:>

#

maybe a bad one

smoky oak
#

mm. its so annoying theres like nothing i found on apis beyond frosthalfs git repo which... im too stupid to understand (how the heck does a separate pom.xml help)

ivory sleet
#

well i suppose thats just classic modularization

#

like obv u can write everything in one module in ur buildsystem workspace

#

but like

#

ur ide wont even index what isnt needed if u separate it

#

so a mistake where the api calls/refers-to an implementation will never happen

#

or well almost never

smoky oak
#

would using modules mean you would have to do something extra when using a library? the goal for this is ease-of-use bc... well, text is small lol

im more interested in the implication you can generate the code fully, or just the public static methods + javadoc so you dont have to download the entire library

ivory sleet
#

i mean yea

#

thats one other benefit

#

u can depend on just the api jar

#

and not the impl classes

#

ofc at runtime the impl classes must still be loaded, then whether thats through shading or class loading is for the application to decide I suppose

smoky oak
#

my go-to is provided coz then the code only needs to be present once lol

ivory sleet
#

myeaa :)

smoky oak
#

do you have any resources on how to do that? modules, api jars, separating the interfaces from the implementation etc

sullen marlin
#

probably gonna be a waste of time unless you have a reason to

smoky oak
#

imillusion yells at me otherwise

#

plus, similar to the sql thing, i want to know how it works, so i know how to use it later

ivory sleet
#

yes but u dont always need to apply the best industry, cutting edge, meta practices

#

sometimes its fine to stick with the simpler, more banal option if the scope of the project allows you to

zealous scroll
#

is there a way to move a player along a path at a set speed using velocity instead of teleporting them? I currently made a projectile using item displays that has gravity and drag, and I have all the velocities at every tick of the projectile using x = x0 + v0t + 0.5at^2, and I could just teleport a player using relative projectile flags, but it feels clunky. I tried setting the player velocity to that of the projectile at every tick, but it didnt work, and i suppose its because the player also has some inherent drag applied to them

ivory sleet
#

I mean look into maven (or gradle) modules would be like the one tip (which is quite obvious :>)

smoky oak
#

yeah, i guess

sullen marlin
zealous scroll
#

yeah but the teleport packet is not the same as the player mov packet isnt it? which is how movement is smooth and teleportation isnt

#

im trying to make the player follow this

sullen marlin
#

I think it is, movement is smooth because of velocity and client prediction

smoky oak
#

make player ride an invisible arrow maybe?

zealous scroll
#

for it to have a custom projectile trajectory then i would have to teleport the arrow, and that'll kick any passengers off, unless i use the retain flag but that'll also feel clunky

mortal hare
#

is there any way to link entity with foreign key entity, while preserving the value of the foreign key in a field in spring boot data jpa/jakarta/hibernate:
this is how you usually do it (but then you have all the Facility entity data loaded, which sucks really)

    @OneToOne(cascade = CascadeType.ALL)
    @JoinColumn(name = "facilityId", referencedColumnName = "id")
    private Facility facility;

but i woud love to have something like:

    @OneToOne(cascade = CascadeType.ALL)
    @JoinColumn(name = "facilityId", referencedColumnName = "id")
    private Integer facilityId;

so that the entity loading will only happen when its was explicitly stated

mortal vortex
chrome beacon
#

or am I missing understanding what you want to do?

grim hound
#

can you publish a .jar to maven local?

blazing ocean
#

yes

#

that is literally what maven local is

grim hound
young knoll
#

Have you unconsciously used it

grim hound
#

ye

#

with build tools

#

(I think)

blazing ocean
#

Well since you are using gradle just run publishToMavenLocal

grim hound
blazing ocean
#

You don't need to add maven local specifically

chrome beacon
#

You don't need repositories there ^^

blazing ocean
#

And why are you adding artifact files manually

#

Don't do that

grim hound
chrome beacon
#

You have the project, no?

grim hound
#

I mean it is on github

chrome beacon
#

??

blazing ocean
#

Just jitpack it or something?

grim hound
#

but downloading the rep, updating and compiling it each time seems excessive

grim hound
#

uhh

blazing ocean
blazing ocean
grim hound
#

it'd be unholy to mention it here

young knoll
#

Version 69

slender elbow
#

probably something about paper sex

mortal hare
#

it will still try to fetch all the data

#

instead of just id

#

is there any way to apply jspecify@NullMarked on a method parameter?

#

it would be neat that i could declare that implementation object in the calling method parameter should contain non null values

eternal night
#

null marked targets type

#

so yes

mortal hare
#

hmm

#

i just tried recently and it didnt worked for some odd reason

#

well this is great, now i can reuse the same interface

#

but with different implementation goals for nullability

#

neat

eternal night
#

wait no its type, not type use xD

#

non null iirc is the one for type use

#

Yeaa

mortal hare
#

welp doesnt work

mortal hare
#

i want to check for nullability of object fields

#

not the object reference itself is nullable

eternal night
#

object fields?

#

what

#

Did you mean like "null marked here means that the passed type needs to be null marked"?

mortal hare
#

class foo {
Integer bar;
}

baz(@NullMarked foo buzz) {}

eternal night
#

Which, das impossible

mortal hare
#

i would love to have a way to define whether Integer bar in the class is nullable or not depending on the method parameter type is annotated with @NullMarked or not

eternal night
#

How would a method parameter have any affect on a classes field types nullability

#

What

#

that isn't even OOP

mortal hare
#

@NullMarked is merely just a hint, it doesnt check aynthing at runtime

eternal night
#

Well yea but why would there be a hint about something on a method param??

mortal hare
#

lets say for example i have an interface, and two impls

#

one impl might return null

#

and one might not

quaint mantle
eternal night
#

Yea, then the interface's method return type is nullable

mortal hare
#

marking @NullMarked an interface in method parameter would inform the typechecker that in this parameter it expects and implementation with nonnullable types

eternal night
#

That makes 0 sense

#

the caller to such a method would have 0 ability to consistently provide "an implementation that yields non-null"

#

what you want is a sub-interface the just re-defines the methods as non-null

#

and have your specific implementations implement that

mortal hare
#

i guess it just impossible from java's standpoint to implement that

eternal night
#

it is impossible in every sane type system

mortal hare
#

in typescript you can override types from nullable to nonnull

eternal night
#

in a method param?

mortal hare
#

yes

eternal night
#

do you have documentation for that

#

I'd love to see what they actually do there

urban cloak
#

but isnt it an interface to make it exchangeable? so your usecase has to work for the broadest set of return values. and that includes null values, regardless of the implementation

urban cloak
#

if one implementation may return null, then all of them could and your implementation has to check for null values anyways for that one implementation that does return null values

eternal night
#

Yea but that is a new type

mortal hare
#

not really, its a hint just like jspecify

eternal night
#

no

#

Constructs a type consisting of all properties of Type set to required.

#

a type

mortal hare
#

typescript is not strictly typed, i guess you can interpet that as a new type

eternal night
#

Yes

#

Otherwise, everything in typescript is a hint and off you go

mortal hare
#

but that doesnt change the fact that you cant do something like this on java, unless you use bytecode generation or some sort with annotations

eternal night
#

yes indeed

#

java does not have such dynamic typing mostly because it is statically typed

mortal hare
#

too bad

eternal night
#

¯_(ツ)_/¯

mortal hare
#

well i have love and hate relationship with that

eternal night
#

I'd argue you are probably doing something wrong when you have a type that may return null and a subtype that then doesn't

chrome beacon
eternal night
#

that sounds more like you'd want a type that does know of the field bar in the first place, and one that does

mortal hare
#

something like

@ForeignKey(maps = "me.dovias.foo.Bar.id")
private Integer barId;
#

@JoinColumn returns whole object reference im not using anyways

mortal hare
#

thought i can reuse the same classes that i use for PUT operations (because they're pretty much compatible apart from nullability checks) by just using nullability hints

#

basically i had very similar records:

import org.jspecify.annotations.NullMarked;

@NullMarked
public record PublicationDetails(long ownerId, long borrowerId, boolean available, PublicationData data) {
}

import org.jspecify.annotations.NullMarked;
import org.jspecify.annotations.Nullable;

@NullMarked
public record PublicationPatchDetails(long ownerId, @Nullable Long borrowerId, @Nullable Boolean available, @Nullable PublicationData data) {
}

but i guess maybe its even better to keep it separate, no need to autobox primitives for no reason

quaint mantle
#

I built a github project with Grade and the build is successful, but I can't find the jar anywhere even though I set it to Desktop. Can someone assist me?

blazing ocean
#

it should be in build/libs

#

also use a copy task instead of setting the output

quaint mantle
quaint mantle
blazing ocean
#
tasks.register<Copy>("copyJar") {
    from(tasks.jar) // or tasks.shadowJar if you use shadow
    into("your target directory")
    dependsOn(tasks.build)
}
quaint mantle
blazing ocean
#

Yep

quaint mantle
#

thanks

worthy yarrow
#

:p

blazing ocean
#

no :3

worthy yarrow
#

K work time bai

blazing ocean
#

can you make me a coffee too

eternal night
#

correct copy task prayge

blazing ocean
#

copy task your coffee into my hands

quaint mantle
#

Is there a way to detect if a player is trying to open the debug screen?

#

The F3+S, I'm not sure what it's called exactly

eternal night
#

no

quaint mantle
#

Oh

#

Thanks

upper hazel
#

why when i join to game or respawn i not getting effects

in debug mode i get but in minecraft not all

potion effect

quaint mantle
#

paste the entire code 😭

upper hazel
river oracle
upper hazel
#

jvm debug mode

smoky anchor
#

Not sure if you're doing that, but I don't think you should reuse the PotionEffect object

worthy yarrow
blazing ocean
#

lmao wat

worthy yarrow
#

Weekdays aren’t that busy and they already had another barista scheduled

#

They just transitioned from the GM handling the schedule to the AM so that’s probably why we were both scheduled today

#

I could make you a nice cup of Java tomorrow though

blazing ocean
#

:)

worthy yarrow
#

Anyone have useful links about chunk generators?

chrome beacon
#

?jd-s

undone axleBOT
worthy yarrow
#

More like example snippets

#

I looked through the impl in stash a little bit... not enough to get a handle tho kek

#

Maybe I just go back to doing that

chrome beacon
#

What about them do you want to know?

worthy yarrow
#

I guess just how they work? Trying to integrate my wfc with them because I wrote it so inefficiently, it crashes the server every time lol

#

For example, generateSurface, I wasn't able to tell if I should be extending worldInfo somewhere or just making it up on the spot... though again, I didn't really look hard enough

slender elbow
#

worldinfo is provided to you by the server tho?

chrome beacon
#

^^

worthy yarrow
#

Oh is it now

chrome beacon
#

You get it as a method param

worthy yarrow
#

hold on a sec

#

WorldInfo info = Bukkit.getWorld("");

wow didn't realize this worked

slender elbow
#

no...

chrome beacon
#

Why are you getting the world info like that

#

Use the one provided to you

worthy yarrow
#

I wouldn't

slender elbow
#

what the hell are you doing lol

worthy yarrow
#

I literally just wrote that cuz I wanted to see if it worked kek

slender elbow
#

sure.. but in no situation you would actually do that

worthy yarrow
#

Mk lol

slender elbow
#

and before you get any funny ideas, that does not imply that all WorldInfos are Worlds

slender elbow
#

yeah?

worthy yarrow
#

You asked what I was trying to do

slender elbow
#

with the worldinfo

worthy yarrow
#

Oh just that I need it as a param in #generateSurface

chrome beacon
#

Are making a chunk generator or trying to call one

slender elbow
#

yes but you don't call that method yourself

worthy yarrow
#

Making one

slender elbow
#

the server calls the method

chrome beacon
#

Then why are you calling the method

worthy yarrow
#

I guess I thought I had to

#

I would show the wfc impl but it is abysmal to say the least

storm mango
#

Hi there, is there any reason for Spigot to save/load the tickCount value into the entity nbt data? As it causes some entity behavior inconsistencies between Spigot and Vanilla

chrome beacon
#

What's the behaviour difference

worldly ingot
#

Because it's used by Entity#getTicksLived()

#

Wouldn't be very accurate if it were reset to 0 every time the entity gets unloaded

glossy laurel
#

Guys, if a have a class Game would it be considered better classes to make its constructor create and start the game or would it be better to make a static method startGame and make it return a Game instance?

blazing ocean
#

I made a GameInstanceFactory

#

and then you have an initialize method that starts the actual game and registers it to the instance manager, thus it starts ticking

glossy laurel
#

?

storm mango
chrome beacon
storm mango
glossy laurel
#

Guys, is there a way to freeze person who is gliding in place? Iirc canceling move event causes it to be jittery

upper hazel
#

What's the name of that app that checks plugins for viruses? Author gave a link to the repository here a long time ago.

river oracle
upper hazel
#

thenks

#

now author not update this plugin?

#

last time update was in 2024

blazing ocean
#

2024 isn't long ago

glossy laurel
smoky oak
halcyon hemlock
blazing ocean
smoky oak
rotund ravine
slender elbow
rotund ravine
slender elbow
#

I have loved for longer today than ever before

#

lived*

rotund ravine
#

fair

slender elbow
#

and I will live for even longer tomorrow

#

very impressive

glossy laurel
#

how do I stop player from interacting with the item they have in hand? (eating, charging a bow, aiming a trident, etc.) I want to know how to cancel the thing their doing at any time (as if they scrolled away from the held item), NOT cancel the actual usage of them.

remote swallow
smoky oak
nova notch
#

sleep

lean pumice
#

why the first dont get error but the second yes?

blazing ocean
#

because DataInteger does not extend DataObject<Integer> or something

#

hard to tell without knowing your full code

lean pumice
#

?paste

undone axleBOT
lean pumice
#

i found this, but i wonder why that doesn't work the first đŸ€”

worldly ingot
#

Yeahhhh... casting with generics is a bundle of fun

sullen marlin
#

Reject generics
Embrace java 1.4

river oracle
#

👏 👏 👏 👏 de generify spigot

winter jungle
#

Biome#valueOf will be removed in 1.22, what is the alternative?

eternal night
#

Registry.BIOME.get

winter jungle
#

ty :)

worldly ingot
eternal night
remote swallow
eternal night
#

fucking troll

remote swallow
#

Nuhuh

blazing ocean
#

smh choco

heavy void
#

Someone knows why ProtocolLib(packets) entities keep disappearing when

  • Player world change
  • Player dies
  • Player goes too much far
    And how to fix it?
young knoll
#

Because the client stops tracking it

#

So you need to send it again

heavy void
#

I mean, It is not recommended to do a spawn entity loop every 20 ticks right?

lethal knoll
#

Hey, does anyone know how to achieve a natural mob spawn? use case, I am reworking an existing plugin of mine that used to replace existing mobs with custom mobs. However this has some pitfalls as you might imagine. Any possiblity you can think of to manipulate this differently? Without NMS

sullen marlin
#

wdym natural mob spawn

lethal knoll
#

So long story short, I want to control the mobs that are being spawned without using specific locations

#

And the way I achieved that earlier is listen for the CreateSpawnEvent

sullen marlin
#

just replace the mobs you want with CreatureSpawnEvent?

lethal knoll
#

Yeah that's what I did before

young knoll
#

Re-create the games spawning system

#

🙃

lethal knoll
#

That sounds very much like reinventing the water :p

#

So replace of the spawned mobs is still a good solution

#

alright

blazing ocean
#

i love reinventing water

lethal knoll
#

Yeah okay, then CreatureSpawnEvent it is

#

It's what I used to do, it's what I'll use again

young knoll
#

Water 2

#

H4O2

heavy void
lethal knoll
#

It's just that replacing the existing mobs has casued some difficulties. For example worldguard. I didn't want to integrate with worldguard directly, but apparently, when I Just replace them upon spawn, I thought that worldguard would take priority on this and cancel even before my plugin can process it.

#

Many people have reported that mobs can still spawn in protected regions

young knoll
#

It should if your event is set to ignoreCancelled

#

And is a higher priority than worldguards

lethal knoll
#

Yeah which I thought worldguard would do

heavy void
#

Just put the event in MONITOR and check if it is cancelled, no?

lethal knoll
#

Not sure if I changed the priority of my event listener, so might be

#

but would I still need to check for isCancelled in my listener? or can I assume that the listener never got triggered in the first place?

young knoll
#

It won’t be triggered

#

For some reason worldguards listener is on high

#

So you’ll have to use highest

lethal knoll
#

So the higher the priority, the later it gets processed?

young knoll
#

Yes

lethal knoll
#

Alright, got that. Okay, that would have been a very ez fix

#

Thank you for the feedback

young knoll
#

That’s basically what the game does to track entities

#

With a bit more nuance

lethal knoll
#

I had tried that before myself, the challenge is to spawn it on a more natural base, instead of behind you. The "Custom spawn" mechanic as I called it, I was about to deprecate it the revamped version

young knoll
#

I don’t think the games spawning logic is super complicated

#

So it’s probably not that hard to remake

heavy void
lethal knoll
#

Yeah, but I don't have an idea on what is the general algorith around it, plus for example you got the caves etc. You would need to check also on the Y axis for empty spaces

heavy void
#

Idk too, but i think chatgpt can help u with that

lethal knoll
#

Yeah, possibly, I honnestly had lots of solutioning discussions with chat gpt already

#

we're talking about nights, not minutes

#

or even hours

#

xd

heavy void
#

A example: every 20 ticks theres a 1/100 chance to spawn a zombie, if it spawns, it checks every block arround player to find a proper place to spawn it

worthy yarrow
#

I think that's what it's called anyway

#

(for checking the block below your location)

young knoll
#

For each spawning cycle, attempts are made to spawn packs of mobs per each eligible chunk. An eligible chunk is determined by the same check for which chunks are random ticked. A random location in the chunk is chosen to be the center point of the pack. The X and Z coordinates are chosen completely at random, while the Y coordinate is a random coordinate between the block above the highest block in the column and -64. This makes lower maximum elevations a strong way to increase spawn rates and is the reason why perimeters are so effective. If the block in which a pack spawn occurs is an opaque full cube, further pack spawn attempts are canceled. There are a maximum of 3 pack spawn attempts per mob category.

Before the attempt to spawn each mob in the pack, the position is offset by ±5 (triangular distribution) on the X and Z axes. Thus, while the pack can be spread out up to 40 blocks from the initial position for a pack size of 4, it's much more likely they'll be closer to the center. Approximately 85% of spawns are within 5 blocks of the pack center, and 99% within 10 blocks of the center. Mobs spawn with the lowest part of their body inside this area.

lethal knoll
#

Yeah, that would work