#help-development

1 messages · Page 912 of 1

worthy yarrow
#

er more like why do you have this print? Debug thing rn?

molten hearth
#

yea

#

it was a debug thing

worthy yarrow
#

Gotcha haha

molten hearth
#

ive never used a debugging feature in the past like 15 programming languages ive used except print

worthy yarrow
#

No worries, that's why I was so confused... that's just gonna spam your console D:

#

true
true
true

#

etc etc

#

That'd be a fun log to sort through

molten hearth
#

yeah except its always false

#

false

#

false

#

😭

worthy yarrow
#

Try moving it into the if(below.compare) body

#

I don't think it will do anything but hey who knows... I've had issues where moving a single line fixes all of it

molten hearth
#

i mean its fine the player isnt on fire i have to code that

molten hearth
#

nope

worthy yarrow
molten hearth
worthy yarrow
#

Order of events should follow correctly then... odd how it only prints false

#

Perhaps try a helper method that'll print based on if the player if fired up or not...

molten hearth
#

oh no I mean itll print true but my method for checking if the player should be on fire sucks

worthy yarrow
#

ig just call it where the original print is?

#

Ohhhhh

#

gotcha

molten hearth
#

ill be standing 70% in the fire and its not the block below so its false lmao

worthy yarrow
#

Are you not gonna try this?

#

Also this one

molten hearth
#

yeah I will

#

but

#

my math isnt on point

#

im apparently looking at blocks in unloaded chunks

#

while trying to loop over the nearest blocks

#

😎 👍

worthy yarrow
molten hearth
#

🤷‍♂️

