#dev-general

1 messages ยท Page 305 of 1

onyx loom
#

๐Ÿฅฒ

prisma wave
#

๐Ÿฅฒ

obtuse gale
#

lol

hot hull
old wyvern
#

push current

onyx loom
#

bm are u keeping the links mainly functional?

#

in the randomizer

prisma wave
#

yep

#

functional only

old wyvern
#

Add elara

hot hull
#

pushed, added a limit so it only generates a single chunk, easier debugging

onyx loom
#

was gonna say scala but ig thats too much oop

surreal quarry
onyx loom
#

lol

jovial warren
onyx loom
surreal quarry
prisma wave
#

lmao

surreal quarry
prisma wave
#

scala is fine

#

ill add it

jovial warren
#

@prisma wave I dare you to throw a link to never gonna give you up in there just for kicks

#

omfg that took a while

#

that took like 30 seconds

surreal quarry
#

lmao do it

jovial warren
#

yeah

#

or just same chance as the others

#

just throw it in the list

unkempt tangle
#

Senpai

#

Or bom

#

lets play ;c

trim niche
#

Is there another way to do this? @surreal quarry

surreal quarry
#

use 1.14+ to make nbt easier ๐ŸŒš
if they all will have the same name you could technically check the items displayname, but its better to just use nbt

prisma wave
old wyvern
#

Frost, its just that perlin value is almost always negative I think

#

noise * 2 - 1
Did you mean this to bring it up to a positive range?

#

Because it doesnt neccessarily do that

#

@hot hull

hot hull
#

yeye I'm here :p

#

uh that's the idea yea, the value should always be positive

old wyvern
#

Yea you just need to add the absolute value of the minimum

#

noise * 2 - 1 is negative if noise is negative

jovial warren
old wyvern
#

for eg:
-0.5 * 2 - 1
= -1 -1 = -2

hot hull
#

I see

#

Seems to have another issue lol

#

Although 1 value is 1, so that's promising I guess?

prisma wave
#

Cuz yeah it could be

#

Although I think I had a specific reason for making HandshakeData mutable

onyx loom
#

what happened to "immutability only"

jovial warren
#

also going to change the address to be an InetAddress and the next state to be a PacketState

prisma wave
#

I made a terrible mistake

jovial warren
#

and refactoring this in OTBS

prisma wave
#

No

#

Allman

old wyvern
jovial warren
#

from string and int

#

ffs why did that take so long

prisma wave
#

O

#

I think the idea for the packet data classes was they were the unprocessed data

jovial warren
#

using a custom extension, fun String.toInetAddress() = InetAddress.getByName(this) because Kotlin fingerguns

prisma wave
#

just POJOs

jovial warren
#

ah right

#

yeah I'm basically making classes that look like they could fit in the API

jovial warren
prisma wave
#
extend String {
    let toInetAddress = InetAddress.getByName
}
``` :slight_smile:
#

K&R bad

surreal quarry
#

no

jovial warren
#

it's either convert what small amount of allman we got left or convert the much larger amount of K&R OTBS

#

and can we pleeeeeeeeeeeeeeeeeease stick by official Kotlin conventions as well

#

or at least, close enough lol

#

loosely

prisma wave
#

I will make you a deal

jovial warren
#

go for it

prisma wave
#

You can use "Kay and are" if you purge any of the ugly mutability stuff I'm sure you've done

onyx loom
#

LOL

jovial warren
#

with pleasure

prisma wave
#

okay

#

Pleasure doing business with you

jovial warren
#

also, I haven't really done that much mutable stuff in here

prisma wave
#

Hmmm

#

We'll see

jovial warren
#

except for temporary lists

prisma wave
#

Ew

ocean quartz
prisma wave
#

๐Ÿ™„

#

You look meh

ocean quartz
#

That's true

old wyvern
#

๐Ÿ˜ฎ

ocean quartz
#

๐Ÿ˜ญ

prisma wave
#

๐Ÿฅฒ

jovial warren
#

oh yeah, gl making allman work in Elara btw

#

Yugi have fun with that

#

ffs my Discord is broken

prisma wave
#

lol

jovial warren
#

I swear

prisma wave
#

parser.CleanNewLines

jovial warren
#

omfg what is this

old wyvern
#

xD

#

yea

#

Allman already works

jovial warren
#

not reading by lines?

#

gj

old wyvern
#

wdym by not reading lines?

jovial warren
#

not reading by lines

#

line by line

onyx loom
#

lol

old wyvern
#

Its not reading line by line anyway tho

jovial warren
#

good

old wyvern
#

its like a token stream

prisma wave
#

the parser is clever

#

unlike Go's

old wyvern
#

xD

jovial warren
#
    fun flagsToProtocol(): Int {
        var flagsByte = 0x00
        if (isInvulnerable) flagsByte += 0x01
        if (canFly) flagsByte += 0x02
        if (isFlyingAllowed) flagsByte += 0x04
        if (isCreativeMode) flagsByte += 0x08
        return flagsByte
    }
```on the topic of mutability btw, any way I can do this better?
unkempt tangle
#

Thats what I ask myself

#

Since java runs on JVM

#

does it support memory addresses?

prisma wave
#

uh

jovial warren
#

I need to convert 4 booleans (for the 4 abilities that are serialised into the single flags byte) into bytes

unkempt tangle
#

0x20323F

jovial warren
#

well, more asking for your acceptance tbh BM

prisma wave
unkempt tangle
#

Then why he uses 0x01

onyx loom
#

what

old wyvern
#

just a hex*value

prisma wave
#

That's just hexadecimal numbers lol

old wyvern
#

lol

unkempt tangle
#

Hm

obtuse gale
#

can't you multiply a bool with a number in your almighty Kotlin?

hot hull
prisma wave
obtuse gale
#

cpp though

