#help-development

1 messages · Page 1623 of 1

eternal night
#

well, if you can't pass the player name to mvconfirm you won't be able to hide that message

#

instead of manually dispatching commands tho, you could code against the multiverse API instead

manic crater
#

ah ok

#

thank you

grim ice
#

wait

#

where ???

quaint mantle
grim ice
#

I can't see where did I static abuse

grim ice
#

OH FUCK

#

im fixing it rn

eternal night
#

I mean, still not a fan of the namespaced key enum/static plugin instance setup but w/e

echo basalt
#

Like

ivory sleet
#

static = global = good???? /s

echo basalt
#

ItemStacks.qq() sounds very obvious that it is projectile protection?

grim ice
#

Yeah

#

just pp but

#

backwards

#

and is more family friendly

#

HAHA

echo basalt
#

Even then

#

Use an item builder

#

Imagine you're just some beginner

#

or you're looking at old code

#

and it's like hmm okay lemme just change a mention

#

So you use your IDE autocomplete

#

And it just returns

silk()
eff()
unb()
sh()
mn()
sm()
sq()
qr()
bl()
qf()
pf()
qq()
#

You'd just want to learn NMS at that point because you're a literal god if you understand what's going on

#

first 1-3 lines are somewhat fine

#

but after that

grim ice
quaint mantle
#

someone take over

echo basalt
#

nah

regal dew
#

why can’t it be static? Totally fine to have it static

echo basalt
#

It can be static

#

but he wants to pass some variable

regal dew
#

sth can be brought up about thr amount of code duplication

#

But its fine to have that static

grim ice
#

Yeah its static abusing

#

not really

echo basalt
#

static abuse is the code I run on production

#

um

#

Static is fine if the variable is constant

#

and appropriately named

grim ice
#

@ivory sleet

#

can you help?

regal dew
#

static is just … not using an instance

echo basalt
#

You can either ditch all static

#

or you can make them all public static whatever

#

and make an init method

echo basalt
#

Only garbage-collected if they're nulled out iirc

grim ice
#

idk man

echo basalt
#

For the lifetime the jvm

regal dew
#

Static fields aren’t necessarily bad, as long as you dont keep collections which are infinitely growing

echo basalt
#

Static abuse means that someone is using static for convenience and not following OOP principles

echo basalt
#

Collections, database connections or really any mutable objects shouldn't be kept statically

echo basalt
#

But it can definitely be better

grim ice
#

how

echo basalt
#
public static ItemStack PROTECTION;
...

public static void init(MyMainClass main) {
  PROTECTION = ...;
}

for example

regal dew
#

that solves nothing

echo basalt
#

Passes his variables

#

I don't see a big problem needing to be solved

#

If you DI everything you don't really need static at all

regal dew
#

its an utility class, its fine

echo basalt
#

I'd only use something like that if I need the values on an enum

tepid oar
#

is the best way to store things such as a kill counter for each player json files?

echo basalt
#

If the plugin somehow gets disabled those itemstacks are still kept in-memory

regal dew
#

If you need an instance, design it following the factory design pattern

echo basalt
#

even better if they're proprietary

#

but ultimately, a database

tepid oar
#

for a small scale server?

tepid oar
echo basalt
#

Yes

#

A global file will just cause long startup times at a certain point

tepid oar
#

ah ok thanks

grim ice
#

wait

#

can i do

#

private static ItemStacks items;

crude sleet
#

Is there a way to block the click on a furnace recipe? I have a custom Inventory and i dont want that the player can click on the recipe in this specific inventory (Without removing the furnace recipe)

grim ice
echo basalt
#

singleton

grim ice
#

for example

echo basalt
#

bad

grim ice
#

o

echo basalt
#

still uses static

grim ice
#

Help

#

bro

grim ice
#

@quaint mantle e u cant help?

quaint mantle
#

just use dependency injection

grim ice
#

bruh

