Skip to content

Instantly share code, notes, and snippets.

View Floweynt's full-sized avatar
🙃
Dying

Floweynt

🙃
Dying
View GitHub Profile

Proposal: Server-side item rendering with protocollib

Note: this was written to be food for thought and discussion. Feedback is appreciated.

Introduction

The server should not store more information than necessary. If some information can be computed from other data, don't store it, only cache it. Unnecessary statefulness and data coupling should be avoided. Invariance should be minimized since they represent a potentially buggy degree of freedom.

Definitions

@Floweynt
Floweynt / spec.md
Last active February 8, 2023 04:01

Language specifications

Tokens

Tokens are defined as follow:

match_id = [a-zA-Z_][a-zA-Z0-9_]*

TOK_IDENTIFIER := match_id
TOK_LANG_IDENTIFIER := @match_id
TOK_INTEGER := [0-9]+ ([0-9]+match_id, but this is currently unsupported)
@Floweynt
Floweynt / ctcfg.h
Created July 6, 2022 02:11
C++ compile time config
#include <concepts>
#include <type_traits>
#include <algorithm>
#include <string_view>
namespace detail
{
template<typename T> constexpr bool always_false = false;
template<typename T>
Properties props = new Properties()
def propFile = file('login.properties')
def username = ""
def password = ""
if (propFile.canRead()){
props.load(new FileInputStream(propFile))
if (props!=null && props.containsKey('password') && props.containsKey('username')) {
username = props['username']
password = props['password']
@Floweynt
Floweynt / CrashReport.java
Last active January 26, 2021 01:56
Mixin
package com.hyahm.mixins;
import com.hyahm.HyahmMain;
import net.minecraft.crash.CrashReport;
import org.spongepowered.asm.mixin.Mixin;
import org.spongepowered.asm.mixin.injection.At;
import org.spongepowered.asm.mixin.injection.Inject;
import org.spongepowered.asm.mixin.injection.callback.CallbackInfoReturnable;
@Mixin(CrashReport.class)
public class CustomCrash