#help-development

1 messages · Page 1283 of 1

molten hearth
#

oh wait i defined an image

sly topaz
#

let me verify, but I believe you should have the docker executor if you want to define image

molten hearth
#

so if i remove the image it should be fine

sly topaz
#

technically, yeah

molten hearth
#

okay thank u

#

lmc

#

okay i changed the config to ```yml

pls work?

stages:

  • deploy

deploy:
stage: deploy
tags:
- mcscans_runner
before_script:
- echo "$ENCODED_SSH_KEY" | base64 -d > ~/.ssh/id_tmp_id
- chmod 600 ~/.ssh/id_tmp_id
- eval "$(ssh-agent -s)"
- ssh-add ~/.ssh/id_tmp_id
- ssh-keyscan -H $PROD_SERVER_IP >> ~/.ssh/known_hosts
script:
- echo "Deploying via SSH..."
- rsync -avz --exclude=".git" ./ root@$PROD_SERVER_IP:/var/www/api/
environment: production

#

still Checking pipeline status without the job being assigned correctly ig

sly topaz
molten hearth
sly topaz
#

sudo journalctl -u gitlab-runner

molten hearth
#

yea i was checking

#

well

#

not epic

#

wait

#

i truncated the log gg

#

not sure if there's usually logs after Initializing executor providers

sly topaz
#

I just skimmed through it but there doesn't seem to be anything weird on these logs

#

have you tried just re-registering the runner

molten hearth
#

oh maybe its cause i ran it with root

#

yeah that was NOT it

nimble hill
#

Does spigot Mess with the Jars that are uploaded? Compress, Tweak, or Modify at all? If not, Who should i email or talk to about a concern?

undone axleBOT
remote swallow
#

Spigot only modifies premium jars for resource placeholders

nimble hill
#

as an example

sly topaz
#

are you sure you're comparing the right version of these jars

nimble hill
#

the resulting code SHOULD do the same thing.

#

but if you are doing reflection, or whatever its problematic

nimble hill
#

we are doing a sanity check the next release just because this was off enough that out sentury analytics made us question our sanity

sly topaz
#

welp, email tmp-support and see if they tell you anything

nimble hill
#

but if this is intentional like compression or whatever its technically in violation of the tos lol

sly topaz
#

if they do, please share results as I am also curious as to whether spigot does anything to jars

nimble hill
#

ill shoot them an email and let you know whats up, and yea

#

more an err

#

as its nolonger the jar we uploaded

#

if that makes sense. and this is all IF any compression or modification is done

remote swallow
nimble hill
#

im not pointing fingers, and we are doing a sanity check, and im still reaching out

remote swallow
#

better to double check tho

nimble hill
# nimble hill

also ignore the flavorful language here haha, one of the people who bought it was doing something and flipped out. and thats what brought it to our attention

sly topaz
#

it's alright, kind of understandable reaction lol

nimble hill
#

yea

#

lol

sly topaz
#

though, tbf, what is said there doesn't really prohibit Spigot from modifying the jars, be it through compression or anything, it just waives legal liability

#

not that I think it's alright even if it was compression, if I were to do code-signing that'd fuck up my jars and I'd be in a pickle but welp

thorn isle
#

are you sure you decompiled those two jars the same way

#

because method parameter names do not by default get included in compiled bytecode

nimble hill
#

yes

thorn isle
#

which is why decompilers just generate names for them programmatically, e.g. paramInt2

sly topaz
#

I assume they compiled the jar with -parameters to keep them

thorn isle
#

or they're decompiling them through an ide/using a bytecode inspector and the ide infers them from the project sources

slim crown
#

the only diff is that one is downloaded from spigotmc and one is the one before the upload

thorn isle
#

that rules out most of the decompiler related causes

#

i haven't heard of spigot doing any processing on the uploaded jars but presumably that is what is happening; best hear from someone who actually works there

young knoll
#

Maybe @vagrant stratus knows?

#

I only know of the placeholders

thorn isle
#

definitely seems a bit iffy if they waive liability on the downloads and also fiddle with the downloads in unspecified and undocumented ways

slim crown
#

my current guess is that the placeholder modifier drops the parameters and runs even if you are not using any

thorn isle
#

if it's a premium resource, i could maybe see that string substitution thing causing the parameter names to be lost

sly topaz
#

I also don't know of any compression that would remove param names from bytecode, so it's definitely very iffy yeah

#

well there's r8 but that's android stuff

nimble hill
#

One of the issues i see with Jdgui is its been deprecated for ages Procyon is what im trying to get @slim crown to use, and or just another MODERN decompiler as another sanity check. because we could all be stupid and the decompiler could just be crap haha

thorn isle
#

you'd have to like modify the constant pool which means shifting around most of the bytecode which means offsets are fucked which means you might be easier off doing asm on it instead, which i could definitely see nuking parameter names

nimble hill
#

like, i dont think Spigot is going around modifying jars as thats far more effort for no reason, nor would it make sense. so im almost certain its either on OUR end, or the decompiler.

sly topaz
vagrant stratus
#

I use a variety. Just depends on if luyten works or not kekw

nimble hill
#

or that yea, but just not an almost 18 year old decompiler haha

thorn isle
#

i mean from what i understand he's uploading and downloading the jar and it changes along the way, specifically losing the encoded method parameter names

#

so it shouldn't be an issue of the decompiler

sly topaz
#

it'd be more understandable if it was just file metadata but param names do sound weird

vagrant stratus
#

Out of these the java ones are:

jd-gui, luyten, bytecode-viewer, and recaf

sly topaz
#

doesn't recaf support most decompilers

#

why use different frontends for it

vagrant stratus
#

bytecode-viewer supports a few too, but they're not guaranteed to all be the same version

sly topaz
#

well, except engima I guess

vagrant stratus
#

enigma's exe & dll

slim crown
#

wtf with refac & procyon the debug param names are back

nimble hill
#

It would seem that the jdgui was the issue

vagrant stratus
nimble hill
#

who would have known it was the barely legal age of 18 deprecated decompiler.

vagrant stratus
#

It's why I have 4 different Java decompiler. 2 of which have multiple which are built-in

nimble hill
#

cool, fire put out.

vagrant stratus
slim crown
#

still a bit strange but ig the placeholder processor is dropping some backwards compat stuff

slender elbow
#

decompilers are cringe

#

javap my beloved

vagrant stratus
sly topaz
#

I liked jasmin representation better when that was a thing

slim crown
vagrant stratus
vagrant stratus
#

nah?

slim crown
#

so you don't have the same spigot

vagrant stratus
#

I've got access to the same exact jar(s) as you do kekw

sly topaz
#

and it's being rewritten in rust™

slim crown
mellow edge
#

are in the final spigot jars only spigot mappings (if any?)

chrome beacon
#

depends on the version

sly topaz
#

I am not sure what that means

remote swallow
#

Spigot always runs Spigot mappings on the server

#

You can create mojang mapped jars for development but by default end user servers are always spigot mapped

sly topaz
#

can you even get mojang-mapped jars to run

#

ig if you just take the compiled artifact out of the target folder in the Spigot-Server repo that has the mojang mappings you could run that

mellow edge
#

legacy versions had spigot mappings only, on the modern versions as I can see they are spigot mappings on the server, but in dev mojang.

#

then buildtools remap them on compilation

#

but since I have reflection that will be no help to me

slender elbow
#

mojang mappings are only used during development of spigot itself

#

every running server out there is using spigot mappings

mellow edge
#

yes, but since I am using reflection I need to only look for spigot mappings

young knoll
#

This is why I avoid using names for reflection

#

And instead look for types/index

mellow edge
#

the order of the fields usually doesn't change

worldly ingot
#

Well especially the index of specific types

#

Filter fields by type, then index those

#

Definitely not impossible for those to change though. There could be some obscure fork that adds a new field of the type you're looking for

#

But at that point it's no different than that fork removing the field you're looking for, so fuck 'em

mellow edge
worldly ingot
#

Good to have both, yes

#

Just make sure you cache your reflective lookups. Don't want to be doing name and index lookups each time you want to get the field. Cache it, it will stay the same at runtime

mellow edge
#

already do ;)

    public static Field cachedFieldFinder(Class<?> clazz, String firstConstant, Class<?> retType, int index, String... alias) {
        FieldData data = new FieldData(clazz, firstConstant);
        if (fieldData.containsKey(data)) return fieldData.get(data);

        for (String constant : alias) {
            data = new FieldData(clazz, constant);
            if(fieldData.containsKey(data)) return fieldData.get(data);
        }
        GamePair<Field, String> fld = fieldFinder(clazz, firstConstant, retType, index, alias);
        if (fld == null) throw new NullPointerException("Could not find a field specified by the name: " + firstConstant + " of the class: " + clazz.getName());
        data = new FieldData(clazz, fld.getValue());
        fieldData.put(data, fld.getKey());
        return fld.getKey();
    }
#

I'll have to modify this specifically though

worldly ingot
#

Perfect

#

btw,

Field field = fieldData.get(data);
if (field != null) {
   return field;
}
#

Saves you from making 2 map lookups with containsKey() and get()

mellow edge
#

fair enough, I will refactor the whole thing though, as you can see it was made to serach by names

worldly ingot
#

just a good habit to keep in the back of your mind

#

Technically twice as fast!

mellow edge
#

I do have hashing though

#

(like it matters lol)

slim crown
#

just curious

worldly ingot
#

It basically does what I show, only it puts into the map if it's empty

mellow edge
#

I also have that yes, for caching almost everything I use computeIfAbsent

worldly ingot
#
default V computeIfAbsent(K key, Function<? super K, ? extends V> mappingFunction) {
    Objects.requireNonNull(mappingFunction);
    V v;
    if ((v = get(key)) == null) { // Set v to get(key), if value doesn't exist
        V newValue;
        if ((newValue = mappingFunction.apply(key)) != null) { // Get new value from function. If not null,
            put(key, newValue); // put it in the map
            return newValue;
        }
    }

    return v; // If the value (v, from get(key)) wasn't null, return it
}
#

So, same thing, just with a value setter if null

mellow edge
#

yeah

#

still neat

slender elbow
# worldly ingot ```java default V computeIfAbsent(K key, Function<? super K, ? extends V> mappin...

is this code free software that one can redistribute it and/or modify it under the terms of the GNU General Public License version 2 only, as published by the Free Software Foundation? and is this code distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE? should one have received a copy of the GNU General Public License version 2 along with this work; and if not, write to the Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA?

#

should one contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA or visit www.oracle.com if one needs additional information or have any questions?

mellow edge
#

lol

slender elbow
#

radio silence..... i think choco is violating that code's license

mellow edge
slender elbow
#

thank you

buoyant viper
grim ice
#

So I haven't used spigot in a while, and this is really confusing me lol

#

Somehow my command isn't being registered?

#

I'm calling getCommand(..).setExecutor(..) on enable

#

and im sure the command is in the commands list in plugin.yml

#

yet it's as if the command simply isn't there, when I test it ingame

mellow edge
#

some tips why that might happen: is the plugin correctly loaded and compiled?, command just prints its name when executed? -> something wrong with plugin.yml (is it in resources?)

grim ice
#

Nevermind I'm kinda slow

#

I restarted the server before putting the plugin there 😭

#

so fried

buoyant viper
#

F

worldly ingot
#

It just so happens to be almost identical to the JDK's

#

I ADDED COMMENTS!

#

AND STRIPPED 4 LEADING SPACES SO IT WOULD JUSTIFY LEFT!

slender elbow
#

so you are admitting to having redistributed it and/or modified it under the terms of the GNU General Public License version 2 only, as published by the Free Software Foundation?

storm wind
#

how do private mine plugins work? is it a packet to update one block or is there some way to update blocks on a large scale?

young void
#

guys how can i make hex code scoreboards. why it gotta be so hard😭

manic delta
#

how can i things like this?

young knoll
#

Or you can resend entire chunks

young void
young void
manic delta
manic delta
young void
young void
manic delta
mellow edge
#

Is the handler that handles Minecraft server inbound packets still called "packet_handler" (in netty pipeline) in spigot 1.21?

slender elbow
storm wind
#

have some private mine plugins available for free?

manic delta
#

realmines

mint nova
#

how to check if player has caught something, while fishing?

@Nullable
public Entity getCaught()
Gets the entity caught by the player.
If player has fished successfully, the result may be cast to Item.

Returns:
Entity caught by the player, Entity if fishing, and null if bobber has gotten stuck in the ground or nothing has been caught

I only see this in PlayerFishEvent but it dosen't return boolean (or im just stupid)

chrome beacon
#

It tells you what it returns if nothing has been caught

thorn isle
#

if you're asking how to discriminate between fishing up items from the water vs. catching an entity by hooking it, you can probably look at the fishing state to determine that

storm wind
#

And what do the mine plugins do, for example, to prevent the block from disappearing when you right-click on them?

chrome beacon
#

Are you making a plugin?

storm wind
chrome beacon
#

Then there's a packet that gets sent when a player right clicks a block

#

you'll need to handle that case and resend the block change

storm wind
#

what packet name?

#

and even with that, it still has more performance than the conventional mine plugin?

#

and another thing. when you move away the blocks that were modified on the client side can return to the original (server side). how do plugins deal with this? And also with alternative clients that can change this

chrome beacon
#

use item and block dig

#

for right and left click respectively

chrome beacon
storm wind
chrome beacon
#

anyways you'll need to listen for when a chunk is loaded for a player and apply your changes to it

storm wind
chrome beacon
#

define private mine plugin

thorn isle
#

to get fully per-player packet based functionality you're looking at replicating large parts of the game code which will be nontrivial to implement and maintain

#

replicating a mine schematic and having each player mining in a physically separated location/world will be far easier and the performance difference is negligible

mortal hare
#

is it just me or i like to write my own implementations of SQL without ORM's using plain old JDBC api by designing query interfaces and use cache like Caffeine?

#

overall it feels better experience than having to use hibernate or mybatis

#

it just integrates better with your code when you design the persistence instead of using generic solutions

drowsy helm
#

Same reason why large companies for the most part use ORMs aswell, they do everything automatically. No need to manually update potentially hundreds of queries when something changes

mortal hare
#

i despise session based orms

drowsy helm
#

Hibernate has verbose mode

mortal hare
#

its a debugging nightmare

thorn isle
#

i just store data as json blobs and call the sql job done

mortal hare
#

instead of controlling sql queries yourself you're giving it to external tool which does its job worse than you do if you weren't lazy to do proper implementation

drowsy helm
#

If ORMs were so horrible these mega companies wouldnt use them

mortal hare
#

you write sql migrations anyway

drowsy helm
#

But their use alone should be proof of their capabilities

mortal hare
#

i like how google does give advice on accesibility to use semantic html but itself doesnt use it properly

#

hipocrisy at its finest

slender elbow
#

you think they write that manually

mortal hare
#

you can automate semantic html

#

for example why tf this is not <ul> <li>?

#

and has to have aria role listitem

#

that just doesnt make sense

thorn isle
#

web devs are profoundly incompetent as a rule

#

google is no exception

drowsy helm
#

And why change something that isnt broken

chrome beacon
#

Roles seem correct at least

drowsy helm
#

Also probably legacy device support

#

It’s not such a black and white thing

mortal hare
#

if it was truly legacy it wouldnt use flexbox

#

<li> is supported since like IE 5

#

that's just incompetency

drowsy helm
#

You talk as if you are better than a team of thousands of developers. You dont think they have their reasons?

buoyant viper
mortal hare
thorn isle
#

well, see, dev time costs money

mortal hare
#

and yet they do this

buoyant viper
#

and probably codebases older than most of us here

thorn isle
#

if you had to pay for their huge dev team to rewrite this, would you tell them to rewrite this?

#

conversely, telling others to use semantic whatever whatever is optics which is pr which is money, so of course they would do so

#

you might not like it but it makes perfect sense

mortal hare
#

it all comes down to money

#

i just hate hipocrisy

#

i dont care if its div or ul

#

i just hate to see megacorps telling others what to do when they themselves dont taste their own medicine

buoyant viper
#

thats just anybody in the work field

#

corners get cut all the time

thorn isle
#

i don't really care about that part, i only wish the google ads interface wouldn't take 15 gigabytes of memory to run and OOM my browser after 45 minutes

young vine
#

Google always has been a bad example

#

Just look at how slow the YouTube UI is

#

Takes ages to hydrate

chrome beacon
#

It's also quite buggy

#

Loves to play two videos at once and the channel banners sometimes flicker like it's two of them fighting

cinder abyss
#

Hello, is there a GUI API to easily make sections ? (I mean, by clicking on items, it opens "another" inventory with items in)

chrome beacon
#

IF is one

rotund ravine
#

If mentioned

wet breach
# mortal hare for example why tf this is not <ul> <li>?

because div's on their own do not apply anything unlike those other tags you listed it is interpreted by the browser and each broswer does it differently or can. So you use Div and then setup the rules for the styling how you want.

#

would say Div is probably one of the most useful tags which is ironic because on its down it doesn't really do anything lol

young knoll
#

Oops! All div

buoyant viper
#

The world runs on Div

mortal hare
wet breach
torn shuttle
#

this is why I don't use html elements and instead just make my website a png

#

then I can be sure they get exactly what I wanted

mortal hare
#

semantically <ul> is preffered. You just cant code your website for specific browser or user agent stylesheet, that's just bad. That would be justifiable if they wanted to make page loads quicker, thus saving some data, but this obviously not the case because their whole website is div container hell and could be broken down into specific classes with way less html elements than It is right now

#

Its component-based autogenerated page, you can see it from class hashing and controller attributes.

#

Component css scoping is also dumb, like cascading stylesheets are cascading for a reason. instead of creating fine tuned css global classes with sass or heck vanilla css, frameworks opt-in for component level based css hashed classes which contains duplicate css properties per each component because those css classes are only used per element and cannot be optimized due to how frameworks dont analyze html tree for css classes

#

all of this nonsense and bloat is for "developer experience" for pushing quick and dirty apps which run like shit on mobile devices but kisses investors ass because "muh innovation"

#

its terrible and im tired of pretending its not.

#

i might sound like a boomer, but I believe that agile ruined the quality of todays software

#

companies nowadays prefer labelling their apps as AI powered and doing cashgrab from investors instead of doing real innovation or improving the quality of their existing software for example

#

just take a look at microsoft and what Windows became during the last 15 years

torn shuttle
#

it's crazy how I get to relive and rewitness the same arguments that were going on 15 years ago

#

looking forward to 15 years from now when someone else says the same exact thing

wet breach
# mortal hare semantically <ul> is preffered. You just cant code your website for specific bro...

These days browsers almost behave the same however there are times you have to make code for specific browsers. It was a lot worse years ago in this regard. Point is you absolutely can just sucks when you have to and as I said there is still cases where you do. Not sure what you mean semantically ul is preferred. Anyways, as far as html goes it doesn't really matter what you use as far as tags go since no matter which you choose to use it won't speed up anything if you are using a stylesheet file anyways unless you want to put the style in the element itself in which case it would but that is not the standard no more and frowned upon in doing vs using stylesheet lol.

mortal hare
#

MDN says you should semantic list html elements for such uses cases

wet breach
#

and?

mortal hare
#

i've replied to your " Not sure what you mean semantically ul is preferred"

wet breach
#

so because one browser said so means it applies for all?

mortal hare
#

google says it too

wet breach
#

oh your concern is over accessibility

dawn flower
#

why do all items' meta extend damageable?

#

how do i check if an item actually has durability

#

like sword, pickaxe, etc

#

because i have /repair and it can creates unstackable items

#

nvm am stupid

echo basalt
dawn flower
#

i barely got used to damageable

echo basalt
#

it's been a thing for a solid 10 years

slender elbow
dawn flower
storm wind
storm wind
thorn isle
#

make the area large enough to accommodate the largest possible size ahead of time

#

alternatively, create a world per mine

storm wind
thorn isle
#

yes, so have an empty area around the mine at first

#

and then expand the mine into the empty area as it grows

#

space the mines 1000 blocks apart

storm wind
#

cannot be empty

thorn isle
#

then fill it in

storm wind
#

and i make 1 world for each player?

thorn isle
#

that is the other alternative

storm wind
#

tthen server will have 5000 worlds

thorn isle
# thorn isle then fill it in

ideally, use a custom world generator that makes the world solid stone, and then paste the mines into the solid stone

#

you don't have 5000 concurrent players

storm wind
thorn isle
#

you only need a world per online player

storm wind
#

still, 100 worlds is a lot

thorn isle
#

alternatively, do what i said first and space the mines apart 1000 blocks

storm wind
#

and wouldn't it be better to do all this with packets? I don't think it's too complicated

thorn isle
#

because believe me doing this with packets isn't something you want to attempt yourself and probably can't afford to pay someone to do for you

#

you will have to replicate large parts of the netcode and game code to achieve this

#

and you will have to maintain it across versions

storm wind
#

just need use packetevents

thorn isle
#

you do you but i'll advise against it

storm wind
thorn isle
#

🤡 sure buddy

#

keep in mind that packets and game behaviour change across versions

#

packetevents is only a wrapper for the protocol

#

any changes made to it will still require changes on your end to be compatible

storm wind
#

I only have doubts regarding when I send a block change packet on the client side for example, for n factors the block can synchronize with the server block and no longer see the block and I don't know what these factors are. if it is by moving away, etc.

storm wind
thorn isle
#

you'll have to intercept all sent block change packets for the affected locations, all chunk packets for chunks containing affected locations, and probably light packets and a handful of game event packets

thorn isle
#

for the chunk packets, you will have to decode the chunk contents and rewrite it to contain the blocks you need it to contain by accessing/modifying the palette and nibbles

young knoll
#

PacketEvents actually has a nice wrapper for that

thorn isle
#

that'll be quite convenient

#

then after that you'll want to either use nms or manually calculate the breaking speed of the tool on a given block and send block damage packets accordingly, and later once the block has been fully broken, compare the serverbound block break packet with the timing to see if the player is cheating (anticheats won't help you here since the blocks are clientside) and respond with an ack packet accordingly; damage the tool (remember to account for unbreaking); then create the dropped item with that new fancy EntitySnapshot API and send a spawn and set metadata packet for it, and similarly validate the player picking it up and manually add the item into the player inventory; or alternatively make the entity only pickable by that player and use the entity show/hide api to only show it to that player

