#help-development

1 messages · Page 1257 of 1

thorn isle
#

design for extension or prevent it

#

that said, final in my mind is one of those things that ought to be used sparingly and only when needed, with the exception of fields which should be final by default

#

final classes and final methods usually don't make sense, except when they do, and that's usually fairly clear design-wise; for example a doThing method that overloads to a final or private doThing0 so that you can both allow extension (by overriding doThing) but be certain that sensitive logic (doThing0), when called by you in this class, works exactly as expected

mortal hare
#

my mind tells me if you want to override something from a class which already has implementation, you should replace inheritance with composition

#

im not saying that it should be used everywhere but lets say if you know that these values are only for public access, are immutable but also used internally, it can be good way to enforce that implementations would not touch those variables and getters, thus prevent nullability issues that might occur in buggy implementations

#

you shouldnt patch the code from the inheritance, you should edit source code if you see that it bothers you how it works.

#

ofc not everytime this works, especially with legacy applications where we need shady hacks to do we want because code is riddled with tech debt

#

one example would be getter for retrieving name Player#getName() of the player, you shouldnt override that variable, because that might mess with various classes which depend on that, so you might as well make that method final in abstract class and not let implementations of Player touch neither the field, neither the getter, but let them use that variable for read access only from subclasses

#

imagine if OfflinePlayer overridden getName() to one thing and OnlinePlayer to be something else. Its clearly a field that shouldnt be mutated and only be handled from base class

thorn isle
#

funny you should take that as an example because this is exactly a case where this doesn't hold

#

OfflinePlayer's aren't guaranteed to have a name; getName on an offlineplayer can actually fire a blocking network request to mojang to resolve the uuid -> name association

mortal hare
#

im not talking about minecraft in general

thorn isle
#

whereas for (online) Player it's a fixed value

mortal hare
#

what if player name cannot be changed

#

and it is a fixed value

thorn isle
#

yes, but it is a counterexample of how assumptions about subclass internal behavior can fail down the road

#

generally the assumption is that the implementor is competent

#

beyond that as long as they follow the documented specification of the method/behavior they're overriding, everything's fair

mortal hare
#

but having something that nags you when you might do something wrong is kinda nice tho

thorn isle
#

"something wrong" is very difficult to define programmatically

#

the best we have are probably flow/contract annotations

mortal hare
#

my main point is that api contract should define as much as it can by itself instead of relying on javadoc comments

#

by preventing errors that might occur by hacky solutions

#

instead of editing the source code

thorn isle
#

that's what annotations are essentially, they're javadoc comments that the compiler/linter can read and emit warnings about programmatically

#

the difference to the final keyword is that it doesn't nag, it outright stops you from doing things

#

which very easily slides into nanny protectionism rather than anything productive

#

if it's critical that the behavior not be overridden/changed, it should be final

mortal hare
#

if that's the case why most implementations use final keyword for private variables

thorn isle
#

if it's non-critical then it's better to opt to be more flexible and assume the implementor is competent

mortal hare
#

isnt that nanny protectionism

thorn isle
#

fields are quite a bit different from methods

#

like i noted at first, fields should be final by default

mortal hare
#

sure you cant inherit them, but still the point is that you emit errors to not mutate them, the same is done with method but from inheritance perspective

#

self describing contract in a sense

thorn isle
#

not only mutate, but making them final also ensures that they are initialized

#

e.g. take a class with 8 different constructors

#

labeling your fields final ensures that each constructor assigns each field exactly once

#

labeling fields final also enforces stricted read-write ordering because the compiler can have perfect information about whether the field has been initialized at the time of being read or not

#

and compared to e.g. making all your methods final which prevents extension outright, there are very few drawbacks to making fields final

mortal hare
#

im not proposing to make all methods final, only immutable data getters

#

like record data

#

in c# you have this

thorn isle
#

that's nanny protectionism

#

what, is someone going to mess up a getter by accident?

mortal hare
#

what if you're making a library and cant expect to be everyone competent enough who uses your lib

thorn isle
#

what if someone wants to for example add a last-accessed timestamp that gets updated on read? the whole point of having getters for fields rather than making them public and final is that you can slide arbitrary logic in between the read and the access

#

you could argue that nobody needs to do that, and it is a fairly contrived example, but it's better to assume competence and allow extension than disallow it outright

#

because needs and applications will arise that you can't foresee

mortal hare
#

if everybody was competent enough we would be using c till this day. there's a reason why abstractions and high level syntax exists. mainly encapsulation in OOP and ease of use

#

anyways good discussion

young knoll
#

C? Why not assembly

mortal hare
#

there's no clear answer anyways to this, it depends what kind of code you write. imho if you write a lib, that someone would use externally maybe you're right but if someone writes code for internal processing where data safety makes sense, maybe im right idk

mortal hare
young knoll
#

I like it

#

My next thought was manually entering the binary 1s and 0s

thorn isle
#

like with all design and paradigms and this nonsense, being consistent is more useful than being right, because no two people are going to agree on what right is

#

i stick to my view that final is something that ought to be used sparingly only for critical things, but sure if your entire thing is critical it probably should all be private or final; be judicious and try to find a principle that fits and then stick to it

paper viper
young knoll
#

Just do better

paper viper
#
7. Invalid mov Instructions - Explain why these instructions are
invalid in a 64-bit assembly program.
a) movl %eax, %rdx
b) movb %di, 8(%rdx)
c) movq (%rsi), 8(%rbp)
d) movw $0xFF, (%eax)
#

😭

young knoll
#

Because they don’t pass the vibe check

paper viper
#

whatever

kindred sage
#

heyy i need some help with making NMS clones

smoky anchor
#

elaborate ?
I don't exaclty know what to imagine under "NMS clones"

kindred sage
#

So basically I need a clone of a player to lay on the ground in order to simulate them being knocked out

#

and the player should be invisible at that time

#

but i cant seem to find any docs or anything helpful at all

#

for 1.21 btw

smoky anchor
#

If you don't want to cause yourself painful pain, use Citizens

kindred sage
#

yeah i probably will

thorn isle
#

or libsdisguises

#

comes out of the box with a "copy player with all equipment+cape+whatever" facility

#

and yes i will continue to shill libsdisguises

manic delta
#

Or EntityLib

#

From Tofaa

young knoll
#

Isn’t that the one that doesn’t have half its source on GitHub

manic delta
#

Huh? I don't think so

thorn isle
#

i think that was PlayerLib or something

manic delta
thorn isle
#

or PlayerNpc

young knoll
#

Ah

manic delta
#

This one is entitylib

young knoll
#

Yeah this one seems to be actually decent

manic delta
#

It is

#

I used it a few times, it's very useful

kindred sage
#

how do i get entitylib working in intellij idea

echo tangle
#

how do i use clientboundaddentitypacket to respawn the player? i tried this constructor, No matching static constructor: ClientboundAddEntityPacket.<init> called with (4485 (Integer), *insert uuid here* (UUID), -28.92 (Double), 96 (Double), -44.5 (Double), 7.95 (Float), 93.75 (Float), minecraft:player (EntityType), 0 (Long), x: 0, y: 0, z: 0 (Vector), 93.75 (Float)), i also tried creating a new serverplayer with server, level, gameprofile, and clientinformation yet that didn't work either

eternal oxide
#

ChatGPT? *insert uuid here*

echo tangle
#

i removed it myself... lmao

#

also that's an error message, so it would make no sense for chatgpt to generate it

eternal oxide
#

the add entity packet constructor has changed many times over teh past few months. It really depends on teh version you are compiling against

