Skip to content

Instantly share code, notes, and snippets.

local resources = {}
resources.data = {}
resources.lookup = {}
function register(name, block, default, ore,
suffix, dust_label, block_label)
local data = {
default_label = suffix and (name .. " " .. suffix) or name,
type SystemData = (
WriteStorage<'s, Ball>,
WriteStorage<'s, Transform>,
Read<'s, EventChannel<ScoreEvent>>,
Read<'s, InputHandler<StringBindings>>,
Read<'s, Time>,
);
fn setup(&mut self, res: &mut Resources) {
Self::SystemData::setup(res);
package net.mcft.copy.wearables.api;
import java.util.Collection;
import java.util.Collections;
import java.util.stream.Stream;
import net.minecraft.entity.Entity;
import net.minecraft.entity.EquipmentSlot;
import net.minecraft.entity.LivingEntity;
{
"schemaVersion": 1,
"id": "wearables",
"version": "${version}",
"name": "Wearables",
"description": "API which allows adding and accessing additional, configurable equipment slots.",
"authors": [
{ "name": "copygirl", "contact": {
"homepage": "https://copy.mcft.net/",
{
"schemaVersion": 1,
"id": "wearables",
"version": "${version}",
"name": "Wearables",
"description": "API which allows adding and accessing additional, configurable equipment slots.",
"authors": [
{ "name": "copygirl", "contact": {
"homepage": "https://copy.mcft.net/",

Wearables API Concept

I wish to make a reusable, generic API for adding and accessing additional equipment slots to entities. My initial motivation for this comes from my backpacks (BetterStorage and later Wearable Backpacks), which should really just be able to make use of a "back" slot, ideally. Along with wanting to be able to carry certain other containers à la TerraFirmaCraft.

Existing Mods

  • Baubles defines a specific hardcoded set of extra slots: Amulet, head, 2x ring, body, charm, belt. Though I've noticed that some slots get little attention from the other mods, compared to the more popular ring and amulet slots.
    On the other hand, sometimes they're not enough - there's other mods that do the same thing as Baubles, offering even more extra equipment slots!
using System;
using System.Collections.Generic;
namespace ProperEngine.ECS.Collections
{
public class ComponentMap<TEntity, TComponent>
where TEntity : struct, IEntity
where TComponent : struct, IComponent
{
private readonly RefDictionary<TEntity, TComponent> _dict
import
future,
json,
macros,
options,
sequtils,
strutils,
./either
import
json,
macros,
./gltfpkg/koppehschema
jsonschema:
SomeJsonType:
property: int | float
## Introduces a number of `Either` types which are union-like types which can hold one single
## value of multiple possible types. They are meant to be used as parts of types autogenerated
## by schema parsers, for example JSON where a valid property may be a `string` or `int`.
##
## Generates types `Either2[T0, T1]` to `Either[T0, T1, T2, T3, T4, T5, T6, T7]`.
import
macros,
options,
sets,