#dev-general

1 messages · Page 626 of 1

quiet depot
#

your main class is your programs entry point, it should initialize your program's starting procedure, and absolutely nothing more

inner umbra
quiet depot
#

with that use case there is no reason you would ever need an instance of your main class anywhere

#

apart from perhaps some weird jvm thing

#

nothing is coming to mind for that though, but something might exist

steel heart
inner umbra
steel heart
#

Yes, but like this only proves piggy’s point?

inner umbra
#

Just proving my point of use cases for using <main>

quiet depot
#

the only preference that comes into play here is whether you prefer to write good, or bad code

#

if you prefer to write good, then there isn't a preference in whether the main should be a singleton or not, there is only one choice, it will not be a singleton

steel heart
inner umbra
steel heart
#

How?

#

I mean I guess writing bad code is preference but still

onyx loom
#

im failing to see how thats a good use of a main class anyway

quiet depot
#

I remember I actually had a system like this, identical to this, a long time ago

#

I made it because I thought it'd be useful, it sounded useful, but then I realised, it's literally not useful, it's just "cool"

steel heart
#

Like yapperyaps, we usually wanna separate and isolate concerns between different classes and modules, not merge 10 responsibilities into a single class

inner umbra
inner umbra
steel heart
#

Sure, but some preferences are just not good and beneficial preferences

inner umbra
quiet depot
#

if your preference is to write bad code, then sure, it is a preference to use a singleton

#

but if your preference is to write good code, then you do not get to choose here, because choosing to use a singleton for that and also choosing to write good code, are two fundamentally incompatible choices

heavy galleon
#

Hello, may I know how the Phrase Check in your Discord Bot works?😂

quiet depot
#

phrase check?

#

like the swear filter?

inner umbra
#

"good code" is opinion based... If something runs how intended it could be considered "good code". You get the idea.

quiet depot
#

no, good code is objective

inner umbra
#

Hell look at activision's recent games xD

heavy galleon
#

Get users purchased plugins

inner umbra
heavy galleon
#

Yes

quiet depot
#

ah...

#

no

#

trade secret I'm afraid

#

the cube doesn't want us telling secrets

heavy galleon
#

Okay

inner umbra
quiet depot
#

I don't believe you can access buyers via any of those methods

inner umbra
quiet depot
#

@pallid gale is this true

heavy galleon
#

Isn't there any other way to know if the user bought my plugin?

inner umbra
pallid gale
quiet depot
#

can u acecss buyer list through spigot api

pallid gale
#

no

#

spigot has no api keys, so you can only access public info

heavy galleon
quiet depot
#

I think we stopped using that because we got banned or something

pallid gale
#

That's a fork of maxims thing

#

which no longer works

heavy galleon
#

