#help-development

1 messages Β· Page 371 of 1

remote swallow
bold vessel
#

but that wasnt working

quaint mantle
#

It’s slow

#

Look at the web benchmarks

#

Use jooby or smth

sterile token
#

What should i add to this regex ^[a-zA-Z0-9]+$, to be able to use the color caracter & ?

worldly ingot
#

Probably a &

sterile token
#

Hmn, but where?

#

Its first time i try using them just to clarify

worldly ingot
#

[a-zA-Z0-9&]+

#

Unless you're trying to write a RegEx for like &f, &9, etc.

#

In which case &[0-9a-fA-Fnmor]

sterile token
#

No no, its just for a display name command

#

So then you cant use any special character unless color code one

worldly ingot
#

Yeah, then the first one

sterile token
#

right, thanks choco

worldly ingot
#

[] is just a list of characters that should match

#

Any of the chars in that []

#

https://regexr.com/ is a fantastic website by the way in case you're ever writing RegEx and want to test out your queries

sterile token
#

Really thanks!!

bold vessel
glossy atlas
#

how to do?

sterile token
glossy atlas
#

i can see them in list

#

but i cant see them

halcyon hemlock
#

watch a tutorial

#

so u understand how to do it instead of copying code

tender shard
#

ayone knows how to raise IJ's memory limit?

#

I got 64 GB of RAM but IJ keeps refusing to use more than 2 GB

vocal cloud
#

I believe

tender shard
#

thanks!

vocal cloud
#

I do it to all my JB ide's what's the point in having memory if you ain't gonna use it?

tender shard
#

I do use that much

#

I usually have 10+ projects open haha

#

yeah that indeed worked, thank you

#

another question: I usually got github copilot enabled, but whenever it's enabled, sometimes this menu doesn't open anymore

#

anyone got any fix for that, too? πŸ˜„

eternal oxide
#

yeah, use Eclipse πŸ˜‰

tender shard
#

sometimes it's just like this

tender shard
eternal oxide
#

mix?

tender shard
#

erm

#

fix*

#

sorry

eternal oxide
#

I've had no issues

tender shard
#

I had some issues with eclipse being confused when there's both, a pom.xml and an .eclipse folder

eternal oxide
#

ah that

tender shard
#

but that was like 3 years ago

eternal oxide
#

yeah if you mess the classpath it can play up

tender shard
#

hmmm

#

and does it work nicely with github copilot?

#

if yes, I might consider switchig back

eternal oxide
#

I've no interest in copilot so no idea

tender shard
#

oh well

#

it is awesome, you should try it

eternal oxide
#

nah it makes people lazy

tender shard
#

sometimes

#

lemme give you a example

eternal oxide
#

along comes copilot then ChatGPT, next comes people telling the AI what they want and it writes the whole program for you

#

its a terribly bad slope to slide down

#

Won't be long before there are no more programming jobs

tender shard
#

check out this, for example

tender shard
#

but sometimes it let's you do stuff very quickly that you'd nnormally have to type out by hand

#

(also sorry in case my numbers miss any "n" char, my keyboard is a bit broken and I have to hit the n key like a maniac for it to work)

eternal oxide
#

quickly is nice, but it's also teaching an AI to take your job

#

I doubt you remember when the majority of coding jobs were farmed off to India

tender shard
#

I'm a lawyer, coding plugins is not my job lol

eternal oxide
#

I saw a bot recently (test) passed the UK bar exam

tender shard
#

then it must be a good bot

vocal cloud
#

I think the biggest reason ChatGPT and the like won't replace jobs is that in order to do that it first has to be trained on how and by the time it is then it's already behind.

tender shard
#

I always say that AI has it's limitations, e.g. it cannot help people answer questions like "how can I avoid inheritance taxes when my grandmother wants to inherit some property to me", but it does a good job in making people code a bit quicker

eternal oxide
#

ChatGPT is a HUGE leap forwards in predictive AI. Comparted to 10 years ago it's astounding

tender shard
#

definitely

#

it still doesn't undertsand basic concepts

#

e.g. ask it about the event priority in spigot plugins

eternal oxide
#

imagine another 10 years

tender shard
#

it will give you a totally incorrect answer

tender shard
eternal oxide
#

Yep because it's currently predictive but that ability expands with every iteration of the AI

vocal cloud
#

Maybe, we'll see. I really hate how it's so confident in it's incorrect answers. Can you imagine the bugs in production code that will exist from ChatGPT and the like?

eternal oxide
#

oh it will be a buggy mess, but Corporations won't care, it's free labor

vocal cloud
#

At the end of the day they will because lawsuits and legacy code bases will always exist

tender shard
#

anyway, this discussion only started because I asked whether there's a fix for IJ not showing "IntelliSense" suggestions anymore just because GH copilot is running. does anyone have a fix for that? would be appreciated, thanks

eternal oxide
#

πŸ™‚

tender shard
#

I didnt want to start a war about "is AI good or not?"

sly berry
#

it is good

tender shard
sly berry
#

most of the times*

hushed pawn
#

i tried using mojang mappings and create npc, and i get
java.lang.NoClassDefFoundError: net/minecraft/server/level/ServerPlayer

#

i use 1.19 paper

hybrid spoke
#

?whereami

drowsy helm
#

we cant gfuess

#

looks like you're not mapping it properly

tender shard
#

Also you are using this weird api

tender shard
#

almost been an hour, guess they fixed it

#

steps to stop having problems coding minecraft plugins:

  1. Use spigot instead of paper
  2. ???
  3. profit
unique sable
#

What should I use here to output a more readable death message?
I'm currently using
"lastDamageCause"

remote swallow
#

to string it

lost matrix
#

You cant just print out a whole Object like that.
Get the DamageCause of the event and format/translate it.

unique sable
#

Ah I see

rugged gust
#

hey i made it so when players use command /1v1 an inventory opens and there are list of players and when they click a player name they can confirm or cancel 1v1 request if they click confirm an message pops up to the other player to accept or decline the request and when they both accept they can pvp and i dont know how to make it so when those two players are fighting other players cant attack them.

lost matrix
# rugged gust hey i made it so when players use command /1v1 an inventory opens and there are ...

Create a class ActiveDuel which contains a Set<UUID> of participants.
Then a DuelManager which has a Map<UUID, ActiveMatch> which maps players to active duels they are in.
EntityDamageByEntityEvent:
(Pseudocode)

  • if duelManager.hasActiveMatch(defenderId)
  • ActiveMatch match = duelManager.getActiveMatch(defenderId)
  • if not match.isParticipant(attackerId) -> cancel event

Another, simpler approach:
Put the duel partner in the PDC of both players and check them on the damage event.

spiral depot
#

hello guys, anyone has an custom rates xp? for 1.19?
for example put custom values for each level or any formula

halcyon hemlock
#

Cause no way πŸ’€

#

Half of the time it doesn't know what it is doin

#

unless u spot a mistake it it will confidently tell you the wrong answer

#

for copilot it also messes up

#

maybe in 10 years

hazy parrot
#

Elgarls point is that you should look at ai 10 years ago, it basically doesn't exist

#

And according to that pattern, what will happen in next 10 years

halcyon hemlock
#

so, according to them AI would be coding itself then

#

I mean if AI can do everything why even bother living

hallow goblet
#

For some reason, the config folder is not being created on my client's server, although on my localhost it works without a problem. I am using saveDefaultConfig() in the onEnable() method.