#

overall i don't really think this is going to be worth the effort but you can take a crack at it if you like

#

like if this is for a prison server where the mine is like 90% of the server functionality, it might almost be more straight forward to rewrite a basic server in C or whatever that just supports movement and basic block breaking; that way you could actually have those 5000 concurrent players

mortal hare
#

apart from that you handle everything yourself

thorn isle
#

But muh 5000 concurrent players

#

I suppose java performs decently well nowadays if you avoid allocation traps

uneven hinge
#

How do i reset Arenas using ASWM?

vast ledge
ivory sleet
mellow edge
storm wind
#

runTaskAsync is a poll of how many threads? and is this poll done for plugins only or does server.jar also use this poll?
I ask this because I don't know if I should use runTaskAsync to do database operations or if I have my poll for that

chrome beacon
#

If you're on a modern version you can use VirtualThreads for database operations

#

They're perfectly suited for I/O

robust helm
#

in a server network when I need a new minecraft server for a minigame, do I create that using Kubernetes or what?

chrome beacon
#

That's one way to do it

robust helm
#

or is there any other sane way?

chrome beacon
#

it really depends on how you want to scale

#

For a small server running Kubernetes is overkill

robust helm
#

hm lets say 50 players

chrome beacon
#

Yeah then you do not need Kubernetes