sad :(

quiet depot
pallid gale
#

nah its dead

inner umbra
#

Ah probs cause of the clouflare update MD_5 did a few months back

quiet depot
#

more than a few months

pallid gale
#

we went through many solutions before the one we're on now that has been mostly rock solid

#

it's not perfect though, far from it

inner umbra
#

I just use paypal's API and have it check the transaction memo lol

pallid gale
#

Having access to the paypal is the ideal world

#

We don't fingerguns

inner umbra
#

I haven't checked in quite a while but I think you can make different tokens on paypal that have different perms so could request perms for just transaction memos

#

But depends on the user.

pallid gale
#

idk, current way works atm

inner umbra
#

If you want spigot to have an API you gotta make your own and tell MD_5 to add it. He won't do anything himself anymore lol. Look how long the remove buyer button took.
(For buyers added manually)

hot hull
#

I am so confused, got a variable which I assign, in 15 classes the variable is assigned, yet in one it's null, it all works at the same time, yet that one is still somehow null, I have a timer running which prints if the variable is null, yet it never is, so how can it be null if in all the rest of the classes it's not

inner umbra
#

Show code

hot hull
#

Here it's not null:

public final class PlayerPostRespawnListener implements Listener {

    private final GameSession session;

    public PlayerPostRespawnListener(final GameLoop loop) {
        this.session = loop.session();
    }

    @EventHandler
    public void onPostRespawn(final PlayerPostRespawnEvent event) {
        if (this.session == null) {
            return;
        }

        this.session.equipmentComponent().apply(event.getPlayer());
    }
}
inner umbra
#

Can you DM me the txt lol

hot hull
#

Here it is:

public final class PlayerRespawnListener implements Listener {

    private final GameSession session;

    public PlayerRespawnListener(final GameLoop loop) {
        this.session = loop.session();
    }

    @EventHandler
    public void onRespawn(final PlayerRespawnEvent event) {
        if (this.session == null) {
            Logging.log("Session null");
            return;
        }

        final StageObject currentStage = this.session.currentStage();
        if (currentStage == null) {
            Logging.log("Stage null");
            return;
        }

        event.setRespawnLocation(currentStage.teamComponent().teamBukkitSpawnLocation(this.session.playerTeam(event.getPlayer()), currentStage.mapComponent().world()));
        Logging.log("Respawning ", event.getPlayer().getName(), " at ", event.getRespawnLocation());
    }

}
#

(Talking about GameSession so we're clear)

inner umbra
#

Where are you initializing PlayerRespawnListener?

hot hull
#

Same place as the other one

inner umbra
#

... show please lol

hot hull
quiet depot
#

show gameloop

onyx loom
#

upload source to github next

quiet depot
#

transfer copyright to me

ocean quartz
#

Send the entire code as zip

hot hull
#

If you want to finish the project sure, you can even collect the payment for it

inner umbra
#

Is this for that "among us" game?

hot hull
#

It makes no sense as the variable is set once, and I never unset it

#

And no?

hot hull
inner umbra
#

Ok yeah show gameloop like piggy said. Everything else matches so far.

ocean quartz
#

Also if all do do is loop.session() just pass session instead

quiet depot
#

so it's null on the spigot event and not the paper one?

hot hull
#

Yes

hot hull
quiet depot
#

do it for debug frosty

hot hull
#

Oh shit I'm a fucking tard

#

Lemme check something

inner umbra
#

I was thinking maybe you nulled the game session after post respawn or something.

hot hull
#

nvm I'm not

quiet depot
hot hull
#

Yeye doing that rn

quiet depot
#

also log in constructor

#

also compare instances

#

sout(this) in constructor & method

hot hull
#

Figured out the issue, I'm a slight nonce

onyx loom
#

ur a what now? 🤨

ocean quartz
#

A random or semi-random number that is generated for a specific use

hot hull
#

Does WE have an attribute to paste something without applying gravity to it, or how should I prevent sand from falling

prisma wave
#

nonce 😭😭🤣🤓

inner umbra
obtuse gale
#

It does, check the SideEffects things

#

pretty sure you set them somewhere in the edit session

hot hull
#

will check

tame bane
#

Anybody know how to block looking at /?

hot hull
#

isn't there a config option for that

inner umbra
tame bane
inner umbra
#

In your perms plugin add a - before the permnode Ex; -<perm>

tame bane
#

also

#

I saw on this one server, DonutSMP

#

They made it so you can only see the commands you can use

#

So when doing like /dc menu it won't show up as a actual command.

eternal compass
#

They probably had a plugin like CommandWhitelist

#

set up

#

but good plugins should do that by default

fresh parrot
#

can i ask you smth?

eternal compass
#

?help

compact perchBOT
#
FAQ Answer:
» Give the helpers some details
» Ask suitable questions
» Be polite
» Wait

Source

eternal compass
fresh parrot
#

ok sorry

eternal compass
weary wolf
#

why placeholder plugin isn't working on aternos

compact perchBOT
#
FAQ Answer:

Startup Log Location
Your latest startup log can be found in the logs folder of your
server directory, labeled as latest.log.
Please copy the contents and paste them to a paste service.
Type ?paste for more information.

half harness
#

because it doesn't show up in the plugin manager thing

frail glade
#

Ahh

#

They need to talk to their host then.

fresh parrot
#

bro, Aternos says they had to remove it cause it can abuse their system bruhhhhhhhh

pallid gale
#

Yeah technically you could download plugins via papi

#

Probs what they don't like

balmy agate
#

I'm experimenting with java sockets and I wanted to see what it can do so I made a program that using sockets to communicate between computers.
but for some reason idk why I'm getting a stackoverflow error.

#

can I get some help, idk why is this issue occurring.

#

?paste

compact perchBOT
#
FAQ Answer:

Paste Services
When asking for help with a config/menu/code issue please use our paste bin:
(we prefer it over pastebin.com)
HelpChat Paste - How To Use

balmy agate
balmy agate
#

Please ping me if you think you can help

wind patio
#

Does anyone know any simple key-value "databases" for Java, such as quick.db (javascript), TinyDB (python)?

cinder flare
wind patio
#

Yeah

potent nest
#

Chronicle-Map

wind patio
#

they should update their links 💀

wind patio
#

yeah, I found it

wintry harness
#

Does anyone roughly know the standard of developers that get admitted into Hypixel without a CS degree?

hot hull
#

Know your shit

#

That's probably about it

wintry harness
#

I don't know how good or bad I am

old wyvern
#

Give it a shot

#

Ull know

inner umbra
#

Based on what I've seen... I think they hire anyone that applies xD

half harness
#

watchdog 🤡

#

although maybe it is difficult to find an anticheat for 1.7

#

¯_(ツ)_/¯

inner umbra
half harness
#

but only 1.8+ is allowed

hot hull
#

It's not on 1.7

wintry harness
warped depot
#

can you tell me what happened to PlaceholderAPI?

prisma wave
#

A tragic loss

warped depot
#

Oh

plain dragon
#

at least they do in skyblock, idk bout the entire network

prisma wave
#

this is old news

#

Its been discussed about a million times now

onyx loom
#

one of their devs has openly said they use 1.7

inner umbra
plain dragon
#

i think minikloon said it on someone elses stream once

#

thats where i heard it

#

no idea where that vod is tho lol

onyx loom
half harness
# inner umbra

We didn't drop 1.7 support as soon as 1.8 was released. There was a period of time where you could connect with 1.7 or 1.8 on Hypixel. We didn't remove 1.7 support until 97% of players were already using 1.8. We did this so that we could use new features (such as the world border and new blocks). It also resolved a few bugs that we couldn't fix while still supporting 1.7.​

At this point, you may be wondering why we didn't update our servers to 1.8 itself. Well, that would require a huge amount of rewriting and testing of every single plugin and game mode that we used. We also use a heavily customised version of Spigot. Those changes would need to be ported over too. A lot of work. It was far easier to simply add support for later versions using protocol adaption and manually add the 1.8 features we needed to our custom Spigot.​

In future, I recommend you avoid the calling people idiots like that. After all, it kind of backfired on you considering they were correct.​

inner umbra
#

Huh. Wonder how they got armorstands to work then.

half harness
#

packets

#

server jar was prob too modified

#

to update

inner umbra
#

Weren't they horses with certain data in 1.7.10?

half harness
#

wdym

#

oh

#

idk

#

¯_(ツ)_/¯

inner umbra
#

It was like a hidden thing until "full release" 1.8

half harness
inner umbra
#

1.7.10 clients

half harness
#

o

prisma wave
#

i assume they just patched the shit out of the server jar to send the right packets

#

Which sounds evil but I guess it works

plain dragon
#

they use a very very customized and optimized server jar regardless so that sounds about right

#

i wouldn't be surprised if their server jar has a later bukkit api version

inner umbra
plain dragon
#

or that they added a lot of api to the jar

prisma wave
#

they probably added their own

plain dragon
#

yeah

#

cuz 1.7 spigot has like nothing

prisma wave
#

Since everything is custom there's no point enforcing yourself to the bukkit api

plain dragon
#

i mean they still run spigot

#

which uses the bukkit api

half harness
inner umbra
#

Yeah at this point I'm surprised they still claim they use spigot. With alot of the customization I wouldn't assume it would match spigot at all lol

half harness
#

but they prob still copied it

plain dragon
half harness
#

and now, it's still probably at least half of the api (or a quarter)

prisma wave
#

For all extents and purposes it's a completely custom server

plain dragon
#

its a very very much customized fork

inner umbra
#

Discord needs to add searching from roles instead of just users

half harness
#

add every user to the search 🥴

inner umbra
#

I want to be able to search in:#<channel> role:<rolename> <text> to show all from the text by users with the role.

static zealot
thick monolith
#

Anyone know a way to optimize having many different gun configs?

#

I know it would lag out the server this would be on if many players had many different guns, so I'm trying to figure out how to make it more efficient

inner umbra
thick monolith
#

Imagine crackshot but instead of 15 gun configs its 200, and for this hypothetical they're all being used at once

inner umbra
#

Well... if its your own plugin cache the gun settings rather then the whole config.

#

And if you really need the config have them cached on a delay. (Remove them after non use for a certain time)

thick monolith
#

Ah I see

#

second one makes sense shouldve thought of that lol

#

Whats the difference when you refer to gun settings instead of config?

inner umbra
half harness
#

(a GunSettings class for each gun)
so maybe like Map<String, GunSettings>, the string being the name of the gun
then the map gets updated on config reload and server start

inner umbra
#

^^^

wintry harness
#

Does anyone have experience with JPA or Hibernate?

#

I have the jakarta.persistence.schema-generation.database.action set to create in persistence.xml, so the JPA will create tables automatically for me if not exist. But now every time I run my program, it tries to create tables without checking and I keep receiving a warning (so the program runs without problem) saying my tables already exist. How do I set JPA to check for the existence of tables before actually creating them? Alternatively, how do I disable the warning?

pliant dagger
#

Anyone know any good alternatives to Google Analytics?

wintry plinth
pliant dagger
#

lmao

#

Always rely on Charlie for dat info

wintry plinth
#

ofc ofc 😂

pliant dagger
#

😂

#

How you been lad?

wintry plinth
#

I've used fathom for years now, really love it, can't fault it, and haha ive been good pal, hows you?

pliant dagger
#

Ye not too bad. Had to move out of the gaff due to Cost of Living

#

But we're looking for somewhere cheaper

wintry plinth
#

Yeah stuff has gone up so much now :( these UK increases are going wild

pliant dagger
#

Insane dude

#

Actual insane

wintry plinth
#

very

rotund egret
#

Imagine living

prisma wave
#

I...

#

I don't know why I said that

#

I knew it was intents lmao

cinder flare
#

haha

#

i had to read it again cause I was like "extents? hmmmmmm"

hot hull
#

Did you just "censor" british

brittle leaf
#

its not offensive to call someone british lol

prisma wave
#

it is

#

im offended

#

as a br*t

rotund egret
#

Lmao americans will never understand br*ts

pastel imp
#

random question, holograms are basically invisible armorstands, which are entities, so, having a lot of holograms or just armorstands in the server, could it cause lag because of the amount of entities?

agile galleon
#

make clientside entities

queen saffron
cinder flare
inner umbra
#

Armorstands cause more then fps lag. They are still entities. They are still ran through entity ticks. (I think paper has an option to remove them from the ticker)

Only packet based armorstands are not loaded in the world and only sending the packets would affect the server.

half harness
#

if you disable collision and gravity on it I think it causes a lot less server lag though

#

and maybe some client lag too

queen saffron
#

And if anything- minimal

inner umbra
#

Even with those options, spawn 2k armorstands spread across a few chunks. ;)

queen saffron
#

His question was about holograms.

inner umbra
#

Yes, but I wasn't responding to his question. I was responding to the comments about armorstand lag.

queen saffron
#

so im assuminngggg he doesnt have 2k in a couple chunks.

half harness
#

even 2k prob won't lag the server since it's not checking gravity, AI, or collisions

cinder flare
#

sending packets isn't free, but honestly 2k probably wouldn't be awful on a decent server

half harness
inner umbra
#

Besides me has anyone actually tried this? Been working with armorstands for quite awhile xD the more armorstands you have the laggier your server will become.

queen saffron
#

Ive tested the affects on armorstands on servers.

half harness
#

I've tried it but iirc it affected more ping than tps but it's been months so I don't remember

cinder flare
#

yeah the clientside lag and the amount of packets is a thing

queen saffron
#

but overal it wont affect tps by anything.

cinder flare
#

but the actual CPU impact of the server sending those packets is not very high

queen saffron
#

or barely anything

inner umbra
#

Yes but that's client side. I'm talking server side currently.

cinder flare
#

yeah server side it's not that bad

#

most of the server's work is sending packets lol

queen saffron
#

Server side the server Should be fine if the configuration is properly done. Except when you dont have the proper config and you have 7K armorstands

half harness
queen saffron
#

then the server goes kinda- dead.

#

7K armor stands in 1 chunk btw.

#

In bubble water.

cinder flare
#

lol

queen saffron
#

Tested on a server with 5Gb of ram.

inner umbra
#

I'm not on PC so I can't bring up my tests. Someone spawn 1 armorstand per block over 12 chunks. (Nogravity and set it as a marker in higher versions) then do a timings or spark profiler.

half harness
#

btw offtopic but what would happen if a program ran out of memory and the GC can't free up any more? And it's also capped using -Xmx

#

would it just kill itself?

queen saffron
#

^^^

half harness
#

oh

queen saffron
#

It would shut down

prisma wave
#

smh dkim never tried making a million new objects before

cinder flare
#

speaking of, if you're running a server on 1.17 or up, ZGC is really fucking good

prisma wave
#

or a max length array

queen saffron
#

Why the frick does stupid NameTagEdit keep enabling debug mode on its own..

cinder flare
cinder flare
#

nope, new ZGC flags

queen saffron
#

havent seen those yet

cinder flare
#

Aikar hasn't updated his flags in years lol, but now Minecraft newer versions can take advantage of Java upgrades

queen saffron
#

-Xms4G -Xmx4G -XX:+IgnoreUnrecognizedVMOptions -XX:+UnlockExperimentalVMOptions -XX:+UnlockDiagnosticVMOptions -XX:-OmitStackTraceInFastThrow -XX:+ShowCodeDetailsInExceptionMessages -XX:+DisableExplicitGC -XX:-UseParallelGC -XX:-UseParallelOldGC -XX:+PerfDisableSharedMem -XX:+UseZGC -XX:-ZUncommit -XX:ZUncommitDelay=300 -XX:ZCollectionInterval=5 -XX:ZAllocationSpikeTolerance=2.0 -XX:+AlwaysPreTouch -XX:+UseTransparentHugePages -XX:LargePageSizeInBytes=2M -XX:+UseLargePages -XX:+ParallelRefProcEnabled

#

These?

cinder flare
#

No

queen saffron
#

This is where im looking xD

cinder flare
#

java -Xms10G -Xmx10G -XX:+UseZGC -XX:ZCollectionInterval=30 -XX:MetaspaceSize=256M -XX:+DisableExplicitGC -XX:+AlwaysPreTouch --add-modules=jdk.incubator.vector -Duser.timezone="America/Denver" -Dlog4j2.formatMsgNoLookups=true -Dterminal.ansi=true -Dterminal.jline=false -jar server.jar --nogui

#

These are mine

#

and it is very nice let me tell you

queen saffron
#

Lemme get em up and running and do some tests

#

one of our servers runs on 1.18.2 so this might help

cinder flare
#

yeah I run all 1.18.2 servers and we had a big problem with long GC pauses with G1, so we swapped to ZGC and they are a thing of the past

#

kinda crazy how far technology has actually come

queen saffron
#

Ai has gone crazy far.

#

Oh oops i think i violated a rule by sayin that.

#

Sorry

cinder flare
#

lmao

queen saffron
#

i dont actually have the ZCollectionInterval flag

queen saffron
#

I gotta contact my host for this xD

cinder flare
#

lol, that's when you get a dedi and become your own host >:)

#

sweet, sweet Pterodactyl panel

queen saffron
#

Atm its cheaper if i just buy the servers like that-

#

Im still developing most of the network so

cinder flare
#

how many servers ya got? I've found if you have a big server, you need the performance of a good dedi, and if you have more than like 3 servers it is very worth getting a dedi and just using all your resources

queen saffron
#

We got 6 atm.

cinder flare
#

sheesh, how much per?

queen saffron
#

1$ per GB

#

Not pebblehost tho

#

got a deal over at a different company

cinder flare
#

oh

queen saffron
#

since i was about to switch to pebble xD

cinder flare
#

so how much do you spend in total for the 6 servers?

queen saffron
#

and they were like- we can pricematch lol

cinder flare
#

plus proxy

queen saffron
cinder flare
#

oh damn okay

#

that's pretty cheap lol

#

i suppose you're doing something light like minigames or something

queen saffron
#

Ill be upgrading 2 of the servers when we release

#

But we are doing Skyblock/ Vanilla Anarchy atm

cinder flare
#

oh huh

queen saffron
#

Pretty heavy gamemodes.

cinder flare
#

how many people per server?

queen saffron
#

With the upgrades?

#

or without

cinder flare
#

like right now

queen saffron
#

We arent open yet

cinder flare
#

ah

queen saffron
#

But i think theoretically we could hold like a solid 50 without lag?

cinder flare
#

i was gonna say, i do big SMPs with stuff like MMOItems and MythicMobs and ModelEngine, we do 50 people per server right now on a dedi and we have 4 servers

queen saffron
#

I got 500 slots on the network open for now so.

cinder flare
#

and we need the performance of a nice dedicated CPU lol

queen saffron
#

yeahhh i can get that

#

I think we have a dedicated Node but im not sure.

cinder flare
#

plus accessory hosting, like databases and website

queen saffron
#

Got any cheap dedi's i could look at?

cinder flare
#

OVH is where I get mine, unless you're located in Europe, in which case Hetzner is your company

queen saffron
#

The reason i went with my current host is cuz they have amazing ping towards the US etc while being in europe.

#

and cuz i like their systems

#

but i might look into a dedi eventually

cinder flare
#

you'll just use a panel like Pterodactyl or something that you setup your self

queen saffron
#

yeah okay

#

I think im using multicraft atm-

#

I dont think its terrible

#

but ive heard people hate it

cinder flare
#

oh yeah multicraft is not great lol

#

Pterodactyl is a lot nicer and has a ton more flexibility

queen saffron
#

i dont really get why

#

In all honesty most of the stuff i do is via the FTP

#

But i wouldnt say its terrible.

cinder flare
#

mostly closed source and proprietary and expensive, and just outdated UI and management ability

queen saffron
#

Ahh okay

cinder flare
#

kinda absurd to have to pay money just to use your own stuff lol

queen saffron
#

wdym?

cinder flare
#

you have to buy a license to use multicraft

#

whereas Pterodactyl is free and open source

queen saffron
#

oh like that

#

yeah okay fair

#

If i go for somethin itll probably be Hetzner

#

Since their dedi's there are 40$ a month for 64GB and over at my host its 110$ a month lol

cinder flare
#

yeah Hetzner is great, though don't know how great it would be for a server for Americans

queen saffron
#

Maybe when i switch ill have the funds to make a split network with a US location and an EU location

#

;/

#

idk

cinder flare
#

lmao probably not worth

#

OVH is not that much more expensive

#

especially if you get a deal for no setup fee

queen saffron
#

true

#

Thanks for the tech talk tho xD

cinder flare
#

yuh np

#

i was just so impressed with a new GC that I had to share lol

queen saffron
#

xD

#

Understandable

#

btw- why does Pebble ask for money to use Aikar's flags.

#

thats like- kinda bs

cinder flare
#

oh yes it's because hosts are a scam

queen saffron
#

Oof

cinder flare
#

if you have the technical knowledge, a dedi will always be a good investment for any server planning for more than 15 players

queen saffron
#

No true

#

Personally never used a dedicated server before tho

#

So I would have NADA clue where to start lol

cinder flare
#

ever used linux?

queen saffron
#

Mostly Kali Linux

#

For pentesting

cinder flare
#

then you should be pretty good lol, a dedi is generally just a linux box that you can do whatever on

queen saffron
#

Plot twist: you install Windows on the Linux system

#

And then get an entire army of people get mad at you for doing so

#

But yeah thanks man!

cinder flare
#

yup yup

last nacelle
#

anyone here good with packets? trying to cancel the q event with items and empty hand

#

So far i just have it set up with the item drop event, but that wouldnt work with nothing in hand, so thats why im resorting to packets.

#

SHIFT + Q would activate the ability

cursive jolt
#

So client sided the player will replace that item with air

last nacelle
cursive jolt
#

If you cancel the item drop event when the player is holding an item, it will desync the client

last nacelle
#

oh, okay.

cursive jolt
last nacelle
#

like when they press shift + Q wither skull projectiles will launch from them etc.

#

however PlayerDropItemEvent can only fire with item in hand, so I was looking for work around to get it when there is no item in hand

cursive jolt
#

So you just want to listen to the event

#

I’d cancel it with bukkit and listen to it with packets

last nacelle
#

yeah thats what I was looking to do, but you said its not good?

cursive jolt
#

Yeah that works

#

Just don’t cancel any packets

last nacelle
#

but what if they have an item in hand? I dont want them to throw their item out if they use their ability

cursive jolt
#

Cancel with bukkit

last nacelle
#

on packet listening to block dig, how can you differentiate from a regular Q drop or a block dig?

#
public void onPacketReceiving(PacketEvent event) {
      StructureModifier<WrappedEnumEntityUseAction> actions = event.getPacket().getEnumEntityUseActions();
                actions.
            }
cursive jolt
#

Idk I use PacketEvents

last nacelle
#

api?

last nacelle
pastel imp
last nacelle
#

noob question but how do you cancel a bukkit event from another class?

#

you have to get some sort of handler?

hot heron
#

You'd pass the event in to that class

queen saffron
pastel imp
queen saffron
#

Wdym by that?

agile galleon
cinder flare
pastel imp
# queen saffron Wdym by that?

So, lets say I use armorstands with a head just purely cosmetic for a generator (which is a block). That generator belongs to X user. So my idea was to despawn the armorstand when the user isnt online, since its useless to display it. And spawn it again on join.

cinder flare
agile galleon
#

not yet

#

dedicated cloud rn but afaik dedicated are coming too

cinder flare
#

Okay so... For the moment... Your best option in North America is OVH...

agile galleon
#

yes

cinder flare
#

Great conversation lmao

pastel imp
#

Tbh I just use Oracle Cloud...

#

They give a 24gb ram 4ocpu VM for free

#

😎

#

Perfectly enough for testing and whatsoever

frail glade
#

Heh... Enjoy it while it lasts.

distant sun
#

🤣🤣

potent nest
#

works fine for me :p

half harness
cinder flare
#

Oh that actually makes a lot more sense lol

half harness
#

🥲

#

they should remake that emoji

cinder flare
#

Though still not sure why they brought it up in the first place, that at least explains that lol

cinder flare
prisma wave
#

and they randomly terminate your account for no reason

potent nest
#

not for me

prisma wave
#

for now

rotund egret
#

Bm just doesn't pay his bills

quiet depot
#

yeah bm pay your $0 bills

#

sheesh

prisma wave
#

yeah

old wyvern
#

🤣🤣

#

Oracle is a pain

quiet depot
#

oracle is evil

old wyvern
#

Clearly

quiet depot
#

always has been

old wyvern
#

Owns java, must be

quiet depot
#

the oracle rabbit hole, full of shit btw, goes back a long time

#

probably worth a google

potent nest
pastel imp
#

has lasted for over a year now sooo

pastel imp
#

not to host an actual server, who is stupid enough to do such thing?

#

lol

cursive jolt
#

I am

last nacelle
#

anyway to detect when player opens up their own inventory? I've read its impossible, without a custom client. Wanted to double check

wind patio
#

IIRC there's an advancement for opening inventory, you can check PlayerAdvancementDoneEvent or whatever, if it's the Open Inventory one, remove it, rinse and repeat.

#

Tacky, but might work

silent basalt
#

Sheesh that’s kind of a big brain idea

brittle leaf
#

minecrafts way of handling recipes is a complex mistress

#

im looking it over to see if theres any optimizations i can make to my recipes and its like terrifying

brittle leaf
#

found the root of the recipe lookup, they use like stream()...findFirst() and something called a flatmap

#

which was weird

#

and some other weird stuff im not familier with such as Recipe<?> and

public <C extends Container, T extends Recipe<C>> Optional<T> getRecipeFor(RecipeType<T> type, C inventory, Level world) {
#

the thing thats confusing me is the <C extends Container, T extends Recipe<C>>, i have no idea what this type of syntax is called

#

or what to search online for the answer, guess ill start typing some keywords and hope for the best

distant sun
#

Generics

brittle leaf
#

thanks

obtuse gale
#

eww

brittle leaf
#

no idea what it is

#

well i have an idea but not sure how to use it or if i should as the current method seems optimal enough

distant sun
#

It accepts a RecipeType<Recipe<Container>> as first argument, and the second argument (C inventory) has to be the same type as the container from Recipe<Container>. So if you use RecipeType<Recipe<WorkBench>> (assuming WorldBench is a valid container type), the second argument has to be a WorkBench instance.

brittle leaf
#

i probably shouldve given a bit more context

brittle leaf
#

progress update to my crafting gui in a chest gui, it kinda works now. tho its deleting items which i assume is cus i dont check for inventoryaction, which i will do now.

brittle leaf
#

Turns out there is a client server desync with the player's offhand when attempting to put an item in it and its been cancelled.

timber oak
#

Does someone know if Vault works for 1.18.2? It just says that it isn't tested, on the spigot site

obtuse gale
#

yes

#

unless something regarding offline players has a dramatically catastrophic breaking change, odds are it will work in every future version

timber oak
#

Alright, nice

leaden sparrow
#

Hey I tried rebasing the last 7 commit so I can reword them (change the commit message) but I messed something up now when I run git rebase -i HEAD~7 it instantly says "Successfully rebased and updated refs/heads" anyone know how to fix that?

distant sun
static zealot
#

Hippity Hoppity your meme is now my property

dense dew
obtuse gale
#

oo

half harness
#

Nice

obtuse gale
#

Anyone here got any idea on IOS development? More specifically with RealityComposer & RealityKit

pastel imp
#

Uh random question, whats that thing some people have in github that shows like A+, B-, etc. Regarding the quality of the code?

old wyvern
#

Readme stats

pastel imp
#

Like, where can I find it?

#

Oh

#

Ok

#

Well is it for all repos or just one repo?

old wyvern
#

Its for your profile

pastel imp
#

Well I saw people using stuff for independent projects and it actually graded the quality of your code?

#

At least thats what I got told?

distant sun
#

codacy is an example

brittle leaf
#

I got shapeless recipes to work for my chest-based crafting GUI, they also now remove from the highest quantity slot instead of just the first to the last.

brittle leaf
#

i just checked and i could be wrong but i dont think hypixel has true shapeless recipes

brittle leaf
#

also shaped recipes now take priority over shapeless

subtle smelt
#

Who wants a completely useless command?

hot hull
#

I do

subtle smelt
subtle smelt
# hot hull I do

this command does all you need : summon many mobs at a time

    @Override
    public boolean onCommand(@NotNull CommandSender sender, @NotNull Command command, @NotNull String label, @NotNull String[] args) {
        if (sender instanceof Player) {
            if (sender.hasPermission("server.multisummon")) {
                Player player = (Player) sender;
                if (args.length >= 2) {
                    try {
                        EntityType entity = EntityType.valueOf(args[0]);
                        int amount = Integer.parseInt(args[1]);
                        for (int i = 0; i < amount; i++) {
                            player.getWorld().spawnEntity(player.getLocation(), entity);
                        }
                        player.sendMessage(colorize("&b&lTL &b&o: &4You summoned &e&o" + args[1] + " " + args[0]));
                    } catch (IllegalArgumentException e) {
                        player.sendMessage(colorize("&b&lTL &b&o: &4This is not an entity."));
                    }
                } else {
                    player.sendMessage(colorize("&b&lTL &b&o: &e/multisummon [mob] [amount]."));
                }
            } else {
                sender.sendMessage(colorize("&b&lTL &b&o: &4You don't have permission to do this."));
            }
        } else {
            sender.sendMessage(colorize("&b&lTL &b&o: &4You cannot do this. "));
        }
        return true;
    }

    public String colorize(String msg) {
        return ChatColor.translateAlternateColorCodes('&', msg);
    }```
hot hull
#

What the fuck

subtle smelt
#

I told you it was useless

forest pecan
#

hes talking about the code

#

lmao

subtle smelt
forest pecan
#

its kinda ugly

subtle smelt
#

ok and

forest pecan
#

let me get the arrow code gif

subtle smelt
#

i haven't used arrow code

forest pecan
#

you call that not arrow code?

#

Lol

#

that is the definition of arrow code

subtle smelt
#

I just call it code

#

ty very much

forest pecan
#

fck i cant find the gif

subtle smelt
#

lol

forest pecan
#

you thought you could dodge the bullet

#

little did you know

subtle smelt
#

bruh

forest pecan
#

Turn

if (sender instanceof Player) {
  // more conditionals here
}

to

if (!(sender instanceof Player)) {
  return true;
}

// conditionals here
#

understood?

sly sonnet
#

What the fuck is that arrow

subtle smelt
forest pecan
#

just flip the condition and put the rest after

subtle smelt
#

this is old code

#

I just copied and pasted it

#

lemme fix it up a bit

forest pecan
#

thats what they all say

subtle smelt
#

I can show the spigot thing

subtle smelt
#

wut

#

yk

#

that's not the plugin I was working on

#

same thing I just copied and pasted it

forest pecan
#

oh

subtle smelt
#

it doesn't even work

forest pecan
#

i just saw multisummon command

#

lol

subtle smelt
#

for 1.5

#

Let me bring up spigot rq

#

bruh no screenshots

#

@forest pecan it's really sad

#
    @Override
    public boolean onCommand(@NotNull CommandSender sender, @NotNull Command command, @NotNull String label, @NotNull String[] args) {
        if (!(sender instanceof Player)) {
            sender.sendMessage(colorize("&b&lTL &b&o: &4Only a player can execute this command."));
        } else {
            Player p = (Player) sender;
            if (p.hasPermission("server.multisummon")) {
                Player player = (Player) sender;
                if (args.length >= 2) {
                    try {
                        EntityType entity = EntityType.valueOf(args[0]);
                        int amount = Integer.parseInt(args[1]);
                        for (int i = 0; i < amount; i++) {
                            player.getWorld().spawnEntity(player.getLocation(), entity);
                        }
                        player.sendMessage(colorize("&b&lTL &b&o: &4You summoned &e&o" + args[1] + " " + args[0]));
                    } catch (IllegalArgumentException e) {
                        player.sendMessage(colorize("&b&lTL &b&o: &4This is not an entity."));
                    }
                } else {
                    player.sendMessage(colorize("&b&lTL &b&o: &e/multisummon [mob] [amount]."));
                }
            } else {

            }
        }
        return true;
    }```
#

it still is an arrow

forest pecan
#

you know you dont have to do that ONLY for that conditional

#

you can do that for other conditionals too

#

lmao

#

and you dont need else

#

if you return

subtle smelt
forest pecan
#

sigh

#
if (!(sender instanceof Player)) {
    // logic
    return true;
}

if (!p.hasPermission("")) {
    // logic
    return true;
}

#

get the idea?

subtle smelt
#

Pretty sure I'm using those

#

just oppisite

forest pecan
#

you arent

#

if you dont use that way you get an arrow

#

thats why it looks bad

#

lol

subtle smelt
#

if (p.hasPermission("")

forest pecan
#

thats the whole point

#

you dotn want an arrow

#

so you reverse it

#

so it looks easier to read

subtle smelt
#

I will try it for your sanity

#

since it's such a big deal

forest pecan
#

do you like reading left to right

#

or up to down

#

lol

subtle smelt
#

yes

forest pecan
#

for code

subtle smelt
#

I do

#

I've done it forever

#
    @Override
    public boolean onCommand(@NotNull CommandSender sender, @NotNull Command command, @NotNull String label, @NotNull String[] args) {
        if (!(sender instanceof Player)) {
            sender.sendMessage(colorize("&b&lTL &b&o: &4Only a player can execute this command."));
        } else {
            Player p = (Player) sender;
            if (!(p.hasPermission("server.multisummon"))) {

            } else {
                Player player = (Player) sender;
                if (args.length >= 2) {
                    try {
                        EntityType entity = EntityType.valueOf(args[0]);
                        int amount = Integer.parseInt(args[1]);
                        for (int i = 0; i < amount; i++) {
                            player.getWorld().spawnEntity(player.getLocation(), entity);
                        }
                        player.sendMessage(colorize("&b&lTL &b&o: &4You summoned &e&o" + args[1] + " " + args[0]));
                    } catch (IllegalArgumentException e) {
                        player.sendMessage(colorize("&b&lTL &b&o: &4This is not an entity."));
                    }
                } else {
                    player.sendMessage(colorize("&b&lTL &b&o: &e/multisummon [mob] [amount]."));
                }
            }
        }
        return true;
    }```
#

still an arrow

forest pecan
#

nope

#

thats not it

#

you dont understand

subtle smelt
#

I flipped the damn thing

#
            if (!(p.hasPermission("server.multisummon"))) {

            } ```
forest pecan
#

i hate to spoonfeed

#

but

forest pecan
#
    @Override
    public boolean onCommand(@NotNull CommandSender sender, @NotNull Command command, @NotNull String label, @NotNull String[] args) {

  if (!(sender instanceof Player)) {
    sender.sendMessage(colorize("&b&lTL &b&o: &4Only a player can execute this command."));
    return true;
  }

  final Player p = (Player) sender;
  if (!p.hasPermission("server.multisummon")) {
    return true;
  }

  if (args.length < 2) {
    player.sendMessage(colorize("&b&lTL &b&o: &e/multisummon [mob] [amount]."));
    return true;
  }

}
#

im not spoonfeeding all of it

#

but do you see the difference?

#

that is so much easier to read

subtle smelt
#

I see redundence

#
  if (!(sender instanceof Player)) {
    sender.sendMessage(colorize("&b&lTL &b&o: &4Only a player can execute this command."));
    return true;
  }

  if (!(sender instanceof Player)) {
    return true;
  }```
forest pecan
#

not there

#

lol

subtle smelt
#

I already have your mistake

forest pecan
#

well bro idc if i accidently added that

#

if you arent gonna learn

#

your problem

subtle smelt
#

but why "final player"

prisma wave
#

final good

forest pecan
#

^

prisma wave
#

mutability bad

#
  • ratio
onyx loom
#

it injects a virus into ur server

subtle smelt
#

Never used final ever

onyx loom
#

dont use final

subtle smelt
#

except in one line of code

prisma wave
#

ok

#

sorry to hear that

subtle smelt
#
    private final ServerPlugin plugin;

    public Heal(ServerPlugin plugin) {
        this.plugin = plugin;
    }```
forest pecan
#

believe it or not, but final actually makes some optimizations lol

prisma wave
#

true

#

final makes ur code faster

#

and thread safe

subtle smelt
prisma wave
#

for free!

subtle smelt
forest pecan
#

nah

#

nothing is safe

subtle smelt
#

it does the literal same thing

forest pecan
#

😂

subtle smelt
#

I just replied

#

to your last message

prisma wave
#

cope

subtle smelt
#

Cope

prisma wave
#

i have not been crying whatsoever

#

in fact i did not even read the old messages

forest pecan
#

lol

subtle smelt
#

sure

forest pecan
#

i aint crying

prisma wave
#

however if i had to guess i would say that pulse was probably correct

subtle smelt
#

he's not

prisma wave
#

in what way?

subtle smelt
#

he just wants looks

prisma wave
#

ok im guessing ur new to coding

subtle smelt
#

not really

#

I've just haven't learned java

#

lol

prisma wave
#

but ask literally any professional programmer and they will tell you that readability is the most important thing in 99% of scenarios

prisma wave
subtle smelt
#

I've just learned spigot

prisma wave
#

looks are inherently important

subtle smelt
#

For what

forest pecan
#

sir in my veteran years in this server ive probably seen 30x of you before

#

lol

subtle smelt
#

who's gonna decompile my plugin and complain to me about how my code3 looks

prisma wave
#

decompiled code never looks good

#

but you my friend are the one that's gonna be complaining

#

because when you come back in 2 months to change 1 thing and you have an unreadable mess, you're going to suffer

subtle smelt
#

I've had that snip of code forever

#

I can still read it

#

Because I am it's creator

forest pecan
#

come back 3 months

subtle smelt
#

"I was there when it was writen"

forest pecan
#

yeah thats what they all say

#

lol

prisma wave
#

sure, maybe you can with 30 lines, but what about an entire codebase where you've completely ignored "looks?"

prisma wave
forest pecan
#

cough bukkit

prisma wave
#

you will forget

#

i bet money on it

prisma wave
#

why not?

subtle smelt
#

because

#

I just stick to llittle things

forest pecan
#

nobody's brain is that 5head

subtle smelt
#

I don't wanna make a "codebase"

prisma wave
#

for now

#

i mean

#

a codebase literally just means code lol

subtle smelt
#

I just like making completly useless plugins

forest pecan
#

thats a codebase

prisma wave
#

well okay suit yourself i guess

subtle smelt
forest pecan
#

whatever

subtle smelt
#

NOW back to my thing

#

Who want's a code snippet that can disable fishing

static zealot
#

bump

prisma wave
#

no thank you but thanks for the offer

subtle smelt
distant sun
#

Lmk when you offer 2 pizzas

static zealot
#

I'll take 3

subtle smelt
prisma wave
subtle smelt
static zealot
#

yeah. clearly there's joe 64 chunks away. he's just waiting to be found

forest pecan
#

wheres joe?

subtle smelt
#

joe mama

static zealot
#

64 chunks away from your location and rapidly aproaching

#

so you better start running

subtle smelt
forest pecan
subtle smelt
static zealot
subtle smelt
static zealot
forest pecan
#

lol

subtle smelt
subtle smelt
static zealot
forest pecan
#

lol

subtle smelt
static zealot
#

pterobutt

subtle smelt
#

no

#

@forest pecan

static zealot
#

no

#

its mario

subtle smelt
#
    @Override
    public boolean onCommand(@NotNull CommandSender sender, @NotNull Command command, @NotNull String label, @NotNull String[] args) {
        if (!(sender instanceof final Player p)) {
            sender.sendMessage(colorize("&b&lTL &b&o: &4Only a player can execute this command."));
        } else {
            if (!(p.hasPermission("server.multisummon"))) {
                sender.sendMessage(colorize("&b&lTL &b&o: &4You don't have permission to do this."));
            } else {
                switch (args.length) {
                    case 0:
                        sender.sendMessage(colorize("&b&lTL &b&o: &4You need to pick an entity"));
                    case 1:
                        sender.sendMessage(colorize("&b&lTL &b&o: &4You need to specify a number"));
                    case 2:
                        try {
                            EntityType entity = EntityType.valueOf(args[0]);
                            int amount = Integer.parseInt(args[1]);
                            for (int i = 0; i < amount; i++) {
                                p.getWorld().spawnEntity(p.getLocation(), entity);
                            }
                            p.sendMessage(colorize("&b&lTL &b&o: &4You summoned &e&o" + args[1] + " " + args[0]));
                        } catch (IllegalArgumentException e) {
                            p.sendMessage(colorize("&b&lTL &b&o: &4This is not an entity."));
                        }
                }
            }
        }
        return true;
    }```
static zealot
#

wow

subtle smelt
#

more arrow for you @forest pecan

#

sorta

static zealot
#

so much arrow

#

I love arrow

prisma wave
#

@subtle smelt have u ever heard of haskell

prisma wave
#

ok

subtle smelt
static zealot
#

why would you need to know who I am?

subtle smelt
#

Because you're supposed to be trusted

static zealot
#

anyways. it says it right there in the title

#

oh

#

idk. I don't even trust myself

subtle smelt
#

Then how did you even become trusted

static zealot
#

hmm

compact perchBOT
static zealot
#

I have no life

#

that's how

subtle smelt
#

I cannot execute that command here

#

I don't have a life

#

but

#

I haven't spent time on this server

static zealot
#

oh look. its 88

#

from BlitzGamer_88

subtle smelt
#

"Unfortunately we've been noticing quite the trend of you being actively helpful to members in the community"

static zealot
#

yes.

#

that's why I executed the command

#

I can't believe you actually spotted that

subtle smelt
#

You're not really that helpful

static zealot
#

I faked it all

prisma wave
#

yeah everyone hates blitz

subtle smelt
#

I don't hate him

static zealot
#

that's a lie

subtle smelt
#

I just said he's not really helpful

#

also if you're on staff blitz

#

why are you posting a sticker of a

static zealot
#

pterobutt?

prisma wave
#

a sticker of a what?

static zealot
subtle smelt
#

can't you see

#

it

ocean quartz
#

Wtf lol

subtle smelt
#

pteropenis

static zealot
ocean quartz
#

Yeah, that's why I said that

prisma wave
#

penis?!?!?!?!!?

#

WHAT

static zealot
#

I was typing something out and it automatically showed up bcz discord dumb. so I just sent it bcz I realised discord wants me to do it

subtle smelt
static zealot
prisma wave
static zealot
#

joe

subtle smelt
#

the penisdactyl

prisma wave
#

i really dont get what u mean

subtle smelt
prisma wave
#

yeah what about it?

forest pecan
static zealot
#

yeah idk DarkLife. Seems like you're going insane

forest pecan
#

you are making me blush

subtle smelt
#

I have even more code for you to see

#

You might need some bleach

forest pecan
#

bleach for what?

subtle smelt
#
    List<String> arguments = new ArrayList<>();

    public @Nullable List<String> onTabComplete(@NotNull CommandSender sender, @NotNull Command command, @NotNull String alias, @NotNull String[] args) {
        if (command.getName().equalsIgnoreCase("multisummon")) {
            if (args.length != 1) return Collections.emptyList();
            if (!sender.hasPermission("server.multisummon")) return Collections.emptyList();

            return StringUtil.copyPartialMatches(args[0].toLowerCase(), Stream.of(EntityType.values()).map(Enum::name).map(String::toLowerCase).collect(Collectors.toList()), new ArrayList<>());
        } else if (command.getName().equalsIgnoreCase("server")) {
            if (arguments.isEmpty()) {
                arguments.add("reload");
            }
        } else if (command.getName().equalsIgnoreCase("gamemode")) {
            if (arguments.isEmpty()) {
                arguments.add("creative");
                arguments.add("survival");
                arguments.add("adventure");
                arguments.add("spectator");
            }
        }
        List<String> results = new ArrayList<>();
        if (args.length == 1) {
            for (String a : arguments) {
                if (a.toLowerCase().startsWith(args[0].toLowerCase()))
                    results.add(a);
            }
            return results;
        }
        return null;
    }```
static zealot
subtle smelt
#

TabComplete

forest pecan
#

blitz u got instagram?

static zealot
#

yes. kinda.

subtle smelt
#

tf

forest pecan
#

wanna follow me

#

lmao

static zealot
#

I already follow you daily

#

on the streets

forest pecan
#

😮

#

Wait

#

is that you in my closet

subtle smelt
#

Blitz why don't you walk with them to their house

#

with a knife

#

for Protection

static zealot
forest pecan
#

is that your side kick?

static zealot
subtle smelt
#

Family guy

#

Chris

forest pecan
#

yeah

static zealot
#

you my friend are very cultured

subtle smelt
#

ty

subtle smelt
prisma wave
#

bored apes jpegs?!?!

hot hull
#

Already screenshotted, get fucked nerd

static zealot
subtle smelt
#
package me.darklife12345.serverplugin.events;

import org.bukkit.ChatColor;
import org.bukkit.entity.Player;
import org.bukkit.event.EventHandler;
import org.bukkit.event.Listener;
import org.bukkit.event.player.PlayerFishEvent;
import org.jetbrains.annotations.NotNull;

public class NoFish implements Listener {
    
    @EventHandler
    public void onFishEvent (PlayerFishEvent e) {
        final Player p = e.getPlayer();
        
        if (!(e.getPlayer().hasPermission("server.fish"))) {
            e.setCancelled(true);
            p.sendMessage(colorize("&b&lTL &b&o: &4You're not allowed to fish."));
            p.damage(5);
        }
        
    }    public @NotNull String colorize(String msg) {
        return ChatColor.translateAlternateColorCodes('&', msg);
    }
    
}
#

no fishing allowed

subtle smelt
#

he is literally staff

subtle smelt
# subtle smelt ```java package me.darklife12345.serverplugin.events; import org.bukkit.ChatCol...

Updated code

package me.darklife12345.serverplugin.events;

import me.darklife12345.serverplugin.ServerPlugin;
import org.bukkit.ChatColor;
import org.bukkit.entity.Player;
import org.bukkit.event.EventHandler;
import org.bukkit.event.Listener;
import org.bukkit.event.player.PlayerFishEvent;
import org.jetbrains.annotations.NotNull;

public class NoFish implements Listener {
    private final ServerPlugin plugin;

    public NoFish(ServerPlugin plugin) {
        this.plugin = plugin;
    }

    @EventHandler
    public void onFishEvent(PlayerFishEvent e) {
        boolean fishThing = plugin.getConfig().getBoolean("Fishing");
        final Player p = e.getPlayer();
        if (!(fishThing)) {
            if (!(e.getPlayer().hasPermission("server.fish"))) {
                e.setCancelled(true);
                p.sendMessage(colorize("&b&lTL &b&o: &4You're not allowed to fish."));
                p.damage(5);
            }
        }
    }

    public @NotNull String colorize(String msg) {
        return ChatColor.translateAlternateColorCodes('&', msg);
    }

}```
hot hull
#

Smh @static zealot get with the program

subtle smelt
static zealot
#

async

subtle smelt
#

async with what

static zealot
#

everything

subtle smelt
#

I don't understand

#

I cannot comprehend what you want me to do

#
    private final ServerPlugin plugin;

    public ChatEvent(ServerPlugin plugin) {
        this.plugin = plugin;
    }

    @EventHandler
    public void onChatEvent(AsyncPlayerChatEvent e) {
        String chatFormat = plugin.getConfig().getString("ChatFormat");
        String playerPrefix = plugin.getConfig().getString("Prefix");
        Player player = e.getPlayer();
        String chatFormatted = Objects.requireNonNull(chatFormat).replace("{prefix}", Objects.requireNonNull(playerPrefix)).replace("{player}", player.getName()).replace("{message}", e.getMessage());
        e.setCancelled(true);
        Bukkit.broadcastMessage(colorize(chatFormatted));
    }
    public @NotNull String colorize(String msg) {
        return ChatColor.translateAlternateColorCodes('&', msg);
    }``` 😮 chat plugin
distant sun
#

I will kindly ask you to stop sending random snippets of code, thanks

distant sun
#

Why is that in their server LOL

hot hull
#

Why would it not be, I mean look at that beauty

static zealot
viral grove
#

Me rn:

potent nest
#

what about @Disabled?

boreal needle
#

100% of zero tests passing is still 100%

distant sun
#

True

half harness
#

Since someone could just decompile the client and see how the report button works

#

or is there something that mojang does that stores chat messages on their own server

#

thats the only thing i can think of

obtuse gale
#

you need to select the messages yourself, and that's where message signing comes into play, the whole thing around message signature is to verify the actual message (with its "actual contents") are legitimate and actually sent from the player it claims to be from

half harness
#

or would the sender sign it and then the sender would tell the server which would tell the receiver the signature?

obtuse gale
#

when you launch the game, auth servers provide you with a public and a private key; the private key your client uses to sign messages (and other things like certain command arguments), public key is sent to the server when you login (and "broadcasted" to other online players) which is used to verify the integrity of your messages

#

something something cryptography stuff

half harness
#

oh ic

#

wait so this means that the server can disable chat reporting? by just not sending the keys

obtuse gale
#

if the signature is invalid (or absent) then there is no way to verify a certain message (which btw, messages are sent alongside a corresponding signature) is legit or not, it could've been tampered with in some way.. somehow, how? idk, but that does not matter in any case

half harness
#

"yes"? 👀

obtuse gale
#

not in such direct way, but you can strip out signatures from messages on the packet stream

#

I would advise against disallowing basic player safety features however

half harness
#

and this can be changed by ProtocolLib, right?
As I'm assuming this would just be another field in the packet

obtuse gale
#

"sure man, come on in this construction site but you must not use a hardhat"

obtuse gale
half harness
#

wait so each signature is generated by the message contents?

#

Oh wait yea

#

I was thinking each player has its own signature

#

for some reason

#

wait

#

wait which one

#

😖

obtuse gale
#

when you send a chat message or some command arguments (like /say or /me etc), the client will do some magic cryptographic woes and produces a hash, then with the public key you can do some more crypto fuckery to verify the validity of the hash against the message

#

I don't know the mathematical details or process but if it matches, the message is untouched and basically means "yes, this player sent this"

#

if it doesn't, something went wrong or was modified somewhere after the player signed and sent the message

half harness
obtuse gale
# subtle smelt uh why ;- ;
def test_method_4(self):
        b = """
            class A:
                def __init__(self, foo):
                    self.foo = foo

                def next(self):
                    pass

                def __iter__(self):
                    return self
            """
        a = """
            class A:
                def __init__(self, foo):
                    self.foo = foo

                def __next__(self):
                    pass

                def __iter__(self):
                    return self
            """
        self.check(b, a) 

😮 foo bar

you get that now?

compact perchBOT
#
FAQ Answer:

Paste Services
When asking for help with a config/menu/code issue please use our paste bin:
(we prefer it over pastebin.com)
HelpChat Paste - How To Use

keen cape
obtuse gale
#

I got banned in spigotmc community discord for saying I got banned in roblox for saying I hate Koreans so imma make squid game real in korea

So I wonder if this server will kindly ban me too with no specific server like every server ever

#

@distant sun
You come from chad city you know what to do right

static zealot
distant sun
#

The fuck

obtuse gale
#

just do it im tired of getting banned in every server for no reasons so this time i will give a reason so pls do it

#

im wanderingpalace by the way so ban my main acc too

obtuse gale
agile galleon
#

Ban reason: Chad

obtuse gale
#

you can also, like

hot hull
#

Leave server exists

obtuse gale
#

no i want to get banned for actually a reason for the first time ever

#

im tried of getting randomly banned for no reasons

#

people are just racist towards my name
Just because im deleted user doesnt automatically mean im a troll

#

Deleted User is a race now?

hot hull
#

Well I mean right now you're acting like a troll lmao

obtuse gale
#

cuz i have been identified as a troll for so long so why not?

#

tired of discord anyway ban me pls
end it quicker

ruby dew
#

end me too

#

i main acc

obtuse gale
#

yes you main acc very nice

#

user settings -> delete account

hot hull
#

Man's twelve

obtuse gale
#

nah you dont understand
being banned FOR A REASON breaks the loop

static zealot
#

hello. I've been trying to reach you about your car's extended warranty!

obtuse gale
#

right now im stuck in a loop i need yall to help me break it

obtuse gale
#

thats famous last word

static zealot
hot hull
#

Your better watch your kneecaps

obtuse gale
#

You have been banned from SpigotMC.
Reason
No reason was given.

#

ok

#

you should get some green tea

static zealot
#

discord now shows a reason when you're banned?

obtuse gale
#

its from their bot

static zealot
#

ah. cool

obtuse gale
#

alr mate you know what give my your paypal i will pay for my ban

#

20 usd each i have 2 accs deal?

#

I can give you my paypal

#

I don't have any moderation powers tho

#

maybe you can let me join your own discord server and ban me

#

without reason?

#

no way

static zealot
#

haha

obtuse gale
#

remember the days when we all have green names

#

that was kinda the pinnacle of my life

#

right now i do not know what am i doing
im lost and im down

#

hey trusted why are we in the same discord server but our lives are so different

obtuse gale
#

nobody lives life worse than me

static zealot
obtuse gale
#

i have wasted enough time to not know how to advance any further

ruby dew
#

this account used to have green name too
but everything changed after i got cyan name
right in time

#

now im a wandering skull with no purpose

#

empty and all hollow