hazy parrot
#

Is there any error

#

And are you sure they are using same jar

hallow goblet
hallow goblet
remote swallow
#

are they using pufferfish by chance

hallow goblet
#

spigot

remote swallow
#

that makes it more confusing

slate mortar
#

do you actually provide a config in your plugin? saveDefaultConfig doesn't create one, but copies the existing one from the jar file

hallow goblet
#

yes

hazy parrot
#

If its some permission error or smth it should throw in console

#

So ask them about it

dry yacht
onyx fjord
halcyon hemlock
#

then that dumber AI can learn from the internet by itself gradually becoming more smarter

onyx fjord
#

Gotta get that data somewhere

#

Originally

vocal cloud
#

The problem with that is without proper filtering/sorting of the data if you input random garbage you'll get out of it random garbage

dry yacht
#

I really don't understand why spigot decided to not use the same versions across craftbukkit's package, Bukkit#getVersion and the NMS package (on older versions). What a headache...

regal scaffold
#

@wet breach

#

I was just browsing looking for how people do nametags for players and I came across MultiLineAPI

remote swallow
#

pre 1.19.4 armor stands

hushed spindle
#

i've chosen to rewrite an older plugin of mine and i've decided to do that by simply making a new plugin project with the same plugin name, but on startup it's complaining about permissions that were already registered. do plugins have like a type of ID? where could i find or edit it in that both versions would be the same?

remote swallow
#

only 1 plugin can have a specific name

hushed spindle
#

i know, thats the purpose

#

im not trying to run both plugins with the same name

#

i have to make the plugin rewrite with the assumption it will replace the plugin pre-rewrite, so the pre-rewritten plugin will have been enabled on such servers at some point, but when it does it seems it'll complain about permissions already having been registered and probably some other things that i dont know about

#

so that leads me to believe plugins have an identifier beyond just the name, and im wondering if i can find that id somewhere so i can make it the same as the older plugin version

glossy atlas
#

why cant found?

remote swallow
#

because thats probably unobsfucated/moj-maps

#

or doesnt exist on that version

glossy atlas
remote swallow
#

from that prior screenshot you sent, its obsfucated so your gonna need to find the obsfucated version of that

regal scaffold
#

Epic are the only ways you know to changing a players nametag above their head packets and scoreboards?

remote swallow
#

packets, scoreboard somehow hiding the current name and making a new armorstand on their head

regal scaffold
#

Is it that complicated as I think it is?

remote swallow
#

ive got no idea

regal scaffold
#

Cause some places I've lately seen like insanely simple ways of doing it

remote swallow
#

only ever seen it in 1 plugin

regal scaffold
#

But then a plugin like NameTagEdit is extremely complicated

glossy atlas
remote swallow
#

might be spigot mappings

chrome beacon
#

So why aren't you using Mojmaps

#

It will make things much easier

glossy atlas
#

i watch the tutorial and do as the video
it build the spigot Buildtools.jar

opal juniper
#

i can never work out how to get maven to compile to a proper directory so give up

thick oracle
#

Hey,
Im having some trouble setting a Chat format. Well to be more precise, setting it is no problem, but getting the console to properly log messages.
This is my code (simplified):

@EventHandler(priority = EventPriority.LOWEST)
public void setChatFormat(AsyncPlayerChatEvent e) {
  String format = "{username}: {message}";
  format = format.replace("{username}", "%1$s").replace("{message}", "%2$s");

  e.setFormat(format);
}

Works fine ingame, however the console only logs messages without usernames once I set a custom format. I also tried using e.getPlayer().getName(), but that didn’t change anything sadly

https://imgur.com/a/2mpIWgc

eternal oxide
#

Someone else here two days ago had the exact same issue.

#

they claimed it was due to including the color code in the format without calling ChatColor.translate

quaint mantle
#

How can I destroy an end crystal without making it explode?

thick oracle
quaint mantle
#

No like, destroy an end crystal without the player hitting it

eternal oxide
#

call translate on the format before you set it, just to be sure

quaint mantle
#

Entity#remove doesn't work for some reason

grizzled oasis
thick oracle
eternal oxide
#

No clue then. The code you posted should work

dry yacht
thick oracle
dry yacht
thick oracle
#

yes

eternal oxide
#

See if it happens on Spigot

thick oracle
#

one second

#

Oh well it works on spigot

dry yacht
#

Paper's chat processing logic is completely different from spigots. It's such a ratsnest that I didn't completely investigate it.

dry yacht
thick oracle
thick oracle
limpid nexus
#

?whereami

eternal oxide
#

I hate paper for their nag messages on logging/sysout

#

If you were able to change teh logging level on teh Bukkit logger people would not need sysout

#

I was forced to remove debug due to papers nags

warm mica
#

I will never understand the hate from the Spigots community towards the Paper community and vice versa

dry yacht
warm mica
eternal oxide
dry yacht
limpid nexus
dry yacht
eternal night
chrome beacon
eternal oxide
#

On top of that they are driving users to harass devs to change their code.

eternal night
#

sout is a lot better for sure

eternal oxide
#

much better, you can change logging level on the fly and have proper debug

eternal night
chrome beacon
eternal oxide
#

You try changing it at runtime

#

change it from teh default of INFO to FINE at runtime and try to log a FINE message

chrome beacon
#

It's just a normal logger? So just pass fine as an argument when logging?

eternal oxide
#

You try that, it will be ignored as changing the logging level does nothing at runtime

eternal night
#

idk in what environment you'd ever want to change log level at runtime

eternal oxide
#

very frequently to enable/disable debug output

eternal night
#

which should require a proper startup of a debug mode server

eternal oxide
#

no, thats what logging level is specifically for

tender shard
#

whut

#

its totally normal to tell a server to "debug now"

#

or a plugin

eternal night
#

it really isn't

tender shard
#

I can totally relate to the fact that chaning the log level is at runtime is normal

eternal night
#

a production server does not need the ability to change its log level during runtime

eternal oxide
#

it really is, it's been the defacto way of enabling debug for at least a decade

tender shard
#

same

#

okay, not a decade, but for 4 years or so

eternal night
#

aha

eternal oxide
#

I've been using it for over a decade πŸ˜‰

#

users comes to you with an issue, you tell them to change teh logging level and post the output, issue found and fixed.

thick oracle
# limpid nexus ?whereami

I wasnt aware that there was such a big difference between the two.
I figured I should ask here since I'm coding a spigot plugin

dry yacht
thick oracle
eternal night
#

just, they should never be enabled on a production server

dry yacht
eternal night
#

that is not what they are for

eternal oxide
eternal night
#

then properly start the server in debug mode ?

dry yacht
thick oracle
eternal oxide
#

yeah, you are making excuses now to be obtuse? Restarting a production server is not always feasible.

eternal night
dry yacht
eternal oxide
#

In many local authorities systems I've installed and maintained they dealt with taking the publics payments. You could not "down a server" for any reason.

thick oracle
eternal oxide
#

You had to have the ability to turn on/off a debug

opal juniper
#

exactly

dry yacht
eternal oxide
#

We've actually done that in the past :). Local councils are bitches

dry yacht
#

But I do get the point, it's actually pretty valid. Collect traces on a running system to later debug locally.

eternal oxide
#

So many crazy rules in their CLA

chrome beacon
#

So I tested the logger. The log levels are missing in the prefix. Is that the issue you were talking about?