#
public static boolean isOnFireNearby(Pos centerPos, int range, Instance instance, BoundingBox boundingBox) {
        int centerX = (int) centerPos.x();
        int centerY = (int) centerPos.y();
        int centerZ = (int) centerPos.z();

        for (int x = centerX - range; x <= centerX + range; x++) {
            for (int z = centerY - range; z <= centerZ + range; z++) {
                Pos pointPos = new Pos(x, centerY, z);
                if(instance.getBlock(pointPos).compare(FIRE)) {
                    return true;
                } else {
                    System.out.println(instance.getBlock(pointPos));
                }
            }
        }

        return false;
    }```
#

how to math tutorial

#

nah its good copilot figured it out ong 💯

rough ibex
#

copilot...

umbral ridge
#

i have a question about yaml config.

can I set an object with a space in it? eg.

homes:
home1:
world: "world"
x: 0
y: 0

where home1 would be eg.: "home 1" with a space in between e and 1

#

if I use set, and the path contains a space, will it automatically resolve to:
homes:
"home 1":
....

?

worthy yarrow
#

I would say it's a better practice to just use _ as spacing indicator

river oracle
zinc moat
#

Anyone a clue why this is erroring?

worthy yarrow
zinc moat
#

👍

worthy yarrow
zinc moat
#

Yeah i already found it

#

Thanks tho

worthy yarrow
#

The error happens because enchantment mending is a void method that holds all the properties of mending when creating a new itemStack only needs to take a material

zinc moat
#

ohh

worthy yarrow
# zinc moat ohh

Something cool you can do is create an itemstack method that will ultimately serve as a custom item of sorts... within this method you can customize a lot about this item... just gotta have some fun with it

zinc moat
#

interesting

#

quick question
what is <pluginname>-shaded and orginal-<pluginname>

hazy parrot
#

Shaded - with shaded dependencies

#

Original - without

zinc moat
#

shaded dependencies?

hazy parrot
#

Yes?

zinc moat
#

no clue what that is

hazy parrot
#

Dependencies you shaded into your jar

zinc moat
#

It's already fixed.

worthy yarrow
#

He's new

zinc moat
#

yup

#

and uhh my brain hurts

#

my plugin dont work and its not erroring

worthy yarrow
#

Add debug statements

#

ie system.out.println

zinc moat
#

return false;

worthy yarrow
#

Send code

zinc moat
worthy yarrow
#

?paste

undone axleBOT
worthy yarrow
#

send the link after you finish the paste

zinc moat
worthy yarrow
#

I bet you didn't put the command in your plugin.yml

zinc moat
#

i bet you i did

worthy yarrow
#

if (player.getInventory().containsAtLeast(new ItemStack(Material.IRON_ORE), 32)) {
if (player.getInventory().containsAtLeast(new ItemStack(Material.GOLD_ORE), 32)) {
Both of these are incorrect

zinc moat
#

What is it suppost to be?

worthy yarrow
#

I don't think you use containsAtLeast, nor do you check for a "new" itemstack. The new modifier implies that you are creating a new itemstack which is not what you are trying to do. In the case of you wanting to check if the player has a certain amount of items, you can iterate through the player inventory using a for loop that will let you go through the whole inventory and find items that way

#

in the case of the inventory having iron ingots then you can apply mending to them that way

kindred sentinel
#

Is there a way to improve tps by turning off light of redstone?

zinc moat
worthy yarrow
#

So you just want the iron in the inventory to get mending?

river oracle
lost matrix
zinc moat
lost matrix
worthy yarrow
#

he's new

zinc moat
#

yh

worthy yarrow
zinc moat
#

oh

lost matrix
zinc moat
worthy yarrow
lost matrix
worthy yarrow
#

Just a simple println will be fine

zinc moat
#

why not the try catch if i may ask?

#

this is the try catch i ment

worthy yarrow
#

There's no reason to debug with try catch especially when it's something this simple

worthy yarrow
#

Also it's not specifically for debugging

zinc moat
#

oh

lost matrix
# zinc moat why not the try catch if i may ask?

try catch is used to catch critical exceptions at intricate positions in your code.
It is used to handle fails gracefully. In your case it wouldnt even print anything to console because you are
not producing an exception.

worthy yarrow
#

It can be used in much more complicated processes, ie: where data should go or be handled based on certain scenarios

river oracle
zinc moat
#

so smthing like sout would just do it?

kindred sentinel
worthy yarrow
zinc moat
#

makes me happy

river oracle
worthy yarrow
#

That's all you need for debug statements tbf

river oracle
#

You're running through that circuit like a couple times a second

kindred sentinel
river oracle
#

That's bound to be somewhat slow

zinc moat
#

alrigth

#

so i got iron

#

but it does not print

river oracle
worthy yarrow
worthy yarrow
zinc moat
zinc moat
kindred sentinel
worthy yarrow
zinc moat
worthy yarrow
#

That's my point, what is it supposed to do when it's done

zinc moat
#

uhh its like an auto compressor plugin so it checks if the player has 32 of a item and "compresses" it

worthy yarrow
#

Compresses it into a block?

zinc moat
#

no into an item

worthy yarrow
#

That item being (material + mending)

zinc moat
#

yeah

void vapor
#

hello i have a problem, i can't access to the InitialHandler class in my bungeecord plugin

worthy yarrow
#

So then basically I believe you still have to iterate through the player inventory to get the materials in order to check if A: it's at least a stack of 32, and B: it's an item you want to be compressible. After that, you just do the same logic for giving the player the compressed item, and remove the original stack of items

void vapor
#

InitialHandler con = (InitialHandler) event.getConnection();

zinc moat
#

how do i loop thru an inventory tho

worthy yarrow
#

let me find an example

zinc moat
#

i think it would be much easier to loop thru an inventory and just remove all the iron and change the iron to iron with mending

zinc moat
#

😭

static gull
#

hi i wanted, to set custom item in mythicmobs, to after all, set it as a drops in one of my custom mobs in modelendinge, but when i'm using /mm items import name
i can see an error in console, (it has custommodeldata, and custom name) what can i do in this situation to set it right?

worthy yarrow
# zinc moat oh

The implantation you currently have only adds a single iron with mending, as well as keeps the original items haha

zinc moat
void vapor
#

Please can someone help me!!
i have a problem, i can't access to the InitialHandler class in my bungeecord plugin

import net.md_5.bungee.connection.InitialHandler;

but i have the bungeecord-api in my classpath

zinc moat
worthy yarrow
#

it is

zinc moat
#

oh

#

mb Le S

worthy yarrow
#

People know bungee here, just gotta be patient

static gull
zinc moat
#

nope

worthy yarrow
#

This should iterate through every item stack in the players inventory

rare ridge
#

Hello, is it possible to somehow disable the chorus flower growth logic?

zinc moat
zinc moat
zinc moat
undone axleBOT
#

For Beginners:

Codecademy - Learn Java: Interactive Java programming course from basics to more advanced concepts. Perfect for absolute beginners.
https://www.codecademy.com/learn/learn-java
JetBrains Academy - Java Developer Track: Learn by doing with projects and challenges. It covers Java fundamentals to advanced topics.
https://www.jetbrains.com/academy/
Udemy - Java Programming Masterclass for Software Developers: Updated courses that cover Java 8 to Java 17 features. Suitable for those who prefer structured learning.
https://www.udemy.com/course/java-the-complete-java-developer-course/

For Intermediate to Advanced Learners:

Oracle Java Tutorials: The official guides by Oracle for Java programming—great for understanding the depth of Java.
https://docs.oracle.com/javase/tutorial/
Baeldung - Learn Java and Spring: Focus on Spring Framework and modern Java technologies. Best for intermediate learners aiming to expand their knowledge.
https://www.baeldung.com/

Practice and Hands-on Learning:

Exercism - Java Track: Solve exercises and get feedback from mentors. Great for practicing coding skills.
https://exercism.io/tracks/java
LeetCode: Practice your coding skills and prepare for technical interviews with Java.
https://leetcode.com/

Free Resources and Documentation:

Java Programming and Documentation: A comprehensive collection of Java programming guides, tutorials, and API documentation.
https://docs.oracle.com/en/java/

Community and Support:

Stack Overflow: A vast community of developers. Great for getting help with specific problems or understanding concepts.
https://stackoverflow.com/questions/tagged/java
r/learnjava on Reddit: Join the community of Java learners and get advice, share resources, and discuss projects.
https://www.reddit.com/r/learnjava/

Remember: Learning to program takes practice and patience. Don't hesitate to experiment with code and participate in community discussions. Happy coding! 🎉

worthy yarrow
#

So you're checking ItemStacks (in) : player.getInventory.getContents

zinc moat
#

?idontlikeacademys

#

?youarenothelpingme

icy beacon
#

If you don't know a programming language you're gonna have a very very very hard time coding a project in that language, let alone with a library

zinc moat
#

?NuclearKatIsHelpingMeAndIappricateHimVeryMuch

icy beacon
#

Give a man a fish,

shadow night
#

When I tried coding a mod without knowing java I quit very quickly

zinc moat
#

?YouWhereABeginnerOnceTooSoIthinkYouShouldStfu

shadow night
#

Then I learnt java and now it's fine

icy beacon
#

So you're not gonna take a hint ezed

#

Well kudos to your determination

shadow night
#

Beginers don't have the ability to think rationally

zinc moat
#

Ok?

shadow night
shadow night
worthy yarrow
#

Sometimes it's best for a beginner to receive a bit of support at the beginning in order to introduce them to new concepts and processes to encourage further development of their knowledge

zinc moat
#

If you get anoyed so easily just ask the owner or sum for like a seprate channel for beginners and intermediate coders

shadow night
icy beacon
worthy yarrow
#

Why do you think I said "a bit"

#

I'm not going to spoonfeed him an introduction to java

zinc moat
shadow night
#

I learnt for loops before java lol

icy beacon
#

You don't read a book in a foreign language and go around asking what every word in the book means

icy beacon
worthy yarrow
#

But when you offer a little bit of patience and support it allows them to learn more from what you're trying to help with. Not only that, it can be easily saved for future use and what not. Another point is just that physiologically a person is more inclined to learn a subject when other people around them are interested and willing to at least point in the correct direction... You don't have to feed the man or even teach him how to fish, just fish with him

icy beacon
#

Just learn the language dude. At least the basics

#

You'll find yourself coming here much less frequently

shadow night
#

A good thing to learn is: googling

#

If you can google, you don't need a support channel

icy beacon
#

There is also a better one

#

?learnjava!

undone axleBOT
icy beacon
#

Not updated :cope:

worthy yarrow
#

But you proceed to treat is as, you're not allowed to ask questions when you don't know anything about the subject which is just wrong... They should always be allowed to ask questions... Yes they should probably use their own search engine first but the point is just that you shouldn't shoot someone's question down by saying "learn java"

icy beacon
#

Eh it's a place for a lot of stuff

shadow night
#

But not learning langs lol

icy beacon
#

I remember a discussion ongoing in this channel whether existing was a violation of OCP

worthy yarrow
#

I know, like I said, use your search engine first but don't just be an ass and tell any beginner to go learn java... that's very condescending and utterly demotivating

#

Just put it in a nicer way man

#

"Hey there are places that are better for learning so and so"

#

That's all it's gotta be man

shadow night
worthy yarrow
icy beacon
#

Coly how I'm going to bed

#

Welcome to Gboard clipboard, any text you copy will be saved here.

shadow night
echo basalt
#

"hey we're going to get technical and we need someone that understands what we're saying"

worthy yarrow
#

Another point to take into consideration, is just the simple fact of someone might be learning java through minecraft framework...

icy beacon
#

Learning through doing is only valid if you at least know the syntax

shadow night
#

I definitely did not learn java through bukkit lmao

icy beacon
#

Same..

echo basalt
#

I definitely did

shadow night
#

But I did have experience in other langs before so it's ok ig

icy beacon
#

Same again

echo basalt
#

Yeah same

worthy yarrow
icy beacon
#

Yup you did the right thing

zinc moat
#

hi guys yall still arguing or something?

icy beacon
#

Discussing

#

If that's allowed

worthy yarrow
#

Again, the person should obviously try to learn the language but sometimes instead of being a dick, you could always just be nice and offer the support that you're willing to. ie: offer the links and again, just be nice about it

#

I see so many people getting into it after asking simple questions and it's kinda sad

worthy yarrow
shadow night
#

Because that's how it has to be

icy beacon
#

There were some spontaneous aggressive statements here and there in this convo but overall more or less civil

worthy yarrow
# shadow night Because that's how it has to be

Why does it have to be that way? It seems like most of you just don't have the patience to offer a little support which I get, it's probably below your skill level by like 5 years but we all did start somewhere and the more support that can be offered to those who are starting, the easier it's going to be on everyone considering most people here don't like those beginner questions

shadow night
torn shuttle
#

I don't even know what the context of the discussion here is but there is a big difference between being new to programming and being new to the spigot api

#

people here are generally fine with helping you even with the most basic spigot api questions imaginable

icy beacon
#

Well it's fine if there's 1, maybe 2 questions that are related to the very very basics of the language. Any more than that and you are now obligated to visit ?learnjava to avert crises

torn shuttle
#

they are not fine with teaching people how to program line by line

icy beacon
#

Valid

torn shuttle
#

we don't expect people here to know how an itemstack works but we do expect you to know how to use just about any class in the api by looking at its documentation, with maybe just a couple of exceptions

worthy yarrow
#

I understand that but it doesn't always have to be "You don't know the language go learn idiot" Which is 90% of the cases when it comes to beginners trying to ask something... At least from what I have seen

torn shuttle
#

yeah and 90% of the time those people get told to go learn java, as well it should be

icy beacon
#

You are right, there's often no need for negativity, but I didn't see much negativity in the convo anyway. What is the argument about?

worthy yarrow
rough ibex
#

what is happening

icy beacon
torn shuttle
#

and these are the same people that see this same question show up many, many times a day

#

for years

worthy yarrow
#

So then it goes back to the etiquette of "if you don't have something nice to say, don't say it at all"

torn shuttle
#

that's not how it works

worthy yarrow
#

Why not?

icy beacon
#

NuclearKat, at least in this particular instance the individual denied the VERY neutral offer to learn Java. There was no negativity, just a ?learnjava thrown in the conversation. No rudeness was sparked until a bit later on

torn shuttle
#

why would it be

worthy yarrow
#

You as a person can make it how it works

icy beacon
#

So I rest my point here I guess

torn shuttle
#

clearly you observe that it isn't

worthy yarrow
#

Same as everyone else

torn shuttle
#

thus it isn't

icy beacon
#

On the fact that the argument kinda stemmed from nothing

worthy yarrow
torn shuttle
#

well, too bad

#

it is the way it is

worthy yarrow
#

Guess it is too bad everyone is a dickhead

#

That's just life innit

torn shuttle
#

I think we're lucky in the first place that there is a place you can ask questions for this api and that is generally well-versed enough and populated enough that you can usually get an immediate answer to most basic questions 24/7 free of charge

#

nothing about the current setup is guaranteed

ivory sleet
#

Bru wtf

#

I mean this channel is for help, if you’re not willing to help then don’t be here

worthy yarrow
#

I'm not going to refute any of your points because they are all solid. Again, it's just so sad that beginners can't even ask something without getting yapped at to learn java

#

100% they should learn the language before messing with an api

#

But again, it doesn't have to be brought about so rudely

ivory sleet
#

@zinc moat Im sorry for any rude behavior here, it shouldn’t be the case, even in the case of being a beginner

zinc moat
#

its fine

#

im just a little sad that people dont help and are rude in a help channel

#

but NuclearKat is really helpfull!

torn shuttle
#

you are more than welcome to go open a new discord server called christian-spigot where you can enforce your own etiquette and staff it with your own people and have the utopia you seek, and not be at the mercy of the state of mind of whoever is online at a given time in spigot's help channels, and let me tell you you can take cmarco with you, he would love that

ivory sleet
#

lets calm down

worthy yarrow
#

That's disappointing

torn shuttle
#

I'd be very happy if you take cmarco tbh

ivory sleet
worthy yarrow
#

@zinc moat fine if I share the first thing you messaged me with con?

zinc moat
#

sure

worthy yarrow
#

This is the reason I started yapping @ivory sleet it happens all too often

ivory sleet
#

ugh well, id appreciate if you talked to us discord helpers instead of making a fuss about it here

#

drop it

worthy yarrow
#

I was too involved tbf

ivory sleet
#

yea, well in any case, lets just start from fresh

torn shuttle
worthy yarrow
#

Again, disappointing

worthy yarrow
zinc moat
#

oh

#

i didnt even relise minecraft had a 1.4

torn shuttle
#

buddy

#

when I started playing minecraft it was in infdev

worthy yarrow
#

well usually projects start from 1.0

zinc moat
#

minecraft old as hell 💀

worthy yarrow
#

Sometimes before 1.0 too

torn shuttle
#

I remember a time when there were in-game player npcs

#

and no survival mode on servers

zinc moat
#

oh

torn shuttle
#

infdev was before that

#

Ithink

#

that doesn't sound right, was prealpha before infdev?

#

it's been a while

#

right

#

oh right yeah

#

that would've been 2009

#

I remember playing minecraft around when the economy crashed

sullen wharf
#

So you remember playing it today?

zinc moat
#

yeah i know most of those versions but i thouth after all of those it was 1.8.x

torn shuttle
#

my stock porfolio indicates that the economy did not, in fact, crash today

sullen wharf
#

fair

#

would enjoy some stock investment tips

#

life is hard

torn shuttle
#

matter of fact nvidia's out here acting like Atlas carrying the entire thing

zinc moat
#

idk

wet breach
#

btw

#

if you ever get enough money, recommend getting a catastrophe bond 😛

#

might as well bet on them apocolypses

pulsar parcel
#

Hi, I am trying to make a parent class Configs, that would have a register method, where it puts it's child classes to a List<? extends Configs> and my thoughts were to make Main.configs.add(this); int the parent register method and then just run register() in constructor of each child class. But the problem is, that in the parent class, I can't put this in to the method, because it doesn't extend the class. Is there any way how to do it? My code looks something like this (I'm just testing it out)
https://pastebin.com/L84C4aD2

chrome beacon
#

Don't make it static

chrome beacon
#

and this ^^

ivory sleet
#

:)

pulsar parcel
tardy delta
#

dont think config should be plural

pulsar parcel
ivory sleet
#

in general Tada Collection<? extends T> means you only read of said collection

#

and ? super T would mean you only write to said collection

pulsar parcel
#

oh I see

ivory sleet
#

yeah, there is much more to it, but in ur case, that "idea" is enough I think?

pulsar parcel
#

yea

#

it is exacly what I need

#

thanks for the explanation

ivory sleet
#

:), well if u ever need a deeper explanation, just ask away

twin venture
#

Hi ,anyone good with nms , 1.20.4?
trying to spawn body of the player

#

but the Remove does not work

rough ibex
#

it needs a argument

kind hatch
#

?mappings

undone axleBOT
kind hatch
charred blaze
#

can i store data in inventoryholders?

#

someone said its faster than hashmap

twin venture
chrome beacon
#

Depends on what you're doing and where the race condition is

rough ibex
#

into the packet constructor

#

its underlined in red.

dawn flower
#

uh what do i do in a situation where just a small part of the code is too big to show in chat to explain my issue

chrome beacon
#

?paste

undone axleBOT
chrome beacon
#

^^

ivory sleet
#

what type of ops?

twin venture
#

Hi so iam using nms 1.20.4 , and iam using spigot 1.20.4

#

how i can fix this?

twin venture
ivory sleet
#

is ur cache just on heap mem? Or do u use sth like redis?

chrome beacon
twin venture
ivory sleet
#

then that’s fine insolublemouse?

twin venture
ivory sleet
#

what exactly in detail ru doing to achieve this race condition

#

Probably

dawn flower
#

https://paste.md-5.net/jomuhicale.java
and
https://paste.md-5.net/yuzazavowe.cs

so basically my issue is, it's adding the activators to the activators hashmap (i can tell cuz it's working) but in this part of the code

for (String ac : activators.keySet()) {
  try {
    Activator activator = (Activator) Class.forName("missing.plugins.executablepets.activators." + ac).getConstructors()[0].newInstance();
    inventory.setItem(slot, activator.toItem());
    slot++;
    if (slot >= inventory.getSize()) {
      break;
    }
  } catch (ClassNotFoundException | InvocationTargetException | InstantiationException | IllegalAccessException ignored) {}
}```
it's not updating and showing the added activator thingi even tho it exists in the map
#