#

also, that error seems to indicate you are using some lib or reflection to build your packet

#

if a Lib make sure it is updated to support the version you are building for

echo tangle
#

alright, i'm fairly certain it's up to date for 1.21 (my version), and i have all the information it says is needed on the mc protocol page as well as 1.21 nms mappings site, maybe i'm missing something idk

buoyant viper
echo tangle
#

i sent a clienside respawn, so i have to readd the entity for others

#

i guess i could just use that

kindred sage
#

I need some help with entity lib please dms

sly topaz
#

just ask here and wait for an answer

thorn isle
#

use libsdisguises

#

💪

#

lib has a dedicated support channel on the mythic discord

#

which i think is a shame because mythic is cancer, but he does very actively answer questions and help with the api and command usage

buoyant viper
#

i hate support thru dms

#

cos 1. usually need to send a friend request, n then 2. i forget to unfriend these ppl like 99.99% of the time

#

and now i have a friends list of 400 when i talk to maybe 3 people

tulip basin
#

Hi, I have a rather important question. If I have a plugin for eggwars (I'd be glad for a recommendation) and for example in npc I click on start, I would like it to port me to such a pre-lobby where it will wait for players, select teams, select kits etc. or how to say it and the question is whether the pre-lobby is in the plugin of eggwars or it is done separately.

Thank you for the answer

sly topaz
#

It’s fine if it is a friend, but it is just weird to take that burden for someone you barely know lol

sly topaz
tulip basin
#

yea its a devlopment question for 50/50

sly topaz
#

If that’s the case, it really can be either way, if you have found an egg wars plugin that doesn’t have a pre-lobby and want to add that feature within a separate plugin, as long as the other plugin gives you enough leeway to intervene with its lifecycle, it should be fine

#

But if you’re making an egg wars plugin from scratch, I’d just have the functionality from the get go

#

What’s good about eggwars is that you can also just take any bedwars plugin and configure it to work for eggwars lol

tulip basin
#

okay thanks

young knoll
#

Turn bed into egg

#

Sell it as a separate $19.99 plugin

knotty gale
#

I am trying to use the spigot API, and i have it in my refrenced libraries but I cannot use anything with it, like I am trying to extend JavaPlugin but its not showing up

sly topaz
jolly maple
#

https://paste.md-5.net/jibudehoci.makefile

Hello, I currently am making a minecraft plugin and I want to publish it into my maven local and when I do the publishInMavenLocal task, it works fine and it creates folder but I can't import it anywhere...

mortal hare
#

in either case you can fuck up the implementation in other places even if you did force final for getter methods

#

its just not worth to keep final methods for such things, as you can write bad algo anyways and no matter if getters are correct or not it will fail

knotty gale
#

I’m new to all of this stuff so I’ve heard of maven but I don’t know what it does or how to use it

mortal hare
#

in very rough sense maven is just a glorified java library downloader from internet

#

allows you to add libraries to your java project, by just declaring what you need inside pom.xml file and it will auto download that for you from maven central repository on the internet

knotty gale
#

Oh ok, I’m not home right now so I’ll try to set it up later

#

Is it pretty straight forward

mortal hare
#

its mostly copy pasta boiler plate

#

but you can also set up other things to do with maven, for example package your application under .jar file

#

preprocess files, like variable interpolation where you can substitute placeholders with values in files

#

its just a build tool for java

#

currently there's two popular build tools for java development: maven and gradle. Most spigot projects use maven build system, but for example Paper uses gradle

knotty gale
#

Ok ok, but js for referencing do you know what I could be doing wrong? I took the spigot jar straight from the server to add to the external library

mortal hare
#

i prefer gradle, but its easier to learn maven

mortal hare
#

and it will automatically do that for you

#

the point of maven is that you can reproduce the same builds over accross different systems, for example you can setup git repository and put it on the cloud and anyone else who clones the repository will have all the libraries downloaded that are attached to pom.xml file

mortal hare
#

note that NMS is not included with spigot-api dependency so if you depend on that you should look for buildtools tutorial

knotty gale
#

I already set up a test server with btools in it

#

I just needed to make my first plugins

mortal hare
#

i suggest you just use spigot-api dependency

#

for now as it includes like 80%-90% of what you need mostly anyways

knotty gale
#

I was following a tutorial for a simple hello world one, but I couldn’t get the spigot to work which is why I am here

knotty gale
mortal hare
#

yes, it will auto download and setup everything for you

knotty gale
#

Ok cool, is a tutorial needed to set it up or will it be real easy

mortal hare
#

thats how mostly pom.xml should look like

    <repositories>
        <repository>
            <id>spigot-repo</id>
            <url>https://hub.spigotmc.org/nexus/content/repositories/snapshots/</url>
        </repository>
    </repositories>

    <dependencies>
        <dependency>
            <groupId>org.spigotmc</groupId>
            <artifactId>spigot-api</artifactId>
            <version>1.20.1-R0.1-SNAPSHOT</version>
            <scope>provided</scope>
        </dependency>
    </dependencies>
knotty gale
#

Also what’s the difference between intellij and eclipse

mortal hare
#

those are IDE's which you use to write java code

#

assistants

#

in a sense

knotty gale
mortal hare
#

which can catch bugs

knotty gale
#

I prefer the eclipse look

mortal hare
#

Intellij is free and community version is open source

#

and its usually better

#

but it eats ram like its nothing

#

it can eat like 3GB of ram on idle on certain projects

#

due to how it indexes the whole project

#

and analyzes code

#

its heavy but nothing better is really compared to that IDE

young knoll
#

(Eclipse is also free)

knotty gale
#

I was abt to say cuz I have it installed and was using it

mortal hare
#

Eclipse also suck. Last time i've used it, extensions were broken

#

i mean official build ships with broken marketplace

#

never used it after

#

intellij is literally all you need

eternal oxide
#

works for me

knotty gale
eternal oxide
#

Eclipse is fine

knotty gale
#

Is maven different to use on eclipse and intellij

eternal oxide
#

no, just the interface

mortal hare
#

maven is a command line tool

#

but usually ide's integrate that tool with fancy GUIs

#

to make maintaining a java project less a hassle

#

by just clicking things instead of writing the commands

#

honestly i just use command line at least for gradle

#

i hate those buttons

#

at least terminal gives me consistency across different environments

#

same with git for me

young knoll
#

The gradle menus in intelij and eclipse are basically the same

#

Maven less so

mental trail
#

probably overthinking this...I have a system similar to factions and I want to have some various settings on the Faction object such as power, some misc settings such as leaf decay/future settings. I was thinking about three different options for implementing this...

option 1) in the main class, standard
option 2) map of config options attached to the option so option-id as the key and value as a string in the map
option 3) separate class for settings such as FactionSettings with the variables and getters/setters then store this in the faction class

thoughts? I was leaning towards the FactionSettings class, map seems overkill, but it allows for flexibility later on

echo basalt
#

main class IS NOT standard

mental trail
#

the Faction class having the variables?

echo basalt
#

yeah

mental trail
#

iirc that's how I saw others do it

echo basalt
#

doesn't adhere to the single responsibility principle

#

Map is the best approach as it allows for custom settings made by third-party plugins

#

Make sure your generics check out

mental trail
#

now to follow up, I was thinking about creating some classes to simplify the serialization/deserialization/validate process such as Integer setting, String setting, etc for the map stuff that would validate the input and auto convert to/from the string, would this be overkill or no?

#

so like Map<String id, Setting object which is the parent for String setting/integer setting>