#

is op

lunar cypress
#

Kapp

onyx loom
#

4 * true โ“

obtuse gale
#

yea

onyx loom
#

oh god

prisma wave
#

what's the answer

obtuse gale
#

4

prisma wave
#

4?

onyx loom
#

4

obtuse gale
#
  • false is 0
prisma wave
#

Oh because booleans are just numbers

onyx loom
#

ye

prisma wave
#

Stupid

onyx loom
#

๐Ÿ™‚

obtuse gale
prisma wave
#

I am more concerned about the mutability

#

It's not great

#

you could definitely get around it

jovial warren
#

it'll work for now

#

we can always change it

prisma wave
#

you could define a list of functions (based on the booleans), filter all applicable and then sum()

#

Ez

jovial warren
#

what?

#

omfg Discord

obtuse gale
#
const int flags = 0x01 * isInvulnerable +
                  0x02 * canFly +
                  0x04 * isFlyingAllowed +
                  0x08 * isCreativeMode;

๐Ÿ˜‰

onyx loom
#

readability stonks

jovial warren
#

piss off

obtuse gale
#

kni when

prisma wave
#
listOf (
    if (isInvulnerable) 0x01 else 0x00,
    etc
).sum()
jovial warren
#

that looks worse than my current solution

prisma wave
#

yeah but it doesn't use var

#

So

#

I see this as a win

jovial warren
#

var is fine when you moderate it

prisma wave
#

no

#

Absolutely not

jovial warren
#

if I was exposing mutable variables then I'd understand

#

but using var isn't exactly a crime

prisma wave
#

there is an entire family of languages where mutability literally does not exist

#

it is a crime

#

unless absolutely necessary

#

Also fun fact, apparently pretty much all types are erased in Haskell, so the runtime is really fast because it doesn't do any type checking at all

surreal quarry
#

wait really

obtuse gale
#

javascript doesn't do type checking either ๐Ÿฅฒ

#

just throw everything in there

#

boom

prisma wave
#

Might be misremembering

surreal quarry
#

idk how the language works but is it typed by the compiler and then they just remove that later

#

or whatever the equivalent would be to the compiler

#

or is it more like python/js with no types

prisma wave
#

yeah the compiler handles all of the type checking and things

#

And then it erases all of the types

#

Because it's already sure that everything will work

surreal quarry
#

thats pretty cool

prisma wave
#

Yeah quite clever

#

although the lazy everything has some overheads apparently

#

Since every value has to be boxed

hot hull
#

@old wyvern Do you think mapping the 0 - 1 values to a large range of let's say 60 - 180 would work in terms of approximate scale size when generating it in mc

#

Since multiplying the value by 100 ofc won't work

old wyvern
#

Yea I guess so

#

multiply by the scale you want and add an offset I guess

jovial warren
half harness
jovial warren
onyx loom
#

u p g r a d e y o u r p c

jovial warren
#

and yes, I'm aware it's a mess

half harness
jovial warren
#

how would that work?

#

also, Niall you sneaky mother fucker

#

I saw your ass join the call deafened and then just leave

heady birch
#

Same as += but looks nicer

jovial warren
#

is it nicer though?

prisma wave
#

it looks cleverer

#

they also have slightly different semantics

#

although it doesnt matter in this case

#

afaik

jovial warren
#

| is a bitwise OR isn't it

heady birch
#

And use constants make it look nicer as well

if (isInvulnerable) {
entityFlags |= FLAG_INVULNERABLE;
}

prisma wave
#

true

jovial warren
#

yeah I'm gonna use constants

obtuse gale
#

Since I'm no longer server booster

#

I would've :cct:'ed but oh well

onyx loom
#

im gonna steal that emoji

prisma wave
#

cct

#

whats that

onyx loom
prisma wave
#

aah that

obtuse gale
#

lmao

jovial warren
#

I steal

#

me has now

#

Ctrl+Shift+I

prisma wave
obtuse gale
jovial warren
#

ffs

obtuse gale
#

lol

prisma wave
obtuse gale
prisma wave
jovial warren
#

lol

obtuse gale
#

you speak Spanish ๐Ÿ‘€

jovial warren
#

learning

obtuse gale
#

o

jovial warren
#

un poco

obtuse gale
#

tbh that's a pro move, changing the language of the products you use

prisma wave
#

i had discord in french for ages

jovial warren
prisma wave
#

people complained

jovial warren
#

change it to japanese

#

me?

#

lol

obtuse gale
#

lmao

static zealot
#

no u?

jovial warren
#

donkey

static zealot
#

changed what?

#

donkey

jovial warren
#

pfp lol

#

donkey

#

eeee orrr

static zealot
#

you are a very dumb donkey

#

lmao

#

changed it back like 10 minutes later

unkempt tangle
static zealot
#

u donkey

jovial warren
#

what is it with you and impersonation blitz

static zealot
#

I am you.

#

donkey

jovial warren
obtuse gale
#

\๐Ÿ˜‰

jovial warren
#

ew get outta here with your XML trash

static zealot
#

we love XML

#

you are trash.

jovial warren
#

we hate XML

static zealot
#

donkey

jovial warren
#

you are trash

#

donkey

static zealot
#

anyways

jovial warren
#

is that a spongebob deepfake?

prisma wave
#
{ :message { :content { :emoji wink }}}
unkempt tangle
heady birch
#

Yeah they didn't have trump, if someone ever finds a trump voice generator I Need it

jovial warren
#

lol

#

wonder if it's actually a deepfake

#

sounds like it ngl

unkempt tangle
#

Just go ahead and use Voice Cloning

jovial warren
unkempt tangle
#

python is master language

jovial warren
#

for AI, I agree

#

and hackery

#

everything else? no chance

unkempt tangle
#