eternal oxide
#

No, if you use the plugin logger you can not change teh logging level after startup

chrome beacon
#

wdym by changing to logging level

eternal night
#

what logs it prints

eternal oxide
#

if you startup with INFO level and change to FINE after startup no FINE logs will be produced. The level remains at INFO

chrome beacon
#

Couldn't you just use setLevel?

eternal oxide
#

Thats the point setLevel on a Plugin logger has no effect

dry yacht
smoky oak
#

ye like blvck said

#

context

opal juniper
#

its a structure yeah but i cant think of a way to generate it proc so... hardcoded values atm

smoky oak
#

ye but what kind of structure

dry yacht
chrome beacon
opal juniper
dry yacht
opal juniper
#

nah a leaf

dry yacht
#

oh my lord

eternal night
#

wrong reply

smoky oak
# opal juniper

cant you just load in the azaela tree structure and remove the blocks

#

`logs i mean

eternal night
#

the log4j appender is configured to log level info by default, you can supply whatever log4j2.xml file you want

dry yacht
# opal juniper

Just have the middle stem and then use block-faces to generate the leafs around them. Top left bottom right for the middle and front and back for front and back, well, obviously.

eternal night
#

if you care for debug level output

chrome beacon
#

ah I now I understand. I forgot it uses Log4J

regal scaffold
#

How can I use a "config-version" field in config.yml to then replace the config if there's a new version available?

#

Like delete the old file and replace for the new one

opal juniper
chrome beacon
opal juniper
#

Did discord switch image renderer?

chrome beacon
#

They've done some image changes

regal scaffold
chrome beacon
#

You can set values to the config

regal scaffold
#

Do I instead just delete the file and then run saveDefaultConfig?

chrome beacon
#

getConfig().set smth

#

or delete the file if you want to reset their settings

#

which would be a pain for the user

regal scaffold
#

Wait you're saying I can actually "update" the file without deleting it

dry yacht
# opal juniper

Btw, depending on how fancy your "leaf" needs to be, I'd just advise the simple route: Write a yaml file where you have block-type sections and coordinate entries, based on a relative coordinate system, as you already have. Then just load that yaml and generate the entries at startup. "The ugly code gotta be somewhere", in this case it's not code but only data in a flat-file, that's alright. You're also not hardcoding the data that way, which I'd consider bad practise to be honest.

regal scaffold
#

Interesting

regal scaffold
#

How does that work tho? How do I know what changed?

chrome beacon
#

You write data fixers

smoky oak
#

also @opal juniper if all you care about is code size/readability do something like this

int[][] leafPos = { {0,1,1},{1,0,1}...};
//init set
for(int[] pos : leafPos){
  set.add(Pair.of(new Vector(pos[0],pos[1],pos[2]),Material.AZAELA_LEAVES);
}

which would mean you could order the triplets in the leafPos initializator by height for example

regal scaffold
#

For each field in the config?!/

sharp zenith
#

Can someone enter help-server i need a lil help

chrome beacon
#

Yeah

regal scaffold
#

brh

opal juniper
chrome beacon
#

So if config version is 8 and new 10
You'd run update fixer 9 then update fixer to 10

regal scaffold
#

O.O

#

That's even more

#

tf

#

That seems like a pain

opal juniper
chrome beacon
#

It's not that much if you're only making small changes

dry yacht
sharp zenith
#

Does someone know why does my server open and closes?

regal scaffold
#

That what you're saying?

chrome beacon
#

Yeah

regal scaffold
#

Ooooo ok that's not as bad as I thought

dry yacht
regal scaffold
#

If I need to change a field I guess best thing to do is straight up remove it and add the new format for it

#

Gotcha gotcha

opal juniper
smoky oak
#

id probably use a config myself but this was cleanup, not redesign

#

sides

#

not like that changes

#

the form i mean

#

so hard coding it is fine

regal scaffold
#

And then, I've been using saveDefaultConfig() onEnable to copy the config.yml from the plugin.jar

#

Is this the best?

chrome beacon
#

That's fine yeah

regal scaffold
#

Alright thanks Olivo

dry yacht
opal juniper
#

ultimately, the leaf wasn't something I wanted people to be able to configure, however If i just shove it in the config and have some string -> material map in there too it should be fine

dry yacht
opal juniper
#

yeah i imagine πŸ˜„

#

will work on it again later, will probs put it in a config

#

I have done something like this before

#

jank, but meh

smoky oak
#

i just use RedLib for structures

dry yacht
dry yacht
opal juniper
#

πŸ˜„

#

thanks for your ideas tho guys

smoky oak
#

by the way

#

dont trust anything i say

#

i give the quick solution

#

not the good one

regal scaffold
#

Can I try getting a config field but what if I expect it to be null

#

Nah nvm

smoky oak
#

you can put a default value as second arg in the get method

regal scaffold
#

Really good to know. Thanks anyways

#

Hey, If I'm making a class called Scheduler that I want to use to run a task on repeat. I make that class implement Runnable right? Then is it as simple as it sounds?

Start new instance of the class from Main class and call Scheduler.run()?

chrome beacon
#

That will only call the run method once

smoky oak
#

well you have to overwrite the run method

#

preferrably with a loop

regal scaffold
#

Ok wait wait

eternal oxide
#

calling it Scheduler is probably not a good choice

smoky oak
#

but thats for stand alone

#

?scheduler

regal scaffold
#

I was using this before

smoky oak
#

?scheduling

undone axleBOT
regal scaffold
#
            (new BukkitRunnable() {
                public void run() {
                    
                }
            }).runTaskTimer((Plugin) this, 20L, 20L);
#

And that's what I'm trying to move to a separate class

#

I think im confusing terms tho

chrome beacon
#

Extend BukkitRunnable

smoky oak
#

class extends bukkit runnable, @overwrite the run method, call it like above

eternal oxide
#

and call it a SomethingTask rather than Scheduler

regal scaffold
#

Ok ok I understand now

#

Thanks

tawdry echo
#

how can create villager trades manipulation like this?

smoky oak
#

by the way @eternal oxide do you not sleep or something? I go to bed, i wake up, and youre still online

tardy delta
#

instantiating bukkitrunnables πŸ’€

regal scaffold
eternal oxide
#

I have an ill wife so my hours are never regular

regal scaffold
#
public class PrefixTask extends BukkitRunnable {

    BetterPrefix betterprefix;

    public PrefixTask(BetterPrefix betterprefix) {
        this.betterprefix = betterprefix;
    }

    @Override
    public void run() {
        
    }
}
fluid river
#

ayo

smoky oak
fluid river
#

pee pee poo poo check

regal scaffold
#

ooooooooooo

fluid river
#

by free java teacher

regal scaffold
#

Alrtight alright thanks

pseudo hazel
#

with a scoreboard, can I hide the red score number and just show the entries instead?

pseudo hazel
#

sad

chrome beacon
#

You can use a resourcepack

tardy delta
#

just make your own client

pseudo hazel
#

oh yeah thats a good idea brush

tardy delta
#

i really have to change my name

smoky oak
#

why

tardy delta
#

people either think that im 14 or that im a toothbrush

smoky oak
#

worked for the last 5 years

pseudo hazel
#

i guess I will use bold numbers for the actual score xD

chrome beacon
#

If you're on a modern version you can use shaders in the resourcepack to remove the numbers

pseudo hazel
#

hmm

#

well maybe thats something for later

smoky oak
pseudo hazel
#

my plugin doesnt really come with a resource pack now

chrome beacon
#

Found this

pseudo hazel
#

well I want to show a team name, but also the players in the team

#

but only the actual team name has the correct score

#

so then I cant order it correctly

dry yacht
pseudo hazel
#

because those red scores are also used to order teh board

tardy delta
pseudo hazel
#

unless there is a way to not have it do that

#

but I dont think so

eternal oxide
#

you can have all the scores zero

pseudo hazel
#

I guess

#

so then what will the order be

#

order of insertion?

eternal oxide
#

you order by... sec I have it done

#

you create a team per line...

#

then teh simplest way is to use a MC colors to create the team name

#
            // Create a Team for each line in the Sidebar.
            for (int index = 1; index <= 15; index++) {

                Team team = scoreboard.registerNewTeam("TEAM_" + index);
                /*
                 * Set a colour code as the team name because it's an invisible
                 * character and will not display over any Sidebar text.
                 */
                team.addEntry(createKey(index));
            }```
