#help-development

1 messages ยท Page 1464 of 1

minor garnet
#

dude its serious

#

he was talking about Byte or byte

#

with the most b

wraith rapids
#

yes, byte is different from Byte

torn shuttle
#

@wraith rapids so does it bother you that google lets you search keywords instead of keeping a big directory of everything on google so you can browse the directory instead?

wraith rapids
#

they are two very different things

minor garnet
#

dude

wraith rapids
#

byte is a primitive

#

Byte is a wrapper object

minor garnet
#

why didn't you tell me before

wraith rapids
#

because it's java 101

#

and you should know it

#

google is quite different from my project

#

google can't categorize everything into neatly ordered nodes based on their use and intent

minor garnet
#

how nice

torn shuttle
#

I mean it could if it really wanted to

wraith rapids
#

if it could, and if it did, I'd use that rather than the search function

torn shuttle
#

lol

#

that is almost psychopathically backwards

wraith rapids
#

because when you compare a string of text vs a network mapped based on actual intention, the string loses every time

#

this is less the case in a project that you and you alone are working on

#

because you probably remember most of the names by heart

#

and can associate intention to those names

torn shuttle
#

christ no

opal juniper
#

How to set the maximum value of a bossbar

torn shuttle
#

I don't

wraith rapids
#

and so searching them directly can be faster

#

but that is not the case for someone else browsing the project

torn shuttle
#

there's over 813 project files

#

you think I remember every name

wraith rapids
#

it's quite possible yes

young knoll
opal juniper
torn shuttle
#

this is just one project

wraith rapids
#

i remember most of the hundreds of names in my projects

#

it might take a little bit to re-remember them and their purpose after coming back after a while

#

but i do remember them

torn shuttle
#

yes, this is hundreds of names

#

it's getting close to the thousand

wraith rapids
#

and that's all the more reason to categorize them based on a package tree rather than name

#

you are slowly losing the advantage of "i know this name" and getting into google territory

torn shuttle
#

I couldn't even tell you the name of 10 people I studied with let alone the exact names of my class files

wraith rapids
#

where you have to throw random search queries at it and hope it finds what you want

torn shuttle
#

they are in packages, but also I know that if I want to mess around with a fireball power whose name I forgot I can just type fireball and it will be there

wraith rapids
#

or you could open the packages that involve fireballs and see it'll be there as well

quaint mantle
#

thanks you. I created color class. but how can I use this in spigot plugin's console?

torn shuttle
#

yes, I could go to the list of all packages, find the one I am looking for, look through that list of packages, find the one I am looking for, look through the list of packages, find the one I am looking for and then browse that package directory

#

or I can just type "fireb"

wraith rapids
#

and the downside of this is that your class names turn into orgBukkitBlockBlock from org.bukkit.block.Block

torn shuttle
#

and what's the downside of that?

wraith rapids
#

that they become absurdly and needlessly large and your code becomes illegible

torn shuttle
#

EnderDragonDiscoFireball is the opposite of illegible to me

#

it tells me everything I need to know at a glance

wet breach
#

the other downside is that on windows, you have a max direcctory depth and character limitation in paths. On linux generally don't have that problem.

wraith rapids
#

you don't need to know most of the things it tells you

torn shuttle
#

I need to know it's dragon specific, that it's a fireball power and which one it is

#

the only extraneous thing in there is "ender"

#

and that's just because I am following the api name

wraith rapids
#

perhaps you should also know that it's specific to your plugin

#

why don't you add your plugin name to the classname

torn shuttle
#

you're being facetious because you just don't have a counter-argument for what I just said

minor garnet
#

i have other problem now with it..

wraith rapids
#

this is false

wet breach
#

are you comparing different search methods?

#

o.O

wraith rapids
#

i'm saying his class names are excessively verbose

torn shuttle
#

no, we're comparing a search method vs browsing directories

wet breach
#

I usually resort to browsing directories if what I am trying to search for doesn't pan out

minor garnet
#

yay

torn shuttle
#

if you named it something very easy to find perhaps you wouldn't have a hard time finding it in the first place

#

that's what I do

wet breach
#

well that depends

wraith rapids
#

and then again you end up with excessively verbose classnames

torn shuttle
#

which is his way of saying you wouldn't have 20 classes called "fb"

minor garnet
# minor garnet https://paste.md-5.net/karebopaci.css

my minecraft crashed with this

        DataWatcher watcher = new DataWatcher(((CraftPlayer)player).getHandle());
        watcher.register(new DataWatcherObject<>(7, DataWatcherRegistry.a), (byte) 1);
        
        PacketPlayOutEntityMetadata meta = new PacketPlayOutEntityMetadata(((CraftPlayer)player).getHandle().getId(), watcher, true);
        world.getPlayers().forEach(all ->  ((CraftPlayer)player).getHandle().playerConnection.sendPacket(meta));
    }```
wet breach
#

depends on how broad you want to be about when it comes to searching. For coding projects, I have zero problems using either method

wraith rapids
#

if you need to include every bit of information on what a class is and what it does and how to find it in the name, you'll end up with really long names

#

the name isn't the place to store all of the identifying information of a class

wet breach
#

but if say I want to find a random obsucre file that I have, then browsing directories is going to be faster then using some search function

torn shuttle
wet breach
#

it probably doesn't necessarily make it harder, but it could turn into an odd name if its used for multiple things

torn shuttle
#

it's just one power

wet breach
#

but, I say use whatever works for you ๐Ÿ˜›

torn shuttle
#

the ender dragon has 20, currently 6 of which are fireballs

wraith rapids
#

it's needlessly long and takes up space and takes up time to read

wet breach
#

if the only complaint you have is one that is of an opinion, then its not much of a complaint or argument

torn shuttle
#

maybe I'm just a fast reader, but it takes me no time at all to read 4 words

#

then again that is my job

wraith rapids
#

me neither but it takes somewhat longer than to read 1 word

torn shuttle
#

I still can't imagine a world where you can somehow browse hundreds of project directories faster by hand than by typing 4 words but perhaps you're just some sort of super human at reading 1 word long directory names and your kryptonite is class names with 4 words

wet breach
wraith rapids
#

i wouldn't want to have a project of thousands of files each of which must be uniquely identifiable by their name lest I can't find them with a test based search function

torn shuttle
#

they don't have to be entirely unique, just searchable

#

I wouldn't want to have to go through dozens of directories to find one class

#

look all I'm saying is that when I look up the javadocs I use the search feature, not once in my life have I actually even looked at what shows up by default

wet breach
#

lol

torn shuttle
#

for all I know there's a picture of a cute dog on there

wet breach
#

well I think I pretty much answered when browsing directories is going to be faster

#

if what you are searching for is going to be contained just in a single project, then its going to be faster

#

its when you have to make that search broader does it become less efficient

torn shuttle
#

I use the search function on two class projects

wet breach
#

missed my point

#

I don't really care where you are using the search function. I am stating that as long as your search can be contained within a specific set of parameters. In your case just your project, then the search function is going to be most of the time faster. However, the moment you can't contain the search to something specific, IE it becomes a broader search will drastically become less efficient the more broader it becomes.

torn shuttle
#

well yeah but unless you're on a seriously large project odds are there's a hard threshold to how broad your search can get

wet breach
#

as long as my IDE is aware of all the projects I told it to be aware

#

I can search through them all

torn shuttle
#

yeah obviously this won't work if you literally can't index the files

wet breach
#

but I do have projects where searching isn't feasible though

#

IE, Mozilla firefox being an example ๐Ÿ˜‰

torn shuttle
#

you work on internet explorer AND firefox?

wet breach
#

however, I can narrow it down by telling it certain directories to only look instead

torn shuttle
#

that sounds like a conflict of interests

wet breach
#

I don't work on internet explorer?

torn shuttle
#

IE

torn jewel
#

how would i put just "\ " without it escaping quotatioon marks

torn shuttle
#

the world doesn't deserve my top notch comedy

wet breach
#

IE = Id Est

wraith rapids
#

woosh

torn shuttle
#

like I said

#

undeserved

wet breach
#

indeed

#

anyways, firefox is super large takes a few hours just to compile it lol

torn shuttle
#

for sure

#

I'm sure microsoft also doesn't use this tactic, but I don't I'm not breaking down in cold sweats over it

wet breach
#

but that is probably the best example I have where searching isn't always effective except unless you know the directories to contain the search to

torn shuttle
#

I don't think I'll sneeze and accidentally become google

#

though it would be one cool party trick

wet breach
#

well, googles patent did expire so you could always look at that if you are wanting to become what google used to be ๐Ÿ˜‰

torn shuttle
#

yeah this sounds like the space I should be competing in

#

what with my vast background of making semi-obscure spigot plugins and translating

#

you better watch out google

#

magmoogle is coming to get you

#

anyway I'm still

#

two powers short

wet breach
#

lol

#

but it is also the reason why google search kind of sucks now too, since they changed their search function because apparently you can't use something unless its patented

#

according to the vast corporations lol

torn shuttle
#

I wouldn't say it sucks but it does feel like it's a few features short

#

that being said I used duckduckgo for a few years but I still ended up going back to google for a few features

#

I wish I could not use google but at the same time ddg lacks the ability to answer queries on the search page

#

or at least to do it well

wet breach
#

most likely because most websites tailor their stuff to google

torn shuttle
#

yeah google isn't exactly sleeping on the job

#

they're very deeply entrenched

wet breach
#

it would be nice if google wasn't trying to predict everything I am trying to search for

#

predictive search is nice for people who are not tech savy. Terrible for people like developers because it tries to find what is relevant to their average user, not so much caring for the niche stuff

torn shuttle
#

pro: a search engine that knows what you want to search
con: a search engine that knows what you want to search

wet breach
#

google very rarely gets it right in what I am trying to search for

wraith rapids
#

using google is super annoying because for every search query you make you need to think "how would a plebian search for this"

torn shuttle
#

it's exceedingly rare that I don't get what I want from google on my first try

wraith rapids
#

maybe you're a plebian

wet breach
#

lol

torn shuttle
#

maybe I just like typing because it's my day job

wet breach
#

not sure what typing has to do with it

torn shuttle
#

it's not hard to get a search right if you give it enough context

wet breach
#

I can give it enough context all I want, if its a niche or obscure site I am trying to find or topic, google won't find it

wraith rapids
#

all it's going to find is 2000 results of "how to open task bar windows techgenius guide"

torn shuttle
#

man I'll feed google half remembered lyrics from random songs from the 90s and it will still sort it out by result 5

wraith rapids
#

JUMP_HIGH or something

#

the names are dumb

#

should've gotten flattened in 1.13

#

but ig then we'd have to rewrite that enum at runtime with bytecode hacks too so eh

wet breach
wraith rapids
#

well that's probably it then

torn shuttle
wraith rapids
#

is jump boost the same as leaping?

#

never heard of leaping

torn shuttle
#

same thing

#

p sure

wet breach
wraith rapids
#

try not to make it explode by doing whatever it is that you're doing asynchronously

torn shuttle
#

don't be a coward make player movement async

#

only fools and cowards move in linear time

wet breach
#

player movement could be async

#

main problem isn't doing that, rather the client wouldn't know how to handle it

torn shuttle
#

couldn't make pvp worse

wraith rapids
#

that'd involve making block and entity collisions threaded

#

which with the current system would be kind of bad news bears

wet breach
#

yeah with the way MC is setup currently it just wouldn't work

#

but that isn't the same as saying player movement couldn't be async though. Which in most games player movement is async

wraith rapids
#

although ig entity collisions are handled by the client

torn shuttle
#

let's be real the way it is currently setup is the way it will remain setup for the rest of mc's duration

wraith rapids
#

and most block collisions are handled by the client as well

#

almost all of player movement is clientside actually

wet breach
torn shuttle
#

it's too much of a hassle to start one for as long as the official client keeps getting updates

minor garnet
#
        DataWatcher watcher = new DataWatcher(((CraftPlayer)player).getHandle());
        watcher.register(new DataWatcherObject<>(7, DataWatcherRegistry.a), (byte) (int) 1);```  is crashing my minecraft..
