···11+# Created by https://www.toptal.com/developers/gitignore/api/csharp,visualstudio,visualstudiocode,rider
22+# Edit at https://www.toptal.com/developers/gitignore?templates=csharp,visualstudio,visualstudiocode,rider
33+44+### Csharp ###
55+## Ignore Visual Studio temporary files, build results, and
66+## files generated by popular Visual Studio add-ons.
77+##
88+## Get latest from https://github.com/github/gitignore/blob/main/VisualStudio.gitignore
99+1010+# User-specific files
1111+*.rsuser
1212+*.suo
1313+*.user
1414+*.userosscache
1515+*.sln.docstates
1616+1717+# User-specific files (MonoDevelop/Xamarin Studio)
1818+*.userprefs
1919+2020+# Mono auto generated files
2121+mono_crash.*
2222+2323+# Build results
2424+[Dd]ebug/
2525+[Dd]ebugPublic/
2626+[Rr]elease/
2727+[Rr]eleases/
2828+x64/
2929+x86/
3030+[Ww][Ii][Nn]32/
3131+[Aa][Rr][Mm]/
3232+[Aa][Rr][Mm]64/
3333+bld/
3434+[Bb]in/
3535+[Oo]bj/
3636+[Ll]og/
3737+[Ll]ogs/
3838+3939+# Visual Studio 2015/2017 cache/options directory
4040+.vs/
4141+# Uncomment if you have tasks that create the project's static files in wwwroot
4242+#wwwroot/
4343+4444+# Visual Studio 2017 auto generated files
4545+Generated\ Files/
4646+4747+# MSTest test Results
4848+[Tt]est[Rr]esult*/
4949+[Bb]uild[Ll]og.*
5050+5151+# NUnit
5252+*.VisualState.xml
5353+TestResult.xml
5454+nunit-*.xml
5555+5656+# Build Results of an ATL Project
5757+[Dd]ebugPS/
5858+[Rr]eleasePS/
5959+dlldata.c
6060+6161+# Benchmark Results
6262+BenchmarkDotNet.Artifacts/
6363+6464+# .NET Core
6565+project.lock.json
6666+project.fragment.lock.json
6767+artifacts/
6868+6969+# ASP.NET Scaffolding
7070+ScaffoldingReadMe.txt
7171+7272+# StyleCop
7373+StyleCopReport.xml
7474+7575+# Files built by Visual Studio
7676+*_i.c
7777+*_p.c
7878+*_h.h
7979+*.ilk
8080+*.meta
8181+*.obj
8282+*.iobj
8383+*.pch
8484+*.pdb
8585+*.ipdb
8686+*.pgc
8787+*.pgd
8888+*.rsp
8989+*.sbr
9090+*.tlb
9191+*.tli
9292+*.tlh
9393+*.tmp
9494+*.tmp_proj
9595+*_wpftmp.csproj
9696+*.log
9797+*.tlog
9898+*.vspscc
9999+*.vssscc
100100+.builds
101101+*.pidb
102102+*.svclog
103103+*.scc
104104+105105+# Chutzpah Test files
106106+_Chutzpah*
107107+108108+# Visual C++ cache files
109109+ipch/
110110+*.aps
111111+*.ncb
112112+*.opendb
113113+*.opensdf
114114+*.sdf
115115+*.cachefile
116116+*.VC.db
117117+*.VC.VC.opendb
118118+119119+# Visual Studio profiler
120120+*.psess
121121+*.vsp
122122+*.vspx
123123+*.sap
124124+125125+# Visual Studio Trace Files
126126+*.e2e
127127+128128+# TFS 2012 Local Workspace
129129+$tf/
130130+131131+# Guidance Automation Toolkit
132132+*.gpState
133133+134134+# ReSharper is a .NET coding add-in
135135+_ReSharper*/
136136+*.[Rr]e[Ss]harper
137137+*.DotSettings.user
138138+139139+# TeamCity is a build add-in
140140+_TeamCity*
141141+142142+# DotCover is a Code Coverage Tool
143143+*.dotCover
144144+145145+# AxoCover is a Code Coverage Tool
146146+.axoCover/*
147147+!.axoCover/settings.json
148148+149149+# Coverlet is a free, cross platform Code Coverage Tool
150150+coverage*.json
151151+coverage*.xml
152152+coverage*.info
153153+154154+# Visual Studio code coverage results
155155+*.coverage
156156+*.coveragexml
157157+158158+# NCrunch
159159+_NCrunch_*
160160+.*crunch*.local.xml
161161+nCrunchTemp_*
162162+163163+# MightyMoose
164164+*.mm.*
165165+AutoTest.Net/
166166+167167+# Web workbench (sass)
168168+.sass-cache/
169169+170170+# Installshield output folder
171171+[Ee]xpress/
172172+173173+# DocProject is a documentation generator add-in
174174+DocProject/buildhelp/
175175+DocProject/Help/*.HxT
176176+DocProject/Help/*.HxC
177177+DocProject/Help/*.hhc
178178+DocProject/Help/*.hhk
179179+DocProject/Help/*.hhp
180180+DocProject/Help/Html2
181181+DocProject/Help/html
182182+183183+# Click-Once directory
184184+publish/
185185+186186+# Publish Web Output
187187+*.[Pp]ublish.xml
188188+*.azurePubxml
189189+# Note: Comment the next line if you want to checkin your web deploy settings,
190190+# but database connection strings (with potential passwords) will be unencrypted
191191+*.pubxml
192192+*.publishproj
193193+194194+# Microsoft Azure Web App publish settings. Comment the next line if you want to
195195+# checkin your Azure Web App publish settings, but sensitive information contained
196196+# in these scripts will be unencrypted
197197+PublishScripts/
198198+199199+# NuGet Packages
200200+*.nupkg
201201+# NuGet Symbol Packages
202202+*.snupkg
203203+# The packages folder can be ignored because of Package Restore
204204+**/[Pp]ackages/*
205205+# except build/, which is used as an MSBuild target.
206206+!**/[Pp]ackages/build/
207207+# Uncomment if necessary however generally it will be regenerated when needed
208208+#!**/[Pp]ackages/repositories.config
209209+# NuGet v3's project.json files produces more ignorable files
210210+*.nuget.props
211211+*.nuget.targets
212212+213213+# Microsoft Azure Build Output
214214+csx/
215215+*.build.csdef
216216+217217+# Microsoft Azure Emulator
218218+ecf/
219219+rcf/
220220+221221+# Windows Store app package directories and files
222222+AppPackages/
223223+BundleArtifacts/
224224+Package.StoreAssociation.xml
225225+_pkginfo.txt
226226+*.appx
227227+*.appxbundle
228228+*.appxupload
229229+230230+# Visual Studio cache files
231231+# files ending in .cache can be ignored
232232+*.[Cc]ache
233233+# but keep track of directories ending in .cache
234234+!?*.[Cc]ache/
235235+236236+# Others
237237+ClientBin/
238238+~$*
239239+*~
240240+*.dbmdl
241241+*.dbproj.schemaview
242242+*.jfm
243243+*.pfx
244244+*.publishsettings
245245+orleans.codegen.cs
246246+247247+# Including strong name files can present a security risk
248248+# (https://github.com/github/gitignore/pull/2483#issue-259490424)
249249+#*.snk
250250+251251+# Since there are multiple workflows, uncomment next line to ignore bower_components
252252+# (https://github.com/github/gitignore/pull/1529#issuecomment-104372622)
253253+#bower_components/
254254+255255+# RIA/Silverlight projects
256256+Generated_Code/
257257+258258+# Backup & report files from converting an old project file
259259+# to a newer Visual Studio version. Backup files are not needed,
260260+# because we have git ;-)
261261+_UpgradeReport_Files/
262262+Backup*/
263263+UpgradeLog*.XML
264264+UpgradeLog*.htm
265265+ServiceFabricBackup/
266266+*.rptproj.bak
267267+268268+# SQL Server files
269269+*.mdf
270270+*.ldf
271271+*.ndf
272272+273273+# Business Intelligence projects
274274+*.rdl.data
275275+*.bim.layout
276276+*.bim_*.settings
277277+*.rptproj.rsuser
278278+*- [Bb]ackup.rdl
279279+*- [Bb]ackup ([0-9]).rdl
280280+*- [Bb]ackup ([0-9][0-9]).rdl
281281+282282+# Microsoft Fakes
283283+FakesAssemblies/
284284+285285+# GhostDoc plugin setting file
286286+*.GhostDoc.xml
287287+288288+# Node.js Tools for Visual Studio
289289+.ntvs_analysis.dat
290290+node_modules/
291291+292292+# Visual Studio 6 build log
293293+*.plg
294294+295295+# Visual Studio 6 workspace options file
296296+*.opt
297297+298298+# Visual Studio 6 auto-generated workspace file (contains which files were open etc.)
299299+*.vbw
300300+301301+# Visual Studio 6 auto-generated project file (contains which files were open etc.)
302302+*.vbp
303303+304304+# Visual Studio 6 workspace and project file (working project files containing files to include in project)
305305+*.dsw
306306+*.dsp
307307+308308+# Visual Studio 6 technical files
309309+310310+# Visual Studio LightSwitch build output
311311+**/*.HTMLClient/GeneratedArtifacts
312312+**/*.DesktopClient/GeneratedArtifacts
313313+**/*.DesktopClient/ModelManifest.xml
314314+**/*.Server/GeneratedArtifacts
315315+**/*.Server/ModelManifest.xml
316316+_Pvt_Extensions
317317+318318+# Paket dependency manager
319319+.paket/paket.exe
320320+paket-files/
321321+322322+# FAKE - F# Make
323323+.fake/
324324+325325+# CodeRush personal settings
326326+.cr/personal
327327+328328+# Python Tools for Visual Studio (PTVS)
329329+__pycache__/
330330+*.pyc
331331+332332+# Cake - Uncomment if you are using it
333333+# tools/**
334334+# !tools/packages.config
335335+336336+# Tabs Studio
337337+*.tss
338338+339339+# Telerik's JustMock configuration file
340340+*.jmconfig
341341+342342+# BizTalk build output
343343+*.btp.cs
344344+*.btm.cs
345345+*.odx.cs
346346+*.xsd.cs
347347+348348+# OpenCover UI analysis results
349349+OpenCover/
350350+351351+# Azure Stream Analytics local run output
352352+ASALocalRun/
353353+354354+# MSBuild Binary and Structured Log
355355+*.binlog
356356+357357+# NVidia Nsight GPU debugger configuration file
358358+*.nvuser
359359+360360+# MFractors (Xamarin productivity tool) working folder
361361+.mfractor/
362362+363363+# Local History for Visual Studio
364364+.localhistory/
365365+366366+# Visual Studio History (VSHistory) files
367367+.vshistory/
368368+369369+# BeatPulse healthcheck temp database
370370+healthchecksdb
371371+372372+# Backup folder for Package Reference Convert tool in Visual Studio 2017
373373+MigrationBackup/
374374+375375+# Ionide (cross platform F# VS Code tools) working folder
376376+.ionide/
377377+378378+# Fody - auto-generated XML schema
379379+FodyWeavers.xsd
380380+381381+# VS Code files for those working on multiple tools
382382+.vscode/*
383383+!.vscode/settings.json
384384+!.vscode/tasks.json
385385+!.vscode/launch.json
386386+!.vscode/extensions.json
387387+*.code-workspace
388388+389389+# Local History for Visual Studio Code
390390+.history/
391391+392392+# Windows Installer files from build outputs
393393+*.cab
394394+*.msi
395395+*.msix
396396+*.msm
397397+*.msp
398398+399399+# JetBrains Rider
400400+*.sln.iml
401401+402402+### Rider ###
403403+# Covers JetBrains IDEs: IntelliJ, RubyMine, PhpStorm, AppCode, PyCharm, CLion, Android Studio, WebStorm and Rider
404404+# Reference: https://intellij-support.jetbrains.com/hc/en-us/articles/206544839
405405+406406+# User-specific stuff
407407+.idea/**/workspace.xml
408408+.idea/**/tasks.xml
409409+.idea/**/usage.statistics.xml
410410+.idea/**/dictionaries
411411+.idea/**/shelf
412412+413413+# AWS User-specific
414414+.idea/**/aws.xml
415415+416416+# Generated files
417417+.idea/**/contentModel.xml
418418+419419+# Sensitive or high-churn files
420420+.idea/**/dataSources/
421421+.idea/**/dataSources.ids
422422+.idea/**/dataSources.local.xml
423423+.idea/**/sqlDataSources.xml
424424+.idea/**/dynamic.xml
425425+.idea/**/uiDesigner.xml
426426+.idea/**/dbnavigator.xml
427427+428428+# Gradle
429429+.idea/**/gradle.xml
430430+.idea/**/libraries
431431+432432+# Gradle and Maven with auto-import
433433+# When using Gradle or Maven with auto-import, you should exclude module files,
434434+# since they will be recreated, and may cause churn. Uncomment if using
435435+# auto-import.
436436+# .idea/artifacts
437437+# .idea/compiler.xml
438438+# .idea/jarRepositories.xml
439439+# .idea/modules.xml
440440+# .idea/*.iml
441441+# .idea/modules
442442+# *.iml
443443+# *.ipr
444444+445445+# CMake
446446+cmake-build-*/
447447+448448+# Mongo Explorer plugin
449449+.idea/**/mongoSettings.xml
450450+451451+# File-based project format
452452+*.iws
453453+454454+# IntelliJ
455455+out/
456456+457457+# mpeltonen/sbt-idea plugin
458458+.idea_modules/
459459+460460+# JIRA plugin
461461+atlassian-ide-plugin.xml
462462+463463+# Cursive Clojure plugin
464464+.idea/replstate.xml
465465+466466+# SonarLint plugin
467467+.idea/sonarlint/
468468+469469+# Crashlytics plugin (for Android Studio and IntelliJ)
470470+com_crashlytics_export_strings.xml
471471+crashlytics.properties
472472+crashlytics-build.properties
473473+fabric.properties
474474+475475+# Editor-based Rest Client
476476+.idea/httpRequests
477477+478478+# Android studio 3.1+ serialized cache file
479479+.idea/caches/build_file_checksums.ser
480480+481481+### VisualStudioCode ###
482482+!.vscode/*.code-snippets
483483+484484+# Local History for Visual Studio Code
485485+486486+# Built Visual Studio Code Extensions
487487+*.vsix
488488+489489+### VisualStudioCode Patch ###
490490+# Ignore all local history of files
491491+.history
492492+.ionide
493493+494494+### VisualStudio ###
495495+496496+# User-specific files
497497+498498+# User-specific files (MonoDevelop/Xamarin Studio)
499499+500500+# Mono auto generated files
501501+502502+# Build results
503503+504504+# Visual Studio 2015/2017 cache/options directory
505505+# Uncomment if you have tasks that create the project's static files in wwwroot
506506+507507+# Visual Studio 2017 auto generated files
508508+509509+# MSTest test Results
510510+511511+# NUnit
512512+513513+# Build Results of an ATL Project
514514+515515+# Benchmark Results
516516+517517+# .NET Core
518518+519519+# ASP.NET Scaffolding
520520+521521+# StyleCop
522522+523523+# Files built by Visual Studio
524524+525525+# Chutzpah Test files
526526+527527+# Visual C++ cache files
528528+529529+# Visual Studio profiler
530530+531531+# Visual Studio Trace Files
532532+533533+# TFS 2012 Local Workspace
534534+535535+# Guidance Automation Toolkit
536536+537537+# ReSharper is a .NET coding add-in
538538+539539+# TeamCity is a build add-in
540540+541541+# DotCover is a Code Coverage Tool
542542+543543+# AxoCover is a Code Coverage Tool
544544+545545+# Coverlet is a free, cross platform Code Coverage Tool
546546+547547+# Visual Studio code coverage results
548548+549549+# NCrunch
550550+551551+# MightyMoose
552552+553553+# Web workbench (sass)
554554+555555+# Installshield output folder
556556+557557+# DocProject is a documentation generator add-in
558558+559559+# Click-Once directory
560560+561561+# Publish Web Output
562562+# Note: Comment the next line if you want to checkin your web deploy settings,
563563+# but database connection strings (with potential passwords) will be unencrypted
564564+565565+# Microsoft Azure Web App publish settings. Comment the next line if you want to
566566+# checkin your Azure Web App publish settings, but sensitive information contained
567567+# in these scripts will be unencrypted
568568+569569+# NuGet Packages
570570+# NuGet Symbol Packages
571571+# The packages folder can be ignored because of Package Restore
572572+# except build/, which is used as an MSBuild target.
573573+# Uncomment if necessary however generally it will be regenerated when needed
574574+# NuGet v3's project.json files produces more ignorable files
575575+576576+# Microsoft Azure Build Output
577577+578578+# Microsoft Azure Emulator
579579+580580+# Windows Store app package directories and files
581581+582582+# Visual Studio cache files
583583+# files ending in .cache can be ignored
584584+# but keep track of directories ending in .cache
585585+586586+# Others
587587+588588+# Including strong name files can present a security risk
589589+# (https://github.com/github/gitignore/pull/2483#issue-259490424)
590590+591591+# Since there are multiple workflows, uncomment next line to ignore bower_components
592592+# (https://github.com/github/gitignore/pull/1529#issuecomment-104372622)
593593+594594+# RIA/Silverlight projects
595595+596596+# Backup & report files from converting an old project file
597597+# to a newer Visual Studio version. Backup files are not needed,
598598+# because we have git ;-)
599599+600600+# SQL Server files
601601+602602+# Business Intelligence projects
603603+604604+# Microsoft Fakes
605605+606606+# GhostDoc plugin setting file
607607+608608+# Node.js Tools for Visual Studio
609609+610610+# Visual Studio 6 build log
611611+612612+# Visual Studio 6 workspace options file
613613+614614+# Visual Studio 6 auto-generated workspace file (contains which files were open etc.)
615615+616616+# Visual Studio 6 auto-generated project file (contains which files were open etc.)
617617+618618+# Visual Studio 6 workspace and project file (working project files containing files to include in project)
619619+620620+# Visual Studio 6 technical files
621621+622622+# Visual Studio LightSwitch build output
623623+624624+# Paket dependency manager
625625+626626+# FAKE - F# Make
627627+628628+# CodeRush personal settings
629629+630630+# Python Tools for Visual Studio (PTVS)
631631+632632+# Cake - Uncomment if you are using it
633633+# tools/**
634634+# !tools/packages.config
635635+636636+# Tabs Studio
637637+638638+# Telerik's JustMock configuration file
639639+640640+# BizTalk build output
641641+642642+# OpenCover UI analysis results
643643+644644+# Azure Stream Analytics local run output
645645+646646+# MSBuild Binary and Structured Log
647647+648648+# NVidia Nsight GPU debugger configuration file
649649+650650+# MFractors (Xamarin productivity tool) working folder
651651+652652+# Local History for Visual Studio
653653+654654+# Visual Studio History (VSHistory) files
655655+656656+# BeatPulse healthcheck temp database
657657+658658+# Backup folder for Package Reference Convert tool in Visual Studio 2017
659659+660660+# Ionide (cross platform F# VS Code tools) working folder
661661+662662+# Fody - auto-generated XML schema
663663+664664+# VS Code files for those working on multiple tools
665665+666666+# Local History for Visual Studio Code
667667+668668+# Windows Installer files from build outputs
669669+670670+# JetBrains Rider
671671+672672+### VisualStudio Patch ###
673673+# Additional files built by Visual Studio
674674+675675+# End of https://www.toptal.com/developers/gitignore/api/csharp,visualstudio,visualstudiocode,rider
···11+using System;
22+using System.IO;
33+using Cake.Common;
44+using Cake.Common.IO;
55+using Cake.Common.Tools.DotNet;
66+using Cake.Common.Tools.DotNet.Clean;
77+using Cake.Common.Tools.DotNet.Publish;
88+using Cake.Core;
99+using Cake.Frosting;
1010+using Cake.Json;
1111+using Newtonsoft.Json;
1212+using Newtonsoft.Json.Linq;
1313+using Vintagestory.API.Common;
1414+1515+public static class Program
1616+{
1717+ public static int Main(string[] args)
1818+ {
1919+ return new CakeHost()
2020+ .UseContext<BuildContext>()
2121+ .Run(args);
2222+ }
2323+}
2424+2525+public class BuildContext : FrostingContext
2626+{
2727+ public const string ProjectName = "ModTemplate";
2828+ public string BuildConfiguration { get; set; }
2929+ public string Version { get; }
3030+ public string Name { get; }
3131+ public bool SkipJsonValidation { get; set; }
3232+3333+ public BuildContext(ICakeContext context)
3434+ : base(context)
3535+ {
3636+ BuildConfiguration = context.Argument("configuration", "Release");
3737+ SkipJsonValidation = context.Argument("skipJsonValidation", false);
3838+ var modInfo = context.DeserializeJsonFromFile<ModInfo>($"../{BuildContext.ProjectName}/modinfo.json");
3939+ Version = modInfo.Version;
4040+ Name = modInfo.ModID;
4141+ }
4242+}
4343+4444+[TaskName("ValidateJson")]
4545+public sealed class ValidateJsonTask : FrostingTask<BuildContext>
4646+{
4747+ public override void Run(BuildContext context)
4848+ {
4949+ if (context.SkipJsonValidation)
5050+ {
5151+ return;
5252+ }
5353+ var jsonFiles = context.GetFiles($"../{BuildContext.ProjectName}/assets/**/*.json");
5454+ foreach (var file in jsonFiles)
5555+ {
5656+ try
5757+ {
5858+ var json = File.ReadAllText(file.FullPath);
5959+ JToken.Parse(json);
6060+ }
6161+ catch (JsonException ex)
6262+ {
6363+ throw new Exception($"Validation failed for JSON file: {file.FullPath}{Environment.NewLine}{ex.Message}", ex);
6464+ }
6565+ }
6666+ }
6767+}
6868+6969+[TaskName("Build")]
7070+[IsDependentOn(typeof(ValidateJsonTask))]
7171+public sealed class BuildTask : FrostingTask<BuildContext>
7272+{
7373+ public override void Run(BuildContext context)
7474+ {
7575+ context.DotNetClean($"../{BuildContext.ProjectName}/{BuildContext.ProjectName}.csproj",
7676+ new DotNetCleanSettings
7777+ {
7878+ Configuration = context.BuildConfiguration
7979+ });
8080+8181+8282+ context.DotNetPublish($"../{BuildContext.ProjectName}/{BuildContext.ProjectName}.csproj",
8383+ new DotNetPublishSettings
8484+ {
8585+ Configuration = context.BuildConfiguration
8686+ });
8787+ }
8888+}
8989+9090+[TaskName("Package")]
9191+[IsDependentOn(typeof(BuildTask))]
9292+public sealed class PackageTask : FrostingTask<BuildContext>
9393+{
9494+ public override void Run(BuildContext context)
9595+ {
9696+ context.EnsureDirectoryExists("../Releases");
9797+ context.CleanDirectory("../Releases");
9898+ context.EnsureDirectoryExists($"../Releases/{context.Name}");
9999+ context.CopyFiles($"../{BuildContext.ProjectName}/bin/{context.BuildConfiguration}/Mods/mod/publish/*", $"../Releases/{context.Name}");
100100+ context.CopyDirectory($"../{BuildContext.ProjectName}/assets", $"../Releases/{context.Name}/assets");
101101+ context.CopyFile($"../{BuildContext.ProjectName}/modinfo.json", $"../Releases/{context.Name}/modinfo.json");
102102+ if (context.FileExists($"../{BuildContext.ProjectName}/modicon.png"))
103103+ {
104104+ context.CopyFile($"../{BuildContext.ProjectName}/modicon.png", $"../Releases/{context.Name}/modicon.png");
105105+ }
106106+ context.Zip($"../Releases/{context.Name}", $"../Releases/{context.Name}_{context.Version}.zip");
107107+ }
108108+}
109109+110110+[TaskName("Default")]
111111+[IsDependentOn(typeof(PackageTask))]
112112+public class DefaultTask : FrostingTask
113113+{
114114+}
+121
LICENSE
···11+Creative Commons Legal Code
22+33+CC0 1.0 Universal
44+55+ CREATIVE COMMONS CORPORATION IS NOT A LAW FIRM AND DOES NOT PROVIDE
66+ LEGAL SERVICES. DISTRIBUTION OF THIS DOCUMENT DOES NOT CREATE AN
77+ ATTORNEY-CLIENT RELATIONSHIP. CREATIVE COMMONS PROVIDES THIS
88+ INFORMATION ON AN "AS-IS" BASIS. CREATIVE COMMONS MAKES NO WARRANTIES
99+ REGARDING THE USE OF THIS DOCUMENT OR THE INFORMATION OR WORKS
1010+ PROVIDED HEREUNDER, AND DISCLAIMS LIABILITY FOR DAMAGES RESULTING FROM
1111+ THE USE OF THIS DOCUMENT OR THE INFORMATION OR WORKS PROVIDED
1212+ HEREUNDER.
1313+1414+Statement of Purpose
1515+1616+The laws of most jurisdictions throughout the world automatically confer
1717+exclusive Copyright and Related Rights (defined below) upon the creator
1818+and subsequent owner(s) (each and all, an "owner") of an original work of
1919+authorship and/or a database (each, a "Work").
2020+2121+Certain owners wish to permanently relinquish those rights to a Work for
2222+the purpose of contributing to a commons of creative, cultural and
2323+scientific works ("Commons") that the public can reliably and without fear
2424+of later claims of infringement build upon, modify, incorporate in other
2525+works, reuse and redistribute as freely as possible in any form whatsoever
2626+and for any purposes, including without limitation commercial purposes.
2727+These owners may contribute to the Commons to promote the ideal of a free
2828+culture and the further production of creative, cultural and scientific
2929+works, or to gain reputation or greater distribution for their Work in
3030+part through the use and efforts of others.
3131+3232+For these and/or other purposes and motivations, and without any
3333+expectation of additional consideration or compensation, the person
3434+associating CC0 with a Work (the "Affirmer"), to the extent that he or she
3535+is an owner of Copyright and Related Rights in the Work, voluntarily
3636+elects to apply CC0 to the Work and publicly distribute the Work under its
3737+terms, with knowledge of his or her Copyright and Related Rights in the
3838+Work and the meaning and intended legal effect of CC0 on those rights.
3939+4040+1. Copyright and Related Rights. A Work made available under CC0 may be
4141+protected by copyright and related or neighboring rights ("Copyright and
4242+Related Rights"). Copyright and Related Rights include, but are not
4343+limited to, the following:
4444+4545+ i. the right to reproduce, adapt, distribute, perform, display,
4646+ communicate, and translate a Work;
4747+ ii. moral rights retained by the original author(s) and/or performer(s);
4848+iii. publicity and privacy rights pertaining to a person's image or
4949+ likeness depicted in a Work;
5050+ iv. rights protecting against unfair competition in regards to a Work,
5151+ subject to the limitations in paragraph 4(a), below;
5252+ v. rights protecting the extraction, dissemination, use and reuse of data
5353+ in a Work;
5454+ vi. database rights (such as those arising under Directive 96/9/EC of the
5555+ European Parliament and of the Council of 11 March 1996 on the legal
5656+ protection of databases, and under any national implementation
5757+ thereof, including any amended or successor version of such
5858+ directive); and
5959+vii. other similar, equivalent or corresponding rights throughout the
6060+ world based on applicable law or treaty, and any national
6161+ implementations thereof.
6262+6363+2. Waiver. To the greatest extent permitted by, but not in contravention
6464+of, applicable law, Affirmer hereby overtly, fully, permanently,
6565+irrevocably and unconditionally waives, abandons, and surrenders all of
6666+Affirmer's Copyright and Related Rights and associated claims and causes
6767+of action, whether now known or unknown (including existing as well as
6868+future claims and causes of action), in the Work (i) in all territories
6969+worldwide, (ii) for the maximum duration provided by applicable law or
7070+treaty (including future time extensions), (iii) in any current or future
7171+medium and for any number of copies, and (iv) for any purpose whatsoever,
7272+including without limitation commercial, advertising or promotional
7373+purposes (the "Waiver"). Affirmer makes the Waiver for the benefit of each
7474+member of the public at large and to the detriment of Affirmer's heirs and
7575+successors, fully intending that such Waiver shall not be subject to
7676+revocation, rescission, cancellation, termination, or any other legal or
7777+equitable action to disrupt the quiet enjoyment of the Work by the public
7878+as contemplated by Affirmer's express Statement of Purpose.
7979+8080+3. Public License Fallback. Should any part of the Waiver for any reason
8181+be judged legally invalid or ineffective under applicable law, then the
8282+Waiver shall be preserved to the maximum extent permitted taking into
8383+account Affirmer's express Statement of Purpose. In addition, to the
8484+extent the Waiver is so judged Affirmer hereby grants to each affected
8585+person a royalty-free, non transferable, non sublicensable, non exclusive,
8686+irrevocable and unconditional license to exercise Affirmer's Copyright and
8787+Related Rights in the Work (i) in all territories worldwide, (ii) for the
8888+maximum duration provided by applicable law or treaty (including future
8989+time extensions), (iii) in any current or future medium and for any number
9090+of copies, and (iv) for any purpose whatsoever, including without
9191+limitation commercial, advertising or promotional purposes (the
9292+"License"). The License shall be deemed effective as of the date CC0 was
9393+applied by Affirmer to the Work. Should any part of the License for any
9494+reason be judged legally invalid or ineffective under applicable law, such
9595+partial invalidity or ineffectiveness shall not invalidate the remainder
9696+of the License, and in such case Affirmer hereby affirms that he or she
9797+will not (i) exercise any of his or her remaining Copyright and Related
9898+Rights in the Work or (ii) assert any associated claims and causes of
9999+action with respect to the Work, in either case contrary to Affirmer's
100100+express Statement of Purpose.
101101+102102+4. Limitations and Disclaimers.
103103+104104+ a. No trademark or patent rights held by Affirmer are waived, abandoned,
105105+ surrendered, licensed or otherwise affected by this document.
106106+ b. Affirmer offers the Work as-is and makes no representations or
107107+ warranties of any kind concerning the Work, express, implied,
108108+ statutory or otherwise, including without limitation warranties of
109109+ title, merchantability, fitness for a particular purpose, non
110110+ infringement, or the absence of latent or other defects, accuracy, or
111111+ the present or absence of errors, whether or not discoverable, all to
112112+ the greatest extent permissible under applicable law.
113113+ c. Affirmer disclaims responsibility for clearing rights of other persons
114114+ that may apply to the Work or any use thereof, including without
115115+ limitation any person's Copyright and Related Rights in the Work.
116116+ Further, Affirmer disclaims responsibility for obtaining any necessary
117117+ consents, permissions or other rights required for any use of the
118118+ Work.
119119+ d. Affirmer understands and acknowledges that Creative Commons is not a
120120+ party to this document and has no duty or obligation with respect to
121121+ this CC0 or use of the Work.
+28
ModTemplate.sln
···11+
22+Microsoft Visual Studio Solution File, Format Version 12.00
33+# Visual Studio Version 17
44+VisualStudioVersion = 17.0.31903.59
55+MinimumVisualStudioVersion = 10.0.40219.1
66+Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "CakeBuild", "CakeBuild\CakeBuild.csproj", "{BC68EDF6-C294-4819-B7F4-9EA99B73E69D}"
77+EndProject
88+Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "ModTemplate", "ModTemplate\ModTemplate.csproj", "{CB2100BC-F653-402A-9FBA-EA463C2BD4FC}"
99+EndProject
1010+Global
1111+ GlobalSection(SolutionConfigurationPlatforms) = preSolution
1212+ Debug|Any CPU = Debug|Any CPU
1313+ Release|Any CPU = Release|Any CPU
1414+ EndGlobalSection
1515+ GlobalSection(SolutionProperties) = preSolution
1616+ HideSolutionNode = FALSE
1717+ EndGlobalSection
1818+ GlobalSection(ProjectConfigurationPlatforms) = postSolution
1919+ {BC68EDF6-C294-4819-B7F4-9EA99B73E69D}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
2020+ {BC68EDF6-C294-4819-B7F4-9EA99B73E69D}.Debug|Any CPU.Build.0 = Debug|Any CPU
2121+ {BC68EDF6-C294-4819-B7F4-9EA99B73E69D}.Release|Any CPU.ActiveCfg = Release|Any CPU
2222+ {BC68EDF6-C294-4819-B7F4-9EA99B73E69D}.Release|Any CPU.Build.0 = Release|Any CPU
2323+ {CB2100BC-F653-402A-9FBA-EA463C2BD4FC}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
2424+ {CB2100BC-F653-402A-9FBA-EA463C2BD4FC}.Debug|Any CPU.Build.0 = Debug|Any CPU
2525+ {CB2100BC-F653-402A-9FBA-EA463C2BD4FC}.Release|Any CPU.ActiveCfg = Release|Any CPU
2626+ {CB2100BC-F653-402A-9FBA-EA463C2BD4FC}.Release|Any CPU.Build.0 = Release|Any CPU
2727+ EndGlobalSection
2828+EndGlobal
···11+# Vintage Story Mod Template
22+33+This repository contains a configured .NET 7 mod for Visual Studio, Visual Studio Code and Rider that let's you start Vintage Story and add your own code to it. Supports logging and as well as debugging.
44+55+66+77+## Usage
88+- Get a copy of this template by either using the "Use this Template" on github or cloning it or downloading a .zip file.
99+- Open the Project with your preferred IDE
1010+- Run the template
1111+1212+1313+The template uses the Cake build system to produce a mod ready to release for you.
1414+You can create a release with one of the following methods:
1515+- In Visual Studio and Rider Select to run the CakeBuilder Project.
1616+- In Visual Studio Code click on "Terminal" > "Run Task" > "package"
1717+- run the build.ps1 or build.sh
1818+1919+This will then produce the `mymodid_1.0.0.zip` inside the `Release` folder in the project root folder.
2020+2121+2222+## Linux / Mac
2323+This sample is preconfigured for Windows if you want to use it on Linux or Mac you need to change the path for the Vintage Story (Server) binaries since those are now platform dependent with .NET 7.
2424+2525+### Rider
2626+If you use Rider on Linux or Mac you will need to change in
2727+`modtemplate/Properties/launchSettings.json`
2828+```
2929+"executablePath": "$(VINTAGE_STORY)/Vintagestory.exe",
3030+"executablePath": "$(VINTAGE_STORY)/VintagestoryServer.exe",
3131+```
3232+to
3333+```
3434+"executablePath": "$(VINTAGE_STORY)/Vintagestory",
3535+"executablePath": "$(VINTAGE_STORY)/VintagestoryServer",
3636+```
3737+3838+## Info General
3939+4040+Since version 1.18.8-rc1 Vintage Story uses .NET 7 as its base framework. This means from now on mods can be targeted towards it and make use of the latest C# 11 language features.
4141+4242+Further the new way of creating mods uses a [dotnet template package](https://www.nuget.org/packages/VintageStory.Mod.Templates/).
4343+4444+This basically allows you to create a mod directly from Visual Studio, Rider or the command line (`dotnet new vsmod`) for more details how to use it see our [wiki page](https://wiki.vintagestory.at/index.php/Modding:Setting_up_your_Development_Environment).
4545+4646+It supports options so you can easily add what ever dependency you may need in you next modding project.
4747+4848+The new template also just houses a single mod by default (you can still manually add more if wanted). We think it is better to have the mods separated in their own repositories and Solutions.
4949+5050+Further with the new template package and the cake build system there is not much need for the `vsmodtools` tool hopefully, which means less code to be maintained by us.
5151+5252+We are also now supporting Visual Studio, Visual Studio Code and Rider with the new SDK style project and templates.
5353+5454+## Cake build system
5555+5656+The new template also comes with the cake build system https://cakebuild.net/ found in the file [CakeBuild/Program.cs](CakeBuild/Program.cs).
5757+It is also used in the games repo to build the game for each platform (Windows x64, Linux x64, MacOs x64) and eventually Arm x64 as well at some point.
5858+5959+But that is not all cake can do for us.
6060+Since we use the `Cake Frosting` setup which essentially adds another Project to our solution where we can write C# code to define our build and package procedure. Further we added a Json Validation step to it so before a build is made it will verify that all json files are at least parsable by `Newtonsoft.Json` to avoid simple mistakes. And if you want to use any Testing library you can also add it to the Cake build system to run your test when you create a mod.zip for release.
6161+6262+6363+## Migrating Mods to .NET 7
6464+6565+To migrate your mod to .NET 7 we would recommend you to create a new project with our new template (checkout our updated [wiki page](https://wiki.vintagestory.at/index.php/Modding:Setting_up_your_Development_Environment) for that) and copy over your old code. Additionally you may need to add any special references you need for your mod.
6666+6767+Then you may have to make some code changes so your mod works with the .NET 7 version of the game. For most mods this should be just minor changes.
6868+6969+Once that is done it should be ready to be started within you preferred IDE. So you can also benefit from new C# 11 language features as well as the cake build system.
7070+
+2
build.ps1
···11+dotnet run --project CakeBuild/CakeBuild.csproj -- $args
22+exit $LASTEXITCODE;
+1
build.sh
···11+dotnet run --project ./CakeBuild/CakeBuild.csproj -- "$@"