pseudo hazel
#

I see

eternal oxide
#

then it's simple to change a line with ```java
/**
* Set a specific line on the Scoreboard.
*
* @param index 1-15 (bottom to top)
* @param text String to display.
*/
public void setSlot(int index, String text) {

        Team team = scoreboard.getTeam("TEAM_" + index);
        String entry = createKey(index);

        if (!scoreboard.getEntries().contains(entry)) {
            sidebar.getScore(entry).setScore(0);
        }

        // Translate colour codes so they can be displayed correctly
        // and trim to 32 displayable.
        text = trimWithoutColour(translateColourCodes(text));

        team.setPrefix(text);
    }```
pseudo hazel
#

this will make my scoreboard more complex though, since I am already using this to create my normal teams

#

but yeah the way it gets ordered is just by inserting it in the right order

eternal oxide
#

yes, each team is added in order then any changes are kept

#

so you can change any line and it stays in the same place with a zero score

pseudo hazel
eternal oxide
#

the key used above is just ```java
private String createKey(int slot) {

return ChatColor.values()[slot].toString();

}```

pseudo hazel
#

can a scoreboard only have 15 lines?

eternal oxide
#

yes

pseudo hazel
#

ok

#

and can I also hide certain lines?

#

without ruining the order

#

like I might not want all the lines at all times but still want it to be possible to use them if I need it

eternal oxide
#

yes

pseudo hazel
#

okay so how do I hide a line

eternal oxide
#

set it to an empty string

pseudo hazel
#

oh okay

#

and the color wont prevent it from hiding?

regal scaffold
#

How to change the filename export from

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

If I wanna make it use <version>5</version>

iron palm
#

should i have to install redis on my pc ? (im on windows) since its throwing an error on creating client

teal wagon
lost matrix
regal scaffold
#

This problem is back.

#

Nice image size discord. you nailed it

#
    @EventHandler
    public void aSyncPlayerChatEvent(AsyncPlayerChatEvent event) {
        if (Configuration.getChatEnabled()) {
            Player player = event.getPlayer();
            event.setMessage(Utils.colorize(Utils.translateHexColorCodes(event.getMessage())));
            String format = Utils.setPlaceholders(player, Configuration.getChatFormat(), event.getMessage());
            event.setFormat(ChatColor.translateAlternateColorCodes('&', format));
            Bukkit.getLogger().info(format);
        }
    }
pseudo hazel
#

wait so what is the goal?

regal scaffold
#

The output in console should be identical to the output ingame. But it doesn't even show the player name

#

Which is how it would work if I turn my eventhandler off. So I know I'm doing something wrong

pseudo hazel
#

so you want the console to display the same as the client?

dry yacht
regal scaffold
#

The console already does display the same as the client. by default. But if I change the format like I'm doing above it completely messes up

dry yacht
#

Use spigot, lol

pseudo hazel
#

have you tried using Bukkit.getConsoleSender().sendMessage()?

regal scaffold
#

Why would I need that

#

If all messages already get sent to console

thick oracle
regal scaffold
#

By default

#

Wait this is a paper issue?

#

Are you serious

thick oracle
#

yes

dry yacht
#

I told you...

regal scaffold
#

bruh

#

I thought the conclusion

#

Wasn't that

#

fk me...

#

Apologies

paper viper
#

Hello
where is the PortalCreateEvent called?

dry yacht
#

"iT's tHe ColOrs"

regal scaffold
#

So what I'm doing is correct they just messed up

eternal oxide
#

This is why we ask people to only use Spigot here πŸ˜‰

regal scaffold
eternal oxide
#

yes, but TEST on Spigot

regal scaffold
#

That's a good point

pseudo hazel
#

meaning when fire lights a portal, when a portal gets created in the nether as a pair by the game, or when the end portal creates a obsidian platform in the end

paper viper
#

Class name?

pseudo hazel
#

there is no class name

#

the event will just get fired when these things happen

paper viper
#

where does minecraft check if it is a valid portal

pseudo hazel
#

oof

#

idk where minecraft checks it

#

but if its created, it should be a valid portal

#

i.e. I would expect this event to fire only for valid portals

#

but like, what do you consider an invalid portal

paper viper
#

ik i wanted the locgic where it checks if its valid for my own portals

pseudo hazel
#

what do you mean by your own portals

iron palm
dry yacht
# paper viper where does minecraft check if it is a valid portal

Event-Call site: ./main/java/net/minecraft/world/level/portal/BlockPortalShape.java:194

Block logic: ./main/java/net/minecraft/world/level/block/BlockFireAbstract.java:149

May deviate a bit on your version. That's grepped from craftbukkit. Basically checked onPlace, when the block is fire.

dry yacht
pseudo hazel
#

hmm

#

thats weird

#

well I guess the other 2 reasons dont really have to rely on a portal being valid as they are the result of a portal already being created

regal scaffold
#
        java.lang.UnsupportedClassVersionError: org/bukkit/craftbukkit/bootstrap/Main has been compiled by a more recent version of the Java Runtime (class file version 61.0), this version of the Java Runtime only recognizes class file versions up to 60.0
``` This means I need to install a lower version of jdk right?
eternal oxide
#

newer

regal scaffold
#

tf I have latest

eternal oxide
#

your classpath disagrees

regal scaffold
#

I do agree with my classpath somehow

dry yacht
# regal scaffold ```Error: LinkageError occurred while loading main class org.bukkit.craftbukkit....

The Java language has undergone several changes since JDK 1.0 as well as numerous additions of classes and packages to the standard library. Since J2SE 1.4, the evolution of the Java language has been governed by the Java Community Process (JCP), which uses Java Specification Requests (JSRs) to propose and specify additions and changes to the Ja...

regal scaffold
#

How do I have that I download jdk19

eternal oxide
#

install and update path

dry yacht
primal goblet
#

Hey! i tried to hide the player's name tag from putting an armorstand as passenger to the player
and when i removed my code and return everything as it is, the player's nametags always hidden
how can i fix this?

regal scaffold
#

ahyes

primal goblet
#

oh i did it by Entity#eject

regal scaffold
#

Can console not display unicode characters?

eternal oxide
#

depends on teh codepage of your server

regal scaffold
#

Β»

#

Is there anything I can do in the plugin itself to support it or is it a 100% server side setting

eternal oxide
#