even if i close the menu and reopen it cuz maybe it didnt update it still isnt showing up

chrome beacon
ivory sleet
#

:,)

median bronze
#

does anyone know a per player worldborder api that can also shrink over a set period like the normal worldborder?

tender shard
tender shard
twin venture
#

i added it , and reloaded maven and builded the new versions

#

but its still send the error

tender shard
#

how do you compile?

twin venture
#

package?

#

clean package?

tender shard
#

that's correct. and which .jar are you using?

twin venture
#

This one

tender shard
#

?paste your whole pom

twin venture
undone axleBOT
twin venture
tender shard
#

this breaks it

#

If you’re using maven for your Spigot plugins (which you should do), it’s easy to make maven automatically save your plugin’s .jar in your plugins folder. There’s two ways of doing this: 1. The lazy way (not recommended) If you only work alone on one computer, you can just directly declare the output location in...

#

do NOT change it in the shade plugin

#

quick fix:

<plugin>
  <groupId>org.apache.maven.plugins</groupId>
  <artifactId>maven-jar-plugin</artifactId>
  <version>3.3.0</version>
  <configuration>
    <finalName>MyJarName</finalName>
  </configuration>
</plugin>
#

then remove the finalName from your shade plugin

#

then mvn clean package and it should work

twin venture
#

