Skip to content

Commit e0ffeed

Browse files
committed
Updated to tModLoader v0.11.5
1 parent dad0df7 commit e0ffeed

File tree

9 files changed

+20
-21
lines changed

9 files changed

+20
-21
lines changed

BlockRecipes.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ public override bool RecipeAvailable(Recipe recipe)
1919
try
2020
{
2121
Player player = Main.player[Main.myPlayer];
22-
StoragePlayer modPlayer = player.GetModPlayer<StoragePlayer>(mod);
22+
StoragePlayer modPlayer = player.GetModPlayer<StoragePlayer>();
2323
Point16 storageAccess = modPlayer.ViewingStorage();
2424
return storageAccess.X < 0 || storageAccess.Y < 0;
2525
}

Components/RemoteAccess.cs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ public override TEStorageHeart GetHeart(int i, int j)
3434
return ((TERemoteAccess)ent).GetHeart();
3535
}
3636

37-
public override void RightClick(int i, int j)
37+
public override bool NewRightClick(int i, int j)
3838
{
3939
Player player = Main.player[Main.myPlayer];
4040
Item item = player.inventory[player.selectedItem];
@@ -48,7 +48,6 @@ public override void RightClick(int i, int j)
4848
{
4949
j--;
5050
}
51-
player.tileInteractionHappened = true;
5251
TERemoteAccess ent = (TERemoteAccess)TileEntity.ByPosition[new Point16(i, j)];
5352
Locator locator = (Locator)item.modItem;
5453
string message;
@@ -68,10 +67,11 @@ public override void RightClick(int i, int j)
6867
Main.mouseItem = item.Clone();
6968
}
7069
Main.NewText(message);
70+
return true;
7171
}
7272
else
7373
{
74-
base.RightClick(i, j);
74+
return base.NewRightClick(i, j);
7575
}
7676
}
7777
}

Components/StorageAccess.cs

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ public override void MouseOver(int i, int j)
4848
player.noThrow = 2;
4949
}
5050

51-
public override void RightClick(int i, int j)
51+
public override bool NewRightClick(int i, int j)
5252
{
5353
if (Main.tile[i, j].frameX % 36 == 18)
5454
{
@@ -61,12 +61,10 @@ public override void RightClick(int i, int j)
6161
Player player = Main.player[Main.myPlayer];
6262
if (GetHeart(i, j) == null)
6363
{
64-
player.tileInteractionHappened = true;
6564
Main.NewText("This access is not connected to a Storage Heart!");
66-
return;
65+
return true;
6766
}
68-
StoragePlayer modPlayer = player.GetModPlayer<StoragePlayer>(mod);
69-
player.tileInteractionHappened = true;
67+
StoragePlayer modPlayer = player.GetModPlayer<StoragePlayer>();
7068
Main.mouseRightRelease = false;
7169
if (player.sign > -1)
7270
{
@@ -117,6 +115,7 @@ public override void RightClick(int i, int j)
117115
Main.PlaySound(hadChestOpen || hadOtherOpen ? 12 : 10, -1, -1, 1);
118116
Recipe.FindRecipes();
119117
}
118+
return true;
120119
}
121120

122121
public override void PostDraw(int i, int j, SpriteBatch spriteBatch)

Components/StorageHeart.cs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ public override TEStorageHeart GetHeart(int i, int j)
3333
return (TEStorageHeart)TileEntity.ByPosition[new Point16(i, j)];
3434
}
3535

36-
public override void RightClick(int i, int j)
36+
public override bool NewRightClick(int i, int j)
3737
{
3838
Player player = Main.player[Main.myPlayer];
3939
Item item = player.inventory[player.selectedItem];
@@ -47,18 +47,18 @@ public override void RightClick(int i, int j)
4747
{
4848
j--;
4949
}
50-
player.tileInteractionHappened = true;
5150
Locator locator = (Locator)item.modItem;
5251
locator.location = new Point16(i, j);
5352
if (player.selectedItem == 58)
5453
{
5554
Main.mouseItem = item.Clone();
5655
}
5756
Main.NewText("Locator successfully set to: X=" + i + ", Y=" + j);
57+
return true;
5858
}
5959
else
6060
{
61-
base.RightClick(i, j);
61+
return base.NewRightClick(i, j);
6262
}
6363
}
6464
}

Components/StorageUnit.cs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,7 @@ public override void KillTile(int i, int j, ref bool fail, ref bool effectOnly,
7878
}
7979
}
8080

