#help-development

1 messages Β· Page 813 of 1

slender elbow
#

vanilla can do that already

#

required resource packs

remote swallow
#

this u?

slender elbow
#

yeah?

remote swallow
#

did lynx come up with it

slender elbow
#

@eternal night did you?

#

i don't think so

#

oh it was kenny

eternal night
#

No no

slate tinsel
#

Right now you can enter the command, but when you type the first letter, you can't enter it anymore, can this be solved?

    @Override
    public List<String> onTabComplete(@NotNull CommandSender sender, @NotNull Command command, @NotNull String alias, String[] args) {
        if (args.length == 1) {
            List<String> matches = new ArrayList<>();
            for (String subcommand : WHITELIST_SUBCOMMANDS) {
                if (subcommand.startsWith(args[0])) {
                    matches.add(subcommand.toLowerCase());

                }
            }
            return matches;
        }
        return ImmutableList.of();
    }```
grim hound
#

The log console

#

created on each player command

#

I mentioned playercommandpreprocessevent

#

Because I meant a player

hazy parrot
#

Add log4j filter shrugging

#

Not sure you can cancel log with event

grim hound
#

But there can be an easier way

#

I'll just cancel the packet I guess

hazy parrot
#

That would cancel whole command ig

#

Adding filter shouldn't be hard job

grim hound
hazy parrot
#

Oh you don't want just to cancel log

grim hound
#

But if it's a command I need, I'll just process it's contents on my own

grim hound
#

In the player cmd event

slender elbow
#

have you considered setting commands.log to false in spigot.yml?

remote swallow
#

smoothbraingang me fr

noble adder
#

where can i hire developer ?

eternal oxide
#

?services

undone axleBOT
noble adder
#

thank you

slender elbow
#
if (bukkitGenerator.shouldGenerateNoise())
    vanillaGenerator.generateNoise()
bukkitGenerator.generateNoise()
quaint mantle
#

is there any way i can get a player that doesn't exist in the game?

#

OfflinePlayer

quaint mantle
#

Both but name deprecated

#

If your focus on cracked then do not use uuids

#

At all

#

aight ty

chrome beacon
#

The UUID is based on the name

#

in offline mode

#

so why do you need a player that doesn't exist?

quaint mantle
#

I actually need a player who has joined the server before

chrome beacon
#

Then get the player by uuid

quaint mantle
#

for get skulls

quaint mantle
eternal oxide
#

only if it's an invalid UUID

quaint mantle
chrome beacon
#

πŸ’€

#

Store the UUID not the name

eternal oxide
#

it has to be a Valid Mojang account UUID to get a skin

quaint mantle
#

You will stop supporting me after what I said.
i work for offline server

chrome beacon
#

Doesn't matter

#

store the uuid

eternal oxide
#

if you are in offline mode and still want to use Mojang skins you will have to use a skin api

chrome beacon
#

also skull might be broken in offline mode since it won't fetch skins

#

since you know offline mode is inteded for use when offline

quaint mantle
#

understood but can i do this with tlauncher or skinsrestorer ?

eternal oxide
#

1.7 to 1.13

quaint mantle
#

ah im 1.16.5

eternal oxide
#

then why the hell are you using offline?

quaint mantle
#

my market is there

eternal oxide
#

you cna still look at teh SkinAPI code and see what you need to do for 1.16

#

it uses an external website to upload skins

quaint mantle
#

aight i check ty

eternal oxide
#

No point in roles

eternal night
#

you could ban people 😏

eternal oxide
#

safer for me to not have ban access πŸ™‚

eternal night
eternal oxide
#

theres a couple I would have been tempted to kick

quaint mantle
#

but you deserve

remote swallow
#

theres a load of people here that should probably have helper but its up to md's discretion to give them the offer

river oracle
#

I mean that and we probably don't need a ton of helpers

remote swallow
#

oh and that too

river oracle
#

our dear little cutie @young knoll is irrepalceable uwu

remote swallow
#

if everyone got it there would be 40 different helpers

#

wait

eternal oxide
#

helpers are really everyone. Being flagged as a helper means you get pinged to deal with trouble.

remote swallow
#

are discord helpers hydra, 1 head was cut off (imajin) 2 grew back (coll and smile)

storm crystal
#

how do I make player specific guis
like custom ender chests
what should I use to store contents

remote swallow
#

pdc if its small, database if its large

eternal night
#

database ?

river oracle
eternal night
#

probably yea

remote swallow
#

couldnt saving it to pdc book ban people if the packet is too big

river oracle
#

That or an NBT file

eternal night
#

entity PDCs are not synced to the client

river oracle
storm crystal
#

I generally want to make similar progression as Hypixel does with crafting mining etc.

river oracle
#

it'll be fine

storm crystal
#

so like gui_name:playerUUID ?

remote swallow
#

if its on the players pdc no need to save the uuid on it

#

gui_id:data

#

probably a byte array through nbt

storm crystal
#

wait you can give pdcs onto players directly?

river oracle
remote swallow
#

yeah?

eternal night
#

I mean, you will still need to cache the inventory somewhere

remote swallow
#

Player#getPersistentDataContainer()

eternal night
#

like, handle the read/write from/to PDC

storm crystal
#

whats array through nbt

#

I mean through nbt part

#

I know what array is

river oracle
river oracle
eternal night
#

Entity extends BukkitSerializable

#

bytearray is its own nbt type

remote swallow
#

i havent actually looked at the byte array stuff through nbt yet so y2k explain how it works

eternal night
#

not a list

storm crystal
#

maybe using database would be easier since I already have one

river oracle
river oracle
#

Imho Binary Storage is better here, but you do you πŸ‘

remote swallow
#

100010110101001010010100101111011010010111011110110111111110111110101000101000101010100101

storm crystal
#

how should I proceed with custom crafting recipiest that are locked behind condition

remote swallow
#

library of babel but binary

storm crystal
#

like bool PDC on player that's true/false?

remote swallow
#

why is the message empty

river oracle
#

it won't let me send that unicode character xD

#

funny it just replaces it with nothing

#

οΏ½

#

GUH I have class today WTF I wanted to chill at home

remote swallow
#

no

#

go to class but make spigot stuff anyway

river oracle
#

no I have finals coming up and a lot of my grades are on the line, if I do well I can prob still get straight A's

remote swallow
#

when the fuck are finals

river oracle
#

4.0 for 2 college semesters would look great on my applciation

storm crystal
#

what do these grades even give you

remote swallow
#

you say coming up but someone else says finals in november πŸ˜†

river oracle
#

once I actually get into a college they mean much less but right now I'm still in highschool fighting to look semi good on my application

remote swallow
#

what are you gonna do in college

river oracle
storm crystal
#

4.0 seems pretty average

#

whats ur scale

#

1-6?

river oracle
storm crystal
#

tf

river oracle
storm crystal
#

where are you even from

remote swallow
#

ha NERD

#

cheese land

river oracle
#

Once I get accepted I'm doing CS with an emphasis in Embedded SYstem

river oracle
#

the United States :P

#

Midwest

storm crystal
#

since when Switzerland is US

remote swallow
#

the us cheese land

river oracle
#

my state is popular for its cheese

remote swallow
#

not eu cheese land

storm crystal
#

anyway

#

how do I store checking if player can or can not use X recipe

remote swallow
#

i have to enable 2fa to post resource updates but i dont trust myself with the backup codes

river oracle
storm crystal
#

I doubt that every player having 30+ PDCs with bools is a good idea

river oracle
remote swallow
#

and you think ill keep track of the piece of paper too?

eternal oxide
#

I hate 2fa. I didn't store my codes.

storm crystal
river oracle
#

idk I never use SQL but probably :P

storm crystal
#

yeah that sounds okay

weak meteor
#

can someone give me a code advice for that?

storm crystal
#

do u have any gui guides by any chance

#

like how to start with this

weak meteor
#

this one

#

is good

#

i love it

storm crystal
#

isnt that smile

weak meteor
#

yes it is

storm crystal
#

seems credible then thank

weak meteor
#

Its system is understandable and i use it

weak meteor
#

Its more than 6 seconds on making a request

#

And well, isnt the appropiate

#

it does work and checks the db and stuff, but its super slow, so can someone help me?

remote swallow
#

cache the data

weak meteor
#

yeah i was thinking that

#

but i still think is the server taking so much, not the connection to mysql

remote swallow
#

do you know u just sent ur login info and also the info of where the server is runngin

weak meteor
#

Fuck

#

lol

#

well

#

Gotta create a new user and delete actual

remote swallow
#

you probably would be best to do some testing on a seperate table with a differnt local only user that is the only one with access to the table

weak meteor
#

yo @remote swallow

#

just did of the cachΓ© stuff

#

still slow

#

its the code

#

cause the domain its ok

remote swallow
#

dm me or send a request here, it might be ur internet being slow

quaint mantle
#

Or use warp vpn

#

1.1.1.1

#

They close to cloudflare and less captcha stuff

vocal cloud
#

NGINX is better

river oracle
#

Apache πŸ’ͺ

remote swallow
#

no

#

nginx better

river oracle
#

Nginx can suck a popsicle I have currently stored within my freezer

remote swallow
#

y2k fight me bitch

quaint mantle
#

Sockets

river oracle
remote swallow
river oracle
#

Skull emoji

remote swallow
vocal cloud
quaint mantle
#

Sockets are build in

raw epoch
#

Hello, is there any other option to display a TextComponent in a bossbar rather than use packets?

river oracle
#

If youre on redacted fork you can

raw epoch
#

okay thx!

river oracle
#

This is coming soon though Choco has been hard at work

raw epoch
#

okay nice

river oracle
#

I'd expect either in early 1.20.3 or 1.21 at latest if everything doesn't break :P

upper hazel
#

I'm not good at mathematics, but whoever studied this topic can you tell me what the 3rd version of uniform randomness is based on? https://github.com/DailyStruggle/RTP/wiki/Why Personally, I only understood option 2 where the square root is used

GitHub
Why

fun with spatial math. Contribute to DailyStruggle/RTP development by creating an account on GitHub.

glass mauve
#

which event is called when placing an Item Frame?

worthy yarrow
glass mauve
#

ok thanks

#

odd name lol

worthy yarrow
# glass mauve odd name lol

Spigot docs say "triggered when hanging entity is created in a world" Which I assume references the placing of a hanging entity

#

I never messed with item frame placement or the method of handling placed item frams lol so I could be incorrect

glass mauve
#

nah its probably correct

#

thanks

worthy yarrow
glass mauve
#

yeah its correct

worthy yarrow
#

The issue that I'm having is with the set player coins logic either within the setPlayerCoins method, or the onCommand method. For some reason when i type /mb balance set <name> <amount> it will send me the message in chat that I have set the <players> balance to <amount> , but doesn't actually update in /mb balance. https://pastebin.com/T1PaiZmG

#

Also don't judge my nested ifs, it's the only way I know how to implement this logic lol

minor junco
worthy yarrow
#

...

#

thanks

minor junco
#

first and foremost shouldn't the set method actually set the coints no matter if there already is an entry (thus leading to override)?

worthy yarrow
#

yes

#

give me a sec to test that

minor junco
#

if that doesn't change anything debug and test if your targetUUID may be null

glossy venture
#

this will only set the coins if they dont already have any

worthy yarrow
#

It shouldn't since I have the defaultcoins method

#

    @EventHandler
    public void onJoin(PlayerJoinEvent e){
        Player p = (Player) e.getPlayer();
        if (!MobCoinCommand.playerCoins.containsValue(p.getUniqueId())){
            MobCoinCommand.setDefaultCoinBalance(p.getUniqueId(), 0);

        }

    }

}```
and this
minor junco
#