robust helm
#

what do i use then?

#

docker run?.. and docker kill

chrome beacon
#

You should ask yourself if creating servers on demand is even necessary on that scale

robust helm
#

stale servers are expensive

chrome beacon
#

not really

#

you'd only need a single vps

#

or just a dedi

robust helm
#

is there anything better than kubernetes if I want on demand servers?

robust helm
chrome beacon
#

which is fine

robust helm
#

how do I cleanup the server after the minigame ends then?

chrome beacon
#

Depends on what needs cleaning

robust helm
#

so u mean I should only e.g remove the world but not the whole server?

chrome beacon
#

Consider not saving the world in the first place

wet breach
robust helm
wet breach
#

you would need to create a custom system if you want something better

#

have done it, and it takes quite a while to make one

robust helm
robust helm
wet breach
#

and put the players in there

robust helm
#

oh thats cool

#

ig I'll try kubernetes to see how difficult it is

#

thank u both

robust helm
wet breach
#

it doesn't really matter on the size

#

just matters how much resources you dedicate, whether or not the server is custom or not

#

I generally used custom servers where the internals have been gutted out except for what was needed for the games

#

everything not needed was tossed out

thorn isle
#

If there isn't a free thread to take up the task immediately, a new one is spawned for it

sly topaz
#

the implementation is pretty self-explanatory, so if you want more details then just take a peek at it

undone yarrow
#

