Skip to content

Instantly share code, notes, and snippets.

View JabDoesThings's full-sized avatar
👋

Jab JabDoesThings

👋
  • United States
View GitHub Profile
@JabDoesThings
JabDoesThings / BasicCoroutine.lua
Created November 14, 2024 23:30
A basic coroutine example for Project Zomboid.
local IS_PZ = instanceof ~= nil;
-- Create our coroutine by passing a function to execute, from start to finish.
local thread = coroutine.create(function()
local result = 0;
for i = 0, 100, 1 do
-- Perform next pass.
result = result + i;
@JabDoesThings
JabDoesThings / readonly.lua
Created October 28, 2024 16:26
Freezes objects as read-only.
-- Creates a read-only object, much like frozen objects in JavaScript.
--
-- Example:
--
-- local readonly = require 'readonly';
-- // Cannot modify.
-- local object = readonly({ pi = math.PI });
--
--
-- @author asledgehammer, JabDoesThings 2024
@JabDoesThings
JabDoesThings / PlayerListener.lua
Last active October 29, 2024 16:20
Project Zomboid 41.78.16 - Creates login and logout events for server-side Lua.
-- This script handles additional events for managing players logging in and
-- out of multiplayer servers. (Server-Side)
--
-- Events:
-- - void OnServerPlayerLogin(IsoPlayer player)
-- - void OnServerPlayerLogout(IsoPlayer player)
--
-- @author asledgehammer, JabDoesThings 2024
-- Only run on servers.
@JabDoesThings
JabDoesThings / TexturePack.java
Created October 2, 2024 04:07
Reads & Accesses TexturePack files for Project Zomboid 41.78.16.
package com.asledgehammer;
import javax.imageio.ImageIO;
import java.awt.image.BufferedImage;
import java.io.*;
import java.util.ArrayList;
import java.util.HashMap;
public class TexturePack {
@JabDoesThings
JabDoesThings / security.yml
Created September 12, 2024 01:22
The default configuration file for CraftHammer.
# This file is part of Craftboid.
#
# Author: Jab
# Version: 2
# Published: 2/1/2022
__meta: { version: 2 }
# All security checks are managed here.
security_checks:
@JabDoesThings
JabDoesThings / JSON.d.ts
Last active June 8, 2024 17:39
JSON support for Project Zomboid (Build 41.78.16)
/** @noSelfInFile */
export function parse(text: string): any;
export function stringify(value: any): string;
@JabDoesThings
JabDoesThings / Example.lua
Last active May 10, 2024 18:03
[LuaCommand] - Template
--- This file serves as a template for creating and executing custom Lua commands using the LuaCommands patch
--- & workshop mod.
---
--- {FILES}
--- Java Patch: https://discord.gg/taP6ZxSTGJ
--- Workshop Mod: https://steamcommunity.com/workshop/filedetails/?id=3243738892
---
--- {DEVELOPER LINKS}
--- Workshop GitHub: https://github.com/asledgehammer/LuaCommands
--- Asledgehammer Discord: https://discord.gg/u3vWvcPX8f
@JabDoesThings
JabDoesThings / BitwiseOps.java
Last active June 8, 2024 17:35
Bitwise Ops Support for Project Zomboid (Build 41.78.16)
package com.asledgehammer.craftnail.util;
public class BitwiseOps {
public static byte bnot8(long value) {
return (byte) ~(byte) value;
}
public static byte band8(long value, long mask) {
return (byte) ((byte) value & (byte) mask);
@JabDoesThings
JabDoesThings / security.yml
Created October 2, 2023 15:09
security.yml (French Translation)
# Ce fichier fait partie de CraftHammer.
#
# (Traduit de l’anglais vers le français)
#
# Auteur: Jab
# Version: 2
# Publié: 2/1/2022
__meta: { version: 2 }
# Tous les contrôles de sécurité sont gérés ici.
@JabDoesThings
JabDoesThings / ExampleUI.tsx
Created December 26, 2022 14:41
PipeWrench-UI: Tech Demo
/** @jsx PipeWrenchUI.createElement */
/** @noSelfInFile */
import * as Events from '@asledgehammer/pipewrench-events';
import { asRGBA, RGBA } from '../../shared/pipewrench-ui/css/color/RGBA';
import { easeInOut } from '../../shared/pipewrench-ui/css/math/Math';
import { PWUIElement } from '../../shared/pipewrench-ui/elements/PWUIElement';
import { OptionalElementFunction } from '../../shared/pipewrench-ui/PipeWrenchUI';
import { PipeWrenchUI, createUI } from '../../shared/pipewrench-ui/React';