all server side

regal scaffold
#

Looks funny lol

#

Alrighty

regal scaffold
#

Can't do that for a public plugin tho

#

Could add the fix as a description if they want

eternal oxide
#

console should be fine on linux

regal scaffold
#

But might as well just add a description to change the encoding on startup

#

Same thing

eternal oxide
#

looks like it's fixed in newer JLine

hazy warren
#

How do I turn a maven repo into a dependency

regal scaffold
#
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-jar-plugin</artifactId>
                <version>3.3.0</version>
                <configuration>
                    <outputDirectory></outputDirectory>
                </configuration>
            </plugin>
hazy warren
#

Maven plugin project on GitHub into my maven dependencies

regal scaffold
#

How can I change the output name to include <version> as well

#

<finalName>BetterPrefix-${version}</finalName> tis?

desert tinsel
#

How to check if an itemstack is equal with a predefined one without checking the itemstack's amount?

eternal oxide
#

ItemStack#isSimilar

desert tinsel
#

Thanks

regal scaffold
#

To fully replace a file with the default config file from the jar should I use File# methods to delete the existing folder and then saveDefaultConfig()?

primal goblet
#

why the player's nametag is hidden?

eternal oxide
#

If you want to completely reset teh config but you have one already saved use getConfig().load(Reader) and pass it a Reader via getResource

tardy delta
#

i wanted to say Files.copy(plugin.getResource("config.yml"), Paths.get("config.yml"), StandardCopyOptions.REPLACE_EXISTING) lol

#

but ye that works too ig

#

still gotta load it then

eternal oxide
#

using load you only need to call save after adn you never touch the file yourself so no possible chance of locks

regal scaffold
#

            File file = new File(getDataFolder(), "config.yml");
            if (file.exists())
                file.delete();

        saveDefaultConfig();
#

Doesn't that do the trick too?

eternal oxide
#

it does, but you then also have to load it again

#

as your modified one will still be in memory

tardy delta
#

\πŸ‘€

regal scaffold
#

You just pointed out something and now I'm even more confused

#

load the file again

#

I never loaded the file in the first place I don't think

#

How was it working

hazy parrot
#

Do you want to change it on runtime or onEnable

regal scaffold
#

Oh nvm I see what I did

#

Yeah

hazy parrot
#

If its onEnable, no need to do anything

#

If its runtime tho, you have to load it again, you can just do it with reloadConfig

regal scaffold
#
    private void setConfigFile() {
        config = getConfig();
        try {
            int configVersion = config.getInt("CONFIG_VERSION");
            //Make a switch to check what version the config is currently at. If it is not the latest version, update to the next version
            switch (configVersion) {
                case 1:
                    break;
                default:
                    break;
            }
        } catch (Exception e) {
            //If the config version is not found, it is most likely the first time the plugin is being run. Set the config version to 1

            Bukkit.getLogger().log(Level.WARNING, "Config version is outdated. Resetting config version to 1");
            File file = new File(getDataFolder(), "config.yml");
            if (file.exists())
                file.delete();
        }

        saveDefaultConfig();
        if (config ==  null ) {
            config = getConfig();
        }
    }
#

I think that works

#

To replace the file completely if it's a very old version, even before I added "config_version"

If it has the field "CONFIG_VERSION" it'll do the stuff for the number of the version.

If it doesn't have it it, delete, saveDefault and load

hazy parrot
#

But your approach will delete any modification user already made

regal scaffold
#

I need to force that

hazy parrot
#

It's bad if you ask me

#

Alex have some config updater

regal scaffold
#

I need to force it because the config file changed drastically

eternal oxide
#

this will wipe your config and save over teh config you have savedjava try { getConfig().load(new InputStreamReader(getResource("config.yml"))); getConfig().save(new File(getDataFolder(), "config.yml")); } catch (IOException | InvalidConfigurationException e) { e.printStackTrace(); }

regal scaffold
#

I can have a config updater once the config includes the field "CONFIG_VERSION"

iron palm
regal scaffold
#

I just need to make sure they have the very old config version before I delete it. Which in this case is not having the field "CONFIG_VERSION"

#

After that it won't delete anymore and I can do config updater stuff

#

So even tho alex suggests not to use exceptions for this

hazy parrot
#

You can just get it

#

And check if its null

regal scaffold
#

yeah I'm changing to that rn

#

Just noticed

hazy parrot
#

Also this empty switch is kinda...

tardy delta
#

interesting

regal scaffold
#

It's for the future

#

For config updater no?

#

I can remove it for now obviously

#

I was just thinking on ikt

#
    private void setConfigFile() throws IOException, InvalidConfigurationException {
        config = getConfig();
        int configVersion = config.getKeys(false).contains("CONFIG_VERSION") ? config.getInt("CONFIG_VERSION") : -1;
        if (configVersion == -1) {
            Bukkit.getLogger().log(Level.WARNING, "Config version is outdated. Resetting config version to 1");
            getConfig().load(new InputStreamReader(getResource("config.yml")));
            getConfig().save(new File(getDataFolder(), "config.yml"));

        }
    }
#

There you go. that looks much better

quaint mantle
#

Hey there. I have a simple fake player. When the npc faces to north, it's head being a bit weird. anyone knows whats the error here?

https://cdn.discordapp.com/attachments/1072278481850867802/1076872643522875444/2023-02-19_17-25-42.mp4

            Vector dir = player.getLocation().toVector().clone().subtract(npc.getLocation().toVector()).normalize();
            
            double r = Math.sqrt( dir.getX() * dir.getX() + dir.getY() * dir.getY() + dir.getZ() * dir.getZ() );
            double yaw = Math.toDegrees(Math.atan2(-dir.getX(), dir.getZ()));
            double pitch = Math.toDegrees(-Math.asin(dir.getY() / r));

            connection.sendPacket(new PacketPlayOutEntityHeadRotation(npc.getPlayerObject(), (byte) yaw));
            connection.sendPacket(new PacketPlayOutEntity.PacketPlayOutEntityLook(npc.getPlayerObject().getId(), (byte) yaw, (byte) pitch, true));
        
#

I want it to look my eyes. Its working fine for other rotations but when north, it is a bit weird

green tapir
#

how can I fire a let's say fire_charge at a specific direction with a specific radius?

#

and make the exploded blocks surroundings turn into a specific block

eternal oxide
green tapir
#

like coding a meteor that turns surrounding exploded blocks into magma and netherrack

quaint mantle
eternal oxide
#

NPC is a Player

quaint mantle
#

i mean the real player

green tapir
#

how can I make a let's say tnt explode and turn all exploded blocks into (80%) netherrack/magma block (20%)

quaint mantle
#

Also, which version is this? It says ClientboundRotateHeadPacket cannot be resolved

eternal oxide
#

thats 1.19.3?

quaint mantle
#

i was using 1.16.5

eternal oxide
#

1.19.2 sorry

quaint mantle
#

time to update

green tapir
#

everyone ignoring me be like

chrome beacon
#

Use random to randomize the blocks

green tapir
eternal oxide
#

you don;t need to place, just get teh blocklist in the explosion and randomize

green tapir
#

oh

#

.-.

#

im dumb

eternal oxide
#

after you made your changes don;t forget to set teh yield to zero and probably clear teh BlockList

#

you still want the explosion to happen, just not change blocks

dry yacht
# regal scaffold I need to force it because the config file changed drastically

