Skip to content

Instantly share code, notes, and snippets.

View Iunius118's full-sized avatar

iunius118 Iunius118

View GitHub Profile
@Iunius118
Iunius118 / ExampleMod.java
Last active July 4, 2024 13:04
Example mod to add an enchantment for Forge 1.21-51.0.21
package com.example.examplemod;
import com.mojang.logging.LogUtils;
import net.minecraft.Util;
import net.minecraft.core.HolderGetter;
import net.minecraft.core.HolderLookup;
import net.minecraft.core.RegistrySetBuilder;
import net.minecraft.core.registries.Registries;
import net.minecraft.data.DataGenerator;
import net.minecraft.data.PackOutput;
@Iunius118
Iunius118 / marge_alpha.py
Last active January 8, 2022 10:55
Merge alpha channel from an image to another image (OpenCV is required)
import argparse
import cv2
def main():
args = parse_args()
alpha, img = read_images(args)
new_img = marge_alpha(args, alpha, img)
write_image(args, new_img)
def parse_args():
@Iunius118
Iunius118 / get_structure_nbt_block_list.py
Last active June 30, 2021 14:24
Output the list of block IDs and quantities from a structure .nbt file.
import sys
# Requires Python-NBT
# pip install Python-NBT
import python_nbt.nbt as nbt
def main():
nbt_file = open_file()
block_list = count_blocks(nbt_file)
output_block_list(block_list)
@Iunius118
Iunius118 / gimp_autosave.py
Last active September 4, 2024 05:01
Auto save plug-in for GIMP [2.8, 2.10]
#!/usr/bin/env python
# Original (by yahvuu): https://www.gimpusers.com/forums/gimp-developer/11718-autosave-plugin
import tempfile
import os
from time import *
from gimpfu import *
def autosave(image, layer):
# Backup interval in seconds (600 = 10 minutes)