this wont work

worthy yarrow
#

ok

minor junco
#

playerCoins.containsKey instead of containsValue

#

your value is an integer

#

in the coins map

worthy yarrow
#

ok will change that

minor junco
#

also you do not need to test against whether the UUID is already contained in the map since your setDefaultCoinBalance method is doing this already

worthy yarrow
#

Right right

#

yeah this was started late last night lol a bit sloppy

worthy yarrow
proud badge
#

Idk if I should ask this here, but my friend just updated our github repository, how could I make it automatically update on my home PC? (I have github desktop)

#

Asking this here since the github discord got nuked

#

(I think)

#

Ah its the pull/fetch origin button

scenic onyx
#

how i can resolve?

river oracle
#

:P Lombok plugin

#

on intellij

scenic onyx
#

i get error

dry hazel
#

you have a method signature clash

river oracle
#

oh yeah lol that's in JavaPlugin

#

name the var like iLogger or myLogger or pluginLogger

scenic onyx
river oracle
#

yes you do

scenic onyx
river oracle
#

JavaPlugin already has a getLogger method

scenic onyx
scenic onyx
river oracle
#

no you sill guy

scenic onyx
#

bruh

river oracle
#

Logger getLogger()
ILogger getLogger()

#

clash

scenic onyx
#

yes yes