Well... if your plugin is actually used by people you shouldn't do that, :-: Think about your layout properly before the first release and then only patch in keys on the fly or deprecate others (would be best if you'd also add a comment above). But drastically changing the whole file would be a dealbreaker for most people who took the time to make it their own and now have to manually migrate everything.

stone jackal
#

Hey, how I can create a clickable npc in java spigot 1.12.2 ?

dry yacht
chrome beacon
#

I'd use the Citizens API

tardy delta
#

any more methods i can add to my math parser? i currently have sin, cos, tan, asin, acos, atan, sinh, cosh, tanh, sqrt, cbrt, log, rad, floor, ceil, abs, int, pi, e, min, max, avg, round, rand, exit, and, nand, or, xor, not, nor, xnor

#

lol

stone jackal
chrome beacon
#
API

Citizens has an extensive API for working with NPCs. Make sure you always are using an up-to-date build of the CitizensAPI to ensure that your plugin works with the latest release of Citizens.

stone jackal
tardy delta
#

i always made my npcs myself with packets πŸ₯Ί

regal scaffold
chrome beacon
stone jackal
#

Both of them

chrome beacon
#

So to add the line you open the file and write the text then you save

tardy delta
#

(a, b) -> a != 0 ^ b != 0 ? 0 : 1 me wondering how a != 0 ^ b != 0 is a valid expression

#

or does ^ act as a boolean operator?

#

probbaly xor ig oh ye

chrome beacon
#

πŸ’€ Use variables

tardy delta
#

varargs method

chrome beacon
#

the plugin manager

tardy delta
#

^^

#

is there a reason you're instantiating all your stuff before calling that method?

dry yacht
tardy delta
#

you dont do registerEvents(new EventHandlerX(), this)

#

i dont think thats supposed to work lol

dry yacht
#

If you're really interested in a more clean and flexible solution (which most people actually aren't, lol), you could check this out: https://github.com/BlvckBytes/AutoWirer

It's very simple and lightweight. This is how I use it: https://paste.md-5.net/wocudisoza.java

In your case, the addInstantiationListener for Listener.class would do the trick. You of course still need to add the classes to have a reference, but the part of wiring is being done for you.

torn shuttle
#

does spigot have a specific implementation for async callbacks?

stone jackal
hazy parrot
#

If its true and file already exist, it will be overwritten

tardy delta
#

replace

hazy parrot
#

Old school impl

tardy delta
#

them not using FIles

zealous osprey
tardy delta
#

uh oh

cobalt thorn
#

Hi, im having a stroke for making this, i made an upgrade item when you click into an armor it opens a GUI but i realized after some time that how can i change the lore to the armor piece selected, any help on how to pass it from the InventoryClickEvent in the upgrade to the one in the GUI?

some code:
https://sourceb.in/uffy1QlnMJ (GUI)
https://sourceb.in/ya7Kvy8eEx (Event)

tardy delta
#

its currently only working with numbers but ye i might try

#

i dont even know how vectors work lol

zealous osprey
#

Well normally you can distill vector math down to a sequence of regular expressions, where each result is "stored" in a different portion of the vector.
Important math expressions for vectors are the dot product, normalizing and smth I never can remember.

tardy delta
#

i was thinking about transforming my parser to a interpreted language but that will probably go brr

stone jackal
#

Hey, how I can create a clickable NPC without Citizens ?

eternal oxide
#

not easily

#

it takes a lot of Java knowledge, NMS and rewrites for every version of MC/Spigot

tardy delta
cinder spindle
#

Hey anyone know their way around 'creating a pull request'?

pseudo hazel
#

what do you mean?

#

?contribute

pseudo hazel
#

can I have a scoreboard thats visually present on the players sidebar but still have the tablist displaying a player name with the prefix of another scoreboard objective?

#

or can I have multiple objectives on the same scoreboard but only have 1 showing

#

like I can make a scoreboard and add an objective for the team name prefix

#

and then another objective for the things that I want to display on the scoreboard

#

like can both of those things be on the same scoreboard?

eternal oxide
#

I've not done anythign with tablist

pseudo hazel
#

hmm ill play around then

dry yacht
#

Yes, that's possible. Scoreboard Objectives and Teams don't really share anything that could collide. Teams are just named groups with members and some properties.

cobalt thorn
#

Hi with the replaceall if i have something like "Power LVL" but has some color code doesn't get replaced?

int s = Armor.getLore().size();
            for(int x = 0; x < s; x++) {
                String st = Armor.getLore().get(s);
                st.replaceAll("PowerLVL", "Speed");
            }
 //&e&l* &d+PowerLVL <- Color code 

but doesn't work, no error too

pseudo hazel
#

do you want to also replace the color code?

valid basin
#

Does anyone know a way to make brewing instant? And make it require certain amount of money to brew?

#

So players don't need to wait

cobalt thorn
pseudo hazel
#

and now its replacing teh color also?

#

or what doesnt work about it

cobalt thorn
cobalt thorn
smoky oak
#

iirc theres some sort of event triggered if a player places an item in an inventory

eternal oxide
cobalt thorn
pseudo hazel
#

you need to re apply the line to the lore

#

like you are just getting a copy of the lore, not actually setting it back

eternal oxide
#

except you are getting the index by size when arrays are indexed on zero

cobalt thorn
eternal oxide
#

you are not looping lore to replace the string

cobalt thorn
eternal oxide
#

you are trying to fetch the last entry + 1 and perform a replace on that

pseudo hazel
#

you mistyped

eternal oxide
#

you shoud get x not get s

warm mesa
#

New Day

pseudo hazel
#

you probably want to get the x'th line instead of s'th one, like String st = Armor.getLore().get(x);

warm mesa
#

New attempt

cobalt thorn
#

x < s -> s < x?

pseudo hazel
#

no

#

what is s

chrome forge
#

Hi, is it possible to send chest opening animation without using nms packets?

cobalt thorn
#

OOOH i got it

eternal oxide
#

first line inside your for loop

warm mesa
cobalt thorn
eternal oxide
#

lastly this is not how you actually modify lore

icy beacon
#

for values added with YamlConfiguration#addDefault, how do I make sure that the values are there? if I use #options().copyDefaults(true), then everytime i edit a value in the configuration, it'll be overwritten upon restart and i don't want that to happen

cobalt thorn
eternal oxide
#

get lore -> modify List -> put back on object

