Skip to content
This repository was archived by the owner on Nov 7, 2023. It is now read-only.

Commit 5229f34

Browse files
committed
fix (dependencies): compatibility to recent TShock & OTAPI builds
1 parent 905525e commit 5229f34

File tree

4 files changed

+8
-8
lines changed

4 files changed

+8
-8
lines changed

Implementation/ChestManager.cs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -349,11 +349,11 @@ public IChest PlaceChest(ushort tileType, int style, DPoint placeLocation) {
349349
if (tileType == TileID.Containers2)
350350
storageType = 4;
351351

352-
TSPlayer.All.SendData(PacketTypes.TileKill, string.Empty, storageType, placeLocation.X, placeLocation.Y, style, chestIndex);
352+
TSPlayer.All.SendData(PacketTypes.PlaceChest, string.Empty, storageType, placeLocation.X, placeLocation.Y, style, chestIndex);
353353
// The client will always show open / close animations for the latest chest index. But when there are multiple chests with id 999
354354
// this will look awkard, so instead tell the client about another 999 chest on a location where the animation will never be noticed by the player.
355355
if (chestIndex == ChestManager.DummyChestIndex)
356-
TSPlayer.All.SendData(PacketTypes.TileKill, string.Empty, storageType, 0, 0, style, chestIndex);
356+
TSPlayer.All.SendData(PacketTypes.PlaceChest, string.Empty, storageType, 0, 0, style, chestIndex);
357357

358358
return chest;
359359
}
@@ -445,7 +445,7 @@ public void DestroyChest(IChest chest) {
445445
}
446446

447447
WorldGen.KillTile(chest.Location.X, chest.Location.Y);
448-
TSPlayer.All.SendData(PacketTypes.TileKill, string.Empty, 1, chest.Location.X, chest.Location.Y, 0, chestIndex);
448+
TSPlayer.All.SendData(PacketTypes.PlaceChest, string.Empty, 1, chest.Location.X, chest.Location.Y, 0, chestIndex);
449449
}
450450
}
451451

Implementation/ProtectionManager.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -259,7 +259,7 @@ public ProtectionEntry CreateProtection(
259259
if (checkIfBlockTypeProtectableByConfig && !this.Config.ManuallyProtectableTiles[tile.type])
260260
throw new InvalidBlockTypeException(blockType);
261261

262-
if (checkTShockBuildAndRegionAccess && TShock.CheckTilePermission(player, tileLocation.X, tileLocation.Y))
262+
if (checkTShockBuildAndRegionAccess && !player.HasBuildPermission(tileLocation.X, tileLocation.Y))
263263
throw new TileProtectedException(tileLocation);
264264

265265
if (

Implementation/ProtectorPlugin.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -340,7 +340,7 @@ private void TShock_PlayerSpawn(object sender, GetDataHandlers.SpawnEventArgs e)
340340
if (this.isDisposed || !this.hooksEnabled || e.Handled)
341341
return;
342342

343-
TSPlayer player = TShock.Players[e.Player];
343+
TSPlayer player = e.Player;
344344
if (player == null || !player.IsLoggedIn)
345345
return;
346346

Implementation/UserInteractionHandler.cs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1168,7 +1168,7 @@ private void ShareGroupCommand_Exec(CommandArgs args) {
11681168
groupName = args.ParamsToSingleString();
11691169
}
11701170

1171-
if (TShock.Utils.GetGroup(groupName) == null) {
1171+
if (TShock.Groups.GetGroupByName(groupName) == null) {
11721172
args.Player.SendErrorMessage($"The group \"{groupName}\" does not exist.");
11731173

11741174
return;
@@ -3568,7 +3568,7 @@ public bool TrySwapChestData(TSPlayer player, DPoint anyChestTileLocation, out I
35683568
//TSPlayer.All.SendData(PacketTypes.ChestName, string.Empty, chest.Index, chestLocation.X, chestLocation.Y);
35693569

35703570
// Tell the client to remove the chest with the given index from its own chest array.
3571-
TSPlayer.All.SendData(PacketTypes.TileKill, string.Empty, 1, chestLocation.X, chestLocation.Y, 0, chest.Index);
3571+
TSPlayer.All.SendData(PacketTypes.PlaceChest, string.Empty, 1, chestLocation.X, chestLocation.Y, 0, chest.Index);
35723572
TSPlayer.All.SendTileSquare(chestLocation.X, chestLocation.Y, 2);
35733573
player?.SendWarningMessage("This chest is now a Protector chest.");
35743574
}
@@ -3928,7 +3928,7 @@ private void DestroyBlockOrObject(DPoint tileLocation) {
39283928
this.ChestManager.DestroyChest(tileLocation);
39293929
} else {
39303930
WorldGen.KillTile(tileLocation.X, tileLocation.Y, false, false, true);
3931-
TSPlayer.All.SendData(PacketTypes.TileKill, string.Empty, 0, tileLocation.X, tileLocation.Y, 0, -1);
3931+
TSPlayer.All.SendData(PacketTypes.PlaceChest, string.Empty, 0, tileLocation.X, tileLocation.Y, 0, -1);
39323932
}
39333933
}
39343934

0 commit comments

Comments
 (0)