Skip to content

Commit

Permalink
Actually fix ExampleDoorOpen
Browse files Browse the repository at this point in the history
  • Loading branch information
JavidPack committed Apr 23, 2024
1 parent 619557d commit baf29e9
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions ExampleMod/Content/Tiles/Furniture/ExampleDoorOpen.cs
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@
using ExampleMod.Content.Items.Placeable.Furniture;
using Microsoft.Xna.Framework;
using Terraria;
using Terraria.DataStructures;
using Terraria.Enums;
using Terraria.GameContent.ObjectInteractions;
using Terraria.ID;
using Terraria.Localization;
Expand Down Expand Up @@ -35,9 +37,8 @@ public class ExampleDoorOpen : ModTile
AddMapEntry(new Color(200, 200, 200), Language.GetText("MapObject.Door"));

// Placement
// In addition to copying from the TileObjectData.Something templates, modders can copy from specific tile types. CopyFrom won't copy subtile data, so style specific properties won't be copied, such as how Obsidian doors are immune to lava.
TileObjectData.newTile.CopyFrom(TileObjectData.GetTileData(TileID.OpenDoor, 0));
/* This is what is copied from the OpenDoor tile
// The TileID.OpenDoor TileObjectData is incorrect, as they sometimes are, so we will not be copying from it in this case
// TileObjectData.newTile.CopyFrom(TileObjectData.GetTileData(TileID.OpenDoor, 0));
TileObjectData.newTile.Width = 2;
TileObjectData.newTile.Height = 3;
TileObjectData.newTile.Origin = new Point16(0, 0);
Expand All @@ -48,9 +49,9 @@ public class ExampleDoorOpen : ModTile
TileObjectData.newTile.CoordinateHeights = new[] { 16, 16, 16 };
TileObjectData.newTile.CoordinateWidth = 16;
TileObjectData.newTile.CoordinatePadding = 2;
TileObjectData.newTile.StyleHorizontal = false;
TileObjectData.newTile.StyleWrapLimit = 36;
TileObjectData.newTile.StyleLineSkip = 2;
TileObjectData.newTile.StyleHorizontal = true;
TileObjectData.newTile.StyleMultiplier = 2;
TileObjectData.newTile.StyleWrapLimit = 2; // Since the wrap limit is 2, a 2nd style will be below the first on the spritesheet even though this is StyleHorizontal = true
TileObjectData.newTile.Direction = TileObjectDirection.PlaceRight;
TileObjectData.newAlternate.CopyFrom(TileObjectData.newTile);
TileObjectData.newAlternate.Origin = new Point16(0, 1);
Expand All @@ -76,7 +77,6 @@ public class ExampleDoorOpen : ModTile
TileObjectData.newAlternate.AnchorBottom = new AnchorData(AnchorType.SolidTile, 1, 1);
TileObjectData.newAlternate.Direction = TileObjectDirection.PlaceLeft;
TileObjectData.addAlternate(1);
*/
TileObjectData.addTile(Type);
}

Expand Down

0 comments on commit baf29e9

Please sign in to comment.