cobalt thorn
eternal oxide
#
lore = Armor.getLore();
for (String line : lore) {
  // replace
  line = line.replaceAll("PowerLVL", "Speed");
}
Armor.setLore(lore);```
wet breach
tardy delta
#

replaceall is for regex remember

cobalt thorn
eternal oxide
#

it also works for string replace

tardy delta
#

it will work yes

#

am i looking at kotlin or smth cuz Armor

#

or are we not caring about naming conventions anymore

cobalt thorn
tardy delta
#

also strings are immutable so line.replace wont have any effect to line

cobalt thorn
tardy delta
#

String#replace returns a new string with the replaced content of the string you call that method on

warm mesa
eternal oxide
#

yep

tardy delta
#

spigot-server?

warm mesa
eternal oxide
#

you should never need to modify BT at all

#

I have no idea why your build fails. We went over everything yesterday

#

cmd and Bash

#

java version, cmd line, file location, access level.

thick oracle
#

Can anyone here recommend me some Command Frameworks?

eternal oxide
#

The only one which gets recommended here is Aikars ACF

dry yacht
eternal oxide
#

^

thick oracle
pseudo hazel
#

I would usually work the other way around

icy beacon
#

well acf makes your life 100 times more convenient imho

#

but it will give your plugin some extra weight

#

if you don't mind it, try it

echo basalt
#

acf is a bit too much imo

eternal oxide
#

I generally java public abstract class BaseCommand implements CommandExecutor

icy beacon
eternal oxide
#

then extend it for each command

echo basalt
#

I made my own tiny SimpleCommand util that is about 10kb

icy beacon
#

if your plugin has a lot of commands with a lot of code, it can probably be simplified

pseudo hazel
#

whats in this basecommand then

icy beacon
pseudo hazel
#

like input checking?

#

or what else would you put in such a class

eternal oxide
#

just a constructor and a default onCommand

pseudo hazel
#

other than concrete commands

eternal oxide
#

then any shared fields

thick oracle
eternal oxide
#

?paste

undone axleBOT
eternal oxide
pseudo hazel
#

I guess

echo basalt
#
public class WhateverMyCommand implements SimpleCommand {

  @Override
  public String getIdentifier() {
    return "teleport.*"; // /teleport 123asdf
  }

  @Override
  public String getPermission() {
    return "command.teleport";
  }

  @Override
  public void execute(CommandSender sender, String... args) {
    Player source = (Player) sender;

    String targetPlayer = args[0];

    if(targetPlayer.isEmpty()) {
      ...
      return;
    }

    Player target = Bukkit.getPlayer(targetPlayer):

    // validate target
    source.teleport(target.getLocation());
  }
}
#

idfk

pseudo hazel
#

all it really does is just hide some casting of the sender

echo basalt
#

It's good enough

pseudo hazel
#

as far as I can see

#

yeah same I feel like CommandExecuter is already the base so there is no reason imo to make another one for it

eternal oxide
#

it allows you to minimize code not having to check for console etc in every command

#

you can also simplify tab complete using an abstract

thick oracle
#

tab complete is already pretty simple as is imo

pseudo hazel
#

well you still need to check for console in your implemented class, but now its a boolean instead of a cast check

eternal oxide
#

true

echo basalt
#

nice song choices

icy beacon
#

thx xd

thick oracle
#

saving the config on plugin reload will override previous settings afaik

icy beacon
#

oh that could be actually

#

should i swap reload and save

thick oracle
#

I usually have a reload method like this

public static void reloadFiles(boolean save) {
  try {
    if (save) config.save(configFile);
    config.load(configFile);
  catch (IOException | InvalidConfigurationException e) {
    e.printStackTrace();
  }
}

and in my reload command I just call FileManager.reloadFiles(false);

icy beacon
#

honestly config reloads are the bane of my existence

#

i never get them right on the first try

#

and barely on the fifth

echo basalt
#

static config?

#

oh hell no

thick oracle
#

is there anything wrong with it? never had any issues

icy beacon
#

thx lewd person

cunning canopy
#

ArmorStand#setHelmet is deprecated. What do I do?

proper notch
#

See its docs.

Deprecated.
prefer EntityEquipment.setHelmet(org.bukkit.inventory.ItemStack)```
cunning canopy
#

thanks

#

Is there a way to make an entity invisible from the time spawned so you can't see the armorstand visible for a splitsecond?

frank kettle
#

What's the problem with seeing a armor stand?

cunning canopy
#

it is supposed to be invisible

frank kettle
#

You can use NMS then

#

And send packets of the armor stand after you have created it fully.

eternal oxide
thick oracle
#

ArmorStand inherits LivingEntity and can thus use #setInvisible(), no?

cunning canopy
#

a consumer?

eternal oxide
#

in the consumer you can set it invisible and that code runs before it's actually spawned

frank kettle
cunning canopy
#

but you can still se it for a split second

eternal oxide
#

then he can;t be using the consumer method

thick oracle
#

oh, didnt read that part, sorry

frank kettle
#

He must be using a 5tps server and really bothered by it

cunning canopy
cunning canopy
#

Thank you

eternal oxide
#
world.spawn(world.getSpawnLocation(), ArmorStand.class, (stand) -> { stand.setInvisible(true); });```
paper viper
#

why does this is not creating a 3x3 portal?

            block1x1.setType(Material.PORTAL);
            block1x2.setType(Material.PORTAL);
            block1x3.setType(Material.PORTAL);
            block2x1.setType(Material.PORTAL);
            block2x2.setType(Material.PORTAL);
            block2x3.setType(Material.PORTAL);
            block3x1.setType(Material.PORTAL);
            block3x2.setType(Material.PORTAL);
            block3x3.setType(Material.PORTAL);
#

1.12.2

sacred mountain
#

very unrelated to minecraft but how would i replace numbers in a string with their sum if they are next to each other?

e.g.
28hi -> 10hi
248test49helloworld10 -> 14test13helloworld1

#

cant figure it out for the life of me

sacred mountain
#

yeah tried that the library doesnt give me anything useful

icy beacon
#

library?

#

regex is a java built-in

sacred mountain
#

yeah that one

eternal oxide
#

yes regex

sacred mountain
#

(\d+) i tried

icy beacon
#

uh

#

i don't think that's sufficient

sacred mountain
#

seemed to do something but i dont know how to capture groups properly

icy beacon
#

oh

sacred mountain
icy beacon
#

so you need to cache a pattern somewhere

#

like you know

#

Pattern pattern = Pattern.something("(\\d+")

#

and then

#

uh

#

Matcher

#

something

#

lmao

sacred mountain
#

yeah i have all that

icy beacon
#

show your code at least

sacred mountain
cunning canopy
#

I dont really understand the clazz argument for world.spawn

sacred mountain
#

no clue what to do with the matcher object

icy beacon
#

while (matcher.find())

#

and then matcher.group(1) something

#

i do not remember 😭

#

but it should be group

eternal oxide
#

or split on a regex

icy beacon
#

yeah that would work actually

eternal oxide
#

you can split numbers and letters

sacred mountain
#

how

#

ok

icy beacon
#

well split() accepts regex actually

#

so i guess just pass a regex string there

#

toTruncate.split("\\d+")

#

wait no

#

that would remove the numbers

eternal oxide
icy beacon
#

so instead remove everything that's NOT a number

#

and work with numbers

thick oracle
eternal oxide
#

you need two splits the same as the stackoverflow shows, if you want to reassemble it after

sacred mountain
#

so it wouldn't sum correctly

icy beacon
#

that would return you an array

sacred mountain
#

oh i see ok

icy beacon
#

like 28a15 -> [28, 15]

sacred mountain
#

so to remove everything else i just split with regex

eternal oxide
#

you split to create two arrays, one of the number and one of words

icy beacon
#

you need to split by a regex that matches anything that's not a number

#

so perhaps negate your \d+

eternal oxide
#

you add up each char in the number array, then recombine with yoru words array (if you need to)

sacred mountain
#

[^\d]+

#

something like that

#

\D+

eternal oxide
pseudo hazel
#

if its only letters you can use /w

sacred mountain
#

ran a few tests

#

thats a bit weird

pseudo hazel
#

what regex did you use

#

and what test cases

sacred mountain
#

\D+

#

same as [^\d]+ according to intellij

pseudo hazel
#

yes thats true

#

is that the full regex?

sacred mountain
#

yeah

pseudo hazel
#

okay and what kinda strings did you test

sacred mountain
#

oiers1
q2i1e2rosl

#

the first 2

#

some random spam

#

p2p1p2[, 2, 1, 2]

printed the array next to the string

#

br6[, 6]

pseudo hazel
#

weird

#

idk whats going on

#

it shouldnt put an empty match xD

eternal oxide
#

[^a-zA-Z]+ gets you all the numbers \D+ gets you all the words

clear wave
#

Hello, I tried using mojang mappings and spawning a ServerPlayer, but when starting / reloading the server I get this error

at me.souprpk.areaglow.AreaGlow.onEnable(AreaGlow.java:18) ~[?:?]
Caused by: java.lang.ClassNotFoundException: net.minecraft.world.entity.player.Player``` which then points to a class that has all my nms imports and handles spawning / removing entities