Hi again. I'm working on this airstrike thingy that can shoot projectiles from a specified origin to a specified destination. If the origin is very far away, the projectiles won't load and move (obviously). But, if I load all the chunks between the projectile and the destination, the projectiles still don't move, unless I move closer to the projectiles

#

any idea what the issue could be?

thorn isle
#

i'm pretty sure loading chunks through bukkit makes them the highest ticket level and hence entity ticking, but now that i think about it, i think mojang might have changed the way how entities are ticked recently

undone yarrow
#

that's bukkit though, I'm using paper

thorn isle
#

bukkit as in through the bukkit api

#

this includes paper, yes

#

in fact it is a pet peeve of mine that they still haven't added api for the various ticket levels

#

i would like to preload a bunch of chunks in memory for faster teleports/less gc spikes, but don't want to spend cpu on block/entity ticking; border chunks would achieve this but for that i'd need nms

#

and the chunk ticket bullshit is like one of the 3 places in nms which i refuse to touch

#

either way make sure you load the chunks before spawning the entity rather than after; paper has some settings where fireballs and other projectiles don't get saved on unload

#

and do a sanity check i suppose seeing a few ticks afterward if the projectile isValid

sly topaz
#

it's also recommended that you ask in their discord if you're running their software. Some of the things vcs2 pointed out don't apply to Spigot so if they didn't just happen to know them you could be in a pickle

thorn isle
#

something something entity activation range v2

#

though i don't think that affects projectiles

sly topaz
#

it definitely was back in 1.12, not so sure now

dawn flower
#

is it possible to make permenent trims? for example you do /trims then select chestplate then silence then white

now any chestplate that you wear will have silence trim with quartz but when you remove the chestplate the trim gets removed

thorn isle
#

depends on if it implements vertical activation range, which i think it does

#

back in the day it used to work like chunks, i.e. only horizontal distance would count

#

which was incredibly dumb

dawn flower
sly topaz
#

tbf it was made in pre-flattening era

thorn isle
sly topaz
#

don't we have an armor equip event by now

#

I remember there being a PR about that

thorn isle
#

the closest thing we have is paper's armor change event, but i don't remember if changes made to the old armor item are reflected in the item

#

dunno we might have it in spigot now

#

but eyeballing by the way paper implemented it, it might not always be possible to reflect the changes made on the old item

#

since iirc it just checked the slot every tick

#

not sure how the spigot pr is implemented

dawn flower
sly topaz
#

don't overcomplicate it and just set the trim when they equip

dawn flower
#

why not? can't i just do sendEquipmentChange on the same player?

sly topaz
#

ah, I forgot that was an API method yet again

#

ig if you don't care about the item not reflecting the trim, that's fine

thorn isle
#

it won't change the item in their inventory i don't think, which might look a bit confusing, but yeah that'll work for other players and in third person

storm wind
#

How do I serialize Material to string and vice versa?

storm wind
pseudo hazel
#

why a string

sly topaz
pseudo hazel
#

oh material, I thought you said item meta

storm wind
sly topaz
#

don't remember if there was any way to get the minecraft name of a Material back then

storm wind
thorn isle
#

and then the pool will spawn new ones

orchid gazelle
#

Minecraft is like the only game where fking community plugin devs know completely different api calls on 20 different versions at the top of their head, kinda crazy

thorn isle
#

there is a cache for them but it only retains a certain number of them for a certain period of time

storm wind
young knoll
#

It just handles stuff like casing for you

sly topaz
storm wind
thorn isle
sly topaz
#

just use the output of Material#toString on it

thorn isle
#

and that's what you were asking about afaik

#

or were you asking about completablefutures with a custom executor?

storm wind
thorn isle
#

right

sly topaz
#

I am confused, I am pretty sure you asked about the bukkit scheduler lol

thorn isle
#

yeeeah

storm wind
sly topaz
#

as Jish mentioned, it handles things like casing for you

storm wind
#

wdym casing

thorn isle
#

technically if what you intend to do with the string is to call the enum value getters, you should use Enum::name, since toString can be overridden

sly topaz
young knoll
#

It also handles namespaces in the modern version

storm wind
sly topaz
#

one is just more convenient

storm wind
#

and whats difference between getMaterial and matchmaterial?

thorn isle
#

i think the docs do say this but one throws an exception if nothing matches and the other returns null

storm wind
#

I understand that matchmaterial is even less strict than getmaterial

worldly ingot
#

Both return null, matchMaterial() does some processing on the input such as lowercasing, stripping of whitespace, and replacing spaces with underscores

#

Prefer matchMaterial() if you're accepting user input

thorn isle
#

odd, i remember getting an exception from them but maybe i just misremember

worldly ingot
#

valueOf() will throw the exception because it's Enum#valueOf()

thorn isle
#

i specifically remember being moderately annoyed because i thought it would return null but it exploded instead; i specifically picked it instead of valueOf because I wanted null out of it

#

god only knows though, i seem to be remembering things that never happened in recent years

cinder abyss
sly topaz
#

I am aware that the more you remember things, the less it's an actual memory but just a reconstruction of what your mind thinks happened, but I didn't think I'd have it this bad lol

chrome beacon
cinder abyss
#

I'll try to figure out how to do it by myself, thanks for letting me know about IF, can be useful later !

sly topaz
#

often times it's easier to just use bukkit API directly

chrome beacon
#

if you want to make your own

sly topaz
#

I was going to suggest looking at the implementation for the methods but forgot the stash doesn't have tags for versions in the bukkit repo

#

the craftbukkit repository does so ig you could just cross-match commit refs but eh

inner grail
#

Hello 👋 does someone know if there is any fix for this bug? Been having this issue for quite a while now

thorn isle
#

no clue what i'm looking at

buoyant viper
#

hes dead

thorn isle
#

💀

inner grail
#

So, whenever a player dies and once they respawn, they can still play and they're like shown in the screenshot

mellow edge
chrome beacon
#

Now if this isn't caused by your plugin I suggest heading over to #help-server

young knoll
#

That poor player

#

They must have drank bone hurting juice

mint nova
#

Why LURED is not up here?

remote swallow
#

LURED Is paper api

mint nova
#

bruh

#

mb sr

pseudo hazel
#

caught red handed

mint nova
#

i forgot im using it XDD

young knoll
#

Get him!

mint nova
#

no please

#

spare me

viscid condor
#

org.bukkit.PortalType.CUSTOM makes me very curious : what is the purpose ? doc says "This is a custom Plugin portal", but I have no idea what to make of it
I searched on google and some plugin codes, didn't find any usage

drowsy helm
#

unless theres some programmatic way to make a custom portal which im unaware of

buoyant viper
#

there was that one minecraft update

young knoll
#

I guess if a plugin wants to manually fire the event for their portals

buoyant viper
#

the april fools one

drowsy helm
#

that was a snapshot though

drowsy helm
viscid condor
drowsy helm
#

yeah probably just a forgotten relic atp

buoyant viper
#

hey i mean it only took us like 11 years but we got pretty close to almost making use of it

winter jungle
#

Heya, does anyone know how I can activate the second layer on my NPC? Because at the moment the skin of the NPC is only 2D

drowsy helm
winter jungle
drowsy helm
#

You have to set the entity data

#

one sec i have a snippet

#

this.getEntityData().set(DATA_PLAYER_MODE_CUSTOMISATION, (byte) 0xFF);

#

this was for 1.19.1 but will be pretty much the same for later versions

winter jungle
#

Oh wow, thank you so much!
That was easier than I thought

fickle mantle
#

hey, can anyone help me with Messaging Channels (Spigot / Velocity)? I dont know what I did wrong..

chrome beacon
#

?ask

undone axleBOT
#

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

fickle mantle
#

my PluginMessageEvent isn't fired even tho its registered in ProxyInitialization, the PluginMessage is sent and also the channels are registered

chrome beacon
#

Could you send the relevant code

mellow edge
#

how do I get a NetworkManager from a Player / EntityHuman? It used to be player.networkManager.(channel), now it's something else?

chrome beacon
#

?mappings

undone axleBOT
mellow edge
#

no I actually cannot find the method lol

chrome beacon
#

What are you trying to do

mellow edge
#

I basically need to get the Player's netty.io.Channel

#
        PlayerConnection connection = ((CraftPlayer)player).getHandle().playerConnection;
        ChannelPipeline channelPipeline = connection.networkManager.channel.pipeline();
#

but this is legacy

mellow edge
#

I found it

