#help-development

1 messages · Page 2297 of 1

willow widget
#

I mean I know it existed but I kinda feel like it had a diff name for some reason

#

idk what's that tbh lol

drowsy helm
#

thats not gonna cause a npe

lunar mica
#

Its string.. Im only getting player name

lunar mica
drowsy helm
#

just chuck it in a pastebin

#

doesnt really say

#

either Main.Database is null or e.getWhoClicked()

#

btw Main.Database is incorrect naming conventions

#

assuming that line is GUI:512 right?

#

so it must be Main.Database is null

#

or something in the prepareStatement is throwing

lunar mica
willow widget
#

just tried

        String aux = "";
        for(int i=0;i<str.split("\n").length; i++) {
            aux += str.split("\n")[i];
            if(i < str.split("\n").length) aux += "\n";
        }
        return aux;

And got the same outcome 😦

#

idk why it doesn't want to do the line break lol

#

I feel like it has something to do with the string, maybe I can't use the color code and line break at the same time (?)

drowsy helm
#

linebreak doesnt work for chat

willow widget
#

it does

lunar mica
willow widget
#

doing sender.sendmessage("one line \nanother line") works

willow widget
willow widget
#

I don't understand why it didnt work just with the \n directly lol

#

thanks (:

lunar mica
#

idk.. 😄 np

buoyant viper
#

how old we talkin? i remember this behaviour since at least 7 or 8

carmine nacelle
#

If I have a custom entity and set it to persistent, will it stay loaded even with nobody in the chunk with it?

quiet ice
ivory sleet
#

Doesnt jit optimize it?

quiet ice
#

Since it only append chances are it goes smart about it

quiet ice
ivory sleet
#

Hmm maybe Im thinking about a general jvm optimization of string concats then

quaint mantle
#

I need Vein miner for 1.19 and I can’t find it

small current
#

what will the arraylocation do

quiet ice
#

Just use the latest build and you are fineee

eternal oxide
small current
#

thanks

#

now i will go and cry about the fact that i understood nothing from the math

wind dune
#

Does anyone know if the ProxyServer.getPlayer(UUID) can return null?

small current
#

if a player with that uuid does not exist (not online)

wind dune
#

ok thanks

quiet ice
#

Check the nullabillity annotations

eternal oxide
#

Thats an excellent tutorial

#

Best I've seen

quaint mantle
#

Please help me 🙂

small current
#

what are these LEGACY materials in spigot ?

eternal oxide
#

pre 1.13

dim palm
#

how can i send a updating message 15 times without doing 15 runTaskLater

eternal oxide
#

15 times over a period?

dim palm
eternal oxide
#

You use RunTaskTimer so it repeats

small current
eternal oxide
#

keep count in teh task of how many times it has repeated

#

then this.cancel() when finished

dim palm
#

and how can i make the updating message

eternal oxide
#

Legaacy materials are used when you forget to put a valid API version in your plugin.yml

small current
#

so is there anyway so i can support multi version material support without XMaterial ?

eternal oxide
#

Probably, but I've never tried

quiet ice
hushed spindle
#

does anyone know how i can simulate killing an entity with a looting weapon?

#

or alternatively how i can make it so LivingEntity#attack() always attacks with a full "attack cooldown"

small current
#

guys will 8000 objects with a string and a byte in it in a set cause any problem ?

hushed spindle
#

depends how you use it

#

the set on its own no

small current
#

like get from it

#

everytime somone does a certain command

ivory sleet
#

get from it?

#

Is it a map? Or like whats the structure

hushed spindle
#

if you're trying to do something like storing a bunch of byte values under a string id why arent you using a map

small current
#

two byte values might be needed

#

Set<MyObject>

#

MyObject

byte anotherThing;
byte moreThings;

somemethods

#

and maybe call the methods on the command

#

maybe i could just

#

Map<String, MyObject>

#

yeah

#

will map cause any problem ?

ivory sleet
#

Are you adding to the set in the command

#

Or just using contains() on it?

#

A HashSet uses a HashMap anyway fyi

hardy swan
small current
#

and then i get

ivory sleet
#

With a Set??

vast junco
#

I'm trying to change the effectiveness of the respiration enchantment with a plugin. I found the code in nms that handles respiration (m() which is actually getNextAirUnderwater inside EntityLiving), although I can't figure out a way to bypass it/change it. Is it possible to change this method during runtime, or do I need to use a different approach

small current
ivory sleet
#

Yeah should be fine using remove, put and containsKey

rough drift
#

I wanted to publish my plugin (basically a LIB) to maven central so that I don't need to shade it in, however they discourage using <repositories>, is it fine even if I just publish?

<repositories>
    <repository>
        <id>spigotmc-repo</id>
        <url>https://hub.spigotmc.org/nexus/content/repositories/snapshots/</url>
    </repository>
    <repository>
        <id>sonatype</id>
        <url>https://oss.sonatype.org/content/groups/public/</url>
    </repository>
    <repository>
        <id>placeholderapi</id>
        <url>https://repo.extendedclip.com/content/repositories/placeholderapi/</url>
    </repository>
</repositories>

<dependencies>
    <dependency>
        <groupId>org.spigotmc</groupId>
        <artifactId>spigot-api</artifactId>
        <version>1.17.1-R0.1-SNAPSHOT</version>
        <scope>provided</scope>
    </dependency>
    <dependency>
        <groupId>me.clip</groupId>
        <artifactId>placeholderapi</artifactId>
        <version>2.11.2</version>
        <scope>provided</scope>
    </dependency>
</dependencies>
```This is my repositories/dependencies
ivory sleet
#

Assuming the underlying hashCode implementation isnt shit

rough drift
ivory sleet
#

remove rather than containsKey?

#

Do you mean get() + null check instead of containsKey?

rough drift
#

well I mean remove if remove will later be called

#

so like

ivory sleet
#

Hmm yes but contains doesnt remove

#

Else sure if you’re gonna remove something use remove 👍

rough drift
#
if (map.containsKey(key)) {
  Object value = map.get(key);
  map.remove(key);
}

can be simplified to

Object value = map.remove(key);
if (value != null) {
  // do stuff
}
quaint mantle
rough drift
#

1 call vs 3

ivory sleet
quaint mantle
#

how not?

ivory sleet
#

In a multithreaded scenario they might yield different results

quaint mantle
ivory sleet
#

Additionally, the contains check is redundant

#

and using != null in the latter example wouldnt tell you if the value was null

#

Altho adopting null in data structures is a sin

quaint mantle
#

Yes i like the idea of Map<K, Optional<V>>

#

much more reliable

ivory sleet
#

Indeed

hardy swan
#

What scenario for the need of nullable

ivory sleet
#

ConcurrentHashMap uses it iirc for some internal atomic reasons

#

but else its pretty much always discouraged

#

Or do you mean the Optional?

hardy swan
hardy swan
#

Why did I say nullable

ivory sleet
#

Probably if you wanna more expressive in terms of absence of values

#

Rather than using null

vast junco
quaint mantle
# hardy swan Why did I say nullable
Map<Customer, PaymentMethod> map;
PaymentMethod method = map.get(customer);

if (method == null) {
    // Well the payment method is null, but does the map at least have this customer registered?
    // This results in one extra check, map#contains().
}
Map<Customer, Optional<PaymentMethod>> map;
Optional<PaymentMethod> methodOptional = map.get(customer);

if (methodOptional == null) {
    customer.send("You are not registered to our program!");
    return;
}

if (!methodOptional.isPresent()) {
    customer.send("You have not created a payment method!");
    customer.send("Defaulting to VISA...");
}

PaymentMethod method = methodOptional.orElse(PaymentMethod.VISA);
// ... //
hardy swan
quaint mantle
#

how so

ivory sleet
#

Well, null is a sin I think thats where Imajin is getting at mostly

#

It is hideous because null inherently cannot be expressed in type level

quiet ice
#

There is Void for that more or less

quaint mantle
#

Whut

ivory sleet
#

Void is an inflexible option Id say

quiet ice
#

But that is a Hacky workaround

quaint mantle
#

How is dat relevant

rough drift
quaint mantle
#

you wouldnt store Void in a map

rough drift
#

kt is a good start, it is null-safe

ivory sleet
#

You dont have absence and presence derivatives of an optional type with Void for instance, not that Optional actually has that either but whatever

quaint mantle
ivory sleet
#

yes but kotlin doesnt have null the same way java has it

#

Kotlin expresses null in types

rough drift
rough drift
ivory sleet
#

With presence and absence derivatives of nullable types

hardy swan
rough drift
#

bast con rust

#

(play on words, sounds like "stop, stop with rust")

ivory sleet
#

Kotlin essentially uses java Optional, just has syntactic suger for it in some aspects

rough drift
#

that's the good way

ivory sleet
#

Yes

quiet ice
ivory sleet
#

but usually when point at null/nil we mean the value

#

Which often ends up trolling us

#

Kotlin got it figured out tho :>

#

As well as some other cool languages, not Java tho

hardy swan
rough drift
#

java is a base, and other languages just build on top of it

hardy swan
#

I know js has that

rough drift
#

js has null, undefined, [], {}, NaN etc

rough drift
ivory sleet
#

Well no one was able to predict that the representation of absence in a language at value level was gonna lead to deplorable frustration

quiet ice
#

NaN is a floating Point standard

rough drift
#

yes

#

but you get the point

#

JS has 15 ways to say something doesn't exist

#

including void

hardy swan
quiet ice
#

Half of those actually mean something else

earnest forum
#

[] {} have values no?

ivory sleet
#

JavaScript is messy and will probably stay messy due to retro compat

hardy swan
rough drift
earnest forum
#

empty array

ivory sleet
#

Altho it has introduced better features in newer versions

noble lantern
#

if (typeof variable === 'string') {

}

#

all i gotta say

earnest forum
#

it doesnt have a "value" but its also not null

#

its empty

rough drift
#

it's shrodinger's variable

ivory sleet
#

I mean it is a value effectively but doesnt contain any values shrug

earnest forum
#

yea

hardy swan
#

Then js tried to have these values to be falsy

rough drift
#

(!+[]+[]+[]).length is 9

#

just saying

ivory sleet
#

Baffling

noble lantern
#

wtf

tender shard
#

FFS 80% of stacktraces people send me is because they disable AE at runtime and then wonder why AngelChest throws exceptions...

ivory sleet
#

Stupid people

ivory sleet
#

They have stupid brain

rough drift
#

oh

rough drift
#

just check for it always

#

ez

tender shard
rough drift
#

bro it's an if statement

hardy swan
noble lantern
#

i hope thats sarcasm

ivory sleet
#

I mean you could tell them in the console

tender shard
#

If they wanna disable a plugin, they should restart the server and remove it properly

hardy swan
#

Users always prefer a more direct info/steps to follow

ivory sleet
#

LOGGER.error("You dumdum dont use plugman and dont just yeet plugins, now this plugin wont work >:(") or sth

noble lantern
#

if i take the carberator out of my car while its running what do ppl expect it to do to the other components of the car

#

like what do u expect

rough drift
#
boolean isAdvancedEnchantsInstalled;

if (isAdvancedEnchantsInstalled = (Bukkit.getPluginManager().getPlugin("AdvancedEnchantments") != null)) {
    // do stuff
}
tender shard
rough drift
#

there

#

you can add the thing before it

noble lantern
#

make the insult very mean

hardy swan
#

Ok then it is not your fault nor the users fault

noble lantern
#

"Stupid dumbass quit disabling plugins at runtime"

tender shard
rough drift
#

bro worsen perf?

#

how hard of a perf hit can a single getPlugin give

ivory sleet
#

Yeah collective punishment 💀

#

Hmm good questionb

#

Its basically a map lookup

rough drift
#

actually, just run that check only if plugman is installed

#

since plugman can't really disable itself

noble lantern
#

or

ivory sleet
#

Wait cant it?

rough drift
#

it can't

ivory sleet
#

Lol

rough drift
#

it blocks you

hardy swan
#

Insult realEntity303

noble lantern
#

if (plugMan.isInstlalled()) disablePlugin()

tender shard
#

it would have to check this for every inventory slot on every death. So yeah, not very often but still, I don't see a reason to do this. People cannot expect to just e.g. disable WorldEdit and then expect all plugins to check "is this plugin STILL installed?" everytime

rough drift
#

"[PlugMan] this plugin cannot be disabled" or smt

tender shard
#

If a plugin is enabled on startup, it should keep stay enabled until shutdown

tender shard
#

if not, the admin is stupid

rough drift
#

just run the every time check if plugman is installed

#

otherwise don't

#

punishment only for plugman users

tender shard
#

and PlugWoman

#

and ServerUtils

rough drift
#

wait

noble lantern
#

wait

rough drift
#

PlugWoman exists

noble lantern
#

^^?

tender shard
#

yes

noble lantern
#

wtf

hardy swan
#

Wtf

rough drift
tender shard
#

it's Redempt's version of Plugman

#

and ServerUtils is from... erm

noble lantern
#

bahahahaa

tender shard
#

idr

ivory sleet
#

Its better because it does a recursive reload at least

tender shard
#

plugman doesn't?

hardy swan
#

We gonna meme spigot plugins now eh

ivory sleet
#

Dont think so

tender shard
#

PlugTrans when

#

wait that sounds wrong

noble lantern
#

on it

ivory sleet
#

At least I experienced a wholesome classloader fucketry with it

noble lantern
#

PlugNeutral

#

PlugBoy (femboy)

tender shard
#

fun fact - don't google "plug woman" and then click on "images"

noble lantern
#

bet

ivory sleet
#

💀

noble lantern
#

haha

hardy swan
#

What does it show

noble lantern
#

nice

hardy swan
#

Women or plug

tender shard
rough drift
#

too many ppl around

tender shard
noble lantern
tender shard
#

lol

noble lantern
#

??

#

contradicting genders there

rough drift
#

imma need some strong ones for this

noble lantern
#

BRO

#

THEY HAVE A SPYGLASS ONE

tender shard
#

wtf

rough drift
#

I'll just

noble lantern
#

it opens up like a inch

rough drift
#

commit oof

noble lantern
#

its called a peeking plug

#

it has a stopper to

tender shard
#

to what

noble lantern
#

too*

#

sry

tender shard
#

ooh

#

DM me link lol

hardy swan
#

help-development

tender shard
#

trivia

young knoll
#

Excuse me what the fuck

reef lagoon
#

how do I use libraries

grim ice
ivory sleet
#

Which ones? The ones that are plugins or the ones that are not plugins?

reef lagoon
#

jda

grim ice
reef lagoon
#

cause my plugin is 17mb

ivory sleet
#

They offer apis then probably, but hopefully an api is offered regardless

tardy delta
#

They have An API just add it as dependency

ivory sleet
#

wihy if its jda you might wanna shade it

tardy delta
#

What's the Point of shading again?

#

Smh tyoing on phone is aids

ivory sleet
#

To make sure a class is present when you need it

#

Assuming no one else provides it to the jvm

grim ice
#

lol

tardy delta
#

Hmm right

grim ice
#

and i dont think the server owner will have it in their server

ivory sleet
grim ice
#

Oh righy

ivory sleet
#

You’d get a NoClassDefFoundError

grim ice
#

ClassDefNotFoundException

#

Oh shit right

ivory sleet
#

But pretty much identical ye

reef lagoon
ivory sleet
#

Shading means that you include the classes of the library in your own jar

grim ice
#

classnotfoundexception isnt only for reflection tho

ivory sleet
#

Pretty much is?

#

I believe thats the Class::forName exception specifically or sth

reef lagoon
ivory sleet
ivory sleet
grim ice
#

its as of version 1.4 i believe

ivory sleet
#

Those that are needed at compile time. That is when you write the code in your ide, and then those at runtime which is that the classes you’re using during when the server is running

#

As some jar must provide the classes so the jvm knows how everything works

#

Normally you set the scope to provided for lets say placeholder api or spigot api

#

But thats because other jars are including them (as the classes of spigot and placeholderapi) at runtime

reef lagoon
#

so that's what it means?

ivory sleet
#

Yes it means you are only depending on the dependency at compile time, merely to make the classes visible in your ide

reef lagoon
#

If I wanted to make my plugin weight less, how would I go about doing so?

ivory sleet
#

But the classes of the dependency wont be included in your jar because some other jar will probably include them and load them in

#

You could add jda as a library in your plugin yml I believe?

reef lagoon
#

Yes that's what I was asking in the first place

#

I tried but it didn't seem to work

#

do I add a library and remove the dependency?

#

how does it work

ivory sleet
#

You have the dependency set to scope provided

#

In your pom xml

#

And then you add it under libraries in plugin.yml

reef lagoon
#

alright thanks

#

I'll try it

ivory sleet
#

As such

reef lagoon
#

nvm added a space lol

ivory sleet
#

Nice

reef lagoon
#

ayyy lets go

#

thanks

ivory sleet
#

Test if it actually works :>

reef lagoon
#

alr

#

def looks like it xd

#

Yeah it works

ivory sleet
chrome beacon
#

Keep in mind that will only work on modern versions

reef lagoon
#

My server is 1.17 - 1.19 so it's fine I think

chrome beacon
#

Yeah that's fine

bright tulip
#

ppl help me

eternal oxide
#

you broke the config

#

spigot.yml

bright tulip
eternal oxide
#

unbreak it?

#

fix whatever you edited to break it

bright tulip
# eternal oxide unbreak it?

settings:
debug: false
sample-count: 12
bungeecord: false
player-shuffle: 0
user-cache-size: 1000
save-user-cache-on-stop-only: false
moved-wrongly-threshold: 0.0625
moved-too-quickly-multiplier: 10.0
timeout-time: 60
restart-on-crash: true
restart-script: ./start.sh
netty-threads: 4
attribute:
maxHealth:
max: 2048.0
movementSpeed:
max: 2048.0
attackDamage:
max: 2048.0
log-villager-deaths: true
log-named-deaths: true
messages:
whitelist: &4&l Server under mantainance! Please come back on july 25th 16PM CEST!
unknown-command: Unknown command. Type "/help" for help.
server-full: The server is full!
outdated-client: Outdated client! Please use {0}
outdated-server: Outdated server! I'm still on {0}
restart: Server is restarting
advancements:
disable-saving: false
disabled:

  • minecraft:story/disabled
    players:
    disable-saving: false
    commands:
    spam-exclusions:
  • /skill
    silent-commandblock-console: false
    replace-commands:
  • setblock
  • summon
  • testforblock
  • tellraw
    log: true
    tab-complete: 0
    send-namespaced: true
    world-settings:
    default:
    hopper-can-load-chunks: false
    below-zero-generation-in-existing-chunks: true
    verbose: false
    entity-activation-range:
    animals: 40
    monsters: 60
    raiders: 70
    misc: 15
    water: 16
    villagers: 45
    flying-monsters: 24
    wake-up-inactive:
    animals-max-per-tick: 4
    animals-every: 1200
    animals-for: 100
    monsters-max-per-tick: 8
    monsters-every: 400
    monsters-for: 100
    villagers-max-per-tick: 4
    villagers-every: 600
    villagers-for: 100
    flying-monsters-max-per-tick: 8
    flying-monsters-every: 200
    flying-monsters-for: 100
    villagers-work-immunity-after: 100
    villagers-work-immunity-for: 20
    villagers-active-for-panic: true
    tick-inactive-villagers: false
    ignore-spectators: false
    entity-tracking-range:
    players: 48
    animals: 48
    monsters: 48
    misc: 32
    other: 64
    ticks-per:
    hopper-transfer: 8
    hopper-check: 1
    hopper-amount: 1
    dragon-death-sound-radius: 0
    seed-village: 10387312
    seed-desert: 14357617
    seed-igloo: 14357618
    seed-jungle: 14357619
    seed-swamp: 14357620
    seed-monument: 10387313
    seed-shipwreck: 165745295
    seed-ocean: 14357621
    seed-outpost: 165745296
    seed-endcity: 10387313
    seed-slime: 987234911
    seed-nether: 30084232
    seed-mansion: 10387319
    seed-fossil: 14357921
    seed-portal: 34222645
    seed-stronghold: default
    hunger:
    jump-walk-exhaustion: 0.05
    jump-sprint-exhaustion: 0.2
    combat-exhaustion: 0.1
    regen-exhaustion: 6.0
    swim-multiplier: 0.01
    sprint-multiplier: 0.1
    other-multiplier: 0.0
    max-tnt-per-tick: 100
    max-tick-time:
    tile: 50
    entity: 50
    growth:
    cactus-modifier: 100
    cane-modifier: 100
    melon-modifier: 100
    mushroom-modifier: 100
    pumpkin-modifier: 100
    sapling-modifier: 100
    beetroot-modifier: 100
    carrot-modifier: 100
    potato-modifier: 100
    wheat-modifier: 100
    netherwart-modifier: 100
    vine-modifier: 100
    cocoa-modifier: 100
    bamboo-modifier: 100
    sweetberry-modifier: 100
    kelp-modifier: 100
    twistingvines-modifier: 100
    weepingvines-modifier: 100
    cavevines-modifier: 100
    glowberry-modifier: 100
    merge-radius:
    exp: 6.0
    item: 4.0
#

item-despawn-rate: 6000
view-distance: default
simulation-distance: default
thunder-chance: 100000
enable-zombie-pigmen-portal-spawns: true
wither-spawn-sound-radius: 0
arrow-despawn-rate: 300
trident-despawn-rate: 1200
hanging-tick-frequency: 100
zombie-aggressive-towards-villager: true
nerf-spawner-mobs: false
mob-spawn-range: 6
end-portal-sound-radius: 0
worldeditregentempworld:
verbose: false
config-version: 12
stats:
disable-saving: false
forced-stats: {}

bright tulip
#

help

#

i sent

#

@eternal oxide how do i dix it

chrome beacon
#

Use paste

#

?paste

undone axleBOT
chrome beacon
#

Also don't put "" in the middle of your message

eternal oxide
#

you only have a single space indent on each of the messages: entries. yaml requires multiple of 2

chrome beacon
#

And have patience

chrome beacon
#
  • use the right channel
bright tulip
#

help me

#

wich channel

eternal oxide
#

You have single space indenting on the whole file

bright tulip
chrome beacon
eternal oxide
#
  whitelist: &4&l Server under mantainance! Please come back on july 25th 16PM CEST!```This is indented by a single space
chrome beacon
eternal oxide
#

|I think

bright tulip
#

now what

eternal oxide
#

perhaps not, Discord formatting

eternal oxide
#

use paste for a start

eternal oxide
#

This channel is for teh development of plugins

bright tulip
#

mhm

#

what now

tender shard
#

install IntelliJ (or eclipse if you're into BDSM, or Netbeans if you're from kangaroo country) and start coding, then you're in the correct channel

eternal oxide
#

I like me a little leather

hoary perch
#

EntityPlayer npc = new EntityPlayer(nmsServer, nmsWorld, gameProfile, new PlayerInteractManager(nmsWorld)); at the PlayerInteractManager you must use EntityPlayer. A few years ago this was not like this. Does someone know how to do this now?

tender shard
#

EntityPlayer? Are you still on 1.16 or older?

hoary perch
#

1.19

#

nms

tender shard
#

It's called ServerPlayer in mojang mappings

hoary perch
#

okay

lean monolith
#

Is there a way to fix corrupted plugins?

hoary perch
hoary perch
#

I am using gradle and have installed buildtools

tender shard
#

pretty sure that gradle should also be able to remap

#

if you use mojang mappings, everything will be so much easier

hoary perch
#

ima check the link out

tender shard
#

and you dont need to adjust your code for every new version

tender shard
hoary perch
#

i guess you can use every maven stuff in gradle

tender shard
#

naaah

#

well

lean monolith
#

Does anyone know if there a way to fix corrupted plugins?

hoary perch
#

you just need to translate it ig

tender shard
#

there definitely is a gradle plugin that does the same thing but no idea whats it called. for maven it's the "specialsource" plugin

eternal oxide
tender shard
#

someone add this to my todo list pls lol

#

I forgot my password

eternal oxide
#

lol

tender shard
#

on my server I just ping @Todo and then someone else adds stuff dd 😄

hoary perch
#

so is there any way for gradle @tender shard ?

tender shard
#

I don't know

#

I never voluntarily used gradle so I don't know much about it

#

well

#

I am sure that gradle has sth like the "maven-exec-plugin"

#

so you can just run nthe special source jar manually

#

1 sec

#

?remapping

#

?1.17

undone axleBOT
tender shard
#

erm

#

nah where is the fucking announcement

eternal oxide
#

Spigot is Maven. Paper is Gradle. I believe they have somethign called Paperweight for mapping

tender shard
eternal oxide
#

Never used it and no idea how though. Also Paper is a fork so not much support for it in here

tender shard
eternal oxide
#

If using Spigot and NMS its probably best to stick with Maven

tender shard
fiery prairie
#
    private HashMap<UUID, Long> cooldown = new HashMap<>();
    public void onAsyncPlayerChatEvent(AsyncPlayerChatEvent e){
        Player p = e.getPlayer();

        if (!cooldown.containsKey(p.getUniqueId())) {
            cooldown.put(p.getUniqueId(), System.currentTimeMillis());
            return;
        }

        long timeElapsed = System.currentTimeMillis() - cooldown.get(p.getUniqueId());

        if (timeElapsed >= getConfig().getInt("chat-cooldown")) {
            cooldown.put(p.getUniqueId(), System.currentTimeMillis());
            return;
        }

        int remaining = getConfig().getInt("chat-cooldown");

        e.setCancelled(true);
        p.sendMessage(Long.toString(timeElapsed));
        Utils.color(getConfig().getString("chat-cooldown-reached").replace("%seconds%", String.valueOf(Math.round(remaining/1000))));
    }```

any idea why i can still spam on chat?
hoary perch
tardy delta
#

Another one that uses the cooldown tutorial

tender shard
tender shard
fiery prairie
tardy delta
#

Not really

tender shard
buoyant viper
tardy delta
#

Wrote one too

#

What's the Long even?

eternal oxide
fiery prairie
#

3000

tender shard
#

why are you returning if the map doesn't contain the UUID yet?

tardy delta
#

Not using TimeUnit :(

buoyant viper
tender shard
#

also your cooldown thing should be a separate class / object

tardy delta
#

Ah the time they can chat again

buoyant viper
#

oh wait

#

add @fresh templetHandler to ur method

tender shard
#

lol right

tardy delta
#

Im sorry just awake and it's 12 am smh

tender shard
#

the whole listener doesn't run lmao

buoyant viper
#

why the fuck did discord think yeah let me edit that to add a ping

#

fuck this stupid ass platform

fiery prairie
#

ohhhh yeah thanks xD!

tardy delta
#

@NotNull

#

Oh

#

@Nullable

#

Dude gone

quiet hearth
#
public class Ender {

    private static Main main;
    public static void setup(Main Main){
        main = Main;
    }

    public static void teleport(Entity e){

    }

}
``` is this kind of class ok?
eternal oxide
#

probably changed name as he got so many pingsd

tardy delta
#

No

buoyant viper
tardy delta
#

?di

undone axleBOT
tardy delta
#

I smell static abuse

fiery prairie
#

ye

tender shard
#

I pinged him there all the time until I switched to javax annotations

tardy delta
#

Oh right on chocos gh thing

tender shard
#

Nonnull

noble lantern
#

@EventHandler

noble lantern
#

Oh it doesn't do it on mobile

fiery prairie
tender shard
#

@fresh templethandler

noble lantern
#

Hahaha

buoyant viper
#

@fresh templethandler

noble lantern
#

Tf

tardy delta
#

Lmao

noble lantern
#

@eventhandler

tender shard
#

maybe it's different between ios / android

noble lantern
#

@eventHandler

#

Oh yah in on android

#

Hnnh likes her ios i bet

fiery prairie
#

@fresh templetHandler

tardy delta
#

I want to kill aitocorrection

tender shard
buoyant viper
#

im just on it to try it out 😞

quiet hearth
buoyant viper
#

might switch to a pixel or something after

noble lantern
tardy delta
#

What the

tender shard
wide coyote
#

is there a way to get newstate's drops in BlockGrowEvent?

noble lantern
#

I go back to sleep i woke up and just needed to we ewhat yall doing

tender shard
#

just do a private static final field of your main instance

fiery prairie
# tardy delta What the

sometimes its actually great, because usually when your screen is horizontal and you type something the keyboard covers the whole screen

noble lantern
tender shard
#

10% left and I don't have a proper USB-C cable with me 🥲

tardy delta
#

I hate discord on phone

buoyant viper
hoary perch
tender shard
buoyant viper
hoary perch
fiery prairie
#

so umm now I have this

    private HashMap<UUID, Long> cooldown = new HashMap<>();
    @EventHandler
    public void onAsyncPlayerChatEvent(AsyncPlayerChatEvent e){
        Player p = e.getPlayer();

        if (!cooldown.containsKey(p.getUniqueId())) {
            cooldown.put(p.getUniqueId(), System.currentTimeMillis());
            return;
        }

        long timeElapsed = System.currentTimeMillis() - cooldown.get(p.getUniqueId());

        if (timeElapsed >= getConfig().getInt("chat-cooldown")) {
            cooldown.put(p.getUniqueId(), System.currentTimeMillis());
            return;
        }

        int remaining = getConfig().getInt("chat-cooldown");

        e.setCancelled(true);
        p.sendMessage(Long.toString(timeElapsed));
        Utils.color(getConfig().getString("chat-cooldown-reached").replace("%seconds%", String.valueOf(Math.round(remaining/1000))));
    }

and it only responds the number instead of the whole message from config, and instead of showing how much time is remaining, it actually shows it going up until it reaches 3000

noble lantern
#

Get the state one tick later

buoyant viper
fiery prairie
#

wait what why where

tender shard
wide coyote
fiery prairie
#

which line is it xD

noble lantern
buoyant viper
#

u have one sendMessage call snd its Long.toString

noble lantern
#

Too*

chrome beacon
fiery prairie
#

shit i found the problem thx xD

noble lantern
#

Fucking anime githu repo pfp

#

Github*

tender shard
#

mac is so beautiful compared to windows

buoyant viper
#

mac is better looking than a lot of things

tender shard
#

it doesn't even have any activation thing 🥲

fiery prairie
eternal oxide
#

lol 11 is terrible

vale ember
tender shard
buoyant viper
#

i think the first thing i said when i booted into windows 11 was "wow, this looks like macos"

eternal oxide
#

I stay on 7 as 10 and 11 are so bad

buoyant viper
#

rounded corners out the ass

noble lantern
#

Now way ur on 7

#

No*

eternal oxide
#

yep

weak kayak
#

7 is still widely used by a lot of people

buoyant viper
noble lantern
#

Can I see the window 7 task bar again

#

I miss it

quiet hearth
eternal oxide
#

7 rocks, you update to just before they added all that upgrade nag shit, then disable all updates

tender shard
fiery prairie
tender shard
#
private static final Main main = Main.getInstance();
#

on Mac, IntelliJ supports several projects in tabs / in one window :3

noble lantern
#

So theyre racist

#

I see

buoyant viper
tender shard
buoyant viper
#

even macos ones are turned off

#

no wacky anim for minimizing for me

quiet hearth
tender shard
buoyant viper
#

although funnily enough a certain microsoft app will break if u turn off ALL animations (im looking at you, [Xbox] Insider)

buoyant viper
#

but i basically consider that off

tender shard
#

ah kk

noble lantern
#

Wtf is this emoji lmao

tender shard
#

applies for staff

buoyant viper
noble lantern
#

The only animation on my pc is my anime haaaa

#

Jk i dont watch that

tender shard
#

hm that one sucks

noble lantern
#

BWAHAH

eternal oxide
#

oh wow, all these years and I never knew teh snipping tool was in Win 7

noble lantern
#

Ofc

buoyant viper
#

snipping tool my beloved

tender shard
#

discord shows all the emojis so tinny, you gotta send them to see what they are actually like lol

tender shard
buoyant viper
#

cmd+shift+5 >

tender shard
#

I like the 4 version better

buoyant viper
#

4 is just for selection area isnt it

tender shard
#

yes

#

5 is the "do whatever you want" one

buoyant viper
#

5 is effectively the equivalent to win shift s

noble lantern
#

I love how this emojis in a coding discord

tender shard
#

I think Cmd+Shift+5 is the only thing I ever used the touchbar for lol

grim ice
#

uh

#

?paste

undone axleBOT
noble lantern
#

Oh god

#

Lord help us

grim ice
#

nvm

noble lantern
grim ice
#

LOL

noble lantern
#

Literally free meme real estate

#

Okay fr gnight now

buoyant viper
#

no touchbar for me

#

just an expensive lap heater

tender shard
#

Well its fancy to have but thats it

buoyant viper
#

isnt there an app that adds pets to it

#

like a duck or something

tender shard
tender shard
#

I have a piano app for it

#

But its hard to hit the black keys

#

Theyre too small

#

When i got my new apartment i finally have enough space for my real piano

#

Right now its at my parents

tender shard
#

I need that

#

I definitely need a second reddit account too

fiery prairie
#
    private HashMap<UUID, Long> cooldown = new HashMap<>();
    @EventHandler
    public void onAsyncPlayerChatEvent(AsyncPlayerChatEvent e){
        Player p = e.getPlayer();

        if (!cooldown.containsKey(p.getUniqueId())) {
            cooldown.put(p.getUniqueId(), System.currentTimeMillis());
            return;
        }

        long timeElapsed = System.currentTimeMillis() - cooldown.get(p.getUniqueId());

        if (timeElapsed >= getConfig().getInt("chat-cooldown")) {
            cooldown.put(p.getUniqueId(), System.currentTimeMillis());
            return;
        }

        int remaining = getConfig().getInt("chat-cooldown");

        e.setCancelled(true);
        timeElapsed = remaining - timeElapsed;
        p.sendMessage(Utils.color(getConfig().getString("chat-cooldown-reached").replace("%seconds%", String.valueOf(Math.round(remaining/1000)))));
    }```

last thing for cooldown 

turns out it doesnt work correctly and when i am on cooldown and i send a message it actually cancells the event but doesnt say anything except for this error in the console https://pastebin.com/wARyV11H
gritty urchin
#

How to check if player has no permissions

fiery prairie
gritty urchin
#

yes but I want to check for all permissions

#

not specific ones

#

tried

fiery prairie
#

do if(sender.isOp()) instead of hasPermission

gritty urchin
#

if (player.getEffectivePermissions() == null) { }

#

no but you can still be not op

fiery prairie
#

because technically op gives all permissions

gritty urchin
#

and have permissions

fiery prairie
#

oh

gritty urchin
#

doesnt work

eternal oxide
#

of course not, its annotated @urban grotto

#

it returns a Set

fiery prairie
#

you pinged a notnull guy

gritty urchin
#

ah ok

#

i just convert to array

eternal oxide
#

so .isEmpty()

gritty urchin
#

and check length

#

or that

tender shard
#

Just do size() if you need the „length“

gritty urchin
#

alr

solid cargo
#

why dafaq

#

the "c" acts as a player balancer btw

#

this is what i get when i trigger the code