I have downloaded the remapped 1.19.2 version with Buildtools and also have specialsource-maven with spigot <classifier> set to remapped-mojang, so I'm not really sure what could be causing this error
eternal oxide
#

or easier \d+ and \D+

#

gets you two arrays

paper viper
#

why does this is not creating a 3x3 portal?

            block1x1.setType(Material.PORTAL);
            block1x2.setType(Material.PORTAL);
            block1x3.setType(Material.PORTAL);
            block2x1.setType(Material.PORTAL);
            block2x2.setType(Material.PORTAL);
            block2x3.setType(Material.PORTAL);
            block3x1.setType(Material.PORTAL);
            block3x2.setType(Material.PORTAL);
            block3x3.setType(Material.PORTAL);

1.12.2

eternal oxide
clear wave
# eternal oxide ?nms

I already checked this and have my pom.xml setup the same way (only changed the version 1.19.2-R0.1-SNAPSHOT )

paper viper
# eternal oxide first guess is all your blocks are teh same block not different ones

No
Block block1x1 = block1.getRelative(BlockFace.UP);
Block block1x2 = block1x1.getRelative(BlockFace.UP);
Block block1x3 = block1x2.getRelative(BlockFace.UP);

        Block block2x1 = block2.getRelative(BlockFace.UP);
        Block block2x2 = block2x1.getRelative(BlockFace.UP);
        Block block2x3 = block2x2.getRelative(BlockFace.UP);

        Block block3x1 = block3.getRelative(BlockFace.UP);
        Block block3x2 = block3x1.getRelative(BlockFace.UP);
        Block block3x3 = block3x2.getRelative(BlockFace.UP);
eternal oxide
paper viper
#

locations are corect

eternal oxide
#

then do yoru blockchange without physics

paper viper
#

?

eternal oxide
#

setType(material, false)

sacred mountain
#

getting the sums isnt the difficult bit atm

eternal oxide
#

replace them back, ie rebuild the string?

sacred mountain
#

yeah but how would you rebuild it

#

if theyre in seperate arrays now

paper viper
eternal oxide
#

you use a StringBuilder adn concat the two arrays

sacred mountain
#

wut

sacred mountain
#

because i feel like that wouldnt

#

all numbers next to each other get added and put back into the string in the same place, replacing the numbers used

clear wave
dry yacht
dry yacht
#

Takes a bit of practise, but I'm sure you can make that work out! :).

dry yacht
eternal oxide
#

you are usign arrays rather than strings is all

cunning canopy
#

can server crashes be caused by infinite while loops?

eternal oxide
sacred mountain
dry yacht
wet breach
#

a while loop that doesn't complete essentially blocks the thread it is running on

desert tinsel
#

Hello, I'm trying to create a file like this java File file = new File("plugins/SennyMines/database.db"); if (!file.exists()){ file.createNewFile(); } But I get this exeption java.io.IOException: No such file or directory [18:31:00] [Server thread/WARN]: at java.base/java.io.UnixFileSystem.createFileExclusively(Native Method) [18:31:00] [Server thread/WARN]: at java.base/java.io.File.createNewFile(File.java:1043), why?

eternal oxide
#

folders don't exist

desert tinsel
#

but how can I create a folder automatically?

dry yacht
dry yacht
hazy warren
#

can you earn 6 figs off of making plugins

pseudo hazel
#

no xD

#

and besides, if that's something you need to ask, then there is no way

eternal oxide
#

most will be lucky to break 3 digits

pseudo hazel
#

i havent earned a single coin

#

I just make plugins cuz its fun

dry yacht
pseudo hazel
#

na

#

people have told me I should start selling mine

#

but like, whats the point xD

hazy warren
pseudo hazel
#

I already have a stable day job

#

sure ig

dry yacht
hazy warren
#

Guys what if you ahve the most insane utils class ever

#

Instantly finish 99% of all projects

pseudo hazel
#

well

#

thats just a programming language

#

has all the utils to make anything you want

dry yacht
#

If your plugins are superficial to the degree where utilities get you 99% of the way there, I don't think you'll be making much if anything. The great ideas don't take boilerplate, but rather a lot of logic.

hazy warren
#

Cmonnn

#

There's lots of boilerplate in those great ideas

#

Maybe the strategy is to only accept the easy ideas

#

and then finish them in 2 seconds with your insane util class

dry yacht
#

Yeah, but you usually don't think about how you reduce that, this comes naturally if you're doing it long enough. You'll stock up on libs of your own.

dry yacht
hazy warren
#

millions

pseudo hazel
#

yes thats a strategy

#

will leave you soulless though

#

if you had any to begin with

hazy warren
#

lol

#

That's messed up steaf...

#

The mega ideas aren't worth it

#

If I have to spend weeks making this guys insane minigame for 100 dollars

dry yacht
#

They are, if you actually take pride in engineering. If you don't, it's likely the wrong field for you. Maybe you can still pull it off, as many others here do, charging insane amounts.

hazy warren
#

So I should charge some wacky amount

dry yacht
#

And find the people willing to pay for it, yes, xD.

hazy warren
#

What if I take too much pride in my own work that once I make the plugin I just can't give it away...

dry yacht
#

You print it out and use it as a wallpaper in your whole home, :).

hazy warren
#

lol

#

What do you do when you just finally finished this man's $10000 commission

#

but you're just so proud of your precious plugin you can't give it up

dry yacht
#

Are people actually selling the whole thing? I'd just sell the software, not the rights of the code, xD. But I guess 10k would be something different, yes.

hazy warren
#

Yeah but just knowing that someone else out there is making off with your precious baby

#

Who knows how they're treating her

dry yacht
#

Man, you got too much time on your hand, xD

hazy warren
#

How much would you charge for an entire recreation of Mineplex's SSM gamemode BlvckBytes

dry yacht
#

Don't even know what that is, and I don't do commissions, xD.

hazy warren
#

It's like 21 kits ability based pvp

iron palm
#

i already shaded up netty and slf4j

chrome beacon
iron palm
chrome beacon
#

Relocation is a feature of shadow/shade plugin that changes the package of shaded dependencies

#

You need to do that to prevent conflicts if the same dependency is loaded multiple times

autumn ingot
chrome beacon
#

Not really

#

It still works the same way

#

You just have more customization with shaders and custom characters

#

and in 1.20 the display entities that can be interpolated

autumn ingot
#

alright, thanks!

hazy warren
#

has there ever been a pre player death event before

iron palm
iron palm
#

aight thanks

dry yacht
hazy warren
#

well there's an unresolved pre player death event in this guys code