#dev-general
1 messages · Page 313 of 1
oh yeah

lol
I think functional programming definitely has it's uses
stuff like Minecraft is not one of them though
Why not?
because Minecraft requires a hell of a lot of data storage
So?
and unless your language is good at representing data in memory, you'll have a hard job with Minecraft
Im pretty sure that statement is biased towards oop
maybe
Obviously you wouldnt model your application in the same way
No issues with that tho?
worlds, dimensions, biomes, players, etc.
There still is no issue
idk what functional languages are like at storing data
Suggestion for my nms practice pls?
You don't even need to use NMS to achieve that, pretty boring
schematics
take a look at SSB (Superior Skyblock) for examples
Fine?
suppose it varies
Functional languages still have records or similar things
mhm
some do
Most do
wdym?
Any language without data types is pretty much useless
very true
mhm
Even more useless than a 100% pure language
might as well be assembly if it has no data types lel
but even assembly has data types
Now you might have a point if you said that games usually require a lot of state changing
Although most fp languages have abstractions for this
Because ofc state is necessary sometimes
also, I'm using bit shifting over multiplication from now on
🤨
why u no embed
multiplication = 1.18ms
bit shifting = 1.22us (micro seconds?)
almost 1000x faster
Oh god that's barely even a microbenchmark
that difference may not seem like much, but when that calculation is being performed at least 3 times every time a player moves, that will make a difference
those results aren't gonna be remotely accurate
at scale, that's the difference between lag and no lag
no, they're not, but it's still a significant enough difference that it's worth using it
and they produce the same results
any optimisation I can get with a packet that you can receive thousands of every second is a good one
well I can try it out with the new algorithm can't I
and see if it actually makes a noticeable difference
yeah but please for the love of god don't benchmark stuff like that
don't benchmark what?
anything
He means not to benchmark things in the way that you did, not to not benchmark stuff
^^
ah right
is there something wrong with measureTime? or is it that I'm not factoring in all the other stuff?
the latter
You need to take averages of multiple runs and account for cold start ig
^
idk much about benchmarking but if you want accurate results you should probably use something like jmh
I gotta factor in the list filtering as well
that's probably the most expensive thing here
wdym?
isn't filtering done linearly?
it has to linear search, comparing every item to the given predicate, and then remove any items that don't match it
Yes obviously, whats the issue with that?
linear search is O(n) on the worst case
also if you have chains of these sequence operations kotlin does optimize it to a single loop I think
Its not a linear search
and in our case, it's always O(n) isn't it?
It is linear time in execution but not linear search
the entire operation will run in linear time
since it always has to run through all the elements
linear search reffers to searching for a particular element in an iteration
true
okay idk whether I'm doing something wrong here, but I've just used measureTime on two separate operations: ```kotlin
TEST_LIST.filter { it != 2 }
TEST_LIST.asSequence().filter { it != 2 }
this is a set of the numbers 1-6
literally none of these results are reliable
yeah they vary so much
and the multiplication time seems to now have magically gone down to micro seconds and nano seconds now wtf
yeah but before it was milliseconds and micro seconds
by adding these two, the other times have now decreased
what is a microbenchmark?
it's not a benchmark
how can i get the number of items/string size of a itemstack
Also the second one isnt actually doing anything here
Some common traps in Java micro-benchmarks are:
writing code that the compiler can deduce does not useful work, and therefore optimize away entirely,
not taking account of the "lumpy" nature of Java memory management, and
not taking account of JVM startup effects; e.g. the time take to load and JIT compile classes, and (conversely) the execution speedup that happens once the methods have been JIT compiled.
ah right
wdym?
Lazy
^^
There is no terminal operation there xD
forEach?
No not take
Any reduction
what if my case never has any of those?
then nothing will happen
I filter and throw it into forEach
forEach is terminal
forEach is terminal
lol
xD
ah
using println(it) in a forEach on both still seems to have sequences measured slower, not 100% sure if I trust measureTime though
because you shouldn't
where do sequences generally perform better btw?
so if I only have one filter followed by a foreach, then sequences aren't really of use to me
they might perform better
hard to say without an actual benchmark
they probably would if the dataset is big
otherwise it's probably not noticable
is converting to sequences expensive though?
not particularly
depends how it does it I suppose
kinda wanna see how Mojang does it, out of curiosity lol
yeah it does a lot more than this lol
also, seems like the bit shift method broke positioning lol
just reverted back to the method from wiki.vg and it works fine again, with bit shifting it sometimes works and sometimes doesn't
player's heads don't move in the yaw axis yet though, which is frustrating because I believe that may be a separate packet
yeah it is
@prisma wave arrays from python's array module are dynamic arrays right?
afaik
alrighty
Yugi, I played around with the game engine a tad, pretty cool
anyone wanna help test this btw?
Goddamn you Bardy, just closed mc
MineKraft 0.5 xD
Gimme a sec
I'm gonna start from scratch, cause structure fucked again lmao
also, @prisma wave, another reason why I'd rather not have a 33 MB jar is because it takes me like 30 seconds to upload to my server via SFTP every time lol
build on the server
may not be such a bad idea
also, gotta handle disconnects at some point, since atm, you can reconnect and there will be two of you
Bardy inception
kek
yeah ik lol
I need my hat
metadata defaults are false for everything
not 100% sure why you can't see your own skin stuff though
yeah
Also no cape, sadge
not sure if it's metadata or something
sneeze imagine having a test server
Imagine not having a test dedi
if it compiles, it works on my machine™️
Mine is cause I speshul
I got a dedi for testing on the server I'm head dev for, but that's for use with that server only
Mine :hopefully:
if it gens worlds like vanilla then sure
Will have a vanilla styled world preset as well yea
Some day™️
Got 1 week of vacation, gonna see if I can get the current shit working by the end of the week
also, trying to think of how to fix the repeated code I currently have
since I have 3 different methods
Show
one for handling the position packet, one for handling the rotation packet, and one for handling both the position and the rotation
man kotlin
actually that reminds me that I gotta extract the whacky algorithm to a function
Why not have the handles return the built packet, and then handling it from there
you mean handling them by combining them into a PPAR packet?
I don't know what I mean honestly
lol
Kotlin trash
- BomBardyGamer, Feburary 2021
also, btw, if you're wondering what an Angle is, it's basically an unsigned byte that represents an angle measured in 256ths of a full turn
using UByte because using Byte was a bit whack sometimes
e.g. making a Byte of value 128 would give you a Byte with value -128, which meant that both those values would produce the same result
with UByte, we don't worry about any of that whack, since there are no negatives
Kotlin trash
literally just ```kotlin
/**
-
Represents a protocol angle, measured in 256ths of a full turn
*/
data class Angle(val value: UByte) : Comparable<Angle> {override operator fun compareTo(other: Angle) = if (value == other.value) 0 else if (value < other.value) -1 else 1
fun toDegrees() = ((value.toFloat() / 256.0f) * 360.0f)
}
fun Float.toAngle() = Angle(((this / 360.0f) * 256.0f).toInt().toUByte())