wraith rapids
#

nobody cares about the client anyway

wet breach
#

nobody cares about it, yet everyone complains about it

#

the irony

torn shuttle
#

nobody that could actually do something about it cares

wraith rapids
#

the load times are absurdly long as of like 1.15 or something

#

ever since that new eyebleaching red mojang logo in the loading screen

torn shuttle
#

I don't quite know why minecraft's load times are so long

minor garnet
#

@wraith rapids but..

torn shuttle
#

surely they could load things during runtime

wraith rapids
#

data driven something something resources

wet breach
#

well most of that stems from the fact that most people don't switch the JVM the client uses. by default the client uses 1.8 java that is shipped with the launcher

minor garnet
#

java.lang.ClassCastException: java.lang.Byte cannot be cast to java.lang.Float
at vp.cd(SourceFile:711) ~[vp.class:?]
at buq.a(EntityRenderer.java:675) ~[buq.class:?]
at buq.a(EntityRenderer.java:934) ~[buq.class:?]
at buq.a(EntityRenderer.java:1646) ~[buq.class:?]
at buq.b(EntityRenderer.java:1614) ~[buq.class:?]
at buq.a(EntityRenderer.java:1385) ~[buq.class:?]
at bib.az(SourceFile:1023) ~[bib.class:?]
at bib.a(SourceFile:419) [bib.class:?]
at net.minecraft.client.main.Main.main(SourceFile:123) [Main.class:?]
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[?:1.8.0_281]
at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source) ~[?:1.8.0_281]
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) ~[?:1.8.0_281]
at java.lang.reflect.Method.invoke(Unknown Source) ~[?:1.8.0_281]
at net.minecraft.launchwrapper.Launch.launch(Launch.java:159) [launchwrapper-of-2.1.jar:2.1]
at net.minecraft.launchwrapper.Launch.main(Launch.java:30) [launchwrapper-of-2.1.jar:2.1]

wraith rapids
#

literally read

torn shuttle
#

we all Float down here

wet breach
#

why do you keep attempting to cast objects?

minor garnet
#

tf

wraith rapids
#

at least cast it to the right shit

minor garnet
#

final byte i = Integer.valueOf(1).byteValue(); i tried it to

wraith rapids
#

ClassCastException: java.lang.Byte cannot be cast to java.lang.Float

#

read

dusty herald
#

why do you need the byte value of 1, just curious

wraith rapids
#

so he can have it explode by trying to cast it to float obviously

dusty herald
#

ah YES

#

the infamous >

minor garnet
#

wait

wraith rapids
#

notify

torn shuttle
#

schedule for later

wet breach
#

@dusty herald maybe they want to get some practice in for bitshifting or bitmasking one of the two

dusty herald
#

i have no idea what either of those do

wraith rapids
#

noob

torn shuttle
wraith rapids
#

lmao

wet breach
#

lol

minor garnet
# dusty herald the infamous >

You want to create a new Data Watcher, set its watched byte 7 to byte 1, create a metadata packet, set its data watcher field to the created datawatcher, set the entityid field of the metadata packet to the player's entityid and send the packet to the viewers >

torn shuttle
#

my hat will remain uneaten

minor garnet
#

i need it to make it

wraith rapids
#

you are

#

trying to cast

#

a byte to a float

#

the solution to this problem:

#

don't do that

wet breach
#

and ironically float is not the type needed here either so the cast is unnecessary to begin with XD

minor garnet
torn shuttle
#

I think vinny will make for a great mmorpg developer one day, he can clearly prove that he can create his own issues he just needs to then sell the solution to the playerbase

wraith rapids
#

i have no clue where the cast is even happening because of the classnames

minor garnet
#

but if i and an int how does it become a i float

wraith rapids
#

but he is passing a byte somewhere that expects a float

#

and for some reason the compiler isn't catching it

wraith rapids
#

i'm calm

torn shuttle
#

he pinged me

wraith rapids
#

i can't see replies

torn shuttle
#

not sure why

minor garnet
#

i cant understand it

#

it can be such a simple business but it can sometimes get so hard xd

paper viper
wraith rapids
#

they'll implement replies eventually maybe

#

idk, maybe they already have

#

haven't updated ripcord in like 2 years or something

paper viper
#

then update

dusty herald
#

what's ripcord

paper viper
#

LMao

wet breach
#

are you modifying something with the client @minor garnet ? or is this a plugin you are working on?

wraith rapids
#

kind of like discord

minor garnet
#

plugin

wraith rapids
#

but not gay

#

and also shit

dusty herald
#

lmao

#