#

i have understand

proud badge
#

yo so a friend made a plugin, but can someone explain whats going on here? Why is the main class in lowercase and why is there a class inside of a class

river oracle
#

the file is named staffcore but the class is StaffCore

pseudo hazel
#

because they didnt name it correctly

#

its probably case sensitive

river oracle
#

they just raw dogging it with notepad xd

pseudo hazel
#

idfk

river oracle
#

even VSCode gets angry when you do that shit

#

and thats VSCode

pseudo hazel
#

windows paths arent case sensitive

proud badge
#

ok I think ik whats going on

#

they used JDK 17 and I use JDK22

#

I think

pseudo hazel
#

that shouldnt matter

#

whats the file called on disk

river oracle
#

staffcore.java

proud badge
#

Ok I fixed it

river oracle
proud badge
#

By coping the entire file, deleting it, and making a new file called StaffCore and pasting it all in

wraith dragon
#

I think what happened was

#

the file was named

#

staffcore

#

then inside the file

#

its

#

public class StaffCore

shadow night
#

Exactly what it is lol

wraith dragon
proud badge
#

says the file is named StaffCore on their machine

#

but when I copied the github repo it changed

#

cloned*

pseudo hazel
#

yeah this is like a windows issue probably

#

or github

wraith dragon
#

windows πŸ€¦β€β™‚οΈ

shadow night
#

Also, if you went into the class and looked at what the error is, it would tell you something like "public class name can't be different from file name"

river oracle
#

windows try not to be dumb challenge

proud badge
#

Ok its lowercase on github too

#

but its normal case on their pc

#

interesting

#

also, how could I run something I cloned from github?

native bramble
#

are ores generate in minecraft like structures?

quaint mantle
#

No

#

Ore gen is pure random

#

By the seed

hazy parrot
proud badge
#

see the screenshot I attached

#

I cant

hazy parrot
#

Intellij suggest that class you are in doesn't have public static void main method

#

Which probably doesn't if it's plugin

proud badge
#

also am I blind but wheres the rename button

river oracle
#

refactor

#

rename

proud badge
#

ok thanks

proud badge
river oracle
#

bro you need to learn the basics here

#

its not hard to compile and run a plugin

hazy parrot
#

^

#

You can't just run a plugin

proud badge
#

Ik how to compile a plugin

river oracle
proud badge
#

I always press the green triangle to compile a plugin

hazy parrot
#

Because it's probably maven profile selected

#

But you have to know to do it manually to

remote swallow
#

do you actually have a run config set

river oracle
#

didn't even know you could do that lol

proud badge
#

is there a guide anywhere

remote swallow
#

open the maven tab on the right

#

open life cycles

#

choose package

proud badge
remote swallow
#

double click package

#

then you can use the green triangle

hazy parrot
#

If that plugin is using maven, either add run config, do what epicebic said or double ctrl and type mvn package

river oracle
#

I literally just posted a guide for maven with intellij

remote swallow
#

not good enough nerd

#

go and revise for ur finals nerd boy

proud badge
#

ah wait

#

its named package

#

YOO IT WORKED

#

the green dorito is back

hazy parrot
#

Tbh didn't know it auto add profile

river oracle
#

same lol

#

I always just compile using the package button

#

or mvn package in the command line

molten hearth
#

is there no like, tool.getTier()

halcyon hemlock
#

Hardness maybe

halcyon hemlock
deep herald
#

can i handle chat events thru bungee?

#

🧌

young knoll
#

I don’t think bungee has an event for that

#

Could be wrong

deep herald
#

its chatevent or smthg but idk if thats game chat

proud badge
#

is bukkit retlogger and systemoutprintln the same thing?

#

Bukkit.getLogger().info("HeeseSeen loaded.");

young knoll
#

Somewhat

#

You should use your plugins logger though

scenic onyx
#

Is the configuration ok or do I need to change something (is it the plugin at the beginning)?

#

@lost matrix ?

lost matrix
lavish flower
#

Hey guys! I'm currently working on a chat plugin for my mc server (I find chat plugins are some of the easier to develop and that provide some good experience/knowledge), and I wanted to use it in my next plugin

How can I implement an API into my chat plugin that allows me to use it in other plugins as a dependency? (like using Vault)

young knoll
#

I is usually used as an interface prefix

#

Although that’s somewhat controversial

scenic onyx
young knoll
#

Because you expose the hashmap directly

#

Meaning people could call clear or remove or whatever on it

lost matrix
scenic onyx
young knoll
#

You generally don’t want third parties clearing your map

#

Or messing with it in ways you don’t intend

lost matrix
young knoll
#

Unless you return a copy*

lost matrix
#

Yes for bulk iterations you can return a copy πŸ™‚

scenic onyx
young knoll
#

Doesn’t stop people from depending on it

#

At least in the case of a plugin

lost matrix
scenic onyx
lost matrix
# scenic onyx

One thing i would def change is your IClass. Distributing dependencies via an abstract class is really not the way to go.

hazy parrot
#

Why prefix I

#

On class config and logger

lost matrix
hushed spindle
#

is there any way to figure out the loot table of a suspicious sand/gravel block

#

a loot generation event doesnt seem to be able to detect such a loot table generating and on-interact the loot table is already gone

#

