Skip to content

Instantly share code, notes, and snippets.

@Niko-sk2x
Niko-sk2x / arduino-multitasking-bare-minimum.ino
Created September 17, 2016 18:43
Bare minimum preemptive multitasking code for arduino
typedef struct {
uint8_t taskStatus = 0;
uint16_t R_SP;
} Regs;
const size_t MAX_TASKS = 2;
Regs tasks[MAX_TASKS];
uint8_t currentTask = 0;
void setup() {
@Niko-sk2x
Niko-sk2x / 1.13-Worldgen.md
Last active September 4, 2022 14:06
MC 1.13 Worldgen

Overview of changes

  • net.minecraftforge.fml.common.IWorldGenerator -> net.minecraft.world.gen.feature.Feature
    • No longer needed. I think it should be removed by forge, as it has been superseded by vanilla functionality. See below.
  • net.minecraft.world.gen.feature.WorldGenerator -> net.minecraft.world.gen.feature.Feature
    • This would also be the most common replacement of Forge's IWorldGenerator. This should be the solution for anything smaller than a chunk.
    • Except the 8 blocks offset. This is not a thing anymore. Population now works just like any normal person would expect.
    • Position of features is controlled by instances of net.minecraft.world.gen.placement.BasePlacement instead of by the feature itself.
  • net.minecraft.world.gen.MapGenBase -> net.minecraft.world.gen.carver.IWorldCarver
  • This is now finally exposed to mods in a useful way. As it was mostly hidden from modders before, not eveyone may know what it is, so it will be explained later. Generates caves a
@Niko-sk2x
Niko-sk2x / build.gradle
Created January 18, 2015 03:12
build.gradle for Craftbukkit/Spigot 1.8
apply plugin: 'java'
//this is the same ad Maven groupID
//usually it refers to domain name you own. If your domain is tutorial.bukkit.com then your droupID is com.bukkit.tutorial
group = 'com.tutorial'
//the same as Maven artifactID. This will be used as base for jar name. Usually the same as plugin name
archivesBaseName = 'Tutorial'
//Plugin version. "-SNAPSHOT" at the end is reserved for development versions.
version = '1.0-SNAPSHOT'
@Niko-sk2x
Niko-sk2x / ForgeSystemProperties.md
Last active January 19, 2021 08:31
Forge system properties

Forge

Property Description Default value
b3dloader.printLoadedModels false
fml.doNotBackup don't backup world when loading with missing registry entries false
fml.queryResult specifies accepting loading world with missing registry entries false
fml.noGrab disable mouse grab false
forge.enableExtendedSave enable saving chunks >1MB in size true
forge.verboseMissingModelLogging false
@Niko-sk2x
Niko-sk2x / CubeProviderDebug.java
Last active October 13, 2020 23:00
Simple GUI for TWM that shows loaded columns around player. Useful for debugging.
package dbg;
import it.unimi.dsi.fastutil.ints.IntArrayList;
import it.unimi.dsi.fastutil.ints.IntList;
import it.unimi.dsi.fastutil.longs.Long2ObjectMap;
import it.unimi.dsi.fastutil.longs.Long2ObjectOpenHashMap;
import net.minecraft.client.Minecraft;
import net.minecraft.client.multiplayer.ChunkProviderClient;
import net.minecraft.client.multiplayer.WorldClient;
import net.minecraft.entity.player.EntityPlayer;
@Niko-sk2x
Niko-sk2x / build.gradle.kts
Created November 20, 2016 18:24
CubicChunks gradle buildscript in kotlin
import com.github.jengelman.gradle.plugins.shadow.ShadowPlugin
import com.github.jengelman.gradle.plugins.shadow.tasks.ShadowJar
import net.minecraftforge.gradle.user.ReobfMappingType
import net.minecraftforge.gradle.user.ReobfTaskFactory
import net.minecraftforge.gradle.user.patcherUser.forge.ForgeExtension
import net.minecraftforge.gradle.user.patcherUser.forge.ForgePlugin
import nl.javadude.gradle.plugins.license.LicenseExtension
import nl.javadude.gradle.plugins.license.LicensePlugin
import org.ajoberstar.grgit.Grgit
import org.ajoberstar.grgit.operation.DescribeOp
@Niko-sk2x
Niko-sk2x / DiscordInfo
Last active August 1, 2019 00:26
CubicChunks discord info
<<https://raw.githubusercontent.com/OpenCubicChunks/CubicChunks/9038dec47469ba24e64c9957052a9c52e349182c/src/main/resources/cubicchunks/logo.png>>
=>
...
is a mod allowing you to build pretty much as high or dig as low as you want. It is compatible with many mods, including Optifine with shaders!
Where this mod excels is in the terrain generation of CustomCubic worldtype with CubicWorldGen sub-mod, which requires MalisisCore for complete functionality.
Original mod by Robinton (2011). Current mod created by Barteks2x.
**NOT COMPATIBLE WITH MCEDIT, SPONGE or BUKKIT**
WorldEdit: Compatible build in #cc_add-ons
@Niko-sk2x
Niko-sk2x / liveMcpMappings.sh
Last active July 2, 2019 16:27
A script to start local maven sfile server with live MCPBot exports. Use channel "live" and version number shown just before starting HTTP server in buildscript, add maven repository with URL "http://127.0.0.1:8000/". If everything is working, you should see the mappings file being accessed in HTTP server output.
#!/bin/bash
tmp_dir=$(mktemp -p "" -d -t liveMcpMappings-XXXXXXXXXX)
version_string=$RANDOM
echo Downloading live mappings to temporary directory $tmp_dir
cd $tmp_dir
wget -o /dev/null http://export.mcpbot.bspk.rs/fields.csv || echo "Downloading field.csv failed"
wget -o /dev/null http://export.mcpbot.bspk.rs/methods.csv || echo "Downloading methods.csv failed"
wget -o /dev/null http://export.mcpbot.bspk.rs/params.csv || echo "Downloading params.csv failed"
@Niko-sk2x
Niko-sk2x / build.gradle.kts
Created June 13, 2019 16:14
ForgeGradle3 buildscript using kotlin DSL. Note: Start with initial.build.gradle.kts and run task kotlinDslAccessorsSnapshot
import java.text.SimpleDateFormat
import java.util.*
buildscript {
repositories {
maven { setUrl("https://files.minecraftforge.net/maven") }
jcenter()
mavenCentral()
}
dependencies {
<<https://raw.githubusercontent.com/OpenCubicChunks/CubicChunks/9038dec47469ba24e64c9957052a9c52e349182c/src/main/resources/cubicchunks/logo.png>>
=>
<:cubicchunks:339448515027664896> CUBIC CHUNKS (CC)<:cubicchunks:339448515027664896>
...is a mod allowing you to build pretty much as high or dig as low as you want. At present it is not available on Curseforge until it becomes full alpha. It is compatible with many mods, including Optifine with shaders!
Where this mod excels is in the terrain generation of CustomCubic worldtype, which requires MalisisCore to function.
Original mod by Robinton (2011). Current mod created by Barteks2x.
**NOT COMPATIBLE WITH** WORLDPAINTER, MCEDIT OR WORLDEDIT