does it have shitty logos

minor garnet
#

im trying remake this:

dusty herald
#

this shit right here? awesome

torn shuttle
wet breach
#

well that explains where the casting comes in, the client is expecting a float but you have it set to a byte on whatever the packet is you are trying to send

wet breach
#

which means that whatever you tried setting, was the wrong thing

dusty herald
#

holy fuck NNYa

torn shuttle
#

you know suddenly it makes sense that you like directories so much

wet breach
#

lol

torn shuttle
#

I've never before seen an OS that looked deranged

wraith rapids
#

there is a real reason for why everything is the way it is

torn shuttle
#

and I saw the thing accursedfarms came up with

wet breach
#

try looking at everything with just green colors ๐Ÿ™‚

torn shuttle
#

are all of these reasons derived from a deep self-hatred?

wraith rapids
#

mostly from eye damage

torn shuttle
#

right

wet breach
#

green colors I use sometimes especially for console because its just a military thing

minor garnet
#

i just want to create a package where all players see a certain player pulling the bow

wraith rapids
#

basically there's some defect in the lens of my eyes that causes me to see shit in two

wet breach
#

when looking at any screen in the military, its pretty much just green and white XD

wraith rapids
#

high contrast and monochrome displays help with seeing things properly

dusty herald
#

holy hell ripcord is uh

#

different

wraith rapids
#

it's a from-scratch rewrite of the discord client in like C or something

torn shuttle
dusty herald
#

very IRC vibes

torn shuttle
#

I thought it came from that

#

same monitors still found in... oscilloscopes?

#

it's been a while

minor garnet
#

0x01 this is a byte...

wet breach
#

@torn shuttle not sure of the top of my head, but the reason green is used is because your eye can see more shades of green far easier then any other color

#

hence why NVG's are also green

wraith rapids
#

back in the day green was the brightest phosphor they could come across iirc

torn shuttle
#

ah yeah

dusty herald
#

NNYA why doesn't it ever show when you're typing

torn shuttle
#

that sounds vaguely familiar

dusty herald
#

is it bc ur name is so long

wraith rapids
#

because i disabled that feature

#

with my godlike ripcord powers

wet breach
#

basically his client just doesn't send that packet

dusty herald
#

thats cool

wraith rapids
#

my godlike ripcord powers also let me see all hidden channels and all user permissions and shit

dusty herald
#

yes I can see #verification too

wet breach
#

well don't think anyone said discords API stuff was very good ๐Ÿ˜›

torn shuttle
#

that sounds like the opposite of useful

#

I wish I could not see most channels lol

wraith rapids
#

i don't even look at the channel list ever

#

i just have a select few channels open in my tabs

dusty herald
wraith rapids
#

and a few other select channels in the custom list on the left

#

and then I just navigate those

#

i'm in like a billion servers, can't be arsed to scroll through them all

dusty herald
#

i mean magma u can mute channels and right click the server and click hide muted channels

torn shuttle
#

I can't tell if NNYa always sees red or is blind to the color red

wet breach
torn shuttle
#

or maybe both, somehow

wraith rapids
#

i use red because it doesn't fuck up my circadian rythm

dusty herald
#

what version of windows do you even use nnya

wraith rapids
#

10

torn shuttle
#

is that why your walls are covered in blood?

dusty herald
#

does not look like it Kek

wraith rapids
#

it took some effort to make it look like this

#

windows 98 skin

wet breach
wraith rapids
#

except it's red

dusty herald
#

very nostalgia

#

i wanna play some of the OG simcity now thanks

minor garnet
#

how do I add a byte value 1 in a fdatawatcher

wet breach
#

@dusty herald if you do, need to use a cpu limiter for it

dusty herald
#

whaa

#

does it just eat up cpu lmao

wet breach
#

many games from that time era used the CPU as the clock

torn shuttle
#

yeah

wet breach
#

so, modern cpus are way too fast for the games

torn shuttle
#

let's play at 300x the speed

wet breach
#

^

torn shuttle
#

iirc there's some emulators out there to prevent this issue

#

could be wrong though

wet breach
#

you are correct

dusty herald
#

oh shit, there's a #discord-staff Wink

torn shuttle
#

discord-staff is mandatory

dusty herald
#

i wonder what goes on in there

wraith rapids
#

probably nothing

dusty herald
#

idkk

torn shuttle
#

discord forces servers of a certain category to have that channel

wraith rapids
#

you see the staff like once or twice a week

wet breach
#

so the cpu limiter basically artificially slows the CPU clock for the game so that the game doesn't run at million times faster then you are wanting it to @dusty herald

dusty herald
#

are you saying i can speed shit up just by changing the CPU limits

wet breach
#

for older games yes

dusty herald
#

no more waiting for simcity shit to be built

torn shuttle
#

I mean that's not even the worst of it

wet breach
#

because as I said, they used the CPU speed as the game clock or tick rate

torn shuttle
#

there's games that have in-game speed tied to framerate

wet breach
#

oh yeah there is that too

dusty herald
#

oh my god

torn shuttle
#

a few years back some major racing title came out locked to 30fps

#

people unlocked it

wraith rapids
#

many old games do that yeah

torn shuttle
#

turns out it was tied to fps

#

also turns out the physics were sort of weirdly async

#

so cars would fly off the map

#

pretty much instantly

dusty herald
#

ah yes

torn shuttle
#

best space sim game ever made 10/10 I believe it got recalled

dusty herald
#

async

wraith rapids
#

async multithread physics fork

dusty herald
#

every developers wet dream

covert bluff
#
package me.notprankster.kitduels.events;

import org.bukkit.entity.Player;
import org.bukkit.event.EventHandler;
import org.bukkit.event.Listener;
import org.bukkit.event.entity.EntityDamageByEntityEvent;

public class EntityDamageListener implements Listener {

    @EventHandler
    public void onEntityDamage(EntityDamageByEntityEvent event) {
        if (event.getDamager() instanceof Player) {
            if (((Player) event.getDamager()).getNoDamageTicks() > 0) {
                event.setCancelled(true);
            }
        }
    }
}

I'm making a kitselector plugin, and I've got the GUI working, the tp'ing working, and the invincibility by using .setNoDamageTicks(), but my one question is how I would prevent the player who is invincible for a set duration after spawning from damaging people. This is my method but I haven't tried it yet. I want to know if this is the best way.

dusty herald
#

๐Ÿคท test it

wraith rapids
#

listen to entity damage by entity event and check if the damager is invincible for a set duration, then cancel

torn shuttle
#

don't do that

#

because I already know you're going to mess it up

#

and read the no damage ticks

covert bluff
#

ye, i just wanna know if this is a good method

wraith rapids
#

basically this will run into the issue that anybody will have nodamageticks > 0 after they're punched

wet breach
#

or just keep track of the players who are invincible and track their actions for that period of time

dusty herald
#

magma send that twitch thing again im on desktop

wet breach
#

and just don't let them hit players ๐Ÿ˜›

wraith rapids
#

yeah you should probably not use the nodamageticks for tracking this

#

as that's being used by the game for stuff

torn shuttle
covert bluff
dusty herald
#

oh my god

wraith rapids
#

yes and punching them will also set the invincible with nodamageticks

dusty herald
#

that is amazing magma

#

does it regenerate?

torn shuttle
#

yep

wraith rapids
#

so whenever anyone punches anyone they become invincible for a brief moment and can't punch anything

covert bluff
#

what do i do?

wraith rapids
#

you listen to damage events and cancel them if the damager or damaged player are invincible

#

and track invincibility separately

torn shuttle
#

ergh

covert bluff
#

how do i make them invincible in the first place though

wraith rapids
#

by marking them as invincible

#

idk, add them to a Set<Player> named myinvincibleplayers

#

or whatever

covert bluff
#

add them to an arraylist?

torn shuttle
#

or keep a list of players you are making invincible and compare it to that if you don't want to run into compatibility issues

wraith rapids
#

not an arraylist

#

a set

covert bluff
#

and then remove them from the arraylist by using a delayed task?

#

oh, then set?

wraith rapids
#

yeah, what you said but with a set

covert bluff
#

okay, thanks, now i know a better method

torn shuttle
#

make sure you make it static buddy

wet breach
#

I suppose you could

torn shuttle
#

I mean this is the perfect use case

covert bluff
#

do i make the set in another class or can i keep it in the same listener class that sets them invincible