ofc periodically checking the block the player is simply looking at is an option but that seems silly

lost matrix
# scenic onyx How should I do otherwise?

One thing i could maybe see is something like this

public interface LogAccessor {

  default Logger getLogger() {
    return UltimateBedWars.getInstange().getLogger();
  }

}

It doesnt allocate fields every time you create an instance of your abstract classes.

#

*And its lazy so you wont encounter circular references (which could happen with init fields like in your abstract class)

hushed spindle
#

nvm the loot table generates when the first lil thing has been brushed away

scenic onyx
#

@lost matrix this?

proud badge
#

?paste

undone axleBOT
proud badge
lavish flower
#

I'm debating with the idea of refactoring to have a Libs plugin that can be used like Vault for all my plugins, though I'm hesitant to do that because I feel that greatly overcomplicates things. Also, not sure how I'd even go about that

lavish flower
lost matrix
proud badge
#

what about my plugin versions?

#

One of my plugins is on JDK-17

lost matrix
lost matrix
proud badge
#

to the latest paper build?

lavish flower
lost matrix
lavish flower
#

Awesome, thank you so much for the help! ❀️

glossy venture
#

besides reflection will break any attempt at 'encapsulation' with no effort anyways

lost matrix
#

You dont gain anything and you lose a metric ton of robustness.

glossy venture
#

dont really understand what you mean by fragile code but the one argument i can think of is having to refactor code if you want to introduce custom getter logic

glossy venture
#

ofc its nice to have a getX method in XManager but thats mainly QOL imo

lost matrix
#

What kind of flexibility would that be? All you are doing is violate half of the clean code principle which have been meticulously engineered over last decades.

lost matrix
glossy venture
#

well you dont really gain functionality because reflection breaks anything anyways but its easier to modify the collections for other devs and yourself

#

the only reason i wouldnt expose it is bc it doesnt look nice or professional in autocomplete lol

lost matrix
#

But thats what you dont want. You should never pass the responsibility of your fields to other classes.
It completely defeats the point of having responsibilities. At that point you can as well write python or javascript, where
nothing actually matters.

glossy venture
#

i dont really understand why that matters

#

also i wouldnt say you pass responsibilty at all

#

its more you provide more access for less code

lost matrix
#

You lose modularity, you have no more data integrity. Its a total and complete mess.
I have literally never worked in a professional environment where breaking strong encapsulation was even considered.

glossy venture
#

to the rest of your codebase

lofty badge
#

who can help me with my c# script?

lofty badge
# lofty badge who can help me with my c# script?
using System.Diagnostics;
using System.Runtime.InteropServices;

class Program
{
    const int PROCESS_ALL_ACCESS = 0x1F0FFF;

    [DllImport("kernel32.dll")]
    public static extern IntPtr OpenProcess(int dwDesiredAccess, bool bInheritHandle, int dwProcessId);

    [DllImport("kernel32.dll")]
    public static extern bool WriteProcessMemory(IntPtr hProcess, IntPtr lpBaseAddress, byte[] lpBuffer, uint nSize, out int lpNumberOfBytesWritten);