echo basalt
#

eh strings

#

the way we do it at work is with a "typed key" / codec system

#

think of the following

#
public interface FactionSettingKey<T> {

  String getName();
  FactionSettingCodec<T> getCodec();

}
#
public interface FactionSettingCodec<T> {

  T decode(Container or whatever);
  void encode(Container or whatever, T value);

}
#
public interface FactionSettingContainer {

  <T> T getValue(FactionSettingKey<T> key);
  void setValue(FactionSettingKey<T> key, T value);
  ...

}
mental trail
#

gotcha so the container is the faction object?

echo basalt
#

it's separate to the faction

#

the faction tracks more than just settings

mental trail
#

oh so like the separate FactionSetting class

echo basalt
#

Yeah

#

You can then yeet all your builtin keys into a BuiltinFactionSettings class

#

or something similar to that

#

FactionSettingDefaults type deal

mental trail
#

interface enum hack?

echo basalt
#

no

#

that's abuse

#

just use a final class

#

smh he didn't read effective java 🙄

mental trail
#

I did, but it's just so convenient

echo basalt
#
public final class FactionSettingKeys {

  private FactionSettingKeys () {}

  public static final FactionSettingKey<String> WELCOME_MESSAGE = FactionSettingKey.create("welcome-message", 
FactionKeyTypes.STRING);

}
#

type deal

mental trail
#

yeah I got what you mean

echo basalt
#

it's somewhat limitless and you get to yeet it all into a map in your setting container class

#

I'd also make a value holder to differenciate between not-set and null

#

it also makes it convenient for codecs and defaults

#
public class FactionSettingValueHolder<T> {

  private final FactionSettingKey<T> key;
  private T value;

  ...
}
#

then your map is exclusively Key<?> to ValueHolder<?>

#

and the generics check out

#

I've made like a dozen systems of this style at work

mental trail
#

Yeah seems really convenient

echo basalt
#

it CAN eventually get really annoying when you start having different subtypes of Number and you need to do math between them

#

(for example adding 12% (float) to a base value of 10 (double))

#

but you can just keep going with generics until it works out

mental trail
#

Understandable, I don't think that would be an issue with factions stuff

echo basalt
#

yeah defo not with factions

#

I'm thinking more around RPGs

mental trail
#

Oh, definitely!

echo basalt
#

where you have a 35% durability modifier on an item that also stacks with whatever

mental trail
#

yeah all the rates and modifies for an rpg since there's so many xD

#

well now I get to start coding again, thanks again

echo basalt
#

cheers

mental trail
#

cheers

sly topaz
#

Illusion

#

Are you the one that made the modern way to handle inventories post

#

Oh no, that was mfnalex

young knoll
#

Pretty sure that was smile

#

?gui

trail cargo
#

what type is 1b?

#

byte? bit?

worldly ice
#

Byte

trail cargo
#

thx!

sly topaz
#

I was going to ask if there's any difference now with the API prioritizing handling of inventory views rather than inventories

knotty gale
#

whats the event when a player picks up a shot arrow? Like someone shoots, it falls to the floor and someone picks up the arrow

manic delta
#

try with EntityPickupItemEvent

knotty gale
worldly ice
knotty gale
#

thank you

manic delta
worldly ingot
#

Child of a deprecated event, so fair assumption

#

It's not deprecated though. Works fine

jagged thicket
#

@manic delta

#

is that HashMap issue fix working

knotty gale
worldly ice
#

are you in creative?

#

i know creative messes with a lot of inventory-related events

knotty gale
#

no

sly topaz
#

well you can't pickup arrows in creative either

worldly ice
#

i thought you could?

#

but it jsut didn't give you the item

knotty gale
#
   @EventHandler
    public void onArrowPickup(PlayerPickupArrowEvent event, Player player, Item item, AbstractArrow arrow) {

            getServer().broadcastMessage(ChatColor.RED + player.getName() + " picked up the basketball!");

            BHandler = player;
        }

its not broadcasting

sly topaz
#

I don't remember, it's been a while since I played MC lol

sly topaz
knotty gale
#

myf bro pls help me out

sly topaz
worldly ice
#

remove all method params except the event you're listening to

knotty gale
#

ok

sly topaz
#

it's better if they just read the wiki for it

worldly ice
#

yeah but in this case it's an easy fix

sly topaz
#

you're assuming they've properly implemented Listener for that class as well as registered the listener to the plugin manager, though

worldly ice
#

ig

manic delta
knotty gale
#

well I have a first listener that works

#
    @EventHandler
    public void onProjectileShoot(ProjectileLaunchEvent event) {
        if (!(event.getEntity() instanceof Projectile)) return;

        if (event.getEntity().getShooter() instanceof Player) {
            Player shooter = (Player) event.getEntity().getShooter();

            getServer().broadcastMessage(ChatColor.RED + shooter.getName() + " shot the basketball!");
        }
    }

This one works

sly topaz
#

unsolicited advice: there's no need to check whether the event entity is a projectile as that event overrides getEntity accordingly to only deal with projectiles. Also, since I assume you're using a newish java version, you can do instanceof pattern matching to "avoid" the cast

knotty gale
#

ok

#

also I know how to register a listener inside the main class, but how would i do so when it is in a seperate class?

rotund ravine
#

?di

undone axleBOT
manic delta
#

idk why i readed "Guice"

#

lol

knotty gale
worldly ice
#

yes

#

im assuming bukkit just won't register that handler if it has erroneous params

knotty gale
#

ok good to know

manic delta
#

@sly topaz @jagged thicket~~ wow it worked~~

#

tysm to both

#

no wait

#

i think is from my playerjoin implementation

#

💀

jagged thicket
#

brehh 💀

#

comment it out

manic delta
#

ill do it

manic delta
#

i give up

#

lol

#

ill use my playerjoin stuff

#

:sadge:

jagged thicket
#

is the same problem happening

#

even with using longs

manic delta
#

yea

#

that sucks

#

i give up

#

i was so happy to see orange there

#

then i remember that i fixed it using pjoin event

jagged thicket
#

when a problem is too cooked i give it to chat gpt

#

and do you think it is speaking the truth

manic delta
#

my brain is burned

jagged thicket
#

yah it kinda makes sense

#

Yeah i figured out the problem

#

The thing is the pets are loaded only during player join event but

#

see the pets are loaded only in playerjoin event after 20L

#

but , PlayerChunkLoadEvent is called before the 20L

#

so the initial chunks are not getting counted

#

@manic delta

#

i think the proper way to handle this is using AsyncPlayerPreLoginEvent

buoyant viper
blazing ocean
#

swing smh

#

shit that reminds me, I need to work on my BT GUI

buoyant viper
#

the weird part is like

#

it used to work

#

one version prior / the gui on my spigot account

blazing ocean
#

"actual good looking"

#

lmao

#

nice window icon

buoyant viper
#

thank u

#

i made it in GIMP

#

all of them were made in GIMP

rotund ravine
#

50$ and i’ll remake it in paint

blazing ocean
#

that's a bloody mess

#

(in a British accent)

buoyant viper
#

hardcoded blood particles for entities loosely based on what i think their blood would be

#

ie. creepers have tnt particles, nether mobs have lava particles, etc

blazing ocean
#

concern

buoyant viper
#

will i make it configurable? probably not

buoyant viper
blazing ocean
buoyant viper
#

fixed i guess

#

maybe i compiled a version without flatlaf setup and didnt realize it

#

my maven package is adding -shaded to the output name D:

#

couldve sworn i specifically disabled that..