chrome beacon
#

I recommend heading over to the Paper discord

fickle mantle
#

Ok

chrome beacon
#

but I'm not sure why you're using the forward channel

#

as that's intended to send messages to servers

#

and you appear to want to keep the message in Velocity

fickle mantle
#

yeah its Not the original Version of mine. I asked chatgpt First and it messed a few things up

#

but it also didnt work before and i tried everything. The Event isnt Even called

chrome beacon
#

Why is the answer always because GPT told me every time 💀

#

also you're never closing your streams, use a try with resources

ocean hollow
#

is PlayerInputEvent works only on clicking. not holding? Can I make somehow holding button.

eternal night
#

input event is only called when the input changes

ocean hollow
#

i have to click each time

#

i thought this event loops

#

no?

#
    @EventHandler
    public void moving(PlayerInputEvent event){
        Player player = event.getPlayer();
        BoatSession session = MoreMinecraftBoats.instance.getSessions().getOwnerBoat(player);

        if(MoreMinecraftBoats.instance.getSessions().getOwnerBoat(player) == null){
            return;
        }

        Input input = event.getInput();

        if(input.isForward()){
            session.moveForward();
        }

        if(input.isRight()){
            session.rotate(3);
        } else if(input.isLeft()){
            session.rotate(-3);
        }
    }

#

like if i am holding that for 3 ticks. it will work 3 times

#

have I to do scheduler for this? and stop after forward input is false

young knoll
#

Yes