tepid oar
#
        <dependency>
            <groupId>me.clip</groupId>
            <artifactId>placeholderapi</artifactId>
            <version>2.10.9</version>
            <scope>provided</scope>
        </dependency>```
grim ice
#

"just use"

tepid oar
#

"Dependency 'me.clip:placeholderapi:2.10.9' not found"

grim ice
#

It seems im static abusing by getting ItemStacks from another class

#

1s

tepid oar
grim ice
#

Not my question

#

I didnt ask for that though

paper viper
#

It’s a tip

grim ice
#

well

#

That's going out of topic

paper viper
#

It’s really not. You have like 10 billion other issues you need to fix too lol

#

There’s a ton of repeated code

grim ice
#

w h a t

#

how is that repeated

#

bro u didnt see how it was before lmfao

#

u wouldve murdered me if u saw it

paper viper
#

It’s still repeated

#

Lol

grim ice
#

how

paper viper
#

Idc what it looks like before. We care about what it looks like right now

#

Lol

grim ice
#

@paper viper how to fix it

paper viper
#

You can also condense all those statements into one and just pass in some sort of enum or something to identify

grim ice
#

i understood nothing

#

not what u sent

#

what PulseBeat sent

#

idk

paper viper
#

You know, this is why when we tell you something not related it’s because it’s something related to basic Java that is good to point out and bring to your attention

#

As those basic mistakes are definitely supposed to be fixed first

main dew
#

how can i find memory leaks?

unreal quartz
#

not really a surefire way except to leave your program running and see if the allocated memory is unexpectedly high

grim ice
#

@paper viper btw if ur gonna help

#

at least sned me a tutorial

#

its not like i didnt try :/

#

i didnt find any good tutorial

#

i went on those

#

its ?learnjava

#

?learnjava

undone axleBOT
grim ice
#

i read the first 4

#

LMAO

#

exactly the one i focused the most on

#

it doesnt even have enums

ivory sleet
#

2hex still need help?

grim ice
#

yes

#

im almost giving up :/

main dew
#

But idk what plugin
And how my plugin idk where

grim ice
#

honestly

#

the most annoying thing to hear is learnjava

#

i legit spent days finding tutorials i found nothing useful

ivory sleet
#

?ask

undone axleBOT
#

If you have a question, please just ask it. Don't look for staff or topic experts. Don't ask to ask or ask if people are awake or available. Just ask the question to the channel straight out, and wait patiently for a reply.

grim ice
#

if ur gonna tell me that then at least

#

give me a tutorial

#

without shrugging

grim ice
#

tbh i found a solution some guy helped

#

they dont help

#

and u did nothing, even the command i told u it lmao

#

thats not how helping works, ur just making my day worse

#

Yes im serious

#

thats not how to help

#

shrugging

#

isnt helpful

ivory sleet
#

2Hex

#

what did u need help with tho

grim ice
#

uh

ivory sleet
#

all I see is just a ludicrous argument going on here

grim ice
#

solving static abusing

#

then it went to java

#

then shit

#

my guy

#

u know i wont even bother

ivory sleet
#

static abuse?

grim ice
#

yes

#

and DRY

ivory sleet
#

be more concrete

#

sysdm take a chill pill

toxic mesa
#

So I'm looking for a way to get the block a player is standing on. But the block the person is actually standing on, not just the block under the player as it doesn't account for sneaking and going to the edge. For some reason this sounds easy but turns out to not be easy. I've been looking through forums but haven't really found an answer. What would be the best way of doing this?

ivory sleet
#

no worries but I think your point has come through here

grim ice
#

u have a point

#

but ur fucking point is dirt useless

crude sleet
ivory sleet
#

2hex alright srsly

grim ice
#

either give me a solution

ivory sleet
#

what u need help with

#

give me context

grim ice
#

finding a good tutorial of java

#

apparently

ivory sleet
#

yelling at sysdm wont help either

#

define good

grim ice
#
quaint mantle
crude sleet
#

No xd

grim ice
#

something what wont make me look dumb

quaint mantle
#

i have no idea if you can @crude sleet

crude sleet
#

:/

ivory sleet
#

udemy acc got some good courses

#

for free

quaint mantle
#

is there a way to check if a runnable is finished

#

?

ivory sleet
#

yeah

grim ice
#

i found one

ivory sleet
#

I believe

grim ice
#

that has

ivory sleet
#

?jd-s

undone axleBOT
ivory sleet
#

check BukkitTask

grim ice
#

140 hours full course

ivory sleet
#

or BukkitScheduler

grim ice
#

ppl told me its originally a 1 year

quaint mantle
grim ice
#

ok

#

ill stop for 15 days

#

and learn java everyday

#

until i finish this 140 hours

toxic mesa
#

mmm that would require a lot of performance for a simple check :/

#

well simple...

#

apparently not

toxic mesa
#

sneaking to the edge of a block or just standing on the edge of a block

toxic mesa
exotic kraken
#

Hey !

I have a question

Is it possible that when you type in the chat @ and you press TAB, the list of the online players appears ?

#

like that

#

ah damn I can't send a picture in the living room

unreal quartz
#

would love to see your living room

exotic kraken
#

development

#

I'm french sorry 😅

#

so it's possible ?

#

aah is not possible in vanillia ?

#

ty !

quaint mantle
#

can someone show me how to decrease the health of the bossbar every second till 1 minute?

narrow vessel
unreal quartz
#

from the context of the message they appear to be trying to alter tab completions for chat

#

which is impossible

narrow vessel
#

except you dont need the @

quaint mantle
#
task = new BukkitRunnable() {}.runTaskTimer(plugin, 0L, 1200L);
                
            
            
            Bukkit.getScheduler().scheduleSyncRepeatingTask(plugin, new Runnable() {

                @Override
                public void run() {
                    int r = 1;
                    if(r > 9) {
                        r = 1;
                    } else {
                        ChangeSkin(player, r);
                        r++;
                    }
                    
                }}
            , 0L, 1200L);``` I have 2 runnables I want both of them to run at the same time what do I do to make that happen?
exotic kraken
#

I'm sure it's possible

candid galleon
#

why not make it one runnable

digital plinth
#

is it possible to do a 20fps animation in mc

digital plinth
#

like refresh blocks once per tick

narrow vessel
#

yes

digital plinth
#

but it will lag a lot?

narrow vessel
#

depends

digital plinth
#

like the calculation wont lag much but

#

the block placement and stuff

#

it lags a lot

#

so is there a way to like

narrow vessel
#

you can use certain entities and nms or something to do more than 20fps

digital plinth
#

optimize block palcement

lapis moon
#

Quick question, but how do I reference a potion? Ik it is like material.POTION and then I do not know what should come after it

digital plinth
narrow vessel
#