Inline class you coward
difference?
Fast
never used an inline class before
ah, so it allows you to wrap values without having to actually wrap them at runtime
it doesn't actually create any instances of the wrapper class
the closest thing kotlin has to structs
what even are structs?
also, how are Java's inline classes different?
ah right
Java doesnt have inline classes yet tho right?
has Kotlin not quite made them native yet or what?
part of valhalla I think
ah yeah, it is
The hell is going on
Haskell gang 
I kinda really wanna see if I can optimise that toAngle algorithm, since division slow lol
They can't be native if the JVM doesn't support them
but I'm not going to bother yet
ah
I have discovered more modern and performant languages
Yes they can and in kotlins case they are
Took you long enough
They simply don't exist after compilation
^
The wrapper classes still exist in some cases I think
for nullables they do
but for non-null, nope
poof
gone
not 100% sure if it applies for unsigned types though
according to Kotlin bytecode, it still seems to exist though
Also generics
True but I wouldn't say they're "native" , in the same way that top level properties, reified generics, etc aren't native
They aren't actually supported on the JVM, it's just a compiler trick
toAngle seems to return a byte though, instead of the wrapper class
so they must vanish I guess
Usually when talking about this I focus on the language level
The entirety of kotlin xD
Because I don't really care about implementation detail
unsigned types are definitely a hack
But in comparison to Java's implementation they're not "native" in the same way
^
trust me, it's not a standardised angle lol
it's measured in 256ths of a full turn
Because if you looked at implementation level there would be no differences between jvm languages whatsoever
likely to save space by keeping it within a single byte
They'd all have the same feature set by that logic
john, have you used numpy's arrays?
it is funny how Mojang cares much more about the server's outbound packets than the client's
I have not
since the client always sends absolute positions and degree angles
it's your job to calculate the relative positioning and convert to what I'm going to call "protocol angles"
All of a sudden I am interested in using ASM bytecode manipulation... without knowing anything at all
lol
ASM is cool
Nice, maybe you should contribute to some port of asm thats in works 🥲
A certain specific port
he means https://github.com/ElaraLang/asm
okay, idk whether it's just me, but I seem to be able to tell an ever so slight difference between using an inline class and a data class for the angle, being that head movements seem to be ever so slightly faster and more precise
and so, in that case, BM, you have now been promoted to God++
Where?
Do mean that there is another one?
that's the Java one lol
Yea thats on the jvm
I was focused on that lol
they want to be able to read JVM bytecode from Go lol
write*
I don't see how there could be a difference
and read too Ig
Manipulate
idfk, it is extremely subtle
may just be me
MineKraft 0.6 is now a thing
because I now know how to space out commits a bit better lol
Wasnt it 0.4 like an hour ago
0.5 yeah
0.5 yesterday
also, me.bristermitten.minekraft.entity.cardinal, what a package xD
Alrighty
I added support for player rotation and player position & rotation
right, now what next?
skins pl0x
btw frost the components got built. Started building the frost frame
Neato
I thought I had some Carrier Prime relics but I don't
Was gonna farm you a set so it picks shit up for you
o.o
You got 100k credits by any chance?
Its not an assignment from uni welp, part of the codechef chapter's work
ah
🥲
Imma go fuck around with this rendering I guess
what is this for?
@hot hull figured out why skins aren't showing lel
you gotta send a metadata packet with the skin settings sent in client settings
this sneaky mother fucker