โค๏ธ Check out Lambda here and sign up for their GPU Cloud: https://lambdalabs.com/papers

๐Ÿ“ The paper "Flow-edge Guided Video Completion" is available here:
http://chengao.vision/FGVC/

๐Ÿ™ We would like to thank our generous Patreon supporters who make Two Minute Papers possible:
Aleksandr Mashrabov, Alex Haro, Alex Paden, Andrew Melnychuk, Angelo...

โ–ถ Play video
#

^ watch it

#

masturbating quality.

prisma wave
#

๐Ÿ‘€

dawn hinge
unkempt tangle
#

told ya.

#

soon there is only python left

heady birch
#

๐Ÿคฃ

#

There are younger, faster, safer languages out there such as RUST!

unkempt tangle
#

They dont have PyTorch

#

Or TensorFlow

heady birch
unkempt tangle
#

Btw

prisma wave
unkempt tangle
#

It's no science fiction

old wyvern
#

God

unkempt tangle
#

NO

old wyvern
#

Yes

unkempt tangle
#

You can use their method yourself.

#

colab<3

old wyvern
#

Im voting trump. Sorry

prisma wave
#

yep

#

you're only 4 months too late ๐Ÿฅฒ

old wyvern
#

Trump shall rule the world

#

Not just america

#

๐Ÿ™‚

prisma wave
#

IO America

unkempt tangle
#

And where should he build the world?

old wyvern
#

xD

unkempt tangle
#

A wall between all planets

old wyvern
#

He will build a wall above our planet

#

Protecting us from alien immigrants

#

!!

heady birch
#

WHAT

#

GIVE IT TO ME

obtuse gale
heady birch
#

@prisma wave Can I have the text for haskel?

prisma wave
#

You know, I've been hearing a lot about this language they call Haskell. I've heard its type system is very good, the best in the world, a lot of people say. And so of course the democrats are trying to discredit haskell, they're telling people lies, they're saying it's not practical, and they're claiming imperative languages are better. The American people need the truth!

heady birch
#

Lmao

#

Obama voice is out of service ๐Ÿ˜ฆ

prisma wave
#

๐Ÿ˜ฆ

heady birch
#

Wheres biden??????

#

The trump + haskell one flows pretty well

prisma wave
#

yeah it's pretty good

#

biden is too new

trim niche
#

Hey so I created an nbt for my item and everything now I want to check if the player clicked that specific item and if he did it should open up a gui the code I used is:

  @EventHandler
    public void onRightClick(PlayerInteractEvent e)
    {
        Player player = e.getPlayer();
        // We need to convert the item to an nms ItemStack.
        net.minecraft.server.v1_8_R3.ItemStack hopperNbt = CraftItemStack.asNMSCopy(player.getItemInHand());
        // Here we are checking if the item has an NBT tag.
        NBTTagCompound hopperNbtCompound = (hopperNbt.hasTag()) ? hopperNbt.getTag() : new NBTTagCompound();
        
        // Here we are checking if the player clicked the Custom item.
        if(hopperNbtCompound.hasKey("chunk-collector"))
        {
            HopperGui gui = new HopperGui();
            gui.applyHopperUI(player);
            System.out.println("It has the NBT Tag");
        }
        else
        {
            System.out.println("It doesn't have the NBT Tag");
        }
    }

it doesnt seem to work though
I think it is something to do with the if statement

lunar cypress
#

the people need the truff

static zealot
#

lmao

#

wait why the fuck did I put this here?

#

discord why do you like torturing me ๐Ÿ˜ฆ

jovial warren
#

@prisma wave this is such a pain lol

#

I'm trying to figure out a way to not use hacks.exe with session and player objects

#

passing these objects around is already getting a bit messy

#

which is what I currently do inside of beginPlayState, to assign the user's UUID and name

static zealot
#

yo anyone using gitbooks? How do I escape _? because if I put 2 it just makes the text inbetween italic.

frigid badge
#

\_ probably

static zealot
#

yeah that doesn't work.

#

forgot to mention I tried it

frigid badge
#

try _

static zealot
#

hmm doesn't seem to work

#

oh they have an entire wiki for this. found it.

#

Occasionally you'll want to use Markdown formatting characters as-is, without them initiating formatting. The simplest way to do this is to put a \ (backslash) in front of them. ๐Ÿ˜ฆ

#

fuck

#

it should be \ as expected but for me its special case I guess. will just give up for now

trim niche
half harness
jovial warren
#

anyone wanna see some whacky movement glitches with MineKraft btw?

surreal quarry
#

sure

jovial warren
#

168.119.171.28:25565

#

you gotta join first to see the bugs lol

#

you in?

surreal quarry
#

coming rn

#

what is happening lmfao

jovial warren
#

you shooting off into the distance?

surreal quarry
#

yea kinda

#

its just moving itself

jovial warren
#

actually I fuckin' know why that is

surreal quarry
#

actually im chillin now

jovial warren
#

or do I

#

yeah because I ain't moving

surreal quarry
#

oh lmao

jovial warren
#

it's moving you relative to me

surreal quarry
#

ohh

#

wild

jovial warren
#

probably me sending some whack packets

surreal quarry
#

wild

#

its getting there tho

forest pecan
#

tnt doesn't work

obtuse gale
#

lol

obtuse pulsar
#

i still didnt figure it out @unkempt tangle

#

even looking at your code, i dont see why mine doesnt work

shrewd halo
#

can someone test my anticheat plugin

obtuse gale
#

no way lmao

obtuse pulsar
#

Can someone please join me in a VC

#

I just can't explain what I'm doing wrong

#

its driving me insane

#

not even java devs in other discords has any idea

#

why is it so fucking hard so save data for coordinates

obtuse gale
#

I do have a question, why use locations as keys? You'll have to come up with a serialization/deserialization process into a single string yourself to be able to use them as keys in a format like YAML or JSON

