Skip to content

Instantly share code, notes, and snippets.

View spacechase0's full-sized avatar

Casey W spacechase0

View GitHub Profile
@spacechase0
spacechase0 / content.json
Created March 7, 2024 01:13
Custom shop tabs
{
"Action":"EditData",
"Target":"spacechase0.SpaceCore/ShopExtensionData",
"Entries":
{
"SeedShop":
{
"Tabs": "Custom",
"CustomTabs": [
@spacechase0
spacechase0 / content.json
Created March 7, 2024 01:10
Furniture Tile Properties Example
{
"Action":"EditData",
"Target":"spacechase0.SpaceCore/FurnitureExtensionData",
"Entries":
{
"1304":
{
"TileProperties": {
"0, 0": {
"Buildings": {
{
"Format": "1.24.0",
"Changes": [
{
"Action": "EditData",
"Target": "spacechase0.MonstersTheFramework/Monsters",
"Entries": {
"SpookySkeletonMage": {
"Name": "{{i18n: spooky-skeleton-mage}}",
"CorrespondingMonsterGoal": "Skeleton Mage",
@spacechase0
spacechase0 / Program.cs
Last active August 19, 2021 15:02
Adding fields dynamically to XMLSerializer test
using HarmonyLib;
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Globalization;
using System.IO;
using System.Linq;
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Text;
@spacechase0
spacechase0 / Root.gd
Created July 9, 2021 07:57
SpaceECS v2
extends Node2D
func _physics_process(delta):
var vels = get_tree().get_nodes_in_group( "components/VelocityComponent" )
for node in vels:
var vel = node.get_component( "VelocityComponent" )
node.move_and_collide( vel.velocity * delta )
@spacechase0
spacechase0 / Root.gd
Created July 8, 2021 06:42
SpaceECS (name subject to change)
extends Node2D
func _physics_process(delta):
var vels = get_tree().get_nodes_in_group( "components/VelocityComponent" )
for node in vels:
var vel = ComponentServer.get_component( node, "VelocityComponent" )
node.move_and_collide( vel.velocity * delta )
var velsCS = get_tree().get_nodes_in_group( "components/VelocityCSComponent" )
for node in velsCS:
@spacechase0
spacechase0 / JsonHelper.cs
Last active January 25, 2021 01:07
Net type serialization
namespace StardewModdingAPI.Toolkit.Serialization
{
public class MyNetConverter : JsonConverter
{
public override bool CanRead => true;
public override bool CanWrite => true;
public override bool CanConvert( Type objectType )
{
//Console.WriteLine( "checking " + objectType );
return typeof( AbstractNetSerializable ).IsAssignableFrom( objectType );
@spacechase0
spacechase0 / Mod.cs
Last active January 21, 2021 04:40
SDV/SMAPI custom net root
using Harmony;
using Netcode;
using SpaceShared;
using StardewModdingAPI;
using StardewModdingAPI.Events;
using StardewModdingAPI.Utilities;
using StardewValley;
using StardewValley.Network;
using System;
using System.Collections.Generic;
@spacechase0
spacechase0 / CecilMod.cs
Created August 14, 2020 10:56
BiggerCraftables.Cecil
using Mono.Cecil;
using Mono.Cecil.Cil;
using Netcode;
using StardewModdingAPI;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
@spacechase0
spacechase0 / .cs
Last active May 12, 2021 07:28
Generic Mod Config Menu example
// Your config class
public class DummyConfig
{
public bool dummyBool = true;
public int dummyInt1 = 50;
public int dummyInt2 = 50;
public float dummyFloat1 = 0.5f;
public float dummyFloat2 = 0.5f;
public string dummyString1 = "Kirby";
public string dummyString2 = "Default";