ok

#

Its fixed thanks

tender shard
#

np

twin venture
#

do yk how i can add a fake entity ?Dead Body?

#

in 1.20.4

valid burrow
#

ups wrong channel

ivory sleet
#

i think this can be solved with just appending one operation after the other?

#

like if u have a completablefuture

#

myea

#

for instance

#

CompletableFuture.runAsync(() -> {
//get
},executor).thenAccept(() -> {
//save
}).thenAccept(() -> {
//get
});

#

ofc u prob by ALL MEANS want to lock while doing the database calls

echo basalt
#

thenCompose

#

:)

ivory sleet
#

well when u do the database stuff

#

because u wouldnt want two threads writing at the same time

#

I mean ofc, thats in general fine if u rely on some database

#

but then, if u wna use a flat file impl u'd wna lock ofc

tardy delta
#

start a db transaction

echo basalt
#

refuse to support anything other than S3

ivory sleet
#

myea looks fine

echo basalt
#

hm

ivory sleet
#

anyway you might wanna lock even if u're using a databse backend, like lets say u wna write if and only if no threads are writing - like doing stuff optimistically and not enforcingly

echo basalt
#

I need to reorganize this package

ivory sleet
#

well thats when u care about availability (for mc, prob not needed)

#

for the database stuff?

#

I mean I would recommend having like, at least a fixed thread pool of n threads where n is the amount of available processors

echo basalt
#

cached thread pool thumbsup

#

I remember hearing about an issue where high player spikes managed to exhaust the fork common pool

#

and like horrible latency n stuff

ivory sleet
#

yes

#

if u do io stuff w common pool u're trolling

river oracle
#

I think this may be a spigot bug lmao

ivory sleet
echo basalt
#

or just use a diff pool

ivory sleet
#

not really

#

but I would advice so

#

I mean when u involve state, u do wna ensure memory visibility across threads

#

(which u get automatically, by using certain locks that guarantee memory visibility)

ivory sleet
# echo basalt or just use a diff pool

yeah I mean ideally u'd wna have some input measurements of the hardware available or resources so u can define the constraints of the thread pool more concretely

river oracle
#

what the FUCK what?????

#

lmfao

ivory sleet
#

lol

hushed spindle
#

thoughts on item nbt being removed

river oracle
#

finally :PPPP

quiet ice
#

PDC is gone? Good thing I use lore for data storage

echo basalt
#

ah yes my favorite

river oracle
hushed spindle
#

guh

echo basalt
#

using chatcolor as hex

river oracle
rough ibex
#

NBT is not removed

#

its just in a different format

river oracle
#

if its even broken that is

ivory sleet
#

well threads sometimes save outdated values of variables locally, and compiler and jvm can optimize things by reordering which order variables are written to and read from

#

these "optimizations" can make a program behave incorrectly in a concurrent environment where state is accessed from multiple threads

quiet ice
river oracle
#

if you work with older versions put the PDC in the same place as in the newer versions

quiet ice
#

Yeah but the older plugins still store everything in lores, so I'd need to automatically refractor all lore data to PDC; meaning I'll eternally have code I cannot really touch; not making the situation any better

#

But the plugin is too dead anyways for anyone to care

ivory sleet
#

idk

#

i read a book

#

and ive been git blamed for writing bad multithreaded code

quiet ice
#

Conclure is one of the more concurrency-aware persons around here

slender elbow
#

terrible curse

ivory sleet
#

yup

#

ignorance is bliss as they say

quiet ice
#

I can only git blame myself so generally I don't use it heh

river oracle
#

finaly finished my first ever spigot plugin 🥲 the worst is ahead though

#

I gotta make the plugin page

ivory sleet
#

a big W for finishing something

river oracle
#

its small atm but I figure I'd start small or I'd never finish it

#

its in kotlin too :P

rough ibex
#

I finished a plugin but I can't test it because protocollib doesn't work on 1.20.4

river oracle
#

this is why I just use NMS lmfao

rough ibex
#

last time I tried

#

I hate using NMS

river oracle
#

Remapped is amazing

rough ibex
#

I avoid it anyway I can

river oracle
#

plus I have a script to autoupdate versions

rough ibex
#

I'd like to write it once

#

and leave it be

river oracle
#

that's how NMS is for the most part unless you're touching stuff that gets changed a lot

#

I haven't had to update my code since 1.19 and it was just a field to method change

#

most of my stuff works back to 1.17, but I only support 1.20.4 :P

#

just run my upgrade script and make sure nothing exploded and boom I'm done

rough ibex
#

I just don't see a reason to not use protocollib

#

why switch over

river oracle
#

its harder to use lol

rough ibex
#

Not in my experience

river oracle
#

have you ever use remapped?

ivory sleet
#

I used protocollib, but like, its nice sure, tho some of the names of the packets were outdated

#

so it was hard to navigate

rough ibex
#

I did a little a while ago

ivory sleet
#

which is why im pro nms and netty at this point

river oracle
#

makes life easy as hell

ivory sleet
#

yea

rough ibex
#

no

tender shard
#

packet constructors are much more straight-forward then checking whether the first int or the second int is entity id etc etc

rough ibex
#

git blame just shows you who added what code

