diff --git a/Items/Placeables/Furniture/VoidTorch.cs b/Items/Placeables/Furniture/VoidTorch.cs index 8f1d5467ba..e759ca8304 100644 --- a/Items/Placeables/Furniture/VoidTorch.cs +++ b/Items/Placeables/Furniture/VoidTorch.cs @@ -7,6 +7,7 @@ using Terraria.ModLoader; namespace CalamityMod.Items.Placeables.Furniture { + [LegacyName("AbyssTorch")] public class VoidTorch : ModItem, ILocalizedModType { public new string LocalizationCategory => "Items.Placeables"; diff --git a/Tiles/CalamityGlobalTile.cs b/Tiles/CalamityGlobalTile.cs index cee684049a..4b21d53067 100644 --- a/Tiles/CalamityGlobalTile.cs +++ b/Tiles/CalamityGlobalTile.cs @@ -305,7 +305,7 @@ namespace CalamityMod.Tiles // Drop Evil Smasher on every 12 alter smashed if (WorldGen.altarCount > 1 && WorldGen.altarCount % 12 == 0) - DropItem(i, j, ItemType(), quantity: 1, asStack: true); + DropItem(i, j, ItemType(), quantity: 1, asStack: true, prefix: true); } // Drop Golden Bombs at a 0.33% chance from Pots @@ -356,7 +356,7 @@ namespace CalamityMod.Tiles } } - private static void DropItem(int i, int j, int itemType, int quantity, bool asStack, Vector2 spreadMinMax = default) + private static void DropItem(int i, int j, int itemType, int quantity, bool asStack, Vector2 spreadMinMax = default, bool prefix = false) { // Multiplayer Client should not spawn item themselves if (Main.netMode == NetmodeID.MultiplayerClient) @@ -366,14 +366,14 @@ namespace CalamityMod.Tiles if (asStack) { Vector2 spawnOffset = Main.rand.NextVector2Unit(spreadMinMax.X, spreadMinMax.Y); - Item.NewItem(new EntitySource_TileBreak(i, j), worldPos + spawnOffset, itemType, Stack: quantity); + Item.NewItem(new EntitySource_TileBreak(i, j), worldPos + spawnOffset, itemType, Stack: quantity, prefixGiven: prefix ? -1 : 0); } else { for (int k = 0; k < quantity; k += 1) { Vector2 spawnOffset = Main.rand.NextVector2Unit(spreadMinMax.X, spreadMinMax.Y); - Item.NewItem(new EntitySource_TileBreak(i, j), worldPos + spawnOffset, itemType, Stack: 1); + Item.NewItem(new EntitySource_TileBreak(i, j), worldPos + spawnOffset, itemType, Stack: 1, prefixGiven: prefix ? -1 : 0); } } } diff --git a/World/Abyss.cs b/World/Abyss.cs index 84775f63b8..6c51e76870 100644 --- a/World/Abyss.cs +++ b/World/Abyss.cs @@ -1119,6 +1119,7 @@ namespace CalamityMod.World if (ChestIndex != -1) { Main.chest[ChestIndex].item[0].SetDefaults(itemChoice); + Main.chest[ChestIndex].item[0].Prefix(-1); Main.chest[ChestIndex].item[1].SetDefaults(WorldGen.genRand.Next(Potions1)); Main.chest[ChestIndex].item[1].stack = WorldGen.genRand.Next(1, 3); diff --git a/World/CustomUnderworld.cs b/World/CustomUnderworld.cs index 60b43a5528..3271f7e3f4 100644 --- a/World/CustomUnderworld.cs +++ b/World/CustomUnderworld.cs @@ -2185,6 +2185,7 @@ namespace CalamityMod.World for (int i = 0; i < contents.Count; i++) { chest.item[i].SetDefaults(contents[i].Type); + chest.item[i].Prefix(-1); chest.item[i].stack = contents[i].Stack; } } @@ -2215,6 +2216,7 @@ namespace CalamityMod.World for (int i = 0; i < contents.Count; i++) { chest.item[i].SetDefaults(contents[i].Type); + chest.item[i].Prefix(-1); chest.item[i].stack = contents[i].Stack; } } diff --git a/World/DraedonStructures.cs b/World/DraedonStructures.cs index 566ee2b8f0..411b8181db 100644 --- a/World/DraedonStructures.cs +++ b/World/DraedonStructures.cs @@ -246,6 +246,7 @@ namespace CalamityMod.World for (int i = 0; i < contents.Count; i++) { chest.item[i].SetDefaults(contents[i].Type); + chest.item[i].Prefix(-1); chest.item[i].stack = contents[i].Stack; } } diff --git a/World/DungeonArchive.cs b/World/DungeonArchive.cs index 51487e5f4c..ff39d10636 100644 --- a/World/DungeonArchive.cs +++ b/World/DungeonArchive.cs @@ -135,6 +135,7 @@ namespace CalamityMod.World else { chest.item[i].SetDefaults(contents2[i].Type); + chest.item[i].Prefix(-1); chest.item[i].stack = contents2[i].Stack; } } diff --git a/World/GiantHive.cs b/World/GiantHive.cs index 7845fa730c..03fadea3de 100644 --- a/World/GiantHive.cs +++ b/World/GiantHive.cs @@ -831,12 +831,13 @@ namespace CalamityMod.World int index = 0; - chest.item[index++].SetDefaults(random.Next(FocusLootHoney)); + chest.item[index].SetDefaults(random.Next(FocusLootHoney)); + chest.item[index++].Prefix(-1); if (random.Next(3) <= 1) { chest.item[index].SetDefaults(random.Next(BarLootHoney)); - chest.item[index].SetDefaults(random.Next(7, 15)); + chest.item[index++].stack = random.Next(7, 15); } else { diff --git a/World/MechanicShed.cs b/World/MechanicShed.cs index 172e2fb573..5af166de3c 100644 --- a/World/MechanicShed.cs +++ b/World/MechanicShed.cs @@ -130,6 +130,7 @@ namespace CalamityMod.World for (int i = 0; i < contents.Count; i++) { chest.item[i].SetDefaults(contents[i].Type); + chest.item[i].Prefix(-1); chest.item[i].stack = contents[i].Stack; } } diff --git a/World/MiscWorldgenRoutines.cs b/World/MiscWorldgenRoutines.cs index 474cf6d647..6b92ec1073 100644 --- a/World/MiscWorldgenRoutines.cs +++ b/World/MiscWorldgenRoutines.cs @@ -63,6 +63,7 @@ namespace CalamityMod.World return; c.item[itemIndex].SetDefaults(id, false); + c.item[itemIndex].Prefix(-1); // Don't set quantity unless quantity is specified if (minQuantity > 0) diff --git a/World/Planets/MudPlanet.cs b/World/Planets/MudPlanet.cs index 97113e4681..0ce47166f8 100644 --- a/World/Planets/MudPlanet.cs +++ b/World/Planets/MudPlanet.cs @@ -222,13 +222,14 @@ namespace CalamityMod.World.Planets int index = 0; //Focus loot - chest.item[index++].SetDefaults(_random.Next(FocusLoot)); + chest.item[index].SetDefaults(_random.Next(FocusLoot)); + chest.item[index++].Prefix(-1); //Bars if (_random.Next(3) <= 1) { chest.item[index].SetDefaults(_random.Next(BarLoot)); - chest.item[index].SetDefaults(_random.Next(7, 15)); + chest.item[index++].stack = _random.Next(7, 15); } else { diff --git a/World/UndergroundShrines.cs b/World/UndergroundShrines.cs index d1379f1d3c..199fd4b84a 100644 --- a/World/UndergroundShrines.cs +++ b/World/UndergroundShrines.cs @@ -272,6 +272,7 @@ namespace CalamityMod.World for (int i = 0; i < contents.Count; i++) { chest.item[i].SetDefaults(contents[i].Type); + chest.item[i].Prefix(-1); chest.item[i].stack = contents[i].Stack; } } @@ -341,6 +342,7 @@ namespace CalamityMod.World for (int i = 0; i < contents.Count; i++) { chest.item[i].SetDefaults(contents[i].Type); + chest.item[i].Prefix(-1); chest.item[i].stack = contents[i].Stack; } } @@ -534,6 +536,7 @@ namespace CalamityMod.World for (int i = 0; i < contents.Count; i++) { chest.item[i].SetDefaults(contents[i].Type); + chest.item[i].Prefix(-1); chest.item[i].stack = contents[i].Stack; } } @@ -670,6 +673,7 @@ namespace CalamityMod.World for (int i = 0; i < contents.Count; i++) { chest.item[i].SetDefaults(contents[i].Type); + chest.item[i].Prefix(-1); chest.item[i].stack = contents[i].Stack; } } @@ -761,6 +765,7 @@ namespace CalamityMod.World for (int i = 0; i < contents.Count; i++) { chest.item[i].SetDefaults(contents[i].Type); + chest.item[i].Prefix(-1); chest.item[i].stack = contents[i].Stack; } } diff --git a/World/VernalPass.cs b/World/VernalPass.cs index cea45e5153..4d3d7d3f94 100644 --- a/World/VernalPass.cs +++ b/World/VernalPass.cs @@ -86,6 +86,7 @@ namespace CalamityMod.World for (int i = 0; i < contents.Count; i++) { chest.item[i].SetDefaults(contents[i].Type); + chest.item[i].Prefix(-1); chest.item[i].stack = contents[i].Stack; } }