#help-development

1 messages · Page 1007 of 1

slender elbow
#

but, the short answer is "see what bukkit does when you call setCustomName on the API"

inner mulch
#
  1. Should I have relational data (one ServerNamePlayer Object) with all the data tied to it
    or

  2. should I have a data object for each system that stores data?

  3. option seems better because then I can load only the players bans in and stop loading the data if he is banned instead of loading the full thing everytime

blazing ocean
#

imo a mix of both

#

generally go with 1. but maybe have a way to get specific data

inner mulch
#

okay

blazing ocean
#

in this case you might wanna have a class which handles the bans

inner mulch
#

alr

#

java just wants to see me lose 😔

blazing ocean
#

but have you tried giving it a capture of ?????????

shadow night
blazing ocean
#

what is t anyway

shadow night
inner mulch
#

type erasure >:(

blazing ocean
#

i know what it is lol

shadow night
blazing ocean
#

[object Object]

shadow night
#

NOOOOOOO

#

Anything but that

blazing ocean
#

hehe

#

get js'd

worthy yarrow
#

You can have multiple rp’s on a server without conflict correct?

kind hatch
#

For the most part yes. There are some cases where depending on what the pack does, that it can cause some interference with other packs.

worthy yarrow
#

I’m just looking for custom models on some blocks

kind hatch
#

Should be fine with just that then.

worthy yarrow
#

How does the pathing work in relation to code? I’ve never messed with rp’s before if you’ve got a resource I can go off

blazing ocean
#

blocks don't support custom models

worthy yarrow
#

Oh hmm

blazing ocean
#

and you don't set the model directly

worthy yarrow
#

Well the idea was models for elevator blocks based on what player used for crafting them

blazing ocean
#

that's handled by CustomModelData

#

you can try item displays with custom models

worthy yarrow
#

Hmmm I’ll have to figure a good movement emulator of sorts to fit a proper elevator

#

Sucks I can’t just do it with blocks

#

Anyways thanks!

charred blaze
#

do itemdisplays have their own holograms? or do i have to do passengers thing

slender elbow
#

I mean you can set a custom name on them

#

it won't be as flexible as a proper text display however

storm crystal
#

why is my data appended in a wrong order?

#

instead of common, uncommon, epic its uncommon, common, epic

tardy delta
#

there are no ordering guarantees

young knoll
#

Depends what it is

acoustic pendant
#

Hey, so i'm setting a world autosave off but it is still getting saved :

lilac dagger
#

that disables autosave

#

i think this save is something else

mellow edge
acoustic pendant
acoustic pendant
mellow edge
#

ah

lilac dagger
#

u might need to look in the nms

mellow edge
#

I can tell you how I did it if you want (system)

lilac dagger
#

check the error

#

and see where it leads

acoustic pendant
#

nms actually

acoustic pendant
mellow edge
#

nope

acoustic pendant
#

can i see?

mellow edge
#

what exactly

acoustic pendant
mellow edge
#

I don't even disable auto-saving

terse sail
#

where can i find the api for 1.20.4?

#

i can only find a download for the 1.20.6 dependency

mellow edge
#

I just unload the whole world at the end and erase it from disk

acoustic pendant
#

every 5 minutes actually

mellow edge
#

well I think

#

are you trying to disable auto-saving so that this exception wouldn't ever happen?

acoustic pendant
#

No, i disabled auto save before knowing this error happened

mellow edge
#

I recommend you to figure out what is causing the exception instead of trying to disable auto-save

acoustic pendant
#

hmm

#

there is a WorldSaveEvent right?

#

What if i setCancelled it?

mellow edge
#

can you successfully join your temp world?

acoustic pendant
#

yea, i can join it

mellow edge
#

hmm

#

that sounds like permission error (on your OS) honestly but I am not sure

young knoll
#

I prefer to delete them on startup

#

Because deleting them on shutdown won’t work if the server crashes

mellow edge
acoustic pendant
#

uuh

mellow edge
#

it is indicating NoSuchFileException, but I don't know why, since the error isn't caused by your code

acoustic pendant
mellow edge
#

depends on what you are trying to do

#

this event cannot be cancelled

acoustic pendant
#

Oh, true

mellow edge
#

are you doing a recursive copy of your original world directory and correctly register the world to the server?

acoustic pendant
#

I think so

mellow edge
#

I haven't seen your code so I can't really find the cause

acoustic pendant
#

to see i mean

teal oracle
#

which one of these two should i use?

p.sendMessage(ChatColor.translateAlternateColorCodes('&', "&8[&9☽&8] &7Discord: &9&nlink"));

p.sendMessage("§8[§9☽§8] §7Discord: §9§nlink");
young knoll
#

Top one

acoustic pendant
#

mb

young knoll
#

I mean ideally you’d use the enum constants but yeah

teal oracle
#

is that the ChatColor.GRAY things?

young knoll
#

Yes

quiet ice
#

ye, darn it - got sniped

grim hound
#

does anyone have inventory types mapped into ids on different server versions?

sullen marlin
#

?xy

undone axleBOT
grim hound
#

inventory id required

#

inventory id change depending on version

#

me sad

#

I just wanna send anvil

#

but it break

#

somewhere like 1.20-1.20.2

sullen marlin
#

Why can't you createInventory and openInventory

grim hound
#

1.20.3

grim hound
#

I'm doing some uncanny stuff

#

and I cannot let the player invoke any player events

#

so I cancel every packet except keep alives

#

so I gotta do the gui stuff myself

#

and everything

young knoll
#

I remember having issues with using the api for anvil inventories

grim hound
#

except this inventory id stuff

#

works

young knoll
#

I don’t remember what it was tho

grim hound
grim hound
#

and needs to be sync

mellow edge
grim hound
acoustic pendant
grim hound
#

like casting the inventory

#

not working

#

or AnvilPrepareEvent not activating for virtual inventories

#

stuff like that

young knoll
#

Ah yeah

#

Couldn’t get the text Input from it

grim hound
#

ye

mellow edge
grim hound
#

md

wet breach
grim hound
#

is there a way to harvest the id from the server

#

?

grim hound
#

basically

#

I stop all events from firing

#

even join and stuff

#

except async pre login

#

so that when a player joins and isn't logged in

#

(since it's a login plugin)

wet breach
#

player can't join if you stop the packet of joining

grim hound
#

and this creates problems with other plugins

#

so if I delay the join event

#

until he logs in

#

no problems occur

grim hound
wet breach
#

you can't delay the join for very long

grim hound
#

I just stop the events

wet breach
#

if you do so they disconnect

grim hound
#

no

#

I'm not

#

removing packets

#

just events

#

and packets FROM

#

the player

wet breach
#

can you talk in complete sentences

grim hound
#

no

wet breach
#

this isn't twitter

grim hound
#

I feel offended

#

and I don't use XXXXXXXXXXXXXXXX

grim hound
#

it's almost as if it was designed to be easily replaced

#

very comprehensive design I must admit

wet breach
#

ok even if you remove events, you can't delay certain events. Join is one of those, if that event or packet is delayed for too long the player will disconnect

grim hound
#

the server sends all

#

packets

wet breach
#

alright, whatever continue with your weird login plugin

grim hound
#

how do I get the inventory type id for each version tho

wet breach
#

the id doesn't change for each version

grim hound
#

I can't even map it since it doesn't show what versions they were

grim hound
wet breach
#

that makes no sense

grim hound
#

in 1.20.3 when crafter was added

wet breach
#

and I doubt that

#

yeah when an inventory type is added the id's can change

grim hound
#

bruh where does this confidence come from?

#

You haven't ever probably looked at this

#

and yet you speak with full confidence

#

to a guy that just spent 4 hours reading this stuff

wet breach
#

I been around since practically the beginning of MC

#

so I spent more then 4 hours on this

slender elbow
#

only 4 hours?

grim hound
#

what?

#

restarted

grim hound
#

for any longer than that

grim hound
wet breach
#

I am not saying id's never change, just it doesn't make sense they change every version. You only need to know the versions where an inventory type was added as well as the organizing versions. Just look at the MC wiki for all the versions list and changes to find the relevant versions you will need

grim hound
#

from what I can see you don't even understand what I say

wet breach
#

you said they change often

grim hound
#

Just look at the MC wiki for all the versions list and changes to find the relevant versions you will need

wet breach
#

I guess you can't read

#

my bad

grim hound
#

go on

slender elbow
#

honestly I don't even understand what you're trying to ask

grim hound
#

show me

wet breach
#

so they can map them

#

but they don't know how to figure out what those versions are

grim hound
wet breach
#

I guess reading the change log on the MC wiki between versions is not good enough like I suggested

grim hound
#

I don't even have the strength to tell you

#

just how restarted you are

quiet ice
#

Unfortunately NMS is far beyond my expertise so can't help you there

grim hound
#

so I'm going to sleep

#

and just so you know

#

I'm not going to curse you

#

and will simply ignore you from now on

quiet ice
#

I'm not entirely sure why one would ignore frostalf though

grim hound
wet breach
#

I don't understand how it is you can't read the inventory types from the change logs

grim hound
#

like this

wet breach
#

like do you not know what is or is not an inventory type?

grim hound
#

goodnight

grim hound
#

the changes could've been applied later

wet breach
#

what did you look at?

grim hound
#

and not all mapped

quiet ice
#

frostalf is not talking about the wiki.vg wiki

#

they are talking about the different wiki (https://minecraft.wiki/ methinks)

grim hound
wet breach
#

yeah I am not talking about the protocol wiki

wet breach
#

and the changes

#

find all the ones that introduce a new inventory as well as any versions were re-organizing/optimizing took place

#

then use wiki.vg to find the relevent protocol versions that match those versions

quiet ice
#

You probably can use NMS to extract the data for the current minecraft version

wet breach
#

quite possibly, but that would require decompiling all the relevant versions, which eventually would be done I suppose

quiet ice
#

At worst you'll do it by creating a bunch of dummy packets and sending them down a dummy pipeline - then dissect those packets.
Is it a bunch of unnecessary work? Sure. But would it work? I think?

young knoll
#

Id just check the source for each version

quiet ice
slender elbow
#

I find it kinda funny the person that allegedly spent hours tryna figure out different ids in different versions also failed to do so on the source of information that presents that

wet breach
#

I mean they are opting for the most difficult solution when there is far easier ones XD

quiet ice
#

I mean last time I've talked to them they were writing some kind of elaborate firewall - so my assumption is that they won't allow connections with the "wrong" protocol version.

That being said it could very well be possible that this is a fully new project

wet breach
#

I understand wanting to block stuff, but like you can just make an auth void world and just have them stand on a single block

#

if they are able to do anything, like what are they going to do there?

#

XD

wet breach
#

pretty sure this was talked about like a month ago

quiet ice
#

oh, it feels much more than that

#

but yeah, we had that discussion

slender elbow
#

you'd think that a firewall would be before the machine altogether to prevent the kernel from even initiating a tcp connection

#

but oh well

wet breach
#

ideally yes

#

but even if you have a software firewall, it needs to be separate from the application you are trying to protect XD

quiet ice
#

I'd guess they probably used the wrong word when describing the plugin but instead they want to do some anti-bot plugin.
In which case the inventory things are probably needed for some kind of captcha?

Though you probably can do that as a proxy plugin but who knows?

#

Anyways, I urgently need to go to bed. It's way past my bedtime - no wonder I'm feeling so tired right now

teal oracle
#

why doesnt this work?
Inventory inv = Bukkit.createInventory(this, 9, "Server Selector");

#

Cannot resolve method 'createInventory(ManaCore, int, String)'

young knoll
#

The first argument is the holder

#

I usually just use null tho

teal oracle
#

ohh

#

thanks

#

with holder do they mean like the player or something then?

sullen marlin
#

Yeah player

teal oracle
#

ok thanks

patent coyote
#

is their any way to change the display name of a potion effect?

quaint mantle
#

if i use experimental data packages in my spigot server i got some issues ?

young knoll
quaint mantle
#

yes

#

if i ask for 1.19.4

#

u guys was help me ?:D

young knoll
#

What

quaint mantle
#

i mean

patent coyote
quaint mantle
#

1.19.4 isnt supporting

young knoll
#

Data driven potion effects will happen one day 😩

quaint mantle
#

🙏

#

Just imagine being able to slowly animate an entity (such as block display) by using the same css rule you would use to animate a text

young knoll
#

Ew css

quaint mantle
#

😔

#

Why "ew"?

patent coyote
young knoll
#

I just don’t like doing css

#

Am I just bad at design? Probably

quaint mantle
#

I'll just make as I didn't see that

#

if i use experimental data packages in my spigot server i got some issues ?

quaint mantle
#

And answering to that, yes, you might get some issues by using experimental data packages

#

That's why they are tagged as "experimental"

young knoll
#

Idk if they are talking about the 1.21 pack or third party packs

#

¯_(ツ)_/¯

quaint mantle
#

i mean

#

spigot is supporting edp ?

#

Spigot is a (fork?) of Bukkit, which at the same time is an (extension?) to Minecraft

#

So I think so

young knoll
#

Yeah they work

#

No guarantees they will work across versions though

quaint mantle
#

?paste

undone axleBOT
quaint mantle
#

btw if i code a plugin for 1.20
can i use this plugin in my 1.19.4 with edp server?
i wanna use camels and i wanna do something with camel features

#

Yooo

I'm trying to run a Kotlin Multipatform app, but I get this error
JDK 17

Is the JDK related to the issue?

import androidx.compose.ui.window.Window
import androidx.compose.ui.window.application

fun main() = application {
    Window(
        onCloseRequest = ::exitApplication,
        title = "ExampleProject",
    ) {
        App()
    }
}
quaint mantle
#

If the plugin you coded for 1.20 uses API which was introduced in 1.20, it won't work.
If your plugin relies on NMS or Reflection (two ways of doing the same), it won't work

hazy parrot
quaint mantle
hazy parrot
#

That is an Android app

quaint mantle
#

But in the multiplatform setup I selected all apps, including desktop

#

I mean

#

I'm trying to run the desktopMain sub-project

remote swallow
#

if its a desktop app why are you using andriodx classes

quaint mantle
#

It's what the Kotlin Multiplatform setup give me

hazy parrot
#

So u have solution

quaint mantle
#

Yes

quaint mantle
#

can we change hologram sizes ?

#

idk how works holograms maybe with armor stands ?
but i saw hologram in some server

#

they are huge

kind hatch
#

Those are display entites.

#

Specifically a TextDisplay

quaint mantle
#

can we change sizes ?

#

bcs i saw first time

muted otter
#

I created a library that registers a listener in it. However, in my plugin that uses the library, the listener is registered twice. Once because of the library, and again because it is using the library. How do I fix this?

kind hatch
quaint mantle
#

or 1.20+?

kind hatch
#

Display Entities were added in 1.19.4

wintry elk
#

is there a new entitytype name for primedtnt for 1.20.6?

kind hatch
wet breach
#

however in either case holograms are resizable whether its the armorstands or display entities

#

I should probably make a new plugin to mess with display entities though as I haven't done that yet

eternal oxide
#

I messed with ItemDisplays, but I've yet to overlay them with an Interaction passenger

young knoll
#

You can’t resize the name of armorstands

wintry elk
eager turtle
#

Pretty sure its just TNT now but could be wrong

kind hatch
#

It is.

eager turtle
#

TNT is only ever an entity when its primed, so the primed part is redundant

wintry elk
#

yeah but when i use tnt i just get an error

eager turtle
#

Did you just update to 1.20.6? It causes major issues with imports for me but i got it fixed

wintry elk
#

i think so because i was using 1.20.4 before

eager turtle
#

Yep

#

1.20.4 -> 1.20.6 was a disaster to fix but ill share the thread I posted

#

Hope this helps man

#

Also i ended up using jdk 21 instead of 22 i think. Id have to double check

kind hatch
#

Should probably stick with Java 21 as it's an LTS release.

eager turtle
#

I have a pretty involved development question that would be alot to type out. It involves somehow attaching a custom Enum to a damage event for an entity. So later I can retrieve that Enum on death. The Enum stores the special weapon type a player was using. For example i have a kit that when you drop a sword it launches other players away with a gust of wind. Right now i just call victim.damage(1,killer) (which triggers a damage event) and then in the damage event i grab the killer i atached and store it in a lastDamagedBy field for the victim. So my issue here is that I need to also store my Enum for “GUST_SWORD” somewhere. I could just make a another field for lastDamagedByWeapon and for the victim and save it there but I am trying to make this work with all LivingEntity types and I really dont want to have to create container for every single LivingEntity aswell just to store a field for the lastPlayerToDamage and lastDamagedByWeapon.

#

Sorry for the wall of text. But basically I am down to hop in a call if someone can help me or if you prefer to type it out thats cool with me aswell

eager turtle
#

Can you attach that to events?

drowsy helm
#

just attach a tag to the entity's pdc and read it on death

eager turtle
#

Ive only used it for items

#

Oh yo I recognize you from spigotmc you helped me with something else haha

#

So in the gust of wind method for every entity it hits I can just attach a PDC to it and say the player who attacked them and the weapon they used?

drowsy helm
#

correct

eager turtle
#

Damn see i knew there was a better way

drowsy helm
#

yeah trying to work around the event would be a pain in the ass tbh

eager turtle
#

I was legit thinking of creating a container for every livingentity on the server

#

Could i also attach a time of the attack in the PDC, then check it with the current time on death to see if its within say 10 seconds i count it as the players kill?

drowsy helm
#

yeah absolutely

eager turtle
#

Yo md_5 is typing

drowsy helm
#

anything that can be stringified

#

can be a pdc

eager turtle
drowsy helm
#

just keep in mind if the player hits the enemy then runs away, it will stay in the pdc

#

so you could have a timeout value or smth

eager turtle
#

Cause i was like well would i store the UUID on entity spawn or when they first get attacked by someone to conserve space

#

Yeah thats what i was saying with the time of attack being stored

#

So when they die i can check if its within like 10 seconds

#

Dang dude so helpful god i couldnt sleep last night i was going in circles trying to figure this out

drowsy helm
#

Lol it’s like that sometimes

eager turtle
# drowsy helm so you could have a timeout value or smth

Is there a better way to do a timeout value than what im thinking? Like make a delayed runnable after 10s just remove it? But i guess another player could attack within those 10s and it would remove the new entry assuming im using the same key value for every attack

#

The PDC is like a hashmap right? Or does it make a new entry for every time you put something in it

drowsy helm
#

Yeah it’s just a fancy hashmap pretty much

eager turtle
#

Sweet

drowsy helm
#

I would just keep a time value for last hit then check if it’s within bounds on death

#

No need for a runnable

eager turtle
#

Shoulda been using this all along thanks

#

Along the same topic, when i use entity.damage() i believe it ignores armor/enchantments/etc. Is there a way to have it not? Or a diff method?

eternal oxide
#

you don;t have to damage the entity to trigger a damage event

#

fire it yourself

eager turtle
#

Yes i know but i want to inflict damage with this wind spell

#

But i also want higher levels of armor to protect against it better

eternal oxide
#

Then no, the damage you apply ignores all defences

eager turtle
#

((CraftPlayer)player).getHandle().d(DamageSource.GENERIC, 5f);

#

I found this on an old thread from 2016, they said it accounts for armor and stuff but figured youd all know more

#

Using nms

kind hatch
#

?mappings

undone axleBOT
drowsy helm
eager turtle
drowsy helm
#

The code snippet you sent is unmapped nms

#

He just sent the site to find the equivalent mapping

eager turtle
drowsy helm
#

Nms will have still like e.df().j or some shit

eager turtle
#

also for the PDC thing, would it be fine to use like 4PDCs per entity for each variable? or better to use one PDC and put one string in and deconstruct it?

#

ohhhh

drowsy helm
#

Do you mean pdc entry

#

?

#

An entity can only have one pdc

eager turtle
#

are pics not allowed in this server i cant upload

drowsy helm
#

?img

undone axleBOT
#

Can't send images? That's because you're not verified! Use !verify to complete verification.
Alternatively, you can upload screenshots to any image hosting site and share the link.

Here's some screenshot utilities that you can use to upload images.
Lightshot: https://prnt.sc
Imgur: https://imgur.com/upload
Flameshot: https://flameshot.org

eager turtle
#

i see doing that now sorry

eager turtle
#

guess i mustve verified it on a different discord already

#

this is what im talking about with the PDCs ^^

drowsy helm
#

Img isnt loading for some reason

eager turtle
#

i think that may be better than using comma seperation for my fields dunno

grim hound
#

Can someone point me to the code where the serverside packet compressor is?

#

The netty handler

#

Should be named like "minecraft-compressor"

eager turtle
#

!verify vanabyte

undone axleBOT
#

A private message has been sent to your SpigotMC.org account for verification!

eager turtle
#

okay sweet im verified. this is what i was talking about @drowsy helm

#

but like Elgar said theres a list type

drowsy helm
#

I wouldnt use a list for that

eternal oxide
#

not just for 2

drowsy helm
#

Regardless of size, they arent the same variable. List would make sense if it were multiple players or smth

eager turtle
#

so it would be better to just do a comma seperated string?

#

one PDC per entity?

wet breach
#

if so, just stick with a normal hashmap and a task

#

not sure why pdc would need to be introduced for such things

eager turtle
#

yes temporary that will be updated pretty often, everytime they are attacked

wet breach
#

yeah, pdc is designed for persistent data, not temporary

#

and everything about it is not ideal for such things

#

you are better off making a player wrapper, hashmap and some task

eager turtle
#

i have that for my players already and it works fine. im trying to come up with a better system for all LivingEntities

wet breach
#

it works fine, but some how its not good enough?

eager turtle
#

for players, i dont want to create a wrapper for every single entity

wet breach
#

seems you are looking for a problem that doesn't exist =/

eager turtle
#

bruh

wet breach
#

and it wouldn't need to be for every single entity, you can have one for players and one for living entities, don't think you need more then that

eager turtle
#

well yes but still thats alot of living entities

wet breach
#

you can distinguish the entity easily of what it is by evaluating properly

eager turtle
#

constantly spawning and despawning

wet breach
#

sure, not sure what the issue is

eager turtle
#

idk just trying to be a smart programmer haha that seemed like it would clog up the garbage collector

wet breach
#

if your GC is tailored properly it shouldn't be an issue

eager turtle
#

like 50 players in a survival world with maybe 20 living entities spawned around them at a time. thats around 1000 instances

eternal oxide
#

It sounds like your data only needs to persist for 10 seconds. No point in PDC at al

eager turtle
#

so i was saying, maybe i should only create an instance if the player attacks the entity in the first place, instead of on spawn

wet breach
#

you can absolutely use PDC if you want, however because it is persistent it gets saved every so often and since your data isn't permanent this is actually not optimal and you are just causing more work for the server

eager turtle
#

but my issue with that is what if they deliver a single kill blow and the death event happens before the damage event, and i dont have a wrapper set up yet

eternal oxide
#

add to HashMap when hit with the timestamp

#

death never fires before damage

wet breach
#

temporary data should only remain in memory this way it can just vanish with ease 🙂

eager turtle
#

i use PDC for the special weapons players carry, those are more persistent at least

#

maybe changing a couple times per session

wet breach
#

that is more appropriate use of it I agree

eager turtle
#

so what do you think, wrapper that gets created on attack or on entity spawn?

#

or hashmap

wet breach
#

Well I don't know what data your keeping track of, but the handiness of a wrapper is you can store that data on the object this way when you fetch said entity or player from the list, you can just call the relavant method on the object instead of having like 2 or so hashmaps or lists

#

if you are keeping track of damage, the wrapper only needs to exist as long as the entity is alive or the player is on the server

echo basalt
#

oh yikes you're doing damage tracking in pdc

wet breach
#

entities disappear when chunks go away, so this means the wrapper can go away too

eager turtle
#

yeah and theres a despawn event right

#

ill just do it on spawn and despawn

echo basalt
#

EntityRemoveFromWorldEvent or something

wet breach
#

not sure if a despawn event happens for a chunk unload

echo basalt
#

might be paper only

wet breach
#

but good news with the wrapper you could easily just check your entities locations with that of the chunk that unloaded

#

so not like overly difficult in that type of check

echo basalt
#

Store the entity id on the wrapper

wet breach
#

exactly

echo basalt
#

Periodically check if the entity is not null and its chunk is loaded and it's not dead

#

Or just use events to make sure that's always the case, both options work

#

But yeah not only should you make a wrapper for the entity, but also for the entry :)

#

I wrote this at work like 12 hours ago

eager turtle
#

Yeah thats what i was thinking

#

oop is great haha

#

this is a dumb question, but how do you forceably remove an instance in java?

echo basalt
#

not really possible

wet breach
# eager turtle yeah and theres a despawn event right

when it comes to optimizing, you need to learn only optimize stuff that is known good practice in code, like some cleaning up. But for other stuff like bogging down GC don't start optimizing without first doing some profiling. If the GC is tailored well enough and same with the JVM, you really shouldn't be encountering issues until you have like hundred thousand or so living entities

echo basalt
#

You just remove every reference to it and the GC will do stuff

eager turtle
#

ah okay gotcha

wet breach
#

the only way you can force remove something and its not really guaranteed is nulling out

#

there needs to be no reference, but nulling out something helps sometimes not be a reference anymore

#

but if you are having to do that, probably should look into that design flaw

#

I personally null out stuff I know I am not going to use anymore but that is just a habit from using other languages and not something you really should have to do

eager turtle
#

so i create my player wrapper on join like this, when I make a new instance I add them to a static <UUID, Fighter> hashmap so i can retrieve the instances wherever in my code. When I call fighterLeftServer(), I dont actually remove them from the hashmap (just upload their stats to database and stuff) but you guys are basically saying i should remove them from the hash?

#

this is unrelated to the damage tracking i already have this done

blazing ocean
echo basalt
blazing ocean
echo basalt
#

The map shouldn't be static either

wet breach
echo basalt
blazing ocean
eager turtle
wet breach
#

be careful with making maps static

#

they don't quite work the same when you do it that way lol

echo basalt
#

There's also the thing of having a single point of entry

eager turtle
echo basalt
#

When you have a manager class and encapsulate the map you get the benefit of being able to do input validation and all that good stuff

blazing ocean
#

like in general

eager turtle
#

yes yes i know haha i used to be a static abuser

wet breach
#

not sure why you would make it a private static

#

kind of defeats the purpose of making a map static

blazing ocean
echo basalt
#

??

#

Not a good argument

wet breach
#

well I don't use kotlin

blazing ocean
#

also i just remembered objects are singletons so nvm ig

echo basalt
#

In this case the whole damage tracker would look a bit like this

wet breach
#

looks a lot better, is this kotlin?

echo basalt
#

It is

wet breach
#

I thought so with all those fun's

echo basalt
#

I am not having fun

wet breach
#

lol

blazing ocean
#

yeah i just have something like this

object PlayerUtil {
    private val nameTagEntitiesMap: MutableMap<UUID, TextDisplay> = mutableMapOf()
    var Player.nameTagDisplay: TextDisplay
        get() = nameTagEntitiesMap[this.uniqueId]!!
        set(value) {
            nameTagEntitiesMap[this.uniqueId] = value
        }
}
blazing ocean
echo basalt
#

that's still dumb and should be a manager / tracker class

eager turtle
echo basalt
blazing ocean
eager turtle
#

no its not you its me

#

i have refused to take the time to learn optimized syntaxs i just kinda cave man it

#

but im getting there

echo basalt
eager turtle
#

the static abuse hurdle was a big one to get over

#

yeah thats way more readable for me

#

do you have anything for doing the chunk unloading checking?

echo basalt
#

no thumbsup

eager turtle
#

ive honestly never had to deal with that, is there a direct method for every entity

echo basalt
#

ChunkUnloadEvent

#

getEntities

#

bim bim bam bam

eager turtle
#

ah okay simple enough

#

asn just to clarify lol

#

it would be a bad idea to attach a register ChunkUnloadEvent listener to every entity wrapper

echo basalt
#

yes

eager turtle
#

one listener then delegate to entity wrappers? Or just directly remove the entity

echo basalt
#

It's overall "a bad idea" to register and unregister listeners in runtime

eager turtle
#

yeah i have them all onEnable

echo basalt
#

One listener that calls the "tracker"

#

then the tracker does shit

eager turtle
#

gotcha

lilac dagger
#

if you want to do it still, it can be done

echo basalt
#

don't

#

no shitty ideas on my watch

lilac dagger
#

it doesn't have a huge performance impact from what i saw

#

don't you have a phase game engine, how are you handling listeners then?

eager turtle
#

yeah i think im going to attach a movement listener to every entity and make it do 6 nested for loops on every event

blazing ocean
echo basalt
eager turtle
# echo basalt then the tracker does shit

sorry just to clarify but when the chunk unloads or the entity dies, we do the tracker shit if necessary then when we know the entity is forsure gone we just do the remove() method from the hashmap right

#

that should be okay for garbage collector

echo basalt
#

Pretty much yeah

eager turtle
#

sweet

#

is there some way i can save a place on discord to come back to later. i guess i could just type a message and find it again

echo basalt
#

VANA SEARCH INDEX - static aboose

#

:)

eager turtle
#

perfect

echo basalt
#

Just search for those 3 words

eager turtle
#

got my very own hashindex for a discord

echo basalt
#

you should see mine o_o

eager turtle
#

thanks for all the help you guys are the best!

echo basalt
#

yo @wet breach I got a proposition

wet breach
#

o.o

wet breach
#

if left inactive for too long it disappears though

echo basalt
#

Like sure geyser can translate the armorstands and shit but bedrock has a native system for that

wet breach
#

as far as I know, but I haven't messed with bedrock

echo basalt
#

Problem is, geyser's api is dogshit and doesn't give you context of anything if you're running a proxy

eager turtle
# echo basalt

Just taking a closer look at this, is your register() method just something you pass the event into from an outside Listener class? Or is the “register” a special keyword for something

echo basalt
#

So we need a proxy plugin and some communication

echo basalt
echo basalt
#

I can provide a bunch of code

wet breach
#

I am not sure how bedrock plugins work and what you could pass along

#

or what would need to be necessary o.O

echo basalt
#

It's a spigot plugin

#

o.O

#

I can guide the project

#

I just could use a little help :)