Do capes show up?
not yet, working on it now lol
anyone got any idea if there's an easy way to split an unsigned byte into 8 booleans?
wow that's dumb, why does groovy not allow variables in
plugins {
}
limitations
lame
fun fromProtocol(byte: UByte): SkinFlags {
val int = byte.toUInt()
return SkinFlags(
(int and 0x01u) != 0u,
(int and 0x02u) != 0u,
(int and 0x04u) != 0u,
(int and 0x08u) != 0u,
(int and 0x10u) != 0u,
(int and 0x20u) != 0u,
(int and 0x40u) != 0u
)
}
```that should work I think
and I gotta convert to an int there because otherwise you get some whack where 0x01u and 0u are UInts
you can't define bytes like that for whatever reason
(int.toInt() & 0x01) != 0?
yeah that might work, but isn't that a bit wasteful?
What with the .toInt() ? I'm not sure how kotlin handles it
actually what am I on about
that'll just get yeeted after it's done
oh also, if I have more than one predicate, is it best to call filter twice or just use &&?
if it is a sequence it does not matter
it's currently just using the collection method
do you need a filtered collection?
I need to just filter a collection and iterate over it's elements
so you don't
probably best to make it a sequence and call filter twice then right?
every transformation on a collection is O(n) space complexity
so if you only use one filter you save a factor of two
sequences should be O(1) space
space
ah right
so space complexity is the amount of space it requires then?
and then time complexity is how long it takes
time complexity is O(n) in both cases but in contrast to collections multiple transformations on sequences do not factor the steps
what's conversion to sequences like?
should be O(1)
time complexity?
both time and space
right then, sequences it is
but I'd have to double check that
yes, It only exists for the compiler in most cases
note that this does not say anything about how long this takes in seconds or similar
its simplified into a single loop
asSequence just returns Sequence { this.iterator() }
yeah that's constant
so O(1) right?
yeah
and even though technically both sequences and collections end up with O(n) in time as long as you're doing a constant amount of transformations, sequences are still better in practice because you still reduce the amount of steps by that constant factor
yeah
So how fast is while(true)
O(∞)
doesn't have a time complexity because it's infinite right?
Wouldnt it be 1 since there is no external input that affects the execution?
if it doesn't halt at all you can't determine the max. number of steps it takes until it halts
no function grows asymptotically faster than infinity because there is no such thing as a function from N -> N that "reaches" infinity
or to put it in another way it doesn't make sense to define the "growth" of infinity
if I'm only performing a single operation, e.g. filter, followed by map for example, then it's not worth using sequences for that right?
Wouldnt the growth of infinity be no growth at all tho
no because infinity is not a constant or a number that abides by any of our rules for natural numbers
Maybe someone defined it differently idk, but to me it does not make sense to define
filter, then map, then some terminal operation is not a single operation
it always depends
no it just does filter then map
do you want it as a collection in the end? then for two operations I'd probably do it without a sequence, yeah
although it wouldn't hurt
and is still technically better because you save a factor of 2 in space
keep in mind that with small input lengths factors like that don't really matter all that much
right, I need a bit of help figuring something out
you see https://github.com/knightzmc/MineKraft/blob/master/src/main/kotlin/me/bristermitten/minekraft/entity/metadata/EntityMetadata.kt right?
those all have defaults set
now, my issue is that I need both the defaults, but also a way to recognise if we just want to send a single part, or only parts of the metadata, and not the full monty
I would do this by making them nullable with a default of null, but then how would you tell the difference between optional metadata and other metadata?
e.g. you can send a packet with only 2 out of all the metadata values with no issues, but you also have required and optional metadata, where the difference is that the former must be present and non-null if you choose to send it, whereas the latter you have to send a boolean value indicating whether it's present or not
that's the issue with place oriented programming 
with what?
In this keynote speech from JaxConf 2012, Rich Hickey, creator of Clojure and founder of Datomic gives an awesome analysis of the changing way we think about values (not the philosphoical kind) in light of the increasing complexity of information technology and the advent of Big Data. The broad subject of the talk makes it worth watching for alm...
richard 🤤
yeah I'm reading the transcript rn
well that kinda went right over my head
so it's kinda where you have addresses and you can free and allocate those addresses and put and replace things there right?
that's what he's talking about
Ah yes when you use minecraft as a perlin noise representation :p http://adrianb.io/2014/08/09/perlinnoise.html
anyone got any ideas of possible solutions to my issue?
I mean, not a bad idea, Minecraft's perlin noise is pretty good
Yea it's really good
Could be better with some polishing, but for a blocky game it's pretty decent
any linux/unix users here?
which kinda unix?
unix 🤮
Linux is unix-like, but yeah
linux > unix
so you want bash support, not unix support
can user linadoma write to the directory xz?
yes
then wtf is wrong with my lecturers
let me break down those permissions
first, we have d, which indicates this is a directory
yeah, I mean, I understand it, but,
then, we have the first rwx, which indicates the read, write and execute flags for the user who owns this
then, we have the second rwx, which indicates the read, write and execute flags for the group of the user who owns this
then the third and final set of rwx flags indicate the permissions of other, basically everyone else
Thanks mojang api for letting me know the actual reason how our MC uuid randomize between Alex and Steve 👀
in this case, linadoma can read and write, users can read and execute, and everyone else can read and execute
yeah, knew most of it, thanks for further explanation though
Should I be generating the permutation table myself, or should I just be using existing patterns?
yw
thinking of having required fields be nullable and optionals using Java's Optional
bit ew but it'll work
I don't think what I mean is mentioned in that talk. What I mean is the concept of representing data that is not present as null (because you have to put something in its place) rather than just omitting whatever is not present
This is hard to do in a statically typed language and Kotlin doesn't have a solution for this
You have to work your way around it somehow
But I wouldn't use Optional
rather wrap it yourself somehow
I could just make my own optional yeah
since the problem with optional is it just sets null values to empty
I need an optional that can have 3 states: present and non-null, present and null, or not present
sealed class
sealed class Optional<T>
object EmptyOptional : Optional<*>
object NullOptional : Optional<Nothing?>
class PresentOptional<T>(val value: T) : Optional<T>
```?
probably a better way to do that
Hi Reddit! /u/xerohour
Fair use claim:
-this serves an educational purpose in demonstrating computer illiteracy as it pertains to American Television
-the clip is far too short to compete in any way with the original product and its intended use
-there is no way that this could be confused with an official broadcast or redistribution by the con...