obtuse pulsar
#

No It don't and how else would I structure it?

#

Can I please explain you what I'm trying to do in VC

obtuse gale
#

"No I don't" what??

obtuse pulsar
#

You can use it as keys

obtuse gale
#

I know what you're trying to do, you want to use locations as keys

#

My question is why

#

I didn't ask if you can or can't

#

You'll have to come up with a serialization/deserialization process into a single string yourself to be able to use them as keys in a format like YAML or JSON

obtuse pulsar
#

why cant i send images nor screenshare..

ocean quartz
#

?imgur

compact perchBOT
#
FAQ Answer:

You won't be able to upload images here directly to avoid spam, so please use https://imgur.com/ to upload images/screenshots.
You can also use a screenshot service like gyazo or jinx and post those links here.

obtuse pulsar
#

this is a dev discord

obtuse gale
#

How do i make the horizontal spacer bigger

obtuse gale
obtuse pulsar
obtuse gale
#

Okay, then you'll have to deserialize whatever Bukkit gives you into a Map manually

ocean quartz
obtuse gale
#

getKeys and getValues or whatever

obtuse pulsar
#

how can I visually show you

#

ah 2 sec

obtuse pulsar
ocean quartz
#

Well maybe if you had asked in the right channel

#

This channel is for chilling and talking about dev stuff

obtuse gale
#

Okay, let's see, when used as a key, what does a Location serialize into?

iron apex
#

@eager fern are you good with bungeecord?

unkempt tangle
#

I got a magiclly switch

iron apex
#

Can some one help me I am really IN A RUSH

iron apex
unkempt tangle
#

zero battery capacity.

#

Still runnign

iron apex
#

lol

#

can you help me

#

My one server on my bugeecord Server will not work

unkempt tangle
#

Whats wrong with it?

iron apex
#

I dont know

ocean quartz
#

This is not a support channel, and ask your question instead of asking if anyone is good with bungeecord, people will help if they know what the issue is

iron apex
#

How do i get a pic sent

unkempt tangle
#

errors?

compact perchBOT
#
FAQ Answer:

You won't be able to upload images here directly to avoid spam, so please use https://imgur.com/ to upload images/screenshots.
You can also use a screenshot service like gyazo or jinx and post those links here.

regal gale
unkempt tangle
ocean quartz
#

Don't think that's a development question either

unkempt tangle
#

^

iron apex
unkempt tangle
#

But if someone has troubles. You help

iron apex
#

ok thanks

obtuse gale
#

How do I
A) Make the JList on the left smaller (width wise)
B) Make the TextField on the right taller(Height wise)

iron apex
prisma wave
#

you're welcome ๐Ÿ˜Š

iron apex
#

๐Ÿ˜Š

obtuse gale
prisma wave
#

I guess optionals are kind of okay

forest pecan
#

I donโ€™t understand optional

regal gale
#

I am wondering if I should use Math.pow(n,2) or n*n for lazyhead

forest pecan
#

Could someone explain lol

#

Use n*n

#

Itโ€™s faster

obtuse gale
#

^

obtuse gale
regal gale
#

Ok thx

obtuse gale
#

it has some nice methods like map(Function), get, orElse(T), orElseGet(Supplier), etc

regal gale
#

Let me improve the formula

forest pecan
#

Ah I see

obtuse gale
#

ifPresent(Consumer), isPresent, and others

forest pecan
#

What if I called it on Fefo

#

If I did isPresent

#

What would it return

obtuse gale
#

IllegalStateException

#

quantum mechanics be like: I l l e g a l S t a t e E x c e p t i o n

#

huh, you can make a stream out of an optional

#

tbh Streams and Optional kind of go hand in hand, findFirst, findAny, and they have methods to work with each other, it's nice

#

hello i need help

remote goblet
#

hello why do you need help

obtuse gale
regal gale
#

No idea what you're even trying to show there

half harness
obtuse gale
ocean quartz
half harness
remote goblet
#

@ocean quartz do you have an code examples on how you did pagination in guis, you usually save me with stuff im too smol brain to do

remote goblet
#

i love you sometimes

#

no homo tho

obtuse gale
#

im not gay but NOBODY should be lonely on valentines day amiright

obtuse gale
#

there's a lot of fancy stuff in there

quiet depot
#

indeed

#

look for something called undo size

#

or it might be undo count

#

idk

#

it's got the word "undo" in it though

#

@obtuse gale

obtuse gale
#

yeah it was something on clipboard.history.size or something

quiet depot
#

that doesn't sound like it

#

undo.documentUndoLimit

#

I think ij lowered it recently

#

because I swear I used to be able to do huge undos

#

but then recently, like you, I also had to put the limit up

obtuse gale
#

hm

#

tf is the global one about

#

like files n stuff?

quiet depot
#

when u undo file creations and shit

obtuse gale
#

ugh

quiet depot
#

and refactors

#

and all that fun stuff

obtuse gale
#

I kinda need those often xD

quiet depot
#

yea just put both to 1000

obtuse gale
#

are they that much of a memory hog?

quiet depot
#

idk

obtuse gale
#

lmao

quiet depot
#

i don't worry about memory usage ๐Ÿ˜‰

obtuse gale
#

why do i feel like ive heard this name before

#

Konstantin Bulenkov

quiet depot
#

32gb gang

obsidian canyon
#

Hey, I was wondering if someone had a moment to explain when I should use DAO and when to use DTO

obtuse gale
#

DTO is the object that actually holds the data itself (you encapsulate and transfer data with it) and DAO is the object that takes care of and handles operations like saving, updating, deleting, etc. of DTOs

remote cedar
#

Hey can I have help with something please I am trying to click the hopper with the nbt and it will open up a gui how do I do that thats my code:

