diff --git a/TShockAPI/GetDataHandlers.cs b/TShockAPI/GetDataHandlers.cs index b0685fe1..6e06df18 100755 --- a/TShockAPI/GetDataHandlers.cs +++ b/TShockAPI/GetDataHandlers.cs @@ -1742,7 +1742,14 @@ namespace TShockAPI KillTileNoItem, PlaceWire, KillWire, - PoundTile + PoundTile, + PlaceActuator, + KillActuator, + PlaceWire2, + KillWire2, + PlaceWire3, + KillWire3, + SlopeTile } public enum EditType { @@ -1927,19 +1934,38 @@ namespace TShockAPI } } } - else if (action == EditAction.PlaceWire) + else if (action == EditAction.PlaceWire || action == EditAction.PlaceWire2 || action == EditAction.PlaceWire3) { - // If they aren't selecting the wrench, they're hacking. - if (args.TPlayer.inventory[args.TPlayer.selectedItem].type != 509) + // If they aren't selecting a wrench, they're hacking. + if (selectedItem.type != 509 && selectedItem.type != 850 && selectedItem.type != 851) { args.Player.SendTileSquare(tileX, tileY, 1); return true; } } - else if (action == EditAction.KillWire) + else if (action == EditAction.KillActuator || action == EditAction.KillWire || + action == EditAction.KillWire2 || action == EditAction.KillWire3) { // If they aren't selecting the wire cutter, they're hacking. - if (args.TPlayer.inventory[args.TPlayer.selectedItem].type != 510) + if (selectedItem.type != 510) + { + args.Player.SendTileSquare(tileX, tileY, 1); + return true; + } + } + else if (action == EditAction.PlaceActuator) + { + // If they aren't selecting the actuator, they're hacking. + if (selectedItem.type != 849) + { + args.Player.SendTileSquare(tileX, tileY, 1); + return true; + } + } + else if (action == EditAction.PoundTile || action == EditAction.SlopeTile) + { + // If they aren't selecting a hammer, they're hacking. + if (selectedItem.hammer == 0) { args.Player.SendTileSquare(tileX, tileY, 1); return true; diff --git a/TShockAPI/TShock.cs b/TShockAPI/TShock.cs index 9b8dbfc7..b47e5825 100755 --- a/TShockAPI/TShock.cs +++ b/TShockAPI/TShock.cs @@ -596,7 +596,6 @@ namespace TShockAPI Lighting.lightMode = 2; ComputeMaxStyles(); - FixChestStacks(); StatTracker = new StatTracker(); } @@ -607,13 +606,16 @@ namespace TShockAPI for (int i = 0; i < Main.maxItemTypes; i++) { item.netDefaults(i); - if (GetDataHandlers.MaxPlaceStyles.ContainsKey(item.createTile)) + if (item.placeStyle > 0) { - if (item.placeStyle > GetDataHandlers.MaxPlaceStyles[item.createTile]) - GetDataHandlers.MaxPlaceStyles[item.createTile] = item.placeStyle; + if (GetDataHandlers.MaxPlaceStyles.ContainsKey(item.createTile)) + { + if (item.placeStyle > GetDataHandlers.MaxPlaceStyles[item.createTile]) + GetDataHandlers.MaxPlaceStyles[item.createTile] = item.placeStyle; + } + else + GetDataHandlers.MaxPlaceStyles.Add(item.createTile, item.placeStyle); } - else - GetDataHandlers.MaxPlaceStyles.Add(item.createTile, item.placeStyle); } } private void FixChestStacks()