wet breach
#

I can try helping, but as I said bedrock is the one thing I have practically not touched lmao.

eager turtle
echo basalt
#

But for other plugins yeah just a single instance

eager turtle
#

Oh oh i see thats interesting

#

So i could actually have one per world if i have two worlds

#

Youve given me some ideas

echo basalt
#

Yeah but if the entity crosses a portal then all their data is lost

eager turtle
#

Yeah, just a thought cause im working on a minigame and it would be better to have it seperate

#

Not like actual overworld and nether

#

I meant moreso like gamemodes

wooden frost
#

Hello everyone :D, i have a question, do you have a good guide on how to add custom enchantments (1.20+) without any dependencies (ofc if it's possible) .

quaint mantle
#

Idk if it's still the same
https://www.youtube.com/watch?v=EVDUIivW7MQ

But that's how you do it

In this episode, I show you how to make custom enchantments in Spigot 1.14. There are a lot of different steps involved, so you need to pay attention closely. I demonstrate how to make two separate enchants, the glow enchant and the hemorrhage enchant.You will find no other resource that can help you do this, so a lot of hard work was put into ...

▶ Play video
still ridge
still ridge
#

is it possible to change the block state ou the block data of a block ? and if yes how because I try to change it but nothing change :/

vast ledge
#

block#setData afaiak

#

afaik**

still ridge
# vast ledge

yes, but as I was saying, when I do that, the block data doesn't change, it remains a CraftBlockData and not my CustomBlockData.

vast ledge
#

What are you trying to achieve?

still ridge
#

make a custom block

vast ledge
#

afaik mfnalex made a lib for that

valid basin
#

Does someone have a good simple anti piracy system that compliant with spigotmc rules?

#

For example a command where a developer of the plugin can see what user downloaded the plugin or disable the plugin if it's pirated

crisp acorn
#

hey I will want to make a invsee command with the off hand and the armor but I have a issue. there a lot of event that change the inventory moreover the inventory is update one tick later after the action is made that is produce some duplication bug. can somebody know how to make a good invsee without these issue.

vast ledge
charred blaze
#

im starting to get useless error messages in some of my plugins. console is empty . i have tried surrounding with try execption but it still doesnt show the errors.

blazing ocean
#

console should never be empty when you get an error

warm igloo
#

how do i fix the remapper throwing "Unsupported class file major version 65" during compile? My net.md-5:specialsource-maven-plugin is using 1.2.5 and im using java 21

chrome beacon
warm igloo
# chrome beacon Are you sure it's the remapper

pretty sure
[ERROR] Failed to execute goal net.md-5:specialsource-maven-plugin:1.2.5:remap (remap-obf) on project Aurum: Error creating remapped jar: Unsupported class file major version 65 -> [Help 1]

charred blaze
chrome beacon
warm igloo
#

that worked, ty

chrome beacon
drowsy helm
chrome beacon
#

Remove whatever that is and try again

eternal oxide
#

however, you can't duel yourself

charred blaze
charred blaze
charred blaze
eternal oxide
#

you didn't return true at the end of yoru command?

young knoll
#

Returning false should print the usage message not an error

eternal oxide
#

eventually he'll check his variables and see something is null

blazing ocean
#

at leas tlike

#

show your code

charred blaze
#

i was trying to add this sender.sendMessage(String.format("You have %s", BettingSystem.econ.format(BettingSystem.econ.getBalance((OfflinePlayer) sender))));

glad prawn
charred blaze
eternal oxide
#

throw new RuntimeException(e);

#

you are just hiding the actual error behind another

charred blaze
#

with/without doesnt work

eternal oxide
#

look in your server logs, there WILL be a stacktrace

charred blaze
eternal oxide
#

remove the try/catch and see what the actual error is

blazing ocean
#

paper

eternal oxide
#

also, that code is not the code that threw your first error

#

your error was in a command

#

not setup an eco

blazing ocean
#

yeah at least give the relevant code lol

charred blaze
#

remove it too?3

eternal oxide
#

?nocode

undone axleBOT
#

It’s hard to answer a programming question without code
Oh no! You ran into a problem. But no worries, people are willing to help, but first they need to see your code. This is because otherwise, they would be providing help based on guesses instead of concrete knowledge. Whether it be a compile error, runtime error, or an unexpected output, I'm sure that if you were to provide code, you'd receive a quick solution.

charred blaze
vast ledge
#

Wait

#

....

glad prawn
#

why u throw another Exception, just print it

vast ledge
#

**** SERVER IS RUNNING IN OFFLINE/INSECURE MODE! ****

#

...

#

explain

charred blaze
vast ledge
#

why

eternal oxide
#

line 47 return true, as it was yoru command and you processed it

charred blaze
#

and i need 2 for duels

eternal oxide
#

actually, ALl return true

charred blaze
charred blaze
vast ledge
#

Have a second account

charred blaze
#

i wanted to buy another one (discount motivated me).

vast ledge
#

xD

charred blaze
#

but it needs card

#

to buy

vast ledge
#

rly?

charred blaze
#

i only have paypal

grave plover
#

I just bought a second one via PayPal…

eternal oxide
#

line 74, the whole for loop is pointless, You already know they are ignoring with the contains check. No need to loop every entry

charred blaze
grave plover
eternal oxide
#

you check if the config contains the UUID

#

then you loop over every entry to find it, and do nothign with it

charred blaze
#

this one?

eternal oxide
#

literally java if (plugin.ignoresConfig.contains("Ignores." + target.getUniqueId())) { Chat.sendMessage(player, plugin.languageConfig.getString("duel.commands.ignore.player-is-ignoring-requests")); return false; }

#

yes

tardy delta
#

Objects.equals is redundant

eternal oxide
#

don;t need for loop at all

#

delete teh loop, just send message and return after .contains check

charred blaze
eternal oxide
#

no

charred blaze
eternal oxide
#

line 75 to 78 is pointless

#

you already check on line 74

charred blaze
#

if (plugin.ignoresConfig.contains("Ignores." + target.getUniqueId())) {

#

im just checking here if that target player is ignoring any player

eternal oxide
#

ah ok

charred blaze
#

then im checking if one of the players is the one that is sending request

eternal oxide
#

you have a sub list for specific players?

charred blaze
#

i have a list

eternal oxide
#

then still don;t loop just do another contains on the list

charred blaze
#

do we have a method for that?

#

in config api?

eternal oxide
#

if (plugin.ignoresConfig.getStringList("Ignores." + target.getUniqueId()).contains...

charred blaze
#

if (plugin.ignoresConfig.getStringList("Ignores."+target.getUniqueId()).contains())

#

ye

#

thanks

eternal oxide
#

no

charred blaze
#

what no

eternal oxide
#
if (plugin.ignoresConfig.getStringList("Ignores." + target.getUniqueId()).contains(player.getUniqueId().toString()) {```
charred blaze
eternal oxide
#

yes

charred blaze
#

ok wait

wintry oxide
#

hi guys how do i get the object EntityType from a mobs name string?
i mean instead of doing EntityType.ZOMBIE i have a string containing "zombie"

charred blaze
#

same error

charred blaze
#

do you want me to remove try catch from command too?

wintry oxide
#

or you souldnt

#

2 different thing

eternal oxide
#

shouldn't as it may be unreliable

wintry oxide
#

ok

#

i need to do it

#

how

eternal oxide
#

string matching and customs etc

pliant topaz
#

EntityType.ZOMBIE.getName()

eternal oxide
#

do you have the entity itself?

pliant topaz
#

iirc

wintry oxide
#

no

#

the thing reverse

#

from "zombie" string to EntityType.ZOMBIE

charred blaze
#

still same thing

#

no errors in console

pliant topaz
eternal oxide
#

remove try/catch and there will be a stacktrace

#

if there is not, do it on Spigot

wintry oxide
#

i do get this is still a thing?

lost matrix
#

The modern approach would be to use the entity registry

wintry oxide
#

so?

lost matrix
#

So i would do that

wintry oxide
#

ok how

pliant topaz
charred blaze
#

already removed it

lost matrix
eternal oxide
#

then its impossible for you to not have an error. Test on Spigot

charred blaze
#

does runTask have spigot?

lost matrix
charred blaze
pliant topaz
# shadow night That's bad

ik, but it depends on what i use, sometimes the old way is just as good, i try to use the latest, but sometimes I just can't be bothered

shadow night
#

The only sometimes acceptable use case of deprecated methods is the getOfflinePlayer method

pliant topaz
#

i only have deprecated stuff when dealing with paper normally

shadow night
#

I don't deal with paper normally

pliant topaz
#

it's nice, but hell at the same time

shadow night
pliant topaz
#

basically half of everything is deprecated lmao

#

i feel sorry for u haha

#

do u know when entity registry got added?

charred blaze
#

where do i download spigot?

#

without buildtools?

vast ledge
#

You dont

#

You run buildtoosl

lilac dagger
#

well, you're up to yourself then

#

buildtools is the only clean way to get spigot

shadow night
#

Fuck I screenshotted it a second too late

lilac dagger
#

screenshot my mistake?

#

lol

charred blaze
#

how do i download 1.20.6 spigot?

vast ledge
#

You run buildtools

lilac dagger
#

download buildtools, put the jar in a folder

eternal oxide
#

Illegal to download, Run buildtools

lilac dagger
#

double click the jar

charred blaze
#

Attempting to build Minecraft with details: VersionInfo(minecraftVersion=1.20.4,

lilac dagger
#

and set version to 1.20.6 and then hit compile

shadow night
#

--rev 1.20.6

vast ledge
#

If you're on windows, theres even a UI

lilac dagger
#

we got the gui now

charred blaze
#

im on linux

lilac dagger
#

it should work on any platform

#

as long as you know how to open jars on that platform

#

unless it's headless

charred blaze
#

headless?

lilac dagger
#

then yeah just run the command, it's 4 arguments long

#

as in without an interface

acoustic pendant
#

Is it possible to execute commands in only one world?

#

like with dispatchcommand

charred blaze
#

this one?

lilac dagger
#

sounds like an xz thing

lilac dagger
#

dispatch command runs commands as console

acoustic pendant
#

yea, that's why

shadow night
lilac dagger
#

if you want to make a command that runs in chosen worlds just check if a player is in the specific world by name

shadow night
#

Or I think you can dispatch commands as an entity

acoustic pendant
lilac dagger
#

yeah, but it depends on the command i think

#

if it supports targets

acoustic pendant
lilac dagger
#

none

#

assuming you have under 50 worlds

acoustic pendant
#

i have to loop through all players

lilac dagger
#

are you running it every second?

shadow night
#

Wtf are you even doing

charred blaze
acoustic pendant
#

No, not every second

shadow night
#

Most of the time there is 0 reason to dispatch commands

charred blaze
lilac dagger
#

command execute->
for each player
check if in a specific world
do command stuff

acoustic pendant
lilac dagger
#

it's not that expensive to run

#

it's O(n)

shadow night
acoustic pendant
#

to use commands from other plugins

shadow night
#

Such as?

acoustic pendant
#

mythicmobs

charred blaze
shadow night
eternal oxide
#

API's exist for a reason

acoustic pendant
#

yea it has

#

but is easier this way

shadow night
#

No

charred blaze
#

💀

eternal oxide
#

lol

shadow night
#

Either api or nothing

acoustic pendant
#

i'll check i guess

charred blaze
#

why do i need to hack pentagon to download spigot?

vast ledge
#

you dont

eternal oxide
#

check your buildtools log for where it failed

vast ledge
#

from the command error, it looks like the maven build

shadow night
charred blaze
eternal oxide
#

yes it will be a long log. see wher it starts to erro, or paste it

frail pilot
# charred blaze

I did not read the conv so it might have already been suggested, but try from an empty repo with just the buildtools

lost matrix
charred blaze
vast ledge
#

rip

remote swallow
#

mojang code

charred blaze
#

i mean paper distributes its jar without a problem

eternal oxide
#

I told you before, its illegal

frail pilot
#

Mojang things

vast ledge
#

removed it .-.

remote swallow
charred blaze
#

whats that

vast ledge
#

@charred blaze Just use paper then

remote swallow
#

it performs the server patches at runtime with binary patches

vast ledge
#

It runs spigot plugins fine

charred blaze
remote swallow
#

which puts it in a legal grayzone

eternal oxide
#

builds teh server on your computer when it needs it

charred blaze
#

but elgarL asked me to test it on spigot

#

if it had errors on it

vast ledge
remote swallow
eternal oxide
#

Yes, test on Spigot as WE are Spigot here and you are showing an erro that is not in your console, which is impossible

lost matrix
#

Why doesnt he just show the exception?

shadow night
eternal oxide
#

he says he gets no exception in his logs

vast ledge
#

Man now i had to startup my VM just to delete it :(

eternal oxide
#

just in chat

vast ledge
#

Thats

#

not possible

vast ledge
#

Then its not an exception from the server

worldly ingot
#

WE are Spigot

eternal oxide
#

I'm betting its his enviroment as he runs his server use a runTask plugin, so he's not seeing the error channel

worldly ingot
#

Yes Comrade

late sonnet
eternal oxide
#

yeps WE

shadow night
worldly ingot
eternal oxide
#

All hail the Spigots!

late sonnet
carmine mica
# charred blaze

Turn on debug mode in server.properties to see the full error.

charred blaze
#

it was java

eternal oxide
#

I don;t think he's even seeing teh error stream

charred blaze
#

THANKSS

#

ill try it

eternal oxide
#

I shoudl have told you to look in your actual servers latest.log, not just a screenshot of yoru console

charred blaze
#

yep. debug mode worked

charred blaze
charred blaze
vast ledge
short drift
#

Is it even possible to ban player's by UUID?

charred blaze
#

ill fix it

vast ledge
#

The username can change

short drift
#

No, I mean using Spigot API.

vast ledge
#

the UUID cant

charred blaze
short drift
#

I can't get the addBan to co-operate with me.

charred blaze
#

wait

#

what ban are you talking about

hazy parrot
#

Iirc for spigot u use ban by name and use stringified uuid

#

Or something like that

blazing ocean
short drift
#
var banEntry = banList.addBan(bannedId, "Reason", null, whoBanned);

You know, something like.

charred blaze
#

what is this

carmine mica
# charred blaze why isnt this enabled by default

Well, it only shows more exceptions in specific places, but after the brig API was merged, it became more useful. I’m wondering if maybe exceptions there should be shown always regardless since it’s happening way more often now.

short drift
#

Depracated!

#

😠

vast ledge
#

so what

vast ledge
#

@SuppresWarning("deprecation")

short drift
#

So I would rather use these other overloads here.

shadow night
#

Yes

vast ledge
#

oh true

short drift
#

But the T won't accept anything I try to throw at it.

shadow night
#

Iirc you need to get a specific list

#

And then cast it or some shit

short drift
#

🤔

shadow night
#

I don't remember the exact details

carmine mica
# short drift Right, but then I get this:

It’s absolutely hilarious that you wrote this code and it will compile. It’s nothing you did, just the atrociousness of making a method have a return type generic that is not based on any parameters.

late sonnet
carmine mica
#

Which is the APIs fault, not your

carmine mica
#

What? Generics are fine. But they are used incorrectly for the getBanList method

#

Because it takes an enum, which cannot have a generic parameter and returns something with one

shadow night
#

Nah, I'm saying class generics are annoying. Some of the time javadocs do not tell you anything about them so you end up having no idea what to do

#

And because it's class specific it's even more dificult to spot

short drift
#

Well, let me know if you have any ideas how to get it working.

civic sluice
carmine mica
#

It doesn’t in this case, because it’s an enum

shadow night
carmine mica
#

Because the parameter is an enum

shadow night
#

And in this case the javadocs really should describe a bit more on how to use those methods

carmine mica
short drift
#

I can't find any mention of it in the docs.

#

Obviously it doesn't accept UUID.

frail pilot
#

Are you trying to ban a player ?

civic sluice
#

PlayerProfile

short drift
civic sluice
# short drift Obviously it doesn't accept UUID.

e.g:

    void banMyPlayer(Player player) {
        ProfileBanList list = player.getServer().getBanList(BanListType.PROFILE);
        list.addBan(player.getPlayerProfile(), "Hacking", Duration.ofDays(20), null);
    }
short drift
#

Godamnit.

#

I had:

BanList<ProfileBanList> banList = server.getBanList(BanList.Type.PROFILE);
#

And it required

ProfileBanList banList = server.getBanList(BanList.Type.PROFILE);
blazing ocean
#

ah

short drift
#

I pasted the same thing twice by accident at first.

eternal oxide
#

edited

short drift
#

Well, it seems to not error out now. Thank you very much @civic sluice

#

And the rest of you as well.

civic sluice
short drift
#

What do you mean? Why wouldn't it work on Spigot?

eternal oxide
#

on spigot you shoudl just need to cast the returned BanList

civic sluice
charred blaze
#

why is econ null?

eternal oxide
#

do you have an economy plugin?

charred blaze
eternal oxide
#

nope

#

thats just an interface

charred blaze
#

0h

#

ok ill try essentials

short drift
charred blaze
#

then how do i check?

remote swallow
#

it wont be null if theres a valid provider

#

which essentials would be

charred blaze
#

how do i check if there is a provider

remote swallow
#

with rsp == null

charred blaze
#

oh ok

short drift
#

It produces gzipped base64.

#

Under 256 characters.

charred blaze
#

nice

short drift
#

So if you create 8x8 grid of characters in Minecraft + some negative spaces you can now construct and register smileys.

#

For the chat.