#

I DO??

blazing ocean
#

maven moment

buoyant viper
#

clean package fixed it

#

wtf is happening

proud badge
#

if I save a Player object to a variable, then the player disconnects, can I still use player.getUniqueID() or will that not work?

paper viper
#

Maybe, not really sure. I mean it’s all sort of undefined behavior after the player leaves

#

Why not just get the UUID before

jagged thicket
#

?tas

undone axleBOT
blazing ocean
#

trying it won't help you with a bunch of UB and edge cases

buoyant viper
blazing ocean
#

I'm just making an impl of shadows designs

buoyant viper
#

mine is sadly part of the inspiration for the official

#

made the silly mistake of trying to actually use List<Integer>

#

silly me.. ambiguous calls for .remove duke

#

i could track processes with a UUID instead of an int... khajiit

quaint mantle
#

int for uuid?

#

wtf md_5

buoyant viper
#

i have a list of "processes" and i was just tracking them with an int lol

blazing ocean
#

are you currently using pids

buoyant viper
#

...yeah

blazing ocean
#

don't see an issue with that

buoyant viper
#

List#remove takes either Object or int(for index)

buoyant viper
#

and when my type is int i guess autoboxer shits the bed

#

couldve sworn ive written something like this that did work, but it honestly mightve been in C# lol

#

i think c# List uses removeAt or something

buoyant viper
#

i could name the process instead ig

#

like task-{ID}

#

or just .toString the pid itself

#

i also need to make a system that takes a snapshot of the users current config

#

bc i realized i could change an option mid-process and affect output functions

buoyant viper
#

this is autistic but fuck it

blazing ocean
#

just implement Cloneable 😭

buoyant viper
#

true

buoyant viper
#

ok it looks slightly less autistic with a copy constructor

flat lark
#

Anybody know of a good conversation api

buoyant viper
#

spigot conversation api

blazing ocean
nocturne mirage
#

Anyone wo wants to develop for some money?

young knoll
#

?services

undone axleBOT
flat lark
buoyant viper
#

had to make sure my task counter worked lol

grim hound
#

can I display a 1994x1994 bitmap?

young knoll
#

Wat

grim hound
#

well

#

you see

#

I have a txt pack

#

and a 1994x1994 bitmap

#

and well

#

it doesn't render

buoyant viper
#

might be too big

grim hound
#

orrr

#

it's some config

buoyant viper
#

doesnt minecraft have a max texture size limit

young knoll
#

The texture atlas’s are 256x256

#

So you can’t go bigger than that

grim hound
#

like wtf is the height?

grim hound
#

I see

young knoll
#

You can split it into multiple characters though

grim hound
#

never understood it

#

the wiki

#

also doesn't clear it up for me

young knoll
#

It defines how tall the character should be when rendered in game

#

Generally you want it the same as the height of the actual image or you’ll get ugly squishing/stretching

grim hound
#

good god

blazing ocean
#

the wiki used to say the max is 512x for some reason

#

had to fix that lmao

young knoll
#

Maybe the atlas used to be bigger?

#

¯_(ツ)_/¯

blazing ocean
#

nope

umbral ridge
#

is there a way to tell if player joined with a custom client? are there packets that custom clients send to the server?

eternal night
#

some clients announce themselves but like

#

obviously nothing you can rely on

umbral ridge
#

hm

young knoll
#

Ask the player nicely

#

Are you using a cheat/hacked client? [Yes] [No]

jagged thicket
blazing ocean
#

click here if you're cheating

young knoll
#

dQw spotted

blazing ocean
#

lies

jagged thicket
blazing ocean
#

no

jagged thicket
#

😱

#

bro said no

young knoll
#

Does the item model component support any kind of fallback

#

Aka if the specified model isn’t found it’ll show as a default item rather than a missing texture

blazing ocean
#

not that I'm aware of

young knoll
#

Poop

blazing ocean
#

you could use the actual fallback as the item and set the model

#

or, no, nevermind

#

that wouldn't work

young knoll
#

That’s unfortunate

#

Does custom model data default to the standard item if the custom model isn’t found?

#

I seem to remember it did but that was the old custom model data

slender elbow
sly topaz
#

what did I even say I was gonna make it in, I don't remember

blazing ocean
#

I think tauri

#

I started working on one in Tauri a while ago as well

#

Had a working version selector and runner with logs

jagged thicket
#

@ xpdz make one in electron

#

its your time!!!!

#

use your frontend skillz

#

ok fk it ima make it in electron fr

#

time to learn front end

left jay
#

can anyone explain why this happens?

chrome beacon
#

Is that a class from a dependency or the same project

left jay
#

same project

blazing ocean
#

censors github username
does not censor windows username

#

🧠

left jay
blazing ocean
#

so why do you care about your github username

left jay
#

cuz its my actual name

blazing ocean
#

if you don't want people to see that, then don't use that as your username kekw

left jay
#

yk what lemme just change it rq

eternal oxide
#

it looks like you manually imported a jar and did not add it as a dependency

#

Your IDE sees it but maven can;t

wet breach
left jay
#

,_,

#

well i just changed it

#

forgot thats how that worked

eternal oxide
#

You mean gregory?

wet breach
#

anyways not like even if people on the internet knows your name makes a difference in anything

#

I mean there is like 100+ countries

blazing ocean
#

197, +/- 10 depending on who you ask

wet breach
#

yeah, and if your named steve

#

no one is going to find you

#

there is like a million steves

wet breach
#

lol

safe beacon
#

Good evening, handsome guys!

#

May I ask how to use ProtocolLib to send particle effects to players?

#

I used the method given by the AI, but it seems like it doesn't work.

#

public static void sendFakeExplosion(Player player, Location loc) {

    ProtocolManager protocolManager = ProtocolLibrary.getProtocolManager();

    PacketContainer packet = new PacketContainer(PacketType.Play.Server.WORLD_PARTICLES);

    System.out.println(packet.getModifier().getValues());


    packet.getIntegers().write(0, 15);


    packet.getBooleans().write(0, true); 


    packet.getFloat().write(0, (float) loc.getX());
    packet.getFloat().write(1, (float) loc.getY());
    packet.getFloat().write(2, (float) loc.getZ());

    packet.getFloat().write(3, 0f);
    packet.getFloat().write(4, 0f);
    packet.getFloat().write(5, 0f);
    packet.getFloat().write(6, 0f);

    packet.getIntegers().write(1, 5);

    packet.getIntegerArrays().write(0, new int[0]);

    protocolManager.sendServerPacket(player, packet);
}
chrome beacon
#

Just use the Spigot API

#

There's no reason to use Protocollib

left jay
safe beacon
#

I want to use ProtocolLib to send particle effects to a player individually, but I haven't used ProtocolLib before.

chrome beacon
#

Use the Spigot api

#

You don't need Protocollib

#

See Player#spawnParticles

eternal oxide
safe beacon
#

May I ask for the link?

chrome beacon
#

There are a couple of overloads depending on what you want to do

safe beacon
#

But I want to use ProtocolLib to make the particle effect visible only to one player.

chrome beacon
#

Again you don't need to

#

That API method will do that

eternal oxide
#

the API allows you to send particles to one player, or the world

safe beacon
#

But the version I'm using is 1.12.2

#

And I want to try using ProtocolLib because I've heard that this plugin is very powerful.

chrome beacon
#

It is

#

but it's also not easy to use and is highly version specific

#

(depending on what packets you use)

safe beacon
#

Thank you for your help, I will try using Bukkit.

#