river oracle
#
    @Override
    public void broadcastTotemEffect(@NotNull final LivingEntity entity) {
        final var livingEntity = ((CraftLivingEntity) entity).getHandle();
        livingEntity.level().broadcastEntityEvent(livingEntity, (byte) 35);
    }```
ivory sleet
#

oh, no more like people saw who pushed the code that broke production (on github)

#

and it was me

#

so I got blamed

#

but its also a git command

#

a swedish mc server, back in the days

#

almost, tho I stepped out before officially becoming one

#

it was another network, but i applied to xfun is what I meant

#

then idr why I didnt take the job, well thats that

vital ridge
#
@EventHandler
    public void onZombieSpawn(CreatureSpawnEvent e) {

        Entity entity = e.getEntity();

        if (!(entity instanceof Zombie)) return;

        e.setCancelled(true);

        Zombie zombie = (Zombie) e.getEntity();

        System.out.println(zombie.getLocation());

     

        Zombie newZombie = (Zombie) zombie.getWorld().spawnEntity(zombie.getLocation(), EntityType.ZOMBIE);
        newZombie.setCustomNameVisible(true);
        newZombie.setCustomName(ChatColor.RED + "Custom Zombie");

         

    }
dawn flower
#

https://paste.md-5.net/jomuhicale.java
and
https://paste.md-5.net/yuzazavowe.cs

so basically my issue is, it's adding the activators to the activators hashmap (i can tell cuz it's working) but in this part of the code

for (String ac : activators.keySet()) {
  try {
    Activator activator = (Activator) Class.forName("missing.plugins.executablepets.activators." + ac).getConstructors()[0].newInstance();
    inventory.setItem(slot, activator.toItem());
    slot++;
    if (slot >= inventory.getSize()) {
      break;
    }
  } catch (ClassNotFoundException | InvocationTargetException | InstantiationException | IllegalAccessException ignored) {}
}```
it's not updating and showing the added activator thingi even tho it exists in the map
even if i close the menu and reopen it cuz maybe it didnt update it still isnt showing up
vital ridge
#

How doe, isnt the code only running once?

#

When the creaturespawnevent runs

#

Oh lmao im actually dumb

#

yeah

#

Ofc

#

I'll try messing around with spawn reasons

#

Yeah Im testing the spawnreason with an if statement now and no errors, thank you

echo basalt
#

bruh the TAB plugin doesn't support translatable components woeisme this whole update is in shambles

wet breach
#

Lol

echo basalt
#

was planning on releasing an update tomorrow where I localized every message in the server

chrome beacon
#

quick fork TAB

eternal night
#

but I presume md won't just overlook it kekwhyper

#

its just a patch to the DFU

#

go look at net/minecraft/util/datafix/fixes/ItemStackComponentizationFix.java

echo basalt
molten hearth
#

yo chat whats the mathematical difference between the width and depth of a boundingbox

echo basalt
#

one's x one's z

molten hearth
#

yeah thats what i thought

#

what the fuck man

#

fuck this shit

#

🦒

eternal night
#

you basically just patch the PDC conversion there from root level nbt into the custom_data dc

slender elbow
echo basalt
#

this is gonna be a fun night

river oracle
#

@eternal night md probably won't be having a fun time updating this pepe_laugh

eternal night
#

he wont xD

eternal night
#

the items are the chill part

#

when they get to entities shit will go fucking nuts

#

the amount of custom data bukkit/spigot/paper store on those kekwhyper

#

or block entities

#

delicious

river oracle
#

exactly for this reason smh smh

sullen canyon
#

how do they really update them all at once

river oracle
#

I doubt they update them all at once. There is likely some degree of latency

#

if I had to guess some form of redis cache subscription

glass mauve
#

do I check if two things are in the same world just by using equals method?

ivory sleet
#

In general yeah

#

or well, what two things?

glass mauve
#

the player and a Location object

ivory sleet
#

if u wna check whether a player and a location is in the same world you’d first call
getWorld() on the player, and then compare that to getWorld() from the location

dawn flower
#

is there anything like a map that can have 2 of the same key?

glass mauve
#

yeah exactly

ivory sleet
ivory sleet
#

a key that holds two values?

dawn flower
rough ibex
#

generally move players around so that they're in the same game type

dawn flower
#

"test" being the key

ivory sleet
#

you’d need some sort of Map<K,Collection<V>>

rough ibex
#

a Multimap

ivory sleet
#

^

dawn flower
#

k thanks

ivory sleet
#

Guava has HashMultimap, perfect for u as it handles creation and destruction of the underlying collections

glass mauve
#

I am confused though right now, the location object is used to spawn an item frame using packets
but I just saw that I never tell that packet in which world it should be 🤔

rough ibex
#

Locations can have a World

glass mauve
#

yeah but my packet doesnt have that information

#

For the metadata:

#

no place to set the world

#

so I am kinda confused

#

how is it going to know where to spawn?

#

or will it always spawn in the world where the player is located when receiving the packet?

wet breach
#

The server should check which clients it is sending to as its relative to the client for world

glass mauve
#

what happens if someone switches world? will it unload the entity on the client?

wet breach
#

More likely the client will ignore it since it performed a world change

glass mauve
#

wdym?

wet breach
#

Not all packets are processed by server and client depending on their age and what actions have happened

ivory sleet
#

I dont like synchronized

#

for one its not compatible w virtual threads

#

for another

#

I’d advice using ReentrantLock, or maybe a semaphore?

#

its good

#

yeah w reentrant lock u get fairness, try lock methods, lock interruptibly and uninterruptibly

#

very gucci stuff

wet breach
# glass mauve wdym?

Also other packets get sent on world change too. So lets say the entity does spawn after world change. The chunk packets would cause the client to remove the entity because according to the chunks sent to the client it doesnt exist as well as some other update packets

ivory sleet
#

well u get that almost w semaphore also, but semaphores are better in their own ways

eternal night
#

their name certainly sounds cooler

ivory sleet
#

lol, I meant that u can lock on one thread and unlock on another

#

but yea true

glass mauve
ivory sleet
#

typically u do sth like:

#

lock.lock();
try {
//code
} finally { lock.unlock(); }

#

and then even if code inside that scope throws an exception, -

#

Yes

#

Finally runs

wet breach
ivory sleet
#

wdym

glass mauve
ivory sleet
#

I mean

try {

} catch (){

} finally {

}

wet breach
glass mauve
#

ok yeah thats what I thought

#

thats good

ivory sleet
#

if its checked you should have it propagate upwards w the method signature

glass mauve
#

thanks

ivory sleet
#

yea

#

finally is that strong

#

and it needs to be

#

in that case it’d execute after (iirc)

wet breach
#

Finally executed at the end of the block regardless what happened

#

They are handy for cleaning up connections

#

And some other things

ivory sleet
#

Yea well they’re handy for cleaning up no matter what happens

wet breach
ivory sleet
#

very much

#

:3

wet breach
#

You can still catch exceptions and have a finally. Should always catch exceptions and do something when possible about it.

ivory sleet
#

i mean I do something like:

void method() throws StorageException {
lock.lock();
try {
actualMethod();
} catch (GoofyException e) {
throw new StorageException(e);
} finally {
lock.unlock();
}
}

#

storage exception is checked

#

but it can be unchecked also

wet breach
#

And conclube shows a nice example of such

ivory sleet
#

If u prefer

#

only thing is to not catch Exception

#

or well unless u have good reason to do so

#

return inside the try block

wet breach
#

Ah do the unlock in finally because if finally is reached nothing should need the lock as we are out of the code block now

ivory sleet
#

Anyway insoluble

#

I don’t think you need to lock around the cache

#

like you probably wanna decouple the cache, from the actual database stuff

#

All the database stuff should do is to either take a data object and write to it from reading the database, or take a data object and read from it to then write to the database

#

the cache stuff should be responsible of loading up a user data object based of an identifier (like uuid), additionally it might put it in some map since u wna be able to access it later

analog mantle
#

How can I check if a CommandSender is a player?

rough ibex
#

instanceof I believe

analog mantle
#