    static void Main()
    {
        Process process = Process.GetProcessesByName("GeometryDash")[0];

        IntPtr processHandle = OpenProcess(PROCESS_ALL_ACCESS, false, process.Id);

        IntPtr address = new IntPtr(0x188CE1);

        byte[] newValue = new byte[] { 0xE9, 0x8A, 0x00, 0x00, 0x00, 0x90 };

        int bytesWritten;
        WriteProcessMemory(processHandle, address, newValue, (uint)newValue.Length, out bytesWritten);
        Console.WriteLine("ok!");
    }
}``` i have this script, i want to change values on addresses for my geometry dash mod menu. but it's not working, who can say why it's not working?
lost matrix
# glossy venture also i wouldnt say you pass responsibilty at all

It leaves your classes scope. This means if your class is destroyed, there is no guarantee that your objects are collected because
you exposed them. You literally endanger your whole project to be a giant memory leak. Idk how you could pass the responsibility even more...

glossy venture
#

thats not leaking memory thats just it being kept alive by something else until thats done with it

lost matrix
glossy venture
#

if a program uses your collection it would use your class if it had to

celest notch
glossy venture
#

so its either your collection or your class instance doesnt get collected

lofty badge
hazy parrot
glossy venture
lofty badge
lost matrix
#

You are also running the danger of writing DRY code because a lot of operations you will apply on your exposed
collections will be copy pastes of each other. Just spread to different points in your code.

hazy parrot
#

my assumption is that you can't just write to process

hazy parrot
lost matrix
glossy venture
#

oh

#

yeah thats why you make shortcut methods like getX in XManager

lost matrix
#

Let me write an example to clearify this point...

glossy venture
#

or dont expose the collection

#

but its always exposed

whole edge
#

hi boys!
I was creating a java plugin for my server, an arcade plugin with automatic events, do you happen to know how to fix it on intellij, idea how to fix the jdk? Which one should I use to make it work?

glossy venture
#

so it doesnt even matter really

glossy venture
whole edge
glossy venture
#

id build for Java 8

whole edge
lost matrix
# glossy venture so it doesnt even matter really

With that argument you can as well not adhere to any clean code principle because you can always hack your way in with reflections and bytecode injection.
Its not about making your code impenetrable. Its about writing clean, robust and maintainable code.

glossy venture
#

javas mostly backwards compatible so Java 8 will work on Java 17 required by 1.20

whole edge
#

give me download please

glossy venture
#

?java8

#

nvm

glossy venture
#

jdk 8

glossy venture
#

whatevr

#

it doesnt matter

#

i need to learn stupid macbeth for a fucking english test

whole edge
#

this?

lost matrix
glossy venture
#

k

hazy parrot
lost matrix
#

?paste

undone axleBOT
echo basalt
lofty badge
#

int bytesWritten returns nothing

echo basalt
#

So that your collection is properly encapsulated

glossy venture
#

yeah why

echo basalt
#

It allows you to have full control over code flow for that collection

hazy parrot
#

is it 0

lofty badge
#

i have this

hazy parrot
#

dude

echo basalt
#

So that if you want to know when something is added to your collection, you just modify the method and it works for every use case

glossy venture
#

yehah

hazy parrot
hazy parrot
#

yeah it failed, check this

glossy venture
#

maybe run as admin

hazy parrot
#

with this function, you change protection level

lost matrix
lofty badge
#

i need for c#

#

bruh

hazy parrot
glossy venture
#

cant you define that like the other method

hazy parrot
#

its literally method from kernel32.dll lol

glossy venture
lofty badge
#

oh.. sorry, my bad

glossy venture
#

whatevr

#

tho

#

i kinda agree

lost matrix
#

Ok im glad smileybolb

glossy venture
#

not strictly at all though

lost matrix
#

sigh

glossy venture
#

still glad? lma

#

o

#

lets go guys

lost matrix
#

The thing is, this is in my opinion the most important concept for writing actual next level code.

glossy venture
#

hm

#

interesting

#

its boring name but i couldnt come up with anything better

#

wanted to send smth with exposed collections in code review but then i thouhgt of this and now im pissed abt the name

lost matrix
#

If it has exposed collections then you can call it data-store-with-messed-up-data-integrity πŸ˜™

glossy venture
#

no

#

it doesnt

#

yet

#

dont worry ill introduce them somewhere

lost matrix
#

Someone take away orbyfieds IDE...

glossy venture
#

i actually have a custom written plugin on intellij which automatically exposes every collection i write and makes everything static and all fields public and mutable i forgot to tell you

lost matrix
#

Yeah sounds about right PES2_Uhm

glossy venture
#

i regret not using lombok before

#

this is better than records bc you can actually fucking do shit with them

hazy parrot
#

and you can't with records ?

glossy venture
#

no

lost matrix
#

You lose the performance gains of records, but i also sometimes use Data classes like that.

glossy venture
#

no alternate constructors, no initialization code, no other fields

glossy venture
lost matrix
#

You can have alternate constructors in records

glossy venture
#

oh wait i forgot

#

yeah

#

ive been writing java 8 for so long now

glossy venture
lost matrix
#

I kinda dont like those parameters

lost matrix
#

How would you for example serialize from a simple String using this.
Would you extend SerializationInput and wrap a String?

glossy venture
#

its not done yet

#

lmao

#

ill do that shit later

glossy venture
#

ill rename it later

lost matrix
#

Maybe use one shared data type. So X->Y and Y->X

public interface DataSerializer<T, RAW> {

    /**
     * Serialize the given value into the given serialization output.
     *
     * @param context The context.
     * @param value The input value.
     * @param output The output.
     */
    RAW serialize(SerializationContext context, T value);

    /**
     * Construct a value of the correct type from the given serialization input.
     *
     * @param context The context.
     * @param input The input.
     * @return The output value.
     */
    T construct(SerializationContext context, RAW input);
dry hazel
#

sun misc Unsafe my favorite

lost matrix
glossy venture
#

like to bson, binary, mysql table thing or smth, etc

#

ig the DataSerializer is more for structuring the data for serialization

#

than actually converting it

lost matrix
#

Well then

public interface BsonSerializer<T> extends DataSerializer<T, Bson>

for example

glossy venture
#

the serializer is like the backend tho

#

its generated from reflection

#

or smth

#

and it accesses and structures the data

lost matrix
#

Isnt that what a Codec does usually?

glossy venture
#

for the SerializationOutput to actually serialize

glossy venture
#

thansk

glossy venture
#

ill do that for final fields ig

#

but
DataSerializer<T> simply a codec for type T
DataMarshaller<K, T> is supposed to be an extended codec for a database value of type T with primary key K

lost matrix
# dry hazel yeah and it's terrible

Yeah. I have fallen back to having a no-args constructor which just passes null parameters to the actual delegate constructor
to make sure my initialization logic is not skipped by Gson all the time. (I hate writing serializers and i always let Gson wipe over my data via reflections)

sterile axle
glossy venture
#

ah

#

maybe ill do

DataSerializer -> ValueCodec
DataMarshaller -> DataCodec
lost matrix
glossy venture
#

idk man i see a codec in the english language simply as something which describes arbitrary data in a structured format or smth idk english lol

lost matrix
#

But thats all lingo. If it works and your names are not completely missleading then its probably fine.
I learned that a lot of the time the naming in programming is inconsistent.

lofty badge
#

ok, it's not working

glossy venture
#

but yeah thanks for the name

#

never wouldve thought of that tbh

#

looks cooler too

#

sick

sterile axle
#

codec is just short for coder/decoder

glossy venture
#

ig that makes sense

sterile axle
#

it (en)codes stuff into another format and decodes it back

#

ah sorry. slightly wrong apparently according to wikipedia. it either encodes or decodes. an endec does both

#

but whatever

glossy venture
#

tf

#

interesting

minor junco
#

I mean allocating an object without calling it's constructor seems like an anti pattern to me

#

At least for Java where this isn't possible without calling the low-level api

sterile axle
#

google is always right

lost matrix
minor junco
#

Fairs

#

But I honestly would not want my pojo to skip constructor invocation on object allocation simply alone due to the fact that there are many reasons against it xD

#

What about attribute constants that are initialized in the constructor?

#

Wouldn't that violate javas object orientation when the constructor is skipped?

#

@lost matrix

dry hazel
#

it does bypass a lot of java's principles

#

not to mention that it will break in newer jdks and probably doesn't work on some of them right now

minor junco
#

Damn seems very UNSAFE to me πŸ˜‰ heh

#

Im proud of that pun

civic apex
#

not sure if this would fit in #help-server better but
im trying to detect a player using an end portal from the end (i tried various events they all lead p much to the same) but whenever i go through an end portal in the end i just get teleported back on top of the end exit pillar (where the egg is). Im using multiverse-core and multiverse-netherportals, and they are definitely causing the issue (disabling them stops that weird behaviour). Does anyone know why the event (in this case PlayerTeleportEvent) doesnt fire at all? (ive also tried NORMAL LOWEST and HIGHEST prios)

lofty badge
#

c#, c++ or c only for genius

#

i'm using java or javascript

sterile axle
#

lol

river oracle
civic apex
river oracle
civic apex
#

that confuses me

river oracle
sterile axle
#

C# is a lot like Java, so you'd probably find it's not that bad. C++ and C are not for geniuses, you just need to practice. They aren't that bad.

lofty badge
#

javascript is good language

#

better than python

sterile axle
#

here we go

river oracle
#

which of the 10 billion frameworks do you use?

river oracle
lofty badge
sterile axle
#

If y'all wanna argue about programming languages go to #general, this is the help channel and ppl are getting help rn

glossy venture
#

it shouldnt be able to cancel an event from being handled right

river oracle
#

Its possible Multiverse handles something differently and avoid bukkit

civic apex
#

i have this and it triggers whenever i go through a nether portal in the end (and works how it should) but going through end portal just teleports me to the pillar and doesnt fire that

river oracle
civic apex
glossy venture
#

yeah maybe it intercepts the movement

river oracle
#

and never use the event

glossy venture
#

yeah

river oracle
civic apex
glossy venture
#

idk

#

for custom portals

#

and then maybe extended it to all

#

portals

river oracle
glossy venture
#

EventPriority.MONITOR

civic apex
#

oh

river oracle
#

also double check your listener and make sure its registered πŸ˜‰

#

just so we avoid stupid issues first

civic apex
#

i also enabled mv debugging

#

and it told me i was gonna tp to the right world (but i didnt and tp event didnt get called)

#

monitor doesnt work

umbral ridge
#

hey

lofty badge
#

javascript better than java

umbral ridge
#

is it possible to add like an invisible string data to an itemstack item in GUI? eg.: "playername: spexx" and I would be able to retrieve it somehow

slender elbow
civic apex
lofty badge
civic apex
#

the event should still get called

slender elbow
#

not the teleport event

river oracle
civic apex
#

and im getting teleported and this isnt firing

slender elbow
#

the re/spawn event

#

I don't remember the name

civic apex
umbral ridge
young knoll
#

Yeah it fires the respawn event

umbral ridge
river oracle
#

then pdc works fine πŸ‘

young knoll
#

You can check the cause if you’re not on old version

civic apex
#

respawn does get called

slender elbow
#

yeah that's pretty much intended behaviour

civic apex
#

makes sense

#

but its anti intuitive

#

that it works differently for different portals

#

and that teleport DOES get called if you dont tamper w respawn (or at least i think it did)

young knoll
#

Blame Mojang

glossy venture
young knoll
#

No but they are the one using respawn in the end portal

#

EntityPlaceEvent

#

Only player

molten hearth
#

does aikar's @Dependency need additional stuff to work i mean im assuming it does

#

say I use java @Dependency private JavaPlugin genericPlugin;

#

do i not need to pass the JavaPlugin somewhere

glossy venture
#

i think it derives that from the plugin instance you use to create the command manager

molten hearth
#

oh yea

#

// some classes like your plugin are automatically registered for injection

#

epic

cursive falcon
#

is there a way i can change the model of an entity?

#

i have custom models

grim hound
#

Texture pack

fair grotto
#

Why does my bungeecord when I join lobby says my server is offline?

river oracle
umbral ridge
#

hey whats the event for when player presses Q in GUI again?

#

I can't remember the name

river oracle
#

InventoryClickEvent should do it

#

that might trigger PlayerDropItemEvent

umbral ridge
#

these four?

river oracle
#

How can you iterate over every Block within a Region inside of an iterator. For example I have a region which has a
minX, minY, minZ, maxX, maxY, maxZ

river oracle
umbral ridge
carmine mica
#

if you mean an Iterator

#

otherwise just do triple nested for loops

river oracle
river oracle
#

alrighty thanks

umbral ridge
#

hey so if I cancel the InventoryClickEvent when player tries to drop any of the items, it will still play the hand animation, as if I'm still dropping something

#

how can I prevent the hand animation from happening

#

?jd-s

undone axleBOT
tall dragon
#

by cancelling PlayerDropItemEvent i'd guess?

umbral ridge
#

so I just need to write the same code all over again in PlayerDropItemEvent? XD

#

I already do all gui checks in InventoryClickEvent

tall dragon
#

well yea. ur tryna block dropping witht the wrong event

#

u could also intercept the packet πŸ˜„

umbral ridge
#

do you know how to check from which slot the item was dropped on PlayerDropItemEvent

#

there is event.getItemDrop().getItemStack(), but I dont think its reliable (I could loop through the inventory itemstacks and find first that matches, but I could have multiple of the exactly same items in my inventory, so that wouldn't work)

summer scroll
#

I don't think there is a way to detect which slot the itemstack belongs to.

umbral ridge
#

I need to detect from which slot the item was dropped, if it was from the upper inventory or player inventory

summer scroll
#

Well, what do you want to achieve?

#

Like what's the end goal?

umbral ridge
#

if it was from the upper inventory I need to get the slot number from which it was dropped and from there check if it's less than 45, because the bottom line is for pagination, anything less are homes blocks (which player can click to teleport, they can press Q to remove them, right click to modify the block material for the home)

#

right now it works, I just need to deal with the hand animation, for some reason it's still there after I cancel the inventoryClickEvent

#

So I got a suggestion in the chat to go for PlayerDropItemEvent and now I can't even check from where the item was dropped or anything

young knoll
#

I think the arm swing might be client side

umbral ridge
#

o

#

Is it possible to intercept it with packets?

young knoll
#

You can try player animation event

umbral ridge
#

alright

umbral ridge
#

It doesn't cancel the hand swing animation for some reason

#

but it should since i think its specifically made for it

#

πŸ€”

#

here's my code

#

it comes to the end of the code block and everything works, but that event.setCancelled just doesn't do anything

molten hearth
#

is there any sane way to convert a material to a block

#

i tried uh

#
BlockData blockData = material.createBlockData();
Block dataBlock = blockData.createBlockState().getBlock();```
#