I tried it, and it really works.

double offsetX = (Math.random() - 0.5) * 2;
double offsetY = (Math.random() - 0.5) * 2;
double offsetZ = (Math.random() - 0.5) * 2;

// Send particle
player.spawnParticle(Particle.HEART, location.add(offsetX, offsetY, offsetZ), 0);

// Restore original location
location.subtract(offsetX, offsetY, offsetZ);
Thank you!

manic delta
#

WAIT

#

THAT MAKES SENSE

#

i dont know why did i put that 20L

manic delta
safe beacon
#

If the player.spawnParticle() method is used asynchronously, will it cause errors in higher versions?

manic delta
jagged thicket
manic delta
#

because i need a player to build the pet

jagged thicket
#

wait leme see

manic delta
#

i dont think Bukkit.getPlayer will work

#

because the player is not even there

#

i can try tho

jagged thicket
#

so do smth like pre loading the data into a temporary list

#

or map

manic delta
#

mmm

#

damn

#

let me try

#

removing the 20L part

#

maybe it works

jagged thicket
#

yeah i don't think so because the player would have loaded the chunk as soon as the playerloginevent fires

#

so race condition blah blah blah

manic delta
#

mmmm

#

lets try and then ill use that temporary list

jagged thicket
#

alright

manic delta
#

maybe i can set

#

the owner property

#

to lateinit var

jagged thicket
#

that is the problem here

manic delta
#

WAIT

#

OMG

#

removing that

#

20L

#

WORKED

jagged thicket
#

LOLLLL

#

NICEEEe

manic delta
#

orange is here

sly topaz
#

congrats

jagged thicket
#

CONFIRM THAT

sly topaz
#

lol

jagged thicket
#

yeah

manic delta
#

good damn

#

thank you guys

jagged thicket
#

LETS GOO

sly topaz
#

I did nothing but you're welcome

manic delta
#

I will never make pets again

jagged thicket
#

so the problem was that the pets were added to petsbychunk after the PlayerChunkLoad event fires because of 20L

manic delta
#

yea lmao

sly topaz
#

yeah I was following the convo

manic delta
#

i dont remember why i put that 20L lol

jagged thicket
#

i gave it to fucking chat gpt and it couldnt figure it out

sly topaz
#

could've caught that if I had actually taken the time to read the code carefully, but my eyes get itchy when I read kotlin

jagged thicket
#

then i actually read the code lmao

#

and figured it out

sly topaz
#

chatgpt was a smart move, it can do the reading for you

manic delta
#

hahah fr

jagged thicket
#

but at this point chat gpt couldnt help

manic delta
#

i moved from java to kotlin a weeks ago

jagged thicket
#

@manic delta close the paper issue lol

#

why did u add 20L anyway

manic delta
manic delta
manic delta
jagged thicket
#

Nicee cars

jagged thicket
sly topaz
# manic delta

is this some convoluted way to call me a discord kitten

sly topaz
#

why is it on spanish btw

manic delta
#

because im spanish

#

lol

sly topaz
#

makes sense

manic delta
#

damn they died

jagged thicket
#

NOOOOOOOOOOOO

#

sad

manic delta
#

i can finally make their behaviour logic

#

because this one sucks

sly topaz
#

what is the very complex tag beside the bracket

jagged thicket
#

are u gonna release this on hangar?

sly topaz
#

is it measuring code complexity by the number of branches

young knoll
#

Probably

safe beacon
#

I want to write a method
public void showParticle(Player player, Location corner1, Location corner2),
which will send a particle effect in the form of a cuboid based on these two coordinates. However, the only approach I can think of right now is:

public void showCuboidParticleEffect(Player player, Location corner1, Location corner2) {
double minX = Math.min(corner1.getX(), corner2.getX());
double maxX = Math.max(corner1.getX(), corner2.getX());
double minY = Math.min(corner1.getY(), corner2.getY());
double maxY = Math.max(corner1.getY(), corner2.getY());
double minZ = Math.min(corner1.getZ(), corner2.getZ());
double maxZ = Math.max(corner1.getZ(), corner2.getZ());

for (double x = minX; x <= maxX; x += 0.5) {
    for (double y = minY; y <= maxY; y += 0.5) {
        for (double z = minZ; z <= maxZ; z += 0.5) {
            Location loc = new Location(player.getWorld(), x, y, z);
            player.spawnParticle(Particle.HEART, loc, 0);
        }
    }
}

}
This approach may cause lag. Are there better ways to prevent multiple packet sends?

chrome beacon
#

No

safe beacon
#

There is no way to send multiple particles at once?

#

Can it be done using ProtocolLib?

sly topaz
#

I mean, the particle sending isn't the part that's gonna cause lag

manic delta
manic delta
sly topaz
manic delta
#

probably the outline

#

maybe i can implement that to my lib

safe beacon
#

I only need to draw the outline.@sly topaz

manic delta
#

i had 100% kotlin before adding bstats metrics lol

jagged thicket
manic delta
#

It's for a buyer

manic delta
#

i know it sucks thats why 1

#

i have my docs page

jagged thicket
#

7.5/10

-2.5 for no documentation

manic delta
#

Yes, not everything is documented yet

sly topaz
manic delta
sly topaz
#

but the current way you're calculating the cuboid is inefficient if you're only looking for the outline, you'd want to loop over the coordinates and only add the edges of each

safe beacon
#

This seems like a good idea. I'm thinking if it's possible to control the movement of particles to draw the edges of the cuboid, thus reducing the number of particles.

manic delta
#

fr

#

i use my lib for all my plugins

sly topaz
#

and the only way to reduce it would be to make the step/spacing bigger

safe beacon
#

@sly topazIs the spacing the distance the particle moves? How can I make the particle move?

sly topaz
#

since you can spawn particles with a precision of 2 I believe, you could spawn a bunch over a single block

safe beacon
#

Do you mean making the particles move from one location to another, thus reducing the number of particles used?

sly topaz
#

your current code spawns one every half-block, meaning it is 2 times the amount of particles if we take blocks as point of comparison

safe beacon
#

I see what you mean, reduce the number of particles along the path.

#

Is there a way to make the particles move from one location to another?

sly topaz
#

not really, no

#

some particles have a speed parameter but they don't move that much, and not every particle has a speed param

safe beacon
#

Alright, thanks for your help

knotty gale
#

when shot by an arrow in entitydamagebyentity event, how would I find who SHOT the arrow? Because I am finding what arrow hit them by getDamager() so what would it be for the arrow shooter?

young knoll
#

getDamager to get the arrow, cast to projectile, getShooter

sly topaz
young knoll
#

And then check if the shooter is an entity

proud badge
#

hi, it appears player.isInRain() returns false for when the player is in snow (its raining and player is in snowy biome), and there is no isInSnow method, what should I use?

sly topaz
proud badge
#

nvm then its a paper method

safe beacon
#

@sly topazCan I add you as a friend?

blazing ocean
#

English only and check the pins in #general

#

?services too

undone axleBOT
lavish owl
#

?services

undone axleBOT
sly topaz
blazing ocean
#

omg you know me then

young knoll
#

Who are you

blazing ocean
#

who are you

#

and why do I have you added

eternal oxide
#

stranger danger!

safe beacon
#

ok, I just want to make some friends here. I can only communicate using a translator.

plush merlin
#

Heyo! I'm kind of going insane right now xD My goal is to increase TNT knockback towards other TNT by a factor of whatever I desire. This is the code I tried to use. It detects player knockback but not TNT entity knockback. Any help would be highly appreciated