torn shuttle
#

go nuts

wraith rapids
#

i can almost see something

covert bluff
#

ahhhhh

wet breach
#

well you are not wrong about that @torn shuttle

torn shuttle
covert bluff
#

nvm, i'll make a function

wraith rapids
#

the site is

torn shuttle
#

twitch is poo poo

wraith rapids
#

worst shit ever

torn shuttle
#

not sure how the player is so busted

#

I can't even watch the video

wet breach
#

@torn shuttle works if I set it to 360p

wraith rapids
#

2021 and we haven't invented video streaming yet

torn shuttle
#

it automatically starts at 2 seconds and instantly stops and starts the countdown for the next video

#

this isn't even streaming, it's a clip

wraith rapids
#

it is streaming

torn shuttle
#

the stream was buttery smooth

wraith rapids
#

from the server

#

to my machine

wet breach
#

works if I set it to source, but auto wants to default to 360p @torn shuttle

wraith rapids
#

i probably can't even run source

torn shuttle
#

fun

wraith rapids
#

it's probably like 2gbps bitrate

wet breach
#

I can run it as source and my display only does 1080

torn shuttle
#

I can stream but I can't watch lol

wraith rapids
#

tell that to my integrated gpu and 600mhz cpu

wet breach
#

I have an integrated as well, but my cpu is faster then that XD

#

@torn shuttle then maybe set a lower resolution for recording then?

#

probably why your videos have issues

torn shuttle
#

the videos are entirely fine when I record them locally

#

and the stream playback at 1440p is perfect

#

somehow clipping it is what broke it

dusty herald
#

i use action for recording and it eats through my memory like fraps but on cocaine

covert bluff
#
 public static Set<Player> invinciblePlayers;

    public void makePlayerInvincible(Player p) {
        int invincibilityTime = KitSelector.getInstance().getConfig().getInt("invincibilityTime");

        invinciblePlayers.add(p);

        BukkitScheduler scheduler = KitSelector.getInstance().getServer().getScheduler();

        scheduler.runTaskLater(KitSelector.getInstance(), new BukkitRunnable() {
            @Override
            public void run() {
                invinciblePlayers.remove(p);
            }
        },invincibilityTime * 20L);
    }
#

would this work?

dusty herald
#

should lower the video quality

wraith rapids
#

he actually made it public and static

covert bluff
#

was i supposed to do that

wraith rapids
#

maybe

torn shuttle
#

it's valid

dusty herald
#

i mean ๐Ÿคท

covert bluff
#

or should i make a getter instead

#

okay

wraith rapids
#

ideally yes

torn shuttle
#

eh

dusty herald
#

getters are nice

wraith rapids
#

exposing state directly is bad bad

dusty herald
#

i use lombok for that though

wraith rapids
#

where is tommy tom tom I wonder

covert bluff
#

what is a lombok

#

is it a programming language

wraith rapids
#

it's magick

covert bluff
#

oh

dusty herald
wraith rapids
#

heh

#

ripcord lets me rename people

#

i'll rename tom to tommy tom tom

torn shuttle
#

just the clip I got from it is completely broken?

torn shuttle
#

what?

wraith rapids
#

substituted tom's name for tommy tom tom

torn shuttle
#

what a feature

#

truly this is the 22nd century

covert bluff
#
public class EntityDamageListener implements Listener {
    
    @EventHandler
    public void onEntityDamage(EntityDamageByEntityEvent event) {
        Set<Player> invinciblePlayers = InventoryClickListener.invinciblePlayers;
        if (event.getDamager() instanceof Player) {
            Player damager = (Player) event.getDamager(); 
            
            if (invinciblePlayers.contains(damager)) {
                event.setCancelled(true);
            }
        }
    }
}
#

?

wraith rapids
#

check the damaged player as well

#

you don't want people to damage an invincible player

#

so you should cancel those as well

covert bluff
#

ye

#

i just remembered it right now

#
public void onEntityDamage(EntityDamageByEntityEvent event) {
        Set<Player> invinciblePlayers = InventoryClickListener.invinciblePlayers;
        if (event.getDamager() instanceof Player) {
            Player damager = (Player) event.getDamager();

            if (invinciblePlayers.contains(damager)) {
                event.setCancelled(true);
            }
        }
        
        if (event.getEntity() instanceof Player) {
            Player plr = (Player) event.getEntity();
            
            if (invinciblePlayers.contains(plr)) {
                event.setCancelled(true);
            }
        }
    }
#

is this fine?

torn shuttle
#

waht

#

why did you copy the set

wraith rapids
#

you may want to split the latter check into its own listener listening for EntityDamageEvent

#

as this event handler will only be fired for entities damaging the player

#

fall damage and cacti and lava and shit won't fire this

torn shuttle
#

fyi that's not a getter if that's what it was meant to be

wraith rapids
#

i assumed he was doing something with lombok

#

never really looked into that shit so idk how that's supposed to look like

dusty herald
#

i was jsut talking about lombok, and how it has saved my projects from being crouded

covert bluff
#

3 seconds after spawn

wet breach
#

@torn shuttle
Audio for portions of this video has been muted as it appears to contain copyrighted content owned or controlled by a third party.

also the video works properly too, can set lower resolution without issue

torn shuttle
#

yeah

wraith rapids
#

then this is fine, but you should also check whether the damager and damaged are players before cancelling it

torn shuttle
#

then it's right

maiden briar
#

cannot access net.md_5.bungee.api.chat.TextComponent ? I imported the spigot dependency

wraith rapids
#

since this will also fire when a zombie punches a player

torn shuttle
#

I don't really care about playing copyrighted music lol

covert bluff
#

oh right

wraith rapids
#

are you using a dependency manager

#

or directly importing shit via ide

#

@maiden briar

wet breach
#

@torn shuttle well sometimes twitch will mute whole sections of a video where you can't hear people talk

maiden briar
#

I am using Maven

wraith rapids
#

that should be included then

wet breach
#

even if you use music that is public domain

torn shuttle
wraith rapids
#

check your dependency tree

maiden briar
#
<dependency>
            <groupId>org.spigotmc</groupId>
            <artifactId>spigot</artifactId>
            <version>${spigot.version}</version>
            <scope>provided</scope>
        </dependency>
wraith rapids
#

bungee-chat should be there somewhere

maiden briar
#

Ok

torn shuttle
#

and honestly aside for clipping purposes I don't really care about the vods, I don't know that anyone watches them anyhow

wet breach
#

lol

#

I used to watch your streams

torn shuttle
#

did I go too mainstream?

wet breach
#

no, I just don't watch streams all the time

#

so I tend to forget that people do ๐Ÿ˜›

dusty herald
#

i dont ever watch streams

torn shuttle
#

tbf I stopped streaming for uh

#

lotsa months

wraith rapids
#

i don't watch streams at all because all streaming platforms are so laggy

maiden briar
wraith rapids
#

youtube's streaming is a little bit more lightweight but the chat box bricks my browser

torn shuttle
#

i usually stream in phases when I feel like it

maiden briar
#

But still get the error

wraith rapids
#

clear caches and restart

maiden briar
#

How?

wraith rapids
#

it's under File > iirc

torn shuttle
#

honestly my stream content is really boring, most good it does is force me to go the extra mile to make something look good or work

covert bluff
#

i can only watch videos at a quality of 360p

maiden briar
#

Ok restarting....

wraith rapids
#

caching is hard

covert bluff
#

having only 1 mbps of download speed sucks

torn shuttle
#

and not spend hours making fun of nnya's distaste of my naming conventions for classes

wraith rapids
#

your conventions are the only thing being made fun of

torn shuttle
#

the feeling is mutual

wet breach
#

lol

maiden briar
#

Still getting the error

dusty herald
#

what error

maiden briar
#

I just get it since I am working with module-info.java

#

cannot access net.md_5.bungee.api.chat.TextComponent in Maven

dusty herald
maiden briar
#

But I can import the class

#

And IntelliJ doesn't give any problem

#

Yes I done it exactly as that

wraith rapids
#

oh well then clearing caches won't help

#

caches cause the ide to scream about issues that don't exist

maiden briar
#

Yes

torn shuttle
#

alright so I've been putting off going to bed for 4 hours now, I think it's a losing battle

wraith rapids
#

sleep is for the weak

torn shuttle
#

gn, dream of my class names

