diff --git a/CalamityMod.cs b/CalamityMod.cs index 7ec5082d2b..5a8ed39838 100644 --- a/CalamityMod.cs +++ b/CalamityMod.cs @@ -84,7 +84,7 @@ namespace CalamityMod { public class CalamityMod : Mod { - // TODO -- I have been advised by Jopo that Mods should never contain static variables + // CONSIDER -- I have been advised by Jopo that Mods should never contain static variables // Hotkeys public static ModHotKey NormalityRelocatorHotKey; @@ -204,6 +204,8 @@ namespace CalamityMod BossHealthBarManager.Load(this); + TileFraming.Load(); + Config.Load(); SetupLists(); @@ -349,6 +351,8 @@ namespace CalamityMod BossHealthBarManager.Unload(); base.Unload(); + TileFraming.Unload(); + AstralArcanumUI.Unload(); base.Unload(); diff --git a/Tiles/Abyss/AbyssGravel.cs b/Tiles/Abyss/AbyssGravel.cs index 5116120202..1d9026137e 100644 --- a/Tiles/Abyss/AbyssGravel.cs +++ b/Tiles/Abyss/AbyssGravel.cs @@ -14,8 +14,8 @@ namespace CalamityMod.Tiles.Abyss Main.tileBlockLight[Type] = true; Main.tileMergeDirt[Type] = true; - TileMerge.MergeGeneralTiles(Type); - TileMerge.MergeAbyssTiles(Type); + CalamityUtils.MergeWithGeneral(Type); + CalamityUtils.MergeWithAbyss(Type); drop = ModContent.ItemType(); AddMapEntry(new Color(0, 0, 0)); @@ -37,7 +37,7 @@ namespace CalamityMod.Tiles.Abyss public override bool TileFrame(int i, int j, ref bool resetFrame, ref bool noBreak) { - CustomTileFraming.FrameTileForCustomMergeFrom(i, j, Type, TileID.Dirt); + TileFraming.CustomMergeFrame(i, j, Type, TileID.Dirt); return false; } } diff --git a/Tiles/Abyss/PlantyMush.cs b/Tiles/Abyss/PlantyMush.cs index ef0935465a..3790232a14 100644 --- a/Tiles/Abyss/PlantyMush.cs +++ b/Tiles/Abyss/PlantyMush.cs @@ -14,8 +14,8 @@ namespace CalamityMod.Tiles.Abyss Main.tileMergeDirt[Type] = true; Main.tileBlockLight[Type] = true; - TileMerge.MergeGeneralTiles(Type); - TileMerge.MergeAbyssTiles(Type); + CalamityUtils.MergeWithGeneral(Type); + CalamityUtils.MergeWithAbyss(Type); dustType = 2; drop = ModContent.ItemType(); @@ -88,7 +88,7 @@ namespace CalamityMod.Tiles.Abyss public override bool TileFrame(int i, int j, ref bool resetFrame, ref bool noBreak) { - CustomTileFraming.FrameTileForCustomMerge(i, j, Type, ModContent.TileType(), false, false, false, false, resetFrame); + TileFraming.CustomMergeFrame(i, j, Type, ModContent.TileType(), false, false, false, false, resetFrame); return false; } } diff --git a/Tiles/Abyss/SulphurousSand.cs b/Tiles/Abyss/SulphurousSand.cs index 8f32820263..5a3da8edc7 100644 --- a/Tiles/Abyss/SulphurousSand.cs +++ b/Tiles/Abyss/SulphurousSand.cs @@ -15,8 +15,8 @@ namespace CalamityMod.Tiles.Abyss Main.tileMergeDirt[Type] = true; Main.tileBlockLight[Type] = true; - TileMerge.MergeGeneralTiles(Type); - TileMerge.MergeAbyssTiles(Type); + CalamityUtils.MergeWithGeneral(Type); + CalamityUtils.MergeWithAbyss(Type); dustType = 32; drop = ModContent.ItemType(); @@ -189,7 +189,7 @@ namespace CalamityMod.Tiles.Abyss public override bool TileFrame(int i, int j, ref bool resetFrame, ref bool noBreak) { - CustomTileFraming.FrameTileForCustomMerge(i, j, Type, ModContent.TileType(), false, false, false, false, resetFrame); + TileFraming.CustomMergeFrame(i, j, Type, ModContent.TileType(), false, false, false, false, resetFrame); return false; } } diff --git a/Tiles/Abyss/Tenebris.cs b/Tiles/Abyss/Tenebris.cs index aac7f768a4..d6a9075cee 100644 --- a/Tiles/Abyss/Tenebris.cs +++ b/Tiles/Abyss/Tenebris.cs @@ -15,8 +15,8 @@ namespace CalamityMod.Tiles.Abyss Main.tileMergeDirt[Type] = true; Main.tileBlockLight[Type] = true; - TileMerge.MergeGeneralTiles(Type); - TileMerge.MergeAbyssTiles(Type); + CalamityUtils.MergeWithGeneral(Type); + CalamityUtils.MergeWithAbyss(Type); dustType = 44; drop = ModContent.ItemType(); @@ -91,7 +91,7 @@ namespace CalamityMod.Tiles.Abyss public override bool TileFrame(int i, int j, ref bool resetFrame, ref bool noBreak) { - CustomTileFraming.FrameTileForCustomMerge(i, j, Type, ModContent.TileType(), false, false, false, false, resetFrame); + TileFraming.CustomMergeFrame(i, j, Type, ModContent.TileType(), false, false, false, false, resetFrame); return false; } } diff --git a/Tiles/Abyss/Voidstone.cs b/Tiles/Abyss/Voidstone.cs index 2fb46a569c..04aee3d2d2 100644 --- a/Tiles/Abyss/Voidstone.cs +++ b/Tiles/Abyss/Voidstone.cs @@ -15,8 +15,8 @@ namespace CalamityMod.Tiles.Abyss Main.tileBlockLight[Type] = true; Main.tileBrick[Type] = true; - TileMerge.MergeGeneralTiles(Type); - TileMerge.MergeAbyssTiles(Type); + CalamityUtils.MergeWithGeneral(Type); + CalamityUtils.MergeWithAbyss(Type); TileID.Sets.ChecksForMerge[Type] = true; soundType = 21; @@ -234,7 +234,7 @@ namespace CalamityMod.Tiles.Abyss public override bool TileFrame(int i, int j, ref bool resetFrame, ref bool noBreak) { - CustomTileFraming.FrameTileForCustomMerge(i, j, Type, ModContent.TileType(), false, false, false, false, resetFrame); + TileFraming.CustomMergeFrame(i, j, Type, ModContent.TileType(), false, false, false, false, resetFrame); return false; } diff --git a/Tiles/AerialiteBrick.cs b/Tiles/AerialiteBrick.cs index e91c36d415..80d7855dfe 100644 --- a/Tiles/AerialiteBrick.cs +++ b/Tiles/AerialiteBrick.cs @@ -18,7 +18,7 @@ namespace CalamityMod.Tiles public override bool TileFrame(int i, int j, ref bool resetFrame, ref bool noBreak) { - return CustomTileFraming.BetterGemsparkFraming(i, j, resetFrame); + return TileFraming.BetterGemsparkFraming(i, j, resetFrame); } public override bool CreateDust(int i, int j, ref int type) diff --git a/Tiles/Astral/AstralChestLocked.cs b/Tiles/Astral/AstralChestLocked.cs index e0d4acda49..7bf35851d0 100644 --- a/Tiles/Astral/AstralChestLocked.cs +++ b/Tiles/Astral/AstralChestLocked.cs @@ -12,7 +12,7 @@ namespace CalamityMod.Tiles.Astral { public override void SetDefaults() { - CalamityUtils.SetUpChest(Type); + this.SetUpChest(); ModTranslation name = CreateMapEntryName(); name.SetDefault("Astral Chest"); AddMapEntry(new Color(174, 129, 92), name, MapChestName); diff --git a/Tiles/Astral/AstralClay.cs b/Tiles/Astral/AstralClay.cs index ffa55478b2..f96309ea44 100644 --- a/Tiles/Astral/AstralClay.cs +++ b/Tiles/Astral/AstralClay.cs @@ -14,9 +14,9 @@ namespace CalamityMod.Tiles.Astral Main.tileSolid[Type] = true; Main.tileBlockLight[Type] = true; - TileMerge.MergeGeneralTiles(Type); - TileMerge.MergeAstralTiles(Type); - TileMerge.MergeOreTiles(Type); + CalamityUtils.MergeWithGeneral(Type); + CalamityUtils.MergeAstralTiles(Type); + CalamityUtils.MergeWithOres(Type); dustType = ModContent.DustType(); drop = ModContent.ItemType(); @@ -29,7 +29,7 @@ namespace CalamityMod.Tiles.Astral public override bool TileFrame(int i, int j, ref bool resetFrame, ref bool noBreak) { - CustomTileFraming.FrameTileForCustomMerge(i, j, Type, ModContent.TileType()); + TileFraming.CustomMergeFrame(i, j, Type, ModContent.TileType()); return false; } diff --git a/Tiles/Astral/AstralDirt.cs b/Tiles/Astral/AstralDirt.cs index 879e9ea2f0..84eac815ac 100644 --- a/Tiles/Astral/AstralDirt.cs +++ b/Tiles/Astral/AstralDirt.cs @@ -14,13 +14,13 @@ namespace CalamityMod.Tiles.Astral Main.tileSolid[Type] = true; Main.tileBlockLight[Type] = true; - TileMerge.MergeGeneralTiles(Type); - TileMerge.MergeAstralTiles(Type); - TileMerge.MergeOreTiles(Type); - TileMerge.MergeTile(Type, TileID.Grass); - TileMerge.MergeTile(Type, TileID.CorruptGrass); - TileMerge.MergeTile(Type, TileID.HallowedGrass); - TileMerge.MergeTile(Type, TileID.FleshGrass); + CalamityUtils.MergeWithGeneral(Type); + CalamityUtils.MergeAstralTiles(Type); + CalamityUtils.MergeWithOres(Type); + CalamityUtils.SetMerge(Type, TileID.Grass); + CalamityUtils.SetMerge(Type, TileID.CorruptGrass); + CalamityUtils.SetMerge(Type, TileID.HallowedGrass); + CalamityUtils.SetMerge(Type, TileID.FleshGrass); dustType = ModContent.DustType(); drop = ModContent.ItemType(); @@ -33,7 +33,7 @@ namespace CalamityMod.Tiles.Astral public override bool TileFrame(int i, int j, ref bool resetFrame, ref bool noBreak) { - CustomTileFraming.FrameTileForCustomMergeFrom(i, j, Type, TileID.Dirt); + TileFraming.CustomMergeFrame(i, j, Type, TileID.Dirt); return false; } diff --git a/Tiles/Astral/AstralGrass.cs b/Tiles/Astral/AstralGrass.cs index 3e541ccdb9..a5669e8cc4 100644 --- a/Tiles/Astral/AstralGrass.cs +++ b/Tiles/Astral/AstralGrass.cs @@ -16,11 +16,11 @@ namespace CalamityMod.Tiles.Astral Main.tileBlockLight[Type] = true; Main.tileBrick[Type] = true; - TileMerge.MergeTile(Type, ModContent.TileType()); - TileMerge.MergeTile(Type, TileID.Grass); - TileMerge.MergeTile(Type, TileID.CorruptGrass); - TileMerge.MergeTile(Type, TileID.HallowedGrass); - TileMerge.MergeTile(Type, TileID.FleshGrass); + CalamityUtils.SetMerge(Type, ModContent.TileType()); + CalamityUtils.SetMerge(Type, TileID.Grass); + CalamityUtils.SetMerge(Type, TileID.CorruptGrass); + CalamityUtils.SetMerge(Type, TileID.HallowedGrass); + CalamityUtils.SetMerge(Type, TileID.FleshGrass); dustType = ModContent.DustType(); drop = ModContent.ItemType(); diff --git a/Tiles/Astral/AstralMonolith.cs b/Tiles/Astral/AstralMonolith.cs index f966681f87..d545c6d9ef 100644 --- a/Tiles/Astral/AstralMonolith.cs +++ b/Tiles/Astral/AstralMonolith.cs @@ -15,12 +15,12 @@ namespace CalamityMod.Tiles.Astral Main.tileSolid[Type] = true; Main.tileBlockLight[Type] = true; - TileMerge.MergeGeneralTiles(Type); - TileMerge.MergeAstralTiles(Type); - TileMerge.MergeTile(Type, TileID.LeafBlock); - TileMerge.MergeTile(Type, TileID.LivingMahoganyLeaves); - TileMerge.MergeTile(Type, TileID.LivingWood); - TileMerge.MergeTile(Type, TileID.LivingMahogany); + CalamityUtils.MergeWithGeneral(Type); + CalamityUtils.MergeAstralTiles(Type); + CalamityUtils.SetMerge(Type, TileID.LeafBlock); + CalamityUtils.SetMerge(Type, TileID.LivingMahoganyLeaves); + CalamityUtils.SetMerge(Type, TileID.LivingWood); + CalamityUtils.SetMerge(Type, TileID.LivingMahogany); drop = ModContent.ItemType(); AddMapEntry(new Color(45, 36, 63)); @@ -71,7 +71,7 @@ namespace CalamityMod.Tiles.Astral public override bool TileFrame(int i, int j, ref bool resetFrame, ref bool noBreak) { - CustomTileFraming.FrameTileForCustomMerge(i, j, Type, ModContent.TileType(), false, false, false, false, resetFrame); + TileFraming.CustomMergeFrame(i, j, Type, ModContent.TileType(), false, false, false, false, resetFrame); return false; } diff --git a/Tiles/Astral/AstralSilt.cs b/Tiles/Astral/AstralSilt.cs index b319bda69b..2c8daae3a7 100644 --- a/Tiles/Astral/AstralSilt.cs +++ b/Tiles/Astral/AstralSilt.cs @@ -14,9 +14,9 @@ namespace CalamityMod.Tiles.Astral Main.tileSolid[Type] = true; Main.tileBlockLight[Type] = true; - TileMerge.MergeGeneralTiles(Type); - TileMerge.MergeAstralTiles(Type); - TileMerge.MergeOreTiles(Type); + CalamityUtils.MergeWithGeneral(Type); + CalamityUtils.MergeAstralTiles(Type); + CalamityUtils.MergeWithOres(Type); dustType = ModContent.DustType(); drop = ModContent.ItemType(); @@ -38,7 +38,7 @@ namespace CalamityMod.Tiles.Astral public override bool TileFrame(int i, int j, ref bool resetFrame, ref bool noBreak) { - CustomTileFraming.FrameTileForCustomMerge(i, j, Type, ModContent.TileType()); + TileFraming.CustomMergeFrame(i, j, Type, ModContent.TileType()); return false; } diff --git a/Tiles/Astral/AstralStone.cs b/Tiles/Astral/AstralStone.cs index f97efae691..b37d924ccd 100644 --- a/Tiles/Astral/AstralStone.cs +++ b/Tiles/Astral/AstralStone.cs @@ -15,9 +15,9 @@ namespace CalamityMod.Tiles.Astral Main.tileBlockLight[Type] = true; Main.tileBrick[Type] = true; - TileMerge.MergeGeneralTiles(Type); - TileMerge.MergeAstralTiles(Type); - TileMerge.MergeOreTiles(Type); + CalamityUtils.MergeWithGeneral(Type); + CalamityUtils.MergeAstralTiles(Type); + CalamityUtils.MergeWithOres(Type); dustType = ModContent.DustType(); drop = ModContent.ItemType(); @@ -33,7 +33,7 @@ namespace CalamityMod.Tiles.Astral public override bool TileFrame(int i, int j, ref bool resetFrame, ref bool noBreak) { - CustomTileFraming.FrameTileForCustomMerge(i, j, Type, ModContent.TileType()); + TileFraming.CustomMergeFrame(i, j, Type, ModContent.TileType()); return false; } diff --git a/Tiles/AstralBrick.cs b/Tiles/AstralBrick.cs index b8787c954e..bb34563cd8 100644 --- a/Tiles/AstralBrick.cs +++ b/Tiles/AstralBrick.cs @@ -30,7 +30,7 @@ namespace CalamityMod.Tiles public override bool TileFrame(int i, int j, ref bool resetFrame, ref bool noBreak) { - return CustomTileFraming.BetterGemsparkFraming(i, j, resetFrame); + return TileFraming.BetterGemsparkFraming(i, j, resetFrame); } public override void AnimateIndividualTile(int type, int i, int j, ref int frameXOffset, ref int frameYOffset) diff --git a/Tiles/AstralDesert/AstralFossil.cs b/Tiles/AstralDesert/AstralFossil.cs index 3d0f5626d0..4f27a702b4 100644 --- a/Tiles/AstralDesert/AstralFossil.cs +++ b/Tiles/AstralDesert/AstralFossil.cs @@ -14,9 +14,9 @@ namespace CalamityMod.Tiles.AstralDesert Main.tileSolid[Type] = true; Main.tileBlockLight[Type] = true; - TileMerge.MergeGeneralTiles(Type); - TileMerge.MergeDesertTiles(Type); - TileMerge.MergeAstralTiles(Type); + CalamityUtils.MergeWithGeneral(Type); + CalamityUtils.MergeWithDesert(Type); + CalamityUtils.MergeAstralTiles(Type); dustType = ModContent.DustType(); drop = ModContent.ItemType(); @@ -30,7 +30,7 @@ namespace CalamityMod.Tiles.AstralDesert public override bool TileFrame(int i, int j, ref bool resetFrame, ref bool noBreak) { - CustomTileFraming.FrameTileForCustomMerge(i, j, Type, ModContent.TileType(), false, false, false, false, resetFrame); + TileFraming.CustomMergeFrame(i, j, Type, ModContent.TileType(), false, false, false, false, resetFrame); return false; } diff --git a/Tiles/AstralDesert/AstralSand.cs b/Tiles/AstralDesert/AstralSand.cs index 404ac1dc1c..0dfe3ca83c 100644 --- a/Tiles/AstralDesert/AstralSand.cs +++ b/Tiles/AstralDesert/AstralSand.cs @@ -18,9 +18,9 @@ namespace CalamityMod.Tiles.AstralDesert Main.tileSand[Type] = true; Main.tileBrick[Type] = true; - TileMerge.MergeGeneralTiles(Type); - TileMerge.MergeDesertTiles(Type); - TileMerge.MergeAstralTiles(Type); + CalamityUtils.MergeWithGeneral(Type); + CalamityUtils.MergeWithDesert(Type); + CalamityUtils.MergeAstralTiles(Type); dustType = 108; drop = ModContent.ItemType(); @@ -51,8 +51,8 @@ namespace CalamityMod.Tiles.AstralDesert WorldGen.SquareTileFrame(i, j); return false; } - // CustomTileFraming.FrameTileForCustomMerge(i, j, Type, ModContent.TileType()); - CustomTileFraming.FrameTileForCustomMergeFrom(i, j, Type, ModContent.TileType()); + // CustomTileFraming.CustomMergeFrame(i, j, Type, ModContent.TileType()); + TileFraming.CustomMergeFrame(i, j, Type, ModContent.TileType()); return false; } diff --git a/Tiles/AstralDesert/AstralSandstone.cs b/Tiles/AstralDesert/AstralSandstone.cs index f975a3e14c..f4b527988c 100644 --- a/Tiles/AstralDesert/AstralSandstone.cs +++ b/Tiles/AstralDesert/AstralSandstone.cs @@ -14,9 +14,9 @@ namespace CalamityMod.Tiles.AstralDesert Main.tileSolid[Type] = true; Main.tileBlockLight[Type] = true; - TileMerge.MergeGeneralTiles(Type); - TileMerge.MergeDesertTiles(Type); - TileMerge.MergeAstralTiles(Type); + CalamityUtils.MergeWithGeneral(Type); + CalamityUtils.MergeWithDesert(Type); + CalamityUtils.MergeAstralTiles(Type); dustType = ModContent.DustType(); drop = ModContent.ItemType(); @@ -29,8 +29,8 @@ namespace CalamityMod.Tiles.AstralDesert public override bool TileFrame(int i, int j, ref bool resetFrame, ref bool noBreak) { - // CustomTileFraming.FrameTileForCustomMerge(i, j, Type, ModContent.TileType(), false, false, false, false, resetFrame); - CustomTileFraming.FrameTileForCustomMergeFrom(i, j, Type, ModContent.TileType()); + // CustomTileFraming.CustomMergeFrame(i, j, Type, ModContent.TileType(), false, false, false, false, resetFrame); + TileFraming.CustomMergeFrame(i, j, Type, ModContent.TileType()); return false; } diff --git a/Tiles/AstralDesert/HardenedAstralSand.cs b/Tiles/AstralDesert/HardenedAstralSand.cs index 285fde36bc..adbb8d9dc5 100644 --- a/Tiles/AstralDesert/HardenedAstralSand.cs +++ b/Tiles/AstralDesert/HardenedAstralSand.cs @@ -13,9 +13,9 @@ namespace CalamityMod.Tiles.AstralDesert Main.tileSolid[Type] = true; Main.tileBlockLight[Type] = true; - TileMerge.MergeGeneralTiles(Type); - TileMerge.MergeDesertTiles(Type); - TileMerge.MergeAstralTiles(Type); + CalamityUtils.MergeWithGeneral(Type); + CalamityUtils.MergeWithDesert(Type); + CalamityUtils.MergeAstralTiles(Type); dustType = 108; @@ -29,8 +29,8 @@ namespace CalamityMod.Tiles.AstralDesert public override bool TileFrame(int i, int j, ref bool resetFrame, ref bool noBreak) { - // CustomTileFraming.FrameTileForCustomMerge(i, j, Type, ModContent.TileType(), false, false, false, false, resetFrame); - CustomTileFraming.FrameTileForCustomMergeFrom(i, j, Type, ModContent.TileType()); + // CustomTileFraming.CustomMergeFrame(i, j, Type, ModContent.TileType(), false, false, false, false, resetFrame); + TileFraming.CustomMergeFrame(i, j, Type, ModContent.TileType()); return false; } diff --git a/Tiles/AstralSnow/AstralIce.cs b/Tiles/AstralSnow/AstralIce.cs index e1a335e13c..d840ba687e 100644 --- a/Tiles/AstralSnow/AstralIce.cs +++ b/Tiles/AstralSnow/AstralIce.cs @@ -15,9 +15,9 @@ namespace CalamityMod.Tiles.AstralSnow Main.tileBlockLight[Type] = true; Main.tileBrick[Type] = true; - TileMerge.MergeGeneralTiles(Type); - TileMerge.MergeSnowTiles(Type); - TileMerge.MergeAstralTiles(Type); + CalamityUtils.MergeWithGeneral(Type); + CalamityUtils.MergeWithSnow(Type); + CalamityUtils.MergeAstralTiles(Type); dustType = 173; drop = ModContent.ItemType(); @@ -48,7 +48,7 @@ namespace CalamityMod.Tiles.AstralSnow public override bool TileFrame(int i, int j, ref bool resetFrame, ref bool noBreak) { - CustomTileFraming.FrameTileForCustomMerge(i, j, Type, ModContent.TileType(), false, false, false, false, resetFrame); + TileFraming.CustomMergeFrame(i, j, Type, ModContent.TileType(), false, false, false, false, resetFrame); return false; } } diff --git a/Tiles/AstralSnow/AstralSnow.cs b/Tiles/AstralSnow/AstralSnow.cs index ec950b5379..83c0920d73 100644 --- a/Tiles/AstralSnow/AstralSnow.cs +++ b/Tiles/AstralSnow/AstralSnow.cs @@ -15,9 +15,9 @@ namespace CalamityMod.Tiles.AstralSnow Main.tileBlockLight[Type] = true; Main.tileBrick[Type] = true; - TileMerge.MergeGeneralTiles(Type); - TileMerge.MergeSnowTiles(Type); - TileMerge.MergeAstralTiles(Type); + CalamityUtils.MergeWithGeneral(Type); + CalamityUtils.MergeWithSnow(Type); + CalamityUtils.MergeAstralTiles(Type); dustType = 173; drop = ModContent.ItemType(); @@ -41,8 +41,8 @@ namespace CalamityMod.Tiles.AstralSnow public override bool TileFrame(int i, int j, ref bool resetFrame, ref bool noBreak) { - // CustomTileFraming.FrameTileForCustomMerge(i, j, Type, ModContent.TileType(), false, false, false, false, resetFrame); - CustomTileFraming.FrameTileForCustomMergeFrom(i, j, Type, ModContent.TileType()); + // CustomTileFraming.CustomMergeFrame(i, j, Type, ModContent.TileType(), false, false, false, false, resetFrame); + TileFraming.CustomMergeFrame(i, j, Type, ModContent.TileType()); return false; } diff --git a/Tiles/CalamityGlobalTile.cs b/Tiles/CalamityGlobalTile.cs index 7ad42caefa..287c2cee96 100644 --- a/Tiles/CalamityGlobalTile.cs +++ b/Tiles/CalamityGlobalTile.cs @@ -1,4 +1,3 @@ - using CalamityMod.Items.Potions; using CalamityMod.Tiles.Abyss; using CalamityMod.Tiles.Astral; @@ -26,55 +25,29 @@ namespace CalamityMod.Tiles TileID.HallowedPlants, TileID.HallowedPlants2, TileID.FleshWeeds, - (ushort)ModContent.GetInstance().TileType("AstralShortPlants"), - (ushort)ModContent.GetInstance().TileType("AstralTallPlants") + (ushort)ModContent.TileType(), + (ushort)ModContent.TileType(), }; - public override void SetDefaults() + public override bool PreHitWire(int i, int j, int type) { - if (CalamityMod.chairList != null) - { - foreach (int i in CalamityMod.chairList) - { - AddToArray(ref TileID.Sets.RoomNeeds.CountsAsChair, i); - } - } - if (CalamityMod.doorList != null) - { - foreach (int i in CalamityMod.doorList) - { - AddToArray(ref TileID.Sets.RoomNeeds.CountsAsDoor, i); - } - } - if (CalamityMod.lightList != null) - { - foreach (int i in CalamityMod.lightList) - { - AddToArray(ref TileID.Sets.RoomNeeds.CountsAsTorch, i); - } - } - if (CalamityMod.tableList != null) - { - foreach (int i in CalamityMod.tableList) - { - AddToArray(ref TileID.Sets.RoomNeeds.CountsAsTable, i); - } - } + return !CalamityWorld.bossRushActive; } public override bool TileFrame(int i, int j, int type, ref bool resetFrame, ref bool noBreak) { + // Custom plant framing for (int k = 0; k < PlantTypes.Length; k++) - { - if (PlantTypes[k] == type) + if (type == PlantTypes[k]) { - CustomTileFraming.CheckPlants(i, j); + TileFraming.PlantFrame(i, j); return false; } - } + + // Custom vine framing if (type == TileID.Vines || type == TileID.CrimsonVines || type == TileID.HallowedVines || type == ModContent.TileType()) { - CustomTileFraming.VineFrame(i, j); + TileFraming.VineFrame(i, j); return false; } return base.TileFrame(i, j, type, ref resetFrame, ref noBreak); @@ -82,140 +55,84 @@ namespace CalamityMod.Tiles public override void PostDraw(int i, int j, int type, SpriteBatch spriteBatch) { + // Guaranteed not null at this point Tile tile = Main.tile[i, j]; - if (type == TileID.Cactus) - { - //GRABBING VARIABLES FOR CERTAIN THINGS - Vector2 zero = new Vector2(Main.offScreenRange, Main.offScreenRange); - if (Main.drawToScreen) - zero = Vector2.Zero; - //TESTING STUFF - int frameX = tile.frameX; - int frameY = tile.frameY; - bool astralCactus = false; - if (!Main.canDrawColorTile(i, j)) - { - int xTile = i; - if (frameX == 36) - { - xTile--; - } - if (frameX == 54) - { - xTile++; - } - if (frameX == 108) - { - if (frameY == 18) - { - xTile--; - } - else - { - xTile++; - } - } - int yTile = j; - bool flag = false; - if (Main.tile[xTile, yTile].type == 80 && Main.tile[xTile, yTile].active()) - { - flag = true; - } - while (!Main.tile[xTile, yTile].active() || !Main.tileSolid[(int)Main.tile[xTile, yTile].type] || !flag) - { - if (Main.tile[xTile, yTile].type == 80 && Main.tile[xTile, yTile].active()) - { - flag = true; - } - yTile++; - if (yTile > i + 20) - { - break; - } - } - //CACTUS CHECK - if (Main.tile[xTile, yTile].type == (ushort)ModContent.TileType()) - { - astralCactus = true; - } - } - //Draw Glow - if (astralCactus) - { - spriteBatch.Draw(CalamityMod.AstralCactusGlowTexture, new Vector2((float)(i * 16 - (int)Main.screenPosition.X), (float)(j * 16 - (int)Main.screenPosition.Y)) + zero, new Rectangle((int)frameX, (int)frameY, 16, 18), Color.White * 0.75f, 0f, default, 1f, SpriteEffects.None, 0f); - } + // This function is only for Astral Cactus. If the tile isn't even cactus, forget about it. + if (type != TileID.Cactus) return; - } - } - public override void KillTile(int i, int j, int type, ref bool fail, ref bool effectOnly, ref bool noItem) - { - // TODO -- holy shit THAT IS NOT HOW YOU NULL CHECK OH MY GOD THIS EXPLAINS EVERYTHING - if(Main.tile[i,j] is null) - return; - - if (Main.tile[i, j].type != ModContent.TileType() && Main.tile[i, j].type != ModContent.TileType() && Main.tileSolid[Main.tile[i, j].type]) + Vector2 zero = new Vector2(Main.offScreenRange, Main.offScreenRange); + if (Main.drawToScreen) + zero = Vector2.Zero; + int frameX = tile.frameX; + int frameY = tile.frameY; + + // Search down the cactus to find out whether the block it is planted in is Astral Sand. + bool astralCactus = false; + if (!Main.canDrawColorTile(i, j)) { - if (Main.tile[i + 1, j] != null) + int xTile = i; + if (frameX == 36) // Cactus segment which splits left + xTile--; + if (frameX == 54) // Cactus segment which splits right + xTile++; + if (frameX == 108) // Cactus segment which splits both directions + xTile += (frameY == 18) ? -1 : 1; + + int yTile = j; + bool slidingDownCactus = Main.tile[xTile, yTile] != null && Main.tile[xTile, yTile].type == TileID.Cactus && Main.tile[xTile, yTile].active(); + while (!Main.tile[xTile, yTile].active() || !Main.tileSolid[Main.tile[xTile, yTile].type] || !slidingDownCactus) { - if (Main.tile[i + 1, j].active()) + if (Main.tile[xTile, yTile].type == TileID.Cactus && Main.tile[xTile, yTile].active()) { - if (Main.tile[i + 1, j].type == ModContent.TileType() || (Main.tile[i + 1, j].type == ModContent.TileType() && CalamityWorld.downedDesertScourge)) - { - WorldGen.KillTile(i + 1, j, false, false, false); - if (!Main.tile[i + 1, j].active() && Main.netMode != NetmodeID.SinglePlayer) - { - NetMessage.SendData(17, -1, -1, null, 0, (float)i + 1, (float)j, 0f, 0, 0, 0); - } - } - } - } - if (Main.tile[i - 1, j] != null) - { - if (Main.tile[i - 1, j].active()) - { - if (Main.tile[i - 1, j].type == ModContent.TileType() || (Main.tile[i - 1, j].type == ModContent.TileType() && CalamityWorld.downedDesertScourge)) - { - WorldGen.KillTile(i - 1, j, false, false, false); - if (!Main.tile[i - 1, j].active() && Main.netMode != NetmodeID.SinglePlayer) - { - NetMessage.SendData(17, -1, -1, null, 0, (float)i - 1, (float)j, 0f, 0, 0, 0); - } - } - } - } - if (Main.tile[i, j + 1] != null) - { - if (Main.tile[i, j + 1].active()) - { - if (Main.tile[i, j + 1].type == ModContent.TileType() || (Main.tile[i, j + 1].type == ModContent.TileType() && CalamityWorld.downedDesertScourge)) - { - WorldGen.KillTile(i, j + 1, false, false, false); - if (!Main.tile[i, j + 1].active() && Main.netMode != NetmodeID.SinglePlayer) - { - NetMessage.SendData(17, -1, -1, null, 0, (float)i, (float)j + 1, 0f, 0, 0, 0); - } - } - } - } - if (Main.tile[i, j - 1] != null) - { - if (Main.tile[i, j - 1].active()) - { - if (Main.tile[i, j - 1].type == ModContent.TileType() || (Main.tile[i, j - 1].type == ModContent.TileType() && CalamityWorld.downedDesertScourge)) - { - WorldGen.KillTile(i, j - 1, false, false, false); - if (!Main.tile[i, j - 1].active() && Main.netMode != NetmodeID.SinglePlayer) - { - NetMessage.SendData(17, -1, -1, null, 0, (float)i, (float)j - 1, 0f, 0, 0, 0); - } - } + slidingDownCactus = true; } + yTile++; + // Cacti are assumed to be no more than 20 blocks tall. + if (yTile > i + 20) + break; } + astralCactus = Main.tile[xTile, yTile].type == (ushort)ModContent.TileType(); + } + + // If it is actually astral cactus, then draw its glowmask. + if (astralCactus) + { + spriteBatch.Draw(CalamityMod.AstralCactusGlowTexture, new Vector2((float)(i * 16 - (int)Main.screenPosition.X), (float)(j * 16 - (int)Main.screenPosition.Y)) + zero, new Rectangle((int)frameX, (int)frameY, 16, 18), Color.White * 0.75f, 0f, default, 1f, SpriteEffects.None, 0f); } } + // This function exists only to shatter adjacent Lumenyl or Sea Prism crystals when a neighboring solid tile is destroyed. + public override void KillTile(int i, int j, int type, ref bool fail, ref bool effectOnly, ref bool noItem) + { + Tile tile = Main.tile[i, j]; + if(tile is null) + return; + + // Helper function to shatter crystals attached to neighboring solid tiles. + void CheckShatterCrystal(int xPos, int yPos) + { + Tile t = Main.tile[xPos, yPos]; + if (t != null && t.active() && (t.type == ModContent.TileType() || (t.type == ModContent.TileType() && CalamityWorld.downedDesertScourge))) + { + WorldGen.KillTile(xPos, yPos, false, false, false); + if (!Main.tile[xPos, yPos].active() && Main.netMode != NetmodeID.SinglePlayer) + NetMessage.SendData(17, -1, -1, null, 0, (float)xPos, (float)yPos, 0f, 0, 0, 0); + } + } + + // CONSIDER -- Lumenyl Crystals and Sea Prism Crystals aren't solid. They shouldn't need to be checked here. + if (Main.tileSolid[tile.type] && tile.type != ModContent.TileType() && tile.type != ModContent.TileType()) + { + CheckShatterCrystal(i + 1, j); + CheckShatterCrystal(i - 1, j); + CheckShatterCrystal(i, j + 1); + CheckShatterCrystal(i, j - 1); + } + } + + // LATER -- clean up copied decompiled pot code here public override bool Drop(int i, int j, int type) { if (type == 28) @@ -584,10 +501,5 @@ namespace CalamityMod.Tiles } return true; } - - public override bool PreHitWire(int i, int j, int type) - { - return !CalamityWorld.bossRushActive; - } } } diff --git a/Tiles/Cinderplate.cs b/Tiles/Cinderplate.cs index 37c972e415..14720b25c4 100644 --- a/Tiles/Cinderplate.cs +++ b/Tiles/Cinderplate.cs @@ -13,7 +13,7 @@ namespace CalamityMod.Tiles Main.tileMergeDirt[Type] = true; Main.tileBlockLight[Type] = true; - TileMerge.MergeGeneralTiles(Type); + CalamityUtils.MergeWithGeneral(Type); soundType = 21; mineResist = 1f; diff --git a/Tiles/Crags/BrimstoneSlag.cs b/Tiles/Crags/BrimstoneSlag.cs index 5e5b79f80f..c285a3198d 100644 --- a/Tiles/Crags/BrimstoneSlag.cs +++ b/Tiles/Crags/BrimstoneSlag.cs @@ -15,9 +15,9 @@ namespace CalamityMod.Tiles.Crags Main.tileSolid[Type] = true; Main.tileBlockLight[Type] = true; - TileMerge.MergeGeneralTiles(Type); - TileMerge.MergeHellTiles(Type); - TileMerge.MergeTile(Type, ModContent.TileType()); + CalamityUtils.MergeWithGeneral(Type); + CalamityUtils.MergeWithHell(Type); + CalamityUtils.SetMerge(Type, ModContent.TileType()); soundType = 21; mineResist = 3f; @@ -40,7 +40,7 @@ namespace CalamityMod.Tiles.Crags public override bool TileFrame(int i, int j, ref bool resetFrame, ref bool noBreak) { - return CustomTileFraming.BrimstoneFraming(i, j, resetFrame); + return TileFraming.BrimstoneFraming(i, j, resetFrame); } public override void PostDraw(int i, int j, SpriteBatch spriteBatch) diff --git a/Tiles/CryonicBrick.cs b/Tiles/CryonicBrick.cs index 886df7adb6..4d83c033e9 100644 --- a/Tiles/CryonicBrick.cs +++ b/Tiles/CryonicBrick.cs @@ -13,8 +13,8 @@ namespace CalamityMod.Tiles Main.tileSolid[Type] = true; Main.tileBlockLight[Type] = true; - TileMerge.MergeGeneralTiles(Type); - TileMerge.MergeDecorativeTiles(Type); + CalamityUtils.MergeWithGeneral(Type); + CalamityUtils.MergeDecorativeTiles(Type); soundType = 21; minPick = 100; diff --git a/Tiles/FurnitureAbyss/AbyssBath.cs b/Tiles/FurnitureAbyss/AbyssBath.cs index 0a863314e3..be56829128 100644 --- a/Tiles/FurnitureAbyss/AbyssBath.cs +++ b/Tiles/FurnitureAbyss/AbyssBath.cs @@ -7,7 +7,7 @@ namespace CalamityMod.Tiles.FurnitureAbyss { public override void SetDefaults() { - CalamityUtils.SetUpBathtub(Type); + this.SetUpBathtub(); ModTranslation name = CreateMapEntryName(); name.SetDefault("Abyss Bathtub"); AddMapEntry(new Color(191, 142, 111), name); diff --git a/Tiles/FurnitureAbyss/AbyssBed.cs b/Tiles/FurnitureAbyss/AbyssBed.cs index 457da51ae1..f280441e35 100644 --- a/Tiles/FurnitureAbyss/AbyssBed.cs +++ b/Tiles/FurnitureAbyss/AbyssBed.cs @@ -9,7 +9,7 @@ namespace CalamityMod.Tiles.FurnitureAbyss { public override void SetDefaults() { - CalamityUtils.SetUpBed(Type); + this.SetUpBed(); ModTranslation name = CreateMapEntryName(); name.SetDefault("Abyss Bed"); AddMapEntry(new Color(191, 142, 111), name); diff --git a/Tiles/FurnitureAbyss/AbyssBookcase.cs b/Tiles/FurnitureAbyss/AbyssBookcase.cs index 7e8c5e2c66..36b5317fc1 100644 --- a/Tiles/FurnitureAbyss/AbyssBookcase.cs +++ b/Tiles/FurnitureAbyss/AbyssBookcase.cs @@ -9,7 +9,7 @@ namespace CalamityMod.Tiles.FurnitureAbyss { public override void SetDefaults() { - CalamityUtils.SetUpBookcase(Type); + this.SetUpBookcase(); ModTranslation name = CreateMapEntryName(); name.SetDefault("Abyss Bookcase"); AddMapEntry(new Color(191, 142, 111), name); diff --git a/Tiles/FurnitureAbyss/AbyssCandelabra.cs b/Tiles/FurnitureAbyss/AbyssCandelabra.cs index b76fd6629e..675df6d43b 100644 --- a/Tiles/FurnitureAbyss/AbyssCandelabra.cs +++ b/Tiles/FurnitureAbyss/AbyssCandelabra.cs @@ -9,7 +9,7 @@ namespace CalamityMod.Tiles.FurnitureAbyss { public override void SetDefaults() { - CalamityUtils.SetUpCandelabra(Type); + this.SetUpCandelabra(); ModTranslation name = CreateMapEntryName(); name.SetDefault("Abyss Candelabra"); AddMapEntry(new Color(191, 142, 111), name); diff --git a/Tiles/FurnitureAbyss/AbyssChair.cs b/Tiles/FurnitureAbyss/AbyssChair.cs index 8d558714f0..8218df02d2 100644 --- a/Tiles/FurnitureAbyss/AbyssChair.cs +++ b/Tiles/FurnitureAbyss/AbyssChair.cs @@ -9,7 +9,7 @@ namespace CalamityMod.Tiles.FurnitureAbyss { public override void SetDefaults() { - CalamityUtils.SetUpChair(Type); + this.SetUpChair(); ModTranslation name = CreateMapEntryName(); name.SetDefault("Abyss Chair"); AddMapEntry(new Color(191, 142, 111), name); diff --git a/Tiles/FurnitureAbyss/AbyssChandelier.cs b/Tiles/FurnitureAbyss/AbyssChandelier.cs index c313963421..61003db166 100644 --- a/Tiles/FurnitureAbyss/AbyssChandelier.cs +++ b/Tiles/FurnitureAbyss/AbyssChandelier.cs @@ -9,7 +9,7 @@ namespace CalamityMod.Tiles.FurnitureAbyss { public override void SetDefaults() { - CalamityUtils.SetUpChandelier(Type); + this.SetUpChandelier(); ModTranslation name = CreateMapEntryName(); name.SetDefault("Abyss Chandelier"); AddMapEntry(new Color(191, 142, 111), name); diff --git a/Tiles/FurnitureAbyss/AbyssChest.cs b/Tiles/FurnitureAbyss/AbyssChest.cs index 750de05d95..41b136759f 100644 --- a/Tiles/FurnitureAbyss/AbyssChest.cs +++ b/Tiles/FurnitureAbyss/AbyssChest.cs @@ -9,7 +9,7 @@ namespace CalamityMod.Tiles.FurnitureAbyss { public override void SetDefaults() { - CalamityUtils.SetUpChest(Type); + this.SetUpChest(); ModTranslation name = CreateMapEntryName(); name.SetDefault("Abyss Chest"); AddMapEntry(new Color(191, 142, 111), name, MapChestName); diff --git a/Tiles/FurnitureAbyss/AbyssClock.cs b/Tiles/FurnitureAbyss/AbyssClock.cs index cdeb188bf2..b2a76142a0 100644 --- a/Tiles/FurnitureAbyss/AbyssClock.cs +++ b/Tiles/FurnitureAbyss/AbyssClock.cs @@ -9,7 +9,7 @@ namespace CalamityMod.Tiles.FurnitureAbyss { public override void SetDefaults() { - CalamityUtils.SetUpClock(Type); + this.SetUpClock(); ModTranslation name = CreateMapEntryName(); name.SetDefault("Abyss Clock"); AddMapEntry(new Color(191, 142, 111), name); diff --git a/Tiles/FurnitureAbyss/AbyssDoorClosed.cs b/Tiles/FurnitureAbyss/AbyssDoorClosed.cs index 53de06ea52..f2db6f1480 100644 --- a/Tiles/FurnitureAbyss/AbyssDoorClosed.cs +++ b/Tiles/FurnitureAbyss/AbyssDoorClosed.cs @@ -9,7 +9,7 @@ namespace CalamityMod.Tiles.FurnitureAbyss { public override void SetDefaults() { - CalamityUtils.SetUpDoorClosed(Type); + this.SetUpDoorClosed(); ModTranslation name = CreateMapEntryName(); name.SetDefault("Abyss Door"); AddMapEntry(new Color(191, 142, 111), name); diff --git a/Tiles/FurnitureAbyss/AbyssDoorOpen.cs b/Tiles/FurnitureAbyss/AbyssDoorOpen.cs index 4e63968308..01a156250e 100644 --- a/Tiles/FurnitureAbyss/AbyssDoorOpen.cs +++ b/Tiles/FurnitureAbyss/AbyssDoorOpen.cs @@ -9,7 +9,7 @@ namespace CalamityMod.Tiles.FurnitureAbyss { public override void SetDefaults() { - CalamityUtils.SetUpDoorOpen(Type); + this.SetUpDoorOpen(); ModTranslation name = CreateMapEntryName(); name.SetDefault("Abyss Door"); AddMapEntry(new Color(191, 142, 111), name); diff --git a/Tiles/FurnitureAbyss/AbyssDresser.cs b/Tiles/FurnitureAbyss/AbyssDresser.cs index b7c453cb8a..aeb0916653 100644 --- a/Tiles/FurnitureAbyss/AbyssDresser.cs +++ b/Tiles/FurnitureAbyss/AbyssDresser.cs @@ -9,7 +9,7 @@ namespace CalamityMod.Tiles.FurnitureAbyss { public override void SetDefaults() { - CalamityUtils.SetUpDresser(Type); + this.SetUpDresser(); ModTranslation name = CreateMapEntryName(); name.SetDefault("Abyss Dresser"); AddMapEntry(new Color(191, 142, 111), name); diff --git a/Tiles/FurnitureAbyss/AbyssLamp.cs b/Tiles/FurnitureAbyss/AbyssLamp.cs index 3b259106ab..9703458159 100644 --- a/Tiles/FurnitureAbyss/AbyssLamp.cs +++ b/Tiles/FurnitureAbyss/AbyssLamp.cs @@ -9,7 +9,7 @@ namespace CalamityMod.Tiles.FurnitureAbyss { public override void SetDefaults() { - CalamityUtils.SetUpLamp(Type); + this.SetUpLamp(); ModTranslation name = CreateMapEntryName(); name.SetDefault("Abyss Lamp"); AddMapEntry(new Color(191, 142, 111), name); diff --git a/Tiles/FurnitureAbyss/AbyssLantern.cs b/Tiles/FurnitureAbyss/AbyssLantern.cs index c94f0705dd..5301f21226 100644 --- a/Tiles/FurnitureAbyss/AbyssLantern.cs +++ b/Tiles/FurnitureAbyss/AbyssLantern.cs @@ -9,7 +9,7 @@ namespace CalamityMod.Tiles.FurnitureAbyss { public override void SetDefaults() { - CalamityUtils.SetUpLantern(Type); + this.SetUpLantern(); ModTranslation name = CreateMapEntryName(); name.SetDefault("Abyss Lantern"); AddMapEntry(new Color(191, 142, 111), name); diff --git a/Tiles/FurnitureAbyss/AbyssPiano.cs b/Tiles/FurnitureAbyss/AbyssPiano.cs index a7871162de..c99b695592 100644 --- a/Tiles/FurnitureAbyss/AbyssPiano.cs +++ b/Tiles/FurnitureAbyss/AbyssPiano.cs @@ -7,7 +7,7 @@ namespace CalamityMod.Tiles.FurnitureAbyss { public override void SetDefaults() { - CalamityUtils.SetUpPiano(Type); + this.SetUpPiano(); ModTranslation name = CreateMapEntryName(); name.SetDefault("Abyss Synth"); AddMapEntry(new Color(191, 142, 111), name); diff --git a/Tiles/FurnitureAbyss/AbyssSink.cs b/Tiles/FurnitureAbyss/AbyssSink.cs index b9cb3193ce..f2efacc8e7 100644 --- a/Tiles/FurnitureAbyss/AbyssSink.cs +++ b/Tiles/FurnitureAbyss/AbyssSink.cs @@ -9,7 +9,7 @@ namespace CalamityMod.Tiles.FurnitureAbyss { public override void SetDefaults() { - CalamityUtils.SetUpSink(Type); + this.SetUpSink(); ModTranslation name = CreateMapEntryName(); name.SetDefault("Abyss Sink"); AddMapEntry(new Color(191, 142, 111), name); diff --git a/Tiles/FurnitureAbyss/AbyssSofa.cs b/Tiles/FurnitureAbyss/AbyssSofa.cs index 2c345fb282..399f0ea036 100644 --- a/Tiles/FurnitureAbyss/AbyssSofa.cs +++ b/Tiles/FurnitureAbyss/AbyssSofa.cs @@ -7,7 +7,7 @@ namespace CalamityMod.Tiles.FurnitureAbyss { public override void SetDefaults() { - CalamityUtils.SetUpSofa(Type); + this.SetUpSofa(); ModTranslation name = CreateMapEntryName(); name.SetDefault("Abyss Sofa"); AddMapEntry(new Color(191, 142, 111), name); diff --git a/Tiles/FurnitureAbyss/AbyssTable.cs b/Tiles/FurnitureAbyss/AbyssTable.cs index d34b586668..b7ab01d4b7 100644 --- a/Tiles/FurnitureAbyss/AbyssTable.cs +++ b/Tiles/FurnitureAbyss/AbyssTable.cs @@ -9,7 +9,7 @@ namespace CalamityMod.Tiles.FurnitureAbyss { public override void SetDefaults() { - CalamityUtils.SetUpTable(Type); + this.SetUpTable(); ModTranslation name = CreateMapEntryName(); name.SetDefault("Abyss Table"); AddMapEntry(new Color(191, 142, 111), name); diff --git a/Tiles/FurnitureAbyss/AbyssTorch.cs b/Tiles/FurnitureAbyss/AbyssTorch.cs index d5d6927b26..86e40febe1 100644 --- a/Tiles/FurnitureAbyss/AbyssTorch.cs +++ b/Tiles/FurnitureAbyss/AbyssTorch.cs @@ -10,7 +10,7 @@ namespace CalamityMod.Tiles.FurnitureAbyss { public override void SetDefaults() { - CalamityUtils.SetUpTorch(Type, waterImmune: true); + this.SetUpTorch(waterImmune: true); ModTranslation name = CreateMapEntryName(); name.SetDefault("Abyss Torch"); AddMapEntry(new Color(253, 221, 3), name); diff --git a/Tiles/FurnitureAbyss/AbyssWorkbench.cs b/Tiles/FurnitureAbyss/AbyssWorkbench.cs index dc016412ad..177c3822b3 100644 --- a/Tiles/FurnitureAbyss/AbyssWorkbench.cs +++ b/Tiles/FurnitureAbyss/AbyssWorkbench.cs @@ -9,7 +9,7 @@ namespace CalamityMod.Tiles.FurnitureAbyss { public override void SetDefaults() { - CalamityUtils.SetUpWorkBench(Type); + this.SetUpWorkBench(); ModTranslation name = CreateMapEntryName(); name.SetDefault("Abyss Work Bench"); AddMapEntry(new Color(191, 142, 111), name); diff --git a/Tiles/FurnitureAbyss/SmoothAbyssGravel.cs b/Tiles/FurnitureAbyss/SmoothAbyssGravel.cs index 9fd6a511e4..4908935f52 100644 --- a/Tiles/FurnitureAbyss/SmoothAbyssGravel.cs +++ b/Tiles/FurnitureAbyss/SmoothAbyssGravel.cs @@ -12,10 +12,10 @@ namespace CalamityMod.Tiles.FurnitureAbyss Main.tileMergeDirt[Type] = true; Main.tileBlockLight[Type] = true; - TileMerge.MergeGeneralTiles(Type); - TileMerge.MergeSmoothTiles(Type); - TileMerge.MergeDecorativeTiles(Type); - TileMerge.MergeAbyssTiles(Type); + CalamityUtils.MergeWithGeneral(Type); + CalamityUtils.MergeSmoothTiles(Type); + CalamityUtils.MergeDecorativeTiles(Type); + CalamityUtils.MergeWithAbyss(Type); soundType = 21; mineResist = 2f; diff --git a/Tiles/FurnitureAbyss/SmoothAbyssGravelPlatform.cs b/Tiles/FurnitureAbyss/SmoothAbyssGravelPlatform.cs index 2ffcbfcaf7..7c7794f71f 100644 --- a/Tiles/FurnitureAbyss/SmoothAbyssGravelPlatform.cs +++ b/Tiles/FurnitureAbyss/SmoothAbyssGravelPlatform.cs @@ -9,7 +9,7 @@ namespace CalamityMod.Tiles.FurnitureAbyss { public override void SetDefaults() { - CalamityUtils.SetUpPlatform(Type); + this.SetUpPlatform(); soundType = 21; AddMapEntry(new Color(191, 142, 111)); drop = ModContent.ItemType(); diff --git a/Tiles/FurnitureAncient/AncientBath.cs b/Tiles/FurnitureAncient/AncientBath.cs index bdcf7c9f93..8e4f3c3280 100644 --- a/Tiles/FurnitureAncient/AncientBath.cs +++ b/Tiles/FurnitureAncient/AncientBath.cs @@ -7,7 +7,7 @@ namespace CalamityMod.Tiles.FurnitureAncient { public override void SetDefaults() { - CalamityUtils.SetUpBathtub(Type, true); + this.SetUpBathtub(true); ModTranslation name = CreateMapEntryName(); name.SetDefault("Ancient Bathtub"); AddMapEntry(new Color(191, 142, 111), name); diff --git a/Tiles/FurnitureAncient/AncientBed.cs b/Tiles/FurnitureAncient/AncientBed.cs index 1fb3647845..0f9f772952 100644 --- a/Tiles/FurnitureAncient/AncientBed.cs +++ b/Tiles/FurnitureAncient/AncientBed.cs @@ -9,7 +9,7 @@ namespace CalamityMod.Tiles.FurnitureAncient { public override void SetDefaults() { - CalamityUtils.SetUpBed(Type, true); + this.SetUpBed(true); ModTranslation name = CreateMapEntryName(); name.SetDefault("Ancient Bed"); AddMapEntry(new Color(191, 142, 111), name); diff --git a/Tiles/FurnitureAncient/AncientBookcase.cs b/Tiles/FurnitureAncient/AncientBookcase.cs index f68b028d1c..324ffdf711 100644 --- a/Tiles/FurnitureAncient/AncientBookcase.cs +++ b/Tiles/FurnitureAncient/AncientBookcase.cs @@ -9,7 +9,7 @@ namespace CalamityMod.Tiles.FurnitureAncient { public override void SetDefaults() { - CalamityUtils.SetUpBookcase(Type, true); + this.SetUpBookcase(true); ModTranslation name = CreateMapEntryName(); name.SetDefault("Ancient Bookcase"); AddMapEntry(new Color(191, 142, 111), name); diff --git a/Tiles/FurnitureAncient/AncientChair.cs b/Tiles/FurnitureAncient/AncientChair.cs index b81db7b848..15b2ff26c1 100644 --- a/Tiles/FurnitureAncient/AncientChair.cs +++ b/Tiles/FurnitureAncient/AncientChair.cs @@ -9,7 +9,7 @@ namespace CalamityMod.Tiles.FurnitureAncient { public override void SetDefaults() { - CalamityUtils.SetUpChair(Type, true); + this.SetUpChair(true); ModTranslation name = CreateMapEntryName(); name.SetDefault("Ancient Chair"); AddMapEntry(new Color(191, 142, 111), name); diff --git a/Tiles/FurnitureAncient/AncientChandelier.cs b/Tiles/FurnitureAncient/AncientChandelier.cs index 2d6fd59670..d2dbcc66e9 100644 --- a/Tiles/FurnitureAncient/AncientChandelier.cs +++ b/Tiles/FurnitureAncient/AncientChandelier.cs @@ -7,7 +7,7 @@ namespace CalamityMod.Tiles.FurnitureAncient { public override void SetDefaults() { - CalamityUtils.SetUpChandelier(Type, true); + this.SetUpChandelier(true); ModTranslation name = CreateMapEntryName(); name.SetDefault("Ancient Chandelier"); AddMapEntry(new Color(191, 142, 111), name); diff --git a/Tiles/FurnitureAncient/AncientDoorClosed.cs b/Tiles/FurnitureAncient/AncientDoorClosed.cs index 553cb8a9cb..5bcd57e104 100644 --- a/Tiles/FurnitureAncient/AncientDoorClosed.cs +++ b/Tiles/FurnitureAncient/AncientDoorClosed.cs @@ -9,7 +9,7 @@ namespace CalamityMod.Tiles.FurnitureAncient { public override void SetDefaults() { - CalamityUtils.SetUpDoorClosed(Type, true); + this.SetUpDoorClosed(true); ModTranslation name = CreateMapEntryName(); name.SetDefault("Ancient Door"); AddMapEntry(new Color(191, 142, 111), name); diff --git a/Tiles/FurnitureAncient/AncientDoorOpen.cs b/Tiles/FurnitureAncient/AncientDoorOpen.cs index 78e8efec85..4f5b56c82b 100644 --- a/Tiles/FurnitureAncient/AncientDoorOpen.cs +++ b/Tiles/FurnitureAncient/AncientDoorOpen.cs @@ -9,7 +9,7 @@ namespace CalamityMod.Tiles.FurnitureAncient { public override void SetDefaults() { - CalamityUtils.SetUpDoorOpen(Type, true); + this.SetUpDoorOpen(true); ModTranslation name = CreateMapEntryName(); name.SetDefault("Ancient Door"); AddMapEntry(new Color(191, 142, 111), name); diff --git a/Tiles/FurnitureAncient/AncientDresser.cs b/Tiles/FurnitureAncient/AncientDresser.cs index 3fd8ea2f61..b8ff54f9ba 100644 --- a/Tiles/FurnitureAncient/AncientDresser.cs +++ b/Tiles/FurnitureAncient/AncientDresser.cs @@ -9,7 +9,7 @@ namespace CalamityMod.Tiles.FurnitureAncient { public override void SetDefaults() { - CalamityUtils.SetUpDresser(Type); + this.SetUpDresser(); ModTranslation name = CreateMapEntryName(); name.SetDefault("Ancient Dresser"); AddMapEntry(new Color(191, 142, 111), name); diff --git a/Tiles/FurnitureAncient/AncientLamp.cs b/Tiles/FurnitureAncient/AncientLamp.cs index 866e64dbad..5f1e49ba38 100644 --- a/Tiles/FurnitureAncient/AncientLamp.cs +++ b/Tiles/FurnitureAncient/AncientLamp.cs @@ -9,7 +9,7 @@ namespace CalamityMod.Tiles.FurnitureAncient { public override void SetDefaults() { - CalamityUtils.SetUpLamp(Type, true); + this.SetUpLamp(true); ModTranslation name = CreateMapEntryName(); name.SetDefault("Ancient Lamp"); AddMapEntry(new Color(191, 142, 111), name); diff --git a/Tiles/FurnitureAncient/AncientLantern.cs b/Tiles/FurnitureAncient/AncientLantern.cs index 12615b5fac..9ded969cc5 100644 --- a/Tiles/FurnitureAncient/AncientLantern.cs +++ b/Tiles/FurnitureAncient/AncientLantern.cs @@ -9,7 +9,7 @@ namespace CalamityMod.Tiles.FurnitureAncient { public override void SetDefaults() { - CalamityUtils.SetUpLantern(Type, true); + this.SetUpLantern(true); ModTranslation name = CreateMapEntryName(); name.SetDefault("Ancient Lantern"); AddMapEntry(new Color(191, 142, 111), name); diff --git a/Tiles/FurnitureAncient/AncientMonolith.cs b/Tiles/FurnitureAncient/AncientMonolith.cs index 3e720de742..0cde559566 100644 --- a/Tiles/FurnitureAncient/AncientMonolith.cs +++ b/Tiles/FurnitureAncient/AncientMonolith.cs @@ -9,7 +9,7 @@ namespace CalamityMod.Tiles.FurnitureAncient { public override void SetDefaults() { - CalamityUtils.SetUpClock(Type, true); + this.SetUpClock(true); ModTranslation name = CreateMapEntryName(); name.SetDefault("Ancient Monolith"); AddMapEntry(new Color(191, 142, 111), name); diff --git a/Tiles/FurnitureAncient/AncientSink.cs b/Tiles/FurnitureAncient/AncientSink.cs index d7ffb234aa..4d6ec5bd57 100644 --- a/Tiles/FurnitureAncient/AncientSink.cs +++ b/Tiles/FurnitureAncient/AncientSink.cs @@ -9,7 +9,7 @@ namespace CalamityMod.Tiles.FurnitureAncient { public override void SetDefaults() { - CalamityUtils.SetUpSink(Type, true); + this.SetUpSink(true); ModTranslation name = CreateMapEntryName(); name.SetDefault("Ancient Sink"); AddMapEntry(new Color(191, 142, 111), name); diff --git a/Tiles/FurnitureAncient/AncientSofa.cs b/Tiles/FurnitureAncient/AncientSofa.cs index 136d3baadc..83e0bec7bd 100644 --- a/Tiles/FurnitureAncient/AncientSofa.cs +++ b/Tiles/FurnitureAncient/AncientSofa.cs @@ -7,7 +7,7 @@ namespace CalamityMod.Tiles.FurnitureAncient { public override void SetDefaults() { - CalamityUtils.SetUpSofa(Type, true); + this.SetUpSofa(true); ModTranslation name = CreateMapEntryName(); name.SetDefault("Ancient Sofa"); AddMapEntry(new Color(191, 142, 111), name); diff --git a/Tiles/FurnitureAncient/AncientTable.cs b/Tiles/FurnitureAncient/AncientTable.cs index 9359dadbbd..71b3cca707 100644 --- a/Tiles/FurnitureAncient/AncientTable.cs +++ b/Tiles/FurnitureAncient/AncientTable.cs @@ -9,7 +9,7 @@ namespace CalamityMod.Tiles.FurnitureAncient { public override void SetDefaults() { - CalamityUtils.SetUpTable(Type, true); + this.SetUpTable(true); ModTranslation name = CreateMapEntryName(); name.SetDefault("Ancient Table"); AddMapEntry(new Color(191, 142, 111), name); diff --git a/Tiles/FurnitureAncient/AncientWorkbench.cs b/Tiles/FurnitureAncient/AncientWorkbench.cs index 964b5801bb..ca2d080942 100644 --- a/Tiles/FurnitureAncient/AncientWorkbench.cs +++ b/Tiles/FurnitureAncient/AncientWorkbench.cs @@ -9,7 +9,7 @@ namespace CalamityMod.Tiles.FurnitureAncient { public override void SetDefaults() { - CalamityUtils.SetUpWorkBench(Type, true); + this.SetUpWorkBench(true); ModTranslation name = CreateMapEntryName(); name.SetDefault("Ancient Work Bench"); AddMapEntry(new Color(191, 142, 111), name); diff --git a/Tiles/FurnitureAshen/AshenBath.cs b/Tiles/FurnitureAshen/AshenBath.cs index 0ea9b41168..8e0d8f68c7 100644 --- a/Tiles/FurnitureAshen/AshenBath.cs +++ b/Tiles/FurnitureAshen/AshenBath.cs @@ -7,7 +7,7 @@ namespace CalamityMod.Tiles.FurnitureAshen { public override void SetDefaults() { - CalamityUtils.SetUpBathtub(Type, true); + this.SetUpBathtub(true); ModTranslation name = CreateMapEntryName(); name.SetDefault("Ashen Bathtub"); AddMapEntry(new Color(191, 142, 111), name); diff --git a/Tiles/FurnitureAshen/AshenBed.cs b/Tiles/FurnitureAshen/AshenBed.cs index ab3d7d7aa0..342c7c7605 100644 --- a/Tiles/FurnitureAshen/AshenBed.cs +++ b/Tiles/FurnitureAshen/AshenBed.cs @@ -9,7 +9,7 @@ namespace CalamityMod.Tiles.FurnitureAshen { public override void SetDefaults() { - CalamityUtils.SetUpBed(Type, true); + this.SetUpBed(true); ModTranslation name = CreateMapEntryName(); name.SetDefault("Ashen Bed"); AddMapEntry(new Color(191, 142, 111), name); diff --git a/Tiles/FurnitureAshen/AshenBookcase.cs b/Tiles/FurnitureAshen/AshenBookcase.cs index 727ee925a1..81b3a10062 100644 --- a/Tiles/FurnitureAshen/AshenBookcase.cs +++ b/Tiles/FurnitureAshen/AshenBookcase.cs @@ -9,7 +9,7 @@ namespace CalamityMod.Tiles.FurnitureAshen { public override void SetDefaults() { - CalamityUtils.SetUpBookcase(Type, true); + this.SetUpBookcase(true); ModTranslation name = CreateMapEntryName(); name.SetDefault("Ashen Bookcase"); AddMapEntry(new Color(191, 142, 111), name); diff --git a/Tiles/FurnitureAshen/AshenCandelabra.cs b/Tiles/FurnitureAshen/AshenCandelabra.cs index 3d4e9f9748..2e31108a9d 100644 --- a/Tiles/FurnitureAshen/AshenCandelabra.cs +++ b/Tiles/FurnitureAshen/AshenCandelabra.cs @@ -9,7 +9,7 @@ namespace CalamityMod.Tiles.FurnitureAshen { public override void SetDefaults() { - CalamityUtils.SetUpCandelabra(Type, true); + this.SetUpCandelabra(true); ModTranslation name = CreateMapEntryName(); name.SetDefault("Ashen Candelabra"); AddMapEntry(new Color(191, 142, 111), name); diff --git a/Tiles/FurnitureAshen/AshenCandle.cs b/Tiles/FurnitureAshen/AshenCandle.cs index 1e64407e57..3f781a2325 100644 --- a/Tiles/FurnitureAshen/AshenCandle.cs +++ b/Tiles/FurnitureAshen/AshenCandle.cs @@ -9,7 +9,7 @@ namespace CalamityMod.Tiles.FurnitureAshen { public override void SetDefaults() { - CalamityUtils.SetUpCandle(Type, true); + this.SetUpCandle(true); ModTranslation name = CreateMapEntryName(); name.SetDefault("Ashen Candle"); AddMapEntry(new Color(191, 142, 111), name); diff --git a/Tiles/FurnitureAshen/AshenChair.cs b/Tiles/FurnitureAshen/AshenChair.cs index e0aa5d0ffd..cbc4769f9d 100644 --- a/Tiles/FurnitureAshen/AshenChair.cs +++ b/Tiles/FurnitureAshen/AshenChair.cs @@ -9,7 +9,7 @@ namespace CalamityMod.Tiles.FurnitureAshen { public override void SetDefaults() { - CalamityUtils.SetUpChair(Type, true); + this.SetUpChair(true); ModTranslation name = CreateMapEntryName(); name.SetDefault("Ashen Chair"); AddMapEntry(new Color(191, 142, 111), name); diff --git a/Tiles/FurnitureAshen/AshenChandelier.cs b/Tiles/FurnitureAshen/AshenChandelier.cs index 9ce827faad..fbfc652b28 100644 --- a/Tiles/FurnitureAshen/AshenChandelier.cs +++ b/Tiles/FurnitureAshen/AshenChandelier.cs @@ -9,7 +9,7 @@ namespace CalamityMod.Tiles.FurnitureAshen { public override void SetDefaults() { - CalamityUtils.SetUpChandelier(Type, true); + this.SetUpChandelier(true); ModTranslation name = CreateMapEntryName(); name.SetDefault("Ashen Chandelier"); AddMapEntry(new Color(191, 142, 111), name); diff --git a/Tiles/FurnitureAshen/AshenChest.cs b/Tiles/FurnitureAshen/AshenChest.cs index bdc7dbf68a..143eec1853 100644 --- a/Tiles/FurnitureAshen/AshenChest.cs +++ b/Tiles/FurnitureAshen/AshenChest.cs @@ -9,7 +9,7 @@ namespace CalamityMod.Tiles.FurnitureAshen { public override void SetDefaults() { - CalamityUtils.SetUpChest(Type); + this.SetUpChest(); ModTranslation name = CreateMapEntryName(); name.SetDefault("Ashen Chest"); AddMapEntry(new Color(191, 142, 111), name, MapChestName); diff --git a/Tiles/FurnitureAshen/AshenDoorClosed.cs b/Tiles/FurnitureAshen/AshenDoorClosed.cs index 1b9e06b5c8..fc3b44f265 100644 --- a/Tiles/FurnitureAshen/AshenDoorClosed.cs +++ b/Tiles/FurnitureAshen/AshenDoorClosed.cs @@ -10,7 +10,7 @@ namespace CalamityMod.Tiles.FurnitureAshen { public override void SetDefaults() { - CalamityUtils.SetUpDoorClosed(Type, true); + this.SetUpDoorClosed(true); ModTranslation name = CreateMapEntryName(); name.SetDefault("Ashen Door"); AddMapEntry(new Color(191, 142, 111), name); diff --git a/Tiles/FurnitureAshen/AshenDoorOpen.cs b/Tiles/FurnitureAshen/AshenDoorOpen.cs index 51e381eeba..8534f1fdaf 100644 --- a/Tiles/FurnitureAshen/AshenDoorOpen.cs +++ b/Tiles/FurnitureAshen/AshenDoorOpen.cs @@ -10,7 +10,7 @@ namespace CalamityMod.Tiles.FurnitureAshen { public override void SetDefaults() { - CalamityUtils.SetUpDoorOpen(Type, true); + this.SetUpDoorOpen(true); ModTranslation name = CreateMapEntryName(); name.SetDefault("Ashen Door"); AddMapEntry(new Color(191, 142, 111), name); diff --git a/Tiles/FurnitureAshen/AshenDresser.cs b/Tiles/FurnitureAshen/AshenDresser.cs index 4a6b4176df..bad5eb2b8c 100644 --- a/Tiles/FurnitureAshen/AshenDresser.cs +++ b/Tiles/FurnitureAshen/AshenDresser.cs @@ -9,7 +9,7 @@ namespace CalamityMod.Tiles.FurnitureAshen { public override void SetDefaults() { - CalamityUtils.SetUpDresser(Type); + this.SetUpDresser(); Main.tileLavaDeath[Type] = false; ModTranslation name = CreateMapEntryName(); name.SetDefault("Ashen Dresser"); diff --git a/Tiles/FurnitureAshen/AshenLamp.cs b/Tiles/FurnitureAshen/AshenLamp.cs index aa8e6e10f4..771c8907b5 100644 --- a/Tiles/FurnitureAshen/AshenLamp.cs +++ b/Tiles/FurnitureAshen/AshenLamp.cs @@ -9,7 +9,7 @@ namespace CalamityMod.Tiles.FurnitureAshen { public override void SetDefaults() { - CalamityUtils.SetUpLamp(Type, true); + this.SetUpLamp(true); ModTranslation name = CreateMapEntryName(); name.SetDefault("Ashen Lamp"); AddMapEntry(new Color(191, 142, 111), name); diff --git a/Tiles/FurnitureAshen/AshenLantern.cs b/Tiles/FurnitureAshen/AshenLantern.cs index 1bc6a78e5a..467718a52d 100644 --- a/Tiles/FurnitureAshen/AshenLantern.cs +++ b/Tiles/FurnitureAshen/AshenLantern.cs @@ -9,7 +9,7 @@ namespace CalamityMod.Tiles.FurnitureAshen { public override void SetDefaults() { - CalamityUtils.SetUpLantern(Type, true); + this.SetUpLantern(true); ModTranslation name = CreateMapEntryName(); name.SetDefault("Ashen Lantern"); AddMapEntry(new Color(191, 142, 111), name); diff --git a/Tiles/FurnitureAshen/AshenMonolith.cs b/Tiles/FurnitureAshen/AshenMonolith.cs index 7854ab5eee..34405c0cba 100644 --- a/Tiles/FurnitureAshen/AshenMonolith.cs +++ b/Tiles/FurnitureAshen/AshenMonolith.cs @@ -11,7 +11,7 @@ namespace CalamityMod.Tiles.FurnitureAshen { public override void SetDefaults() { - CalamityUtils.SetUpClock(Type, true); + this.SetUpClock(true); ModTranslation name = CreateMapEntryName(); AddMapEntry(new Color(191, 142, 111), name); name.SetDefault("Ashen Monolith"); diff --git a/Tiles/FurnitureAshen/AshenPlatform.cs b/Tiles/FurnitureAshen/AshenPlatform.cs index 1001fdfa9e..381c112814 100644 --- a/Tiles/FurnitureAshen/AshenPlatform.cs +++ b/Tiles/FurnitureAshen/AshenPlatform.cs @@ -9,7 +9,7 @@ namespace CalamityMod.Tiles.FurnitureAshen { public override void SetDefaults() { - CalamityUtils.SetUpPlatform(Type, true); + this.SetUpPlatform(true); AddMapEntry(new Color(191, 142, 111)); drop = ModContent.ItemType(); disableSmartCursor = true; diff --git a/Tiles/FurnitureAshen/AshenSink.cs b/Tiles/FurnitureAshen/AshenSink.cs index e3509f56c2..b42bcb0d96 100644 --- a/Tiles/FurnitureAshen/AshenSink.cs +++ b/Tiles/FurnitureAshen/AshenSink.cs @@ -9,7 +9,7 @@ namespace CalamityMod.Tiles.FurnitureAshen { public override void SetDefaults() { - CalamityUtils.SetUpSink(Type, true); + this.SetUpSink(true); ModTranslation name = CreateMapEntryName(); name.SetDefault("Ashen Sink"); AddMapEntry(new Color(191, 142, 111), name); diff --git a/Tiles/FurnitureAshen/AshenSofa.cs b/Tiles/FurnitureAshen/AshenSofa.cs index 41bc7a88b1..773e4650ab 100644 --- a/Tiles/FurnitureAshen/AshenSofa.cs +++ b/Tiles/FurnitureAshen/AshenSofa.cs @@ -7,7 +7,7 @@ namespace CalamityMod.Tiles.FurnitureAshen { public override void SetDefaults() { - CalamityUtils.SetUpSofa(Type, true); + this.SetUpSofa(true); ModTranslation name = CreateMapEntryName(); name.SetDefault("Ashen Sofa"); AddMapEntry(new Color(191, 142, 111), name); diff --git a/Tiles/FurnitureAshen/AshenTable.cs b/Tiles/FurnitureAshen/AshenTable.cs index bc31df79b0..da30fa01ca 100644 --- a/Tiles/FurnitureAshen/AshenTable.cs +++ b/Tiles/FurnitureAshen/AshenTable.cs @@ -9,7 +9,7 @@ namespace CalamityMod.Tiles.FurnitureAshen { public override void SetDefaults() { - CalamityUtils.SetUpTable(Type, true); + this.SetUpTable(true); ModTranslation name = CreateMapEntryName(); name.SetDefault("Ashen Table"); AddMapEntry(new Color(191, 142, 111), name); diff --git a/Tiles/FurnitureAshen/AshenWorkbench.cs b/Tiles/FurnitureAshen/AshenWorkbench.cs index 61e91ddfd5..9eb7faae1e 100644 --- a/Tiles/FurnitureAshen/AshenWorkbench.cs +++ b/Tiles/FurnitureAshen/AshenWorkbench.cs @@ -9,7 +9,7 @@ namespace CalamityMod.Tiles.FurnitureAshen { public override void SetDefaults() { - CalamityUtils.SetUpWorkBench(Type, true); + this.SetUpWorkBench(true); ModTranslation name = CreateMapEntryName(); name.SetDefault("Ashen Work Bench"); AddMapEntry(new Color(191, 142, 111), name); diff --git a/Tiles/FurnitureAshen/SmoothBrimstoneSlag.cs b/Tiles/FurnitureAshen/SmoothBrimstoneSlag.cs index ddabcd10ac..f260f2e062 100644 --- a/Tiles/FurnitureAshen/SmoothBrimstoneSlag.cs +++ b/Tiles/FurnitureAshen/SmoothBrimstoneSlag.cs @@ -13,10 +13,10 @@ namespace CalamityMod.Tiles.FurnitureAshen Main.tileMergeDirt[Type] = false; Main.tileBlockLight[Type] = true; - TileMerge.MergeGeneralTiles(Type); - TileMerge.MergeSmoothTiles(Type); - TileMerge.MergeDecorativeTiles(Type); - TileMerge.MergeHellTiles(Type); + CalamityUtils.MergeWithGeneral(Type); + CalamityUtils.MergeSmoothTiles(Type); + CalamityUtils.MergeDecorativeTiles(Type); + CalamityUtils.MergeWithHell(Type); soundType = 21; mineResist = 5f; diff --git a/Tiles/FurnitureBotanic/BotanicBathtub.cs b/Tiles/FurnitureBotanic/BotanicBathtub.cs index 719fa0b00d..8facebf005 100644 --- a/Tiles/FurnitureBotanic/BotanicBathtub.cs +++ b/Tiles/FurnitureBotanic/BotanicBathtub.cs @@ -8,7 +8,7 @@ namespace CalamityMod.Tiles.FurnitureBotanic { public override void SetDefaults() { - CalamityUtils.SetUpBathtub(Type); + this.SetUpBathtub(); ModTranslation name = CreateMapEntryName(); name.SetDefault("Botanic Bathtub"); AddMapEntry(new Color(191, 142, 111), name); diff --git a/Tiles/FurnitureBotanic/BotanicBed.cs b/Tiles/FurnitureBotanic/BotanicBed.cs index 22bf8ecec3..e38443be80 100644 --- a/Tiles/FurnitureBotanic/BotanicBed.cs +++ b/Tiles/FurnitureBotanic/BotanicBed.cs @@ -10,7 +10,7 @@ namespace CalamityMod.Tiles.FurnitureBotanic { public override void SetDefaults() { - CalamityUtils.SetUpBed(Type); + this.SetUpBed(); ModTranslation name = CreateMapEntryName(); name.SetDefault("Botanic Bed"); AddMapEntry(new Color(191, 142, 111), name); diff --git a/Tiles/FurnitureBotanic/BotanicBench.cs b/Tiles/FurnitureBotanic/BotanicBench.cs index 1d54c627b3..d00ff22607 100644 --- a/Tiles/FurnitureBotanic/BotanicBench.cs +++ b/Tiles/FurnitureBotanic/BotanicBench.cs @@ -8,7 +8,7 @@ namespace CalamityMod.Tiles.FurnitureBotanic { public override void SetDefaults() { - CalamityUtils.SetUpSofa(Type); + this.SetUpSofa(); ModTranslation name = CreateMapEntryName(); name.SetDefault("Botanic Bench"); AddMapEntry(new Color(191, 142, 111), name); diff --git a/Tiles/FurnitureBotanic/BotanicBookcase.cs b/Tiles/FurnitureBotanic/BotanicBookcase.cs index 6ec27d61aa..0a30182edc 100644 --- a/Tiles/FurnitureBotanic/BotanicBookcase.cs +++ b/Tiles/FurnitureBotanic/BotanicBookcase.cs @@ -10,7 +10,7 @@ namespace CalamityMod.Tiles.FurnitureBotanic { public override void SetDefaults() { - CalamityUtils.SetUpBookcase(Type); + this.SetUpBookcase(); ModTranslation name = CreateMapEntryName(); name.SetDefault("Botanic Bookcase"); AddMapEntry(new Color(191, 142, 111), name); diff --git a/Tiles/FurnitureBotanic/BotanicCandelabra.cs b/Tiles/FurnitureBotanic/BotanicCandelabra.cs index 28e8c3c759..f54e42c5be 100644 --- a/Tiles/FurnitureBotanic/BotanicCandelabra.cs +++ b/Tiles/FurnitureBotanic/BotanicCandelabra.cs @@ -10,7 +10,7 @@ namespace CalamityMod.Tiles.FurnitureBotanic { public override void SetDefaults() { - CalamityUtils.SetUpCandelabra(Type); + this.SetUpCandelabra(); ModTranslation name = CreateMapEntryName(); name.SetDefault("Botanic Candelabra"); AddMapEntry(new Color(191, 142, 111), name); diff --git a/Tiles/FurnitureBotanic/BotanicCandle.cs b/Tiles/FurnitureBotanic/BotanicCandle.cs index 2507f42ba1..a64c996414 100644 --- a/Tiles/FurnitureBotanic/BotanicCandle.cs +++ b/Tiles/FurnitureBotanic/BotanicCandle.cs @@ -10,7 +10,7 @@ namespace CalamityMod.Tiles.FurnitureBotanic { public override void SetDefaults() { - CalamityUtils.SetUpCandle(Type); + this.SetUpCandle(); ModTranslation name = CreateMapEntryName(); name.SetDefault("Botanic Candle"); AddMapEntry(new Color(191, 142, 111), name); diff --git a/Tiles/FurnitureBotanic/BotanicChair.cs b/Tiles/FurnitureBotanic/BotanicChair.cs index 634156d044..94472a0b41 100644 --- a/Tiles/FurnitureBotanic/BotanicChair.cs +++ b/Tiles/FurnitureBotanic/BotanicChair.cs @@ -10,7 +10,7 @@ namespace CalamityMod.Tiles.FurnitureBotanic { public override void SetDefaults() { - CalamityUtils.SetUpChair(Type); + this.SetUpChair(); ModTranslation name = CreateMapEntryName(); name.SetDefault("Botanic Chair"); AddMapEntry(new Color(191, 142, 111), name); diff --git a/Tiles/FurnitureBotanic/BotanicChandelier.cs b/Tiles/FurnitureBotanic/BotanicChandelier.cs index 524c65cd75..9abd6913f6 100644 --- a/Tiles/FurnitureBotanic/BotanicChandelier.cs +++ b/Tiles/FurnitureBotanic/BotanicChandelier.cs @@ -10,7 +10,7 @@ namespace CalamityMod.Tiles.FurnitureBotanic { public override void SetDefaults() { - CalamityUtils.SetUpChandelier(Type); + this.SetUpChandelier(); ModTranslation name = CreateMapEntryName(); name.SetDefault("Botanic Chandelier"); AddMapEntry(new Color(191, 142, 111), name); diff --git a/Tiles/FurnitureBotanic/BotanicChest.cs b/Tiles/FurnitureBotanic/BotanicChest.cs index 5dcac00d85..113e6aa815 100644 --- a/Tiles/FurnitureBotanic/BotanicChest.cs +++ b/Tiles/FurnitureBotanic/BotanicChest.cs @@ -10,7 +10,7 @@ namespace CalamityMod.Tiles.FurnitureBotanic { public override void SetDefaults() { - CalamityUtils.SetUpChest(Type); + this.SetUpChest(); ModTranslation name = CreateMapEntryName(); name.SetDefault("Botanic Chest"); AddMapEntry(new Color(191, 142, 111), name, MapChestName); diff --git a/Tiles/FurnitureBotanic/BotanicClock.cs b/Tiles/FurnitureBotanic/BotanicClock.cs index fdd33b75ca..58c0d26079 100644 --- a/Tiles/FurnitureBotanic/BotanicClock.cs +++ b/Tiles/FurnitureBotanic/BotanicClock.cs @@ -10,7 +10,7 @@ namespace CalamityMod.Tiles.FurnitureBotanic { public override void SetDefaults() { - CalamityUtils.SetUpClock(Type); + this.SetUpClock(); ModTranslation name = CreateMapEntryName(); name.SetDefault("Botanic Clock"); AddMapEntry(new Color(191, 142, 111), name); diff --git a/Tiles/FurnitureBotanic/BotanicDoorClosed.cs b/Tiles/FurnitureBotanic/BotanicDoorClosed.cs index 42735d3b21..518ffc9949 100644 --- a/Tiles/FurnitureBotanic/BotanicDoorClosed.cs +++ b/Tiles/FurnitureBotanic/BotanicDoorClosed.cs @@ -10,7 +10,7 @@ namespace CalamityMod.Tiles.FurnitureBotanic { public override void SetDefaults() { - CalamityUtils.SetUpDoorClosed(Type); + this.SetUpDoorClosed(); ModTranslation name = CreateMapEntryName(); name.SetDefault("Botanic Door"); AddMapEntry(new Color(191, 142, 111), name); diff --git a/Tiles/FurnitureBotanic/BotanicDoorOpen.cs b/Tiles/FurnitureBotanic/BotanicDoorOpen.cs index 106602090e..c7c7dc2b07 100644 --- a/Tiles/FurnitureBotanic/BotanicDoorOpen.cs +++ b/Tiles/FurnitureBotanic/BotanicDoorOpen.cs @@ -10,7 +10,7 @@ namespace CalamityMod.Tiles.FurnitureBotanic { public override void SetDefaults() { - CalamityUtils.SetUpDoorOpen(Type); + this.SetUpDoorOpen(); ModTranslation name = CreateMapEntryName(); name.SetDefault("Botanic Door"); AddMapEntry(new Color(191, 142, 111), name); diff --git a/Tiles/FurnitureBotanic/BotanicDresser.cs b/Tiles/FurnitureBotanic/BotanicDresser.cs index c298deb61a..a68fb8cb97 100644 --- a/Tiles/FurnitureBotanic/BotanicDresser.cs +++ b/Tiles/FurnitureBotanic/BotanicDresser.cs @@ -10,7 +10,7 @@ namespace CalamityMod.Tiles.FurnitureBotanic { public override void SetDefaults() { - CalamityUtils.SetUpDresser(Type); + this.SetUpDresser(); ModTranslation name = CreateMapEntryName(); name.SetDefault("Botanic Dresser"); AddMapEntry(new Color(191, 142, 111), name); diff --git a/Tiles/FurnitureBotanic/BotanicLamp.cs b/Tiles/FurnitureBotanic/BotanicLamp.cs index 2cf3a6e307..bf5bf2fe12 100644 --- a/Tiles/FurnitureBotanic/BotanicLamp.cs +++ b/Tiles/FurnitureBotanic/BotanicLamp.cs @@ -10,7 +10,7 @@ namespace CalamityMod.Tiles.FurnitureBotanic { public override void SetDefaults() { - CalamityUtils.SetUpLamp(Type); + this.SetUpLamp(); ModTranslation name = CreateMapEntryName(); name.SetDefault("Botanic Lamp"); AddMapEntry(new Color(191, 142, 111), name); diff --git a/Tiles/FurnitureBotanic/BotanicLantern.cs b/Tiles/FurnitureBotanic/BotanicLantern.cs index 6d77e6d09e..5c4538eb6f 100644 --- a/Tiles/FurnitureBotanic/BotanicLantern.cs +++ b/Tiles/FurnitureBotanic/BotanicLantern.cs @@ -10,7 +10,7 @@ namespace CalamityMod.Tiles.FurnitureBotanic { public override void SetDefaults() { - CalamityUtils.SetUpLantern(Type); + this.SetUpLantern(); ModTranslation name = CreateMapEntryName(); name.SetDefault("Botanic Lantern"); AddMapEntry(new Color(191, 142, 111), name); diff --git a/Tiles/FurnitureBotanic/BotanicPiano.cs b/Tiles/FurnitureBotanic/BotanicPiano.cs index 26c2950a08..37a2e3247f 100644 --- a/Tiles/FurnitureBotanic/BotanicPiano.cs +++ b/Tiles/FurnitureBotanic/BotanicPiano.cs @@ -8,7 +8,7 @@ namespace CalamityMod.Tiles.FurnitureBotanic { public override void SetDefaults() { - CalamityUtils.SetUpPiano(Type); + this.SetUpPiano(); ModTranslation name = CreateMapEntryName(); name.SetDefault("Botanic Piano"); AddMapEntry(new Color(191, 142, 111), name); diff --git a/Tiles/FurnitureBotanic/BotanicPlatform.cs b/Tiles/FurnitureBotanic/BotanicPlatform.cs index 697752c81e..47718f5454 100644 --- a/Tiles/FurnitureBotanic/BotanicPlatform.cs +++ b/Tiles/FurnitureBotanic/BotanicPlatform.cs @@ -10,7 +10,7 @@ namespace CalamityMod.Tiles.FurnitureBotanic { public override void SetDefaults() { - CalamityUtils.SetUpPlatform(Type); + this.SetUpPlatform(); AddMapEntry(new Color(191, 142, 111)); drop = ModContent.ItemType(); disableSmartCursor = true; diff --git a/Tiles/FurnitureBotanic/BotanicSink.cs b/Tiles/FurnitureBotanic/BotanicSink.cs index 259dda3780..d6df4cf26e 100644 --- a/Tiles/FurnitureBotanic/BotanicSink.cs +++ b/Tiles/FurnitureBotanic/BotanicSink.cs @@ -10,7 +10,7 @@ namespace CalamityMod.Tiles.FurnitureBotanic { public override void SetDefaults() { - CalamityUtils.SetUpSink(Type); + this.SetUpSink(); ModTranslation name = CreateMapEntryName(); name.SetDefault("Botanic Sink"); AddMapEntry(new Color(191, 142, 111), name); diff --git a/Tiles/FurnitureBotanic/BotanicTable.cs b/Tiles/FurnitureBotanic/BotanicTable.cs index caee57f315..616b83a2a2 100644 --- a/Tiles/FurnitureBotanic/BotanicTable.cs +++ b/Tiles/FurnitureBotanic/BotanicTable.cs @@ -10,7 +10,7 @@ namespace CalamityMod.Tiles.FurnitureBotanic { public override void SetDefaults() { - CalamityUtils.SetUpTable(Type); + this.SetUpTable(); ModTranslation name = CreateMapEntryName(); name.SetDefault("Botanic Table"); AddMapEntry(new Color(191, 142, 111), name); diff --git a/Tiles/FurnitureBotanic/BotanicWorkBench.cs b/Tiles/FurnitureBotanic/BotanicWorkBench.cs index 10684207dd..3ede514034 100644 --- a/Tiles/FurnitureBotanic/BotanicWorkBench.cs +++ b/Tiles/FurnitureBotanic/BotanicWorkBench.cs @@ -10,7 +10,7 @@ namespace CalamityMod.Tiles.FurnitureBotanic { public override void SetDefaults() { - CalamityUtils.SetUpWorkBench(Type); + this.SetUpWorkBench(); ModTranslation name = CreateMapEntryName(); name.SetDefault("Botanic Work Bench"); AddMapEntry(new Color(191, 142, 111), name); diff --git a/Tiles/FurnitureCosmilite/CosmiliteBath.cs b/Tiles/FurnitureCosmilite/CosmiliteBath.cs index b5c2faa17f..fa165e2b4a 100644 --- a/Tiles/FurnitureCosmilite/CosmiliteBath.cs +++ b/Tiles/FurnitureCosmilite/CosmiliteBath.cs @@ -7,7 +7,7 @@ namespace CalamityMod.Tiles.FurnitureCosmilite { public override void SetDefaults() { - CalamityUtils.SetUpBathtub(Type); + this.SetUpBathtub(); ModTranslation name = CreateMapEntryName(); name.SetDefault("Cosmilite Bathtub"); AddMapEntry(new Color(191, 142, 111), name); diff --git a/Tiles/FurnitureCosmilite/CosmiliteBed.cs b/Tiles/FurnitureCosmilite/CosmiliteBed.cs index e667c593ea..baefb13234 100644 --- a/Tiles/FurnitureCosmilite/CosmiliteBed.cs +++ b/Tiles/FurnitureCosmilite/CosmiliteBed.cs @@ -9,7 +9,7 @@ namespace CalamityMod.Tiles.FurnitureCosmilite { public override void SetDefaults() { - CalamityUtils.SetUpBed(Type); + this.SetUpBed(); ModTranslation name = CreateMapEntryName(); name.SetDefault("Cosmilite Bed"); AddMapEntry(new Color(191, 142, 111), name); diff --git a/Tiles/FurnitureCosmilite/CosmiliteBookcase.cs b/Tiles/FurnitureCosmilite/CosmiliteBookcase.cs index bb531fa440..bc0efba24a 100644 --- a/Tiles/FurnitureCosmilite/CosmiliteBookcase.cs +++ b/Tiles/FurnitureCosmilite/CosmiliteBookcase.cs @@ -9,7 +9,7 @@ namespace CalamityMod.Tiles.FurnitureCosmilite { public override void SetDefaults() { - CalamityUtils.SetUpBookcase(Type); + this.SetUpBookcase(); ModTranslation name = CreateMapEntryName(); name.SetDefault("Cosmilite Bookcase"); AddMapEntry(new Color(191, 142, 111), name); diff --git a/Tiles/FurnitureCosmilite/CosmiliteBrick.cs b/Tiles/FurnitureCosmilite/CosmiliteBrick.cs index cd16588a4e..c391a8a0e4 100644 --- a/Tiles/FurnitureCosmilite/CosmiliteBrick.cs +++ b/Tiles/FurnitureCosmilite/CosmiliteBrick.cs @@ -27,7 +27,7 @@ namespace CalamityMod.Tiles.FurnitureCosmilite public override bool TileFrame(int i, int j, ref bool resetFrame, ref bool noBreak) { - return CustomTileFraming.BrimstoneFraming(i, j, resetFrame); + return TileFraming.BrimstoneFraming(i, j, resetFrame); } public override void PostDraw(int i, int j, SpriteBatch spriteBatch) diff --git a/Tiles/FurnitureCosmilite/CosmiliteCandelabra.cs b/Tiles/FurnitureCosmilite/CosmiliteCandelabra.cs index 6f724011df..f5b2055a39 100644 --- a/Tiles/FurnitureCosmilite/CosmiliteCandelabra.cs +++ b/Tiles/FurnitureCosmilite/CosmiliteCandelabra.cs @@ -9,7 +9,7 @@ namespace CalamityMod.Tiles.FurnitureCosmilite { public override void SetDefaults() { - CalamityUtils.SetUpCandelabra(Type); + this.SetUpCandelabra(); ModTranslation name = CreateMapEntryName(); name.SetDefault("Cosmilite Candelabra"); AddMapEntry(new Color(191, 142, 111), name); diff --git a/Tiles/FurnitureCosmilite/CosmiliteCandle.cs b/Tiles/FurnitureCosmilite/CosmiliteCandle.cs index 596da90aca..e10eede421 100644 --- a/Tiles/FurnitureCosmilite/CosmiliteCandle.cs +++ b/Tiles/FurnitureCosmilite/CosmiliteCandle.cs @@ -9,7 +9,7 @@ namespace CalamityMod.Tiles.FurnitureCosmilite { public override void SetDefaults() { - CalamityUtils.SetUpCandle(Type); + this.SetUpCandle(); ModTranslation name = CreateMapEntryName(); name.SetDefault("Cosmilite Candle"); AddMapEntry(new Color(191, 142, 111), name); diff --git a/Tiles/FurnitureCosmilite/CosmiliteChair.cs b/Tiles/FurnitureCosmilite/CosmiliteChair.cs index 3525770901..612ccc596f 100644 --- a/Tiles/FurnitureCosmilite/CosmiliteChair.cs +++ b/Tiles/FurnitureCosmilite/CosmiliteChair.cs @@ -9,7 +9,7 @@ namespace CalamityMod.Tiles.FurnitureCosmilite { public override void SetDefaults() { - CalamityUtils.SetUpChair(Type); + this.SetUpChair(); ModTranslation name = CreateMapEntryName(); name.SetDefault("Cosmilite Chair"); AddMapEntry(new Color(191, 142, 111), name); diff --git a/Tiles/FurnitureCosmilite/CosmiliteChandelier.cs b/Tiles/FurnitureCosmilite/CosmiliteChandelier.cs index 79fbab4989..65bd59f6a6 100644 --- a/Tiles/FurnitureCosmilite/CosmiliteChandelier.cs +++ b/Tiles/FurnitureCosmilite/CosmiliteChandelier.cs @@ -9,7 +9,7 @@ namespace CalamityMod.Tiles.FurnitureCosmilite { public override void SetDefaults() { - CalamityUtils.SetUpChandelier(Type); + this.SetUpChandelier(); ModTranslation name = CreateMapEntryName(); name.SetDefault("Cosmilite Chandelier"); AddMapEntry(new Color(191, 142, 111), name); diff --git a/Tiles/FurnitureCosmilite/CosmiliteChest.cs b/Tiles/FurnitureCosmilite/CosmiliteChest.cs index 13c4da657c..e7238b0804 100644 --- a/Tiles/FurnitureCosmilite/CosmiliteChest.cs +++ b/Tiles/FurnitureCosmilite/CosmiliteChest.cs @@ -9,7 +9,7 @@ namespace CalamityMod.Tiles.FurnitureCosmilite { public override void SetDefaults() { - CalamityUtils.SetUpChest(Type); + this.SetUpChest(); ModTranslation name = CreateMapEntryName(); name.SetDefault("Cosmilite Chest"); AddMapEntry(new Color(191, 142, 111), name, MapChestName); diff --git a/Tiles/FurnitureCosmilite/CosmiliteClock.cs b/Tiles/FurnitureCosmilite/CosmiliteClock.cs index 4b4904974f..7f60027a3a 100644 --- a/Tiles/FurnitureCosmilite/CosmiliteClock.cs +++ b/Tiles/FurnitureCosmilite/CosmiliteClock.cs @@ -9,7 +9,7 @@ namespace CalamityMod.Tiles.FurnitureCosmilite { public override void SetDefaults() { - CalamityUtils.SetUpClock(Type); + this.SetUpClock(); ModTranslation name = CreateMapEntryName(); name.SetDefault("Cosmilite Clock"); AddMapEntry(new Color(191, 142, 111), name); diff --git a/Tiles/FurnitureCosmilite/CosmiliteDoorClosed.cs b/Tiles/FurnitureCosmilite/CosmiliteDoorClosed.cs index 754be5a3b4..aed053387d 100644 --- a/Tiles/FurnitureCosmilite/CosmiliteDoorClosed.cs +++ b/Tiles/FurnitureCosmilite/CosmiliteDoorClosed.cs @@ -9,7 +9,7 @@ namespace CalamityMod.Tiles.FurnitureCosmilite { public override void SetDefaults() { - CalamityUtils.SetUpDoorClosed(Type); + this.SetUpDoorClosed(); ModTranslation name = CreateMapEntryName(); name.SetDefault("Cosmilite Door"); AddMapEntry(new Color(191, 142, 111), name); diff --git a/Tiles/FurnitureCosmilite/CosmiliteDoorOpen.cs b/Tiles/FurnitureCosmilite/CosmiliteDoorOpen.cs index 909a7d0556..b54e6169db 100644 --- a/Tiles/FurnitureCosmilite/CosmiliteDoorOpen.cs +++ b/Tiles/FurnitureCosmilite/CosmiliteDoorOpen.cs @@ -9,7 +9,7 @@ namespace CalamityMod.Tiles.FurnitureCosmilite { public override void SetDefaults() { - CalamityUtils.SetUpDoorOpen(Type); + this.SetUpDoorOpen(); ModTranslation name = CreateMapEntryName(); name.SetDefault("Cosmilite Door"); AddMapEntry(new Color(191, 142, 111), name); diff --git a/Tiles/FurnitureCosmilite/CosmiliteDresser.cs b/Tiles/FurnitureCosmilite/CosmiliteDresser.cs index ae210e904a..05d9706986 100644 --- a/Tiles/FurnitureCosmilite/CosmiliteDresser.cs +++ b/Tiles/FurnitureCosmilite/CosmiliteDresser.cs @@ -9,7 +9,7 @@ namespace CalamityMod.Tiles.FurnitureCosmilite { public override void SetDefaults() { - CalamityUtils.SetUpDresser(Type); + this.SetUpDresser(); ModTranslation name = CreateMapEntryName(); name.SetDefault("Cosmilite Dresser"); AddMapEntry(new Color(191, 142, 111), name); diff --git a/Tiles/FurnitureCosmilite/CosmiliteLamp.cs b/Tiles/FurnitureCosmilite/CosmiliteLamp.cs index c46eabb5c6..8083d96456 100644 --- a/Tiles/FurnitureCosmilite/CosmiliteLamp.cs +++ b/Tiles/FurnitureCosmilite/CosmiliteLamp.cs @@ -9,7 +9,7 @@ namespace CalamityMod.Tiles.FurnitureCosmilite { public override void SetDefaults() { - CalamityUtils.SetUpLamp(Type); + this.SetUpLamp(); ModTranslation name = CreateMapEntryName(); name.SetDefault("Cosmilite Lamp"); AddMapEntry(new Color(191, 142, 111), name); diff --git a/Tiles/FurnitureCosmilite/CosmiliteLantern.cs b/Tiles/FurnitureCosmilite/CosmiliteLantern.cs index 72662b1985..d25d2084d7 100644 --- a/Tiles/FurnitureCosmilite/CosmiliteLantern.cs +++ b/Tiles/FurnitureCosmilite/CosmiliteLantern.cs @@ -9,7 +9,7 @@ namespace CalamityMod.Tiles.FurnitureCosmilite { public override void SetDefaults() { - CalamityUtils.SetUpLantern(Type); + this.SetUpLantern(); ModTranslation name = CreateMapEntryName(); name.SetDefault("Cosmilite Lantern"); AddMapEntry(new Color(191, 142, 111), name); diff --git a/Tiles/FurnitureCosmilite/CosmilitePiano.cs b/Tiles/FurnitureCosmilite/CosmilitePiano.cs index ed138964f0..9bb5ce82c3 100644 --- a/Tiles/FurnitureCosmilite/CosmilitePiano.cs +++ b/Tiles/FurnitureCosmilite/CosmilitePiano.cs @@ -7,7 +7,7 @@ namespace CalamityMod.Tiles.FurnitureCosmilite { public override void SetDefaults() { - CalamityUtils.SetUpPiano(Type); + this.SetUpPiano(); ModTranslation name = CreateMapEntryName(); name.SetDefault("Cosmilite Piano"); AddMapEntry(new Color(191, 142, 111), name); diff --git a/Tiles/FurnitureCosmilite/CosmilitePlatform.cs b/Tiles/FurnitureCosmilite/CosmilitePlatform.cs index c14a15868e..aab34d9eae 100644 --- a/Tiles/FurnitureCosmilite/CosmilitePlatform.cs +++ b/Tiles/FurnitureCosmilite/CosmilitePlatform.cs @@ -9,7 +9,7 @@ namespace CalamityMod.Tiles.FurnitureCosmilite { public override void SetDefaults() { - CalamityUtils.SetUpPlatform(Type); + this.SetUpPlatform(); AddMapEntry(new Color(191, 142, 111)); drop = ModContent.ItemType(); disableSmartCursor = true; diff --git a/Tiles/FurnitureCosmilite/CosmiliteSink.cs b/Tiles/FurnitureCosmilite/CosmiliteSink.cs index 095bc653e6..08d03e6fb2 100644 --- a/Tiles/FurnitureCosmilite/CosmiliteSink.cs +++ b/Tiles/FurnitureCosmilite/CosmiliteSink.cs @@ -9,7 +9,7 @@ namespace CalamityMod.Tiles.FurnitureCosmilite { public override void SetDefaults() { - CalamityUtils.SetUpSink(Type); + this.SetUpSink(); ModTranslation name = CreateMapEntryName(); name.SetDefault("Cosmilite Sink"); AddMapEntry(new Color(191, 142, 111), name); diff --git a/Tiles/FurnitureCosmilite/CosmiliteSofa.cs b/Tiles/FurnitureCosmilite/CosmiliteSofa.cs index 62553d9c6e..9c63374c7e 100644 --- a/Tiles/FurnitureCosmilite/CosmiliteSofa.cs +++ b/Tiles/FurnitureCosmilite/CosmiliteSofa.cs @@ -7,7 +7,7 @@ namespace CalamityMod.Tiles.FurnitureCosmilite { public override void SetDefaults() { - CalamityUtils.SetUpSofa(Type); + this.SetUpSofa(); ModTranslation name = CreateMapEntryName(); name.SetDefault("Cosmilite Sofa"); AddMapEntry(new Color(191, 142, 111), name); diff --git a/Tiles/FurnitureCosmilite/CosmiliteTable.cs b/Tiles/FurnitureCosmilite/CosmiliteTable.cs index 879594aa7f..1cb9f60fb4 100644 --- a/Tiles/FurnitureCosmilite/CosmiliteTable.cs +++ b/Tiles/FurnitureCosmilite/CosmiliteTable.cs @@ -9,7 +9,7 @@ namespace CalamityMod.Tiles.FurnitureCosmilite { public override void SetDefaults() { - CalamityUtils.SetUpTable(Type); + this.SetUpTable(); ModTranslation name = CreateMapEntryName(); name.SetDefault("Cosmilite Table"); AddMapEntry(new Color(191, 142, 111), name); diff --git a/Tiles/FurnitureCosmilite/CosmiliteWorkbench.cs b/Tiles/FurnitureCosmilite/CosmiliteWorkbench.cs index 34aeaf6084..ef6f95077a 100644 --- a/Tiles/FurnitureCosmilite/CosmiliteWorkbench.cs +++ b/Tiles/FurnitureCosmilite/CosmiliteWorkbench.cs @@ -9,7 +9,7 @@ namespace CalamityMod.Tiles.FurnitureCosmilite { public override void SetDefaults() { - CalamityUtils.SetUpWorkBench(Type); + this.SetUpWorkBench(); ModTranslation name = CreateMapEntryName(); name.SetDefault("Cosmilite Work Bench"); AddMapEntry(new Color(191, 142, 111), name); diff --git a/Tiles/FurnitureEutrophic/EutrophicBathtub.cs b/Tiles/FurnitureEutrophic/EutrophicBathtub.cs index 616d65ce26..15eaa2f81c 100644 --- a/Tiles/FurnitureEutrophic/EutrophicBathtub.cs +++ b/Tiles/FurnitureEutrophic/EutrophicBathtub.cs @@ -9,7 +9,7 @@ namespace CalamityMod.Tiles.FurnitureEutrophic { public override void SetDefaults() { - CalamityUtils.SetUpBathtub(Type); + this.SetUpBathtub(); TileObjectData.newTile.CopyFrom(TileObjectData.Style4x2); TileObjectData.addTile(Type); ModTranslation name = CreateMapEntryName(); diff --git a/Tiles/FurnitureEutrophic/EutrophicBed.cs b/Tiles/FurnitureEutrophic/EutrophicBed.cs index ecd34cd7a3..185c48aecc 100644 --- a/Tiles/FurnitureEutrophic/EutrophicBed.cs +++ b/Tiles/FurnitureEutrophic/EutrophicBed.cs @@ -9,7 +9,7 @@ namespace CalamityMod.Tiles.FurnitureEutrophic { public override void SetDefaults() { - CalamityUtils.SetUpBed(Type); + this.SetUpBed(); ModTranslation name = CreateMapEntryName(); name.SetDefault("Eutrophic Bed"); AddMapEntry(new Color(191, 142, 111), name); diff --git a/Tiles/FurnitureEutrophic/EutrophicBench.cs b/Tiles/FurnitureEutrophic/EutrophicBench.cs index baa77c9f77..d4bfdb7c09 100644 --- a/Tiles/FurnitureEutrophic/EutrophicBench.cs +++ b/Tiles/FurnitureEutrophic/EutrophicBench.cs @@ -7,7 +7,7 @@ namespace CalamityMod.Tiles.FurnitureEutrophic { public override void SetDefaults() { - CalamityUtils.SetUpSofa(Type); + this.SetUpSofa(); ModTranslation name = CreateMapEntryName(); name.SetDefault("Eutrophic Bench"); AddMapEntry(new Color(191, 142, 111), name); diff --git a/Tiles/FurnitureEutrophic/EutrophicBookcase.cs b/Tiles/FurnitureEutrophic/EutrophicBookcase.cs index 5c17801ab4..60125099f5 100644 --- a/Tiles/FurnitureEutrophic/EutrophicBookcase.cs +++ b/Tiles/FurnitureEutrophic/EutrophicBookcase.cs @@ -9,7 +9,7 @@ namespace CalamityMod.Tiles.FurnitureEutrophic { public override void SetDefaults() { - CalamityUtils.SetUpBookcase(Type); + this.SetUpBookcase(); ModTranslation name = CreateMapEntryName(); name.SetDefault("Eutrophic Bookcase"); AddMapEntry(new Color(191, 142, 111), name); diff --git a/Tiles/FurnitureEutrophic/EutrophicCandelabra.cs b/Tiles/FurnitureEutrophic/EutrophicCandelabra.cs index 8b4e111e9b..fd43dd889d 100644 --- a/Tiles/FurnitureEutrophic/EutrophicCandelabra.cs +++ b/Tiles/FurnitureEutrophic/EutrophicCandelabra.cs @@ -9,7 +9,7 @@ namespace CalamityMod.Tiles.FurnitureEutrophic { public override void SetDefaults() { - CalamityUtils.SetUpCandelabra(Type); + this.SetUpCandelabra(); ModTranslation name = CreateMapEntryName(); name.SetDefault("Eutrophic Candelabra"); AddMapEntry(new Color(191, 142, 111), name); diff --git a/Tiles/FurnitureEutrophic/EutrophicCandle.cs b/Tiles/FurnitureEutrophic/EutrophicCandle.cs index c7737489c9..f706935c97 100644 --- a/Tiles/FurnitureEutrophic/EutrophicCandle.cs +++ b/Tiles/FurnitureEutrophic/EutrophicCandle.cs @@ -9,7 +9,7 @@ namespace CalamityMod.Tiles.FurnitureEutrophic { public override void SetDefaults() { - CalamityUtils.SetUpCandle(Type); + this.SetUpCandle(); ModTranslation name = CreateMapEntryName(); name.SetDefault("Eutrophic Candle"); AddMapEntry(new Color(191, 142, 111), name); diff --git a/Tiles/FurnitureEutrophic/EutrophicChair.cs b/Tiles/FurnitureEutrophic/EutrophicChair.cs index 16b6a80824..d69b74cca3 100644 --- a/Tiles/FurnitureEutrophic/EutrophicChair.cs +++ b/Tiles/FurnitureEutrophic/EutrophicChair.cs @@ -9,7 +9,7 @@ namespace CalamityMod.Tiles.FurnitureEutrophic { public override void SetDefaults() { - CalamityUtils.SetUpChair(Type); + this.SetUpChair(); ModTranslation name = CreateMapEntryName(); name.SetDefault("Eutrophic Chair"); AddMapEntry(new Color(191, 142, 111), name); diff --git a/Tiles/FurnitureEutrophic/EutrophicChandelier.cs b/Tiles/FurnitureEutrophic/EutrophicChandelier.cs index ed21766556..1c83213322 100644 --- a/Tiles/FurnitureEutrophic/EutrophicChandelier.cs +++ b/Tiles/FurnitureEutrophic/EutrophicChandelier.cs @@ -9,7 +9,7 @@ namespace CalamityMod.Tiles.FurnitureEutrophic { public override void SetDefaults() { - CalamityUtils.SetUpChandelier(Type); + this.SetUpChandelier(); ModTranslation name = CreateMapEntryName(); name.SetDefault("Eutrophic Chandelier"); AddMapEntry(new Color(191, 142, 111), name); diff --git a/Tiles/FurnitureEutrophic/EutrophicChest.cs b/Tiles/FurnitureEutrophic/EutrophicChest.cs index afb7a22a70..4c9884c709 100644 --- a/Tiles/FurnitureEutrophic/EutrophicChest.cs +++ b/Tiles/FurnitureEutrophic/EutrophicChest.cs @@ -9,7 +9,7 @@ namespace CalamityMod.Tiles.FurnitureEutrophic { public override void SetDefaults() { - CalamityUtils.SetUpChest(Type); + this.SetUpChest(); ModTranslation name = CreateMapEntryName(); name.SetDefault("Eutrophic Chest"); AddMapEntry(new Color(191, 142, 111), name, MapChestName); diff --git a/Tiles/FurnitureEutrophic/EutrophicClock.cs b/Tiles/FurnitureEutrophic/EutrophicClock.cs index dd452ac5a2..9481c58690 100644 --- a/Tiles/FurnitureEutrophic/EutrophicClock.cs +++ b/Tiles/FurnitureEutrophic/EutrophicClock.cs @@ -9,7 +9,7 @@ namespace CalamityMod.Tiles.FurnitureEutrophic { public override void SetDefaults() { - CalamityUtils.SetUpClock(Type); + this.SetUpClock(); ModTranslation name = CreateMapEntryName(); name.SetDefault("Eutrophic Clock"); AddMapEntry(new Color(191, 142, 111), name); diff --git a/Tiles/FurnitureEutrophic/EutrophicDoorClosed.cs b/Tiles/FurnitureEutrophic/EutrophicDoorClosed.cs index ef47c15fc8..ab746a32ee 100644 --- a/Tiles/FurnitureEutrophic/EutrophicDoorClosed.cs +++ b/Tiles/FurnitureEutrophic/EutrophicDoorClosed.cs @@ -9,7 +9,7 @@ namespace CalamityMod.Tiles.FurnitureEutrophic { public override void SetDefaults() { - CalamityUtils.SetUpDoorClosed(Type); + this.SetUpDoorClosed(); ModTranslation name = CreateMapEntryName(); name.SetDefault("Eutrophic Door"); AddMapEntry(new Color(191, 142, 111), name); diff --git a/Tiles/FurnitureEutrophic/EutrophicDoorOpen.cs b/Tiles/FurnitureEutrophic/EutrophicDoorOpen.cs index 920cf96bcc..64fb41eda6 100644 --- a/Tiles/FurnitureEutrophic/EutrophicDoorOpen.cs +++ b/Tiles/FurnitureEutrophic/EutrophicDoorOpen.cs @@ -9,7 +9,7 @@ namespace CalamityMod.Tiles.FurnitureEutrophic { public override void SetDefaults() { - CalamityUtils.SetUpDoorOpen(Type); + this.SetUpDoorOpen(); ModTranslation name = CreateMapEntryName(); name.SetDefault("Eutrophic Door"); AddMapEntry(new Color(191, 142, 111), name); diff --git a/Tiles/FurnitureEutrophic/EutrophicDresser.cs b/Tiles/FurnitureEutrophic/EutrophicDresser.cs index 624cc997b5..01830426b3 100644 --- a/Tiles/FurnitureEutrophic/EutrophicDresser.cs +++ b/Tiles/FurnitureEutrophic/EutrophicDresser.cs @@ -9,7 +9,7 @@ namespace CalamityMod.Tiles.FurnitureEutrophic { public override void SetDefaults() { - CalamityUtils.SetUpDresser(Type); + this.SetUpDresser(); ModTranslation name = CreateMapEntryName(); name.SetDefault("Eutrophic Dresser"); AddMapEntry(new Color(191, 142, 111), name); diff --git a/Tiles/FurnitureEutrophic/EutrophicLamp.cs b/Tiles/FurnitureEutrophic/EutrophicLamp.cs index baff72b438..7864e7e496 100644 --- a/Tiles/FurnitureEutrophic/EutrophicLamp.cs +++ b/Tiles/FurnitureEutrophic/EutrophicLamp.cs @@ -9,7 +9,7 @@ namespace CalamityMod.Tiles.FurnitureEutrophic { public override void SetDefaults() { - CalamityUtils.SetUpLamp(Type); + this.SetUpLamp(); ModTranslation name = CreateMapEntryName(); name.SetDefault("Eutrophic Lamp"); AddMapEntry(new Color(191, 142, 111), name); diff --git a/Tiles/FurnitureEutrophic/EutrophicLantern.cs b/Tiles/FurnitureEutrophic/EutrophicLantern.cs index d9921cdb18..215754fb24 100644 --- a/Tiles/FurnitureEutrophic/EutrophicLantern.cs +++ b/Tiles/FurnitureEutrophic/EutrophicLantern.cs @@ -9,7 +9,7 @@ namespace CalamityMod.Tiles.FurnitureEutrophic { public override void SetDefaults() { - CalamityUtils.SetUpLantern(Type); + this.SetUpLantern(); ModTranslation name = CreateMapEntryName(); name.SetDefault("Eutrophic Lantern"); AddMapEntry(new Color(191, 142, 111), name); diff --git a/Tiles/FurnitureEutrophic/EutrophicPiano.cs b/Tiles/FurnitureEutrophic/EutrophicPiano.cs index 7aa21150d0..403c2d04d0 100644 --- a/Tiles/FurnitureEutrophic/EutrophicPiano.cs +++ b/Tiles/FurnitureEutrophic/EutrophicPiano.cs @@ -7,7 +7,7 @@ namespace CalamityMod.Tiles.FurnitureEutrophic { public override void SetDefaults() { - CalamityUtils.SetUpPiano(Type); + this.SetUpPiano(); ModTranslation name = CreateMapEntryName(); name.SetDefault("Eutrophic Piano"); AddMapEntry(new Color(191, 142, 111), name); diff --git a/Tiles/FurnitureEutrophic/EutrophicPlatform.cs b/Tiles/FurnitureEutrophic/EutrophicPlatform.cs index 6b764effd8..79b1bb1596 100644 --- a/Tiles/FurnitureEutrophic/EutrophicPlatform.cs +++ b/Tiles/FurnitureEutrophic/EutrophicPlatform.cs @@ -9,7 +9,7 @@ namespace CalamityMod.Tiles.FurnitureEutrophic { public override void SetDefaults() { - CalamityUtils.SetUpPlatform(Type); + this.SetUpPlatform(); AddMapEntry(new Color(191, 142, 111)); drop = ModContent.ItemType(); disableSmartCursor = true; diff --git a/Tiles/FurnitureEutrophic/EutrophicSink.cs b/Tiles/FurnitureEutrophic/EutrophicSink.cs index 0d1c5fddc0..0a917459f3 100644 --- a/Tiles/FurnitureEutrophic/EutrophicSink.cs +++ b/Tiles/FurnitureEutrophic/EutrophicSink.cs @@ -9,7 +9,7 @@ namespace CalamityMod.Tiles.FurnitureEutrophic { public override void SetDefaults() { - CalamityUtils.SetUpSink(Type); + this.SetUpSink(); ModTranslation name = CreateMapEntryName(); name.SetDefault("Eutrophic Sink"); AddMapEntry(new Color(191, 142, 111), name); diff --git a/Tiles/FurnitureEutrophic/EutrophicTable.cs b/Tiles/FurnitureEutrophic/EutrophicTable.cs index c92cfa5e21..d90da2eb71 100644 --- a/Tiles/FurnitureEutrophic/EutrophicTable.cs +++ b/Tiles/FurnitureEutrophic/EutrophicTable.cs @@ -9,7 +9,7 @@ namespace CalamityMod.Tiles.FurnitureEutrophic { public override void SetDefaults() { - CalamityUtils.SetUpTable(Type); + this.SetUpTable(); ModTranslation name = CreateMapEntryName(); name.SetDefault("Eutrophic Table"); AddMapEntry(new Color(191, 142, 111), name); diff --git a/Tiles/FurnitureEutrophic/EutrophicWorkBench.cs b/Tiles/FurnitureEutrophic/EutrophicWorkBench.cs index ccf99ebfe0..52103a9b74 100644 --- a/Tiles/FurnitureEutrophic/EutrophicWorkBench.cs +++ b/Tiles/FurnitureEutrophic/EutrophicWorkBench.cs @@ -9,7 +9,7 @@ namespace CalamityMod.Tiles.FurnitureEutrophic { public override void SetDefaults() { - CalamityUtils.SetUpWorkBench(Type); + this.SetUpWorkBench(); ModTranslation name = CreateMapEntryName(); name.SetDefault("Eutrophic Work Bench"); AddMapEntry(new Color(191, 142, 111), name); diff --git a/Tiles/FurnitureEutrophic/SmoothNavystone.cs b/Tiles/FurnitureEutrophic/SmoothNavystone.cs index 46526f27bd..b354a98f67 100644 --- a/Tiles/FurnitureEutrophic/SmoothNavystone.cs +++ b/Tiles/FurnitureEutrophic/SmoothNavystone.cs @@ -14,10 +14,10 @@ namespace CalamityMod.Tiles.FurnitureEutrophic Main.tileMergeDirt[Type] = true; Main.tileBlockLight[Type] = true; - TileMerge.MergeGeneralTiles(Type); - TileMerge.MergeSmoothTiles(Type); - TileMerge.MergeDecorativeTiles(Type); - TileMerge.MergeDesertTiles(Type); + CalamityUtils.MergeWithGeneral(Type); + CalamityUtils.MergeSmoothTiles(Type); + CalamityUtils.MergeDecorativeTiles(Type); + CalamityUtils.MergeWithDesert(Type); TileID.Sets.ChecksForMerge[Type] = true; soundType = 21; diff --git a/Tiles/FurnitureOccult/OccultBathtub.cs b/Tiles/FurnitureOccult/OccultBathtub.cs index 4ac83af06b..4dd2d1e1fa 100644 --- a/Tiles/FurnitureOccult/OccultBathtub.cs +++ b/Tiles/FurnitureOccult/OccultBathtub.cs @@ -8,7 +8,7 @@ namespace CalamityMod.Tiles.FurnitureOccult { public override void SetDefaults() { - CalamityUtils.SetUpBathtub(Type); + this.SetUpBathtub(); ModTranslation name = CreateMapEntryName(); name.SetDefault("Otherworldly Bathtub"); AddMapEntry(new Color(191, 142, 111), name); diff --git a/Tiles/FurnitureOccult/OccultBed.cs b/Tiles/FurnitureOccult/OccultBed.cs index 326bd1377e..af6fbd8359 100644 --- a/Tiles/FurnitureOccult/OccultBed.cs +++ b/Tiles/FurnitureOccult/OccultBed.cs @@ -10,7 +10,7 @@ namespace CalamityMod.Tiles.FurnitureOccult { public override void SetDefaults() { - CalamityUtils.SetUpBed(Type); + this.SetUpBed(); ModTranslation name = CreateMapEntryName(); name.SetDefault("Otherworldly Bed"); AddMapEntry(new Color(191, 142, 111), name); diff --git a/Tiles/FurnitureOccult/OccultBookcase.cs b/Tiles/FurnitureOccult/OccultBookcase.cs index 40e135aea9..865723a772 100644 --- a/Tiles/FurnitureOccult/OccultBookcase.cs +++ b/Tiles/FurnitureOccult/OccultBookcase.cs @@ -10,7 +10,7 @@ namespace CalamityMod.Tiles.FurnitureOccult { public override void SetDefaults() { - CalamityUtils.SetUpBookcase(Type); + this.SetUpBookcase(); ModTranslation name = CreateMapEntryName(); name.SetDefault("Otherworldly Bookcase"); AddMapEntry(new Color(191, 142, 111), name); diff --git a/Tiles/FurnitureOccult/OccultCandelabra.cs b/Tiles/FurnitureOccult/OccultCandelabra.cs index bf5c37e535..c253c7c730 100644 --- a/Tiles/FurnitureOccult/OccultCandelabra.cs +++ b/Tiles/FurnitureOccult/OccultCandelabra.cs @@ -10,7 +10,7 @@ namespace CalamityMod.Tiles.FurnitureOccult { public override void SetDefaults() { - CalamityUtils.SetUpCandelabra(Type); + this.SetUpCandelabra(); ModTranslation name = CreateMapEntryName(); name.SetDefault("Otherworldly Candelabra"); AddMapEntry(new Color(191, 142, 111), name); diff --git a/Tiles/FurnitureOccult/OccultCandle.cs b/Tiles/FurnitureOccult/OccultCandle.cs index b2097555ec..d93b4fb70c 100644 --- a/Tiles/FurnitureOccult/OccultCandle.cs +++ b/Tiles/FurnitureOccult/OccultCandle.cs @@ -10,7 +10,7 @@ namespace CalamityMod.Tiles.FurnitureOccult { public override void SetDefaults() { - CalamityUtils.SetUpCandle(Type); + this.SetUpCandle(); ModTranslation name = CreateMapEntryName(); name.SetDefault("Otherworldly Candle"); AddMapEntry(new Color(191, 142, 111), name); diff --git a/Tiles/FurnitureOccult/OccultChair.cs b/Tiles/FurnitureOccult/OccultChair.cs index 1aedc4ac48..ac96949e67 100644 --- a/Tiles/FurnitureOccult/OccultChair.cs +++ b/Tiles/FurnitureOccult/OccultChair.cs @@ -10,7 +10,7 @@ namespace CalamityMod.Tiles.FurnitureOccult { public override void SetDefaults() { - CalamityUtils.SetUpChair(Type); + this.SetUpChair(); ModTranslation name = CreateMapEntryName(); name.SetDefault("Otherworldly Chair"); AddMapEntry(new Color(191, 142, 111), name); diff --git a/Tiles/FurnitureOccult/OccultChandelier.cs b/Tiles/FurnitureOccult/OccultChandelier.cs index 288fba6a40..0dc8072b9c 100644 --- a/Tiles/FurnitureOccult/OccultChandelier.cs +++ b/Tiles/FurnitureOccult/OccultChandelier.cs @@ -10,7 +10,7 @@ namespace CalamityMod.Tiles.FurnitureOccult { public override void SetDefaults() { - CalamityUtils.SetUpChandelier(Type); + this.SetUpChandelier(); ModTranslation name = CreateMapEntryName(); name.SetDefault("Otherworldly Chandelier"); AddMapEntry(new Color(191, 142, 111), name); diff --git a/Tiles/FurnitureOccult/OccultChest.cs b/Tiles/FurnitureOccult/OccultChest.cs index 875af69443..4caa15b748 100644 --- a/Tiles/FurnitureOccult/OccultChest.cs +++ b/Tiles/FurnitureOccult/OccultChest.cs @@ -10,7 +10,7 @@ namespace CalamityMod.Tiles.FurnitureOccult { public override void SetDefaults() { - CalamityUtils.SetUpChest(Type); + this.SetUpChest(); ModTranslation name = CreateMapEntryName(); name.SetDefault("Otherworldly Chest"); AddMapEntry(new Color(191, 142, 111), name, MapChestName); diff --git a/Tiles/FurnitureOccult/OccultClock.cs b/Tiles/FurnitureOccult/OccultClock.cs index 155c19e9f6..a56246afa8 100644 --- a/Tiles/FurnitureOccult/OccultClock.cs +++ b/Tiles/FurnitureOccult/OccultClock.cs @@ -10,7 +10,7 @@ namespace CalamityMod.Tiles.FurnitureOccult { public override void SetDefaults() { - CalamityUtils.SetUpClock(Type); + this.SetUpClock(); ModTranslation name = CreateMapEntryName(); name.SetDefault("Otherworldly Clock"); AddMapEntry(new Color(191, 142, 111), name); diff --git a/Tiles/FurnitureOccult/OccultDoorClosed.cs b/Tiles/FurnitureOccult/OccultDoorClosed.cs index ff95568ba6..a9cbec9694 100644 --- a/Tiles/FurnitureOccult/OccultDoorClosed.cs +++ b/Tiles/FurnitureOccult/OccultDoorClosed.cs @@ -10,7 +10,7 @@ namespace CalamityMod.Tiles.FurnitureOccult { public override void SetDefaults() { - CalamityUtils.SetUpDoorClosed(Type); + this.SetUpDoorClosed(); ModTranslation name = CreateMapEntryName(); name.SetDefault("Otherworldly Door"); AddMapEntry(new Color(191, 142, 111), name); diff --git a/Tiles/FurnitureOccult/OccultDoorOpen.cs b/Tiles/FurnitureOccult/OccultDoorOpen.cs index 4dd9bacfa3..1f0c91cbd3 100644 --- a/Tiles/FurnitureOccult/OccultDoorOpen.cs +++ b/Tiles/FurnitureOccult/OccultDoorOpen.cs @@ -10,7 +10,7 @@ namespace CalamityMod.Tiles.FurnitureOccult { public override void SetDefaults() { - CalamityUtils.SetUpDoorOpen(Type); + this.SetUpDoorOpen(); ModTranslation name = CreateMapEntryName(); name.SetDefault("Otherworldly Door"); AddMapEntry(new Color(191, 142, 111), name); diff --git a/Tiles/FurnitureOccult/OccultDresser.cs b/Tiles/FurnitureOccult/OccultDresser.cs index 91c46aee4f..796c2e5597 100644 --- a/Tiles/FurnitureOccult/OccultDresser.cs +++ b/Tiles/FurnitureOccult/OccultDresser.cs @@ -10,7 +10,7 @@ namespace CalamityMod.Tiles.FurnitureOccult { public override void SetDefaults() { - CalamityUtils.SetUpDresser(Type); + this.SetUpDresser(); ModTranslation name = CreateMapEntryName(); name.SetDefault("Otherworldly Dresser"); AddMapEntry(new Color(191, 142, 111), name); diff --git a/Tiles/FurnitureOccult/OccultLamp.cs b/Tiles/FurnitureOccult/OccultLamp.cs index 649da26855..27bc92a8c7 100644 --- a/Tiles/FurnitureOccult/OccultLamp.cs +++ b/Tiles/FurnitureOccult/OccultLamp.cs @@ -10,7 +10,7 @@ namespace CalamityMod.Tiles.FurnitureOccult { public override void SetDefaults() { - CalamityUtils.SetUpLamp(Type); + this.SetUpLamp(); ModTranslation name = CreateMapEntryName(); name.SetDefault("Otherworldly Lamp"); AddMapEntry(new Color(191, 142, 111), name); diff --git a/Tiles/FurnitureOccult/OccultLantern.cs b/Tiles/FurnitureOccult/OccultLantern.cs index 532734b466..6f5ac699e5 100644 --- a/Tiles/FurnitureOccult/OccultLantern.cs +++ b/Tiles/FurnitureOccult/OccultLantern.cs @@ -10,7 +10,7 @@ namespace CalamityMod.Tiles.FurnitureOccult { public override void SetDefaults() { - CalamityUtils.SetUpLantern(Type); + this.SetUpLantern(); ModTranslation name = CreateMapEntryName(); name.SetDefault("Otherworldly Lantern"); AddMapEntry(new Color(191, 142, 111), name); diff --git a/Tiles/FurnitureOccult/OccultPiano.cs b/Tiles/FurnitureOccult/OccultPiano.cs index 71891ccda0..70beaf1e72 100644 --- a/Tiles/FurnitureOccult/OccultPiano.cs +++ b/Tiles/FurnitureOccult/OccultPiano.cs @@ -8,7 +8,7 @@ namespace CalamityMod.Tiles.FurnitureOccult { public override void SetDefaults() { - CalamityUtils.SetUpPiano(Type); + this.SetUpPiano(); ModTranslation name = CreateMapEntryName(); name.SetDefault("Otherworldly Piano"); AddMapEntry(new Color(191, 142, 111), name); diff --git a/Tiles/FurnitureOccult/OccultPlatform.cs b/Tiles/FurnitureOccult/OccultPlatform.cs index ba5752bd12..f765779440 100644 --- a/Tiles/FurnitureOccult/OccultPlatform.cs +++ b/Tiles/FurnitureOccult/OccultPlatform.cs @@ -10,7 +10,7 @@ namespace CalamityMod.Tiles.FurnitureOccult { public override void SetDefaults() { - CalamityUtils.SetUpPlatform(Type); + this.SetUpPlatform(); AddMapEntry(new Color(191, 142, 111)); drop = ModContent.ItemType(); disableSmartCursor = true; diff --git a/Tiles/FurnitureOccult/OccultSink.cs b/Tiles/FurnitureOccult/OccultSink.cs index debf1a8cd1..bd76b59ebe 100644 --- a/Tiles/FurnitureOccult/OccultSink.cs +++ b/Tiles/FurnitureOccult/OccultSink.cs @@ -10,7 +10,7 @@ namespace CalamityMod.Tiles.FurnitureOccult { public override void SetDefaults() { - CalamityUtils.SetUpSink(Type); + this.SetUpSink(); ModTranslation name = CreateMapEntryName(); name.SetDefault("Otherworldly Sink"); AddMapEntry(new Color(191, 142, 111), name); diff --git a/Tiles/FurnitureOccult/OccultSofa.cs b/Tiles/FurnitureOccult/OccultSofa.cs index f99d5a7ac6..33cf7ced49 100644 --- a/Tiles/FurnitureOccult/OccultSofa.cs +++ b/Tiles/FurnitureOccult/OccultSofa.cs @@ -8,7 +8,7 @@ namespace CalamityMod.Tiles.FurnitureOccult { public override void SetDefaults() { - CalamityUtils.SetUpSofa(Type); + this.SetUpSofa(); ModTranslation name = CreateMapEntryName(); name.SetDefault("Otherworldly Sofa"); AddMapEntry(new Color(191, 142, 111), name); diff --git a/Tiles/FurnitureOccult/OccultStone.cs b/Tiles/FurnitureOccult/OccultStone.cs index f004962a26..920adf1bd6 100644 --- a/Tiles/FurnitureOccult/OccultStone.cs +++ b/Tiles/FurnitureOccult/OccultStone.cs @@ -16,9 +16,9 @@ namespace CalamityMod.Tiles.FurnitureOccult Main.tileMergeDirt[Type] = false; Main.tileBlockLight[Type] = true; - TileMerge.MergeGeneralTiles(Type); - TileMerge.MergeDecorativeTiles(Type); - TileMerge.MergeSmoothTiles(Type); + CalamityUtils.MergeWithGeneral(Type); + CalamityUtils.MergeDecorativeTiles(Type); + CalamityUtils.MergeSmoothTiles(Type); soundType = 21; mineResist = 10f; diff --git a/Tiles/FurnitureOccult/OccultTable.cs b/Tiles/FurnitureOccult/OccultTable.cs index 175b7870f1..cf00a26d5b 100644 --- a/Tiles/FurnitureOccult/OccultTable.cs +++ b/Tiles/FurnitureOccult/OccultTable.cs @@ -10,7 +10,7 @@ namespace CalamityMod.Tiles.FurnitureOccult { public override void SetDefaults() { - CalamityUtils.SetUpTable(Type); + this.SetUpTable(); ModTranslation name = CreateMapEntryName(); name.SetDefault("Otherworldly Table"); AddMapEntry(new Color(191, 142, 111), name); diff --git a/Tiles/FurnitureOccult/OccultWorkbench.cs b/Tiles/FurnitureOccult/OccultWorkbench.cs index dcaa8b5f76..bbe6141914 100644 --- a/Tiles/FurnitureOccult/OccultWorkbench.cs +++ b/Tiles/FurnitureOccult/OccultWorkbench.cs @@ -10,7 +10,7 @@ namespace CalamityMod.Tiles.FurnitureOccult { public override void SetDefaults() { - CalamityUtils.SetUpWorkBench(Type); + this.SetUpWorkBench(); ModTranslation name = CreateMapEntryName(); name.SetDefault("Otherworldly Work Bench"); AddMapEntry(new Color(191, 142, 111), name); diff --git a/Tiles/FurniturePlaguedPlate/PlaguedPlate.cs b/Tiles/FurniturePlaguedPlate/PlaguedPlate.cs index 72ecf2f5f8..377e26ef99 100644 --- a/Tiles/FurniturePlaguedPlate/PlaguedPlate.cs +++ b/Tiles/FurniturePlaguedPlate/PlaguedPlate.cs @@ -31,7 +31,7 @@ namespace CalamityMod.Tiles.FurniturePlaguedPlate public override bool TileFrame(int i, int j, ref bool resetFrame, ref bool noBreak) { - return CustomTileFraming.BrimstoneFraming(i, j, resetFrame); + return TileFraming.BrimstoneFraming(i, j, resetFrame); } public override void PostDraw(int i, int j, SpriteBatch spriteBatch) diff --git a/Tiles/FurniturePlaguedPlate/PlaguedPlateBathtub.cs b/Tiles/FurniturePlaguedPlate/PlaguedPlateBathtub.cs index 5d51d6725a..a5d139863c 100644 --- a/Tiles/FurniturePlaguedPlate/PlaguedPlateBathtub.cs +++ b/Tiles/FurniturePlaguedPlate/PlaguedPlateBathtub.cs @@ -7,7 +7,7 @@ namespace CalamityMod.Tiles.FurniturePlaguedPlate { public override void SetDefaults() { - CalamityUtils.SetUpBathtub(Type); + this.SetUpBathtub(); ModTranslation name = CreateMapEntryName(); name.SetDefault("Plagued Plate Bathtub"); AddMapEntry(new Color(191, 142, 111), name); diff --git a/Tiles/FurniturePlaguedPlate/PlaguedPlateBookcase.cs b/Tiles/FurniturePlaguedPlate/PlaguedPlateBookcase.cs index ebe4057dde..c5a3caaddf 100644 --- a/Tiles/FurniturePlaguedPlate/PlaguedPlateBookcase.cs +++ b/Tiles/FurniturePlaguedPlate/PlaguedPlateBookcase.cs @@ -9,7 +9,7 @@ namespace CalamityMod.Tiles.FurniturePlaguedPlate { public override void SetDefaults() { - CalamityUtils.SetUpBookcase(Type); + this.SetUpBookcase(); ModTranslation name = CreateMapEntryName(); name.SetDefault("Plagued Plate Bookcase"); AddMapEntry(new Color(191, 142, 111), name); diff --git a/Tiles/FurniturePlaguedPlate/PlaguedPlateCandelabra.cs b/Tiles/FurniturePlaguedPlate/PlaguedPlateCandelabra.cs index a111cb0b19..cdd3bce422 100644 --- a/Tiles/FurniturePlaguedPlate/PlaguedPlateCandelabra.cs +++ b/Tiles/FurniturePlaguedPlate/PlaguedPlateCandelabra.cs @@ -9,7 +9,7 @@ namespace CalamityMod.Tiles.FurniturePlaguedPlate { public override void SetDefaults() { - CalamityUtils.SetUpCandelabra(Type); + this.SetUpCandelabra(); ModTranslation name = CreateMapEntryName(); name.SetDefault("Plagued Plate Candelabra"); AddMapEntry(new Color(191, 142, 111), name); diff --git a/Tiles/FurniturePlaguedPlate/PlaguedPlateCandle.cs b/Tiles/FurniturePlaguedPlate/PlaguedPlateCandle.cs index a9e2cd7e09..415c4c5eb8 100644 --- a/Tiles/FurniturePlaguedPlate/PlaguedPlateCandle.cs +++ b/Tiles/FurniturePlaguedPlate/PlaguedPlateCandle.cs @@ -9,7 +9,7 @@ namespace CalamityMod.Tiles.FurniturePlaguedPlate { public override void SetDefaults() { - CalamityUtils.SetUpCandle(Type); + this.SetUpCandle(); ModTranslation name = CreateMapEntryName(); name.SetDefault("Plagued Plate Candle"); AddMapEntry(new Color(191, 142, 111), name); diff --git a/Tiles/FurniturePlaguedPlate/PlaguedPlateChair.cs b/Tiles/FurniturePlaguedPlate/PlaguedPlateChair.cs index d76f872ae4..fad963fbc4 100644 --- a/Tiles/FurniturePlaguedPlate/PlaguedPlateChair.cs +++ b/Tiles/FurniturePlaguedPlate/PlaguedPlateChair.cs @@ -9,7 +9,7 @@ namespace CalamityMod.Tiles.FurniturePlaguedPlate { public override void SetDefaults() { - CalamityUtils.SetUpChair(Type); + this.SetUpChair(); ModTranslation name = CreateMapEntryName(); name.SetDefault("Plagued Plate Chair"); AddMapEntry(new Color(191, 142, 111), name); diff --git a/Tiles/FurniturePlaguedPlate/PlaguedPlateChandelier.cs b/Tiles/FurniturePlaguedPlate/PlaguedPlateChandelier.cs index 7298cb1179..858b3573d8 100644 --- a/Tiles/FurniturePlaguedPlate/PlaguedPlateChandelier.cs +++ b/Tiles/FurniturePlaguedPlate/PlaguedPlateChandelier.cs @@ -9,7 +9,7 @@ namespace CalamityMod.Tiles.FurniturePlaguedPlate { public override void SetDefaults() { - CalamityUtils.SetUpChandelier(Type); + this.SetUpChandelier(); ModTranslation name = CreateMapEntryName(); name.SetDefault("Plagued Plate Chandelier"); AddMapEntry(new Color(191, 142, 111), name); diff --git a/Tiles/FurniturePlaguedPlate/PlaguedPlateChest.cs b/Tiles/FurniturePlaguedPlate/PlaguedPlateChest.cs index 6aca75bd8f..3cb997487f 100644 --- a/Tiles/FurniturePlaguedPlate/PlaguedPlateChest.cs +++ b/Tiles/FurniturePlaguedPlate/PlaguedPlateChest.cs @@ -9,7 +9,7 @@ namespace CalamityMod.Tiles.FurniturePlaguedPlate { public override void SetDefaults() { - CalamityUtils.SetUpChest(Type); + this.SetUpChest(); ModTranslation name = CreateMapEntryName(); name.SetDefault("Plagued Plate Chest"); AddMapEntry(new Color(191, 142, 111), name, MapChestName); diff --git a/Tiles/FurniturePlaguedPlate/PlaguedPlateClock.cs b/Tiles/FurniturePlaguedPlate/PlaguedPlateClock.cs index 5c7436753f..e5561e60ad 100644 --- a/Tiles/FurniturePlaguedPlate/PlaguedPlateClock.cs +++ b/Tiles/FurniturePlaguedPlate/PlaguedPlateClock.cs @@ -9,7 +9,7 @@ namespace CalamityMod.Tiles.FurniturePlaguedPlate { public override void SetDefaults() { - CalamityUtils.SetUpClock(Type); + this.SetUpClock(); ModTranslation name = CreateMapEntryName(); name.SetDefault("Plagued Plate Clock"); AddMapEntry(new Color(191, 142, 111), name); diff --git a/Tiles/FurniturePlaguedPlate/PlaguedPlateDoorClosed.cs b/Tiles/FurniturePlaguedPlate/PlaguedPlateDoorClosed.cs index ceb769d604..d963e78f62 100644 --- a/Tiles/FurniturePlaguedPlate/PlaguedPlateDoorClosed.cs +++ b/Tiles/FurniturePlaguedPlate/PlaguedPlateDoorClosed.cs @@ -9,7 +9,7 @@ namespace CalamityMod.Tiles.FurniturePlaguedPlate { public override void SetDefaults() { - CalamityUtils.SetUpDoorClosed(Type); + this.SetUpDoorClosed(); ModTranslation name = CreateMapEntryName(); name.SetDefault("Plagued Plate Door"); AddMapEntry(new Color(191, 142, 111), name); diff --git a/Tiles/FurniturePlaguedPlate/PlaguedPlateDoorOpen.cs b/Tiles/FurniturePlaguedPlate/PlaguedPlateDoorOpen.cs index 6db6af02ee..42cccce9ea 100644 --- a/Tiles/FurniturePlaguedPlate/PlaguedPlateDoorOpen.cs +++ b/Tiles/FurniturePlaguedPlate/PlaguedPlateDoorOpen.cs @@ -9,7 +9,7 @@ namespace CalamityMod.Tiles.FurniturePlaguedPlate { public override void SetDefaults() { - CalamityUtils.SetUpDoorOpen(Type); + this.SetUpDoorOpen(); ModTranslation name = CreateMapEntryName(); name.SetDefault("Plagued Plate Door"); AddMapEntry(new Color(191, 142, 111), name); diff --git a/Tiles/FurniturePlaguedPlate/PlaguedPlateDresser.cs b/Tiles/FurniturePlaguedPlate/PlaguedPlateDresser.cs index 5d113a4dcb..4f5605ba8a 100644 --- a/Tiles/FurniturePlaguedPlate/PlaguedPlateDresser.cs +++ b/Tiles/FurniturePlaguedPlate/PlaguedPlateDresser.cs @@ -9,7 +9,7 @@ namespace CalamityMod.Tiles.FurniturePlaguedPlate { public override void SetDefaults() { - CalamityUtils.SetUpDresser(Type); + this.SetUpDresser(); ModTranslation name = CreateMapEntryName(); name.SetDefault("Plagued Plate Dresser"); AddMapEntry(new Color(191, 142, 111), name); diff --git a/Tiles/FurniturePlaguedPlate/PlaguedPlateLamp.cs b/Tiles/FurniturePlaguedPlate/PlaguedPlateLamp.cs index 6b33f9f630..f45aba7e55 100644 --- a/Tiles/FurniturePlaguedPlate/PlaguedPlateLamp.cs +++ b/Tiles/FurniturePlaguedPlate/PlaguedPlateLamp.cs @@ -9,7 +9,7 @@ namespace CalamityMod.Tiles.FurniturePlaguedPlate { public override void SetDefaults() { - CalamityUtils.SetUpLamp(Type); + this.SetUpLamp(); ModTranslation name = CreateMapEntryName(); name.SetDefault("Plagued Plate Lamp"); AddMapEntry(new Color(191, 142, 111), name); diff --git a/Tiles/FurniturePlaguedPlate/PlaguedPlateLantern.cs b/Tiles/FurniturePlaguedPlate/PlaguedPlateLantern.cs index 3e29ecb079..63a827087b 100644 --- a/Tiles/FurniturePlaguedPlate/PlaguedPlateLantern.cs +++ b/Tiles/FurniturePlaguedPlate/PlaguedPlateLantern.cs @@ -9,7 +9,7 @@ namespace CalamityMod.Tiles.FurniturePlaguedPlate { public override void SetDefaults() { - CalamityUtils.SetUpLantern(Type); + this.SetUpLantern(); ModTranslation name = CreateMapEntryName(); name.SetDefault("Plagued Plate Lantern"); AddMapEntry(new Color(191, 142, 111), name); diff --git a/Tiles/FurniturePlaguedPlate/PlaguedPlatePiano.cs b/Tiles/FurniturePlaguedPlate/PlaguedPlatePiano.cs index bf895ae112..1e5df8f95c 100644 --- a/Tiles/FurniturePlaguedPlate/PlaguedPlatePiano.cs +++ b/Tiles/FurniturePlaguedPlate/PlaguedPlatePiano.cs @@ -7,7 +7,7 @@ namespace CalamityMod.Tiles.FurniturePlaguedPlate { public override void SetDefaults() { - CalamityUtils.SetUpPiano(Type); + this.SetUpPiano(); ModTranslation name = CreateMapEntryName(); name.SetDefault("Plagued Plate Piano"); AddMapEntry(new Color(191, 142, 111), name); diff --git a/Tiles/FurniturePlaguedPlate/PlaguedPlatePlatform.cs b/Tiles/FurniturePlaguedPlate/PlaguedPlatePlatform.cs index 8bdf31a690..d0382cc708 100644 --- a/Tiles/FurniturePlaguedPlate/PlaguedPlatePlatform.cs +++ b/Tiles/FurniturePlaguedPlate/PlaguedPlatePlatform.cs @@ -9,7 +9,7 @@ namespace CalamityMod.Tiles.FurniturePlaguedPlate { public override void SetDefaults() { - CalamityUtils.SetUpPlatform(Type); + this.SetUpPlatform(); AddMapEntry(new Color(191, 142, 111)); drop = ModContent.ItemType(); disableSmartCursor = true; diff --git a/Tiles/FurniturePlaguedPlate/PlaguedPlateSink.cs b/Tiles/FurniturePlaguedPlate/PlaguedPlateSink.cs index f2be54e0bb..4c08be7b27 100644 --- a/Tiles/FurniturePlaguedPlate/PlaguedPlateSink.cs +++ b/Tiles/FurniturePlaguedPlate/PlaguedPlateSink.cs @@ -9,7 +9,7 @@ namespace CalamityMod.Tiles.FurniturePlaguedPlate { public override void SetDefaults() { - CalamityUtils.SetUpSink(Type); + this.SetUpSink(); ModTranslation name = CreateMapEntryName(); name.SetDefault("Plagued Plate Sink"); AddMapEntry(new Color(191, 142, 111), name); diff --git a/Tiles/FurniturePlaguedPlate/PlaguedPlateSofa.cs b/Tiles/FurniturePlaguedPlate/PlaguedPlateSofa.cs index 27b2fd79bc..92d2aed8b4 100644 --- a/Tiles/FurniturePlaguedPlate/PlaguedPlateSofa.cs +++ b/Tiles/FurniturePlaguedPlate/PlaguedPlateSofa.cs @@ -7,7 +7,7 @@ namespace CalamityMod.Tiles.FurniturePlaguedPlate { public override void SetDefaults() { - CalamityUtils.SetUpSofa(Type); + this.SetUpSofa(); ModTranslation name = CreateMapEntryName(); name.SetDefault("Plagued Plate Sofa"); AddMapEntry(new Color(191, 142, 111), name); diff --git a/Tiles/FurniturePlaguedPlate/PlaguedPlateTable.cs b/Tiles/FurniturePlaguedPlate/PlaguedPlateTable.cs index 053f4e5d47..5b8dfd2a37 100644 --- a/Tiles/FurniturePlaguedPlate/PlaguedPlateTable.cs +++ b/Tiles/FurniturePlaguedPlate/PlaguedPlateTable.cs @@ -9,7 +9,7 @@ namespace CalamityMod.Tiles.FurniturePlaguedPlate { public override void SetDefaults() { - CalamityUtils.SetUpTable(Type); + this.SetUpTable(); ModTranslation name = CreateMapEntryName(); name.SetDefault("Plagued Plate Table"); AddMapEntry(new Color(191, 142, 111), name); diff --git a/Tiles/FurniturePlaguedPlate/PlaguedPlateWorkbench.cs b/Tiles/FurniturePlaguedPlate/PlaguedPlateWorkbench.cs index 5e05608cf7..8270c355f0 100644 --- a/Tiles/FurniturePlaguedPlate/PlaguedPlateWorkbench.cs +++ b/Tiles/FurniturePlaguedPlate/PlaguedPlateWorkbench.cs @@ -9,7 +9,7 @@ namespace CalamityMod.Tiles.FurniturePlaguedPlate { public override void SetDefaults() { - CalamityUtils.SetUpWorkBench(Type); + this.SetUpWorkBench(); ModTranslation name = CreateMapEntryName(); name.SetDefault("Plagued Plate Work Bench"); AddMapEntry(new Color(191, 142, 111), name); diff --git a/Tiles/FurnitureProfaned/ProfanedBath.cs b/Tiles/FurnitureProfaned/ProfanedBath.cs index d315dd238e..f9efa50b3e 100644 --- a/Tiles/FurnitureProfaned/ProfanedBath.cs +++ b/Tiles/FurnitureProfaned/ProfanedBath.cs @@ -8,7 +8,7 @@ namespace CalamityMod.Tiles.FurnitureProfaned { public override void SetDefaults() { - CalamityUtils.SetUpBathtub(Type); + this.SetUpBathtub(); ModTranslation name = CreateMapEntryName(); name.SetDefault("Profaned Bathtub"); AddMapEntry(new Color(191, 142, 111), name); diff --git a/Tiles/FurnitureProfaned/ProfanedBed.cs b/Tiles/FurnitureProfaned/ProfanedBed.cs index 04949d85a1..921ba7fa2c 100644 --- a/Tiles/FurnitureProfaned/ProfanedBed.cs +++ b/Tiles/FurnitureProfaned/ProfanedBed.cs @@ -10,7 +10,7 @@ namespace CalamityMod.Tiles.FurnitureProfaned { public override void SetDefaults() { - CalamityUtils.SetUpBed(Type); + this.SetUpBed(); ModTranslation name = CreateMapEntryName(); name.SetDefault("Profaned Bed"); AddMapEntry(new Color(191, 142, 111), name); diff --git a/Tiles/FurnitureProfaned/ProfanedBench.cs b/Tiles/FurnitureProfaned/ProfanedBench.cs index 146bf21aca..045ad834ba 100644 --- a/Tiles/FurnitureProfaned/ProfanedBench.cs +++ b/Tiles/FurnitureProfaned/ProfanedBench.cs @@ -8,7 +8,7 @@ namespace CalamityMod.Tiles.FurnitureProfaned { public override void SetDefaults() { - CalamityUtils.SetUpSofa(Type); + this.SetUpSofa(); ModTranslation name = CreateMapEntryName(); name.SetDefault("Profaned Bench"); AddMapEntry(new Color(191, 142, 111), name); diff --git a/Tiles/FurnitureProfaned/ProfanedBookcase.cs b/Tiles/FurnitureProfaned/ProfanedBookcase.cs index 66e2f3c73e..a5b6bca7d8 100644 --- a/Tiles/FurnitureProfaned/ProfanedBookcase.cs +++ b/Tiles/FurnitureProfaned/ProfanedBookcase.cs @@ -10,7 +10,7 @@ namespace CalamityMod.Tiles.FurnitureProfaned { public override void SetDefaults() { - CalamityUtils.SetUpBookcase(Type); + this.SetUpBookcase(); ModTranslation name = CreateMapEntryName(); name.SetDefault("Profaned Bookcase"); AddMapEntry(new Color(191, 142, 111), name); diff --git a/Tiles/FurnitureProfaned/ProfanedCandelabra.cs b/Tiles/FurnitureProfaned/ProfanedCandelabra.cs index 8b2d384034..2bdf665ab9 100644 --- a/Tiles/FurnitureProfaned/ProfanedCandelabra.cs +++ b/Tiles/FurnitureProfaned/ProfanedCandelabra.cs @@ -10,7 +10,7 @@ namespace CalamityMod.Tiles.FurnitureProfaned { public override void SetDefaults() { - CalamityUtils.SetUpCandelabra(Type); + this.SetUpCandelabra(); ModTranslation name = CreateMapEntryName(); name.SetDefault("Profaned Candelabra"); AddMapEntry(new Color(191, 142, 111), name); diff --git a/Tiles/FurnitureProfaned/ProfanedCandle.cs b/Tiles/FurnitureProfaned/ProfanedCandle.cs index cd8b815ef2..189d0dc099 100644 --- a/Tiles/FurnitureProfaned/ProfanedCandle.cs +++ b/Tiles/FurnitureProfaned/ProfanedCandle.cs @@ -10,7 +10,7 @@ namespace CalamityMod.Tiles.FurnitureProfaned { public override void SetDefaults() { - CalamityUtils.SetUpCandle(Type); + this.SetUpCandle(); ModTranslation name = CreateMapEntryName(); name.SetDefault("Profaned Candle"); AddMapEntry(new Color(191, 142, 111), name); diff --git a/Tiles/FurnitureProfaned/ProfanedChair.cs b/Tiles/FurnitureProfaned/ProfanedChair.cs index 2c25f6f5fa..8aefc380f3 100644 --- a/Tiles/FurnitureProfaned/ProfanedChair.cs +++ b/Tiles/FurnitureProfaned/ProfanedChair.cs @@ -10,7 +10,7 @@ namespace CalamityMod.Tiles.FurnitureProfaned { public override void SetDefaults() { - CalamityUtils.SetUpChair(Type); + this.SetUpChair(); ModTranslation name = CreateMapEntryName(); name.SetDefault("Profaned Chair"); AddMapEntry(new Color(191, 142, 111), name); diff --git a/Tiles/FurnitureProfaned/ProfanedChandelier.cs b/Tiles/FurnitureProfaned/ProfanedChandelier.cs index 51cff1d059..4af1e58b3c 100644 --- a/Tiles/FurnitureProfaned/ProfanedChandelier.cs +++ b/Tiles/FurnitureProfaned/ProfanedChandelier.cs @@ -10,7 +10,7 @@ namespace CalamityMod.Tiles.FurnitureProfaned { public override void SetDefaults() { - CalamityUtils.SetUpChandelier(Type); + this.SetUpChandelier(); ModTranslation name = CreateMapEntryName(); name.SetDefault("Profaned Chandelier"); AddMapEntry(new Color(191, 142, 111), name); @@ -52,7 +52,7 @@ namespace CalamityMod.Tiles.FurnitureProfaned public override void HitWire(int i, int j) { - CalamityUtils.SetUpChandelier(Type); + this.SetUpChandelier(); } } } diff --git a/Tiles/FurnitureProfaned/ProfanedChest.cs b/Tiles/FurnitureProfaned/ProfanedChest.cs index 4f9ab2872b..79dce48340 100644 --- a/Tiles/FurnitureProfaned/ProfanedChest.cs +++ b/Tiles/FurnitureProfaned/ProfanedChest.cs @@ -10,7 +10,7 @@ namespace CalamityMod.Tiles.FurnitureProfaned { public override void SetDefaults() { - CalamityUtils.SetUpChest(Type); + this.SetUpChest(); ModTranslation name = CreateMapEntryName(); name.SetDefault("Profaned Chest"); AddMapEntry(new Color(191, 142, 111), name, MapChestName); diff --git a/Tiles/FurnitureProfaned/ProfanedClock.cs b/Tiles/FurnitureProfaned/ProfanedClock.cs index b59a16b648..26e2ab6612 100644 --- a/Tiles/FurnitureProfaned/ProfanedClock.cs +++ b/Tiles/FurnitureProfaned/ProfanedClock.cs @@ -10,7 +10,7 @@ namespace CalamityMod.Tiles.FurnitureProfaned { public override void SetDefaults() { - CalamityUtils.SetUpClock(Type); + this.SetUpClock(); ModTranslation name = CreateMapEntryName(); name.SetDefault("Profaned Clock"); AddMapEntry(new Color(191, 142, 111), name); diff --git a/Tiles/FurnitureProfaned/ProfanedCrystal.cs b/Tiles/FurnitureProfaned/ProfanedCrystal.cs index 655aa8650e..418edb3b5c 100644 --- a/Tiles/FurnitureProfaned/ProfanedCrystal.cs +++ b/Tiles/FurnitureProfaned/ProfanedCrystal.cs @@ -14,9 +14,9 @@ namespace CalamityMod.Tiles.FurnitureProfaned Main.tileNoAttach[Type] = true; Main.tileBlockLight[Type] = true; - TileMerge.MergeGeneralTiles(Type); - TileMerge.MergeDecorativeTiles(Type); - TileMerge.MergeSmoothTiles(Type); + CalamityUtils.MergeWithGeneral(Type); + CalamityUtils.MergeDecorativeTiles(Type); + CalamityUtils.MergeSmoothTiles(Type); soundType = 13; mineResist = 1f; @@ -27,7 +27,7 @@ namespace CalamityMod.Tiles.FurnitureProfaned public override bool TileFrame(int i, int j, ref bool resetFrame, ref bool noBreak) { - return CustomTileFraming.BetterGemsparkFraming(i, j, resetFrame); + return TileFraming.BetterGemsparkFraming(i, j, resetFrame); } public override bool CreateDust(int i, int j, ref int type) diff --git a/Tiles/FurnitureProfaned/ProfanedDoorClosed.cs b/Tiles/FurnitureProfaned/ProfanedDoorClosed.cs index dfc7558ab7..be0956c8e6 100644 --- a/Tiles/FurnitureProfaned/ProfanedDoorClosed.cs +++ b/Tiles/FurnitureProfaned/ProfanedDoorClosed.cs @@ -10,7 +10,7 @@ namespace CalamityMod.Tiles.FurnitureProfaned { public override void SetDefaults() { - CalamityUtils.SetUpDoorClosed(Type); + this.SetUpDoorClosed(); ModTranslation name = CreateMapEntryName(); name.SetDefault("Profaned Door"); AddMapEntry(new Color(191, 142, 111), name); diff --git a/Tiles/FurnitureProfaned/ProfanedDoorOpen.cs b/Tiles/FurnitureProfaned/ProfanedDoorOpen.cs index a4756e63e1..377154f463 100644 --- a/Tiles/FurnitureProfaned/ProfanedDoorOpen.cs +++ b/Tiles/FurnitureProfaned/ProfanedDoorOpen.cs @@ -10,7 +10,7 @@ namespace CalamityMod.Tiles.FurnitureProfaned { public override void SetDefaults() { - CalamityUtils.SetUpDoorOpen(Type); + this.SetUpDoorOpen(); ModTranslation name = CreateMapEntryName(); name.SetDefault("Profaned Door"); AddMapEntry(new Color(191, 142, 111), name); diff --git a/Tiles/FurnitureProfaned/ProfanedDresser.cs b/Tiles/FurnitureProfaned/ProfanedDresser.cs index 54d5e3fede..92fedcb671 100644 --- a/Tiles/FurnitureProfaned/ProfanedDresser.cs +++ b/Tiles/FurnitureProfaned/ProfanedDresser.cs @@ -10,7 +10,7 @@ namespace CalamityMod.Tiles.FurnitureProfaned { public override void SetDefaults() { - CalamityUtils.SetUpDresser(Type); + this.SetUpDresser(); ModTranslation name = CreateMapEntryName(); name.SetDefault("Profaned Dresser"); AddMapEntry(new Color(191, 142, 111), name); diff --git a/Tiles/FurnitureProfaned/ProfanedLamp.cs b/Tiles/FurnitureProfaned/ProfanedLamp.cs index 5ea676f6af..7b1bf3d349 100644 --- a/Tiles/FurnitureProfaned/ProfanedLamp.cs +++ b/Tiles/FurnitureProfaned/ProfanedLamp.cs @@ -10,7 +10,7 @@ namespace CalamityMod.Tiles.FurnitureProfaned { public override void SetDefaults() { - CalamityUtils.SetUpLamp(Type); + this.SetUpLamp(); ModTranslation name = CreateMapEntryName(); name.SetDefault("Profaned Lamp"); AddMapEntry(new Color(191, 142, 111), name); diff --git a/Tiles/FurnitureProfaned/ProfanedLantern.cs b/Tiles/FurnitureProfaned/ProfanedLantern.cs index 948e03bccc..84047300d9 100644 --- a/Tiles/FurnitureProfaned/ProfanedLantern.cs +++ b/Tiles/FurnitureProfaned/ProfanedLantern.cs @@ -10,7 +10,7 @@ namespace CalamityMod.Tiles.FurnitureProfaned { public override void SetDefaults() { - CalamityUtils.SetUpLantern(Type); + this.SetUpLantern(); ModTranslation name = CreateMapEntryName(); name.SetDefault("Profaned Lantern"); AddMapEntry(new Color(191, 142, 111), name); diff --git a/Tiles/FurnitureProfaned/ProfanedPlatform.cs b/Tiles/FurnitureProfaned/ProfanedPlatform.cs index b2ba6d6edd..28765ecb82 100644 --- a/Tiles/FurnitureProfaned/ProfanedPlatform.cs +++ b/Tiles/FurnitureProfaned/ProfanedPlatform.cs @@ -10,7 +10,7 @@ namespace CalamityMod.Tiles.FurnitureProfaned { public override void SetDefaults() { - CalamityUtils.SetUpPlatform(Type); + this.SetUpPlatform(); AddMapEntry(new Color(191, 142, 111)); drop = ModContent.ItemType(); disableSmartCursor = true; diff --git a/Tiles/FurnitureProfaned/ProfanedRock.cs b/Tiles/FurnitureProfaned/ProfanedRock.cs index 8f8b8f1b51..0b28736693 100644 --- a/Tiles/FurnitureProfaned/ProfanedRock.cs +++ b/Tiles/FurnitureProfaned/ProfanedRock.cs @@ -15,9 +15,9 @@ namespace CalamityMod.Tiles.FurnitureProfaned Main.tileMergeDirt[Type] = true; Main.tileBlockLight[Type] = true; - TileMerge.MergeGeneralTiles(Type); - TileMerge.MergeDecorativeTiles(Type); - TileMerge.MergeSmoothTiles(Type); + CalamityUtils.MergeWithGeneral(Type); + CalamityUtils.MergeDecorativeTiles(Type); + CalamityUtils.MergeSmoothTiles(Type); soundType = 21; mineResist = 4f; diff --git a/Tiles/FurnitureProfaned/ProfanedSink.cs b/Tiles/FurnitureProfaned/ProfanedSink.cs index 3d80db87d8..3054bb26a1 100644 --- a/Tiles/FurnitureProfaned/ProfanedSink.cs +++ b/Tiles/FurnitureProfaned/ProfanedSink.cs @@ -10,7 +10,7 @@ namespace CalamityMod.Tiles.FurnitureProfaned { public override void SetDefaults() { - CalamityUtils.SetUpSink(Type); + this.SetUpSink(); ModTranslation name = CreateMapEntryName(); name.SetDefault("Profaned Sink"); AddMapEntry(new Color(191, 142, 111), name); diff --git a/Tiles/FurnitureProfaned/ProfanedSlab.cs b/Tiles/FurnitureProfaned/ProfanedSlab.cs index 8431951683..08b7de818c 100644 --- a/Tiles/FurnitureProfaned/ProfanedSlab.cs +++ b/Tiles/FurnitureProfaned/ProfanedSlab.cs @@ -13,10 +13,10 @@ namespace CalamityMod.Tiles.FurnitureProfaned Main.tileSolid[Type] = true; Main.tileBlockLight[Type] = true; - TileMerge.MergeGeneralTiles(Type); - TileMerge.MergeDecorativeTiles(Type); - TileMerge.MergeSmoothTiles(Type); - TileMerge.MergeTile(Type, ModContent.TileType()); + CalamityUtils.MergeWithGeneral(Type); + CalamityUtils.MergeDecorativeTiles(Type); + CalamityUtils.MergeSmoothTiles(Type); + CalamityUtils.SetMerge(Type, ModContent.TileType()); soundType = 21; mineResist = 4f; diff --git a/Tiles/FurnitureProfaned/ProfanedTable.cs b/Tiles/FurnitureProfaned/ProfanedTable.cs index 40c471287c..2585599ab9 100644 --- a/Tiles/FurnitureProfaned/ProfanedTable.cs +++ b/Tiles/FurnitureProfaned/ProfanedTable.cs @@ -10,7 +10,7 @@ namespace CalamityMod.Tiles.FurnitureProfaned { public override void SetDefaults() { - CalamityUtils.SetUpTable(Type); + this.SetUpTable(); ModTranslation name = CreateMapEntryName(); name.SetDefault("Profaned Table"); AddMapEntry(new Color(191, 142, 111), name); diff --git a/Tiles/FurnitureProfaned/ProfanedWorkbench.cs b/Tiles/FurnitureProfaned/ProfanedWorkbench.cs index 68ca679f5c..9036aa2f7a 100644 --- a/Tiles/FurnitureProfaned/ProfanedWorkbench.cs +++ b/Tiles/FurnitureProfaned/ProfanedWorkbench.cs @@ -10,7 +10,7 @@ namespace CalamityMod.Tiles.FurnitureProfaned { public override void SetDefaults() { - CalamityUtils.SetUpWorkBench(Type); + this.SetUpWorkBench(); ModTranslation name = CreateMapEntryName(); name.SetDefault("Profaned Work Bench"); AddMapEntry(new Color(191, 142, 111), name); diff --git a/Tiles/FurnitureProfaned/RunicProfanedBrick.cs b/Tiles/FurnitureProfaned/RunicProfanedBrick.cs index 2a20cc9f67..455f53665c 100644 --- a/Tiles/FurnitureProfaned/RunicProfanedBrick.cs +++ b/Tiles/FurnitureProfaned/RunicProfanedBrick.cs @@ -14,9 +14,9 @@ namespace CalamityMod.Tiles.FurnitureProfaned Main.tileSolid[Type] = true; Main.tileBlockLight[Type] = true; - TileMerge.MergeGeneralTiles(Type); - TileMerge.MergeDecorativeTiles(Type); - TileMerge.MergeSmoothTiles(Type); + CalamityUtils.MergeWithGeneral(Type); + CalamityUtils.MergeDecorativeTiles(Type); + CalamityUtils.MergeSmoothTiles(Type); soundType = 21; mineResist = 4f; diff --git a/Tiles/FurnitureSilva/SilvaBathtub.cs b/Tiles/FurnitureSilva/SilvaBathtub.cs index ed3d44ca38..c8639d8718 100644 --- a/Tiles/FurnitureSilva/SilvaBathtub.cs +++ b/Tiles/FurnitureSilva/SilvaBathtub.cs @@ -8,7 +8,7 @@ namespace CalamityMod.Tiles.FurnitureSilva { public override void SetDefaults() { - CalamityUtils.SetUpBathtub(Type); + this.SetUpBathtub(); ModTranslation name = CreateMapEntryName(); name.SetDefault("Silva Bathtub"); AddMapEntry(new Color(191, 142, 111), name); diff --git a/Tiles/FurnitureSilva/SilvaBed.cs b/Tiles/FurnitureSilva/SilvaBed.cs index 79b29383b2..06edbda356 100644 --- a/Tiles/FurnitureSilva/SilvaBed.cs +++ b/Tiles/FurnitureSilva/SilvaBed.cs @@ -10,7 +10,7 @@ namespace CalamityMod.Tiles.FurnitureSilva { public override void SetDefaults() { - CalamityUtils.SetUpBed(Type); + this.SetUpBed(); ModTranslation name = CreateMapEntryName(); name.SetDefault("Silva Bed"); AddMapEntry(new Color(191, 142, 111), name); diff --git a/Tiles/FurnitureSilva/SilvaBench.cs b/Tiles/FurnitureSilva/SilvaBench.cs index ac06dfa210..d170c63c5d 100644 --- a/Tiles/FurnitureSilva/SilvaBench.cs +++ b/Tiles/FurnitureSilva/SilvaBench.cs @@ -8,7 +8,7 @@ namespace CalamityMod.Tiles.FurnitureSilva { public override void SetDefaults() { - CalamityUtils.SetUpSofa(Type); + this.SetUpSofa(); ModTranslation name = CreateMapEntryName(); name.SetDefault("Silva Bench"); AddMapEntry(new Color(191, 142, 111), name); diff --git a/Tiles/FurnitureSilva/SilvaBookcase.cs b/Tiles/FurnitureSilva/SilvaBookcase.cs index 2c85076608..ff6d4c069a 100644 --- a/Tiles/FurnitureSilva/SilvaBookcase.cs +++ b/Tiles/FurnitureSilva/SilvaBookcase.cs @@ -10,7 +10,7 @@ namespace CalamityMod.Tiles.FurnitureSilva { public override void SetDefaults() { - CalamityUtils.SetUpBookcase(Type); + this.SetUpBookcase(); ModTranslation name = CreateMapEntryName(); name.SetDefault("Silva Bookcase"); AddMapEntry(new Color(191, 142, 111), name); diff --git a/Tiles/FurnitureSilva/SilvaCandelabra.cs b/Tiles/FurnitureSilva/SilvaCandelabra.cs index 19a7b1ffad..884da7998e 100644 --- a/Tiles/FurnitureSilva/SilvaCandelabra.cs +++ b/Tiles/FurnitureSilva/SilvaCandelabra.cs @@ -10,7 +10,7 @@ namespace CalamityMod.Tiles.FurnitureSilva { public override void SetDefaults() { - CalamityUtils.SetUpCandelabra(Type); + this.SetUpCandelabra(); ModTranslation name = CreateMapEntryName(); name.SetDefault("Silva Candelabra"); AddMapEntry(new Color(191, 142, 111), name); diff --git a/Tiles/FurnitureSilva/SilvaCandle.cs b/Tiles/FurnitureSilva/SilvaCandle.cs index df9de0257e..17fbf60fbb 100644 --- a/Tiles/FurnitureSilva/SilvaCandle.cs +++ b/Tiles/FurnitureSilva/SilvaCandle.cs @@ -10,7 +10,7 @@ namespace CalamityMod.Tiles.FurnitureSilva { public override void SetDefaults() { - CalamityUtils.SetUpCandle(Type); + this.SetUpCandle(); ModTranslation name = CreateMapEntryName(); name.SetDefault("Silva Candle"); AddMapEntry(new Color(191, 142, 111), name); diff --git a/Tiles/FurnitureSilva/SilvaChair.cs b/Tiles/FurnitureSilva/SilvaChair.cs index 00b295d5ee..079844f226 100644 --- a/Tiles/FurnitureSilva/SilvaChair.cs +++ b/Tiles/FurnitureSilva/SilvaChair.cs @@ -10,7 +10,7 @@ namespace CalamityMod.Tiles.FurnitureSilva { public override void SetDefaults() { - CalamityUtils.SetUpChair(Type); + this.SetUpChair(); ModTranslation name = CreateMapEntryName(); name.SetDefault("Silva Chair"); AddMapEntry(new Color(191, 142, 111), name); diff --git a/Tiles/FurnitureSilva/SilvaChandelier.cs b/Tiles/FurnitureSilva/SilvaChandelier.cs index 6b2f2c4e0a..b1cff31a2a 100644 --- a/Tiles/FurnitureSilva/SilvaChandelier.cs +++ b/Tiles/FurnitureSilva/SilvaChandelier.cs @@ -10,7 +10,7 @@ namespace CalamityMod.Tiles.FurnitureSilva { public override void SetDefaults() { - CalamityUtils.SetUpChandelier(Type); + this.SetUpChandelier(); ModTranslation name = CreateMapEntryName(); name.SetDefault("Silva Chandelier"); AddMapEntry(new Color(191, 142, 111), name); diff --git a/Tiles/FurnitureSilva/SilvaChest.cs b/Tiles/FurnitureSilva/SilvaChest.cs index fa70e41a25..e9154be443 100644 --- a/Tiles/FurnitureSilva/SilvaChest.cs +++ b/Tiles/FurnitureSilva/SilvaChest.cs @@ -10,7 +10,7 @@ namespace CalamityMod.Tiles.FurnitureSilva { public override void SetDefaults() { - CalamityUtils.SetUpChest(Type); + this.SetUpChest(); ModTranslation name = CreateMapEntryName(); name.SetDefault("Silva Chest"); AddMapEntry(new Color(191, 142, 111), name, MapChestName); diff --git a/Tiles/FurnitureSilva/SilvaClock.cs b/Tiles/FurnitureSilva/SilvaClock.cs index c3504da8e8..aebfb1db2b 100644 --- a/Tiles/FurnitureSilva/SilvaClock.cs +++ b/Tiles/FurnitureSilva/SilvaClock.cs @@ -10,7 +10,7 @@ namespace CalamityMod.Tiles.FurnitureSilva { public override void SetDefaults() { - CalamityUtils.SetUpClock(Type); + this.SetUpClock(); ModTranslation name = CreateMapEntryName(); name.SetDefault("Silva Clock"); AddMapEntry(new Color(191, 142, 111), name); diff --git a/Tiles/FurnitureSilva/SilvaCrystal.cs b/Tiles/FurnitureSilva/SilvaCrystal.cs index 2d052997c3..88cdd34d8b 100644 --- a/Tiles/FurnitureSilva/SilvaCrystal.cs +++ b/Tiles/FurnitureSilva/SilvaCrystal.cs @@ -29,7 +29,7 @@ namespace CalamityMod.Tiles.FurnitureSilva public override bool TileFrame(int i, int j, ref bool resetFrame, ref bool noBreak) { - return CustomTileFraming.BetterGemsparkFraming(i, j, resetFrame); + return TileFraming.BetterGemsparkFraming(i, j, resetFrame); } } } diff --git a/Tiles/FurnitureSilva/SilvaDoorClosed.cs b/Tiles/FurnitureSilva/SilvaDoorClosed.cs index 62dcc333d4..8ef1bcc480 100644 --- a/Tiles/FurnitureSilva/SilvaDoorClosed.cs +++ b/Tiles/FurnitureSilva/SilvaDoorClosed.cs @@ -10,7 +10,7 @@ namespace CalamityMod.Tiles.FurnitureSilva { public override void SetDefaults() { - CalamityUtils.SetUpDoorClosed(Type); + this.SetUpDoorClosed(); ModTranslation name = CreateMapEntryName(); name.SetDefault("Silva Door"); AddMapEntry(new Color(191, 142, 111), name); diff --git a/Tiles/FurnitureSilva/SilvaDoorOpen.cs b/Tiles/FurnitureSilva/SilvaDoorOpen.cs index 14f54a1a9f..12ac6f22a3 100644 --- a/Tiles/FurnitureSilva/SilvaDoorOpen.cs +++ b/Tiles/FurnitureSilva/SilvaDoorOpen.cs @@ -10,7 +10,7 @@ namespace CalamityMod.Tiles.FurnitureSilva { public override void SetDefaults() { - CalamityUtils.SetUpDoorOpen(Type); + this.SetUpDoorOpen(); ModTranslation name = CreateMapEntryName(); name.SetDefault("Silva Door"); AddMapEntry(new Color(191, 142, 111), name); diff --git a/Tiles/FurnitureSilva/SilvaDresser.cs b/Tiles/FurnitureSilva/SilvaDresser.cs index c50e001974..66ec338e01 100644 --- a/Tiles/FurnitureSilva/SilvaDresser.cs +++ b/Tiles/FurnitureSilva/SilvaDresser.cs @@ -10,7 +10,7 @@ namespace CalamityMod.Tiles.FurnitureSilva { public override void SetDefaults() { - CalamityUtils.SetUpDresser(Type); + this.SetUpDresser(); ModTranslation name = CreateMapEntryName(); name.SetDefault("Silva Dresser"); AddMapEntry(new Color(191, 142, 111), name); diff --git a/Tiles/FurnitureSilva/SilvaLamp.cs b/Tiles/FurnitureSilva/SilvaLamp.cs index 6d710c53e9..462a8bf893 100644 --- a/Tiles/FurnitureSilva/SilvaLamp.cs +++ b/Tiles/FurnitureSilva/SilvaLamp.cs @@ -10,7 +10,7 @@ namespace CalamityMod.Tiles.FurnitureSilva { public override void SetDefaults() { - CalamityUtils.SetUpLamp(Type); + this.SetUpLamp(); ModTranslation name = CreateMapEntryName(); name.SetDefault("Silva Lamp"); AddMapEntry(new Color(191, 142, 111), name); diff --git a/Tiles/FurnitureSilva/SilvaLantern.cs b/Tiles/FurnitureSilva/SilvaLantern.cs index f77dc68fbd..5e4ff6352a 100644 --- a/Tiles/FurnitureSilva/SilvaLantern.cs +++ b/Tiles/FurnitureSilva/SilvaLantern.cs @@ -10,7 +10,7 @@ namespace CalamityMod.Tiles.FurnitureSilva { public override void SetDefaults() { - CalamityUtils.SetUpLantern(Type); + this.SetUpLantern(); ModTranslation name = CreateMapEntryName(); name.SetDefault("Silva Lantern"); AddMapEntry(new Color(191, 142, 111), name); diff --git a/Tiles/FurnitureSilva/SilvaPiano.cs b/Tiles/FurnitureSilva/SilvaPiano.cs index 7733ba2065..e32301a56f 100644 --- a/Tiles/FurnitureSilva/SilvaPiano.cs +++ b/Tiles/FurnitureSilva/SilvaPiano.cs @@ -8,7 +8,7 @@ namespace CalamityMod.Tiles.FurnitureSilva { public override void SetDefaults() { - CalamityUtils.SetUpPiano(Type); + this.SetUpPiano(); ModTranslation name = CreateMapEntryName(); name.SetDefault("Silva Piano"); AddMapEntry(new Color(191, 142, 111), name); diff --git a/Tiles/FurnitureSilva/SilvaPlatform.cs b/Tiles/FurnitureSilva/SilvaPlatform.cs index 4ea9a542ac..a77404b170 100644 --- a/Tiles/FurnitureSilva/SilvaPlatform.cs +++ b/Tiles/FurnitureSilva/SilvaPlatform.cs @@ -10,7 +10,7 @@ namespace CalamityMod.Tiles.FurnitureSilva { public override void SetDefaults() { - CalamityUtils.SetUpPlatform(Type); + this.SetUpPlatform(); AddMapEntry(new Color(191, 142, 111)); drop = ModContent.ItemType(); disableSmartCursor = true; diff --git a/Tiles/FurnitureSilva/SilvaSink.cs b/Tiles/FurnitureSilva/SilvaSink.cs index 58ab4e6bec..3fc78bf4f3 100644 --- a/Tiles/FurnitureSilva/SilvaSink.cs +++ b/Tiles/FurnitureSilva/SilvaSink.cs @@ -10,7 +10,7 @@ namespace CalamityMod.Tiles.FurnitureSilva { public override void SetDefaults() { - CalamityUtils.SetUpSink(Type); + this.SetUpSink(); ModTranslation name = CreateMapEntryName(); name.SetDefault("Silva Sink"); AddMapEntry(new Color(191, 142, 111), name); diff --git a/Tiles/FurnitureSilva/SilvaTable.cs b/Tiles/FurnitureSilva/SilvaTable.cs index bea06bcaf5..30e9112489 100644 --- a/Tiles/FurnitureSilva/SilvaTable.cs +++ b/Tiles/FurnitureSilva/SilvaTable.cs @@ -10,7 +10,7 @@ namespace CalamityMod.Tiles.FurnitureSilva { public override void SetDefaults() { - CalamityUtils.SetUpTable(Type); + this.SetUpTable(); ModTranslation name = CreateMapEntryName(); name.SetDefault("Silva Table"); AddMapEntry(new Color(191, 142, 111), name); diff --git a/Tiles/FurnitureSilva/SilvaWorkBench.cs b/Tiles/FurnitureSilva/SilvaWorkBench.cs index 636c53343c..ef8cf6f926 100644 --- a/Tiles/FurnitureSilva/SilvaWorkBench.cs +++ b/Tiles/FurnitureSilva/SilvaWorkBench.cs @@ -10,7 +10,7 @@ namespace CalamityMod.Tiles.FurnitureSilva { public override void SetDefaults() { - CalamityUtils.SetUpWorkBench(Type); + this.SetUpWorkBench(); ModTranslation name = CreateMapEntryName(); name.SetDefault("Silva Work Bench"); AddMapEntry(new Color(191, 142, 111), name); diff --git a/Tiles/FurnitureStatigel/StatigelBath.cs b/Tiles/FurnitureStatigel/StatigelBath.cs index 3c0fd349cb..7bac37c391 100644 --- a/Tiles/FurnitureStatigel/StatigelBath.cs +++ b/Tiles/FurnitureStatigel/StatigelBath.cs @@ -7,7 +7,7 @@ namespace CalamityMod.Tiles.FurnitureStatigel { public override void SetDefaults() { - CalamityUtils.SetUpBathtub(Type); + this.SetUpBathtub(); ModTranslation name = CreateMapEntryName(); name.SetDefault("Statigel Bathtub"); AddMapEntry(new Color(191, 142, 111), name); diff --git a/Tiles/FurnitureStatigel/StatigelBed.cs b/Tiles/FurnitureStatigel/StatigelBed.cs index 902b21513e..c40946d7e3 100644 --- a/Tiles/FurnitureStatigel/StatigelBed.cs +++ b/Tiles/FurnitureStatigel/StatigelBed.cs @@ -9,7 +9,7 @@ namespace CalamityMod.Tiles.FurnitureStatigel { public override void SetDefaults() { - CalamityUtils.SetUpBed(Type); + this.SetUpBed(); ModTranslation name = CreateMapEntryName(); name.SetDefault("Statigel Bed"); AddMapEntry(new Color(191, 142, 111), name); diff --git a/Tiles/FurnitureStatigel/StatigelBlock.cs b/Tiles/FurnitureStatigel/StatigelBlock.cs index 6acd70e87c..32290a99c0 100644 --- a/Tiles/FurnitureStatigel/StatigelBlock.cs +++ b/Tiles/FurnitureStatigel/StatigelBlock.cs @@ -12,9 +12,9 @@ namespace CalamityMod.Tiles.FurnitureStatigel Main.tileMergeDirt[Type] = true; Main.tileBlockLight[Type] = true; - TileMerge.MergeGeneralTiles(Type); - TileMerge.MergeDecorativeTiles(Type); - TileMerge.MergeSmoothTiles(Type); + CalamityUtils.MergeWithGeneral(Type); + CalamityUtils.MergeDecorativeTiles(Type); + CalamityUtils.MergeSmoothTiles(Type); drop = ModContent.ItemType(); AddMapEntry(new Color(215, 74, 121)); diff --git a/Tiles/FurnitureStatigel/StatigelBookcase.cs b/Tiles/FurnitureStatigel/StatigelBookcase.cs index f0dc433f44..170fc227f9 100644 --- a/Tiles/FurnitureStatigel/StatigelBookcase.cs +++ b/Tiles/FurnitureStatigel/StatigelBookcase.cs @@ -9,7 +9,7 @@ namespace CalamityMod.Tiles.FurnitureStatigel { public override void SetDefaults() { - CalamityUtils.SetUpBookcase(Type); + this.SetUpBookcase(); ModTranslation name = CreateMapEntryName(); name.SetDefault("Statigel Bookcase"); AddMapEntry(new Color(191, 142, 111), name); diff --git a/Tiles/FurnitureStatigel/StatigelCandelabra.cs b/Tiles/FurnitureStatigel/StatigelCandelabra.cs index fe663096df..8fd0bbf336 100644 --- a/Tiles/FurnitureStatigel/StatigelCandelabra.cs +++ b/Tiles/FurnitureStatigel/StatigelCandelabra.cs @@ -9,7 +9,7 @@ namespace CalamityMod.Tiles.FurnitureStatigel { public override void SetDefaults() { - CalamityUtils.SetUpCandelabra(Type); + this.SetUpCandelabra(); ModTranslation name = CreateMapEntryName(); name.SetDefault("Statigel Candelabra"); AddMapEntry(new Color(191, 142, 111), name); diff --git a/Tiles/FurnitureStatigel/StatigelCandle.cs b/Tiles/FurnitureStatigel/StatigelCandle.cs index 43319b297b..957a19dc20 100644 --- a/Tiles/FurnitureStatigel/StatigelCandle.cs +++ b/Tiles/FurnitureStatigel/StatigelCandle.cs @@ -9,7 +9,7 @@ namespace CalamityMod.Tiles.FurnitureStatigel { public override void SetDefaults() { - CalamityUtils.SetUpCandle(Type); + this.SetUpCandle(); ModTranslation name = CreateMapEntryName(); name.SetDefault("Statigel Candle"); AddMapEntry(new Color(191, 142, 111), name); diff --git a/Tiles/FurnitureStatigel/StatigelChair.cs b/Tiles/FurnitureStatigel/StatigelChair.cs index 5b65a98ea7..269cab3648 100644 --- a/Tiles/FurnitureStatigel/StatigelChair.cs +++ b/Tiles/FurnitureStatigel/StatigelChair.cs @@ -9,7 +9,7 @@ namespace CalamityMod.Tiles.FurnitureStatigel { public override void SetDefaults() { - CalamityUtils.SetUpChair(Type); + this.SetUpChair(); ModTranslation name = CreateMapEntryName(); name.SetDefault("Statigel Chair"); AddMapEntry(new Color(191, 142, 111), name); diff --git a/Tiles/FurnitureStatigel/StatigelChandelier.cs b/Tiles/FurnitureStatigel/StatigelChandelier.cs index c18b875a80..4d1f79d255 100644 --- a/Tiles/FurnitureStatigel/StatigelChandelier.cs +++ b/Tiles/FurnitureStatigel/StatigelChandelier.cs @@ -9,7 +9,7 @@ namespace CalamityMod.Tiles.FurnitureStatigel { public override void SetDefaults() { - CalamityUtils.SetUpChandelier(Type); + this.SetUpChandelier(); ModTranslation name = CreateMapEntryName(); name.SetDefault("Statigel Chandelier"); AddMapEntry(new Color(191, 142, 111), name); diff --git a/Tiles/FurnitureStatigel/StatigelChest.cs b/Tiles/FurnitureStatigel/StatigelChest.cs index 7024b01340..c292d54d0e 100644 --- a/Tiles/FurnitureStatigel/StatigelChest.cs +++ b/Tiles/FurnitureStatigel/StatigelChest.cs @@ -9,7 +9,7 @@ namespace CalamityMod.Tiles.FurnitureStatigel { public override void SetDefaults() { - CalamityUtils.SetUpChest(Type); + this.SetUpChest(); ModTranslation name = CreateMapEntryName(); name.SetDefault("Statigel Chest"); AddMapEntry(new Color(191, 142, 111), name, MapChestName); diff --git a/Tiles/FurnitureStatigel/StatigelClock.cs b/Tiles/FurnitureStatigel/StatigelClock.cs index 40a3f3a0ec..72b2ec00ad 100644 --- a/Tiles/FurnitureStatigel/StatigelClock.cs +++ b/Tiles/FurnitureStatigel/StatigelClock.cs @@ -9,7 +9,7 @@ namespace CalamityMod.Tiles.FurnitureStatigel { public override void SetDefaults() { - CalamityUtils.SetUpClock(Type); + this.SetUpClock(); ModTranslation name = CreateMapEntryName(); name.SetDefault("Statigel Clock"); AddMapEntry(new Color(191, 142, 111), name); diff --git a/Tiles/FurnitureStatigel/StatigelDoorClosed.cs b/Tiles/FurnitureStatigel/StatigelDoorClosed.cs index 2460f2abf0..859b50802b 100644 --- a/Tiles/FurnitureStatigel/StatigelDoorClosed.cs +++ b/Tiles/FurnitureStatigel/StatigelDoorClosed.cs @@ -9,7 +9,7 @@ namespace CalamityMod.Tiles.FurnitureStatigel { public override void SetDefaults() { - CalamityUtils.SetUpDoorClosed(Type); + this.SetUpDoorClosed(); ModTranslation name = CreateMapEntryName(); name.SetDefault("Statigel Door"); AddMapEntry(new Color(191, 142, 111), name); diff --git a/Tiles/FurnitureStatigel/StatigelDoorOpen.cs b/Tiles/FurnitureStatigel/StatigelDoorOpen.cs index bc5702e4f2..b0f3eee7c3 100644 --- a/Tiles/FurnitureStatigel/StatigelDoorOpen.cs +++ b/Tiles/FurnitureStatigel/StatigelDoorOpen.cs @@ -9,7 +9,7 @@ namespace CalamityMod.Tiles.FurnitureStatigel { public override void SetDefaults() { - CalamityUtils.SetUpDoorOpen(Type); + this.SetUpDoorOpen(); ModTranslation name = CreateMapEntryName(); name.SetDefault("Statigel Door"); AddMapEntry(new Color(191, 142, 111), name); diff --git a/Tiles/FurnitureStatigel/StatigelDresser.cs b/Tiles/FurnitureStatigel/StatigelDresser.cs index 03977d85e6..17ca56c32f 100644 --- a/Tiles/FurnitureStatigel/StatigelDresser.cs +++ b/Tiles/FurnitureStatigel/StatigelDresser.cs @@ -9,7 +9,7 @@ namespace CalamityMod.Tiles.FurnitureStatigel { public override void SetDefaults() { - CalamityUtils.SetUpDresser(Type); + this.SetUpDresser(); ModTranslation name = CreateMapEntryName(); name.SetDefault("Statigel Dresser"); AddMapEntry(new Color(191, 142, 111), name); diff --git a/Tiles/FurnitureStatigel/StatigelLamp.cs b/Tiles/FurnitureStatigel/StatigelLamp.cs index 98e5c5b7b9..cca064e12e 100644 --- a/Tiles/FurnitureStatigel/StatigelLamp.cs +++ b/Tiles/FurnitureStatigel/StatigelLamp.cs @@ -9,7 +9,7 @@ namespace CalamityMod.Tiles.FurnitureStatigel { public override void SetDefaults() { - CalamityUtils.SetUpLamp(Type); + this.SetUpLamp(); ModTranslation name = CreateMapEntryName(); name.SetDefault("Statigel Lamp"); AddMapEntry(new Color(191, 142, 111), name); diff --git a/Tiles/FurnitureStatigel/StatigelLantern.cs b/Tiles/FurnitureStatigel/StatigelLantern.cs index 7b53de4f06..a5bf8ae9d4 100644 --- a/Tiles/FurnitureStatigel/StatigelLantern.cs +++ b/Tiles/FurnitureStatigel/StatigelLantern.cs @@ -9,7 +9,7 @@ namespace CalamityMod.Tiles.FurnitureStatigel { public override void SetDefaults() { - CalamityUtils.SetUpLantern(Type); + this.SetUpLantern(); ModTranslation name = CreateMapEntryName(); name.SetDefault("Statigel Lantern"); AddMapEntry(new Color(191, 142, 111), name); diff --git a/Tiles/FurnitureStatigel/StatigelPiano.cs b/Tiles/FurnitureStatigel/StatigelPiano.cs index 6ab966cf35..8d734ea1a4 100644 --- a/Tiles/FurnitureStatigel/StatigelPiano.cs +++ b/Tiles/FurnitureStatigel/StatigelPiano.cs @@ -7,7 +7,7 @@ namespace CalamityMod.Tiles.FurnitureStatigel { public override void SetDefaults() { - CalamityUtils.SetUpPiano(Type); + this.SetUpPiano(); ModTranslation name = CreateMapEntryName(); name.SetDefault("Statigel Piano"); AddMapEntry(new Color(191, 142, 111), name); diff --git a/Tiles/FurnitureStatigel/StatigelPlatform.cs b/Tiles/FurnitureStatigel/StatigelPlatform.cs index 87f608e9fe..ba56da70f4 100644 --- a/Tiles/FurnitureStatigel/StatigelPlatform.cs +++ b/Tiles/FurnitureStatigel/StatigelPlatform.cs @@ -9,7 +9,7 @@ namespace CalamityMod.Tiles.FurnitureStatigel { public override void SetDefaults() { - CalamityUtils.SetUpPlatform(Type); + this.SetUpPlatform(); AddMapEntry(new Color(191, 142, 111)); drop = ModContent.ItemType(); disableSmartCursor = true; diff --git a/Tiles/FurnitureStatigel/StatigelSink.cs b/Tiles/FurnitureStatigel/StatigelSink.cs index 7b85edc72e..49f15187a0 100644 --- a/Tiles/FurnitureStatigel/StatigelSink.cs +++ b/Tiles/FurnitureStatigel/StatigelSink.cs @@ -9,7 +9,7 @@ namespace CalamityMod.Tiles.FurnitureStatigel { public override void SetDefaults() { - CalamityUtils.SetUpSink(Type); + this.SetUpSink(); ModTranslation name = CreateMapEntryName(); name.SetDefault("Statigel Sink"); AddMapEntry(new Color(191, 142, 111), name); diff --git a/Tiles/FurnitureStatigel/StatigelSofa.cs b/Tiles/FurnitureStatigel/StatigelSofa.cs index 6a0021c61e..be50113854 100644 --- a/Tiles/FurnitureStatigel/StatigelSofa.cs +++ b/Tiles/FurnitureStatigel/StatigelSofa.cs @@ -7,7 +7,7 @@ namespace CalamityMod.Tiles.FurnitureStatigel { public override void SetDefaults() { - CalamityUtils.SetUpSofa(Type); + this.SetUpSofa(); ModTranslation name = CreateMapEntryName(); name.SetDefault("Statigel Sofa"); AddMapEntry(new Color(191, 142, 111), name); diff --git a/Tiles/FurnitureStatigel/StatigelTable.cs b/Tiles/FurnitureStatigel/StatigelTable.cs index 03167ecd58..702d167ea0 100644 --- a/Tiles/FurnitureStatigel/StatigelTable.cs +++ b/Tiles/FurnitureStatigel/StatigelTable.cs @@ -9,7 +9,7 @@ namespace CalamityMod.Tiles.FurnitureStatigel { public override void SetDefaults() { - CalamityUtils.SetUpTable(Type); + this.SetUpTable(); ModTranslation name = CreateMapEntryName(); name.SetDefault("Statigel Table"); AddMapEntry(new Color(191, 142, 111), name); diff --git a/Tiles/FurnitureStatigel/StatigelWorkbench.cs b/Tiles/FurnitureStatigel/StatigelWorkbench.cs index 354956fbec..f34431bfcc 100644 --- a/Tiles/FurnitureStatigel/StatigelWorkbench.cs +++ b/Tiles/FurnitureStatigel/StatigelWorkbench.cs @@ -9,7 +9,7 @@ namespace CalamityMod.Tiles.FurnitureStatigel { public override void SetDefaults() { - CalamityUtils.SetUpWorkBench(Type); + this.SetUpWorkBench(); ModTranslation name = CreateMapEntryName(); name.SetDefault("Statigel Work Bench"); AddMapEntry(new Color(191, 142, 111), name); diff --git a/Tiles/FurnitureStratus/StratusBathtub.cs b/Tiles/FurnitureStratus/StratusBathtub.cs index 9d7ad9edfb..7446911f45 100644 --- a/Tiles/FurnitureStratus/StratusBathtub.cs +++ b/Tiles/FurnitureStratus/StratusBathtub.cs @@ -7,7 +7,7 @@ namespace CalamityMod.Tiles.FurnitureStratus { public override void SetDefaults() { - CalamityUtils.SetUpBathtub(Type); + this.SetUpBathtub(); ModTranslation name = CreateMapEntryName(); name.SetDefault("Stratus Bathtub"); AddMapEntry(new Color(191, 142, 111), name); diff --git a/Tiles/FurnitureStratus/StratusBed.cs b/Tiles/FurnitureStratus/StratusBed.cs index 5844300124..b347463b93 100644 --- a/Tiles/FurnitureStratus/StratusBed.cs +++ b/Tiles/FurnitureStratus/StratusBed.cs @@ -9,7 +9,7 @@ namespace CalamityMod.Tiles.FurnitureStratus { public override void SetDefaults() { - CalamityUtils.SetUpBed(Type); + this.SetUpBed(); ModTranslation name = CreateMapEntryName(); name.SetDefault("Stratus Bed"); AddMapEntry(new Color(191, 142, 111), name); diff --git a/Tiles/FurnitureStratus/StratusBookcase.cs b/Tiles/FurnitureStratus/StratusBookcase.cs index 50a417b6e4..9f570b1afb 100644 --- a/Tiles/FurnitureStratus/StratusBookcase.cs +++ b/Tiles/FurnitureStratus/StratusBookcase.cs @@ -9,7 +9,7 @@ namespace CalamityMod.Tiles.FurnitureStratus { public override void SetDefaults() { - CalamityUtils.SetUpBookcase(Type); + this.SetUpBookcase(); ModTranslation name = CreateMapEntryName(); name.SetDefault("Stratus Bookcase"); AddMapEntry(new Color(191, 142, 111), name); diff --git a/Tiles/FurnitureStratus/StratusBricks.cs b/Tiles/FurnitureStratus/StratusBricks.cs index dc452dbc1b..47a8523680 100644 --- a/Tiles/FurnitureStratus/StratusBricks.cs +++ b/Tiles/FurnitureStratus/StratusBricks.cs @@ -15,7 +15,7 @@ namespace CalamityMod.Tiles.FurnitureStratus Main.tileBlockLight[Type] = true; TileID.Sets.HasSlopeFrames[Type] = true; - TileMerge.MergeGeneralTiles(Type); + CalamityUtils.MergeWithGeneral(Type); soundType = 21; mineResist = 5f; @@ -33,7 +33,7 @@ namespace CalamityMod.Tiles.FurnitureStratus public override bool TileFrame(int i, int j, ref bool resetFrame, ref bool noBreak) { - return CustomTileFraming.BetterGemsparkFraming(i, j, resetFrame); + return TileFraming.BetterGemsparkFraming(i, j, resetFrame); } public override void PostDraw(int i, int j, SpriteBatch spriteBatch) diff --git a/Tiles/FurnitureStratus/StratusCandelabra.cs b/Tiles/FurnitureStratus/StratusCandelabra.cs index 3e63ff033f..9e5a5753cc 100644 --- a/Tiles/FurnitureStratus/StratusCandelabra.cs +++ b/Tiles/FurnitureStratus/StratusCandelabra.cs @@ -9,7 +9,7 @@ namespace CalamityMod.Tiles.FurnitureStratus { public override void SetDefaults() { - CalamityUtils.SetUpCandelabra(Type); + this.SetUpCandelabra(); ModTranslation name = CreateMapEntryName(); name.SetDefault("Stratus Candelabra"); AddMapEntry(new Color(191, 142, 111), name); diff --git a/Tiles/FurnitureStratus/StratusCandle.cs b/Tiles/FurnitureStratus/StratusCandle.cs index 6c6220a8f7..91385474ef 100644 --- a/Tiles/FurnitureStratus/StratusCandle.cs +++ b/Tiles/FurnitureStratus/StratusCandle.cs @@ -9,7 +9,7 @@ namespace CalamityMod.Tiles.FurnitureStratus { public override void SetDefaults() { - CalamityUtils.SetUpCandle(Type); + this.SetUpCandle(); ModTranslation name = CreateMapEntryName(); name.SetDefault("Stratus Candle"); AddMapEntry(new Color(191, 142, 111), name); diff --git a/Tiles/FurnitureStratus/StratusChair.cs b/Tiles/FurnitureStratus/StratusChair.cs index 924c8f386d..9f48a73dd4 100644 --- a/Tiles/FurnitureStratus/StratusChair.cs +++ b/Tiles/FurnitureStratus/StratusChair.cs @@ -9,7 +9,7 @@ namespace CalamityMod.Tiles.FurnitureStratus { public override void SetDefaults() { - CalamityUtils.SetUpChair(Type); + this.SetUpChair(); ModTranslation name = CreateMapEntryName(); name.SetDefault("Stratus Chair"); AddMapEntry(new Color(191, 142, 111), name); diff --git a/Tiles/FurnitureStratus/StratusChandelier.cs b/Tiles/FurnitureStratus/StratusChandelier.cs index 886d3efd4f..af549c2547 100644 --- a/Tiles/FurnitureStratus/StratusChandelier.cs +++ b/Tiles/FurnitureStratus/StratusChandelier.cs @@ -9,7 +9,7 @@ namespace CalamityMod.Tiles.FurnitureStratus { public override void SetDefaults() { - CalamityUtils.SetUpChandelier(Type); + this.SetUpChandelier(); ModTranslation name = CreateMapEntryName(); name.SetDefault("Stratus Chandelier"); AddMapEntry(new Color(191, 142, 111), name); diff --git a/Tiles/FurnitureStratus/StratusChest.cs b/Tiles/FurnitureStratus/StratusChest.cs index 231f123dff..3b54090a54 100644 --- a/Tiles/FurnitureStratus/StratusChest.cs +++ b/Tiles/FurnitureStratus/StratusChest.cs @@ -9,7 +9,7 @@ namespace CalamityMod.Tiles.FurnitureStratus { public override void SetDefaults() { - CalamityUtils.SetUpChest(Type); + this.SetUpChest(); ModTranslation name = CreateMapEntryName(); name.SetDefault("Stratus Chest"); AddMapEntry(new Color(191, 142, 111), name, MapChestName); diff --git a/Tiles/FurnitureStratus/StratusClock.cs b/Tiles/FurnitureStratus/StratusClock.cs index 5148467460..689558c938 100644 --- a/Tiles/FurnitureStratus/StratusClock.cs +++ b/Tiles/FurnitureStratus/StratusClock.cs @@ -9,7 +9,7 @@ namespace CalamityMod.Tiles.FurnitureStratus { public override void SetDefaults() { - CalamityUtils.SetUpClock(Type); + this.SetUpClock(); ModTranslation name = CreateMapEntryName(); name.SetDefault("Stratus Clock"); AddMapEntry(new Color(191, 142, 111), name); diff --git a/Tiles/FurnitureStratus/StratusDoorClosed.cs b/Tiles/FurnitureStratus/StratusDoorClosed.cs index 97d2ad9b18..c5e0b4cafa 100644 --- a/Tiles/FurnitureStratus/StratusDoorClosed.cs +++ b/Tiles/FurnitureStratus/StratusDoorClosed.cs @@ -9,7 +9,7 @@ namespace CalamityMod.Tiles.FurnitureStratus { public override void SetDefaults() { - CalamityUtils.SetUpDoorClosed(Type); + this.SetUpDoorClosed(); ModTranslation name = CreateMapEntryName(); name.SetDefault("Stratus Door"); AddMapEntry(new Color(191, 142, 111), name); diff --git a/Tiles/FurnitureStratus/StratusDoorOpen.cs b/Tiles/FurnitureStratus/StratusDoorOpen.cs index 7fe6efe512..294d81ec5f 100644 --- a/Tiles/FurnitureStratus/StratusDoorOpen.cs +++ b/Tiles/FurnitureStratus/StratusDoorOpen.cs @@ -9,7 +9,7 @@ namespace CalamityMod.Tiles.FurnitureStratus { public override void SetDefaults() { - CalamityUtils.SetUpDoorOpen(Type); + this.SetUpDoorOpen(); ModTranslation name = CreateMapEntryName(); name.SetDefault("Stratus Door"); AddMapEntry(new Color(191, 142, 111), name); diff --git a/Tiles/FurnitureStratus/StratusDresser.cs b/Tiles/FurnitureStratus/StratusDresser.cs index b238615424..b9bf0a81c4 100644 --- a/Tiles/FurnitureStratus/StratusDresser.cs +++ b/Tiles/FurnitureStratus/StratusDresser.cs @@ -9,7 +9,7 @@ namespace CalamityMod.Tiles.FurnitureStratus { public override void SetDefaults() { - CalamityUtils.SetUpDresser(Type); + this.SetUpDresser(); ModTranslation name = CreateMapEntryName(); name.SetDefault("Stratus Dresser"); AddMapEntry(new Color(191, 142, 111), name); diff --git a/Tiles/FurnitureStratus/StratusLamp.cs b/Tiles/FurnitureStratus/StratusLamp.cs index 73e669cb57..d21fc33675 100644 --- a/Tiles/FurnitureStratus/StratusLamp.cs +++ b/Tiles/FurnitureStratus/StratusLamp.cs @@ -9,7 +9,7 @@ namespace CalamityMod.Tiles.FurnitureStratus { public override void SetDefaults() { - CalamityUtils.SetUpLamp(Type); + this.SetUpLamp(); ModTranslation name = CreateMapEntryName(); name.SetDefault("Stratus Lamp"); AddMapEntry(new Color(191, 142, 111), name); diff --git a/Tiles/FurnitureStratus/StratusLantern.cs b/Tiles/FurnitureStratus/StratusLantern.cs index 94f7a9a9c0..f0ef9600e7 100644 --- a/Tiles/FurnitureStratus/StratusLantern.cs +++ b/Tiles/FurnitureStratus/StratusLantern.cs @@ -9,7 +9,7 @@ namespace CalamityMod.Tiles.FurnitureStratus { public override void SetDefaults() { - CalamityUtils.SetUpLantern(Type); + this.SetUpLantern(); ModTranslation name = CreateMapEntryName(); name.SetDefault("Stratus Lantern"); AddMapEntry(new Color(191, 142, 111), name); diff --git a/Tiles/FurnitureStratus/StratusPiano.cs b/Tiles/FurnitureStratus/StratusPiano.cs index 3e21bdf0f8..ab0f513bdf 100644 --- a/Tiles/FurnitureStratus/StratusPiano.cs +++ b/Tiles/FurnitureStratus/StratusPiano.cs @@ -7,7 +7,7 @@ namespace CalamityMod.Tiles.FurnitureStratus { public override void SetDefaults() { - CalamityUtils.SetUpPiano(Type); + this.SetUpPiano(); ModTranslation name = CreateMapEntryName(); name.SetDefault("Stratus Piano"); AddMapEntry(new Color(191, 142, 111), name); diff --git a/Tiles/FurnitureStratus/StratusPlatform.cs b/Tiles/FurnitureStratus/StratusPlatform.cs index 36107ba539..cb879e2dd3 100644 --- a/Tiles/FurnitureStratus/StratusPlatform.cs +++ b/Tiles/FurnitureStratus/StratusPlatform.cs @@ -9,7 +9,7 @@ namespace CalamityMod.Tiles.FurnitureStratus { public override void SetDefaults() { - CalamityUtils.SetUpPlatform(Type); + this.SetUpPlatform(); AddMapEntry(new Color(191, 142, 111)); drop = ModContent.ItemType(); disableSmartCursor = true; diff --git a/Tiles/FurnitureStratus/StratusSink.cs b/Tiles/FurnitureStratus/StratusSink.cs index c05bc39334..c30a22097e 100644 --- a/Tiles/FurnitureStratus/StratusSink.cs +++ b/Tiles/FurnitureStratus/StratusSink.cs @@ -9,7 +9,7 @@ namespace CalamityMod.Tiles.FurnitureStratus { public override void SetDefaults() { - CalamityUtils.SetUpSink(Type); + this.SetUpSink(); ModTranslation name = CreateMapEntryName(); name.SetDefault("Stratus Sink"); AddMapEntry(new Color(191, 142, 111), name); diff --git a/Tiles/FurnitureStratus/StratusSofa.cs b/Tiles/FurnitureStratus/StratusSofa.cs index d31c124258..831506237d 100644 --- a/Tiles/FurnitureStratus/StratusSofa.cs +++ b/Tiles/FurnitureStratus/StratusSofa.cs @@ -7,7 +7,7 @@ namespace CalamityMod.Tiles.FurnitureStratus { public override void SetDefaults() { - CalamityUtils.SetUpSofa(Type); + this.SetUpSofa(); ModTranslation name = CreateMapEntryName(); name.SetDefault("Stratus Sofa"); AddMapEntry(new Color(191, 142, 111), name); diff --git a/Tiles/FurnitureStratus/StratusTable.cs b/Tiles/FurnitureStratus/StratusTable.cs index 00e099eb14..0d4dcda6fe 100644 --- a/Tiles/FurnitureStratus/StratusTable.cs +++ b/Tiles/FurnitureStratus/StratusTable.cs @@ -9,7 +9,7 @@ namespace CalamityMod.Tiles.FurnitureStratus { public override void SetDefaults() { - CalamityUtils.SetUpTable(Type); + this.SetUpTable(); ModTranslation name = CreateMapEntryName(); name.SetDefault("Stratus Table"); AddMapEntry(new Color(191, 142, 111), name); diff --git a/Tiles/FurnitureStratus/StratusWorkbench.cs b/Tiles/FurnitureStratus/StratusWorkbench.cs index bb0ac08fe4..5d02910fd9 100644 --- a/Tiles/FurnitureStratus/StratusWorkbench.cs +++ b/Tiles/FurnitureStratus/StratusWorkbench.cs @@ -9,7 +9,7 @@ namespace CalamityMod.Tiles.FurnitureStratus { public override void SetDefaults() { - CalamityUtils.SetUpWorkBench(Type); + this.SetUpWorkBench(); ModTranslation name = CreateMapEntryName(); name.SetDefault("Stratus Work Bench"); AddMapEntry(new Color(191, 142, 111), name); diff --git a/Tiles/FurnitureVoid/SmoothVoidstone.cs b/Tiles/FurnitureVoid/SmoothVoidstone.cs index 0575eeaa53..3c141139fd 100644 --- a/Tiles/FurnitureVoid/SmoothVoidstone.cs +++ b/Tiles/FurnitureVoid/SmoothVoidstone.cs @@ -13,10 +13,10 @@ namespace CalamityMod.Tiles.FurnitureVoid Main.tileMergeDirt[Type] = true; Main.tileBlockLight[Type] = true; - TileMerge.MergeGeneralTiles(Type); - TileMerge.MergeSmoothTiles(Type); - TileMerge.MergeDecorativeTiles(Type); - TileMerge.MergeAbyssTiles(Type); + CalamityUtils.MergeWithGeneral(Type); + CalamityUtils.MergeSmoothTiles(Type); + CalamityUtils.MergeDecorativeTiles(Type); + CalamityUtils.MergeWithAbyss(Type); soundType = 21; mineResist = 7f; diff --git a/Tiles/FurnitureVoid/SmoothVoidstonePlatform.cs b/Tiles/FurnitureVoid/SmoothVoidstonePlatform.cs index 2c88fb8d2b..efafa9544f 100644 --- a/Tiles/FurnitureVoid/SmoothVoidstonePlatform.cs +++ b/Tiles/FurnitureVoid/SmoothVoidstonePlatform.cs @@ -9,7 +9,7 @@ namespace CalamityMod.Tiles.FurnitureVoid { public override void SetDefaults() { - CalamityUtils.SetUpPlatform(Type); + this.SetUpPlatform(); AddMapEntry(new Color(191, 142, 111)); drop = ModContent.ItemType(); disableSmartCursor = true; diff --git a/Tiles/FurnitureVoid/VoidBath.cs b/Tiles/FurnitureVoid/VoidBath.cs index 2a9f3f2189..38f82bf05c 100644 --- a/Tiles/FurnitureVoid/VoidBath.cs +++ b/Tiles/FurnitureVoid/VoidBath.cs @@ -7,7 +7,7 @@ namespace CalamityMod.Tiles.FurnitureVoid { public override void SetDefaults() { - CalamityUtils.SetUpBathtub(Type); + this.SetUpBathtub(); ModTranslation name = CreateMapEntryName(); name.SetDefault("Void Bathtub"); AddMapEntry(new Color(191, 142, 111), name); diff --git a/Tiles/FurnitureVoid/VoidBed.cs b/Tiles/FurnitureVoid/VoidBed.cs index d895eab73a..3797a72a4c 100644 --- a/Tiles/FurnitureVoid/VoidBed.cs +++ b/Tiles/FurnitureVoid/VoidBed.cs @@ -9,7 +9,7 @@ namespace CalamityMod.Tiles.FurnitureVoid { public override void SetDefaults() { - CalamityUtils.SetUpBed(Type); + this.SetUpBed(); ModTranslation name = CreateMapEntryName(); name.SetDefault("Void Bed"); AddMapEntry(new Color(191, 142, 111), name); diff --git a/Tiles/FurnitureVoid/VoidBookcase.cs b/Tiles/FurnitureVoid/VoidBookcase.cs index d464e42d7c..9e298e03c1 100644 --- a/Tiles/FurnitureVoid/VoidBookcase.cs +++ b/Tiles/FurnitureVoid/VoidBookcase.cs @@ -9,7 +9,7 @@ namespace CalamityMod.Tiles.FurnitureVoid { public override void SetDefaults() { - CalamityUtils.SetUpBookcase(Type); + this.SetUpBookcase(); ModTranslation name = CreateMapEntryName(); name.SetDefault("Void Bookcase"); AddMapEntry(new Color(191, 142, 111), name); diff --git a/Tiles/FurnitureVoid/VoidCandelabra.cs b/Tiles/FurnitureVoid/VoidCandelabra.cs index 356e25194f..1909e4bc37 100644 --- a/Tiles/FurnitureVoid/VoidCandelabra.cs +++ b/Tiles/FurnitureVoid/VoidCandelabra.cs @@ -9,7 +9,7 @@ namespace CalamityMod.Tiles.FurnitureVoid { public override void SetDefaults() { - CalamityUtils.SetUpCandelabra(Type); + this.SetUpCandelabra(); ModTranslation name = CreateMapEntryName(); name.SetDefault("Void Candelabra"); AddMapEntry(new Color(191, 142, 111), name); diff --git a/Tiles/FurnitureVoid/VoidCandle.cs b/Tiles/FurnitureVoid/VoidCandle.cs index 40a55f5500..0cf50ad857 100644 --- a/Tiles/FurnitureVoid/VoidCandle.cs +++ b/Tiles/FurnitureVoid/VoidCandle.cs @@ -9,7 +9,7 @@ namespace CalamityMod.Tiles.FurnitureVoid { public override void SetDefaults() { - CalamityUtils.SetUpCandle(Type); + this.SetUpCandle(); ModTranslation name = CreateMapEntryName(); name.SetDefault("Void Candle"); AddMapEntry(new Color(191, 142, 111), name); diff --git a/Tiles/FurnitureVoid/VoidChair.cs b/Tiles/FurnitureVoid/VoidChair.cs index 3049e71902..d7870d874e 100644 --- a/Tiles/FurnitureVoid/VoidChair.cs +++ b/Tiles/FurnitureVoid/VoidChair.cs @@ -9,7 +9,7 @@ namespace CalamityMod.Tiles.FurnitureVoid { public override void SetDefaults() { - CalamityUtils.SetUpChair(Type); + this.SetUpChair(); ModTranslation name = CreateMapEntryName(); name.SetDefault("Void Chair"); AddMapEntry(new Color(191, 142, 111), name); diff --git a/Tiles/FurnitureVoid/VoidChandelier.cs b/Tiles/FurnitureVoid/VoidChandelier.cs index 31254b803f..1f15ef52db 100644 --- a/Tiles/FurnitureVoid/VoidChandelier.cs +++ b/Tiles/FurnitureVoid/VoidChandelier.cs @@ -9,7 +9,7 @@ namespace CalamityMod.Tiles.FurnitureVoid { public override void SetDefaults() { - CalamityUtils.SetUpChandelier(Type); + this.SetUpChandelier(); ModTranslation name = CreateMapEntryName(); name.SetDefault("Void Chandelier"); AddMapEntry(new Color(191, 142, 111), name); diff --git a/Tiles/FurnitureVoid/VoidChest.cs b/Tiles/FurnitureVoid/VoidChest.cs index c67cfd032f..c83db58333 100644 --- a/Tiles/FurnitureVoid/VoidChest.cs +++ b/Tiles/FurnitureVoid/VoidChest.cs @@ -9,7 +9,7 @@ namespace CalamityMod.Tiles.FurnitureVoid { public override void SetDefaults() { - CalamityUtils.SetUpChest(Type); + this.SetUpChest(); ModTranslation name = CreateMapEntryName(); name.SetDefault("Void Chest"); AddMapEntry(new Color(191, 142, 111), name, MapChestName); diff --git a/Tiles/FurnitureVoid/VoidClock.cs b/Tiles/FurnitureVoid/VoidClock.cs index 3530221f4c..506003f84a 100644 --- a/Tiles/FurnitureVoid/VoidClock.cs +++ b/Tiles/FurnitureVoid/VoidClock.cs @@ -9,7 +9,7 @@ namespace CalamityMod.Tiles.FurnitureVoid { public override void SetDefaults() { - CalamityUtils.SetUpClock(Type); + this.SetUpClock(); animationFrameHeight = 90; ModTranslation name = CreateMapEntryName(); name.SetDefault("Void Obelisk"); diff --git a/Tiles/FurnitureVoid/VoidDoorClosed.cs b/Tiles/FurnitureVoid/VoidDoorClosed.cs index 703a377a2c..ecf7ac19ff 100644 --- a/Tiles/FurnitureVoid/VoidDoorClosed.cs +++ b/Tiles/FurnitureVoid/VoidDoorClosed.cs @@ -9,7 +9,7 @@ namespace CalamityMod.Tiles.FurnitureVoid { public override void SetDefaults() { - CalamityUtils.SetUpDoorClosed(Type); + this.SetUpDoorClosed(); ModTranslation name = CreateMapEntryName(); name.SetDefault("Void Door"); AddMapEntry(new Color(191, 142, 111), name); diff --git a/Tiles/FurnitureVoid/VoidDoorOpen.cs b/Tiles/FurnitureVoid/VoidDoorOpen.cs index 60823e31a1..6e2be97437 100644 --- a/Tiles/FurnitureVoid/VoidDoorOpen.cs +++ b/Tiles/FurnitureVoid/VoidDoorOpen.cs @@ -9,7 +9,7 @@ namespace CalamityMod.Tiles.FurnitureVoid { public override void SetDefaults() { - CalamityUtils.SetUpDoorOpen(Type); + this.SetUpDoorOpen(); ModTranslation name = CreateMapEntryName(); name.SetDefault("Void Door"); AddMapEntry(new Color(191, 142, 111), name); diff --git a/Tiles/FurnitureVoid/VoidDresser.cs b/Tiles/FurnitureVoid/VoidDresser.cs index f9e24d6052..828e33e204 100644 --- a/Tiles/FurnitureVoid/VoidDresser.cs +++ b/Tiles/FurnitureVoid/VoidDresser.cs @@ -9,7 +9,7 @@ namespace CalamityMod.Tiles.FurnitureVoid { public override void SetDefaults() { - CalamityUtils.SetUpDresser(Type); + this.SetUpDresser(); ModTranslation name = CreateMapEntryName(); name.SetDefault("Void Dresser"); AddMapEntry(new Color(191, 142, 111), name); diff --git a/Tiles/FurnitureVoid/VoidLamp.cs b/Tiles/FurnitureVoid/VoidLamp.cs index 1e827bac0f..d7059ad8d5 100644 --- a/Tiles/FurnitureVoid/VoidLamp.cs +++ b/Tiles/FurnitureVoid/VoidLamp.cs @@ -9,7 +9,7 @@ namespace CalamityMod.Tiles.FurnitureVoid { public override void SetDefaults() { - CalamityUtils.SetUpLamp(Type); + this.SetUpLamp(); ModTranslation name = CreateMapEntryName(); name.SetDefault("Void Lamp"); AddMapEntry(new Color(191, 142, 111), name); diff --git a/Tiles/FurnitureVoid/VoidLantern.cs b/Tiles/FurnitureVoid/VoidLantern.cs index b949f1a530..296a12c03b 100644 --- a/Tiles/FurnitureVoid/VoidLantern.cs +++ b/Tiles/FurnitureVoid/VoidLantern.cs @@ -9,7 +9,7 @@ namespace CalamityMod.Tiles.FurnitureVoid { public override void SetDefaults() { - CalamityUtils.SetUpLantern(Type); + this.SetUpLantern(); ModTranslation name = CreateMapEntryName(); name.SetDefault("Void Lantern"); AddMapEntry(new Color(191, 142, 111), name); diff --git a/Tiles/FurnitureVoid/VoidPiano.cs b/Tiles/FurnitureVoid/VoidPiano.cs index edfbd29499..6015d92fbf 100644 --- a/Tiles/FurnitureVoid/VoidPiano.cs +++ b/Tiles/FurnitureVoid/VoidPiano.cs @@ -7,7 +7,7 @@ namespace CalamityMod.Tiles.FurnitureVoid { public override void SetDefaults() { - CalamityUtils.SetUpPiano(Type); + this.SetUpPiano(); ModTranslation name = CreateMapEntryName(); name.SetDefault("Void Piano"); AddMapEntry(new Color(191, 142, 111), name); diff --git a/Tiles/FurnitureVoid/VoidSink.cs b/Tiles/FurnitureVoid/VoidSink.cs index 4a4e5d8c0e..a61c59bd8a 100644 --- a/Tiles/FurnitureVoid/VoidSink.cs +++ b/Tiles/FurnitureVoid/VoidSink.cs @@ -9,7 +9,7 @@ namespace CalamityMod.Tiles.FurnitureVoid { public override void SetDefaults() { - CalamityUtils.SetUpSink(Type); + this.SetUpSink(); ModTranslation name = CreateMapEntryName(); name.SetDefault("Void Sink"); AddMapEntry(new Color(191, 142, 111), name); diff --git a/Tiles/FurnitureVoid/VoidSofa.cs b/Tiles/FurnitureVoid/VoidSofa.cs index ea70f2b09f..50b4738c62 100644 --- a/Tiles/FurnitureVoid/VoidSofa.cs +++ b/Tiles/FurnitureVoid/VoidSofa.cs @@ -7,7 +7,7 @@ namespace CalamityMod.Tiles.FurnitureVoid { public override void SetDefaults() { - CalamityUtils.SetUpSofa(Type); + this.SetUpSofa(); ModTranslation name = CreateMapEntryName(); name.SetDefault("Void Sofa"); AddMapEntry(new Color(191, 142, 111), name); diff --git a/Tiles/FurnitureVoid/VoidTable.cs b/Tiles/FurnitureVoid/VoidTable.cs index f91a102207..9a08c2ff57 100644 --- a/Tiles/FurnitureVoid/VoidTable.cs +++ b/Tiles/FurnitureVoid/VoidTable.cs @@ -9,7 +9,7 @@ namespace CalamityMod.Tiles.FurnitureVoid { public override void SetDefaults() { - CalamityUtils.SetUpTable(Type); + this.SetUpTable(); ModTranslation name = CreateMapEntryName(); name.SetDefault("Void Table"); AddMapEntry(new Color(191, 142, 111), name); diff --git a/Tiles/FurnitureVoid/VoidWorkbench.cs b/Tiles/FurnitureVoid/VoidWorkbench.cs index c59d33a662..348ca1c050 100644 --- a/Tiles/FurnitureVoid/VoidWorkbench.cs +++ b/Tiles/FurnitureVoid/VoidWorkbench.cs @@ -9,7 +9,7 @@ namespace CalamityMod.Tiles.FurnitureVoid { public override void SetDefaults() { - CalamityUtils.SetUpWorkBench(Type); + this.SetUpWorkBench(); ModTranslation name = CreateMapEntryName(); name.SetDefault("Void Work Bench"); AddMapEntry(new Color(191, 142, 111), name); diff --git a/Tiles/Ores/AerialiteOre.cs b/Tiles/Ores/AerialiteOre.cs index 91ffbb7ee2..283a487eb5 100644 --- a/Tiles/Ores/AerialiteOre.cs +++ b/Tiles/Ores/AerialiteOre.cs @@ -13,7 +13,7 @@ namespace CalamityMod.Tiles.Ores Main.tileMergeDirt[Type] = true; Main.tileBlockLight[Type] = true; - TileMerge.MergeGeneralTiles(Type); + CalamityUtils.MergeWithGeneral(Type); drop = ModContent.ItemType(); ModTranslation name = CreateMapEntryName(); name.SetDefault("Aerialite Ore"); diff --git a/Tiles/Ores/AstralOre.cs b/Tiles/Ores/AstralOre.cs index 9f6cfaab50..c6543466b9 100644 --- a/Tiles/Ores/AstralOre.cs +++ b/Tiles/Ores/AstralOre.cs @@ -20,8 +20,8 @@ namespace CalamityMod.Tiles.Ores Main.tileSpelunker[Type] = true; Main.tileShine2[Type] = true; - TileMerge.MergeGeneralTiles(Type); - TileMerge.MergeAstralTiles(Type); + CalamityUtils.MergeWithGeneral(Type); + CalamityUtils.MergeAstralTiles(Type); minPick = 200; dustType = 173; @@ -79,7 +79,7 @@ namespace CalamityMod.Tiles.Ores public override bool TileFrame(int i, int j, ref bool resetFrame, ref bool noBreak) { - CustomTileFraming.FrameTileForCustomMerge(i, j, Type, ModContent.TileType(), false, false, false, false, resetFrame); + TileFraming.CustomMergeFrame(i, j, Type, ModContent.TileType(), false, false, false, false, resetFrame); return false; } } diff --git a/Tiles/Ores/AuricOre.cs b/Tiles/Ores/AuricOre.cs index 0dc0a33cbf..f740c52870 100644 --- a/Tiles/Ores/AuricOre.cs +++ b/Tiles/Ores/AuricOre.cs @@ -16,7 +16,7 @@ namespace CalamityMod.Tiles.Ores Main.tileSpelunker[Type] = true; Main.tileValue[Type] = 1000; - TileMerge.MergeGeneralTiles(Type); + CalamityUtils.MergeWithGeneral(Type); dustType = 55; drop = ModContent.ItemType(); diff --git a/Tiles/Ores/ChaoticOre.cs b/Tiles/Ores/ChaoticOre.cs index 9693c0c16b..08f5fdb648 100644 --- a/Tiles/Ores/ChaoticOre.cs +++ b/Tiles/Ores/ChaoticOre.cs @@ -15,8 +15,8 @@ namespace CalamityMod.Tiles.Ores Main.tileBlockLight[Type] = true; Main.tileValue[Type] = 850; - TileMerge.MergeGeneralTiles(Type); - TileMerge.MergeAbyssTiles(Type); + CalamityUtils.MergeWithGeneral(Type); + CalamityUtils.MergeWithAbyss(Type); dustType = 105; drop = ModContent.ItemType(); @@ -77,7 +77,7 @@ namespace CalamityMod.Tiles.Ores public override bool TileFrame(int i, int j, ref bool resetFrame, ref bool noBreak) { - CustomTileFraming.FrameTileForCustomMerge(i, j, Type, ModContent.TileType(), false, false, false, false, resetFrame); + TileFraming.CustomMergeFrame(i, j, Type, ModContent.TileType(), false, false, false, false, resetFrame); return false; } } diff --git a/Tiles/Ores/CharredOre.cs b/Tiles/Ores/CharredOre.cs index da9a242079..2e9116f21d 100644 --- a/Tiles/Ores/CharredOre.cs +++ b/Tiles/Ores/CharredOre.cs @@ -17,8 +17,8 @@ namespace CalamityMod.Tiles.Ores Main.tileLighted[Type] = true; Main.tileValue[Type] = 720; - TileMerge.MergeGeneralTiles(Type); - TileMerge.MergeHellTiles(Type); + CalamityUtils.MergeWithGeneral(Type); + CalamityUtils.MergeWithHell(Type); drop = ModContent.ItemType(); ModTranslation name = CreateMapEntryName(); @@ -56,7 +56,7 @@ namespace CalamityMod.Tiles.Ores public override bool TileFrame(int i, int j, ref bool resetFrame, ref bool noBreak) { - CustomTileFraming.FrameTileForCustomMerge(i, j, Type, ModContent.TileType(), false, false, false, false, resetFrame); + TileFraming.CustomMergeFrame(i, j, Type, ModContent.TileType(), false, false, false, false, resetFrame); return false; } } diff --git a/Tiles/Ores/CryonicOre.cs b/Tiles/Ores/CryonicOre.cs index d43b288caa..8ffa13280f 100644 --- a/Tiles/Ores/CryonicOre.cs +++ b/Tiles/Ores/CryonicOre.cs @@ -16,8 +16,8 @@ namespace CalamityMod.Tiles.Ores Main.tileBlockLight[Type] = true; Main.tileValue[Type] = 675; - TileMerge.MergeGeneralTiles(Type); - TileMerge.MergeSnowTiles(Type); + CalamityUtils.MergeWithGeneral(Type); + CalamityUtils.MergeWithSnow(Type); drop = ModContent.ItemType(); ModTranslation name = CreateMapEntryName(); @@ -41,7 +41,7 @@ namespace CalamityMod.Tiles.Ores public override bool TileFrame(int i, int j, ref bool resetFrame, ref bool noBreak) { - CustomTileFraming.FrameTileForCustomMerge(i, j, Type, TileID.SnowBlock); + TileFraming.CustomMergeFrame(i, j, Type, TileID.SnowBlock); return false; } diff --git a/Tiles/Ores/ExodiumOre.cs b/Tiles/Ores/ExodiumOre.cs index 671c85b6cb..9c08ce117c 100644 --- a/Tiles/Ores/ExodiumOre.cs +++ b/Tiles/Ores/ExodiumOre.cs @@ -12,7 +12,7 @@ namespace CalamityMod.Tiles.Ores Main.tileSolid[Type] = true; Main.tileBlockLight[Type] = true; - TileMerge.MergeGeneralTiles(Type); + CalamityUtils.MergeWithGeneral(Type); ModTranslation name = CreateMapEntryName(); name.SetDefault("Exodium Ore"); diff --git a/Tiles/Ores/PerennialOre.cs b/Tiles/Ores/PerennialOre.cs index 23e4df5d3e..37974a382c 100644 --- a/Tiles/Ores/PerennialOre.cs +++ b/Tiles/Ores/PerennialOre.cs @@ -14,7 +14,7 @@ namespace CalamityMod.Tiles.Ores Main.tileBlockLight[Type] = true; Main.tileValue[Type] = 710; - TileMerge.MergeGeneralTiles(Type); + CalamityUtils.MergeWithGeneral(Type); drop = ModContent.ItemType(); ModTranslation name = CreateMapEntryName(); diff --git a/Tiles/Ores/UelibloomOre.cs b/Tiles/Ores/UelibloomOre.cs index a197522a00..251ec9bf2d 100644 --- a/Tiles/Ores/UelibloomOre.cs +++ b/Tiles/Ores/UelibloomOre.cs @@ -14,7 +14,7 @@ namespace CalamityMod.Tiles.Ores Main.tileBlockLight[Type] = true; Main.tileValue[Type] = 950; - TileMerge.MergeGeneralTiles(Type); + CalamityUtils.MergeWithGeneral(Type); drop = ModContent.ItemType(); ModTranslation name = CreateMapEntryName(); @@ -38,7 +38,7 @@ namespace CalamityMod.Tiles.Ores public override bool TileFrame(int i, int j, ref bool resetFrame, ref bool noBreak) { - CustomTileFraming.FrameTileForCustomMerge(i, j, Type, TileID.Mud, false, false, false, false, resetFrame); + TileFraming.CustomMergeFrame(i, j, Type, TileID.Mud, false, false, false, false, resetFrame); return false; } } diff --git a/Tiles/PerennialBrick.cs b/Tiles/PerennialBrick.cs index 4a9efd6879..c9e10b5008 100644 --- a/Tiles/PerennialBrick.cs +++ b/Tiles/PerennialBrick.cs @@ -12,8 +12,8 @@ namespace CalamityMod.Tiles Main.tileMergeDirt[Type] = false; Main.tileBlockLight[Type] = true; - TileMerge.MergeGeneralTiles(Type); - TileMerge.MergeDecorativeTiles(Type); + CalamityUtils.MergeWithGeneral(Type); + CalamityUtils.MergeDecorativeTiles(Type); drop = ModContent.ItemType(); soundType = 21; diff --git a/Tiles/SunkenSea/EutrophicSand.cs b/Tiles/SunkenSea/EutrophicSand.cs index 5799b54228..1484ea1ec7 100644 --- a/Tiles/SunkenSea/EutrophicSand.cs +++ b/Tiles/SunkenSea/EutrophicSand.cs @@ -14,8 +14,8 @@ namespace CalamityMod.Tiles.SunkenSea Main.tileSolid[Type] = true; Main.tileBlockLight[Type] = true; - TileMerge.MergeGeneralTiles(Type); - TileMerge.MergeDesertTiles(Type); + CalamityUtils.MergeWithGeneral(Type); + CalamityUtils.MergeWithDesert(Type); TileID.Sets.ChecksForMerge[Type] = true; dustType = 108; @@ -43,8 +43,8 @@ namespace CalamityMod.Tiles.SunkenSea public override bool TileFrame(int i, int j, ref bool resetFrame, ref bool noBreak) { - // CustomTileFraming.FrameTileForCustomMerge(i, j, Type, TileID.Sandstone, false, false, false, false, resetFrame); - CustomTileFraming.FrameTileForCustomMergeFrom(i, j, Type, TileID.Sandstone); + // CustomTileFraming.CustomMergeFrame(i, j, Type, TileID.Sandstone, false, false, false, false, resetFrame); + TileFraming.CustomMergeFrame(i, j, Type, TileID.Sandstone); return false; } } diff --git a/Tiles/SunkenSea/Navystone.cs b/Tiles/SunkenSea/Navystone.cs index 295edd9f00..9fd08dd66c 100644 --- a/Tiles/SunkenSea/Navystone.cs +++ b/Tiles/SunkenSea/Navystone.cs @@ -14,8 +14,8 @@ namespace CalamityMod.Tiles.SunkenSea Main.tileSolid[Type] = true; Main.tileBlockLight[Type] = true; - TileMerge.MergeGeneralTiles(Type); - TileMerge.MergeDesertTiles(Type); + CalamityUtils.MergeWithGeneral(Type); + CalamityUtils.MergeWithDesert(Type); TileID.Sets.ChecksForMerge[Type] = true; dustType = 96; @@ -102,8 +102,8 @@ namespace CalamityMod.Tiles.SunkenSea public override bool TileFrame(int i, int j, ref bool resetFrame, ref bool noBreak) { - // CustomTileFraming.FrameTileForCustomMerge(i, j, Type, ModContent.TileType(), false, false, false, false, resetFrame); - CustomTileFraming.FrameTileForCustomMergeFrom(i, j, Type, ModContent.TileType()); + // CustomTileFraming.CustomMergeFrame(i, j, Type, ModContent.TileType(), false, false, false, false, resetFrame); + TileFraming.CustomMergeFrame(i, j, Type, ModContent.TileType()); return false; } } diff --git a/Tiles/SunkenSea/SeaPrism.cs b/Tiles/SunkenSea/SeaPrism.cs index 88337420d1..3e7157d9a1 100644 --- a/Tiles/SunkenSea/SeaPrism.cs +++ b/Tiles/SunkenSea/SeaPrism.cs @@ -14,8 +14,8 @@ namespace CalamityMod.Tiles.SunkenSea Main.tileSolid[Type] = true; Main.tileBlockLight[Type] = true; - TileMerge.MergeGeneralTiles(Type); - TileMerge.MergeDesertTiles(Type); + CalamityUtils.MergeWithGeneral(Type); + CalamityUtils.MergeWithDesert(Type); TileID.Sets.ChecksForMerge[Type] = true; dustType = 33; @@ -103,7 +103,7 @@ namespace CalamityMod.Tiles.SunkenSea public override bool TileFrame(int i, int j, ref bool resetFrame, ref bool noBreak) { - CustomTileFraming.FrameTileForCustomMerge(i, j, Type, ModContent.TileType(), false, false, false, false, resetFrame); + TileFraming.CustomMergeFrame(i, j, Type, ModContent.TileType(), false, false, false, false, resetFrame); return false; } } diff --git a/Tiles/UelibloomBrick.cs b/Tiles/UelibloomBrick.cs index 8d1fbb6ccd..8143c2eb61 100644 --- a/Tiles/UelibloomBrick.cs +++ b/Tiles/UelibloomBrick.cs @@ -17,8 +17,8 @@ namespace CalamityMod.Tiles Main.tileMergeDirt[Type] = false; Main.tileBlockLight[Type] = true; - TileMerge.MergeGeneralTiles(Type); - TileMerge.MergeDecorativeTiles(Type); + CalamityUtils.MergeWithGeneral(Type); + CalamityUtils.MergeDecorativeTiles(Type); soundType = 21; minPick = 200; @@ -46,7 +46,7 @@ namespace CalamityMod.Tiles public override bool TileFrame(int i, int j, ref bool resetFrame, ref bool noBreak) { - return CustomTileFraming.BrimstoneFraming(i, j, resetFrame); + return TileFraming.BrimstoneFraming(i, j, resetFrame); } public override void SpecialDraw(int i, int j, SpriteBatch spriteBatch) diff --git a/Utilities/CalamityUtils.cs b/Utilities/CalamityUtils.cs index f0e56e7991..ac73be1d06 100644 --- a/Utilities/CalamityUtils.cs +++ b/Utilities/CalamityUtils.cs @@ -2,6 +2,20 @@ using CalamityMod.Items; using CalamityMod.NPCs; using CalamityMod.Projectiles; +using CalamityMod.Tiles; +using CalamityMod.Tiles.Abyss; +using CalamityMod.Tiles.Astral; +using CalamityMod.Tiles.AstralDesert; +using CalamityMod.Tiles.AstralSnow; +using CalamityMod.Tiles.Crags; +using CalamityMod.Tiles.FurnitureAbyss; +using CalamityMod.Tiles.FurnitureAshen; +using CalamityMod.Tiles.FurnitureEutrophic; +using CalamityMod.Tiles.FurnitureOccult; +using CalamityMod.Tiles.FurnitureProfaned; +using CalamityMod.Tiles.FurnitureVoid; +using CalamityMod.Tiles.Ores; +using CalamityMod.Tiles.SunkenSea; using CalamityMod.World; using Microsoft.Xna.Framework; using Microsoft.Xna.Framework.Graphics; @@ -9,6 +23,7 @@ using System; using System.Collections.Generic; using System.Linq; using System.Reflection; +using System.Text; using Terraria; using Terraria.DataStructures; using Terraria.Enums; @@ -312,6 +327,31 @@ namespace CalamityMod #endregion #region Tile Utilities + public static void SafeSquareTileFrame(int x, int y, bool resetFrame = true) + { + if (Main.tile[x, y] is null) + return; + + for (int xIter = x - 1; xIter <= x + 1; ++xIter) + { + if (xIter < 0 || xIter >= Main.maxTilesX) + continue; + for (int yIter = y - 1; yIter <= y + 1; yIter++) + { + if (yIter < 0 || yIter >= Main.maxTilesY) + continue; + if (xIter == x && yIter == y) + { + WorldGen.TileFrame(x, y, resetFrame, false); + } + else + { + WorldGen.TileFrame(xIter, yIter, false, false); + } + } + } + } + public static void LightHitWire(int type, int i, int j, int tileX, int tileY) { int x = i - Main.tile[i, j].frameX / 18 % tileX; @@ -349,6 +389,231 @@ namespace CalamityMod } } + #region Tile Merge Utilities + /// + /// Sets the mergeability state of two tiles. By default, enables tile merging. + /// + /// The first tile type which should merge (or not). + /// The second tile type which should merge (or not). + /// The mergeability state of the tiles. Defaults to true if omitted. + public static void SetMerge(int type1, int type2, bool merge = true) + { + if (type1 != type2) + { + Main.tileMerge[type1][type2] = merge; + Main.tileMerge[type2][type1] = merge; + } + } + + /// + /// Makes the first tile type argument merge with all the other tile type arguments. Also accepts arrays. + /// + /// The tile whose merging properties will be set. + /// Every tile that should be merged with. + public static void MergeWithSet(int myType, params int[] otherTypes) + { + for (int i = 0; i < otherTypes.Length; ++i) + SetMerge(myType, otherTypes[i]); + } + + /// + /// Makes the specified tile merge with the most common types of tiles found in world generation.

+ /// Notably excludes Ice. + ///
+ /// The tile whose merging properties will be set. + public static void MergeWithGeneral(int type) => MergeWithSet(type, new int[] { + // Soils + TileID.Dirt, + TileID.Mud, + TileID.ClayBlock, + // Stones + TileID.Stone, + TileID.Ebonstone, + TileID.Crimstone, + TileID.Pearlstone, + // Sands + TileID.Sand, + TileID.Ebonsand, + TileID.Crimsand, + TileID.Pearlsand, + // Snows + TileID.SnowBlock, + // Calamity Tiles + ModContent.TileType(), + ModContent.TileType(), + ModContent.TileType(), + ModContent.TileType(), + ModContent.TileType(), + ModContent.TileType(), + }); + + /// + /// Makes the specified tile merge with all ores, vanilla and Calamity. Particularly useful for stone blocks. + /// + /// The tile whose merging properties will be set. + public static void MergeWithOres(int type) => MergeWithSet(type, new int[] { + // Vanilla Ores + TileID.Copper, + TileID.Tin, + TileID.Iron, + TileID.Lead, + TileID.Silver, + TileID.Tungsten, + TileID.Gold, + TileID.Demonite, + TileID.Crimtane, + TileID.Cobalt, + TileID.Palladium, + TileID.Mythril, + TileID.Platinum, + TileID.Orichalcum, + TileID.Adamantite, + TileID.Titanium, + TileID.LunarOre, + // Calamity Ores + ModContent.TileType(), + ModContent.TileType(), + ModContent.TileType(), + ModContent.TileType(), + ModContent.TileType(), + ModContent.TileType(), + ModContent.TileType(), + ModContent.TileType(), + }); + + /// + /// Makes the specified tile merge with all types of desert tiles, including the Calamity Sunken Sea. + /// + /// The tile whose merging properties will be set. + public static void MergeWithDesert(int type) => MergeWithSet(type, new int[] { + // Sands + TileID.Sand, + TileID.Ebonsand, + TileID.Crimsand, + TileID.Pearlsand, + // Hardened Sands + TileID.HardenedSand, + TileID.CorruptHardenedSand, + TileID.CrimsonHardenedSand, + TileID.HallowHardenedSand, + // Sandstones + TileID.Sandstone, + TileID.CorruptSandstone, + TileID.CrimsonSandstone, + TileID.HallowSandstone, + // Miscellaneous Desert Tiles + TileID.FossilOre, + TileID.DesertFossil, + // Astral Desert + ModContent.TileType(), + ModContent.TileType(), + ModContent.TileType(), + // Sunken Sea + ModContent.TileType(), + ModContent.TileType(), + ModContent.TileType(), + }); + + /// + /// Makes the specified tile merge with all types of snow and ice tiles. + /// + /// The tile whose merging properties will be set. + public static void MergeWithSnow(int type) => MergeWithSet(type, new int[] { + // Snows + TileID.SnowBlock, + // Ices + TileID.IceBlock, + TileID.CorruptIce, + TileID.FleshIce, + TileID.HallowedIce, + // Astral Snow + ModContent.TileType(), + ModContent.TileType(), + }); + + /// + /// Makes the specified tile merge with all tiles which generate in hell. Does not include Charred Ore. + /// + /// The tile whose merging properties will be set. + public static void MergeWithHell(int type) => MergeWithSet(type, new int[] { + TileID.Ash, + TileID.Hellstone, + TileID.ObsidianBrick, + TileID.HellstoneBrick, + ModContent.TileType(), + }); + + /// + /// Makes the specified tile merge with all tiles which generate in the Abyss or the Sulphurous Sea. Includes Chaotic Ore. + /// + /// The tile whose merging properties will be set. + public static void MergeWithAbyss(int type) => MergeWithSet(type, new int[] { + // Sulphurous Sea + ModContent.TileType(), + // Abyss + ModContent.TileType(), + ModContent.TileType(), + ModContent.TileType(), + ModContent.TileType(), + ModContent.TileType(), + }); + + /// + /// Makes the tile merge with all the tile types that generate within various types of astral tiles + /// + /// + public static void MergeAstralTiles(int type) + { + //Astral + SetMerge(type, ModContent.TileType()); + SetMerge(type, ModContent.TileType()); + SetMerge(type, ModContent.TileType()); + //Astral Desert + SetMerge(type, ModContent.TileType()); + SetMerge(type, ModContent.TileType()); + SetMerge(type, ModContent.TileType()); + //Astral Snow + SetMerge(type, ModContent.TileType()); + SetMerge(type, ModContent.TileType()); + } + + /// + /// Makes the tile merge with all the decorative 'smooth' tiles + /// + /// + public static void MergeSmoothTiles(int type) + { + //Vanilla + SetMerge(type, TileID.MarbleBlock); + SetMerge(type, TileID.GraniteBlock); + //Calam + SetMerge(type, ModContent.TileType()); + SetMerge(type, ModContent.TileType()); + SetMerge(type, ModContent.TileType()); + SetMerge(type, ModContent.TileType()); + } + + /// + /// Makes the tile merge with other mergable decorative tiles + /// + /// + public static void MergeDecorativeTiles(int type) + { + //Vanilla decor + Main.tileBrick[type] = true; + //Calam + SetMerge(type, ModContent.TileType()); + SetMerge(type, ModContent.TileType()); + SetMerge(type, ModContent.TileType()); + SetMerge(type, ModContent.TileType()); + SetMerge(type, ModContent.TileType()); + SetMerge(type, ModContent.TileType()); + SetMerge(type, ModContent.TileType()); + SetMerge(type, ModContent.TileType()); + } + #endregion + + #region Furniture Interaction public static bool BedRightClick(int i, int j) { Player player = Main.LocalPlayer; @@ -860,14 +1125,20 @@ namespace CalamityMod player.showItemIcon2 = 0; } } + #endregion #region Furniture SetDefaults - public static void SetUpBathtub(int type, bool lavaImmune = false) + /// + /// Extension which initializes a ModTile to be a bathtub. + /// + /// The ModTile which is being initialized. + /// Whether this tile is supposed to be immune to lava. Defaults to false. + internal static void SetUpBathtub(this ModTile mt, bool lavaImmune = false) { - Main.tileLighted[type] = true; - Main.tileFrameImportant[type] = true; - Main.tileLavaDeath[type] = !lavaImmune; - Main.tileWaterDeath[type] = false; + Main.tileLighted[mt.Type] = true; + Main.tileFrameImportant[mt.Type] = true; + Main.tileLavaDeath[mt.Type] = !lavaImmune; + Main.tileWaterDeath[mt.Type] = false; TileObjectData.newTile.Width = 4; TileObjectData.newTile.Height = 2; TileObjectData.newTile.CoordinateHeights = new int[] { 16, 18 }; @@ -882,15 +1153,23 @@ namespace CalamityMod TileObjectData.newAlternate.CopyFrom(TileObjectData.newTile); TileObjectData.newAlternate.Direction = TileObjectDirection.PlaceRight; TileObjectData.addAlternate(1); - TileObjectData.addTile(type); + TileObjectData.addTile(mt.Type); + + // All bathtubs count as tables. + mt.AddToArray(ref TileID.Sets.RoomNeeds.CountsAsTable); } - public static void SetUpBed(int type, bool lavaImmune = false) + /// + /// Extension which initializes a ModTile to be a bed. + /// + /// The ModTile which is being initialized. + /// Whether this tile is supposed to be immune to lava. Defaults to false. + internal static void SetUpBed(this ModTile mt, bool lavaImmune = false) { - Main.tileFrameImportant[type] = true; - Main.tileLavaDeath[type] = !lavaImmune; - Main.tileWaterDeath[type] = false; - TileID.Sets.HasOutlines[type] = true; + Main.tileFrameImportant[mt.Type] = true; + Main.tileLavaDeath[mt.Type] = !lavaImmune; + Main.tileWaterDeath[mt.Type] = false; + TileID.Sets.HasOutlines[mt.Type] = true; TileObjectData.newTile.Width = 4; TileObjectData.newTile.Height = 2; TileObjectData.newTile.CoordinateHeights = new int[] { 16, 18 }; @@ -905,51 +1184,83 @@ namespace CalamityMod TileObjectData.newAlternate.CopyFrom(TileObjectData.newTile); TileObjectData.newAlternate.Direction = TileObjectDirection.PlaceRight; TileObjectData.addAlternate(1); - TileObjectData.addTile(type); + TileObjectData.addTile(mt.Type); + + // All beds count as chairs. + mt.AddToArray(ref TileID.Sets.RoomNeeds.CountsAsChair); } - public static void SetUpBookcase(int type, bool lavaImmune = false) + /// + /// Extension which initializes a ModTile to be a bookcase. + /// + /// The ModTile which is being initialized. + /// Whether this tile is supposed to be immune to lava. Defaults to false. + internal static void SetUpBookcase(this ModTile mt, bool lavaImmune = false) { - Main.tileSolidTop[type] = true; - Main.tileLighted[type] = true; - Main.tileFrameImportant[type] = true; - Main.tileTable[type] = true; - Main.tileLavaDeath[type] = !lavaImmune; - Main.tileWaterDeath[type] = false; + Main.tileSolidTop[mt.Type] = true; + Main.tileLighted[mt.Type] = true; + Main.tileFrameImportant[mt.Type] = true; + Main.tileTable[mt.Type] = true; + Main.tileLavaDeath[mt.Type] = !lavaImmune; + Main.tileWaterDeath[mt.Type] = false; TileObjectData.newTile.CopyFrom(TileObjectData.Style3x4); TileObjectData.newTile.LavaDeath = !lavaImmune; - TileObjectData.addTile(type); + TileObjectData.addTile(mt.Type); + + // All bookcases count as tables. + mt.AddToArray(ref TileID.Sets.RoomNeeds.CountsAsTable); } - public static void SetUpCandelabra(int type, bool lavaImmune = false) + /// + /// Extension which initializes a ModTile to be a candelabra. + /// + /// The ModTile which is being initialized. + /// Whether this tile is supposed to be immune to lava. Defaults to false. + internal static void SetUpCandelabra(this ModTile mt, bool lavaImmune = false) { - Main.tileLighted[type] = true; - Main.tileFrameImportant[type] = true; - Main.tileLavaDeath[type] = true; - Main.tileWaterDeath[type] = false; + Main.tileLighted[mt.Type] = true; + Main.tileFrameImportant[mt.Type] = true; + Main.tileLavaDeath[mt.Type] = true; + Main.tileWaterDeath[mt.Type] = false; TileObjectData.newTile.CopyFrom(TileObjectData.Style2x2); TileObjectData.newTile.LavaDeath = !lavaImmune; - TileObjectData.addTile(type); + TileObjectData.addTile(mt.Type); + + // All candelabras count as light sources. + mt.AddToArray(ref TileID.Sets.RoomNeeds.CountsAsTorch); } - public static void SetUpCandle(int type, bool lavaImmune = false) + /// + /// Extension which initializes a ModTile to be a candle. + /// + /// The ModTile which is being initialized. + /// Whether this tile is supposed to be immune to lava. Defaults to false. + internal static void SetUpCandle(this ModTile mt, bool lavaImmune = false) { - Main.tileLighted[type] = true; - Main.tileFrameImportant[type] = true; - Main.tileLavaDeath[type] = !lavaImmune; - Main.tileWaterDeath[type] = false; + Main.tileLighted[mt.Type] = true; + Main.tileFrameImportant[mt.Type] = true; + Main.tileLavaDeath[mt.Type] = !lavaImmune; + Main.tileWaterDeath[mt.Type] = false; TileObjectData.newTile.CopyFrom(TileObjectData.StyleOnTable1x1); TileObjectData.newTile.CoordinateHeights = new int[] { 20 }; TileObjectData.newTile.LavaDeath = !lavaImmune; - TileObjectData.addTile(type); + TileObjectData.addTile(mt.Type); + + // All candles count as light sources. + mt.AddToArray(ref TileID.Sets.RoomNeeds.CountsAsTorch); } - public static void SetUpChair(int type, bool lavaImmune = false) + /// + /// Extension which initializes a ModTile to be a chair. + /// + /// The ModTile which is being initialized. + /// Whether this tile is supposed to be immune to lava. Defaults to false. + internal static void SetUpChair(this ModTile mt, bool lavaImmune = false) { - Main.tileFrameImportant[type] = true; - Main.tileNoAttach[type] = true; - Main.tileLavaDeath[type] = !lavaImmune; - Main.tileWaterDeath[type] = false; + Main.tileFrameImportant[mt.Type] = true; + Main.tileNoAttach[mt.Type] = true; + Main.tileLavaDeath[mt.Type] = !lavaImmune; + Main.tileWaterDeath[mt.Type] = false; TileObjectData.newTile.CopyFrom(TileObjectData.Style1x2); TileObjectData.newTile.CoordinateHeights = new int[] { 16, 18 }; TileObjectData.newTile.Direction = TileObjectDirection.PlaceLeft; @@ -960,16 +1271,24 @@ namespace CalamityMod TileObjectData.newAlternate.CopyFrom(TileObjectData.newTile); TileObjectData.newAlternate.Direction = TileObjectDirection.PlaceRight; TileObjectData.addAlternate(1); - TileObjectData.addTile(type); + TileObjectData.addTile(mt.Type); + + // As you could probably guess, all chairs count as chairs. + mt.AddToArray(ref TileID.Sets.RoomNeeds.CountsAsChair); } - public static void SetUpChandelier(int type, bool lavaImmune = false) + /// + /// Extension which initializes a ModTile to be a chandelier. + /// + /// The ModTile which is being initialized. + /// Whether this tile is supposed to be immune to lava. Defaults to false. + internal static void SetUpChandelier(this ModTile mt, bool lavaImmune = false) { - Main.tileLighted[type] = true; - Main.tileFrameImportant[type] = true; - Main.tileNoAttach[type] = true; - Main.tileLavaDeath[type] = !lavaImmune; - Main.tileWaterDeath[type] = false; + Main.tileLighted[mt.Type] = true; + Main.tileFrameImportant[mt.Type] = true; + Main.tileNoAttach[mt.Type] = true; + Main.tileLavaDeath[mt.Type] = !lavaImmune; + Main.tileWaterDeath[mt.Type] = false; TileObjectData.newTile.Width = 3; TileObjectData.newTile.Height = 3; TileObjectData.newTile.CoordinateHeights = new int[] { 16, 16, 16 }; @@ -979,19 +1298,26 @@ namespace CalamityMod TileObjectData.newTile.UsesCustomCanPlace = true; TileObjectData.newTile.AnchorTop = new AnchorData(AnchorType.SolidTile, 1, 1); TileObjectData.newTile.LavaDeath = !lavaImmune; - TileObjectData.addTile(type); + TileObjectData.addTile(mt.Type); + + // All chandeliers count as light sources. + mt.AddToArray(ref TileID.Sets.RoomNeeds.CountsAsTorch); } - public static void SetUpChest(int type) + /// + /// Extension which initializes a ModTile to be a chest. + /// + /// The ModTile which is being initialized. + internal static void SetUpChest(this ModTile mt) { - Main.tileSpelunker[type] = true; - Main.tileContainer[type] = true; - Main.tileShine2[type] = true; - Main.tileShine[type] = 1200; - Main.tileFrameImportant[type] = true; - Main.tileNoAttach[type] = true; - Main.tileValue[type] = 500; - TileID.Sets.HasOutlines[type] = true; + Main.tileSpelunker[mt.Type] = true; + Main.tileContainer[mt.Type] = true; + Main.tileShine2[mt.Type] = true; + Main.tileShine[mt.Type] = 1200; + Main.tileFrameImportant[mt.Type] = true; + Main.tileNoAttach[mt.Type] = true; + Main.tileValue[mt.Type] = 500; + TileID.Sets.HasOutlines[mt.Type] = true; TileObjectData.newTile.CopyFrom(TileObjectData.Style2x2); TileObjectData.newTile.Origin = new Point16(0, 1); TileObjectData.newTile.CoordinateHeights = new int[] { 16, 18 }; @@ -1001,15 +1327,20 @@ namespace CalamityMod TileObjectData.newTile.StyleHorizontal = true; TileObjectData.newTile.LavaDeath = false; TileObjectData.newTile.AnchorBottom = new AnchorData(AnchorType.SolidTile | AnchorType.SolidWithTop | AnchorType.SolidSide, TileObjectData.newTile.Width, 0); - TileObjectData.addTile(type); + TileObjectData.addTile(mt.Type); } - public static void SetUpClock(int type, bool lavaImmune = false) + /// + /// Extension which initializes a ModTile to be a clock. + /// + /// The ModTile which is being initialized. + /// Whether this tile is supposed to be immune to lava. Defaults to false. + internal static void SetUpClock(this ModTile mt, bool lavaImmune = false) { - Main.tileFrameImportant[type] = true; - Main.tileNoAttach[type] = true; - Main.tileLavaDeath[type] = !lavaImmune; - TileID.Sets.HasOutlines[type] = true; + Main.tileFrameImportant[mt.Type] = true; + Main.tileNoAttach[mt.Type] = true; + Main.tileLavaDeath[mt.Type] = !lavaImmune; + TileID.Sets.HasOutlines[mt.Type] = true; TileObjectData.newTile.CopyFrom(TileObjectData.Style2xX); TileObjectData.newTile.Height = 5; TileObjectData.newTile.CoordinateHeights = new int[] @@ -1023,20 +1354,25 @@ namespace CalamityMod TileObjectData.newTile.Origin = new Point16(0, 4); TileObjectData.newTile.UsesCustomCanPlace = true; TileObjectData.newTile.LavaDeath = !lavaImmune; - TileObjectData.addTile(type); + TileObjectData.addTile(mt.Type); } - public static void SetUpDoorClosed(int type, bool lavaImmune = false) + /// + /// Extension which initializes a ModTile to be a closed door. + /// + /// The ModTile which is being initialized. + /// Whether this tile is supposed to be immune to lava. Defaults to false. + internal static void SetUpDoorClosed(this ModTile mt, bool lavaImmune = false) { - Main.tileFrameImportant[type] = true; - Main.tileBlockLight[type] = true; - Main.tileSolid[type] = true; - Main.tileNoAttach[type] = true; - Main.tileLavaDeath[type] = !lavaImmune; - Main.tileWaterDeath[type] = false; - TileID.Sets.NotReallySolid[type] = true; - TileID.Sets.DrawsWalls[type] = true; - TileID.Sets.HasOutlines[type] = true; + Main.tileFrameImportant[mt.Type] = true; + Main.tileBlockLight[mt.Type] = true; + Main.tileSolid[mt.Type] = true; + Main.tileNoAttach[mt.Type] = true; + Main.tileLavaDeath[mt.Type] = !lavaImmune; + Main.tileWaterDeath[mt.Type] = false; + TileID.Sets.NotReallySolid[mt.Type] = true; + TileID.Sets.DrawsWalls[mt.Type] = true; + TileID.Sets.HasOutlines[mt.Type] = true; TileObjectData.newTile.Width = 1; TileObjectData.newTile.Height = 3; TileObjectData.newTile.Origin = new Point16(0, 0); @@ -1054,16 +1390,24 @@ namespace CalamityMod TileObjectData.newAlternate.CopyFrom(TileObjectData.newTile); TileObjectData.newAlternate.Origin = new Point16(0, 2); TileObjectData.addAlternate(0); - TileObjectData.addTile(type); + TileObjectData.addTile(mt.Type); + + // As you could probably guess, all closed doors count as doors. + mt.AddToArray(ref TileID.Sets.RoomNeeds.CountsAsDoor); } - public static void SetUpDoorOpen(int type, bool lavaImmune = false) + /// + /// Extension which initializes a ModTile to be an open door. + /// + /// The ModTile which is being initialized. + /// Whether this tile is supposed to be immune to lava. Defaults to false. + internal static void SetUpDoorOpen(this ModTile mt, bool lavaImmune = false) { - Main.tileFrameImportant[type] = true; - Main.tileSolid[type] = false; - Main.tileLavaDeath[type] = !lavaImmune; - Main.tileWaterDeath[type] = false; - Main.tileNoSunLight[type] = true; + Main.tileFrameImportant[mt.Type] = true; + Main.tileSolid[mt.Type] = false; + Main.tileLavaDeath[mt.Type] = !lavaImmune; + Main.tileWaterDeath[mt.Type] = false; + Main.tileNoSunLight[mt.Type] = true; TileObjectData.newTile.Width = 2; TileObjectData.newTile.Height = 3; TileObjectData.newTile.Origin = new Point16(0, 0); @@ -1103,21 +1447,28 @@ namespace CalamityMod TileObjectData.newAlternate.AnchorBottom = new AnchorData(AnchorType.SolidTile, 1, 1); TileObjectData.newAlternate.Direction = TileObjectDirection.PlaceLeft; TileObjectData.addAlternate(1); - TileObjectData.addTile(type); - TileID.Sets.HousingWalls[type] = true; - TileID.Sets.HasOutlines[type] = true; + TileObjectData.addTile(mt.Type); + TileID.Sets.HousingWalls[mt.Type] = true; + TileID.Sets.HasOutlines[mt.Type] = true; + + // As you could probably guess, all open doors count as doors. + mt.AddToArray(ref TileID.Sets.RoomNeeds.CountsAsDoor); } - public static void SetUpDresser(int type) + /// + /// Extension which initializes a ModTile to be a dresser. + /// + /// The ModTile which is being initialized. + internal static void SetUpDresser(this ModTile mt) { - Main.tileSolidTop[type] = true; - Main.tileFrameImportant[type] = true; - Main.tileNoAttach[type] = true; - Main.tileTable[type] = true; - Main.tileContainer[type] = true; - Main.tileWaterDeath[type] = false; - Main.tileLavaDeath[type] = false; - TileID.Sets.HasOutlines[type] = true; + Main.tileSolidTop[mt.Type] = true; + Main.tileFrameImportant[mt.Type] = true; + Main.tileNoAttach[mt.Type] = true; + Main.tileTable[mt.Type] = true; + Main.tileContainer[mt.Type] = true; + Main.tileWaterDeath[mt.Type] = false; + Main.tileLavaDeath[mt.Type] = false; + TileID.Sets.HasOutlines[mt.Type] = true; TileObjectData.newTile.CopyFrom(TileObjectData.Style3x2); TileObjectData.newTile.Origin = new Point16(1, 1); TileObjectData.newTile.CoordinateHeights = new int[] { 16, 16 }; @@ -1127,102 +1478,170 @@ namespace CalamityMod TileObjectData.newTile.StyleHorizontal = true; TileObjectData.newTile.LavaDeath = false; TileObjectData.newTile.AnchorBottom = new AnchorData(AnchorType.SolidTile | AnchorType.SolidWithTop | AnchorType.SolidSide, TileObjectData.newTile.Width, 0); - TileObjectData.addTile(type); + TileObjectData.addTile(mt.Type); + + // All dressers count as tables. + mt.AddToArray(ref TileID.Sets.RoomNeeds.CountsAsTable); } - public static void SetUpLamp(int type, bool lavaImmune = false) + /// + /// Extension which initializes a ModTile to be a floor lamp. + /// + /// The ModTile which is being initialized. + /// Whether this tile is supposed to be immune to lava. Defaults to false. + internal static void SetUpLamp(this ModTile mt, bool lavaImmune = false) { - Main.tileLighted[type] = true; - Main.tileFrameImportant[type] = true; - Main.tileLavaDeath[type] = !lavaImmune; - Main.tileWaterDeath[type] = false; + Main.tileLighted[mt.Type] = true; + Main.tileFrameImportant[mt.Type] = true; + Main.tileLavaDeath[mt.Type] = !lavaImmune; + Main.tileWaterDeath[mt.Type] = false; TileObjectData.newTile.CopyFrom(TileObjectData.Style1xX); TileObjectData.newTile.LavaDeath = !lavaImmune; - TileObjectData.addTile(type); + TileObjectData.addTile(mt.Type); + + // All floor lamps count as light sources. + mt.AddToArray(ref TileID.Sets.RoomNeeds.CountsAsTorch); } - public static void SetUpLantern(int type, bool lavaImmune = false) + /// + /// Extension which initializes a ModTile to be a hanging lantern. + /// + /// The ModTile which is being initialized. + /// Whether this tile is supposed to be immune to lava. Defaults to false. + internal static void SetUpLantern(this ModTile mt, bool lavaImmune = false) { - Main.tileLighted[type] = true; - Main.tileFrameImportant[type] = true; - Main.tileLavaDeath[type] = !lavaImmune; - Main.tileWaterDeath[type] = false; + Main.tileLighted[mt.Type] = true; + Main.tileFrameImportant[mt.Type] = true; + Main.tileLavaDeath[mt.Type] = !lavaImmune; + Main.tileWaterDeath[mt.Type] = false; TileObjectData.newTile.CopyFrom(TileObjectData.Style1x2Top); TileObjectData.newTile.LavaDeath = !lavaImmune; - TileObjectData.addTile(type); + TileObjectData.addTile(mt.Type); + + // All hanging lanterns count as light sources. + mt.AddToArray(ref TileID.Sets.RoomNeeds.CountsAsTorch); } - public static void SetUpPiano(int type, bool lavaImmune = false) + /// + /// Extension which initializes a ModTile to be a piano. + /// + /// The ModTile which is being initialized. + /// Whether this tile is supposed to be immune to lava. Defaults to false. + internal static void SetUpPiano(this ModTile mt, bool lavaImmune = false) { - Main.tileLighted[type] = true; - Main.tileFrameImportant[type] = true; - Main.tileLavaDeath[type] = !lavaImmune; - Main.tileWaterDeath[type] = false; + Main.tileLighted[mt.Type] = true; + Main.tileFrameImportant[mt.Type] = true; + Main.tileLavaDeath[mt.Type] = !lavaImmune; + Main.tileWaterDeath[mt.Type] = false; TileObjectData.newTile.CopyFrom(TileObjectData.Style3x2); - TileObjectData.addTile(type); + TileObjectData.addTile(mt.Type); + + // All pianos count as tables. + mt.AddToArray(ref TileID.Sets.RoomNeeds.CountsAsTable); } - public static void SetUpSink(int type, bool lavaImmune = false) + /// + /// Extension which initializes a ModTile to be a platform. + /// + /// The ModTile which is being initialized. + /// Whether this tile is supposed to be immune to lava. Defaults to false. + internal static void SetUpPlatform(this ModTile mt, bool lavaImmune = false) { - Main.tileLighted[type] = true; - Main.tileFrameImportant[type] = true; - Main.tileLavaDeath[type] = !lavaImmune; - Main.tileWaterDeath[type] = false; + Main.tileLighted[mt.Type] = true; + Main.tileFrameImportant[mt.Type] = true; + Main.tileSolidTop[mt.Type] = true; + Main.tileSolid[mt.Type] = true; + Main.tileNoAttach[mt.Type] = true; + Main.tileTable[mt.Type] = true; + Main.tileLavaDeath[mt.Type] = !lavaImmune; + TileID.Sets.Platforms[mt.Type] = true; + TileObjectData.newTile.CoordinateHeights = new int[] { 16 }; + TileObjectData.newTile.CoordinateWidth = 16; + TileObjectData.newTile.CoordinatePadding = 2; + TileObjectData.newTile.StyleHorizontal = true; + TileObjectData.newTile.StyleMultiplier = 27; + TileObjectData.newTile.StyleWrapLimit = 27; + TileObjectData.newTile.UsesCustomCanPlace = false; + TileObjectData.newTile.LavaDeath = !lavaImmune; + TileObjectData.addTile(mt.Type); + + // All platforms count as doors (so that you may have top-or-bottom entry/exit rooms) + mt.AddToArray(ref TileID.Sets.RoomNeeds.CountsAsDoor); + } + + /// + /// Extension which initializes a ModTile to be a sink. + /// + /// The ModTile which is being initialized. + /// Whether this tile is supposed to be immune to lava. Defaults to false. + internal static void SetUpSink(this ModTile mt, bool lavaImmune = false) + { + Main.tileLighted[mt.Type] = true; + Main.tileFrameImportant[mt.Type] = true; + Main.tileLavaDeath[mt.Type] = !lavaImmune; + Main.tileWaterDeath[mt.Type] = false; TileObjectData.newTile.CopyFrom(TileObjectData.Style2x2); TileObjectData.newTile.LavaDeath = !lavaImmune; - TileObjectData.addTile(type); + TileObjectData.addTile(mt.Type); } - public static void SetUpSofa(int type, bool lavaImmune = false) + /// + /// Extension which initializes a ModTile to be a sofa. + /// + /// The ModTile which is being initialized. + /// Whether this tile is supposed to be immune to lava. Defaults to false. + internal static void SetUpSofa(this ModTile mt, bool lavaImmune = false) { - Main.tileLighted[type] = true; - Main.tileFrameImportant[type] = true; - Main.tileLavaDeath[type] = !lavaImmune; - Main.tileWaterDeath[type] = false; + Main.tileLighted[mt.Type] = true; + Main.tileFrameImportant[mt.Type] = true; + Main.tileLavaDeath[mt.Type] = !lavaImmune; + Main.tileWaterDeath[mt.Type] = false; TileObjectData.newTile.CopyFrom(TileObjectData.Style3x2); TileObjectData.newTile.LavaDeath = !lavaImmune; - TileObjectData.addTile(type); + TileObjectData.addTile(mt.Type); + + // All sofas count as chairs. + mt.AddToArray(ref TileID.Sets.RoomNeeds.CountsAsChair); } - public static void SetUpTable(int type, bool lavaImmune = false) + /// + /// Extension which initializes a ModTile to be a table. + /// + /// The ModTile which is being initialized. + /// Whether this tile is supposed to be immune to lava. Defaults to false. + internal static void SetUpTable(this ModTile mt, bool lavaImmune = false) { - Main.tileSolidTop[type] = true; - Main.tileLighted[type] = true; - Main.tileFrameImportant[type] = true; - Main.tileNoAttach[type] = true; - Main.tileTable[type] = true; - Main.tileLavaDeath[type] = !lavaImmune; - Main.tileWaterDeath[type] = false; + Main.tileSolidTop[mt.Type] = true; + Main.tileLighted[mt.Type] = true; + Main.tileFrameImportant[mt.Type] = true; + Main.tileNoAttach[mt.Type] = true; + Main.tileTable[mt.Type] = true; + Main.tileLavaDeath[mt.Type] = !lavaImmune; + Main.tileWaterDeath[mt.Type] = false; TileObjectData.newTile.CopyFrom(TileObjectData.Style3x2); TileObjectData.newTile.LavaDeath = !lavaImmune; - TileObjectData.addTile(type); + TileObjectData.addTile(mt.Type); + + // As you could probably guess, all tables count as tables. + mt.AddToArray(ref TileID.Sets.RoomNeeds.CountsAsTable); } - public static void SetUpWorkBench(int type, bool lavaImmune = false) + /// + /// Extension which initializes a ModTile to be a torch. + /// + /// The ModTile which is being initialized. + /// Whether this tile is supposed to be immune to lava. Defaults to false. + internal static void SetUpTorch(this ModTile mt, bool lavaImmune = false, bool waterImmune = false) { - Main.tileSolidTop[type] = true; - Main.tileFrameImportant[type] = true; - Main.tileNoAttach[type] = true; - Main.tileTable[type] = true; - Main.tileLavaDeath[type] = !lavaImmune; - Main.tileWaterDeath[type] = false; - TileObjectData.newTile.CopyFrom(TileObjectData.Style2x1); - TileObjectData.newTile.CoordinateHeights = new int[] { 18 }; - TileObjectData.newTile.LavaDeath = !lavaImmune; - TileObjectData.addTile(type); - } - - public static void SetUpTorch(int type, bool lavaImmune = false, bool waterImmune = false) - { - Main.tileLighted[type] = true; - Main.tileFrameImportant[type] = true; - Main.tileSolid[type] = false; - Main.tileNoAttach[type] = true; - Main.tileNoFail[type] = true; - Main.tileWaterDeath[type] = !waterImmune; - Main.tileLavaDeath[type] = !lavaImmune; + Main.tileLighted[mt.Type] = true; + Main.tileFrameImportant[mt.Type] = true; + Main.tileSolid[mt.Type] = false; + Main.tileNoAttach[mt.Type] = true; + Main.tileNoFail[mt.Type] = true; + Main.tileWaterDeath[mt.Type] = !waterImmune; + Main.tileLavaDeath[mt.Type] = !lavaImmune; TileObjectData.newTile.CopyFrom(TileObjectData.StyleTorch); TileObjectData.newTile.WaterDeath = !waterImmune; TileObjectData.newTile.LavaDeath = !lavaImmune; @@ -1241,31 +1660,34 @@ namespace CalamityMod TileObjectData.newAlternate.WaterDeath = false; TileObjectData.newAlternate.AnchorWall = true; TileObjectData.addAlternate(0); - TileObjectData.addTile(type); + TileObjectData.addTile(mt.Type); + + // All torches count as light sources. + mt.AddToArray(ref TileID.Sets.RoomNeeds.CountsAsTorch); } - public static void SetUpPlatform(int type, bool lavaImmune = false) + /// + /// Extension which initializes a ModTile to be a work bench. + /// + /// The ModTile which is being initialized. + /// Whether this tile is supposed to be immune to lava. Defaults to false. + internal static void SetUpWorkBench(this ModTile mt, bool lavaImmune = false) { - Main.tileLighted[type] = true; - Main.tileFrameImportant[type] = true; - Main.tileSolidTop[type] = true; - Main.tileSolid[type] = true; - Main.tileNoAttach[type] = true; - Main.tileTable[type] = true; - Main.tileLavaDeath[type] = !lavaImmune; - TileID.Sets.Platforms[type] = true; - TileObjectData.newTile.CoordinateHeights = new int[] { 16 }; - TileObjectData.newTile.CoordinateWidth = 16; - TileObjectData.newTile.CoordinatePadding = 2; - TileObjectData.newTile.StyleHorizontal = true; - TileObjectData.newTile.StyleMultiplier = 27; - TileObjectData.newTile.StyleWrapLimit = 27; - TileObjectData.newTile.UsesCustomCanPlace = false; + Main.tileSolidTop[mt.Type] = true; + Main.tileFrameImportant[mt.Type] = true; + Main.tileNoAttach[mt.Type] = true; + Main.tileTable[mt.Type] = true; + Main.tileLavaDeath[mt.Type] = !lavaImmune; + Main.tileWaterDeath[mt.Type] = false; + TileObjectData.newTile.CopyFrom(TileObjectData.Style2x1); + TileObjectData.newTile.CoordinateHeights = new int[] { 18 }; TileObjectData.newTile.LavaDeath = !lavaImmune; - TileObjectData.addTile(type); + TileObjectData.addTile(mt.Type); + + // All work benches count as tables. + mt.AddToArray(ref TileID.Sets.RoomNeeds.CountsAsTable); } #endregion - #endregion #region Drawing Utilities @@ -1433,6 +1855,33 @@ namespace CalamityMod #endregion #region Miscellaneous Utilities + public static T[] ShuffleArray(T[] array, Random rand = null) + { + if (rand is null) + rand = new Random(); + + for (int i = array.Length; i > 0; --i) + { + int j = rand.Next(i); + T tempElement = array[j]; + array[j] = array[i - 1]; + array[i - 1] = tempElement; + } + return array; + } + + public static string CombineStrings(params object[] args) + { + StringBuilder result = new StringBuilder(1024); + for(int i = 0; i < args.Length; ++i) + { + object o = args[i]; + result.Append(o.ToString()); + result.Append(' '); + } + return result.ToString(); + } + public static void StartSandstorm() { typeof(Terraria.GameContent.Events.Sandstorm).GetMethod("StartSandstorm", BindingFlags.Static | BindingFlags.NonPublic).Invoke(null, null); diff --git a/Utilities/CustomTileFraming.cs b/Utilities/TileFraming.cs similarity index 72% rename from Utilities/CustomTileFraming.cs rename to Utilities/TileFraming.cs index cd4e6164d7..a36f95ea47 100644 --- a/Utilities/CustomTileFraming.cs +++ b/Utilities/TileFraming.cs @@ -1,5 +1,4 @@ -using CalamityMod.Tiles; -using CalamityMod.Tiles.Abyss; +using CalamityMod.Tiles.Abyss; using CalamityMod.Tiles.Astral; using CalamityMod.Tiles.AstralDesert; using CalamityMod.Tiles.AstralSnow; @@ -14,22 +13,40 @@ using Terraria.ModLoader; namespace CalamityMod { - public static class CustomTileFraming + public static class TileFraming { private static int[][] PlantCheckAgainst; private static Dictionary VineToGrass; + + // CONSIDER -- This is a triangle array, but does it need to be? Main.tileMerge is a triangle array as well public static bool[][] tileMergeTypes; - static CustomTileFraming() + #region Similarity Enum + private enum Similarity { - Setup(); + Same, + MergeLink, + None } - private static void Setup() + private static Similarity GetSimilarity(Tile check, int myType, int mergeType) { - int size = CalamityGlobalTile.PlantTypes.Length; - PlantCheckAgainst = new int[TileLoader.TileCount][]; + if (check is null || !check.active()) + return Similarity.None; + if (check.type == myType || Main.tileMerge[myType][check.type]) + return Similarity.Same; + else if (check.type == mergeType) + return Similarity.MergeLink; + + return Similarity.None; + } + #endregion + + #region Load/Unload + internal static void Load() + { + PlantCheckAgainst = new int[TileLoader.TileCount][]; PlantCheckAgainst[TileID.Plants] = new int[3] { TileID.Grass, TileID.PlanterBox, TileID.ClayPot }; PlantCheckAgainst[TileID.CorruptPlants] = new int[1] { TileID.CorruptGrass }; PlantCheckAgainst[TileID.JunglePlants] = new int[1] { TileID.JungleGrass }; @@ -42,18 +59,17 @@ namespace CalamityMod PlantCheckAgainst[ModContent.TileType()] = new int[1] { ModContent.TileType() }; PlantCheckAgainst[ModContent.TileType()] = new int[1] { ModContent.TileType() }; - VineToGrass = new Dictionary(); - VineToGrass[TileID.Vines] = TileID.Grass; - VineToGrass[TileID.CrimsonVines] = TileID.FleshGrass; - VineToGrass[TileID.HallowedVines] = TileID.HallowedGrass; - VineToGrass[(ushort)ModContent.TileType()] = (ushort)ModContent.TileType(); + VineToGrass = new Dictionary + { + [TileID.Vines] = TileID.Grass, + [TileID.CrimsonVines] = TileID.FleshGrass, + [TileID.HallowedVines] = TileID.HallowedGrass, + [(ushort)ModContent.TileType()] = (ushort)ModContent.TileType() + }; tileMergeTypes = new bool[TileLoader.TileCount][]; - for (int i = 0; i < tileMergeTypes.Length; i++) - { + for (int i = 0; i < tileMergeTypes.Length; ++i) tileMergeTypes[i] = new bool[TileLoader.TileCount]; - } - tileMergeTypes[ModContent.TileType()][ModContent.TileType()] = true; tileMergeTypes[ModContent.TileType()][ModContent.TileType()] = true; tileMergeTypes[ModContent.TileType()][ModContent.TileType()] = true; @@ -77,261 +93,149 @@ namespace CalamityMod tileMergeTypes[ModContent.TileType()][ModContent.TileType()] = true; tileMergeTypes[ModContent.TileType()][ModContent.TileType()] = true; tileMergeTypes[ModContent.TileType()][ModContent.TileType()] = true; - } - private static bool PlantNeedsUpdate(int plantType, int checkType) + internal static void Unload() { - if (PlantCheckAgainst[plantType] == null) + PlantCheckAgainst = null; + VineToGrass.Clear(); + VineToGrass = null; + tileMergeTypes = null; + } + #endregion + + #region Framing Helpers + private static bool GetMerge(Tile myTile, Tile mergeTile) + { + if (myTile is null || mergeTile is null) return false; - int size = PlantCheckAgainst[plantType].Length; - for (int i = 0; i < size; i++) - { - if (PlantCheckAgainst[plantType][i] == checkType) - { - return false; - } - } - return true; + return mergeTile.active() && (mergeTile.type == myTile.type || Main.tileMerge[myTile.type][mergeTile.type]); } - public static void CheckPlants(int x, int y) + private static void SetFrameAt(int x, int y, int frameX, int frameY) { - int checkType = -1; - int plantType = Main.tile[x, y].type; - - if (y + 1 >= Main.maxTilesY) - checkType = plantType; - Tile tile = Main.tile[x, y]; - Tile below = Main.tile[x, y + 1]; - if (y + 1 < Main.maxTilesY && below != null && below.nactive() && !below.halfBrick() && below.slope() == 0) - checkType = below.type; + if (tile != null) + { + tile.frameX = (short)frameX; + tile.frameY = (short)frameY; + } + } + #endregion - if (checkType == -1) + #region Specific Framing Code + internal static void PlantFrame(int x, int y) + { + Tile tile = Main.tile[x, y]; + if (tile is null) return; - //Check if this plant needs an update - if (PlantNeedsUpdate(plantType, checkType)) - { - if ((plantType == TileID.Plants || plantType == TileID.Plants2) && checkType != TileID.Grass && tile.frameX >= 162) - { - Main.tile[x, y].frameX = 126; - } - if (plantType == TileID.JunglePlants2 && checkType != TileID.JungleGrass && tile.frameX >= 162) - { - Main.tile[x, y].frameX = 126; - } + int checkType = -1; + int plantType = tile.type; - if (checkType == TileID.CorruptGrass) - { - plantType = TileID.CorruptPlants; - if (tile.frameX >= 162) - { - Main.tile[x, y].frameX = 126; - } - } - else if (checkType == TileID.Grass) - { - if (plantType == TileID.HallowedPlants2) - { - plantType = TileID.Plants2; - } - else - { - plantType = TileID.Plants; - } - } - else if (checkType == TileID.HallowedGrass) - { - if (plantType == TileID.Plants2) - { - plantType = TileID.HallowedPlants2; - } - else - { - plantType = TileID.HallowedPlants; - } - } - else if (checkType == TileID.FleshGrass) - { - plantType = TileID.FleshWeeds; - } - else if (checkType == TileID.MushroomGrass) - { - plantType = TileID.MushroomPlants; - while (Main.tile[x, y].frameX > 72) - { - Main.tile[x, y].frameX -= 72; - } - } - else if (checkType == ModContent.GetInstance().TileType("AstralGrass")) //ASTRAL - { - if (plantType == TileID.Plants || plantType == TileID.CorruptPlants || - plantType == TileID.FleshWeeds || plantType == TileID.HallowedPlants || - plantType == TileID.MushroomPlants || plantType == TileID.JunglePlants) - { - plantType = ModContent.GetInstance().TileType("AstralShortPlants"); - } - else - { - plantType = ModContent.GetInstance().TileType("AstralTallPlants"); - } - } - if (plantType != Main.tile[x, y].type) - { - Main.tile[x, y].type = (ushort)plantType; - return; - } - WorldGen.KillTile(x, y, false, false, false); - } - } - - public static void VineFrame(int x, int y) - { - Tile tile = Main.tile[x, y]; - int myType = tile.type; - Tile tile2 = Main.tile[x, y - 1]; - Tile tile3 = Main.tile[x, y + 1]; - Tile tile4 = Main.tile[x - 1, y]; - Tile tile5 = Main.tile[x + 1, y]; - Tile tile6 = Main.tile[x - 1, y + 1]; - Tile tile7 = Main.tile[x + 1, y + 1]; - Tile tile8 = Main.tile[x - 1, y - 1]; - Tile tile9 = Main.tile[x + 1, y - 1]; - if (tile4 != null && tile4.active()) - { - if (Main.tileStone[(int)tile4.type]) - { - } - else - { - int num55 = (int)tile4.type; - } - if (tile4.slope() == 1 || tile4.slope() == 3) - { - } - } - if (tile5 != null && tile5.active()) - { - if (Main.tileStone[(int)tile5.type]) - { - } - else - { - int num56 = (int)tile5.type; - } - if (tile5.slope() == 2 || tile5.slope() == 4) - { - } - } - - int num53; - if (tile2 != null && tile2.active()) - { - if (Main.tileStone[(int)tile2.type]) - { - } - else - { - num53 = (int)tile2.type; - } - if (tile2.slope() == 3 || tile2.slope() == 4) - { - } - } - if (tile3 != null && tile3.active()) - { - if (Main.tileStone[(int)tile3.type]) - { - } - else - { - int num58 = (int)tile3.type; - } - if (tile3.slope() == 1 || tile3.slope() == 2) - { - } - } - if (tile8 != null && tile8.active()) - { - if (Main.tileStone[(int)tile8.type]) - { - } - else - { - int num52 = (int)tile8.type; - } - } - if (tile9 != null && tile9.active()) - { - if (Main.tileStone[(int)tile9.type]) - { - } - else - { - int num54 = (int)tile9.type; - } - } - if (tile6 != null && tile6.active()) - { - if (Main.tileStone[(int)tile6.type]) - { - } - else - { - int num57 = (int)tile6.type; - } - } - if (tile7 != null && tile7.active()) - { - if (Main.tileStone[(int)tile7.type]) - { - } - else - { - int num59 = (int)tile7.type; - } - } - if (tile.slope() == 2) - { - } - if (tile.slope() == 1) - { - } - if (tile.slope() == 4) - { - } - if (tile.slope() == 3) - { - } - - if (tile2 != null) - { - if (!tile2.active()) - { - num53 = -1; - } - else if (tile2.bottomSlope()) - { - num53 = -1; - } - else - { - num53 = (int)tile2.type; - } - } + // If the tile below is off the bottom of the map, then assume it's the same tile type. + if (y + 1 >= Main.maxTilesY) + checkType = plantType; else { - num53 = myType; + Tile below = Main.tile[x, y + 1]; + if (below != null && below.nactive() && !below.halfBrick() && below.slope() == 0) + checkType = below.type; } - ushort[] vines = VineToGrass.Keys.ToArray(); - - for (int i = 0; i < vines.Length; i++) + // Sub function to determine whether the plant needs an update + bool PlantNeedsUpdate(int plant, int check) { - ushort myGrassType = VineToGrass[(ushort)vines[i]]; - if (myType != vines[i] && (num53 == myGrassType || num53 == vines[i])) + if (PlantCheckAgainst[plant] is null) + return false; + + for (int i = 0; i < PlantCheckAgainst[plant].Length; ++i) + if (PlantCheckAgainst[plant][i] == check) + return false; + + return true; + } + + // If no valid below tile type could be determined, then don't do anything. + // Additionally, don't do anything if the plant doesn't need a framing update. + if (checkType == -1 || !PlantNeedsUpdate(plantType, checkType)) + return; + + if ((plantType == TileID.Plants || plantType == TileID.Plants2) && checkType != TileID.Grass && tile.frameX >= 162) + { + Main.tile[x, y].frameX = 126; + } + if (plantType == TileID.JunglePlants2 && checkType != TileID.JungleGrass && tile.frameX >= 162) + { + Main.tile[x, y].frameX = 126; + } + + if (checkType == TileID.CorruptGrass) + { + plantType = TileID.CorruptPlants; + if (tile.frameX >= 162) + { + Main.tile[x, y].frameX = 126; + } + } + else if (checkType == TileID.Grass) + { + plantType = plantType == TileID.HallowedPlants2 ? TileID.Plants2 : TileID.Plants; + } + else if (checkType == TileID.HallowedGrass) + { + plantType = plantType == TileID.Plants2 ? TileID.HallowedPlants2 : TileID.HallowedPlants; + } + else if (checkType == TileID.FleshGrass) + { + plantType = TileID.FleshWeeds; + } + else if (checkType == TileID.MushroomGrass) + { + plantType = TileID.MushroomPlants; + while (Main.tile[x, y].frameX > 72) + { + Main.tile[x, y].frameX -= 72; + } + } + + // Astral grass and plant behavior + else if (checkType == ModContent.GetInstance().TileType("AstralGrass")) + { + bool isShortPlant = plantType == TileID.Plants || + plantType == TileID.CorruptPlants || + plantType == TileID.FleshWeeds || + plantType == TileID.HallowedPlants || + plantType == TileID.MushroomPlants || + plantType == TileID.JunglePlants; + plantType = ModContent.GetInstance().TileType(isShortPlant ? "AstralShortPlants" : "AstralTallPlants"); + } + + // If the tile type is not the same as the plant type, then set it equal. Otherwise, destroy it. + if (Main.tile[x, y].type != plantType) + Main.tile[x, y].type = (ushort)plantType; + else + WorldGen.KillTile(x, y, false, false, false); + } + + internal static void VineFrame(int x, int y) + { + Tile tile = Main.tile[x, y]; + if (tile is null) + return; + + int myType = tile.type; + + // Get the type of the tile above this vine. If that tile doesn't exist, just assume it's another vine. + Tile north = y <= 0 ? null : Main.tile[x, y - 1]; + int northType = north is null ? myType : (!north.active() || north.bottomSlope()) ? -1 : north.type; + + // Make this vine match the tile above it if that's another vine or a grass tile. + ushort[] vines = VineToGrass.Keys.ToArray(); + for (int i = 0; i < vines.Length; ++i) + { + ushort correspondingGrass = VineToGrass[vines[i]]; + if (myType != vines[i] && (northType == correspondingGrass || northType == vines[i])) { Main.tile[x, y].type = vines[i]; WorldGen.SquareTileFrame(x, y, true); @@ -339,57 +243,52 @@ namespace CalamityMod } } - if (num53 != myType) + // If the tile above is an identical vine, nothing else needs to be done. + if (northType == myType) + return; + + // If the tile above isn't sloped correctly or otherwise isn't a valid anchor for this vine, check whether the vine must die. + bool tileMustDie = northType == -1; + if(northType != -1) { - bool flag17 = false; - if (num53 == -1) + // Vanilla vines can hang from vanilla grass and vanilla leaf blocks. + if (myType == TileID.Vines && northType != TileID.Grass && northType != TileID.LeafBlock) + tileMustDie = true; + else for (int i = 0; i < vines.Length; ++i) { - flag17 = true; - } - else - { - for (int i = 0; i < vines.Length; i++) + // Not matching grass? Die. + if (myType == vines[i] && northType != VineToGrass[vines[i]]) { - if (myType != TileID.Vines) - { - if (myType == vines[i] && num53 != VineToGrass[vines[i]]) - { - flag17 = true; - } - } - else if (num53 != TileID.Grass && num53 != TileID.LeafBlock) - { - flag17 = true; - } + tileMustDie = true; + break; } } - if (flag17) - { - WorldGen.KillTile(x, y, false, false, false); - } } - return; + + if (tileMustDie) + WorldGen.KillTile(x, y, false, false, false); } - public static bool BetterGemsparkFraming(int x, int y, bool resetFrame) + internal static bool BetterGemsparkFraming(int x, int y, bool resetFrame) { Tile tile = Main.tile[x, y]; + if (tile is null) + return false; if (tile.slope() > 0 && TileID.Sets.HasSlopeFrames[tile.type]) { return true; } - Tile tile2 = Main.tile[x, y - 1]; - Tile tile3 = Main.tile[x, y + 1]; - Tile tile4 = Main.tile[x - 1, y]; - Tile tile5 = Main.tile[x + 1, y]; - Tile tile6 = Main.tile[x - 1, y + 1]; - Tile tile7 = Main.tile[x + 1, y + 1]; - Tile tile8 = Main.tile[x - 1, y - 1]; - Tile tile9 = Main.tile[x + 1, y - 1]; - - int myType = tile.type; + // these all get null checked in the GetMerge function + Tile north = Main.tile[x, y - 1]; + Tile south = Main.tile[x, y + 1]; + Tile west = Main.tile[x - 1, y]; + Tile east = Main.tile[x + 1, y]; + Tile southwest = Main.tile[x - 1, y + 1]; + Tile southeast = Main.tile[x + 1, y + 1]; + Tile northwest = Main.tile[x - 1, y - 1]; + Tile northeast = Main.tile[x + 1, y - 1]; bool left = false; bool right = false; @@ -400,23 +299,24 @@ namespace CalamityMod bool downLeft = false; bool downRight = false; - if (GetMerge(tile, tile2) && (tile2.slope() == 0 || tile2.slope() == 1 || tile2.slope() == 2)) + if (GetMerge(tile, north) && (north.slope() == 0 || north.slope() == 1 || north.slope() == 2)) up = true; - if (GetMerge(tile, tile3) && (tile3.slope() == 0 || tile3.slope() == 3 || tile3.slope() == 4)) + if (GetMerge(tile, south) && (south.slope() == 0 || south.slope() == 3 || south.slope() == 4)) down = true; - if (GetMerge(tile, tile4) && (tile4.slope() == 0 || tile4.slope() == 2 || tile4.slope() == 4)) + if (GetMerge(tile, west) && (west.slope() == 0 || west.slope() == 2 || west.slope() == 4)) left = true; - if (GetMerge(tile, tile5) && (tile5.slope() == 0 || tile5.slope() == 1 || tile5.slope() == 3)) + if (GetMerge(tile, east) && (east.slope() == 0 || east.slope() == 1 || east.slope() == 3)) right = true; - if (GetMerge(tile, tile2) && GetMerge(tile, tile4) && GetMerge(tile, tile8) && (tile8.slope() == 0 || tile8.slope() == 2) && (tile2.slope() == 0 || tile2.slope() == 1 || tile2.slope() == 3) && (tile4.slope() == 0 || tile4.slope() == 3 || tile4.slope() == 4)) + if (GetMerge(tile, north) && GetMerge(tile, west) && GetMerge(tile, northwest) && (northwest.slope() == 0 || northwest.slope() == 2) && (north.slope() == 0 || north.slope() == 1 || north.slope() == 3) && (west.slope() == 0 || west.slope() == 3 || west.slope() == 4)) upLeft = true; - if (GetMerge(tile, tile2) && GetMerge(tile, tile5) && GetMerge(tile, tile9) && (tile9.slope() == 0 || tile9.slope() == 1) && (tile2.slope() == 0 || tile2.slope() == 2 || tile2.slope() == 4) && (tile5.slope() == 0 || tile5.slope() == 3 || tile5.slope() == 4)) + if (GetMerge(tile, north) && GetMerge(tile, east) && GetMerge(tile, northeast) && (northeast.slope() == 0 || northeast.slope() == 1) && (north.slope() == 0 || north.slope() == 2 || north.slope() == 4) && (east.slope() == 0 || east.slope() == 3 || east.slope() == 4)) upRight = true; - if (GetMerge(tile, tile3) && GetMerge(tile, tile4) && GetMerge(tile, tile6) && !tile6.halfBrick() && (tile6.slope() == 0 || tile6.slope() == 4) && (tile3.slope() == 0 || tile3.slope() == 1 || tile3.slope() == 3) && (tile4.slope() == 0 || tile4.slope() == 1 || tile4.slope() == 2)) + if (GetMerge(tile, south) && GetMerge(tile, west) && GetMerge(tile, southwest) && !southwest.halfBrick() && (southwest.slope() == 0 || southwest.slope() == 4) && (south.slope() == 0 || south.slope() == 1 || south.slope() == 3) && (west.slope() == 0 || west.slope() == 1 || west.slope() == 2)) downLeft = true; - if (GetMerge(tile, tile3) && GetMerge(tile, tile5) && GetMerge(tile, tile7) && !tile7.halfBrick() && (tile7.slope() == 0 || tile7.slope() == 3) && (tile3.slope() == 0 || tile3.slope() == 2 || tile3.slope() == 4) && (tile5.slope() == 0 || tile5.slope() == 1 || tile5.slope() == 2)) + if (GetMerge(tile, south) && GetMerge(tile, east) && GetMerge(tile, southeast) && !southeast.halfBrick() && (southeast.slope() == 0 || southeast.slope() == 3) && (south.slope() == 0 || south.slope() == 2 || south.slope() == 4) && (east.slope() == 0 || east.slope() == 1 || east.slope() == 2)) downRight = true; + // Reset the tile's random frame style if the frame is being reset. int randomFrame; if (resetFrame) { @@ -647,25 +547,26 @@ namespace CalamityMod return true; } - public static bool BrimstoneFraming(int x, int y, bool resetFrame) + internal static bool BrimstoneFraming(int x, int y, bool resetFrame) { Tile tile = Main.tile[x, y]; + if (tile is null) + return false; if (tile.slope() > 0 && TileID.Sets.HasSlopeFrames[tile.type]) { return true; } - Tile tile2 = Main.tile[x, y - 1]; - Tile tile3 = Main.tile[x, y + 1]; - Tile tile4 = Main.tile[x - 1, y]; - Tile tile5 = Main.tile[x + 1, y]; - Tile tile6 = Main.tile[x - 1, y + 1]; - Tile tile7 = Main.tile[x + 1, y + 1]; - Tile tile8 = Main.tile[x - 1, y - 1]; - Tile tile9 = Main.tile[x + 1, y - 1]; - - int myType = tile.type; + // these all get null checked in the GetMerge function + Tile north = Main.tile[x, y - 1]; + Tile south = Main.tile[x, y + 1]; + Tile west = Main.tile[x - 1, y]; + Tile east = Main.tile[x + 1, y]; + Tile southwest = Main.tile[x - 1, y + 1]; + Tile southeast = Main.tile[x + 1, y + 1]; + Tile northwest = Main.tile[x - 1, y - 1]; + Tile northeast = Main.tile[x + 1, y - 1]; bool left = false; bool right = false; @@ -676,23 +577,24 @@ namespace CalamityMod bool downLeft = false; bool downRight = false; - if (GetMerge(tile, tile2) && (tile2.slope() == 0 || tile2.slope() == 1 || tile2.slope() == 2)) + if (GetMerge(tile, north) && (north.slope() == 0 || north.slope() == 1 || north.slope() == 2)) up = true; - if (GetMerge(tile, tile3) && (tile3.slope() == 0 || tile3.slope() == 3 || tile3.slope() == 4)) + if (GetMerge(tile, south) && (south.slope() == 0 || south.slope() == 3 || south.slope() == 4)) down = true; - if (GetMerge(tile, tile4) && (tile4.slope() == 0 || tile4.slope() == 2 || tile4.slope() == 4)) + if (GetMerge(tile, west) && (west.slope() == 0 || west.slope() == 2 || west.slope() == 4)) left = true; - if (GetMerge(tile, tile5) && (tile5.slope() == 0 || tile5.slope() == 1 || tile5.slope() == 3)) + if (GetMerge(tile, east) && (east.slope() == 0 || east.slope() == 1 || east.slope() == 3)) right = true; - if (GetMerge(tile, tile2) && GetMerge(tile, tile4) && GetMerge(tile, tile8) && (tile8.slope() == 0 || tile8.slope() == 2) && (tile2.slope() == 0 || tile2.slope() == 1 || tile2.slope() == 3) && (tile4.slope() == 0 || tile4.slope() == 3 || tile4.slope() == 4)) + if (GetMerge(tile, north) && GetMerge(tile, west) && GetMerge(tile, northwest) && (northwest.slope() == 0 || northwest.slope() == 2) && (north.slope() == 0 || north.slope() == 1 || north.slope() == 3) && (west.slope() == 0 || west.slope() == 3 || west.slope() == 4)) upLeft = true; - if (GetMerge(tile, tile2) && GetMerge(tile, tile5) && GetMerge(tile, tile9) && (tile9.slope() == 0 || tile9.slope() == 1) && (tile2.slope() == 0 || tile2.slope() == 2 || tile2.slope() == 4) && (tile5.slope() == 0 || tile5.slope() == 3 || tile5.slope() == 4)) + if (GetMerge(tile, north) && GetMerge(tile, east) && GetMerge(tile, northeast) && (northeast.slope() == 0 || northeast.slope() == 1) && (north.slope() == 0 || north.slope() == 2 || north.slope() == 4) && (east.slope() == 0 || east.slope() == 3 || east.slope() == 4)) upRight = true; - if (GetMerge(tile, tile3) && GetMerge(tile, tile4) && GetMerge(tile, tile6) && !tile6.halfBrick() && (tile6.slope() == 0 || tile6.slope() == 4) && (tile3.slope() == 0 || tile3.slope() == 1 || tile3.slope() == 3) && (tile4.slope() == 0 || tile4.slope() == 1 || tile4.slope() == 2)) + if (GetMerge(tile, south) && GetMerge(tile, west) && GetMerge(tile, southwest) && !southwest.halfBrick() && (southwest.slope() == 0 || southwest.slope() == 4) && (south.slope() == 0 || south.slope() == 1 || south.slope() == 3) && (west.slope() == 0 || west.slope() == 1 || west.slope() == 2)) downLeft = true; - if (GetMerge(tile, tile3) && GetMerge(tile, tile5) && GetMerge(tile, tile7) && !tile7.halfBrick() && (tile7.slope() == 0 || tile7.slope() == 3) && (tile3.slope() == 0 || tile3.slope() == 2 || tile3.slope() == 4) && (tile5.slope() == 0 || tile5.slope() == 1 || tile5.slope() == 2)) + if (GetMerge(tile, south) && GetMerge(tile, east) && GetMerge(tile, southeast) && !southeast.halfBrick() && (southeast.slope() == 0 || southeast.slope() == 3) && (south.slope() == 0 || south.slope() == 2 || south.slope() == 4) && (east.slope() == 0 || east.slope() == 1 || east.slope() == 2)) downRight = true; + // Reset the tile's random frame style if the frame is being reset. int randomFrame; if (resetFrame) { @@ -922,21 +824,23 @@ namespace CalamityMod return true; } + #endregion - enum Similarity + #region Generic Custom Framing Code + internal static void CustomMergeFrameExplicit(int x, int y, int myType, int mergeType, out bool mergedUp, + out bool mergedLeft, out bool mergedRight, out bool mergedDown, bool forceSameDown = false, + bool forceSameUp = false, bool forceSameLeft = false, bool forceSameRight = false, bool resetFrame = true) { - Same, - MergeLink, - None - } - public static void FrameTileForCustomMerge(int x, int y, int myType, int mergeType, bool forceSameDown = false, bool forceSameUp = false, bool forceSameLeft = false, bool forceSameRight = false, bool resetFrame = true) - { - bool tmp; - FrameTileForCustomMerge(x, y, myType, mergeType, out tmp, out tmp, out tmp, out tmp, forceSameDown, forceSameUp, forceSameLeft, forceSameRight, resetFrame); - } + if (Main.tile[x, y] is null) + { + mergedUp = mergedLeft = mergedRight = mergedDown = false; + return; + } - public static void FrameTileForCustomMerge(int x, int y, int myType, int mergeType, out bool mergedUp, out bool mergedLeft, out bool mergedRight, out bool mergedDown, bool forceSameDown = false, bool forceSameUp = false, bool forceSameLeft = false, bool forceSameRight = false, bool resetFrame = true) - { + // Disable vanilla trying to merge these tiles automtaically. + Main.tileMerge[myType][mergeType] = false; + + // these all get null checked in the GetSimilarity and GetMerge functions Tile tileLeft = Main.tile[x - 1, y]; Tile tileRight = Main.tile[x + 1, y]; Tile tileUp = Main.tile[x, y - 1]; @@ -946,28 +850,19 @@ namespace CalamityMod Tile tileBottomLeft = Main.tile[x - 1, y + 1]; Tile tileBottomRight = Main.tile[x + 1, y + 1]; - Main.tileMerge[myType][mergeType] = false; + // Cardinal directions + Similarity leftSim = forceSameLeft ? Similarity.Same : GetSimilarity(tileLeft, myType, mergeType); + Similarity rightSim = forceSameRight ? Similarity.Same : GetSimilarity(tileRight, myType, mergeType); + Similarity upSim = forceSameUp ? Similarity.Same : GetSimilarity(tileUp, myType, mergeType); + Similarity downSim = forceSameDown ? Similarity.Same : GetSimilarity(tileDown, myType, mergeType); - //CARDINAL - Similarity leftSim = GetSimilarity(tileLeft, myType, mergeType); - if (forceSameLeft) - leftSim = Similarity.Same; - Similarity rightSim = GetSimilarity(tileRight, myType, mergeType); - if (forceSameRight) - rightSim = Similarity.Same; - Similarity upSim = GetSimilarity(tileUp, myType, mergeType); - if (forceSameUp) - upSim = Similarity.Same; - Similarity downSim = GetSimilarity(tileDown, myType, mergeType); - if (forceSameDown) - downSim = Similarity.Same; - - //DIAGONAL + // Diagonal directions Similarity topLeftSim = GetSimilarity(tileTopLeft, myType, mergeType); Similarity topRightSim = GetSimilarity(tileTopRight, myType, mergeType); Similarity bottomLeftSim = GetSimilarity(tileBottomLeft, myType, mergeType); Similarity bottomRightSim = GetSimilarity(tileBottomRight, myType, mergeType); + // Reset the tile's random frame style if the frame is being reset. int randomFrame; if (resetFrame) { @@ -979,14 +874,10 @@ namespace CalamityMod randomFrame = Main.tile[x, y].frameNumber(); } - /* DEBUGGING - if (Player.tileTargetX == x && Player.tileTargetY == y) - { - Main.NewText(StringWriter(leftSim, rightSim, upSim, downSim, topLeftSim, topRightSim, bottomLeftSim, bottomRightSim, forceSameDown, forceSameUp, forceSameLeft, forceSameRight)); - }*/ - + // Initialize all merged variables to false. mergedDown = mergedLeft = mergedRight = mergedUp = false; + #region Custom Merge Conditional Tree if (leftSim == Similarity.None) { if (upSim == Similarity.Same) @@ -1481,111 +1372,69 @@ namespace CalamityMod } SetFrameAt(x, y, 216, 18 * randomFrame); return; + #endregion } - public static void FrameTileForCustomMergeFrom(int x, int y, int myType, int mergeType) + internal static void CustomMergeFrame(int x, int y, int myType, int mergeType, bool forceSameDown = false, + bool forceSameUp = false, bool forceSameLeft = false, bool forceSameRight = false, bool resetFrame = true) + => CustomMergeFrameExplicit(x, y, myType, mergeType, out _, out _, out _, out _, forceSameDown, forceSameUp, forceSameLeft, forceSameRight, resetFrame); + + internal static void CustomMergeFrame(int x, int y, int myType, int mergeType) { + Tile tile = Main.tile[x, y]; + if (tile is null) + return; + bool forceSameUp = false; bool forceSameDown = false; bool forceSameLeft = false; bool forceSameRight = false; - Tile up = Main.tile[x, y - 1]; - Tile down = Main.tile[x, y + 1]; - Tile left = Main.tile[x - 1, y]; - Tile right = Main.tile[x + 1, y]; + Tile north = Main.tile[x, y - 1]; + Tile south = Main.tile[x, y + 1]; + Tile west = Main.tile[x - 1, y]; + Tile east = Main.tile[x + 1, y]; - bool tmp; - - if (up.active() && tileMergeTypes[myType][up.type]) + if (north != null && north.active() && tileMergeTypes[myType][north.type]) { - TileMerge.MergeTile(myType, up.type, false); + // Register this tile as not automatically merging with the tile above it. + CalamityUtils.SetMerge(myType, north.type, false); TileID.Sets.ChecksForMerge[myType] = true; - bool mergedDown; - FrameTileForCustomMerge(x, y - 1, up.type, myType, out tmp, out tmp, out tmp, out mergedDown, false, false, false, false, false); - if (mergedDown) - { - forceSameUp = true; - } + // Properly frame the tile given this constraint. + CustomMergeFrameExplicit(x, y - 1, north.type, myType, out _, out _, out _, out forceSameUp, false, false, false, false, false); } - if (left.active() && tileMergeTypes[myType][left.type]) + if (west != null && west.active() && tileMergeTypes[myType][west.type]) { - TileMerge.MergeTile(myType, left.type, false); + // Register this tile as not automatically merging with the tile to the left of it. + CalamityUtils.SetMerge(myType, west.type, false); TileID.Sets.ChecksForMerge[myType] = true; - bool mergedRight; - FrameTileForCustomMerge(x - 1, y, left.type, myType, out tmp, out tmp, out mergedRight, out tmp, false, false, false, false, false); - if (mergedRight) - { - forceSameLeft = true; - } + // Properly frame the tile given this constraint. + CustomMergeFrameExplicit(x - 1, y, west.type, myType, out _, out _, out forceSameLeft, out _, false, false, false, false, false); } - if (right.active() && tileMergeTypes[myType][right.type]) + if (east != null && east.active() && tileMergeTypes[myType][east.type]) { - TileMerge.MergeTile(myType, right.type, false); + // Register this tile as not automatically merging with the tile to the right of it. + CalamityUtils.SetMerge(myType, east.type, false); TileID.Sets.ChecksForMerge[myType] = true; - bool mergedLeft; - FrameTileForCustomMerge(x + 1, y, right.type, myType, out tmp, out mergedLeft, out tmp, out tmp, false, false, false, false, false); - if (mergedLeft) - { - forceSameRight = true; - } + // Properly frame the tile given this constraint. + CustomMergeFrameExplicit(x + 1, y, east.type, myType, out _, out forceSameRight , out _, out _, false, false, false, false, false); } - if (down.active() && tileMergeTypes[myType][down.type]) + if (south != null && south.active() && tileMergeTypes[myType][south.type]) { - TileMerge.MergeTile(myType, down.type, false); + // Register this tile as not automatically merging with the tile below it. + CalamityUtils.SetMerge(myType, south.type, false); TileID.Sets.ChecksForMerge[myType] = true; - bool mergedUp; - FrameTileForCustomMerge(x, y + 1, down.type, myType, out mergedUp, out tmp, out tmp, out tmp, false, false, false, false, false); - if (mergedUp) - { - forceSameDown = true; - } + // Properly frame the tile given this constraint. + CustomMergeFrameExplicit(x, y + 1, south.type, myType, out forceSameDown, out _, out _, out _, false, false, false, false, false); } - FrameTileForCustomMerge(x, y, myType, mergeType, forceSameDown, forceSameUp, forceSameLeft, forceSameRight); - } - - private static void SetFrameAt(int x, int y, int frameX, int frameY) - { - Main.tile[x, y].frameX = (short)frameX; - Main.tile[x, y].frameY = (short)frameY; - } - - private static Similarity GetSimilarity(Tile check, int myType, int mergeType) - { - if (check is null || !check.active()) - return Similarity.None; - - if (check.type == myType || Main.tileMerge[myType][check.type]) - return Similarity.Same; - else if (check.type == mergeType) - return Similarity.MergeLink; - - return Similarity.None; - } - - private static bool GetMerge(Tile myTile, Tile mergeTile) - { - if (!mergeTile.active()) - return false; - return (mergeTile.type == myTile.type || Main.tileMerge[myTile.type][mergeTile.type]); - } - private static string StringWriter(params object[] strings) - { - string s = ""; - for (int i = 0; i < strings.Length; i++) - { - s += strings[i].ToString(); - if (i != strings.Length - 1) - { - s += ", "; - } - } - return s; + // With all constraints determined, properly frame the tile a final time. + CustomMergeFrameExplicit(x, y, myType, mergeType, out _, out _, out _, out _, forceSameDown, forceSameUp, forceSameLeft, forceSameRight, true); } + #endregion } } diff --git a/Utilities/TileMerge.cs b/Utilities/TileMerge.cs deleted file mode 100644 index 632c157a14..0000000000 --- a/Utilities/TileMerge.cs +++ /dev/null @@ -1,241 +0,0 @@ -using CalamityMod.Tiles; -using CalamityMod.Tiles.Abyss; -using CalamityMod.Tiles.Astral; -using CalamityMod.Tiles.AstralDesert; -using CalamityMod.Tiles.AstralSnow; -using CalamityMod.Tiles.Crags; -using CalamityMod.Tiles.FurnitureAbyss; -using CalamityMod.Tiles.FurnitureAshen; -using CalamityMod.Tiles.FurnitureEutrophic; -using CalamityMod.Tiles.FurnitureOccult; -using CalamityMod.Tiles.FurnitureProfaned; -using CalamityMod.Tiles.FurnitureVoid; -using CalamityMod.Tiles.Ores; -using CalamityMod.Tiles.SunkenSea; -using Terraria; -using Terraria.ID; -using Terraria.ModLoader; - -namespace CalamityMod -{ - public static class TileMerge - { - public static void MergeTile(int type, int mergeType, bool merge = true) - { - if (type != mergeType) - { - Main.tileMerge[type][mergeType] = merge; - Main.tileMerge[mergeType][type] = merge; - } - } - - /// - /// Makes the tile merge with the most common types of naturally generated tiles - /// - /// - public static void MergeGeneralTiles(int type) - { - Mod mod = ModContent.GetInstance(); - //Soils - MergeTile(type, TileID.ClayBlock); - MergeTile(type, TileID.Dirt); - MergeTile(type, TileID.Mud); - //Sands - MergeTile(type, TileID.Sand); - MergeTile(type, TileID.Ebonsand); - MergeTile(type, TileID.Crimsand); - MergeTile(type, TileID.Pearlsand); - //Snows - MergeTile(type, TileID.SnowBlock); - //Stones - MergeTile(type, TileID.Stone); - MergeTile(type, TileID.Ebonstone); - MergeTile(type, TileID.Crimstone); - MergeTile(type, TileID.Pearlstone); - //Calam general tiles - MergeTile(type, ModContent.TileType()); - MergeTile(type, ModContent.TileType()); - MergeTile(type, ModContent.TileType()); - MergeTile(type, ModContent.TileType()); - MergeTile(type, ModContent.TileType()); - MergeTile(type, ModContent.TileType()); - } - - public static void MergeOreTiles(int type) - { - Mod mod = ModContent.GetInstance(); - //Vanilla Ores - MergeTile(type, TileID.Copper); - MergeTile(type, TileID.Tin); - MergeTile(type, TileID.Iron); - MergeTile(type, TileID.Lead); - MergeTile(type, TileID.Silver); - MergeTile(type, TileID.Tungsten); - MergeTile(type, TileID.Gold); - MergeTile(type, TileID.Demonite); - MergeTile(type, TileID.Crimtane); - MergeTile(type, TileID.Cobalt); - MergeTile(type, TileID.Palladium); - MergeTile(type, TileID.Mythril); - MergeTile(type, TileID.Platinum); - MergeTile(type, TileID.Orichalcum); - MergeTile(type, TileID.Adamantite); - MergeTile(type, TileID.Titanium); - MergeTile(type, TileID.LunarOre); - //Calam Ores - MergeTile(type, ModContent.TileType()); - MergeTile(type, ModContent.TileType()); - MergeTile(type, ModContent.TileType()); - MergeTile(type, ModContent.TileType()); - MergeTile(type, ModContent.TileType()); - MergeTile(type, ModContent.TileType()); - MergeTile(type, ModContent.TileType()); - MergeTile(type, ModContent.TileType()); - } - - /// - /// Makes the tile merge with all the tile types that generate within various types of desert, sunken sea and related tiles - /// - /// - public static void MergeDesertTiles(int type) - { - Mod mod = ModContent.GetInstance(); - //Sands - MergeTile(type, TileID.Sand); - MergeTile(type, TileID.Ebonsand); - MergeTile(type, TileID.Crimsand); - MergeTile(type, TileID.Pearlsand); - //Hardened Sands - MergeTile(type, TileID.HardenedSand); - MergeTile(type, TileID.CorruptHardenedSand); - MergeTile(type, TileID.CrimsonHardenedSand); - MergeTile(type, TileID.HallowHardenedSand); - //Sandstones - MergeTile(type, TileID.Sandstone); - MergeTile(type, TileID.CorruptSandstone); - MergeTile(type, TileID.CrimsonSandstone); - MergeTile(type, TileID.HallowSandstone); - //Misc relevant desert tiles - MergeTile(type, TileID.FossilOre); - MergeTile(type, TileID.DesertFossil); - //Calam desert tiles - MergeTile(type, ModContent.TileType()); - MergeTile(type, ModContent.TileType()); - MergeTile(type, ModContent.TileType()); - //Sunken Sea tiles - MergeTile(type, ModContent.TileType()); - MergeTile(type, ModContent.TileType()); - MergeTile(type, ModContent.TileType()); - } - - /// - /// Makes the tile merge with all the tile types that generate within various types of snow or snow biome related tiles - /// - /// - public static void MergeSnowTiles(int type) - { - Mod mod = ModContent.GetInstance(); - //Snow - MergeTile(type, TileID.SnowBlock); - //Ices - MergeTile(type, TileID.IceBlock); - MergeTile(type, TileID.CorruptIce); - MergeTile(type, TileID.FleshIce); - MergeTile(type, TileID.HallowedIce); - //Calam snow tiles - MergeTile(type, ModContent.TileType()); - MergeTile(type, ModContent.TileType()); - } - - /// - /// Makes the tile merge with all the tile types that generate within various types of hell or hell biome related tiles - /// - /// - public static void MergeHellTiles(int type) - { - Mod mod = ModContent.GetInstance(); - //Terrain - MergeTile(type, TileID.Ash); - MergeTile(type, TileID.Hellstone); - //Houses - MergeTile(type, TileID.ObsidianBrick); - MergeTile(type, TileID.HellstoneBrick); - //Crag tiles - MergeTile(type, ModContent.TileType()); - } - - /// - /// Makes the tile merge with all the tile types that generate within various types of abyss or abyss biome related tiles - /// - /// - public static void MergeAbyssTiles(int type) - { - Mod mod = ModContent.GetInstance(); - //Sulphurous Sea - MergeTile(type, ModContent.TileType()); - //Abyss - MergeTile(type, ModContent.TileType()); - MergeTile(type, ModContent.TileType()); - MergeTile(type, ModContent.TileType()); - MergeTile(type, ModContent.TileType()); - MergeTile(type, ModContent.TileType()); - } - - /// - /// Makes the tile merge with all the tile types that generate within various types of astral tiles - /// - /// - public static void MergeAstralTiles(int type) - { - Mod mod = ModContent.GetInstance(); - //Astral - MergeTile(type, ModContent.TileType()); - MergeTile(type, ModContent.TileType()); - MergeTile(type, ModContent.TileType()); - //Astral Desert - MergeTile(type, ModContent.TileType()); - MergeTile(type, ModContent.TileType()); - MergeTile(type, ModContent.TileType()); - //Astral Snow - MergeTile(type, ModContent.TileType()); - MergeTile(type, ModContent.TileType()); - } - - /// - /// Makes the tile merge with all the decorative 'smooth' tiles - /// - /// - public static void MergeSmoothTiles(int type) - { - Mod mod = ModContent.GetInstance(); - //Vanilla - MergeTile(type, TileID.MarbleBlock); - MergeTile(type, TileID.GraniteBlock); - //Calam - MergeTile(type, ModContent.TileType()); - MergeTile(type, ModContent.TileType()); - MergeTile(type, ModContent.TileType()); - MergeTile(type, ModContent.TileType()); - } - - /// - /// Makes the tile merge with other mergable decorative tiles - /// - /// - public static void MergeDecorativeTiles(int type) - { - Mod mod = ModContent.GetInstance(); - //Vanilla decor - Main.tileBrick[type] = true; - //Calam - MergeTile(type, ModContent.TileType()); - MergeTile(type, ModContent.TileType()); - MergeTile(type, ModContent.TileType()); - MergeTile(type, ModContent.TileType()); - MergeTile(type, ModContent.TileType()); - MergeTile(type, ModContent.TileType()); - MergeTile(type, ModContent.TileType()); - MergeTile(type, ModContent.TileType()); - } - } -} diff --git a/World/Abyss.cs b/World/Abyss.cs index 1b1510a95f..6a63a7044e 100644 --- a/World/Abyss.cs +++ b/World/Abyss.cs @@ -390,7 +390,7 @@ namespace CalamityMod.World islandLocationY += islandLocationOffset; } - CalamityWorld.AbyssItemArray = WorldGenerationMethods.ShuffleArray(CalamityWorld.AbyssItemArray); + CalamityWorld.AbyssItemArray = CalamityUtils.ShuffleArray(CalamityWorld.AbyssItemArray); for (int abyssHouse = 0; abyssHouse < CalamityWorld.numAbyssIslands; abyssHouse++) //11 15 19 { if (abyssHouse != 20) @@ -415,7 +415,7 @@ namespace CalamityMod.World { int style = WorldGen.genRand.Next(13, 16); WorldGen.PlacePot(abyssIndex, abyssIndex2, 28, style); - WorldGenerationMethods.SafeSquareTileFrame(abyssIndex, abyssIndex2, true); + CalamityUtils.SafeSquareTileFrame(abyssIndex, abyssIndex2, true); } } else if (WorldGen.SolidTile(abyssIndex, abyssIndex2 + 1) && @@ -425,7 +425,7 @@ namespace CalamityMod.World { int style = WorldGen.genRand.Next(25, 28); WorldGen.PlacePot(abyssIndex, abyssIndex2, 28, style); - WorldGenerationMethods.SafeSquareTileFrame(abyssIndex, abyssIndex2, true); + CalamityUtils.SafeSquareTileFrame(abyssIndex, abyssIndex2, true); } } } @@ -447,7 +447,7 @@ namespace CalamityMod.World { int style = WorldGen.genRand.Next(13, 16); WorldGen.PlacePot(abyssIndex, abyssIndex2, 28, style); - WorldGenerationMethods.SafeSquareTileFrame(abyssIndex, abyssIndex2, true); + CalamityUtils.SafeSquareTileFrame(abyssIndex, abyssIndex2, true); } } else if (WorldGen.SolidTile(abyssIndex, abyssIndex2 + 1) && @@ -457,7 +457,7 @@ namespace CalamityMod.World { int style = WorldGen.genRand.Next(25, 28); WorldGen.PlacePot(abyssIndex, abyssIndex2, 28, style); - WorldGenerationMethods.SafeSquareTileFrame(abyssIndex, abyssIndex2, true); + CalamityUtils.SafeSquareTileFrame(abyssIndex, abyssIndex2, true); } } } diff --git a/World/WorldGenerationMethods.cs b/World/WorldGenerationMethods.cs index 6abc32d137..4d40bfdd7d 100644 --- a/World/WorldGenerationMethods.cs +++ b/World/WorldGenerationMethods.cs @@ -1179,46 +1179,6 @@ namespace CalamityMod.World } #endregion - #region SafeTileFrame - public static void SafeSquareTileFrame(int i, int j, bool resetFrame = true) - { - if (Main.tile[i, j] != null) - { - for (int x = i - 1; x <= i + 1; x++) - { - for (int y = j - 1; y <= j + 1; y++) - { - if (x < 0 || y < 0 || x >= Main.maxTilesX || y >= Main.maxTilesY) - continue; - if (x == i && y == j) - { - WorldGen.TileFrame(i, j, resetFrame, false); - } - else - { - WorldGen.TileFrame(x, y, false, false); - } - } - } - } - } - #endregion - - #region ShuffleArray - public static int[] ShuffleArray(int[] array) - { - Random random = new Random(); - for (int index = array.Length; index > 0; index--) - { - int j = random.Next(index); - int k = array[j]; - array[j] = array[index - 1]; - array[index - 1] = k; - } - return array; - } - #endregion - #region OreSpawn public static void SpawnOre(int type, double frequency, float depth, float depthLimit) { @@ -3258,7 +3218,7 @@ namespace CalamityMod.World } Main.tile[k, l].active(true); Main.tile[k, l].type = (ushort)(isVoid ? ModContent.TileType() : ModContent.TileType()); - SafeSquareTileFrame(k, l, true); + CalamityUtils.SafeSquareTileFrame(k, l, true); } } } @@ -3310,7 +3270,7 @@ namespace CalamityMod.World { Main.tile[n, num17].active(true); Main.tile[n, num17].type = (ushort)num16; - SafeSquareTileFrame(n, num17, true); + CalamityUtils.SafeSquareTileFrame(n, num17, true); } } } @@ -3342,7 +3302,7 @@ namespace CalamityMod.World { Main.tile[n, num17].active(true); Main.tile[n, num17].type = (ushort)num16; - SafeSquareTileFrame(n, num17, true); + CalamityUtils.SafeSquareTileFrame(n, num17, true); } } } @@ -3414,7 +3374,7 @@ namespace CalamityMod.World if (Math.Sqrt((double)(arg_890_0 * arg_890_0 + num29 * num29)) < (double)num25) { Main.tile[num27, num28].type = (ushort)num26; - SafeSquareTileFrame(num27, num28, true); + CalamityUtils.SafeSquareTileFrame(num27, num28, true); } } } @@ -3463,21 +3423,21 @@ namespace CalamityMod.World Main.tile[num37, num35].active(false); Main.tile[num37, num35].liquid = 255; Main.tile[num37, num35].lava(false); - SafeSquareTileFrame(num34, num35, true); + CalamityUtils.SafeSquareTileFrame(num34, num35, true); } if (Main.tile[num37, num35 + 1].type == (ushort)(isVoid ? ModContent.TileType() : ModContent.TileType())) { Main.tile[num37, num35 + 1].active(false); Main.tile[num37, num35 + 1].liquid = 255; Main.tile[num37, num35 + 1].lava(false); - SafeSquareTileFrame(num34, num35 + 1, true); + CalamityUtils.SafeSquareTileFrame(num34, num35 + 1, true); } if (num37 > num34 - num36 && num37 < num34 + 2 && Main.tile[num37, num35 + 2].type == (ushort)(isVoid ? ModContent.TileType() : ModContent.TileType())) { Main.tile[num37, num35 + 2].active(false); Main.tile[num37, num35 + 2].liquid = 255; Main.tile[num37, num35 + 2].lava(false); - SafeSquareTileFrame(num34, num35 + 2, true); + CalamityUtils.SafeSquareTileFrame(num34, num35 + 2, true); } } } @@ -3486,7 +3446,7 @@ namespace CalamityMod.World Main.tile[num34, num35].liquid = 255; } Main.tile[num34, num35].lava(false); - SafeSquareTileFrame(num34, num35, true); + CalamityUtils.SafeSquareTileFrame(num34, num35, true); } } }