@EventHandler(priority = EventPriority.LOW, ignoreCancelled = true)
    public void TNTKnockbackEvent (@NotNull EntityKnockbackEvent e) {

        if (!(e.getCause() == EXPLOSION))
            return;
        System.out.println("We have an explosion: " + e.getKnockback().toString());
        // Increase knockback by factor provide from config
        e.setKnockback(e.getKnockback().multiply(TNTKnockbackFactor));
    }
young knoll
#

Called when a living entity receives knockback.

#

TnT isn't a living entity

torn shuttle
#

hey, is there a way to simulate a player damaging an entity with just what they have on?

#

so basically pretending a player just swung at a mob

young knoll
#

Player#attack

sly topaz
#

LivingEntity#attack does just that I believe

#

jish beat me to it

torn shuttle
#

thanks

plush merlin
sly topaz
#

there's only two scenarios where a TNT has "knockback", when a plugin artificially adds velocity and when another tnt (and I believe other explosives too) explode near it

#

for the first one, there's no easy way around that but for the second one you can probably check the damage event and whether the damage cause was explosion?

#

idk if damage event is triggered for tnt tbh

#

but if it does, you can just multiply the velocity there

plush merlin
#

alright thank ya Ima try that

vocal cloud
#

(!(e.getCause() == EXPLOSION)) to e.getCause() != EXPLOSION

#

sorry, that was bothering me

plush merlin
vocal cloud
#

I've done worse dw

sly topaz
#

check if the entity type is TNTPrimed too

plush merlin
sly topaz
#

it would make any entity damaged by the explosion get a boost if you're trying to do what I think you're trying to do lol

plush merlin
plush merlin
sly topaz
#

I don't know if tnt exploding counts as entity exploding or block exploding, ig entity

plush merlin
#

Wait but wouldn’t the velocity be 0 in that moment since they haven’t been moved yet?

sly topaz
#

kinda wack but running out of options right now lol

plush merlin
#

Wait

#

Is it possible to like

#

Make all TNT considered LivingEntities somehow?

sly topaz
#

not possible, no

#

if you are using a fork I won't mention, they got a better knockback event which includes tnts I believe

plush merlin
sly topaz
plush merlin
sly topaz
young knoll
#

"Sets or gets"

#

Final field

umbral ridge
#

refactored!

blazing ocean
# umbral ridge

gets the entity. this method may be used for retrieving the entity.

#

shocker

chrome beacon
undone axleBOT
#

"Does not working" is a useless statement. Please describe what exactly is not working, what you expect it to do, and what actually happens. If you get any console errors, also ?paste the entire stacktrace.

sly topaz
echo tangle
sly topaz
#

is there a reason you're manually removing/adding the entity?

echo tangle
#

for others

sly topaz
#

Player#show/hideEntity should do for that

chrome beacon
#

^ was about to say

echo tangle
#

o

sly topaz
#

all these methods do is literally send the entity add/remove packets so yeah

#

though I do wonder whether it removes the entity from the tracker

#

also, you want to hide the entity, change the gameprofile, then show it and only then use the refreshPlayer method I sent earlier

mortal hare
#

is there any good way to encode states into types in java or c#?

public class Chatroom {
    private readonly Dictionary<string, IUser> _participants = new();
    
    public void AddParticipant(IUser user) {
        if (!_participants.ContainsKey(user.Id))
            _participants.Add(user.Id, user);
    }
    
    public IChatParticipantContext? GetParticipantContext(string userId) {
        if (_participants.ContainsKey(userId))
            return new ActiveParticipantContext(_participants[userId]);

        return null;
    }
}

public class ActiveParticipantContext : IChatParticipantContext {
    private readonly IUser _user;
    
    public ActiveParticipantContext(IUser user) {
        _user = user;
    }
    
    public void SendMessage(string text) {
        // Ensure the participant is allowed to send the message
        Console.WriteLine($"{_user.Name} sends message: {text}");
    }
}

This code allows user to only send message whenever it is part of the chat only and it enforces validation only once.

This makes contract resistant to runtime invalid data since you can't input wrong player id in the instance through public methods (there's no Chatroom#SendMessage(string userId, string Text) because you can mistakenly input wrong data at runtime and compiler wouldnt give a damn and will just compile that successfully). with Chatroom#GetParticipantContext(string userId) you validate participant once and then you can send message safely at runtime.

This works, but goddamn its kinda expensive to trash around GC just for compile time constraints like these. I can see this as a problem with thousands of IUser objects, so this isnt optimal.

My question is there a better way to encode states and validations into types? I cant any info apart from resemblences to parse dont validate and state machine approaches of doing something like this?

blazing ocean
#

what in the fuck is that

#

is that C#

chrome beacon
#

yes

knotty gale
#
        if (event.getDamager() instanceof Player && !(event.getEntity() instanceof Player)) {
            Player passer1 = (Player) event.getDamager();
            if (passer1.getInventory().getItemInMainHand().getItemMeta().getItemName().contains("Bow")) {
                for(ItemStack i : passer1.getInventory().getContents()){
                    if (i.equals(Material.SPECTRAL_ARROW)) {
            Bukkit.broadcastMessage(ChatColor.BLACK + event.getDamager().getName() + " has hit something that isn't a player");
                    }
                }
            }
        }

Can anyone explain why nothing broadcasts

echo tangle
chrome beacon
#

No

chrome beacon
knotty gale
#

I am new and going straight off of forum research so thats prolly why

chrome beacon
#

So what's the goal here? You just want to print a messsage when a player hits someone with a spectral arrow?

knotty gale
#

the arrow marks him which is why it is important

#

I actually know that when it checks for the bow in hand it works, but I am having trouble implementing checking for the arrow

round temple
#

can someone help me? I just bought a new host bcs i played on aternos, and i want to set my old world to my new host but i cant figure it out

chrome beacon
#

Did you shoot the arrow