maiden briar
torn shuttle
#

says the man so worried about his circadian rhythm that he turned his entire OS into a horror movie

#

meanwhile I started working at 8 pm

wraith rapids
#

like i said it's not exclusively about circadian rythm

torn shuttle
#

no,. but it makes for a good zinger

wraith rapids
#

that's just why I chose red over the other colors

torn shuttle
#

never let facts get in the way of a good joke

covert bluff
#
[21:11:56 ERROR]: Could not pass event EntityDamageByEntityEvent to KitSelector v0.0.1
java.lang.NullPointerException: null
        at me.notprankster.kitselector.events.EntityDamageListener.onEntityDamage(EntityDamageListener.java:18) ~[?:?]
#

help

#
public void onEntityDamage(EntityDamageByEntityEvent event) {
        Set<Player> invinciblePlayers = InventoryClickListener.invinciblePlayers;
        if (event.getDamager() instanceof Player) {
            Player damager = (Player) event.getDamager();

            if (invinciblePlayers.contains(damager)) {
                event.setCancelled(true);
            }
        }

        if (event.getEntity() instanceof Player) {
            Player plr = (Player) event.getEntity();

            if (invinciblePlayers.contains(plr)) {
                event.setCancelled(true);
            }
        }
    }
}
wraith rapids
#

the exception has all of the information you need

covert bluff
#

yea but i don't get why

#

invinciblePlayers can't be null

wraith rapids
#

if it says it's null then it's null

maiden briar
#

Sometimes I think the same, Java always gets it right

covert bluff
#
public static Set<Player> invinciblePlayers;
#

is this a correct way of declaring sets

#

or did i do itw rong

maiden briar
#

No

torn shuttle
#

not initialized

wraith rapids
#

you are declaring a field

maiden briar
#

new HashSet

wraith rapids
#

the field is empty

#

it has no object

#

it points at no object

#

it is a null-pointer

#

it is null

covert bluff
#

i see

maiden briar
#

This is the same as public static Set<Player> invinciblePlayers = null;

covert bluff
#

i am completely stupid

wraith rapids
#

you need to assign something in the field

#

= something

covert bluff
#

public static Set<Player> invinciblePlayers = new HashSet<Player>();

#

like this then?

wraith rapids
#

myes

maiden briar
#

Yes

covert bluff
#

thanks

torn shuttle
maiden briar
#

Haha

covert bluff
#

why cant my server launch

#

it says can't keep up with server something running 67109 ticks behind

wraith rapids
#

try not running it on a raspberry pi

chrome beacon
#

Your PC is a bit overloaded

covert bluff
#

i play on a new hp laptop with intel pentium 4 1.2 hz and intel hd graphics and 2gb ram

#

is that enough for server

wraith rapids
#

seemingly not

#

don't underestimate how heavy the server is

#

it is very heavy

covert bluff
#
 new BukkitRunnable() {
            @Override
            public void run() {
                invinciblePlayers.remove(p);
            }
        }.runTaskLater(KitSelector.getInstance(), invincibilityTime*20L);
#

is this fine

#

cause i don't have much experience with things like these

#

i could be missing something like a way beter method

#

it works fine i guess

wraith rapids
#

Bukkit.getScheduler().runTaskLater(() -> invinciblePlayers.remove(p), invincibilityTime*20L);

minor garnet
#
watcher.register(new DataWatcherObject<>(7, DataWatcherRegistry.a), new Byte((byte) 1));``` i really cant understand how to solve this problem 

java.lang.ClassCastException: java.lang.Byte cannot be cast to java.lang.Float at vp.cd(SourceFile:711) ~[vp.class:?] at bib.t(SourceFile:1610) ~[bib.class:?]
#

this is problem intern of minecraft client

wheat dagger
#

What is the type of DataWatcherRegistry.a ?

tribal holly
#

can we call paper event inside a spigot server (with maven import) (i think have the answer but i wanna be sure)

kind coral
#

there is yellow flower but not red flower?

opal juniper
kind coral
#

Poppy

#

btw at the end it was red rose idk why

opal juniper
#

ah ok

granite stirrup
#

อœออž อœออž| อœออž| อœออž| อœออž| อœออž| อœออž| อœออž | อœออž อœออž|อœออž อœออž| อœออž| อœออž| อœออž| อœออž| อœออž| อœออž | อœออž อœออž|อœออž อœออž| อœออž| อœออž| อœออž| อœออž| อœออž| อœออž | อœออž อœออž|อœออž อœออž| อœออž| อœออž| อœออž| อœออž| อœออž| อœออž | อœออž อœออž|อœออž อœออž| อœออž| อœออž| อœออž| อœออž| อœออž| อœออž | อœออž อœอ| ladder

rigid hazel
#

How I can code a program, that moves a player to another server in bungee network?

paper viper
#

What should be the exception I would throw if I only want one library instance per plugin but someone decides to create a library twice for one plugin (which should be illegal)
IllegalStateException?

rigid hazel
#
if(player.isOnline() && player instanceof ProxiedPlayer) // line 44
                {
                    ServerInfo serverInfo = ProxyServer.getInstance().getServerInfo(server);
                    ((ProxiedPlayer) player).connect(serverInfo);
                    sender.sendMessage("ยงaDer Spieler wurde erfolreich auf den anderen Server verschoben.");
                }
                else {
                    sender.sendMessage("ยงcThe player isn't online!");
                }```
#
[16:36:58 ERROR]: null
org.bukkit.command.CommandException: Unhandled exception executing 'ccn redirect freebuild Verox007' in de.cimeyclust.commands.CCNetworkCommand(ccnetwork)
        at org.bukkit.command.SimpleCommandMap.dispatch(SimpleCommandMap.java:169) ~[patched_1.16.5.jar:git-Paper-611]
        at org.bukkit.craftbukkit.v1_16_R3.CraftServer.dispatchCommand(CraftServer.java:810) ~[patched_1.16.5.jar:git-Paper-611]
        at net.minecraft.server.v1_16_R3.PlayerConnection.handleCommand(PlayerConnection.java:2170) ~[patched_1.16.5.jar:git-Paper-611]
Caused by: java.lang.NullPointerException
        at de.cimeyclust.commands.CCNetworkCommand.execute(CCNetworkCommand.java:44) ~[?:?]
        at org.bukkit.command.SimpleCommandMap.dispatch(SimpleCommandMap.java:159) ~[patched_1.16.5.jar:git-Paper-611]
        ... 18 more```
#

I have this error with this code. Can someone help me?

#

I use this on a child server of the bungee server.

#

Could this be the error?

eternal night
#

why are you using bungee cord api on a spigot server

#

you cannot use the bungee cord classes on a "child" server

#

the bungee api is only valid for bungee cord plugins

young knoll
quaint mantle
#

Do you know how to use ansi in spigot getLogger#log();?

#

i couldn't find any way in google

tribal holly
rare hazel
#

Does anyone know a consistent way to connect player to a server on a PostLoginEvent? Or do i need to use another event? (BungeeCord)

quaint mantle
#

But I'll try it in great detail.

young knoll
#

As mentioned it depends on the console

#

I don't think most shared hosts implement colors

quaint mantle
#

As expected, it's the same. But thank you! ee(NoColor) < logged msg new ColoredLogger("e", '0').log(java.util.logging.Level.INFO, "e"); < code

rigid hazel
#
String server = args[1];
                Player player = Bukkit.getPlayerExact(args[1]);

                if(player.isOnline()) // line 44
                {
                    ByteArrayDataOutput out = ByteStreams.newDataOutput();
                    out.writeUTF("ConnectOther");
                    out.writeUTF(player.getName());
                    out.writeUTF(server);

                    player.sendPluginMessage(this.plugin, "BungeeCord", out.toByteArray());
                    sender.sendMessage("ยงaDer Spieler wurde erfolreich auf den anderen Server verschoben.");
                }
                else {
                    sender.sendMessage("ยงcThe player isn't online!");
                }```
