Drop() public method

public Drop ( int i, int j ) : bool
i int
j int
return bool
Beispiel #1
0
        //in Terraria.WorldGen.KillTile before if statements checking num49 and num50
        //  add bool vanillaDrop = TileLoader.Drop(i, j, tile.type);
        //  add "vanillaDrop && " to beginning of these if statements
        public static bool Drop(int i, int j, int type)
        {
            foreach (var hook in HookDrop)
            {
                if (!hook(i, j, type))
                {
                    return(false);
                }
            }
            ModTile modTile = GetTile(type);

            if (modTile != null)
            {
                if (!modTile.Drop(i, j))
                {
                    return(false);
                }
                if (modTile.drop > 0)
                {
                    Item.NewItem(i * 16, j * 16, 16, 16, modTile.drop, 1, false, -1);
                }
                return(false);
            }
            return(true);
        }
Beispiel #2
0
        //in Terraria.WorldGen.KillTile before if statements checking num49 and num50
        //  add bool vanillaDrop = TileLoader.Drop(i, j, tile.type);
        //  add "vanillaDrop && " to beginning of these if statements
        public static bool Drop(int i, int j, int type)
        {
            foreach (GlobalTile globalTile in globalTiles)
            {
                if (!globalTile.Drop(i, j, type))
                {
                    return(false);
                }
            }
            ModTile modTile = GetTile(type);

            if (modTile != null)
            {
                if (!modTile.Drop(i, j))
                {
                    return(false);
                }
                if (modTile.drop > 0)
                {
                    Item.NewItem(i * 16, j * 16, 16, 16, modTile.drop, 1, false, -1, false, false);
                }
                return(false);
            }
            return(true);
        }