Skip to content

Instantly share code, notes, and snippets.

@copygirl
copygirl / pack-instance.sh
Last active May 2, 2024 16:17
Helper scripts to create Prism Launcher compatible .zip files from packwiz Minecraft modpacks, as well as for publishing changes using rsync.
#!/bin/bash
if [[ $@ == "-h" ]] || [[ $@ == "--help" ]]; then
echo "usage: ./pack-instance.sh [output]"
echo "Creates a Prism Launcher compatible instance .zip file from your pack.toml."
echo "If 'include' directory exists, its contents are copied to the minecraft folder."
echo "If 'icon.png' exists, it's added to the pack and its instance config."
echo "Output defaults to '<name>_v<version>.zip' in the current directory."
exit 0
fi
public readonly unsafe struct Query : IEnumerable<Iterator>
{
private readonly World _world = null!;
private readonly ecs_query_t* _handle = null;
public Query(World world, string expr)
{
ecs_query_desc_t desc = default;
desc.filter.expr = expr;
_world = world;
@copygirl
copygirl / Zomboid_Checklist.md
Created January 23, 2022 14:34
A checklist for important items to grab in Project Zomboid.

Skill Books

Crafting

BEG INT ADV EXP MAS
Carpentry
Cooking
Farming
First Aid
Electrical
using System;
using System.Collections.Generic;
using System.Linq;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
namespace gaemstone.Utility
{
public delegate ref TResult ValueSelector<TValue, TResult>(ref TValue value);
public delegate bool ValueFilter<TValue>(ref TValue value);
use num_traits::PrimInt;
use std::{
mem::size_of,
ops::{Shl, Shr},
};
#[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd)]
pub struct ZOrderIndex<T: PrimInt>(T);
impl<T: PrimInt> ZOrderIndex<T> {

Overview

Statements

Every statement in this language has an associated type and value. In fact, statements that are not supposed to express any value, instead are of type None, its value usually expressed as [].

Here are some example statements and the type they'd be inferred as:

1 // int
using System;
using System.Collections.Generic;
using gaemstone.Common.Utility;
namespace gaemstone.Common.Collections
{
public class RefDictionary<TKey, TValue>
where TKey : struct
{
public struct Entry
using System;
using System.Text;
using Vintagestory.API.MathTools;
namespace Vintagestory.Essentials
{
[Flags]
public enum ProperNeighbor : byte
{
None = 0,
import crafttweaker.item.IIngredient;
import crafttweaker.item.IItemStack;
import mods.dropt.Dropt;
// The chance (1/X) for a gravel pile to drop from
// breaking a dirt block instead of a dirt pile.
// Allows harvesting flint in gravel-sparse places.
static DIRT_GRAVEL_WEIGHT as int = 6;
local component = require("component");
local sides = require("sides");
package.loaded["./resources"] = nil
local resources = require("./resources");
function pretty_amount(n)
if n < 1000 then return string.format("%.0f", n)
elseif n < 1000000 then return string.format("%.1fK", n / 1000)
else return string.format("%.1fM", n / 1000000) end