Compare commits

...
Sign in to create a new pull request.

3 commits

18 changed files with 988 additions and 1266 deletions

View file

@ -1,22 +1,16 @@
<?xml version="1.0" encoding="utf-8"?>
<Project DefaultTargets="Build" ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
<ProjectGuid>{180853A2-7E1D-4876-9D1E-AA8608D701C3}</ProjectGuid>
<TargetFramework>net7.0</TargetFramework>
<OutputType>Library</OutputType>
<RootNamespace>FirstMachineAge</RootNamespace>
<AssemblyName>AccessControls</AssemblyName>
<TargetFrameworkVersion>v4.5</TargetFrameworkVersion>
<GenerateAssemblyInfo>false</GenerateAssemblyInfo>
<AssemblyTitle>AccessControls</AssemblyTitle>
<Copyright>Melchior</Copyright>
<AssemblyVersion>1.0.*</AssemblyVersion>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
<DebugSymbols>true</DebugSymbols>
<DebugType>full</DebugType>
<Optimize>false</Optimize>
<OutputPath>bin\Debug</OutputPath>
<DefineConstants>DEBUG;</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
<ConsolePause>false</ConsolePause>
<CustomCommands>
<CustomCommands>
@ -26,58 +20,35 @@
</CustomCommands>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
<Optimize>true</Optimize>
<OutputPath>bin\Release</OutputPath>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
<ConsolePause>false</ConsolePause>
</PropertyGroup>
<ItemGroup>
<Reference Include="System" />
<Reference Include="VintagestoryAPI">
<HintPath>..\FirstMachineAge_Common\vs_libs\VintagestoryAPI.dll</HintPath>
<HintPath>$(VINTAGE_STORY)\VintagestoryAPI.dll</HintPath>
<Private>False</Private>
</Reference>
<Reference Include="VSEssentials">
<HintPath>..\FirstMachineAge_Common\vs_libs\VSEssentials.dll</HintPath>
<HintPath>$(VINTAGE_STORY)\mods\VSEssentials.dll</HintPath>
<Private>False</Private>
</Reference>
<Reference Include="VSCreativeMod">
<HintPath>..\FirstMachineAge_Common\vs_libs\VSCreativeMod.dll</HintPath>
<HintPath>$(VINTAGE_STORY)\mods\VSCreativeMod.dll</HintPath>
<Private>False</Private>
</Reference>
<Reference Include="VSSurvivalMod">
<HintPath>..\FirstMachineAge_Common\vs_libs\VSSurvivalMod.dll</HintPath>
<HintPath>$(VINTAGE_STORY)\mods\VSSurvivalMod.dll</HintPath>
<Private>False</Private>
</Reference>
<Reference Include="protobuf-net">
<HintPath>..\FirstMachineAge_Common\vs_libs\protobuf-net.dll</HintPath>
<HintPath>$(VINTAGE_STORY)\lib\protobuf-net.dll</HintPath>
<Private>False</Private>
</Reference>
<Reference Include="VintagestoryLib">
<HintPath>..\FirstMachineAge_Common\vs_libs\VintagestoryLib.dll</HintPath>
<HintPath>$(VINTAGE_STORY)\VintagestoryLib.dll</HintPath>
<Private>False</Private>
</Reference>
</ItemGroup>
<ItemGroup>
<Compile Include="AccessControlMod.cs" />
<Compile Include="Properties\AssemblyInfo.cs" />
<Compile Include="behaviors\BlockBehaviorComplexLockable.cs" />
<Compile Include="GUIs\GuiDialog_ComboLock.cs" />
<Compile Include="items\ItemCombolock.cs" />
<Compile Include="LocksmithCmd.cs" />
<Compile Include="GroupLocksCmd.cs" />
<Compile Include="items\GenericLock.cs" />
<Compile Include="items\GenericKey.cs" />
<Compile Include="data\AccessControlNode.cs" />
<Compile Include="data\LockStatus.cs" />
<Compile Include="data\LockKinds.cs" />
<Compile Include="data\ACLPersisted.cs" />
<Compile Include="data\LockGUIMessage.cs" />
<Compile Include="data\LockCacheNode.cs" />
<Compile Include="AccessControls_Internals.cs" />
<Compile Include="items\ItemKeylock.cs" />
</ItemGroup>
<ItemGroup>
<Folder Include="assets\" />
<Folder Include="assets\fma\" />
@ -92,37 +63,32 @@
<Folder Include="assets\fma\shapes\item\access_controls\" />
</ItemGroup>
<ItemGroup>
<None Include="assets\fma\itemtypes\locks\combolock.json">
<None Update="assets\fma\itemtypes\locks\combolock.json">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</None>
<None Include="assets\fma\textures\locks\brass_symbols.png">
<None Update="assets\fma\textures\locks\brass_symbols.png">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</None>
<None Include="modinfo.json">
<None Update="modinfo.json">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</None>
<None Include="assets\fma\itemtypes\locks\key.json">
<None Update="assets\fma\itemtypes\locks\key.json">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</None>
<None Include="assets\fma\shapes\item\access_controls\combo_lock1.json">
<None Update="assets\fma\shapes\item\access_controls\combo_lock1.json">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</None>
<None Include="assets\fma\shapes\item\access_controls\key1.json">
<None Update="assets\fma\shapes\item\access_controls\key1.json">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</None>
<None Include="assets\fma\shapes\item\access_controls\barrel_lock.json">
<None Update="assets\fma\shapes\item\access_controls\barrel_lock.json">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</None>
<None Include="assets\fma\itemtypes\locks\keylock.json">
<None Update="assets\fma\itemtypes\locks\keylock.json">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</None>
<None Include="LICENSE.txt" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\FirstMachineAge_Common\Common.csproj">
<Project>{DE0A4E7D-E5FA-441D-A11A-8279E6AC5BBC}</Project>
<Name>Common</Name>
</ProjectReference>
<ProjectReference Include="..\FirstMachineAge_Common\Common.csproj" />
</ItemGroup>
<Import Project="$(MSBuildBinPath)\Microsoft.CSharp.targets" />
</Project>

View file

@ -1,27 +1,11 @@
using System.Reflection;
using System.Runtime.CompilerServices;
// Information about this assembly is defined by the following attributes.
// Change them to the values specific to your project.
[assembly: AssemblyTitle("AccessControls")]
[assembly: AssemblyDescription("")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("")]
[assembly: AssemblyProduct("")]
[assembly: AssemblyCopyright("Melchior")]
[assembly: AssemblyTrademark("")]
[assembly: AssemblyCulture("")]
// The assembly version has the format "{Major}.{Minor}.{Build}.{Revision}".
// The form "{Major}.{Minor}.*" will automatically update the build and revision,
// and "{Major}.{Minor}.{Build}.*" will update just the revision.
[assembly: AssemblyVersion("1.0.*")]
// The following attributes are used to specify the signing key for the assembly,
// if desired. See the Mono documentation for more information about signing.
//[assembly: AssemblyDelaySign(false)]
//[assembly: AssemblyKeyFile("")]
using System.Reflection;
using System.Runtime.CompilerServices;
[assembly: AssemblyTrademark("")]
[assembly: AssemblyCulture("")]
// The following attributes are used to specify the signing key for the assembly,
// if desired. See the Mono documentation for more information about signing.
//[assembly: AssemblyDelaySign(false)]
//[assembly: AssemblyKeyFile("")]

View file

@ -1,22 +1,18 @@
<?xml version="1.0" encoding="utf-8"?>
<Project DefaultTargets="Build" ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
<ProjectGuid>{3EC9A581-655C-4F68-898C-4E773C292082}</ProjectGuid>
<TargetFramework>net7.0</TargetFramework>
<OutputType>Library</OutputType>
<RootNamespace>AnvilMetalRecovery</RootNamespace>
<AssemblyName>AnvilMetalRecovery</AssemblyName>
<TargetFrameworkVersion>v4.6.1</TargetFrameworkVersion>
<GenerateAssemblyInfo>false</GenerateAssemblyInfo>
<AssemblyTitle>AnvilMetalRecovery</AssemblyTitle>
<Description>Mod plugin for V.S.</Description>
<Configuration>DEBUG</Configuration>
<Product>First_Machine_Age_component</Product>
<Copyright>Melchior</Copyright>
<AssemblyVersion>0.2.0</AssemblyVersion>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
<DebugSymbols>true</DebugSymbols>
<DebugType>full</DebugType>
<Optimize>false</Optimize>
<OutputPath>bin\Debug</OutputPath>
<DefineConstants>DEBUG;</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
<ConsolePause>false</ConsolePause>
<CustomCommands>
<CustomCommands>
@ -26,10 +22,7 @@
</CustomCommands>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
<Optimize>true</Optimize>
<OutputPath>bin\Release</OutputPath>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
<ConsolePause>false</ConsolePause>
<CustomCommands>
<CustomCommands>
@ -39,100 +32,72 @@
</CustomCommands>
</PropertyGroup>
<ItemGroup>
<Reference Include="System" />
<Reference Include="VintagestoryAPI">
<HintPath>vs_libs\VintagestoryAPI.dll</HintPath>
<HintPath>$(VINTAGE_STORY)\VintagestoryAPI.dll</HintPath>
<Private>False</Private>
</Reference>
<Reference Include="VintagestoryLib">
<HintPath>vs_libs\VintagestoryLib.dll</HintPath>
<HintPath>$(VINTAGE_STORY)\VintagestoryLib.dll</HintPath>
<Private>False</Private>
</Reference>
<Reference Include="VSCreativeMod">
<HintPath>vs_libs\VSCreativeMod.dll</HintPath>
<HintPath>$(VINTAGE_STORY)\mods\VSCreativeMod.dll</HintPath>
<Private>False</Private>
</Reference>
<Reference Include="VSEssentials">
<HintPath>vs_libs\VSEssentials.dll</HintPath>
<HintPath>$(VINTAGE_STORY)\mods\VSEssentials.dll</HintPath>
<Private>False</Private>
</Reference>
<Reference Include="VSSurvivalMod">
<HintPath>vs_libs\VSSurvivalMod.dll</HintPath>
<Private>False</Private>
</Reference>
<Reference Include="Newtonsoft.Json">
<HintPath>vs_libs\Newtonsoft.Json.dll</HintPath>
<HintPath>$(VINTAGE_STORY)\mods\VSSurvivalMod.dll</HintPath>
<Private>False</Private>
</Reference>
<Reference Include="0Harmony">
<HintPath>vs_libs\0Harmony.dll</HintPath>
<HintPath>$(VINTAGE_STORY)\lib\0Harmony.dll</HintPath>
<Private>False</Private>
</Reference>
<Reference Include="protobuf-net">
<HintPath>vs_libs\protobuf-net.dll</HintPath>
<HintPath>$(VINTAGE_STORY)\lib\protobuf-net.dll</HintPath>
<Private>False</Private>
</Reference>
</ItemGroup>
<ItemGroup>
<Compile Include="MetalRecoverySystem.cs" />
<Compile Include="Properties\AssemblyInfo.cs" />
<Compile Include="Helpers.cs" />
<Compile Include="EntityBehaviors\HotbarObserverData.cs" />
<Compile Include="Data\RecoveryEntry.cs" />
<Compile Include="Items\VariableMetalItem.cs" />
<Compile Include="Items\SmartSmeltableItem.cs" />
<Compile Include="Harmony\AnvilDaptor.cs" />
<Compile Include="MetalRecoverySystem_Components.cs" />
<Compile Include="Harmony\GenericItemMortalityDetector.cs" />
<Compile Include="Data\AMR_Config.cs" />
<Compile Include="Data\RecoveryEntryTable.cs" />
<Compile Include="BlockBehaviors\MoldDestructionRecovererBehavior.cs" />
<Compile Include="Harmony\WateringCanDaptor.cs" />
<Compile Include="Data\MetalInfo.cs" />
</ItemGroup>
<ItemGroup>
<None Include="modinfo.json">
<None Update="modinfo.json">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</None>
<None Include="assets\fma\itemtypes\metal\metal_shavings.json">
<None Update="assets\fma\itemtypes\metal\metal_shavings.json">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</None>
<None Include="assets\fma\shapes\item\metal\metal_shavings.json">
<None Update="assets\fma\shapes\item\metal\metal_shavings.json">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</None>
<None Include="assets\fma\lang\en.json">
<None Update="assets\fma\lang\en.json">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</None>
<None Include="assets\fma\lang\pt-br.json">
<None Update="assets\fma\lang\pt-br.json">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</None>
<None Include="assets\fma\patches\hotbarobserver_for_playerentity.json">
</None>
<None Include="modicon.png">
<None Update="modicon.png">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</None>
<None Include="assets\fma\shapes\item\metal\fragments.json">
<None Update="assets\fma\shapes\item\metal\fragments.json">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</None>
<None Include="assets\fma\itemtypes\metal\fragments.json">
<None Update="assets\fma\itemtypes\metal\fragments.json">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</None>
<None Include="BlockEntities\MetalRecovery_BlockEntityAnvil.cs" />
<None Include="assets\fma\lang\de.json">
<None Update="assets\fma\lang\de.json">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</None>
<None Include="EntityBehaviors\HotbarObserverBehavior.cs" />
<None Include="assets\fma\recipes\grid\variableMetal_smash.json">
<None Update="assets\fma\recipes\grid\variableMetal_smash.json">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</None>
<None Include="assets\fma\lang\ru.json">
<None Update="assets\fma\lang\ru.json">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</None>
<None Include="assets\fma\patches\wateringcan_behavior.json">
</None>
<None Include="Blocks\BlockWateringCanPlus.cs" />
<None Include="assets\fma\patches\old_item_remapping.json">
</None>
</ItemGroup>
<ItemGroup>
<Folder Include="assets\" />
@ -160,5 +125,13 @@
<Folder Include="assets\fma\sounds\sfx\" />
<Folder Include="BlockBehaviors\" />
</ItemGroup>
<Import Project="$(MSBuildBinPath)\Microsoft.CSharp.targets" />
<ItemGroup>
<Compile Remove="BlockEntities\MetalRecovery_BlockEntityAnvil.cs" />
<Compile Remove="Blocks\BlockWateringCanPlus.cs" />
<Compile Remove="CollectableBehaviors\DirectSprayCooler_Behavior.cs" />
<Compile Remove="EntityBehaviors\HotbarObserverBehavior.cs" />
</ItemGroup>
<ItemGroup>
<PackageReference Include="Newtonsoft.Json" Version="13.0.3" />
</ItemGroup>
</Project>