knotty gale
#
for(ItemStack i : passer.getInventory().getContents()){
                            if (i.equals(Material.SPECTRAL_ARROW)) {

specifically this is breaking it ig

chrome beacon
knotty gale
chrome beacon
#

Get the material with getType

knotty gale
#

ok i will try that

chrome beacon
knotty gale
umbral ridge
#

does anyone know of any api that tracks currencies and converts them, eg. eur to usd, gbp to eur, vice versa

#

need to use it in my plugin

chrome beacon
umbral ridge
#

ohh but its not free

#

XD

chrome beacon
#

It is

umbral ridge
#

really?

knotty gale
#

I tried

for(ItemStack i : passer.getInventory().getContents()){
                            if(i.getType().equals(Material.SPECTRAL_ARROW)) {

But still nothing happens, maybe it is how I am looping?

chrome beacon
umbral ridge
#

it's limited to 1000 requests per month

chrome beacon
#

yes

umbral ridge
#

hmmm

#

then i need to think of something else

#

1000 api requests could be enough only for a few days

chrome beacon
#

Why do you need to update it that often

umbral ridge
#

yeah you're right.. i could update it once a day

#

great!

#

ty olivo

chrome beacon
#

You could even do it once per hour if you wanted to

umbral ridge
#

im making a currency system and players can have different banks in the server with different currencies which is why i need a currency api (dynamically convert between currencies based on real-time exchange rates)

#

yea

manic delta
#

wtf lmao

#

I don't know how convenient that is

manic delta
#

or 12 for every 2 hours

chrome beacon
#

yeah no point in querying it that many times

manic delta
#

yeah

chrome beacon
#

Since it says it's only updated once per hour

manic delta
#

yea

#

i would update every 2 hours

ornate rapids
#

Is this from bedrock client not allowing to view items mounted in armor stand that are invisible?

manic delta
#

mmm thats weird

#

probably

obtuse charm
#

Looking for a way to give glowing effect to entity (Player or another) or block (not necessary) using only Velocity proxy.

chrome beacon
#

I recommend you head over to the Paper discord

obtuse charm
umbral ridge
#

hey how are dynamic signs done (eg.: show the player name on the sign that is looking at it)? I've done it in the past somehow, do i Need protocolLib for this? or can it be done without it

young knoll
#

Iirc there is a Player#sendSignChange

umbral ridge
#

ohhh

#

ty

quaint mantle
#

I noticed that my scoreboard is heavier than (i think) it should be, what am I doing wrong?

        Scoreboard board = Bukkit.getScoreboardManager().getNewScoreboard();
        Objective obj = board.registerNewObjective(plugin.getName(), "dummy", plugin.getConfig().getString("Scoreboard.Title"));
        obj.setDisplaySlot(DisplaySlot.SIDEBAR);
        lines = plugin.getConfig().getStringList("Scoreboard.Lines");
        size = lines.size();

        for (String line : lines) {
            if (Bukkit.getPluginManager().getPlugin("PlaceholderAPI") != null) {
                line = PlaceholderAPI.setPlaceholders(player, line);
            }

            Team team = board.getTeam("line" + size);
            if (team == null) {
                team = board.registerNewTeam("line" + size);
                team.addEntry(ChatColor.BLACK + "" + ChatColor.WHITE);
                team.setPrefix(ChatColor.translateAlternateColorCodes('&', line + "&r ".repeat(size)));
                team.setOption(Team.Option.COLLISION_RULE, Team.OptionStatus.NEVER);
            }
            obj.getScore(team.getPrefix()).setScore(size);
            size--;
        }

        if (player.getScoreboard() != board) { player.setScoreboard(board); }

    }```
https://imgur.com/a/ETyge33
manic delta
#

why dont u use a lib

blazing ocean
#

telling somebody to "just go use a lib for this" isn't good advice

#

and, without the full spark report, we can't help

manic delta
#

But it's better than reinventing the wheel

quaint mantle
#

and i couldn't find other methods than shading it so

#

ight let me send report

blazing ocean
#

reinventing the wheel isn't as bad here

manic delta
#

well

blazing ocean
#

(but are you really trying to avoid it just because it's 400kb? kekw)

manic delta
#

i guess so

blazing ocean
#

reinventing the wheel is how you learn how the wheel works and is built

manic delta
blazing ocean
#

ever heard of fastutil

manic delta
#

it add 13mb lol

blazing ocean
#

fastutil is 35mb uncompressed

quaint mantle
#

400kb isn't bad but I figured that making a scoreboard shouldn't be that hard and therefore I could save 400kb from the size of the plugin

blazing ocean
#

(you can always just library it)

manic delta
#

lmao

#

35mb

#

wow

quaint mantle
blazing ocean
#

that's just regex taking 0.06ms

#

and like, why complain about something taking half a millisecond per tick

manic delta
#

yea

blazing ocean
#

you could do that a hundred times in a tick and still have time

#

well, not much time, but you get the point

quaint mantle
#

If it doesn't cause any issues that I can fix then that's fine with me

blazing ocean
#

and also

#

?whereami

blazing ocean
#
  • offline mode
#

running a server with 150 players on windows 11 is crazy

quaint mantle
#

they're all bots

#

that's why offline mode is on too

blazing ocean
#

and why exactly do you need 150 bots online

quaint mantle
#

but yes you're right I am in the wrong discord that's my bad

manic delta
#

how do you have 150 bots

quaint mantle
#

anyways thanks

wet breach
blazing ocean
#

of course it can

#

it's just not as good for servers as linux is

wet breach
#

it is just prohibitively more expensive is all when you consider the amount of resources needed for the OS itself

#

also, it is more expensive when renting a server not because of resources but also because you need a windows license which you have to buy for every server

#

so yeah it is crazy to use windows for something like mc hosting XD

#

also those licenses expire every year and have to buy a new one

#

so a windows server renting wise is like $10.5k yearly around about

odd sentinel
#

seems like EntityChangeBlockEvent fires for sheep eating grass but the getTo is Material.AIR. I see at least one forum post but there's no real explanation on why this is. I can ignore this and just expect it's "really" dirt but is there any kind of work around?

woeful lantern
#

Hey, I might be being an idiot, but Im trying to set the CustomModelDataComponent for an item, but it isn't working

    private static final ItemStack baseMenu = new ItemStack(Material.STRING);
    static {
        ItemMeta baseMenuItemMeta = baseMenu.getItemMeta();

        assert baseMenuItemMeta != null;
        baseMenuItemMeta.setItemModel(NamespacedKey.fromString("menu_system:game_select_menu"));
        CustomModelDataComponent customModelDataComponent = baseMenuItemMeta.getCustomModelDataComponent();
//        customModelDataComponent.setStrings(List.of("\"base_menu\""));
        customModelDataComponent.setFlags(List.of(true));
          baseMenuItemMeta.setCustomModelDataComponent(customModelDataComponent);
        Bukkit.getLogger().warning(baseMenuItemMeta.getCustomModelDataComponent().toString());
        baseMenu.setItemMeta(baseMenuItemMeta);
        Bukkit.getLogger().warning(baseMenu.getItemMeta().getCustomModelDataComponent().toString());
    }```

The first logger has it working, but after I try to apply it to the ItemStack, suddenly it gets deleted?

`[00:27:15] [Server thread/WARN]: CraftCustomModelDataComponent{handle=CustomModelData[floats=[], flags=[true], strings=[], colors=[]]}`
`[00:27:15] [Server thread/WARN]: CraftCustomModelDataComponent{handle=CustomModelData[floats=[], flags=[], strings=[], colors=[]]}`

This is my first time working with the new CustomModelDataComponent, am I doing something obvious wrong? xd
eternal night
#

what is the output of /version

slender elbow
#

1.21

eternal night
#

1 ignored message this late into the night?

umbral ridge
#

youre modifying the CustomModelDataComponent that was fetched from the old ItemMeta

eternal night
blazing ocean
#

itemmeta at it again

woeful lantern
#

How should I do it without doing that?

eternal night
#

can you just paste the /version output 😭

woeful lantern
#

This server is running CraftBukkit version 4477-Spigot-e339edc-ba251cc (MC: 1.21.5) (Implementing API version 1.21.5-R0.1-SNAPSHOT)

#

(if that was to me*)

eternal night
#

okay

#

now to know which of these commits is what

#

Heh

#

yes

#

upgrade xD

woeful lantern
#

Alright XD

eternal night
#

you managed to get one of the two builds that had a regression in that area

woeful lantern
#

LOL

#

Alright welp

#

at least its been fixed hahaha

#

Thanks a lot I felt like I was going insane XD

eternal night
#

No problem PepeSalute

#

Also @slender elbow I lied, I'd never ignore you pepe_hand_heart_2

slender elbow
#

🥺

daring smelt
#

Hi, Im trying to create a 1.16.1 server but when i enter 1.16.1 into the .bat file it says (Java 8 or Java 16 (for 1.17.1 only) or Java 17?)

rough ibex
plain holly
#

does anyone know where to find server developers to hire?

chrome beacon
#

?services

undone axleBOT
undone axleBOT
buoyant viper
#

damn

#

both of us grinding the channels today

chrome beacon
#

On my phone rn

manic delta
buoyant viper
chrome beacon
#

Nice

manic delta
abstract totem
#

how do you hide attributes on armor. the HIDE_ATTRIBUTES flag is not working

odd sentinel
#

Is there a recommended lib for making “ui”s like inventory ones? I know of one but am curious if there’s any better ones

safe beacon
#

Does sending particles to a player using ProtocolLib have better performance than using player.spawnParticle();

echo basalt
#

no

#

it's actually worse

safe beacon
#

okk

odd sentinel
#

thanks, that's one I was planning on using but it errors with their basic example so I'm waiting on Matt to look into it

odd sentinel
#

unlike his command lib, the gui one errors, probably because of how my plugin bootstraps the code the gui is used from. I'm in his discord a lot because he works very closely with me on the cmd lib, so I mentioned the error to him

odd sentinel
#
Caused by: java.lang.IllegalArgumentException: class network.darkhelmet.prism.libs.triumphteam.gui.guis.BaseGui is not provided by class org.bukkit.plugin.java.PluginClassLoader
    at org.bukkit.plugin.java.JavaPlugin.getProvidingPlugin(JavaPlugin.java:427) ~[spigot-api-1.21.4-R0.1-SNAPSHOT.jar:?]
    at network.darkhelmet.prism.libs.triumphteam.gui.TriumphGui.getPlugin(TriumphGui.java:20) ~[?:?]
    at network.darkhelmet.prism.libs.triumphteam.gui.guis.BaseGui.<clinit>(BaseGui.java:71) ~[?:?]
manic delta
#

Uh

#

Are you sure it's not an error in your code?

odd sentinel
#

I just copied the example provided in his docs but as I said, it's probably something due to how we bootstrap the code this is used in. that's an uncommon scenario so he's not expecting it, hence why I reported it to him but reminded him of our setup

manic delta
#

Maybe

odd sentinel
#

his command lib works fine so I'm just waiting on his reply

wide viper
#

is there any support for removing components from items, like making an inedible poisonous potato?

obtuse charm
#

Repost: Looking for a way to give glowing effect to entity (Player or another) or block (not necessary) using only Velocity proxy.

eternal oxide
#

Velocity is not a Spigot product

blazing ocean
#

and that is also not something you do on the proxy side

#

why even

dawn flower
#

how do i get a random element in a set based on the getProbability of each one

eternal oxide
#

Don;t use a Set

dawn flower
#

sure but same question

dawn flower
#

thanks

short pilot
#

heyo! How can i make my mobs only attack players up to a designated radius from its spawn point, otherwise it just goes back?

public class TargetNonFactionPlayersGoal<T extends Mob> extends TargetGoal {
    private final T customMob;
    private final UUID kingdomID;
    private final KingdomManager kingdomManager;

    public TargetNonFactionPlayersGoal(T customMob, UUID kingdomID) {
        super(customMob, false);
        System.out.println("TEMPTEMPTEMP " + kingdomID);
        this.customMob = customMob;
        this.kingdomID = kingdomID;
        this.kingdomManager = KingdomManager.getInstance();
    }

    @Override
    public boolean canUse() {
        for (Player player : this.customMob.level().players()) {
            UUID playerKingdomID = kingdomManager.getPlayerKingdom(player.getUUID()).getID();
            // CHANGE LATER TEMP TEMP TEMP
            if (!player.isCreative() && !player.isSpectator() && !kingdomID.equals(playerKingdomID)) {
                this.customMob.setTarget(player, EntityTargetEvent.TargetReason.CLOSEST_PLAYER, true);
                return true;
            }
        }
        return false;
    }
#

i already have its spawn location stored

mortal hare
#

do you guys personally use inner or inner static classes in java?

#

or do you no matter what declare it under another file

#

sometimes it feels wrong to declare it under different file, for example iterator implementations

chrome beacon
#

Depends

mortal hare
chrome beacon
#

True

mortal hare
#

i feel general approach would be if class can stand on its own in its behaviour should have its own class, while classes which represent certain scopes or views (like iterators) should be inside the same file

blazing ocean
#

I barely use actual inner (non-static) classes tbh

umbral ridge
#

for sql, what to use? mysql-connector-java?

sullen marlin
#

wdym?

#

spigot bundles mysql and sqlite drivers if thats what youre asking

umbral ridge
#

ohh i see

sullen marlin
#

but yes that is the mysql driver

#

with sql in java the driver doesnt matter, the API is the same for all jdbc databases

umbral ridge
#

do I need it?

sullen marlin
#

no

umbral ridge
#

ok great

short pilot
#
            CustomGuard customGuard = new CustomGuard(world, kingdomID, new BlockPos((int) spawnX, (int) spawnY, (int) spawnZ));
            customGuard.setPos(spawnX, spawnY, spawnZ);
            customGuard.getBukkitEntity().getPersistentDataContainer().set(namespacedKey, PersistentDataType.INTEGER,
                    0);
#

Is this a proper way to set persistent data containers?

#

im currently using an integer to map to each different custom entity

drowsy helm
rough drift
#
final var created = container.getAdapterContext().newPersistentDataContainer();
container.set(key, PersistentDataType.TAG_CONTAINER, created);

created.set(...); // Will this save?

Will editing a container after setting it edit it or not

short pilot
young knoll
#

Make a variable for the container

umbral ridge
#

No suitable driver found for jdbc:mysql://...

#

and on top of that, I need to shade it in the plugin

sullen marlin
#

You definitely don't need to shade it

#

You may need to load it

blazing ocean
#

don't you have to Class.forName it on older versions

umbral ridge
#

now it works

#

forgot about Class.forName XD

drowsy helm
#

Im lactose intolerant

umbral ridge
#

XD

sly topaz
dawn flower
#

how do i change the light level of every single block

#

without needing a rocket science degree

young knoll
#

Invisible light blocks :p

dawn flower
young knoll
#

It gets removed

dawn flower
#

-.-

#

so like

#

now what

#

did i use my free help card or what

sullen marlin
mortal hare
tranquil pecan
#

Is the GitHub Codespace free? There’s a lot going on in its wiki—can someone explain it simply? Or is it just limited free hours, and then I’ll be charged?

blazing ocean
#

is that the name of your codespace

tranquil pecan
#

uh idk

#

Well yes i think

#

removed

#

I don't know why they give weird names

tranquil pecan
#

o.O

blazing ocean
#

?

tranquil pecan
#

So, we can use it for 30 hours per month

#

Using Intellij is better

sly topaz
#

it is a remote development environment

#

it's convenient if you don't have a good PC, or work with multiple desktops thorough the month

#

I used it at times to host a development minecraft server for example, that way I don't have to do it all on my computer lol

#

if you have IntellIJ ultimate you can connect to it, otherwise you're gonna be stuck with vscode whose java extensions kinda suck

vast sapphire
#

I’m making a guns plugin and for all guns i’m using a cross bow since it works with 3d models and looks like they’re pointing to shoot. The main problem is the fire rate, some guns have a really fast fire rate, some are slow, but when i hold down right click it’s a constant fire rate, which is slower than the fastest fire rate i have. Is there a way to speed this up in an interact event? Without using runnables since i need tap fire to work as well

unkempt tusk
#

@short pilot Hi Pvz

vast sapphire
#

it’s a private server

sly topaz
#

well, that doesn't quite make it okay but whatever lol

#

as for the question itself, you could probably just get rid of crossbows and shoot projectiles at the rate you want

young knoll
#

Max you can do is 1 per tick

sly topaz