diff --git a/Items/Placeables/GreedPot.cs b/Items/Placeables/GreedPot.cs index 0ad723196e..582e5f67ed 100644 --- a/Items/Placeables/GreedPot.cs +++ b/Items/Placeables/GreedPot.cs @@ -1,10 +1,7 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; -using CalamityMod.Tiles; +using Terraria; +using Terraria.ID; using Terraria.ModLoader; +using CalamityMod.Tiles; namespace CalamityMod.Items.Placeables { @@ -12,7 +9,11 @@ namespace CalamityMod.Items.Placeables { public new string LocalizationCategory => "Items.Placeables"; - public override void SetDefaults() => Item.DefaultToPlaceableTile(ModContent.TileType()); - + public override void SetDefaults() + { + Item.DefaultToPlaceableTile(ModContent.TileType()); + Item.rare = ItemRarityID.Pink; + Item.value = Item.buyPrice(gold: 5); + } } } diff --git a/Tiles/GreedPotTile.cs b/Tiles/GreedPotTile.cs index 59e4550dea..8a58ad248d 100644 --- a/Tiles/GreedPotTile.cs +++ b/Tiles/GreedPotTile.cs @@ -2,9 +2,6 @@ using System.Collections.Generic; using System.IO; using System.Linq; -using System.Net; -using System.Text; -using System.Threading.Tasks; using CalamityMod.DataStructures; using CalamityMod.Items.Placeables.Ores; using CalamityMod.Particles; @@ -75,10 +72,16 @@ namespace CalamityMod.Tiles { Tile tile = Main.tile[x, y]; + if (!tile.HasTile || tile.TileType != ModContent.TileType()) + return false; + int style = 0, alt = 0; TileObjectData.GetTileInfo(tile, ref style, ref alt); TileObjectData data = TileObjectData.GetTileData(tile.TileType, style, alt); + if (data == null) + return false; + int sheetSquare = 16 + data.CoordinatePadding; int FrameX = tile.TileFrameX / sheetSquare % data.Width; int FrameY = tile.TileFrameY / sheetSquare % data.Height;