View file

@ -1,97 +1,97 @@
using System;
using Vintagestory.API.Client;
using Vintagestory.API.Common;
using Vintagestory.API.Common.Entities;
using Vintagestory.API.Config;
using Vintagestory.API.Datastructures;
using Vintagestory.API.MathTools;
using Vintagestory.API.Server;
using Vintagestory.GameContent;
namespace AnvilMetalRecovery
{
public class MoldDestructionRecovererBehavior : BlockBehavior
{
public static readonly string BehaviorClassName = @"MoldDestructionRecoverer";
private readonly AssetLocation MetalBits_partial = new AssetLocation(GlobalConstants.DefaultDomain, @"metalbit");
private const int shavingValue = 5;
public MoldDestructionRecovererBehavior(Block block) : base(block)
{
}
public override void OnBlockBroken(IWorldAccessor world, BlockPos pos, IPlayer byPlayer, ref EnumHandling handling)
{
if (world.Api.Side.IsClient( )) return;
ICoreAPI CoreAPI = world.Api;
ICoreServerAPI ServerAPI = world.Api as ICoreServerAPI;
#if DEBUG
world.Api.Logger.VerboseDebug("MoldDestructionRecovererBehavior::OnBlockBroken");
#endif
var someBlock = ServerAPI.World.BlockAccessor.GetBlock(pos);
var someBlockEntity = ServerAPI.World.BlockAccessor.GetBlockEntity(pos);
if (someBlockEntity is BlockEntityIngotMold) {
var ingotMold = someBlockEntity as BlockEntityIngotMold;
#if DEBUG
world.Api.Logger.VerboseDebug("{0} Ingot Mold(s) with L {1} Units, R {2} Units", ingotMold.quantityMolds, ingotMold.fillLevelLeft, ingotMold.fillLevelRight);
#endif
if ( ingotMold.fillLevelLeft >= shavingValue && ingotMold.contentsLeft != null)
{
var ingotMetal = ingotMold.contentsLeft.Collectible.Variant[@"metal"];
SpawnMetalBits(world, pos, ingotMold.fillLevelLeft, ingotMetal);
}
if ( ingotMold.fillLevelRight >= shavingValue && ingotMold.contentsRight != null)
{
var ingotMetal = ingotMold.contentsLeft.Collectible.Variant[@"metal"];
SpawnMetalBits(world, pos, ingotMold.fillLevelRight, ingotMetal);
}
return;
}
if (someBlockEntity is BlockEntityToolMold) {
var toolMold = someBlockEntity as BlockEntityToolMold;
#if DEBUG
world.Api.Logger.VerboseDebug("Tool Mold with {0} Units", toolMold.fillLevel);
#endif
if ( toolMold.fillLevel >= shavingValue && toolMold.metalContent != null)
{
var metalCode = toolMold.metalContent.Collectible.Variant.AnyKeys(@"metal", @"material");
SpawnMetalBits(world, pos, toolMold.fillLevel, metalCode);
}
}
}
internal void SpawnMetalBits(IWorldAccessor world, BlockPos pos, int unitQuantity, string baseMetalCode)
{
if (unitQuantity > 0 && pos != null && !string.IsNullOrEmpty(baseMetalCode))
{
int shavingQty = unitQuantity / shavingValue;
Item metalShavingsItem = world.Api.World.GetItem(MetalBits_partial.AppendPathVariant(baseMetalCode));
if (shavingQty >= 1 && metalShavingsItem != null)
{
var metalShavingsStack = new ItemStack(metalShavingsItem, shavingQty);
#if DEBUG
world.Api.Logger.VerboseDebug("Creating '{0}' @{1} *{2} Units",metalShavingsItem, pos, shavingQty);
#endif
world.Api.World.SpawnItemEntity(metalShavingsStack, pos.ToVec3d( ).Add(0.1d, 0, 0));
}
}
}
}
}
using System;
using Vintagestory.API.Client;
using Vintagestory.API.Common;
using Vintagestory.API.Common.Entities;
using Vintagestory.API.Config;
using Vintagestory.API.Datastructures;
using Vintagestory.API.MathTools;
using Vintagestory.API.Server;
using Vintagestory.GameContent;
namespace AnvilMetalRecovery
{
public class MoldDestructionRecovererBehavior : BlockBehavior
{
public static readonly string BehaviorClassName = @"MoldDestructionRecoverer";
private readonly AssetLocation MetalBits_partial = new AssetLocation(GlobalConstants.DefaultDomain, @"metalbit");
private const int shavingValue = 5;
public MoldDestructionRecovererBehavior(Block block) : base(block)
{
}
public override void OnBlockBroken(IWorldAccessor world, BlockPos pos, IPlayer byPlayer, ref EnumHandling handling)
{
if (world.Api.Side.IsClient( )) return;
ICoreAPI CoreAPI = world.Api;
ICoreServerAPI ServerAPI = world.Api as ICoreServerAPI;
#if DEBUG
world.Api.Logger.VerboseDebug("MoldDestructionRecovererBehavior::OnBlockBroken");
#endif
var someBlock = ServerAPI.World.BlockAccessor.GetBlock(pos);
var someBlockEntity = ServerAPI.World.BlockAccessor.GetBlockEntity(pos);
if (someBlockEntity is BlockEntityIngotMold) {
var ingotMold = someBlockEntity as BlockEntityIngotMold;
#if DEBUG
world.Api.Logger.VerboseDebug("{0} Ingot Mold(s) with L {1} Units, R {2} Units", ingotMold.QuantityMolds, ingotMold.FillLevelLeft, ingotMold.FillLevelRight);
#endif
if ( ingotMold.FillLevelLeft >= shavingValue && ingotMold.ContentsLeft != null)
{
var ingotMetal = ingotMold.ContentsLeft.Collectible.Variant[@"metal"];
SpawnMetalBits(world, pos, ingotMold.FillLevelLeft, ingotMetal);
}
if ( ingotMold.FillLevelRight >= shavingValue && ingotMold.ContentsRight != null)
{
var ingotMetal = ingotMold.ContentsLeft.Collectible.Variant[@"metal"];
SpawnMetalBits(world, pos, ingotMold.FillLevelRight, ingotMetal);
}
return;
}
if (someBlockEntity is BlockEntityToolMold) {
var toolMold = someBlockEntity as BlockEntityToolMold;
#if DEBUG
world.Api.Logger.VerboseDebug("Tool Mold with {0} Units", toolMold.FillLevel);
#endif
if ( toolMold.FillLevel >= shavingValue && toolMold.MetalContent != null)
{
var metalCode = toolMold.MetalContent.Collectible.Variant.AnyKeys(@"metal", @"material");
SpawnMetalBits(world, pos, toolMold.FillLevel, metalCode);
}
}
}
internal void SpawnMetalBits(IWorldAccessor world, BlockPos pos, int unitQuantity, string baseMetalCode)
{
if (unitQuantity > 0 && pos != null && !string.IsNullOrEmpty(baseMetalCode))
{
int shavingQty = unitQuantity / shavingValue;
Item metalShavingsItem = world.Api.World.GetItem(MetalBits_partial.AppendPathVariant(baseMetalCode));
if (shavingQty >= 1 && metalShavingsItem != null)
{
var metalShavingsStack = new ItemStack(metalShavingsItem, shavingQty);
#if DEBUG
world.Api.Logger.VerboseDebug("Creating '{0}' @{1} *{2} Units",metalShavingsItem, pos, shavingQty);
#endif
world.Api.World.SpawnItemEntity(metalShavingsStack, pos.ToVec3d( ).Add(0.1d, 0, 0));
}
}
}
}
}

View file