hardy cairn
#
        Bukkit.getScheduler().runTaskTimer(plugin, () -> {
            for (Player player : Bukkit.getOnlinePlayers()) {
 if (ArmourChecking.hasFullTrimmedArmor(player, TrimPattern.SILENCE)) {
                    if (!player.hasPotionEffect(PotionEffectType.STRENGTH)) {
                        player.addPotionEffect(new PotionEffect(PotionEffectType.STRENGTH, Integer.MAX_VALUE, 1, true, false, true));
                        player.getPersistentDataContainer().set(effectKey, PersistentDataType.BYTE, (byte) 3);
                    }
                } else if (player.getPersistentDataContainer().has(effectKey, PersistentDataType.BYTE)) {
                    player.removePotionEffect(PotionEffectType.STRENGTH);
                    player.getPersistentDataContainer().remove(effectKey);
                }
            }
        }, 0L, 20L);
    }``` this is not causing lag on the server till now but i want to make a better way for this to make my plugin better anyone got any suggestions?
chrome beacon
#

Use the infinite duration constant instead of int max

#

and instead of checking every couple of ticks you can listen for the armor changing

hardy cairn
#

woah thanks! this will really help optimize my plugin

storm wind
#

Do the mine plugins that frequently add balances to the player normally update the database in real time or do they just update the cache which will be updated in the database periodically?

worthy yarrow
#

Probably the latter

storm wind
worthy yarrow
#

Those things you could probably make manual update calls cuz I figure they won’t be happening as much as the automated ones

storm wind
worthy yarrow
#

If you’re sure your caching system is solid then I don’t see the issue… they both deal with balance updates so just clear your cache whenever an update to the db occurs

#

Whether that happens manually or not, you’re still keeping things clean and updated

#

I guess you could keep like a transaction cache and total the amount from each one and modify db with that result just once in a while if you’re worried about that

ocean hollow
#

can I force player to user F5 using plugin? Maybe Mojang created ability to do this, they created camera distance attribute.

slender elbow
#

no

#

the camera_distance is being added because you can ride ghasts and such, so to look nice they added that so the view is further away

#

but no way to force 3rd person view

undone yarrow
#

Hello again, I made this airstrike plugin that shoots shulker_bullets, disguised with a block display towards a specific destination from a specified origin, and then explode. The issue is, by divine intervention a shulker bullet sometimes gets magically removed, and leaves the block display floating in the air

#

I am checking the following events:
projectile hits
entity damaged
entity dies
projectile collides with entity
entity killed

#

I'm cancelling the event on each of these (for these shulker bullets), but somehow there's still some shulker bullets that get magically removed

#

Any ideas what could be happening here?

#

Are there any other events that might be run?

eternal oxide
#

chunk/entity unload will probably not save the bullet

undone yarrow
#

wdym?

eternal oxide
#

if the chunk unloads the bullet entity will probably be deleted, not saved. So your display gets saved but the bullet does not

undone yarrow
#

hm alright

#

I force load all the chunks that the bullets go through though

#

so I doubt that's it

eternal oxide
#

force load or chunk ticket?

undone yarrow
#

if I stop the explosions from breaking blocks (so, it still hurts entities but no blocks), then this is a lot rarer. Just spawned an insane amount of bullets for a min and only got 1 floating block display

undone yarrow
sharp hearth
#

Hey anyone here can help me? I got problem with plugin compilation.. please im not experienced

eternal oxide
#

a chunk ticket = stay loaded until the ticket is removed, forece load = unload later if not needed

undone yarrow
#

it's force loaded

undone axleBOT
#

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

sharp hearth
# chrome beacon ?ask

I have the full code for a plugin, but I can't get it to compile in IntelliJ. I always get a COMPILATION ERROR saying package com.onarandombox.multiversecore does not exist and package net.milkbowl.vault does not exist.
I've tried many solutions for adding the dependencies (Maven repos, local JARs) but nothing seems to work. I think the problem is with my local environment setup.

eternal oxide
#

You are using Artifacts to build instead of Maven

#

Right side of screen in the Maven Tab select package

sharp hearth
chrome beacon
#

and is multiverse in your pom

sharp hearth
#

What that mean?

chrome beacon
#

pom.xml

#

The maven file

#

Are you depending on Multiverse Core

sharp hearth
#

should i put u fully pom.xml file? can you help me please?

chrome beacon
#

?paste

undone axleBOT
chrome beacon
#

^ send it

#

(and give link)

sharp hearth
#

Error adding document. any other site?

eternal oxide
#

thats not your pom

sharp hearth
eternal oxide
#

<systemPath>${project.basedir}/lib/MultiVerse-Core.jar</systemPath> Bad idea

mint nova
#

Why with IntelliJ IDEA and jdk 17 i cant create plugins for 1.16.5?

slender elbow
eternal oxide
#

I thought he meant he manually loaded them instead of placing a ticket

slender elbow
#

i'm thinking of the World#setChunkForceLoaded mechanism

eternal oxide
#

Yeah one of us is correct 🙂

#

I though he just ment he manually loaded them as the projection flew

slender elbow
#

i hope at least one is lol

sharp hearth
#

Sorry for my lack of knowledge, AI helps me create the first plugin but it can't handle these errors

dusty mason
#

Hello, is this the right place to search for plugin/skript developers? Payment included

chrome beacon
#

?services

undone axleBOT
main basin
undone yarrow
#

Any idea why some particles, e.g. large_smoke can't be rendered at distances larger than ~30 (+-20) blocks, but other particles such as explosions can be rendered at 200+ blocks?

#

I'm trying to make a shockwave using particles

#

but a lot of particles don't want to be rendered far

young knoll
#

Did you set the force Boolean to true

quartz relic
#

So i have a createInventory. I use to be able to open another one when selecting an option with putting the player.performCommand("othermenu") to open the other menu assigned to the command "othermenu" but its no longer working and just closess the inventory without opening the other one or saying unknown command... any ideas?

young knoll
#

Why are you using a command

smoky anchor
#
  1. Don't use commands for your GUI control flow (or however it should be called)
  2. Is it your own command ? Are you sure it exists, is it properly registered ?
rotund ravine
#

If u still wanna do it that shitty way. Close inventory, wait a tick. Make them run the command/

quartz relic
#

yes, i can run the command seperatly and it opens the menu so they both are register

#

and idk, i was following a course and they set it up with a command

young knoll
#

You are meant to wait a tick before opening another inventory in a click event

quartz relic
#

id add the wait in the listener part since that has the player.performCommand right

rotund ravine
#

How are you gonna wait?

quartz relic
#

with a bukkit scheduler?

rotund ravine
#

Good then sure

quartz relic
#

this seems like a trap

young knoll
#

I would find a better guide

#

Or course or whatever

#

Using commands for your code flow is Wack

smoky anchor
#

?gui

rotund ravine
#

I agree with Jish guy

storm wind
#

If I have plugin A that is dependent on plugin B, am I guaranteed that plugin A will shut down before B?

storm wind
mellow edge
#

are you making the plugin

storm wind
#

I need to do this because I have an ExecutorService shared by all plugins and I need the plugin that has this instance to shut down after all the others

mellow edge
#

Are all of the mentioned plugin yours?

storm wind
#

yes

mellow edge
slender elbow
#

plugins do disable in the reverse order in which they enable

main basin
zinc moat
#

Does anyone know why i need to wrap it in StringValue i've tried doing that and it didnt work or atleast not what i want to happend.

#
    private final BlockyBoxCore plugin;
    private final Random random = new Random();
    private final MiniMessage miniMessage = MiniMessage.miniMessage();

    public MOTDRandomizer(BlockyBoxCore plugin) {
        this.plugin = plugin;
    }

    @EventHandler
    public void onping(ServerListPingEvent event){
        List<String> motdArray = plugin.getConfig().getStringList("motds");
        if (motdArray.isEmpty()) return;
        String rawmotd = motdArray.get(random.nextInt(motdArray.size()));
        Component motdComponent = miniMessage.deserialize(rawmotd);

        event.setMotd(motdComponent);
    }
chrome beacon
#

First off don't use any jar dependencies like that

#

and split each version in to it's own maven module

#

For versions 1.17 and above I recommend you follow this:

#

?nms

chrome beacon
#

Hi there! Today I’m going to explain how to setup a multi-module project using maven to support different NMS versions. Important notes about this tutorial: Every step will have detailled screenshots using IntelliJ. I explicitly chose not to include everything as copy/pastable source code, but normal screenshots (you can click on them to show ...

mellow edge
#

mojang mappings are great only for people that don't use reflection

#

we now suffer of not updated spigot mappings

winter jungle
coral owl
#

hello everyone i was wondering if i could get a hand with my coding for mc forge 1.20.1 for some reason my coding is being thrown even tho it all shows to be curract and cant seem to figure out why if someone is down to help id be down to hop into a call i havent modded since 1.12.12 and 1.7.10 virsions of forge so i know some things are differnt i am using intellij witch has always worked for me before when trying to mod past 1.12.2 and i know as far as right now that

IEventBus modEventbus = FMLJavaModLoadingContext.get().getModEventBus();

the .get is massive being thrown witch isnt a problem game still runs but when i go to register my item everything starts to get thrown if i could get a hand that would be awesome i have a lot of items mobs and even entitys that needs to be made and register but if its giving me this much of a problem im not gonna be able to get the items register the way i need dms are open so if you want to dm me thats fine just plz some help would be awesome

vocal cloud
#

Going to need a bit more context than that lol. Usually a pastebin of what's going on

coral owl
#

i can send screen shots of the code in the main class and moditems class

potent crescent
#

can someone help me for compile a plugin cz evrey time. i tried it say pom. xml is worng

undone axleBOT
sly topaz
coral owl
#

being thrown is slange for throwing an error

sly topaz
#

okay, but what kind of error

#

an exception, it crashes the game, it is highlighted red in your IDE

coral owl
#

yeah even more so after rewatching the video 5 times for 1.20.x when the errors aint being thrown it loads into the game just fine but the item registery keeps refusing to register my items i have screens shots i am able to send but has to be send trough dms

potent crescent
potent crescent
# sly topaz show your pom

<project xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0
http://maven.apache.org/xsd/maven-4.0.0.xsd">

<modelVersion>4.0.0</modelVersion>
<groupId>com.owner.plugins</groupId>
<artifactId>MyPlugin</artifactId>
<version>1.0-SNAPSHOT</version>
<name>MyPlugin</name>

<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.12.2-R0.1-SNAPSHOT</version>
        <scope>provided</scope>
    </dependency>
</dependencies>

<build>
    <plugins>
        <plugin>
            <artifactId>maven-compiler-plugin</artifactId>
            <version>3.8.1</version>
            <configuration>
                <source>1.8</source>
                <target>1.8</target>
            </configuration>
        </plugin>
    </plugins>
</build>

</project>

#

this. my pom.xml

#

it say version is worng

#

red version

sly topaz
#

the maven compiler plugin version or the spigot-api version

#

also, use a paste service to send long texts like that next time

#

?paste

undone axleBOT
potent crescent
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

coral owl
# sly topaz ?img

okay ive been verify let me send some screen shots so you can see what im talking about

coral owl
# sly topaz ?img

this is after redoing all of my coding 4 times last night and had the game running and then went to register the item before adding the textures and models the first one is of the moditems class and the second one is the main class

#

i do still also have all of the original coding up and loaded that has all of the classes textures and models if you would like a screen shot of thoes let me know

chrome beacon
#

Please format your code and don't send it as an image 🙏

#

And follow naming conventions

chrome beacon
coral owl
knotty gale
#

I try to add the external jar of spigot to my projects, but my JDE (eclipse) doesn't seem to recgonize it. I can't even use extends JavaPlugin. I am using the shaded snapshot of the spigot file like usual but it isnt working

chrome beacon
#

?bootstrap

undone axleBOT
#

Bootstrap Jar
The main spigot-1.18.jar is now a bootstrap jar which contains all libraries. You cannot directly depend on this jar. You should depend on Spigot/Spigot-API/target/spigot-api-1.18-R0.1-SNAPSHOT-shaded.jar, or the entire contents of the bundler directory from your server, or use a dependency manager such as Maven or Gradle to handle this automatically.

Please read the release notes for further information: https://www.spigotmc.org/threads/9-years-of-spigotmc-spigot-bungeecord-1-18-1-18-1-release.534760/#post-4305163

chrome beacon
#

Make sure it's the correct one

#

Though you really should be using maven or gradle

knotty gale
#

its also making this module info class and that wasnt being made before

buoyant viper
#

java 9+ moment

chrome beacon
knotty gale
#

can someone please teach me how to use/download it

#

its something i know exists but can't like wrap my head around

chrome beacon
#

If you're on windows download its zip extract it where you want it installed and then add the path to the bin folder to the path environmental variable

#

Alternatively you can use Intellij as your IDE it comes with maven preinstalled and it can help you setup Spigot projects with the mc dev plugin

true cosmos
#

I wouldn't mind explaining cli maven too

knotty gale
chrome beacon
#

Maven is a build tool/system. It helps manage dependencies and other build steps

#

Making your project more portable

slender elbow
young knoll
#

Why right aligned

#

Go with F U L L

slender elbow
#

like that one weird line in your word document essay that for whatever reason the spaces are larger but the rest don't do that

young knoll
#

What is full alignment ever used for

sly topaz
winter jungle
#

Is there a way to completely remove the nametag of an npc?

sly topaz
#

if it is a player npc, if it is just a mob then you can just set custom name visible to false

#

the other option is to use team options, but that's kind of annoying in its own way

young knoll
#

Custom name visible doesn’t quite do what it says

sly topaz
#

well, I'll be damned then

young knoll
#

It’s always visible if you are close and looking at the mob

#

Making it “visible” just makes it always show when the mob is on screen

sly topaz
#

well then mounting or team options it is

winter jungle
#

Yea, it's a player NPC. What do you mean by mounting?

sly topaz
#

mounting an entity to it

#

you may use something without a hitbox if it is meant to be clicked, like a display entity or an armor stand with marker option

winter jungle
#

All right, thank you very much. I'll try something out :)

young knoll
#

I think display entities actually don’t hide the name tag

#

Intentionally

#

But a marker armorstand or a 0 size interaction entity should work

#

Alternative use teams

sly topaz
#

though an interaction entity is also a good option, I always forget those exist

young knoll
#

You can definitely have a mob with a normal name plus a text display

winter jungle
# young knoll But a marker armorstand or a 0 size interaction entity should work

I'm probably doing something wrong, but unfortunately the nameplate is still there.

private void createNPC(@NonNull LobbyNPC lobbyNPC) {
      final NPC npc = NPC.create("", lobbyNPC.armorStandLocation());
      npc.setClickHandler(lobbyNPC::interact);
      npc.spawn();

      ServerPlayer serverPlayer = ((ServerPlayer) npc.getSpawnedNPC());

      serverPlayer.setCustomNameVisible(false);
      serverPlayer.setCustomName(null);

      Location loc = npc.getLocation().clone().add(0, 2.03, 0);

      org.bukkit.entity.ArmorStand bukkitStand = (org.bukkit.entity.ArmorStand) loc.getWorld()
              .spawnEntity(loc, EntityType.ARMOR_STAND);

      bukkitStand.setMarker(true);
      bukkitStand.setVisible(false);
      bukkitStand.setCustomNameVisible(false);

      net.minecraft.world.entity.decoration.ArmorStand nmsStand = ((CraftArmorStand) bukkitStand).getHandle();

      ClientboundSetEntityLinkPacket linkPacket = new ClientboundSetEntityLinkPacket(nmsStand, serverPlayer);
      ClientboundRemoveEntitiesPacket removePacket = new ClientboundRemoveEntitiesPacket(nmsStand.getId());

      for (Player player : Bukkit.getOnlinePlayers()) {
          CraftPlayer craftPlayer = (CraftPlayer) player;

          craftPlayer.getHandle().connection.send(linkPacket);
          craftPlayer.getHandle().connection.send(removePacket);
      }

      npc.setLookingAtPlayer(lobbyNPC.isLookAtPlayer());
      npc.show();
}
#

oh gosh i hate discord formatting

jolly creek
sly topaz
jolly creek
# sly topaz can't you just add the bow attack goal to the zombie

In the post it says that I tried to do this but you can't because the bow attack goal takes an entity that implements IRangedEntity which the zombie class does not. So it draws back the bow and when it tries to shoot it throws an exception trying to cast the zombie and just removes it.

sly topaz
jolly creek
young knoll
#

Make your own goal I guess

jolly creek
# young knoll Make your own goal I guess

This is exactly what I am doing, the reason why I am using NMS is to make the entity use the item so that the bow can draw back. There isn't any bukkit API for this.

#

So I am trying to mimic the NMS class in my custom goal and skip the cast to ranged entity.

sly topaz
#

you can probably use MobChipLite for it

jolly creek
sly topaz
#

Paper also has a mob goals API but it is paper only so, yeah

#

let me check if there's anything special about the bow goal attack goal, perhaps you can just clone that class

sly topaz
jolly creek
sly topaz
#

which method are you talking about exactly?

jolly creek
#

So either there is something very unique with the bow attack goal class which I am not seeing or I am not calling it properly, I am just calling once after spawning the entity and setting its main hand to a bow

jolly creek
#

Or were you talking about the NMS method?

sly topaz
#

no, that was the one

#

I have the feeling you'll have to create a custom entity to implement the necessary method, but let me check just to be sure

jolly creek
# sly topaz I have the feeling you'll have to create a custom entity to implement the necess...

I was planning on doing that but for these zombies I have a unique way I want the arrows to fire so it would make more sense to just create a custom goal rather than making the custom entity. I was thinking it could be some restriction of drawing the bow back in the item use call that is silently failing but this can't be the case because the vanilla bow attack class can be put on the vanilla zombie and it does draw the bow back.

#

It is very strange because if I call the useItem method from mob chip lite on a skeleton then it will draw the bow back just fine and will get stuck at the max pull back position. But when I do the exact same thing to a zombie that has a bow in its main hand then it does nothing.

#

@sly topaz Thank you for the help but I just solved it. For some reason you just have to wait 2 ticks after the mob is spawned before you call the use item method. Lol I wasted so much time on this XD

rotund ravine
#

Everything always work after u wait a few ticks totally

wet breach
winter jungle
earnest girder
#

if I need each player to have their own scoreboard for stats

and I also need players to only be able to see the nametags of players in their faction

is this possible with teams?

sly topaz
#

if so, yes it should be possible

earnest girder
#

each player needs to have their own stats on the side bar,

and each faction of players needs to have a team that restricts nametag visibility to just each other

sly topaz
#

yeah, it should be fine

#

unless you're like in 1.8 and are using team prefix/name/suffix in order to extend scoreboard line length

#

it would still be possible, just a bit more annoying

gray saddle
#

hey i noticed you're able to use 1.21.6 spigot api now

#

i couldnt figure out how to set the harness for a happy ghast though

paper viper
#

API probably isn’t even there

cursive kite
#

I am trying to remove items from my GUI if a player leaves their items, except if they shift click the item and then close the inventory it dupes the item

    public void onCloseRunicTable(InventoryCloseEvent event) {
        Inventory inv = event.getInventory();
        if(!event.getInventory().getName().equals(TITLE)) return;
        Player player = (Player) event.getPlayer();
        User user = Server.getUser(player);
        ItemStack enchantingItem = inv.getItem(20);
    
        if(enchantingItem != null && enchantingItem.getType() != Material.AIR) 
            user.addItem(enchantingItem, true);

        ItemStack runeItem = inv.getItem(24);
        if(runeItem != null && runeItem.getType() != Material.AIR)
            user.addItem(runeItem, true);
        
    }```
