From b387d42e5342eb2c3eda941a40f0a2ec922b0677 Mon Sep 17 00:00:00 2001 From: Lucas Nicodemus Date: Sun, 16 Jul 2017 21:21:42 -0600 Subject: [PATCH 1/4] Add PR template file --- PULL_REQUEST_TEMPLATE.md | 1 + 1 file changed, 1 insertion(+) create mode 100644 PULL_REQUEST_TEMPLATE.md diff --git a/PULL_REQUEST_TEMPLATE.md b/PULL_REQUEST_TEMPLATE.md new file mode 100644 index 00000000..9e7b1cc8 --- /dev/null +++ b/PULL_REQUEST_TEMPLATE.md @@ -0,0 +1 @@ + From 5a04b6651427dca02018effe87ab4ae208cf48fe Mon Sep 17 00:00:00 2001 From: ProfessorXZ Date: Fri, 8 Sep 2017 21:59:13 +0200 Subject: [PATCH 2/4] Make Utils.GetBuffDescription actually return the buff's description & properly read 'buffTime' from the stream. Fixes #1469 --- TShockAPI/GetDataHandlers.cs | 8 ++++---- TShockAPI/Utils.cs | 2 +- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/TShockAPI/GetDataHandlers.cs b/TShockAPI/GetDataHandlers.cs index 77e37c03..b593af2c 100644 --- a/TShockAPI/GetDataHandlers.cs +++ b/TShockAPI/GetDataHandlers.cs @@ -895,14 +895,14 @@ namespace TShockAPI /// /// Time the buff lasts /// - public short Time { get; set; } + public int Time { get; set; } } /// /// PlayerBuff - Called when a player is buffed /// public static HandlerList PlayerBuff; - private static bool OnPlayerBuff(byte id, byte type, short time) + private static bool OnPlayerBuff(byte id, byte type, int time) { if (PlayerBuff == null) return false; @@ -911,7 +911,7 @@ namespace TShockAPI { ID = id, Type = type, - Time = time, + Time = time }; PlayerBuff.Invoke(null, args); return args.Handled; @@ -3425,7 +3425,7 @@ namespace TShockAPI { var id = args.Data.ReadInt8(); var type = args.Data.ReadInt8(); - var time = args.Data.ReadInt16(); + var time = args.Data.ReadInt32(); if (OnPlayerBuff(id, type, time)) return true; diff --git a/TShockAPI/Utils.cs b/TShockAPI/Utils.cs index 520bed9c..5081f8e4 100644 --- a/TShockAPI/Utils.cs +++ b/TShockAPI/Utils.cs @@ -465,7 +465,7 @@ namespace TShockAPI /// description public string GetBuffDescription(int id) { - return (id > 0 && id < Main.maxBuffTypes) ? Lang.GetBuffName(id) : "null"; + return (id > 0 && id < Main.maxBuffTypes) ? Lang.GetBuffDescription(id) : "null"; } /// From c8549db08726122a5ea1cc62946fc1fe3249d625 Mon Sep 17 00:00:00 2001 From: koneko-nyan <31385587+koneko-nyan@users.noreply.github.com> Date: Tue, 19 Sep 2017 21:00:15 +0200 Subject: [PATCH 3/4] Update Commands.cs (time % 1.0) * 60.0 can be equal to 59.8, then it gets rounded to undesirable 60 displayed in the time format --- TShockAPI/Commands.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/TShockAPI/Commands.cs b/TShockAPI/Commands.cs index 5e7b84bf..fbc6c061 100644 --- a/TShockAPI/Commands.cs +++ b/TShockAPI/Commands.cs @@ -3872,7 +3872,7 @@ namespace TShockAPI if (!Main.dayTime) time += 15.0; time = time % 24.0; - args.Player.SendInfoMessage("The current time is {0}:{1:D2}.", (int)Math.Floor(time), (int)Math.Round((time % 1.0) * 60.0)); + args.Player.SendInfoMessage("The current time is {0}:{1:D2}.", (int)Math.Floor(time), (int)Math.Floor((time % 1.0) * 60.0)); return; } From 65582ceaecb4be28acecf88059a4bc4798e38bbd Mon Sep 17 00:00:00 2001 From: koneko-nyan <31385587+koneko-nyan@users.noreply.github.com> Date: Tue, 19 Sep 2017 21:22:56 +0200 Subject: [PATCH 4/4] Update CHANGELOG.md --- CHANGELOG.md | 1 + 1 file changed, 1 insertion(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index d7ab5308..efa71d54 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -9,6 +9,7 @@ This is the rolling changelog for TShock for Terraria. Use past tense when addin * Fixed /spawnmob not spawning negative IDs (@MarioE) * Validated tile placement on PlaceObject; clients can no longer place frames, paintings etc with dirt blocks (@bartico6, @ProfessorXZ) * Updated to new stat tracking system with more data so we can actually make informed software decisions (Jordan Coulam) +* Fixed /time display at the end of Terraria hours (@koneko-nyan) ## TShock 4.3.24 * API: Changed `PlayerHooks` permission hook mechanisms to allow negation from hooks (@deadsurgeon42)