https://www.youtube.com/watch?v=K7Hn1rPQouU
Imagine how much better the world would be if you could see the % until a breach
From "Castle" Season 8 Episode 8
Copyright ABC
Maybe IO List String
sealed class Optional<T>
object EmptyOptional : Optional<Unit>()
object NullOptional : Optional<Nothing?>()
class PresentOptional<T>(val value: T) : Optional<T>()
```or maybe this
using unit there seems like a bit of a hack though
Could you not just use null? Since kotlins null safety stuff im pretty sure isn't zero cost like rust
let me explain why null won't work
it's pretty much zero cost
but there is a cost because of interop
I need to represent when we don't want to send the metadata value, when we want to send a required metadata value (one that must not be null and is not prefixed with a boolean), and when we want to send an optional metadata value (one that needs to be prefixed with a boolean stating whether it's present or not)
No u
enum Metadata<T> {
Required {
value: [T]
},
Optional {
value: Option<[T]>
}
}
if that's supposed to be rust idk why you put square brackets there
Surprisingly, I have never done generics (in rust), I just put together what I remembered, obviously remembered it wrong lol
enum Metadata<T> {
Required(T),
Optional(Option<T>),
}```
I've thought of a hack that will work for this lol
what if I use Java's Optional, but I have not only the optional's value be nullable, but also the optional itself
well, I wrote the email to the lecturer
he still says you can't write a file to it since you don't have execute permission
no, bad
it violates the contract of optional and is worse than making a sealed class in every regard
but I can't create file there, correct?
whacky casting? what?
like having to cast x to y
Pattern matching🙂
and what do you think will you do with optionals? not null check, get, map or whatever?
you can implement the same operations on your custom wrapper
if optional not null, write optional metadata
could it vary on OS?
no?
actually, he's right
that's really weird
From this page, http://content.hccfl.edu/pollock/aunix1/filepermissions.htm, I understand that I need the +w bit set in a directory to create a new file and +x bit to cd into it/access its inode. S...
ok how is this better than casting (ignoring that this violates the purpose of Optional, again)
because we'd have to check if it's not an instance of NullOptional and then cast to PresentOptional if it's not
no
actually I suppose that's not bad
wat dis?
right, if in doubt, bring the notchian server out
rust enums
public static class DataItem<T> {
private final EntityDataAccessor<T> accessor;
private T value;
private boolean dirty;
public DataItem(EntityDataAccessor<T> param_0, T param_1) {
this.accessor = param_0;
this.value = param_1;
this.dirty = true;
}
public EntityDataAccessor<T> getAccessor() {
return this.accessor;
}
public void setValue(T param_0) {
this.value = param_0;
}
public T getValue() {
return this.value;
}
public boolean isDirty() {
return this.dirty;
}
public void setDirty(boolean param_0) {
this.dirty = param_0;
}
public DataItem<T> copy() {
return new DataItem<T>(this.accessor, this.accessor.getSerializer().copy(this.value));
}
}
sends a list of those
first of all, using the official server as a style guide is not a good idea
yeah ik
I just wanted to see what it did
CrudeIncrementalIntIdentityHashBiMap very nice
okay yeah, it has a serialiser per type
so it has a different EntityDataSerializer implementation for each of the 19 different types
I mean, I should kinda just have this be a list
instead of wrapping it all in horrible looking classes
But the point of this is to make an abstraction
it's supposed to represent an object
If you're writing to the protocol directly you might as well ask why bother doing anything other than just raw bytes
DeluxeConcurrentAsyncAbstractTreeCrudeIncrementalIntIdentityHashBiMapImpl
wdym writing directly?
also, stuff like this shouldn't really be wrapped in classes anyway
since there's just so many metadata flags that will just be repeated in every subclass
and it's not like I have to read this anyway
I just write it all and send it off
also gives me an excuse to use generics 🙂
anyway, just to give an example of what I recommended earlier
sealed class Metadata<T> {
abstract val value: T?
}
class Required<T>(override val value: T) : Metadata<T>()
class Optional<T>(override val value: T?) : Metadata<T>()```
not bad
data Metadata t
wat?
circlejerk all you want, the real problem behind this is only fixed by something like Clojure
🤣
where you just use a map and omission
nil
Dear clojure users
You claim to fix many programming problems, and yet a function in Clojure cannot be guaranteed to be pure
Curious...
dear haskell users
you claim to have a rich type system, yet you encode every little problem as an own type, distracting from the actual types of your program
actually my solution kinda runs into the same issue lol
unless I do what Mojang did
fuck it, Johnny, I'm using your solution
Dear clojure users
You claim types are bad, yet you spend hours debugging vague errors that a statically typed compiler could check within milliseconds
😌
Dear programmer:
You suck
Go fuck yourself
this is actually kinda nice ngl Johnny
one question though
how can I deal with knowing whether the user wants to give it a value or sending nothing at all?
just use Required? for example?
oh uh
you could either make this nullable, or, probably better, add a third "empty" type
But currently it should already support everything hold on
oh no it doesn't, right
yeah it'd need a third variant
so just ```kotlin
class Empty<T> : Metadata<T>() {
override val value: Nothing? = null
}
wait but optional metadata values can be absent right
can someone help me to why this doesn't work
package me.blazen.starter;
import org.bukkit.Bukkit;
import org.bukkit.event.Event;
import org.bukkit.event.EventHandler;
import org.bukkit.event.Listener;
import org.bukkit.event.block.BlockBreakEvent;
import org.bukkit.event.player.PlayerMoveEvent;
public class SpeedA implements Listener {
private double lastDist;
private boolean lastOnGround;
@EventHandler
public void onPlayerMove(PlayerMoveEvent e) {
if (e instanceof PlayerMoveEvent) {
PlayerMoveEvent event = ((PlayerMoveEvent) e);
double distX = event.getTo().getX() - event.getFrom().getX();
double distZ = event.getTo().getZ() - event.getFrom().getZ();
double dist = (distX * distX) + (distZ * distZ);
double lastDist = this.lastDist;
this.lastDist = dist;
boolean onGround = event.getPlayer().isOnGround();
boolean lastOnGround = this.lastOnGround;
this.lastOnGround = onGround;
float friction = 0.91F;
double shiftedLastDist = lastDist * friction;
double equalness = dist - shiftedLastDist;
Bukkit.broadcastMessage(equalness + "");
}
}
}```
I was following a tutorial for some of it but it didnt have all of it so I did the rest on my own but it doesnt broadcast any messages in my server. I am pretty new to coding plugins so I probably messed something up.
that would just make it indistinguishable from Optional though
yeah that's why I'm asking
I suppose I don't really understand what "required" means here
to me it sounds like you always need to send it
"it is not required to send all metadata fields, or even any metadata fields, so long as the terminating entry is correctly sent"
some of those types in that list though are optional, meaning they can be sent but absent
some of them must be sent if they are present
you registered that?
oh I would take a different approach here
yes
also, what's the purpose of the cast there?
you unnecessarily check if the event is a PlayerMoveEvent, when we already know it's a PlayerMoveEvent because that's the type passed to this method
what?
that is true
well for some reason taking out the if statement fixed it
have nullability represent whether something should be sent or not, i.e. null = do not send
and for optionality use a sealed class
so all of your fields are nullable
that was exactly what I was trying to do lol
what's the issue you're facing with that?
then I must have misunderstood you in the beginning
other than the fact that I still wouldn't use java.util.Optional
.
I suggested using nullable for not sent and a sealed class for optional values
actually, I don't even need a sealed class, I just need a class that wraps a nullable value
also, can someone who knows more about this than me tell me why you can't use a smart cast on an open property?
Thats not because of the property being open but rather having a variable(var) property afaik. Reason being that they could change even after the check since its mutable and so can be mutated from somewhere else
actually that's not it, but it makes sense now why that occurs
iirc, you can override vals with vars
huh?
or something like that
it has to have something to do with it being able to be overridden with a mutable property
love how I'm complaining now and I haven't even got to the part where most call it quits yet lol
@jovial warren is there a way to broadcast what a variable is ```@EventHandler
public void onPlayerMove(PlayerMoveEvent e) {
PlayerMoveEvent event = ((PlayerMoveEvent) e);
double distX = event.getTo().getX() - event.getFrom().getX();
double distZ = event.getTo().getZ() - event.getFrom().getZ();
double dist = (distX * distX) + (distZ * distZ);
double lastDist = this.lastDist;
this.lastDist = dist;
boolean onGround = event.getPlayer().isOnGround();
boolean lastOnGround = this.lastOnGround;
this.lastOnGround = onGround;
float friction = 0.91F;
double shiftedLastDist = lastDist * friction;
double equalness = dist - shiftedLastDist;
double scaledEqualness = equalness * 138;
if (!onGround && !lastOnGround) {
if (scaledEqualness >= 1.0) {
Bukkit.broadcastMessage(scaledEqualness + "");
}
}
}``` I want to see what onGround and lastOnGround are to see what they are outputting
ok
you can use the logger from your plugin instance
yeah there's no need to cast there either
your IDE should flag that up as a redundant cast
he's still learning
give him a break guys
do I not have to do that?
no
oh ok
casting is when you want to turn one object into another
in your case, it's already the object that you're casting to, so there's no point in casting there
just rename your parameter name from e to event and you're good
ok
Hahahaha imagine having casting in your language
Good news everyone
Go 1.16 added unicode 13.0.0 support
Meaning 🥲 is now supported
🥲
https://i.imgur.com/C78R2JW.png someone explain how @JvmName is not applicable here
It's not applicable
I have to specify @JvmName there to avoid overload resolution ambiguity
yeah but why?
Probably cuz it's an extension function
but IntelliJ doesn't complain about it, which confuses me
if I decompile the bytecode, I can see it applies it correctly
and I saw a suggestion to use @JvmName to avoid ambiguity there on StackOverflow
ah yes, I can cast door onto door and get door
and it's also the suggestion that the official article about Java interoperability suggests
let writeOptionalMetadata buf index chat =
writeOptionalMetadata :: ByteBuf -> UByte -> Maybe Component -> IO ()
trying to think of my options now
fn writeOptionalMetadata (buf: &ByteBuf, index: u8, chat: Option<Component>)
what are you trying to suggest?
Nothing
That haskell is superior*
Oh yeah that goes without saying

bm
oui?
Can you proof read something I wrote? I wanna make sure not to include any dumb mistakes 😬
Sure
You should know bm by now
😊
true
Alrighty ill dm it to you in 5 mins
Good Afternoon smart people.
good afternoon Glare
extend ByteBuf as buf {
let writeOptionalMetadata(Byte index, Result<Component> chat) => {
buf.writeUByte(index)
if index != 0xFF.toUByte() {
buf.writeVarInt(MetaDataType.OPTIONAL_CHAT, id)
buf.writeOptionalChat(chat)
}
}
}
Pancake King
seems to be a Kotlin bug btw, using @Suppress("INAPPLICABLE_JVM_NAME") seems to have fixed it
and skins now work
Looks great!!!
Ooo that's fancy.
Coolio
can't see others' skins yet because I'm still working on that, but it's a start
Is anybody else having issue with iij not being able to access the source of certain library(libraries)?
MineKraft is now 0.7 🙂
actually not sure if that should've been a patch
yeah I'm making that a patch
MineKraft O.o
Actually we should probably have separate Option and Result types
Minecraft server implementation from scratch in Kotlin 🙂
How's that going for ya?
actually pretty well
you can join into a world with a single 16x16x16 cube of stone
you can see other players
Ooo
So what is the benefit of writing a Kotlin implementation for this?
just a fun side project
its kotlin
xD
also will hopefully multithread properly
Could design it to be a lightweight limbo server?
If done well Coroutines could be a big benefit
^
HasKraft 🔜
BM's already spoke about changing the name, but no one can come up with any good ideas lol
KotlinCraft
Kraft
K-Craft
KraftMine
Kraft - Mac and Cheese
I kinda want a name that doesn't contain any variation on the words "Kotlin", "Craft" or "Mine"
Cleo
KineMraft
nothing that's really really unoriginal lol
F#Craft
Says the person who made "Komponent" lmao
We are announcing the addition of the Zombie monad

So have you done any benchmark testing to see how it runs so far or is it not to that point yet?
I might rename that at some point
baby steps Glare, baby steps xD
Hector Hughes
you gotta learn to run before you can walk
it hardly functions as a proper Minecraft server yet
also, I will rename Komponent at some point if I come up with a better name
Yo website is down bm
KraftTheCraft
what did I say
ClojureCraft
.
prev
lol
Minebug
Minekitten```
where you getting these? GitHub's name generator?
Huh?
I can't go with the naming scheme of that lel
also, that's not his site
that's mine
Yo website is down
yeah ik
insidious restaurant
I don't even have one lol
:doubt:
yeah nothing ever got done with that
Quality
Someone rewrite this for me lol
look at what that is
also, love how that email address doesn't exist any more either
the only Prevarinite emails I have are my personal one, abuse, admin and reports
I would revive Prevarinite again, if the members wanted to stick around as well lol
Oh that's not mine
also, the naming for that was just "Prevaricate" (my favourite word at the time), and a bit of manipulation, I think from the word "Ignite", which came from a previous project of mine, "Inferno"
love how because we're all developers, none of us are good at naming things lol
Nah man, it has anything to do with kotlin, we gotta sneak in that K somehow
I mean, I personally would be happy to settle on MineKraft, but BM doesn't like it
Kongress
Krap
also, if you're talking about naming relating to other things, Spigot and Paper for example are two names of projects that have nothing to do with what they're named after
no
oh come on, at least someone here has to be half decent at naming
double-text
Rust
@obtuse gale another good example
Name it after someone famous
Needs to be renamed
We need SpiJot nad Japer
I was thinking of naming it after an element on the periodic table
Will Smith
or Pajer
PopularGameThatIsPopularAndStartsWithMineAndEndsWithCraftWrittenInKotlin
idk
Name it after someone like famous mathematician Haskell Curry
no
CurryKraft
Samuel L Jackson
Jackson🥲
how about Oxide?
Dioxide
How about Peroxide?
Michael Jacksoncraft
Popular Minecraft server implementation "Joe Biden"
Ammonium
Robin Williams
Or Sodium Bicarbonate Or Benzene-2-4-Dialdehyde
Bryan Adams
What about something that describes the game
Minecraft
Make a Cubic shaped carbon chain and name it its IUPAC name 
Like CraftMine or Minecraft or something
Damn you stole my joke
way too unoriginal
🥲
come on guys
What?
KotlinCraft
Lorem Ipsum
Lanthanide
Intellectual Property Craft
lol
MineHQCraft
Dolor sit amet
ffs guys, can't we just be at least somewhat serious for once in our lives
IronOre
BoulderKraft
GoldenAppleMC
CopperKraft
GoogleKraft
I'm spitting out names and everyone's just ignoring them
FUNCraft
Nitride
Copper Wire 0.35mm Enamelled Copper Magnet Wire Round Copper Wiring Bare Copper Wire for Transformer Inductor Coil Relay Motor Coil Winding
AmericaKraft
why do I bother asking you lot, honestly
DigBuild
RepublicanCraft
DrillKraft
please just be serious for once
ChinaJoeBiden'sSonCraft
fucking hell
SleepyJoeCraft
Queen Elizabeth the First of England
Craft™️
^
CraftCraft
IngotCraft
MineKT ? Or something
at this point, I'm just gonna pick the name
Lmao
xD
OpenPitMiningKraft
Not configuration help
When they said carbon makes up life, they werent kidding
PluginnerMc
RavineKraft
NotJavaCraft
AmongusCraft
right, let's do some ratings
ProspectingLicenceKraft
ElaraCraft
HasKraft
I'm gonna throw names, and you guys can rate them
SedimentaryRockKraft
fuck
Does it start with Elara?
Oxygen
Elaramooncraft
If not, its a -1 from me
Me too
ELARAELARAELARAELARAKRAFTELARA
CarbonDioxideKraftImplementationFactoryGenerator
O(2)
that's the name of a UK mobile phone company lol
Better yet, O(3)
H2O2
ZeusKraft
H1N1
Mineplex
O(x^x)
Ozone 😮
O(N!!)
OrthosieKraft
O(N!!!!!^N!!!!!)
sounds like it's been done many, many times before
Simon Peyton-Jones craft
Hickeycraft
ThrymrKraft
Was referring to Yugi's message xD
Blitzcraft
I'm losing hope in you lot
WHAT!
LMAO
BlitzKraft 💯
No need to shout
Barry!!
Why are we ruling out AmericaKraft?
SARS-Cov-2 Craft
we're just collectively going insane.
BarryCraft
UranusCraft
you're all useless, I swear
🥲
Kovid
🥲craft
Omg
Fovid
:smiling_face_with_3_tears: craft
Kovid i love it
God dammot
🙂
smiling_face_with_minecraft_server_implementation
everyone just stop
Unironically would use Kovid
XD
S/2003 J9 Kraft
that's enough names
n o
Pogchampcraft
KoviShield
ChessKraft
NixKraft
KKK
WeirdChampKraft
T-Mobile Craft
you're just taking the piss at this point
🥲
FlexTapeCraft
Vodafonecraft
LiquidDryWallCraft
Kraft-beta-rc-alpha-00.1 v0.0.1-Beta
Margaret Craft
-SNAPSHOT
KovlinCraft