worldly ice
#

are you in creative

#

also don't check inventories using their name

#

?gui

cursive kite
#

I wish.. survival

worldly ice
#

and it's not a ghost item?

cursive kite
#

Welp... now I feel stupid

#

should I player#updateInventory on close?

worldly ice
#

the item's client sided so idk if that has an effect on it

#

but i would try it in case

cursive kite
#

Thank you!

worldly ice
#

and even then it shouldn't be a big issue anyways since it is a ghost item and the player won't be able to use it

worldly ice
mortal hare
#

how tf can you put efficient SQL persistence without sacrificing on performance in OOP without going anemic

#

i just dont understand how people push rich domain models but still put persistence in service classes

#

doesnt that still make your code anemic in a sense that you still manually sync persistence between the database

#

right now i made a service which constructs lazy loaded proxy classes which loads data according to repository class method operation (get, create etc), but i see this approach as brittle one since it only works simple CRUD operations

#

this just kinda proves that DDD is broken, and doesn't reflect real life apps without ORM.

#

this just proves that anemic operations are simply better with validator predicate interfaces for validating data instead of making mapping and bashing gc for no reason

young knoll
#

I don’t see how having low blood oxygen would help

storm wind
#

If I have an economy plugin and I keep the nickname with a uuid, there may be 2 or more identical nicknames with different uuids. How do you solve this? For example, I need to have nickname support for commands like /money pay <nickname> and have it work for offline players. I was thinking about the solution of /money pay <nickname> searching the database for the player with that nickname with the most recent login time if they are not online, that is, it would add a timestamp to the database that was the date of the last login. Is this the best approach?

chrome beacon
#

Don't let two players have the same nickname

#

or give them another identifier you can use to pay them

storm wind
#

premium player logs in with nickname A. premium player changes nickname to nickname B, cracked player registers account with nickname A and premium player with nickname B has not logged in yet. There will be 2 nicknames with different uuids in my database

young knoll
#

?offline

undone axleBOT
storm wind
#

so my idea would be this timestamp thing and it would solve the problem

chrome beacon
#

💀 Offline mode

storm wind
#

the more players the better

storm wind
#

How many threads are responsible for calling AsyncPlayerPreLoginEvent?

echo basalt
#

It gets called on the player's thread

#

which comes from a thread pool that's configured in the server settings iirc

dawn flower
#

is it safe to check an item's pdc everytime a player drops it?

#

or can it cause a crash

chrome beacon
#

it's fine

mortal hare
#

i love this

sly topaz
#

I think they conflate a bit too many things there

slender elbow
#

theprimetime

#

peepowalkaway

lilac dagger
#

clean code doesn't have to have horrible performance

lapis schooner
#

My custom NMS entity causes this very funny connection error. How does one get a EntityDataAccessor or otherwise store a EntityReference<LivingEntity> in nbt without causing this?

chrome beacon
#

How about using pdc to store data

#

?pdc

trim quest
#

There is a philosophy of abstraction in all basic sciences.

pastel nova
#

Hey guys, when creating a plugin with a bunch of subcommands, is there a good way to pass the tabComplete functionality down to the individual subcommands?
I have My main executor which contains the "entry point of my sub commands"
So: ```
MyExecutor

  • UsersCommands
    • UserCmd1
    • UserCmd2
    • ...
  • GroupsCommands
    • GroupCmd1
    • GroupCmd2
    • ...
So in this case my command will be:
`/myCommand <Users|Groups> <cmd>` so each command behaves diffrently and have their own format, some are `<playre_list> add <property_list>`, and other ones are simpler like `<player> delete`, etc...
Currently my main Executor's tabComplete only shows `users` and `groups`, then I want the Users command wrapper to show all possible user commands, same with the Groups wrapper. I found a way to do this but I'm not sure if it's the best approach - is there a standard/better way?
rotund ravine
#

What is your current way.

pastel nova
#

something like this:

@Override
  public List<String> onTabComplete(CommandSender sender, Command command, String label, String[] args) {
    List<String> completions = new ArrayList<>();
    
    if (args.length == 0) {
      return completions;
    }

    if (args.length == 1) {
      
      String userCmd = args[0];

      for (SubCommand sub : subCommands) {
        if (sub.getName().startsWith(userCmd)) {
          completions.add(sub.getName());
        }
      }

      return completions;
    }

    String userCmd = args[0];

    for (SubCommand sub : subCommands) {
      if (sub.getName().equalsIgnoreCase(userCmd)) {
        String[] subArgs = new String[args.length - 1];
        System.arraycopy(args, 1, subArgs, 0, args.length - 1);

        return sub.onTabComplete(sender, command, label, subArgs);
      }
    }

    return completions;
  }```