#
org.bukkit.command.CommandException: Unhandled exception executing 'ccn redirect test Verox001' in de.cimeyclust.commands.CCNetworkCommand(ccnetwork)
        at org.bukkit.command.SimpleCommandMap.dispatch(SimpleCommandMap.java:169) ~[patched_1.16.5.jar:git-Paper-611]
        at org.bukkit.craftbukkit.v1_16_R3.CraftServer.dispatchCommand(CraftServer.java:810) ~[patched_1.16.5.jar:git-Paper-611]
        at net.minecraft.server.v1_16_R3.PlayerConnection.handleCommand(PlayerConnection.java:2170) ~[patched_1.16.5.jar:git-Paper-611]
        at net.minecraft.server.v1_16_R3.PlayerConnection.c(PlayerConnection.java:1985) ~[patched_1.16.5.jar:git-Paper-611]
        at net.minecraft.server.v1_16_R3.PlayerConnection.a(PlayerConnection.java:1938) ~[patched_1.16.5.jar:git-Paper-611]
        at net.minecraft.server.v1_16_R3.PacketPlayInChat.a(PacketPlayInChat.java:50) ~[patched_1.16.5.jar:git-Paper-611]
        at net.minecraft.server.v1_16_R3.PacketPlayInChat.a(PacketPlayInChat.java:8) ~[patched_1.16.5.jar:git-Paper-611]
        at net.minecraft.server.v1_16_R3.PlayerConnectionUtils.lambda$ensureMainThread$1(PlayerConnectionUtils.java:35) ~[patched_1.16.5.jar:git-Paper-611]
        at net.minecraft.server.v1_16_R3.TickTask.run(SourceFile:18) ~[patched_1.16.5.jar:git-Paper-611]```
#
        at net.minecraft.server.v1_16_R3.IAsyncTaskHandlerReentrant.executeTask(SourceFile:23) ~[patched_1.16.5.jar:git-Paper-611]
        at net.minecraft.server.v1_16_R3.IAsyncTaskHandler.executeNext(IAsyncTaskHandler.java:109) ~[patched_1.16.5.jar:git-Paper-611]
        at net.minecraft.server.v1_16_R3.MinecraftServer.bb(MinecraftServer.java:1262) ~[patched_1.16.5.jar:git-Paper-611]
        at net.minecraft.server.v1_16_R3.MinecraftServer.executeNext(MinecraftServer.java:1255) ~[patched_1.16.5.jar:git-Paper-611]
        at net.minecraft.server.v1_16_R3.IAsyncTaskHandler.awaitTasks(IAsyncTaskHandler.java:119) ~[patched_1.16.5.jar:git-Paper-611]
        at net.minecraft.server.v1_16_R3.MinecraftServer.sleepForTick(MinecraftServer.java:1216) ~[patched_1.16.5.jar:git-Paper-611]
        at net.minecraft.server.v1_16_R3.MinecraftServer.w(MinecraftServer.java:1130) ~[patched_1.16.5.jar:git-Paper-611]
        at net.minecraft.server.v1_16_R3.MinecraftServer.lambda$a$0(MinecraftServer.java:289) ~[patched_1.16.5.jar:git-Paper-611]
        at java.lang.Thread.run(Thread.java:834) [?:?]
Caused by: java.lang.NullPointerException
        at de.cimeyclust.commands.CCNetworkCommand.execute(CCNetworkCommand.java:44) ~[?:?]
        at org.bukkit.command.SimpleCommandMap.dispatch(SimpleCommandMap.java:159) ~[patched_1.16.5.jar:git-Paper-611]
        ... 18 more```
#

Help please.

rigid hazel
tribal holly
#

read the error

rigid hazel
#

The player is null.

#

Yes.

#

But why?

#

Can you explain it to me?

eternal night
#

are you using the same string (args[1]) to identify the server and the player ? xD

tribal holly
#

yes it is

rigid hazel
#

Okay.

#

Thanks.

#

It worked

tribal holly
#

read the error as i said, if you have a NPE just look the object you trying to work with

rare hazel
#

Does anyone know why this only work sometimes?
@EventHandler public void onJoin(PostLoginEvent postLoginEvent) { ProxiedPlayer player = postLoginEvent.getPlayer(); ServerInfo serverInfoMain = ProxyServer.getInstance().getServerInfo("Main"); player.connect(serverInfoMain); }

tribal holly
#

what ?

opal juniper
#

The work load thread is just the thread that actually does the computation?

tribal holly
#

i think (i begin in this so i continue to learn how it work)

#

just when i start it, it compute only once

#

or did i setup wrong my workeloadThread ?

#
workloadThread = new WorkloadThread();
        System.out.println("Start filling queue");
        for (int x = 0; x <= maze.length; x++) {
            for (int y = (int) origin.getY(); y <= origin.getY() + 20; y++) {
                for (int z = 0; z <= maze.length; z++) {
                    workloadThread.addLoad(new WallBreaker(origin.getWorld(), (int) (origin.getX() + x), y, (int) (origin.getZ() + z)));
                }
            }
        }
        System.out.println("Start task");
        workloadThread.run();```
#
@AllArgsConstructor
public class WallBreaker implements Workload {

    private final World world;
    private final int x;
    private final int y;
    private final int z;


    @Override
    public void compute() {
        Block block = world.getBlockAt(x, y, z);

        if (block.getType() == Material.SMOOTH_SANDSTONE)
            block.setType(Material.AIR);
    }
}```
#

