Init
This commit is contained in:
parent
cb3ff0c2ce
commit
62d35533a0
2 changed files with 11 additions and 13 deletions
|
|
@ -13,6 +13,7 @@ This is the rolling changelog for TShock for Terraria. Use past tense when addin
|
||||||
* If there is no section called "Upcoming changes" below this line, please add one with `## Upcoming changes` as the first line, and then a bulleted item directly after with the first change.
|
* If there is no section called "Upcoming changes" below this line, please add one with `## Upcoming changes` as the first line, and then a bulleted item directly after with the first change.
|
||||||
|
|
||||||
## Upcoming changes
|
## Upcoming changes
|
||||||
|
* Fixed painting wall/tile being rejected from hand of creation. (@Rozen4334)
|
||||||
* Reduced load/save console spam. (@SignatureBeef, @YehnBeep)
|
* Reduced load/save console spam. (@SignatureBeef, @YehnBeep)
|
||||||
* Replaced SQLite library with Microsoft.Data.Sqlite for arm64 support. (@SignatureBeef)
|
* Replaced SQLite library with Microsoft.Data.Sqlite for arm64 support. (@SignatureBeef)
|
||||||
* Initial support for MonoMod hooks on Raspberry Pi (arm64). (@kevzhao2)
|
* Initial support for MonoMod hooks on Raspberry Pi (arm64). (@kevzhao2)
|
||||||
|
|
|
||||||
|
|
@ -3583,6 +3583,12 @@ namespace TShockAPI
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private static bool HasPaintSprayerAbilities(Item item)
|
||||||
|
=> item is not null && item.stack > 0 && (
|
||||||
|
item.type == ItemID.PaintSprayer ||
|
||||||
|
item.type == ItemID.ArchitectGizmoPack ||
|
||||||
|
item.type == ItemID.HandOfCreation);
|
||||||
|
|
||||||
private static bool HandlePaintTile(GetDataHandlerArgs args)
|
private static bool HandlePaintTile(GetDataHandlerArgs args)
|
||||||
{
|
{
|
||||||
var x = args.Data.ReadInt16();
|
var x = args.Data.ReadInt16();
|
||||||
|
|
@ -3594,15 +3600,6 @@ namespace TShockAPI
|
||||||
TShock.Log.ConsoleDebug("GetDataHandlers / HandlePaintTile rejected range check {0}", args.Player.Name);
|
TShock.Log.ConsoleDebug("GetDataHandlers / HandlePaintTile rejected range check {0}", args.Player.Name);
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
if (OnPaintTile(args.Player, args.Data, x, y, t))
|
|
||||||
{
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
|
|
||||||
bool hasPaintSprayerAbilities(Item item) =>
|
|
||||||
item != null
|
|
||||||
&& item.stack > 0
|
|
||||||
&& (item.type == ItemID.PaintSprayer || item.type == ItemID.ArchitectGizmoPack);
|
|
||||||
|
|
||||||
// Not selecting paintbrush or paint scraper or the spectre versions? Hacking.
|
// Not selecting paintbrush or paint scraper or the spectre versions? Hacking.
|
||||||
if (args.Player.SelectedItem.type != ItemID.PaintRoller &&
|
if (args.Player.SelectedItem.type != ItemID.PaintRoller &&
|
||||||
|
|
@ -3611,8 +3608,8 @@ namespace TShockAPI
|
||||||
args.Player.SelectedItem.type != ItemID.SpectrePaintRoller &&
|
args.Player.SelectedItem.type != ItemID.SpectrePaintRoller &&
|
||||||
args.Player.SelectedItem.type != ItemID.SpectrePaintScraper &&
|
args.Player.SelectedItem.type != ItemID.SpectrePaintScraper &&
|
||||||
args.Player.SelectedItem.type != ItemID.SpectrePaintbrush &&
|
args.Player.SelectedItem.type != ItemID.SpectrePaintbrush &&
|
||||||
!args.Player.Accessories.Any(hasPaintSprayerAbilities) &&
|
!args.Player.Accessories.Any(HasPaintSprayerAbilities) &&
|
||||||
!args.Player.Inventory.Any(hasPaintSprayerAbilities))
|
!args.Player.Inventory.Any(HasPaintSprayerAbilities))
|
||||||
{
|
{
|
||||||
TShock.Log.ConsoleDebug("GetDataHandlers / HandlePaintTile rejected select consistency {0}", args.Player.Name);
|
TShock.Log.ConsoleDebug("GetDataHandlers / HandlePaintTile rejected select consistency {0}", args.Player.Name);
|
||||||
args.Player.SendData(PacketTypes.PaintTile, "", x, y, Main.tile[x, y].color());
|
args.Player.SendData(PacketTypes.PaintTile, "", x, y, Main.tile[x, y].color());
|
||||||
|
|
@ -3658,8 +3655,8 @@ namespace TShockAPI
|
||||||
args.Player.SelectedItem.type != ItemID.SpectrePaintRoller &&
|
args.Player.SelectedItem.type != ItemID.SpectrePaintRoller &&
|
||||||
args.Player.SelectedItem.type != ItemID.SpectrePaintScraper &&
|
args.Player.SelectedItem.type != ItemID.SpectrePaintScraper &&
|
||||||
args.Player.SelectedItem.type != ItemID.SpectrePaintbrush &&
|
args.Player.SelectedItem.type != ItemID.SpectrePaintbrush &&
|
||||||
!args.Player.Accessories.Any(i => i != null && i.stack > 0 &&
|
!args.Player.Accessories.Any(HasPaintSprayerAbilities) &&
|
||||||
(i.type == ItemID.PaintSprayer || i.type == ItemID.ArchitectGizmoPack)))
|
!args.Player.Inventory.Any(HasPaintSprayerAbilities))
|
||||||
{
|
{
|
||||||
TShock.Log.ConsoleDebug("GetDataHandlers / HandlePaintWall rejected selector consistency {0}", args.Player.Name);
|
TShock.Log.ConsoleDebug("GetDataHandlers / HandlePaintWall rejected selector consistency {0}", args.Player.Name);
|
||||||
args.Player.SendData(PacketTypes.PaintWall, "", x, y, Main.tile[x, y].wallColor());
|
args.Player.SendData(PacketTypes.PaintWall, "", x, y, Main.tile[x, y].wallColor());
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue