Skip to content

How to Submit a New Plugin

肝帝熙恩 edited this page Jan 10, 2025 · 11 revisions

How to Submit a New Plugin

Step 1: Fork the Repository

  • Fork the repository on GitHub to your account. image

Step 2: Clone the Repository Locally

  • Clone the forked repository to your local machine. For example, you can use the built-in Git tools in Visual Studio (VS) to perform the clone operation. image image image

Step 3: Add Your Plugin

  1. Navigate to the src directory. This is where plugin source code resides. image
  2. Create a new folder for your plugin:
    • The folder name must match your plugin's name and project name. If they differ, modify them to be the same.
    • Ensure the name is in English. image
  3. Copy your code files and the .csproj file into this new folder. image

Step 4: Add the Plugin to the Solution

  1. In Visual Studio, right-click the solution and select Add > Existing Project. image
  2. Select the .csproj file in your plugin folder and click Open. image

Step 5: Edit the Project File

  1. Right-click your project and select Edit Project File. image
  2. Add the following content to your project file:
    <Project Sdk="Microsoft.NET.Sdk">
    
        <Import Project="..\..\template.targets" />
    
    </Project>

image

  1. Save the file.
    • Note: This step is required only if your plugin has no dependencies other than TShock.

Step 6: Add Readme and Manifest Files

  1. Add a README file for your plugin:

    • For Chinese content, name it README.md.
    • For English, name it README.en-US.md.
    • For Spanish, name it README.es-ES.md. Note that it should be en-US, not en_US.
    Language File Name Example
    Deutsch de-DE
    English (PT) en-PT
    Español es-ES
    Français (FR) fr-FR
    Français (QC) fr-QC
    Bahasa Indonesia id-ID
    Italiano it-IT
    日本語 ja-JP
    Polski pl-PL
    Português (BR) pt-BR
    Português (PT) pt-PT
    Русский (RU) ru-RU
    Русский (UA) ru-UA
    Tokipona tok
    Türkçe tr-TR
    English (US) en-US
    • Ensure the formatting follows existing examples for consistency. image
  2. Add a manifest.json file. Here’s an example:

{
  "README.en-US": {
    "Description": "World Reversal and Placing Mines Anywhere"
  },
  "README.es-ES": {
    "Description": "Inversión del Mundo y Colocación de Minas en Cualquier Lugar"
  },
  "README": {
    "Description": "世界反转和全图放置地雷插件"
  }
}

image

  • Minimum requirement: Include both Chinese and English descriptions.

Step 7: Code Guidelines

  • Use the following format for your plugin version:
    public override Version Version => new Version();

image

  • When updating your plugin:
    • Document update notes in the README.
    • Update the version number.
  • Avoid using Chinese characters in variable names.
  • Do not use dangerous features or backdoors.
  • Minimize the use of multithreading.
  • Consider using LazyAPI for improved functionality (refer to another guide).
  • For internationalization (i18n):
    • Use LazyAPI to support i18n for configuration files.
    • Refer to a separate guide for details.

Step 8: Stage and Commit Your Changes

  1. In Visual Studio, click Git > Commit or Stash. image
  2. Add your changes by clicking the "+" button.
  3. Write a commit message summarizing your updates. image
  4. Push or synchronize your changes to your forked repository. image

Step 9: Go back to the homepage

You'll find that you have additional content compared to the source repository.
Go back
pr

Step 10: PR Submission Guide

PR Type Reference Table

Title Applicable Labels Description
Plugin/Feature Feat, Add, feature, feat, add For adding new plugins or features.
Bug Fix fix, Fix, 修复 For fixing bugs.
Documentation README, 文档 For documentation updates.
Update update, Update, 更新 For general updates.
Workflow Workflow, Action, 工作流 For workflow-related updates.

Example Usage

  • If you are submitting a documentation update, use the title README and select a corresponding label, such as README or 文档.
  • Refer to the table above to choose the correct title and label based on your submission type.

image