like

#

cmdSender instanceof Player ?

#

ok thanks

teal venture
#

Anyone have any good spigot GitHub links to projects that are very good to look at for beginners but not super basic

analog mantle
#

Why does my cursor disappear when I type in intellij? How can I fix it?

rough ibex
#

like the pointer or the I

dawn flower
#

look at any basic one

analog mantle
spare mason
#

how can i damage the player like if an entity damaged him with the inmunity frames and all of that

ivory sleet
echo basalt
analog mantle
ivory sleet
worthy yarrow
echo basalt
#

I opened an issue not a pr

#

He uses strings and not comps literally everywhere

analog mantle
ivory sleet
#

“Feature requests are closed”

dawn flower
#
if (e.isShiftClick()) {
  if (e.getSlot() > 0 && e.getSlot() < activators.get(activatorString).size()) {
    Collections.swap(activators.get(activatorString), e.getSlot(), e.getSlot() - 1);
    setMenuItems();
  }
}   ```

this isn't moving it up, there's no errors in the console, am i missing something here?
analog mantle
#

I don't even have VIM installed.

ivory sleet
#

Did u maybe press like insert?

analog mantle
#

nope

ivory sleet
#

Hmm thats weird then

dawn flower
analog mantle
#

It makes my cursor fat when I press insert

#

Im gonna restart my pc and see if it fixes

rough ibex
#

like a square?

analog mantle
#

idk

analog mantle
kind hatch
dawn flower
#

weird

#

oh wait is a map not ordered correctly cuz its entries is a set

#

oh bruh

#

it is

#

linkedhashmap exists thank god

slender elbow
#

I didn't know joshua bloch was god

wet breach
dawn flower
#

how do i move a key up in a linkedhashmap and move it down as well?

#

for example
"A": 1
"B": 2
"C": 3

i want to move C up so it'll be
"A": 1
"C": 3
"B": 2

dawn flower
#

then?

wet breach
#

Use keyset() or values() which returns ascending order

dawn flower
#

i dont want a specific sorting, i want to move a whole value directory

#

also the value isnt an integer

wet breach
#

You really shouldnt need to move something in a map itself. As this is can be an expensive operation

#

So you just do such things on returned values

#

Sortedmap facilitates this. Otherwise use a linkedhashmap if insertion order is important i guess.

dawn flower
#

insertion order is important i just need a way to move the value up if i want to

wet breach
#

You will need to iterate over the map and manually dump into another

molten hearth
#

ye at this point ive been working on this simple collision detection for like 5 hours bruh ```java
/* For reference */

public BoundingBox(double width, double height, double depth) {
this(width, height, depth, /offset/ new Vec(-width / 2.0, 0.0, -depth / 2.0));
}

public boolean intersectEntity(@NotNull Point src, @NotNull Entity entity) {
return this.intersectBox(src.sub(entity.getPosition()), entity.getBoundingBox());
}

public boolean intersectBox(@NotNull Point positionRelative, @NotNull BoundingBox boundingBox) {
return this.minX() + positionRelative.x() <= boundingBox.maxX() - 5.0E-7 && this.maxX() + positionRelative.x() >= boundingBox.minX() + 5.0E-7 && this.minY() + positionRelative.y() <= boundingBox.maxY() - 5.0E-7 && this.maxY() + positionRelative.y() >= boundingBox.minY() + 5.0E-7 && this.minZ() + positionRelative.z() <= boundingBox.maxZ() - 5.0E-7 && this.maxZ() + positionRelative.z() >= boundingBox.minZ() + 5.0E-7;
}

/* my actual code */
for(Pos firePos : getNearbyFires(player.getPosition(), 1, player.getInstance(), player.getBoundingBox())) {
BoundingBox fireBoundingBox = new BoundingBox(1, 1, 1);
var inside = fireBoundingBox.intersectEntity(firePos, player);
System.out.println("inside" + inside);
}does anyone know why `inside` is always fucking completely just garbage 😭 🙏 2/4 block faces are true and 2/4 are false for example
This returns true
Pos[x=2488.0, y=72.0, z=1682.0, yaw=0.0, pitch=0.0] (Fire Pos)
Pos[x=2487.2477273989675, y=72.0, z=1682.527185211678, yaw=-96.659515, pitch=56.08326] (Player Pos)and
This returns false
Pos[x=2488.0, y=72.0, z=1682.0, yaw=0.0, pitch=0.0] (Fire Pos)
Pos[x=2489.516695224516, y=72.0, z=1682.569168189597, yaw=86.72293, pitch=82.06115] (Player Pos)```

#

with the player's boundingbox being [-0.3 : 0.3] (minx, maxx) [0.0 : 1.8] (miny, maxy) [-0.3 : 0.3] (minz, maxz)

#

the math aint mathing anymore

wet breach
#

Half true and half false making a whole

molten hearth
#

idk man im trying to check if im standing in a fire and if I stand on 2 out of the 4 blocks near the fire block (except the 4 other blocks on the diagonal i ignore those atm) it returns true for 2/4

#

this is apparently true for example (I dont think it is buddy but whatever the math says)

wet breach
#

I mean you are on half the blocks?

molten hearth
#

on the other sides i can literally be in the block and itll return false

young knoll
#

Why aren’t you using the built in bounding box stuff

analog mantle
molten hearth
#

limitation skill diff

worthy yarrow
analog mantle
#

it does

worthy yarrow
#

?

wet breach
#

So why we minusing 5?

#

I think maybe your offset is off?

molten hearth
#

(im actually using the minestom api but im quite sure this is a mathematical skill issue)

wet breach
#

It is

worthy yarrow
# analog mantle it does

The cursor turns into that tiny line where you’re typing… so that’s just base os functionality

wet breach
#

There is some numbers or assumed numbers that are not correct

analog mantle
wet breach
#

You should output each stage of the equation

molten hearth
#

im not too sure what the role of the 5 is

worthy yarrow
analog mantle
#

it does it for you too

molten hearth
#

i assumed it was some mathematical rule for boundingbox calculation lmfao

wet breach
wet breach
#

For example 4 blocks share a corner coord. But if you want the center of a block its measured from bottom right of the coord if i recall

molten hearth
#

with one of the True cases for example ```
Pos[x=2507.0, y=72.0, z=1662.0, yaw=0.0, pitch=0.0] - Fire Pos
Pos[x=2507.4823801380167, y=72.0, z=1661.3185049153367, yaw=-1.6994896, pitch=86.026634] - Player Pos

