Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

添加插件:定位传送;修复:自动垃圾桶、自动钓鱼BUG;重构并更新:禁止脏话v3.1 #577

Merged
merged 7 commits into from
Nov 22, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 10 additions & 0 deletions Plugin.sln
Original file line number Diff line number Diff line change
Expand Up @@ -252,6 +252,8 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "CaiPacketDebug", "src\CaiPa
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "ItemDecoration", "src\ItemDecoration\ItemDecoration.csproj", "{C4A6D861-D53D-447E-9948-A23A797E2C1C}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "DwTP", "src\DwTP\DwTP.csproj", "{2003D2E7-0A1C-4557-A0EE-F4E06B766B78}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
Expand Down Expand Up @@ -1236,6 +1238,14 @@ Global
{C4A6D861-D53D-447E-9948-A23A797E2C1C}.Release|Any CPU.Build.0 = Release|Any CPU
{C4A6D861-D53D-447E-9948-A23A797E2C1C}.Release|x64.ActiveCfg = Release|Any CPU
{C4A6D861-D53D-447E-9948-A23A797E2C1C}.Release|x64.Build.0 = Release|Any CPU
{2003D2E7-0A1C-4557-A0EE-F4E06B766B78}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{2003D2E7-0A1C-4557-A0EE-F4E06B766B78}.Debug|Any CPU.Build.0 = Debug|Any CPU
{2003D2E7-0A1C-4557-A0EE-F4E06B766B78}.Debug|x64.ActiveCfg = Debug|Any CPU
{2003D2E7-0A1C-4557-A0EE-F4E06B766B78}.Debug|x64.Build.0 = Debug|Any CPU
{2003D2E7-0A1C-4557-A0EE-F4E06B766B78}.Release|Any CPU.ActiveCfg = Release|Any CPU
{2003D2E7-0A1C-4557-A0EE-F4E06B766B78}.Release|Any CPU.Build.0 = Release|Any CPU
{2003D2E7-0A1C-4557-A0EE-F4E06B766B78}.Release|x64.ActiveCfg = Release|Any CPU
{2003D2E7-0A1C-4557-A0EE-F4E06B766B78}.Release|x64.Build.0 = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
Expand Down
3 changes: 2 additions & 1 deletion README_EN.md
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,8 @@
| [DeathDrop](src/DeathDrop/README.md) | No | Random and custom loot upon monster death | None |
| [DisableMonsLoot](src/DisableMonsLoot/README.md) | No | Prohibit monster loot | None |
| [DisableSurfaceProjectiles](src/DisableSurfaceProjectiles/README.md) | No | Prohibit surface projectiles | None |
| [Don't Fuck](src/DonotFuck/README.md) | No | Prevent swearing | None |
| [Don't Fuck](src/DonotFuck/README.md) | Yes | Prevent swearing | None |
| [DwTP](src/DwTP/README.md) | Yes | Positioning Teleport | None |
| [DTEntryBlock](src/DTEntryBlock/README.md) | No | Prevent entry into dungeons or temples | None |
| [DumpTerrariaID](src/DumpTerrariaID/README.md) | No | Dump Terraria IDs | None |
| [Economics.Deal](src/Economics.RPG/README_EN.md) | Yes | Trading plugin | [EconomicsAPI](src/EconomicsAPI/README_EN.md) |
Expand Down
4 changes: 2 additions & 2 deletions src/AutoAirItem/AutoAirItem.cs
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ public class AutoAirItem : TerrariaPlugin
#region 插件信息
public override string Name => "自动垃圾桶";
public override string Author => "羽学";
public override Version Version => new Version(1, 1, 6);
public override Version Version => new Version(1, 1, 7);
public override string Description => "涡轮增压不蒸鸭";
#endregion

Expand Down Expand Up @@ -170,7 +170,7 @@ public static void UpDict(Dictionary<int, int> delItem, int type, int stack)
else
{
// 直接添加新ID和它的数量
delItem.Add(type, stack);
delItem.Add(type, 0);
}
}
#endregion
Expand Down
14 changes: 3 additions & 11 deletions src/AutoAirItem/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,9 @@

## 更新日志
```
v1.1.7
修复PE使用:/air del 会返还双倍物品的BUG

v1.1.6
加入了/air ck 数量指令
筛选出物品超过此数量的玩家
Expand Down Expand Up @@ -85,17 +88,6 @@ v1.0.0
| /airreset | /重置垃圾桶| AutoAir.admin | 清空玩家数据表(重置服务器用) |
| /reload | 无 | tshock.cfg.reload | 重载配置文件 |

---
注意事项
---
1.`如何给玩家添加权限`请使用该指令在控制台发送: `/group addperm default AutoAir.use`

2.`垃圾桶开关`与`垃圾桶物品`和均由玩家游戏内指令触发!

3.`玩家数据表`由玩家加入服务器后`自动写入`

4.`监听垃圾桶`使用指令`/air auto`开启,当垃圾桶位格放入物品时自动添加垃圾桶表内

## 配置
> 配置文件位置:tshock/自动垃圾桶.json
```json
Expand Down
90 changes: 62 additions & 28 deletions src/AutoAirItem/README_EN.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,66 @@
- It automatically creates the configuration structure when a player joins the server.
- A fully automated plugin that interacts with players through commands.

## Update Log
```
v1.1.7
- Fixed the bug where using `/air del` would return double the items on Mobile Games

v1.1.6
- Added the `/air ck <amount>` command to filter out players with more than the specified amount of items
- Fixed the bug where returned items exceeded the stack limit

v1.1.5
- Changed the removal logic to trigger on player movement (performance optimization)
- Removed the `/air sd` command to modify cleanup speed
- Added the item return logic to the `/air del` command

v1.1.4
- Removed the automatic player data cleanup logic and related configuration options
- Changed the `/air reset` command to:
- A separate `/airreset` command for easier loop reset of the server

v1.1.3
- Improved the command menu
- Added the `/air sd` command to modify garbage cleanup speed
- Added the `/air reset` command to clear all player data (used to reset the server)
- The `/air mess` command can control the hiding of item addition notifications to the trash bin

v1.1.2
- Fixed the null reference when a player leaves the server
- Moved the data cleanup function to the join server event

v1.1.1
- Fixed English translation (open-source version)

v1.1.0
- Moved the data table content from Config to the internal MyData class to avoid frequent writes to the configuration file, which could cause issues with a large number of players
- Automatically enabled the trash bin feature on first login, with a command prompt when items are placed in the trash bin
- Added online status checks to prevent innocent data cleanup due to 24-hour play sessions
- Added offline announcements when cleaning specific player data

v1.0.2
- Added the `/air yes` command to add held items to the trash bin
- Items will only be cleaned if not selected; even if the wrong input is entered, `/air del <item name>` can be used to remove them
- Added the `/air mess` command to enable/disable cleanup messages
- Added a listener for the trash bin slot to automatically add items to the `Trash Bin Table` when they are placed in the trash bin

v1.0.1
- Removed the plugin activation status notification on every `/air add` or `/air del`
- Added the "Data Cleanup Cycle" logic:
- The "Record Time" is updated every time a player logs in or out
- If the offline time of Player A and the login time of Player B differ by more than the set "Cleanup Cycle" time, Player A's data will be automatically cleaned
- Setting the "Data Cleanup Cycle" to over 9999999999 hours effectively means never cleaning data

v1.0.0
- Implemented an automatic trash bin for Tshock based on the idea from the Mod "Better Experience"
- The garbage cleanup speed unit is frames per second; the smaller the value, the faster the cleanup
- Use the `/air on` command to enable the plugin
- Use `/air add <item name>` or `<item id>` or `Alt + Left Click` to select an item, which will automatically write the item name to the configuration file
- Automatically creates a "Player Data Table" based on player login events
- The "Trash Bin Items" will trigger the cleanup logic if they exist and the "Trash Bin Switch" is enabled
- Equipped with "Login Time" for server owners to reference whether they need to manually remove a player's data
```

## Commands

Expand All @@ -21,39 +81,13 @@
| /air mess | /垃圾 mess | AutoAir.use | Enable or disable cleanup messages |
| /air add or del id | /垃圾 add or del 物品名 | AutoAir.use | Add or remove items from personal trash can list |


---
Notes
---

1. To give players permission, use this command in the console: `/group addperm default AutoAir.use`.

2. The "Trash Bin Toggle" and "Trash Bin Items" are both triggered by in-game player commands!

3. The "Player Data Table" is automatically updated when a player joins the server. If a player with the same name exists, their "record time" will be updated (it will also update once when they are offline).

4. The unit for "Trash Cleanup Speed" is the frame rate. The smaller the value, the "faster" the cleanup speed.

5. "Data Cleanup Cycle": If Player A logs out at 00:00 and Player B logs in at 00:10, with a "cleanup cycle of 10 hours," if Player A does not log back in by 10:10, Player A's auto-trash data will be cleared "when Player B logs off."

6. If the "Data Cleanup Cycle" is set to more than "9999999999 hours," it is equivalent to never clearing the data.

7. To "Monitor Trash Bin," use the command `/air auto` to enable auto-monitoring. Items placed in the trash bin slot will automatically be added to the trash bin table.

## Config
> Configuration file location:tshock/自动垃圾桶.json
```json
{
"插件指令权限": "指令菜单:/air 或 /垃圾,权限名【AutoAir.use】,给玩家权限:/group addperm default AutoAir.use", // Command permissions for the plugin, allowing players to use /air or /trash commands with the AutoAir.use permission
"使用说明": "玩家每次进出服都会更新【记录时间】,玩家A离线时间与玩家B登录时间相差超过【清理周期】所设定的时间,则自动清理该玩家A的数据", // Description of how the plugin works: player record time is updated on join/leave, and data is cleared if the time between Player A logging out and Player B logging in exceeds the set cleanup cycle
"插件开关": true, // Toggle to enable or disable the plugin
"清理垃圾速度": 60, // Speed of trash cleanup, lower values mean faster cleanup
"广告开关": true, // Toggle to enable or disable advertisements
"广告内容": "[i:3456][C/F2F2C7:插件开发] [C/BFDFEA:by] [c/00FFFF:羽学][i:3459]", // Content of the advertisement message
"是否清理数据": true, // Whether or not to clean up player data
"清理数据周期/小时": 24 // The data cleanup cycle in hours
"Plugin Command Permissions": "Command menu: /air or /trash, permission name [AutoAir.use], give players permission: /group addperm default AutoAir.use",
"Plugin Enable": true
}

```
## FeedBack
- Github Issue -> TShockPlugin Repo: https://github.com/UnrealMultiple/TShockPlugin
Expand Down
18 changes: 10 additions & 8 deletions src/AutoFish/AutoFish.cs
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ public class AutoFish : TerrariaPlugin
#region 插件信息
public override string Name => "自动钓鱼";
public override string Author => "羽学 少司命";
public override Version Version => new Version(1, 3, 1);
public override Version Version => new Version(1, 3, 2);
public override string Description => "涡轮增压不蒸鸭";
#endregion

Expand Down Expand Up @@ -162,18 +162,20 @@ private static void ControlFishing(ProjectileAiUpdateEventArgs args, TSPlayer pl
if (inv.bait > 0 && baitTypeUsed == inv.type)
{
//当物品数量正常则开始进入钓鱼检查
if (inv.stack > 0)
if (inv.stack > 1)
{
//当前物品数量为1则移除(避免选中的饵不会主动消失 变成无限饵 或 卡住线程)
if (plr.TPlayer.inventory[i].stack == 1)
{
inv.TurnToAir();
}

//发包到对应饵料的格子内
plr.SendData(PacketTypes.PlayerSlot, "", plr.Index, i);
break;
}

//当前物品数量为1则移除(避免选中的饵不会主动消失 变成无限饵 或 卡住线程)
if (inv.stack == 1 || inv.bait == 1)
{
inv.TurnToAir();
plr.SendData(PacketTypes.PlayerSlot, "", plr.Index, i);
break;
}
}
}
}
Expand Down
3 changes: 3 additions & 0 deletions src/AutoFish/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,9 @@
## 更新日志

```
v1.3.2
尝试修复鱼饵数量为1时崩服BUG

v1.3.1
修复了在多钩钓鱼模式下,单体召唤物衍生更多数量BUG
并加了一个配置项来禁止它们"禁止衍生弹幕"。
Expand Down
8 changes: 8 additions & 0 deletions src/AutoFish/README_EN.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,14 @@
## Update Log

```
v1.3.2
- Attempted to fix the server crash bug that occurred when the bait quantity was 1.

v1.3.1
- Fixed the bug where in multi-hook fishing mode, individual summons would spawn additional quantities.
- Added a configuration option to disable "spawned bullet hell" from these summons.
- Introduced a random item configuration option; when enabled, players can randomly catch any item while fishing.

v1.3.0
Fixed: Preferred bait would not disappear, turning it into infinite bait or causing thread locking bugs.
Modified: Extra catches can now be hooked along with existing environmental items.
Expand Down
102 changes: 0 additions & 102 deletions src/DonotFuck/Ban.cs

This file was deleted.

Loading
Loading