well you dont need to spawn and remove them constantly

digital plinth
#

wait is the lag client side or serverside

narrow vessel
#

both depending on how much youre doing

digital plinth
narrow vessel
#

is it 500 blocks or 50,000

digital plinth
#

hmm like maybe

#

360p?

#

how much is that wait no

narrow vessel
#

360p is a resolution

digital plinth
#

well yea

#

im counting the pixels

#

thats a lot of pixels...

narrow vessel
#

yeah thats gonna lag

#

both ways

#

and i dont think you can even do that many blocks 20fps/tps

digital plinth
#

yea

#

lets say i want to do a 20 by 10 block animation

#

and it ends up lagging

#

is there a way to optimize it

#

without

#

lowering the resolution

#

feel like minecraft is really unoptimized

#

...

#

especially java edition

narrow vessel
#

well mc isnt designed to play "an animation" at 360p 20fps

digital plinth
#

hmm will it help if I send the new packets after all blocks are replaced

digital plinth
#

XD

#

not really realistic but

#

meh why not try it out

paper viper
#

With my plugin and idek how they did it

#

Probably beefy ass PC

#

But it was smooth

narrow vessel
#

client mod?

unkempt ore
#

Okay wow, making a multi version plugin may be much more of a pain in the ass than I thought

paper viper
#

Nope

#

All plugins

unkempt ore
#

I literally changed the version and everything broke. It like all broke

paper viper
#

It uses VLC media player and FFmpeg to play the video

#

So pretty much C, C++, and Assembly

unkempt ore
#

I didn’t think I’d have to interface so much

#

But like everything broke. Tf

#

There’s no PersistentDataContainer in 1.12. Wtf am I supposed to do then

paper viper
#

NBT API

unkempt ore
#

Like, the 3rd party thing?

paper viper
#

Why does that matter

unkempt ore
#

Because the only NBT API I know is that one library plugin

#

I’m asking if you’re talking about that

paper viper
#

I’d prefer not to use NMS

#

Lol

unkempt ore
#

Yeah

#

What about BlockData?

#

I see BlockData is gone too

opal juniper
unkempt ore
#

I’d guess server

opal juniper
#

I suppose - although I forget how it is implemented

#

I guess with enough packets you could fill up the netty buffer

#

But that has no real performance effect

#

Just latency

paper viper
opal juniper
#

Huh

#

I didn’t expect that really

plain scroll
#

hey

#

is it possable to make something i make in an item stack that can only be broke once?

#

so that when the person brakes it it just destorys?

plain scroll
paper viper
#

plugin

plain scroll
#

ooo

#

link?

paper viper
#

Its not published

plain scroll
#

ahh kk

paper viper
#

im still developing it

plain scroll
#

noice!

paper viper
#

ya

plain scroll
#

pls ping me when u do lmao

#

looks amazing

paper viper
#

Thanks

plain scroll
#

does it run mp4 or url vids?

paper viper
#

both

plain scroll
#

oooo

plain scroll
#

ik its probs easy just i can't wrap my head arround it

digital plinth
unkempt ore
digital plinth
#

here

#

make sure to do throughout research before making a plugin

#

XD

digital plinth
#

how did you get the client to display it

unkempt ore
#

Bruh

#

When did I ever say I was trying to make that

digital plinth
#

the server sents packets and the client matches the packets with the code and put on the correspodding texture correct?

#

that is how mc works?

digital plinth
unkempt ore
#

Yeah….and who said the first ever?

digital plinth
#

well

unkempt ore
#

Learn to read before saying shit like that

#

XD

#

XD

digital plinth
#

if you make a plugin that is similar to viabackwards

#

u wont get much downloads

unkempt ore
#

Dude

digital plinth
#

well whatever u do ur thing

unkempt ore
#

I do not care

digital plinth
#

idc not my problem

unkempt ore
#

LMAO

digital plinth
#

dude im just trying to help you

unkempt ore
#

You’re doing an awful job

digital plinth
#

i thought you were wasting time making a already existing plugin :/

stone sinew
#

Imagine making plugins based on the amount of downloads you would get lol. ViaBackwards never would have been made in the first place.

digital plinth
paper viper
#

lol

digital plinth
#

what will you feel

unkempt ore
#

😡

stone sinew
digital plinth
digital plinth
unkempt ore
#

Sure as hell looked like it

dusty herald
#

but i dont sell it

digital plinth
#

im jealosu tbh

proud basin
#

I'm not sure why this is happening but when a player gets a multiple cooldowns then leaves the first cooldown stays but the other ones get removed. When the user disconnects I am saving their data into a db and grabbing their data and storing it into a map when they join.

unkempt ore
dusty herald
#

supa

digital plinth
unkempt ore
#

Ew

digital plinth
dusty herald
digital plinth
#

Since when did this discord have so many toxic people

unkempt ore
#

WTF?!

digital plinth
unkempt ore
#

YOURE CALLING US TOXIC BRUH

digital plinth
#

so i abandoned it

dusty herald
#

my plugins are the best

stone sinew
dusty herald
digital plinth
#

i hate u luckperms

dusty herald
#

luckperms is great

unkempt ore
#

If your motivation is solely to be the first you won’t get too far

#

In a lot of things

digital plinth
#

