- Introduction
- Styling
- Source files
- Formatting
- Naming
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Takes a Map<K, V> and applies the given function to each one of its elements, returning a new | |
// Map<K1, V1> with the transformed key-value pairs | |
fun <K, V, K1, V1> Map<K, V>.transform(function: (Map.Entry<K, V>) -> Pair<K1, V1>): Map<K1, V1> { | |
val temp = mutableMapOf<K1, V1>() | |
for (entry in this) { | |
temp += function(entry) | |
} | |
return temp | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* Calculates a chunk position from a given [id] in a spiral pattern. | |
* | |
* This algorithm was previously part of Krypton (https://github.com/KryptonMC/Krypton), however it was removed after | |
* it was no longer used. | |
* | |
* **Algorithm:** | |
* | |
* Given n, an index in the squared spiral | |
* p, the sum of a point in the inner square |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"minecraft:dimension_type": { | |
type: "minecraft:dimension_type", | |
value: [ | |
{ | |
name: "minecraft:overworld", | |
id: 0, | |
element: { | |
piglin_safe: 0b, | |
natural: 1b, |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
fun ByteBuf.writeVarLong(value: Long) { | |
when { | |
value and (0xFFFFFFFF shl 7) == 0L -> writeByte(value.toInt()) | |
value and (0xFFFFFFFF shl 14) == 0L -> writeShort((value and 0x7F or 0x80 shl 8 or (value ushr 7)).toInt()) | |
value and (0xFFFFFFFF shl 21) == 0L -> writeMedium((value and 0x7F or 0x80 shl 16 or (value ushr 7 and 0x7F or 0x80 shl 8) or (value ushr 14)).toInt()) | |
value and (0xFFFFFFFF shl 28) == 0L -> writeInt((value and 0x7F or 0x80 shl 24 or (value ushr 7 and 0x7F or 0x80 shl 16) or (value ushr 14 and 0x7F or 0x80 shl 8) or (value ushr 21)).toInt()) | |
value and (0xFFFFFFFF shl 35) == 0L -> { | |
writeInt((value and 0x7F or 0x80 shl 24 or (value ushr 7 and 0x7F or 0x80 shl 16) or (value ushr 14 and 0x7F or 0x80 shl 8) or (value ushr 21 and 0x7F or 0x80)).toInt()) | |
writeByte((value ushr 28).toInt()) | |
} |
We can make this file beautiful and searchable if this error is corrected: Unclosed quoted field in line 7.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
"Benchmark","Mode","Threads","Samples","Score","Score Error (99.9%)","Unit" | |
"net.kyori.adventure.text.serializer.gson.ComponentDeserializationBenchmark.componentTreeWithEvents","sample",1,4510105,13.949098,0.021804,"us/op" | |
"net.kyori.adventure.text.serializer.gson.ComponentDeserializationBenchmark.componentTreeWithEvents:componentTreeWithEvents·p0.00","sample",1,1,12.608000,NaN,"us/op" | |
"net.kyori.adventure.text.serializer.gson.ComponentDeserializationBenchmark.componentTreeWithEvents:componentTreeWithEvents·p0.50","sample",1,1,13.600000,NaN,"us/op" | |
"net.kyori.adventure.text.serializer.gson.ComponentDeserializationBenchmark.componentTreeWithEvents:componentTreeWithEvents·p0.90","sample",1,1,14.112000,NaN,"us/op" | |
"net.kyori.adventure.text.serializer.gson.ComponentDeserializationBenchmark.componentTreeWithEvents:componentTreeWithEvents·p0.95","sample",1,1,14.592000,NaN,"us/op" | |
"net.kyori.adventure.text.serializer.gson.ComponentDeserializationBenchmark.componentTreeWithEvents:componentTreeWithEvents·p0.99","sampl |
I hereby claim:
- I am BomBardyGamer on github.
- I am bombardydev (https://keybase.io/bombardydev) on keybase.
- I have a public key whose fingerprint is B308 410E 6681 4C58 CBC4 8167 A3AC 563A 6E59 A4E8
To claim this, I am signing this object:
API Changes:
- Remove
wrapped
field fromAdventureMessage
. - Remove many methods from
GameProfile
- not required.- Possibly remove
with
- usetoBuilder
to convert to a builder and edit in bulk. - Remove
withName
- changing the name of aGameProfile
is hardly ever going to be required. - Remove
withUUID
- changing the UUID of aGameProfile
is hardly ever going to be required.
- Possibly remove
- Remove
ProfileCache
and replace withProfileProvider
- removes dependency on modified vanilla names, and removes the requirement for implementations to need a cache forGameProfile
s. - Remove many implementation details and unclear fields from
Block
.- Remove
id
andstateId
- unstable network IDs, subject to change, huge implementation details.
- Remove
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package dev.emortal.minestom.core.placement; | |
import net.minestom.server.instance.block.Block; | |
import net.minestom.server.instance.block.BlockFace; | |
import net.minestom.server.instance.block.rule.BlockPlacementRule; | |
import net.minestom.server.utils.Direction; | |
import org.jetbrains.annotations.NotNull; | |
import org.jetbrains.annotations.Nullable; | |
import java.util.Locale; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public final class Main { | |
private static final String PURE_MINI_MESSAGE = "<click:run_command:'/party join <username>'><color:#3db83d>You have been invited to join <green><username>'s</green> party. <b><gradient:light_purple:gold>Click to accept</gradient></b></click>"; | |
private static final String MINI_AND_PARSE = "<click:run_command:'/party join {0}'><color:#3db83d>You have been invited to join <green>{0}'s</green> party. <b><gradient:light_purple:gold>Click to accept</gradient></b></click>"; | |
private static final TagResolver PLACEHOLDER = Placeholder.parsed("username", "Bardy"); | |
private static final List<Component> ARGS = List.of(Component.text("Bardy")); | |
public static void main(String[] ignored) { | |
// Try to pre-initialise everything so that doesn't affect the results | |
MiniMessage miniMessage = MiniMessage.miniMessage(); |