but this wasnt so cashmoney

slender elbow
#

a block is a position in the world

molten hearth
#

yeah but like

#

idk man

#

i need to get the nms version of the block to call getSoundType

slender elbow
#

idk what sound type is but isn't that the sound group? you can get that from a BlockData in the API

young knoll
#

Blocks don’t even exist in NMS

#

Well, they do but not in the same way

molten hearth
#

are you sure about that πŸ…±οΈuddy

carmine mica
#

laughs in GlobalPos

molten hearth
#
net.minecraft.world.level.block.Block nmsBlock = ((CraftBlock) block).getNMS().getBlock();
SoundType soundEffectType = nmsBlock.getSoundType(nmsBlock.defaultBlockState());```
#

i was using this for nms

carmine mica
#

that is a Block type, not at all the same as the api's Block

young knoll
#

It’s closer to material

slender elbow
#

._.

molten hearth
#

i mean i passed it a casted bukkit Block so its close enough

young knoll
#

BlockType when

mortal hare
#

is there any website that provides mappings from protocol ids to minecraft version names (i know wiki.vg does provide it, but i would like to fetch it like from some kind of api)

molten hearth
#

actually perhaps im overcomplicating this

mortal hare
#

i've currently made my own .csv file but not sure

molten hearth
#

i simply need a material to a sound

mortal hare
#

if that's the best

slender elbow
#

why not just get the soundgroup from the blockdata in the API..?

mortal hare
#

i'll guess i will make a git repo and store the .csv file there lol

molten hearth
young knoll
sullen wharf
#

is there any way to make sure the player's dat file is (forcibly) updated when updating it's PDC?

#

I'm trying to make a crash-save thing that saves a serialized string of the player inventory and tries to replace it when the player join the server after crash

#

that's the gist of it, but the server seems to simple not update the .dat file because well... it crashes

young knoll
#

Player#saveData should work

umbral ridge
#

HOW do you get inventory title

#

wasn't there getTitle in previous versions or am i delusional

molten hearth
#

ladies and lentlemen do you all have any tips on how to approach modifying a block's hit sound

remote swallow
umbral ridge
#

I also do material comparison

mortal hare
#

https://github.com/Dovias/mc-version-protocol/blob/main/mc-version-protocol.csv
i've made a repo which contains .csv file which maps version names to protocol ids. Not sure if that's really the best thing that you could use, but it helps me to automate some stuff im working on

GitHub

Repository containing only one mc-version-protocol.csv file that maps all post-netty (1.7+) minecraft versions to their according protocol ids and vice-versa. - Dovias/mc-version-protocol

#

i've scraped wiki.vg and parsed via libreoffice and some regex and then saved it in .csv

remote swallow
wet breach
river oracle
#

?guis

undone axleBOT
river oracle
wet breach
#

Reason for not using title or name is because the client can set those

river oracle
#

InventoryView#setTitle for example

umbral ridge
#

thanks

wet breach
#

Its not much of an issue with the server rather the client

river oracle
# wet breach Its not much of an issue with the server rather the client

well the main issue is that Inventory's don't even have titles technically only their containers do, and the container title can be set arbitrarily by both the client and the server, for our purposes the title on the server is more important, but the title on the client can also cause weird sync issues

wet breach
#

Again not an issue with the sever

#

I will give an example. Lets say you use inventory names to see of its some special inventory and the way it is opened is via a command. Well the client could just send an inventory open packet bypassing the command and then set the name of the inventory and now they are allowed to do whatever with it to sometimes include taking the items lol.

#

Its fine to set a name just as long its not the primary means for checking the inventory

molten hearth
wet breach
#

If the server does it, it is fine because you can for the most part detect and do things the server does not necessarily the client. Why the client is allowed to change the name or specify it is dumb though

river oracle
remote swallow
#

You could also rename a chest and boosh ur fucked

wet breach
#

Both is what i am referring to

#

Its stupid regardless mainly because again the server just accepts what the client says about some things lol

molten hearth
young knoll
#

Might be client side

molten hearth
#

well how do other players hear it then

#

they also all do calculations ig?

#

seems kinda inefficient idk

young knoll
#

It probably sends it to anyone but you

#

Idk haven’t really looked at it

molten hearth
#

hmm okay

#

i cant really find much related to sounds tbh

#

and block breaking is not one of them 😭 πŸ™

young knoll
#

I’m pretty sure there’s a non-named version

#

Idk though ProtocolLib names are pain

molten hearth
#

you mean a non-named packet for it?

sterile axle
#

you can find sound ids and identifiers here

#

it has block.<blockname>.{break,fall,hit,place,step}

molten hearth
#

or so it seems lol

slender elbow
#

keep in mind some sounds are played in the client by itself, I'm not exactly sure in what cases that happens

grand flint
slender elbow
#

πŸ‘

cursive falcon
#

Not the model, right?

torn shuttle
#

if only there was a cool developer that just released such a plugin which is also free and open source

#

that sure would be poggers

chrome beacon
#

And then use custom item models

torn shuttle
#

or use a plugin that does that for you

young knoll
#

Oh it’s the same packet for named and unnamed sounds

#

Wacky

torn shuttle
#

unnamed sounds seems like a sick album name

cursive falcon
#

To display the model

torn shuttle
#

nope

torn shuttle
torn shuttle
#

spot the problem I failed to spot for 3 days

#

smh

river oracle
#

pink

quaint mantle
#

JE RP should be close to bedrock

#

Bedrock rps are OP

torn shuttle
#

how could a mere mortal ever ascend to such a level of coolness

grim hound
#

It'd be impossible to be that cool

#

Also why can't I modify the spigot page on a phone

zealous osprey
torn shuttle
#

on that one specifically that is technically one model but each cube is its own bone for debug purposes

torn shuttle
cursive falcon
#

Man idfk what that is

#

It’s js a recording

blazing stream
#

i would like to be able to access my player data (ex: health, vault eco balance, XP level, etc.) through an external app (node.js)
thing is, i dont know how to do so, i looked into Rest PAPI (it doesnt work!) and im not experienced enough to make my own plugin to handle a REST API

could i get help please? maybe point me in a direction and ill search from there

indigo jasper
#

Hey, so I want to know how can I set the item from PacketSetInCreativeSlot to AIR or null if NBTTag isn’t null. Should I call a new PacketSetInCreativeSlot?

young knoll
#

Edit the item?

rotund ravine
#

U’ll have tough luck messing with creative tbh

indigo jasper
#

There is an exploit in past versions which I would like how to prevent when players have access to creative

rotund ravine
#

What exploit

young knoll
#

yeah just edit the packet and then update the client if you change it

eternal oxide
#

Creative = Server trusts anything the client does.

indigo jasper
#

So basically inject the new packet to the player connection

rotund ravine
#

No edit it

indigo jasper
#

Oh, ok

indigo jasper
native bramble
#

is it ok to use cf in chunk populate event?

rotund ravine
indigo jasper
#

I lost already 6 hours on it πŸ™‚

native bramble
#

completable future

rotund ravine
#

Use it how?

native bramble
#

i need to generate custom ore

#

i know that it should be generated with block populator

rotund ravine
#

And you want to use completablefutures for that how?

native bramble
#

i will send u my class

rotund ravine
#

?paste

undone axleBOT
native bramble
#

if i will use the same code but with block populator, my server stop respond

#

i think problem in big loops

#

like they become infinite

#

or smth like this

rotund ravine
#

Don’t do that

#

Chunks are meant to be gotten sync

native bramble
#

so what should i do than?

young knoll
#

Use a block populator?

blazing stream
# cursive falcon Just use a database

thing is

  1. i dont want to move my stuff to a DB (some plugins require essentials so i'd have to link them to the DB im guessing)
  2. if i were to use a DB, ideally it would just have a clone of the players data (see above), how would i do that?
native bramble
#

okay, i will try use block populator again

#

and in block populator i can use async?

young knoll
#

It already is async

native bramble
#

so i dont need cf

#

and i also need to know

#

shouldnt i use bukkit runTaskAsynchronously with this?

eternal oxide
#

no

native bramble
#

ok

eternal oxide
#

No CF, No Tasks, No Async

young knoll
#

Also avoid accessing the world or chunk

#

Work with just the xyz values

native bramble
#

why?

eternal oxide
#

Because the chunk you are populating doesn;t exist yet

native bramble
#

ohh

#

thank u

young knoll
native bramble
#

ok

shadow night
#

why does the runnable run, the event constructor get called, but the event doesn't get called

eternal oxide
#

register listener?

warm mica
#

Or the event class isn't implementing handlers properly

shadow night
#

ah fuck

#

did I not register the listener

#

I swear I remember doing that

twin venture
#

Hi , i have a question ..
what kind of things i need to have on the core moudle?
i have

  • api module [api]
  • core moudle
  • game moudle [jar game itself]
  • lobby moudle [jar for lobby server]
indigo jasper
#
public void readPacket(Player player, PacketPlayInSetCreativeSlot packet) {
        ItemStack itemStack = packet.c();
        if (!itemStack.v().h().toString().equalsIgnoreCase("{}")) {
            ItemStack item = new ItemStack((IMaterial) null);
            new PacketPlayInSetCreativeSlot(packet.a(), item);
        }
    }```