well, what motivates me is to new ideas. I try to make things that don't exist so I can contribute to society. I also try to make stuff better, if I see a poorly coded plugin that has a nice idea and can be proven useful for the minecraft community, i will try to re-code it to make it better

#

thats just my personal opinion

#

🤷‍♂️

unkempt ore
#

Shrimp

digital plinth
#

XD

unkempt ore
#

You immediately assumed I was trying to make a new idea though, pushing your ideology onto others. Most people I know don’t think like you

#

Sure new ideas are great. But it’s not something to pursue religiously

#

That isn’t how you grow

dusty herald
#

supa

#

rate my plugin

digital plinth
#

i believe in science

unkempt ore
#

Dude…

#

Wow

#

You are 8 years old

dusty herald
#

you can be both religious and believe in science though

unkempt ore
#

I give up

digital plinth
stone sinew
digital plinth
#

I am only trying to help you...

dusty herald
#

why are you even here supa

#

didn't you leave

digital plinth
#

🙁

digital plinth
unkempt ore
#

That may be the formal meaning, but informally it can mean with a lot of dedication

digital plinth
#

why should i leave

unkempt ore
#

That is how I’ve often seen the word used too

dusty herald
#

did i say you should

digital plinth
hasty prawn
#

Yeah Operation you used it right dw lmao

proud basin
unkempt ore
#

You grew from the experience. In the end, the attempt made you grow as a programmer. That’s not wasted time

#

Trying things done before is not wrong at all

plain scroll
#

I have an itemstack on another class. Is it possable to use that instaed of mat.white_bed ????

plain scroll
unkempt ore
#

Okay but why are you complaining

dusty herald
#

You can check the similarity of two itemstacks

digital plinth
dusty herald
#

idk

unkempt ore
#

You still assumed that my motive was like yours right away

plain scroll
#

like ItemStack. ?

dusty herald
#

itemStack.isSimilar(itemStack2)

digital plinth
unkempt ore
#

@plain scroll A#b means “an instance of class A, method b”

digital plinth
#

how many times do i need to tel you yhis

unkempt ore
#

I sure as hell didn’t

dusty herald
plain scroll
digital plinth
#

dude

dusty herald
#

no

plain scroll
dusty herald
#

also since when hasn't spigotmc been toxic 😏

unkempt ore
#

Where the fuck are you drawing the connection

dusk flicker
#

Can yall fucking drop it

digital plinth
paper viper
dusty herald
#

idk if will matter since it's a broken block

#

no point in comparing item stacks

#

stick with material

digital plinth
plain scroll
#

yea but idk why the blockBroken.setType air wont work with just a mat...

unkempt ore
#

When did I ask if it’s already been made kid

#

When

dusty herald
#

many people make identical plugins

digital plinth
plain scroll
#

so when i brake the bed taht was made with IS it jjust drops a bed

dusty herald
#

doesn't mean they're not smart

unkempt ore
#

I didn’t

digital plinth
#

yes

#

you did not

dusty herald
#

but yeah take it to DM or drop it

unkempt ore
#

You’re trolling me at this point

dusty herald
#

😎

digital plinth
#

Im just wasting time on someone with scattered nerves at this point

dusty herald
#

did i stutter

#

😠

digital plinth
plain scroll
digital plinth
#

did you code custom drops?

plain scroll
#

nah

plain scroll
#

i want it to drop nothing

#

when you break it lol

digital plinth
#

oh

dusty herald
#

oh

digital plinth
#

well just use events

#

why not

dusty herald
#

remove the drops

digital plinth
plain scroll
#

because idk why it wont work with material

dusty herald
#

what event is this again

digital plinth
#

or delete the drops in itemdrop

dusty herald
#

i forget

digital plinth
hexed hatch
#

you might be able to inject or modify the world loot tables

plain scroll
dusty herald
#

idk

digital plinth
#

try removing the drops from drop item event

hexed hatch
#

show cod

#

:cod:

plain scroll
digital plinth
#

code*

dusty herald
#

it's not dropitemevent if ur breaking a block and removing the block

#

it's blockbreakevent

dusty herald
hexed hatch
#

are you ✨ registering the listener ✨

digital plinth
dusty herald
#

good smart idea

digital plinth
#

maybe that caused it

#

to not work

plain scroll
#

yea

digital plinth
plain scroll
#

i think so lmao

digital plinth
#

sout

plain scroll
#

idk why i lefit that in there 😅

digital plinth
#

or broadcast

dusk flicker
#

just check lol

digital plinth
#

and put a log at the beginning of the method

#

method*

plain scroll
digital plinth
dusty herald
#

yo

#

are u going to rate my plugin supa !

digital plinth
#

what do you databases for? I mean you have the ram and hard drive to store stuff

digital plinth
dusty herald
digital plinth
#

why ask me...

plain scroll
#

ok here is the "bug" i get

digital plinth
dusty herald
#

dont review it

#

give me ur opinion on it

proud basin
#

so what if I say dog water (I wont) but what if

plain scroll
#

if the bed is called Sleeping Bag it drops the bed but if i sleep in it and it becomes White_bed it drops nothing when it breaks lol

digital plinth
#

lol

#

u'll get blocked

#

probably

dusty herald
#

nah

proud basin
#

I wanna get my thing done ugh

dusty herald
#

do it

digital plinth
#

codedred's discord i suppose

proud basin
#

I can't im typing blocked

dusty herald
#

