Skip to content

Instantly share code, notes, and snippets.

@flammpfeil
flammpfeil / Patch_MaxPack.xml
Last active October 6, 2024 13:34
A sample patch for giving other vehicle mods the same InteriorSpace as my RVmod.
<?xml version="1.0" encoding="utf-8" ?>
<Patch>
<Operation Class="PatchOperationConditional">
<xpath>Defs/Vehicles.VehicleDef[defName='SK_MaxPack']</xpath>
<match Class="PatchOperationConditional">
<xpath>Defs/Vehicles.VehicleDef[defName='SK_MaxPack']/comps</xpath>
<nomatch Class="PatchOperationAdd">
<xpath>Defs/Vehicles.VehicleDef[defName='SK_MaxPack']</xpath>
<value>
@flammpfeil
flammpfeil / Z_RatkinGeneExpandComat.xml
Last active August 8, 2024 05:04
[OA]RGExpand と RGExpandedを共存させるためのパッチです。
<?xml version="1.0" encoding="utf-8" ?>
<Patch>
<!--■■■■■■■■■■ RO RGEpand + RGExpanded ■■■■■■■■■■■■-->
<!-- compat patch
**Load order***
[OA]Ratkin Gene Expand
Ratkin Gene Expanded <-こいつのPatchフォルダにこのファイルを入れるのでも可
*this*
@flammpfeil
flammpfeil / 1.12.xの時用.md
Last active January 27, 2022 10:35
ideaとかでModdingプロジェクト作るとき手順

SlashBlade

本リポジトリの使い方

  1. 開発環境の作成
    • 用意できてるなら不要です。
    1. 初期設定 gradlew setupDevWorkspace setupDecompWorkspace idea できたiprを開く
@flammpfeil
flammpfeil / NBTHelper.java
Created February 14, 2020 18:07
NBTなんかするやつ
package mods.flammpfeil.slashblade.util;
import net.minecraft.nbt.*;
import net.minecraft.util.math.Vec3d;
import java.util.Optional;
import java.util.UUID;
import java.util.function.Consumer;
public class NBTHelper {
@flammpfeil
flammpfeil / i2j.java
Created December 6, 2019 17:43
ItemStack to json
hoge(ItemStack stack, World worldIn){
JsonObject ret = new JsonObject();
ret.addProperty("item", stack.getItem().getRegistryName().toString());
if (stack.getCount() != 1)
ret.addProperty("count", stack.getCount());
CompoundNBT tag = new CompoundNBT();
stack.write(tag);
@flammpfeil
flammpfeil / ModelBipedPA.java
Last active December 4, 2019 16:07
Item.getArmorModelで返す防具モデルのお手軽実装ひな型的な
package mods.flammpfeil.armor;
import mods.flammpfeil.slashblade.client.model.obj.WavefrontObject;
import net.minecraft.client.model.ModelBiped;
import net.minecraft.entity.Entity;
import net.minecraft.entity.EntityLivingBase;
import net.minecraft.inventory.EntityEquipmentSlot;
import net.minecraft.util.ResourceLocation;
import mods.flammpfeil.slashblade.client.model.*;
@flammpfeil
flammpfeil / SubMeshInspectorWindow.cs
Last active February 4, 2020 11:31
SubMeshの順序入れ替え、統合なんかをする感じのやつ。 RenderQueueでソートもできる。
using UnityEngine;
using UnityEditor;
using System;
using System.Collections.Generic;
using UTJ.VertexTweaker;
using UTJ.BlendShapeBuilder;
using System.Linq;
using System.Text.RegularExpressions;
namespace UTJ.BlendShapeBuilderEditor
@flammpfeil
flammpfeil / MToonSM3.cginc
Last active March 15, 2019 14:59
まゆげ髪透かし用小細工
v2f vert_forward_base(appdata_full v)
{
//MToon改造用なので適当に_ShadeToonyのスライダパラメータを拾ってきている。
//どれだけカメラ側に移動するか
float offset = _ShadeToony*0.05f;
//視線方向ベクトル
float3 viewDirection = normalize(_WorldSpaceCameraPos.xyz - mul(unity_ObjectToWorld, v.vertex).xyz);
//視線方向へ頂点位置にモデルローカル空間でオフセットを与える
@flammpfeil
flammpfeil / LICENSE
Last active December 30, 2018 10:58
PMXE用材質ソートCSScript
Copyright (c) 2018 furia
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER D
@flammpfeil
flammpfeil / v.java
Last active October 20, 2018 14:27
worldpos to screenpos?
import org.lwjgl.opengl.GL11;
import javax.vecmath.Matrix4f;
import javax.vecmath.Vector2f;
import javax.vecmath.Vector3f;
Vector2f getScreenPos(Vector3f pos){
GL11.glMatrixMode(GL11.GL_PROJECTION);
FloatBuffer fbuf;
GL11.glGetDouble(GL11.GL_PROJECTION_MATRIX, fbuf); //現在の投影変換行列取得