#

how can I update this packet?

river oracle
#

Whatever you think would be abstract and applicable for both of your implementation modules

young knoll
#

You probably need reflection

indigo jasper
#

I have it already

#

I need only to update this packet

slender elbow
#

push the new packet through the netty pipeline

twin venture
#

should i make this a map?

and add each thing sepratly?

#

like arenaname,arena.getarenaName()
etc

native bramble
#

but on world generation server just stop respond

#

in main class i have :

@Override
    public @Nullable ChunkGenerator getDefaultWorldGenerator(@NotNull String worldName, @Nullable String id) {
        if(worldName.equals("world_the_end")) return new CustomEndGenerator();
        return super.getDefaultWorldGenerator(worldName, id);
    }
weak adder
#

so im trying to make my plugin compaitable with the older versions of the spigot as well as newer versions of the spigot so there is this method in 1.8 inventory.getItemInHand() which is deprecated in the newer versions and replaced with getItemInMainHand(). what is a proper way to handle this?

wicked loom
#

ΠΊΠ°ΠΊ ΠΌΠ½Π΅ Π·Π°ΠΉΡ‚ΠΈ Π½Π° ΠΊΠΎΠ»Π»ΠΈ Π²ΠΎΡ€ΠΎΠ»Π΄

indigo jasper
young knoll
weak adder
indigo jasper
#