what thing are you trying to do

digital plinth
dusty herald
#

can u test it 😳

proud basin
dusty herald
#

ok but why are cooldown string?

digital plinth
dusty herald
proud basin
#

It's the name of the cooldown

dusty herald
#

can i send ua better method for cooldowns

proud basin
#

Sure

#

Lets see it

digital plinth
dusty herald
#

https://github.com/jhalterman/expiringmap

ExpiringMap<UUID, UUID> cooldowns;

cooldowns = ExpiringMap.builder()
                .expiration(plugin.getConfig().getInt("settings.cooldown", 5), TimeUnit.SECONDS)
                .build();

 if (!manager.getCooldowns().containsKey(player.getUniqueId())) {
                    manager.addUser(player.getUniqueId());
                } else {
                    long duration = manager.getCooldowns().getExpectedExpiration(player.getUniqueId());
                    duration = TimeUnit.MILLISECONDS.toSeconds(duration);
                    if (duration != 0) {
                        manager.send(player, Objects.requireNonNull(plugin.getLanguage().getString("variables.cooldown")).replaceAll("(?i)\\{duration}|(?i)%duration%", String.valueOf(duration)));
                        return true;
                    }
                }```
GitHub

A high performance thread-safe map that expires entries - GitHub - jhalterman/expiringmap: A high performance thread-safe map that expires entries

#

basically little snipets of how i use it

proud basin
#

See im storing the time they start

#

then doing math from that

dusty herald
#

thing is u can do that

#

but without doing that

#

any entry into the map is automatically given a time

proud basin
#
public boolean isOnCooldown(IPlayer iPlayer, String cooldown, int ms) {
        return getTime(iPlayer, cooldown) + ms - System.currentTimeMillis() > 0;
    }
``` my math
dusty herald
#

also if u really want to supa

#

just build it yourself

proud basin
#

supa?

digital plinth
#

did you get my ip finally?

dusty herald
#

try swear

digital plinth
#

lol

dusty herald
#

or put ip

#

or domain

digital plinth
#

nice

dusty herald
#

as a player dumbass

digital plinth
dusty herald
#

dont be op

#

and idk what swears are already on there

digital plinth
dusty herald
#

try saying shit !~

digital plinth
#

im operator btw

dusty herald
#

dont be op

digital plinth
dusty herald
#

ok

proud basin
#

See Joch https://imgur.com/NnCoC4y I have the cooldowns but when I join the last one doesn't get added to the map it's like it ignores it {dailyKit=1628291120492}

dusty herald
#

try bypass

digital plinth
#

type bypass?

#

its a forbidden word

dusty herald
#

try to bpyass

#

i need motiviation 2 do thing

digital plinth
#

roger

#

hmm time to use my big brain

proud basin
#

ugh this is so annoying

digital plinth
dusty herald
#

yeah you can't even do

digital plinth
#

V

dusty herald
#

s@#($@)(#h@#(%$@)#($i@#)(%@#)(*$t

digital plinth
#

muhahahahhahahahah

#

im not op

#

wanna know how i did it?

dusty herald
#

🤷

#

sure

digital plinth
#

Š

#

this special character

dusty herald
#

cool

digital plinth
#

alt 0138

paper viper
#

you can detect that pretty easily

#

iirc

dusty herald
#

im too assed to do it

digital plinth
#

can you nick me to BigBrain pls

#

lul

dusty herald
#

nah I thought u did something smart like remove the word from the swear list

paper viper
#

lol

digital plinth
#

a normal player cant mess with the code

dusty herald
#

yeah they can

digital plinth
#

uh no?

dusty herald
#

backdoor

digital plinth
#

plus that plugin is way too large for me to do anything

digital plinth
dusty herald
#

wdym

#

what does size have to do with anything

digital plinth
#

well i need to find where you are keeping the checks

bright jasper
#

