Skip to content

Instantly share code, notes, and snippets.

View DMHYT's full-sized avatar
🌴
On vacation

visualstudiodan DMHYT

🌴
On vacation
View GitHub Profile
@DMHYT
DMHYT / TileEntityImplementation.ts
Created August 9, 2021 10:22
InnerCore TileEntity implementation
interface RedstoneSignalParams { power: number, signal: number, onLoad: boolean }
class TileEntityImplementation<T> implements TileEntity, TileEntity.TileEntityPrototype {
public readonly useNetworkItemContainer = true;
public readonly x: number;
public readonly y: number;
public readonly z: number;
public readonly dimension: number;
public readonly blockID: number;
@DMHYT
DMHYT / kex.d.ts
Created February 11, 2022 08:35
KernelExtension v1.0 TS declarations
/// <reference path="core-engine.d.ts" />
type MinMax = { min: number, max: number }
type FeatureTypes = "buriedtreasure" | "endcity" | "fortress" | "mansion" | "mineshaft" | "monument" | "pillageroutpost" | "ruins" | "shipwreck" | "stronghold" | "temple" | "village";
type EnchantTypes = Lowercase<keyof typeof EEnchantment>;
declare namespace LootTableTypes {
export type LootPoolEntryFunction = {
function: "enchant_book_for_trading",
base_cost: number,
@DMHYT
DMHYT / kex.d.ts
Created March 5, 2022 19:49
KernelExtension v1.2 TS declarations
/// <reference path="core-engine.d.ts" />
type MinMax = { min: number, max: number }
type FeatureTypes = "buriedtreasure" | "endcity" | "fortress" | "mansion" | "mineshaft" | "monument" | "pillageroutpost" | "ruins" | "shipwreck" | "stronghold" | "temple" | "village";
type EnchantTypes = Lowercase<keyof typeof EEnchantment>;
declare namespace LootTableTypes {
export type LootPoolEntryFunction = {
function: "enchant_book_for_trading",
base_cost: number,
@DMHYT
DMHYT / kex.d.ts
Created March 6, 2022 17:37
KernelExtension v1.3 TS declarations
/// <reference path="core-engine.d.ts" />
type MinMax = { min: number, max: number }
type FeatureTypes = "buriedtreasure" | "endcity" | "fortress" | "mansion" | "mineshaft" | "monument" | "pillageroutpost" | "ruins" | "shipwreck" | "stronghold" | "temple" | "village";
type EnchantTypes = Lowercase<keyof typeof EEnchantment>;
declare namespace LootTableTypes {
export type LootPoolEntryFunction = {
function: "enchant_book_for_trading",
base_cost: number,
@DMHYT
DMHYT / kex.d.ts
Created March 10, 2022 17:47
KernelExtension v1.4 TS declarations
/// <reference path="core-engine.d.ts" />
type MinMax = { min: number, max: number }
type FeatureTypes = "buriedtreasure" | "endcity" | "fortress" | "mansion" | "mineshaft" | "monument" | "pillageroutpost" | "ruins" | "shipwreck" | "stronghold" | "temple" | "village";
type EnchantTypes = Lowercase<keyof typeof EEnchantment>;
declare namespace LootTableTypes {
export type LootPoolEntryFunction = {
function: "enchant_book_for_trading",
base_cost: number,
@DMHYT
DMHYT / biome_mappings_1_16.json
Last active August 31, 2023 12:43
Names of the biomes in Minecraft: Bedrock Edition 1.16, which differ from the names of the same biomes in Minecraft: Java Edition 1.16. Keys - Java Edition names. Values - Bedrock edition names.
{
"badlands_plateau": "mesa_plateau",
"badlands": "mesa",
"dark_forest_hills": "roofed_forest_mutated",
"dark_forest": "roofed_forest",
"desert_lakes": "desert_mutated",
"eroded_badlands": "mesa_bryce",
"giant_spruce_taiga_hills": "redwood_taiga_hills_mutated",
"giant_spruce_taiga": "redwood_taiga_mutated",
"giant_tree_taiga_hills": "mega_taiga_hills",
@DMHYT
DMHYT / convertQuadsToTriangles.ts
Created September 13, 2023 19:06
QuadsConverter
const convertQuadsToTriangles = (objString: string) => {
const lines = objString.split("\n");
const newLines = [];
lines.forEach((line, i) => {
if(line.startsWith("f ")) {
const faceVertices = line.split(" ").slice(1);
if(faceVertices.length === 3) newLines.push(line);
else if(faceVertices.length === 4) {
newLines.push(
`f ${faceVertices[0]} ${faceVertices[1]} ${faceVertices[2]}`,
@DMHYT
DMHYT / yunzhan.py
Last active October 19, 2025 13:20
yunzhan365.com PDF downloader
# Fetches yunzhan365.com book contents and saves it to PDF.
# Really slow but I just wanted to make this work in any way.
# Third-party modules: requests, selenium, pillow
# Usage: python yunzhan.py <needed yunzhan book url>
from io import BytesIO
from json import dumps, loads
from math import floor
import requests