player.getHandle().b.a(new PacketPlayInSetCreativeSlot(packet.a(), CraftItemStack.asNMSCopy(item)));

wicked loom
#

ΠΊΠΎΠ³ΠΎ

rotund ravine
weak adder
#

thanks

young knoll
slender elbow
indigo jasper
young knoll
#

Does the InventoryCreativeEvent not handle PacketPlayInSetCreativeSlot?

hushed spindle
#

did ServerGamePacketListenerImpl lose the connection variable in recent updates?

slender elbow
#

it was made private iirc?

hushed spindle
#

man

slender elbow
#

woman

hushed spindle
#

baby

umbral ridge
#

β˜• 🚬

hushed spindle
#

i was hoping to not need that but i guess you gotta do what you gotta do

#

unless theres a better approach to getting someones channel

river oracle
hushed spindle
#

yuh

river oracle
#

one sec buddy

hushed spindle
#

thanks buddy

river oracle
#

ServerPlayer#connection <3

#

CraftPlayer#getHandle() -> ServerPlayer

#

works as of 1.20.2

hushed spindle
#

that returns ServerGamePacketListenerImpl

river oracle
#

isn't that what you want

hushed spindle
#

i need a Channel lol

river oracle
#

oh πŸ’€

hushed spindle
#

its reflectin' time

indigo jasper
#

@slender elbow please help, I'm dumb

channelHandlerContext.fireChannelRead(new PacketPlayInSetCreativeSlot(packet.a(), CraftItemStack.asNMSCopy(item)));```
slender elbow
#

System.out.println("hello world")

umbral ridge
#

System.cat.output("give food")

tepid crater
#

Hey guys, I'm getting on the v1.20.2-R0.1 mappings the error "incompatible types: inference variable T has incompatible bounds" when calling "craftWorld.createEntity(location, EntityType.ARMOR_STAND.getEntityClass())" any reason why?