Skip to content

Instantly share code, notes, and snippets.

@Minikloon
Minikloon / Instructions.md
Created July 7, 2024 11:03
Minecraft Player Nametags with Custom RGB.

Preview

-Naive solution:
  1. Create a team, set its prefix or suffix to the component you want.
  2. In the PlayerInfoUpdatePacket, set the Username to ""
  3. Add "" to the team.

The player entity on the client stores the username from the player list entry with a matching UUID.

@Minikloon
Minikloon / ComponentWrapper.java
Last active October 15, 2024 21:46
Kyori Adventure Component Word Wrapping
import net.kyori.adventure.text.Component;
import net.kyori.adventure.text.TextComponent;
import net.kyori.adventure.text.format.NamedTextColor;
import net.kyori.adventure.text.format.Style;
import net.kyori.adventure.text.format.TextDecoration;
import net.minestom.server.utils.StringUtils;
import java.util.*;
public class ComponentWrapper {
import net.kyori.adventure.text.Component;
import net.kyori.adventure.text.minimessage.MiniMessage;
public final class MiniMessageTemplate {
private MiniMessageTemplate() {}
public static final StringTemplate.Processor<Component, RuntimeException> MM = stringTemplate -> {
String interpolated = STR.process(stringTemplate);
MiniMessage mm = MiniMessage.miniMessage();
return mm.deserialize(interpolated);
@Minikloon
Minikloon / walmart_chat.txt
Created May 28, 2022 21:09
Walmart gives up on my order
[WALMART] Hi, my name is -----. I will be assisting you today
5/28/2022, 4:41:35 PM
[WALMART] Hello! Welcome to Walmart Canada. Hope you’re doing well.
5/28/2022, 4:41:40 PM
[ME] Hi my order yesterday was not delivered. An agent yesterday told me to contact support today to deal with its pending status.
5/28/2022, 4:42:03 PM
[WALMART] I sincerely apologize for the inconvenience caused you. Certainly, this is not what we want our customers to experience.
@Minikloon
Minikloon / GltfLoadAsLightingMaterialAdapter.java
Last active May 7, 2022 16:26
Load gltf files but use the Lighting material
package com.minikloon.jmonkeytest;
import com.jme3.material.Materials;
import com.jme3.scene.plugins.gltf.PBRMetalRoughMaterialAdapter;
import java.util.Set;
public class GltfLoadAsLightingMaterialAdapter extends PBRMetalRoughMaterialAdapter {
private static final Set<String> IGNORED_GLTF_PARAMS = Set.of(
"baseColorFactor",
@Minikloon
Minikloon / Main.java
Created March 10, 2022 06:02
For NoOneBoss
package com.minikloon.particlestest;
import net.md_5.bungee.api.ChatColor;
import org.bukkit.*;
import org.bukkit.entity.Player;
import org.bukkit.event.EventHandler;
import org.bukkit.event.Listener;
import org.bukkit.event.block.Action;
import org.bukkit.event.player.PlayerInteractEvent;
import org.bukkit.inventory.ItemStack;
@Minikloon
Minikloon / Definition
Created July 24, 2019 01:54
Slime World Format
“Blob” file format
2 bytes - magic = 0xB10B
1 byte (ubyte) - version, current = 0x03
2 bytes (short) - xPos of chunk lowest x & lowest z
2 bytes (short) - zPos
2 bytes (ushort) - width
2 bytes (ushort) - depth
[depends] - chunk bitmask
-> each chunk is 1 bit: 0 if all air (missing), 1 if present
-> chunks are ordered zx, meaning
@Minikloon
Minikloon / index.twig
Created January 29, 2019 05:51
Guild site .twig
<!doctype html>
<html lang="en">
<head>
<meta charset="utf-8">
<title>Mini Squid</title>
<meta name="description" content="Mini Squid">
<meta name="author" content="Minikloon">
<link rel="stylesheet" href="theme.css">
<link href="https://fonts.googleapis.com/css?family=Shrikhand" rel="stylesheet">
</head>
@Minikloon
Minikloon / Colors.kt
Created July 13, 2018 18:28
Color distribution formatting
fun main(args: Array<String>) {
val colors = listOf(
"#ff0000",
"#ffff00",
"#0000ff",
"#ff8000",
"#00ff00"
)
val sb = StringBuilder()
---- Minecraft Crash Report ----
// This doesn't make any sense!
Time: 14/06/18 6:29 PM
Description: Unexpected error
java.lang.NullPointerException: Unexpected error
at ciq.P(SourceFile:2151)
at dix.Y_(SourceFile:26)
at ciq.m(SourceFile:1252)