public class RightClickListener implements Listener
{
    @EventHandler
    public void onRightClick(PlayerInteractEvent e)
    {
        Player player = e.getPlayer();
        // We need to convert the item to an nms ItemStack.
        net.minecraft.server.v1_8_R3.ItemStack hopperNbt = CraftItemStack.asNMSCopy(player.getItemInHand());
        // Here we are checking if the item has an NBT tag.
        NBTTagCompound hopperNbtCompound = (hopperNbt.hasTag()) ? hopperNbt.getTag() : new NBTTagCompound();
        
        // Here we are checking if the player clicked the Custom item.
        if(hopperNbtCompound.hasKey("chunk-collector"))
        {
            HopperGui gui = new HopperGui();
            gui.applyHopperUI(player);
            System.out.println("It has the NBT Tag");
        }
        else
        {
            System.out.println("It doesn't have the NBT Tag");
        }
    }

}
jovial warren
#

morning all

hot hull
#

No

#

I refuse

jovial warren
#

because if it's pre-1.14, that NBT data will not save, just a word of warning

#

oh btw, did anyone know that command block minecarts are actually a thing that exist?

#

I just found this out when looking through the list of entities lol

#

/summon minecraft:commandblock_minecart 1 ~ ~ ~?

old wyvern
#

Yea

distant sun
jovial warren
#

yeah NBT ain't gonna persist on 1.8

#

gl

distant sun
#

f

jovial warren
#

might reorganise those, since some of them are marked in yellow, meaning they should only be spawned from spawn object

#