(i know set type is a very slow method but it's just to test the workload system)

quaint mantle
#
@EventHandler
    public void onJoin(AsyncPlayerPreLoginEvent e){
        Bukkit.broadcastMessage("Humanoid is joining, fuck off");
        e.setLoginResult(AsyncPlayerPreLoginEvent.Result.KICK_BANNED);
        e.disallow(AsyncPlayerPreLoginEvent.Result.KICK_BANNED, "bye");
    }``` Message is broadcasted, player still joins.
#

Fixed by changing to PlayerPreLoginEvent

#

#Just1.8Things

weak mauve
#

hi, im making power orbs but this piece of code buff NPCs (Citizens with "player" type), how i can prevent that?

    protected void buff(Player player)
    {
        player.setHealth(Math.min(player.getMaxHealth(), player.getHealth() + (player.getMaxHealth() * 0.02)));
        PlayerStatistics statistics = PlayerUtils.STATISTICS_CACHE.get(player.getUniqueId());
        PlayerUtils.boostPlayer(statistics, new PlayerBoostStatistics()
        {
            @Override
            public String getDisplayName()
            {
                return null;
            }
            @Override
            public Rarity getRarity()
            {
                return null;
            }
            @Override
            public GenericItemType getType()
            {
                return null;
            }
            @Override
            public double getBaseStrength()
            {
                return 10;
            }
        }, 20);
        statistics.boostManaRegeneration(0.5, 20);
    }
quaint mantle
#

you're trying to prevent NPCs from getting this effect?

weak mauve
#

yes

#

cause

#

the 'statistics' cannot exist on NPCs

wraith rapids
#

i don't remember what the way to tell citizens npcs apart from real players was

#

you could always depend on their api I suppose

#

@tribal holly

can we call paper event inside a spigot server (with maven import) (i think have the answer but i wanna be sure)
yes but no

#

you can have the logic for it in place

#

but you mustn't refer to the event directly

quaint mantle
wraith rapids
#

because the event class is not present in the spigot environment

quaint mantle
#

Pretty sure the NPC's aren't part of the online player list

wraith rapids
#

meaning any class that strongly deferences that class will explode

weak mauve
# wraith rapids you could always depend on their api I suppose
                for (Entity entity : stand.getNearbyEntities(18, 18, 18))
                {
                    if (!(entity instanceof Player)) continue;
                    Player p = (Player) entity;
                    if (c >= 5) break;
                    c++;
                    if (USING_POWER_ORB_MAP.containsKey(p.getUniqueId()))
                    {
                        if (!USING_POWER_ORB_MAP.get(p.getUniqueId()).equals(stand)) continue;
                    }
                    USING_POWER_ORB_MAP.put(p.getUniqueId(), stand);
                    new BukkitRunnable()
                    {
                        public void run()
                        {
                            USING_POWER_ORB_MAP.remove(p.getUniqueId());
                        }
                    }.runTaskLater(Spectaculation.getPlugin(), 20);
                    buff(p);
                    for (int i = 0; i < 8; i++)
                        playEffect(p.getLocation().add(SUtil.random(-0.5, 0.5), 0.1, SUtil.random(-0.5, 0.5)));
                }
                stand.setCustomName(sItem.getRarity().getColor() + (getCustomOrbName() == null ? getBuffName() : getCustomOrbName()) +
                        " " + ChatColor.YELLOW + Math.max(0, seconds.decrementAndGet()) + "s");
            }
#

i have this

#

instance of player

tribal holly
quaint mantle
#
  // it's not an NPC, return;
}```
#

@weak mauve

weak mauve
#

oh

#

nice

wraith rapids
#

don't return, continue

weak mauve
#

ik

quaint mantle
#

correct

#

whatever the use case might be

#

You can also just use Citizens' api assuming that's where these ncps are coming from

weak mauve
#

xcannot find symbol
[ERROR] symbol: variable world

quaint mantle
#

I'm making a server where it's just 1 server & I need to handle bans, I'm used to handling bans in the bungee server but now I can't, what's the best way to check for bans upon joining/connecting? this requires database requests.

wraith rapids
#

listen to async player prelogin event

#

do the db request there

quaint mantle
wraith rapids
#

you can prevent the player from connecting

tribal holly
#

Someone know about workloader ?

wraith rapids
#

set the result to deny

quaint mantle
#

I can't, setting their login result to KICK or some bs just lets them login regardless

wraith rapids
#

this is false

quaint mantle
#

Sure

wraith rapids
#

AsyncPlayerPreLoginEvent::disallow

#

prevents the player from joining

#

the player won't be allowed to join before all event handlers have processed the event, and since the execution happens off the main thread, you can block with your db request for up to 30 seconds

#

after your db request completes, you can either choose to allow or disallow it

#

the latter of which will prevent the player from connecting

quaint mantle
weak mauve
#

ummm

#

it said

#

world cannot be resolved

wraith rapids
#

yeah i don't know what i'm looking at but denying the prelogin event prevents the connection

weak mauve
#

help

wraith rapids
#

then make the world resolved

weak mauve
#

its the whole point i asking

quaint mantle
#
    @EventHandler
    public void onJoin(AsyncPlayerPreLoginEvent e){
        Bukkit.broadcastMessage("Get the fuck outta here;");
        e.setLoginResult(AsyncPlayerPreLoginEvent.Result.KICK_BANNED);
        e.disallow(AsyncPlayerPreLoginEvent.Result.KICK_BANNED, "nibba");
        Bukkit.broadcastMessage("Bet you're still here...");

    }```
wraith rapids
#

if that absolutely doesn't work for whatever reason, then preload the data required for kicking or otherwise preventing the connection during async prelogin

quaint mantle
#

This still lets them log in just fine

wraith rapids
#

then you're doing something wrong

#

because it works just fine for me

weak mauve
wraith rapids
#

my point is do the db query in async prelogin, as it is async

#

then do whatever you want with the data you get, whenever you want

quaint mantle
#

No, I knew this wasn't an option because the same thing happens with AsyncChatEvent, I'm pretty sure the async events are just placebos in 1.8's spigot

wraith rapids
#

what

sage swift
#

chat is definitely async

wraith rapids
#

async prelogin events are asynchronous from the main thread

#

async chat may or may not be

quaint mantle
#

I can't change the format or even cancel it for that matter when using AsyncChat, only when using ChatEvent I can actually change things

wraith rapids
#

๐Ÿ‘€

#

works fine for me strangely enough

quaint mantle
#

I'm on 1.8 like I said

wraith rapids
#

shouldn't have any effect on it

quaint mantle
#

I don't know what it is

wraith rapids
#

well, do what I said

#

you don't need to use disallow

quaint mantle
#

Yeah i'll look into that

wraith rapids
#

just do the query asynchronously

quaint mantle
#

I can just kick them

#

Sounds good

wet breach
#

chat is async until some plugin decides to do something with it, then it becomes sync

weak mauve
#

how to make the world resolved

#

help

quaint mantle
#

World is null?

weak mauve
#

i hover into the bulb and its said

#

world cannot be resolved

quaint mantle
#

You're defining the world before it actually loaded.

wet breach
sage swift
#

no lol

#

he probably has a variable named world

#

which he hasnt defined

weak mauve
sage swift
quaint mantle
#

I'm assuming you're working with locations?

weak mauve
# quaint mantle I'm assuming you're working with locations?
                    if (!(entity instanceof Player)) continue;
                    Player p = (Player) entity;
                    if (c >= 5) break;
                    c++;
                    if(world.getOnlinePlayers().contains(player)) continue;
                    if (USING_POWER_ORB_MAP.containsKey(p.getUniqueId()))
                    {
                        if (!USING_POWER_ORB_MAP.get(p.getUniqueId()).equals(stand)) continue;
                    }
                    USING_POWER_ORB_MAP.put(p.getUniqueId(), stand);
quaint mantle
#

...

#

So you're just a noob

weak mauve
quaint mantle
#

:haha:

#

replace world with entity.getWorld()

wraith rapids
#

learn java basically

weak mauve
#

wait

#

i defined it already i think

sage swift
#

clearly not

weak mauve
quaint mantle
#

Looking back at it knowing you just don't understand java and referring to the error as a bulb makes me laugh a little

wet breach
#

lmao

wraith rapids
#

a bulb

wet breach
#

probably referring to the icon in the IDE

wraith rapids
#

myes

quaint mantle
#

This magic bulb told me that world isn't defined? HEEEEELP

quaint mantle
#

Let me guess, you did World world; & called it a day?

sage swift
#

i can show you the world

#

something something something

quaint mantle
#

The magic world of wonders

wet breach
wraith rapids
#

my world is the barrel i live in

weak mauve
quaint mantle
#

๐Ÿค”

#

man this server is shitty for disabling nitro emotes

weak mauve
#

yes but somehow it works

wraith rapids
#

yeah this is a no fun zone

quaint mantle
#

so I hear

wraith rapids
#

you need to be a cuck and pay server boosts to get to use emojis and shit

#

there are like 3 channels and the staff are basically dead

wraith rapids
#

in a word this discord as a whole is pretty shit

#

this help channel doesn't even have any pins

quaint mantle
#

the lord already knows i'm not about to waste 3 dollars a month to use my nitro emotes in a specific Discord server

wraith rapids
#

it's like they don't care at all

weak mauve
#

yes i want to test if the orb still buff player but forgot to install citizens

wet breach
weak mauve
#

my entire life is a circus

wraith rapids
#

why even have a discord guild if you're just going to let it rot

wet breach
#

because it is free

wraith rapids
#

he does it for free

quaint mantle
#

Meh why not, you've got people like you and me still using it.

wraith rapids
#

they should put some effort into it

wet breach
#

why?

wraith rapids
#

not like the forums are any better anyway

wet breach
#

forums are far better for information storing then discord is

quaint mantle
#

Maybe some magic bulb tooltip will magically make them care

wraith rapids
#

yeah but compared to bukkit forums they're extremely lackluster

wet breach
#

bukkit didn't make its own forums

wraith rapids
#

if the forums are the thing they're focusing on they could at least make them good

wet breach
#

Bukkits website was/is managed by curse

wraith rapids
#

and spigot's is some 3 dollar stock xenforo design

wet breach
#

Spigot doesn't have such a sponsor

weak mauve
#

i use bukkit.getOnlinePlayers and its work

wraith rapids
#

good job

weak mauve
#

why i became a clown when i can become not a clown

wet breach
weak mauve
#

cause my entire life... is a circus

wraith rapids
#

my complaint is that everything about it is bleh and either rotting to shit or mediocre

wet breach
#

so, you are upset because spigot chose to not toss a ton of money to its website

wraith rapids
#

replace money with effort and ton with decent amount and you're mostly right

wet breach
#

time is money mostly, that includes effort

wraith rapids
#

yes but effort has more soul

tribal holly
#

Hi, someone know why my workLoad run stop after few compute done ? and how to make it compute until the workload is empty ?```java
@Override
public void run() {
long stopTime = System.currentTimeMillis() + MAX_MS_PER_TICK;

    while (!workloadDeque.isEmpty() && System.currentTimeMillis() <= stopTime) {
        workloadDeque.poll().compute();
        System.out.println(workloadDeque.size());
    }
}```
wraith rapids
#

because you're telling it to stop when the queue is empty

tribal holly
#

yep but when it stop he is not empty

wet breach
#

Well, the website serves its purpose for what it is for, can't ask for more when it doesn't charge you to use it.

tribal holly
wraith rapids
#

then it has reached stopTime

tribal holly
#

3.5Millions remain

wraith rapids
#

you are also telling it to stop if it reaches stoptime

#

which it does

pastel basin
#

Heya!

I'm looking for a way to get the durability of a pickaxe. Tought about using getItemInMainHand().getDurability(); but I see it's **Deprecated **. Tried to find another function to get this data, but could not find it. Any tips?

wraith rapids
#

read the note about deprecation

tribal holly
#

yep to avoid overHead the tick as the 7smile7 tutoriel explain

wraith rapids
#

on the javadocs, it says why it's deprecated and it probably mentions a replacement

tribal holly
#

but i don't understand how he is doing to make it repeat every tick begin until is not empty

wraith rapids
#

i don't know what you're talking about

tribal holly
#

(i can send back the 7smile7 tutorial link)

tribal holly
wraith rapids
#

@lost matrix help this man

tribal holly
#

i was afraid to ping him

wraith rapids
#

real men don't know fear

tribal holly
#

hahaha

wraith rapids
#

the gayest

#

looking at this guide it probably expects you to schedule a repeating task rather than a single task

tribal holly
#

yep i was thinking about this but as he said in spigot we can't call every tick Start because we don't know

#

and he talk about some kind of tps check

#

but don't specify how

wraith rapids
#

ideally you would use paper's getMspt to see how much free time you have

tribal holly
#

yep but can't use paper event inside spigot server

wraith rapids
#

and then allocate like 30% of that

#

yeah well that's why more than 60% of people don't run their shit inside spigot servers

tribal holly
#

i begin to know about this but i wanna make it on spigot

#

and maybe after shade it to paper

wraith rapids
#

what is this project for again

#

like what are you making

tribal holly
#

do you want github link ?

wraith rapids
#

does your github describe your project concisely

tribal holly
#

in french yes but google translate

wraith rapids
#

then no i do not want the github link

tribal holly
#

to late

#

in few world a maze mini-game with god and abilities

wraith rapids
#

are you're that guy with the dungeon plugin

tribal holly
#

huuuu

#

that not was YOUR plugin ?

#

i remember talking to you about async task make on other thread

wraith rapids
#

i remember talking to someone who was working on a dungeon plugin about my dungeon plugin

#

so that was probably you

tribal holly
#

huu nop i'm not so

#

it's not a dungeon plugin

#

even if the maze contain dungeon

wraith rapids
#

it definitely looks like a dungeon plugin

tribal holly
#

if you want

wraith rapids
#

looks interesting i suppose

#

lmk when you've written it in english and built it against paper

#

might give it a try

tribal holly
tardy delta
#

whats the best way I can handle this: i have an ArrayList with objects stored and I want to return the object with the highest value (the method xFactor() returns it)

wraith rapids
#

how often is this arraylist modified

#

how often do you need to get the highest value

tardy delta
#

just when i execute the method

wraith rapids
#

that answers exactly zero of my questions

tribal holly
#

just need a quantic computer to do this fast

tardy delta
#

its only modified when i add an object

wraith rapids
#

no shit

tardy delta
#

and thats only in the beggining

wraith rapids
#

so you're reading more than you're writing

tardy delta
#

yes

wraith rapids
#

do you also need to get the highest values of other kinds, like yFactor() or whatever

tardy delta
#

well the objects have only one method and thats xFactor() which returns a double and i need to get the object with that highest double

wraith rapids
#

sort the list

tardy delta
#

its a school exercice

#

im not supposed to do this

wraith rapids
#

Collections.sort(list, Comparator.comparing(element -> element.xFactor()))

#

if you can't sort it, iterate over the list and find the highest value

tribal holly
#

algorithme exercise i see

tardy delta
#

yes i have a for loop

wraith rapids
#

you should exceed expectations

tardy delta
#

wut im figuring out how to do it

wraith rapids
#

write a heapsort algorithm and use it to sort the list

young knoll
#

Offload the operation onto a server in India

tardy delta
#

lmao

tribal holly
#

In computer science, a sorting algorithm is an algorithm that puts elements of a list in a certain order. The most frequently used orders are numerical order and lexicographical order. Efficient sorting is important for optimizing the efficiency of other algorithms (such as search and merge algorithms) that require input data to be in sorted lis...

tardy delta
#

do you think I've already learned that?

wet breach
wraith rapids
#

the point is that you haven't learned it yet

#

so you should exceed expectations by learning it

tardy delta
#

its a exercice so i would be able to solve it

wet breach
#

you should think of it as something more then an exercise problem as this problem is something you will run into constantly in various forms regardless of the project/code language you use

wraith rapids
#

now that we're on the subject matter of sorted shit

#

does anybody know any actually navigable map implementations

#

i know java has "navigable" maps like treemaps

#

but in order to "navigate" from one entry to the next or the previous one, you need to search through the entire tree all the way from the root every time

#

which is just a colossal waste of time

wet breach
#

concurrentnavigablemap is a thing

#

could also look at using ConcurrentSkipListMap

lilac dagger
#

create one

wraith rapids
#

i'm not seeing a way of navigating about the former without passing the current entry's key to higher/lowerEntry

#

which has to go through the entire tree to find the next entry

lilac dagger
wraith rapids
#

i want to maintain a pointer within the sorted map and be able to move that pointer forward and backward at will

#

the use case is a list of trade offers that is modified relatively frequently by adding/removing entries

#

the pointer itself is mostly used for paginated views of the list

#

i'm using a tree map for it but navigating to the next/previous entry in a treemap involves going through the entire map to find the next key that is greater/lower than the key I'm currently at

#

in logarithmic time, sure, but still needs to go through the tree all the way from the root

#

f.e via a next()/back() method on the returned entry itself

lilac dagger
#

uhm

#

it doesn't have pointers?

#

to navigate between the nodes?

#

maybe you're not checking the TreeMap's methods

#

since i bet navigable map is pretty weakly defined

wraith rapids
#

well I may be blind but I'm not seeing them

#

what methods are you talking about

wet breach
#

could look at using treemultimap or make your own custom multimap

wraith rapids
#

i guess i'll just have to write it myself

#

should be relatively simple

#

just need to maintain a linked list of the entries and then have methods on the entries returning the next/previous elements

lilac dagger
#

treemap.entryset?

wraith rapids
#

doesn't have a 2-way iterator from what I can see

lilac dagger
#

why would you wanna return?

wraith rapids
#

because the user might want to go back to the previous page

lilac dagger
#

you could hold a stack history yourself then

wraith rapids
#

the list could get modified at any time

lilac dagger
#

but i guess you can't have a tree map view of the prev node then

#

i don't think a tree map is your solution here

#

you need a custom build system

wraith rapids
#

what I need is a treemap that lets me move to the next and previous nodes on demand

#

sadly one doesn't seem to exist

keen kelp
#

What's the difference between gradle, maven and the artifact thing

wraith rapids
#

it should be a tree as that makes insertions and finding the nearest values to specific queries fast

keen kelp
#

Im always confused by this

wraith rapids
#

and it should be linked as that makes modifications fast

#

and since it's linked it can't be random access

#

which disqualifies binary searches as a replacement for the tree structure

lilac dagger
#

it allows you primarily to attach dependencies

#

or run tasks

#

the difference between them, i dunno

#

i guess the syntax

#

and some nice to haves

keen kelp
lilac dagger
#

that's a part of it

#

not always tho

#

it's mostly so users don't have to scour for the files

#

they can download them

storm garden
#

How to get current server version with the spigot API?

wraith rapids
#

the most notable part about it is that it automatically downloads and links the dependencies you're using with your ide

lilac dagger
#

Bukkit.getVersion

wraith rapids
#

for example, if you use your IDE alone to import spigot api

storm garden
wraith rapids
#

you won't have access to the bungee chat components

#

because those aren't actually in the spigot api jar

keen kelp
#

Unless I use the full spigot

wraith rapids
#

but if you use maven/gradle, it will see that spigot api includes bungeecord-chat

#

and automatically downloads the bungeecord chat dependency as well

keen kelp
#

So does gradle/maven have anything to do with the finish product?

wraith rapids
#

it can

#

not not necessarily

keen kelp
#

I see

wraith rapids
#

you can make it shade stuff in, relocate stuff around

keen kelp
#

Can it help in reducing the file size then

wraith rapids
#

automatically fill plugin.yml placeholders with project variables

#

filesize is one of the most irrelevant things in development

keen kelp
#

Cause idk what I did but the plugin went from 1.3m to 40m