Skip to content

Instantly share code, notes, and snippets.

View Aizistral's full-sized avatar
🖤
We all die a little sometimes, it's alright

Aizistral

🖤
We all die a little sometimes, it's alright
View GitHub Profile
@GizmoTheMoonPig
GizmoTheMoonPig / Materials.md
Last active July 23, 2024 03:47
Materials: where did they go?

Starting in 1.20, the Material class has completely disappeared and has been replaced with a series of properties that are chained to BlockBehavior.Properties.of. This list exists so you can easily figure out which propeties to use to replace the old materials.

Every Material here gives its default MapColor (previously known as MaterialColor), regardless of if it had one or not. It also defines which properties to use to replicate the exact behavior used previously.

The very bottom of this file defines the more complicated replacements to certain material properties.

  • AIR - No MapColor, replaceable
  • STRUCTURAL_AIR - No MapColor, replaceable
  • PORTAL - No MapColor, PushReaction.BLOCK
  • CLOTH_DECORATION - MapColor.WOOL, ignitedByLava
@TheNullicorn
TheNullicorn / UuidUtil.java
Created August 4, 2020 01:10
Various utilities for converting to and from "trimmed" UUIDs (UUID strings without hyphens)
import java.util.UUID;
/**
* Various utilities for converting to and from "trimmed" UUIDs (UUID strings without hyphens)
*/
public final class UuidUtil {
private static final String UUID_REGEX = "[a-f0-9]{8}-[a-f0-9]{4}-4[a-f0-9]{3}-[89aAbB][a-f0-9]{3}-[a-f0-9]{12}";
private static final String TRIMMED_UUID_REGEX = "[a-f0-9]{12}4[a-f0-9]{3}[89aAbB][a-f0-9]{15}";
private static final String ADD_UUID_HYPHENS_REGEX = "([a-f0-9]{8})([a-f0-9]{4})(4[a-f0-9]{3})([89aAbB][a-f0-9]{3})([a-f0-9]{12})";
@timvisee
timvisee / falsehoods-programming-time-list.md
Last active December 4, 2025 12:46
Falsehoods programmers believe about time, in a single list

Falsehoods programmers believe about time

This is a compiled list of falsehoods programmers tend to believe about working with time.

Don't re-invent a date time library yourself. If you think you understand everything about time, you're probably doing it wrong.

Falsehoods

  • There are always 24 hours in a day.
  • February is always 28 days long.
  • Any 24-hour period will always begin and end in the same day (or week, or month).