and the commented out ones have to be spawned in their own special ways (experience orb, for example, has it's own packet, spawn experience orb)

#

also, Minecraft's yaw and pitch axes are really weird

#

sometimes they use absolute or relative float angles in degrees, sometimes they use angles in 256ths of a full turn

#

oh well that's easy to convert between

#

to convert from 360ths to 256ths we just divide the fraction by 256/360

#

but that's not what we want actually

distant sun
#

Fr

jovial warren
#

it was ez

#

anyway, anyone up for MineKraft MP test #357,821? xD

distant sun
#

Kotlin minecraft jar?

jovial warren
#

168.119.171.28:25565

distant sun
#

Also, send the link to the repo

prisma wave
distant sun
#

https smh

jovial warren
#

smh BM

prisma wave
#

mobile

distant sun
#

Also, how do you know how to do this

prisma wave
#

Copy paste it into chrome

distant sun
#

me too smh

jovial warren
prisma wave
#

99% of the work is already done for you

jovial warren
#

pretty much fully documented, really nice guys on IRC that'll help you when you get stuck

old wyvern
#

bm

jovial warren
#

someone join the server pls xD

#

you can use cracked MC btw, there's no auth yet

prisma wave
#

Mobile

prisma wave
old wyvern
#

Would an objectdecoder be able to decode the packets?

prisma wave
#

uh

jovial warren
#

we use Netty's ByteToMessageDecoder

prisma wave
#

Which is pretty much the same thing

old wyvern
#

I've a "chat" based project coming up, trying to get a better grasp of netty before I start. Had a look through minekraft

prisma wave
#

So probably yes

#

Netty is pretty simple

remote cedar
jovial warren
#

yeah gl working with NBT on 1.8

old wyvern
#

So any serializable object can be sent and received with just object decoders and encoders right?

prisma wave
jovial warren
#

any byte stream

prisma wave
#

I've never actually read the netty docs

jovial warren
#

packets get sent as raw bytes

prisma wave
#

Just copied notchian and used a bit of common sense

old wyvern
#

Bard I mean the provided ObjectDecoder

jovial warren
#

docs?

prisma wave
#

It's pretty simple

old wyvern
#

I guess I dont need to go too deep into this anyway

prisma wave
#

Yea

old wyvern
#

Probably not too much work for just chat

prisma wave
#

Probably not

jovial warren
#

you wanna send and receive chat packets?

old wyvern
#

No

#

a bit more

jovial warren
#

those are like the easiest ones lol

#

what more?

old wyvern
#

I can already send messages through but there are more things to be dealt with, also

old wyvern
prisma wave
#

Elara's nio library is 10x faster than netty

#

Fun fact

old wyvern
#

Yes!

jovial warren
prisma wave
#

Nonsense

old wyvern
#

Quantum Elara

prisma wave
#

yes

#

Elara transcends physical distance

old wyvern
#

An entangled internet!

prisma wave
#

Information is sent and received instantaneously

old wyvern
#

The future

#

is here

prisma wave
#

So modern!

old wyvern
#

Guess where Elon Musk's parents got the El for his name?

prisma wave
#

๐Ÿ˜ณ

old wyvern
#

๐ŸŒ˜

#

:elaramoon:

prisma wave
old wyvern
prisma wave
#

Why does code cave's version of the emoji look like the official one lol

old wyvern
#

lol

#

xD

prisma wave
old wyvern
#

AH yes

#

Animated emojis

#

Atleast that works

trim niche
#

What's the most used version for plugins?

prisma wave
#

lol

old wyvern
#

Oh wait

#

Yea I read his msg wrong didnt I

prisma wave
#

idk

old wyvern
#

I read that as him asking for the latest version of some plugin at first

prisma wave
#

yea idk

steel heart
#

paper got 1.7.10 still available?

prisma wave
#

pls no

steel heart
#

?

#

its the best version bro

distant sun
#

craft bukkit 1.7.10

jovial warren
#

well chat works

#

entity movement still broken though

remote cedar
#

Hey is there any way to get a clicked blocked display name?

jovial warren
remote cedar
#

I have tried but is there a way to get the hoppers name for example I want to open a gui whenever I open this specific hopper with this specific name I have tried NBT but getting the custom name seems easier

winter iron
#

NBT

#

๐Ÿ™‚

#

so you want to place a hopper and open it for custom gui?

remote cedar
#

whenever I right click it

#

1.8 btw

#

been trying NBT for 5 hours now and working yesterday non stop

winter iron
#

well when u place the hopper, u can store the location of that hopper in a list or map and when u click it u check if its in the list or map and do ur stuff

#

and if u need it to save after reboots, then store the locations in a file

#

and load them on enable

remote cedar
#

I see

winter iron
#

There might also be something u can do with block metadata

dawn hinge
#

Make sure to remove the location if it gets broken

winter iron
#

but im not too sure with that

remote cedar
#

ok wow thanks a lot guys

remote cedar
#

Hey I cant get the location directly from the itemstack can I?
I mean I cant write something like this right?

public class EventListener implements Listener
{

    GiveHopper chopper = new GiveHopper();
    ItemStack hopper = chopper.hopper;

    @EventHandler
    public void onPlaceBlock(BlockPlaceEvent event)
    {
        Block blockPlaced = event.getBlockPlaced();

        if(blockPlaced.equals(hopper))
        {
             event.getBlock().getLocation();
        }
        
    }
oak coyote
#

d;spigot BlockPlaceEvent#getBlockPlaced()

ruby craterBOT
#
@NotNull
public Block getBlockPlaced()```
Description:

Clarity method for getting the placed block. Not really needed except for reasons of clarity.

Returns:

The Block that was placed

remote cedar
oak coyote
#

yeah i believe so

#

there is a different method though

remote cedar
#

so how do I get it to return my custom hopper

#

using NBT?

oak coyote
#

d;spigot BlockPlaceEvent

ruby craterBOT
#
public class BlockPlaceEvent
extends BlockEvent
implements Cancellable```
BlockPlaceEvent has 1 sub classes, 7 fields, 1 all implementations, 13 methods, 1 implementations, and  1 extensions.
Description:

Called when a block is placed by a player.

If a Block Place event is cancelled, the block will not be placed.

remote cedar
#

I am using BlockPlaceEvent

oak coyote
#

getItemInHand()

remote cedar
#

so I did some print debugging and it cant tell the difference between my custom hopper and the regular hopper
@oak coyote

#

anyone else?

trim bear
#

Hello pro dev has joined the server. Let's talk about dev stuff

steel heart
#

html is a programming language

winter iron
#

so is css

trim niche
#

Hi, I'm trying to learn how to use Nbt tags on 1.8.8.
My question is,
If I applied an nbt tag to an ItemStack and I want to check it afterwards,
Do I need to use the same compound that I used to apply the nbt tag?

onyx loom
#

xml is good

trim niche
#

What kind of data do I need to store inside of the xml file?

regal gale
#

He's not talking about your problem lol

trim niche
#

Ok thanks

#

@regal gale Can you help me with my problem though?

#

Ok I figured it out, I don't need to use the same compound

#

But it's still doesn't work for some reason I'll try to send code

#
net.minecraft.server.v1_8_R3.ItemStack nmsItem = CraftItemStack.asNMSCopy(player.getItemInHand());
NBTTagCompound compound = (nmsItem.hasTag()) ? nmsItem.getTag() : new NBTTagCompound();
        
if(chopper.compound.hasKey("chunk-collector"))
{
  System.out.println("It has the NBT Tag");
  System.out.println("Item placed on ground = " + blockPlaced);
}
#

The if statement is always false and I don't know why.

twilit thunder
#

guys i dont see the free request plugin i think i have been muted but the guy that muted me over a month or 2 ego says you have bean muted for a month but i have not been unmuted yet

#

can someone unmute me?

hot hull
#

@trim niche use a library for it, makes no sense to use nbt raw

ocean quartz
#

Plus wtf is that chopper.compound

regal gale
#

Or at least, idk of private message

jovial warren
#

I swear that defeats the entire point in encryption

#

since that shared secret is sent in the clear, anyone who's sniffing can just intercept that and now they can man in the middle you

ocean quartz
#

I assume it is all encrypted with a private key you don't have access to

jovial warren
#

nvm, encrypted with pub key

prisma wave
#

the shared secret is encrypted with the server's public key

jovial warren
#

yeah I didn't read that properly

hallow crane
#

u have the private key

prisma wave
#

why does the private key even exist

#

What is the server hiding from us

hallow crane
#

securitee

jovial warren
#

so we send them the server's pub key, they gen a shared secret, encrypt it with the pub key, send that back, the priv key then decrypts the shared secret and uses that as the AES symmetric key

prisma wave
#

imo the relationship between client and server should be transparent

#

They shouldn't be keeping secrets from each other

#

If the server doesn't tell you their private* key that means you are in a TOXIC relationship**

#

GET OUT

unkempt tangle
terse mesa
#

Hello

unkempt tangle
#

hi

hot hull
prisma wave
#

Yes

hot hull
#

Someone please shoot me in the head, I have to wake up at 5:30 tommorrow

dawn hinge
#

No

#

just go to sleep

hot hull
#

7pm so no

trim niche
#

Which one is more supported by java?
xml or json?

hot hull
#

Json

#

Fuck xml

trim niche
#

Thanks

old wyvern
#

Lol

#

YouTrack ad

distant sun
#

@jovial warren do I have to use hikari for that kotlin database lib?

jovial warren
#

no

distant sun
#

NIKE

jovial warren
#

but you definitely should

distant sun
#

idk how to use it ๐Ÿ˜ฆ

jovial warren
#

it's easy

surreal quarry
jovial warren
#

just initialise a pool config (HikariPoolConfig), create a data source from that config (HikariDataSource), and then feed it into Database.connect(dataSource)

distant sun
#

will see what I can do

heady birch
#

Someones partner would only type the password in for his girlfriend or something and not let her see it

#

Aparrently that made it a "Toxic relationship, something isn't right about that"

onyx loom
#

lol

hot hull
#

The concept of relationships is fucked these days

heady birch
#

Except database relationships ๐Ÿ˜ซ

jovial warren
#

as my mentor/SENCO/the only staff member at school I go to for help says, if anyone knew the answer and wrote a book on it, they'd be a billionaire (at least)

hot hull
#

Where are the good old 1800s where life was simple

#

Or better yet 200mil bc

jovial warren
#

lol

onyx loom
#

back then there were no nukes tho sad_fingerguns

#

how do u want me to detonate them if they dont exist in that time period

lunar cypress
#

return to monke

jovial warren
#

I'm so tempted to set the netty name for the packet encrypter and decrypter to encrypt0r and decrypt0r lol

#

please someone get that reference lol

remote cedar
#

Hey so I want to override a hopper's gui with my own whenever I rightclick it how am I suppose to do it this is my code

      @EventHandler
    public void onClick(PlayerInteractEvent event)
    {
        Player player = event.getPlayer();
        Block clickedBlock = event.getClickedBlock();
        Location location = null;
        int i = 0;
        
        if(clickedBlock == Material.HOPPER)
        {
            location = clickedBlock.getLocation();
            for(i = 0; i < locations.size(); i += 1)
            {
                if(locations.get(i).equals(location))
                {
                    gui.applyHopperUI(player);
                    System.out.println("Inside the if");
                }
            }
        }
    }
ocean quartz
prisma wave
#

Is this what it's come to

old wyvern
#

Lmao

prisma wave
#

"challenge"

#

๐Ÿฅฒ

distant sun
#

what's hackerrank?

old wyvern
#

Competitive Coding

surreal quarry
#

how to do that?

#

seems very hard

distant sun
#

is it any good to try it?

old wyvern
#

Yea its fun

#

Basically CoC, but harder and longer

#

There are also practice challenges you can try

distant sun
#

is it "multiplayer"?

old wyvern
#

Yes many thousands of people will compete

onyx loom
#

cant wait to have thousands compete in the pinnacle of programming to say hello world

old wyvern
#

I mean thats probably one of the practice ones

half harness
obtuse gale
#

Restart reversed_fingerguns

half harness
#

but

old wyvern
#

you could give it a shot

surreal quarry
half harness
#

then theres no point in running debug mode

surreal quarry
#

you fool

#

just restart the debug seesion

half harness
#

but it always shows that message

#

so I always restart

half harness
#

๐Ÿ˜ฆ

heady birch
#

New barry feature?

old wyvern
#

old

#

welp

jovial warren
#

wat?

prisma wave
#

swap :: String -> String
swap [] = []
swap [a] = [a]
swap (a:b:s) = [b, a] ++ swap s
``` that is unbelievably hot
jovial warren
#

ew what is that new pfp

prisma wave
#

i cant believe it worked

#

lmao

#

female tf2 soldier

jovial warren
#

gtfo

prisma wave
#

๐Ÿคฃ

jovial warren
#

go back to the old one

#

it better

#

I mean, you've had it for at least a year now

prisma wave
#

this one is better

jovial warren
#

is this a valentine's day thing or something?

prisma wave
#

nah

#

just bored

jovial warren
#

or is this just you being dumb

#

ah fair enough

old wyvern
#

lol

jovial warren
#

also, encryption still doesn't work

#

it broke

#

I can tell it's broke because the client doesn't log any received packets after encryption response

old wyvern
jovial warren
old wyvern
#

Also, was installing a stack package but not sure what is even going on anymore ๐Ÿ™‚

#

This has been going on for a while now

prisma wave
#

๐Ÿฅฒ

#

do u know how to use justMaybe

#

is it like orElse?

#

i am very confused

jovial warren
#

BM

old wyvern
#

Which package is that function from?

jovial warren
#

would you have a clue what "Note that the AES cipher is updated continuously, not finished and restarted every packet" means?

old wyvern
#

orElse would be something like fromMaybe

prisma wave
#

uh

old wyvern
#

takes a default value and the maybe monad, returns the value if its a Just and the default if its Nothing

prisma wave
#

i see

#

i need like "cascading" maybes

#

if the first maybe is Nothing, try the next, if that's nothing, use the last value

old wyvern
#

so its a list of maybe ?

prisma wave
#

yeah effectively

lunar cypress
#

Like Java's or?

prisma wave
#

yup

#

not orElse

#
getType s = head $ catMaybes [
    mapMaybe (\x -> Just "integer") $ readMaybe s :: Integer,
    mapMaybe (\x -> Just "float") $ readMaybe s :: Float,
    Just "string"]
``` i've got this rn, it's not working ๐Ÿฅฒ
#

there's probably a lot wrong with it

jovial warren
#

oi donkey

#

you used Cipher#doFinal for stream cipher encryption

#

nice one

prisma wave
#

i think because mapMaybe requires a Maybe a of the same a

prisma wave
#

i fixed this in the rewrite

jovial warren
#

rewrite?

prisma wave
#

it doesnt work

#

but it's slightly better

#
getType s = head $ catMaybes [
    mapMaybe (\x -> Just "integer") $ readMaybe s :: Integer,
    mapMaybe (\x -> Just "float") $ readMaybe s :: Float,
    Just "string"]
``` ran out of time but I got to this
obtuse gale
#

Hi

#

I need configuration help

prisma wave
#

ok

old wyvern
#

if the first maybe is Nothing, try the next, if that's nothing, use the last value
Are there only 2 elements?

prisma wave
#

3

#

try parse int, else try parse float, else it's a string

jovial warren
prisma wave
#

ยฏ_(ใƒ„)_/ยฏ

#

it was working at some point

#

i think

#

i distinctly remember changing it from doFinal, because that's wrong

#

i just might have reverted it in my desperate attempt at debugging lol

jovial warren
#

should decryptWithPrivateKey use doFinal?

#

also, wanna see what I currently got?

lunar cypress
jovial warren
prisma wave
old wyvern
#
getType s = head $ concat [
    mapMaybe id $ readMaybe s :: Integer,
    mapMaybe id $ readMaybe s :: Float,
    [s]]
prisma wave
#

o

old wyvern
#

That should work I think

jovial warren
#

ain't doing anything wrong there, am I BM?

old wyvern
#

mapMaybe takes a Maybe value

#

and ignores the value if it is Nothing

lunar cypress
#

does mapMaybe take a scalar?

#

or concat rather

prisma wave
old wyvern
#

concat returns a list

prisma wave
#

hmm

lunar cypress
#

wait no I do mean mapMaybe

old wyvern
#

takes a list of lists

lunar cypress
#

It takes a list

prisma wave
#

what's the point of mapMaybe with id

old wyvern
#

mapMaybe takes a function that returns a Maybe and a list

jovial warren
old wyvern
#

return a another list with mapped value with only the ones tht returned Just

lunar cypress
old wyvern
#

yea second is a list

prisma wave
lunar cypress
#

hold on a sec

jovial warren
#

IT WORKS

#

yes

lunar cypress
#

your snippet could be simplified yugi but currently it doesn't to exactly what bm did

prisma wave
#

yeah i need to map to stuff like "integer", "float" etc

#

and I think mapMaybe needs 2 maybes of the same type

lunar cypress
#

it needs a list of maybes

old wyvern
#

Are you sure

lunar cypress
#

a list of a

#

sorry

prisma wave
old wyvern
#

readMaybe return a a maybe

#

so a becomes Maybe int

prisma wave
#

yeah idk im just guessing based on the error

lunar cypress
#

not a single Maybe

old wyvern
#

wait lemme actually try running that

lunar cypress
#

that's what I was trying to suggest earlier

old wyvern
#

ah true my bad

#

use fromMaybe there

#

I see

unkempt tangle
#

Is there total conversation of code

old wyvern
#

I didnt notice that

unkempt tangle
#

from java -> c

lunar cypress
#

conversation?

#

do you mean conversion?

unkempt tangle
#

Yes

old wyvern
#

Why not just write c?

lunar cypress
#

in that case no there is not

unkempt tangle
lunar cypress
#

C is a very different language

unkempt tangle
#

cuz I am lazy

old wyvern
lunar cypress
#

however you can use the jni if you want to write to some C library

unkempt tangle
#

jni?

#

Nevertheless someone have to teach me pointers or when do use malloc or free

prisma wave
#

uh

#

use Go ๐Ÿ™‚

old wyvern
#

^

lunar cypress
#

pepeP

prisma wave
#

so about all this scary Maybe stuff

old wyvern
#

or Elara ๐Ÿ™‚

#

Lemme try running it once bm

prisma wave
#

okay

unkempt tangle
#

No. dont come with other things

prisma wave
#

i am just confused

unkempt tangle
#

I wanna learn it

#

WHat IDE should I use

prisma wave
unkempt tangle
#

I learn C how I learned Java

prisma wave
#

CLion is good

unkempt tangle
#

straight forward and no reading

lunar cypress
unkempt tangle
#

Its trail

prisma wave
#

oh

#

right

lunar cypress
#

if you wrapped it in [] it should work

old wyvern
#

use fromMaybe instead of mapMaybe

lunar cypress
#

but I think you could simplify it using catMaybes

unkempt tangle
#

make it free ;c

prisma wave
#

yeah i was using catMaybes i think

prisma wave
lunar cypress
#

but still doesn't solve your initial problem lol

unkempt tangle
#

Yes

prisma wave
#

yeah lol

prisma wave
# unkempt tangle Yes

you can get all jetbrains IDEs for free with the github student developer pack then

#

or just via jetbrains themselves

unkempt tangle
#

How

prisma wave
#

but github makes it easier

lunar cypress
lunar cypress
#

makes you learn how to work with the cli as well

unkempt tangle
#

I had C and C++ in my uni

#

But it was extremely basic

#

I forgot half of it

#

especially with struct

#

and pointers

lunar cypress
#

that's half of what C is

unkempt tangle
#

For C++ You had to use iostream

prisma wave
#

i noticed that

#

weird

unkempt tangle
#

Bom

#

Wanna play?

#

@jovial warren

jovial warren
#

not yet

prisma wave
jovial warren
#

also, @prisma wave, decoding doesn't seem to be working (the client's sending packets but I ain't gettin' em')

prisma wave
#

leading me to believe it's because of the conversions

jovial warren
old wyvern
#

@prisma wave What should the function essentially return?

prisma wave
#

either "integer", "float", or "string"

#

a String

old wyvern
#

ah

lunar cypress
#
applyMaybe :: (a -> b) -> Maybe a -> Maybe b
applyMaybe f x = case x of 
    Just a -> (Just . f) x
    Nothing -> Nothing

getType s = (head . catMaybes) [
    applyMaybe (const (Just "integer")) (readMaybe s :: Integer)
    applyMaybe (const (Just "float")) (readMaybe s :: Float)
    Just "string"]
```haven't tested, but something like this maybe? @prisma wave
prisma wave
#

oh boy

lunar cypress
#

bit rusty with Haskell but it's basically your idea with an additional function

#

might be a few mistakes in there

prisma wave
#

gimme a minute to try and understand this

#

const is curried here right?

jovial warren
#

oh btw, fun fact: Oracle JDK 11 doesn't give a fuck about securing Unsafe

prisma wave
#

o

jovial warren
#

or this might be AdoptOpenJDK, not sure lol

lunar cypress
#

have you tried it?

jovial warren
#

yeah this is AdoptOpenJDK