ResultPos[x=-0.48238013801665147, y=0.0, z=0.681495084663311, yaw=0.0, pitch=0.0] - Substraction Result```

#

ill update it in a sec with the other steps

#

ah this equation is so complicated god dayumn

wet breach
#

Lol

#

Not even sure why you need this complex math for something so trivial

#

Just surround the fire with a bounding box. Check if player is in the bounding box

#

The fire itself is only so large. And if you want them to still get like burned for being close, adjust the bounding box out accordingly

young knoll
#

On spigoot it’s literally just BoundingBox.of(block).overlaps(player.getBoundingBox())

#

:p

wet breach
#

Yeah

molten hearth
#

im just trying to check if the player overlaps with the fire's bounding box

#

someone told me fire doesnt have a bounding box but thats another story

wet breach
#

Well it shouldnt be that hard, or need complex math even if you wanted to do it manually

wet breach
#

But regardless you can just make your own for it

molten hearth
#

well to be fair i tried to make a boundingbox bigger than width 1 height 1 and depth 1 but then i dont even know what the fuck happened

#

i ended up having issues like 3/4 sides would always be true and 1 side would just never be true

wet breach
#

Ah the problem with using 1's

molten hearth
#

am i not supposed to use 1 for a 1 by 1 block 😭

wet breach
#

No just in math when you do some calculation 1s and 0s cause issues is all

molten hearth
#

also it seems my issue is with specifically java boolean p6 = fireBoundingBox.maxZ() + positionRelative.z() >= boundingBox.minZ() + epsilon;

#

well maybe more than that

#
                        double epsilon = 5.0E-7;
                        boolean p1 = fireBoundingBox.minX() + positionRelative.x() <= boundingBox.maxX() - epsilon;
                        boolean p2 = fireBoundingBox.maxX() + positionRelative.x() >= boundingBox.minX() + epsilon;
                        boolean p3 = fireBoundingBox.minY() + positionRelative.y() <= boundingBox.maxY() - epsilon;
                        boolean p4 = fireBoundingBox.maxY() + positionRelative.y() >= boundingBox.minY() + epsilon;
                        boolean p5 = fireBoundingBox.minZ() + positionRelative.z() <= boundingBox.maxZ() - epsilon;
                        boolean p6 = fireBoundingBox.maxZ() + positionRelative.z() >= boundingBox.minZ() + epsilon;

                        System.out.println("p1" + p1);
                        System.out.println("p2" + p2);
                        System.out.println("p3" + p3);
                        System.out.println("p4" + p4);
                        System.out.println("p5" + p5);
                        System.out.println("p6" + p6);```
#

this is the code im trying atm and it seems p6 is returning false when it should be true or true in cases it should be false 🤔

#

how to use z axis tutorial 🙏

#

the full example would be java Pos[x=2505.0, y=72.0, z=1681.0, yaw=0.0, pitch=0.0] - fire pos Pos[x=2505.2872937165994, y=72.0, z=1682.5240348120838, yaw=-178.15439, pitch=61.100857] - player pos inside => false subResultPos[x=-0.28729371659937897, y=0.0, z=-1.5240348120837552, yaw=0.0, pitch=0.0] p1true p2true p3true p4true p5true p6false

wet breach
#

Weird you are using such large floats lol. Why we using an epsilon in here? Is it for if they are diagonal?

#

I still dont know why using 5.0000000 is being used either

molten hearth
#

it was part of the OG formula and i didnt question it

#

i could try nuking it

#

lemme cook

#

honestly if its because of the diagonal im just banning players who diagonally step into fire atp

wet breach
#

Lmao

molten hearth
#

to be fair i replaced it with 0 and i dont even see changes bruh

wet breach
#

Weird

#

I will have to look at this when i get home in 7 hours lol

wet breach
#

Too difficult with just a phone

molten hearth
#

alright thank you 😭 its already been 7 hours i can spare some more dont worry lmao

wet breach
#

Lol

ivory sleet
#

where there is a notion fo natural order

dawn flower
wet breach
ivory sleet
#

:,) yea

#

altho u do sacrifice time complexity somewhat

molten hearth
# molten hearth the full example would be ```java Pos[x=2505.0, y=72.0, z=1681.0, yaw=0.0, pitch...

also for reference here's a more detailed example of a false positive java Pos[x=2489.0, y=72.0, z=1673.0, yaw=0.0, pitch=0.0] Pos[x=2488.315463502017, y=72.0, z=1673.488163720621, yaw=-84.227356, pitch=63.528667] RESULT -> true subtraction -> ResultPos[x=0.6845364979831174, y=0.0, z=-0.48816372062105984, yaw=0.0, pitch=0.0] FireBoundingBox [minX=-0.5, minY=0.0, minZ=-0.5, maxX=0.5, maxY=1.0, maxZ=0.5] PlayerBoundingBox [minX=-0.3, minY=0.0, minZ=-0.3, maxX=0.3, maxY=1.8, maxZ=0.3] PositionRelative [x=0.6845364979831174, y=0.0, z=-0.48816372062105984] p1true p2true p3true p4true p5true p6true

analog mantle
#

Is there a way I can get a list of all the children of a ConfigurationSection ?

#

the way I have my config set up is that you're supposed to add an arbitrary amount of entries to a ConfigurationSection

delicate lynx
#

ConfigurationSection#getKeys(false)

analog mantle
#

what kind of entry is this?

#

afaik, it's a key then an Integer[]

#

but there's no option to get an int array

delicate lynx
#

that's just a list

#

specifically getIntegerList(path)

analog mantle
#

yea i'll just map it to an int array

#

I also need to parse an Identifier to a StatusEffect

#

It took me so long to learn collections, but man I am glad.

#

I could do all of that in 1 map call but I think it's cleaner to do it in 2

ivory sleet
#

thats a lot of streams

kind hatch
analog mantle
ivory sleet
#

i mean yeah

#

but the memory overhead and just operational overhead is still noticeable on streams if u go far enough, dont think it affects u here tho but point given

analog mantle
ivory sleet
#

also looks like once we get stream gatherers

#

u could make it shorter

analog mantle
#

so it turns an arbitrary amount of those potion effects into a list of them

analog mantle
ivory sleet
#

better in what way?

#

speed? or memory consumption? or less lines?

#

:,)

analog mantle
#

Well you're saying that it can be improved

ivory sleet
#

I think personally the code is a bit complicated

#

like in those streams a lot of things happen

analog mantle
#

less lines = bad
I prefer a much more readable line then 1 long long line that you have to scroll to see the end

ivory sleet
#

yes

#

i more meant the logic

analog mantle
#

matter of fact, you can make a whole class in 1 line if you wanted

ivory sleet
#

well I think it highly depends on whether few or more lines is bad or good

analog mantle
#

feel free to make it better in any ways you see possible, and then explain to me what you did to make it better.

final List<PotionEffect> effects = config.getConfigurationSection("Punishment Effects")
          .getKeys(false)
          .stream()
        .map(f -> Map.entry(NamespacedKey.minecraft(f), config.getConfigurationSection("Punishment Effects")
                .getIntegerList(f)
                .stream().limit(2L)
                .toArray(Integer[]::new)))
        .map(f -> new PotionEffect(Registry.EFFECT.get(f.getKey()), f.getValue()[1], f.getValue()[0]))
        .toList();
ivory sleet
#

why isn't ur format like

effect:
  amplifier: x
  duration: y
#

if I may ask

analog mantle
#

too much time

#

This is literally my very first time making a plugin

#

I have like zero knowledge on the API

ivory sleet
#

well you did ask me what I thought could be improved

ivory sleet
#

but the format has little to do with the api

#

anyway I'd probably have limit(2) on its own line

#

and make it consistently indented

analog mantle
#

sure

analog mantle
ivory sleet
#

goofy ide

analog mantle
#

do people usually put their permission node configurable in the config file or not?

ivory sleet
#

na

#

plugin.yml

#

i reckon

torn shuttle
#

people with some resource pack experience, this code works for setting my offsets for armor stands

    private void setDisplay(Map<String, Object> textureReferencesClone) {
        textureReferencesClone.put("display", Map.of("head", Map.of("translation", List.of(
                        -modelSpaceOriginOffset.getX(),
                        -modelSpaceOriginOffset.getY(),
                        -modelSpaceOriginOffset.getZ()),
                "scale", List.of(MODEL_SCALE, MODEL_SCALE, MODEL_SCALE))));
    }