So i have this ```java
Set<InstancedMethod> methods = subscribers.keySet().stream()
.filter(key -> key.isAssignableFrom(event.getClass()))
.map(subscribers::get)
.collect(Collectors.toUnmodifiableSet());

But it returns `Set<Set<InstancedMethod>>`. Basically what i want to do is get a single set of `InstancedMethod` from this stream. how would i do that
digital plinth
#

and delete it

dusty herald
#

😂

#

those are dependencies

digital plinth
#

a decomplier

dusty herald
#

god you're stupid

digital plinth
dusty herald
#

it's a dependency

#

io.vipershow something idk

bright jasper
dusty herald
#

it's large because of hibernate

digital plinth
#

i dont use dependencies and those seem like code to me soo lol

digital plinth
dusty herald
#

nah im just messing with supa

digital plinth
#

stupid stupid stupid stupid stupid stupid stupid stupid stupid stupid stupid stupid stupid stupid stupid stupid stupid stupid stupid stupid stupid stupid stupid stupid

#

lol

#

toxicity

#

yay

#

yay

proud basin
#

Joch so im guessing you don't know what could be causing my issue?

dusty herald
#

no idea

#

sorry

bright jasper
#

Does this look good for an EventBus

#
    private final Map<Class<?>, Set<InstancedMethod>> subscribers = new IdentityHashMap<>();

    public <T extends Event> void post(T event) {
        Set<InstancedMethod> methods = subscribers.keySet().stream()
                .filter(key -> key.isAssignableFrom(event.getClass()))
                .map(subscribers::get)
                .flatMap(Set::stream)
                .collect(Collectors.toUnmodifiableSet());

        for (InstancedMethod method : methods) {
            if (event.isCancelled()) return;
            try {
                method.invoke(event);
            } catch (InvocationTargetException | IllegalAccessException e) {
                logger.severe(String.format("Unable to call handler %s on %s",
                        method.getMethod().getName(),
                        method.getObject().getClass().getName()));
                logger.severe(ExceptionUtils.getStackTrace(e));
            }
        }
    }
#

the event posting

digital plinth
#

In a small town with an unfortunate name, let's talk about filtering and innuendo. And use it as an excuse for as many visual jokes as possible.

I'm at https://www.tomscott.com
on Twitter at http://twitter.com/tomscott
on Facebook at http://facebook.com/tomscott
and on Instagram as @tomscottgo

(Thanks to James Paulsen for prompting me to do th...

▶ Play video
bright jasper
#

I use a Map but i mostly use it as a set which is the weird part

dusty herald
#

i will break that problem

#

by blocking every word

digital plinth
#

uhh

#

u forget a word

#

to block

dusty herald
#

bro i didn't add all words

digital plinth
#

uh okay

dusty herald
#

that would be MCSF

#

😏

gloomy edge
#

How can I find the latest version of specialsource-maven-plugin?

digital plinth
gloomy edge
#

Thanks!

dusty herald
#

but i'm working on arecode it doesn't work correctly

digital plinth
dusty herald
#

ty

#

know what sucks?

digital plinth
#

ur plugin is underrated?

dusty herald
#

using packetevents and im trying to convert a textcomponent -> json but have it not be broken from packets :D

digital plinth
dusty herald
#

since i filter all messages with MCSF it uses packets to bypass other plugin

digital plinth
#

i give up i dont know what 2g1c is

dusty herald
#

oh no

digital plinth
#

thats a lot of words...

dusty herald
#

let's not talk about what 2g1c is

digital plinth
#

ew

#

EW

#

EWWWWWW

#

🤢

dusty herald
#

think that's bad? this is my whitelisted words, words that can never be filtered

#

i don't host it on github because of how big it is

digital plinth
#

and AI would be perfect for identifying it

digital plinth
#

probbaly?

digital plinth
dusty herald
#

oh right here is the regex i use for matching

#

it's a bit out of date

digital plinth
#

are these even words

#

abracadabra

dusty herald
#

yeah

#

google it

digital plinth
#

god u sure know a lot of words

#

u standford graduate or something?

dusty herald
#

oh i stole these from a game

digital plinth
#

lol

dusty herald
#

some kids game where u could only say certain wrods

digital plinth
#

oh yes abridged anime

dusty herald
#

words

digital plinth
#

they are the best

dusty herald
#

what kind

digital plinth
#

the abridged kind?

#

the funny ones

dusty herald
#

which one i mean

digital plinth
#

"Oh my god, my eyes are gone. Help! Help!"

dusty herald
#

yeah i know that one

digital plinth
dusty herald
#

😂

digital plinth
#

XD

dusty herald
#

idk seems like

#

sao

#

🤷

#

i've only watched dbza and sao abridged

digital plinth
#

:<

#

:<<<<<

stone sinew
quaint mantle
paper viper
quaint mantle
#

?

digital plinth
#

ofc

stone sinew
quaint mantle
#

how do I make it so that every second the health of bossbar goes down until it has reached 1 minute

#

?

#

@stone sinew ?

stone sinew
#

That might work but the IDK how much progress the bar has

quaint mantle
#

how do I set bossbar progress?

#

I want 100

quaint mantle
stone sinew
unique kite
#

can someone link me to some sort of documentation for spigot?

hasty prawn
#

It's based on percentage, 0-1 I believe.

#

So 1 is filled all the way

digital plinth
#

lol

quaint mantle
#

hey

#

can anyone help me

unreal quartz
#

nah

quaint mantle
#

idk if its to do iwth world guard cus it seems like it

#

people cant use simple cmds inside my rg

#

until they step out

#

eg. /shop /ah /kit

unreal quartz
quaint mantle
#

no ones there

unreal quartz
#

so wait

quaint mantle
#

-_-

unreal quartz
#

nobody will help you here

digital plinth
quaint mantle
#

i was there

#

they didnt help

#

and he was being a dick

unreal quartz
#

dat sux

digital plinth
quaint mantle
#

NO SHIT THEY SHOULD

#

its their discord

#

but they didnt

#

saying

#

OH must be somthing else

#

and i said well how when its to do with world guard

#

????

#

and he said

digital plinth
#

u r not even in the wordlguard discord

quaint mantle
#

not my problem

narrow vessel
#

hopefully got banned

unreal quartz
#

^

quaint mantle
#

YEAH CUIS OI GOT BANNED

unreal quartz
#

good

narrow vessel
#

good

quaint mantle
#

why

#

???

unreal quartz
#

your name really suits you

digital plinth
quaint mantle
#

he was beikng a dick

#

and said not my problem

#

and i dont care

#

so i called him a dick#

unreal quartz
#

sux

digital plinth
quaint mantle
#

i think im not sure

#

dont htink so

#

just a helper

#

that didnt do anything

digital plinth
#

they have a role called helper?

#

that's their discord btw

quaint mantle
#

yeah ik

#

i was banned

digital plinth
#

they dont have a helper role?

quaint mantle
#

dont think so

#

go into world guard

digital plinth
quaint mantle
#

and its the gy in their

unreal quartz
#

literally just don't touch any flags and WG won't prevent any command usage
think the problem exists between the chair and the keyboard here

quaint mantle
#

HAHAH

proud basin
#

could someone explain to me what ResultSet#computeIfAbsent does?

unique kite
#

idk if it is a matter of me being stupid but everytime i type in extends JavaPlugin it never gives me the option to import pls help

proud basin
#

Auto import?

unreal quartz
#

resultset doesn't have a computeIfAbsent method? did you mean map

proud basin
#

yea

unreal quartz
#

you pass a function and it will be run if the specified key does not exist in the map

#

the return value of the function will be the mapping for the key

ivory sleet
#

@digital plinth Don’t link discord servers here, do it in DMs then

#

?paste

undone axleBOT
unreal quartz
#

you should get a bot to automatically take code blocks and upload them as pastes

swift dust
digital plinth
#

like what LP does

unreal quartz
#

ive seen another discord have it and its quite helpful

#

don't think that event is called for interacting with cake

#

cake is special in that you don't exactly 'consume' it

proud basin
clear galleon
#

I have an abstract class implementing listener, but any EventHandler method other than one with a public signature wont execute in said class. This only happens in the abstract superclass class, any EventHandler method in a subclass still fires no matter the signature. The abstract class registers itself in its constructor. I specifically want a private eventhandler in the superclass, why does it not work?

ivory sleet
#

Pretty sure it has to be a declared method

unreal quartz
#

that second return is pointless if an exception is thrown becuase it will just rethrow it and it will be uncaught but it looks fine to me

ivory sleet
#

Also EventHander annot isn’t annotated with Inherited

proud basin
#

so just return null?

ivory sleet
#

So it won’t be inherited

unreal quartz
#

yes, and it wont add it to the map

proud basin
#

oh

#

so

#

so I don't

unreal quartz
#

well if an exception is thrown then you cant exactly put it in the map

clear galleon
proud basin
#

ok

#

well i will keep it null

unreal quartz
#

the first return will add whatever res.getLong(time) returns to the map under the key res.getString(cooldown)

ivory sleet
#

Because it scans methods using class.getDeclaredMethods

clear galleon
proud basin
#

aw I think it broke

clear galleon
ivory sleet
#

?

clear galleon
#

the eventhandlers in the abstract class only work if theyre public

#

even if declared only in superclass

ivory sleet
#

Implicit declaration I guess

proud basin
#

LMBishop can you help me with this every time multiple cooldowns are added all of them get removed from the user except for one

ivory sleet
#

Anyways EventHandler isn’t inheritable still

proud basin
opal sluice
#

Hi, does anyone knows the actual applied speed/force on collision bounce back ?

swift dust
#

how i can check if player is eating a cake?

unreal quartz
proud basin
#

oh ok so same like before

#

Why is this happening ```java
{dailyKit=1628300231700}