@ -1,177 +1,177 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Reflection;
using System.Text;
using HarmonyLib;
using Vintagestory.API.Client;
using Vintagestory.API.Common;
using Vintagestory.API.Config;
using Vintagestory.API.Datastructures;
using Vintagestory.API.MathTools;
using Vintagestory.API.Server;
using Vintagestory.GameContent;
namespace AnvilMetalRecovery.Patches
{
/// <summary>
/// Harmony patcher class to wrap Watering-can class
///</summary>
[HarmonyPatch(typeof(BlockWateringCan))]
public class WateringCanDaptor
{
[HarmonyPrepare]
private static bool DeduplicatePatching(MethodBase original, Harmony harmony)
{
if (original != null) {
foreach (var patched in harmony.GetPatchedMethods( )) {
if (patched.Name == original.Name) return false; //SKIPS PATCHING, its already there
}
}
return true;//patch all other methods
}
[HarmonyPostfix]
[HarmonyPatch(nameof(BlockWateringCan.OnHeldInteractStep))]
public static void OnHeldInteractStep(ref bool __result, float secondsUsed, ItemSlot slot, EntityAgent byEntity, BlockSelection blockSel, EntitySelection entitySel, BlockWateringCan __instance)
{
var coreAPI = byEntity.Api;
#if DEBUG
coreAPI.Logger.VerboseDebug("BlockWateringCanPlus::OnHeldInteractStep");
#endif
var wc = new WateringCanAssist(__instance, byEntity.Api);
wc.PerformBlockCooling(secondsUsed, slot, byEntity, blockSel, entitySel);
}
}
public class WateringCanAssist
{
private ICoreAPI CoreAPI { get; set; }
private ICoreServerAPI ServerAPI { get { return CoreAPI as ICoreServerAPI; } }
private ICoreClientAPI ClientAPI { get { return CoreAPI as ICoreClientAPI; } }
private BlockWateringCan Original { get; set; }
private const float coolRateDefault = 0.0075f;
private const float flashPointTemp = 100f;
private SimpleParticleProperties steamParticles = new SimpleParticleProperties {
MinPos = new Vec3d( ),
AddPos = new Vec3d( ),
MinQuantity = 6,
AddQuantity = 12,
Color = ColorUtil.ToRgba(100, 225, 225, 225),
OpacityEvolve = new EvolvingNatFloat(EnumTransformFunction.LINEAR, 1.0f),
GravityEffect = -0.015f,
WithTerrainCollision = false,
ShouldDieInLiquid = true,
ParticleModel = EnumParticleModel.Quad,
LifeLength = 2.0f,
MinVelocity = new Vec3f(-0.25f, 0.1f, -0.25f),
AddVelocity = new Vec3f(0.25f, 0.1f, 0.25f),
MinSize = 0.075f,
MaxSize = 0.1f,
WindAffected = true,
WindAffectednes = 0.4f,
};
public readonly AssetLocation CoolSoundEffect = new AssetLocation(@"game", @"sounds/sizzle");
public WateringCanAssist(BlockWateringCan original, ICoreAPI api)
{
this.CoreAPI = api;
this.Original = original;
}
public void PerformBlockCooling(float secondsUsed, ItemSlot slot, EntityAgent byEntity, BlockSelection blockSel, EntitySelection entitySel)
{
if (blockSel == null) return;
if (byEntity.Controls.Sneak) return;
if ((DateTime.Now.Millisecond / 100) % 2 == 1) return;
BlockPos targetPos = blockSel.Position;
if (!slot.Empty && Original.GetRemainingWateringSeconds(slot.Itemstack) >= 0.1f) {
var server = (CoreAPI.World.Side.IsServer( ));
var someBlock = CoreAPI.World.BlockAccessor.GetBlock(targetPos);
if (someBlock != null
&& someBlock.BlockMaterial == EnumBlockMaterial.Ceramic
&& (someBlock.Class == @"BlockIngotMold" || someBlock.Class == @"BlockToolMold")) {
var someBlockEntity = server ? ServerAPI.World.BlockAccessor.GetBlockEntity(targetPos) : ClientAPI.World.BlockAccessor.GetBlockEntity(targetPos);
#if DEBUG
CoreAPI.Logger.VerboseDebug("Ok, its an Tool/Ingot mold.: {0}", someBlockEntity);
#endif
if (someBlockEntity is BlockEntityIngotMold) {
var rightSide = AimAtRight(blockSel.HitPosition);
var ingotMold = someBlockEntity as BlockEntityIngotMold;
if (rightSide && (ingotMold.fillLevelRight > 0 && ingotMold.TemperatureRight > flashPointTemp)) {
if (server) CoolContents(ingotMold.contentsRight); else GenerateSpecialEffects(blockSel.Position, blockSel.HitPosition, byEntity as EntityPlayer);
ingotMold.MarkDirty( );
}
else if (ingotMold.fillLevelLeft > 0 && ingotMold.TemperatureLeft > flashPointTemp) {
if (server) CoolContents(ingotMold.contentsLeft); else GenerateSpecialEffects(blockSel.Position, blockSel.HitPosition, byEntity as EntityPlayer);
ingotMold.MarkDirty( );
}
return;
}
if (someBlockEntity is BlockEntityToolMold) {
var toolMold = someBlockEntity as BlockEntityToolMold;
if (toolMold.fillLevel > 0 && toolMold.Temperature > flashPointTemp) {
if (server) CoolContents(toolMold.metalContent); else GenerateSpecialEffects(blockSel.Position, blockSel.HitPosition, byEntity as EntityPlayer);
toolMold.MarkDirty( );
}
return;
}
}
}
}
internal void GenerateSpecialEffects(BlockPos blockLoc, Vec3d aimPoint, EntityPlayer playerEntity)
{
if ((DateTime.Now.Millisecond / 333) % 2 == 1) return;
steamParticles.MinPos = blockLoc.ToVec3d( ).AddCopy(aimPoint);
steamParticles.AddPos = new Vec3d(0.05f, 0f, 0.05f);
#if DEBUG
CoreAPI.Logger.VerboseDebug("Generate steam particles");
#endif
ClientAPI.World.SpawnParticles(steamParticles, playerEntity.Player);
ClientAPI.World.PlaySoundAt(CoolSoundEffect, playerEntity, playerEntity.Player, randomizePitch: false, volume: 0.5f);
}
internal void CoolContents(ItemStack itemStack)
{
var temperature = itemStack.Collectible.GetTemperature(CoreAPI.World, itemStack);
if (temperature > 20f)//TODO: USE local AMBIENT Temp
itemStack.Collectible.SetTemperature(CoreAPI.World, itemStack, temperature - (temperature * coolRateDefault), false);
(itemStack.Attributes["temperature"] as ITreeAttribute)?.SetFloat("cooldownSpeed", 400);
#if DEBUG
CoreAPI.Logger.VerboseDebug("Cooled Molten metal, temp: {0:F1} ", temperature);
#endif
}
internal bool AimAtRight(Vec3d hitPosition)
{
return hitPosition.X >= 0.5f;
}
}
using System;
using System.Collections.Generic;
using System.Linq;
using System.Reflection;
using System.Text;
using HarmonyLib;
using Vintagestory.API.Client;
using Vintagestory.API.Common;
using Vintagestory.API.Config;
using Vintagestory.API.Datastructures;
using Vintagestory.API.MathTools;
using Vintagestory.API.Server;
using Vintagestory.GameContent;
namespace AnvilMetalRecovery.Patches
{
/// <summary>
/// Harmony patcher class to wrap Watering-can class
///</summary>
[HarmonyPatch(typeof(BlockWateringCan))]
public class WateringCanDaptor
{
[HarmonyPrepare]
private static bool DeduplicatePatching(MethodBase original, Harmony harmony)
{
if (original != null) {
foreach (var patched in harmony.GetPatchedMethods( )) {
if (patched.Name == original.Name) return false; //SKIPS PATCHING, its already there
}
}
return true;//patch all other methods
}
[HarmonyPostfix]
[HarmonyPatch(nameof(BlockWateringCan.OnHeldInteractStep))]
public static void OnHeldInteractStep(ref bool __result, float secondsUsed, ItemSlot slot, EntityAgent byEntity, BlockSelection blockSel, EntitySelection entitySel, BlockWateringCan __instance)
{
var coreAPI = byEntity.Api;
#if DEBUG
coreAPI.Logger.VerboseDebug("BlockWateringCanPlus::OnHeldInteractStep");
#endif
var wc = new WateringCanAssist(__instance, byEntity.Api);
wc.PerformBlockCooling(secondsUsed, slot, byEntity, blockSel, entitySel);
}
}
public class WateringCanAssist
{
private ICoreAPI CoreAPI { get; set; }
private ICoreServerAPI ServerAPI { get { return CoreAPI as ICoreServerAPI; } }
private ICoreClientAPI ClientAPI { get { return CoreAPI as ICoreClientAPI; } }
private BlockWateringCan Original { get; set; }
private const float coolRateDefault = 0.0075f;
private const float flashPointTemp = 100f;
private SimpleParticleProperties steamParticles = new SimpleParticleProperties {
MinPos = new Vec3d( ),
AddPos = new Vec3d( ),
MinQuantity = 6,
AddQuantity = 12,
Color = ColorUtil.ToRgba(100, 225, 225, 225),
OpacityEvolve = new EvolvingNatFloat(EnumTransformFunction.LINEAR, 1.0f),
GravityEffect = -0.015f,
WithTerrainCollision = false,
ShouldDieInLiquid = true,
ParticleModel = EnumParticleModel.Quad,
LifeLength = 2.0f,
MinVelocity = new Vec3f(-0.25f, 0.1f, -0.25f),
AddVelocity = new Vec3f(0.25f, 0.1f, 0.25f),
MinSize = 0.075f,
MaxSize = 0.1f,
WindAffected = true,
WindAffectednes = 0.4f,
};
public readonly AssetLocation CoolSoundEffect = new AssetLocation(@"game", @"sounds/sizzle");
public WateringCanAssist(BlockWateringCan original, ICoreAPI api)
{
this.CoreAPI = api;
this.Original = original;
}
public void PerformBlockCooling(float secondsUsed, ItemSlot slot, EntityAgent byEntity, BlockSelection blockSel, EntitySelection entitySel)
{
if (blockSel == null) return;
if (byEntity.Controls.Sneak) return;
if ((DateTime.Now.Millisecond / 100) % 2 == 1) return;
BlockPos targetPos = blockSel.Position;
if (!slot.Empty && Original.GetRemainingWateringSeconds(slot.Itemstack) >= 0.1f) {
var server = (CoreAPI.World.Side.IsServer( ));
var someBlock = CoreAPI.World.BlockAccessor.GetBlock(targetPos);
if (someBlock != null
&& someBlock.BlockMaterial == EnumBlockMaterial.Ceramic
&& (someBlock.Class == @"BlockIngotMold" || someBlock.Class == @"BlockToolMold")) {
var someBlockEntity = server ? ServerAPI.World.BlockAccessor.GetBlockEntity(targetPos) : ClientAPI.World.BlockAccessor.GetBlockEntity(targetPos);
#if DEBUG
CoreAPI.Logger.VerboseDebug("Ok, its an Tool/Ingot mold.: {0}", someBlockEntity);
#endif
if (someBlockEntity is BlockEntityIngotMold) {
var rightSide = AimAtRight(blockSel.HitPosition);
var ingotMold = someBlockEntity as BlockEntityIngotMold;
if (rightSide && (ingotMold.FillLevelRight > 0 && ingotMold.TemperatureRight > flashPointTemp)) {
if (server) CoolContents(ingotMold.ContentsRight); else GenerateSpecialEffects(blockSel.Position, blockSel.HitPosition, byEntity as EntityPlayer);
ingotMold.MarkDirty( );
}
else if (ingotMold.FillLevelLeft > 0 && ingotMold.TemperatureLeft > flashPointTemp) {
if (server) CoolContents(ingotMold.ContentsLeft); else GenerateSpecialEffects(blockSel.Position, blockSel.HitPosition, byEntity as EntityPlayer);
ingotMold.MarkDirty( );
}
return;
}
if (someBlockEntity is BlockEntityToolMold) {
var toolMold = someBlockEntity as BlockEntityToolMold;
if (toolMold.FillLevel > 0 && toolMold.Temperature > flashPointTemp) {
if (server) CoolContents(toolMold.MetalContent); else GenerateSpecialEffects(blockSel.Position, blockSel.HitPosition, byEntity as EntityPlayer);
toolMold.MarkDirty( );
}
return;
}
}
}
}
internal void GenerateSpecialEffects(BlockPos blockLoc, Vec3d aimPoint, EntityPlayer playerEntity)
{
if ((DateTime.Now.Millisecond / 333) % 2 == 1) return;
steamParticles.MinPos = blockLoc.ToVec3d( ).AddCopy(aimPoint);
steamParticles.AddPos = new Vec3d(0.05f, 0f, 0.05f);
#if DEBUG
CoreAPI.Logger.VerboseDebug("Generate steam particles");
#endif
ClientAPI.World.SpawnParticles(steamParticles, playerEntity.Player);
ClientAPI.World.PlaySoundAt(CoolSoundEffect, playerEntity, playerEntity.Player, randomizePitch: false, volume: 0.5f);
}
internal void CoolContents(ItemStack itemStack)
{
var temperature = itemStack.Collectible.GetTemperature(CoreAPI.World, itemStack);
if (temperature > 20f)//TODO: USE local AMBIENT Temp
itemStack.Collectible.SetTemperature(CoreAPI.World, itemStack, temperature - (temperature * coolRateDefault), false);
(itemStack.Attributes["temperature"] as ITreeAttribute)?.SetFloat("cooldownSpeed", 400);
#if DEBUG
CoreAPI.Logger.VerboseDebug("Cooled Molten metal, temp: {0:F1} ", temperature);
#endif
}
internal bool AimAtRight(Vec3d hitPosition)
{
return hitPosition.X >= 0.5f;
}
}
}

View file

@ -1,319 +1,317 @@
using System;
using System.Collections.Generic;
using System.Collections.ObjectModel;
using System.Linq;
using HarmonyLib;
using Vintagestory.API.Client;
using Vintagestory.API.Common;
using Vintagestory.API.Server;
using Vintagestory.API.Util;
using Vintagestory.Client.NoObf;
using Vintagestory.GameContent;
using Vintagestory.Server;
/* IDEAS / ISSUES
* # DONE: Watering Can (molten-metal state) Ingot Cooling *Tssss*
* # WIP : Mold breaks -> Metal fragments : bits...
* # DONE: Tool-break configurable ratio
* # IDEA: Recycling Bench block/tool
*/
namespace AnvilMetalRecovery
{
public partial class MetalRecoverySystem : ModSystem
{
internal const string _configFilename = @"amr_config.json";
internal const string anvilKey = @"Anvil";
internal const string metalFragmentsCode = @"fma:metal_fragments";
internal const string metalShavingsCode = @"metal_shaving";
internal const string itemFilterListCacheKey = @"AMR_ItemFilters";
public const float IngotVoxelDefault = 2.38f;
public const string ItemDamageChannelName = @"ItemDamageEvents";
internal IServerNetworkChannel _ConfigDownlink;
internal IClientNetworkChannel _ConfigUplink;
public event Action AMR_DataReady;
protected RecoveryEntryTable itemToVoxelLookup = new RecoveryEntryTable();//Item Asset Code to: Ammount & Material
public static Dictionary<string, MetalInfo> MetalProperties;//for easy lookup
private ICoreAPI CoreAPI;
private ServerCoreAPI ServerCore { get; set; }
private ClientCoreAPI ClientCore { get; set; }
public AMRConfig CachedConfiguration {
get
{
return ( AMRConfig )CoreAPI.ObjectCache[_configFilename];
}
set
{
CoreAPI.ObjectCache.Add(_configFilename, value);
}
}
internal List<SmithingRecipe> SmithingRecipies
{
get { return CoreAPI.ModLoader.GetModSystem<RecipeRegistrySystem>( ).SmithingRecipes; }
}
public static RecoveryEntryTable GetCachedLookupTable(IWorldAccessor world )
{
return ( RecoveryEntryTable )world.Api.ObjectCache[MetalRecoverySystem.itemFilterListCacheKey];
}
/// <summary>
/// Valid Items that are 'recoverable' (Asset Codes) only
/// </summary>
/// <value>The item filter list.</value>
public List<AssetLocation> ItemFilterList {
get
{
return itemToVoxelLookup.Keys.ToList( );
}
}
/// <summary>
/// ALL Items that have were derivable from smithing recipies (and are 'tool' / have durability property)
/// </summary>/
/// <value>The item filter list.</value>
public RecoveryEntryTable ItemRecoveryTable {
get
{
return itemToVoxelLookup;
}
set
{
itemToVoxelLookup = value;
}
}
public override bool AllowRuntimeReload {
get { return false; }
}
public override bool ShouldLoad(EnumAppSide forSide)
{
return true;
}
public override double ExecuteOrder( )
{
return 0.11d;
}
public override void Start(ICoreAPI api)
{
this.CoreAPI = api;
RegisterItemClassMappings( );
//RegisterBlockClassMappings( );
RegisterBlockBehaviors( );
if (api.Side.IsServer())
{
if (api is ServerCoreAPI) {
ServerCore = api as ServerCoreAPI;
}
}
else
{
ClientCore = api as ClientCoreAPI;
}
#if DEBUG
//Harmony.DEBUG = true;
#endif
var harmony = new Harmony(this.Mod.Info.ModID);
harmony.PatchAll( );
base.Start(api);
}
public override void StartServerSide(ICoreServerAPI api)
{
PrepareServersideConfig( );
PrepareDownlinkChannel( );
ServerCore.Event.PlayerJoin += SendClientConfigMessage;
ServerCore.Event.ServerRunPhase(EnumServerRunPhase.Shutdown, PersistServersideConfig);
ServerCore.Event.ServerRunPhase(EnumServerRunPhase.GameReady, UnravelMetalProperties);
ServerCore.Event.ServerRunPhase(EnumServerRunPhase.GameReady, MaterialDataGathering);
ServerCore.Event.ServerRunPhase(EnumServerRunPhase.RunGame, CacheRecoveryDataTable);
SetupGeneralObservers( );
Mod.Logger.VerboseDebug("Anvil Metal Recovery - should be running...");
#if DEBUG
ServerCore.RegisterCommand("durability", "edit durability of item", " (Held tool) and #", EditDurability, Privilege.give);
#endif
}
public override void StartClientSide(ICoreClientAPI api)
{
base.StartClientSide(api);
ListenForServerConfigMessage( );
Mod.Logger.VerboseDebug("Anvil Metal Recovery - should be running...");
#if DEBUG
//ClientCore.Event.LevelFinalize += DebugStuffs;
#endif
}
public override void AssetsLoaded(ICoreAPI api)
{
Mod.Logger.VerboseDebug("AssetsLoaded");
}
public override void AssetsFinalize(ICoreAPI api)
{
Mod.Logger.VerboseDebug("AssetsFinalize");
if (api.Side.IsServer())
{
AttachExtraBlockBehaviors( );
}
}
private void RegisterItemClassMappings( )
{
this.CoreAPI.RegisterItemClass(@"VariableMetalItem", typeof(VariableMetalItem));
this.CoreAPI.RegisterItemClass(@"SmartSmeltableItem", typeof(SmartSmeltableItem));
}
private void RegisterBlockBehaviors()
{
#if DEBUG
Mod.Logger.Debug("RegisterBlockBehaviors");
#endif
this.CoreAPI.RegisterBlockBehaviorClass(MoldDestructionRecovererBehavior.BehaviorClassName, typeof(MoldDestructionRecovererBehavior));
this.CoreAPI.RegisterCollectibleBehaviorClass(MoldDestructionRecovererBehavior.BehaviorClassName, typeof(MoldDestructionRecovererBehavior));
}
private void AttachExtraBlockBehaviors()
{
Collection<AssetLocation> mold_behaviorsAppendList = new Collection<AssetLocation>( ) {
new AssetLocation(@"game",@"ingotmold-burned"),
new AssetLocation(@"game",@"toolmold-burned-*"),
};
var moldRecoverBehaviorType = ServerCore.ClassRegistry.GetBlockBehaviorClass(MoldDestructionRecovererBehavior.BehaviorClassName);
foreach (var assetName in mold_behaviorsAppendList) {
if (!assetName.IsWildCard)
{
this.CoreAPI.AddBlockBehavior(assetName, MoldDestructionRecovererBehavior.BehaviorClassName, moldRecoverBehaviorType);
#if DEBUG
Mod.Logger.VerboseDebug("Attached Block-Behavior {0} to '{1}' ", MoldDestructionRecovererBehavior.BehaviorClassName, assetName);
#endif
}
else {
var searchResults = ServerCore.World.SearchBlocks(assetName);
if (searchResults != null && searchResults.Length > 0) {
#if DEBUG
Mod.Logger.VerboseDebug("Attaching Block-Behaviors, wildcard matches from '{0}'", assetName);
#endif
for (int index = 0; index < searchResults.Length; index++)
{
var matchBlock = searchResults[index];
this.CoreAPI.AddBlockBehavior(matchBlock.Code, MoldDestructionRecovererBehavior.BehaviorClassName, moldRecoverBehaviorType);
#if DEBUG
Mod.Logger.VerboseDebug("Attached Block-Behavior {0} to '{1}' ", MoldDestructionRecovererBehavior.BehaviorClassName, matchBlock.Code);
#endif
}
}
}
}
}
private void SetupGeneralObservers( ){
ServerCore.Event.RegisterEventBusListener(Item_DamageEventReciever, 1.0f, ItemDamageChannelName);
}
private void PrepareServersideConfig( )
{
AMRConfig config = ServerCore.LoadModConfig<AMRConfig>(_configFilename);
if (config == null)
{
//Regen default
Mod.Logger.Warning("Regenerating default config as it was missing / unparsable...");
ServerCore.StoreModConfig<AMRConfig>(new AMRConfig(true), _configFilename);
config = ServerCore.LoadModConfig<AMRConfig>(_configFilename);
}
else if( config.BlackList == null || config.BlackList.Count == 0)
{
AMRConfig defaults = new AMRConfig(true);
config.BlackList = defaults.BlackList;
}
this.CachedConfiguration = config;
}
private void PersistServersideConfig( )
{
if (this.CachedConfiguration != null) {
Mod.Logger.Notification("Persisting configuration.");
ServerCore.StoreModConfig<AMRConfig>(this.CachedConfiguration, _configFilename);
}
}
private void PrepareDownlinkChannel( )
{
_ConfigDownlink = ServerCore.Network.RegisterChannel(_configFilename);
_ConfigDownlink.RegisterMessageType<AMRConfig>( );
}
private void SendClientConfigMessage(IServerPlayer byPlayer)
{
#if DEBUG
Mod.Logger.VerboseDebug("Sending joiner: {0} a copy of config data.", byPlayer.PlayerName);
#endif
_ConfigDownlink.SendPacket<AMRConfig>(this.CachedConfiguration, byPlayer);
}
private void ListenForServerConfigMessage( )
{
_ConfigUplink = ClientCore.Network.RegisterChannel(_configFilename);
_ConfigUplink = _ConfigUplink.RegisterMessageType<AMRConfig>( );
#if DEBUG
Mod.Logger.VerboseDebug("Registered RX channel: '{0}'", _ConfigUplink.ChannelName);
#endif
_ConfigUplink.SetMessageHandler<AMRConfig>(RecievedConfigMessage);
}
private void RecievedConfigMessage(AMRConfig networkMessage)
{
#if DEBUG
Mod.Logger.Debug("Got Config message!");
#endif
if (networkMessage != null) {
Mod.Logger.Debug("Message value; Recover Broken Tools:{0}, VoxelEquiv:{1:F2}, Tool Recovery {3:P0}, Blacklisted:{2}", networkMessage.ToolFragmentRecovery, networkMessage.VoxelEquivalentValue, networkMessage.BlackList.Count, networkMessage.ToolRecoveryRate);
this.CachedConfiguration = networkMessage;
}
}
private void CacheRecoveryDataTable( )
{
this.AMR_DataReady?.Invoke();
// Cache list too
#if DEBUG
Mod.Logger.VerboseDebug("Adding Recovery entries table to Cache...");
#endif
ServerCore.ObjectCache.Add(itemFilterListCacheKey, itemToVoxelLookup);
}
}
using System;
using System.Collections.Generic;
using System.Collections.ObjectModel;
using System.Linq;
using HarmonyLib;
using Vintagestory.API.Client;
using Vintagestory.API.Common;
using Vintagestory.API.Server;
using Vintagestory.API.Util;
using Vintagestory.Client.NoObf;
using Vintagestory.GameContent;
using Vintagestory.Server;
/* IDEAS / ISSUES
* # DONE: Watering Can (molten-metal state) Ingot Cooling *Tssss*
* # WIP : Mold breaks -> Metal fragments : bits...
* # DONE: Tool-break configurable ratio
* # IDEA: Recycling Bench block/tool
*/
namespace AnvilMetalRecovery
{
public partial class MetalRecoverySystem : ModSystem
{
internal const string _configFilename = @"amr_config.json";
internal const string anvilKey = @"Anvil";
internal const string metalFragmentsCode = @"fma:metal_fragments";
internal const string metalShavingsCode = @"metal_shaving";
internal const string itemFilterListCacheKey = @"AMR_ItemFilters";
public const float IngotVoxelDefault = 2.38f;
public const string ItemDamageChannelName = @"ItemDamageEvents";
internal IServerNetworkChannel _ConfigDownlink;
internal IClientNetworkChannel _ConfigUplink;
public event Action AMR_DataReady;
protected RecoveryEntryTable itemToVoxelLookup = new RecoveryEntryTable();//Item Asset Code to: Ammount & Material
public static Dictionary<string, MetalInfo> MetalProperties;//for easy lookup
private ICoreAPI CoreAPI;
private ServerCoreAPI ServerCore { get; set; }
private ClientCoreAPI ClientCore { get; set; }
public AMRConfig CachedConfiguration {
get
{
return ( AMRConfig )CoreAPI.ObjectCache[_configFilename];
}
set
{
CoreAPI.ObjectCache.Add(_configFilename, value);
}
}
internal List<SmithingRecipe> SmithingRecipies
{
get { return CoreAPI.ModLoader.GetModSystem<RecipeRegistrySystem>( ).SmithingRecipes; }
}
public static RecoveryEntryTable GetCachedLookupTable(IWorldAccessor world )
{
return ( RecoveryEntryTable )world.Api.ObjectCache[MetalRecoverySystem.itemFilterListCacheKey];
}
/// <summary>
/// Valid Items that are 'recoverable' (Asset Codes) only
/// </summary>
/// <value>The item filter list.</value>
public List<AssetLocation> ItemFilterList {
get
{
return itemToVoxelLookup.Keys.ToList( );
}
}
/// <summary>
/// ALL Items that have were derivable from smithing recipies (and are 'tool' / have durability property)
/// </summary>/
/// <value>The item filter list.</value>
public RecoveryEntryTable ItemRecoveryTable {
get
{
return itemToVoxelLookup;
}
set
{
itemToVoxelLookup = value;
}
}
//public override bool AllowRuntimeReload => false;
public override bool ShouldLoad(EnumAppSide forSide)
{
return true;
}
public override double ExecuteOrder( )
{
return 0.11d;
}
public override void Start(ICoreAPI api)
{
this.CoreAPI = api;
RegisterItemClassMappings( );
//RegisterBlockClassMappings( );
RegisterBlockBehaviors( );
if (api.Side.IsServer())
{
if (api is ServerCoreAPI) {
ServerCore = api as ServerCoreAPI;
}
}
else
{
ClientCore = api as ClientCoreAPI;
}
#if DEBUG
//Harmony.DEBUG = true;
#endif
var harmony = new Harmony(this.Mod.Info.ModID);
harmony.PatchAll( );
base.Start(api);
}
public override void StartServerSide(ICoreServerAPI api)
{
PrepareServersideConfig( );
PrepareDownlinkChannel( );
ServerCore.Event.PlayerJoin += SendClientConfigMessage;
ServerCore.Event.ServerRunPhase(EnumServerRunPhase.Shutdown, PersistServersideConfig);
ServerCore.Event.ServerRunPhase(EnumServerRunPhase.GameReady, UnravelMetalProperties);
ServerCore.Event.ServerRunPhase(EnumServerRunPhase.GameReady, MaterialDataGathering);
ServerCore.Event.ServerRunPhase(EnumServerRunPhase.RunGame, CacheRecoveryDataTable);
SetupGeneralObservers( );
Mod.Logger.VerboseDebug("Anvil Metal Recovery - should be running...");
#if DEBUG
ServerCore.RegisterCommand("durability", "edit durability of item", " (Held tool) and #", EditDurability, Privilege.give);
#endif
}
public override void StartClientSide(ICoreClientAPI api)
{
base.StartClientSide(api);
ListenForServerConfigMessage( );
Mod.Logger.VerboseDebug("Anvil Metal Recovery - should be running...");
#if DEBUG
//ClientCore.Event.LevelFinalize += DebugStuffs;
#endif
}
public override void AssetsLoaded(ICoreAPI api)
{
Mod.Logger.VerboseDebug("AssetsLoaded");
}
public override void AssetsFinalize(ICoreAPI api)
{
Mod.Logger.VerboseDebug("AssetsFinalize");
if (api.Side.IsServer())
{
AttachExtraBlockBehaviors( );
}
}
private void RegisterItemClassMappings( )
{
this.CoreAPI.RegisterItemClass(@"VariableMetalItem", typeof(VariableMetalItem));
this.CoreAPI.RegisterItemClass(@"SmartSmeltableItem", typeof(SmartSmeltableItem));
}
private void RegisterBlockBehaviors()
{
#if DEBUG
Mod.Logger.Debug("RegisterBlockBehaviors");
#endif
this.CoreAPI.RegisterBlockBehaviorClass(MoldDestructionRecovererBehavior.BehaviorClassName, typeof(MoldDestructionRecovererBehavior));
this.CoreAPI.RegisterCollectibleBehaviorClass(MoldDestructionRecovererBehavior.BehaviorClassName, typeof(MoldDestructionRecovererBehavior));
}
private void AttachExtraBlockBehaviors()
{
Collection<AssetLocation> mold_behaviorsAppendList = new Collection<AssetLocation>( ) {
new AssetLocation(@"game",@"ingotmold-burned"),
new AssetLocation(@"game",@"toolmold-burned-*"),
};
var moldRecoverBehaviorType = ServerCore.ClassRegistry.GetBlockBehaviorClass(MoldDestructionRecovererBehavior.BehaviorClassName);
foreach (var assetName in mold_behaviorsAppendList) {
if (!assetName.IsWildCard)
{
this.CoreAPI.AddBlockBehavior(assetName, MoldDestructionRecovererBehavior.BehaviorClassName, moldRecoverBehaviorType);
#if DEBUG
Mod.Logger.VerboseDebug("Attached Block-Behavior {0} to '{1}' ", MoldDestructionRecovererBehavior.BehaviorClassName, assetName);
#endif
}
else {
var searchResults = ServerCore.World.SearchBlocks(assetName);
if (searchResults != null && searchResults.Length > 0) {
#if DEBUG
Mod.Logger.VerboseDebug("Attaching Block-Behaviors, wildcard matches from '{0}'", assetName);
#endif
for (int index = 0; index < searchResults.Length; index++)
{
var matchBlock = searchResults[index];
this.CoreAPI.AddBlockBehavior(matchBlock.Code, MoldDestructionRecovererBehavior.BehaviorClassName, moldRecoverBehaviorType);
#if DEBUG
Mod.Logger.VerboseDebug("Attached Block-Behavior {0} to '{1}' ", MoldDestructionRecovererBehavior.BehaviorClassName, matchBlock.Code);
#endif
}
}
}
}
}
private void SetupGeneralObservers( ){
ServerCore.Event.RegisterEventBusListener(Item_DamageEventReciever, 1.0f, ItemDamageChannelName);
}
private void PrepareServersideConfig( )
{
AMRConfig config = ServerCore.LoadModConfig<AMRConfig>(_configFilename);
if (config == null)
{
//Regen default
Mod.Logger.Warning("Regenerating default config as it was missing / unparsable...");
ServerCore.StoreModConfig<AMRConfig>(new AMRConfig(true), _configFilename);
config = ServerCore.LoadModConfig<AMRConfig>(_configFilename);
}
else if( config.BlackList == null || config.BlackList.Count == 0)
{
AMRConfig defaults = new AMRConfig(true);
config.BlackList = defaults.BlackList;
}
this.CachedConfiguration = config;
}
private void PersistServersideConfig( )
{
if (this.CachedConfiguration != null) {
Mod.Logger.Notification("Persisting configuration.");
ServerCore.StoreModConfig<AMRConfig>(this.CachedConfiguration, _configFilename);
}
}
private void PrepareDownlinkChannel( )
{
_ConfigDownlink = ServerCore.Network.RegisterChannel(_configFilename);
_ConfigDownlink.RegisterMessageType<AMRConfig>( );
}
private void SendClientConfigMessage(IServerPlayer byPlayer)
{
#if DEBUG
Mod.Logger.VerboseDebug("Sending joiner: {0} a copy of config data.", byPlayer.PlayerName);
#endif
_ConfigDownlink.SendPacket<AMRConfig>(this.CachedConfiguration, byPlayer);
}
private void ListenForServerConfigMessage( )
{
_ConfigUplink = ClientCore.Network.RegisterChannel(_configFilename);
_ConfigUplink = _ConfigUplink.RegisterMessageType<AMRConfig>( );
#if DEBUG
Mod.Logger.VerboseDebug("Registered RX channel: '{0}'", _ConfigUplink.ChannelName);
#endif
_ConfigUplink.SetMessageHandler<AMRConfig>(RecievedConfigMessage);
}
private void RecievedConfigMessage(AMRConfig networkMessage)
{
#if DEBUG
Mod.Logger.Debug("Got Config message!");
#endif
if (networkMessage != null) {
Mod.Logger.Debug("Message value; Recover Broken Tools:{0}, VoxelEquiv:{1:F2}, Tool Recovery {3:P0}, Blacklisted:{2}", networkMessage.ToolFragmentRecovery, networkMessage.VoxelEquivalentValue, networkMessage.BlackList.Count, networkMessage.ToolRecoveryRate);
this.CachedConfiguration = networkMessage;
}
}
private void CacheRecoveryDataTable( )
{
this.AMR_DataReady?.Invoke();
// Cache list too
#if DEBUG
Mod.Logger.VerboseDebug("Adding Recovery entries table to Cache...");
#endif
ServerCore.ObjectCache.Add(itemFilterListCacheKey, itemToVoxelLookup);
}
}
}

View file

@ -1,30 +1,11 @@
using System.Reflection;
using System.Runtime.CompilerServices;
// Information about this assembly is defined by the following attributes.
// Change them to the values specific to your project.
[assembly: AssemblyTitle("AnvilMetalRecovery")]
[assembly: AssemblyDescription("Mod plugin for V.S.")]
#if DEBUG
[assembly: AssemblyConfiguration("DEBUG")]
#else
[assembly: AssemblyConfiguration("RELEASE")]
#endif
[assembly: AssemblyProduct("First_Machine_Age_component")]
[assembly: AssemblyCopyright("Melchior")]
[assembly: AssemblyTrademark("")]
[assembly: AssemblyCulture("")]
// The assembly version has the format "{Major}.{Minor}.{Build}.{Revision}".
// The form "{Major}.{Minor}.*" will automatically update the build and revision,
// and "{Major}.{Minor}.{Build}.*" will update just the revision.
[assembly: AssemblyVersion("0.1.9")]
// The following attributes are used to specify the signing key for the assembly,
// if desired. See the Mono documentation for more information about signing.
//[assembly: AssemblyDelaySign(false)]
//[assembly: AssemblyKeyFile("")]
using System.Reflection;
using System.Runtime.CompilerServices;
[assembly: AssemblyTrademark("")]
[assembly: AssemblyCulture("")]
// The following attributes are used to specify the signing key for the assembly,
// if desired. See the Mono documentation for more information about signing.
//[assembly: AssemblyDelaySign(false)]
//[assembly: AssemblyKeyFile("")]

View file

@ -1,13 +1,11 @@
{
"type": "code",
"name": "Anvil Metal Recovery+",
"description" : "Get back smithing discards, broken tool scrap, failed molds; and MORE!",
"authors": ["Melchior"],
"ModID":"metalrecovery",
"version": "0.1.19-pre.1",
"dependencies": {
"game": "1.18.0",
"survival": ""
},
"website": "http://nowebsite.nope"
}
{
"type": "code",
"name": "Anvil Metal Recovery Revived",
"description" : "Get back smithing discards, broken tool scrap, failed molds; and MORE!",
"authors": ["Melchior", "btach"],
"ModID":"metalrecoveryrevived",
"version": "0.1.20",
"dependencies": {
"game": "1.20.0-rc.6"
}
}

View file

@ -1,22 +1,16 @@
<?xml version="1.0" encoding="utf-8"?>
<Project DefaultTargets="Build" ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
<ProjectGuid>{805B37F5-F87D-4A63-BD3F-66AE59F1C998}</ProjectGuid>
<TargetFramework>net7.0</TargetFramework>
<OutputType>Library</OutputType>
<RootNamespace>FirstMachineAge</RootNamespace>
<AssemblyName>Assorted</AssemblyName>
<TargetFrameworkVersion>v4.6.1</TargetFrameworkVersion>
<GenerateAssemblyInfo>false</GenerateAssemblyInfo>
<AssemblyTitle>Assorted</AssemblyTitle>
<Copyright>librarian</Copyright>
<AssemblyVersion>1.0.*</AssemblyVersion>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
<DebugSymbols>true</DebugSymbols>
<DebugType>full</DebugType>
<Optimize>false</Optimize>
<OutputPath>bin\Debug</OutputPath>
<DefineConstants>DEBUG;</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
<ConsolePause>false</ConsolePause>
<CustomCommands>
<CustomCommands>
@ -26,10 +20,7 @@
</CustomCommands>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
<Optimize>true</Optimize>
<OutputPath>bin\Release</OutputPath>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
<ConsolePause>false</ConsolePause>
<CustomCommands>
<CustomCommands>
@ -39,58 +30,37 @@
</CustomCommands>
</PropertyGroup>
<ItemGroup>
<Reference Include="System" />
<Reference Include="cairo-sharp">
<HintPath>vs_libs\cairo-sharp.dll</HintPath>
<HintPath>$(VINTAGE_STORY)\lib\cairo-sharp.dll</HintPath>
<Private>False</Private>
</Reference>
<Reference Include="protobuf-net">
<HintPath>vs_libs\protobuf-net.dll</HintPath>
<HintPath>$(VINTAGE_STORY)\lib\protobuf-net.dll</HintPath>
<Private>False</Private>
</Reference>
<Reference Include="VintagestoryAPI">
<HintPath>vs_libs\VintagestoryAPI.dll</HintPath>
<HintPath>$(VINTAGE_STORY)\VintagestoryAPI.dll</HintPath>
<Private>False</Private>
</Reference>
<Reference Include="VintagestoryLib">
<HintPath>vs_libs\VintagestoryLib.dll</HintPath>
<HintPath>$(VINTAGE_STORY)\VintagestoryLib.dll</HintPath>
<Private>False</Private>
</Reference>
<Reference Include="VSCreativeMod">
<HintPath>vs_libs\VSCreativeMod.dll</HintPath>
<HintPath>$(VINTAGE_STORY)\mods\VSCreativeMod.dll</HintPath>
<Private>False</Private>
</Reference>
<Reference Include="VSEssentials">
<HintPath>vs_libs\VSEssentials.dll</HintPath>
<HintPath>$(VINTAGE_STORY)\mods\VSEssentials.dll</HintPath>
<Private>False</Private>
</Reference>
<Reference Include="VSSurvivalMod">
<HintPath>vs_libs\VSSurvivalMod.dll</HintPath>
<Private>False</Private>
</Reference>
<Reference Include="Newtonsoft.Json">
<HintPath>vs_libs\Newtonsoft.Json.dll</HintPath>
<HintPath>$(VINTAGE_STORY)\mods\VSSurvivalMod.dll</HintPath>
<Private>False</Private>
</Reference>
<Reference Include="Enums.NET">
<HintPath>vs_libs\Enums.NET.dll</HintPath>
<HintPath>$(VINTAGE_STORY)\lib\Enums.NET.dll</HintPath>
</Reference>
<Reference Include="System.Runtime.CompilerServices.Unsafe">
<HintPath>vs_libs\System.Runtime.CompilerServices.Unsafe.dll</HintPath>
</Reference>
</ItemGroup>
<ItemGroup>
<Compile Include="AssortedModLoader.cs" />
<Compile Include="Properties\AssemblyInfo.cs" />
<Compile Include="BlockClasses\BoltableDoor.cs" />
<Compile Include="BlockEntityClasses\BoltableDoorBlockEntity.cs" />
<Compile Include="BlockBehaviors\BlockBehaviorFreeReinforcement.cs" />
<Compile Include="Helpers.cs" />
<Compile Include="BlockBehaviors\BlockBehaviorVerticalOrientation.cs" />
<Compile Include="BlockClasses\CollapsingBlock.cs" />
<Compile Include="BlockClasses\FalseWall.cs" />
<Compile Include="BlockBehaviors\BlockBehaviorNeedSides.cs" />
<Compile Include="BlockClasses\RectangularBrazier.cs" />
</ItemGroup>
<ItemGroup>
<Folder Include="BlockClasses\" />
@ -106,182 +76,180 @@
<Folder Include="assets\defensive\itemtypes\metal\" />
</ItemGroup>
<ItemGroup>
<None Include="assets\defensive\blocktypes\metal\grille_horizontal.json">
<None Update="assets\defensive\blocktypes\metal\grille_horizontal.json">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</None>
<None Include="assets\defensive\blocktypes\metal\grille_vertical.json">
<None Update="assets\defensive\blocktypes\metal\grille_vertical.json">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</None>
<None Include="assets\defensive\blocktypes\stone\slot_vert.json">
<None Update="assets\defensive\blocktypes\stone\slot_vert.json">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</None>
<None Include="assets\defensive\blocktypes\wood\boltable_door.json">
<None Update="assets\defensive\blocktypes\wood\boltable_door.json">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</None>
<None Include="assets\defensive\lang\en.json">
<None Update="assets\defensive\lang\en.json">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</None>
<None Include="assets\defensive\recipes\smithing\grille_v.json">
<None Update="assets\defensive\recipes\smithing\grille_v.json">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</None>
<None Include="assets\defensive\shapes\block\metal\grille_horizontal.json">
<None Update="assets\defensive\shapes\block\metal\grille_horizontal.json">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</None>
<None Include="assets\defensive\shapes\block\metal\grille_vertical.json">
<None Update="assets\defensive\shapes\block\metal\grille_vertical.json">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</None>
<None Include="assets\defensive\shapes\block\metal\strut_vert.json" />
<None Include="assets\defensive\shapes\block\stone\slot_vert.json">
<None Update="assets\defensive\shapes\block\stone\slot_vert.json">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</None>
<None Include="assets\defensive\shapes\block\wood\heavydoor_lower_closed_left.json">
<None Update="assets\defensive\shapes\block\wood\heavydoor_lower_closed_left.json">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</None>
<None Include="assets\defensive\shapes\block\wood\heavydoor_lower_opened_left.json">
<None Update="assets\defensive\shapes\block\wood\heavydoor_lower_opened_left.json">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</None>
<None Include="assets\defensive\shapes\block\wood\heavydoor_upper_closed_left.json">
<None Update="assets\defensive\shapes\block\wood\heavydoor_upper_closed_left.json">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</None>
<None Include="assets\defensive\shapes\block\wood\heavydoor_upper_opened_left.json">
<None Update="assets\defensive\shapes\block\wood\heavydoor_upper_opened_left.json">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</None>
<None Include="assets\defensive\textures\metal\iron_rusty.png">
<None Update="assets\defensive\textures\metal\iron_rusty.png">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</None>
<None Include="modinfo.json">
<None Update="modinfo.json">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</None>
<None Include="assets\defensive\recipes\smithing\grille_h.json">
<None Update="assets\defensive\recipes\smithing\grille_h.json">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</None>
<None Include="assets\defensive\recipes\grid\heavydoor.json">
<None Update="assets\defensive\recipes\grid\heavydoor.json">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</None>
<None Include="assets\defensive\shapes\block\wood\heavydoor_inv.json">
<None Update="assets\defensive\shapes\block\wood\heavydoor_inv.json">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</None>
<None Include="assets\defensive\shapes\block\stone\slot_hole.json">
<None Update="assets\defensive\shapes\block\stone\slot_hole.json">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</None>
<None Include="assets\defensive\blocktypes\stone\slot_hole.json">
<None Update="assets\defensive\blocktypes\stone\slot_hole.json">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</None>
<None Include="assets\defensive\shapes\block\metal\brazier2.json">
</None>
<None Include="assets\defensive\blocktypes\metal\brazier.json">
<None Update="assets\defensive\blocktypes\metal\brazier.json">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</None>
<None Include="assets\defensive\shapes\block\stone\brick_w_candle.json">
<None Update="assets\defensive\shapes\block\stone\brick_w_candle.json">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</None>
<None Include="assets\defensive\shapes\block\stone\climbing_slab.json">
<None Update="assets\defensive\shapes\block\stone\climbing_slab.json">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</None>
<None Include="assets\defensive\blocktypes\stone\sconse_brick.json">
</None>
<None Include="assets\defensive\shapes\block\wood\false_floor.json">
<None Update="assets\defensive\shapes\block\wood\false_floor.json">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</None>
<None Include="assets\defensive\blocktypes\wood\false_floor.json">
<None Update="assets\defensive\blocktypes\wood\false_floor.json">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</None>
<None Include="assets\defensive\recipes\grid\false_floor.json">
<None Update="assets\defensive\recipes\grid\false_floor.json">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</None>
<None Include="assets\defensive\shapes\block\stone\false_wall_lower.json">
<None Update="assets\defensive\shapes\block\stone\false_wall_lower.json">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</None>
<None Include="assets\defensive\blocktypes\stone\false_wall.json">
<None Update="assets\defensive\blocktypes\stone\false_wall.json">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</None>
<None Include="assets\defensive\shapes\block\stone\false_wall_upper.json">
<None Update="assets\defensive\shapes\block\stone\false_wall_upper.json">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</None>
<None Include="assets\defensive\shapes\block\ceramic\candle_wall-holder.json">
<None Update="assets\defensive\shapes\block\ceramic\candle_wall-holder.json">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</None>
<None Include="assets\defensive\textures\ceramic\semi_t_cera.png">
<None Update="assets\defensive\textures\ceramic\semi_t_cera.png">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</None>
<None Include="assets\defensive\shapes\block\stone\false_wall_inv.json">
<None Update="assets\defensive\shapes\block\stone\false_wall_inv.json">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</None>
<None Include="assets\defensive\blocktypes\ceramic\enclosed_candle.json">
<None Update="assets\defensive\blocktypes\ceramic\enclosed_candle.json">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</None>
<None Include="assets\defensive\recipes\grid\stone_hole.json">
<None Update="assets\defensive\recipes\grid\stone_hole.json">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</None>
<None Include="assets\defensive\recipes\grid\stone_slit.json">
<None Update="assets\defensive\recipes\grid\stone_slit.json">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</None>
<None Include="assets\defensive\recipes\grid\false_wall.json">
<None Update="assets\defensive\recipes\grid\false_wall.json">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</None>
<None Include="assets\defensive\recipes\grid\enclosed_candle.json">
<None Update="assets\defensive\recipes\grid\enclosed_candle.json">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</None>
<None Include="assets\defensive\blocktypes\metal\crusie_lamp.json">
<None Update="assets\defensive\blocktypes\metal\crusie_lamp.json">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</None>
<None Include="assets\defensive\shapes\block\metal\crusie_lamp.json">
<None Update="assets\defensive\shapes\block\metal\crusie_lamp.json">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</None>
<None Include="assets\defensive\textures\metal\black_iron2.png">
<None Update="assets\defensive\textures\metal\black_iron2.png">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</None>
<None Include="assets\defensive\textures\liquids\liquid_oil.png">
<None Update="assets\defensive\textures\liquids\liquid_oil.png">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</None>
<None Include="assets\defensive\shapes\block\wood\log_cornercade.json">
<None Update="assets\defensive\shapes\block\wood\log_cornercade.json">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</None>
<None Include="assets\defensive\shapes\block\wood\log_topcade.json">
<None Update="assets\defensive\shapes\block\wood\log_topcade.json">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</None>
<None Include="assets\defensive\shapes\block\wood\log_barricade.json">
<None Update="assets\defensive\shapes\block\wood\log_barricade.json">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</None>
<None Include="assets\defensive\blocktypes\wood\log_barricade.json">
<None Update="assets\defensive\blocktypes\wood\log_barricade.json">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</None>
<None Include="assets\defensive\shapes\block\wood\log_barricade2.json">
<None Update="assets\defensive\shapes\block\wood\log_barricade2.json">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</None>
<None Include="assets\defensive\blocktypes\wood\log_topcade.json">
<None Update="assets\defensive\blocktypes\wood\log_topcade.json">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</None>
<None Include="assets\defensive\blocktypes\wood\log_cornercade.json">
<None Update="assets\defensive\blocktypes\wood\log_cornercade.json">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</None>
<None Include="assets\defensive\recipes\grid\log_barricade.json">
<None Update="assets\defensive\recipes\grid\log_barricade.json">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</None>
<None Include="assets\defensive\recipes\grid\log_topcade.json">
<None Update="assets\defensive\recipes\grid\log_topcade.json">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</None>
<None Include="assets\defensive\recipes\grid\log_cornercade.json">
<None Update="assets\defensive\recipes\grid\log_cornercade.json">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</None>
<None Include="assets\defensive\recipes\smithing\crusie_lamp.json">
<None Update="assets\defensive\recipes\smithing\crusie_lamp.json">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</None>
<None Include="assets\defensive\itemtypes\metal\crusie_shell.json">
<None Update="assets\defensive\itemtypes\metal\crusie_shell.json">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</None>
<None Include="assets\defensive\recipes\grid\crusie_lamp.json">
<None Update="assets\defensive\recipes\grid\crusie_lamp.json">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</None>
<None Include="assets\defensive\shapes\block\metal\brazier3.json">
<None Update="assets\defensive\shapes\block\metal\brazier3.json">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</None>
<None Include="modicon.png">
<None Update="modicon.png">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</None>
<None Include="assets\defensive\recipes\smithing\brazier.json">
<None Update="assets\defensive\recipes\smithing\brazier.json">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</None>
</ItemGroup>
<Import Project="$(MSBuildBinPath)\Microsoft.CSharp.targets" />
<ItemGroup>
<PackageReference Include="Enums.NET" Version="5.0.0" />
<PackageReference Include="Newtonsoft.Json" Version="13.0.3" />
</ItemGroup>
</Project>

View file

@ -1,85 +1,83 @@
using System;
using System.Collections.Generic;
using Vintagestory.API;
using Vintagestory.API.Common;
using Vintagestory.API.Server;
using Vintagestory.Common;
using Vintagestory.Server;
namespace FirstMachineAge
{
public class AssortedModSystems : ModSystem
{
private ICoreAPI CoreAPI;
private ICoreServerAPI ServerAPI;
private ServerCoreAPI ServerCore { get; set; }
public const string BoltableDoorEntityNameKey = @"BoltableDoorEntity";
public const string CollapsingBlockEntityNameKey = @"CollapsingBlockEntity";
public override bool AllowRuntimeReload {
get { return false; }
}
public override bool ShouldLoad(EnumAppSide forSide)
{
return forSide.IsClient() || forSide.IsServer();
}
public override double ExecuteOrder( )
{
return 0.1d;
}
public override void Start(ICoreAPI api)
{
base.Start(api);
this.CoreAPI = api;
RegisterBlockClasses( );
RegisterBehaviorClasses( );
}
public override void StartServerSide(ICoreServerAPI api)
{
base.StartServerSide(api);
this.ServerAPI = api;
if (api is ServerCoreAPI) {
ServerCore = api as ServerCoreAPI;
}
else {
Mod.Logger.Error("Cannot access 'ServerCoreAPI' class: API (implimentation) has changed, Contact Developer!");
return;
}
}
private void RegisterBlockClasses( )
{
CoreAPI.RegisterBlockClass(@"BoltableDoor", typeof(BoltableDoor));
CoreAPI.RegisterBlockClass(@"FalseWall", typeof(FalseWall));
CoreAPI.RegisterBlockClass(@"CollapsingBlock", typeof(CollapsingBlock));
CoreAPI.RegisterBlockClass(@"RectangularBrazier", typeof(RectangularBrazier));
CoreAPI.RegisterBlockEntityClass(BoltableDoorEntityNameKey, typeof(BoltableDoorBlockEntity));
}
private void RegisterBehaviorClasses( )
{
CoreAPI.RegisterBlockBehaviorClass(@"FreeReinforcement", typeof(BlockBehaviorFreeReinforcement));
CoreAPI.RegisterBlockBehaviorClass(@"VerticalOrentiation",typeof(BlockBehaviorVerticalOrientation));
CoreAPI.RegisterBlockBehaviorClass(@"NeedSides", typeof(BlockBehaviorNeedSides));
}
}
}
using System;
using System.Collections.Generic;
using Vintagestory.API;
using Vintagestory.API.Common;
using Vintagestory.API.Server;
using Vintagestory.Common;
using Vintagestory.Server;
namespace FirstMachineAge
{
public class AssortedModSystems : ModSystem
{
private ICoreAPI CoreAPI;
private ICoreServerAPI ServerAPI;
private ServerCoreAPI ServerCore { get; set; }
public const string BoltableDoorEntityNameKey = @"BoltableDoorEntity";
public const string CollapsingBlockEntityNameKey = @"CollapsingBlockEntity";
//public override bool AllowRuntimeReload => false;
public override bool ShouldLoad(EnumAppSide forSide)
{
return forSide.IsClient() || forSide.IsServer();
}
public override double ExecuteOrder( )
{
return 0.1d;
}
public override void Start(ICoreAPI api)
{
base.Start(api);
this.CoreAPI = api;
RegisterBlockClasses( );
RegisterBehaviorClasses( );
}
public override void StartServerSide(ICoreServerAPI api)
{
base.StartServerSide(api);
this.ServerAPI = api;
if (api is ServerCoreAPI) {
ServerCore = api as ServerCoreAPI;
}
else {
Mod.Logger.Error("Cannot access 'ServerCoreAPI' class: API (implimentation) has changed, Contact Developer!");
return;
}
}
private void RegisterBlockClasses( )
{
CoreAPI.RegisterBlockClass(@"BoltableDoor", typeof(BoltableDoor));
CoreAPI.RegisterBlockClass(@"FalseWall", typeof(FalseWall));
CoreAPI.RegisterBlockClass(@"CollapsingBlock", typeof(CollapsingBlock));
CoreAPI.RegisterBlockClass(@"RectangularBrazier", typeof(RectangularBrazier));
CoreAPI.RegisterBlockEntityClass(BoltableDoorEntityNameKey, typeof(BoltableDoorBlockEntity));
}
private void RegisterBehaviorClasses( )
{
CoreAPI.RegisterBlockBehaviorClass(@"FreeReinforcement", typeof(BlockBehaviorFreeReinforcement));
CoreAPI.RegisterBlockBehaviorClass(@"VerticalOrentiation",typeof(BlockBehaviorVerticalOrientation));
CoreAPI.RegisterBlockBehaviorClass(@"NeedSides", typeof(BlockBehaviorNeedSides));
}
}
}

View file

@ -1,27 +1,11 @@
using System.Reflection;
using System.Runtime.CompilerServices;
// Information about this assembly is defined by the following attributes.
// Change them to the values specific to your project.
[assembly: AssemblyTitle("Assorted")]
[assembly: AssemblyDescription("")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("")]
[assembly: AssemblyProduct("")]
[assembly: AssemblyCopyright("librarian")]
[assembly: AssemblyTrademark("")]
[assembly: AssemblyCulture("")]
// The assembly version has the format "{Major}.{Minor}.{Build}.{Revision}".
// The form "{Major}.{Minor}.*" will automatically update the build and revision,
// and "{Major}.{Minor}.{Build}.*" will update just the revision.
[assembly: AssemblyVersion("1.0.*")]
// The following attributes are used to specify the signing key for the assembly,
// if desired. See the Mono documentation for more information about signing.
//[assembly: AssemblyDelaySign(false)]
//[assembly: AssemblyKeyFile("")]
using System.Reflection;
using System.Runtime.CompilerServices;
[assembly: AssemblyTrademark("")]
[assembly: AssemblyCulture("")]
// The following attributes are used to specify the signing key for the assembly,
// if desired. See the Mono documentation for more information about signing.
//[assembly: AssemblyDelaySign(false)]
//[assembly: AssemblyKeyFile("")]

View file

@ -1,22 +1,18 @@
<?xml version="1.0" encoding="utf-8"?>
<Project DefaultTargets="Build" ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
<ProjectGuid>{EA9BA3EC-EF08-4192-A844-4D3F398B1FFF}</ProjectGuid>
<TargetFramework>net7.0</TargetFramework>
<OutputType>Library</OutputType>
<RootNamespace>ElementalTools</RootNamespace>
<AssemblyName>ElementalTools</AssemblyName>
<TargetFrameworkVersion>v4.6.1</TargetFrameworkVersion>
<GenerateAssemblyInfo>false</GenerateAssemblyInfo>
<AssemblyTitle>Era_Of_Steel</AssemblyTitle>
<Description>Mod plugin for V.S.</Description>
<Configuration>DEBUG</Configuration>
<Product>First_Machine_Age_component</Product>
<Copyright>Melchior</Copyright>
<AssemblyVersion>1.0.*</AssemblyVersion>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
<DebugSymbols>true</DebugSymbols>
<DebugType>full</DebugType>
<Optimize>false</Optimize>
<OutputPath>bin\Debug</OutputPath>
<DefineConstants>DEBUG;</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
<ConsolePause>false</ConsolePause>
<CustomCommands>
<CustomCommands>
@ -26,70 +22,43 @@
</CustomCommands>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
<Optimize>true</Optimize>
<OutputPath>bin\Release</OutputPath>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
<ConsolePause>false</ConsolePause>
</PropertyGroup>
<ItemGroup>
<Reference Include="System" />
<Reference Include="Newtonsoft.Json">
<HintPath>vs_libs\Newtonsoft.Json.dll</HintPath>
<Private>False</Private>
</Reference>
<Reference Include="protobuf-net">
<HintPath>vs_libs\protobuf-net.dll</HintPath>
<HintPath>$(VINTAGE_STORY)\lib\protobuf-net.dll</HintPath>
<Private>False</Private>
</Reference>
<Reference Include="VintagestoryAPI">
<HintPath>vs_libs\VintagestoryAPI.dll</HintPath>
<HintPath>$(VINTAGE_STORY)\VintagestoryAPI.dll</HintPath>
<Private>False</Private>
</Reference>
<Reference Include="VintagestoryLib">
<HintPath>vs_libs\VintagestoryLib.dll</HintPath>
<HintPath>$(VINTAGE_STORY)\VintagestoryLib.dll</HintPath>
<Private>False</Private>
</Reference>
<Reference Include="VSCreativeMod">
<HintPath>vs_libs\VSCreativeMod.dll</HintPath>
<HintPath>$(VINTAGE_STORY)\mods\VSCreativeMod.dll</HintPath>
<Private>False</Private>
</Reference>
<Reference Include="VSEssentials">
<HintPath>vs_libs\VSEssentials.dll</HintPath>
<HintPath>$(VINTAGE_STORY)\mods\VSEssentials.dll</HintPath>
<Private>False</Private>
</Reference>
<Reference Include="VSSurvivalMod">
<HintPath>vs_libs\VSSurvivalMod.dll</HintPath>
<HintPath>$(VINTAGE_STORY)\mods\VSSurvivalMod.dll</HintPath>
<Private>False</Private>
</Reference>
<Reference Include="0Harmony">
<HintPath>vs_libs\0Harmony.dll</HintPath>
<HintPath>$(VINTAGE_STORY)\lib\0Harmony.dll</HintPath>
<Private>False</Private>
</Reference>
</ItemGroup>
<ItemGroup>
<Compile Include="ElementalToolsMod.cs" />
<Compile Include="Properties\AssemblyInfo.cs" />
<Compile Include="Assignments.cs" />
<Compile Include="Items\ItemMallet.cs">
<Compile Update="Items\ItemMallet.cs">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</Compile>
<Compile Include="Block\PackCarburization.cs" />
<Compile Include="BlockEntities\PackCarburizationEntity.cs" />
<Compile Include="Helpers.cs" />
<Compile Include="General\ISteelByStack.cs" />
<Compile Include="Items\ItemSharpeningStone.cs" />
<Compile Include="Items\VariableWearRateTool.cs" />
<Compile Include="ColorHelper.cs" />
<Compile Include="General\SteelAssist.cs" />
<Compile Include="Renderers\PackCarburization_Renderer.cs" />
<Compile Include="General\ISteelThingInstance.cs" />
<Compile Include="General\SteelThingViaStack.cs" />
<Compile Include="Items\ItemConsolidatableCards.cs" />
<Compile Include="Items\Steel\SteeIWrapItem.cs" />
<Compile Include="Items\Steel\GenericSteelItem.cs" />
<Compile Include="General\ISteelBase.cs" />
<Compile Include="General\SteelAspects.cs" />
</ItemGroup>
<ItemGroup>
<Folder Include="Items\" />
@ -124,214 +93,203 @@
<Folder Include="Items\Steel\" />
</ItemGroup>
<ItemGroup>
<None Include="modinfo.json">
<None Update="modinfo.json">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</None>
<None Include="assets\fma\itemtypes\tools\mallet.json">
<None Update="assets\fma\itemtypes\tools\mallet.json">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</None>
<None Include="assets\fma\lang\en.json">
<None Update="assets\fma\lang\en.json">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</None>
<None Include="assets\fma\recipes\grid\tool\mallet.json">
<None Update="assets\fma\recipes\grid\tool\mallet.json">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</None>
<None Include="assets\fma\shapes\item\tools\mallet.json">
<None Update="assets\fma\shapes\item\tools\mallet.json">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</None>
<None Include="assets\fma\shapes\item\tools\bit_brace.json">
</None>
<None Include="assets\fma\blocktypes\metallurgy\pack_carburization.json">
<None Update="assets\fma\blocktypes\metallurgy\pack_carburization.json">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</None>
<None Include="assets\fma\shapes\block\metallurgy\pack_carburization.json">
<None Update="assets\fma\shapes\block\metallurgy\pack_carburization.json">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</None>
<None Include="assets\fma\recipes\grid\metallurgy\pack_carburization.json">
<None Update="assets\fma\recipes\grid\metallurgy\pack_carburization.json">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</None>
<None Include="assets\fma\itemtypes\metallurgy\carburization_powder.json">
<None Update="assets\fma\itemtypes\metallurgy\carburization_powder.json">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</None>
<None Include="assets\fma\recipes\grid\metallurgy\carburization_powder.json">
<None Update="assets\fma\recipes\grid\metallurgy\carburization_powder.json">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</None>
<None Include="assets\fma\textures\metallurgy\carb_pwd.png">
<None Update="assets\fma\textures\metallurgy\carb_pwd.png">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</None>
<None Include="assets\fma\textures\metal\blister_steel.png">
<None Update="assets\fma\textures\metal\blister_steel.png">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</None>
<None Include="assets\fma\blocktypes\metal\blister_steel_slips.json" />
<None Include="assets\fma\blocktypes\metal\shear_steel_ingot.json" />
<None Include="assets\fma\recipes\grid\remapping\blister_steel_mappings.json">
</None>
<None Include="assets\fma\itemtypes\arms\swords.json">
<None Update="assets\fma\itemtypes\arms\swords.json">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</None>
<None Include="assets\fma\shapes\item\arms\gladii.json">
<None Update="assets\fma\shapes\item\arms\gladii.json">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</None>
<None Include="assets\fma\textures\metal\shear_steel.png">
<None Update="assets\fma\textures\metal\shear_steel.png">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</None>
<None Include="assets\fma\shapes\item\tools\sharpening_stone.json">
<None Update="assets\fma\shapes\item\tools\sharpening_stone.json">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</None>
<None Include="assets\fma\itemtypes\tools\sharpening_stone.json">
<None Update="assets\fma\itemtypes\tools\sharpening_stone.json">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</None>
<None Include="assets\fma\recipes\grid\tool\sharpening_stone.json">
<None Update="assets\fma\recipes\grid\tool\sharpening_stone.json">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</None>
<None Include="assets\fma\shapes\item\tools\files.json" />
<None Include="assets\fma\itemtypes\tools\chisel.json">
<None Update="assets\fma\itemtypes\tools\chisel.json">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</None>
<None Include="assets\fma\itemtypes\tools\axe.json">
<None Update="assets\fma\itemtypes\tools\axe.json">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</None>
<None Include="assets\fma\shapes\item\material\cards.json">
<None Update="assets\fma\shapes\item\material\cards.json">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</None>
<None Include="assets\fma\shapes\item\tools\striker.json">
<None Update="assets\fma\shapes\item\tools\striker.json">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</None>
<None Include="assets\fma\config\handbook\primitive_steelmaking.json">
<None Update="assets\fma\config\handbook\primitive_steelmaking.json">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</None>
<None Include="assets\fma\itemtypes\tools\pickaxe.json">
<None Update="assets\fma\itemtypes\tools\pickaxe.json">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</None>
<None Include="assets\fma\itemtypes\tools\shovel.json">
<None Update="assets\fma\itemtypes\tools\shovel.json">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</None>
<None Include="assets\fma\itemtypes\tools\knife.json">
<None Update="assets\fma\itemtypes\tools\knife.json">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</None>
<None Include="assets\fma\itemtypes\tools\prospectingpick.json">
<None Update="assets\fma\itemtypes\tools\prospectingpick.json">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</None>
<None Include="assets\fma\itemtypes\tools\scythe.json">
<None Update="assets\fma\itemtypes\tools\scythe.json">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</None>
<None Include="assets\fma\itemtypes\tools\saw.json">
<None Update="assets\fma\itemtypes\tools\saw.json">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</None>
<None Include="assets\fma\itemtypes\tools\cleaver.json">
<None Update="assets\fma\itemtypes\tools\cleaver.json">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</None>
<None Include="assets\fma\itemtypes\tools\hammer.json">
<None Update="assets\fma\itemtypes\tools\hammer.json">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</None>
<None Include="assets\fma\itemtypes\tools\shears.json">
<None Update="assets\fma\itemtypes\tools\shears.json">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</None>
<None Include="assets\fma\itemtypes\tools\hoe.json">
<None Update="assets\fma\itemtypes\tools\hoe.json">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</None>
<None Include="assets\fma\itemtypes\arms\spear.json">
<None Update="assets\fma\itemtypes\arms\spear.json">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</None>
<None Include="assets\fma\shapes\item\arms\dory.json">
<None Update="assets\fma\shapes\item\arms\dory.json">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</None>
<None Include="assets\fma\entities\spears.json">
<None Update="assets\fma\entities\spears.json">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</None>
<None Include="assets\fma\itemtypes\tools\heads\hammer_head.json">
<None Update="assets\fma\itemtypes\tools\heads\hammer_head.json">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</None>
<None Include="assets\fma\itemtypes\tools\heads\hoe_head.json">
<None Update="assets\fma\itemtypes\tools\heads\hoe_head.json">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</None>
<None Include="assets\fma\itemtypes\arms\heads\sword_blades.json">
<None Update="assets\fma\itemtypes\arms\heads\sword_blades.json">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</None>
<None Include="assets\fma\itemtypes\arms\heads\arrow_heads.json">
<None Update="assets\fma\itemtypes\arms\heads\arrow_heads.json">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</None>
<None Include="assets\fma\itemtypes\tools\heads\pickaxe_head.json">
<None Update="assets\fma\itemtypes\tools\heads\pickaxe_head.json">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</None>
<None Include="assets\fma\itemtypes\tools\heads\shovel_head.json">
<None Update="assets\fma\itemtypes\tools\heads\shovel_head.json">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</None>
<None Include="assets\fma\itemtypes\tools\heads\propick_head.json">
<None Update="assets\fma\itemtypes\tools\heads\propick_head.json">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</None>
<None Include="assets\fma\itemtypes\tools\heads\saw_blade.json">
<None Update="assets\fma\itemtypes\tools\heads\saw_blade.json">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</None>
<None Include="assets\fma\itemtypes\tools\heads\scythe_head.json">
<None Update="assets\fma\itemtypes\tools\heads\scythe_head.json">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</None>
<None Include="assets\fma\itemtypes\tools\heads\axe_head.json">
<None Update="assets\fma\itemtypes\tools\heads\axe_head.json">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</None>
<None Include="assets\fma\entities\arrows.json" />
<None Include="assets\fma\recipes\smithing\gladii_swordblade.json">
<None Update="assets\fma\recipes\smithing\gladii_swordblade.json">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</None>
<None Include="assets\fma\itemtypes\arms\arrows.json" />
<None Include="assets\fma\recipes\grid\weapon\swords.json">
<None Update="assets\fma\recipes\grid\weapon\swords.json">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</None>
<None Include="assets\fma\recipes\grid\weapon\spears.json">
<None Update="assets\fma\recipes\grid\weapon\spears.json">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</None>
<None Include="assets\fma\recipes\grid\tool\hoes.json">
<None Update="assets\fma\recipes\grid\tool\hoes.json">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</None>
<None Include="assets\fma\recipes\grid\tool\hammers.json">
<None Update="assets\fma\recipes\grid\tool\hammers.json">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</None>
<None Include="assets\fma\recipes\grid\tool\axes.json">
<None Update="assets\fma\recipes\grid\tool\axes.json">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</None>
<None Include="assets\fma\recipes\grid\tool\saws.json">
<None Update="assets\fma\recipes\grid\tool\saws.json">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</None>
<None Include="assets\fma\recipes\grid\tool\scythes.json">
<None Update="assets\fma\recipes\grid\tool\scythes.json">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</None>
<None Include="assets\fma\recipes\grid\tool\knives.json">
<None Update="assets\fma\recipes\grid\tool\knives.json">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</None>
<None Include="assets\fma\recipes\grid\tool\shovels.json">
<None Update="assets\fma\recipes\grid\tool\shovels.json">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</None>
<None Include="assets\fma\recipes\grid\tool\pickaxes.json">
<None Update="assets\fma\recipes\grid\tool\pickaxes.json">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</None>
<None Include="assets\fma\recipes\grid\tool\propicks.json">
<None Update="assets\fma\recipes\grid\tool\propicks.json">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</None>
<None Include="assets\fma\itemtypes\tools\heads\knife_blades.json">
<None Update="assets\fma\itemtypes\tools\heads\knife_blades.json">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</None>
<None Include="assets\fma\itemtypes\arms\heads\spear_tip.json">
<None Update="assets\fma\itemtypes\arms\heads\spear_tip.json">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</None>
<None Include="assets\fma\recipes\smithing\dory_speartip.json">
<None Update="assets\fma\recipes\smithing\dory_speartip.json">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</None>
<None Include="assets\fma\shapes\item\tools\drawplate.json">
<None Update="assets\fma\shapes\item\tools\drawplate.json">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</None>
<None Include="assets\fma\blocktypes\metal\crusie_lamp.json" />
<None Include="assets\fma\textures\metal\black_iron2.png" />
<None Include="assets\fma\textures\liquids\liquid_oil.png" />
<None Include="assets\fma\itemtypes\metallurgy\metal_cards.json">
<None Update="assets\fma\itemtypes\metallurgy\metal_cards.json">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</None>
<None Include="assets\fma\recipes\smithing\metal_cards.json" />
<None Include="assets\fma\shapes\item\arms\seax.json">
<None Update="assets\fma\shapes\item\arms\seax.json">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</None>
<None Include="modicon.png">
<None Update="modicon.png">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</None>
</ItemGroup>
<Import Project="$(MSBuildBinPath)\Microsoft.CSharp.targets" />
<ItemGroup>
<PackageReference Include="Newtonsoft.Json" Version="13.0.3" />
</ItemGroup>
</Project>

View file

@ -1,31 +1,11 @@
using System.Reflection;
using System.Runtime.CompilerServices;
// Information about this assembly is defined by the following attributes.
// Change them to the values specific to your project.
[assembly: AssemblyTitle("Era_Of_Steel")]
[assembly: AssemblyDescription("Mod plugin for V.S.")]
#if DEBUG
[assembly: AssemblyConfiguration("DEBUG")]
#else
[assembly: AssemblyConfiguration("RELEASE")]
#endif
[assembly: AssemblyCompany("")]
[assembly: AssemblyProduct("First_Machine_Age_component")]
[assembly: AssemblyCopyright("Melchior")]
[assembly: AssemblyTrademark("")]
[assembly: AssemblyCulture("")]
// The assembly version has the format "{Major}.{Minor}.{Build}.{Revision}".
// The form "{Major}.{Minor}.*" will automatically update the build and revision,
// and "{Major}.{Minor}.{Build}.*" will update just the revision.
[assembly: AssemblyVersion("1.0.*")]
// The following attributes are used to specify the signing key for the assembly,
// if desired. See the Mono documentation for more information about signing.
//[assembly: AssemblyDelaySign(false)]
//[assembly: AssemblyKeyFile("")]
using System.Reflection;
using System.Runtime.CompilerServices;
[assembly: AssemblyTrademark("")]
[assembly: AssemblyCulture("")]
// The following attributes are used to specify the signing key for the assembly,
// if desired. See the Mono documentation for more information about signing.
//[assembly: AssemblyDelaySign(false)]
//[assembly: AssemblyKeyFile("")]

View file

@ -1,54 +1,38 @@
<?xml version="1.0" encoding="utf-8"?>
<Project DefaultTargets="Build" ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
<ProjectGuid>{DE0A4E7D-E5FA-441D-A11A-8279E6AC5BBC}</ProjectGuid>
<TargetFramework>net7.0</TargetFramework>
<OutputType>Library</OutputType>
<RootNamespace>FirstMachineAge</RootNamespace>
<AssemblyName>FirstMachineAge_Common</AssemblyName>
<TargetFrameworkVersion>v4.5</TargetFrameworkVersion>
<GenerateAssemblyInfo>false</GenerateAssemblyInfo>
<AssemblyTitle>FirstMachineAge_Common</AssemblyTitle>
<Copyright>Melchior</Copyright>
<AssemblyVersion>1.0.*</AssemblyVersion>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
<DebugSymbols>true</DebugSymbols>
<DebugType>full</DebugType>
<Optimize>false</Optimize>
<OutputPath>bin\Debug</OutputPath>
<DefineConstants>DEBUG;</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
<ConsolePause>false</ConsolePause>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
<Optimize>true</Optimize>
<OutputPath>bin\Release</OutputPath>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
<ConsolePause>false</ConsolePause>
</PropertyGroup>
<ItemGroup>
<Reference Include="System" />
<Reference Include="VintagestoryAPI">
<HintPath>vs_libs\VintagestoryAPI.dll</HintPath>
<HintPath>$(VINTAGE_STORY)\VintagestoryAPI.dll</HintPath>
</Reference>
<Reference Include="VSCreativeMod">
<HintPath>vs_libs\VSCreativeMod.dll</HintPath>
<HintPath>$(VINTAGE_STORY)\Mods\VSCreativeMod.dll</HintPath>
</Reference>
<Reference Include="VSEssentials">
<HintPath>vs_libs\VSEssentials.dll</HintPath>
<HintPath>$(VINTAGE_STORY)\Mods\VSEssentials.dll</HintPath>
</Reference>
<Reference Include="VSSurvivalMod">
<HintPath>vs_libs\VSSurvivalMod.dll</HintPath>
<HintPath>$(VINTAGE_STORY)\Mods\VSSurvivalMod.dll</HintPath>
</Reference>
</ItemGroup>
<ItemGroup>
<Compile Include="Helpers.cs" />
<Compile Include="Properties\AssemblyInfo.cs" />
<Compile Include="ILogicNetNode.cs" />
<Compile Include="IMultiBlockModule.cs" />
</ItemGroup>
<ItemGroup>
<Folder Include="vs_libs\" />
</ItemGroup>
<Import Project="$(MSBuildBinPath)\Microsoft.CSharp.targets" />
</Project>

View file

@ -1,27 +1,11 @@
using System.Reflection;
using System.Runtime.CompilerServices;
// Information about this assembly is defined by the following attributes.
// Change them to the values specific to your project.
[assembly: AssemblyTitle("FirstMachineAge_Common")]
[assembly: AssemblyDescription("")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("")]
[assembly: AssemblyProduct("")]
[assembly: AssemblyCopyright("Melchior")]
[assembly: AssemblyTrademark("")]
[assembly: AssemblyCulture("")]
// The assembly version has the format "{Major}.{Minor}.{Build}.{Revision}".
// The form "{Major}.{Minor}.*" will automatically update the build and revision,
// and "{Major}.{Minor}.{Build}.*" will update just the revision.
[assembly: AssemblyVersion("1.0.*")]
// The following attributes are used to specify the signing key for the assembly,
// if desired. See the Mono documentation for more information about signing.
//[assembly: AssemblyDelaySign(false)]
//[assembly: AssemblyKeyFile("")]
using System.Reflection;
using System.Runtime.CompilerServices;
[assembly: AssemblyTrademark("")]
[assembly: AssemblyCulture("")]
// The following attributes are used to specify the signing key for the assembly,
// if desired. See the Mono documentation for more information about signing.
//[assembly: AssemblyDelaySign(false)]
//[assembly: AssemblyKeyFile("")]

View file

@ -1,17 +1,17 @@
Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio 2012
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Common", "FirstMachineAge_Common\Common.csproj", "{DE0A4E7D-E5FA-441D-A11A-8279E6AC5BBC}"
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Common", "FirstMachineAge_Common\Common.csproj", "{DE0A4E7D-E5FA-441D-A11A-8279E6AC5BBC}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "AccessControls", "AccessControls\AccessControls.csproj", "{180853A2-7E1D-4876-9D1E-AA8608D701C3}"
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "AccessControls", "AccessControls\AccessControls.csproj", "{180853A2-7E1D-4876-9D1E-AA8608D701C3}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "AnvilMetalRecovery", "AnvilMetalRecovery\AnvilMetalRecovery.csproj", "{3EC9A581-655C-4F68-898C-4E773C292082}"
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "AnvilMetalRecovery", "AnvilMetalRecovery\AnvilMetalRecovery.csproj", "{3EC9A581-655C-4F68-898C-4E773C292082}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Assorted", "Assorted\Assorted.csproj", "{805B37F5-F87D-4A63-BD3F-66AE59F1C998}"
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Assorted", "Assorted\Assorted.csproj", "{805B37F5-F87D-4A63-BD3F-66AE59F1C998}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "PsudeoTarget", "PsudeoTarget\PsudeoTarget.csproj", "{DF81DB59-817A-48BA-88CC-8173E6D2919D}"
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "PsudeoTarget", "PsudeoTarget\PsudeoTarget.csproj", "{DF81DB59-817A-48BA-88CC-8173E6D2919D}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "ElementalTools", "ElementalTools\ElementalTools.csproj", "{EA9BA3EC-EF08-4192-A844-4D3F398B1FFF}"
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "ElementalTools", "ElementalTools\ElementalTools.csproj", "{EA9BA3EC-EF08-4192-A844-4D3F398B1FFF}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution

View file

@ -1,27 +1,11 @@
using System.Reflection;
using System.Runtime.CompilerServices;
// Information about this assembly is defined by the following attributes.
// Change them to the values specific to your project.
[assembly: AssemblyTitle("PsudeoTarget")]
[assembly: AssemblyDescription("")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("")]
[assembly: AssemblyProduct("")]
[assembly: AssemblyCopyright("librarian")]
[assembly: AssemblyTrademark("")]
[assembly: AssemblyCulture("")]
// The assembly version has the format "{Major}.{Minor}.{Build}.{Revision}".
// The form "{Major}.{Minor}.*" will automatically update the build and revision,
// and "{Major}.{Minor}.{Build}.*" will update just the revision.
[assembly: AssemblyVersion("1.0.*")]
// The following attributes are used to specify the signing key for the assembly,
// if desired. See the Mono documentation for more information about signing.
//[assembly: AssemblyDelaySign(false)]
//[assembly: AssemblyKeyFile("")]
using System.Reflection;
using System.Runtime.CompilerServices;
[assembly: AssemblyTrademark("")]
[assembly: AssemblyCulture("")]
// The following attributes are used to specify the signing key for the assembly,
// if desired. See the Mono documentation for more information about signing.
//[assembly: AssemblyDelaySign(false)]
//[assembly: AssemblyKeyFile("")]

View file

@ -1,37 +1,19 @@
<?xml version="1.0" encoding="utf-8"?>
<Project DefaultTargets="Build" ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
<ProjectGuid>{DF81DB59-817A-48BA-88CC-8173E6D2919D}</ProjectGuid>
<TargetFramework>net7.0</TargetFramework>
<OutputType>Exe</OutputType>
<RootNamespace>PsudeoTarget</RootNamespace>
<AssemblyName>PsudeoTarget</AssemblyName>
<TargetFrameworkVersion>v4.5</TargetFrameworkVersion>
<GenerateAssemblyInfo>false</GenerateAssemblyInfo>
<AssemblyTitle>PsudeoTarget</AssemblyTitle>
<Copyright>librarian</Copyright>
<AssemblyVersion>1.0.*</AssemblyVersion>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
<DebugSymbols>true</DebugSymbols>
<DebugType>full</DebugType>
<Optimize>false</Optimize>
<OutputPath>bin\Debug</OutputPath>
<DefineConstants>DEBUG;</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
<ExternalConsole>true</ExternalConsole>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
<Optimize>true</Optimize>
<OutputPath>bin\Release</OutputPath>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
<ExternalConsole>true</ExternalConsole>
</PropertyGroup>
<ItemGroup>
<Reference Include="System" />
</ItemGroup>
<ItemGroup>
<Compile Include="Program.cs" />
<Compile Include="Properties\AssemblyInfo.cs" />
</ItemGroup>
<Import Project="$(MSBuildBinPath)\Microsoft.CSharp.targets" />
</Project>