but it doesn't affect display entities, anyone have any idea of what the key might be for display entities?

analog mantle
#

here's my plugin.yml rn

name: dangerlevel
version: '${version}'
main: me.wclient.dangerlevel.DangerLevel
api-version: '1.20'
#

(I use a really funny method using reflections to bypass manually adding all commands to plugin.yml)

ivory sleet
#

but its not favored

#

never

#

i asked it once

#

it gave my fail-proof failing code

analog mantle
#

this is my inheritor class, and I just access the commandMap in the server and register them

#

It doesn't get much easier to make a command then what I have

analog mantle
torn shuttle
#

is there just no equivalent for display entities? I can't tell if I can't find the documentation or if this is just something that doesn't exist

#

well I can't find it anywhere so I'll just assume it doesn't exist I guess

#

hm

#

feels like this might cause issues

torn shuttle
#

resource packs have a display property that allows you to align models so they fit an entity

river oracle
#

mmm interesting

torn shuttle
#

and it's keyed

river oracle
#

didn't know that

torn shuttle
#

so like if you use the head key it will allow you to re-center where on a player a helmet will be

#

(or an armorstand or I guess also a mob of player-ish size)

#

I use that for FMM and I finally narrowed down my issue to the fact that display entities are either not using that key or not using that system at all

#

which might be a big problem for rotations if that is the case

#

I'll have to test it

wintry lynx
#

Does metadata stored on a player persist after death?

#

or does it clear when they respawn

worthy yarrow
torn shuttle
#

pdc data persists

river oracle
#

metadata API is leaky anyways

#

?pdc

wintry lynx
#

I know it's cleared when a server closes but i wanted to know if it does on player death

slender elbow
#

the problem with metadata isn't that it isn't stored but rather it isn't cleared

river oracle
#

yeah honestly PDC is safer imho

#

you should probably avoid MetaData

wintry lynx
#

Yea yea, i know. i didnt plan to :I

analog mantle
#

They call me the collections guy.
this turns in to

ivory sleet
#

i see one collection

#

most of it is stream api :,) (counting w the code from before also)

analog mantle
ivory sleet
#

wclient seems dangerous

analog mantle
#

what do you think of my expertise in streams

ivory sleet
#

well, I mean u certainly like streams

#

maybe a bit too much

analog mantle
#

its just so goddamn convenient

#

and also extremely fast

ivory sleet
#

well its not any faster than the counter alternative

#

for loops

#

while loops

#

but yea its convenient

spare crypt
#

Not always the most memory efficient though

ivory sleet
#

^

#

it has a certain mem foot print and overhead in terms of ops

spare crypt
#

Streams are most useful when you're using concurrency

analog mantle
#

personally, I can't see it being a insane memory problem, especially since my plugin is very simple

spare crypt
#

Yeah. Most scenarios, it's not a big deal

ivory sleet
#

yea but like

analog mantle
#

I'm honestly having more fun then anything making this plugin

ivory sleet
#

at startup

#

its fine to loop through a set of boostrappable components w a stream or so

slender elbow
analog mantle
#

The one thing I'm kind of dreading is making the placeholder for the danger of the player

ivory sleet
analog mantle
#

I'm not sure how to even start with the placeholders

ivory sleet
#

or well, "custom fork join pool"

slender elbow
#

if the current thread is a FJT it will use the pool of the current thread

#

common pool otherwise

ivory sleet
#

ah yes

#

thats true

slender elbow
#

but yeah not really a custom executor

#

but a FJP

#

after all, the point is a divide and conquer approach

ivory sleet
#

yup

analog mantle
#

Can someone please send me a tutorial for using placeholder strings in a plugin

ivory sleet
#

if u wna be barebone

#

String#replace

analog mantle
#

Well no, because I would like to allow support to put the player's danger on TAB, Scoreboard, and in chat

ivory sleet
#

ah u wna write ur own placeholder api extension?

analog mantle
#

uhh no

#

lol

#

is that something I have to do?

ivory sleet
#

i mean yea

#

prob

analog mantle
#

Just to use a singular placeholder?

slender elbow
#

you want to provide a placeholder, no?

#

for other plugins to use

analog mantle
#

yea i want people to be able to use ie. %danger-level% as a placeholder, and it then becomes whatever the player's danger actually is

ivory sleet
#

you'd pretty much need to write a papi (placeholder api) extension for it

analog mantle
#

Yeah I mean I guess i'm willing to do that

ivory sleet
#

u basically need to override a couple of methods

analog mantle
#

Well hold up

#

I have never made a plugin before, so I kinda need to follow a tutorial or something

quaint mantle
#

Do new snapshot's ItemStack Components deprecate PersistentDataContainer API?

worthy yarrow
quaint mantle
#

Oof

ivory sleet
#

it fits in the custom tag

analog mantle
# ivory sleet here

So this gives me no info how to set it up, it jumps straight into making it, but no set up

quaint mantle
#

I got really scared reading the news 🦦

ivory sleet
#

yea no u're good

#

its mostly them just having their shit loaded and validated eagerly

quaint mantle
#

By the way, I would like to contribute/expose some methods

#

I was previously told how to

analog mantle
#

What do I need to add to my gradle file

ivory sleet
#

its at the right nav bar

analog mantle
#

like i have no idea

quaint mantle
#

I just can no longer find the source of how to do so

ivory sleet
#

like create a PR?

quaint mantle
ivory sleet
#

idk

#

@river oracle

#

help this guy :)

worthy yarrow
ivory sleet
#

?pr

#

istg there was a command for it

quaint mantle
#

?contribute

quaint mantle
#

Yes!

analog mantle
#

where can i put in my placeholder expansion identifier so people know what it is, but cannot change it?

ivory sleet
#

There is the papi ecloud

analog mantle
#

nah imma just put it in config.yml

kind hatch
#

?

#

Wants to know where to put an unmodifiable string prefix.
Decides to put it in the config where everyone can change it.
🤔

analog mantle
#

does string.substring(0, string.length - 1) return "est Strin" given string is "Test String" ?

drowsy helm
#

try it and see

analog mantle
#

man i can't be bothered

drowsy helm
#

🤷

analog mantle
#

I had to do that crap like 2 million times in my CS class and I still don't know fully

drowsy helm
#

java online compiler

analog mantle
#

nah it's 1

river oracle
#

It just moves where it's stored internally iirc

#

Dont worry about it I'm sure md will have fun fixing everything xD

ivory sleet
#

Yea the custom tag should be fine

river oracle
#

The top bound is exclusive and your subtracting 1

flat olive
#

So if I wanted to make my own rank system plugin, would I have to log each user on the server in a database to their assigned rank or would I just have the ranks setup in the database to where I can grant such and such user on my server a rank without needing to append their username to the database..?

ivory sleet
#

inclusive exclusive by convention:)

river oracle
ivory sleet
river oracle
#

Step 1 give up use luckperms

ivory sleet
#

But yes

#

U’d store them in a database

flat olive
#

all of the users...

#

bruh

ivory sleet
#

Yea

#

I mean where else do u store info about their ranks

river oracle
#

No one here is going to help you with ranks if I wanted to suffer in hell I'd rather wait till I die no need to do it when I'm alive

flat olive
#

Nah the mongodb and storing each user granted a rank and by default on join the basic rank isn't hard at all