THis is my tabComplete executor
#

subCommands is this:

subCommands = List.of(
  new HelpCommand(),
  new ListCommand(pm),
  new UsersCommands(),
  new GroupsCommands()
);
```So UsersCommands and GroupCommands are subCommands and Help/List are top level (so u can just do `/mycommand list|help`
thorn isle
#

seems sensible, but replace that for loop and name equals check with a hashmap.get by name

pastel nova
#

yeah thats what I had before, i had a map like sub.getName(), sub but i though why not access it just by the sub.getName()

#

I dont think that time complexity is gonna be a problem since I will always have < 10 items in the list

thorn isle
#

not for the sake of time complexity, but it will be clearer to read and more concise

pastel nova
#

mh ok, but other than that its fine to make things like this

#

because i have the same structure in the sub commands

#

for example my UsersCommands is:

@Override
  public List<String> onTabComplete(CommandSender sender, Command command, String label, String[] args) {
    List<String> completions = new ArrayList<>();
    
    if (args.length == 0) {
      return completions;
    }

    if (args.length == 1) {
      return Bukkit.getOnlinePlayers().stream().map(p -> p.getName()).toList();
    }

    for (SubCommand sub : subCommands) {
      if (sub.getName().startsWith(args[1])) {
        completions.add(sub.getName());
      }
    }

    return completions;
  }```
thorn isle
#

this is as close to the "standard practice" as one gets by implementing commands and tabcomplete from scratch; recursion, command nodes in a tree structure, and oop

pastel nova
#

mh okok

#

thanks

rotund ravine
#

Jkjk

mortal hare
#

people in video state that they shouldnt abstract until they fully have working prototype

#

as you cant predict proper abstractions you might need until you see whole context and your development time will be greatly reduced

trim quest
#

"Premature optimization is the root of all evil." - Donald Knuth

mortal hare
slender elbow
#

the problem is using windows

trim quest
mortal hare
trim quest
#

the only performance-critical code is only %3 of program, you dont have to worry about performance till you make a program.

mortal hare
#

im not saying it should be very efficient, but sometimes there's blatant performance issues lying around in the code and no one bothers to fix them because muh clean code practices

#

you shouldnt design your programs like API's, you expose api's for a reason

#

if i cared about efficiency i wouldnt program in java

#

and opt in for assembly or c

rough drift
mortal hare
# trim quest what

some people do so many abstractions in their internal code that it looks as if the program's code itself was designed to be used externally and not its functionality

rough drift
#

clean code comes as a bi-product of a well-engineered, highly-modular and scalable system

mortal hare
#

next topic. how do you guys stored dates in databases? do you use local dates with UTC conversion prior or just store the timezone anyways

rough drift
mortal hare
#

i mean from clientside you can also seek for system time's timezone for conversion so what's the point of storing it inside db apart from storing for audits or smth

rough drift
trim quest
#

Casey has an approach that throws things like tdd,ddd right out the window. Abstraction is needed when you deal with complex domains such as e-commerce, banking, insurance

#

you cant basically apply that to these domains

#

i mean his approach

rough drift
#

DDD is applicable in all domains though

trim quest
#

yes i know

#

i give it a example

#

some low-level coders dont know what domain is

#

im explaining it in this way

rough drift
#

fair point

#

wait do you mean low-level

mortal hare
rough drift
#

as in unskilled

#

or asm level

trim quest
rough drift
#

fair point

trim quest
#

for ex

#

C is lower than java

#

but its not low-level lang

mortal hare
#

predicting abstractions without having proper working code is very hard unless you've solved similar problem before

trim quest
#

if you dont have any experience about new domain

#

you have to practice more and try to find best practices

#

each domain have its best practices

#

There are 2 main concept in DDD -> Tactical Design and Strategical Design

thorn isle
#

you guys have way too much free time

#

just make it work

#

simple as

mortal hare
#

but isnt that overcomplicating a problem tbh? I mean good architecture is great but the software will never get perfect anyways and as the days gone by it will become dead code anyways so why bother. There's a saying "code duplication is far cheaper than wrong abstractions" which clearly denotes this.

trim quest
#

in big domains without DDD, product will be big ball of mud and basically you cant even update it. DDD solves that and seperates contexts(bounded context -> which is we use in real world in microservices).

mortal hare
#

i'd rather have a huge chunk of functional code which can be refactored into abstractions than having to deal with improper ones in the first place

trim quest
#

each update will make it more complex and hard to maintain

#

bad oop practices is also reason of big ball of mud

mortal hare
#

but you cant produce pure oop that's inferior

#

java is not inferior itself as its mix of OOP, procedural and functional paradigms

wet breach
wet breach
#

in what ?

mortal hare
#

garbage collection and byte code interpreting slows it down

slender elbow
#

does it really?

wet breach
#

byte code interpretation only happens once

slender elbow
#

it's very much comparable, sometimes it's faster, sometimes it's slower

wet breach
#

that is when the class is loaded

echo basalt
#

uh

slender elbow
#

"C is faster" was the case 20 years ago

echo basalt
#

not strictly once

trim quest
main basin
echo basalt
#

I forgot the exact names but there were 4 stages

slender elbow
#

idk who that is

#

nor do I care

echo basalt
#

bytecode interpretation was the first stage

slender elbow
#

I just get shit done, then I care about cleaning it up

echo basalt
#

JIT was another

#

iirc

#

something like that

trim quest
echo basalt
#

as the code is hotter and hotter it runs in the different areas

trim quest
#

he is successfull person but radical af

slender elbow
#

cool I still don't care

trim quest
#

😦

echo basalt
mortal hare
echo basalt
#

recommend watching this

chrome beacon
wet breach
#

anyways, Java has come a long way in terms of efficiency however that is also thanks to hardware becoming efficient too

#

otherwise if that wasn't the case then yeah Java would probably still be somewhat horrible XD

trim quest
#

such as insurance

main basin
chrome beacon
#

No

#

Just run BuildTools and it'll work

wet breach
#

but sometimes, you don't need to do anything though. Someone waiting a second or two isn't the end of the world either lol

echo basalt
trim quest
#

for example if you have expertise on insurance and zero knowledge on banking

#

you have no clue about optimization

wet breach
trim quest
#

you have to build your domain knowledge first if you are new on that domain

#

then you can optimize it

wet breach
#

you might not be able to do all the optimizations you might otherwise be able to do because of that, however its just a matter of breaking down what is important and what is not so important

#

transactions being processed quickly is more important then the app being responsive for example

#

many developers just think everything is important is all

#

and try to optimize everything XD

trim quest
#

i mean that only 3% of the software is performance critical; trying to optimize the rest is a waste of time

#

more important is domain knowledge

wet breach
#

that is not accurate

#

if you say so, you don't need domain knowledge to know how to break stuff down to what is or is not important

#

they used to teach this in school you know

trim quest
#

this is Donald Knuth's famous quote

wet breach
#

don't care

#

they are a person I have not once followed or heard about so they must not be a big enough deal

wet breach
#

sure, software isn't dependent on the domain, it works the same regardless

trim quest
#

i wonder what you understand while saying domain

wet breach
#

you just mean categories

#

you are just using domain as a way to use a different word then that, but its just categories or areas of business that is different. They have different needs, before your fancy use of domain this has not been a mystery or something new

#

we all know that insurance use different parts of a calculator then a banker does, but at the end of the day its still a calculator

trim quest
wet breach
#

was it even needed to begin with?

trim quest
wet breach
#

not everything needs to talk to each other, IE does the calculator really need to connect to the internet to function? Does it need to communicate with some other apps what would the benefit be if some other app connected to it?

trim quest
wet breach
#

in otherwords, just keep it simple 🙂

main basin
wet breach
#

you don't need all the versions? unless you are trying to support them all