81-
public override void RightClick(int i, int j)
81+
public override bool NewRightClick(int i, int j)
8282
{
8383
if (Main.tile[i, j].frameX % 36 == 18)
8484
{
@@ -90,14 +90,14 @@ public override void RightClick(int i, int j)
9090
}
9191
if (TryUpgrade(i, j))
9292
{
93-
Main.player[Main.myPlayer].tileInteractionHappened = true;
94-
return;
93+
return true;
9594
}
9695
TEStorageUnit storageUnit = (TEStorageUnit)TileEntity.ByPosition[new Point16(i, j)];
9796
Main.player[Main.myPlayer].tileInteractionHappened = true;
9897
string activeString = storageUnit.Inactive ? "Inactive" : "Active";
9998
string fullnessString = storageUnit.NumItems + " / " + storageUnit.Capacity + " Items";
10099
Main.NewText(activeString + ", " + fullnessString);
100+
return base.NewRightClick(i, j);
101101
}
102102

103103
private bool TryUpgrade(int i, int j)

CraftingGUI.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -425,7 +425,7 @@ public static void Update(GameTime gameTime)
425425
{try{
426426
oldMouse = StorageGUI.oldMouse;
427427
curMouse = StorageGUI.curMouse;
428-
if (Main.playerInventory && Main.player[Main.myPlayer].GetModPlayer<StoragePlayer>(MagicStorage.Instance).ViewingStorage().X >= 0 && StoragePlayer.IsStorageCrafting())
428+
if (Main.playerInventory && Main.player[Main.myPlayer].GetModPlayer<StoragePlayer>().ViewingStorage().X >= 0 && StoragePlayer.IsStorageCrafting())
429429
{
430430
if (curMouse.RightButton == ButtonState.Released)
431431
{
@@ -453,7 +453,7 @@ public static void Update(GameTime gameTime)
453453
public static void Draw(TEStorageHeart heart)
454454
{try{
455455
Player player = Main.player[Main.myPlayer];
456-
StoragePlayer modPlayer = player.GetModPlayer<StoragePlayer>(MagicStorage.Instance);
456+
StoragePlayer modPlayer = player.GetModPlayer<StoragePlayer>();
457457
Initialize();
458458
if (Main.mouseX > panelLeft && Main.mouseX < recipeLeft + panelWidth && Main.mouseY > panelTop && Main.mouseY < panelTop + panelHeight)
459459
{

InterfaceHelper.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ public static void ModifyInterfaceLayers(List<GameInterfaceLayer> layers)
3434
public static bool DrawStorageGUI()
3535
{
3636
Player player = Main.player[Main.myPlayer];
37-
StoragePlayer modPlayer = player.GetModPlayer<StoragePlayer>(MagicStorage.Instance);
37+
StoragePlayer modPlayer = player.GetModPlayer<StoragePlayer>();
3838
Point16 storageAccess = modPlayer.ViewingStorage();
3939
if (!Main.playerInventory || storageAccess.X < 0 || storageAccess.Y < 0)
4040
{

Items/PortableAccess.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,7 @@ public override bool UseItem(Player player)
6767

6868
private void OpenStorage(Player player)
6969
{
70-
StoragePlayer modPlayer = player.GetModPlayer<StoragePlayer>(mod);
70+
StoragePlayer modPlayer = player.GetModPlayer<StoragePlayer>();
7171
if (player.sign > -1)
7272
{
7373
Main.PlaySound(11, -1, -1, 1);

StorageGUI.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -241,7 +241,7 @@ public static void Update(GameTime gameTime)
241241
{
242242
oldMouse = curMouse;
243243
curMouse = Mouse.GetState();
244-
if (Main.playerInventory && Main.player[Main.myPlayer].GetModPlayer<StoragePlayer>(MagicStorage.Instance).ViewingStorage().X >= 0 && !StoragePlayer.IsStorageCrafting())
244+
if (Main.playerInventory && Main.player[Main.myPlayer].GetModPlayer<StoragePlayer>().ViewingStorage().X >= 0 && !StoragePlayer.IsStorageCrafting())
245245
{
246246
if (StorageGUI.curMouse.RightButton == ButtonState.Released)
247247
{
@@ -263,7 +263,7 @@ public static void Update(GameTime gameTime)
263263
public static void Draw(TEStorageHeart heart)
264264
{
265265
Player player = Main.player[Main.myPlayer];
266-
StoragePlayer modPlayer = player.GetModPlayer<StoragePlayer>(MagicStorage.Instance);
266+
StoragePlayer modPlayer = player.GetModPlayer<StoragePlayer>();
267267
Initialize();
268268
if (Main.mouseX > panelLeft && Main.mouseX < panelLeft + panelWidth && Main.mouseY > panelTop && Main.mouseY < panelTop + panelHeight)
269269
{

0 commit comments

Comments
 (0)