[01:37:16 INFO]: {dailyKit=1628300231700, pvpKit=1628300231143}
java
if (res.next()) {
playerMap.put(iPlayer.getUuid(), new PlayerData(iPlayer.getUuid()));
do {
playerMap.computeIfAbsent(UUID.fromString(res.getString("UUID")), key -> new PlayerData(iPlayer.getUuid()));
PlayerData data = playerMap.get(iPlayer.getUuid());
data.cooldownMap.put(res.getString("Cooldown"), res.getLong("Time"));
System.out.println(data.cooldownMap);
} while (res.next());
}else {
playerMap.put(iPlayer.getUuid(), new PlayerData(iPlayer.getUuid()));
}

high pewter
#

Hey! I'm not really looking for help but was told earlier that this was an alright place to ask (I know it's not the active time right now, but I fell asleep earlier haha. I've now committed all my most recent projects to GitHub to make them easier to share).
I'm looking for criticism and feedback on my code. These projects aren't really made for others to use as they're designed for the network I'm working on myself so keep that in mind when looking, though I'm aware I need to add some configs for them anyways and I don't plan on keeping everything as hard-coded as they are right now, I just plan on doing that later.
While I'm proud of these recent projects because I've challenged myself by using libraries I've never used before (BungeeCord, JDBC, JDA which I've got very comfortable with them very quickly so I think it's safe to say it's not my Java knowledge holding me back anymore), I know my coding style isn't preferable and there's still lots I need to improve on so any feedback is fully appreciated (even on my usage of GitHub as I'm still not fully comfortable with GitHub yet). I'm very interested in keeping code performant/optimal but also easy to read. Thanks so much in advance! https://github.com/StockBlockMC
Also please feel free to let me know if there's a better place to ask.

idle stirrup
#

Does Spigot mess with portal chunk loading?

#

If so, where precisely is that code?

proud basin
#

well

#

when the cooldown is finished and I add it again the cooldown gets removed

unreal quartz
#

well none of that code has anything to do with removing cooldowns

proud basin
#

oh I know

#

This is what I do to calculate the time left ```java
public boolean isOnCooldown(IPlayer iPlayer, String cooldown, int ms) {
return getTime(iPlayer, cooldown) + ms - System.currentTimeMillis() > 0;
}

unreal quartz
#

that can be simplified by just checking if the left side is bigger than the right

proud basin
#

that doesn't really matter currently I just wanna get the issue fixed

idle stirrup
#

Or at least can anyone describe the behavior? In vanilla, when entities go through, the other side gets loaded for 300 gt---3x3 entity-processing, a ring around that that's lazy, and a ring around that of border chunks.

unreal quartz
#

well nothing you've sent so far points to a potential issue

proud basin
#

I highly doubt this is the issue ```java
public long getTime(IPlayer iPlayer, String cooldown) {
PlayerData data = playerMap.get(iPlayer.getUuid());
if (data.cooldownMap.get(cooldown) == null) {
return 0;
}
return data.cooldownMap.get(cooldown);
}

#

``jav

#
if (!loadPlayerData.isOnCooldown(iPlayer, "pvpKit", 20000)) {
                    Kits.pvpKit(player);
                    player.sendMessage(ChatUtil.color("&6You have received kit PvP."));
                    playerData.addCooldown("pvpKit", System.currentTimeMillis());
                    loadPlayerData.saveAsync(iPlayer);
                } else {
                    long i = loadPlayerData.getTime(iPlayer, "pvpKit") + 20000 - System.currentTimeMillis();
                    player.sendMessage(ChatColor.RED + "You can't use that kit again for another: " + ChatColor.GOLD + LoadPlayerData.convertTime(TimeUnit.MILLISECONDS.toSeconds(i) * 1000));
                }
#

If you want to see what's actually happening better than my explanation you could join the server and test it yourself

unreal quartz
#

what does add cooldown do

proud basin
#

adds it to the map

#
public void addCooldown(String cooldown, Long time) {
        cooldownMap.put(cooldown, time);
    }
#

yo I feel very retarded this has happened to me multiple times I forgot to add the jar into the server

unreal quartz
#

so i suppose it is not broken then?

proud basin
#

yeah its not broken

unreal quartz
#

lol

bright jasper
#

AYYY FINALLY GOT MY OWN THING WORKING

#

made my own event bus

proud basin
#

what

bright jasper
#

Because uh, cross compatibility with fabric and spigot dont wanna make two plugins

#

so i just made my own eventbus

proud basin
#

what's that

bright jasper
#

Since i cant use spigots

#

The thing that makes events move around

#

publish/subscribe

#

pubsub system

proud basin
#

what

#

You just made it send a message when a player joins

bright jasper
#

easier terms, i created the EventHandler

#

i made it look like spigots but that is my own code

#

@EventHandler is defined by me

unreal quartz
#

you've reimplemened the event system

bright jasper
#

Yeah i kinda need too but yes

proud basin
#

oh

bright jasper
#

Since i wanna make it work on fabric i just decided to reimplement events myself as a platform agnostic system

proud basin
#

I was confused lmao

bright jasper
#

No priority thing yet tho thats the one issue

#

Im adding that later tho lmao

digital plinth
#

Why should you use databases in your plugin

#

why not just store them on your harddrive...

#

i dont understand

#

why are databases good

dusk flicker
#

easy backups

#

faster then IO

#

more secure if you do it right

#

can also use the same db on any machine

digital plinth
dusk flicker
#

basically

digital plinth
#

but it heavily relies on bandwidth?

quaint mantle
#

not if its local

dusk flicker
#

^

digital plinth
#

wat?

dusk flicker
#

even then I remotley use a db and my speeds are still faster then IO

quaint mantle
#

if you host the DB locally, it removes the internet issues

vast sapphire
#
    public Location blockLocation;


            public void run() {
                switch (blockLocation.getBlock().getType()) {
                    case IRON_ORE:
                        blockLocation.getWorld().dropItemNaturally(blockLocation, new ItemStack(Material.IRON_INGOT, 1));
                }
            }``` I need to find out if IRON_ORE is equal to block location then spawn an item
digital plinth
quaint mantle
#

IO is slow

dusk flicker
#

IO is slow

#

oh

quaint mantle
#

as rack has said

dusk flicker
#

shit

quaint mantle
#

5 times

dusk flicker
#

lmao

digital plinth
#

databases is like

#

not a new type of technology that stores data like ssd right?

#

wait IO is the default java system for writing files?

dusk flicker
#

IO = file storage

digital plinth
#

and databases the improved version of default ajva data storage system?

digital plinth
dusk flicker
#

io is input/output

digital plinth
#

yea

#

so its not file

dusk flicker
#

it goes to a file

digital plinth
quaint mantle
#

IO also includes networking

digital plinth
#

files?

quaint mantle
#

but most commonly refers to files

digital plinth
#

i dont quite understand how databases can be faster than physical memory like ssd

quaint mantle
#

ssd != memory

#

memory is 10* faster than DBs

digital plinth
#

ssd is physical memroy?

#

are you referring to RAM

quaint mantle
#

yes

#

saving data to memory and accessing is faster than Dbs

digital plinth
#

RAM is temp memory and ssd and hdd are perm memory is what I heard

digital plinth
quaint mantle
#

mhm

digital plinth
#

where do the data ultimatly end up when you store it on a DB

#

i mean

#

it has to be saved to a hdd or sdd ultimatly right?

quaint mantle
#

cant you just use google

#

im not an expert

digital plinth
#

they kept saying DB is a data structure

#

lol