forked from blushiemagic/MagicStorage
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathBlockRecipes.cs
More file actions
32 lines (30 loc) · 804 Bytes
/
BlockRecipes.cs
File metadata and controls
32 lines (30 loc) · 804 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
using System;
using System.Collections.Generic;
using Terraria;
using Terraria.DataStructures;
using Terraria.ModLoader;
namespace MagicStorage
{
public class BlockRecipes : GlobalRecipe
{
public static bool active = true;
public override bool RecipeAvailable(Recipe recipe)
{
if (!active)
{
return true;
}
try
{
Player player = Main.player[Main.myPlayer];
StoragePlayer modPlayer = player.GetModPlayer<StoragePlayer>();
Point16 storageAccess = modPlayer.ViewingStorage();
return storageAccess.X < 0 || storageAccess.Y < 0;
}
catch
{
return true;
}
}
}
}